From 2b27c68c84b46a763e9ae913641c50ff2520553a Mon Sep 17 00:00:00 2001 From: Nick Fyson Date: Fri, 21 Aug 2020 11:59:11 +0100 Subject: [PATCH 01/35] add exec_wrapper function --- lib/codeql.js | 3 ++- lib/codeql.js.map | 2 +- lib/exec_wrapper.js | 41 +++++++++++++++++++++++++++++++++++++++++ lib/exec_wrapper.js.map | 1 + src/codeql.ts | 3 ++- src/exec_wrapper.ts | 39 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 86 insertions(+), 3 deletions(-) create mode 100644 lib/exec_wrapper.js create mode 100644 lib/exec_wrapper.js.map create mode 100644 src/exec_wrapper.ts diff --git a/lib/codeql.js b/lib/codeql.js index 3c7cf10c8..ac970b209 100644 --- a/lib/codeql.js +++ b/lib/codeql.js @@ -22,6 +22,7 @@ const globalutil = __importStar(require("util")); const v4_1 = __importDefault(require("uuid/v4")); const api = __importStar(require("./api-client")); const defaults = __importStar(require("./defaults.json")); // Referenced from codeql-action-sync-tool! +const exec_wrapper_1 = require("./exec_wrapper"); const util = __importStar(require("./util")); /** * Stores the CodeQL object, and is populated by `setupCodeQL` or `getCodeQL`. @@ -298,7 +299,7 @@ function getCodeQLForCmd(cmd) { ]); }, finalizeDatabase: async function (databasePath) { - await exec.exec(cmd, [ + await exec_wrapper_1.exec_wrapper(cmd, [ 'database', 'finalize', ...getExtraOptionsFromEnv(['database', 'finalize']), diff --git a/lib/codeql.js.map b/lib/codeql.js.map index 9856e6957..2f12f0571 100644 --- a/lib/codeql.js.map +++ b/lib/codeql.js.map @@ -1 +1 @@ -{"version":3,"file":"codeql.js","sourceRoot":"","sources":["../src/codeql.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsC;AACtC,oDAAsC;AACtC,2DAA6C;AAE7C,+DAAiD;AACjD,uCAAyB;AACzB,2CAA6B;AAC7B,+CAAiC;AACjC,+CAAiC;AACjC,iDAAmC;AACnC,iDAA6B;AAE7B,kDAAoC;AACpC,0DAA4C,CAAC,2CAA2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,CAAC,GAAG,CAAC,CAAC;aACtB;YACD,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC;IACD,IAAI,GAAG,GAAG,cAAc,OAAC,OAAO,0CAAG,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/D,IAAI,QAAQ,GAAG,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;QAChC,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;QACnC,eAAe,OAAC,OAAO,0CAAG,IAAI,CAAC,CAAC,CAAC,SAAG,IAAI,0CAAE,KAAK,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChF,OAAO,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC9B,CAAC;AAjCD,0CAiCC"} \ No newline at end of file diff --git a/lib/exec_wrapper.js b/lib/exec_wrapper.js new file mode 100644 index 000000000..cabf03f5e --- /dev/null +++ b/lib/exec_wrapper.js @@ -0,0 +1,41 @@ +"use strict"; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const exec = __importStar(require("@actions/exec")); +async function exec_wrapper(commandLine, args, options) { + var _a; + const originalListener = (_a = options) === null || _a === void 0 ? void 0 : _a.listeners; + let stdout = ''; + let stderr = ''; + let listeners = { + stdout: (data) => { + var _a, _b, _c; + stdout += data.toString(); + // NB change behaviour to only write to stdout/err if no listener passed + process.stdout.write(data); + (_c = (_a = originalListener) === null || _a === void 0 ? void 0 : (_b = _a).stdout) === null || _c === void 0 ? void 0 : _c.call(_b, data); + }, + stderr: (data) => { + var _a, _b, _c; + stderr += data.toString(); + process.stderr.write(data); + (_c = (_a = originalListener) === null || _a === void 0 ? void 0 : (_b = _a).stderr) === null || _c === void 0 ? void 0 : _c.call(_b, data); + } + }; + const returnCode = await exec.exec(commandLine, args, { + listeners: listeners, + ...options + }); + if (stderr === stdout) { + console.log('foo bar'); + } + return returnCode; +} +exports.exec_wrapper = exec_wrapper; +//# sourceMappingURL=exec_wrapper.js.map \ No newline at end of file diff --git a/lib/exec_wrapper.js.map b/lib/exec_wrapper.js.map new file mode 100644 index 000000000..a05333309 --- /dev/null +++ b/lib/exec_wrapper.js.map @@ -0,0 +1 @@ +{"version":3,"file":"exec_wrapper.js","sourceRoot":"","sources":["../src/exec_wrapper.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAAsC;AAG/B,KAAK,UAAU,YAAY,CAAC,WAAmB,EAAE,IAAe,EAAE,OAAwB;;IAE/F,MAAM,gBAAgB,SAAG,OAAO,0CAAE,SAAS,CAAC;IAE5C,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,IAAI,SAAS,GAAG;QACd,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;;YACvB,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,wEAAwE;YACxE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC3B,YAAA,gBAAgB,iDAAE,MAAM,mDAAG,IAAI,EAAE;QACnC,CAAC;QACD,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;;YACvB,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC3B,YAAA,gBAAgB,iDAAE,MAAM,mDAAG,IAAI,EAAE;QACnC,CAAC;KACF,CAAC;IAEF,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,IAAI,CAChC,WAAW,EACX,IAAI,EACJ;QACE,SAAS,EAAE,SAAS;QACpB,GAAG,OAAO;KACX,CAAC,CAAC;IAEL,IAAI,MAAM,KAAK,MAAM,EAAG;QACtB,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;KACxB;IAED,OAAO,UAAU,CAAC;AAEpB,CAAC;AAnCD,oCAmCC"} \ No newline at end of file diff --git a/src/codeql.ts b/src/codeql.ts index ddf93aed8..745c60550 100644 --- a/src/codeql.ts +++ b/src/codeql.ts @@ -12,6 +12,7 @@ import uuidV4 from 'uuid/v4'; import * as api from './api-client'; import * as defaults from './defaults.json'; // Referenced from codeql-action-sync-tool! +import { exec_wrapper } from './exec_wrapper'; import { Language } from './languages'; import * as util from './util'; @@ -390,7 +391,7 @@ function getCodeQLForCmd(cmd: string): CodeQL { ]); }, finalizeDatabase: async function(databasePath: string) { - await exec.exec(cmd, [ + await exec_wrapper(cmd, [ 'database', 'finalize', ...getExtraOptionsFromEnv(['database', 'finalize']), diff --git a/src/exec_wrapper.ts b/src/exec_wrapper.ts new file mode 100644 index 000000000..6ddbad7d5 --- /dev/null +++ b/src/exec_wrapper.ts @@ -0,0 +1,39 @@ +import * as exec from '@actions/exec'; +import * as im from '@actions/exec/lib/interfaces'; + +export async function exec_wrapper(commandLine: string, args?: string[], options?: im.ExecOptions): Promise { + + const originalListener = options?.listeners; + + let stdout = ''; + let stderr = ''; + + let listeners = { + stdout: (data: Buffer) => { + stdout += data.toString(); + // NB change behaviour to only write to stdout/err if no listener passed + process.stdout.write(data); + originalListener?.stdout?.(data); + }, + stderr: (data: Buffer) => { + stderr += data.toString(); + process.stderr.write(data); + originalListener?.stderr?.(data); + } + }; + + const returnCode = await exec.exec( + commandLine, + args, + { + listeners: listeners, + ...options + }); + + if (stderr === stdout ) { + console.log('foo bar'); + } + + return returnCode; + +} From 45e00a8e6a7f779537ae616786aa4a7864674687 Mon Sep 17 00:00:00 2001 From: Nick Fyson Date: Mon, 24 Aug 2020 18:35:22 +0100 Subject: [PATCH 02/35] match existing behaviour when custom listeners defined --- lib/exec_wrapper.js | 23 ++++++++++++++++------- lib/exec_wrapper.js.map | 2 +- src/exec_wrapper.ts | 18 +++++++++++++----- 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/lib/exec_wrapper.js b/lib/exec_wrapper.js index cabf03f5e..4d1ee6f27 100644 --- a/lib/exec_wrapper.js +++ b/lib/exec_wrapper.js @@ -15,17 +15,26 @@ async function exec_wrapper(commandLine, args, options) { let stderr = ''; let listeners = { stdout: (data) => { - var _a, _b, _c; + var _a; stdout += data.toString(); - // NB change behaviour to only write to stdout/err if no listener passed - process.stdout.write(data); - (_c = (_a = originalListener) === null || _a === void 0 ? void 0 : (_b = _a).stdout) === null || _c === void 0 ? void 0 : _c.call(_b, data); + if (((_a = originalListener) === null || _a === void 0 ? void 0 : _a.stdout) !== undefined) { + originalListener.stdout(data); + } + else { + // if no stdout listener was originally defined then match behaviour of exec.exec + process.stdout.write(data); + } }, stderr: (data) => { - var _a, _b, _c; + var _a; stderr += data.toString(); - process.stderr.write(data); - (_c = (_a = originalListener) === null || _a === void 0 ? void 0 : (_b = _a).stderr) === null || _c === void 0 ? void 0 : _c.call(_b, data); + if (((_a = originalListener) === null || _a === void 0 ? void 0 : _a.stderr) !== undefined) { + originalListener.stderr(data); + } + else { + // if no stderr listener was originally defined then match behaviour of exec.exec + process.stderr.write(data); + } } }; const returnCode = await exec.exec(commandLine, args, { diff --git a/lib/exec_wrapper.js.map b/lib/exec_wrapper.js.map index a05333309..9782a3592 100644 --- a/lib/exec_wrapper.js.map +++ b/lib/exec_wrapper.js.map @@ -1 +1 @@ -{"version":3,"file":"exec_wrapper.js","sourceRoot":"","sources":["../src/exec_wrapper.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAAsC;AAG/B,KAAK,UAAU,YAAY,CAAC,WAAmB,EAAE,IAAe,EAAE,OAAwB;;IAE/F,MAAM,gBAAgB,SAAG,OAAO,0CAAE,SAAS,CAAC;IAE5C,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI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B,0CAAE,MAAM,MAAK,SAAS,EAAE;gBAC1C,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aAC/B;iBAAM;gBACL,iFAAiF;gBACjF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;aAC5B;QAEH,CAAC;QACD,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;;YACvB,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,IAAI,OAAA,gBAAgB,0CAAE,MAAM,MAAK,SAAS,EAAE;gBAC1C,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aAC/B;iBAAM;gBACL,iFAAiF;gBACjF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;aAC5B;QACH,CAAC;KACF,CAAC;IAEF,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,IAAI,CAChC,WAAW,EACX,IAAI,EACJ;QACE,SAAS,EAAE,SAAS;QACpB,GAAG,OAAO;KACX,CAAC,CAAC;IAEL,IAAI,MAAM,KAAK,MAAM,EAAG;QACtB,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;KACxB;IAED,OAAO,UAAU,CAAC;AAEpB,CAAC;AA3CD,oCA2CC"} \ No newline at end of file diff --git a/src/exec_wrapper.ts b/src/exec_wrapper.ts index 6ddbad7d5..484e64121 100644 --- a/src/exec_wrapper.ts +++ b/src/exec_wrapper.ts @@ -11,14 +11,22 @@ export async function exec_wrapper(commandLine: string, args?: string[], options let listeners = { stdout: (data: Buffer) => { stdout += data.toString(); - // NB change behaviour to only write to stdout/err if no listener passed - process.stdout.write(data); - originalListener?.stdout?.(data); + if (originalListener?.stdout !== undefined) { + originalListener.stdout(data); + } else { + // if no stdout listener was originally defined then match behaviour of exec.exec + process.stdout.write(data); + } + }, stderr: (data: Buffer) => { stderr += data.toString(); - process.stderr.write(data); - originalListener?.stderr?.(data); + if (originalListener?.stderr !== undefined) { + originalListener.stderr(data); + } else { + // if no stderr listener was originally defined then match behaviour of exec.exec + process.stderr.write(data); + } } }; From cd22abcda8a8331d862f9896e7048696d8bb74a2 Mon Sep 17 00:00:00 2001 From: Nick Fyson Date: Mon, 24 Aug 2020 20:49:58 +0100 Subject: [PATCH 03/35] add example regex match for stdout/err string --- .github/workflows/cli.yml | 2 +- .github/workflows/codeql.yml | 2 +- .github/workflows/integration-testing.yml | 313 ++++++++++++---------- .github/workflows/pr-checks.yml | 2 +- lib/exec_wrapper.js | 27 +- lib/exec_wrapper.js.map | 2 +- src/exec_wrapper.ts | 36 ++- 7 files changed, 227 insertions(+), 157 deletions(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 1ce2fbfc4..189ac7d1e 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -1,6 +1,6 @@ name: "CodeScanning CLI" -on: [push, pull_request] +on: [pull_request] jobs: build: diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index dbf82c60d..944484407 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,6 +1,6 @@ name: "CodeQL action" -on: [push, pull_request] +on: [pull_request] jobs: build: diff --git a/.github/workflows/integration-testing.yml b/.github/workflows/integration-testing.yml index b805489eb..85fafe8e7 100644 --- a/.github/workflows/integration-testing.yml +++ b/.github/workflows/integration-testing.yml @@ -3,150 +3,191 @@ name: "Integration Testing" on: [push, pull_request] jobs: - multi-language-repo_test-autodetect-languages: - runs-on: ubuntu-latest + # multi-language-repo_test-autodetect-languages: + # runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Move codeql-action - shell: bash - run: | - mkdir ../action - mv * .github ../action/ - mv ../action/tests/multi-language-repo/{*,.github} . - - uses: ./../action/init - - name: Build code - shell: bash - run: ./build.sh - - uses: ./../action/analyze - env: - TEST_MODE: true - - run: | - cd "$RUNNER_TEMP/codeql_databases" - # List all directories as there will be precisely one directory per database - # but there may be other files in this directory such as query suites. - if [ "$(ls -d */ | wc -l)" != 6 ] || \ - [[ ! -d cpp ]] || \ - [[ ! -d csharp ]] || \ - [[ ! -d go ]] || \ - [[ ! -d java ]] || \ - [[ ! -d javascript ]] || \ - [[ ! -d python ]]; then - echo "Did not find expected number of databases. Database dir contains: $(ls)" - exit 1 - fi + # steps: + # - uses: actions/checkout@v2 + # - name: Move codeql-action + # shell: bash + # run: | + # mkdir ../action + # mv * .github ../action/ + # mv ../action/tests/multi-language-repo/{*,.github} . + # - uses: ./../action/init + # - name: Build code + # shell: bash + # run: ./build.sh + # - uses: ./../action/analyze + # env: + # TEST_MODE: true + # - run: | + # cd "$RUNNER_TEMP/codeql_databases" + # # List all directories as there will be precisely one directory per database + # # but there may be other files in this directory such as query suites. + # if [ "$(ls -d */ | wc -l)" != 6 ] || \ + # [[ ! -d cpp ]] || \ + # [[ ! -d csharp ]] || \ + # [[ ! -d go ]] || \ + # [[ ! -d java ]] || \ + # [[ ! -d javascript ]] || \ + # [[ ! -d python ]]; then + # echo "Did not find expected number of databases. Database dir contains: $(ls)" + # exit 1 + # fi - multi-language-repo_test-custom-queries-and-remote-config: - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - runs-on: ${{ matrix.os }} + # multi-language-repo_test-custom-queries-and-remote-config: + # strategy: + # fail-fast: false + # matrix: + # os: [ubuntu-latest, windows-latest, macos-latest] + # runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v2 - - name: Move codeql-action - shell: bash - run: | - mkdir ../action - mv * .github ../action/ - mv ../action/tests/multi-language-repo/{*,.github} . - - uses: ./../action/init - with: - languages: cpp,csharp,java,javascript,python - config-file: github/codeql-action/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{ github.sha }} - - name: Build code - shell: bash - run: ./build.sh - - uses: ./../action/analyze - env: - TEST_MODE: true + # steps: + # - uses: actions/checkout@v2 + # - name: Move codeql-action + # shell: bash + # run: | + # mkdir ../action + # mv * .github ../action/ + # mv ../action/tests/multi-language-repo/{*,.github} . + # - uses: ./../action/init + # with: + # languages: cpp,csharp,java,javascript,python + # config-file: github/codeql-action/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{ github.sha }} + # - name: Build code + # shell: bash + # run: ./build.sh + # - uses: ./../action/analyze + # env: + # TEST_MODE: true - # Currently is not possible to analyze Go in conjunction with other languages in macos - multi-language-repo_test-go-custom-queries: - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - runs-on: ${{ matrix.os }} + # # Currently is not possible to analyze Go in conjunction with other languages in macos + # multi-language-repo_test-go-custom-queries: + # strategy: + # fail-fast: false + # matrix: + # os: [ubuntu-latest, windows-latest, macos-latest] + # runs-on: ${{ matrix.os }} - steps: - - uses: actions/setup-go@v2 - if: ${{ matrix.os == 'macos-latest' }} - with: - go-version: '^1.13.1' - - uses: actions/checkout@v2 - - name: Move codeql-action - shell: bash - run: | - mkdir ../action - mv * .github ../action/ - mv ../action/tests/multi-language-repo/{*,.github} . - - uses: ./../action/init - with: - languages: go - config-file: ./.github/codeql/custom-queries.yml - - name: Build code - shell: bash - run: ./build.sh - - uses: ./../action/analyze - env: - TEST_MODE: true + # steps: + # - uses: actions/setup-go@v2 + # if: ${{ matrix.os == 'macos-latest' }} + # with: + # go-version: '^1.13.1' + # - uses: actions/checkout@v2 + # - name: Move codeql-action + # shell: bash + # run: | + # mkdir ../action + # mv * .github ../action/ + # mv ../action/tests/multi-language-repo/{*,.github} . + # - uses: ./../action/init + # with: + # languages: go + # config-file: ./.github/codeql/custom-queries.yml + # - name: Build code + # shell: bash + # run: ./build.sh + # - uses: ./../action/analyze + # env: + # TEST_MODE: true + + # multi-language-repo_rubocop: + # runs-on: ubuntu-latest - multi-language-repo_rubocop: + # steps: + # - uses: actions/checkout@v2 + # - name: Move codeql-action + # shell: bash + # run: | + # mkdir ../action + # mv * .github ../action/ + # mv ../action/tests/multi-language-repo/{*,.github} . + # - name: Set up Ruby + # uses: ruby/setup-ruby@v1 + # with: + # ruby-version: 2.6 + # - name: Install Code Scanning integration + # run: bundle add code-scanning-rubocop --version 0.3.0 --skip-install + # - name: Install dependencies + # run: bundle install + # - name: Rubocop run + # run: | + # bash -c " + # bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif + # [[ $? -ne 2 ]] + # " + # - uses: ./../action/upload-sarif + # with: + # sarif_file: rubocop.sarif + # env: + # TEST_MODE: true + + # test-proxy: + # runs-on: ubuntu-latest + # container: + # image: ubuntu:18.04 + # options: --dns 127.0.0.1 + # services: + # squid-proxy: + # image: datadog/squid:latest + # ports: + # - 3128:3128 + # env: + # https_proxy: http://squid-proxy:3128 + # steps: + # - uses: actions/checkout@v2 + # - name: Move codeql-action + # shell: bash + # run: | + # mkdir ../action + # mv * .github ../action/ + # mv ../action/tests/multi-language-repo/{*,.github} . + # - uses: ./../action/init + # with: + # languages: javascript + # - uses: ./../action/analyze + # env: + # TEST_MODE: true + + +# Test the behaviour when asked to scan a compiled language but no code is compiled + java: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Move codeql-action - shell: bash - run: | - mkdir ../action - mv * .github ../action/ - mv ../action/tests/multi-language-repo/{*,.github} . - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 2.6 - - name: Install Code Scanning integration - run: bundle add code-scanning-rubocop --version 0.3.0 --skip-install - - name: Install dependencies - run: bundle install - - name: Rubocop run - run: | - bash -c " - bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif - [[ $? -ne 2 ]] - " - - uses: ./../action/upload-sarif - with: - sarif_file: rubocop.sarif - env: - TEST_MODE: true - - test-proxy: + - uses: actions/checkout@v2 + - name: Move codeql-action + shell: bash + run: | + mkdir ../action + shopt -s dotglob + mv * ../action/ + # Do not copy anything back, so there's nothing left to scan + - uses: ./../action/init + with: + languages: java + - uses: ./../action/analyze + env: + TEST_MODE: true + + # Test the behaviour when asked to scan a non-compiled language but there is no code to scan + javascript: runs-on: ubuntu-latest - container: - image: ubuntu:18.04 - options: --dns 127.0.0.1 - services: - squid-proxy: - image: datadog/squid:latest - ports: - - 3128:3128 - env: - https_proxy: http://squid-proxy:3128 + steps: - - uses: actions/checkout@v2 - - name: Move codeql-action - shell: bash - run: | - mkdir ../action - mv * .github ../action/ - mv ../action/tests/multi-language-repo/{*,.github} . - - uses: ./../action/init - with: - languages: javascript - - uses: ./../action/analyze - env: - TEST_MODE: true + - uses: actions/checkout@v2 + - name: Move codeql-action + shell: bash + run: | + mkdir ../action + shopt -s dotglob + mv * ../action/ + # Do not copy anything back, so there's nothing left to scan + - uses: ./../action/init + with: + languages: javascript + - uses: ./../action/analyze + env: + TEST_MODE: true diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index fb30c74a7..c952c5255 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -1,6 +1,6 @@ name: "PR checks" -on: [push, pull_request] +on: [pull_request] jobs: tslint: diff --git a/lib/exec_wrapper.js b/lib/exec_wrapper.js index 4d1ee6f27..b1cd829eb 100644 --- a/lib/exec_wrapper.js +++ b/lib/exec_wrapper.js @@ -37,12 +37,27 @@ async function exec_wrapper(commandLine, args, options) { } } }; - const returnCode = await exec.exec(commandLine, args, { - listeners: listeners, - ...options - }); - if (stderr === stdout) { - console.log('foo bar'); + let returnCode; + try { + returnCode = await exec.exec(commandLine, args, { + listeners: listeners, + ...options + }); + } + catch (e) { + returnCode = 1; + } + if (returnCode === 0) { + throw new Error('The exit code was ' + returnCode + '?!'); + } + const regex = new RegExp("(No source code was seen during the build\\.|No JavaScript or TypeScript code found\\.)"); + if (regex.test(stderr) || regex.test(stdout)) { + throw new Error(`No source code was found. This can occur if the specified build commands failed to compile or process any code. + - Confirm that there is some source code for the specified language in the project. + - For codebases written in Go, JavaScript, TypeScript, and Python, do not specify + an explicit --command. + - For other languages, the --command must specify a "clean" build which compiles + https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning`); } return returnCode; } diff --git a/lib/exec_wrapper.js.map b/lib/exec_wrapper.js.map index 9782a3592..abc1307a2 100644 --- a/lib/exec_wrapper.js.map +++ b/lib/exec_wrapper.js.map @@ -1 +1 @@ -{"version":3,"file":"exec_wrapper.js","sourceRoot":"","sources":["../src/exec_wrapper.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAAsC;AAG/B,KAAK,UAAU,YAAY,CAAC,WAAmB,EAAE,IAAe,EAAE,OAAwB;;IAE/F,MAAM,gBAAgB,SAAG,OAAO,0CAAE,SAAS,CAAC;IAE5C,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,IAAI,SAAS,GAAG;QACd,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;;YACvB,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,IAAI,OAAA,gBAAgB,0CAAE,MAAM,MAAK,SAAS,EAAE;gBAC1C,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aAC/B;iBAAM;gBACL,iFAAiF;gBACjF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;aAC5B;QAEH,CAAC;QACD,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;;YACvB,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,IAAI,OAAA,gBAAgB,0CAAE,MAAM,MAAK,SAAS,EAAE;gBAC1C,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aAC/B;iBAAM;gBACL,iFAAiF;gBACjF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;aAC5B;QACH,CAAC;KACF,CAAC;IAEF,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,IAAI,CAChC,WAAW,EACX,IAAI,EACJ;QACE,SAAS,EAAE,SAAS;QACpB,GAAG,OAAO;KACX,CAAC,CAAC;I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YACpB,GAAG,OAAO;SACX,CAAC,CAAC;KACN;IAAC,OAAO,CAAC,EAAE;QACV,UAAU,GAAG,CAAC,CAAC;KAChB;IACD,IAAI,UAAU,KAAK,CAAC,EAAE;QACpB,MAAM,IAAI,KAAK,CAAC,oBAAoB,GAAG,UAAU,GAAG,IAAI,CAAC,CAAC;KAC3D;IAED,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,yFAAyF,CAAC,CAAC;IAEpH,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAG;QAC7C,MAAM,IAAI,KAAK,CAAC;;;;;yHAKqG,CAAC,CAAC;KACxH;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAzDD,oCAyDC"} \ No newline at end of file diff --git a/src/exec_wrapper.ts b/src/exec_wrapper.ts index 484e64121..3b5690489 100644 --- a/src/exec_wrapper.ts +++ b/src/exec_wrapper.ts @@ -30,18 +30,32 @@ export async function exec_wrapper(commandLine: string, args?: string[], options } }; - const returnCode = await exec.exec( - commandLine, - args, - { - listeners: listeners, - ...options - }); - - if (stderr === stdout ) { - console.log('foo bar'); + let returnCode: number; + try { + returnCode = await exec.exec( + commandLine, + args, + { + listeners: listeners, + ...options + }); + } catch (e) { + returnCode = 1; + } + if (returnCode === 0) { + throw new Error('The exit code was ' + returnCode + '?!'); } - return returnCode; + const regex = new RegExp("(No source code was seen during the build\\.|No JavaScript or TypeScript code found\\.)"); + if (regex.test(stderr) || regex.test(stdout) ) { + throw new Error(`No source code was found. This can occur if the specified build commands failed to compile or process any code. + - Confirm that there is some source code for the specified language in the project. + - For codebases written in Go, JavaScript, TypeScript, and Python, do not specify + an explicit --command. + - For other languages, the --command must specify a "clean" build which compiles + https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning`); + } + + return returnCode; } From 7b7e0e12b7768d6b4b6cfd43bb81a23ad76395f8 Mon Sep 17 00:00:00 2001 From: Nick Fyson Date: Tue, 1 Sep 2020 16:35:08 +0100 Subject: [PATCH 04/35] update error_wrapper to take matcher array --- lib/codeql.js | 2 +- lib/codeql.js.map | 2 +- lib/exec_wrapper.js | 46 ++++++++++++++++++++++++--------------- lib/exec_wrapper.js.map | 2 +- src/codeql.ts | 14 ++++++------ src/exec_wrapper.ts | 48 +++++++++++++++++++++++++---------------- 6 files changed, 70 insertions(+), 44 deletions(-) diff --git a/lib/codeql.js b/lib/codeql.js index ac970b209..369abcbd4 100644 --- a/lib/codeql.js +++ b/lib/codeql.js @@ -304,7 +304,7 @@ function getCodeQLForCmd(cmd) { 'finalize', ...getExtraOptionsFromEnv(['database', 'finalize']), databasePath - ]); + ], [[0, new RegExp("(No source code was seen during the build\\.|No JavaScript or TypeScript code found\\.)"), 'foo bar']]); }, resolveQueries: async function (queries, extraSearchPath) { const codeqlArgs = [ diff --git a/lib/codeql.js.map b/lib/codeql.js.map index 2f12f0571..a5bafa6d8 100644 --- a/lib/codeql.js.map +++ b/lib/codeql.js.map @@ -1 +1 @@ -{"version":3,"file":"codeql.js","sourceRoot":"","sources":["../src/codeql.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsC;AACtC,oDAAsC;AACtC,2DAA6C;AAE7C,+DAAiD;AACjD,uCAAyB;AACzB,2CAA6B;AAC7B,+CAAiC;AACjC,+CAAiC;AACjC,iDAAmC;AACnC,iDAA6B;AAE7B,kDAAoC;AACpC,0DAA4C,CAAC,2CAA2C;AACxF,iDAA8C;AAE9C,6CAA+B;AA8E/B;;;GAGG;AACH,IAAI,YAAY,GAAuB,SAAS,CAAC;AAEjD,MAAM,qBAAqB,GAAG,QAAQ,CAAC,aAAa,CAAC;AACrD,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AAClD,MAAM,gCAAgC,GAAG,sBAAsB,CAAC;AAEhE,SAAS,yBAAyB;IAChC,iDAAiD;IACjD,+EAA+E;IAC/E,+GAA+G;IAC/G,MAAM,UAAU,GAAG,IAA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QAAQ,GAAG,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;QAChC,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;QACnC,eAAe,OAAC,OAAO,0CAAG,IAAI,CAAC,CAAC,CAAC,SAAG,IAAI,0CAAE,KAAK,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChF,OAAO,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC9B,CAAC;AAjCD,0CAiCC"} \ No newline at end of file diff --git a/lib/exec_wrapper.js b/lib/exec_wrapper.js index b1cd829eb..c5cc9f3ac 100644 --- a/lib/exec_wrapper.js +++ b/lib/exec_wrapper.js @@ -8,11 +8,23 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const exec = __importStar(require("@actions/exec")); -async function exec_wrapper(commandLine, args, options) { +/** + * Wrapper for exec.exec which checks for specific return code and/or regex matches in console output. + * Output will be streamed to the live console as well as captured for subsequent processing. + * Returns promise with return code + * + * @param commandLine command to execute (can include additional args). Must be correctly escaped. + * @param matchers defines specific codes and/or regexes that should lead to return of a custom error + * @param args optional arguments for tool. Escaping is handled by the lib. + * @param options optional exec options. See ExecOptions + * @returns Promise exit code + */ +async function exec_wrapper(commandLine, args, matchers, options) { var _a; - const originalListener = (_a = options) === null || _a === void 0 ? void 0 : _a.listeners; let stdout = ''; let stderr = ''; + // custom listeners to store stdout and stderr, while also replicating the behaviour of the passed listeners + const originalListener = (_a = options) === null || _a === void 0 ? void 0 : _a.listeners; let listeners = { stdout: (data) => { var _a; @@ -37,29 +49,29 @@ async function exec_wrapper(commandLine, args, options) { } } }; - let returnCode; + // we capture the original return code and error so that (if no match is found) we can duplicate the behaviour + let originalReturnCode; + let originalError; try { - returnCode = await exec.exec(commandLine, args, { + originalReturnCode = await exec.exec(commandLine, args, { listeners: listeners, ...options }); } catch (e) { - returnCode = 1; - } - if (returnCode === 0) { - throw new Error('The exit code was ' + returnCode + '?!'); + originalError = e; + originalReturnCode = 1; // TODO linter insists, but presumably there's a better way to do _all_ this... } - const regex = new RegExp("(No source code was seen during the build\\.|No JavaScript or TypeScript code found\\.)"); - if (regex.test(stderr) || regex.test(stdout)) { - throw new Error(`No source code was found. This can occur if the specified build commands failed to compile or process any code. - - Confirm that there is some source code for the specified language in the project. - - For codebases written in Go, JavaScript, TypeScript, and Python, do not specify - an explicit --command. - - For other languages, the --command must specify a "clean" build which compiles - https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning`); + if (matchers) { + for (const [customCode, regex, message] of matchers) { + if (customCode === originalReturnCode || regex.test(stderr) || regex.test(stdout)) { + throw new Error(message); + } + } } - return returnCode; + if (originalError) + throw originalError; + return originalReturnCode; } exports.exec_wrapper = exec_wrapper; //# sourceMappingURL=exec_wrapper.js.map \ No newline at end of file diff --git a/lib/exec_wrapper.js.map b/lib/exec_wrapper.js.map index abc1307a2..9992338cb 100644 --- a/lib/exec_wrapper.js.map +++ b/lib/exec_wrapper.js.map @@ -1 +1 @@ -{"version":3,"file":"exec_wrapper.js","sourceRoot":"","sources":["../src/exec_wrapper.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAAsC;AAG/B,KAAK,UAAU,YAAY,CAAC,WAAmB,EAAE,IAAe,EAAE,OAAwB;;IAE/F,MAAM,gBAAgB,SAAG,OAAO,0CAAE,SAAS,CAAC;IAE5C,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,IAAI,SAAS,GAAG;QACd,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;;YACvB,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,IAAI,OAAA,gBAAgB,0CAAE,MAAM,MAAK,SAAS,EAAE;gBAC1C,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aA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AAI,QAAQ,EAAE;YACnD,IAAI,UAAU,KAAK,kBAAkB,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAG;gBAClF,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;aAC1B;SACF;KACF;IAED,IAAI,aAAa;QAAE,MAAM,aAAa,CAAC;IACvC,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAzDD,oCAyDC"} \ No newline at end of file diff --git a/src/codeql.ts b/src/codeql.ts index 745c60550..924935f8b 100644 --- a/src/codeql.ts +++ b/src/codeql.ts @@ -391,12 +391,14 @@ function getCodeQLForCmd(cmd: string): CodeQL { ]); }, finalizeDatabase: async function(databasePath: string) { - await exec_wrapper(cmd, [ - 'database', - 'finalize', - ...getExtraOptionsFromEnv(['database', 'finalize']), - databasePath - ]); + await exec_wrapper( + cmd, [ + 'database', + 'finalize', + ...getExtraOptionsFromEnv(['database', 'finalize']), + databasePath + ], + [[0, new RegExp("(No source code was seen during the build\\.|No JavaScript or TypeScript code found\\.)"), 'foo bar']]); }, resolveQueries: async function(queries: string[], extraSearchPath: string | undefined) { const codeqlArgs = [ diff --git a/src/exec_wrapper.ts b/src/exec_wrapper.ts index 3b5690489..d565461af 100644 --- a/src/exec_wrapper.ts +++ b/src/exec_wrapper.ts @@ -1,13 +1,27 @@ import * as exec from '@actions/exec'; import * as im from '@actions/exec/lib/interfaces'; -export async function exec_wrapper(commandLine: string, args?: string[], options?: im.ExecOptions): Promise { - const originalListener = options?.listeners; +/** + * Wrapper for exec.exec which checks for specific return code and/or regex matches in console output. + * Output will be streamed to the live console as well as captured for subsequent processing. + * Returns promise with return code + * + * @param commandLine command to execute (can include additional args). Must be correctly escaped. + * @param matchers defines specific codes and/or regexes that should lead to return of a custom error + * @param args optional arguments for tool. Escaping is handled by the lib. + * @param options optional exec options. See ExecOptions + * @returns Promise exit code + */ +export async function exec_wrapper(commandLine: string, args?: string[], + matchers?: [[number, RegExp, string]], + options?: im.ExecOptions): Promise { let stdout = ''; let stderr = ''; + // custom listeners to store stdout and stderr, while also replicating the behaviour of the passed listeners + const originalListener = options?.listeners; let listeners = { stdout: (data: Buffer) => { stdout += data.toString(); @@ -30,9 +44,11 @@ export async function exec_wrapper(commandLine: string, args?: string[], options } }; - let returnCode: number; + // we capture the original return code and error so that (if no match is found) we can duplicate the behaviour + let originalReturnCode: number; + let originalError: Error|undefined; try { - returnCode = await exec.exec( + originalReturnCode = await exec.exec( commandLine, args, { @@ -40,22 +56,18 @@ export async function exec_wrapper(commandLine: string, args?: string[], options ...options }); } catch (e) { - returnCode = 1; - } - if (returnCode === 0) { - throw new Error('The exit code was ' + returnCode + '?!'); + originalError = e; + originalReturnCode = 1; // TODO linter insists, but presumably there's a better way to do _all_ this... } - const regex = new RegExp("(No source code was seen during the build\\.|No JavaScript or TypeScript code found\\.)"); - - if (regex.test(stderr) || regex.test(stdout) ) { - throw new Error(`No source code was found. This can occur if the specified build commands failed to compile or process any code. - - Confirm that there is some source code for the specified language in the project. - - For codebases written in Go, JavaScript, TypeScript, and Python, do not specify - an explicit --command. - - For other languages, the --command must specify a "clean" build which compiles - https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning`); + if (matchers) { + for (const [customCode, regex, message] of matchers) { + if (customCode === originalReturnCode || regex.test(stderr) || regex.test(stdout) ) { + throw new Error(message); + } + } } - return returnCode; + if (originalError) throw originalError; + return originalReturnCode; } From 6ef533485ed3acf0d61ba1aba80624d93401cea8 Mon Sep 17 00:00:00 2001 From: Nick Fyson Date: Tue, 1 Sep 2020 16:51:39 +0100 Subject: [PATCH 05/35] wrap more codeql calls in the error catcher wrapper --- lib/codeql.js | 8 ++++---- lib/codeql.js.map | 2 +- src/codeql.ts | 22 +++++++++++++--------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/lib/codeql.js b/lib/codeql.js index 369abcbd4..cb16853cd 100644 --- a/lib/codeql.js +++ b/lib/codeql.js @@ -272,13 +272,13 @@ function getCodeQLForCmd(cmd) { extractScannedLanguage: async function (databasePath, language) { // Get extractor location let extractorPath = ''; - await exec.exec(cmd, [ + await exec_wrapper_1.exec_wrapper(cmd, [ 'resolve', 'extractor', '--format=json', '--language=' + language, ...getExtraOptionsFromEnv(['resolve', 'extractor']), - ], { + ], [[0, new RegExp("(No source code was seen during the build\\.|No JavaScript or TypeScript code found\\.)"), 'foo bar']], { silent: true, listeners: { stdout: (data) => { extractorPath += data.toString(); }, @@ -289,14 +289,14 @@ function getCodeQLForCmd(cmd) { const ext = process.platform === 'win32' ? '.cmd' : '.sh'; const traceCommand = path.resolve(JSON.parse(extractorPath), 'tools', 'autobuild' + ext); // Run trace command - await exec.exec(cmd, [ + await exec_wrapper_1.exec_wrapper(cmd, [ 'database', 'trace-command', ...getExtraOptionsFromEnv(['database', 'trace-command']), databasePath, '--', traceCommand - ]); + ], [[0, new RegExp("(No source code was seen during the build\\.|No JavaScript or TypeScript code found\\.)"), 'foo bar']]); }, finalizeDatabase: async function (databasePath) { await exec_wrapper_1.exec_wrapper(cmd, [ diff --git a/lib/codeql.js.map b/lib/codeql.js.map index a5bafa6d8..a4a58111f 100644 --- a/lib/codeql.js.map +++ b/lib/codeql.js.map @@ -1 +1 @@ -{"version":3,"file":"codeql.js","sourceRoot":"","sources":["../src/codeql.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsC;AACtC,oDAAsC;AACtC,2DAA6C;AAE7C,+DAAiD;AACjD,uCAAyB;AACzB,2CAA6B;AAC7B,+CAAiC;AACjC,+CAAiC;AACjC,iDAAmC;AACnC,iDAA6B;AAE7B,kDAAoC;AACpC,0DAA4C,CAAC,2CAA2C;AACxF,iDAA8C;AAE9C,6CAA+B;AA8E/B;;;GAGG;AACH,IAAI,YAAY,GAAuB,SAAS,CAAC;AAEjD,MAAM,qBAAqB,GAAG,QAAQ,CAAC,aAAa,CAAC;AACrD,MAAM,kBAAkB,GAAG,sB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SAAS,EAAE;gBACvD,MAAM,GAAG,GACP,yBAAyB,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,8BAA8B,CAAC;gBACpG,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;aACtB;YACD,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC;IACD,IAAI,GAAG,GAAG,cAAc,OAAC,OAAO,0CAAG,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/D,IAAI,QAAQ,GAAG,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;QAChC,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;QACnC,eAAe,OAAC,OAAO,0CAAG,IAAI,CAAC,CAAC,CAAC,SAAG,IAAI,0CAAE,KAAK,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChF,OAAO,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC9B,CAAC;AAjCD,0CAiCC"} \ No newline at end of file diff --git a/src/codeql.ts b/src/codeql.ts index 924935f8b..36c680085 100644 --- a/src/codeql.ts +++ b/src/codeql.ts @@ -359,7 +359,7 @@ function getCodeQLForCmd(cmd: string): CodeQL { extractScannedLanguage: async function(databasePath: string, language: Language) { // Get extractor location let extractorPath = ''; - await exec.exec( + await exec_wrapper( cmd, [ 'resolve', @@ -368,6 +368,7 @@ function getCodeQLForCmd(cmd: string): CodeQL { '--language=' + language, ...getExtraOptionsFromEnv(['resolve', 'extractor']), ], + [[0, new RegExp("(No source code was seen during the build\\.|No JavaScript or TypeScript code found\\.)"), 'foo bar']], { silent: true, listeners: { @@ -381,14 +382,17 @@ function getCodeQLForCmd(cmd: string): CodeQL { const traceCommand = path.resolve(JSON.parse(extractorPath), 'tools', 'autobuild' + ext); // Run trace command - await exec.exec(cmd, [ - 'database', - 'trace-command', - ...getExtraOptionsFromEnv(['database', 'trace-command']), - databasePath, - '--', - traceCommand - ]); + await exec_wrapper( + cmd, [ + 'database', + 'trace-command', + ...getExtraOptionsFromEnv(['database', 'trace-command']), + databasePath, + '--', + traceCommand + ], + [[0, new RegExp("(No source code was seen during the build\\.|No JavaScript or TypeScript code found\\.)"), 'foo bar']] + ); }, finalizeDatabase: async function(databasePath: string) { await exec_wrapper( From 231537b08ef57e28e550239c2079c4a294773b42 Mon Sep 17 00:00:00 2001 From: Nick Fyson Date: Wed, 2 Sep 2020 16:32:28 +0100 Subject: [PATCH 06/35] refactor to handle exec.exec return values together --- lib/exec_wrapper.js | 19 ++++++++++--------- lib/exec_wrapper.js.map | 2 +- src/exec_wrapper.ts | 17 +++++++++-------- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/lib/exec_wrapper.js b/lib/exec_wrapper.js index c5cc9f3ac..139e65577 100644 --- a/lib/exec_wrapper.js +++ b/lib/exec_wrapper.js @@ -50,28 +50,29 @@ async function exec_wrapper(commandLine, args, matchers, options) { } }; // we capture the original return code and error so that (if no match is found) we can duplicate the behaviour - let originalReturnCode; - let originalError; + let originalReturnValue; try { - originalReturnCode = await exec.exec(commandLine, args, { + originalReturnValue = await exec.exec(commandLine, args, { listeners: listeners, ...options }); } catch (e) { - originalError = e; - originalReturnCode = 1; // TODO linter insists, but presumably there's a better way to do _all_ this... + originalReturnValue = e; } if (matchers) { for (const [customCode, regex, message] of matchers) { - if (customCode === originalReturnCode || regex.test(stderr) || regex.test(stdout)) { + if (customCode === originalReturnValue || regex.test(stderr) || regex.test(stdout)) { throw new Error(message); } } } - if (originalError) - throw originalError; - return originalReturnCode; + if (typeof originalReturnValue === 'number') { + return originalReturnValue; + } + else { + throw originalReturnValue; + } } exports.exec_wrapper = exec_wrapper; //# sourceMappingURL=exec_wrapper.js.map \ No newline at end of file diff --git a/lib/exec_wrapper.js.map b/lib/exec_wrapper.js.map index 9992338cb..b3727083b 100644 --- a/lib/exec_wrapper.js.map +++ b/lib/exec_wrapper.js.map @@ -1 +1 @@ -{"version":3,"file":"exec_wrapper.js","sourceRoot":"","sources":["../src/exec_wrapper.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAAsC;AAItC;;;;;;;;;;GAUG;AACI,KAAK,UAAU,YAAY,CAAC,WAAmB,EAAE,IAAe,EACpC,QAAqC,EACrC,OAAwB;;IAEzD,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,4GAA4G;IAC5G,MAAM,gBAAgB,SAAG,OAAO,0CAAE,SAAS,CAAC;IAC5C,IAAI,SAAS,GAAG;QACd,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;;YACvB,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,IAAI,OAAA,gBAAgB,0CAAE,MAAM,MAAK,SAAS,EAAE;gBAC1C,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aAC/B;iBAAM;gBACL,iFAAiF;gBACjF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;aAC5B;QAEH,CAAC;QACD,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;;YACvB,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,IAAI,OAAA,gBAAgB,0CAAE,MAAM,MAAK,SAAS,EAAE;gBAC1C,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aAC/B;iBAAM;gBACL,iFAAiF;gBACjF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;aAC5B;QACH,CAAC;KACF,CAAC;IAEF,8GAA8G;IAC9G,IAAI,kBAA0B,CAAC;IAC/B,IAAI,aAA8B,CAAC;IACnC,IAAI;QACF,kBAAkB,GAAG,MAAM,IAAI,CAAC,IAAI,CAClC,WAAW,EACX,IA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C;aAC5B;QAEH,CAAC;QACD,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;;YACvB,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,IAAI,OAAA,gBAAgB,0CAAE,MAAM,MAAK,SAAS,EAAE;gBAC1C,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aAC/B;iBAAM;gBACL,iFAAiF;gBACjF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;aAC5B;QACH,CAAC;KACF,CAAC;IAEF,8GAA8G;IAC9G,IAAI,mBAAiC,CAAC;IACtC,IAAI;QACF,mBAAmB,GAAG,MAAM,IAAI,CAAC,IAAI,CACnC,WAAW,EACX,IAAI,EACJ;YACE,SAAS,EAAE,SAAS;YACpB,GAAG,OAAO;SACX,CAAC,CAAC;KACN;IAAC,OAAO,CAAC,EAAE;QACV,mBAAmB,GAAG,CAAC,CAAC;KACzB;IAED,IAAI,QAAQ,EAAE;QACZ,KAAK,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,QAAQ,EAAE;YACnD,IAAI,UAAU,KAAK,mBAAmB,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAG;gBACnF,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;aAC1B;SACF;KACF;IAED,IAAI,OAAO,mBAAmB,KAAK,QAAQ,EAAE;QAC3C,OAAO,mBAAmB,CAAC;KAC5B;SAAM;QACL,MAAM,mBAAmB,CAAC;KAC3B;AACH,CAAC;AA1DD,oCA0DC"} \ No newline at end of file diff --git a/src/exec_wrapper.ts b/src/exec_wrapper.ts index d565461af..c7f6d511c 100644 --- a/src/exec_wrapper.ts +++ b/src/exec_wrapper.ts @@ -45,10 +45,9 @@ export async function exec_wrapper(commandLine: string, args?: string[], }; // we capture the original return code and error so that (if no match is found) we can duplicate the behaviour - let originalReturnCode: number; - let originalError: Error|undefined; + let originalReturnValue: Error|number; try { - originalReturnCode = await exec.exec( + originalReturnValue = await exec.exec( commandLine, args, { @@ -56,18 +55,20 @@ export async function exec_wrapper(commandLine: string, args?: string[], ...options }); } catch (e) { - originalError = e; - originalReturnCode = 1; // TODO linter insists, but presumably there's a better way to do _all_ this... + originalReturnValue = e; } if (matchers) { for (const [customCode, regex, message] of matchers) { - if (customCode === originalReturnCode || regex.test(stderr) || regex.test(stdout) ) { + if (customCode === originalReturnValue || regex.test(stderr) || regex.test(stdout) ) { throw new Error(message); } } } - if (originalError) throw originalError; - return originalReturnCode; + if (typeof originalReturnValue === 'number') { + return originalReturnValue; + } else { + throw originalReturnValue; + } } From 6a43a6178d1a7a4a22ac1ee519066c5df7b68797 Mon Sep 17 00:00:00 2001 From: Nick Fyson Date: Thu, 3 Sep 2020 16:42:56 +0100 Subject: [PATCH 07/35] ensure matchers not applied if exit code is zero --- lib/exec_wrapper.js | 2 +- lib/exec_wrapper.js.map | 2 +- src/exec_wrapper.ts | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/exec_wrapper.js b/lib/exec_wrapper.js index 139e65577..ae0b47b2c 100644 --- a/lib/exec_wrapper.js +++ b/lib/exec_wrapper.js @@ -60,7 +60,7 @@ async function exec_wrapper(commandLine, args, matchers, options) { catch (e) { originalReturnValue = e; } - if (matchers) { + if (matchers && originalReturnValue !== 0) { for (const [customCode, regex, message] of matchers) { if (customCode === originalReturnValue || regex.test(stderr) || regex.test(stdout)) { throw new Error(message); diff --git a/lib/exec_wrapper.js.map b/lib/exec_wrapper.js.map index b3727083b..355133215 100644 --- a/lib/exec_wrapper.js.map +++ b/lib/exec_wrapper.js.map @@ -1 +1 @@ -{"version":3,"file":"exec_wrapper.js","sourceRoot":"","sources":["../src/exec_wrapper.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAAsC;AAItC;;;;;;;;;;GAUG;AACI,KAAK,UAAU,YAAY,CAAC,W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AAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;aAC5B;QACH,CAAC;KACF,CAAC;IAEF,8GAA8G;IAC9G,IAAI,mBAAiC,CAAC;IACtC,IAAI;QACF,mBAAmB,GAAG,MAAM,IAAI,CAAC,IAAI,CACnC,WAAW,EACX,IAAI,EACJ;YACE,SAAS,EAAE,SAAS;YACpB,GAAG,OAAO;SACX,CAAC,CAAC;KACN;IAAC,OAAO,CAAC,EAAE;QACV,mBAAmB,GAAG,CAAC,CAAC;KACzB;IAED,IAAI,QAAQ,IAAI,mBAAmB,KAAK,CAAC,EAAE;QACzC,KAAK,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,QAAQ,EAAE;YACnD,IAAI,UAAU,KAAK,mBAAmB,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAG;gBACnF,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;aAC1B;SACF;KACF;IAED,IAAI,OAAO,mBAAmB,KAAK,QAAQ,EAAE;QAC3C,OAAO,mBAAmB,CAAC;KAC5B;SAAM;QACL,MAAM,mBAAmB,CAAC;KAC3B;AACH,CAAC;AA1DD,oCA0DC"} \ No newline at end of file diff --git a/src/exec_wrapper.ts b/src/exec_wrapper.ts index c7f6d511c..b928c826c 100644 --- a/src/exec_wrapper.ts +++ b/src/exec_wrapper.ts @@ -2,6 +2,8 @@ import * as exec from '@actions/exec'; import * as im from '@actions/exec/lib/interfaces'; +export type ErrorMatcher = [number, RegExp, string]; + /** * Wrapper for exec.exec which checks for specific return code and/or regex matches in console output. * Output will be streamed to the live console as well as captured for subsequent processing. @@ -14,7 +16,7 @@ import * as im from '@actions/exec/lib/interfaces'; * @returns Promise exit code */ export async function exec_wrapper(commandLine: string, args?: string[], - matchers?: [[number, RegExp, string]], + matchers?: ErrorMatcher[], options?: im.ExecOptions): Promise { let stdout = ''; @@ -58,7 +60,7 @@ export async function exec_wrapper(commandLine: string, args?: string[], originalReturnValue = e; } - if (matchers) { + if (matchers && originalReturnValue !== 0) { for (const [customCode, regex, message] of matchers) { if (customCode === originalReturnValue || regex.test(stderr) || regex.test(stdout) ) { throw new Error(message); From dd4e841441b3fb05488d1145c37f64b41caf08fe Mon Sep 17 00:00:00 2001 From: Nick Fyson Date: Thu, 3 Sep 2020 17:01:51 +0100 Subject: [PATCH 08/35] remove spurious use of exec_wrapper --- lib/codeql.js | 4 ++-- lib/codeql.js.map | 2 +- src/codeql.ts | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/codeql.js b/lib/codeql.js index cb16853cd..32ba1d384 100644 --- a/lib/codeql.js +++ b/lib/codeql.js @@ -272,13 +272,13 @@ function getCodeQLForCmd(cmd) { extractScannedLanguage: async function (databasePath, language) { // Get extractor location let extractorPath = ''; - await exec_wrapper_1.exec_wrapper(cmd, [ + await exec.exec(cmd, [ 'resolve', 'extractor', '--format=json', '--language=' + language, ...getExtraOptionsFromEnv(['resolve', 'extractor']), - ], [[0, new RegExp("(No source code was seen during the build\\.|No JavaScript or TypeScript code found\\.)"), 'foo bar']], { + ], { silent: true, listeners: { stdout: (data) => { extractorPath += data.toString(); }, diff --git a/lib/codeql.js.map b/lib/codeql.js.map index a4a58111f..9da2c85b0 100644 --- a/lib/codeql.js.map +++ b/lib/codeql.js.map @@ -1 +1 @@ -{"version":3,"file":"codeql.js","sourceRoot":"","sources":["../src/codeql.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsC;AACtC,oDAAsC;AACtC,2DAA6C;AAE7C,+DAAiD;AACjD,uCAAyB;AACzB,2CAA6B;AAC7B,+CAAiC;AACjC,+CAAiC;AACjC,iDAAmC;AACnC,iDAA6B;AAE7B,kDAAoC;AACpC,0DAA4C,CAAC,2CAA2C;AACxF,iDAA8C;AAE9C,6CAA+B;AA8E/B;;;GAGG;AACH,IAAI,YAAY,GAAuB,SAAS,CAA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OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;YACrB,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC;YACnB,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,SAAS,EAAE;gBACvD,MAAM,GAAG,GACP,yBAAyB,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,8BAA8B,CAAC;gBACpG,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;aACtB;YACD,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC;IACD,IAAI,GAAG,GAAG,cAAc,OAAC,OAAO,0CAAG,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/D,IAAI,QAAQ,GAAG,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;QAChC,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;QACnC,eAAe,OAAC,OAAO,0CAAG,IAAI,CAAC,CAAC,CAAC,SAAG,IAAI,0CAAE,KAAK,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChF,OAAO,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC9B,CAAC;AAjCD,0CAiCC"} \ No newline at end of file diff --git a/src/codeql.ts b/src/codeql.ts index 36c680085..8b35e3461 100644 --- a/src/codeql.ts +++ b/src/codeql.ts @@ -359,7 +359,7 @@ function getCodeQLForCmd(cmd: string): CodeQL { extractScannedLanguage: async function(databasePath: string, language: Language) { // Get extractor location let extractorPath = ''; - await exec_wrapper( + await exec.exec( cmd, [ 'resolve', @@ -368,7 +368,6 @@ function getCodeQLForCmd(cmd: string): CodeQL { '--language=' + language, ...getExtraOptionsFromEnv(['resolve', 'extractor']), ], - [[0, new RegExp("(No source code was seen during the build\\.|No JavaScript or TypeScript code found\\.)"), 'foo bar']], { silent: true, listeners: { From 9701a93bf11727593de62e25288c86d8969a3230 Mon Sep 17 00:00:00 2001 From: Nick Fyson Date: Mon, 7 Sep 2020 15:17:19 +0100 Subject: [PATCH 09/35] ensure exec_wrapper always captures exit code of called process --- lib/exec_wrapper.js | 48 ++++++++++++++++++++++++----------------- lib/exec_wrapper.js.map | 2 +- src/exec_wrapper.ts | 43 ++++++++++++++++++++---------------- 3 files changed, 54 insertions(+), 39 deletions(-) diff --git a/lib/exec_wrapper.js b/lib/exec_wrapper.js index ae0b47b2c..f698aab2d 100644 --- a/lib/exec_wrapper.js +++ b/lib/exec_wrapper.js @@ -23,55 +23,63 @@ async function exec_wrapper(commandLine, args, matchers, options) { var _a; let stdout = ''; let stderr = ''; - // custom listeners to store stdout and stderr, while also replicating the behaviour of the passed listeners - const originalListener = (_a = options) === null || _a === void 0 ? void 0 : _a.listeners; let listeners = { stdout: (data) => { - var _a; + var _a, _b; stdout += data.toString(); - if (((_a = originalListener) === null || _a === void 0 ? void 0 : _a.stdout) !== undefined) { - originalListener.stdout(data); + if (((_b = (_a = options) === null || _a === void 0 ? void 0 : _a.listeners) === null || _b === void 0 ? void 0 : _b.stdout) !== undefined) { + options.listeners.stdout(data); } else { - // if no stdout listener was originally defined then match behaviour of exec.exec + // if no stdout listener was originally defined then we match default behavior of exec.exec process.stdout.write(data); } }, stderr: (data) => { - var _a; + var _a, _b; stderr += data.toString(); - if (((_a = originalListener) === null || _a === void 0 ? void 0 : _a.stderr) !== undefined) { - originalListener.stderr(data); + if (((_b = (_a = options) === null || _a === void 0 ? void 0 : _a.listeners) === null || _b === void 0 ? void 0 : _b.stderr) !== undefined) { + options.listeners.stderr(data); } else { - // if no stderr listener was originally defined then match behaviour of exec.exec + // if no stderr listener was originally defined then we match default behavior of exec.exec process.stderr.write(data); } } }; - // we capture the original return code and error so that (if no match is found) we can duplicate the behaviour - let originalReturnValue; + // we capture the original return code or error so that if no match is found we can duplicate the behavior + let returnState; try { - originalReturnValue = await exec.exec(commandLine, args, { + returnState = await exec.exec(commandLine, args, { + ...options, listeners: listeners, - ...options + ignoreReturnCode: true, }); } catch (e) { - originalReturnValue = e; + returnState = e; } - if (matchers && originalReturnValue !== 0) { + // if there is a zero return code then we do not apply the matchers + if (returnState === 0) + return returnState; + if (matchers) { for (const [customCode, regex, message] of matchers) { - if (customCode === originalReturnValue || regex.test(stderr) || regex.test(stdout)) { + if (customCode === returnState || regex.test(stderr) || regex.test(stdout)) { throw new Error(message); } } } - if (typeof originalReturnValue === 'number') { - return originalReturnValue; + if (typeof returnState === 'number') { + // only if we were instructed to ignore the return code do we ever return it non-zero + if ((_a = options) === null || _a === void 0 ? void 0 : _a.ignoreReturnCode) { + return returnState; + } + else { + throw new Error(`The process \'${commandLine}\' failed with exit code ${returnState}`); + } } else { - throw originalReturnValue; + throw returnState; } } exports.exec_wrapper = exec_wrapper; diff --git a/lib/exec_wrapper.js.map b/lib/exec_wrapper.js.map index 355133215..60d0bec1d 100644 --- a/lib/exec_wrapper.js.map +++ b/lib/exec_wrapper.js.map @@ -1 +1 @@ -{"version":3,"file":"exec_wrapper.js","sourceRoot":"","sources":["../src/exec_wrapper.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAAsC;AAMtC;;;;;;;;;;GAUG;AACI,KAAK,UAAU,YAAY,CAAC,WAAmB,EAAE,IAAe,EACpC,QAAyB,EACzB,OAAwB;;IAEzD,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,4GAA4G;IAC5G,MAAM,gBAAgB,SAAG,OAAO,0CAAE,SAAS,CAAC;IAC5C,IAAI,SAAS,GAAG;QACd,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;;YACvB,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,IAAI,OAAA,gBAAgB,0CAAE,MAAM,MAAK,SAAS,EAAE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AmE;IACnE,IAAI,WAAW,KAAK,CAAC;QAAE,OAAO,WAAW,CAAC;IAE1C,IAAI,QAAQ,EAAE;QACZ,KAAK,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,QAAQ,EAAE;YACnD,IAAI,UAAU,KAAK,WAAW,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAG;gBAC3E,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;aAC1B;SACF;KACF;IAED,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;QACnC,qFAAqF;QACrF,UAAI,OAAO,0CAAE,gBAAgB,EAAE;YAC7B,OAAO,WAAW,CAAC;SACpB;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,iBAAiB,WAAW,4BAA4B,WAAW,EAAE,CAAC,CAAC;SACxF;KACF;SAAM;QACL,MAAM,WAAW,CAAC;KACnB;AACH,CAAC;AAjED,oCAiEC"} \ No newline at end of file diff --git a/src/exec_wrapper.ts b/src/exec_wrapper.ts index b928c826c..b9a70e7c4 100644 --- a/src/exec_wrapper.ts +++ b/src/exec_wrapper.ts @@ -22,55 +22,62 @@ export async function exec_wrapper(commandLine: string, args?: string[], let stdout = ''; let stderr = ''; - // custom listeners to store stdout and stderr, while also replicating the behaviour of the passed listeners - const originalListener = options?.listeners; let listeners = { stdout: (data: Buffer) => { stdout += data.toString(); - if (originalListener?.stdout !== undefined) { - originalListener.stdout(data); + if (options?.listeners?.stdout !== undefined) { + options.listeners.stdout(data); } else { - // if no stdout listener was originally defined then match behaviour of exec.exec + // if no stdout listener was originally defined then we match default behavior of exec.exec process.stdout.write(data); } }, stderr: (data: Buffer) => { stderr += data.toString(); - if (originalListener?.stderr !== undefined) { - originalListener.stderr(data); + if (options?.listeners?.stderr !== undefined) { + options.listeners.stderr(data); } else { - // if no stderr listener was originally defined then match behaviour of exec.exec + // if no stderr listener was originally defined then we match default behavior of exec.exec process.stderr.write(data); } } }; - // we capture the original return code and error so that (if no match is found) we can duplicate the behaviour - let originalReturnValue: Error|number; + // we capture the original return code or error so that if no match is found we can duplicate the behavior + let returnState: Error|number; try { - originalReturnValue = await exec.exec( + returnState = await exec.exec( commandLine, args, { + ...options, // pass original options first in order to override below listeners: listeners, - ...options + ignoreReturnCode: true, // so we can check for specific codes using the matchers }); } catch (e) { - originalReturnValue = e; + returnState = e; } - if (matchers && originalReturnValue !== 0) { + // if there is a zero return code then we do not apply the matchers + if (returnState === 0) return returnState; + + if (matchers) { for (const [customCode, regex, message] of matchers) { - if (customCode === originalReturnValue || regex.test(stderr) || regex.test(stdout) ) { + if (customCode === returnState || regex.test(stderr) || regex.test(stdout) ) { throw new Error(message); } } } - if (typeof originalReturnValue === 'number') { - return originalReturnValue; + if (typeof returnState === 'number') { + // only if we were instructed to ignore the return code do we ever return it non-zero + if (options?.ignoreReturnCode) { + return returnState; + } else { + throw new Error(`The process \'${commandLine}\' failed with exit code ${returnState}`); + } } else { - throw originalReturnValue; + throw returnState; } } From 1f3ce75844fe0a331add272db35dad480a223118 Mon Sep 17 00:00:00 2001 From: Nick Fyson Date: Mon, 7 Sep 2020 15:17:43 +0100 Subject: [PATCH 10/35] add initial suite of tests for exec_wrapper --- lib/exec_wrapper.test.js | 102 ++++++++++++++++++++++ lib/exec_wrapper.test.js.map | 1 + src/exec_wrapper.test.ts | 158 +++++++++++++++++++++++++++++++++++ 3 files changed, 261 insertions(+) create mode 100644 lib/exec_wrapper.test.js create mode 100644 lib/exec_wrapper.test.js.map create mode 100644 src/exec_wrapper.test.ts diff --git a/lib/exec_wrapper.test.js b/lib/exec_wrapper.test.js new file mode 100644 index 000000000..b0ceebc73 --- /dev/null +++ b/lib/exec_wrapper.test.js @@ -0,0 +1,102 @@ +"use strict"; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const exec = __importStar(require("@actions/exec")); +const ava_1 = __importDefault(require("ava")); +const exec_wrapper_1 = require("./exec_wrapper"); +const testing_utils_1 = require("./testing-utils"); +// import fs from 'fs'; +// import { exec_wrapper } from './exec_wrapper'; +// const matchers: [[number, RegExp, string]] = [ +// [-999, +// new RegExp("match this string"), +// 'No source code was found. CUSTOM ERROR MESSAGE HERE'], +// ]; +testing_utils_1.setupTests(ava_1.default); +ava_1.default('matchers are never applied if non-error exit', async (t) => { + const testCommand = buildDummyCommand("foo bar\\nblort qux", "foo bar\\nblort qux", '', 0); + const matchers = [[123, new RegExp("foo bar"), 'error!!!']]; + t.deepEqual(await exec.exec(testCommand), 0); + t.deepEqual(await exec_wrapper_1.exec_wrapper(testCommand, [], matchers), 0); +}); +ava_1.default('regex matchers are applied to stdout for non-zero exit code', async (t) => { + const testCommand = buildDummyCommand("foo bar\\nblort qux", '', '', 1); + const matchers = [[123, new RegExp("foo bar"), '🦄']]; + await t.throwsAsync(exec.exec(testCommand), { instanceOf: Error, message: 'The process \'node\' failed with exit code 1' }); + await t.throwsAsync(exec_wrapper_1.exec_wrapper(testCommand, [], matchers), { instanceOf: Error, message: '🦄' }); +}); +ava_1.default('regex matchers are applied to stderr for non-zero exit code', async (t) => { + const testCommand = buildDummyCommand("non matching string", 'foo bar\\nblort qux', '', 1); + const matchers = [[123, new RegExp("foo bar"), '🦄']]; + await t.throwsAsync(exec.exec(testCommand), { instanceOf: Error, message: 'The process \'node\' failed with exit code 1' }); + await t.throwsAsync(exec_wrapper_1.exec_wrapper(testCommand, [], matchers), { instanceOf: Error, message: '🦄' }); +}); +ava_1.default('matcher returns correct error message when multiple matchers defined', async (t) => { + const testCommand = buildDummyCommand("non matching string", 'foo bar\\nblort qux', '', 1); + const matchers = [[456, new RegExp("lorem ipsum"), '😩'], + [123, new RegExp("foo bar"), '🦄'], + [789, new RegExp("blah blah"), '🤦‍♂️']]; + await t.throwsAsync(exec.exec(testCommand), { instanceOf: Error, message: 'The process \'node\' failed with exit code 1' }); + await t.throwsAsync(exec_wrapper_1.exec_wrapper(testCommand, [], matchers), { instanceOf: Error, message: '🦄' }); +}); +ava_1.default('matcher returns first match to regex when multiple matches', async (t) => { + const testCommand = buildDummyCommand("non matching string", 'foo bar\\nblort qux', '', 1); + const matchers = [[123, new RegExp("foo bar"), '🦄'], + [789, new RegExp("blah blah"), '🤦‍♂️'], + [987, new RegExp("foo bar"), '🚫']]; + await t.throwsAsync(exec.exec(testCommand), { instanceOf: Error, message: 'The process \'node\' failed with exit code 1' }); + await t.throwsAsync(exec_wrapper_1.exec_wrapper(testCommand, [], matchers), { instanceOf: Error, message: '🦄' }); +}); +ava_1.default('exit code matchers are applied', async (t) => { + const testCommand = buildDummyCommand("non matching string", 'foo bar\\nblort qux', '', 123); + const matchers = [[123, new RegExp("this will not match"), '🦄']]; + await t.throwsAsync(exec.exec(testCommand), { instanceOf: Error, message: 'The process \'node\' failed with exit code 123' }); + await t.throwsAsync(exec_wrapper_1.exec_wrapper(testCommand, [], matchers), { instanceOf: Error, message: '🦄' }); +}); +ava_1.default('exec_wrapper respects the ignoreReturnValue option', async (t) => { + const testCommand = buildDummyCommand("standard output", 'error output', '', 199); + await t.throwsAsync(exec_wrapper_1.exec_wrapper(testCommand, [], [], { ignoreReturnCode: false }), { instanceOf: Error }); + t.deepEqual(await exec_wrapper_1.exec_wrapper(testCommand, [], [], { ignoreReturnCode: true }), 199); +}); +ava_1.default('exec_wrapper preserves behavior of provided listeners', async (t) => { + let stdoutExpected = 'standard output'; + let stderrExpected = 'error output'; + let stdoutActual = ''; + let stderrActual = ''; + let listeners = { + stdout: (data) => { + stdoutActual += data.toString(); + }, + stderr: (data) => { + stderrActual += data.toString(); + } + }; + const testCommand = buildDummyCommand(stdoutExpected, stderrExpected, '', 0); + t.deepEqual(await exec_wrapper_1.exec_wrapper(testCommand, [], [], { listeners: listeners }), 0); + t.deepEqual(stdoutActual, stdoutExpected + "\n"); + t.deepEqual(stderrActual, stderrExpected + "\n"); +}); +function buildDummyCommand(stdoutContents, stderrContents, desiredErrorMessage, desiredExitCode) { + let command = ''; + if (stdoutContents) + command += 'console.log(\\"' + stdoutContents + '\\");'; + if (stderrContents) + command += 'console.error(\\"' + stderrContents + '\\");'; + if (command.length === 0) + throw new Error("Must provide contents for either stdout or stderr"); + if (desiredErrorMessage) + command += 'throw new Error(\\"' + desiredErrorMessage + '\\");'; + if (desiredExitCode) + command += 'process.exitCode = ' + desiredExitCode + ';'; + return 'node -e "' + command + '"'; +} +//# sourceMappingURL=exec_wrapper.test.js.map \ No newline at end of file diff --git a/lib/exec_wrapper.test.js.map b/lib/exec_wrapper.test.js.map new file mode 100644 index 000000000..64c41c8be --- /dev/null +++ b/lib/exec_wrapper.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"exec_wrapper.test.js","sourceRoot":"","sources":["../src/exec_wrapper.test.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsC;AACtC,8CAAuB;AAEvB,iDAA4D;AAC5D,mDAA2C;AAC3C,uBAAuB;AAEvB,iDAAiD;AAEjD,iDAAiD;AACjD,WAAW;AACX,uCAAuC;AACvC,8DAA8D;AAC9D,KAAK;AAEL,0BAAU,CAAC,aAAI,CAAC,CAAC;AAEjB,aAAI,CAAC,8CAA8C,EAAE,KAAK,EAAC,CAAC,EAAC,EAAE;IAE7D,MAAM,WAAW,GAAG,iBAAiB,CAAC,qBAAqB,EAAE,qBAAqB,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAE3F,MAAM,QAAQ,GAAmB,CAAC,CAAC,GAAG,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC;IAE5E,CAAC,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC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IAE/E,IAAI,OAAO,GAAG,EAAE,CAAC;IAEjB,IAAI,cAAc;QAAE,OAAO,IAAI,iBAAiB,GAAG,cAAc,GAAG,OAAO,CAAC;IAC5E,IAAI,cAAc;QAAE,OAAO,IAAI,mBAAmB,GAAG,cAAc,GAAG,OAAO,CAAC;IAE9E,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IAE/F,IAAI,mBAAmB;QAAE,OAAO,IAAI,qBAAqB,GAAG,mBAAmB,GAAG,OAAO,CAAC;IAC1F,IAAI,eAAe;QAAE,OAAO,IAAI,qBAAqB,GAAG,eAAe,GAAG,GAAG,CAAC;IAE9E,OAAO,WAAW,GAAG,OAAO,GAAG,GAAG,CAAC;AACrC,CAAC"} \ No newline at end of file diff --git a/src/exec_wrapper.test.ts b/src/exec_wrapper.test.ts new file mode 100644 index 000000000..036551a99 --- /dev/null +++ b/src/exec_wrapper.test.ts @@ -0,0 +1,158 @@ +import * as exec from '@actions/exec'; +import test from 'ava'; + +import { exec_wrapper, ErrorMatcher } from './exec_wrapper'; +import {setupTests} from './testing-utils'; +// import fs from 'fs'; + +// import { exec_wrapper } from './exec_wrapper'; + +// const matchers: [[number, RegExp, string]] = [ +// [-999, +// new RegExp("match this string"), +// 'No source code was found. CUSTOM ERROR MESSAGE HERE'], +// ]; + +setupTests(test); + +test('matchers are never applied if non-error exit', async t => { + + const testCommand = buildDummyCommand("foo bar\\nblort qux", "foo bar\\nblort qux", '', 0); + + const matchers: ErrorMatcher[] = [[123, new RegExp("foo bar"), 'error!!!']]; + + t.deepEqual(await exec.exec(testCommand), 0); + + t.deepEqual(await exec_wrapper(testCommand, [], matchers), 0); + +}); + +test('regex matchers are applied to stdout for non-zero exit code', async t => { + + const testCommand = buildDummyCommand("foo bar\\nblort qux", '', '', 1); + + const matchers: ErrorMatcher[] = [[123, new RegExp("foo bar"), '🦄']]; + + await t.throwsAsync(exec.exec(testCommand), {instanceOf: Error, message: 'The process \'node\' failed with exit code 1'}); + + await t.throwsAsync( + exec_wrapper(testCommand, [], matchers), + {instanceOf: Error, message: '🦄'} + ); + +}); + +test('regex matchers are applied to stderr for non-zero exit code', async t => { + + const testCommand = buildDummyCommand("non matching string", 'foo bar\\nblort qux', '', 1); + + const matchers: ErrorMatcher[] = [[123, new RegExp("foo bar"), '🦄']]; + + await t.throwsAsync(exec.exec(testCommand), {instanceOf: Error, message: 'The process \'node\' failed with exit code 1'}); + + await t.throwsAsync( + exec_wrapper(testCommand, [], matchers), + {instanceOf: Error, message: '🦄'} + ); + +}); + +test('matcher returns correct error message when multiple matchers defined', async t => { + + const testCommand = buildDummyCommand("non matching string", 'foo bar\\nblort qux', '', 1); + + const matchers: ErrorMatcher[] = [[456, new RegExp("lorem ipsum"), '😩'], + [123, new RegExp("foo bar"), '🦄'], + [789, new RegExp("blah blah"), '🤦‍♂️']]; + + await t.throwsAsync(exec.exec(testCommand), {instanceOf: Error, message: 'The process \'node\' failed with exit code 1'}); + + await t.throwsAsync( + exec_wrapper(testCommand, [], matchers), + {instanceOf: Error, message: '🦄'} + ); + +}); + +test('matcher returns first match to regex when multiple matches', async t => { + + const testCommand = buildDummyCommand("non matching string", 'foo bar\\nblort qux', '', 1); + + const matchers: ErrorMatcher[] = [[123, new RegExp("foo bar"), '🦄'], + [789, new RegExp("blah blah"), '🤦‍♂️'], + [987, new RegExp("foo bar"), '🚫']]; + + await t.throwsAsync(exec.exec(testCommand), {instanceOf: Error, message: 'The process \'node\' failed with exit code 1'}); + + await t.throwsAsync( + exec_wrapper(testCommand, [], matchers), + {instanceOf: Error, message: '🦄'} + ); + +}); + +test('exit code matchers are applied', async t => { + + const testCommand = buildDummyCommand("non matching string", 'foo bar\\nblort qux', '', 123); + + const matchers: ErrorMatcher[] = [[123, new RegExp("this will not match"), '🦄']]; + + await t.throwsAsync(exec.exec(testCommand), {instanceOf: Error, message: 'The process \'node\' failed with exit code 123'}); + + await t.throwsAsync( + exec_wrapper(testCommand, [], matchers), + {instanceOf: Error, message: '🦄'} + ); + +}); + +test('exec_wrapper respects the ignoreReturnValue option', async t => { + const testCommand = buildDummyCommand("standard output", 'error output', '', 199); + + await t.throwsAsync(exec_wrapper(testCommand, [], [], {ignoreReturnCode: false}), {instanceOf: Error}); + + t.deepEqual(await exec_wrapper(testCommand, [], [], {ignoreReturnCode: true}), 199); + +}); + +test('exec_wrapper preserves behavior of provided listeners', async t => { + + let stdoutExpected = 'standard output'; + let stderrExpected = 'error output'; + + let stdoutActual = ''; + let stderrActual = ''; + + let listeners = { + stdout: (data: Buffer) => { + stdoutActual += data.toString(); + }, + stderr: (data: Buffer) => { + stderrActual += data.toString(); + } + }; + + const testCommand = buildDummyCommand(stdoutExpected, stderrExpected, '', 0); + + t.deepEqual(await exec_wrapper(testCommand, [], [], {listeners: listeners}), 0); + + t.deepEqual(stdoutActual, stdoutExpected + "\n"); + t.deepEqual(stderrActual, stderrExpected + "\n"); + +}); + +function buildDummyCommand(stdoutContents: string, stderrContents: string, + desiredErrorMessage?: string, desiredExitCode?: number): string { + + let command = ''; + + if (stdoutContents) command += 'console.log(\\"' + stdoutContents + '\\");'; + if (stderrContents) command += 'console.error(\\"' + stderrContents + '\\");'; + + if (command.length === 0) throw new Error("Must provide contents for either stdout or stderr"); + + if (desiredErrorMessage) command += 'throw new Error(\\"' + desiredErrorMessage + '\\");'; + if (desiredExitCode) command += 'process.exitCode = ' + desiredExitCode + ';'; + + return 'node -e "' + command + '"'; +} From 7dbaff09b608c15860638396597f24a3535a8e35 Mon Sep 17 00:00:00 2001 From: Nick Fyson Date: Mon, 7 Sep 2020 15:49:03 +0100 Subject: [PATCH 11/35] move error matcher definition into dedicated file --- lib/codeql.js | 5 +++-- lib/codeql.js.map | 2 +- lib/error_matcher.js | 6 ++++++ lib/error_matcher.js.map | 1 + lib/exec_wrapper.js | 2 +- lib/exec_wrapper.js.map | 2 +- lib/exec_wrapper.test.js.map | 2 +- src/codeql.ts | 5 +++-- src/error_matcher.ts | 19 +++++++++++++++++++ src/exec_wrapper.test.ts | 3 ++- src/exec_wrapper.ts | 5 ++--- 11 files changed, 40 insertions(+), 12 deletions(-) create mode 100644 lib/error_matcher.js create mode 100644 lib/error_matcher.js.map create mode 100644 src/error_matcher.ts diff --git a/lib/codeql.js b/lib/codeql.js index 32ba1d384..ea0a032a6 100644 --- a/lib/codeql.js +++ b/lib/codeql.js @@ -22,6 +22,7 @@ const globalutil = __importStar(require("util")); const v4_1 = __importDefault(require("uuid/v4")); const api = __importStar(require("./api-client")); const defaults = __importStar(require("./defaults.json")); // Referenced from codeql-action-sync-tool! +const error_matcher_1 = require("./error_matcher"); const exec_wrapper_1 = require("./exec_wrapper"); const util = __importStar(require("./util")); /** @@ -296,7 +297,7 @@ function getCodeQLForCmd(cmd) { databasePath, '--', traceCommand - ], [[0, new RegExp("(No source code was seen during the build\\.|No JavaScript or TypeScript code found\\.)"), 'foo bar']]); + ], error_matcher_1.error_matchers); }, finalizeDatabase: async function (databasePath) { await exec_wrapper_1.exec_wrapper(cmd, [ @@ -304,7 +305,7 @@ function getCodeQLForCmd(cmd) { 'finalize', ...getExtraOptionsFromEnv(['database', 'finalize']), databasePath - ], [[0, new RegExp("(No source code was seen during the build\\.|No JavaScript or TypeScript code found\\.)"), 'foo bar']]); + ], error_matcher_1.error_matchers); }, resolveQueries: async function (queries, extraSearchPath) { const codeqlArgs = [ diff --git a/lib/codeql.js.map b/lib/codeql.js.map index 9da2c85b0..b7b0659d5 100644 --- a/lib/codeql.js.map +++ b/lib/codeql.js.map @@ -1 +1 @@ -{"version":3,"file":"codeql.js","sourceRoot":"","sources":["../src/codeql.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsC;AACtC,oDAAsC;AACtC,2DAA6C;AAE7C,+DAAiD;AACjD,uCAAyB;AACzB,2CAA6B;AAC7B,+CAAiC;AACjC,+CAAiC;AACjC,iDAAmC;AACnC,iDAA6B;AAE7B,kDAAoC;AACpC,0DAA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,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,SAAS,EAAE;gBACvD,MAAM,GAAG,GACP,yBAAyB,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,8BAA8B,CAAC;gBACpG,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;aACtB;YACD,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC;IACD,IAAI,GAAG,GAAG,cAAc,OAAC,OAAO,0CAAG,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/D,IAAI,QAAQ,GAAG,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;QAChC,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;QACnC,eAAe,OAAC,OAAO,0CAAG,IAAI,CAAC,CAAC,CAAC,SAAG,IAAI,0CAAE,KAAK,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChF,OAAO,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC9B,CAAC;AAjCD,0CAiCC"} \ No newline at end of file diff --git a/lib/error_matcher.js b/lib/error_matcher.js new file mode 100644 index 000000000..4b523b5f9 --- /dev/null +++ b/lib/error_matcher.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.error_matchers = [ + [32, new RegExp("No JavaScript or TypeScript code found\\."), 'foo bar'] +]; +//# sourceMappingURL=error_matcher.js.map \ No newline at end of file diff --git a/lib/error_matcher.js.map b/lib/error_matcher.js.map new file mode 100644 index 000000000..02bb25613 --- /dev/null +++ b/lib/error_matcher.js.map @@ -0,0 +1 @@ +{"version":3,"file":"error_matcher.js","sourceRoot":"","sources":["../src/error_matcher.ts"],"names":[],"mappings":";;AAGa,QAAA,cAAc,GAAmB;IAC5C,CAAC,EAAE,EAAE,IAAI,MAAM,CAAC,2CAA2C,CAAC,EAAE,SAAS,CAAC;CACzE,CAAC"} \ No newline at end of file diff --git a/lib/exec_wrapper.js b/lib/exec_wrapper.js index f698aab2d..c8224d25d 100644 --- a/lib/exec_wrapper.js +++ b/lib/exec_wrapper.js @@ -64,7 +64,7 @@ async function exec_wrapper(commandLine, args, matchers, options) { return returnState; if (matchers) { for (const [customCode, regex, message] of matchers) { - if (customCode === returnState || regex.test(stderr) || regex.test(stdout)) { + if (customCode === returnState || regex && (regex.test(stderr) || regex.test(stdout))) { throw new Error(message); } } diff --git a/lib/exec_wrapper.js.map b/lib/exec_wrapper.js.map index 60d0bec1d..32f47be9c 100644 --- a/lib/exec_wrapper.js.map +++ b/lib/exec_wrapper.js.map @@ -1 +1 @@ -{"version":3,"file":"exec_wrapper.js","sourceRoot":"","sources":["../src/exec_wrapper.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAAsC;AAMtC;;;;;;;;;;GAUG;AACI,KAAK,UAAU,YAAY,CAAC,WAAmB,EAAE,IAAe,EACpC,QAAyB,EACzB,OAAwB;;IAEzD,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,IAAI,SAAS,GAAG;QACd,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;;YACvB,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,IAAI,aAAA,OAAO,0CAAE,SAAS,0CAAE,MAAM,MAAK,SAAS,EAAE;gBAC5C,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aAChC;iBAAM;gBACL,2FAA2F;gBAC3F,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;aAC5B;QAEH,CAAC;QACD,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;;YACvB,MAAM,IAAI,IAAI,CAAC,QAAQ,EA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AAK,CAAC;QAAE,OAAO,WAAW,CAAC;IAE1C,IAAI,QAAQ,EAAE;QACZ,KAAK,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,QAAQ,EAAE;YACnD,IAAI,UAAU,KAAK,WAAW,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAG;gBACtF,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;aAC1B;SACF;KACF;IAED,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;QACnC,qFAAqF;QACrF,UAAI,OAAO,0CAAE,gBAAgB,EAAE;YAC7B,OAAO,WAAW,CAAC;SACpB;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,iBAAiB,WAAW,4BAA4B,WAAW,EAAE,CAAC,CAAC;SACxF;KACF;SAAM;QACL,MAAM,WAAW,CAAC;KACnB;AACH,CAAC;AAjED,oCAiEC"} \ No newline at end of file diff --git a/lib/exec_wrapper.test.js.map b/lib/exec_wrapper.test.js.map index 64c41c8be..b805c8b80 100644 --- a/lib/exec_wrapper.test.js.map +++ b/lib/exec_wrapper.test.js.map @@ -1 +1 @@ -{"version":3,"file":"exec_wrapper.test.js","sourceRoot":"","sources":["../src/exec_wrapper.test.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsC;AACtC,8CAAuB;AAEvB,iDAA4D;AAC5D,mDAA2C;AAC3C,uBAAuB;AAEvB,iDAAiD;AAEjD,iDAAiD;AACjD,WAAW;AACX,uCAAuC;AACvC,8DAA8D;AAC9D,KAAK;AAEL,0BAAU,CAAC,aAAI,CAAC,CAAC;AAEjB,aAAI,CAAC,8CAA8C,EAAE,KAAK,EAAC,CAAC,EAAC,EAAE;IAE7D,MAAM,WAAW,GAAG,iBAAiB,CAAC,qBAAqB,EAAE,qBAAqB,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAE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,SAAS,iBAAiB,CAAC,cAAsB,EAAE,cAAsB,EAC9C,mBAA4B,EAAE,eAAwB;IAE/E,IAAI,OAAO,GAAG,EAAE,CAAC;IAEjB,IAAI,cAAc;QAAE,OAAO,IAAI,iBAAiB,GAAG,cAAc,GAAG,OAAO,CAAC;IAC5E,IAAI,cAAc;QAAE,OAAO,IAAI,mBAAmB,GAAG,cAAc,GAAG,OAAO,CAAC;IAE9E,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IAE/F,IAAI,mBAAmB;QAAE,OAAO,IAAI,qBAAqB,GAAG,mBAAmB,GAAG,OAAO,CAAC;IAC1F,IAAI,eAAe;QAAE,OAAO,IAAI,qBAAqB,GAAG,eAAe,GAAG,GAAG,CAAC;IAE9E,OAAO,WAAW,GAAG,OAAO,GAAG,GAAG,CAAC;AACrC,CAAC"} \ No newline at end of file diff --git a/src/codeql.ts b/src/codeql.ts index 8b35e3461..beb46121c 100644 --- a/src/codeql.ts +++ b/src/codeql.ts @@ -12,6 +12,7 @@ import uuidV4 from 'uuid/v4'; import * as api from './api-client'; import * as defaults from './defaults.json'; // Referenced from codeql-action-sync-tool! +import { errorMatchers} from './error_matcher'; import { exec_wrapper } from './exec_wrapper'; import { Language } from './languages'; import * as util from './util'; @@ -390,7 +391,7 @@ function getCodeQLForCmd(cmd: string): CodeQL { '--', traceCommand ], - [[0, new RegExp("(No source code was seen during the build\\.|No JavaScript or TypeScript code found\\.)"), 'foo bar']] + errorMatchers ); }, finalizeDatabase: async function(databasePath: string) { @@ -401,7 +402,7 @@ function getCodeQLForCmd(cmd: string): CodeQL { ...getExtraOptionsFromEnv(['database', 'finalize']), databasePath ], - [[0, new RegExp("(No source code was seen during the build\\.|No JavaScript or TypeScript code found\\.)"), 'foo bar']]); + errorMatchers); }, resolveQueries: async function(queries: string[], extraSearchPath: string | undefined) { const codeqlArgs = [ diff --git a/src/error_matcher.ts b/src/error_matcher.ts new file mode 100644 index 000000000..f3ffc5e94 --- /dev/null +++ b/src/error_matcher.ts @@ -0,0 +1,19 @@ + +export type ErrorMatcher = [number|null, RegExp|null, string]; + +const namedMatchers: { [key: string]: ErrorMatcher } = { + noSourceCodeFound: [ + 32, + null, + `No source code was seen during the build. Please see... +https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/troubleshooting-code-scanning#no-code-found-during-the-build` + ], + noSourceCodeFoundJavascript: [ + null, + new RegExp("No JavaScript or TypeScript code found\\."), + `No source code was seen during the build. Please see... +https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/troubleshooting-code-scanning#no-code-found-during-the-build` + ] +}; + +export const errorMatchers = Object.values(namedMatchers); diff --git a/src/exec_wrapper.test.ts b/src/exec_wrapper.test.ts index 036551a99..46b93ab80 100644 --- a/src/exec_wrapper.test.ts +++ b/src/exec_wrapper.test.ts @@ -1,7 +1,8 @@ import * as exec from '@actions/exec'; import test from 'ava'; -import { exec_wrapper, ErrorMatcher } from './exec_wrapper'; +import { ErrorMatcher } from './error_matcher'; +import { exec_wrapper } from './exec_wrapper'; import {setupTests} from './testing-utils'; // import fs from 'fs'; diff --git a/src/exec_wrapper.ts b/src/exec_wrapper.ts index b9a70e7c4..ff9088004 100644 --- a/src/exec_wrapper.ts +++ b/src/exec_wrapper.ts @@ -1,8 +1,7 @@ import * as exec from '@actions/exec'; import * as im from '@actions/exec/lib/interfaces'; - -export type ErrorMatcher = [number, RegExp, string]; +import {ErrorMatcher} from './error_matcher'; /** * Wrapper for exec.exec which checks for specific return code and/or regex matches in console output. @@ -64,7 +63,7 @@ export async function exec_wrapper(commandLine: string, args?: string[], if (matchers) { for (const [customCode, regex, message] of matchers) { - if (customCode === returnState || regex.test(stderr) || regex.test(stdout) ) { + if (customCode === returnState || regex && (regex.test(stderr) || regex.test(stdout)) ) { throw new Error(message); } } From 3e6d23928bb590e0714fcbd23a8fa3ea01aaa5cb Mon Sep 17 00:00:00 2001 From: Nick Fyson Date: Mon, 7 Sep 2020 22:50:37 +0100 Subject: [PATCH 12/35] add test for initial error matcher --- lib/codeql.js | 4 ++-- lib/codeql.js.map | 2 +- lib/error_matcher.js | 18 +++++++++++++++--- lib/error_matcher.js.map | 2 +- lib/error_matcher.test.js | 33 +++++++++++++++++++++++++++++++++ lib/error_matcher.test.js.map | 1 + src/error_matcher.test.ts | 33 +++++++++++++++++++++++++++++++++ src/error_matcher.ts | 18 +++++++++--------- 8 files changed, 95 insertions(+), 16 deletions(-) create mode 100644 lib/error_matcher.test.js create mode 100644 lib/error_matcher.test.js.map create mode 100644 src/error_matcher.test.ts diff --git a/lib/codeql.js b/lib/codeql.js index ea0a032a6..c3f5c0897 100644 --- a/lib/codeql.js +++ b/lib/codeql.js @@ -297,7 +297,7 @@ function getCodeQLForCmd(cmd) { databasePath, '--', traceCommand - ], error_matcher_1.error_matchers); + ], error_matcher_1.errorMatchers); }, finalizeDatabase: async function (databasePath) { await exec_wrapper_1.exec_wrapper(cmd, [ @@ -305,7 +305,7 @@ function getCodeQLForCmd(cmd) { 'finalize', ...getExtraOptionsFromEnv(['database', 'finalize']), databasePath - ], error_matcher_1.error_matchers); + ], error_matcher_1.errorMatchers); }, resolveQueries: async function (queries, extraSearchPath) { const codeqlArgs = [ diff --git a/lib/codeql.js.map b/lib/codeql.js.map index b7b0659d5..24a578537 100644 --- a/lib/codeql.js.map +++ b/lib/codeql.js.map @@ -1 +1 @@ -{"version":3,"file":"codeql.js","sourceRoot":"","sources":["../src/codeql.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsC;AACtC,oDAAsC;AACtC,2DAA6C;AAE7C,+DAAiD;AACjD,uCAAyB;AACzB,2CAA6B;AAC7B,+CAAiC;AACjC,+CAAiC;AACjC,iDAAmC;AACnC,iDAA6B;AAE7B,kDAAoC;AACpC,0DAA4C,CAAC,2CAA2C;AACxF,mDAAgD;AAChD,iDAA8C;AAE9C,6CAA+B;AA8E/B;;;GAGG;AACH,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AG,CAAC,CAAC;aACtB;YACD,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC;IACD,IAAI,GAAG,GAAG,cAAc,OAAC,OAAO,0CAAG,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/D,IAAI,QAAQ,GAAG,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;QAChC,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;QACnC,eAAe,OAAC,OAAO,0CAAG,IAAI,CAAC,CAAC,CAAC,SAAG,IAAI,0CAAE,KAAK,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChF,OAAO,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC9B,CAAC;AAjCD,0CAiCC"} \ No newline at end of file diff --git a/lib/error_matcher.js b/lib/error_matcher.js index 4b523b5f9..fee347b71 100644 --- a/lib/error_matcher.js +++ b/lib/error_matcher.js @@ -1,6 +1,18 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.error_matchers = [ - [32, new RegExp("No JavaScript or TypeScript code found\\."), 'foo bar'] -]; +// exported only for testing purposes +exports.namedMatchersForTesting = { + /* + In due course it may be possible to remove the regex, if/when javascript also exits with code 32. + For context see https://github.com/github/semmle-code/pull/36921 + */ + noSourceCodeFound: [ + 32, + new RegExp("No JavaScript or TypeScript code found\\."), + `No source code was seen during the build. Please see... +https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/troubleshooting-code-scanning#no-code-found-during-the-build` + ], +}; +// we collapse the matches into an array for use in exec_wrapper +exports.errorMatchers = Object.values(exports.namedMatchersForTesting); //# sourceMappingURL=error_matcher.js.map \ No newline at end of file diff --git a/lib/error_matcher.js.map b/lib/error_matcher.js.map index 02bb25613..c5628937a 100644 --- a/lib/error_matcher.js.map +++ b/lib/error_matcher.js.map @@ -1 +1 @@ -{"version":3,"file":"error_matcher.js","sourceRoot":"","sources":["../src/error_matcher.ts"],"names":[],"mappings":";;AAGa,QAAA,cAAc,GAAmB;IAC5C,CAAC,EAAE,EAAE,IAAI,MAAM,CAAC,2CAA2C,CAAC,EAAE,SAAS,CAAC;CACzE,CAAC"} \ No newline at end of file +{"version":3,"file":"error_matcher.js","sourceRoot":"","sources":["../src/error_matcher.ts"],"names":[],"mappings":";;AAGA,qCAAqC;AACxB,QAAA,uBAAuB,GAAoC;IACtE;;;MAGE;IACF,iBAAiB,EAAE;QACjB,EAAE;QACF,IAAI,MAAM,CAAC,2CAA2C,CAAC;QACvD;wJACoJ;KACrJ;CACF,CAAC;AAEF,gEAAgE;AACnD,QAAA,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,+BAAuB,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/error_matcher.test.js b/lib/error_matcher.test.js new file mode 100644 index 000000000..1969b9ceb --- /dev/null +++ b/lib/error_matcher.test.js @@ -0,0 +1,33 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const ava_1 = __importDefault(require("ava")); +const error_matcher_1 = require("./error_matcher"); +/* +NB We test the regexes for all the matchers against example log output snippets. +*/ +ava_1.default('noSourceCodeFound matches against example javascript output', async (t) => { + t.assert(testErrorMatcher("noSourceCodeFound", ` + 2020-09-07T17:39:53.9050522Z [2020-09-07 17:39:53] [build] Done extracting /opt/hostedtoolcache/CodeQL/0.0.0-20200630/x64/codeql/javascript/tools/data/externs/web/ie_vml.js (3 ms) + 2020-09-07T17:39:53.9051849Z [2020-09-07 17:39:53] [build-err] No JavaScript or TypeScript code found. + 2020-09-07T17:39:53.9052444Z [2020-09-07 17:39:53] [build-err] No JavaScript or TypeScript code found. + 2020-09-07T17:39:53.9251124Z [2020-09-07 17:39:53] [ERROR] Spawned process exited abnormally (code 255; tried to run: [/opt/hostedtoolcache/CodeQL/0.0.0-20200630/x64/codeql/javascript/tools/autobuild.sh]) + `)); +}); +function testErrorMatcher(matcherName, logSample) { + const regex = error_matcher_1.namedMatchersForTesting[matcherName] ? error_matcher_1.namedMatchersForTesting[matcherName][1] : null; + if (regex) { + return regex.test(logSample); + } + else { + if (error_matcher_1.namedMatchersForTesting[matcherName]) { + throw new Error(`Cannot test matcher ${matcherName} with null regex`); + } + else { + throw new Error(`Unknown matcher ${matcherName}`); + } + } +} +//# sourceMappingURL=error_matcher.test.js.map \ No newline at end of file diff --git a/lib/error_matcher.test.js.map b/lib/error_matcher.test.js.map new file mode 100644 index 000000000..bb17b4bda --- /dev/null +++ b/lib/error_matcher.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"error_matcher.test.js","sourceRoot":"","sources":["../src/error_matcher.test.ts"],"names":[],"mappings":";;;;;AACA,8CAAuB;AAEvB,mDAA0D;AAE1D;;EAEE;AAEF,aAAI,CAAC,6DAA6D,EAAE,KAAK,EAAC,CAAC,EAAC,EAAE;IAC5E,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,mBAAmB,EAAE;;;;;GAK9C,CAAC,CAAC,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,SAAS,gBAAgB,CAAC,WAAmB,EAAE,SAAiB;IAE9D,MAAM,KAAK,GAAG,uCAAuB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,uCAAuB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAEpG,IAAI,KAAK,EAAE;QACT,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KAC9B;SAAM;QACL,IAAI,uCAAuB,CAAC,WAAW,CAAC,EAAE;YACxC,MAAM,IAAI,KAAK,CAAC,uBAAuB,WAAW,kBAAkB,CAAC,CAAC;SACvE;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,mBAAmB,WAAW,EAAE,CAAC,CAAC;SACnD;KACF;AAEH,CAAC"} \ No newline at end of file diff --git a/src/error_matcher.test.ts b/src/error_matcher.test.ts new file mode 100644 index 000000000..9d86eebe9 --- /dev/null +++ b/src/error_matcher.test.ts @@ -0,0 +1,33 @@ + +import test from 'ava'; + +import { namedMatchersForTesting } from './error_matcher'; + +/* +NB We test the regexes for all the matchers against example log output snippets. +*/ + +test('noSourceCodeFound matches against example javascript output', async t => { + t.assert(testErrorMatcher("noSourceCodeFound", ` + 2020-09-07T17:39:53.9050522Z [2020-09-07 17:39:53] [build] Done extracting /opt/hostedtoolcache/CodeQL/0.0.0-20200630/x64/codeql/javascript/tools/data/externs/web/ie_vml.js (3 ms) + 2020-09-07T17:39:53.9051849Z [2020-09-07 17:39:53] [build-err] No JavaScript or TypeScript code found. + 2020-09-07T17:39:53.9052444Z [2020-09-07 17:39:53] [build-err] No JavaScript or TypeScript code found. + 2020-09-07T17:39:53.9251124Z [2020-09-07 17:39:53] [ERROR] Spawned process exited abnormally (code 255; tried to run: [/opt/hostedtoolcache/CodeQL/0.0.0-20200630/x64/codeql/javascript/tools/autobuild.sh]) + `)); +}); + +function testErrorMatcher(matcherName: string, logSample: string): boolean { + + const regex = namedMatchersForTesting[matcherName] ? namedMatchersForTesting[matcherName][1] : null; + + if (regex) { + return regex.test(logSample); + } else { + if (namedMatchersForTesting[matcherName]) { + throw new Error(`Cannot test matcher ${matcherName} with null regex`); + } else { + throw new Error(`Unknown matcher ${matcherName}`); + } + } + +} diff --git a/src/error_matcher.ts b/src/error_matcher.ts index f3ffc5e94..5344cd06d 100644 --- a/src/error_matcher.ts +++ b/src/error_matcher.ts @@ -1,19 +1,19 @@ export type ErrorMatcher = [number|null, RegExp|null, string]; -const namedMatchers: { [key: string]: ErrorMatcher } = { +// exported only for testing purposes +export const namedMatchersForTesting: { [key: string]: ErrorMatcher } = { + /* + In due course it may be possible to remove the regex, if/when javascript also exits with code 32. + For context see https://github.com/github/semmle-code/pull/36921 + */ noSourceCodeFound: [ 32, - null, - `No source code was seen during the build. Please see... -https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/troubleshooting-code-scanning#no-code-found-during-the-build` - ], - noSourceCodeFoundJavascript: [ - null, new RegExp("No JavaScript or TypeScript code found\\."), `No source code was seen during the build. Please see... https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/troubleshooting-code-scanning#no-code-found-during-the-build` - ] + ], }; -export const errorMatchers = Object.values(namedMatchers); +// we collapse the matches into an array for use in exec_wrapper +export const errorMatchers = Object.values(namedMatchersForTesting); From cc2dfaf5d871902b24801add006e43750ad264fb Mon Sep 17 00:00:00 2001 From: Nick Fyson Date: Mon, 7 Sep 2020 23:02:58 +0100 Subject: [PATCH 13/35] clean up and rename things to follow proper conventions --- lib/codeql.js | 8 ++--- lib/codeql.js.map | 2 +- lib/{error_matcher.js => error-matcher.js} | 4 +-- lib/error-matcher.js.map | 1 + ..._matcher.test.js => error-matcher.test.js} | 4 +-- ....test.js.map => error-matcher.test.js.map} | 2 +- lib/error_matcher.js.map | 1 - lib/{exec_wrapper.js => exec-wrapper.js} | 6 ++-- lib/exec-wrapper.js.map | 1 + ...c_wrapper.test.js => exec-wrapper.test.js} | 33 +++++++---------- lib/exec-wrapper.test.js.map | 1 + lib/exec_wrapper.js.map | 1 - lib/exec_wrapper.test.js.map | 1 - src/codeql.ts | 8 ++--- ..._matcher.test.ts => error-matcher.test.ts} | 2 +- src/{error_matcher.ts => error-matcher.ts} | 2 +- ...c_wrapper.test.ts => exec-wrapper.test.ts} | 35 +++++++------------ src/{exec_wrapper.ts => exec-wrapper.ts} | 8 ++--- 18 files changed, 52 insertions(+), 68 deletions(-) rename lib/{error_matcher.js => error-matcher.js} (87%) create mode 100644 lib/error-matcher.js.map rename lib/{error_matcher.test.js => error-matcher.test.js} (94%) rename lib/{error_matcher.test.js.map => error-matcher.test.js.map} (82%) delete mode 100644 lib/error_matcher.js.map rename lib/{exec_wrapper.js => exec-wrapper.js} (95%) create mode 100644 lib/exec-wrapper.js.map rename lib/{exec_wrapper.test.js => exec-wrapper.test.js} (73%) create mode 100644 lib/exec-wrapper.test.js.map delete mode 100644 lib/exec_wrapper.js.map delete mode 100644 lib/exec_wrapper.test.js.map rename src/{error_matcher.test.ts => error-matcher.test.ts} (95%) rename src/{error_matcher.ts => error-matcher.ts} (91%) rename src/{exec_wrapper.test.ts => exec-wrapper.test.ts} (80%) rename src/{exec_wrapper.ts => exec-wrapper.ts} (90%) diff --git a/lib/codeql.js b/lib/codeql.js index c3f5c0897..b445fe9eb 100644 --- a/lib/codeql.js +++ b/lib/codeql.js @@ -22,8 +22,8 @@ const globalutil = __importStar(require("util")); const v4_1 = __importDefault(require("uuid/v4")); const api = __importStar(require("./api-client")); const defaults = __importStar(require("./defaults.json")); // Referenced from codeql-action-sync-tool! -const error_matcher_1 = require("./error_matcher"); -const exec_wrapper_1 = require("./exec_wrapper"); +const error_matcher_1 = require("./error-matcher"); +const exec_wrapper_1 = require("./exec-wrapper"); const util = __importStar(require("./util")); /** * Stores the CodeQL object, and is populated by `setupCodeQL` or `getCodeQL`. @@ -290,7 +290,7 @@ function getCodeQLForCmd(cmd) { const ext = process.platform === 'win32' ? '.cmd' : '.sh'; const traceCommand = path.resolve(JSON.parse(extractorPath), 'tools', 'autobuild' + ext); // Run trace command - await exec_wrapper_1.exec_wrapper(cmd, [ + await exec_wrapper_1.execErrorCatcher(cmd, [ 'database', 'trace-command', ...getExtraOptionsFromEnv(['database', 'trace-command']), @@ -300,7 +300,7 @@ function getCodeQLForCmd(cmd) { ], error_matcher_1.errorMatchers); }, finalizeDatabase: async function (databasePath) { - await exec_wrapper_1.exec_wrapper(cmd, [ + await exec_wrapper_1.execErrorCatcher(cmd, [ 'database', 'finalize', ...getExtraOptionsFromEnv(['database', 'finalize']), diff --git a/lib/codeql.js.map b/lib/codeql.js.map index 24a578537..864348ab3 100644 --- a/lib/codeql.js.map +++ b/lib/codeql.js.map @@ -1 +1 @@ -{"version":3,"file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CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;YACrB,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC;YACnB,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,SAAS,EAAE;gBACvD,MAAM,GAAG,GACP,yBAAyB,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,8BAA8B,CAAC;gBACpG,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;aACtB;YACD,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC;IACD,IAAI,GAAG,GAAG,cAAc,OAAC,OAAO,0CAAG,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/D,IAAI,QAAQ,GAAG,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;QAChC,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;QACnC,eAAe,OAAC,OAAO,0CAAG,IAAI,CAAC,CAAC,CAAC,SAAG,IAAI,0CAAE,KAAK,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChF,OAAO,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC9B,CAAC;AAjCD,0CAiCC"} \ No newline at end of file diff --git a/lib/error_matcher.js b/lib/error-matcher.js similarity index 87% rename from lib/error_matcher.js rename to lib/error-matcher.js index fee347b71..2557b5a07 100644 --- a/lib/error_matcher.js +++ b/lib/error-matcher.js @@ -13,6 +13,6 @@ exports.namedMatchersForTesting = { https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/troubleshooting-code-scanning#no-code-found-during-the-build` ], }; -// we collapse the matches into an array for use in exec_wrapper +// we collapse the matches into an array for use in execErrorCatcher exports.errorMatchers = Object.values(exports.namedMatchersForTesting); -//# sourceMappingURL=error_matcher.js.map \ No newline at end of file +//# sourceMappingURL=error-matcher.js.map \ No newline at end of file diff --git a/lib/error-matcher.js.map b/lib/error-matcher.js.map new file mode 100644 index 000000000..3e6fa866c --- /dev/null +++ b/lib/error-matcher.js.map @@ -0,0 +1 @@ +{"version":3,"file":"error-matcher.js","sourceRoot":"","sources":["../src/error-matcher.ts"],"names":[],"mappings":";;AAGA,qCAAqC;AACxB,QAAA,uBAAuB,GAAoC;IACtE;;;MAGE;IACF,iBAAiB,EAAE;QACjB,EAAE;QACF,IAAI,MAAM,CAAC,2CAA2C,CAAC;QACvD;wJACoJ;KACrJ;CACF,CAAC;AAEF,oEAAoE;AACvD,QAAA,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,+BAAuB,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/error_matcher.test.js b/lib/error-matcher.test.js similarity index 94% rename from lib/error_matcher.test.js rename to lib/error-matcher.test.js index 1969b9ceb..d68d58d96 100644 --- a/lib/error_matcher.test.js +++ b/lib/error-matcher.test.js @@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const ava_1 = __importDefault(require("ava")); -const error_matcher_1 = require("./error_matcher"); +const error_matcher_1 = require("./error-matcher"); /* NB We test the regexes for all the matchers against example log output snippets. */ @@ -30,4 +30,4 @@ function testErrorMatcher(matcherName, logSample) { } } } -//# sourceMappingURL=error_matcher.test.js.map \ No newline at end of file +//# sourceMappingURL=error-matcher.test.js.map \ No newline at end of file diff --git a/lib/error_matcher.test.js.map b/lib/error-matcher.test.js.map similarity index 82% rename from lib/error_matcher.test.js.map rename to lib/error-matcher.test.js.map index bb17b4bda..60db0bb8b 100644 --- a/lib/error_matcher.test.js.map +++ b/lib/error-matcher.test.js.map @@ -1 +1 @@ -{"version":3,"file":"error_matcher.test.js","sourceRoot":"","sources":["../src/error_matcher.test.ts"],"names":[],"mappings":";;;;;AACA,8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AO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KAC9B;SAAM;QACL,IAAI,uCAAuB,CAAC,WAAW,CAAC,EAAE;YACxC,MAAM,IAAI,KAAK,CAAC,uBAAuB,WAAW,kBAAkB,CAAC,CAAC;SACvE;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,mBAAmB,WAAW,EAAE,CAAC,CAAC;SACnD;KACF;AAEH,CAAC"} \ No newline at end of file diff --git a/lib/error_matcher.js.map b/lib/error_matcher.js.map deleted file mode 100644 index c5628937a..000000000 --- a/lib/error_matcher.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"error_matcher.js","sourceRoot":"","sources":["../src/error_matcher.ts"],"names":[],"mappings":";;AAGA,qCAAqC;AACxB,QAAA,uBAAuB,GAAoC;IACtE;;;MAGE;IACF,iBAAiB,EAAE;QACjB,EAAE;QACF,IAAI,MAAM,CAAC,2CAA2C,CAAC;QACvD;wJACoJ;KACrJ;CACF,CAAC;AAEF,gEAAgE;AACnD,QAAA,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,+BAAuB,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/exec_wrapper.js b/lib/exec-wrapper.js similarity index 95% rename from lib/exec_wrapper.js rename to lib/exec-wrapper.js index c8224d25d..9921a3a3f 100644 --- a/lib/exec_wrapper.js +++ b/lib/exec-wrapper.js @@ -19,7 +19,7 @@ const exec = __importStar(require("@actions/exec")); * @param options optional exec options. See ExecOptions * @returns Promise exit code */ -async function exec_wrapper(commandLine, args, matchers, options) { +async function execErrorCatcher(commandLine, args, matchers, options) { var _a; let stdout = ''; let stderr = ''; @@ -82,5 +82,5 @@ async function exec_wrapper(commandLine, args, matchers, options) { throw returnState; } } -exports.exec_wrapper = exec_wrapper; -//# sourceMappingURL=exec_wrapper.js.map \ No newline at end of file +exports.execErrorCatcher = execErrorCatcher; +//# sourceMappingURL=exec-wrapper.js.map \ No newline at end of file diff --git a/lib/exec-wrapper.js.map b/lib/exec-wrapper.js.map new file mode 100644 index 000000000..b0b416c87 --- /dev/null +++ b/lib/exec-wrapper.js.map @@ -0,0 +1 @@ +{"version":3,"file":"exec-wrapper.js","sourceRoot":"","sources":["../src/exec-wrapper.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAAsC;AAKtC;;;;;;;;;;GAUG;AACI,KAAK,UAAU,gBAAgB,CAAC,WAAmB,EAAE,IAAe,EACpC,QAAyB,EACzB,OAAwB;;IAE7D,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,IAAI,SAAS,GAAG;QACd,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;;YACvB,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,IAAI,aAAA,OAAO,0CAAE,SAAS,0CAAE,MAAM,MAAK,SAAS,EAAE;gBAC5C,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aAChC;iBAAM;gBACL,2FAA2F;gBAC3F,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;aAC5B;QAEH,CAAC;QACD,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;;YACvB,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,IAAI,aAAA,OAAO,0CAAE,SAAS,0CAAE,MAAM,MAAK,SAAS,EAAE;gBAC5C,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aAChC;iBAAM;gBACL,2FAA2F;gBAC3F,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;aAC5B;QACH,CAAC;KACF,CAAC;IAEF,0GAA0G;IAC1G,IAAI,WAAyB,CAAC;IAC9B,IAAI;QACF,WAAW,GAAG,MAAM,IAAI,CAAC,IAAI,CAC3B,WAAW,EACX,IAAI,EACJ;YACE,GAAG,OAAO;YACV,SAAS,EAAE,SAAS;YACpB,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;KACN;IAAC,OAAO,CAAC,EAAE;QACV,WAAW,GAAG,CAAC,CAAC;KACjB;IAED,mEAAmE;IACnE,IAAI,WAAW,KAAK,CAAC;QAAE,OAAO,WAAW,CAAC;IAE1C,IAAI,QAAQ,EAAE;QACZ,KAAK,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,QAAQ,EAAE;YACnD,IAAI,UAAU,KAAK,WAAW,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAG;gBACtF,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;aAC1B;SACF;KACF;IAED,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;QACnC,qFAAqF;QACrF,UAAI,OAAO,0CAAE,gBAAgB,EAAE;YAC7B,OAAO,WAAW,CAAC;SACpB;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,iBAAiB,WAAW,4BAA4B,WAAW,EAAE,CAAC,CAAC;SACxF;KACF;SAAM;QACL,MAAM,WAAW,CAAC;KACnB;AACH,CAAC;AAjED,4CAiEC"} \ No newline at end of file diff --git a/lib/exec_wrapper.test.js b/lib/exec-wrapper.test.js similarity index 73% rename from lib/exec_wrapper.test.js rename to lib/exec-wrapper.test.js index b0ceebc73..7a9279e37 100644 --- a/lib/exec_wrapper.test.js +++ b/lib/exec-wrapper.test.js @@ -12,33 +12,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); const exec = __importStar(require("@actions/exec")); const ava_1 = __importDefault(require("ava")); -const exec_wrapper_1 = require("./exec_wrapper"); +const exec_wrapper_1 = require("./exec-wrapper"); const testing_utils_1 = require("./testing-utils"); -// import fs from 'fs'; -// import { exec_wrapper } from './exec_wrapper'; -// const matchers: [[number, RegExp, string]] = [ -// [-999, -// new RegExp("match this string"), -// 'No source code was found. CUSTOM ERROR MESSAGE HERE'], -// ]; testing_utils_1.setupTests(ava_1.default); ava_1.default('matchers are never applied if non-error exit', async (t) => { const testCommand = buildDummyCommand("foo bar\\nblort qux", "foo bar\\nblort qux", '', 0); const matchers = [[123, new RegExp("foo bar"), 'error!!!']]; t.deepEqual(await exec.exec(testCommand), 0); - t.deepEqual(await exec_wrapper_1.exec_wrapper(testCommand, [], matchers), 0); + t.deepEqual(await exec_wrapper_1.execErrorCatcher(testCommand, [], matchers), 0); }); ava_1.default('regex matchers are applied to stdout for non-zero exit code', async (t) => { const testCommand = buildDummyCommand("foo bar\\nblort qux", '', '', 1); const matchers = [[123, new RegExp("foo bar"), '🦄']]; await t.throwsAsync(exec.exec(testCommand), { instanceOf: Error, message: 'The process \'node\' failed with exit code 1' }); - await t.throwsAsync(exec_wrapper_1.exec_wrapper(testCommand, [], matchers), { instanceOf: Error, message: '🦄' }); + await t.throwsAsync(exec_wrapper_1.execErrorCatcher(testCommand, [], matchers), { instanceOf: Error, message: '🦄' }); }); ava_1.default('regex matchers are applied to stderr for non-zero exit code', async (t) => { const testCommand = buildDummyCommand("non matching string", 'foo bar\\nblort qux', '', 1); const matchers = [[123, new RegExp("foo bar"), '🦄']]; await t.throwsAsync(exec.exec(testCommand), { instanceOf: Error, message: 'The process \'node\' failed with exit code 1' }); - await t.throwsAsync(exec_wrapper_1.exec_wrapper(testCommand, [], matchers), { instanceOf: Error, message: '🦄' }); + await t.throwsAsync(exec_wrapper_1.execErrorCatcher(testCommand, [], matchers), { instanceOf: Error, message: '🦄' }); }); ava_1.default('matcher returns correct error message when multiple matchers defined', async (t) => { const testCommand = buildDummyCommand("non matching string", 'foo bar\\nblort qux', '', 1); @@ -46,7 +39,7 @@ ava_1.default('matcher returns correct error message when multiple matchers defi [123, new RegExp("foo bar"), '🦄'], [789, new RegExp("blah blah"), '🤦‍♂️']]; await t.throwsAsync(exec.exec(testCommand), { instanceOf: Error, message: 'The process \'node\' failed with exit code 1' }); - await t.throwsAsync(exec_wrapper_1.exec_wrapper(testCommand, [], matchers), { instanceOf: Error, message: '🦄' }); + await t.throwsAsync(exec_wrapper_1.execErrorCatcher(testCommand, [], matchers), { instanceOf: Error, message: '🦄' }); }); ava_1.default('matcher returns first match to regex when multiple matches', async (t) => { const testCommand = buildDummyCommand("non matching string", 'foo bar\\nblort qux', '', 1); @@ -54,20 +47,20 @@ ava_1.default('matcher returns first match to regex when multiple matches', asyn [789, new RegExp("blah blah"), '🤦‍♂️'], [987, new RegExp("foo bar"), '🚫']]; await t.throwsAsync(exec.exec(testCommand), { instanceOf: Error, message: 'The process \'node\' failed with exit code 1' }); - await t.throwsAsync(exec_wrapper_1.exec_wrapper(testCommand, [], matchers), { instanceOf: Error, message: '🦄' }); + await t.throwsAsync(exec_wrapper_1.execErrorCatcher(testCommand, [], matchers), { instanceOf: Error, message: '🦄' }); }); ava_1.default('exit code matchers are applied', async (t) => { const testCommand = buildDummyCommand("non matching string", 'foo bar\\nblort qux', '', 123); const matchers = [[123, new RegExp("this will not match"), '🦄']]; await t.throwsAsync(exec.exec(testCommand), { instanceOf: Error, message: 'The process \'node\' failed with exit code 123' }); - await t.throwsAsync(exec_wrapper_1.exec_wrapper(testCommand, [], matchers), { instanceOf: Error, message: '🦄' }); + await t.throwsAsync(exec_wrapper_1.execErrorCatcher(testCommand, [], matchers), { instanceOf: Error, message: '🦄' }); }); -ava_1.default('exec_wrapper respects the ignoreReturnValue option', async (t) => { +ava_1.default('execErrorCatcher respects the ignoreReturnValue option', async (t) => { const testCommand = buildDummyCommand("standard output", 'error output', '', 199); - await t.throwsAsync(exec_wrapper_1.exec_wrapper(testCommand, [], [], { ignoreReturnCode: false }), { instanceOf: Error }); - t.deepEqual(await exec_wrapper_1.exec_wrapper(testCommand, [], [], { ignoreReturnCode: true }), 199); + await t.throwsAsync(exec_wrapper_1.execErrorCatcher(testCommand, [], [], { ignoreReturnCode: false }), { instanceOf: Error }); + t.deepEqual(await exec_wrapper_1.execErrorCatcher(testCommand, [], [], { ignoreReturnCode: true }), 199); }); -ava_1.default('exec_wrapper preserves behavior of provided listeners', async (t) => { +ava_1.default('execErrorCatcher preserves behavior of provided listeners', async (t) => { let stdoutExpected = 'standard output'; let stderrExpected = 'error output'; let stdoutActual = ''; @@ -81,7 +74,7 @@ ava_1.default('exec_wrapper preserves behavior of provided listeners', async (t) } }; const testCommand = buildDummyCommand(stdoutExpected, stderrExpected, '', 0); - t.deepEqual(await exec_wrapper_1.exec_wrapper(testCommand, [], [], { listeners: listeners }), 0); + t.deepEqual(await exec_wrapper_1.execErrorCatcher(testCommand, [], [], { listeners: listeners }), 0); t.deepEqual(stdoutActual, stdoutExpected + "\n"); t.deepEqual(stderrActual, stderrExpected + "\n"); }); @@ -99,4 +92,4 @@ function buildDummyCommand(stdoutContents, stderrContents, desiredErrorMessage, command += 'process.exitCode = ' + desiredExitCode + ';'; return 'node -e "' + command + '"'; } -//# sourceMappingURL=exec_wrapper.test.js.map \ No newline at end of file +//# sourceMappingURL=exec-wrapper.test.js.map \ No newline at end of file diff --git a/lib/exec-wrapper.test.js.map b/lib/exec-wrapper.test.js.map new file mode 100644 index 000000000..f85325915 --- /dev/null +++ b/lib/exec-wrapper.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"exec-wrapper.test.js","sourceRoot":"","sources":["../src/exec-wrapper.test.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsC;AACtC,8CAAuB;AAGvB,iDAAkD;AAClD,mDAA2C;AAE3C,0BAAU,CAAC,aAAI,CAAC,CAAC;AAEjB,aAAI,CAAC,8CAA8C,EAAE,KAAK,EAAC,CAAC,EAAC,EAAE;IAE7D,MAAM,WAAW,GAAG,iBAAiB,CAAC,qBAAqB,EAAE,qBAAqB,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAE3F,MAAM,QAAQ,GAAmB,CAAC,CAAC,GAAG,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,C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CAAC,CAAC;AAEH,SAAS,iBAAiB,CAAC,cAAsB,EAAE,cAAsB,EAC9C,mBAA4B,EAAE,eAAwB;IAE/E,IAAI,OAAO,GAAG,EAAE,CAAC;IAEjB,IAAI,cAAc;QAAE,OAAO,IAAI,iBAAiB,GAAG,cAAc,GAAG,OAAO,CAAC;IAC5E,IAAI,cAAc;QAAE,OAAO,IAAI,mBAAmB,GAAG,cAAc,GAAG,OAAO,CAAC;IAE9E,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IAE/F,IAAI,mBAAmB;QAAE,OAAO,IAAI,qBAAqB,GAAG,mBAAmB,GAAG,OAAO,CAAC;IAC1F,IAAI,eAAe;QAAE,OAAO,IAAI,qBAAqB,GAAG,eAAe,GAAG,GAAG,CAAC;IAE9E,OAAO,WAAW,GAAG,OAAO,GAAG,GAAG,CAAC;AACrC,CAAC"} \ No newline at end of file diff --git a/lib/exec_wrapper.js.map b/lib/exec_wrapper.js.map deleted file mode 100644 index 32f47be9c..000000000 --- a/lib/exec_wrapper.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"exec_wrapper.js","sourceRoot":"","sources":["../src/exec_wrapper.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAAsC;AAKtC;;;;;;;;;;GAUG;AACI,KAAK,UAAU,YAAY,CAAC,WAAmB,EAAE,IAAe,EACpC,QAAyB,EACzB,OAAwB;;IAEzD,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,IAAI,SAAS,GAAG;QACd,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;;YACvB,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,IAAI,aAAA,OAAO,0CAAE,SAAS,0CAAE,MAAM,MAAK,SAAS,EAAE;gBAC5C,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,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AAC;SACpB;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,iBAAiB,WAAW,4BAA4B,WAAW,EAAE,CAAC,CAAC;SACxF;KACF;SAAM;QACL,MAAM,WAAW,CAAC;KACnB;AACH,CAAC;AAjED,oCAiEC"} \ No newline at end of file diff --git a/lib/exec_wrapper.test.js.map b/lib/exec_wrapper.test.js.map deleted file mode 100644 index b805c8b80..000000000 --- a/lib/exec_wrapper.test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"exec_wrapper.test.js","sourceRoot":"","sources":["../src/exec_wrapper.test.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsC;AACtC,8CAAuB;AAGvB,iDAA8C;AAC9C,mDAA2C;AAC3C,uBAAuB;AAEvB,iDAAiD;AAEjD,iDAAiD;AACjD,WAAW;AACX,uCAAuC;AACvC,8DAA8D;AAC9D,KAAK;AAEL,0BAAU,CAAC,aAAI,CAAC,CAAC;AAEjB,aAAI,CAAC,8CAA8C,EAAE,KAAK,EAAC,CAAC,EAAC,EAAE;IAE7D,MAAM,WAAW,GAAG,iBAAiB,CAAC,qBAAqB,EAAE,qBAAqB,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAE3F,MAAM,QAAQ,GAAmB,CAAC,CAAC,GAAG,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC;IAE5E,CAAC,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC;IAE7C,CAAC,CAAC,SAAS,CAAC,MAAM,2BAAY,CAAC,WAAW,EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;AAEhE,CAAC,CAAC,CAAC;AAEH,aAAI,CAAC,6DAA6D,EAAE,KAAK,EAAC,CAAC,EAAC,EAAE;IAE5E,MAAM,WAAW,GAAG,iBAAiB,CAAC,qBAAqB,EAAE,EAAE,EAAE,EAAE,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,OAAO,IAAI,qBAAqB,GAAG,mBAAmB,GAAG,OAAO,CAAC;IAC1F,IAAI,eAAe;QAAE,OAAO,IAAI,qBAAqB,GAAG,eAAe,GAAG,GAAG,CAAC;IAE9E,OAAO,WAAW,GAAG,OAAO,GAAG,GAAG,CAAC;AACrC,CAAC"} \ No newline at end of file diff --git a/src/codeql.ts b/src/codeql.ts index beb46121c..bc2876cfd 100644 --- a/src/codeql.ts +++ b/src/codeql.ts @@ -12,8 +12,8 @@ import uuidV4 from 'uuid/v4'; import * as api from './api-client'; import * as defaults from './defaults.json'; // Referenced from codeql-action-sync-tool! -import { errorMatchers} from './error_matcher'; -import { exec_wrapper } from './exec_wrapper'; +import { errorMatchers} from './error-matcher'; +import { execErrorCatcher } from './exec-wrapper'; import { Language } from './languages'; import * as util from './util'; @@ -382,7 +382,7 @@ function getCodeQLForCmd(cmd: string): CodeQL { const traceCommand = path.resolve(JSON.parse(extractorPath), 'tools', 'autobuild' + ext); // Run trace command - await exec_wrapper( + await execErrorCatcher( cmd, [ 'database', 'trace-command', @@ -395,7 +395,7 @@ function getCodeQLForCmd(cmd: string): CodeQL { ); }, finalizeDatabase: async function(databasePath: string) { - await exec_wrapper( + await execErrorCatcher( cmd, [ 'database', 'finalize', diff --git a/src/error_matcher.test.ts b/src/error-matcher.test.ts similarity index 95% rename from src/error_matcher.test.ts rename to src/error-matcher.test.ts index 9d86eebe9..4dc99bccf 100644 --- a/src/error_matcher.test.ts +++ b/src/error-matcher.test.ts @@ -1,7 +1,7 @@ import test from 'ava'; -import { namedMatchersForTesting } from './error_matcher'; +import { namedMatchersForTesting } from './error-matcher'; /* NB We test the regexes for all the matchers against example log output snippets. diff --git a/src/error_matcher.ts b/src/error-matcher.ts similarity index 91% rename from src/error_matcher.ts rename to src/error-matcher.ts index 5344cd06d..68f0bbb1d 100644 --- a/src/error_matcher.ts +++ b/src/error-matcher.ts @@ -15,5 +15,5 @@ https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in ], }; -// we collapse the matches into an array for use in exec_wrapper +// we collapse the matches into an array for use in execErrorCatcher export const errorMatchers = Object.values(namedMatchersForTesting); diff --git a/src/exec_wrapper.test.ts b/src/exec-wrapper.test.ts similarity index 80% rename from src/exec_wrapper.test.ts rename to src/exec-wrapper.test.ts index 46b93ab80..55ce5d0de 100644 --- a/src/exec_wrapper.test.ts +++ b/src/exec-wrapper.test.ts @@ -1,18 +1,9 @@ import * as exec from '@actions/exec'; import test from 'ava'; -import { ErrorMatcher } from './error_matcher'; -import { exec_wrapper } from './exec_wrapper'; +import { ErrorMatcher } from './error-matcher'; +import { execErrorCatcher } from './exec-wrapper'; import {setupTests} from './testing-utils'; -// import fs from 'fs'; - -// import { exec_wrapper } from './exec_wrapper'; - -// const matchers: [[number, RegExp, string]] = [ -// [-999, -// new RegExp("match this string"), -// 'No source code was found. CUSTOM ERROR MESSAGE HERE'], -// ]; setupTests(test); @@ -24,7 +15,7 @@ test('matchers are never applied if non-error exit', async t => { t.deepEqual(await exec.exec(testCommand), 0); - t.deepEqual(await exec_wrapper(testCommand, [], matchers), 0); + t.deepEqual(await execErrorCatcher(testCommand, [], matchers), 0); }); @@ -37,7 +28,7 @@ test('regex matchers are applied to stdout for non-zero exit code', async t => { await t.throwsAsync(exec.exec(testCommand), {instanceOf: Error, message: 'The process \'node\' failed with exit code 1'}); await t.throwsAsync( - exec_wrapper(testCommand, [], matchers), + execErrorCatcher(testCommand, [], matchers), {instanceOf: Error, message: '🦄'} ); @@ -52,7 +43,7 @@ test('regex matchers are applied to stderr for non-zero exit code', async t => { await t.throwsAsync(exec.exec(testCommand), {instanceOf: Error, message: 'The process \'node\' failed with exit code 1'}); await t.throwsAsync( - exec_wrapper(testCommand, [], matchers), + execErrorCatcher(testCommand, [], matchers), {instanceOf: Error, message: '🦄'} ); @@ -69,7 +60,7 @@ test('matcher returns correct error message when multiple matchers defined', asy await t.throwsAsync(exec.exec(testCommand), {instanceOf: Error, message: 'The process \'node\' failed with exit code 1'}); await t.throwsAsync( - exec_wrapper(testCommand, [], matchers), + execErrorCatcher(testCommand, [], matchers), {instanceOf: Error, message: '🦄'} ); @@ -86,7 +77,7 @@ test('matcher returns first match to regex when multiple matches', async t => { await t.throwsAsync(exec.exec(testCommand), {instanceOf: Error, message: 'The process \'node\' failed with exit code 1'}); await t.throwsAsync( - exec_wrapper(testCommand, [], matchers), + execErrorCatcher(testCommand, [], matchers), {instanceOf: Error, message: '🦄'} ); @@ -101,22 +92,22 @@ test('exit code matchers are applied', async t => { await t.throwsAsync(exec.exec(testCommand), {instanceOf: Error, message: 'The process \'node\' failed with exit code 123'}); await t.throwsAsync( - exec_wrapper(testCommand, [], matchers), + execErrorCatcher(testCommand, [], matchers), {instanceOf: Error, message: '🦄'} ); }); -test('exec_wrapper respects the ignoreReturnValue option', async t => { +test('execErrorCatcher respects the ignoreReturnValue option', async t => { const testCommand = buildDummyCommand("standard output", 'error output', '', 199); - await t.throwsAsync(exec_wrapper(testCommand, [], [], {ignoreReturnCode: false}), {instanceOf: Error}); + await t.throwsAsync(execErrorCatcher(testCommand, [], [], {ignoreReturnCode: false}), {instanceOf: Error}); - t.deepEqual(await exec_wrapper(testCommand, [], [], {ignoreReturnCode: true}), 199); + t.deepEqual(await execErrorCatcher(testCommand, [], [], {ignoreReturnCode: true}), 199); }); -test('exec_wrapper preserves behavior of provided listeners', async t => { +test('execErrorCatcher preserves behavior of provided listeners', async t => { let stdoutExpected = 'standard output'; let stderrExpected = 'error output'; @@ -135,7 +126,7 @@ test('exec_wrapper preserves behavior of provided listeners', async t => { const testCommand = buildDummyCommand(stdoutExpected, stderrExpected, '', 0); - t.deepEqual(await exec_wrapper(testCommand, [], [], {listeners: listeners}), 0); + t.deepEqual(await execErrorCatcher(testCommand, [], [], {listeners: listeners}), 0); t.deepEqual(stdoutActual, stdoutExpected + "\n"); t.deepEqual(stderrActual, stderrExpected + "\n"); diff --git a/src/exec_wrapper.ts b/src/exec-wrapper.ts similarity index 90% rename from src/exec_wrapper.ts rename to src/exec-wrapper.ts index ff9088004..27eabf557 100644 --- a/src/exec_wrapper.ts +++ b/src/exec-wrapper.ts @@ -1,7 +1,7 @@ import * as exec from '@actions/exec'; import * as im from '@actions/exec/lib/interfaces'; -import {ErrorMatcher} from './error_matcher'; +import {ErrorMatcher} from './error-matcher'; /** * Wrapper for exec.exec which checks for specific return code and/or regex matches in console output. @@ -14,9 +14,9 @@ import {ErrorMatcher} from './error_matcher'; * @param options optional exec options. See ExecOptions * @returns Promise exit code */ -export async function exec_wrapper(commandLine: string, args?: string[], - matchers?: ErrorMatcher[], - options?: im.ExecOptions): Promise { +export async function execErrorCatcher(commandLine: string, args?: string[], + matchers?: ErrorMatcher[], + options?: im.ExecOptions): Promise { let stdout = ''; let stderr = ''; From 30bb37a5c771ca0828a4ff3e113f066291678bb3 Mon Sep 17 00:00:00 2001 From: Nick Fyson Date: Mon, 7 Sep 2020 23:11:10 +0100 Subject: [PATCH 14/35] restore all default workflow triggers and integration tests --- .github/workflows/cli.yml | 2 +- .github/workflows/codeql.yml | 2 +- .github/workflows/integration-testing.yml | 278 +++++++++++----------- .github/workflows/pr-checks.yml | 2 +- 4 files changed, 142 insertions(+), 142 deletions(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 189ac7d1e..1ce2fbfc4 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -1,6 +1,6 @@ name: "CodeScanning CLI" -on: [pull_request] +on: [push, pull_request] jobs: build: diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 944484407..dbf82c60d 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,6 +1,6 @@ name: "CodeQL action" -on: [pull_request] +on: [push, pull_request] jobs: build: diff --git a/.github/workflows/integration-testing.yml b/.github/workflows/integration-testing.yml index 85fafe8e7..8334925a7 100644 --- a/.github/workflows/integration-testing.yml +++ b/.github/workflows/integration-testing.yml @@ -3,153 +3,153 @@ name: "Integration Testing" on: [push, pull_request] jobs: - # multi-language-repo_test-autodetect-languages: - # runs-on: ubuntu-latest + multi-language-repo_test-autodetect-languages: + runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - name: Move codeql-action - # shell: bash - # run: | - # mkdir ../action - # mv * .github ../action/ - # mv ../action/tests/multi-language-repo/{*,.github} . - # - uses: ./../action/init - # - name: Build code - # shell: bash - # run: ./build.sh - # - uses: ./../action/analyze - # env: - # TEST_MODE: true - # - run: | - # cd "$RUNNER_TEMP/codeql_databases" - # # List all directories as there will be precisely one directory per database - # # but there may be other files in this directory such as query suites. - # if [ "$(ls -d */ | wc -l)" != 6 ] || \ - # [[ ! -d cpp ]] || \ - # [[ ! -d csharp ]] || \ - # [[ ! -d go ]] || \ - # [[ ! -d java ]] || \ - # [[ ! -d javascript ]] || \ - # [[ ! -d python ]]; then - # echo "Did not find expected number of databases. Database dir contains: $(ls)" - # exit 1 - # fi + steps: + - uses: actions/checkout@v2 + - name: Move codeql-action + shell: bash + run: | + mkdir ../action + mv * .github ../action/ + mv ../action/tests/multi-language-repo/{*,.github} . + - uses: ./../action/init + - name: Build code + shell: bash + run: ./build.sh + - uses: ./../action/analyze + env: + TEST_MODE: true + - run: | + cd "$RUNNER_TEMP/codeql_databases" + # List all directories as there will be precisely one directory per database + # but there may be other files in this directory such as query suites. + if [ "$(ls -d */ | wc -l)" != 6 ] || \ + [[ ! -d cpp ]] || \ + [[ ! -d csharp ]] || \ + [[ ! -d go ]] || \ + [[ ! -d java ]] || \ + [[ ! -d javascript ]] || \ + [[ ! -d python ]]; then + echo "Did not find expected number of databases. Database dir contains: $(ls)" + exit 1 + fi - # multi-language-repo_test-custom-queries-and-remote-config: - # strategy: - # fail-fast: false - # matrix: - # os: [ubuntu-latest, windows-latest, macos-latest] - # runs-on: ${{ matrix.os }} + multi-language-repo_test-custom-queries-and-remote-config: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} - # steps: - # - uses: actions/checkout@v2 - # - name: Move codeql-action - # shell: bash - # run: | - # mkdir ../action - # mv * .github ../action/ - # mv ../action/tests/multi-language-repo/{*,.github} . - # - uses: ./../action/init - # with: - # languages: cpp,csharp,java,javascript,python - # config-file: github/codeql-action/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{ github.sha }} - # - name: Build code - # shell: bash - # run: ./build.sh - # - uses: ./../action/analyze - # env: - # TEST_MODE: true + steps: + - uses: actions/checkout@v2 + - name: Move codeql-action + shell: bash + run: | + mkdir ../action + mv * .github ../action/ + mv ../action/tests/multi-language-repo/{*,.github} . + - uses: ./../action/init + with: + languages: cpp,csharp,java,javascript,python + config-file: github/codeql-action/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{ github.sha }} + - name: Build code + shell: bash + run: ./build.sh + - uses: ./../action/analyze + env: + TEST_MODE: true - # # Currently is not possible to analyze Go in conjunction with other languages in macos - # multi-language-repo_test-go-custom-queries: - # strategy: - # fail-fast: false - # matrix: - # os: [ubuntu-latest, windows-latest, macos-latest] - # runs-on: ${{ matrix.os }} + # Currently is not possible to analyze Go in conjunction with other languages in macos + multi-language-repo_test-go-custom-queries: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} - # steps: - # - uses: actions/setup-go@v2 - # if: ${{ matrix.os == 'macos-latest' }} - # with: - # go-version: '^1.13.1' - # - uses: actions/checkout@v2 - # - name: Move codeql-action - # shell: bash - # run: | - # mkdir ../action - # mv * .github ../action/ - # mv ../action/tests/multi-language-repo/{*,.github} . - # - uses: ./../action/init - # with: - # languages: go - # config-file: ./.github/codeql/custom-queries.yml - # - name: Build code - # shell: bash - # run: ./build.sh - # - uses: ./../action/analyze - # env: - # TEST_MODE: true + steps: + - uses: actions/setup-go@v2 + if: ${{ matrix.os == 'macos-latest' }} + with: + go-version: '^1.13.1' + - uses: actions/checkout@v2 + - name: Move codeql-action + shell: bash + run: | + mkdir ../action + mv * .github ../action/ + mv ../action/tests/multi-language-repo/{*,.github} . + - uses: ./../action/init + with: + languages: go + config-file: ./.github/codeql/custom-queries.yml + - name: Build code + shell: bash + run: ./build.sh + - uses: ./../action/analyze + env: + TEST_MODE: true - # multi-language-repo_rubocop: - # runs-on: ubuntu-latest + multi-language-repo_rubocop: + runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - name: Move codeql-action - # shell: bash - # run: | - # mkdir ../action - # mv * .github ../action/ - # mv ../action/tests/multi-language-repo/{*,.github} . - # - name: Set up Ruby - # uses: ruby/setup-ruby@v1 - # with: - # ruby-version: 2.6 - # - name: Install Code Scanning integration - # run: bundle add code-scanning-rubocop --version 0.3.0 --skip-install - # - name: Install dependencies - # run: bundle install - # - name: Rubocop run - # run: | - # bash -c " - # bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif - # [[ $? -ne 2 ]] - # " - # - uses: ./../action/upload-sarif - # with: - # sarif_file: rubocop.sarif - # env: - # TEST_MODE: true + steps: + - uses: actions/checkout@v2 + - name: Move codeql-action + shell: bash + run: | + mkdir ../action + mv * .github ../action/ + mv ../action/tests/multi-language-repo/{*,.github} . + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 + - name: Install Code Scanning integration + run: bundle add code-scanning-rubocop --version 0.3.0 --skip-install + - name: Install dependencies + run: bundle install + - name: Rubocop run + run: | + bash -c " + bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif + [[ $? -ne 2 ]] + " + - uses: ./../action/upload-sarif + with: + sarif_file: rubocop.sarif + env: + TEST_MODE: true - # test-proxy: - # runs-on: ubuntu-latest - # container: - # image: ubuntu:18.04 - # options: --dns 127.0.0.1 - # services: - # squid-proxy: - # image: datadog/squid:latest - # ports: - # - 3128:3128 - # env: - # https_proxy: http://squid-proxy:3128 - # steps: - # - uses: actions/checkout@v2 - # - name: Move codeql-action - # shell: bash - # run: | - # mkdir ../action - # mv * .github ../action/ - # mv ../action/tests/multi-language-repo/{*,.github} . - # - uses: ./../action/init - # with: - # languages: javascript - # - uses: ./../action/analyze - # env: - # TEST_MODE: true + test-proxy: + runs-on: ubuntu-latest + container: + image: ubuntu:18.04 + options: --dns 127.0.0.1 + services: + squid-proxy: + image: datadog/squid:latest + ports: + - 3128:3128 + env: + https_proxy: http://squid-proxy:3128 + steps: + - uses: actions/checkout@v2 + - name: Move codeql-action + shell: bash + run: | + mkdir ../action + mv * .github ../action/ + mv ../action/tests/multi-language-repo/{*,.github} . + - uses: ./../action/init + with: + languages: javascript + - uses: ./../action/analyze + env: + TEST_MODE: true # Test the behaviour when asked to scan a compiled language but no code is compiled diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index c952c5255..fb30c74a7 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -1,6 +1,6 @@ name: "PR checks" -on: [pull_request] +on: [push, pull_request] jobs: tslint: From c4f579a4dbc4520a3cdf7c53261f5ebe8e434f95 Mon Sep 17 00:00:00 2001 From: Nick Fyson Date: Mon, 7 Sep 2020 23:12:12 +0100 Subject: [PATCH 15/35] remove the intentionally failing matcher integration tests --- .github/workflows/integration-testing.yml | 41 ----------------------- 1 file changed, 41 deletions(-) diff --git a/.github/workflows/integration-testing.yml b/.github/workflows/integration-testing.yml index 8334925a7..b805489eb 100644 --- a/.github/workflows/integration-testing.yml +++ b/.github/workflows/integration-testing.yml @@ -150,44 +150,3 @@ jobs: - uses: ./../action/analyze env: TEST_MODE: true - - -# Test the behaviour when asked to scan a compiled language but no code is compiled - java: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Move codeql-action - shell: bash - run: | - mkdir ../action - shopt -s dotglob - mv * ../action/ - # Do not copy anything back, so there's nothing left to scan - - uses: ./../action/init - with: - languages: java - - uses: ./../action/analyze - env: - TEST_MODE: true - - # Test the behaviour when asked to scan a non-compiled language but there is no code to scan - javascript: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Move codeql-action - shell: bash - run: | - mkdir ../action - shopt -s dotglob - mv * ../action/ - # Do not copy anything back, so there's nothing left to scan - - uses: ./../action/init - with: - languages: javascript - - uses: ./../action/analyze - env: - TEST_MODE: true From 88951d6193a278ee8ce2b39643cb3cab5ba3ae7b Mon Sep 17 00:00:00 2001 From: Nick Fyson Date: Tue, 8 Sep 2020 00:01:04 +0100 Subject: [PATCH 16/35] renames to reflect the switch to using toolrunner --- lib/codeql.js | 6 ++--- lib/codeql.js.map | 2 +- lib/exec-wrapper.js.map | 1 - lib/exec-wrapper.test.js.map | 1 - ...wrapper.js => toolrunner-error-catcher.js} | 6 ++--- lib/toolrunner-error-catcher.js.map | 1 + ...st.js => toolrunner-error-catcher.test.js} | 22 +++++++++---------- lib/toolrunner-error-catcher.test.js.map | 1 + src/codeql.ts | 6 ++--- ...st.ts => toolrunner-error-catcher.test.ts} | 20 ++++++++--------- ...wrapper.ts => toolrunner-error-catcher.ts} | 6 ++--- 11 files changed, 36 insertions(+), 36 deletions(-) delete mode 100644 lib/exec-wrapper.js.map delete mode 100644 lib/exec-wrapper.test.js.map rename lib/{exec-wrapper.js => toolrunner-error-catcher.js} (94%) create mode 100644 lib/toolrunner-error-catcher.js.map rename lib/{exec-wrapper.test.js => toolrunner-error-catcher.test.js} (77%) create mode 100644 lib/toolrunner-error-catcher.test.js.map rename src/{exec-wrapper.test.ts => toolrunner-error-catcher.test.ts} (86%) rename src/{exec-wrapper.ts => toolrunner-error-catcher.ts} (91%) diff --git a/lib/codeql.js b/lib/codeql.js index 180e16066..1456fa7fa 100644 --- a/lib/codeql.js +++ b/lib/codeql.js @@ -22,7 +22,7 @@ const v4_1 = __importDefault(require("uuid/v4")); const api = __importStar(require("./api-client")); const defaults = __importStar(require("./defaults.json")); // Referenced from codeql-action-sync-tool! const error_matcher_1 = require("./error-matcher"); -const exec_wrapper_1 = require("./exec-wrapper"); +const toolrunner_error_catcher_1 = require("./toolrunner-error-catcher"); const util = __importStar(require("./util")); /** * Stores the CodeQL object, and is populated by `setupCodeQL` or `getCodeQL`. @@ -308,7 +308,7 @@ function getCodeQLForCmd(cmd) { const ext = process.platform === 'win32' ? '.cmd' : '.sh'; const traceCommand = path.resolve(JSON.parse(extractorPath), 'tools', 'autobuild' + ext); // Run trace command - await exec_wrapper_1.execErrorCatcher(cmd, [ + await toolrunner_error_catcher_1.toolrunnerErrorCatcher(cmd, [ 'database', 'trace-command', ...getExtraOptionsFromEnv(['database', 'trace-command']), @@ -318,7 +318,7 @@ function getCodeQLForCmd(cmd) { ], error_matcher_1.errorMatchers); }, finalizeDatabase: async function (databasePath) { - await exec_wrapper_1.execErrorCatcher(cmd, [ + await toolrunner_error_catcher_1.toolrunnerErrorCatcher(cmd, [ 'database', 'finalize', ...getExtraOptionsFromEnv(['database', 'finalize']), diff --git a/lib/codeql.js.map b/lib/codeql.js.map index 81a3fd158..809dca090 100644 --- a/lib/codeql.js.map +++ b/lib/codeql.js.map @@ -1 +1 @@ -{"version":3,"file":"codeql.js","sourceRoot":"","sources":["../src/codeql.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0EAA4D;AAC5D,2DAA6C;AAE7C,+DAAiD;AACjD,uCAAyB;AACzB,2CAA6B;AAC7B,+CAAiC;AACjC,+CAAiC;AACjC,iDAAmC;AACnC,iDAA6B;AAE7B,kDAAoC;AACpC,0DAA4C,CAAC,2CAA2C;AACxF,mDAA+C;AAC/C,iDAAkD;AAGlD,6CAA+B;AAmF/B;;;GAGG;AACH,IAAI,YAAY,GAAuB,SAAS,CAAC;AAEjD,MAAM,qBAAqB,GAAG,QAAQ,CAAC,aAAa,CAAC;AACrD,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AAClD,MAAM,gCAAgC,GAAG,sBAAsB,CAAC;AAEhE,SAAS,yBAAyB,CAAC,IAAe;IAChD,IAAI,IAAI,KAAK,SAAS,EAAE;QACtB,OAAO,gCAAgC,CAAC;KACzC;IAED,iDAAiD;IACjD,+EAA+E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CAAC,CAAC,CAAC,SAAG,IAAI,0CAAE,KAAK,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChF,OAAO,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC9B,CAAC;AAjCD,0CAiCC"} \ No newline at end of file diff --git a/lib/exec-wrapper.js.map b/lib/exec-wrapper.js.map deleted file mode 100644 index c3d4ca1e1..000000000 --- a/lib/exec-wrapper.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"exec-wrapper.js","sourceRoot":"","sources":["../src/exec-wrapper.ts"],"names":[],"mappings":";;;;;;;;;AACA,0EAA4D;AAI5D;;;;;;;;;;GAUG;AACI,KAAK,UAAU,gBAAgB,CAAC,WAAmB,EAAE,IAAe,EACpC,QAAyB,EACzB,OAAwB;;IAE7D,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,IAAI,SAAS,GAAG;QACd,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;;YACvB,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,IAAI,aAAA,OAAO,0CAAE,SAAS,0CAAE,MAAM,MAAK,SAAS,EAAE;gBAC5C,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aAChC;iBAAM;gBACL,2FAA2F;gBAC3F,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;aAC5B;QAEH,CAAC;QACD,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;;YACvB,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,IAAI,aAAA,OAAO,0CAAE,SAAS,0CAAE,MAAM,MAAK,SAAS,EAAE;gBAC5C,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aAChC;iBAAM;gBACL,2FAA2F;gBAC3F,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;aAC5B;QACH,CAAC;KACF,CAAC;IAEF,0GAA0G;IAC1G,IAAI,WAAyB,CAAC;IAC9B,IAAI;QACF,WAAW,GAAG,MAAM,IAAI,WAAW,CAAC,UAAU,CAC5C,WAAW,EACX,IAAI,EACJ;YACE,GAAG,OAAO;YACV,SAAS,EAAE,SAAS;YACpB,gBAAgB,EAAE,IAAI;SACvB,CACA,CAAC,IAAI,EAAE,CAAC;KACZ;IAAC,OAAO,CAAC,EAAE;QACV,WAAW,GAAG,CAAC,CAAC;KACjB;IAED,mEAAmE;IACnE,IAAI,WAAW,KAAK,CAAC;QAAE,OAAO,WAAW,CAAC;IAE1C,IAAI,QAAQ,EAAE;QACZ,KAAK,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,QAAQ,EAAE;YACnD,IAAI,UAAU,KAAK,WAAW,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAG;gBACtF,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;aAC1B;SACF;KACF;IAED,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;QACnC,qFAAqF;QACrF,UAAI,OAAO,0CAAE,gBAAgB,EAAE;YAC7B,OAAO,WAAW,CAAC;SACpB;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,iBAAiB,WAAW,4BAA4B,WAAW,EAAE,CAAC,CAAC;SACxF;KACF;SAAM;QACL,MAAM,WAAW,CAAC;KACnB;AACH,CAAC;AAlED,4CAkEC"} \ No newline at end of file diff --git a/lib/exec-wrapper.test.js.map b/lib/exec-wrapper.test.js.map deleted file mode 100644 index ff8702fc5..000000000 --- a/lib/exec-wrapper.test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"exec-wrapper.test.js","sourceRoot":"","sources":["../src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CAAC,IAAY,EAAE,EAAE;YACvB,YAAY,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QAClC,CAAC;KACF,CAAC;IAEF,MAAM,QAAQ,GAAG,cAAc,CAAC,cAAc,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAEvE,CAAC,CAAC,SAAS,CAAC,MAAM,+BAAgB,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAC,SAAS,EAAE,SAAS,EAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAErF,CAAC,CAAC,SAAS,CAAC,YAAY,EAAE,cAAc,GAAG,IAAI,CAAC,CAAC;IACjD,CAAC,CAAC,SAAS,CAAC,YAAY,EAAE,cAAc,GAAG,IAAI,CAAC,CAAC;AAEnD,CAAC,CAAC,CAAC;AAEH,SAAS,cAAc,CAAC,cAAsB,EAAE,cAAsB,EAC9C,mBAA4B,EAAE,eAAwB;IAE5E,IAAI,OAAO,GAAG,EAAE,CAAC;IAEjB,IAAI,cAAc;QAAE,OAAO,IAAI,iBAAiB,GAAG,cAAc,GAAG,OAAO,CAAC;IAC5E,IAAI,cAAc;QAAE,OAAO,IAAI,mBAAmB,GAAG,cAAc,GAAG,OAAO,CAAC;IAE9E,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IAE/F,IAAI,mBAAmB;QAAE,OAAO,IAAI,qBAAqB,GAAG,mBAAmB,GAAG,OAAO,CAAC;IAC1F,IAAI,eAAe;QAAE,OAAO,IAAI,qBAAqB,GAAG,eAAe,GAAG,GAAG,CAAC;IAE9E,OAAO,WAAW,CAAC,gBAAgB,CAAC,MAAM,GAAG,OAAO,GAAG,GAAG,CAAC,CAAC;AAC9D,CAAC"} \ No newline at end of file diff --git a/lib/exec-wrapper.js b/lib/toolrunner-error-catcher.js similarity index 94% rename from lib/exec-wrapper.js rename to lib/toolrunner-error-catcher.js index 60259805a..ed6f90a66 100644 --- a/lib/exec-wrapper.js +++ b/lib/toolrunner-error-catcher.js @@ -19,7 +19,7 @@ const toolrunnner = __importStar(require("@actions/exec/lib/toolrunner")); * @param options optional exec options. See ExecOptions * @returns Promise exit code */ -async function execErrorCatcher(commandLine, args, matchers, options) { +async function toolrunnerErrorCatcher(commandLine, args, matchers, options) { var _a; let stdout = ''; let stderr = ''; @@ -82,5 +82,5 @@ async function execErrorCatcher(commandLine, args, matchers, options) { throw returnState; } } -exports.execErrorCatcher = execErrorCatcher; -//# sourceMappingURL=exec-wrapper.js.map \ No newline at end of file +exports.toolrunnerErrorCatcher = toolrunnerErrorCatcher; +//# sourceMappingURL=toolrunner-error-catcher.js.map \ No newline at end of file diff --git a/lib/toolrunner-error-catcher.js.map b/lib/toolrunner-error-catcher.js.map new file mode 100644 index 000000000..e3bf54dec --- /dev/null +++ b/lib/toolrunner-error-catcher.js.map @@ -0,0 +1 @@ +{"version":3,"file":"toolrunner-error-catcher.js","sourceRoot":"","sources":["../src/toolrunner-error-catcher.ts"],"names":[],"mappings":";;;;;;;;;AACA,0EAA4D;AAI5D;;;;;;;;;;GAUG;AACI,KAAK,UAAU,sBAAsB,CAAC,WAAmB,EAAE,IAAe,EACpC,QAAyB,EACzB,OAAwB;;IAEnE,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,IAAI,SAAS,GAAG;QACd,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;;YACvB,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,IAAI,aAAA,OAAO,0CAAE,SAAS,0CAAE,MAAM,MAAK,SAAS,EAAE;gBAC5C,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aAChC;iBAAM;gBACL,2FAA2F;gBAC3F,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;aAC5B;QAEH,CAAC;QACD,MAAM,EAAE,C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QACL,MAAM,WAAW,CAAC;KACnB;AACH,CAAC;AAlED,wDAkEC"} \ No newline at end of file diff --git a/lib/exec-wrapper.test.js b/lib/toolrunner-error-catcher.test.js similarity index 77% rename from lib/exec-wrapper.test.js rename to lib/toolrunner-error-catcher.test.js index 97ef1073d..e2c514a8b 100644 --- a/lib/exec-wrapper.test.js +++ b/lib/toolrunner-error-catcher.test.js @@ -13,26 +13,26 @@ Object.defineProperty(exports, "__esModule", { value: true }); const exec = __importStar(require("@actions/exec")); const toolrunnner = __importStar(require("@actions/exec/lib/toolrunner")); const ava_1 = __importDefault(require("ava")); -const exec_wrapper_1 = require("./exec-wrapper"); const testing_utils_1 = require("./testing-utils"); +const toolrunner_error_catcher_1 = require("./toolrunner-error-catcher"); testing_utils_1.setupTests(ava_1.default); ava_1.default('matchers are never applied if non-error exit', async (t) => { const testArgs = buildDummyArgs("foo bar\\nblort qux", "foo bar\\nblort qux", '', 0); const matchers = [[123, new RegExp("foo bar"), 'error!!!']]; t.deepEqual(await exec.exec('node', testArgs), 0); - t.deepEqual(await exec_wrapper_1.execErrorCatcher('node', testArgs, matchers), 0); + t.deepEqual(await toolrunner_error_catcher_1.toolrunnerErrorCatcher('node', testArgs, matchers), 0); }); ava_1.default('regex matchers are applied to stdout for non-zero exit code', async (t) => { const testArgs = buildDummyArgs("foo bar\\nblort qux", '', '', 1); const matchers = [[123, new RegExp("foo bar"), '🦄']]; await t.throwsAsync(exec.exec('node', testArgs), { instanceOf: Error, message: 'The process \'node\' failed with exit code 1' }); - await t.throwsAsync(exec_wrapper_1.execErrorCatcher('node', testArgs, matchers), { instanceOf: Error, message: '🦄' }); + await t.throwsAsync(toolrunner_error_catcher_1.toolrunnerErrorCatcher('node', testArgs, matchers), { instanceOf: Error, message: '🦄' }); }); ava_1.default('regex matchers are applied to stderr for non-zero exit code', async (t) => { const testArgs = buildDummyArgs("non matching string", 'foo bar\\nblort qux', '', 1); const matchers = [[123, new RegExp("foo bar"), '🦄']]; await t.throwsAsync(exec.exec('node', testArgs), { instanceOf: Error, message: 'The process \'node\' failed with exit code 1' }); - await t.throwsAsync(exec_wrapper_1.execErrorCatcher('node', testArgs, matchers), { instanceOf: Error, message: '🦄' }); + await t.throwsAsync(toolrunner_error_catcher_1.toolrunnerErrorCatcher('node', testArgs, matchers), { instanceOf: Error, message: '🦄' }); }); ava_1.default('matcher returns correct error message when multiple matchers defined', async (t) => { const testArgs = buildDummyArgs("non matching string", 'foo bar\\nblort qux', '', 1); @@ -40,7 +40,7 @@ ava_1.default('matcher returns correct error message when multiple matchers defi [123, new RegExp("foo bar"), '🦄'], [789, new RegExp("blah blah"), '🤦‍♂️']]; await t.throwsAsync(exec.exec('node', testArgs), { instanceOf: Error, message: 'The process \'node\' failed with exit code 1' }); - await t.throwsAsync(exec_wrapper_1.execErrorCatcher('node', testArgs, matchers), { instanceOf: Error, message: '🦄' }); + await t.throwsAsync(toolrunner_error_catcher_1.toolrunnerErrorCatcher('node', testArgs, matchers), { instanceOf: Error, message: '🦄' }); }); ava_1.default('matcher returns first match to regex when multiple matches', async (t) => { const testArgs = buildDummyArgs("non matching string", 'foo bar\\nblort qux', '', 1); @@ -48,18 +48,18 @@ ava_1.default('matcher returns first match to regex when multiple matches', asyn [789, new RegExp("blah blah"), '🤦‍♂️'], [987, new RegExp("foo bar"), '🚫']]; await t.throwsAsync(exec.exec('node', testArgs), { instanceOf: Error, message: 'The process \'node\' failed with exit code 1' }); - await t.throwsAsync(exec_wrapper_1.execErrorCatcher('node', testArgs, matchers), { instanceOf: Error, message: '🦄' }); + await t.throwsAsync(toolrunner_error_catcher_1.toolrunnerErrorCatcher('node', testArgs, matchers), { instanceOf: Error, message: '🦄' }); }); ava_1.default('exit code matchers are applied', async (t) => { const testArgs = buildDummyArgs("non matching string", 'foo bar\\nblort qux', '', 123); const matchers = [[123, new RegExp("this will not match"), '🦄']]; await t.throwsAsync(exec.exec('node', testArgs), { instanceOf: Error, message: 'The process \'node\' failed with exit code 123' }); - await t.throwsAsync(exec_wrapper_1.execErrorCatcher('node', testArgs, matchers), { instanceOf: Error, message: '🦄' }); + await t.throwsAsync(toolrunner_error_catcher_1.toolrunnerErrorCatcher('node', testArgs, matchers), { instanceOf: Error, message: '🦄' }); }); ava_1.default('execErrorCatcher respects the ignoreReturnValue option', async (t) => { const testArgs = buildDummyArgs("standard output", 'error output', '', 199); - await t.throwsAsync(exec_wrapper_1.execErrorCatcher('node', testArgs, [], { ignoreReturnCode: false }), { instanceOf: Error }); - t.deepEqual(await exec_wrapper_1.execErrorCatcher('node', testArgs, [], { ignoreReturnCode: true }), 199); + await t.throwsAsync(toolrunner_error_catcher_1.toolrunnerErrorCatcher('node', testArgs, [], { ignoreReturnCode: false }), { instanceOf: Error }); + t.deepEqual(await toolrunner_error_catcher_1.toolrunnerErrorCatcher('node', testArgs, [], { ignoreReturnCode: true }), 199); }); ava_1.default('execErrorCatcher preserves behavior of provided listeners', async (t) => { let stdoutExpected = 'standard output'; @@ -75,7 +75,7 @@ ava_1.default('execErrorCatcher preserves behavior of provided listeners', async } }; const testArgs = buildDummyArgs(stdoutExpected, stderrExpected, '', 0); - t.deepEqual(await exec_wrapper_1.execErrorCatcher('node', testArgs, [], { listeners: listeners }), 0); + t.deepEqual(await toolrunner_error_catcher_1.toolrunnerErrorCatcher('node', testArgs, [], { listeners: listeners }), 0); t.deepEqual(stdoutActual, stdoutExpected + "\n"); t.deepEqual(stderrActual, stderrExpected + "\n"); }); @@ -93,4 +93,4 @@ function buildDummyArgs(stdoutContents, stderrContents, desiredErrorMessage, des command += 'process.exitCode = ' + desiredExitCode + ';'; return toolrunnner.argStringToArray('-e "' + command + '"'); } -//# sourceMappingURL=exec-wrapper.test.js.map \ No newline at end of file +//# sourceMappingURL=toolrunner-error-catcher.test.js.map \ No newline at end of file diff --git a/lib/toolrunner-error-catcher.test.js.map b/lib/toolrunner-error-catcher.test.js.map new file mode 100644 index 000000000..0960eac20 --- /dev/null +++ b/lib/toolrunner-error-catcher.test.js.map @@ -0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487 100644 --- a/src/codeql.ts +++ b/src/codeql.ts @@ -12,9 +12,9 @@ import uuidV4 from 'uuid/v4'; import * as api from './api-client'; import * as defaults from './defaults.json'; // Referenced from codeql-action-sync-tool! import { errorMatchers} from './error-matcher'; -import { execErrorCatcher } from './exec-wrapper'; import { Language } from './languages'; import { Logger } from './logging'; +import { toolrunnerErrorCatcher } from './toolrunner-error-catcher'; import * as util from './util'; type Options = (string|number|boolean)[]; @@ -425,7 +425,7 @@ function getCodeQLForCmd(cmd: string): CodeQL { const traceCommand = path.resolve(JSON.parse(extractorPath), 'tools', 'autobuild' + ext); // Run trace command - await execErrorCatcher( + await toolrunnerErrorCatcher( cmd, [ 'database', 'trace-command', @@ -438,7 +438,7 @@ function getCodeQLForCmd(cmd: string): CodeQL { ); }, finalizeDatabase: async function(databasePath: string) { - await execErrorCatcher( + await toolrunnerErrorCatcher( cmd, [ 'database', 'finalize', diff --git a/src/exec-wrapper.test.ts b/src/toolrunner-error-catcher.test.ts similarity index 86% rename from src/exec-wrapper.test.ts rename to src/toolrunner-error-catcher.test.ts index bd89f58e5..8538b3ea9 100644 --- a/src/exec-wrapper.test.ts +++ b/src/toolrunner-error-catcher.test.ts @@ -3,8 +3,8 @@ import * as toolrunnner from '@actions/exec/lib/toolrunner'; import test from 'ava'; import { ErrorMatcher } from './error-matcher'; -import { execErrorCatcher } from './exec-wrapper'; import {setupTests} from './testing-utils'; +import { toolrunnerErrorCatcher } from './toolrunner-error-catcher'; setupTests(test); @@ -16,7 +16,7 @@ test('matchers are never applied if non-error exit', async t => { t.deepEqual(await exec.exec('node', testArgs), 0); - t.deepEqual(await execErrorCatcher('node', testArgs, matchers), 0); + t.deepEqual(await toolrunnerErrorCatcher('node', testArgs, matchers), 0); }); @@ -29,7 +29,7 @@ test('regex matchers are applied to stdout for non-zero exit code', async t => { await t.throwsAsync(exec.exec('node', testArgs), {instanceOf: Error, message: 'The process \'node\' failed with exit code 1'}); await t.throwsAsync( - execErrorCatcher('node', testArgs, matchers), + toolrunnerErrorCatcher('node', testArgs, matchers), {instanceOf: Error, message: '🦄'} ); @@ -44,7 +44,7 @@ test('regex matchers are applied to stderr for non-zero exit code', async t => { await t.throwsAsync(exec.exec('node', testArgs), {instanceOf: Error, message: 'The process \'node\' failed with exit code 1'}); await t.throwsAsync( - execErrorCatcher('node', testArgs, matchers), + toolrunnerErrorCatcher('node', testArgs, matchers), {instanceOf: Error, message: '🦄'} ); @@ -61,7 +61,7 @@ test('matcher returns correct error message when multiple matchers defined', asy await t.throwsAsync(exec.exec('node', testArgs), {instanceOf: Error, message: 'The process \'node\' failed with exit code 1'}); await t.throwsAsync( - execErrorCatcher('node', testArgs, matchers), + toolrunnerErrorCatcher('node', testArgs, matchers), {instanceOf: Error, message: '🦄'} ); @@ -78,7 +78,7 @@ test('matcher returns first match to regex when multiple matches', async t => { await t.throwsAsync(exec.exec('node', testArgs), {instanceOf: Error, message: 'The process \'node\' failed with exit code 1'}); await t.throwsAsync( - execErrorCatcher('node', testArgs, matchers), + toolrunnerErrorCatcher('node', testArgs, matchers), {instanceOf: Error, message: '🦄'} ); @@ -93,7 +93,7 @@ test('exit code matchers are applied', async t => { await t.throwsAsync(exec.exec('node', testArgs), {instanceOf: Error, message: 'The process \'node\' failed with exit code 123'}); await t.throwsAsync( - execErrorCatcher('node', testArgs, matchers), + toolrunnerErrorCatcher('node', testArgs, matchers), {instanceOf: Error, message: '🦄'} ); @@ -102,9 +102,9 @@ test('exit code matchers are applied', async t => { test('execErrorCatcher respects the ignoreReturnValue option', async t => { const testArgs = buildDummyArgs("standard output", 'error output', '', 199); - await t.throwsAsync(execErrorCatcher('node', testArgs, [], {ignoreReturnCode: false}), {instanceOf: Error}); + await t.throwsAsync(toolrunnerErrorCatcher('node', testArgs, [], {ignoreReturnCode: false}), {instanceOf: Error}); - t.deepEqual(await execErrorCatcher('node', testArgs, [], {ignoreReturnCode: true}), 199); + t.deepEqual(await toolrunnerErrorCatcher('node', testArgs, [], {ignoreReturnCode: true}), 199); }); @@ -127,7 +127,7 @@ test('execErrorCatcher preserves behavior of provided listeners', async t => { const testArgs = buildDummyArgs(stdoutExpected, stderrExpected, '', 0); - t.deepEqual(await execErrorCatcher('node', testArgs, [], {listeners: listeners}), 0); + t.deepEqual(await toolrunnerErrorCatcher('node', testArgs, [], {listeners: listeners}), 0); t.deepEqual(stdoutActual, stdoutExpected + "\n"); t.deepEqual(stderrActual, stderrExpected + "\n"); diff --git a/src/exec-wrapper.ts b/src/toolrunner-error-catcher.ts similarity index 91% rename from src/exec-wrapper.ts rename to src/toolrunner-error-catcher.ts index 96ec8e9a5..276fc408d 100644 --- a/src/exec-wrapper.ts +++ b/src/toolrunner-error-catcher.ts @@ -14,9 +14,9 @@ import {ErrorMatcher} from './error-matcher'; * @param options optional exec options. See ExecOptions * @returns Promise exit code */ -export async function execErrorCatcher(commandLine: string, args?: string[], - matchers?: ErrorMatcher[], - options?: im.ExecOptions): Promise { +export async function toolrunnerErrorCatcher(commandLine: string, args?: string[], + matchers?: ErrorMatcher[], + options?: im.ExecOptions): Promise { let stdout = ''; let stderr = ''; From 0539269665b9c57b964b2413fbfef3203582b7a7 Mon Sep 17 00:00:00 2001 From: Robert Brignull Date: Thu, 10 Sep 2020 18:02:33 +0100 Subject: [PATCH 17/35] split up builtin and custom queries --- lib/analyze.js | 48 +++++++++++++--------- lib/analyze.js.map | 2 +- lib/analyze.test.js | 60 +++++++++++++++++++++++++++ lib/analyze.test.js.map | 1 + lib/config-utils.js | 39 ++++++++++++------ lib/config-utils.js.map | 2 +- lib/config-utils.test.js | 44 ++++++++++++-------- lib/config-utils.test.js.map | 2 +- src/analyze.test.ts | 65 +++++++++++++++++++++++++++++ src/analyze.ts | 59 ++++++++++++++++----------- src/config-utils.test.ts | 44 ++++++++++++-------- src/config-utils.ts | 79 ++++++++++++++++++++++++------------ 12 files changed, 325 insertions(+), 120 deletions(-) create mode 100644 lib/analyze.test.js create mode 100644 lib/analyze.test.js.map create mode 100644 src/analyze.test.ts diff --git a/lib/analyze.js b/lib/analyze.js index 2fc552fb1..5f256c6dd 100644 --- a/lib/analyze.js +++ b/lib/analyze.js @@ -39,35 +39,45 @@ async function finalizeDatabaseCreation(config, logger) { } // Runs queries and creates sarif files in the given folder async function runQueries(sarifFolder, memoryFlag, threadsFlag, config, logger) { - const codeql = codeql_1.getCodeQL(config.codeQLCmd); + const statusReport = {}; for (let language of config.languages) { logger.startGroup('Analyzing ' + language); - const queries = config.queries[language] || []; - if (queries.length === 0) { + const queries = config.queries[language]; + if (queries.builtin.length === 0 && queries.custom.length === 0) { throw new Error('Unable to analyse ' + language + ' as no queries were selected for this language'); } try { - const databasePath = util.getCodeQLDatabasePath(config.tempDir, language); - // Pass the queries to codeql using a file instead of using the command - // line to avoid command line length restrictions, particularly on windows. - const querySuite = databasePath + '-queries.qls'; - const querySuiteContents = queries.map(q => '- query: ' + q).join('\n'); - fs.writeFileSync(querySuite, querySuiteContents); - logger.debug('Query suite file for ' + language + '...\n' + querySuiteContents); - const sarifFile = path.join(sarifFolder, language + '.sarif'); - await codeql.databaseAnalyze(databasePath, sarifFile, querySuite, memoryFlag, threadsFlag); - logger.debug('SARIF results for database ' + language + ' created at "' + sarifFile + '"'); - logger.endGroup(); + for (const type of ['builtin', 'custom']) { + if (queries[type].length > 0) { + const startTime = new Date().getTime(); + const databasePath = util.getCodeQLDatabasePath(config.tempDir, language); + // Pass the queries to codeql using a file instead of using the command + // line to avoid command line length restrictions, particularly on windows. + const querySuitePath = `${databasePath}-queries-${type}.qls`; + const querySuiteContents = queries[type].map((q) => '- query: ' + q).join('\n'); + fs.writeFileSync(querySuitePath, querySuiteContents); + logger.debug('Query suite file for ' + language + '...\n' + querySuiteContents); + const sarifFile = path.join(sarifFolder, `${language}-${type}.sarif`); + const codeql = codeql_1.getCodeQL(config.codeQLCmd); + await codeql.databaseAnalyze(databasePath, sarifFile, querySuitePath, memoryFlag, threadsFlag); + logger.debug('SARIF results for database ' + language + ' created at "' + sarifFile + '"'); + logger.endGroup(); + // Record the performance + const endTime = new Date().getTime(); + statusReport[`analyze_${type}_queries_${language}_duration_ms`] = endTime - startTime; + } + } } catch (e) { - // For now the fields about query performance are not populated - return { - analyze_failure_language: language, - }; + logger.error(`Error running analysis for ${language}: ${e}`); + logger.info(e); + statusReport.analyze_failure_language = language; + return statusReport; } } - return {}; + return statusReport; } +exports.runQueries = runQueries; async function runAnalyze(repositoryNwo, commitOid, ref, analysisKey, analysisName, workflowRunID, checkoutPath, environment, githubAuth, githubUrl, doUpload, mode, outputDir, memoryFlag, threadsFlag, config, logger) { // Delete the tracer config env var to avoid tracing ourselves delete process.env[sharedEnv.ODASA_TRACER_CONFIGURATION]; diff --git a/lib/analyze.js.map b/lib/analyze.js.map index 3907718ac..7406f004f 100644 --- a/lib/analyze.js.map +++ b/lib/analyze.js.map @@ -1 +1 @@ -{"version":3,"file":"analyze.js","sourceRoot":"","sources":["../src/analyze.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,gEAAkD;AAClD,qCAAqC;AAErC,2CAAgD;AAGhD,gEAAkD;AAClD,yDAA2C;AAC3C,6CAA+B;AAiC/B,KAAK,UAAU,4BAA4B,CACzC,MAA0B,EAC1B,MAAc;IAEd,sEAAsE;IACtE,oCAAoC;IACpC,aAAa,CAAC,8BAA8B,CAAC,MAAM,CAAC,CAAC;IAErD,MAAM,MAAM,GAAG,kBAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAC3C,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,SAAS,EAAE;QACvC,IAAI,6BAAiB,CAAC,QAAQ,CAAC,EAAE;YAC/B,MAAM,CAAC,UAAU,CAAC,aAAa,GAAG,QAAQ,CAAC,CAAC;YAC5C,MAAM,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC;YACpG,MAAM,CAAC,QAA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UAAU,EACV,SAAS,EACT,IAAI,EACJ,MAAM,CAAC,CAAC;IAEV,OAAO,EAAE,GAAG,YAAY,EAAE,GAAG,WAAW,EAAE,CAAC;AAC7C,CAAC;AAnDD,gCAmDC"} \ No newline at end of file diff --git a/lib/analyze.test.js b/lib/analyze.test.js new file mode 100644 index 000000000..7380b52eb --- /dev/null +++ b/lib/analyze.test.js @@ -0,0 +1,60 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const ava_1 = __importDefault(require("ava")); +const fs = __importStar(require("fs")); +const analyze_1 = require("./analyze"); +const codeql_1 = require("./codeql"); +const languages_1 = require("./languages"); +const logging_1 = require("./logging"); +const testing_utils_1 = require("./testing-utils"); +const util = __importStar(require("./util")); +testing_utils_1.setupTests(ava_1.default); +// Checks that the duration fields are populated for the correct language +// and correct case of builtin or custom. +ava_1.default('status report fields', async (t) => { + return await util.withTmpDir(async (tmpDir) => { + codeql_1.setCodeQL({ + databaseAnalyze: async () => undefined + }); + const memoryFlag = ''; + const threadsFlag = ''; + for (const language of Object.values(languages_1.Language)) { + const config = { + languages: [language], + queries: {}, + pathsIgnore: [], + paths: [], + originalUserInput: {}, + tempDir: tmpDir, + toolCacheDir: tmpDir, + codeQLCmd: '', + }; + fs.mkdirSync(util.getCodeQLDatabasePath(config.tempDir, language), { recursive: true }); + config.queries[language] = { + builtin: ['foo.ql'], + custom: [], + }; + const builtinStatusReport = await analyze_1.runQueries(tmpDir, memoryFlag, threadsFlag, config, logging_1.getRunnerLogger(true)); + t.deepEqual(Object.keys(builtinStatusReport).length, 1); + t.true(`analyze_builtin_queries_${language}_duration_ms` in builtinStatusReport); + config.queries[language] = { + builtin: [], + custom: ['foo.ql'], + }; + const customStatusReport = await analyze_1.runQueries(tmpDir, memoryFlag, threadsFlag, config, logging_1.getRunnerLogger(true)); + t.deepEqual(Object.keys(customStatusReport).length, 1); + t.true(`analyze_custom_queries_${language}_duration_ms` in customStatusReport); + } + }); +}); +//# sourceMappingURL=analyze.test.js.map \ No newline at end of file diff --git a/lib/analyze.test.js.map b/lib/analyze.test.js.map new file mode 100644 index 000000000..e66941209 --- /dev/null +++ b/lib/analyze.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"analyze.test.js","sourceRoot":"","sources":["../src/analyze.test.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAAuB;AACvB,uCAAyB;AAEzB,uCAAuC;AACvC,qCAAqC;AAErC,2CAAuC;AACvC,uCAA4C;AAC5C,mDAA6C;AAC7C,6CAA+B;AAE/B,0BAAU,CAAC,aAAI,CAAC,CAAC;AAEjB,yEAAyE;AACzE,yCAAyC;AACzC,aAAI,CAAC,sBAAsB,EAAE,KAAK,EAAC,CAAC,EAAC,EAAE;IACrC,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,EAAC,MAAM,EAAC,EAAE;QAC1C,kBAAS,CAAC;YACR,eAAe,EAAE,KAAK,IAAI,EAAE,CAAC,SAAS;SACvC,CAAC,CAAC;QAEH,MAAM,UAAU,GAAG,EAAE,CAAC;QACtB,MAAM,WAAW,GAAG,EAAE,CAAC;QAEvB,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,oBAAQ,CAAC,EAAE;YAC9C,MAAM,MAAM,GAAW;gBACrB,SAAS,EAAE,CAAC,QAAQ,CAAC;gBACrB,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,EAAE;gBACf,KAAK,EAAE,EAAE;gBACT,iBAAiB,EAAE,EAAE;gBACrB,OAAO,EAAE,MAAM;gBACf,YAAY,EAAE,MAAM;gBACpB,SAAS,EAAE,EAAE;aACd,CAAC;YACF,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAExF,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG;gBACzB,OAAO,EAAE,CAAC,QAAQ,CAAC;gBACnB,MAAM,EAAE,EAAE;aACX,CAAC;YACF,MAAM,mBAAmB,GAAG,MAAM,oBAAU,CAC1C,MAAM,EACN,UAAU,EACV,WAAW,EACX,MAAM,EACN,yBAAe,CAAC,IAAI,CAAC,CAAC,CAAC;YACzB,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YACxD,CAAC,CAAC,IAAI,CAAC,2BAA2B,QAAQ,cAAc,IAAI,mBAAmB,CAAC,CAAC;YAEjF,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG;gBACzB,OAAO,EAAE,EAAE;gBACX,MAAM,EAAE,CAAC,QAAQ,CAAC;aACnB,CAAC;YACF,MAAM,kBAAkB,GAAG,MAAM,oBAAU,CACzC,MAAM,EACN,UAAU,EACV,WAAW,EACX,MAAM,EACN,yBAAe,CAAC,IAAI,CAAC,CAAC,CAAC;YACzB,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YACvD,CAAC,CAAC,IAAI,CAAC,0BAA0B,QAAQ,cAAc,IAAI,kBAAkB,CAAC,CAAC;SAChF;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/config-utils.js b/lib/config-utils.js index 5b0a4f62f..156e2d29c 100644 --- a/lib/config-utils.js +++ b/lib/config-utils.js @@ -61,17 +61,31 @@ function validateQueries(resolvedQueries) { } /** * Run 'codeql resolve queries' and add the results to resultMap + * + * If a checkout path is given then the queries are assumed to be custom queries + * and an error will be thrown if there is anything invalid about the queries. + * If a checkout path is not given then the queries are assumed to be builtin + * queries, and error checking will be suppressed. */ -async function runResolveQueries(codeQL, resultMap, toResolve, extraSearchPath, errorOnInvalidQueries) { +async function runResolveQueries(codeQL, resultMap, toResolve, extraSearchPath) { const resolvedQueries = await codeQL.resolveQueries(toResolve, extraSearchPath); - for (const [language, queries] of Object.entries(resolvedQueries.byLanguage)) { + if (extraSearchPath !== undefined) { + validateQueries(resolvedQueries); + } + for (const [language, queryPaths] of Object.entries(resolvedQueries.byLanguage)) { if (resultMap[language] === undefined) { - resultMap[language] = []; + resultMap[language] = { + builtin: [], + custom: [], + }; + } + const queries = Object.keys(queryPaths).filter(q => !queryIsDisabled(language, q)); + if (extraSearchPath !== undefined) { + resultMap[language].custom.push(...queries); + } + else { + resultMap[language].builtin.push(...queries); } - resultMap[language].push(...Object.keys(queries).filter(q => !queryIsDisabled(language, q))); - } - if (errorOnInvalidQueries) { - validateQueries(resolvedQueries); } } /** @@ -79,7 +93,7 @@ async function runResolveQueries(codeQL, resultMap, toResolve, extraSearchPath, */ async function addDefaultQueries(codeQL, languages, resultMap) { const suites = languages.map(l => l + '-code-scanning.qls'); - await runResolveQueries(codeQL, resultMap, suites, undefined, false); + await runResolveQueries(codeQL, resultMap, suites, undefined); } // The set of acceptable values for built-in suites from the codeql bundle const builtinSuites = ['security-extended', 'security-and-quality']; @@ -93,7 +107,7 @@ async function addBuiltinSuiteQueries(languages, codeQL, resultMap, suiteName, c throw new Error(getQueryUsesInvalid(configFile, suiteName)); } const suites = languages.map(l => l + '-' + suiteName + '.qls'); - await runResolveQueries(codeQL, resultMap, suites, undefined, false); + await runResolveQueries(codeQL, resultMap, suites, undefined); } /** * Retrieve the set of queries at localQueryPath and add them to resultMap. @@ -112,7 +126,7 @@ async function addLocalQueries(codeQL, resultMap, localQueryPath, checkoutPath, if (!(absoluteQueryPath + path.sep).startsWith(fs.realpathSync(checkoutPath) + path.sep)) { throw new Error(getLocalPathOutsideOfRepository(configFile, localQueryPath)); } - await runResolveQueries(codeQL, resultMap, [absoluteQueryPath], checkoutPath, true); + await runResolveQueries(codeQL, resultMap, [absoluteQueryPath], checkoutPath); } /** * Retrieve the set of queries at the referenced remote repo and add them to resultMap. @@ -140,7 +154,7 @@ async function addRemoteQueries(codeQL, resultMap, queryUses, tempDir, githubUrl const queryPath = tok.length > 2 ? path.join(checkoutPath, tok.slice(2).join('/')) : checkoutPath; - await runResolveQueries(codeQL, resultMap, [queryPath], checkoutPath, true); + await runResolveQueries(codeQL, resultMap, [queryPath], checkoutPath); } /** * Parse a query 'uses' field to a discrete set of query files and update resultMap. @@ -476,7 +490,8 @@ async function loadConfig(languagesInput, queriesInput, configFile, repository, // The list of queries should not be empty for any language. If it is then // it is a user configuration error. for (const language of languages) { - if (queries[language] === undefined || queries[language].length === 0) { + if (queries[language] === undefined || + (queries[language].builtin.length === 0 && queries[language].custom.length === 0)) { throw new Error(`Did not detect any queries to run for ${language}. ` + "Please make sure that the default queries are enabled, or you are specifying queries to run."); } diff --git a/lib/config-utils.js.map b/lib/config-utils.js.map index 116353526..ecf7c0c02 100644 --- a/lib/config-utils.js.map +++ b/lib/config-utils.js.map @@ -1 +1 @@ -{"version":3,"file":"config-utils.js","sourceRoot":"","sources":["../src/config-utils.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAyB;AACzB,8CAAgC;AAChC,2CAA6B;AAE7B,kDAAoC;AAEpC,oEAAsD;AACtD,2CAAsD;AAItD,qDAAqD;AACrD,MAAM,aAAa,GAAG,MAAM,CAAC;AAC7B,MAAM,gCAAgC,GAAG,yBAAyB,CAAC;AACnE,MAAM,gBAAgB,GAAG,SAAS,CAAC;AACnC,MAAM,qBAAqB,GAAG,MAAM,CAAC;AACrC,MAAM,qBAAqB,GAAG,cAAc,CAAC;AAC7C,MAAM,cAAc,GAAG,OAAO,CAAC;AA8D/B;;;;;;;;GAQG;AACH,MAAM,wBAAwB,GAAmC;IAC/D,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D,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC/B,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AAClC,CAAC;AATD,8BASC"} \ No newline at end of file diff --git a/lib/config-utils.test.js b/lib/config-utils.test.js index f23790c75..2a9d96af7 100644 --- a/lib/config-utils.test.js +++ b/lib/config-utils.test.js @@ -161,7 +161,10 @@ ava_1.default("load non-empty input", async (t) => { // And the config we expect it to parse to const expectedConfig = { languages: [languages_1.Language.javascript], - queries: { 'javascript': ['/foo/a.ql', '/bar/b.ql'] }, + queries: { 'javascript': { + builtin: [], + custom: ['/foo/a.ql', '/bar/b.ql'] + } }, pathsIgnore: ['a', 'b'], paths: ['c/d'], originalUserInput: { @@ -260,9 +263,10 @@ ava_1.default("Queries can be specified in config file", async (t) => { t.deepEqual(resolveQueriesArgs[1].queries.length, 1); t.regex(resolveQueriesArgs[1].queries[0], /.*\/foo$/); // Now check that the end result contains the default queries and the query from config - t.deepEqual(config.queries['javascript'].length, 2); - t.regex(config.queries['javascript'][0], /javascript-code-scanning.qls$/); - t.regex(config.queries['javascript'][1], /.*\/foo$/); + t.deepEqual(config.queries['javascript'].builtin.length, 1); + t.deepEqual(config.queries['javascript'].custom.length, 1); + t.regex(config.queries['javascript'].builtin[0], /javascript-code-scanning.qls$/); + t.regex(config.queries['javascript'].custom[0], /.*\/foo$/); }); }); ava_1.default("Queries from config file can be overridden in workflow file", async (t) => { @@ -292,9 +296,10 @@ ava_1.default("Queries from config file can be overridden in workflow file", asy t.deepEqual(resolveQueriesArgs[1].queries.length, 1); t.regex(resolveQueriesArgs[1].queries[0], /.*\/override$/); // Now check that the end result contains only the default queries and the override query - t.deepEqual(config.queries['javascript'].length, 2); - t.regex(config.queries['javascript'][0], /javascript-code-scanning.qls$/); - t.regex(config.queries['javascript'][1], /.*\/override$/); + t.deepEqual(config.queries['javascript'].builtin.length, 1); + t.deepEqual(config.queries['javascript'].custom.length, 1); + t.regex(config.queries['javascript'].builtin[0], /javascript-code-scanning.qls$/); + t.regex(config.queries['javascript'].custom[0], /.*\/override$/); }); }); ava_1.default("Queries in workflow file can be used in tandem with the 'disable default queries' option", async (t) => { @@ -323,8 +328,9 @@ ava_1.default("Queries in workflow file can be used in tandem with the 'disable t.deepEqual(resolveQueriesArgs[0].queries.length, 1); t.regex(resolveQueriesArgs[0].queries[0], /.*\/workflow-query$/); // Now check that the end result contains only the workflow query, and not the default one - t.deepEqual(config.queries['javascript'].length, 1); - t.regex(config.queries['javascript'][0], /.*\/workflow-query$/); + t.deepEqual(config.queries['javascript'].builtin.length, 0); + t.deepEqual(config.queries['javascript'].custom.length, 1); + t.regex(config.queries['javascript'].custom[0], /.*\/workflow-query$/); }); }); ava_1.default("Multiple queries can be specified in workflow file, no config file required", async (t) => { @@ -350,10 +356,11 @@ ava_1.default("Multiple queries can be specified in workflow file, no config fil t.regex(resolveQueriesArgs[1].queries[0], /.*\/override1$/); t.regex(resolveQueriesArgs[2].queries[0], /.*\/override2$/); // Now check that the end result contains both the queries from the workflow, as well as the defaults - t.deepEqual(config.queries['javascript'].length, 3); - t.regex(config.queries['javascript'][0], /javascript-code-scanning.qls$/); - t.regex(config.queries['javascript'][1], /.*\/override1$/); - t.regex(config.queries['javascript'][2], /.*\/override2$/); + t.deepEqual(config.queries['javascript'].builtin.length, 1); + t.deepEqual(config.queries['javascript'].custom.length, 2); + t.regex(config.queries['javascript'].builtin[0], /javascript-code-scanning.qls$/); + t.regex(config.queries['javascript'].custom[0], /.*\/override1$/); + t.regex(config.queries['javascript'].custom[1], /.*\/override2$/); }); }); ava_1.default("Queries in workflow file can be added to the set of queries without overriding config file", async (t) => { @@ -391,11 +398,12 @@ ava_1.default("Queries in workflow file can be added to the set of queries witho t.deepEqual(resolveQueriesArgs[3].queries.length, 1); t.regex(resolveQueriesArgs[3].queries[0], /.*\/foo$/); // Now check that the end result contains all the queries - t.deepEqual(config.queries['javascript'].length, 4); - t.regex(config.queries['javascript'][0], /javascript-code-scanning.qls$/); - t.regex(config.queries['javascript'][1], /.*\/additional1$/); - t.regex(config.queries['javascript'][2], /.*\/additional2$/); - t.regex(config.queries['javascript'][3], /.*\/foo$/); + t.deepEqual(config.queries['javascript'].builtin.length, 1); + t.deepEqual(config.queries['javascript'].custom.length, 3); + t.regex(config.queries['javascript'].builtin[0], /javascript-code-scanning.qls$/); + t.regex(config.queries['javascript'].custom[0], /.*\/additional1$/); + t.regex(config.queries['javascript'].custom[1], /.*\/additional2$/); + t.regex(config.queries['javascript'].custom[2], /.*\/foo$/); }); }); ava_1.default("Invalid queries in workflow file handled correctly", async (t) => { diff --git a/lib/config-utils.test.js.map b/lib/config-utils.test.js.map index ef56568d6..d4eb7efa4 100644 --- a/lib/config-utils.test.js.map +++ b/lib/config-utils.test.js.map @@ -1 +1 @@ -{"version":3,"file":"config-utils.test.js","sourceRoot":"","sources":["../src/config-utils.test.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAA0C;AAC1C,8CAAuB;AACvB,uCAAyB;AACzB,2CAA6B;AAC7B,kDAA0B;AAE1B,kDAAoC;AACpC,qCAAsD;AACtD,4DAA8C;AAC9C,2CAAuC;AACvC,uCAA4C;AAC5C,mDAA2C;AAC3C,6CAA+B;AAE/B,0BAAU,CAAC,aAAI,CAAC,CAAC;AAEjB,iDAAiD;AACjD,SAAS,gBAAgB,CAAC,iBAAyB,EAAE,MAAc;IACjE,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClD,EAAE,CAAC,aAAa,CAAC,cAAc,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAC;IAC5D,OAAO,cAAc,CAAC;AACxB,CAAC;AAID,SAAS,eAAe,CAAC,OAA4B;IACnD,kEAAkE;IAClE,IAAI,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACtC,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AmB,EAAE,CAAC,CAAC,EAAE;IAC5B,kDAAkD;IAClD,MAAM,YAAY,GAAG,OAAO,CAAC;IAC7B,MAAM,UAAU,GAAG,6BAA6B,CAAC;IAEjD,+BAA+B;IAC/B,CAAC,CAAC,SAAS,CACT,WAAW,CAAC,uBAAuB,CAAC,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,yBAAe,CAAC,IAAI,CAAC,CAAC,EAC/F,SAAS,CAAC,CAAC;IAEb,8BAA8B;IAC9B,CAAC,CAAC,SAAS,CACT,WAAW,CAAC,uBAAuB,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,yBAAe,CAAC,IAAI,CAAC,CAAC,EAC9F,MAAM,CAAC,CAAC;AACZ,CAAC,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"config-utils.test.js","sourceRoot":"","sources":["../src/config-utils.test.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAA0C;AAC1C,8CAAuB;AACvB,uCAAyB;AACzB,2CAA6B;AAC7B,kDAA0B;AAE1B,kDAAoC;AACpC,qCAAsD;AACtD,4DAA8C;AAC9C,2CAAuC;AACvC,uCAA4C;AAC5C,mDAA2C;AAC3C,6CAA+B;AAE/B,0BAAU,CAAC,aAAI,CAAC,CAAC;AAEjB,iDAAiD;AACjD,SAAS,gBAAgB,CAAC,iBAAyB,EAAE,MAAc;IACjE,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClD,EAAE,CAAC,aAAa,CAAC,cAAc,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAC;IAC5D,OAAO,cAAc,CAAC;AACxB,CAAC;AAID,SAAS,eAAe,CAAC,OAA4B;IACnD,kEAAkE;IAClE,IAAI,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,QAAQ,GAAG;QACf,IAAI,EAAE,OAAO;KACd,CAAC;IACF,MAAM,cAAc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C"} \ No newline at end of file diff --git a/src/analyze.test.ts b/src/analyze.test.ts new file mode 100644 index 000000000..127bc8e77 --- /dev/null +++ b/src/analyze.test.ts @@ -0,0 +1,65 @@ +import test from 'ava'; +import * as fs from 'fs'; + +import { runQueries } from './analyze'; +import { setCodeQL } from './codeql'; +import { Config } from './config-utils'; +import { Language } from './languages'; +import { getRunnerLogger } from './logging'; +import { setupTests } from './testing-utils'; +import * as util from './util'; + +setupTests(test); + +// Checks that the duration fields are populated for the correct language +// and correct case of builtin or custom. +test('status report fields', async t => { + return await util.withTmpDir(async tmpDir => { + setCodeQL({ + databaseAnalyze: async () => undefined + }); + + const memoryFlag = ''; + const threadsFlag = ''; + + for (const language of Object.values(Language)) { + const config: Config = { + languages: [language], + queries: {}, + pathsIgnore: [], + paths: [], + originalUserInput: {}, + tempDir: tmpDir, + toolCacheDir: tmpDir, + codeQLCmd: '', + }; + fs.mkdirSync(util.getCodeQLDatabasePath(config.tempDir, language), { recursive: true }); + + config.queries[language] = { + builtin: ['foo.ql'], + custom: [], + }; + const builtinStatusReport = await runQueries( + tmpDir, + memoryFlag, + threadsFlag, + config, + getRunnerLogger(true)); + t.deepEqual(Object.keys(builtinStatusReport).length, 1); + t.true(`analyze_builtin_queries_${language}_duration_ms` in builtinStatusReport); + + config.queries[language] = { + builtin: [], + custom: ['foo.ql'], + }; + const customStatusReport = await runQueries( + tmpDir, + memoryFlag, + threadsFlag, + config, + getRunnerLogger(true)); + t.deepEqual(Object.keys(customStatusReport).length, 1); + t.true(`analyze_custom_queries_${language}_duration_ms` in customStatusReport); + } + }); +}); diff --git a/src/analyze.ts b/src/analyze.ts index 588238793..05e11a932 100644 --- a/src/analyze.ts +++ b/src/analyze.ts @@ -75,47 +75,58 @@ async function finalizeDatabaseCreation( } // Runs queries and creates sarif files in the given folder -async function runQueries( +export async function runQueries( sarifFolder: string, memoryFlag: string, threadsFlag: string, config: configUtils.Config, logger: Logger): Promise { - const codeql = getCodeQL(config.codeQLCmd); + const statusReport: QueriesStatusReport = {}; + for (let language of config.languages) { logger.startGroup('Analyzing ' + language); - const queries = config.queries[language] || []; - if (queries.length === 0) { + const queries = config.queries[language]; + if (queries.builtin.length === 0 && queries.custom.length === 0) { throw new Error('Unable to analyse ' + language + ' as no queries were selected for this language'); } try { - const databasePath = util.getCodeQLDatabasePath(config.tempDir, language); - // Pass the queries to codeql using a file instead of using the command - // line to avoid command line length restrictions, particularly on windows. - const querySuite = databasePath + '-queries.qls'; - const querySuiteContents = queries.map(q => '- query: ' + q).join('\n'); - fs.writeFileSync(querySuite, querySuiteContents); - logger.debug('Query suite file for ' + language + '...\n' + querySuiteContents); - - const sarifFile = path.join(sarifFolder, language + '.sarif'); - - await codeql.databaseAnalyze(databasePath, sarifFile, querySuite, memoryFlag, threadsFlag); - - logger.debug('SARIF results for database ' + language + ' created at "' + sarifFile + '"'); - logger.endGroup(); - + for (const type of ['builtin', 'custom']) { + if (queries[type].length > 0) { + const startTime = new Date().getTime(); + + const databasePath = util.getCodeQLDatabasePath(config.tempDir, language); + // Pass the queries to codeql using a file instead of using the command + // line to avoid command line length restrictions, particularly on windows. + const querySuitePath = `${databasePath}-queries-${type}.qls`; + const querySuiteContents = queries[type].map((q: string) => '- query: ' + q).join('\n'); + fs.writeFileSync(querySuitePath, querySuiteContents); + logger.debug('Query suite file for ' + language + '...\n' + querySuiteContents); + + const sarifFile = path.join(sarifFolder, `${language}-${type}.sarif`); + + const codeql = getCodeQL(config.codeQLCmd); + await codeql.databaseAnalyze(databasePath, sarifFile, querySuitePath, memoryFlag, threadsFlag); + + logger.debug('SARIF results for database ' + language + ' created at "' + sarifFile + '"'); + logger.endGroup(); + + // Record the performance + const endTime = new Date().getTime(); + statusReport[`analyze_${type}_queries_${language}_duration_ms`] = endTime - startTime; + } + } } catch (e) { - // For now the fields about query performance are not populated - return { - analyze_failure_language: language, - }; + logger.error(`Error running analysis for ${language}: ${e}`); + logger.info(e); + statusReport.analyze_failure_language = language; + return statusReport; } } - return {}; + return statusReport; } export async function runAnalyze( diff --git a/src/config-utils.test.ts b/src/config-utils.test.ts index df34fb5f3..cb7aa29d9 100644 --- a/src/config-utils.test.ts +++ b/src/config-utils.test.ts @@ -239,7 +239,10 @@ test("load non-empty input", async t => { // And the config we expect it to parse to const expectedConfig: configUtils.Config = { languages: [Language.javascript], - queries: {'javascript': ['/foo/a.ql', '/bar/b.ql']}, + queries: {'javascript': { + builtin: [], + custom: ['/foo/a.ql', '/bar/b.ql'] + }}, pathsIgnore: ['a', 'b'], paths: ['c/d'], originalUserInput: { @@ -390,9 +393,10 @@ test("Queries can be specified in config file", async t => { t.regex(resolveQueriesArgs[1].queries[0], /.*\/foo$/); // Now check that the end result contains the default queries and the query from config - t.deepEqual(config.queries['javascript'].length, 2); - t.regex(config.queries['javascript'][0], /javascript-code-scanning.qls$/); - t.regex(config.queries['javascript'][1], /.*\/foo$/); + t.deepEqual(config.queries['javascript'].builtin.length, 1); + t.deepEqual(config.queries['javascript'].custom.length, 1); + t.regex(config.queries['javascript'].builtin[0], /javascript-code-scanning.qls$/); + t.regex(config.queries['javascript'].custom[0], /.*\/foo$/); }); }); @@ -442,9 +446,10 @@ test("Queries from config file can be overridden in workflow file", async t => { t.regex(resolveQueriesArgs[1].queries[0], /.*\/override$/); // Now check that the end result contains only the default queries and the override query - t.deepEqual(config.queries['javascript'].length, 2); - t.regex(config.queries['javascript'][0], /javascript-code-scanning.qls$/); - t.regex(config.queries['javascript'][1], /.*\/override$/); + t.deepEqual(config.queries['javascript'].builtin.length, 1); + t.deepEqual(config.queries['javascript'].custom.length, 1); + t.regex(config.queries['javascript'].builtin[0], /javascript-code-scanning.qls$/); + t.regex(config.queries['javascript'].custom[0], /.*\/override$/); }); }); @@ -492,8 +497,9 @@ test("Queries in workflow file can be used in tandem with the 'disable default q t.regex(resolveQueriesArgs[0].queries[0], /.*\/workflow-query$/); // Now check that the end result contains only the workflow query, and not the default one - t.deepEqual(config.queries['javascript'].length, 1); - t.regex(config.queries['javascript'][0], /.*\/workflow-query$/); + t.deepEqual(config.queries['javascript'].builtin.length, 0); + t.deepEqual(config.queries['javascript'].custom.length, 1); + t.regex(config.queries['javascript'].custom[0], /.*\/workflow-query$/); }); }); @@ -537,10 +543,11 @@ test("Multiple queries can be specified in workflow file, no config file require t.regex(resolveQueriesArgs[2].queries[0], /.*\/override2$/); // Now check that the end result contains both the queries from the workflow, as well as the defaults - t.deepEqual(config.queries['javascript'].length, 3); - t.regex(config.queries['javascript'][0], /javascript-code-scanning.qls$/); - t.regex(config.queries['javascript'][1], /.*\/override1$/); - t.regex(config.queries['javascript'][2], /.*\/override2$/); + t.deepEqual(config.queries['javascript'].builtin.length, 1); + t.deepEqual(config.queries['javascript'].custom.length, 2); + t.regex(config.queries['javascript'].builtin[0], /javascript-code-scanning.qls$/); + t.regex(config.queries['javascript'].custom[0], /.*\/override1$/); + t.regex(config.queries['javascript'].custom[1], /.*\/override2$/); }); }); @@ -598,11 +605,12 @@ test("Queries in workflow file can be added to the set of queries without overri t.regex(resolveQueriesArgs[3].queries[0], /.*\/foo$/); // Now check that the end result contains all the queries - t.deepEqual(config.queries['javascript'].length, 4); - t.regex(config.queries['javascript'][0], /javascript-code-scanning.qls$/); - t.regex(config.queries['javascript'][1], /.*\/additional1$/); - t.regex(config.queries['javascript'][2], /.*\/additional2$/); - t.regex(config.queries['javascript'][3], /.*\/foo$/); + t.deepEqual(config.queries['javascript'].builtin.length, 1); + t.deepEqual(config.queries['javascript'].custom.length, 3); + t.regex(config.queries['javascript'].builtin[0], /javascript-code-scanning.qls$/); + t.regex(config.queries['javascript'].custom[0], /.*\/additional1$/); + t.regex(config.queries['javascript'].custom[1], /.*\/additional2$/); + t.regex(config.queries['javascript'].custom[2], /.*\/foo$/); }); }); diff --git a/src/config-utils.ts b/src/config-utils.ts index c313b6c30..a5145291f 100644 --- a/src/config-utils.ts +++ b/src/config-utils.ts @@ -31,6 +31,22 @@ export interface UserConfig { paths?: string[]; } +/** + * Lists of query files for each language. + * Will only contain .ql files and not other kinds of files, + * and all file paths will be absolute. + * + * The queries are split between ones from a builtin suite + * and custom queries from unknown locations. This allows us to treat + * them separately if we want to, for example to measure performance. + */ +type Queries = { [language: string]: { + /** Queries from one of the builtin suites */ + builtin: string[]; + /** Custom queries, from a non-standard location */ + custom: string[]; +}}; + /** * Format of the parsed config file. */ @@ -41,10 +57,8 @@ export interface Config { languages: Language[]; /** * Map from language to query files. - * Will only contain .ql files and not other kinds of files, - * and all file paths will be absolute. */ - queries: { [language: string]: string[] }; + queries: Queries; /** * List of paths to ignore from analysis. */ @@ -122,34 +136,46 @@ function validateQueries(resolvedQueries: ResolveQueriesOutput) { /** * Run 'codeql resolve queries' and add the results to resultMap + * + * If a checkout path is given then the queries are assumed to be custom queries + * and an error will be thrown if there is anything invalid about the queries. + * If a checkout path is not given then the queries are assumed to be builtin + * queries, and error checking will be suppressed. */ async function runResolveQueries( codeQL: CodeQL, - resultMap: { [language: string]: string[] }, + resultMap: Queries, toResolve: string[], - extraSearchPath: string | undefined, - errorOnInvalidQueries: boolean) { + extraSearchPath: string | undefined) { const resolvedQueries = await codeQL.resolveQueries(toResolve, extraSearchPath); - for (const [language, queries] of Object.entries(resolvedQueries.byLanguage)) { - if (resultMap[language] === undefined) { - resultMap[language] = []; - } - resultMap[language].push(...Object.keys(queries).filter(q => !queryIsDisabled(language, q))); + if (extraSearchPath !== undefined) { + validateQueries(resolvedQueries); } - if (errorOnInvalidQueries) { - validateQueries(resolvedQueries); + for (const [language, queryPaths] of Object.entries(resolvedQueries.byLanguage)) { + if (resultMap[language] === undefined) { + resultMap[language] = { + builtin: [], + custom: [], + }; + } + const queries = Object.keys(queryPaths).filter(q => !queryIsDisabled(language, q)); + if (extraSearchPath !== undefined) { + resultMap[language].custom.push(...queries); + } else { + resultMap[language].builtin.push(...queries); + } } } /** * Get the set of queries included by default. */ -async function addDefaultQueries(codeQL: CodeQL, languages: string[], resultMap: { [language: string]: string[] }) { +async function addDefaultQueries(codeQL: CodeQL, languages: string[], resultMap: Queries) { const suites = languages.map(l => l + '-code-scanning.qls'); - await runResolveQueries(codeQL, resultMap, suites, undefined, false); + await runResolveQueries(codeQL, resultMap, suites, undefined); } // The set of acceptable values for built-in suites from the codeql bundle @@ -162,7 +188,7 @@ const builtinSuites = ['security-extended', 'security-and-quality'] as const; async function addBuiltinSuiteQueries( languages: string[], codeQL: CodeQL, - resultMap: { [language: string]: string[] }, + resultMap: Queries, suiteName: string, configFile?: string) { @@ -172,7 +198,7 @@ async function addBuiltinSuiteQueries( } const suites = languages.map(l => l + '-' + suiteName + '.qls'); - await runResolveQueries(codeQL, resultMap, suites, undefined, false); + await runResolveQueries(codeQL, resultMap, suites, undefined); } /** @@ -180,7 +206,7 @@ async function addBuiltinSuiteQueries( */ async function addLocalQueries( codeQL: CodeQL, - resultMap: { [language: string]: string[] }, + resultMap: Queries, localQueryPath: string, checkoutPath: string, configFile?: string) { @@ -202,7 +228,7 @@ async function addLocalQueries( throw new Error(getLocalPathOutsideOfRepository(configFile, localQueryPath)); } - await runResolveQueries(codeQL, resultMap, [absoluteQueryPath], checkoutPath, true); + await runResolveQueries(codeQL, resultMap, [absoluteQueryPath], checkoutPath); } /** @@ -210,7 +236,7 @@ async function addLocalQueries( */ async function addRemoteQueries( codeQL: CodeQL, - resultMap: { [language: string]: string[] }, + resultMap: Queries, queryUses: string, tempDir: string, githubUrl: string, @@ -249,7 +275,7 @@ async function addRemoteQueries( ? path.join(checkoutPath, tok.slice(2).join('/')) : checkoutPath; - await runResolveQueries(codeQL, resultMap, [queryPath], checkoutPath, true); + await runResolveQueries(codeQL, resultMap, [queryPath], checkoutPath); } /** @@ -263,7 +289,7 @@ async function addRemoteQueries( async function parseQueryUses( languages: string[], codeQL: CodeQL, - resultMap: { [language: string]: string[] }, + resultMap: Queries, queryUses: string, tempDir: string, checkoutPath: string, @@ -543,7 +569,7 @@ async function addQueriesFromWorkflow( codeQL: CodeQL, queriesInput: string, languages: string[], - resultMap: { [language: string]: string[] }, + resultMap: Queries, tempDir: string, checkoutPath: string, githubUrl: string, @@ -599,7 +625,7 @@ export async function getDefaultConfig( githubAuth, githubUrl, logger); - const queries = {}; + const queries: Queries = {}; await addDefaultQueries(codeQL, languages, queries); if (queriesInput) { await addQueriesFromWorkflow( @@ -672,7 +698,7 @@ async function loadConfig( githubUrl, logger); - const queries = {}; + const queries: Queries = {}; const pathsIgnore: string[] = []; const paths: string[] = []; @@ -750,7 +776,8 @@ async function loadConfig( // The list of queries should not be empty for any language. If it is then // it is a user configuration error. for (const language of languages) { - if (queries[language] === undefined || queries[language].length === 0) { + if (queries[language] === undefined || + (queries[language].builtin.length === 0 && queries[language].custom.length === 0)) { throw new Error(`Did not detect any queries to run for ${language}. ` + "Please make sure that the default queries are enabled, or you are specifying queries to run."); } From 1fb7c81099a0cf4b3c37f9e2cfd8e5912780534e Mon Sep 17 00:00:00 2001 From: Nick Fyson Date: Fri, 11 Sep 2020 18:25:23 +0100 Subject: [PATCH 18/35] tweak in response to reviewer comments --- lib/error-matcher.js | 5 ++--- lib/error-matcher.js.map | 2 +- lib/error-matcher.test.js | 16 ++++++---------- lib/error-matcher.test.js.map | 2 +- lib/toolrunner-error-catcher.js | 10 +++++----- lib/toolrunner-error-catcher.js.map | 2 +- lib/toolrunner-error-catcher.test.js | 9 ++++----- lib/toolrunner-error-catcher.test.js.map | 2 +- src/error-matcher.test.ts | 18 +++++++----------- src/error-matcher.ts | 5 ++--- src/toolrunner-error-catcher.test.ts | 9 ++++----- src/toolrunner-error-catcher.ts | 12 ++++++------ 12 files changed, 40 insertions(+), 52 deletions(-) diff --git a/lib/error-matcher.js b/lib/error-matcher.js index 2557b5a07..3881dac19 100644 --- a/lib/error-matcher.js +++ b/lib/error-matcher.js @@ -4,13 +4,12 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.namedMatchersForTesting = { /* In due course it may be possible to remove the regex, if/when javascript also exits with code 32. - For context see https://github.com/github/semmle-code/pull/36921 */ noSourceCodeFound: [ 32, new RegExp("No JavaScript or TypeScript code found\\."), - `No source code was seen during the build. Please see... -https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/troubleshooting-code-scanning#no-code-found-during-the-build` + "No code found during the build. Please see:\n" + + "https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/troubleshooting-code-scanning#no-code-found-during-the-build" ], }; // we collapse the matches into an array for use in execErrorCatcher diff --git a/lib/error-matcher.js.map b/lib/error-matcher.js.map index 3e6fa866c..dd41806ff 100644 --- a/lib/error-matcher.js.map +++ b/lib/error-matcher.js.map @@ -1 +1 @@ -{"version":3,"file":"error-matcher.js","sourceRoot":"","sources":["../src/error-matcher.ts"],"names":[],"mappings":";;AAGA,qCAAqC;AACxB,QAAA,uBAAuB,GAAoC;IACtE;;;MAGE;IACF,iBAAiB,EAAE;QACjB,EAAE;QACF,IAAI,MAAM,CAAC,2CAA2C,CAAC;QACvD;wJACoJ;KACrJ;CACF,CAAC;AAEF,oEAAoE;AACvD,QAAA,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,+BAAuB,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"error-matcher.js","sourceRoot":"","sources":["../src/error-matcher.ts"],"names":[],"mappings":";;AAGA,qCAAqC;AACxB,QAAA,uBAAuB,GAAoC;IACtE;;MAEE;IACF,iBAAiB,EAAE;QACjB,EAAE;QACF,IAAI,MAAM,CAAC,2CAA2C,CAAC;QACvD,+CAA+C;YAC/C,yJAAyJ;KAC1J;CACF,CAAC;AAEF,oEAAoE;AACvD,QAAA,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,+BAAuB,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/error-matcher.test.js b/lib/error-matcher.test.js index d68d58d96..c79bf5719 100644 --- a/lib/error-matcher.test.js +++ b/lib/error-matcher.test.js @@ -17,17 +17,13 @@ ava_1.default('noSourceCodeFound matches against example javascript output', asy `)); }); function testErrorMatcher(matcherName, logSample) { - const regex = error_matcher_1.namedMatchersForTesting[matcherName] ? error_matcher_1.namedMatchersForTesting[matcherName][1] : null; - if (regex) { - return regex.test(logSample); + if (!(matcherName in error_matcher_1.namedMatchersForTesting)) { + throw new Error(`Unknown matcher ${matcherName}`); } - else { - if (error_matcher_1.namedMatchersForTesting[matcherName]) { - throw new Error(`Cannot test matcher ${matcherName} with null regex`); - } - else { - throw new Error(`Unknown matcher ${matcherName}`); - } + const regex = error_matcher_1.namedMatchersForTesting[matcherName][1]; + if (regex === null) { + throw new Error(`Cannot test matcher ${matcherName} with null regex`); } + return regex.test(logSample); } //# sourceMappingURL=error-matcher.test.js.map \ No newline at end of file diff --git a/lib/error-matcher.test.js.map b/lib/error-matcher.test.js.map index 60db0bb8b..321a28a65 100644 --- a/lib/error-matcher.test.js.map +++ b/lib/error-matcher.test.js.map @@ -1 +1 @@ -{"version":3,"file":"error-matcher.test.js","sourceRoot":"","sources":["../src/error-matcher.test.ts"],"names":[],"mappings":";;;;;AACA,8CAAuB;AAEvB,mDAA0D;AAE1D;;EAEE;AAEF,aAAI,CAAC,6DAA6D,EAAE,KAAK,EAAC,CAAC,EAAC,EAAE;IAC5E,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,mBAAmB,EAAE;;;;;GAK9C,CAAC,CAAC,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,SAAS,gBAAgB,CAAC,WAAmB,EAAE,SAAiB;IAE9D,MAAM,KAAK,GAAG,uCAAuB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,uCAAuB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAEpG,IAAI,KAAK,EAAE;QACT,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KAC9B;SAAM;QACL,IAAI,uCAAuB,CAAC,WAAW,CAAC,EAAE;YACxC,MAAM,IAAI,KAAK,CAAC,uBAAuB,WAAW,kBAAkB,CAAC,CAAC;SACvE;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,mBAAmB,WAAW,EAAE,CAAC,CAAC;SACnD;KACF;AAEH,CAAC"} \ No newline at end of file +{"version":3,"file":"error-matcher.test.js","sourceRoot":"","sources":["../src/error-matcher.test.ts"],"names":[],"mappings":";;;;;AACA,8CAAuB;AAEvB,mDAA0D;AAE1D;;EAEE;AAEF,aAAI,CAAC,6DAA6D,EAAE,KAAK,EAAC,CAAC,EAAC,EAAE;IAC5E,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,mBAAmB,EAAE;;;;;GAK9C,CAAC,CAAC,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,SAAS,gBAAgB,CAAC,WAAmB,EAAE,SAAiB;IAE9D,IAAI,CAAC,CAAC,WAAW,IAAI,uCAAuB,CAAC,EAAE;QAC7C,MAAM,IAAI,KAAK,CAAC,mBAAmB,WAAW,EAAE,CAAC,CAAC;KACnD;IACD,MAAM,KAAK,GAAG,uCAAuB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACtD,IAAI,KAAK,KAAK,IAAI,EAAE;QAClB,MAAM,IAAI,KAAK,CAAC,uBAAuB,WAAW,kBAAkB,CAAC,CAAC;KACvE;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAC/B,CAAC"} \ No newline at end of file diff --git a/lib/toolrunner-error-catcher.js b/lib/toolrunner-error-catcher.js index ed6f90a66..ec1ebdad8 100644 --- a/lib/toolrunner-error-catcher.js +++ b/lib/toolrunner-error-catcher.js @@ -9,13 +9,13 @@ var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); const toolrunnner = __importStar(require("@actions/exec/lib/toolrunner")); /** - * Wrapper for exec.exec which checks for specific return code and/or regex matches in console output. + * Wrapper for toolrunner.Toolrunner which checks for specific return code and/or regex matches in console output. * Output will be streamed to the live console as well as captured for subsequent processing. * Returns promise with return code * - * @param commandLine command to execute (can include additional args). Must be correctly escaped. - * @param matchers defines specific codes and/or regexes that should lead to return of a custom error + * @param commandLine command to execute * @param args optional arguments for tool. Escaping is handled by the lib. + * @param matchers defines specific codes and/or regexes that should lead to return of a custom error * @param options optional exec options. See ExecOptions * @returns Promise exit code */ @@ -31,7 +31,7 @@ async function toolrunnerErrorCatcher(commandLine, args, matchers, options) { options.listeners.stdout(data); } else { - // if no stdout listener was originally defined then we match default behavior of exec.exec + // if no stdout listener was originally defined then we match default behavior of Toolrunner process.stdout.write(data); } }, @@ -42,7 +42,7 @@ async function toolrunnerErrorCatcher(commandLine, args, matchers, options) { options.listeners.stderr(data); } else { - // if no stderr listener was originally defined then we match default behavior of exec.exec + // if no stderr listener was originally defined then we match default behavior of Toolrunner process.stderr.write(data); } } diff --git a/lib/toolrunner-error-catcher.js.map b/lib/toolrunner-error-catcher.js.map index e3bf54dec..1ccaea597 100644 --- a/lib/toolrunner-error-catcher.js.map +++ b/lib/toolrunner-error-catcher.js.map @@ -1 +1 @@ -{"version":3,"file":"toolrunner-error-catcher.js","sourceRoot":"","sources":["../src/toolrunner-error-catcher.ts"],"names":[],"mappings":";;;;;;;;;AACA,0EAA4D;AAI5D;;;;;;;;;;GAUG;AACI,KAAK,UAAU,sBAAsB,CAAC,WAAmB,EAAE,IAAe,EACpC,QAAyB,EACzB,OAAwB;;IAEnE,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,IAAI,SAAS,GAAG;QACd,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;;YACvB,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,IAAI,aAAA,OAAO,0CAAE,SAAS,0CAAE,MAAM,MAAK,SAAS,EAAE;gBAC5C,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aAChC;iBAAM;gBACL,2FAA2F;gBAC3F,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;aAC5B;QAEH,CAAC;QACD,MAAM,EAAE,CAAC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,MAAM,WAAW,CAAC;KACnB;AACH,CAAC;AAlED,wDAkEC"} \ No newline at end of file +{"version":3,"file":"toolrunner-error-catcher.js","sourceRoot":"","sources":["../src/toolrunner-error-catcher.ts"],"names":[],"mappings":";;;;;;;;;AACA,0EAA4D;AAI5D;;;;;;;;;;GAUG;AACI,KAAK,UAAU,sBAAsB,CAAC,WAAmB,EAAE,IAAe,EACpC,QAAyB,EACzB,OAAwB;;IAEnE,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,IAAI,SAAS,GAAG;QACd,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;;YACvB,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,IAAI,aAAA,OAAO,0CAAE,SAAS,0CAAE,MAAM,MAAK,SAAS,EAAE;gBAC5C,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aAChC;iBAAM;gBACL,4FAA4F;gBAC5F,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;aAC5B;QAEH,CAAC;QACD,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;;YACvB,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,IAAI,aAAA,OAAO,0CAAE,SAAS,0CAAE,MAAM,MAAK,SAAS,EAAE;gBAC5C,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aAChC;iBAAM;gBACL,4FAA4F;gBAC5F,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;aAC5B;QACH,CAAC;KACF,CAAC;IAEF,0GAA0G;IAC1G,IAAI,WAAyB,CAAC;IAC9B,IAAI;QACF,WAAW,GAAG,MAAM,IAAI,WAAW,CAAC,UAAU,CAC5C,WAAW,EACX,IAAI,EACJ;YACE,GAAG,OAAO;YACV,SAAS,EAAE,SAAS;YACpB,gBAAgB,EAAE,IAAI;SACvB,CACA,CAAC,IAAI,EAAE,CAAC;KACZ;IAAC,OAAO,CAAC,EAAE;QACV,WAAW,GAAG,CAAC,CAAC;KACjB;IAED,mEAAmE;IACnE,IAAI,WAAW,KAAK,CAAC;QAAE,OAAO,WAAW,CAAC;IAE1C,IAAI,QAAQ,EAAE;QACZ,KAAK,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,QAAQ,EAAE;YACnD,IAAI,UAAU,KAAK,WAAW,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAG;gBACtF,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;aAC1B;SACF;KACF;IAED,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;QACnC,qFAAqF;QACrF,UAAI,OAAO,0CAAE,gBAAgB,EAAE;YAC7B,OAAO,WAAW,CAAC;SACpB;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,iBAAiB,WAAW,4BAA4B,WAAW,EAAE,CAAC,CAAC;SACxF;KACF;SAAM;QACL,MAAM,WAAW,CAAC;KACnB;AACH,CAAC;AAlED,wDAkEC"} \ No newline at end of file diff --git a/lib/toolrunner-error-catcher.test.js b/lib/toolrunner-error-catcher.test.js index e2c514a8b..12446ae52 100644 --- a/lib/toolrunner-error-catcher.test.js +++ b/lib/toolrunner-error-catcher.test.js @@ -11,7 +11,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const exec = __importStar(require("@actions/exec")); -const toolrunnner = __importStar(require("@actions/exec/lib/toolrunner")); const ava_1 = __importDefault(require("ava")); const testing_utils_1 = require("./testing-utils"); const toolrunner_error_catcher_1 = require("./toolrunner-error-catcher"); @@ -82,15 +81,15 @@ ava_1.default('execErrorCatcher preserves behavior of provided listeners', async function buildDummyArgs(stdoutContents, stderrContents, desiredErrorMessage, desiredExitCode) { let command = ''; if (stdoutContents) - command += 'console.log(\\"' + stdoutContents + '\\");'; + command += 'console.log("' + stdoutContents + '");'; if (stderrContents) - command += 'console.error(\\"' + stderrContents + '\\");'; + command += 'console.error("' + stderrContents + '");'; if (command.length === 0) throw new Error("Must provide contents for either stdout or stderr"); if (desiredErrorMessage) - command += 'throw new Error(\\"' + desiredErrorMessage + '\\");'; + command += 'throw new Error("' + desiredErrorMessage + '");'; if (desiredExitCode) command += 'process.exitCode = ' + desiredExitCode + ';'; - return toolrunnner.argStringToArray('-e "' + command + '"'); + return ["-e", command]; } //# sourceMappingURL=toolrunner-error-catcher.test.js.map \ No newline at end of file diff --git a/lib/toolrunner-error-catcher.test.js.map b/lib/toolrunner-error-catcher.test.js.map index 0960eac20..27ae17803 100644 --- a/lib/toolrunner-error-catcher.test.js.map +++ b/lib/toolrunner-error-catcher.test.js.map @@ -1 +1 @@ -{"version":3,"file":"toolrunner-error-catcher.test.js","sourceRoot":"","sources":["../src/toolrunner-error-catcher.test.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsC;AACtC,0EAA4D;AAC5D,8CAAuB;AAGvB,mDAA2C;AAC3C,yEAAoE;AAEpE,0BAAU,CAAC,aAAI,CAAC,CAAC;AAEjB,aAAI,CAAC,8CAA8C,EAAE,KAAK,EAAC,CAAC,EAAC,EAAE;IAE7D,MAAM,QAAQ,GAAG,cAAc,CAAC,qBAAqB,EAAE,qBAAqB,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAErF,MAAM,QAAQ,GAAmB,CAAC,CAAC,GAAG,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC;IAE5E,CAAC,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IAElD,CAAC,CAAC,SAAS,CAAC,MAAM,iDAAsB,CAAC,MAAM,EAAE,QAAQ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K,CAAC;IACxE,IAAI,cAAc;QAAE,OAAO,IAAI,iBAAiB,GAAG,cAAc,GAAG,KAAK,CAAC;IAE1E,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IAE/F,IAAI,mBAAmB;QAAE,OAAO,IAAI,mBAAmB,GAAG,mBAAmB,GAAG,KAAK,CAAC;IACtF,IAAI,eAAe;QAAE,OAAO,IAAI,qBAAqB,GAAG,eAAe,GAAG,GAAG,CAAC;IAE9E,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACzB,CAAC"} \ No newline at end of file diff --git a/src/error-matcher.test.ts b/src/error-matcher.test.ts index 4dc99bccf..fadfb2381 100644 --- a/src/error-matcher.test.ts +++ b/src/error-matcher.test.ts @@ -18,16 +18,12 @@ test('noSourceCodeFound matches against example javascript output', async t => { function testErrorMatcher(matcherName: string, logSample: string): boolean { - const regex = namedMatchersForTesting[matcherName] ? namedMatchersForTesting[matcherName][1] : null; - - if (regex) { - return regex.test(logSample); - } else { - if (namedMatchersForTesting[matcherName]) { - throw new Error(`Cannot test matcher ${matcherName} with null regex`); - } else { - throw new Error(`Unknown matcher ${matcherName}`); - } + if (!(matcherName in namedMatchersForTesting)) { + throw new Error(`Unknown matcher ${matcherName}`); } - + const regex = namedMatchersForTesting[matcherName][1]; + if (regex === null) { + throw new Error(`Cannot test matcher ${matcherName} with null regex`); + } + return regex.test(logSample); } diff --git a/src/error-matcher.ts b/src/error-matcher.ts index 68f0bbb1d..ba4a684ee 100644 --- a/src/error-matcher.ts +++ b/src/error-matcher.ts @@ -5,13 +5,12 @@ export type ErrorMatcher = [number|null, RegExp|null, string]; export const namedMatchersForTesting: { [key: string]: ErrorMatcher } = { /* In due course it may be possible to remove the regex, if/when javascript also exits with code 32. - For context see https://github.com/github/semmle-code/pull/36921 */ noSourceCodeFound: [ 32, new RegExp("No JavaScript or TypeScript code found\\."), - `No source code was seen during the build. Please see... -https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/troubleshooting-code-scanning#no-code-found-during-the-build` + "No code found during the build. Please see:\n" + + "https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/troubleshooting-code-scanning#no-code-found-during-the-build" ], }; diff --git a/src/toolrunner-error-catcher.test.ts b/src/toolrunner-error-catcher.test.ts index 8538b3ea9..389882dc4 100644 --- a/src/toolrunner-error-catcher.test.ts +++ b/src/toolrunner-error-catcher.test.ts @@ -1,5 +1,4 @@ import * as exec from '@actions/exec'; -import * as toolrunnner from '@actions/exec/lib/toolrunner'; import test from 'ava'; import { ErrorMatcher } from './error-matcher'; @@ -139,13 +138,13 @@ function buildDummyArgs(stdoutContents: string, stderrContents: string, let command = ''; - if (stdoutContents) command += 'console.log(\\"' + stdoutContents + '\\");'; - if (stderrContents) command += 'console.error(\\"' + stderrContents + '\\");'; + if (stdoutContents) command += 'console.log("' + stdoutContents + '");'; + if (stderrContents) command += 'console.error("' + stderrContents + '");'; if (command.length === 0) throw new Error("Must provide contents for either stdout or stderr"); - if (desiredErrorMessage) command += 'throw new Error(\\"' + desiredErrorMessage + '\\");'; + if (desiredErrorMessage) command += 'throw new Error("' + desiredErrorMessage + '");'; if (desiredExitCode) command += 'process.exitCode = ' + desiredExitCode + ';'; - return toolrunnner.argStringToArray('-e "' + command + '"'); + return ["-e", command]; } diff --git a/src/toolrunner-error-catcher.ts b/src/toolrunner-error-catcher.ts index 276fc408d..e423e427e 100644 --- a/src/toolrunner-error-catcher.ts +++ b/src/toolrunner-error-catcher.ts @@ -4,13 +4,13 @@ import * as toolrunnner from '@actions/exec/lib/toolrunner'; import {ErrorMatcher} from './error-matcher'; /** - * Wrapper for exec.exec which checks for specific return code and/or regex matches in console output. + * Wrapper for toolrunner.Toolrunner which checks for specific return code and/or regex matches in console output. * Output will be streamed to the live console as well as captured for subsequent processing. * Returns promise with return code * - * @param commandLine command to execute (can include additional args). Must be correctly escaped. - * @param matchers defines specific codes and/or regexes that should lead to return of a custom error + * @param commandLine command to execute * @param args optional arguments for tool. Escaping is handled by the lib. + * @param matchers defines specific codes and/or regexes that should lead to return of a custom error * @param options optional exec options. See ExecOptions * @returns Promise exit code */ @@ -27,7 +27,7 @@ export async function toolrunnerErrorCatcher(commandLine: string, args?: string[ if (options?.listeners?.stdout !== undefined) { options.listeners.stdout(data); } else { - // if no stdout listener was originally defined then we match default behavior of exec.exec + // if no stdout listener was originally defined then we match default behavior of Toolrunner process.stdout.write(data); } @@ -37,7 +37,7 @@ export async function toolrunnerErrorCatcher(commandLine: string, args?: string[ if (options?.listeners?.stderr !== undefined) { options.listeners.stderr(data); } else { - // if no stderr listener was originally defined then we match default behavior of exec.exec + // if no stderr listener was originally defined then we match default behavior of Toolrunner process.stderr.write(data); } } @@ -50,7 +50,7 @@ export async function toolrunnerErrorCatcher(commandLine: string, args?: string[ commandLine, args, { - ...options, // pass original options first in order to override below + ...options, // we want to override the original options, so include them first listeners: listeners, ignoreReturnCode: true, // so we can check for specific codes using the matchers } From b3b99014eb254ee8a0a84d95e5a57b48639e7881 Mon Sep 17 00:00:00 2001 From: Nick Fyson Date: Fri, 11 Sep 2020 18:30:07 +0100 Subject: [PATCH 19/35] make ErrorMatcher an object rather than a tuple --- lib/error-matcher.js | 10 +++++----- lib/error-matcher.js.map | 2 +- lib/error-matcher.test.js | 4 ++-- lib/error-matcher.test.js.map | 2 +- lib/toolrunner-error-catcher.js | 10 +++++----- lib/toolrunner-error-catcher.js.map | 2 +- lib/toolrunner-error-catcher.test.js | 20 ++++++++++---------- lib/toolrunner-error-catcher.test.js.map | 2 +- src/error-matcher.test.ts | 4 ++-- src/error-matcher.ts | 20 +++++++++++++------- src/toolrunner-error-catcher.test.ts | 20 ++++++++++---------- src/toolrunner-error-catcher.ts | 10 +++++++--- 12 files changed, 58 insertions(+), 48 deletions(-) diff --git a/lib/error-matcher.js b/lib/error-matcher.js index 3881dac19..4bc56bdcf 100644 --- a/lib/error-matcher.js +++ b/lib/error-matcher.js @@ -5,12 +5,12 @@ exports.namedMatchersForTesting = { /* In due course it may be possible to remove the regex, if/when javascript also exits with code 32. */ - noSourceCodeFound: [ - 32, - new RegExp("No JavaScript or TypeScript code found\\."), - "No code found during the build. Please see:\n" + + noSourceCodeFound: { + exitCode: 32, + outputRegex: new RegExp("No JavaScript or TypeScript code found\\."), + message: "No code found during the build. Please see:\n" + "https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/troubleshooting-code-scanning#no-code-found-during-the-build" - ], + }, }; // we collapse the matches into an array for use in execErrorCatcher exports.errorMatchers = Object.values(exports.namedMatchersForTesting); diff --git a/lib/error-matcher.js.map b/lib/error-matcher.js.map index dd41806ff..bfd9adcac 100644 --- a/lib/error-matcher.js.map +++ b/lib/error-matcher.js.map @@ -1 +1 @@ -{"version":3,"file":"error-matcher.js","sourceRoot":"","sources":["../src/error-matcher.ts"],"names":[],"mappings":";;AAGA,qCAAqC;AACxB,QAAA,uBAAuB,GAAoC;IACtE;;MAEE;IACF,iBAAiB,EAAE;QACjB,EAAE;QACF,IAAI,MAAM,CAAC,2CAA2C,CAAC;QACvD,+CAA+C;YAC/C,yJAAyJ;KAC1J;CACF,CAAC;AAEF,oEAAoE;AACvD,QAAA,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,+BAAuB,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"error-matcher.js","sourceRoot":"","sources":["../src/error-matcher.ts"],"names":[],"mappings":";;AASA,qCAAqC;AACxB,QAAA,uBAAuB,GAAoC;IACtE;;MAEE;IACF,iBAAiB,EAAE;QACjB,QAAQ,EAAE,EAAE;QACZ,WAAW,EAAE,IAAI,MAAM,CAAC,2CAA2C,CAAC;QACpE,OAAO,EAAE,+CAA+C;YAC/C,yJAAyJ;KACnK;CACF,CAAC;AAEF,oEAAoE;AACvD,QAAA,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,+BAAuB,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/error-matcher.test.js b/lib/error-matcher.test.js index c79bf5719..1d8601120 100644 --- a/lib/error-matcher.test.js +++ b/lib/error-matcher.test.js @@ -20,8 +20,8 @@ function testErrorMatcher(matcherName, logSample) { if (!(matcherName in error_matcher_1.namedMatchersForTesting)) { throw new Error(`Unknown matcher ${matcherName}`); } - const regex = error_matcher_1.namedMatchersForTesting[matcherName][1]; - if (regex === null) { + const regex = error_matcher_1.namedMatchersForTesting[matcherName].outputRegex; + if (regex === undefined) { throw new Error(`Cannot test matcher ${matcherName} with null regex`); } return regex.test(logSample); diff --git a/lib/error-matcher.test.js.map b/lib/error-matcher.test.js.map index 321a28a65..660294611 100644 --- a/lib/error-matcher.test.js.map +++ b/lib/error-matcher.test.js.map @@ -1 +1 @@ -{"version":3,"file":"error-matcher.test.js","sourceRoot":"","sources":["../src/error-matcher.test.ts"],"names":[],"mappings":";;;;;AACA,8CAAuB;AAEvB,mDAA0D;AAE1D;;EAEE;AAEF,aAAI,CAAC,6DAA6D,EAAE,KAAK,EAAC,CAAC,EAAC,EAAE;IAC5E,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,mBAAmB,EAAE;;;;;GAK9C,CAAC,CAAC,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,SAAS,gBAAgB,CAAC,WAAmB,EAAE,SAAiB;IAE9D,IAAI,CAAC,CAAC,WAAW,IAAI,uCAAuB,CAAC,EAAE;QAC7C,MAAM,IAAI,KAAK,CAAC,mBAAmB,WAAW,EAAE,CAAC,CAAC;KACnD;IACD,MAAM,KAAK,GAAG,uCAAuB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACtD,IAAI,KAAK,KAAK,IAAI,EAAE;QAClB,MAAM,IAAI,KAAK,CAAC,uBAAuB,WAAW,kBAAkB,CAAC,CAAC;KACvE;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAC/B,CAAC"} \ No newline at end of file +{"version":3,"file":"error-matcher.test.js","sourceRoot":"","sources":["../src/error-matcher.test.ts"],"names":[],"mappings":";;;;;AACA,8CAAuB;AAEvB,mDAA0D;AAE1D;;EAEE;AAEF,aAAI,CAAC,6DAA6D,EAAE,KAAK,EAAC,CAAC,EAAC,EAAE;IAC5E,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,mBAAmB,EAAE;;;;;GAK9C,CAAC,CAAC,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,SAAS,gBAAgB,CAAC,WAAmB,EAAE,SAAiB;IAE9D,IAAI,CAAC,CAAC,WAAW,IAAI,uCAAuB,CAAC,EAAE;QAC7C,MAAM,IAAI,KAAK,CAAC,mBAAmB,WAAW,EAAE,CAAC,CAAC;KACnD;IACD,MAAM,KAAK,GAAG,uCAAuB,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC;IAC/D,IAAI,KAAK,KAAK,SAAS,EAAE;QACvB,MAAM,IAAI,KAAK,CAAC,uBAAuB,WAAW,kBAAkB,CAAC,CAAC;KACvE;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAC/B,CAAC"} \ No newline at end of file diff --git a/lib/toolrunner-error-catcher.js b/lib/toolrunner-error-catcher.js index ec1ebdad8..ead5ec0b5 100644 --- a/lib/toolrunner-error-catcher.js +++ b/lib/toolrunner-error-catcher.js @@ -20,7 +20,7 @@ const toolrunnner = __importStar(require("@actions/exec/lib/toolrunner")); * @returns Promise exit code */ async function toolrunnerErrorCatcher(commandLine, args, matchers, options) { - var _a; + var _a, _b, _c; let stdout = ''; let stderr = ''; let listeners = { @@ -63,15 +63,15 @@ async function toolrunnerErrorCatcher(commandLine, args, matchers, options) { if (returnState === 0) return returnState; if (matchers) { - for (const [customCode, regex, message] of matchers) { - if (customCode === returnState || regex && (regex.test(stderr) || regex.test(stdout))) { - throw new Error(message); + for (const matcher of matchers) { + if (matcher.exitCode === returnState || ((_a = matcher.outputRegex) === null || _a === void 0 ? void 0 : _a.test(stderr)) || ((_b = matcher.outputRegex) === null || _b === void 0 ? void 0 : _b.test(stdout))) { + throw new Error(matcher.message); } } } if (typeof returnState === 'number') { // only if we were instructed to ignore the return code do we ever return it non-zero - if ((_a = options) === null || _a === void 0 ? void 0 : _a.ignoreReturnCode) { + if ((_c = options) === null || _c === void 0 ? void 0 : _c.ignoreReturnCode) { return returnState; } else { diff --git a/lib/toolrunner-error-catcher.js.map b/lib/toolrunner-error-catcher.js.map index 1ccaea597..ee483b129 100644 --- a/lib/toolrunner-error-catcher.js.map +++ b/lib/toolrunner-error-catcher.js.map @@ -1 +1 @@ -{"version":3,"file":"toolrunner-error-catcher.js","sourceRoot":"","sources":["../src/toolrunner-error-catcher.ts"],"names":[],"mappings":";;;;;;;;;AACA,0EAA4D;AAI5D;;;;;;;;;;GAUG;AACI,KAAK,UAAU,sBAAsB,CAAC,WAAmB,EAAE,IAAe,EACpC,QAAyB,EACzB,OAAwB;;IAEnE,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,IAAI,SAAS,GAAG;QACd,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;;YACvB,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,IAAI,aAAA,OAAO,0CAAE,SAAS,0CAAE,MAAM,MAAK,SAAS,EAAE;gBAC5C,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aAChC;iBAAM;gBACL,4FAA4F;gBAC5F,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;aAC5B;QAEH,CAAC;QACD,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;;YACvB,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,IAAI,aAAA,OAAO,0CAAE,SAAS,0CAAE,MAAM,MAAK,SAAS,EAAE;gBAC5C,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aAChC;iBAAM;gBACL,4FAA4F;gBAC5F,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;aAC5B;QACH,CAAC;KACF,CAAC;IAEF,0GAA0G;IAC1G,IAAI,WAAyB,CAAC;IAC9B,IAAI;QACF,WAAW,GAAG,MAAM,IAAI,WAAW,CAAC,UAAU,CAC5C,WAAW,EACX,IAAI,EACJ;YACE,GAAG,OAAO;YACV,SAAS,EAAE,SAAS;YACpB,gBAAgB,EAAE,IAAI;SACvB,CACA,CAAC,IAAI,EAAE,CAAC;KACZ;IAAC,OAAO,CAAC,EAAE;QACV,WAAW,GAAG,CAAC,CAAC;KACjB;IAED,mEAAmE;IACnE,IAAI,WAAW,KAAK,CAAC;QAAE,OAAO,WAAW,CAAC;IAE1C,IAAI,QAAQ,EAAE;QACZ,KAAK,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,QAAQ,EAAE;YACnD,IAAI,UAAU,KAAK,WAAW,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAG;gBACtF,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;aAC1B;SACF;KACF;IAED,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;QACnC,qFAAqF;QACrF,UAAI,OAAO,0CAAE,gBAAgB,EAAE;YAC7B,OAAO,WAAW,CAAC;SACpB;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,iBAAiB,WAAW,4BAA4B,WAAW,EAAE,CAAC,CAAC;SACxF;KACF;SAAM;QACL,MAAM,WAAW,CAAC;KACnB;AACH,CAAC;AAlED,wDAkEC"} \ No newline at end of file +{"version":3,"file":"toolrunner-error-catcher.js","sourceRoot":"","sources":["../src/toolrunner-error-catcher.ts"],"names":[],"mappings":";;;;;;;;;AACA,0EAA4D;AAI5D;;;;;;;;;;GAUG;AACI,KAAK,UAAU,sBAAsB,CAAC,WA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O,IAAI,QAAQ,EAAE;YAC9B,IACE,OAAO,CAAC,QAAQ,KAAK,WAAW,WAChC,OAAO,CAAC,WAAW,0CAAE,IAAI,CAAC,MAAM,EAAC,WACjC,OAAO,CAAC,WAAW,0CAAE,IAAI,CAAC,MAAM,EAAC,EAC/B;gBACF,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;aAClC;SACF;KACF;IAED,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;QACnC,qFAAqF;QACrF,UAAI,OAAO,0CAAE,gBAAgB,EAAE;YAC7B,OAAO,WAAW,CAAC;SACpB;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,iBAAiB,WAAW,4BAA4B,WAAW,EAAE,CAAC,CAAC;SACxF;KACF;SAAM;QACL,MAAM,WAAW,CAAC;KACnB;AACH,CAAC;AAtED,wDAsEC"} \ No newline at end of file diff --git a/lib/toolrunner-error-catcher.test.js b/lib/toolrunner-error-catcher.test.js index 12446ae52..a088397bf 100644 --- a/lib/toolrunner-error-catcher.test.js +++ b/lib/toolrunner-error-catcher.test.js @@ -17,41 +17,41 @@ const toolrunner_error_catcher_1 = require("./toolrunner-error-catcher"); testing_utils_1.setupTests(ava_1.default); ava_1.default('matchers are never applied if non-error exit', async (t) => { const testArgs = buildDummyArgs("foo bar\\nblort qux", "foo bar\\nblort qux", '', 0); - const matchers = [[123, new RegExp("foo bar"), 'error!!!']]; + const matchers = [{ exitCode: 123, outputRegex: new RegExp("foo bar"), message: 'error!!!' }]; t.deepEqual(await exec.exec('node', testArgs), 0); t.deepEqual(await toolrunner_error_catcher_1.toolrunnerErrorCatcher('node', testArgs, matchers), 0); }); ava_1.default('regex matchers are applied to stdout for non-zero exit code', async (t) => { const testArgs = buildDummyArgs("foo bar\\nblort qux", '', '', 1); - const matchers = [[123, new RegExp("foo bar"), '🦄']]; + const matchers = [{ exitCode: 123, outputRegex: new RegExp("foo bar"), message: '🦄' }]; await t.throwsAsync(exec.exec('node', testArgs), { instanceOf: Error, message: 'The process \'node\' failed with exit code 1' }); await t.throwsAsync(toolrunner_error_catcher_1.toolrunnerErrorCatcher('node', testArgs, matchers), { instanceOf: Error, message: '🦄' }); }); ava_1.default('regex matchers are applied to stderr for non-zero exit code', async (t) => { const testArgs = buildDummyArgs("non matching string", 'foo bar\\nblort qux', '', 1); - const matchers = [[123, new RegExp("foo bar"), '🦄']]; + const matchers = [{ exitCode: 123, outputRegex: new RegExp("foo bar"), message: '🦄' }]; await t.throwsAsync(exec.exec('node', testArgs), { instanceOf: Error, message: 'The process \'node\' failed with exit code 1' }); await t.throwsAsync(toolrunner_error_catcher_1.toolrunnerErrorCatcher('node', testArgs, matchers), { instanceOf: Error, message: '🦄' }); }); ava_1.default('matcher returns correct error message when multiple matchers defined', async (t) => { const testArgs = buildDummyArgs("non matching string", 'foo bar\\nblort qux', '', 1); - const matchers = [[456, new RegExp("lorem ipsum"), '😩'], - [123, new RegExp("foo bar"), '🦄'], - [789, new RegExp("blah blah"), '🤦‍♂️']]; + const matchers = [{ exitCode: 456, outputRegex: new RegExp("lorem ipsum"), message: '😩' }, + { exitCode: 123, outputRegex: new RegExp("foo bar"), message: '🦄' }, + { exitCode: 789, outputRegex: new RegExp("blah blah"), message: '🤦‍♂️' }]; await t.throwsAsync(exec.exec('node', testArgs), { instanceOf: Error, message: 'The process \'node\' failed with exit code 1' }); await t.throwsAsync(toolrunner_error_catcher_1.toolrunnerErrorCatcher('node', testArgs, matchers), { instanceOf: Error, message: '🦄' }); }); ava_1.default('matcher returns first match to regex when multiple matches', async (t) => { const testArgs = buildDummyArgs("non matching string", 'foo bar\\nblort qux', '', 1); - const matchers = [[123, new RegExp("foo bar"), '🦄'], - [789, new RegExp("blah blah"), '🤦‍♂️'], - [987, new RegExp("foo bar"), '🚫']]; + const matchers = [{ exitCode: 123, outputRegex: new RegExp("foo bar"), message: '🦄' }, + { exitCode: 789, outputRegex: new RegExp("blah blah"), message: '🤦‍♂️' }, + { exitCode: 987, outputRegex: new RegExp("foo bar"), message: '🚫' }]; await t.throwsAsync(exec.exec('node', testArgs), { instanceOf: Error, message: 'The process \'node\' failed with exit code 1' }); await t.throwsAsync(toolrunner_error_catcher_1.toolrunnerErrorCatcher('node', testArgs, matchers), { instanceOf: Error, message: '🦄' }); }); ava_1.default('exit code matchers are applied', async (t) => { const testArgs = buildDummyArgs("non matching string", 'foo bar\\nblort qux', '', 123); - const matchers = [[123, new RegExp("this will not match"), '🦄']]; + const matchers = [{ exitCode: 123, outputRegex: new RegExp("this will not match"), message: '🦄' }]; await t.throwsAsync(exec.exec('node', testArgs), { instanceOf: Error, message: 'The process \'node\' failed with exit code 123' }); await t.throwsAsync(toolrunner_error_catcher_1.toolrunnerErrorCatcher('node', testArgs, matchers), { instanceOf: Error, message: '🦄' }); }); diff --git a/lib/toolrunner-error-catcher.test.js.map b/lib/toolrunner-error-catcher.test.js.map index 27ae17803..c47222015 100644 --- a/lib/toolrunner-error-catcher.test.js.map +++ b/lib/toolrunner-error-catcher.test.js.map @@ -1 +1 @@ -{"version":3,"file":"toolrunner-error-catcher.test.js","sourceRoot":"","sources":["../src/toolrunner-error-catcher.test.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsC;AACtC,8CAAuB;AAGvB,mDAA2C;AAC3C,yEAAoE;AAEpE,0BAAU,CAAC,aAAI,CAAC,CAAC;AAEjB,aAAI,CAAC,8CAA8C,EAAE,KAAK,EAAC,CAAC,EAAC,EAAE;IAE7D,MAAM,QAAQ,GAAG,cAAc,CAAC,qBAAqB,EAAE,qBAAqB,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAErF,MAAM,QAAQ,GAAmB,CAAC,CAAC,GAAG,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC;IAE5E,CAAC,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IAElD,C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,EAAE,SAAS,EAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAE3F,CAAC,CAAC,SAAS,CAAC,YAAY,EAAE,cAAc,GAAG,IAAI,CAAC,CAAC;IACjD,CAAC,CAAC,SAAS,CAAC,YAAY,EAAE,cAAc,GAAG,IAAI,CAAC,CAAC;AAEnD,CAAC,CAAC,CAAC;AAEH,SAAS,cAAc,CAAC,cAAsB,EAAE,cAAsB,EAC9C,mBAA4B,EAAE,eAAwB;IAE5E,IAAI,OAAO,GAAG,EAAE,CAAC;IAEjB,IAAI,cAAc;QAAE,OAAO,IAAI,eAAe,GAAG,cAAc,GAAG,KAAK,CAAC;IACxE,IAAI,cAAc;QAAE,OAAO,IAAI,iBAAiB,GAAG,cAAc,GAAG,KAAK,CAAC;IAE1E,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IAE/F,IAAI,mBAAmB;QAAE,OAAO,IAAI,mBAAmB,GAAG,mBAAmB,GAAG,KAAK,CAAC;IACtF,IAAI,eAAe;QAAE,OAAO,IAAI,qBAAqB,GAAG,eAAe,GAAG,GAAG,CAAC;IAE9E,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACzB,CAAC"} \ No newline at end of file diff --git a/src/error-matcher.test.ts b/src/error-matcher.test.ts index fadfb2381..2f62211d8 100644 --- a/src/error-matcher.test.ts +++ b/src/error-matcher.test.ts @@ -21,8 +21,8 @@ function testErrorMatcher(matcherName: string, logSample: string): boolean { if (!(matcherName in namedMatchersForTesting)) { throw new Error(`Unknown matcher ${matcherName}`); } - const regex = namedMatchersForTesting[matcherName][1]; - if (regex === null) { + const regex = namedMatchersForTesting[matcherName].outputRegex; + if (regex === undefined) { throw new Error(`Cannot test matcher ${matcherName} with null regex`); } return regex.test(logSample); diff --git a/src/error-matcher.ts b/src/error-matcher.ts index ba4a684ee..d4e5c15d4 100644 --- a/src/error-matcher.ts +++ b/src/error-matcher.ts @@ -1,17 +1,23 @@ -export type ErrorMatcher = [number|null, RegExp|null, string]; +// defines properties to match against the result of executed commands, +// and a custom error to return when a match is found +export interface ErrorMatcher { + exitCode?: number; // exit code of the run process + outputRegex?: RegExp; // pattern to match against either stdout or stderr + message: string; // the error message that will be thrown for a matching process +} // exported only for testing purposes export const namedMatchersForTesting: { [key: string]: ErrorMatcher } = { /* In due course it may be possible to remove the regex, if/when javascript also exits with code 32. */ - noSourceCodeFound: [ - 32, - new RegExp("No JavaScript or TypeScript code found\\."), - "No code found during the build. Please see:\n" + - "https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/troubleshooting-code-scanning#no-code-found-during-the-build" - ], + noSourceCodeFound: { + exitCode: 32, + outputRegex: new RegExp("No JavaScript or TypeScript code found\\."), + message: "No code found during the build. Please see:\n" + + "https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/troubleshooting-code-scanning#no-code-found-during-the-build" + }, }; // we collapse the matches into an array for use in execErrorCatcher diff --git a/src/toolrunner-error-catcher.test.ts b/src/toolrunner-error-catcher.test.ts index 389882dc4..26f32a4fd 100644 --- a/src/toolrunner-error-catcher.test.ts +++ b/src/toolrunner-error-catcher.test.ts @@ -11,7 +11,7 @@ test('matchers are never applied if non-error exit', async t => { const testArgs = buildDummyArgs("foo bar\\nblort qux", "foo bar\\nblort qux", '', 0); - const matchers: ErrorMatcher[] = [[123, new RegExp("foo bar"), 'error!!!']]; + const matchers: ErrorMatcher[] = [{exitCode: 123, outputRegex: new RegExp("foo bar"), message: 'error!!!' }]; t.deepEqual(await exec.exec('node', testArgs), 0); @@ -23,7 +23,7 @@ test('regex matchers are applied to stdout for non-zero exit code', async t => { const testArgs = buildDummyArgs("foo bar\\nblort qux", '', '', 1); - const matchers: ErrorMatcher[] = [[123, new RegExp("foo bar"), '🦄']]; + const matchers: ErrorMatcher[] = [{exitCode: 123, outputRegex: new RegExp("foo bar"), message: '🦄' }]; await t.throwsAsync(exec.exec('node', testArgs), {instanceOf: Error, message: 'The process \'node\' failed with exit code 1'}); @@ -38,7 +38,7 @@ test('regex matchers are applied to stderr for non-zero exit code', async t => { const testArgs = buildDummyArgs("non matching string", 'foo bar\\nblort qux', '', 1); - const matchers: ErrorMatcher[] = [[123, new RegExp("foo bar"), '🦄']]; + const matchers: ErrorMatcher[] = [{exitCode: 123, outputRegex: new RegExp("foo bar"), message: '🦄' }]; await t.throwsAsync(exec.exec('node', testArgs), {instanceOf: Error, message: 'The process \'node\' failed with exit code 1'}); @@ -53,9 +53,9 @@ test('matcher returns correct error message when multiple matchers defined', asy const testArgs = buildDummyArgs("non matching string", 'foo bar\\nblort qux', '', 1); - const matchers: ErrorMatcher[] = [[456, new RegExp("lorem ipsum"), '😩'], - [123, new RegExp("foo bar"), '🦄'], - [789, new RegExp("blah blah"), '🤦‍♂️']]; + const matchers: ErrorMatcher[] = [{exitCode: 456, outputRegex: new RegExp("lorem ipsum"), message: '😩'}, + {exitCode: 123, outputRegex: new RegExp("foo bar"), message: '🦄'}, + {exitCode: 789, outputRegex: new RegExp("blah blah"), message: '🤦‍♂️'}]; await t.throwsAsync(exec.exec('node', testArgs), {instanceOf: Error, message: 'The process \'node\' failed with exit code 1'}); @@ -70,9 +70,9 @@ test('matcher returns first match to regex when multiple matches', async t => { const testArgs = buildDummyArgs("non matching string", 'foo bar\\nblort qux', '', 1); - const matchers: ErrorMatcher[] = [[123, new RegExp("foo bar"), '🦄'], - [789, new RegExp("blah blah"), '🤦‍♂️'], - [987, new RegExp("foo bar"), '🚫']]; + const matchers: ErrorMatcher[] = [{exitCode: 123, outputRegex: new RegExp("foo bar"), message: '🦄'}, + {exitCode: 789, outputRegex: new RegExp("blah blah"), message: '🤦‍♂️'}, + {exitCode: 987, outputRegex: new RegExp("foo bar"), message: '🚫'}]; await t.throwsAsync(exec.exec('node', testArgs), {instanceOf: Error, message: 'The process \'node\' failed with exit code 1'}); @@ -87,7 +87,7 @@ test('exit code matchers are applied', async t => { const testArgs = buildDummyArgs("non matching string", 'foo bar\\nblort qux', '', 123); - const matchers: ErrorMatcher[] = [[123, new RegExp("this will not match"), '🦄']]; + const matchers: ErrorMatcher[] = [{exitCode: 123, outputRegex: new RegExp("this will not match"), message: '🦄' }]; await t.throwsAsync(exec.exec('node', testArgs), {instanceOf: Error, message: 'The process \'node\' failed with exit code 123'}); diff --git a/src/toolrunner-error-catcher.ts b/src/toolrunner-error-catcher.ts index e423e427e..140186684 100644 --- a/src/toolrunner-error-catcher.ts +++ b/src/toolrunner-error-catcher.ts @@ -63,9 +63,13 @@ export async function toolrunnerErrorCatcher(commandLine: string, args?: string[ if (returnState === 0) return returnState; if (matchers) { - for (const [customCode, regex, message] of matchers) { - if (customCode === returnState || regex && (regex.test(stderr) || regex.test(stdout)) ) { - throw new Error(message); + for (const matcher of matchers) { + if ( + matcher.exitCode === returnState || + matcher.outputRegex?.test(stderr) || + matcher.outputRegex?.test(stdout) + ) { + throw new Error(matcher.message); } } } From 06765f934041767c84047a3ffbd0327a62d5bd4d Mon Sep 17 00:00:00 2001 From: Chris Raynor Date: Mon, 14 Sep 2020 10:32:24 +0100 Subject: [PATCH 20/35] Adding ESLint config and required dev dependencies --- .eslintignore | 5 + .eslintrc.json | 32 ++ package-lock.json | 1388 +++++++++++++++++++++++++++++++++++++++++++++ package.json | 8 +- 4 files changed, 1432 insertions(+), 1 deletion(-) create mode 100644 .eslintignore create mode 100644 .eslintrc.json diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000000000..18b086df1 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,5 @@ +**/webpack.config.js +lib/** +runner/dist/** +src/testdata/** +tests/** diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000000000..61d7b8e99 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,32 @@ + +{ + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "./tsconfig.json" + }, + "plugins": ["@typescript-eslint", "filenames", "github", "import", "no-async-foreach"], + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + "plugin:github/recommended", + "plugin:github/typescript" + ], + "rules": { + "filenames/match-regex": ["error", "^[a-z0-9-]+(\\.test)?$"], + "import/extensions": "error", + "import/no-amd": "error", + "import/no-commonjs": "error", + "import/no-dynamic-require": "error", + "import/no-extraneous-dependencies": ["error", {"devDependencies": false}], + "import/no-namespace": "off", + "import/no-unresolved": "error", + "import/no-webpack-loader-syntax": "error", + "no-async-foreach/no-async-foreach": "error", + "no-console": "off", + "no-sequences": "error", + "one-var": ["error", "never"], + "sort-imports": ["error", { "allowSeparatedGroups": true }] + } + } + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index d3f6bf269..73b4a3a4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -173,6 +173,38 @@ } } }, + "@eslint/eslintrc": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.1.3.tgz", + "integrity": "sha512-4YVwPkANLeNtRjMekzux1ci8hIaH5eGKktGqR0d3LWsKNn5B2X/1Z6Trxy7jQXl9EBGE6Yj02O+t09FMeRllaA==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + } + } + }, "@nodelib/fs.scandir": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", @@ -358,6 +390,18 @@ "@types/node": "*" } }, + "@types/json-schema": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", + "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==", + "dev": true + }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true + }, "@types/jszip": { "version": "3.1.6", "resolved": "https://registry.npmjs.org/@types/jszip/-/jszip-3.1.6.tgz", @@ -414,12 +458,137 @@ "integrity": "sha512-T+m89VdXj/eidZyejvmoP9jivXgBDdkOSBVQjU9kF349NEx10QdPNGxHeZUaj1IlJ32/ewdyXJjnJxyxJroYwg==", "dev": true }, + "@typescript-eslint/eslint-plugin": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.1.0.tgz", + "integrity": "sha512-U+nRJx8XDUqJxYF0FCXbpmD9nWt/xHDDG0zsw1vrVYAmEAuD/r49iowfurjSL2uTA2JsgtpsyG7mjO7PHf2dYw==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "4.1.0", + "@typescript-eslint/scope-manager": "4.1.0", + "debug": "^4.1.1", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^3.0.0", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "dependencies": { + "tsutils": { + "version": "3.17.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz", + "integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + } + } + }, + "@typescript-eslint/experimental-utils": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.1.0.tgz", + "integrity": "sha512-paEYLA37iqRIDPeQwAmoYSiZ3PiHsaAc3igFeBTeqRHgPnHjHLJ9OGdmP6nwAkF65p2QzEsEBtpjNUBWByNWzA==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/scope-manager": "4.1.0", + "@typescript-eslint/types": "4.1.0", + "@typescript-eslint/typescript-estree": "4.1.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + } + }, + "@typescript-eslint/parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.1.0.tgz", + "integrity": "sha512-hM/WNCQTzDHgS0Ke3cR9zPndL3OTKr9OoN9CL3UqulsAjYDrglSwIIgswSmHBcSbOzLmgaMARwrQEbIumIglvQ==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "4.1.0", + "@typescript-eslint/types": "4.1.0", + "@typescript-eslint/typescript-estree": "4.1.0", + "debug": "^4.1.1" + } + }, + "@typescript-eslint/scope-manager": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.1.0.tgz", + "integrity": "sha512-HD1/u8vFNnxwiHqlWKC/Pigdn0Mvxi84Y6GzbZ5f5sbLrFKu0al02573Er+D63Sw67IffVUXR0uR8rpdfdk+vA==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.1.0", + "@typescript-eslint/visitor-keys": "4.1.0" + } + }, + "@typescript-eslint/types": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.1.0.tgz", + "integrity": "sha512-rkBqWsO7m01XckP9R2YHVN8mySOKKY2cophGM8K5uDK89ArCgahItQYdbg/3n8xMxzu2elss+an1TphlUpDuJw==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.1.0.tgz", + "integrity": "sha512-r6et57qqKAWU173nWyw31x7OfgmKfMEcjJl9vlJEzS+kf9uKNRr4AVTRXfTCwebr7bdiVEkfRY5xGnpPaNPe4Q==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.1.0", + "@typescript-eslint/visitor-keys": "4.1.0", + "debug": "^4.1.1", + "globby": "^11.0.1", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "dependencies": { + "globby": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.1.tgz", + "integrity": "sha512-iH9RmgwCmUJHi2z5o2l3eTtGBtXek1OYlHrbcxOYugyHLmAsZrPj43OtHThd62Buh/Vv6VyCBD2bdyWcGNQqoQ==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + } + }, + "tsutils": { + "version": "3.17.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz", + "integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + } + } + }, + "@typescript-eslint/visitor-keys": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.1.0.tgz", + "integrity": "sha512-+taO0IZGCtCEsuNTTF2Q/5o8+fHrlml8i9YsZt2AiDCdYEJzYlsmRY991l/6f3jNXFyAWepdQj7n8Na6URiDRQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.1.0", + "eslint-visitor-keys": "^2.0.0" + } + }, "acorn": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", "dev": true }, + "acorn-jsx": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "dev": true + }, "aggregate-error": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", @@ -430,6 +599,18 @@ "indent-string": "^4.0.0" } }, + "ajv": { + "version": "6.12.5", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz", + "integrity": "sha512-lRF8RORchjpKG50/WFf8xmg7sgCLFiYNNnqdKflk63whMQcWR5ngGjiSXkL9bjxy6B2npOK2HSMN49jEBMSkag==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, "ansi-align": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", @@ -473,6 +654,12 @@ } } }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, "ansi-regex": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", @@ -502,12 +689,33 @@ "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", "dev": true }, + "array-includes": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", + "integrity": "sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0", + "is-string": "^1.0.5" + } + }, "array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, + "array.prototype.flat": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.3.tgz", + "integrity": "sha512-gBlRZV0VSmfPIeWfuuy56XZMvbVfbEUnOXUvt3F/eUUUSyzlgLxhEX4YAEpxNAogRGehPSnfXyPtYyKAhkzQhQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + } + }, "arrgv": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/arrgv/-/arrgv-1.0.2.tgz", @@ -520,6 +728,12 @@ "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", "dev": true }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, "atob-lite": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/atob-lite/-/atob-lite-2.0.0.tgz", @@ -1081,6 +1295,12 @@ "resolved": "https://registry.npmjs.org/console-log-level/-/console-log-level-1.4.1.tgz", "integrity": "sha512-VZzbIORbP+PPcN/gg3DXClTLPLg5Slwd5fL2MIc+o1qZ4BXBvWyc6QxPk6T/Mkr6IVjRpoAGf32XxP3ZWMVRcQ==" }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, "convert-source-map": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", @@ -1174,6 +1394,12 @@ "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "dev": true }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, "defaults": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", @@ -1189,6 +1415,15 @@ "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", "dev": true }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, "del": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/del/-/del-5.1.0.tgz", @@ -1305,6 +1540,15 @@ "once": "^1.4.0" } }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, "equal-length": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/equal-length/-/equal-length-1.0.1.tgz", @@ -1320,6 +1564,36 @@ "is-arrayish": "^0.2.1" } }, + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, "escape-goat": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", @@ -1332,6 +1606,516 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, + "eslint": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.9.0.tgz", + "integrity": "sha512-V6QyhX21+uXp4T+3nrNfI3hQNBDa/P8ga7LoQOenwrlEFXrEnUEE+ok1dMtaS3b6rmLXhT1TkTIsG75HMLbknA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@eslint/eslintrc": "^0.1.3", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.0", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^1.3.0", + "espree": "^7.3.0", + "esquery": "^1.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "eslint-config-prettier": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz", + "integrity": "sha512-oB8cpLWSAjOVFEJhhyMZh6NOEOtBVziaqdDQ86+qhDHFbZXoRTM7pNSvFRfW/W/L/LrQ38C99J5CGuRBBzBsdA==", + "dev": true, + "requires": { + "get-stdin": "^6.0.0" + } + }, + "eslint-import-resolver-node": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", + "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "resolve": "^1.13.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-module-utils": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", + "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "pkg-dir": "^2.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + } + } + }, + "eslint-plugin-eslint-comments": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-eslint-comments/-/eslint-plugin-eslint-comments-3.2.0.tgz", + "integrity": "sha512-0jkOl0hfojIHHmEHgmNdqv4fmh7300NdpA9FFpF7zaoLvB/QeXOGNLIo86oAveJFrfB1p05kC8hpEMHM8DwWVQ==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5", + "ignore": "^5.0.5" + } + }, + "eslint-plugin-filenames": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-filenames/-/eslint-plugin-filenames-1.3.2.tgz", + "integrity": "sha512-tqxJTiEM5a0JmRCUYQmxw23vtTxrb2+a3Q2mMOPhFxvt7ZQQJmdiuMby9B/vUAuVMghyP7oET+nIf6EO6CBd/w==", + "dev": true, + "requires": { + "lodash.camelcase": "4.3.0", + "lodash.kebabcase": "4.1.1", + "lodash.snakecase": "4.1.1", + "lodash.upperfirst": "4.3.1" + } + }, + "eslint-plugin-github": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-github/-/eslint-plugin-github-4.1.1.tgz", + "integrity": "sha512-MzCh4P4zVvR/13AHtumzZ3znq0cbUE7lXehyBEpFURD/EHdx/+7qW+0c+ySTrteImpX9LGLJFTYNtu10BifkbQ==", + "dev": true, + "requires": { + "@typescript-eslint/eslint-plugin": ">=2.25.0", + "@typescript-eslint/parser": ">=2.25.0", + "eslint-config-prettier": ">=6.10.1", + "eslint-plugin-eslint-comments": ">=3.0.1", + "eslint-plugin-import": ">=2.20.1", + "eslint-plugin-prettier": ">=3.1.2", + "eslint-rule-documentation": ">=1.0.0", + "prettier": ">=1.12.0", + "svg-element-attributes": ">=1.3.1" + } + }, + "eslint-plugin-import": { + "version": "2.22.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.0.tgz", + "integrity": "sha512-66Fpf1Ln6aIS5Gr/55ts19eUuoDhAbZgnr6UxK5hbDx6l/QgQgx61AePq+BV4PP2uXQFClgMVzep5zZ94qqsxg==", + "dev": true, + "requires": { + "array-includes": "^3.1.1", + "array.prototype.flat": "^1.2.3", + "contains-path": "^0.1.0", + "debug": "^2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.3", + "eslint-module-utils": "^2.6.0", + "has": "^1.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.1", + "read-pkg-up": "^2.0.0", + "resolve": "^1.17.0", + "tsconfig-paths": "^3.9.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + } + } + }, + "eslint-plugin-no-async-foreach": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-no-async-foreach/-/eslint-plugin-no-async-foreach-0.1.1.tgz", + "integrity": "sha512-SXiJCpXWyNijyT8F4K51oXwqnYv3G2JTHMhg+qE/BcWyj7E395pDScmHIP4NkeKi8B650BQBIMOLgMI47Mj26A==", + "dev": true, + "requires": { + "requireindex": "~1.1.0" + } + }, + "eslint-plugin-prettier": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.4.tgz", + "integrity": "sha512-jZDa8z76klRqo+TdGDTFJSavwbnWK2ZpqGKNZ+VvweMW516pDUMmQ2koXvxEE4JhzNvTv+radye/bWGBmA6jmg==", + "dev": true, + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, + "eslint-rule-documentation": { + "version": "1.0.23", + "resolved": "https://registry.npmjs.org/eslint-rule-documentation/-/eslint-rule-documentation-1.0.23.tgz", + "integrity": "sha512-pWReu3fkohwyvztx/oQWWgld2iad25TfUdi6wvhhaDPIQjHU/pyvlKgXFw1kX31SQK2Nq9MH+vRDWB0ZLy8fYw==", + "dev": true + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "eslint-visitor-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", + "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", + "dev": true + }, + "espree": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.0.tgz", + "integrity": "sha512-dksIWsvKCixn1yrEXO8UosNSxaDoSYpq9reEjZSbHLpT5hpaCAKTLBwq0RHtLrIr+c0ByiYzWT8KTMRzoRCNlw==", + "dev": true, + "requires": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "acorn": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.0.tgz", + "integrity": "sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==", + "dev": true + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "esquery": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, "esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -1352,6 +2136,12 @@ "strip-eof": "^1.0.0" } }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, "fast-diff": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", @@ -1372,6 +2162,18 @@ "picomatch": "^2.2.1" } }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, "fastq": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.8.0.tgz", @@ -1390,6 +2192,15 @@ "escape-string-regexp": "^1.0.5" } }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, "file-url": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/file-url/-/file-url-3.0.0.tgz", @@ -1414,6 +2225,34 @@ "path-exists": "^4.0.0" } }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + }, + "dependencies": { + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, "fs": { "version": "0.0.1-security", "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", @@ -1432,12 +2271,30 @@ "dev": true, "optional": true }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + }, "get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", @@ -1478,6 +2335,15 @@ "ini": "^1.3.5" } }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, "globby": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.0.tgz", @@ -1517,12 +2383,27 @@ "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", "dev": true }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, "has-yarn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", @@ -1553,6 +2434,24 @@ "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", "dev": true }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + } + } + }, "import-lazy": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", @@ -1628,6 +2527,12 @@ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" }, + "is-callable": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.1.tgz", + "integrity": "sha512-wliAfSzx6V+6WfMOmus1xy0XvSgf/dlStkvTfq7F0g4bOIW0PSUbnyse3NhDwdyYS1ozfUtAAySqTws3z9Eqgg==", + "dev": true + }, "is-ci": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", @@ -1637,6 +2542,12 @@ "ci-info": "^2.0.0" } }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true + }, "is-error": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/is-error/-/is-error-2.2.2.tgz", @@ -1680,6 +2591,12 @@ "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", "dev": true }, + "is-negative-zero": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz", + "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=", + "dev": true + }, "is-npm": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-4.0.0.tgz", @@ -1724,11 +2641,35 @@ "integrity": "sha512-aTHJ4BvETyySzLhguH+7sL4b8765eecqq7ZrHVuhZr3FjCL/IV+LsvisEeH+9d0AkChYny3ad1KEL+mKy4ot7A==", "dev": true }, + "is-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "dev": true + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -1797,12 +2738,33 @@ "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "dev": true }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, "jsonschema": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.2.6.tgz", @@ -1832,6 +2794,16 @@ "package-json": "^6.3.0" } }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, "lines-and-columns": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", @@ -1880,6 +2852,12 @@ "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", "dev": true }, + "lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", + "dev": true + }, "lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", @@ -1903,6 +2881,12 @@ "integrity": "sha1-Tpho1FJXXXUK/9NYyXlUPcIO1Xc=", "dev": true }, + "lodash.kebabcase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", + "integrity": "sha1-hImxyw0p/4gZXM7KRI/21swpXDY=", + "dev": true + }, "lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -1914,11 +2898,23 @@ "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", "integrity": "sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=" }, + "lodash.snakecase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", + "integrity": "sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40=", + "dev": true + }, "lodash.uniq": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=" }, + "lodash.upperfirst": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz", + "integrity": "sha1-E2Xt9DFIBIHvDRxolXpe2Z1J984=", + "dev": true + }, "log-symbols": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", @@ -2094,6 +3090,12 @@ "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "dev": true }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -2163,6 +3165,64 @@ "path-key": "^2.0.0" } }, + "object-inspect": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", + "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object.assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz", + "integrity": "sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.0", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.18.0-next.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.0.tgz", + "integrity": "sha512-elZXTZXKn51hUBdJjSZGYRujuzilgXo8vSPQzjGYXLvSlGiCo8VO8ZGV3kjo9a0WNJJ57hENagwbtlRuHuzkcQ==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-negative-zero": "^2.0.0", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } + } + }, + "object.values": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", + "integrity": "sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "has": "^1.0.3" + } + }, "octokit-pagination-methods": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz", @@ -2185,6 +3245,20 @@ "mimic-fn": "^2.1.0" } }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, "ora": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/ora/-/ora-4.0.4.tgz", @@ -2332,6 +3406,15 @@ } } }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, "parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", @@ -2471,12 +3554,33 @@ "irregular-plurals": "^3.2.0" } }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, "prepend-http": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", "dev": true }, + "prettier": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.1.tgz", + "integrity": "sha512-9bY+5ZWCfqj3ghYBLxApy2zf6m+NJo5GzmLTpr9FsApsfjriNnS2dahWReHMi7qNPhhHl9SYHJs2cHZLgexNIw==", + "dev": true + }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "requires": { + "fast-diff": "^1.1.2" + } + }, "pretty-ms": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-6.0.1.tgz", @@ -2491,6 +3595,12 @@ "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, "propagate": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/propagate/-/propagate-2.0.1.tgz", @@ -2506,6 +3616,12 @@ "once": "^1.3.1" } }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, "pupa": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.0.1.tgz", @@ -2559,6 +3675,114 @@ } } }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + } + } + } + }, "readdirp": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz", @@ -2568,6 +3792,12 @@ "picomatch": "^2.2.1" } }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, "registry-auth-token": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.1.1.tgz", @@ -2604,6 +3834,12 @@ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, + "requireindex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.1.0.tgz", + "integrity": "sha1-5UBLgVV+91225JxacgBIk/4D4WI=", + "dev": true + }, "resolve": { "version": "1.13.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.13.1.tgz", @@ -2862,6 +4098,26 @@ "strip-ansi": "^6.0.0" } }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, "strip-ansi": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", @@ -2879,6 +4135,12 @@ } } }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, "strip-eof": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", @@ -2941,6 +4203,69 @@ "has-flag": "^3.0.0" } }, + "svg-element-attributes": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/svg-element-attributes/-/svg-element-attributes-1.3.1.tgz", + "integrity": "sha512-Bh05dSOnJBf3miNMqpsormfNtfidA/GxQVakhtn0T4DECWKeXQRQUceYjJ+OxYiiLdGe4Jo9iFV8wICFapFeIA==", + "dev": true + }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + } + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, "temp-dir": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", @@ -2953,6 +4278,12 @@ "integrity": "sha512-a6sumDlzyHVJWb8+YofY4TW112G6p2FCPEAFk+59gIYHv3XHRhm9ltVQ9kli4hNWeQBwSpe8cRN25x0ROunMOw==", "dev": true }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, "time-zone": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz", @@ -2980,6 +4311,18 @@ "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", "dev": true }, + "tsconfig-paths": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", + "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", + "dev": true, + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + } + }, "tslib": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", @@ -3058,12 +4401,27 @@ "tslib": "^1.8.1" } }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, "typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", @@ -3169,6 +4527,15 @@ } } }, + "uri-js": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", + "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, "url-parse-lax": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", @@ -3191,6 +4558,12 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" }, + "v8-compile-cache": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", + "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", + "dev": true + }, "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -3247,6 +4620,12 @@ "execa": "^1.0.0" } }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, "wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -3290,6 +4669,15 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, "write-file-atomic": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", diff --git a/package.json b/package.json index 79b1c6f16..197bc56e3 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,13 @@ "@types/node": "^12.0.4", "@types/semver": "^7.2.0", "@types/sinon": "^7.2.0", + "@typescript-eslint/parser": "^4.1.0", "ava": "3.8.1", + "eslint": "^7.9.0", + "eslint-plugin-filenames": "^1.3.2", + "eslint-plugin-github": "^4.1.1", + "eslint-plugin-import": "^2.22.0", + "eslint-plugin-no-async-foreach": "^0.1.1", "micromatch": "4.0.2", "nock": "^12.0.3", "removeNPMAbsolutePaths": "2.0.0", @@ -55,4 +61,4 @@ "tslint-eslint-rules": "^5.4.0", "typescript": "^3.7.5" } -} \ No newline at end of file +} From 09b4a82c8384487a849ef27c0db0897f62f8445e Mon Sep 17 00:00:00 2001 From: Chris Raynor Date: Mon, 14 Sep 2020 10:37:55 +0100 Subject: [PATCH 21/35] Removing the tslint config --- .github/workflows/pr-checks.yml | 8 -- package-lock.json | 96 --------------------- package.json | 5 +- tslint.json | 144 -------------------------------- 4 files changed, 2 insertions(+), 251 deletions(-) delete mode 100644 tslint.json diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 3fdea4998..f804eab47 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -3,14 +3,6 @@ name: "PR checks" on: [push, pull_request] jobs: - tslint: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - name: tslint - run: npm run-script lint - check-js: runs-on: ubuntu-latest diff --git a/package-lock.json b/package-lock.json index 73b4a3a4e..0313b021b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1012,12 +1012,6 @@ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", - "dev": true - }, "cacheable-request": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", @@ -1487,24 +1481,6 @@ "path-type": "^4.0.0" } }, - "doctrine": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-0.7.2.tgz", - "integrity": "sha1-fLhgNZujvpDgQLJrcpzkv6ZUxSM=", - "dev": true, - "requires": { - "esutils": "^1.1.6", - "isarray": "0.0.1" - }, - "dependencies": { - "esutils": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-1.1.6.tgz", - "integrity": "sha1-wBzKqa5LiXxtDD4hCuUvPHqEQ3U=", - "dev": true - } - } - }, "dot-prop": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.2.0.tgz", @@ -4329,78 +4305,6 @@ "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", "dev": true }, - "tslint": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.0.tgz", - "integrity": "sha512-fXjYd/61vU6da04E505OZQGb2VCN2Mq3doeWcOIryuG+eqdmFUXTYVwdhnbEu2k46LNLgUYt9bI5icQze/j0bQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "builtin-modules": "^1.1.1", - "chalk": "^2.3.0", - "commander": "^2.12.1", - "diff": "^4.0.1", - "glob": "^7.1.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", - "resolve": "^1.3.2", - "semver": "^5.3.0", - "tslib": "^1.10.0", - "tsutils": "^2.29.0" - }, - "dependencies": { - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "tslint-eslint-rules": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/tslint-eslint-rules/-/tslint-eslint-rules-5.4.0.tgz", - "integrity": "sha512-WlSXE+J2vY/VPgIcqQuijMQiel+UtmXS+4nvK4ZzlDiqBfXse8FAvkNnTcYhnQyOTW5KFM+uRRGXxYhFpuBc6w==", - "dev": true, - "requires": { - "doctrine": "0.7.2", - "tslib": "1.9.0", - "tsutils": "^3.0.0" - }, - "dependencies": { - "tslib": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.0.tgz", - "integrity": "sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ==", - "dev": true - }, - "tsutils": { - "version": "3.17.1", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz", - "integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - } - } - }, - "tsutils": { - "version": "2.29.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", - "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", diff --git a/package.json b/package.json index 197bc56e3..211d68a64 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "scripts": { "build": "tsc", "test": "ava src/** --serial --verbose", - "lint": "tslint -p . -c tslint.json 'src/**/*.ts'", + "lint": "eslint --report-unused-disable-directives --max-warnings=0 . --ext .js,.ts", + "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --ext .js,.ts --fix", "removeNPMAbsolutePaths": "removeNPMAbsolutePaths . --force" }, "ava": { @@ -57,8 +58,6 @@ "nock": "^12.0.3", "removeNPMAbsolutePaths": "2.0.0", "sinon": "^9.0.2", - "tslint": "^6.1.0", - "tslint-eslint-rules": "^5.4.0", "typescript": "^3.7.5" } } diff --git a/tslint.json b/tslint.json deleted file mode 100644 index 3951a9fb3..000000000 --- a/tslint.json +++ /dev/null @@ -1,144 +0,0 @@ -{ - "extends": [ - "tslint" - ], - "rulesDirectory": [ - "./node_modules/tslint-eslint-rules/dist/rules/" - ], - "rules": { - "align": [ - true, - "parameters", - "arguments", - "statements" - ], - "class-name": true, - "comment-format": [ - true, - "check-space" - ], - "curly": false, - "eofline": true, - "forin": true, - "ter-indent": [ - true, - 2 - ], - "jsdoc-format": true, - "label-position": true, - "max-line-length": [ - true, - 120 - ], - "member-access": true, - "member-ordering": [ - { - "name": "static field", - "kinds": [ - "public-static-field", - "protected-static-field", - "private-static-field" - ] - }, - { - "name": "instance field", - "kinds": [ - "public-instance-field", - "protected-instance-field", - "private-instance-field" - ] - }, - { - "name": "static method", - "kinds": [ - "public-static-method", - "private-static-method", - "protected-static-method", - "public-static-accessor", - "protected-static-accessor", - "private-static-accessor" - ] - }, - { - "name": "instance method", - "kinds": [ - "public-constructor", - "protected-constructor", - "private-constructor", - "public-instance-method", - "protected-instance-method", - "private-instance-method", - "public-instance-accessor", - "protected-instance-accessor", - "private-instance-accessor" - ] - } - ], - "no-arg": true, - "no-bitwise": true, - "no-construct": true, - "no-debugger": true, - "no-duplicate-variable": true, - "no-empty": true, - "no-eval": true, - "no-floating-promises": true, - "no-inferrable-types": true, - "no-internal-module": true, - "no-require-imports": false, - "no-shadowed-variable": false, - "no-string-literal": false, - "no-switch-case-fall-through": true, - "no-trailing-whitespace": true, - "no-unused-expression": true, - "no-var-keyword": true, - "object-literal-sort-keys": false, - "one-line": [ - true, - "check-open-brace", - "check-catch", - "check-else", - "check-finally", - "check-whitespace" - ], - "ordered-imports": [ - true, - { - "grouped-imports": true - } - ], - "quotemark": [ - false - ], - "radix": true, - "semicolon": [ - true, - "always" - ], - "trailing-comma": [ - true, - { - "singleline": "never" - } - ], - "triple-equals": true, - "typedef-whitespace": [ - true, - { - "call-signature": "nospace", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - } - ], - "variable-name": false, - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ] - } -} From c96f84308a618dae52459d8e74ae7d2a41920fc2 Mon Sep 17 00:00:00 2001 From: Chris Raynor Date: Mon, 14 Sep 2020 10:42:37 +0100 Subject: [PATCH 22/35] Regenerating node_modules --- node_modules/.bin/eslint | 1 + .../.bin/eslint-config-prettier-check | 1 + node_modules/.bin/eslint-ignore-errors | 1 + node_modules/.bin/json5 | 1 + node_modules/.bin/prettier | 1 + node_modules/.bin/tslint | 1 - node_modules/@eslint/eslintrc/CHANGELOG.md | 4 + node_modules/@eslint/eslintrc/LICENSE | 21 + node_modules/@eslint/eslintrc/README.md | 21 + .../@eslint/eslintrc/conf/category-list.json | 39 + .../@eslint/eslintrc/conf/config-schema.js | 81 + .../eslintrc/conf/default-cli-options.js | 31 + .../@eslint/eslintrc/conf/environments.js | 179 + .../@eslint/eslintrc/conf/eslint-all.js | 32 + .../eslintrc/conf/eslint-recommended.js | 72 + .../@eslint/eslintrc/conf/replacements.json | 22 + .../lib/cascading-config-array-factory.js | 501 + .../eslintrc/lib/config-array-factory.js | 1080 + .../eslintrc/lib/config-array/config-array.js | 524 + .../lib/config-array/config-dependency.js | 116 + .../lib/config-array/extracted-config.js | 146 + .../lib/config-array/ignore-pattern.js | 237 + .../eslintrc/lib/config-array/index.js | 20 + .../lib/config-array/override-tester.js | 223 + node_modules/@eslint/eslintrc/lib/index.js | 51 + .../@eslint/eslintrc/lib/shared/ajv.js | 34 + .../@eslint/eslintrc/lib/shared/config-ops.js | 130 + .../eslintrc/lib/shared/config-validator.js | 324 + .../lib/shared/deprecation-warnings.js | 56 + .../@eslint/eslintrc/lib/shared/naming.js | 97 + .../lib/shared/relative-module-resolver.js | 44 + .../eslintrc/node_modules/ignore/CHANGELOG.md | 19 + .../eslintrc/node_modules/ignore/LICENSE-MIT | 21 + .../eslintrc/node_modules/ignore/README.md | 307 + .../eslintrc/node_modules/ignore/index.d.ts | 45 + .../eslintrc/node_modules/ignore/index.js | 463 + .../eslintrc/node_modules/ignore/legacy.js | 466 + .../eslintrc/node_modules/ignore/package.json | 64 + .../strip-json-comments/index.d.ts | 36 + .../node_modules/strip-json-comments/index.js | 77 + .../node_modules/strip-json-comments/license | 9 + .../strip-json-comments/package.json | 47 + .../strip-json-comments/readme.md | 78 + node_modules/@eslint/eslintrc/package.json | 59 + node_modules/@types/json-schema/LICENSE | 21 + node_modules/@types/json-schema/README.md | 16 + node_modules/@types/json-schema/index.d.ts | 747 + node_modules/@types/json-schema/package.json | 44 + node_modules/@types/json5/README.md | 18 + node_modules/@types/json5/index.d.ts | 44 + node_modules/@types/json5/package.json | 16 + node_modules/@types/json5/types-metadata.json | 25 + .../eslint-plugin/CHANGELOG.md | 1417 + .../@typescript-eslint/eslint-plugin/LICENSE | 21 + .../eslint-plugin/README.md | 224 + .../eslint-plugin/dist/configs/all.js | 144 + .../eslint-plugin/dist/configs/all.js.map | 1 + .../eslint-plugin/dist/configs/base.js | 10 + .../eslint-plugin/dist/configs/base.js.map | 1 + .../dist/configs/eslint-recommended.js | 32 + .../dist/configs/eslint-recommended.js.map | 1 + .../recommended-requiring-type-checking.js | 26 + ...recommended-requiring-type-checking.js.map | 1 + .../eslint-plugin/dist/configs/recommended.js | 35 + .../dist/configs/recommended.js.map | 1 + .../eslint-plugin/dist/index.js | 21 + .../eslint-plugin/dist/index.js.map | 1 + .../rules/adjacent-overload-signatures.js | 159 + .../rules/adjacent-overload-signatures.js.map | 1 + .../eslint-plugin/dist/rules/array-type.js | 275 + .../dist/rules/array-type.js.map | 1 + .../dist/rules/await-thenable.js | 59 + .../dist/rules/await-thenable.js.map | 1 + .../dist/rules/ban-ts-comment.js | 141 + .../dist/rules/ban-ts-comment.js.map | 1 + .../dist/rules/ban-tslint-comment.js | 75 + .../dist/rules/ban-tslint-comment.js.map | 1 + .../eslint-plugin/dist/rules/ban-types.js | 189 + .../eslint-plugin/dist/rules/ban-types.js.map | 1 + .../eslint-plugin/dist/rules/brace-style.js | 94 + .../dist/rules/brace-style.js.map | 1 + .../rules/class-literal-property-style.js | 114 + .../rules/class-literal-property-style.js.map | 1 + .../eslint-plugin/dist/rules/comma-spacing.js | 141 + .../dist/rules/comma-spacing.js.map | 1 + .../dist/rules/consistent-type-assertions.js | 153 + .../rules/consistent-type-assertions.js.map | 1 + .../dist/rules/consistent-type-definitions.js | 102 + .../rules/consistent-type-definitions.js.map | 1 + .../dist/rules/consistent-type-imports.js | 392 + .../dist/rules/consistent-type-imports.js.map | 1 + .../dist/rules/default-param-last.js | 65 + .../dist/rules/default-param-last.js.map | 1 + .../eslint-plugin/dist/rules/dot-notation.js | 90 + .../dist/rules/dot-notation.js.map | 1 + .../rules/explicit-function-return-type.js | 97 + .../explicit-function-return-type.js.map | 1 + .../rules/explicit-member-accessibility.js | 209 + .../explicit-member-accessibility.js.map | 1 + .../rules/explicit-module-boundary-types.js | 412 + .../explicit-module-boundary-types.js.map | 1 + .../dist/rules/func-call-spacing.js | 165 + .../dist/rules/func-call-spacing.js.map | 1 + .../indent-new-do-not-use/BinarySearchTree.js | 55 + .../BinarySearchTree.js.map | 1 + .../indent-new-do-not-use/OffsetStorage.js | 221 + .../OffsetStorage.js.map | 1 + .../rules/indent-new-do-not-use/TokenInfo.js | 49 + .../indent-new-do-not-use/TokenInfo.js.map | 1 + .../dist/rules/indent-new-do-not-use/index.js | 1143 + .../rules/indent-new-do-not-use/index.js.map | 1 + .../eslint-plugin/dist/rules/indent.js | 412 + .../eslint-plugin/dist/rules/indent.js.map | 1 + .../eslint-plugin/dist/rules/index.js | 220 + .../eslint-plugin/dist/rules/index.js.map | 1 + .../dist/rules/init-declarations.js | 47 + .../dist/rules/init-declarations.js.map | 1 + .../dist/rules/keyword-spacing.js | 67 + .../dist/rules/keyword-spacing.js.map | 1 + .../dist/rules/lines-between-class-members.js | 79 + .../rules/lines-between-class-members.js.map | 1 + .../dist/rules/member-delimiter-style.js | 208 + .../dist/rules/member-delimiter-style.js.map | 1 + .../dist/rules/member-ordering.js | 468 + .../dist/rules/member-ordering.js.map | 1 + .../dist/rules/method-signature-style.js | 162 + .../dist/rules/method-signature-style.js.map | 1 + .../dist/rules/naming-convention.js | 999 + .../dist/rules/naming-convention.js.map | 1 + .../dist/rules/no-array-constructor.js | 72 + .../dist/rules/no-array-constructor.js.map | 1 + .../dist/rules/no-base-to-string.js | 161 + .../dist/rules/no-base-to-string.js.map | 1 + .../rules/no-confusing-non-null-assertion.js | 97 + .../no-confusing-non-null-assertion.js.map | 1 + .../dist/rules/no-dupe-class-members.js | 55 + .../dist/rules/no-dupe-class-members.js.map | 1 + .../dist/rules/no-dynamic-delete.js | 91 + .../dist/rules/no-dynamic-delete.js.map | 1 + .../dist/rules/no-empty-function.js | 146 + .../dist/rules/no-empty-function.js.map | 1 + .../dist/rules/no-empty-interface.js | 105 + .../dist/rules/no-empty-interface.js.map | 1 + .../dist/rules/no-explicit-any.js | 188 + .../dist/rules/no-explicit-any.js.map | 1 + .../dist/rules/no-extra-non-null-assertion.js | 56 + .../rules/no-extra-non-null-assertion.js.map | 1 + .../dist/rules/no-extra-parens.js | 182 + .../dist/rules/no-extra-parens.js.map | 1 + .../eslint-plugin/dist/rules/no-extra-semi.js | 49 + .../dist/rules/no-extra-semi.js.map | 1 + .../dist/rules/no-extraneous-class.js | 129 + .../dist/rules/no-extraneous-class.js.map | 1 + .../dist/rules/no-floating-promises.js | 204 + .../dist/rules/no-floating-promises.js.map | 1 + .../dist/rules/no-for-in-array.js | 58 + .../dist/rules/no-for-in-array.js.map | 1 + .../dist/rules/no-implicit-any-catch.js | 97 + .../dist/rules/no-implicit-any-catch.js.map | 1 + .../dist/rules/no-implied-eval.js | 139 + .../dist/rules/no-implied-eval.js.map | 1 + .../dist/rules/no-inferrable-types.js | 199 + .../dist/rules/no-inferrable-types.js.map | 1 + .../dist/rules/no-invalid-this.js | 59 + .../dist/rules/no-invalid-this.js.map | 1 + .../dist/rules/no-invalid-void-type.js | 163 + .../dist/rules/no-invalid-void-type.js.map | 1 + .../eslint-plugin/dist/rules/no-loop-func.js | 196 + .../dist/rules/no-loop-func.js.map | 1 + .../dist/rules/no-loss-of-precision.js | 63 + .../dist/rules/no-loss-of-precision.js.map | 1 + .../dist/rules/no-magic-numbers.js | 205 + .../dist/rules/no-magic-numbers.js.map | 1 + .../dist/rules/no-misused-new.js | 103 + .../dist/rules/no-misused-new.js.map | 1 + .../dist/rules/no-misused-promises.js | 219 + .../dist/rules/no-misused-promises.js.map | 1 + .../eslint-plugin/dist/rules/no-namespace.js | 81 + .../dist/rules/no-namespace.js.map | 1 + .../no-non-null-asserted-optional-chain.js | 146 + ...no-non-null-asserted-optional-chain.js.map | 1 + .../dist/rules/no-non-null-assertion.js | 126 + .../dist/rules/no-non-null-assertion.js.map | 1 + .../dist/rules/no-parameter-properties.js | 106 + .../dist/rules/no-parameter-properties.js.map | 1 + .../eslint-plugin/dist/rules/no-redeclare.js | 224 + .../dist/rules/no-redeclare.js.map | 1 + .../dist/rules/no-require-imports.js | 55 + .../dist/rules/no-require-imports.js.map | 1 + .../eslint-plugin/dist/rules/no-shadow.js | 278 + .../eslint-plugin/dist/rules/no-shadow.js.map | 1 + .../eslint-plugin/dist/rules/no-this-alias.js | 83 + .../dist/rules/no-this-alias.js.map | 1 + .../dist/rules/no-throw-literal.js | 130 + .../dist/rules/no-throw-literal.js.map | 1 + .../eslint-plugin/dist/rules/no-type-alias.js | 252 + .../dist/rules/no-type-alias.js.map | 1 + .../no-unnecessary-boolean-literal-compare.js | 207 + ...unnecessary-boolean-literal-compare.js.map | 1 + .../dist/rules/no-unnecessary-condition.js | 469 + .../rules/no-unnecessary-condition.js.map | 1 + .../dist/rules/no-unnecessary-qualifier.js | 149 + .../rules/no-unnecessary-qualifier.js.map | 1 + .../rules/no-unnecessary-type-arguments.js | 119 + .../no-unnecessary-type-arguments.js.map | 1 + .../rules/no-unnecessary-type-assertion.js | 218 + .../no-unnecessary-type-assertion.js.map | 1 + .../dist/rules/no-unsafe-assignment.js | 265 + .../dist/rules/no-unsafe-assignment.js.map | 1 + .../dist/rules/no-unsafe-call.js | 67 + .../dist/rules/no-unsafe-call.js.map | 1 + .../dist/rules/no-unsafe-member-access.js | 105 + .../dist/rules/no-unsafe-member-access.js.map | 1 + .../dist/rules/no-unsafe-return.js | 137 + .../dist/rules/no-unsafe-return.js.map | 1 + .../dist/rules/no-unused-expressions.js | 76 + .../dist/rules/no-unused-expressions.js.map | 1 + .../dist/rules/no-unused-vars-experimental.js | 318 + .../rules/no-unused-vars-experimental.js.map | 1 + .../dist/rules/no-unused-vars.js | 348 + .../dist/rules/no-unused-vars.js.map | 1 + .../dist/rules/no-use-before-define.js | 247 + .../dist/rules/no-use-before-define.js.map | 1 + .../dist/rules/no-useless-constructor.js | 87 + .../dist/rules/no-useless-constructor.js.map | 1 + .../dist/rules/no-var-requires.js | 62 + .../dist/rules/no-var-requires.js.map | 1 + .../dist/rules/prefer-as-const.js | 88 + .../dist/rules/prefer-as-const.js.map | 1 + .../dist/rules/prefer-enum-initializers.js | 85 + .../rules/prefer-enum-initializers.js.map | 1 + .../eslint-plugin/dist/rules/prefer-for-of.js | 178 + .../dist/rules/prefer-for-of.js.map | 1 + .../dist/rules/prefer-function-type.js | 137 + .../dist/rules/prefer-function-type.js.map | 1 + .../dist/rules/prefer-includes.js | 208 + .../dist/rules/prefer-includes.js.map | 1 + .../dist/rules/prefer-literal-enum-member.js | 46 + .../rules/prefer-literal-enum-member.js.map | 1 + .../dist/rules/prefer-namespace-keyword.js | 65 + .../rules/prefer-namespace-keyword.js.map | 1 + .../dist/rules/prefer-nullish-coalescing.js | 160 + .../rules/prefer-nullish-coalescing.js.map | 1 + .../dist/rules/prefer-optional-chain.js | 318 + .../dist/rules/prefer-optional-chain.js.map | 1 + .../rules/prefer-readonly-parameter-types.js | 91 + .../prefer-readonly-parameter-types.js.map | 1 + .../dist/rules/prefer-readonly.js | 265 + .../dist/rules/prefer-readonly.js.map | 1 + .../rules/prefer-reduce-type-parameter.js | 92 + .../rules/prefer-reduce-type-parameter.js.map | 1 + .../dist/rules/prefer-regexp-exec.js | 54 + .../dist/rules/prefer-regexp-exec.js.map | 1 + .../rules/prefer-string-starts-ends-with.js | 489 + .../prefer-string-starts-ends-with.js.map | 1 + .../dist/rules/prefer-ts-expect-error.js | 62 + .../dist/rules/prefer-ts-expect-error.js.map | 1 + .../dist/rules/promise-function-async.js | 133 + .../dist/rules/promise-function-async.js.map | 1 + .../eslint-plugin/dist/rules/quotes.js | 86 + .../eslint-plugin/dist/rules/quotes.js.map | 1 + .../dist/rules/require-array-sort-compare.js | 81 + .../rules/require-array-sort-compare.js.map | 1 + .../eslint-plugin/dist/rules/require-await.js | 193 + .../dist/rules/require-await.js.map | 1 + .../dist/rules/restrict-plus-operands.js | 130 + .../dist/rules/restrict-plus-operands.js.map | 1 + .../rules/restrict-template-expressions.js | 111 + .../restrict-template-expressions.js.map | 1 + .../eslint-plugin/dist/rules/return-await.js | 190 + .../dist/rules/return-await.js.map | 1 + .../eslint-plugin/dist/rules/semi.js | 84 + .../eslint-plugin/dist/rules/semi.js.map | 1 + .../dist/rules/space-before-function-paren.js | 158 + .../rules/space-before-function-paren.js.map | 1 + .../dist/rules/strict-boolean-expressions.js | 265 + .../rules/strict-boolean-expressions.js.map | 1 + .../dist/rules/switch-exhaustiveness-check.js | 158 + .../rules/switch-exhaustiveness-check.js.map | 1 + .../dist/rules/triple-slash-reference.js | 125 + .../dist/rules/triple-slash-reference.js.map | 1 + .../dist/rules/type-annotation-spacing.js | 221 + .../dist/rules/type-annotation-spacing.js.map | 1 + .../eslint-plugin/dist/rules/typedef.js | 204 + .../eslint-plugin/dist/rules/typedef.js.map | 1 + .../dist/rules/unbound-method.js | 258 + .../dist/rules/unbound-method.js.map | 1 + .../dist/rules/unified-signatures.js | 396 + .../dist/rules/unified-signatures.js.map | 1 + .../eslint-plugin/dist/util/astUtils.js | 15 + .../eslint-plugin/dist/util/astUtils.js.map | 1 + .../eslint-plugin/dist/util/createRule.js | 8 + .../eslint-plugin/dist/util/createRule.js.map | 1 + .../dist/util/explicitReturnTypeUtils.js | 241 + .../dist/util/explicitReturnTypeUtils.js.map | 1 + .../eslint-plugin/dist/util/index.js | 28 + .../eslint-plugin/dist/util/index.js.map | 1 + .../eslint-plugin/dist/util/isTypeReadonly.js | 140 + .../dist/util/isTypeReadonly.js.map | 1 + .../eslint-plugin/dist/util/misc.js | 67 + .../eslint-plugin/dist/util/misc.js.map | 1 + .../eslint-plugin/dist/util/nullThrows.js | 28 + .../eslint-plugin/dist/util/nullThrows.js.map | 1 + .../dist/util/objectIterators.js | 27 + .../dist/util/objectIterators.js.map | 1 + .../eslint-plugin/dist/util/types.js | 411 + .../eslint-plugin/dist/util/types.js.map | 1 + .../rules/adjacent-overload-signatures.md | 89 + .../eslint-plugin/docs/rules/array-type.md | 97 + .../docs/rules/await-thenable.md | 33 + .../docs/rules/ban-ts-comment.md | 116 + .../docs/rules/ban-tslint-comment.md | 29 + .../eslint-plugin/docs/rules/ban-types.md | 187 + .../eslint-plugin/docs/rules/brace-style.md | 22 + .../eslint-plugin/docs/rules/camelcase.md | 8 + .../rules/class-literal-property-style.md | 96 + .../eslint-plugin/docs/rules/comma-spacing.md | 22 + .../docs/rules/consistent-type-assertions.md | 93 + .../docs/rules/consistent-type-definitions.md | 74 + .../docs/rules/consistent-type-imports.md | 64 + .../docs/rules/default-param-last.md | 56 + .../eslint-plugin/docs/rules/dot-notation.md | 46 + .../rules/explicit-function-return-type.md | 229 + .../rules/explicit-member-accessibility.md | 344 + .../rules/explicit-module-boundary-types.md | 274 + .../docs/rules/func-call-spacing.md | 22 + .../eslint-plugin/docs/rules/indent.md | 24 + .../docs/rules/init-declarations.md | 22 + .../docs/rules/keyword-spacing.md | 22 + .../docs/rules/lines-between-class-members.md | 73 + .../docs/rules/member-delimiter-style.md | 194 + .../docs/rules/member-ordering.md | 867 + .../docs/rules/method-signature-style.md | 94 + .../docs/rules/naming-convention.md | 465 + .../docs/rules/no-array-constructor.md | 43 + .../docs/rules/no-base-to-string.md | 87 + .../rules/no-confusing-non-null-assertion.md | 46 + .../docs/rules/no-dupe-class-members.md | 22 + .../docs/rules/no-dynamic-delete.md | 49 + .../docs/rules/no-empty-function.md | 78 + .../docs/rules/no-empty-interface.md | 64 + .../docs/rules/no-explicit-any.md | 181 + .../docs/rules/no-extra-non-null-assertion.md | 49 + .../docs/rules/no-extra-parens.md | 22 + .../eslint-plugin/docs/rules/no-extra-semi.md | 22 + .../docs/rules/no-extraneous-class.md | 80 + .../docs/rules/no-floating-promises.md | 104 + .../docs/rules/no-for-in-array.md | 44 + .../docs/rules/no-implicit-any-catch.md | 76 + .../docs/rules/no-implied-eval.md | 95 + .../docs/rules/no-inferrable-types.md | 146 + .../docs/rules/no-invalid-this.md | 26 + .../docs/rules/no-invalid-void-type.md | 107 + .../eslint-plugin/docs/rules/no-loop-func.md | 22 + .../docs/rules/no-loss-of-precision.md | 19 + .../docs/rules/no-magic-numbers.md | 119 + .../docs/rules/no-misused-new.md | 41 + .../docs/rules/no-misused-promises.md | 119 + .../eslint-plugin/docs/rules/no-namespace.md | 115 + .../no-non-null-asserted-optional-chain.md | 48 + .../docs/rules/no-non-null-assertion.md | 35 + .../docs/rules/no-parameter-properties.md | 367 + .../eslint-plugin/docs/rules/no-redeclare.md | 79 + .../docs/rules/no-require-imports.md | 34 + .../eslint-plugin/docs/rules/no-shadow.md | 87 + .../eslint-plugin/docs/rules/no-this-alias.md | 60 + .../docs/rules/no-throw-literal.md | 84 + .../eslint-plugin/docs/rules/no-type-alias.md | 569 + .../no-unnecessary-boolean-literal-compare.md | 134 + .../docs/rules/no-unnecessary-condition.md | 107 + .../docs/rules/no-unnecessary-qualifier.md | 79 + .../rules/no-unnecessary-type-arguments.md | 53 + .../rules/no-unnecessary-type-assertion.md | 73 + .../docs/rules/no-unsafe-assignment.md | 72 + .../docs/rules/no-unsafe-call.md | 48 + .../docs/rules/no-unsafe-member-access.md | 54 + .../docs/rules/no-unsafe-return.md | 89 + .../docs/rules/no-unused-expressions.md | 22 + .../docs/rules/no-unused-vars-experimental.md | 115 + .../docs/rules/no-unused-vars.md | 22 + .../docs/rules/no-use-before-define.md | 106 + .../docs/rules/no-useless-constructor.md | 26 + .../docs/rules/no-var-requires.md | 29 + .../docs/rules/prefer-as-const.md | 28 + .../docs/rules/prefer-enum-initializers.md | 70 + .../eslint-plugin/docs/rules/prefer-for-of.md | 41 + .../docs/rules/prefer-function-type.md | 57 + .../docs/rules/prefer-includes.md | 71 + .../docs/rules/prefer-literal-enum-member.md | 51 + .../docs/rules/prefer-namespace-keyword.md | 22 + .../docs/rules/prefer-nullish-coalescing.md | 141 + .../docs/rules/prefer-optional-chain.md | 82 + .../rules/prefer-readonly-parameter-types.md | 164 + .../docs/rules/prefer-readonly.md | 81 + .../rules/prefer-reduce-type-parameter.md | 54 + .../docs/rules/prefer-regexp-exec.md | 53 + .../rules/prefer-string-starts-ends-with.md | 54 + .../docs/rules/prefer-ts-expect-error.md | 47 + .../docs/rules/promise-function-async.md | 66 + .../eslint-plugin/docs/rules/quotes.md | 22 + .../docs/rules/require-array-sort-compare.md | 85 + .../eslint-plugin/docs/rules/require-await.md | 32 + .../docs/rules/restrict-plus-operands.md | 58 + .../rules/restrict-template-expressions.md | 85 + .../eslint-plugin/docs/rules/return-await.md | 146 + .../eslint-plugin/docs/rules/semi.md | 26 + .../docs/rules/space-before-function-paren.md | 22 + .../docs/rules/strict-boolean-expressions.md | 162 + .../docs/rules/switch-exhaustiveness-check.md | 103 + .../docs/rules/triple-slash-reference.md | 58 + .../docs/rules/type-annotation-spacing.md | 291 + .../eslint-plugin/docs/rules/typedef.md | 308 + .../docs/rules/unbound-method.md | 92 + .../docs/rules/unified-signatures.md | 33 + .../node_modules/tsutils/.editorconfig | 0 .../node_modules/tsutils/.fimbullinter.yaml | 0 .../node_modules/tsutils/.wotanrc.yaml | 0 .../node_modules/tsutils/CHANGELOG.md | 0 .../node_modules/tsutils/LICENSE | 0 .../node_modules/tsutils/README.md | 0 .../node_modules/tsutils/index.d.ts | 0 .../node_modules/tsutils/index.js | 0 .../node_modules/tsutils/package.json | 0 .../tsutils/typeguard/2.8/index.d.ts | 0 .../tsutils/typeguard/2.8/index.js | 0 .../tsutils/typeguard/2.8/node.d.ts | 0 .../tsutils/typeguard/2.8/node.js | 0 .../tsutils/typeguard/2.8/type.d.ts | 0 .../tsutils/typeguard/2.8/type.js | 0 .../tsutils/typeguard/2.9/index.d.ts | 0 .../tsutils/typeguard/2.9/index.js | 0 .../tsutils/typeguard/2.9/node.d.ts | 0 .../tsutils/typeguard/2.9/node.js | 0 .../tsutils/typeguard/2.9/type.d.ts | 0 .../tsutils/typeguard/2.9/type.js | 0 .../tsutils/typeguard/3.0/index.d.ts | 0 .../tsutils/typeguard/3.0/index.js | 0 .../tsutils/typeguard/3.0/node.d.ts | 0 .../tsutils/typeguard/3.0/node.js | 0 .../tsutils/typeguard/3.0/type.d.ts | 0 .../tsutils/typeguard/3.0/type.js | 0 .../tsutils/typeguard/3.2/index.d.ts | 0 .../tsutils/typeguard/3.2/index.js | 0 .../tsutils/typeguard/3.2/node.d.ts | 0 .../tsutils/typeguard/3.2/node.js | 0 .../tsutils/typeguard/3.2/type.d.ts | 0 .../tsutils/typeguard/3.2/type.js | 0 .../node_modules/tsutils/typeguard/index.d.ts | 0 .../node_modules/tsutils/typeguard/index.js | 0 .../tsutils/typeguard/next/index.d.ts | 0 .../tsutils/typeguard/next/index.js | 0 .../tsutils/typeguard/next/node.d.ts | 0 .../tsutils/typeguard/next/node.js | 0 .../tsutils/typeguard/next/type.d.ts | 0 .../tsutils/typeguard/next/type.js | 0 .../node_modules/tsutils/typeguard/node.d.ts | 0 .../node_modules/tsutils/typeguard/node.js | 0 .../node_modules/tsutils/typeguard/type.d.ts | 0 .../node_modules/tsutils/typeguard/type.js | 0 .../tsutils/util/control-flow.d.ts | 0 .../node_modules/tsutils/util/control-flow.js | 0 .../tsutils/util/convert-ast.d.ts | 0 .../node_modules/tsutils/util/convert-ast.js | 0 .../node_modules/tsutils/util/index.d.ts | 0 .../node_modules/tsutils/util/index.js | 0 .../node_modules/tsutils/util/type.d.ts | 0 .../node_modules/tsutils/util/type.js | 0 .../node_modules/tsutils/util/usage.d.ts | 0 .../node_modules/tsutils/util/usage.js | 0 .../node_modules/tsutils/util/util.d.ts | 0 .../node_modules/tsutils/util/util.js | 0 .../eslint-plugin/package.json | 76 + .../experimental-utils/CHANGELOG.md | 698 + .../experimental-utils/LICENSE | 21 + .../experimental-utils/README.md | 37 + .../eslint-utils/PatternMatcher.d.ts | 48 + .../eslint-utils/ReferenceTracker.d.ts | 72 + .../ast-utils/eslint-utils/astUtilities.d.ts | 82 + .../dist/ast-utils/eslint-utils/index.d.ts | 6 + .../ast-utils/eslint-utils/predicates.d.ts | 45 + .../ast-utils/eslint-utils/scopeAnalysis.d.ts | 18 + .../_ts3.4/dist/ast-utils/index.d.ts | 4 + .../_ts3.4/dist/ast-utils/misc.d.ts | 8 + .../_ts3.4/dist/ast-utils/predicates.d.ts | 57 + .../dist/eslint-utils/InferTypesFromRule.d.ts | 12 + .../_ts3.4/dist/eslint-utils/RuleCreator.d.ts | 13 + .../_ts3.4/dist/eslint-utils/RuleTester.d.ts | 18 + .../dist/eslint-utils/applyDefault.d.ts | 10 + .../eslint-utils/batchedSingleLineTests.d.ts | 24 + .../_ts3.4/dist/eslint-utils/deepMerge.d.ts | 17 + .../dist/eslint-utils/getParserServices.d.ts | 8 + .../_ts3.4/dist/eslint-utils/index.d.ts | 8 + .../experimental-utils/_ts3.4/dist/index.d.ts | 8 + .../_ts3.4/dist/json-schema.d.ts | 2 + .../dist/ts-eslint-scope/Definition.d.ts | 19 + .../_ts3.4/dist/ts-eslint-scope/Options.d.ts | 15 + .../dist/ts-eslint-scope/PatternVisitor.d.ts | 25 + .../dist/ts-eslint-scope/Reference.d.ts | 28 + .../dist/ts-eslint-scope/Referencer.d.ts | 55 + .../_ts3.4/dist/ts-eslint-scope/Scope.d.ts | 103 + .../dist/ts-eslint-scope/ScopeManager.d.ts | 50 + .../_ts3.4/dist/ts-eslint-scope/Variable.d.ts | 17 + .../_ts3.4/dist/ts-eslint-scope/analyze.d.ts | 16 + .../_ts3.4/dist/ts-eslint-scope/index.d.ts | 11 + .../_ts3.4/dist/ts-eslint/AST.d.ts | 9 + .../_ts3.4/dist/ts-eslint/CLIEngine.d.ts | 143 + .../_ts3.4/dist/ts-eslint/ESLint.d.ts | 341 + .../_ts3.4/dist/ts-eslint/Linter.d.ts | 327 + .../_ts3.4/dist/ts-eslint/ParserOptions.d.ts | 2 + .../_ts3.4/dist/ts-eslint/Rule.d.ts | 369 + .../_ts3.4/dist/ts-eslint/RuleTester.d.ts | 137 + .../_ts3.4/dist/ts-eslint/Scope.d.ts | 44 + .../_ts3.4/dist/ts-eslint/SourceCode.d.ts | 350 + .../_ts3.4/dist/ts-eslint/index.d.ts | 10 + .../_ts3.4/dist/ts-estree.d.ts | 3 + .../eslint-utils/PatternMatcher.d.ts | 48 + .../eslint-utils/PatternMatcher.d.ts.map | 1 + .../ast-utils/eslint-utils/PatternMatcher.js | 32 + .../eslint-utils/PatternMatcher.js.map | 1 + .../eslint-utils/ReferenceTracker.d.ts | 72 + .../eslint-utils/ReferenceTracker.d.ts.map | 1 + .../eslint-utils/ReferenceTracker.js | 35 + .../eslint-utils/ReferenceTracker.js.map | 1 + .../ast-utils/eslint-utils/astUtilities.d.ts | 82 + .../eslint-utils/astUtilities.d.ts.map | 1 + .../ast-utils/eslint-utils/astUtilities.js | 104 + .../eslint-utils/astUtilities.js.map | 1 + .../dist/ast-utils/eslint-utils/index.d.ts | 6 + .../ast-utils/eslint-utils/index.d.ts.map | 1 + .../dist/ast-utils/eslint-utils/index.js | 18 + .../dist/ast-utils/eslint-utils/index.js.map | 1 + .../ast-utils/eslint-utils/predicates.d.ts | 45 + .../eslint-utils/predicates.d.ts.map | 1 + .../dist/ast-utils/eslint-utils/predicates.js | 68 + .../ast-utils/eslint-utils/predicates.js.map | 1 + .../ast-utils/eslint-utils/scopeAnalysis.d.ts | 18 + .../eslint-utils/scopeAnalysis.d.ts.map | 1 + .../ast-utils/eslint-utils/scopeAnalysis.js | 40 + .../eslint-utils/scopeAnalysis.js.map | 1 + .../dist/ast-utils/index.d.ts | 4 + .../dist/ast-utils/index.d.ts.map | 1 + .../dist/ast-utils/index.js | 16 + .../dist/ast-utils/index.js.map | 1 + .../dist/ast-utils/misc.d.ts | 8 + .../dist/ast-utils/misc.d.ts.map | 1 + .../experimental-utils/dist/ast-utils/misc.js | 13 + .../dist/ast-utils/misc.js.map | 1 + .../dist/ast-utils/predicates.d.ts | 57 + .../dist/ast-utils/predicates.d.ts.map | 1 + .../dist/ast-utils/predicates.js | 152 + .../dist/ast-utils/predicates.js.map | 1 + .../dist/eslint-utils/InferTypesFromRule.d.ts | 12 + .../eslint-utils/InferTypesFromRule.d.ts.map | 1 + .../dist/eslint-utils/InferTypesFromRule.js | 3 + .../eslint-utils/InferTypesFromRule.js.map | 1 + .../dist/eslint-utils/RuleCreator.d.ts | 13 + .../dist/eslint-utils/RuleCreator.d.ts.map | 1 + .../dist/eslint-utils/RuleCreator.js | 19 + .../dist/eslint-utils/RuleCreator.js.map | 1 + .../dist/eslint-utils/RuleTester.d.ts | 18 + .../dist/eslint-utils/RuleTester.d.ts.map | 1 + .../dist/eslint-utils/RuleTester.js | 128 + .../dist/eslint-utils/RuleTester.js.map | 1 + .../dist/eslint-utils/applyDefault.d.ts | 10 + .../dist/eslint-utils/applyDefault.d.ts.map | 1 + .../dist/eslint-utils/applyDefault.js | 32 + .../dist/eslint-utils/applyDefault.js.map | 1 + .../eslint-utils/batchedSingleLineTests.d.ts | 24 + .../batchedSingleLineTests.d.ts.map | 1 + .../eslint-utils/batchedSingleLineTests.js | 26 + .../batchedSingleLineTests.js.map | 1 + .../dist/eslint-utils/deepMerge.d.ts | 17 + .../dist/eslint-utils/deepMerge.d.ts.map | 1 + .../dist/eslint-utils/deepMerge.js | 48 + .../dist/eslint-utils/deepMerge.js.map | 1 + .../dist/eslint-utils/getParserServices.d.ts | 8 + .../eslint-utils/getParserServices.d.ts.map | 1 + .../dist/eslint-utils/getParserServices.js | 28 + .../eslint-utils/getParserServices.js.map | 1 + .../dist/eslint-utils/index.d.ts | 8 + .../dist/eslint-utils/index.d.ts.map | 1 + .../dist/eslint-utils/index.js | 20 + .../dist/eslint-utils/index.js.map | 1 + .../experimental-utils/dist/index.d.ts | 8 + .../experimental-utils/dist/index.d.ts.map | 1 + .../experimental-utils/dist/index.js | 37 + .../experimental-utils/dist/index.js.map | 1 + .../experimental-utils/dist/json-schema.d.ts | 2 + .../dist/json-schema.d.ts.map | 1 + .../experimental-utils/dist/json-schema.js | 6 + .../dist/json-schema.js.map | 1 + .../dist/ts-eslint-scope/Definition.d.ts | 19 + .../dist/ts-eslint-scope/Definition.d.ts.map | 1 + .../dist/ts-eslint-scope/Definition.js | 9 + .../dist/ts-eslint-scope/Definition.js.map | 1 + .../dist/ts-eslint-scope/Options.d.ts | 15 + .../dist/ts-eslint-scope/Options.d.ts.map | 1 + .../dist/ts-eslint-scope/Options.js | 3 + .../dist/ts-eslint-scope/Options.js.map | 1 + .../dist/ts-eslint-scope/PatternVisitor.d.ts | 25 + .../ts-eslint-scope/PatternVisitor.d.ts.map | 1 + .../dist/ts-eslint-scope/PatternVisitor.js | 10 + .../ts-eslint-scope/PatternVisitor.js.map | 1 + .../dist/ts-eslint-scope/Reference.d.ts | 28 + .../dist/ts-eslint-scope/Reference.d.ts.map | 1 + .../dist/ts-eslint-scope/Reference.js | 10 + .../dist/ts-eslint-scope/Reference.js.map | 1 + .../dist/ts-eslint-scope/Referencer.d.ts | 55 + .../dist/ts-eslint-scope/Referencer.d.ts.map | 1 + .../dist/ts-eslint-scope/Referencer.js | 11 + .../dist/ts-eslint-scope/Referencer.js.map | 1 + .../dist/ts-eslint-scope/Scope.d.ts | 103 + .../dist/ts-eslint-scope/Scope.d.ts.map | 1 + .../dist/ts-eslint-scope/Scope.js | 28 + .../dist/ts-eslint-scope/Scope.js.map | 1 + .../dist/ts-eslint-scope/ScopeManager.d.ts | 50 + .../ts-eslint-scope/ScopeManager.d.ts.map | 1 + .../dist/ts-eslint-scope/ScopeManager.js | 10 + .../dist/ts-eslint-scope/ScopeManager.js.map | 1 + .../dist/ts-eslint-scope/Variable.d.ts | 17 + .../dist/ts-eslint-scope/Variable.d.ts.map | 1 + .../dist/ts-eslint-scope/Variable.js | 10 + .../dist/ts-eslint-scope/Variable.js.map | 1 + .../dist/ts-eslint-scope/analyze.d.ts | 16 + .../dist/ts-eslint-scope/analyze.d.ts.map | 1 + .../dist/ts-eslint-scope/analyze.js | 7 + .../dist/ts-eslint-scope/analyze.js.map | 1 + .../dist/ts-eslint-scope/index.d.ts | 11 + .../dist/ts-eslint-scope/index.d.ts.map | 1 + .../dist/ts-eslint-scope/index.js | 25 + .../dist/ts-eslint-scope/index.js.map | 1 + .../dist/ts-eslint/AST.d.ts | 9 + .../dist/ts-eslint/AST.d.ts.map | 1 + .../experimental-utils/dist/ts-eslint/AST.js | 4 + .../dist/ts-eslint/AST.js.map | 1 + .../dist/ts-eslint/CLIEngine.d.ts | 143 + .../dist/ts-eslint/CLIEngine.d.ts.map | 1 + .../dist/ts-eslint/CLIEngine.js | 15 + .../dist/ts-eslint/CLIEngine.js.map | 1 + .../dist/ts-eslint/ESLint.d.ts | 338 + .../dist/ts-eslint/ESLint.d.ts.map | 1 + .../dist/ts-eslint/ESLint.js | 23 + .../dist/ts-eslint/ESLint.js.map | 1 + .../dist/ts-eslint/Linter.d.ts | 324 + .../dist/ts-eslint/Linter.d.ts.map | 1 + .../dist/ts-eslint/Linter.js | 14 + .../dist/ts-eslint/Linter.js.map | 1 + .../dist/ts-eslint/ParserOptions.d.ts | 2 + .../dist/ts-eslint/ParserOptions.d.ts.map | 1 + .../dist/ts-eslint/ParserOptions.js | 3 + .../dist/ts-eslint/ParserOptions.js.map | 1 + .../dist/ts-eslint/Rule.d.ts | 369 + .../dist/ts-eslint/Rule.d.ts.map | 1 + .../experimental-utils/dist/ts-eslint/Rule.js | 3 + .../dist/ts-eslint/Rule.js.map | 1 + .../dist/ts-eslint/RuleTester.d.ts | 137 + .../dist/ts-eslint/RuleTester.d.ts.map | 1 + .../dist/ts-eslint/RuleTester.js | 8 + .../dist/ts-eslint/RuleTester.js.map | 1 + .../dist/ts-eslint/Scope.d.ts | 44 + .../dist/ts-eslint/Scope.d.ts.map | 1 + .../dist/ts-eslint/Scope.js | 9 + .../dist/ts-eslint/Scope.js.map | 1 + .../dist/ts-eslint/SourceCode.d.ts | 350 + .../dist/ts-eslint/SourceCode.d.ts.map | 1 + .../dist/ts-eslint/SourceCode.js | 9 + .../dist/ts-eslint/SourceCode.js.map | 1 + .../dist/ts-eslint/index.d.ts | 10 + .../dist/ts-eslint/index.d.ts.map | 1 + .../dist/ts-eslint/index.js | 22 + .../dist/ts-eslint/index.js.map | 1 + .../experimental-utils/dist/ts-estree.d.ts | 3 + .../dist/ts-estree.d.ts.map | 1 + .../experimental-utils/dist/ts-estree.js | 10 + .../experimental-utils/dist/ts-estree.js.map | 1 + .../experimental-utils/package.json | 67 + .../@typescript-eslint/parser/CHANGELOG.md | 776 + .../@typescript-eslint/parser/LICENSE | 22 + .../@typescript-eslint/parser/README.md | 228 + .../@typescript-eslint/parser/dist/index.d.ts | 5 + .../parser/dist/index.d.ts.map | 1 + .../@typescript-eslint/parser/dist/index.js | 11 + .../parser/dist/index.js.map | 1 + .../parser/dist/parser-options.d.ts | 2 + .../parser/dist/parser-options.d.ts.map | 1 + .../parser/dist/parser-options.js | 3 + .../parser/dist/parser-options.js.map | 1 + .../parser/dist/parser.d.ts | 17 + .../parser/dist/parser.d.ts.map | 1 + .../@typescript-eslint/parser/dist/parser.js | 131 + .../parser/dist/parser.js.map | 1 + .../@typescript-eslint/parser/package.json | 76 + .../scope-manager/CHANGELOG.md | 135 + .../@typescript-eslint/scope-manager/LICENSE | 21 + .../scope-manager/README.md | 113 + .../scope-manager/dist/ID.d.ts | 4 + .../scope-manager/dist/ID.d.ts.map | 1 + .../scope-manager/dist/ID.js | 22 + .../scope-manager/dist/ID.js.map | 1 + .../scope-manager/dist/ScopeManager.d.ts | 68 + .../scope-manager/dist/ScopeManager.d.ts.map | 1 + .../scope-manager/dist/ScopeManager.js | 181 + .../scope-manager/dist/ScopeManager.js.map | 1 + .../scope-manager/dist/analyze.d.ts | 56 + .../scope-manager/dist/analyze.d.ts.map | 1 + .../scope-manager/dist/analyze.js | 50 + .../scope-manager/dist/analyze.js.map | 1 + .../scope-manager/dist/assert.d.ts | 3 + .../scope-manager/dist/assert.d.ts.map | 1 + .../scope-manager/dist/assert.js | 11 + .../scope-manager/dist/assert.js.map | 1 + .../definition/CatchClauseDefinition.d.ts | 10 + .../definition/CatchClauseDefinition.d.ts.map | 1 + .../dist/definition/CatchClauseDefinition.js | 14 + .../definition/CatchClauseDefinition.js.map | 1 + .../dist/definition/ClassNameDefinition.d.ts | 10 + .../definition/ClassNameDefinition.d.ts.map | 1 + .../dist/definition/ClassNameDefinition.js | 14 + .../definition/ClassNameDefinition.js.map | 1 + .../dist/definition/Definition.d.ts | 14 + .../dist/definition/Definition.d.ts.map | 1 + .../dist/definition/Definition.js | 3 + .../dist/definition/Definition.js.map | 1 + .../dist/definition/DefinitionBase.d.ts | 39 + .../dist/definition/DefinitionBase.d.ts.map | 1 + .../dist/definition/DefinitionBase.js | 19 + .../dist/definition/DefinitionBase.js.map | 1 + .../dist/definition/DefinitionType.d.ts | 15 + .../dist/definition/DefinitionType.d.ts.map | 1 + .../dist/definition/DefinitionType.js | 20 + .../dist/definition/DefinitionType.js.map | 1 + .../definition/FunctionNameDefinition.d.ts | 10 + .../FunctionNameDefinition.d.ts.map | 1 + .../dist/definition/FunctionNameDefinition.js | 14 + .../definition/FunctionNameDefinition.js.map | 1 + .../ImplicitGlobalVariableDefinition.d.ts | 10 + .../ImplicitGlobalVariableDefinition.d.ts.map | 1 + .../ImplicitGlobalVariableDefinition.js | 14 + .../ImplicitGlobalVariableDefinition.js.map | 1 + .../definition/ImportBindingDefinition.d.ts | 11 + .../ImportBindingDefinition.d.ts.map | 1 + .../definition/ImportBindingDefinition.js | 14 + .../definition/ImportBindingDefinition.js.map | 1 + .../dist/definition/ParameterDefinition.d.ts | 14 + .../definition/ParameterDefinition.d.ts.map | 1 + .../dist/definition/ParameterDefinition.js | 15 + .../definition/ParameterDefinition.js.map | 1 + .../definition/TSEnumMemberDefinition.d.ts | 10 + .../TSEnumMemberDefinition.d.ts.map | 1 + .../dist/definition/TSEnumMemberDefinition.js | 14 + .../definition/TSEnumMemberDefinition.js.map | 1 + .../dist/definition/TSEnumNameDefinition.d.ts | 10 + .../definition/TSEnumNameDefinition.d.ts.map | 1 + .../dist/definition/TSEnumNameDefinition.js | 14 + .../definition/TSEnumNameDefinition.js.map | 1 + .../definition/TSModuleNameDefinition.d.ts | 10 + .../TSModuleNameDefinition.d.ts.map | 1 + .../dist/definition/TSModuleNameDefinition.js | 14 + .../definition/TSModuleNameDefinition.js.map | 1 + .../dist/definition/TypeDefinition.d.ts | 10 + .../dist/definition/TypeDefinition.d.ts.map | 1 + .../dist/definition/TypeDefinition.js | 14 + .../dist/definition/TypeDefinition.js.map | 1 + .../dist/definition/VariableDefinition.d.ts | 10 + .../definition/VariableDefinition.d.ts.map | 1 + .../dist/definition/VariableDefinition.js | 14 + .../dist/definition/VariableDefinition.js.map | 1 + .../scope-manager/dist/definition/index.d.ts | 14 + .../dist/definition/index.d.ts.map | 1 + .../scope-manager/dist/definition/index.js | 26 + .../dist/definition/index.js.map | 1 + .../scope-manager/dist/index.d.ts | 9 + .../scope-manager/dist/index.d.ts.map | 1 + .../scope-manager/dist/index.js | 27 + .../scope-manager/dist/index.js.map | 1 + .../scope-manager/dist/lib/dom.d.ts | 3 + .../scope-manager/dist/lib/dom.d.ts.map | 1 + .../scope-manager/dist/lib/dom.iterable.d.ts | 3 + .../dist/lib/dom.iterable.d.ts.map | 1 + .../scope-manager/dist/lib/dom.iterable.js | 321 + .../dist/lib/dom.iterable.js.map | 1 + .../scope-manager/dist/lib/dom.js | 7911 +++ .../scope-manager/dist/lib/dom.js.map | 1 + .../dist/lib/es2015.collection.d.ts | 3 + .../dist/lib/es2015.collection.d.ts.map | 1 + .../dist/lib/es2015.collection.js | 69 + .../dist/lib/es2015.collection.js.map | 1 + .../scope-manager/dist/lib/es2015.core.d.ts | 3 + .../dist/lib/es2015.core.d.ts.map | 1 + .../scope-manager/dist/lib/es2015.core.js | 81 + .../scope-manager/dist/lib/es2015.core.js.map | 1 + .../scope-manager/dist/lib/es2015.d.ts | 3 + .../scope-manager/dist/lib/es2015.d.ts.map | 1 + .../dist/lib/es2015.generator.d.ts | 3 + .../dist/lib/es2015.generator.d.ts.map | 1 + .../dist/lib/es2015.generator.js | 24 + .../dist/lib/es2015.generator.js.map | 1 + .../dist/lib/es2015.iterable.d.ts | 3 + .../dist/lib/es2015.iterable.d.ts.map | 1 + .../scope-manager/dist/lib/es2015.iterable.js | 224 + .../dist/lib/es2015.iterable.js.map | 1 + .../scope-manager/dist/lib/es2015.js | 18 + .../scope-manager/dist/lib/es2015.js.map | 1 + .../dist/lib/es2015.promise.d.ts | 3 + .../dist/lib/es2015.promise.d.ts.map | 1 + .../scope-manager/dist/lib/es2015.promise.js | 15 + .../dist/lib/es2015.promise.js.map | 1 + .../scope-manager/dist/lib/es2015.proxy.d.ts | 3 + .../dist/lib/es2015.proxy.d.ts.map | 1 + .../scope-manager/dist/lib/es2015.proxy.js | 21 + .../dist/lib/es2015.proxy.js.map | 1 + .../dist/lib/es2015.reflect.d.ts | 3 + .../dist/lib/es2015.reflect.d.ts.map | 1 + .../scope-manager/dist/lib/es2015.reflect.js | 15 + .../dist/lib/es2015.reflect.js.map | 1 + .../scope-manager/dist/lib/es2015.symbol.d.ts | 3 + .../dist/lib/es2015.symbol.d.ts.map | 1 + .../scope-manager/dist/lib/es2015.symbol.js | 15 + .../dist/lib/es2015.symbol.js.map | 1 + .../dist/lib/es2015.symbol.wellknown.d.ts | 3 + .../dist/lib/es2015.symbol.wellknown.d.ts.map | 1 + .../dist/lib/es2015.symbol.wellknown.js | 169 + .../dist/lib/es2015.symbol.wellknown.js.map | 1 + .../dist/lib/es2016.array.include.d.ts | 3 + .../dist/lib/es2016.array.include.d.ts.map | 1 + .../dist/lib/es2016.array.include.js | 75 + .../dist/lib/es2016.array.include.js.map | 1 + .../scope-manager/dist/lib/es2016.d.ts | 3 + .../scope-manager/dist/lib/es2016.d.ts.map | 1 + .../scope-manager/dist/lib/es2016.full.d.ts | 3 + .../dist/lib/es2016.full.d.ts.map | 1 + .../scope-manager/dist/lib/es2016.full.js | 13 + .../scope-manager/dist/lib/es2016.full.js.map | 1 + .../scope-manager/dist/lib/es2016.js | 10 + .../scope-manager/dist/lib/es2016.js.map | 1 + .../scope-manager/dist/lib/es2017.d.ts | 3 + .../scope-manager/dist/lib/es2017.d.ts.map | 1 + .../scope-manager/dist/lib/es2017.full.d.ts | 3 + .../dist/lib/es2017.full.d.ts.map | 1 + .../scope-manager/dist/lib/es2017.full.js | 13 + .../scope-manager/dist/lib/es2017.full.js.map | 1 + .../scope-manager/dist/lib/es2017.intl.d.ts | 3 + .../dist/lib/es2017.intl.d.ts.map | 1 + .../scope-manager/dist/lib/es2017.intl.js | 15 + .../scope-manager/dist/lib/es2017.intl.js.map | 1 + .../scope-manager/dist/lib/es2017.js | 14 + .../scope-manager/dist/lib/es2017.js.map | 1 + .../scope-manager/dist/lib/es2017.object.d.ts | 3 + .../dist/lib/es2017.object.d.ts.map | 1 + .../scope-manager/dist/lib/es2017.object.js | 15 + .../dist/lib/es2017.object.js.map | 1 + .../dist/lib/es2017.sharedmemory.d.ts | 3 + .../dist/lib/es2017.sharedmemory.d.ts.map | 1 + .../dist/lib/es2017.sharedmemory.js | 30 + .../dist/lib/es2017.sharedmemory.js.map | 1 + .../scope-manager/dist/lib/es2017.string.d.ts | 3 + .../dist/lib/es2017.string.d.ts.map | 1 + .../scope-manager/dist/lib/es2017.string.js | 15 + .../dist/lib/es2017.string.js.map | 1 + .../dist/lib/es2017.typedarrays.d.ts | 3 + .../dist/lib/es2017.typedarrays.d.ts.map | 1 + .../dist/lib/es2017.typedarrays.js | 63 + .../dist/lib/es2017.typedarrays.js.map | 1 + .../dist/lib/es2018.asyncgenerator.d.ts | 3 + .../dist/lib/es2018.asyncgenerator.d.ts.map | 1 + .../dist/lib/es2018.asyncgenerator.js | 24 + .../dist/lib/es2018.asyncgenerator.js.map | 1 + .../dist/lib/es2018.asynciterable.d.ts | 3 + .../dist/lib/es2018.asynciterable.d.ts.map | 1 + .../dist/lib/es2018.asynciterable.js | 30 + .../dist/lib/es2018.asynciterable.js.map | 1 + .../scope-manager/dist/lib/es2018.d.ts | 3 + .../scope-manager/dist/lib/es2018.d.ts.map | 1 + .../scope-manager/dist/lib/es2018.full.d.ts | 3 + .../dist/lib/es2018.full.d.ts.map | 1 + .../scope-manager/dist/lib/es2018.full.js | 13 + .../scope-manager/dist/lib/es2018.full.js.map | 1 + .../scope-manager/dist/lib/es2018.intl.d.ts | 3 + .../dist/lib/es2018.intl.d.ts.map | 1 + .../scope-manager/dist/lib/es2018.intl.js | 15 + .../scope-manager/dist/lib/es2018.intl.js.map | 1 + .../scope-manager/dist/lib/es2018.js | 14 + .../scope-manager/dist/lib/es2018.js.map | 1 + .../dist/lib/es2018.promise.d.ts | 3 + .../dist/lib/es2018.promise.d.ts.map | 1 + .../scope-manager/dist/lib/es2018.promise.js | 15 + .../dist/lib/es2018.promise.js.map | 1 + .../scope-manager/dist/lib/es2018.regexp.d.ts | 3 + .../dist/lib/es2018.regexp.d.ts.map | 1 + .../scope-manager/dist/lib/es2018.regexp.js | 27 + .../dist/lib/es2018.regexp.js.map | 1 + .../scope-manager/dist/lib/es2019.array.d.ts | 3 + .../dist/lib/es2019.array.d.ts.map | 1 + .../scope-manager/dist/lib/es2019.array.js | 27 + .../dist/lib/es2019.array.js.map | 1 + .../scope-manager/dist/lib/es2019.d.ts | 3 + .../scope-manager/dist/lib/es2019.d.ts.map | 1 + .../scope-manager/dist/lib/es2019.full.d.ts | 3 + .../dist/lib/es2019.full.d.ts.map | 1 + .../scope-manager/dist/lib/es2019.full.js | 13 + .../scope-manager/dist/lib/es2019.full.js.map | 1 + .../scope-manager/dist/lib/es2019.js | 13 + .../scope-manager/dist/lib/es2019.js.map | 1 + .../scope-manager/dist/lib/es2019.object.d.ts | 3 + .../dist/lib/es2019.object.d.ts.map | 1 + .../scope-manager/dist/lib/es2019.object.js | 14 + .../dist/lib/es2019.object.js.map | 1 + .../scope-manager/dist/lib/es2019.string.d.ts | 3 + .../dist/lib/es2019.string.d.ts.map | 1 + .../scope-manager/dist/lib/es2019.string.js | 15 + .../dist/lib/es2019.string.js.map | 1 + .../scope-manager/dist/lib/es2019.symbol.d.ts | 3 + .../dist/lib/es2019.symbol.d.ts.map | 1 + .../scope-manager/dist/lib/es2019.symbol.js | 15 + .../dist/lib/es2019.symbol.js.map | 1 + .../scope-manager/dist/lib/es2020.bigint.d.ts | 3 + .../dist/lib/es2020.bigint.d.ts.map | 1 + .../scope-manager/dist/lib/es2020.bigint.js | 63 + .../dist/lib/es2020.bigint.js.map | 1 + .../scope-manager/dist/lib/es2020.d.ts | 3 + .../scope-manager/dist/lib/es2020.d.ts.map | 1 + .../scope-manager/dist/lib/es2020.full.d.ts | 3 + .../dist/lib/es2020.full.d.ts.map | 1 + .../scope-manager/dist/lib/es2020.full.js | 13 + .../scope-manager/dist/lib/es2020.full.js.map | 1 + .../scope-manager/dist/lib/es2020.intl.d.ts | 3 + .../dist/lib/es2020.intl.d.ts.map | 1 + .../scope-manager/dist/lib/es2020.intl.js | 15 + .../scope-manager/dist/lib/es2020.intl.js.map | 1 + .../scope-manager/dist/lib/es2020.js | 14 + .../scope-manager/dist/lib/es2020.js.map | 1 + .../dist/lib/es2020.promise.d.ts | 3 + .../dist/lib/es2020.promise.d.ts.map | 1 + .../scope-manager/dist/lib/es2020.promise.js | 33 + .../dist/lib/es2020.promise.js.map | 1 + .../scope-manager/dist/lib/es2020.string.d.ts | 3 + .../dist/lib/es2020.string.d.ts.map | 1 + .../scope-manager/dist/lib/es2020.string.js | 14 + .../dist/lib/es2020.string.js.map | 1 + .../dist/lib/es2020.symbol.wellknown.d.ts | 3 + .../dist/lib/es2020.symbol.wellknown.d.ts.map | 1 + .../dist/lib/es2020.symbol.wellknown.js | 20 + .../dist/lib/es2020.symbol.wellknown.js.map | 1 + .../scope-manager/dist/lib/es5.d.ts | 3 + .../scope-manager/dist/lib/es5.d.ts.map | 1 + .../scope-manager/dist/lib/es5.js | 585 + .../scope-manager/dist/lib/es5.js.map | 1 + .../scope-manager/dist/lib/es6.d.ts | 3 + .../scope-manager/dist/lib/es6.d.ts.map | 1 + .../scope-manager/dist/lib/es6.js | 18 + .../scope-manager/dist/lib/es6.js.map | 1 + .../scope-manager/dist/lib/es7.d.ts | 3 + .../scope-manager/dist/lib/es7.d.ts.map | 1 + .../scope-manager/dist/lib/es7.js | 10 + .../scope-manager/dist/lib/es7.js.map | 1 + .../scope-manager/dist/lib/esnext.array.d.ts | 3 + .../dist/lib/esnext.array.d.ts.map | 1 + .../scope-manager/dist/lib/esnext.array.js | 27 + .../dist/lib/esnext.array.js.map | 1 + .../dist/lib/esnext.asynciterable.d.ts | 3 + .../dist/lib/esnext.asynciterable.d.ts.map | 1 + .../dist/lib/esnext.asynciterable.js | 30 + .../dist/lib/esnext.asynciterable.js.map | 1 + .../scope-manager/dist/lib/esnext.bigint.d.ts | 3 + .../dist/lib/esnext.bigint.d.ts.map | 1 + .../scope-manager/dist/lib/esnext.bigint.js | 63 + .../dist/lib/esnext.bigint.js.map | 1 + .../scope-manager/dist/lib/esnext.d.ts | 3 + .../scope-manager/dist/lib/esnext.d.ts.map | 1 + .../scope-manager/dist/lib/esnext.full.d.ts | 3 + .../dist/lib/esnext.full.d.ts.map | 1 + .../scope-manager/dist/lib/esnext.full.js | 13 + .../scope-manager/dist/lib/esnext.full.js.map | 1 + .../scope-manager/dist/lib/esnext.intl.d.ts | 3 + .../dist/lib/esnext.intl.d.ts.map | 1 + .../scope-manager/dist/lib/esnext.intl.js | 15 + .../scope-manager/dist/lib/esnext.intl.js.map | 1 + .../scope-manager/dist/lib/esnext.js | 12 + .../scope-manager/dist/lib/esnext.js.map | 1 + .../dist/lib/esnext.promise.d.ts | 3 + .../dist/lib/esnext.promise.d.ts.map | 1 + .../scope-manager/dist/lib/esnext.promise.js | 27 + .../dist/lib/esnext.promise.js.map | 1 + .../scope-manager/dist/lib/esnext.string.d.ts | 3 + .../dist/lib/esnext.string.d.ts.map | 1 + .../scope-manager/dist/lib/esnext.string.js | 15 + .../dist/lib/esnext.string.js.map | 1 + .../scope-manager/dist/lib/esnext.symbol.d.ts | 3 + .../dist/lib/esnext.symbol.d.ts.map | 1 + .../scope-manager/dist/lib/esnext.symbol.js | 15 + .../dist/lib/esnext.symbol.js.map | 1 + .../scope-manager/dist/lib/index.d.ts | 62 + .../scope-manager/dist/lib/index.d.ts.map | 1 + .../scope-manager/dist/lib/index.js | 126 + .../scope-manager/dist/lib/index.js.map | 1 + .../scope-manager/dist/lib/lib.d.ts | 3 + .../scope-manager/dist/lib/lib.d.ts.map | 1 + .../scope-manager/dist/lib/lib.js | 12 + .../scope-manager/dist/lib/lib.js.map | 1 + .../scope-manager/dist/lib/scripthost.d.ts | 3 + .../dist/lib/scripthost.d.ts.map | 1 + .../scope-manager/dist/lib/scripthost.js | 87 + .../scope-manager/dist/lib/scripthost.js.map | 1 + .../scope-manager/dist/lib/webworker.d.ts | 3 + .../scope-manager/dist/lib/webworker.d.ts.map | 1 + .../dist/lib/webworker.importscripts.d.ts | 3 + .../dist/lib/webworker.importscripts.d.ts.map | 1 + .../dist/lib/webworker.importscripts.js | 8 + .../dist/lib/webworker.importscripts.js.map | 1 + .../scope-manager/dist/lib/webworker.js | 2475 + .../scope-manager/dist/lib/webworker.js.map | 1 + .../dist/referencer/ExportVisitor.d.ts | 15 + .../dist/referencer/ExportVisitor.d.ts.map | 1 + .../dist/referencer/ExportVisitor.js | 75 + .../dist/referencer/ExportVisitor.js.map | 1 + .../dist/referencer/ImportVisitor.d.ts | 14 + .../dist/referencer/ImportVisitor.d.ts.map | 1 + .../dist/referencer/ImportVisitor.js | 51 + .../dist/referencer/ImportVisitor.js.map | 1 + .../dist/referencer/PatternVisitor.d.ts | 28 + .../dist/referencer/PatternVisitor.d.ts.map | 1 + .../dist/referencer/PatternVisitor.js | 113 + .../dist/referencer/PatternVisitor.js.map | 1 + .../dist/referencer/Reference.d.ts | 89 + .../dist/referencer/Reference.d.ts.map | 1 + .../dist/referencer/Reference.js | 111 + .../dist/referencer/Reference.js.map | 1 + .../dist/referencer/Referencer.d.ts | 87 + .../dist/referencer/Referencer.d.ts.map | 1 + .../dist/referencer/Referencer.js | 569 + .../dist/referencer/Referencer.js.map | 1 + .../dist/referencer/TypeVisitor.d.ts | 31 + .../dist/referencer/TypeVisitor.d.ts.map | 1 + .../dist/referencer/TypeVisitor.js | 209 + .../dist/referencer/TypeVisitor.js.map | 1 + .../dist/referencer/Visitor.d.ts | 13 + .../dist/referencer/Visitor.d.ts.map | 1 + .../scope-manager/dist/referencer/Visitor.js | 41 + .../dist/referencer/Visitor.js.map | 1 + .../dist/referencer/VisitorBase.d.ts | 21 + .../dist/referencer/VisitorBase.d.ts.map | 1 + .../dist/referencer/VisitorBase.js | 79 + .../dist/referencer/VisitorBase.js.map | 1 + .../scope-manager/dist/referencer/index.d.ts | 2 + .../dist/referencer/index.d.ts.map | 1 + .../scope-manager/dist/referencer/index.js | 6 + .../dist/referencer/index.js.map | 1 + .../scope-manager/dist/scope/BlockScope.d.ts | 10 + .../dist/scope/BlockScope.d.ts.map | 1 + .../scope-manager/dist/scope/BlockScope.js | 12 + .../dist/scope/BlockScope.js.map | 1 + .../scope-manager/dist/scope/CatchScope.d.ts | 10 + .../dist/scope/CatchScope.d.ts.map | 1 + .../scope-manager/dist/scope/CatchScope.js | 12 + .../dist/scope/CatchScope.js.map | 1 + .../scope-manager/dist/scope/ClassScope.d.ts | 10 + .../dist/scope/ClassScope.d.ts.map | 1 + .../scope-manager/dist/scope/ClassScope.js | 12 + .../dist/scope/ClassScope.js.map | 1 + .../dist/scope/ConditionalTypeScope.d.ts | 10 + .../dist/scope/ConditionalTypeScope.d.ts.map | 1 + .../dist/scope/ConditionalTypeScope.js | 12 + .../dist/scope/ConditionalTypeScope.js.map | 1 + .../scope-manager/dist/scope/ForScope.d.ts | 10 + .../dist/scope/ForScope.d.ts.map | 1 + .../scope-manager/dist/scope/ForScope.js | 12 + .../scope-manager/dist/scope/ForScope.js.map | 1 + .../scope/FunctionExpressionNameScope.d.ts | 11 + .../FunctionExpressionNameScope.d.ts.map | 1 + .../dist/scope/FunctionExpressionNameScope.js | 17 + .../scope/FunctionExpressionNameScope.js.map | 1 + .../dist/scope/FunctionScope.d.ts | 13 + .../dist/scope/FunctionScope.d.ts.map | 1 + .../scope-manager/dist/scope/FunctionScope.js | 37 + .../dist/scope/FunctionScope.js.map | 1 + .../dist/scope/FunctionTypeScope.d.ts | 10 + .../dist/scope/FunctionTypeScope.d.ts.map | 1 + .../dist/scope/FunctionTypeScope.js | 12 + .../dist/scope/FunctionTypeScope.js.map | 1 + .../scope-manager/dist/scope/GlobalScope.d.ts | 18 + .../dist/scope/GlobalScope.d.ts.map | 1 + .../scope-manager/dist/scope/GlobalScope.js | 39 + .../dist/scope/GlobalScope.js.map | 1 + .../dist/scope/MappedTypeScope.d.ts | 10 + .../dist/scope/MappedTypeScope.d.ts.map | 1 + .../dist/scope/MappedTypeScope.js | 12 + .../dist/scope/MappedTypeScope.js.map | 1 + .../scope-manager/dist/scope/ModuleScope.d.ts | 10 + .../dist/scope/ModuleScope.d.ts.map | 1 + .../scope-manager/dist/scope/ModuleScope.js | 12 + .../dist/scope/ModuleScope.js.map | 1 + .../scope-manager/dist/scope/Scope.d.ts | 19 + .../scope-manager/dist/scope/Scope.d.ts.map | 1 + .../scope-manager/dist/scope/Scope.js | 3 + .../scope-manager/dist/scope/Scope.js.map | 1 + .../scope-manager/dist/scope/ScopeBase.d.ts | 106 + .../dist/scope/ScopeBase.d.ts.map | 1 + .../scope-manager/dist/scope/ScopeBase.js | 369 + .../scope-manager/dist/scope/ScopeBase.js.map | 1 + .../scope-manager/dist/scope/ScopeType.d.ts | 20 + .../dist/scope/ScopeType.d.ts.map | 1 + .../scope-manager/dist/scope/ScopeType.js | 24 + .../scope-manager/dist/scope/ScopeType.js.map | 1 + .../scope-manager/dist/scope/SwitchScope.d.ts | 10 + .../dist/scope/SwitchScope.d.ts.map | 1 + .../scope-manager/dist/scope/SwitchScope.js | 12 + .../dist/scope/SwitchScope.js.map | 1 + .../scope-manager/dist/scope/TSEnumScope.d.ts | 10 + .../dist/scope/TSEnumScope.d.ts.map | 1 + .../scope-manager/dist/scope/TSEnumScope.js | 12 + .../dist/scope/TSEnumScope.js.map | 1 + .../dist/scope/TSModuleScope.d.ts | 10 + .../dist/scope/TSModuleScope.d.ts.map | 1 + .../scope-manager/dist/scope/TSModuleScope.js | 12 + .../dist/scope/TSModuleScope.js.map | 1 + .../scope-manager/dist/scope/TypeScope.d.ts | 10 + .../dist/scope/TypeScope.d.ts.map | 1 + .../scope-manager/dist/scope/TypeScope.js | 12 + .../scope-manager/dist/scope/TypeScope.js.map | 1 + .../scope-manager/dist/scope/WithScope.d.ts | 11 + .../dist/scope/WithScope.d.ts.map | 1 + .../scope-manager/dist/scope/WithScope.js | 25 + .../scope-manager/dist/scope/WithScope.js.map | 1 + .../scope-manager/dist/scope/index.d.ts | 19 + .../scope-manager/dist/scope/index.d.ts.map | 1 + .../scope-manager/dist/scope/index.js | 31 + .../scope-manager/dist/scope/index.js.map | 1 + .../dist/variable/ESLintScopeVariable.d.ts | 34 + .../variable/ESLintScopeVariable.d.ts.map | 1 + .../dist/variable/ESLintScopeVariable.js | 12 + .../dist/variable/ESLintScopeVariable.js.map | 1 + .../dist/variable/ImplicitLibVariable.d.ts | 26 + .../variable/ImplicitLibVariable.d.ts.map | 1 + .../dist/variable/ImplicitLibVariable.js | 18 + .../dist/variable/ImplicitLibVariable.js.map | 1 + .../scope-manager/dist/variable/Variable.d.ts | 18 + .../dist/variable/Variable.d.ts.map | 1 + .../scope-manager/dist/variable/Variable.js | 33 + .../dist/variable/Variable.js.map | 1 + .../dist/variable/VariableBase.d.ts | 44 + .../dist/variable/VariableBase.d.ts.map | 1 + .../dist/variable/VariableBase.js | 39 + .../dist/variable/VariableBase.js.map | 1 + .../scope-manager/dist/variable/index.d.ts | 4 + .../dist/variable/index.d.ts.map | 1 + .../scope-manager/dist/variable/index.js | 10 + .../scope-manager/dist/variable/index.js.map | 1 + .../scope-manager/package.json | 68 + .../@typescript-eslint/types/CHANGELOG.md | 140 + node_modules/@typescript-eslint/types/LICENSE | 21 + .../@typescript-eslint/types/README.md | 17 + .../types/dist/ast-node-types.d.ts | 165 + .../types/dist/ast-node-types.d.ts.map | 1 + .../types/dist/ast-node-types.js | 169 + .../types/dist/ast-node-types.js.map | 1 + .../types/dist/ast-token-types.d.ts | 17 + .../types/dist/ast-token-types.d.ts.map | 1 + .../types/dist/ast-token-types.js | 22 + .../types/dist/ast-token-types.js.map | 1 + .../@typescript-eslint/types/dist/index.d.ts | 7 + .../types/dist/index.d.ts.map | 1 + .../@typescript-eslint/types/dist/index.js | 36 + .../types/dist/index.js.map | 1 + .../@typescript-eslint/types/dist/lib.d.ts | 3 + .../types/dist/lib.d.ts.map | 1 + .../@typescript-eslint/types/dist/lib.js | 6 + .../@typescript-eslint/types/dist/lib.js.map | 1 + .../types/dist/parser-options.d.ts | 31 + .../types/dist/parser-options.d.ts.map | 1 + .../types/dist/parser-options.js | 3 + .../types/dist/parser-options.js.map | 1 + .../types/dist/ts-estree.d.ts | 1070 + .../types/dist/ts-estree.d.ts.map | 1 + .../types/dist/ts-estree.js | 3 + .../types/dist/ts-estree.js.map | 1 + .../@typescript-eslint/types/package.json | 52 + .../typescript-estree/CHANGELOG.md | 925 + .../typescript-estree/LICENSE | 26 + .../typescript-estree/README.md | 287 + .../typescript-estree/dist/ast-converter.d.ts | 9 + .../dist/ast-converter.d.ts.map | 1 + .../typescript-estree/dist/ast-converter.js | 63 + .../dist/ast-converter.js.map | 1 + .../dist/convert-comments.d.ts | 11 + .../dist/convert-comments.d.ts.map | 1 + .../dist/convert-comments.js | 59 + .../dist/convert-comments.js.map | 1 + .../typescript-estree/dist/convert.d.ts | 152 + .../typescript-estree/dist/convert.d.ts.map | 1 + .../typescript-estree/dist/convert.js | 2206 + .../typescript-estree/dist/convert.js.map | 1 + .../WatchCompilerHostOfConfigFile.d.ts | 13 + .../WatchCompilerHostOfConfigFile.d.ts.map | 1 + .../WatchCompilerHostOfConfigFile.js | 6 + .../WatchCompilerHostOfConfigFile.js.map | 1 + .../create-program/createDefaultProgram.d.ts | 12 + .../createDefaultProgram.d.ts.map | 1 + .../create-program/createDefaultProgram.js | 59 + .../createDefaultProgram.js.map | 1 + .../create-program/createIsolatedProgram.d.ts | 9 + .../createIsolatedProgram.d.ts.map | 1 + .../create-program/createIsolatedProgram.js | 78 + .../createIsolatedProgram.js.map | 1 + .../create-program/createProjectProgram.d.ts | 11 + .../createProjectProgram.d.ts.map | 1 + .../create-program/createProjectProgram.js | 75 + .../createProjectProgram.js.map | 1 + .../dist/create-program/createSourceFile.d.ts | 5 + .../create-program/createSourceFile.d.ts.map | 1 + .../dist/create-program/createSourceFile.js | 36 + .../create-program/createSourceFile.js.map | 1 + .../create-program/createWatchProgram.d.ts | 19 + .../createWatchProgram.d.ts.map | 1 + .../dist/create-program/createWatchProgram.js | 388 + .../create-program/createWatchProgram.js.map | 1 + .../dist/create-program/shared.d.ts | 17 + .../dist/create-program/shared.d.ts.map | 1 + .../dist/create-program/shared.js | 98 + .../dist/create-program/shared.js.map | 1 + .../typescript-estree/dist/index.d.ts | 8 + .../typescript-estree/dist/index.d.ts.map | 1 + .../typescript-estree/dist/index.js | 27 + .../typescript-estree/dist/index.js.map | 1 + .../typescript-estree/dist/node-utils.d.ts | 282 + .../dist/node-utils.d.ts.map | 1 + .../typescript-estree/dist/node-utils.js | 543 + .../typescript-estree/dist/node-utils.js.map | 1 + .../dist/parser-options.d.ts | 150 + .../dist/parser-options.d.ts.map | 1 + .../typescript-estree/dist/parser-options.js | 3 + .../dist/parser-options.js.map | 1 + .../typescript-estree/dist/parser.d.ts | 17 + .../typescript-estree/dist/parser.d.ts.map | 1 + .../typescript-estree/dist/parser.js | 380 + .../typescript-estree/dist/parser.js.map | 1 + .../dist/semantic-or-syntactic-errors.d.ts | 14 + .../semantic-or-syntactic-errors.d.ts.map | 1 + .../dist/semantic-or-syntactic-errors.js | 112 + .../dist/semantic-or-syntactic-errors.js.map | 1 + .../dist/simple-traverse.d.ts | 9 + .../dist/simple-traverse.d.ts.map | 1 + .../typescript-estree/dist/simple-traverse.js | 53 + .../dist/simple-traverse.js.map | 1 + .../ts-estree/estree-to-ts-node-types.d.ts | 169 + .../estree-to-ts-node-types.d.ts.map | 1 + .../dist/ts-estree/estree-to-ts-node-types.js | 4 + .../ts-estree/estree-to-ts-node-types.js.map | 1 + .../dist/ts-estree/index.d.ts | 4 + .../dist/ts-estree/index.d.ts.map | 1 + .../typescript-estree/dist/ts-estree/index.js | 21 + .../dist/ts-estree/index.js.map | 1 + .../dist/ts-estree/ts-nodes.d.ts | 8 + .../dist/ts-estree/ts-nodes.d.ts.map | 1 + .../dist/ts-estree/ts-nodes.js | 3 + .../dist/ts-estree/ts-nodes.js.map | 1 + .../typescript-estree/dist/version-check.d.ts | 3 + .../dist/version-check.d.ts.map | 1 + .../typescript-estree/dist/version-check.js | 42 + .../dist/version-check.js.map | 1 + .../node_modules/globby/gitignore.js | 118 + .../node_modules/globby/index.d.ts | 176 + .../node_modules/globby/index.js | 177 + .../node_modules/globby/license | 9 + .../node_modules/globby/package.json | 82 + .../node_modules/globby/readme.md | 170 + .../node_modules/globby/stream-utils.js | 46 + .../node_modules}/tsutils/.editorconfig | 0 .../node_modules}/tsutils/.fimbullinter.yaml | 0 .../node_modules}/tsutils/.wotanrc.yaml | 0 .../node_modules/tsutils/CHANGELOG.md | 741 + .../node_modules}/tsutils/LICENSE | 0 .../node_modules/tsutils/README.md | 61 + .../node_modules}/tsutils/index.d.ts | 0 .../node_modules/tsutils/index.js | 5 + .../node_modules/tsutils/package.json | 61 + .../tsutils/typeguard/2.8/index.d.ts | 0 .../tsutils/typeguard/2.8/index.js | 5 + .../tsutils/typeguard/2.8/node.d.ts | 155 + .../tsutils/typeguard/2.8/node.js | 709 + .../tsutils/typeguard/2.8/type.d.ts | 0 .../tsutils/typeguard/2.8/type.js | 75 + .../tsutils/typeguard/2.9/index.d.ts | 0 .../tsutils/typeguard/2.9/index.js | 5 + .../tsutils/typeguard/2.9/node.d.ts | 0 .../tsutils/typeguard/2.9/node.js | 9 + .../tsutils/typeguard/2.9/type.d.ts | 0 .../tsutils/typeguard/2.9/type.js | 4 + .../tsutils/typeguard/3.0/index.d.ts | 0 .../tsutils/typeguard/3.0/index.js | 5 + .../tsutils/typeguard/3.0/node.d.ts | 0 .../tsutils/typeguard/3.0/node.js | 17 + .../tsutils/typeguard/3.0/type.d.ts | 6 + .../tsutils/typeguard/3.0/type.js | 14 + .../tsutils/typeguard/3.2}/index.d.ts | 0 .../tsutils/typeguard/3.2/index.js | 5 + .../tsutils/typeguard/3.2/node.d.ts | 3 + .../tsutils/typeguard/3.2/node.js | 9 + .../tsutils/typeguard/3.2}/type.d.ts | 0 .../tsutils/typeguard/3.2/type.js | 4 + .../tsutils/typeguard}/index.d.ts | 0 .../node_modules/tsutils/typeguard/index.js | 5 + .../tsutils/typeguard/next/index.d.ts | 2 + .../tsutils/typeguard/next/index.js | 5 + .../tsutils/typeguard/next/node.d.ts | 1 + .../tsutils/typeguard/next/node.js | 4 + .../tsutils/typeguard/next/type.d.ts | 1 + .../tsutils/typeguard/next/type.js | 4 + .../node_modules/tsutils/typeguard/node.d.ts | 1 + .../node_modules/tsutils/typeguard/node.js | 4 + .../node_modules/tsutils/typeguard/type.d.ts | 1 + .../node_modules/tsutils/typeguard/type.js | 4 + .../tsutils/util/control-flow.d.ts | 1 - .../node_modules/tsutils/util/control-flow.js | 171 + .../tsutils/util/convert-ast.d.ts | 1 + .../node_modules/tsutils/util/convert-ast.js | 47 + .../node_modules}/tsutils/util/index.d.ts | 0 .../node_modules/tsutils/util/index.js | 8 + .../node_modules/tsutils/util/type.d.ts | 21 + .../node_modules/tsutils/util/type.js | 238 + .../node_modules}/tsutils/util/usage.d.ts | 4 +- .../node_modules/tsutils/util/usage.js | 645 + .../node_modules/tsutils/util/util.d.ts | 167 + .../node_modules/tsutils/util/util.js | 1422 + .../typescript-estree/package.json | 88 + .../visitor-keys/CHANGELOG.md | 124 + .../@typescript-eslint/visitor-keys/LICENSE | 21 + .../@typescript-eslint/visitor-keys/README.md | 13 + .../visitor-keys/dist/get-keys.d.ts | 4 + .../visitor-keys/dist/get-keys.d.ts.map | 1 + .../visitor-keys/dist/get-keys.js | 7 + .../visitor-keys/dist/get-keys.js.map | 1 + .../visitor-keys/dist/index.d.ts | 3 + .../visitor-keys/dist/index.d.ts.map | 1 + .../visitor-keys/dist/index.js | 8 + .../visitor-keys/dist/index.js.map | 1 + .../visitor-keys/dist/visitor-keys.d.ts | 6 + .../visitor-keys/dist/visitor-keys.d.ts.map | 1 + .../visitor-keys/dist/visitor-keys.js | 149 + .../visitor-keys/dist/visitor-keys.js.map | 1 + .../visitor-keys/package.json | 59 + node_modules/acorn-jsx/LICENSE | 19 + node_modules/acorn-jsx/README.md | 40 + node_modules/acorn-jsx/index.js | 488 + node_modules/acorn-jsx/package.json | 27 + node_modules/acorn-jsx/xhtml.js | 255 + node_modules/ajv/.tonic_example.js | 20 + node_modules/ajv/LICENSE | 22 + node_modules/ajv/README.md | 1477 + node_modules/ajv/dist/ajv.bundle.js | 7189 ++ node_modules/ajv/dist/ajv.min.js | 3 + node_modules/ajv/dist/ajv.min.js.map | 1 + node_modules/ajv/lib/ajv.d.ts | 396 + node_modules/ajv/lib/ajv.js | 506 + node_modules/ajv/lib/cache.js | 26 + node_modules/ajv/lib/compile/async.js | 90 + node_modules/ajv/lib/compile/equal.js | 5 + node_modules/ajv/lib/compile/error_classes.js | 34 + node_modules/ajv/lib/compile/formats.js | 142 + node_modules/ajv/lib/compile/index.js | 387 + node_modules/ajv/lib/compile/resolve.js | 270 + node_modules/ajv/lib/compile/rules.js | 66 + node_modules/ajv/lib/compile/schema_obj.js | 9 + node_modules/ajv/lib/compile/ucs2length.js | 20 + node_modules/ajv/lib/compile/util.js | 239 + node_modules/ajv/lib/data.js | 49 + node_modules/ajv/lib/definition_schema.js | 37 + node_modules/ajv/lib/dot/_limit.jst | 113 + node_modules/ajv/lib/dot/_limitItems.jst | 12 + node_modules/ajv/lib/dot/_limitLength.jst | 12 + node_modules/ajv/lib/dot/_limitProperties.jst | 12 + node_modules/ajv/lib/dot/allOf.jst | 32 + node_modules/ajv/lib/dot/anyOf.jst | 46 + node_modules/ajv/lib/dot/coerce.def | 51 + node_modules/ajv/lib/dot/comment.jst | 9 + node_modules/ajv/lib/dot/const.jst | 11 + node_modules/ajv/lib/dot/contains.jst | 55 + node_modules/ajv/lib/dot/custom.jst | 191 + node_modules/ajv/lib/dot/defaults.def | 47 + node_modules/ajv/lib/dot/definitions.def | 203 + node_modules/ajv/lib/dot/dependencies.jst | 79 + node_modules/ajv/lib/dot/enum.jst | 30 + node_modules/ajv/lib/dot/errors.def | 194 + node_modules/ajv/lib/dot/format.jst | 106 + node_modules/ajv/lib/dot/if.jst | 73 + node_modules/ajv/lib/dot/items.jst | 98 + node_modules/ajv/lib/dot/missing.def | 39 + node_modules/ajv/lib/dot/multipleOf.jst | 22 + node_modules/ajv/lib/dot/not.jst | 43 + node_modules/ajv/lib/dot/oneOf.jst | 54 + node_modules/ajv/lib/dot/pattern.jst | 14 + node_modules/ajv/lib/dot/properties.jst | 245 + node_modules/ajv/lib/dot/propertyNames.jst | 52 + node_modules/ajv/lib/dot/ref.jst | 85 + node_modules/ajv/lib/dot/required.jst | 108 + node_modules/ajv/lib/dot/uniqueItems.jst | 62 + node_modules/ajv/lib/dot/validate.jst | 276 + node_modules/ajv/lib/dotjs/README.md | 3 + node_modules/ajv/lib/dotjs/_limit.js | 163 + node_modules/ajv/lib/dotjs/_limitItems.js | 80 + node_modules/ajv/lib/dotjs/_limitLength.js | 85 + .../ajv/lib/dotjs/_limitProperties.js | 80 + node_modules/ajv/lib/dotjs/allOf.js | 42 + node_modules/ajv/lib/dotjs/anyOf.js | 73 + node_modules/ajv/lib/dotjs/comment.js | 14 + node_modules/ajv/lib/dotjs/const.js | 56 + node_modules/ajv/lib/dotjs/contains.js | 81 + node_modules/ajv/lib/dotjs/custom.js | 228 + node_modules/ajv/lib/dotjs/dependencies.js | 168 + node_modules/ajv/lib/dotjs/enum.js | 66 + node_modules/ajv/lib/dotjs/format.js | 150 + node_modules/ajv/lib/dotjs/if.js | 103 + node_modules/ajv/lib/dotjs/index.js | 33 + node_modules/ajv/lib/dotjs/items.js | 140 + node_modules/ajv/lib/dotjs/multipleOf.js | 80 + node_modules/ajv/lib/dotjs/not.js | 84 + node_modules/ajv/lib/dotjs/oneOf.js | 73 + node_modules/ajv/lib/dotjs/pattern.js | 75 + node_modules/ajv/lib/dotjs/properties.js | 335 + node_modules/ajv/lib/dotjs/propertyNames.js | 81 + node_modules/ajv/lib/dotjs/ref.js | 124 + node_modules/ajv/lib/dotjs/required.js | 270 + node_modules/ajv/lib/dotjs/uniqueItems.js | 86 + node_modules/ajv/lib/dotjs/validate.js | 482 + node_modules/ajv/lib/keyword.js | 146 + node_modules/ajv/lib/refs/data.json | 17 + .../ajv/lib/refs/json-schema-draft-04.json | 149 + .../ajv/lib/refs/json-schema-draft-06.json | 154 + .../ajv/lib/refs/json-schema-draft-07.json | 168 + .../ajv/lib/refs/json-schema-secure.json | 94 + node_modules/ajv/package.json | 106 + node_modules/ajv/scripts/.eslintrc.yml | 3 + node_modules/ajv/scripts/bundle.js | 61 + node_modules/ajv/scripts/compile-dots.js | 73 + node_modules/ajv/scripts/info | 10 + node_modules/ajv/scripts/prepare-tests | 12 + .../ajv/scripts/publish-built-version | 32 + node_modules/ajv/scripts/travis-gh-pages | 23 + node_modules/ansi-colors/LICENSE | 21 + node_modules/ansi-colors/README.md | 315 + node_modules/ansi-colors/index.js | 177 + node_modules/ansi-colors/package.json | 109 + node_modules/ansi-colors/symbols.js | 70 + node_modules/ansi-colors/types/index.d.ts | 161 + node_modules/array-includes/.editorconfig | 13 + node_modules/array-includes/.eslintrc | 22 + .../array-includes/.github/FUNDING.yml | 12 + .../.github/workflows/rebase.yml | 15 + node_modules/array-includes/.travis.yml | 12 + node_modules/array-includes/CHANGELOG.md | 101 + node_modules/array-includes/LICENSE | 21 + node_modules/array-includes/README.md | 94 + node_modules/array-includes/auto.js | 3 + node_modules/array-includes/implementation.js | 35 + node_modules/array-includes/index.js | 26 + node_modules/array-includes/package.json | 89 + node_modules/array-includes/polyfill.js | 7 + node_modules/array-includes/shim.js | 14 + node_modules/array-includes/test.html | 14606 +++++ node_modules/array-includes/test/index.js | 17 + node_modules/array-includes/test/shimmed.js | 36 + node_modules/array-includes/test/tests.js | 94 + .../array.prototype.flat/.editorconfig | 20 + node_modules/array.prototype.flat/.eslintrc | 40 + .../array.prototype.flat/.github/FUNDING.yml | 12 + .../.github/workflows/rebase.yml | 15 + node_modules/array.prototype.flat/.nycrc | 13 + node_modules/array.prototype.flat/.travis.yml | 9 + .../array.prototype.flat/CHANGELOG.md | 53 + node_modules/array.prototype.flat/LICENSE | 21 + node_modules/array.prototype.flat/README.md | 72 + node_modules/array.prototype.flat/auto.js | 3 + .../array.prototype.flat/implementation.js | 22 + node_modules/array.prototype.flat/index.js | 19 + .../array.prototype.flat/package.json | 96 + node_modules/array.prototype.flat/polyfill.js | 7 + node_modules/array.prototype.flat/shim.js | 14 + .../array.prototype.flat/test/index.js | 17 + .../array.prototype.flat/test/shimmed.js | 36 + .../array.prototype.flat/test/tests.js | 30 + node_modules/astral-regex/index.js | 4 + node_modules/astral-regex/license | 9 + node_modules/astral-regex/package.json | 32 + node_modules/astral-regex/readme.md | 43 + .../builtin-modules/builtin-modules.json | 35 - node_modules/builtin-modules/index.js | 10 - node_modules/builtin-modules/package.json | 40 - node_modules/builtin-modules/readme.md | 41 - node_modules/builtin-modules/static.js | 2 - node_modules/contains-path/LICENSE | 21 + node_modules/contains-path/README.md | 83 + node_modules/contains-path/index.js | 33 + node_modules/contains-path/package.json | 55 + node_modules/deep-is/.npmignore | 1 + node_modules/deep-is/.travis.yml | 6 + node_modules/deep-is/LICENSE | 22 + node_modules/deep-is/README.markdown | 70 + node_modules/deep-is/example/cmp.js | 11 + node_modules/deep-is/index.js | 102 + node_modules/deep-is/package.json | 61 + node_modules/deep-is/test/NaN.js | 16 + node_modules/deep-is/test/cmp.js | 23 + node_modules/deep-is/test/neg-vs-pos-0.js | 15 + node_modules/define-properties/.editorconfig | 13 + node_modules/define-properties/.eslintrc | 12 + node_modules/define-properties/.jscs.json | 175 + node_modules/define-properties/.travis.yml | 233 + node_modules/define-properties/CHANGELOG.md | 44 + node_modules/define-properties/LICENSE | 21 + node_modules/define-properties/README.md | 86 + node_modules/define-properties/index.js | 58 + node_modules/define-properties/package.json | 65 + node_modules/define-properties/test/index.js | 125 + node_modules/doctrine/README.md | 174 - node_modules/doctrine/lib/doctrine.js | 833 - node_modules/doctrine/lib/typed.js | 1261 - node_modules/doctrine/lib/utility.js | 54 - .../doctrine/node_modules/esutils/README.md | 169 - .../doctrine/node_modules/esutils/lib/ast.js | 144 - .../doctrine/node_modules/esutils/lib/code.js | 101 - .../node_modules/esutils/lib/keyword.js | 137 - .../node_modules/esutils/lib/utils.js | 33 - .../node_modules/esutils/package.json | 49 - node_modules/doctrine/package.json | 69 - node_modules/enquirer/CHANGELOG.md | 135 + node_modules/enquirer/LICENSE | 21 + node_modules/enquirer/README.md | 1752 + node_modules/enquirer/index.d.ts | 151 + node_modules/enquirer/index.js | 250 + node_modules/enquirer/lib/ansi.js | 116 + node_modules/enquirer/lib/combos.js | 75 + node_modules/enquirer/lib/completer.js | 52 + node_modules/enquirer/lib/interpolate.js | 266 + node_modules/enquirer/lib/keypress.js | 243 + node_modules/enquirer/lib/placeholder.js | 63 + node_modules/enquirer/lib/prompt.js | 485 + .../enquirer/lib/prompts/autocomplete.js | 113 + .../enquirer/lib/prompts/basicauth.js | 41 + node_modules/enquirer/lib/prompts/confirm.js | 13 + node_modules/enquirer/lib/prompts/editable.js | 136 + node_modules/enquirer/lib/prompts/form.js | 196 + node_modules/enquirer/lib/prompts/index.js | 28 + node_modules/enquirer/lib/prompts/input.js | 55 + .../enquirer/lib/prompts/invisible.js | 11 + node_modules/enquirer/lib/prompts/list.js | 36 + .../enquirer/lib/prompts/multiselect.js | 11 + node_modules/enquirer/lib/prompts/numeral.js | 1 + node_modules/enquirer/lib/prompts/password.js | 18 + node_modules/enquirer/lib/prompts/quiz.js | 37 + node_modules/enquirer/lib/prompts/scale.js | 237 + node_modules/enquirer/lib/prompts/select.js | 139 + node_modules/enquirer/lib/prompts/snippet.js | 185 + node_modules/enquirer/lib/prompts/sort.js | 37 + node_modules/enquirer/lib/prompts/survey.js | 163 + node_modules/enquirer/lib/prompts/text.js | 1 + node_modules/enquirer/lib/prompts/toggle.js | 109 + node_modules/enquirer/lib/render.js | 33 + node_modules/enquirer/lib/roles.js | 46 + node_modules/enquirer/lib/state.js | 69 + node_modules/enquirer/lib/styles.js | 144 + node_modules/enquirer/lib/symbols.js | 66 + node_modules/enquirer/lib/theme.js | 11 + node_modules/enquirer/lib/timer.js | 38 + node_modules/enquirer/lib/types/array.js | 658 + node_modules/enquirer/lib/types/auth.js | 29 + node_modules/enquirer/lib/types/boolean.js | 88 + node_modules/enquirer/lib/types/index.js | 7 + node_modules/enquirer/lib/types/number.js | 86 + node_modules/enquirer/lib/types/string.js | 185 + node_modules/enquirer/lib/utils.js | 268 + node_modules/enquirer/package.json | 111 + node_modules/es-abstract/.editorconfig | 13 + node_modules/es-abstract/.eslintignore | 1 + node_modules/es-abstract/.eslintrc | 66 + node_modules/es-abstract/.gitattributes | 472 + node_modules/es-abstract/.github/FUNDING.yml | 12 + .../.github/workflows/codeql-analysis.yml | 52 + .../es-abstract/.github/workflows/rebase.yml | 15 + node_modules/es-abstract/.nycrc | 14 + node_modules/es-abstract/.travis.yml | 32 + .../2015/AbstractEqualityComparison.js | 37 + .../2015/AbstractRelationalComparison.js | 66 + .../es-abstract/2015/AdvanceStringIndex.js | 45 + node_modules/es-abstract/2015/ArrayCreate.js | 53 + .../es-abstract/2015/ArraySetLength.js | 85 + .../es-abstract/2015/ArraySpeciesCreate.js | 46 + node_modules/es-abstract/2015/Call.js | 13 + .../2015/CanonicalNumericIndexString.js | 22 + .../2015/CompletePropertyDescriptor.js | 39 + .../es-abstract/2015/CreateDataProperty.js | 45 + .../2015/CreateDataPropertyOrThrow.js | 25 + node_modules/es-abstract/2015/CreateHTML.js | 30 + .../2015/CreateIterResultObject.js | 19 + .../2015/CreateListFromArrayLike.js | 43 + .../es-abstract/2015/CreateMethodProperty.js | 40 + node_modules/es-abstract/2015/DateFromTime.js | 54 + node_modules/es-abstract/2015/Day.js | 13 + node_modules/es-abstract/2015/DayFromYear.js | 12 + .../es-abstract/2015/DayWithinYear.js | 11 + node_modules/es-abstract/2015/DaysInYear.js | 18 + .../es-abstract/2015/DefinePropertyOrThrow.js | 50 + .../es-abstract/2015/DeletePropertyOrThrow.js | 27 + .../es-abstract/2015/EnumerableOwnNames.js | 19 + .../2015/FromPropertyDescriptor.js | 36 + node_modules/es-abstract/2015/Get.js | 30 + node_modules/es-abstract/2015/GetIterator.js | 35 + node_modules/es-abstract/2015/GetMethod.js | 42 + .../es-abstract/2015/GetOwnPropertyKeys.js | 31 + .../2015/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2015/GetSubstitution.js | 104 + node_modules/es-abstract/2015/GetV.js | 29 + .../es-abstract/2015/HasOwnProperty.js | 22 + node_modules/es-abstract/2015/HasProperty.js | 20 + node_modules/es-abstract/2015/HourFromTime.js | 16 + node_modules/es-abstract/2015/InLeapYear.js | 21 + .../es-abstract/2015/InstanceofOperator.js | 30 + node_modules/es-abstract/2015/Invoke.js | 22 + .../es-abstract/2015/IsAccessorDescriptor.js | 23 + node_modules/es-abstract/2015/IsArray.js | 14 + node_modules/es-abstract/2015/IsCallable.js | 5 + .../es-abstract/2015/IsConcatSpreadable.js | 25 + .../es-abstract/2015/IsConstructor.js | 40 + .../es-abstract/2015/IsDataDescriptor.js | 23 + node_modules/es-abstract/2015/IsExtensible.js | 20 + .../es-abstract/2015/IsGenericDescriptor.js | 23 + node_modules/es-abstract/2015/IsInteger.js | 21 + node_modules/es-abstract/2015/IsPromise.js | 24 + .../es-abstract/2015/IsPropertyDescriptor.js | 17 + .../es-abstract/2015/IsPropertyKey.js | 7 + node_modules/es-abstract/2015/IsRegExp.js | 24 + .../es-abstract/2015/IteratorClose.js | 50 + .../es-abstract/2015/IteratorComplete.js | 18 + node_modules/es-abstract/2015/IteratorNext.js | 18 + node_modules/es-abstract/2015/IteratorStep.js | 13 + .../es-abstract/2015/IteratorValue.js | 18 + node_modules/es-abstract/2015/MakeDate.js | 13 + node_modules/es-abstract/2015/MakeDay.js | 33 + node_modules/es-abstract/2015/MakeTime.js | 23 + node_modules/es-abstract/2015/MinFromTime.js | 16 + .../es-abstract/2015/MonthFromTime.js | 47 + node_modules/es-abstract/2015/ObjectCreate.js | 37 + .../2015/OrdinaryDefineOwnProperty.js | 61 + .../2015/OrdinaryGetOwnProperty.js | 44 + .../es-abstract/2015/OrdinaryHasInstance.js | 25 + .../es-abstract/2015/OrdinaryHasProperty.js | 20 + node_modules/es-abstract/2015/RegExpExec.js | 32 + .../2015/RequireObjectCoercible.js | 3 + node_modules/es-abstract/2015/SameValue.js | 13 + .../es-abstract/2015/SameValueZero.js | 9 + node_modules/es-abstract/2015/SecFromTime.js | 16 + node_modules/es-abstract/2015/Set.js | 47 + .../es-abstract/2015/SetFunctionName.js | 44 + .../es-abstract/2015/SetIntegrityLevel.js | 57 + .../es-abstract/2015/SpeciesConstructor.js | 32 + .../2015/StrictEqualityComparison.js | 17 + .../2015/SymbolDescriptiveString.js | 20 + .../es-abstract/2015/TestIntegrityLevel.js | 42 + node_modules/es-abstract/2015/TimeClip.js | 21 + node_modules/es-abstract/2015/TimeFromYear.js | 11 + .../es-abstract/2015/TimeWithinDay.js | 11 + node_modules/es-abstract/2015/ToBoolean.js | 5 + node_modules/es-abstract/2015/ToDateString.js | 22 + node_modules/es-abstract/2015/ToInt16.js | 10 + node_modules/es-abstract/2015/ToInt32.js | 9 + node_modules/es-abstract/2015/ToInt8.js | 10 + node_modules/es-abstract/2015/ToInteger.js | 12 + node_modules/es-abstract/2015/ToLength.js | 12 + node_modules/es-abstract/2015/ToNumber.js | 59 + node_modules/es-abstract/2015/ToObject.js | 14 + node_modules/es-abstract/2015/ToPrimitive.js | 12 + .../es-abstract/2015/ToPropertyDescriptor.js | 52 + .../es-abstract/2015/ToPropertyKey.js | 15 + node_modules/es-abstract/2015/ToString.js | 15 + node_modules/es-abstract/2015/ToUint16.js | 24 + node_modules/es-abstract/2015/ToUint32.js | 9 + node_modules/es-abstract/2015/ToUint8.js | 22 + node_modules/es-abstract/2015/ToUint8Clamp.js | 24 + node_modules/es-abstract/2015/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + node_modules/es-abstract/2015/WeekDay.js | 11 + node_modules/es-abstract/2015/YearFromTime.js | 16 + node_modules/es-abstract/2015/modulo.js | 9 + node_modules/es-abstract/2015/msFromTime.js | 10 + .../es-abstract/2015/thisBooleanValue.js | 15 + .../es-abstract/2015/thisNumberValue.js | 18 + .../es-abstract/2015/thisStringValue.js | 15 + .../es-abstract/2015/thisTimeValue.js | 9 + .../2016/AbstractEqualityComparison.js | 37 + .../2016/AbstractRelationalComparison.js | 66 + .../es-abstract/2016/AdvanceStringIndex.js | 45 + node_modules/es-abstract/2016/ArrayCreate.js | 53 + .../es-abstract/2016/ArraySetLength.js | 85 + .../es-abstract/2016/ArraySpeciesCreate.js | 46 + node_modules/es-abstract/2016/Call.js | 13 + .../2016/CanonicalNumericIndexString.js | 22 + .../2016/CompletePropertyDescriptor.js | 39 + .../es-abstract/2016/CreateDataProperty.js | 45 + .../2016/CreateDataPropertyOrThrow.js | 25 + node_modules/es-abstract/2016/CreateHTML.js | 30 + .../2016/CreateIterResultObject.js | 19 + .../2016/CreateListFromArrayLike.js | 43 + .../es-abstract/2016/CreateMethodProperty.js | 40 + node_modules/es-abstract/2016/DateFromTime.js | 54 + node_modules/es-abstract/2016/Day.js | 13 + node_modules/es-abstract/2016/DayFromYear.js | 12 + .../es-abstract/2016/DayWithinYear.js | 11 + node_modules/es-abstract/2016/DaysInYear.js | 18 + .../es-abstract/2016/DefinePropertyOrThrow.js | 50 + .../es-abstract/2016/DeletePropertyOrThrow.js | 27 + .../es-abstract/2016/EnumerableOwnNames.js | 19 + .../2016/FromPropertyDescriptor.js | 36 + node_modules/es-abstract/2016/Get.js | 30 + node_modules/es-abstract/2016/GetIterator.js | 35 + node_modules/es-abstract/2016/GetMethod.js | 42 + .../es-abstract/2016/GetOwnPropertyKeys.js | 31 + .../2016/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2016/GetSubstitution.js | 104 + node_modules/es-abstract/2016/GetV.js | 29 + .../es-abstract/2016/HasOwnProperty.js | 22 + node_modules/es-abstract/2016/HasProperty.js | 20 + node_modules/es-abstract/2016/HourFromTime.js | 16 + node_modules/es-abstract/2016/InLeapYear.js | 21 + .../es-abstract/2016/InstanceofOperator.js | 30 + node_modules/es-abstract/2016/Invoke.js | 22 + .../es-abstract/2016/IsAccessorDescriptor.js | 23 + node_modules/es-abstract/2016/IsArray.js | 14 + node_modules/es-abstract/2016/IsCallable.js | 5 + .../es-abstract/2016/IsConcatSpreadable.js | 25 + .../es-abstract/2016/IsConstructor.js | 40 + .../es-abstract/2016/IsDataDescriptor.js | 23 + node_modules/es-abstract/2016/IsExtensible.js | 20 + .../es-abstract/2016/IsGenericDescriptor.js | 23 + node_modules/es-abstract/2016/IsInteger.js | 21 + node_modules/es-abstract/2016/IsPromise.js | 24 + .../es-abstract/2016/IsPropertyDescriptor.js | 17 + .../es-abstract/2016/IsPropertyKey.js | 7 + node_modules/es-abstract/2016/IsRegExp.js | 24 + .../es-abstract/2016/IterableToArrayLike.js | 56 + .../es-abstract/2016/IteratorClose.js | 50 + .../es-abstract/2016/IteratorComplete.js | 18 + node_modules/es-abstract/2016/IteratorNext.js | 18 + node_modules/es-abstract/2016/IteratorStep.js | 13 + .../es-abstract/2016/IteratorValue.js | 18 + node_modules/es-abstract/2016/MakeDate.js | 13 + node_modules/es-abstract/2016/MakeDay.js | 33 + node_modules/es-abstract/2016/MakeTime.js | 23 + node_modules/es-abstract/2016/MinFromTime.js | 16 + .../es-abstract/2016/MonthFromTime.js | 47 + node_modules/es-abstract/2016/ObjectCreate.js | 37 + .../2016/OrdinaryDefineOwnProperty.js | 61 + .../2016/OrdinaryGetOwnProperty.js | 44 + .../2016/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2016/OrdinaryHasInstance.js | 25 + .../es-abstract/2016/OrdinaryHasProperty.js | 20 + .../2016/OrdinarySetPrototypeOf.js | 53 + node_modules/es-abstract/2016/RegExpExec.js | 32 + .../2016/RequireObjectCoercible.js | 3 + node_modules/es-abstract/2016/SameValue.js | 13 + .../es-abstract/2016/SameValueNonNumber.js | 16 + .../es-abstract/2016/SameValueZero.js | 9 + node_modules/es-abstract/2016/SecFromTime.js | 16 + node_modules/es-abstract/2016/Set.js | 47 + .../es-abstract/2016/SetFunctionName.js | 44 + .../es-abstract/2016/SetIntegrityLevel.js | 57 + .../es-abstract/2016/SpeciesConstructor.js | 32 + .../2016/StrictEqualityComparison.js | 17 + .../2016/SymbolDescriptiveString.js | 20 + .../es-abstract/2016/TestIntegrityLevel.js | 42 + node_modules/es-abstract/2016/TimeClip.js | 21 + node_modules/es-abstract/2016/TimeFromYear.js | 11 + .../es-abstract/2016/TimeWithinDay.js | 11 + node_modules/es-abstract/2016/ToBoolean.js | 5 + node_modules/es-abstract/2016/ToDateString.js | 22 + node_modules/es-abstract/2016/ToInt16.js | 10 + node_modules/es-abstract/2016/ToInt32.js | 9 + node_modules/es-abstract/2016/ToInt8.js | 10 + node_modules/es-abstract/2016/ToInteger.js | 12 + node_modules/es-abstract/2016/ToLength.js | 12 + node_modules/es-abstract/2016/ToNumber.js | 59 + node_modules/es-abstract/2016/ToObject.js | 14 + node_modules/es-abstract/2016/ToPrimitive.js | 12 + .../es-abstract/2016/ToPropertyDescriptor.js | 52 + .../es-abstract/2016/ToPropertyKey.js | 15 + node_modules/es-abstract/2016/ToString.js | 15 + node_modules/es-abstract/2016/ToUint16.js | 24 + node_modules/es-abstract/2016/ToUint32.js | 9 + node_modules/es-abstract/2016/ToUint8.js | 22 + node_modules/es-abstract/2016/ToUint8Clamp.js | 24 + node_modules/es-abstract/2016/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + node_modules/es-abstract/2016/WeekDay.js | 11 + node_modules/es-abstract/2016/YearFromTime.js | 16 + node_modules/es-abstract/2016/modulo.js | 9 + node_modules/es-abstract/2016/msFromTime.js | 10 + .../es-abstract/2016/thisBooleanValue.js | 15 + .../es-abstract/2016/thisNumberValue.js | 18 + .../es-abstract/2016/thisStringValue.js | 15 + .../es-abstract/2016/thisTimeValue.js | 9 + .../2017/AbstractEqualityComparison.js | 37 + .../2017/AbstractRelationalComparison.js | 66 + .../es-abstract/2017/AdvanceStringIndex.js | 45 + node_modules/es-abstract/2017/ArrayCreate.js | 53 + .../es-abstract/2017/ArraySetLength.js | 85 + .../es-abstract/2017/ArraySpeciesCreate.js | 46 + node_modules/es-abstract/2017/Call.js | 13 + .../2017/CanonicalNumericIndexString.js | 22 + .../2017/CompletePropertyDescriptor.js | 39 + .../es-abstract/2017/CreateDataProperty.js | 45 + .../2017/CreateDataPropertyOrThrow.js | 25 + node_modules/es-abstract/2017/CreateHTML.js | 30 + .../2017/CreateIterResultObject.js | 19 + .../2017/CreateListFromArrayLike.js | 43 + .../es-abstract/2017/CreateMethodProperty.js | 40 + node_modules/es-abstract/2017/DateFromTime.js | 54 + node_modules/es-abstract/2017/Day.js | 13 + node_modules/es-abstract/2017/DayFromYear.js | 12 + .../es-abstract/2017/DayWithinYear.js | 11 + node_modules/es-abstract/2017/DaysInYear.js | 18 + .../es-abstract/2017/DefinePropertyOrThrow.js | 50 + .../es-abstract/2017/DeletePropertyOrThrow.js | 27 + .../2017/EnumerableOwnProperties.js | 43 + .../2017/FromPropertyDescriptor.js | 36 + node_modules/es-abstract/2017/Get.js | 30 + node_modules/es-abstract/2017/GetIterator.js | 35 + node_modules/es-abstract/2017/GetMethod.js | 42 + .../es-abstract/2017/GetOwnPropertyKeys.js | 31 + .../2017/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2017/GetSubstitution.js | 104 + node_modules/es-abstract/2017/GetV.js | 29 + .../es-abstract/2017/HasOwnProperty.js | 22 + node_modules/es-abstract/2017/HasProperty.js | 20 + node_modules/es-abstract/2017/HourFromTime.js | 16 + node_modules/es-abstract/2017/InLeapYear.js | 21 + .../es-abstract/2017/InstanceofOperator.js | 30 + node_modules/es-abstract/2017/Invoke.js | 22 + .../es-abstract/2017/IsAccessorDescriptor.js | 23 + node_modules/es-abstract/2017/IsArray.js | 14 + node_modules/es-abstract/2017/IsCallable.js | 5 + .../es-abstract/2017/IsConcatSpreadable.js | 25 + .../es-abstract/2017/IsConstructor.js | 40 + .../es-abstract/2017/IsDataDescriptor.js | 23 + node_modules/es-abstract/2017/IsExtensible.js | 20 + .../es-abstract/2017/IsGenericDescriptor.js | 23 + node_modules/es-abstract/2017/IsInteger.js | 21 + node_modules/es-abstract/2017/IsPromise.js | 24 + .../es-abstract/2017/IsPropertyDescriptor.js | 17 + .../es-abstract/2017/IsPropertyKey.js | 7 + node_modules/es-abstract/2017/IsRegExp.js | 24 + .../es-abstract/2017/IterableToList.js | 24 + .../es-abstract/2017/IteratorClose.js | 50 + .../es-abstract/2017/IteratorComplete.js | 18 + node_modules/es-abstract/2017/IteratorNext.js | 18 + node_modules/es-abstract/2017/IteratorStep.js | 13 + .../es-abstract/2017/IteratorValue.js | 18 + node_modules/es-abstract/2017/MakeDate.js | 13 + node_modules/es-abstract/2017/MakeDay.js | 33 + node_modules/es-abstract/2017/MakeTime.js | 23 + node_modules/es-abstract/2017/MinFromTime.js | 16 + .../es-abstract/2017/MonthFromTime.js | 47 + node_modules/es-abstract/2017/ObjectCreate.js | 37 + .../2017/OrdinaryDefineOwnProperty.js | 61 + .../2017/OrdinaryGetOwnProperty.js | 44 + .../2017/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2017/OrdinaryHasInstance.js | 25 + .../es-abstract/2017/OrdinaryHasProperty.js | 20 + .../2017/OrdinarySetPrototypeOf.js | 53 + node_modules/es-abstract/2017/RegExpExec.js | 32 + .../2017/RequireObjectCoercible.js | 3 + node_modules/es-abstract/2017/SameValue.js | 13 + .../es-abstract/2017/SameValueNonNumber.js | 16 + .../es-abstract/2017/SameValueZero.js | 9 + node_modules/es-abstract/2017/SecFromTime.js | 16 + node_modules/es-abstract/2017/Set.js | 47 + .../es-abstract/2017/SetFunctionName.js | 44 + .../es-abstract/2017/SetIntegrityLevel.js | 57 + .../es-abstract/2017/SpeciesConstructor.js | 32 + .../2017/StrictEqualityComparison.js | 17 + .../2017/SymbolDescriptiveString.js | 20 + .../es-abstract/2017/TestIntegrityLevel.js | 42 + node_modules/es-abstract/2017/TimeClip.js | 21 + node_modules/es-abstract/2017/TimeFromYear.js | 11 + .../es-abstract/2017/TimeWithinDay.js | 11 + node_modules/es-abstract/2017/ToBoolean.js | 5 + node_modules/es-abstract/2017/ToDateString.js | 22 + node_modules/es-abstract/2017/ToIndex.js | 26 + node_modules/es-abstract/2017/ToInt16.js | 10 + node_modules/es-abstract/2017/ToInt32.js | 9 + node_modules/es-abstract/2017/ToInt8.js | 10 + node_modules/es-abstract/2017/ToInteger.js | 12 + node_modules/es-abstract/2017/ToLength.js | 12 + node_modules/es-abstract/2017/ToNumber.js | 59 + node_modules/es-abstract/2017/ToObject.js | 14 + node_modules/es-abstract/2017/ToPrimitive.js | 12 + .../es-abstract/2017/ToPropertyDescriptor.js | 52 + .../es-abstract/2017/ToPropertyKey.js | 15 + node_modules/es-abstract/2017/ToString.js | 15 + node_modules/es-abstract/2017/ToUint16.js | 24 + node_modules/es-abstract/2017/ToUint32.js | 9 + node_modules/es-abstract/2017/ToUint8.js | 22 + node_modules/es-abstract/2017/ToUint8Clamp.js | 24 + node_modules/es-abstract/2017/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + node_modules/es-abstract/2017/WeekDay.js | 11 + node_modules/es-abstract/2017/YearFromTime.js | 16 + node_modules/es-abstract/2017/modulo.js | 9 + node_modules/es-abstract/2017/msFromTime.js | 10 + .../es-abstract/2017/thisBooleanValue.js | 15 + .../es-abstract/2017/thisNumberValue.js | 18 + .../es-abstract/2017/thisStringValue.js | 15 + .../es-abstract/2017/thisTimeValue.js | 9 + .../2018/AbstractEqualityComparison.js | 37 + .../2018/AbstractRelationalComparison.js | 66 + .../es-abstract/2018/AdvanceStringIndex.js | 45 + node_modules/es-abstract/2018/ArrayCreate.js | 53 + .../es-abstract/2018/ArraySetLength.js | 85 + .../es-abstract/2018/ArraySpeciesCreate.js | 46 + node_modules/es-abstract/2018/Call.js | 13 + .../2018/CanonicalNumericIndexString.js | 22 + .../2018/CompletePropertyDescriptor.js | 39 + .../es-abstract/2018/CopyDataProperties.js | 64 + .../es-abstract/2018/CreateDataProperty.js | 45 + .../2018/CreateDataPropertyOrThrow.js | 25 + node_modules/es-abstract/2018/CreateHTML.js | 30 + .../2018/CreateIterResultObject.js | 19 + .../2018/CreateListFromArrayLike.js | 43 + .../es-abstract/2018/CreateMethodProperty.js | 40 + node_modules/es-abstract/2018/DateFromTime.js | 54 + node_modules/es-abstract/2018/DateString.js | 30 + node_modules/es-abstract/2018/Day.js | 13 + node_modules/es-abstract/2018/DayFromYear.js | 12 + .../es-abstract/2018/DayWithinYear.js | 11 + node_modules/es-abstract/2018/DaysInYear.js | 18 + .../es-abstract/2018/DefinePropertyOrThrow.js | 50 + .../es-abstract/2018/DeletePropertyOrThrow.js | 27 + .../2018/EnumerableOwnPropertyNames.js | 43 + .../2018/FromPropertyDescriptor.js | 36 + node_modules/es-abstract/2018/Get.js | 30 + node_modules/es-abstract/2018/GetIterator.js | 35 + node_modules/es-abstract/2018/GetMethod.js | 42 + .../es-abstract/2018/GetOwnPropertyKeys.js | 31 + .../2018/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2018/GetSubstitution.js | 128 + node_modules/es-abstract/2018/GetV.js | 29 + .../es-abstract/2018/HasOwnProperty.js | 22 + node_modules/es-abstract/2018/HasProperty.js | 20 + node_modules/es-abstract/2018/HourFromTime.js | 16 + node_modules/es-abstract/2018/InLeapYear.js | 21 + .../es-abstract/2018/InstanceofOperator.js | 30 + node_modules/es-abstract/2018/Invoke.js | 22 + .../es-abstract/2018/IsAccessorDescriptor.js | 23 + node_modules/es-abstract/2018/IsArray.js | 14 + node_modules/es-abstract/2018/IsCallable.js | 5 + .../es-abstract/2018/IsConcatSpreadable.js | 25 + .../es-abstract/2018/IsConstructor.js | 40 + .../es-abstract/2018/IsDataDescriptor.js | 23 + node_modules/es-abstract/2018/IsExtensible.js | 20 + .../es-abstract/2018/IsGenericDescriptor.js | 23 + node_modules/es-abstract/2018/IsInteger.js | 21 + node_modules/es-abstract/2018/IsPromise.js | 24 + .../es-abstract/2018/IsPropertyKey.js | 7 + node_modules/es-abstract/2018/IsRegExp.js | 24 + .../es-abstract/2018/IsStringPrefix.js | 47 + .../es-abstract/2018/IterableToList.js | 24 + .../es-abstract/2018/IteratorClose.js | 50 + .../es-abstract/2018/IteratorComplete.js | 18 + node_modules/es-abstract/2018/IteratorNext.js | 18 + node_modules/es-abstract/2018/IteratorStep.js | 13 + .../es-abstract/2018/IteratorValue.js | 18 + node_modules/es-abstract/2018/MakeDate.js | 13 + node_modules/es-abstract/2018/MakeDay.js | 33 + node_modules/es-abstract/2018/MakeTime.js | 23 + node_modules/es-abstract/2018/MinFromTime.js | 16 + .../es-abstract/2018/MonthFromTime.js | 47 + .../es-abstract/2018/NumberToString.js | 18 + node_modules/es-abstract/2018/ObjectCreate.js | 37 + .../2018/OrdinaryDefineOwnProperty.js | 61 + .../2018/OrdinaryGetOwnProperty.js | 44 + .../2018/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2018/OrdinaryHasInstance.js | 25 + .../es-abstract/2018/OrdinaryHasProperty.js | 20 + .../2018/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2018/PromiseResolve.js | 15 + node_modules/es-abstract/2018/RegExpExec.js | 32 + .../2018/RequireObjectCoercible.js | 3 + node_modules/es-abstract/2018/SameValue.js | 13 + .../es-abstract/2018/SameValueNonNumber.js | 16 + .../es-abstract/2018/SameValueZero.js | 9 + node_modules/es-abstract/2018/SecFromTime.js | 16 + node_modules/es-abstract/2018/Set.js | 47 + .../es-abstract/2018/SetFunctionName.js | 44 + .../es-abstract/2018/SetIntegrityLevel.js | 57 + .../es-abstract/2018/SpeciesConstructor.js | 32 + .../2018/StrictEqualityComparison.js | 17 + .../2018/SymbolDescriptiveString.js | 20 + .../es-abstract/2018/TestIntegrityLevel.js | 42 + node_modules/es-abstract/2018/TimeClip.js | 21 + node_modules/es-abstract/2018/TimeFromYear.js | 11 + node_modules/es-abstract/2018/TimeString.js | 25 + .../es-abstract/2018/TimeWithinDay.js | 11 + node_modules/es-abstract/2018/ToBoolean.js | 5 + node_modules/es-abstract/2018/ToDateString.js | 22 + node_modules/es-abstract/2018/ToIndex.js | 26 + node_modules/es-abstract/2018/ToInt16.js | 10 + node_modules/es-abstract/2018/ToInt32.js | 9 + node_modules/es-abstract/2018/ToInt8.js | 10 + node_modules/es-abstract/2018/ToInteger.js | 12 + node_modules/es-abstract/2018/ToLength.js | 12 + node_modules/es-abstract/2018/ToNumber.js | 59 + node_modules/es-abstract/2018/ToObject.js | 14 + node_modules/es-abstract/2018/ToPrimitive.js | 12 + .../es-abstract/2018/ToPropertyDescriptor.js | 52 + .../es-abstract/2018/ToPropertyKey.js | 15 + node_modules/es-abstract/2018/ToString.js | 15 + node_modules/es-abstract/2018/ToUint16.js | 24 + node_modules/es-abstract/2018/ToUint32.js | 9 + node_modules/es-abstract/2018/ToUint8.js | 22 + node_modules/es-abstract/2018/ToUint8Clamp.js | 24 + node_modules/es-abstract/2018/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + node_modules/es-abstract/2018/WeekDay.js | 11 + node_modules/es-abstract/2018/YearFromTime.js | 16 + node_modules/es-abstract/2018/modulo.js | 9 + node_modules/es-abstract/2018/msFromTime.js | 10 + .../es-abstract/2018/thisBooleanValue.js | 15 + .../es-abstract/2018/thisNumberValue.js | 18 + .../es-abstract/2018/thisStringValue.js | 15 + .../es-abstract/2018/thisSymbolValue.js | 19 + .../es-abstract/2018/thisTimeValue.js | 9 + .../2019/AbstractEqualityComparison.js | 37 + .../2019/AbstractRelationalComparison.js | 66 + .../2019/AddEntriesFromIterable.js | 52 + .../es-abstract/2019/AdvanceStringIndex.js | 45 + node_modules/es-abstract/2019/ArrayCreate.js | 53 + .../es-abstract/2019/ArraySetLength.js | 85 + .../es-abstract/2019/ArraySpeciesCreate.js | 46 + node_modules/es-abstract/2019/Call.js | 13 + .../2019/CanonicalNumericIndexString.js | 22 + .../2019/CompletePropertyDescriptor.js | 39 + .../es-abstract/2019/CopyDataProperties.js | 64 + .../es-abstract/2019/CreateDataProperty.js | 45 + .../2019/CreateDataPropertyOrThrow.js | 25 + node_modules/es-abstract/2019/CreateHTML.js | 30 + .../2019/CreateIterResultObject.js | 19 + .../2019/CreateListFromArrayLike.js | 43 + .../es-abstract/2019/CreateMethodProperty.js | 40 + node_modules/es-abstract/2019/DateFromTime.js | 54 + node_modules/es-abstract/2019/DateString.js | 30 + node_modules/es-abstract/2019/Day.js | 13 + node_modules/es-abstract/2019/DayFromYear.js | 12 + .../es-abstract/2019/DayWithinYear.js | 11 + node_modules/es-abstract/2019/DaysInYear.js | 18 + .../es-abstract/2019/DefinePropertyOrThrow.js | 50 + .../es-abstract/2019/DeletePropertyOrThrow.js | 27 + .../2019/EnumerableOwnPropertyNames.js | 43 + .../es-abstract/2019/FlattenIntoArray.js | 58 + .../2019/FromPropertyDescriptor.js | 36 + node_modules/es-abstract/2019/Get.js | 30 + node_modules/es-abstract/2019/GetIterator.js | 35 + node_modules/es-abstract/2019/GetMethod.js | 42 + .../es-abstract/2019/GetOwnPropertyKeys.js | 31 + .../2019/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2019/GetSubstitution.js | 128 + node_modules/es-abstract/2019/GetV.js | 29 + .../es-abstract/2019/HasOwnProperty.js | 22 + node_modules/es-abstract/2019/HasProperty.js | 20 + node_modules/es-abstract/2019/HourFromTime.js | 16 + node_modules/es-abstract/2019/InLeapYear.js | 21 + .../es-abstract/2019/InstanceofOperator.js | 30 + node_modules/es-abstract/2019/Invoke.js | 22 + .../es-abstract/2019/IsAccessorDescriptor.js | 23 + node_modules/es-abstract/2019/IsArray.js | 14 + node_modules/es-abstract/2019/IsCallable.js | 5 + .../es-abstract/2019/IsConcatSpreadable.js | 25 + .../es-abstract/2019/IsConstructor.js | 40 + .../es-abstract/2019/IsDataDescriptor.js | 23 + node_modules/es-abstract/2019/IsExtensible.js | 20 + .../es-abstract/2019/IsGenericDescriptor.js | 23 + node_modules/es-abstract/2019/IsInteger.js | 21 + node_modules/es-abstract/2019/IsPromise.js | 24 + .../es-abstract/2019/IsPropertyKey.js | 7 + node_modules/es-abstract/2019/IsRegExp.js | 24 + .../es-abstract/2019/IsStringPrefix.js | 47 + .../es-abstract/2019/IterableToList.js | 24 + .../es-abstract/2019/IteratorClose.js | 50 + .../es-abstract/2019/IteratorComplete.js | 18 + node_modules/es-abstract/2019/IteratorNext.js | 18 + node_modules/es-abstract/2019/IteratorStep.js | 13 + .../es-abstract/2019/IteratorValue.js | 18 + node_modules/es-abstract/2019/MakeDate.js | 13 + node_modules/es-abstract/2019/MakeDay.js | 33 + node_modules/es-abstract/2019/MakeTime.js | 23 + node_modules/es-abstract/2019/MinFromTime.js | 16 + .../es-abstract/2019/MonthFromTime.js | 47 + .../es-abstract/2019/NumberToString.js | 18 + node_modules/es-abstract/2019/ObjectCreate.js | 37 + .../2019/OrdinaryDefineOwnProperty.js | 61 + .../2019/OrdinaryGetOwnProperty.js | 44 + .../2019/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2019/OrdinaryHasInstance.js | 25 + .../es-abstract/2019/OrdinaryHasProperty.js | 20 + .../2019/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2019/PromiseResolve.js | 15 + node_modules/es-abstract/2019/RegExpExec.js | 32 + .../2019/RequireObjectCoercible.js | 3 + node_modules/es-abstract/2019/SameValue.js | 13 + .../es-abstract/2019/SameValueNonNumber.js | 16 + .../es-abstract/2019/SameValueZero.js | 9 + node_modules/es-abstract/2019/SecFromTime.js | 16 + node_modules/es-abstract/2019/Set.js | 47 + .../es-abstract/2019/SetFunctionName.js | 44 + .../es-abstract/2019/SetIntegrityLevel.js | 57 + .../es-abstract/2019/SpeciesConstructor.js | 32 + .../2019/StrictEqualityComparison.js | 17 + .../2019/SymbolDescriptiveString.js | 20 + .../es-abstract/2019/TestIntegrityLevel.js | 42 + node_modules/es-abstract/2019/TimeClip.js | 21 + node_modules/es-abstract/2019/TimeFromYear.js | 11 + node_modules/es-abstract/2019/TimeString.js | 25 + .../es-abstract/2019/TimeWithinDay.js | 11 + node_modules/es-abstract/2019/ToBoolean.js | 5 + node_modules/es-abstract/2019/ToDateString.js | 22 + node_modules/es-abstract/2019/ToIndex.js | 26 + node_modules/es-abstract/2019/ToInt16.js | 10 + node_modules/es-abstract/2019/ToInt32.js | 9 + node_modules/es-abstract/2019/ToInt8.js | 10 + node_modules/es-abstract/2019/ToInteger.js | 12 + node_modules/es-abstract/2019/ToLength.js | 12 + node_modules/es-abstract/2019/ToNumber.js | 59 + node_modules/es-abstract/2019/ToObject.js | 14 + node_modules/es-abstract/2019/ToPrimitive.js | 12 + .../es-abstract/2019/ToPropertyDescriptor.js | 52 + .../es-abstract/2019/ToPropertyKey.js | 15 + node_modules/es-abstract/2019/ToString.js | 15 + node_modules/es-abstract/2019/ToUint16.js | 24 + node_modules/es-abstract/2019/ToUint32.js | 9 + node_modules/es-abstract/2019/ToUint8.js | 22 + node_modules/es-abstract/2019/ToUint8Clamp.js | 24 + node_modules/es-abstract/2019/TrimString.js | 29 + node_modules/es-abstract/2019/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + node_modules/es-abstract/2019/WeekDay.js | 11 + node_modules/es-abstract/2019/YearFromTime.js | 16 + node_modules/es-abstract/2019/modulo.js | 9 + node_modules/es-abstract/2019/msFromTime.js | 10 + .../es-abstract/2019/thisBooleanValue.js | 15 + .../es-abstract/2019/thisNumberValue.js | 18 + .../es-abstract/2019/thisStringValue.js | 15 + .../es-abstract/2019/thisSymbolValue.js | 19 + .../es-abstract/2019/thisTimeValue.js | 3 + .../5/AbstractEqualityComparison.js | 37 + .../5/AbstractRelationalComparison.js | 66 + .../es-abstract/5/CheckObjectCoercible.js | 14 + node_modules/es-abstract/5/DateFromTime.js | 54 + node_modules/es-abstract/5/Day.js | 13 + node_modules/es-abstract/5/DayFromYear.js | 12 + node_modules/es-abstract/5/DayWithinYear.js | 11 + node_modules/es-abstract/5/DaysInYear.js | 18 + .../es-abstract/5/FromPropertyDescriptor.js | 39 + node_modules/es-abstract/5/HourFromTime.js | 16 + node_modules/es-abstract/5/InLeapYear.js | 21 + .../es-abstract/5/IsAccessorDescriptor.js | 23 + node_modules/es-abstract/5/IsCallable.js | 5 + .../es-abstract/5/IsDataDescriptor.js | 23 + .../es-abstract/5/IsGenericDescriptor.js | 23 + .../es-abstract/5/IsPropertyDescriptor.js | 17 + node_modules/es-abstract/5/MakeDate.js | 13 + node_modules/es-abstract/5/MakeDay.js | 33 + node_modules/es-abstract/5/MakeTime.js | 23 + node_modules/es-abstract/5/MinFromTime.js | 16 + node_modules/es-abstract/5/MonthFromTime.js | 47 + node_modules/es-abstract/5/SameValue.js | 13 + node_modules/es-abstract/5/SecFromTime.js | 16 + .../es-abstract/5/StrictEqualityComparison.js | 17 + node_modules/es-abstract/5/TimeClip.js | 21 + node_modules/es-abstract/5/TimeFromYear.js | 11 + node_modules/es-abstract/5/TimeWithinDay.js | 11 + node_modules/es-abstract/5/ToBoolean.js | 5 + node_modules/es-abstract/5/ToInt32.js | 9 + node_modules/es-abstract/5/ToInteger.js | 22 + node_modules/es-abstract/5/ToNumber.js | 7 + node_modules/es-abstract/5/ToObject.js | 14 + node_modules/es-abstract/5/ToPrimitive.js | 5 + .../es-abstract/5/ToPropertyDescriptor.js | 52 + node_modules/es-abstract/5/ToString.js | 12 + node_modules/es-abstract/5/ToUint16.js | 24 + node_modules/es-abstract/5/ToUint32.js | 9 + node_modules/es-abstract/5/Type.js | 24 + node_modules/es-abstract/5/WeekDay.js | 11 + node_modules/es-abstract/5/YearFromTime.js | 16 + node_modules/es-abstract/5/modulo.js | 9 + node_modules/es-abstract/5/msFromTime.js | 10 + node_modules/es-abstract/CHANGELOG.md | 357 + node_modules/es-abstract/GetIntrinsic.js | 218 + node_modules/es-abstract/LICENSE | 21 + node_modules/es-abstract/README.md | 48 + node_modules/es-abstract/es2015.js | 115 + node_modules/es-abstract/es2016.js | 119 + node_modules/es-abstract/es2017.js | 120 + node_modules/es-abstract/es2018.js | 126 + node_modules/es-abstract/es2019.js | 129 + node_modules/es-abstract/es5.js | 49 + node_modules/es-abstract/es6.js | 3 + node_modules/es-abstract/es7.js | 3 + .../es-abstract/helpers/DefineOwnProperty.js | 45 + .../es-abstract/helpers/OwnPropertyKeys.js | 22 + .../es-abstract/helpers/assertRecord.js | 48 + node_modules/es-abstract/helpers/assign.js | 22 + node_modules/es-abstract/helpers/callBind.js | 17 + node_modules/es-abstract/helpers/callBound.js | 15 + node_modules/es-abstract/helpers/every.js | 10 + node_modules/es-abstract/helpers/forEach.js | 7 + .../es-abstract/helpers/getInferredName.js | 10 + .../es-abstract/helpers/getIteratorMethod.js | 45 + .../helpers/getOwnPropertyDescriptor.js | 15 + node_modules/es-abstract/helpers/getProto.js | 15 + .../helpers/getSymbolDescription.js | 41 + node_modules/es-abstract/helpers/isFinite.js | 5 + node_modules/es-abstract/helpers/isNaN.js | 5 + .../es-abstract/helpers/isPrefixOf.js | 13 + .../es-abstract/helpers/isPrimitive.js | 5 + .../helpers/isPropertyDescriptor.js | 31 + .../helpers/isSamePropertyDescriptor.js | 20 + .../es-abstract/helpers/maxSafeInteger.js | 8 + node_modules/es-abstract/helpers/mod.js | 8 + .../es-abstract/helpers/padTimeComponent.js | 9 + .../es-abstract/helpers/regexTester.js | 11 + node_modules/es-abstract/helpers/setProto.js | 16 + node_modules/es-abstract/helpers/sign.js | 5 + .../es-abstract/helpers/timeConstants.js | 19 + node_modules/es-abstract/index.js | 26 + node_modules/es-abstract/operations/.eslintrc | 5 + node_modules/es-abstract/operations/2015.js | 249 + node_modules/es-abstract/operations/2016.js | 276 + node_modules/es-abstract/operations/2017.js | 324 + node_modules/es-abstract/operations/2018.js | 350 + node_modules/es-abstract/operations/2019.js | 355 + node_modules/es-abstract/package.json | 110 + node_modules/es-abstract/test/GetIntrinsic.js | 94 + node_modules/es-abstract/test/diffOps.js | 27 + node_modules/es-abstract/test/es2015.js | 150 + node_modules/es-abstract/test/es2016.js | 173 + node_modules/es-abstract/test/es2017.js | 220 + node_modules/es-abstract/test/es2018.js | 241 + node_modules/es-abstract/test/es2019.js | 246 + node_modules/es-abstract/test/es5.js | 786 + node_modules/es-abstract/test/es6.js | 18 + node_modules/es-abstract/test/es7.js | 18 + .../test/helpers/OwnPropertyKeys.js | 42 + .../es-abstract/test/helpers/assertRecord.js | 60 + .../test/helpers/createBoundESNamespace.js | 21 + .../test/helpers/defineProperty.js | 22 + .../test/helpers/getSymbolDescription.js | 67 + .../test/helpers/runManifestTest.js | 27 + .../es-abstract/test/helpers/values.js | 121 + node_modules/es-abstract/test/index.js | 35 + node_modules/es-abstract/test/tests.js | 4193 ++ node_modules/es-to-primitive/.eslintrc | 22 + .../es-to-primitive/.github/FUNDING.yml | 12 + node_modules/es-to-primitive/.travis.yml | 15 + node_modules/es-to-primitive/CHANGELOG.md | 49 + node_modules/es-to-primitive/LICENSE | 22 + node_modules/es-to-primitive/Makefile | 61 + node_modules/es-to-primitive/README.md | 49 + node_modules/es-to-primitive/es2015.js | 75 + node_modules/es-to-primitive/es5.js | 45 + node_modules/es-to-primitive/es6.js | 3 + .../es-to-primitive/helpers/isPrimitive.js | 5 + node_modules/es-to-primitive/index.js | 17 + node_modules/es-to-primitive/package.json | 81 + node_modules/es-to-primitive/test/es2015.js | 151 + node_modules/es-to-primitive/test/es5.js | 118 + node_modules/es-to-primitive/test/es6.js | 151 + node_modules/es-to-primitive/test/index.js | 20 + .../@typescript-eslint.js | 19 + .../eslint-config-prettier/CHANGELOG.md | 340 + node_modules/eslint-config-prettier/LICENSE | 21 + node_modules/eslint-config-prettier/README.md | 837 + node_modules/eslint-config-prettier/babel.js | 10 + .../eslint-config-prettier/bin/cli.js | 207 + .../eslint-config-prettier/bin/validators.js | 54 + .../eslint-config-prettier/flowtype.js | 15 + node_modules/eslint-config-prettier/index.js | 103 + .../eslint-config-prettier/package.json | 67 + node_modules/eslint-config-prettier/react.js | 29 + .../eslint-config-prettier/standard.js | 9 + .../eslint-config-prettier/unicorn.js | 8 + node_modules/eslint-config-prettier/vue.js | 32 + .../eslint-import-resolver-node/CHANGELOG.md | 63 + .../eslint-import-resolver-node/LICENSE | 22 + .../eslint-import-resolver-node/README.md | 44 + .../eslint-import-resolver-node/index.js | 47 + .../node_modules/debug/.coveralls.yml | 1 + .../node_modules/debug/.eslintrc | 11 + .../node_modules/debug/.npmignore | 9 + .../node_modules/debug/.travis.yml | 14 + .../node_modules/debug/CHANGELOG.md | 362 + .../node_modules/debug/LICENSE | 19 + .../node_modules/debug/Makefile | 50 + .../node_modules/debug/README.md | 312 + .../node_modules/debug/component.json | 19 + .../node_modules/debug/karma.conf.js | 70 + .../node_modules/debug/node.js | 1 + .../node_modules/debug/package.json | 49 + .../node_modules/debug/src/browser.js | 185 + .../node_modules/debug/src/debug.js | 202 + .../node_modules/debug/src/index.js | 10 + .../node_modules/debug/src/inspector-log.js | 15 + .../node_modules/debug/src/node.js | 248 + .../node_modules/ms/index.js | 152 + .../node_modules/ms/license.md | 21 + .../node_modules/ms/package.json | 37 + .../node_modules/ms/readme.md | 51 + .../eslint-import-resolver-node/package.json | 47 + .../eslint-module-utils/.eslintrc.yml | 3 + node_modules/eslint-module-utils/CHANGELOG.md | 103 + node_modules/eslint-module-utils/LICENSE | 22 + .../eslint-module-utils/ModuleCache.js | 47 + .../eslint-module-utils/declaredScope.js | 14 + node_modules/eslint-module-utils/hash.js | 59 + node_modules/eslint-module-utils/ignore.js | 60 + .../eslint-module-utils/module-require.js | 30 + .../eslint-module-utils/moduleVisitor.js | 141 + .../node_modules/debug/.coveralls.yml | 1 + .../node_modules/debug/.eslintrc | 11 + .../node_modules/debug/.npmignore | 9 + .../node_modules/debug/.travis.yml | 14 + .../node_modules/debug/CHANGELOG.md | 362 + .../node_modules/debug/LICENSE | 19 + .../node_modules/debug/Makefile | 50 + .../node_modules/debug/README.md | 312 + .../node_modules/debug/component.json | 19 + .../node_modules/debug/karma.conf.js | 70 + .../node_modules/debug/node.js | 1 + .../node_modules/debug/package.json | 49 + .../node_modules/debug/src/browser.js | 185 + .../node_modules/debug/src/debug.js | 202 + .../node_modules/debug/src/index.js | 10 + .../node_modules/debug/src/inspector-log.js | 15 + .../node_modules/debug/src/node.js | 248 + .../node_modules/find-up/index.js | 48 + .../node_modules/find-up}/license | 0 .../node_modules/find-up/package.json | 53 + .../node_modules/find-up/readme.md | 85 + .../node_modules/locate-path/index.js | 24 + .../node_modules/locate-path/license | 21 + .../node_modules/locate-path/package.json | 47 + .../node_modules/locate-path/readme.md | 99 + .../node_modules/ms/index.js | 152 + .../node_modules/ms/license.md | 21 + .../node_modules/ms/package.json | 37 + .../node_modules/ms/readme.md | 51 + .../node_modules/p-limit/index.js | 42 + .../node_modules/p-limit/license | 9 + .../node_modules/p-limit/package.json | 49 + .../node_modules/p-limit/readme.md | 69 + .../node_modules/p-locate/index.js | 31 + .../node_modules/p-locate/license | 21 + .../node_modules/p-locate/package.json | 54 + .../node_modules/p-locate/readme.md | 86 + .../node_modules/p-try/index.js | 4 + .../node_modules/p-try/license | 21 + .../node_modules/p-try/package.json | 43 + .../node_modules/p-try/readme.md | 38 + .../node_modules/path-exists/index.js | 17 + .../node_modules/path-exists/license | 21 + .../node_modules/path-exists/package.json | 40 + .../node_modules/path-exists/readme.md | 50 + .../node_modules/pkg-dir/index.js | 10 + .../node_modules/pkg-dir/license | 21 + .../node_modules/pkg-dir/package.json | 53 + .../node_modules/pkg-dir/readme.md | 64 + node_modules/eslint-module-utils/package.json | 32 + node_modules/eslint-module-utils/parse.js | 82 + node_modules/eslint-module-utils/resolve.js | 241 + .../eslint-module-utils/unambiguous.js | 30 + .../eslint-plugin-eslint-comments/LICENSE | 21 + .../eslint-plugin-eslint-comments/README.md | 36 + .../eslint-plugin-eslint-comments/index.js | 8 + .../lib/configs.js | 6 + .../lib/configs/recommended.js | 13 + .../lib/internal/disabled-area.js | 211 + .../lib/internal/get-linters.js | 33 + .../lib/internal/utils.js | 152 + .../lib/rules.js | 14 + .../lib/rules/disable-enable-pair.js | 69 + .../lib/rules/no-aggregating-enable.js | 47 + .../lib/rules/no-duplicate-disable.js | 42 + .../lib/rules/no-restricted-disable.js | 62 + .../lib/rules/no-unlimited-disable.js | 57 + .../lib/rules/no-unused-disable.js | 34 + .../lib/rules/no-unused-enable.js | 42 + .../lib/rules/no-use.js | 74 + .../lib/rules/require-description.js | 78 + .../lib/utils.js | 6 + .../lib/utils/patch.js | 201 + .../package.json | 83 + .../eslint-plugin-filenames/.eslintignore | 3 + .../eslint-plugin-filenames/.eslintrc | 14 + .../eslint-plugin-filenames/README.md | 162 + node_modules/eslint-plugin-filenames/index.js | 9 + .../lib/common/getExportedName.js | 38 + .../lib/common/isIgnoredFilename.js | 5 + .../lib/common/isIndexFile.js | 3 + .../lib/common/parseFilename.js | 12 + .../lib/rules/match-exported.js | 123 + .../lib/rules/match-regex.js | 40 + .../lib/rules/no-index.js | 32 + .../eslint-plugin-filenames/package.json | 50 + node_modules/eslint-plugin-github/LICENSE | 20 + node_modules/eslint-plugin-github/README.md | 38 + .../bin/eslint-ignore-errors.js | 50 + .../lib/configs/browser.js | 18 + .../lib/configs/internal.js | 8 + .../lib/configs/recommended.js | 116 + .../lib/configs/typescript.js | 15 + .../lib/formatters/stylish-fixes.js | 89 + .../eslint-plugin-github/lib/index.js | 26 + .../lib/rules/array-foreach.js | 16 + .../lib/rules/async-currenttarget.js | 24 + .../lib/rules/async-preventdefault.js | 24 + .../lib/rules/authenticity-token.js | 25 + .../lib/rules/get-attribute.js | 45 + .../lib/rules/js-class-name.js | 53 + .../eslint-plugin-github/lib/rules/no-blur.js | 11 + .../lib/rules/no-d-none.js | 23 + .../lib/rules/no-dataset.js | 16 + .../lib/rules/no-implicit-buggy-globals.js | 31 + .../lib/rules/no-innerText.js | 25 + .../eslint-plugin-github/lib/rules/no-then.js | 17 + .../lib/rules/no-useless-passive.js | 46 + .../lib/rules/prefer-observers.js | 24 + .../lib/rules/require-passive-events.js | 22 + .../lib/rules/unescaped-html-literal.js | 25 + .../eslint-plugin-github/package.json | 51 + .../eslint-plugin-import/CHANGELOG.md | 1258 + .../eslint-plugin-import/CONTRIBUTING.md | 116 + node_modules/eslint-plugin-import/LICENSE | 22 + node_modules/eslint-plugin-import/README.md | 505 + node_modules/eslint-plugin-import/RELEASE.md | 54 + node_modules/eslint-plugin-import/SECURITY.md | 11 + .../eslint-plugin-import/config/electron.js | 8 + .../eslint-plugin-import/config/errors.js | 14 + .../config/react-native.js | 13 + .../eslint-plugin-import/config/react.js | 18 + .../config/recommended.js | 28 + .../eslint-plugin-import/config/stage-0.js | 12 + .../eslint-plugin-import/config/typescript.js | 28 + .../eslint-plugin-import/config/warnings.js | 12 + .../docs/rules/default.md | 71 + .../docs/rules/dynamic-import-chunkname.md | 85 + .../eslint-plugin-import/docs/rules/export.md | 32 + .../docs/rules/exports-last.md | 50 + .../docs/rules/extensions.md | 167 + .../eslint-plugin-import/docs/rules/first.md | 70 + .../docs/rules/group-exports.md | 117 + .../docs/rules/imports-first.md | 3 + .../docs/rules/max-dependencies.md | 44 + .../eslint-plugin-import/docs/rules/named.md | 98 + .../docs/rules/namespace.md | 99 + .../docs/rules/newline-after-import.md | 87 + .../docs/rules/no-absolute-path.md | 48 + .../eslint-plugin-import/docs/rules/no-amd.md | 35 + .../docs/rules/no-anonymous-default-export.md | 73 + .../docs/rules/no-commonjs.md | 95 + .../docs/rules/no-cycle.md | 92 + .../docs/rules/no-default-export.md | 63 + .../docs/rules/no-deprecated.md | 61 + .../docs/rules/no-duplicates.md | 69 + .../docs/rules/no-dynamic-require.md | 23 + .../docs/rules/no-extraneous-dependencies.md | 124 + .../docs/rules/no-internal-modules.md | 70 + .../docs/rules/no-mutable-exports.md | 52 + .../docs/rules/no-named-as-default-member.md | 47 + .../docs/rules/no-named-as-default.md | 46 + .../docs/rules/no-named-default.md | 27 + .../docs/rules/no-named-export.md | 77 + .../docs/rules/no-namespace.md | 30 + .../docs/rules/no-nodejs-modules.md | 40 + .../docs/rules/no-relative-parent-imports.md | 120 + .../docs/rules/no-restricted-paths.md | 80 + .../docs/rules/no-self-import.md | 30 + .../docs/rules/no-unassigned-import.md | 59 + .../docs/rules/no-unresolved.md | 91 + .../docs/rules/no-unused-modules.md | 107 + .../docs/rules/no-useless-path-segments.md | 79 + .../docs/rules/no-webpack-loader-syntax.md | 36 + .../eslint-plugin-import/docs/rules/order.md | 264 + .../docs/rules/prefer-default-export.md | 58 + .../docs/rules/unambiguous.md | 54 + .../eslint-plugin-import/lib/ExportMap.js | 735 + .../lib/core/importType.js | 102 + .../lib/core/staticRequire.js | 11 + .../eslint-plugin-import/lib/docsUrl.js | 8 + .../lib/importDeclaration.js | 5 + .../eslint-plugin-import/lib/index.js | 67 + .../eslint-plugin-import/lib/rules/default.js | 40 + .../lib/rules/dynamic-import-chunkname.js | 119 + .../eslint-plugin-import/lib/rules/export.js | 170 + .../lib/rules/exports-last.js | 41 + .../lib/rules/extensions.js | 189 + .../eslint-plugin-import/lib/rules/first.js | 132 + .../lib/rules/group-exports.js | 153 + .../lib/rules/imports-first.js | 13 + .../lib/rules/max-dependencies.js | 58 + .../eslint-plugin-import/lib/rules/named.js | 72 + .../lib/rules/namespace.js | 217 + .../lib/rules/newline-after-import.js | 179 + .../lib/rules/no-absolute-path.js | 24 + .../eslint-plugin-import/lib/rules/no-amd.js | 46 + .../lib/rules/no-anonymous-default-export.js | 104 + .../lib/rules/no-commonjs.js | 135 + .../lib/rules/no-cycle.js | 105 + .../lib/rules/no-default-export.js | 41 + .../lib/rules/no-deprecated.js | 143 + .../lib/rules/no-duplicates.js | 288 + .../lib/rules/no-dynamic-require.js | 37 + .../lib/rules/no-extraneous-dependencies.js | 207 + .../lib/rules/no-internal-modules.js | 110 + .../lib/rules/no-mutable-exports.js | 57 + .../lib/rules/no-named-as-default-member.js | 107 + .../lib/rules/no-named-as-default.js | 43 + .../lib/rules/no-named-default.js | 25 + .../lib/rules/no-named-export.js | 35 + .../lib/rules/no-namespace.js | 160 + .../lib/rules/no-nodejs-modules.js | 49 + .../lib/rules/no-relative-parent-imports.js | 49 + .../lib/rules/no-restricted-paths.js | 125 + .../lib/rules/no-self-import.js | 45 + .../lib/rules/no-unassigned-import.js | 76 + .../lib/rules/no-unresolved.js | 49 + .../lib/rules/no-unused-modules.js | 907 + .../lib/rules/no-useless-path-segments.js | 145 + .../lib/rules/no-webpack-loader-syntax.js | 33 + .../eslint-plugin-import/lib/rules/order.js | 686 + .../lib/rules/prefer-default-export.js | 96 + .../lib/rules/unambiguous.js | 36 + .../eslint-plugin-import/memo-parser/LICENSE | 22 + .../memo-parser/README.md | 23 + .../eslint-plugin-import/memo-parser/index.js | 41 + .../memo-parser/package.json | 34 + .../node_modules/debug/.coveralls.yml | 1 + .../node_modules/debug/.eslintrc | 11 + .../node_modules/debug/.npmignore | 9 + .../node_modules/debug/.travis.yml | 14 + .../node_modules/debug/CHANGELOG.md | 362 + .../node_modules/debug/LICENSE | 19 + .../node_modules/debug/Makefile | 50 + .../node_modules/debug/README.md | 312 + .../node_modules/debug/component.json | 19 + .../node_modules/debug/karma.conf.js | 70 + .../node_modules/debug/node.js | 1 + .../node_modules/debug/package.json | 49 + .../node_modules/debug/src/browser.js | 185 + .../node_modules/debug/src/debug.js | 202 + .../node_modules/debug/src/index.js | 10 + .../node_modules/debug/src/inspector-log.js | 15 + .../node_modules/debug/src/node.js | 248 + .../node_modules/doctrine/CHANGELOG.md | 70 + .../node_modules/doctrine/LICENSE.BSD | 22 + .../doctrine/LICENSE.closure-compiler | 0 .../node_modules}/doctrine/LICENSE.esprima | 0 .../node_modules/doctrine/README.md | 174 + .../node_modules/doctrine/lib/doctrine.js | 897 + .../node_modules/doctrine/lib/typed.js | 1283 + .../node_modules/doctrine/lib/utility.js | 35 + .../node_modules/doctrine/package.json | 65 + .../node_modules/isarray/.npmignore | 1 + .../node_modules/isarray/.travis.yml | 4 + .../node_modules/isarray/Makefile | 6 + .../node_modules/isarray/README.md | 60 + .../node_modules/isarray/component.json | 19 + .../node_modules/isarray/index.js | 5 + .../node_modules/isarray/package.json | 45 + .../node_modules/isarray/test.js | 20 + .../node_modules/ms/index.js | 152 + .../node_modules/ms/license.md | 21 + .../node_modules/ms/package.json | 37 + .../node_modules/ms/readme.md | 51 + .../node_modules/resolve/.editorconfig | 20 + .../node_modules/resolve/.eslintignore | 1 + .../node_modules/resolve/.eslintrc | 39 + .../node_modules/resolve/.travis.yml | 8 + .../node_modules/resolve/LICENSE | 21 + .../node_modules/resolve/appveyor.yml | 54 + .../node_modules/resolve/example/async.js | 5 + .../node_modules/resolve/example/sync.js | 3 + .../node_modules/resolve/index.js | 6 + .../node_modules/resolve/lib/async.js | 298 + .../node_modules/resolve/lib/caller.js | 8 + .../node_modules/resolve/lib/core.js | 53 + .../node_modules/resolve/lib/core.json | 75 + .../node_modules/resolve/lib/is-core.js | 5 + .../resolve/lib/node-modules-paths.js | 42 + .../resolve/lib/normalize-options.js | 10 + .../node_modules/resolve/lib/sync.js | 191 + .../node_modules/resolve/package.json | 47 + .../node_modules/resolve/readme.markdown | 242 + .../node_modules/resolve/test/.eslintrc | 5 + .../node_modules/resolve/test/core.js | 85 + .../node_modules/resolve/test/dotdot.js | 29 + .../resolve/test/dotdot/abc/index.js | 2 + .../node_modules/resolve/test/dotdot/index.js | 1 + .../resolve/test/faulty_basedir.js | 29 + .../node_modules/resolve/test/filter.js | 34 + .../node_modules/resolve/test/filter_sync.js | 33 + .../node_modules/resolve/test/mock.js | 239 + .../node_modules/resolve/test/mock_sync.js | 141 + .../node_modules/resolve/test/module_dir.js | 56 + .../test/module_dir/xmodules/aaa/index.js | 1 + .../test/module_dir/ymodules/aaa/index.js | 1 + .../test/module_dir/zmodules/bbb/main.js | 1 + .../test/module_dir/zmodules/bbb/package.json | 3 + .../resolve/test/node-modules-paths.js | 143 + .../node_modules/resolve/test/node_path.js | 70 + .../resolve/test/node_path/x/aaa/index.js | 1 + .../resolve/test/node_path/x/ccc/index.js | 1 + .../resolve/test/node_path/y/bbb/index.js | 1 + .../resolve/test/node_path/y/ccc/index.js | 1 + .../node_modules/resolve/test/nonstring.js | 9 + .../node_modules/resolve/test/pathfilter.js | 75 + .../resolve/test/pathfilter/deep_ref/main.js | 0 .../node_modules/resolve/test/precedence.js | 23 + .../resolve/test/precedence/aaa.js | 1 + .../resolve/test/precedence/aaa/index.js | 1 + .../resolve/test/precedence/aaa/main.js | 1 + .../resolve/test/precedence/bbb.js | 1 + .../resolve/test/precedence/bbb/main.js | 1 + .../node_modules/resolve/test/resolver.js | 450 + .../resolve/test/resolver/baz/doom.js | 0 .../resolve/test/resolver/baz/package.json | 4 + .../resolve/test/resolver/baz/quux.js | 1 + .../resolve/test/resolver/browser_field/a.js | 0 .../resolve/test/resolver/browser_field/b.js | 0 .../test/resolver/browser_field/package.json | 5 + .../resolve/test/resolver/cup.coffee | 1 + .../resolve/test/resolver/dot_main/index.js | 1 + .../test/resolver/dot_main/package.json | 3 + .../test/resolver/dot_slash_main/index.js | 1 + .../test/resolver/dot_slash_main/package.json | 3 + .../node_modules/resolve/test/resolver/foo.js | 1 + .../test/resolver/incorrect_main/index.js | 2 + .../test/resolver/incorrect_main/package.json | 3 + .../test/resolver/invalid_main/package.json | 7 + .../resolve/test/resolver/mug.coffee | 0 .../node_modules/resolve/test/resolver/mug.js | 0 .../test/resolver/multirepo/lerna.json | 6 + .../test/resolver/multirepo/package.json | 20 + .../multirepo/packages/package-a/index.js | 35 + .../multirepo/packages/package-a/package.json | 14 + .../multirepo/packages/package-b/index.js | 0 .../multirepo/packages/package-b/package.json | 14 + .../resolver/nested_symlinks/mylib/async.js | 26 + .../nested_symlinks/mylib/package.json | 15 + .../resolver/nested_symlinks/mylib/sync.js | 12 + .../test/resolver/other_path/lib/other-lib.js | 0 .../resolve/test/resolver/other_path/root.js | 0 .../resolve/test/resolver/quux/foo/index.js | 1 + .../resolve/test/resolver/same_names/foo.js | 1 + .../test/resolver/same_names/foo/index.js | 1 + .../resolver/symlinked/_/node_modules/foo.js | 0 .../symlinked/_/symlink_target/.gitkeep | 0 .../test/resolver/symlinked/package/bar.js | 1 + .../resolver/symlinked/package/package.json | 3 + .../test/resolver/without_basedir/main.js | 5 + .../resolve/test/resolver_sync.js | 358 + .../resolve/test/shadowed_core.js | 38 + .../shadowed_core/node_modules/util/index.js | 0 .../node_modules/resolve/test/subdirs.js | 13 + .../node_modules/resolve/test/symlinks.js | 173 + .../eslint-plugin-import/package.json | 125 + .../eslint-plugin-no-async-foreach/README.md | 45 + .../eslint-plugin-no-async-foreach/index.js | 5 + .../lib/no-async-foreach.js | 34 + .../package.json | 26 + .../tests/lib/rules/no-async-foreach.js | 52 + .../eslint-plugin-prettier/CHANGELOG.md | 217 + .../eslint-plugin-prettier/LICENSE.md | 24 + node_modules/eslint-plugin-prettier/README.md | 140 + .../eslint-plugin-prettier.js | 305 + .../eslint-plugin-prettier/package.json | 53 + .../eslint-rule-documentation/index.js | 49 + .../eslint-rule-documentation/license | 21 + .../eslint-rule-documentation/package.json | 40 + .../eslint-rule-documentation/plugins.json | 44 + .../eslint-rule-documentation/readme.md | 77 + node_modules/eslint-scope/CHANGELOG.md | 70 + node_modules/eslint-scope/LICENSE | 22 + node_modules/eslint-scope/README.md | 54 + node_modules/eslint-scope/lib/definition.js | 86 + node_modules/eslint-scope/lib/index.js | 165 + .../eslint-scope/lib/pattern-visitor.js | 152 + node_modules/eslint-scope/lib/reference.js | 167 + node_modules/eslint-scope/lib/referencer.js | 629 + .../eslint-scope/lib/scope-manager.js | 247 + node_modules/eslint-scope/lib/scope.js | 748 + node_modules/eslint-scope/lib/variable.js | 88 + node_modules/eslint-scope/package.json | 48 + node_modules/eslint-utils/LICENSE | 21 + node_modules/eslint-utils/README.md | 38 + node_modules/eslint-utils/index.js | 1880 + node_modules/eslint-utils/index.js.map | 1 + node_modules/eslint-utils/index.mjs | 1838 + node_modules/eslint-utils/index.mjs.map | 1 + .../eslint-visitor-keys/CHANGELOG.md | 25 + .../node_modules/eslint-visitor-keys/LICENSE | 201 + .../eslint-visitor-keys/README.md | 98 + .../eslint-visitor-keys/lib/index.js | 81 + .../eslint-visitor-keys/lib/visitor-keys.json | 284 + .../eslint-visitor-keys/package.json | 40 + node_modules/eslint-utils/package.json | 65 + node_modules/eslint-visitor-keys/CHANGELOG.md | 30 + node_modules/eslint-visitor-keys/LICENSE | 201 + node_modules/eslint-visitor-keys/README.md | 98 + node_modules/eslint-visitor-keys/lib/index.js | 81 + .../eslint-visitor-keys/lib/visitor-keys.json | 284 + node_modules/eslint-visitor-keys/package.json | 39 + node_modules/eslint/CHANGELOG.md | 6201 ++ node_modules/eslint/LICENSE | 19 + node_modules/eslint/README.md | 276 + node_modules/eslint/bin/eslint.js | 146 + node_modules/eslint/conf/category-list.json | 39 + node_modules/eslint/conf/config-schema.js | 93 + .../eslint/conf/default-cli-options.js | 31 + node_modules/eslint/conf/eslint-all.js | 31 + .../eslint/conf/eslint-recommended.js | 72 + node_modules/eslint/conf/replacements.json | 22 + node_modules/eslint/lib/api.js | 34 + .../cascading-config-array-factory.js | 502 + .../eslint/lib/cli-engine/cli-engine.js | 1026 + .../lib/cli-engine/config-array-factory.js | 1092 + .../cli-engine/config-array/config-array.js | 536 + .../config-array/config-dependency.js | 128 + .../config-array/extracted-config.js | 158 + .../cli-engine/config-array/ignore-pattern.js | 249 + .../lib/cli-engine/config-array/index.js | 32 + .../config-array/override-tester.js | 235 + .../eslint/lib/cli-engine/file-enumerator.js | 528 + .../lib/cli-engine/formatters/checkstyle.js | 60 + .../lib/cli-engine/formatters/codeframe.js | 138 + .../lib/cli-engine/formatters/compact.js | 60 + .../formatters/html-template-message.html | 8 + .../formatters/html-template-page.html | 115 + .../formatters/html-template-result.html | 6 + .../eslint/lib/cli-engine/formatters/html.js | 140 + .../lib/cli-engine/formatters/jslint-xml.js | 41 + .../formatters/json-with-metadata.js | 16 + .../eslint/lib/cli-engine/formatters/json.js | 13 + .../eslint/lib/cli-engine/formatters/junit.js | 82 + .../lib/cli-engine/formatters/stylish.js | 101 + .../eslint/lib/cli-engine/formatters/table.js | 159 + .../eslint/lib/cli-engine/formatters/tap.js | 95 + .../eslint/lib/cli-engine/formatters/unix.js | 58 + .../lib/cli-engine/formatters/visualstudio.js | 63 + node_modules/eslint/lib/cli-engine/hash.js | 35 + node_modules/eslint/lib/cli-engine/index.js | 7 + .../lib/cli-engine/lint-result-cache.js | 142 + .../eslint/lib/cli-engine/load-rules.js | 46 + .../eslint/lib/cli-engine/xml-escape.js | 34 + node_modules/eslint/lib/cli.js | 326 + node_modules/eslint/lib/eslint/eslint.js | 662 + node_modules/eslint/lib/eslint/index.js | 7 + node_modules/eslint/lib/init/autoconfig.js | 348 + node_modules/eslint/lib/init/config-file.js | 143 + .../eslint/lib/init/config-initializer.js | 690 + node_modules/eslint/lib/init/config-rule.js | 317 + node_modules/eslint/lib/init/npm-utils.js | 178 + .../eslint/lib/init/source-code-utils.js | 109 + .../lib/linter/apply-disable-directives.js | 167 + .../code-path-analysis/code-path-analyzer.js | 760 + .../code-path-analysis/code-path-segment.js | 236 + .../code-path-analysis/code-path-state.js | 1480 + .../linter/code-path-analysis/code-path.js | 238 + .../code-path-analysis/debug-helpers.js | 203 + .../linter/code-path-analysis/fork-context.js | 249 + .../linter/code-path-analysis/id-generator.js | 46 + .../lib/linter/config-comment-parser.js | 141 + node_modules/eslint/lib/linter/index.js | 13 + node_modules/eslint/lib/linter/interpolate.js | 28 + node_modules/eslint/lib/linter/linter.js | 1467 + .../eslint/lib/linter/node-event-generator.js | 311 + .../eslint/lib/linter/report-translator.js | 347 + node_modules/eslint/lib/linter/rule-fixer.js | 140 + node_modules/eslint/lib/linter/rules.js | 77 + .../eslint/lib/linter/safe-emitter.js | 52 + .../eslint/lib/linter/source-code-fixer.js | 152 + node_modules/eslint/lib/linter/timing.js | 139 + node_modules/eslint/lib/options.js | 262 + node_modules/eslint/lib/rule-tester/index.js | 5 + .../eslint/lib/rule-tester/rule-tester.js | 903 + .../eslint/lib/rules/accessor-pairs.js | 354 + .../eslint/lib/rules/array-bracket-newline.js | 258 + .../eslint/lib/rules/array-bracket-spacing.js | 241 + .../eslint/lib/rules/array-callback-return.js | 296 + .../eslint/lib/rules/array-element-newline.js | 301 + .../eslint/lib/rules/arrow-body-style.js | 286 + node_modules/eslint/lib/rules/arrow-parens.js | 183 + .../eslint/lib/rules/arrow-spacing.js | 161 + .../eslint/lib/rules/block-scoped-var.js | 122 + .../eslint/lib/rules/block-spacing.js | 164 + node_modules/eslint/lib/rules/brace-style.js | 188 + .../eslint/lib/rules/callback-return.js | 186 + node_modules/eslint/lib/rules/camelcase.js | 325 + .../eslint/lib/rules/capitalized-comments.js | 300 + .../lib/rules/class-methods-use-this.js | 125 + node_modules/eslint/lib/rules/comma-dangle.js | 340 + .../eslint/lib/rules/comma-spacing.js | 195 + node_modules/eslint/lib/rules/comma-style.js | 310 + node_modules/eslint/lib/rules/complexity.js | 160 + .../lib/rules/computed-property-spacing.js | 204 + .../eslint/lib/rules/consistent-return.js | 185 + .../eslint/lib/rules/consistent-this.js | 151 + .../eslint/lib/rules/constructor-super.js | 412 + node_modules/eslint/lib/rules/curly.js | 495 + .../eslint/lib/rules/default-case-last.js | 44 + node_modules/eslint/lib/rules/default-case.js | 97 + .../eslint/lib/rules/default-param-last.js | 62 + node_modules/eslint/lib/rules/dot-location.js | 105 + node_modules/eslint/lib/rules/dot-notation.js | 176 + node_modules/eslint/lib/rules/eol-last.js | 112 + node_modules/eslint/lib/rules/eqeqeq.js | 174 + .../eslint/lib/rules/for-direction.js | 126 + .../eslint/lib/rules/func-call-spacing.js | 230 + .../eslint/lib/rules/func-name-matching.js | 249 + node_modules/eslint/lib/rules/func-names.js | 190 + node_modules/eslint/lib/rules/func-style.js | 98 + .../rules/function-call-argument-newline.js | 122 + .../lib/rules/function-paren-newline.js | 281 + .../lib/rules/generator-star-spacing.js | 206 + .../eslint/lib/rules/getter-return.js | 173 + .../eslint/lib/rules/global-require.js | 86 + .../lib/rules/grouped-accessor-pairs.js | 224 + node_modules/eslint/lib/rules/guard-for-in.js | 76 + .../eslint/lib/rules/handle-callback-err.js | 99 + node_modules/eslint/lib/rules/id-blacklist.js | 233 + node_modules/eslint/lib/rules/id-denylist.js | 230 + node_modules/eslint/lib/rules/id-length.js | 145 + node_modules/eslint/lib/rules/id-match.js | 226 + .../lib/rules/implicit-arrow-linebreak.js | 81 + .../eslint/lib/rules/indent-legacy.js | 1125 + node_modules/eslint/lib/rules/indent.js | 1706 + node_modules/eslint/lib/rules/index.js | 297 + .../eslint/lib/rules/init-declarations.js | 139 + node_modules/eslint/lib/rules/jsx-quotes.js | 95 + node_modules/eslint/lib/rules/key-spacing.js | 674 + .../eslint/lib/rules/keyword-spacing.js | 573 + .../eslint/lib/rules/line-comment-position.js | 122 + .../eslint/lib/rules/linebreak-style.js | 105 + .../eslint/lib/rules/lines-around-comment.js | 404 + .../lib/rules/lines-around-directive.js | 201 + .../lib/rules/lines-between-class-members.js | 133 + .../eslint/lib/rules/max-classes-per-file.js | 65 + node_modules/eslint/lib/rules/max-depth.js | 154 + node_modules/eslint/lib/rules/max-len.js | 433 + .../lib/rules/max-lines-per-function.js | 214 + node_modules/eslint/lib/rules/max-lines.js | 174 + .../eslint/lib/rules/max-nested-callbacks.js | 117 + node_modules/eslint/lib/rules/max-params.js | 103 + .../lib/rules/max-statements-per-line.js | 196 + .../eslint/lib/rules/max-statements.js | 175 + .../lib/rules/multiline-comment-style.js | 435 + .../eslint/lib/rules/multiline-ternary.js | 114 + node_modules/eslint/lib/rules/new-cap.js | 275 + node_modules/eslint/lib/rules/new-parens.js | 99 + .../eslint/lib/rules/newline-after-var.js | 255 + .../eslint/lib/rules/newline-before-return.js | 217 + .../lib/rules/newline-per-chained-call.js | 123 + node_modules/eslint/lib/rules/no-alert.js | 136 + .../eslint/lib/rules/no-array-constructor.js | 54 + .../lib/rules/no-async-promise-executor.js | 39 + .../eslint/lib/rules/no-await-in-loop.js | 106 + node_modules/eslint/lib/rules/no-bitwise.js | 119 + .../eslint/lib/rules/no-buffer-constructor.js | 49 + node_modules/eslint/lib/rules/no-caller.js | 46 + .../eslint/lib/rules/no-case-declarations.js | 64 + .../eslint/lib/rules/no-catch-shadow.js | 80 + .../eslint/lib/rules/no-class-assign.js | 61 + .../eslint/lib/rules/no-compare-neg-zero.js | 60 + .../eslint/lib/rules/no-cond-assign.js | 159 + .../eslint/lib/rules/no-confusing-arrow.js | 85 + node_modules/eslint/lib/rules/no-console.js | 134 + .../eslint/lib/rules/no-const-assign.js | 54 + .../eslint/lib/rules/no-constant-condition.js | 253 + .../eslint/lib/rules/no-constructor-return.js | 62 + node_modules/eslint/lib/rules/no-continue.js | 39 + .../eslint/lib/rules/no-control-regex.js | 113 + node_modules/eslint/lib/rules/no-debugger.js | 43 + .../eslint/lib/rules/no-delete-var.js | 42 + node_modules/eslint/lib/rules/no-div-regex.js | 53 + node_modules/eslint/lib/rules/no-dupe-args.js | 80 + .../eslint/lib/rules/no-dupe-class-members.js | 103 + .../eslint/lib/rules/no-dupe-else-if.js | 122 + node_modules/eslint/lib/rules/no-dupe-keys.js | 143 + .../eslint/lib/rules/no-duplicate-case.js | 71 + .../eslint/lib/rules/no-duplicate-imports.js | 142 + .../eslint/lib/rules/no-else-return.js | 404 + .../lib/rules/no-empty-character-class.js | 64 + .../eslint/lib/rules/no-empty-function.js | 167 + .../eslint/lib/rules/no-empty-pattern.js | 43 + node_modules/eslint/lib/rules/no-empty.js | 86 + node_modules/eslint/lib/rules/no-eq-null.js | 46 + node_modules/eslint/lib/rules/no-eval.js | 277 + node_modules/eslint/lib/rules/no-ex-assign.js | 52 + .../eslint/lib/rules/no-extend-native.js | 178 + .../eslint/lib/rules/no-extra-bind.js | 213 + .../eslint/lib/rules/no-extra-boolean-cast.js | 316 + .../eslint/lib/rules/no-extra-label.js | 149 + .../eslint/lib/rules/no-extra-parens.js | 1177 + .../eslint/lib/rules/no-extra-semi.js | 126 + .../eslint/lib/rules/no-fallthrough.js | 142 + .../eslint/lib/rules/no-floating-decimal.js | 70 + .../eslint/lib/rules/no-func-assign.js | 76 + .../eslint/lib/rules/no-global-assign.js | 94 + .../eslint/lib/rules/no-implicit-coercion.js | 305 + .../eslint/lib/rules/no-implicit-globals.js | 140 + .../eslint/lib/rules/no-implied-eval.js | 131 + .../eslint/lib/rules/no-import-assign.js | 239 + .../eslint/lib/rules/no-inline-comments.js | 89 + .../eslint/lib/rules/no-inner-declarations.js | 88 + .../eslint/lib/rules/no-invalid-regexp.js | 130 + .../eslint/lib/rules/no-invalid-this.js | 145 + .../lib/rules/no-irregular-whitespace.js | 261 + node_modules/eslint/lib/rules/no-iterator.js | 52 + node_modules/eslint/lib/rules/no-label-var.js | 79 + node_modules/eslint/lib/rules/no-labels.js | 149 + .../eslint/lib/rules/no-lone-blocks.js | 128 + node_modules/eslint/lib/rules/no-lonely-if.js | 89 + node_modules/eslint/lib/rules/no-loop-func.js | 204 + .../eslint/lib/rules/no-loss-of-precision.js | 206 + .../eslint/lib/rules/no-magic-numbers.js | 226 + .../rules/no-misleading-character-class.js | 200 + .../eslint/lib/rules/no-mixed-operators.js | 243 + .../eslint/lib/rules/no-mixed-requires.js | 237 + .../lib/rules/no-mixed-spaces-and-tabs.js | 113 + .../eslint/lib/rules/no-multi-assign.js | 49 + .../eslint/lib/rules/no-multi-spaces.js | 138 + node_modules/eslint/lib/rules/no-multi-str.js | 65 + .../lib/rules/no-multiple-empty-lines.js | 151 + .../eslint/lib/rules/no-native-reassign.js | 97 + .../eslint/lib/rules/no-negated-condition.js | 95 + .../eslint/lib/rules/no-negated-in-lhs.js | 46 + .../eslint/lib/rules/no-nested-ternary.js | 44 + node_modules/eslint/lib/rules/no-new-func.js | 58 + .../eslint/lib/rules/no-new-object.js | 57 + .../eslint/lib/rules/no-new-require.js | 49 + .../eslint/lib/rules/no-new-symbol.js | 54 + .../eslint/lib/rules/no-new-wrappers.js | 48 + node_modules/eslint/lib/rules/no-new.js | 43 + node_modules/eslint/lib/rules/no-obj-calls.js | 84 + .../eslint/lib/rules/no-octal-escape.js | 56 + node_modules/eslint/lib/rules/no-octal.js | 45 + .../eslint/lib/rules/no-param-reassign.js | 229 + .../eslint/lib/rules/no-path-concat.js | 63 + node_modules/eslint/lib/rules/no-plusplus.js | 105 + .../eslint/lib/rules/no-process-env.js | 50 + .../eslint/lib/rules/no-process-exit.js | 46 + .../lib/rules/no-promise-executor-return.js | 121 + node_modules/eslint/lib/rules/no-proto.js | 48 + .../eslint/lib/rules/no-prototype-builtins.js | 71 + node_modules/eslint/lib/rules/no-redeclare.js | 172 + .../eslint/lib/rules/no-regex-spaces.js | 180 + .../eslint/lib/rules/no-restricted-exports.js | 90 + .../eslint/lib/rules/no-restricted-globals.js | 122 + .../eslint/lib/rules/no-restricted-imports.js | 268 + .../eslint/lib/rules/no-restricted-modules.js | 214 + .../lib/rules/no-restricted-properties.js | 181 + .../eslint/lib/rules/no-restricted-syntax.js | 70 + .../eslint/lib/rules/no-return-assign.js | 80 + .../eslint/lib/rules/no-return-await.js | 103 + .../eslint/lib/rules/no-script-url.js | 48 + .../eslint/lib/rules/no-self-assign.js | 183 + .../eslint/lib/rules/no-self-compare.js | 60 + node_modules/eslint/lib/rules/no-sequences.js | 119 + .../eslint/lib/rules/no-setter-return.js | 224 + .../lib/rules/no-shadow-restricted-names.js | 64 + node_modules/eslint/lib/rules/no-shadow.js | 192 + .../eslint/lib/rules/no-spaced-func.js | 83 + .../eslint/lib/rules/no-sparse-arrays.js | 50 + node_modules/eslint/lib/rules/no-sync.js | 65 + node_modules/eslint/lib/rules/no-tabs.js | 78 + .../lib/rules/no-template-curly-in-string.js | 44 + node_modules/eslint/lib/rules/no-ternary.js | 41 + .../eslint/lib/rules/no-this-before-super.js | 304 + .../eslint/lib/rules/no-throw-literal.js | 51 + .../eslint/lib/rules/no-trailing-spaces.js | 190 + .../eslint/lib/rules/no-undef-init.js | 75 + node_modules/eslint/lib/rules/no-undef.js | 78 + node_modules/eslint/lib/rules/no-undefined.js | 84 + .../eslint/lib/rules/no-underscore-dangle.js | 277 + .../lib/rules/no-unexpected-multiline.js | 120 + .../lib/rules/no-unmodified-loop-condition.js | 360 + .../eslint/lib/rules/no-unneeded-ternary.js | 166 + .../eslint/lib/rules/no-unreachable-loop.js | 150 + .../eslint/lib/rules/no-unreachable.js | 218 + .../eslint/lib/rules/no-unsafe-finally.js | 111 + .../eslint/lib/rules/no-unsafe-negation.js | 127 + .../eslint/lib/rules/no-unused-expressions.js | 172 + .../eslint/lib/rules/no-unused-labels.js | 110 + .../eslint/lib/rules/no-unused-vars.js | 648 + .../eslint/lib/rules/no-use-before-define.js | 233 + .../lib/rules/no-useless-backreference.js | 193 + .../eslint/lib/rules/no-useless-call.js | 90 + .../eslint/lib/rules/no-useless-catch.js | 57 + .../lib/rules/no-useless-computed-key.js | 103 + .../eslint/lib/rules/no-useless-concat.js | 115 + .../lib/rules/no-useless-constructor.js | 181 + .../eslint/lib/rules/no-useless-escape.js | 252 + .../eslint/lib/rules/no-useless-rename.js | 168 + .../eslint/lib/rules/no-useless-return.js | 305 + node_modules/eslint/lib/rules/no-var.js | 334 + node_modules/eslint/lib/rules/no-void.js | 64 + .../eslint/lib/rules/no-warning-comments.js | 196 + .../rules/no-whitespace-before-property.js | 113 + node_modules/eslint/lib/rules/no-with.js | 39 + .../rules/nonblock-statement-body-position.js | 124 + .../eslint/lib/rules/object-curly-newline.js | 306 + .../eslint/lib/rules/object-curly-spacing.js | 308 + .../lib/rules/object-property-newline.js | 99 + .../eslint/lib/rules/object-shorthand.js | 508 + .../lib/rules/one-var-declaration-per-line.js | 92 + node_modules/eslint/lib/rules/one-var.js | 535 + .../eslint/lib/rules/operator-assignment.js | 204 + .../eslint/lib/rules/operator-linebreak.js | 247 + .../eslint/lib/rules/padded-blocks.js | 298 + .../rules/padding-line-between-statements.js | 632 + .../eslint/lib/rules/prefer-arrow-callback.js | 379 + node_modules/eslint/lib/rules/prefer-const.js | 476 + .../eslint/lib/rules/prefer-destructuring.js | 277 + .../rules/prefer-exponentiation-operator.js | 189 + .../lib/rules/prefer-named-capture-group.js | 110 + .../lib/rules/prefer-numeric-literals.js | 148 + .../eslint/lib/rules/prefer-object-spread.js | 299 + .../lib/rules/prefer-promise-reject-errors.js | 131 + .../eslint/lib/rules/prefer-reflect.js | 127 + .../eslint/lib/rules/prefer-regex-literals.js | 180 + .../eslint/lib/rules/prefer-rest-params.js | 115 + .../eslint/lib/rules/prefer-spread.js | 87 + .../eslint/lib/rules/prefer-template.js | 283 + node_modules/eslint/lib/rules/quote-props.js | 307 + node_modules/eslint/lib/rules/quotes.js | 332 + node_modules/eslint/lib/rules/radix.js | 181 + .../lib/rules/require-atomic-updates.js | 283 + .../eslint/lib/rules/require-await.js | 113 + .../eslint/lib/rules/require-jsdoc.js | 121 + .../lib/rules/require-unicode-regexp.js | 69 + .../eslint/lib/rules/require-yield.js | 78 + .../eslint/lib/rules/rest-spread-spacing.js | 120 + node_modules/eslint/lib/rules/semi-spacing.js | 244 + node_modules/eslint/lib/rules/semi-style.js | 151 + node_modules/eslint/lib/rules/semi.js | 336 + node_modules/eslint/lib/rules/sort-imports.js | 241 + node_modules/eslint/lib/rules/sort-keys.js | 187 + node_modules/eslint/lib/rules/sort-vars.js | 104 + .../eslint/lib/rules/space-before-blocks.js | 164 + .../lib/rules/space-before-function-paren.js | 164 + .../eslint/lib/rules/space-in-parens.js | 282 + .../eslint/lib/rules/space-infix-ops.js | 169 + .../eslint/lib/rules/space-unary-ops.js | 321 + .../eslint/lib/rules/spaced-comment.js | 382 + node_modules/eslint/lib/rules/strict.js | 277 + .../eslint/lib/rules/switch-colon-spacing.js | 141 + .../eslint/lib/rules/symbol-description.js | 71 + .../lib/rules/template-curly-spacing.js | 141 + .../eslint/lib/rules/template-tag-spacing.js | 90 + node_modules/eslint/lib/rules/unicode-bom.js | 73 + node_modules/eslint/lib/rules/use-isnan.js | 138 + .../eslint/lib/rules/utils/ast-utils.js | 1794 + .../eslint/lib/rules/utils/fix-tracker.js | 114 + .../eslint/lib/rules/utils/keywords.js | 67 + .../lib/rules/utils/lazy-loading-rule-map.js | 115 + .../lib/rules/utils/patterns/letters.js | 36 + .../eslint/lib/rules/utils/unicode/index.js | 11 + .../utils/unicode/is-combining-character.js | 13 + .../rules/utils/unicode/is-emoji-modifier.js | 13 + .../unicode/is-regional-indicator-symbol.js | 13 + .../rules/utils/unicode/is-surrogate-pair.js | 14 + node_modules/eslint/lib/rules/valid-jsdoc.js | 515 + node_modules/eslint/lib/rules/valid-typeof.js | 85 + node_modules/eslint/lib/rules/vars-on-top.js | 144 + node_modules/eslint/lib/rules/wrap-iife.js | 204 + node_modules/eslint/lib/rules/wrap-regex.js | 59 + .../eslint/lib/rules/yield-star-spacing.js | 127 + node_modules/eslint/lib/rules/yoda.js | 352 + node_modules/eslint/lib/shared/ajv.js | 34 + node_modules/eslint/lib/shared/ast-utils.js | 29 + .../eslint/lib/shared/config-validator.js | 338 + .../eslint/lib/shared/deprecation-warnings.js | 56 + node_modules/eslint/lib/shared/logging.js | 30 + .../lib/shared/relative-module-resolver.js | 56 + .../eslint/lib/shared/runtime-info.js | 163 + node_modules/eslint/lib/shared/traverser.js | 195 + node_modules/eslint/lib/shared/types.js | 150 + node_modules/eslint/lib/source-code/index.js | 5 + .../eslint/lib/source-code/source-code.js | 586 + .../backward-token-comment-cursor.js | 57 + .../token-store/backward-token-cursor.js | 58 + .../lib/source-code/token-store/cursor.js | 76 + .../lib/source-code/token-store/cursors.js | 90 + .../token-store/decorative-cursor.js | 39 + .../source-code/token-store/filter-cursor.js | 43 + .../forward-token-comment-cursor.js | 57 + .../token-store/forward-token-cursor.js | 63 + .../lib/source-code/token-store/index.js | 627 + .../source-code/token-store/limit-cursor.js | 40 + .../token-store/padded-token-cursor.js | 38 + .../source-code/token-store/skip-cursor.js | 42 + .../lib/source-code/token-store/utils.js | 100 + .../eslint/messages/all-files-ignored.txt | 8 + .../eslint/messages/extend-config-missing.txt | 5 + .../eslint/messages/failed-to-read-json.txt | 3 + .../eslint/messages/file-not-found.txt | 2 + .../eslint/messages/no-config-found.txt | 7 + .../eslint/messages/plugin-conflict.txt | 7 + .../eslint/messages/plugin-invalid.txt | 8 + .../eslint/messages/plugin-missing.txt | 11 + .../print-config-with-directory-path.txt | 2 + .../eslint/messages/whitespace-found.txt | 3 + .../eslint/node_modules/.bin/node-which | 1 + .../node_modules/ansi-styles/index.d.ts | 197 + .../eslint/node_modules/ansi-styles/index.js | 163 + .../eslint/node_modules/ansi-styles/license | 9 + .../node_modules/ansi-styles/package.json | 57 + .../eslint/node_modules/ansi-styles/readme.md | 158 + .../eslint/node_modules/chalk/index.d.ts | 415 + .../eslint/node_modules/chalk/license | 9 + .../eslint/node_modules/chalk/package.json | 68 + .../eslint/node_modules/chalk/readme.md | 293 + .../eslint/node_modules/chalk/source/index.js | 229 + .../node_modules/chalk/source/templates.js | 134 + .../eslint/node_modules/chalk/source/util.js | 39 + .../node_modules/color-convert/CHANGELOG.md | 54 + .../eslint/node_modules/color-convert/LICENSE | 21 + .../node_modules/color-convert/README.md | 68 + .../node_modules/color-convert/conversions.js | 839 + .../node_modules/color-convert/index.js | 81 + .../node_modules/color-convert/package.json | 48 + .../node_modules/color-convert/route.js | 97 + .../eslint/node_modules/color-name/LICENSE | 8 + .../eslint/node_modules/color-name/README.md | 11 + .../eslint/node_modules/color-name/index.js | 152 + .../node_modules/color-name/package.json | 28 + .../node_modules/cross-spawn/CHANGELOG.md | 130 + .../eslint/node_modules/cross-spawn/LICENSE | 21 + .../eslint/node_modules/cross-spawn/README.md | 96 + .../eslint/node_modules/cross-spawn/index.js | 39 + .../node_modules/cross-spawn/lib/enoent.js | 59 + .../node_modules/cross-spawn/lib/parse.js | 91 + .../cross-spawn/lib/util/escape.js | 45 + .../cross-spawn/lib/util/readShebang.js | 23 + .../cross-spawn/lib/util/resolveCommand.js | 52 + .../node_modules/cross-spawn/package.json | 73 + .../eslint/node_modules/doctrine/CHANGELOG.md | 101 + .../eslint/node_modules/doctrine/LICENSE | 177 + .../doctrine/LICENSE.closure-compiler | 202 + .../node_modules/doctrine/LICENSE.esprima} | 0 .../eslint/node_modules/doctrine/README.md | 165 + .../node_modules/doctrine/lib/doctrine.js | 898 + .../eslint/node_modules/doctrine/lib/typed.js | 1305 + .../node_modules/doctrine/lib/utility.js | 35 + .../eslint/node_modules/doctrine/package.json | 58 + .../eslint-visitor-keys/CHANGELOG.md | 25 + .../node_modules/eslint-visitor-keys/LICENSE | 201 + .../eslint-visitor-keys/README.md | 98 + .../eslint-visitor-keys/lib/index.js | 81 + .../eslint-visitor-keys/lib/visitor-keys.json | 284 + .../eslint-visitor-keys/package.json | 40 + .../eslint/node_modules/has-flag/index.d.ts | 39 + .../eslint/node_modules/has-flag/index.js | 8 + .../eslint/node_modules/has-flag/license | 9 + .../eslint/node_modules/has-flag/package.json | 46 + .../eslint/node_modules/has-flag/readme.md | 89 + .../eslint/node_modules/ignore/CHANGELOG.md | 19 + .../eslint/node_modules/ignore/LICENSE-MIT | 21 + .../eslint/node_modules/ignore/README.md | 307 + .../eslint/node_modules/ignore/index.d.ts | 45 + .../eslint/node_modules/ignore/index.js | 463 + .../eslint/node_modules/ignore/legacy.js | 466 + .../eslint/node_modules/ignore/package.json | 64 + .../eslint/node_modules/path-key/index.d.ts | 40 + .../eslint/node_modules/path-key/index.js | 16 + .../eslint/node_modules/path-key/license | 9 + .../eslint/node_modules/path-key/package.json | 39 + .../eslint/node_modules/path-key/readme.md | 61 + .../node_modules/shebang-command/index.js | 19 + .../node_modules/shebang-command/license | 9 + .../node_modules/shebang-command/package.json | 34 + .../node_modules/shebang-command/readme.md | 34 + .../node_modules/shebang-regex/index.d.ts | 22 + .../node_modules/shebang-regex/index.js | 2 + .../eslint/node_modules/shebang-regex/license | 9 + .../node_modules/shebang-regex/package.json | 35 + .../node_modules/shebang-regex/readme.md | 33 + .../strip-json-comments/index.d.ts | 36 + .../node_modules/strip-json-comments/index.js | 77 + .../node_modules/strip-json-comments/license | 9 + .../strip-json-comments/package.json | 47 + .../strip-json-comments/readme.md | 78 + .../node_modules/supports-color/browser.js | 5 + .../node_modules/supports-color/index.js | 135 + .../node_modules/supports-color/license | 9 + .../node_modules/supports-color/package.json | 53 + .../node_modules/supports-color/readme.md | 76 + .../eslint/node_modules/which/CHANGELOG.md | 166 + .../node_modules/which}/LICENSE | 0 .../eslint/node_modules/which/README.md | 54 + .../eslint/node_modules/which/bin/node-which | 52 + .../eslint/node_modules/which/package.json | 43 + .../eslint/node_modules/which/which.js | 125 + node_modules/eslint/package.json | 146 + node_modules/espree/CHANGELOG.md | 503 + node_modules/espree/LICENSE | 25 + node_modules/espree/README.md | 233 + node_modules/espree/espree.js | 177 + node_modules/espree/lib/ast-node-types.js | 96 + node_modules/espree/lib/espree.js | 286 + node_modules/espree/lib/features.js | 29 + node_modules/espree/lib/options.js | 106 + node_modules/espree/lib/token-translator.js | 263 + node_modules/espree/lib/visitor-keys.js | 123 + node_modules/espree/node_modules/.bin/acorn | 1 + .../espree/node_modules/acorn/CHANGELOG.md | 620 + .../espree/node_modules/acorn/LICENSE | 21 + .../espree/node_modules/acorn/README.md | 269 + .../espree/node_modules/acorn/bin/acorn | 4 + .../espree/node_modules/acorn/dist/acorn.d.ts | 209 + .../espree/node_modules/acorn/dist/acorn.js | 5186 ++ .../node_modules/acorn/dist/acorn.js.map | 1 + .../espree/node_modules/acorn/dist/acorn.mjs | 5155 ++ .../node_modules/acorn/dist/acorn.mjs.d.ts | 2 + .../node_modules/acorn/dist/acorn.mjs.map | 1 + .../espree/node_modules/acorn/dist/bin.js | 64 + .../espree/node_modules/acorn/package.json | 39 + .../eslint-visitor-keys/CHANGELOG.md | 25 + .../node_modules/eslint-visitor-keys/LICENSE | 201 + .../eslint-visitor-keys/README.md | 98 + .../eslint-visitor-keys/lib/index.js | 81 + .../eslint-visitor-keys/lib/visitor-keys.json | 284 + .../eslint-visitor-keys/package.json | 40 + node_modules/espree/package.json | 64 + node_modules/esquery/README.md | 27 + node_modules/esquery/dist/esquery.esm.js | 4545 ++ node_modules/esquery/dist/esquery.esm.min.js | 2 + .../esquery/dist/esquery.esm.min.js.map | 1 + node_modules/esquery/dist/esquery.js | 4553 ++ node_modules/esquery/dist/esquery.min.js | 2 + node_modules/esquery/dist/esquery.min.js.map | 1 + node_modules/esquery/license.txt | 24 + .../esquery/node_modules/estraverse/.jshintrc | 16 + .../node_modules/estraverse}/LICENSE.BSD | 0 .../esquery/node_modules/estraverse/README.md | 153 + .../node_modules/estraverse/estraverse.js | 801 + .../node_modules/estraverse/gulpfile.js | 70 + .../node_modules/estraverse/package.json | 40 + node_modules/esquery/package.json | 78 + node_modules/esquery/parser.js | 2572 + node_modules/esrecurse/.babelrc | 3 + node_modules/esrecurse/README.md | 171 + node_modules/esrecurse/esrecurse.js | 117 + node_modules/esrecurse/gulpfile.babel.js | 92 + .../node_modules/estraverse/.jshintrc | 16 + .../node_modules/estraverse/LICENSE.BSD | 19 + .../node_modules/estraverse/README.md | 153 + .../node_modules/estraverse/estraverse.js | 801 + .../node_modules/estraverse/gulpfile.js | 70 + .../node_modules/estraverse/package.json | 40 + node_modules/esrecurse/package.json | 52 + node_modules/estraverse/.jshintrc | 16 + node_modules/estraverse/LICENSE.BSD | 19 + node_modules/estraverse/README.md | 153 + node_modules/estraverse/estraverse.js | 782 + node_modules/estraverse/gulpfile.js | 70 + node_modules/estraverse/package.json | 40 + node_modules/fast-deep-equal/LICENSE | 21 + node_modules/fast-deep-equal/README.md | 96 + node_modules/fast-deep-equal/es6/index.d.ts | 2 + node_modules/fast-deep-equal/es6/index.js | 72 + node_modules/fast-deep-equal/es6/react.d.ts | 2 + node_modules/fast-deep-equal/es6/react.js | 79 + node_modules/fast-deep-equal/index.d.ts | 4 + node_modules/fast-deep-equal/index.js | 46 + node_modules/fast-deep-equal/package.json | 61 + node_modules/fast-deep-equal/react.d.ts | 2 + node_modules/fast-deep-equal/react.js | 53 + .../fast-json-stable-stringify/.eslintrc.yml | 26 + .../.github/FUNDING.yml | 1 + .../fast-json-stable-stringify/.travis.yml | 8 + .../fast-json-stable-stringify/LICENSE | 21 + .../fast-json-stable-stringify/README.md | 131 + .../benchmark/index.js | 31 + .../benchmark/test.json | 137 + .../example/key_cmp.js | 7 + .../example/nested.js | 3 + .../fast-json-stable-stringify/example/str.js | 3 + .../example/value_cmp.js | 7 + .../fast-json-stable-stringify/index.d.ts | 4 + .../fast-json-stable-stringify/index.js | 59 + .../fast-json-stable-stringify/package.json | 52 + .../fast-json-stable-stringify/test/cmp.js | 13 + .../fast-json-stable-stringify/test/nested.js | 44 + .../fast-json-stable-stringify/test/str.js | 46 + .../test/to-json.js | 22 + node_modules/fast-levenshtein/LICENSE.md | 25 + node_modules/fast-levenshtein/README.md | 104 + node_modules/fast-levenshtein/levenshtein.js | 136 + node_modules/fast-levenshtein/package.json | 39 + node_modules/file-entry-cache/LICENSE | 22 + node_modules/file-entry-cache/README.md | 112 + node_modules/file-entry-cache/cache.js | 286 + node_modules/file-entry-cache/changelog.md | 141 + node_modules/file-entry-cache/package.json | 84 + node_modules/flat-cache/LICENSE | 22 + node_modules/flat-cache/README.md | 73 + node_modules/flat-cache/cache.js | 197 + node_modules/flat-cache/changelog.md | 300 + node_modules/flat-cache/del.js | 13 + .../flat-cache/node_modules/.bin/rimraf | 1 + .../flat-cache/node_modules/rimraf/LICENSE | 15 + .../flat-cache/node_modules/rimraf/README.md | 101 + .../flat-cache/node_modules/rimraf/bin.js | 50 + .../node_modules/rimraf/package.json | 29 + .../flat-cache/node_modules/rimraf/rimraf.js | 364 + node_modules/flat-cache/package.json | 87 + node_modules/flat-cache/utils.js | 39 + node_modules/flatted/.github/FUNDING.yml | 8 + node_modules/flatted/LICENSE | 15 + node_modules/flatted/README.md | 65 + node_modules/flatted/SPECS.md | 94 + node_modules/flatted/cjs/index.js | 114 + node_modules/flatted/esm/index.js | 116 + node_modules/flatted/index.js | 113 + node_modules/flatted/min.js | 2 + node_modules/flatted/package.json | 44 + node_modules/flatted/types.d.ts | 19 + node_modules/function-bind/.editorconfig | 20 + node_modules/function-bind/.eslintrc | 15 + node_modules/function-bind/.jscs.json | 176 + node_modules/function-bind/.npmignore | 22 + node_modules/function-bind/.travis.yml | 168 + node_modules/function-bind/LICENSE | 20 + node_modules/function-bind/README.md | 48 + node_modules/function-bind/implementation.js | 52 + node_modules/function-bind/index.js | 5 + node_modules/function-bind/package.json | 63 + node_modules/function-bind/test/.eslintrc | 9 + node_modules/function-bind/test/index.js | 252 + .../functional-red-black-tree/.npmignore | 16 + .../functional-red-black-tree/LICENSE | 22 + .../functional-red-black-tree/README.md | 237 + .../functional-red-black-tree/bench/test.js | 11 + .../functional-red-black-tree/package.json | 40 + .../functional-red-black-tree/rbtree.js | 996 + .../functional-red-black-tree/test/test.js | 479 + node_modules/get-stdin/index.js | 52 + node_modules/get-stdin/license | 9 + node_modules/get-stdin/package.json | 35 + node_modules/get-stdin/readme.md | 55 + node_modules/globals/globals.json | 1586 + node_modules/globals/index.d.ts | 6 + node_modules/globals/index.js | 2 + node_modules/globals/license | 9 + node_modules/globals/package.json | 52 + node_modules/globals/readme.md | 56 + node_modules/has-symbols/.eslintrc | 11 + node_modules/has-symbols/.github/FUNDING.yml | 12 + .../has-symbols/.github/workflows/rebase.yml | 15 + node_modules/has-symbols/.travis.yml | 12 + node_modules/has-symbols/CHANGELOG.md | 34 + node_modules/has-symbols/LICENSE | 21 + node_modules/has-symbols/README.md | 45 + node_modules/has-symbols/index.js | 13 + node_modules/has-symbols/package.json | 89 + node_modules/has-symbols/shams.js | 42 + node_modules/has-symbols/test/index.js | 22 + .../has-symbols/test/shams/core-js.js | 28 + .../test/shams/get-own-property-symbols.js | 28 + node_modules/has-symbols/test/tests.js | 54 + node_modules/has/LICENSE-MIT | 22 + node_modules/has/README.md | 18 + node_modules/has/package.json | 48 + node_modules/has/src/index.js | 5 + node_modules/has/test/index.js | 10 + node_modules/import-fresh/index.d.ts | 28 + node_modules/import-fresh/index.js | 32 + node_modules/import-fresh/license | 9 + .../node_modules/resolve-from/index.js | 47 + .../node_modules/resolve-from/license | 9 + .../node_modules/resolve-from/package.json | 34 + .../node_modules/resolve-from/readme.md | 72 + node_modules/import-fresh/package.json | 42 + node_modules/import-fresh/readme.md | 52 + node_modules/is-callable/.editorconfig | 21 + node_modules/is-callable/.eslintrc | 21 + node_modules/is-callable/.github/FUNDING.yml | 12 + .../is-callable/.github/main.workflow | 14 + .../is-callable/.github/workflows/rebase.yml | 15 + node_modules/is-callable/.istanbul.yml | 47 + node_modules/is-callable/.travis.yml | 12 + node_modules/is-callable/CHANGELOG.md | 81 + node_modules/is-callable/LICENSE | 22 + node_modules/is-callable/README.md | 68 + node_modules/is-callable/index.js | 66 + node_modules/is-callable/package.json | 100 + node_modules/is-callable/test/index.js | 190 + node_modules/is-date-object/.eslintrc | 9 + .../is-date-object/.github/FUNDING.yml | 12 + .../.github/workflows/rebase.yml | 15 + node_modules/is-date-object/.jscs.json | 176 + node_modules/is-date-object/.travis.yml | 12 + node_modules/is-date-object/CHANGELOG.md | 76 + node_modules/is-date-object/LICENSE | 22 + node_modules/is-date-object/README.md | 53 + node_modules/is-date-object/index.js | 22 + node_modules/is-date-object/package.json | 73 + node_modules/is-date-object/test/index.js | 36 + node_modules/is-negative-zero/.eslintrc | 10 + node_modules/is-negative-zero/.jscs.json | 104 + node_modules/is-negative-zero/.npmignore | 15 + node_modules/is-negative-zero/.travis.yml | 46 + node_modules/is-negative-zero/LICENSE | 20 + node_modules/is-negative-zero/README.md | 56 + node_modules/is-negative-zero/index.js | 6 + node_modules/is-negative-zero/package.json | 64 + node_modules/is-negative-zero/test.js | 28 + node_modules/is-regex/.editorconfig | 20 + node_modules/is-regex/.eslintrc | 19 + .../is-regex/.github/workflows/rebase.yml | 15 + node_modules/is-regex/.travis.yml | 12 + node_modules/is-regex/CHANGELOG.md | 163 + node_modules/is-regex/LICENSE | 20 + node_modules/is-regex/README.md | 54 + node_modules/is-regex/index.js | 58 + node_modules/is-regex/package.json | 83 + node_modules/is-regex/test/index.js | 105 + node_modules/is-string/.eslintrc | 19 + node_modules/is-string/.github/FUNDING.yml | 12 + .../is-string/.github/workflows/rebase.yml | 15 + node_modules/is-string/.travis.yml | 12 + node_modules/is-string/CHANGELOG.md | 84 + node_modules/is-string/LICENSE | 22 + node_modules/is-string/README.md | 57 + node_modules/is-string/index.js | 24 + node_modules/is-string/package.json | 76 + node_modules/is-string/test/index.js | 39 + node_modules/is-symbol/.editorconfig | 13 + node_modules/is-symbol/.eslintrc | 14 + node_modules/is-symbol/.github/FUNDING.yml | 12 + .../is-symbol/.github/workflows/rebase.yml | 15 + node_modules/is-symbol/.nvmrc | 1 + node_modules/is-symbol/.travis.yml | 12 + node_modules/is-symbol/CHANGELOG.md | 86 + node_modules/is-symbol/LICENSE | 22 + node_modules/is-symbol/Makefile | 61 + node_modules/is-symbol/README.md | 44 + node_modules/is-symbol/index.js | 35 + node_modules/is-symbol/package.json | 76 + node_modules/is-symbol/test/index.js | 92 + .../json-schema-traverse/.eslintrc.yml | 27 + node_modules/json-schema-traverse/.travis.yml | 8 + node_modules/json-schema-traverse/LICENSE | 21 + node_modules/json-schema-traverse/README.md | 83 + node_modules/json-schema-traverse/index.js | 89 + .../json-schema-traverse/package.json | 43 + .../json-schema-traverse/spec/.eslintrc.yml | 6 + .../spec/fixtures/schema.js | 125 + .../json-schema-traverse/spec/index.spec.js | 171 + .../.npmignore | 1 + .../.travis.yml | 4 + .../LICENSE | 18 + .../example/key_cmp.js | 7 + .../example/nested.js | 3 + .../example/str.js | 3 + .../example/value_cmp.js | 7 + .../index.js | 82 + .../package.json | 44 + .../readme.markdown | 132 + .../test/cmp.js | 11 + .../test/nested.js | 42 + .../test/replacer.js | 74 + .../test/space.js | 59 + .../test/str.js | 32 + .../test/to-json.js | 20 + node_modules/json5/CHANGELOG.md | 274 + node_modules/json5/LICENSE.md | 23 + node_modules/json5/README.md | 234 + node_modules/json5/dist/index.js | 1 + node_modules/json5/lib/cli.js | 2 + node_modules/json5/lib/index.js | 1 + node_modules/json5/lib/parse.js | 1 + node_modules/json5/lib/register.js | 1 + node_modules/json5/lib/require.js | 1 + node_modules/json5/lib/stringify.js | 1 + node_modules/json5/lib/unicode.js | 1 + node_modules/json5/lib/util.js | 1 + node_modules/json5/package.json | 76 + node_modules/levn/LICENSE | 22 + node_modules/levn/README.md | 196 + node_modules/levn/lib/cast.js | 327 + node_modules/levn/lib/index.js | 22 + node_modules/levn/lib/parse-string.js | 113 + node_modules/levn/package.json | 46 + node_modules/lodash.camelcase/LICENSE | 47 + node_modules/lodash.camelcase/README.md | 18 + node_modules/lodash.camelcase/index.js | 599 + node_modules/lodash.camelcase/package.json | 19 + node_modules/lodash.kebabcase/LICENSE | 47 + node_modules/lodash.kebabcase/README.md | 18 + node_modules/lodash.kebabcase/index.js | 435 + node_modules/lodash.kebabcase/package.json | 19 + node_modules/lodash.snakecase/LICENSE | 47 + node_modules/lodash.snakecase/README.md | 18 + node_modules/lodash.snakecase/index.js | 435 + node_modules/lodash.snakecase/package.json | 19 + node_modules/lodash.upperfirst/LICENSE | 47 + node_modules/lodash.upperfirst/README.md | 18 + node_modules/lodash.upperfirst/index.js | 303 + node_modules/lodash.upperfirst/package.json | 19 + node_modules/natural-compare/README.md | 125 + node_modules/natural-compare/index.js | 57 + node_modules/natural-compare/package.json | 42 + node_modules/object-inspect/.eslintignore | 1 + node_modules/object-inspect/.eslintrc | 64 + .../.github/workflows/rebase.yml | 15 + node_modules/object-inspect/.nycrc | 17 + node_modules/object-inspect/.travis.yml | 53 + node_modules/object-inspect/LICENSE | 21 + node_modules/object-inspect/example/all.js | 23 + .../object-inspect/example/circular.js | 6 + node_modules/object-inspect/example/fn.js | 5 + .../object-inspect/example/inspect.js | 10 + node_modules/object-inspect/index.js | 383 + node_modules/object-inspect/package.json | 73 + node_modules/object-inspect/readme.markdown | 62 + node_modules/object-inspect/test-core-js.js | 26 + node_modules/object-inspect/test/bigint.js | 31 + .../object-inspect/test/browser/dom.js | 15 + node_modules/object-inspect/test/circular.js | 9 + node_modules/object-inspect/test/deep.js | 9 + node_modules/object-inspect/test/element.js | 53 + node_modules/object-inspect/test/err.js | 31 + node_modules/object-inspect/test/fn.js | 28 + node_modules/object-inspect/test/has.js | 34 + node_modules/object-inspect/test/holes.js | 15 + .../object-inspect/test/indent-option.js | 271 + node_modules/object-inspect/test/inspect.js | 35 + node_modules/object-inspect/test/lowbyte.js | 12 + node_modules/object-inspect/test/number.js | 12 + .../object-inspect/test/quoteStyle.js | 17 + node_modules/object-inspect/test/undef.js | 12 + node_modules/object-inspect/test/values.js | 171 + node_modules/object-inspect/util.inspect.js | 1 + node_modules/object-keys/.editorconfig | 13 + node_modules/object-keys/.eslintrc | 17 + node_modules/object-keys/.travis.yml | 277 + node_modules/object-keys/CHANGELOG.md | 232 + node_modules/object-keys/LICENSE | 21 + node_modules/object-keys/README.md | 76 + node_modules/object-keys/implementation.js | 122 + node_modules/object-keys/index.js | 32 + node_modules/object-keys/isArguments.js | 17 + node_modules/object-keys/package.json | 88 + node_modules/object-keys/test/index.js | 5 + node_modules/object.assign/.editorconfig | 20 + node_modules/object.assign/.eslintignore | 1 + node_modules/object.assign/.eslintrc | 26 + .../object.assign/.github/FUNDING.yml | 12 + .../.github/workflows/rebase.yml | 15 + .../.github/workflows/require-allow-edits.yml | 14 + node_modules/object.assign/CHANGELOG.md | 194 + node_modules/object.assign/LICENSE | 21 + node_modules/object.assign/README.md | 135 + node_modules/object.assign/auto.js | 3 + node_modules/object.assign/dist/browser.js | 840 + node_modules/object.assign/hasSymbols.js | 43 + node_modules/object.assign/implementation.js | 42 + node_modules/object.assign/index.js | 22 + .../node_modules/es-abstract/.editorconfig | 13 + .../node_modules/es-abstract/.eslintignore | 1 + .../node_modules/es-abstract/.eslintrc | 72 + .../node_modules/es-abstract/.gitattributes | 613 + .../es-abstract/.github/FUNDING.yml | 12 + .../.github/workflows/codeql-analysis.yml | 52 + .../es-abstract/.github/workflows/rebase.yml | 15 + .../node_modules/es-abstract/.nycrc | 14 + .../node_modules/es-abstract/.travis.yml | 32 + .../2015/AbstractEqualityComparison.js | 37 + .../2015/AbstractRelationalComparison.js | 66 + .../es-abstract/2015/AdvanceStringIndex.js | 47 + .../es-abstract/2015/ArrayCreate.js | 53 + .../es-abstract/2015/ArraySetLength.js | 85 + .../es-abstract/2015/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2015/Call.js | 13 + .../2015/CanonicalNumericIndexString.js | 22 + .../2015/CompletePropertyDescriptor.js | 39 + .../es-abstract/2015/CreateDataProperty.js | 45 + .../2015/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2015/CreateHTML.js | 30 + .../2015/CreateIterResultObject.js | 19 + .../2015/CreateListFromArrayLike.js | 43 + .../es-abstract/2015/CreateMethodProperty.js | 40 + .../es-abstract/2015/DateFromTime.js | 54 + .../node_modules/es-abstract/2015/Day.js | 11 + .../es-abstract/2015/DayFromYear.js | 10 + .../es-abstract/2015/DayWithinYear.js | 11 + .../es-abstract/2015/DaysInYear.js | 18 + .../es-abstract/2015/DefinePropertyOrThrow.js | 50 + .../es-abstract/2015/DeletePropertyOrThrow.js | 27 + .../es-abstract/2015/EnumerableOwnNames.js | 19 + .../2015/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2015/Get.js | 30 + .../es-abstract/2015/GetIterator.js | 35 + .../es-abstract/2015/GetMethod.js | 42 + .../es-abstract/2015/GetOwnPropertyKeys.js | 31 + .../2015/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2015/GetSubstitution.js | 104 + .../node_modules/es-abstract/2015/GetV.js | 29 + .../es-abstract/2015/HasOwnProperty.js | 22 + .../es-abstract/2015/HasProperty.js | 20 + .../es-abstract/2015/HourFromTime.js | 14 + .../es-abstract/2015/InLeapYear.js | 21 + .../es-abstract/2015/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2015/Invoke.js | 22 + .../es-abstract/2015/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2015/IsArray.js | 14 + .../es-abstract/2015/IsCallable.js | 5 + .../es-abstract/2015/IsConcatSpreadable.js | 25 + .../es-abstract/2015/IsConstructor.js | 40 + .../es-abstract/2015/IsDataDescriptor.js | 23 + .../es-abstract/2015/IsExtensible.js | 20 + .../es-abstract/2015/IsGenericDescriptor.js | 23 + .../es-abstract/2015/IsInteger.js | 17 + .../es-abstract/2015/IsPromise.js | 24 + .../es-abstract/2015/IsPropertyDescriptor.js | 17 + .../es-abstract/2015/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2015/IsRegExp.js | 24 + .../es-abstract/2015/IteratorClose.js | 50 + .../es-abstract/2015/IteratorComplete.js | 18 + .../es-abstract/2015/IteratorNext.js | 18 + .../es-abstract/2015/IteratorStep.js | 13 + .../es-abstract/2015/IteratorValue.js | 18 + .../node_modules/es-abstract/2015/MakeDate.js | 13 + .../node_modules/es-abstract/2015/MakeDay.js | 33 + .../node_modules/es-abstract/2015/MakeTime.js | 23 + .../es-abstract/2015/MinFromTime.js | 14 + .../es-abstract/2015/MonthFromTime.js | 47 + .../es-abstract/2015/ObjectCreate.js | 37 + .../2015/OrdinaryCreateFromConstructor.js | 20 + .../2015/OrdinaryDefineOwnProperty.js | 61 + .../2015/OrdinaryGetOwnProperty.js | 44 + .../es-abstract/2015/OrdinaryHasInstance.js | 25 + .../es-abstract/2015/OrdinaryHasProperty.js | 20 + .../es-abstract/2015/QuoteJSONString.js | 52 + .../es-abstract/2015/RegExpExec.js | 32 + .../2015/RequireObjectCoercible.js | 3 + .../es-abstract/2015/SameValue.js | 13 + .../es-abstract/2015/SameValueZero.js | 9 + .../es-abstract/2015/SecFromTime.js | 14 + .../node_modules/es-abstract/2015/Set.js | 47 + .../es-abstract/2015/SetFunctionName.js | 44 + .../es-abstract/2015/SetIntegrityLevel.js | 57 + .../es-abstract/2015/SpeciesConstructor.js | 32 + .../2015/StrictEqualityComparison.js | 17 + .../2015/SymbolDescriptiveString.js | 20 + .../es-abstract/2015/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2015/TimeClip.js | 21 + .../es-abstract/2015/TimeFromYear.js | 11 + .../es-abstract/2015/TimeWithinDay.js | 12 + .../es-abstract/2015/ToBoolean.js | 5 + .../es-abstract/2015/ToDateString.js | 22 + .../node_modules/es-abstract/2015/ToInt16.js | 10 + .../node_modules/es-abstract/2015/ToInt32.js | 9 + .../node_modules/es-abstract/2015/ToInt8.js | 10 + .../es-abstract/2015/ToInteger.js | 12 + .../node_modules/es-abstract/2015/ToLength.js | 12 + .../node_modules/es-abstract/2015/ToNumber.js | 59 + .../node_modules/es-abstract/2015/ToObject.js | 14 + .../es-abstract/2015/ToPrimitive.js | 12 + .../es-abstract/2015/ToPropertyDescriptor.js | 52 + .../es-abstract/2015/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2015/ToString.js | 15 + .../node_modules/es-abstract/2015/ToUint16.js | 19 + .../node_modules/es-abstract/2015/ToUint32.js | 9 + .../node_modules/es-abstract/2015/ToUint8.js | 20 + .../es-abstract/2015/ToUint8Clamp.js | 19 + .../node_modules/es-abstract/2015/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2015/WeekDay.js | 10 + .../es-abstract/2015/YearFromTime.js | 16 + .../node_modules/es-abstract/2015/abs.js | 11 + .../node_modules/es-abstract/2015/floor.js | 11 + .../node_modules/es-abstract/2015/modulo.js | 9 + .../es-abstract/2015/msFromTime.js | 11 + .../es-abstract/2015/thisBooleanValue.js | 15 + .../es-abstract/2015/thisNumberValue.js | 18 + .../es-abstract/2015/thisStringValue.js | 15 + .../es-abstract/2015/thisTimeValue.js | 9 + .../2016/AbstractEqualityComparison.js | 37 + .../2016/AbstractRelationalComparison.js | 66 + .../es-abstract/2016/AdvanceStringIndex.js | 47 + .../es-abstract/2016/ArrayCreate.js | 53 + .../es-abstract/2016/ArraySetLength.js | 85 + .../es-abstract/2016/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2016/Call.js | 13 + .../2016/CanonicalNumericIndexString.js | 22 + .../2016/CompletePropertyDescriptor.js | 39 + .../es-abstract/2016/CreateDataProperty.js | 45 + .../2016/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2016/CreateHTML.js | 30 + .../2016/CreateIterResultObject.js | 19 + .../2016/CreateListFromArrayLike.js | 43 + .../es-abstract/2016/CreateMethodProperty.js | 40 + .../es-abstract/2016/DateFromTime.js | 54 + .../node_modules/es-abstract/2016/Day.js | 11 + .../es-abstract/2016/DayFromYear.js | 10 + .../es-abstract/2016/DayWithinYear.js | 11 + .../es-abstract/2016/DaysInYear.js | 18 + .../es-abstract/2016/DefinePropertyOrThrow.js | 50 + .../es-abstract/2016/DeletePropertyOrThrow.js | 27 + .../es-abstract/2016/EnumerableOwnNames.js | 19 + .../2016/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2016/Get.js | 30 + .../es-abstract/2016/GetIterator.js | 35 + .../es-abstract/2016/GetMethod.js | 42 + .../es-abstract/2016/GetOwnPropertyKeys.js | 31 + .../2016/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2016/GetSubstitution.js | 104 + .../node_modules/es-abstract/2016/GetV.js | 29 + .../es-abstract/2016/HasOwnProperty.js | 22 + .../es-abstract/2016/HasProperty.js | 20 + .../es-abstract/2016/HourFromTime.js | 14 + .../es-abstract/2016/InLeapYear.js | 21 + .../es-abstract/2016/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2016/Invoke.js | 22 + .../es-abstract/2016/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2016/IsArray.js | 14 + .../es-abstract/2016/IsCallable.js | 5 + .../es-abstract/2016/IsConcatSpreadable.js | 25 + .../es-abstract/2016/IsConstructor.js | 40 + .../es-abstract/2016/IsDataDescriptor.js | 23 + .../es-abstract/2016/IsExtensible.js | 20 + .../es-abstract/2016/IsGenericDescriptor.js | 23 + .../es-abstract/2016/IsInteger.js | 17 + .../es-abstract/2016/IsPromise.js | 24 + .../es-abstract/2016/IsPropertyDescriptor.js | 17 + .../es-abstract/2016/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2016/IsRegExp.js | 24 + .../es-abstract/2016/IterableToArrayLike.js | 56 + .../es-abstract/2016/IteratorClose.js | 50 + .../es-abstract/2016/IteratorComplete.js | 18 + .../es-abstract/2016/IteratorNext.js | 18 + .../es-abstract/2016/IteratorStep.js | 13 + .../es-abstract/2016/IteratorValue.js | 18 + .../node_modules/es-abstract/2016/MakeDate.js | 13 + .../node_modules/es-abstract/2016/MakeDay.js | 33 + .../node_modules/es-abstract/2016/MakeTime.js | 23 + .../es-abstract/2016/MinFromTime.js | 14 + .../es-abstract/2016/MonthFromTime.js | 47 + .../es-abstract/2016/ObjectCreate.js | 37 + .../2016/OrdinaryCreateFromConstructor.js | 20 + .../2016/OrdinaryDefineOwnProperty.js | 61 + .../2016/OrdinaryGetOwnProperty.js | 44 + .../2016/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2016/OrdinaryHasInstance.js | 25 + .../es-abstract/2016/OrdinaryHasProperty.js | 20 + .../2016/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2016/QuoteJSONString.js | 52 + .../es-abstract/2016/RegExpExec.js | 32 + .../2016/RequireObjectCoercible.js | 3 + .../es-abstract/2016/SameValue.js | 13 + .../es-abstract/2016/SameValueNonNumber.js | 16 + .../es-abstract/2016/SameValueZero.js | 9 + .../es-abstract/2016/SecFromTime.js | 14 + .../node_modules/es-abstract/2016/Set.js | 47 + .../es-abstract/2016/SetFunctionName.js | 44 + .../es-abstract/2016/SetIntegrityLevel.js | 57 + .../es-abstract/2016/SpeciesConstructor.js | 32 + .../2016/StrictEqualityComparison.js | 17 + .../2016/SymbolDescriptiveString.js | 20 + .../es-abstract/2016/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2016/TimeClip.js | 21 + .../es-abstract/2016/TimeFromYear.js | 11 + .../es-abstract/2016/TimeWithinDay.js | 12 + .../es-abstract/2016/ToBoolean.js | 5 + .../es-abstract/2016/ToDateString.js | 22 + .../node_modules/es-abstract/2016/ToInt16.js | 10 + .../node_modules/es-abstract/2016/ToInt32.js | 9 + .../node_modules/es-abstract/2016/ToInt8.js | 10 + .../es-abstract/2016/ToInteger.js | 12 + .../node_modules/es-abstract/2016/ToLength.js | 12 + .../node_modules/es-abstract/2016/ToNumber.js | 59 + .../node_modules/es-abstract/2016/ToObject.js | 14 + .../es-abstract/2016/ToPrimitive.js | 12 + .../es-abstract/2016/ToPropertyDescriptor.js | 52 + .../es-abstract/2016/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2016/ToString.js | 15 + .../node_modules/es-abstract/2016/ToUint16.js | 19 + .../node_modules/es-abstract/2016/ToUint32.js | 9 + .../node_modules/es-abstract/2016/ToUint8.js | 20 + .../es-abstract/2016/ToUint8Clamp.js | 19 + .../node_modules/es-abstract/2016/Type.js | 12 + .../es-abstract/2016/UTF16Encoding.js | 23 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2016/WeekDay.js | 10 + .../es-abstract/2016/YearFromTime.js | 16 + .../node_modules/es-abstract/2016/abs.js | 11 + .../node_modules/es-abstract/2016/floor.js | 11 + .../node_modules/es-abstract/2016/modulo.js | 9 + .../es-abstract/2016/msFromTime.js | 11 + .../es-abstract/2016/thisBooleanValue.js | 15 + .../es-abstract/2016/thisNumberValue.js | 18 + .../es-abstract/2016/thisStringValue.js | 15 + .../es-abstract/2016/thisTimeValue.js | 9 + .../2017/AbstractEqualityComparison.js | 37 + .../2017/AbstractRelationalComparison.js | 66 + .../es-abstract/2017/AdvanceStringIndex.js | 47 + .../es-abstract/2017/ArrayCreate.js | 53 + .../es-abstract/2017/ArraySetLength.js | 85 + .../es-abstract/2017/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2017/Call.js | 13 + .../2017/CanonicalNumericIndexString.js | 22 + .../2017/CompletePropertyDescriptor.js | 39 + .../es-abstract/2017/CreateDataProperty.js | 45 + .../2017/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2017/CreateHTML.js | 30 + .../2017/CreateIterResultObject.js | 19 + .../2017/CreateListFromArrayLike.js | 43 + .../es-abstract/2017/CreateMethodProperty.js | 40 + .../es-abstract/2017/DateFromTime.js | 54 + .../node_modules/es-abstract/2017/Day.js | 11 + .../es-abstract/2017/DayFromYear.js | 10 + .../es-abstract/2017/DayWithinYear.js | 11 + .../es-abstract/2017/DaysInYear.js | 18 + .../es-abstract/2017/DefinePropertyOrThrow.js | 50 + .../es-abstract/2017/DeletePropertyOrThrow.js | 27 + .../2017/EnumerableOwnProperties.js | 43 + .../2017/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2017/Get.js | 30 + .../es-abstract/2017/GetIterator.js | 35 + .../es-abstract/2017/GetMethod.js | 42 + .../es-abstract/2017/GetOwnPropertyKeys.js | 31 + .../2017/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2017/GetSubstitution.js | 104 + .../node_modules/es-abstract/2017/GetV.js | 29 + .../es-abstract/2017/HasOwnProperty.js | 22 + .../es-abstract/2017/HasProperty.js | 20 + .../es-abstract/2017/HourFromTime.js | 14 + .../es-abstract/2017/InLeapYear.js | 21 + .../es-abstract/2017/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2017/Invoke.js | 22 + .../es-abstract/2017/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2017/IsArray.js | 14 + .../es-abstract/2017/IsCallable.js | 5 + .../es-abstract/2017/IsConcatSpreadable.js | 25 + .../es-abstract/2017/IsConstructor.js | 40 + .../es-abstract/2017/IsDataDescriptor.js | 23 + .../es-abstract/2017/IsExtensible.js | 20 + .../es-abstract/2017/IsGenericDescriptor.js | 23 + .../es-abstract/2017/IsInteger.js | 17 + .../es-abstract/2017/IsPromise.js | 24 + .../es-abstract/2017/IsPropertyDescriptor.js | 17 + .../es-abstract/2017/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2017/IsRegExp.js | 24 + .../es-abstract/2017/IterableToList.js | 24 + .../es-abstract/2017/IteratorClose.js | 50 + .../es-abstract/2017/IteratorComplete.js | 18 + .../es-abstract/2017/IteratorNext.js | 18 + .../es-abstract/2017/IteratorStep.js | 13 + .../es-abstract/2017/IteratorValue.js | 18 + .../node_modules/es-abstract/2017/MakeDate.js | 13 + .../node_modules/es-abstract/2017/MakeDay.js | 33 + .../node_modules/es-abstract/2017/MakeTime.js | 23 + .../es-abstract/2017/MinFromTime.js | 14 + .../es-abstract/2017/MonthFromTime.js | 47 + .../es-abstract/2017/ObjectCreate.js | 37 + .../2017/OrdinaryCreateFromConstructor.js | 20 + .../2017/OrdinaryDefineOwnProperty.js | 61 + .../2017/OrdinaryGetOwnProperty.js | 44 + .../2017/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2017/OrdinaryHasInstance.js | 25 + .../es-abstract/2017/OrdinaryHasProperty.js | 20 + .../2017/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2017/QuoteJSONString.js | 52 + .../es-abstract/2017/RegExpExec.js | 32 + .../2017/RequireObjectCoercible.js | 3 + .../es-abstract/2017/SameValue.js | 13 + .../es-abstract/2017/SameValueNonNumber.js | 16 + .../es-abstract/2017/SameValueZero.js | 9 + .../es-abstract/2017/SecFromTime.js | 14 + .../node_modules/es-abstract/2017/Set.js | 47 + .../es-abstract/2017/SetFunctionName.js | 44 + .../es-abstract/2017/SetIntegrityLevel.js | 57 + .../es-abstract/2017/SpeciesConstructor.js | 32 + .../2017/StrictEqualityComparison.js | 17 + .../es-abstract/2017/StringGetOwnProperty.js | 48 + .../2017/SymbolDescriptiveString.js | 20 + .../es-abstract/2017/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2017/TimeClip.js | 21 + .../es-abstract/2017/TimeFromYear.js | 11 + .../es-abstract/2017/TimeWithinDay.js | 12 + .../es-abstract/2017/ToBoolean.js | 5 + .../es-abstract/2017/ToDateString.js | 22 + .../node_modules/es-abstract/2017/ToIndex.js | 26 + .../node_modules/es-abstract/2017/ToInt16.js | 10 + .../node_modules/es-abstract/2017/ToInt32.js | 9 + .../node_modules/es-abstract/2017/ToInt8.js | 10 + .../es-abstract/2017/ToInteger.js | 12 + .../node_modules/es-abstract/2017/ToLength.js | 12 + .../node_modules/es-abstract/2017/ToNumber.js | 59 + .../node_modules/es-abstract/2017/ToObject.js | 14 + .../es-abstract/2017/ToPrimitive.js | 12 + .../es-abstract/2017/ToPropertyDescriptor.js | 52 + .../es-abstract/2017/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2017/ToString.js | 15 + .../node_modules/es-abstract/2017/ToUint16.js | 19 + .../node_modules/es-abstract/2017/ToUint32.js | 9 + .../node_modules/es-abstract/2017/ToUint8.js | 20 + .../es-abstract/2017/ToUint8Clamp.js | 19 + .../node_modules/es-abstract/2017/Type.js | 12 + .../es-abstract/2017/UTF16Encoding.js | 23 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2017/WeekDay.js | 10 + .../es-abstract/2017/YearFromTime.js | 16 + .../node_modules/es-abstract/2017/abs.js | 11 + .../node_modules/es-abstract/2017/floor.js | 11 + .../node_modules/es-abstract/2017/modulo.js | 9 + .../es-abstract/2017/msFromTime.js | 11 + .../es-abstract/2017/thisBooleanValue.js | 15 + .../es-abstract/2017/thisNumberValue.js | 18 + .../es-abstract/2017/thisStringValue.js | 15 + .../es-abstract/2017/thisTimeValue.js | 9 + .../2018/AbstractEqualityComparison.js | 37 + .../2018/AbstractRelationalComparison.js | 66 + .../es-abstract/2018/AdvanceStringIndex.js | 47 + .../es-abstract/2018/ArrayCreate.js | 53 + .../es-abstract/2018/ArraySetLength.js | 85 + .../es-abstract/2018/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2018/Call.js | 13 + .../2018/CanonicalNumericIndexString.js | 22 + .../2018/CompletePropertyDescriptor.js | 39 + .../es-abstract/2018/CopyDataProperties.js | 68 + .../es-abstract/2018/CreateDataProperty.js | 45 + .../2018/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2018/CreateHTML.js | 30 + .../2018/CreateIterResultObject.js | 19 + .../2018/CreateListFromArrayLike.js | 43 + .../es-abstract/2018/CreateMethodProperty.js | 40 + .../es-abstract/2018/DateFromTime.js | 54 + .../es-abstract/2018/DateString.js | 30 + .../node_modules/es-abstract/2018/Day.js | 11 + .../es-abstract/2018/DayFromYear.js | 10 + .../es-abstract/2018/DayWithinYear.js | 11 + .../es-abstract/2018/DaysInYear.js | 18 + .../es-abstract/2018/DefinePropertyOrThrow.js | 50 + .../es-abstract/2018/DeletePropertyOrThrow.js | 27 + .../2018/EnumerableOwnPropertyNames.js | 43 + .../2018/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2018/Get.js | 30 + .../es-abstract/2018/GetIterator.js | 35 + .../es-abstract/2018/GetMethod.js | 42 + .../es-abstract/2018/GetOwnPropertyKeys.js | 31 + .../2018/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2018/GetSubstitution.js | 128 + .../node_modules/es-abstract/2018/GetV.js | 29 + .../es-abstract/2018/HasOwnProperty.js | 22 + .../es-abstract/2018/HasProperty.js | 20 + .../es-abstract/2018/HourFromTime.js | 14 + .../es-abstract/2018/InLeapYear.js | 21 + .../es-abstract/2018/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2018/Invoke.js | 22 + .../es-abstract/2018/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2018/IsArray.js | 14 + .../es-abstract/2018/IsCallable.js | 5 + .../es-abstract/2018/IsConcatSpreadable.js | 25 + .../es-abstract/2018/IsConstructor.js | 40 + .../es-abstract/2018/IsDataDescriptor.js | 23 + .../es-abstract/2018/IsExtensible.js | 20 + .../es-abstract/2018/IsGenericDescriptor.js | 23 + .../es-abstract/2018/IsInteger.js | 17 + .../es-abstract/2018/IsPromise.js | 24 + .../es-abstract/2018/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2018/IsRegExp.js | 24 + .../es-abstract/2018/IsStringPrefix.js | 47 + .../es-abstract/2018/IterableToList.js | 24 + .../es-abstract/2018/IteratorClose.js | 50 + .../es-abstract/2018/IteratorComplete.js | 18 + .../es-abstract/2018/IteratorNext.js | 18 + .../es-abstract/2018/IteratorStep.js | 13 + .../es-abstract/2018/IteratorValue.js | 18 + .../node_modules/es-abstract/2018/MakeDate.js | 13 + .../node_modules/es-abstract/2018/MakeDay.js | 33 + .../node_modules/es-abstract/2018/MakeTime.js | 23 + .../es-abstract/2018/MinFromTime.js | 14 + .../es-abstract/2018/MonthFromTime.js | 47 + .../es-abstract/2018/NumberToString.js | 19 + .../es-abstract/2018/ObjectCreate.js | 37 + .../2018/OrdinaryCreateFromConstructor.js | 20 + .../2018/OrdinaryDefineOwnProperty.js | 61 + .../2018/OrdinaryGetOwnProperty.js | 44 + .../2018/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2018/OrdinaryHasInstance.js | 25 + .../es-abstract/2018/OrdinaryHasProperty.js | 20 + .../2018/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2018/PromiseResolve.js | 15 + .../es-abstract/2018/QuoteJSONString.js | 48 + .../es-abstract/2018/RegExpExec.js | 32 + .../2018/RequireObjectCoercible.js | 3 + .../es-abstract/2018/SameValue.js | 13 + .../es-abstract/2018/SameValueNonNumber.js | 16 + .../es-abstract/2018/SameValueZero.js | 9 + .../es-abstract/2018/SecFromTime.js | 14 + .../node_modules/es-abstract/2018/Set.js | 47 + .../es-abstract/2018/SetFunctionLength.js | 31 + .../es-abstract/2018/SetFunctionName.js | 44 + .../es-abstract/2018/SetIntegrityLevel.js | 57 + .../es-abstract/2018/SpeciesConstructor.js | 32 + .../2018/StrictEqualityComparison.js | 17 + .../es-abstract/2018/StringGetOwnProperty.js | 48 + .../2018/SymbolDescriptiveString.js | 20 + .../es-abstract/2018/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2018/TimeClip.js | 21 + .../es-abstract/2018/TimeFromYear.js | 11 + .../es-abstract/2018/TimeString.js | 25 + .../es-abstract/2018/TimeWithinDay.js | 12 + .../es-abstract/2018/ToBoolean.js | 5 + .../es-abstract/2018/ToDateString.js | 22 + .../node_modules/es-abstract/2018/ToIndex.js | 26 + .../node_modules/es-abstract/2018/ToInt16.js | 10 + .../node_modules/es-abstract/2018/ToInt32.js | 9 + .../node_modules/es-abstract/2018/ToInt8.js | 10 + .../es-abstract/2018/ToInteger.js | 12 + .../node_modules/es-abstract/2018/ToLength.js | 12 + .../node_modules/es-abstract/2018/ToNumber.js | 59 + .../node_modules/es-abstract/2018/ToObject.js | 14 + .../es-abstract/2018/ToPrimitive.js | 12 + .../es-abstract/2018/ToPropertyDescriptor.js | 52 + .../es-abstract/2018/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2018/ToString.js | 15 + .../node_modules/es-abstract/2018/ToUint16.js | 19 + .../node_modules/es-abstract/2018/ToUint32.js | 9 + .../node_modules/es-abstract/2018/ToUint8.js | 20 + .../es-abstract/2018/ToUint8Clamp.js | 19 + .../node_modules/es-abstract/2018/Type.js | 12 + .../es-abstract/2018/UTF16Encoding.js | 23 + .../es-abstract/2018/UnicodeEscape.js | 26 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2018/WeekDay.js | 10 + .../es-abstract/2018/YearFromTime.js | 16 + .../node_modules/es-abstract/2018/abs.js | 11 + .../node_modules/es-abstract/2018/floor.js | 11 + .../node_modules/es-abstract/2018/modulo.js | 9 + .../es-abstract/2018/msFromTime.js | 11 + .../es-abstract/2018/thisBooleanValue.js | 15 + .../es-abstract/2018/thisNumberValue.js | 18 + .../es-abstract/2018/thisStringValue.js | 15 + .../es-abstract/2018/thisSymbolValue.js | 19 + .../es-abstract/2018/thisTimeValue.js | 9 + .../2019/AbstractEqualityComparison.js | 37 + .../2019/AbstractRelationalComparison.js | 66 + .../2019/AddEntriesFromIterable.js | 52 + .../es-abstract/2019/AdvanceStringIndex.js | 47 + .../es-abstract/2019/ArrayCreate.js | 53 + .../es-abstract/2019/ArraySetLength.js | 85 + .../es-abstract/2019/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2019/Call.js | 13 + .../2019/CanonicalNumericIndexString.js | 22 + .../2019/CompletePropertyDescriptor.js | 39 + .../es-abstract/2019/CopyDataProperties.js | 68 + .../es-abstract/2019/CreateDataProperty.js | 45 + .../2019/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2019/CreateHTML.js | 30 + .../2019/CreateIterResultObject.js | 19 + .../2019/CreateListFromArrayLike.js | 43 + .../es-abstract/2019/CreateMethodProperty.js | 40 + .../es-abstract/2019/DateFromTime.js | 54 + .../es-abstract/2019/DateString.js | 30 + .../node_modules/es-abstract/2019/Day.js | 11 + .../es-abstract/2019/DayFromYear.js | 10 + .../es-abstract/2019/DayWithinYear.js | 11 + .../es-abstract/2019/DaysInYear.js | 18 + .../es-abstract/2019/DefinePropertyOrThrow.js | 50 + .../es-abstract/2019/DeletePropertyOrThrow.js | 27 + .../2019/EnumerableOwnPropertyNames.js | 43 + .../es-abstract/2019/FlattenIntoArray.js | 58 + .../2019/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2019/Get.js | 30 + .../es-abstract/2019/GetIterator.js | 35 + .../es-abstract/2019/GetMethod.js | 42 + .../es-abstract/2019/GetOwnPropertyKeys.js | 31 + .../2019/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2019/GetSubstitution.js | 128 + .../node_modules/es-abstract/2019/GetV.js | 29 + .../es-abstract/2019/HasOwnProperty.js | 22 + .../es-abstract/2019/HasProperty.js | 20 + .../es-abstract/2019/HourFromTime.js | 14 + .../es-abstract/2019/InLeapYear.js | 21 + .../es-abstract/2019/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2019/Invoke.js | 22 + .../es-abstract/2019/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2019/IsArray.js | 14 + .../es-abstract/2019/IsCallable.js | 5 + .../es-abstract/2019/IsConcatSpreadable.js | 25 + .../es-abstract/2019/IsConstructor.js | 40 + .../es-abstract/2019/IsDataDescriptor.js | 23 + .../es-abstract/2019/IsExtensible.js | 20 + .../es-abstract/2019/IsGenericDescriptor.js | 23 + .../es-abstract/2019/IsInteger.js | 17 + .../es-abstract/2019/IsPromise.js | 24 + .../es-abstract/2019/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2019/IsRegExp.js | 24 + .../es-abstract/2019/IsStringPrefix.js | 47 + .../es-abstract/2019/IterableToList.js | 24 + .../es-abstract/2019/IteratorClose.js | 50 + .../es-abstract/2019/IteratorComplete.js | 18 + .../es-abstract/2019/IteratorNext.js | 18 + .../es-abstract/2019/IteratorStep.js | 13 + .../es-abstract/2019/IteratorValue.js | 18 + .../node_modules/es-abstract/2019/MakeDate.js | 13 + .../node_modules/es-abstract/2019/MakeDay.js | 33 + .../node_modules/es-abstract/2019/MakeTime.js | 23 + .../es-abstract/2019/MinFromTime.js | 14 + .../es-abstract/2019/MonthFromTime.js | 47 + .../es-abstract/2019/NumberToString.js | 19 + .../es-abstract/2019/ObjectCreate.js | 37 + .../2019/OrdinaryCreateFromConstructor.js | 20 + .../2019/OrdinaryDefineOwnProperty.js | 61 + .../2019/OrdinaryGetOwnProperty.js | 44 + .../2019/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2019/OrdinaryHasInstance.js | 25 + .../es-abstract/2019/OrdinaryHasProperty.js | 20 + .../2019/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2019/PromiseResolve.js | 15 + .../es-abstract/2019/QuoteJSONString.js | 55 + .../es-abstract/2019/RegExpExec.js | 32 + .../2019/RequireObjectCoercible.js | 3 + .../es-abstract/2019/SameValue.js | 13 + .../es-abstract/2019/SameValueNonNumber.js | 16 + .../es-abstract/2019/SameValueZero.js | 9 + .../es-abstract/2019/SecFromTime.js | 14 + .../node_modules/es-abstract/2019/Set.js | 47 + .../es-abstract/2019/SetFunctionLength.js | 31 + .../es-abstract/2019/SetFunctionName.js | 44 + .../es-abstract/2019/SetIntegrityLevel.js | 57 + .../es-abstract/2019/SpeciesConstructor.js | 32 + .../2019/StrictEqualityComparison.js | 17 + .../es-abstract/2019/StringGetOwnProperty.js | 48 + .../2019/SymbolDescriptiveString.js | 20 + .../es-abstract/2019/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2019/TimeClip.js | 21 + .../es-abstract/2019/TimeFromYear.js | 11 + .../es-abstract/2019/TimeString.js | 25 + .../es-abstract/2019/TimeWithinDay.js | 12 + .../es-abstract/2019/ToBoolean.js | 5 + .../es-abstract/2019/ToDateString.js | 22 + .../node_modules/es-abstract/2019/ToIndex.js | 26 + .../node_modules/es-abstract/2019/ToInt16.js | 10 + .../node_modules/es-abstract/2019/ToInt32.js | 9 + .../node_modules/es-abstract/2019/ToInt8.js | 10 + .../es-abstract/2019/ToInteger.js | 12 + .../node_modules/es-abstract/2019/ToLength.js | 12 + .../node_modules/es-abstract/2019/ToNumber.js | 59 + .../node_modules/es-abstract/2019/ToObject.js | 14 + .../es-abstract/2019/ToPrimitive.js | 12 + .../es-abstract/2019/ToPropertyDescriptor.js | 52 + .../es-abstract/2019/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2019/ToString.js | 15 + .../node_modules/es-abstract/2019/ToUint16.js | 19 + .../node_modules/es-abstract/2019/ToUint32.js | 9 + .../node_modules/es-abstract/2019/ToUint8.js | 20 + .../es-abstract/2019/ToUint8Clamp.js | 19 + .../es-abstract/2019/TrimString.js | 29 + .../node_modules/es-abstract/2019/Type.js | 12 + .../es-abstract/2019/UTF16Encoding.js | 23 + .../es-abstract/2019/UnicodeEscape.js | 26 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2019/WeekDay.js | 10 + .../es-abstract/2019/YearFromTime.js | 16 + .../node_modules/es-abstract/2019/abs.js | 11 + .../node_modules/es-abstract/2019/floor.js | 11 + .../node_modules/es-abstract/2019/modulo.js | 9 + .../es-abstract/2019/msFromTime.js | 11 + .../es-abstract/2019/thisBooleanValue.js | 15 + .../es-abstract/2019/thisNumberValue.js | 18 + .../es-abstract/2019/thisStringValue.js | 15 + .../es-abstract/2019/thisSymbolValue.js | 19 + .../es-abstract/2019/thisTimeValue.js | 3 + .../2020/AbstractEqualityComparison.js | 37 + .../2020/AbstractRelationalComparison.js | 66 + .../2020/AddEntriesFromIterable.js | 52 + .../es-abstract/2020/AdvanceStringIndex.js | 34 + .../es-abstract/2020/ArrayCreate.js | 53 + .../es-abstract/2020/ArraySetLength.js | 85 + .../es-abstract/2020/ArraySpeciesCreate.js | 46 + .../es-abstract/2020/BigIntBitwiseOp.js | 66 + .../es-abstract/2020/BinaryAnd.js | 14 + .../node_modules/es-abstract/2020/BinaryOr.js | 14 + .../es-abstract/2020/BinaryXor.js | 14 + .../node_modules/es-abstract/2020/Call.js | 13 + .../2020/CanonicalNumericIndexString.js | 22 + .../es-abstract/2020/CodePointAt.js | 58 + .../2020/CompletePropertyDescriptor.js | 39 + .../es-abstract/2020/CopyDataProperties.js | 68 + .../es-abstract/2020/CreateDataProperty.js | 45 + .../2020/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2020/CreateHTML.js | 30 + .../2020/CreateIterResultObject.js | 19 + .../2020/CreateListFromArrayLike.js | 44 + .../es-abstract/2020/CreateMethodProperty.js | 40 + .../es-abstract/2020/DateFromTime.js | 54 + .../es-abstract/2020/DateString.js | 30 + .../node_modules/es-abstract/2020/Day.js | 11 + .../es-abstract/2020/DayFromYear.js | 10 + .../es-abstract/2020/DayWithinYear.js | 11 + .../es-abstract/2020/DaysInYear.js | 18 + .../es-abstract/2020/DefinePropertyOrThrow.js | 50 + .../es-abstract/2020/DeletePropertyOrThrow.js | 27 + .../2020/EnumerableOwnPropertyNames.js | 43 + .../es-abstract/2020/FlattenIntoArray.js | 58 + .../2020/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2020/Get.js | 30 + .../es-abstract/2020/GetIterator.js | 35 + .../es-abstract/2020/GetMethod.js | 42 + .../es-abstract/2020/GetOwnPropertyKeys.js | 31 + .../2020/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2020/GetSubstitution.js | 128 + .../node_modules/es-abstract/2020/GetV.js | 29 + .../es-abstract/2020/HasOwnProperty.js | 22 + .../es-abstract/2020/HasProperty.js | 20 + .../es-abstract/2020/HourFromTime.js | 14 + .../es-abstract/2020/InLeapYear.js | 21 + .../es-abstract/2020/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2020/Invoke.js | 22 + .../es-abstract/2020/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2020/IsArray.js | 14 + .../es-abstract/2020/IsBigIntElementType.js | 7 + .../es-abstract/2020/IsCallable.js | 5 + .../es-abstract/2020/IsConcatSpreadable.js | 25 + .../es-abstract/2020/IsConstructor.js | 40 + .../es-abstract/2020/IsDataDescriptor.js | 23 + .../es-abstract/2020/IsExtensible.js | 20 + .../es-abstract/2020/IsGenericDescriptor.js | 23 + .../es-abstract/2020/IsInteger.js | 17 + .../es-abstract/2020/IsNoTearConfiguration.js | 16 + .../es-abstract/2020/IsNonNegativeInteger.js | 9 + .../es-abstract/2020/IsPromise.js | 24 + .../es-abstract/2020/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2020/IsRegExp.js | 24 + .../es-abstract/2020/IsStringPrefix.js | 47 + .../2020/IsUnclampedIntegerElementType.js | 12 + .../es-abstract/2020/IsUnsignedElementType.js | 11 + .../es-abstract/2020/IterableToList.js | 24 + .../es-abstract/2020/IteratorClose.js | 50 + .../es-abstract/2020/IteratorComplete.js | 18 + .../es-abstract/2020/IteratorNext.js | 18 + .../es-abstract/2020/IteratorStep.js | 13 + .../es-abstract/2020/IteratorValue.js | 18 + .../es-abstract/2020/LengthOfArrayLike.js | 20 + .../node_modules/es-abstract/2020/MakeDate.js | 13 + .../node_modules/es-abstract/2020/MakeDay.js | 33 + .../node_modules/es-abstract/2020/MakeTime.js | 23 + .../es-abstract/2020/MinFromTime.js | 14 + .../es-abstract/2020/MonthFromTime.js | 47 + .../es-abstract/2020/NumberBitwiseOp.js | 25 + .../2020/OrdinaryCreateFromConstructor.js | 20 + .../2020/OrdinaryDefineOwnProperty.js | 61 + .../2020/OrdinaryGetOwnProperty.js | 44 + .../2020/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2020/OrdinaryHasInstance.js | 25 + .../es-abstract/2020/OrdinaryHasProperty.js | 20 + .../es-abstract/2020/OrdinaryObjectCreate.js | 46 + .../2020/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2020/PromiseResolve.js | 15 + .../es-abstract/2020/QuoteJSONString.js | 55 + .../es-abstract/2020/RegExpExec.js | 32 + .../2020/RequireObjectCoercible.js | 3 + .../es-abstract/2020/SameValue.js | 13 + .../es-abstract/2020/SameValueNonNumeric.js | 21 + .../es-abstract/2020/SameValueZero.js | 9 + .../es-abstract/2020/SecFromTime.js | 14 + .../node_modules/es-abstract/2020/Set.js | 47 + .../es-abstract/2020/SetFunctionLength.js | 31 + .../es-abstract/2020/SetFunctionName.js | 44 + .../es-abstract/2020/SetIntegrityLevel.js | 57 + .../es-abstract/2020/SpeciesConstructor.js | 32 + .../2020/StrictEqualityComparison.js | 17 + .../es-abstract/2020/StringGetOwnProperty.js | 48 + .../es-abstract/2020/StringPad.js | 43 + .../2020/SymbolDescriptiveString.js | 20 + .../es-abstract/2020/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2020/TimeClip.js | 21 + .../es-abstract/2020/TimeFromYear.js | 11 + .../es-abstract/2020/TimeString.js | 25 + .../es-abstract/2020/TimeWithinDay.js | 12 + .../es-abstract/2020/ToBoolean.js | 5 + .../es-abstract/2020/ToDateString.js | 22 + .../node_modules/es-abstract/2020/ToIndex.js | 26 + .../node_modules/es-abstract/2020/ToInt16.js | 10 + .../node_modules/es-abstract/2020/ToInt32.js | 9 + .../node_modules/es-abstract/2020/ToInt8.js | 10 + .../es-abstract/2020/ToInteger.js | 12 + .../node_modules/es-abstract/2020/ToLength.js | 12 + .../node_modules/es-abstract/2020/ToNumber.js | 59 + .../es-abstract/2020/ToNumeric.js | 21 + .../node_modules/es-abstract/2020/ToObject.js | 14 + .../es-abstract/2020/ToPrimitive.js | 12 + .../es-abstract/2020/ToPropertyDescriptor.js | 52 + .../es-abstract/2020/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2020/ToString.js | 15 + .../node_modules/es-abstract/2020/ToUint16.js | 19 + .../node_modules/es-abstract/2020/ToUint32.js | 9 + .../node_modules/es-abstract/2020/ToUint8.js | 20 + .../es-abstract/2020/ToUint8Clamp.js | 19 + .../es-abstract/2020/TrimString.js | 29 + .../node_modules/es-abstract/2020/Type.js | 15 + .../es-abstract/2020/UTF16DecodeString.js | 29 + .../2020/UTF16DecodeSurrogatePair.js | 19 + .../es-abstract/2020/UTF16Encoding.js | 23 + .../es-abstract/2020/UnicodeEscape.js | 27 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2020/WeekDay.js | 10 + .../es-abstract/2020/YearFromTime.js | 16 + .../node_modules/es-abstract/2020/abs.js | 11 + .../node_modules/es-abstract/2020/floor.js | 11 + .../node_modules/es-abstract/2020/modulo.js | 9 + .../es-abstract/2020/msFromTime.js | 11 + .../es-abstract/2020/thisBigIntValue.js | 22 + .../es-abstract/2020/thisBooleanValue.js | 15 + .../es-abstract/2020/thisNumberValue.js | 18 + .../es-abstract/2020/thisStringValue.js | 15 + .../es-abstract/2020/thisSymbolValue.js | 19 + .../es-abstract/2020/thisTimeValue.js | 3 + .../5/AbstractEqualityComparison.js | 37 + .../5/AbstractRelationalComparison.js | 66 + .../es-abstract/5/CheckObjectCoercible.js | 14 + .../es-abstract/5/DateFromTime.js | 54 + .../node_modules/es-abstract/5/Day.js | 11 + .../node_modules/es-abstract/5/DayFromYear.js | 10 + .../es-abstract/5/DayWithinYear.js | 11 + .../node_modules/es-abstract/5/DaysInYear.js | 18 + .../es-abstract/5/FromPropertyDescriptor.js | 39 + .../es-abstract/5/HourFromTime.js | 14 + .../node_modules/es-abstract/5/InLeapYear.js | 21 + .../es-abstract/5/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/5/IsCallable.js | 5 + .../es-abstract/5/IsDataDescriptor.js | 23 + .../es-abstract/5/IsGenericDescriptor.js | 23 + .../es-abstract/5/IsPropertyDescriptor.js | 17 + .../node_modules/es-abstract/5/MakeDate.js | 13 + .../node_modules/es-abstract/5/MakeDay.js | 33 + .../node_modules/es-abstract/5/MakeTime.js | 23 + .../node_modules/es-abstract/5/MinFromTime.js | 14 + .../es-abstract/5/MonthFromTime.js | 47 + .../node_modules/es-abstract/5/SameValue.js | 13 + .../node_modules/es-abstract/5/SecFromTime.js | 14 + .../es-abstract/5/StrictEqualityComparison.js | 17 + .../node_modules/es-abstract/5/TimeClip.js | 21 + .../es-abstract/5/TimeFromYear.js | 11 + .../es-abstract/5/TimeWithinDay.js | 12 + .../node_modules/es-abstract/5/ToBoolean.js | 5 + .../node_modules/es-abstract/5/ToInt32.js | 9 + .../node_modules/es-abstract/5/ToInteger.js | 18 + .../node_modules/es-abstract/5/ToNumber.js | 7 + .../node_modules/es-abstract/5/ToObject.js | 14 + .../node_modules/es-abstract/5/ToPrimitive.js | 5 + .../es-abstract/5/ToPropertyDescriptor.js | 52 + .../node_modules/es-abstract/5/ToString.js | 12 + .../node_modules/es-abstract/5/ToUint16.js | 19 + .../node_modules/es-abstract/5/ToUint32.js | 9 + .../node_modules/es-abstract/5/Type.js | 24 + .../node_modules/es-abstract/5/WeekDay.js | 10 + .../es-abstract/5/YearFromTime.js | 16 + .../node_modules/es-abstract/5/abs.js | 11 + .../node_modules/es-abstract/5/floor.js | 11 + .../node_modules/es-abstract/5/modulo.js | 9 + .../node_modules/es-abstract/5/msFromTime.js | 11 + .../node_modules/es-abstract/CHANGELOG.md | 374 + .../node_modules/es-abstract/GetIntrinsic.js | 278 + .../node_modules/es-abstract/LICENSE | 21 + .../node_modules/es-abstract/README.md | 48 + .../node_modules/es-abstract/es2015.js | 119 + .../node_modules/es-abstract/es2016.js | 124 + .../node_modules/es-abstract/es2017.js | 126 + .../node_modules/es-abstract/es2018.js | 134 + .../node_modules/es-abstract/es2019.js | 137 + .../node_modules/es-abstract/es2020.js | 153 + .../node_modules/es-abstract/es5.js | 51 + .../node_modules/es-abstract/es6.js | 3 + .../node_modules/es-abstract/es7.js | 3 + .../es-abstract/helpers/DefineOwnProperty.js | 45 + .../es-abstract/helpers/OwnPropertyKeys.js | 22 + .../es-abstract/helpers/assertRecord.js | 48 + .../es-abstract/helpers/assign.js | 22 + .../es-abstract/helpers/callBind.js | 17 + .../es-abstract/helpers/callBound.js | 15 + .../node_modules/es-abstract/helpers/every.js | 10 + .../es-abstract/helpers/forEach.js | 7 + .../es-abstract/helpers/getInferredName.js | 10 + .../es-abstract/helpers/getIteratorMethod.js | 45 + .../helpers/getOwnPropertyDescriptor.js | 15 + .../es-abstract/helpers/getProto.js | 15 + .../helpers/getSymbolDescription.js | 41 + .../es-abstract/helpers/isFinite.js | 5 + .../es-abstract/helpers/isLeadingSurrogate.js | 5 + .../node_modules/es-abstract/helpers/isNaN.js | 5 + .../es-abstract/helpers/isPrefixOf.js | 13 + .../es-abstract/helpers/isPrimitive.js | 5 + .../helpers/isPropertyDescriptor.js | 31 + .../helpers/isSamePropertyDescriptor.js | 20 + .../helpers/isTrailingSurrogate.js | 5 + .../es-abstract/helpers/maxSafeInteger.js | 8 + .../node_modules/es-abstract/helpers/mod.js | 8 + .../es-abstract/helpers/padTimeComponent.js | 9 + .../es-abstract/helpers/regexTester.js | 11 + .../es-abstract/helpers/setProto.js | 16 + .../node_modules/es-abstract/helpers/sign.js | 5 + .../es-abstract/helpers/timeConstants.js | 19 + .../node_modules/es-abstract/index.js | 28 + .../es-abstract/operations/.eslintrc | 5 + .../es-abstract/operations/2015.js | 249 + .../es-abstract/operations/2016.js | 276 + .../es-abstract/operations/2017.js | 324 + .../es-abstract/operations/2018.js | 350 + .../es-abstract/operations/2019.js | 355 + .../node_modules/es-abstract/package.json | 115 + .../es-abstract/test/GetIntrinsic.js | 206 + .../node_modules/es-abstract/test/diffOps.js | 27 + .../node_modules/es-abstract/test/es2015.js | 146 + .../node_modules/es-abstract/test/es2016.js | 168 + .../node_modules/es-abstract/test/es2017.js | 214 + .../node_modules/es-abstract/test/es2018.js | 233 + .../node_modules/es-abstract/test/es2019.js | 238 + .../node_modules/es-abstract/test/es2020.js | 267 + .../node_modules/es-abstract/test/es5.js | 786 + .../node_modules/es-abstract/test/es6.js | 18 + .../node_modules/es-abstract/test/es7.js | 18 + .../test/helpers/OwnPropertyKeys.js | 42 + .../es-abstract/test/helpers/assertRecord.js | 60 + .../test/helpers/createBoundESNamespace.js | 21 + .../test/helpers/defineProperty.js | 22 + .../test/helpers/getSymbolDescription.js | 67 + .../test/helpers/runManifestTest.js | 27 + .../es-abstract/test/helpers/values.js | 127 + .../node_modules/es-abstract/test/index.js | 36 + .../node_modules/es-abstract/test/tests.js | 4913 ++ node_modules/object.assign/package.json | 84 + node_modules/object.assign/polyfill.js | 55 + node_modules/object.assign/shim.js | 14 + node_modules/object.assign/test/index.js | 17 + node_modules/object.assign/test/native.js | 49 + node_modules/object.assign/test/ses-compat.js | 15 + node_modules/object.assign/test/shimmed.js | 52 + node_modules/object.assign/test/tests.js | 237 + node_modules/object.values/.eslintrc | 12 + .../.github/workflows/rebase.yml | 15 + node_modules/object.values/.travis.yml | 12 + node_modules/object.values/CHANGELOG.md | 44 + node_modules/object.values/LICENSE | 22 + node_modules/object.values/README.md | 59 + node_modules/object.values/auto.js | 3 + node_modules/object.values/implementation.js | 18 + node_modules/object.values/index.js | 17 + node_modules/object.values/package.json | 77 + node_modules/object.values/polyfill.js | 7 + node_modules/object.values/shim.js | 14 + node_modules/object.values/test/.eslintrc | 11 + node_modules/object.values/test/index.js | 17 + node_modules/object.values/test/shimmed.js | 36 + node_modules/object.values/test/tests.js | 82 + node_modules/optionator/CHANGELOG.md | 59 + node_modules/optionator/LICENSE | 22 + node_modules/optionator/README.md | 238 + node_modules/optionator/lib/help.js | 260 + node_modules/optionator/lib/index.js | 465 + node_modules/optionator/lib/util.js | 54 + node_modules/optionator/package.json | 43 + node_modules/parent-module/index.js | 37 + node_modules/parent-module/license | 9 + node_modules/parent-module/package.json | 46 + node_modules/parent-module/readme.md | 67 + node_modules/prelude-ls/CHANGELOG.md | 108 + node_modules/prelude-ls/LICENSE | 22 + node_modules/prelude-ls/README.md | 15 + node_modules/prelude-ls/lib/Func.js | 69 + node_modules/prelude-ls/lib/List.js | 716 + node_modules/prelude-ls/lib/Num.js | 130 + node_modules/prelude-ls/lib/Obj.js | 154 + node_modules/prelude-ls/lib/Str.js | 92 + node_modules/prelude-ls/lib/index.js | 178 + node_modules/prelude-ls/package.json | 46 + .../prettier-linter-helpers/.editorconfig | 15 + .../prettier-linter-helpers/.eslintignore | 2 + .../prettier-linter-helpers/.eslintrc.js | 6 + .../.github/CONTRIBUTING.md | 41 + .../prettier-linter-helpers/.prettierignore | 1 + .../prettier-linter-helpers/.prettierrc | 6 + .../.vscode/settings.json | 12 + .../prettier-linter-helpers/LICENSE.md | 24 + .../prettier-linter-helpers/README.md | 14 + node_modules/prettier-linter-helpers/index.js | 145 + .../prettier-linter-helpers/package.json | 38 + .../test/index.test.js | 29 + node_modules/prettier/LICENSE | 7 + node_modules/prettier/README.md | 111 + node_modules/prettier/bin-prettier.js | 16523 +++++ node_modules/prettier/doc.js | 3769 ++ node_modules/prettier/index.js | 54743 ++++++++++++++++ node_modules/prettier/package.json | 22 + node_modules/prettier/parser-angular.js | 46 + node_modules/prettier/parser-babel.js | 1 + node_modules/prettier/parser-flow.js | 1 + node_modules/prettier/parser-glimmer.js | 1 + node_modules/prettier/parser-graphql.js | 1 + node_modules/prettier/parser-html.js | 113 + node_modules/prettier/parser-markdown.js | 19 + node_modules/prettier/parser-postcss.js | 8 + node_modules/prettier/parser-typescript.js | 14 + node_modules/prettier/parser-yaml.js | 15 + node_modules/prettier/standalone.js | 15 + node_modules/prettier/third-party.js | 10583 +++ node_modules/progress/CHANGELOG.md | 115 + node_modules/progress/LICENSE | 22 + node_modules/progress/Makefile | 8 + node_modules/progress/Readme.md | 146 + node_modules/progress/index.js | 1 + node_modules/progress/lib/node-progress.js | 236 + node_modules/progress/package.json | 26 + node_modules/punycode/LICENSE-MIT.txt | 20 + node_modules/punycode/README.md | 122 + node_modules/punycode/package.json | 58 + node_modules/punycode/punycode.es6.js | 441 + node_modules/punycode/punycode.js | 440 + node_modules/read-pkg-up/index.js | 26 + node_modules/read-pkg-up/license | 21 + .../read-pkg-up/node_modules/find-up/index.js | 48 + .../read-pkg-up/node_modules/find-up/license | 21 + .../node_modules/find-up/package.json | 53 + .../node_modules/find-up/readme.md | 85 + .../node_modules/load-json-file/index.js | 11 + .../node_modules/load-json-file/license | 21 + .../node_modules/load-json-file/package.json | 43 + .../node_modules/load-json-file/readme.md | 45 + .../node_modules/locate-path/index.js | 24 + .../node_modules/locate-path/license | 21 + .../node_modules/locate-path/package.json | 47 + .../node_modules/locate-path/readme.md | 99 + .../read-pkg-up/node_modules/p-limit/index.js | 42 + .../read-pkg-up/node_modules/p-limit/license | 9 + .../node_modules/p-limit/package.json | 49 + .../node_modules/p-limit/readme.md | 69 + .../node_modules/p-locate/index.js | 31 + .../read-pkg-up/node_modules/p-locate/license | 21 + .../node_modules/p-locate/package.json | 54 + .../node_modules/p-locate/readme.md | 86 + .../read-pkg-up/node_modules/p-try/index.js | 4 + .../read-pkg-up/node_modules/p-try/license | 21 + .../node_modules/p-try/package.json | 43 + .../read-pkg-up/node_modules/p-try/readme.md | 38 + .../node_modules/parse-json/index.js | 35 + .../node_modules/parse-json/license | 21 + .../node_modules/parse-json/package.json | 46 + .../node_modules/parse-json/readme.md | 83 + .../node_modules/parse-json/vendor/parse.js | 752 + .../node_modules/parse-json/vendor/unicode.js | 71 + .../node_modules/path-exists/index.js | 17 + .../node_modules/path-exists/license | 21 + .../node_modules/path-exists/package.json | 40 + .../node_modules/path-exists/readme.md | 50 + .../node_modules/path-type/index.js | 26 + .../node_modules/path-type/license | 21 + .../node_modules/path-type/package.json | 48 + .../node_modules/path-type/readme.md | 42 + .../read-pkg-up/node_modules/pify/index.js | 68 + .../read-pkg-up/node_modules/pify/license | 21 + .../node_modules/pify/package.json | 48 + .../read-pkg-up/node_modules/pify/readme.md | 119 + .../node_modules/read-pkg/index.js | 47 + .../read-pkg-up/node_modules/read-pkg/license | 21 + .../node_modules/read-pkg/package.json | 45 + .../node_modules/read-pkg/readme.md | 79 + node_modules/read-pkg-up/package.json | 62 + node_modules/read-pkg-up/readme.md | 80 + node_modules/regexpp/LICENSE | 21 + node_modules/regexpp/README.md | 178 + node_modules/regexpp/index.d.ts | 247 + node_modules/regexpp/index.js | 2085 + node_modules/regexpp/index.js.map | 1 + node_modules/regexpp/index.mjs | 2076 + node_modules/regexpp/index.mjs.map | 1 + node_modules/regexpp/package.json | 84 + node_modules/requireindex/.npmignore | 1 + node_modules/requireindex/.travis.yml | 3 + node_modules/requireindex/README.md | 90 + node_modules/requireindex/index.js | 59 + node_modules/requireindex/package.json | 37 + .../test/lib/.also_private/private.txt | 1 + node_modules/requireindex/test/lib/Foo.js | 4 + .../requireindex/test/lib/_private.js | 3 + node_modules/requireindex/test/lib/bam.js | 4 + node_modules/requireindex/test/lib/bar/f.js | 3 + .../requireindex/test/lib/bar/fed/again.js | 3 + .../requireindex/test/lib/bar/fed/ignored.js | 3 + .../requireindex/test/lib/bar/fed/index.js | 1 + .../requireindex/test/lib/bar/fed/somemore.js | 3 + .../requireindex/test/lib/bar/fing.js | 3 + .../requireindex/test/lib/bar/index.js | 1 + node_modules/requireindex/test/lib/index.js | 1 + .../requireindex/test/lib/not_javascript.txt | 1 + node_modules/requireindex/test/test.js | 43 + .../string.prototype.trimend/.editorconfig | 20 + .../string.prototype.trimend/.eslintrc | 15 + .../.github/workflows/rebase.yml | 15 + .../string.prototype.trimend/.travis.yml | 8 + .../string.prototype.trimend/CHANGELOG.md | 44 + node_modules/string.prototype.trimend/LICENSE | 21 + .../string.prototype.trimend/README.md | 47 + node_modules/string.prototype.trimend/auto.js | 3 + .../implementation.js | 12 + .../string.prototype.trimend/index.js | 18 + .../string.prototype.trimend/package.json | 65 + .../string.prototype.trimend/polyfill.js | 15 + node_modules/string.prototype.trimend/shim.js | 14 + .../string.prototype.trimend/test/index.js | 17 + .../string.prototype.trimend/test/shimmed.js | 37 + .../string.prototype.trimend/test/tests.js | 26 + .../string.prototype.trimstart/.editorconfig | 20 + .../string.prototype.trimstart/.eslintrc | 15 + .../.github/workflows/rebase.yml | 15 + .../string.prototype.trimstart/.travis.yml | 12 + .../string.prototype.trimstart/CHANGELOG.md | 44 + .../string.prototype.trimstart/LICENSE | 21 + .../string.prototype.trimstart/README.md | 47 + .../string.prototype.trimstart/auto.js | 3 + .../implementation.js | 12 + .../string.prototype.trimstart/index.js | 18 + .../string.prototype.trimstart/package.json | 65 + .../string.prototype.trimstart/polyfill.js | 15 + .../string.prototype.trimstart/shim.js | 14 + .../string.prototype.trimstart/test/index.js | 18 + .../test/shimmed.js | 37 + .../string.prototype.trimstart/test/tests.js | 26 + node_modules/strip-bom/index.js | 14 + node_modules/strip-bom/license | 21 + node_modules/strip-bom/package.json | 40 + node_modules/strip-bom/readme.md | 36 + .../svg-element-attributes/index.json | 4282 ++ node_modules/svg-element-attributes/license | 22 + .../svg-element-attributes/package.json | 76 + node_modules/svg-element-attributes/readme.md | 169 + node_modules/table/LICENSE | 24 + node_modules/table/README.md | 735 + node_modules/table/dist/alignString.js | 108 + node_modules/table/dist/alignString.js.flow | 96 + node_modules/table/dist/alignString.js.map | 1 + node_modules/table/dist/alignTableData.js | 35 + .../table/dist/alignTableData.js.flow | 21 + node_modules/table/dist/alignTableData.js.map | 1 + .../table/dist/calculateCellHeight.js | 38 + .../table/dist/calculateCellHeight.js.flow | 24 + .../table/dist/calculateCellHeight.js.map | 1 + .../table/dist/calculateCellWidthIndex.js | 28 + .../dist/calculateCellWidthIndex.js.flow | 17 + .../table/dist/calculateCellWidthIndex.js.map | 1 + .../dist/calculateMaximumColumnWidthIndex.js | 37 + .../calculateMaximumColumnWidthIndex.js.flow | 27 + .../calculateMaximumColumnWidthIndex.js.map | 1 + .../table/dist/calculateRowHeightIndex.js | 48 + .../dist/calculateRowHeightIndex.js.flow | 35 + .../table/dist/calculateRowHeightIndex.js.map | 1 + node_modules/table/dist/createStream.js | 132 + node_modules/table/dist/createStream.js.flow | 127 + node_modules/table/dist/createStream.js.map | 1 + node_modules/table/dist/drawBorder.js | 110 + node_modules/table/dist/drawBorder.js.flow | 101 + node_modules/table/dist/drawBorder.js.map | 1 + node_modules/table/dist/drawRow.js | 26 + node_modules/table/dist/drawRow.js.flow | 15 + node_modules/table/dist/drawRow.js.map | 1 + node_modules/table/dist/drawTable.js | 59 + node_modules/table/dist/drawTable.js.flow | 53 + node_modules/table/dist/drawTable.js.map | 1 + .../table/dist/getBorderCharacters.js | 119 + .../table/dist/getBorderCharacters.js.flow | 120 + .../table/dist/getBorderCharacters.js.map | 1 + node_modules/table/dist/index.js | 32 + node_modules/table/dist/index.js.flow | 9 + node_modules/table/dist/index.js.map | 1 + node_modules/table/dist/makeConfig.js | 94 + node_modules/table/dist/makeConfig.js.flow | 76 + node_modules/table/dist/makeConfig.js.map | 1 + node_modules/table/dist/makeStreamConfig.js | 101 + .../table/dist/makeStreamConfig.js.flow | 83 + .../table/dist/makeStreamConfig.js.map | 1 + .../table/dist/mapDataUsingRowHeightIndex.js | 44 + .../dist/mapDataUsingRowHeightIndex.js.flow | 34 + .../dist/mapDataUsingRowHeightIndex.js.map | 1 + node_modules/table/dist/padTableData.js | 24 + node_modules/table/dist/padTableData.js.flow | 14 + node_modules/table/dist/padTableData.js.map | 1 + node_modules/table/dist/schemas/config.json | 114 + .../table/dist/schemas/streamConfig.json | 114 + node_modules/table/dist/stringifyTableData.js | 22 + .../table/dist/stringifyTableData.js.flow | 11 + .../table/dist/stringifyTableData.js.map | 1 + node_modules/table/dist/table.js | 110 + node_modules/table/dist/table.js.flow | 96 + node_modules/table/dist/table.js.map | 1 + node_modules/table/dist/truncateTableData.js | 30 + .../table/dist/truncateTableData.js.flow | 17 + .../table/dist/truncateTableData.js.map | 1 + node_modules/table/dist/validateConfig.js | 752 + .../table/dist/validateConfig.js.flow | 34 + node_modules/table/dist/validateConfig.js.map | 1 + .../table/dist/validateStreamConfig.js | 739 + node_modules/table/dist/validateTableData.js | 96 + .../table/dist/validateTableData.js.flow | 44 + .../table/dist/validateTableData.js.map | 1 + node_modules/table/dist/wrapCell.js | 48 + node_modules/table/dist/wrapCell.js.flow | 35 + node_modules/table/dist/wrapCell.js.map | 1 + node_modules/table/dist/wrapString.js | 40 + node_modules/table/dist/wrapString.js.flow | 29 + node_modules/table/dist/wrapString.js.map | 1 + node_modules/table/dist/wrapWord.js | 47 + node_modules/table/dist/wrapWord.js.flow | 39 + node_modules/table/dist/wrapWord.js.map | 1 + .../node_modules/emoji-regex/LICENSE-MIT.txt | 20 + .../table/node_modules/emoji-regex/README.md | 73 + .../node_modules/emoji-regex/es2015/index.js | 6 + .../node_modules/emoji-regex/es2015/text.js | 6 + .../table/node_modules/emoji-regex/index.d.ts | 5 + .../table/node_modules/emoji-regex/index.js | 6 + .../node_modules/emoji-regex/package.json | 51 + .../table/node_modules/emoji-regex/text.js | 6 + .../is-fullwidth-code-point/index.js | 46 + .../is-fullwidth-code-point/license | 21 + .../is-fullwidth-code-point/package.json | 45 + .../is-fullwidth-code-point/readme.md | 39 + .../table/node_modules/slice-ansi/index.js | 59 + .../table/node_modules/slice-ansi/license | 9 + .../node_modules/slice-ansi/package.json | 51 + .../table/node_modules/slice-ansi/readme.md | 64 + .../table/node_modules/string-width/index.js | 39 + .../table/node_modules/string-width/license | 9 + .../node_modules/string-width/package.json | 56 + .../table/node_modules/string-width/readme.md | 45 + .../table/node_modules/strip-ansi/index.d.ts | 15 + .../table/node_modules/strip-ansi/index.js | 7 + .../table/node_modules/strip-ansi/license | 9 + .../node_modules/strip-ansi/package.json | 54 + .../table/node_modules/strip-ansi/readme.md | 61 + node_modules/table/package.json | 84 + node_modules/text-table/.travis.yml | 4 + node_modules/text-table/LICENSE | 18 + node_modules/text-table/example/align.js | 8 + node_modules/text-table/example/center.js | 8 + node_modules/text-table/example/dotalign.js | 9 + node_modules/text-table/example/doubledot.js | 11 + node_modules/text-table/example/table.js | 6 + node_modules/text-table/index.js | 86 + node_modules/text-table/package.json | 45 + node_modules/text-table/readme.markdown | 134 + node_modules/text-table/test/align.js | 18 + node_modules/text-table/test/ansi-colors.js | 32 + node_modules/text-table/test/center.js | 18 + node_modules/text-table/test/dotalign.js | 20 + node_modules/text-table/test/doubledot.js | 24 + node_modules/text-table/test/table.js | 14 + node_modules/tsconfig-paths/.nycrc.json | 8 + node_modules/tsconfig-paths/CHANGELOG.md | 307 + node_modules/tsconfig-paths/LICENSE | 21 + node_modules/tsconfig-paths/README.md | 231 + .../tsconfig-paths/lib/config-loader.d.ts | 33 + .../tsconfig-paths/lib/config-loader.js | 55 + .../tsconfig-paths/lib/filesystem.d.ts | 33 + node_modules/tsconfig-paths/lib/filesystem.js | 53 + node_modules/tsconfig-paths/lib/index.d.ts | 5 + node_modules/tsconfig-paths/lib/index.js | 13 + .../tsconfig-paths/lib/mapping-entry.d.ts | 17 + .../tsconfig-paths/lib/mapping-entry.js | 51 + .../tsconfig-paths/lib/match-path-async.d.ts | 21 + .../tsconfig-paths/lib/match-path-async.js | 113 + .../tsconfig-paths/lib/match-path-sync.d.ts | 30 + .../tsconfig-paths/lib/match-path-sync.js | 87 + node_modules/tsconfig-paths/lib/options.d.ts | 4 + node_modules/tsconfig-paths/lib/options.js | 13 + node_modules/tsconfig-paths/lib/register.d.ts | 6 + node_modules/tsconfig-paths/lib/register.js | 82 + node_modules/tsconfig-paths/lib/try-path.d.ts | 15 + node_modules/tsconfig-paths/lib/try-path.js | 91 + .../tsconfig-paths/lib/tsconfig-loader.d.ts | 28 + .../tsconfig-paths/lib/tsconfig-loader.js | 97 + node_modules/tsconfig-paths/package.json | 63 + node_modules/tsconfig-paths/register.js | 1 + .../test/config-loader-tests.ts | 90 + .../test/data/match-path-data.ts | 212 + .../tsconfig-paths/test/filesystem-tests.ts | 46 + .../tsconfig-paths/test/mapping-entry-test.ts | 47 + .../test/match-path-async-tests.ts | 27 + .../test/match-path-sync-tests.ts | 23 + node_modules/tsconfig-paths/test/mocha.opts | 3 + .../tsconfig-paths/test/try-path-tests.ts | 99 + .../test/tsconfig-loader-tests.ts | 203 + .../tsconfig-paths/test/tsconfig-named.json | 10 + .../tsconfig-paths/test/tsconfig.json | 9 + node_modules/tsconfig-paths/tslint.json | 88 + node_modules/tslint-eslint-rules/CHANGELOG.md | 398 - node_modules/tslint-eslint-rules/LICENSE | 22 - node_modules/tslint-eslint-rules/README.md | 345 - .../dist/rules/arrayBracketSpacingRule.js | 196 - .../dist/rules/blockSpacingRule.js | 58 - .../dist/rules/braceStyleRule.js | 149 - .../dist/rules/handleCallbackErrRule.js | 155 - .../dist/rules/noConstantConditionRule.js | 116 - .../dist/rules/noControlRegexRule.js | 53 - .../dist/rules/noDuplicateCaseRule.js | 46 - .../dist/rules/noEmptyCharacterClassRule.js | 35 - .../dist/rules/noExAssignRule.js | 57 - .../dist/rules/noExtraBooleanCastRule.js | 83 - .../dist/rules/noExtraSemiRule.js | 69 - .../dist/rules/noInnerDeclarationsRule.js | 67 - .../dist/rules/noInvalidRegexpRule.js | 49 - .../dist/rules/noMultiSpacesRule.js | 119 - .../dist/rules/noRegexSpacesRule.js | 35 - .../dist/rules/noUnexpectedMultilineRule.js | 91 - .../dist/rules/objectCurlySpacingRule.js | 109 - .../dist/rules/sortImportsRule.js | 215 - .../dist/rules/spaceInParensRule.js | 215 - .../dist/rules/terArrowBodyStyleRule.js | 117 - .../dist/rules/terArrowParensRule.js | 115 - .../dist/rules/terArrowSpacingRule.js | 104 - .../rules/terComputedPropertySpacingRule.js | 123 - .../dist/rules/terFuncCallSpacingRule.js | 137 - .../dist/rules/terIndentRule.js | 915 - .../dist/rules/terMaxLenRule.js | 306 - .../dist/rules/terNewlineAfterVarRule.js | 113 - .../rules/terNoIrregularWhitespaceRule.js | 84 - .../dist/rules/terNoMixedSpacesAndTabsRule.js | 115 - .../dist/rules/terNoProtoRule.js | 46 - .../dist/rules/terNoScriptUrlRule.js | 48 - .../dist/rules/terNoSelfCompareRule.js | 75 - .../dist/rules/terNoSparseArraysRule.js | 51 - .../dist/rules/terNoTabsRule.js | 43 - .../dist/rules/terPaddedBlocksRule.js | 229 - .../dist/rules/terPreferArrowCallbackRule.js | 188 - .../dist/rules/validJsdocRule.js | 336 - .../dist/rules/validTypeofRule.js | 47 - .../tslint-eslint-rules/dist/support/token.js | 9 - node_modules/tslint-eslint-rules/index.js | 5 - .../node_modules/tslib/.gitattributes | 1 - .../node_modules/tslib/CopyrightNotice.txt | 15 - .../node_modules/tslib/LICENSE.txt | 55 - .../node_modules/tslib/README.md | 134 - .../node_modules/tslib/bower.json | 34 - .../node_modules/tslib/docs/generator.md | 486 - .../node_modules/tslib/package.json | 28 - .../node_modules/tslib/tslib.d.ts | 33 - .../node_modules/tslib/tslib.es6.html | 1 - .../node_modules/tslib/tslib.es6.js | 178 - .../node_modules/tslib/tslib.html | 1 - .../node_modules/tslib/tslib.js | 241 - node_modules/tslint-eslint-rules/package.json | 50 - node_modules/tslint/.prettierrc | 5 - node_modules/tslint/CHANGELOG.md | 2422 - node_modules/tslint/LICENSE | 201 - node_modules/tslint/README.md | 75 - node_modules/tslint/bin/tslint | 3 - node_modules/tslint/lib/configs/all.d.ts | 263 - node_modules/tslint/lib/configs/all.js | 305 - node_modules/tslint/lib/configs/latest.d.ts | 49 - node_modules/tslint/lib/configs/latest.js | 67 - .../tslint/lib/configs/recommended.d.ts | 125 - .../tslint/lib/configs/recommended.js | 128 - node_modules/tslint/lib/configuration.d.ts | 140 - node_modules/tslint/lib/configuration.js | 516 - .../tslint/lib/enableDisableRules.d.ts | 27 - node_modules/tslint/lib/enableDisableRules.js | 154 - node_modules/tslint/lib/error.d.ts | 39 - node_modules/tslint/lib/error.js | 53 - node_modules/tslint/lib/files/reading.d.ts | 19 - node_modules/tslint/lib/files/reading.js | 49 - node_modules/tslint/lib/files/resolution.d.ts | 25 - node_modules/tslint/lib/files/resolution.js | 100 - node_modules/tslint/lib/formatterLoader.d.ts | 18 - node_modules/tslint/lib/formatterLoader.js | 85 - node_modules/tslint/lib/formatters.d.ts | 18 - node_modules/tslint/lib/formatters.js | 21 - .../lib/formatters/checkstyleFormatter.d.ts | 25 - .../lib/formatters/checkstyleFormatter.js | 82 - .../lib/formatters/codeFrameFormatter.d.ts | 23 - .../lib/formatters/codeFrameFormatter.js | 83 - .../lib/formatters/fileslistFormatter.d.ts | 23 - .../lib/formatters/fileslistFormatter.js | 52 - node_modules/tslint/lib/formatters/index.d.ts | 25 - node_modules/tslint/lib/formatters/index.js | 36 - .../tslint/lib/formatters/jsonFormatter.d.ts | 23 - .../tslint/lib/formatters/jsonFormatter.js | 42 - .../tslint/lib/formatters/junitFormatter.d.ts | 24 - .../tslint/lib/formatters/junitFormatter.js | 93 - .../lib/formatters/msbuildFormatter.d.ts | 23 - .../tslint/lib/formatters/msbuildFormatter.js | 52 - .../tslint/lib/formatters/pmdFormatter.d.ts | 23 - .../tslint/lib/formatters/pmdFormatter.js | 61 - .../tslint/lib/formatters/proseFormatter.d.ts | 23 - .../tslint/lib/formatters/proseFormatter.js | 65 - .../lib/formatters/stylishFormatter.d.ts | 27 - .../tslint/lib/formatters/stylishFormatter.js | 114 - .../tslint/lib/formatters/tapFormatter.d.ts | 24 - .../tslint/lib/formatters/tapFormatter.js | 59 - .../lib/formatters/verboseFormatter.d.ts | 24 - .../tslint/lib/formatters/verboseFormatter.js | 54 - .../tslint/lib/formatters/vsoFormatter.d.ts | 23 - .../tslint/lib/formatters/vsoFormatter.js | 53 - node_modules/tslint/lib/index.d.ts | 47 - node_modules/tslint/lib/index.js | 36 - .../language/formatter/abstractFormatter.d.ts | 23 - .../language/formatter/abstractFormatter.js | 28 - .../lib/language/formatter/formatter.d.ts | 52 - .../lib/language/formatter/formatter.js | 18 - .../lib/language/rule/abstractRule.d.ts | 43 - .../tslint/lib/language/rule/abstractRule.js | 52 - .../language/rule/optionallyTypedRule.d.ts | 22 - .../lib/language/rule/optionallyTypedRule.js | 28 - .../tslint/lib/language/rule/rule.d.ts | 191 - node_modules/tslint/lib/language/rule/rule.js | 180 - .../tslint/lib/language/rule/typedRule.d.ts | 23 - .../tslint/lib/language/rule/typedRule.js | 34 - .../tslint/lib/language/typeUtils.d.ts | 18 - node_modules/tslint/lib/language/typeUtils.js | 35 - node_modules/tslint/lib/language/utils.d.ts | 159 - node_modules/tslint/lib/language/utils.js | 484 - .../walker/blockScopeAwareRuleWalker.d.ts | 38 - .../walker/blockScopeAwareRuleWalker.js | 84 - .../tslint/lib/language/walker/index.d.ts | 23 - .../tslint/lib/language/walker/index.js | 26 - .../walker/programAwareRuleWalker.d.ts | 32 - .../language/walker/programAwareRuleWalker.js | 44 - .../lib/language/walker/ruleWalker.d.ts | 55 - .../tslint/lib/language/walker/ruleWalker.js | 102 - .../language/walker/scopeAwareRuleWalker.d.ts | 65 - .../language/walker/scopeAwareRuleWalker.js | 101 - .../lib/language/walker/syntaxWalker.d.ts | 105 - .../lib/language/walker/syntaxWalker.js | 539 - .../lib/language/walker/walkContext.d.ts | 30 - .../tslint/lib/language/walker/walkContext.js | 41 - .../tslint/lib/language/walker/walker.d.ts | 29 - .../tslint/lib/language/walker/walker.js | 34 - node_modules/tslint/lib/linter.d.ts | 55 - node_modules/tslint/lib/linter.js | 272 - node_modules/tslint/lib/ruleLoader.d.ts | 20 - node_modules/tslint/lib/ruleLoader.js | 120 - node_modules/tslint/lib/rules.d.ts | 19 - node_modules/tslint/lib/rules.js | 22 - .../rules/adjacentOverloadSignaturesRule.d.ts | 24 - .../rules/adjacentOverloadSignaturesRule.js | 166 - node_modules/tslint/lib/rules/alignRule.d.ts | 23 - node_modules/tslint/lib/rules/alignRule.js | 192 - .../tslint/lib/rules/arrayTypeRule.d.ts | 26 - .../tslint/lib/rules/arrayTypeRule.js | 162 - .../tslint/lib/rules/arrowParensRule.d.ts | 24 - .../tslint/lib/rules/arrowParensRule.js | 97 - .../lib/rules/arrowReturnShorthandRule.d.ts | 23 - .../lib/rules/arrowReturnShorthandRule.js | 115 - .../tslint/lib/rules/awaitPromiseRule.d.ts | 24 - .../tslint/lib/rules/awaitPromiseRule.js | 94 - .../lib/rules/banCommaOperatorRule.d.ts | 23 - .../tslint/lib/rules/banCommaOperatorRule.js | 63 - node_modules/tslint/lib/rules/banRule.d.ts | 7 - node_modules/tslint/lib/rules/banRule.js | 179 - .../tslint/lib/rules/banTsIgnoreRule.d.ts | 23 - .../tslint/lib/rules/banTsIgnoreRule.js | 55 - .../tslint/lib/rules/banTypesRule.d.ts | 23 - node_modules/tslint/lib/rules/banTypesRule.js | 75 - .../binaryExpressionOperandOrderRule.d.ts | 23 - .../rules/binaryExpressionOperandOrderRule.js | 97 - .../tslint/lib/rules/callableTypesRule.d.ts | 23 - .../tslint/lib/rules/callableTypesRule.js | 105 - .../tslint/lib/rules/classNameRule.d.ts | 23 - .../tslint/lib/rules/classNameRule.js | 61 - .../arrowReturnShorthand.examples.d.ts | 22 - .../arrowReturnShorthand.examples.js | 36 - .../code-examples/banTsIgnore.examples.d.ts | 22 - .../code-examples/banTsIgnore.examples.js | 30 - .../code-examples/className.examples.d.ts | 22 - .../rules/code-examples/className.examples.js | 30 - .../rules/code-examples/curly.examples.d.ts | 22 - .../lib/rules/code-examples/curly.examples.js | 42 - .../functionConstructor.examples.d.ts | 22 - .../functionConstructor.examples.js | 35 - .../rules/code-examples/noAny.examples.d.ts | 27 - .../lib/rules/code-examples/noAny.examples.js | 35 - .../noAsyncWithoutAwait.examples.d.ts | 22 - .../noAsyncWithoutAwait.examples.js | 29 - .../noEmptyInterface.examples.d.ts | 22 - .../noEmptyInterface.examples.js | 30 - ...noObjectLiteralTypeAssertion.examples.d.ts | 18 - .../noObjectLiteralTypeAssertion.examples.js | 35 - .../noPromiseAsBoolean.examples.d.ts | 22 - .../noPromiseAsBoolean.examples.js | 36 - .../noSparseArrays.examples.d.ts | 22 - .../code-examples/noSparseArrays.examples.js | 30 - .../noStringThrowRule.examples.d.ts | 22 - .../noStringThrowRule.examples.js | 30 - ...noUnnecessaryCallbackWrapper.examples.d.ts | 22 - .../noUnnecessaryCallbackWrapper.examples.js | 30 - .../noUseBeforeDeclare.examples.d.ts | 22 - .../noUseBeforeDeclare.examples.js | 30 - .../objectLiteralSortKeys.examples.d.ts | 22 - .../objectLiteralSortKeys.examples.js | 37 - .../oneVariablePerDeclaration.examples.d.ts | 27 - .../oneVariablePerDeclaration.examples.js | 35 - .../onlyArrowFunctions.examples.d.ts | 22 - .../onlyArrowFunctions.examples.js | 30 - .../preferTemplate.examples.d.ts | 22 - .../code-examples/preferTemplate.examples.js | 36 - .../code-examples/preferWhile.examples.d.ts | 22 - .../code-examples/preferWhile.examples.js | 30 - .../rules/code-examples/radix.examples.d.ts | 22 - .../lib/rules/code-examples/radix.examples.js | 30 - .../code-examples/staticThis.examples.d.ts | 22 - .../code-examples/staticThis.examples.js | 30 - .../strictComparisons.examples.d.ts | 22 - .../strictComparisons.examples.js | 42 - .../code-examples/switchDefault.examples.d.ts | 22 - .../code-examples/switchDefault.examples.js | 30 - .../rules/code-examples/typedef.examples.d.ts | 22 - .../rules/code-examples/typedef.examples.js | 78 - .../unnecessaryElse.examples.d.ts | 22 - .../code-examples/unnecessaryElse.examples.js | 30 - .../code-examples/useIsnan.examples.d.ts | 22 - .../rules/code-examples/useIsnan.examples.js | 30 - .../tslint/lib/rules/commentFormatRule.d.ts | 29 - .../tslint/lib/rules/commentFormatRule.js | 238 - .../tslint/lib/rules/commentTypeRule.d.ts | 22 - .../tslint/lib/rules/commentTypeRule.js | 86 - .../rules/completed-docs/blockExclusion.d.ts | 26 - .../rules/completed-docs/blockExclusion.js | 42 - .../rules/completed-docs/classExclusion.d.ts | 30 - .../rules/completed-docs/classExclusion.js | 58 - .../completed-docs/constructorExclusion.d.ts | 26 - .../completed-docs/constructorExclusion.js | 45 - .../lib/rules/completed-docs/exclusion.d.ts | 25 - .../lib/rules/completed-docs/exclusion.js | 33 - .../completed-docs/exclusionDescriptors.d.ts | 28 - .../completed-docs/exclusionDescriptors.js | 18 - .../lib/rules/completed-docs/exclusions.d.ts | 25 - .../lib/rules/completed-docs/exclusions.js | 66 - .../rules/completed-docs/tagExclusion.d.ts | 34 - .../lib/rules/completed-docs/tagExclusion.js | 79 - .../tslint/lib/rules/completedDocsRule.d.ts | 199 - .../tslint/lib/rules/completedDocsRule.js | 484 - node_modules/tslint/lib/rules/curlyRule.d.ts | 24 - node_modules/tslint/lib/rules/curlyRule.js | 147 - .../lib/rules/cyclomaticComplexityRule.d.ts | 27 - .../lib/rules/cyclomaticComplexityRule.js | 123 - .../tslint/lib/rules/deprecationRule.d.ts | 23 - .../tslint/lib/rules/deprecationRule.js | 234 - .../tslint/lib/rules/encodingRule.d.ts | 24 - node_modules/tslint/lib/rules/encodingRule.js | 76 - .../tslint/lib/rules/eoflineRule.d.ts | 23 - node_modules/tslint/lib/rules/eoflineRule.js | 58 - .../tslint/lib/rules/fileHeaderRule.d.ts | 29 - .../tslint/lib/rules/fileHeaderRule.js | 191 - .../tslint/lib/rules/fileNameCasingRule.d.ts | 25 - .../tslint/lib/rules/fileNameCasingRule.js | 214 - node_modules/tslint/lib/rules/forinRule.d.ts | 23 - node_modules/tslint/lib/rules/forinRule.js | 73 - .../lib/rules/functionConstructorRule.d.ts | 23 - .../lib/rules/functionConstructorRule.js | 64 - .../tslint/lib/rules/importBlacklistRule.d.ts | 27 - .../tslint/lib/rules/importBlacklistRule.js | 214 - .../tslint/lib/rules/importSpacingRule.d.ts | 31 - .../tslint/lib/rules/importSpacingRule.js | 140 - .../lib/rules/incrementDecrementRule.d.ts | 23 - .../lib/rules/incrementDecrementRule.js | 100 - node_modules/tslint/lib/rules/indentRule.d.ts | 23 - node_modules/tslint/lib/rules/indentRule.js | 126 - .../tslint/lib/rules/interfaceNameRule.d.ts | 24 - .../tslint/lib/rules/interfaceNameRule.js | 87 - .../rules/interfaceOverTypeLiteralRule.d.ts | 23 - .../lib/rules/interfaceOverTypeLiteralRule.js | 66 - .../tslint/lib/rules/invalidVoidRule.d.ts | 26 - .../tslint/lib/rules/invalidVoidRule.js | 142 - .../tslint/lib/rules/jsdocFormatRule.d.ts | 24 - .../tslint/lib/rules/jsdocFormatRule.js | 113 - .../tslint/lib/rules/labelPositionRule.d.ts | 23 - .../tslint/lib/rules/labelPositionRule.js | 69 - .../tslint/lib/rules/linebreakStyleRule.d.ts | 24 - .../tslint/lib/rules/linebreakStyleRule.js | 67 - .../lib/rules/matchDefaultExportNameRule.d.ts | 23 - .../lib/rules/matchDefaultExportNameRule.js | 73 - .../lib/rules/maxClassesPerFileRule.d.ts | 23 - .../tslint/lib/rules/maxClassesPerFileRule.js | 84 - .../lib/rules/maxFileLineCountRule.d.ts | 24 - .../tslint/lib/rules/maxFileLineCountRule.js | 62 - .../tslint/lib/rules/maxLineLengthRule.d.ts | 25 - .../tslint/lib/rules/maxLineLengthRule.js | 155 - .../tslint/lib/rules/memberAccessRule.d.ts | 24 - .../tslint/lib/rules/memberAccessRule.js | 174 - .../tslint/lib/rules/memberOrderingRule.d.ts | 24 - .../tslint/lib/rules/memberOrderingRule.js | 697 - .../tslint/lib/rules/newParensRule.d.ts | 23 - .../tslint/lib/rules/newParensRule.js | 54 - .../lib/rules/newlineBeforeReturnRule.d.ts | 23 - .../lib/rules/newlineBeforeReturnRule.js | 96 - .../lib/rules/newlinePerChainedCallRule.d.ts | 23 - .../lib/rules/newlinePerChainedCallRule.js | 74 - .../noAngleBracketTypeAssertionRule.d.ts | 23 - .../rules/noAngleBracketTypeAssertionRule.js | 68 - node_modules/tslint/lib/rules/noAnyRule.d.ts | 23 - node_modules/tslint/lib/rules/noAnyRule.js | 79 - node_modules/tslint/lib/rules/noArgRule.d.ts | 23 - node_modules/tslint/lib/rules/noArgRule.js | 58 - .../lib/rules/noAsyncWithoutAwaitRule.d.ts | 23 - .../lib/rules/noAsyncWithoutAwaitRule.js | 110 - .../tslint/lib/rules/noBitwiseRule.d.ts | 23 - .../tslint/lib/rules/noBitwiseRule.js | 73 - .../rules/noBooleanLiteralCompareRule.d.ts | 23 - .../lib/rules/noBooleanLiteralCompareRule.js | 123 - .../rules/noConditionalAssignmentRule.d.ts | 23 - .../lib/rules/noConditionalAssignmentRule.js | 118 - .../rules/noConsecutiveBlankLinesRule.d.ts | 29 - .../lib/rules/noConsecutiveBlankLinesRule.js | 133 - .../tslint/lib/rules/noConsoleRule.d.ts | 23 - .../tslint/lib/rules/noConsoleRule.js | 62 - .../tslint/lib/rules/noConstructRule.d.ts | 23 - .../tslint/lib/rules/noConstructRule.js | 61 - .../tslint/lib/rules/noDebuggerRule.d.ts | 23 - .../tslint/lib/rules/noDebuggerRule.js | 53 - .../tslint/lib/rules/noDefaultExportRule.d.ts | 23 - .../tslint/lib/rules/noDefaultExportRule.js | 66 - .../tslint/lib/rules/noDefaultImportRule.d.ts | 26 - .../tslint/lib/rules/noDefaultImportRule.js | 118 - .../lib/rules/noDuplicateImportsRule.d.ts | 24 - .../lib/rules/noDuplicateImportsRule.js | 114 - .../lib/rules/noDuplicateSuperRule.d.ts | 24 - .../tslint/lib/rules/noDuplicateSuperRule.js | 173 - .../lib/rules/noDuplicateSwitchCaseRule.d.ts | 23 - .../lib/rules/noDuplicateSwitchCaseRule.js | 67 - .../lib/rules/noDuplicateVariableRule.d.ts | 23 - .../lib/rules/noDuplicateVariableRule.js | 112 - .../tslint/lib/rules/noDynamicDeleteRule.d.ts | 23 - .../tslint/lib/rules/noDynamicDeleteRule.js | 94 - .../lib/rules/noEmptyInterfaceRule.d.ts | 24 - .../tslint/lib/rules/noEmptyInterfaceRule.js | 72 - .../tslint/lib/rules/noEmptyRule.d.ts | 23 - node_modules/tslint/lib/rules/noEmptyRule.js | 107 - node_modules/tslint/lib/rules/noEvalRule.d.ts | 23 - node_modules/tslint/lib/rules/noEvalRule.js | 57 - .../lib/rules/noFloatingPromisesRule.d.ts | 23 - .../lib/rules/noFloatingPromisesRule.js | 80 - .../tslint/lib/rules/noForInArrayRule.d.ts | 23 - .../tslint/lib/rules/noForInArrayRule.js | 60 - .../tslint/lib/rules/noForInRule.d.ts | 23 - node_modules/tslint/lib/rules/noForInRule.js | 56 - .../lib/rules/noImplicitDependenciesRule.d.ts | 23 - .../lib/rules/noImplicitDependenciesRule.js | 152 - .../lib/rules/noImportSideEffectRule.d.ts | 23 - .../lib/rules/noImportSideEffectRule.js | 78 - .../lib/rules/noInferrableTypesRule.d.ts | 23 - .../tslint/lib/rules/noInferrableTypesRule.js | 126 - .../rules/noInferredEmptyObjectTypeRule.d.ts | 24 - .../rules/noInferredEmptyObjectTypeRule.js | 106 - .../lib/rules/noInternalModuleRule.d.ts | 23 - .../tslint/lib/rules/noInternalModuleRule.js | 85 - .../rules/noInvalidTemplateStringsRule.d.ts | 23 - .../lib/rules/noInvalidTemplateStringsRule.js | 69 - .../tslint/lib/rules/noInvalidThisRule.d.ts | 24 - .../tslint/lib/rules/noInvalidThisRule.js | 114 - .../lib/rules/noIrregularWhitespaceRule.d.ts | 24 - .../lib/rules/noIrregularWhitespaceRule.js | 59 - .../tslint/lib/rules/noMagicNumbersRule.d.ts | 25 - .../tslint/lib/rules/noMagicNumbersRule.js | 165 - .../lib/rules/noMergeableNamespaceRule.d.ts | 23 - .../lib/rules/noMergeableNamespaceRule.js | 92 - .../tslint/lib/rules/noMisusedNewRule.d.ts | 24 - .../tslint/lib/rules/noMisusedNewRule.js | 77 - .../tslint/lib/rules/noNamespaceRule.d.ts | 23 - .../tslint/lib/rules/noNamespaceRule.js | 77 - .../lib/rules/noNonNullAssertionRule.d.ts | 23 - .../lib/rules/noNonNullAssertionRule.js | 54 - .../tslint/lib/rules/noNullKeywordRule.d.ts | 23 - .../tslint/lib/rules/noNullKeywordRule.js | 71 - .../lib/rules/noNullUndefinedUnionRule.d.ts | 23 - .../lib/rules/noNullUndefinedUnionRule.js | 88 - .../noObjectLiteralTypeAssertionRule.d.ts | 23 - .../rules/noObjectLiteralTypeAssertionRule.js | 87 - .../lib/rules/noParameterPropertiesRule.d.ts | 23 - .../lib/rules/noParameterPropertiesRule.js | 62 - .../rules/noParameterReassignmentRule.d.ts | 23 - .../lib/rules/noParameterReassignmentRule.js | 71 - .../lib/rules/noPromiseAsBooleanRule.d.ts | 22 - .../lib/rules/noPromiseAsBooleanRule.js | 120 - .../lib/rules/noRedundantJsdocRule.d.ts | 25 - .../tslint/lib/rules/noRedundantJsdocRule.js | 141 - .../lib/rules/noReferenceImportRule.d.ts | 23 - .../tslint/lib/rules/noReferenceImportRule.js | 57 - .../tslint/lib/rules/noReferenceRule.d.ts | 23 - .../tslint/lib/rules/noReferenceRule.js | 51 - .../lib/rules/noRequireImportsRule.d.ts | 23 - .../tslint/lib/rules/noRequireImportsRule.js | 51 - .../lib/rules/noRestrictedGlobalsRule.d.ts | 23 - .../lib/rules/noRestrictedGlobalsRule.js | 100 - .../tslint/lib/rules/noReturnAwaitRule.d.ts | 23 - .../tslint/lib/rules/noReturnAwaitRule.js | 114 - .../lib/rules/noShadowedVariableRule.d.ts | 23 - .../lib/rules/noShadowedVariableRule.js | 339 - .../tslint/lib/rules/noSparseArraysRule.d.ts | 23 - .../tslint/lib/rules/noSparseArraysRule.js | 100 - .../tslint/lib/rules/noStringLiteralRule.d.ts | 24 - .../tslint/lib/rules/noStringLiteralRule.js | 73 - .../tslint/lib/rules/noStringThrowRule.d.ts | 23 - .../tslint/lib/rules/noStringThrowRule.js | 87 - .../lib/rules/noSubmoduleImportsRule.d.ts | 23 - .../lib/rules/noSubmoduleImportsRule.js | 76 - .../rules/noSwitchCaseFallThroughRule.d.ts | 28 - .../lib/rules/noSwitchCaseFallThroughRule.js | 89 - .../lib/rules/noTautologyExpressionRule.d.ts | 22 - .../lib/rules/noTautologyExpressionRule.js | 96 - .../lib/rules/noThisAssignmentRule.d.ts | 24 - .../tslint/lib/rules/noThisAssignmentRule.js | 128 - .../lib/rules/noTrailingWhitespaceRule.d.ts | 23 - .../lib/rules/noTrailingWhitespaceRule.js | 143 - .../tslint/lib/rules/noUnboundMethodRule.d.ts | 23 - .../tslint/lib/rules/noUnboundMethodRule.js | 174 - .../noUnnecessaryCallbackWrapperRule.d.ts | 23 - .../rules/noUnnecessaryCallbackWrapperRule.js | 93 - .../lib/rules/noUnnecessaryClassRule.d.ts | 25 - .../lib/rules/noUnnecessaryClassRule.js | 114 - .../rules/noUnnecessaryInitializerRule.d.ts | 24 - .../lib/rules/noUnnecessaryInitializerRule.js | 107 - .../lib/rules/noUnnecessaryQualifierRule.d.ts | 23 - .../lib/rules/noUnnecessaryQualifierRule.js | 129 - .../rules/noUnnecessaryTypeAssertionRule.d.ts | 23 - .../rules/noUnnecessaryTypeAssertionRule.js | 135 - .../tslint/lib/rules/noUnsafeAnyRule.d.ts | 23 - .../tslint/lib/rules/noUnsafeAnyRule.js | 425 - .../tslint/lib/rules/noUnsafeFinallyRule.d.ts | 23 - .../tslint/lib/rules/noUnsafeFinallyRule.js | 140 - .../lib/rules/noUnusedExpressionRule.d.ts | 23 - .../lib/rules/noUnusedExpressionRule.js | 220 - .../lib/rules/noUnusedVariableRule.d.ts | 22 - .../tslint/lib/rules/noUnusedVariableRule.js | 434 - .../lib/rules/noUseBeforeDeclareRule.d.ts | 23 - .../lib/rules/noUseBeforeDeclareRule.js | 106 - .../tslint/lib/rules/noVarKeywordRule.d.ts | 23 - .../tslint/lib/rules/noVarKeywordRule.js | 75 - .../tslint/lib/rules/noVarRequiresRule.d.ts | 23 - .../tslint/lib/rules/noVarRequiresRule.js | 70 - .../lib/rules/noVoidExpressionRule.d.ts | 23 - .../tslint/lib/rules/noVoidExpressionRule.js | 94 - .../lib/rules/numberLiteralFormatRule.d.ts | 27 - .../lib/rules/numberLiteralFormatRule.js | 122 - .../lib/rules/objectLiteralKeyQuotesRule.d.ts | 25 - .../lib/rules/objectLiteralKeyQuotesRule.js | 152 - .../lib/rules/objectLiteralShorthandRule.d.ts | 34 - .../lib/rules/objectLiteralShorthandRule.js | 168 - .../lib/rules/objectLiteralSortKeysRule.d.ts | 26 - .../lib/rules/objectLiteralSortKeysRule.js | 257 - .../tslint/lib/rules/oneLineRule.d.ts | 23 - node_modules/tslint/lib/rules/oneLineRule.js | 162 - .../rules/oneVariablePerDeclarationRule.d.ts | 23 - .../rules/oneVariablePerDeclarationRule.js | 75 - .../lib/rules/onlyArrowFunctionsRule.d.ts | 23 - .../lib/rules/onlyArrowFunctionsRule.js | 98 - .../tslint/lib/rules/orderedImportsRule.d.ts | 25 - .../tslint/lib/rules/orderedImportsRule.js | 567 - .../preferConditionalExpressionRule.d.ts | 23 - .../rules/preferConditionalExpressionRule.js | 115 - .../tslint/lib/rules/preferConstRule.d.ts | 23 - .../tslint/lib/rules/preferConstRule.js | 319 - .../tslint/lib/rules/preferForOfRule.d.ts | 23 - .../tslint/lib/rules/preferForOfRule.js | 170 - .../rules/preferFunctionOverMethodRule.d.ts | 23 - .../lib/rules/preferFunctionOverMethodRule.js | 112 - .../lib/rules/preferMethodSignatureRule.d.ts | 24 - .../lib/rules/preferMethodSignatureRule.js | 75 - .../lib/rules/preferObjectSpreadRule.d.ts | 24 - .../lib/rules/preferObjectSpreadRule.js | 128 - .../tslint/lib/rules/preferReadonlyRule.d.ts | 22 - .../tslint/lib/rules/preferReadonlyRule.js | 245 - .../tslint/lib/rules/preferSwitchRule.d.ts | 23 - .../tslint/lib/rules/preferSwitchRule.js | 146 - .../tslint/lib/rules/preferTemplateRule.d.ts | 24 - .../tslint/lib/rules/preferTemplateRule.js | 135 - .../tslint/lib/rules/preferWhileRule.d.ts | 25 - .../tslint/lib/rules/preferWhileRule.js | 76 - .../lib/rules/promiseFunctionAsyncRule.d.ts | 23 - .../lib/rules/promiseFunctionAsyncRule.js | 116 - .../tslint/lib/rules/quotemarkRule.d.ts | 23 - .../tslint/lib/rules/quotemarkRule.js | 307 - node_modules/tslint/lib/rules/radixRule.d.ts | 23 - node_modules/tslint/lib/rules/radixRule.js | 89 - .../lib/rules/restrictPlusOperandsRule.d.ts | 24 - .../lib/rules/restrictPlusOperandsRule.js | 104 - .../tslint/lib/rules/returnUndefinedRule.d.ts | 24 - .../tslint/lib/rules/returnUndefinedRule.js | 175 - .../tslint/lib/rules/semicolonRule.d.ts | 25 - .../tslint/lib/rules/semicolonRule.js | 335 - .../rules/spaceBeforeFunctionParenRule.d.ts | 24 - .../lib/rules/spaceBeforeFunctionParenRule.js | 134 - .../lib/rules/spaceWithinParensRule.d.ts | 25 - .../tslint/lib/rules/spaceWithinParensRule.js | 158 - .../tslint/lib/rules/staticThisRule.d.ts | 23 - .../tslint/lib/rules/staticThisRule.js | 77 - .../rules/strictBooleanExpressionsRule.d.ts | 38 - .../lib/rules/strictBooleanExpressionsRule.js | 424 - .../lib/rules/strictComparisonsRule.d.ts | 36 - .../tslint/lib/rules/strictComparisonsRule.js | 257 - .../rules/strictStringExpressionsRule.d.ts | 24 - .../lib/rules/strictStringExpressionsRule.js | 131 - .../lib/rules/strictTypePredicatesRule.d.ts | 25 - .../lib/rules/strictTypePredicatesRule.js | 247 - .../tslint/lib/rules/switchDefaultRule.d.ts | 23 - .../tslint/lib/rules/switchDefaultRule.js | 56 - .../lib/rules/switchFinalBreakRule.d.ts | 24 - .../tslint/lib/rules/switchFinalBreakRule.js | 110 - .../tslint/lib/rules/trailingCommaRule.d.ts | 26 - .../tslint/lib/rules/trailingCommaRule.js | 242 - .../tslint/lib/rules/tripleEqualsRule.d.ts | 24 - .../tslint/lib/rules/tripleEqualsRule.js | 83 - .../lib/rules/typeLiteralDelimiterRule.d.ts | 26 - .../lib/rules/typeLiteralDelimiterRule.js | 101 - .../tslint/lib/rules/typedefRule.d.ts | 23 - node_modules/tslint/lib/rules/typedefRule.js | 217 - .../lib/rules/typedefWhitespaceRule.d.ts | 23 - .../tslint/lib/rules/typedefWhitespaceRule.js | 198 - .../tslint/lib/rules/typeofCompareRule.d.ts | 23 - .../tslint/lib/rules/typeofCompareRule.js | 91 - .../lib/rules/unifiedSignaturesRule.d.ts | 26 - .../tslint/lib/rules/unifiedSignaturesRule.js | 320 - .../tslint/lib/rules/unnecessaryBindRule.d.ts | 25 - .../tslint/lib/rules/unnecessaryBindRule.js | 128 - .../lib/rules/unnecessaryConstructorRule.d.ts | 23 - .../lib/rules/unnecessaryConstructorRule.js | 132 - .../tslint/lib/rules/unnecessaryElseRule.d.ts | 7 - .../tslint/lib/rules/unnecessaryElseRule.js | 135 - .../rules/useDefaultTypeParameterRule.d.ts | 23 - .../lib/rules/useDefaultTypeParameterRule.js | 125 - .../tslint/lib/rules/useIsnanRule.d.ts | 23 - node_modules/tslint/lib/rules/useIsnanRule.js | 72 - .../tslint/lib/rules/variableNameRule.d.ts | 24 - .../tslint/lib/rules/variableNameRule.js | 219 - .../tslint/lib/rules/whitespaceRule.d.ts | 24 - .../tslint/lib/rules/whitespaceRule.js | 356 - node_modules/tslint/lib/runner.d.ts | 93 - node_modules/tslint/lib/runner.js | 206 - node_modules/tslint/lib/test.d.ts | 41 - node_modules/tslint/lib/test.js | 245 - node_modules/tslint/lib/tslintCli.d.ts | 17 - node_modules/tslint/lib/tslintCli.js | 243 - node_modules/tslint/lib/utils.d.ts | 83 - node_modules/tslint/lib/utils.js | 336 - node_modules/tslint/lib/verify/lines.d.ts | 38 - node_modules/tslint/lib/verify/lines.js | 159 - node_modules/tslint/lib/verify/lintError.d.ts | 11 - node_modules/tslint/lib/verify/lintError.js | 40 - node_modules/tslint/lib/verify/parse.d.ts | 15 - node_modules/tslint/lib/verify/parse.js | 266 - node_modules/tslint/node_modules/.bin/semver | 1 - .../node_modules/commander/CHANGELOG.md | 419 - .../tslint/node_modules/commander/LICENSE | 22 - .../tslint/node_modules/commander/Readme.md | 428 - .../tslint/node_modules/commander/index.js | 1224 - .../node_modules/commander/package.json | 38 - .../node_modules/commander/typings/index.d.ts | 310 - .../tslint/node_modules/semver/CHANGELOG.md | 39 - .../tslint/node_modules/semver/README.md | 412 - .../tslint/node_modules/semver/bin/semver | 160 - .../tslint/node_modules/semver/package.json | 28 - .../tslint/node_modules/semver/range.bnf | 16 - .../tslint/node_modules/semver/semver.js | 1483 - node_modules/tslint/package.json | 93 - node_modules/tslint/tslint-vscode.json | 25 - node_modules/tsutils/CHANGELOG.md | 529 - node_modules/tsutils/README.md | 61 - node_modules/tsutils/index.js | 6 - node_modules/tsutils/package.json | 55 - node_modules/tsutils/typeguard/2.8/index.js | 6 - node_modules/tsutils/typeguard/2.8/node.d.ts | 153 - node_modules/tsutils/typeguard/2.8/node.js | 695 - node_modules/tsutils/typeguard/2.8/type.js | 76 - node_modules/tsutils/typeguard/2.9/index.js | 6 - node_modules/tsutils/typeguard/2.9/node.js | 10 - node_modules/tsutils/typeguard/2.9/type.js | 5 - node_modules/tsutils/typeguard/3.0/index.js | 6 - node_modules/tsutils/typeguard/3.0/node.js | 18 - node_modules/tsutils/typeguard/3.0/type.d.ts | 3 - node_modules/tsutils/typeguard/3.0/type.js | 10 - node_modules/tsutils/typeguard/index.js | 6 - node_modules/tsutils/typeguard/next/index.js | 6 - node_modules/tsutils/typeguard/next/node.d.ts | 1 - node_modules/tsutils/typeguard/next/node.js | 5 - node_modules/tsutils/typeguard/next/type.js | 5 - node_modules/tsutils/typeguard/node.d.ts | 1 - node_modules/tsutils/typeguard/node.js | 5 - node_modules/tsutils/typeguard/type.d.ts | 1 - node_modules/tsutils/typeguard/type.js | 5 - node_modules/tsutils/util/control-flow.js | 178 - node_modules/tsutils/util/convert-ast.js | 48 - node_modules/tsutils/util/index.js | 9 - node_modules/tsutils/util/type.d.ts | 9 - node_modules/tsutils/util/type.js | 143 - node_modules/tsutils/util/usage.js | 704 - node_modules/tsutils/util/util.d.ts | 121 - node_modules/tsutils/util/util.js | 1109 - node_modules/tsutils/yarn.lock | 2412 - node_modules/type-check/LICENSE | 22 + node_modules/type-check/README.md | 210 + node_modules/type-check/lib/check.js | 128 + node_modules/type-check/lib/index.js | 16 + node_modules/type-check/lib/parse-type.js | 198 + node_modules/type-check/package.json | 39 + node_modules/type-fest/index.d.ts | 20 + node_modules/type-fest/license | 9 + node_modules/type-fest/package.json | 51 + node_modules/type-fest/readme.md | 635 + node_modules/type-fest/source/basic.d.ts | 67 + node_modules/type-fest/source/except.d.ts | 22 + .../type-fest/source/literal-union.d.ts | 33 + .../type-fest/source/merge-exclusive.d.ts | 39 + node_modules/type-fest/source/merge.d.ts | 22 + node_modules/type-fest/source/mutable.d.ts | 22 + node_modules/type-fest/source/opaque.d.ts | 40 + .../type-fest/source/package-json.d.ts | 501 + .../type-fest/source/partial-deep.d.ts | 72 + node_modules/type-fest/source/promisable.d.ts | 23 + .../type-fest/source/readonly-deep.d.ts | 59 + .../source/require-at-least-one.d.ts | 32 + .../type-fest/source/require-exactly-one.d.ts | 36 + .../type-fest/source/set-optional.d.ts | 32 + .../type-fest/source/set-required.d.ts | 32 + node_modules/uri-js/LICENSE | 11 + node_modules/uri-js/README.md | 201 + node_modules/uri-js/dist/es5/uri.all.d.ts | 59 + node_modules/uri-js/dist/es5/uri.all.js | 1443 + node_modules/uri-js/dist/es5/uri.all.js.map | 1 + node_modules/uri-js/dist/es5/uri.all.min.d.ts | 59 + node_modules/uri-js/dist/es5/uri.all.min.js | 3 + .../uri-js/dist/es5/uri.all.min.js.map | 1 + node_modules/uri-js/dist/esnext/index.d.ts | 1 + node_modules/uri-js/dist/esnext/index.js | 17 + node_modules/uri-js/dist/esnext/index.js.map | 1 + .../uri-js/dist/esnext/regexps-iri.d.ts | 3 + .../uri-js/dist/esnext/regexps-iri.js | 3 + .../uri-js/dist/esnext/regexps-iri.js.map | 1 + .../uri-js/dist/esnext/regexps-uri.d.ts | 4 + .../uri-js/dist/esnext/regexps-uri.js | 42 + .../uri-js/dist/esnext/regexps-uri.js.map | 1 + .../uri-js/dist/esnext/schemes/http.d.ts | 3 + .../uri-js/dist/esnext/schemes/http.js | 28 + .../uri-js/dist/esnext/schemes/http.js.map | 1 + .../uri-js/dist/esnext/schemes/https.d.ts | 3 + .../uri-js/dist/esnext/schemes/https.js | 9 + .../uri-js/dist/esnext/schemes/https.js.map | 1 + .../uri-js/dist/esnext/schemes/mailto.d.ts | 12 + .../uri-js/dist/esnext/schemes/mailto.js | 148 + .../uri-js/dist/esnext/schemes/mailto.js.map | 1 + .../uri-js/dist/esnext/schemes/urn-uuid.d.ts | 7 + .../uri-js/dist/esnext/schemes/urn-uuid.js | 23 + .../dist/esnext/schemes/urn-uuid.js.map | 1 + .../uri-js/dist/esnext/schemes/urn.d.ts | 10 + .../uri-js/dist/esnext/schemes/urn.js | 49 + .../uri-js/dist/esnext/schemes/urn.js.map | 1 + .../uri-js/dist/esnext/schemes/ws.d.ts | 7 + node_modules/uri-js/dist/esnext/schemes/ws.js | 41 + .../uri-js/dist/esnext/schemes/ws.js.map | 1 + .../uri-js/dist/esnext/schemes/wss.d.ts | 3 + .../uri-js/dist/esnext/schemes/wss.js | 9 + .../uri-js/dist/esnext/schemes/wss.js.map | 1 + node_modules/uri-js/dist/esnext/uri.d.ts | 59 + node_modules/uri-js/dist/esnext/uri.js | 480 + node_modules/uri-js/dist/esnext/uri.js.map | 1 + node_modules/uri-js/dist/esnext/util.d.ts | 6 + node_modules/uri-js/dist/esnext/util.js | 36 + node_modules/uri-js/dist/esnext/util.js.map | 1 + node_modules/uri-js/package.json | 77 + node_modules/uri-js/yarn.lock | 1923 + node_modules/v8-compile-cache/CHANGELOG.md | 45 + node_modules/v8-compile-cache/LICENSE | 21 + node_modules/v8-compile-cache/README.md | 53 + node_modules/v8-compile-cache/package.json | 33 + .../v8-compile-cache/v8-compile-cache.js | 367 + node_modules/word-wrap/LICENSE | 21 + node_modules/word-wrap/README.md | 182 + node_modules/word-wrap/index.d.ts | 50 + node_modules/word-wrap/index.js | 46 + node_modules/word-wrap/package.json | 77 + node_modules/write/LICENSE | 21 + node_modules/write/README.md | 178 + node_modules/write/index.js | 160 + node_modules/write/package.json | 74 + package.json | 2 +- 5488 files changed, 487362 insertions(+), 60779 deletions(-) create mode 120000 node_modules/.bin/eslint create mode 120000 node_modules/.bin/eslint-config-prettier-check create mode 120000 node_modules/.bin/eslint-ignore-errors create mode 120000 node_modules/.bin/json5 create mode 120000 node_modules/.bin/prettier delete mode 120000 node_modules/.bin/tslint create mode 100644 node_modules/@eslint/eslintrc/CHANGELOG.md create mode 100644 node_modules/@eslint/eslintrc/LICENSE create mode 100644 node_modules/@eslint/eslintrc/README.md create mode 100644 node_modules/@eslint/eslintrc/conf/category-list.json create mode 100644 node_modules/@eslint/eslintrc/conf/config-schema.js create mode 100644 node_modules/@eslint/eslintrc/conf/default-cli-options.js create mode 100644 node_modules/@eslint/eslintrc/conf/environments.js create mode 100644 node_modules/@eslint/eslintrc/conf/eslint-all.js create mode 100644 node_modules/@eslint/eslintrc/conf/eslint-recommended.js create mode 100644 node_modules/@eslint/eslintrc/conf/replacements.json create mode 100644 node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js create mode 100644 node_modules/@eslint/eslintrc/lib/config-array-factory.js create mode 100644 node_modules/@eslint/eslintrc/lib/config-array/config-array.js create mode 100644 node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js create mode 100644 node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js create mode 100644 node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js create mode 100644 node_modules/@eslint/eslintrc/lib/config-array/index.js create mode 100644 node_modules/@eslint/eslintrc/lib/config-array/override-tester.js create mode 100644 node_modules/@eslint/eslintrc/lib/index.js create mode 100644 node_modules/@eslint/eslintrc/lib/shared/ajv.js create mode 100644 node_modules/@eslint/eslintrc/lib/shared/config-ops.js create mode 100644 node_modules/@eslint/eslintrc/lib/shared/config-validator.js create mode 100644 node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js create mode 100644 node_modules/@eslint/eslintrc/lib/shared/naming.js create mode 100644 node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/ignore/CHANGELOG.md create mode 100755 node_modules/@eslint/eslintrc/node_modules/ignore/LICENSE-MIT create mode 100755 node_modules/@eslint/eslintrc/node_modules/ignore/README.md create mode 100644 node_modules/@eslint/eslintrc/node_modules/ignore/index.d.ts create mode 100755 node_modules/@eslint/eslintrc/node_modules/ignore/index.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/ignore/legacy.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/ignore/package.json create mode 100644 node_modules/@eslint/eslintrc/node_modules/strip-json-comments/index.d.ts create mode 100644 node_modules/@eslint/eslintrc/node_modules/strip-json-comments/index.js create mode 100644 node_modules/@eslint/eslintrc/node_modules/strip-json-comments/license create mode 100644 node_modules/@eslint/eslintrc/node_modules/strip-json-comments/package.json create mode 100644 node_modules/@eslint/eslintrc/node_modules/strip-json-comments/readme.md create mode 100644 node_modules/@eslint/eslintrc/package.json create mode 100644 node_modules/@types/json-schema/LICENSE create mode 100644 node_modules/@types/json-schema/README.md create mode 100644 node_modules/@types/json-schema/index.d.ts create mode 100644 node_modules/@types/json-schema/package.json create mode 100644 node_modules/@types/json5/README.md create mode 100644 node_modules/@types/json5/index.d.ts create mode 100644 node_modules/@types/json5/package.json create mode 100644 node_modules/@types/json5/types-metadata.json create mode 100644 node_modules/@typescript-eslint/eslint-plugin/CHANGELOG.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/LICENSE create mode 100644 node_modules/@typescript-eslint/eslint-plugin/README.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended-requiring-type-checking.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended-requiring-type-checking.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/index.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/index.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/await-thenable.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/await-thenable.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-tslint-comment.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-tslint-comment.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-types.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-types.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/brace-style.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/brace-style.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-literal-property-style.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-literal-property-style.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-spacing.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-spacing.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-assertions.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-assertions.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-definitions.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-definitions.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/default-param-last.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/default-param-last.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/dot-notation.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/dot-notation.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/func-call-spacing.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/func-call-spacing.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/BinarySearchTree.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/BinarySearchTree.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/OffsetStorage.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/OffsetStorage.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/TokenInfo.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/TokenInfo.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/index.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/index.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/init-declarations.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/init-declarations.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/keyword-spacing.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/keyword-spacing.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/lines-between-class-members.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/lines-between-class-members.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-delimiter-style.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-delimiter-style.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/method-signature-style.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/method-signature-style.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-array-constructor.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-array-constructor.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-confusing-non-null-assertion.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-confusing-non-null-assertion.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dupe-class-members.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dupe-class-members.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dynamic-delete.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dynamic-delete.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-function.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-function.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-non-null-assertion.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-non-null-assertion.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-parens.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-parens.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-semi.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-semi.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-for-in-array.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-for-in-array.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implicit-any-catch.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implicit-any-catch.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implied-eval.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implied-eval.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-this.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-this.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loop-func.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loop-func.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loss-of-precision.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loss-of-precision.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-parameter-properties.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-parameter-properties.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redeclare.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redeclare.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-require-imports.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-require-imports.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-throw-literal.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-throw-literal.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-expressions.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-expressions.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars-experimental.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars-experimental.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-var-requires.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-var-requires.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-includes.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-includes.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly-parameter-types.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly-parameter-types.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/quotes.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/quotes.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/semi.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/semi.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/space-before-function-paren.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/space-before-function-paren.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/type-annotation-spacing.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/type-annotation-spacing.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/util/createRule.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/util/createRule.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/util/explicitReturnTypeUtils.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/util/explicitReturnTypeUtils.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/util/isTypeReadonly.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/util/isTypeReadonly.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/util/nullThrows.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/util/nullThrows.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/util/objectIterators.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/util/objectIterators.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/util/types.js create mode 100644 node_modules/@typescript-eslint/eslint-plugin/dist/util/types.js.map create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/adjacent-overload-signatures.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/array-type.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/await-thenable.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-ts-comment.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-tslint-comment.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-types.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/brace-style.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/camelcase.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/class-literal-property-style.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-spacing.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-assertions.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-definitions.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-imports.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/default-param-last.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/dot-notation.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-function-return-type.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-member-accessibility.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-module-boundary-types.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/func-call-spacing.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/indent.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/init-declarations.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/keyword-spacing.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-between-class-members.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-delimiter-style.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-ordering.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/method-signature-style.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/naming-convention.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-array-constructor.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-base-to-string.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dupe-class-members.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dynamic-delete.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-function.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-interface.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-explicit-any.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-non-null-assertion.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-parens.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-semi.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extraneous-class.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-floating-promises.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-for-in-array.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implicit-any-catch.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implied-eval.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-inferrable-types.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-this.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-void-type.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loop-func.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loss-of-precision.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-magic-numbers.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-new.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-promises.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-namespace.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-assertion.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-parameter-properties.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redeclare.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-require-imports.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-shadow.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-this-alias.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-throw-literal.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-type-alias.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-condition.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-qualifier.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-assignment.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-call.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-member-access.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-return.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-expressions.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-vars-experimental.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-vars.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-use-before-define.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-constructor.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-var-requires.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-as-const.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-enum-initializers.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-for-of.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-function-type.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-includes.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-literal-enum-member.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-namespace-keyword.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-nullish-coalescing.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-optional-chain.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-regexp-exec.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-ts-expect-error.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/promise-function-async.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/quotes.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-array-sort-compare.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-await.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-plus-operands.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-template-expressions.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/return-await.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/semi.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-function-paren.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/strict-boolean-expressions.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/switch-exhaustiveness-check.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/triple-slash-reference.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/type-annotation-spacing.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/typedef.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/unbound-method.md create mode 100644 node_modules/@typescript-eslint/eslint-plugin/docs/rules/unified-signatures.md rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/.editorconfig (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/.fimbullinter.yaml (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/.wotanrc.yaml (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/CHANGELOG.md (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/LICENSE (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/README.md (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/index.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/index.js (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/package.json (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/2.8/index.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/2.8/index.js (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/2.8/node.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/2.8/node.js (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/2.8/type.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/2.8/type.js (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/2.9/index.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/2.9/index.js (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/2.9/node.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/2.9/node.js (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/2.9/type.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/2.9/type.js (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/3.0/index.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/3.0/index.js (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/3.0/node.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/3.0/node.js (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/3.0/type.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/3.0/type.js (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/3.2/index.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/3.2/index.js (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/3.2/node.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/3.2/node.js (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/3.2/type.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/3.2/type.js (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/index.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/index.js (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/next/index.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/next/index.js (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/next/node.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/next/node.js (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/next/type.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/next/type.js (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/node.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/node.js (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/type.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/typeguard/type.js (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/util/control-flow.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/util/control-flow.js (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/util/convert-ast.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/util/convert-ast.js (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/util/index.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/util/index.js (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/util/type.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/util/type.js (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/util/usage.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/util/usage.js (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/util/util.d.ts (100%) rename node_modules/{tslint-eslint-rules => @typescript-eslint/eslint-plugin}/node_modules/tsutils/util/util.js (100%) create mode 100644 node_modules/@typescript-eslint/eslint-plugin/package.json create mode 100644 node_modules/@typescript-eslint/experimental-utils/CHANGELOG.md create mode 100644 node_modules/@typescript-eslint/experimental-utils/LICENSE create mode 100644 node_modules/@typescript-eslint/experimental-utils/README.md create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/eslint-utils/PatternMatcher.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/eslint-utils/astUtilities.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/eslint-utils/index.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/eslint-utils/predicates.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/index.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/misc.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/predicates.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/InferTypesFromRule.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/RuleCreator.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/RuleTester.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/applyDefault.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/batchedSingleLineTests.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/deepMerge.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/getParserServices.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/index.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/index.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/json-schema.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Definition.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Options.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/PatternVisitor.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Reference.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Referencer.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Scope.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/ScopeManager.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Variable.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/analyze.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/index.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/AST.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/CLIEngine.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/ESLint.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/Linter.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/ParserOptions.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/Rule.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/RuleTester.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/Scope.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/SourceCode.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/index.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-estree.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/PatternMatcher.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/PatternMatcher.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/PatternMatcher.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/PatternMatcher.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/ReferenceTracker.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/ReferenceTracker.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/astUtilities.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/astUtilities.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/astUtilities.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/astUtilities.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/index.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/index.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/index.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/index.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/predicates.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/predicates.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/predicates.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/predicates.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/scopeAnalysis.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/scopeAnalysis.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/index.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/index.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/index.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/index.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/misc.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/misc.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/misc.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/misc.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/predicates.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/predicates.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/predicates.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/predicates.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/InferTypesFromRule.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/InferTypesFromRule.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/InferTypesFromRule.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/InferTypesFromRule.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleCreator.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleCreator.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleCreator.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleCreator.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleTester.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleTester.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleTester.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleTester.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/applyDefault.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/applyDefault.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/applyDefault.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/applyDefault.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/batchedSingleLineTests.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/batchedSingleLineTests.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/batchedSingleLineTests.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/batchedSingleLineTests.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/deepMerge.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/deepMerge.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/deepMerge.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/deepMerge.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/getParserServices.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/getParserServices.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/getParserServices.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/getParserServices.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/index.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/index.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/index.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/index.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/index.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/index.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/index.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/index.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/json-schema.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/json-schema.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/json-schema.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/json-schema.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Definition.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Definition.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Definition.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Definition.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Options.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Options.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Options.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Options.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/PatternVisitor.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/PatternVisitor.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/PatternVisitor.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/PatternVisitor.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Reference.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Reference.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Reference.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Reference.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Referencer.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Referencer.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Referencer.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Referencer.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Scope.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Scope.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Scope.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Scope.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/ScopeManager.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/ScopeManager.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/ScopeManager.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/ScopeManager.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Variable.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Variable.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Variable.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Variable.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/analyze.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/analyze.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/analyze.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/analyze.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/index.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/index.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/index.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/index.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/AST.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/AST.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/AST.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/AST.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/CLIEngine.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/CLIEngine.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/CLIEngine.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/CLIEngine.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ESLint.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ESLint.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ESLint.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ESLint.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Linter.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Linter.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Linter.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Linter.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ParserOptions.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ParserOptions.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ParserOptions.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ParserOptions.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Rule.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Rule.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Rule.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Rule.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/RuleTester.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/RuleTester.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/RuleTester.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/RuleTester.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Scope.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Scope.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Scope.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Scope.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/SourceCode.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/SourceCode.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/SourceCode.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/SourceCode.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/index.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/index.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/index.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/index.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-estree.d.ts create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-estree.d.ts.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-estree.js create mode 100644 node_modules/@typescript-eslint/experimental-utils/dist/ts-estree.js.map create mode 100644 node_modules/@typescript-eslint/experimental-utils/package.json create mode 100644 node_modules/@typescript-eslint/parser/CHANGELOG.md create mode 100644 node_modules/@typescript-eslint/parser/LICENSE create mode 100644 node_modules/@typescript-eslint/parser/README.md create mode 100644 node_modules/@typescript-eslint/parser/dist/index.d.ts create mode 100644 node_modules/@typescript-eslint/parser/dist/index.d.ts.map create mode 100644 node_modules/@typescript-eslint/parser/dist/index.js create mode 100644 node_modules/@typescript-eslint/parser/dist/index.js.map create mode 100644 node_modules/@typescript-eslint/parser/dist/parser-options.d.ts create mode 100644 node_modules/@typescript-eslint/parser/dist/parser-options.d.ts.map create mode 100644 node_modules/@typescript-eslint/parser/dist/parser-options.js create mode 100644 node_modules/@typescript-eslint/parser/dist/parser-options.js.map create mode 100644 node_modules/@typescript-eslint/parser/dist/parser.d.ts create mode 100644 node_modules/@typescript-eslint/parser/dist/parser.d.ts.map create mode 100644 node_modules/@typescript-eslint/parser/dist/parser.js create mode 100644 node_modules/@typescript-eslint/parser/dist/parser.js.map create mode 100644 node_modules/@typescript-eslint/parser/package.json create mode 100644 node_modules/@typescript-eslint/scope-manager/CHANGELOG.md create mode 100644 node_modules/@typescript-eslint/scope-manager/LICENSE create mode 100644 node_modules/@typescript-eslint/scope-manager/README.md create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/ID.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/ID.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/ID.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/ID.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/analyze.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/analyze.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/analyze.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/analyze.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/assert.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/assert.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/assert.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/assert.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/index.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/index.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/index.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/definition/index.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/index.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/index.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/index.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/index.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/dom.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/dom.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/dom.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/dom.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es5.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es5.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es5.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es5.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es6.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es6.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es6.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es6.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es7.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es7.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es7.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/es7.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/index.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/index.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/index.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/index.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/lib.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/lib.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/lib.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/lib.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/index.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/index.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/index.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/referencer/index.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/index.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/index.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/index.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/scope/index.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/variable/index.d.ts create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/variable/index.d.ts.map create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/variable/index.js create mode 100644 node_modules/@typescript-eslint/scope-manager/dist/variable/index.js.map create mode 100644 node_modules/@typescript-eslint/scope-manager/package.json create mode 100644 node_modules/@typescript-eslint/types/CHANGELOG.md create mode 100644 node_modules/@typescript-eslint/types/LICENSE create mode 100644 node_modules/@typescript-eslint/types/README.md create mode 100644 node_modules/@typescript-eslint/types/dist/ast-node-types.d.ts create mode 100644 node_modules/@typescript-eslint/types/dist/ast-node-types.d.ts.map create mode 100644 node_modules/@typescript-eslint/types/dist/ast-node-types.js create mode 100644 node_modules/@typescript-eslint/types/dist/ast-node-types.js.map create mode 100644 node_modules/@typescript-eslint/types/dist/ast-token-types.d.ts create mode 100644 node_modules/@typescript-eslint/types/dist/ast-token-types.d.ts.map create mode 100644 node_modules/@typescript-eslint/types/dist/ast-token-types.js create mode 100644 node_modules/@typescript-eslint/types/dist/ast-token-types.js.map create mode 100644 node_modules/@typescript-eslint/types/dist/index.d.ts create mode 100644 node_modules/@typescript-eslint/types/dist/index.d.ts.map create mode 100644 node_modules/@typescript-eslint/types/dist/index.js create mode 100644 node_modules/@typescript-eslint/types/dist/index.js.map create mode 100644 node_modules/@typescript-eslint/types/dist/lib.d.ts create mode 100644 node_modules/@typescript-eslint/types/dist/lib.d.ts.map create mode 100644 node_modules/@typescript-eslint/types/dist/lib.js create mode 100644 node_modules/@typescript-eslint/types/dist/lib.js.map create mode 100644 node_modules/@typescript-eslint/types/dist/parser-options.d.ts create mode 100644 node_modules/@typescript-eslint/types/dist/parser-options.d.ts.map create mode 100644 node_modules/@typescript-eslint/types/dist/parser-options.js create mode 100644 node_modules/@typescript-eslint/types/dist/parser-options.js.map create mode 100644 node_modules/@typescript-eslint/types/dist/ts-estree.d.ts create mode 100644 node_modules/@typescript-eslint/types/dist/ts-estree.d.ts.map create mode 100644 node_modules/@typescript-eslint/types/dist/ts-estree.js create mode 100644 node_modules/@typescript-eslint/types/dist/ts-estree.js.map create mode 100644 node_modules/@typescript-eslint/types/package.json create mode 100644 node_modules/@typescript-eslint/typescript-estree/CHANGELOG.md create mode 100644 node_modules/@typescript-eslint/typescript-estree/LICENSE create mode 100644 node_modules/@typescript-eslint/typescript-estree/README.md create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.d.ts.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.js.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.d.ts.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/convert.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/convert.js.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.d.ts.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.js.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/createDefaultProgram.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/createDefaultProgram.d.ts.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/createDefaultProgram.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/createDefaultProgram.js.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.d.ts.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.d.ts.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.d.ts.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.js.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.d.ts.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.js.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.d.ts.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.js.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/index.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/index.d.ts.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/index.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/index.js.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/node-utils.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/node-utils.d.ts.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/parser-options.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/parser-options.d.ts.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/parser-options.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/parser-options.js.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/parser.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/parser.d.ts.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/parser.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/parser.js.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.d.ts.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.js.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.d.ts.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.js.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.d.ts.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.js.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.d.ts.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.js.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.js.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/version-check.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/version-check.d.ts.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/version-check.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/dist/version-check.js.map create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/globby/gitignore.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/globby/index.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/globby/index.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/globby/license create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/globby/package.json create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/globby/readme.md create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/globby/stream-utils.js rename node_modules/{ => @typescript-eslint/typescript-estree/node_modules}/tsutils/.editorconfig (100%) rename node_modules/{ => @typescript-eslint/typescript-estree/node_modules}/tsutils/.fimbullinter.yaml (100%) rename node_modules/{ => @typescript-eslint/typescript-estree/node_modules}/tsutils/.wotanrc.yaml (100%) create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/CHANGELOG.md rename node_modules/{ => @typescript-eslint/typescript-estree/node_modules}/tsutils/LICENSE (100%) create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/README.md rename node_modules/{ => @typescript-eslint/typescript-estree/node_modules}/tsutils/index.d.ts (100%) create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/index.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/package.json rename node_modules/{ => @typescript-eslint/typescript-estree/node_modules}/tsutils/typeguard/2.8/index.d.ts (100%) create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.8/index.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.8/node.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.8/node.js rename node_modules/{ => @typescript-eslint/typescript-estree/node_modules}/tsutils/typeguard/2.8/type.d.ts (100%) create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.8/type.js rename node_modules/{ => @typescript-eslint/typescript-estree/node_modules}/tsutils/typeguard/2.9/index.d.ts (100%) create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.9/index.js rename node_modules/{ => @typescript-eslint/typescript-estree/node_modules}/tsutils/typeguard/2.9/node.d.ts (100%) create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.9/node.js rename node_modules/{ => @typescript-eslint/typescript-estree/node_modules}/tsutils/typeguard/2.9/type.d.ts (100%) create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.9/type.js rename node_modules/{ => @typescript-eslint/typescript-estree/node_modules}/tsutils/typeguard/3.0/index.d.ts (100%) create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.0/index.js rename node_modules/{ => @typescript-eslint/typescript-estree/node_modules}/tsutils/typeguard/3.0/node.d.ts (100%) create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.0/node.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.0/type.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.0/type.js rename node_modules/{tsutils/typeguard => @typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.2}/index.d.ts (100%) create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.2/index.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.2/node.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.2/node.js rename node_modules/{tsutils/typeguard/next => @typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.2}/type.d.ts (100%) create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.2/type.js rename node_modules/{tsutils/typeguard/next => @typescript-eslint/typescript-estree/node_modules/tsutils/typeguard}/index.d.ts (100%) create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/index.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/next/index.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/next/index.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/next/node.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/next/node.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/next/type.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/next/type.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/node.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/node.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/type.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/type.js rename node_modules/{ => @typescript-eslint/typescript-estree/node_modules}/tsutils/util/control-flow.d.ts (79%) create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/control-flow.js rename node_modules/{ => @typescript-eslint/typescript-estree/node_modules}/tsutils/util/convert-ast.d.ts (95%) create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/convert-ast.js rename node_modules/{ => @typescript-eslint/typescript-estree/node_modules}/tsutils/util/index.d.ts (100%) create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/index.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/type.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/type.js rename node_modules/{ => @typescript-eslint/typescript-estree/node_modules}/tsutils/util/usage.d.ts (89%) create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/usage.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/util.d.ts create mode 100644 node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/util.js create mode 100644 node_modules/@typescript-eslint/typescript-estree/package.json create mode 100644 node_modules/@typescript-eslint/visitor-keys/CHANGELOG.md create mode 100644 node_modules/@typescript-eslint/visitor-keys/LICENSE create mode 100644 node_modules/@typescript-eslint/visitor-keys/README.md create mode 100644 node_modules/@typescript-eslint/visitor-keys/dist/get-keys.d.ts create mode 100644 node_modules/@typescript-eslint/visitor-keys/dist/get-keys.d.ts.map create mode 100644 node_modules/@typescript-eslint/visitor-keys/dist/get-keys.js create mode 100644 node_modules/@typescript-eslint/visitor-keys/dist/get-keys.js.map create mode 100644 node_modules/@typescript-eslint/visitor-keys/dist/index.d.ts create mode 100644 node_modules/@typescript-eslint/visitor-keys/dist/index.d.ts.map create mode 100644 node_modules/@typescript-eslint/visitor-keys/dist/index.js create mode 100644 node_modules/@typescript-eslint/visitor-keys/dist/index.js.map create mode 100644 node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.d.ts create mode 100644 node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.d.ts.map create mode 100644 node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.js create mode 100644 node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.js.map create mode 100644 node_modules/@typescript-eslint/visitor-keys/package.json create mode 100644 node_modules/acorn-jsx/LICENSE create mode 100644 node_modules/acorn-jsx/README.md create mode 100644 node_modules/acorn-jsx/index.js create mode 100644 node_modules/acorn-jsx/package.json create mode 100644 node_modules/acorn-jsx/xhtml.js create mode 100644 node_modules/ajv/.tonic_example.js create mode 100644 node_modules/ajv/LICENSE create mode 100644 node_modules/ajv/README.md create mode 100644 node_modules/ajv/dist/ajv.bundle.js create mode 100644 node_modules/ajv/dist/ajv.min.js create mode 100644 node_modules/ajv/dist/ajv.min.js.map create mode 100644 node_modules/ajv/lib/ajv.d.ts create mode 100644 node_modules/ajv/lib/ajv.js create mode 100644 node_modules/ajv/lib/cache.js create mode 100644 node_modules/ajv/lib/compile/async.js create mode 100644 node_modules/ajv/lib/compile/equal.js create mode 100644 node_modules/ajv/lib/compile/error_classes.js create mode 100644 node_modules/ajv/lib/compile/formats.js create mode 100644 node_modules/ajv/lib/compile/index.js create mode 100644 node_modules/ajv/lib/compile/resolve.js create mode 100644 node_modules/ajv/lib/compile/rules.js create mode 100644 node_modules/ajv/lib/compile/schema_obj.js create mode 100644 node_modules/ajv/lib/compile/ucs2length.js create mode 100644 node_modules/ajv/lib/compile/util.js create mode 100644 node_modules/ajv/lib/data.js create mode 100644 node_modules/ajv/lib/definition_schema.js create mode 100644 node_modules/ajv/lib/dot/_limit.jst create mode 100644 node_modules/ajv/lib/dot/_limitItems.jst create mode 100644 node_modules/ajv/lib/dot/_limitLength.jst create mode 100644 node_modules/ajv/lib/dot/_limitProperties.jst create mode 100644 node_modules/ajv/lib/dot/allOf.jst create mode 100644 node_modules/ajv/lib/dot/anyOf.jst create mode 100644 node_modules/ajv/lib/dot/coerce.def create mode 100644 node_modules/ajv/lib/dot/comment.jst create mode 100644 node_modules/ajv/lib/dot/const.jst create mode 100644 node_modules/ajv/lib/dot/contains.jst create mode 100644 node_modules/ajv/lib/dot/custom.jst create mode 100644 node_modules/ajv/lib/dot/defaults.def create mode 100644 node_modules/ajv/lib/dot/definitions.def create mode 100644 node_modules/ajv/lib/dot/dependencies.jst create mode 100644 node_modules/ajv/lib/dot/enum.jst create mode 100644 node_modules/ajv/lib/dot/errors.def create mode 100644 node_modules/ajv/lib/dot/format.jst create mode 100644 node_modules/ajv/lib/dot/if.jst create mode 100644 node_modules/ajv/lib/dot/items.jst create mode 100644 node_modules/ajv/lib/dot/missing.def create mode 100644 node_modules/ajv/lib/dot/multipleOf.jst create mode 100644 node_modules/ajv/lib/dot/not.jst create mode 100644 node_modules/ajv/lib/dot/oneOf.jst create mode 100644 node_modules/ajv/lib/dot/pattern.jst create mode 100644 node_modules/ajv/lib/dot/properties.jst create mode 100644 node_modules/ajv/lib/dot/propertyNames.jst create mode 100644 node_modules/ajv/lib/dot/ref.jst create mode 100644 node_modules/ajv/lib/dot/required.jst create mode 100644 node_modules/ajv/lib/dot/uniqueItems.jst create mode 100644 node_modules/ajv/lib/dot/validate.jst create mode 100644 node_modules/ajv/lib/dotjs/README.md create mode 100644 node_modules/ajv/lib/dotjs/_limit.js create mode 100644 node_modules/ajv/lib/dotjs/_limitItems.js create mode 100644 node_modules/ajv/lib/dotjs/_limitLength.js create mode 100644 node_modules/ajv/lib/dotjs/_limitProperties.js create mode 100644 node_modules/ajv/lib/dotjs/allOf.js create mode 100644 node_modules/ajv/lib/dotjs/anyOf.js create mode 100644 node_modules/ajv/lib/dotjs/comment.js create mode 100644 node_modules/ajv/lib/dotjs/const.js create mode 100644 node_modules/ajv/lib/dotjs/contains.js create mode 100644 node_modules/ajv/lib/dotjs/custom.js create mode 100644 node_modules/ajv/lib/dotjs/dependencies.js create mode 100644 node_modules/ajv/lib/dotjs/enum.js create mode 100644 node_modules/ajv/lib/dotjs/format.js create mode 100644 node_modules/ajv/lib/dotjs/if.js create mode 100644 node_modules/ajv/lib/dotjs/index.js create mode 100644 node_modules/ajv/lib/dotjs/items.js create mode 100644 node_modules/ajv/lib/dotjs/multipleOf.js create mode 100644 node_modules/ajv/lib/dotjs/not.js create mode 100644 node_modules/ajv/lib/dotjs/oneOf.js create mode 100644 node_modules/ajv/lib/dotjs/pattern.js create mode 100644 node_modules/ajv/lib/dotjs/properties.js create mode 100644 node_modules/ajv/lib/dotjs/propertyNames.js create mode 100644 node_modules/ajv/lib/dotjs/ref.js create mode 100644 node_modules/ajv/lib/dotjs/required.js create mode 100644 node_modules/ajv/lib/dotjs/uniqueItems.js create mode 100644 node_modules/ajv/lib/dotjs/validate.js create mode 100644 node_modules/ajv/lib/keyword.js create mode 100644 node_modules/ajv/lib/refs/data.json create mode 100644 node_modules/ajv/lib/refs/json-schema-draft-04.json create mode 100644 node_modules/ajv/lib/refs/json-schema-draft-06.json create mode 100644 node_modules/ajv/lib/refs/json-schema-draft-07.json create mode 100644 node_modules/ajv/lib/refs/json-schema-secure.json create mode 100644 node_modules/ajv/package.json create mode 100644 node_modules/ajv/scripts/.eslintrc.yml create mode 100644 node_modules/ajv/scripts/bundle.js create mode 100644 node_modules/ajv/scripts/compile-dots.js create mode 100755 node_modules/ajv/scripts/info create mode 100755 node_modules/ajv/scripts/prepare-tests create mode 100755 node_modules/ajv/scripts/publish-built-version create mode 100755 node_modules/ajv/scripts/travis-gh-pages create mode 100644 node_modules/ansi-colors/LICENSE create mode 100644 node_modules/ansi-colors/README.md create mode 100644 node_modules/ansi-colors/index.js create mode 100644 node_modules/ansi-colors/package.json create mode 100644 node_modules/ansi-colors/symbols.js create mode 100644 node_modules/ansi-colors/types/index.d.ts create mode 100644 node_modules/array-includes/.editorconfig create mode 100644 node_modules/array-includes/.eslintrc create mode 100644 node_modules/array-includes/.github/FUNDING.yml create mode 100644 node_modules/array-includes/.github/workflows/rebase.yml create mode 100644 node_modules/array-includes/.travis.yml create mode 100644 node_modules/array-includes/CHANGELOG.md create mode 100644 node_modules/array-includes/LICENSE create mode 100644 node_modules/array-includes/README.md create mode 100644 node_modules/array-includes/auto.js create mode 100644 node_modules/array-includes/implementation.js create mode 100644 node_modules/array-includes/index.js create mode 100644 node_modules/array-includes/package.json create mode 100644 node_modules/array-includes/polyfill.js create mode 100644 node_modules/array-includes/shim.js create mode 100644 node_modules/array-includes/test.html create mode 100644 node_modules/array-includes/test/index.js create mode 100644 node_modules/array-includes/test/shimmed.js create mode 100644 node_modules/array-includes/test/tests.js create mode 100644 node_modules/array.prototype.flat/.editorconfig create mode 100644 node_modules/array.prototype.flat/.eslintrc create mode 100644 node_modules/array.prototype.flat/.github/FUNDING.yml create mode 100644 node_modules/array.prototype.flat/.github/workflows/rebase.yml create mode 100644 node_modules/array.prototype.flat/.nycrc create mode 100644 node_modules/array.prototype.flat/.travis.yml create mode 100644 node_modules/array.prototype.flat/CHANGELOG.md create mode 100644 node_modules/array.prototype.flat/LICENSE create mode 100644 node_modules/array.prototype.flat/README.md create mode 100644 node_modules/array.prototype.flat/auto.js create mode 100644 node_modules/array.prototype.flat/implementation.js create mode 100644 node_modules/array.prototype.flat/index.js create mode 100644 node_modules/array.prototype.flat/package.json create mode 100644 node_modules/array.prototype.flat/polyfill.js create mode 100644 node_modules/array.prototype.flat/shim.js create mode 100644 node_modules/array.prototype.flat/test/index.js create mode 100644 node_modules/array.prototype.flat/test/shimmed.js create mode 100644 node_modules/array.prototype.flat/test/tests.js create mode 100644 node_modules/astral-regex/index.js create mode 100644 node_modules/astral-regex/license create mode 100644 node_modules/astral-regex/package.json create mode 100644 node_modules/astral-regex/readme.md delete mode 100644 node_modules/builtin-modules/builtin-modules.json delete mode 100644 node_modules/builtin-modules/index.js delete mode 100644 node_modules/builtin-modules/package.json delete mode 100644 node_modules/builtin-modules/readme.md delete mode 100644 node_modules/builtin-modules/static.js create mode 100644 node_modules/contains-path/LICENSE create mode 100644 node_modules/contains-path/README.md create mode 100644 node_modules/contains-path/index.js create mode 100644 node_modules/contains-path/package.json create mode 100644 node_modules/deep-is/.npmignore create mode 100644 node_modules/deep-is/.travis.yml create mode 100644 node_modules/deep-is/LICENSE create mode 100644 node_modules/deep-is/README.markdown create mode 100644 node_modules/deep-is/example/cmp.js create mode 100644 node_modules/deep-is/index.js create mode 100644 node_modules/deep-is/package.json create mode 100644 node_modules/deep-is/test/NaN.js create mode 100644 node_modules/deep-is/test/cmp.js create mode 100644 node_modules/deep-is/test/neg-vs-pos-0.js create mode 100644 node_modules/define-properties/.editorconfig create mode 100644 node_modules/define-properties/.eslintrc create mode 100644 node_modules/define-properties/.jscs.json create mode 100644 node_modules/define-properties/.travis.yml create mode 100644 node_modules/define-properties/CHANGELOG.md create mode 100644 node_modules/define-properties/LICENSE create mode 100644 node_modules/define-properties/README.md create mode 100644 node_modules/define-properties/index.js create mode 100644 node_modules/define-properties/package.json create mode 100644 node_modules/define-properties/test/index.js delete mode 100644 node_modules/doctrine/README.md delete mode 100644 node_modules/doctrine/lib/doctrine.js delete mode 100644 node_modules/doctrine/lib/typed.js delete mode 100644 node_modules/doctrine/lib/utility.js delete mode 100644 node_modules/doctrine/node_modules/esutils/README.md delete mode 100644 node_modules/doctrine/node_modules/esutils/lib/ast.js delete mode 100644 node_modules/doctrine/node_modules/esutils/lib/code.js delete mode 100644 node_modules/doctrine/node_modules/esutils/lib/keyword.js delete mode 100644 node_modules/doctrine/node_modules/esutils/lib/utils.js delete mode 100644 node_modules/doctrine/node_modules/esutils/package.json delete mode 100644 node_modules/doctrine/package.json create mode 100644 node_modules/enquirer/CHANGELOG.md create mode 100644 node_modules/enquirer/LICENSE create mode 100644 node_modules/enquirer/README.md create mode 100644 node_modules/enquirer/index.d.ts create mode 100644 node_modules/enquirer/index.js create mode 100644 node_modules/enquirer/lib/ansi.js create mode 100644 node_modules/enquirer/lib/combos.js create mode 100644 node_modules/enquirer/lib/completer.js create mode 100644 node_modules/enquirer/lib/interpolate.js create mode 100644 node_modules/enquirer/lib/keypress.js create mode 100644 node_modules/enquirer/lib/placeholder.js create mode 100644 node_modules/enquirer/lib/prompt.js create mode 100644 node_modules/enquirer/lib/prompts/autocomplete.js create mode 100644 node_modules/enquirer/lib/prompts/basicauth.js create mode 100644 node_modules/enquirer/lib/prompts/confirm.js create mode 100644 node_modules/enquirer/lib/prompts/editable.js create mode 100644 node_modules/enquirer/lib/prompts/form.js create mode 100644 node_modules/enquirer/lib/prompts/index.js create mode 100644 node_modules/enquirer/lib/prompts/input.js create mode 100644 node_modules/enquirer/lib/prompts/invisible.js create mode 100644 node_modules/enquirer/lib/prompts/list.js create mode 100644 node_modules/enquirer/lib/prompts/multiselect.js create mode 100644 node_modules/enquirer/lib/prompts/numeral.js create mode 100644 node_modules/enquirer/lib/prompts/password.js create mode 100644 node_modules/enquirer/lib/prompts/quiz.js create mode 100644 node_modules/enquirer/lib/prompts/scale.js create mode 100644 node_modules/enquirer/lib/prompts/select.js create mode 100644 node_modules/enquirer/lib/prompts/snippet.js create mode 100644 node_modules/enquirer/lib/prompts/sort.js create mode 100644 node_modules/enquirer/lib/prompts/survey.js create mode 100644 node_modules/enquirer/lib/prompts/text.js create mode 100644 node_modules/enquirer/lib/prompts/toggle.js create mode 100644 node_modules/enquirer/lib/render.js create mode 100644 node_modules/enquirer/lib/roles.js create mode 100644 node_modules/enquirer/lib/state.js create mode 100644 node_modules/enquirer/lib/styles.js create mode 100644 node_modules/enquirer/lib/symbols.js create mode 100644 node_modules/enquirer/lib/theme.js create mode 100644 node_modules/enquirer/lib/timer.js create mode 100644 node_modules/enquirer/lib/types/array.js create mode 100644 node_modules/enquirer/lib/types/auth.js create mode 100644 node_modules/enquirer/lib/types/boolean.js create mode 100644 node_modules/enquirer/lib/types/index.js create mode 100644 node_modules/enquirer/lib/types/number.js create mode 100644 node_modules/enquirer/lib/types/string.js create mode 100644 node_modules/enquirer/lib/utils.js create mode 100644 node_modules/enquirer/package.json create mode 100644 node_modules/es-abstract/.editorconfig create mode 100644 node_modules/es-abstract/.eslintignore create mode 100644 node_modules/es-abstract/.eslintrc create mode 100644 node_modules/es-abstract/.gitattributes create mode 100644 node_modules/es-abstract/.github/FUNDING.yml create mode 100644 node_modules/es-abstract/.github/workflows/codeql-analysis.yml create mode 100644 node_modules/es-abstract/.github/workflows/rebase.yml create mode 100644 node_modules/es-abstract/.nycrc create mode 100644 node_modules/es-abstract/.travis.yml create mode 100644 node_modules/es-abstract/2015/AbstractEqualityComparison.js create mode 100644 node_modules/es-abstract/2015/AbstractRelationalComparison.js create mode 100644 node_modules/es-abstract/2015/AdvanceStringIndex.js create mode 100644 node_modules/es-abstract/2015/ArrayCreate.js create mode 100644 node_modules/es-abstract/2015/ArraySetLength.js create mode 100644 node_modules/es-abstract/2015/ArraySpeciesCreate.js create mode 100644 node_modules/es-abstract/2015/Call.js create mode 100644 node_modules/es-abstract/2015/CanonicalNumericIndexString.js create mode 100644 node_modules/es-abstract/2015/CompletePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2015/CreateDataProperty.js create mode 100644 node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js create mode 100644 node_modules/es-abstract/2015/CreateHTML.js create mode 100644 node_modules/es-abstract/2015/CreateIterResultObject.js create mode 100644 node_modules/es-abstract/2015/CreateListFromArrayLike.js create mode 100644 node_modules/es-abstract/2015/CreateMethodProperty.js create mode 100644 node_modules/es-abstract/2015/DateFromTime.js create mode 100644 node_modules/es-abstract/2015/Day.js create mode 100644 node_modules/es-abstract/2015/DayFromYear.js create mode 100644 node_modules/es-abstract/2015/DayWithinYear.js create mode 100644 node_modules/es-abstract/2015/DaysInYear.js create mode 100644 node_modules/es-abstract/2015/DefinePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2015/DeletePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2015/EnumerableOwnNames.js create mode 100644 node_modules/es-abstract/2015/FromPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2015/Get.js create mode 100644 node_modules/es-abstract/2015/GetIterator.js create mode 100644 node_modules/es-abstract/2015/GetMethod.js create mode 100644 node_modules/es-abstract/2015/GetOwnPropertyKeys.js create mode 100644 node_modules/es-abstract/2015/GetPrototypeFromConstructor.js create mode 100644 node_modules/es-abstract/2015/GetSubstitution.js create mode 100644 node_modules/es-abstract/2015/GetV.js create mode 100644 node_modules/es-abstract/2015/HasOwnProperty.js create mode 100644 node_modules/es-abstract/2015/HasProperty.js create mode 100644 node_modules/es-abstract/2015/HourFromTime.js create mode 100644 node_modules/es-abstract/2015/InLeapYear.js create mode 100644 node_modules/es-abstract/2015/InstanceofOperator.js create mode 100644 node_modules/es-abstract/2015/Invoke.js create mode 100644 node_modules/es-abstract/2015/IsAccessorDescriptor.js create mode 100644 node_modules/es-abstract/2015/IsArray.js create mode 100644 node_modules/es-abstract/2015/IsCallable.js create mode 100644 node_modules/es-abstract/2015/IsConcatSpreadable.js create mode 100644 node_modules/es-abstract/2015/IsConstructor.js create mode 100644 node_modules/es-abstract/2015/IsDataDescriptor.js create mode 100644 node_modules/es-abstract/2015/IsExtensible.js create mode 100644 node_modules/es-abstract/2015/IsGenericDescriptor.js create mode 100644 node_modules/es-abstract/2015/IsInteger.js create mode 100644 node_modules/es-abstract/2015/IsPromise.js create mode 100644 node_modules/es-abstract/2015/IsPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2015/IsPropertyKey.js create mode 100644 node_modules/es-abstract/2015/IsRegExp.js create mode 100644 node_modules/es-abstract/2015/IteratorClose.js create mode 100644 node_modules/es-abstract/2015/IteratorComplete.js create mode 100644 node_modules/es-abstract/2015/IteratorNext.js create mode 100644 node_modules/es-abstract/2015/IteratorStep.js create mode 100644 node_modules/es-abstract/2015/IteratorValue.js create mode 100644 node_modules/es-abstract/2015/MakeDate.js create mode 100644 node_modules/es-abstract/2015/MakeDay.js create mode 100644 node_modules/es-abstract/2015/MakeTime.js create mode 100644 node_modules/es-abstract/2015/MinFromTime.js create mode 100644 node_modules/es-abstract/2015/MonthFromTime.js create mode 100644 node_modules/es-abstract/2015/ObjectCreate.js create mode 100644 node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js create mode 100644 node_modules/es-abstract/2015/OrdinaryHasInstance.js create mode 100644 node_modules/es-abstract/2015/OrdinaryHasProperty.js create mode 100644 node_modules/es-abstract/2015/RegExpExec.js create mode 100644 node_modules/es-abstract/2015/RequireObjectCoercible.js create mode 100644 node_modules/es-abstract/2015/SameValue.js create mode 100644 node_modules/es-abstract/2015/SameValueZero.js create mode 100644 node_modules/es-abstract/2015/SecFromTime.js create mode 100644 node_modules/es-abstract/2015/Set.js create mode 100644 node_modules/es-abstract/2015/SetFunctionName.js create mode 100644 node_modules/es-abstract/2015/SetIntegrityLevel.js create mode 100644 node_modules/es-abstract/2015/SpeciesConstructor.js create mode 100644 node_modules/es-abstract/2015/StrictEqualityComparison.js create mode 100644 node_modules/es-abstract/2015/SymbolDescriptiveString.js create mode 100644 node_modules/es-abstract/2015/TestIntegrityLevel.js create mode 100644 node_modules/es-abstract/2015/TimeClip.js create mode 100644 node_modules/es-abstract/2015/TimeFromYear.js create mode 100644 node_modules/es-abstract/2015/TimeWithinDay.js create mode 100644 node_modules/es-abstract/2015/ToBoolean.js create mode 100644 node_modules/es-abstract/2015/ToDateString.js create mode 100644 node_modules/es-abstract/2015/ToInt16.js create mode 100644 node_modules/es-abstract/2015/ToInt32.js create mode 100644 node_modules/es-abstract/2015/ToInt8.js create mode 100644 node_modules/es-abstract/2015/ToInteger.js create mode 100644 node_modules/es-abstract/2015/ToLength.js create mode 100644 node_modules/es-abstract/2015/ToNumber.js create mode 100644 node_modules/es-abstract/2015/ToObject.js create mode 100644 node_modules/es-abstract/2015/ToPrimitive.js create mode 100644 node_modules/es-abstract/2015/ToPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2015/ToPropertyKey.js create mode 100644 node_modules/es-abstract/2015/ToString.js create mode 100644 node_modules/es-abstract/2015/ToUint16.js create mode 100644 node_modules/es-abstract/2015/ToUint32.js create mode 100644 node_modules/es-abstract/2015/ToUint8.js create mode 100644 node_modules/es-abstract/2015/ToUint8Clamp.js create mode 100644 node_modules/es-abstract/2015/Type.js create mode 100644 node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2015/WeekDay.js create mode 100644 node_modules/es-abstract/2015/YearFromTime.js create mode 100644 node_modules/es-abstract/2015/modulo.js create mode 100644 node_modules/es-abstract/2015/msFromTime.js create mode 100644 node_modules/es-abstract/2015/thisBooleanValue.js create mode 100644 node_modules/es-abstract/2015/thisNumberValue.js create mode 100644 node_modules/es-abstract/2015/thisStringValue.js create mode 100644 node_modules/es-abstract/2015/thisTimeValue.js create mode 100644 node_modules/es-abstract/2016/AbstractEqualityComparison.js create mode 100644 node_modules/es-abstract/2016/AbstractRelationalComparison.js create mode 100644 node_modules/es-abstract/2016/AdvanceStringIndex.js create mode 100644 node_modules/es-abstract/2016/ArrayCreate.js create mode 100644 node_modules/es-abstract/2016/ArraySetLength.js create mode 100644 node_modules/es-abstract/2016/ArraySpeciesCreate.js create mode 100644 node_modules/es-abstract/2016/Call.js create mode 100644 node_modules/es-abstract/2016/CanonicalNumericIndexString.js create mode 100644 node_modules/es-abstract/2016/CompletePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2016/CreateDataProperty.js create mode 100644 node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js create mode 100644 node_modules/es-abstract/2016/CreateHTML.js create mode 100644 node_modules/es-abstract/2016/CreateIterResultObject.js create mode 100644 node_modules/es-abstract/2016/CreateListFromArrayLike.js create mode 100644 node_modules/es-abstract/2016/CreateMethodProperty.js create mode 100644 node_modules/es-abstract/2016/DateFromTime.js create mode 100644 node_modules/es-abstract/2016/Day.js create mode 100644 node_modules/es-abstract/2016/DayFromYear.js create mode 100644 node_modules/es-abstract/2016/DayWithinYear.js create mode 100644 node_modules/es-abstract/2016/DaysInYear.js create mode 100644 node_modules/es-abstract/2016/DefinePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2016/DeletePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2016/EnumerableOwnNames.js create mode 100644 node_modules/es-abstract/2016/FromPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2016/Get.js create mode 100644 node_modules/es-abstract/2016/GetIterator.js create mode 100644 node_modules/es-abstract/2016/GetMethod.js create mode 100644 node_modules/es-abstract/2016/GetOwnPropertyKeys.js create mode 100644 node_modules/es-abstract/2016/GetPrototypeFromConstructor.js create mode 100644 node_modules/es-abstract/2016/GetSubstitution.js create mode 100644 node_modules/es-abstract/2016/GetV.js create mode 100644 node_modules/es-abstract/2016/HasOwnProperty.js create mode 100644 node_modules/es-abstract/2016/HasProperty.js create mode 100644 node_modules/es-abstract/2016/HourFromTime.js create mode 100644 node_modules/es-abstract/2016/InLeapYear.js create mode 100644 node_modules/es-abstract/2016/InstanceofOperator.js create mode 100644 node_modules/es-abstract/2016/Invoke.js create mode 100644 node_modules/es-abstract/2016/IsAccessorDescriptor.js create mode 100644 node_modules/es-abstract/2016/IsArray.js create mode 100644 node_modules/es-abstract/2016/IsCallable.js create mode 100644 node_modules/es-abstract/2016/IsConcatSpreadable.js create mode 100644 node_modules/es-abstract/2016/IsConstructor.js create mode 100644 node_modules/es-abstract/2016/IsDataDescriptor.js create mode 100644 node_modules/es-abstract/2016/IsExtensible.js create mode 100644 node_modules/es-abstract/2016/IsGenericDescriptor.js create mode 100644 node_modules/es-abstract/2016/IsInteger.js create mode 100644 node_modules/es-abstract/2016/IsPromise.js create mode 100644 node_modules/es-abstract/2016/IsPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2016/IsPropertyKey.js create mode 100644 node_modules/es-abstract/2016/IsRegExp.js create mode 100644 node_modules/es-abstract/2016/IterableToArrayLike.js create mode 100644 node_modules/es-abstract/2016/IteratorClose.js create mode 100644 node_modules/es-abstract/2016/IteratorComplete.js create mode 100644 node_modules/es-abstract/2016/IteratorNext.js create mode 100644 node_modules/es-abstract/2016/IteratorStep.js create mode 100644 node_modules/es-abstract/2016/IteratorValue.js create mode 100644 node_modules/es-abstract/2016/MakeDate.js create mode 100644 node_modules/es-abstract/2016/MakeDay.js create mode 100644 node_modules/es-abstract/2016/MakeTime.js create mode 100644 node_modules/es-abstract/2016/MinFromTime.js create mode 100644 node_modules/es-abstract/2016/MonthFromTime.js create mode 100644 node_modules/es-abstract/2016/ObjectCreate.js create mode 100644 node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js create mode 100644 node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/es-abstract/2016/OrdinaryHasInstance.js create mode 100644 node_modules/es-abstract/2016/OrdinaryHasProperty.js create mode 100644 node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js create mode 100644 node_modules/es-abstract/2016/RegExpExec.js create mode 100644 node_modules/es-abstract/2016/RequireObjectCoercible.js create mode 100644 node_modules/es-abstract/2016/SameValue.js create mode 100644 node_modules/es-abstract/2016/SameValueNonNumber.js create mode 100644 node_modules/es-abstract/2016/SameValueZero.js create mode 100644 node_modules/es-abstract/2016/SecFromTime.js create mode 100644 node_modules/es-abstract/2016/Set.js create mode 100644 node_modules/es-abstract/2016/SetFunctionName.js create mode 100644 node_modules/es-abstract/2016/SetIntegrityLevel.js create mode 100644 node_modules/es-abstract/2016/SpeciesConstructor.js create mode 100644 node_modules/es-abstract/2016/StrictEqualityComparison.js create mode 100644 node_modules/es-abstract/2016/SymbolDescriptiveString.js create mode 100644 node_modules/es-abstract/2016/TestIntegrityLevel.js create mode 100644 node_modules/es-abstract/2016/TimeClip.js create mode 100644 node_modules/es-abstract/2016/TimeFromYear.js create mode 100644 node_modules/es-abstract/2016/TimeWithinDay.js create mode 100644 node_modules/es-abstract/2016/ToBoolean.js create mode 100644 node_modules/es-abstract/2016/ToDateString.js create mode 100644 node_modules/es-abstract/2016/ToInt16.js create mode 100644 node_modules/es-abstract/2016/ToInt32.js create mode 100644 node_modules/es-abstract/2016/ToInt8.js create mode 100644 node_modules/es-abstract/2016/ToInteger.js create mode 100644 node_modules/es-abstract/2016/ToLength.js create mode 100644 node_modules/es-abstract/2016/ToNumber.js create mode 100644 node_modules/es-abstract/2016/ToObject.js create mode 100644 node_modules/es-abstract/2016/ToPrimitive.js create mode 100644 node_modules/es-abstract/2016/ToPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2016/ToPropertyKey.js create mode 100644 node_modules/es-abstract/2016/ToString.js create mode 100644 node_modules/es-abstract/2016/ToUint16.js create mode 100644 node_modules/es-abstract/2016/ToUint32.js create mode 100644 node_modules/es-abstract/2016/ToUint8.js create mode 100644 node_modules/es-abstract/2016/ToUint8Clamp.js create mode 100644 node_modules/es-abstract/2016/Type.js create mode 100644 node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2016/WeekDay.js create mode 100644 node_modules/es-abstract/2016/YearFromTime.js create mode 100644 node_modules/es-abstract/2016/modulo.js create mode 100644 node_modules/es-abstract/2016/msFromTime.js create mode 100644 node_modules/es-abstract/2016/thisBooleanValue.js create mode 100644 node_modules/es-abstract/2016/thisNumberValue.js create mode 100644 node_modules/es-abstract/2016/thisStringValue.js create mode 100644 node_modules/es-abstract/2016/thisTimeValue.js create mode 100644 node_modules/es-abstract/2017/AbstractEqualityComparison.js create mode 100644 node_modules/es-abstract/2017/AbstractRelationalComparison.js create mode 100644 node_modules/es-abstract/2017/AdvanceStringIndex.js create mode 100644 node_modules/es-abstract/2017/ArrayCreate.js create mode 100644 node_modules/es-abstract/2017/ArraySetLength.js create mode 100644 node_modules/es-abstract/2017/ArraySpeciesCreate.js create mode 100644 node_modules/es-abstract/2017/Call.js create mode 100644 node_modules/es-abstract/2017/CanonicalNumericIndexString.js create mode 100644 node_modules/es-abstract/2017/CompletePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2017/CreateDataProperty.js create mode 100644 node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js create mode 100644 node_modules/es-abstract/2017/CreateHTML.js create mode 100644 node_modules/es-abstract/2017/CreateIterResultObject.js create mode 100644 node_modules/es-abstract/2017/CreateListFromArrayLike.js create mode 100644 node_modules/es-abstract/2017/CreateMethodProperty.js create mode 100644 node_modules/es-abstract/2017/DateFromTime.js create mode 100644 node_modules/es-abstract/2017/Day.js create mode 100644 node_modules/es-abstract/2017/DayFromYear.js create mode 100644 node_modules/es-abstract/2017/DayWithinYear.js create mode 100644 node_modules/es-abstract/2017/DaysInYear.js create mode 100644 node_modules/es-abstract/2017/DefinePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2017/DeletePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2017/EnumerableOwnProperties.js create mode 100644 node_modules/es-abstract/2017/FromPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2017/Get.js create mode 100644 node_modules/es-abstract/2017/GetIterator.js create mode 100644 node_modules/es-abstract/2017/GetMethod.js create mode 100644 node_modules/es-abstract/2017/GetOwnPropertyKeys.js create mode 100644 node_modules/es-abstract/2017/GetPrototypeFromConstructor.js create mode 100644 node_modules/es-abstract/2017/GetSubstitution.js create mode 100644 node_modules/es-abstract/2017/GetV.js create mode 100644 node_modules/es-abstract/2017/HasOwnProperty.js create mode 100644 node_modules/es-abstract/2017/HasProperty.js create mode 100644 node_modules/es-abstract/2017/HourFromTime.js create mode 100644 node_modules/es-abstract/2017/InLeapYear.js create mode 100644 node_modules/es-abstract/2017/InstanceofOperator.js create mode 100644 node_modules/es-abstract/2017/Invoke.js create mode 100644 node_modules/es-abstract/2017/IsAccessorDescriptor.js create mode 100644 node_modules/es-abstract/2017/IsArray.js create mode 100644 node_modules/es-abstract/2017/IsCallable.js create mode 100644 node_modules/es-abstract/2017/IsConcatSpreadable.js create mode 100644 node_modules/es-abstract/2017/IsConstructor.js create mode 100644 node_modules/es-abstract/2017/IsDataDescriptor.js create mode 100644 node_modules/es-abstract/2017/IsExtensible.js create mode 100644 node_modules/es-abstract/2017/IsGenericDescriptor.js create mode 100644 node_modules/es-abstract/2017/IsInteger.js create mode 100644 node_modules/es-abstract/2017/IsPromise.js create mode 100644 node_modules/es-abstract/2017/IsPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2017/IsPropertyKey.js create mode 100644 node_modules/es-abstract/2017/IsRegExp.js create mode 100644 node_modules/es-abstract/2017/IterableToList.js create mode 100644 node_modules/es-abstract/2017/IteratorClose.js create mode 100644 node_modules/es-abstract/2017/IteratorComplete.js create mode 100644 node_modules/es-abstract/2017/IteratorNext.js create mode 100644 node_modules/es-abstract/2017/IteratorStep.js create mode 100644 node_modules/es-abstract/2017/IteratorValue.js create mode 100644 node_modules/es-abstract/2017/MakeDate.js create mode 100644 node_modules/es-abstract/2017/MakeDay.js create mode 100644 node_modules/es-abstract/2017/MakeTime.js create mode 100644 node_modules/es-abstract/2017/MinFromTime.js create mode 100644 node_modules/es-abstract/2017/MonthFromTime.js create mode 100644 node_modules/es-abstract/2017/ObjectCreate.js create mode 100644 node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js create mode 100644 node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/es-abstract/2017/OrdinaryHasInstance.js create mode 100644 node_modules/es-abstract/2017/OrdinaryHasProperty.js create mode 100644 node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js create mode 100644 node_modules/es-abstract/2017/RegExpExec.js create mode 100644 node_modules/es-abstract/2017/RequireObjectCoercible.js create mode 100644 node_modules/es-abstract/2017/SameValue.js create mode 100644 node_modules/es-abstract/2017/SameValueNonNumber.js create mode 100644 node_modules/es-abstract/2017/SameValueZero.js create mode 100644 node_modules/es-abstract/2017/SecFromTime.js create mode 100644 node_modules/es-abstract/2017/Set.js create mode 100644 node_modules/es-abstract/2017/SetFunctionName.js create mode 100644 node_modules/es-abstract/2017/SetIntegrityLevel.js create mode 100644 node_modules/es-abstract/2017/SpeciesConstructor.js create mode 100644 node_modules/es-abstract/2017/StrictEqualityComparison.js create mode 100644 node_modules/es-abstract/2017/SymbolDescriptiveString.js create mode 100644 node_modules/es-abstract/2017/TestIntegrityLevel.js create mode 100644 node_modules/es-abstract/2017/TimeClip.js create mode 100644 node_modules/es-abstract/2017/TimeFromYear.js create mode 100644 node_modules/es-abstract/2017/TimeWithinDay.js create mode 100644 node_modules/es-abstract/2017/ToBoolean.js create mode 100644 node_modules/es-abstract/2017/ToDateString.js create mode 100644 node_modules/es-abstract/2017/ToIndex.js create mode 100644 node_modules/es-abstract/2017/ToInt16.js create mode 100644 node_modules/es-abstract/2017/ToInt32.js create mode 100644 node_modules/es-abstract/2017/ToInt8.js create mode 100644 node_modules/es-abstract/2017/ToInteger.js create mode 100644 node_modules/es-abstract/2017/ToLength.js create mode 100644 node_modules/es-abstract/2017/ToNumber.js create mode 100644 node_modules/es-abstract/2017/ToObject.js create mode 100644 node_modules/es-abstract/2017/ToPrimitive.js create mode 100644 node_modules/es-abstract/2017/ToPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2017/ToPropertyKey.js create mode 100644 node_modules/es-abstract/2017/ToString.js create mode 100644 node_modules/es-abstract/2017/ToUint16.js create mode 100644 node_modules/es-abstract/2017/ToUint32.js create mode 100644 node_modules/es-abstract/2017/ToUint8.js create mode 100644 node_modules/es-abstract/2017/ToUint8Clamp.js create mode 100644 node_modules/es-abstract/2017/Type.js create mode 100644 node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2017/WeekDay.js create mode 100644 node_modules/es-abstract/2017/YearFromTime.js create mode 100644 node_modules/es-abstract/2017/modulo.js create mode 100644 node_modules/es-abstract/2017/msFromTime.js create mode 100644 node_modules/es-abstract/2017/thisBooleanValue.js create mode 100644 node_modules/es-abstract/2017/thisNumberValue.js create mode 100644 node_modules/es-abstract/2017/thisStringValue.js create mode 100644 node_modules/es-abstract/2017/thisTimeValue.js create mode 100644 node_modules/es-abstract/2018/AbstractEqualityComparison.js create mode 100644 node_modules/es-abstract/2018/AbstractRelationalComparison.js create mode 100644 node_modules/es-abstract/2018/AdvanceStringIndex.js create mode 100644 node_modules/es-abstract/2018/ArrayCreate.js create mode 100644 node_modules/es-abstract/2018/ArraySetLength.js create mode 100644 node_modules/es-abstract/2018/ArraySpeciesCreate.js create mode 100644 node_modules/es-abstract/2018/Call.js create mode 100644 node_modules/es-abstract/2018/CanonicalNumericIndexString.js create mode 100644 node_modules/es-abstract/2018/CompletePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2018/CopyDataProperties.js create mode 100644 node_modules/es-abstract/2018/CreateDataProperty.js create mode 100644 node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js create mode 100644 node_modules/es-abstract/2018/CreateHTML.js create mode 100644 node_modules/es-abstract/2018/CreateIterResultObject.js create mode 100644 node_modules/es-abstract/2018/CreateListFromArrayLike.js create mode 100644 node_modules/es-abstract/2018/CreateMethodProperty.js create mode 100644 node_modules/es-abstract/2018/DateFromTime.js create mode 100644 node_modules/es-abstract/2018/DateString.js create mode 100644 node_modules/es-abstract/2018/Day.js create mode 100644 node_modules/es-abstract/2018/DayFromYear.js create mode 100644 node_modules/es-abstract/2018/DayWithinYear.js create mode 100644 node_modules/es-abstract/2018/DaysInYear.js create mode 100644 node_modules/es-abstract/2018/DefinePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2018/DeletePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js create mode 100644 node_modules/es-abstract/2018/FromPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2018/Get.js create mode 100644 node_modules/es-abstract/2018/GetIterator.js create mode 100644 node_modules/es-abstract/2018/GetMethod.js create mode 100644 node_modules/es-abstract/2018/GetOwnPropertyKeys.js create mode 100644 node_modules/es-abstract/2018/GetPrototypeFromConstructor.js create mode 100644 node_modules/es-abstract/2018/GetSubstitution.js create mode 100644 node_modules/es-abstract/2018/GetV.js create mode 100644 node_modules/es-abstract/2018/HasOwnProperty.js create mode 100644 node_modules/es-abstract/2018/HasProperty.js create mode 100644 node_modules/es-abstract/2018/HourFromTime.js create mode 100644 node_modules/es-abstract/2018/InLeapYear.js create mode 100644 node_modules/es-abstract/2018/InstanceofOperator.js create mode 100644 node_modules/es-abstract/2018/Invoke.js create mode 100644 node_modules/es-abstract/2018/IsAccessorDescriptor.js create mode 100644 node_modules/es-abstract/2018/IsArray.js create mode 100644 node_modules/es-abstract/2018/IsCallable.js create mode 100644 node_modules/es-abstract/2018/IsConcatSpreadable.js create mode 100644 node_modules/es-abstract/2018/IsConstructor.js create mode 100644 node_modules/es-abstract/2018/IsDataDescriptor.js create mode 100644 node_modules/es-abstract/2018/IsExtensible.js create mode 100644 node_modules/es-abstract/2018/IsGenericDescriptor.js create mode 100644 node_modules/es-abstract/2018/IsInteger.js create mode 100644 node_modules/es-abstract/2018/IsPromise.js create mode 100644 node_modules/es-abstract/2018/IsPropertyKey.js create mode 100644 node_modules/es-abstract/2018/IsRegExp.js create mode 100644 node_modules/es-abstract/2018/IsStringPrefix.js create mode 100644 node_modules/es-abstract/2018/IterableToList.js create mode 100644 node_modules/es-abstract/2018/IteratorClose.js create mode 100644 node_modules/es-abstract/2018/IteratorComplete.js create mode 100644 node_modules/es-abstract/2018/IteratorNext.js create mode 100644 node_modules/es-abstract/2018/IteratorStep.js create mode 100644 node_modules/es-abstract/2018/IteratorValue.js create mode 100644 node_modules/es-abstract/2018/MakeDate.js create mode 100644 node_modules/es-abstract/2018/MakeDay.js create mode 100644 node_modules/es-abstract/2018/MakeTime.js create mode 100644 node_modules/es-abstract/2018/MinFromTime.js create mode 100644 node_modules/es-abstract/2018/MonthFromTime.js create mode 100644 node_modules/es-abstract/2018/NumberToString.js create mode 100644 node_modules/es-abstract/2018/ObjectCreate.js create mode 100644 node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js create mode 100644 node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/es-abstract/2018/OrdinaryHasInstance.js create mode 100644 node_modules/es-abstract/2018/OrdinaryHasProperty.js create mode 100644 node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js create mode 100644 node_modules/es-abstract/2018/PromiseResolve.js create mode 100644 node_modules/es-abstract/2018/RegExpExec.js create mode 100644 node_modules/es-abstract/2018/RequireObjectCoercible.js create mode 100644 node_modules/es-abstract/2018/SameValue.js create mode 100644 node_modules/es-abstract/2018/SameValueNonNumber.js create mode 100644 node_modules/es-abstract/2018/SameValueZero.js create mode 100644 node_modules/es-abstract/2018/SecFromTime.js create mode 100644 node_modules/es-abstract/2018/Set.js create mode 100644 node_modules/es-abstract/2018/SetFunctionName.js create mode 100644 node_modules/es-abstract/2018/SetIntegrityLevel.js create mode 100644 node_modules/es-abstract/2018/SpeciesConstructor.js create mode 100644 node_modules/es-abstract/2018/StrictEqualityComparison.js create mode 100644 node_modules/es-abstract/2018/SymbolDescriptiveString.js create mode 100644 node_modules/es-abstract/2018/TestIntegrityLevel.js create mode 100644 node_modules/es-abstract/2018/TimeClip.js create mode 100644 node_modules/es-abstract/2018/TimeFromYear.js create mode 100644 node_modules/es-abstract/2018/TimeString.js create mode 100644 node_modules/es-abstract/2018/TimeWithinDay.js create mode 100644 node_modules/es-abstract/2018/ToBoolean.js create mode 100644 node_modules/es-abstract/2018/ToDateString.js create mode 100644 node_modules/es-abstract/2018/ToIndex.js create mode 100644 node_modules/es-abstract/2018/ToInt16.js create mode 100644 node_modules/es-abstract/2018/ToInt32.js create mode 100644 node_modules/es-abstract/2018/ToInt8.js create mode 100644 node_modules/es-abstract/2018/ToInteger.js create mode 100644 node_modules/es-abstract/2018/ToLength.js create mode 100644 node_modules/es-abstract/2018/ToNumber.js create mode 100644 node_modules/es-abstract/2018/ToObject.js create mode 100644 node_modules/es-abstract/2018/ToPrimitive.js create mode 100644 node_modules/es-abstract/2018/ToPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2018/ToPropertyKey.js create mode 100644 node_modules/es-abstract/2018/ToString.js create mode 100644 node_modules/es-abstract/2018/ToUint16.js create mode 100644 node_modules/es-abstract/2018/ToUint32.js create mode 100644 node_modules/es-abstract/2018/ToUint8.js create mode 100644 node_modules/es-abstract/2018/ToUint8Clamp.js create mode 100644 node_modules/es-abstract/2018/Type.js create mode 100644 node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2018/WeekDay.js create mode 100644 node_modules/es-abstract/2018/YearFromTime.js create mode 100644 node_modules/es-abstract/2018/modulo.js create mode 100644 node_modules/es-abstract/2018/msFromTime.js create mode 100644 node_modules/es-abstract/2018/thisBooleanValue.js create mode 100644 node_modules/es-abstract/2018/thisNumberValue.js create mode 100644 node_modules/es-abstract/2018/thisStringValue.js create mode 100644 node_modules/es-abstract/2018/thisSymbolValue.js create mode 100644 node_modules/es-abstract/2018/thisTimeValue.js create mode 100644 node_modules/es-abstract/2019/AbstractEqualityComparison.js create mode 100644 node_modules/es-abstract/2019/AbstractRelationalComparison.js create mode 100644 node_modules/es-abstract/2019/AddEntriesFromIterable.js create mode 100644 node_modules/es-abstract/2019/AdvanceStringIndex.js create mode 100644 node_modules/es-abstract/2019/ArrayCreate.js create mode 100644 node_modules/es-abstract/2019/ArraySetLength.js create mode 100644 node_modules/es-abstract/2019/ArraySpeciesCreate.js create mode 100644 node_modules/es-abstract/2019/Call.js create mode 100644 node_modules/es-abstract/2019/CanonicalNumericIndexString.js create mode 100644 node_modules/es-abstract/2019/CompletePropertyDescriptor.js create mode 100644 node_modules/es-abstract/2019/CopyDataProperties.js create mode 100644 node_modules/es-abstract/2019/CreateDataProperty.js create mode 100644 node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js create mode 100644 node_modules/es-abstract/2019/CreateHTML.js create mode 100644 node_modules/es-abstract/2019/CreateIterResultObject.js create mode 100644 node_modules/es-abstract/2019/CreateListFromArrayLike.js create mode 100644 node_modules/es-abstract/2019/CreateMethodProperty.js create mode 100644 node_modules/es-abstract/2019/DateFromTime.js create mode 100644 node_modules/es-abstract/2019/DateString.js create mode 100644 node_modules/es-abstract/2019/Day.js create mode 100644 node_modules/es-abstract/2019/DayFromYear.js create mode 100644 node_modules/es-abstract/2019/DayWithinYear.js create mode 100644 node_modules/es-abstract/2019/DaysInYear.js create mode 100644 node_modules/es-abstract/2019/DefinePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2019/DeletePropertyOrThrow.js create mode 100644 node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js create mode 100644 node_modules/es-abstract/2019/FlattenIntoArray.js create mode 100644 node_modules/es-abstract/2019/FromPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2019/Get.js create mode 100644 node_modules/es-abstract/2019/GetIterator.js create mode 100644 node_modules/es-abstract/2019/GetMethod.js create mode 100644 node_modules/es-abstract/2019/GetOwnPropertyKeys.js create mode 100644 node_modules/es-abstract/2019/GetPrototypeFromConstructor.js create mode 100644 node_modules/es-abstract/2019/GetSubstitution.js create mode 100644 node_modules/es-abstract/2019/GetV.js create mode 100644 node_modules/es-abstract/2019/HasOwnProperty.js create mode 100644 node_modules/es-abstract/2019/HasProperty.js create mode 100644 node_modules/es-abstract/2019/HourFromTime.js create mode 100644 node_modules/es-abstract/2019/InLeapYear.js create mode 100644 node_modules/es-abstract/2019/InstanceofOperator.js create mode 100644 node_modules/es-abstract/2019/Invoke.js create mode 100644 node_modules/es-abstract/2019/IsAccessorDescriptor.js create mode 100644 node_modules/es-abstract/2019/IsArray.js create mode 100644 node_modules/es-abstract/2019/IsCallable.js create mode 100644 node_modules/es-abstract/2019/IsConcatSpreadable.js create mode 100644 node_modules/es-abstract/2019/IsConstructor.js create mode 100644 node_modules/es-abstract/2019/IsDataDescriptor.js create mode 100644 node_modules/es-abstract/2019/IsExtensible.js create mode 100644 node_modules/es-abstract/2019/IsGenericDescriptor.js create mode 100644 node_modules/es-abstract/2019/IsInteger.js create mode 100644 node_modules/es-abstract/2019/IsPromise.js create mode 100644 node_modules/es-abstract/2019/IsPropertyKey.js create mode 100644 node_modules/es-abstract/2019/IsRegExp.js create mode 100644 node_modules/es-abstract/2019/IsStringPrefix.js create mode 100644 node_modules/es-abstract/2019/IterableToList.js create mode 100644 node_modules/es-abstract/2019/IteratorClose.js create mode 100644 node_modules/es-abstract/2019/IteratorComplete.js create mode 100644 node_modules/es-abstract/2019/IteratorNext.js create mode 100644 node_modules/es-abstract/2019/IteratorStep.js create mode 100644 node_modules/es-abstract/2019/IteratorValue.js create mode 100644 node_modules/es-abstract/2019/MakeDate.js create mode 100644 node_modules/es-abstract/2019/MakeDay.js create mode 100644 node_modules/es-abstract/2019/MakeTime.js create mode 100644 node_modules/es-abstract/2019/MinFromTime.js create mode 100644 node_modules/es-abstract/2019/MonthFromTime.js create mode 100644 node_modules/es-abstract/2019/NumberToString.js create mode 100644 node_modules/es-abstract/2019/ObjectCreate.js create mode 100644 node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js create mode 100644 node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/es-abstract/2019/OrdinaryHasInstance.js create mode 100644 node_modules/es-abstract/2019/OrdinaryHasProperty.js create mode 100644 node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js create mode 100644 node_modules/es-abstract/2019/PromiseResolve.js create mode 100644 node_modules/es-abstract/2019/RegExpExec.js create mode 100644 node_modules/es-abstract/2019/RequireObjectCoercible.js create mode 100644 node_modules/es-abstract/2019/SameValue.js create mode 100644 node_modules/es-abstract/2019/SameValueNonNumber.js create mode 100644 node_modules/es-abstract/2019/SameValueZero.js create mode 100644 node_modules/es-abstract/2019/SecFromTime.js create mode 100644 node_modules/es-abstract/2019/Set.js create mode 100644 node_modules/es-abstract/2019/SetFunctionName.js create mode 100644 node_modules/es-abstract/2019/SetIntegrityLevel.js create mode 100644 node_modules/es-abstract/2019/SpeciesConstructor.js create mode 100644 node_modules/es-abstract/2019/StrictEqualityComparison.js create mode 100644 node_modules/es-abstract/2019/SymbolDescriptiveString.js create mode 100644 node_modules/es-abstract/2019/TestIntegrityLevel.js create mode 100644 node_modules/es-abstract/2019/TimeClip.js create mode 100644 node_modules/es-abstract/2019/TimeFromYear.js create mode 100644 node_modules/es-abstract/2019/TimeString.js create mode 100644 node_modules/es-abstract/2019/TimeWithinDay.js create mode 100644 node_modules/es-abstract/2019/ToBoolean.js create mode 100644 node_modules/es-abstract/2019/ToDateString.js create mode 100644 node_modules/es-abstract/2019/ToIndex.js create mode 100644 node_modules/es-abstract/2019/ToInt16.js create mode 100644 node_modules/es-abstract/2019/ToInt32.js create mode 100644 node_modules/es-abstract/2019/ToInt8.js create mode 100644 node_modules/es-abstract/2019/ToInteger.js create mode 100644 node_modules/es-abstract/2019/ToLength.js create mode 100644 node_modules/es-abstract/2019/ToNumber.js create mode 100644 node_modules/es-abstract/2019/ToObject.js create mode 100644 node_modules/es-abstract/2019/ToPrimitive.js create mode 100644 node_modules/es-abstract/2019/ToPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2019/ToPropertyKey.js create mode 100644 node_modules/es-abstract/2019/ToString.js create mode 100644 node_modules/es-abstract/2019/ToUint16.js create mode 100644 node_modules/es-abstract/2019/ToUint32.js create mode 100644 node_modules/es-abstract/2019/ToUint8.js create mode 100644 node_modules/es-abstract/2019/ToUint8Clamp.js create mode 100644 node_modules/es-abstract/2019/TrimString.js create mode 100644 node_modules/es-abstract/2019/Type.js create mode 100644 node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/es-abstract/2019/WeekDay.js create mode 100644 node_modules/es-abstract/2019/YearFromTime.js create mode 100644 node_modules/es-abstract/2019/modulo.js create mode 100644 node_modules/es-abstract/2019/msFromTime.js create mode 100644 node_modules/es-abstract/2019/thisBooleanValue.js create mode 100644 node_modules/es-abstract/2019/thisNumberValue.js create mode 100644 node_modules/es-abstract/2019/thisStringValue.js create mode 100644 node_modules/es-abstract/2019/thisSymbolValue.js create mode 100644 node_modules/es-abstract/2019/thisTimeValue.js create mode 100644 node_modules/es-abstract/5/AbstractEqualityComparison.js create mode 100644 node_modules/es-abstract/5/AbstractRelationalComparison.js create mode 100644 node_modules/es-abstract/5/CheckObjectCoercible.js create mode 100644 node_modules/es-abstract/5/DateFromTime.js create mode 100644 node_modules/es-abstract/5/Day.js create mode 100644 node_modules/es-abstract/5/DayFromYear.js create mode 100644 node_modules/es-abstract/5/DayWithinYear.js create mode 100644 node_modules/es-abstract/5/DaysInYear.js create mode 100644 node_modules/es-abstract/5/FromPropertyDescriptor.js create mode 100644 node_modules/es-abstract/5/HourFromTime.js create mode 100644 node_modules/es-abstract/5/InLeapYear.js create mode 100644 node_modules/es-abstract/5/IsAccessorDescriptor.js create mode 100644 node_modules/es-abstract/5/IsCallable.js create mode 100644 node_modules/es-abstract/5/IsDataDescriptor.js create mode 100644 node_modules/es-abstract/5/IsGenericDescriptor.js create mode 100644 node_modules/es-abstract/5/IsPropertyDescriptor.js create mode 100644 node_modules/es-abstract/5/MakeDate.js create mode 100644 node_modules/es-abstract/5/MakeDay.js create mode 100644 node_modules/es-abstract/5/MakeTime.js create mode 100644 node_modules/es-abstract/5/MinFromTime.js create mode 100644 node_modules/es-abstract/5/MonthFromTime.js create mode 100644 node_modules/es-abstract/5/SameValue.js create mode 100644 node_modules/es-abstract/5/SecFromTime.js create mode 100644 node_modules/es-abstract/5/StrictEqualityComparison.js create mode 100644 node_modules/es-abstract/5/TimeClip.js create mode 100644 node_modules/es-abstract/5/TimeFromYear.js create mode 100644 node_modules/es-abstract/5/TimeWithinDay.js create mode 100644 node_modules/es-abstract/5/ToBoolean.js create mode 100644 node_modules/es-abstract/5/ToInt32.js create mode 100644 node_modules/es-abstract/5/ToInteger.js create mode 100644 node_modules/es-abstract/5/ToNumber.js create mode 100644 node_modules/es-abstract/5/ToObject.js create mode 100644 node_modules/es-abstract/5/ToPrimitive.js create mode 100644 node_modules/es-abstract/5/ToPropertyDescriptor.js create mode 100644 node_modules/es-abstract/5/ToString.js create mode 100644 node_modules/es-abstract/5/ToUint16.js create mode 100644 node_modules/es-abstract/5/ToUint32.js create mode 100644 node_modules/es-abstract/5/Type.js create mode 100644 node_modules/es-abstract/5/WeekDay.js create mode 100644 node_modules/es-abstract/5/YearFromTime.js create mode 100644 node_modules/es-abstract/5/modulo.js create mode 100644 node_modules/es-abstract/5/msFromTime.js create mode 100644 node_modules/es-abstract/CHANGELOG.md create mode 100644 node_modules/es-abstract/GetIntrinsic.js create mode 100644 node_modules/es-abstract/LICENSE create mode 100644 node_modules/es-abstract/README.md create mode 100644 node_modules/es-abstract/es2015.js create mode 100644 node_modules/es-abstract/es2016.js create mode 100644 node_modules/es-abstract/es2017.js create mode 100644 node_modules/es-abstract/es2018.js create mode 100644 node_modules/es-abstract/es2019.js create mode 100644 node_modules/es-abstract/es5.js create mode 100644 node_modules/es-abstract/es6.js create mode 100644 node_modules/es-abstract/es7.js create mode 100644 node_modules/es-abstract/helpers/DefineOwnProperty.js create mode 100644 node_modules/es-abstract/helpers/OwnPropertyKeys.js create mode 100644 node_modules/es-abstract/helpers/assertRecord.js create mode 100644 node_modules/es-abstract/helpers/assign.js create mode 100644 node_modules/es-abstract/helpers/callBind.js create mode 100644 node_modules/es-abstract/helpers/callBound.js create mode 100644 node_modules/es-abstract/helpers/every.js create mode 100644 node_modules/es-abstract/helpers/forEach.js create mode 100644 node_modules/es-abstract/helpers/getInferredName.js create mode 100644 node_modules/es-abstract/helpers/getIteratorMethod.js create mode 100644 node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js create mode 100644 node_modules/es-abstract/helpers/getProto.js create mode 100644 node_modules/es-abstract/helpers/getSymbolDescription.js create mode 100644 node_modules/es-abstract/helpers/isFinite.js create mode 100644 node_modules/es-abstract/helpers/isNaN.js create mode 100644 node_modules/es-abstract/helpers/isPrefixOf.js create mode 100644 node_modules/es-abstract/helpers/isPrimitive.js create mode 100644 node_modules/es-abstract/helpers/isPropertyDescriptor.js create mode 100644 node_modules/es-abstract/helpers/isSamePropertyDescriptor.js create mode 100644 node_modules/es-abstract/helpers/maxSafeInteger.js create mode 100644 node_modules/es-abstract/helpers/mod.js create mode 100644 node_modules/es-abstract/helpers/padTimeComponent.js create mode 100644 node_modules/es-abstract/helpers/regexTester.js create mode 100644 node_modules/es-abstract/helpers/setProto.js create mode 100644 node_modules/es-abstract/helpers/sign.js create mode 100644 node_modules/es-abstract/helpers/timeConstants.js create mode 100644 node_modules/es-abstract/index.js create mode 100644 node_modules/es-abstract/operations/.eslintrc create mode 100644 node_modules/es-abstract/operations/2015.js create mode 100644 node_modules/es-abstract/operations/2016.js create mode 100644 node_modules/es-abstract/operations/2017.js create mode 100644 node_modules/es-abstract/operations/2018.js create mode 100644 node_modules/es-abstract/operations/2019.js create mode 100644 node_modules/es-abstract/package.json create mode 100644 node_modules/es-abstract/test/GetIntrinsic.js create mode 100644 node_modules/es-abstract/test/diffOps.js create mode 100644 node_modules/es-abstract/test/es2015.js create mode 100644 node_modules/es-abstract/test/es2016.js create mode 100644 node_modules/es-abstract/test/es2017.js create mode 100644 node_modules/es-abstract/test/es2018.js create mode 100644 node_modules/es-abstract/test/es2019.js create mode 100644 node_modules/es-abstract/test/es5.js create mode 100644 node_modules/es-abstract/test/es6.js create mode 100644 node_modules/es-abstract/test/es7.js create mode 100644 node_modules/es-abstract/test/helpers/OwnPropertyKeys.js create mode 100644 node_modules/es-abstract/test/helpers/assertRecord.js create mode 100644 node_modules/es-abstract/test/helpers/createBoundESNamespace.js create mode 100644 node_modules/es-abstract/test/helpers/defineProperty.js create mode 100644 node_modules/es-abstract/test/helpers/getSymbolDescription.js create mode 100644 node_modules/es-abstract/test/helpers/runManifestTest.js create mode 100644 node_modules/es-abstract/test/helpers/values.js create mode 100644 node_modules/es-abstract/test/index.js create mode 100644 node_modules/es-abstract/test/tests.js create mode 100644 node_modules/es-to-primitive/.eslintrc create mode 100644 node_modules/es-to-primitive/.github/FUNDING.yml create mode 100644 node_modules/es-to-primitive/.travis.yml create mode 100644 node_modules/es-to-primitive/CHANGELOG.md create mode 100644 node_modules/es-to-primitive/LICENSE create mode 100644 node_modules/es-to-primitive/Makefile create mode 100644 node_modules/es-to-primitive/README.md create mode 100644 node_modules/es-to-primitive/es2015.js create mode 100644 node_modules/es-to-primitive/es5.js create mode 100644 node_modules/es-to-primitive/es6.js create mode 100644 node_modules/es-to-primitive/helpers/isPrimitive.js create mode 100644 node_modules/es-to-primitive/index.js create mode 100644 node_modules/es-to-primitive/package.json create mode 100644 node_modules/es-to-primitive/test/es2015.js create mode 100644 node_modules/es-to-primitive/test/es5.js create mode 100644 node_modules/es-to-primitive/test/es6.js create mode 100644 node_modules/es-to-primitive/test/index.js create mode 100644 node_modules/eslint-config-prettier/@typescript-eslint.js create mode 100644 node_modules/eslint-config-prettier/CHANGELOG.md create mode 100644 node_modules/eslint-config-prettier/LICENSE create mode 100644 node_modules/eslint-config-prettier/README.md create mode 100644 node_modules/eslint-config-prettier/babel.js create mode 100755 node_modules/eslint-config-prettier/bin/cli.js create mode 100644 node_modules/eslint-config-prettier/bin/validators.js create mode 100644 node_modules/eslint-config-prettier/flowtype.js create mode 100644 node_modules/eslint-config-prettier/index.js create mode 100644 node_modules/eslint-config-prettier/package.json create mode 100644 node_modules/eslint-config-prettier/react.js create mode 100644 node_modules/eslint-config-prettier/standard.js create mode 100644 node_modules/eslint-config-prettier/unicorn.js create mode 100644 node_modules/eslint-config-prettier/vue.js create mode 100644 node_modules/eslint-import-resolver-node/CHANGELOG.md create mode 100644 node_modules/eslint-import-resolver-node/LICENSE create mode 100644 node_modules/eslint-import-resolver-node/README.md create mode 100644 node_modules/eslint-import-resolver-node/index.js create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/.coveralls.yml create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/.eslintrc create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/.npmignore create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/.travis.yml create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/CHANGELOG.md create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/LICENSE create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/Makefile create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/README.md create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/component.json create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/karma.conf.js create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/node.js create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/package.json create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/src/browser.js create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/src/debug.js create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/src/index.js create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/src/inspector-log.js create mode 100644 node_modules/eslint-import-resolver-node/node_modules/debug/src/node.js create mode 100644 node_modules/eslint-import-resolver-node/node_modules/ms/index.js create mode 100644 node_modules/eslint-import-resolver-node/node_modules/ms/license.md create mode 100644 node_modules/eslint-import-resolver-node/node_modules/ms/package.json create mode 100644 node_modules/eslint-import-resolver-node/node_modules/ms/readme.md create mode 100644 node_modules/eslint-import-resolver-node/package.json create mode 100644 node_modules/eslint-module-utils/.eslintrc.yml create mode 100644 node_modules/eslint-module-utils/CHANGELOG.md create mode 100644 node_modules/eslint-module-utils/LICENSE create mode 100644 node_modules/eslint-module-utils/ModuleCache.js create mode 100644 node_modules/eslint-module-utils/declaredScope.js create mode 100644 node_modules/eslint-module-utils/hash.js create mode 100644 node_modules/eslint-module-utils/ignore.js create mode 100644 node_modules/eslint-module-utils/module-require.js create mode 100644 node_modules/eslint-module-utils/moduleVisitor.js create mode 100644 node_modules/eslint-module-utils/node_modules/debug/.coveralls.yml create mode 100644 node_modules/eslint-module-utils/node_modules/debug/.eslintrc create mode 100644 node_modules/eslint-module-utils/node_modules/debug/.npmignore create mode 100644 node_modules/eslint-module-utils/node_modules/debug/.travis.yml create mode 100644 node_modules/eslint-module-utils/node_modules/debug/CHANGELOG.md create mode 100644 node_modules/eslint-module-utils/node_modules/debug/LICENSE create mode 100644 node_modules/eslint-module-utils/node_modules/debug/Makefile create mode 100644 node_modules/eslint-module-utils/node_modules/debug/README.md create mode 100644 node_modules/eslint-module-utils/node_modules/debug/component.json create mode 100644 node_modules/eslint-module-utils/node_modules/debug/karma.conf.js create mode 100644 node_modules/eslint-module-utils/node_modules/debug/node.js create mode 100644 node_modules/eslint-module-utils/node_modules/debug/package.json create mode 100644 node_modules/eslint-module-utils/node_modules/debug/src/browser.js create mode 100644 node_modules/eslint-module-utils/node_modules/debug/src/debug.js create mode 100644 node_modules/eslint-module-utils/node_modules/debug/src/index.js create mode 100644 node_modules/eslint-module-utils/node_modules/debug/src/inspector-log.js create mode 100644 node_modules/eslint-module-utils/node_modules/debug/src/node.js create mode 100644 node_modules/eslint-module-utils/node_modules/find-up/index.js rename node_modules/{builtin-modules => eslint-module-utils/node_modules/find-up}/license (100%) create mode 100644 node_modules/eslint-module-utils/node_modules/find-up/package.json create mode 100644 node_modules/eslint-module-utils/node_modules/find-up/readme.md create mode 100644 node_modules/eslint-module-utils/node_modules/locate-path/index.js create mode 100644 node_modules/eslint-module-utils/node_modules/locate-path/license create mode 100644 node_modules/eslint-module-utils/node_modules/locate-path/package.json create mode 100644 node_modules/eslint-module-utils/node_modules/locate-path/readme.md create mode 100644 node_modules/eslint-module-utils/node_modules/ms/index.js create mode 100644 node_modules/eslint-module-utils/node_modules/ms/license.md create mode 100644 node_modules/eslint-module-utils/node_modules/ms/package.json create mode 100644 node_modules/eslint-module-utils/node_modules/ms/readme.md create mode 100644 node_modules/eslint-module-utils/node_modules/p-limit/index.js create mode 100644 node_modules/eslint-module-utils/node_modules/p-limit/license create mode 100644 node_modules/eslint-module-utils/node_modules/p-limit/package.json create mode 100644 node_modules/eslint-module-utils/node_modules/p-limit/readme.md create mode 100644 node_modules/eslint-module-utils/node_modules/p-locate/index.js create mode 100644 node_modules/eslint-module-utils/node_modules/p-locate/license create mode 100644 node_modules/eslint-module-utils/node_modules/p-locate/package.json create mode 100644 node_modules/eslint-module-utils/node_modules/p-locate/readme.md create mode 100644 node_modules/eslint-module-utils/node_modules/p-try/index.js create mode 100644 node_modules/eslint-module-utils/node_modules/p-try/license create mode 100644 node_modules/eslint-module-utils/node_modules/p-try/package.json create mode 100644 node_modules/eslint-module-utils/node_modules/p-try/readme.md create mode 100644 node_modules/eslint-module-utils/node_modules/path-exists/index.js create mode 100644 node_modules/eslint-module-utils/node_modules/path-exists/license create mode 100644 node_modules/eslint-module-utils/node_modules/path-exists/package.json create mode 100644 node_modules/eslint-module-utils/node_modules/path-exists/readme.md create mode 100644 node_modules/eslint-module-utils/node_modules/pkg-dir/index.js create mode 100644 node_modules/eslint-module-utils/node_modules/pkg-dir/license create mode 100644 node_modules/eslint-module-utils/node_modules/pkg-dir/package.json create mode 100644 node_modules/eslint-module-utils/node_modules/pkg-dir/readme.md create mode 100644 node_modules/eslint-module-utils/package.json create mode 100644 node_modules/eslint-module-utils/parse.js create mode 100644 node_modules/eslint-module-utils/resolve.js create mode 100644 node_modules/eslint-module-utils/unambiguous.js create mode 100644 node_modules/eslint-plugin-eslint-comments/LICENSE create mode 100644 node_modules/eslint-plugin-eslint-comments/README.md create mode 100644 node_modules/eslint-plugin-eslint-comments/index.js create mode 100644 node_modules/eslint-plugin-eslint-comments/lib/configs.js create mode 100644 node_modules/eslint-plugin-eslint-comments/lib/configs/recommended.js create mode 100644 node_modules/eslint-plugin-eslint-comments/lib/internal/disabled-area.js create mode 100644 node_modules/eslint-plugin-eslint-comments/lib/internal/get-linters.js create mode 100644 node_modules/eslint-plugin-eslint-comments/lib/internal/utils.js create mode 100644 node_modules/eslint-plugin-eslint-comments/lib/rules.js create mode 100644 node_modules/eslint-plugin-eslint-comments/lib/rules/disable-enable-pair.js create mode 100644 node_modules/eslint-plugin-eslint-comments/lib/rules/no-aggregating-enable.js create mode 100644 node_modules/eslint-plugin-eslint-comments/lib/rules/no-duplicate-disable.js create mode 100644 node_modules/eslint-plugin-eslint-comments/lib/rules/no-restricted-disable.js create mode 100644 node_modules/eslint-plugin-eslint-comments/lib/rules/no-unlimited-disable.js create mode 100644 node_modules/eslint-plugin-eslint-comments/lib/rules/no-unused-disable.js create mode 100644 node_modules/eslint-plugin-eslint-comments/lib/rules/no-unused-enable.js create mode 100644 node_modules/eslint-plugin-eslint-comments/lib/rules/no-use.js create mode 100644 node_modules/eslint-plugin-eslint-comments/lib/rules/require-description.js create mode 100644 node_modules/eslint-plugin-eslint-comments/lib/utils.js create mode 100644 node_modules/eslint-plugin-eslint-comments/lib/utils/patch.js create mode 100644 node_modules/eslint-plugin-eslint-comments/package.json create mode 100644 node_modules/eslint-plugin-filenames/.eslintignore create mode 100644 node_modules/eslint-plugin-filenames/.eslintrc create mode 100644 node_modules/eslint-plugin-filenames/README.md create mode 100644 node_modules/eslint-plugin-filenames/index.js create mode 100644 node_modules/eslint-plugin-filenames/lib/common/getExportedName.js create mode 100644 node_modules/eslint-plugin-filenames/lib/common/isIgnoredFilename.js create mode 100644 node_modules/eslint-plugin-filenames/lib/common/isIndexFile.js create mode 100644 node_modules/eslint-plugin-filenames/lib/common/parseFilename.js create mode 100644 node_modules/eslint-plugin-filenames/lib/rules/match-exported.js create mode 100644 node_modules/eslint-plugin-filenames/lib/rules/match-regex.js create mode 100644 node_modules/eslint-plugin-filenames/lib/rules/no-index.js create mode 100644 node_modules/eslint-plugin-filenames/package.json create mode 100644 node_modules/eslint-plugin-github/LICENSE create mode 100644 node_modules/eslint-plugin-github/README.md create mode 100755 node_modules/eslint-plugin-github/bin/eslint-ignore-errors.js create mode 100644 node_modules/eslint-plugin-github/lib/configs/browser.js create mode 100644 node_modules/eslint-plugin-github/lib/configs/internal.js create mode 100644 node_modules/eslint-plugin-github/lib/configs/recommended.js create mode 100644 node_modules/eslint-plugin-github/lib/configs/typescript.js create mode 100644 node_modules/eslint-plugin-github/lib/formatters/stylish-fixes.js create mode 100644 node_modules/eslint-plugin-github/lib/index.js create mode 100644 node_modules/eslint-plugin-github/lib/rules/array-foreach.js create mode 100644 node_modules/eslint-plugin-github/lib/rules/async-currenttarget.js create mode 100644 node_modules/eslint-plugin-github/lib/rules/async-preventdefault.js create mode 100644 node_modules/eslint-plugin-github/lib/rules/authenticity-token.js create mode 100644 node_modules/eslint-plugin-github/lib/rules/get-attribute.js create mode 100644 node_modules/eslint-plugin-github/lib/rules/js-class-name.js create mode 100644 node_modules/eslint-plugin-github/lib/rules/no-blur.js create mode 100644 node_modules/eslint-plugin-github/lib/rules/no-d-none.js create mode 100644 node_modules/eslint-plugin-github/lib/rules/no-dataset.js create mode 100644 node_modules/eslint-plugin-github/lib/rules/no-implicit-buggy-globals.js create mode 100644 node_modules/eslint-plugin-github/lib/rules/no-innerText.js create mode 100644 node_modules/eslint-plugin-github/lib/rules/no-then.js create mode 100644 node_modules/eslint-plugin-github/lib/rules/no-useless-passive.js create mode 100644 node_modules/eslint-plugin-github/lib/rules/prefer-observers.js create mode 100644 node_modules/eslint-plugin-github/lib/rules/require-passive-events.js create mode 100644 node_modules/eslint-plugin-github/lib/rules/unescaped-html-literal.js create mode 100644 node_modules/eslint-plugin-github/package.json create mode 100644 node_modules/eslint-plugin-import/CHANGELOG.md create mode 100644 node_modules/eslint-plugin-import/CONTRIBUTING.md create mode 100644 node_modules/eslint-plugin-import/LICENSE create mode 100644 node_modules/eslint-plugin-import/README.md create mode 100644 node_modules/eslint-plugin-import/RELEASE.md create mode 100644 node_modules/eslint-plugin-import/SECURITY.md create mode 100644 node_modules/eslint-plugin-import/config/electron.js create mode 100644 node_modules/eslint-plugin-import/config/errors.js create mode 100644 node_modules/eslint-plugin-import/config/react-native.js create mode 100644 node_modules/eslint-plugin-import/config/react.js create mode 100644 node_modules/eslint-plugin-import/config/recommended.js create mode 100644 node_modules/eslint-plugin-import/config/stage-0.js create mode 100644 node_modules/eslint-plugin-import/config/typescript.js create mode 100644 node_modules/eslint-plugin-import/config/warnings.js create mode 100644 node_modules/eslint-plugin-import/docs/rules/default.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/dynamic-import-chunkname.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/export.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/exports-last.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/extensions.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/first.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/group-exports.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/imports-first.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/max-dependencies.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/named.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/namespace.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/newline-after-import.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-absolute-path.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-amd.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-anonymous-default-export.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-commonjs.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-cycle.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-default-export.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-deprecated.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-duplicates.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-dynamic-require.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-extraneous-dependencies.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-internal-modules.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-mutable-exports.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-named-as-default-member.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-named-as-default.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-named-default.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-named-export.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-namespace.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-nodejs-modules.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-relative-parent-imports.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-restricted-paths.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-self-import.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-unassigned-import.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-unresolved.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-unused-modules.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-useless-path-segments.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/no-webpack-loader-syntax.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/order.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/prefer-default-export.md create mode 100644 node_modules/eslint-plugin-import/docs/rules/unambiguous.md create mode 100644 node_modules/eslint-plugin-import/lib/ExportMap.js create mode 100644 node_modules/eslint-plugin-import/lib/core/importType.js create mode 100644 node_modules/eslint-plugin-import/lib/core/staticRequire.js create mode 100644 node_modules/eslint-plugin-import/lib/docsUrl.js create mode 100644 node_modules/eslint-plugin-import/lib/importDeclaration.js create mode 100644 node_modules/eslint-plugin-import/lib/index.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/default.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/dynamic-import-chunkname.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/export.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/exports-last.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/extensions.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/first.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/group-exports.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/imports-first.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/max-dependencies.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/named.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/namespace.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/newline-after-import.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-absolute-path.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-amd.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-anonymous-default-export.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-commonjs.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-cycle.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-default-export.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-deprecated.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-duplicates.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-dynamic-require.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-extraneous-dependencies.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-internal-modules.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-mutable-exports.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-named-as-default-member.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-named-as-default.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-named-default.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-named-export.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-namespace.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-nodejs-modules.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-relative-parent-imports.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-restricted-paths.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-self-import.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-unassigned-import.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-unresolved.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-unused-modules.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-useless-path-segments.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/no-webpack-loader-syntax.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/order.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/prefer-default-export.js create mode 100644 node_modules/eslint-plugin-import/lib/rules/unambiguous.js create mode 100644 node_modules/eslint-plugin-import/memo-parser/LICENSE create mode 100644 node_modules/eslint-plugin-import/memo-parser/README.md create mode 100644 node_modules/eslint-plugin-import/memo-parser/index.js create mode 100644 node_modules/eslint-plugin-import/memo-parser/package.json create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/.coveralls.yml create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/.eslintrc create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/.npmignore create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/.travis.yml create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/CHANGELOG.md create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/LICENSE create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/Makefile create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/README.md create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/component.json create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/karma.conf.js create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/node.js create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/package.json create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/src/browser.js create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/src/debug.js create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/src/index.js create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/src/inspector-log.js create mode 100644 node_modules/eslint-plugin-import/node_modules/debug/src/node.js create mode 100644 node_modules/eslint-plugin-import/node_modules/doctrine/CHANGELOG.md create mode 100644 node_modules/eslint-plugin-import/node_modules/doctrine/LICENSE.BSD rename node_modules/{ => eslint-plugin-import/node_modules}/doctrine/LICENSE.closure-compiler (100%) rename node_modules/{ => eslint-plugin-import/node_modules}/doctrine/LICENSE.esprima (100%) create mode 100644 node_modules/eslint-plugin-import/node_modules/doctrine/README.md create mode 100644 node_modules/eslint-plugin-import/node_modules/doctrine/lib/doctrine.js create mode 100644 node_modules/eslint-plugin-import/node_modules/doctrine/lib/typed.js create mode 100644 node_modules/eslint-plugin-import/node_modules/doctrine/lib/utility.js create mode 100644 node_modules/eslint-plugin-import/node_modules/doctrine/package.json create mode 100644 node_modules/eslint-plugin-import/node_modules/isarray/.npmignore create mode 100644 node_modules/eslint-plugin-import/node_modules/isarray/.travis.yml create mode 100644 node_modules/eslint-plugin-import/node_modules/isarray/Makefile create mode 100644 node_modules/eslint-plugin-import/node_modules/isarray/README.md create mode 100644 node_modules/eslint-plugin-import/node_modules/isarray/component.json create mode 100644 node_modules/eslint-plugin-import/node_modules/isarray/index.js create mode 100644 node_modules/eslint-plugin-import/node_modules/isarray/package.json create mode 100644 node_modules/eslint-plugin-import/node_modules/isarray/test.js create mode 100644 node_modules/eslint-plugin-import/node_modules/ms/index.js create mode 100644 node_modules/eslint-plugin-import/node_modules/ms/license.md create mode 100644 node_modules/eslint-plugin-import/node_modules/ms/package.json create mode 100644 node_modules/eslint-plugin-import/node_modules/ms/readme.md create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/.editorconfig create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/.eslintignore create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/.eslintrc create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/.travis.yml create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/LICENSE create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/appveyor.yml create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/example/async.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/example/sync.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/index.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/lib/async.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/lib/caller.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/lib/core.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/lib/core.json create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/lib/is-core.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/lib/node-modules-paths.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/lib/normalize-options.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/lib/sync.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/package.json create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/readme.markdown create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/.eslintrc create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/core.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/dotdot.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/dotdot/abc/index.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/dotdot/index.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/faulty_basedir.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/filter.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/filter_sync.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/mock.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/mock_sync.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/module_dir.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/module_dir/xmodules/aaa/index.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/module_dir/ymodules/aaa/index.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/module_dir/zmodules/bbb/main.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/module_dir/zmodules/bbb/package.json create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/node-modules-paths.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/node_path.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/node_path/x/aaa/index.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/node_path/x/ccc/index.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/node_path/y/bbb/index.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/node_path/y/ccc/index.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/nonstring.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/pathfilter.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/pathfilter/deep_ref/main.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/precedence.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/precedence/aaa.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/precedence/aaa/index.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/precedence/aaa/main.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/precedence/bbb.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/precedence/bbb/main.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/baz/doom.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/baz/package.json create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/baz/quux.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/browser_field/a.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/browser_field/b.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/browser_field/package.json create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/cup.coffee create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/dot_main/index.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/dot_main/package.json create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/dot_slash_main/index.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/dot_slash_main/package.json create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/foo.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/incorrect_main/index.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/incorrect_main/package.json create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/invalid_main/package.json create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/mug.coffee create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/mug.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/multirepo/lerna.json create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/multirepo/package.json create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/other_path/lib/other-lib.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/other_path/root.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/quux/foo/index.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/same_names/foo.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/same_names/foo/index.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/symlinked/package/bar.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/symlinked/package/package.json create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/without_basedir/main.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/resolver_sync.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/shadowed_core.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/shadowed_core/node_modules/util/index.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/subdirs.js create mode 100644 node_modules/eslint-plugin-import/node_modules/resolve/test/symlinks.js create mode 100644 node_modules/eslint-plugin-import/package.json create mode 100644 node_modules/eslint-plugin-no-async-foreach/README.md create mode 100644 node_modules/eslint-plugin-no-async-foreach/index.js create mode 100644 node_modules/eslint-plugin-no-async-foreach/lib/no-async-foreach.js create mode 100644 node_modules/eslint-plugin-no-async-foreach/package.json create mode 100644 node_modules/eslint-plugin-no-async-foreach/tests/lib/rules/no-async-foreach.js create mode 100644 node_modules/eslint-plugin-prettier/CHANGELOG.md create mode 100644 node_modules/eslint-plugin-prettier/LICENSE.md create mode 100644 node_modules/eslint-plugin-prettier/README.md create mode 100644 node_modules/eslint-plugin-prettier/eslint-plugin-prettier.js create mode 100644 node_modules/eslint-plugin-prettier/package.json create mode 100644 node_modules/eslint-rule-documentation/index.js create mode 100644 node_modules/eslint-rule-documentation/license create mode 100644 node_modules/eslint-rule-documentation/package.json create mode 100644 node_modules/eslint-rule-documentation/plugins.json create mode 100644 node_modules/eslint-rule-documentation/readme.md create mode 100644 node_modules/eslint-scope/CHANGELOG.md create mode 100644 node_modules/eslint-scope/LICENSE create mode 100644 node_modules/eslint-scope/README.md create mode 100644 node_modules/eslint-scope/lib/definition.js create mode 100644 node_modules/eslint-scope/lib/index.js create mode 100644 node_modules/eslint-scope/lib/pattern-visitor.js create mode 100644 node_modules/eslint-scope/lib/reference.js create mode 100644 node_modules/eslint-scope/lib/referencer.js create mode 100644 node_modules/eslint-scope/lib/scope-manager.js create mode 100644 node_modules/eslint-scope/lib/scope.js create mode 100644 node_modules/eslint-scope/lib/variable.js create mode 100644 node_modules/eslint-scope/package.json create mode 100644 node_modules/eslint-utils/LICENSE create mode 100644 node_modules/eslint-utils/README.md create mode 100644 node_modules/eslint-utils/index.js create mode 100644 node_modules/eslint-utils/index.js.map create mode 100644 node_modules/eslint-utils/index.mjs create mode 100644 node_modules/eslint-utils/index.mjs.map create mode 100644 node_modules/eslint-utils/node_modules/eslint-visitor-keys/CHANGELOG.md create mode 100644 node_modules/eslint-utils/node_modules/eslint-visitor-keys/LICENSE create mode 100644 node_modules/eslint-utils/node_modules/eslint-visitor-keys/README.md create mode 100644 node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/index.js create mode 100644 node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/visitor-keys.json create mode 100644 node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json create mode 100644 node_modules/eslint-utils/package.json create mode 100644 node_modules/eslint-visitor-keys/CHANGELOG.md create mode 100644 node_modules/eslint-visitor-keys/LICENSE create mode 100644 node_modules/eslint-visitor-keys/README.md create mode 100644 node_modules/eslint-visitor-keys/lib/index.js create mode 100644 node_modules/eslint-visitor-keys/lib/visitor-keys.json create mode 100644 node_modules/eslint-visitor-keys/package.json create mode 100644 node_modules/eslint/CHANGELOG.md create mode 100644 node_modules/eslint/LICENSE create mode 100644 node_modules/eslint/README.md create mode 100755 node_modules/eslint/bin/eslint.js create mode 100644 node_modules/eslint/conf/category-list.json create mode 100644 node_modules/eslint/conf/config-schema.js create mode 100644 node_modules/eslint/conf/default-cli-options.js create mode 100644 node_modules/eslint/conf/eslint-all.js create mode 100644 node_modules/eslint/conf/eslint-recommended.js create mode 100644 node_modules/eslint/conf/replacements.json create mode 100644 node_modules/eslint/lib/api.js create mode 100644 node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js create mode 100644 node_modules/eslint/lib/cli-engine/cli-engine.js create mode 100644 node_modules/eslint/lib/cli-engine/config-array-factory.js create mode 100644 node_modules/eslint/lib/cli-engine/config-array/config-array.js create mode 100644 node_modules/eslint/lib/cli-engine/config-array/config-dependency.js create mode 100644 node_modules/eslint/lib/cli-engine/config-array/extracted-config.js create mode 100644 node_modules/eslint/lib/cli-engine/config-array/ignore-pattern.js create mode 100644 node_modules/eslint/lib/cli-engine/config-array/index.js create mode 100644 node_modules/eslint/lib/cli-engine/config-array/override-tester.js create mode 100644 node_modules/eslint/lib/cli-engine/file-enumerator.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/checkstyle.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/codeframe.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/compact.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/html-template-message.html create mode 100644 node_modules/eslint/lib/cli-engine/formatters/html-template-page.html create mode 100644 node_modules/eslint/lib/cli-engine/formatters/html-template-result.html create mode 100644 node_modules/eslint/lib/cli-engine/formatters/html.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/jslint-xml.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/json-with-metadata.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/json.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/junit.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/stylish.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/table.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/tap.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/unix.js create mode 100644 node_modules/eslint/lib/cli-engine/formatters/visualstudio.js create mode 100644 node_modules/eslint/lib/cli-engine/hash.js create mode 100644 node_modules/eslint/lib/cli-engine/index.js create mode 100644 node_modules/eslint/lib/cli-engine/lint-result-cache.js create mode 100644 node_modules/eslint/lib/cli-engine/load-rules.js create mode 100644 node_modules/eslint/lib/cli-engine/xml-escape.js create mode 100644 node_modules/eslint/lib/cli.js create mode 100644 node_modules/eslint/lib/eslint/eslint.js create mode 100644 node_modules/eslint/lib/eslint/index.js create mode 100644 node_modules/eslint/lib/init/autoconfig.js create mode 100644 node_modules/eslint/lib/init/config-file.js create mode 100644 node_modules/eslint/lib/init/config-initializer.js create mode 100644 node_modules/eslint/lib/init/config-rule.js create mode 100644 node_modules/eslint/lib/init/npm-utils.js create mode 100644 node_modules/eslint/lib/init/source-code-utils.js create mode 100644 node_modules/eslint/lib/linter/apply-disable-directives.js create mode 100644 node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js create mode 100644 node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js create mode 100644 node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js create mode 100644 node_modules/eslint/lib/linter/code-path-analysis/code-path.js create mode 100644 node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js create mode 100644 node_modules/eslint/lib/linter/code-path-analysis/fork-context.js create mode 100644 node_modules/eslint/lib/linter/code-path-analysis/id-generator.js create mode 100644 node_modules/eslint/lib/linter/config-comment-parser.js create mode 100644 node_modules/eslint/lib/linter/index.js create mode 100644 node_modules/eslint/lib/linter/interpolate.js create mode 100644 node_modules/eslint/lib/linter/linter.js create mode 100644 node_modules/eslint/lib/linter/node-event-generator.js create mode 100644 node_modules/eslint/lib/linter/report-translator.js create mode 100644 node_modules/eslint/lib/linter/rule-fixer.js create mode 100644 node_modules/eslint/lib/linter/rules.js create mode 100644 node_modules/eslint/lib/linter/safe-emitter.js create mode 100644 node_modules/eslint/lib/linter/source-code-fixer.js create mode 100644 node_modules/eslint/lib/linter/timing.js create mode 100644 node_modules/eslint/lib/options.js create mode 100644 node_modules/eslint/lib/rule-tester/index.js create mode 100644 node_modules/eslint/lib/rule-tester/rule-tester.js create mode 100644 node_modules/eslint/lib/rules/accessor-pairs.js create mode 100644 node_modules/eslint/lib/rules/array-bracket-newline.js create mode 100644 node_modules/eslint/lib/rules/array-bracket-spacing.js create mode 100644 node_modules/eslint/lib/rules/array-callback-return.js create mode 100644 node_modules/eslint/lib/rules/array-element-newline.js create mode 100644 node_modules/eslint/lib/rules/arrow-body-style.js create mode 100644 node_modules/eslint/lib/rules/arrow-parens.js create mode 100644 node_modules/eslint/lib/rules/arrow-spacing.js create mode 100644 node_modules/eslint/lib/rules/block-scoped-var.js create mode 100644 node_modules/eslint/lib/rules/block-spacing.js create mode 100644 node_modules/eslint/lib/rules/brace-style.js create mode 100644 node_modules/eslint/lib/rules/callback-return.js create mode 100644 node_modules/eslint/lib/rules/camelcase.js create mode 100644 node_modules/eslint/lib/rules/capitalized-comments.js create mode 100644 node_modules/eslint/lib/rules/class-methods-use-this.js create mode 100644 node_modules/eslint/lib/rules/comma-dangle.js create mode 100644 node_modules/eslint/lib/rules/comma-spacing.js create mode 100644 node_modules/eslint/lib/rules/comma-style.js create mode 100644 node_modules/eslint/lib/rules/complexity.js create mode 100644 node_modules/eslint/lib/rules/computed-property-spacing.js create mode 100644 node_modules/eslint/lib/rules/consistent-return.js create mode 100644 node_modules/eslint/lib/rules/consistent-this.js create mode 100644 node_modules/eslint/lib/rules/constructor-super.js create mode 100644 node_modules/eslint/lib/rules/curly.js create mode 100644 node_modules/eslint/lib/rules/default-case-last.js create mode 100644 node_modules/eslint/lib/rules/default-case.js create mode 100644 node_modules/eslint/lib/rules/default-param-last.js create mode 100644 node_modules/eslint/lib/rules/dot-location.js create mode 100644 node_modules/eslint/lib/rules/dot-notation.js create mode 100644 node_modules/eslint/lib/rules/eol-last.js create mode 100644 node_modules/eslint/lib/rules/eqeqeq.js create mode 100644 node_modules/eslint/lib/rules/for-direction.js create mode 100644 node_modules/eslint/lib/rules/func-call-spacing.js create mode 100644 node_modules/eslint/lib/rules/func-name-matching.js create mode 100644 node_modules/eslint/lib/rules/func-names.js create mode 100644 node_modules/eslint/lib/rules/func-style.js create mode 100644 node_modules/eslint/lib/rules/function-call-argument-newline.js create mode 100644 node_modules/eslint/lib/rules/function-paren-newline.js create mode 100644 node_modules/eslint/lib/rules/generator-star-spacing.js create mode 100644 node_modules/eslint/lib/rules/getter-return.js create mode 100644 node_modules/eslint/lib/rules/global-require.js create mode 100644 node_modules/eslint/lib/rules/grouped-accessor-pairs.js create mode 100644 node_modules/eslint/lib/rules/guard-for-in.js create mode 100644 node_modules/eslint/lib/rules/handle-callback-err.js create mode 100644 node_modules/eslint/lib/rules/id-blacklist.js create mode 100644 node_modules/eslint/lib/rules/id-denylist.js create mode 100644 node_modules/eslint/lib/rules/id-length.js create mode 100644 node_modules/eslint/lib/rules/id-match.js create mode 100644 node_modules/eslint/lib/rules/implicit-arrow-linebreak.js create mode 100644 node_modules/eslint/lib/rules/indent-legacy.js create mode 100644 node_modules/eslint/lib/rules/indent.js create mode 100644 node_modules/eslint/lib/rules/index.js create mode 100644 node_modules/eslint/lib/rules/init-declarations.js create mode 100644 node_modules/eslint/lib/rules/jsx-quotes.js create mode 100644 node_modules/eslint/lib/rules/key-spacing.js create mode 100644 node_modules/eslint/lib/rules/keyword-spacing.js create mode 100644 node_modules/eslint/lib/rules/line-comment-position.js create mode 100644 node_modules/eslint/lib/rules/linebreak-style.js create mode 100644 node_modules/eslint/lib/rules/lines-around-comment.js create mode 100644 node_modules/eslint/lib/rules/lines-around-directive.js create mode 100644 node_modules/eslint/lib/rules/lines-between-class-members.js create mode 100644 node_modules/eslint/lib/rules/max-classes-per-file.js create mode 100644 node_modules/eslint/lib/rules/max-depth.js create mode 100644 node_modules/eslint/lib/rules/max-len.js create mode 100644 node_modules/eslint/lib/rules/max-lines-per-function.js create mode 100644 node_modules/eslint/lib/rules/max-lines.js create mode 100644 node_modules/eslint/lib/rules/max-nested-callbacks.js create mode 100644 node_modules/eslint/lib/rules/max-params.js create mode 100644 node_modules/eslint/lib/rules/max-statements-per-line.js create mode 100644 node_modules/eslint/lib/rules/max-statements.js create mode 100644 node_modules/eslint/lib/rules/multiline-comment-style.js create mode 100644 node_modules/eslint/lib/rules/multiline-ternary.js create mode 100644 node_modules/eslint/lib/rules/new-cap.js create mode 100644 node_modules/eslint/lib/rules/new-parens.js create mode 100644 node_modules/eslint/lib/rules/newline-after-var.js create mode 100644 node_modules/eslint/lib/rules/newline-before-return.js create mode 100644 node_modules/eslint/lib/rules/newline-per-chained-call.js create mode 100644 node_modules/eslint/lib/rules/no-alert.js create mode 100644 node_modules/eslint/lib/rules/no-array-constructor.js create mode 100644 node_modules/eslint/lib/rules/no-async-promise-executor.js create mode 100644 node_modules/eslint/lib/rules/no-await-in-loop.js create mode 100644 node_modules/eslint/lib/rules/no-bitwise.js create mode 100644 node_modules/eslint/lib/rules/no-buffer-constructor.js create mode 100644 node_modules/eslint/lib/rules/no-caller.js create mode 100644 node_modules/eslint/lib/rules/no-case-declarations.js create mode 100644 node_modules/eslint/lib/rules/no-catch-shadow.js create mode 100644 node_modules/eslint/lib/rules/no-class-assign.js create mode 100644 node_modules/eslint/lib/rules/no-compare-neg-zero.js create mode 100644 node_modules/eslint/lib/rules/no-cond-assign.js create mode 100644 node_modules/eslint/lib/rules/no-confusing-arrow.js create mode 100644 node_modules/eslint/lib/rules/no-console.js create mode 100644 node_modules/eslint/lib/rules/no-const-assign.js create mode 100644 node_modules/eslint/lib/rules/no-constant-condition.js create mode 100644 node_modules/eslint/lib/rules/no-constructor-return.js create mode 100644 node_modules/eslint/lib/rules/no-continue.js create mode 100644 node_modules/eslint/lib/rules/no-control-regex.js create mode 100644 node_modules/eslint/lib/rules/no-debugger.js create mode 100644 node_modules/eslint/lib/rules/no-delete-var.js create mode 100644 node_modules/eslint/lib/rules/no-div-regex.js create mode 100644 node_modules/eslint/lib/rules/no-dupe-args.js create mode 100644 node_modules/eslint/lib/rules/no-dupe-class-members.js create mode 100644 node_modules/eslint/lib/rules/no-dupe-else-if.js create mode 100644 node_modules/eslint/lib/rules/no-dupe-keys.js create mode 100644 node_modules/eslint/lib/rules/no-duplicate-case.js create mode 100644 node_modules/eslint/lib/rules/no-duplicate-imports.js create mode 100644 node_modules/eslint/lib/rules/no-else-return.js create mode 100644 node_modules/eslint/lib/rules/no-empty-character-class.js create mode 100644 node_modules/eslint/lib/rules/no-empty-function.js create mode 100644 node_modules/eslint/lib/rules/no-empty-pattern.js create mode 100644 node_modules/eslint/lib/rules/no-empty.js create mode 100644 node_modules/eslint/lib/rules/no-eq-null.js create mode 100644 node_modules/eslint/lib/rules/no-eval.js create mode 100644 node_modules/eslint/lib/rules/no-ex-assign.js create mode 100644 node_modules/eslint/lib/rules/no-extend-native.js create mode 100644 node_modules/eslint/lib/rules/no-extra-bind.js create mode 100644 node_modules/eslint/lib/rules/no-extra-boolean-cast.js create mode 100644 node_modules/eslint/lib/rules/no-extra-label.js create mode 100644 node_modules/eslint/lib/rules/no-extra-parens.js create mode 100644 node_modules/eslint/lib/rules/no-extra-semi.js create mode 100644 node_modules/eslint/lib/rules/no-fallthrough.js create mode 100644 node_modules/eslint/lib/rules/no-floating-decimal.js create mode 100644 node_modules/eslint/lib/rules/no-func-assign.js create mode 100644 node_modules/eslint/lib/rules/no-global-assign.js create mode 100644 node_modules/eslint/lib/rules/no-implicit-coercion.js create mode 100644 node_modules/eslint/lib/rules/no-implicit-globals.js create mode 100644 node_modules/eslint/lib/rules/no-implied-eval.js create mode 100644 node_modules/eslint/lib/rules/no-import-assign.js create mode 100644 node_modules/eslint/lib/rules/no-inline-comments.js create mode 100644 node_modules/eslint/lib/rules/no-inner-declarations.js create mode 100644 node_modules/eslint/lib/rules/no-invalid-regexp.js create mode 100644 node_modules/eslint/lib/rules/no-invalid-this.js create mode 100644 node_modules/eslint/lib/rules/no-irregular-whitespace.js create mode 100644 node_modules/eslint/lib/rules/no-iterator.js create mode 100644 node_modules/eslint/lib/rules/no-label-var.js create mode 100644 node_modules/eslint/lib/rules/no-labels.js create mode 100644 node_modules/eslint/lib/rules/no-lone-blocks.js create mode 100644 node_modules/eslint/lib/rules/no-lonely-if.js create mode 100644 node_modules/eslint/lib/rules/no-loop-func.js create mode 100644 node_modules/eslint/lib/rules/no-loss-of-precision.js create mode 100644 node_modules/eslint/lib/rules/no-magic-numbers.js create mode 100644 node_modules/eslint/lib/rules/no-misleading-character-class.js create mode 100644 node_modules/eslint/lib/rules/no-mixed-operators.js create mode 100644 node_modules/eslint/lib/rules/no-mixed-requires.js create mode 100644 node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js create mode 100644 node_modules/eslint/lib/rules/no-multi-assign.js create mode 100644 node_modules/eslint/lib/rules/no-multi-spaces.js create mode 100644 node_modules/eslint/lib/rules/no-multi-str.js create mode 100644 node_modules/eslint/lib/rules/no-multiple-empty-lines.js create mode 100644 node_modules/eslint/lib/rules/no-native-reassign.js create mode 100644 node_modules/eslint/lib/rules/no-negated-condition.js create mode 100644 node_modules/eslint/lib/rules/no-negated-in-lhs.js create mode 100644 node_modules/eslint/lib/rules/no-nested-ternary.js create mode 100644 node_modules/eslint/lib/rules/no-new-func.js create mode 100644 node_modules/eslint/lib/rules/no-new-object.js create mode 100644 node_modules/eslint/lib/rules/no-new-require.js create mode 100644 node_modules/eslint/lib/rules/no-new-symbol.js create mode 100644 node_modules/eslint/lib/rules/no-new-wrappers.js create mode 100644 node_modules/eslint/lib/rules/no-new.js create mode 100644 node_modules/eslint/lib/rules/no-obj-calls.js create mode 100644 node_modules/eslint/lib/rules/no-octal-escape.js create mode 100644 node_modules/eslint/lib/rules/no-octal.js create mode 100644 node_modules/eslint/lib/rules/no-param-reassign.js create mode 100644 node_modules/eslint/lib/rules/no-path-concat.js create mode 100644 node_modules/eslint/lib/rules/no-plusplus.js create mode 100644 node_modules/eslint/lib/rules/no-process-env.js create mode 100644 node_modules/eslint/lib/rules/no-process-exit.js create mode 100644 node_modules/eslint/lib/rules/no-promise-executor-return.js create mode 100644 node_modules/eslint/lib/rules/no-proto.js create mode 100644 node_modules/eslint/lib/rules/no-prototype-builtins.js create mode 100644 node_modules/eslint/lib/rules/no-redeclare.js create mode 100644 node_modules/eslint/lib/rules/no-regex-spaces.js create mode 100644 node_modules/eslint/lib/rules/no-restricted-exports.js create mode 100644 node_modules/eslint/lib/rules/no-restricted-globals.js create mode 100644 node_modules/eslint/lib/rules/no-restricted-imports.js create mode 100644 node_modules/eslint/lib/rules/no-restricted-modules.js create mode 100644 node_modules/eslint/lib/rules/no-restricted-properties.js create mode 100644 node_modules/eslint/lib/rules/no-restricted-syntax.js create mode 100644 node_modules/eslint/lib/rules/no-return-assign.js create mode 100644 node_modules/eslint/lib/rules/no-return-await.js create mode 100644 node_modules/eslint/lib/rules/no-script-url.js create mode 100644 node_modules/eslint/lib/rules/no-self-assign.js create mode 100644 node_modules/eslint/lib/rules/no-self-compare.js create mode 100644 node_modules/eslint/lib/rules/no-sequences.js create mode 100644 node_modules/eslint/lib/rules/no-setter-return.js create mode 100644 node_modules/eslint/lib/rules/no-shadow-restricted-names.js create mode 100644 node_modules/eslint/lib/rules/no-shadow.js create mode 100644 node_modules/eslint/lib/rules/no-spaced-func.js create mode 100644 node_modules/eslint/lib/rules/no-sparse-arrays.js create mode 100644 node_modules/eslint/lib/rules/no-sync.js create mode 100644 node_modules/eslint/lib/rules/no-tabs.js create mode 100644 node_modules/eslint/lib/rules/no-template-curly-in-string.js create mode 100644 node_modules/eslint/lib/rules/no-ternary.js create mode 100644 node_modules/eslint/lib/rules/no-this-before-super.js create mode 100644 node_modules/eslint/lib/rules/no-throw-literal.js create mode 100644 node_modules/eslint/lib/rules/no-trailing-spaces.js create mode 100644 node_modules/eslint/lib/rules/no-undef-init.js create mode 100644 node_modules/eslint/lib/rules/no-undef.js create mode 100644 node_modules/eslint/lib/rules/no-undefined.js create mode 100644 node_modules/eslint/lib/rules/no-underscore-dangle.js create mode 100644 node_modules/eslint/lib/rules/no-unexpected-multiline.js create mode 100644 node_modules/eslint/lib/rules/no-unmodified-loop-condition.js create mode 100644 node_modules/eslint/lib/rules/no-unneeded-ternary.js create mode 100644 node_modules/eslint/lib/rules/no-unreachable-loop.js create mode 100644 node_modules/eslint/lib/rules/no-unreachable.js create mode 100644 node_modules/eslint/lib/rules/no-unsafe-finally.js create mode 100644 node_modules/eslint/lib/rules/no-unsafe-negation.js create mode 100644 node_modules/eslint/lib/rules/no-unused-expressions.js create mode 100644 node_modules/eslint/lib/rules/no-unused-labels.js create mode 100644 node_modules/eslint/lib/rules/no-unused-vars.js create mode 100644 node_modules/eslint/lib/rules/no-use-before-define.js create mode 100644 node_modules/eslint/lib/rules/no-useless-backreference.js create mode 100644 node_modules/eslint/lib/rules/no-useless-call.js create mode 100644 node_modules/eslint/lib/rules/no-useless-catch.js create mode 100644 node_modules/eslint/lib/rules/no-useless-computed-key.js create mode 100644 node_modules/eslint/lib/rules/no-useless-concat.js create mode 100644 node_modules/eslint/lib/rules/no-useless-constructor.js create mode 100644 node_modules/eslint/lib/rules/no-useless-escape.js create mode 100644 node_modules/eslint/lib/rules/no-useless-rename.js create mode 100644 node_modules/eslint/lib/rules/no-useless-return.js create mode 100644 node_modules/eslint/lib/rules/no-var.js create mode 100644 node_modules/eslint/lib/rules/no-void.js create mode 100644 node_modules/eslint/lib/rules/no-warning-comments.js create mode 100644 node_modules/eslint/lib/rules/no-whitespace-before-property.js create mode 100644 node_modules/eslint/lib/rules/no-with.js create mode 100644 node_modules/eslint/lib/rules/nonblock-statement-body-position.js create mode 100644 node_modules/eslint/lib/rules/object-curly-newline.js create mode 100644 node_modules/eslint/lib/rules/object-curly-spacing.js create mode 100644 node_modules/eslint/lib/rules/object-property-newline.js create mode 100644 node_modules/eslint/lib/rules/object-shorthand.js create mode 100644 node_modules/eslint/lib/rules/one-var-declaration-per-line.js create mode 100644 node_modules/eslint/lib/rules/one-var.js create mode 100644 node_modules/eslint/lib/rules/operator-assignment.js create mode 100644 node_modules/eslint/lib/rules/operator-linebreak.js create mode 100644 node_modules/eslint/lib/rules/padded-blocks.js create mode 100644 node_modules/eslint/lib/rules/padding-line-between-statements.js create mode 100644 node_modules/eslint/lib/rules/prefer-arrow-callback.js create mode 100644 node_modules/eslint/lib/rules/prefer-const.js create mode 100644 node_modules/eslint/lib/rules/prefer-destructuring.js create mode 100644 node_modules/eslint/lib/rules/prefer-exponentiation-operator.js create mode 100644 node_modules/eslint/lib/rules/prefer-named-capture-group.js create mode 100644 node_modules/eslint/lib/rules/prefer-numeric-literals.js create mode 100644 node_modules/eslint/lib/rules/prefer-object-spread.js create mode 100644 node_modules/eslint/lib/rules/prefer-promise-reject-errors.js create mode 100644 node_modules/eslint/lib/rules/prefer-reflect.js create mode 100644 node_modules/eslint/lib/rules/prefer-regex-literals.js create mode 100644 node_modules/eslint/lib/rules/prefer-rest-params.js create mode 100644 node_modules/eslint/lib/rules/prefer-spread.js create mode 100644 node_modules/eslint/lib/rules/prefer-template.js create mode 100644 node_modules/eslint/lib/rules/quote-props.js create mode 100644 node_modules/eslint/lib/rules/quotes.js create mode 100644 node_modules/eslint/lib/rules/radix.js create mode 100644 node_modules/eslint/lib/rules/require-atomic-updates.js create mode 100644 node_modules/eslint/lib/rules/require-await.js create mode 100644 node_modules/eslint/lib/rules/require-jsdoc.js create mode 100644 node_modules/eslint/lib/rules/require-unicode-regexp.js create mode 100644 node_modules/eslint/lib/rules/require-yield.js create mode 100644 node_modules/eslint/lib/rules/rest-spread-spacing.js create mode 100644 node_modules/eslint/lib/rules/semi-spacing.js create mode 100644 node_modules/eslint/lib/rules/semi-style.js create mode 100644 node_modules/eslint/lib/rules/semi.js create mode 100644 node_modules/eslint/lib/rules/sort-imports.js create mode 100644 node_modules/eslint/lib/rules/sort-keys.js create mode 100644 node_modules/eslint/lib/rules/sort-vars.js create mode 100644 node_modules/eslint/lib/rules/space-before-blocks.js create mode 100644 node_modules/eslint/lib/rules/space-before-function-paren.js create mode 100644 node_modules/eslint/lib/rules/space-in-parens.js create mode 100644 node_modules/eslint/lib/rules/space-infix-ops.js create mode 100644 node_modules/eslint/lib/rules/space-unary-ops.js create mode 100644 node_modules/eslint/lib/rules/spaced-comment.js create mode 100644 node_modules/eslint/lib/rules/strict.js create mode 100644 node_modules/eslint/lib/rules/switch-colon-spacing.js create mode 100644 node_modules/eslint/lib/rules/symbol-description.js create mode 100644 node_modules/eslint/lib/rules/template-curly-spacing.js create mode 100644 node_modules/eslint/lib/rules/template-tag-spacing.js create mode 100644 node_modules/eslint/lib/rules/unicode-bom.js create mode 100644 node_modules/eslint/lib/rules/use-isnan.js create mode 100644 node_modules/eslint/lib/rules/utils/ast-utils.js create mode 100644 node_modules/eslint/lib/rules/utils/fix-tracker.js create mode 100644 node_modules/eslint/lib/rules/utils/keywords.js create mode 100644 node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js create mode 100644 node_modules/eslint/lib/rules/utils/patterns/letters.js create mode 100644 node_modules/eslint/lib/rules/utils/unicode/index.js create mode 100644 node_modules/eslint/lib/rules/utils/unicode/is-combining-character.js create mode 100644 node_modules/eslint/lib/rules/utils/unicode/is-emoji-modifier.js create mode 100644 node_modules/eslint/lib/rules/utils/unicode/is-regional-indicator-symbol.js create mode 100644 node_modules/eslint/lib/rules/utils/unicode/is-surrogate-pair.js create mode 100644 node_modules/eslint/lib/rules/valid-jsdoc.js create mode 100644 node_modules/eslint/lib/rules/valid-typeof.js create mode 100644 node_modules/eslint/lib/rules/vars-on-top.js create mode 100644 node_modules/eslint/lib/rules/wrap-iife.js create mode 100644 node_modules/eslint/lib/rules/wrap-regex.js create mode 100644 node_modules/eslint/lib/rules/yield-star-spacing.js create mode 100644 node_modules/eslint/lib/rules/yoda.js create mode 100644 node_modules/eslint/lib/shared/ajv.js create mode 100644 node_modules/eslint/lib/shared/ast-utils.js create mode 100644 node_modules/eslint/lib/shared/config-validator.js create mode 100644 node_modules/eslint/lib/shared/deprecation-warnings.js create mode 100644 node_modules/eslint/lib/shared/logging.js create mode 100644 node_modules/eslint/lib/shared/relative-module-resolver.js create mode 100644 node_modules/eslint/lib/shared/runtime-info.js create mode 100644 node_modules/eslint/lib/shared/traverser.js create mode 100644 node_modules/eslint/lib/shared/types.js create mode 100644 node_modules/eslint/lib/source-code/index.js create mode 100644 node_modules/eslint/lib/source-code/source-code.js create mode 100644 node_modules/eslint/lib/source-code/token-store/backward-token-comment-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/backward-token-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/cursors.js create mode 100644 node_modules/eslint/lib/source-code/token-store/decorative-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/filter-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/forward-token-comment-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/forward-token-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/index.js create mode 100644 node_modules/eslint/lib/source-code/token-store/limit-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/padded-token-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/skip-cursor.js create mode 100644 node_modules/eslint/lib/source-code/token-store/utils.js create mode 100644 node_modules/eslint/messages/all-files-ignored.txt create mode 100644 node_modules/eslint/messages/extend-config-missing.txt create mode 100644 node_modules/eslint/messages/failed-to-read-json.txt create mode 100644 node_modules/eslint/messages/file-not-found.txt create mode 100644 node_modules/eslint/messages/no-config-found.txt create mode 100644 node_modules/eslint/messages/plugin-conflict.txt create mode 100644 node_modules/eslint/messages/plugin-invalid.txt create mode 100644 node_modules/eslint/messages/plugin-missing.txt create mode 100644 node_modules/eslint/messages/print-config-with-directory-path.txt create mode 100644 node_modules/eslint/messages/whitespace-found.txt create mode 120000 node_modules/eslint/node_modules/.bin/node-which create mode 100644 node_modules/eslint/node_modules/ansi-styles/index.d.ts create mode 100644 node_modules/eslint/node_modules/ansi-styles/index.js create mode 100644 node_modules/eslint/node_modules/ansi-styles/license create mode 100644 node_modules/eslint/node_modules/ansi-styles/package.json create mode 100644 node_modules/eslint/node_modules/ansi-styles/readme.md create mode 100644 node_modules/eslint/node_modules/chalk/index.d.ts create mode 100644 node_modules/eslint/node_modules/chalk/license create mode 100644 node_modules/eslint/node_modules/chalk/package.json create mode 100644 node_modules/eslint/node_modules/chalk/readme.md create mode 100644 node_modules/eslint/node_modules/chalk/source/index.js create mode 100644 node_modules/eslint/node_modules/chalk/source/templates.js create mode 100644 node_modules/eslint/node_modules/chalk/source/util.js create mode 100644 node_modules/eslint/node_modules/color-convert/CHANGELOG.md create mode 100644 node_modules/eslint/node_modules/color-convert/LICENSE create mode 100644 node_modules/eslint/node_modules/color-convert/README.md create mode 100644 node_modules/eslint/node_modules/color-convert/conversions.js create mode 100644 node_modules/eslint/node_modules/color-convert/index.js create mode 100644 node_modules/eslint/node_modules/color-convert/package.json create mode 100644 node_modules/eslint/node_modules/color-convert/route.js create mode 100644 node_modules/eslint/node_modules/color-name/LICENSE create mode 100644 node_modules/eslint/node_modules/color-name/README.md create mode 100644 node_modules/eslint/node_modules/color-name/index.js create mode 100644 node_modules/eslint/node_modules/color-name/package.json create mode 100644 node_modules/eslint/node_modules/cross-spawn/CHANGELOG.md create mode 100644 node_modules/eslint/node_modules/cross-spawn/LICENSE create mode 100644 node_modules/eslint/node_modules/cross-spawn/README.md create mode 100644 node_modules/eslint/node_modules/cross-spawn/index.js create mode 100644 node_modules/eslint/node_modules/cross-spawn/lib/enoent.js create mode 100644 node_modules/eslint/node_modules/cross-spawn/lib/parse.js create mode 100644 node_modules/eslint/node_modules/cross-spawn/lib/util/escape.js create mode 100644 node_modules/eslint/node_modules/cross-spawn/lib/util/readShebang.js create mode 100644 node_modules/eslint/node_modules/cross-spawn/lib/util/resolveCommand.js create mode 100644 node_modules/eslint/node_modules/cross-spawn/package.json create mode 100644 node_modules/eslint/node_modules/doctrine/CHANGELOG.md create mode 100644 node_modules/eslint/node_modules/doctrine/LICENSE create mode 100644 node_modules/eslint/node_modules/doctrine/LICENSE.closure-compiler rename node_modules/{doctrine/LICENSE.BSD => eslint/node_modules/doctrine/LICENSE.esprima} (100%) create mode 100644 node_modules/eslint/node_modules/doctrine/README.md create mode 100644 node_modules/eslint/node_modules/doctrine/lib/doctrine.js create mode 100644 node_modules/eslint/node_modules/doctrine/lib/typed.js create mode 100644 node_modules/eslint/node_modules/doctrine/lib/utility.js create mode 100644 node_modules/eslint/node_modules/doctrine/package.json create mode 100644 node_modules/eslint/node_modules/eslint-visitor-keys/CHANGELOG.md create mode 100644 node_modules/eslint/node_modules/eslint-visitor-keys/LICENSE create mode 100644 node_modules/eslint/node_modules/eslint-visitor-keys/README.md create mode 100644 node_modules/eslint/node_modules/eslint-visitor-keys/lib/index.js create mode 100644 node_modules/eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.json create mode 100644 node_modules/eslint/node_modules/eslint-visitor-keys/package.json create mode 100644 node_modules/eslint/node_modules/has-flag/index.d.ts create mode 100644 node_modules/eslint/node_modules/has-flag/index.js create mode 100644 node_modules/eslint/node_modules/has-flag/license create mode 100644 node_modules/eslint/node_modules/has-flag/package.json create mode 100644 node_modules/eslint/node_modules/has-flag/readme.md create mode 100644 node_modules/eslint/node_modules/ignore/CHANGELOG.md create mode 100755 node_modules/eslint/node_modules/ignore/LICENSE-MIT create mode 100755 node_modules/eslint/node_modules/ignore/README.md create mode 100644 node_modules/eslint/node_modules/ignore/index.d.ts create mode 100755 node_modules/eslint/node_modules/ignore/index.js create mode 100644 node_modules/eslint/node_modules/ignore/legacy.js create mode 100644 node_modules/eslint/node_modules/ignore/package.json create mode 100644 node_modules/eslint/node_modules/path-key/index.d.ts create mode 100644 node_modules/eslint/node_modules/path-key/index.js create mode 100644 node_modules/eslint/node_modules/path-key/license create mode 100644 node_modules/eslint/node_modules/path-key/package.json create mode 100644 node_modules/eslint/node_modules/path-key/readme.md create mode 100644 node_modules/eslint/node_modules/shebang-command/index.js create mode 100644 node_modules/eslint/node_modules/shebang-command/license create mode 100644 node_modules/eslint/node_modules/shebang-command/package.json create mode 100644 node_modules/eslint/node_modules/shebang-command/readme.md create mode 100644 node_modules/eslint/node_modules/shebang-regex/index.d.ts create mode 100644 node_modules/eslint/node_modules/shebang-regex/index.js create mode 100644 node_modules/eslint/node_modules/shebang-regex/license create mode 100644 node_modules/eslint/node_modules/shebang-regex/package.json create mode 100644 node_modules/eslint/node_modules/shebang-regex/readme.md create mode 100644 node_modules/eslint/node_modules/strip-json-comments/index.d.ts create mode 100644 node_modules/eslint/node_modules/strip-json-comments/index.js create mode 100644 node_modules/eslint/node_modules/strip-json-comments/license create mode 100644 node_modules/eslint/node_modules/strip-json-comments/package.json create mode 100644 node_modules/eslint/node_modules/strip-json-comments/readme.md create mode 100644 node_modules/eslint/node_modules/supports-color/browser.js create mode 100644 node_modules/eslint/node_modules/supports-color/index.js create mode 100644 node_modules/eslint/node_modules/supports-color/license create mode 100644 node_modules/eslint/node_modules/supports-color/package.json create mode 100644 node_modules/eslint/node_modules/supports-color/readme.md create mode 100644 node_modules/eslint/node_modules/which/CHANGELOG.md rename node_modules/{tslint/node_modules/semver => eslint/node_modules/which}/LICENSE (100%) create mode 100644 node_modules/eslint/node_modules/which/README.md create mode 100755 node_modules/eslint/node_modules/which/bin/node-which create mode 100644 node_modules/eslint/node_modules/which/package.json create mode 100644 node_modules/eslint/node_modules/which/which.js create mode 100644 node_modules/eslint/package.json create mode 100644 node_modules/espree/CHANGELOG.md create mode 100644 node_modules/espree/LICENSE create mode 100644 node_modules/espree/README.md create mode 100644 node_modules/espree/espree.js create mode 100644 node_modules/espree/lib/ast-node-types.js create mode 100644 node_modules/espree/lib/espree.js create mode 100644 node_modules/espree/lib/features.js create mode 100644 node_modules/espree/lib/options.js create mode 100644 node_modules/espree/lib/token-translator.js create mode 100644 node_modules/espree/lib/visitor-keys.js create mode 120000 node_modules/espree/node_modules/.bin/acorn create mode 100644 node_modules/espree/node_modules/acorn/CHANGELOG.md create mode 100644 node_modules/espree/node_modules/acorn/LICENSE create mode 100644 node_modules/espree/node_modules/acorn/README.md create mode 100755 node_modules/espree/node_modules/acorn/bin/acorn create mode 100644 node_modules/espree/node_modules/acorn/dist/acorn.d.ts create mode 100644 node_modules/espree/node_modules/acorn/dist/acorn.js create mode 100644 node_modules/espree/node_modules/acorn/dist/acorn.js.map create mode 100644 node_modules/espree/node_modules/acorn/dist/acorn.mjs create mode 100644 node_modules/espree/node_modules/acorn/dist/acorn.mjs.d.ts create mode 100644 node_modules/espree/node_modules/acorn/dist/acorn.mjs.map create mode 100644 node_modules/espree/node_modules/acorn/dist/bin.js create mode 100644 node_modules/espree/node_modules/acorn/package.json create mode 100644 node_modules/espree/node_modules/eslint-visitor-keys/CHANGELOG.md create mode 100644 node_modules/espree/node_modules/eslint-visitor-keys/LICENSE create mode 100644 node_modules/espree/node_modules/eslint-visitor-keys/README.md create mode 100644 node_modules/espree/node_modules/eslint-visitor-keys/lib/index.js create mode 100644 node_modules/espree/node_modules/eslint-visitor-keys/lib/visitor-keys.json create mode 100644 node_modules/espree/node_modules/eslint-visitor-keys/package.json create mode 100644 node_modules/espree/package.json create mode 100644 node_modules/esquery/README.md create mode 100644 node_modules/esquery/dist/esquery.esm.js create mode 100644 node_modules/esquery/dist/esquery.esm.min.js create mode 100644 node_modules/esquery/dist/esquery.esm.min.js.map create mode 100644 node_modules/esquery/dist/esquery.js create mode 100644 node_modules/esquery/dist/esquery.min.js create mode 100644 node_modules/esquery/dist/esquery.min.js.map create mode 100644 node_modules/esquery/license.txt create mode 100644 node_modules/esquery/node_modules/estraverse/.jshintrc rename node_modules/{doctrine/node_modules/esutils => esquery/node_modules/estraverse}/LICENSE.BSD (100%) create mode 100644 node_modules/esquery/node_modules/estraverse/README.md create mode 100644 node_modules/esquery/node_modules/estraverse/estraverse.js create mode 100644 node_modules/esquery/node_modules/estraverse/gulpfile.js create mode 100644 node_modules/esquery/node_modules/estraverse/package.json create mode 100644 node_modules/esquery/package.json create mode 100644 node_modules/esquery/parser.js create mode 100644 node_modules/esrecurse/.babelrc create mode 100644 node_modules/esrecurse/README.md create mode 100644 node_modules/esrecurse/esrecurse.js create mode 100644 node_modules/esrecurse/gulpfile.babel.js create mode 100644 node_modules/esrecurse/node_modules/estraverse/.jshintrc create mode 100644 node_modules/esrecurse/node_modules/estraverse/LICENSE.BSD create mode 100644 node_modules/esrecurse/node_modules/estraverse/README.md create mode 100644 node_modules/esrecurse/node_modules/estraverse/estraverse.js create mode 100644 node_modules/esrecurse/node_modules/estraverse/gulpfile.js create mode 100644 node_modules/esrecurse/node_modules/estraverse/package.json create mode 100755 node_modules/esrecurse/package.json create mode 100644 node_modules/estraverse/.jshintrc create mode 100644 node_modules/estraverse/LICENSE.BSD create mode 100644 node_modules/estraverse/README.md create mode 100644 node_modules/estraverse/estraverse.js create mode 100644 node_modules/estraverse/gulpfile.js create mode 100644 node_modules/estraverse/package.json create mode 100644 node_modules/fast-deep-equal/LICENSE create mode 100644 node_modules/fast-deep-equal/README.md create mode 100644 node_modules/fast-deep-equal/es6/index.d.ts create mode 100644 node_modules/fast-deep-equal/es6/index.js create mode 100644 node_modules/fast-deep-equal/es6/react.d.ts create mode 100644 node_modules/fast-deep-equal/es6/react.js create mode 100644 node_modules/fast-deep-equal/index.d.ts create mode 100644 node_modules/fast-deep-equal/index.js create mode 100644 node_modules/fast-deep-equal/package.json create mode 100644 node_modules/fast-deep-equal/react.d.ts create mode 100644 node_modules/fast-deep-equal/react.js create mode 100644 node_modules/fast-json-stable-stringify/.eslintrc.yml create mode 100644 node_modules/fast-json-stable-stringify/.github/FUNDING.yml create mode 100644 node_modules/fast-json-stable-stringify/.travis.yml create mode 100644 node_modules/fast-json-stable-stringify/LICENSE create mode 100644 node_modules/fast-json-stable-stringify/README.md create mode 100644 node_modules/fast-json-stable-stringify/benchmark/index.js create mode 100644 node_modules/fast-json-stable-stringify/benchmark/test.json create mode 100644 node_modules/fast-json-stable-stringify/example/key_cmp.js create mode 100644 node_modules/fast-json-stable-stringify/example/nested.js create mode 100644 node_modules/fast-json-stable-stringify/example/str.js create mode 100644 node_modules/fast-json-stable-stringify/example/value_cmp.js create mode 100644 node_modules/fast-json-stable-stringify/index.d.ts create mode 100644 node_modules/fast-json-stable-stringify/index.js create mode 100644 node_modules/fast-json-stable-stringify/package.json create mode 100644 node_modules/fast-json-stable-stringify/test/cmp.js create mode 100644 node_modules/fast-json-stable-stringify/test/nested.js create mode 100644 node_modules/fast-json-stable-stringify/test/str.js create mode 100644 node_modules/fast-json-stable-stringify/test/to-json.js create mode 100644 node_modules/fast-levenshtein/LICENSE.md create mode 100644 node_modules/fast-levenshtein/README.md create mode 100644 node_modules/fast-levenshtein/levenshtein.js create mode 100644 node_modules/fast-levenshtein/package.json create mode 100644 node_modules/file-entry-cache/LICENSE create mode 100644 node_modules/file-entry-cache/README.md create mode 100644 node_modules/file-entry-cache/cache.js create mode 100644 node_modules/file-entry-cache/changelog.md create mode 100644 node_modules/file-entry-cache/package.json create mode 100644 node_modules/flat-cache/LICENSE create mode 100644 node_modules/flat-cache/README.md create mode 100644 node_modules/flat-cache/cache.js create mode 100644 node_modules/flat-cache/changelog.md create mode 100644 node_modules/flat-cache/del.js create mode 120000 node_modules/flat-cache/node_modules/.bin/rimraf create mode 100644 node_modules/flat-cache/node_modules/rimraf/LICENSE create mode 100644 node_modules/flat-cache/node_modules/rimraf/README.md create mode 100755 node_modules/flat-cache/node_modules/rimraf/bin.js create mode 100644 node_modules/flat-cache/node_modules/rimraf/package.json create mode 100644 node_modules/flat-cache/node_modules/rimraf/rimraf.js create mode 100644 node_modules/flat-cache/package.json create mode 100644 node_modules/flat-cache/utils.js create mode 100644 node_modules/flatted/.github/FUNDING.yml create mode 100644 node_modules/flatted/LICENSE create mode 100644 node_modules/flatted/README.md create mode 100644 node_modules/flatted/SPECS.md create mode 100644 node_modules/flatted/cjs/index.js create mode 100644 node_modules/flatted/esm/index.js create mode 100644 node_modules/flatted/index.js create mode 100644 node_modules/flatted/min.js create mode 100644 node_modules/flatted/package.json create mode 100644 node_modules/flatted/types.d.ts create mode 100644 node_modules/function-bind/.editorconfig create mode 100644 node_modules/function-bind/.eslintrc create mode 100644 node_modules/function-bind/.jscs.json create mode 100644 node_modules/function-bind/.npmignore create mode 100644 node_modules/function-bind/.travis.yml create mode 100644 node_modules/function-bind/LICENSE create mode 100644 node_modules/function-bind/README.md create mode 100644 node_modules/function-bind/implementation.js create mode 100644 node_modules/function-bind/index.js create mode 100644 node_modules/function-bind/package.json create mode 100644 node_modules/function-bind/test/.eslintrc create mode 100644 node_modules/function-bind/test/index.js create mode 100644 node_modules/functional-red-black-tree/.npmignore create mode 100644 node_modules/functional-red-black-tree/LICENSE create mode 100644 node_modules/functional-red-black-tree/README.md create mode 100644 node_modules/functional-red-black-tree/bench/test.js create mode 100644 node_modules/functional-red-black-tree/package.json create mode 100644 node_modules/functional-red-black-tree/rbtree.js create mode 100644 node_modules/functional-red-black-tree/test/test.js create mode 100644 node_modules/get-stdin/index.js create mode 100644 node_modules/get-stdin/license create mode 100644 node_modules/get-stdin/package.json create mode 100644 node_modules/get-stdin/readme.md create mode 100644 node_modules/globals/globals.json create mode 100644 node_modules/globals/index.d.ts create mode 100644 node_modules/globals/index.js create mode 100644 node_modules/globals/license create mode 100644 node_modules/globals/package.json create mode 100644 node_modules/globals/readme.md create mode 100644 node_modules/has-symbols/.eslintrc create mode 100644 node_modules/has-symbols/.github/FUNDING.yml create mode 100644 node_modules/has-symbols/.github/workflows/rebase.yml create mode 100644 node_modules/has-symbols/.travis.yml create mode 100644 node_modules/has-symbols/CHANGELOG.md create mode 100644 node_modules/has-symbols/LICENSE create mode 100644 node_modules/has-symbols/README.md create mode 100644 node_modules/has-symbols/index.js create mode 100644 node_modules/has-symbols/package.json create mode 100644 node_modules/has-symbols/shams.js create mode 100644 node_modules/has-symbols/test/index.js create mode 100644 node_modules/has-symbols/test/shams/core-js.js create mode 100644 node_modules/has-symbols/test/shams/get-own-property-symbols.js create mode 100644 node_modules/has-symbols/test/tests.js create mode 100644 node_modules/has/LICENSE-MIT create mode 100644 node_modules/has/README.md create mode 100644 node_modules/has/package.json create mode 100644 node_modules/has/src/index.js create mode 100644 node_modules/has/test/index.js create mode 100644 node_modules/import-fresh/index.d.ts create mode 100644 node_modules/import-fresh/index.js create mode 100644 node_modules/import-fresh/license create mode 100644 node_modules/import-fresh/node_modules/resolve-from/index.js create mode 100644 node_modules/import-fresh/node_modules/resolve-from/license create mode 100644 node_modules/import-fresh/node_modules/resolve-from/package.json create mode 100644 node_modules/import-fresh/node_modules/resolve-from/readme.md create mode 100644 node_modules/import-fresh/package.json create mode 100644 node_modules/import-fresh/readme.md create mode 100644 node_modules/is-callable/.editorconfig create mode 100644 node_modules/is-callable/.eslintrc create mode 100644 node_modules/is-callable/.github/FUNDING.yml create mode 100644 node_modules/is-callable/.github/main.workflow create mode 100644 node_modules/is-callable/.github/workflows/rebase.yml create mode 100644 node_modules/is-callable/.istanbul.yml create mode 100644 node_modules/is-callable/.travis.yml create mode 100644 node_modules/is-callable/CHANGELOG.md create mode 100644 node_modules/is-callable/LICENSE create mode 100644 node_modules/is-callable/README.md create mode 100644 node_modules/is-callable/index.js create mode 100644 node_modules/is-callable/package.json create mode 100644 node_modules/is-callable/test/index.js create mode 100644 node_modules/is-date-object/.eslintrc create mode 100644 node_modules/is-date-object/.github/FUNDING.yml create mode 100644 node_modules/is-date-object/.github/workflows/rebase.yml create mode 100644 node_modules/is-date-object/.jscs.json create mode 100644 node_modules/is-date-object/.travis.yml create mode 100644 node_modules/is-date-object/CHANGELOG.md create mode 100644 node_modules/is-date-object/LICENSE create mode 100644 node_modules/is-date-object/README.md create mode 100644 node_modules/is-date-object/index.js create mode 100644 node_modules/is-date-object/package.json create mode 100644 node_modules/is-date-object/test/index.js create mode 100644 node_modules/is-negative-zero/.eslintrc create mode 100644 node_modules/is-negative-zero/.jscs.json create mode 100644 node_modules/is-negative-zero/.npmignore create mode 100644 node_modules/is-negative-zero/.travis.yml create mode 100644 node_modules/is-negative-zero/LICENSE create mode 100644 node_modules/is-negative-zero/README.md create mode 100644 node_modules/is-negative-zero/index.js create mode 100644 node_modules/is-negative-zero/package.json create mode 100644 node_modules/is-negative-zero/test.js create mode 100644 node_modules/is-regex/.editorconfig create mode 100644 node_modules/is-regex/.eslintrc create mode 100644 node_modules/is-regex/.github/workflows/rebase.yml create mode 100644 node_modules/is-regex/.travis.yml create mode 100644 node_modules/is-regex/CHANGELOG.md create mode 100644 node_modules/is-regex/LICENSE create mode 100644 node_modules/is-regex/README.md create mode 100644 node_modules/is-regex/index.js create mode 100644 node_modules/is-regex/package.json create mode 100644 node_modules/is-regex/test/index.js create mode 100644 node_modules/is-string/.eslintrc create mode 100644 node_modules/is-string/.github/FUNDING.yml create mode 100644 node_modules/is-string/.github/workflows/rebase.yml create mode 100644 node_modules/is-string/.travis.yml create mode 100644 node_modules/is-string/CHANGELOG.md create mode 100644 node_modules/is-string/LICENSE create mode 100644 node_modules/is-string/README.md create mode 100644 node_modules/is-string/index.js create mode 100644 node_modules/is-string/package.json create mode 100644 node_modules/is-string/test/index.js create mode 100644 node_modules/is-symbol/.editorconfig create mode 100644 node_modules/is-symbol/.eslintrc create mode 100644 node_modules/is-symbol/.github/FUNDING.yml create mode 100644 node_modules/is-symbol/.github/workflows/rebase.yml create mode 100644 node_modules/is-symbol/.nvmrc create mode 100644 node_modules/is-symbol/.travis.yml create mode 100644 node_modules/is-symbol/CHANGELOG.md create mode 100644 node_modules/is-symbol/LICENSE create mode 100644 node_modules/is-symbol/Makefile create mode 100644 node_modules/is-symbol/README.md create mode 100644 node_modules/is-symbol/index.js create mode 100644 node_modules/is-symbol/package.json create mode 100644 node_modules/is-symbol/test/index.js create mode 100644 node_modules/json-schema-traverse/.eslintrc.yml create mode 100644 node_modules/json-schema-traverse/.travis.yml create mode 100644 node_modules/json-schema-traverse/LICENSE create mode 100644 node_modules/json-schema-traverse/README.md create mode 100644 node_modules/json-schema-traverse/index.js create mode 100644 node_modules/json-schema-traverse/package.json create mode 100644 node_modules/json-schema-traverse/spec/.eslintrc.yml create mode 100644 node_modules/json-schema-traverse/spec/fixtures/schema.js create mode 100644 node_modules/json-schema-traverse/spec/index.spec.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/.npmignore create mode 100644 node_modules/json-stable-stringify-without-jsonify/.travis.yml create mode 100644 node_modules/json-stable-stringify-without-jsonify/LICENSE create mode 100644 node_modules/json-stable-stringify-without-jsonify/example/key_cmp.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/example/nested.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/example/str.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/example/value_cmp.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/index.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/package.json create mode 100644 node_modules/json-stable-stringify-without-jsonify/readme.markdown create mode 100644 node_modules/json-stable-stringify-without-jsonify/test/cmp.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/test/nested.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/test/replacer.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/test/space.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/test/str.js create mode 100644 node_modules/json-stable-stringify-without-jsonify/test/to-json.js create mode 100644 node_modules/json5/CHANGELOG.md create mode 100644 node_modules/json5/LICENSE.md create mode 100644 node_modules/json5/README.md create mode 100644 node_modules/json5/dist/index.js create mode 100755 node_modules/json5/lib/cli.js create mode 100644 node_modules/json5/lib/index.js create mode 100644 node_modules/json5/lib/parse.js create mode 100644 node_modules/json5/lib/register.js create mode 100644 node_modules/json5/lib/require.js create mode 100644 node_modules/json5/lib/stringify.js create mode 100644 node_modules/json5/lib/unicode.js create mode 100644 node_modules/json5/lib/util.js create mode 100644 node_modules/json5/package.json create mode 100644 node_modules/levn/LICENSE create mode 100644 node_modules/levn/README.md create mode 100644 node_modules/levn/lib/cast.js create mode 100644 node_modules/levn/lib/index.js create mode 100644 node_modules/levn/lib/parse-string.js create mode 100644 node_modules/levn/package.json create mode 100644 node_modules/lodash.camelcase/LICENSE create mode 100644 node_modules/lodash.camelcase/README.md create mode 100644 node_modules/lodash.camelcase/index.js create mode 100644 node_modules/lodash.camelcase/package.json create mode 100644 node_modules/lodash.kebabcase/LICENSE create mode 100644 node_modules/lodash.kebabcase/README.md create mode 100644 node_modules/lodash.kebabcase/index.js create mode 100644 node_modules/lodash.kebabcase/package.json create mode 100644 node_modules/lodash.snakecase/LICENSE create mode 100644 node_modules/lodash.snakecase/README.md create mode 100644 node_modules/lodash.snakecase/index.js create mode 100644 node_modules/lodash.snakecase/package.json create mode 100644 node_modules/lodash.upperfirst/LICENSE create mode 100644 node_modules/lodash.upperfirst/README.md create mode 100644 node_modules/lodash.upperfirst/index.js create mode 100644 node_modules/lodash.upperfirst/package.json create mode 100644 node_modules/natural-compare/README.md create mode 100644 node_modules/natural-compare/index.js create mode 100644 node_modules/natural-compare/package.json create mode 100644 node_modules/object-inspect/.eslintignore create mode 100644 node_modules/object-inspect/.eslintrc create mode 100644 node_modules/object-inspect/.github/workflows/rebase.yml create mode 100644 node_modules/object-inspect/.nycrc create mode 100644 node_modules/object-inspect/.travis.yml create mode 100644 node_modules/object-inspect/LICENSE create mode 100644 node_modules/object-inspect/example/all.js create mode 100644 node_modules/object-inspect/example/circular.js create mode 100644 node_modules/object-inspect/example/fn.js create mode 100644 node_modules/object-inspect/example/inspect.js create mode 100644 node_modules/object-inspect/index.js create mode 100644 node_modules/object-inspect/package.json create mode 100644 node_modules/object-inspect/readme.markdown create mode 100644 node_modules/object-inspect/test-core-js.js create mode 100644 node_modules/object-inspect/test/bigint.js create mode 100644 node_modules/object-inspect/test/browser/dom.js create mode 100644 node_modules/object-inspect/test/circular.js create mode 100644 node_modules/object-inspect/test/deep.js create mode 100644 node_modules/object-inspect/test/element.js create mode 100644 node_modules/object-inspect/test/err.js create mode 100644 node_modules/object-inspect/test/fn.js create mode 100644 node_modules/object-inspect/test/has.js create mode 100644 node_modules/object-inspect/test/holes.js create mode 100644 node_modules/object-inspect/test/indent-option.js create mode 100644 node_modules/object-inspect/test/inspect.js create mode 100644 node_modules/object-inspect/test/lowbyte.js create mode 100644 node_modules/object-inspect/test/number.js create mode 100644 node_modules/object-inspect/test/quoteStyle.js create mode 100644 node_modules/object-inspect/test/undef.js create mode 100644 node_modules/object-inspect/test/values.js create mode 100644 node_modules/object-inspect/util.inspect.js create mode 100644 node_modules/object-keys/.editorconfig create mode 100644 node_modules/object-keys/.eslintrc create mode 100644 node_modules/object-keys/.travis.yml create mode 100644 node_modules/object-keys/CHANGELOG.md create mode 100644 node_modules/object-keys/LICENSE create mode 100644 node_modules/object-keys/README.md create mode 100644 node_modules/object-keys/implementation.js create mode 100644 node_modules/object-keys/index.js create mode 100644 node_modules/object-keys/isArguments.js create mode 100644 node_modules/object-keys/package.json create mode 100644 node_modules/object-keys/test/index.js create mode 100644 node_modules/object.assign/.editorconfig create mode 100644 node_modules/object.assign/.eslintignore create mode 100644 node_modules/object.assign/.eslintrc create mode 100644 node_modules/object.assign/.github/FUNDING.yml create mode 100644 node_modules/object.assign/.github/workflows/rebase.yml create mode 100644 node_modules/object.assign/.github/workflows/require-allow-edits.yml create mode 100644 node_modules/object.assign/CHANGELOG.md create mode 100644 node_modules/object.assign/LICENSE create mode 100644 node_modules/object.assign/README.md create mode 100644 node_modules/object.assign/auto.js create mode 100644 node_modules/object.assign/dist/browser.js create mode 100644 node_modules/object.assign/hasSymbols.js create mode 100644 node_modules/object.assign/implementation.js create mode 100644 node_modules/object.assign/index.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/.editorconfig create mode 100644 node_modules/object.assign/node_modules/es-abstract/.eslintignore create mode 100644 node_modules/object.assign/node_modules/es-abstract/.eslintrc create mode 100644 node_modules/object.assign/node_modules/es-abstract/.gitattributes create mode 100644 node_modules/object.assign/node_modules/es-abstract/.github/FUNDING.yml create mode 100644 node_modules/object.assign/node_modules/es-abstract/.github/workflows/codeql-analysis.yml create mode 100644 node_modules/object.assign/node_modules/es-abstract/.github/workflows/rebase.yml create mode 100644 node_modules/object.assign/node_modules/es-abstract/.nycrc create mode 100644 node_modules/object.assign/node_modules/es-abstract/.travis.yml create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/AbstractEqualityComparison.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/AbstractRelationalComparison.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/AdvanceStringIndex.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/ArrayCreate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/ArraySetLength.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/ArraySpeciesCreate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/Call.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/CanonicalNumericIndexString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/CompletePropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/CreateDataProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/CreateHTML.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/CreateIterResultObject.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/CreateListFromArrayLike.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/CreateMethodProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/DateFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/Day.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/DayFromYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/DayWithinYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/DaysInYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/DefinePropertyOrThrow.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/DeletePropertyOrThrow.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/EnumerableOwnNames.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/FromPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/Get.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/GetIterator.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/GetMethod.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/GetOwnPropertyKeys.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/GetPrototypeFromConstructor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/GetSubstitution.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/GetV.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/HasOwnProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/HasProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/HourFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/InLeapYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/InstanceofOperator.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/Invoke.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/IsAccessorDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/IsArray.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/IsCallable.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/IsConcatSpreadable.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/IsConstructor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/IsDataDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/IsExtensible.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/IsGenericDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/IsInteger.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/IsPromise.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/IsPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/IsPropertyKey.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/IsRegExp.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/IteratorClose.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/IteratorComplete.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/IteratorNext.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/IteratorStep.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/IteratorValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/MakeDate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/MakeDay.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/MakeTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/MinFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/MonthFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/ObjectCreate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/OrdinaryCreateFromConstructor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/OrdinaryHasInstance.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/OrdinaryHasProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/QuoteJSONString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/RegExpExec.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/RequireObjectCoercible.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/SameValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/SameValueZero.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/SecFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/Set.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/SetFunctionName.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/SetIntegrityLevel.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/SpeciesConstructor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/StrictEqualityComparison.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/SymbolDescriptiveString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/TestIntegrityLevel.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/TimeClip.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/TimeFromYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/TimeWithinDay.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/ToBoolean.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/ToDateString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/ToInt16.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/ToInt32.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/ToInt8.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/ToInteger.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/ToLength.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/ToNumber.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/ToObject.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/ToPrimitive.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/ToPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/ToPropertyKey.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/ToString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/ToUint16.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/ToUint32.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/ToUint8.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/ToUint8Clamp.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/Type.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/WeekDay.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/YearFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/abs.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/floor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/modulo.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/msFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/thisBooleanValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/thisNumberValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/thisStringValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2015/thisTimeValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/AbstractEqualityComparison.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/AbstractRelationalComparison.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/AdvanceStringIndex.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/ArrayCreate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/ArraySetLength.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/ArraySpeciesCreate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/Call.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/CanonicalNumericIndexString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/CompletePropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/CreateDataProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/CreateHTML.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/CreateIterResultObject.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/CreateListFromArrayLike.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/CreateMethodProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/DateFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/Day.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/DayFromYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/DayWithinYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/DaysInYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/DefinePropertyOrThrow.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/DeletePropertyOrThrow.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/EnumerableOwnNames.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/FromPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/Get.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/GetIterator.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/GetMethod.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/GetOwnPropertyKeys.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/GetPrototypeFromConstructor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/GetSubstitution.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/GetV.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/HasOwnProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/HasProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/HourFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/InLeapYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/InstanceofOperator.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/Invoke.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/IsAccessorDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/IsArray.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/IsCallable.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/IsConcatSpreadable.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/IsConstructor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/IsDataDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/IsExtensible.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/IsGenericDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/IsInteger.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/IsPromise.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/IsPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/IsPropertyKey.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/IsRegExp.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/IterableToArrayLike.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/IteratorClose.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/IteratorComplete.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/IteratorNext.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/IteratorStep.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/IteratorValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/MakeDate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/MakeDay.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/MakeTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/MinFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/MonthFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/ObjectCreate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/OrdinaryCreateFromConstructor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/OrdinaryHasInstance.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/OrdinaryHasProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/QuoteJSONString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/RegExpExec.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/RequireObjectCoercible.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/SameValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/SameValueNonNumber.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/SameValueZero.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/SecFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/Set.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/SetFunctionName.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/SetIntegrityLevel.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/SpeciesConstructor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/StrictEqualityComparison.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/SymbolDescriptiveString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/TestIntegrityLevel.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/TimeClip.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/TimeFromYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/TimeWithinDay.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/ToBoolean.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/ToDateString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/ToInt16.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/ToInt32.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/ToInt8.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/ToInteger.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/ToLength.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/ToNumber.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/ToObject.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/ToPrimitive.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/ToPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/ToPropertyKey.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/ToString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/ToUint16.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/ToUint32.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/ToUint8.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/ToUint8Clamp.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/Type.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/UTF16Encoding.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/WeekDay.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/YearFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/abs.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/floor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/modulo.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/msFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/thisBooleanValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/thisNumberValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/thisStringValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2016/thisTimeValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/AbstractEqualityComparison.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/AbstractRelationalComparison.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/AdvanceStringIndex.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/ArrayCreate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/ArraySetLength.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/ArraySpeciesCreate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/Call.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/CanonicalNumericIndexString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/CompletePropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/CreateDataProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/CreateHTML.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/CreateIterResultObject.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/CreateListFromArrayLike.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/CreateMethodProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/DateFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/Day.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/DayFromYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/DayWithinYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/DaysInYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/DefinePropertyOrThrow.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/DeletePropertyOrThrow.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/EnumerableOwnProperties.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/FromPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/Get.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/GetIterator.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/GetMethod.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/GetOwnPropertyKeys.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/GetPrototypeFromConstructor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/GetSubstitution.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/GetV.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/HasOwnProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/HasProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/HourFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/InLeapYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/InstanceofOperator.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/Invoke.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/IsAccessorDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/IsArray.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/IsCallable.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/IsConcatSpreadable.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/IsConstructor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/IsDataDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/IsExtensible.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/IsGenericDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/IsInteger.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/IsPromise.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/IsPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/IsPropertyKey.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/IsRegExp.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/IterableToList.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/IteratorClose.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/IteratorComplete.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/IteratorNext.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/IteratorStep.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/IteratorValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/MakeDate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/MakeDay.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/MakeTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/MinFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/MonthFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/ObjectCreate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/OrdinaryCreateFromConstructor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/OrdinaryHasInstance.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/OrdinaryHasProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/QuoteJSONString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/RegExpExec.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/RequireObjectCoercible.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/SameValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/SameValueNonNumber.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/SameValueZero.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/SecFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/Set.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/SetFunctionName.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/SetIntegrityLevel.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/SpeciesConstructor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/StrictEqualityComparison.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/StringGetOwnProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/SymbolDescriptiveString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/TestIntegrityLevel.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/TimeClip.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/TimeFromYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/TimeWithinDay.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/ToBoolean.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/ToDateString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/ToIndex.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/ToInt16.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/ToInt32.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/ToInt8.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/ToInteger.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/ToLength.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/ToNumber.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/ToObject.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/ToPrimitive.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/ToPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/ToPropertyKey.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/ToString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/ToUint16.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/ToUint32.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/ToUint8.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/ToUint8Clamp.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/Type.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/UTF16Encoding.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/WeekDay.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/YearFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/abs.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/floor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/modulo.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/msFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/thisBooleanValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/thisNumberValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/thisStringValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2017/thisTimeValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/AbstractEqualityComparison.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/AbstractRelationalComparison.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/AdvanceStringIndex.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/ArrayCreate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/ArraySetLength.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/ArraySpeciesCreate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/Call.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/CanonicalNumericIndexString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/CompletePropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/CopyDataProperties.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/CreateDataProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/CreateHTML.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/CreateIterResultObject.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/CreateListFromArrayLike.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/CreateMethodProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/DateFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/DateString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/Day.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/DayFromYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/DayWithinYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/DaysInYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/DefinePropertyOrThrow.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/DeletePropertyOrThrow.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/FromPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/Get.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/GetIterator.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/GetMethod.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/GetOwnPropertyKeys.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/GetPrototypeFromConstructor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/GetSubstitution.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/GetV.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/HasOwnProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/HasProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/HourFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/InLeapYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/InstanceofOperator.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/Invoke.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/IsAccessorDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/IsArray.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/IsCallable.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/IsConcatSpreadable.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/IsConstructor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/IsDataDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/IsExtensible.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/IsGenericDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/IsInteger.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/IsPromise.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/IsPropertyKey.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/IsRegExp.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/IsStringPrefix.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/IterableToList.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/IteratorClose.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/IteratorComplete.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/IteratorNext.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/IteratorStep.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/IteratorValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/MakeDate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/MakeDay.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/MakeTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/MinFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/MonthFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/NumberToString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/ObjectCreate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/OrdinaryCreateFromConstructor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/OrdinaryHasInstance.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/OrdinaryHasProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/PromiseResolve.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/QuoteJSONString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/RegExpExec.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/RequireObjectCoercible.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/SameValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/SameValueNonNumber.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/SameValueZero.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/SecFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/Set.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/SetFunctionLength.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/SetFunctionName.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/SetIntegrityLevel.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/SpeciesConstructor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/StrictEqualityComparison.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/StringGetOwnProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/SymbolDescriptiveString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/TestIntegrityLevel.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/TimeClip.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/TimeFromYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/TimeString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/TimeWithinDay.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/ToBoolean.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/ToDateString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/ToIndex.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/ToInt16.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/ToInt32.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/ToInt8.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/ToInteger.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/ToLength.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/ToNumber.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/ToObject.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/ToPrimitive.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/ToPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/ToPropertyKey.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/ToString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/ToUint16.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/ToUint32.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/ToUint8.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/ToUint8Clamp.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/Type.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/UTF16Encoding.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/UnicodeEscape.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/WeekDay.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/YearFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/abs.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/floor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/modulo.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/msFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/thisBooleanValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/thisNumberValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/thisStringValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/thisSymbolValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2018/thisTimeValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/AbstractEqualityComparison.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/AbstractRelationalComparison.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/AddEntriesFromIterable.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/AdvanceStringIndex.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/ArrayCreate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/ArraySetLength.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/ArraySpeciesCreate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/Call.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/CanonicalNumericIndexString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/CompletePropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/CopyDataProperties.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/CreateDataProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/CreateHTML.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/CreateIterResultObject.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/CreateListFromArrayLike.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/CreateMethodProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/DateFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/DateString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/Day.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/DayFromYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/DayWithinYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/DaysInYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/DefinePropertyOrThrow.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/DeletePropertyOrThrow.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/FlattenIntoArray.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/FromPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/Get.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/GetIterator.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/GetMethod.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/GetOwnPropertyKeys.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/GetPrototypeFromConstructor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/GetSubstitution.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/GetV.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/HasOwnProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/HasProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/HourFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/InLeapYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/InstanceofOperator.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/Invoke.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/IsAccessorDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/IsArray.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/IsCallable.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/IsConcatSpreadable.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/IsConstructor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/IsDataDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/IsExtensible.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/IsGenericDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/IsInteger.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/IsPromise.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/IsPropertyKey.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/IsRegExp.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/IsStringPrefix.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/IterableToList.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/IteratorClose.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/IteratorComplete.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/IteratorNext.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/IteratorStep.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/IteratorValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/MakeDate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/MakeDay.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/MakeTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/MinFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/MonthFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/NumberToString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/ObjectCreate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/OrdinaryCreateFromConstructor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/OrdinaryHasInstance.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/OrdinaryHasProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/PromiseResolve.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/QuoteJSONString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/RegExpExec.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/RequireObjectCoercible.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/SameValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/SameValueNonNumber.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/SameValueZero.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/SecFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/Set.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/SetFunctionLength.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/SetFunctionName.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/SetIntegrityLevel.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/SpeciesConstructor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/StrictEqualityComparison.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/StringGetOwnProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/SymbolDescriptiveString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/TestIntegrityLevel.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/TimeClip.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/TimeFromYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/TimeString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/TimeWithinDay.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/ToBoolean.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/ToDateString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/ToIndex.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/ToInt16.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/ToInt32.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/ToInt8.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/ToInteger.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/ToLength.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/ToNumber.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/ToObject.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/ToPrimitive.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/ToPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/ToPropertyKey.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/ToString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/ToUint16.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/ToUint32.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/ToUint8.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/ToUint8Clamp.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/TrimString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/Type.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/UTF16Encoding.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/UnicodeEscape.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/WeekDay.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/YearFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/abs.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/floor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/modulo.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/msFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/thisBooleanValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/thisNumberValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/thisStringValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/thisSymbolValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2019/thisTimeValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/AbstractEqualityComparison.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/AbstractRelationalComparison.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/AddEntriesFromIterable.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/AdvanceStringIndex.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/ArrayCreate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/ArraySetLength.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/ArraySpeciesCreate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/BigIntBitwiseOp.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/BinaryAnd.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/BinaryOr.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/BinaryXor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/Call.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/CanonicalNumericIndexString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/CodePointAt.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/CompletePropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/CopyDataProperties.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/CreateDataProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/CreateDataPropertyOrThrow.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/CreateHTML.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/CreateIterResultObject.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/CreateListFromArrayLike.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/CreateMethodProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/DateFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/DateString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/Day.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/DayFromYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/DayWithinYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/DaysInYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/DefinePropertyOrThrow.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/DeletePropertyOrThrow.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/EnumerableOwnPropertyNames.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/FlattenIntoArray.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/FromPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/Get.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/GetIterator.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/GetMethod.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/GetOwnPropertyKeys.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/GetPrototypeFromConstructor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/GetSubstitution.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/GetV.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/HasOwnProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/HasProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/HourFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/InLeapYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/InstanceofOperator.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/Invoke.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/IsAccessorDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/IsArray.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/IsBigIntElementType.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/IsCallable.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/IsConcatSpreadable.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/IsConstructor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/IsDataDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/IsExtensible.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/IsGenericDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/IsInteger.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/IsNoTearConfiguration.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/IsNonNegativeInteger.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/IsPromise.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/IsPropertyKey.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/IsRegExp.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/IsStringPrefix.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/IsUnclampedIntegerElementType.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/IsUnsignedElementType.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/IterableToList.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/IteratorClose.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/IteratorComplete.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/IteratorNext.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/IteratorStep.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/IteratorValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/LengthOfArrayLike.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/MakeDate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/MakeDay.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/MakeTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/MinFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/MonthFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/NumberBitwiseOp.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/OrdinaryCreateFromConstructor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/OrdinaryDefineOwnProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/OrdinaryGetOwnProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/OrdinaryGetPrototypeOf.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/OrdinaryHasInstance.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/OrdinaryHasProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/OrdinaryObjectCreate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/OrdinarySetPrototypeOf.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/PromiseResolve.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/QuoteJSONString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/RegExpExec.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/RequireObjectCoercible.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/SameValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/SameValueNonNumeric.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/SameValueZero.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/SecFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/Set.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/SetFunctionLength.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/SetFunctionName.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/SetIntegrityLevel.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/SpeciesConstructor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/StrictEqualityComparison.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/StringGetOwnProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/StringPad.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/SymbolDescriptiveString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/TestIntegrityLevel.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/TimeClip.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/TimeFromYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/TimeString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/TimeWithinDay.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/ToBoolean.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/ToDateString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/ToIndex.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/ToInt16.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/ToInt32.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/ToInt8.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/ToInteger.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/ToLength.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/ToNumber.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/ToNumeric.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/ToObject.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/ToPrimitive.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/ToPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/ToPropertyKey.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/ToString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/ToUint16.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/ToUint32.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/ToUint8.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/ToUint8Clamp.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/TrimString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/Type.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/UTF16DecodeString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/UTF16DecodeSurrogatePair.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/UTF16Encoding.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/UnicodeEscape.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/ValidateAndApplyPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/WeekDay.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/YearFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/abs.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/floor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/modulo.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/msFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/thisBigIntValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/thisBooleanValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/thisNumberValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/thisStringValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/thisSymbolValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/2020/thisTimeValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/AbstractEqualityComparison.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/AbstractRelationalComparison.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/CheckObjectCoercible.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/DateFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/Day.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/DayFromYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/DayWithinYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/DaysInYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/FromPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/HourFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/InLeapYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/IsAccessorDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/IsCallable.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/IsDataDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/IsGenericDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/IsPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/MakeDate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/MakeDay.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/MakeTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/MinFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/MonthFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/SameValue.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/SecFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/StrictEqualityComparison.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/TimeClip.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/TimeFromYear.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/TimeWithinDay.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/ToBoolean.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/ToInt32.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/ToInteger.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/ToNumber.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/ToObject.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/ToPrimitive.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/ToPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/ToString.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/ToUint16.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/ToUint32.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/Type.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/WeekDay.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/YearFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/abs.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/floor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/modulo.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/5/msFromTime.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/CHANGELOG.md create mode 100644 node_modules/object.assign/node_modules/es-abstract/GetIntrinsic.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/LICENSE create mode 100644 node_modules/object.assign/node_modules/es-abstract/README.md create mode 100644 node_modules/object.assign/node_modules/es-abstract/es2015.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/es2016.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/es2017.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/es2018.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/es2019.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/es2020.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/es5.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/es6.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/es7.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/DefineOwnProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/OwnPropertyKeys.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/assertRecord.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/assign.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/callBind.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/callBound.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/every.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/forEach.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/getInferredName.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/getIteratorMethod.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/getProto.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/getSymbolDescription.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/isFinite.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/isLeadingSurrogate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/isNaN.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/isPrefixOf.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/isPrimitive.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/isPropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/isTrailingSurrogate.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/maxSafeInteger.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/mod.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/padTimeComponent.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/regexTester.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/setProto.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/sign.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/helpers/timeConstants.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/index.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/operations/.eslintrc create mode 100644 node_modules/object.assign/node_modules/es-abstract/operations/2015.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/operations/2016.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/operations/2017.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/operations/2018.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/operations/2019.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/package.json create mode 100644 node_modules/object.assign/node_modules/es-abstract/test/GetIntrinsic.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/test/diffOps.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/test/es2015.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/test/es2016.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/test/es2017.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/test/es2018.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/test/es2019.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/test/es2020.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/test/es5.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/test/es6.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/test/es7.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/test/helpers/OwnPropertyKeys.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/test/helpers/assertRecord.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/test/helpers/createBoundESNamespace.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/test/helpers/defineProperty.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/test/helpers/getSymbolDescription.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/test/helpers/runManifestTest.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/test/helpers/values.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/test/index.js create mode 100644 node_modules/object.assign/node_modules/es-abstract/test/tests.js create mode 100644 node_modules/object.assign/package.json create mode 100644 node_modules/object.assign/polyfill.js create mode 100644 node_modules/object.assign/shim.js create mode 100644 node_modules/object.assign/test/index.js create mode 100644 node_modules/object.assign/test/native.js create mode 100644 node_modules/object.assign/test/ses-compat.js create mode 100644 node_modules/object.assign/test/shimmed.js create mode 100644 node_modules/object.assign/test/tests.js create mode 100644 node_modules/object.values/.eslintrc create mode 100644 node_modules/object.values/.github/workflows/rebase.yml create mode 100644 node_modules/object.values/.travis.yml create mode 100644 node_modules/object.values/CHANGELOG.md create mode 100644 node_modules/object.values/LICENSE create mode 100644 node_modules/object.values/README.md create mode 100644 node_modules/object.values/auto.js create mode 100644 node_modules/object.values/implementation.js create mode 100644 node_modules/object.values/index.js create mode 100644 node_modules/object.values/package.json create mode 100644 node_modules/object.values/polyfill.js create mode 100644 node_modules/object.values/shim.js create mode 100644 node_modules/object.values/test/.eslintrc create mode 100644 node_modules/object.values/test/index.js create mode 100644 node_modules/object.values/test/shimmed.js create mode 100644 node_modules/object.values/test/tests.js create mode 100644 node_modules/optionator/CHANGELOG.md create mode 100644 node_modules/optionator/LICENSE create mode 100644 node_modules/optionator/README.md create mode 100644 node_modules/optionator/lib/help.js create mode 100644 node_modules/optionator/lib/index.js create mode 100644 node_modules/optionator/lib/util.js create mode 100644 node_modules/optionator/package.json create mode 100644 node_modules/parent-module/index.js create mode 100644 node_modules/parent-module/license create mode 100644 node_modules/parent-module/package.json create mode 100644 node_modules/parent-module/readme.md create mode 100644 node_modules/prelude-ls/CHANGELOG.md create mode 100644 node_modules/prelude-ls/LICENSE create mode 100644 node_modules/prelude-ls/README.md create mode 100644 node_modules/prelude-ls/lib/Func.js create mode 100644 node_modules/prelude-ls/lib/List.js create mode 100644 node_modules/prelude-ls/lib/Num.js create mode 100644 node_modules/prelude-ls/lib/Obj.js create mode 100644 node_modules/prelude-ls/lib/Str.js create mode 100644 node_modules/prelude-ls/lib/index.js create mode 100644 node_modules/prelude-ls/package.json create mode 100644 node_modules/prettier-linter-helpers/.editorconfig create mode 100644 node_modules/prettier-linter-helpers/.eslintignore create mode 100644 node_modules/prettier-linter-helpers/.eslintrc.js create mode 100644 node_modules/prettier-linter-helpers/.github/CONTRIBUTING.md create mode 100644 node_modules/prettier-linter-helpers/.prettierignore create mode 100644 node_modules/prettier-linter-helpers/.prettierrc create mode 100644 node_modules/prettier-linter-helpers/.vscode/settings.json create mode 100644 node_modules/prettier-linter-helpers/LICENSE.md create mode 100644 node_modules/prettier-linter-helpers/README.md create mode 100644 node_modules/prettier-linter-helpers/index.js create mode 100644 node_modules/prettier-linter-helpers/package.json create mode 100644 node_modules/prettier-linter-helpers/test/index.test.js create mode 100644 node_modules/prettier/LICENSE create mode 100644 node_modules/prettier/README.md create mode 100755 node_modules/prettier/bin-prettier.js create mode 100644 node_modules/prettier/doc.js create mode 100644 node_modules/prettier/index.js create mode 100644 node_modules/prettier/package.json create mode 100644 node_modules/prettier/parser-angular.js create mode 100644 node_modules/prettier/parser-babel.js create mode 100644 node_modules/prettier/parser-flow.js create mode 100644 node_modules/prettier/parser-glimmer.js create mode 100644 node_modules/prettier/parser-graphql.js create mode 100644 node_modules/prettier/parser-html.js create mode 100644 node_modules/prettier/parser-markdown.js create mode 100644 node_modules/prettier/parser-postcss.js create mode 100644 node_modules/prettier/parser-typescript.js create mode 100644 node_modules/prettier/parser-yaml.js create mode 100644 node_modules/prettier/standalone.js create mode 100644 node_modules/prettier/third-party.js create mode 100644 node_modules/progress/CHANGELOG.md create mode 100644 node_modules/progress/LICENSE create mode 100644 node_modules/progress/Makefile create mode 100644 node_modules/progress/Readme.md create mode 100644 node_modules/progress/index.js create mode 100644 node_modules/progress/lib/node-progress.js create mode 100644 node_modules/progress/package.json create mode 100644 node_modules/punycode/LICENSE-MIT.txt create mode 100644 node_modules/punycode/README.md create mode 100644 node_modules/punycode/package.json create mode 100644 node_modules/punycode/punycode.es6.js create mode 100644 node_modules/punycode/punycode.js create mode 100644 node_modules/read-pkg-up/index.js create mode 100644 node_modules/read-pkg-up/license create mode 100644 node_modules/read-pkg-up/node_modules/find-up/index.js create mode 100644 node_modules/read-pkg-up/node_modules/find-up/license create mode 100644 node_modules/read-pkg-up/node_modules/find-up/package.json create mode 100644 node_modules/read-pkg-up/node_modules/find-up/readme.md create mode 100644 node_modules/read-pkg-up/node_modules/load-json-file/index.js create mode 100644 node_modules/read-pkg-up/node_modules/load-json-file/license create mode 100644 node_modules/read-pkg-up/node_modules/load-json-file/package.json create mode 100644 node_modules/read-pkg-up/node_modules/load-json-file/readme.md create mode 100644 node_modules/read-pkg-up/node_modules/locate-path/index.js create mode 100644 node_modules/read-pkg-up/node_modules/locate-path/license create mode 100644 node_modules/read-pkg-up/node_modules/locate-path/package.json create mode 100644 node_modules/read-pkg-up/node_modules/locate-path/readme.md create mode 100644 node_modules/read-pkg-up/node_modules/p-limit/index.js create mode 100644 node_modules/read-pkg-up/node_modules/p-limit/license create mode 100644 node_modules/read-pkg-up/node_modules/p-limit/package.json create mode 100644 node_modules/read-pkg-up/node_modules/p-limit/readme.md create mode 100644 node_modules/read-pkg-up/node_modules/p-locate/index.js create mode 100644 node_modules/read-pkg-up/node_modules/p-locate/license create mode 100644 node_modules/read-pkg-up/node_modules/p-locate/package.json create mode 100644 node_modules/read-pkg-up/node_modules/p-locate/readme.md create mode 100644 node_modules/read-pkg-up/node_modules/p-try/index.js create mode 100644 node_modules/read-pkg-up/node_modules/p-try/license create mode 100644 node_modules/read-pkg-up/node_modules/p-try/package.json create mode 100644 node_modules/read-pkg-up/node_modules/p-try/readme.md create mode 100644 node_modules/read-pkg-up/node_modules/parse-json/index.js create mode 100644 node_modules/read-pkg-up/node_modules/parse-json/license create mode 100644 node_modules/read-pkg-up/node_modules/parse-json/package.json create mode 100644 node_modules/read-pkg-up/node_modules/parse-json/readme.md create mode 100644 node_modules/read-pkg-up/node_modules/parse-json/vendor/parse.js create mode 100644 node_modules/read-pkg-up/node_modules/parse-json/vendor/unicode.js create mode 100644 node_modules/read-pkg-up/node_modules/path-exists/index.js create mode 100644 node_modules/read-pkg-up/node_modules/path-exists/license create mode 100644 node_modules/read-pkg-up/node_modules/path-exists/package.json create mode 100644 node_modules/read-pkg-up/node_modules/path-exists/readme.md create mode 100644 node_modules/read-pkg-up/node_modules/path-type/index.js create mode 100644 node_modules/read-pkg-up/node_modules/path-type/license create mode 100644 node_modules/read-pkg-up/node_modules/path-type/package.json create mode 100644 node_modules/read-pkg-up/node_modules/path-type/readme.md create mode 100644 node_modules/read-pkg-up/node_modules/pify/index.js create mode 100644 node_modules/read-pkg-up/node_modules/pify/license create mode 100644 node_modules/read-pkg-up/node_modules/pify/package.json create mode 100644 node_modules/read-pkg-up/node_modules/pify/readme.md create mode 100644 node_modules/read-pkg-up/node_modules/read-pkg/index.js create mode 100644 node_modules/read-pkg-up/node_modules/read-pkg/license create mode 100644 node_modules/read-pkg-up/node_modules/read-pkg/package.json create mode 100644 node_modules/read-pkg-up/node_modules/read-pkg/readme.md create mode 100644 node_modules/read-pkg-up/package.json create mode 100644 node_modules/read-pkg-up/readme.md create mode 100644 node_modules/regexpp/LICENSE create mode 100644 node_modules/regexpp/README.md create mode 100644 node_modules/regexpp/index.d.ts create mode 100644 node_modules/regexpp/index.js create mode 100644 node_modules/regexpp/index.js.map create mode 100644 node_modules/regexpp/index.mjs create mode 100644 node_modules/regexpp/index.mjs.map create mode 100644 node_modules/regexpp/package.json create mode 100644 node_modules/requireindex/.npmignore create mode 100644 node_modules/requireindex/.travis.yml create mode 100644 node_modules/requireindex/README.md create mode 100644 node_modules/requireindex/index.js create mode 100644 node_modules/requireindex/package.json create mode 100644 node_modules/requireindex/test/lib/.also_private/private.txt create mode 100644 node_modules/requireindex/test/lib/Foo.js create mode 100644 node_modules/requireindex/test/lib/_private.js create mode 100644 node_modules/requireindex/test/lib/bam.js create mode 100644 node_modules/requireindex/test/lib/bar/f.js create mode 100644 node_modules/requireindex/test/lib/bar/fed/again.js create mode 100644 node_modules/requireindex/test/lib/bar/fed/ignored.js create mode 100644 node_modules/requireindex/test/lib/bar/fed/index.js create mode 100644 node_modules/requireindex/test/lib/bar/fed/somemore.js create mode 100644 node_modules/requireindex/test/lib/bar/fing.js create mode 100644 node_modules/requireindex/test/lib/bar/index.js create mode 100644 node_modules/requireindex/test/lib/index.js create mode 100644 node_modules/requireindex/test/lib/not_javascript.txt create mode 100644 node_modules/requireindex/test/test.js create mode 100644 node_modules/string.prototype.trimend/.editorconfig create mode 100644 node_modules/string.prototype.trimend/.eslintrc create mode 100644 node_modules/string.prototype.trimend/.github/workflows/rebase.yml create mode 100644 node_modules/string.prototype.trimend/.travis.yml create mode 100644 node_modules/string.prototype.trimend/CHANGELOG.md create mode 100644 node_modules/string.prototype.trimend/LICENSE create mode 100644 node_modules/string.prototype.trimend/README.md create mode 100644 node_modules/string.prototype.trimend/auto.js create mode 100644 node_modules/string.prototype.trimend/implementation.js create mode 100644 node_modules/string.prototype.trimend/index.js create mode 100644 node_modules/string.prototype.trimend/package.json create mode 100644 node_modules/string.prototype.trimend/polyfill.js create mode 100644 node_modules/string.prototype.trimend/shim.js create mode 100644 node_modules/string.prototype.trimend/test/index.js create mode 100644 node_modules/string.prototype.trimend/test/shimmed.js create mode 100644 node_modules/string.prototype.trimend/test/tests.js create mode 100644 node_modules/string.prototype.trimstart/.editorconfig create mode 100644 node_modules/string.prototype.trimstart/.eslintrc create mode 100644 node_modules/string.prototype.trimstart/.github/workflows/rebase.yml create mode 100644 node_modules/string.prototype.trimstart/.travis.yml create mode 100644 node_modules/string.prototype.trimstart/CHANGELOG.md create mode 100644 node_modules/string.prototype.trimstart/LICENSE create mode 100644 node_modules/string.prototype.trimstart/README.md create mode 100644 node_modules/string.prototype.trimstart/auto.js create mode 100644 node_modules/string.prototype.trimstart/implementation.js create mode 100644 node_modules/string.prototype.trimstart/index.js create mode 100644 node_modules/string.prototype.trimstart/package.json create mode 100644 node_modules/string.prototype.trimstart/polyfill.js create mode 100644 node_modules/string.prototype.trimstart/shim.js create mode 100644 node_modules/string.prototype.trimstart/test/index.js create mode 100644 node_modules/string.prototype.trimstart/test/shimmed.js create mode 100644 node_modules/string.prototype.trimstart/test/tests.js create mode 100644 node_modules/strip-bom/index.js create mode 100644 node_modules/strip-bom/license create mode 100644 node_modules/strip-bom/package.json create mode 100644 node_modules/strip-bom/readme.md create mode 100644 node_modules/svg-element-attributes/index.json create mode 100644 node_modules/svg-element-attributes/license create mode 100644 node_modules/svg-element-attributes/package.json create mode 100644 node_modules/svg-element-attributes/readme.md create mode 100644 node_modules/table/LICENSE create mode 100644 node_modules/table/README.md create mode 100644 node_modules/table/dist/alignString.js create mode 100644 node_modules/table/dist/alignString.js.flow create mode 100644 node_modules/table/dist/alignString.js.map create mode 100644 node_modules/table/dist/alignTableData.js create mode 100644 node_modules/table/dist/alignTableData.js.flow create mode 100644 node_modules/table/dist/alignTableData.js.map create mode 100644 node_modules/table/dist/calculateCellHeight.js create mode 100644 node_modules/table/dist/calculateCellHeight.js.flow create mode 100644 node_modules/table/dist/calculateCellHeight.js.map create mode 100644 node_modules/table/dist/calculateCellWidthIndex.js create mode 100644 node_modules/table/dist/calculateCellWidthIndex.js.flow create mode 100644 node_modules/table/dist/calculateCellWidthIndex.js.map create mode 100644 node_modules/table/dist/calculateMaximumColumnWidthIndex.js create mode 100644 node_modules/table/dist/calculateMaximumColumnWidthIndex.js.flow create mode 100644 node_modules/table/dist/calculateMaximumColumnWidthIndex.js.map create mode 100644 node_modules/table/dist/calculateRowHeightIndex.js create mode 100644 node_modules/table/dist/calculateRowHeightIndex.js.flow create mode 100644 node_modules/table/dist/calculateRowHeightIndex.js.map create mode 100644 node_modules/table/dist/createStream.js create mode 100644 node_modules/table/dist/createStream.js.flow create mode 100644 node_modules/table/dist/createStream.js.map create mode 100644 node_modules/table/dist/drawBorder.js create mode 100644 node_modules/table/dist/drawBorder.js.flow create mode 100644 node_modules/table/dist/drawBorder.js.map create mode 100644 node_modules/table/dist/drawRow.js create mode 100644 node_modules/table/dist/drawRow.js.flow create mode 100644 node_modules/table/dist/drawRow.js.map create mode 100644 node_modules/table/dist/drawTable.js create mode 100644 node_modules/table/dist/drawTable.js.flow create mode 100644 node_modules/table/dist/drawTable.js.map create mode 100644 node_modules/table/dist/getBorderCharacters.js create mode 100644 node_modules/table/dist/getBorderCharacters.js.flow create mode 100644 node_modules/table/dist/getBorderCharacters.js.map create mode 100644 node_modules/table/dist/index.js create mode 100644 node_modules/table/dist/index.js.flow create mode 100644 node_modules/table/dist/index.js.map create mode 100644 node_modules/table/dist/makeConfig.js create mode 100644 node_modules/table/dist/makeConfig.js.flow create mode 100644 node_modules/table/dist/makeConfig.js.map create mode 100644 node_modules/table/dist/makeStreamConfig.js create mode 100644 node_modules/table/dist/makeStreamConfig.js.flow create mode 100644 node_modules/table/dist/makeStreamConfig.js.map create mode 100644 node_modules/table/dist/mapDataUsingRowHeightIndex.js create mode 100644 node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow create mode 100644 node_modules/table/dist/mapDataUsingRowHeightIndex.js.map create mode 100644 node_modules/table/dist/padTableData.js create mode 100644 node_modules/table/dist/padTableData.js.flow create mode 100644 node_modules/table/dist/padTableData.js.map create mode 100644 node_modules/table/dist/schemas/config.json create mode 100644 node_modules/table/dist/schemas/streamConfig.json create mode 100644 node_modules/table/dist/stringifyTableData.js create mode 100644 node_modules/table/dist/stringifyTableData.js.flow create mode 100644 node_modules/table/dist/stringifyTableData.js.map create mode 100644 node_modules/table/dist/table.js create mode 100644 node_modules/table/dist/table.js.flow create mode 100644 node_modules/table/dist/table.js.map create mode 100644 node_modules/table/dist/truncateTableData.js create mode 100644 node_modules/table/dist/truncateTableData.js.flow create mode 100644 node_modules/table/dist/truncateTableData.js.map create mode 100644 node_modules/table/dist/validateConfig.js create mode 100644 node_modules/table/dist/validateConfig.js.flow create mode 100644 node_modules/table/dist/validateConfig.js.map create mode 100644 node_modules/table/dist/validateStreamConfig.js create mode 100644 node_modules/table/dist/validateTableData.js create mode 100644 node_modules/table/dist/validateTableData.js.flow create mode 100644 node_modules/table/dist/validateTableData.js.map create mode 100644 node_modules/table/dist/wrapCell.js create mode 100644 node_modules/table/dist/wrapCell.js.flow create mode 100644 node_modules/table/dist/wrapCell.js.map create mode 100644 node_modules/table/dist/wrapString.js create mode 100644 node_modules/table/dist/wrapString.js.flow create mode 100644 node_modules/table/dist/wrapString.js.map create mode 100644 node_modules/table/dist/wrapWord.js create mode 100644 node_modules/table/dist/wrapWord.js.flow create mode 100644 node_modules/table/dist/wrapWord.js.map create mode 100644 node_modules/table/node_modules/emoji-regex/LICENSE-MIT.txt create mode 100644 node_modules/table/node_modules/emoji-regex/README.md create mode 100644 node_modules/table/node_modules/emoji-regex/es2015/index.js create mode 100644 node_modules/table/node_modules/emoji-regex/es2015/text.js create mode 100644 node_modules/table/node_modules/emoji-regex/index.d.ts create mode 100644 node_modules/table/node_modules/emoji-regex/index.js create mode 100644 node_modules/table/node_modules/emoji-regex/package.json create mode 100644 node_modules/table/node_modules/emoji-regex/text.js create mode 100644 node_modules/table/node_modules/is-fullwidth-code-point/index.js create mode 100644 node_modules/table/node_modules/is-fullwidth-code-point/license create mode 100644 node_modules/table/node_modules/is-fullwidth-code-point/package.json create mode 100644 node_modules/table/node_modules/is-fullwidth-code-point/readme.md create mode 100755 node_modules/table/node_modules/slice-ansi/index.js create mode 100644 node_modules/table/node_modules/slice-ansi/license create mode 100644 node_modules/table/node_modules/slice-ansi/package.json create mode 100644 node_modules/table/node_modules/slice-ansi/readme.md create mode 100644 node_modules/table/node_modules/string-width/index.js create mode 100644 node_modules/table/node_modules/string-width/license create mode 100644 node_modules/table/node_modules/string-width/package.json create mode 100644 node_modules/table/node_modules/string-width/readme.md create mode 100644 node_modules/table/node_modules/strip-ansi/index.d.ts create mode 100644 node_modules/table/node_modules/strip-ansi/index.js create mode 100644 node_modules/table/node_modules/strip-ansi/license create mode 100644 node_modules/table/node_modules/strip-ansi/package.json create mode 100644 node_modules/table/node_modules/strip-ansi/readme.md create mode 100644 node_modules/table/package.json create mode 100644 node_modules/text-table/.travis.yml create mode 100644 node_modules/text-table/LICENSE create mode 100644 node_modules/text-table/example/align.js create mode 100644 node_modules/text-table/example/center.js create mode 100644 node_modules/text-table/example/dotalign.js create mode 100644 node_modules/text-table/example/doubledot.js create mode 100644 node_modules/text-table/example/table.js create mode 100644 node_modules/text-table/index.js create mode 100644 node_modules/text-table/package.json create mode 100644 node_modules/text-table/readme.markdown create mode 100644 node_modules/text-table/test/align.js create mode 100644 node_modules/text-table/test/ansi-colors.js create mode 100644 node_modules/text-table/test/center.js create mode 100644 node_modules/text-table/test/dotalign.js create mode 100644 node_modules/text-table/test/doubledot.js create mode 100644 node_modules/text-table/test/table.js create mode 100644 node_modules/tsconfig-paths/.nycrc.json create mode 100644 node_modules/tsconfig-paths/CHANGELOG.md create mode 100644 node_modules/tsconfig-paths/LICENSE create mode 100644 node_modules/tsconfig-paths/README.md create mode 100644 node_modules/tsconfig-paths/lib/config-loader.d.ts create mode 100644 node_modules/tsconfig-paths/lib/config-loader.js create mode 100644 node_modules/tsconfig-paths/lib/filesystem.d.ts create mode 100644 node_modules/tsconfig-paths/lib/filesystem.js create mode 100644 node_modules/tsconfig-paths/lib/index.d.ts create mode 100644 node_modules/tsconfig-paths/lib/index.js create mode 100644 node_modules/tsconfig-paths/lib/mapping-entry.d.ts create mode 100644 node_modules/tsconfig-paths/lib/mapping-entry.js create mode 100644 node_modules/tsconfig-paths/lib/match-path-async.d.ts create mode 100644 node_modules/tsconfig-paths/lib/match-path-async.js create mode 100644 node_modules/tsconfig-paths/lib/match-path-sync.d.ts create mode 100644 node_modules/tsconfig-paths/lib/match-path-sync.js create mode 100644 node_modules/tsconfig-paths/lib/options.d.ts create mode 100644 node_modules/tsconfig-paths/lib/options.js create mode 100644 node_modules/tsconfig-paths/lib/register.d.ts create mode 100644 node_modules/tsconfig-paths/lib/register.js create mode 100644 node_modules/tsconfig-paths/lib/try-path.d.ts create mode 100644 node_modules/tsconfig-paths/lib/try-path.js create mode 100644 node_modules/tsconfig-paths/lib/tsconfig-loader.d.ts create mode 100644 node_modules/tsconfig-paths/lib/tsconfig-loader.js create mode 100644 node_modules/tsconfig-paths/package.json create mode 100644 node_modules/tsconfig-paths/register.js create mode 100644 node_modules/tsconfig-paths/test/config-loader-tests.ts create mode 100644 node_modules/tsconfig-paths/test/data/match-path-data.ts create mode 100644 node_modules/tsconfig-paths/test/filesystem-tests.ts create mode 100644 node_modules/tsconfig-paths/test/mapping-entry-test.ts create mode 100644 node_modules/tsconfig-paths/test/match-path-async-tests.ts create mode 100644 node_modules/tsconfig-paths/test/match-path-sync-tests.ts create mode 100644 node_modules/tsconfig-paths/test/mocha.opts create mode 100644 node_modules/tsconfig-paths/test/try-path-tests.ts create mode 100644 node_modules/tsconfig-paths/test/tsconfig-loader-tests.ts create mode 100644 node_modules/tsconfig-paths/test/tsconfig-named.json create mode 100644 node_modules/tsconfig-paths/test/tsconfig.json create mode 100644 node_modules/tsconfig-paths/tslint.json delete mode 100644 node_modules/tslint-eslint-rules/CHANGELOG.md delete mode 100644 node_modules/tslint-eslint-rules/LICENSE delete mode 100644 node_modules/tslint-eslint-rules/README.md delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/arrayBracketSpacingRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/blockSpacingRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/braceStyleRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/handleCallbackErrRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/noConstantConditionRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/noControlRegexRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/noDuplicateCaseRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/noEmptyCharacterClassRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/noExAssignRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/noExtraBooleanCastRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/noExtraSemiRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/noInnerDeclarationsRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/noInvalidRegexpRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/noMultiSpacesRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/noRegexSpacesRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/noUnexpectedMultilineRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/objectCurlySpacingRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/sortImportsRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/spaceInParensRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/terArrowBodyStyleRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/terArrowParensRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/terArrowSpacingRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/terComputedPropertySpacingRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/terFuncCallSpacingRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/terIndentRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/terMaxLenRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/terNewlineAfterVarRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/terNoIrregularWhitespaceRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/terNoMixedSpacesAndTabsRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/terNoProtoRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/terNoScriptUrlRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/terNoSelfCompareRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/terNoSparseArraysRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/terNoTabsRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/terPaddedBlocksRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/terPreferArrowCallbackRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/validJsdocRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/rules/validTypeofRule.js delete mode 100644 node_modules/tslint-eslint-rules/dist/support/token.js delete mode 100644 node_modules/tslint-eslint-rules/index.js delete mode 100644 node_modules/tslint-eslint-rules/node_modules/tslib/.gitattributes delete mode 100644 node_modules/tslint-eslint-rules/node_modules/tslib/CopyrightNotice.txt delete mode 100644 node_modules/tslint-eslint-rules/node_modules/tslib/LICENSE.txt delete mode 100644 node_modules/tslint-eslint-rules/node_modules/tslib/README.md delete mode 100644 node_modules/tslint-eslint-rules/node_modules/tslib/bower.json delete mode 100644 node_modules/tslint-eslint-rules/node_modules/tslib/docs/generator.md delete mode 100644 node_modules/tslint-eslint-rules/node_modules/tslib/package.json delete mode 100644 node_modules/tslint-eslint-rules/node_modules/tslib/tslib.d.ts delete mode 100644 node_modules/tslint-eslint-rules/node_modules/tslib/tslib.es6.html delete mode 100644 node_modules/tslint-eslint-rules/node_modules/tslib/tslib.es6.js delete mode 100644 node_modules/tslint-eslint-rules/node_modules/tslib/tslib.html delete mode 100644 node_modules/tslint-eslint-rules/node_modules/tslib/tslib.js delete mode 100644 node_modules/tslint-eslint-rules/package.json delete mode 100644 node_modules/tslint/.prettierrc delete mode 100644 node_modules/tslint/CHANGELOG.md delete mode 100644 node_modules/tslint/LICENSE delete mode 100644 node_modules/tslint/README.md delete mode 100755 node_modules/tslint/bin/tslint delete mode 100644 node_modules/tslint/lib/configs/all.d.ts delete mode 100644 node_modules/tslint/lib/configs/all.js delete mode 100644 node_modules/tslint/lib/configs/latest.d.ts delete mode 100644 node_modules/tslint/lib/configs/latest.js delete mode 100644 node_modules/tslint/lib/configs/recommended.d.ts delete mode 100644 node_modules/tslint/lib/configs/recommended.js delete mode 100644 node_modules/tslint/lib/configuration.d.ts delete mode 100644 node_modules/tslint/lib/configuration.js delete mode 100644 node_modules/tslint/lib/enableDisableRules.d.ts delete mode 100644 node_modules/tslint/lib/enableDisableRules.js delete mode 100644 node_modules/tslint/lib/error.d.ts delete mode 100644 node_modules/tslint/lib/error.js delete mode 100644 node_modules/tslint/lib/files/reading.d.ts delete mode 100644 node_modules/tslint/lib/files/reading.js delete mode 100644 node_modules/tslint/lib/files/resolution.d.ts delete mode 100644 node_modules/tslint/lib/files/resolution.js delete mode 100644 node_modules/tslint/lib/formatterLoader.d.ts delete mode 100644 node_modules/tslint/lib/formatterLoader.js delete mode 100644 node_modules/tslint/lib/formatters.d.ts delete mode 100644 node_modules/tslint/lib/formatters.js delete mode 100644 node_modules/tslint/lib/formatters/checkstyleFormatter.d.ts delete mode 100644 node_modules/tslint/lib/formatters/checkstyleFormatter.js delete mode 100644 node_modules/tslint/lib/formatters/codeFrameFormatter.d.ts delete mode 100644 node_modules/tslint/lib/formatters/codeFrameFormatter.js delete mode 100644 node_modules/tslint/lib/formatters/fileslistFormatter.d.ts delete mode 100644 node_modules/tslint/lib/formatters/fileslistFormatter.js delete mode 100644 node_modules/tslint/lib/formatters/index.d.ts delete mode 100644 node_modules/tslint/lib/formatters/index.js delete mode 100644 node_modules/tslint/lib/formatters/jsonFormatter.d.ts delete mode 100644 node_modules/tslint/lib/formatters/jsonFormatter.js delete mode 100644 node_modules/tslint/lib/formatters/junitFormatter.d.ts delete mode 100644 node_modules/tslint/lib/formatters/junitFormatter.js delete mode 100644 node_modules/tslint/lib/formatters/msbuildFormatter.d.ts delete mode 100644 node_modules/tslint/lib/formatters/msbuildFormatter.js delete mode 100644 node_modules/tslint/lib/formatters/pmdFormatter.d.ts delete mode 100644 node_modules/tslint/lib/formatters/pmdFormatter.js delete mode 100644 node_modules/tslint/lib/formatters/proseFormatter.d.ts delete mode 100644 node_modules/tslint/lib/formatters/proseFormatter.js delete mode 100644 node_modules/tslint/lib/formatters/stylishFormatter.d.ts delete mode 100644 node_modules/tslint/lib/formatters/stylishFormatter.js delete mode 100644 node_modules/tslint/lib/formatters/tapFormatter.d.ts delete mode 100644 node_modules/tslint/lib/formatters/tapFormatter.js delete mode 100644 node_modules/tslint/lib/formatters/verboseFormatter.d.ts delete mode 100644 node_modules/tslint/lib/formatters/verboseFormatter.js delete mode 100644 node_modules/tslint/lib/formatters/vsoFormatter.d.ts delete mode 100644 node_modules/tslint/lib/formatters/vsoFormatter.js delete mode 100644 node_modules/tslint/lib/index.d.ts delete mode 100644 node_modules/tslint/lib/index.js delete mode 100644 node_modules/tslint/lib/language/formatter/abstractFormatter.d.ts delete mode 100644 node_modules/tslint/lib/language/formatter/abstractFormatter.js delete mode 100644 node_modules/tslint/lib/language/formatter/formatter.d.ts delete mode 100644 node_modules/tslint/lib/language/formatter/formatter.js delete mode 100644 node_modules/tslint/lib/language/rule/abstractRule.d.ts delete mode 100644 node_modules/tslint/lib/language/rule/abstractRule.js delete mode 100644 node_modules/tslint/lib/language/rule/optionallyTypedRule.d.ts delete mode 100644 node_modules/tslint/lib/language/rule/optionallyTypedRule.js delete mode 100644 node_modules/tslint/lib/language/rule/rule.d.ts delete mode 100644 node_modules/tslint/lib/language/rule/rule.js delete mode 100644 node_modules/tslint/lib/language/rule/typedRule.d.ts delete mode 100644 node_modules/tslint/lib/language/rule/typedRule.js delete mode 100644 node_modules/tslint/lib/language/typeUtils.d.ts delete mode 100644 node_modules/tslint/lib/language/typeUtils.js delete mode 100644 node_modules/tslint/lib/language/utils.d.ts delete mode 100644 node_modules/tslint/lib/language/utils.js delete mode 100644 node_modules/tslint/lib/language/walker/blockScopeAwareRuleWalker.d.ts delete mode 100644 node_modules/tslint/lib/language/walker/blockScopeAwareRuleWalker.js delete mode 100644 node_modules/tslint/lib/language/walker/index.d.ts delete mode 100644 node_modules/tslint/lib/language/walker/index.js delete mode 100644 node_modules/tslint/lib/language/walker/programAwareRuleWalker.d.ts delete mode 100644 node_modules/tslint/lib/language/walker/programAwareRuleWalker.js delete mode 100644 node_modules/tslint/lib/language/walker/ruleWalker.d.ts delete mode 100644 node_modules/tslint/lib/language/walker/ruleWalker.js delete mode 100644 node_modules/tslint/lib/language/walker/scopeAwareRuleWalker.d.ts delete mode 100644 node_modules/tslint/lib/language/walker/scopeAwareRuleWalker.js delete mode 100644 node_modules/tslint/lib/language/walker/syntaxWalker.d.ts delete mode 100644 node_modules/tslint/lib/language/walker/syntaxWalker.js delete mode 100644 node_modules/tslint/lib/language/walker/walkContext.d.ts delete mode 100644 node_modules/tslint/lib/language/walker/walkContext.js delete mode 100644 node_modules/tslint/lib/language/walker/walker.d.ts delete mode 100644 node_modules/tslint/lib/language/walker/walker.js delete mode 100644 node_modules/tslint/lib/linter.d.ts delete mode 100644 node_modules/tslint/lib/linter.js delete mode 100644 node_modules/tslint/lib/ruleLoader.d.ts delete mode 100644 node_modules/tslint/lib/ruleLoader.js delete mode 100644 node_modules/tslint/lib/rules.d.ts delete mode 100644 node_modules/tslint/lib/rules.js delete mode 100644 node_modules/tslint/lib/rules/adjacentOverloadSignaturesRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/adjacentOverloadSignaturesRule.js delete mode 100644 node_modules/tslint/lib/rules/alignRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/alignRule.js delete mode 100644 node_modules/tslint/lib/rules/arrayTypeRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/arrayTypeRule.js delete mode 100644 node_modules/tslint/lib/rules/arrowParensRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/arrowParensRule.js delete mode 100644 node_modules/tslint/lib/rules/arrowReturnShorthandRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/arrowReturnShorthandRule.js delete mode 100644 node_modules/tslint/lib/rules/awaitPromiseRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/awaitPromiseRule.js delete mode 100644 node_modules/tslint/lib/rules/banCommaOperatorRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/banCommaOperatorRule.js delete mode 100644 node_modules/tslint/lib/rules/banRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/banRule.js delete mode 100644 node_modules/tslint/lib/rules/banTsIgnoreRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/banTsIgnoreRule.js delete mode 100644 node_modules/tslint/lib/rules/banTypesRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/banTypesRule.js delete mode 100644 node_modules/tslint/lib/rules/binaryExpressionOperandOrderRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/binaryExpressionOperandOrderRule.js delete mode 100644 node_modules/tslint/lib/rules/callableTypesRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/callableTypesRule.js delete mode 100644 node_modules/tslint/lib/rules/classNameRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/classNameRule.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/arrowReturnShorthand.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/arrowReturnShorthand.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/banTsIgnore.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/banTsIgnore.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/className.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/className.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/curly.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/curly.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/functionConstructor.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/functionConstructor.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/noAny.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/noAny.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/noAsyncWithoutAwait.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/noAsyncWithoutAwait.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/noEmptyInterface.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/noEmptyInterface.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/noObjectLiteralTypeAssertion.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/noObjectLiteralTypeAssertion.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/noPromiseAsBoolean.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/noPromiseAsBoolean.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/noSparseArrays.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/noSparseArrays.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/noStringThrowRule.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/noStringThrowRule.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/noUnnecessaryCallbackWrapper.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/noUnnecessaryCallbackWrapper.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/noUseBeforeDeclare.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/noUseBeforeDeclare.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/objectLiteralSortKeys.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/objectLiteralSortKeys.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/oneVariablePerDeclaration.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/oneVariablePerDeclaration.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/onlyArrowFunctions.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/onlyArrowFunctions.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/preferTemplate.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/preferTemplate.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/preferWhile.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/preferWhile.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/radix.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/radix.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/staticThis.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/staticThis.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/strictComparisons.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/strictComparisons.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/switchDefault.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/switchDefault.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/typedef.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/typedef.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/unnecessaryElse.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/unnecessaryElse.examples.js delete mode 100644 node_modules/tslint/lib/rules/code-examples/useIsnan.examples.d.ts delete mode 100644 node_modules/tslint/lib/rules/code-examples/useIsnan.examples.js delete mode 100644 node_modules/tslint/lib/rules/commentFormatRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/commentFormatRule.js delete mode 100644 node_modules/tslint/lib/rules/commentTypeRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/commentTypeRule.js delete mode 100644 node_modules/tslint/lib/rules/completed-docs/blockExclusion.d.ts delete mode 100644 node_modules/tslint/lib/rules/completed-docs/blockExclusion.js delete mode 100644 node_modules/tslint/lib/rules/completed-docs/classExclusion.d.ts delete mode 100644 node_modules/tslint/lib/rules/completed-docs/classExclusion.js delete mode 100644 node_modules/tslint/lib/rules/completed-docs/constructorExclusion.d.ts delete mode 100644 node_modules/tslint/lib/rules/completed-docs/constructorExclusion.js delete mode 100644 node_modules/tslint/lib/rules/completed-docs/exclusion.d.ts delete mode 100644 node_modules/tslint/lib/rules/completed-docs/exclusion.js delete mode 100644 node_modules/tslint/lib/rules/completed-docs/exclusionDescriptors.d.ts delete mode 100644 node_modules/tslint/lib/rules/completed-docs/exclusionDescriptors.js delete mode 100644 node_modules/tslint/lib/rules/completed-docs/exclusions.d.ts delete mode 100644 node_modules/tslint/lib/rules/completed-docs/exclusions.js delete mode 100644 node_modules/tslint/lib/rules/completed-docs/tagExclusion.d.ts delete mode 100644 node_modules/tslint/lib/rules/completed-docs/tagExclusion.js delete mode 100644 node_modules/tslint/lib/rules/completedDocsRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/completedDocsRule.js delete mode 100644 node_modules/tslint/lib/rules/curlyRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/curlyRule.js delete mode 100644 node_modules/tslint/lib/rules/cyclomaticComplexityRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/cyclomaticComplexityRule.js delete mode 100644 node_modules/tslint/lib/rules/deprecationRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/deprecationRule.js delete mode 100644 node_modules/tslint/lib/rules/encodingRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/encodingRule.js delete mode 100644 node_modules/tslint/lib/rules/eoflineRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/eoflineRule.js delete mode 100644 node_modules/tslint/lib/rules/fileHeaderRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/fileHeaderRule.js delete mode 100644 node_modules/tslint/lib/rules/fileNameCasingRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/fileNameCasingRule.js delete mode 100644 node_modules/tslint/lib/rules/forinRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/forinRule.js delete mode 100644 node_modules/tslint/lib/rules/functionConstructorRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/functionConstructorRule.js delete mode 100644 node_modules/tslint/lib/rules/importBlacklistRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/importBlacklistRule.js delete mode 100644 node_modules/tslint/lib/rules/importSpacingRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/importSpacingRule.js delete mode 100644 node_modules/tslint/lib/rules/incrementDecrementRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/incrementDecrementRule.js delete mode 100644 node_modules/tslint/lib/rules/indentRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/indentRule.js delete mode 100644 node_modules/tslint/lib/rules/interfaceNameRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/interfaceNameRule.js delete mode 100644 node_modules/tslint/lib/rules/interfaceOverTypeLiteralRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/interfaceOverTypeLiteralRule.js delete mode 100644 node_modules/tslint/lib/rules/invalidVoidRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/invalidVoidRule.js delete mode 100644 node_modules/tslint/lib/rules/jsdocFormatRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/jsdocFormatRule.js delete mode 100644 node_modules/tslint/lib/rules/labelPositionRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/labelPositionRule.js delete mode 100644 node_modules/tslint/lib/rules/linebreakStyleRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/linebreakStyleRule.js delete mode 100644 node_modules/tslint/lib/rules/matchDefaultExportNameRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/matchDefaultExportNameRule.js delete mode 100644 node_modules/tslint/lib/rules/maxClassesPerFileRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/maxClassesPerFileRule.js delete mode 100644 node_modules/tslint/lib/rules/maxFileLineCountRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/maxFileLineCountRule.js delete mode 100644 node_modules/tslint/lib/rules/maxLineLengthRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/maxLineLengthRule.js delete mode 100644 node_modules/tslint/lib/rules/memberAccessRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/memberAccessRule.js delete mode 100644 node_modules/tslint/lib/rules/memberOrderingRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/memberOrderingRule.js delete mode 100644 node_modules/tslint/lib/rules/newParensRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/newParensRule.js delete mode 100644 node_modules/tslint/lib/rules/newlineBeforeReturnRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/newlineBeforeReturnRule.js delete mode 100644 node_modules/tslint/lib/rules/newlinePerChainedCallRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/newlinePerChainedCallRule.js delete mode 100644 node_modules/tslint/lib/rules/noAngleBracketTypeAssertionRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noAngleBracketTypeAssertionRule.js delete mode 100644 node_modules/tslint/lib/rules/noAnyRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noAnyRule.js delete mode 100644 node_modules/tslint/lib/rules/noArgRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noArgRule.js delete mode 100644 node_modules/tslint/lib/rules/noAsyncWithoutAwaitRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noAsyncWithoutAwaitRule.js delete mode 100644 node_modules/tslint/lib/rules/noBitwiseRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noBitwiseRule.js delete mode 100644 node_modules/tslint/lib/rules/noBooleanLiteralCompareRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noBooleanLiteralCompareRule.js delete mode 100644 node_modules/tslint/lib/rules/noConditionalAssignmentRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noConditionalAssignmentRule.js delete mode 100644 node_modules/tslint/lib/rules/noConsecutiveBlankLinesRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noConsecutiveBlankLinesRule.js delete mode 100644 node_modules/tslint/lib/rules/noConsoleRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noConsoleRule.js delete mode 100644 node_modules/tslint/lib/rules/noConstructRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noConstructRule.js delete mode 100644 node_modules/tslint/lib/rules/noDebuggerRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noDebuggerRule.js delete mode 100644 node_modules/tslint/lib/rules/noDefaultExportRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noDefaultExportRule.js delete mode 100644 node_modules/tslint/lib/rules/noDefaultImportRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noDefaultImportRule.js delete mode 100644 node_modules/tslint/lib/rules/noDuplicateImportsRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noDuplicateImportsRule.js delete mode 100644 node_modules/tslint/lib/rules/noDuplicateSuperRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noDuplicateSuperRule.js delete mode 100644 node_modules/tslint/lib/rules/noDuplicateSwitchCaseRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noDuplicateSwitchCaseRule.js delete mode 100644 node_modules/tslint/lib/rules/noDuplicateVariableRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noDuplicateVariableRule.js delete mode 100644 node_modules/tslint/lib/rules/noDynamicDeleteRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noDynamicDeleteRule.js delete mode 100644 node_modules/tslint/lib/rules/noEmptyInterfaceRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noEmptyInterfaceRule.js delete mode 100644 node_modules/tslint/lib/rules/noEmptyRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noEmptyRule.js delete mode 100644 node_modules/tslint/lib/rules/noEvalRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noEvalRule.js delete mode 100644 node_modules/tslint/lib/rules/noFloatingPromisesRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noFloatingPromisesRule.js delete mode 100644 node_modules/tslint/lib/rules/noForInArrayRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noForInArrayRule.js delete mode 100644 node_modules/tslint/lib/rules/noForInRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noForInRule.js delete mode 100644 node_modules/tslint/lib/rules/noImplicitDependenciesRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noImplicitDependenciesRule.js delete mode 100644 node_modules/tslint/lib/rules/noImportSideEffectRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noImportSideEffectRule.js delete mode 100644 node_modules/tslint/lib/rules/noInferrableTypesRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noInferrableTypesRule.js delete mode 100644 node_modules/tslint/lib/rules/noInferredEmptyObjectTypeRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noInferredEmptyObjectTypeRule.js delete mode 100644 node_modules/tslint/lib/rules/noInternalModuleRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noInternalModuleRule.js delete mode 100644 node_modules/tslint/lib/rules/noInvalidTemplateStringsRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noInvalidTemplateStringsRule.js delete mode 100644 node_modules/tslint/lib/rules/noInvalidThisRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noInvalidThisRule.js delete mode 100644 node_modules/tslint/lib/rules/noIrregularWhitespaceRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noIrregularWhitespaceRule.js delete mode 100644 node_modules/tslint/lib/rules/noMagicNumbersRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noMagicNumbersRule.js delete mode 100644 node_modules/tslint/lib/rules/noMergeableNamespaceRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noMergeableNamespaceRule.js delete mode 100644 node_modules/tslint/lib/rules/noMisusedNewRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noMisusedNewRule.js delete mode 100644 node_modules/tslint/lib/rules/noNamespaceRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noNamespaceRule.js delete mode 100644 node_modules/tslint/lib/rules/noNonNullAssertionRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noNonNullAssertionRule.js delete mode 100644 node_modules/tslint/lib/rules/noNullKeywordRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noNullKeywordRule.js delete mode 100644 node_modules/tslint/lib/rules/noNullUndefinedUnionRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noNullUndefinedUnionRule.js delete mode 100644 node_modules/tslint/lib/rules/noObjectLiteralTypeAssertionRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noObjectLiteralTypeAssertionRule.js delete mode 100644 node_modules/tslint/lib/rules/noParameterPropertiesRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noParameterPropertiesRule.js delete mode 100644 node_modules/tslint/lib/rules/noParameterReassignmentRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noParameterReassignmentRule.js delete mode 100644 node_modules/tslint/lib/rules/noPromiseAsBooleanRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noPromiseAsBooleanRule.js delete mode 100644 node_modules/tslint/lib/rules/noRedundantJsdocRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noRedundantJsdocRule.js delete mode 100644 node_modules/tslint/lib/rules/noReferenceImportRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noReferenceImportRule.js delete mode 100644 node_modules/tslint/lib/rules/noReferenceRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noReferenceRule.js delete mode 100644 node_modules/tslint/lib/rules/noRequireImportsRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noRequireImportsRule.js delete mode 100644 node_modules/tslint/lib/rules/noRestrictedGlobalsRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noRestrictedGlobalsRule.js delete mode 100644 node_modules/tslint/lib/rules/noReturnAwaitRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noReturnAwaitRule.js delete mode 100644 node_modules/tslint/lib/rules/noShadowedVariableRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noShadowedVariableRule.js delete mode 100644 node_modules/tslint/lib/rules/noSparseArraysRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noSparseArraysRule.js delete mode 100644 node_modules/tslint/lib/rules/noStringLiteralRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noStringLiteralRule.js delete mode 100644 node_modules/tslint/lib/rules/noStringThrowRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noStringThrowRule.js delete mode 100644 node_modules/tslint/lib/rules/noSubmoduleImportsRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noSubmoduleImportsRule.js delete mode 100644 node_modules/tslint/lib/rules/noSwitchCaseFallThroughRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noSwitchCaseFallThroughRule.js delete mode 100644 node_modules/tslint/lib/rules/noTautologyExpressionRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noTautologyExpressionRule.js delete mode 100644 node_modules/tslint/lib/rules/noThisAssignmentRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noThisAssignmentRule.js delete mode 100644 node_modules/tslint/lib/rules/noTrailingWhitespaceRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noTrailingWhitespaceRule.js delete mode 100644 node_modules/tslint/lib/rules/noUnboundMethodRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noUnboundMethodRule.js delete mode 100644 node_modules/tslint/lib/rules/noUnnecessaryCallbackWrapperRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noUnnecessaryCallbackWrapperRule.js delete mode 100644 node_modules/tslint/lib/rules/noUnnecessaryClassRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noUnnecessaryClassRule.js delete mode 100644 node_modules/tslint/lib/rules/noUnnecessaryInitializerRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noUnnecessaryInitializerRule.js delete mode 100644 node_modules/tslint/lib/rules/noUnnecessaryQualifierRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noUnnecessaryQualifierRule.js delete mode 100644 node_modules/tslint/lib/rules/noUnnecessaryTypeAssertionRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noUnnecessaryTypeAssertionRule.js delete mode 100644 node_modules/tslint/lib/rules/noUnsafeAnyRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noUnsafeAnyRule.js delete mode 100644 node_modules/tslint/lib/rules/noUnsafeFinallyRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noUnsafeFinallyRule.js delete mode 100644 node_modules/tslint/lib/rules/noUnusedExpressionRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noUnusedExpressionRule.js delete mode 100644 node_modules/tslint/lib/rules/noUnusedVariableRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noUnusedVariableRule.js delete mode 100644 node_modules/tslint/lib/rules/noUseBeforeDeclareRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noUseBeforeDeclareRule.js delete mode 100644 node_modules/tslint/lib/rules/noVarKeywordRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noVarKeywordRule.js delete mode 100644 node_modules/tslint/lib/rules/noVarRequiresRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noVarRequiresRule.js delete mode 100644 node_modules/tslint/lib/rules/noVoidExpressionRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/noVoidExpressionRule.js delete mode 100644 node_modules/tslint/lib/rules/numberLiteralFormatRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/numberLiteralFormatRule.js delete mode 100644 node_modules/tslint/lib/rules/objectLiteralKeyQuotesRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/objectLiteralKeyQuotesRule.js delete mode 100644 node_modules/tslint/lib/rules/objectLiteralShorthandRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/objectLiteralShorthandRule.js delete mode 100644 node_modules/tslint/lib/rules/objectLiteralSortKeysRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/objectLiteralSortKeysRule.js delete mode 100644 node_modules/tslint/lib/rules/oneLineRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/oneLineRule.js delete mode 100644 node_modules/tslint/lib/rules/oneVariablePerDeclarationRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/oneVariablePerDeclarationRule.js delete mode 100644 node_modules/tslint/lib/rules/onlyArrowFunctionsRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/onlyArrowFunctionsRule.js delete mode 100644 node_modules/tslint/lib/rules/orderedImportsRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/orderedImportsRule.js delete mode 100644 node_modules/tslint/lib/rules/preferConditionalExpressionRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/preferConditionalExpressionRule.js delete mode 100644 node_modules/tslint/lib/rules/preferConstRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/preferConstRule.js delete mode 100644 node_modules/tslint/lib/rules/preferForOfRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/preferForOfRule.js delete mode 100644 node_modules/tslint/lib/rules/preferFunctionOverMethodRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/preferFunctionOverMethodRule.js delete mode 100644 node_modules/tslint/lib/rules/preferMethodSignatureRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/preferMethodSignatureRule.js delete mode 100644 node_modules/tslint/lib/rules/preferObjectSpreadRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/preferObjectSpreadRule.js delete mode 100644 node_modules/tslint/lib/rules/preferReadonlyRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/preferReadonlyRule.js delete mode 100644 node_modules/tslint/lib/rules/preferSwitchRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/preferSwitchRule.js delete mode 100644 node_modules/tslint/lib/rules/preferTemplateRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/preferTemplateRule.js delete mode 100644 node_modules/tslint/lib/rules/preferWhileRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/preferWhileRule.js delete mode 100644 node_modules/tslint/lib/rules/promiseFunctionAsyncRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/promiseFunctionAsyncRule.js delete mode 100644 node_modules/tslint/lib/rules/quotemarkRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/quotemarkRule.js delete mode 100644 node_modules/tslint/lib/rules/radixRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/radixRule.js delete mode 100644 node_modules/tslint/lib/rules/restrictPlusOperandsRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/restrictPlusOperandsRule.js delete mode 100644 node_modules/tslint/lib/rules/returnUndefinedRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/returnUndefinedRule.js delete mode 100644 node_modules/tslint/lib/rules/semicolonRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/semicolonRule.js delete mode 100644 node_modules/tslint/lib/rules/spaceBeforeFunctionParenRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/spaceBeforeFunctionParenRule.js delete mode 100644 node_modules/tslint/lib/rules/spaceWithinParensRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/spaceWithinParensRule.js delete mode 100644 node_modules/tslint/lib/rules/staticThisRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/staticThisRule.js delete mode 100644 node_modules/tslint/lib/rules/strictBooleanExpressionsRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/strictBooleanExpressionsRule.js delete mode 100644 node_modules/tslint/lib/rules/strictComparisonsRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/strictComparisonsRule.js delete mode 100644 node_modules/tslint/lib/rules/strictStringExpressionsRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/strictStringExpressionsRule.js delete mode 100644 node_modules/tslint/lib/rules/strictTypePredicatesRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/strictTypePredicatesRule.js delete mode 100644 node_modules/tslint/lib/rules/switchDefaultRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/switchDefaultRule.js delete mode 100644 node_modules/tslint/lib/rules/switchFinalBreakRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/switchFinalBreakRule.js delete mode 100644 node_modules/tslint/lib/rules/trailingCommaRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/trailingCommaRule.js delete mode 100644 node_modules/tslint/lib/rules/tripleEqualsRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/tripleEqualsRule.js delete mode 100644 node_modules/tslint/lib/rules/typeLiteralDelimiterRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/typeLiteralDelimiterRule.js delete mode 100644 node_modules/tslint/lib/rules/typedefRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/typedefRule.js delete mode 100644 node_modules/tslint/lib/rules/typedefWhitespaceRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/typedefWhitespaceRule.js delete mode 100644 node_modules/tslint/lib/rules/typeofCompareRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/typeofCompareRule.js delete mode 100644 node_modules/tslint/lib/rules/unifiedSignaturesRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/unifiedSignaturesRule.js delete mode 100644 node_modules/tslint/lib/rules/unnecessaryBindRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/unnecessaryBindRule.js delete mode 100644 node_modules/tslint/lib/rules/unnecessaryConstructorRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/unnecessaryConstructorRule.js delete mode 100644 node_modules/tslint/lib/rules/unnecessaryElseRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/unnecessaryElseRule.js delete mode 100644 node_modules/tslint/lib/rules/useDefaultTypeParameterRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/useDefaultTypeParameterRule.js delete mode 100644 node_modules/tslint/lib/rules/useIsnanRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/useIsnanRule.js delete mode 100644 node_modules/tslint/lib/rules/variableNameRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/variableNameRule.js delete mode 100644 node_modules/tslint/lib/rules/whitespaceRule.d.ts delete mode 100644 node_modules/tslint/lib/rules/whitespaceRule.js delete mode 100644 node_modules/tslint/lib/runner.d.ts delete mode 100644 node_modules/tslint/lib/runner.js delete mode 100644 node_modules/tslint/lib/test.d.ts delete mode 100644 node_modules/tslint/lib/test.js delete mode 100644 node_modules/tslint/lib/tslintCli.d.ts delete mode 100644 node_modules/tslint/lib/tslintCli.js delete mode 100644 node_modules/tslint/lib/utils.d.ts delete mode 100644 node_modules/tslint/lib/utils.js delete mode 100644 node_modules/tslint/lib/verify/lines.d.ts delete mode 100644 node_modules/tslint/lib/verify/lines.js delete mode 100644 node_modules/tslint/lib/verify/lintError.d.ts delete mode 100644 node_modules/tslint/lib/verify/lintError.js delete mode 100644 node_modules/tslint/lib/verify/parse.d.ts delete mode 100644 node_modules/tslint/lib/verify/parse.js delete mode 120000 node_modules/tslint/node_modules/.bin/semver delete mode 100644 node_modules/tslint/node_modules/commander/CHANGELOG.md delete mode 100644 node_modules/tslint/node_modules/commander/LICENSE delete mode 100644 node_modules/tslint/node_modules/commander/Readme.md delete mode 100644 node_modules/tslint/node_modules/commander/index.js delete mode 100644 node_modules/tslint/node_modules/commander/package.json delete mode 100644 node_modules/tslint/node_modules/commander/typings/index.d.ts delete mode 100644 node_modules/tslint/node_modules/semver/CHANGELOG.md delete mode 100644 node_modules/tslint/node_modules/semver/README.md delete mode 100755 node_modules/tslint/node_modules/semver/bin/semver delete mode 100644 node_modules/tslint/node_modules/semver/package.json delete mode 100644 node_modules/tslint/node_modules/semver/range.bnf delete mode 100644 node_modules/tslint/node_modules/semver/semver.js delete mode 100644 node_modules/tslint/package.json delete mode 100644 node_modules/tslint/tslint-vscode.json delete mode 100644 node_modules/tsutils/CHANGELOG.md delete mode 100644 node_modules/tsutils/README.md delete mode 100644 node_modules/tsutils/index.js delete mode 100644 node_modules/tsutils/package.json delete mode 100644 node_modules/tsutils/typeguard/2.8/index.js delete mode 100644 node_modules/tsutils/typeguard/2.8/node.d.ts delete mode 100644 node_modules/tsutils/typeguard/2.8/node.js delete mode 100644 node_modules/tsutils/typeguard/2.8/type.js delete mode 100644 node_modules/tsutils/typeguard/2.9/index.js delete mode 100644 node_modules/tsutils/typeguard/2.9/node.js delete mode 100644 node_modules/tsutils/typeguard/2.9/type.js delete mode 100644 node_modules/tsutils/typeguard/3.0/index.js delete mode 100644 node_modules/tsutils/typeguard/3.0/node.js delete mode 100644 node_modules/tsutils/typeguard/3.0/type.d.ts delete mode 100644 node_modules/tsutils/typeguard/3.0/type.js delete mode 100644 node_modules/tsutils/typeguard/index.js delete mode 100644 node_modules/tsutils/typeguard/next/index.js delete mode 100644 node_modules/tsutils/typeguard/next/node.d.ts delete mode 100644 node_modules/tsutils/typeguard/next/node.js delete mode 100644 node_modules/tsutils/typeguard/next/type.js delete mode 100644 node_modules/tsutils/typeguard/node.d.ts delete mode 100644 node_modules/tsutils/typeguard/node.js delete mode 100644 node_modules/tsutils/typeguard/type.d.ts delete mode 100644 node_modules/tsutils/typeguard/type.js delete mode 100644 node_modules/tsutils/util/control-flow.js delete mode 100644 node_modules/tsutils/util/convert-ast.js delete mode 100644 node_modules/tsutils/util/index.js delete mode 100644 node_modules/tsutils/util/type.d.ts delete mode 100644 node_modules/tsutils/util/type.js delete mode 100644 node_modules/tsutils/util/usage.js delete mode 100644 node_modules/tsutils/util/util.d.ts delete mode 100644 node_modules/tsutils/util/util.js delete mode 100644 node_modules/tsutils/yarn.lock create mode 100644 node_modules/type-check/LICENSE create mode 100644 node_modules/type-check/README.md create mode 100644 node_modules/type-check/lib/check.js create mode 100644 node_modules/type-check/lib/index.js create mode 100644 node_modules/type-check/lib/parse-type.js create mode 100644 node_modules/type-check/package.json create mode 100644 node_modules/type-fest/index.d.ts create mode 100644 node_modules/type-fest/license create mode 100644 node_modules/type-fest/package.json create mode 100644 node_modules/type-fest/readme.md create mode 100644 node_modules/type-fest/source/basic.d.ts create mode 100644 node_modules/type-fest/source/except.d.ts create mode 100644 node_modules/type-fest/source/literal-union.d.ts create mode 100644 node_modules/type-fest/source/merge-exclusive.d.ts create mode 100644 node_modules/type-fest/source/merge.d.ts create mode 100644 node_modules/type-fest/source/mutable.d.ts create mode 100644 node_modules/type-fest/source/opaque.d.ts create mode 100644 node_modules/type-fest/source/package-json.d.ts create mode 100644 node_modules/type-fest/source/partial-deep.d.ts create mode 100644 node_modules/type-fest/source/promisable.d.ts create mode 100644 node_modules/type-fest/source/readonly-deep.d.ts create mode 100644 node_modules/type-fest/source/require-at-least-one.d.ts create mode 100644 node_modules/type-fest/source/require-exactly-one.d.ts create mode 100644 node_modules/type-fest/source/set-optional.d.ts create mode 100644 node_modules/type-fest/source/set-required.d.ts create mode 100755 node_modules/uri-js/LICENSE create mode 100755 node_modules/uri-js/README.md create mode 100755 node_modules/uri-js/dist/es5/uri.all.d.ts create mode 100755 node_modules/uri-js/dist/es5/uri.all.js create mode 100755 node_modules/uri-js/dist/es5/uri.all.js.map create mode 100755 node_modules/uri-js/dist/es5/uri.all.min.d.ts create mode 100755 node_modules/uri-js/dist/es5/uri.all.min.js create mode 100755 node_modules/uri-js/dist/es5/uri.all.min.js.map create mode 100755 node_modules/uri-js/dist/esnext/index.d.ts create mode 100755 node_modules/uri-js/dist/esnext/index.js create mode 100755 node_modules/uri-js/dist/esnext/index.js.map create mode 100755 node_modules/uri-js/dist/esnext/regexps-iri.d.ts create mode 100755 node_modules/uri-js/dist/esnext/regexps-iri.js create mode 100755 node_modules/uri-js/dist/esnext/regexps-iri.js.map create mode 100755 node_modules/uri-js/dist/esnext/regexps-uri.d.ts create mode 100755 node_modules/uri-js/dist/esnext/regexps-uri.js create mode 100755 node_modules/uri-js/dist/esnext/regexps-uri.js.map create mode 100755 node_modules/uri-js/dist/esnext/schemes/http.d.ts create mode 100755 node_modules/uri-js/dist/esnext/schemes/http.js create mode 100755 node_modules/uri-js/dist/esnext/schemes/http.js.map create mode 100755 node_modules/uri-js/dist/esnext/schemes/https.d.ts create mode 100755 node_modules/uri-js/dist/esnext/schemes/https.js create mode 100755 node_modules/uri-js/dist/esnext/schemes/https.js.map create mode 100755 node_modules/uri-js/dist/esnext/schemes/mailto.d.ts create mode 100755 node_modules/uri-js/dist/esnext/schemes/mailto.js create mode 100755 node_modules/uri-js/dist/esnext/schemes/mailto.js.map create mode 100755 node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts create mode 100755 node_modules/uri-js/dist/esnext/schemes/urn-uuid.js create mode 100755 node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map create mode 100755 node_modules/uri-js/dist/esnext/schemes/urn.d.ts create mode 100755 node_modules/uri-js/dist/esnext/schemes/urn.js create mode 100755 node_modules/uri-js/dist/esnext/schemes/urn.js.map create mode 100755 node_modules/uri-js/dist/esnext/schemes/ws.d.ts create mode 100755 node_modules/uri-js/dist/esnext/schemes/ws.js create mode 100755 node_modules/uri-js/dist/esnext/schemes/ws.js.map create mode 100755 node_modules/uri-js/dist/esnext/schemes/wss.d.ts create mode 100755 node_modules/uri-js/dist/esnext/schemes/wss.js create mode 100755 node_modules/uri-js/dist/esnext/schemes/wss.js.map create mode 100755 node_modules/uri-js/dist/esnext/uri.d.ts create mode 100755 node_modules/uri-js/dist/esnext/uri.js create mode 100755 node_modules/uri-js/dist/esnext/uri.js.map create mode 100755 node_modules/uri-js/dist/esnext/util.d.ts create mode 100755 node_modules/uri-js/dist/esnext/util.js create mode 100755 node_modules/uri-js/dist/esnext/util.js.map create mode 100755 node_modules/uri-js/package.json create mode 100755 node_modules/uri-js/yarn.lock create mode 100644 node_modules/v8-compile-cache/CHANGELOG.md create mode 100644 node_modules/v8-compile-cache/LICENSE create mode 100644 node_modules/v8-compile-cache/README.md create mode 100644 node_modules/v8-compile-cache/package.json create mode 100644 node_modules/v8-compile-cache/v8-compile-cache.js create mode 100644 node_modules/word-wrap/LICENSE create mode 100644 node_modules/word-wrap/README.md create mode 100644 node_modules/word-wrap/index.d.ts create mode 100644 node_modules/word-wrap/index.js create mode 100644 node_modules/word-wrap/package.json create mode 100644 node_modules/write/LICENSE create mode 100644 node_modules/write/README.md create mode 100644 node_modules/write/index.js create mode 100644 node_modules/write/package.json diff --git a/node_modules/.bin/eslint b/node_modules/.bin/eslint new file mode 120000 index 000000000..810e4bcb3 --- /dev/null +++ b/node_modules/.bin/eslint @@ -0,0 +1 @@ +../eslint/bin/eslint.js \ No newline at end of file diff --git a/node_modules/.bin/eslint-config-prettier-check b/node_modules/.bin/eslint-config-prettier-check new file mode 120000 index 000000000..7d29baaae --- /dev/null +++ b/node_modules/.bin/eslint-config-prettier-check @@ -0,0 +1 @@ +../eslint-config-prettier/bin/cli.js \ No newline at end of file diff --git a/node_modules/.bin/eslint-ignore-errors b/node_modules/.bin/eslint-ignore-errors new file mode 120000 index 000000000..6267ea25a --- /dev/null +++ b/node_modules/.bin/eslint-ignore-errors @@ -0,0 +1 @@ +../eslint-plugin-github/bin/eslint-ignore-errors.js \ No newline at end of file diff --git a/node_modules/.bin/json5 b/node_modules/.bin/json5 new file mode 120000 index 000000000..217f37981 --- /dev/null +++ b/node_modules/.bin/json5 @@ -0,0 +1 @@ +../json5/lib/cli.js \ No newline at end of file diff --git a/node_modules/.bin/prettier b/node_modules/.bin/prettier new file mode 120000 index 000000000..a478df383 --- /dev/null +++ b/node_modules/.bin/prettier @@ -0,0 +1 @@ +../prettier/bin-prettier.js \ No newline at end of file diff --git a/node_modules/.bin/tslint b/node_modules/.bin/tslint deleted file mode 120000 index 7d8df7440..000000000 --- a/node_modules/.bin/tslint +++ /dev/null @@ -1 +0,0 @@ -../tslint/bin/tslint \ No newline at end of file diff --git a/node_modules/@eslint/eslintrc/CHANGELOG.md b/node_modules/@eslint/eslintrc/CHANGELOG.md new file mode 100644 index 000000000..1e39a092e --- /dev/null +++ b/node_modules/@eslint/eslintrc/CHANGELOG.md @@ -0,0 +1,4 @@ +v0.1.3 - September 1, 2020 + +* [`8647a61`](https://github.com/eslint/eslintrc/commit/8647a61991fe121f923d33e96232475209b78210) Fix: version number and eslint-release version (refs #6) (Nicholas C. Zakas) + diff --git a/node_modules/@eslint/eslintrc/LICENSE b/node_modules/@eslint/eslintrc/LICENSE new file mode 100644 index 000000000..f9556ee61 --- /dev/null +++ b/node_modules/@eslint/eslintrc/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 ESLint + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@eslint/eslintrc/README.md b/node_modules/@eslint/eslintrc/README.md new file mode 100644 index 000000000..cd65564e6 --- /dev/null +++ b/node_modules/@eslint/eslintrc/README.md @@ -0,0 +1,21 @@ +# ESLintRC Library + +This repository contains the legacy ESLintRC configuration file format for ESLint. + +**Note:** This package is not intended for use outside of the ESLint ecosystem. It is ESLint-specific and not intended for use in other programs. + +## Usage + +You can install the package as follows: + +``` +npm install @eslint/eslintrc --save-dev + +# or + +yarn add @eslint/eslintrc -D +``` + +## License + +MIT License diff --git a/node_modules/@eslint/eslintrc/conf/category-list.json b/node_modules/@eslint/eslintrc/conf/category-list.json new file mode 100644 index 000000000..cd3b816b6 --- /dev/null +++ b/node_modules/@eslint/eslintrc/conf/category-list.json @@ -0,0 +1,39 @@ +{ + "categories": [ + { "name": "Possible Errors", "description": "These rules relate to possible syntax or logic errors in JavaScript code:" }, + { "name": "Best Practices", "description": "These rules relate to better ways of doing things to help you avoid problems:" }, + { "name": "Strict Mode", "description": "These rules relate to strict mode directives:" }, + { "name": "Variables", "description": "These rules relate to variable declarations:" }, + { "name": "Stylistic Issues", "description": "These rules relate to style guidelines, and are therefore quite subjective:" }, + { "name": "ECMAScript 6", "description": "These rules relate to ES6, also known as ES2015:" } + ], + "deprecated": { + "name": "Deprecated", + "description": "These rules have been deprecated in accordance with the deprecation policy, and replaced by newer rules:", + "rules": [] + }, + "removed": { + "name": "Removed", + "description": "These rules from older versions of ESLint (before the deprecation policy existed) have been replaced by newer rules:", + "rules": [ + { "removed": "generator-star", "replacedBy": ["generator-star-spacing"] }, + { "removed": "global-strict", "replacedBy": ["strict"] }, + { "removed": "no-arrow-condition", "replacedBy": ["no-confusing-arrow", "no-constant-condition"] }, + { "removed": "no-comma-dangle", "replacedBy": ["comma-dangle"] }, + { "removed": "no-empty-class", "replacedBy": ["no-empty-character-class"] }, + { "removed": "no-empty-label", "replacedBy": ["no-labels"] }, + { "removed": "no-extra-strict", "replacedBy": ["strict"] }, + { "removed": "no-reserved-keys", "replacedBy": ["quote-props"] }, + { "removed": "no-space-before-semi", "replacedBy": ["semi-spacing"] }, + { "removed": "no-wrap-func", "replacedBy": ["no-extra-parens"] }, + { "removed": "space-after-function-name", "replacedBy": ["space-before-function-paren"] }, + { "removed": "space-after-keywords", "replacedBy": ["keyword-spacing"] }, + { "removed": "space-before-function-parentheses", "replacedBy": ["space-before-function-paren"] }, + { "removed": "space-before-keywords", "replacedBy": ["keyword-spacing"] }, + { "removed": "space-in-brackets", "replacedBy": ["object-curly-spacing", "array-bracket-spacing"] }, + { "removed": "space-return-throw-case", "replacedBy": ["keyword-spacing"] }, + { "removed": "space-unary-word-ops", "replacedBy": ["space-unary-ops"] }, + { "removed": "spaced-line-comment", "replacedBy": ["spaced-comment"] } + ] + } +} diff --git a/node_modules/@eslint/eslintrc/conf/config-schema.js b/node_modules/@eslint/eslintrc/conf/config-schema.js new file mode 100644 index 000000000..712fc4235 --- /dev/null +++ b/node_modules/@eslint/eslintrc/conf/config-schema.js @@ -0,0 +1,81 @@ +/** + * @fileoverview Defines a schema for configs. + * @author Sylvan Mably + */ + +"use strict"; + +const baseConfigProperties = { + $schema: { type: "string" }, + 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" }, + ignorePatterns: { $ref: "#/definitions/stringOrStrings" }, + ...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; diff --git a/node_modules/@eslint/eslintrc/conf/default-cli-options.js b/node_modules/@eslint/eslintrc/conf/default-cli-options.js new file mode 100644 index 000000000..e09a829d1 --- /dev/null +++ b/node_modules/@eslint/eslintrc/conf/default-cli-options.js @@ -0,0 +1,31 @@ +/** + * @fileoverview Default CLIEngineOptions. + * @author Ian VanSchooten + */ + +"use strict"; + +module.exports = { + configFile: null, + baseConfig: false, + rulePaths: [], + useEslintrc: true, + envs: [], + globals: [], + extensions: null, + ignore: true, + ignorePath: void 0, + cache: false, + + /* + * in order to honor the cacheFile option if specified + * this option should not have a default value otherwise + * it will always be used + */ + cacheLocation: "", + cacheFile: ".eslintcache", + fix: false, + allowInlineConfig: true, + reportUnusedDisableDirectives: void 0, + globInputPaths: true +}; diff --git a/node_modules/@eslint/eslintrc/conf/environments.js b/node_modules/@eslint/eslintrc/conf/environments.js new file mode 100644 index 000000000..d3237c725 --- /dev/null +++ b/node_modules/@eslint/eslintrc/conf/environments.js @@ -0,0 +1,179 @@ +/** + * @fileoverview Defines environment settings and globals. + * @author Elan Shanker + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const globals = require("globals"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Get the object that has difference. + * @param {Record} current The newer object. + * @param {Record} prev The older object. + * @returns {Record} The difference object. + */ +function getDiff(current, prev) { + const retv = {}; + + for (const [key, value] of Object.entries(current)) { + if (!Object.hasOwnProperty.call(prev, key)) { + retv[key] = value; + } + } + + return retv; +} + +const newGlobals2015 = getDiff(globals.es2015, globals.es5); // 19 variables such as Promise, Map, ... +const newGlobals2017 = { + Atomics: false, + SharedArrayBuffer: false +}; +const newGlobals2020 = { + BigInt: false, + BigInt64Array: false, + BigUint64Array: false, + globalThis: false +}; + +const newGlobals2021 = { + FinalizationRegistry: false, + WeakRef: false +}; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** @type {Map} */ +module.exports = new Map(Object.entries({ + + // Language + builtin: { + globals: globals.es5 + }, + es6: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 6 + } + }, + es2015: { + globals: newGlobals2015, + parserOptions: { + ecmaVersion: 6 + } + }, + es2017: { + globals: { ...newGlobals2015, ...newGlobals2017 }, + parserOptions: { + ecmaVersion: 8 + } + }, + es2020: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 }, + parserOptions: { + ecmaVersion: 11 + } + }, + es2021: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 12 + } + }, + + // Platforms + browser: { + globals: globals.browser + }, + node: { + globals: globals.node, + parserOptions: { + ecmaFeatures: { + globalReturn: true + } + } + }, + "shared-node-browser": { + globals: globals["shared-node-browser"] + }, + worker: { + globals: globals.worker + }, + serviceworker: { + globals: globals.serviceworker + }, + + // Frameworks + commonjs: { + globals: globals.commonjs, + parserOptions: { + ecmaFeatures: { + globalReturn: true + } + } + }, + amd: { + globals: globals.amd + }, + mocha: { + globals: globals.mocha + }, + jasmine: { + globals: globals.jasmine + }, + jest: { + globals: globals.jest + }, + phantomjs: { + globals: globals.phantomjs + }, + jquery: { + globals: globals.jquery + }, + qunit: { + globals: globals.qunit + }, + prototypejs: { + globals: globals.prototypejs + }, + shelljs: { + globals: globals.shelljs + }, + meteor: { + globals: globals.meteor + }, + mongo: { + globals: globals.mongo + }, + protractor: { + globals: globals.protractor + }, + applescript: { + globals: globals.applescript + }, + nashorn: { + globals: globals.nashorn + }, + atomtest: { + globals: globals.atomtest + }, + embertest: { + globals: globals.embertest + }, + webextensions: { + globals: globals.webextensions + }, + greasemonkey: { + globals: globals.greasemonkey + } +})); diff --git a/node_modules/@eslint/eslintrc/conf/eslint-all.js b/node_modules/@eslint/eslintrc/conf/eslint-all.js new file mode 100644 index 000000000..cdd8a3e47 --- /dev/null +++ b/node_modules/@eslint/eslintrc/conf/eslint-all.js @@ -0,0 +1,32 @@ +/** + * @fileoverview Config to enable all rules. + * @author Robert Fletcher + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +// FIXME: "../lib/rules" doesn't exist in this package +const builtInRules = require("../lib/rules"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const allRules = {}; + +for (const [ruleId, rule] of builtInRules) { + if (!rule.meta.deprecated) { + allRules[ruleId] = "error"; + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** @type {import("../lib/shared/types").ConfigData} */ +module.exports = { rules: allRules }; diff --git a/node_modules/@eslint/eslintrc/conf/eslint-recommended.js b/node_modules/@eslint/eslintrc/conf/eslint-recommended.js new file mode 100644 index 000000000..2137685fb --- /dev/null +++ b/node_modules/@eslint/eslintrc/conf/eslint-recommended.js @@ -0,0 +1,72 @@ +/** + * @fileoverview Configuration applied when a user configuration extends from + * eslint:recommended. + * @author Nicholas C. Zakas + */ + +"use strict"; + +/* eslint sort-keys: ["error", "asc"] */ + +/** @type {import("../lib/shared/types").ConfigData} */ +module.exports = { + rules: { + "constructor-super": "error", + "for-direction": "error", + "getter-return": "error", + "no-async-promise-executor": "error", + "no-case-declarations": "error", + "no-class-assign": "error", + "no-compare-neg-zero": "error", + "no-cond-assign": "error", + "no-const-assign": "error", + "no-constant-condition": "error", + "no-control-regex": "error", + "no-debugger": "error", + "no-delete-var": "error", + "no-dupe-args": "error", + "no-dupe-class-members": "error", + "no-dupe-else-if": "error", + "no-dupe-keys": "error", + "no-duplicate-case": "error", + "no-empty": "error", + "no-empty-character-class": "error", + "no-empty-pattern": "error", + "no-ex-assign": "error", + "no-extra-boolean-cast": "error", + "no-extra-semi": "error", + "no-fallthrough": "error", + "no-func-assign": "error", + "no-global-assign": "error", + "no-import-assign": "error", + "no-inner-declarations": "error", + "no-invalid-regexp": "error", + "no-irregular-whitespace": "error", + "no-misleading-character-class": "error", + "no-mixed-spaces-and-tabs": "error", + "no-new-symbol": "error", + "no-obj-calls": "error", + "no-octal": "error", + "no-prototype-builtins": "error", + "no-redeclare": "error", + "no-regex-spaces": "error", + "no-self-assign": "error", + "no-setter-return": "error", + "no-shadow-restricted-names": "error", + "no-sparse-arrays": "error", + "no-this-before-super": "error", + "no-undef": "error", + "no-unexpected-multiline": "error", + "no-unreachable": "error", + "no-unsafe-finally": "error", + "no-unsafe-negation": "error", + "no-unused-labels": "error", + "no-unused-vars": "error", + "no-useless-catch": "error", + "no-useless-escape": "error", + "no-with": "error", + "require-yield": "error", + "use-isnan": "error", + "valid-typeof": "error" + } +}; diff --git a/node_modules/@eslint/eslintrc/conf/replacements.json b/node_modules/@eslint/eslintrc/conf/replacements.json new file mode 100644 index 000000000..c047811e6 --- /dev/null +++ b/node_modules/@eslint/eslintrc/conf/replacements.json @@ -0,0 +1,22 @@ +{ + "rules": { + "generator-star": ["generator-star-spacing"], + "global-strict": ["strict"], + "no-arrow-condition": ["no-confusing-arrow", "no-constant-condition"], + "no-comma-dangle": ["comma-dangle"], + "no-empty-class": ["no-empty-character-class"], + "no-empty-label": ["no-labels"], + "no-extra-strict": ["strict"], + "no-reserved-keys": ["quote-props"], + "no-space-before-semi": ["semi-spacing"], + "no-wrap-func": ["no-extra-parens"], + "space-after-function-name": ["space-before-function-paren"], + "space-after-keywords": ["keyword-spacing"], + "space-before-function-parentheses": ["space-before-function-paren"], + "space-before-keywords": ["keyword-spacing"], + "space-in-brackets": ["object-curly-spacing", "array-bracket-spacing", "computed-property-spacing"], + "space-return-throw-case": ["keyword-spacing"], + "space-unary-word-ops": ["space-unary-ops"], + "spaced-line-comment": ["spaced-comment"] + } +} diff --git a/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js b/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js new file mode 100644 index 000000000..a6933964e --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js @@ -0,0 +1,501 @@ +/** + * @fileoverview `CascadingConfigArrayFactory` class. + * + * `CascadingConfigArrayFactory` class has a responsibility: + * + * 1. Handles cascading of config files. + * + * It provides two methods: + * + * - `getConfigArrayForFile(filePath)` + * Get the corresponded configuration of a given file. This method doesn't + * throw even if the given file didn't exist. + * - `clearCache()` + * Clear the internal cache. You have to call this method when + * `additionalPluginPool` was updated if `baseConfig` or `cliConfig` depends + * on the additional plugins. (`CLIEngine#addPlugin()` method calls this.) + * + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const os = require("os"); +const path = require("path"); +const ConfigValidator = require("./shared/config-validator"); +const { emitDeprecationWarning } = require("./shared/deprecation-warnings"); +const { ConfigArrayFactory } = require("./config-array-factory"); +const { ConfigArray, ConfigDependency, IgnorePattern } = require("./config-array"); +const debug = require("debug")("eslintrc:cascading-config-array-factory"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +// Define types for VSCode IntelliSense. +/** @typedef {import("../shared/types").ConfigData} ConfigData */ +/** @typedef {import("../shared/types").Parser} Parser */ +/** @typedef {import("../shared/types").Plugin} Plugin */ +/** @typedef {ReturnType} ConfigArray */ + +/** + * @typedef {Object} CascadingConfigArrayFactoryOptions + * @property {Map} [additionalPluginPool] The map for additional plugins. + * @property {ConfigData} [baseConfig] The config by `baseConfig` option. + * @property {ConfigData} [cliConfig] The config by CLI options (`--env`, `--global`, `--ignore-pattern`, `--parser`, `--parser-options`, `--plugin`, and `--rule`). CLI options overwrite the setting in config files. + * @property {string} [cwd] The base directory to start lookup. + * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`. + * @property {string[]} [rulePaths] The value of `--rulesdir` option. + * @property {string} [specificConfigPath] The value of `--config` option. + * @property {boolean} [useEslintrc] if `false` then it doesn't load config files. + */ + +/** + * @typedef {Object} CascadingConfigArrayFactoryInternalSlots + * @property {ConfigArray} baseConfigArray The config array of `baseConfig` option. + * @property {ConfigData} baseConfigData The config data of `baseConfig` option. This is used to reset `baseConfigArray`. + * @property {ConfigArray} cliConfigArray The config array of CLI options. + * @property {ConfigData} cliConfigData The config data of CLI options. This is used to reset `cliConfigArray`. + * @property {ConfigArrayFactory} configArrayFactory The factory for config arrays. + * @property {Map} configCache The cache from directory paths to config arrays. + * @property {string} cwd The base directory to start lookup. + * @property {WeakMap} finalizeCache The cache from config arrays to finalized config arrays. + * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`. + * @property {string[]|null} rulePaths The value of `--rulesdir` option. This is used to reset `baseConfigArray`. + * @property {string|null} specificConfigPath The value of `--config` option. This is used to reset `cliConfigArray`. + * @property {boolean} useEslintrc if `false` then it doesn't load config files. + */ + +/** @type {WeakMap} */ +const internalSlotsMap = new WeakMap(); + +/** + * Create the config array from `baseConfig` and `rulePaths`. + * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots. + * @returns {ConfigArray} The config array of the base configs. + */ +function createBaseConfigArray({ + configArrayFactory, + baseConfigData, + rulePaths, + cwd, + loadRules +}) { + const baseConfigArray = configArrayFactory.create( + baseConfigData, + { name: "BaseConfig" } + ); + + /* + * Create the config array element for the default ignore patterns. + * This element has `ignorePattern` property that ignores the default + * patterns in the current working directory. + */ + baseConfigArray.unshift(configArrayFactory.create( + { ignorePatterns: IgnorePattern.DefaultPatterns }, + { name: "DefaultIgnorePattern" } + )[0]); + + /* + * Load rules `--rulesdir` option as a pseudo plugin. + * Use a pseudo plugin to define rules of `--rulesdir`, so we can validate + * the rule's options with only information in the config array. + */ + if (rulePaths && rulePaths.length > 0) { + baseConfigArray.push({ + type: "config", + name: "--rulesdir", + filePath: "", + plugins: { + "": new ConfigDependency({ + definition: { + rules: rulePaths.reduce( + (map, rulesPath) => Object.assign( + map, + loadRules(rulesPath, cwd) + ), + {} + ) + }, + filePath: "", + id: "", + importerName: "--rulesdir", + importerPath: "" + }) + } + }); + } + + return baseConfigArray; +} + +/** + * Create the config array from CLI options. + * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots. + * @returns {ConfigArray} The config array of the base configs. + */ +function createCLIConfigArray({ + cliConfigData, + configArrayFactory, + cwd, + ignorePath, + specificConfigPath +}) { + const cliConfigArray = configArrayFactory.create( + cliConfigData, + { name: "CLIOptions" } + ); + + cliConfigArray.unshift( + ...(ignorePath + ? configArrayFactory.loadESLintIgnore(ignorePath) + : configArrayFactory.loadDefaultESLintIgnore()) + ); + + if (specificConfigPath) { + cliConfigArray.unshift( + ...configArrayFactory.loadFile( + specificConfigPath, + { name: "--config", basePath: cwd } + ) + ); + } + + return cliConfigArray; +} + +/** + * The error type when there are files matched by a glob, but all of them have been ignored. + */ +class ConfigurationNotFoundError extends Error { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {string} directoryPath The directory path. + */ + constructor(directoryPath) { + super(`No ESLint configuration found in ${directoryPath}.`); + this.messageTemplate = "no-config-found"; + this.messageData = { directoryPath }; + } +} + +/** + * This class provides the functionality that enumerates every file which is + * matched by given glob patterns and that configuration. + */ +class CascadingConfigArrayFactory { + + /** + * Initialize this enumerator. + * @param {CascadingConfigArrayFactoryOptions} options The options. + */ + constructor({ + additionalPluginPool = new Map(), + baseConfig: baseConfigData = null, + cliConfig: cliConfigData = null, + cwd = process.cwd(), + ignorePath, + resolvePluginsRelativeTo, + rulePaths = [], + specificConfigPath = null, + useEslintrc = true, + builtInRules = new Map(), + loadRules, + resolver + } = {}) { + const configArrayFactory = new ConfigArrayFactory({ + additionalPluginPool, + cwd, + resolvePluginsRelativeTo, + builtInRules, + resolver + }); + + internalSlotsMap.set(this, { + baseConfigArray: createBaseConfigArray({ + baseConfigData, + configArrayFactory, + cwd, + rulePaths, + loadRules, + resolver + }), + baseConfigData, + cliConfigArray: createCLIConfigArray({ + cliConfigData, + configArrayFactory, + cwd, + ignorePath, + specificConfigPath + }), + cliConfigData, + configArrayFactory, + configCache: new Map(), + cwd, + finalizeCache: new WeakMap(), + ignorePath, + rulePaths, + specificConfigPath, + useEslintrc + }); + } + + /** + * The path to the current working directory. + * This is used by tests. + * @type {string} + */ + get cwd() { + const { cwd } = internalSlotsMap.get(this); + + return cwd; + } + + /** + * Get the config array of a given file. + * If `filePath` was not given, it returns the config which contains only + * `baseConfigData` and `cliConfigData`. + * @param {string} [filePath] The file path to a file. + * @param {Object} [options] The options. + * @param {boolean} [options.ignoreNotFoundError] If `true` then it doesn't throw `ConfigurationNotFoundError`. + * @returns {ConfigArray} The config array of the file. + */ + getConfigArrayForFile(filePath, { ignoreNotFoundError = false } = {}) { + const { + baseConfigArray, + cliConfigArray, + cwd + } = internalSlotsMap.get(this); + + if (!filePath) { + return new ConfigArray(...baseConfigArray, ...cliConfigArray); + } + + const directoryPath = path.dirname(path.resolve(cwd, filePath)); + + debug(`Load config files for ${directoryPath}.`); + + return this._finalizeConfigArray( + this._loadConfigInAncestors(directoryPath), + directoryPath, + ignoreNotFoundError + ); + } + + /** + * Set the config data to override all configs. + * Require to call `clearCache()` method after this method is called. + * @param {ConfigData} configData The config data to override all configs. + * @returns {void} + */ + setOverrideConfig(configData) { + const slots = internalSlotsMap.get(this); + + slots.cliConfigData = configData; + } + + /** + * Clear config cache. + * @returns {void} + */ + clearCache() { + const slots = internalSlotsMap.get(this); + + slots.baseConfigArray = createBaseConfigArray(slots); + slots.cliConfigArray = createCLIConfigArray(slots); + slots.configCache.clear(); + } + + /** + * Load and normalize config files from the ancestor directories. + * @param {string} directoryPath The path to a leaf directory. + * @param {boolean} configsExistInSubdirs `true` if configurations exist in subdirectories. + * @returns {ConfigArray} The loaded config. + * @private + */ + _loadConfigInAncestors(directoryPath, configsExistInSubdirs = false) { + const { + baseConfigArray, + configArrayFactory, + configCache, + cwd, + useEslintrc + } = internalSlotsMap.get(this); + + if (!useEslintrc) { + return baseConfigArray; + } + + let configArray = configCache.get(directoryPath); + + // Hit cache. + if (configArray) { + debug(`Cache hit: ${directoryPath}.`); + return configArray; + } + debug(`No cache found: ${directoryPath}.`); + + const homePath = os.homedir(); + + // Consider this is root. + if (directoryPath === homePath && cwd !== homePath) { + debug("Stop traversing because of considered root."); + if (configsExistInSubdirs) { + const filePath = ConfigArrayFactory.getPathToConfigFileInDirectory(directoryPath); + + if (filePath) { + emitDeprecationWarning( + filePath, + "ESLINT_PERSONAL_CONFIG_SUPPRESS" + ); + } + } + return this._cacheConfig(directoryPath, baseConfigArray); + } + + // Load the config on this directory. + try { + configArray = configArrayFactory.loadInDirectory(directoryPath); + } catch (error) { + /* istanbul ignore next */ + if (error.code === "EACCES") { + debug("Stop traversing because of 'EACCES' error."); + return this._cacheConfig(directoryPath, baseConfigArray); + } + throw error; + } + + if (configArray.length > 0 && configArray.isRoot()) { + debug("Stop traversing because of 'root:true'."); + configArray.unshift(...baseConfigArray); + return this._cacheConfig(directoryPath, configArray); + } + + // Load from the ancestors and merge it. + const parentPath = path.dirname(directoryPath); + const parentConfigArray = parentPath && parentPath !== directoryPath + ? this._loadConfigInAncestors( + parentPath, + configsExistInSubdirs || configArray.length > 0 + ) + : baseConfigArray; + + if (configArray.length > 0) { + configArray.unshift(...parentConfigArray); + } else { + configArray = parentConfigArray; + } + + // Cache and return. + return this._cacheConfig(directoryPath, configArray); + } + + /** + * Freeze and cache a given config. + * @param {string} directoryPath The path to a directory as a cache key. + * @param {ConfigArray} configArray The config array as a cache value. + * @returns {ConfigArray} The `configArray` (frozen). + */ + _cacheConfig(directoryPath, configArray) { + const { configCache } = internalSlotsMap.get(this); + + Object.freeze(configArray); + configCache.set(directoryPath, configArray); + + return configArray; + } + + /** + * Finalize a given config array. + * Concatenate `--config` and other CLI options. + * @param {ConfigArray} configArray The parent config array. + * @param {string} directoryPath The path to the leaf directory to find config files. + * @param {boolean} ignoreNotFoundError If `true` then it doesn't throw `ConfigurationNotFoundError`. + * @returns {ConfigArray} The loaded config. + * @private + */ + _finalizeConfigArray(configArray, directoryPath, ignoreNotFoundError) { + const { + cliConfigArray, + configArrayFactory, + finalizeCache, + useEslintrc + } = internalSlotsMap.get(this); + + let finalConfigArray = finalizeCache.get(configArray); + + if (!finalConfigArray) { + finalConfigArray = configArray; + + // Load the personal config if there are no regular config files. + if ( + useEslintrc && + configArray.every(c => !c.filePath) && + cliConfigArray.every(c => !c.filePath) // `--config` option can be a file. + ) { + const homePath = os.homedir(); + + debug("Loading the config file of the home directory:", homePath); + + const personalConfigArray = configArrayFactory.loadInDirectory( + homePath, + { name: "PersonalConfig" } + ); + + if ( + personalConfigArray.length > 0 && + !directoryPath.startsWith(homePath) + ) { + const lastElement = + personalConfigArray[personalConfigArray.length - 1]; + + emitDeprecationWarning( + lastElement.filePath, + "ESLINT_PERSONAL_CONFIG_LOAD" + ); + } + + finalConfigArray = finalConfigArray.concat(personalConfigArray); + } + + // Apply CLI options. + if (cliConfigArray.length > 0) { + finalConfigArray = finalConfigArray.concat(cliConfigArray); + } + + // Validate rule settings and environments. + const validator = new ConfigValidator({ + builtInRules: configArrayFactory.builtInRules + }); + + validator.validateConfigArray(finalConfigArray); + + // Cache it. + Object.freeze(finalConfigArray); + finalizeCache.set(configArray, finalConfigArray); + + debug( + "Configuration was determined: %o on %s", + finalConfigArray, + directoryPath + ); + } + + // At least one element (the default ignore patterns) exists. + if (!ignoreNotFoundError && useEslintrc && finalConfigArray.length <= 1) { + throw new ConfigurationNotFoundError(directoryPath); + } + + return finalConfigArray; + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { CascadingConfigArrayFactory }; diff --git a/node_modules/@eslint/eslintrc/lib/config-array-factory.js b/node_modules/@eslint/eslintrc/lib/config-array-factory.js new file mode 100644 index 000000000..97f8b5cb2 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/config-array-factory.js @@ -0,0 +1,1080 @@ +/** + * @fileoverview The factory of `ConfigArray` objects. + * + * This class provides methods to create `ConfigArray` instance. + * + * - `create(configData, options)` + * Create a `ConfigArray` instance from a config data. This is to handle CLI + * options except `--config`. + * - `loadFile(filePath, options)` + * Create a `ConfigArray` instance from a config file. This is to handle + * `--config` option. If the file was not found, throws the following error: + * - If the filename was `*.js`, a `MODULE_NOT_FOUND` error. + * - If the filename was `package.json`, an IO error or an + * `ESLINT_CONFIG_FIELD_NOT_FOUND` error. + * - Otherwise, an IO error such as `ENOENT`. + * - `loadInDirectory(directoryPath, options)` + * Create a `ConfigArray` instance from a config file which is on a given + * directory. This tries to load `.eslintrc.*` or `package.json`. If not + * found, returns an empty `ConfigArray`. + * - `loadESLintIgnore(filePath)` + * Create a `ConfigArray` instance from a config file that is `.eslintignore` + * format. This is to handle `--ignore-path` option. + * - `loadDefaultESLintIgnore()` + * Create a `ConfigArray` instance from `.eslintignore` or `package.json` in + * the current working directory. + * + * `ConfigArrayFactory` class has the responsibility that loads configuration + * files, including loading `extends`, `parser`, and `plugins`. The created + * `ConfigArray` instance has the loaded `extends`, `parser`, and `plugins`. + * + * But this class doesn't handle cascading. `CascadingConfigArrayFactory` class + * handles cascading and hierarchy. + * + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const fs = require("fs"); +const path = require("path"); +const importFresh = require("import-fresh"); +const stripComments = require("strip-json-comments"); +const ConfigValidator = require("./shared/config-validator"); +const naming = require("./shared/naming"); +const ModuleResolver = require("./shared/relative-module-resolver"); +const { + ConfigArray, + ConfigDependency, + IgnorePattern, + OverrideTester +} = require("./config-array"); +const debug = require("debug")("eslintrc:config-array-factory"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const eslintRecommendedPath = path.resolve(__dirname, "../../eslint/conf/eslint-recommended.js"); +const eslintAllPath = path.resolve(__dirname, "../../eslint/conf/eslint-all.js"); +const configFilenames = [ + ".eslintrc.js", + ".eslintrc.cjs", + ".eslintrc.yaml", + ".eslintrc.yml", + ".eslintrc.json", + ".eslintrc", + "package.json" +]; + +// Define types for VSCode IntelliSense. +/** @typedef {import("../shared/types").ConfigData} ConfigData */ +/** @typedef {import("../shared/types").OverrideConfigData} OverrideConfigData */ +/** @typedef {import("../shared/types").Parser} Parser */ +/** @typedef {import("../shared/types").Plugin} Plugin */ +/** @typedef {import("./config-array/config-dependency").DependentParser} DependentParser */ +/** @typedef {import("./config-array/config-dependency").DependentPlugin} DependentPlugin */ +/** @typedef {ConfigArray[0]} ConfigArrayElement */ + +/** + * @typedef {Object} ConfigArrayFactoryOptions + * @property {Map} [additionalPluginPool] The map for additional plugins. + * @property {string} [cwd] The path to the current working directory. + * @property {string} [resolvePluginsRelativeTo] A path to the directory that plugins should be resolved from. Defaults to `cwd`. + */ + +/** + * @typedef {Object} ConfigArrayFactoryInternalSlots + * @property {Map} additionalPluginPool The map for additional plugins. + * @property {string} cwd The path to the current working directory. + * @property {string | undefined} resolvePluginsRelativeTo An absolute path the the directory that plugins should be resolved from. + */ + +/** + * @typedef {Object} ConfigArrayFactoryLoadingContext + * @property {string} filePath The path to the current configuration. + * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @property {string} name The name of the current configuration. + * @property {string} pluginBasePath The base path to resolve plugins. + * @property {"config" | "ignore" | "implicit-processor"} type The type of the current configuration. This is `"config"` in normal. This is `"ignore"` if it came from `.eslintignore`. This is `"implicit-processor"` if it came from legacy file-extension processors. + */ + +/** + * @typedef {Object} ConfigArrayFactoryLoadingContext + * @property {string} filePath The path to the current configuration. + * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @property {string} name The name of the current configuration. + * @property {"config" | "ignore" | "implicit-processor"} type The type of the current configuration. This is `"config"` in normal. This is `"ignore"` if it came from `.eslintignore`. This is `"implicit-processor"` if it came from legacy file-extension processors. + */ + +/** @type {WeakMap} */ +const internalSlotsMap = new WeakMap(); + +/** + * Check if a given string is a file path. + * @param {string} nameOrPath A module name or file path. + * @returns {boolean} `true` if the `nameOrPath` is a file path. + */ +function isFilePath(nameOrPath) { + return ( + /^\.{1,2}[/\\]/u.test(nameOrPath) || + path.isAbsolute(nameOrPath) + ); +} + +/** + * Convenience wrapper for synchronously reading file contents. + * @param {string} filePath The filename to read. + * @returns {string} The file contents, with the BOM removed. + * @private + */ +function readFile(filePath) { + return fs.readFileSync(filePath, "utf8").replace(/^\ufeff/u, ""); +} + +/** + * Loads a YAML configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadYAMLConfigFile(filePath) { + debug(`Loading YAML config file: ${filePath}`); + + // lazy load YAML to improve performance when not used + const yaml = require("js-yaml"); + + try { + + // empty YAML file can be null, so always use + return yaml.safeLoad(readFile(filePath)) || {}; + } catch (e) { + debug(`Error reading YAML file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a JSON configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadJSONConfigFile(filePath) { + debug(`Loading JSON config file: ${filePath}`); + + try { + return JSON.parse(stripComments(readFile(filePath))); + } catch (e) { + debug(`Error reading JSON file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + e.messageTemplate = "failed-to-read-json"; + e.messageData = { + path: filePath, + message: e.message + }; + throw e; + } +} + +/** + * Loads a legacy (.eslintrc) configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadLegacyConfigFile(filePath) { + debug(`Loading legacy config file: ${filePath}`); + + // lazy load YAML to improve performance when not used + const yaml = require("js-yaml"); + + try { + return yaml.safeLoad(stripComments(readFile(filePath))) || /* istanbul ignore next */ {}; + } catch (e) { + debug("Error reading YAML file: %s\n%o", filePath, e); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a JavaScript configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadJSConfigFile(filePath) { + debug(`Loading JS config file: ${filePath}`); + try { + return importFresh(filePath); + } catch (e) { + debug(`Error reading JavaScript file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a configuration from a package.json file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadPackageJSONConfigFile(filePath) { + debug(`Loading package.json config file: ${filePath}`); + try { + const packageData = loadJSONConfigFile(filePath); + + if (!Object.hasOwnProperty.call(packageData, "eslintConfig")) { + throw Object.assign( + new Error("package.json file doesn't have 'eslintConfig' field."), + { code: "ESLINT_CONFIG_FIELD_NOT_FOUND" } + ); + } + + return packageData.eslintConfig; + } catch (e) { + debug(`Error reading package.json file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a `.eslintignore` from a file. + * @param {string} filePath The filename to load. + * @returns {string[]} The ignore patterns from the file. + * @private + */ +function loadESLintIgnoreFile(filePath) { + debug(`Loading .eslintignore file: ${filePath}`); + + try { + return readFile(filePath) + .split(/\r?\n/gu) + .filter(line => line.trim() !== "" && !line.startsWith("#")); + } catch (e) { + debug(`Error reading .eslintignore file: ${filePath}`); + e.message = `Cannot read .eslintignore file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Creates an error to notify about a missing config to extend from. + * @param {string} configName The name of the missing config. + * @param {string} importerName The name of the config that imported the missing config + * @returns {Error} The error object to throw + * @private + */ +function configMissingError(configName, importerName) { + return Object.assign( + new Error(`Failed to load config "${configName}" to extend from.`), + { + messageTemplate: "extend-config-missing", + messageData: { configName, importerName } + } + ); +} + +/** + * Loads a configuration file regardless of the source. Inspects the file path + * to determine the correctly way to load the config file. + * @param {string} filePath The path to the configuration. + * @returns {ConfigData|null} The configuration information. + * @private + */ +function loadConfigFile(filePath) { + switch (path.extname(filePath)) { + case ".js": + case ".cjs": + return loadJSConfigFile(filePath); + + case ".json": + if (path.basename(filePath) === "package.json") { + return loadPackageJSONConfigFile(filePath); + } + return loadJSONConfigFile(filePath); + + case ".yaml": + case ".yml": + return loadYAMLConfigFile(filePath); + + default: + return loadLegacyConfigFile(filePath); + } +} + +/** + * Write debug log. + * @param {string} request The requested module name. + * @param {string} relativeTo The file path to resolve the request relative to. + * @param {string} filePath The resolved file path. + * @returns {void} + */ +function writeDebugLogForLoading(request, relativeTo, filePath) { + /* istanbul ignore next */ + if (debug.enabled) { + let nameAndVersion = null; + + try { + const packageJsonPath = ModuleResolver.resolve( + `${request}/package.json`, + relativeTo + ); + const { version = "unknown" } = require(packageJsonPath); + + nameAndVersion = `${request}@${version}`; + } catch (error) { + debug("package.json was not found:", error.message); + nameAndVersion = request; + } + + debug("Loaded: %s (%s)", nameAndVersion, filePath); + } +} + +/** + * Create a new context with default values. + * @param {ConfigArrayFactoryInternalSlots} slots The internal slots. + * @param {"config" | "ignore" | "implicit-processor" | undefined} providedType The type of the current configuration. Default is `"config"`. + * @param {string | undefined} providedName The name of the current configuration. Default is the relative path from `cwd` to `filePath`. + * @param {string | undefined} providedFilePath The path to the current configuration. Default is empty string. + * @param {string | undefined} providedMatchBasePath The type of the current configuration. Default is the directory of `filePath` or `cwd`. + * @returns {ConfigArrayFactoryLoadingContext} The created context. + */ +function createContext( + { cwd, resolvePluginsRelativeTo }, + providedType, + providedName, + providedFilePath, + providedMatchBasePath +) { + const filePath = providedFilePath + ? path.resolve(cwd, providedFilePath) + : ""; + const matchBasePath = + (providedMatchBasePath && path.resolve(cwd, providedMatchBasePath)) || + (filePath && path.dirname(filePath)) || + cwd; + const name = + providedName || + (filePath && path.relative(cwd, filePath)) || + ""; + const pluginBasePath = + resolvePluginsRelativeTo || + (filePath && path.dirname(filePath)) || + cwd; + const type = providedType || "config"; + + return { filePath, matchBasePath, name, pluginBasePath, type }; +} + +/** + * Normalize a given plugin. + * - Ensure the object to have four properties: configs, environments, processors, and rules. + * - Ensure the object to not have other properties. + * @param {Plugin} plugin The plugin to normalize. + * @returns {Plugin} The normalized plugin. + */ +function normalizePlugin(plugin) { + return { + configs: plugin.configs || {}, + environments: plugin.environments || {}, + processors: plugin.processors || {}, + rules: plugin.rules || {} + }; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * The factory of `ConfigArray` objects. + */ +class ConfigArrayFactory { + + /** + * Initialize this instance. + * @param {ConfigArrayFactoryOptions} [options] The map for additional plugins. + */ + constructor({ + additionalPluginPool = new Map(), + cwd = process.cwd(), + resolvePluginsRelativeTo, + builtInRules, + resolver = ModuleResolver + } = {}) { + internalSlotsMap.set(this, { + additionalPluginPool, + cwd, + resolvePluginsRelativeTo: + resolvePluginsRelativeTo && + path.resolve(cwd, resolvePluginsRelativeTo), + builtInRules, + resolver + }); + } + + /** + * Create `ConfigArray` instance from a config data. + * @param {ConfigData|null} configData The config data to create. + * @param {Object} [options] The options. + * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @param {string} [options.filePath] The path to this config data. + * @param {string} [options.name] The config name. + * @returns {ConfigArray} Loaded config. + */ + create(configData, { basePath, filePath, name } = {}) { + if (!configData) { + return new ConfigArray(); + } + + const slots = internalSlotsMap.get(this); + const ctx = createContext(slots, "config", name, filePath, basePath); + const elements = this._normalizeConfigData(configData, ctx); + + return new ConfigArray(...elements); + } + + /** + * Load a config file. + * @param {string} filePath The path to a config file. + * @param {Object} [options] The options. + * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @param {string} [options.name] The config name. + * @returns {ConfigArray} Loaded config. + */ + loadFile(filePath, { basePath, name } = {}) { + const slots = internalSlotsMap.get(this); + const ctx = createContext(slots, "config", name, filePath, basePath); + + return new ConfigArray(...this._loadConfigData(ctx)); + } + + /** + * Load the config file on a given directory if exists. + * @param {string} directoryPath The path to a directory. + * @param {Object} [options] The options. + * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @param {string} [options.name] The config name. + * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist. + */ + loadInDirectory(directoryPath, { basePath, name } = {}) { + const slots = internalSlotsMap.get(this); + + for (const filename of configFilenames) { + const ctx = createContext( + slots, + "config", + name, + path.join(directoryPath, filename), + basePath + ); + + if (fs.existsSync(ctx.filePath)) { + let configData; + + try { + configData = loadConfigFile(ctx.filePath); + } catch (error) { + if (!error || error.code !== "ESLINT_CONFIG_FIELD_NOT_FOUND") { + throw error; + } + } + + if (configData) { + debug(`Config file found: ${ctx.filePath}`); + return new ConfigArray( + ...this._normalizeConfigData(configData, ctx) + ); + } + } + } + + debug(`Config file not found on ${directoryPath}`); + return new ConfigArray(); + } + + /** + * Check if a config file on a given directory exists or not. + * @param {string} directoryPath The path to a directory. + * @returns {string | null} The path to the found config file. If not found then null. + */ + static getPathToConfigFileInDirectory(directoryPath) { + for (const filename of configFilenames) { + const filePath = path.join(directoryPath, filename); + + if (fs.existsSync(filePath)) { + if (filename === "package.json") { + try { + loadPackageJSONConfigFile(filePath); + return filePath; + } catch { /* ignore */ } + } else { + return filePath; + } + } + } + return null; + } + + /** + * Load `.eslintignore` file. + * @param {string} filePath The path to a `.eslintignore` file to load. + * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist. + */ + loadESLintIgnore(filePath) { + const slots = internalSlotsMap.get(this); + const ctx = createContext( + slots, + "ignore", + void 0, + filePath, + slots.cwd + ); + const ignorePatterns = loadESLintIgnoreFile(ctx.filePath); + + return new ConfigArray( + ...this._normalizeESLintIgnoreData(ignorePatterns, ctx) + ); + } + + /** + * Load `.eslintignore` file in the current working directory. + * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist. + */ + loadDefaultESLintIgnore() { + const slots = internalSlotsMap.get(this); + const eslintIgnorePath = path.resolve(slots.cwd, ".eslintignore"); + const packageJsonPath = path.resolve(slots.cwd, "package.json"); + + if (fs.existsSync(eslintIgnorePath)) { + return this.loadESLintIgnore(eslintIgnorePath); + } + if (fs.existsSync(packageJsonPath)) { + const data = loadJSONConfigFile(packageJsonPath); + + if (Object.hasOwnProperty.call(data, "eslintIgnore")) { + if (!Array.isArray(data.eslintIgnore)) { + throw new Error("Package.json eslintIgnore property requires an array of paths"); + } + const ctx = createContext( + slots, + "ignore", + "eslintIgnore in package.json", + packageJsonPath, + slots.cwd + ); + + return new ConfigArray( + ...this._normalizeESLintIgnoreData(data.eslintIgnore, ctx) + ); + } + } + + return new ConfigArray(); + } + + /** + * Load a given config file. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} Loaded config. + * @private + */ + _loadConfigData(ctx) { + return this._normalizeConfigData(loadConfigFile(ctx.filePath), ctx); + } + + /** + * Normalize a given `.eslintignore` data to config array elements. + * @param {string[]} ignorePatterns The patterns to ignore files. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + *_normalizeESLintIgnoreData(ignorePatterns, ctx) { + const elements = this._normalizeObjectConfigData( + { ignorePatterns }, + ctx + ); + + // Set `ignorePattern.loose` flag for backward compatibility. + for (const element of elements) { + if (element.ignorePattern) { + element.ignorePattern.loose = true; + } + yield element; + } + } + + /** + * Normalize a given config to an array. + * @param {ConfigData} configData The config data to normalize. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _normalizeConfigData(configData, ctx) { + const validator = new ConfigValidator(); + + validator.validateConfigSchema(configData, ctx.name || ctx.filePath); + return this._normalizeObjectConfigData(configData, ctx); + } + + /** + * Normalize a given config to an array. + * @param {ConfigData|OverrideConfigData} configData The config data to normalize. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + *_normalizeObjectConfigData(configData, ctx) { + const { files, excludedFiles, ...configBody } = configData; + const criteria = OverrideTester.create( + files, + excludedFiles, + ctx.matchBasePath + ); + const elements = this._normalizeObjectConfigDataBody(configBody, ctx); + + // Apply the criteria to every element. + for (const element of elements) { + + /* + * Merge the criteria. + * This is for the `overrides` entries that came from the + * configurations of `overrides[].extends`. + */ + element.criteria = OverrideTester.and(criteria, element.criteria); + + /* + * Remove `root` property to ignore `root` settings which came from + * `extends` in `overrides`. + */ + if (element.criteria) { + element.root = void 0; + } + + yield element; + } + } + + /** + * Normalize a given config to an array. + * @param {ConfigData} configData The config data to normalize. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + *_normalizeObjectConfigDataBody( + { + env, + extends: extend, + globals, + ignorePatterns, + noInlineConfig, + parser: parserName, + parserOptions, + plugins: pluginList, + processor, + reportUnusedDisableDirectives, + root, + rules, + settings, + overrides: overrideList = [] + }, + ctx + ) { + const extendList = Array.isArray(extend) ? extend : [extend]; + const ignorePattern = ignorePatterns && new IgnorePattern( + Array.isArray(ignorePatterns) ? ignorePatterns : [ignorePatterns], + ctx.matchBasePath + ); + + // Flatten `extends`. + for (const extendName of extendList.filter(Boolean)) { + yield* this._loadExtends(extendName, ctx); + } + + // Load parser & plugins. + const parser = parserName && this._loadParser(parserName, ctx); + const plugins = pluginList && this._loadPlugins(pluginList, ctx); + + // Yield pseudo config data for file extension processors. + if (plugins) { + yield* this._takeFileExtensionProcessors(plugins, ctx); + } + + // Yield the config data except `extends` and `overrides`. + yield { + + // Debug information. + type: ctx.type, + name: ctx.name, + filePath: ctx.filePath, + + // Config data. + criteria: null, + env, + globals, + ignorePattern, + noInlineConfig, + parser, + parserOptions, + plugins, + processor, + reportUnusedDisableDirectives, + root, + rules, + settings + }; + + // Flatten `overries`. + for (let i = 0; i < overrideList.length; ++i) { + yield* this._normalizeObjectConfigData( + overrideList[i], + { ...ctx, name: `${ctx.name}#overrides[${i}]` } + ); + } + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _loadExtends(extendName, ctx) { + debug("Loading {extends:%j} relative to %s", extendName, ctx.filePath); + try { + if (extendName.startsWith("eslint:")) { + return this._loadExtendedBuiltInConfig(extendName, ctx); + } + if (extendName.startsWith("plugin:")) { + return this._loadExtendedPluginConfig(extendName, ctx); + } + return this._loadExtendedShareableConfig(extendName, ctx); + } catch (error) { + error.message += `\nReferenced from: ${ctx.filePath || ctx.name}`; + throw error; + } + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _loadExtendedBuiltInConfig(extendName, ctx) { + if (extendName === "eslint:recommended") { + return this._loadConfigData({ + ...ctx, + filePath: eslintRecommendedPath, + name: `${ctx.name} » ${extendName}` + }); + } + if (extendName === "eslint:all") { + return this._loadConfigData({ + ...ctx, + filePath: eslintAllPath, + name: `${ctx.name} » ${extendName}` + }); + } + + throw configMissingError(extendName, ctx.name); + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _loadExtendedPluginConfig(extendName, ctx) { + const slashIndex = extendName.lastIndexOf("/"); + const pluginName = extendName.slice("plugin:".length, slashIndex); + const configName = extendName.slice(slashIndex + 1); + + if (isFilePath(pluginName)) { + throw new Error("'extends' cannot use a file path for plugins."); + } + + const plugin = this._loadPlugin(pluginName, ctx); + const configData = + plugin.definition && + plugin.definition.configs[configName]; + + if (configData) { + return this._normalizeConfigData(configData, { + ...ctx, + filePath: plugin.filePath || ctx.filePath, + name: `${ctx.name} » plugin:${plugin.id}/${configName}` + }); + } + + throw plugin.error || configMissingError(extendName, ctx.filePath); + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _loadExtendedShareableConfig(extendName, ctx) { + const { cwd, resolver } = internalSlotsMap.get(this); + const relativeTo = ctx.filePath || path.join(cwd, "__placeholder__.js"); + let request; + + if (isFilePath(extendName)) { + request = extendName; + } else if (extendName.startsWith(".")) { + request = `./${extendName}`; // For backward compatibility. A ton of tests depended on this behavior. + } else { + request = naming.normalizePackageName( + extendName, + "eslint-config" + ); + } + + let filePath; + + try { + filePath = resolver.resolve(request, relativeTo); + } catch (error) { + /* istanbul ignore else */ + if (error && error.code === "MODULE_NOT_FOUND") { + throw configMissingError(extendName, ctx.filePath); + } + throw error; + } + + writeDebugLogForLoading(request, relativeTo, filePath); + return this._loadConfigData({ + ...ctx, + filePath, + name: `${ctx.name} » ${request}` + }); + } + + /** + * Load given plugins. + * @param {string[]} names The plugin names to load. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {Record} The loaded parser. + * @private + */ + _loadPlugins(names, ctx) { + return names.reduce((map, name) => { + if (isFilePath(name)) { + throw new Error("Plugins array cannot includes file paths."); + } + const plugin = this._loadPlugin(name, ctx); + + map[plugin.id] = plugin; + + return map; + }, {}); + } + + /** + * Load a given parser. + * @param {string} nameOrPath The package name or the path to a parser file. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {DependentParser} The loaded parser. + */ + _loadParser(nameOrPath, ctx) { + debug("Loading parser %j from %s", nameOrPath, ctx.filePath); + + const { cwd } = internalSlotsMap.get(this); + const relativeTo = ctx.filePath || path.join(cwd, "__placeholder__.js"); + + try { + const filePath = ModuleResolver.resolve(nameOrPath, relativeTo); + + writeDebugLogForLoading(nameOrPath, relativeTo, filePath); + + return new ConfigDependency({ + definition: require(filePath), + filePath, + id: nameOrPath, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } catch (error) { + + // If the parser name is "espree", load the espree of ESLint. + if (nameOrPath === "espree") { + debug("Fallback espree."); + return new ConfigDependency({ + definition: require("espree"), + filePath: require.resolve("espree"), + id: nameOrPath, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + debug("Failed to load parser '%s' declared in '%s'.", nameOrPath, ctx.name); + error.message = `Failed to load parser '${nameOrPath}' declared in '${ctx.name}': ${error.message}`; + + return new ConfigDependency({ + error, + id: nameOrPath, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + } + + /** + * Load a given plugin. + * @param {string} name The plugin name to load. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {DependentPlugin} The loaded plugin. + * @private + */ + _loadPlugin(name, ctx) { + debug("Loading plugin %j from %s", name, ctx.filePath); + + const { additionalPluginPool } = internalSlotsMap.get(this); + const request = naming.normalizePackageName(name, "eslint-plugin"); + const id = naming.getShorthandName(request, "eslint-plugin"); + const relativeTo = path.join(ctx.pluginBasePath, "__placeholder__.js"); + + if (name.match(/\s+/u)) { + const error = Object.assign( + new Error(`Whitespace found in plugin name '${name}'`), + { + messageTemplate: "whitespace-found", + messageData: { pluginName: request } + } + ); + + return new ConfigDependency({ + error, + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + // Check for additional pool. + const plugin = + additionalPluginPool.get(request) || + additionalPluginPool.get(id); + + if (plugin) { + return new ConfigDependency({ + definition: normalizePlugin(plugin), + filePath: "", // It's unknown where the plugin came from. + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + let filePath; + let error; + + try { + filePath = ModuleResolver.resolve(request, relativeTo); + } catch (resolveError) { + error = resolveError; + /* istanbul ignore else */ + if (error && error.code === "MODULE_NOT_FOUND") { + error.messageTemplate = "plugin-missing"; + error.messageData = { + pluginName: request, + resolvePluginsRelativeTo: ctx.pluginBasePath, + importerName: ctx.name + }; + } + } + + if (filePath) { + try { + writeDebugLogForLoading(request, relativeTo, filePath); + + const startTime = Date.now(); + const pluginDefinition = require(filePath); + + debug(`Plugin ${filePath} loaded in: ${Date.now() - startTime}ms`); + + return new ConfigDependency({ + definition: normalizePlugin(pluginDefinition), + filePath, + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } catch (loadError) { + error = loadError; + } + } + + debug("Failed to load plugin '%s' declared in '%s'.", name, ctx.name); + error.message = `Failed to load plugin '${name}' declared in '${ctx.name}': ${error.message}`; + return new ConfigDependency({ + error, + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + /** + * Take file expression processors as config array elements. + * @param {Record} plugins The plugin definitions. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The config array elements of file expression processors. + * @private + */ + *_takeFileExtensionProcessors(plugins, ctx) { + for (const pluginId of Object.keys(plugins)) { + const processors = + plugins[pluginId] && + plugins[pluginId].definition && + plugins[pluginId].definition.processors; + + if (!processors) { + continue; + } + + for (const processorId of Object.keys(processors)) { + if (processorId.startsWith(".")) { + yield* this._normalizeObjectConfigData( + { + files: [`*${processorId}`], + processor: `${pluginId}/${processorId}` + }, + { + ...ctx, + type: "implicit-processor", + name: `${ctx.name}#processors["${pluginId}/${processorId}"]` + } + ); + } + } + } + } +} + +module.exports = { ConfigArrayFactory, createContext }; diff --git a/node_modules/@eslint/eslintrc/lib/config-array/config-array.js b/node_modules/@eslint/eslintrc/lib/config-array/config-array.js new file mode 100644 index 000000000..42a736273 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/config-array/config-array.js @@ -0,0 +1,524 @@ +/** + * @fileoverview `ConfigArray` class. + * + * `ConfigArray` class expresses the full of a configuration. It has the entry + * config file, base config files that were extended, loaded parsers, and loaded + * plugins. + * + * `ConfigArray` class provides three properties and two methods. + * + * - `pluginEnvironments` + * - `pluginProcessors` + * - `pluginRules` + * The `Map` objects that contain the members of all plugins that this + * config array contains. Those map objects don't have mutation methods. + * Those keys are the member ID such as `pluginId/memberName`. + * - `isRoot()` + * If `true` then this configuration has `root:true` property. + * - `extractConfig(filePath)` + * Extract the final configuration for a given file. This means merging + * every config array element which that `criteria` property matched. The + * `filePath` argument must be an absolute path. + * + * `ConfigArrayFactory` provides the loading logic of config files. + * + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { ExtractedConfig } = require("./extracted-config"); +const { IgnorePattern } = require("./ignore-pattern"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +// Define types for VSCode IntelliSense. +/** @typedef {import("../../shared/types").Environment} Environment */ +/** @typedef {import("../../shared/types").GlobalConf} GlobalConf */ +/** @typedef {import("../../shared/types").RuleConf} RuleConf */ +/** @typedef {import("../../shared/types").Rule} Rule */ +/** @typedef {import("../../shared/types").Plugin} Plugin */ +/** @typedef {import("../../shared/types").Processor} Processor */ +/** @typedef {import("./config-dependency").DependentParser} DependentParser */ +/** @typedef {import("./config-dependency").DependentPlugin} DependentPlugin */ +/** @typedef {import("./override-tester")["OverrideTester"]} OverrideTester */ + +/** + * @typedef {Object} ConfigArrayElement + * @property {string} name The name of this config element. + * @property {string} filePath The path to the source file of this config element. + * @property {InstanceType|null} criteria The tester for the `files` and `excludedFiles` of this config element. + * @property {Record|undefined} env The environment settings. + * @property {Record|undefined} globals The global variable settings. + * @property {IgnorePattern|undefined} ignorePattern The ignore patterns. + * @property {boolean|undefined} noInlineConfig The flag that disables directive comments. + * @property {DependentParser|undefined} parser The parser loader. + * @property {Object|undefined} parserOptions The parser options. + * @property {Record|undefined} plugins The plugin loaders. + * @property {string|undefined} processor The processor name to refer plugin's processor. + * @property {boolean|undefined} reportUnusedDisableDirectives The flag to report unused `eslint-disable` comments. + * @property {boolean|undefined} root The flag to express root. + * @property {Record|undefined} rules The rule settings + * @property {Object|undefined} settings The shared settings. + * @property {"config" | "ignore" | "implicit-processor"} type The element type. + */ + +/** + * @typedef {Object} ConfigArrayInternalSlots + * @property {Map} cache The cache to extract configs. + * @property {ReadonlyMap|null} envMap The map from environment ID to environment definition. + * @property {ReadonlyMap|null} processorMap The map from processor ID to environment definition. + * @property {ReadonlyMap|null} ruleMap The map from rule ID to rule definition. + */ + +/** @type {WeakMap} */ +const internalSlotsMap = new class extends WeakMap { + get(key) { + let value = super.get(key); + + if (!value) { + value = { + cache: new Map(), + envMap: null, + processorMap: null, + ruleMap: null + }; + super.set(key, value); + } + + return value; + } +}(); + +/** + * Get the indices which are matched to a given file. + * @param {ConfigArrayElement[]} elements The elements. + * @param {string} filePath The path to a target file. + * @returns {number[]} The indices. + */ +function getMatchedIndices(elements, filePath) { + const indices = []; + + for (let i = elements.length - 1; i >= 0; --i) { + const element = elements[i]; + + if (!element.criteria || (filePath && element.criteria.test(filePath))) { + indices.push(i); + } + } + + return indices; +} + +/** + * Check if a value is a non-null object. + * @param {any} x The value to check. + * @returns {boolean} `true` if the value is a non-null object. + */ +function isNonNullObject(x) { + return typeof x === "object" && x !== null; +} + +/** + * Merge two objects. + * + * Assign every property values of `y` to `x` if `x` doesn't have the property. + * If `x`'s property value is an object, it does recursive. + * @param {Object} target The destination to merge + * @param {Object|undefined} source The source to merge. + * @returns {void} + */ +function mergeWithoutOverwrite(target, source) { + if (!isNonNullObject(source)) { + return; + } + + for (const key of Object.keys(source)) { + if (key === "__proto__") { + continue; + } + + if (isNonNullObject(target[key])) { + mergeWithoutOverwrite(target[key], source[key]); + } else if (target[key] === void 0) { + if (isNonNullObject(source[key])) { + target[key] = Array.isArray(source[key]) ? [] : {}; + mergeWithoutOverwrite(target[key], source[key]); + } else if (source[key] !== void 0) { + target[key] = source[key]; + } + } + } +} + +/** + * The error for plugin conflicts. + */ +class PluginConflictError extends Error { + + /** + * Initialize this error object. + * @param {string} pluginId The plugin ID. + * @param {{filePath:string, importerName:string}[]} plugins The resolved plugins. + */ + constructor(pluginId, plugins) { + super(`Plugin "${pluginId}" was conflicted between ${plugins.map(p => `"${p.importerName}"`).join(" and ")}.`); + this.messageTemplate = "plugin-conflict"; + this.messageData = { pluginId, plugins }; + } +} + +/** + * Merge plugins. + * `target`'s definition is prior to `source`'s. + * @param {Record} target The destination to merge + * @param {Record|undefined} source The source to merge. + * @returns {void} + */ +function mergePlugins(target, source) { + if (!isNonNullObject(source)) { + return; + } + + for (const key of Object.keys(source)) { + if (key === "__proto__") { + continue; + } + const targetValue = target[key]; + const sourceValue = source[key]; + + // Adopt the plugin which was found at first. + if (targetValue === void 0) { + if (sourceValue.error) { + throw sourceValue.error; + } + target[key] = sourceValue; + } else if (sourceValue.filePath !== targetValue.filePath) { + throw new PluginConflictError(key, [ + { + filePath: targetValue.filePath, + importerName: targetValue.importerName + }, + { + filePath: sourceValue.filePath, + importerName: sourceValue.importerName + } + ]); + } + } +} + +/** + * Merge rule configs. + * `target`'s definition is prior to `source`'s. + * @param {Record} target The destination to merge + * @param {Record|undefined} source The source to merge. + * @returns {void} + */ +function mergeRuleConfigs(target, source) { + if (!isNonNullObject(source)) { + return; + } + + for (const key of Object.keys(source)) { + if (key === "__proto__") { + continue; + } + const targetDef = target[key]; + const sourceDef = source[key]; + + // Adopt the rule config which was found at first. + if (targetDef === void 0) { + if (Array.isArray(sourceDef)) { + target[key] = [...sourceDef]; + } else { + target[key] = [sourceDef]; + } + + /* + * If the first found rule config is severity only and the current rule + * config has options, merge the severity and the options. + */ + } else if ( + targetDef.length === 1 && + Array.isArray(sourceDef) && + sourceDef.length >= 2 + ) { + targetDef.push(...sourceDef.slice(1)); + } + } +} + +/** + * Create the extracted config. + * @param {ConfigArray} instance The config elements. + * @param {number[]} indices The indices to use. + * @returns {ExtractedConfig} The extracted config. + */ +function createConfig(instance, indices) { + const config = new ExtractedConfig(); + const ignorePatterns = []; + + // Merge elements. + for (const index of indices) { + const element = instance[index]; + + // Adopt the parser which was found at first. + if (!config.parser && element.parser) { + if (element.parser.error) { + throw element.parser.error; + } + config.parser = element.parser; + } + + // Adopt the processor which was found at first. + if (!config.processor && element.processor) { + config.processor = element.processor; + } + + // Adopt the noInlineConfig which was found at first. + if (config.noInlineConfig === void 0 && element.noInlineConfig !== void 0) { + config.noInlineConfig = element.noInlineConfig; + config.configNameOfNoInlineConfig = element.name; + } + + // Adopt the reportUnusedDisableDirectives which was found at first. + if (config.reportUnusedDisableDirectives === void 0 && element.reportUnusedDisableDirectives !== void 0) { + config.reportUnusedDisableDirectives = element.reportUnusedDisableDirectives; + } + + // Collect ignorePatterns + if (element.ignorePattern) { + ignorePatterns.push(element.ignorePattern); + } + + // Merge others. + mergeWithoutOverwrite(config.env, element.env); + mergeWithoutOverwrite(config.globals, element.globals); + mergeWithoutOverwrite(config.parserOptions, element.parserOptions); + mergeWithoutOverwrite(config.settings, element.settings); + mergePlugins(config.plugins, element.plugins); + mergeRuleConfigs(config.rules, element.rules); + } + + // Create the predicate function for ignore patterns. + if (ignorePatterns.length > 0) { + config.ignores = IgnorePattern.createIgnore(ignorePatterns.reverse()); + } + + return config; +} + +/** + * Collect definitions. + * @template T, U + * @param {string} pluginId The plugin ID for prefix. + * @param {Record} defs The definitions to collect. + * @param {Map} map The map to output. + * @param {function(T): U} [normalize] The normalize function for each value. + * @returns {void} + */ +function collect(pluginId, defs, map, normalize) { + if (defs) { + const prefix = pluginId && `${pluginId}/`; + + for (const [key, value] of Object.entries(defs)) { + map.set( + `${prefix}${key}`, + normalize ? normalize(value) : value + ); + } + } +} + +/** + * Normalize a rule definition. + * @param {Function|Rule} rule The rule definition to normalize. + * @returns {Rule} The normalized rule definition. + */ +function normalizePluginRule(rule) { + return typeof rule === "function" ? { create: rule } : rule; +} + +/** + * Delete the mutation methods from a given map. + * @param {Map} map The map object to delete. + * @returns {void} + */ +function deleteMutationMethods(map) { + Object.defineProperties(map, { + clear: { configurable: true, value: void 0 }, + delete: { configurable: true, value: void 0 }, + set: { configurable: true, value: void 0 } + }); +} + +/** + * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array. + * @param {ConfigArrayElement[]} elements The config elements. + * @param {ConfigArrayInternalSlots} slots The internal slots. + * @returns {void} + */ +function initPluginMemberMaps(elements, slots) { + const processed = new Set(); + + slots.envMap = new Map(); + slots.processorMap = new Map(); + slots.ruleMap = new Map(); + + for (const element of elements) { + if (!element.plugins) { + continue; + } + + for (const [pluginId, value] of Object.entries(element.plugins)) { + const plugin = value.definition; + + if (!plugin || processed.has(pluginId)) { + continue; + } + processed.add(pluginId); + + collect(pluginId, plugin.environments, slots.envMap); + collect(pluginId, plugin.processors, slots.processorMap); + collect(pluginId, plugin.rules, slots.ruleMap, normalizePluginRule); + } + } + + deleteMutationMethods(slots.envMap); + deleteMutationMethods(slots.processorMap); + deleteMutationMethods(slots.ruleMap); +} + +/** + * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array. + * @param {ConfigArray} instance The config elements. + * @returns {ConfigArrayInternalSlots} The extracted config. + */ +function ensurePluginMemberMaps(instance) { + const slots = internalSlotsMap.get(instance); + + if (!slots.ruleMap) { + initPluginMemberMaps(instance, slots); + } + + return slots; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * The Config Array. + * + * `ConfigArray` instance contains all settings, parsers, and plugins. + * You need to call `ConfigArray#extractConfig(filePath)` method in order to + * extract, merge and get only the config data which is related to an arbitrary + * file. + * @extends {Array} + */ +class ConfigArray extends Array { + + /** + * Get the plugin environments. + * The returned map cannot be mutated. + * @type {ReadonlyMap} The plugin environments. + */ + get pluginEnvironments() { + return ensurePluginMemberMaps(this).envMap; + } + + /** + * Get the plugin processors. + * The returned map cannot be mutated. + * @type {ReadonlyMap} The plugin processors. + */ + get pluginProcessors() { + return ensurePluginMemberMaps(this).processorMap; + } + + /** + * Get the plugin rules. + * The returned map cannot be mutated. + * @returns {ReadonlyMap} The plugin rules. + */ + get pluginRules() { + return ensurePluginMemberMaps(this).ruleMap; + } + + /** + * Check if this config has `root` flag. + * @returns {boolean} `true` if this config array is root. + */ + isRoot() { + for (let i = this.length - 1; i >= 0; --i) { + const root = this[i].root; + + if (typeof root === "boolean") { + return root; + } + } + return false; + } + + /** + * Extract the config data which is related to a given file. + * @param {string} filePath The absolute path to the target file. + * @returns {ExtractedConfig} The extracted config data. + */ + extractConfig(filePath) { + const { cache } = internalSlotsMap.get(this); + const indices = getMatchedIndices(this, filePath); + const cacheKey = indices.join(","); + + if (!cache.has(cacheKey)) { + cache.set(cacheKey, createConfig(this, indices)); + } + + return cache.get(cacheKey); + } + + /** + * Check if a given path is an additional lint target. + * @param {string} filePath The absolute path to the target file. + * @returns {boolean} `true` if the file is an additional lint target. + */ + isAdditionalTargetPath(filePath) { + for (const { criteria, type } of this) { + if ( + type === "config" && + criteria && + !criteria.endsWithWildcard && + criteria.test(filePath) + ) { + return true; + } + } + return false; + } +} + +const exportObject = { + ConfigArray, + + /** + * Get the used extracted configs. + * CLIEngine will use this method to collect used deprecated rules. + * @param {ConfigArray} instance The config array object to get. + * @returns {ExtractedConfig[]} The used extracted configs. + * @private + */ + getUsedExtractedConfigs(instance) { + const { cache } = internalSlotsMap.get(instance); + + return Array.from(cache.values()); + } +}; + +module.exports = exportObject; diff --git a/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js b/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js new file mode 100644 index 000000000..0d5f6f713 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js @@ -0,0 +1,116 @@ +/** + * @fileoverview `ConfigDependency` class. + * + * `ConfigDependency` class expresses a loaded parser or plugin. + * + * If the parser or plugin was loaded successfully, it has `definition` property + * and `filePath` property. Otherwise, it has `error` property. + * + * When `JSON.stringify()` converted a `ConfigDependency` object to a JSON, it + * omits `definition` property. + * + * `ConfigArrayFactory` creates `ConfigDependency` objects when it loads parsers + * or plugins. + * + * @author Toru Nagashima + */ +"use strict"; + +const util = require("util"); + +/** + * The class is to store parsers or plugins. + * This class hides the loaded object from `JSON.stringify()` and `console.log`. + * @template T + */ +class ConfigDependency { + + /** + * Initialize this instance. + * @param {Object} data The dependency data. + * @param {T} [data.definition] The dependency if the loading succeeded. + * @param {Error} [data.error] The error object if the loading failed. + * @param {string} [data.filePath] The actual path to the dependency if the loading succeeded. + * @param {string} data.id The ID of this dependency. + * @param {string} data.importerName The name of the config file which loads this dependency. + * @param {string} data.importerPath The path to the config file which loads this dependency. + */ + constructor({ + definition = null, + error = null, + filePath = null, + id, + importerName, + importerPath + }) { + + /** + * The loaded dependency if the loading succeeded. + * @type {T|null} + */ + this.definition = definition; + + /** + * The error object if the loading failed. + * @type {Error|null} + */ + this.error = error; + + /** + * The loaded dependency if the loading succeeded. + * @type {string|null} + */ + this.filePath = filePath; + + /** + * The ID of this dependency. + * @type {string} + */ + this.id = id; + + /** + * The name of the config file which loads this dependency. + * @type {string} + */ + this.importerName = importerName; + + /** + * The path to the config file which loads this dependency. + * @type {string} + */ + this.importerPath = importerPath; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {Object} a JSON compatible object. + */ + toJSON() { + const obj = this[util.inspect.custom](); + + // Display `error.message` (`Error#message` is unenumerable). + if (obj.error instanceof Error) { + obj.error = { ...obj.error, message: obj.error.message }; + } + + return obj; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {Object} an object to display by `console.log()`. + */ + [util.inspect.custom]() { + const { + definition: _ignore, // eslint-disable-line no-unused-vars + ...obj + } = this; + + return obj; + } +} + +/** @typedef {ConfigDependency} DependentParser */ +/** @typedef {ConfigDependency} DependentPlugin */ + +module.exports = { ConfigDependency }; diff --git a/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js b/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js new file mode 100644 index 000000000..b27d6ffb1 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js @@ -0,0 +1,146 @@ +/** + * @fileoverview `ExtractedConfig` class. + * + * `ExtractedConfig` class expresses a final configuration for a specific file. + * + * It provides one method. + * + * - `toCompatibleObjectAsConfigFileContent()` + * Convert this configuration to the compatible object as the content of + * config files. It converts the loaded parser and plugins to strings. + * `CLIEngine#getConfigForFile(filePath)` method uses this method. + * + * `ConfigArray#extractConfig(filePath)` creates a `ExtractedConfig` instance. + * + * @author Toru Nagashima + */ +"use strict"; + +const { IgnorePattern } = require("./ignore-pattern"); + +// For VSCode intellisense +/** @typedef {import("../../shared/types").ConfigData} ConfigData */ +/** @typedef {import("../../shared/types").GlobalConf} GlobalConf */ +/** @typedef {import("../../shared/types").SeverityConf} SeverityConf */ +/** @typedef {import("./config-dependency").DependentParser} DependentParser */ +/** @typedef {import("./config-dependency").DependentPlugin} DependentPlugin */ + +/** + * Check if `xs` starts with `ys`. + * @template T + * @param {T[]} xs The array to check. + * @param {T[]} ys The array that may be the first part of `xs`. + * @returns {boolean} `true` if `xs` starts with `ys`. + */ +function startsWith(xs, ys) { + return xs.length >= ys.length && ys.every((y, i) => y === xs[i]); +} + +/** + * The class for extracted config data. + */ +class ExtractedConfig { + constructor() { + + /** + * The config name what `noInlineConfig` setting came from. + * @type {string} + */ + this.configNameOfNoInlineConfig = ""; + + /** + * Environments. + * @type {Record} + */ + this.env = {}; + + /** + * Global variables. + * @type {Record} + */ + this.globals = {}; + + /** + * The glob patterns that ignore to lint. + * @type {(((filePath:string, dot?:boolean) => boolean) & { basePath:string; patterns:string[] }) | undefined} + */ + this.ignores = void 0; + + /** + * The flag that disables directive comments. + * @type {boolean|undefined} + */ + this.noInlineConfig = void 0; + + /** + * Parser definition. + * @type {DependentParser|null} + */ + this.parser = null; + + /** + * Options for the parser. + * @type {Object} + */ + this.parserOptions = {}; + + /** + * Plugin definitions. + * @type {Record} + */ + this.plugins = {}; + + /** + * Processor ID. + * @type {string|null} + */ + this.processor = null; + + /** + * The flag that reports unused `eslint-disable` directive comments. + * @type {boolean|undefined} + */ + this.reportUnusedDisableDirectives = void 0; + + /** + * Rule settings. + * @type {Record} + */ + this.rules = {}; + + /** + * Shared settings. + * @type {Object} + */ + this.settings = {}; + } + + /** + * Convert this config to the compatible object as a config file content. + * @returns {ConfigData} The converted object. + */ + toCompatibleObjectAsConfigFileContent() { + const { + /* eslint-disable no-unused-vars */ + configNameOfNoInlineConfig: _ignore1, + processor: _ignore2, + /* eslint-enable no-unused-vars */ + ignores, + ...config + } = this; + + config.parser = config.parser && config.parser.filePath; + config.plugins = Object.keys(config.plugins).filter(Boolean).reverse(); + config.ignorePatterns = ignores ? ignores.patterns : []; + + // Strip the default patterns from `ignorePatterns`. + if (startsWith(config.ignorePatterns, IgnorePattern.DefaultPatterns)) { + config.ignorePatterns = + config.ignorePatterns.slice(IgnorePattern.DefaultPatterns.length); + } + + return config; + } +} + +module.exports = { ExtractedConfig }; diff --git a/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js b/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js new file mode 100644 index 000000000..6eaec4258 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js @@ -0,0 +1,237 @@ +/** + * @fileoverview `IgnorePattern` class. + * + * `IgnorePattern` class has the set of glob patterns and the base path. + * + * It provides two static methods. + * + * - `IgnorePattern.createDefaultIgnore(cwd)` + * Create the default predicate function. + * - `IgnorePattern.createIgnore(ignorePatterns)` + * Create the predicate function from multiple `IgnorePattern` objects. + * + * It provides two properties and a method. + * + * - `patterns` + * The glob patterns that ignore to lint. + * - `basePath` + * The base path of the glob patterns. If absolute paths existed in the + * glob patterns, those are handled as relative paths to the base path. + * - `getPatternsRelativeTo(basePath)` + * Get `patterns` as modified for a given base path. It modifies the + * absolute paths in the patterns as prepending the difference of two base + * paths. + * + * `ConfigArrayFactory` creates `IgnorePattern` objects when it processes + * `ignorePatterns` properties. + * + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const assert = require("assert"); +const path = require("path"); +const ignore = require("ignore"); +const debug = require("debug")("eslint:ignore-pattern"); + +/** @typedef {ReturnType} Ignore */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Get the path to the common ancestor directory of given paths. + * @param {string[]} sourcePaths The paths to calculate the common ancestor. + * @returns {string} The path to the common ancestor directory. + */ +function getCommonAncestorPath(sourcePaths) { + let result = sourcePaths[0]; + + for (let i = 1; i < sourcePaths.length; ++i) { + const a = result; + const b = sourcePaths[i]; + + // Set the shorter one (it's the common ancestor if one includes the other). + result = a.length < b.length ? a : b; + + // Set the common ancestor. + for (let j = 0, lastSepPos = 0; j < a.length && j < b.length; ++j) { + if (a[j] !== b[j]) { + result = a.slice(0, lastSepPos); + break; + } + if (a[j] === path.sep) { + lastSepPos = j; + } + } + } + + let resolvedResult = result || path.sep; + + // if Windows common ancestor is root of drive must have trailing slash to be absolute. + if (resolvedResult && resolvedResult.endsWith(":") && process.platform === "win32") { + resolvedResult += path.sep; + } + return resolvedResult; +} + +/** + * Make relative path. + * @param {string} from The source path to get relative path. + * @param {string} to The destination path to get relative path. + * @returns {string} The relative path. + */ +function relative(from, to) { + const relPath = path.relative(from, to); + + if (path.sep === "/") { + return relPath; + } + return relPath.split(path.sep).join("/"); +} + +/** + * Get the trailing slash if existed. + * @param {string} filePath The path to check. + * @returns {string} The trailing slash if existed. + */ +function dirSuffix(filePath) { + const isDir = ( + filePath.endsWith(path.sep) || + (process.platform === "win32" && filePath.endsWith("/")) + ); + + return isDir ? "/" : ""; +} + +const DefaultPatterns = Object.freeze(["/**/node_modules/*"]); +const DotPatterns = Object.freeze([".*", "!.eslintrc.*", "!../"]); + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +class IgnorePattern { + + /** + * The default patterns. + * @type {string[]} + */ + static get DefaultPatterns() { + return DefaultPatterns; + } + + /** + * Create the default predicate function. + * @param {string} cwd The current working directory. + * @returns {((filePath:string, dot:boolean) => boolean) & {basePath:string; patterns:string[]}} + * The preficate function. + * The first argument is an absolute path that is checked. + * The second argument is the flag to not ignore dotfiles. + * If the predicate function returned `true`, it means the path should be ignored. + */ + static createDefaultIgnore(cwd) { + return this.createIgnore([new IgnorePattern(DefaultPatterns, cwd)]); + } + + /** + * Create the predicate function from multiple `IgnorePattern` objects. + * @param {IgnorePattern[]} ignorePatterns The list of ignore patterns. + * @returns {((filePath:string, dot?:boolean) => boolean) & {basePath:string; patterns:string[]}} + * The preficate function. + * The first argument is an absolute path that is checked. + * The second argument is the flag to not ignore dotfiles. + * If the predicate function returned `true`, it means the path should be ignored. + */ + static createIgnore(ignorePatterns) { + debug("Create with: %o", ignorePatterns); + + const basePath = getCommonAncestorPath(ignorePatterns.map(p => p.basePath)); + const patterns = [].concat( + ...ignorePatterns.map(p => p.getPatternsRelativeTo(basePath)) + ); + const ig = ignore().add([...DotPatterns, ...patterns]); + const dotIg = ignore().add(patterns); + + debug(" processed: %o", { basePath, patterns }); + + return Object.assign( + (filePath, dot = false) => { + assert(path.isAbsolute(filePath), "'filePath' should be an absolute path."); + const relPathRaw = relative(basePath, filePath); + const relPath = relPathRaw && (relPathRaw + dirSuffix(filePath)); + const adoptedIg = dot ? dotIg : ig; + const result = relPath !== "" && adoptedIg.ignores(relPath); + + debug("Check", { filePath, dot, relativePath: relPath, result }); + return result; + }, + { basePath, patterns } + ); + } + + /** + * Initialize a new `IgnorePattern` instance. + * @param {string[]} patterns The glob patterns that ignore to lint. + * @param {string} basePath The base path of `patterns`. + */ + constructor(patterns, basePath) { + assert(path.isAbsolute(basePath), "'basePath' should be an absolute path."); + + /** + * The glob patterns that ignore to lint. + * @type {string[]} + */ + this.patterns = patterns; + + /** + * The base path of `patterns`. + * @type {string} + */ + this.basePath = basePath; + + /** + * If `true` then patterns which don't start with `/` will match the paths to the outside of `basePath`. Defaults to `false`. + * + * It's set `true` for `.eslintignore`, `package.json`, and `--ignore-path` for backward compatibility. + * It's `false` as-is for `ignorePatterns` property in config files. + * @type {boolean} + */ + this.loose = false; + } + + /** + * Get `patterns` as modified for a given base path. It modifies the + * absolute paths in the patterns as prepending the difference of two base + * paths. + * @param {string} newBasePath The base path. + * @returns {string[]} Modifired patterns. + */ + getPatternsRelativeTo(newBasePath) { + assert(path.isAbsolute(newBasePath), "'newBasePath' should be an absolute path."); + const { basePath, loose, patterns } = this; + + if (newBasePath === basePath) { + return patterns; + } + const prefix = `/${relative(newBasePath, basePath)}`; + + return patterns.map(pattern => { + const negative = pattern.startsWith("!"); + const head = negative ? "!" : ""; + const body = negative ? pattern.slice(1) : pattern; + + if (body.startsWith("/") || body.startsWith("../")) { + return `${head}${prefix}${body}`; + } + return loose ? pattern : `${head}${prefix}/**/${body}`; + }); + } +} + +module.exports = { IgnorePattern }; diff --git a/node_modules/@eslint/eslintrc/lib/config-array/index.js b/node_modules/@eslint/eslintrc/lib/config-array/index.js new file mode 100644 index 000000000..928d76c83 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/config-array/index.js @@ -0,0 +1,20 @@ +/** + * @fileoverview `ConfigArray` class. + * @author Toru Nagashima + */ +"use strict"; + +const { ConfigArray, getUsedExtractedConfigs } = require("./config-array"); +const { ConfigDependency } = require("./config-dependency"); +const { ExtractedConfig } = require("./extracted-config"); +const { IgnorePattern } = require("./ignore-pattern"); +const { OverrideTester } = require("./override-tester"); + +module.exports = { + ConfigArray, + ConfigDependency, + ExtractedConfig, + IgnorePattern, + OverrideTester, + getUsedExtractedConfigs +}; diff --git a/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js b/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js new file mode 100644 index 000000000..e7ba1202f --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js @@ -0,0 +1,223 @@ +/** + * @fileoverview `OverrideTester` class. + * + * `OverrideTester` class handles `files` property and `excludedFiles` property + * of `overrides` config. + * + * It provides one method. + * + * - `test(filePath)` + * Test if a file path matches the pair of `files` property and + * `excludedFiles` property. The `filePath` argument must be an absolute + * path. + * + * `ConfigArrayFactory` creates `OverrideTester` objects when it processes + * `overrides` properties. + * + * @author Toru Nagashima + */ +"use strict"; + +const assert = require("assert"); +const path = require("path"); +const util = require("util"); +const { Minimatch } = require("minimatch"); +const minimatchOpts = { dot: true, matchBase: true }; + +/** + * @typedef {Object} Pattern + * @property {InstanceType[] | null} includes The positive matchers. + * @property {InstanceType[] | null} excludes The negative matchers. + */ + +/** + * Normalize a given pattern to an array. + * @param {string|string[]|undefined} patterns A glob pattern or an array of glob patterns. + * @returns {string[]|null} Normalized patterns. + * @private + */ +function normalizePatterns(patterns) { + if (Array.isArray(patterns)) { + return patterns.filter(Boolean); + } + if (typeof patterns === "string" && patterns) { + return [patterns]; + } + return []; +} + +/** + * Create the matchers of given patterns. + * @param {string[]} patterns The patterns. + * @returns {InstanceType[] | null} The matchers. + */ +function toMatcher(patterns) { + if (patterns.length === 0) { + return null; + } + return patterns.map(pattern => { + if (/^\.[/\\]/u.test(pattern)) { + return new Minimatch( + pattern.slice(2), + + // `./*.js` should not match with `subdir/foo.js` + { ...minimatchOpts, matchBase: false } + ); + } + return new Minimatch(pattern, minimatchOpts); + }); +} + +/** + * Convert a given matcher to string. + * @param {Pattern} matchers The matchers. + * @returns {string} The string expression of the matcher. + */ +function patternToJson({ includes, excludes }) { + return { + includes: includes && includes.map(m => m.pattern), + excludes: excludes && excludes.map(m => m.pattern) + }; +} + +/** + * The class to test given paths are matched by the patterns. + */ +class OverrideTester { + + /** + * Create a tester with given criteria. + * If there are no criteria, returns `null`. + * @param {string|string[]} files The glob patterns for included files. + * @param {string|string[]} excludedFiles The glob patterns for excluded files. + * @param {string} basePath The path to the base directory to test paths. + * @returns {OverrideTester|null} The created instance or `null`. + */ + static create(files, excludedFiles, basePath) { + const includePatterns = normalizePatterns(files); + const excludePatterns = normalizePatterns(excludedFiles); + let endsWithWildcard = false; + + if (includePatterns.length === 0) { + return null; + } + + // Rejects absolute paths or relative paths to parents. + for (const pattern of includePatterns) { + if (path.isAbsolute(pattern) || pattern.includes("..")) { + throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`); + } + if (pattern.endsWith("*")) { + endsWithWildcard = true; + } + } + for (const pattern of excludePatterns) { + if (path.isAbsolute(pattern) || pattern.includes("..")) { + throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`); + } + } + + const includes = toMatcher(includePatterns); + const excludes = toMatcher(excludePatterns); + + return new OverrideTester( + [{ includes, excludes }], + basePath, + endsWithWildcard + ); + } + + /** + * Combine two testers by logical and. + * If either of the testers was `null`, returns the other tester. + * The `basePath` property of the two must be the same value. + * @param {OverrideTester|null} a A tester. + * @param {OverrideTester|null} b Another tester. + * @returns {OverrideTester|null} Combined tester. + */ + static and(a, b) { + if (!b) { + return a && new OverrideTester( + a.patterns, + a.basePath, + a.endsWithWildcard + ); + } + if (!a) { + return new OverrideTester( + b.patterns, + b.basePath, + b.endsWithWildcard + ); + } + + assert.strictEqual(a.basePath, b.basePath); + return new OverrideTester( + a.patterns.concat(b.patterns), + a.basePath, + a.endsWithWildcard || b.endsWithWildcard + ); + } + + /** + * Initialize this instance. + * @param {Pattern[]} patterns The matchers. + * @param {string} basePath The base path. + * @param {boolean} endsWithWildcard If `true` then a pattern ends with `*`. + */ + constructor(patterns, basePath, endsWithWildcard = false) { + + /** @type {Pattern[]} */ + this.patterns = patterns; + + /** @type {string} */ + this.basePath = basePath; + + /** @type {boolean} */ + this.endsWithWildcard = endsWithWildcard; + } + + /** + * Test if a given path is matched or not. + * @param {string} filePath The absolute path to the target file. + * @returns {boolean} `true` if the path was matched. + */ + test(filePath) { + if (typeof filePath !== "string" || !path.isAbsolute(filePath)) { + throw new Error(`'filePath' should be an absolute path, but got ${filePath}.`); + } + const relativePath = path.relative(this.basePath, filePath); + + return this.patterns.every(({ includes, excludes }) => ( + (!includes || includes.some(m => m.match(relativePath))) && + (!excludes || !excludes.some(m => m.match(relativePath))) + )); + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {Object} a JSON compatible object. + */ + toJSON() { + if (this.patterns.length === 1) { + return { + ...patternToJson(this.patterns[0]), + basePath: this.basePath + }; + } + return { + AND: this.patterns.map(patternToJson), + basePath: this.basePath + }; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {Object} an object to display by `console.log()`. + */ + [util.inspect.custom]() { + return this.toJSON(); + } +} + +module.exports = { OverrideTester }; diff --git a/node_modules/@eslint/eslintrc/lib/index.js b/node_modules/@eslint/eslintrc/lib/index.js new file mode 100644 index 000000000..90959c16e --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/index.js @@ -0,0 +1,51 @@ +/** + * @fileoverview Package exports for @eslint/eslintrc + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { + ConfigArrayFactory, + createContext: createConfigArrayFactoryContext +} = require("./config-array-factory"); + +const { CascadingConfigArrayFactory } = require("./cascading-config-array-factory"); +const { ModuleResolver } = require("./shared/relative-module-resolver"); +const { ConfigArray, getUsedExtractedConfigs } = require("./config-array"); +const { ConfigDependency } = require("./config-array/config-dependency"); +const { ExtractedConfig } = require("./config-array/extracted-config"); +const { IgnorePattern } = require("./config-array/ignore-pattern"); +const { OverrideTester } = require("./config-array/override-tester"); +const ConfigOps = require("./shared/config-ops"); +const ConfigValidator = require("./shared/config-validator"); +const naming = require("./shared/naming"); + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +module.exports = { + + Legacy: { + ConfigArray, + createConfigArrayFactoryContext, + CascadingConfigArrayFactory, + ConfigArrayFactory, + ConfigDependency, + ExtractedConfig, + IgnorePattern, + OverrideTester, + getUsedExtractedConfigs, + + // shared + ConfigOps, + ConfigValidator, + ModuleResolver, + naming + } + +}; diff --git a/node_modules/@eslint/eslintrc/lib/shared/ajv.js b/node_modules/@eslint/eslintrc/lib/shared/ajv.js new file mode 100644 index 000000000..3fb0fbdd3 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/shared/ajv.js @@ -0,0 +1,34 @@ +/** + * @fileoverview The instance of Ajv validator. + * @author Evgeny Poberezkin + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Ajv = require("ajv"), + metaSchema = require("ajv/lib/refs/json-schema-draft-04.json"); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = (additionalOptions = {}) => { + const ajv = new Ajv({ + meta: false, + useDefaults: true, + validateSchema: false, + missingRefs: "ignore", + verbose: true, + schemaId: "auto", + ...additionalOptions + }); + + ajv.addMetaSchema(metaSchema); + // eslint-disable-next-line no-underscore-dangle + ajv._opts.defaultMeta = metaSchema.id; + + return ajv; +}; diff --git a/node_modules/@eslint/eslintrc/lib/shared/config-ops.js b/node_modules/@eslint/eslintrc/lib/shared/config-ops.js new file mode 100644 index 000000000..3b4d5699d --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/shared/config-ops.js @@ -0,0 +1,130 @@ +/** + * @fileoverview Config file operations. This file must be usable in the browser, + * so no Node-specific code can be here. + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +const RULE_SEVERITY_STRINGS = ["off", "warn", "error"], + RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce((map, value, index) => { + map[value] = index; + return map; + }, {}), + VALID_SEVERITIES = [0, 1, 2, "off", "warn", "error"]; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + + /** + * Normalizes the severity value of a rule's configuration to a number + * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally + * received from the user. A valid config value is either 0, 1, 2, the string "off" (treated the same as 0), + * the string "warn" (treated the same as 1), the string "error" (treated the same as 2), or an array + * whose first element is one of the above values. Strings are matched case-insensitively. + * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0. + */ + getRuleSeverity(ruleConfig) { + const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; + + if (severityValue === 0 || severityValue === 1 || severityValue === 2) { + return severityValue; + } + + if (typeof severityValue === "string") { + return RULE_SEVERITY[severityValue.toLowerCase()] || 0; + } + + return 0; + }, + + /** + * Converts old-style severity settings (0, 1, 2) into new-style + * severity settings (off, warn, error) for all rules. Assumption is that severity + * values have already been validated as correct. + * @param {Object} config The config object to normalize. + * @returns {void} + */ + normalizeToStrings(config) { + + if (config.rules) { + Object.keys(config.rules).forEach(ruleId => { + const ruleConfig = config.rules[ruleId]; + + if (typeof ruleConfig === "number") { + config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0]; + } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === "number") { + ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0]; + } + }); + } + }, + + /** + * Determines if the severity for the given rule configuration represents an error. + * @param {int|string|Array} ruleConfig The configuration for an individual rule. + * @returns {boolean} True if the rule represents an error, false if not. + */ + isErrorSeverity(ruleConfig) { + return module.exports.getRuleSeverity(ruleConfig) === 2; + }, + + /** + * Checks whether a given config has valid severity or not. + * @param {number|string|Array} ruleConfig The configuration for an individual rule. + * @returns {boolean} `true` if the configuration has valid severity. + */ + isValidSeverity(ruleConfig) { + let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; + + if (typeof severity === "string") { + severity = severity.toLowerCase(); + } + return VALID_SEVERITIES.indexOf(severity) !== -1; + }, + + /** + * Checks whether every rule of a given config has valid severity or not. + * @param {Object} config The configuration for rules. + * @returns {boolean} `true` if the configuration has valid severity. + */ + isEverySeverityValid(config) { + return Object.keys(config).every(ruleId => this.isValidSeverity(config[ruleId])); + }, + + /** + * Normalizes a value for a global in a config + * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in + * a global directive comment + * @returns {("readable"|"writeable"|"off")} The value normalized as a string + * @throws Error if global value is invalid + */ + normalizeConfigGlobal(configuredValue) { + switch (configuredValue) { + case "off": + return "off"; + + case true: + case "true": + case "writeable": + case "writable": + return "writable"; + + case null: + case false: + case "false": + case "readable": + case "readonly": + return "readonly"; + + default: + throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`); + } + } +}; diff --git a/node_modules/@eslint/eslintrc/lib/shared/config-validator.js b/node_modules/@eslint/eslintrc/lib/shared/config-validator.js new file mode 100644 index 000000000..d3c700127 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/shared/config-validator.js @@ -0,0 +1,324 @@ +/** + * @fileoverview Validates configs. + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const + util = require("util"), + configSchema = require("../../conf/config-schema"), + BuiltInEnvironments = require("../../conf/environments"), + ConfigOps = require("./config-ops"), + { emitDeprecationWarning } = require("./deprecation-warnings"); + +const ajv = require("./ajv")(); +const ruleValidators = new WeakMap(); +const noop = Function.prototype; + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ +let validateSchema; +const severityMap = { + error: 2, + warn: 1, + off: 0 +}; + +const validated = new WeakSet(); + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +module.exports = class ConfigValidator { + constructor({ builtInRules = new Map() } = {}) { + this.builtInRules = builtInRules; + } + + /** + * Gets a complete options schema for a rule. + * @param {{create: Function, schema: (Array|null)}} rule A new-style rule object + * @returns {Object} JSON Schema for the rule's options. + */ + getRuleOptionsSchema(rule) { + if (!rule) { + return null; + } + + const schema = rule.schema || rule.meta && rule.meta.schema; + + // Given a tuple of schemas, insert warning level at the beginning + if (Array.isArray(schema)) { + if (schema.length) { + return { + type: "array", + items: schema, + minItems: 0, + maxItems: schema.length + }; + } + return { + type: "array", + minItems: 0, + maxItems: 0 + }; + + } + + // Given a full schema, leave it alone + return schema || null; + } + + /** + * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid. + * @param {options} options The given options for the rule. + * @returns {number|string} The rule's severity value + */ + validateRuleSeverity(options) { + const severity = Array.isArray(options) ? options[0] : options; + const normSeverity = typeof severity === "string" ? severityMap[severity.toLowerCase()] : severity; + + if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) { + return normSeverity; + } + + throw new Error(`\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util.inspect(severity).replace(/'/gu, "\"").replace(/\n/gu, "")}').\n`); + + } + + /** + * Validates the non-severity options passed to a rule, based on its schema. + * @param {{create: Function}} rule The rule to validate + * @param {Array} localOptions The options for the rule, excluding severity + * @returns {void} + */ + validateRuleSchema(rule, localOptions) { + if (!ruleValidators.has(rule)) { + const schema = this.getRuleOptionsSchema(rule); + + if (schema) { + ruleValidators.set(rule, ajv.compile(schema)); + } + } + + const validateRule = ruleValidators.get(rule); + + if (validateRule) { + validateRule(localOptions); + if (validateRule.errors) { + throw new Error(validateRule.errors.map( + error => `\tValue ${JSON.stringify(error.data)} ${error.message}.\n` + ).join("")); + } + } + } + + /** + * Validates a rule's options against its schema. + * @param {{create: Function}|null} rule The rule that the config is being validated for + * @param {string} ruleId The rule's unique name. + * @param {Array|number} options The given options for the rule. + * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined, + * no source is prepended to the message. + * @returns {void} + */ + validateRuleOptions(rule, ruleId, options, source = null) { + try { + const severity = this.validateRuleSeverity(options); + + if (severity !== 0) { + this.validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []); + } + } catch (err) { + const enhancedMessage = `Configuration for rule "${ruleId}" is invalid:\n${err.message}`; + + if (typeof source === "string") { + throw new Error(`${source}:\n\t${enhancedMessage}`); + } else { + throw new Error(enhancedMessage); + } + } + } + + /** + * Validates an environment object + * @param {Object} environment The environment config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded environments. + * @returns {void} + */ + validateEnvironment( + environment, + source, + getAdditionalEnv = noop + ) { + + // not having an environment is ok + if (!environment) { + return; + } + + Object.keys(environment).forEach(id => { + const env = getAdditionalEnv(id) || BuiltInEnvironments.get(id) || null; + + if (!env) { + const message = `${source}:\n\tEnvironment key "${id}" is unknown\n`; + + throw new Error(message); + } + }); + } + + /** + * Validates a rules config object + * @param {Object} rulesConfig The rules config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(ruleId:string): Object} getAdditionalRule A map from strings to loaded rules + * @returns {void} + */ + validateRules( + rulesConfig, + source, + getAdditionalRule = noop + ) { + if (!rulesConfig) { + return; + } + + Object.keys(rulesConfig).forEach(id => { + const rule = getAdditionalRule(id) || this.builtInRules.get(id) || null; + + this.validateRuleOptions(rule, id, rulesConfig[id], source); + }); + } + + /** + * Validates a `globals` section of a config file + * @param {Object} globalsConfig The `globals` section + * @param {string|null} source The name of the configuration source to report in the event of an error. + * @returns {void} + */ + validateGlobals(globalsConfig, source = null) { + if (!globalsConfig) { + return; + } + + Object.entries(globalsConfig) + .forEach(([configuredGlobal, configuredValue]) => { + try { + ConfigOps.normalizeConfigGlobal(configuredValue); + } catch (err) { + throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\n${err.message}`); + } + }); + } + + /** + * Validate `processor` configuration. + * @param {string|undefined} processorName The processor name. + * @param {string} source The name of config file. + * @param {function(id:string): Processor} getProcessor The getter of defined processors. + * @returns {void} + */ + validateProcessor(processorName, source, getProcessor) { + if (processorName && !getProcessor(processorName)) { + throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`); + } + } + + /** + * Formats an array of schema validation errors. + * @param {Array} errors An array of error messages to format. + * @returns {string} Formatted error message + */ + formatErrors(errors) { + return errors.map(error => { + if (error.keyword === "additionalProperties") { + const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty; + + return `Unexpected top-level property "${formattedPropertyPath}"`; + } + if (error.keyword === "type") { + const formattedField = error.dataPath.slice(1); + const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join("/") : error.schema; + const formattedValue = JSON.stringify(error.data); + + return `Property "${formattedField}" is the wrong type (expected ${formattedExpectedType} but got \`${formattedValue}\`)`; + } + + const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath; + + return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`; + }).map(message => `\t- ${message}.\n`).join(""); + } + + /** + * Validates the top level properties of the config object. + * @param {Object} config The config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @returns {void} + */ + validateConfigSchema(config, source = null) { + validateSchema = this.validateSchema || ajv.compile(configSchema); + + if (!validateSchema(config)) { + throw new Error(`ESLint configuration in ${source} is invalid:\n${this.formatErrors(validateSchema.errors)}`); + } + + if (Object.hasOwnProperty.call(config, "ecmaFeatures")) { + emitDeprecationWarning(source, "ESLINT_LEGACY_ECMAFEATURES"); + } + } + + /** + * Validates an entire config object. + * @param {Object} config The config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(ruleId:string): Object} [getAdditionalRule] A map from strings to loaded rules. + * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded envs. + * @returns {void} + */ + validate(config, source, getAdditionalRule, getAdditionalEnv) { + this.validateConfigSchema(config, source); + this.validateRules(config.rules, source, getAdditionalRule); + this.validateEnvironment(config.env, source, getAdditionalEnv); + this.validateGlobals(config.globals, source); + + for (const override of config.overrides || []) { + this.validateRules(override.rules, source, getAdditionalRule); + this.validateEnvironment(override.env, source, getAdditionalEnv); + this.validateGlobals(config.globals, source); + } + } + + /** + * Validate config array object. + * @param {ConfigArray} configArray The config array to validate. + * @returns {void} + */ + validateConfigArray(configArray) { + const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments); + const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors); + const getPluginRule = Map.prototype.get.bind(configArray.pluginRules); + + // Validate. + for (const element of configArray) { + if (validated.has(element)) { + continue; + } + validated.add(element); + + this.validateEnvironment(element.env, element.name, getPluginEnv); + this.validateGlobals(element.globals, element.name); + this.validateProcessor(element.processor, element.name, getPluginProcessor); + this.validateRules(element.rules, element.name, getPluginRule); + } + } + +}; diff --git a/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js b/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js new file mode 100644 index 000000000..e1481a2e9 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js @@ -0,0 +1,56 @@ +/** + * @fileoverview Provide the function that emits deprecation warnings. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const path = require("path"); +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +// Defitions for deprecation warnings. +const deprecationWarningMessages = { + ESLINT_LEGACY_ECMAFEATURES: + "The 'ecmaFeatures' config file property is deprecated and has no effect.", + ESLINT_PERSONAL_CONFIG_LOAD: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please use a config file per project or the '--config' option.", + ESLINT_PERSONAL_CONFIG_SUPPRESS: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please remove it or add 'root:true' to the config files in your " + + "projects in order to avoid loading '~/.eslintrc.*' accidentally." +}; + +/** + * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted + * for each unique file path, but repeated invocations with the same file path have no effect. + * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active. + * @param {string} source The name of the configuration source to report the warning for. + * @param {string} errorCode The warning message to show. + * @returns {void} + */ +const emitDeprecationWarning = lodash.memoize((source, errorCode) => { + const rel = path.relative(process.cwd(), source); + const message = deprecationWarningMessages[errorCode]; + + process.emitWarning( + `${message} (found in "${rel}")`, + "DeprecationWarning", + errorCode + ); +}, (...args) => JSON.stringify(args)); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + emitDeprecationWarning +}; diff --git a/node_modules/@eslint/eslintrc/lib/shared/naming.js b/node_modules/@eslint/eslintrc/lib/shared/naming.js new file mode 100644 index 000000000..32cff9453 --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/shared/naming.js @@ -0,0 +1,97 @@ +/** + * @fileoverview Common helpers for naming of plugins, formatters and configs + */ +"use strict"; + +const NAMESPACE_REGEX = /^@.*\//iu; + +/** + * Brings package name to correct format based on prefix + * @param {string} name The name of the package. + * @param {string} prefix Can be either "eslint-plugin", "eslint-config" or "eslint-formatter" + * @returns {string} Normalized name of the package + * @private + */ +function normalizePackageName(name, prefix) { + let normalizedName = name; + + /** + * On Windows, name can come in with Windows slashes instead of Unix slashes. + * Normalize to Unix first to avoid errors later on. + * https://github.com/eslint/eslint/issues/5644 + */ + if (normalizedName.includes("\\")) { + normalizedName = normalizedName.replace(/\\/gu, "/"); + } + + if (normalizedName.charAt(0) === "@") { + + /** + * it's a scoped package + * package name is the prefix, or just a username + */ + const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, "u"), + scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, "u"); + + if (scopedPackageShortcutRegex.test(normalizedName)) { + normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`); + } else if (!scopedPackageNameRegex.test(normalizedName.split("/")[1])) { + + /** + * for scoped packages, insert the prefix after the first / unless + * the path is already @scope/eslint or @scope/eslint-xxx-yyy + */ + normalizedName = normalizedName.replace(/^@([^/]+)\/(.*)$/u, `@$1/${prefix}-$2`); + } + } else if (!normalizedName.startsWith(`${prefix}-`)) { + normalizedName = `${prefix}-${normalizedName}`; + } + + return normalizedName; +} + +/** + * Removes the prefix from a fullname. + * @param {string} fullname The term which may have the prefix. + * @param {string} prefix The prefix to remove. + * @returns {string} The term without prefix. + */ +function getShorthandName(fullname, prefix) { + if (fullname[0] === "@") { + let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, "u").exec(fullname); + + if (matchResult) { + return matchResult[1]; + } + + matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, "u").exec(fullname); + if (matchResult) { + return `${matchResult[1]}/${matchResult[2]}`; + } + } else if (fullname.startsWith(`${prefix}-`)) { + return fullname.slice(prefix.length + 1); + } + + return fullname; +} + +/** + * Gets the scope (namespace) of a term. + * @param {string} term The term which may have the namespace. + * @returns {string} The namespace of the term if it has one. + */ +function getNamespaceFromTerm(term) { + const match = term.match(NAMESPACE_REGEX); + + return match ? match[0] : ""; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + normalizePackageName, + getShorthandName, + getNamespaceFromTerm +}; diff --git a/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js b/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js new file mode 100644 index 000000000..80335c5cf --- /dev/null +++ b/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js @@ -0,0 +1,44 @@ +/** + * Utility for resolving a module relative to another module + * @author Teddy Katz + */ + +"use strict"; + +const Module = require("module"); + +/* + * `Module.createRequire` is added in v12.2.0. It supports URL as well. + * We only support the case where the argument is a filepath, not a URL. + */ +// eslint-disable-next-line node/no-unsupported-features/node-builtins, node/no-deprecated-api +const createRequire = Module.createRequire || Module.createRequireFromPath; + +module.exports = { + + /** + * Resolves a Node module relative to another module + * @param {string} moduleName The name of a Node module, or a path to a Node module. + * @param {string} relativeToPath An absolute path indicating the module that `moduleName` should be resolved relative to. This must be + * a file rather than a directory, but the file need not actually exist. + * @returns {string} The absolute path that would result from calling `require.resolve(moduleName)` in a file located at `relativeToPath` + */ + resolve(moduleName, relativeToPath) { + try { + return createRequire(relativeToPath).resolve(moduleName); + } catch (error) { + + // This `if` block is for older Node.js than 12.0.0. We can remove this block in the future. + if ( + typeof error === "object" && + error !== null && + error.code === "MODULE_NOT_FOUND" && + !error.requireStack && + error.message.includes(moduleName) + ) { + error.message += `\nRequire stack:\n- ${relativeToPath}`; + } + throw error; + } + } +}; diff --git a/node_modules/@eslint/eslintrc/node_modules/ignore/CHANGELOG.md b/node_modules/@eslint/eslintrc/node_modules/ignore/CHANGELOG.md new file mode 100644 index 000000000..2b250132c --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/ignore/CHANGELOG.md @@ -0,0 +1,19 @@ +# `node-ignore` 4 ChangeLog + +# 4.x + +## 2018-06-22, Version 4.0.0 + +- **SEMVER-MAJOR**: Drop support for node < 6 by default. +- **FEATURE**: supports the missing character ranges and sets, such as `*.[a-z]` and `*.[jJ][pP][gG]` +- **FEATURE**: new option: `ignorecase` to make `ignore` case sensitive. +- **FEATURE**: supports question mark which matches a single character. +- **PATCH**: fixes typescript declaration. + +## ~ 2018-08-09, Version 4.0.1 - 4.0.5 + +- **PATCH**: updates README.md about frequent asked quesions from github issues. + +## 2018-08-12, Version 4.0.6 + +- **PATCH**: `Object.prototype` methods will not ruin the result any more. diff --git a/node_modules/@eslint/eslintrc/node_modules/ignore/LICENSE-MIT b/node_modules/@eslint/eslintrc/node_modules/ignore/LICENSE-MIT new file mode 100755 index 000000000..825533e33 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/ignore/LICENSE-MIT @@ -0,0 +1,21 @@ +Copyright (c) 2013 Kael Zhang , contributors +http://kael.me/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/@eslint/eslintrc/node_modules/ignore/README.md b/node_modules/@eslint/eslintrc/node_modules/ignore/README.md new file mode 100755 index 000000000..c4d8230cc --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/ignore/README.md @@ -0,0 +1,307 @@ + + + + + + + + + + + + + +
LinuxOS XWindowsCoverageDownloads
+ + Build Status + + + Windows Build Status + + + Coverage Status + + + npm module downloads per month +
+ +# ignore + +`ignore` is a manager, filter and parser which implemented in pure JavaScript according to the .gitignore [spec](http://git-scm.com/docs/gitignore). + +Pay attention that [`minimatch`](https://www.npmjs.org/package/minimatch) does not work in the gitignore way. To filter filenames according to .gitignore file, I recommend this module. + +##### Tested on + +- Linux + Node: `0.8` - `7.x` +- Windows + Node: `0.10` - `7.x`, node < `0.10` is not tested due to the lack of support of appveyor. + +Actually, `ignore` does not rely on any versions of node specially. + +Since `4.0.0`, ignore will no longer support `node < 6` by default, to use in node < 6, `require('ignore/legacy')`. For details, see [CHANGELOG](https://github.com/kaelzhang/node-ignore/blob/master/CHANGELOG.md). + +## Table Of Main Contents + +- [Usage](#usage) +- [`Pathname` Conventions](#pathname-conventions) +- [Guide for 2.x -> 3.x](#upgrade-2x---3x) +- [Guide for 3.x -> 4.x](#upgrade-3x---4x) +- See Also: + - [`glob-gitignore`](https://www.npmjs.com/package/glob-gitignore) matches files using patterns and filters them according to gitignore rules. + +## Usage + +```js +import ignore from 'ignore' +const ig = ignore().add(['.abc/*', '!.abc/d/']) +``` + +### Filter the given paths + +```js +const paths = [ + '.abc/a.js', // filtered out + '.abc/d/e.js' // included +] + +ig.filter(paths) // ['.abc/d/e.js'] +ig.ignores('.abc/a.js') // true +``` + +### As the filter function + +```js +paths.filter(ig.createFilter()); // ['.abc/d/e.js'] +``` + +### Win32 paths will be handled + +```js +ig.filter(['.abc\\a.js', '.abc\\d\\e.js']) +// if the code above runs on windows, the result will be +// ['.abc\\d\\e.js'] +``` + +## Why another ignore? + +- `ignore` is a standalone module, and is much simpler so that it could easy work with other programs, unlike [isaacs](https://npmjs.org/~isaacs)'s [fstream-ignore](https://npmjs.org/package/fstream-ignore) which must work with the modules of the fstream family. + +- `ignore` only contains utility methods to filter paths according to the specified ignore rules, so + - `ignore` never try to find out ignore rules by traversing directories or fetching from git configurations. + - `ignore` don't cares about sub-modules of git projects. + +- Exactly according to [gitignore man page](http://git-scm.com/docs/gitignore), fixes some known matching issues of fstream-ignore, such as: + - '`/*.js`' should only match '`a.js`', but not '`abc/a.js`'. + - '`**/foo`' should match '`foo`' anywhere. + - Prevent re-including a file if a parent directory of that file is excluded. + - Handle trailing whitespaces: + - `'a '`(one space) should not match `'a '`(two spaces). + - `'a \ '` matches `'a '` + - All test cases are verified with the result of `git check-ignore`. + +# Methods + +## .add(pattern: string | Ignore): this +## .add(patterns: Array): this + +- **pattern** `String | Ignore` An ignore pattern string, or the `Ignore` instance +- **patterns** `Array` Array of ignore patterns. + +Adds a rule or several rules to the current manager. + +Returns `this` + +Notice that a line starting with `'#'`(hash) is treated as a comment. Put a backslash (`'\'`) in front of the first hash for patterns that begin with a hash, if you want to ignore a file with a hash at the beginning of the filename. + +```js +ignore().add('#abc').ignores('#abc') // false +ignore().add('\#abc').ignores('#abc') // true +``` + +`pattern` could either be a line of ignore pattern or a string of multiple ignore patterns, which means we could just `ignore().add()` the content of a ignore file: + +```js +ignore() +.add(fs.readFileSync(filenameOfGitignore).toString()) +.filter(filenames) +``` + +`pattern` could also be an `ignore` instance, so that we could easily inherit the rules of another `Ignore` instance. + +## .addIgnoreFile(path) + +REMOVED in `3.x` for now. + +To upgrade `ignore@2.x` up to `3.x`, use + +```js +import fs from 'fs' + +if (fs.existsSync(filename)) { + ignore().add(fs.readFileSync(filename).toString()) +} +``` + +instead. + +## .filter(paths: Array): Array + +```ts +type Pathname = string +``` + +Filters the given array of pathnames, and returns the filtered array. + +- **paths** `Array.` The array of `pathname`s to be filtered. + +### `Pathname` Conventions: + +#### 1. `Pathname` should be a `path.relative()`d pathname + +`Pathname` should be a string that have been `path.join()`ed, or the return value of `path.relative()` to the current directory. + +```js +// WRONG +ig.ignores('./abc') + +// WRONG, for it will never happen. +// If the gitignore rule locates at the root directory, +// `'/abc'` should be changed to `'abc'`. +// ``` +// path.relative('/', '/abc') -> 'abc' +// ``` +ig.ignores('/abc') + +// Right +ig.ignores('abc') + +// Right +ig.ignores(path.join('./abc')) // path.join('./abc') -> 'abc' +``` + +In other words, each `Pathname` here should be a relative path to the directory of the gitignore rules. + +Suppose the dir structure is: + +``` +/path/to/your/repo + |-- a + | |-- a.js + | + |-- .b + | + |-- .c + |-- .DS_store +``` + +Then the `paths` might be like this: + +```js +[ + 'a/a.js' + '.b', + '.c/.DS_store' +] +``` + +Usually, you could use [`glob`](http://npmjs.org/package/glob) with `option.mark = true` to fetch the structure of the current directory: + +```js +import glob from 'glob' + +glob('**', { + // Adds a / character to directory matches. + mark: true +}, (err, files) => { + if (err) { + return console.error(err) + } + + let filtered = ignore().add(patterns).filter(files) + console.log(filtered) +}) +``` + +#### 2. filenames and dirnames + +`node-ignore` does NO `fs.stat` during path matching, so for the example below: + +```js +ig.add('config/') + +// `ig` does NOT know if 'config' is a normal file, directory or something +ig.ignores('config') // And it returns `false` + +ig.ignores('config/') // returns `true` +``` + +Specially for people who develop some library based on `node-ignore`, it is important to understand that. + +## .ignores(pathname: Pathname): boolean + +> new in 3.2.0 + +Returns `Boolean` whether `pathname` should be ignored. + +```js +ig.ignores('.abc/a.js') // true +``` + +## .createFilter() + +Creates a filter function which could filter an array of paths with `Array.prototype.filter`. + +Returns `function(path)` the filter function. + +## `options.ignorecase` since 4.0.0 + +Similar as the `core.ignorecase` option of [git-config](https://git-scm.com/docs/git-config), `node-ignore` will be case insensitive if `options.ignorecase` is set to `true` (default value), otherwise case sensitive. + +```js +const ig = ignore({ + ignorecase: false +}) + +ig.add('*.png') + +ig.ignores('*.PNG') // false +``` + +**** + +# Upgrade Guide + +## Upgrade 2.x -> 3.x + +- All `options` of 2.x are unnecessary and removed, so just remove them. +- `ignore()` instance is no longer an [`EventEmitter`](nodejs.org/api/events.html), and all events are unnecessary and removed. +- `.addIgnoreFile()` is removed, see the [.addIgnoreFile](#addignorefilepath) section for details. + +## Upgrade 3.x -> 4.x + +Since `4.0.0`, `ignore` will no longer support node < 6, to use `ignore` in node < 6: + +```js +var ignore = require('ignore/legacy') +``` + +**** + +# Collaborators + +- [@whitecolor](https://github.com/whitecolor) *Alex* +- [@SamyPesse](https://github.com/SamyPesse) *Samy Pessé* +- [@azproduction](https://github.com/azproduction) *Mikhail Davydov* +- [@TrySound](https://github.com/TrySound) *Bogdan Chadkin* +- [@JanMattner](https://github.com/JanMattner) *Jan Mattner* +- [@ntwb](https://github.com/ntwb) *Stephen Edgar* +- [@kasperisager](https://github.com/kasperisager) *Kasper Isager* +- [@sandersn](https://github.com/sandersn) *Nathan Shively-Sanders* diff --git a/node_modules/@eslint/eslintrc/node_modules/ignore/index.d.ts b/node_modules/@eslint/eslintrc/node_modules/ignore/index.d.ts new file mode 100644 index 000000000..be9d5f8ea --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/ignore/index.d.ts @@ -0,0 +1,45 @@ +interface Ignore { + /** + * Adds a rule rules to the current manager. + * @param {string | Ignore} pattern + * @returns IgnoreBase + */ + add(pattern: string | Ignore): Ignore + /** + * Adds several rules to the current manager. + * @param {string[]} patterns + * @returns IgnoreBase + */ + add(patterns: (string | Ignore)[]): Ignore + + /** + * Filters the given array of pathnames, and returns the filtered array. + * NOTICE that each path here should be a relative path to the root of your repository. + * @param paths the array of paths to be filtered. + * @returns The filtered array of paths + */ + filter(paths: string[]): string[] + /** + * Creates a filter function which could filter + * an array of paths with Array.prototype.filter. + */ + createFilter(): (path: string) => boolean + + /** + * Returns Boolean whether pathname should be ignored. + * @param {string} pathname a path to check + * @returns boolean + */ + ignores(pathname: string): boolean +} + +interface Options { + ignorecase?: boolean +} + +/** + * Creates new ignore manager. + */ +declare function ignore(options?: Options): Ignore + +export default ignore diff --git a/node_modules/@eslint/eslintrc/node_modules/ignore/index.js b/node_modules/@eslint/eslintrc/node_modules/ignore/index.js new file mode 100755 index 000000000..62c5cf71e --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/ignore/index.js @@ -0,0 +1,463 @@ +// A simple implementation of make-array +function make_array (subject) { + return Array.isArray(subject) + ? subject + : [subject] +} + +const REGEX_BLANK_LINE = /^\s+$/ +const REGEX_LEADING_EXCAPED_EXCLAMATION = /^\\!/ +const REGEX_LEADING_EXCAPED_HASH = /^\\#/ +const SLASH = '/' +const KEY_IGNORE = typeof Symbol !== 'undefined' + ? Symbol.for('node-ignore') + /* istanbul ignore next */ + : 'node-ignore' + +const define = (object, key, value) => + Object.defineProperty(object, key, {value}) + +const REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g + +// Sanitize the range of a regular expression +// The cases are complicated, see test cases for details +const sanitizeRange = range => range.replace( + REGEX_REGEXP_RANGE, + (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) + ? match + // Invalid range (out of order) which is ok for gitignore rules but + // fatal for JavaScript regular expression, so eliminate it. + : '' +) + +// > If the pattern ends with a slash, +// > it is removed for the purpose of the following description, +// > but it would only find a match with a directory. +// > In other words, foo/ will match a directory foo and paths underneath it, +// > but will not match a regular file or a symbolic link foo +// > (this is consistent with the way how pathspec works in general in Git). +// '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`' +// -> ignore-rules will not deal with it, because it costs extra `fs.stat` call +// you could use option `mark: true` with `glob` + +// '`foo/`' should not continue with the '`..`' +const DEFAULT_REPLACER_PREFIX = [ + + // > Trailing spaces are ignored unless they are quoted with backslash ("\") + [ + // (a\ ) -> (a ) + // (a ) -> (a) + // (a \ ) -> (a ) + /\\?\s+$/, + match => match.indexOf('\\') === 0 + ? ' ' + : '' + ], + + // replace (\ ) with ' ' + [ + /\\\s/g, + () => ' ' + ], + + // Escape metacharacters + // which is written down by users but means special for regular expressions. + + // > There are 12 characters with special meanings: + // > - the backslash \, + // > - the caret ^, + // > - the dollar sign $, + // > - the period or dot ., + // > - the vertical bar or pipe symbol |, + // > - the question mark ?, + // > - the asterisk or star *, + // > - the plus sign +, + // > - the opening parenthesis (, + // > - the closing parenthesis ), + // > - and the opening square bracket [, + // > - the opening curly brace {, + // > These special characters are often called "metacharacters". + [ + /[\\^$.|*+(){]/g, + match => `\\${match}` + ], + + [ + // > [abc] matches any character inside the brackets + // > (in this case a, b, or c); + /\[([^\]/]*)($|\])/g, + (match, p1, p2) => p2 === ']' + ? `[${sanitizeRange(p1)}]` + : `\\${match}` + ], + + [ + // > a question mark (?) matches a single character + /(?!\\)\?/g, + () => '[^/]' + ], + + // leading slash + [ + + // > A leading slash matches the beginning of the pathname. + // > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". + // A leading slash matches the beginning of the pathname + /^\//, + () => '^' + ], + + // replace special metacharacter slash after the leading slash + [ + /\//g, + () => '\\/' + ], + + [ + // > A leading "**" followed by a slash means match in all directories. + // > For example, "**/foo" matches file or directory "foo" anywhere, + // > the same as pattern "foo". + // > "**/foo/bar" matches file or directory "bar" anywhere that is directly + // > under directory "foo". + // Notice that the '*'s have been replaced as '\\*' + /^\^*\\\*\\\*\\\//, + + // '**/foo' <-> 'foo' + () => '^(?:.*\\/)?' + ] +] + +const DEFAULT_REPLACER_SUFFIX = [ + // starting + [ + // there will be no leading '/' + // (which has been replaced by section "leading slash") + // If starts with '**', adding a '^' to the regular expression also works + /^(?=[^^])/, + function startingReplacer () { + return !/\/(?!$)/.test(this) + // > If the pattern does not contain a slash /, + // > Git treats it as a shell glob pattern + // Actually, if there is only a trailing slash, + // git also treats it as a shell glob pattern + ? '(?:^|\\/)' + + // > Otherwise, Git treats the pattern as a shell glob suitable for + // > consumption by fnmatch(3) + : '^' + } + ], + + // two globstars + [ + // Use lookahead assertions so that we could match more than one `'/**'` + /\\\/\\\*\\\*(?=\\\/|$)/g, + + // Zero, one or several directories + // should not use '*', or it will be replaced by the next replacer + + // Check if it is not the last `'/**'` + (match, index, str) => index + 6 < str.length + + // case: /**/ + // > A slash followed by two consecutive asterisks then a slash matches + // > zero or more directories. + // > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on. + // '/**/' + ? '(?:\\/[^\\/]+)*' + + // case: /** + // > A trailing `"/**"` matches everything inside. + + // #21: everything inside but it should not include the current folder + : '\\/.+' + ], + + // intermediate wildcards + [ + // Never replace escaped '*' + // ignore rule '\*' will match the path '*' + + // 'abc.*/' -> go + // 'abc.*' -> skip this rule + /(^|[^\\]+)\\\*(?=.+)/g, + + // '*.js' matches '.js' + // '*.js' doesn't match 'abc' + (match, p1) => `${p1}[^\\/]*` + ], + + // trailing wildcard + [ + /(\^|\\\/)?\\\*$/, + (match, p1) => { + const prefix = p1 + // '\^': + // '/*' does not match '' + // '/*' does not match everything + + // '\\\/': + // 'abc/*' does not match 'abc/' + ? `${p1}[^/]+` + + // 'a*' matches 'a' + // 'a*' matches 'aa' + : '[^/]*' + + return `${prefix}(?=$|\\/$)` + } + ], + + [ + // unescape + /\\\\\\/g, + () => '\\' + ] +] + +const POSITIVE_REPLACERS = [ + ...DEFAULT_REPLACER_PREFIX, + + // 'f' + // matches + // - /f(end) + // - /f/ + // - (start)f(end) + // - (start)f/ + // doesn't match + // - oof + // - foo + // pseudo: + // -> (^|/)f(/|$) + + // ending + [ + // 'js' will not match 'js.' + // 'ab' will not match 'abc' + /(?:[^*/])$/, + + // 'js*' will not match 'a.js' + // 'js/' will not match 'a.js' + // 'js' will match 'a.js' and 'a.js/' + match => `${match}(?=$|\\/)` + ], + + ...DEFAULT_REPLACER_SUFFIX +] + +const NEGATIVE_REPLACERS = [ + ...DEFAULT_REPLACER_PREFIX, + + // #24, #38 + // The MISSING rule of [gitignore docs](https://git-scm.com/docs/gitignore) + // A negative pattern without a trailing wildcard should not + // re-include the things inside that directory. + + // eg: + // ['node_modules/*', '!node_modules'] + // should ignore `node_modules/a.js` + [ + /(?:[^*])$/, + match => `${match}(?=$|\\/$)` + ], + + ...DEFAULT_REPLACER_SUFFIX +] + +// A simple cache, because an ignore rule only has only one certain meaning +const cache = Object.create(null) + +// @param {pattern} +const make_regex = (pattern, negative, ignorecase) => { + const r = cache[pattern] + if (r) { + return r + } + + const replacers = negative + ? NEGATIVE_REPLACERS + : POSITIVE_REPLACERS + + const source = replacers.reduce( + (prev, current) => prev.replace(current[0], current[1].bind(pattern)), + pattern + ) + + return cache[pattern] = ignorecase + ? new RegExp(source, 'i') + : new RegExp(source) +} + +// > A blank line matches no files, so it can serve as a separator for readability. +const checkPattern = pattern => pattern + && typeof pattern === 'string' + && !REGEX_BLANK_LINE.test(pattern) + + // > A line starting with # serves as a comment. + && pattern.indexOf('#') !== 0 + +const createRule = (pattern, ignorecase) => { + const origin = pattern + let negative = false + + // > An optional prefix "!" which negates the pattern; + if (pattern.indexOf('!') === 0) { + negative = true + pattern = pattern.substr(1) + } + + pattern = pattern + // > Put a backslash ("\") in front of the first "!" for patterns that + // > begin with a literal "!", for example, `"\!important!.txt"`. + .replace(REGEX_LEADING_EXCAPED_EXCLAMATION, '!') + // > Put a backslash ("\") in front of the first hash for patterns that + // > begin with a hash. + .replace(REGEX_LEADING_EXCAPED_HASH, '#') + + const regex = make_regex(pattern, negative, ignorecase) + + return { + origin, + pattern, + negative, + regex + } +} + +class IgnoreBase { + constructor ({ + ignorecase = true + } = {}) { + this._rules = [] + this._ignorecase = ignorecase + define(this, KEY_IGNORE, true) + this._initCache() + } + + _initCache () { + this._cache = Object.create(null) + } + + // @param {Array.|string|Ignore} pattern + add (pattern) { + this._added = false + + if (typeof pattern === 'string') { + pattern = pattern.split(/\r?\n/g) + } + + make_array(pattern).forEach(this._addPattern, this) + + // Some rules have just added to the ignore, + // making the behavior changed. + if (this._added) { + this._initCache() + } + + return this + } + + // legacy + addPattern (pattern) { + return this.add(pattern) + } + + _addPattern (pattern) { + // #32 + if (pattern && pattern[KEY_IGNORE]) { + this._rules = this._rules.concat(pattern._rules) + this._added = true + return + } + + if (checkPattern(pattern)) { + const rule = createRule(pattern, this._ignorecase) + this._added = true + this._rules.push(rule) + } + } + + filter (paths) { + return make_array(paths).filter(path => this._filter(path)) + } + + createFilter () { + return path => this._filter(path) + } + + ignores (path) { + return !this._filter(path) + } + + // @returns `Boolean` true if the `path` is NOT ignored + _filter (path, slices) { + if (!path) { + return false + } + + if (path in this._cache) { + return this._cache[path] + } + + if (!slices) { + // path/to/a.js + // ['path', 'to', 'a.js'] + slices = path.split(SLASH) + } + + slices.pop() + + return this._cache[path] = slices.length + // > It is not possible to re-include a file if a parent directory of + // > that file is excluded. + // If the path contains a parent directory, check the parent first + ? this._filter(slices.join(SLASH) + SLASH, slices) + && this._test(path) + + // Or only test the path + : this._test(path) + } + + // @returns {Boolean} true if a file is NOT ignored + _test (path) { + // Explicitly define variable type by setting matched to `0` + let matched = 0 + + this._rules.forEach(rule => { + // if matched = true, then we only test negative rules + // if matched = false, then we test non-negative rules + if (!(matched ^ rule.negative)) { + matched = rule.negative ^ rule.regex.test(path) + } + }) + + return !matched + } +} + +// Windows +// -------------------------------------------------------------- +/* istanbul ignore if */ +if ( + // Detect `process` so that it can run in browsers. + typeof process !== 'undefined' + && ( + process.env && process.env.IGNORE_TEST_WIN32 + || process.platform === 'win32' + ) +) { + const filter = IgnoreBase.prototype._filter + + /* eslint no-control-regex: "off" */ + const make_posix = str => /^\\\\\?\\/.test(str) + || /[^\x00-\x80]+/.test(str) + ? str + : str.replace(/\\/g, '/') + + IgnoreBase.prototype._filter = function filterWin32 (path, slices) { + path = make_posix(path) + return filter.call(this, path, slices) + } +} + +module.exports = options => new IgnoreBase(options) diff --git a/node_modules/@eslint/eslintrc/node_modules/ignore/legacy.js b/node_modules/@eslint/eslintrc/node_modules/ignore/legacy.js new file mode 100644 index 000000000..14f377d77 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/ignore/legacy.js @@ -0,0 +1,466 @@ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +// A simple implementation of make-array +function make_array(subject) { + return Array.isArray(subject) ? subject : [subject]; +} + +var REGEX_BLANK_LINE = /^\s+$/; +var REGEX_LEADING_EXCAPED_EXCLAMATION = /^\\!/; +var REGEX_LEADING_EXCAPED_HASH = /^\\#/; +var SLASH = '/'; +var KEY_IGNORE = typeof Symbol !== 'undefined' ? Symbol.for('node-ignore') +/* istanbul ignore next */ +: 'node-ignore'; + +var define = function define(object, key, value) { + return Object.defineProperty(object, key, { value }); +}; + +var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g; + +// Sanitize the range of a regular expression +// The cases are complicated, see test cases for details +var sanitizeRange = function sanitizeRange(range) { + return range.replace(REGEX_REGEXP_RANGE, function (match, from, to) { + return from.charCodeAt(0) <= to.charCodeAt(0) ? match + // Invalid range (out of order) which is ok for gitignore rules but + // fatal for JavaScript regular expression, so eliminate it. + : ''; + }); +}; + +// > If the pattern ends with a slash, +// > it is removed for the purpose of the following description, +// > but it would only find a match with a directory. +// > In other words, foo/ will match a directory foo and paths underneath it, +// > but will not match a regular file or a symbolic link foo +// > (this is consistent with the way how pathspec works in general in Git). +// '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`' +// -> ignore-rules will not deal with it, because it costs extra `fs.stat` call +// you could use option `mark: true` with `glob` + +// '`foo/`' should not continue with the '`..`' +var DEFAULT_REPLACER_PREFIX = [ + +// > Trailing spaces are ignored unless they are quoted with backslash ("\") +[ +// (a\ ) -> (a ) +// (a ) -> (a) +// (a \ ) -> (a ) +/\\?\s+$/, function (match) { + return match.indexOf('\\') === 0 ? ' ' : ''; +}], + +// replace (\ ) with ' ' +[/\\\s/g, function () { + return ' '; +}], + +// Escape metacharacters +// which is written down by users but means special for regular expressions. + +// > There are 12 characters with special meanings: +// > - the backslash \, +// > - the caret ^, +// > - the dollar sign $, +// > - the period or dot ., +// > - the vertical bar or pipe symbol |, +// > - the question mark ?, +// > - the asterisk or star *, +// > - the plus sign +, +// > - the opening parenthesis (, +// > - the closing parenthesis ), +// > - and the opening square bracket [, +// > - the opening curly brace {, +// > These special characters are often called "metacharacters". +[/[\\^$.|*+(){]/g, function (match) { + return `\\${match}`; +}], [ +// > [abc] matches any character inside the brackets +// > (in this case a, b, or c); +/\[([^\]/]*)($|\])/g, function (match, p1, p2) { + return p2 === ']' ? `[${sanitizeRange(p1)}]` : `\\${match}`; +}], [ +// > a question mark (?) matches a single character +/(?!\\)\?/g, function () { + return '[^/]'; +}], + +// leading slash +[ + +// > A leading slash matches the beginning of the pathname. +// > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". +// A leading slash matches the beginning of the pathname +/^\//, function () { + return '^'; +}], + +// replace special metacharacter slash after the leading slash +[/\//g, function () { + return '\\/'; +}], [ +// > A leading "**" followed by a slash means match in all directories. +// > For example, "**/foo" matches file or directory "foo" anywhere, +// > the same as pattern "foo". +// > "**/foo/bar" matches file or directory "bar" anywhere that is directly +// > under directory "foo". +// Notice that the '*'s have been replaced as '\\*' +/^\^*\\\*\\\*\\\//, + +// '**/foo' <-> 'foo' +function () { + return '^(?:.*\\/)?'; +}]]; + +var DEFAULT_REPLACER_SUFFIX = [ +// starting +[ +// there will be no leading '/' +// (which has been replaced by section "leading slash") +// If starts with '**', adding a '^' to the regular expression also works +/^(?=[^^])/, function startingReplacer() { + return !/\/(?!$)/.test(this) + // > If the pattern does not contain a slash /, + // > Git treats it as a shell glob pattern + // Actually, if there is only a trailing slash, + // git also treats it as a shell glob pattern + ? '(?:^|\\/)' + + // > Otherwise, Git treats the pattern as a shell glob suitable for + // > consumption by fnmatch(3) + : '^'; +}], + +// two globstars +[ +// Use lookahead assertions so that we could match more than one `'/**'` +/\\\/\\\*\\\*(?=\\\/|$)/g, + +// Zero, one or several directories +// should not use '*', or it will be replaced by the next replacer + +// Check if it is not the last `'/**'` +function (match, index, str) { + return index + 6 < str.length + + // case: /**/ + // > A slash followed by two consecutive asterisks then a slash matches + // > zero or more directories. + // > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on. + // '/**/' + ? '(?:\\/[^\\/]+)*' + + // case: /** + // > A trailing `"/**"` matches everything inside. + + // #21: everything inside but it should not include the current folder + : '\\/.+'; +}], + +// intermediate wildcards +[ +// Never replace escaped '*' +// ignore rule '\*' will match the path '*' + +// 'abc.*/' -> go +// 'abc.*' -> skip this rule +/(^|[^\\]+)\\\*(?=.+)/g, + +// '*.js' matches '.js' +// '*.js' doesn't match 'abc' +function (match, p1) { + return `${p1}[^\\/]*`; +}], + +// trailing wildcard +[/(\^|\\\/)?\\\*$/, function (match, p1) { + var prefix = p1 + // '\^': + // '/*' does not match '' + // '/*' does not match everything + + // '\\\/': + // 'abc/*' does not match 'abc/' + ? `${p1}[^/]+` + + // 'a*' matches 'a' + // 'a*' matches 'aa' + : '[^/]*'; + + return `${prefix}(?=$|\\/$)`; +}], [ +// unescape +/\\\\\\/g, function () { + return '\\'; +}]]; + +var POSITIVE_REPLACERS = [].concat(DEFAULT_REPLACER_PREFIX, [ + +// 'f' +// matches +// - /f(end) +// - /f/ +// - (start)f(end) +// - (start)f/ +// doesn't match +// - oof +// - foo +// pseudo: +// -> (^|/)f(/|$) + +// ending +[ +// 'js' will not match 'js.' +// 'ab' will not match 'abc' +/(?:[^*/])$/, + +// 'js*' will not match 'a.js' +// 'js/' will not match 'a.js' +// 'js' will match 'a.js' and 'a.js/' +function (match) { + return `${match}(?=$|\\/)`; +}]], DEFAULT_REPLACER_SUFFIX); + +var NEGATIVE_REPLACERS = [].concat(DEFAULT_REPLACER_PREFIX, [ + +// #24, #38 +// The MISSING rule of [gitignore docs](https://git-scm.com/docs/gitignore) +// A negative pattern without a trailing wildcard should not +// re-include the things inside that directory. + +// eg: +// ['node_modules/*', '!node_modules'] +// should ignore `node_modules/a.js` +[/(?:[^*])$/, function (match) { + return `${match}(?=$|\\/$)`; +}]], DEFAULT_REPLACER_SUFFIX); + +// A simple cache, because an ignore rule only has only one certain meaning +var cache = Object.create(null); + +// @param {pattern} +var make_regex = function make_regex(pattern, negative, ignorecase) { + var r = cache[pattern]; + if (r) { + return r; + } + + var replacers = negative ? NEGATIVE_REPLACERS : POSITIVE_REPLACERS; + + var source = replacers.reduce(function (prev, current) { + return prev.replace(current[0], current[1].bind(pattern)); + }, pattern); + + return cache[pattern] = ignorecase ? new RegExp(source, 'i') : new RegExp(source); +}; + +// > A blank line matches no files, so it can serve as a separator for readability. +var checkPattern = function checkPattern(pattern) { + return pattern && typeof pattern === 'string' && !REGEX_BLANK_LINE.test(pattern) + + // > A line starting with # serves as a comment. + && pattern.indexOf('#') !== 0; +}; + +var createRule = function createRule(pattern, ignorecase) { + var origin = pattern; + var negative = false; + + // > An optional prefix "!" which negates the pattern; + if (pattern.indexOf('!') === 0) { + negative = true; + pattern = pattern.substr(1); + } + + pattern = pattern + // > Put a backslash ("\") in front of the first "!" for patterns that + // > begin with a literal "!", for example, `"\!important!.txt"`. + .replace(REGEX_LEADING_EXCAPED_EXCLAMATION, '!') + // > Put a backslash ("\") in front of the first hash for patterns that + // > begin with a hash. + .replace(REGEX_LEADING_EXCAPED_HASH, '#'); + + var regex = make_regex(pattern, negative, ignorecase); + + return { + origin, + pattern, + negative, + regex + }; +}; + +var IgnoreBase = function () { + function IgnoreBase() { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + _ref$ignorecase = _ref.ignorecase, + ignorecase = _ref$ignorecase === undefined ? true : _ref$ignorecase; + + _classCallCheck(this, IgnoreBase); + + this._rules = []; + this._ignorecase = ignorecase; + define(this, KEY_IGNORE, true); + this._initCache(); + } + + _createClass(IgnoreBase, [{ + key: '_initCache', + value: function _initCache() { + this._cache = Object.create(null); + } + + // @param {Array.|string|Ignore} pattern + + }, { + key: 'add', + value: function add(pattern) { + this._added = false; + + if (typeof pattern === 'string') { + pattern = pattern.split(/\r?\n/g); + } + + make_array(pattern).forEach(this._addPattern, this); + + // Some rules have just added to the ignore, + // making the behavior changed. + if (this._added) { + this._initCache(); + } + + return this; + } + + // legacy + + }, { + key: 'addPattern', + value: function addPattern(pattern) { + return this.add(pattern); + } + }, { + key: '_addPattern', + value: function _addPattern(pattern) { + // #32 + if (pattern && pattern[KEY_IGNORE]) { + this._rules = this._rules.concat(pattern._rules); + this._added = true; + return; + } + + if (checkPattern(pattern)) { + var rule = createRule(pattern, this._ignorecase); + this._added = true; + this._rules.push(rule); + } + } + }, { + key: 'filter', + value: function filter(paths) { + var _this = this; + + return make_array(paths).filter(function (path) { + return _this._filter(path); + }); + } + }, { + key: 'createFilter', + value: function createFilter() { + var _this2 = this; + + return function (path) { + return _this2._filter(path); + }; + } + }, { + key: 'ignores', + value: function ignores(path) { + return !this._filter(path); + } + + // @returns `Boolean` true if the `path` is NOT ignored + + }, { + key: '_filter', + value: function _filter(path, slices) { + if (!path) { + return false; + } + + if (path in this._cache) { + return this._cache[path]; + } + + if (!slices) { + // path/to/a.js + // ['path', 'to', 'a.js'] + slices = path.split(SLASH); + } + + slices.pop(); + + return this._cache[path] = slices.length + // > It is not possible to re-include a file if a parent directory of + // > that file is excluded. + // If the path contains a parent directory, check the parent first + ? this._filter(slices.join(SLASH) + SLASH, slices) && this._test(path) + + // Or only test the path + : this._test(path); + } + + // @returns {Boolean} true if a file is NOT ignored + + }, { + key: '_test', + value: function _test(path) { + // Explicitly define variable type by setting matched to `0` + var matched = 0; + + this._rules.forEach(function (rule) { + // if matched = true, then we only test negative rules + // if matched = false, then we test non-negative rules + if (!(matched ^ rule.negative)) { + matched = rule.negative ^ rule.regex.test(path); + } + }); + + return !matched; + } + }]); + + return IgnoreBase; +}(); + +// Windows +// -------------------------------------------------------------- +/* istanbul ignore if */ + + +if ( +// Detect `process` so that it can run in browsers. +typeof process !== 'undefined' && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === 'win32')) { + var filter = IgnoreBase.prototype._filter; + + /* eslint no-control-regex: "off" */ + var make_posix = function make_posix(str) { + return (/^\\\\\?\\/.test(str) || /[^\x00-\x80]+/.test(str) ? str : str.replace(/\\/g, '/') + ); + }; + + IgnoreBase.prototype._filter = function filterWin32(path, slices) { + path = make_posix(path); + return filter.call(this, path, slices); + }; +} + +module.exports = function (options) { + return new IgnoreBase(options); +}; diff --git a/node_modules/@eslint/eslintrc/node_modules/ignore/package.json b/node_modules/@eslint/eslintrc/node_modules/ignore/package.json new file mode 100644 index 000000000..873bff3ed --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/ignore/package.json @@ -0,0 +1,64 @@ +{ + "name": "ignore", + "version": "4.0.6", + "description": "Ignore is a manager and filter for .gitignore rules.", + "files": [ + "legacy.js", + "index.js", + "index.d.ts", + "LICENSE-MIT" + ], + "scripts": { + "prepublish": "npm run build", + "build": "babel -o legacy.js index.js", + "test:lint": "eslint .", + "test:tsc": "tsc ./test/ts/simple.ts", + "test:git": "tap test/git-check-ignore.js", + "test:ignore": "tap test/ignore.js --coverage", + "test-no-cov": "npm run test:lint && npm run test:tsc && tap test/*.js --coverage", + "test": "npm run test-no-cov", + "posttest": "tap --coverage-report=html && codecov" + }, + "repository": { + "type": "git", + "url": "git@github.com:kaelzhang/node-ignore.git" + }, + "keywords": [ + "ignore", + ".gitignore", + "gitignore", + "npmignore", + "rules", + "manager", + "filter", + "regexp", + "regex", + "fnmatch", + "glob", + "asterisks", + "regular-expression" + ], + "author": "kael", + "license": "MIT", + "bugs": { + "url": "https://github.com/kaelzhang/node-ignore/issues" + }, + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-preset-env": "^1.7.0", + "codecov": "^3.0.4", + "eslint": "^5.3.0", + "eslint-config-ostai": "^1.3.2", + "eslint-plugin-import": "^2.13.0", + "mkdirp": "^0.5.1", + "pre-suf": "^1.1.0", + "rimraf": "^2.6.2", + "spawn-sync": "^2.0.0", + "tap": "^12.0.1", + "tmp": "0.0.33", + "typescript": "^3.0.1" + }, + "engines": { + "node": ">= 4" + } +} \ No newline at end of file diff --git a/node_modules/@eslint/eslintrc/node_modules/strip-json-comments/index.d.ts b/node_modules/@eslint/eslintrc/node_modules/strip-json-comments/index.d.ts new file mode 100644 index 000000000..28ba3c8a8 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/strip-json-comments/index.d.ts @@ -0,0 +1,36 @@ +declare namespace stripJsonComments { + interface Options { + /** + Replace comments with whitespace instead of stripping them entirely. + + @default true + */ + readonly whitespace?: boolean; + } +} + +/** +Strip comments from JSON. Lets you use comments in your JSON files! + +It will replace single-line comments `//` and multi-line comments `/**\/` with whitespace. This allows JSON error positions to remain as close as possible to the original source. + +@param jsonString - Accepts a string with JSON. +@returns A JSON string without comments. + +@example +``` +const json = `{ + // Rainbows + "unicorn": "cake" +}`; + +JSON.parse(stripJsonComments(json)); +//=> {unicorn: 'cake'} +``` +*/ +declare function stripJsonComments( + jsonString: string, + options?: stripJsonComments.Options +): string; + +export = stripJsonComments; diff --git a/node_modules/@eslint/eslintrc/node_modules/strip-json-comments/index.js b/node_modules/@eslint/eslintrc/node_modules/strip-json-comments/index.js new file mode 100644 index 000000000..bb00b38ba --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/strip-json-comments/index.js @@ -0,0 +1,77 @@ +'use strict'; +const singleComment = Symbol('singleComment'); +const multiComment = Symbol('multiComment'); +const stripWithoutWhitespace = () => ''; +const stripWithWhitespace = (string, start, end) => string.slice(start, end).replace(/\S/g, ' '); + +const isEscaped = (jsonString, quotePosition) => { + let index = quotePosition - 1; + let backslashCount = 0; + + while (jsonString[index] === '\\') { + index -= 1; + backslashCount += 1; + } + + return Boolean(backslashCount % 2); +}; + +module.exports = (jsonString, options = {}) => { + if (typeof jsonString !== 'string') { + throw new TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof jsonString}\``); + } + + const strip = options.whitespace === false ? stripWithoutWhitespace : stripWithWhitespace; + + let insideString = false; + let insideComment = false; + let offset = 0; + let result = ''; + + for (let i = 0; i < jsonString.length; i++) { + const currentCharacter = jsonString[i]; + const nextCharacter = jsonString[i + 1]; + + if (!insideComment && currentCharacter === '"') { + const escaped = isEscaped(jsonString, i); + if (!escaped) { + insideString = !insideString; + } + } + + if (insideString) { + continue; + } + + if (!insideComment && currentCharacter + nextCharacter === '//') { + result += jsonString.slice(offset, i); + offset = i; + insideComment = singleComment; + i++; + } else if (insideComment === singleComment && currentCharacter + nextCharacter === '\r\n') { + i++; + insideComment = false; + result += strip(jsonString, offset, i); + offset = i; + continue; + } else if (insideComment === singleComment && currentCharacter === '\n') { + insideComment = false; + result += strip(jsonString, offset, i); + offset = i; + } else if (!insideComment && currentCharacter + nextCharacter === '/*') { + result += jsonString.slice(offset, i); + offset = i; + insideComment = multiComment; + i++; + continue; + } else if (insideComment === multiComment && currentCharacter + nextCharacter === '*/') { + i++; + insideComment = false; + result += strip(jsonString, offset, i + 1); + offset = i + 1; + continue; + } + } + + return result + (insideComment ? strip(jsonString.slice(offset)) : jsonString.slice(offset)); +}; diff --git a/node_modules/@eslint/eslintrc/node_modules/strip-json-comments/license b/node_modules/@eslint/eslintrc/node_modules/strip-json-comments/license new file mode 100644 index 000000000..fa7ceba3e --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/strip-json-comments/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@eslint/eslintrc/node_modules/strip-json-comments/package.json b/node_modules/@eslint/eslintrc/node_modules/strip-json-comments/package.json new file mode 100644 index 000000000..ea6331861 --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/strip-json-comments/package.json @@ -0,0 +1,47 @@ +{ + "name": "strip-json-comments", + "version": "3.1.1", + "description": "Strip comments from JSON. Lets you use comments in your JSON files!", + "license": "MIT", + "repository": "sindresorhus/strip-json-comments", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "bench": "matcha benchmark.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "json", + "strip", + "comments", + "remove", + "delete", + "trim", + "multiline", + "parse", + "config", + "configuration", + "settings", + "util", + "env", + "environment", + "jsonc" + ], + "devDependencies": { + "ava": "^1.4.1", + "matcha": "^0.7.0", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} \ No newline at end of file diff --git a/node_modules/@eslint/eslintrc/node_modules/strip-json-comments/readme.md b/node_modules/@eslint/eslintrc/node_modules/strip-json-comments/readme.md new file mode 100644 index 000000000..cc542e50c --- /dev/null +++ b/node_modules/@eslint/eslintrc/node_modules/strip-json-comments/readme.md @@ -0,0 +1,78 @@ +# strip-json-comments [![Build Status](https://travis-ci.com/sindresorhus/strip-json-comments.svg?branch=master)](https://travis-ci.com/github/sindresorhus/strip-json-comments) + +> Strip comments from JSON. Lets you use comments in your JSON files! + +This is now possible: + +```js +{ + // Rainbows + "unicorn": /* ❤ */ "cake" +} +``` + +It will replace single-line comments `//` and multi-line comments `/**/` with whitespace. This allows JSON error positions to remain as close as possible to the original source. + +Also available as a [Gulp](https://github.com/sindresorhus/gulp-strip-json-comments)/[Grunt](https://github.com/sindresorhus/grunt-strip-json-comments)/[Broccoli](https://github.com/sindresorhus/broccoli-strip-json-comments) plugin. + +## Install + +``` +$ npm install strip-json-comments +``` + +## Usage + +```js +const json = `{ + // Rainbows + "unicorn": /* ❤ */ "cake" +}`; + +JSON.parse(stripJsonComments(json)); +//=> {unicorn: 'cake'} +``` + +## API + +### stripJsonComments(jsonString, options?) + +#### jsonString + +Type: `string` + +Accepts a string with JSON and returns a string without comments. + +#### options + +Type: `object` + +##### whitespace + +Type: `boolean`\ +Default: `true` + +Replace comments with whitespace instead of stripping them entirely. + +## Benchmark + +``` +$ npm run bench +``` + +## Related + +- [strip-json-comments-cli](https://github.com/sindresorhus/strip-json-comments-cli) - CLI for this module +- [strip-css-comments](https://github.com/sindresorhus/strip-css-comments) - Strip comments from CSS + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/@eslint/eslintrc/package.json b/node_modules/@eslint/eslintrc/package.json new file mode 100644 index 000000000..71830c09a --- /dev/null +++ b/node_modules/@eslint/eslintrc/package.json @@ -0,0 +1,59 @@ +{ + "name": "@eslint/eslintrc", + "version": "0.1.3", + "description": "The legacy ESLintRC config file format for ESLint", + "main": "lib/index.js", + "files": [ + "lib", + "conf", + "LICENSE" + ], + "publishConfig": { + "access": "public" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha tests/lib/shared", + "generate-release": "eslint-generate-release", + "generate-alpharelease": "eslint-generate-prerelease alpha", + "generate-betarelease": "eslint-generate-prerelease beta", + "generate-rcrelease": "eslint-generate-prerelease rc", + "publish-release": "eslint-publish-release" + }, + "repository": "eslint/eslintrc", + "keywords": [ + "ESLint", + "ESLintRC", + "Configuration" + ], + "author": "Nicholas C. Zakas", + "license": "MIT", + "bugs": { + "url": "https://github.com/eslint/eslintrc/issues" + }, + "homepage": "https://github.com/eslint/eslintrc#readme", + "devDependencies": { + "chai": "^4.2.0", + "eslint": "^7.7.0", + "eslint-config-eslint": "^6.0.0", + "eslint-plugin-jsdoc": "^22.1.0", + "eslint-plugin-node": "^11.1.0", + "eslint-release": "^3.1.2", + "mocha": "^8.1.1" + }, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } +} \ No newline at end of file diff --git a/node_modules/@types/json-schema/LICENSE b/node_modules/@types/json-schema/LICENSE new file mode 100644 index 000000000..9e841e7a2 --- /dev/null +++ b/node_modules/@types/json-schema/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/node_modules/@types/json-schema/README.md b/node_modules/@types/json-schema/README.md new file mode 100644 index 000000000..75b31e039 --- /dev/null +++ b/node_modules/@types/json-schema/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/json-schema` + +# Summary +This package contains type definitions for json-schema 4.0, 6.0 and (https://github.com/kriszyp/json-schema). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-schema. + +### Additional Details + * Last updated: Mon, 31 Aug 2020 21:41:49 GMT + * Dependencies: none + * Global values: none + +# Credits +These definitions were written by [Boris Cherny](https://github.com/bcherny), [Cyrille Tuzi](https://github.com/cyrilletuzi), [Lucian Buzzo](https://github.com/lucianbuzzo), [Roland Groza](https://github.com/rolandjitsu), and [Jason Kwok](https://github.com/JasonHK). diff --git a/node_modules/@types/json-schema/index.d.ts b/node_modules/@types/json-schema/index.d.ts new file mode 100644 index 000000000..be735fbf8 --- /dev/null +++ b/node_modules/@types/json-schema/index.d.ts @@ -0,0 +1,747 @@ +// Type definitions for json-schema 4.0, 6.0 and 7.0 +// Project: https://github.com/kriszyp/json-schema +// Definitions by: Boris Cherny +// Cyrille Tuzi +// Lucian Buzzo +// Roland Groza +// Jason Kwok +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +//================================================================================================== +// JSON Schema Draft 04 +//================================================================================================== + +/** + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1 + */ +export type JSONSchema4TypeName = + | 'string' + | 'number' + | 'integer' + | 'boolean' + | 'object' + | 'array' + | 'null' + | 'any'; + +/** + * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-3.5 + */ +export type JSONSchema4Type = + | string + | number + | boolean + | JSONSchema4Object + | JSONSchema4Array + | null; + +// Workaround for infinite type recursion +export interface JSONSchema4Object { + [key: string]: JSONSchema4Type; +} + +// Workaround for infinite type recursion +// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540 +export interface JSONSchema4Array extends Array {} + +/** + * Meta schema + * + * Recommended values: + * - 'http://json-schema.org/schema#' + * - 'http://json-schema.org/hyper-schema#' + * - 'http://json-schema.org/draft-04/schema#' + * - 'http://json-schema.org/draft-04/hyper-schema#' + * - 'http://json-schema.org/draft-03/schema#' + * - 'http://json-schema.org/draft-03/hyper-schema#' + * + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5 + */ +export type JSONSchema4Version = string; + +/** + * JSON Schema V4 + * @see https://tools.ietf.org/html/draft-zyp-json-schema-04 + */ +export interface JSONSchema4 { + id?: string + $ref?: string + $schema?: JSONSchema4Version + + /** + * This attribute is a string that provides a short description of the + * instance property. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.21 + */ + title?: string + + /** + * This attribute is a string that provides a full description of the of + * purpose the instance property. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.22 + */ + description?: string + + default?: JSONSchema4Type + multipleOf?: number + maximum?: number + exclusiveMaximum?: boolean + minimum?: number + exclusiveMinimum?: boolean + maxLength?: number + minLength?: number + pattern?: string + + /** + * May only be defined when "items" is defined, and is a tuple of JSONSchemas. + * + * This provides a definition for additional items in an array instance + * when tuple definitions of the items is provided. This can be false + * to indicate additional items in the array are not allowed, or it can + * be a schema that defines the schema of the additional items. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.6 + */ + additionalItems?: boolean | JSONSchema4 + + /** + * This attribute defines the allowed items in an instance array, and + * MUST be a schema or an array of schemas. The default value is an + * empty schema which allows any value for items in the instance array. + * + * When this attribute value is a schema and the instance value is an + * array, then all the items in the array MUST be valid according to the + * schema. + * + * When this attribute value is an array of schemas and the instance + * value is an array, each position in the instance array MUST conform + * to the schema in the corresponding position for this array. This + * called tuple typing. When tuple typing is used, additional items are + * allowed, disallowed, or constrained by the "additionalItems" + * (Section 5.6) attribute using the same rules as + * "additionalProperties" (Section 5.4) for objects. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.5 + */ + items?: JSONSchema4 | JSONSchema4[] + + maxItems?: number + minItems?: number + uniqueItems?: boolean + maxProperties?: number + minProperties?: number + + /** + * This attribute indicates if the instance must have a value, and not + * be undefined. This is false by default, making the instance + * optional. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.7 + */ + required?: false | string[] + + /** + * This attribute defines a schema for all properties that are not + * explicitly defined in an object type definition. If specified, the + * value MUST be a schema or a boolean. If false is provided, no + * additional properties are allowed beyond the properties defined in + * the schema. The default value is an empty schema which allows any + * value for additional properties. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.4 + */ + additionalProperties?: boolean | JSONSchema4 + + definitions?: { + [k: string]: JSONSchema4 + } + + /** + * This attribute is an object with property definitions that define the + * valid values of instance object property values. When the instance + * value is an object, the property values of the instance object MUST + * conform to the property definitions in this object. In this object, + * each property definition's value MUST be a schema, and the property's + * name MUST be the name of the instance property that it defines. The + * instance property value MUST be valid according to the schema from + * the property definition. Properties are considered unordered, the + * order of the instance properties MAY be in any order. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.2 + */ + properties?: { + [k: string]: JSONSchema4 + } + + /** + * This attribute is an object that defines the schema for a set of + * property names of an object instance. The name of each property of + * this attribute's object is a regular expression pattern in the ECMA + * 262/Perl 5 format, while the value is a schema. If the pattern + * matches the name of a property on the instance object, the value of + * the instance's property MUST be valid against the pattern name's + * schema value. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.3 + */ + patternProperties?: { + [k: string]: JSONSchema4 + } + dependencies?: { + [k: string]: JSONSchema4 | string[] + } + + /** + * This provides an enumeration of all possible values that are valid + * for the instance property. This MUST be an array, and each item in + * the array represents a possible value for the instance value. If + * this attribute is defined, the instance value MUST be one of the + * values in the array in order for the schema to be valid. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19 + */ + enum?: JSONSchema4Type[] + + /** + * A single type, or a union of simple types + */ + type?: JSONSchema4TypeName | JSONSchema4TypeName[] + + allOf?: JSONSchema4[] + anyOf?: JSONSchema4[] + oneOf?: JSONSchema4[] + not?: JSONSchema4 + + /** + * The value of this property MUST be another schema which will provide + * a base schema which the current schema will inherit from. The + * inheritance rules are such that any instance that is valid according + * to the current schema MUST be valid according to the referenced + * schema. This MAY also be an array, in which case, the instance MUST + * be valid for all the schemas in the array. A schema that extends + * another schema MAY define additional attributes, constrain existing + * attributes, or add other constraints. + * + * Conceptually, the behavior of extends can be seen as validating an + * instance against all constraints in the extending schema as well as + * the extended schema(s). + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.26 + */ + extends?: string | string[] + + /** + * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-5.6 + */ + [k: string]: any + + format?: string +} + +//================================================================================================== +// JSON Schema Draft 06 +//================================================================================================== + +export type JSONSchema6TypeName = + | 'string' + | 'number' + | 'integer' + | 'boolean' + | 'object' + | 'array' + | 'null' + | 'any'; + +export type JSONSchema6Type = + | string + | number + | boolean + | JSONSchema6Object + | JSONSchema6Array + | null; + +// Workaround for infinite type recursion +export interface JSONSchema6Object { + [key: string]: JSONSchema6Type; +} + +// Workaround for infinite type recursion +// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540 +export interface JSONSchema6Array extends Array {} + +/** + * Meta schema + * + * Recommended values: + * - 'http://json-schema.org/schema#' + * - 'http://json-schema.org/hyper-schema#' + * - 'http://json-schema.org/draft-06/schema#' + * - 'http://json-schema.org/draft-06/hyper-schema#' + * + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5 + */ +export type JSONSchema6Version = string; + +/** + * JSON Schema V6 + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01 + */ +export type JSONSchema6Definition = JSONSchema6 | boolean; +export interface JSONSchema6 { + $id?: string + $ref?: string + $schema?: JSONSchema6Version + + /** + * Must be strictly greater than 0. + * A numeric instance is valid only if division by this keyword's value results in an integer. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.1 + */ + multipleOf?: number + + /** + * Representing an inclusive upper limit for a numeric instance. + * This keyword validates only if the instance is less than or exactly equal to "maximum". + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.2 + */ + maximum?: number + + /** + * Representing an exclusive upper limit for a numeric instance. + * This keyword validates only if the instance is strictly less than (not equal to) to "exclusiveMaximum". + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.3 + */ + exclusiveMaximum?: number + + /** + * Representing an inclusive lower limit for a numeric instance. + * This keyword validates only if the instance is greater than or exactly equal to "minimum". + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.4 + */ + minimum?: number + + /** + * Representing an exclusive lower limit for a numeric instance. + * This keyword validates only if the instance is strictly greater than (not equal to) to "exclusiveMinimum". + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.5 + */ + exclusiveMinimum?: number + + /** + * Must be a non-negative integer. + * A string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.6 + */ + maxLength?: number + + /** + * Must be a non-negative integer. + * A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword. + * Omitting this keyword has the same behavior as a value of 0. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.7 + */ + minLength?: number + + /** + * Should be a valid regular expression, according to the ECMA 262 regular expression dialect. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.8 + */ + pattern?: string + + /** + * This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself. + * Omitting this keyword has the same behavior as an empty schema. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.9 + */ + items?: JSONSchema6Definition | JSONSchema6Definition[] + + /** + * This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself. + * If "items" is an array of schemas, validation succeeds if every instance element + * at a position greater than the size of "items" validates against "additionalItems". + * Otherwise, "additionalItems" MUST be ignored, as the "items" schema + * (possibly the default value of an empty schema) is applied to all elements. + * Omitting this keyword has the same behavior as an empty schema. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.10 + */ + additionalItems?: JSONSchema6Definition + + /** + * Must be a non-negative integer. + * An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.11 + */ + maxItems?: number + + /** + * Must be a non-negative integer. + * An array instance is valid against "maxItems" if its size is greater than, or equal to, the value of this keyword. + * Omitting this keyword has the same behavior as a value of 0. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.12 + */ + minItems?: number + + /** + * If this keyword has boolean value false, the instance validates successfully. + * If it has boolean value true, the instance validates successfully if all of its elements are unique. + * Omitting this keyword has the same behavior as a value of false. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.13 + */ + uniqueItems?: boolean + + /** + * An array instance is valid against "contains" if at least one of its elements is valid against the given schema. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.14 + */ + contains?: JSONSchema6Definition + + /** + * Must be a non-negative integer. + * An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the value of this keyword. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.15 + */ + maxProperties?: number + + /** + * Must be a non-negative integer. + * An object instance is valid against "maxProperties" if its number of properties is greater than, + * or equal to, the value of this keyword. + * Omitting this keyword has the same behavior as a value of 0. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.16 + */ + minProperties?: number + + /** + * Elements of this array must be unique. + * An object instance is valid against this keyword if every item in the array is the name of a property in the instance. + * Omitting this keyword has the same behavior as an empty array. + * + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.17 + */ + required?: string[] + + /** + * This keyword determines how child instances validate for objects, and does not directly validate the immediate instance itself. + * Validation succeeds if, for each name that appears in both the instance and as a name within this keyword's value, + * the child instance for that name successfully validates against the corresponding schema. + * Omitting this keyword has the same behavior as an empty object. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.18 + */ + properties?: { + [k: string]: JSONSchema6Definition + } + + /** + * This attribute is an object that defines the schema for a set of property names of an object instance. + * The name of each property of this attribute's object is a regular expression pattern in the ECMA 262, while the value is a schema. + * If the pattern matches the name of a property on the instance object, the value of the instance's property + * MUST be valid against the pattern name's schema value. + * Omitting this keyword has the same behavior as an empty object. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.19 + */ + patternProperties?: { + [k: string]: JSONSchema6Definition + } + + /** + * This attribute defines a schema for all properties that are not explicitly defined in an object type definition. + * If specified, the value MUST be a schema or a boolean. + * If false is provided, no additional properties are allowed beyond the properties defined in the schema. + * The default value is an empty schema which allows any value for additional properties. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.20 + */ + additionalProperties?: JSONSchema6Definition + + /** + * This keyword specifies rules that are evaluated if the instance is an object and contains a certain property. + * Each property specifies a dependency. + * If the dependency value is an array, each element in the array must be unique. + * Omitting this keyword has the same behavior as an empty object. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.21 + */ + dependencies?: { + [k: string]: JSONSchema6Definition | string[] + } + + /** + * Takes a schema which validates the names of all properties rather than their values. + * Note the property name that the schema is testing will always be a string. + * Omitting this keyword has the same behavior as an empty schema. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.22 + */ + propertyNames?: JSONSchema6Definition + + /** + * This provides an enumeration of all possible values that are valid + * for the instance property. This MUST be an array, and each item in + * the array represents a possible value for the instance value. If + * this attribute is defined, the instance value MUST be one of the + * values in the array in order for the schema to be valid. + * + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.23 + */ + enum?: JSONSchema6Type[] + + /** + * More readable form of a one-element "enum" + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.24 + */ + const?: JSONSchema6Type + + /** + * A single type, or a union of simple types + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.25 + */ + type?: JSONSchema6TypeName | JSONSchema6TypeName[] + + /** + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.26 + */ + allOf?: JSONSchema6Definition[] + + /** + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.27 + */ + anyOf?: JSONSchema6Definition[] + + /** + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28 + */ + oneOf?: JSONSchema6Definition[] + + /** + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.29 + */ + not?: JSONSchema6Definition + + /** + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.1 + */ + definitions?: { + [k: string]: JSONSchema6Definition + } + + /** + * This attribute is a string that provides a short description of the instance property. + * + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2 + */ + title?: string + + /** + * This attribute is a string that provides a full description of the of purpose the instance property. + * + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2 + */ + description?: string + + /** + * This keyword can be used to supply a default JSON value associated with a particular schema. + * It is RECOMMENDED that a default value be valid against the associated schema. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.3 + */ + default?: JSONSchema6Type + + /** + * Array of examples with no validation effect the value of "default" is usable as an example without repeating it under this keyword + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.4 + */ + examples?: JSONSchema6Type[] + + /** + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-8 + */ + format?: string +} + +//================================================================================================== +// JSON Schema Draft 07 +//================================================================================================== +// https://tools.ietf.org/html/draft-handrews-json-schema-validation-01 +//-------------------------------------------------------------------------------------------------- + +/** + * Primitive type + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1 + */ +export type JSONSchema7TypeName = + | 'string' + | 'number' + | 'integer' + | 'boolean' + | 'object' + | 'array' + | 'null'; + +/** + * Primitive type + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1 + */ +export type JSONSchema7Type = + | string + | number + | boolean + | JSONSchema7Object + | JSONSchema7Array + | null; + +// Workaround for infinite type recursion +export interface JSONSchema7Object { + [key: string]: JSONSchema7Type; +} + +// Workaround for infinite type recursion +// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540 +export interface JSONSchema7Array extends Array {} + +/** + * Meta schema + * + * Recommended values: + * - 'http://json-schema.org/schema#' + * - 'http://json-schema.org/hyper-schema#' + * - 'http://json-schema.org/draft-07/schema#' + * - 'http://json-schema.org/draft-07/hyper-schema#' + * + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5 + */ +export type JSONSchema7Version = string; + +/** + * JSON Schema v7 + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01 + */ +export type JSONSchema7Definition = JSONSchema7 | boolean; +export interface JSONSchema7 { + $id?: string; + $ref?: string; + $schema?: JSONSchema7Version; + $comment?: string; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1 + */ + type?: JSONSchema7TypeName | JSONSchema7TypeName[]; + enum?: JSONSchema7Type[]; + const?: JSONSchema7Type; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2 + */ + multipleOf?: number; + maximum?: number; + exclusiveMaximum?: number; + minimum?: number; + exclusiveMinimum?: number; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3 + */ + maxLength?: number; + minLength?: number; + pattern?: string; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4 + */ + items?: JSONSchema7Definition | JSONSchema7Definition[]; + additionalItems?: JSONSchema7Definition; + maxItems?: number; + minItems?: number; + uniqueItems?: boolean; + contains?: JSONSchema7; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5 + */ + maxProperties?: number; + minProperties?: number; + required?: string[]; + properties?: { + [key: string]: JSONSchema7Definition; + }; + patternProperties?: { + [key: string]: JSONSchema7Definition; + }; + additionalProperties?: JSONSchema7Definition; + dependencies?: { + [key: string]: JSONSchema7Definition | string[]; + }; + propertyNames?: JSONSchema7Definition; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6 + */ + if?: JSONSchema7Definition; + then?: JSONSchema7Definition; + else?: JSONSchema7Definition; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7 + */ + allOf?: JSONSchema7Definition[]; + anyOf?: JSONSchema7Definition[]; + oneOf?: JSONSchema7Definition[]; + not?: JSONSchema7Definition; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7 + */ + format?: string; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8 + */ + contentMediaType?: string; + contentEncoding?: string; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9 + */ + definitions?: { + [key: string]: JSONSchema7Definition; + }; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10 + */ + title?: string; + description?: string; + default?: JSONSchema7Type; + readOnly?: boolean; + writeOnly?: boolean; + examples?: JSONSchema7Type; +} + +export interface ValidationResult { + valid: boolean; + errors: ValidationError[]; +} + +export interface ValidationError { + property: string; + message: string; +} + +/** + * To use the validator call JSONSchema.validate with an instance object and an optional schema object. + * If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating), + * that schema will be used to validate and the schema parameter is not necessary (if both exist, + * both validations will occur). + */ +export function validate(instance: {}, schema: JSONSchema4 | JSONSchema6 | JSONSchema7): ValidationResult; + +/** + * The checkPropertyChange method will check to see if an value can legally be in property with the given schema + * This is slightly different than the validate method in that it will fail if the schema is readonly and it will + * not check for self-validation, it is assumed that the passed in value is already internally valid. + */ +export function checkPropertyChange(value: any, schema: JSONSchema4 | JSONSchema6 | JSONSchema7, property: string): ValidationResult; + +/** + * This checks to ensure that the result is valid and will throw an appropriate error message if it is not. + */ +export function mustBeValid(result: ValidationResult): void; diff --git a/node_modules/@types/json-schema/package.json b/node_modules/@types/json-schema/package.json new file mode 100644 index 000000000..7e1d206a9 --- /dev/null +++ b/node_modules/@types/json-schema/package.json @@ -0,0 +1,44 @@ +{ + "name": "@types/json-schema", + "version": "7.0.6", + "description": "TypeScript definitions for json-schema 4.0, 6.0 and", + "license": "MIT", + "contributors": [ + { + "name": "Boris Cherny", + "url": "https://github.com/bcherny", + "githubUsername": "bcherny" + }, + { + "name": "Cyrille Tuzi", + "url": "https://github.com/cyrilletuzi", + "githubUsername": "cyrilletuzi" + }, + { + "name": "Lucian Buzzo", + "url": "https://github.com/lucianbuzzo", + "githubUsername": "lucianbuzzo" + }, + { + "name": "Roland Groza", + "url": "https://github.com/rolandjitsu", + "githubUsername": "rolandjitsu" + }, + { + "name": "Jason Kwok", + "url": "https://github.com/JasonHK", + "githubUsername": "JasonHK" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/json-schema" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "bb4b22e70ee94bf7b787307444fcee2f57a8869f012a460ed8f15b5b6985ed70", + "typeScriptVersion": "3.1" +} \ No newline at end of file diff --git a/node_modules/@types/json5/README.md b/node_modules/@types/json5/README.md new file mode 100644 index 000000000..ea81c5cc2 --- /dev/null +++ b/node_modules/@types/json5/README.md @@ -0,0 +1,18 @@ +# Installation +> `npm install --save @types/json5` + +# Summary +This package contains type definitions for JSON5 (http://json5.org/). + +# Details +Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/json5 + +Additional Details + * Last updated: Mon, 19 Sep 2016 17:28:59 GMT + * File structure: ProperModule + * Library Dependencies: none + * Module Dependencies: none + * Global values: json5 + +# Credits +These definitions were written by Jason Swearingen . diff --git a/node_modules/@types/json5/index.d.ts b/node_modules/@types/json5/index.d.ts new file mode 100644 index 000000000..76a035261 --- /dev/null +++ b/node_modules/@types/json5/index.d.ts @@ -0,0 +1,44 @@ +// Type definitions for JSON5 +// Project: http://json5.org/ +// Definitions by: Jason Swearingen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +//commonjs loader + +/** + * The following is the exact list of additions to JSON's syntax introduced by JSON5. All of these are optional, and all of these come from ES5. + +Objects + +Object keys can be unquoted if they're valid identifiers. Yes, even reserved keywords (like default) are valid unquoted keys in ES5 [§11.1.5, §7.6]. (More info) + +(TODO: Unicode characters and escape sequences aren’t yet supported in this implementation.) + +Objects can have trailing commas. + +Arrays + +Arrays can have trailing commas. +Strings + +Strings can be single-quoted. + +Strings can be split across multiple lines; just prefix each newline with a backslash. [ES5 §7.8.4] + +Numbers + +Numbers can be hexadecimal (base 16). + +Numbers can begin or end with a (leading or trailing) decimal point. + +Numbers can include Infinity, -Infinity, NaN, and -NaN. + +Numbers can begin with an explicit plus sign. + +Comments + +Both inline (single-line) and block (multi-line) comments are allowed. + */ +declare var json5: JSON; +export = json5; diff --git a/node_modules/@types/json5/package.json b/node_modules/@types/json5/package.json new file mode 100644 index 000000000..d31e7361f --- /dev/null +++ b/node_modules/@types/json5/package.json @@ -0,0 +1,16 @@ +{ + "name": "@types/json5", + "version": "0.0.29", + "description": "TypeScript definitions for JSON5", + "license": "MIT", + "author": "Jason Swearingen ", + "main": "", + "repository": { + "type": "git", + "url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git" + }, + "scripts": {}, + "dependencies": {}, + "typings": "index.d.ts", + "typesPublisherContentHash": "1ed77f2bfd59d290798abf89db281c36565f4a78d97d4e9caab25319d54c6331" +} \ No newline at end of file diff --git a/node_modules/@types/json5/types-metadata.json b/node_modules/@types/json5/types-metadata.json new file mode 100644 index 000000000..1c02afee7 --- /dev/null +++ b/node_modules/@types/json5/types-metadata.json @@ -0,0 +1,25 @@ +{ + "authors": "Jason Swearingen ", + "definitionFilename": "index.d.ts", + "libraryDependencies": [], + "moduleDependencies": [], + "libraryMajorVersion": "0", + "libraryMinorVersion": "0", + "libraryName": "JSON5", + "typingsPackageName": "json5", + "projectName": "http://json5.org/", + "sourceRepoURL": "https://www.github.com/DefinitelyTyped/DefinitelyTyped", + "sourceBranch": "types-2.0", + "kind": "ProperModule", + "globals": [ + "json5" + ], + "declaredModules": [ + "json5" + ], + "files": [ + "index.d.ts" + ], + "hasPackageJson": false, + "contentHash": "1ed77f2bfd59d290798abf89db281c36565f4a78d97d4e9caab25319d54c6331" +} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/CHANGELOG.md b/node_modules/@typescript-eslint/eslint-plugin/CHANGELOG.md new file mode 100644 index 000000000..7bc2c3c4d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/CHANGELOG.md @@ -0,0 +1,1417 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) + + +### Bug Fixes + +* **eslint-plugin:** [explicit-module-boundary-types] cyclical reference infinite recursion crash ([#2482](https://github.com/typescript-eslint/typescript-eslint/issues/2482)) ([8693653](https://github.com/typescript-eslint/typescript-eslint/commit/86936537bd6f1075cbceeb8d2d4e254d75188409)) +* **eslint-plugin:** [no-unused-vars] correct detection of unused vars in a declared module with `export =` ([#2505](https://github.com/typescript-eslint/typescript-eslint/issues/2505)) ([3d07a99](https://github.com/typescript-eslint/typescript-eslint/commit/3d07a99faa0a5fc1b44acdb43ddbfc90a5105833)) +* **eslint-plugin:** [no-unused-vars] properly handle ambient declaration exports ([#2496](https://github.com/typescript-eslint/typescript-eslint/issues/2496)) ([4d3ce5f](https://github.com/typescript-eslint/typescript-eslint/commit/4d3ce5f696985389bf53a31d62766041c703c70c)) +* **eslint-plugin:** [no-use-before-define] false positive with jsx pragma reference ([#2503](https://github.com/typescript-eslint/typescript-eslint/issues/2503)) ([5afeeab](https://github.com/typescript-eslint/typescript-eslint/commit/5afeeab24ad013142f2431750f24e6085d0a6f3a)), closes [#2502](https://github.com/typescript-eslint/typescript-eslint/issues/2502) +* **eslint-plugin:** [typedef] false positive for rest parameter with array destructuring ([#2441](https://github.com/typescript-eslint/typescript-eslint/issues/2441)) ([2ada5af](https://github.com/typescript-eslint/typescript-eslint/commit/2ada5aff1ef37bc260d7a0eaafe9ff04f8a08fe4)) +* **eslint-plugin:** handle missing message IDs in eslint v5/v6 ([#2461](https://github.com/typescript-eslint/typescript-eslint/issues/2461)) ([ffdfade](https://github.com/typescript-eslint/typescript-eslint/commit/ffdfade106d602bcc12b074bdfa489e9f661491e)) +* **scope-manager:** add `const` as a global type variable ([#2499](https://github.com/typescript-eslint/typescript-eslint/issues/2499)) ([eb3f6e3](https://github.com/typescript-eslint/typescript-eslint/commit/eb3f6e39391d62ac424baa305a15e61806b2fd65)) +* **scope-manager:** correctly handle inferred types in nested type scopes ([#2497](https://github.com/typescript-eslint/typescript-eslint/issues/2497)) ([95f6bf4](https://github.com/typescript-eslint/typescript-eslint/commit/95f6bf4818cdec48a0583bf82f928c598af22736)) +* **scope-manager:** don't create references for intrinsic JSX elements ([#2504](https://github.com/typescript-eslint/typescript-eslint/issues/2504)) ([cdb9807](https://github.com/typescript-eslint/typescript-eslint/commit/cdb9807a5a368a136856cd03048b68e0f2dfb405)) +* **scope-manager:** support rest function type parameters ([#2491](https://github.com/typescript-eslint/typescript-eslint/issues/2491)) ([9d8b4c4](https://github.com/typescript-eslint/typescript-eslint/commit/9d8b4c479c98623e4198aa07639321929a8a876f)), closes [#2449](https://github.com/typescript-eslint/typescript-eslint/issues/2449) +* **scope-manager:** support tagged template string generic type parameters ([#2492](https://github.com/typescript-eslint/typescript-eslint/issues/2492)) ([a2686c0](https://github.com/typescript-eslint/typescript-eslint/commit/a2686c04293ab9070c1500a0dab7e205bd1fa9d2)) +* **scope-manager:** support type predicates ([#2493](https://github.com/typescript-eslint/typescript-eslint/issues/2493)) ([a40f54c](https://github.com/typescript-eslint/typescript-eslint/commit/a40f54c39d59096a0d12a492807dcd52fbcdc384)), closes [#2462](https://github.com/typescript-eslint/typescript-eslint/issues/2462) +* **scope-manager:** treat type imports as both values and types ([#2494](https://github.com/typescript-eslint/typescript-eslint/issues/2494)) ([916e95a](https://github.com/typescript-eslint/typescript-eslint/commit/916e95a505689746dda38a67148c95cc7d207d9f)), closes [#2453](https://github.com/typescript-eslint/typescript-eslint/issues/2453) + + +### Features + +* **eslint-plugin:** [no-shadow] add option `ignoreFunctionTypeParameterNameValueShadow` ([#2470](https://github.com/typescript-eslint/typescript-eslint/issues/2470)) ([bfe255f](https://github.com/typescript-eslint/typescript-eslint/commit/bfe255fde0cb5fe5e32c02eb5ba35d27fb23d9ea)) +* **eslint-plugin:** add extension rule `no-loop-func` ([#2490](https://github.com/typescript-eslint/typescript-eslint/issues/2490)) ([36305df](https://github.com/typescript-eslint/typescript-eslint/commit/36305df74b3c26b60364f7ec13390be492b4b2ec)) +* **scope-manager:** add support for JSX scope analysis ([#2498](https://github.com/typescript-eslint/typescript-eslint/issues/2498)) ([f887ab5](https://github.com/typescript-eslint/typescript-eslint/commit/f887ab51f58c1b3571f9a14832864bc0ca59623f)), closes [#2455](https://github.com/typescript-eslint/typescript-eslint/issues/2455) [#2477](https://github.com/typescript-eslint/typescript-eslint/issues/2477) + + + + + +## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) + + +### Bug Fixes + +* **eslint-plugin:** update parser dependency range ([#2445](https://github.com/typescript-eslint/typescript-eslint/issues/2445)) ([2cb6620](https://github.com/typescript-eslint/typescript-eslint/commit/2cb66205de797479d9b2d362652c42fe032e913b)), closes [#2444](https://github.com/typescript-eslint/typescript-eslint/issues/2444) + + + + + +# [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) + +## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) + +### Bug Fixes + +* **eslint-plugin:** [no-shadow] fix false-positive on enum declaration ([#2374](https://github.com/typescript-eslint/typescript-eslint/issues/2374)) ([9de669f](https://github.com/typescript-eslint/typescript-eslint/commit/9de669f339fef62a98f745dc08b833aa5c632e62)) +* **eslint-plugin:** [no-unused-vars] handle TSCallSignature ([#2336](https://github.com/typescript-eslint/typescript-eslint/issues/2336)) ([c70f54f](https://github.com/typescript-eslint/typescript-eslint/commit/c70f54fd3a46a12060ae3aec0faae872c431dd88)) +* correct decorator traversal for AssignmentPattern ([#2375](https://github.com/typescript-eslint/typescript-eslint/issues/2375)) ([d738fa4](https://github.com/typescript-eslint/typescript-eslint/commit/d738fa4eff0a5c4cfc9b30b1c0502f8d1e78d7b6)) +* **scope-manager:** correct analysis of abstract class properties ([#2420](https://github.com/typescript-eslint/typescript-eslint/issues/2420)) ([cd84549](https://github.com/typescript-eslint/typescript-eslint/commit/cd84549beba3cf471d75cfd9ba26f80366842ed5)) +* **typescript-estree:** correct ChainExpression interaction with parentheses and non-nulls ([#2380](https://github.com/typescript-eslint/typescript-eslint/issues/2380)) ([762bc99](https://github.com/typescript-eslint/typescript-eslint/commit/762bc99584ede4d0b8099a743991e957aec86aa8)) + + +### Features + +* consume new scope analysis package ([#2039](https://github.com/typescript-eslint/typescript-eslint/issues/2039)) ([3be125d](https://github.com/typescript-eslint/typescript-eslint/commit/3be125d9bdbee1984ac6037874edf619213bd3d0)) +* support ESTree optional chaining representation ([#2308](https://github.com/typescript-eslint/typescript-eslint/issues/2308)) ([e9d2ab6](https://github.com/typescript-eslint/typescript-eslint/commit/e9d2ab638b6767700b52797e74b814ea059beaae)) +* **eslint-plugin:** [ban-ts-comment] change default for `ts-expect-error` to `allow-with-description` ([#2351](https://github.com/typescript-eslint/typescript-eslint/issues/2351)) ([a3f163a](https://github.com/typescript-eslint/typescript-eslint/commit/a3f163abc03f0fefc6dca1f205b728a4425209e4)), closes [#2146](https://github.com/typescript-eslint/typescript-eslint/issues/2146) +* **eslint-plugin:** [no-unnecessary-condition][strict-boolean-expressions] add option to make the rules error on files without `strictNullChecks` turned on ([#2345](https://github.com/typescript-eslint/typescript-eslint/issues/2345)) ([9273441](https://github.com/typescript-eslint/typescript-eslint/commit/9273441f7592b52620e10432cb2dd4dc5c3b4db1)) +* **eslint-plugin:** [typedef] remove all defaults ([#2352](https://github.com/typescript-eslint/typescript-eslint/issues/2352)) ([a9cd6fb](https://github.com/typescript-eslint/typescript-eslint/commit/a9cd6fb893074e4f2ca9ad3497eaddfacb3cfd25)) +* **eslint-plugin:** add `consistent-type-imports` rule ([#2367](https://github.com/typescript-eslint/typescript-eslint/issues/2367)) ([58b1c2d](https://github.com/typescript-eslint/typescript-eslint/commit/58b1c2d463f34895798b9a61340e49ffc3ec4f1a)) + + +### BREAKING CHANGES + +* - Removed decorators property from several Nodes that could never semantically have them (FunctionDeclaration, TSEnumDeclaration, and TSInterfaceDeclaration) +- Removed AST_NODE_TYPES.Import. This is a minor breaking change as the node type that used this was removed ages ago. +* **eslint-plugin:** Default rule options is a breaking change. + + + + + +## [3.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.0...v3.10.1) (2020-08-25) + + +### Bug Fixes + +* **eslint-plugin:** [no-unnecessary-condition] correct regression with unary negations ([#2422](https://github.com/typescript-eslint/typescript-eslint/issues/2422)) ([d1f0887](https://github.com/typescript-eslint/typescript-eslint/commit/d1f08879338c825a1a20406fe47c051a287d6519)), closes [#2421](https://github.com/typescript-eslint/typescript-eslint/issues/2421) + + + + + +# [3.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.1...v3.10.0) (2020-08-24) + + +### Bug Fixes + +* **eslint-plugin:** [explicit-module-boundary-types] ignore abstract setters ([#2410](https://github.com/typescript-eslint/typescript-eslint/issues/2410)) ([3764248](https://github.com/typescript-eslint/typescript-eslint/commit/3764248084455409f085c5bc4706079405cef618)) +* **eslint-plugin:** [explicit-module-boundary-types] ignore all bodyless setters ([#2413](https://github.com/typescript-eslint/typescript-eslint/issues/2413)) ([a53f8c6](https://github.com/typescript-eslint/typescript-eslint/commit/a53f8c6ff37aa47b3fc1b729e359d81ea079ff75)) +* **eslint-plugin:** [no-unnecessary-condition] better handling for unary negation ([#2382](https://github.com/typescript-eslint/typescript-eslint/issues/2382)) ([32fe2bb](https://github.com/typescript-eslint/typescript-eslint/commit/32fe2bb4fe5524355eef4f3a9bd85c824e9d7f46)) + + +### Features + +* **eslint-plugin:** add `no-implicit-any-catch` rule ([#2202](https://github.com/typescript-eslint/typescript-eslint/issues/2202)) ([fde89d4](https://github.com/typescript-eslint/typescript-eslint/commit/fde89d4d392ef35cac2bc09f2774bfe397b20100)) + + + + + +## [3.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.0...v3.9.1) (2020-08-17) + + +### Bug Fixes + +* **eslint-plugin:** [no-unnecessary-condition] fix false positive with nullish coalescing ([#2385](https://github.com/typescript-eslint/typescript-eslint/issues/2385)) ([092c969](https://github.com/typescript-eslint/typescript-eslint/commit/092c96967fd9b58fb2d8d325e1dbc750ccbeb746)) +* **eslint-plugin:** [prefer-includes] don't auto fix when `test` method's argument type doesn't have an 'includes' method ([#2391](https://github.com/typescript-eslint/typescript-eslint/issues/2391)) ([71c4c72](https://github.com/typescript-eslint/typescript-eslint/commit/71c4c729e90e308e0afd70af7db5e9d9ff238527)) + + + + + +# [3.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.8.0...v3.9.0) (2020-08-10) + + +### Bug Fixes + +* **eslint-plugin:** [no-throw-literal] support type assertions ([#2354](https://github.com/typescript-eslint/typescript-eslint/issues/2354)) ([470174a](https://github.com/typescript-eslint/typescript-eslint/commit/470174ad51fdb12d82129a896559075513f6c912)) + + +### Features + +* **eslint-plugin:** [no-unsafe-assignment/return] allow assigning any => unknown ([#2371](https://github.com/typescript-eslint/typescript-eslint/issues/2371)) ([e7528e6](https://github.com/typescript-eslint/typescript-eslint/commit/e7528e686f5fe5cce8504fc15d3cd06b8733712e)) +* **typescript-estree:** support TSv4 labelled tuple members ([#2378](https://github.com/typescript-eslint/typescript-eslint/issues/2378)) ([00d84ff](https://github.com/typescript-eslint/typescript-eslint/commit/00d84ffbcbe9d0ec98bdb2f2ce59959a27ce4dbe)) + + + + + +# [3.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.1...v3.8.0) (2020-08-03) + + +### Bug Fixes + +* **eslint-plugin:** [no-implied-eval] don't report when `Function` is imported ([#2348](https://github.com/typescript-eslint/typescript-eslint/issues/2348)) ([fa169e7](https://github.com/typescript-eslint/typescript-eslint/commit/fa169e79661821f0e0e64a56d6db9da42c3c8654)) +* **eslint-plugin:** [no-unsafe-assignment] fix typo in message ([#2347](https://github.com/typescript-eslint/typescript-eslint/issues/2347)) ([2027bb1](https://github.com/typescript-eslint/typescript-eslint/commit/2027bb11689b76c297f93ba8a918b35fe68e5b9d)) + + +### Features + +* **eslint-plugin:** [naming-convention] allow specifying an array of selectors ([#2335](https://github.com/typescript-eslint/typescript-eslint/issues/2335)) ([3ef6bd5](https://github.com/typescript-eslint/typescript-eslint/commit/3ef6bd5cadc225e42ef1330d15919a39f53f2a2b)) +* **eslint-plugin:** add `prefer-enum-initializers` rule ([#2326](https://github.com/typescript-eslint/typescript-eslint/issues/2326)) ([4f38ea3](https://github.com/typescript-eslint/typescript-eslint/commit/4f38ea39c97289db11501d6368d01db8c5787257)) + + + + + +## [3.7.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.0...v3.7.1) (2020-07-27) + + +### Bug Fixes + +* **eslint-plugin:** [adjacent-overload-signatures] fix false positive on call signatures and a method named `call` ([#2313](https://github.com/typescript-eslint/typescript-eslint/issues/2313)) ([30fafb0](https://github.com/typescript-eslint/typescript-eslint/commit/30fafb09422b3aca881f4785d89b0536092d4952)) +* **eslint-plugin:** [no-extra-parens] stop reporting on calling generic functions with one argument and type parameters containing parentheses ([#2319](https://github.com/typescript-eslint/typescript-eslint/issues/2319)) ([616a841](https://github.com/typescript-eslint/typescript-eslint/commit/616a841032bec310d9f31f1c987888273df27008)) + + + + + +# [3.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.1...v3.7.0) (2020-07-20) + + +### Features + +* **eslint-plugin:** [naming-convention] allow selecting only `const` variables ([#2291](https://github.com/typescript-eslint/typescript-eslint/issues/2291)) ([156d058](https://github.com/typescript-eslint/typescript-eslint/commit/156d058fee835fdf1ed827a5ad4a80d57190cc54)) +* **eslint-plugin:** [no-empty-function] add `decoratedFunctions` option ([#2295](https://github.com/typescript-eslint/typescript-eslint/issues/2295)) ([88f08f4](https://github.com/typescript-eslint/typescript-eslint/commit/88f08f410760f58fdc2de58ecd9dab9610821642)) + + + + + +## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) + + +### Bug Fixes + +* **eslint-plugin:** [no-unnecessary-condition] handle computed member access ([#2288](https://github.com/typescript-eslint/typescript-eslint/issues/2288)) ([3a187ca](https://github.com/typescript-eslint/typescript-eslint/commit/3a187cafb7302a3c05de0e6a236dd142a5e2d741)) +* **eslint-plugin:** [prefer-literal-enum-member] allow negative numbers ([#2277](https://github.com/typescript-eslint/typescript-eslint/issues/2277)) ([00ac9c3](https://github.com/typescript-eslint/typescript-eslint/commit/00ac9c3ccaad27bab08ec3c3a104f612bb593df5)) +* **eslint-plugin:** [space-before-function-paren] incorrect handling of abstract methods ([#2275](https://github.com/typescript-eslint/typescript-eslint/issues/2275)) ([ced6591](https://github.com/typescript-eslint/typescript-eslint/commit/ced65918b16f46c383496a9b4bd43eca8a76baf6)), closes [#2274](https://github.com/typescript-eslint/typescript-eslint/issues/2274) +* **eslint-plugin:** [switch-exhaustiveness-check] handle special characters in enum keys ([#2207](https://github.com/typescript-eslint/typescript-eslint/issues/2207)) ([98ab010](https://github.com/typescript-eslint/typescript-eslint/commit/98ab010fb7fca884984bb4200fd806ecee8071b6)) + + + + + +# [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) + + +### Bug Fixes + +* **eslint-plugin:** [no-namespace] allow namespaces in nested declarations with `allowDeclarations` ([#2238](https://github.com/typescript-eslint/typescript-eslint/issues/2238)) ([c1df669](https://github.com/typescript-eslint/typescript-eslint/commit/c1df6694f7866d3ef7ede0b1c6c9dd6f3955e682)) +* **eslint-plugin:** [space-before-function-paren] handle abstract functions ([#2199](https://github.com/typescript-eslint/typescript-eslint/issues/2199)) ([88a3edf](https://github.com/typescript-eslint/typescript-eslint/commit/88a3edfce8349f871b7b660d2b76508b67c94eda)) + + +### Features + +* **eslint-plugin:** add rule `prefer-literal-enum-member` ([#1898](https://github.com/typescript-eslint/typescript-eslint/issues/1898)) ([fe2b2ec](https://github.com/typescript-eslint/typescript-eslint/commit/fe2b2ec39ef04ac8b73eef9d29d12fd1b24fa183)) + + + + + +# [3.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.4.0...v3.5.0) (2020-06-29) + + +### Bug Fixes + +* **eslint-plugin:** [naming-convention] support unicode in regex ([#2241](https://github.com/typescript-eslint/typescript-eslint/issues/2241)) ([5fdd21a](https://github.com/typescript-eslint/typescript-eslint/commit/5fdd21a1726fb6928098c4152aec55a30df960d4)) + + +### Features + +* add package scope-manager ([#1939](https://github.com/typescript-eslint/typescript-eslint/issues/1939)) ([682eb7e](https://github.com/typescript-eslint/typescript-eslint/commit/682eb7e009c3f22a542882dfd3602196a60d2a1e)) + + + + + +# [3.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.3.0...v3.4.0) (2020-06-22) + + +### Bug Fixes + +* **eslint-plugin:** [no-base-to-string] handle intersection types ([#2170](https://github.com/typescript-eslint/typescript-eslint/issues/2170)) ([9cca3a9](https://github.com/typescript-eslint/typescript-eslint/commit/9cca3a9584d5d5ef0536219c5a734f4e87efb543)) +* **eslint-plugin:** [unbound-method] handling destructuring ([#2228](https://github.com/typescript-eslint/typescript-eslint/issues/2228)) ([c3753c2](https://github.com/typescript-eslint/typescript-eslint/commit/c3753c21768d355ecdb9e7ae8e0bfdfbbc1d3bbe)) + + +### Features + +* **eslint-plugin:** [no-unnecessary-boolean-literal-compare] add option to check nullable booleans ([#1983](https://github.com/typescript-eslint/typescript-eslint/issues/1983)) ([c0b3057](https://github.com/typescript-eslint/typescript-eslint/commit/c0b3057b7f7d515891ad2efe32e4ef8c01e0478f)) +* **eslint-plugin:** add extension rule `no-loss-of-precision` ([#2196](https://github.com/typescript-eslint/typescript-eslint/issues/2196)) ([535b0f2](https://github.com/typescript-eslint/typescript-eslint/commit/535b0f2ddd82efa6a2c40307a61c480f4b3cdea3)) + + + + + +# [3.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.2.0...v3.3.0) (2020-06-15) + + +### Bug Fixes + +* **eslint-plugin:** [no-unused-expressions] handle ternary and short-circuit options ([#2194](https://github.com/typescript-eslint/typescript-eslint/issues/2194)) ([ee9f100](https://github.com/typescript-eslint/typescript-eslint/commit/ee9f100a2f9a874c2b361482742686eeaa9bdac7)) + + +### Features + +* **eslint-plugin:** [naming-convention] better error message and docs for prefix/suffix ([#2195](https://github.com/typescript-eslint/typescript-eslint/issues/2195)) ([a2ffe55](https://github.com/typescript-eslint/typescript-eslint/commit/a2ffe5568df0f7224bfe9141d298e538383d5f09)) + + + + + +# [3.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.1.0...v3.2.0) (2020-06-08) + + +### Bug Fixes + +* **eslint-plugin:** [explicit-module-boundary-types] dont report return type errors on constructor overloads ([#2158](https://github.com/typescript-eslint/typescript-eslint/issues/2158)) ([53232d7](https://github.com/typescript-eslint/typescript-eslint/commit/53232d775ca0b808e2d75d9501f4411a868b2b48)) +* **eslint-plugin:** [explicit-module-boundary-types] handle bodyless arrow functions with explicit return types that return functions ([#2169](https://github.com/typescript-eslint/typescript-eslint/issues/2169)) ([58db655](https://github.com/typescript-eslint/typescript-eslint/commit/58db655133aaae006efe3e3ceee971cf88dc348f)) +* **eslint-plugin:** [explicit-module-boundary-types] handle nested functions and functions expressions in a typed variable declaration ([#2176](https://github.com/typescript-eslint/typescript-eslint/issues/2176)) ([6ff450d](https://github.com/typescript-eslint/typescript-eslint/commit/6ff450da3abec93223a33f6b52484c9ca99b7abe)) +* **eslint-plugin:** [no-extra-non-null-assertion] dont report for assertions not followed by the optional chain ([#2167](https://github.com/typescript-eslint/typescript-eslint/issues/2167)) ([e4c1834](https://github.com/typescript-eslint/typescript-eslint/commit/e4c1834c7c5934332dd1d58c09018453568c4889)) +* **eslint-plugin:** [no-unnecessary-conditionals] Handle comparison of generics and loose comparisons with undefined values ([#2152](https://github.com/typescript-eslint/typescript-eslint/issues/2152)) ([c86e2a2](https://github.com/typescript-eslint/typescript-eslint/commit/c86e2a235372149db9b1700d39c2145e0ce5221a)) +* **eslint-plugin:** [prefer-optional-chain] handling first member expression ([#2156](https://github.com/typescript-eslint/typescript-eslint/issues/2156)) ([de18660](https://github.com/typescript-eslint/typescript-eslint/commit/de18660a8cf8f7033798646d8c5b0938d1accb12)) +* **eslint-plugin:** [return-await] correct handling of ternaries ([#2168](https://github.com/typescript-eslint/typescript-eslint/issues/2168)) ([fe4c0bf](https://github.com/typescript-eslint/typescript-eslint/commit/fe4c0bf8c04f070d6642fbe86c5e5614bc88e8fd)) + + +### Features + +* **eslint-plugin:** [naming-convention] put identifiers in quotes in error messages ([#2182](https://github.com/typescript-eslint/typescript-eslint/issues/2182)) ([fc61932](https://github.com/typescript-eslint/typescript-eslint/commit/fc619326eedf7ef2efa51444ecdead81a36a204f)), closes [#2178](https://github.com/typescript-eslint/typescript-eslint/issues/2178) +* **eslint-plugin:** [require-array-sort-compare] add `ignoreStringArrays` option ([#1972](https://github.com/typescript-eslint/typescript-eslint/issues/1972)) ([6dee784](https://github.com/typescript-eslint/typescript-eslint/commit/6dee7840a3af1dfe4c38a128d1c4655bdac625df)) +* **eslint-plugin:** add rule `ban-tslint-comment` ([#2140](https://github.com/typescript-eslint/typescript-eslint/issues/2140)) ([43ee226](https://github.com/typescript-eslint/typescript-eslint/commit/43ee226ffbaaa3e7126081db9476c24b89ec16e9)) +* **eslint-plugin:** add rule `no-confusing-non-null-assertion` ([#1941](https://github.com/typescript-eslint/typescript-eslint/issues/1941)) ([9b51c44](https://github.com/typescript-eslint/typescript-eslint/commit/9b51c44f29d8b3e95a510985544e8ded8a14404d)) + + + + + +# [3.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.2...v3.1.0) (2020-06-01) + + +### Bug Fixes + +* **eslint-plugin:** [explicit-module-boundary-types] don't check returned functions if parent function has return type ([#2084](https://github.com/typescript-eslint/typescript-eslint/issues/2084)) ([d7d4eeb](https://github.com/typescript-eslint/typescript-eslint/commit/d7d4eeb03f2918d5d9e361fdb47c2d42e83bd593)) +* **eslint-plugin:** [no-unnecessary-condition] handle comparison of any, unknown and loose comparisons with nullish values ([#2123](https://github.com/typescript-eslint/typescript-eslint/issues/2123)) ([1ae1d01](https://github.com/typescript-eslint/typescript-eslint/commit/1ae1d01e5603ec7cef8051ed018c3c3c88b29867)) +* **eslint-plugin:** [no-unnecessary-condition] improve optional chain handling ([#2111](https://github.com/typescript-eslint/typescript-eslint/issues/2111)) ([9ee399b](https://github.com/typescript-eslint/typescript-eslint/commit/9ee399b5906e82f346ff89141207a6630786de54)) +* **eslint-plugin:** [no-unnecessary-condition] improve optional chain handling 2 - electric boogaloo ([#2138](https://github.com/typescript-eslint/typescript-eslint/issues/2138)) ([c87cfaf](https://github.com/typescript-eslint/typescript-eslint/commit/c87cfaf6746775bb8ad9eb45b0002f068a822dbe)) +* **eslint-plugin:** [no-unused-expressions] ignore import expressions ([#2130](https://github.com/typescript-eslint/typescript-eslint/issues/2130)) ([e383691](https://github.com/typescript-eslint/typescript-eslint/commit/e3836910efdafd9edf04daed149c9e839c08047e)) +* **eslint-plugin:** [no-var-requires] false negative for TSAsExpression and MemberExpression ([#2139](https://github.com/typescript-eslint/typescript-eslint/issues/2139)) ([df95338](https://github.com/typescript-eslint/typescript-eslint/commit/df953388913b22d45242e65ce231d92a8b8a0080)) +* **experimental-utils:** downlevel type declarations for versions older than 3.8 ([#2133](https://github.com/typescript-eslint/typescript-eslint/issues/2133)) ([7925823](https://github.com/typescript-eslint/typescript-eslint/commit/792582326a8065270b69a0ffcaad5a7b4b103ff3)) + + +### Features + +* **eslint-plugin:** [ban-ts-comments] add "allow-with-description" option ([#2099](https://github.com/typescript-eslint/typescript-eslint/issues/2099)) ([8a0fd18](https://github.com/typescript-eslint/typescript-eslint/commit/8a0fd1899f544470a35afb3117f4c71aad7e4e42)) +* **eslint-plugin:** [ban-types] allow selective disable of default options with `false` value ([#2137](https://github.com/typescript-eslint/typescript-eslint/issues/2137)) ([1cb8ca4](https://github.com/typescript-eslint/typescript-eslint/commit/1cb8ca483d029935310e6904580df8501837084d)) +* **eslint-plugin:** [explicit-module-boundary-types] improve accuracy and coverage ([#2135](https://github.com/typescript-eslint/typescript-eslint/issues/2135)) ([caaa859](https://github.com/typescript-eslint/typescript-eslint/commit/caaa8599284d02ab3341e282cad35a52d0fb86c7)) + + + + + +## [3.0.2](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.1...v3.0.2) (2020-05-27) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin + + + + + +## [3.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.0...v3.0.1) (2020-05-25) + + +### Bug Fixes + +* **eslint-plugin:** [naming-convention] handle no options correctly ([#2095](https://github.com/typescript-eslint/typescript-eslint/issues/2095)) ([fd7d02b](https://github.com/typescript-eslint/typescript-eslint/commit/fd7d02b31ebd995b7fdd857d7c054042aa4f2001)) +* **eslint-plugin:** [no-throw-literal] handle intersection and union types ([#2085](https://github.com/typescript-eslint/typescript-eslint/issues/2085)) ([cae037f](https://github.com/typescript-eslint/typescript-eslint/commit/cae037ff9b20363b970cc600a09505b98bf10a14)) +* **eslint-plugin:** [unbound-method] fix crash due to missing `Intl` ([#2090](https://github.com/typescript-eslint/typescript-eslint/issues/2090)) ([f2fa82c](https://github.com/typescript-eslint/typescript-eslint/commit/f2fa82c532ae858ccfb064268cfcc9df657a54be)) + + + + + +# [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) + +## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) + +### Bug Fixes + +* **eslint-plugin:** [dot-notation] fix typo in schema ([#2040](https://github.com/typescript-eslint/typescript-eslint/issues/2040)) ([242328f](https://github.com/typescript-eslint/typescript-eslint/commit/242328fa749ee4c72af93433a9bef95f329ac62f)) +* **eslint-plugin:** correct parser peerDep version ([fe59f69](https://github.com/typescript-eslint/typescript-eslint/commit/fe59f69381a0915a4f5135e2e88637a5eea246ba)) +* **experimental-utils:** add back SourceCode.isSpaceBetweenTokens ([ae82ea4](https://github.com/typescript-eslint/typescript-eslint/commit/ae82ea4a85a4ca332ebe6104e96c59dba30411be)) +* **typescript-estree:** remove now defunct `Import` node type ([f199cbd](https://github.com/typescript-eslint/typescript-eslint/commit/f199cbdbbd892b5ba03bfff66f463f3d9c92ee9b)) +* **typescript-estree:** use `TSEmptyBodyFunctionExpression` for body-less nodes ([#1289](https://github.com/typescript-eslint/typescript-eslint/issues/1289)) ([82e7163](https://github.com/typescript-eslint/typescript-eslint/commit/82e7163214b56ccde93ba97807b161669a50a60b)) + + +### Features + +* **eslint-plugin:** [ban-types] rework default options ([#848](https://github.com/typescript-eslint/typescript-eslint/issues/848)) ([8e31d5d](https://github.com/typescript-eslint/typescript-eslint/commit/8e31d5dbe9fe5227fdbefcecfd50ce5dd51360c3)) +* **eslint-plugin:** [no-floating-promises] ignore void operator by default ([#2003](https://github.com/typescript-eslint/typescript-eslint/issues/2003)) ([3626a67](https://github.com/typescript-eslint/typescript-eslint/commit/3626a673cf8117cc995245cd86e466e2553e9b0e)) +* **eslint-plugin:** [prefer-nullish-coalescing][prefer-optional-chain] remove unsafe fixers ([52b6085](https://github.com/typescript-eslint/typescript-eslint/commit/52b60852d0ba6bb6abe519c9d3ec1b231793e91d)) +* **experimental-utils:** upgrade eslint types for v7 ([#2023](https://github.com/typescript-eslint/typescript-eslint/issues/2023)) ([06869c9](https://github.com/typescript-eslint/typescript-eslint/commit/06869c9656fa37936126666845aee40aad546ebd)) +* upgrade to ESLint v7 ([#2022](https://github.com/typescript-eslint/typescript-eslint/issues/2022)) ([208de71](https://github.com/typescript-eslint/typescript-eslint/commit/208de71059746bf38e94bd460346ffb2698a3e12)) +* **eslint-plugin:** [no-unnecessary-condition] remove `checkArrayPredicates` and always check it ([#1579](https://github.com/typescript-eslint/typescript-eslint/issues/1579)) ([bfd9b60](https://github.com/typescript-eslint/typescript-eslint/commit/bfd9b606d17d30d5694967a1f01e0e1501ba1022)) +* **eslint-plugin:** [no-unnecessary-condition] remove option `ignoreRHS` ([#1163](https://github.com/typescript-eslint/typescript-eslint/issues/1163)) ([ee8dd8f](https://github.com/typescript-eslint/typescript-eslint/commit/ee8dd8f8a9e6c25ac426ce9bb71c5f012c51f264)) +* **eslint-plugin:** [no-unnecessary-condition] report when non-nullish is compared to `null`/`undefined` ([#1659](https://github.com/typescript-eslint/typescript-eslint/issues/1659)) ([7fa9060](https://github.com/typescript-eslint/typescript-eslint/commit/7fa906073903c5eb70609c25f1a91ada14dcdc71)) +* **eslint-plugin:** [restrict-template-expressions] `allowNumber: true` by default ([#2005](https://github.com/typescript-eslint/typescript-eslint/issues/2005)) ([643ec24](https://github.com/typescript-eslint/typescript-eslint/commit/643ec240bd901295d9e9ea5c43fc20109c33e982)) +* **eslint-plugin:** [restrict-template-expressions] rename `allowNullable` to `allowNullish` ([#2006](https://github.com/typescript-eslint/typescript-eslint/issues/2006)) ([264b017](https://github.com/typescript-eslint/typescript-eslint/commit/264b017c11c2ab132fcbad18b42a9a0fe639386e)) +* **eslint-plugin:** [strict-boolean-expression] rework options ([#1631](https://github.com/typescript-eslint/typescript-eslint/issues/1631)) ([cd14482](https://github.com/typescript-eslint/typescript-eslint/commit/cd1448240dca11762fcb9c10e18bb6541a840485)) +* **eslint-plugin:** delete deprecated rules ([#2002](https://github.com/typescript-eslint/typescript-eslint/issues/2002)) ([da0aec2](https://github.com/typescript-eslint/typescript-eslint/commit/da0aec2cfa27902aae7c438a2fe91343c822e4ae)) +* **eslint-plugin:** eslint-recommended: disable no-func-assign ([#984](https://github.com/typescript-eslint/typescript-eslint/issues/984)) ([ae9b8a9](https://github.com/typescript-eslint/typescript-eslint/commit/ae9b8a9c73c0328287de956466257d8bbfbdb20f)) +* **eslint-plugin:** eslint-recommended: disable no-obj-calls ([#1000](https://github.com/typescript-eslint/typescript-eslint/issues/1000)) ([b9ca14c](https://github.com/typescript-eslint/typescript-eslint/commit/b9ca14c5f5ec28a3fde1a9b2d2f6a4dc74d903e4)) +* **eslint-plugin:** update `eslint-recommended` set ([#1996](https://github.com/typescript-eslint/typescript-eslint/issues/1996)) ([9a96e18](https://github.com/typescript-eslint/typescript-eslint/commit/9a96e18400e0a0d738d159d9d01faf41d3586249)) +* **eslint-plugin:** update recommended sets ([#2001](https://github.com/typescript-eslint/typescript-eslint/issues/2001)) ([0126b4f](https://github.com/typescript-eslint/typescript-eslint/commit/0126b4f56f9197d561e90b09962ccceb4f88bc41)) +* **typescript-estree:** align nodes with estree 2020 ([#1389](https://github.com/typescript-eslint/typescript-eslint/issues/1389)) ([aff5b62](https://github.com/typescript-eslint/typescript-eslint/commit/aff5b62044f9b93f2087a1d261e9be3f8d6fd54d)) +* drop support for node v8 ([#1997](https://github.com/typescript-eslint/typescript-eslint/issues/1997)) ([b6c3b7b](https://github.com/typescript-eslint/typescript-eslint/commit/b6c3b7b84b8d199fa75a46432febd4a364a63217)) +* **typescript-estree:** always return parserServices ([#716](https://github.com/typescript-eslint/typescript-eslint/issues/716)) ([5b23443](https://github.com/typescript-eslint/typescript-eslint/commit/5b23443c48f3f62424db3e742243f3568080b946)) +* **typescript-estree:** handle 3.9's non-null assertion changes ([#2036](https://github.com/typescript-eslint/typescript-eslint/issues/2036)) ([06bec63](https://github.com/typescript-eslint/typescript-eslint/commit/06bec63c56536db070608ab136d2ad57083f0c6a)) + + + + + +# [2.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.33.0...v2.34.0) (2020-05-18) + + +### Features + +* **eslint-plugin:** [no-invalid-void-type] allow union of void and `allowInGenericTypeArguments` ([#1960](https://github.com/typescript-eslint/typescript-eslint/issues/1960)) ([1bc105a](https://github.com/typescript-eslint/typescript-eslint/commit/1bc105a2c6ae3fde9596f0419fed0de699dc57c7)) +* **eslint-plugin:** [restrict-template-expressions] improve error message ([#1926](https://github.com/typescript-eslint/typescript-eslint/issues/1926)) ([1af59ba](https://github.com/typescript-eslint/typescript-eslint/commit/1af59ba8ac0ceabb008d9c61556acf7db0a1d352)) +* **experimental-utils:** add `suggestion` property for rule modules ([#2033](https://github.com/typescript-eslint/typescript-eslint/issues/2033)) ([f42a5b0](https://github.com/typescript-eslint/typescript-eslint/commit/f42a5b09ebfa173f418a99c552b0cbe221567194)) + + + + + +# [2.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.32.0...v2.33.0) (2020-05-12) + + +### Features + +* **eslint-plugin:** add extension rule `lines-between-class-members` ([#1684](https://github.com/typescript-eslint/typescript-eslint/issues/1684)) ([08f93e6](https://github.com/typescript-eslint/typescript-eslint/commit/08f93e69347a8e7f3a7e8a1455bb5d069c2faeef)) + + + + + +# [2.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.31.0...v2.32.0) (2020-05-11) + + +### Bug Fixes + +* **eslint-plugin:** [no-base-to-string] support boolean in unions ([#1979](https://github.com/typescript-eslint/typescript-eslint/issues/1979)) ([6987ecc](https://github.com/typescript-eslint/typescript-eslint/commit/6987ecc1dacfb45c0f8ed3e81d08aa708eb96ad1)) +* **eslint-plugin:** [no-type-alias] handle readonly types in aliases ([#1990](https://github.com/typescript-eslint/typescript-eslint/issues/1990)) ([56d9870](https://github.com/typescript-eslint/typescript-eslint/commit/56d987070f83d1b6410b04750b20a761fd793073)) +* **eslint-plugin:** [no-unused-expressions] inherit `messages` from base rule ([#1992](https://github.com/typescript-eslint/typescript-eslint/issues/1992)) ([51ca404](https://github.com/typescript-eslint/typescript-eslint/commit/51ca404af645eed194269ab7f8f67b97bd52e32d)) + + +### Features + +* bump dependencies and align AST ([#2007](https://github.com/typescript-eslint/typescript-eslint/issues/2007)) ([18668b7](https://github.com/typescript-eslint/typescript-eslint/commit/18668b78fd7d1e5281af7fc26c76e0ca53297f69)) + + + + + +# [2.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.30.0...v2.31.0) (2020-05-04) + + +### Bug Fixes + +* **eslint-plugin:** [dot-notation] handle missing declarations ([#1947](https://github.com/typescript-eslint/typescript-eslint/issues/1947)) ([383f931](https://github.com/typescript-eslint/typescript-eslint/commit/383f93182599c00e231a0f0d36575ca0e19369a6)) +* **eslint-plugin:** [method-signature-style] fix overloaded methods to an intersection type ([#1966](https://github.com/typescript-eslint/typescript-eslint/issues/1966)) ([7f3fba3](https://github.com/typescript-eslint/typescript-eslint/commit/7f3fba348d432d7637e1c737df943ee1f9105062)) +* **eslint-plugin:** [return-await] await in a normal function ([#1962](https://github.com/typescript-eslint/typescript-eslint/issues/1962)) ([f82fd7b](https://github.com/typescript-eslint/typescript-eslint/commit/f82fd7bb81f986c4861d0b4e2ecdb0c496d7a602)) +* **eslint-plugin:** [unbound-method] false positives for unary expressions ([#1964](https://github.com/typescript-eslint/typescript-eslint/issues/1964)) ([b35070e](https://github.com/typescript-eslint/typescript-eslint/commit/b35070ec6f84ad5ce606386cdb6eeb91488dfdd7)) +* **eslint-plugin:** no-base-to-string boolean expression detect ([#1969](https://github.com/typescript-eslint/typescript-eslint/issues/1969)) ([f78f13a](https://github.com/typescript-eslint/typescript-eslint/commit/f78f13aedd59d5b5880903d48c779a6c50fd937e)) + + +### Features + +* **eslint-plugin:** [member-ordering] add decorators support ([#1870](https://github.com/typescript-eslint/typescript-eslint/issues/1870)) ([f7ec192](https://github.com/typescript-eslint/typescript-eslint/commit/f7ec1920607cb8eec8020b08cd7247de0bf19ce1)) +* **eslint-plugin:** [prefer-optional-chain] added option to convert to suggestion fixer ([#1965](https://github.com/typescript-eslint/typescript-eslint/issues/1965)) ([2f0824b](https://github.com/typescript-eslint/typescript-eslint/commit/2f0824b0a41f3043b6242fc1d49faae540abaf22)) +* **eslint-plugin:** new extended rule 'no-invalid-this' ([#1823](https://github.com/typescript-eslint/typescript-eslint/issues/1823)) ([b18bc35](https://github.com/typescript-eslint/typescript-eslint/commit/b18bc357507337b9725f8d9c1b549513075a0da5)) +* **experimental-utils:** expose our RuleTester extension ([#1948](https://github.com/typescript-eslint/typescript-eslint/issues/1948)) ([2dd1638](https://github.com/typescript-eslint/typescript-eslint/commit/2dd1638aaa2658ba99b2341861146b586f489121)) + + + + + +# [2.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.29.0...v2.30.0) (2020-04-27) + + +### Bug Fixes + +* **eslint-plugin:** [prefer-string-starts-ends-with] check for negative start index in slice ([#1920](https://github.com/typescript-eslint/typescript-eslint/issues/1920)) ([ed2bd60](https://github.com/typescript-eslint/typescript-eslint/commit/ed2bd6067f74ae33e36a084719bb91efedfba599)) +* **eslint-plugin:** fix no-base-to-string boolean literal check ([#1850](https://github.com/typescript-eslint/typescript-eslint/issues/1850)) ([2f45e99](https://github.com/typescript-eslint/typescript-eslint/commit/2f45e9992a8f12b6233716e77a6159f9cea2c879)) + + +### Features + +* **eslint-plugin:** add extension rule `dot-notation` ([#1867](https://github.com/typescript-eslint/typescript-eslint/issues/1867)) ([a85c3e1](https://github.com/typescript-eslint/typescript-eslint/commit/a85c3e1515d735b6c245cc658cdaec6deb05d630)) +* **eslint-plugin:** create `no-invalid-void-type` rule ([#1847](https://github.com/typescript-eslint/typescript-eslint/issues/1847)) ([f667ff1](https://github.com/typescript-eslint/typescript-eslint/commit/f667ff1708d4ed28b7ea5beea742889da69a76d9)) + + + + + +# [2.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.28.0...v2.29.0) (2020-04-20) + + +### Bug Fixes + +* **eslint-plugin:** [no-base-to-string] soft remove `ignoreTaggedTemplateExpressions` option ([#1916](https://github.com/typescript-eslint/typescript-eslint/issues/1916)) ([369978e](https://github.com/typescript-eslint/typescript-eslint/commit/369978e9685bacb3e3882b0510ff06eaf8df4ca1)) + + +### Features + +* **eslint-plugin:** [no-floating-promise] add option to ignore IIFEs ([#1799](https://github.com/typescript-eslint/typescript-eslint/issues/1799)) ([cea51bf](https://github.com/typescript-eslint/typescript-eslint/commit/cea51bf130d6d3c2935f5e2dcc468196f2ad9d00)) +* **eslint-plugin:** [restrict-template-expressions] add support for intersection types ([#1803](https://github.com/typescript-eslint/typescript-eslint/issues/1803)) ([cc70e4f](https://github.com/typescript-eslint/typescript-eslint/commit/cc70e4fbadd0b15fd6af913a2e1e2ddd346fa558)) +* **eslint-plugin:** add extension rule `init-declarations` ([#1814](https://github.com/typescript-eslint/typescript-eslint/issues/1814)) ([b01f5e7](https://github.com/typescript-eslint/typescript-eslint/commit/b01f5e778ac28e0797a3734fc58d025bb224f418)) +* **eslint-plugin:** add extension rule `keyword-spacing` ([#1739](https://github.com/typescript-eslint/typescript-eslint/issues/1739)) ([c5106dd](https://github.com/typescript-eslint/typescript-eslint/commit/c5106dd4bf2bc8846cc39aa8bb50c33bec026d4d)) + + + + + +# [2.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.27.0...v2.28.0) (2020-04-13) + + +### Bug Fixes + +* **eslint-plugin:** [method-signature-style] handle multiline params ([#1861](https://github.com/typescript-eslint/typescript-eslint/issues/1861)) ([5832a86](https://github.com/typescript-eslint/typescript-eslint/commit/5832a8643bbe174ec02df5966bb333e506e45f5d)) +* **eslint-plugin:** [no-empty-interface] use suggestion fixer for ambient contexts ([#1880](https://github.com/typescript-eslint/typescript-eslint/issues/1880)) ([62b2278](https://github.com/typescript-eslint/typescript-eslint/commit/62b2278aec0011c93eae17bed8b278114d3379a2)) +* **eslint-plugin:** [unbound-method] false positive on property function initializer ([#1890](https://github.com/typescript-eslint/typescript-eslint/issues/1890)) ([f1c3b18](https://github.com/typescript-eslint/typescript-eslint/commit/f1c3b18f7aadc81f7dca7aa32aa1a8fe424e04e7)) +* **eslint-plugin:** [unbound-method] ignore assignments _to_ methods ([#1736](https://github.com/typescript-eslint/typescript-eslint/issues/1736)) ([6b4680b](https://github.com/typescript-eslint/typescript-eslint/commit/6b4680b6e7343d9d98fa1de170f387a36d98b73e)) +* **eslint-plugin:** no-empty-interface autofix ([#1865](https://github.com/typescript-eslint/typescript-eslint/issues/1865)) ([829a2f7](https://github.com/typescript-eslint/typescript-eslint/commit/829a2f728f876d356908e2338c2d6620e58f9943)), closes [#1864](https://github.com/typescript-eslint/typescript-eslint/issues/1864) +* **eslint-plugin:** use `isTypeArrayTypeOrUnionOfArrayTypes` util for checking if type is array ([#1728](https://github.com/typescript-eslint/typescript-eslint/issues/1728)) ([05030f8](https://github.com/typescript-eslint/typescript-eslint/commit/05030f8d2bd5a50e95053bc61380891da71cc567)) + + +### Features + +* **eslint-plugin:** [ban-ts-comment] support `ts-expect-error` ([#1706](https://github.com/typescript-eslint/typescript-eslint/issues/1706)) ([469cff3](https://github.com/typescript-eslint/typescript-eslint/commit/469cff332c041f38f60de052769287342455cff1)) +* **eslint-plugin:** [consistent-type-assertions] always allow `const` assertions ([#1713](https://github.com/typescript-eslint/typescript-eslint/issues/1713)) ([af2c00d](https://github.com/typescript-eslint/typescript-eslint/commit/af2c00de62f7e31eaeb88996ebf3f330cc8473b9)) +* **eslint-plugin:** [explicit-function-return-type] add option to allow concise arrows that start with void ([#1732](https://github.com/typescript-eslint/typescript-eslint/issues/1732)) ([2e9c202](https://github.com/typescript-eslint/typescript-eslint/commit/2e9c2028a8a0b226e0f87d4bcc997fa259ca3ebd)) +* **eslint-plugin:** [explicit-module-boundary-types] add optio… ([#1778](https://github.com/typescript-eslint/typescript-eslint/issues/1778)) ([3eee804](https://github.com/typescript-eslint/typescript-eslint/commit/3eee804461d017ea6189cd7f64fcd473623684b4)) +* **eslint-plugin:** [no-base-to-string] add option to ignore tagged templates ([#1763](https://github.com/typescript-eslint/typescript-eslint/issues/1763)) ([f5edb99](https://github.com/typescript-eslint/typescript-eslint/commit/f5edb9938c33f8b68f026eba00db3abe9359ced3)) +* **eslint-plugin:** [restrict-template-expressions] add option `allowAny` ([#1762](https://github.com/typescript-eslint/typescript-eslint/issues/1762)) ([d44c0f9](https://github.com/typescript-eslint/typescript-eslint/commit/d44c0f9bed2404ca00b020b35fd825929e213398)) +* **eslint-plugin:** add rule `prefer-reduce-type-parameter` ([#1707](https://github.com/typescript-eslint/typescript-eslint/issues/1707)) ([c92d240](https://github.com/typescript-eslint/typescript-eslint/commit/c92d240e49113779053eac32038382b282812afc)) +* **eslint-plugin:** add rule `prefer-ts-expect-error` ([#1705](https://github.com/typescript-eslint/typescript-eslint/issues/1705)) ([7021f21](https://github.com/typescript-eslint/typescript-eslint/commit/7021f2151a25db2a8edf17e06cd6f21e90761ec8)) +* **eslint-plugin:** add rule no-unsafe-assignment ([#1694](https://github.com/typescript-eslint/typescript-eslint/issues/1694)) ([a49b860](https://github.com/typescript-eslint/typescript-eslint/commit/a49b860cbbb2c7d718b99f561e2fb6eaadf16f17)) + + + + + +# [2.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.26.0...v2.27.0) (2020-04-06) + + +### Bug Fixes + +* **eslint-plugin:** [no-throw-literal] fix crash caused by getBaseTypes ([#1830](https://github.com/typescript-eslint/typescript-eslint/issues/1830)) ([9d53c76](https://github.com/typescript-eslint/typescript-eslint/commit/9d53c761983dd964109b9f13eb9bfe20caf9defb)) +* **eslint-plugin:** [no-unsafe-call] fix incorrect selector ([#1826](https://github.com/typescript-eslint/typescript-eslint/issues/1826)) ([8ec53a3](https://github.com/typescript-eslint/typescript-eslint/commit/8ec53a3579fcb59cdffea0c60fbb755d056f4c8a)) +* **eslint-plugin:** [require-await] handle async generators ([#1782](https://github.com/typescript-eslint/typescript-eslint/issues/1782)) ([9642d9d](https://github.com/typescript-eslint/typescript-eslint/commit/9642d9dce693befac89a4e9d8bf8dd18f4361e2a)) +* **eslint-plugin:** no-explicit-any constructor functions (& mo… ([#1711](https://github.com/typescript-eslint/typescript-eslint/issues/1711)) ([ab8572e](https://github.com/typescript-eslint/typescript-eslint/commit/ab8572e30e14ebda91c8437be5ee35e7dc9add2e)) + + +### Features + +* **eslint-plugin:** new rule method-signature-style ([#1685](https://github.com/typescript-eslint/typescript-eslint/issues/1685)) ([c49d771](https://github.com/typescript-eslint/typescript-eslint/commit/c49d771ba62f1a21d3c1aec106341daddfcd3c9a)) +* **eslint-plugin:** sort members alphabetically ([#263](https://github.com/typescript-eslint/typescript-eslint/issues/263)) ([485e902](https://github.com/typescript-eslint/typescript-eslint/commit/485e90213a0f8baac0587f7d56925448883fc5bd)) +* **eslint-plugin-internal:** add plugin-test-formatting rule ([#1821](https://github.com/typescript-eslint/typescript-eslint/issues/1821)) ([9b0023a](https://github.com/typescript-eslint/typescript-eslint/commit/9b0023a4996ecdd7dfcb30abd1678091a78f3064)) + + + + + +# [2.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.25.0...v2.26.0) (2020-03-30) + + +### Bug Fixes + +* **eslint-plugin:** [no-explicit-any] error with ignoreRestArgs ([#1796](https://github.com/typescript-eslint/typescript-eslint/issues/1796)) ([638d84d](https://github.com/typescript-eslint/typescript-eslint/commit/638d84ddd77d07117b3ec7c5431f3b0e44b1995d)) +* **eslint-plugin:** [no-unsafe-call] allow import expressions ([#1800](https://github.com/typescript-eslint/typescript-eslint/issues/1800)) ([4fa7107](https://github.com/typescript-eslint/typescript-eslint/commit/4fa710754ecc412b65ac3864fe0c7857c254ac1b)) +* **eslint-plugin:** [no-unsafe-return] error with =3.2.1 <3.6.0 ([#597](https://github.com/typescript-eslint/typescript-eslint/issues/597)) ([5d2b962](https://github.com/typescript-eslint/typescript-eslint/commit/5d2b962)) +- **eslint-plugin:** [explicit-function-return-type] allowHigherOrderFunctions ([#193](https://github.com/typescript-eslint/typescript-eslint/issues/193)) ([#538](https://github.com/typescript-eslint/typescript-eslint/issues/538)) ([50a493e](https://github.com/typescript-eslint/typescript-eslint/commit/50a493e)) +- **eslint-plugin:** add config all.json ([#313](https://github.com/typescript-eslint/typescript-eslint/issues/313)) ([67537b8](https://github.com/typescript-eslint/typescript-eslint/commit/67537b8)) + +# [1.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.8.0...v1.9.0) (2019-05-12) + +### Bug Fixes + +- **eslint-plugin:** Add missing dependency ([89c87cc](https://github.com/typescript-eslint/typescript-eslint/commit/89c87cc)), closes [#516](https://github.com/typescript-eslint/typescript-eslint/issues/516) +- **eslint-plugin:** Fix exported name of eslint-recommended ([#513](https://github.com/typescript-eslint/typescript-eslint/issues/513)) ([5c65350](https://github.com/typescript-eslint/typescript-eslint/commit/5c65350)) + +### Features + +- **eslint-plugin:** add prefer-regexp-exec rule ([#305](https://github.com/typescript-eslint/typescript-eslint/issues/305)) ([f61d421](https://github.com/typescript-eslint/typescript-eslint/commit/f61d421)) + +# [1.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.7.0...v1.8.0) (2019-05-10) + +### Bug Fixes + +- **eslint-plugin:** [array-type] support readonly operator ([#429](https://github.com/typescript-eslint/typescript-eslint/issues/429)) ([8e2d2f5](https://github.com/typescript-eslint/typescript-eslint/commit/8e2d2f5)) +- **eslint-plugin:** [explicit-function-return-type] Add handling for class properties ([#502](https://github.com/typescript-eslint/typescript-eslint/issues/502)) ([2c36325](https://github.com/typescript-eslint/typescript-eslint/commit/2c36325)) +- **eslint-plugin:** [no-extra-parens] Fix build error ([298d66c](https://github.com/typescript-eslint/typescript-eslint/commit/298d66c)) +- **eslint-plugin:** [unbound-method] Work around class prototype bug ([#499](https://github.com/typescript-eslint/typescript-eslint/issues/499)) ([3219aa7](https://github.com/typescript-eslint/typescript-eslint/commit/3219aa7)) +- **eslint-plugin:** correct eslint-recommended settings ([d52a683](https://github.com/typescript-eslint/typescript-eslint/commit/d52a683)) +- **eslint-plugin:** explicit-func-return-type: support object types and as expressions ([#459](https://github.com/typescript-eslint/typescript-eslint/issues/459)) ([d19e512](https://github.com/typescript-eslint/typescript-eslint/commit/d19e512)) +- **eslint-plugin:** restrict-plus-operands: generic constraint support ([#440](https://github.com/typescript-eslint/typescript-eslint/issues/440)) ([3f305b1](https://github.com/typescript-eslint/typescript-eslint/commit/3f305b1)) +- **eslint-plugin:** Support more nodes [no-extra-parens](<[#465](https://github.com/typescript-eslint/typescript-eslint/issues/465)>) ([2d15644](https://github.com/typescript-eslint/typescript-eslint/commit/2d15644)) +- **eslint-plugin:** support switch statement [unbound-method](<[#485](https://github.com/typescript-eslint/typescript-eslint/issues/485)>) ([e99ca81](https://github.com/typescript-eslint/typescript-eslint/commit/e99ca81)) + +### Features + +- **eslint-plugin:** (EXPERIMENTAL) begin indent rewrite ([#439](https://github.com/typescript-eslint/typescript-eslint/issues/439)) ([6eb97d4](https://github.com/typescript-eslint/typescript-eslint/commit/6eb97d4)) +- **eslint-plugin:** Add better non-null handling [no-unnecessary-type-assertion](<[#478](https://github.com/typescript-eslint/typescript-eslint/issues/478)>) ([4cd5590](https://github.com/typescript-eslint/typescript-eslint/commit/4cd5590)) +- **eslint-plugin:** Add func-call-spacing ([#448](https://github.com/typescript-eslint/typescript-eslint/issues/448)) ([92e65ec](https://github.com/typescript-eslint/typescript-eslint/commit/92e65ec)) +- **eslint-plugin:** Add new config "eslint-recommended" ([#488](https://github.com/typescript-eslint/typescript-eslint/issues/488)) ([2600a9f](https://github.com/typescript-eslint/typescript-eslint/commit/2600a9f)) +- **eslint-plugin:** add no-magic-numbers rule ([#373](https://github.com/typescript-eslint/typescript-eslint/issues/373)) ([43fa09c](https://github.com/typescript-eslint/typescript-eslint/commit/43fa09c)) +- **eslint-plugin:** Add semi [extension](<[#461](https://github.com/typescript-eslint/typescript-eslint/issues/461)>) ([0962017](https://github.com/typescript-eslint/typescript-eslint/commit/0962017)) +- **eslint-plugin:** no-inferrable-types: Support more primitives ([#442](https://github.com/typescript-eslint/typescript-eslint/issues/442)) ([4e193ca](https://github.com/typescript-eslint/typescript-eslint/commit/4e193ca)) +- Move shared types into their own package ([#425](https://github.com/typescript-eslint/typescript-eslint/issues/425)) ([a7a03ce](https://github.com/typescript-eslint/typescript-eslint/commit/a7a03ce)) + +# [1.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.6.0...v1.7.0) (2019-04-20) + +### Bug Fixes + +- **eslint-plugin:** indent: fix false positive on type parameters ([#385](https://github.com/typescript-eslint/typescript-eslint/issues/385)) ([d476f15](https://github.com/typescript-eslint/typescript-eslint/commit/d476f15)) +- **eslint-plugin:** no-object-literal-type-assertion: fix `as const` is reported ([#390](https://github.com/typescript-eslint/typescript-eslint/issues/390)) ([2521b85](https://github.com/typescript-eslint/typescript-eslint/commit/2521b85)) +- **eslint-plugin:** support BigInt in restrict-plus-operands rule ([#344](https://github.com/typescript-eslint/typescript-eslint/issues/344)) ([eee6d49](https://github.com/typescript-eslint/typescript-eslint/commit/eee6d49)), closes [#309](https://github.com/typescript-eslint/typescript-eslint/issues/309) + +### Features + +- **eslint-plugin:** [member-accessibility] add more options ([#322](https://github.com/typescript-eslint/typescript-eslint/issues/322)) ([4b3d820](https://github.com/typescript-eslint/typescript-eslint/commit/4b3d820)) +- **eslint-plugin:** add prefer-for-of rule ([#338](https://github.com/typescript-eslint/typescript-eslint/issues/338)) ([3e26ab6](https://github.com/typescript-eslint/typescript-eslint/commit/3e26ab6)) +- **eslint-plugin:** add prefer-includes rule ([#294](https://github.com/typescript-eslint/typescript-eslint/issues/294)) ([01c4dae](https://github.com/typescript-eslint/typescript-eslint/commit/01c4dae)), closes [#284](https://github.com/typescript-eslint/typescript-eslint/issues/284) +- **eslint-plugin:** add prefer-string-starts-ends-with rule ([#289](https://github.com/typescript-eslint/typescript-eslint/issues/289)) ([5592a2c](https://github.com/typescript-eslint/typescript-eslint/commit/5592a2c)), closes [#285](https://github.com/typescript-eslint/typescript-eslint/issues/285) +- **eslint-plugin:** added new rule await-promise ([#192](https://github.com/typescript-eslint/typescript-eslint/issues/192)) ([5311342](https://github.com/typescript-eslint/typescript-eslint/commit/5311342)) +- **eslint-plugin:** added new rule unbound-method ([#204](https://github.com/typescript-eslint/typescript-eslint/issues/204)) ([6718906](https://github.com/typescript-eslint/typescript-eslint/commit/6718906)) +- **eslint-plugin:** support type assertions in no-extra-parens rule ([#311](https://github.com/typescript-eslint/typescript-eslint/issues/311)) ([116ca75](https://github.com/typescript-eslint/typescript-eslint/commit/116ca75)) + +# [1.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.5.0...v1.6.0) (2019-04-03) + +### Bug Fixes + +- **eslint-plugin:** explicit-function-return-type: ensure class arrow methods are validated ([#377](https://github.com/typescript-eslint/typescript-eslint/issues/377)) ([643a223](https://github.com/typescript-eslint/typescript-eslint/commit/643a223)), closes [#348](https://github.com/typescript-eslint/typescript-eslint/issues/348) +- **eslint-plugin:** Fix `allowExpressions` false positives in explicit-function-return-type and incorrect documentation ([#388](https://github.com/typescript-eslint/typescript-eslint/issues/388)) ([f29d1c9](https://github.com/typescript-eslint/typescript-eslint/commit/f29d1c9)), closes [#387](https://github.com/typescript-eslint/typescript-eslint/issues/387) +- **eslint-plugin:** member-naming false flagging constructors ([#376](https://github.com/typescript-eslint/typescript-eslint/issues/376)) ([ad0f2be](https://github.com/typescript-eslint/typescript-eslint/commit/ad0f2be)), closes [#359](https://github.com/typescript-eslint/typescript-eslint/issues/359) +- **eslint-plugin:** no-type-alias: fix typeof alias erroring ([#380](https://github.com/typescript-eslint/typescript-eslint/issues/380)) ([cebcfe6](https://github.com/typescript-eslint/typescript-eslint/commit/cebcfe6)) + +### Features + +- change TypeScript version range to >=3.2.1 <3.5.0 ([#399](https://github.com/typescript-eslint/typescript-eslint/issues/399)) ([a4f95d3](https://github.com/typescript-eslint/typescript-eslint/commit/a4f95d3)) +- **eslint-plugin:** allow explicit variable type with arrow functions ([#260](https://github.com/typescript-eslint/typescript-eslint/issues/260)) ([bea6b92](https://github.com/typescript-eslint/typescript-eslint/commit/bea6b92)), closes [#149](https://github.com/typescript-eslint/typescript-eslint/issues/149) + +# [1.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.2...v1.5.0) (2019-03-20) + +### Bug Fixes + +- **eslint-plugin:** [interface-name-prefix] correct error message in always mode ([#333](https://github.com/typescript-eslint/typescript-eslint/issues/333)) ([097262f](https://github.com/typescript-eslint/typescript-eslint/commit/097262f)) +- **eslint-plugin:** fix false positives for adjacent-overload-signatures regarding computed property names ([#340](https://github.com/typescript-eslint/typescript-eslint/issues/340)) ([f6e5118](https://github.com/typescript-eslint/typescript-eslint/commit/f6e5118)) +- **eslint-plugin:** fix incorrect rule name ([#357](https://github.com/typescript-eslint/typescript-eslint/issues/357)) ([0a5146b](https://github.com/typescript-eslint/typescript-eslint/commit/0a5146b)) + +### Features + +- **eslint-plugin:** Add unified-signature rule ([#178](https://github.com/typescript-eslint/typescript-eslint/issues/178)) ([6ffaa0b](https://github.com/typescript-eslint/typescript-eslint/commit/6ffaa0b)) + +## [1.4.2](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.1...v1.4.2) (2019-02-25) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin + +## [1.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.0...v1.4.1) (2019-02-23) + +### Bug Fixes + +- **eslint-plugin:** out-of-bounds access in member-ordering rule ([#304](https://github.com/typescript-eslint/typescript-eslint/issues/304)) ([4526f27](https://github.com/typescript-eslint/typescript-eslint/commit/4526f27)) +- **eslint-plugin:** support BigInt in restrict-plus-operands rule ([#309](https://github.com/typescript-eslint/typescript-eslint/issues/309)) ([#310](https://github.com/typescript-eslint/typescript-eslint/issues/310)) ([9a88363](https://github.com/typescript-eslint/typescript-eslint/commit/9a88363)) + +# [1.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.3.0...v1.4.0) (2019-02-19) + +### Bug Fixes + +- **parser:** fix crash when visiting decorators in parameters ([#237](https://github.com/typescript-eslint/typescript-eslint/issues/237)) ([225fc26](https://github.com/typescript-eslint/typescript-eslint/commit/225fc26)) +- **parser:** fix visiting props of TSDeclareFunction ([#244](https://github.com/typescript-eslint/typescript-eslint/issues/244)) ([b40def8](https://github.com/typescript-eslint/typescript-eslint/commit/b40def8)) +- **ts-estree:** make sure that every node can be converted to tsNode ([#287](https://github.com/typescript-eslint/typescript-eslint/issues/287)) ([9f1d314](https://github.com/typescript-eslint/typescript-eslint/commit/9f1d314)) +- **typescript-estree, eslint-plugin:** stop adding ParenthesizedExpressions to node maps ([#226](https://github.com/typescript-eslint/typescript-eslint/issues/226)) ([317405a](https://github.com/typescript-eslint/typescript-eslint/commit/317405a)) + +### Features + +- **eslint-plugin:** add 'no-unnecessary-qualifier' rule ([#231](https://github.com/typescript-eslint/typescript-eslint/issues/231)) ([cc8f906](https://github.com/typescript-eslint/typescript-eslint/commit/cc8f906)) +- **eslint-plugin:** add ban-ts-ignore rule ([#276](https://github.com/typescript-eslint/typescript-eslint/issues/276)) ([859ab29](https://github.com/typescript-eslint/typescript-eslint/commit/859ab29)) +- **eslint-plugin:** add prefer-function-type rule ([#222](https://github.com/typescript-eslint/typescript-eslint/issues/222)) ([b95c4cf](https://github.com/typescript-eslint/typescript-eslint/commit/b95c4cf)) +- **eslint-plugin:** add require-array-sort-compare rule ([#261](https://github.com/typescript-eslint/typescript-eslint/issues/261)) ([2a4aaaa](https://github.com/typescript-eslint/typescript-eslint/commit/2a4aaaa)), closes [#247](https://github.com/typescript-eslint/typescript-eslint/issues/247) +- **eslint-plugin:** Migrate plugin to ts ([#120](https://github.com/typescript-eslint/typescript-eslint/issues/120)) ([61c60dc](https://github.com/typescript-eslint/typescript-eslint/commit/61c60dc)) +- **eslint-plugin:** update types to allow parameter type inferrence ([#272](https://github.com/typescript-eslint/typescript-eslint/issues/272)) ([80bd72c](https://github.com/typescript-eslint/typescript-eslint/commit/80bd72c)) +- **no-empty-interface:** add allowSingleExtend option ([#215](https://github.com/typescript-eslint/typescript-eslint/issues/215)) ([bf46f8c](https://github.com/typescript-eslint/typescript-eslint/commit/bf46f8c)) + +# [1.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.2.0...v1.3.0) (2019-02-07) + +### Bug Fixes + +- **eslint-plugin:** fix false positive from adjacent-overload-signatures ([#206](https://github.com/typescript-eslint/typescript-eslint/issues/206)) ([07e950e](https://github.com/typescript-eslint/typescript-eslint/commit/07e950e)) + +### Features + +- change TypeScript version range to >=3.2.1 <3.4.0 ([#184](https://github.com/typescript-eslint/typescript-eslint/issues/184)) ([f513a14](https://github.com/typescript-eslint/typescript-eslint/commit/f513a14)) +- **eslint-plugin:** add new rule no-for-in-array ([#155](https://github.com/typescript-eslint/typescript-eslint/issues/155)) ([84162ba](https://github.com/typescript-eslint/typescript-eslint/commit/84162ba)) +- **eslint-plugin:** add new rule no-require-imports ([#199](https://github.com/typescript-eslint/typescript-eslint/issues/199)) ([683e5bc](https://github.com/typescript-eslint/typescript-eslint/commit/683e5bc)) +- **eslint-plugin:** added new rule promise-function-async ([#194](https://github.com/typescript-eslint/typescript-eslint/issues/194)) ([5f3aec9](https://github.com/typescript-eslint/typescript-eslint/commit/5f3aec9)) + +# [1.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.1.1...v1.2.0) (2019-02-01) + +### Bug Fixes + +- **eslint-plugin:** fix no-extraneous-class for class without name ([#174](https://github.com/typescript-eslint/typescript-eslint/issues/174)) ([b1dbb64](https://github.com/typescript-eslint/typescript-eslint/commit/b1dbb64)) +- **eslint-plugin:** fix wrong URL ([#180](https://github.com/typescript-eslint/typescript-eslint/issues/180)) ([00d020d](https://github.com/typescript-eslint/typescript-eslint/commit/00d020d)) +- **eslint-plugin:** use bracket for infer type in array-type rule ([#173](https://github.com/typescript-eslint/typescript-eslint/issues/173)) ([1f868ce](https://github.com/typescript-eslint/typescript-eslint/commit/1f868ce)) +- **parser:** fix regression with no-unused-vars for jsx attributes ([#161](https://github.com/typescript-eslint/typescript-eslint/issues/161)) ([6147de1](https://github.com/typescript-eslint/typescript-eslint/commit/6147de1)) + +### Features + +- **eslint-plugin:** add eslint rule no-useless-constructor ([#167](https://github.com/typescript-eslint/typescript-eslint/issues/167)) ([3fb57a5](https://github.com/typescript-eslint/typescript-eslint/commit/3fb57a5)) +- **eslint-plugin:** add no-unnecessary-type-assertion rule ([#157](https://github.com/typescript-eslint/typescript-eslint/issues/157)) ([38abc28](https://github.com/typescript-eslint/typescript-eslint/commit/38abc28)) + +## [1.1.1](https://github.com/typescript-eslint/typescript-eslint/compare/v1.1.0...v1.1.1) (2019-01-29) + +### Bug Fixes + +- **eslint-plugin:** make parser services error clearer ([#132](https://github.com/typescript-eslint/typescript-eslint/issues/132)) ([aa9d1e1](https://github.com/typescript-eslint/typescript-eslint/commit/aa9d1e1)) +- **parser:** add visiting of type parameters in JSXOpeningElement ([#150](https://github.com/typescript-eslint/typescript-eslint/issues/150)) ([5e16003](https://github.com/typescript-eslint/typescript-eslint/commit/5e16003)) + +# [1.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.0.0...v1.1.0) (2019-01-23) + +### Bug Fixes + +- **eslint-plugin:** don’t mark `declare class` as unused ([#110](https://github.com/typescript-eslint/typescript-eslint/issues/110)) ([5841cd2](https://github.com/typescript-eslint/typescript-eslint/commit/5841cd2)), closes [#106](https://github.com/typescript-eslint/typescript-eslint/issues/106) +- **eslint-plugin:** improve detection of used vars in heritage ([#102](https://github.com/typescript-eslint/typescript-eslint/issues/102)) ([193b434](https://github.com/typescript-eslint/typescript-eslint/commit/193b434)) + +### Features + +- **eslint-plugin:** add new rule restrict-plus-operands ([#70](https://github.com/typescript-eslint/typescript-eslint/issues/70)) ([c541ede](https://github.com/typescript-eslint/typescript-eslint/commit/c541ede)) +- **eslint-plugin:** add option to no-object-literal-type-assertion rule ([#87](https://github.com/typescript-eslint/typescript-eslint/issues/87)) ([9f501a1](https://github.com/typescript-eslint/typescript-eslint/commit/9f501a1)) + +# [1.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v0.2.1...v1.0.0) (2019-01-20) + +### Bug Fixes + +- **eslint-plugin:** fix crash in rule indent for eslint 5.12.1 ([#89](https://github.com/typescript-eslint/typescript-eslint/issues/89)) ([3f51d51](https://github.com/typescript-eslint/typescript-eslint/commit/3f51d51)) +- **eslint-plugin:** no-unused-vars: mark declared statements as used ([#88](https://github.com/typescript-eslint/typescript-eslint/issues/88)) ([2df5e0c](https://github.com/typescript-eslint/typescript-eslint/commit/2df5e0c)) +- **eslint-plugin:** update remaining parser refs ([#97](https://github.com/typescript-eslint/typescript-eslint/issues/97)) ([055c3fc](https://github.com/typescript-eslint/typescript-eslint/commit/055c3fc)) + +### Features + +- **eslint-plugin:** remove exported parser ([#94](https://github.com/typescript-eslint/typescript-eslint/issues/94)) ([0ddb93c](https://github.com/typescript-eslint/typescript-eslint/commit/0ddb93c)) + +## [0.2.1](https://github.com/typescript-eslint/typescript-eslint/compare/v0.2.0...v0.2.1) (2019-01-20) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin diff --git a/node_modules/@typescript-eslint/eslint-plugin/LICENSE b/node_modules/@typescript-eslint/eslint-plugin/LICENSE new file mode 100644 index 000000000..7e7370143 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 TypeScript ESLint and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@typescript-eslint/eslint-plugin/README.md b/node_modules/@typescript-eslint/eslint-plugin/README.md new file mode 100644 index 000000000..63b5b6e7f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/README.md @@ -0,0 +1,224 @@ +

ESLint Plugin TypeScript

+ +

An ESLint plugin which provides lint rules for TypeScript codebases.

+ +

+ CI + NPM Version + NPM Downloads +

+ +## Getting Started + +- **[You can find our Getting Started docs here](../../docs/getting-started/linting/README.md)** +- **[You can find our FAQ / Troubleshooting docs here](../../docs/getting-started/linting/FAQ.md)** + +These docs walk you through setting up ESLint, this plugin, and our parser. If you know what you're doing and just want to quick start, read on... + +## Quick-start + +### Installation + +Make sure you have TypeScript and [`@typescript-eslint/parser`](../parser) installed: + +```bash +$ yarn add -D typescript @typescript-eslint/parser +$ npm i --save-dev typescript @typescript-eslint/parser +``` + +Then install the plugin: + +```bash +$ yarn add -D @typescript-eslint/eslint-plugin +$ npm i --save-dev @typescript-eslint/eslint-plugin +``` + +It is important that you use the same version number for `@typescript-eslint/parser` and `@typescript-eslint/eslint-plugin`. + +**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `@typescript-eslint/eslint-plugin` globally. + +### Usage + +Add `@typescript-eslint/parser` to the `parser` field and `@typescript-eslint` to the plugins section of your `.eslintrc` configuration file, then configure the rules you want to use under the rules section. + +```json +{ + "parser": "@typescript-eslint/parser", + "plugins": ["@typescript-eslint"], + "rules": { + "@typescript-eslint/rule-name": "error" + } +} +``` + +You can also enable all the recommended rules for our plugin. Add `plugin:@typescript-eslint/recommended` in extends: + +```json +{ + "extends": ["plugin:@typescript-eslint/recommended"] +} +``` + +**Note: Make sure to use `eslint --ext .js,.ts` since by [default](https://eslint.org/docs/user-guide/command-line-interface#--ext) `eslint` will only search for `.js` files.** + +### Recommended Configs + +You can also use [`eslint:recommended`](https://eslint.org/docs/rules/) (the set of rules which are recommended for all projects by the ESLint Team) with this plugin: + +```json +{ + "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"] +} +``` + +As of version 2 of this plugin, _by design_, none of the rules in the main `recommended` config require type-checking in order to run. This means that they are more lightweight and faster to run. + +Some highly valuable rules simply require type-checking in order to be implemented correctly, however, so we provide an additional config you can extend from called `recommended-requiring-type-checking`. You would apply this _in addition_ to the recommended configs previously mentioned, e.g.: + +```json +{ + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking" + ] +} +``` + +Pro Tip: For larger codebases you may want to consider splitting our linting into two separate stages: 1. fast feedback rules which operate purely based on syntax (no type-checking), 2. rules which are based on semantics (type-checking). + +**[You can read more about linting with type information here](../../docs/getting-started/linting/TYPED_LINTING.md)** + +## Supported Rules + + + +**Key**: :heavy_check_mark: = recommended, :wrench: = fixable, :thought_balloon: = requires type information + +| Name | Description | :heavy_check_mark: | :wrench: | :thought_balloon: | +| --------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ------------------ | -------- | ----------------- | +| [`@typescript-eslint/adjacent-overload-signatures`](./docs/rules/adjacent-overload-signatures.md) | Require that member overloads be consecutive | :heavy_check_mark: | | | +| [`@typescript-eslint/array-type`](./docs/rules/array-type.md) | Requires using either `T[]` or `Array` for arrays | | :wrench: | | +| [`@typescript-eslint/await-thenable`](./docs/rules/await-thenable.md) | Disallows awaiting a value that is not a Thenable | :heavy_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/ban-ts-comment`](./docs/rules/ban-ts-comment.md) | Bans `// @ts-` comments from being used or requires descriptions after directive | :heavy_check_mark: | | | +| [`@typescript-eslint/ban-tslint-comment`](./docs/rules/ban-tslint-comment.md) | Bans `// tslint:` comments from being used | | :wrench: | | +| [`@typescript-eslint/ban-types`](./docs/rules/ban-types.md) | Bans specific types from being used | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/class-literal-property-style`](./docs/rules/class-literal-property-style.md) | Ensures that literals on classes are exposed in a consistent style | | :wrench: | | +| [`@typescript-eslint/consistent-type-assertions`](./docs/rules/consistent-type-assertions.md) | Enforces consistent usage of type assertions | | | | +| [`@typescript-eslint/consistent-type-definitions`](./docs/rules/consistent-type-definitions.md) | Consistent with type definition either `interface` or `type` | | :wrench: | | +| [`@typescript-eslint/consistent-type-imports`](./docs/rules/consistent-type-imports.md) | Enforces consistent usage of type imports | | :wrench: | | +| [`@typescript-eslint/explicit-function-return-type`](./docs/rules/explicit-function-return-type.md) | Require explicit return types on functions and class methods | | | | +| [`@typescript-eslint/explicit-member-accessibility`](./docs/rules/explicit-member-accessibility.md) | Require explicit accessibility modifiers on class properties and methods | | :wrench: | | +| [`@typescript-eslint/explicit-module-boundary-types`](./docs/rules/explicit-module-boundary-types.md) | Require explicit return and argument types on exported functions' and classes' public class methods | :heavy_check_mark: | | | +| [`@typescript-eslint/member-delimiter-style`](./docs/rules/member-delimiter-style.md) | Require a specific member delimiter style for interfaces and type literals | | :wrench: | | +| [`@typescript-eslint/member-ordering`](./docs/rules/member-ordering.md) | Require a consistent member declaration order | | | | +| [`@typescript-eslint/method-signature-style`](./docs/rules/method-signature-style.md) | Enforces using a particular method signature syntax. | | :wrench: | | +| [`@typescript-eslint/naming-convention`](./docs/rules/naming-convention.md) | Enforces naming conventions for everything across a codebase | | | :thought_balloon: | +| [`@typescript-eslint/no-base-to-string`](./docs/rules/no-base-to-string.md) | Requires that `.toString()` is only called on objects which provide useful information when stringified | | | :thought_balloon: | +| [`@typescript-eslint/no-confusing-non-null-assertion`](./docs/rules/no-confusing-non-null-assertion.md) | Disallow non-null assertion in locations that may be confusing | | :wrench: | | +| [`@typescript-eslint/no-dynamic-delete`](./docs/rules/no-dynamic-delete.md) | Disallow the delete operator with computed key expressions | | :wrench: | | +| [`@typescript-eslint/no-empty-interface`](./docs/rules/no-empty-interface.md) | Disallow the declaration of empty interfaces | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/no-explicit-any`](./docs/rules/no-explicit-any.md) | Disallow usage of the `any` type | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/no-extra-non-null-assertion`](./docs/rules/no-extra-non-null-assertion.md) | Disallow extra non-null assertion | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/no-extraneous-class`](./docs/rules/no-extraneous-class.md) | Forbids the use of classes as namespaces | | | | +| [`@typescript-eslint/no-floating-promises`](./docs/rules/no-floating-promises.md) | Requires Promise-like values to be handled appropriately | :heavy_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-for-in-array`](./docs/rules/no-for-in-array.md) | Disallow iterating over an array with a for-in loop | :heavy_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-implicit-any-catch`](./docs/rules/no-implicit-any-catch.md) | Disallow usage of the implicit `any` type in catch clauses | | :wrench: | | +| [`@typescript-eslint/no-implied-eval`](./docs/rules/no-implied-eval.md) | Disallow the use of `eval()`-like methods | :heavy_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-inferrable-types`](./docs/rules/no-inferrable-types.md) | Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/no-invalid-void-type`](./docs/rules/no-invalid-void-type.md) | Disallows usage of `void` type outside of generic or return types | | | | +| [`@typescript-eslint/no-misused-new`](./docs/rules/no-misused-new.md) | Enforce valid definition of `new` and `constructor` | :heavy_check_mark: | | | +| [`@typescript-eslint/no-misused-promises`](./docs/rules/no-misused-promises.md) | Avoid using promises in places not designed to handle them | :heavy_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-namespace`](./docs/rules/no-namespace.md) | Disallow the use of custom TypeScript modules and namespaces | :heavy_check_mark: | | | +| [`@typescript-eslint/no-non-null-asserted-optional-chain`](./docs/rules/no-non-null-asserted-optional-chain.md) | Disallows using a non-null assertion after an optional chain expression | :heavy_check_mark: | | | +| [`@typescript-eslint/no-non-null-assertion`](./docs/rules/no-non-null-assertion.md) | Disallows non-null assertions using the `!` postfix operator | :heavy_check_mark: | | | +| [`@typescript-eslint/no-parameter-properties`](./docs/rules/no-parameter-properties.md) | Disallow the use of parameter properties in class constructors | | | | +| [`@typescript-eslint/no-require-imports`](./docs/rules/no-require-imports.md) | Disallows invocation of `require()` | | | | +| [`@typescript-eslint/no-this-alias`](./docs/rules/no-this-alias.md) | Disallow aliasing `this` | :heavy_check_mark: | | | +| [`@typescript-eslint/no-throw-literal`](./docs/rules/no-throw-literal.md) | Disallow throwing literals as exceptions | | | :thought_balloon: | +| [`@typescript-eslint/no-type-alias`](./docs/rules/no-type-alias.md) | Disallow the use of type aliases | | | | +| [`@typescript-eslint/no-unnecessary-boolean-literal-compare`](./docs/rules/no-unnecessary-boolean-literal-compare.md) | Flags unnecessary equality comparisons against boolean literals | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-condition`](./docs/rules/no-unnecessary-condition.md) | Prevents conditionals where the type is always truthy or always falsy | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-qualifier`](./docs/rules/no-unnecessary-qualifier.md) | Warns when a namespace qualifier is unnecessary | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-type-arguments`](./docs/rules/no-unnecessary-type-arguments.md) | Enforces that type arguments will not be used if not required | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-type-assertion`](./docs/rules/no-unnecessary-type-assertion.md) | Warns if a type assertion does not change the type of an expression | :heavy_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unsafe-assignment`](./docs/rules/no-unsafe-assignment.md) | Disallows assigning any to variables and properties | :heavy_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unsafe-call`](./docs/rules/no-unsafe-call.md) | Disallows calling an any type value | :heavy_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unsafe-member-access`](./docs/rules/no-unsafe-member-access.md) | Disallows member access on any typed variables | :heavy_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-unsafe-return`](./docs/rules/no-unsafe-return.md) | Disallows returning any from a function | :heavy_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/no-var-requires`](./docs/rules/no-var-requires.md) | Disallows the use of require statements except in import statements | :heavy_check_mark: | | | +| [`@typescript-eslint/prefer-as-const`](./docs/rules/prefer-as-const.md) | Prefer usage of `as const` over literal type | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/prefer-enum-initializers`](./docs/rules/prefer-enum-initializers.md) | Prefer initializing each enums member value | | | | +| [`@typescript-eslint/prefer-for-of`](./docs/rules/prefer-for-of.md) | Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated | | | | +| [`@typescript-eslint/prefer-function-type`](./docs/rules/prefer-function-type.md) | Use function types instead of interfaces with call signatures | | :wrench: | | +| [`@typescript-eslint/prefer-includes`](./docs/rules/prefer-includes.md) | Enforce `includes` method over `indexOf` method | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-literal-enum-member`](./docs/rules/prefer-literal-enum-member.md) | Require that all enum members be literal values to prevent unintended enum member name shadow issues | | | | +| [`@typescript-eslint/prefer-namespace-keyword`](./docs/rules/prefer-namespace-keyword.md) | Require the use of the `namespace` keyword instead of the `module` keyword to declare custom TypeScript modules | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/prefer-nullish-coalescing`](./docs/rules/prefer-nullish-coalescing.md) | Enforce the usage of the nullish coalescing operator instead of logical chaining | | | :thought_balloon: | +| [`@typescript-eslint/prefer-optional-chain`](./docs/rules/prefer-optional-chain.md) | Prefer using concise optional chain expressions instead of chained logical ands | | | | +| [`@typescript-eslint/prefer-readonly`](./docs/rules/prefer-readonly.md) | Requires that private members are marked as `readonly` if they're never modified outside of the constructor | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-readonly-parameter-types`](./docs/rules/prefer-readonly-parameter-types.md) | Requires that function parameters are typed as readonly to prevent accidental mutation of inputs | | | :thought_balloon: | +| [`@typescript-eslint/prefer-reduce-type-parameter`](./docs/rules/prefer-reduce-type-parameter.md) | Prefer using type parameter when calling `Array#reduce` instead of casting | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-regexp-exec`](./docs/rules/prefer-regexp-exec.md) | Enforce that `RegExp#exec` is used instead of `String#match` if no global flag is provided | :heavy_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/prefer-string-starts-ends-with`](./docs/rules/prefer-string-starts-ends-with.md) | Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-ts-expect-error`](./docs/rules/prefer-ts-expect-error.md) | Recommends using `// @ts-expect-error` over `// @ts-ignore` | | :wrench: | | +| [`@typescript-eslint/promise-function-async`](./docs/rules/promise-function-async.md) | Requires any function or method that returns a Promise to be marked async | | | :thought_balloon: | +| [`@typescript-eslint/require-array-sort-compare`](./docs/rules/require-array-sort-compare.md) | Requires `Array#sort` calls to always provide a `compareFunction` | | | :thought_balloon: | +| [`@typescript-eslint/restrict-plus-operands`](./docs/rules/restrict-plus-operands.md) | When adding two variables, operands must both be of type number or of type string | :heavy_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/restrict-template-expressions`](./docs/rules/restrict-template-expressions.md) | Enforce template literal expressions to be of string type | :heavy_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/strict-boolean-expressions`](./docs/rules/strict-boolean-expressions.md) | Restricts the types allowed in boolean expressions | | | :thought_balloon: | +| [`@typescript-eslint/switch-exhaustiveness-check`](./docs/rules/switch-exhaustiveness-check.md) | Exhaustiveness checking in switch with union type | | | :thought_balloon: | +| [`@typescript-eslint/triple-slash-reference`](./docs/rules/triple-slash-reference.md) | Sets preference level for triple slash directives versus ES6-style import declarations | :heavy_check_mark: | | | +| [`@typescript-eslint/type-annotation-spacing`](./docs/rules/type-annotation-spacing.md) | Require consistent spacing around type annotations | | :wrench: | | +| [`@typescript-eslint/typedef`](./docs/rules/typedef.md) | Requires type annotations to exist | | | | +| [`@typescript-eslint/unbound-method`](./docs/rules/unbound-method.md) | Enforces unbound methods are called with their expected scope | :heavy_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/unified-signatures`](./docs/rules/unified-signatures.md) | Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter | | | | + + + +### Extension Rules + +In some cases, ESLint provides a rule itself, but it doesn't support TypeScript syntax; either it crashes, or it ignores the syntax, or it falsely reports against it. +In these cases, we create what we call an extension rule; a rule within our plugin that has the same functionality, but also supports TypeScript. + + + +**Key**: :heavy_check_mark: = recommended, :wrench: = fixable, :thought_balloon: = requires type information + +| Name | Description | :heavy_check_mark: | :wrench: | :thought_balloon: | +| ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------ | -------- | ----------------- | +| [`@typescript-eslint/brace-style`](./docs/rules/brace-style.md) | Enforce consistent brace style for blocks | | :wrench: | | +| [`@typescript-eslint/comma-spacing`](./docs/rules/comma-spacing.md) | Enforces consistent spacing before and after commas | | :wrench: | | +| [`@typescript-eslint/default-param-last`](./docs/rules/default-param-last.md) | Enforce default parameters to be last | | | | +| [`@typescript-eslint/dot-notation`](./docs/rules/dot-notation.md) | enforce dot notation whenever possible | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/func-call-spacing`](./docs/rules/func-call-spacing.md) | Require or disallow spacing between function identifiers and their invocations | | :wrench: | | +| [`@typescript-eslint/indent`](./docs/rules/indent.md) | Enforce consistent indentation | | :wrench: | | +| [`@typescript-eslint/init-declarations`](./docs/rules/init-declarations.md) | require or disallow initialization in variable declarations | | | | +| [`@typescript-eslint/keyword-spacing`](./docs/rules/keyword-spacing.md) | Enforce consistent spacing before and after keywords | | :wrench: | | +| [`@typescript-eslint/lines-between-class-members`](./docs/rules/lines-between-class-members.md) | Require or disallow an empty line between class members | | :wrench: | | +| [`@typescript-eslint/no-array-constructor`](./docs/rules/no-array-constructor.md) | Disallow generic `Array` constructors | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/no-dupe-class-members`](./docs/rules/no-dupe-class-members.md) | Disallow duplicate class members | | | | +| [`@typescript-eslint/no-empty-function`](./docs/rules/no-empty-function.md) | Disallow empty functions | :heavy_check_mark: | | | +| [`@typescript-eslint/no-extra-parens`](./docs/rules/no-extra-parens.md) | Disallow unnecessary parentheses | | :wrench: | | +| [`@typescript-eslint/no-extra-semi`](./docs/rules/no-extra-semi.md) | Disallow unnecessary semicolons | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/no-invalid-this`](./docs/rules/no-invalid-this.md) | disallow `this` keywords outside of classes or class-like objects | | | | +| [`@typescript-eslint/no-loop-func`](./docs/rules/no-loop-func.md) | Disallow function declarations that contain unsafe references inside loop statements | | | | +| [`@typescript-eslint/no-loss-of-precision`](./docs/rules/no-loss-of-precision.md) | Disallow literal numbers that lose precision | | | | +| [`@typescript-eslint/no-magic-numbers`](./docs/rules/no-magic-numbers.md) | Disallow magic numbers | | | | +| [`@typescript-eslint/no-redeclare`](./docs/rules/no-redeclare.md) | Disallow variable redeclaration | | | | +| [`@typescript-eslint/no-shadow`](./docs/rules/no-shadow.md) | Disallow variable declarations from shadowing variables declared in the outer scope | | | | +| [`@typescript-eslint/no-unused-expressions`](./docs/rules/no-unused-expressions.md) | Disallow unused expressions | | | | +| [`@typescript-eslint/no-unused-vars`](./docs/rules/no-unused-vars.md) | Disallow unused variables | :heavy_check_mark: | | | +| [`@typescript-eslint/no-use-before-define`](./docs/rules/no-use-before-define.md) | Disallow the use of variables before they are defined | | | | +| [`@typescript-eslint/no-useless-constructor`](./docs/rules/no-useless-constructor.md) | Disallow unnecessary constructors | | | | +| [`@typescript-eslint/quotes`](./docs/rules/quotes.md) | Enforce the consistent use of either backticks, double, or single quotes | | :wrench: | | +| [`@typescript-eslint/require-await`](./docs/rules/require-await.md) | Disallow async functions which have no `await` expression | :heavy_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/return-await`](./docs/rules/return-await.md) | Enforces consistent returning of awaited values | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/semi`](./docs/rules/semi.md) | Require or disallow semicolons instead of ASI | | :wrench: | | +| [`@typescript-eslint/space-before-function-paren`](./docs/rules/space-before-function-paren.md) | Enforces consistent spacing before function parenthesis | | :wrench: | | + + + +## Contributing + +[See the contributing guide here](../../CONTRIBUTING.md). diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.js b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.js new file mode 100644 index 000000000..037b3ca81 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.js @@ -0,0 +1,144 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:configs +module.exports = { + extends: ['./configs/base', './configs/eslint-recommended'], + rules: { + '@typescript-eslint/adjacent-overload-signatures': 'error', + '@typescript-eslint/array-type': 'error', + '@typescript-eslint/await-thenable': 'error', + '@typescript-eslint/ban-ts-comment': 'error', + '@typescript-eslint/ban-tslint-comment': 'error', + '@typescript-eslint/ban-types': 'error', + 'brace-style': 'off', + '@typescript-eslint/brace-style': 'error', + '@typescript-eslint/class-literal-property-style': 'error', + 'comma-spacing': 'off', + '@typescript-eslint/comma-spacing': 'error', + '@typescript-eslint/consistent-type-assertions': 'error', + '@typescript-eslint/consistent-type-definitions': 'error', + '@typescript-eslint/consistent-type-imports': 'error', + 'default-param-last': 'off', + '@typescript-eslint/default-param-last': 'error', + 'dot-notation': 'off', + '@typescript-eslint/dot-notation': 'error', + '@typescript-eslint/explicit-function-return-type': 'error', + '@typescript-eslint/explicit-member-accessibility': 'error', + '@typescript-eslint/explicit-module-boundary-types': 'error', + 'func-call-spacing': 'off', + '@typescript-eslint/func-call-spacing': 'error', + indent: 'off', + '@typescript-eslint/indent': 'error', + 'init-declarations': 'off', + '@typescript-eslint/init-declarations': 'error', + 'keyword-spacing': 'off', + '@typescript-eslint/keyword-spacing': 'error', + 'lines-between-class-members': 'off', + '@typescript-eslint/lines-between-class-members': 'error', + '@typescript-eslint/member-delimiter-style': 'error', + '@typescript-eslint/member-ordering': 'error', + '@typescript-eslint/method-signature-style': 'error', + '@typescript-eslint/naming-convention': 'error', + 'no-array-constructor': 'off', + '@typescript-eslint/no-array-constructor': 'error', + '@typescript-eslint/no-base-to-string': 'error', + '@typescript-eslint/no-confusing-non-null-assertion': 'error', + 'no-dupe-class-members': 'off', + '@typescript-eslint/no-dupe-class-members': 'error', + '@typescript-eslint/no-dynamic-delete': 'error', + 'no-empty-function': 'off', + '@typescript-eslint/no-empty-function': 'error', + '@typescript-eslint/no-empty-interface': 'error', + '@typescript-eslint/no-explicit-any': 'error', + '@typescript-eslint/no-extra-non-null-assertion': 'error', + 'no-extra-parens': 'off', + '@typescript-eslint/no-extra-parens': 'error', + 'no-extra-semi': 'off', + '@typescript-eslint/no-extra-semi': 'error', + '@typescript-eslint/no-extraneous-class': 'error', + '@typescript-eslint/no-floating-promises': 'error', + '@typescript-eslint/no-for-in-array': 'error', + '@typescript-eslint/no-implicit-any-catch': 'error', + '@typescript-eslint/no-implied-eval': 'error', + '@typescript-eslint/no-inferrable-types': 'error', + 'no-invalid-this': 'off', + '@typescript-eslint/no-invalid-this': 'error', + '@typescript-eslint/no-invalid-void-type': 'error', + 'no-loop-func': 'off', + '@typescript-eslint/no-loop-func': 'error', + 'no-loss-of-precision': 'off', + '@typescript-eslint/no-loss-of-precision': 'error', + 'no-magic-numbers': 'off', + '@typescript-eslint/no-magic-numbers': 'error', + '@typescript-eslint/no-misused-new': 'error', + '@typescript-eslint/no-misused-promises': 'error', + '@typescript-eslint/no-namespace': 'error', + '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', + '@typescript-eslint/no-non-null-assertion': 'error', + '@typescript-eslint/no-parameter-properties': 'error', + 'no-redeclare': 'off', + '@typescript-eslint/no-redeclare': 'error', + '@typescript-eslint/no-require-imports': 'error', + 'no-shadow': 'off', + '@typescript-eslint/no-shadow': 'error', + '@typescript-eslint/no-this-alias': 'error', + '@typescript-eslint/no-throw-literal': 'error', + '@typescript-eslint/no-type-alias': 'error', + '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', + '@typescript-eslint/no-unnecessary-condition': 'error', + '@typescript-eslint/no-unnecessary-qualifier': 'error', + '@typescript-eslint/no-unnecessary-type-arguments': 'error', + '@typescript-eslint/no-unnecessary-type-assertion': 'error', + '@typescript-eslint/no-unsafe-assignment': 'error', + '@typescript-eslint/no-unsafe-call': 'error', + '@typescript-eslint/no-unsafe-member-access': 'error', + '@typescript-eslint/no-unsafe-return': 'error', + 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'error', + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': 'error', + 'no-use-before-define': 'off', + '@typescript-eslint/no-use-before-define': 'error', + 'no-useless-constructor': 'off', + '@typescript-eslint/no-useless-constructor': 'error', + '@typescript-eslint/no-var-requires': 'error', + '@typescript-eslint/prefer-as-const': 'error', + '@typescript-eslint/prefer-enum-initializers': 'error', + '@typescript-eslint/prefer-for-of': 'error', + '@typescript-eslint/prefer-function-type': 'error', + '@typescript-eslint/prefer-includes': 'error', + '@typescript-eslint/prefer-literal-enum-member': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', + '@typescript-eslint/prefer-nullish-coalescing': 'error', + '@typescript-eslint/prefer-optional-chain': 'error', + '@typescript-eslint/prefer-readonly': 'error', + '@typescript-eslint/prefer-readonly-parameter-types': 'error', + '@typescript-eslint/prefer-reduce-type-parameter': 'error', + '@typescript-eslint/prefer-regexp-exec': 'error', + '@typescript-eslint/prefer-string-starts-ends-with': 'error', + '@typescript-eslint/prefer-ts-expect-error': 'error', + '@typescript-eslint/promise-function-async': 'error', + quotes: 'off', + '@typescript-eslint/quotes': 'error', + '@typescript-eslint/require-array-sort-compare': 'error', + 'require-await': 'off', + '@typescript-eslint/require-await': 'error', + '@typescript-eslint/restrict-plus-operands': 'error', + '@typescript-eslint/restrict-template-expressions': 'error', + 'no-return-await': 'off', + '@typescript-eslint/return-await': 'error', + semi: 'off', + '@typescript-eslint/semi': 'error', + 'space-before-function-paren': 'off', + '@typescript-eslint/space-before-function-paren': 'error', + '@typescript-eslint/strict-boolean-expressions': 'error', + '@typescript-eslint/switch-exhaustiveness-check': 'error', + '@typescript-eslint/triple-slash-reference': 'error', + '@typescript-eslint/type-annotation-spacing': 'error', + '@typescript-eslint/typedef': 'error', + '@typescript-eslint/unbound-method': 'error', + '@typescript-eslint/unified-signatures': 'error', + }, +}; +//# sourceMappingURL=all.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.js.map new file mode 100644 index 000000000..e3533ccde --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.js.map @@ -0,0 +1 @@ +{"version":3,"file":"all.js","sourceRoot":"","sources":["../../src/configs/all.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,oDAAoD;AAEpD,iBAAS;IACP,OAAO,EAAE,CAAC,gBAAgB,EAAE,8BAA8B,CAAC;IAC3D,KAAK,EAAE;QACL,iDAAiD,EAAE,OAAO;QAC1D,+BAA+B,EAAE,OAAO;QACxC,mCAAmC,EAAE,OAAO;QAC5C,mCAAmC,EAAE,OAAO;QAC5C,uCAAuC,EAAE,OAAO;QAChD,8BAA8B,EAAE,OAAO;QACvC,aAAa,EAAE,KAAK;QACpB,gCAAgC,EAAE,OAAO;QACzC,iDAAiD,EAAE,OAAO;QAC1D,eAAe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3C,yCAAyC,EAAE,OAAO;QAClD,oCAAoC,EAAE,OAAO;QAC7C,+CAA+C,EAAE,OAAO;QACxD,6CAA6C,EAAE,OAAO;QACtD,8CAA8C,EAAE,OAAO;QACvD,0CAA0C,EAAE,OAAO;QACnD,oCAAoC,EAAE,OAAO;QAC7C,oDAAoD,EAAE,OAAO;QAC7D,iDAAiD,EAAE,OAAO;QAC1D,uCAAuC,EAAE,OAAO;QAChD,mDAAmD,EAAE,OAAO;QAC5D,2CAA2C,EAAE,OAAO;QACpD,2CAA2C,EAAE,OAAO;QACpD,MAAM,EAAE,KAAK;QACb,2BAA2B,EAAE,OAAO;QACpC,+CAA+C,EAAE,OAAO;QACxD,eAAe,EAAE,KAAK;QACtB,kCAAkC,EAAE,OAAO;QAC3C,2CAA2C,EAAE,OAAO;QACpD,kDAAkD,EAAE,OAAO;QAC3D,iBAAiB,EAAE,KAAK;QACxB,iCAAiC,EAAE,OAAO;QAC1C,IAAI,EAAE,KAAK;QACX,yBAAyB,EAAE,OAAO;QAClC,6BAA6B,EAAE,KAAK;QACpC,gDAAgD,EAAE,OAAO;QACzD,+CAA+C,EAAE,OAAO;QACxD,gDAAgD,EAAE,OAAO;QACzD,2CAA2C,EAAE,OAAO;QACpD,4CAA4C,EAAE,OAAO;QACrD,4BAA4B,EAAE,OAAO;QACrC,mCAAmC,EAAE,OAAO;QAC5C,uCAAuC,EAAE,OAAO;KACjD;CACF,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.js b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.js new file mode 100644 index 000000000..52d1fe8b0 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.js @@ -0,0 +1,10 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:configs +module.exports = { + parser: '@typescript-eslint/parser', + parserOptions: { sourceType: 'module' }, + plugins: ['@typescript-eslint'], +}; +//# sourceMappingURL=base.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.js.map new file mode 100644 index 000000000..a2f415fc4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.js.map @@ -0,0 +1 @@ +{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/configs/base.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,oDAAoD;AAEpD,iBAAS;IACP,MAAM,EAAE,2BAA2B;IACnC,aAAa,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE;IACvC,OAAO,EAAE,CAAC,oBAAoB,CAAC;CAChC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended.js b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended.js new file mode 100644 index 000000000..f1b5191e8 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended.js @@ -0,0 +1,32 @@ +"use strict"; +module.exports = { + overrides: [ + { + files: ['*.ts', '*.tsx'], + rules: { + 'constructor-super': 'off', + 'getter-return': 'off', + 'no-const-assign': 'off', + 'no-dupe-args': 'off', + 'no-dupe-class-members': 'off', + 'no-dupe-keys': 'off', + 'no-func-assign': 'off', + 'no-import-assign': 'off', + 'no-new-symbol': 'off', + 'no-obj-calls': 'off', + 'no-redeclare': 'off', + 'no-setter-return': 'off', + 'no-this-before-super': 'off', + 'no-undef': 'off', + 'no-unreachable': 'off', + 'no-unsafe-negation': 'off', + 'no-var': 'error', + 'prefer-const': 'error', + 'prefer-rest-params': 'error', + 'prefer-spread': 'error', + 'valid-typeof': 'off', + }, + }, + ], +}; +//# sourceMappingURL=eslint-recommended.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended.js.map new file mode 100644 index 000000000..8181881ac --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended.js.map @@ -0,0 +1 @@ +{"version":3,"file":"eslint-recommended.js","sourceRoot":"","sources":["../../src/configs/eslint-recommended.ts"],"names":[],"mappings":";AAKA,iBAAS;IACP,SAAS,EAAE;QACT;YACE,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;YACxB,KAAK,EAAE;gBACL,mBAAmB,EAAE,KAAK;gBAC1B,eAAe,EAAE,KAAK;gBACtB,iBAAiB,EAAE,KAAK;gBACxB,cAAc,EAAE,KAAK;gBACrB,uBAAuB,EAAE,KAAK;gBAC9B,cAAc,EAAE,KAAK;gBACrB,gBAAgB,EAAE,KAAK;gBACvB,kBAAkB,EAAE,KAAK;gBACzB,eAAe,EAAE,KAAK;gBACtB,cAAc,EAAE,KAAK;gBACrB,cAAc,EAAE,KAAK;gBACrB,kBAAkB,EAAE,KAAK;gBACzB,sBAAsB,EAAE,KAAK;gBAC7B,UAAU,EAAE,KAAK;gBACjB,gBAAgB,EAAE,KAAK;gBACvB,oBAAoB,EAAE,KAAK;gBAC3B,QAAQ,EAAE,OAAO;gBACjB,cAAc,EAAE,OAAO;gBACvB,oBAAoB,EAAE,OAAO;gBAC7B,eAAe,EAAE,OAAO;gBACxB,cAAc,EAAE,KAAK;aACtB;SACF;KACF;CACF,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended-requiring-type-checking.js b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended-requiring-type-checking.js new file mode 100644 index 000000000..cb31319f0 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended-requiring-type-checking.js @@ -0,0 +1,26 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:configs +module.exports = { + extends: ['./configs/base', './configs/eslint-recommended'], + rules: { + '@typescript-eslint/await-thenable': 'error', + '@typescript-eslint/no-floating-promises': 'error', + '@typescript-eslint/no-for-in-array': 'error', + '@typescript-eslint/no-implied-eval': 'error', + '@typescript-eslint/no-misused-promises': 'error', + '@typescript-eslint/no-unnecessary-type-assertion': 'error', + '@typescript-eslint/no-unsafe-assignment': 'error', + '@typescript-eslint/no-unsafe-call': 'error', + '@typescript-eslint/no-unsafe-member-access': 'error', + '@typescript-eslint/no-unsafe-return': 'error', + '@typescript-eslint/prefer-regexp-exec': 'error', + 'require-await': 'off', + '@typescript-eslint/require-await': 'error', + '@typescript-eslint/restrict-plus-operands': 'error', + '@typescript-eslint/restrict-template-expressions': 'error', + '@typescript-eslint/unbound-method': 'error', + }, +}; +//# sourceMappingURL=recommended-requiring-type-checking.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended-requiring-type-checking.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended-requiring-type-checking.js.map new file mode 100644 index 000000000..ef219919f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended-requiring-type-checking.js.map @@ -0,0 +1 @@ +{"version":3,"file":"recommended-requiring-type-checking.js","sourceRoot":"","sources":["../../src/configs/recommended-requiring-type-checking.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,oDAAoD;AAEpD,iBAAS;IACP,OAAO,EAAE,CAAC,gBAAgB,EAAE,8BAA8B,CAAC;IAC3D,KAAK,EAAE;QACL,mCAAmC,EAAE,OAAO;QAC5C,yCAAyC,EAAE,OAAO;QAClD,oCAAoC,EAAE,OAAO;QAC7C,oCAAoC,EAAE,OAAO;QAC7C,wCAAwC,EAAE,OAAO;QACjD,kDAAkD,EAAE,OAAO;QAC3D,yCAAyC,EAAE,OAAO;QAClD,mCAAmC,EAAE,OAAO;QAC5C,4CAA4C,EAAE,OAAO;QACrD,qCAAqC,EAAE,OAAO;QAC9C,uCAAuC,EAAE,OAAO;QAChD,eAAe,EAAE,KAAK;QACtB,kCAAkC,EAAE,OAAO;QAC3C,2CAA2C,EAAE,OAAO;QACpD,kDAAkD,EAAE,OAAO;QAC3D,mCAAmC,EAAE,OAAO;KAC7C;CACF,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended.js b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended.js new file mode 100644 index 000000000..e8e5a6f7b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended.js @@ -0,0 +1,35 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:configs +module.exports = { + extends: ['./configs/base', './configs/eslint-recommended'], + rules: { + '@typescript-eslint/adjacent-overload-signatures': 'error', + '@typescript-eslint/ban-ts-comment': 'error', + '@typescript-eslint/ban-types': 'error', + '@typescript-eslint/explicit-module-boundary-types': 'warn', + 'no-array-constructor': 'off', + '@typescript-eslint/no-array-constructor': 'error', + 'no-empty-function': 'off', + '@typescript-eslint/no-empty-function': 'error', + '@typescript-eslint/no-empty-interface': 'error', + '@typescript-eslint/no-explicit-any': 'warn', + '@typescript-eslint/no-extra-non-null-assertion': 'error', + 'no-extra-semi': 'off', + '@typescript-eslint/no-extra-semi': 'error', + '@typescript-eslint/no-inferrable-types': 'error', + '@typescript-eslint/no-misused-new': 'error', + '@typescript-eslint/no-namespace': 'error', + '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', + '@typescript-eslint/no-non-null-assertion': 'warn', + '@typescript-eslint/no-this-alias': 'error', + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': 'warn', + '@typescript-eslint/no-var-requires': 'error', + '@typescript-eslint/prefer-as-const': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', + '@typescript-eslint/triple-slash-reference': 'error', + }, +}; +//# sourceMappingURL=recommended.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended.js.map new file mode 100644 index 000000000..406ea3ff6 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/configs/recommended.js.map @@ -0,0 +1 @@ +{"version":3,"file":"recommended.js","sourceRoot":"","sources":["../../src/configs/recommended.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,oDAAoD;AAEpD,iBAAS;IACP,OAAO,EAAE,CAAC,gBAAgB,EAAE,8BAA8B,CAAC;IAC3D,KAAK,EAAE;QACL,iDAAiD,EAAE,OAAO;QAC1D,mCAAmC,EAAE,OAAO;QAC5C,8BAA8B,EAAE,OAAO;QACvC,mDAAmD,EAAE,MAAM;QAC3D,sBAAsB,EAAE,KAAK;QAC7B,yCAAyC,EAAE,OAAO;QAClD,mBAAmB,EAAE,KAAK;QAC1B,sCAAsC,EAAE,OAAO;QAC/C,uCAAuC,EAAE,OAAO;QAChD,oCAAoC,EAAE,MAAM;QAC5C,gDAAgD,EAAE,OAAO;QACzD,eAAe,EAAE,KAAK;QACtB,kCAAkC,EAAE,OAAO;QAC3C,wCAAwC,EAAE,OAAO;QACjD,mCAAmC,EAAE,OAAO;QAC5C,iCAAiC,EAAE,OAAO;QAC1C,wDAAwD,EAAE,OAAO;QACjE,0CAA0C,EAAE,MAAM;QAClD,kCAAkC,EAAE,OAAO;QAC3C,gBAAgB,EAAE,KAAK;QACvB,mCAAmC,EAAE,MAAM;QAC3C,oCAAoC,EAAE,OAAO;QAC7C,oCAAoC,EAAE,OAAO;QAC7C,6CAA6C,EAAE,OAAO;QACtD,2CAA2C,EAAE,OAAO;KACrD;CACF,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/index.js b/node_modules/@typescript-eslint/eslint-plugin/dist/index.js new file mode 100644 index 000000000..37426f23f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/index.js @@ -0,0 +1,21 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const rules_1 = __importDefault(require("./rules")); +const all_1 = __importDefault(require("./configs/all")); +const base_1 = __importDefault(require("./configs/base")); +const recommended_1 = __importDefault(require("./configs/recommended")); +const recommended_requiring_type_checking_1 = __importDefault(require("./configs/recommended-requiring-type-checking")); +const eslint_recommended_1 = __importDefault(require("./configs/eslint-recommended")); +module.exports = { + rules: rules_1.default, + configs: { + all: all_1.default, + base: base_1.default, + recommended: recommended_1.default, + 'eslint-recommended': eslint_recommended_1.default, + 'recommended-requiring-type-checking': recommended_requiring_type_checking_1.default, + }, +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/index.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/index.js.map new file mode 100644 index 000000000..24698092b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,oDAA4B;AAE5B,wDAAgC;AAChC,0DAAkC;AAClC,wEAAgD;AAChD,wHAA6F;AAC7F,sFAA6D;AAE7D,iBAAS;IACP,KAAK,EAAL,eAAK;IACL,OAAO,EAAE;QACP,GAAG,EAAH,aAAG;QACH,IAAI,EAAJ,cAAI;QACJ,WAAW,EAAX,qBAAW;QACX,oBAAoB,EAAE,4BAAiB;QACvC,qCAAqC,EAAE,6CAAgC;KACxE;CACF,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures.js new file mode 100644 index 000000000..6b6871465 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures.js @@ -0,0 +1,159 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'adjacent-overload-signatures', + meta: { + type: 'suggestion', + docs: { + description: 'Require that member overloads be consecutive', + category: 'Best Practices', + recommended: 'error', + }, + schema: [], + messages: { + adjacentSignature: "All '{{name}}' signatures should be adjacent.", + }, + }, + defaultOptions: [], + create(context) { + const sourceCode = context.getSourceCode(); + /** + * Gets the name and attribute of the member being processed. + * @param member the member being processed. + * @returns the name and attribute of the member or null if it's a member not relevant to the rule. + */ + function getMemberMethod(member) { + var _a, _b; + if (!member) { + return null; + } + const isStatic = 'static' in member && !!member.static; + switch (member.type) { + case experimental_utils_1.AST_NODE_TYPES.ExportDefaultDeclaration: + case experimental_utils_1.AST_NODE_TYPES.ExportNamedDeclaration: { + // export statements (e.g. export { a };) + // have no declarations, so ignore them + if (!member.declaration) { + return null; + } + return getMemberMethod(member.declaration); + } + case experimental_utils_1.AST_NODE_TYPES.TSDeclareFunction: + case experimental_utils_1.AST_NODE_TYPES.FunctionDeclaration: { + const name = (_b = (_a = member.id) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : null; + if (name === null) { + return null; + } + return { + name, + static: isStatic, + callSignature: false, + }; + } + case experimental_utils_1.AST_NODE_TYPES.TSMethodSignature: + return { + name: util.getNameFromMember(member, sourceCode), + static: isStatic, + callSignature: false, + }; + case experimental_utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration: + return { + name: 'call', + static: isStatic, + callSignature: true, + }; + case experimental_utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration: + return { + name: 'new', + static: isStatic, + callSignature: false, + }; + case experimental_utils_1.AST_NODE_TYPES.MethodDefinition: + return { + name: util.getNameFromMember(member, sourceCode), + static: isStatic, + callSignature: false, + }; + } + return null; + } + function isSameMethod(method1, method2) { + return (!!method2 && + method1.name === method2.name && + method1.static === method2.static && + method1.callSignature === method2.callSignature); + } + function getMembers(node) { + switch (node.type) { + case experimental_utils_1.AST_NODE_TYPES.ClassBody: + case experimental_utils_1.AST_NODE_TYPES.Program: + case experimental_utils_1.AST_NODE_TYPES.TSModuleBlock: + case experimental_utils_1.AST_NODE_TYPES.TSInterfaceBody: + return node.body; + case experimental_utils_1.AST_NODE_TYPES.TSTypeLiteral: + return node.members; + } + } + /** + * Check the body for overload methods. + * @param {ASTNode} node the body to be inspected. + */ + function checkBodyForOverloadMethods(node) { + const members = getMembers(node); + if (members) { + let lastMethod = null; + const seenMethods = []; + members.forEach(member => { + const method = getMemberMethod(member); + if (method === null) { + lastMethod = null; + return; + } + const index = seenMethods.findIndex(seenMethod => isSameMethod(method, seenMethod)); + if (index > -1 && !isSameMethod(method, lastMethod)) { + context.report({ + node: member, + messageId: 'adjacentSignature', + data: { + name: (method.static ? 'static ' : '') + method.name, + }, + }); + } + else if (index === -1) { + seenMethods.push(method); + } + lastMethod = method; + }); + } + } + return { + ClassBody: checkBodyForOverloadMethods, + Program: checkBodyForOverloadMethods, + TSModuleBlock: checkBodyForOverloadMethods, + TSTypeLiteral: checkBodyForOverloadMethods, + TSInterfaceBody: checkBodyForOverloadMethods, + }; + }, +}); +//# sourceMappingURL=adjacent-overload-signatures.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures.js.map new file mode 100644 index 000000000..737109074 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures.js.map @@ -0,0 +1 @@ +{"version":3,"file":"adjacent-overload-signatures.js","sourceRoot":"","sources":["../../src/rules/adjacent-overload-signatures.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,8CAAgC;AAahC,kBAAe,IAAI,CAAC,UAAU,CAAC;IAC7B,IAAI,EAAE,8BAA8B;IACpC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,8CAA8C;YAC3D,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,OAAO;SACrB;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,iBAAiB,EAAE,+CAA+C;SACnE;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;QAQ3C;;;;WAIG;QACH,SAAS,eAAe,CAAC,MAAqB;;YAC5C,IAAI,CAAC,MAAM,EAAE;gBACX,OAAO,IAAI,CAAC;aACb;YAED,MAAM,QAAQ,GAAG,QAAQ,IAAI,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;YAEvD,QAAQ,MAAM,CAAC,IAAI,EAAE;gBACnB,KAAK,mCAAc,CAAC,wBAAwB,CAAC;gBAC7C,KAAK,mCAAc,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,yCAAyC;oBACzC,uCAAuC;oBACvC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE;wBACvB,OAAO,IAAI,CAAC;qBACb;oBAED,OAAO,e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C,IAAI;6BACrD;yBACF,CAAC,CAAC;qBACJ;yBAAM,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;wBACvB,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;qBAC1B;oBAED,UAAU,GAAG,MAAM,CAAC;gBACtB,CAAC,CAAC,CAAC;aACJ;QACH,CAAC;QAED,OAAO;YACL,SAAS,EAAE,2BAA2B;YACtC,OAAO,EAAE,2BAA2B;YACpC,aAAa,EAAE,2BAA2B;YAC1C,aAAa,EAAE,2BAA2B;YAC1C,eAAe,EAAE,2BAA2B;SAC7C,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js new file mode 100644 index 000000000..4f4d2d195 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js @@ -0,0 +1,275 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +/** + * Check whatever node can be considered as simple + * @param node the node to be evaluated. + */ +function isSimpleType(node) { + switch (node.type) { + case experimental_utils_1.AST_NODE_TYPES.Identifier: + case experimental_utils_1.AST_NODE_TYPES.TSAnyKeyword: + case experimental_utils_1.AST_NODE_TYPES.TSBooleanKeyword: + case experimental_utils_1.AST_NODE_TYPES.TSNeverKeyword: + case experimental_utils_1.AST_NODE_TYPES.TSNumberKeyword: + case experimental_utils_1.AST_NODE_TYPES.TSObjectKeyword: + case experimental_utils_1.AST_NODE_TYPES.TSStringKeyword: + case experimental_utils_1.AST_NODE_TYPES.TSSymbolKeyword: + case experimental_utils_1.AST_NODE_TYPES.TSUnknownKeyword: + case experimental_utils_1.AST_NODE_TYPES.TSVoidKeyword: + case experimental_utils_1.AST_NODE_TYPES.TSNullKeyword: + case experimental_utils_1.AST_NODE_TYPES.TSArrayType: + case experimental_utils_1.AST_NODE_TYPES.TSUndefinedKeyword: + case experimental_utils_1.AST_NODE_TYPES.TSThisType: + case experimental_utils_1.AST_NODE_TYPES.TSQualifiedName: + return true; + case experimental_utils_1.AST_NODE_TYPES.TSTypeReference: + if (node.typeName && + node.typeName.type === experimental_utils_1.AST_NODE_TYPES.Identifier && + node.typeName.name === 'Array') { + if (!node.typeParameters) { + return true; + } + if (node.typeParameters.params.length === 1) { + return isSimpleType(node.typeParameters.params[0]); + } + } + else { + if (node.typeParameters) { + return false; + } + return isSimpleType(node.typeName); + } + return false; + default: + return false; + } +} +/** + * Check if node needs parentheses + * @param node the node to be evaluated. + */ +function typeNeedsParentheses(node) { + switch (node.type) { + case experimental_utils_1.AST_NODE_TYPES.TSTypeReference: + return typeNeedsParentheses(node.typeName); + case experimental_utils_1.AST_NODE_TYPES.TSUnionType: + case experimental_utils_1.AST_NODE_TYPES.TSFunctionType: + case experimental_utils_1.AST_NODE_TYPES.TSIntersectionType: + case experimental_utils_1.AST_NODE_TYPES.TSTypeOperator: + case experimental_utils_1.AST_NODE_TYPES.TSInferType: + return true; + case experimental_utils_1.AST_NODE_TYPES.Identifier: + return node.name === 'ReadonlyArray'; + default: + return false; + } +} +const arrayOption = { enum: ['array', 'generic', 'array-simple'] }; +exports.default = util.createRule({ + name: 'array-type', + meta: { + type: 'suggestion', + docs: { + description: 'Requires using either `T[]` or `Array` for arrays', + category: 'Stylistic Issues', + // too opinionated to be recommended + recommended: false, + }, + fixable: 'code', + messages: { + errorStringGeneric: "Array type using '{{type}}[]' is forbidden. Use 'Array<{{type}}>' instead.", + errorStringGenericSimple: "Array type using '{{type}}[]' is forbidden for non-simple types. Use 'Array<{{type}}>' instead.", + errorStringArray: "Array type using 'Array<{{type}}>' is forbidden. Use '{{type}}[]' instead.", + errorStringArraySimple: "Array type using 'Array<{{type}}>' is forbidden for simple types. Use '{{type}}[]' instead.", + }, + schema: [ + { + type: 'object', + properties: { + default: arrayOption, + readonly: arrayOption, + }, + }, + ], + }, + defaultOptions: [ + { + default: 'array', + }, + ], + create(context, [options]) { + var _a; + const sourceCode = context.getSourceCode(); + const defaultOption = options.default; + const readonlyOption = (_a = options.readonly) !== null && _a !== void 0 ? _a : defaultOption; + const isArraySimpleOption = defaultOption === 'array-simple' && readonlyOption === 'array-simple'; + const isArrayOption = defaultOption === 'array' && readonlyOption === 'array'; + const isGenericOption = defaultOption === 'generic' && readonlyOption === 'generic'; + /** + * Check if whitespace is needed before this node + * @param node the node to be evaluated. + */ + function requireWhitespaceBefore(node) { + const prevToken = sourceCode.getTokenBefore(node); + if (!prevToken) { + return false; + } + const nextToken = sourceCode.getTokenAfter(prevToken); + if (nextToken && sourceCode.isSpaceBetweenTokens(prevToken, nextToken)) { + return false; + } + return prevToken.type === experimental_utils_1.AST_TOKEN_TYPES.Identifier; + } + /** + * @param node the node to be evaluated. + */ + function getMessageType(node) { + if (node) { + if (node.type === experimental_utils_1.AST_NODE_TYPES.TSParenthesizedType) { + return getMessageType(node.typeAnnotation); + } + if (isSimpleType(node)) { + return sourceCode.getText(node); + } + } + return 'T'; + } + /** + * @param node the node to be evaluated + */ + function getTypeOpNodeRange(node) { + if (!node) { + return undefined; + } + const firstToken = sourceCode.getFirstToken(node); + const nextToken = sourceCode.getTokenAfter(firstToken); + return [firstToken.range[0], nextToken.range[0]]; + } + return { + TSArrayType(node) { + if (isArrayOption || + (isArraySimpleOption && isSimpleType(node.elementType))) { + return; + } + const isReadonly = node.parent && + node.parent.type === experimental_utils_1.AST_NODE_TYPES.TSTypeOperator && + node.parent.operator === 'readonly'; + const isReadonlyGeneric = readonlyOption === 'generic' && defaultOption !== 'generic'; + const isReadonlyArray = readonlyOption !== 'generic' && defaultOption === 'generic'; + if ((isReadonlyGeneric && !isReadonly) || + (isReadonlyArray && isReadonly)) { + return; + } + const messageId = defaultOption === 'generic' + ? 'errorStringGeneric' + : 'errorStringGenericSimple'; + const typeOpNode = isReadonly ? node.parent : null; + context.report({ + node: isReadonly ? node.parent : node, + messageId, + data: { + type: getMessageType(node.elementType), + }, + fix(fixer) { + const toFix = [ + fixer.replaceTextRange([node.range[1] - 2, node.range[1]], '>'), + ]; + const startText = requireWhitespaceBefore(node); + const typeOpNodeRange = getTypeOpNodeRange(typeOpNode); + if (typeOpNodeRange) { + toFix.unshift(fixer.removeRange(typeOpNodeRange)); + } + else { + toFix.push(fixer.insertTextBefore(node, `${startText ? ' ' : ''}`)); + } + toFix.push(fixer.insertTextBefore(node, `${isReadonly ? 'Readonly' : ''}Array<`)); + if (node.elementType.type === experimental_utils_1.AST_NODE_TYPES.TSParenthesizedType) { + const first = sourceCode.getFirstToken(node.elementType); + const last = sourceCode.getLastToken(node.elementType); + if (!first || !last) { + return null; + } + toFix.push(fixer.remove(first)); + toFix.push(fixer.remove(last)); + } + return toFix; + }, + }); + }, + TSTypeReference(node) { + var _a; + if (isGenericOption || + node.typeName.type !== experimental_utils_1.AST_NODE_TYPES.Identifier) { + return; + } + const isReadonlyArrayType = node.typeName.name === 'ReadonlyArray'; + const isArrayType = node.typeName.name === 'Array'; + if (!(isArrayType || isReadonlyArrayType) || + (readonlyOption === 'generic' && isReadonlyArrayType) || + (defaultOption === 'generic' && !isReadonlyArrayType)) { + return; + } + const readonlyPrefix = isReadonlyArrayType ? 'readonly ' : ''; + const typeParams = (_a = node.typeParameters) === null || _a === void 0 ? void 0 : _a.params; + const messageId = defaultOption === 'array' + ? 'errorStringArray' + : 'errorStringArraySimple'; + if (!typeParams || typeParams.length === 0) { + // Create an 'any' array + context.report({ + node, + messageId, + data: { + type: 'any', + }, + fix(fixer) { + return fixer.replaceText(node, `${readonlyPrefix}any[]`); + }, + }); + return; + } + if (typeParams.length !== 1 || + (defaultOption === 'array-simple' && !isSimpleType(typeParams[0]))) { + return; + } + const type = typeParams[0]; + const parens = typeNeedsParentheses(type); + context.report({ + node, + messageId, + data: { + type: getMessageType(type), + }, + fix(fixer) { + return [ + fixer.replaceTextRange([node.range[0], type.range[0]], `${readonlyPrefix}${parens ? '(' : ''}`), + fixer.replaceTextRange([type.range[1], node.range[1]], parens ? ')[]' : '[]'), + ]; + }, + }); + }, + }; + }, +}); +//# sourceMappingURL=array-type.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js.map new file mode 100644 index 000000000..2acd2d280 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js.map @@ -0,0 +1 @@ +{"version":3,"file":"array-type.js","sourceRoot":"","sources":["../../src/rules/array-type.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAI+C;AAC/C,8CAAgC;AAEhC;;;GAGG;AACH,SAAS,YAAY,CAAC,IAAmB;IACvC,QAAQ,IAAI,CAAC,IAAI,EAAE;QACjB,KAAK,mCAAc,CAAC,UAAU,CAAC;QAC/B,KAAK,mCAAc,CAAC,YAAY,CAAC;QACjC,KAAK,mCAAc,CAAC,gBAAgB,CAAC;QACrC,KAAK,mCAAc,CAAC,cAAc,CAAC;QACnC,KAAK,mCAAc,CAAC,eAAe,CAAC;QACpC,KAAK,mCAAc,CAAC,eAAe,CAAC;QACpC,KAAK,mCAAc,CAAC,eAAe,CAAC;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EAAE,cAAc,CAAC,IAAI,CAAC;qBAC3B;oBACD,GAAG,CAAC,KAAK;wBACP,OAAO;4BACL,KAAK,CAAC,gBAAgB,CACpB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC9B,GAAG,cAAc,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACxC;4BACD,KAAK,CAAC,gBAAgB,CACpB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC9B,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CACtB;yBACF,CAAC;oBACJ,CAAC;iBACF,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/await-thenable.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/await-thenable.js new file mode 100644 index 000000000..e00e853dd --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/await-thenable.js @@ -0,0 +1,59 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const tsutils = __importStar(require("tsutils")); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'await-thenable', + meta: { + docs: { + description: 'Disallows awaiting a value that is not a Thenable', + category: 'Best Practices', + recommended: 'error', + requiresTypeChecking: true, + }, + messages: { + await: 'Unexpected `await` of a non-Promise (non-"Thenable") value.', + }, + schema: [], + type: 'problem', + }, + defaultOptions: [], + create(context) { + const parserServices = util.getParserServices(context); + const checker = parserServices.program.getTypeChecker(); + return { + AwaitExpression(node) { + const originalNode = parserServices.esTreeNodeToTSNodeMap.get(node); + const type = checker.getTypeAtLocation(originalNode.expression); + if (!util.isTypeAnyType(type) && + !util.isTypeUnknownType(type) && + !tsutils.isThenableType(checker, originalNode.expression, type)) { + context.report({ + messageId: 'await', + node, + }); + } + }, + }; + }, +}); +//# sourceMappingURL=await-thenable.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/await-thenable.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/await-thenable.js.map new file mode 100644 index 000000000..b53e8dc88 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/await-thenable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"await-thenable.js","sourceRoot":"","sources":["../../src/rules/await-thenable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,iDAAmC;AAEnC,8CAAgC;AAEhC,kBAAe,IAAI,CAAC,UAAU,CAAC;IAC7B,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,WAAW,EAAE,mDAAmD;YAChE,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,OAAO;YACpB,oBAAoB,EAAE,IAAI;SAC3B;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,6DAA6D;SACrE;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,SAAS;KAChB;IACD,cAAc,EAAE,EAAE;IAElB,MAAM,CAAC,OAAO;QACZ,MAAM,cAAc,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QACvD,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;QAExD,OAAO;YACL,eAAe,CAAC,IAAI;gBAClB,MAAM,YAAY,GAAG,cAAc,CAAC,qBAAqB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBACpE,MAAM,IAAI,GAAG,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;gBAEhE,IACE,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;oBACzB,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC;oBAC7B,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,EAC/D;oBACA,OAAO,CAAC,MAAM,CAAC;wBACb,SAAS,EAAE,OAAO;wBAClB,IAAI;qBACL,CAAC,CAAC;iBACJ;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js new file mode 100644 index 000000000..d2a19b45d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js @@ -0,0 +1,141 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultMinimumDescriptionLength = void 0; +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.defaultMinimumDescriptionLength = 3; +exports.default = util.createRule({ + name: 'ban-ts-comment', + meta: { + type: 'problem', + docs: { + description: 'Bans `// @ts-` comments from being used or requires descriptions after directive', + category: 'Best Practices', + recommended: 'error', + }, + messages: { + tsDirectiveComment: 'Do not use "// @ts-{{directive}}" because it alters compilation errors.', + tsDirectiveCommentRequiresDescription: 'Include a description after the "// @ts-{{directive}}" directive to explain why the @ts-{{directive}} is necessary. The description must be {{minimumDescriptionLength}} characters or longer.', + }, + schema: [ + { + type: 'object', + properties: { + 'ts-expect-error': { + oneOf: [ + { + type: 'boolean', + default: true, + }, + { + enum: ['allow-with-description'], + }, + ], + }, + 'ts-ignore': { + oneOf: [ + { + type: 'boolean', + default: true, + }, + { + enum: ['allow-with-description'], + }, + ], + }, + 'ts-nocheck': { + oneOf: [ + { + type: 'boolean', + default: true, + }, + { + enum: ['allow-with-description'], + }, + ], + }, + 'ts-check': { + oneOf: [ + { + type: 'boolean', + default: true, + }, + { + enum: ['allow-with-description'], + }, + ], + }, + minimumDescriptionLength: { + type: 'number', + default: exports.defaultMinimumDescriptionLength, + }, + }, + additionalProperties: false, + }, + ], + }, + defaultOptions: [ + { + 'ts-expect-error': 'allow-with-description', + 'ts-ignore': true, + 'ts-nocheck': true, + 'ts-check': false, + minimumDescriptionLength: exports.defaultMinimumDescriptionLength, + }, + ], + create(context, [options]) { + const tsCommentRegExp = /^\/*\s*@ts-(expect-error|ignore|check|nocheck)(.*)/; + const sourceCode = context.getSourceCode(); + return { + Program() { + const comments = sourceCode.getAllComments(); + comments.forEach(comment => { + var _a; + if (comment.type !== experimental_utils_1.AST_TOKEN_TYPES.Line) { + return; + } + const [, directive, description] = (_a = tsCommentRegExp.exec(comment.value)) !== null && _a !== void 0 ? _a : []; + const fullDirective = `ts-${directive}`; + const option = options[fullDirective]; + if (option === true) { + context.report({ + data: { directive }, + node: comment, + messageId: 'tsDirectiveComment', + }); + } + if (option === 'allow-with-description') { + const { minimumDescriptionLength = exports.defaultMinimumDescriptionLength, } = options; + if (description.trim().length < minimumDescriptionLength) { + context.report({ + data: { directive, minimumDescriptionLength }, + node: comment, + messageId: 'tsDirectiveCommentRequiresDescription', + }); + } + } + }); + }, + }; + }, +}); +//# sourceMappingURL=ban-ts-comment.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js.map new file mode 100644 index 000000000..7d6e42109 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ban-ts-comment.js","sourceRoot":"","sources":["../../src/rules/ban-ts-comment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,8EAAwE;AACxE,8CAAgC;AAUnB,QAAA,+BAA+B,GAAG,CAAC,CAAC;AAMjD,kBAAe,IAAI,CAAC,UAAU,CAAwB;IACpD,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EACT,6FAA6F;YAC/F,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,OAAO;SACrB;QACD,QAAQ,EAAE;YACR,kBAAkB,EAChB,yEAAyE;YAC3E,qCAAqC,EACnC,gMAAgM;SACnM;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,iBAAiB,EAAE;wBACjB,KAAK,EAAE;4BACL;gCACE,IAAI,EAAE,SAA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MAAM,CAAC,EAAE,SAAS,EAAE,WAAW,CAAC,SAC9B,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,mCAAI,EAAE,CAAC;oBAE5C,MAAM,aAAa,GAAG,MAAM,SAAS,EAAmB,CAAC;oBAEzD,MAAM,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;oBACtC,IAAI,MAAM,KAAK,IAAI,EAAE;wBACnB,OAAO,CAAC,MAAM,CAAC;4BACb,IAAI,EAAE,EAAE,SAAS,EAAE;4BACnB,IAAI,EAAE,OAAO;4BACb,SAAS,EAAE,oBAAoB;yBAChC,CAAC,CAAC;qBACJ;oBAED,IAAI,MAAM,KAAK,wBAAwB,EAAE;wBACvC,MAAM,EACJ,wBAAwB,GAAG,uCAA+B,GAC3D,GAAG,OAAO,CAAC;wBACZ,IAAI,WAAW,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,wBAAwB,EAAE;4BACxD,OAAO,CAAC,MAAM,CAAC;gCACb,IAAI,EAAE,EAAE,SAAS,EAAE,wBAAwB,EAAE;gCAC7C,IAAI,EAAE,OAAO;gCACb,SAAS,EAAE,uCAAuC;6BACnD,CAAC,CAAC;yBACJ;qBACF;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-tslint-comment.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-tslint-comment.js new file mode 100644 index 000000000..46cab0dee --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-tslint-comment.js @@ -0,0 +1,75 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +// tslint regex +// https://github.com/palantir/tslint/blob/95d9d958833fd9dc0002d18cbe34db20d0fbf437/src/enableDisableRules.ts#L32 +const ENABLE_DISABLE_REGEX = /^\s*tslint:(enable|disable)(?:-(line|next-line))?(:|\s|$)/; +const toText = (text, type) => type === experimental_utils_1.AST_TOKEN_TYPES.Line + ? ['//', text.trim()].join(' ') + : ['/*', text.trim(), '*/'].join(' '); +exports.default = util.createRule({ + name: 'ban-tslint-comment', + meta: { + type: 'suggestion', + docs: { + description: 'Bans `// tslint:` comments from being used', + category: 'Stylistic Issues', + recommended: false, + }, + messages: { + commentDetected: 'tslint comment detected: "{{ text }}"', + }, + schema: [], + fixable: 'code', + }, + defaultOptions: [], + create: context => { + const sourceCode = context.getSourceCode(); + return { + Program() { + const comments = sourceCode.getAllComments(); + comments.forEach(c => { + if (ENABLE_DISABLE_REGEX.test(c.value)) { + context.report({ + data: { text: toText(c.value, c.type) }, + node: c, + messageId: 'commentDetected', + fix(fixer) { + const rangeStart = sourceCode.getIndexFromLoc({ + column: c.loc.start.column > 0 ? c.loc.start.column - 1 : 0, + line: c.loc.start.line, + }); + const rangeEnd = sourceCode.getIndexFromLoc({ + column: c.loc.end.column, + line: c.loc.end.line, + }); + return fixer.removeRange([rangeStart, rangeEnd + 1]); + }, + }); + } + }); + }, + }; + }, +}); +//# sourceMappingURL=ban-tslint-comment.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-tslint-comment.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-tslint-comment.js.map new file mode 100644 index 000000000..301958f15 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-tslint-comment.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ban-tslint-comment.js","sourceRoot":"","sources":["../../src/rules/ban-tslint-comment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAAwE;AACxE,8CAAgC;AAEhC,eAAe;AACf,iHAAiH;AACjH,MAAM,oBAAoB,GAAG,2DAA2D,CAAC;AAEzF,MAAM,MAAM,GAAG,CACb,IAAY,EACZ,IAAkD,EAC1C,EAAE,CACV,IAAI,KAAK,oCAAe,CAAC,IAAI;IAC3B,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;IAC/B,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE1C,kBAAe,IAAI,CAAC,UAAU,CAAC;IAC7B,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,uDAAuD;YACpE,QAAQ,EAAE,kBAAkB;YAC5B,WAAW,EAAE,KAAK;SACnB;QACD,QAAQ,EAAE;YACR,eAAe,EAAE,uCAAuC;SACzD;QACD,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,MAAM;KAChB;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,EAAE,OAAO,CAAC,EAAE;QAChB,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;QAC3C,OAAO;YACL,OAAO;gBACL,MAAM,QAAQ,GAAG,UAAU,CAAC,cAAc,EAAE,CAAC;gBAC7C,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;oBACnB,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE;wBACtC,OAAO,CAAC,MAAM,CAAC;4BACb,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE;4BACvC,IAAI,EAAE,CAAC;4BACP,SAAS,EAAE,iBAAiB;4BAC5B,GAAG,CAAC,KAAK;gCACP,MAAM,UAAU,GAAG,UAAU,CAAC,eAAe,CAAC;oCAC5C,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;oCAC3D,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI;iCACvB,CAAC,CAAC;gCACH,MAAM,QAAQ,GAAG,UAAU,CAAC,eAAe,CAAC;oCAC1C,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM;oCACxB,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI;iCACrB,CAAC,CAAC;gCACH,OAAO,KAAK,CAAC,WAAW,CAAC,CAAC,UAAU,EAAE,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC;4BACvD,CAAC;yBACF,CAAC,CAAC;qBACJ;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-types.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-types.js new file mode 100644 index 000000000..eb9fc2d5f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-types.js @@ -0,0 +1,189 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TYPE_KEYWORDS = void 0; +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +function removeSpaces(str) { + return str.replace(/ /g, ''); +} +function stringifyTypeName(node, sourceCode) { + return removeSpaces(sourceCode.getText(node)); +} +function getCustomMessage(bannedType) { + if (bannedType === null) { + return ''; + } + if (typeof bannedType === 'string') { + return ` ${bannedType}`; + } + if (bannedType.message) { + return ` ${bannedType.message}`; + } + return ''; +} +const defaultTypes = { + String: { + message: 'Use string instead', + fixWith: 'string', + }, + Boolean: { + message: 'Use boolean instead', + fixWith: 'boolean', + }, + Number: { + message: 'Use number instead', + fixWith: 'number', + }, + Symbol: { + message: 'Use symbol instead', + fixWith: 'symbol', + }, + Function: { + message: [ + 'The `Function` type accepts any function-like value.', + 'It provides no type safety when calling the function, which can be a common source of bugs.', + 'It also accepts things like class declarations, which will throw at runtime as they will not be called with `new`.', + 'If you are expecting the function to accept certain arguments, you should explicitly define the function shape.', + ].join('\n'), + }, + // object typing + Object: { + message: [ + 'The `Object` type actually means "any non-nullish value", so it is marginally better than `unknown`.', + '- If you want a type meaning "any object", you probably want `Record` instead.', + '- If you want a type meaning "any value", you probably want `unknown` instead.', + ].join('\n'), + }, + '{}': { + message: [ + '`{}` actually means "any non-nullish value".', + '- If you want a type meaning "any object", you probably want `Record` instead.', + '- If you want a type meaning "any value", you probably want `unknown` instead.', + ].join('\n'), + }, + object: { + message: [ + 'The `object` type is currently hard to use ([see this issue](https://github.com/microsoft/TypeScript/issues/21732)).', + 'Consider using `Record` instead, as it allows you to more easily inspect and use the keys.', + ].join('\n'), + }, +}; +exports.TYPE_KEYWORDS = { + bigint: experimental_utils_1.AST_NODE_TYPES.TSBigIntKeyword, + boolean: experimental_utils_1.AST_NODE_TYPES.TSBooleanKeyword, + never: experimental_utils_1.AST_NODE_TYPES.TSNeverKeyword, + null: experimental_utils_1.AST_NODE_TYPES.TSNullKeyword, + number: experimental_utils_1.AST_NODE_TYPES.TSNumberKeyword, + object: experimental_utils_1.AST_NODE_TYPES.TSObjectKeyword, + string: experimental_utils_1.AST_NODE_TYPES.TSStringKeyword, + symbol: experimental_utils_1.AST_NODE_TYPES.TSSymbolKeyword, + undefined: experimental_utils_1.AST_NODE_TYPES.TSUndefinedKeyword, + unknown: experimental_utils_1.AST_NODE_TYPES.TSUnknownKeyword, + void: experimental_utils_1.AST_NODE_TYPES.TSVoidKeyword, +}; +exports.default = util.createRule({ + name: 'ban-types', + meta: { + type: 'suggestion', + docs: { + description: 'Bans specific types from being used', + category: 'Best Practices', + recommended: 'error', + }, + fixable: 'code', + messages: { + bannedTypeMessage: "Don't use `{{name}}` as a type.{{customMessage}}", + }, + schema: [ + { + type: 'object', + properties: { + types: { + type: 'object', + additionalProperties: { + oneOf: [ + { type: 'null' }, + { type: 'boolean' }, + { type: 'string' }, + { + type: 'object', + properties: { + message: { type: 'string' }, + fixWith: { type: 'string' }, + }, + additionalProperties: false, + }, + ], + }, + }, + extendDefaults: { + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], + }, + defaultOptions: [{}], + create(context, [options]) { + var _a, _b; + const extendDefaults = (_a = options.extendDefaults) !== null && _a !== void 0 ? _a : true; + const customTypes = (_b = options.types) !== null && _b !== void 0 ? _b : {}; + const types = Object.assign({}, extendDefaults ? defaultTypes : {}, customTypes); + const bannedTypes = new Map(Object.entries(types).map(([type, data]) => [removeSpaces(type), data])); + function checkBannedTypes(typeNode, name = stringifyTypeName(typeNode, context.getSourceCode())) { + const bannedType = bannedTypes.get(name); + if (bannedType === undefined || bannedType === false) { + return; + } + const customMessage = getCustomMessage(bannedType); + const fixWith = bannedType && typeof bannedType === 'object' && bannedType.fixWith; + context.report({ + node: typeNode, + messageId: 'bannedTypeMessage', + data: { + name, + customMessage, + }, + fix: fixWith + ? (fixer) => fixer.replaceText(typeNode, fixWith) + : null, + }); + } + const keywordSelectors = util.objectReduceKey(exports.TYPE_KEYWORDS, (acc, keyword) => { + if (bannedTypes.has(keyword)) { + acc[exports.TYPE_KEYWORDS[keyword]] = (node) => checkBannedTypes(node, keyword); + } + return acc; + }, {}); + return Object.assign(Object.assign({}, keywordSelectors), { TSTypeLiteral(node) { + if (node.members.length) { + return; + } + checkBannedTypes(node); + }, + TSTypeReference({ typeName }) { + checkBannedTypes(typeName); + } }); + }, +}); +//# sourceMappingURL=ban-types.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-types.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-types.js.map new file mode 100644 index 000000000..3f3eb618b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ban-types.js","sourceRoot":"","sources":["../../src/rules/ban-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,8EAI+C;AAC/C,8CAAgC;AAqBhC,SAAS,YAAY,CAAC,GAAW;IAC/B,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,iBAAiB,CACxB,IAAmB,EACnB,UAA+B;IAE/B,OAAO,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAA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AAC,IAAI;aACT,CAAC,CAAC;QACL,CAAC;QAED,MAAM,gBAAgB,GAAG,IAAI,CAAC,eAAe,CAC3C,qBAAa,EACb,CAAC,GAA0B,EAAE,OAAO,EAAE,EAAE;YACtC,IAAI,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;gBAC5B,GAAG,CAAC,qBAAa,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,IAAmB,EAAQ,EAAE,CAC1D,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;aACnC;YAED,OAAO,GAAG,CAAC;QACb,CAAC,EACD,EAAE,CACH,CAAC;QAEF,uCACK,gBAAgB,KAEnB,aAAa,CAAC,IAAI;gBAChB,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;oBACvB,OAAO;iBACR;gBAED,gBAAgB,CAAC,IAAI,CAAC,CAAC;YACzB,CAAC;YACD,eAAe,CAAC,EAAE,QAAQ,EAAE;gBAC1B,gBAAgB,CAAC,QAAQ,CAAC,CAAC;YAC7B,CAAC,IACD;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/brace-style.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/brace-style.js new file mode 100644 index 000000000..5709f0a9a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/brace-style.js @@ -0,0 +1,94 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const brace_style_1 = __importDefault(require("eslint/lib/rules/brace-style")); +const util_1 = require("../util"); +exports.default = util_1.createRule({ + name: 'brace-style', + meta: { + type: 'layout', + docs: { + description: 'Enforce consistent brace style for blocks', + category: 'Stylistic Issues', + recommended: false, + extendsBaseRule: true, + }, + messages: brace_style_1.default.meta.messages, + fixable: brace_style_1.default.meta.fixable, + schema: brace_style_1.default.meta.schema, + }, + defaultOptions: ['1tbs'], + create(context) { + const [style, { allowSingleLine } = { allowSingleLine: false },] = context.options; + const isAllmanStyle = style === 'allman'; + const sourceCode = context.getSourceCode(); + const rules = brace_style_1.default.create(context); + /** + * Checks a pair of curly brackets based on the user's config + */ + function validateCurlyPair(openingCurlyToken, closingCurlyToken) { + if (allowSingleLine && + util_1.isTokenOnSameLine(openingCurlyToken, closingCurlyToken)) { + return; + } + const tokenBeforeOpeningCurly = sourceCode.getTokenBefore(openingCurlyToken); + const tokenBeforeClosingCurly = sourceCode.getTokenBefore(closingCurlyToken); + const tokenAfterOpeningCurly = sourceCode.getTokenAfter(openingCurlyToken); + if (!isAllmanStyle && + !util_1.isTokenOnSameLine(tokenBeforeOpeningCurly, openingCurlyToken)) { + context.report({ + node: openingCurlyToken, + messageId: 'nextLineOpen', + fix: fixer => { + const textRange = [ + tokenBeforeOpeningCurly.range[1], + openingCurlyToken.range[0], + ]; + const textBetween = sourceCode.text.slice(textRange[0], textRange[1]); + if (textBetween.trim()) { + return null; + } + return fixer.replaceTextRange(textRange, ' '); + }, + }); + } + if (isAllmanStyle && + util_1.isTokenOnSameLine(tokenBeforeOpeningCurly, openingCurlyToken)) { + context.report({ + node: openingCurlyToken, + messageId: 'sameLineOpen', + fix: fixer => fixer.insertTextBefore(openingCurlyToken, '\n'), + }); + } + if (util_1.isTokenOnSameLine(openingCurlyToken, tokenAfterOpeningCurly) && + tokenAfterOpeningCurly !== closingCurlyToken) { + context.report({ + node: openingCurlyToken, + messageId: 'blockSameLine', + fix: fixer => fixer.insertTextAfter(openingCurlyToken, '\n'), + }); + } + if (util_1.isTokenOnSameLine(tokenBeforeClosingCurly, closingCurlyToken) && + tokenBeforeClosingCurly !== openingCurlyToken) { + context.report({ + node: closingCurlyToken, + messageId: 'singleLineClose', + fix: fixer => fixer.insertTextBefore(closingCurlyToken, '\n'), + }); + } + } + return Object.assign(Object.assign({}, rules), { 'TSInterfaceBody, TSModuleBlock'(node) { + const openingCurly = sourceCode.getFirstToken(node); + const closingCurly = sourceCode.getLastToken(node); + validateCurlyPair(openingCurly, closingCurly); + }, + TSEnumDeclaration(node) { + const closingCurly = sourceCode.getLastToken(node); + const openingCurly = sourceCode.getTokenBefore(node.members.length ? node.members[0] : closingCurly); + validateCurlyPair(openingCurly, closingCurly); + } }); + }, +}); +//# sourceMappingURL=brace-style.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/brace-style.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/brace-style.js.map new file mode 100644 index 000000000..8bfa2a874 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/brace-style.js.map @@ -0,0 +1 @@ +{"version":3,"file":"brace-style.js","sourceRoot":"","sources":["../../src/rules/brace-style.ts"],"names":[],"mappings":";;;;;AACA,+EAAoD;AACpD,kCAKiB;AAKjB,kBAAe,iBAAU,CAAsB;IAC7C,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE;YACJ,WAAW,EAAE,2CAA2C;YACxD,QAAQ,EAAE,kBAAkB;YAC5B,WAAW,EAAE,KAAK;YAClB,eAAe,EAAE,IAAI;SACtB;QACD,QAAQ,EAAE,qBAAQ,CAAC,IAAI,CAAC,QAAQ;QAChC,OAAO,EAAE,qBAAQ,CAAC,IAAI,CAAC,OAAO;QAC9B,MAAM,EAAE,qBAAQ,CAAC,IAAI,CAAC,MAAM;KAC7B;IACD,cAAc,EAAE,CAAC,MAAM,CAAC;IACxB,MAAM,CAAC,OAAO;QACZ,MAAM,CACJ,KAAK,EACL,EAAE,eAAe,EAAE,GAAG,EAAE,eAAe,EAAE,KAAK,EAAE,EACjD,GAAG,OAAO,CAAC,OAAO,CAAC;QAEpB,MAAM,aAAa,GAAG,KAAK,KAAK,QAAQ,CAAC;QACzC,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;QAC3C,MAAM,KAAK,GA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YAAY,EAAE,YAAY,CAAC,CAAC;YAChD,CAAC,IACD;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-literal-property-style.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-literal-property-style.js new file mode 100644 index 000000000..2d6e06248 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-literal-property-style.js @@ -0,0 +1,114 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +const printNodeModifiers = (node, final) => { + var _a; + return `${(_a = node.accessibility) !== null && _a !== void 0 ? _a : ''}${node.static ? ' static' : ''} ${final} `.trimLeft(); +}; +const isSupportedLiteral = (node) => { + if (node.type === experimental_utils_1.AST_NODE_TYPES.Literal) { + return true; + } + if (node.type === experimental_utils_1.AST_NODE_TYPES.TaggedTemplateExpression || + node.type === experimental_utils_1.AST_NODE_TYPES.TemplateLiteral) { + return ('quasi' in node ? node.quasi.quasis : node.quasis).length === 1; + } + return false; +}; +exports.default = util.createRule({ + name: 'class-literal-property-style', + meta: { + type: 'problem', + docs: { + description: 'Ensures that literals on classes are exposed in a consistent style', + category: 'Best Practices', + recommended: false, + }, + fixable: 'code', + messages: { + preferFieldStyle: 'Literals should be exposed using readonly fields.', + preferGetterStyle: 'Literals should be exposed using getters.', + }, + schema: [{ enum: ['fields', 'getters'] }], + }, + defaultOptions: ['fields'], + create(context, [style]) { + if (style === 'fields') { + return { + MethodDefinition(node) { + if (node.kind !== 'get' || + !node.value.body || + !node.value.body.body.length) { + return; + } + const [statement] = node.value.body.body; + if (statement.type !== experimental_utils_1.AST_NODE_TYPES.ReturnStatement) { + return; + } + const { argument } = statement; + if (!argument || !isSupportedLiteral(argument)) { + return; + } + context.report({ + node: node.key, + messageId: 'preferFieldStyle', + fix(fixer) { + const sourceCode = context.getSourceCode(); + const name = sourceCode.getText(node.key); + let text = ''; + text += printNodeModifiers(node, 'readonly'); + text += node.computed ? `[${name}]` : name; + text += ` = ${sourceCode.getText(argument)};`; + return fixer.replaceText(node, text); + }, + }); + }, + }; + } + return { + ClassProperty(node) { + if (!node.readonly || node.declare) { + return; + } + const { value } = node; + if (!value || !isSupportedLiteral(value)) { + return; + } + context.report({ + node: node.key, + messageId: 'preferGetterStyle', + fix(fixer) { + const sourceCode = context.getSourceCode(); + const name = sourceCode.getText(node.key); + let text = ''; + text += printNodeModifiers(node, 'get'); + text += node.computed ? `[${name}]` : name; + text += `() { return ${sourceCode.getText(value)}; }`; + return fixer.replaceText(node, text); + }, + }); + }, + }; + }, +}); +//# sourceMappingURL=class-literal-property-style.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-literal-property-style.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-literal-property-style.js.map new file mode 100644 index 000000000..99fba142f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-literal-property-style.js.map @@ -0,0 +1 @@ +{"version":3,"file":"class-literal-property-style.js","sourceRoot":"","sources":["../../src/rules/class-literal-property-style.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;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,CAAC,IAA4B;gBACxC,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,EAAE;oBAClC,OAAO;iBACR;gBAED,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;gBAEvB,IAAI,CAAC,KAAK,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE;oBACxC,OAAO;iBACR;gBAED,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI,EAAE,IAAI,CAAC,GAAG;oBACd,SAAS,EAAE,mBAAmB;oBAC9B,GAAG,CAAC,KAAK;wBACP,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;wBAC3C,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;wBAE1C,IAAI,IAAI,GAAG,EAAE,CAAC;wBAEd,IAAI,IAAI,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;wBACxC,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;wBAC3C,IAAI,IAAI,eAAe,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;wBAEtD,OAAO,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;oBACvC,CAAC;iBACF,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-spacing.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-spacing.js new file mode 100644 index 000000000..6e2c44066 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-spacing.js @@ -0,0 +1,141 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util_1 = require("../util"); +exports.default = util_1.createRule({ + name: 'comma-spacing', + meta: { + type: 'suggestion', + docs: { + description: 'Enforces consistent spacing before and after commas', + category: 'Stylistic Issues', + recommended: false, + extendsBaseRule: true, + }, + fixable: 'whitespace', + schema: [ + { + type: 'object', + properties: { + before: { + type: 'boolean', + default: false, + }, + after: { + type: 'boolean', + default: true, + }, + }, + additionalProperties: false, + }, + ], + messages: { + unexpected: `There should be no space {{loc}} ','.`, + missing: `A space is required {{loc}} ','.`, + }, + }, + defaultOptions: [ + { + before: false, + after: true, + }, + ], + create(context, [{ before: spaceBefore, after: spaceAfter }]) { + const sourceCode = context.getSourceCode(); + const tokensAndComments = sourceCode.tokensAndComments; + const ignoredTokens = new Set(); + /** + * Adds null elements of the ArrayExpression or ArrayPattern node to the ignore list + * @param node node to evaluate + */ + function addNullElementsToIgnoreList(node) { + let previousToken = sourceCode.getFirstToken(node); + for (const element of node.elements) { + let token; + if (element === null) { + token = sourceCode.getTokenAfter(previousToken); + if (token && util_1.isCommaToken(token)) { + ignoredTokens.add(token); + } + } + else { + token = sourceCode.getTokenAfter(element); + } + previousToken = token; + } + } + /** + * Adds type parameters trailing comma token to the ignore list + * @param node node to evaluate + */ + function addTypeParametersTrailingCommaToIgnoreList(node) { + const param = node.params[node.params.length - 1]; + const afterToken = sourceCode.getTokenAfter(param); + if (afterToken && util_1.isCommaToken(afterToken)) { + ignoredTokens.add(afterToken); + } + } + /** + * Validates the spacing around a comma token. + * @param commaToken The token representing the comma + * @param prevToken The last token before the comma + * @param nextToken The first token after the comma + */ + function validateCommaSpacing(commaToken, prevToken, nextToken) { + if (prevToken && + util_1.isTokenOnSameLine(prevToken, commaToken) && + spaceBefore !== sourceCode.isSpaceBetweenTokens(prevToken, commaToken)) { + context.report({ + node: commaToken, + data: { + loc: 'before', + }, + messageId: spaceBefore ? 'missing' : 'unexpected', + fix: fixer => spaceBefore + ? fixer.insertTextBefore(commaToken, ' ') + : fixer.replaceTextRange([prevToken.range[1], commaToken.range[0]], ''), + }); + } + if (nextToken && util_1.isClosingParenToken(nextToken)) { + return; + } + if (!spaceAfter && nextToken && nextToken.type === experimental_utils_1.AST_TOKEN_TYPES.Line) { + return; + } + if (nextToken && + util_1.isTokenOnSameLine(commaToken, nextToken) && + spaceAfter !== sourceCode.isSpaceBetweenTokens(commaToken, nextToken)) { + context.report({ + node: commaToken, + data: { + loc: 'after', + }, + messageId: spaceAfter ? 'missing' : 'unexpected', + fix: fixer => spaceAfter + ? fixer.insertTextAfter(commaToken, ' ') + : fixer.replaceTextRange([commaToken.range[1], nextToken.range[0]], ''), + }); + } + } + return { + TSTypeParameterDeclaration: addTypeParametersTrailingCommaToIgnoreList, + ArrayExpression: addNullElementsToIgnoreList, + ArrayPattern: addNullElementsToIgnoreList, + 'Program:exit'() { + tokensAndComments.forEach((token, i) => { + if (!util_1.isCommaToken(token)) { + return; + } + const prevToken = tokensAndComments[i - 1]; + const nextToken = tokensAndComments[i + 1]; + validateCommaSpacing(token, util_1.isCommaToken(prevToken) || ignoredTokens.has(token) + ? null + : prevToken, util_1.isCommaToken(nextToken) || ignoredTokens.has(token) + ? null + : nextToken); + }); + }, + }; + }, +}); +//# sourceMappingURL=comma-spacing.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-spacing.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-spacing.js.map new file mode 100644 index 000000000..9ddd17a65 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-spacing.js.map @@ -0,0 +1 @@ +{"version":3,"file":"comma-spacing.js","sourceRoot":"","sources":["../../src/rules/comma-spacing.ts"],"names":[],"mappings":";;AAAA,8EAG+C;AAC/C,kCAKiB;AAUjB,kBAAe,iBAAU,CAAsB;IAC7C,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,qDAAqD;YAClE,QAAQ,EAAE,kBAAkB;YAC5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AC,KAAK,CAAC;wBACjD,CAAC,CAAC,IAAI;wBACN,CAAC,CAAC,SAAS,CACd,CAAC;gBACJ,CAAC,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-assertions.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-assertions.js new file mode 100644 index 000000000..00e292ad4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-assertions.js @@ -0,0 +1,153 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const util = __importStar(require("../util")); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +exports.default = util.createRule({ + name: 'consistent-type-assertions', + meta: { + type: 'suggestion', + docs: { + category: 'Best Practices', + description: 'Enforces consistent usage of type assertions', + recommended: false, + }, + messages: { + as: "Use 'as {{cast}}' instead of '<{{cast}}>'.", + 'angle-bracket': "Use '<{{cast}}>' instead of 'as {{cast}}'.", + never: 'Do not use any type assertions.', + unexpectedObjectTypeAssertion: 'Always prefer const x: T = { ... }.', + }, + schema: [ + { + oneOf: [ + { + type: 'object', + properties: { + assertionStyle: { + enum: ['never'], + }, + }, + additionalProperties: false, + required: ['assertionStyle'], + }, + { + type: 'object', + properties: { + assertionStyle: { + enum: ['as', 'angle-bracket'], + }, + objectLiteralTypeAssertions: { + enum: ['allow', 'allow-as-parameter', 'never'], + }, + }, + additionalProperties: false, + required: ['assertionStyle'], + }, + ], + }, + ], + }, + defaultOptions: [ + { + assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow', + }, + ], + create(context, [options]) { + const sourceCode = context.getSourceCode(); + function isConst(node) { + if (node.type !== experimental_utils_1.AST_NODE_TYPES.TSTypeReference) { + return false; + } + return (node.typeName.type === experimental_utils_1.AST_NODE_TYPES.Identifier && + node.typeName.name === 'const'); + } + function reportIncorrectAssertionType(node) { + // If this node is `as const`, then don't report an error. + if (isConst(node.typeAnnotation)) { + return; + } + const messageId = options.assertionStyle; + context.report({ + node, + messageId, + data: messageId !== 'never' + ? { cast: sourceCode.getText(node.typeAnnotation) } + : {}, + }); + } + function checkType(node) { + switch (node.type) { + case experimental_utils_1.AST_NODE_TYPES.TSAnyKeyword: + case experimental_utils_1.AST_NODE_TYPES.TSUnknownKeyword: + return false; + case experimental_utils_1.AST_NODE_TYPES.TSTypeReference: + return ( + // Ignore `as const` and `` + !isConst(node) || + // Allow qualified names which have dots between identifiers, `Foo.Bar` + node.typeName.type === experimental_utils_1.AST_NODE_TYPES.TSQualifiedName); + default: + return true; + } + } + function checkExpression(node) { + if (options.assertionStyle === 'never' || + options.objectLiteralTypeAssertions === 'allow' || + node.expression.type !== experimental_utils_1.AST_NODE_TYPES.ObjectExpression) { + return; + } + if (options.objectLiteralTypeAssertions === 'allow-as-parameter' && + node.parent && + (node.parent.type === experimental_utils_1.AST_NODE_TYPES.NewExpression || + node.parent.type === experimental_utils_1.AST_NODE_TYPES.CallExpression || + node.parent.type === experimental_utils_1.AST_NODE_TYPES.ThrowStatement || + node.parent.type === experimental_utils_1.AST_NODE_TYPES.AssignmentPattern)) { + return; + } + if (checkType(node.typeAnnotation) && + node.expression.type === experimental_utils_1.AST_NODE_TYPES.ObjectExpression) { + context.report({ + node, + messageId: 'unexpectedObjectTypeAssertion', + }); + } + } + return { + TSTypeAssertion(node) { + if (options.assertionStyle !== 'angle-bracket') { + reportIncorrectAssertionType(node); + return; + } + checkExpression(node); + }, + TSAsExpression(node) { + if (options.assertionStyle !== 'as') { + reportIncorrectAssertionType(node); + return; + } + checkExpression(node); + }, + }; + }, +}); +//# sourceMappingURL=consistent-type-assertions.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-assertions.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-assertions.js.map new file mode 100644 index 000000000..41dd8b124 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-assertions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"consistent-type-assertions.js","sourceRoot":"","sources":["../../src/rules/consistent-type-assertions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8CAAgC;AAChC,8EAG+C;AAkB/C,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,4BAA4B;IAClC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,8CAA8C;YAC3D,WAAW,EAAE,KAAK;SACnB;QACD,QAAQ,EAAE;YACR,EAAE,EAAE,4CAA4C;YAChD,eAAe,EAAE,4CAA4C;YAC7D,KAAK,EAAE,iCAAiC;YACxC,6BAA6B,EAAE,qCAAqC;SACrE;QACD,MAAM,EAAE;YACN;gBACE,KAAK,EAAE;oBACL;wBACE,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,cAAc,EAAE;gCACd,IAAI,EAAE,CAAC,OAAO,CAAC;6BAChB;yBACF;wBACD,oBAAoB,EAAE,KAAK;wBAC3B,QAAQ,EAAE,CAAC,gBAAgB,CAAC;qBAC7B;oBACD;wBACE,IAA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CAAC;oBACnC,OAAO;iBACR;gBAED,eAAe,CAAC,IAAI,CAAC,CAAC;YACxB,CAAC;YACD,cAAc,CAAC,IAAI;gBACjB,IAAI,OAAO,CAAC,cAAc,KAAK,IAAI,EAAE;oBACnC,4BAA4B,CAAC,IAAI,CAAC,CAAC;oBACnC,OAAO;iBACR;gBAED,eAAe,CAAC,IAAI,CAAC,CAAC;YACxB,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-definitions.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-definitions.js new file mode 100644 index 000000000..cd0de69e5 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-definitions.js @@ -0,0 +1,102 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'consistent-type-definitions', + meta: { + type: 'suggestion', + docs: { + description: 'Consistent with type definition either `interface` or `type`', + category: 'Stylistic Issues', + // too opinionated to be recommended + recommended: false, + }, + messages: { + interfaceOverType: 'Use an `interface` instead of a `type`.', + typeOverInterface: 'Use a `type` instead of an `interface`.', + }, + schema: [ + { + enum: ['interface', 'type'], + }, + ], + fixable: 'code', + }, + defaultOptions: ['interface'], + create(context, [option]) { + const sourceCode = context.getSourceCode(); + return { + "TSTypeAliasDeclaration[typeAnnotation.type='TSTypeLiteral']"(node) { + if (option === 'interface') { + context.report({ + node: node.id, + messageId: 'interfaceOverType', + fix(fixer) { + var _a; + const typeNode = (_a = node.typeParameters) !== null && _a !== void 0 ? _a : node.id; + const fixes = []; + const firstToken = sourceCode.getFirstToken(node); + if (firstToken) { + fixes.push(fixer.replaceText(firstToken, 'interface')); + fixes.push(fixer.replaceTextRange([typeNode.range[1], node.typeAnnotation.range[0]], ' ')); + } + const afterToken = sourceCode.getTokenAfter(node.typeAnnotation); + if (afterToken && + afterToken.type === experimental_utils_1.AST_TOKEN_TYPES.Punctuator && + afterToken.value === ';') { + fixes.push(fixer.remove(afterToken)); + } + return fixes; + }, + }); + } + }, + TSInterfaceDeclaration(node) { + if (option === 'type') { + context.report({ + node: node.id, + messageId: 'typeOverInterface', + fix(fixer) { + var _a; + const typeNode = (_a = node.typeParameters) !== null && _a !== void 0 ? _a : node.id; + const fixes = []; + const firstToken = sourceCode.getFirstToken(node); + if (firstToken) { + fixes.push(fixer.replaceText(firstToken, 'type')); + fixes.push(fixer.replaceTextRange([typeNode.range[1], node.body.range[0]], ' = ')); + } + if (node.extends) { + node.extends.forEach(heritage => { + const typeIdentifier = sourceCode.getText(heritage); + fixes.push(fixer.insertTextAfter(node.body, ` & ${typeIdentifier}`)); + }); + } + return fixes; + }, + }); + } + }, + }; + }, +}); +//# sourceMappingURL=consistent-type-definitions.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-definitions.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-definitions.js.map new file mode 100644 index 000000000..a9d96cba8 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-definitions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"consistent-type-definitions.js","sourceRoot":"","sources":["../../src/rules/consistent-type-definitions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAI+C;AAC/C,8CAAgC;AAEhC,kBAAe,IAAI,CAAC,UAAU,CAAC;IAC7B,IAAI,EAAE,6BAA6B;IACnC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EACT,8DAA8D;YAChE,QAAQ,EAAE,kBAAkB;YAC5B,oCAAoC;YACpC,WAAW,EAAE,KAAK;SACnB;QACD,QAAQ,EAAE;YACR,iBAAiB,EAAE,yCAAyC;YAC5D,iBAAiB,EAAE,yCAAyC;SAC7D;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC;aAC5B;SACF;QACD,OAAO,EAAE,MAAM;KAChB;IACD,cAAc,EAAE,CAAC,WAAW,CAAC;IAC7B,MAAM,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC;QACtB,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;QAE3C,OAAO;YACL,6DAA6D,CAC3D,IAAqC;gBAErC,IAAI,MAAM,KAAK,WAAW,EAAE;oBAC1B,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI,EAAE,IAAI,CAAC,EAAE;wBACb,SAAS,EAAE,mBAAmB;wBAC9B,GAAG,CAAC,KAAK;;4BACP,MAAM,QAAQ,SAAG,IAAI,CAAC,cAAc,mCAAI,IAAI,CAAC,EAAE,CAAC;4BAChD,MAAM,KAAK,GAAuB,EAAE,CAAC;4BAErC,MAAM,UAAU,GAAG,UAAU,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;4BAClD,IAAI,UAAU,EAAE;gCACd,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC;gCACvD,KAAK,CAAC,IAAI,CACR,KAAK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AAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;oCAC9B,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;oCACpD,KAAK,CAAC,IAAI,CACR,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,cAAc,EAAE,CAAC,CACzD,CAAC;gCACJ,CAAC,CAAC,CAAC;6BACJ;4BAED,OAAO,KAAK,CAAC;wBACf,CAAC;qBACF,CAAC,CAAC;iBACJ;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.js new file mode 100644 index 000000000..c61196c54 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.js @@ -0,0 +1,392 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +function isImportToken(token) { + return token.type === experimental_utils_1.AST_TOKEN_TYPES.Keyword && token.value === 'import'; +} +function isTypeToken(token) { + return token.type === experimental_utils_1.AST_TOKEN_TYPES.Identifier && token.value === 'type'; +} +exports.default = util.createRule({ + name: 'consistent-type-imports', + meta: { + type: 'suggestion', + docs: { + description: 'Enforces consistent usage of type imports', + category: 'Stylistic Issues', + recommended: false, + }, + messages: { + typeOverValue: 'All imports in the declaration are only used as types. Use `import type`', + someImportsAreOnlyTypes: 'Imports {{typeImports}} are only used as types', + aImportIsOnlyTypes: 'Import {{typeImports}} is only used as types', + valueOverType: 'Use an `import` instead of an `import type`.', + noImportTypeAnnotations: '`import()` type annotations are forbidden.', + }, + schema: [ + { + type: 'object', + properties: { + prefer: { + enum: ['type-imports', 'no-type-imports'], + }, + disallowTypeAnnotations: { + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], + fixable: 'code', + }, + defaultOptions: [ + { + prefer: 'type-imports', + disallowTypeAnnotations: true, + }, + ], + create(context, [option]) { + var _a; + const prefer = (_a = option.prefer) !== null && _a !== void 0 ? _a : 'type-imports'; + const disallowTypeAnnotations = option.disallowTypeAnnotations !== false; + const sourceCode = context.getSourceCode(); + const sourceImportsMap = {}; + return Object.assign(Object.assign({}, (prefer === 'type-imports' + ? { + // prefer type imports + ImportDeclaration(node) { + var _a; + const source = node.source.value; + const sourceImports = (_a = sourceImportsMap[source]) !== null && _a !== void 0 ? _a : (sourceImportsMap[source] = { + source, + reportValueImports: [], + typeOnlyNamedImport: null, + }); + if (node.importKind === 'type') { + if (!sourceImports.typeOnlyNamedImport && + node.specifiers.every(specifier => specifier.type === experimental_utils_1.AST_NODE_TYPES.ImportSpecifier)) { + sourceImports.typeOnlyNamedImport = node; + } + return; + } + // if importKind === 'value' + const typeSpecifiers = []; + const valueSpecifiers = []; + const unusedSpecifiers = []; + for (const specifier of node.specifiers) { + const [variable] = context.getDeclaredVariables(specifier); + if (variable.references.length === 0) { + unusedSpecifiers.push(specifier); + } + else { + const onlyHasTypeReferences = variable.references.every(ref => { + if (ref.isValueReference) { + // `type T = typeof foo` will create a value reference because "foo" must be a value type + // however this value reference is safe to use with type-only imports + let parent = ref.identifier.parent; + while (parent) { + if (parent.type === experimental_utils_1.AST_NODE_TYPES.TSTypeQuery) { + return true; + } + // TSTypeQuery must have a TSESTree.EntityName as its child, so we can filter here and break early + if (parent.type !== experimental_utils_1.AST_NODE_TYPES.TSQualifiedName) { + break; + } + parent = parent.parent; + } + return false; + } + return ref.isTypeReference; + }); + if (onlyHasTypeReferences) { + typeSpecifiers.push(specifier); + } + else { + valueSpecifiers.push(specifier); + } + } + } + if (typeSpecifiers.length) { + sourceImports.reportValueImports.push({ + node, + typeSpecifiers, + valueSpecifiers, + unusedSpecifiers, + }); + } + }, + 'Program:exit'() { + for (const sourceImports of Object.values(sourceImportsMap)) { + if (sourceImports.reportValueImports.length === 0) { + continue; + } + for (const report of sourceImports.reportValueImports) { + if (report.valueSpecifiers.length === 0 && + report.unusedSpecifiers.length === 0) { + // import is all type-only, convert the entire import to `import type` + context.report({ + node: report.node, + messageId: 'typeOverValue', + *fix(fixer) { + yield* fixToTypeImport(fixer, report, sourceImports); + }, + }); + } + else { + // we have a mixed type/value import, so we need to split them out into multiple exports + const typeImportNames = report.typeSpecifiers.map(specifier => `"${specifier.local.name}"`); + context.report({ + node: report.node, + messageId: typeImportNames.length === 1 + ? 'aImportIsOnlyTypes' + : 'someImportsAreOnlyTypes', + data: { + typeImports: typeImportNames.length === 1 + ? typeImportNames[0] + : [ + typeImportNames.slice(0, -1).join(', '), + typeImportNames.slice(-1)[0], + ].join(' and '), + }, + *fix(fixer) { + yield* fixToTypeImport(fixer, report, sourceImports); + }, + }); + } + } + } + }, + } + : { + // prefer no type imports + 'ImportDeclaration[importKind = "type"]'(node) { + context.report({ + node, + messageId: 'valueOverType', + fix(fixer) { + return fixToValueImport(fixer, node); + }, + }); + }, + })), (disallowTypeAnnotations + ? { + // disallow `import()` type + TSImportType(node) { + context.report({ + node, + messageId: 'noImportTypeAnnotations', + }); + }, + } + : {})); + function* fixToTypeImport(fixer, report, sourceImports) { + const { node } = report; + const defaultSpecifier = node.specifiers[0].type === experimental_utils_1.AST_NODE_TYPES.ImportDefaultSpecifier + ? node.specifiers[0] + : null; + const namespaceSpecifier = node.specifiers[0].type === experimental_utils_1.AST_NODE_TYPES.ImportNamespaceSpecifier + ? node.specifiers[0] + : null; + const namedSpecifiers = node.specifiers.filter((specifier) => specifier.type === experimental_utils_1.AST_NODE_TYPES.ImportSpecifier); + if (namespaceSpecifier) { + // e.g. + // import * as types from 'foo' + yield* fixToTypeImportByInsertType(fixer, node, false); + return; + } + else if (defaultSpecifier) { + if (report.typeSpecifiers.includes(defaultSpecifier) && + namedSpecifiers.length === 0) { + // e.g. + // import Type from 'foo' + yield* fixToTypeImportByInsertType(fixer, node, true); + return; + } + } + else { + if (namedSpecifiers.every(specifier => report.typeSpecifiers.includes(specifier))) { + // e.g. + // import {Type1, Type2} from 'foo' + yield* fixToTypeImportByInsertType(fixer, node, false); + return; + } + } + const typeNamedSpecifiers = namedSpecifiers.filter(specifier => report.typeSpecifiers.includes(specifier)); + const fixesNamedSpecifiers = getFixesNamedSpecifiers(typeNamedSpecifiers, namedSpecifiers); + const afterFixes = []; + if (typeNamedSpecifiers.length) { + if (sourceImports.typeOnlyNamedImport) { + const closingBraceToken = util.nullThrows(sourceCode.getFirstTokenBetween(sourceCode.getFirstToken(sourceImports.typeOnlyNamedImport), sourceImports.typeOnlyNamedImport.source, util.isClosingBraceToken), util.NullThrowsReasons.MissingToken('}', sourceImports.typeOnlyNamedImport.type)); + let insertText = fixesNamedSpecifiers.typeNamedSpecifiersText; + const before = sourceCode.getTokenBefore(closingBraceToken); + if (!util.isCommaToken(before) && !util.isOpeningBraceToken(before)) { + insertText = ',' + insertText; + } + // import type { Already, Type1, Type2 } from 'foo' + // ^^^^^^^^^^^^^ insert + const insertTypeNamedSpecifiers = fixer.insertTextBefore(closingBraceToken, insertText); + if (sourceImports.typeOnlyNamedImport.range[1] <= node.range[0]) { + yield insertTypeNamedSpecifiers; + } + else { + afterFixes.push(insertTypeNamedSpecifiers); + } + } + else { + yield fixer.insertTextBefore(node, `import type {${fixesNamedSpecifiers.typeNamedSpecifiersText}} from ${sourceCode.getText(node.source)};\n`); + } + } + if (defaultSpecifier && + report.typeSpecifiers.includes(defaultSpecifier)) { + if (typeNamedSpecifiers.length === namedSpecifiers.length) { + const importToken = util.nullThrows(sourceCode.getFirstToken(node, isImportToken), util.NullThrowsReasons.MissingToken('import', node.type)); + // import type Type from 'foo' + // ^^^^ insert + yield fixer.insertTextAfter(importToken, ' type'); + } + else { + yield fixer.insertTextBefore(node, `import type ${sourceCode.getText(defaultSpecifier)} from ${sourceCode.getText(node.source)};\n`); + // import Type , {...} from 'foo' + // ^^^^^^ remove + yield fixer.remove(defaultSpecifier); + yield fixer.remove(sourceCode.getTokenAfter(defaultSpecifier)); + } + } + yield* fixesNamedSpecifiers.removeTypeNamedSpecifiers; + yield* afterFixes; + /** + * Returns information for fixing named specifiers. + */ + function getFixesNamedSpecifiers(typeNamedSpecifiers, allNamedSpecifiers) { + const typeNamedSpecifiersTexts = []; + const removeTypeNamedSpecifiers = []; + if (typeNamedSpecifiers.length === allNamedSpecifiers.length) { + // e.g. + // import Foo, {Type1, Type2} from 'foo' + // import DefType, {Type1, Type2} from 'foo' + const openingBraceToken = util.nullThrows(sourceCode.getTokenBefore(typeNamedSpecifiers[0], util.isOpeningBraceToken), util.NullThrowsReasons.MissingToken('{', node.type)); + const commaToken = util.nullThrows(sourceCode.getTokenBefore(openingBraceToken, util.isCommaToken), util.NullThrowsReasons.MissingToken(',', node.type)); + const closingBraceToken = util.nullThrows(sourceCode.getFirstTokenBetween(openingBraceToken, node.source, util.isClosingBraceToken), util.NullThrowsReasons.MissingToken('}', node.type)); + // import DefType, {...} from 'foo' + // ^^^^^^^ remove + removeTypeNamedSpecifiers.push(fixer.removeRange([ + commaToken.range[0], + closingBraceToken.range[1], + ])); + typeNamedSpecifiersTexts.push(sourceCode.text.slice(openingBraceToken.range[1], closingBraceToken.range[0])); + } + else { + const typeNamedSpecifierGroups = []; + let group = []; + for (const namedSpecifier of allNamedSpecifiers) { + if (typeNamedSpecifiers.includes(namedSpecifier)) { + group.push(namedSpecifier); + } + else if (group.length) { + typeNamedSpecifierGroups.push(group); + group = []; + } + } + if (group.length) { + typeNamedSpecifierGroups.push(group); + } + for (const namedSpecifiers of typeNamedSpecifierGroups) { + const { removeRange, textRange } = getNamedSpecifierRanges(namedSpecifiers, allNamedSpecifiers); + removeTypeNamedSpecifiers.push(fixer.removeRange(removeRange)); + typeNamedSpecifiersTexts.push(sourceCode.text.slice(...textRange)); + } + } + return { + typeNamedSpecifiersText: typeNamedSpecifiersTexts.join(','), + removeTypeNamedSpecifiers, + }; + } + /** + * Returns ranges for fixing named specifier. + */ + function getNamedSpecifierRanges(namedSpecifierGroup, allNamedSpecifiers) { + const first = namedSpecifierGroup[0]; + const last = namedSpecifierGroup[namedSpecifierGroup.length - 1]; + const removeRange = [first.range[0], last.range[1]]; + const textRange = [...removeRange]; + const before = sourceCode.getTokenBefore(first); + textRange[0] = before.range[1]; + if (util.isCommaToken(before)) { + removeRange[0] = before.range[0]; + } + else { + removeRange[0] = before.range[1]; + } + const isFirst = allNamedSpecifiers[0] === first; + const isLast = allNamedSpecifiers[allNamedSpecifiers.length - 1] === last; + const after = sourceCode.getTokenAfter(last); + textRange[1] = after.range[0]; + if (isFirst || isLast) { + if (util.isCommaToken(after)) { + removeRange[1] = after.range[1]; + } + } + return { + textRange, + removeRange, + }; + } + } + function* fixToTypeImportByInsertType(fixer, node, isDefaultImport) { + // import type Foo from 'foo' + // ^^^^^ insert + const importToken = util.nullThrows(sourceCode.getFirstToken(node, isImportToken), util.NullThrowsReasons.MissingToken('import', node.type)); + yield fixer.insertTextAfter(importToken, ' type'); + if (isDefaultImport) { + // Has default import + const openingBraceToken = sourceCode.getFirstTokenBetween(importToken, node.source, util.isOpeningBraceToken); + if (openingBraceToken) { + // Only braces. e.g. import Foo, {} from 'foo' + const commaToken = util.nullThrows(sourceCode.getTokenBefore(openingBraceToken, util.isCommaToken), util.NullThrowsReasons.MissingToken(',', node.type)); + const closingBraceToken = util.nullThrows(sourceCode.getFirstTokenBetween(openingBraceToken, node.source, util.isClosingBraceToken), util.NullThrowsReasons.MissingToken('}', node.type)); + // import type Foo, {} from 'foo' + // ^^ remove + yield fixer.removeRange([ + commaToken.range[0], + closingBraceToken.range[1], + ]); + const specifiersText = sourceCode.text.slice(commaToken.range[1], closingBraceToken.range[1]); + if (node.specifiers.length > 1) { + // import type Foo from 'foo' + // import type {...} from 'foo' // <- insert + yield fixer.insertTextAfter(node, `\nimport type${specifiersText} from ${sourceCode.getText(node.source)};`); + } + } + } + } + function fixToValueImport(fixer, node) { + var _a, _b; + // import type Foo from 'foo' + // ^^^^ remove + const importToken = util.nullThrows(sourceCode.getFirstToken(node, isImportToken), util.NullThrowsReasons.MissingToken('import', node.type)); + const typeToken = util.nullThrows(sourceCode.getFirstTokenBetween(importToken, (_b = (_a = node.specifiers[0]) === null || _a === void 0 ? void 0 : _a.local) !== null && _b !== void 0 ? _b : node.source, isTypeToken), util.NullThrowsReasons.MissingToken('type', node.type)); + return fixer.remove(typeToken); + } + }, +}); +//# sourceMappingURL=consistent-type-imports.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.js.map new file mode 100644 index 000000000..ce74bfdb2 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.js.map @@ -0,0 +1 @@ +{"version":3,"file":"consistent-type-imports.js","sourceRoot":"","sources":["../../src/rules/consistent-type-imports.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAK+C;AAC/C,8CAAgC;AAwBhC,SAAS,aAAa,CACpB,KAAwC;IAExC,OAAO,KAAK,CAAC,IAAI,KAAK,oCAAe,CAAC,OAAO,IAAI,KAAK,CAAC,KAAK,KAAK,QAAQ,CAAC;AAC5E,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,CAAC,CAC3B,CAAC;oBACF,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;wBAC9B,6BAA6B;wBAC7B,4CAA4C;wBAC5C,MAAM,KAAK,CAAC,eAAe,CACzB,IAAI,EACJ,gBAAgB,cAAc,SAAS,UAAU,CAAC,OAAO,CACvD,IAAI,CAAC,MAAM,CACZ,GAAG,CACL,CAAC;qBACH;iBACF;aACF;QACH,CAAC;QAED,SAAS,gBAAgB,CACvB,KAAyB,EACzB,IAAgC;;YAEhC,6BAA6B;YAC7B,qBAAqB;YACrB,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CACjC,UAAU,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,EAC7C,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CACzD,CAAC;YACF,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAC/B,UAAU,CAAC,oBAAoB,CAC7B,WAAW,cACX,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,0CAAE,KAAK,mCAAI,IAAI,CAAC,MAAM,EACxC,WAAW,CACZ,EACD,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CACvD,CAAC;YACF,OAAO,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/default-param-last.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/default-param-last.js new file mode 100644 index 000000000..95769d056 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/default-param-last.js @@ -0,0 +1,65 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../util"); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +exports.default = util_1.createRule({ + name: 'default-param-last', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce default parameters to be last', + category: 'Best Practices', + recommended: false, + extendsBaseRule: true, + }, + schema: [], + messages: { + shouldBeLast: 'Default parameters should be last.', + }, + }, + defaultOptions: [], + create(context) { + /** + * checks if node is optional parameter + * @param node the node to be evaluated + * @private + */ + function isOptionalParam(node) { + return 'optional' in node && node.optional === true; + } + /** + * checks if node is plain parameter + * @param node the node to be evaluated + * @private + */ + function isPlainParam(node) { + return !(node.type === experimental_utils_1.AST_NODE_TYPES.AssignmentPattern || + node.type === experimental_utils_1.AST_NODE_TYPES.RestElement || + isOptionalParam(node)); + } + function checkDefaultParamLast(node) { + let hasSeenPlainParam = false; + for (let i = node.params.length - 1; i >= 0; i--) { + const current = node.params[i]; + const param = current.type === experimental_utils_1.AST_NODE_TYPES.TSParameterProperty + ? current.parameter + : current; + if (isPlainParam(param)) { + hasSeenPlainParam = true; + continue; + } + if (hasSeenPlainParam && + (isOptionalParam(param) || + param.type === experimental_utils_1.AST_NODE_TYPES.AssignmentPattern)) { + context.report({ node: current, messageId: 'shouldBeLast' }); + } + } + } + return { + ArrowFunctionExpression: checkDefaultParamLast, + FunctionDeclaration: checkDefaultParamLast, + FunctionExpression: checkDefaultParamLast, + }; + }, +}); +//# sourceMappingURL=default-param-last.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/default-param-last.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/default-param-last.js.map new file mode 100644 index 000000000..00180529d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/default-param-last.js.map @@ -0,0 +1 @@ +{"version":3,"file":"default-param-last.js","sourceRoot":"","sources":["../../src/rules/default-param-last.ts"],"names":[],"mappings":";;AAAA,kCAAqC;AACrC,8EAG+C;AAE/C,kBAAe,iBAAU,CAAC;IACxB,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;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AAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC,CAAC;iBAC9D;aACF;QACH,CAAC;QAED,OAAO;YACL,uBAAuB,EAAE,qBAAqB;YAC9C,mBAAmB,EAAE,qBAAqB;YAC1C,kBAAkB,EAAE,qBAAqB;SAC1C,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/dot-notation.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/dot-notation.js new file mode 100644 index 000000000..a4a89d0a8 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/dot-notation.js @@ -0,0 +1,90 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const ts = __importStar(require("typescript")); +const dot_notation_1 = __importDefault(require("eslint/lib/rules/dot-notation")); +const util_1 = require("../util"); +exports.default = util_1.createRule({ + name: 'dot-notation', + meta: { + type: 'suggestion', + docs: { + description: 'enforce dot notation whenever possible', + category: 'Best Practices', + recommended: false, + extendsBaseRule: true, + requiresTypeChecking: true, + }, + schema: [ + { + type: 'object', + properties: { + allowKeywords: { + type: 'boolean', + default: true, + }, + allowPattern: { + type: 'string', + default: '', + }, + allowPrivateClassPropertyAccess: { + type: 'boolean', + default: false, + }, + }, + additionalProperties: false, + }, + ], + fixable: dot_notation_1.default.meta.fixable, + messages: dot_notation_1.default.meta.messages, + }, + defaultOptions: [ + { + allowPrivateClassPropertyAccess: false, + allowKeywords: true, + allowPattern: '', + }, + ], + create(context, [options]) { + const rules = dot_notation_1.default.create(context); + const allowPrivateClassPropertyAccess = options.allowPrivateClassPropertyAccess; + const parserServices = util_1.getParserServices(context); + const typeChecker = parserServices.program.getTypeChecker(); + return { + MemberExpression(node) { + var _a, _b, _c; + if (allowPrivateClassPropertyAccess && node.computed) { + // for perf reasons - only fetch the symbol if we have to + const objectSymbol = typeChecker.getSymbolAtLocation(parserServices.esTreeNodeToTSNodeMap.get(node.property)); + if (((_c = (_b = (_a = objectSymbol === null || objectSymbol === void 0 ? void 0 : objectSymbol.getDeclarations()) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.modifiers) === null || _c === void 0 ? void 0 : _c[0].kind) === + ts.SyntaxKind.PrivateKeyword) { + return; + } + } + rules.MemberExpression(node); + }, + }; + }, +}); +//# sourceMappingURL=dot-notation.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/dot-notation.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/dot-notation.js.map new file mode 100644 index 000000000..297244e7d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/dot-notation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dot-notation.js","sourceRoot":"","sources":["../../src/rules/dot-notation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAAiC;AACjC,iFAAqD;AACrD,kCAKiB;AAKjB,kBAAe,iBAAU,CAAsB;IAC7C,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EA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mBAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,eAAe,4CAAK,CAAC,2CAAG,SAAS,0CAAG,CAAC,EAAE,IAAI;wBACzD,EAAE,CAAC,UAAU,CAAC,cAAc,EAC5B;wBACA,OAAO;qBACR;iBACF;gBACD,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;YAC/B,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.js new file mode 100644 index 000000000..5f3916806 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.js @@ -0,0 +1,97 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +const explicitReturnTypeUtils_1 = require("../util/explicitReturnTypeUtils"); +exports.default = util.createRule({ + name: 'explicit-function-return-type', + meta: { + type: 'problem', + docs: { + description: 'Require explicit return types on functions and class methods', + category: 'Stylistic Issues', + recommended: false, + }, + messages: { + missingReturnType: 'Missing return type on function.', + }, + schema: [ + { + type: 'object', + properties: { + allowExpressions: { + type: 'boolean', + }, + allowTypedFunctionExpressions: { + type: 'boolean', + }, + allowHigherOrderFunctions: { + type: 'boolean', + }, + allowDirectConstAssertionInArrowFunctions: { + type: 'boolean', + }, + allowConciseArrowFunctionExpressionsStartingWithVoid: { + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], + }, + defaultOptions: [ + { + allowExpressions: false, + allowTypedFunctionExpressions: true, + allowHigherOrderFunctions: true, + allowDirectConstAssertionInArrowFunctions: true, + allowConciseArrowFunctionExpressionsStartingWithVoid: false, + }, + ], + create(context, [options]) { + const sourceCode = context.getSourceCode(); + return { + 'ArrowFunctionExpression, FunctionExpression'(node) { + if (options.allowConciseArrowFunctionExpressionsStartingWithVoid && + node.type === experimental_utils_1.AST_NODE_TYPES.ArrowFunctionExpression && + node.expression && + node.body.type === experimental_utils_1.AST_NODE_TYPES.UnaryExpression && + node.body.operator === 'void') { + return; + } + explicitReturnTypeUtils_1.checkFunctionExpressionReturnType(node, options, sourceCode, loc => context.report({ + node, + loc, + messageId: 'missingReturnType', + })); + }, + FunctionDeclaration(node) { + explicitReturnTypeUtils_1.checkFunctionReturnType(node, options, sourceCode, loc => context.report({ + node, + loc, + messageId: 'missingReturnType', + })); + }, + }; + }, +}); +//# sourceMappingURL=explicit-function-return-type.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.js.map new file mode 100644 index 000000000..6384a05eb --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.js.map @@ -0,0 +1 @@ +{"version":3,"file":"explicit-function-return-type.js","sourceRoot":"","sources":["../../src/rules/explicit-function-return-type.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,8CAAgC;AAChC,6EAGyC;AAazC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD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ACjE,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI;oBACJ,GAAG;oBACH,SAAS,EAAE,mBAAmB;iBAC/B,CAAC,CACH,CAAC;YACJ,CAAC;YACD,mBAAmB,CAAC,IAAI;gBACtB,iDAAuB,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,CACvD,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI;oBACJ,GAAG;oBACH,SAAS,EAAE,mBAAmB;iBAC/B,CAAC,CACH,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.js new file mode 100644 index 000000000..d6d706306 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.js @@ -0,0 +1,209 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +const accessibilityLevel = { enum: ['explicit', 'no-public', 'off'] }; +exports.default = util.createRule({ + name: 'explicit-member-accessibility', + meta: { + type: 'problem', + docs: { + description: 'Require explicit accessibility modifiers on class properties and methods', + category: 'Stylistic Issues', + // too opinionated to be recommended + recommended: false, + }, + fixable: 'code', + messages: { + missingAccessibility: 'Missing accessibility modifier on {{type}} {{name}}.', + unwantedPublicAccessibility: 'Public accessibility modifier on {{type}} {{name}}.', + }, + schema: [ + { + type: 'object', + properties: { + accessibility: accessibilityLevel, + overrides: { + type: 'object', + properties: { + accessors: accessibilityLevel, + constructors: accessibilityLevel, + methods: accessibilityLevel, + properties: accessibilityLevel, + parameterProperties: accessibilityLevel, + }, + additionalProperties: false, + }, + ignoredMethodNames: { + type: 'array', + items: { + type: 'string', + }, + }, + }, + additionalProperties: false, + }, + ], + }, + defaultOptions: [{ accessibility: 'explicit' }], + create(context, [option]) { + var _a, _b, _c, _d, _e, _f, _g, _h; + const sourceCode = context.getSourceCode(); + const baseCheck = (_a = option.accessibility) !== null && _a !== void 0 ? _a : 'explicit'; + const overrides = (_b = option.overrides) !== null && _b !== void 0 ? _b : {}; + const ctorCheck = (_c = overrides.constructors) !== null && _c !== void 0 ? _c : baseCheck; + const accessorCheck = (_d = overrides.accessors) !== null && _d !== void 0 ? _d : baseCheck; + const methodCheck = (_e = overrides.methods) !== null && _e !== void 0 ? _e : baseCheck; + const propCheck = (_f = overrides.properties) !== null && _f !== void 0 ? _f : baseCheck; + const paramPropCheck = (_g = overrides.parameterProperties) !== null && _g !== void 0 ? _g : baseCheck; + const ignoredMethodNames = new Set((_h = option.ignoredMethodNames) !== null && _h !== void 0 ? _h : []); + /** + * Generates the report for rule violations + */ + function reportIssue(messageId, nodeType, node, nodeName, fix = null) { + context.report({ + node: node, + messageId: messageId, + data: { + type: nodeType, + name: nodeName, + }, + fix: fix, + }); + } + /** + * Checks if a method declaration has an accessibility modifier. + * @param methodDefinition The node representing a MethodDefinition. + */ + function checkMethodAccessibilityModifier(methodDefinition) { + let nodeType = 'method definition'; + let check = baseCheck; + switch (methodDefinition.kind) { + case 'method': + check = methodCheck; + break; + case 'constructor': + check = ctorCheck; + break; + case 'get': + case 'set': + check = accessorCheck; + nodeType = `${methodDefinition.kind} property accessor`; + break; + } + const methodName = util.getNameFromMember(methodDefinition, sourceCode); + if (check === 'off' || ignoredMethodNames.has(methodName)) { + return; + } + if (check === 'no-public' && + methodDefinition.accessibility === 'public') { + reportIssue('unwantedPublicAccessibility', nodeType, methodDefinition, methodName, getUnwantedPublicAccessibilityFixer(methodDefinition)); + } + else if (check === 'explicit' && !methodDefinition.accessibility) { + reportIssue('missingAccessibility', nodeType, methodDefinition, methodName); + } + } + /** + * Creates a fixer that removes a "public" keyword with following spaces + */ + function getUnwantedPublicAccessibilityFixer(node) { + return function (fixer) { + const tokens = sourceCode.getTokens(node); + let rangeToRemove; + for (let i = 0; i < tokens.length; i++) { + const token = tokens[i]; + if (token.type === experimental_utils_1.AST_TOKEN_TYPES.Keyword && + token.value === 'public') { + const commensAfterPublicKeyword = sourceCode.getCommentsAfter(token); + if (commensAfterPublicKeyword.length) { + // public /* Hi there! */ static foo() + // ^^^^^^^ + rangeToRemove = [ + token.range[0], + commensAfterPublicKeyword[0].range[0], + ]; + break; + } + else { + // public static foo() + // ^^^^^^^ + rangeToRemove = [token.range[0], tokens[i + 1].range[0]]; + break; + } + } + } + return fixer.removeRange(rangeToRemove); + }; + } + /** + * Checks if property has an accessibility modifier. + * @param classProperty The node representing a ClassProperty. + */ + function checkPropertyAccessibilityModifier(classProperty) { + const nodeType = 'class property'; + const propertyName = util.getNameFromMember(classProperty, sourceCode); + if (propCheck === 'no-public' && + classProperty.accessibility === 'public') { + reportIssue('unwantedPublicAccessibility', nodeType, classProperty, propertyName, getUnwantedPublicAccessibilityFixer(classProperty)); + } + else if (propCheck === 'explicit' && !classProperty.accessibility) { + reportIssue('missingAccessibility', nodeType, classProperty, propertyName); + } + } + /** + * Checks that the parameter property has the desired accessibility modifiers set. + * @param node The node representing a Parameter Property + */ + function checkParameterPropertyAccessibilityModifier(node) { + const nodeType = 'parameter property'; + // HAS to be an identifier or assignment or TSC will throw + if (node.parameter.type !== experimental_utils_1.AST_NODE_TYPES.Identifier && + node.parameter.type !== experimental_utils_1.AST_NODE_TYPES.AssignmentPattern) { + return; + } + const nodeName = node.parameter.type === experimental_utils_1.AST_NODE_TYPES.Identifier + ? node.parameter.name + : // has to be an Identifier or TSC will throw an error + node.parameter.left.name; + switch (paramPropCheck) { + case 'explicit': { + if (!node.accessibility) { + reportIssue('missingAccessibility', nodeType, node, nodeName); + } + break; + } + case 'no-public': { + if (node.accessibility === 'public' && node.readonly) { + reportIssue('unwantedPublicAccessibility', nodeType, node, nodeName, getUnwantedPublicAccessibilityFixer(node)); + } + break; + } + } + } + return { + TSParameterProperty: checkParameterPropertyAccessibilityModifier, + ClassProperty: checkPropertyAccessibilityModifier, + MethodDefinition: checkMethodAccessibilityModifier, + }; + }, +}); +//# sourceMappingURL=explicit-member-accessibility.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.js.map new file mode 100644 index 000000000..ba2416f7b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.js.map @@ -0,0 +1 @@ +{"version":3,"file":"explicit-member-accessibility.js","sourceRoot":"","sources":["../../src/rules/explicit-member-accessibility.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAK+C;AAC/C,8CAAgC;AAuBhC,MAAM,kBAAkB,GAAG,EAAE,IAAI,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC;AAEtE,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,+BAA+B;IACrC,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EACT,0EAA0E;YAC5E,QAAQ,EAAE,kBAAkB;YAC5B,oCAAoC;YACpC,WAAW,EAAE,KAAK;SACn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ACR,mCAAmC,CAAC,IAAI,CAAC,CAC1C,CAAC;qBACH;oBACD,MAAM;iBACP;aACF;QACH,CAAC;QAED,OAAO;YACL,mBAAmB,EAAE,2CAA2C;YAChE,aAAa,EAAE,kCAAkC;YACjD,gBAAgB,EAAE,gCAAgC;SACnD,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types.js new file mode 100644 index 000000000..61858dcc2 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types.js @@ -0,0 +1,412 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +const explicitReturnTypeUtils_1 = require("../util/explicitReturnTypeUtils"); +exports.default = util.createRule({ + name: 'explicit-module-boundary-types', + meta: { + type: 'problem', + docs: { + description: "Require explicit return and argument types on exported functions' and classes' public class methods", + category: 'Stylistic Issues', + recommended: 'warn', + }, + messages: { + missingReturnType: 'Missing return type on function.', + missingArgType: "Argument '{{name}}' should be typed.", + missingArgTypeUnnamed: '{{type}} argument should be typed.', + anyTypedArg: "Argument '{{name}}' should be typed with a non-any type.", + anyTypedArgUnnamed: '{{type}} argument should be typed with a non-any type.', + }, + schema: [ + { + type: 'object', + properties: { + allowArgumentsExplicitlyTypedAsAny: { + type: 'boolean', + }, + allowDirectConstAssertionInArrowFunctions: { + type: 'boolean', + }, + allowedNames: { + type: 'array', + items: { + type: 'string', + }, + }, + allowHigherOrderFunctions: { + type: 'boolean', + }, + allowTypedFunctionExpressions: { + type: 'boolean', + }, + // DEPRECATED - To be removed in next major + shouldTrackReferences: { + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], + }, + defaultOptions: [ + { + allowArgumentsExplicitlyTypedAsAny: false, + allowDirectConstAssertionInArrowFunctions: true, + allowedNames: [], + allowHigherOrderFunctions: true, + allowTypedFunctionExpressions: true, + }, + ], + create(context, [options]) { + const sourceCode = context.getSourceCode(); + // tracks all of the functions we've already checked + const checkedFunctions = new Set(); + // tracks functions that were found whilst traversing + const foundFunctions = []; + // all nodes visited, avoids infinite recursion for cyclic references + // (such as class member referring to itself) + const alreadyVisited = new Set(); + /* + # How the rule works: + + As the rule traverses the AST, it immediately checks every single function that it finds is exported. + "exported" means that it is either directly exported, or that its name is exported. + + It also collects a list of every single function it finds on the way, but does not check them. + After it's finished traversing the AST, it then iterates through the list of found functions, and checks to see if + any of them are part of a higher-order function + */ + return { + ExportDefaultDeclaration(node) { + checkNode(node.declaration); + }, + 'ExportNamedDeclaration:not([source])'(node) { + if (node.declaration) { + checkNode(node.declaration); + } + else { + for (const specifier of node.specifiers) { + followReference(specifier.local); + } + } + }, + TSExportAssignment(node) { + checkNode(node.expression); + }, + 'ArrowFunctionExpression, FunctionDeclaration, FunctionExpression'(node) { + foundFunctions.push(node); + }, + 'Program:exit'() { + for (const func of foundFunctions) { + if (isExportedHigherOrderFunction(func)) { + checkNode(func); + } + } + }, + }; + function checkParameters(node) { + function checkParameter(param) { + function report(namedMessageId, unnamedMessageId) { + if (param.type === experimental_utils_1.AST_NODE_TYPES.Identifier) { + context.report({ + node: param, + messageId: namedMessageId, + data: { name: param.name }, + }); + } + else if (param.type === experimental_utils_1.AST_NODE_TYPES.ArrayPattern) { + context.report({ + node: param, + messageId: unnamedMessageId, + data: { type: 'Array pattern' }, + }); + } + else if (param.type === experimental_utils_1.AST_NODE_TYPES.ObjectPattern) { + context.report({ + node: param, + messageId: unnamedMessageId, + data: { type: 'Object pattern' }, + }); + } + else if (param.type === experimental_utils_1.AST_NODE_TYPES.RestElement) { + if (param.argument.type === experimental_utils_1.AST_NODE_TYPES.Identifier) { + context.report({ + node: param, + messageId: namedMessageId, + data: { name: param.argument.name }, + }); + } + else { + context.report({ + node: param, + messageId: unnamedMessageId, + data: { type: 'Rest' }, + }); + } + } + } + switch (param.type) { + case experimental_utils_1.AST_NODE_TYPES.ArrayPattern: + case experimental_utils_1.AST_NODE_TYPES.Identifier: + case experimental_utils_1.AST_NODE_TYPES.ObjectPattern: + case experimental_utils_1.AST_NODE_TYPES.RestElement: + if (!param.typeAnnotation) { + report('missingArgType', 'missingArgTypeUnnamed'); + } + else if (options.allowArgumentsExplicitlyTypedAsAny !== true && + param.typeAnnotation.typeAnnotation.type === + experimental_utils_1.AST_NODE_TYPES.TSAnyKeyword) { + report('anyTypedArg', 'anyTypedArgUnnamed'); + } + return; + case experimental_utils_1.AST_NODE_TYPES.TSParameterProperty: + return checkParameter(param.parameter); + case experimental_utils_1.AST_NODE_TYPES.AssignmentPattern: // ignored as it has a type via its assignment + return; + } + } + for (const arg of node.params) { + checkParameter(arg); + } + } + /** + * Checks if a function name is allowed and should not be checked. + */ + function isAllowedName(node) { + if (!node || !options.allowedNames || !options.allowedNames.length) { + return false; + } + if (node.type === experimental_utils_1.AST_NODE_TYPES.VariableDeclarator) { + return (node.id.type === experimental_utils_1.AST_NODE_TYPES.Identifier && + options.allowedNames.includes(node.id.name)); + } + else if (node.type === experimental_utils_1.AST_NODE_TYPES.MethodDefinition || + node.type === experimental_utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition) { + if (node.key.type === experimental_utils_1.AST_NODE_TYPES.Literal && + typeof node.key.value === 'string') { + return options.allowedNames.includes(node.key.value); + } + if (node.key.type === experimental_utils_1.AST_NODE_TYPES.TemplateLiteral && + node.key.expressions.length === 0) { + return options.allowedNames.includes(node.key.quasis[0].value.raw); + } + if (!node.computed && node.key.type === experimental_utils_1.AST_NODE_TYPES.Identifier) { + return options.allowedNames.includes(node.key.name); + } + } + return false; + } + function isExportedHigherOrderFunction(node) { + var _a; + let current = node.parent; + while (current) { + if (current.type === experimental_utils_1.AST_NODE_TYPES.ReturnStatement) { + // the parent of a return will always be a block statement, so we can skip over it + current = (_a = current.parent) === null || _a === void 0 ? void 0 : _a.parent; + continue; + } + if (!util.isFunction(current) || + !explicitReturnTypeUtils_1.doesImmediatelyReturnFunctionExpression(current)) { + return false; + } + if (checkedFunctions.has(current)) { + return true; + } + current = current.parent; + } + return false; + } + function followReference(node) { + const scope = context.getScope(); + const variable = scope.set.get(node.name); + /* istanbul ignore if */ if (!variable) { + return; + } + // check all of the definitions + for (const definition of variable.defs) { + // cases we don't care about in this rule + if (definition.type === 'ImplicitGlobalVariable' || + definition.type === 'ImportBinding' || + // eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum + definition.type === 'CatchClause' || + definition.type === 'Parameter') { + continue; + } + checkNode(definition.node); + } + // follow references to find writes to the variable + for (const reference of variable.references) { + if ( + // we don't want to check the initialization ref, as this is handled by the declaration check + !reference.init && + reference.writeExpr) { + checkNode(reference.writeExpr); + } + } + } + function checkNode(node) { + if (node == null || alreadyVisited.has(node)) { + return; + } + alreadyVisited.add(node); + switch (node.type) { + case experimental_utils_1.AST_NODE_TYPES.ArrowFunctionExpression: + case experimental_utils_1.AST_NODE_TYPES.FunctionExpression: + return checkFunctionExpression(node); + case experimental_utils_1.AST_NODE_TYPES.ArrayExpression: + for (const element of node.elements) { + checkNode(element); + } + return; + case experimental_utils_1.AST_NODE_TYPES.ClassProperty: + case experimental_utils_1.AST_NODE_TYPES.TSAbstractClassProperty: + if (node.accessibility === 'private') { + return; + } + return checkNode(node.value); + case experimental_utils_1.AST_NODE_TYPES.ClassDeclaration: + case experimental_utils_1.AST_NODE_TYPES.ClassExpression: + for (const element of node.body.body) { + checkNode(element); + } + return; + case experimental_utils_1.AST_NODE_TYPES.FunctionDeclaration: + return checkFunction(node); + case experimental_utils_1.AST_NODE_TYPES.MethodDefinition: + case experimental_utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition: + if (node.accessibility === 'private') { + return; + } + return checkNode(node.value); + case experimental_utils_1.AST_NODE_TYPES.Identifier: + return followReference(node); + case experimental_utils_1.AST_NODE_TYPES.ObjectExpression: + for (const property of node.properties) { + checkNode(property); + } + return; + case experimental_utils_1.AST_NODE_TYPES.Property: + return checkNode(node.value); + case experimental_utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression: + return checkEmptyBodyFunctionExpression(node); + case experimental_utils_1.AST_NODE_TYPES.VariableDeclaration: + for (const declaration of node.declarations) { + checkNode(declaration); + } + return; + case experimental_utils_1.AST_NODE_TYPES.VariableDeclarator: + return checkNode(node.init); + } + } + /** + * Check whether any ancestor of the provided function has a valid return type. + * This function assumes that the function either: + * - belongs to an exported function chain validated by isExportedHigherOrderFunction + * - is directly exported itself + */ + function ancestorHasReturnType(node) { + let ancestor = node.parent; + // if the ancestor is not a return, then this function was not returned at all, so we can exit early + const isReturnStatement = (ancestor === null || ancestor === void 0 ? void 0 : ancestor.type) === experimental_utils_1.AST_NODE_TYPES.ReturnStatement; + const isBodylessArrow = (ancestor === null || ancestor === void 0 ? void 0 : ancestor.type) === experimental_utils_1.AST_NODE_TYPES.ArrowFunctionExpression && + ancestor.body.type !== experimental_utils_1.AST_NODE_TYPES.BlockStatement; + if (!isReturnStatement && !isBodylessArrow) { + return false; + } + while (ancestor) { + switch (ancestor.type) { + case experimental_utils_1.AST_NODE_TYPES.ArrowFunctionExpression: + case experimental_utils_1.AST_NODE_TYPES.FunctionExpression: + case experimental_utils_1.AST_NODE_TYPES.FunctionDeclaration: + if (ancestor.returnType) { + return true; + } + // assume + break; + // const x: Foo = () => {}; + // Assume that a typed variable types the function expression + case experimental_utils_1.AST_NODE_TYPES.VariableDeclarator: + if (ancestor.id.typeAnnotation) { + return true; + } + break; + } + ancestor = ancestor.parent; + } + return false; + } + function checkEmptyBodyFunctionExpression(node) { + var _a, _b, _c; + const isConstructor = ((_a = node.parent) === null || _a === void 0 ? void 0 : _a.type) === experimental_utils_1.AST_NODE_TYPES.MethodDefinition && + node.parent.kind === 'constructor'; + const isSetAccessor = (((_b = node.parent) === null || _b === void 0 ? void 0 : _b.type) === experimental_utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition || + ((_c = node.parent) === null || _c === void 0 ? void 0 : _c.type) === experimental_utils_1.AST_NODE_TYPES.MethodDefinition) && + node.parent.kind === 'set'; + if (!isConstructor && !isSetAccessor && !node.returnType) { + context.report({ + node, + messageId: 'missingReturnType', + }); + } + checkParameters(node); + } + function checkFunctionExpression(node) { + if (checkedFunctions.has(node)) { + return; + } + checkedFunctions.add(node); + if (isAllowedName(node.parent) || + explicitReturnTypeUtils_1.isTypedFunctionExpression(node, options) || + ancestorHasReturnType(node)) { + return; + } + explicitReturnTypeUtils_1.checkFunctionExpressionReturnType(node, options, sourceCode, loc => { + context.report({ + node, + loc, + messageId: 'missingReturnType', + }); + }); + checkParameters(node); + } + function checkFunction(node) { + if (checkedFunctions.has(node)) { + return; + } + checkedFunctions.add(node); + if (isAllowedName(node.parent) || ancestorHasReturnType(node)) { + return; + } + explicitReturnTypeUtils_1.checkFunctionReturnType(node, options, sourceCode, loc => { + context.report({ + node, + loc, + messageId: 'missingReturnType', + }); + }); + checkParameters(node); + } + }, +}); +//# sourceMappingURL=explicit-module-boundary-types.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types.js.map new file mode 100644 index 000000000..564b7928f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"explicit-module-boundary-types.js","sourceRoot":"","sources":["../../src/rules/explicit-module-boundary-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,8CAAgC;AAChC,6EAOyC;AAmBzC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,gCAAgC;IACtC,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EACT,qGAAqG;YACvG,QAAQ,EAAE,kBAAkB;YAC5B,WAAW,EAAE,MAAM;SACpB;QACD,QAAQ,EAAE;YACR,iBAAiB,EAAE,kCAAkC;YACrD,cAAc,EAAE,sCAAsC;YACtD,qBAAqB,EAAE,oCAAoC;YAC3D,WAAW,EAAE,0DAA0D;YACvE,kBAAkB,EAChB,wDAAwD;SAC3D;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,kCAAkC,EAAE;wBAClC,IAAI,EAAE,SAAS;qBAChB;oBACD,yCAAyC,EAAE;wBACzC,IAAI,EAAE,SAAS;qBAChB;oBACD,YAAY,EAAE;wBACZ,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE;4BACL,IAAI,EAAE,QAAQ;yBACf;qBACF;oBACD,yBAAyB,EAAE;wBACzB,IAAI,EAAE,SAAS;qBAChB;oBACD,6BAA6B,EAAE;wBAC7B,IAAI,EAAE,SAAS;qBAChB;oBACD,2CAA2C;oBAC3C,qBAAqB,EAAE;wBACrB,IAAI,EAAE,SAAS;qBAChB;iBACF;gBACD,oBAAoB,EAAE,KAAK;aAC5B;SACF;KACF;IACD,cAAc,EAAE;QACd;YACE,kCAAkC,EAAE,KAAK;YACzC,yCAAyC,EAAE,IAAI;YAC/C,YAAY,EAA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I,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;gBAC9B,OAAO;aACR;YACD,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAE3B,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,qBAAqB,CAAC,IAAI,CAAC,EAAE;gBAC7D,OAAO;aACR;YAED,iDAAuB,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE;gBACvD,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI;oBACJ,GAAG;oBACH,SAAS,EAAE,mBAAmB;iBAC/B,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,eAAe,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC;IACH,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/func-call-spacing.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/func-call-spacing.js new file mode 100644 index 000000000..ab51deeac --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/func-call-spacing.js @@ -0,0 +1,165 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'func-call-spacing', + meta: { + type: 'layout', + docs: { + description: 'Require or disallow spacing between function identifiers and their invocations', + category: 'Stylistic Issues', + recommended: false, + extendsBaseRule: true, + }, + fixable: 'whitespace', + schema: { + anyOf: [ + { + type: 'array', + items: [ + { + enum: ['never'], + }, + ], + minItems: 0, + maxItems: 1, + }, + { + type: 'array', + items: [ + { + enum: ['always'], + }, + { + type: 'object', + properties: { + allowNewlines: { + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], + minItems: 0, + maxItems: 2, + }, + ], + }, + messages: { + unexpectedWhitespace: 'Unexpected whitespace between function name and paren.', + unexpectedNewline: 'Unexpected newline between function name and paren.', + missing: 'Missing space between function name and paren.', + }, + }, + defaultOptions: ['never', {}], + create(context, [option, config]) { + const sourceCode = context.getSourceCode(); + const text = sourceCode.getText(); + /** + * Check if open space is present in a function name + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkSpacing(node) { + var _a; + const isOptionalCall = util.isOptionalCallExpression(node); + const closingParenToken = sourceCode.getLastToken(node); + const lastCalleeTokenWithoutPossibleParens = sourceCode.getLastToken((_a = node.typeParameters) !== null && _a !== void 0 ? _a : node.callee); + const openingParenToken = sourceCode.getFirstTokenBetween(lastCalleeTokenWithoutPossibleParens, closingParenToken, util.isOpeningParenToken); + if (!openingParenToken || openingParenToken.range[1] >= node.range[1]) { + // new expression with no parens... + return; + } + const lastCalleeToken = sourceCode.getTokenBefore(openingParenToken, util.isNotOptionalChainPunctuator); + const textBetweenTokens = text + .slice(lastCalleeToken.range[1], openingParenToken.range[0]) + .replace(/\/\*.*?\*\//gu, ''); + const hasWhitespace = /\s/u.test(textBetweenTokens); + const hasNewline = hasWhitespace && util.LINEBREAK_MATCHER.test(textBetweenTokens); + if (option === 'never') { + if (hasWhitespace) { + return context.report({ + node, + loc: lastCalleeToken.loc.start, + messageId: 'unexpectedWhitespace', + fix(fixer) { + /* + * Only autofix if there is no newline + * https://github.com/eslint/eslint/issues/7787 + */ + if (!hasNewline && + // don't fix optional calls + !isOptionalCall) { + return fixer.removeRange([ + lastCalleeToken.range[1], + openingParenToken.range[0], + ]); + } + return null; + }, + }); + } + } + else if (isOptionalCall) { + // disallow: + // foo?. (); + // foo ?.(); + // foo ?. (); + if (hasWhitespace || hasNewline) { + context.report({ + node, + loc: lastCalleeToken.loc.start, + messageId: 'unexpectedWhitespace', + }); + } + } + else { + if (!hasWhitespace) { + context.report({ + node, + loc: lastCalleeToken.loc.start, + messageId: 'missing', + fix(fixer) { + return fixer.insertTextBefore(openingParenToken, ' '); + }, + }); + } + else if (!config.allowNewlines && hasNewline) { + context.report({ + node, + loc: lastCalleeToken.loc.start, + messageId: 'unexpectedNewline', + fix(fixer) { + return fixer.replaceTextRange([lastCalleeToken.range[1], openingParenToken.range[0]], ' '); + }, + }); + } + } + } + return { + CallExpression: checkSpacing, + NewExpression: checkSpacing, + }; + }, +}); +//# sourceMappingURL=func-call-spacing.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/func-call-spacing.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/func-call-spacing.js.map new file mode 100644 index 000000000..a677e9d2f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/func-call-spacing.js.map @@ -0,0 +1 @@ +{"version":3,"file":"func-call-spacing.js","sourceRoot":"","sources":["../../src/rules/func-call-spacing.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,8CAAgC;AAahC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE;YACJ,WAAW,EACT,gFAAgF;YAClF,QAAQ,EAAE,kBAAkB;YAC5B,WAAW,EAAE,KAAK;YAClB,eAAe,EAAE,IAAI;SACtB;QACD,OAAO,EAAE,YAAY;QACrB,MAAM,EAAE;YACN,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,OAAO;oB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EAAE,eAAe,CAAC,GAAG,CAAC,KAAK;wBAC9B,SAAS,EAAE,sBAAsB;qBAClC,CAAC,CAAC;iBACJ;aACF;iBAAM;gBACL,IAAI,CAAC,aAAa,EAAE;oBAClB,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI;wBACJ,GAAG,EAAE,eAAe,CAAC,GAAG,CAAC,KAAK;wBAC9B,SAAS,EAAE,SAAS;wBACpB,GAAG,CAAC,KAAK;4BACP,OAAO,KAAK,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;wBACxD,CAAC;qBACF,CAAC,CAAC;iBACJ;qBAAM,IAAI,CAAC,MAAO,CAAC,aAAa,IAAI,UAAU,EAAE;oBAC/C,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI;wBACJ,GAAG,EAAE,eAAe,CAAC,GAAG,CAAC,KAAK;wBAC9B,SAAS,EAAE,mBAAmB;wBAC9B,GAAG,CAAC,KAAK;4BACP,OAAO,KAAK,CAAC,gBAAgB,CAC3B,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACtD,GAAG,CACJ,CAAC;wBACJ,CAAC;qBACF,CAAC,CAAC;iBACJ;aACF;QACH,CAAC;QAED,OAAO;YACL,cAAc,EAAE,YAAY;YAC5B,aAAa,EAAE,YAAY;SAC5B,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/BinarySearchTree.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/BinarySearchTree.js new file mode 100644 index 000000000..9ae710624 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/BinarySearchTree.js @@ -0,0 +1,55 @@ +"use strict"; +// The following code is adapted from the the code in eslint. +// License: https://github.com/eslint/eslint/blob/48700fc8408f394887cdedd071b22b757700fdcb/LICENSE +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BinarySearchTree = void 0; +const functional_red_black_tree_1 = __importDefault(require("functional-red-black-tree")); +/** + * A mutable balanced binary search tree that stores (key, value) pairs. The keys are numeric, and must be unique. + * This is intended to be a generic wrapper around a balanced binary search tree library, so that the underlying implementation + * can easily be swapped out. + */ +class BinarySearchTree { + constructor() { + this.rbTree = functional_red_black_tree_1.default(); + } + /** + * Inserts an entry into the tree. + */ + insert(key, value) { + const iterator = this.rbTree.find(key); + if (iterator.valid) { + this.rbTree = iterator.update(value); + } + else { + this.rbTree = this.rbTree.insert(key, value); + } + } + /** + * Finds the entry with the largest key less than or equal to the provided key + * @returns The found entry, or null if no such entry exists. + */ + findLe(key) { + const iterator = this.rbTree.le(key); + return { key: iterator.key, value: iterator.value }; + } + /** + * Deletes all of the keys in the interval [start, end) + */ + deleteRange(start, end) { + // Exit without traversing the tree if the range has zero size. + if (start === end) { + return; + } + const iterator = this.rbTree.ge(start); + while (iterator.valid && iterator.key < end) { + this.rbTree = this.rbTree.remove(iterator.key); + iterator.next(); + } + } +} +exports.BinarySearchTree = BinarySearchTree; +//# sourceMappingURL=BinarySearchTree.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/BinarySearchTree.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/BinarySearchTree.js.map new file mode 100644 index 000000000..6f0c20ea0 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/BinarySearchTree.js.map @@ -0,0 +1 @@ +{"version":3,"file":"BinarySearchTree.js","sourceRoot":"","sources":["../../../src/rules/indent-new-do-not-use/BinarySearchTree.ts"],"names":[],"mappings":";AAAA,6DAA6D;AAC7D,kGAAkG;;;;;;AAGlG,0FAAmD;AASnD;;;;GAIG;AACH,MAAa,gBAAgB;IAA7B;QACU,WAAM,GAAG,mCAAU,EAAa,CAAC;IAwC3C,CAAC;IAtCC;;OAEG;IACI,MAAM,CAAC,GAAW,EAAE,KAAgB;QACzC,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAEvC,IAAI,QAAQ,CAAC,KAAK,EAAE;YAClB,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SACtC;aAAM;YACL,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SAC9C;IACH,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,GAAW;QACvB,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;QAErC,OAAO,EAAE,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC;IACtD,CAAC;IAED;;OAEG;IACI,WAAW,CAAC,KAAa,EAAE,GAAW;QAC3C,+DAA+D;QAC/D,IAAI,KAAK,KAAK,GAAG,EAAE;YACjB,OAAO;SACR;QACD,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;QAEvC,OAAO,QAAQ,CAAC,KAAK,IAAI,QAAQ,CAAC,GAAG,GAAG,GAAG,EAAE;YAC3C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YAC/C,QAAQ,CAAC,IAAI,EAAE,CAAC;SACjB;IACH,CAAC;CACF;AAzCD,4CAyCC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/OffsetStorage.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/OffsetStorage.js new file mode 100644 index 000000000..a48651d89 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/OffsetStorage.js @@ -0,0 +1,221 @@ +"use strict"; +// The following code is adapted from the the code in eslint. +// License: https://github.com/eslint/eslint/blob/48700fc8408f394887cdedd071b22b757700fdcb/LICENSE +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OffsetStorage = void 0; +const BinarySearchTree_1 = require("./BinarySearchTree"); +/** + * A class to store information on desired offsets of tokens from each other + */ +class OffsetStorage { + /** + * @param tokenInfo a TokenInfo instance + * @param indentSize The desired size of each indentation level + * @param indentType The indentation character + */ + constructor(tokenInfo, indentSize, indentType) { + this.tokenInfo = tokenInfo; + this.indentSize = indentSize; + this.indentType = indentType; + this.tree = new BinarySearchTree_1.BinarySearchTree(); + this.tree.insert(0, { offset: 0, from: null, force: false }); + this.lockedFirstTokens = new WeakMap(); + this.desiredIndentCache = new WeakMap(); + this.ignoredTokens = new WeakSet(); + } + getOffsetDescriptor(token) { + return this.tree.findLe(token.range[0]).value; + } + /** + * Sets the offset column of token B to match the offset column of token A. + * **WARNING**: This matches a *column*, even if baseToken is not the first token on its line. In + * most cases, `setDesiredOffset` should be used instead. + * @param baseToken The first token + * @param offsetToken The second token, whose offset should be matched to the first token + */ + matchOffsetOf(baseToken, offsetToken) { + /* + * lockedFirstTokens is a map from a token whose indentation is controlled by the "first" option to + * the token that it depends on. For example, with the `ArrayExpression: first` option, the first + * token of each element in the array after the first will be mapped to the first token of the first + * element. The desired indentation of each of these tokens is computed based on the desired indentation + * of the "first" element, rather than through the normal offset mechanism. + */ + this.lockedFirstTokens.set(offsetToken, baseToken); + } + /** + * Sets the desired offset of a token. + * + * This uses a line-based offset collapsing behavior to handle tokens on the same line. + * For example, consider the following two cases: + * + * ( + * [ + * bar + * ] + * ) + * + * ([ + * bar + * ]) + * + * Based on the first case, it's clear that the `bar` token needs to have an offset of 1 indent level (4 spaces) from + * the `[` token, and the `[` token has to have an offset of 1 indent level from the `(` token. Since the `(` token is + * the first on its line (with an indent of 0 spaces), the `bar` token needs to be offset by 2 indent levels (8 spaces) + * from the start of its line. + * + * However, in the second case `bar` should only be indented by 4 spaces. This is because the offset of 1 indent level + * between the `(` and the `[` tokens gets "collapsed" because the two tokens are on the same line. As a result, the + * `(` token is mapped to the `[` token with an offset of 0, and the rule correctly decides that `bar` should be indented + * by 1 indent level from the start of the line. + * + * This is useful because rule listeners can usually just call `setDesiredOffset` for all the tokens in the node, + * without needing to check which lines those tokens are on. + * + * Note that since collapsing only occurs when two tokens are on the same line, there are a few cases where non-intuitive + * behavior can occur. For example, consider the following cases: + * + * foo( + * ). + * bar( + * baz + * ) + * + * foo( + * ).bar( + * baz + * ) + * + * Based on the first example, it would seem that `bar` should be offset by 1 indent level from `foo`, and `baz` + * should be offset by 1 indent level from `bar`. However, this is not correct, because it would result in `baz` + * being indented by 2 indent levels in the second case (since `foo`, `bar`, and `baz` are all on separate lines, no + * collapsing would occur). + * + * Instead, the correct way would be to offset `baz` by 1 level from `bar`, offset `bar` by 1 level from the `)`, and + * offset the `)` by 0 levels from `foo`. This ensures that the offset between `bar` and the `)` are correctly collapsed + * in the second case. + * + * @param token The token + * @param fromToken The token that `token` should be offset from + * @param offset The desired indent level + */ + setDesiredOffset(token, fromToken, offset) { + this.setDesiredOffsets(token.range, fromToken, offset); + } + /** + * Sets the desired offset of all tokens in a range + * It's common for node listeners in this file to need to apply the same offset to a large, contiguous range of tokens. + * Moreover, the offset of any given token is usually updated multiple times (roughly once for each node that contains + * it). This means that the offset of each token is updated O(AST depth) times. + * It would not be performant to store and update the offsets for each token independently, because the rule would end + * up having a time complexity of O(number of tokens * AST depth), which is quite slow for large files. + * + * Instead, the offset tree is represented as a collection of contiguous offset ranges in a file. For example, the following + * list could represent the state of the offset tree at a given point: + * + * * Tokens starting in the interval [0, 15) are aligned with the beginning of the file + * * Tokens starting in the interval [15, 30) are offset by 1 indent level from the `bar` token + * * Tokens starting in the interval [30, 43) are offset by 1 indent level from the `foo` token + * * Tokens starting in the interval [43, 820) are offset by 2 indent levels from the `bar` token + * * Tokens starting in the interval [820, ∞) are offset by 1 indent level from the `baz` token + * + * The `setDesiredOffsets` methods inserts ranges like the ones above. The third line above would be inserted by using: + * `setDesiredOffsets([30, 43], fooToken, 1);` + * + * @param range A [start, end] pair. All tokens with range[0] <= token.start < range[1] will have the offset applied. + * @param fromToken The token that this is offset from + * @param offset The desired indent level + * @param force `true` if this offset should not use the normal collapsing behavior. This should almost always be false. + */ + setDesiredOffsets(range, fromToken, offset = 0, force = false) { + /* + * Offset ranges are stored as a collection of nodes, where each node maps a numeric key to an offset + * descriptor. The tree for the example above would have the following nodes: + * + * * key: 0, value: { offset: 0, from: null } + * * key: 15, value: { offset: 1, from: barToken } + * * key: 30, value: { offset: 1, from: fooToken } + * * key: 43, value: { offset: 2, from: barToken } + * * key: 820, value: { offset: 1, from: bazToken } + * + * To find the offset descriptor for any given token, one needs to find the node with the largest key + * which is <= token.start. To make this operation fast, the nodes are stored in a balanced binary + * search tree indexed by key. + */ + const descriptorToInsert = { offset, from: fromToken, force }; + const descriptorAfterRange = this.tree.findLe(range[1]).value; + const fromTokenIsInRange = fromToken && + fromToken.range[0] >= range[0] && + fromToken.range[1] <= range[1]; + // this has to be before the delete + insert below or else you'll get into a cycle + const fromTokenDescriptor = fromTokenIsInRange + ? this.getOffsetDescriptor(fromToken) + : null; + // First, remove any existing nodes in the range from the tree. + this.tree.deleteRange(range[0] + 1, range[1]); + // Insert a new node into the tree for this range + this.tree.insert(range[0], descriptorToInsert); + /* + * To avoid circular offset dependencies, keep the `fromToken` token mapped to whatever it was mapped to previously, + * even if it's in the current range. + */ + if (fromTokenIsInRange) { + this.tree.insert(fromToken.range[0], fromTokenDescriptor); + this.tree.insert(fromToken.range[1], descriptorToInsert); + } + /* + * To avoid modifying the offset of tokens after the range, insert another node to keep the offset of the following + * tokens the same as it was before. + */ + this.tree.insert(range[1], descriptorAfterRange); + } + /** + * Gets the desired indent of a token + * @returns The desired indent of the token + */ + getDesiredIndent(token) { + if (!this.desiredIndentCache.has(token)) { + if (this.ignoredTokens.has(token)) { + /* + * If the token is ignored, use the actual indent of the token as the desired indent. + * This ensures that no errors are reported for this token. + */ + this.desiredIndentCache.set(token, this.tokenInfo.getTokenIndent(token)); + } + else if (this.lockedFirstTokens.has(token)) { + const firstToken = this.lockedFirstTokens.get(token); + this.desiredIndentCache.set(token, + // (indentation for the first element's line) + this.getDesiredIndent(this.tokenInfo.getFirstTokenOfLine(firstToken)) + + // (space between the start of the first element's line and the first element) + this.indentType.repeat(firstToken.loc.start.column - + this.tokenInfo.getFirstTokenOfLine(firstToken).loc.start.column)); + } + else { + const offsetInfo = this.getOffsetDescriptor(token); + const offset = offsetInfo.from && + offsetInfo.from.loc.start.line === token.loc.start.line && + !/^\s*?\n/u.test(token.value) && + !offsetInfo.force + ? 0 + : offsetInfo.offset * this.indentSize; + this.desiredIndentCache.set(token, (offsetInfo.from ? this.getDesiredIndent(offsetInfo.from) : '') + + this.indentType.repeat(offset)); + } + } + return this.desiredIndentCache.get(token); + } + /** + * Ignores a token, preventing it from being reported. + */ + ignoreToken(token) { + if (this.tokenInfo.isFirstTokenOfLine(token)) { + this.ignoredTokens.add(token); + } + } + getFirstDependency(token) { + return this.getOffsetDescriptor(token).from; + } +} +exports.OffsetStorage = OffsetStorage; +//# sourceMappingURL=OffsetStorage.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/OffsetStorage.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/OffsetStorage.js.map new file mode 100644 index 000000000..dc3aa6671 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/OffsetStorage.js.map @@ -0,0 +1 @@ +{"version":3,"file":"OffsetStorage.js","sourceRoot":"","sources":["../../../src/rules/indent-new-do-not-use/OffsetStorage.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CAAC,CAAC,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC;gBAE1C,IAAI,CAAC,kBAAkB,CAAC,GAAG,CACzB,KAAK,EACL,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;oBAC7D,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CACjC,CAAC;aACH;SACF;QAED,OAAO,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAE,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,KAAqB;QAC/B,IAAI,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE;YAC5C,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SAC/B;IACH,CAAC;IAUD,kBAAkB,CAAC,KAAqB;QACtC,OAAO,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;IAC9C,CAAC;CACF;AA5QD,sCA4QC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/TokenInfo.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/TokenInfo.js new file mode 100644 index 000000000..5da8a48b4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/TokenInfo.js @@ -0,0 +1,49 @@ +"use strict"; +// The following code is adapted from the the code in eslint. +// License: https://github.com/eslint/eslint/blob/48700fc8408f394887cdedd071b22b757700fdcb/LICENSE +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TokenInfo = void 0; +/** + * A helper class to get token-based info related to indentation + */ +class TokenInfo { + constructor(sourceCode) { + this.sourceCode = sourceCode; + this.firstTokensByLineNumber = sourceCode.tokensAndComments.reduce((map, token) => { + if (!map.has(token.loc.start.line)) { + map.set(token.loc.start.line, token); + } + if (!map.has(token.loc.end.line) && + sourceCode.text + .slice(token.range[1] - token.loc.end.column, token.range[1]) + .trim()) { + map.set(token.loc.end.line, token); + } + return map; + }, new Map()); + } + /** + * Gets the first token on a given token's line + * @returns The first token on the given line + */ + getFirstTokenOfLine(token) { + return this.firstTokensByLineNumber.get(token.loc.start.line); + } + /** + * Determines whether a token is the first token in its line + * @returns `true` if the token is the first on its line + */ + isFirstTokenOfLine(token) { + return this.getFirstTokenOfLine(token) === token; + } + /** + * Get the actual indent of a token + * @param token Token to examine. This should be the first token on its line. + * @returns The indentation characters that precede the token + */ + getTokenIndent(token) { + return this.sourceCode.text.slice(token.range[0] - token.loc.start.column, token.range[0]); + } +} +exports.TokenInfo = TokenInfo; +//# sourceMappingURL=TokenInfo.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/TokenInfo.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/TokenInfo.js.map new file mode 100644 index 000000000..7bc04ad44 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/TokenInfo.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TokenInfo.js","sourceRoot":"","sources":["../../../src/rules/indent-new-do-not-use/TokenInfo.ts"],"names":[],"mappings":";AAAA,6DAA6D;AAC7D,kGAAkG;;;AAKlG;;GAEG;AACH,MAAa,SAAS;IAIpB,YAAY,UAA+B;QACzC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,uBAAuB,GAAG,UAAU,CAAC,iBAAiB,CAAC,MAAM,CAChE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;YACb,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;gBAClC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;aACtC;YACD,IACE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC;gBAC5B,UAAU,CAAC,IAAI;qBACZ,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;qBAC5D,IAAI,EAAE,EACT;gBACA,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;aACpC;YACD,OAAO,GAAG,CAAC;QACb,CAAC,EACD,IAAI,GAAG,EAAE,CACV,CAAC;IACJ,CAAC;IAED;;;OAGG;IACI,mBAAmB,CACxB,KAAqC;QAErC,OAAO,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAE,CAAC;IACjE,CAAC;IAED;;;OAGG;IACI,kBAAkB,CAAC,KAAqB;QAC7C,OAAO,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC;IACnD,CAAC;IAED;;;;OAIG;IACI,cAAc,CAAC,KAAqB;QACzC,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAC/B,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EACvC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CACf,CAAC;IACJ,CAAC;CACF;AAtDD,8BAsDC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/index.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/index.js new file mode 100644 index 000000000..c43a8a373 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/index.js @@ -0,0 +1,1143 @@ +"use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const OffsetStorage_1 = require("./OffsetStorage"); +const TokenInfo_1 = require("./TokenInfo"); +const util_1 = require("../../util"); +const GLOBAL_LINEBREAK_REGEX = /\r\n|[\r\n\u2028\u2029]/gu; +const WHITESPACE_REGEX = /\s*$/u; +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ +const KNOWN_NODES = new Set([ + experimental_utils_1.AST_NODE_TYPES.AssignmentExpression, + experimental_utils_1.AST_NODE_TYPES.AssignmentPattern, + experimental_utils_1.AST_NODE_TYPES.ArrayExpression, + experimental_utils_1.AST_NODE_TYPES.ArrayPattern, + experimental_utils_1.AST_NODE_TYPES.ArrowFunctionExpression, + experimental_utils_1.AST_NODE_TYPES.AwaitExpression, + experimental_utils_1.AST_NODE_TYPES.BlockStatement, + experimental_utils_1.AST_NODE_TYPES.BinaryExpression, + experimental_utils_1.AST_NODE_TYPES.BreakStatement, + experimental_utils_1.AST_NODE_TYPES.CallExpression, + experimental_utils_1.AST_NODE_TYPES.CatchClause, + experimental_utils_1.AST_NODE_TYPES.ClassBody, + experimental_utils_1.AST_NODE_TYPES.ClassDeclaration, + experimental_utils_1.AST_NODE_TYPES.ClassExpression, + experimental_utils_1.AST_NODE_TYPES.ConditionalExpression, + experimental_utils_1.AST_NODE_TYPES.ContinueStatement, + experimental_utils_1.AST_NODE_TYPES.DoWhileStatement, + experimental_utils_1.AST_NODE_TYPES.DebuggerStatement, + experimental_utils_1.AST_NODE_TYPES.EmptyStatement, + experimental_utils_1.AST_NODE_TYPES.ExpressionStatement, + experimental_utils_1.AST_NODE_TYPES.ForStatement, + experimental_utils_1.AST_NODE_TYPES.ForInStatement, + experimental_utils_1.AST_NODE_TYPES.ForOfStatement, + experimental_utils_1.AST_NODE_TYPES.FunctionDeclaration, + experimental_utils_1.AST_NODE_TYPES.FunctionExpression, + experimental_utils_1.AST_NODE_TYPES.Identifier, + experimental_utils_1.AST_NODE_TYPES.IfStatement, + experimental_utils_1.AST_NODE_TYPES.Literal, + experimental_utils_1.AST_NODE_TYPES.LabeledStatement, + experimental_utils_1.AST_NODE_TYPES.LogicalExpression, + experimental_utils_1.AST_NODE_TYPES.MemberExpression, + experimental_utils_1.AST_NODE_TYPES.MetaProperty, + experimental_utils_1.AST_NODE_TYPES.MethodDefinition, + experimental_utils_1.AST_NODE_TYPES.NewExpression, + experimental_utils_1.AST_NODE_TYPES.ObjectExpression, + experimental_utils_1.AST_NODE_TYPES.ObjectPattern, + experimental_utils_1.AST_NODE_TYPES.Program, + experimental_utils_1.AST_NODE_TYPES.Property, + experimental_utils_1.AST_NODE_TYPES.RestElement, + experimental_utils_1.AST_NODE_TYPES.ReturnStatement, + experimental_utils_1.AST_NODE_TYPES.SequenceExpression, + experimental_utils_1.AST_NODE_TYPES.SpreadElement, + experimental_utils_1.AST_NODE_TYPES.Super, + experimental_utils_1.AST_NODE_TYPES.SwitchCase, + experimental_utils_1.AST_NODE_TYPES.SwitchStatement, + experimental_utils_1.AST_NODE_TYPES.TaggedTemplateExpression, + experimental_utils_1.AST_NODE_TYPES.TemplateElement, + experimental_utils_1.AST_NODE_TYPES.TemplateLiteral, + experimental_utils_1.AST_NODE_TYPES.ThisExpression, + experimental_utils_1.AST_NODE_TYPES.ThrowStatement, + experimental_utils_1.AST_NODE_TYPES.TryStatement, + experimental_utils_1.AST_NODE_TYPES.UnaryExpression, + experimental_utils_1.AST_NODE_TYPES.UpdateExpression, + experimental_utils_1.AST_NODE_TYPES.VariableDeclaration, + experimental_utils_1.AST_NODE_TYPES.VariableDeclarator, + experimental_utils_1.AST_NODE_TYPES.WhileStatement, + experimental_utils_1.AST_NODE_TYPES.WithStatement, + experimental_utils_1.AST_NODE_TYPES.YieldExpression, + experimental_utils_1.AST_NODE_TYPES.JSXIdentifier, + experimental_utils_1.AST_NODE_TYPES.JSXMemberExpression, + experimental_utils_1.AST_NODE_TYPES.JSXEmptyExpression, + experimental_utils_1.AST_NODE_TYPES.JSXExpressionContainer, + experimental_utils_1.AST_NODE_TYPES.JSXElement, + experimental_utils_1.AST_NODE_TYPES.JSXClosingElement, + experimental_utils_1.AST_NODE_TYPES.JSXOpeningElement, + experimental_utils_1.AST_NODE_TYPES.JSXAttribute, + experimental_utils_1.AST_NODE_TYPES.JSXSpreadAttribute, + experimental_utils_1.AST_NODE_TYPES.JSXText, + experimental_utils_1.AST_NODE_TYPES.ExportDefaultDeclaration, + experimental_utils_1.AST_NODE_TYPES.ExportNamedDeclaration, + experimental_utils_1.AST_NODE_TYPES.ExportAllDeclaration, + experimental_utils_1.AST_NODE_TYPES.ExportSpecifier, + experimental_utils_1.AST_NODE_TYPES.ImportDeclaration, + experimental_utils_1.AST_NODE_TYPES.ImportSpecifier, + experimental_utils_1.AST_NODE_TYPES.ImportDefaultSpecifier, + experimental_utils_1.AST_NODE_TYPES.ImportNamespaceSpecifier, + // Class properties aren't yet supported by eslint... + experimental_utils_1.AST_NODE_TYPES.ClassProperty, + // ts keywords + experimental_utils_1.AST_NODE_TYPES.TSAbstractKeyword, + experimental_utils_1.AST_NODE_TYPES.TSAnyKeyword, + experimental_utils_1.AST_NODE_TYPES.TSBooleanKeyword, + experimental_utils_1.AST_NODE_TYPES.TSNeverKeyword, + experimental_utils_1.AST_NODE_TYPES.TSNumberKeyword, + experimental_utils_1.AST_NODE_TYPES.TSStringKeyword, + experimental_utils_1.AST_NODE_TYPES.TSSymbolKeyword, + experimental_utils_1.AST_NODE_TYPES.TSUndefinedKeyword, + experimental_utils_1.AST_NODE_TYPES.TSUnknownKeyword, + experimental_utils_1.AST_NODE_TYPES.TSVoidKeyword, + experimental_utils_1.AST_NODE_TYPES.TSNullKeyword, + // ts specific nodes we want to support + experimental_utils_1.AST_NODE_TYPES.TSAbstractClassProperty, + experimental_utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition, + experimental_utils_1.AST_NODE_TYPES.TSArrayType, + experimental_utils_1.AST_NODE_TYPES.TSAsExpression, + experimental_utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration, + experimental_utils_1.AST_NODE_TYPES.TSConditionalType, + experimental_utils_1.AST_NODE_TYPES.TSConstructorType, + experimental_utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration, + experimental_utils_1.AST_NODE_TYPES.TSDeclareFunction, + experimental_utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression, + experimental_utils_1.AST_NODE_TYPES.TSEnumDeclaration, + experimental_utils_1.AST_NODE_TYPES.TSEnumMember, + experimental_utils_1.AST_NODE_TYPES.TSExportAssignment, + experimental_utils_1.AST_NODE_TYPES.TSExternalModuleReference, + experimental_utils_1.AST_NODE_TYPES.TSFunctionType, + experimental_utils_1.AST_NODE_TYPES.TSImportType, + experimental_utils_1.AST_NODE_TYPES.TSIndexedAccessType, + experimental_utils_1.AST_NODE_TYPES.TSIndexSignature, + experimental_utils_1.AST_NODE_TYPES.TSInferType, + experimental_utils_1.AST_NODE_TYPES.TSInterfaceBody, + experimental_utils_1.AST_NODE_TYPES.TSInterfaceDeclaration, + experimental_utils_1.AST_NODE_TYPES.TSInterfaceHeritage, + experimental_utils_1.AST_NODE_TYPES.TSIntersectionType, + experimental_utils_1.AST_NODE_TYPES.TSImportEqualsDeclaration, + experimental_utils_1.AST_NODE_TYPES.TSLiteralType, + experimental_utils_1.AST_NODE_TYPES.TSMappedType, + experimental_utils_1.AST_NODE_TYPES.TSMethodSignature, + 'TSMinusToken', + experimental_utils_1.AST_NODE_TYPES.TSModuleBlock, + experimental_utils_1.AST_NODE_TYPES.TSModuleDeclaration, + experimental_utils_1.AST_NODE_TYPES.TSNonNullExpression, + experimental_utils_1.AST_NODE_TYPES.TSParameterProperty, + experimental_utils_1.AST_NODE_TYPES.TSParenthesizedType, + 'TSPlusToken', + experimental_utils_1.AST_NODE_TYPES.TSPropertySignature, + experimental_utils_1.AST_NODE_TYPES.TSQualifiedName, + 'TSQuestionToken', + experimental_utils_1.AST_NODE_TYPES.TSRestType, + experimental_utils_1.AST_NODE_TYPES.TSThisType, + experimental_utils_1.AST_NODE_TYPES.TSTupleType, + experimental_utils_1.AST_NODE_TYPES.TSTypeAnnotation, + experimental_utils_1.AST_NODE_TYPES.TSTypeLiteral, + experimental_utils_1.AST_NODE_TYPES.TSTypeOperator, + experimental_utils_1.AST_NODE_TYPES.TSTypeParameter, + experimental_utils_1.AST_NODE_TYPES.TSTypeParameterDeclaration, + experimental_utils_1.AST_NODE_TYPES.TSTypeParameterInstantiation, + experimental_utils_1.AST_NODE_TYPES.TSTypeReference, + experimental_utils_1.AST_NODE_TYPES.TSUnionType, +]); +const STATEMENT_LIST_PARENTS = new Set([ + experimental_utils_1.AST_NODE_TYPES.Program, + experimental_utils_1.AST_NODE_TYPES.BlockStatement, + experimental_utils_1.AST_NODE_TYPES.SwitchCase, +]); +const DEFAULT_VARIABLE_INDENT = 1; +const DEFAULT_PARAMETER_INDENT = 1; +const DEFAULT_FUNCTION_BODY_INDENT = 1; +/* + * General rule strategy: + * 1. An OffsetStorage instance stores a map of desired offsets, where each token has a specified offset from another + * specified token or to the first column. + * 2. As the AST is traversed, modify the desired offsets of tokens accordingly. For example, when entering a + * BlockStatement, offset all of the tokens in the BlockStatement by 1 indent level from the opening curly + * brace of the BlockStatement. + * 3. After traversing the AST, calculate the expected indentation levels of every token according to the + * OffsetStorage container. + * 4. For each line, compare the expected indentation of the first token to the actual indentation in the file, + * and report the token if the two values are not equal. + */ +const ELEMENT_LIST_SCHEMA = { + oneOf: [ + { + type: 'integer', + minimum: 0, + }, + { + enum: ['first', 'off'], + }, + ], +}; +exports.default = util_1.createRule({ + name: 'indent', + meta: { + type: 'layout', + docs: { + description: 'Enforce consistent indentation.', + category: 'Stylistic Issues', + recommended: false, + }, + fixable: 'whitespace', + schema: [ + { + oneOf: [ + { + enum: ['tab'], + }, + { + type: 'integer', + minimum: 0, + }, + ], + }, + { + type: 'object', + properties: { + SwitchCase: { + type: 'integer', + minimum: 0, + default: 0, + }, + VariableDeclarator: { + oneOf: [ + ELEMENT_LIST_SCHEMA, + { + type: 'object', + properties: { + var: ELEMENT_LIST_SCHEMA, + let: ELEMENT_LIST_SCHEMA, + const: ELEMENT_LIST_SCHEMA, + }, + additionalProperties: false, + }, + ], + }, + outerIIFEBody: { + type: 'integer', + minimum: 0, + }, + MemberExpression: { + oneOf: [ + { + type: 'integer', + minimum: 0, + }, + { + enum: ['off'], + }, + ], + }, + FunctionDeclaration: { + type: 'object', + properties: { + parameters: ELEMENT_LIST_SCHEMA, + body: { + type: 'integer', + minimum: 0, + }, + }, + additionalProperties: false, + }, + FunctionExpression: { + type: 'object', + properties: { + parameters: ELEMENT_LIST_SCHEMA, + body: { + type: 'integer', + minimum: 0, + }, + }, + additionalProperties: false, + }, + CallExpression: { + type: 'object', + properties: { + arguments: ELEMENT_LIST_SCHEMA, + }, + additionalProperties: false, + }, + ArrayExpression: ELEMENT_LIST_SCHEMA, + ObjectExpression: ELEMENT_LIST_SCHEMA, + ImportDeclaration: ELEMENT_LIST_SCHEMA, + flatTernaryExpressions: { + type: 'boolean', + default: false, + }, + ignoredNodes: { + type: 'array', + items: { + type: 'string', + not: { + pattern: ':exit$', + }, + }, + }, + ignoreComments: { + type: 'boolean', + default: false, + }, + }, + additionalProperties: false, + }, + ], + messages: { + wrongIndentation: 'Expected indentation of {{expected}} but found {{actual}}.', + }, + }, + defaultOptions: [ + // typescript docs and playground use 4 space indent + 4, + { + // typescript docs indent the case from the switch + // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-8.html#example-4 + SwitchCase: 1, + VariableDeclarator: { + var: DEFAULT_VARIABLE_INDENT, + let: DEFAULT_VARIABLE_INDENT, + const: DEFAULT_VARIABLE_INDENT, + }, + outerIIFEBody: 1, + FunctionDeclaration: { + parameters: DEFAULT_PARAMETER_INDENT, + body: DEFAULT_FUNCTION_BODY_INDENT, + }, + FunctionExpression: { + parameters: DEFAULT_PARAMETER_INDENT, + body: DEFAULT_FUNCTION_BODY_INDENT, + }, + CallExpression: { + arguments: DEFAULT_PARAMETER_INDENT, + }, + MemberExpression: 1, + ArrayExpression: 1, + ObjectExpression: 1, + ImportDeclaration: 1, + flatTernaryExpressions: false, + ignoredNodes: [], + ignoreComments: false, + }, + ], + create(context, [userIndent, userOptions]) { + const indentType = userIndent === 'tab' ? 'tab' : 'space'; + const indentSize = userIndent === 'tab' ? 1 : userIndent; + const options = userOptions; + if (typeof userOptions.VariableDeclarator === 'number' || + userOptions.VariableDeclarator === 'first') { + // typescript doesn't narrow the type for some reason + options.VariableDeclarator = { + var: userOptions.VariableDeclarator, + let: userOptions.VariableDeclarator, + const: userOptions.VariableDeclarator, + }; + } + const sourceCode = context.getSourceCode(); + const tokenInfo = new TokenInfo_1.TokenInfo(sourceCode); + const offsets = new OffsetStorage_1.OffsetStorage(tokenInfo, indentSize, indentType === 'space' ? ' ' : '\t'); + const parameterParens = new WeakSet(); + /** + * Creates an error message for a line, given the expected/actual indentation. + * @param expectedAmount The expected amount of indentation characters for this line + * @param actualSpaces The actual number of indentation spaces that were found on this line + * @param actualTabs The actual number of indentation tabs that were found on this line + * @returns An error message for this line + */ + function createErrorMessageData(expectedAmount, actualSpaces, actualTabs) { + const expectedStatement = `${expectedAmount} ${indentType}${expectedAmount === 1 ? '' : 's'}`; // e.g. "2 tabs" + const foundSpacesWord = `space${actualSpaces === 1 ? '' : 's'}`; // e.g. "space" + const foundTabsWord = `tab${actualTabs === 1 ? '' : 's'}`; // e.g. "tabs" + let foundStatement; + if (actualSpaces > 0) { + /* + * Abbreviate the message if the expected indentation is also spaces. + * e.g. 'Expected 4 spaces but found 2' rather than 'Expected 4 spaces but found 2 spaces' + */ + foundStatement = + indentType === 'space' + ? actualSpaces + : `${actualSpaces} ${foundSpacesWord}`; + } + else if (actualTabs > 0) { + foundStatement = + indentType === 'tab' ? actualTabs : `${actualTabs} ${foundTabsWord}`; + } + else { + foundStatement = '0'; + } + return { + expected: expectedStatement, + actual: foundStatement, + }; + } + /** + * Reports a given indent violation + * @param token Token violating the indent rule + * @param neededIndent Expected indentation string + */ + function report(token, neededIndent) { + const actualIndent = Array.from(tokenInfo.getTokenIndent(token)); + const numSpaces = actualIndent.filter(char => char === ' ').length; + const numTabs = actualIndent.filter(char => char === '\t').length; + context.report({ + node: token, + messageId: 'wrongIndentation', + data: createErrorMessageData(neededIndent.length, numSpaces, numTabs), + loc: { + start: { line: token.loc.start.line, column: 0 }, + end: { line: token.loc.start.line, column: token.loc.start.column }, + }, + fix(fixer) { + return fixer.replaceTextRange([token.range[0] - token.loc.start.column, token.range[0]], neededIndent); + }, + }); + } + /** + * Checks if a token's indentation is correct + * @param token Token to examine + * @param desiredIndent Desired indentation of the string + * @returns `true` if the token's indentation is correct + */ + function validateTokenIndent(token, desiredIndent) { + const indentation = tokenInfo.getTokenIndent(token); + return (indentation === desiredIndent || + // To avoid conflicts with no-mixed-spaces-and-tabs, don't report mixed spaces and tabs. + (indentation.includes(' ') && indentation.includes('\t'))); + } + /** + * Check to see if the node is a file level IIFE + * @param node The function node to check. + * @returns True if the node is the outer IIFE + */ + function isOuterIIFE(node) { + var _a; + /* + * Verify that the node is an IIFE + */ + if (!node.parent || + node.parent.type !== experimental_utils_1.AST_NODE_TYPES.CallExpression || + node.parent.callee !== node) { + return false; + } + /* + * Navigate legal ancestors to determine whether this IIFE is outer. + * A "legal ancestor" is an expression or statement that causes the function to get executed immediately. + * For example, `!(function(){})()` is an outer IIFE even though it is preceded by a ! operator. + */ + let statement = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent; + while (statement && + ((statement.type === experimental_utils_1.AST_NODE_TYPES.UnaryExpression && + ['!', '~', '+', '-'].includes(statement.operator)) || + statement.type === experimental_utils_1.AST_NODE_TYPES.AssignmentExpression || + statement.type === experimental_utils_1.AST_NODE_TYPES.LogicalExpression || + statement.type === experimental_utils_1.AST_NODE_TYPES.SequenceExpression || + statement.type === experimental_utils_1.AST_NODE_TYPES.VariableDeclarator)) { + statement = statement.parent; + } + return (!!statement && + (statement.type === experimental_utils_1.AST_NODE_TYPES.ExpressionStatement || + statement.type === experimental_utils_1.AST_NODE_TYPES.VariableDeclaration) && + !!statement.parent && + statement.parent.type === experimental_utils_1.AST_NODE_TYPES.Program); + } + /** + * Counts the number of linebreaks that follow the last non-whitespace character in a string + * @param str The string to check + * @returns The number of JavaScript linebreaks that follow the last non-whitespace character, + * or the total number of linebreaks if the string is all whitespace. + */ + function countTrailingLinebreaks(str) { + const trailingWhitespace = WHITESPACE_REGEX.exec(str)[0]; + const linebreakMatches = GLOBAL_LINEBREAK_REGEX.exec(trailingWhitespace); + return linebreakMatches === null ? 0 : linebreakMatches.length; + } + /** + * Check indentation for lists of elements (arrays, objects, function params) + * @param elements List of elements that should be offset + * @param startToken The start token of the list that element should be aligned against, e.g. '[' + * @param endToken The end token of the list, e.g. ']' + * @param offset The amount that the elements should be offset + */ + function addElementListIndent(elements, startToken, endToken, offset) { + /** + * Gets the first token of a given element, including surrounding parentheses. + * @param element A node in the `elements` list + * @returns The first token of this element + */ + function getFirstToken(element) { + let token = sourceCode.getTokenBefore(element); + while (util_1.isOpeningParenToken(token) && token !== startToken) { + token = sourceCode.getTokenBefore(token); + } + return sourceCode.getTokenAfter(token); + } + // Run through all the tokens in the list, and offset them by one indent level (mainly for comments, other things will end up overridden) + offsets.setDesiredOffsets([startToken.range[1], endToken.range[0]], startToken, typeof offset === 'number' ? offset : 1); + offsets.setDesiredOffset(endToken, startToken, 0); + // If the preference is "first" but there is no first element (e.g. sparse arrays w/ empty first slot), fall back to 1 level. + const firstElement = elements[0]; + if (offset === 'first' && elements.length && !firstElement) { + return; + } + elements.forEach((element, index) => { + if (!element) { + // Skip holes in arrays + return; + } + if (offset === 'off') { + // Ignore the first token of every element if the "off" option is used + offsets.ignoreToken(getFirstToken(element)); + } + // Offset the following elements correctly relative to the first element + if (index === 0) { + return; + } + if (offset === 'first' && + tokenInfo.isFirstTokenOfLine(getFirstToken(element))) { + offsets.matchOffsetOf(getFirstToken(firstElement), getFirstToken(element)); + } + else { + const previousElement = elements[index - 1]; + const firstTokenOfPreviousElement = previousElement && getFirstToken(previousElement); + const previousElementLastToken = previousElement && sourceCode.getLastToken(previousElement); + if (previousElement && + previousElementLastToken && + previousElementLastToken.loc.end.line - + countTrailingLinebreaks(previousElementLastToken.value) > + startToken.loc.end.line) { + offsets.setDesiredOffsets([previousElement.range[1], element.range[1]], firstTokenOfPreviousElement, 0); + } + } + }); + } + /** + * Check and decide whether to check for indentation for blockless nodes + * Scenarios are for or while statements without braces around them + */ + function addBlocklessNodeIndent(node) { + if (node.type !== experimental_utils_1.AST_NODE_TYPES.BlockStatement) { + const lastParentToken = sourceCode.getTokenBefore(node, util_1.isNotOpeningParenToken); + let firstBodyToken = sourceCode.getFirstToken(node); + let lastBodyToken = sourceCode.getLastToken(node); + while (util_1.isOpeningParenToken(sourceCode.getTokenBefore(firstBodyToken)) && + util_1.isClosingParenToken(sourceCode.getTokenAfter(lastBodyToken))) { + firstBodyToken = sourceCode.getTokenBefore(firstBodyToken); + lastBodyToken = sourceCode.getTokenAfter(lastBodyToken); + } + offsets.setDesiredOffsets([firstBodyToken.range[0], lastBodyToken.range[1]], lastParentToken, 1); + /* + * For blockless nodes with semicolon-first style, don't indent the semicolon. + * e.g. + * if (foo) bar() + * ; [1, 2, 3].map(foo) + */ + const lastToken = sourceCode.getLastToken(node); + if (lastToken && + node.type !== experimental_utils_1.AST_NODE_TYPES.EmptyStatement && + util_1.isSemicolonToken(lastToken)) { + offsets.setDesiredOffset(lastToken, lastParentToken, 0); + } + } + } + /** + * Checks the indentation for nodes that are like function calls + */ + function addFunctionCallIndent(node) { + const openingParen = node.arguments.length + ? sourceCode.getFirstTokenBetween(node.callee, node.arguments[0], util_1.isOpeningParenToken) + : sourceCode.getLastToken(node, 1); + const closingParen = sourceCode.getLastToken(node); + parameterParens.add(openingParen); + parameterParens.add(closingParen); + offsets.setDesiredOffset(openingParen, sourceCode.getTokenBefore(openingParen), 0); + addElementListIndent(node.arguments, openingParen, closingParen, options.CallExpression.arguments); + } + /** + * Checks the indentation of parenthesized values, given a list of tokens in a program + * @param tokens A list of tokens + */ + function addParensIndent(tokens) { + const parenStack = []; + const parenPairs = []; + tokens.forEach(nextToken => { + // Accumulate a list of parenthesis pairs + if (util_1.isOpeningParenToken(nextToken)) { + parenStack.push(nextToken); + } + else if (util_1.isClosingParenToken(nextToken)) { + parenPairs.unshift({ left: parenStack.pop(), right: nextToken }); + } + }); + parenPairs.forEach(pair => { + const leftParen = pair.left; + const rightParen = pair.right; + // We only want to handle parens around expressions, so exclude parentheses that are in function parameters and function call arguments. + if (!parameterParens.has(leftParen) && + !parameterParens.has(rightParen)) { + const parenthesizedTokens = new Set(sourceCode.getTokensBetween(leftParen, rightParen)); + parenthesizedTokens.forEach(token => { + if (!parenthesizedTokens.has(offsets.getFirstDependency(token))) { + offsets.setDesiredOffset(token, leftParen, 1); + } + }); + } + offsets.setDesiredOffset(rightParen, leftParen, 0); + }); + } + /** + * Ignore all tokens within an unknown node whose offset do not depend + * on another token's offset within the unknown node + */ + function ignoreNode(node) { + const unknownNodeTokens = new Set(sourceCode.getTokens(node, { includeComments: true })); + unknownNodeTokens.forEach(token => { + if (!unknownNodeTokens.has(offsets.getFirstDependency(token))) { + const firstTokenOfLine = tokenInfo.getFirstTokenOfLine(token); + if (token === firstTokenOfLine) { + offsets.ignoreToken(token); + } + else { + offsets.setDesiredOffset(token, firstTokenOfLine, 0); + } + } + }); + } + /** + * Check whether the given token is on the first line of a statement. + * @param leafNode The expression node that the token belongs directly. + * @returns `true` if the token is on the first line of a statement. + */ + function isOnFirstLineOfStatement(token, leafNode) { + let node = leafNode; + while (node.parent && + !node.parent.type.endsWith('Statement') && + !node.parent.type.endsWith('Declaration')) { + node = node.parent; + } + node = node.parent; + return !node || node.loc.start.line === token.loc.start.line; + } + /** + * Check whether there are any blank (whitespace-only) lines between + * two tokens on separate lines. + * @returns `true` if the tokens are on separate lines and + * there exists a blank line between them, `false` otherwise. + */ + function hasBlankLinesBetween(firstToken, secondToken) { + const firstTokenLine = firstToken.loc.end.line; + const secondTokenLine = secondToken.loc.start.line; + if (firstTokenLine === secondTokenLine || + firstTokenLine === secondTokenLine - 1) { + return false; + } + for (let line = firstTokenLine + 1; line < secondTokenLine; ++line) { + if (!tokenInfo.firstTokensByLineNumber.has(line)) { + return true; + } + } + return false; + } + const ignoredNodeFirstTokens = new Set(); + const baseOffsetListeners = { + 'ArrayExpression, ArrayPattern'(node) { + var _a; + const openingBracket = sourceCode.getFirstToken(node); + const closingBracket = sourceCode.getTokenAfter((_a = node.elements[node.elements.length - 1]) !== null && _a !== void 0 ? _a : openingBracket, util_1.isClosingBracketToken); + addElementListIndent(node.elements, openingBracket, closingBracket, options.ArrayExpression); + }, + ArrowFunctionExpression(node) { + const firstToken = sourceCode.getFirstToken(node); + if (util_1.isOpeningParenToken(firstToken)) { + const openingParen = firstToken; + const closingParen = sourceCode.getTokenBefore(node.body, util_1.isClosingParenToken); + parameterParens.add(openingParen); + parameterParens.add(closingParen); + addElementListIndent(node.params, openingParen, closingParen, options.FunctionExpression.parameters); + } + addBlocklessNodeIndent(node.body); + }, + AssignmentExpression(node) { + const operator = sourceCode.getFirstTokenBetween(node.left, node.right, token => token.value === node.operator); + offsets.setDesiredOffsets([operator.range[0], node.range[1]], sourceCode.getLastToken(node.left), 1); + offsets.ignoreToken(operator); + offsets.ignoreToken(sourceCode.getTokenAfter(operator)); + }, + 'BinaryExpression, LogicalExpression'(node) { + const operator = sourceCode.getFirstTokenBetween(node.left, node.right, token => token.value === node.operator); + /* + * For backwards compatibility, don't check BinaryExpression indents, e.g. + * var foo = bar && + * baz; + */ + const tokenAfterOperator = sourceCode.getTokenAfter(operator); + offsets.ignoreToken(operator); + offsets.ignoreToken(tokenAfterOperator); + offsets.setDesiredOffset(tokenAfterOperator, operator, 0); + }, + 'BlockStatement, ClassBody'(node) { + let blockIndentLevel; + if (node.parent && isOuterIIFE(node.parent)) { + blockIndentLevel = options.outerIIFEBody; + } + else if (node.parent && + (node.parent.type === experimental_utils_1.AST_NODE_TYPES.FunctionExpression || + node.parent.type === experimental_utils_1.AST_NODE_TYPES.ArrowFunctionExpression)) { + blockIndentLevel = options.FunctionExpression.body; + } + else if (node.parent && + node.parent.type === experimental_utils_1.AST_NODE_TYPES.FunctionDeclaration) { + blockIndentLevel = options.FunctionDeclaration.body; + } + else { + blockIndentLevel = 1; + } + /* + * For blocks that aren't lone statements, ensure that the opening curly brace + * is aligned with the parent. + */ + if (node.parent && !STATEMENT_LIST_PARENTS.has(node.parent.type)) { + offsets.setDesiredOffset(sourceCode.getFirstToken(node), sourceCode.getFirstToken(node.parent), 0); + } + addElementListIndent(node.body, sourceCode.getFirstToken(node), sourceCode.getLastToken(node), blockIndentLevel); + }, + CallExpression: addFunctionCallIndent, + 'ClassDeclaration[superClass], ClassExpression[superClass]'(node) { + const classToken = sourceCode.getFirstToken(node); + const extendsToken = sourceCode.getTokenBefore(node.superClass, util_1.isNotOpeningParenToken); + offsets.setDesiredOffsets([extendsToken.range[0], node.body.range[0]], classToken, 1); + }, + ConditionalExpression(node) { + const firstToken = sourceCode.getFirstToken(node); + // `flatTernaryExpressions` option is for the following style: + // var a = + // foo > 0 ? bar : + // foo < 0 ? baz : + // /*else*/ qiz ; + if (!options.flatTernaryExpressions || + node.test.loc.end.line !== node.consequent.loc.start.line || + isOnFirstLineOfStatement(firstToken, node)) { + const questionMarkToken = sourceCode.getFirstTokenBetween(node.test, node.consequent, token => token.type === experimental_utils_1.AST_TOKEN_TYPES.Punctuator && token.value === '?'); + const colonToken = sourceCode.getFirstTokenBetween(node.consequent, node.alternate, token => token.type === experimental_utils_1.AST_TOKEN_TYPES.Punctuator && token.value === ':'); + const firstConsequentToken = sourceCode.getTokenAfter(questionMarkToken); + const lastConsequentToken = sourceCode.getTokenBefore(colonToken); + const firstAlternateToken = sourceCode.getTokenAfter(colonToken); + offsets.setDesiredOffset(questionMarkToken, firstToken, 1); + offsets.setDesiredOffset(colonToken, firstToken, 1); + offsets.setDesiredOffset(firstConsequentToken, firstToken, 1); + /* + * The alternate and the consequent should usually have the same indentation. + * If they share part of a line, align the alternate against the first token of the consequent. + * This allows the alternate to be indented correctly in cases like this: + * foo ? ( + * bar + * ) : ( // this '(' is aligned with the '(' above, so it's considered to be aligned with `foo` + * baz // as a result, `baz` is offset by 1 rather than 2 + * ) + */ + if (lastConsequentToken.loc.end.line === + firstAlternateToken.loc.start.line) { + offsets.setDesiredOffset(firstAlternateToken, firstConsequentToken, 0); + } + else { + /** + * If the alternate and consequent do not share part of a line, offset the alternate from the first + * token of the conditional expression. For example: + * foo ? bar + * : baz + * + * If `baz` were aligned with `bar` rather than being offset by 1 from `foo`, `baz` would end up + * having no expected indentation. + */ + offsets.setDesiredOffset(firstAlternateToken, firstToken, 1); + } + } + }, + 'DoWhileStatement, WhileStatement, ForInStatement, ForOfStatement': (node) => { + addBlocklessNodeIndent(node.body); + }, + ExportNamedDeclaration(node) { + if (node.declaration === null) { + const closingCurly = sourceCode.getLastToken(node, util_1.isClosingBraceToken); + // Indent the specifiers in `export {foo, bar, baz}` + addElementListIndent(node.specifiers, sourceCode.getFirstToken(node, { skip: 1 }), closingCurly, 1); + if (node.source) { + // Indent everything after and including the `from` token in `export {foo, bar, baz} from 'qux'` + offsets.setDesiredOffsets([closingCurly.range[1], node.range[1]], sourceCode.getFirstToken(node), 1); + } + } + }, + ForStatement(node) { + const forOpeningParen = sourceCode.getFirstToken(node, 1); + if (node.init) { + offsets.setDesiredOffsets(node.init.range, forOpeningParen, 1); + } + if (node.test) { + offsets.setDesiredOffsets(node.test.range, forOpeningParen, 1); + } + if (node.update) { + offsets.setDesiredOffsets(node.update.range, forOpeningParen, 1); + } + addBlocklessNodeIndent(node.body); + }, + 'FunctionDeclaration, FunctionExpression'(node) { + const closingParen = sourceCode.getTokenBefore(node.body); + const openingParen = sourceCode.getTokenBefore(node.params.length ? node.params[0] : closingParen); + parameterParens.add(openingParen); + parameterParens.add(closingParen); + addElementListIndent(node.params, openingParen, closingParen, options[node.type].parameters); + }, + IfStatement(node) { + addBlocklessNodeIndent(node.consequent); + if (node.alternate && + node.alternate.type !== experimental_utils_1.AST_NODE_TYPES.IfStatement) { + addBlocklessNodeIndent(node.alternate); + } + }, + ImportDeclaration(node) { + if (node.specifiers.some(specifier => specifier.type === experimental_utils_1.AST_NODE_TYPES.ImportSpecifier)) { + const openingCurly = sourceCode.getFirstToken(node, util_1.isOpeningBraceToken); + const closingCurly = sourceCode.getLastToken(node, util_1.isClosingBraceToken); + addElementListIndent(node.specifiers.filter(specifier => specifier.type === experimental_utils_1.AST_NODE_TYPES.ImportSpecifier), openingCurly, closingCurly, options.ImportDeclaration); + } + const fromToken = sourceCode.getLastToken(node, token => token.type === experimental_utils_1.AST_TOKEN_TYPES.Identifier && token.value === 'from'); + const sourceToken = sourceCode.getLastToken(node, token => token.type === experimental_utils_1.AST_TOKEN_TYPES.String); + const semiToken = sourceCode.getLastToken(node, token => token.type === experimental_utils_1.AST_TOKEN_TYPES.Punctuator && token.value === ';'); + if (fromToken) { + const end = semiToken && semiToken.range[1] === sourceToken.range[1] + ? node.range[1] + : sourceToken.range[1]; + offsets.setDesiredOffsets([fromToken.range[0], end], sourceCode.getFirstToken(node), 1); + } + }, + 'MemberExpression, JSXMemberExpression, MetaProperty'(node) { + const object = node.type === experimental_utils_1.AST_NODE_TYPES.MetaProperty ? node.meta : node.object; + const isComputed = 'computed' in node && node.computed; + const firstNonObjectToken = sourceCode.getFirstTokenBetween(object, node.property, util_1.isNotClosingParenToken); + const secondNonObjectToken = sourceCode.getTokenAfter(firstNonObjectToken); + const objectParenCount = sourceCode.getTokensBetween(object, node.property, { filter: util_1.isClosingParenToken }).length; + const firstObjectToken = objectParenCount + ? sourceCode.getTokenBefore(object, { skip: objectParenCount - 1 }) + : sourceCode.getFirstToken(object); + const lastObjectToken = sourceCode.getTokenBefore(firstNonObjectToken); + const firstPropertyToken = isComputed + ? firstNonObjectToken + : secondNonObjectToken; + if (isComputed) { + // For computed MemberExpressions, match the closing bracket with the opening bracket. + offsets.setDesiredOffset(sourceCode.getLastToken(node), firstNonObjectToken, 0); + offsets.setDesiredOffsets(node.property.range, firstNonObjectToken, 1); + } + /* + * If the object ends on the same line that the property starts, match against the last token + * of the object, to ensure that the MemberExpression is not indented. + * + * Otherwise, match against the first token of the object, e.g. + * foo + * .bar + * .baz // <-- offset by 1 from `foo` + */ + const offsetBase = lastObjectToken.loc.end.line === firstPropertyToken.loc.start.line + ? lastObjectToken + : firstObjectToken; + if (typeof options.MemberExpression === 'number') { + // Match the dot (for non-computed properties) or the opening bracket (for computed properties) against the object. + offsets.setDesiredOffset(firstNonObjectToken, offsetBase, options.MemberExpression); + /* + * For computed MemberExpressions, match the first token of the property against the opening bracket. + * Otherwise, match the first token of the property against the object. + */ + offsets.setDesiredOffset(secondNonObjectToken, isComputed ? firstNonObjectToken : offsetBase, options.MemberExpression); + } + else { + // If the MemberExpression option is off, ignore the dot and the first token of the property. + offsets.ignoreToken(firstNonObjectToken); + offsets.ignoreToken(secondNonObjectToken); + // To ignore the property indentation, ensure that the property tokens depend on the ignored tokens. + offsets.setDesiredOffset(firstNonObjectToken, offsetBase, 0); + offsets.setDesiredOffset(secondNonObjectToken, firstNonObjectToken, 0); + } + }, + NewExpression(node) { + // Only indent the arguments if the NewExpression has parens (e.g. `new Foo(bar)` or `new Foo()`, but not `new Foo` + if (node.arguments.length > 0 || + (util_1.isClosingParenToken(sourceCode.getLastToken(node)) && + util_1.isOpeningParenToken(sourceCode.getLastToken(node, 1)))) { + addFunctionCallIndent(node); + } + }, + 'ObjectExpression, ObjectPattern'(node) { + const openingCurly = sourceCode.getFirstToken(node); + const closingCurly = sourceCode.getTokenAfter(node.properties.length + ? node.properties[node.properties.length - 1] + : openingCurly, util_1.isClosingBraceToken); + addElementListIndent(node.properties, openingCurly, closingCurly, options.ObjectExpression); + }, + Property(node) { + if (!node.shorthand && !node.method && node.kind === 'init') { + const colon = sourceCode.getFirstTokenBetween(node.key, node.value, util_1.isColonToken); + offsets.ignoreToken(sourceCode.getTokenAfter(colon)); + } + }, + SwitchStatement(node) { + const openingCurly = sourceCode.getTokenAfter(node.discriminant, util_1.isOpeningBraceToken); + const closingCurly = sourceCode.getLastToken(node); + offsets.setDesiredOffsets([openingCurly.range[1], closingCurly.range[0]], openingCurly, options.SwitchCase); + if (node.cases.length) { + sourceCode + .getTokensBetween(node.cases[node.cases.length - 1], closingCurly, { + includeComments: true, + filter: util_1.isCommentToken, + }) + .forEach(token => offsets.ignoreToken(token)); + } + }, + SwitchCase(node) { + if (!(node.consequent.length === 1 && + node.consequent[0].type === experimental_utils_1.AST_NODE_TYPES.BlockStatement)) { + const caseKeyword = sourceCode.getFirstToken(node); + const tokenAfterCurrentCase = sourceCode.getTokenAfter(node); + offsets.setDesiredOffsets([caseKeyword.range[1], tokenAfterCurrentCase.range[0]], caseKeyword, 1); + } + }, + TemplateLiteral(node) { + node.expressions.forEach((_, index) => { + const previousQuasi = node.quasis[index]; + const nextQuasi = node.quasis[index + 1]; + const tokenToAlignFrom = previousQuasi.loc.start.line === previousQuasi.loc.end.line + ? sourceCode.getFirstToken(previousQuasi) + : null; + offsets.setDesiredOffsets([previousQuasi.range[1], nextQuasi.range[0]], tokenToAlignFrom, 1); + offsets.setDesiredOffset(sourceCode.getFirstToken(nextQuasi), tokenToAlignFrom, 0); + }); + }, + VariableDeclaration(node) { + if (node.declarations.length === 0) { + return; + } + let variableIndent = Object.prototype.hasOwnProperty.call(options.VariableDeclarator, node.kind) + ? options.VariableDeclarator[node.kind] + : DEFAULT_VARIABLE_INDENT; + const firstToken = sourceCode.getFirstToken(node); + const lastToken = sourceCode.getLastToken(node); + if (variableIndent === 'first') { + if (node.declarations.length > 1) { + addElementListIndent(node.declarations, firstToken, lastToken, 'first'); + return; + } + variableIndent = DEFAULT_VARIABLE_INDENT; + } + if (node.declarations[node.declarations.length - 1].loc.start.line > + node.loc.start.line) { + /* + * VariableDeclarator indentation is a bit different from other forms of indentation, in that the + * indentation of an opening bracket sometimes won't match that of a closing bracket. For example, + * the following indentations are correct: + * + * var foo = { + * ok: true + * }; + * + * var foo = { + * ok: true, + * }, + * bar = 1; + * + * Account for when exiting the AST (after indentations have already been set for the nodes in + * the declaration) by manually increasing the indentation level of the tokens in this declarator + * on the same line as the start of the declaration, provided that there are declarators that + * follow this one. + */ + offsets.setDesiredOffsets(node.range, firstToken, variableIndent, true); + } + else { + offsets.setDesiredOffsets(node.range, firstToken, variableIndent); + } + if (util_1.isSemicolonToken(lastToken)) { + offsets.ignoreToken(lastToken); + } + }, + VariableDeclarator(node) { + if (node.init) { + const equalOperator = sourceCode.getTokenBefore(node.init, util_1.isNotOpeningParenToken); + const tokenAfterOperator = sourceCode.getTokenAfter(equalOperator); + offsets.ignoreToken(equalOperator); + offsets.ignoreToken(tokenAfterOperator); + offsets.setDesiredOffsets([tokenAfterOperator.range[0], node.range[1]], equalOperator, 1); + offsets.setDesiredOffset(equalOperator, sourceCode.getLastToken(node.id), 0); + } + }, + 'JSXAttribute[value]'(node) { + const nodeValue = node.value; + const equalsToken = sourceCode.getFirstTokenBetween(node.name, nodeValue, token => token.type === experimental_utils_1.AST_TOKEN_TYPES.Punctuator && token.value === '='); + offsets.setDesiredOffsets([equalsToken.range[0], nodeValue.range[1]], sourceCode.getFirstToken(node.name), 1); + }, + JSXElement(node) { + if (node.closingElement) { + addElementListIndent(node.children, sourceCode.getFirstToken(node.openingElement), sourceCode.getFirstToken(node.closingElement), 1); + } + }, + JSXOpeningElement(node) { + const firstToken = sourceCode.getFirstToken(node); + let closingToken; + if (node.selfClosing) { + closingToken = sourceCode.getLastToken(node, { skip: 1 }); + offsets.setDesiredOffset(sourceCode.getLastToken(node), closingToken, 0); + } + else { + closingToken = sourceCode.getLastToken(node); + } + offsets.setDesiredOffsets(node.name.range, sourceCode.getFirstToken(node)); + addElementListIndent(node.attributes, firstToken, closingToken, 1); + }, + JSXClosingElement(node) { + const firstToken = sourceCode.getFirstToken(node); + offsets.setDesiredOffsets(node.name.range, firstToken, 1); + }, + JSXExpressionContainer(node) { + const openingCurly = sourceCode.getFirstToken(node); + const closingCurly = sourceCode.getLastToken(node); + offsets.setDesiredOffsets([openingCurly.range[1], closingCurly.range[0]], openingCurly, 1); + }, + '*'(node) { + const firstToken = sourceCode.getFirstToken(node); + // Ensure that the children of every node are indented at least as much as the first token. + if (firstToken && !ignoredNodeFirstTokens.has(firstToken)) { + offsets.setDesiredOffsets(node.range, firstToken, 0); + } + }, + }; + const listenerCallQueue = []; + /* + * To ignore the indentation of a node: + * 1. Don't call the node's listener when entering it (if it has a listener) + * 2. Don't set any offsets against the first token of the node. + * 3. Call `ignoreNode` on the node sometime after exiting it and before validating offsets. + */ + const offsetListeners = Object.keys(baseOffsetListeners).reduce( + /* + * Offset listener calls are deferred until traversal is finished, and are called as + * part of the final `Program:exit` listener. This is necessary because a node might + * be matched by multiple selectors. + * + * Example: Suppose there is an offset listener for `Identifier`, and the user has + * specified in configuration that `MemberExpression > Identifier` should be ignored. + * Due to selector specificity rules, the `Identifier` listener will get called first. However, + * if a given Identifier node is supposed to be ignored, then the `Identifier` offset listener + * should not have been called at all. Without doing extra selector matching, we don't know + * whether the Identifier matches the `MemberExpression > Identifier` selector until the + * `MemberExpression > Identifier` listener is called. + * + * To avoid this, the `Identifier` listener isn't called until traversal finishes and all + * ignored nodes are known. + */ + (acc, key) => { + const listener = baseOffsetListeners[key]; + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + acc[key] = node => listenerCallQueue.push({ listener, node }); + return acc; + }, {}); + // For each ignored node selector, set up a listener to collect it into the `ignoredNodes` set. + const ignoredNodes = new Set(); + /** + * Ignores a node + * @param node The node to ignore + */ + function addToIgnoredNodes(node) { + ignoredNodes.add(node); + ignoredNodeFirstTokens.add(sourceCode.getFirstToken(node)); + } + const ignoredNodeListeners = options.ignoredNodes.reduce((listeners, ignoredSelector) => Object.assign(listeners, { [ignoredSelector]: addToIgnoredNodes }), {}); + /* + * Join the listeners, and add a listener to verify that all tokens actually have the correct indentation + * at the end. + * + * Using Object.assign will cause some offset listeners to be overwritten if the same selector also appears + * in `ignoredNodeListeners`. This isn't a problem because all of the matching nodes will be ignored, + * so those listeners wouldn't be called anyway. + */ + return Object.assign(offsetListeners, ignoredNodeListeners, { + '*:exit'(node) { + // If a node's type is nonstandard, we can't tell how its children should be offset, so ignore it. + if (!KNOWN_NODES.has(node.type)) { + addToIgnoredNodes(node); + } + }, + 'Program:exit'() { + // If ignoreComments option is enabled, ignore all comment tokens. + if (options.ignoreComments) { + sourceCode + .getAllComments() + .forEach(comment => offsets.ignoreToken(comment)); + } + // Invoke the queued offset listeners for the nodes that aren't ignored. + listenerCallQueue + .filter(nodeInfo => !ignoredNodes.has(nodeInfo.node)) + .forEach(nodeInfo => nodeInfo.listener(nodeInfo.node)); + // Update the offsets for ignored nodes to prevent their child tokens from being reported. + ignoredNodes.forEach(ignoreNode); + addParensIndent(sourceCode.ast.tokens); + /* + * Create a Map from (tokenOrComment) => (precedingToken). + * This is necessary because sourceCode.getTokenBefore does not handle a comment as an argument correctly. + */ + const precedingTokens = sourceCode.ast.comments.reduce((commentMap, comment) => { + const tokenOrCommentBefore = sourceCode.getTokenBefore(comment, { + includeComments: true, + }); + return commentMap.set(comment, commentMap.has(tokenOrCommentBefore) + ? commentMap.get(tokenOrCommentBefore) + : tokenOrCommentBefore); + }, new WeakMap()); + sourceCode.lines.forEach((_, lineIndex) => { + const lineNumber = lineIndex + 1; + if (!tokenInfo.firstTokensByLineNumber.has(lineNumber)) { + // Don't check indentation on blank lines + return; + } + const firstTokenOfLine = tokenInfo.firstTokensByLineNumber.get(lineNumber); + if (firstTokenOfLine.loc.start.line !== lineNumber) { + // Don't check the indentation of multi-line tokens (e.g. template literals or block comments) twice. + return; + } + // If the token matches the expected expected indentation, don't report it. + if (validateTokenIndent(firstTokenOfLine, offsets.getDesiredIndent(firstTokenOfLine))) { + return; + } + if (util_1.isCommentToken(firstTokenOfLine)) { + const tokenBefore = precedingTokens.get(firstTokenOfLine); + const tokenAfter = tokenBefore + ? sourceCode.getTokenAfter(tokenBefore) + : sourceCode.ast.tokens[0]; + const mayAlignWithBefore = tokenBefore && + !hasBlankLinesBetween(tokenBefore, firstTokenOfLine); + const mayAlignWithAfter = tokenAfter && !hasBlankLinesBetween(firstTokenOfLine, tokenAfter); + // If a comment matches the expected indentation of the token immediately before or after, don't report it. + if ((mayAlignWithBefore && + validateTokenIndent(firstTokenOfLine, offsets.getDesiredIndent(tokenBefore))) || + (mayAlignWithAfter && + validateTokenIndent(firstTokenOfLine, offsets.getDesiredIndent(tokenAfter)))) { + return; + } + } + // Otherwise, report the token/comment. + report(firstTokenOfLine, offsets.getDesiredIndent(firstTokenOfLine)); + }); + }, + }); + }, +}); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/index.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/index.js.map new file mode 100644 index 000000000..5556626d7 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rules/indent-new-do-not-use/index.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,eAAe;AACf,gFAAgF;;AAEhF,8EAK+C;AAG/C,mDAAgD;AAChD,2CAAwC;AACxC,qCAcoB;AAEpB,MAAM,sBAAsB,GAAG,2BAA2B,CAAC;AAC3D,MAAM,gBAAgB,GAAG,OAAO,CAAC;AAEjC,gFAAgF;AAChF,kBAAkB;AAClB,gFAAgF;AAEhF,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC;IAC1B,mCA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O,CAAC,gBAAgB,CAAC,UAAU,CAAC,CACrC,CAAC,EACJ;4BACA,OAAO;yBACR;qBACF;oBAED,uCAAuC;oBACvC,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC,CAAC;gBACvE,CAAC,CAAC,CAAC;YACL,CAAC;SACF,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent.js new file mode 100644 index 000000000..bdb0d7a29 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent.js @@ -0,0 +1,412 @@ +"use strict"; +/** + * Note this file is rather type-unsafe in its current state. + * This is due to some really funky type conversions between different node types. + * This is done intentionally based on the internal implementation of the base indent rule. + */ +/* eslint-disable @typescript-eslint/no-explicit-any */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const indent_1 = __importDefault(require("eslint/lib/rules/indent")); +const util = __importStar(require("../util")); +const KNOWN_NODES = new Set([ + // Class properties aren't yet supported by eslint... + experimental_utils_1.AST_NODE_TYPES.ClassProperty, + // ts keywords + experimental_utils_1.AST_NODE_TYPES.TSAbstractKeyword, + experimental_utils_1.AST_NODE_TYPES.TSAnyKeyword, + experimental_utils_1.AST_NODE_TYPES.TSBooleanKeyword, + experimental_utils_1.AST_NODE_TYPES.TSNeverKeyword, + experimental_utils_1.AST_NODE_TYPES.TSNumberKeyword, + experimental_utils_1.AST_NODE_TYPES.TSStringKeyword, + experimental_utils_1.AST_NODE_TYPES.TSSymbolKeyword, + experimental_utils_1.AST_NODE_TYPES.TSUndefinedKeyword, + experimental_utils_1.AST_NODE_TYPES.TSUnknownKeyword, + experimental_utils_1.AST_NODE_TYPES.TSVoidKeyword, + experimental_utils_1.AST_NODE_TYPES.TSNullKeyword, + // ts specific nodes we want to support + experimental_utils_1.AST_NODE_TYPES.TSAbstractClassProperty, + experimental_utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition, + experimental_utils_1.AST_NODE_TYPES.TSArrayType, + experimental_utils_1.AST_NODE_TYPES.TSAsExpression, + experimental_utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration, + experimental_utils_1.AST_NODE_TYPES.TSConditionalType, + experimental_utils_1.AST_NODE_TYPES.TSConstructorType, + experimental_utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration, + experimental_utils_1.AST_NODE_TYPES.TSDeclareFunction, + experimental_utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression, + experimental_utils_1.AST_NODE_TYPES.TSEnumDeclaration, + experimental_utils_1.AST_NODE_TYPES.TSEnumMember, + experimental_utils_1.AST_NODE_TYPES.TSExportAssignment, + experimental_utils_1.AST_NODE_TYPES.TSExternalModuleReference, + experimental_utils_1.AST_NODE_TYPES.TSFunctionType, + experimental_utils_1.AST_NODE_TYPES.TSImportType, + experimental_utils_1.AST_NODE_TYPES.TSIndexedAccessType, + experimental_utils_1.AST_NODE_TYPES.TSIndexSignature, + experimental_utils_1.AST_NODE_TYPES.TSInferType, + experimental_utils_1.AST_NODE_TYPES.TSInterfaceBody, + experimental_utils_1.AST_NODE_TYPES.TSInterfaceDeclaration, + experimental_utils_1.AST_NODE_TYPES.TSInterfaceHeritage, + experimental_utils_1.AST_NODE_TYPES.TSIntersectionType, + experimental_utils_1.AST_NODE_TYPES.TSImportEqualsDeclaration, + experimental_utils_1.AST_NODE_TYPES.TSLiteralType, + experimental_utils_1.AST_NODE_TYPES.TSMappedType, + experimental_utils_1.AST_NODE_TYPES.TSMethodSignature, + 'TSMinusToken', + experimental_utils_1.AST_NODE_TYPES.TSModuleBlock, + experimental_utils_1.AST_NODE_TYPES.TSModuleDeclaration, + experimental_utils_1.AST_NODE_TYPES.TSNonNullExpression, + experimental_utils_1.AST_NODE_TYPES.TSParameterProperty, + experimental_utils_1.AST_NODE_TYPES.TSParenthesizedType, + 'TSPlusToken', + experimental_utils_1.AST_NODE_TYPES.TSPropertySignature, + experimental_utils_1.AST_NODE_TYPES.TSQualifiedName, + 'TSQuestionToken', + experimental_utils_1.AST_NODE_TYPES.TSRestType, + experimental_utils_1.AST_NODE_TYPES.TSThisType, + experimental_utils_1.AST_NODE_TYPES.TSTupleType, + experimental_utils_1.AST_NODE_TYPES.TSTypeAnnotation, + experimental_utils_1.AST_NODE_TYPES.TSTypeLiteral, + experimental_utils_1.AST_NODE_TYPES.TSTypeOperator, + experimental_utils_1.AST_NODE_TYPES.TSTypeParameter, + experimental_utils_1.AST_NODE_TYPES.TSTypeParameterDeclaration, + experimental_utils_1.AST_NODE_TYPES.TSTypeParameterInstantiation, + experimental_utils_1.AST_NODE_TYPES.TSTypeReference, + experimental_utils_1.AST_NODE_TYPES.TSUnionType, + experimental_utils_1.AST_NODE_TYPES.Decorator, +]); +exports.default = util.createRule({ + name: 'indent', + meta: { + type: 'layout', + docs: { + description: 'Enforce consistent indentation', + category: 'Stylistic Issues', + // too opinionated to be recommended + recommended: false, + extendsBaseRule: true, + }, + fixable: 'whitespace', + schema: indent_1.default.meta.schema, + messages: (_a = indent_1.default.meta.messages) !== null && _a !== void 0 ? _a : { + wrongIndentation: 'Expected indentation of {{expected}} but found {{actual}}.', + }, + }, + defaultOptions: [ + // typescript docs and playground use 4 space indent + 4, + { + // typescript docs indent the case from the switch + // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-8.html#example-4 + SwitchCase: 1, + flatTernaryExpressions: false, + ignoredNodes: [], + }, + ], + create(context, optionsWithDefaults) { + // because we extend the base rule, have to update opts on the context + // the context defines options as readonly though... + const contextWithDefaults = Object.create(context, { + options: { + writable: false, + configurable: false, + value: optionsWithDefaults, + }, + }); + const rules = indent_1.default.create(contextWithDefaults); + /** + * Converts from a TSPropertySignature to a Property + * @param node a TSPropertySignature node + * @param [type] the type to give the new node + * @returns a Property node + */ + function TSPropertySignatureToProperty(node, type = experimental_utils_1.AST_NODE_TYPES.Property) { + const base = { + // indent doesn't actually use these + key: null, + value: null, + // Property flags + computed: false, + method: false, + kind: 'init', + // this will stop eslint from interrogating the type literal + shorthand: true, + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + }; + if (type === experimental_utils_1.AST_NODE_TYPES.Property) { + return Object.assign({ type }, base); + } + else { + return Object.assign({ type, static: false, readonly: false, declare: false }, base); + } + } + return Object.assign({}, rules, { + // overwrite the base rule here so we can use our KNOWN_NODES list instead + '*:exit'(node) { + // For nodes we care about, skip the default handling, because it just marks the node as ignored... + if (!KNOWN_NODES.has(node.type)) { + rules['*:exit'](node); + } + }, + VariableDeclaration(node) { + // https://github.com/typescript-eslint/typescript-eslint/issues/441 + if (node.declarations.length === 0) { + return; + } + return rules.VariableDeclaration(node); + }, + TSAsExpression(node) { + // transform it to a BinaryExpression + return rules['BinaryExpression, LogicalExpression']({ + type: experimental_utils_1.AST_NODE_TYPES.BinaryExpression, + operator: 'as', + left: node.expression, + // the first typeAnnotation includes the as token + right: node.typeAnnotation, + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + }); + }, + TSConditionalType(node) { + // transform it to a ConditionalExpression + return rules.ConditionalExpression({ + type: experimental_utils_1.AST_NODE_TYPES.ConditionalExpression, + test: { + type: experimental_utils_1.AST_NODE_TYPES.BinaryExpression, + operator: 'extends', + left: node.checkType, + right: node.extendsType, + // location data + range: [node.checkType.range[0], node.extendsType.range[1]], + loc: { + start: node.checkType.loc.start, + end: node.extendsType.loc.end, + }, + }, + consequent: node.trueType, + alternate: node.falseType, + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + }); + }, + 'TSEnumDeclaration, TSTypeLiteral'(node) { + // transform it to an ObjectExpression + return rules['ObjectExpression, ObjectPattern']({ + type: experimental_utils_1.AST_NODE_TYPES.ObjectExpression, + properties: node.members.map(member => TSPropertySignatureToProperty(member)), + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + }); + }, + TSImportEqualsDeclaration(node) { + // transform it to an VariableDeclaration + // use VariableDeclaration instead of ImportDeclaration because it's essentially the same thing + const { id, moduleReference } = node; + return rules.VariableDeclaration({ + type: experimental_utils_1.AST_NODE_TYPES.VariableDeclaration, + kind: 'const', + declarations: [ + { + type: experimental_utils_1.AST_NODE_TYPES.VariableDeclarator, + range: [id.range[0], moduleReference.range[1]], + loc: { + start: id.loc.start, + end: moduleReference.loc.end, + }, + id: id, + init: { + type: experimental_utils_1.AST_NODE_TYPES.CallExpression, + callee: { + type: experimental_utils_1.AST_NODE_TYPES.Identifier, + name: 'require', + range: [ + moduleReference.range[0], + moduleReference.range[0] + 'require'.length, + ], + loc: { + start: moduleReference.loc.start, + end: { + line: moduleReference.loc.end.line, + column: moduleReference.loc.start.line + 'require'.length, + }, + }, + }, + arguments: 'expression' in moduleReference + ? [moduleReference.expression] + : [], + // location data + range: moduleReference.range, + loc: moduleReference.loc, + }, + }, + ], + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + }); + }, + TSIndexedAccessType(node) { + // convert to a MemberExpression + return rules['MemberExpression, JSXMemberExpression, MetaProperty']({ + type: experimental_utils_1.AST_NODE_TYPES.MemberExpression, + object: node.objectType, + property: node.indexType, + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + optional: false, + computed: true, + }); + }, + TSInterfaceBody(node) { + // transform it to an ClassBody + return rules['BlockStatement, ClassBody']({ + type: experimental_utils_1.AST_NODE_TYPES.ClassBody, + body: node.body.map(p => TSPropertySignatureToProperty(p, experimental_utils_1.AST_NODE_TYPES.ClassProperty)), + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + }); + }, + 'TSInterfaceDeclaration[extends.length > 0]'(node) { + // transform it to a ClassDeclaration + return rules['ClassDeclaration[superClass], ClassExpression[superClass]']({ + type: experimental_utils_1.AST_NODE_TYPES.ClassDeclaration, + body: node.body, + id: null, + // TODO: This is invalid, there can be more than one extends in interface + superClass: node.extends[0].expression, + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + }); + }, + TSMappedType(node) { + const sourceCode = context.getSourceCode(); + const squareBracketStart = sourceCode.getTokenBefore(node.typeParameter); + // transform it to an ObjectExpression + return rules['ObjectExpression, ObjectPattern']({ + type: experimental_utils_1.AST_NODE_TYPES.ObjectExpression, + properties: [ + { + type: experimental_utils_1.AST_NODE_TYPES.Property, + key: node.typeParameter, + value: node.typeAnnotation, + // location data + range: [ + squareBracketStart.range[0], + node.typeAnnotation + ? node.typeAnnotation.range[1] + : squareBracketStart.range[0], + ], + loc: { + start: squareBracketStart.loc.start, + end: node.typeAnnotation + ? node.typeAnnotation.loc.end + : squareBracketStart.loc.end, + }, + kind: 'init', + computed: false, + method: false, + shorthand: false, + }, + ], + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + }); + }, + TSModuleBlock(node) { + // transform it to a BlockStatement + return rules['BlockStatement, ClassBody']({ + type: experimental_utils_1.AST_NODE_TYPES.BlockStatement, + body: node.body, + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + }); + }, + TSQualifiedName(node) { + return rules['MemberExpression, JSXMemberExpression, MetaProperty']({ + type: experimental_utils_1.AST_NODE_TYPES.MemberExpression, + object: node.left, + property: node.right, + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + optional: false, + computed: false, + }); + }, + TSTupleType(node) { + // transform it to an ArrayExpression + return rules['ArrayExpression, ArrayPattern']({ + type: experimental_utils_1.AST_NODE_TYPES.ArrayExpression, + elements: node.elementTypes, + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + }); + }, + TSTypeParameterDeclaration(node) { + if (!node.params.length) { + return; + } + const [name, ...attributes] = node.params; + // JSX is about the closest we can get because the angle brackets + // it's not perfect but it works! + return rules.JSXOpeningElement({ + type: experimental_utils_1.AST_NODE_TYPES.JSXOpeningElement, + selfClosing: false, + name: name, + attributes: attributes, + // location data + parent: node.parent, + range: node.range, + loc: node.loc, + }); + }, + }); + }, +}); +//# sourceMappingURL=indent.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent.js.map new file mode 100644 index 000000000..9ec4bd57d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent.js.map @@ -0,0 +1 @@ +{"version":3,"file":"indent.js","sourceRoot":"","sources":["../../src/rules/indent.ts"],"names":[],"mappings":";AAAA;;;;GAIG;AACH,uDAAuD;;;;;;;;;;;;;;;;;;;;;;;;;AAEvD,8EAG+C;AAC/C,qEAA+C;AAC/C,8CAAgC;AAKhC,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC;IAC1B,qDAAqD;IACrD,mCAAc,CAAC,aAAa;IAE5B,cAAc;IACd,mCAAc,CAAC,iBAAiB;IAChC,mCAAc,CAAC,YAAY;IAC3B,mCAAc,CAAC,gBAAgB;IAC/B,mCAAc,CAAC,cAAc;IAC7B,mCAAc,CAAC,eAAe;IAC9B,mCAAc,CAAC,eAAe;IAC9B,mCAAc,CAAC,eAAe;IAC9B,mCAAc,CAAC,kBAAkB;IACjC,mCAAc,CAAC,gBAAgB;IAC/B,mCAAc,CAAC,aAAa;IAC5B,mCAAc,CAAC,a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ACjB,GAAG,EAAE,IAAI,CAAC,GAAG;iBACd,CAAC,CAAC;YACL,CAAC;YAED,0BAA0B,CAAC,IAAyC;gBAClE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;oBACvB,OAAO;iBACR;gBAED,MAAM,CAAC,IAAI,EAAE,GAAG,UAAU,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;gBAE1C,iEAAiE;gBACjE,iCAAiC;gBACjC,OAAO,KAAK,CAAC,iBAAiB,CAAC;oBAC7B,IAAI,EAAE,mCAAc,CAAC,iBAAiB;oBACtC,WAAW,EAAE,KAAK;oBAClB,IAAI,EAAE,IAAW;oBACjB,UAAU,EAAE,UAAiB;oBAE7B,gBAAgB;oBAChB,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,KAAK,EAAE,IAAI,CAAC,KAAK;oBACjB,GAAG,EAAE,IAAI,CAAC,GAAG;iBACd,CAAC,CAAC;YACL,CAAC;SACF,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.js new file mode 100644 index 000000000..3f69b8b27 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.js @@ -0,0 +1,220 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const adjacent_overload_signatures_1 = __importDefault(require("./adjacent-overload-signatures")); +const array_type_1 = __importDefault(require("./array-type")); +const await_thenable_1 = __importDefault(require("./await-thenable")); +const ban_ts_comment_1 = __importDefault(require("./ban-ts-comment")); +const ban_tslint_comment_1 = __importDefault(require("./ban-tslint-comment")); +const ban_types_1 = __importDefault(require("./ban-types")); +const brace_style_1 = __importDefault(require("./brace-style")); +const class_literal_property_style_1 = __importDefault(require("./class-literal-property-style")); +const comma_spacing_1 = __importDefault(require("./comma-spacing")); +const no_confusing_non_null_assertion_1 = __importDefault(require("./no-confusing-non-null-assertion")); +const consistent_type_assertions_1 = __importDefault(require("./consistent-type-assertions")); +const consistent_type_definitions_1 = __importDefault(require("./consistent-type-definitions")); +const consistent_type_imports_1 = __importDefault(require("./consistent-type-imports")); +const default_param_last_1 = __importDefault(require("./default-param-last")); +const dot_notation_1 = __importDefault(require("./dot-notation")); +const explicit_function_return_type_1 = __importDefault(require("./explicit-function-return-type")); +const explicit_member_accessibility_1 = __importDefault(require("./explicit-member-accessibility")); +const explicit_module_boundary_types_1 = __importDefault(require("./explicit-module-boundary-types")); +const func_call_spacing_1 = __importDefault(require("./func-call-spacing")); +const indent_1 = __importDefault(require("./indent")); +const init_declarations_1 = __importDefault(require("./init-declarations")); +const keyword_spacing_1 = __importDefault(require("./keyword-spacing")); +const lines_between_class_members_1 = __importDefault(require("./lines-between-class-members")); +const member_delimiter_style_1 = __importDefault(require("./member-delimiter-style")); +const member_ordering_1 = __importDefault(require("./member-ordering")); +const method_signature_style_1 = __importDefault(require("./method-signature-style")); +const naming_convention_1 = __importDefault(require("./naming-convention")); +const no_array_constructor_1 = __importDefault(require("./no-array-constructor")); +const no_base_to_string_1 = __importDefault(require("./no-base-to-string")); +const no_dupe_class_members_1 = __importDefault(require("./no-dupe-class-members")); +const no_dynamic_delete_1 = __importDefault(require("./no-dynamic-delete")); +const no_empty_function_1 = __importDefault(require("./no-empty-function")); +const no_empty_interface_1 = __importDefault(require("./no-empty-interface")); +const no_explicit_any_1 = __importDefault(require("./no-explicit-any")); +const no_implicit_any_catch_1 = __importDefault(require("./no-implicit-any-catch")); +const no_extraneous_class_1 = __importDefault(require("./no-extraneous-class")); +const no_extra_non_null_assertion_1 = __importDefault(require("./no-extra-non-null-assertion")); +const no_extra_parens_1 = __importDefault(require("./no-extra-parens")); +const no_extra_semi_1 = __importDefault(require("./no-extra-semi")); +const no_floating_promises_1 = __importDefault(require("./no-floating-promises")); +const no_for_in_array_1 = __importDefault(require("./no-for-in-array")); +const prefer_literal_enum_member_1 = __importDefault(require("./prefer-literal-enum-member")); +const no_implied_eval_1 = __importDefault(require("./no-implied-eval")); +const no_inferrable_types_1 = __importDefault(require("./no-inferrable-types")); +const no_invalid_this_1 = __importDefault(require("./no-invalid-this")); +const no_invalid_void_type_1 = __importDefault(require("./no-invalid-void-type")); +const no_loss_of_precision_1 = __importDefault(require("./no-loss-of-precision")); +const no_loop_func_1 = __importDefault(require("./no-loop-func")); +const no_magic_numbers_1 = __importDefault(require("./no-magic-numbers")); +const no_misused_new_1 = __importDefault(require("./no-misused-new")); +const no_misused_promises_1 = __importDefault(require("./no-misused-promises")); +const no_namespace_1 = __importDefault(require("./no-namespace")); +const no_non_null_asserted_optional_chain_1 = __importDefault(require("./no-non-null-asserted-optional-chain")); +const no_non_null_assertion_1 = __importDefault(require("./no-non-null-assertion")); +const no_parameter_properties_1 = __importDefault(require("./no-parameter-properties")); +const no_redeclare_1 = __importDefault(require("./no-redeclare")); +const no_require_imports_1 = __importDefault(require("./no-require-imports")); +const no_shadow_1 = __importDefault(require("./no-shadow")); +const no_this_alias_1 = __importDefault(require("./no-this-alias")); +const no_throw_literal_1 = __importDefault(require("./no-throw-literal")); +const no_type_alias_1 = __importDefault(require("./no-type-alias")); +const no_unnecessary_boolean_literal_compare_1 = __importDefault(require("./no-unnecessary-boolean-literal-compare")); +const no_unnecessary_condition_1 = __importDefault(require("./no-unnecessary-condition")); +const no_unnecessary_qualifier_1 = __importDefault(require("./no-unnecessary-qualifier")); +const no_unnecessary_type_arguments_1 = __importDefault(require("./no-unnecessary-type-arguments")); +const no_unnecessary_type_assertion_1 = __importDefault(require("./no-unnecessary-type-assertion")); +const no_unsafe_assignment_1 = __importDefault(require("./no-unsafe-assignment")); +const no_unsafe_call_1 = __importDefault(require("./no-unsafe-call")); +const no_unsafe_member_access_1 = __importDefault(require("./no-unsafe-member-access")); +const no_unsafe_return_1 = __importDefault(require("./no-unsafe-return")); +const no_unused_expressions_1 = __importDefault(require("./no-unused-expressions")); +const no_unused_vars_1 = __importDefault(require("./no-unused-vars")); +const no_unused_vars_experimental_1 = __importDefault(require("./no-unused-vars-experimental")); +const no_use_before_define_1 = __importDefault(require("./no-use-before-define")); +const no_useless_constructor_1 = __importDefault(require("./no-useless-constructor")); +const no_var_requires_1 = __importDefault(require("./no-var-requires")); +const prefer_as_const_1 = __importDefault(require("./prefer-as-const")); +const prefer_enum_initializers_1 = __importDefault(require("./prefer-enum-initializers")); +const prefer_for_of_1 = __importDefault(require("./prefer-for-of")); +const prefer_function_type_1 = __importDefault(require("./prefer-function-type")); +const prefer_includes_1 = __importDefault(require("./prefer-includes")); +const prefer_namespace_keyword_1 = __importDefault(require("./prefer-namespace-keyword")); +const prefer_nullish_coalescing_1 = __importDefault(require("./prefer-nullish-coalescing")); +const prefer_optional_chain_1 = __importDefault(require("./prefer-optional-chain")); +const prefer_readonly_1 = __importDefault(require("./prefer-readonly")); +const prefer_readonly_parameter_types_1 = __importDefault(require("./prefer-readonly-parameter-types")); +const prefer_reduce_type_parameter_1 = __importDefault(require("./prefer-reduce-type-parameter")); +const prefer_regexp_exec_1 = __importDefault(require("./prefer-regexp-exec")); +const prefer_string_starts_ends_with_1 = __importDefault(require("./prefer-string-starts-ends-with")); +const prefer_ts_expect_error_1 = __importDefault(require("./prefer-ts-expect-error")); +const promise_function_async_1 = __importDefault(require("./promise-function-async")); +const quotes_1 = __importDefault(require("./quotes")); +const require_array_sort_compare_1 = __importDefault(require("./require-array-sort-compare")); +const require_await_1 = __importDefault(require("./require-await")); +const restrict_plus_operands_1 = __importDefault(require("./restrict-plus-operands")); +const restrict_template_expressions_1 = __importDefault(require("./restrict-template-expressions")); +const return_await_1 = __importDefault(require("./return-await")); +const semi_1 = __importDefault(require("./semi")); +const space_before_function_paren_1 = __importDefault(require("./space-before-function-paren")); +const strict_boolean_expressions_1 = __importDefault(require("./strict-boolean-expressions")); +const switch_exhaustiveness_check_1 = __importDefault(require("./switch-exhaustiveness-check")); +const triple_slash_reference_1 = __importDefault(require("./triple-slash-reference")); +const type_annotation_spacing_1 = __importDefault(require("./type-annotation-spacing")); +const typedef_1 = __importDefault(require("./typedef")); +const unbound_method_1 = __importDefault(require("./unbound-method")); +const unified_signatures_1 = __importDefault(require("./unified-signatures")); +exports.default = { + 'adjacent-overload-signatures': adjacent_overload_signatures_1.default, + 'array-type': array_type_1.default, + 'await-thenable': await_thenable_1.default, + 'ban-ts-comment': ban_ts_comment_1.default, + 'ban-tslint-comment': ban_tslint_comment_1.default, + 'ban-types': ban_types_1.default, + 'brace-style': brace_style_1.default, + 'class-literal-property-style': class_literal_property_style_1.default, + 'comma-spacing': comma_spacing_1.default, + 'consistent-type-assertions': consistent_type_assertions_1.default, + 'consistent-type-definitions': consistent_type_definitions_1.default, + 'consistent-type-imports': consistent_type_imports_1.default, + 'default-param-last': default_param_last_1.default, + 'dot-notation': dot_notation_1.default, + 'explicit-function-return-type': explicit_function_return_type_1.default, + 'explicit-member-accessibility': explicit_member_accessibility_1.default, + 'explicit-module-boundary-types': explicit_module_boundary_types_1.default, + 'func-call-spacing': func_call_spacing_1.default, + 'init-declarations': init_declarations_1.default, + 'keyword-spacing': keyword_spacing_1.default, + 'lines-between-class-members': lines_between_class_members_1.default, + 'member-delimiter-style': member_delimiter_style_1.default, + 'member-ordering': member_ordering_1.default, + 'method-signature-style': method_signature_style_1.default, + 'naming-convention': naming_convention_1.default, + 'no-array-constructor': no_array_constructor_1.default, + 'no-base-to-string': no_base_to_string_1.default, + 'no-confusing-non-null-assertion': no_confusing_non_null_assertion_1.default, + 'no-dupe-class-members': no_dupe_class_members_1.default, + 'no-dynamic-delete': no_dynamic_delete_1.default, + 'no-empty-function': no_empty_function_1.default, + 'no-empty-interface': no_empty_interface_1.default, + 'no-explicit-any': no_explicit_any_1.default, + 'no-extra-non-null-assertion': no_extra_non_null_assertion_1.default, + 'no-extra-parens': no_extra_parens_1.default, + 'no-extra-semi': no_extra_semi_1.default, + 'no-extraneous-class': no_extraneous_class_1.default, + 'no-floating-promises': no_floating_promises_1.default, + 'no-for-in-array': no_for_in_array_1.default, + 'no-implicit-any-catch': no_implicit_any_catch_1.default, + 'no-implied-eval': no_implied_eval_1.default, + 'no-inferrable-types': no_inferrable_types_1.default, + 'no-invalid-this': no_invalid_this_1.default, + 'no-invalid-void-type': no_invalid_void_type_1.default, + 'no-loop-func': no_loop_func_1.default, + 'no-loss-of-precision': no_loss_of_precision_1.default, + 'no-magic-numbers': no_magic_numbers_1.default, + 'no-misused-new': no_misused_new_1.default, + 'no-misused-promises': no_misused_promises_1.default, + 'no-namespace': no_namespace_1.default, + 'no-non-null-asserted-optional-chain': no_non_null_asserted_optional_chain_1.default, + 'no-non-null-assertion': no_non_null_assertion_1.default, + 'no-parameter-properties': no_parameter_properties_1.default, + 'no-redeclare': no_redeclare_1.default, + 'no-require-imports': no_require_imports_1.default, + 'no-shadow': no_shadow_1.default, + 'no-this-alias': no_this_alias_1.default, + 'no-throw-literal': no_throw_literal_1.default, + 'no-type-alias': no_type_alias_1.default, + 'no-unnecessary-boolean-literal-compare': no_unnecessary_boolean_literal_compare_1.default, + 'no-unnecessary-condition': no_unnecessary_condition_1.default, + 'no-unnecessary-qualifier': no_unnecessary_qualifier_1.default, + 'no-unnecessary-type-arguments': no_unnecessary_type_arguments_1.default, + 'no-unnecessary-type-assertion': no_unnecessary_type_assertion_1.default, + 'no-unsafe-assignment': no_unsafe_assignment_1.default, + 'no-unsafe-call': no_unsafe_call_1.default, + 'no-unsafe-member-access': no_unsafe_member_access_1.default, + 'no-unsafe-return': no_unsafe_return_1.default, + 'no-unused-expressions': no_unused_expressions_1.default, + 'no-unused-vars-experimental': no_unused_vars_experimental_1.default, + 'no-unused-vars': no_unused_vars_1.default, + 'no-use-before-define': no_use_before_define_1.default, + 'no-useless-constructor': no_useless_constructor_1.default, + 'no-var-requires': no_var_requires_1.default, + 'prefer-as-const': prefer_as_const_1.default, + 'prefer-enum-initializers': prefer_enum_initializers_1.default, + 'prefer-for-of': prefer_for_of_1.default, + 'prefer-function-type': prefer_function_type_1.default, + 'prefer-includes': prefer_includes_1.default, + 'prefer-literal-enum-member': prefer_literal_enum_member_1.default, + 'prefer-namespace-keyword': prefer_namespace_keyword_1.default, + 'prefer-nullish-coalescing': prefer_nullish_coalescing_1.default, + 'prefer-optional-chain': prefer_optional_chain_1.default, + 'prefer-readonly-parameter-types': prefer_readonly_parameter_types_1.default, + 'prefer-readonly': prefer_readonly_1.default, + 'prefer-reduce-type-parameter': prefer_reduce_type_parameter_1.default, + 'prefer-regexp-exec': prefer_regexp_exec_1.default, + 'prefer-string-starts-ends-with': prefer_string_starts_ends_with_1.default, + 'prefer-ts-expect-error': prefer_ts_expect_error_1.default, + 'promise-function-async': promise_function_async_1.default, + 'require-array-sort-compare': require_array_sort_compare_1.default, + 'require-await': require_await_1.default, + 'restrict-plus-operands': restrict_plus_operands_1.default, + 'restrict-template-expressions': restrict_template_expressions_1.default, + 'return-await': return_await_1.default, + 'space-before-function-paren': space_before_function_paren_1.default, + 'strict-boolean-expressions': strict_boolean_expressions_1.default, + 'switch-exhaustiveness-check': switch_exhaustiveness_check_1.default, + 'triple-slash-reference': triple_slash_reference_1.default, + 'type-annotation-spacing': type_annotation_spacing_1.default, + 'unbound-method': unbound_method_1.default, + 'unified-signatures': unified_signatures_1.default, + indent: indent_1.default, + quotes: quotes_1.default, + semi: semi_1.default, + typedef: typedef_1.default, +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.js.map new file mode 100644 index 000000000..3d62e0eeb --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":";;;;;AAAA,kGAAwE;AACxE,8DAAqC;AACrC,sEAA6C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C,0BAA0B,EAAE,kCAAsB;IAClD,eAAe,EAAE,uBAAW;IAC5B,sBAAsB,EAAE,8BAAkB;IAC1C,iBAAiB,EAAE,yBAAc;IACjC,4BAA4B,EAAE,oCAAuB;IACrD,0BAA0B,EAAE,kCAAsB;IAClD,2BAA2B,EAAE,mCAAuB;IACpD,uBAAuB,EAAE,+BAAmB;IAC5C,iCAAiC,EAAE,yCAA4B;IAC/D,iBAAiB,EAAE,yBAAc;IACjC,8BAA8B,EAAE,sCAAyB;IACzD,oBAAoB,EAAE,4BAAgB;IACtC,gCAAgC,EAAE,wCAA0B;IAC5D,wBAAwB,EAAE,gCAAmB;IAC7C,wBAAwB,EAAE,gCAAoB;IAC9C,4BAA4B,EAAE,oCAAuB;IACrD,eAAe,EAAE,uBAAY;IAC7B,wBAAwB,EAAE,gCAAoB;IAC9C,+BAA+B,EAAE,uCAA2B;IAC5D,cAAc,EAAE,sBAAW;IAC3B,6BAA6B,EAAE,qCAAwB;IACvD,4BAA4B,EAAE,oCAAwB;IACtD,6BAA6B,EAAE,qCAAyB;IACxD,wBAAwB,EAAE,gCAAoB;IAC9C,yBAAyB,EAAE,iCAAqB;IAChD,gBAAgB,EAAE,wBAAa;IAC/B,oBAAoB,EAAE,4BAAiB;IACvC,MAAM,EAAE,gBAAM;IACd,MAAM,EAAE,gBAAM;IACd,IAAI,EAAE,cAAI;IACV,OAAO,EAAE,iBAAO;CACjB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/init-declarations.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/init-declarations.js new file mode 100644 index 000000000..9b4b3311f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/init-declarations.js @@ -0,0 +1,47 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const init_declarations_1 = __importDefault(require("eslint/lib/rules/init-declarations")); +const util_1 = require("../util"); +exports.default = util_1.createRule({ + name: 'init-declarations', + meta: { + type: 'suggestion', + docs: { + description: 'require or disallow initialization in variable declarations', + category: 'Variables', + recommended: false, + extendsBaseRule: true, + }, + schema: init_declarations_1.default.meta.schema, + messages: (_a = init_declarations_1.default.meta.messages) !== null && _a !== void 0 ? _a : { + initialized: "Variable '{{idName}}' should be initialized on declaration.", + notInitialized: "Variable '{{idName}}' should not be initialized on declaration.", + }, + }, + defaultOptions: ['always'], + create(context) { + const rules = init_declarations_1.default.create(context); + const mode = context.options[0] || 'always'; + return { + 'VariableDeclaration:exit'(node) { + var _a, _b, _c; + if (mode === 'always') { + if (node.declare) { + return; + } + if (((_a = node.parent) === null || _a === void 0 ? void 0 : _a.type) === experimental_utils_1.AST_NODE_TYPES.TSModuleBlock && + ((_b = node.parent.parent) === null || _b === void 0 ? void 0 : _b.type) === experimental_utils_1.AST_NODE_TYPES.TSModuleDeclaration && ((_c = node.parent.parent) === null || _c === void 0 ? void 0 : _c.declare)) { + return; + } + } + rules['VariableDeclaration:exit'](node); + }, + }; + }, +}); +//# sourceMappingURL=init-declarations.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/init-declarations.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/init-declarations.js.map new file mode 100644 index 000000000..99bf077b7 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/init-declarations.js.map @@ -0,0 +1 @@ +{"version":3,"file":"init-declarations.js","sourceRoot":"","sources":["../../src/rules/init-declarations.ts"],"names":[],"mappings":";;;;;;AAAA,8EAG+C;AAC/C,2FAA0D;AAC1D,kCAIiB;AAKjB,kBAAe,iBAAU,CAAsB;IAC7C,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EACT,6DAA6D;YAC/D,QAAQ,EAAE,WAAW;YACrB,WAAW,EAAE,KAAK;YAClB,eAAe,EAAE,IAAI;SACtB;QACD,MAAM,EAAE,2BAAQ,CAAC,IAAI,CAAC,MAAM;QAC5B,QAAQ,QAAE,2BAAQ,CAAC,IAAI,CAAC,QAAQ,mCAAI;YAClC,WAAW,EACT,6DAA6D;YAC/D,cAAc,EACZ,iEAAiE;SACpE;KACF;IACD,cAAc,EAAE,CAAC,QAAQ,CAAC;IAC1B,MAAM,CAAC,OAAO;QACZ,MAAM,KAAK,GAAG,2BAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACvC,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC;QAE5C,OAAO;YACL,0BAA0B,CAAC,IAAkC;;gBAC3D,IAAI,IAAI,KAAK,QAAQ,EAAE;oBACrB,IAAI,IAAI,CAAC,OAAO,EAAE;wBAChB,OAAO;qBACR;oBACD,IACE,OAAA,IAAI,CAAC,MAAM,0CAAE,IAAI,MAAK,mCAAc,CAAC,aAAa;wBAClD,OAAA,IAAI,CAAC,MAAM,CAAC,MAAM,0CAAE,IAAI,MAAK,mCAAc,CAAC,mBAAmB,WAC/D,IAAI,CAAC,MAAM,CAAC,MAAM,0CAAE,OAAO,CAAA,EAC3B;wBACA,OAAO;qBACR;iBACF;gBAED,KAAK,CAAC,0BAA0B,CAAC,CAAC,IAAI,CAAC,CAAC;YAC1C,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/keyword-spacing.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/keyword-spacing.js new file mode 100644 index 000000000..a0d987180 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/keyword-spacing.js @@ -0,0 +1,67 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const keyword_spacing_1 = __importDefault(require("eslint/lib/rules/keyword-spacing")); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'keyword-spacing', + meta: { + type: 'layout', + docs: { + description: 'Enforce consistent spacing before and after keywords', + category: 'Stylistic Issues', + recommended: false, + extendsBaseRule: true, + }, + fixable: 'whitespace', + schema: keyword_spacing_1.default.meta.schema, + messages: (_a = keyword_spacing_1.default.meta.messages) !== null && _a !== void 0 ? _a : { + expectedBefore: 'Expected space(s) before "{{value}}".', + expectedAfter: 'Expected space(s) after "{{value}}".', + unexpectedBefore: 'Unexpected space(s) before "{{value}}".', + unexpectedAfter: 'Unexpected space(s) after "{{value}}".', + }, + }, + defaultOptions: [{}], + create(context) { + const sourceCode = context.getSourceCode(); + const baseRules = keyword_spacing_1.default.create(context); + return Object.assign(Object.assign({}, baseRules), { TSAsExpression(node) { + const asToken = util.nullThrows(sourceCode.getTokenAfter(node.expression, token => token.value === 'as'), util.NullThrowsReasons.MissingToken('as', node.type)); + const oldTokenType = asToken.type; + // as is a contextual keyword, so it's always reported as an Identifier + // the rule looks for keyword tokens, so we temporarily override it + // we mutate it at the token level because the rule calls sourceCode.getFirstToken, + // so mutating a copy would not change the underlying copy returned by that method + asToken.type = experimental_utils_1.AST_TOKEN_TYPES.Keyword; + // use this selector just because it is just a call to `checkSpacingAroundFirstToken` + baseRules.DebuggerStatement(asToken); + // make sure to reset the type afterward so we don't permanently mutate the AST + asToken.type = oldTokenType; + } }); + }, +}); +//# sourceMappingURL=keyword-spacing.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/keyword-spacing.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/keyword-spacing.js.map new file mode 100644 index 000000000..181f8eea5 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/keyword-spacing.js.map @@ -0,0 +1 @@ +{"version":3,"file":"keyword-spacing.js","sourceRoot":"","sources":["../../src/rules/keyword-spacing.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8EAAwE;AACxE,uFAAwD;AACxD,8CAAgC;AAKhC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE;YACJ,WAAW,EAAE,sDAAsD;YACnE,QAAQ,EAAE,kBAAkB;YAC5B,WAAW,EAAE,KAAK;YAClB,eAAe,EAAE,IAAI;SACtB;QACD,OAAO,EAAE,YAAY;QACrB,MAAM,EAAE,yBAAQ,CAAC,IAAI,CAAC,MAAM;QAC5B,QAAQ,QAAE,yBAAQ,CAAC,IAAI,CAAC,QAAQ,mCAAI;YAClC,cAAc,EAAE,uCAAuC;YACvD,aAAa,EAAE,sCAAsC;YACrD,gBAAgB,EAAE,yCAAyC;YAC3D,eAAe,EAAE,wCAAwC;SAC1D;KACF;IACD,cAAc,EAAE,CAAC,EAAE,CAAC;IAEpB,MAAM,CAAC,OAAO;QACZ,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;QAC3C,MAAM,SAAS,GAAG,yBAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC3C,uCACK,SAAS,KACZ,cAAc,CAAC,IAAI;gBACjB,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAC7B,UAAU,CAAC,aAAa,CACtB,IAAI,CAAC,UAAU,EACf,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,KAAK,IAAI,CAC9B,EACD,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CACrD,CAAC;gBACF,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;gBAClC,uEAAuE;gBACvE,mEAAmE;gBACnE,mFAAmF;gBACnF,kFAAkF;gBAClF,OAAO,CAAC,IAAI,GAAG,oCAAe,CAAC,OAAO,CAAC;gBAEvC,qFAAqF;gBACrF,SAAS,CAAC,iBAAiB,CAAC,OAAgB,CAAC,CAAC;gBAE9C,+EAA+E;gBAC/E,OAAO,CAAC,IAAI,GAAG,YAAY,CAAC;YAC9B,CAAC,IACD;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/lines-between-class-members.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/lines-between-class-members.js new file mode 100644 index 000000000..7d55e4333 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/lines-between-class-members.js @@ -0,0 +1,79 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const lines_between_class_members_1 = __importDefault(require("eslint/lib/rules/lines-between-class-members")); +const util = __importStar(require("../util")); +const schema = util.deepMerge(Object.assign({}, lines_between_class_members_1.default.meta.schema), { + 1: { + exceptAfterOverload: { + type: 'booleean', + default: true, + }, + }, +}); +exports.default = util.createRule({ + name: 'lines-between-class-members', + meta: { + type: 'layout', + docs: { + description: 'Require or disallow an empty line between class members', + category: 'Stylistic Issues', + recommended: false, + extendsBaseRule: true, + }, + fixable: 'whitespace', + schema, + messages: (_a = lines_between_class_members_1.default.meta.messages) !== null && _a !== void 0 ? _a : { + never: 'Unexpected blank line between class members.', + always: 'Expected blank line between class members.', + }, + }, + defaultOptions: [ + 'always', + { + exceptAfterOverload: true, + exceptAfterSingleLine: false, + }, + ], + create(context, options) { + var _a; + const rules = lines_between_class_members_1.default.create(context); + const exceptAfterOverload = ((_a = options[1]) === null || _a === void 0 ? void 0 : _a.exceptAfterOverload) && options[0] === 'always'; + function isOverload(node) { + return (node.type === experimental_utils_1.AST_NODE_TYPES.MethodDefinition && + node.value.type === experimental_utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression); + } + return { + ClassBody(node) { + const body = exceptAfterOverload + ? node.body.filter(node => !isOverload(node)) + : node.body; + rules.ClassBody(Object.assign(Object.assign({}, node), { body })); + }, + }; + }, +}); +//# sourceMappingURL=lines-between-class-members.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/lines-between-class-members.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/lines-between-class-members.js.map new file mode 100644 index 000000000..f8300c0e3 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/lines-between-class-members.js.map @@ -0,0 +1 @@ +{"version":3,"file":"lines-between-class-members.js","sourceRoot":"","sources":["../../src/rules/lines-between-class-members.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,+GAAoE;AACpE,8CAAgC;AAKhC,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,mBACtB,qCAAQ,CAAC,IAAI,CAAC,MAAM,GACzB;IACE,CAAC,EAAE;QACD,mBAAmB,EAAE;YACnB,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,IAAI;SACd;KACF;CACF,CACF,CAAC;AAEF,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,6BAA6B;IACnC,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE;YACJ,WAAW,EAAE,yDAAyD;YACtE,QAAQ,EAAE,kBAAkB;YAC5B,WAAW,EAAE,KAAK;YAClB,eAAe,EAAE,IAAI;SACtB;QACD,OAAO,EAAE,YAAY;QACrB,MAAM;QACN,QAAQ,QAAE,qCAAQ,CAAC,IAAI,CAAC,QAAQ,mCAAI;YAClC,KAAK,EAAE,8CAA8C;YACrD,MAAM,EAAE,4CAA4C;SACrD;KACF;IACD,cAAc,EAAE;QACd,QAAQ;QACR;YACE,mBAAmB,EAAE,IAAI;YACzB,qBAAqB,EAAE,KAAK;SAC7B;KACF;IACD,MAAM,CAAC,OAAO,EAAE,OAAO;;QACrB,MAAM,KAAK,GAAG,qCAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACvC,MAAM,mBAAmB,GACvB,OAAA,OAAO,CAAC,CAAC,CAAC,0CAAE,mBAAmB,KAAI,OAAO,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC;QAE7D,SAAS,UAAU,CAAC,IAAmB;YACrC,OAAO,CACL,IAAI,CAAC,IAAI,KAAK,mCAAc,CAAC,gBAAgB;gBAC7C,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,mCAAc,CAAC,6BAA6B,CACjE,CAAC;QACJ,CAAC;QAED,OAAO;YACL,SAAS,CAAC,IAAI;gBACZ,MAAM,IAAI,GAAG,mBAAmB;oBAC9B,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;oBAC7C,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;gBAEd,KAAK,CAAC,SAAS,iCAAM,IAAI,KAAE,IAAI,IAAG,CAAC;YACrC,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-delimiter-style.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-delimiter-style.js new file mode 100644 index 000000000..2faac1c36 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-delimiter-style.js @@ -0,0 +1,208 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +const definition = { + type: 'object', + properties: { + multiline: { + type: 'object', + properties: { + delimiter: { enum: ['none', 'semi', 'comma'] }, + requireLast: { type: 'boolean' }, + }, + additionalProperties: false, + }, + singleline: { + type: 'object', + properties: { + // note can't have "none" for single line delimiter as it's invalid syntax + delimiter: { enum: ['semi', 'comma'] }, + requireLast: { type: 'boolean' }, + }, + additionalProperties: false, + }, + }, + additionalProperties: false, +}; +exports.default = util.createRule({ + name: 'member-delimiter-style', + meta: { + type: 'suggestion', + docs: { + description: 'Require a specific member delimiter style for interfaces and type literals', + category: 'Stylistic Issues', + recommended: false, + }, + fixable: 'code', + messages: { + unexpectedComma: 'Unexpected separator (,).', + unexpectedSemi: 'Unexpected separator (;).', + expectedComma: 'Expected a comma.', + expectedSemi: 'Expected a semicolon.', + }, + schema: [ + { + type: 'object', + properties: Object.assign({}, definition.properties, { + overrides: { + type: 'object', + properties: { + interface: definition, + typeLiteral: definition, + }, + additionalProperties: false, + }, + }), + additionalProperties: false, + }, + ], + }, + defaultOptions: [ + { + multiline: { + delimiter: 'semi', + requireLast: true, + }, + singleline: { + delimiter: 'semi', + requireLast: false, + }, + }, + ], + create(context, [options]) { + var _a; + const sourceCode = context.getSourceCode(); + // use the base options as the defaults for the cases + const baseOptions = options; + const overrides = (_a = baseOptions.overrides) !== null && _a !== void 0 ? _a : {}; + const interfaceOptions = util.deepMerge(baseOptions, overrides.interface); + const typeLiteralOptions = util.deepMerge(baseOptions, overrides.typeLiteral); + /** + * Check the last token in the given member. + * @param member the member to be evaluated. + * @param opts the options to be validated. + * @param isLast a flag indicating `member` is the last in the interface or type literal. + */ + function checkLastToken(member, opts, isLast) { + /** + * Resolves the boolean value for the given setting enum value + * @param type the option name + */ + function getOption(type) { + if (isLast && !opts.requireLast) { + // only turn the option on if its expecting no delimiter for the last member + return type === 'none'; + } + return opts.delimiter === type; + } + let messageId = null; + let missingDelimiter = false; + const lastToken = sourceCode.getLastToken(member, { + includeComments: false, + }); + if (!lastToken) { + return; + } + const optsSemi = getOption('semi'); + const optsComma = getOption('comma'); + const optsNone = getOption('none'); + if (lastToken.value === ';') { + if (optsComma) { + messageId = 'expectedComma'; + } + else if (optsNone) { + missingDelimiter = true; + messageId = 'unexpectedSemi'; + } + } + else if (lastToken.value === ',') { + if (optsSemi) { + messageId = 'expectedSemi'; + } + else if (optsNone) { + missingDelimiter = true; + messageId = 'unexpectedComma'; + } + } + else { + if (optsSemi) { + missingDelimiter = true; + messageId = 'expectedSemi'; + } + else if (optsComma) { + missingDelimiter = true; + messageId = 'expectedComma'; + } + } + if (messageId) { + context.report({ + node: lastToken, + loc: { + start: { + line: lastToken.loc.end.line, + column: lastToken.loc.end.column, + }, + end: { + line: lastToken.loc.end.line, + column: lastToken.loc.end.column, + }, + }, + messageId, + fix(fixer) { + if (optsNone) { + // remove the unneeded token + return fixer.remove(lastToken); + } + const token = optsSemi ? ';' : ','; + if (missingDelimiter) { + // add the missing delimiter + return fixer.insertTextAfter(lastToken, token); + } + // correct the current delimiter + return fixer.replaceText(lastToken, token); + }, + }); + } + } + /** + * Check the member separator being used matches the delimiter. + * @param {ASTNode} node the node to be evaluated. + */ + function checkMemberSeparatorStyle(node) { + const isSingleLine = node.loc.start.line === node.loc.end.line; + const members = node.type === experimental_utils_1.AST_NODE_TYPES.TSInterfaceBody ? node.body : node.members; + const typeOpts = node.type === experimental_utils_1.AST_NODE_TYPES.TSInterfaceBody + ? interfaceOptions + : typeLiteralOptions; + const opts = isSingleLine ? typeOpts.singleline : typeOpts.multiline; + members.forEach((member, index) => { + checkLastToken(member, opts !== null && opts !== void 0 ? opts : {}, index === members.length - 1); + }); + } + return { + TSInterfaceBody: checkMemberSeparatorStyle, + TSTypeLiteral: checkMemberSeparatorStyle, + }; + }, +}); +//# sourceMappingURL=member-delimiter-style.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-delimiter-style.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-delimiter-style.js.map new file mode 100644 index 000000000..f48cf7b4e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-delimiter-style.js.map @@ -0,0 +1 @@ +{"version":3,"file":"member-delimiter-style.js","sourceRoot":"","sources":["../../src/rules/member-delimiter-style.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,8CAAgC;AA2BhC,MAAM,UAAU,GAAG;IACjB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;gBAC9C,WAAW,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;aACjC;YACD,oBAAoB,EAAE,KAAK;SAC5B;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,0EAA0E;gBAC1E,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;gBACtC,WAAW,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;aACjC;YACD,oBAAoB,EAAE,KAAK;SAC5B;KACF;IACD,oBAAoB,EAAE,KAAK;CAC5B,CAAC;AAEF,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EACT,4EAA4E;YAC9E,QAAQ,EAAE,kBAAkB;YAC5B,WAAW,EAAE,KAAK;SACnB;QACD,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE;YACR,eAAe,EAAE,2BAA2B;YAC5C,cAAc,EAAE,2BAA2B;YAC3C,aAAa,EAAE,mBAAmB;YAClC,YAAY,EAAE,uBAAuB;SACtC;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,MAAM,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AM,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,EAAE,KAAK,KAAK,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YACnE,CAAC,CAAC,CAAC;QACL,CAAC;QAED,OAAO;YACL,eAAe,EAAE,yBAAyB;YAC1C,aAAa,EAAE,yBAAyB;SACzC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js new file mode 100644 index 000000000..2dbbe7df7 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js @@ -0,0 +1,468 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultOrder = void 0; +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +const neverConfig = { + type: 'string', + enum: ['never'], +}; +const arrayConfig = (memberTypes) => ({ + type: 'array', + items: { + enum: memberTypes, + }, +}); +const objectConfig = (memberTypes) => ({ + type: 'object', + properties: { + memberTypes: { + oneOf: [arrayConfig(memberTypes), neverConfig], + }, + order: { + type: 'string', + enum: ['alphabetically', 'as-written'], + }, + }, + additionalProperties: false, +}); +exports.defaultOrder = [ + // Index signature + 'signature', + // Fields + 'public-static-field', + 'protected-static-field', + 'private-static-field', + 'public-decorated-field', + 'protected-decorated-field', + 'private-decorated-field', + 'public-instance-field', + 'protected-instance-field', + 'private-instance-field', + 'public-abstract-field', + 'protected-abstract-field', + 'private-abstract-field', + 'public-field', + 'protected-field', + 'private-field', + 'static-field', + 'instance-field', + 'abstract-field', + 'decorated-field', + 'field', + // Constructors + 'public-constructor', + 'protected-constructor', + 'private-constructor', + 'constructor', + // Methods + 'public-static-method', + 'protected-static-method', + 'private-static-method', + 'public-decorated-method', + 'protected-decorated-method', + 'private-decorated-method', + 'public-instance-method', + 'protected-instance-method', + 'private-instance-method', + 'public-abstract-method', + 'protected-abstract-method', + 'private-abstract-method', + 'public-method', + 'protected-method', + 'private-method', + 'static-method', + 'instance-method', + 'abstract-method', + 'decorated-method', + 'method', +]; +const allMemberTypes = ['signature', 'field', 'method', 'constructor'].reduce((all, type) => { + all.push(type); + ['public', 'protected', 'private'].forEach(accessibility => { + if (type !== 'signature') { + all.push(`${accessibility}-${type}`); // e.g. `public-field` + } + // Only class instance fields and methods can have decorators attached to them + if (type === 'field' || type === 'method') { + const decoratedMemberType = `${accessibility}-decorated-${type}`; + const decoratedMemberTypeNoAccessibility = `decorated-${type}`; + if (!all.includes(decoratedMemberType)) { + all.push(decoratedMemberType); + } + if (!all.includes(decoratedMemberTypeNoAccessibility)) { + all.push(decoratedMemberTypeNoAccessibility); + } + } + if (type !== 'constructor' && type !== 'signature') { + // There is no `static-constructor` or `instance-constructor` or `abstract-constructor` + ['static', 'instance', 'abstract'].forEach(scope => { + if (!all.includes(`${scope}-${type}`)) { + all.push(`${scope}-${type}`); + } + all.push(`${accessibility}-${scope}-${type}`); + }); + } + }); + return all; +}, []); +const functionExpressions = [ + experimental_utils_1.AST_NODE_TYPES.FunctionExpression, + experimental_utils_1.AST_NODE_TYPES.ArrowFunctionExpression, +]; +/** + * Gets the node type. + * + * @param node the node to be evaluated. + */ +function getNodeType(node) { + // TODO: add missing TSCallSignatureDeclaration + switch (node.type) { + case experimental_utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition: + case experimental_utils_1.AST_NODE_TYPES.MethodDefinition: + return node.kind; + case experimental_utils_1.AST_NODE_TYPES.TSMethodSignature: + return 'method'; + case experimental_utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration: + return 'constructor'; + case experimental_utils_1.AST_NODE_TYPES.TSAbstractClassProperty: + case experimental_utils_1.AST_NODE_TYPES.ClassProperty: + return node.value && functionExpressions.includes(node.value.type) + ? 'method' + : 'field'; + case experimental_utils_1.AST_NODE_TYPES.TSPropertySignature: + return 'field'; + case experimental_utils_1.AST_NODE_TYPES.TSIndexSignature: + return 'signature'; + default: + return null; + } +} +/** + * Gets the member name based on the member type. + * + * @param node the node to be evaluated. + * @param sourceCode + */ +function getMemberName(node, sourceCode) { + switch (node.type) { + case experimental_utils_1.AST_NODE_TYPES.TSPropertySignature: + case experimental_utils_1.AST_NODE_TYPES.TSMethodSignature: + case experimental_utils_1.AST_NODE_TYPES.TSAbstractClassProperty: + case experimental_utils_1.AST_NODE_TYPES.ClassProperty: + return util.getNameFromMember(node, sourceCode); + case experimental_utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition: + case experimental_utils_1.AST_NODE_TYPES.MethodDefinition: + return node.kind === 'constructor' + ? 'constructor' + : util.getNameFromMember(node, sourceCode); + case experimental_utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration: + return 'new'; + case experimental_utils_1.AST_NODE_TYPES.TSIndexSignature: + return util.getNameFromIndexSignature(node); + default: + return null; + } +} +/** + * Gets the calculated rank using the provided method definition. + * The algorithm is as follows: + * - Get the rank based on the accessibility-scope-type name, e.g. public-instance-field + * - If there is no order for accessibility-scope-type, then strip out the accessibility. + * - If there is no order for scope-type, then strip out the scope. + * - If there is no order for type, then return -1 + * @param memberGroups the valid names to be validated. + * @param orderConfig the current order to be validated. + * + * @return Index of the matching member type in the order configuration. + */ +function getRankOrder(memberGroups, orderConfig) { + let rank = -1; + const stack = memberGroups.slice(); // Get a copy of the member groups + while (stack.length > 0 && rank === -1) { + rank = orderConfig.indexOf(stack.shift()); + } + return rank; +} +/** + * Gets the rank of the node given the order. + * @param node the node to be evaluated. + * @param orderConfig the current order to be validated. + * @param supportsModifiers a flag indicating whether the type supports modifiers (scope or accessibility) or not. + */ +function getRank(node, orderConfig, supportsModifiers) { + const type = getNodeType(node); + if (type === null) { + // shouldn't happen but just in case, put it on the end + return orderConfig.length - 1; + } + const abstract = node.type === experimental_utils_1.AST_NODE_TYPES.TSAbstractClassProperty || + node.type === experimental_utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition; + const scope = 'static' in node && node.static + ? 'static' + : abstract + ? 'abstract' + : 'instance'; + const accessibility = 'accessibility' in node && node.accessibility + ? node.accessibility + : 'public'; + // Collect all existing member groups (e.g. 'public-instance-field', 'instance-field', 'public-field', 'constructor' etc.) + const memberGroups = []; + if (supportsModifiers) { + const decorated = 'decorators' in node && node.decorators.length > 0; + if (decorated && (type === 'field' || type === 'method')) { + memberGroups.push(`${accessibility}-decorated-${type}`); + memberGroups.push(`decorated-${type}`); + } + if (type !== 'constructor') { + // Constructors have no scope + memberGroups.push(`${accessibility}-${scope}-${type}`); + memberGroups.push(`${scope}-${type}`); + } + memberGroups.push(`${accessibility}-${type}`); + } + memberGroups.push(type); + return getRankOrder(memberGroups, orderConfig); +} +/** + * Gets the lowest possible rank higher than target. + * e.g. given the following order: + * ... + * public-static-method + * protected-static-method + * private-static-method + * public-instance-method + * protected-instance-method + * private-instance-method + * ... + * and considering that a public-instance-method has already been declared, so ranks contains + * public-instance-method, then the lowest possible rank for public-static-method is + * public-instance-method. + * @param ranks the existing ranks in the object. + * @param target the target rank. + * @param order the current order to be validated. + * @returns the name of the lowest possible rank without dashes (-). + */ +function getLowestRank(ranks, target, order) { + let lowest = ranks[ranks.length - 1]; + ranks.forEach(rank => { + if (rank > target) { + lowest = Math.min(lowest, rank); + } + }); + return order[lowest].replace(/-/g, ' '); +} +exports.default = util.createRule({ + name: 'member-ordering', + meta: { + type: 'suggestion', + docs: { + description: 'Require a consistent member declaration order', + category: 'Stylistic Issues', + recommended: false, + }, + messages: { + incorrectOrder: 'Member "{{member}}" should be declared before member "{{beforeMember}}".', + incorrectGroupOrder: 'Member {{name}} should be declared before all {{rank}} definitions.', + }, + schema: [ + { + type: 'object', + properties: { + default: { + oneOf: [ + neverConfig, + arrayConfig(allMemberTypes), + objectConfig(allMemberTypes), + ], + }, + classes: { + oneOf: [ + neverConfig, + arrayConfig(allMemberTypes), + objectConfig(allMemberTypes), + ], + }, + classExpressions: { + oneOf: [ + neverConfig, + arrayConfig(allMemberTypes), + objectConfig(allMemberTypes), + ], + }, + interfaces: { + oneOf: [ + neverConfig, + arrayConfig(['signature', 'field', 'method', 'constructor']), + objectConfig(['signature', 'field', 'method', 'constructor']), + ], + }, + typeLiterals: { + oneOf: [ + neverConfig, + arrayConfig(['signature', 'field', 'method', 'constructor']), + objectConfig(['signature', 'field', 'method', 'constructor']), + ], + }, + }, + additionalProperties: false, + }, + ], + }, + defaultOptions: [ + { + default: exports.defaultOrder, + }, + ], + create(context, [options]) { + /** + * Checks if the member groups are correctly sorted. + * + * @param members Members to be validated. + * @param groupOrder Group order to be validated. + * @param supportsModifiers A flag indicating whether the type supports modifiers (scope or accessibility) or not. + * + * @return Array of member groups or null if one of the groups is not correctly sorted. + */ + function checkGroupSort(members, groupOrder, supportsModifiers) { + const previousRanks = []; + const memberGroups = []; + let isCorrectlySorted = true; + // Find first member which isn't correctly sorted + members.forEach(member => { + const rank = getRank(member, groupOrder, supportsModifiers); + const name = getMemberName(member, context.getSourceCode()); + const rankLastMember = previousRanks[previousRanks.length - 1]; + if (rank === -1) { + return; + } + // Works for 1st item because x < undefined === false for any x (typeof string) + if (rank < rankLastMember) { + context.report({ + node: member, + messageId: 'incorrectGroupOrder', + data: { + name, + rank: getLowestRank(previousRanks, rank, groupOrder), + }, + }); + isCorrectlySorted = false; + } + else if (rank === rankLastMember) { + // Same member group --> Push to existing member group array + memberGroups[memberGroups.length - 1].push(member); + } + else { + // New member group --> Create new member group array + previousRanks.push(rank); + memberGroups.push([member]); + } + }); + return isCorrectlySorted ? memberGroups : null; + } + /** + * Checks if the members are alphabetically sorted. + * + * @param members Members to be validated. + * + * @return True if all members are correctly sorted. + */ + function checkAlphaSort(members) { + let previousName = ''; + let isCorrectlySorted = true; + // Find first member which isn't correctly sorted + members.forEach(member => { + const name = getMemberName(member, context.getSourceCode()); + // Note: Not all members have names + if (name) { + if (name < previousName) { + context.report({ + node: member, + messageId: 'incorrectOrder', + data: { + member: name, + beforeMember: previousName, + }, + }); + isCorrectlySorted = false; + } + previousName = name; + } + }); + return isCorrectlySorted; + } + /** + * Validates if all members are correctly sorted. + * + * @param members Members to be validated. + * @param orderConfig Order config to be validated. + * @param supportsModifiers A flag indicating whether the type supports modifiers (scope or accessibility) or not. + */ + function validateMembersOrder(members, orderConfig, supportsModifiers) { + if (orderConfig === 'never') { + return; + } + // Standardize config + let order = null; + let memberTypes; + if (Array.isArray(orderConfig)) { + memberTypes = orderConfig; + } + else { + order = orderConfig.order; + memberTypes = orderConfig.memberTypes; + } + // Check order + if (Array.isArray(memberTypes)) { + const grouped = checkGroupSort(members, memberTypes, supportsModifiers); + if (grouped === null) { + return; + } + if (order === 'alphabetically') { + grouped.some(groupMember => !checkAlphaSort(groupMember)); + } + } + else if (order === 'alphabetically') { + checkAlphaSort(members); + } + } + return { + ClassDeclaration(node) { + var _a; + validateMembersOrder(node.body.body, (_a = options.classes) !== null && _a !== void 0 ? _a : options.default, true); + }, + ClassExpression(node) { + var _a; + validateMembersOrder(node.body.body, (_a = options.classExpressions) !== null && _a !== void 0 ? _a : options.default, true); + }, + TSInterfaceDeclaration(node) { + var _a; + validateMembersOrder(node.body.body, (_a = options.interfaces) !== null && _a !== void 0 ? _a : options.default, false); + }, + TSTypeLiteral(node) { + var _a; + validateMembersOrder(node.members, (_a = options.typeLiterals) !== null && _a !== void 0 ? _a : options.default, false); + }, + }; + }, +}); +//# sourceMappingURL=member-ordering.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js.map new file mode 100644 index 000000000..912eb4b43 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js.map @@ -0,0 +1 @@ +{"version":3,"file":"member-ordering.js","sourceRoot":"","sources":["../../src/rules/member-ordering.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,8EAK+C;AAC/C,8CAAgC;AAsBhC,MAAM,WAAW,GAA2B;IAC1C,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,CAAC,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,WAAqB,EAA0B,EAAE,CAAC,CAAC;IACtE,IAAI,EAAE,OAAO;IACb,KAAK,EAAE;QACL,IAAI,EAAE,WAAW;KAClB;CACF,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,CAAC,WAAqB,EAA0B,EAAE,CAAC,CAAC;IACvE,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,WAAW,EAAE;YACX,KAAK,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;SAC/C;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,gBAAgB,EAAE,YAAY,CAAC;SACvC;KACF;IACD,oBAAoB,EAAE,KAAK;CAC5B,CAAC,CAAC;AAEU,QAAA,YAAY,GAAG;IAC1B,kBAAkB;IAClB,WAAW;IAEX,SAAS;IACT,qBAAqB;IACrB,wBAAwB;IACxB,sBAAsB;IAEtB,wBAAwB;IACxB,2BAA2B;IAC3B,yBAAyB;IAEzB,uBAAuB;IACvB,0BAA0B;IAC1B,wBAAwB;IAExB,uBAAuB;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AAC,IAAI;;gBACnB,oBAAoB,CAClB,IAAI,CAAC,IAAI,CAAC,IAAI,QACd,OAAO,CAAC,OAAO,mCAAI,OAAO,CAAC,OAAQ,EACnC,IAAI,CACL,CAAC;YACJ,CAAC;YACD,eAAe,CAAC,IAAI;;gBAClB,oBAAoB,CAClB,IAAI,CAAC,IAAI,CAAC,IAAI,QACd,OAAO,CAAC,gBAAgB,mCAAI,OAAO,CAAC,OAAQ,EAC5C,IAAI,CACL,CAAC;YACJ,CAAC;YACD,sBAAsB,CAAC,IAAI;;gBACzB,oBAAoB,CAClB,IAAI,CAAC,IAAI,CAAC,IAAI,QACd,OAAO,CAAC,UAAU,mCAAI,OAAO,CAAC,OAAQ,EACtC,KAAK,CACN,CAAC;YACJ,CAAC;YACD,aAAa,CAAC,IAAI;;gBAChB,oBAAoB,CAClB,IAAI,CAAC,OAAO,QACZ,OAAO,CAAC,YAAY,mCAAI,OAAO,CAAC,OAAQ,EACxC,KAAK,CACN,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/method-signature-style.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/method-signature-style.js new file mode 100644 index 000000000..f73a0173d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/method-signature-style.js @@ -0,0 +1,162 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'method-signature-style', + meta: { + type: 'suggestion', + docs: { + description: 'Enforces using a particular method signature syntax.', + category: 'Best Practices', + recommended: false, + }, + fixable: 'code', + messages: { + errorMethod: 'Shorthand method signature is forbidden. Use a function property instead.', + errorProperty: 'Function property signature is forbidden. Use a method shorthand instead.', + }, + schema: [ + { + enum: ['property', 'method'], + }, + ], + }, + defaultOptions: ['property'], + create(context, [mode]) { + const sourceCode = context.getSourceCode(); + function getMethodKey(node) { + let key = sourceCode.getText(node.key); + if (node.computed) { + key = `[${key}]`; + } + if (node.optional) { + key = `${key}?`; + } + if (node.readonly) { + key = `readonly ${key}`; + } + return key; + } + function getMethodParams(node) { + let params = '()'; + if (node.params.length > 0) { + const openingParen = util.nullThrows(sourceCode.getTokenBefore(node.params[0], util.isOpeningParenToken), 'Missing opening paren before first parameter'); + const closingParen = util.nullThrows(sourceCode.getTokenAfter(node.params[node.params.length - 1], util.isClosingParenToken), 'Missing closing paren after last parameter'); + params = sourceCode.text.substring(openingParen.range[0], closingParen.range[1]); + } + if (node.typeParameters != null) { + const typeParams = sourceCode.getText(node.typeParameters); + params = `${typeParams}${params}`; + } + return params; + } + function getMethodReturnType(node) { + return sourceCode.getText(node.returnType.typeAnnotation); + } + function getDelimiter(node) { + const lastToken = sourceCode.getLastToken(node); + if (lastToken && + (util.isSemicolonToken(lastToken) || util.isCommaToken(lastToken))) { + return lastToken.value; + } + return ''; + } + return { + TSMethodSignature(methodNode) { + var _a; + if (mode === 'method') { + return; + } + const duplicatedKeyMethodNodes = ((_a = methodNode.parent) === null || _a === void 0 ? void 0 : _a.type) === experimental_utils_1.AST_NODE_TYPES.TSInterfaceBody + ? methodNode.parent.body.filter((element) => element.type === experimental_utils_1.AST_NODE_TYPES.TSMethodSignature && + element !== methodNode && + getMethodKey(element) === getMethodKey(methodNode)) + : []; + if (duplicatedKeyMethodNodes.length > 0) { + context.report({ + node: methodNode, + messageId: 'errorMethod', + *fix(fixer) { + const methodNodes = [ + methodNode, + ...duplicatedKeyMethodNodes, + ].sort((a, b) => (a.range[0] < b.range[0] ? -1 : 1)); + const typeString = methodNodes.reduce((str, node, idx, nodes) => { + const params = getMethodParams(node); + const returnType = getMethodReturnType(node); + return `${str}(${params} => ${returnType})${idx !== nodes.length - 1 ? ' & ' : ''}`; + }, ''); + const key = getMethodKey(methodNode); + const delimiter = getDelimiter(methodNode); + yield fixer.replaceText(methodNode, `${key}: ${typeString}${delimiter}`); + for (const node of duplicatedKeyMethodNodes) { + const lastToken = sourceCode.getLastToken(node); + if (lastToken) { + const nextToken = sourceCode.getTokenAfter(lastToken); + if (nextToken) { + yield fixer.remove(node); + yield fixer.replaceTextRange([lastToken.range[1], nextToken.range[0]], ''); + } + } + } + }, + }); + return; + } + context.report({ + node: methodNode, + messageId: 'errorMethod', + fix: fixer => { + const key = getMethodKey(methodNode); + const params = getMethodParams(methodNode); + const returnType = getMethodReturnType(methodNode); + const delimiter = getDelimiter(methodNode); + return fixer.replaceText(methodNode, `${key}: ${params} => ${returnType}${delimiter}`); + }, + }); + }, + TSPropertySignature(propertyNode) { + var _a; + const typeNode = (_a = propertyNode.typeAnnotation) === null || _a === void 0 ? void 0 : _a.typeAnnotation; + if ((typeNode === null || typeNode === void 0 ? void 0 : typeNode.type) !== experimental_utils_1.AST_NODE_TYPES.TSFunctionType) { + return; + } + if (mode === 'property') { + return; + } + context.report({ + node: propertyNode, + messageId: 'errorProperty', + fix: fixer => { + const key = getMethodKey(propertyNode); + const params = getMethodParams(typeNode); + const returnType = getMethodReturnType(typeNode); + const delimiter = getDelimiter(propertyNode); + return fixer.replaceText(propertyNode, `${key}${params}: ${returnType}${delimiter}`); + }, + }); + }, + }; + }, +}); +//# sourceMappingURL=method-signature-style.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/method-signature-style.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/method-signature-style.js.map new file mode 100644 index 000000000..e7081d2cf --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/method-signature-style.js.map @@ -0,0 +1 @@ +{"version":3,"file":"method-signature-style.js","sourceRoot":"","sources":["../../src/rules/method-signature-style.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,8CAAgC;AAKhC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,sDAAsD;YACnE,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,KAAK;SACnB;QACD,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE;YACR,WAAW,EACT,2EAA2E;YAC7E,aAAa,EACX,2EAA2E;SAC9E;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC;aAC7B;SACF;KACF;IACD,cAAc,EAAE,CAAC,UAAU,CAAC;IAE5B,MAAM,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC;QACpB,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;QAE3C,SAAS,YAAY,CACnB,IAA+D;YAE/D,IAAI,GAAG,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACvC,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACjB,GAAG,GAAG,IAAI,GAAG,GAAG,CAAC;aAClB;YACD,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACjB,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;aACjB;YACD,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACjB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wBACnD,MAAM,SAAS,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;wBAC3C,OAAO,KAAK,CAAC,WAAW,CACtB,UAAU,EACV,GAAG,GAAG,KAAK,MAAM,OAAO,UAAU,GAAG,SAAS,EAAE,CACjD,CAAC;oBACJ,CAAC;iBACF,CAAC,CAAC;YACL,CAAC;YACD,mBAAmB,CAAC,YAAY;;gBAC9B,MAAM,QAAQ,SAAG,YAAY,CAAC,cAAc,0CAAE,cAAc,CAAC;gBAC7D,IAAI,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,MAAK,mCAAc,CAAC,cAAc,EAAE;oBACpD,OAAO;iBACR;gBAED,IAAI,IAAI,KAAK,UAAU,EAAE;oBACvB,OAAO;iBACR;gBAED,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI,EAAE,YAAY;oBAClB,SAAS,EAAE,eAAe;oBAC1B,GAAG,EAAE,KAAK,CAAC,EAAE;wBACX,MAAM,GAAG,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;wBACvC,MAAM,MAAM,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;wBACzC,MAAM,UAAU,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;wBACjD,MAAM,SAAS,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;wBAC7C,OAAO,KAAK,CAAC,WAAW,CACtB,YAAY,EACZ,GAAG,GAAG,GAAG,MAAM,KAAK,UAAU,GAAG,SAAS,EAAE,CAC7C,CAAC;oBACJ,CAAC;iBACF,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention.js new file mode 100644 index 000000000..212c77311 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention.js @@ -0,0 +1,999 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.selectorTypeToMessageString = void 0; +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +// #region Options Type Config +var PredefinedFormats; +(function (PredefinedFormats) { + PredefinedFormats[PredefinedFormats["camelCase"] = 1] = "camelCase"; + PredefinedFormats[PredefinedFormats["strictCamelCase"] = 2] = "strictCamelCase"; + PredefinedFormats[PredefinedFormats["PascalCase"] = 4] = "PascalCase"; + PredefinedFormats[PredefinedFormats["StrictPascalCase"] = 8] = "StrictPascalCase"; + PredefinedFormats[PredefinedFormats["snake_case"] = 16] = "snake_case"; + PredefinedFormats[PredefinedFormats["UPPER_CASE"] = 32] = "UPPER_CASE"; +})(PredefinedFormats || (PredefinedFormats = {})); +var UnderscoreOptions; +(function (UnderscoreOptions) { + UnderscoreOptions[UnderscoreOptions["forbid"] = 1] = "forbid"; + UnderscoreOptions[UnderscoreOptions["allow"] = 2] = "allow"; + UnderscoreOptions[UnderscoreOptions["require"] = 4] = "require"; +})(UnderscoreOptions || (UnderscoreOptions = {})); +var Selectors; +(function (Selectors) { + // variableLike + Selectors[Selectors["variable"] = 1] = "variable"; + Selectors[Selectors["function"] = 2] = "function"; + Selectors[Selectors["parameter"] = 4] = "parameter"; + // memberLike + Selectors[Selectors["property"] = 8] = "property"; + Selectors[Selectors["parameterProperty"] = 16] = "parameterProperty"; + Selectors[Selectors["method"] = 32] = "method"; + Selectors[Selectors["accessor"] = 64] = "accessor"; + Selectors[Selectors["enumMember"] = 128] = "enumMember"; + // typeLike + Selectors[Selectors["class"] = 256] = "class"; + Selectors[Selectors["interface"] = 512] = "interface"; + Selectors[Selectors["typeAlias"] = 1024] = "typeAlias"; + Selectors[Selectors["enum"] = 2048] = "enum"; + Selectors[Selectors["typeParameter"] = 4096] = "typeParameter"; +})(Selectors || (Selectors = {})); +const SELECTOR_COUNT = util.getEnumNames(Selectors).length; +var MetaSelectors; +(function (MetaSelectors) { + MetaSelectors[MetaSelectors["default"] = -1] = "default"; + MetaSelectors[MetaSelectors["variableLike"] = 7] = "variableLike"; + MetaSelectors[MetaSelectors["memberLike"] = 248] = "memberLike"; + MetaSelectors[MetaSelectors["typeLike"] = 7936] = "typeLike"; +})(MetaSelectors || (MetaSelectors = {})); +var Modifiers; +(function (Modifiers) { + Modifiers[Modifiers["const"] = 1] = "const"; + Modifiers[Modifiers["readonly"] = 2] = "readonly"; + Modifiers[Modifiers["static"] = 4] = "static"; + Modifiers[Modifiers["public"] = 8] = "public"; + Modifiers[Modifiers["protected"] = 16] = "protected"; + Modifiers[Modifiers["private"] = 32] = "private"; + Modifiers[Modifiers["abstract"] = 64] = "abstract"; +})(Modifiers || (Modifiers = {})); +var TypeModifiers; +(function (TypeModifiers) { + TypeModifiers[TypeModifiers["boolean"] = 1024] = "boolean"; + TypeModifiers[TypeModifiers["string"] = 2048] = "string"; + TypeModifiers[TypeModifiers["number"] = 4096] = "number"; + TypeModifiers[TypeModifiers["function"] = 8192] = "function"; + TypeModifiers[TypeModifiers["array"] = 16384] = "array"; +})(TypeModifiers || (TypeModifiers = {})); +// #endregion Options Type Config +// #region Schema Config +const UNDERSCORE_SCHEMA = { + type: 'string', + enum: util.getEnumNames(UnderscoreOptions), +}; +const PREFIX_SUFFIX_SCHEMA = { + type: 'array', + items: { + type: 'string', + minLength: 1, + }, + additionalItems: false, +}; +const MATCH_REGEX_SCHEMA = { + type: 'object', + properties: { + match: { type: 'boolean' }, + regex: { type: 'string' }, + }, + required: ['match', 'regex'], +}; +const FORMAT_OPTIONS_PROPERTIES = { + format: { + oneOf: [ + { + type: 'array', + items: { + type: 'string', + enum: util.getEnumNames(PredefinedFormats), + }, + additionalItems: false, + }, + { + type: 'null', + }, + ], + }, + custom: MATCH_REGEX_SCHEMA, + leadingUnderscore: UNDERSCORE_SCHEMA, + trailingUnderscore: UNDERSCORE_SCHEMA, + prefix: PREFIX_SUFFIX_SCHEMA, + suffix: PREFIX_SUFFIX_SCHEMA, +}; +function selectorSchema(selectorString, allowType, modifiers) { + const selector = { + filter: { + oneOf: [ + { + type: 'string', + minLength: 1, + }, + MATCH_REGEX_SCHEMA, + ], + }, + selector: { + type: 'string', + enum: [selectorString], + }, + }; + if (modifiers && modifiers.length > 0) { + selector.modifiers = { + type: 'array', + items: { + type: 'string', + enum: modifiers, + }, + additionalItems: false, + }; + } + if (allowType) { + selector.types = { + type: 'array', + items: { + type: 'string', + enum: util.getEnumNames(TypeModifiers), + }, + additionalItems: false, + }; + } + return [ + { + type: 'object', + properties: Object.assign(Object.assign({}, FORMAT_OPTIONS_PROPERTIES), selector), + required: ['selector', 'format'], + additionalProperties: false, + }, + ]; +} +function selectorsSchema() { + return { + type: 'object', + properties: Object.assign(Object.assign({}, FORMAT_OPTIONS_PROPERTIES), { + filter: { + oneOf: [ + { + type: 'string', + minLength: 1, + }, + MATCH_REGEX_SCHEMA, + ], + }, + selector: { + type: 'array', + items: { + type: 'string', + enum: [ + ...util.getEnumNames(MetaSelectors), + ...util.getEnumNames(Selectors), + ], + }, + additionalItems: false, + }, + }), + modifiers: { + type: 'array', + items: { + type: 'string', + enum: util.getEnumNames(Modifiers), + }, + additionalItems: false, + }, + types: { + type: 'array', + items: { + type: 'string', + enum: util.getEnumNames(TypeModifiers), + }, + additionalItems: false, + }, + required: ['selector', 'format'], + additionalProperties: false, + }; +} +const SCHEMA = { + type: 'array', + items: { + oneOf: [ + selectorsSchema(), + ...selectorSchema('default', false, util.getEnumNames(Modifiers)), + ...selectorSchema('variableLike', false), + ...selectorSchema('variable', true, ['const']), + ...selectorSchema('function', false), + ...selectorSchema('parameter', true), + ...selectorSchema('memberLike', false, [ + 'private', + 'protected', + 'public', + 'static', + 'readonly', + 'abstract', + ]), + ...selectorSchema('property', true, [ + 'private', + 'protected', + 'public', + 'static', + 'readonly', + 'abstract', + ]), + ...selectorSchema('parameterProperty', true, [ + 'private', + 'protected', + 'public', + 'readonly', + ]), + ...selectorSchema('method', false, [ + 'private', + 'protected', + 'public', + 'static', + 'abstract', + ]), + ...selectorSchema('accessor', true, [ + 'private', + 'protected', + 'public', + 'static', + 'abstract', + ]), + ...selectorSchema('enumMember', false), + ...selectorSchema('typeLike', false, ['abstract']), + ...selectorSchema('class', false, ['abstract']), + ...selectorSchema('interface', false), + ...selectorSchema('typeAlias', false), + ...selectorSchema('enum', false), + ...selectorSchema('typeParameter', false), + ], + }, + additionalItems: false, +}; +// #endregion Schema Config +// This essentially mirrors ESLint's `camelcase` rule +// note that that rule ignores leading and trailing underscores and only checks those in the middle of a variable name +const defaultCamelCaseAllTheThingsConfig = [ + { + selector: 'default', + format: ['camelCase'], + leadingUnderscore: 'allow', + trailingUnderscore: 'allow', + }, + { + selector: 'variable', + format: ['camelCase', 'UPPER_CASE'], + leadingUnderscore: 'allow', + trailingUnderscore: 'allow', + }, + { + selector: 'typeLike', + format: ['PascalCase'], + }, +]; +exports.default = util.createRule({ + name: 'naming-convention', + meta: { + docs: { + category: 'Variables', + description: 'Enforces naming conventions for everything across a codebase', + recommended: false, + // technically only requires type checking if the user uses "type" modifiers + requiresTypeChecking: true, + }, + type: 'suggestion', + messages: { + unexpectedUnderscore: '{{type}} name `{{name}}` must not have a {{position}} underscore.', + missingUnderscore: '{{type}} name `{{name}}` must have a {{position}} underscore.', + missingAffix: '{{type}} name `{{name}}` must have one of the following {{position}}es: {{affixes}}', + satisfyCustom: '{{type}} name `{{name}}` must {{regexMatch}} the RegExp: {{regex}}', + doesNotMatchFormat: '{{type}} name `{{name}}` must match one of the following formats: {{formats}}', + doesNotMatchFormatTrimmed: '{{type}} name `{{name}}` trimmed as `{{processedName}}` must match one of the following formats: {{formats}}', + }, + schema: SCHEMA, + }, + defaultOptions: defaultCamelCaseAllTheThingsConfig, + create(contextWithoutDefaults) { + const context = contextWithoutDefaults.options && + contextWithoutDefaults.options.length > 0 + ? contextWithoutDefaults + : // only apply the defaults when the user provides no config + Object.setPrototypeOf({ + options: defaultCamelCaseAllTheThingsConfig, + }, contextWithoutDefaults); + const validators = parseOptions(context); + function handleMember(validator, node, modifiers) { + if (!validator) { + return; + } + const key = node.key; + validator(key, modifiers); + } + function getMemberModifiers(node) { + const modifiers = new Set(); + if (node.accessibility) { + modifiers.add(Modifiers[node.accessibility]); + } + else { + modifiers.add(Modifiers.public); + } + if (node.static) { + modifiers.add(Modifiers.static); + } + if ('readonly' in node && node.readonly) { + modifiers.add(Modifiers.readonly); + } + if (node.type === experimental_utils_1.AST_NODE_TYPES.TSAbstractClassProperty || + node.type === experimental_utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition) { + modifiers.add(Modifiers.abstract); + } + return modifiers; + } + return { + // #region variable + VariableDeclarator(node) { + const validator = validators.variable; + if (!validator) { + return; + } + const identifiers = []; + getIdentifiersFromPattern(node.id, identifiers); + const modifiers = new Set(); + const parent = node.parent; + if (parent && + parent.type === experimental_utils_1.AST_NODE_TYPES.VariableDeclaration && + parent.kind === 'const') { + modifiers.add(Modifiers.const); + } + identifiers.forEach(i => { + validator(i, modifiers); + }); + }, + // #endregion + // #region function + 'FunctionDeclaration, TSDeclareFunction, FunctionExpression'(node) { + const validator = validators.function; + if (!validator || node.id === null) { + return; + } + validator(node.id); + }, + // #endregion function + // #region parameter + 'FunctionDeclaration, TSDeclareFunction, FunctionExpression, ArrowFunctionExpression'(node) { + const validator = validators.parameter; + if (!validator) { + return; + } + node.params.forEach(param => { + if (param.type === experimental_utils_1.AST_NODE_TYPES.TSParameterProperty) { + return; + } + const identifiers = []; + getIdentifiersFromPattern(param, identifiers); + identifiers.forEach(i => { + validator(i); + }); + }); + }, + // #endregion parameter + // #region parameterProperty + TSParameterProperty(node) { + const validator = validators.parameterProperty; + if (!validator) { + return; + } + const modifiers = getMemberModifiers(node); + const identifiers = []; + getIdentifiersFromPattern(node.parameter, identifiers); + identifiers.forEach(i => { + validator(i, modifiers); + }); + }, + // #endregion parameterProperty + // #region property + 'Property[computed = false][kind = "init"][value.type != "ArrowFunctionExpression"][value.type != "FunctionExpression"][value.type != "TSEmptyBodyFunctionExpression"]'(node) { + const modifiers = new Set([Modifiers.public]); + handleMember(validators.property, node, modifiers); + }, + ':matches(ClassProperty, TSAbstractClassProperty)[computed = false][value.type != "ArrowFunctionExpression"][value.type != "FunctionExpression"][value.type != "TSEmptyBodyFunctionExpression"]'(node) { + const modifiers = getMemberModifiers(node); + handleMember(validators.property, node, modifiers); + }, + 'TSPropertySignature[computed = false]'(node) { + const modifiers = new Set([Modifiers.public]); + if (node.readonly) { + modifiers.add(Modifiers.readonly); + } + handleMember(validators.property, node, modifiers); + }, + // #endregion property + // #region method + [[ + 'Property[computed = false][kind = "init"][value.type = "ArrowFunctionExpression"]', + 'Property[computed = false][kind = "init"][value.type = "FunctionExpression"]', + 'Property[computed = false][kind = "init"][value.type = "TSEmptyBodyFunctionExpression"]', + 'TSMethodSignature[computed = false]', + ].join(', ')](node) { + const modifiers = new Set([Modifiers.public]); + handleMember(validators.method, node, modifiers); + }, + [[ + ':matches(ClassProperty, TSAbstractClassProperty)[computed = false][value.type = "ArrowFunctionExpression"]', + ':matches(ClassProperty, TSAbstractClassProperty)[computed = false][value.type = "FunctionExpression"]', + ':matches(ClassProperty, TSAbstractClassProperty)[computed = false][value.type = "TSEmptyBodyFunctionExpression"]', + ':matches(MethodDefinition, TSAbstractMethodDefinition)[computed = false][kind = "method"]', + ].join(', ')](node) { + const modifiers = getMemberModifiers(node); + handleMember(validators.method, node, modifiers); + }, + // #endregion method + // #region accessor + 'Property[computed = false]:matches([kind = "get"], [kind = "set"])'(node) { + const modifiers = new Set([Modifiers.public]); + handleMember(validators.accessor, node, modifiers); + }, + 'MethodDefinition[computed = false]:matches([kind = "get"], [kind = "set"])'(node) { + const modifiers = getMemberModifiers(node); + handleMember(validators.accessor, node, modifiers); + }, + // #endregion accessor + // #region enumMember + // computed is optional, so can't do [computed = false] + 'TSEnumMember[computed != true]'(node) { + const validator = validators.enumMember; + if (!validator) { + return; + } + const id = node.id; + validator(id); + }, + // #endregion enumMember + // #region class + 'ClassDeclaration, ClassExpression'(node) { + const validator = validators.class; + if (!validator) { + return; + } + const id = node.id; + if (id === null) { + return; + } + const modifiers = new Set(); + if (node.abstract) { + modifiers.add(Modifiers.abstract); + } + validator(id, modifiers); + }, + // #endregion class + // #region interface + TSInterfaceDeclaration(node) { + const validator = validators.interface; + if (!validator) { + return; + } + validator(node.id); + }, + // #endregion interface + // #region typeAlias + TSTypeAliasDeclaration(node) { + const validator = validators.typeAlias; + if (!validator) { + return; + } + validator(node.id); + }, + // #endregion typeAlias + // #region enum + TSEnumDeclaration(node) { + const validator = validators.enum; + if (!validator) { + return; + } + validator(node.id); + }, + // #endregion enum + // #region typeParameter + 'TSTypeParameterDeclaration > TSTypeParameter'(node) { + const validator = validators.typeParameter; + if (!validator) { + return; + } + validator(node.name); + }, + }; + }, +}); +function getIdentifiersFromPattern(pattern, identifiers) { + switch (pattern.type) { + case experimental_utils_1.AST_NODE_TYPES.Identifier: + identifiers.push(pattern); + break; + case experimental_utils_1.AST_NODE_TYPES.ArrayPattern: + pattern.elements.forEach(element => { + if (element !== null) { + getIdentifiersFromPattern(element, identifiers); + } + }); + break; + case experimental_utils_1.AST_NODE_TYPES.ObjectPattern: + pattern.properties.forEach(property => { + if (property.type === experimental_utils_1.AST_NODE_TYPES.RestElement) { + getIdentifiersFromPattern(property, identifiers); + } + else { + // this is a bit weird, but it's because ESTree doesn't have a new node type + // for object destructuring properties - it just reuses Property... + // https://github.com/estree/estree/blob/9ae284b71130d53226e7153b42f01bf819e6e657/es2015.md#L206-L211 + // However, the parser guarantees this is safe (and there is error handling) + getIdentifiersFromPattern(property.value, identifiers); + } + }); + break; + case experimental_utils_1.AST_NODE_TYPES.RestElement: + getIdentifiersFromPattern(pattern.argument, identifiers); + break; + case experimental_utils_1.AST_NODE_TYPES.AssignmentPattern: + getIdentifiersFromPattern(pattern.left, identifiers); + break; + case experimental_utils_1.AST_NODE_TYPES.MemberExpression: + // ignore member expressions, as the everything must already be defined + break; + default: + // https://github.com/typescript-eslint/typescript-eslint/issues/1282 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + throw new Error(`Unexpected pattern type ${pattern.type}`); + } +} +function parseOptions(context) { + const normalizedOptions = context.options.map(opt => normalizeOption(opt)); + return util.getEnumNames(Selectors).reduce((acc, k) => { + acc[k] = createValidator(k, context, normalizedOptions); + return acc; + }, {}); +} +function createValidator(type, context, allConfigs) { + // make sure the "highest priority" configs are checked first + const selectorType = Selectors[type]; + const configs = allConfigs + // gather all of the applicable selectors + .filter(c => (c.selector & selectorType) !== 0 || + c.selector === MetaSelectors.default) + .sort((a, b) => { + if (a.selector === b.selector) { + // in the event of the same selector, order by modifier weight + // sort descending - the type modifiers are "more important" + return b.modifierWeight - a.modifierWeight; + } + /* + meta selectors will always be larger numbers than the normal selectors they contain, as they are the sum of all + of the selectors that they contain. + to give normal selectors a higher priority, shift them all SELECTOR_COUNT bits to the left before comparison, so + they are instead always guaranteed to be larger than the meta selectors. + */ + const aSelector = isMetaSelector(a.selector) + ? a.selector + : a.selector << SELECTOR_COUNT; + const bSelector = isMetaSelector(b.selector) + ? b.selector + : b.selector << SELECTOR_COUNT; + // sort descending - the meta selectors are "least important" + return bSelector - aSelector; + }); + return (node, modifiers = new Set()) => { + var _a, _b, _c; + const originalName = node.type === experimental_utils_1.AST_NODE_TYPES.Identifier ? node.name : `${node.value}`; + // return will break the loop and stop checking configs + // it is only used when the name is known to have failed or succeeded a config. + for (const config of configs) { + if (((_a = config.filter) === null || _a === void 0 ? void 0 : _a.regex.test(originalName)) !== ((_b = config.filter) === null || _b === void 0 ? void 0 : _b.match)) { + // name does not match the filter + continue; + } + if ((_c = config.modifiers) === null || _c === void 0 ? void 0 : _c.some(modifier => !modifiers.has(modifier))) { + // does not have the required modifiers + continue; + } + if (!isCorrectType(node, config, context)) { + // is not the correct type + continue; + } + let name = originalName; + name = validateUnderscore('leading', config, name, node, originalName); + if (name === null) { + // fail + return; + } + name = validateUnderscore('trailing', config, name, node, originalName); + if (name === null) { + // fail + return; + } + name = validateAffix('prefix', config, name, node, originalName); + if (name === null) { + // fail + return; + } + name = validateAffix('suffix', config, name, node, originalName); + if (name === null) { + // fail + return; + } + if (!validateCustom(config, name, node, originalName)) { + // fail + return; + } + if (!validatePredefinedFormat(config, name, node, originalName)) { + // fail + return; + } + // it's valid for this config, so we don't need to check any more configs + return; + } + }; + // centralizes the logic for formatting the report data + function formatReportData({ affixes, formats, originalName, processedName, position, custom, }) { + var _a; + return { + type: selectorTypeToMessageString(type), + name: originalName, + processedName, + position, + affixes: affixes === null || affixes === void 0 ? void 0 : affixes.join(', '), + formats: formats === null || formats === void 0 ? void 0 : formats.map(f => PredefinedFormats[f]).join(', '), + regex: (_a = custom === null || custom === void 0 ? void 0 : custom.regex) === null || _a === void 0 ? void 0 : _a.toString(), + regexMatch: (custom === null || custom === void 0 ? void 0 : custom.match) === true + ? 'match' + : (custom === null || custom === void 0 ? void 0 : custom.match) === false + ? 'not match' + : null, + }; + } + /** + * @returns the name with the underscore removed, if it is valid according to the specified underscore option, null otherwise + */ + function validateUnderscore(position, config, name, node, originalName) { + const option = position === 'leading' + ? config.leadingUnderscore + : config.trailingUnderscore; + if (!option) { + return name; + } + const hasUnderscore = position === 'leading' ? name.startsWith('_') : name.endsWith('_'); + const trimUnderscore = position === 'leading' + ? () => name.slice(1) + : () => name.slice(0, -1); + switch (option) { + case UnderscoreOptions.allow: + // no check - the user doesn't care if it's there or not + break; + case UnderscoreOptions.forbid: + if (hasUnderscore) { + context.report({ + node, + messageId: 'unexpectedUnderscore', + data: formatReportData({ + originalName, + position, + }), + }); + return null; + } + break; + case UnderscoreOptions.require: + if (!hasUnderscore) { + context.report({ + node, + messageId: 'missingUnderscore', + data: formatReportData({ + originalName, + position, + }), + }); + return null; + } + } + return hasUnderscore ? trimUnderscore() : name; + } + /** + * @returns the name with the affix removed, if it is valid according to the specified affix option, null otherwise + */ + function validateAffix(position, config, name, node, originalName) { + const affixes = config[position]; + if (!affixes || affixes.length === 0) { + return name; + } + for (const affix of affixes) { + const hasAffix = position === 'prefix' ? name.startsWith(affix) : name.endsWith(affix); + const trimAffix = position === 'prefix' + ? () => name.slice(affix.length) + : () => name.slice(0, -affix.length); + if (hasAffix) { + // matches, so trim it and return + return trimAffix(); + } + } + context.report({ + node, + messageId: 'missingAffix', + data: formatReportData({ + originalName, + position, + affixes, + }), + }); + return null; + } + /** + * @returns true if the name is valid according to the `regex` option, false otherwise + */ + function validateCustom(config, name, node, originalName) { + const custom = config.custom; + if (!custom) { + return true; + } + const result = custom.regex.test(name); + if (custom.match && result) { + return true; + } + if (!custom.match && !result) { + return true; + } + context.report({ + node, + messageId: 'satisfyCustom', + data: formatReportData({ + originalName, + custom, + }), + }); + return false; + } + /** + * @returns true if the name is valid according to the `format` option, false otherwise + */ + function validatePredefinedFormat(config, name, node, originalName) { + const formats = config.format; + if (formats === null || formats.length === 0) { + return true; + } + for (const format of formats) { + const checker = PredefinedFormatToCheckFunction[format]; + if (checker(name)) { + return true; + } + } + context.report({ + node, + messageId: originalName === name + ? 'doesNotMatchFormat' + : 'doesNotMatchFormatTrimmed', + data: formatReportData({ + originalName, + processedName: name, + formats, + }), + }); + return false; + } +} +// #region Predefined Format Functions +/* +These format functions are taken from `tslint-consistent-codestyle/naming-convention`: +https://github.com/ajafff/tslint-consistent-codestyle/blob/ab156cc8881bcc401236d999f4ce034b59039e81/rules/namingConventionRule.ts#L603-L645 + +The licence for the code can be viewed here: +https://github.com/ajafff/tslint-consistent-codestyle/blob/ab156cc8881bcc401236d999f4ce034b59039e81/LICENSE +*/ +/* +Why not regex here? Because it's actually really, really difficult to create a regex to handle +all of the unicode cases, and we have many non-english users that use non-english characters. +https://gist.github.com/mathiasbynens/6334847 +*/ +function isPascalCase(name) { + return (name.length === 0 || + (name[0] === name[0].toUpperCase() && !name.includes('_'))); +} +function isStrictPascalCase(name) { + return (name.length === 0 || + (name[0] === name[0].toUpperCase() && hasStrictCamelHumps(name, true))); +} +function isCamelCase(name) { + return (name.length === 0 || + (name[0] === name[0].toLowerCase() && !name.includes('_'))); +} +function isStrictCamelCase(name) { + return (name.length === 0 || + (name[0] === name[0].toLowerCase() && hasStrictCamelHumps(name, false))); +} +function hasStrictCamelHumps(name, isUpper) { + function isUppercaseChar(char) { + return char === char.toUpperCase() && char !== char.toLowerCase(); + } + if (name.startsWith('_')) { + return false; + } + for (let i = 1; i < name.length; ++i) { + if (name[i] === '_') { + return false; + } + if (isUpper === isUppercaseChar(name[i])) { + if (isUpper) { + return false; + } + } + else { + isUpper = !isUpper; + } + } + return true; +} +function isSnakeCase(name) { + return (name.length === 0 || + (name === name.toLowerCase() && validateUnderscores(name))); +} +function isUpperCase(name) { + return (name.length === 0 || + (name === name.toUpperCase() && validateUnderscores(name))); +} +/** Check for leading trailing and adjacent underscores */ +function validateUnderscores(name) { + if (name.startsWith('_')) { + return false; + } + let wasUnderscore = false; + for (let i = 1; i < name.length; ++i) { + if (name[i] === '_') { + if (wasUnderscore) { + return false; + } + wasUnderscore = true; + } + else { + wasUnderscore = false; + } + } + return !wasUnderscore; +} +const PredefinedFormatToCheckFunction = { + [PredefinedFormats.PascalCase]: isPascalCase, + [PredefinedFormats.StrictPascalCase]: isStrictPascalCase, + [PredefinedFormats.camelCase]: isCamelCase, + [PredefinedFormats.strictCamelCase]: isStrictCamelCase, + [PredefinedFormats.UPPER_CASE]: isUpperCase, + [PredefinedFormats.snake_case]: isSnakeCase, +}; +// #endregion Predefined Format Functions +function selectorTypeToMessageString(selectorType) { + const notCamelCase = selectorType.replace(/([A-Z])/g, ' $1'); + return notCamelCase.charAt(0).toUpperCase() + notCamelCase.slice(1); +} +exports.selectorTypeToMessageString = selectorTypeToMessageString; +function isMetaSelector(selector) { + return selector in MetaSelectors; +} +function normalizeOption(option) { + var _a, _b, _c, _d, _e, _f; + let weight = 0; + (_a = option.modifiers) === null || _a === void 0 ? void 0 : _a.forEach(mod => { + weight |= Modifiers[mod]; + }); + (_b = option.types) === null || _b === void 0 ? void 0 : _b.forEach(mod => { + weight |= TypeModifiers[mod]; + }); + // give selectors with a filter the _highest_ priority + if (option.filter) { + weight |= 1 << 30; + } + const normalizedOption = { + // format options + format: option.format ? option.format.map(f => PredefinedFormats[f]) : null, + custom: option.custom + ? { + regex: new RegExp(option.custom.regex, 'u'), + match: option.custom.match, + } + : null, + leadingUnderscore: option.leadingUnderscore !== undefined + ? UnderscoreOptions[option.leadingUnderscore] + : null, + trailingUnderscore: option.trailingUnderscore !== undefined + ? UnderscoreOptions[option.trailingUnderscore] + : null, + prefix: option.prefix && option.prefix.length > 0 ? option.prefix : null, + suffix: option.suffix && option.suffix.length > 0 ? option.suffix : null, + modifiers: (_d = (_c = option.modifiers) === null || _c === void 0 ? void 0 : _c.map(m => Modifiers[m])) !== null && _d !== void 0 ? _d : null, + types: (_f = (_e = option.types) === null || _e === void 0 ? void 0 : _e.map(m => TypeModifiers[m])) !== null && _f !== void 0 ? _f : null, + filter: option.filter !== undefined + ? typeof option.filter === 'string' + ? { regex: new RegExp(option.filter, 'u'), match: true } + : { + regex: new RegExp(option.filter.regex, 'u'), + match: option.filter.match, + } + : null, + // calculated ordering weight based on modifiers + modifierWeight: weight, + }; + const selectors = Array.isArray(option.selector) + ? option.selector + : [option.selector]; + return Object.assign({ selector: selectors + .map(selector => isMetaSelector(selector) + ? MetaSelectors[selector] + : Selectors[selector]) + .reduce((accumulator, selector) => accumulator | selector) }, normalizedOption); +} +function isCorrectType(node, config, context) { + if (config.types === null) { + return true; + } + const { esTreeNodeToTSNodeMap, program } = util.getParserServices(context); + const checker = program.getTypeChecker(); + const tsNode = esTreeNodeToTSNodeMap.get(node); + const type = checker + .getTypeAtLocation(tsNode) + // remove null and undefined from the type, as we don't care about it here + .getNonNullableType(); + for (const allowedType of config.types) { + switch (allowedType) { + case TypeModifiers.array: + if (isAllTypesMatch(type, t => checker.isArrayType(t) || checker.isTupleType(t))) { + return true; + } + break; + case TypeModifiers.function: + if (isAllTypesMatch(type, t => t.getCallSignatures().length > 0)) { + return true; + } + break; + case TypeModifiers.boolean: + case TypeModifiers.number: + case TypeModifiers.string: { + const typeString = checker.typeToString( + // this will resolve things like true => boolean, 'a' => string and 1 => number + checker.getWidenedType(checker.getBaseTypeOfLiteralType(type))); + const allowedTypeString = TypeModifiers[allowedType]; + if (typeString === allowedTypeString) { + return true; + } + break; + } + } + } + return false; +} +/** + * @returns `true` if the type (or all union types) in the given type return true for the callback + */ +function isAllTypesMatch(type, cb) { + if (type.isUnion()) { + return type.types.every(t => cb(t)); + } + return cb(type); +} +//# sourceMappingURL=naming-convention.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention.js.map new file mode 100644 index 000000000..a146c3d33 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention.js.map @@ -0,0 +1 @@ +{"version":3,"file":"naming-convention.js","sourceRoot":"","sources":["../../src/rules/naming-convention.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,8EAK+C;AAE/C,8CAAgC;AAUhC,8BAA8B;AAE9B,IAAK,iBAOJ;AAPD,WAAK,iBAAiB;IACpB,mEAAkB,CAAA;IAClB,+EAAwB,CAAA;IAC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,IAAI,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE;oBAChE,OAAO,IAAI,CAAC;iBACb;gBACD,MAAM;YAER,KAAK,aAAa,CAAC,OAAO,CAAC;YAC3B,KAAK,aAAa,CAAC,MAAM,CAAC;YAC1B,KAAK,aAAa,CAAC,MAAM,CAAC,CAAC;gBACzB,MAAM,UAAU,GAAG,OAAO,CAAC,YAAY;gBACrC,+EAA+E;gBAC/E,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC,CAC/D,CAAC;gBACF,MAAM,iBAAiB,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;gBACrD,IAAI,UAAU,KAAK,iBAAiB,EAAE;oBACpC,OAAO,IAAI,CAAC;iBACb;gBACD,MAAM;aACP;SACF;KACF;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAS,eAAe,CACtB,IAAa,EACb,EAA8B;IAE9B,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE;QAClB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;KACrC;IAED,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC;AAClB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-array-constructor.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-array-constructor.js new file mode 100644 index 000000000..806672e97 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-array-constructor.js @@ -0,0 +1,72 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-array-constructor', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow generic `Array` constructors', + category: 'Stylistic Issues', + recommended: 'error', + extendsBaseRule: true, + }, + fixable: 'code', + messages: { + useLiteral: 'The array literal notation [] is preferable.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + /** + * Disallow construction of dense arrays using the Array constructor + * @param node node to evaluate + */ + function check(node) { + if (node.arguments.length !== 1 && + node.callee.type === experimental_utils_1.AST_NODE_TYPES.Identifier && + node.callee.name === 'Array' && + !node.typeParameters && + !util.isOptionalCallExpression(node)) { + context.report({ + node, + messageId: 'useLiteral', + fix(fixer) { + if (node.arguments.length === 0) { + return fixer.replaceText(node, '[]'); + } + const fullText = context.getSourceCode().getText(node); + const preambleLength = node.callee.range[1] - node.range[0]; + return fixer.replaceText(node, `[${fullText.slice(preambleLength + 1, -1)}]`); + }, + }); + } + } + return { + CallExpression: check, + NewExpression: check, + }; + }, +}); +//# sourceMappingURL=no-array-constructor.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-array-constructor.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-array-constructor.js.map new file mode 100644 index 000000000..db44e4893 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-array-constructor.js.map @@ -0,0 +1 @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,CAAC,CAAC,CAAC,CAAC;wBAE5D,OAAO,KAAK,CAAC,WAAW,CACtB,IAAI,EACJ,IAAI,QAAQ,CAAC,KAAK,CAAC,cAAc,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAC9C,CAAC;oBACJ,CAAC;iBACF,CAAC,CAAC;aACJ;QACH,CAAC;QAED,OAAO;YACL,cAAc,EAAE,KAAK;YACrB,aAAa,EAAE,KAAK;SACrB,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string.js new file mode 100644 index 000000000..b3b994b16 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string.js @@ -0,0 +1,161 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const ts = __importStar(require("typescript")); +const util = __importStar(require("../util")); +var Usefulness; +(function (Usefulness) { + Usefulness[Usefulness["Always"] = 0] = "Always"; + Usefulness["Never"] = "will"; + Usefulness["Sometimes"] = "may"; +})(Usefulness || (Usefulness = {})); +exports.default = util.createRule({ + name: 'no-base-to-string', + meta: { + docs: { + description: 'Requires that `.toString()` is only called on objects which provide useful information when stringified', + category: 'Best Practices', + recommended: false, + requiresTypeChecking: true, + }, + messages: { + baseToString: "'{{name}} {{certainty}} evaluate to '[object Object]' when stringified.", + }, + schema: [ + { + type: 'object', + properties: { + ignoredTypeNames: { + type: 'array', + items: { + type: 'string', + }, + }, + }, + additionalProperties: false, + }, + ], + type: 'suggestion', + }, + defaultOptions: [ + { + ignoredTypeNames: ['RegExp'], + }, + ], + create(context, [option]) { + var _a; + const parserServices = util.getParserServices(context); + const typeChecker = parserServices.program.getTypeChecker(); + const ignoredTypeNames = (_a = option.ignoredTypeNames) !== null && _a !== void 0 ? _a : []; + function checkExpression(node, type) { + if (node.type === experimental_utils_1.AST_NODE_TYPES.Literal) { + return; + } + const certainty = collectToStringCertainty(type !== null && type !== void 0 ? type : typeChecker.getTypeAtLocation(parserServices.esTreeNodeToTSNodeMap.get(node))); + if (certainty === Usefulness.Always) { + return; + } + context.report({ + data: { + certainty, + name: context.getSourceCode().getText(node), + }, + messageId: 'baseToString', + node, + }); + } + function collectToStringCertainty(type) { + const toString = typeChecker.getPropertyOfType(type, 'toString'); + const declarations = toString === null || toString === void 0 ? void 0 : toString.getDeclarations(); + if (!toString || !declarations || declarations.length === 0) { + return Usefulness.Always; + } + // Patch for old version TypeScript, the Boolean type definition missing toString() + if (type.flags & ts.TypeFlags.Boolean || + type.flags & ts.TypeFlags.BooleanLiteral) { + return Usefulness.Always; + } + if (ignoredTypeNames.includes(util.getTypeName(typeChecker, type))) { + return Usefulness.Always; + } + if (declarations.every(({ parent }) => !ts.isInterfaceDeclaration(parent) || parent.name.text !== 'Object')) { + return Usefulness.Always; + } + if (type.isIntersection()) { + for (const subType of type.types) { + const subtypeUsefulness = collectToStringCertainty(subType); + if (subtypeUsefulness === Usefulness.Always) { + return Usefulness.Always; + } + } + return Usefulness.Never; + } + if (!type.isUnion()) { + return Usefulness.Never; + } + let allSubtypesUseful = true; + let someSubtypeUseful = false; + for (const subType of type.types) { + const subtypeUsefulness = collectToStringCertainty(subType); + if (subtypeUsefulness !== Usefulness.Always && allSubtypesUseful) { + allSubtypesUseful = false; + } + if (subtypeUsefulness !== Usefulness.Never && !someSubtypeUseful) { + someSubtypeUseful = true; + } + } + if (allSubtypesUseful && someSubtypeUseful) { + return Usefulness.Always; + } + if (someSubtypeUseful) { + return Usefulness.Sometimes; + } + return Usefulness.Never; + } + return { + 'AssignmentExpression[operator = "+="], BinaryExpression[operator = "+"]'(node) { + const leftType = typeChecker.getTypeAtLocation(parserServices.esTreeNodeToTSNodeMap.get(node.left)); + const rightType = typeChecker.getTypeAtLocation(parserServices.esTreeNodeToTSNodeMap.get(node.right)); + if (util.getTypeName(typeChecker, leftType) === 'string') { + checkExpression(node.right, rightType); + } + else if (util.getTypeName(typeChecker, rightType) === 'string') { + checkExpression(node.left, leftType); + } + }, + 'CallExpression > MemberExpression.callee > Identifier[name = "toString"].property'(node) { + const memberExpr = node.parent; + checkExpression(memberExpr.object); + }, + TemplateLiteral(node) { + if (node.parent && + node.parent.type === experimental_utils_1.AST_NODE_TYPES.TaggedTemplateExpression) { + return; + } + for (const expression of node.expressions) { + checkExpression(expression); + } + }, + }; + }, +}); +//# sourceMappingURL=no-base-to-string.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string.js.map new file mode 100644 index 000000000..378fe4c7b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-base-to-string.js","sourceRoot":"","sources":["../../src/rules/no-base-to-string.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,+CAAiC;AAEjC,8CAAgC;AAEhC,IAAK,UAIJ;AAJD,WAAK,UAAU;IACb,+CAAM,CAAA;IACN,4BAAc,CAAA;IACd,+BAA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C,KAAK,QAAQ,EAAE;oBACxD,eAAe,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;iBACxC;qBAAM,IAAI,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,SAAS,CAAC,KAAK,QAAQ,EAAE;oBAChE,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;iBACtC;YACH,CAAC;YACD,mFAAmF,CACjF,IAAyB;gBAEzB,MAAM,UAAU,GAAG,IAAI,CAAC,MAAmC,CAAC;gBAC5D,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YACrC,CAAC;YACD,eAAe,CAAC,IAA8B;gBAC5C,IACE,IAAI,CAAC,MAAM;oBACX,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,mCAAc,CAAC,wBAAwB,EAC5D;oBACA,OAAO;iBACR;gBACD,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,WAAW,EAAE;oBACzC,eAAe,CAAC,UAAU,CAAC,CAAC;iBAC7B;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-confusing-non-null-assertion.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-confusing-non-null-assertion.js new file mode 100644 index 000000000..9369dc9f7 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-confusing-non-null-assertion.js @@ -0,0 +1,97 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-confusing-non-null-assertion', + meta: { + type: 'problem', + docs: { + description: 'Disallow non-null assertion in locations that may be confusing', + category: 'Stylistic Issues', + recommended: false, + }, + fixable: 'code', + messages: { + confusingEqual: 'Confusing combinations of non-null assertion and equal test like "a! == b", which looks very similar to not equal "a !== b"', + confusingAssign: 'Confusing combinations of non-null assertion and equal test like "a! = b", which looks very similar to not equal "a != b"', + notNeedInEqualTest: 'Unnecessary non-null assertion (!) in equal test', + notNeedInAssign: 'Unnecessary non-null assertion (!) in assignment left hand', + wrapUpLeft: 'Wrap up left hand to avoid putting non-null assertion "!" and "=" together', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const sourceCode = context.getSourceCode(); + return { + 'BinaryExpression, AssignmentExpression'(node) { + function isLeftHandPrimaryExpression(node) { + return node.type === experimental_utils_1.AST_NODE_TYPES.TSNonNullExpression; + } + if (node.operator === '==' || + node.operator === '===' || + node.operator === '=') { + const isAssign = node.operator === '='; + const leftHandFinalToken = sourceCode.getLastToken(node.left); + const tokenAfterLeft = sourceCode.getTokenAfter(node.left); + if ((leftHandFinalToken === null || leftHandFinalToken === void 0 ? void 0 : leftHandFinalToken.type) === experimental_utils_1.AST_TOKEN_TYPES.Punctuator && + (leftHandFinalToken === null || leftHandFinalToken === void 0 ? void 0 : leftHandFinalToken.value) === '!' && + (tokenAfterLeft === null || tokenAfterLeft === void 0 ? void 0 : tokenAfterLeft.value) !== ')') { + if (isLeftHandPrimaryExpression(node.left)) { + context.report({ + node, + messageId: isAssign ? 'confusingAssign' : 'confusingEqual', + suggest: [ + { + messageId: isAssign + ? 'notNeedInAssign' + : 'notNeedInEqualTest', + fix: (fixer) => [ + fixer.remove(leftHandFinalToken), + ], + }, + ], + }); + } + else { + context.report({ + node, + messageId: isAssign ? 'confusingAssign' : 'confusingEqual', + suggest: [ + { + messageId: 'wrapUpLeft', + fix: (fixer) => [ + fixer.insertTextBefore(node.left, '('), + fixer.insertTextAfter(node.left, ')'), + ], + }, + ], + }); + } + } + } + }, + }; + }, +}); +//# sourceMappingURL=no-confusing-non-null-assertion.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-confusing-non-null-assertion.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-confusing-non-null-assertion.js.map new file mode 100644 index 000000000..d789e5442 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-confusing-non-null-assertion.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-confusing-non-null-assertion.js","sourceRoot":"","sources":["../../src/rules/no-confusing-non-null-assertion.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAK+C;AAC/C,8CAAgC;AAEhC,kBAAe,IAAI,CAAC,UAAU,CAAC;IAC7B,IAAI,EAAE,iCAAiC;IACvC,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EACT,gEAAgE;YAClE,QAAQ,EAAE,kBAAkB;YAC5B,WAAW,EAAE,KAAK;SACnB;QACD,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE;YACR,cAAc,EACZ,6HAA6H;YAC/H,eAAe,EACb,2HAA2H;YAC7H,kBAAkB,EAAE,kDAAkD;YACtE,eAAe,EACb,4DAA4D;YAC9D,UAAU,EACR,4EAA4E;SAC/E;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;QAC3C,OAAO;YACL,wCAAwC,CACtC,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AC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,gBAAgB;gCAC1D,OAAO,EAAE;oCACP;wCACE,SAAS,EAAE,YAAY;wCACvB,GAAG,EAAE,CAAC,KAAK,EAAsB,EAAE,CAAC;4CAClC,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC;4CACtC,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC;yCACtC;qCACF;iCACF;6BACF,CAAC,CAAC;yBACJ;qBACF;iBACF;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dupe-class-members.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dupe-class-members.js new file mode 100644 index 000000000..a823830e6 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dupe-class-members.js @@ -0,0 +1,55 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const no_dupe_class_members_1 = __importDefault(require("eslint/lib/rules/no-dupe-class-members")); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-dupe-class-members', + meta: { + type: 'problem', + docs: { + description: 'Disallow duplicate class members', + category: 'Possible Errors', + recommended: false, + extendsBaseRule: true, + }, + schema: no_dupe_class_members_1.default.meta.schema, + messages: no_dupe_class_members_1.default.meta.messages, + }, + defaultOptions: [], + create(context) { + const rules = no_dupe_class_members_1.default.create(context); + return Object.assign(Object.assign({}, rules), { MethodDefinition(node) { + if (node.computed) { + return; + } + if (node.value.type === experimental_utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression) { + return; + } + return rules.MethodDefinition(node); + } }); + }, +}); +//# sourceMappingURL=no-dupe-class-members.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dupe-class-members.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dupe-class-members.js.map new file mode 100644 index 000000000..7e93badca --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dupe-class-members.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-dupe-class-members.js","sourceRoot":"","sources":["../../src/rules/no-dupe-class-members.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,8EAAuE;AACvE,mGAA8D;AAC9D,8CAAgC;AAKhC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,uBAAuB;IAC7B,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,kCAAkC;YAC/C,QAAQ,EAAE,iBAAiB;YAC3B,WAAW,EAAE,KAAK;YAClB,eAAe,EAAE,IAAI;SACtB;QACD,MAAM,EAAE,+BAAQ,CAAC,IAAI,CAAC,MAAM;QAC5B,QAAQ,EAAE,+BAAQ,CAAC,IAAI,CAAC,QAAQ;KACjC;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,MAAM,KAAK,GAAG,+BAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAEvC,uCACK,KAAK,KACR,gBAAgB,CAAC,IAAI;gBACnB,IAAI,IAAI,CAAC,QAAQ,EAAE;oBACjB,OAAO;iBACR;gBAED,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,mCAAc,CAAC,6BAA6B,EAAE;oBACpE,OAAO;iBACR;gBAED,OAAO,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;YACtC,CAAC,IACD;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dynamic-delete.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dynamic-delete.js new file mode 100644 index 000000000..911e40127 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dynamic-delete.js @@ -0,0 +1,91 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const tsutils = __importStar(require("tsutils")); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-dynamic-delete', + meta: { + docs: { + category: 'Best Practices', + description: 'Disallow the delete operator with computed key expressions', + recommended: false, + }, + fixable: 'code', + messages: { + dynamicDelete: 'Do not delete dynamically computed property keys.', + }, + schema: [], + type: 'suggestion', + }, + defaultOptions: [], + create(context) { + function createFixer(member) { + if (member.property.type === experimental_utils_1.AST_NODE_TYPES.Literal && + typeof member.property.value === 'string') { + return createPropertyReplacement(member.property, `.${member.property.value}`); + } + return undefined; + } + return { + 'UnaryExpression[operator=delete]'(node) { + if (node.argument.type !== experimental_utils_1.AST_NODE_TYPES.MemberExpression || + !node.argument.computed || + isNecessaryDynamicAccess(diveIntoWrapperExpressions(node.argument.property))) { + return; + } + context.report({ + fix: createFixer(node.argument), + messageId: 'dynamicDelete', + node: node.argument.property, + }); + }, + }; + function createPropertyReplacement(property, replacement) { + return (fixer) => fixer.replaceTextRange(getTokenRange(property), replacement); + } + function getTokenRange(property) { + const sourceCode = context.getSourceCode(); + return [ + sourceCode.getTokenBefore(property).range[0], + sourceCode.getTokenAfter(property).range[1], + ]; + } + }, +}); +function diveIntoWrapperExpressions(node) { + if (node.type === experimental_utils_1.AST_NODE_TYPES.UnaryExpression) { + return diveIntoWrapperExpressions(node.argument); + } + return node; +} +function isNecessaryDynamicAccess(property) { + if (property.type !== experimental_utils_1.AST_NODE_TYPES.Literal) { + return false; + } + if (typeof property.value === 'number') { + return true; + } + return (typeof property.value === 'string' && + !tsutils.isValidPropertyAccess(property.value)); +} +//# sourceMappingURL=no-dynamic-delete.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dynamic-delete.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dynamic-delete.js.map new file mode 100644 index 000000000..bf3450bc2 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dynamic-delete.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-dynamic-delete.js","sourceRoot":"","sources":["../../src/rules/no-dynamic-delete.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAI+C;AAC/C,iDAAmC;AACnC,8CAAg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,KAAK,CAAC,gBAAgB,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,CAAC;QACjE,CAAC;QAED,SAAS,aAAa,CAAC,QAA6B;YAClD,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;YAE3C,OAAO;gBACL,UAAU,CAAC,cAAc,CAAC,QAAQ,CAAE,CAAC,KAAK,CAAC,CAAC,CAAC;gBAC7C,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAE,CAAC,KAAK,CAAC,CAAC,CAAC;aAC7C,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC,CAAC;AAEH,SAAS,0BAA0B,CACjC,IAAyB;IAEzB,IAAI,IAAI,CAAC,IAAI,KAAK,mCAAc,CAAC,eAAe,EAAE;QAChD,OAAO,0BAA0B,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;KAClD;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,wBAAwB,CAAC,QAA6B;IAC7D,IAAI,QAAQ,CAAC,IAAI,KAAK,mCAAc,CAAC,OAAO,EAAE;QAC5C,OAAO,KAAK,CAAC;KACd;IAED,IAAI,OAAO,QAAQ,CAAC,KAAK,KAAK,QAAQ,EAAE;QACtC,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,OAAO,QAAQ,CAAC,KAAK,KAAK,QAAQ;QAClC,CAAC,OAAO,CAAC,qBAAqB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAC/C,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-function.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-function.js new file mode 100644 index 000000000..775e85ccf --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-function.js @@ -0,0 +1,146 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const no_empty_function_1 = __importDefault(require("eslint/lib/rules/no-empty-function")); +const util = __importStar(require("../util")); +const schema = util.deepMerge(Array.isArray(no_empty_function_1.default.meta.schema) + ? no_empty_function_1.default.meta.schema[0] + : no_empty_function_1.default.meta.schema, { + properties: { + allow: { + items: { + enum: [ + 'functions', + 'arrowFunctions', + 'generatorFunctions', + 'methods', + 'generatorMethods', + 'getters', + 'setters', + 'constructors', + 'private-constructors', + 'protected-constructors', + 'asyncFunctions', + 'asyncMethods', + 'decoratedFunctions', + ], + }, + }, + }, +}); +exports.default = util.createRule({ + name: 'no-empty-function', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow empty functions', + category: 'Best Practices', + recommended: 'error', + extendsBaseRule: true, + }, + schema: [schema], + messages: no_empty_function_1.default.meta.messages, + }, + defaultOptions: [ + { + allow: [], + }, + ], + create(context, [{ allow = [] }]) { + const rules = no_empty_function_1.default.create(context); + const isAllowedProtectedConstructors = allow.includes('protected-constructors'); + const isAllowedPrivateConstructors = allow.includes('private-constructors'); + const isAllowedDecoratedFunctions = allow.includes('decoratedFunctions'); + /** + * Check if the method body is empty + * @param node the node to be validated + * @returns true if the body is empty + * @private + */ + function isBodyEmpty(node) { + return !node.body || node.body.body.length === 0; + } + /** + * Check if method has parameter properties + * @param node the node to be validated + * @returns true if the body has parameter properties + * @private + */ + function hasParameterProperties(node) { + var _a; + return (_a = node.params) === null || _a === void 0 ? void 0 : _a.some(param => param.type === experimental_utils_1.AST_NODE_TYPES.TSParameterProperty); + } + /** + * @param node the node to be validated + * @returns true if the constructor is allowed to be empty + * @private + */ + function isAllowedEmptyConstructor(node) { + const parent = node.parent; + if (isBodyEmpty(node) && + (parent === null || parent === void 0 ? void 0 : parent.type) === experimental_utils_1.AST_NODE_TYPES.MethodDefinition && + parent.kind === 'constructor') { + const { accessibility } = parent; + return ( + // allow protected constructors + (accessibility === 'protected' && isAllowedProtectedConstructors) || + // allow private constructors + (accessibility === 'private' && isAllowedPrivateConstructors) || + // allow constructors which have parameter properties + hasParameterProperties(node)); + } + return false; + } + /** + * @param node the node to be validated + * @returns true if a function has decorators + * @private + */ + function isAllowedEmptyDecoratedFunctions(node) { + var _a; + if (isAllowedDecoratedFunctions && isBodyEmpty(node)) { + const decorators = ((_a = node.parent) === null || _a === void 0 ? void 0 : _a.type) === experimental_utils_1.AST_NODE_TYPES.MethodDefinition + ? node.parent.decorators + : undefined; + return !!decorators && !!decorators.length; + } + return false; + } + return Object.assign(Object.assign({}, rules), { FunctionExpression(node) { + if (isAllowedEmptyConstructor(node) || + isAllowedEmptyDecoratedFunctions(node)) { + return; + } + rules.FunctionExpression(node); + }, + FunctionDeclaration(node) { + if (isAllowedEmptyDecoratedFunctions(node)) { + return; + } + rules.FunctionDeclaration(node); + } }); + }, +}); +//# sourceMappingURL=no-empty-function.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-function.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-function.js.map new file mode 100644 index 000000000..e081d10c4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-function.js.map @@ -0,0 +1 @@ +{"version":3,"file":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C,MAAM,0CAAE,IAAI,MAAK,mCAAc,CAAC,gBAAgB;oBACnD,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU;oBACxB,CAAC,CAAC,SAAS,CAAC;gBAChB,OAAO,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC;aAC5C;YAED,OAAO,KAAK,CAAC;QACf,CAAC;QAED,uCACK,KAAK,KACR,kBAAkB,CAAC,IAAI;gBACrB,IACE,yBAAyB,CAAC,IAAI,CAAC;oBAC/B,gCAAgC,CAAC,IAAI,CAAC,EACtC;oBACA,OAAO;iBACR;gBAED,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;YACjC,CAAC;YACD,mBAAmB,CAAC,IAAI;gBACtB,IAAI,gCAAgC,CAAC,IAAI,CAAC,EAAE;oBAC1C,OAAO;iBACR;gBAED,KAAK,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;YAClC,CAAC,IACD;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.js new file mode 100644 index 000000000..f4037c20b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.js @@ -0,0 +1,105 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-empty-interface', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow the declaration of empty interfaces', + category: 'Best Practices', + recommended: 'error', + suggestion: true, + }, + fixable: 'code', + messages: { + noEmpty: 'An empty interface is equivalent to `{}`.', + noEmptyWithSuper: 'An interface declaring no members is equivalent to its supertype.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowSingleExtends: { + type: 'boolean', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowSingleExtends: false, + }, + ], + create(context, [{ allowSingleExtends }]) { + return { + TSInterfaceDeclaration(node) { + const sourceCode = context.getSourceCode(); + const filename = context.getFilename(); + if (node.body.body.length !== 0) { + // interface contains members --> Nothing to report + return; + } + const extend = node.extends; + if (!extend || extend.length === 0) { + context.report({ + node: node.id, + messageId: 'noEmpty', + }); + } + else if (extend.length === 1) { + // interface extends exactly 1 interface --> Report depending on rule setting + if (!allowSingleExtends) { + const fix = (fixer) => { + let typeParam = ''; + if (node.typeParameters) { + typeParam = sourceCode.getText(node.typeParameters); + } + return fixer.replaceText(node, `type ${sourceCode.getText(node.id)}${typeParam} = ${sourceCode.getText(extend[0])}`); + }; + // Check if interface is within ambient declaration + let useAutoFix = true; + if (util.isDefinitionFile(filename)) { + const scope = context.getScope(); + if (scope.type === 'tsModule' && scope.block.declare) { + useAutoFix = false; + } + } + context.report(Object.assign({ node: node.id, messageId: 'noEmptyWithSuper' }, (useAutoFix + ? { fix } + : { + suggest: [ + { + messageId: 'noEmptyWithSuper', + fix, + }, + ], + }))); + } + } + }, + }; + }, +}); +//# sourceMappingURL=no-empty-interface.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.js.map new file mode 100644 index 000000000..ba663fe02 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-empty-interface.js","sourceRoot":"","sources":["../../src/rules/no-empty-interface.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8CAAgC;AAUhC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,8CAA8C;YAC3D,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,OAAO;YACpB,UAAU,EAAE,IAAI;SACjB;QACD,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE;YACR,OAAO,EAAE,2CAA2C;YACpD,gBAAgB,EACd,mEAAmE;SACtE;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,oBAAoB,EAAE,KAAK;gBAC3B,UAAU,EAAE;oBACV,kBAAkB,EAAE;wBAClB,IAAI,EAAE,SAAS;qBAChB;iBACF;aACF;SACF;KACF;IACD,cAAc,EAAE;QACd;YACE,kBAAkB,EAAE,KAAK;SAC1B;KACF;IACD,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE,kBAAkB,EAAE,CAAC;QACtC,OAAO;YACL,sBAAsB,CAAC,IAAI;gBACzB,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;gBAC3C,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;gBAEvC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;oBAC/B,mDAAmD;oBACnD,OAAO;iBACR;gBAED,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;gBAC5B,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;oBAClC,O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CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.js new file mode 100644 index 000000000..f64ee1478 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.js @@ -0,0 +1,188 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-explicit-any', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow usage of the `any` type', + category: 'Best Practices', + recommended: 'warn', + suggestion: true, + }, + fixable: 'code', + messages: { + unexpectedAny: 'Unexpected any. Specify a different type.', + suggestUnknown: 'Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct.', + suggestNever: "Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.", + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + fixToUnknown: { + type: 'boolean', + }, + ignoreRestArgs: { + type: 'boolean', + }, + }, + }, + ], + }, + defaultOptions: [ + { + fixToUnknown: false, + ignoreRestArgs: false, + }, + ], + create(context, [{ ignoreRestArgs, fixToUnknown }]) { + /** + * Checks if the node is an arrow function, function/constructor declaration or function expression + * @param node the node to be validated. + * @returns true if the node is any kind of function declaration or expression + * @private + */ + function isNodeValidFunction(node) { + return [ + experimental_utils_1.AST_NODE_TYPES.ArrowFunctionExpression, + experimental_utils_1.AST_NODE_TYPES.FunctionDeclaration, + experimental_utils_1.AST_NODE_TYPES.FunctionExpression, + experimental_utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression, + experimental_utils_1.AST_NODE_TYPES.TSFunctionType, + experimental_utils_1.AST_NODE_TYPES.TSConstructorType, + experimental_utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration, + experimental_utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration, + experimental_utils_1.AST_NODE_TYPES.TSMethodSignature, + experimental_utils_1.AST_NODE_TYPES.TSDeclareFunction, + ].includes(node.type); + } + /** + * Checks if the node is a rest element child node of a function + * @param node the node to be validated. + * @returns true if the node is a rest element child node of a function + * @private + */ + function isNodeRestElementInFunction(node) { + return (node.type === experimental_utils_1.AST_NODE_TYPES.RestElement && + typeof node.parent !== 'undefined' && + isNodeValidFunction(node.parent)); + } + /** + * Checks if the node is a TSTypeOperator node with a readonly operator + * @param node the node to be validated. + * @returns true if the node is a TSTypeOperator node with a readonly operator + * @private + */ + function isNodeReadonlyTSTypeOperator(node) { + return (node.type === experimental_utils_1.AST_NODE_TYPES.TSTypeOperator && + node.operator === 'readonly'); + } + /** + * Checks if the node is a TSTypeReference node with an Array identifier + * @param node the node to be validated. + * @returns true if the node is a TSTypeReference node with an Array identifier + * @private + */ + function isNodeValidArrayTSTypeReference(node) { + return (node.type === experimental_utils_1.AST_NODE_TYPES.TSTypeReference && + typeof node.typeName !== 'undefined' && + node.typeName.type === experimental_utils_1.AST_NODE_TYPES.Identifier && + ['Array', 'ReadonlyArray'].includes(node.typeName.name)); + } + /** + * Checks if the node is a valid TSTypeOperator or TSTypeReference node + * @param node the node to be validated. + * @returns true if the node is a valid TSTypeOperator or TSTypeReference node + * @private + */ + function isNodeValidTSType(node) { + return (isNodeReadonlyTSTypeOperator(node) || + isNodeValidArrayTSTypeReference(node)); + } + /** + * Checks if the great grand-parent node is a RestElement node in a function + * @param node the node to be validated. + * @returns true if the great grand-parent node is a RestElement node in a function + * @private + */ + function isGreatGrandparentRestElement(node) { + var _a, _b; + return (((_b = (_a = node === null || node === void 0 ? void 0 : node.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.parent) != null && + isNodeRestElementInFunction(node.parent.parent.parent)); + } + /** + * Checks if the great great grand-parent node is a valid RestElement node in a function + * @param node the node to be validated. + * @returns true if the great great grand-parent node is a valid RestElement node in a function + * @private + */ + function isGreatGreatGrandparentRestElement(node) { + var _a, _b, _c; + return (((_c = (_b = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.parent) === null || _c === void 0 ? void 0 : _c.parent) != null && + isNodeValidTSType(node.parent.parent) && + isNodeRestElementInFunction(node.parent.parent.parent.parent)); + } + /** + * Checks if the great grand-parent or the great great grand-parent node is a RestElement node + * @param node the node to be validated. + * @returns true if the great grand-parent or the great great grand-parent node is a RestElement node + * @private + */ + function isNodeDescendantOfRestElementInFunction(node) { + return (isGreatGrandparentRestElement(node) || + isGreatGreatGrandparentRestElement(node)); + } + return { + TSAnyKeyword(node) { + if (ignoreRestArgs && isNodeDescendantOfRestElementInFunction(node)) { + return; + } + const fixOrSuggest = { + fix: null, + suggest: [ + { + messageId: 'suggestUnknown', + fix(fixer) { + return fixer.replaceText(node, 'unknown'); + }, + }, + { + messageId: 'suggestNever', + fix(fixer) { + return fixer.replaceText(node, 'never'); + }, + }, + ], + }; + if (fixToUnknown) { + fixOrSuggest.fix = (fixer => fixer.replaceText(node, 'unknown')); + } + context.report(Object.assign({ node, messageId: 'unexpectedAny' }, fixOrSuggest)); + }, + }; + }, +}); +//# sourceMappingURL=no-explicit-any.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.js.map new file mode 100644 index 000000000..d9f8f5466 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-explicit-any.js","sourceRoot":"","sources":["../../src/rules/no-explicit-any.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,8CAAgC;AAWhC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,kCAAkC;YAC/C,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,MAAM;YACnB,UAAU,EAAE,IAAI;SACjB;QACD,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE;YACR,aAAa,EAAE,2CAA2C;YAC1D,cAAc,EACZ,kGAAkG;YACpG,YAAY,EACV,yHAAyH;SAC5H;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,oBAAoB,EAAE,KAAK;gBAC3B,UAAU,EAAE;oBACV,YAAY,EAAE;wBACZ,IAAI,EAAE,SAAS;qBAChB;oBACD,cAAc,EAAE;wBACd,IAAI,EAAE,SAAS;qBAChB;iBACF;aACF;SACF;KACF;IACD,cAAc,EAAE;QACd;YACE,YAAY,EAAE,KAAK;YACnB,cAAc,EAAE,KAAK;SACtB;KACF;IACD,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC;QAChD;;;;;WAKG;QACH,SAAS,mBAAmB,CAAC,IAAmB;YAC9C,OAAO;gBACL,mCAAc,CAAC,uBAAuB;gBACtC,mCAAc,CAAC,mBAAmB;gBAClC,mCAAc,CAAC,kBAAkB;gBACjC,mCAAc,CAAC,6BAA6B;gBAC5C,mCAAc,C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AAO,CAAC,MAAM,iBACZ,IAAI,EACJ,SAAS,EAAE,eAAe,IACvB,YAAY,EACf,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-non-null-assertion.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-non-null-assertion.js new file mode 100644 index 000000000..9c0ac371d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-non-null-assertion.js @@ -0,0 +1,56 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-extra-non-null-assertion', + meta: { + type: 'problem', + docs: { + description: 'Disallow extra non-null assertion', + category: 'Stylistic Issues', + recommended: 'error', + }, + fixable: 'code', + schema: [], + messages: { + noExtraNonNullAssertion: 'Forbidden extra non-null assertion.', + }, + }, + defaultOptions: [], + create(context) { + function checkExtraNonNullAssertion(node) { + context.report({ + node, + messageId: 'noExtraNonNullAssertion', + fix(fixer) { + return fixer.removeRange([node.range[1] - 1, node.range[1]]); + }, + }); + } + return { + 'TSNonNullExpression > TSNonNullExpression': checkExtraNonNullAssertion, + 'MemberExpression[optional = true] > TSNonNullExpression': checkExtraNonNullAssertion, + 'CallExpression[optional = true] > TSNonNullExpression.callee': checkExtraNonNullAssertion, + }; + }, +}); +//# sourceMappingURL=no-extra-non-null-assertion.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-non-null-assertion.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-non-null-assertion.js.map new file mode 100644 index 000000000..ad93d3fe9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-non-null-assertion.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-extra-non-null-assertion.js","sourceRoot":"","sources":["../../src/rules/no-extra-non-null-assertion.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,8CAAgC;AAEhC,kBAAe,IAAI,CAAC,UAAU,CAAC;IAC7B,IAAI,EAAE,6BAA6B;IACnC,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,mCAAmC;YAChD,QAAQ,EAAE,kBAAkB;YAC5B,WAAW,EAAE,OAAO;SACrB;QACD,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,uBAAuB,EAAE,qCAAqC;SAC/D;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,SAAS,0BAA0B,CACjC,IAAkC;YAElC,OAAO,CAAC,MAAM,CAAC;gBACb,IAAI;gBACJ,SAAS,EAAE,yBAAyB;gBACpC,GAAG,CAAC,KAAK;oBACP,OAAO,KAAK,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC/D,CAAC;aACF,CAAC,CAAC;QACL,CAAC;QAED,OAAO;YACL,2CAA2C,EAAE,0BAA0B;YACvE,yDAAyD,EAAE,0BAA0B;YACrF,8DAA8D,EAAE,0BAA0B;SAC3F,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-parens.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-parens.js new file mode 100644 index 000000000..713be4ddd --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-parens.js @@ -0,0 +1,182 @@ +"use strict"; +// any is required to work around manipulating the AST in weird ways +/* eslint-disable @typescript-eslint/no-explicit-any */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const no_extra_parens_1 = __importDefault(require("eslint/lib/rules/no-extra-parens")); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-extra-parens', + meta: { + type: 'layout', + docs: { + description: 'Disallow unnecessary parentheses', + category: 'Possible Errors', + recommended: false, + extendsBaseRule: true, + }, + fixable: 'code', + schema: no_extra_parens_1.default.meta.schema, + messages: no_extra_parens_1.default.meta.messages, + }, + defaultOptions: ['all'], + create(context) { + const rules = no_extra_parens_1.default.create(context); + function binaryExp(node) { + const rule = rules.BinaryExpression; + // makes the rule think it should skip the left or right + const isLeftTypeAssertion = util.isTypeAssertion(node.left); + const isRightTypeAssertion = util.isTypeAssertion(node.right); + if (isLeftTypeAssertion && isRightTypeAssertion) { + return; // ignore + } + if (isLeftTypeAssertion) { + return rule(Object.assign(Object.assign({}, node), { left: Object.assign(Object.assign({}, node.left), { type: experimental_utils_1.AST_NODE_TYPES.SequenceExpression }) })); + } + if (isRightTypeAssertion) { + return rule(Object.assign(Object.assign({}, node), { right: Object.assign(Object.assign({}, node.right), { type: experimental_utils_1.AST_NODE_TYPES.SequenceExpression }) })); + } + return rule(node); + } + function callExp(node) { + var _a; + const rule = rules.CallExpression; + if (util.isTypeAssertion(node.callee)) { + // reduces the precedence of the node so the rule thinks it needs to be wrapped + return rule(Object.assign(Object.assign({}, node), { callee: Object.assign(Object.assign({}, node.callee), { type: experimental_utils_1.AST_NODE_TYPES.SequenceExpression }) })); + } + if (node.arguments.length === 1 && ((_a = node.typeParameters) === null || _a === void 0 ? void 0 : _a.params.some(param => param.type === experimental_utils_1.AST_NODE_TYPES.TSParenthesizedType || + param.type === experimental_utils_1.AST_NODE_TYPES.TSImportType))) { + return rule(Object.assign(Object.assign({}, node), { arguments: [ + Object.assign(Object.assign({}, node.arguments[0]), { type: experimental_utils_1.AST_NODE_TYPES.SequenceExpression }), + ] })); + } + return rule(node); + } + function unaryUpdateExpression(node) { + const rule = rules.UnaryExpression; + if (util.isTypeAssertion(node.argument)) { + // reduces the precedence of the node so the rule thinks it needs to be wrapped + return rule(Object.assign(Object.assign({}, node), { argument: Object.assign(Object.assign({}, node.argument), { type: experimental_utils_1.AST_NODE_TYPES.SequenceExpression }) })); + } + return rule(node); + } + const overrides = { + // ArrayExpression + ArrowFunctionExpression(node) { + if (!util.isTypeAssertion(node.body)) { + return rules.ArrowFunctionExpression(node); + } + }, + // AssignmentExpression + // AwaitExpression + BinaryExpression: binaryExp, + CallExpression: callExp, + // ClassDeclaration + // ClassExpression + ConditionalExpression(node) { + // reduces the precedence of the node so the rule thinks it needs to be wrapped + if (util.isTypeAssertion(node.test)) { + return rules.ConditionalExpression(Object.assign(Object.assign({}, node), { test: Object.assign(Object.assign({}, node.test), { type: experimental_utils_1.AST_NODE_TYPES.SequenceExpression }) })); + } + if (util.isTypeAssertion(node.consequent)) { + return rules.ConditionalExpression(Object.assign(Object.assign({}, node), { consequent: Object.assign(Object.assign({}, node.consequent), { type: experimental_utils_1.AST_NODE_TYPES.SequenceExpression }) })); + } + if (util.isTypeAssertion(node.alternate)) { + // reduces the precedence of the node so the rule thinks it needs to be rapped + return rules.ConditionalExpression(Object.assign(Object.assign({}, node), { alternate: Object.assign(Object.assign({}, node.alternate), { type: experimental_utils_1.AST_NODE_TYPES.SequenceExpression }) })); + } + return rules.ConditionalExpression(node); + }, + // DoWhileStatement + 'ForInStatement, ForOfStatement'(node) { + if (util.isTypeAssertion(node.right)) { + // makes the rule skip checking of the right + return rules['ForInStatement, ForOfStatement'](Object.assign(Object.assign({}, node), { type: experimental_utils_1.AST_NODE_TYPES.ForOfStatement, right: Object.assign(Object.assign({}, node.right), { type: experimental_utils_1.AST_NODE_TYPES.SequenceExpression }) })); + } + return rules['ForInStatement, ForOfStatement'](node); + }, + ForStatement(node) { + // make the rule skip the piece by removing it entirely + if (node.init && util.isTypeAssertion(node.init)) { + return rules.ForStatement(Object.assign(Object.assign({}, node), { init: null })); + } + if (node.test && util.isTypeAssertion(node.test)) { + return rules.ForStatement(Object.assign(Object.assign({}, node), { test: null })); + } + if (node.update && util.isTypeAssertion(node.update)) { + return rules.ForStatement(Object.assign(Object.assign({}, node), { update: null })); + } + return rules.ForStatement(node); + }, + 'ForStatement > *.init:exit'(node) { + if (!util.isTypeAssertion(node)) { + return rules['ForStatement > *.init:exit'](node); + } + }, + // IfStatement + LogicalExpression: binaryExp, + MemberExpression(node) { + if (util.isTypeAssertion(node.object)) { + // reduces the precedence of the node so the rule thinks it needs to be wrapped + return rules.MemberExpression(Object.assign(Object.assign({}, node), { object: Object.assign(Object.assign({}, node.object), { type: experimental_utils_1.AST_NODE_TYPES.SequenceExpression }) })); + } + return rules.MemberExpression(node); + }, + NewExpression: callExp, + // ObjectExpression + // ReturnStatement + // SequenceExpression + SpreadElement(node) { + if (!util.isTypeAssertion(node.argument)) { + return rules.SpreadElement(node); + } + }, + SwitchCase(node) { + if (node.test && !util.isTypeAssertion(node.test)) { + return rules.SwitchCase(node); + } + }, + // SwitchStatement + ThrowStatement(node) { + if (node.argument && !util.isTypeAssertion(node.argument)) { + return rules.ThrowStatement(node); + } + }, + UnaryExpression: unaryUpdateExpression, + UpdateExpression: unaryUpdateExpression, + // VariableDeclarator + // WhileStatement + // WithStatement - i'm not going to even bother implementing this terrible and never used feature + YieldExpression(node) { + if (node.argument && !util.isTypeAssertion(node.argument)) { + return rules.YieldExpression(node); + } + }, + }; + return Object.assign({}, rules, overrides); + }, +}); +//# sourceMappingURL=no-extra-parens.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-parens.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-parens.js.map new file mode 100644 index 000000000..b3b7d7eac --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-parens.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-extra-parens.js","sourceRoot":"","sources":["../../src/rules/no-extra-parens.ts"],"names":[],"mappings":";AAAA,oEAAoE;AACpE,uDAAuD;;;;;;;;;;;;;;;;;;;;;;;;AAEvD,8EAI+C;AAC/C,uFAAwD;AACxD,8CAAgC;AAKhC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE;YACJ,WAAW,EAAE,kCAAkC;YAC/C,QAAQ,EAAE,iBAAiB;YAC3B,WAAW,EAAE,KAAK;YAClB,eAAe,EAAE,IAAI;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,CAAC,IAAI;gBACb,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;oBACjD,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;iBAC/B;YACH,CAAC;YACD,kBAAkB;YAClB,cAAc,CAAC,IAAI;gBACjB,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;oBACzD,OAAO,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;iBACnC;YACH,CAAC;YACD,eAAe,EAAE,qBAAqB;YACtC,gBAAgB,EAAE,qBAAqB;YACvC,qBAAqB;YACrB,iBAAiB;YACjB,iGAAiG;YACjG,eAAe,CAAC,IAAI;gBAClB,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;oBACzD,OAAO,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;iBACpC;YACH,CAAC;SACF,CAAC;QACF,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IAC7C,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-semi.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-semi.js new file mode 100644 index 000000000..7c89f97d9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-semi.js @@ -0,0 +1,49 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const no_extra_semi_1 = __importDefault(require("eslint/lib/rules/no-extra-semi")); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-extra-semi', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow unnecessary semicolons', + category: 'Possible Errors', + recommended: 'error', + extendsBaseRule: true, + }, + fixable: 'code', + schema: no_extra_semi_1.default.meta.schema, + messages: no_extra_semi_1.default.meta.messages, + }, + defaultOptions: [], + create(context) { + const rules = no_extra_semi_1.default.create(context); + return Object.assign(Object.assign({}, rules), { ClassProperty(node) { + rules.MethodDefinition(node); + } }); + }, +}); +//# sourceMappingURL=no-extra-semi.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-semi.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-semi.js.map new file mode 100644 index 000000000..c7e87d7ab --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-semi.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-extra-semi.js","sourceRoot":"","sources":["../../src/rules/no-extra-semi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,mFAAsD;AACtD,8CAAgC;AAKhC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,iCAAiC;YAC9C,QAAQ,EAAE,iBAAiB;YAC3B,WAAW,EAAE,OAAO;YACpB,eAAe,EAAE,IAAI;SACtB;QACD,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,uBAAQ,CAAC,IAAI,CAAC,MAAM;QAC5B,QAAQ,EAAE,uBAAQ,CAAC,IAAI,CAAC,QAAQ;KACjC;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,MAAM,KAAK,GAAG,uBAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAEvC,uCACK,KAAK,KACR,aAAa,CAAC,IAAI;gBAChB,KAAK,CAAC,gBAAgB,CAAC,IAAa,CAAC,CAAC;YACxC,CAAC,IACD;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.js new file mode 100644 index 000000000..3e8136974 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.js @@ -0,0 +1,129 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-extraneous-class', + meta: { + type: 'suggestion', + docs: { + description: 'Forbids the use of classes as namespaces', + category: 'Best Practices', + recommended: false, + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowConstructorOnly: { + type: 'boolean', + }, + allowEmpty: { + type: 'boolean', + }, + allowStaticOnly: { + type: 'boolean', + }, + allowWithDecorator: { + type: 'boolean', + }, + }, + }, + ], + messages: { + empty: 'Unexpected empty class.', + onlyStatic: 'Unexpected class with only static properties.', + onlyConstructor: 'Unexpected class with only a constructor.', + }, + }, + defaultOptions: [ + { + allowConstructorOnly: false, + allowEmpty: false, + allowStaticOnly: false, + allowWithDecorator: false, + }, + ], + create(context, [{ allowConstructorOnly, allowEmpty, allowStaticOnly, allowWithDecorator }]) { + const isAllowWithDecorator = (node) => { + return !!(allowWithDecorator && + node && + node.decorators && + node.decorators.length); + }; + return { + ClassBody(node) { + const parent = node.parent; + if (!parent || parent.superClass) { + return; + } + const reportNode = 'id' in parent && parent.id ? parent.id : parent; + if (node.body.length === 0) { + if (allowEmpty || isAllowWithDecorator(parent)) { + return; + } + context.report({ + node: reportNode, + messageId: 'empty', + }); + return; + } + let onlyStatic = true; + let onlyConstructor = true; + for (const prop of node.body) { + if ('kind' in prop && prop.kind === 'constructor') { + if (prop.value.params.some(param => param.type === experimental_utils_1.AST_NODE_TYPES.TSParameterProperty)) { + onlyConstructor = false; + onlyStatic = false; + } + } + else { + onlyConstructor = false; + if ('static' in prop && !prop.static) { + onlyStatic = false; + } + } + if (!(onlyStatic || onlyConstructor)) { + break; + } + } + if (onlyConstructor) { + if (!allowConstructorOnly) { + context.report({ + node: reportNode, + messageId: 'onlyConstructor', + }); + } + return; + } + if (onlyStatic && !allowStaticOnly) { + context.report({ + node: reportNode, + messageId: 'onlyStatic', + }); + } + }, + }; + }, +}); +//# sourceMappingURL=no-extraneous-class.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.js.map new file mode 100644 index 000000000..6865a15f3 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-extraneous-class.js","sourceRoot":"","sources":["../../src/rules/no-extraneous-class.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,8CAAgC;AAYhC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,qBAAqB;IAC3B,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,0CAA0C;YACvD,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,KAAK;SACnB;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,oBAAoB,EAAE,KAAK;gBAC3B,UAAU,EAAE;oBACV,oBAAoB,EAAE;wBACpB,IAAI,EAAE,SAAS;qBAChB;oBACD,UAAU,EAAE;wBACV,IAAI,EAAE,SAAS;qBAChB;oBACD,eAAe,EAAE;wBACf,IAAI,EAAE,SAAS;qBAChB;oBACD,kBAAkB,EAAE;wBAClB,IAAI,EAAE,SAAS;qBAChB;iBACF;aACF;SACF;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,yBAAyB;YAChC,UAAU,EAAE,+CAA+C;YAC3D,eAAe,EAAE,2CAA2C;SAC7D;KACF;IACD,cAAc,EAAE;QACd;YACE,oBAAoB,EAAE,KAAK;YAC3B,UAAU,EAAE,KAAK;YACjB,eAAe,EAAE,KAAK;YACtB,kBAAkB,EAAE,KAAK;SAC1B;KACF;IACD,MAAM,CACJ,OAAO,EACP,CAAC,EAAE,oBAAoB,EAAE,UAAU,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC;QAE3E,MAAM,oBAAoB,GAAG,CAC3B,IAAsE,EAC7D,EAAE;YACX,OAAO,CAAC,CAAC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B;qBACF;oBACD,IAAI,CAAC,CAAC,UAAU,IAAI,eAAe,CAAC,EAAE;wBACpC,MAAM;qBACP;iBACF;gBAED,IAAI,eAAe,EAAE;oBACnB,IAAI,CAAC,oBAAoB,EAAE;wBACzB,OAAO,CAAC,MAAM,CAAC;4BACb,IAAI,EAAE,UAAU;4BAChB,SAAS,EAAE,iBAAiB;yBAC7B,CAAC,CAAC;qBACJ;oBACD,OAAO;iBACR;gBACD,IAAI,UAAU,IAAI,CAAC,eAAe,EAAE;oBAClC,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI,EAAE,UAAU;wBAChB,SAAS,EAAE,YAAY;qBACxB,CAAC,CAAC;iBACJ;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js new file mode 100644 index 000000000..38191bcb6 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js @@ -0,0 +1,204 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const tsutils = __importStar(require("tsutils")); +const ts = __importStar(require("typescript")); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-floating-promises', + meta: { + docs: { + description: 'Requires Promise-like values to be handled appropriately', + category: 'Best Practices', + recommended: 'error', + suggestion: true, + requiresTypeChecking: true, + }, + messages: { + floating: 'Promises must be handled appropriately.', + floatingVoid: 'Promises must be handled appropriately' + + ' or explicitly marked as ignored with the `void` operator.', + floatingFixVoid: 'Add void operator to ignore.', + }, + schema: [ + { + type: 'object', + properties: { + ignoreVoid: { type: 'boolean' }, + ignoreIIFE: { type: 'boolean' }, + }, + additionalProperties: false, + }, + ], + type: 'problem', + }, + defaultOptions: [ + { + ignoreVoid: true, + ignoreIIFE: false, + }, + ], + create(context, [options]) { + const parserServices = util.getParserServices(context); + const checker = parserServices.program.getTypeChecker(); + const sourceCode = context.getSourceCode(); + return { + ExpressionStatement(node) { + const { expression } = parserServices.esTreeNodeToTSNodeMap.get(node); + if (options.ignoreIIFE && isAsyncIife(node)) { + return; + } + if (isUnhandledPromise(checker, expression)) { + if (options.ignoreVoid) { + context.report({ + node, + messageId: 'floatingVoid', + suggest: [ + { + messageId: 'floatingFixVoid', + fix(fixer) { + let code = sourceCode.getText(node); + code = `void ${code}`; + return fixer.replaceText(node, code); + }, + }, + ], + }); + } + else { + context.report({ + node, + messageId: 'floating', + }); + } + } + }, + }; + function isAsyncIife(node) { + if (node.expression.type !== experimental_utils_1.AST_NODE_TYPES.CallExpression) { + return false; + } + return (node.expression.type === experimental_utils_1.AST_NODE_TYPES.CallExpression && + (node.expression.callee.type === + experimental_utils_1.AST_NODE_TYPES.ArrowFunctionExpression || + node.expression.callee.type === experimental_utils_1.AST_NODE_TYPES.FunctionExpression)); + } + function isUnhandledPromise(checker, node) { + // First, check expressions whose resulting types may not be promise-like + if (ts.isBinaryExpression(node) && + node.operatorToken.kind === ts.SyntaxKind.CommaToken) { + // Any child in a comma expression could return a potentially unhandled + // promise, so we check them all regardless of whether the final returned + // value is promise-like. + return (isUnhandledPromise(checker, node.left) || + isUnhandledPromise(checker, node.right)); + } + if (ts.isVoidExpression(node) && !options.ignoreVoid) { + // Similarly, a `void` expression always returns undefined, so we need to + // see what's inside it without checking the type of the overall expression. + return isUnhandledPromise(checker, node.expression); + } + // Check the type. At this point it can't be unhandled if it isn't a promise + if (!isPromiseLike(checker, node)) { + return false; + } + if (ts.isCallExpression(node)) { + // If the outer expression is a call, it must be either a `.then()` or + // `.catch()` that handles the promise. + return (!isPromiseCatchCallWithHandler(node) && + !isPromiseThenCallWithRejectionHandler(node) && + !isPromiseFinallyCallWithHandler(node)); + } + else if (ts.isConditionalExpression(node)) { + // We must be getting the promise-like value from one of the branches of the + // ternary. Check them directly. + return (isUnhandledPromise(checker, node.whenFalse) || + isUnhandledPromise(checker, node.whenTrue)); + } + else if (ts.isPropertyAccessExpression(node) || + ts.isIdentifier(node) || + ts.isNewExpression(node)) { + // If it is just a property access chain or a `new` call (e.g. `foo.bar` or + // `new Promise()`), the promise is not handled because it doesn't have the + // necessary then/catch call at the end of the chain. + return true; + } + // We conservatively return false for all other types of expressions because + // we don't want to accidentally fail if the promise is handled internally but + // we just can't tell. + return false; + } + }, +}); +// Modified from tsutils.isThenable() to only consider thenables which can be +// rejected/caught via a second parameter. Original source (MIT licensed): +// +// https://github.com/ajafff/tsutils/blob/49d0d31050b44b81e918eae4fbaf1dfe7b7286af/util/type.ts#L95-L125 +function isPromiseLike(checker, node) { + const type = checker.getTypeAtLocation(node); + for (const ty of tsutils.unionTypeParts(checker.getApparentType(type))) { + const then = ty.getProperty('then'); + if (then === undefined) { + continue; + } + const thenType = checker.getTypeOfSymbolAtLocation(then, node); + if (hasMatchingSignature(thenType, signature => signature.parameters.length >= 2 && + isFunctionParam(checker, signature.parameters[0], node) && + isFunctionParam(checker, signature.parameters[1], node))) { + return true; + } + } + return false; +} +function hasMatchingSignature(type, matcher) { + for (const t of tsutils.unionTypeParts(type)) { + if (t.getCallSignatures().some(matcher)) { + return true; + } + } + return false; +} +function isFunctionParam(checker, param, node) { + const type = checker.getApparentType(checker.getTypeOfSymbolAtLocation(param, node)); + for (const t of tsutils.unionTypeParts(type)) { + if (t.getCallSignatures().length !== 0) { + return true; + } + } + return false; +} +function isPromiseCatchCallWithHandler(expression) { + return (tsutils.isPropertyAccessExpression(expression.expression) && + expression.expression.name.text === 'catch' && + expression.arguments.length >= 1); +} +function isPromiseThenCallWithRejectionHandler(expression) { + return (tsutils.isPropertyAccessExpression(expression.expression) && + expression.expression.name.text === 'then' && + expression.arguments.length >= 2); +} +function isPromiseFinallyCallWithHandler(expression) { + return (tsutils.isPropertyAccessExpression(expression.expression) && + expression.expression.name.text === 'finally' && + expression.arguments.length >= 1); +} +//# sourceMappingURL=no-floating-promises.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js.map new file mode 100644 index 000000000..d02528781 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-floating-promises.js","sourceRoot":"","sources":["../../src/rules/no-floating-promises.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,iDAAmC;AACnC,+CAAiC;AACjC,8EAI+C;AAE/C,8CAAgC;AAWhC,kBAAe,IAAI,CAAC,UAAU,CAAqB;IACjD,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,WAAW,EAAE,0DAA0D;YACvE,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,OAAO;YACpB,UAAU,EAAE,IAAI;YAChB,oBAAoB,EAAE,IAAI;SAC3B;QACD,QAAQ,EAAE;YACR,QAAQ,EAAE,yCAAyC;YACnD,YAAY,EACV,wCAAwC;gBACxC,4DAA4D;YAC9D,eAAe,EAAE,8BAA8B;SAChD;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;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AA6B;IAE7B,OAAO,CACL,OAAO,CAAC,0BAA0B,CAAC,UAAU,CAAC,UAAU,CAAC;QACzD,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM;QAC1C,UAAU,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,CACjC,CAAC;AACJ,CAAC;AAED,SAAS,+BAA+B,CACtC,UAA6B;IAE7B,OAAO,CACL,OAAO,CAAC,0BAA0B,CAAC,UAAU,CAAC,UAAU,CAAC;QACzD,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS;QAC7C,UAAU,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,CACjC,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-for-in-array.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-for-in-array.js new file mode 100644 index 000000000..e1b7fc7dd --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-for-in-array.js @@ -0,0 +1,58 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const ts = __importStar(require("typescript")); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-for-in-array', + meta: { + docs: { + description: 'Disallow iterating over an array with a for-in loop', + category: 'Best Practices', + recommended: 'error', + requiresTypeChecking: true, + }, + messages: { + forInViolation: 'For-in loops over arrays are forbidden. Use for-of or array.forEach instead.', + }, + schema: [], + type: 'problem', + }, + defaultOptions: [], + create(context) { + return { + ForInStatement(node) { + const parserServices = util.getParserServices(context); + const checker = parserServices.program.getTypeChecker(); + const originalNode = parserServices.esTreeNodeToTSNodeMap.get(node); + const type = util.getConstrainedTypeAtLocation(checker, originalNode.expression); + if (util.isTypeArrayTypeOrUnionOfArrayTypes(type, checker) || + (type.flags & ts.TypeFlags.StringLike) !== 0) { + context.report({ + node, + messageId: 'forInViolation', + }); + } + }, + }; + }, +}); +//# sourceMappingURL=no-for-in-array.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-for-in-array.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-for-in-array.js.map new file mode 100644 index 000000000..67767b3c9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-for-in-array.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-for-in-array.js","sourceRoot":"","sources":["../../src/rules/no-for-in-array.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,8CAAgC;AAEhC,kBAAe,IAAI,CAAC,UAAU,CAAC;IAC7B,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,WAAW,EAAE,qDAAqD;YAClE,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,OAAO;YACpB,oBAAoB,EAAE,IAAI;SAC3B;QACD,QAAQ,EAAE;YACR,cAAc,EACZ,8EAA8E;SACjF;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,SAAS;KAChB;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,cAAc,CAAC,IAAI;gBACjB,MAAM,cAAc,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;gBACvD,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;gBACxD,MAAM,YAAY,GAAG,cAAc,CAAC,qBAAqB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBAEpE,MAAM,IAAI,GAAG,IAAI,CAAC,4BAA4B,CAC5C,OAAO,EACP,YAAY,CAAC,UAAU,CACxB,CAAC;gBAEF,IACE,IAAI,CAAC,kCAAkC,CAAC,IAAI,EAAE,OAAO,CAAC;oBACtD,CAAC,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,EAC5C;oBACA,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI;wBACJ,SAAS,EAAE,gBAAgB;qBAC5B,CAAC,CAAC;iBACJ;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implicit-any-catch.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implicit-any-catch.js new file mode 100644 index 000000000..fb3d31ef7 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implicit-any-catch.js @@ -0,0 +1,97 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const util = __importStar(require("../util")); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +exports.default = util.createRule({ + name: 'no-implicit-any-catch', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow usage of the implicit `any` type in catch clauses', + category: 'Best Practices', + recommended: false, + suggestion: true, + }, + fixable: 'code', + messages: { + implicitAnyInCatch: 'Implicit any in catch clause', + explicitAnyInCatch: 'Explicit any in catch clause', + suggestExplicitUnknown: 'Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowExplicitAny: { + type: 'boolean', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowExplicitAny: false, + }, + ], + create(context, [{ allowExplicitAny }]) { + return { + CatchClause(node) { + if (!node.param) { + return; // ignore catch without variable + } + if (!node.param.typeAnnotation) { + context.report({ + node, + messageId: 'implicitAnyInCatch', + suggest: [ + { + messageId: 'suggestExplicitUnknown', + fix(fixer) { + return fixer.insertTextAfter(node.param, ': unknown'); + }, + }, + ], + }); + } + else if (!allowExplicitAny && + node.param.typeAnnotation.typeAnnotation.type === + experimental_utils_1.AST_NODE_TYPES.TSAnyKeyword) { + context.report({ + node, + messageId: 'explicitAnyInCatch', + suggest: [ + { + messageId: 'suggestExplicitUnknown', + fix(fixer) { + return fixer.replaceText(node.param.typeAnnotation, ': unknown'); + }, + }, + ], + }); + } + }, + }; + }, +}); +//# sourceMappingURL=no-implicit-any-catch.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implicit-any-catch.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implicit-any-catch.js.map new file mode 100644 index 000000000..e5ed504fa --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implicit-any-catch.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-implicit-any-catch.js","sourceRoot":"","sources":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,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI;wBAC3C,mCAAc,CAAC,YAAY,EAC7B;oBACA,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI;wBACJ,SAAS,EAAE,oBAAoB;wBAC/B,OAAO,EAAE;4BACP;gCACE,SAAS,EAAE,wBAAwB;gCACnC,GAAG,CAAC,KAAK;oCACP,OAAO,KAAK,CAAC,WAAW,CACtB,IAAI,CAAC,KAAM,CAAC,cAAe,EAC3B,WAAW,CACZ,CAAC;gCACJ,CAAC;6BACF;yBACF;qBACF,CAAC,CAAC;iBACJ;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implied-eval.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implied-eval.js new file mode 100644 index 000000000..8fbc30cc7 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implied-eval.js @@ -0,0 +1,139 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const ts = __importStar(require("typescript")); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const tsutils = __importStar(require("tsutils")); +const util = __importStar(require("../util")); +const FUNCTION_CONSTRUCTOR = 'Function'; +const GLOBAL_CANDIDATES = new Set(['global', 'window', 'globalThis']); +const EVAL_LIKE_METHODS = new Set([ + 'setImmediate', + 'setInterval', + 'setTimeout', + 'execScript', +]); +exports.default = util.createRule({ + name: 'no-implied-eval', + meta: { + docs: { + description: 'Disallow the use of `eval()`-like methods', + category: 'Best Practices', + recommended: 'error', + requiresTypeChecking: true, + }, + messages: { + noImpliedEvalError: 'Implied eval. Consider passing a function.', + noFunctionConstructor: 'Implied eval. Do not use the Function constructor to create functions.', + }, + schema: [], + type: 'suggestion', + }, + defaultOptions: [], + create(context) { + const parserServices = util.getParserServices(context); + const program = parserServices.program; + const checker = parserServices.program.getTypeChecker(); + function getCalleeName(node) { + if (node.type === experimental_utils_1.AST_NODE_TYPES.Identifier) { + return node.name; + } + if (node.type === experimental_utils_1.AST_NODE_TYPES.MemberExpression && + node.object.type === experimental_utils_1.AST_NODE_TYPES.Identifier && + GLOBAL_CANDIDATES.has(node.object.name)) { + if (node.property.type === experimental_utils_1.AST_NODE_TYPES.Identifier) { + return node.property.name; + } + if (node.property.type === experimental_utils_1.AST_NODE_TYPES.Literal && + typeof node.property.value === 'string') { + return node.property.value; + } + } + return null; + } + function isFunctionType(node) { + const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node); + const type = checker.getTypeAtLocation(tsNode); + const symbol = type.getSymbol(); + if (symbol && + tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.Function | ts.SymbolFlags.Method)) { + return true; + } + const signatures = checker.getSignaturesOfType(type, ts.SignatureKind.Call); + return signatures.length > 0; + } + function isFunction(node) { + switch (node.type) { + case experimental_utils_1.AST_NODE_TYPES.ArrowFunctionExpression: + case experimental_utils_1.AST_NODE_TYPES.FunctionDeclaration: + case experimental_utils_1.AST_NODE_TYPES.FunctionExpression: + return true; + case experimental_utils_1.AST_NODE_TYPES.MemberExpression: + case experimental_utils_1.AST_NODE_TYPES.Identifier: + return isFunctionType(node); + case experimental_utils_1.AST_NODE_TYPES.CallExpression: + return ((node.callee.type === experimental_utils_1.AST_NODE_TYPES.Identifier && + node.callee.name === 'bind') || + isFunctionType(node)); + default: + return false; + } + } + function checkImpliedEval(node) { + var _a; + const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node.callee); + const type = checker.getTypeAtLocation(tsNode); + const calleeName = getCalleeName(node.callee); + if (calleeName === null) { + return; + } + if (calleeName === FUNCTION_CONSTRUCTOR) { + const symbol = type.getSymbol(); + if (symbol) { + const declarations = (_a = symbol.getDeclarations()) !== null && _a !== void 0 ? _a : []; + for (const declaration of declarations) { + const sourceFile = declaration.getSourceFile(); + if (program.isSourceFileDefaultLibrary(sourceFile)) { + context.report({ node, messageId: 'noFunctionConstructor' }); + return; + } + } + } + else { + context.report({ node, messageId: 'noFunctionConstructor' }); + return; + } + } + if (node.arguments.length === 0) { + return; + } + const [handler] = node.arguments; + if (EVAL_LIKE_METHODS.has(calleeName) && !isFunction(handler)) { + context.report({ node: handler, messageId: 'noImpliedEvalError' }); + } + } + return { + NewExpression: checkImpliedEval, + CallExpression: checkImpliedEval, + }; + }, +}); +//# sourceMappingURL=no-implied-eval.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implied-eval.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implied-eval.js.map new file mode 100644 index 000000000..f58a0f96b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implied-eval.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-implied-eval.js","sourceRoot":"","sources":["../../src/rules/no-implied-eval.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,8EAG+C;AAC/C,iDAAmC;AACnC,8CAAgC;AAEhC,MAAM,oBAAoB,GAAG,UAAU,CAAC;AACxC,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;AACtE,M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EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC,CAAC;aACpE;QACH,CAAC;QAED,OAAO;YACL,aAAa,EAAE,gBAAgB;YAC/B,cAAc,EAAE,gBAAgB;SACjC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js new file mode 100644 index 000000000..60ff6fb11 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js @@ -0,0 +1,199 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-inferrable-types', + meta: { + type: 'suggestion', + docs: { + description: 'Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean', + category: 'Best Practices', + recommended: 'error', + }, + fixable: 'code', + messages: { + noInferrableType: 'Type {{type}} trivially inferred from a {{type}} literal, remove type annotation.', + }, + schema: [ + { + type: 'object', + properties: { + ignoreParameters: { + type: 'boolean', + }, + ignoreProperties: { + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], + }, + defaultOptions: [ + { + ignoreParameters: false, + ignoreProperties: false, + }, + ], + create(context, [{ ignoreParameters, ignoreProperties }]) { + function isFunctionCall(init, callName) { + if (init.type === experimental_utils_1.AST_NODE_TYPES.ChainExpression) { + return isFunctionCall(init.expression, callName); + } + return (init.type === experimental_utils_1.AST_NODE_TYPES.CallExpression && + init.callee.type === experimental_utils_1.AST_NODE_TYPES.Identifier && + init.callee.name === callName); + } + function isLiteral(init, typeName) { + return (init.type === experimental_utils_1.AST_NODE_TYPES.Literal && typeof init.value === typeName); + } + function isIdentifier(init, ...names) { + return (init.type === experimental_utils_1.AST_NODE_TYPES.Identifier && names.includes(init.name)); + } + function hasUnaryPrefix(init, ...operators) { + return (init.type === experimental_utils_1.AST_NODE_TYPES.UnaryExpression && + operators.includes(init.operator)); + } + const keywordMap = { + [experimental_utils_1.AST_NODE_TYPES.TSBigIntKeyword]: 'bigint', + [experimental_utils_1.AST_NODE_TYPES.TSBooleanKeyword]: 'boolean', + [experimental_utils_1.AST_NODE_TYPES.TSNumberKeyword]: 'number', + [experimental_utils_1.AST_NODE_TYPES.TSNullKeyword]: 'null', + [experimental_utils_1.AST_NODE_TYPES.TSStringKeyword]: 'string', + [experimental_utils_1.AST_NODE_TYPES.TSSymbolKeyword]: 'symbol', + [experimental_utils_1.AST_NODE_TYPES.TSUndefinedKeyword]: 'undefined', + }; + /** + * Returns whether a node has an inferrable value or not + */ + function isInferrable(annotation, init) { + switch (annotation.type) { + case experimental_utils_1.AST_NODE_TYPES.TSBigIntKeyword: { + // note that bigint cannot have + prefixed to it + const unwrappedInit = hasUnaryPrefix(init, '-') + ? init.argument + : init; + return (isFunctionCall(unwrappedInit, 'BigInt') || + (unwrappedInit.type === experimental_utils_1.AST_NODE_TYPES.Literal && + 'bigint' in unwrappedInit)); + } + case experimental_utils_1.AST_NODE_TYPES.TSBooleanKeyword: + return (hasUnaryPrefix(init, '!') || + // eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum + isFunctionCall(init, 'Boolean') || + isLiteral(init, 'boolean')); + case experimental_utils_1.AST_NODE_TYPES.TSNumberKeyword: { + const unwrappedInit = hasUnaryPrefix(init, '+', '-') + ? init.argument + : init; + return (isIdentifier(unwrappedInit, 'Infinity', 'NaN') || + isFunctionCall(unwrappedInit, 'Number') || + isLiteral(unwrappedInit, 'number')); + } + case experimental_utils_1.AST_NODE_TYPES.TSNullKeyword: + return init.type === experimental_utils_1.AST_NODE_TYPES.Literal && init.value === null; + case experimental_utils_1.AST_NODE_TYPES.TSStringKeyword: + return ( + // eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum + isFunctionCall(init, 'String') || + isLiteral(init, 'string') || + init.type === experimental_utils_1.AST_NODE_TYPES.TemplateLiteral); + case experimental_utils_1.AST_NODE_TYPES.TSSymbolKeyword: + return isFunctionCall(init, 'Symbol'); + case experimental_utils_1.AST_NODE_TYPES.TSTypeReference: { + if (annotation.typeName.type === experimental_utils_1.AST_NODE_TYPES.Identifier && + annotation.typeName.name === 'RegExp') { + const isRegExpLiteral = init.type === experimental_utils_1.AST_NODE_TYPES.Literal && + init.value instanceof RegExp; + const isRegExpNewCall = init.type === experimental_utils_1.AST_NODE_TYPES.NewExpression && + init.callee.type === experimental_utils_1.AST_NODE_TYPES.Identifier && + init.callee.name === 'RegExp'; + const isRegExpCall = isFunctionCall(init, 'RegExp'); + return isRegExpLiteral || isRegExpCall || isRegExpNewCall; + } + return false; + } + case experimental_utils_1.AST_NODE_TYPES.TSUndefinedKeyword: + return (hasUnaryPrefix(init, 'void') || isIdentifier(init, 'undefined')); + } + return false; + } + /** + * Reports an inferrable type declaration, if any + */ + function reportInferrableType(node, typeNode, initNode) { + if (!typeNode || !initNode || !typeNode.typeAnnotation) { + return; + } + if (!isInferrable(typeNode.typeAnnotation, initNode)) { + return; + } + const type = typeNode.typeAnnotation.type === experimental_utils_1.AST_NODE_TYPES.TSTypeReference + ? // TODO - if we add more references + 'RegExp' + : keywordMap[typeNode.typeAnnotation.type]; + context.report({ + node, + messageId: 'noInferrableType', + data: { + type, + }, + fix: fixer => fixer.remove(typeNode), + }); + } + function inferrableVariableVisitor(node) { + if (!node.id) { + return; + } + reportInferrableType(node, node.id.typeAnnotation, node.init); + } + function inferrableParameterVisitor(node) { + if (ignoreParameters || !node.params) { + return; + } + node.params.filter(param => param.type === experimental_utils_1.AST_NODE_TYPES.AssignmentPattern && + param.left && + param.right).forEach(param => { + reportInferrableType(param, param.left.typeAnnotation, param.right); + }); + } + function inferrablePropertyVisitor(node) { + // We ignore `readonly` because of Microsoft/TypeScript#14416 + // Essentially a readonly property without a type + // will result in its value being the type, leading to + // compile errors if the type is stripped. + if (ignoreProperties || node.readonly || node.optional) { + return; + } + reportInferrableType(node, node.typeAnnotation, node.value); + } + return { + VariableDeclarator: inferrableVariableVisitor, + FunctionExpression: inferrableParameterVisitor, + FunctionDeclaration: inferrableParameterVisitor, + ArrowFunctionExpression: inferrableParameterVisitor, + ClassProperty: inferrablePropertyVisitor, + }; + }, +}); +//# sourceMappingURL=no-inferrable-types.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js.map new file mode 100644 index 000000000..a31baf22c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-inferrable-types.js","sourceRoot":"","sources":["../../src/rules/no-inferrable-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,8CAAgC;AAUhC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,qBAAqB;IAC3B,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EACT,8GAA8G;YAChH,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,OAAO;SACrB;Q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CAAC;QAED,SAAS,0BAA0B,CACjC,IAGoC;YAEpC,IAAI,gBAAgB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;gBACpC,OAAO;aACR;YACA,IAAI,CAAC,MAAM,CAAC,MAAM,CACjB,KAAK,CAAC,EAAE,CACN,KAAK,CAAC,IAAI,KAAK,mCAAc,CAAC,iBAAiB;gBAC/C,KAAK,CAAC,IAAI;gBACV,KAAK,CAAC,KAAK,CACmB,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBACjD,oBAAoB,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;YACtE,CAAC,CAAC,CAAC;QACL,CAAC;QAED,SAAS,yBAAyB,CAAC,IAA4B;YAC7D,6DAA6D;YAC7D,iDAAiD;YACjD,sDAAsD;YACtD,0CAA0C;YAC1C,IAAI,gBAAgB,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACtD,OAAO;aACR;YACD,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QAC9D,CAAC;QAED,OAAO;YACL,kBAAkB,EAAE,yBAAyB;YAC7C,kBAAkB,EAAE,0BAA0B;YAC9C,mBAAmB,EAAE,0BAA0B;YAC/C,uBAAuB,EAAE,0BAA0B;YACnD,aAAa,EAAE,yBAAyB;SACzC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-this.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-this.js new file mode 100644 index 000000000..bfa7ae2c9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-this.js @@ -0,0 +1,59 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const no_invalid_this_1 = __importDefault(require("eslint/lib/rules/no-invalid-this")); +const util_1 = require("../util"); +exports.default = util_1.createRule({ + name: 'no-invalid-this', + meta: { + type: 'suggestion', + docs: { + description: 'disallow `this` keywords outside of classes or class-like objects', + category: 'Best Practices', + recommended: false, + extendsBaseRule: true, + }, + messages: (_a = no_invalid_this_1.default.meta.messages) !== null && _a !== void 0 ? _a : { + unexpectedThis: "Unexpected 'this'.", + }, + schema: no_invalid_this_1.default.meta.schema, + }, + defaultOptions: [{ capIsConstructor: true }], + create(context) { + const rules = no_invalid_this_1.default.create(context); + const argList = []; + return Object.assign(Object.assign({}, rules), { FunctionDeclaration(node) { + argList.push(node.params.some(param => param.type === experimental_utils_1.AST_NODE_TYPES.Identifier && param.name === 'this')); + // baseRule's work + rules.FunctionDeclaration(node); + }, + 'FunctionDeclaration:exit'(node) { + argList.pop(); + // baseRule's work + rules['FunctionDeclaration:exit'](node); + }, + FunctionExpression(node) { + argList.push(node.params.some(param => param.type === experimental_utils_1.AST_NODE_TYPES.Identifier && param.name === 'this')); + // baseRule's work + rules.FunctionExpression(node); + }, + 'FunctionExpression:exit'(node) { + argList.pop(); + // baseRule's work + rules['FunctionExpression:exit'](node); + }, + ThisExpression(node) { + const lastFnArg = argList[argList.length - 1]; + if (lastFnArg) { + return; + } + // baseRule's work + rules.ThisExpression(node); + } }); + }, +}); +//# sourceMappingURL=no-invalid-this.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-this.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-this.js.map new file mode 100644 index 000000000..1d60a4ee4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-this.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-invalid-this.js","sourceRoot":"","sources":["../../src/rules/no-invalid-this.ts"],"names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AC,UAAU,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,CACpE,CACF,CAAC;gBACF,kBAAkB;gBAClB,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;YACjC,CAAC;YACD,yBAAyB,CAAC,IAAiC;gBACzD,OAAO,CAAC,GAAG,EAAE,CAAC;gBACd,kBAAkB;gBAClB,KAAK,CAAC,yBAAyB,CAAC,CAAC,IAAI,CAAC,CAAC;YACzC,CAAC;YACD,cAAc,CAAC,IAA6B;gBAC1C,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;gBAE9C,IAAI,SAAS,EAAE;oBACb,OAAO;iBACR;gBAED,kBAAkB;gBAClB,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;YAC7B,CAAC,IACD;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.js new file mode 100644 index 000000000..eff4c2bfe --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.js @@ -0,0 +1,163 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-invalid-void-type', + meta: { + type: 'problem', + docs: { + description: 'Disallows usage of `void` type outside of generic or return types', + category: 'Best Practices', + recommended: false, + }, + messages: { + invalidVoidForGeneric: '{{ generic }} may not have void as a type variable', + invalidVoidNotReturnOrGeneric: 'void is only valid as a return type or generic type variable', + invalidVoidNotReturn: 'void is only valid as a return type', + }, + schema: [ + { + type: 'object', + properties: { + allowInGenericTypeArguments: { + oneOf: [ + { type: 'boolean' }, + { + type: 'array', + items: { type: 'string' }, + minLength: 1, + }, + ], + }, + }, + additionalProperties: false, + }, + ], + }, + defaultOptions: [{ allowInGenericTypeArguments: true }], + create(context, [{ allowInGenericTypeArguments }]) { + const validParents = [ + experimental_utils_1.AST_NODE_TYPES.TSTypeAnnotation, + ]; + const invalidGrandParents = [ + experimental_utils_1.AST_NODE_TYPES.TSPropertySignature, + experimental_utils_1.AST_NODE_TYPES.CallExpression, + experimental_utils_1.AST_NODE_TYPES.ClassProperty, + experimental_utils_1.AST_NODE_TYPES.Identifier, + ]; + const validUnionMembers = [ + experimental_utils_1.AST_NODE_TYPES.TSVoidKeyword, + experimental_utils_1.AST_NODE_TYPES.TSNeverKeyword, + ]; + if (allowInGenericTypeArguments === true) { + validParents.push(experimental_utils_1.AST_NODE_TYPES.TSTypeParameterInstantiation); + } + /** + * @brief check if the given void keyword is used as a valid generic type + * + * reports if the type parametrized by void is not in the whitelist, or + * allowInGenericTypeArguments is false. + * no-op if the given void keyword is not used as generic type + */ + function checkGenericTypeArgument(node) { + var _a, _b; + // only matches T<..., void, ...> + // extra check for precaution + /* istanbul ignore next */ + if (((_a = node.parent) === null || _a === void 0 ? void 0 : _a.type) !== experimental_utils_1.AST_NODE_TYPES.TSTypeParameterInstantiation || + ((_b = node.parent.parent) === null || _b === void 0 ? void 0 : _b.type) !== experimental_utils_1.AST_NODE_TYPES.TSTypeReference) { + return; + } + // check whitelist + if (Array.isArray(allowInGenericTypeArguments)) { + const sourceCode = context.getSourceCode(); + const fullyQualifiedName = sourceCode + .getText(node.parent.parent.typeName) + .replace(/ /gu, ''); + if (!allowInGenericTypeArguments + .map(s => s.replace(/ /gu, '')) + .includes(fullyQualifiedName)) { + context.report({ + messageId: 'invalidVoidForGeneric', + data: { generic: fullyQualifiedName }, + node, + }); + } + return; + } + if (!allowInGenericTypeArguments) { + context.report({ + messageId: 'invalidVoidNotReturn', + node, + }); + } + } + /** + * @brief checks that a union containing void is valid + * @return true if every member of the union is specified as a valid type in + * validUnionMembers, or is a valid generic type parametrized by void + */ + function isValidUnionType(node) { + return node.types.every(member => { + var _a, _b; + return validUnionMembers.includes(member.type) || + // allows any T<..., void, ...> here, checked by checkGenericTypeArgument + (member.type === experimental_utils_1.AST_NODE_TYPES.TSTypeReference && + ((_a = member.typeParameters) === null || _a === void 0 ? void 0 : _a.type) === + experimental_utils_1.AST_NODE_TYPES.TSTypeParameterInstantiation && ((_b = member.typeParameters) === null || _b === void 0 ? void 0 : _b.params.map(param => param.type).includes(experimental_utils_1.AST_NODE_TYPES.TSVoidKeyword))); + }); + } + return { + TSVoidKeyword(node) { + var _a; + /* istanbul ignore next */ + if (!((_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent)) { + return; + } + // checks T<..., void, ...> against specification of allowInGenericArguments option + if (node.parent.type === experimental_utils_1.AST_NODE_TYPES.TSTypeParameterInstantiation && + node.parent.parent.type === experimental_utils_1.AST_NODE_TYPES.TSTypeReference) { + checkGenericTypeArgument(node); + return; + } + // union w/ void must contain types from validUnionMembers, or a valid generic void type + if (node.parent.type === experimental_utils_1.AST_NODE_TYPES.TSUnionType && + isValidUnionType(node.parent)) { + return; + } + // default cases + if (validParents.includes(node.parent.type) && + !invalidGrandParents.includes(node.parent.parent.type)) { + return; + } + context.report({ + messageId: allowInGenericTypeArguments + ? 'invalidVoidNotReturnOrGeneric' + : 'invalidVoidNotReturn', + node, + }); + }, + }; + }, +}); +//# sourceMappingURL=no-invalid-void-type.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.js.map new file mode 100644 index 000000000..ec011fc43 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-invalid-void-type.js","sourceRoot":"","sources":["../../src/rules/no-invalid-void-type.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,8CAAgC;AAWhC,kBAAe,IAAI,CAAC,UAAU,CAAwB;IACpD,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EACT,mEAAmE;YACrE,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,KAAK;SACnB;QACD,QAAQ,EAAE;YACR,qBAAqB,EACnB,oDAAoD;YACtD,6BAA6B,EAC3B,8DAA8D;YAChE,oBAAoB,EAAE,qCAAqC;SAC5D;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,2BAA2B,EAAE;wBAC3B,KAAK,EAAE;4BACL,EAAE,IAAI,EAAE,SAAS,EAAE;4BACnB;gCACE,IAAI,EAAE,OAAO;gCACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gCACzB,SAAS,EAAE,CAAC;6BACb;yBACF;qBACF;iBACF;gBACD,oBAAoB,EAAE,KAAK;aAC5B;SACF;KACF;IACD,cAAc,EAAE,CAAC,EAAE,2BAA2B,EAAE,IAAI,EAAE,CAAC;IACvD,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE,2BAA2B,EAAE,CAAC;QAC/C,MAAM,YAAY,GAAqB;YACrC,mCAAc,CAAC,gBAAgB;SAChC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I,CAAC,MAAM,CAAC,IAAI,CAAC;oBACvC,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EACtD;oBACA,OAAO;iBACR;gBAED,OAAO,CAAC,MAAM,CAAC;oBACb,SAAS,EAAE,2BAA2B;wBACpC,CAAC,CAAC,+BAA+B;wBACjC,CAAC,CAAC,sBAAsB;oBAC1B,IAAI;iBACL,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loop-func.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loop-func.js new file mode 100644 index 000000000..50e42bb2b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loop-func.js @@ -0,0 +1,196 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const no_loop_func_1 = __importDefault(require("eslint/lib/rules/no-loop-func")); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-loop-func', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow function declarations that contain unsafe references inside loop statements', + category: 'Best Practices', + recommended: false, + extendsBaseRule: true, + }, + schema: [], + messages: (_a = no_loop_func_1.default === null || no_loop_func_1.default === void 0 ? void 0 : no_loop_func_1.default.meta.messages) !== null && _a !== void 0 ? _a : { + unsafeRefs: 'Function declared in a loop contains unsafe references to variable(s) {{ varNames }}.', + }, + }, + defaultOptions: [], + create(context) { + /** + * Reports functions which match the following condition: + * - has a loop node in ancestors. + * - has any references which refers to an unsafe variable. + * + * @param node The AST node to check. + * @returns Whether or not the node is within a loop. + */ + function checkForLoops(node) { + const loopNode = getContainingLoopNode(node); + if (!loopNode) { + return; + } + const references = context.getScope().through; + const unsafeRefs = references + .filter(r => !isSafe(loopNode, r)) + .map(r => r.identifier.name); + if (unsafeRefs.length > 0) { + context.report({ + node, + messageId: 'unsafeRefs', + data: { varNames: `'${unsafeRefs.join("', '")}'` }, + }); + } + } + return { + ArrowFunctionExpression: checkForLoops, + FunctionExpression: checkForLoops, + FunctionDeclaration: checkForLoops, + }; + }, +}); +/** + * Gets the containing loop node of a specified node. + * + * We don't need to check nested functions, so this ignores those. + * `Scope.through` contains references of nested functions. + * + * @param node An AST node to get. + * @returns The containing loop node of the specified node, or `null`. + */ +function getContainingLoopNode(node) { + for (let currentNode = node; currentNode.parent; currentNode = currentNode.parent) { + const parent = currentNode.parent; + switch (parent.type) { + case experimental_utils_1.AST_NODE_TYPES.WhileStatement: + case experimental_utils_1.AST_NODE_TYPES.DoWhileStatement: + return parent; + case experimental_utils_1.AST_NODE_TYPES.ForStatement: + // `init` is outside of the loop. + if (parent.init !== currentNode) { + return parent; + } + break; + case experimental_utils_1.AST_NODE_TYPES.ForInStatement: + case experimental_utils_1.AST_NODE_TYPES.ForOfStatement: + // `right` is outside of the loop. + if (parent.right !== currentNode) { + return parent; + } + break; + case experimental_utils_1.AST_NODE_TYPES.ArrowFunctionExpression: + case experimental_utils_1.AST_NODE_TYPES.FunctionExpression: + case experimental_utils_1.AST_NODE_TYPES.FunctionDeclaration: + // We don't need to check nested functions. + return null; + default: + break; + } + } + return null; +} +/** + * Gets the containing loop node of a given node. + * If the loop was nested, this returns the most outer loop. + * @param node A node to get. This is a loop node. + * @param excludedNode A node that the result node should not include. + * @returns The most outer loop node. + */ +function getTopLoopNode(node, excludedNode) { + const border = excludedNode ? excludedNode.range[1] : 0; + let retv = node; + let containingLoopNode = node; + while (containingLoopNode && containingLoopNode.range[0] >= border) { + retv = containingLoopNode; + containingLoopNode = getContainingLoopNode(containingLoopNode); + } + return retv; +} +/** + * Checks whether a given reference which refers to an upper scope's variable is + * safe or not. + * @param loopNode A containing loop node. + * @param reference A reference to check. + * @returns `true` if the reference is safe or not. + */ +function isSafe(loopNode, reference) { + var _a; + const variable = reference.resolved; + const definition = variable === null || variable === void 0 ? void 0 : variable.defs[0]; + const declaration = definition === null || definition === void 0 ? void 0 : definition.parent; + const kind = (declaration === null || declaration === void 0 ? void 0 : declaration.type) === experimental_utils_1.AST_NODE_TYPES.VariableDeclaration + ? declaration.kind + : ''; + // type references are all safe + // this only really matters for global types that haven't been configured + if (reference.isTypeReference) { + return true; + } + // Variables which are declared by `const` is safe. + if (kind === 'const') { + return true; + } + /* + * Variables which are declared by `let` in the loop is safe. + * It's a different instance from the next loop step's. + */ + if (kind === 'let' && + declaration && + declaration.range[0] > loopNode.range[0] && + declaration.range[1] < loopNode.range[1]) { + return true; + } + /* + * WriteReferences which exist after this border are unsafe because those + * can modify the variable. + */ + const border = getTopLoopNode(loopNode, kind === 'let' ? declaration : null) + .range[0]; + /** + * Checks whether a given reference is safe or not. + * The reference is every reference of the upper scope's variable we are + * looking now. + * + * It's safe if the reference matches one of the following condition. + * - is readonly. + * - doesn't exist inside a local function and after the border. + * + * @param upperRef A reference to check. + * @returns `true` if the reference is safe. + */ + function isSafeReference(upperRef) { + var _a; + const id = upperRef.identifier; + return (!upperRef.isWrite() || + (((_a = variable === null || variable === void 0 ? void 0 : variable.scope) === null || _a === void 0 ? void 0 : _a.variableScope) === upperRef.from.variableScope && + id.range[0] < border)); + } + return (_a = variable === null || variable === void 0 ? void 0 : variable.references.every(isSafeReference)) !== null && _a !== void 0 ? _a : false; +} +//# sourceMappingURL=no-loop-func.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loop-func.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loop-func.js.map new file mode 100644 index 000000000..45c6496cd --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loop-func.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-loop-func.js","sourceRoot":"","sources":["../../src/rules/no-loop-func.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8EAI+C;AAC/C,iFAAqD;AACrD,8CAAgC;AAKhC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EACT,sFAAsF;YACxF,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,KAAK;YAClB,eAAe,EAAE,IAAI;SACtB;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,QAAE,sBAAQ,aAAR,sBAAQ,uBAAR,sBAAQ,CAAE,IAAI,CAAC,QAAQ,mCAAI;YACnC,UAAU,EACR,uFAAuF;SAC1F;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ;;;;;;;WAOG;QACH,SAAS,aAAa,CACpB,IAGgC;YAEhC,MAAM,QAAQ,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;YAE7C,IAAI,CAAC,QAAQ,EAAE;gBACb,OAAO;aACR;YAED,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC;YAC9C,MAAM,UAAU,GAAG,UAAU;iBAC1B,MAAM,CAA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ACpB,OAAO,IAAI,CAAC;KACb;IAED;;;OAGG;IACH,IACE,IAAI,KAAK,KAAK;QACd,WAAW;QACX,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QACxC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EACxC;QACA,OAAO,IAAI,CAAC;KACb;IAED;;;OAGG;IACH,MAAM,MAAM,GAAG,cAAc,CAAC,QAAQ,EAAE,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;SACzE,KAAK,CAAC,CAAC,CAAC,CAAC;IAEZ;;;;;;;;;;;OAWG;IACH,SAAS,eAAe,CAAC,QAAkC;;QACzD,MAAM,EAAE,GAAG,QAAQ,CAAC,UAAU,CAAC;QAE/B,OAAO,CACL,CAAC,QAAQ,CAAC,OAAO,EAAE;YACnB,CAAC,OAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,0CAAE,aAAa,MAAK,QAAQ,CAAC,IAAI,CAAC,aAAa;gBAC7D,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CACxB,CAAC;IACJ,CAAC;IAED,aAAO,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,UAAU,CAAC,KAAK,CAAC,eAAe,oCAAK,KAAK,CAAC;AAC9D,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loss-of-precision.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loss-of-precision.js new file mode 100644 index 000000000..154caa182 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loss-of-precision.js @@ -0,0 +1,63 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const util = __importStar(require("../util")); +const baseRule = (() => { + try { + return require('eslint/lib/rules/no-loss-of-precision'); + } + catch (_a) { + /* istanbul ignore next */ + return null; + } +})(); +exports.default = util.createRule({ + name: 'no-loss-of-precision', + meta: { + type: 'problem', + docs: { + description: 'Disallow literal numbers that lose precision', + category: 'Possible Errors', + recommended: false, + extendsBaseRule: true, + }, + schema: [], + messages: (_a = baseRule === null || baseRule === void 0 ? void 0 : baseRule.meta.messages) !== null && _a !== void 0 ? _a : { noLossOfPrecision: '' }, + }, + defaultOptions: [], + create(context) { + /* istanbul ignore if */ if (baseRule === null) { + throw new Error('@typescript-eslint/no-loss-of-precision requires at least ESLint v7.1.0'); + } + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + const rules = baseRule.create(context); + function isSeperatedNumeric(node) { + return typeof node.value === 'number' && node.raw.includes('_'); + } + return { + Literal(node) { + rules.Literal(Object.assign(Object.assign({}, node), { raw: isSeperatedNumeric(node) ? node.raw.replace(/_/g, '') : node.raw })); + }, + }; + }, +}); +//# sourceMappingURL=no-loss-of-precision.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loss-of-precision.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loss-of-precision.js.map new file mode 100644 index 000000000..ad268ed9e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loss-of-precision.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-loss-of-precision.js","sourceRoot":"","sources":["../../src/rules/no-loss-of-precision.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAEA,8CAAgC;AAEhC,MAAM,QAAQ,GAAG,CAAC,GAA2B,EAAE;IAC7C,IAAI;QACF,OAAO,OAAO,CAAC,uCAAuC,CAAC,CAAC;KACzD;IAAC,WAAM;QACN,0BAA0B;QAC1B,OAAO,IAAI,CAAC;KACb;AACH,CAAC,CAAC,EAAE,CAAC;AAKL,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,8CAA8C;YAC3D,QAAQ,EAAE,iBAAiB;YAC3B,WAAW,EAAE,KAAK;YAClB,eAAe,EAAE,IAAI;SACtB;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,QAAE,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,CAAC,QAAQ,mCAAI,EAAE,iBAAiB,EAAE,EAAE,EAAE;KAC/D;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,wBAAwB,CAAC,IAAI,QAAQ,KAAK,IAAI,EAAE;YAC9C,MAAM,IAAI,KAAK,CACb,yEAAyE,CAC1E,CAAC;SACH;QAED,4EAA4E;QAC5E,MAAM,KAAK,GAAG,QAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAExC,SAAS,kBAAkB,CAAC,IAAsB;YAChD,OAAO,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAClE,CAAC;QACD,OAAO;YACL,OAAO,CAAC,IAAsB;gBAC5B,KAAK,CAAC,OAAO,iCACR,IAAI,KACP,GAAG,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,IACrE,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.js new file mode 100644 index 000000000..f413422e5 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.js @@ -0,0 +1,205 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const no_magic_numbers_1 = __importDefault(require("eslint/lib/rules/no-magic-numbers")); +const util = __importStar(require("../util")); +const baseRuleSchema = Array.isArray(no_magic_numbers_1.default.meta.schema) + ? no_magic_numbers_1.default.meta.schema[0] + : no_magic_numbers_1.default.meta.schema; +exports.default = util.createRule({ + name: 'no-magic-numbers', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow magic numbers', + category: 'Best Practices', + recommended: false, + extendsBaseRule: true, + }, + // Extend base schema with additional property to ignore TS numeric literal types + schema: [ + Object.assign(Object.assign({}, baseRuleSchema), { properties: Object.assign(Object.assign({}, baseRuleSchema.properties), { ignoreNumericLiteralTypes: { + type: 'boolean', + }, ignoreEnums: { + type: 'boolean', + }, ignoreReadonlyClassProperties: { + type: 'boolean', + } }) }), + ], + messages: (_a = no_magic_numbers_1.default.meta.messages) !== null && _a !== void 0 ? _a : { + useConst: "Number constants declarations must use 'const'.", + noMagic: 'No magic number: {{raw}}.', + }, + }, + defaultOptions: [ + { + ignore: [], + ignoreArrayIndexes: false, + enforceConst: false, + detectObjects: false, + ignoreNumericLiteralTypes: false, + ignoreEnums: false, + ignoreReadonlyClassProperties: false, + }, + ], + create(context, [options]) { + const rules = no_magic_numbers_1.default.create(context); + return { + Literal(node) { + var _a; + // Check if the node is a TypeScript enum declaration + if (options.ignoreEnums && isParentTSEnumDeclaration(node)) { + return; + } + // Check TypeScript specific nodes for Numeric Literal + if (options.ignoreNumericLiteralTypes && + typeof node.value === 'number' && + isTSNumericLiteralType(node)) { + return; + } + // Check if the node is a readonly class property + if (typeof node.value === 'number' && + isParentTSReadonlyClassProperty(node)) { + if (options.ignoreReadonlyClassProperties) { + return; + } + let fullNumberNode = node; + let raw = node.raw; + if (((_a = node.parent) === null || _a === void 0 ? void 0 : _a.type) === experimental_utils_1.AST_NODE_TYPES.UnaryExpression && + // the base rule only shows the operator for negative numbers + // https://github.com/eslint/eslint/blob/9dfc8501fb1956c90dc11e6377b4cb38a6bea65d/lib/rules/no-magic-numbers.js#L126 + node.parent.operator === '-') { + fullNumberNode = node.parent; + raw = `${node.parent.operator}${node.raw}`; + } + context.report({ + messageId: 'noMagic', + node: fullNumberNode, + data: { raw }, + }); + return; + } + // Let the base rule deal with the rest + rules.Literal(node); + }, + }; + }, +}); +/** + * Gets the true parent of the literal, handling prefixed numbers (-1 / +1) + */ +function getLiteralParent(node) { + var _a; + if (((_a = node.parent) === null || _a === void 0 ? void 0 : _a.type) === experimental_utils_1.AST_NODE_TYPES.UnaryExpression && + ['-', '+'].includes(node.parent.operator)) { + return node.parent.parent; + } + return node.parent; +} +/** + * Checks if the node grandparent is a Typescript type alias declaration + * @param node the node to be validated. + * @returns true if the node grandparent is a Typescript type alias declaration + * @private + */ +function isGrandparentTSTypeAliasDeclaration(node) { + var _a, _b; + return ((_b = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.type) === experimental_utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration; +} +/** + * Checks if the node grandparent is a Typescript union type and its parent is a type alias declaration + * @param node the node to be validated. + * @returns true if the node grandparent is a Typescript union type and its parent is a type alias declaration + * @private + */ +function isGrandparentTSUnionType(node) { + var _a, _b; + if (((_b = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.type) === experimental_utils_1.AST_NODE_TYPES.TSUnionType) { + return isGrandparentTSTypeAliasDeclaration(node.parent); + } + return false; +} +/** + * Checks if the node parent is a Typescript enum member + * @param node the node to be validated. + * @returns true if the node parent is a Typescript enum member + * @private + */ +function isParentTSEnumDeclaration(node) { + const parent = getLiteralParent(node); + return (parent === null || parent === void 0 ? void 0 : parent.type) === experimental_utils_1.AST_NODE_TYPES.TSEnumMember; +} +/** + * Checks if the node parent is a Typescript literal type + * @param node the node to be validated. + * @returns true if the node parent is a Typescript literal type + * @private + */ +function isParentTSLiteralType(node) { + var _a; + return ((_a = node.parent) === null || _a === void 0 ? void 0 : _a.type) === experimental_utils_1.AST_NODE_TYPES.TSLiteralType; +} +/** + * Checks if the node is a valid TypeScript numeric literal type. + * @param node the node to be validated. + * @returns true if the node is a TypeScript numeric literal type. + * @private + */ +function isTSNumericLiteralType(node) { + var _a; + // For negative numbers, use the parent node + if (((_a = node.parent) === null || _a === void 0 ? void 0 : _a.type) === experimental_utils_1.AST_NODE_TYPES.UnaryExpression && + node.parent.operator === '-') { + node = node.parent; + } + // If the parent node is not a TSLiteralType, early return + if (!isParentTSLiteralType(node)) { + return false; + } + // If the grandparent is a TSTypeAliasDeclaration, ignore + if (isGrandparentTSTypeAliasDeclaration(node)) { + return true; + } + // If the grandparent is a TSUnionType and it's parent is a TSTypeAliasDeclaration, ignore + if (isGrandparentTSUnionType(node)) { + return true; + } + return false; +} +/** + * Checks if the node parent is a readonly class property + * @param node the node to be validated. + * @returns true if the node parent is a readonly class property + * @private + */ +function isParentTSReadonlyClassProperty(node) { + const parent = getLiteralParent(node); + if ((parent === null || parent === void 0 ? void 0 : parent.type) === experimental_utils_1.AST_NODE_TYPES.ClassProperty && parent.readonly) { + return true; + } + return false; +} +//# sourceMappingURL=no-magic-numbers.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.js.map new file mode 100644 index 000000000..98542b9b7 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-magic-numbers.js","sourceRoot":"","sources":["../../src/rules/no-magic-numbers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,yFAAyD;AACzD,8CAAgC;AAKhC,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,0BAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;IACxD,CAAC,CAAC,0BAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACzB,CAAC,CAAC,0BAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;AAEzB,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,wBAAwB;YACr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AAa,IAAI,MAAM,CAAC,QAAQ,EAAE;QACpE,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.js new file mode 100644 index 000000000..3a310defb --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.js @@ -0,0 +1,103 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-misused-new', + meta: { + type: 'problem', + docs: { + description: 'Enforce valid definition of `new` and `constructor`', + category: 'Best Practices', + recommended: 'error', + }, + schema: [], + messages: { + errorMessageInterface: 'Interfaces cannot be constructed, only classes.', + errorMessageClass: 'Class cannot have method named `new`.', + }, + }, + defaultOptions: [], + create(context) { + /** + * @param node type to be inspected. + * @returns name of simple type or null + */ + function getTypeReferenceName(node) { + if (node) { + switch (node.type) { + case experimental_utils_1.AST_NODE_TYPES.TSTypeAnnotation: + return getTypeReferenceName(node.typeAnnotation); + case experimental_utils_1.AST_NODE_TYPES.TSTypeReference: + return getTypeReferenceName(node.typeName); + case experimental_utils_1.AST_NODE_TYPES.Identifier: + return node.name; + default: + break; + } + } + return null; + } + /** + * @param parent parent node. + * @param returnType type to be compared + */ + function isMatchingParentType(parent, returnType) { + if (parent && + 'id' in parent && + parent.id && + parent.id.type === experimental_utils_1.AST_NODE_TYPES.Identifier) { + return getTypeReferenceName(returnType) === parent.id.name; + } + return false; + } + return { + 'TSInterfaceBody > TSConstructSignatureDeclaration'(node) { + if (isMatchingParentType(node.parent.parent, node.returnType)) { + // constructor + context.report({ + node, + messageId: 'errorMessageInterface', + }); + } + }, + "TSMethodSignature[key.name='constructor']"(node) { + context.report({ + node, + messageId: 'errorMessageInterface', + }); + }, + "ClassBody > MethodDefinition[key.name='new']"(node) { + if (node.value.type === experimental_utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression) { + if (node.parent && + isMatchingParentType(node.parent.parent, node.value.returnType)) { + context.report({ + node, + messageId: 'errorMessageClass', + }); + } + } + }, + }; + }, +}); +//# sourceMappingURL=no-misused-new.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.js.map new file mode 100644 index 000000000..36e0d3469 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-misused-new.js","sourceRoot":"","sources":["../../src/rules/no-misused-new.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,8CAAgC;AAEhC,kBAAe,IAAI,CAAC,UAAU,CAAC;IAC7B,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,qDAAqD;YAClE,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,OAAO;SACrB;QACD,MAAM,EAAE,EAAE;QACV,QAAQ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AC;YACL,CAAC;YACD,8CAA8C,CAC5C,IAA+B;gBAE/B,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,mCAAc,CAAC,6BAA6B,EAAE;oBACpE,IACE,IAAI,CAAC,MAAM;wBACX,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,EAC/D;wBACA,OAAO,CAAC,MAAM,CAAC;4BACb,IAAI;4BACJ,SAAS,EAAE,mBAAmB;yBAC/B,CAAC,CAAC;qBACJ;iBACF;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js new file mode 100644 index 000000000..5c5b72fc3 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js @@ -0,0 +1,219 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const tsutils = __importStar(require("tsutils")); +const ts = __importStar(require("typescript")); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-misused-promises', + meta: { + docs: { + description: 'Avoid using promises in places not designed to handle them', + category: 'Best Practices', + recommended: 'error', + requiresTypeChecking: true, + }, + messages: { + voidReturn: 'Promise returned in function argument where a void return was expected.', + conditional: 'Expected non-Promise value in a boolean conditional.', + }, + schema: [ + { + type: 'object', + properties: { + checksConditionals: { + type: 'boolean', + }, + checksVoidReturn: { + type: 'boolean', + }, + }, + }, + ], + type: 'problem', + }, + defaultOptions: [ + { + checksConditionals: true, + checksVoidReturn: true, + }, + ], + create(context, [{ checksConditionals, checksVoidReturn }]) { + const parserServices = util.getParserServices(context); + const checker = parserServices.program.getTypeChecker(); + const conditionalChecks = { + ConditionalExpression: checkTestConditional, + DoWhileStatement: checkTestConditional, + ForStatement: checkTestConditional, + IfStatement: checkTestConditional, + LogicalExpression(node) { + // We only check the lhs of a logical expression because the rhs might + // be the return value of a short circuit expression. + checkConditional(node.left); + }, + UnaryExpression(node) { + if (node.operator === '!') { + checkConditional(node.argument); + } + }, + WhileStatement: checkTestConditional, + }; + const voidReturnChecks = { + CallExpression: checkArguments, + NewExpression: checkArguments, + }; + function checkTestConditional(node) { + if (node.test) { + checkConditional(node.test); + } + } + function checkConditional(node) { + const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node); + if (isAlwaysThenable(checker, tsNode)) { + context.report({ + messageId: 'conditional', + node, + }); + } + } + function checkArguments(node) { + const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node); + const voidParams = voidFunctionParams(checker, tsNode); + if (voidParams.size === 0) { + return; + } + for (const [index, argument] of node.arguments.entries()) { + if (!voidParams.has(index)) { + continue; + } + const tsNode = parserServices.esTreeNodeToTSNodeMap.get(argument); + if (returnsThenable(checker, tsNode)) { + context.report({ + messageId: 'voidReturn', + node: argument, + }); + } + } + } + return Object.assign(Object.assign({}, (checksConditionals ? conditionalChecks : {})), (checksVoidReturn ? voidReturnChecks : {})); + }, +}); +// Variation on the thenable check which requires all forms of the type (read: +// alternates in a union) to be thenable. Otherwise, you might be trying to +// check if something is defined or undefined and get caught because one of the +// branches is thenable. +function isAlwaysThenable(checker, node) { + const type = checker.getTypeAtLocation(node); + for (const subType of tsutils.unionTypeParts(checker.getApparentType(type))) { + const thenProp = subType.getProperty('then'); + // If one of the alternates has no then property, it is not thenable in all + // cases. + if (thenProp === undefined) { + return false; + } + // We walk through each variation of the then property. Since we know it + // exists at this point, we just need at least one of the alternates to + // be of the right form to consider it thenable. + const thenType = checker.getTypeOfSymbolAtLocation(thenProp, node); + let hasThenableSignature = false; + for (const subType of tsutils.unionTypeParts(thenType)) { + for (const signature of subType.getCallSignatures()) { + if (signature.parameters.length !== 0 && + isFunctionParam(checker, signature.parameters[0], node)) { + hasThenableSignature = true; + break; + } + } + // We only need to find one variant of the then property that has a + // function signature for it to be thenable. + if (hasThenableSignature) { + break; + } + } + // If no flavors of the then property are thenable, we don't consider the + // overall type to be thenable + if (!hasThenableSignature) { + return false; + } + } + // If all variants are considered thenable (i.e. haven't returned false), we + // consider the overall type thenable + return true; +} +function isFunctionParam(checker, param, node) { + const type = checker.getApparentType(checker.getTypeOfSymbolAtLocation(param, node)); + for (const subType of tsutils.unionTypeParts(type)) { + if (subType.getCallSignatures().length !== 0) { + return true; + } + } + return false; +} +// Get the positions of parameters which are void functions (and not also +// thenable functions). These are the candidates for the void-return check at +// the current call site. +function voidFunctionParams(checker, node) { + const voidReturnIndices = new Set(); + const thenableReturnIndices = new Set(); + const type = checker.getTypeAtLocation(node.expression); + for (const subType of tsutils.unionTypeParts(type)) { + // Standard function calls and `new` have two different types of signatures + const signatures = ts.isCallExpression(node) + ? subType.getCallSignatures() + : subType.getConstructSignatures(); + for (const signature of signatures) { + for (const [index, parameter] of signature.parameters.entries()) { + const type = checker.getTypeOfSymbolAtLocation(parameter, node.expression); + for (const subType of tsutils.unionTypeParts(type)) { + for (const signature of subType.getCallSignatures()) { + const returnType = signature.getReturnType(); + if (tsutils.isTypeFlagSet(returnType, ts.TypeFlags.Void)) { + voidReturnIndices.add(index); + } + else if (tsutils.isThenableType(checker, node.expression, returnType)) { + thenableReturnIndices.add(index); + } + } + } + } + } + } + // If a certain positional argument accepts both thenable and void returns, + // a promise-returning function is valid + for (const thenable of thenableReturnIndices) { + voidReturnIndices.delete(thenable); + } + return voidReturnIndices; +} +// Returns true if the expression is a function that returns a thenable +function returnsThenable(checker, node) { + const type = checker.getApparentType(checker.getTypeAtLocation(node)); + for (const subType of tsutils.unionTypeParts(type)) { + for (const signature of subType.getCallSignatures()) { + const returnType = signature.getReturnType(); + if (tsutils.isThenableType(checker, node, returnType)) { + return true; + } + } + } + return false; +} +//# sourceMappingURL=no-misused-promises.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js.map new file mode 100644 index 000000000..ae2463602 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-misused-promises.js","sourceRoot":"","sources":["../../src/rules/no-misused-promises.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,iDAAmC;AACnC,+CAAiC;AAEjC,8CAAgC;AAShC,kBAAe,IAAI,CAAC,UAAU,CAAwC;IACpE,IAAI,EAAE,qBAAqB;IAC3B,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,WAAW,EAAE,4DAA4D;YACzE,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,OAAO;YACpB,oBAAoB,EAAE,IAAI;SAC3B;QACD,QAAQ,EAAE;YACR,UAAU,EACR,yEAAyE;YAC3E,WAAW,EAAE,sDAAsD;SACpE;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,kBAAkB,EAAE;wBAClB,IAAI,EAAE,SAAS;qBAChB;oBACD,gBAAgB,EAAE;wBAChB,IAAI,EAAE,SAAS;qBAChB;iBACF;aACF;SACF;QACD,IAAI,EAAE,SAAS;KAChB;IACD,cAAc,EAAE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ACF;aACF;SACF;KACF;IAED,2EAA2E;IAC3E,wCAAwC;IACxC,KAAK,MAAM,QAAQ,IAAI,qBAAqB,EAAE;QAC5C,iBAAiB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;KACpC;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED,uEAAuE;AACvE,SAAS,eAAe,CACtB,OAAuB,EACvB,IAAmB;IAEnB,MAAM,IAAI,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;IAEtE,KAAK,MAAM,OAAO,IAAI,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE;QAClD,KAAK,MAAM,SAAS,IAAI,OAAO,CAAC,iBAAiB,EAAE,EAAE;YACnD,MAAM,UAAU,GAAG,SAAS,CAAC,aAAa,EAAE,CAAC;YAC7C,IAAI,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,EAAE;gBACrD,OAAO,IAAI,CAAC;aACb;SACF;KACF;IAED,OAAO,KAAK,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js new file mode 100644 index 000000000..cfd3d374b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js @@ -0,0 +1,81 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-namespace', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow the use of custom TypeScript modules and namespaces', + category: 'Best Practices', + recommended: 'error', + }, + messages: { + moduleSyntaxIsPreferred: 'ES2015 module syntax is preferred over custom TypeScript modules and namespaces.', + }, + schema: [ + { + type: 'object', + properties: { + allowDeclarations: { + type: 'boolean', + }, + allowDefinitionFiles: { + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], + }, + defaultOptions: [ + { + allowDeclarations: false, + allowDefinitionFiles: true, + }, + ], + create(context, [{ allowDeclarations, allowDefinitionFiles }]) { + const filename = context.getFilename(); + function isDeclaration(node) { + var _a; + return (node.declare === true || + (((_a = node.parent.parent) === null || _a === void 0 ? void 0 : _a.type) === experimental_utils_1.AST_NODE_TYPES.TSModuleDeclaration && + isDeclaration(node.parent.parent))); + } + return { + "TSModuleDeclaration[global!=true][id.type='Identifier']"(node) { + if ((node.parent && + node.parent.type === experimental_utils_1.AST_NODE_TYPES.TSModuleDeclaration) || + (allowDefinitionFiles && util.isDefinitionFile(filename)) || + (allowDeclarations && isDeclaration(node))) { + return; + } + context.report({ + node, + messageId: 'moduleSyntaxIsPreferred', + }); + }, + }; + }, +}); +//# sourceMappingURL=no-namespace.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js.map new file mode 100644 index 000000000..db4bd761b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-namespace.js","sourceRoot":"","sources":["../../src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CAAC,QAAQ,CAAC,CAAC;oBACzD,CAAC,iBAAiB,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,EAC1C;oBACA,OAAO;iBACR;gBAED,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI;oBACJ,SAAS,EAAE,yBAAyB;iBACrC,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.js new file mode 100644 index 000000000..e86f3ce76 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.js @@ -0,0 +1,146 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const ts = __importStar(require("typescript")); +const semver = __importStar(require("semver")); +const util = __importStar(require("../util")); +const is3dot9 = semver.satisfies(ts.version, `>= 3.9.0 || >= 3.9.1-rc || >= 3.9.0-beta`, { + includePrerelease: true, +}); +exports.default = util.createRule({ + name: 'no-non-null-asserted-optional-chain', + meta: { + type: 'problem', + docs: { + description: 'Disallows using a non-null assertion after an optional chain expression', + category: 'Possible Errors', + recommended: 'error', + suggestion: true, + }, + messages: { + noNonNullOptionalChain: 'Optional chain expressions can return undefined by design - using a non-null assertion is unsafe and wrong.', + suggestRemovingNonNull: 'You should remove the non-null assertion.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + // TS3.9 made a breaking change to how non-null works with optional chains. + // Pre-3.9, `x?.y!.z` means `(x?.y).z` - i.e. it essentially scrubbed the optionality from the chain + // Post-3.9, `x?.y!.z` means `x?.y!.z` - i.e. it just asserts that the property `y` is non-null, not the result of `x?.y`. + // This means that for > 3.9, x?.y!.z is valid! + // + // NOTE: these cases are still invalid for 3.9: + // - x?.y.z! + // - (x?.y)!.z + const baseSelectors = { + // non-nulling a wrapped chain will scrub all nulls introduced by the chain + // (x?.y)! + // (x?.())! + 'TSNonNullExpression > ChainExpression'(node) { + // selector guarantees this assertion + const parent = node.parent; + context.report({ + node, + messageId: 'noNonNullOptionalChain', + // use a suggestion instead of a fixer, because this can obviously break type checks + suggest: [ + { + messageId: 'suggestRemovingNonNull', + fix(fixer) { + return fixer.removeRange([ + parent.range[1] - 1, + parent.range[1], + ]); + }, + }, + ], + }); + }, + // non-nulling at the end of a chain will scrub all nulls introduced by the chain + // x?.y! + // x?.()! + 'ChainExpression > TSNonNullExpression'(node) { + context.report({ + node, + messageId: 'noNonNullOptionalChain', + // use a suggestion instead of a fixer, because this can obviously break type checks + suggest: [ + { + messageId: 'suggestRemovingNonNull', + fix(fixer) { + return fixer.removeRange([node.range[1] - 1, node.range[1]]); + }, + }, + ], + }); + }, + }; + if (is3dot9) { + return baseSelectors; + } + return Object.assign(Object.assign({}, baseSelectors), { [[ + // > :not(ChainExpression) because that case is handled by a previous selector + 'MemberExpression > TSNonNullExpression.object > :not(ChainExpression)', + 'CallExpression > TSNonNullExpression.callee > :not(ChainExpression)', + ].join(', ')](child) { + // selector guarantees this assertion + const node = child.parent; + let current = child; + while (current) { + switch (current.type) { + case experimental_utils_1.AST_NODE_TYPES.MemberExpression: + if (current.optional) { + // found an optional chain! stop traversing + break; + } + current = current.object; + continue; + case experimental_utils_1.AST_NODE_TYPES.CallExpression: + if (current.optional) { + // found an optional chain! stop traversing + break; + } + current = current.callee; + continue; + default: + // something that's not a ChainElement, which means this is not an optional chain we want to check + return; + } + } + context.report({ + node, + messageId: 'noNonNullOptionalChain', + // use a suggestion instead of a fixer, because this can obviously break type checks + suggest: [ + { + messageId: 'suggestRemovingNonNull', + fix(fixer) { + return fixer.removeRange([node.range[1] - 1, node.range[1]]); + }, + }, + ], + }); + } }); + }, +}); +//# sourceMappingURL=no-non-null-asserted-optional-chain.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.js.map new file mode 100644 index 000000000..21f405604 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-non-null-asserted-optional-chain.js","sourceRoot":"","sources":["../../src/rules/no-non-null-asserted-optional-chain.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAI+C;AAC/C,+CAAiC;AACjC,+CAAiC;AACjC,8CAAgC;AAEhC,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAC9B,EAAE,CAAC,OAAO,EACV,0CAA0C,EAC1C;IACE,iBAAiB,EAAE,IAAI;CACxB,CACF,CAAC;AAEF,kBAAe,IAAI,CAAC,UAAU,CAAC;IAC7B,IAAI,EAAE,qCAAqC;IAC3C,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EACT,yEAAyE;YAC3E,QAAQ,EAAE,iBAAiB;YAC3B,WAAW,EAAE,OAAO;YACpB,UAAU,EAAE,IAAI;SACjB;QACD,QAAQ,EAAE;YACR,sBAAsB,EACpB,6GAA6G;YA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,CAAC;SACtB;QAED,uCACK,aAAa,KAChB,CAAC;gBACC,8EAA8E;gBAC9E,uEAAuE;gBACvE,qEAAqE;aACtE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAoB;gBAChC,qCAAqC;gBACrC,MAAM,IAAI,GAAG,KAAK,CAAC,MAAsC,CAAC;gBAE1D,IAAI,OAAO,GAAG,KAAK,CAAC;gBACpB,OAAO,OAAO,EAAE;oBACd,QAAQ,OAAO,CAAC,IAAI,EAAE;wBACpB,KAAK,mCAAc,CAAC,gBAAgB;4BAClC,IAAI,OAAO,CAAC,QAAQ,EAAE;gCACpB,2CAA2C;gCAC3C,MAAM;6BACP;4BAED,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;4BACzB,SAAS;wBAEX,KAAK,mCAAc,CAAC,cAAc;4BAChC,IAAI,OAAO,CAAC,QAAQ,EAAE;gCACpB,2CAA2C;gCAC3C,MAAM;6BACP;4BAED,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;4BACzB,SAAS;wBAEX;4BACE,kGAAkG;4BAClG,OAAO;qBACV;iBACF;gBAED,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI;oBACJ,SAAS,EAAE,wBAAwB;oBACnC,oFAAoF;oBACpF,OAAO,EAAE;wBACP;4BACE,SAAS,EAAE,wBAAwB;4BACnC,GAAG,CAAC,KAAK;gCACP,OAAO,KAAK,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;4BAC/D,CAAC;yBACF;qBACF;iBACF,CAAC,CAAC;YACL,CAAC,IACD;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js new file mode 100644 index 000000000..82ab1fdb4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js @@ -0,0 +1,126 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-non-null-assertion', + meta: { + type: 'problem', + docs: { + description: 'Disallows non-null assertions using the `!` postfix operator', + category: 'Stylistic Issues', + recommended: 'warn', + suggestion: true, + }, + messages: { + noNonNull: 'Forbidden non-null assertion.', + suggestOptionalChain: 'Consider using the optional chain operator `?.` instead. This operator includes runtime checks, so it is safer than the compile-only non-null assertion operator.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const sourceCode = context.getSourceCode(); + return { + TSNonNullExpression(node) { + var _a, _b; + const suggest = []; + function convertTokenToOptional(replacement) { + return (fixer) => { + const operator = sourceCode.getTokenAfter(node.expression, util.isNonNullAssertionPunctuator); + if (operator) { + return fixer.replaceText(operator, replacement); + } + return null; + }; + } + function removeToken() { + return (fixer) => { + const operator = sourceCode.getTokenAfter(node.expression, util.isNonNullAssertionPunctuator); + if (operator) { + return fixer.remove(operator); + } + return null; + }; + } + if (((_a = node.parent) === null || _a === void 0 ? void 0 : _a.type) === experimental_utils_1.AST_NODE_TYPES.MemberExpression && + node.parent.object === node) { + if (!node.parent.optional) { + if (node.parent.computed) { + // it is x![y]?.z + suggest.push({ + messageId: 'suggestOptionalChain', + fix: convertTokenToOptional('?.'), + }); + } + else { + // it is x!.y?.z + suggest.push({ + messageId: 'suggestOptionalChain', + fix: convertTokenToOptional('?'), + }); + } + } + else { + if (node.parent.computed) { + // it is x!?.[y].z + suggest.push({ + messageId: 'suggestOptionalChain', + fix: removeToken(), + }); + } + else { + // it is x!?.y.z + suggest.push({ + messageId: 'suggestOptionalChain', + fix: removeToken(), + }); + } + } + } + else if (((_b = node.parent) === null || _b === void 0 ? void 0 : _b.type) === experimental_utils_1.AST_NODE_TYPES.CallExpression && + node.parent.callee === node) { + if (!node.parent.optional) { + // it is x.y?.z!() + suggest.push({ + messageId: 'suggestOptionalChain', + fix: convertTokenToOptional('?.'), + }); + } + else { + // it is x.y.z!?.() + suggest.push({ + messageId: 'suggestOptionalChain', + fix: removeToken(), + }); + } + } + context.report({ + node, + messageId: 'noNonNull', + suggest, + }); + }, + }; + }, +}); +//# sourceMappingURL=no-non-null-assertion.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js.map new file mode 100644 index 000000000..4f1d31ddb --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-non-null-assertion.js","sourceRoot":"","sources":["../../src/rules/no-non-null-assertion.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,8CAAgC;AAIhC,kBAAe,IAAI,CAAC,UAAU,CAAiB;IAC7C,IAAI,EAAE,uBAAuB;IAC7B,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EACT,8DAA8D;YAChE,QAAQ,EAAE,kBAAkB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AAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-parameter-properties.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-parameter-properties.js new file mode 100644 index 000000000..7e7a10b6d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-parameter-properties.js @@ -0,0 +1,106 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-parameter-properties', + meta: { + type: 'problem', + docs: { + description: 'Disallow the use of parameter properties in class constructors', + category: 'Stylistic Issues', + // too opinionated to be recommended + recommended: false, + }, + messages: { + noParamProp: 'Property {{parameter}} cannot be declared in the constructor.', + }, + schema: [ + { + type: 'object', + properties: { + allows: { + type: 'array', + items: { + enum: [ + 'readonly', + 'private', + 'protected', + 'public', + 'private readonly', + 'protected readonly', + 'public readonly', + ], + }, + minItems: 1, + }, + }, + additionalProperties: false, + }, + ], + }, + defaultOptions: [ + { + allows: [], + }, + ], + create(context, [{ allows }]) { + /** + * Gets the modifiers of `node`. + * @param node the node to be inspected. + */ + function getModifiers(node) { + const modifiers = []; + if (node.accessibility) { + modifiers.push(node.accessibility); + } + if (node.readonly) { + modifiers.push('readonly'); + } + return modifiers.filter(Boolean).join(' '); + } + return { + TSParameterProperty(node) { + const modifiers = getModifiers(node); + if (!allows.includes(modifiers)) { + // HAS to be an identifier or assignment or TSC will throw + if (node.parameter.type !== experimental_utils_1.AST_NODE_TYPES.Identifier && + node.parameter.type !== experimental_utils_1.AST_NODE_TYPES.AssignmentPattern) { + return; + } + const name = node.parameter.type === experimental_utils_1.AST_NODE_TYPES.Identifier + ? node.parameter.name + : // has to be an Identifier or TSC will throw an error + node.parameter.left.name; + context.report({ + node, + messageId: 'noParamProp', + data: { + parameter: name, + }, + }); + } + }, + }; + }, +}); +//# sourceMappingURL=no-parameter-properties.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-parameter-properties.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-parameter-properties.js.map new file mode 100644 index 000000000..3a15f4c95 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-parameter-properties.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-parameter-properties.js","sourceRoot":"","sources":["../../src/rules/no-parameter-properties.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,8CAAgC;AAiBhC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,yBAAyB;IAC/B,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EACT,gEAAgE;YAClE,QAAQ,EAAE,kBAAkB;YAC5B,oCAAoC;YACpC,WAAW,EAAE,KAAK;SACnB;QACD,QAAQ,EAAE;YACR,WAAW,EACT,+DAA+D;SAClE;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,MAAM,EAAE;wBACN,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE;4BACL,IAAI,EAAE;g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CAAC,MAAM,CAAC;wBACb,IAAI;wBACJ,SAAS,EAAE,aAAa;wBACxB,IAAI,EAAE;4BACJ,SAAS,EAAE,IAAI;yBAChB;qBACF,CAAC,CAAC;iBACJ;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redeclare.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redeclare.js new file mode 100644 index 000000000..ccea8a953 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redeclare.js @@ -0,0 +1,224 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +// https://github.com/lodash/lodash/blob/86a852fe763935bb64c12589df5391fd7d3bb14d/escapeRegExp.js +const reRegExpChar = /[\\^$.*+?()[\]{}|]/g; +const reHasRegExpChar = RegExp(reRegExpChar.source); +function escapeRegExp(str) { + return str && reHasRegExpChar.test(str) + ? str.replace(reRegExpChar, '\\$&') + : str || ''; +} +function getNameLocationInGlobalDirectiveComment(sourceCode, comment, name) { + const namePattern = new RegExp(`[\\s,]${escapeRegExp(name)}(?:$|[\\s,:])`, 'gu'); + // To ignore the first text "global". + namePattern.lastIndex = comment.value.indexOf('global') + 6; + // Search a given variable name. + const match = namePattern.exec(comment.value); + // Convert the index to loc. + const start = sourceCode.getLocFromIndex(comment.range[0] + '/*'.length + (match ? match.index + 1 : 0)); + const end = { + line: start.line, + column: start.column + (match ? name.length : 1), + }; + return { start, end }; +} +exports.default = util.createRule({ + name: 'no-redeclare', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow variable redeclaration', + category: 'Best Practices', + recommended: false, + extendsBaseRule: true, + }, + schema: [ + { + type: 'object', + properties: { + builtinGlobals: { + type: 'boolean', + }, + ignoreDeclarationMerge: { + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], + messages: { + redeclared: "'{{id}}' is already defined.", + redeclaredAsBuiltin: "'{{id}}' is already defined as a built-in global variable.", + redeclaredBySyntax: "'{{id}}' is already defined by a variable declaration.", + }, + }, + defaultOptions: [ + { + builtinGlobals: true, + ignoreDeclarationMerge: true, + }, + ], + create(context, [options]) { + const sourceCode = context.getSourceCode(); + const CLASS_DECLARATION_MERGE_NODES = new Set([ + experimental_utils_1.AST_NODE_TYPES.TSInterfaceDeclaration, + experimental_utils_1.AST_NODE_TYPES.TSModuleDeclaration, + experimental_utils_1.AST_NODE_TYPES.ClassDeclaration, + ]); + const FUNCTION_DECLARATION_MERGE_NODES = new Set([ + experimental_utils_1.AST_NODE_TYPES.TSModuleDeclaration, + experimental_utils_1.AST_NODE_TYPES.FunctionDeclaration, + ]); + function* iterateDeclarations(variable) { + if ((options === null || options === void 0 ? void 0 : options.builtinGlobals) && + 'eslintImplicitGlobalSetting' in variable && + (variable.eslintImplicitGlobalSetting === 'readonly' || + variable.eslintImplicitGlobalSetting === 'writable')) { + yield { type: 'builtin' }; + } + if ('eslintExplicitGlobalComments' in variable && + variable.eslintExplicitGlobalComments) { + for (const comment of variable.eslintExplicitGlobalComments) { + yield { + type: 'comment', + node: comment, + loc: getNameLocationInGlobalDirectiveComment(sourceCode, comment, variable.name), + }; + } + } + const identifiers = variable.identifiers + .map(id => ({ + identifier: id, + parent: id.parent, + })) + // ignore function declarations because TS will treat them as an overload + .filter(({ parent }) => parent.type !== experimental_utils_1.AST_NODE_TYPES.TSDeclareFunction); + if (options.ignoreDeclarationMerge && identifiers.length > 1) { + if ( + // interfaces merging + identifiers.every(({ parent }) => parent.type === experimental_utils_1.AST_NODE_TYPES.TSInterfaceDeclaration)) { + return; + } + if ( + // namespace/module merging + identifiers.every(({ parent }) => parent.type === experimental_utils_1.AST_NODE_TYPES.TSModuleDeclaration)) { + return; + } + if ( + // class + interface/namespace merging + identifiers.every(({ parent }) => CLASS_DECLARATION_MERGE_NODES.has(parent.type))) { + const classDecls = identifiers.filter(({ parent }) => parent.type === experimental_utils_1.AST_NODE_TYPES.ClassDeclaration); + if (classDecls.length === 1) { + // safe declaration merging + return; + } + // there's more than one class declaration, which needs to be reported + for (const { identifier } of classDecls) { + yield { type: 'syntax', node: identifier, loc: identifier.loc }; + } + return; + } + if ( + // class + interface/namespace merging + identifiers.every(({ parent }) => FUNCTION_DECLARATION_MERGE_NODES.has(parent.type))) { + const functionDecls = identifiers.filter(({ parent }) => parent.type === experimental_utils_1.AST_NODE_TYPES.FunctionDeclaration); + if (functionDecls.length === 1) { + // safe declaration merging + return; + } + // there's more than one class declaration, which needs to be reported + for (const { identifier } of functionDecls) { + yield { type: 'syntax', node: identifier, loc: identifier.loc }; + } + return; + } + } + for (const { identifier } of identifiers) { + yield { type: 'syntax', node: identifier, loc: identifier.loc }; + } + } + function findVariablesInScope(scope) { + for (const variable of scope.variables) { + const [declaration, ...extraDeclarations] = iterateDeclarations(variable); + if (extraDeclarations.length === 0) { + continue; + } + /* + * If the type of a declaration is different from the type of + * the first declaration, it shows the location of the first + * declaration. + */ + const detailMessageId = declaration.type === 'builtin' + ? 'redeclaredAsBuiltin' + : 'redeclaredBySyntax'; + const data = { id: variable.name }; + // Report extra declarations. + for (const { type, node, loc } of extraDeclarations) { + const messageId = type === declaration.type ? 'redeclared' : detailMessageId; + if (node) { + context.report({ node, loc, messageId, data }); + } + else if (loc) { + context.report({ loc, messageId, data }); + } + } + } + } + /** + * Find variables in the current scope. + */ + function checkForBlock(node) { + const scope = context.getScope(); + /* + * In ES5, some node type such as `BlockStatement` doesn't have that scope. + * `scope.block` is a different node in such a case. + */ + if (scope.block === node) { + findVariablesInScope(scope); + } + } + return { + Program() { + const scope = context.getScope(); + findVariablesInScope(scope); + // Node.js or ES modules has a special scope. + if (scope.type === 'global' && + scope.childScopes[0] && + // The special scope's block is the Program node. + scope.block === scope.childScopes[0].block) { + findVariablesInScope(scope.childScopes[0]); + } + }, + FunctionDeclaration: checkForBlock, + FunctionExpression: checkForBlock, + ArrowFunctionExpression: checkForBlock, + BlockStatement: checkForBlock, + ForStatement: checkForBlock, + ForInStatement: checkForBlock, + ForOfStatement: checkForBlock, + SwitchStatement: checkForBlock, + }; + }, +}); +//# sourceMappingURL=no-redeclare.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redeclare.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redeclare.js.map new file mode 100644 index 000000000..38aac7aa9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redeclare.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-redeclare.js","sourceRoot":"","sources":["../../src/rules/no-redeclare.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAI+C;AAC/C,8CAAgC;AAUhC,iGAAiG;AACjG,MAAM,YAAY,GAAG,qBAAqB,CAAC;AAC3C,MAAM,eAAe,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;AACpD,SAAS,YAAY,CAAC,GAAW;IAC/B,OAAO,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC;QACrC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC;QACnC,CAAC,CAAC,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B,EAAE,aAAa;YAClC,kBAAkB,EAAE,aAAa;YACjC,uBAAuB,EAAE,aAAa;YAEtC,cAAc,EAAE,aAAa;YAC7B,YAAY,EAAE,aAAa;YAC3B,cAAc,EAAE,aAAa;YAC7B,cAAc,EAAE,aAAa;YAC7B,eAAe,EAAE,aAAa;SAC/B,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-require-imports.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-require-imports.js new file mode 100644 index 000000000..3bf5f6b1e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-require-imports.js @@ -0,0 +1,55 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-require-imports', + meta: { + type: 'problem', + docs: { + description: 'Disallows invocation of `require()`', + category: 'Best Practices', + recommended: false, + }, + schema: [], + messages: { + noRequireImports: 'A `require()` style import is forbidden.', + }, + }, + defaultOptions: [], + create(context) { + return { + 'CallExpression > Identifier[name="require"]'(node) { + context.report({ + node: node.parent, + messageId: 'noRequireImports', + }); + }, + TSExternalModuleReference(node) { + context.report({ + node, + messageId: 'noRequireImports', + }); + }, + }; + }, +}); +//# sourceMappingURL=no-require-imports.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-require-imports.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-require-imports.js.map new file mode 100644 index 000000000..48ae71e93 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-require-imports.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-require-imports.js","sourceRoot":"","sources":["../../src/rules/no-require-imports.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,8CAAgC;AAEhC,kBAAe,IAAI,CAAC,UAAU,CAAC;IAC7B,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,qCAAqC;YAClD,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,KAAK;SACnB;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,gBAAgB,EAAE,0CAA0C;SAC7D;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,6CAA6C,CAC3C,IAAyB;gBAEzB,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI,EAAE,IAAI,CAAC,MAAO;oBAClB,SAAS,EAAE,kBAAkB;iBAC9B,CAAC,CAAC;YACL,CAAC;YACD,yBAAyB,CAAC,IAAI;gBAC5B,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI;oBACJ,SAAS,EAAE,kBAAkB;iBAC9B,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js new file mode 100644 index 000000000..e70d5c17e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js @@ -0,0 +1,278 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-shadow', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow variable declarations from shadowing variables declared in the outer scope', + category: 'Variables', + recommended: false, + extendsBaseRule: true, + }, + schema: [ + { + type: 'object', + properties: { + builtinGlobals: { + type: 'boolean', + }, + hoist: { + enum: ['all', 'functions', 'never'], + }, + allow: { + type: 'array', + items: { + type: 'string', + }, + }, + ignoreTypeValueShadow: { + type: 'boolean', + }, + ignoreFunctionTypeParameterNameValueShadow: { + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], + messages: { + noShadow: "'{{name}}' is already declared in the upper scope.", + }, + }, + defaultOptions: [ + { + allow: [], + builtinGlobals: false, + hoist: 'functions', + ignoreTypeValueShadow: true, + ignoreFunctionTypeParameterNameValueShadow: true, + }, + ], + create(context, [options]) { + /** + * Check if variable is a `this` parameter. + */ + function isThisParam(variable) { + return variable.defs[0].type === 'Parameter' && variable.name === 'this'; + } + function isTypeValueShadow(variable, shadowed) { + if (options.ignoreTypeValueShadow !== true) { + return false; + } + if (!('isValueVariable' in variable)) { + // this shouldn't happen... + return false; + } + const isShadowedValue = 'isValueVariable' in shadowed ? shadowed.isValueVariable : true; + return variable.isValueVariable !== isShadowedValue; + } + function isFunctionTypeParameterNameValueShadow(variable, shadowed) { + if (options.ignoreFunctionTypeParameterNameValueShadow !== true) { + return false; + } + if (!('isValueVariable' in variable)) { + // this shouldn't happen... + return false; + } + const isShadowedValue = 'isValueVariable' in shadowed ? shadowed.isValueVariable : true; + if (!isShadowedValue) { + return false; + } + const id = variable.identifiers[0]; + return util.isFunctionType(id.parent); + } + /** + * Check if variable name is allowed. + * @param variable The variable to check. + * @returns Whether or not the variable name is allowed. + */ + function isAllowed(variable) { + return options.allow.indexOf(variable.name) !== -1; + } + /** + * Checks if a variable of the class name in the class scope of ClassDeclaration. + * + * ClassDeclaration creates two variables of its name into its outer scope and its class scope. + * So we should ignore the variable in the class scope. + * @param variable The variable to check. + * @returns Whether or not the variable of the class name in the class scope of ClassDeclaration. + */ + function isDuplicatedClassNameVariable(variable) { + const block = variable.scope.block; + return (block.type === experimental_utils_1.AST_NODE_TYPES.ClassDeclaration && + block.id === variable.identifiers[0]); + } + /** + * Checks if a variable of the class name in the class scope of TSEnumDeclaration. + * + * TSEnumDeclaration creates two variables of its name into its outer scope and its class scope. + * So we should ignore the variable in the class scope. + * @param variable The variable to check. + * @returns Whether or not the variable of the class name in the class scope of TSEnumDeclaration. + */ + function isDuplicatedEnumNameVariable(variable) { + const block = variable.scope.block; + return (block.type === experimental_utils_1.AST_NODE_TYPES.TSEnumDeclaration && + block.id === variable.identifiers[0]); + } + /** + * Checks if a variable is inside the initializer of scopeVar. + * + * To avoid reporting at declarations such as `var a = function a() {};`. + * But it should report `var a = function(a) {};` or `var a = function() { function a() {} };`. + * @param variable The variable to check. + * @param scopeVar The scope variable to look for. + * @returns Whether or not the variable is inside initializer of scopeVar. + */ + function isOnInitializer(variable, scopeVar) { + var _a; + const outerScope = scopeVar.scope; + const outerDef = scopeVar.defs[0]; + const outer = (_a = outerDef === null || outerDef === void 0 ? void 0 : outerDef.parent) === null || _a === void 0 ? void 0 : _a.range; + const innerScope = variable.scope; + const innerDef = variable.defs[0]; + const inner = innerDef === null || innerDef === void 0 ? void 0 : innerDef.name.range; + return !!(outer && + inner && + outer[0] < inner[0] && + inner[1] < outer[1] && + ((innerDef.type === 'FunctionName' && + innerDef.node.type === experimental_utils_1.AST_NODE_TYPES.FunctionExpression) || + innerDef.node.type === experimental_utils_1.AST_NODE_TYPES.ClassExpression) && + outerScope === innerScope.upper); + } + /** + * Get a range of a variable's identifier node. + * @param variable The variable to get. + * @returns The range of the variable's identifier node. + */ + function getNameRange(variable) { + const def = variable.defs[0]; + return def === null || def === void 0 ? void 0 : def.name.range; + } + /** + * Checks if a variable is in TDZ of scopeVar. + * @param variable The variable to check. + * @param scopeVar The variable of TDZ. + * @returns Whether or not the variable is in TDZ of scopeVar. + */ + function isInTdz(variable, scopeVar) { + const outerDef = scopeVar.defs[0]; + const inner = getNameRange(variable); + const outer = getNameRange(scopeVar); + return !!(inner && + outer && + inner[1] < outer[0] && + // Excepts FunctionDeclaration if is {"hoist":"function"}. + (options.hoist !== 'functions' || + !outerDef || + outerDef.node.type !== experimental_utils_1.AST_NODE_TYPES.FunctionDeclaration)); + } + /** + * Finds the variable by a given name in a given scope and its upper scopes. + * @param initScope A scope to start find. + * @param name A variable name to find. + * @returns A found variable or `null`. + */ + function getVariableByName(initScope, name) { + let scope = initScope; + while (scope) { + const variable = scope.set.get(name); + if (variable) { + return variable; + } + scope = scope.upper; + } + return null; + } + /** + * Checks the current context for shadowed variables. + * @param {Scope} scope Fixme + */ + function checkForShadows(scope) { + const variables = scope.variables; + for (const variable of variables) { + // ignore "arguments" + if (variable.identifiers.length === 0) { + continue; + } + // this params are pseudo-params that cannot be shadowed + if (isThisParam(variable)) { + continue; + } + // ignore variables of a class name in the class scope of ClassDeclaration + if (isDuplicatedClassNameVariable(variable)) { + continue; + } + // ignore variables of a class name in the class scope of ClassDeclaration + if (isDuplicatedEnumNameVariable(variable)) { + continue; + } + // ignore configured allowed names + if (isAllowed(variable)) { + continue; + } + // Gets shadowed variable. + const shadowed = getVariableByName(scope.upper, variable.name); + if (!shadowed) { + continue; + } + // ignore type value variable shadowing if configured + if (isTypeValueShadow(variable, shadowed)) { + continue; + } + // ignore function type parameter name shadowing if configured + if (isFunctionTypeParameterNameValueShadow(variable, shadowed)) { + continue; + } + const isESLintGlobal = 'writeable' in shadowed; + if ((shadowed.identifiers.length > 0 || + (options.builtinGlobals && isESLintGlobal)) && + !isOnInitializer(variable, shadowed) && + !(options.hoist !== 'all' && isInTdz(variable, shadowed))) { + context.report({ + node: variable.identifiers[0], + messageId: 'noShadow', + data: { + name: variable.name, + }, + }); + } + } + } + return { + 'Program:exit'() { + const globalScope = context.getScope(); + const stack = globalScope.childScopes.slice(); + while (stack.length) { + const scope = stack.pop(); + stack.push(...scope.childScopes); + checkForShadows(scope); + } + }, + }; + }, +}); +//# sourceMappingURL=no-shadow.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js.map new file mode 100644 index 000000000..188c17273 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-shadow.js","sourceRoot":"","sources":["../../src/rules/no-shadow.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAI+C;AAC/C,8CAAgC;AAahC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EACT,qFAAqF;YACvF,QAAQ,EAAE,WAAW;YACrB,WAAW,EAAE,KAAK;YAClB,eAAe,EAAE,IAAI;SACtB;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,cAAc,E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AK,CAAC,WAAW,CAAC,CAAC;oBACjC,eAAe,CAAC,KAAK,CAAC,CAAC;iBACxB;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js new file mode 100644 index 000000000..cd0ae568e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js @@ -0,0 +1,83 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-this-alias', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow aliasing `this`', + category: 'Best Practices', + recommended: 'error', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowDestructuring: { + type: 'boolean', + }, + allowedNames: { + type: 'array', + items: { + type: 'string', + }, + }, + }, + }, + ], + messages: { + thisAssignment: "Unexpected aliasing of 'this' to local variable.", + thisDestructure: "Unexpected aliasing of members of 'this' to local variables.", + }, + }, + defaultOptions: [ + { + allowDestructuring: true, + allowedNames: [], + }, + ], + create(context, [{ allowDestructuring, allowedNames }]) { + return { + "VariableDeclarator[init.type='ThisExpression']"(node) { + const { id } = node; + if (allowDestructuring && id.type !== experimental_utils_1.AST_NODE_TYPES.Identifier) { + return; + } + const hasAllowedName = id.type === experimental_utils_1.AST_NODE_TYPES.Identifier + ? allowedNames.includes(id.name) + : false; + if (!hasAllowedName) { + context.report({ + node: id, + messageId: id.type === experimental_utils_1.AST_NODE_TYPES.Identifier + ? 'thisAssignment' + : 'thisDestructure', + }); + } + }, + }; + }, +}); +//# sourceMappingURL=no-this-alias.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js.map new file mode 100644 index 000000000..99bf7d349 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-this-alias.js","sourceRoot":"","sources":["../../src/rules/no-this-alias.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,8CAAgC;AAUhC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,0BAA0B;YACvC,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,OAAO;SACrB;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,oBAAoB,EAAE,KAAK;gBAC3B,UAAU,EAAE;oBACV,kBAAkB,EAAE;wBAClB,IAAI,EAAE,SAAS;qBAChB;oBACD,YAAY,EAAE;wBACZ,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE;4BACL,IAAI,EAAE,QAAQ;yBACf;qBACF;iBACF;aACF;SACF;QACD,QAAQ,EAAE;YACR,cAAc,EAAE,kDAAkD;YAClE,eAAe,EACb,8DAA8D;SACjE;KACF;IACD,cAAc,EAAE;QACd;YACE,kBAAkB,EAAE,IAAI;YACxB,YAAY,EAAE,EAAE;SACjB;KACF;IACD,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE,kBAAkB,EAAE,YAAY,EAAE,CAAC;QACpD,OAAO;YACL,gDAAgD,CAC9C,IAAiC;gBAEjC,MAAM,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC;gBAEpB,IAAI,kBAAkB,IAAI,EAAE,CAAC,IAAI,KAAK,mCAAc,CAAC,UAAU,EAAE;oBAC/D,OAAO;iBACR;gBAED,MAAM,cAAc,GAClB,EAAE,CAAC,IAAI,KAAK,mCAAc,CAAC,UAAU;oBACnC,CAAC,CAAC,YAAa,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC;oBACjC,CAAC,CAAC,KAAK,CAAC;gBACZ,IAAI,CAAC,cAAc,EAAE;oBACnB,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI,EAAE,EAAE;wBACR,SAAS,EACP,EAAE,CAAC,IAAI,KAAK,mCAAc,CAAC,UAAU;4BACnC,CAAC,CAAC,gBAAgB;4BAClB,CAAC,CAAC,iBAAiB;qBACxB,CAAC,CAAC;iBACJ;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-throw-literal.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-throw-literal.js new file mode 100644 index 000000000..b11fa4b4d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-throw-literal.js @@ -0,0 +1,130 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const ts = __importStar(require("typescript")); +const util = __importStar(require("../util")); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +exports.default = util.createRule({ + name: 'no-throw-literal', + meta: { + type: 'problem', + docs: { + description: 'Disallow throwing literals as exceptions', + category: 'Best Practices', + recommended: false, + requiresTypeChecking: true, + }, + schema: [], + messages: { + object: 'Expected an error object to be thrown.', + undef: 'Do not throw undefined.', + }, + }, + defaultOptions: [], + create(context) { + const parserServices = util.getParserServices(context); + const program = parserServices.program; + const checker = program.getTypeChecker(); + function isErrorLike(type) { + var _a; + if (type.isIntersection()) { + return type.types.some(isErrorLike); + } + if (type.isUnion()) { + return type.types.every(isErrorLike); + } + const symbol = type.getSymbol(); + if (!symbol) { + return false; + } + if (symbol.getName() === 'Error') { + const declarations = (_a = symbol.getDeclarations()) !== null && _a !== void 0 ? _a : []; + for (const declaration of declarations) { + const sourceFile = declaration.getSourceFile(); + if (program.isSourceFileDefaultLibrary(sourceFile)) { + return true; + } + } + } + if (symbol.flags & (ts.SymbolFlags.Class | ts.SymbolFlags.Interface)) { + for (const baseType of checker.getBaseTypes(type)) { + if (isErrorLike(baseType)) { + return true; + } + } + } + return false; + } + function tryGetThrowArgumentType(node) { + switch (node.type) { + case experimental_utils_1.AST_NODE_TYPES.Identifier: + case experimental_utils_1.AST_NODE_TYPES.CallExpression: + case experimental_utils_1.AST_NODE_TYPES.NewExpression: + case experimental_utils_1.AST_NODE_TYPES.MemberExpression: + case experimental_utils_1.AST_NODE_TYPES.TSAsExpression: { + const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node); + return checker.getTypeAtLocation(tsNode); + } + case experimental_utils_1.AST_NODE_TYPES.AssignmentExpression: + return tryGetThrowArgumentType(node.right); + case experimental_utils_1.AST_NODE_TYPES.SequenceExpression: + return tryGetThrowArgumentType(node.expressions[node.expressions.length - 1]); + case experimental_utils_1.AST_NODE_TYPES.LogicalExpression: { + const left = tryGetThrowArgumentType(node.left); + return left !== null && left !== void 0 ? left : tryGetThrowArgumentType(node.right); + } + case experimental_utils_1.AST_NODE_TYPES.ConditionalExpression: { + const consequent = tryGetThrowArgumentType(node.consequent); + return consequent !== null && consequent !== void 0 ? consequent : tryGetThrowArgumentType(node.alternate); + } + default: + return null; + } + } + function checkThrowArgument(node) { + if (node.type === experimental_utils_1.AST_NODE_TYPES.AwaitExpression || + node.type === experimental_utils_1.AST_NODE_TYPES.YieldExpression) { + return; + } + const type = tryGetThrowArgumentType(node); + if (type) { + if (type.flags & ts.TypeFlags.Undefined) { + context.report({ node, messageId: 'undef' }); + return; + } + if (util.isTypeAnyType(type) || + util.isTypeUnknownType(type) || + isErrorLike(type)) { + return; + } + } + context.report({ node, messageId: 'object' }); + } + return { + ThrowStatement(node) { + if (node.argument) { + checkThrowArgument(node.argument); + } + }, + }; + }, +}); +//# sourceMappingURL=no-throw-literal.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-throw-literal.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-throw-literal.js.map new file mode 100644 index 000000000..86d94ff0a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-throw-literal.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-throw-literal.js","sourceRoot":"","sources":["../../src/rules/no-throw-literal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,8CAAgC;AAChC,8EAG+C;AAE/C,kBAAe,IAAI,CAAC,UAAU,CAAC;IAC7B,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE;QACJ,IAAI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AAC,CAAC;oBAC5D,OAAO,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,uBAAuB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;iBAC9D;gBAED;oBACE,OAAO,IAAI,CAAC;aACf;QACH,CAAC;QAED,SAAS,kBAAkB,CAAC,IAAmB;YAC7C,IACE,IAAI,CAAC,IAAI,KAAK,mCAAc,CAAC,eAAe;gBAC5C,IAAI,CAAC,IAAI,KAAK,mCAAc,CAAC,eAAe,EAC5C;gBACA,OAAO;aACR;YAED,MAAM,IAAI,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC;YAC3C,IAAI,IAAI,EAAE;gBACR,IAAI,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE;oBACvC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;oBAC7C,OAAO;iBACR;gBAED,IACE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;oBACxB,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC;oBAC5B,WAAW,CAAC,IAAI,CAAC,EACjB;oBACA,OAAO;iBACR;aACF;YAED,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC;QAChD,CAAC;QAED,OAAO;YACL,cAAc,CAAC,IAAI;gBACjB,IAAI,IAAI,CAAC,QAAQ,EAAE;oBACjB,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;iBACnC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js new file mode 100644 index 000000000..62b9398b4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js @@ -0,0 +1,252 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +const enumValues = [ + 'always', + 'never', + 'in-unions', + 'in-intersections', + 'in-unions-and-intersections', +]; +exports.default = util.createRule({ + name: 'no-type-alias', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow the use of type aliases', + category: 'Stylistic Issues', + // too opinionated to be recommended + recommended: false, + }, + messages: { + noTypeAlias: 'Type {{alias}} are not allowed.', + noCompositionAlias: '{{typeName}} in {{compositionType}} types are not allowed.', + }, + schema: [ + { + type: 'object', + properties: { + allowAliases: { + enum: enumValues, + }, + allowCallbacks: { + enum: ['always', 'never'], + }, + allowConditionalTypes: { + enum: ['always', 'never'], + }, + allowConstructors: { + enum: ['always', 'never'], + }, + allowLiterals: { + enum: enumValues, + }, + allowMappedTypes: { + enum: enumValues, + }, + allowTupleTypes: { + enum: enumValues, + }, + }, + additionalProperties: false, + }, + ], + }, + defaultOptions: [ + { + allowAliases: 'never', + allowCallbacks: 'never', + allowConditionalTypes: 'never', + allowConstructors: 'never', + allowLiterals: 'never', + allowMappedTypes: 'never', + allowTupleTypes: 'never', + }, + ], + create(context, [{ allowAliases, allowCallbacks, allowConditionalTypes, allowConstructors, allowLiterals, allowMappedTypes, allowTupleTypes, },]) { + const unions = ['always', 'in-unions', 'in-unions-and-intersections']; + const intersections = [ + 'always', + 'in-intersections', + 'in-unions-and-intersections', + ]; + const compositions = [ + 'in-unions', + 'in-intersections', + 'in-unions-and-intersections', + ]; + const aliasTypes = new Set([ + experimental_utils_1.AST_NODE_TYPES.TSArrayType, + experimental_utils_1.AST_NODE_TYPES.TSTypeReference, + experimental_utils_1.AST_NODE_TYPES.TSLiteralType, + experimental_utils_1.AST_NODE_TYPES.TSTypeQuery, + experimental_utils_1.AST_NODE_TYPES.TSIndexedAccessType, + ]); + /** + * Determines if the composition type is supported by the allowed flags. + * @param isTopLevel a flag indicating this is the top level node. + * @param compositionType the composition type (either TSUnionType or TSIntersectionType) + * @param allowed the currently allowed flags. + */ + function isSupportedComposition(isTopLevel, compositionType, allowed) { + return (!compositions.includes(allowed) || + (!isTopLevel && + ((compositionType === experimental_utils_1.AST_NODE_TYPES.TSUnionType && + unions.includes(allowed)) || + (compositionType === experimental_utils_1.AST_NODE_TYPES.TSIntersectionType && + intersections.includes(allowed))))); + } + /** + * Gets the message to be displayed based on the node type and whether the node is a top level declaration. + * @param node the location + * @param compositionType the type of composition this alias is part of (undefined if not + * part of a composition) + * @param isRoot a flag indicating we are dealing with the top level declaration. + * @param type the kind of type alias being validated. + */ + function reportError(node, compositionType, isRoot, type) { + if (isRoot) { + return context.report({ + node, + messageId: 'noTypeAlias', + data: { + alias: type.toLowerCase(), + }, + }); + } + return context.report({ + node, + messageId: 'noCompositionAlias', + data: { + compositionType: compositionType === experimental_utils_1.AST_NODE_TYPES.TSUnionType + ? 'union' + : 'intersection', + typeName: type, + }, + }); + } + const isValidTupleType = (type) => { + if (type.node.type === experimental_utils_1.AST_NODE_TYPES.TSTupleType) { + return true; + } + if (type.node.type === experimental_utils_1.AST_NODE_TYPES.TSTypeOperator) { + if (['keyof', 'readonly'].includes(type.node.operator) && + type.node.typeAnnotation && + type.node.typeAnnotation.type === experimental_utils_1.AST_NODE_TYPES.TSTupleType) { + return true; + } + } + return false; + }; + const checkAndReport = (optionValue, isTopLevel, type, label) => { + if (optionValue === 'never' || + !isSupportedComposition(isTopLevel, type.compositionType, optionValue)) { + reportError(type.node, type.compositionType, isTopLevel, label); + } + }; + /** + * Validates the node looking for aliases, callbacks and literals. + * @param type the type of composition this alias is part of (null if not + * part of a composition) + * @param isTopLevel a flag indicating this is the top level node. + */ + function validateTypeAliases(type, isTopLevel = false) { + if (type.node.type === experimental_utils_1.AST_NODE_TYPES.TSFunctionType) { + // callback + if (allowCallbacks === 'never') { + reportError(type.node, type.compositionType, isTopLevel, 'Callbacks'); + } + } + else if (type.node.type === experimental_utils_1.AST_NODE_TYPES.TSConditionalType) { + // conditional type + if (allowConditionalTypes === 'never') { + reportError(type.node, type.compositionType, isTopLevel, 'Conditional types'); + } + } + else if (type.node.type === experimental_utils_1.AST_NODE_TYPES.TSConstructorType) { + if (allowConstructors === 'never') { + reportError(type.node, type.compositionType, isTopLevel, 'Constructors'); + } + } + else if (type.node.type === experimental_utils_1.AST_NODE_TYPES.TSTypeLiteral) { + // literal object type + checkAndReport(allowLiterals, isTopLevel, type, 'Literals'); + } + else if (type.node.type === experimental_utils_1.AST_NODE_TYPES.TSMappedType) { + // mapped type + checkAndReport(allowMappedTypes, isTopLevel, type, 'Mapped types'); + } + else if (isValidTupleType(type)) { + // tuple types + checkAndReport(allowTupleTypes, isTopLevel, type, 'Tuple Types'); + } + else if ( + // eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum + type.node.type.endsWith('Keyword') || + aliasTypes.has(type.node.type) || + (type.node.type === experimental_utils_1.AST_NODE_TYPES.TSTypeOperator && + type.node.operator === 'readonly' && + type.node.typeAnnotation && + aliasTypes.has(type.node.typeAnnotation.type))) { + // alias / keyword + checkAndReport(allowAliases, isTopLevel, type, 'Aliases'); + } + else { + // unhandled type - shouldn't happen + reportError(type.node, type.compositionType, isTopLevel, 'Unhandled'); + } + } + /** + * Flatten the given type into an array of its dependencies + */ + function getTypes(node, compositionType = null) { + if (node.type === experimental_utils_1.AST_NODE_TYPES.TSUnionType || + node.type === experimental_utils_1.AST_NODE_TYPES.TSIntersectionType) { + return node.types.reduce((acc, type) => { + acc.push(...getTypes(type, node.type)); + return acc; + }, []); + } + if (node.type === experimental_utils_1.AST_NODE_TYPES.TSParenthesizedType) { + return getTypes(node.typeAnnotation, compositionType); + } + return [{ node, compositionType }]; + } + return { + TSTypeAliasDeclaration(node) { + const types = getTypes(node.typeAnnotation); + if (types.length === 1) { + // is a top level type annotation + validateTypeAliases(types[0], true); + } + else { + // is a composition type + types.forEach(type => { + validateTypeAliases(type); + }); + } + }, + }; + }, +}); +//# sourceMappingURL=no-type-alias.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js.map new file mode 100644 index 000000000..ad5550808 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-type-alias.js","sourceRoot":"","sources":["../../src/rules/no-type-alias.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,8CAAgC;AAQhC,MAAM,UAAU,GAAa;IAC3B,QAAQ;IACR,OAAO;IACP,WAAW;IACX,kBAAkB;IAClB,6BAA6B;CAC9B,CAAC;AAuBF,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,kCAAkC;YAC/C,QAAQ,EAAE,kBAAkB;YAC5B,oCAAoC;YACpC,WAAW,EAAE,KAAK;SACnB;QACD,QAAQ,EAAE;YACR,WAAW,EAAE,iCAAiC;YAC9C,kBAAkB,EAChB,4DAA4D;SAC/D;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE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AED;;WAEG;QACH,SAAS,QAAQ,CACf,IAAmB,EACnB,kBAA0C,IAAI;YAE9C,IACE,IAAI,CAAC,IAAI,KAAK,mCAAc,CAAC,WAAW;gBACxC,IAAI,CAAC,IAAI,KAAK,mCAAc,CAAC,kBAAkB,EAC/C;gBACA,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAkB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;oBACtD,GAAG,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;oBACvC,OAAO,GAAG,CAAC;gBACb,CAAC,EAAE,EAAE,CAAC,CAAC;aACR;YACD,IAAI,IAAI,CAAC,IAAI,KAAK,mCAAc,CAAC,mBAAmB,EAAE;gBACpD,OAAO,QAAQ,CAAC,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;aACvD;YACD,OAAO,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;QACrC,CAAC;QAED,OAAO;YACL,sBAAsB,CAAC,IAAI;gBACzB,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;gBAC5C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;oBACtB,iCAAiC;oBACjC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;iBACrC;qBAAM;oBACL,wBAAwB;oBACxB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;wBACnB,mBAAmB,CAAC,IAAI,CAAC,CAAC;oBAC5B,CAAC,CAAC,CAAC;iBACJ;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.js new file mode 100644 index 000000000..7da37adde --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.js @@ -0,0 +1,207 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const tsutils = __importStar(require("tsutils")); +const ts = __importStar(require("typescript")); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-unnecessary-boolean-literal-compare', + meta: { + docs: { + description: 'Flags unnecessary equality comparisons against boolean literals', + category: 'Stylistic Issues', + recommended: false, + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + direct: 'This expression unnecessarily compares a boolean value to a boolean instead of using it directly.', + negated: 'This expression unnecessarily compares a boolean value to a boolean instead of negating it.', + comparingNullableToTrueDirect: 'This expression unnecessarily compares a nullable boolean value to true instead of using it directly.', + comparingNullableToTrueNegated: 'This expression unnecessarily compares a nullable boolean value to true instead of negating it.', + comparingNullableToFalse: 'This expression unnecessarily compares a nullable boolean value to false instead of using the ?? operator to provide a default.', + }, + schema: [ + { + type: 'object', + properties: { + allowComparingNullableBooleansToTrue: { + type: 'boolean', + }, + allowComparingNullableBooleansToFalse: { + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], + type: 'suggestion', + }, + defaultOptions: [ + { + allowComparingNullableBooleansToTrue: true, + allowComparingNullableBooleansToFalse: true, + }, + ], + create(context, [options]) { + const parserServices = util.getParserServices(context); + const checker = parserServices.program.getTypeChecker(); + function getBooleanComparison(node) { + const comparison = deconstructComparison(node); + if (!comparison) { + return undefined; + } + const expressionType = checker.getTypeAtLocation(parserServices.esTreeNodeToTSNodeMap.get(comparison.expression)); + if (isBooleanType(expressionType)) { + return Object.assign(Object.assign({}, comparison), { expressionIsNullableBoolean: false }); + } + if (isNullableBoolean(expressionType)) { + return Object.assign(Object.assign({}, comparison), { expressionIsNullableBoolean: true }); + } + return undefined; + } + function isBooleanType(expressionType) { + return tsutils.isTypeFlagSet(expressionType, ts.TypeFlags.Boolean | ts.TypeFlags.BooleanLiteral); + } + /** + * checks if the expressionType is a union that + * 1) contains at least one nullish type (null or undefined) + * 2) contains at least once boolean type (true or false or boolean) + * 3) does not contain any types besides nullish and boolean types + */ + function isNullableBoolean(expressionType) { + if (!expressionType.isUnion()) { + return false; + } + const { types } = expressionType; + const nonNullishTypes = types.filter(type => !tsutils.isTypeFlagSet(type, ts.TypeFlags.Undefined | ts.TypeFlags.Null)); + const hasNonNullishType = nonNullishTypes.length > 0; + if (!hasNonNullishType) { + return false; + } + const hasNullableType = nonNullishTypes.length < types.length; + if (!hasNullableType) { + return false; + } + const allNonNullishTypesAreBoolean = nonNullishTypes.every(isBooleanType); + if (!allNonNullishTypesAreBoolean) { + return false; + } + return true; + } + function deconstructComparison(node) { + const comparisonType = util.getEqualsKind(node.operator); + if (!comparisonType) { + return undefined; + } + for (const [against, expression] of [ + [node.right, node.left], + [node.left, node.right], + ]) { + if (against.type !== experimental_utils_1.AST_NODE_TYPES.Literal || + typeof against.value !== 'boolean') { + continue; + } + const { value: literalBooleanInComparison } = against; + const negated = !comparisonType.isPositive; + return { + literalBooleanInComparison, + forTruthy: literalBooleanInComparison ? !negated : negated, + expression, + negated, + range: expression.range[0] < against.range[0] + ? [expression.range[1], against.range[1]] + : [against.range[1], expression.range[1]], + }; + } + return undefined; + } + function nodeIsUnaryNegation(node) { + return (node.type === experimental_utils_1.AST_NODE_TYPES.UnaryExpression && + node.prefix && + node.operator === '!'); + } + return { + BinaryExpression(node) { + const comparison = getBooleanComparison(node); + if (comparison === undefined) { + return; + } + if (comparison.expressionIsNullableBoolean) { + if (comparison.literalBooleanInComparison && + options.allowComparingNullableBooleansToTrue) { + return; + } + if (!comparison.literalBooleanInComparison && + options.allowComparingNullableBooleansToFalse) { + return; + } + } + context.report({ + fix: function* (fixer) { + yield fixer.removeRange(comparison.range); + // if the expression `exp` isn't nullable, or we're comparing to `true`, + // we can just replace the entire comparison with `exp` or `!exp` + if (!comparison.expressionIsNullableBoolean || + comparison.literalBooleanInComparison) { + if (!comparison.forTruthy) { + yield fixer.insertTextBefore(node, '!'); + } + return; + } + // if we're here, then the expression is a nullable boolean and we're + // comparing to a literal `false` + // if we're doing `== false` or `=== false`, then we need to negate the expression + if (!comparison.negated) { + const { parent } = node; + // if the parent is a negation, we can instead just get rid of the parent's negation. + // i.e. instead of resulting in `!(!(exp))`, we can just result in `exp` + if (parent != null && nodeIsUnaryNegation(parent)) { + // remove from the beginning of the parent to the beginning of this node + yield fixer.removeRange([parent.range[0], node.range[0]]); + // remove from the end of the node to the end of the parent + yield fixer.removeRange([node.range[1], parent.range[1]]); + } + else { + yield fixer.insertTextBefore(node, '!'); + } + } + // provide the default `true` + yield fixer.insertTextBefore(node, '('); + yield fixer.insertTextAfter(node, ' ?? true)'); + }, + messageId: comparison.expressionIsNullableBoolean + ? comparison.literalBooleanInComparison + ? comparison.negated + ? 'comparingNullableToTrueNegated' + : 'comparingNullableToTrueDirect' + : 'comparingNullableToFalse' + : comparison.negated + ? 'negated' + : 'direct', + node, + }); + }, + }; + }, +}); +//# sourceMappingURL=no-unnecessary-boolean-literal-compare.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.js.map new file mode 100644 index 000000000..be36dbf92 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unnecessary-boolean-literal-compare.js","sourceRoot":"","sources":["../../src/rules/no-unnecessary-boolean-literal-compare.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,iDAAmC;AACnC,+CAAiC;AACjC,8CAAgC;AA4BhC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,wCAAwC;IAC9C,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,WAAW,EACT,iEAAiE;YACnE,QAAQ,EAAE,kBAAkB;YAC5B,WAAW,EAAE,KAAK;YAClB,oBAAoB,EAAE,IAAI;SAC3B;QACD,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE;YACR,MAAM,EACJ,mGAAmG;YACrG,OAAO,EACL,6FAA6F;YAC/F,6BAA6B,EAC3B,uGAAuG;YACzG,8BAA8B,EAC5B,iGAAiG;YACnG,wBAAwB,EACtB,iIAAiI;SACpI;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,oCAAoC,EAAE;wBACpC,IAAI,EAAE,SAAS;qBAChB;oBACD,qCAAqC,EAAE;wBACrC,IAAI,EAAE,SAAS;qBAChB;iBACF;gBACD,oBAAoB,EAAE,KAAK;aAC5B;SACF;QACD,IAAI,EAAE,YAAY;KACnB;IACD,cAAc,EAAE;QACd;YACE,oCAAoC,EAAE,IAAI;YAC1C,qCAAqC,EAAE,IAAI;SAC5C;KACF;IACD,MAAM,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC;QACvB,MAAM,cAAc,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QACvD,MAAM,OAAO,GAAG,cAAc,CAAC,OA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B,qFAAqF;4BACrF,wEAAwE;4BACxE,IAAI,MAAM,IAAI,IAAI,IAAI,mBAAmB,CAAC,MAAM,CAAC,EAAE;gCACjD,wEAAwE;gCACxE,MAAM,KAAK,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gCAC1D,2DAA2D;gCAC3D,MAAM,KAAK,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;6BAC3D;iCAAM;gCACL,MAAM,KAAK,CAAC,gBAAgB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;6BACzC;yBACF;wBAED,6BAA6B;wBAC7B,MAAM,KAAK,CAAC,gBAAgB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;wBACxC,MAAM,KAAK,CAAC,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;oBACjD,CAAC;oBACD,SAAS,EAAE,UAAU,CAAC,2BAA2B;wBAC/C,CAAC,CAAC,UAAU,CAAC,0BAA0B;4BACrC,CAAC,CAAC,UAAU,CAAC,OAAO;gCAClB,CAAC,CAAC,gCAAgC;gCAClC,CAAC,CAAC,+BAA+B;4BACnC,CAAC,CAAC,0BAA0B;wBAC9B,CAAC,CAAC,UAAU,CAAC,OAAO;4BACpB,CAAC,CAAC,SAAS;4BACX,CAAC,CAAC,QAAQ;oBACZ,IAAI;iBACL,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js new file mode 100644 index 000000000..1ed42ea8c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js @@ -0,0 +1,469 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const ts = __importStar(require("typescript")); +const tsutils_1 = require("tsutils"); +const util_1 = require("../util"); +// Truthiness utilities +// #region +const isTruthyLiteral = (type) => tsutils_1.isBooleanLiteralType(type, true) || (tsutils_1.isLiteralType(type) && !!type.value); +const isPossiblyFalsy = (type) => tsutils_1.unionTypeParts(type) + // PossiblyFalsy flag includes literal values, so exclude ones that + // are definitely truthy + .filter(t => !isTruthyLiteral(t)) + .some(type => util_1.isTypeFlagSet(type, ts.TypeFlags.PossiblyFalsy)); +const isPossiblyTruthy = (type) => tsutils_1.unionTypeParts(type).some(type => !tsutils_1.isFalsyType(type)); +// Nullish utilities +const nullishFlag = ts.TypeFlags.Undefined | ts.TypeFlags.Null; +const isNullishType = (type) => util_1.isTypeFlagSet(type, nullishFlag); +const isPossiblyNullish = (type) => tsutils_1.unionTypeParts(type).some(isNullishType); +const isAlwaysNullish = (type) => tsutils_1.unionTypeParts(type).every(isNullishType); +// isLiteralType only covers numbers and strings, this is a more exhaustive check. +const isLiteral = (type) => tsutils_1.isBooleanLiteralType(type, true) || + tsutils_1.isBooleanLiteralType(type, false) || + type.flags === ts.TypeFlags.Undefined || + type.flags === ts.TypeFlags.Null || + type.flags === ts.TypeFlags.Void || + tsutils_1.isLiteralType(type); +exports.default = util_1.createRule({ + name: 'no-unnecessary-condition', + meta: { + type: 'suggestion', + docs: { + description: 'Prevents conditionals where the type is always truthy or always falsy', + category: 'Best Practices', + recommended: false, + requiresTypeChecking: true, + }, + schema: [ + { + type: 'object', + properties: { + allowConstantLoopConditions: { + type: 'boolean', + }, + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: { + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], + fixable: 'code', + messages: { + alwaysTruthy: 'Unnecessary conditional, value is always truthy.', + alwaysFalsy: 'Unnecessary conditional, value is always falsy.', + alwaysTruthyFunc: 'This callback should return a conditional, but return is always truthy.', + alwaysFalsyFunc: 'This callback should return a conditional, but return is always falsy.', + neverNullish: 'Unnecessary conditional, expected left-hand side of `??` operator to be possibly null or undefined.', + alwaysNullish: 'Unnecessary conditional, left-hand side of `??` operator is always `null` or `undefined`.', + literalBooleanExpression: 'Unnecessary conditional, both sides of the expression are literal values', + noOverlapBooleanExpression: 'Unnecessary conditional, the types have no overlap', + never: 'Unnecessary conditional, value is `never`', + neverOptionalChain: 'Unnecessary optional chain on a non-nullish value', + noStrictNullCheck: 'This rule requires the `strictNullChecks` compiler option to be turned on to function correctly.', + }, + }, + defaultOptions: [ + { + allowConstantLoopConditions: false, + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false, + }, + ], + create(context, [{ allowConstantLoopConditions, allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing, },]) { + const service = util_1.getParserServices(context); + const checker = service.program.getTypeChecker(); + const sourceCode = context.getSourceCode(); + const compilerOptions = service.program.getCompilerOptions(); + const isStrictNullChecks = tsutils_1.isStrictCompilerOptionEnabled(compilerOptions, 'strictNullChecks'); + if (!isStrictNullChecks && + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing !== true) { + context.report({ + loc: { + start: { line: 0, column: 0 }, + end: { line: 0, column: 0 }, + }, + messageId: 'noStrictNullCheck', + }); + } + function getNodeType(node) { + const tsNode = service.esTreeNodeToTSNodeMap.get(node); + return util_1.getConstrainedTypeAtLocation(checker, tsNode); + } + function nodeIsArrayType(node) { + const nodeType = getNodeType(node); + return checker.isArrayType(nodeType); + } + function nodeIsTupleType(node) { + const nodeType = getNodeType(node); + return checker.isTupleType(nodeType); + } + function isArrayIndexExpression(node) { + return ( + // Is an index signature + node.type === experimental_utils_1.AST_NODE_TYPES.MemberExpression && + node.computed && + // ...into an array type + (nodeIsArrayType(node.object) || + // ... or a tuple type + (nodeIsTupleType(node.object) && + // Exception: literal index into a tuple - will have a sound type + node.property.type !== experimental_utils_1.AST_NODE_TYPES.Literal))); + } + /** + * Checks if a conditional node is necessary: + * if the type of the node is always true or always false, it's not necessary. + */ + function checkNode(node, isUnaryNotArgument = false) { + // Check if the node is Unary Negation expression and handle it + if (node.type === experimental_utils_1.AST_NODE_TYPES.UnaryExpression && + node.operator === '!') { + return checkNode(node.argument, true); + } + // Since typescript array index signature types don't represent the + // possibility of out-of-bounds access, if we're indexing into an array + // just skip the check, to avoid false positives + if (isArrayIndexExpression(node)) { + return; + } + // When checking logical expressions, only check the right side + // as the left side has been checked by checkLogicalExpressionForUnnecessaryConditionals + // + // Unless the node is nullish coalescing, as it's common to use patterns like `nullBool ?? true` to to strict + // boolean checks if we inspect the right here, it'll usually be a constant condition on purpose. + // In this case it's better to inspect the type of the expression as a whole. + if (node.type === experimental_utils_1.AST_NODE_TYPES.LogicalExpression && + node.operator !== '??') { + return checkNode(node.right); + } + const type = getNodeType(node); + // Conditional is always necessary if it involves: + // `any` or `unknown` or a naked type parameter + if (tsutils_1.unionTypeParts(type).some(part => util_1.isTypeAnyType(part) || + util_1.isTypeUnknownType(part) || + util_1.isTypeFlagSet(part, ts.TypeFlags.TypeParameter))) { + return; + } + let messageId = null; + if (util_1.isTypeFlagSet(type, ts.TypeFlags.Never)) { + messageId = 'never'; + } + else if (!isPossiblyTruthy(type)) { + messageId = !isUnaryNotArgument ? 'alwaysFalsy' : 'alwaysTruthy'; + } + else if (!isPossiblyFalsy(type)) { + messageId = !isUnaryNotArgument ? 'alwaysTruthy' : 'alwaysFalsy'; + } + if (messageId) { + context.report({ node, messageId }); + } + } + function checkNodeForNullish(node) { + // Since typescript array index signature types don't represent the + // possibility of out-of-bounds access, if we're indexing into an array + // just skip the check, to avoid false positives + if (isArrayIndexExpression(node)) { + return; + } + const type = getNodeType(node); + // Conditional is always necessary if it involves `any` or `unknown` + if (util_1.isTypeAnyType(type) || util_1.isTypeUnknownType(type)) { + return; + } + let messageId = null; + if (util_1.isTypeFlagSet(type, ts.TypeFlags.Never)) { + messageId = 'never'; + } + else if (!isPossiblyNullish(type)) { + messageId = 'neverNullish'; + } + else if (isAlwaysNullish(type)) { + messageId = 'alwaysNullish'; + } + if (messageId) { + context.report({ node, messageId }); + } + } + /** + * Checks that a binary expression is necessarily conditional, reports otherwise. + * If both sides of the binary expression are literal values, it's not a necessary condition. + * + * NOTE: It's also unnecessary if the types that don't overlap at all + * but that case is handled by the Typescript compiler itself. + * Known exceptions: + * * https://github.com/microsoft/TypeScript/issues/32627 + * * https://github.com/microsoft/TypeScript/issues/37160 (handled) + */ + const BOOL_OPERATORS = new Set([ + '<', + '>', + '<=', + '>=', + '==', + '===', + '!=', + '!==', + ]); + function checkIfBinaryExpressionIsNecessaryConditional(node) { + if (!BOOL_OPERATORS.has(node.operator)) { + return; + } + const leftType = getNodeType(node.left); + const rightType = getNodeType(node.right); + if (isLiteral(leftType) && isLiteral(rightType)) { + context.report({ node, messageId: 'literalBooleanExpression' }); + return; + } + // Workaround for https://github.com/microsoft/TypeScript/issues/37160 + if (isStrictNullChecks) { + const UNDEFINED = ts.TypeFlags.Undefined; + const NULL = ts.TypeFlags.Null; + const isComparable = (type, flag) => { + // Allow comparison to `any`, `unknown` or a naked type parameter. + flag |= + ts.TypeFlags.Any | + ts.TypeFlags.Unknown | + ts.TypeFlags.TypeParameter; + // Allow loose comparison to nullish values. + if (node.operator === '==' || node.operator === '!=') { + flag |= NULL | UNDEFINED; + } + return util_1.isTypeFlagSet(type, flag); + }; + if ((leftType.flags === UNDEFINED && + !isComparable(rightType, UNDEFINED)) || + (rightType.flags === UNDEFINED && + !isComparable(leftType, UNDEFINED)) || + (leftType.flags === NULL && !isComparable(rightType, NULL)) || + (rightType.flags === NULL && !isComparable(leftType, NULL))) { + context.report({ node, messageId: 'noOverlapBooleanExpression' }); + return; + } + } + } + /** + * Checks that a logical expression contains a boolean, reports otherwise. + */ + function checkLogicalExpressionForUnnecessaryConditionals(node) { + if (node.operator === '??') { + checkNodeForNullish(node.left); + return; + } + // Only checks the left side, since the right side might not be "conditional" at all. + // The right side will be checked if the LogicalExpression is used in a conditional context + checkNode(node.left); + } + /** + * Checks that a testable expression of a loop is necessarily conditional, reports otherwise. + */ + function checkIfLoopIsNecessaryConditional(node) { + if (node.test === null) { + // e.g. `for(;;)` + return; + } + /** + * Allow: + * while (true) {} + * for (;true;) {} + * do {} while (true) + */ + if (allowConstantLoopConditions && + tsutils_1.isBooleanLiteralType(getNodeType(node.test), true)) { + return; + } + checkNode(node.test); + } + const ARRAY_PREDICATE_FUNCTIONS = new Set([ + 'filter', + 'find', + 'some', + 'every', + ]); + function isArrayPredicateFunction(node) { + const { callee } = node; + return ( + // looks like `something.filter` or `something.find` + callee.type === experimental_utils_1.AST_NODE_TYPES.MemberExpression && + callee.property.type === experimental_utils_1.AST_NODE_TYPES.Identifier && + ARRAY_PREDICATE_FUNCTIONS.has(callee.property.name) && + // and the left-hand side is an array, according to the types + (nodeIsArrayType(callee.object) || nodeIsTupleType(callee.object))); + } + function checkCallExpression(node) { + // If this is something like arr.filter(x => /*condition*/), check `condition` + if (isArrayPredicateFunction(node) && node.arguments.length) { + const callback = node.arguments[0]; + // Inline defined functions + if ((callback.type === experimental_utils_1.AST_NODE_TYPES.ArrowFunctionExpression || + callback.type === experimental_utils_1.AST_NODE_TYPES.FunctionExpression) && + callback.body) { + // Two special cases, where we can directly check the node that's returned: + // () => something + if (callback.body.type !== experimental_utils_1.AST_NODE_TYPES.BlockStatement) { + return checkNode(callback.body); + } + // () => { return something; } + const callbackBody = callback.body.body; + if (callbackBody.length === 1 && + callbackBody[0].type === experimental_utils_1.AST_NODE_TYPES.ReturnStatement && + callbackBody[0].argument) { + return checkNode(callbackBody[0].argument); + } + // Potential enhancement: could use code-path analysis to check + // any function with a single return statement + // (Value to complexity ratio is dubious however) + } + // Otherwise just do type analysis on the function as a whole. + const returnTypes = tsutils_1.getCallSignaturesOfType(getNodeType(callback)).map(sig => sig.getReturnType()); + /* istanbul ignore if */ if (returnTypes.length === 0) { + // Not a callable function + return; + } + if (!returnTypes.some(isPossiblyFalsy)) { + return context.report({ + node: callback, + messageId: 'alwaysTruthyFunc', + }); + } + if (!returnTypes.some(isPossiblyTruthy)) { + return context.report({ + node: callback, + messageId: 'alwaysFalsyFunc', + }); + } + } + } + // Recursively searches an optional chain for an array index expression + // Has to search the entire chain, because an array index will "infect" the rest of the types + // Example: + // ``` + // [{x: {y: "z"} }][n] // type is {x: {y: "z"}} + // ?.x // type is {y: "z"} + // ?.y // This access is considered "unnecessary" according to the types + // ``` + function optionChainContainsArrayIndex(node) { + const lhsNode = node.type === experimental_utils_1.AST_NODE_TYPES.CallExpression ? node.callee : node.object; + if (isArrayIndexExpression(lhsNode)) { + return true; + } + if (lhsNode.type === experimental_utils_1.AST_NODE_TYPES.MemberExpression || + lhsNode.type === experimental_utils_1.AST_NODE_TYPES.CallExpression) { + return optionChainContainsArrayIndex(lhsNode); + } + return false; + } + function isNullablePropertyType(objType, propertyType) { + if (propertyType.isUnion()) { + return propertyType.types.some(type => isNullablePropertyType(objType, type)); + } + if (propertyType.isNumberLiteral() || propertyType.isStringLiteral()) { + const propType = checker.getTypeOfPropertyOfType(objType, propertyType.value.toString()); + if (propType) { + return util_1.isNullableType(propType, { allowUndefined: true }); + } + } + const typeName = util_1.getTypeName(checker, propertyType); + return !!((typeName === 'string' && + checker.getIndexInfoOfType(objType, ts.IndexKind.String)) || + (typeName === 'number' && + checker.getIndexInfoOfType(objType, ts.IndexKind.Number))); + } + // Checks whether a member expression is nullable or not regardless of it's previous node. + // Example: + // ``` + // // 'bar' is nullable if 'foo' is null. + // // but this function checks regardless of 'foo' type, so returns 'true'. + // declare const foo: { bar : { baz: string } } | null + // foo?.bar; + // ``` + function isNullableOriginFromPrev(node) { + const prevType = getNodeType(node.object); + const property = node.property; + if (prevType.isUnion() && util_1.isIdentifier(property)) { + const isOwnNullable = prevType.types.some(type => { + if (node.computed) { + const propertyType = getNodeType(node.property); + return isNullablePropertyType(type, propertyType); + } + const propType = checker.getTypeOfPropertyOfType(type, property.name); + return propType && util_1.isNullableType(propType, { allowUndefined: true }); + }); + return (!isOwnNullable && util_1.isNullableType(prevType, { allowUndefined: true })); + } + return false; + } + function isOptionableExpression(node) { + const type = getNodeType(node); + const isOwnNullable = node.type === experimental_utils_1.AST_NODE_TYPES.MemberExpression + ? !isNullableOriginFromPrev(node) + : true; + return (util_1.isTypeAnyType(type) || + util_1.isTypeUnknownType(type) || + (util_1.isNullableType(type, { allowUndefined: true }) && isOwnNullable)); + } + function checkOptionalChain(node, beforeOperator, fix) { + // We only care if this step in the chain is optional. If just descend + // from an optional chain, then that's fine. + if (!node.optional) { + return; + } + // Since typescript array index signature types don't represent the + // possibility of out-of-bounds access, if we're indexing into an array + // just skip the check, to avoid false positives + if (optionChainContainsArrayIndex(node)) { + return; + } + const nodeToCheck = node.type === experimental_utils_1.AST_NODE_TYPES.CallExpression ? node.callee : node.object; + if (isOptionableExpression(nodeToCheck)) { + return; + } + const questionDotOperator = util_1.nullThrows(sourceCode.getTokenAfter(beforeOperator, token => token.type === experimental_utils_1.AST_TOKEN_TYPES.Punctuator && token.value === '?.'), util_1.NullThrowsReasons.MissingToken('operator', node.type)); + context.report({ + node, + loc: questionDotOperator.loc, + messageId: 'neverOptionalChain', + fix(fixer) { + return fixer.replaceText(questionDotOperator, fix); + }, + }); + } + function checkOptionalMemberExpression(node) { + checkOptionalChain(node, node.object, node.computed ? '' : '.'); + } + function checkOptionalCallExpression(node) { + checkOptionalChain(node, node.callee, ''); + } + return { + BinaryExpression: checkIfBinaryExpressionIsNecessaryConditional, + CallExpression: checkCallExpression, + ConditionalExpression: (node) => checkNode(node.test), + DoWhileStatement: checkIfLoopIsNecessaryConditional, + ForStatement: checkIfLoopIsNecessaryConditional, + IfStatement: (node) => checkNode(node.test), + LogicalExpression: checkLogicalExpressionForUnnecessaryConditionals, + WhileStatement: checkIfLoopIsNecessaryConditional, + 'MemberExpression[optional = true]': checkOptionalMemberExpression, + 'CallExpression[optional = true]': checkOptionalCallExpression, + }; + }, +}); +//# sourceMappingURL=no-unnecessary-condition.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js.map new file mode 100644 index 000000000..0178403e3 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unnecessary-condition.js","sourceRoot":"","sources":["../../src/rules/no-unnecessary-condition.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAI+C;AAC/C,+CAAiC;AACjC,qCAOiB;AACjB,kCAYiB;AAEjB,uBAAuB;AACvB,UAAU;AACV,MAAM,eAAe,GAAG,CAAC,IAAa,EAAW,EAAE,CACjD,8BAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,uBAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAE5E,MAAM,eAAe,GAAG,CAAC,IAAa,EAAW,EAAE,CACjD,wBAAc,CAAC,IAAI,CAAC;IAClB,mEAAmE;IACnE,wBAAwB;KACvB,MAAM,CAA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;SAC/D,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier.js new file mode 100644 index 000000000..52202a047 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier.js @@ -0,0 +1,149 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const ts = __importStar(require("typescript")); +const tsutils = __importStar(require("tsutils")); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-unnecessary-qualifier', + meta: { + docs: { + category: 'Best Practices', + description: 'Warns when a namespace qualifier is unnecessary', + recommended: false, + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + unnecessaryQualifier: "Qualifier is unnecessary since '{{ name }}' is in scope.", + }, + schema: [], + type: 'suggestion', + }, + defaultOptions: [], + create(context) { + const namespacesInScope = []; + let currentFailedNamespaceExpression = null; + const parserServices = util.getParserServices(context); + const esTreeNodeToTSNodeMap = parserServices.esTreeNodeToTSNodeMap; + const program = parserServices.program; + const checker = program.getTypeChecker(); + const sourceCode = context.getSourceCode(); + function tryGetAliasedSymbol(symbol, checker) { + return tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.Alias) + ? checker.getAliasedSymbol(symbol) + : null; + } + function symbolIsNamespaceInScope(symbol) { + var _a; + const symbolDeclarations = (_a = symbol.getDeclarations()) !== null && _a !== void 0 ? _a : []; + if (symbolDeclarations.some(decl => namespacesInScope.some(ns => ns === decl))) { + return true; + } + const alias = tryGetAliasedSymbol(symbol, checker); + return alias !== null && symbolIsNamespaceInScope(alias); + } + function getSymbolInScope(node, flags, name) { + // TODO:PERF `getSymbolsInScope` gets a long list. Is there a better way? + const scope = checker.getSymbolsInScope(node, flags); + return scope.find(scopeSymbol => scopeSymbol.name === name); + } + function symbolsAreEqual(accessed, inScope) { + return accessed === checker.getExportSymbolOfSymbol(inScope); + } + function qualifierIsUnnecessary(qualifier, name) { + const tsQualifier = esTreeNodeToTSNodeMap.get(qualifier); + const tsName = esTreeNodeToTSNodeMap.get(name); + const namespaceSymbol = checker.getSymbolAtLocation(tsQualifier); + if (typeof namespaceSymbol === 'undefined' || + !symbolIsNamespaceInScope(namespaceSymbol)) { + return false; + } + const accessedSymbol = checker.getSymbolAtLocation(tsName); + if (typeof accessedSymbol === 'undefined') { + return false; + } + // If the symbol in scope is different, the qualifier is necessary. + const fromScope = getSymbolInScope(tsQualifier, accessedSymbol.flags, sourceCode.getText(name)); + return (typeof fromScope === 'undefined' || + symbolsAreEqual(accessedSymbol, fromScope)); + } + function visitNamespaceAccess(node, qualifier, name) { + // Only look for nested qualifier errors if we didn't already fail on the outer qualifier. + if (!currentFailedNamespaceExpression && + qualifierIsUnnecessary(qualifier, name)) { + currentFailedNamespaceExpression = node; + context.report({ + node: qualifier, + messageId: 'unnecessaryQualifier', + data: { + name: sourceCode.getText(name), + }, + fix(fixer) { + return fixer.removeRange([qualifier.range[0], name.range[0]]); + }, + }); + } + } + function enterDeclaration(node) { + namespacesInScope.push(esTreeNodeToTSNodeMap.get(node)); + } + function exitDeclaration() { + namespacesInScope.pop(); + } + function resetCurrentNamespaceExpression(node) { + if (node === currentFailedNamespaceExpression) { + currentFailedNamespaceExpression = null; + } + } + function isPropertyAccessExpression(node) { + return node.type === experimental_utils_1.AST_NODE_TYPES.MemberExpression && !node.computed; + } + function isEntityNameExpression(node) { + return (node.type === experimental_utils_1.AST_NODE_TYPES.Identifier || + (isPropertyAccessExpression(node) && + isEntityNameExpression(node.object))); + } + return { + TSModuleDeclaration: enterDeclaration, + TSEnumDeclaration: enterDeclaration, + 'ExportNamedDeclaration[declaration.type="TSModuleDeclaration"]': enterDeclaration, + 'ExportNamedDeclaration[declaration.type="TSEnumDeclaration"]': enterDeclaration, + 'TSModuleDeclaration:exit': exitDeclaration, + 'TSEnumDeclaration:exit': exitDeclaration, + 'ExportNamedDeclaration[declaration.type="TSModuleDeclaration"]:exit': exitDeclaration, + 'ExportNamedDeclaration[declaration.type="TSEnumDeclaration"]:exit': exitDeclaration, + TSQualifiedName(node) { + visitNamespaceAccess(node, node.left, node.right); + }, + 'MemberExpression[computed=false]': function (node) { + const property = node.property; + if (isEntityNameExpression(node.object)) { + visitNamespaceAccess(node, node.object, property); + } + }, + 'TSQualifiedName:exit': resetCurrentNamespaceExpression, + 'MemberExpression:exit': resetCurrentNamespaceExpression, + }; + }, +}); +//# sourceMappingURL=no-unnecessary-qualifier.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier.js.map new file mode 100644 index 000000000..c516a4522 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unnecessary-qualifier.js","sourceRoot":"","sources":["../../src/rules/no-unnecessary-qualifier.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,+CAAiC;AACjC,iDAAmC;AACnC,8CAA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CAAC,0BAA0B,CAAC,IAAI,CAAC;oBAC/B,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CACvC,CAAC;QACJ,CAAC;QAED,OAAO;YACL,mBAAmB,EAAE,gBAAgB;YACrC,iBAAiB,EAAE,gBAAgB;YACnC,gEAAgE,EAAE,gBAAgB;YAClF,8DAA8D,EAAE,gBAAgB;YAChF,0BAA0B,EAAE,eAAe;YAC3C,wBAAwB,EAAE,eAAe;YACzC,qEAAqE,EAAE,eAAe;YACtF,mEAAmE,EAAE,eAAe;YACpF,eAAe,CAAC,IAA8B;gBAC5C,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;YACpD,CAAC;YACD,kCAAkC,EAAE,UAClC,IAA+B;gBAE/B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAA+B,CAAC;gBACtD,IAAI,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;oBACvC,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;iBACnD;YACH,CAAC;YACD,sBAAsB,EAAE,+BAA+B;YACvD,uBAAuB,EAAE,+BAA+B;SACzD,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.js new file mode 100644 index 000000000..d8fab6113 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.js @@ -0,0 +1,119 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const tsutils = __importStar(require("tsutils")); +const ts = __importStar(require("typescript")); +const util = __importStar(require("../util")); +const util_1 = require("../util"); +exports.default = util.createRule({ + name: 'no-unnecessary-type-arguments', + meta: { + docs: { + description: 'Enforces that type arguments will not be used if not required', + category: 'Best Practices', + recommended: false, + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + unnecessaryTypeParameter: 'This is the default value for this type parameter, so it can be omitted.', + }, + schema: [], + type: 'suggestion', + }, + defaultOptions: [], + create(context) { + const parserServices = util.getParserServices(context); + const checker = parserServices.program.getTypeChecker(); + const sourceCode = context.getSourceCode(); + function checkTSArgsAndParameters(esParameters, typeParameters) { + // Just check the last one. Must specify previous type parameters if the last one is specified. + const i = esParameters.params.length - 1; + const arg = esParameters.params[i]; + const param = typeParameters[i]; + // TODO: would like checker.areTypesEquivalent. https://github.com/Microsoft/TypeScript/issues/13502 + if (!(param === null || param === void 0 ? void 0 : param.default) || + param.default.getText() !== sourceCode.getText(arg)) { + return; + } + context.report({ + node: arg, + messageId: 'unnecessaryTypeParameter', + fix: fixer => fixer.removeRange(i === 0 + ? esParameters.range + : [esParameters.params[i - 1].range[1], arg.range[1]]), + }); + } + return { + TSTypeParameterInstantiation(node) { + const expression = parserServices.esTreeNodeToTSNodeMap.get(node); + const typeParameters = getTypeParametersFromNode(expression, checker); + if (typeParameters) { + checkTSArgsAndParameters(node, typeParameters); + } + }, + }; + }, +}); +function getTypeParametersFromNode(node, checker) { + if (ts.isExpressionWithTypeArguments(node)) { + return getTypeParametersFromType(node.expression, checker); + } + if (ts.isTypeReferenceNode(node)) { + return getTypeParametersFromType(node.typeName, checker); + } + if (ts.isCallExpression(node) || ts.isNewExpression(node)) { + return getTypeParametersFromCall(node, checker); + } + return undefined; +} +function getTypeParametersFromType(type, checker) { + const symAtLocation = checker.getSymbolAtLocation(type); + if (!symAtLocation) { + return undefined; + } + const sym = getAliasedSymbol(symAtLocation, checker); + const declarations = sym.getDeclarations(); + if (!declarations) { + return undefined; + } + return util_1.findFirstResult(declarations, decl => tsutils.isClassLikeDeclaration(decl) || + ts.isTypeAliasDeclaration(decl) || + ts.isInterfaceDeclaration(decl) + ? decl.typeParameters + : undefined); +} +function getTypeParametersFromCall(node, checker) { + const sig = checker.getResolvedSignature(node); + const sigDecl = sig === null || sig === void 0 ? void 0 : sig.getDeclaration(); + if (!sigDecl) { + return ts.isNewExpression(node) + ? getTypeParametersFromType(node.expression, checker) + : undefined; + } + return sigDecl.typeParameters; +} +function getAliasedSymbol(symbol, checker) { + return tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.Alias) + ? checker.getAliasedSymbol(symbol) + : symbol; +} +//# sourceMappingURL=no-unnecessary-type-arguments.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.js.map new file mode 100644 index 000000000..c669509ac --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unnecessary-type-arguments.js","sourceRoot":"","sources":["../../src/rules/no-unnecessary-type-arguments.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,iDAAmC;AACnC,+CAAiC;AACjC,8CAAgC;AAChC,kCAA0C;AAc1C,kBAAe,IAAI,CAAC,UAAU,CAAiB;IAC7C,IAAI,EAAE,+BAA+B;IACrC,IAAI,EAAE;QACJ,IAAI,EAAE;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EAAE;QACjB,OAAO,SAAS,CAAC;KAClB;IAED,OAAO,sBAAe,CAAC,YAAY,EAAE,IAAI,CAAC,EAAE,CAC1C,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC;QACpC,EAAE,CAAC,sBAAsB,CAAC,IAAI,CAAC;QAC/B,EAAE,CAAC,sBAAsB,CAAC,IAAI,CAAC;QAC7B,CAAC,CAAC,IAAI,CAAC,cAAc;QACrB,CAAC,CAAC,SAAS,CACd,CAAC;AACJ,CAAC;AAED,SAAS,yBAAyB,CAChC,IAA0C,EAC1C,OAAuB;IAEvB,MAAM,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,cAAc,EAAE,CAAC;IACtC,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC;YAC7B,CAAC,CAAC,yBAAyB,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC;YACrD,CAAC,CAAC,SAAS,CAAC;KACf;IAED,OAAO,OAAO,CAAC,cAAc,CAAC;AAChC,CAAC;AAED,SAAS,gBAAgB,CACvB,MAAiB,EACjB,OAAuB;IAEvB,OAAO,OAAO,CAAC,eAAe,CAAC,MAAM,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC;QAC1D,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC;QAClC,CAAC,CAAC,MAAM,CAAC;AACb,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js new file mode 100644 index 000000000..249849fec --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js @@ -0,0 +1,218 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const tsutils_1 = require("tsutils"); +const ts = __importStar(require("typescript")); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-unnecessary-type-assertion', + meta: { + docs: { + description: 'Warns if a type assertion does not change the type of an expression', + category: 'Best Practices', + recommended: 'error', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + unnecessaryAssertion: 'This assertion is unnecessary since it does not change the type of the expression.', + contextuallyUnnecessary: 'This assertion is unnecessary since the receiver accepts the original type of the expression.', + }, + schema: [ + { + type: 'object', + properties: { + typesToIgnore: { + type: 'array', + items: { + type: 'string', + }, + }, + }, + }, + ], + type: 'suggestion', + }, + defaultOptions: [{}], + create(context, [options]) { + const sourceCode = context.getSourceCode(); + const parserServices = util.getParserServices(context); + const checker = parserServices.program.getTypeChecker(); + const compilerOptions = parserServices.program.getCompilerOptions(); + /** + * Sometimes tuple types don't have ObjectFlags.Tuple set, like when they're being matched against an inferred type. + * So, in addition, check if there are integer properties 0..n and no other numeric keys + */ + function couldBeTupleType(type) { + const properties = type.getProperties(); + if (properties.length === 0) { + return false; + } + let i = 0; + for (; i < properties.length; ++i) { + const name = properties[i].name; + if (String(i) !== name) { + if (i === 0) { + // if there are no integer properties, this is not a tuple + return false; + } + break; + } + } + for (; i < properties.length; ++i) { + if (String(+properties[i].name) === properties[i].name) { + return false; // if there are any other numeric properties, this is not a tuple + } + } + return true; + } + /** + * Returns true if there's a chance the variable has been used before a value has been assigned to it + */ + function isPossiblyUsedBeforeAssigned(node) { + const declaration = util.getDeclaration(checker, node); + if (!declaration) { + // don't know what the declaration is for some reason, so just assume the worst + return true; + } + if ( + // non-strict mode doesn't care about used before assigned errors + tsutils_1.isStrictCompilerOptionEnabled(compilerOptions, 'strictNullChecks') && + // ignore class properties as they are compile time guarded + // also ignore function arguments as they can't be used before defined + tsutils_1.isVariableDeclaration(declaration) && + // is it `const x!: number` + declaration.initializer === undefined && + declaration.exclamationToken === undefined && + declaration.type !== undefined) { + // check if the defined variable type has changed since assignment + const declarationType = checker.getTypeFromTypeNode(declaration.type); + const type = util.getConstrainedTypeAtLocation(checker, node); + if (declarationType === type) { + // possibly used before assigned, so just skip it + // better to false negative and skip it, than false positive and fix to compile erroring code + // + // no better way to figure this out right now + // https://github.com/Microsoft/TypeScript/issues/31124 + return true; + } + } + return false; + } + function isConstAssertion(node) { + return (node.type === experimental_utils_1.AST_NODE_TYPES.TSTypeReference && + node.typeName.type === experimental_utils_1.AST_NODE_TYPES.Identifier && + node.typeName.name === 'const'); + } + return { + TSNonNullExpression(node) { + const originalNode = parserServices.esTreeNodeToTSNodeMap.get(node); + const type = util.getConstrainedTypeAtLocation(checker, originalNode.expression); + if (!util.isNullableType(type)) { + if (isPossiblyUsedBeforeAssigned(originalNode.expression)) { + return; + } + context.report({ + node, + messageId: 'unnecessaryAssertion', + fix(fixer) { + return fixer.removeRange([ + originalNode.expression.end, + originalNode.end, + ]); + }, + }); + } + else { + // we know it's a nullable type + // so figure out if the variable is used in a place that accepts nullable types + const contextualType = util.getContextualType(checker, originalNode); + if (contextualType) { + // in strict mode you can't assign null to undefined, so we have to make sure that + // the two types share a nullable type + const typeIncludesUndefined = util.isTypeFlagSet(type, ts.TypeFlags.Undefined); + const typeIncludesNull = util.isTypeFlagSet(type, ts.TypeFlags.Null); + const contextualTypeIncludesUndefined = util.isTypeFlagSet(contextualType, ts.TypeFlags.Undefined); + const contextualTypeIncludesNull = util.isTypeFlagSet(contextualType, ts.TypeFlags.Null); + // make sure that the parent accepts the same types + // i.e. assigning `string | null | undefined` to `string | undefined` is invalid + const isValidUndefined = typeIncludesUndefined + ? contextualTypeIncludesUndefined + : true; + const isValidNull = typeIncludesNull + ? contextualTypeIncludesNull + : true; + if (isValidUndefined && isValidNull) { + context.report({ + node, + messageId: 'contextuallyUnnecessary', + fix(fixer) { + return fixer.removeRange([ + originalNode.expression.end, + originalNode.end, + ]); + }, + }); + } + } + } + }, + 'TSAsExpression, TSTypeAssertion'(node) { + var _a; + if (((_a = options.typesToIgnore) === null || _a === void 0 ? void 0 : _a.includes(sourceCode.getText(node.typeAnnotation))) || + isConstAssertion(node.typeAnnotation)) { + return; + } + const originalNode = parserServices.esTreeNodeToTSNodeMap.get(node); + const castType = checker.getTypeAtLocation(originalNode); + if (tsutils_1.isTypeFlagSet(castType, ts.TypeFlags.Literal) || + (tsutils_1.isObjectType(castType) && + (tsutils_1.isObjectFlagSet(castType, ts.ObjectFlags.Tuple) || + couldBeTupleType(castType)))) { + // It's not always safe to remove a cast to a literal type or tuple + // type, as those types are sometimes widened without the cast. + return; + } + const uncastType = checker.getTypeAtLocation(originalNode.expression); + if (uncastType === castType) { + context.report({ + node, + messageId: 'unnecessaryAssertion', + fix(fixer) { + return originalNode.kind === ts.SyntaxKind.TypeAssertionExpression + ? fixer.removeRange([ + originalNode.getStart(), + originalNode.expression.getStart(), + ]) + : fixer.removeRange([ + originalNode.expression.end, + originalNode.end, + ]); + }, + }); + } + // TODO - add contextually unnecessary check for this + }, + }; + }, +}); +//# sourceMappingURL=no-unnecessary-type-assertion.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js.map new file mode 100644 index 000000000..31dfa14d7 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unnecessary-type-assertion.js","sourceRoot":"","sources":["../../src/rules/no-unnecessary-type-assertion.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,qCAMiB;AACjB,+CAAiC;AACjC,8CAAgC;AAShC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,+BAA+B;IACrC,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,WAAW,EACT,qEAAqE;YACvE,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,OAAO;YACpB,oBAAoB,EAAE,IAAI;SAC3B;QACD,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE;YACR,oBAAoB,EAClB,oFAAoF;YACtF,uBAAuB,EACrB,+FAA+F;SAClG;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,aAAa,EAAE;wBACb,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE;4BACL,IAAI,EAAE,QAAQ;yBACf;qBACF;iBACF;aACF;SACF;QACD,IAAI,EAAE,YAAY;KACnB;IACD,cAAc,EAAE,CAAC,EAAE,CAAC;IACpB,MAAM,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC;QACvB,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;QAC3C,MAAM,cAAc,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QACvD,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;QACxD,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAEpE;;;WAGG;QACH,SAAS,gBAAgB,CAAC,IAAmB;YAC3C,MAAM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AAC,cAAc,CAAC,EACrC;oBACA,OAAO;iBACR;gBAED,MAAM,YAAY,GAAG,cAAc,CAAC,qBAAqB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBACpE,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;gBAEzD,IACE,uBAAa,CAAC,QAAQ,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;oBAC7C,CAAC,sBAAY,CAAC,QAAQ,CAAC;wBACrB,CAAC,yBAAe,CAAC,QAAQ,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC;4BAC9C,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,EAChC;oBACA,mEAAmE;oBACnE,+DAA+D;oBAC/D,OAAO;iBACR;gBAED,MAAM,UAAU,GAAG,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;gBAEtE,IAAI,UAAU,KAAK,QAAQ,EAAE;oBAC3B,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI;wBACJ,SAAS,EAAE,sBAAsB;wBACjC,GAAG,CAAC,KAAK;4BACP,OAAO,YAAY,CAAC,IAAI,KAAK,EAAE,CAAC,UAAU,CAAC,uBAAuB;gCAChE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC;oCAChB,YAAY,CAAC,QAAQ,EAAE;oCACvB,YAAY,CAAC,UAAU,CAAC,QAAQ,EAAE;iCACnC,CAAC;gCACJ,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC;oCAChB,YAAY,CAAC,UAAU,CAAC,GAAG;oCAC3B,YAAY,CAAC,GAAG;iCACjB,CAAC,CAAC;wBACT,CAAC;qBACF,CAAC,CAAC;iBACJ;gBAED,qDAAqD;YACvD,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment.js new file mode 100644 index 000000000..42b1f9c55 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment.js @@ -0,0 +1,265 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-unsafe-assignment', + meta: { + type: 'problem', + docs: { + description: 'Disallows assigning any to variables and properties', + category: 'Possible Errors', + recommended: 'error', + requiresTypeChecking: true, + }, + messages: { + anyAssignment: 'Unsafe assignment of an any value.', + unsafeArrayPattern: 'Unsafe array destructuring of an any array value.', + unsafeArrayPatternFromTuple: 'Unsafe array destructuring of a tuple element with an any value.', + unsafeAssignment: 'Unsafe assignment of type {{sender}} to a variable of type {{receiver}}.', + unsafeArraySpread: 'Unsafe spread of an any value in an array.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const { program, esTreeNodeToTSNodeMap } = util.getParserServices(context); + const checker = program.getTypeChecker(); + // returns true if the assignment reported + function checkArrayDestructureHelper(receiverNode, senderNode) { + if (receiverNode.type !== experimental_utils_1.AST_NODE_TYPES.ArrayPattern) { + return false; + } + const senderTsNode = esTreeNodeToTSNodeMap.get(senderNode); + const senderType = checker.getTypeAtLocation(senderTsNode); + return checkArrayDestructure(receiverNode, senderType, senderTsNode); + } + // returns true if the assignment reported + function checkArrayDestructure(receiverNode, senderType, senderNode) { + // any array + // const [x] = ([] as any[]); + if (util.isTypeAnyArrayType(senderType, checker)) { + context.report({ + node: receiverNode, + messageId: 'unsafeArrayPattern', + }); + return false; + } + if (!checker.isTupleType(senderType)) { + return true; + } + const tupleElements = util.getTypeArguments(senderType, checker); + // tuple with any + // const [x] = [1 as any]; + let didReport = false; + for (let receiverIndex = 0; receiverIndex < receiverNode.elements.length; receiverIndex += 1) { + const receiverElement = receiverNode.elements[receiverIndex]; + if (!receiverElement) { + continue; + } + if (receiverElement.type === experimental_utils_1.AST_NODE_TYPES.RestElement) { + // don't handle rests as they're not a 1:1 assignment + continue; + } + const senderType = tupleElements[receiverIndex]; + if (!senderType) { + continue; + } + // check for the any type first so we can handle [[[x]]] = [any] + if (util.isTypeAnyType(senderType)) { + context.report({ + node: receiverElement, + messageId: 'unsafeArrayPatternFromTuple', + }); + // we want to report on every invalid element in the tuple + didReport = true; + } + else if (receiverElement.type === experimental_utils_1.AST_NODE_TYPES.ArrayPattern) { + didReport = checkArrayDestructure(receiverElement, senderType, senderNode); + } + else if (receiverElement.type === experimental_utils_1.AST_NODE_TYPES.ObjectPattern) { + didReport = checkObjectDestructure(receiverElement, senderType, senderNode); + } + } + return didReport; + } + // returns true if the assignment reported + function checkObjectDestructureHelper(receiverNode, senderNode) { + if (receiverNode.type !== experimental_utils_1.AST_NODE_TYPES.ObjectPattern) { + return false; + } + const senderTsNode = esTreeNodeToTSNodeMap.get(senderNode); + const senderType = checker.getTypeAtLocation(senderTsNode); + return checkObjectDestructure(receiverNode, senderType, senderTsNode); + } + // returns true if the assignment reported + function checkObjectDestructure(receiverNode, senderType, senderNode) { + const properties = new Map(senderType + .getProperties() + .map(property => [ + property.getName(), + checker.getTypeOfSymbolAtLocation(property, senderNode), + ])); + let didReport = false; + for (let receiverIndex = 0; receiverIndex < receiverNode.properties.length; receiverIndex += 1) { + const receiverProperty = receiverNode.properties[receiverIndex]; + if (receiverProperty.type === experimental_utils_1.AST_NODE_TYPES.RestElement) { + // don't bother checking rest + continue; + } + let key; + if (receiverProperty.computed === false) { + key = + receiverProperty.key.type === experimental_utils_1.AST_NODE_TYPES.Identifier + ? receiverProperty.key.name + : String(receiverProperty.key.value); + } + else if (receiverProperty.key.type === experimental_utils_1.AST_NODE_TYPES.Literal) { + key = String(receiverProperty.key.value); + } + else if (receiverProperty.key.type === experimental_utils_1.AST_NODE_TYPES.TemplateLiteral && + receiverProperty.key.quasis.length === 1) { + key = String(receiverProperty.key.quasis[0].value.cooked); + } + else { + // can't figure out the name, so skip it + continue; + } + const senderType = properties.get(key); + if (!senderType) { + continue; + } + // check for the any type first so we can handle {x: {y: z}} = {x: any} + if (util.isTypeAnyType(senderType)) { + context.report({ + node: receiverProperty.value, + messageId: 'unsafeArrayPatternFromTuple', + }); + didReport = true; + } + else if (receiverProperty.value.type === experimental_utils_1.AST_NODE_TYPES.ArrayPattern) { + didReport = checkArrayDestructure(receiverProperty.value, senderType, senderNode); + } + else if (receiverProperty.value.type === experimental_utils_1.AST_NODE_TYPES.ObjectPattern) { + didReport = checkObjectDestructure(receiverProperty.value, senderType, senderNode); + } + } + return didReport; + } + // returns true if the assignment reported + function checkAssignment(receiverNode, senderNode, reportingNode, comparisonType) { + var _a; + const receiverTsNode = esTreeNodeToTSNodeMap.get(receiverNode); + const receiverType = comparisonType === 2 /* Contextual */ + ? (_a = util.getContextualType(checker, receiverTsNode)) !== null && _a !== void 0 ? _a : checker.getTypeAtLocation(receiverTsNode) : checker.getTypeAtLocation(receiverTsNode); + const senderType = checker.getTypeAtLocation(esTreeNodeToTSNodeMap.get(senderNode)); + if (util.isTypeAnyType(senderType)) { + // handle cases when we assign any ==> unknown. + if (util.isTypeUnknownType(receiverType)) { + return false; + } + context.report({ + node: reportingNode, + messageId: 'anyAssignment', + }); + return true; + } + if (comparisonType === 0 /* None */) { + return false; + } + const result = util.isUnsafeAssignment(senderType, receiverType, checker); + if (!result) { + return false; + } + const { sender, receiver } = result; + context.report({ + node: reportingNode, + messageId: 'unsafeAssignment', + data: { + sender: checker.typeToString(sender), + receiver: checker.typeToString(receiver), + }, + }); + return true; + } + function getComparisonType(typeAnnotation) { + return typeAnnotation + ? // if there's a type annotation, we can do a comparison + 1 /* Basic */ + : // no type annotation means the variable's type will just be inferred, thus equal + 0 /* None */; + } + return { + 'VariableDeclarator[init != null]'(node) { + const init = util.nullThrows(node.init, util.NullThrowsReasons.MissingToken(node.type, 'init')); + let didReport = checkAssignment(node.id, init, node, getComparisonType(node.id.typeAnnotation)); + if (!didReport) { + didReport = checkArrayDestructureHelper(node.id, init); + } + if (!didReport) { + checkObjectDestructureHelper(node.id, init); + } + }, + 'ClassProperty[value != null]'(node) { + checkAssignment(node.key, node.value, node, getComparisonType(node.typeAnnotation)); + }, + 'AssignmentExpression[operator = "="], AssignmentPattern'(node) { + let didReport = checkAssignment(node.left, node.right, node, 1 /* Basic */); + if (!didReport) { + didReport = checkArrayDestructureHelper(node.left, node.right); + } + if (!didReport) { + checkObjectDestructureHelper(node.left, node.right); + } + }, + // object pattern props are checked via assignments + ':not(ObjectPattern) > Property'(node) { + if (node.value.type === experimental_utils_1.AST_NODE_TYPES.AssignmentPattern || + node.value.type === experimental_utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression) { + // handled by other selector + return; + } + checkAssignment(node.key, node.value, node, 2 /* Contextual */); + }, + 'ArrayExpression > SpreadElement'(node) { + const resetNode = esTreeNodeToTSNodeMap.get(node.argument); + const restType = checker.getTypeAtLocation(resetNode); + if (util.isTypeAnyType(restType) || + util.isTypeAnyArrayType(restType, checker)) { + context.report({ + node: node, + messageId: 'unsafeArraySpread', + }); + } + }, + 'JSXAttribute[value != null]'(node) { + const value = util.nullThrows(node.value, util.NullThrowsReasons.MissingToken(node.type, 'value')); + if (value.type !== experimental_utils_1.AST_NODE_TYPES.JSXExpressionContainer || + value.expression.type === experimental_utils_1.AST_NODE_TYPES.JSXEmptyExpression) { + return; + } + checkAssignment(node.name, value.expression, value.expression, 2 /* Contextual */); + }, + }; + }, +}); +//# sourceMappingURL=no-unsafe-assignment.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment.js.map new file mode 100644 index 000000000..272d4ac33 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unsafe-assignment.js","sourceRoot":"","sources":["../../src/rules/no-unsafe-assignment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAE/C,8CAAgC;AAWhC,kBAAe,IAAI,CAAC,UAAU,CAAC;IAC7B,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,qDAAqD;YAClE,QAAQ,EAAE,iBAAiB;YAC3B,WAAW,EAAE,OAAO;YACpB,oBAAoB,EAAE,IAAI;SAC3B;QACD,QAAQ,EAAE;YACR,aAAa,EAAE,oCAAoC;YACnD,kBAAkB,EAAE,mDAAmD;YACvE,2BAA2B,EACzB,kEAAkE;YACpE,gBAAgB,EACd,0EAA0E;YAC5E,iBAAiB,EAAE,4CAA4C;SAChE;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,MAAM,EAAE,OAAO,EAAE,qBAAqB,EAAE,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3E,MAAM,OAAO,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;QAEzC,0CAA0C;QAC1C,SAAS,2BAA2B,CAClC,YAA2B,EAC3B,UAAyB;YAEzB,IAAI,Y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AAa,CAAC,QAAQ,CAAC;oBAC5B,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,OAAO,CAAC,EAC1C;oBACA,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI,EAAE,IAAI;wBACV,SAAS,EAAE,mBAAmB;qBAC/B,CAAC,CAAC;iBACJ;YACH,CAAC;YACD,6BAA6B,CAAC,IAA2B;gBACvD,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAC3B,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CACxD,CAAC;gBACF,IACE,KAAK,CAAC,IAAI,KAAK,mCAAc,CAAC,sBAAsB;oBACpD,KAAK,CAAC,UAAU,CAAC,IAAI,KAAK,mCAAc,CAAC,kBAAkB,EAC3D;oBACA,OAAO;iBACR;gBAED,eAAe,CACb,IAAI,CAAC,IAAI,EACT,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,UAAU,qBAEjB,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call.js new file mode 100644 index 000000000..b3d4b5d6c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call.js @@ -0,0 +1,67 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-unsafe-call', + meta: { + type: 'problem', + docs: { + description: 'Disallows calling an any type value', + category: 'Possible Errors', + recommended: 'error', + requiresTypeChecking: true, + }, + messages: { + unsafeCall: 'Unsafe call of an any typed value.', + unsafeNew: 'Unsafe construction of an any type value.', + unsafeTemplateTag: 'Unsafe any typed template tag.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const { program, esTreeNodeToTSNodeMap } = util.getParserServices(context); + const checker = program.getTypeChecker(); + function checkCall(node, reportingNode, messageId) { + const tsNode = esTreeNodeToTSNodeMap.get(node); + const type = util.getConstrainedTypeAtLocation(checker, tsNode); + if (util.isTypeAnyType(type)) { + context.report({ + node: reportingNode, + messageId: messageId, + }); + } + } + return { + 'CallExpression > *.callee'(node) { + checkCall(node, node, 'unsafeCall'); + }, + NewExpression(node) { + checkCall(node.callee, node, 'unsafeNew'); + }, + 'TaggedTemplateExpression > *.tag'(node) { + checkCall(node, node, 'unsafeTemplateTag'); + }, + }; + }, +}); +//# sourceMappingURL=no-unsafe-call.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call.js.map new file mode 100644 index 000000000..2f8e7e8b3 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unsafe-call.js","sourceRoot":"","sources":["../../src/rules/no-unsafe-call.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,8CAAgC;AAIhC,kBAAe,IAAI,CAAC,UAAU,CAAiB;IAC7C,IAAI,EAAE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ACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access.js new file mode 100644 index 000000000..21c6c3151 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access.js @@ -0,0 +1,105 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-unsafe-member-access', + meta: { + type: 'problem', + docs: { + description: 'Disallows member access on any typed variables', + category: 'Possible Errors', + recommended: 'error', + requiresTypeChecking: true, + }, + messages: { + unsafeMemberExpression: 'Unsafe member access {{property}} on an any value.', + unsafeComputedMemberAccess: 'Computed name {{property}} resolves to an any value.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const { program, esTreeNodeToTSNodeMap } = util.getParserServices(context); + const checker = program.getTypeChecker(); + const sourceCode = context.getSourceCode(); + const stateCache = new Map(); + function checkMemberExpression(node) { + const cachedState = stateCache.get(node); + if (cachedState) { + return cachedState; + } + if (node.object.type === experimental_utils_1.AST_NODE_TYPES.MemberExpression) { + const objectState = checkMemberExpression(node.object); + if (objectState === 1 /* Unsafe */) { + // if the object is unsafe, we know this will be unsafe as well + // we don't need to report, as we have already reported on the inner member expr + stateCache.set(node, objectState); + return objectState; + } + } + const tsNode = esTreeNodeToTSNodeMap.get(node.object); + const type = checker.getTypeAtLocation(tsNode); + const state = util.isTypeAnyType(type) ? 1 /* Unsafe */ : 2 /* Safe */; + stateCache.set(node, state); + if (state === 1 /* Unsafe */) { + const propertyName = sourceCode.getText(node.property); + context.report({ + node, + messageId: 'unsafeMemberExpression', + data: { + property: node.computed ? `[${propertyName}]` : `.${propertyName}`, + }, + }); + } + return state; + } + return { + MemberExpression: checkMemberExpression, + 'MemberExpression[computed = true] > *.property'(node) { + if ( + // x[1] + node.type === experimental_utils_1.AST_NODE_TYPES.Literal || + // x[1++] x[++x] etc + // FUN FACT - **all** update expressions return type number, regardless of the argument's type, + // because JS engines return NaN if there the argument is not a number. + node.type === experimental_utils_1.AST_NODE_TYPES.UpdateExpression) { + // perf optimizations - literals can obviously never be `any` + return; + } + const tsNode = esTreeNodeToTSNodeMap.get(node); + const type = checker.getTypeAtLocation(tsNode); + if (util.isTypeAnyType(type)) { + const propertyName = sourceCode.getText(node); + context.report({ + node, + messageId: 'unsafeComputedMemberAccess', + data: { + property: `[${propertyName}]`, + }, + }); + } + }, + }; + }, +}); +//# sourceMappingURL=no-unsafe-member-access.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access.js.map new file mode 100644 index 000000000..4a2df7a7e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unsafe-member-access.js","sourceRoot":"","sources":["../../src/rules/no-unsafe-member-access.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,8CAAgC;AAOhC,k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Y,GAAG;yBAC9B;qBACF,CAAC,CAAC;iBACJ;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.js new file mode 100644 index 000000000..50b809c8c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.js @@ -0,0 +1,137 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const tsutils_1 = require("tsutils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-unsafe-return', + meta: { + type: 'problem', + docs: { + description: 'Disallows returning any from a function', + category: 'Possible Errors', + recommended: 'error', + requiresTypeChecking: true, + }, + messages: { + unsafeReturn: 'Unsafe return of an {{type}} typed value', + unsafeReturnAssignment: 'Unsafe return of type {{sender}} from function with return type {{receiver}}.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const { program, esTreeNodeToTSNodeMap } = util.getParserServices(context); + const checker = program.getTypeChecker(); + function getParentFunctionNode(node) { + let current = node.parent; + while (current) { + if (current.type === experimental_utils_1.AST_NODE_TYPES.ArrowFunctionExpression || + current.type === experimental_utils_1.AST_NODE_TYPES.FunctionDeclaration || + current.type === experimental_utils_1.AST_NODE_TYPES.FunctionExpression) { + return current; + } + current = current.parent; + } + // this shouldn't happen in correct code, but someone may attempt to parse bad code + // the parser won't error, so we shouldn't throw here + /* istanbul ignore next */ return null; + } + function checkReturn(returnNode, reportingNode = returnNode) { + const tsNode = esTreeNodeToTSNodeMap.get(returnNode); + const anyType = util.isAnyOrAnyArrayTypeDiscriminated(tsNode, checker); + const functionNode = getParentFunctionNode(returnNode); + /* istanbul ignore if */ if (!functionNode) { + return; + } + // function has an explicit return type, so ensure it's a safe return + const returnNodeType = util.getConstrainedTypeAtLocation(checker, esTreeNodeToTSNodeMap.get(returnNode)); + const functionTSNode = esTreeNodeToTSNodeMap.get(functionNode); + // function expressions will not have their return type modified based on receiver typing + // so we have to use the contextual typing in these cases, i.e. + // const foo1: () => Set = () => new Set(); + // the return type of the arrow function is Set even though the variable is typed as Set + let functionType = tsutils_1.isExpression(functionTSNode) + ? util.getContextualType(checker, functionTSNode) + : checker.getTypeAtLocation(functionTSNode); + if (!functionType) { + functionType = checker.getTypeAtLocation(functionTSNode); + } + if (anyType !== 2 /* Safe */) { + // Allow cases when the declared return type of the function is either unknown or unknown[] + // and the function is returning any or any[]. + for (const signature of functionType.getCallSignatures()) { + const functionReturnType = signature.getReturnType(); + if (anyType === 0 /* Any */ && + util.isTypeUnknownType(functionReturnType)) { + return; + } + if (anyType === 1 /* AnyArray */ && + util.isTypeUnknownArrayType(functionReturnType, checker)) { + return; + } + } + // If the function return type was not unknown/unknown[], mark usage as unsafeReturn. + return context.report({ + node: reportingNode, + messageId: 'unsafeReturn', + data: { + type: anyType === 0 /* Any */ ? 'any' : 'any[]', + }, + }); + } + for (const signature of functionType.getCallSignatures()) { + const functionReturnType = signature.getReturnType(); + if (returnNodeType === functionReturnType) { + // don't bother checking if they're the same + // either the function is explicitly declared to return the same type + // or there was no declaration, so the return type is implicit + return; + } + const result = util.isUnsafeAssignment(returnNodeType, functionReturnType, checker); + if (!result) { + return; + } + const { sender, receiver } = result; + return context.report({ + node: reportingNode, + messageId: 'unsafeReturnAssignment', + data: { + sender: checker.typeToString(sender), + receiver: checker.typeToString(receiver), + }, + }); + } + } + return { + ReturnStatement(node) { + const argument = node.argument; + if (!argument) { + return; + } + checkReturn(argument, node); + }, + 'ArrowFunctionExpression > :not(BlockStatement).body': checkReturn, + }; + }, +}); +//# sourceMappingURL=no-unsafe-return.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.js.map new file mode 100644 index 000000000..e2f30ca0b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unsafe-return.js","sourceRoot":"","sources":["../../src/rules/no-unsafe-return.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,qCAAuC;AACvC,8CAAgC;AAEhC,kBAAe,IAAI,CAAC,UAAU,CAAC;IAC7B,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,yCAAyC;YACtD,QAAQ,EAAE,iBAAiB;YAC3B,WAAW,EAAE,OAAO;YACpB,oBAAoB,EAAE,IAAI;SAC3B;QACD,QAAQ,EAAE;YACR,YAAY,EAAE,0CAA0C;YACxD,sBAAsB,EACpB,+EAA+E;SAClF;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,MAAM,EAAE,OAAO,EAAE,qBAAqB,EAAE,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3E,MAAM,OAAO,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;QAEzC,SAAS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BACJ,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC;wBACpC,QAAQ,EAAE,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC;qBACzC;iBACF,CAAC,CAAC;aACJ;QACH,CAAC;QAED,OAAO;YACL,eAAe,CAAC,IAAI;gBAClB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;gBAC/B,IAAI,CAAC,QAAQ,EAAE;oBACb,OAAO;iBACR;gBAED,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC9B,CAAC;YACD,qDAAqD,EAAE,WAAW;SACnE,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-expressions.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-expressions.js new file mode 100644 index 000000000..1b3a2d4a1 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-expressions.js @@ -0,0 +1,76 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const no_unused_expressions_1 = __importDefault(require("eslint/lib/rules/no-unused-expressions")); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-unused-expressions', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow unused expressions', + category: 'Best Practices', + recommended: false, + extendsBaseRule: true, + }, + schema: no_unused_expressions_1.default.meta.schema, + messages: (_a = no_unused_expressions_1.default.meta.messages) !== null && _a !== void 0 ? _a : { + unusedExpression: 'Expected an assignment or function call and instead saw an expression.', + }, + }, + defaultOptions: [ + { + allowShortCircuit: false, + allowTernary: false, + allowTaggedTemplates: false, + }, + ], + create(context, options) { + const rules = no_unused_expressions_1.default.create(context); + const { allowShortCircuit = false, allowTernary = false } = options[0]; + function isValidExpression(node) { + if (allowShortCircuit && node.type === experimental_utils_1.AST_NODE_TYPES.LogicalExpression) { + return isValidExpression(node.right); + } + if (allowTernary && node.type === experimental_utils_1.AST_NODE_TYPES.ConditionalExpression) { + return (isValidExpression(node.alternate) && + isValidExpression(node.consequent)); + } + return ((node.type === experimental_utils_1.AST_NODE_TYPES.ChainExpression && + node.expression.type === experimental_utils_1.AST_NODE_TYPES.CallExpression) || + node.type === experimental_utils_1.AST_NODE_TYPES.ImportExpression); + } + return { + ExpressionStatement(node) { + if (node.directive || isValidExpression(node.expression)) { + return; + } + rules.ExpressionStatement(node); + }, + }; + }, +}); +//# sourceMappingURL=no-unused-expressions.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-expressions.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-expressions.js.map new file mode 100644 index 000000000..d9fc64616 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-expressions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unused-expressions.js","sourceRoot":"","sources":["../../src/rules/no-unused-expressions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,mGAA8D;AAC9D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AI,CAAC,IAAI,KAAK,mCAAc,CAAC,gBAAgB,CAC9C,CAAC;QACJ,CAAC;QAED,OAAO;YACL,mBAAmB,CAAC,IAAI;gBACtB,IAAI,IAAI,CAAC,SAAS,IAAI,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;oBACxD,OAAO;iBACR;gBAED,KAAK,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;YAClC,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars-experimental.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars-experimental.js new file mode 100644 index 000000000..fd0572215 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars-experimental.js @@ -0,0 +1,318 @@ +"use strict"; +/* eslint-disable no-fallthrough */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DEFAULT_IGNORED_REGEX_STRING = void 0; +const ts = __importStar(require("typescript")); +const util = __importStar(require("../util")); +exports.DEFAULT_IGNORED_REGEX_STRING = '^_'; +exports.default = util.createRule({ + name: 'no-unused-vars-experimental', + meta: { + type: 'problem', + docs: { + description: 'Disallow unused variables and arguments', + category: 'Best Practices', + recommended: false, + }, + deprecated: true, + replacedBy: ['no-unused-vars'], + schema: [ + { + type: 'object', + properties: { + ignoredNamesRegex: { + oneOf: [ + { + type: 'string', + }, + { + type: 'boolean', + enum: [false], + }, + ], + }, + ignoreArgsIfArgsAfterAreUsed: { + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], + messages: { + unused: "{{type}} '{{name}}' is declared but its value is never read.", + unusedWithIgnorePattern: "{{type}} '{{name}}' is declared but its value is never read. Allowed unused names must match {{pattern}}.", + unusedImport: 'All imports in import declaration are unused.', + unusedTypeParameters: 'All type parameters are unused.', + }, + }, + defaultOptions: [ + { + ignoredNamesRegex: exports.DEFAULT_IGNORED_REGEX_STRING, + ignoreArgsIfArgsAfterAreUsed: false, + }, + ], + create(context, [userOptions]) { + var _a; + const parserServices = util.getParserServices(context, true); + const tsProgram = parserServices.program; + const afterAllDiagnosticsCallbacks = []; + const options = { + ignoredNames: userOptions && typeof userOptions.ignoredNamesRegex === 'string' + ? new RegExp(userOptions.ignoredNamesRegex) + : null, + ignoreArgsIfArgsAfterAreUsed: (_a = userOptions.ignoreArgsIfArgsAfterAreUsed) !== null && _a !== void 0 ? _a : false, + }; + function handleIdentifier(identifier) { + function report(type) { + const node = parserServices.tsNodeToESTreeNodeMap.get(identifier); + const regex = options.ignoredNames; + const name = identifier.getText(); + if (regex) { + if (!regex.test(name)) { + context.report({ + node, + messageId: 'unusedWithIgnorePattern', + data: { + name, + type, + pattern: regex.toString(), + }, + }); + } + } + else { + context.report({ + node, + messageId: 'unused', + data: { + name, + type, + }, + }); + } + } + const parent = identifier.parent; + // is a single variable diagnostic + switch (parent.kind) { + case ts.SyntaxKind.BindingElement: + case ts.SyntaxKind.ObjectBindingPattern: + report('Destructured Variable'); + break; + case ts.SyntaxKind.ClassDeclaration: + report('Class'); + break; + case ts.SyntaxKind.EnumDeclaration: + report('Enum'); + break; + case ts.SyntaxKind.FunctionDeclaration: + report('Function'); + break; + // this won't happen because there are specific nodes that wrap up named/default import identifiers + // case ts.SyntaxKind.ImportDeclaration: + // import equals is always treated as a variable + case ts.SyntaxKind.ImportEqualsDeclaration: + // the default import is NOT used, but a named import is used + case ts.SyntaxKind.ImportClause: + // a named import is NOT used, but either another named import, or the default import is used + case ts.SyntaxKind.ImportSpecifier: + // a namespace import is NOT used, but the default import is used + case ts.SyntaxKind.NamespaceImport: + report('Import'); + break; + case ts.SyntaxKind.InterfaceDeclaration: + report('Interface'); + break; + case ts.SyntaxKind.MethodDeclaration: + report('Method'); + break; + case ts.SyntaxKind.Parameter: + handleParameterDeclaration(identifier, parent); + break; + case ts.SyntaxKind.PropertyDeclaration: + // eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum + report('Property'); + break; + case ts.SyntaxKind.TypeAliasDeclaration: + report('Type'); + break; + case ts.SyntaxKind.TypeParameter: + handleTypeParam(identifier); + break; + case ts.SyntaxKind.VariableDeclaration: + report('Variable'); + break; + default: + throw new Error(`Unknown node with kind ${parent.kind}.`); + // TODO - should we just handle this gracefully? + // report('Unknown Node'); + // break; + } + } + const unusedParameters = new Set(); + function handleParameterDeclaration(identifier, parent) { + const name = identifier.getText(); + // regardless of if the parameter is ignored, track that it had a diagnostic fired on it + unusedParameters.add(identifier); + /* + NOTE - Typescript will automatically ignore parameters that have a + leading underscore in their name. We cannot do anything about this. + */ + function report() { + const node = parserServices.tsNodeToESTreeNodeMap.get(identifier); + context.report({ + node, + messageId: 'unused', + data: { + name, + type: 'Parameter', + }, + }); + } + const isLastParameter = parent.parent.parameters.indexOf(parent) === + parent.parent.parameters.length - 1; + if (!isLastParameter && options.ignoreArgsIfArgsAfterAreUsed) { + // once all diagnostics are processed, we can check if the following args are unused + afterAllDiagnosticsCallbacks.push(() => { + for (const param of parent.parent.parameters) { + if (!unusedParameters.has(param.name)) { + return; + } + } + // none of the following params were unused, so report + report(); + }); + } + else { + report(); + } + } + function handleImportDeclaration(parent) { + // the entire import statement is unused + /* + NOTE - Typescript will automatically ignore imports that have a + leading underscore in their name. We cannot do anything about this. + */ + context.report({ + messageId: 'unusedImport', + node: parserServices.tsNodeToESTreeNodeMap.get(parent), + }); + } + function handleDestructure(parent) { + // the entire destructure is unused + // note that this case only ever triggers for simple, single-level destructured objects + // i.e. these will not trigger it: + // - const {a:_a, b, c: {d}} = z; + // - const [a, b] = c; + parent.elements.forEach(element => { + if (element.kind === ts.SyntaxKind.BindingElement) { + const name = element.name; + if (name.kind === ts.SyntaxKind.Identifier) { + handleIdentifier(name); + } + } + }); + } + function handleTypeParamList(node) { + // the entire generic decl list is unused + /* + NOTE - Typescript will automatically ignore generics that have a + leading underscore in their name. We cannot do anything about this. + */ + const parent = parserServices.tsNodeToESTreeNodeMap.get(node); + context.report({ + messageId: 'unusedTypeParameters', + node: parent.typeParameters, + }); + } + function handleTypeParam(identifier) { + context.report({ + node: parserServices.tsNodeToESTreeNodeMap.get(identifier), + messageId: 'unused', + data: { + name: identifier.getText(), + type: 'Type Parameter', + }, + }); + } + return { + 'Program:exit'(program) { + const tsNode = parserServices.esTreeNodeToTSNodeMap.get(program); + const sourceFile = util.getSourceFileOfNode(tsNode); + const diagnostics = tsProgram.getSemanticDiagnostics(sourceFile); + diagnostics.forEach(diag => { + if (isUnusedDiagnostic(diag.code)) { + if (diag.start !== undefined) { + const node = util.getTokenAtPosition(sourceFile, diag.start); + const parent = node.parent; + if (isIdentifier(node)) { + handleIdentifier(node); + } + else if (isImport(parent)) { + handleImportDeclaration(parent); + } + else if (isDestructure(parent)) { + handleDestructure(parent); + } + else if (isGeneric(node, parent)) { + handleTypeParamList(parent); + } + } + } + }); + // trigger all the checks to be done after all the diagnostics have been evaluated + afterAllDiagnosticsCallbacks.forEach(cb => cb()); + }, + }; + }, +}); +/** + * Checks if the diagnostic code is one of the expected "unused var" codes + */ +function isUnusedDiagnostic(code) { + return [ + 6133, + 6138, + 6192, + 6196, + 6198, + 6199, + 6205, + ].includes(code); +} +/** + * Checks if the given node is a destructuring pattern + */ +function isDestructure(node) { + return (node.kind === ts.SyntaxKind.ObjectBindingPattern || + node.kind === ts.SyntaxKind.ArrayBindingPattern); +} +function isImport(node) { + return node.kind === ts.SyntaxKind.ImportDeclaration; +} +function isIdentifier(node) { + return node.kind === ts.SyntaxKind.Identifier; +} +function isGeneric(node, parent) { + return (node.kind === ts.SyntaxKind.LessThanToken && + parent.typeParameters !== undefined); +} +//# sourceMappingURL=no-unused-vars-experimental.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars-experimental.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars-experimental.js.map new file mode 100644 index 000000000..d5e15835d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars-experimental.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unused-vars-experimental.js","sourceRoot":"","sources":["../../src/rules/no-unused-vars-experimental.ts"],"names":[],"mappings":";AAAA,mCAAmC;;;;;;;;;;;;;;;;;;;;;;AAGnC,+CAAiC;AACjC,8CAAgC;AAkBnB,QAAA,4BAA4B,GAAG,IAAI,CAAC;AACjD,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,6BAA6B;IACnC,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,yCAAyC;YACtD,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,KAAK;SACnB;QACD,UAAU,EAAE,IAAI;QAChB,UAAU,EAAE,CAAC,gBAAgB,CAAC;QAC9B,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,iBAAiB,EAAE;wBACjB,KAAK,EAAE;4BACL;gCACE,IAAI,EAAE,QAAQ;6BACf;4BACD;gCACE,IAAI,EAAE,SAAS;gCACf,IAAI,EAAE,CAAC,KAAK,CAAC;6BACd;yBACF;qBACF;oBACD,4BAA4B,EAAE;wBAC5B,IAAI,EAAE,SAA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plugin/dist/rules/no-unused-vars.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js new file mode 100644 index 000000000..6d4d3bc00 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js @@ -0,0 +1,348 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const no_unused_vars_1 = __importDefault(require("eslint/lib/rules/no-unused-vars")); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-unused-vars', + meta: { + type: 'problem', + docs: { + description: 'Disallow unused variables', + category: 'Variables', + recommended: 'warn', + extendsBaseRule: true, + }, + schema: no_unused_vars_1.default.meta.schema, + messages: (_a = no_unused_vars_1.default.meta.messages) !== null && _a !== void 0 ? _a : { + unusedVar: "'{{varName}}' is {{action}} but never used{{additional}}.", + }, + }, + defaultOptions: [{}], + create(context) { + const rules = no_unused_vars_1.default.create(context); + const filename = context.getFilename(); + const MODULE_DECL_CACHE = new Map(); + /** + * Gets a list of TS module definitions for a specified variable. + * @param variable eslint-scope variable object. + */ + function getModuleNameDeclarations(variable) { + const moduleDeclarations = []; + variable.defs.forEach(def => { + if (def.type === 'TSModuleName') { + moduleDeclarations.push(def.node); + } + }); + return moduleDeclarations; + } + /** + * Determine if an identifier is referencing an enclosing name. + * This only applies to declarations that create their own scope (modules, functions, classes) + * @param ref The reference to check. + * @param nodes The candidate function nodes. + * @returns True if it's a self-reference, false if not. + */ + function isBlockSelfReference(ref, nodes) { + let scope = ref.from; + while (scope) { + if (nodes.indexOf(scope.block) >= 0) { + return true; + } + scope = scope.upper; + } + return false; + } + function isExported(variable, target) { + // TS will require that all merged namespaces/interfaces are exported, so we only need to find one + return variable.defs.some(def => { + var _a, _b; + return def.node.type === target && + (((_a = def.node.parent) === null || _a === void 0 ? void 0 : _a.type) === experimental_utils_1.AST_NODE_TYPES.ExportNamedDeclaration || + ((_b = def.node.parent) === null || _b === void 0 ? void 0 : _b.type) === experimental_utils_1.AST_NODE_TYPES.ExportDefaultDeclaration); + }); + } + return Object.assign(Object.assign({}, rules), { 'TSCallSignatureDeclaration, TSConstructorType, TSConstructSignatureDeclaration, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature'(node) { + // function type signature params create variables because they can be referenced within the signature, + // but they obviously aren't unused variables for the purposes of this rule. + for (const param of node.params) { + visitPattern(param, name => { + context.markVariableAsUsed(name.name); + }); + } + }, + TSEnumDeclaration() { + // enum members create variables because they can be referenced within the enum, + // but they obviously aren't unused variables for the purposes of this rule. + const scope = context.getScope(); + for (const variable of scope.variables) { + context.markVariableAsUsed(variable.name); + } + }, + TSMappedType(node) { + // mapped types create a variable for their type name, but it's not necessary to reference it, + // so we shouldn't consider it as unused for the purpose of this rule. + context.markVariableAsUsed(node.typeParameter.name.name); + }, + TSModuleDeclaration() { + const childScope = context.getScope(); + const scope = util.nullThrows(context.getScope().upper, util.NullThrowsReasons.MissingToken(childScope.type, 'upper scope')); + for (const variable of scope.variables) { + const moduleNodes = getModuleNameDeclarations(variable); + if (moduleNodes.length === 0 || + // ignore unreferenced module definitions, as the base rule will report on them + variable.references.length === 0 || + // ignore exported nodes + isExported(variable, experimental_utils_1.AST_NODE_TYPES.TSModuleDeclaration)) { + continue; + } + // check if the only reference to a module's name is a self-reference in its body + // this won't be caught by the base rule because it doesn't understand TS modules + const isOnlySelfReferenced = variable.references.every(ref => { + return isBlockSelfReference(ref, moduleNodes); + }); + if (isOnlySelfReferenced) { + context.report({ + node: variable.identifiers[0], + messageId: 'unusedVar', + data: { + varName: variable.name, + action: 'defined', + additional: '', + }, + }); + } + } + }, + [[ + 'TSParameterProperty > AssignmentPattern > Identifier.left', + 'TSParameterProperty > Identifier.parameter', + ].join(', ')](node) { + // just assume parameter properties are used as property usage tracking is beyond the scope of this rule + context.markVariableAsUsed(node.name); + }, + ':matches(FunctionDeclaration, FunctionExpression, ArrowFunctionExpression) > Identifier[name="this"].params'(node) { + // this parameters should always be considered used as they're pseudo-parameters + context.markVariableAsUsed(node.name); + }, + 'TSInterfaceDeclaration, TSTypeAliasDeclaration'(node) { + const variable = context.getScope().set.get(node.id.name); + if (!variable) { + return; + } + if (variable.references.length === 0 || + // ignore exported nodes + isExported(variable, node.type)) { + return; + } + // check if the type is only self-referenced + // this won't be caught by the base rule because it doesn't understand self-referencing types + const isOnlySelfReferenced = variable.references.every(ref => { + if (ref.identifier.range[0] >= node.range[0] && + ref.identifier.range[1] <= node.range[1]) { + return true; + } + return false; + }); + if (isOnlySelfReferenced) { + context.report({ + node: variable.identifiers[0], + messageId: 'unusedVar', + data: { + varName: variable.name, + action: 'defined', + additional: '', + }, + }); + } + }, + // declaration file handling + [ambientDeclarationSelector(experimental_utils_1.AST_NODE_TYPES.Program, true)](node) { + if (!util.isDefinitionFile(filename)) { + return; + } + markDeclarationChildAsUsed(node); + }, + // declared namespace handling + [ambientDeclarationSelector('TSModuleDeclaration[declare = true] > TSModuleBlock', false)](node) { + var _a; + const moduleDecl = util.nullThrows((_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent, util.NullThrowsReasons.MissingParent); + // declared modules with an `export =` statement will only export that one thing + // all other statements are not automatically exported in this case + if (checkModuleDeclForExportEquals(moduleDecl)) { + return; + } + markDeclarationChildAsUsed(node); + } }); + function checkModuleDeclForExportEquals(node) { + var _a, _b; + const cached = MODULE_DECL_CACHE.get(node); + if (cached != null) { + return cached; + } + for (const statement of (_b = (_a = node.body) === null || _a === void 0 ? void 0 : _a.body) !== null && _b !== void 0 ? _b : []) { + if (statement.type === experimental_utils_1.AST_NODE_TYPES.TSExportAssignment) { + MODULE_DECL_CACHE.set(node, true); + return true; + } + } + MODULE_DECL_CACHE.set(node, false); + return false; + } + function ambientDeclarationSelector(parent, childDeclare) { + return [ + // Types are ambiently exported + `${parent} > :matches(${[ + experimental_utils_1.AST_NODE_TYPES.TSInterfaceDeclaration, + experimental_utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration, + ].join(', ')})`, + // Value things are ambiently exported if they are "declare"d + `${parent} > :matches(${[ + experimental_utils_1.AST_NODE_TYPES.ClassDeclaration, + experimental_utils_1.AST_NODE_TYPES.TSDeclareFunction, + experimental_utils_1.AST_NODE_TYPES.TSEnumDeclaration, + experimental_utils_1.AST_NODE_TYPES.TSModuleDeclaration, + experimental_utils_1.AST_NODE_TYPES.VariableDeclaration, + ].join(', ')})${childDeclare ? '[declare=true]' : ''}`, + ].join(', '); + } + function markDeclarationChildAsUsed(node) { + var _a; + const identifiers = []; + switch (node.type) { + case experimental_utils_1.AST_NODE_TYPES.TSInterfaceDeclaration: + case experimental_utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration: + case experimental_utils_1.AST_NODE_TYPES.ClassDeclaration: + case experimental_utils_1.AST_NODE_TYPES.FunctionDeclaration: + case experimental_utils_1.AST_NODE_TYPES.TSDeclareFunction: + case experimental_utils_1.AST_NODE_TYPES.TSEnumDeclaration: + case experimental_utils_1.AST_NODE_TYPES.TSModuleDeclaration: + if (((_a = node.id) === null || _a === void 0 ? void 0 : _a.type) === experimental_utils_1.AST_NODE_TYPES.Identifier) { + identifiers.push(node.id); + } + break; + case experimental_utils_1.AST_NODE_TYPES.VariableDeclaration: + for (const declaration of node.declarations) { + visitPattern(declaration, pattern => { + identifiers.push(pattern); + }); + } + break; + } + const scope = context.getScope(); + const { variableScope } = scope; + if (variableScope !== scope) { + for (const id of identifiers) { + const superVar = variableScope.set.get(id.name); + if (superVar) { + superVar.eslintUsed = true; + } + } + } + else { + for (const id of identifiers) { + context.markVariableAsUsed(id.name); + } + } + } + function visitPattern(node, cb) { + const visitor = new scope_manager_1.PatternVisitor({}, node, cb); + visitor.visit(node); + } + }, +}); +/* + +###### TODO ###### + +Edge cases that aren't currently handled due to laziness and them being super edgy edge cases + + +--- function params referenced in typeof type refs in the function declaration --- +--- NOTE - TS gets these cases wrong + +function _foo( + arg: number // arg should be unused +): typeof arg { + return 1 as any; +} + +function _bar( + arg: number, // arg should be unused + _arg2: typeof arg, +) {} + + +--- function names referenced in typeof type refs in the function declaration --- +--- NOTE - TS gets these cases right + +function foo( // foo should be unused +): typeof foo { + return 1 as any; +} + +function bar( // bar should be unused + _arg: typeof bar +) {} + +*/ +/* + +###### TODO ###### + +We currently extend base `no-unused-vars` implementation because it's easier and lighter-weight. + +Because of this, there are a few false-negatives which won't get caught. +We could fix these if we fork the base rule; but that's a lot of code (~650 lines) to add in. +I didn't want to do that just yet without some real-world issues, considering these are pretty rare edge-cases. + +These cases are mishandled because the base rule assumes that each variable has one def, but type-value shadowing +creates a variable with two defs + +--- type-only or value-only references to type/value shadowed variables --- +--- NOTE - TS gets these cases wrong + +type T = 1; +const T = 2; // this T should be unused + +type U = T; // this U should be unused +const U = 3; + +const _V = U; + + +--- partially exported type/value shadowed variables --- +--- NOTE - TS gets these cases wrong + +export interface Foo {} +const Foo = 1; // this Foo should be unused + +interface Bar {} // this Bar should be unused +export const Bar = 1; + +*/ +//# sourceMappingURL=no-unused-vars.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js.map new file mode 100644 index 000000000..95f381532 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-unused-vars.js","sourceRoot":"","sources":["../../src/rules/no-unused-vars.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8EAI+C;AAC/C,oEAAkE;AAClE,qFAAuD;AACvD,8CAAgC;AAKhC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,2BAA2B;YACxC,QAAQ,EAAE,WAAW;YACrB,WAAW,EAAE,MAAM;YACnB,eAAe,EAAE,IAAI;SACtB;QACD,MAAM,EAAE,wBAAQ,CAAC,IAAI,CAAC,MAAM;QAC5B,QAAQ,QAAE,wBAAQ,CAAC,IAAI,CAAC,QAAQ,mCAAI;YAClC,SAAS,EAAE,2DAA2D;SACvE;KACF;IACD,cAAc,EAAE,CAAC,EAAE,CAAC;IACpB,MAAM,CAAC,OAAO;QACZ,MAAM,KAAK,GAAG,wBAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACvC,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;QACvC,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAyC,CAAC;QAE3E;;;WAGG;QACH,SAAS,yBAAyB,CAChC,QAAiC;YAEjC,MAAM,kBAAkB,GAAmC,EAAE,CAAC;YAE9D,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;gBAC1B,IAAI,GAAG,CAAC,IAAI,KAAK,cAAc,EAAE;oBAC/B,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;iBACnC;YACH,CAAC,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AK,MAAM,WAAW,IAAI,IAAI,CAAC,YAAY,EAAE;wBAC3C,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,EAAE;4BAClC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;wBAC5B,CAAC,CAAC,CAAC;qBACJ;oBACD,MAAM;aACT;YAED,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;YACjC,MAAM,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;YAChC,IAAI,aAAa,KAAK,KAAK,EAAE;gBAC3B,KAAK,MAAM,EAAE,IAAI,WAAW,EAAE;oBAC5B,MAAM,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;oBAChD,IAAI,QAAQ,EAAE;wBACZ,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAC;qBAC5B;iBACF;aACF;iBAAM;gBACL,KAAK,MAAM,EAAE,IAAI,WAAW,EAAE;oBAC5B,OAAO,CAAC,kBAAkB,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;iBACrC;aACF;QACH,CAAC;QAED,SAAS,YAAY,CACnB,IAAmB,EACnB,EAAuC;YAEvC,MAAM,OAAO,GAAG,IAAI,8BAAc,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;YACjD,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;CACF,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCE;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCE"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js new file mode 100644 index 000000000..64a01d1c2 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js @@ -0,0 +1,247 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +const SENTINEL_TYPE = /^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/; +/** + * Parses a given value as options. + */ +function parseOptions(options) { + let functions = true; + let classes = true; + let enums = true; + let variables = true; + let typedefs = true; + let ignoreTypeReferences = true; + if (typeof options === 'string') { + functions = options !== 'nofunc'; + } + else if (typeof options === 'object' && options !== null) { + functions = options.functions !== false; + classes = options.classes !== false; + enums = options.enums !== false; + variables = options.variables !== false; + typedefs = options.typedefs !== false; + ignoreTypeReferences = options.ignoreTypeReferences !== false; + } + return { + functions, + classes, + enums, + variables, + typedefs, + ignoreTypeReferences, + }; +} +/** + * Checks whether or not a given variable is a function declaration. + */ +function isFunction(variable) { + return variable.defs[0].type === 'FunctionName'; +} +/** + * Checks whether or not a given variable is a type declaration. + */ +function isTypedef(variable) { + return variable.defs[0].type === 'Type'; +} +/** + * Checks whether or not a given variable is a enum declaration. + */ +function isOuterEnum(variable, reference) { + return (variable.defs[0].type == 'TSEnumName' && + variable.scope.variableScope !== reference.from.variableScope); +} +/** + * Checks whether or not a given variable is a class declaration in an upper function scope. + */ +function isOuterClass(variable, reference) { + return (variable.defs[0].type === 'ClassName' && + variable.scope.variableScope !== reference.from.variableScope); +} +/** + * Checks whether or not a given variable is a variable declaration in an upper function scope. + */ +function isOuterVariable(variable, reference) { + return (variable.defs[0].type === 'Variable' && + variable.scope.variableScope !== reference.from.variableScope); +} +/** + * Checks whether or not a given location is inside of the range of a given node. + */ +function isInRange(node, location) { + return !!node && node.range[0] <= location && location <= node.range[1]; +} +/** + * Checks whether or not a given reference is inside of the initializers of a given variable. + * + * @returns `true` in the following cases: + * - var a = a + * - var [a = a] = list + * - var {a = a} = obj + * - for (var a in a) {} + * - for (var a of a) {} + */ +function isInInitializer(variable, reference) { + var _a; + if (variable.scope !== reference.from) { + return false; + } + let node = variable.identifiers[0].parent; + const location = reference.identifier.range[1]; + while (node) { + if (node.type === experimental_utils_1.AST_NODE_TYPES.VariableDeclarator) { + if (isInRange(node.init, location)) { + return true; + } + if (((_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent) && + (node.parent.parent.type === experimental_utils_1.AST_NODE_TYPES.ForInStatement || + node.parent.parent.type === experimental_utils_1.AST_NODE_TYPES.ForOfStatement) && + isInRange(node.parent.parent.right, location)) { + return true; + } + break; + } + else if (node.type === experimental_utils_1.AST_NODE_TYPES.AssignmentPattern) { + if (isInRange(node.right, location)) { + return true; + } + } + else if (SENTINEL_TYPE.test(node.type)) { + break; + } + node = node.parent; + } + return false; +} +exports.default = util.createRule({ + name: 'no-use-before-define', + meta: { + type: 'problem', + docs: { + description: 'Disallow the use of variables before they are defined', + category: 'Variables', + recommended: false, + extendsBaseRule: true, + }, + messages: { + noUseBeforeDefine: "'{{name}}' was used before it was defined.", + }, + schema: [ + { + oneOf: [ + { + enum: ['nofunc'], + }, + { + type: 'object', + properties: { + functions: { type: 'boolean' }, + classes: { type: 'boolean' }, + enums: { type: 'boolean' }, + variables: { type: 'boolean' }, + typedefs: { type: 'boolean' }, + ignoreTypeReferences: { type: 'boolean' }, + }, + additionalProperties: false, + }, + ], + }, + ], + }, + defaultOptions: [ + { + functions: true, + classes: true, + enums: true, + variables: true, + typedefs: true, + ignoreTypeReferences: true, + }, + ], + create(context, optionsWithDefault) { + const options = parseOptions(optionsWithDefault[0]); + /** + * Determines whether a given use-before-define case should be reported according to the options. + * @param variable The variable that gets used before being defined + * @param reference The reference to the variable + */ + function isForbidden(variable, reference) { + if (reference.isTypeReference && options.ignoreTypeReferences) { + return false; + } + if (isFunction(variable)) { + return options.functions; + } + if (isOuterClass(variable, reference)) { + return options.classes; + } + if (isOuterVariable(variable, reference)) { + return options.variables; + } + if (isOuterEnum(variable, reference)) { + return options.enums; + } + if (isTypedef(variable)) { + return options.typedefs; + } + return true; + } + /** + * Finds and validates all variables in a given scope. + */ + function findVariablesInScope(scope) { + scope.references.forEach(reference => { + const variable = reference.resolved; + // Skips when the reference is: + // - initializations. + // - referring to an undefined variable. + // - referring to a global environment variable (there're no identifiers). + // - located preceded by the variable (except in initializers). + // - allowed by options. + if (reference.init || + !variable || + variable.identifiers.length === 0 || + (variable.identifiers[0].range[1] <= reference.identifier.range[1] && + !isInInitializer(variable, reference)) || + !isForbidden(variable, reference)) { + return; + } + // Reports. + context.report({ + node: reference.identifier, + messageId: 'noUseBeforeDefine', + data: { + name: reference.identifier.name, + }, + }); + }); + scope.childScopes.forEach(findVariablesInScope); + } + return { + Program() { + findVariablesInScope(context.getScope()); + }, + }; + }, +}); +//# sourceMappingURL=no-use-before-define.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js.map new file mode 100644 index 000000000..4cfeb2fe6 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-use-before-define.js","sourceRoot":"","sources":["../../src/rules/no-use-before-define.ts"],"names":[],"mappings":";;;;;;;;;;;;;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_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js new file mode 100644 index 000000000..936e0839c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js @@ -0,0 +1,87 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const no_useless_constructor_1 = __importDefault(require("eslint/lib/rules/no-useless-constructor")); +const util = __importStar(require("../util")); +/** + * Check if method with accessibility is not useless + */ +function checkAccessibility(node) { + switch (node.accessibility) { + case 'protected': + case 'private': + return false; + case 'public': + if (node.parent && + node.parent.type === experimental_utils_1.AST_NODE_TYPES.ClassBody && + node.parent.parent && + 'superClass' in node.parent.parent && + node.parent.parent.superClass) { + return false; + } + break; + } + return true; +} +/** + * Check if method is not unless due to typescript parameter properties + */ +function checkParams(node) { + return (!node.value.params || + !node.value.params.some(param => param.type === experimental_utils_1.AST_NODE_TYPES.TSParameterProperty)); +} +exports.default = util.createRule({ + name: 'no-useless-constructor', + meta: { + type: 'problem', + docs: { + description: 'Disallow unnecessary constructors', + category: 'Best Practices', + recommended: false, + extendsBaseRule: true, + }, + schema: no_useless_constructor_1.default.meta.schema, + messages: (_a = no_useless_constructor_1.default.meta.messages) !== null && _a !== void 0 ? _a : { + noUselessConstructor: 'Useless constructor.', + }, + }, + defaultOptions: [], + create(context) { + const rules = no_useless_constructor_1.default.create(context); + return { + MethodDefinition(node) { + if (node.value && + node.value.type === experimental_utils_1.AST_NODE_TYPES.FunctionExpression && + node.value.body && + checkAccessibility(node) && + checkParams(node)) { + rules.MethodDefinition(node); + } + }, + }; + }, +}); +//# sourceMappingURL=no-useless-constructor.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js.map new file mode 100644 index 000000000..865009c38 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-useless-constructor.js","sourceRoot":"","sources":["../../src/rules/no-useless-constructor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,qGAA+D;AAC/D,8CAAgC;AAKhC;;GAEG;AACH,SAAS,kBAAkB,CAAC,IAA+B;IACzD,QAAQ,IAAI,CAAC,aAAa,EAAE;QAC1B,KAAK,WAAW,CAAC;QACjB,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC;QACf,KAAK,QAAQ;YACX,IACE,IAAI,CAAC,MAAM;gBACX,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,mCAAc,CAAC,SAAS;gBAC7C,IAAI,CAAC,MAAM,CAAC,MAAM;gBAClB,YAAY,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM;gBAClC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,EAC7B;gBACA,OAAO,KAAK,CAAC;aACd;YACD,MAAM;KACT;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAC,IAA+B;IAClD,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM;QAClB,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CACrB,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,mCAAc,CAAC,mBAAmB,CAC3D,CACF,CAAC;AACJ,CAAC;AAED,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,mCAAmC;YAChD,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,KAAK;YAClB,eAAe,EAAE,IAAI;SACtB;QACD,MAAM,EAAE,gCAAQ,CAAC,IAAI,CAAC,MAAM;QAC5B,QAAQ,QAAE,gCAAQ,CAAC,IAAI,CAAC,QAAQ,mCAAI;YAClC,oBAAoB,EAAE,sBAAsB;SAC7C;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,MAAM,KAAK,GAAG,gCAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACvC,OAAO;YACL,gBAAgB,CAAC,IAAI;gBACnB,IACE,IAAI,CAAC,KAAK;oBACV,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,mCAAc,CAAC,kBAAkB;oBACrD,IAAI,CAAC,KAAK,CAAC,IAAI;oBACf,kBAAkB,CAAC,IAAI,CAAC;oBACxB,WAAW,CAAC,IAAI,CAAC,EACjB;oBACA,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;iBAC9B;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-var-requires.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-var-requires.js new file mode 100644 index 000000000..c042fe09a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-var-requires.js @@ -0,0 +1,62 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-var-requires', + meta: { + type: 'problem', + docs: { + description: 'Disallows the use of require statements except in import statements', + category: 'Best Practices', + recommended: 'error', + }, + messages: { + noVarReqs: 'Require statement not part of import statement.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + return { + CallExpression(node) { + var _a; + const parent = ((_a = node.parent) === null || _a === void 0 ? void 0 : _a.type) === experimental_utils_1.AST_NODE_TYPES.ChainExpression + ? node.parent.parent + : node.parent; + if (node.callee.type === experimental_utils_1.AST_NODE_TYPES.Identifier && + node.callee.name === 'require' && + parent && + (parent.type === experimental_utils_1.AST_NODE_TYPES.VariableDeclarator || + parent.type === experimental_utils_1.AST_NODE_TYPES.CallExpression || + parent.type === experimental_utils_1.AST_NODE_TYPES.TSAsExpression || + parent.type === experimental_utils_1.AST_NODE_TYPES.MemberExpression)) { + context.report({ + node, + messageId: 'noVarReqs', + }); + } + }, + }; + }, +}); +//# sourceMappingURL=no-var-requires.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-var-requires.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-var-requires.js.map new file mode 100644 index 000000000..3d9eefcbf --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-var-requires.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-var-requires.js","sourceRoot":"","sources":["../../src/rules/no-var-requires.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,8CAAgC;AAKhC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EACT,qEAAqE;YACvE,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,OAAO;SACrB;QACD,QAAQ,EAAE;YACR,SAAS,EAAE,iDAAiD;SAC7D;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,cAAc,CAAC,IAA6B;;gBAC1C,MAAM,MAAM,GACV,OAAA,IAAI,CAAC,MAAM,0CAAE,IAAI,MAAK,mCAAc,CAAC,eAAe;oBAClD,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;oBACpB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;gBAClB,IACE,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,mCAAc,CAAC,UAAU;oBAC9C,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS;oBAC9B,MAAM;oBACN,CAAC,MAAM,CAAC,IAAI,KAAK,mCAAc,CAAC,kBAAkB;wBAChD,MAAM,CAAC,IAAI,KAAK,mCAAc,CAAC,cAAc;wBAC7C,MAAM,CAAC,IAAI,KAAK,mCAAc,CAAC,cAAc;wBAC7C,MAAM,CAAC,IAAI,KAAK,mCAAc,CAAC,gBAAgB,CAAC,EAClD;oBACA,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI;wBACJ,SAAS,EAAE,WAAW;qBACvB,CAAC,CAAC;iBACJ;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js new file mode 100644 index 000000000..caf2a55de --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js @@ -0,0 +1,88 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'prefer-as-const', + meta: { + type: 'suggestion', + docs: { + description: 'Prefer usage of `as const` over literal type', + category: 'Best Practices', + recommended: 'error', + suggestion: true, + }, + fixable: 'code', + messages: { + preferConstAssertion: 'Expected a `const` instead of a literal type assertion.', + variableConstAssertion: 'Expected a `const` assertion instead of a literal type annotation.', + variableSuggest: 'You should use `as const` instead of type annotation.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + function compareTypes(valueNode, typeNode, canFix) { + if (valueNode.type === experimental_utils_1.AST_NODE_TYPES.Literal && + typeNode.type === experimental_utils_1.AST_NODE_TYPES.TSLiteralType && + 'raw' in typeNode.literal && + valueNode.raw === typeNode.literal.raw) { + if (canFix) { + context.report({ + node: typeNode, + messageId: 'preferConstAssertion', + fix: fixer => fixer.replaceText(typeNode, 'const'), + }); + } + else { + context.report({ + node: typeNode, + messageId: 'variableConstAssertion', + suggest: [ + { + messageId: 'variableSuggest', + fix: (fixer) => [ + fixer.remove(typeNode.parent), + fixer.insertTextAfter(valueNode, ' as const'), + ], + }, + ], + }); + } + } + } + return { + TSAsExpression(node) { + compareTypes(node.expression, node.typeAnnotation, true); + }, + TSTypeAssertion(node) { + compareTypes(node.expression, node.typeAnnotation, true); + }, + VariableDeclarator(node) { + if (node.init && node.id.typeAnnotation) { + compareTypes(node.init, node.id.typeAnnotation.typeAnnotation, false); + } + }, + }; + }, +}); +//# sourceMappingURL=prefer-as-const.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js.map new file mode 100644 index 000000000..93e89b80a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-as-const.js","sourceRoot":"","sources":["../../src/rules/prefer-as-const.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAI+C;AAC/C,8CAAgC;AAEhC,kBAAe,IAAI,CAAC,UAAU,CAAC;IAC7B,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,8CAA8C;YAC3D,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,OAAO;YACpB,UAAU,EAAE,IAAI;SACjB;QACD,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE;YACR,oBAAoB,EAClB,yDAAyD;YAC3D,sBAAsB,EACpB,oEAAoE;YACtE,eAAe,EAAE,uDAAuD;SAC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AI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,CAAC,cAAc,EAAE;oBACvC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,cAAc,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;iBACvE;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.js new file mode 100644 index 000000000..f81e3dc4b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.js @@ -0,0 +1,85 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'prefer-enum-initializers', + meta: { + type: 'suggestion', + docs: { + description: 'Prefer initializing each enums member value', + category: 'Best Practices', + recommended: false, + suggestion: true, + }, + messages: { + defineInitializer: "The value of the member '{{ name }}' should be explicitly defined", + defineInitializerSuggestion: 'Can be fixed to {{ name }} = {{ suggested }}', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const sourceCode = context.getSourceCode(); + function TSEnumDeclaration(node) { + const { members } = node; + members.forEach((member, index) => { + if (member.initializer == null) { + const name = sourceCode.getText(member); + context.report({ + node: member, + messageId: 'defineInitializer', + data: { + name, + }, + suggest: [ + { + messageId: 'defineInitializerSuggestion', + data: { name, suggested: index }, + fix: (fixer) => { + return fixer.replaceText(member, `${name} = ${index}`); + }, + }, + { + messageId: 'defineInitializerSuggestion', + data: { name, suggested: index + 1 }, + fix: (fixer) => { + return fixer.replaceText(member, `${name} = ${index + 1}`); + }, + }, + { + messageId: 'defineInitializerSuggestion', + data: { name, suggested: `'${name}'` }, + fix: (fixer) => { + return fixer.replaceText(member, `${name} = '${name}'`); + }, + }, + ], + }); + } + }); + } + return { + TSEnumDeclaration, + }; + }, +}); +//# sourceMappingURL=prefer-enum-initializers.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.js.map new file mode 100644 index 000000000..5a2c3bf26 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-enum-initializers.js","sourceRoot":"","sources":["../../src/rules/prefer-enum-initializers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,8CAAgC;AAKhC,kBAAe,IAAI,CAAC,UAAU,CAAiB;IAC7C,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,6CAA6C;YAC1D,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,KAAK;YAClB,UAAU,EAAE,IAAI;SACjB;QACD,QAAQ,EAAE;YACR,iBAAiB,EACf,mEAAmE;YACrE,2BAA2B,EACzB,8CAA8C;SACjD;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,MAAM,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C;6BACF;yBACF;qBACF,CAAC,CAAC;iBACJ;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QAED,OAAO;YACL,iBAAiB;SAClB,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of.js new file mode 100644 index 000000000..acd31ea22 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of.js @@ -0,0 +1,178 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'prefer-for-of', + meta: { + type: 'suggestion', + docs: { + description: 'Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated', + category: 'Stylistic Issues', + recommended: false, + }, + messages: { + preferForOf: 'Expected a `for-of` loop instead of a `for` loop with this simple iteration.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + function isSingleVariableDeclaration(node) { + return (node !== null && + node.type === experimental_utils_1.AST_NODE_TYPES.VariableDeclaration && + node.kind !== 'const' && + node.declarations.length === 1); + } + function isLiteral(node, value) { + return node.type === experimental_utils_1.AST_NODE_TYPES.Literal && node.value === value; + } + function isZeroInitialized(node) { + return node.init !== null && isLiteral(node.init, 0); + } + function isMatchingIdentifier(node, name) { + return node.type === experimental_utils_1.AST_NODE_TYPES.Identifier && node.name === name; + } + function isLessThanLengthExpression(node, name) { + if (node !== null && + node.type === experimental_utils_1.AST_NODE_TYPES.BinaryExpression && + node.operator === '<' && + isMatchingIdentifier(node.left, name) && + node.right.type === experimental_utils_1.AST_NODE_TYPES.MemberExpression && + isMatchingIdentifier(node.right.property, 'length')) { + return node.right.object; + } + return null; + } + function isIncrement(node, name) { + if (!node) { + return false; + } + switch (node.type) { + case experimental_utils_1.AST_NODE_TYPES.UpdateExpression: + // x++ or ++x + return (node.operator === '++' && isMatchingIdentifier(node.argument, name)); + case experimental_utils_1.AST_NODE_TYPES.AssignmentExpression: + if (isMatchingIdentifier(node.left, name)) { + if (node.operator === '+=') { + // x += 1 + return isLiteral(node.right, 1); + } + else if (node.operator === '=') { + // x = x + 1 or x = 1 + x + const expr = node.right; + return (expr.type === experimental_utils_1.AST_NODE_TYPES.BinaryExpression && + expr.operator === '+' && + ((isMatchingIdentifier(expr.left, name) && + isLiteral(expr.right, 1)) || + (isLiteral(expr.left, 1) && + isMatchingIdentifier(expr.right, name)))); + } + } + } + return false; + } + function contains(outer, inner) { + return (outer.range[0] <= inner.range[0] && outer.range[1] >= inner.range[1]); + } + function isAssignee(node) { + var _a; + const parent = node.parent; + if (!parent) { + return false; + } + // a[i] = 1, a[i] += 1, etc. + if (parent.type === experimental_utils_1.AST_NODE_TYPES.AssignmentExpression && + parent.left === node) { + return true; + } + // delete a[i] + if (parent.type === experimental_utils_1.AST_NODE_TYPES.UnaryExpression && + parent.operator === 'delete' && + parent.argument === node) { + return true; + } + // a[i]++, --a[i], etc. + if (parent.type === experimental_utils_1.AST_NODE_TYPES.UpdateExpression && + parent.argument === node) { + return true; + } + // [a[i]] = [0] + if (parent.type === experimental_utils_1.AST_NODE_TYPES.ArrayPattern) { + return true; + } + // [...a[i]] = [0] + if (parent.type === experimental_utils_1.AST_NODE_TYPES.RestElement) { + return true; + } + // ({ foo: a[i] }) = { foo: 0 } + if (parent.type === experimental_utils_1.AST_NODE_TYPES.Property && + parent.value === node && + ((_a = parent.parent) === null || _a === void 0 ? void 0 : _a.type) === experimental_utils_1.AST_NODE_TYPES.ObjectExpression && + isAssignee(parent.parent)) { + return true; + } + return false; + } + function isIndexOnlyUsedWithArray(body, indexVar, arrayExpression) { + const sourceCode = context.getSourceCode(); + const arrayText = sourceCode.getText(arrayExpression); + return indexVar.references.every(reference => { + const id = reference.identifier; + const node = id.parent; + return (!contains(body, id) || + (node !== undefined && + node.type === experimental_utils_1.AST_NODE_TYPES.MemberExpression && + node.property === id && + sourceCode.getText(node.object) === arrayText && + !isAssignee(node))); + }); + } + return { + 'ForStatement:exit'(node) { + if (!isSingleVariableDeclaration(node.init)) { + return; + } + const declarator = node.init.declarations[0]; + if (!declarator || + !isZeroInitialized(declarator) || + declarator.id.type !== experimental_utils_1.AST_NODE_TYPES.Identifier) { + return; + } + const indexName = declarator.id.name; + const arrayExpression = isLessThanLengthExpression(node.test, indexName); + if (!arrayExpression) { + return; + } + const [indexVar] = context.getDeclaredVariables(node.init); + if (isIncrement(node.update, indexName) && + isIndexOnlyUsedWithArray(node.body, indexVar, arrayExpression)) { + context.report({ + node, + messageId: 'preferForOf', + }); + } + }, + }; + }, +}); +//# sourceMappingURL=prefer-for-of.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of.js.map new file mode 100644 index 000000000..b7cc1d994 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of.js.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-for-of.js","sourceRoot":"","sources":["../../src/rules/prefer-for-of.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;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U,CAAC,EAAE,CAAC,IAAI,KAAK,mCAAc,CAAC,UAAU,EAChD;oBACA,OAAO;iBACR;gBAED,MAAM,SAAS,GAAG,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC;gBACrC,MAAM,eAAe,GAAG,0BAA0B,CAChD,IAAI,CAAC,IAAI,EACT,SAAS,CACV,CAAC;gBACF,IAAI,CAAC,eAAe,EAAE;oBACpB,OAAO;iBACR;gBAED,MAAM,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC3D,IACE,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC;oBACnC,wBAAwB,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,eAAe,CAAC,EAC9D;oBACA,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI;wBACJ,SAAS,EAAE,aAAa;qBACzB,CAAC,CAAC;iBACJ;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.js new file mode 100644 index 000000000..0232f5109 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.js @@ -0,0 +1,137 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'prefer-function-type', + meta: { + docs: { + description: 'Use function types instead of interfaces with call signatures', + category: 'Best Practices', + recommended: false, + }, + fixable: 'code', + messages: { + functionTypeOverCallableType: "{{ type }} has only a call signature - use '{{ sigSuggestion }}' instead.", + }, + schema: [], + type: 'suggestion', + }, + defaultOptions: [], + create(context) { + const sourceCode = context.getSourceCode(); + /** + * Checks if there the interface has exactly one supertype that isn't named 'Function' + * @param node The node being checked + */ + function hasOneSupertype(node) { + if (!node.extends || node.extends.length === 0) { + return false; + } + if (node.extends.length !== 1) { + return true; + } + const expr = node.extends[0].expression; + return (expr.type !== experimental_utils_1.AST_NODE_TYPES.Identifier || expr.name !== 'Function'); + } + /** + * @param parent The parent of the call signature causing the diagnostic + */ + function shouldWrapSuggestion(parent) { + if (!parent) { + return false; + } + switch (parent.type) { + case experimental_utils_1.AST_NODE_TYPES.TSUnionType: + case experimental_utils_1.AST_NODE_TYPES.TSIntersectionType: + case experimental_utils_1.AST_NODE_TYPES.TSArrayType: + return true; + default: + return false; + } + } + /** + * @param call The call signature causing the diagnostic + * @param parent The parent of the call + * @returns The suggestion to report + */ + function renderSuggestion(call, parent) { + const start = call.range[0]; + const colonPos = call.returnType.range[0] - start; + const text = sourceCode.getText().slice(start, call.range[1]); + let suggestion = `${text.slice(0, colonPos)} =>${text.slice(colonPos + 1)}`; + if (shouldWrapSuggestion(parent.parent)) { + suggestion = `(${suggestion})`; + } + if (parent.type === experimental_utils_1.AST_NODE_TYPES.TSInterfaceDeclaration) { + if (typeof parent.typeParameters !== 'undefined') { + return `type ${sourceCode + .getText() + .slice(parent.id.range[0], parent.typeParameters.range[1])} = ${suggestion}`; + } + return `type ${parent.id.name} = ${suggestion}`; + } + return suggestion.endsWith(';') ? suggestion.slice(0, -1) : suggestion; + } + /** + * @param member The TypeElement being checked + * @param node The parent of member being checked + */ + function checkMember(member, node) { + if ((member.type === experimental_utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration || + member.type === experimental_utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration) && + typeof member.returnType !== 'undefined') { + const suggestion = renderSuggestion(member, node); + const fixStart = node.type === experimental_utils_1.AST_NODE_TYPES.TSTypeLiteral + ? node.range[0] + : sourceCode + .getTokens(node) + .filter(token => token.type === experimental_utils_1.AST_TOKEN_TYPES.Keyword && + token.value === 'interface')[0].range[0]; + context.report({ + node: member, + messageId: 'functionTypeOverCallableType', + data: { + type: node.type === experimental_utils_1.AST_NODE_TYPES.TSTypeLiteral + ? 'Type literal' + : 'Interface', + sigSuggestion: suggestion, + }, + fix(fixer) { + return fixer.replaceTextRange([fixStart, node.range[1]], suggestion); + }, + }); + } + } + return { + TSInterfaceDeclaration(node) { + if (!hasOneSupertype(node) && node.body.body.length === 1) { + checkMember(node.body.body[0], node); + } + }, + 'TSTypeLiteral[members.length = 1]'(node) { + checkMember(node.members[0], node); + }, + }; + }, +}); +//# sourceMappingURL=prefer-function-type.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.js.map new file mode 100644 index 000000000..177925f21 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.js.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-function-type.js","sourceRoot":"","sources":["../../src/rules/prefer-function-type.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAI+C;AAC/C,8CAAgC;AAEhC,kBAAe,IAAI,CAAC,UAAU,CAAC;IAC7B,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,WAAW,EACT,+DAA+D;YACjE,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YACrC,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-includes.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-includes.js new file mode 100644 index 000000000..e352e9645 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-includes.js @@ -0,0 +1,208 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const regexpp_1 = require("regexpp"); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = util_1.createRule({ + name: 'prefer-includes', + defaultOptions: [], + meta: { + type: 'suggestion', + docs: { + description: 'Enforce `includes` method over `indexOf` method', + category: 'Best Practices', + recommended: false, + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + preferIncludes: "Use 'includes()' method instead.", + preferStringIncludes: 'Use `String#includes()` method with a string instead.', + }, + schema: [], + }, + create(context) { + const globalScope = context.getScope(); + const services = util_1.getParserServices(context); + const types = services.program.getTypeChecker(); + function isNumber(node, value) { + const evaluated = util_1.getStaticValue(node, globalScope); + return evaluated !== null && evaluated.value === value; + } + function isPositiveCheck(node) { + switch (node.operator) { + case '!==': + case '!=': + case '>': + return isNumber(node.right, -1); + case '>=': + return isNumber(node.right, 0); + default: + return false; + } + } + function isNegativeCheck(node) { + switch (node.operator) { + case '===': + case '==': + case '<=': + return isNumber(node.right, -1); + case '<': + return isNumber(node.right, 0); + default: + return false; + } + } + function hasSameParameters(nodeA, nodeB) { + if (!ts.isFunctionLike(nodeA) || !ts.isFunctionLike(nodeB)) { + return false; + } + const paramsA = nodeA.parameters; + const paramsB = nodeB.parameters; + if (paramsA.length !== paramsB.length) { + return false; + } + for (let i = 0; i < paramsA.length; ++i) { + const paramA = paramsA[i]; + const paramB = paramsB[i]; + // Check name, type, and question token once. + if (paramA.getText() !== paramB.getText()) { + return false; + } + } + return true; + } + /** + * Parse a given node if it's a `RegExp` instance. + * @param node The node to parse. + */ + function parseRegExp(node) { + const evaluated = util_1.getStaticValue(node, globalScope); + if (evaluated == null || !(evaluated.value instanceof RegExp)) { + return null; + } + const { pattern, flags } = regexpp_1.parseRegExpLiteral(evaluated.value); + if (pattern.alternatives.length !== 1 || + flags.ignoreCase || + flags.global) { + return null; + } + // Check if it can determine a unique string. + const chars = pattern.alternatives[0].elements; + if (!chars.every(c => c.type === 'Character')) { + return null; + } + // To string. + return String.fromCodePoint(...chars.map(c => c.value)); + } + return { + [[ + // a.indexOf(b) !== 1 + "BinaryExpression > CallExpression.left > MemberExpression.callee[property.name='indexOf'][computed=false]", + // a?.indexOf(b) !== 1 + "BinaryExpression > ChainExpression.left > CallExpression > MemberExpression.callee[property.name='indexOf'][computed=false]", + ].join(', ')](node) { + var _a, _b, _c; + // Check if the comparison is equivalent to `includes()`. + const callNode = node.parent; + const compareNode = (((_a = callNode.parent) === null || _a === void 0 ? void 0 : _a.type) === + experimental_utils_1.AST_NODE_TYPES.ChainExpression + ? callNode.parent.parent + : callNode.parent); + const negative = isNegativeCheck(compareNode); + if (!negative && !isPositiveCheck(compareNode)) { + return; + } + // Get the symbol of `indexOf` method. + const tsNode = services.esTreeNodeToTSNodeMap.get(node.property); + const indexofMethodDeclarations = (_b = types + .getSymbolAtLocation(tsNode)) === null || _b === void 0 ? void 0 : _b.getDeclarations(); + if (indexofMethodDeclarations == null || + indexofMethodDeclarations.length === 0) { + return; + } + // Check if every declaration of `indexOf` method has `includes` method + // and the two methods have the same parameters. + for (const instanceofMethodDecl of indexofMethodDeclarations) { + const typeDecl = instanceofMethodDecl.parent; + const type = types.getTypeAtLocation(typeDecl); + const includesMethodDecl = (_c = type + .getProperty('includes')) === null || _c === void 0 ? void 0 : _c.getDeclarations(); + if (includesMethodDecl == null || + !includesMethodDecl.some(includesMethodDecl => hasSameParameters(includesMethodDecl, instanceofMethodDecl))) { + return; + } + } + // Report it. + context.report({ + node: compareNode, + messageId: 'preferIncludes', + *fix(fixer) { + if (negative) { + yield fixer.insertTextBefore(callNode, '!'); + } + yield fixer.replaceText(node.property, 'includes'); + yield fixer.removeRange([callNode.range[1], compareNode.range[1]]); + }, + }); + }, + // /bar/.test(foo) + 'CallExpression > MemberExpression.callee[property.name="test"][computed=false]'(node) { + var _a; + const callNode = node.parent; + const text = callNode.arguments.length === 1 ? parseRegExp(node.object) : null; + if (text == null) { + return; + } + //check the argument type of test methods + const argument = callNode.arguments[0]; + const tsNode = services.esTreeNodeToTSNodeMap.get(argument); + const type = util_1.getConstrainedTypeAtLocation(types, tsNode); + const includesMethodDecl = (_a = type + .getProperty('includes')) === null || _a === void 0 ? void 0 : _a.getDeclarations(); + if (includesMethodDecl == null) { + return; + } + context.report({ + node: callNode, + messageId: 'preferStringIncludes', + *fix(fixer) { + const argNode = callNode.arguments[0]; + const needsParen = argNode.type !== experimental_utils_1.AST_NODE_TYPES.Literal && + argNode.type !== experimental_utils_1.AST_NODE_TYPES.TemplateLiteral && + argNode.type !== experimental_utils_1.AST_NODE_TYPES.Identifier && + argNode.type !== experimental_utils_1.AST_NODE_TYPES.MemberExpression && + argNode.type !== experimental_utils_1.AST_NODE_TYPES.CallExpression; + yield fixer.removeRange([callNode.range[0], argNode.range[0]]); + if (needsParen) { + yield fixer.insertTextBefore(argNode, '('); + yield fixer.insertTextAfter(argNode, ')'); + } + yield fixer.insertTextAfter(argNode, `${node.optional ? '?.' : '.'}includes(${JSON.stringify(text)}`); + }, + }); + }, + }; + }, +}); +//# sourceMappingURL=prefer-includes.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-includes.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-includes.js.map new file mode 100644 index 000000000..b0f5b8056 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-includes.js.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-includes.js","sourceRoot":"","sources":["../../src/rules/prefer-includes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,qCAA+D;AAC/D,+CAAiC;AACjC,kCAKiB;AAEjB,kBAAe,iBAAU,CAAC;IACxB,IAAI,EAAE,iBAAiB;IACvB,cAAc,EAAE,EAAE;IAElB,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,iDAAiD;YAC9D,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,KAAK;YAClB,oBAAoB,EAAE,IAAI;SAC3B;QACD,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE;YACR,cAAc,EAAE,kCAAkC;YAClD,oBAAoB,EAClB,uDAAuD;SAC1D;QACD,MAAM,EAAE,EAAE;KACX;IAED,MAAM,CAAC,OAAO;QACZ,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;QACvC,MAAM,QAAQ,GAAG,wBAAiB,CAAC,OAAO,CAAC,CAAC;QAC5C,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;QAEhD,SAAS,QAAQ,CAAC,IAAmB,EAAE,KAAa;YAClD,MAAM,SAAS,GAAG,qBAAc,CAAC,IAAI,EA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M,CAAC;oBACb,IAAI,EAAE,QAAQ;oBACd,SAAS,EAAE,sBAAsB;oBACjC,CAAC,GAAG,CAAC,KAAK;wBACR,MAAM,OAAO,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;wBACtC,MAAM,UAAU,GACd,OAAO,CAAC,IAAI,KAAK,mCAAc,CAAC,OAAO;4BACvC,OAAO,CAAC,IAAI,KAAK,mCAAc,CAAC,eAAe;4BAC/C,OAAO,CAAC,IAAI,KAAK,mCAAc,CAAC,UAAU;4BAC1C,OAAO,CAAC,IAAI,KAAK,mCAAc,CAAC,gBAAgB;4BAChD,OAAO,CAAC,IAAI,KAAK,mCAAc,CAAC,cAAc,CAAC;wBAEjD,MAAM,KAAK,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;wBAC/D,IAAI,UAAU,EAAE;4BACd,MAAM,KAAK,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;4BAC3C,MAAM,KAAK,CAAC,eAAe,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;yBAC3C;wBACD,MAAM,KAAK,CAAC,eAAe,CACzB,OAAO,EACP,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,YAAY,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAChE,CAAC;oBACJ,CAAC;iBACF,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member.js new file mode 100644 index 000000000..475f4e7a4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util_1 = require("../util"); +exports.default = util_1.createRule({ + name: 'prefer-literal-enum-member', + meta: { + type: 'suggestion', + docs: { + description: 'Require that all enum members be literal values to prevent unintended enum member name shadow issues', + category: 'Best Practices', + recommended: false, + requiresTypeChecking: false, + }, + messages: { + notLiteral: `Explicit enum value must only be a literal value (string, number, boolean, etc).`, + }, + schema: [], + }, + defaultOptions: [], + create(context) { + return { + TSEnumMember(node) { + // If there is no initializer, then this node is just the name of the member, so ignore. + if (node.initializer == null) { + return; + } + // any old literal + if (node.initializer.type === experimental_utils_1.AST_NODE_TYPES.Literal) { + return; + } + // -1 and +1 + if (node.initializer.type === experimental_utils_1.AST_NODE_TYPES.UnaryExpression && + ['+', '-'].includes(node.initializer.operator) && + node.initializer.argument.type === experimental_utils_1.AST_NODE_TYPES.Literal) { + return; + } + context.report({ + node: node.id, + messageId: 'notLiteral', + }); + }, + }; + }, +}); +//# sourceMappingURL=prefer-literal-enum-member.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member.js.map new file mode 100644 index 000000000..9d5f03811 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member.js.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-literal-enum-member.js","sourceRoot":"","sources":["../../src/rules/prefer-literal-enum-member.ts"],"names":[],"mappings":";;AAAA,8EAAuE;AACvE,kCAAqC;AAErC,kBAAe,iBAAU,CAAC;IACxB,IAAI,EAAE,4BAA4B;IAClC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EACT,sGAAsG;YACxG,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,KAAK;YAClB,oBAAoB,EAAE,KAAK;SAC5B;QACD,QAAQ,EAAE;YACR,UAAU,EAAE,kFAAkF;SAC/F;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,YAAY,CAAC,IAAI;gBACf,wFAAwF;gBACxF,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,EAAE;oBAC5B,OAAO;iBACR;gBACD,kBAAkB;gBAClB,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,mCAAc,CAAC,OAAO,EAAE;oBACpD,OAAO;iBACR;gBACD,YAAY;gBACZ,IACE,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,mCAAc,CAAC,eAAe;oBACxD,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;oBAC9C,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,KAAK,mCAAc,CAAC,OAAO,EACzD;oBACA,OAAO;iBACR;gBAED,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI,EAAE,IAAI,CAAC,EAAE;oBACb,SAAS,EAAE,YAAY;iBACxB,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.js new file mode 100644 index 000000000..26303e792 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.js @@ -0,0 +1,65 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'prefer-namespace-keyword', + meta: { + type: 'suggestion', + docs: { + description: 'Require the use of the `namespace` keyword instead of the `module` keyword to declare custom TypeScript modules', + category: 'Best Practices', + recommended: 'error', + }, + fixable: 'code', + messages: { + useNamespace: "Use 'namespace' instead of 'module' to declare custom TypeScript modules.", + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const sourceCode = context.getSourceCode(); + return { + TSModuleDeclaration(node) { + // Do nothing if the name is a string. + if (!node.id || node.id.type === experimental_utils_1.AST_NODE_TYPES.Literal) { + return; + } + // Get tokens of the declaration header. + const moduleType = sourceCode.getTokenBefore(node.id); + if (moduleType && + moduleType.type === experimental_utils_1.AST_TOKEN_TYPES.Identifier && + moduleType.value === 'module') { + context.report({ + node, + messageId: 'useNamespace', + fix(fixer) { + return fixer.replaceText(moduleType, 'namespace'); + }, + }); + } + }, + }; + }, +}); +//# sourceMappingURL=prefer-namespace-keyword.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.js.map new file mode 100644 index 000000000..c4765a056 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.js.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-namespace-keyword.js","sourceRoot":"","sources":["../../src/rules/prefer-namespace-keyword.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,8CAAgC;AAEhC,kBAAe,IAAI,CAAC,UAAU,CAAC;IAC7B,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EACT,iHAAiH;YACnH,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,OAAO;SACrB;QACD,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE;YACR,YAAY,EACV,2EAA2E;SAC9E;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;QAE3C,OAAO;YACL,mBAAmB,CAAC,IAAI;gBACtB,sCAAsC;gBACtC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,mCAAc,CAAC,OAAO,EAAE;oBACvD,OAAO;iBACR;gBACD,wCAAwC;gBACxC,MAAM,UAAU,GAAG,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAEtD,IACE,UAAU;oBACV,UAAU,CAAC,IAAI,KAAK,oCAAe,CAAC,UAAU;oBAC9C,UAAU,CAAC,KAAK,KAAK,QAAQ,EAC7B;oBACA,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI;wBACJ,SAAS,EAAE,cAAc;wBACzB,GAAG,CAAC,KAAK;4BACP,OAAO,KAAK,CAAC,WAAW,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;wBACpD,CAAC;qBACF,CAAC,CAAC;iBACJ;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js new file mode 100644 index 000000000..840e5c3e2 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js @@ -0,0 +1,160 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'prefer-nullish-coalescing', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce the usage of the nullish coalescing operator instead of logical chaining', + category: 'Best Practices', + recommended: false, + suggestion: true, + requiresTypeChecking: true, + }, + messages: { + preferNullish: 'Prefer using nullish coalescing operator (`??`) instead of a logical or (`||`), as it is a safer operator.', + suggestNullish: 'Fix to nullish coalescing operator (`??`).', + }, + schema: [ + { + type: 'object', + properties: { + ignoreConditionalTests: { + type: 'boolean', + }, + ignoreMixedLogicalExpressions: { + type: 'boolean', + }, + forceSuggestionFixer: { + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], + }, + defaultOptions: [ + { + ignoreConditionalTests: true, + ignoreMixedLogicalExpressions: true, + }, + ], + create(context, [{ ignoreConditionalTests, ignoreMixedLogicalExpressions }]) { + const parserServices = util.getParserServices(context); + const sourceCode = context.getSourceCode(); + const checker = parserServices.program.getTypeChecker(); + return { + 'LogicalExpression[operator = "||"]'(node) { + const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node); + const type = checker.getTypeAtLocation(tsNode.left); + const isNullish = util.isNullableType(type, { allowUndefined: true }); + if (!isNullish) { + return; + } + if (ignoreConditionalTests === true && isConditionalTest(node)) { + return; + } + const isMixedLogical = isMixedLogicalExpression(node); + if (ignoreMixedLogicalExpressions === true && isMixedLogical) { + return; + } + const barBarOperator = util.nullThrows(sourceCode.getTokenAfter(node.left, token => token.type === experimental_utils_1.AST_TOKEN_TYPES.Punctuator && + token.value === node.operator), util.NullThrowsReasons.MissingToken('operator', node.type)); + function* fix(fixer) { + if (node.parent && util.isLogicalOrOperator(node.parent)) { + // '&&' and '??' operations cannot be mixed without parentheses (e.g. a && b ?? c) + if (node.left.type === experimental_utils_1.AST_NODE_TYPES.LogicalExpression && + !util.isLogicalOrOperator(node.left.left)) { + yield fixer.insertTextBefore(node.left.right, '('); + } + else { + yield fixer.insertTextBefore(node.left, '('); + } + yield fixer.insertTextAfter(node.right, ')'); + } + yield fixer.replaceText(barBarOperator, '??'); + } + context.report({ + node: barBarOperator, + messageId: 'preferNullish', + suggest: [ + { + messageId: 'suggestNullish', + fix, + }, + ], + }); + }, + }; + }, +}); +function isConditionalTest(node) { + const parents = new Set([node]); + let current = node.parent; + while (current) { + parents.add(current); + if ((current.type === experimental_utils_1.AST_NODE_TYPES.ConditionalExpression || + current.type === experimental_utils_1.AST_NODE_TYPES.DoWhileStatement || + current.type === experimental_utils_1.AST_NODE_TYPES.IfStatement || + current.type === experimental_utils_1.AST_NODE_TYPES.ForStatement || + current.type === experimental_utils_1.AST_NODE_TYPES.WhileStatement) && + parents.has(current.test)) { + return true; + } + if ([ + experimental_utils_1.AST_NODE_TYPES.ArrowFunctionExpression, + experimental_utils_1.AST_NODE_TYPES.FunctionExpression, + ].includes(current.type)) { + /** + * This is a weird situation like: + * `if (() => a || b) {}` + * `if (function () { return a || b }) {}` + */ + return false; + } + current = current.parent; + } + return false; +} +function isMixedLogicalExpression(node) { + const seen = new Set(); + const queue = [node.parent, node.left, node.right]; + for (const current of queue) { + if (seen.has(current)) { + continue; + } + seen.add(current); + if (current && current.type === experimental_utils_1.AST_NODE_TYPES.LogicalExpression) { + if (current.operator === '&&') { + return true; + } + else if (current.operator === '||') { + // check the pieces of the node to catch cases like `a || b || c && d` + queue.push(current.parent, current.left, current.right); + } + } + } + return false; +} +//# sourceMappingURL=prefer-nullish-coalescing.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js.map new file mode 100644 index 000000000..b46f8d4af --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-nullish-coalescing.js","sourceRoot":"","sources":["../../src/rules/prefer-nullish-coalescing.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAK+C;AAC/C,8CAAgC;AAUhC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,2BAA2B;IACjC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EACT,kFAAkF;YACpF,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,KAAK;YAClB,UAAU,EAAE,IAAI;YAChB,oBAAoB,EAAE,IAAI;SAC3B;QACD,QAAQ,EAAE;YACR,aAAa,EACX,4GAA4G;YAC9G,cAAc,EAAE,4CAA4C;SAC7D;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,sBAAsB,EAAE;wBACtB,IAAI,EAAE,SAAS;qBAChB;oBACD,6BAA6B,EAAE;wBAC7B,IAAI,EAAE,SAAS;qBAChB;oBACD,oBAAoB,EAAE;wBACpB,IAAI,EAAE,SAAS;qBAChB;iBACF;g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D;SACF;KACF;IAED,OAAO,KAAK,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js new file mode 100644 index 000000000..c8eb961b9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js @@ -0,0 +1,318 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +/* +The AST is always constructed such the first element is always the deepest element. + +I.e. for this code: `foo && foo.bar && foo.bar.baz && foo.bar.baz.buzz` +The AST will look like this: +{ + left: { + left: { + left: foo + right: foo.bar + } + right: foo.bar.baz + } + right: foo.bar.baz.buzz +} +*/ +exports.default = util.createRule({ + name: 'prefer-optional-chain', + meta: { + type: 'suggestion', + docs: { + description: 'Prefer using concise optional chain expressions instead of chained logical ands', + category: 'Best Practices', + recommended: false, + suggestion: true, + }, + messages: { + preferOptionalChain: "Prefer using an optional chain expression instead, as it's more concise and easier to read.", + optionalChainSuggest: 'Change to an optional chain.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const sourceCode = context.getSourceCode(); + return { + [[ + 'LogicalExpression[operator="&&"] > Identifier', + 'LogicalExpression[operator="&&"] > MemberExpression', + 'LogicalExpression[operator="&&"] > ChainExpression > MemberExpression', + 'LogicalExpression[operator="&&"] > BinaryExpression[operator="!=="]', + 'LogicalExpression[operator="&&"] > BinaryExpression[operator="!="]', + ].join(',')](initialIdentifierOrNotEqualsExpr) { + var _a; + // selector guarantees this cast + const initialExpression = (((_a = initialIdentifierOrNotEqualsExpr.parent) === null || _a === void 0 ? void 0 : _a.type) === experimental_utils_1.AST_NODE_TYPES.ChainExpression + ? initialIdentifierOrNotEqualsExpr.parent.parent + : initialIdentifierOrNotEqualsExpr.parent); + if (initialExpression.left !== initialIdentifierOrNotEqualsExpr) { + // the node(identifier or member expression) is not the deepest left node + return; + } + if (!isValidChainTarget(initialIdentifierOrNotEqualsExpr, true)) { + return; + } + // walk up the tree to figure out how many logical expressions we can include + let previous = initialExpression; + let current = initialExpression; + let previousLeftText = getText(initialIdentifierOrNotEqualsExpr); + let optionallyChainedCode = previousLeftText; + let expressionCount = 1; + while (current.type === experimental_utils_1.AST_NODE_TYPES.LogicalExpression) { + if (!isValidChainTarget(current.right, + // only allow identifiers for the first chain - foo && foo() + expressionCount === 1)) { + break; + } + const leftText = previousLeftText; + const rightText = getText(current.right); + // can't just use startsWith because of cases like foo && fooBar.baz; + const matchRegex = new RegExp(`^${ + // escape regex characters + leftText.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}[^a-zA-Z0-9_$]`); + if (!matchRegex.test(rightText) && + // handle redundant cases like foo.bar && foo.bar + leftText !== rightText) { + break; + } + // omit weird doubled up expression that make no sense like foo.bar && foo.bar + if (rightText !== leftText) { + expressionCount += 1; + previousLeftText = rightText; + /* + Diff the left and right text to construct the fix string + There are the following cases: + + 1) + rightText === 'foo.bar.baz.buzz' + leftText === 'foo.bar.baz' + diff === '.buzz' + + 2) + rightText === 'foo.bar.baz.buzz()' + leftText === 'foo.bar.baz' + diff === '.buzz()' + + 3) + rightText === 'foo.bar.baz.buzz()' + leftText === 'foo.bar.baz.buzz' + diff === '()' + + 4) + rightText === 'foo.bar.baz[buzz]' + leftText === 'foo.bar.baz' + diff === '[buzz]' + + 5) + rightText === 'foo.bar.baz?.buzz' + leftText === 'foo.bar.baz' + diff === '?.buzz' + */ + const diff = rightText.replace(leftText, ''); + if (diff.startsWith('?')) { + // item was "pre optional chained" + optionallyChainedCode += diff; + } + else { + const needsDot = diff.startsWith('(') || diff.startsWith('['); + optionallyChainedCode += `?${needsDot ? '.' : ''}${diff}`; + } + } + previous = current; + current = util.nullThrows(current.parent, util.NullThrowsReasons.MissingParent); + } + if (expressionCount > 1) { + if (previous.right.type === experimental_utils_1.AST_NODE_TYPES.BinaryExpression) { + // case like foo && foo.bar !== someValue + optionallyChainedCode += ` ${previous.right.operator} ${sourceCode.getText(previous.right.right)}`; + } + context.report({ + node: previous, + messageId: 'preferOptionalChain', + suggest: [ + { + messageId: 'optionalChainSuggest', + fix: (fixer) => [ + fixer.replaceText(previous, optionallyChainedCode), + ], + }, + ], + }); + } + }, + }; + function getText(node) { + if (node.type === experimental_utils_1.AST_NODE_TYPES.BinaryExpression) { + return getText( + // isValidChainTarget ensures this is type safe + node.left); + } + if (node.type === experimental_utils_1.AST_NODE_TYPES.CallExpression) { + const calleeText = getText( + // isValidChainTarget ensures this is type safe + node.callee); + // ensure that the call arguments are left untouched, or else we can break cases that _need_ whitespace: + // - JSX: + // - Unary Operators: typeof foo, await bar, delete baz + const closingParenToken = util.nullThrows(sourceCode.getLastToken(node), util.NullThrowsReasons.MissingToken('closing parenthesis', node.type)); + const openingParenToken = util.nullThrows(sourceCode.getFirstTokenBetween(node.callee, closingParenToken, util.isOpeningParenToken), util.NullThrowsReasons.MissingToken('opening parenthesis', node.type)); + const argumentsText = sourceCode.text.substring(openingParenToken.range[0], closingParenToken.range[1]); + return `${calleeText}${argumentsText}`; + } + if (node.type === experimental_utils_1.AST_NODE_TYPES.Identifier) { + return node.name; + } + if (node.type === experimental_utils_1.AST_NODE_TYPES.ThisExpression) { + return 'this'; + } + if (node.type === experimental_utils_1.AST_NODE_TYPES.ChainExpression) { + /* istanbul ignore if */ if (node.expression.type === experimental_utils_1.AST_NODE_TYPES.TSNonNullExpression) { + // this shouldn't happen + return ''; + } + return getText(node.expression); + } + return getMemberExpressionText(node); + } + /** + * Gets a normalized representation of the given MemberExpression + */ + function getMemberExpressionText(node) { + let objectText; + // cases should match the list in ALLOWED_MEMBER_OBJECT_TYPES + switch (node.object.type) { + case experimental_utils_1.AST_NODE_TYPES.CallExpression: + case experimental_utils_1.AST_NODE_TYPES.Identifier: + objectText = getText(node.object); + break; + case experimental_utils_1.AST_NODE_TYPES.MemberExpression: + objectText = getMemberExpressionText(node.object); + break; + case experimental_utils_1.AST_NODE_TYPES.ThisExpression: + objectText = getText(node.object); + break; + /* istanbul ignore next */ + default: + throw new Error(`Unexpected member object type: ${node.object.type}`); + } + let propertyText; + if (node.computed) { + // cases should match the list in ALLOWED_COMPUTED_PROP_TYPES + switch (node.property.type) { + case experimental_utils_1.AST_NODE_TYPES.Identifier: + propertyText = getText(node.property); + break; + case experimental_utils_1.AST_NODE_TYPES.Literal: + case experimental_utils_1.AST_NODE_TYPES.TemplateLiteral: + propertyText = sourceCode.getText(node.property); + break; + case experimental_utils_1.AST_NODE_TYPES.MemberExpression: + propertyText = getMemberExpressionText(node.property); + break; + /* istanbul ignore next */ + default: + throw new Error(`Unexpected member property type: ${node.object.type}`); + } + return `${objectText}${node.optional ? '?.' : ''}[${propertyText}]`; + } + else { + // cases should match the list in ALLOWED_NON_COMPUTED_PROP_TYPES + switch (node.property.type) { + case experimental_utils_1.AST_NODE_TYPES.Identifier: + propertyText = getText(node.property); + break; + /* istanbul ignore next */ + default: + throw new Error(`Unexpected member property type: ${node.object.type}`); + } + return `${objectText}${node.optional ? '?.' : '.'}${propertyText}`; + } + } + }, +}); +const ALLOWED_MEMBER_OBJECT_TYPES = new Set([ + experimental_utils_1.AST_NODE_TYPES.CallExpression, + experimental_utils_1.AST_NODE_TYPES.Identifier, + experimental_utils_1.AST_NODE_TYPES.MemberExpression, + experimental_utils_1.AST_NODE_TYPES.ThisExpression, +]); +const ALLOWED_COMPUTED_PROP_TYPES = new Set([ + experimental_utils_1.AST_NODE_TYPES.Identifier, + experimental_utils_1.AST_NODE_TYPES.Literal, + experimental_utils_1.AST_NODE_TYPES.MemberExpression, + experimental_utils_1.AST_NODE_TYPES.TemplateLiteral, +]); +const ALLOWED_NON_COMPUTED_PROP_TYPES = new Set([ + experimental_utils_1.AST_NODE_TYPES.Identifier, +]); +function isValidChainTarget(node, allowIdentifier) { + if (node.type === experimental_utils_1.AST_NODE_TYPES.ChainExpression) { + return isValidChainTarget(node.expression, allowIdentifier); + } + if (node.type === experimental_utils_1.AST_NODE_TYPES.MemberExpression) { + const isObjectValid = ALLOWED_MEMBER_OBJECT_TYPES.has(node.object.type) && + // make sure to validate the expression is of our expected structure + isValidChainTarget(node.object, true); + const isPropertyValid = node.computed + ? ALLOWED_COMPUTED_PROP_TYPES.has(node.property.type) && + // make sure to validate the member expression is of our expected structure + (node.property.type === experimental_utils_1.AST_NODE_TYPES.MemberExpression + ? isValidChainTarget(node.property, allowIdentifier) + : true) + : ALLOWED_NON_COMPUTED_PROP_TYPES.has(node.property.type); + return isObjectValid && isPropertyValid; + } + if (node.type === experimental_utils_1.AST_NODE_TYPES.CallExpression) { + return isValidChainTarget(node.callee, allowIdentifier); + } + if (allowIdentifier && + (node.type === experimental_utils_1.AST_NODE_TYPES.Identifier || + node.type === experimental_utils_1.AST_NODE_TYPES.ThisExpression)) { + return true; + } + /* + special case for the following, where we only want the left + - foo !== null + - foo != null + - foo !== undefined + - foo != undefined + */ + if (node.type === experimental_utils_1.AST_NODE_TYPES.BinaryExpression && + ['!==', '!='].includes(node.operator) && + isValidChainTarget(node.left, allowIdentifier)) { + if (node.right.type === experimental_utils_1.AST_NODE_TYPES.Identifier && + node.right.name === 'undefined') { + return true; + } + if (node.right.type === experimental_utils_1.AST_NODE_TYPES.Literal && + node.right.value === null) { + return true; + } + } + return false; +} +//# sourceMappingURL=prefer-optional-chain.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js.map new file mode 100644 index 000000000..1ce75dd7a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-optional-chain.js","sourceRoot":"","sources":["../../src/rules/prefer-optional-chain.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAI+C;AAC/C,8CAAgC;AAUhC;;;;;;;;;;;;;;;EAeE;AAEF,kBAAe,IAAI,CAAC,UAAU,CAAC;IAC7B,IAAI,EAAE,uBAAuB;IAC7B,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EACT,iFAAiF;YACnF,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,KAAK;YAClB,UAAU,EAAE,IAAI;SACjB;QACD,QAAQ,EAAE;YACR,mBAAmB,EACjB,6FAA6F;YAC/F,oBAAoB,EAAE,8BAA8B;SACrD;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;QAC3C,OAAO;YACL,CAAC;gBACC,+CAA+C;gBAC/C,qDAAqD;gBACrD,uEAAuE;gBACvE,qEAAqE;gBACrE,oEAAoE;aACrE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CACV,gCAG6B;;gBAE7B,gCAAgC;gBAChC,MAAM,iBAAiB,GAAG,CAAC,OAAA,gCAAgC,CAAC,MAAM,0CAC9D,IAAI,MAAK,mCAAc,CAAC,eAAe;oBACzC,CAAC,CAAC,gCAAgC,CAAC,MAAM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BAAgB;QAC7C,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC;QACrC,kBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,eAAe,CAAC,EAC9C;QACA,IACE,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,mCAAc,CAAC,UAAU;YAC7C,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,WAAW,EAC/B;YACA,OAAO,IAAI,CAAC;SACb;QACD,IACE,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,mCAAc,CAAC,OAAO;YAC1C,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,IAAI,EACzB;YACA,OAAO,IAAI,CAAC;SACb;KACF;IAED,OAAO,KAAK,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly-parameter-types.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly-parameter-types.js new file mode 100644 index 000000000..1c7904954 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly-parameter-types.js @@ -0,0 +1,91 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'prefer-readonly-parameter-types', + meta: { + type: 'suggestion', + docs: { + description: 'Requires that function parameters are typed as readonly to prevent accidental mutation of inputs', + category: 'Possible Errors', + recommended: false, + requiresTypeChecking: true, + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + checkParameterProperties: { + type: 'boolean', + }, + }, + }, + ], + messages: { + shouldBeReadonly: 'Parameter should be a read only type.', + }, + }, + defaultOptions: [ + { + checkParameterProperties: true, + }, + ], + create(context, [{ checkParameterProperties }]) { + const { esTreeNodeToTSNodeMap, program } = util.getParserServices(context); + const checker = program.getTypeChecker(); + return { + [[ + experimental_utils_1.AST_NODE_TYPES.ArrowFunctionExpression, + experimental_utils_1.AST_NODE_TYPES.FunctionDeclaration, + experimental_utils_1.AST_NODE_TYPES.FunctionExpression, + experimental_utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration, + experimental_utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration, + experimental_utils_1.AST_NODE_TYPES.TSDeclareFunction, + experimental_utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression, + experimental_utils_1.AST_NODE_TYPES.TSFunctionType, + experimental_utils_1.AST_NODE_TYPES.TSMethodSignature, + ].join(', ')](node) { + for (const param of node.params) { + if (!checkParameterProperties && + param.type === experimental_utils_1.AST_NODE_TYPES.TSParameterProperty) { + continue; + } + const actualParam = param.type === experimental_utils_1.AST_NODE_TYPES.TSParameterProperty + ? param.parameter + : param; + const tsNode = esTreeNodeToTSNodeMap.get(actualParam); + const type = checker.getTypeAtLocation(tsNode); + const isReadOnly = util.isTypeReadonly(checker, type); + if (!isReadOnly) { + context.report({ + node: actualParam, + messageId: 'shouldBeReadonly', + }); + } + } + }, + }; + }, +}); +//# sourceMappingURL=prefer-readonly-parameter-types.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly-parameter-types.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly-parameter-types.js.map new file mode 100644 index 000000000..be616c825 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly-parameter-types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-readonly-parameter-types.js","sourceRoot":"","sources":["../../src/rules/prefer-readonly-parameter-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,8CAAgC;AAShC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,iCAAiC;IACvC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EACT,kGAAkG;YACpG,QAAQ,EAAE,iBAAiB;YAC3B,WAAW,EAAE,KAAK;YAClB,oBAAoB,EAAE,IAAI;SAC3B;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,oBAAoB,EAAE,KAAK;gBAC3B,UAAU,EAAE;oBACV,wBAAwB,EAAE;wBACxB,IAAI,EAAE,SAAS;qBAChB;iBACF;aACF;SACF;QACD,QAAQ,EAAE;YACR,gBAAgB,EAAE,uCAAuC;SAC1D;KACF;IACD,cAAc,EAAE;QACd;YACE,wBAAwB,EAAE,IAAI;SAC/B;KACF;IACD,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE,wBAAwB,EAAE,CAAC;QAC5C,MAAM,EAAE,qBAAqB,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3E,MAAM,OAAO,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;QAEzC,OAAO;YACL,CAAC;gBACC,mCAAc,CAAC,uBAAuB;gBACtC,mCAAc,CAAC,mBAAmB;gBAClC,mCAAc,CAAC,kBAAkB;gBACjC,mCAAc,CAAC,0BAA0B;gBACzC,mCAAc,CAAC,+BAA+B;gBAC9C,mCAAc,CAAC,iBAAiB;gBAChC,mCAAc,CAAC,6BAA6B;gBAC5C,mCAAc,CAAC,cAAc;gBAC7B,mCAAc,CAAC,iBAAiB;aACjC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CACX,IAS8B;gBAE9B,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE;oBAC/B,IACE,CAAC,wBAAwB;wBACzB,KAAK,CAAC,IAAI,KAAK,mCAAc,CAAC,mBAAmB,EACjD;wBACA,SAAS;qBACV;oBAED,MAAM,WAAW,GACf,KAAK,CAAC,IAAI,KAAK,mCAAc,CAAC,mBAAmB;wBAC/C,CAAC,CAAC,KAAK,CAAC,SAAS;wBACjB,CAAC,CAAC,KAAK,CAAC;oBACZ,MAAM,MAAM,GAAG,qBAAqB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;oBACtD,MAAM,IAAI,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;oBAC/C,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;oBAEtD,IAAI,CAAC,UAAU,EAAE;wBACf,OAAO,CAAC,MAAM,CAAC;4BACb,IAAI,EAAE,WAAW;4BACjB,SAAS,EAAE,kBAAkB;yBAC9B,CAAC,CAAC;qBACJ;iBACF;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.js new file mode 100644 index 000000000..ede07d7ec --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.js @@ -0,0 +1,265 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const tsutils = __importStar(require("tsutils")); +const ts = __importStar(require("typescript")); +const util = __importStar(require("../util")); +const util_1 = require("../util"); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const functionScopeBoundaries = [ + experimental_utils_1.AST_NODE_TYPES.ArrowFunctionExpression, + experimental_utils_1.AST_NODE_TYPES.FunctionDeclaration, + experimental_utils_1.AST_NODE_TYPES.FunctionExpression, + experimental_utils_1.AST_NODE_TYPES.MethodDefinition, +].join(', '); +exports.default = util.createRule({ + name: 'prefer-readonly', + meta: { + docs: { + description: "Requires that private members are marked as `readonly` if they're never modified outside of the constructor", + category: 'Best Practices', + recommended: false, + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + preferReadonly: "Member '{{name}}' is never reassigned; mark it as `readonly`.", + }, + schema: [ + { + allowAdditionalProperties: false, + properties: { + onlyInlineLambdas: { + type: 'boolean', + }, + }, + type: 'object', + }, + ], + type: 'suggestion', + }, + defaultOptions: [{ onlyInlineLambdas: false }], + create(context, [{ onlyInlineLambdas }]) { + const parserServices = util.getParserServices(context); + const checker = parserServices.program.getTypeChecker(); + const classScopeStack = []; + function handlePropertyAccessExpression(node, parent, classScope) { + if (ts.isBinaryExpression(parent)) { + handleParentBinaryExpression(node, parent, classScope); + return; + } + if (ts.isDeleteExpression(parent) || isDestructuringAssignment(node)) { + classScope.addVariableModification(node); + return; + } + if (ts.isPostfixUnaryExpression(parent) || + ts.isPrefixUnaryExpression(parent)) { + handleParentPostfixOrPrefixUnaryExpression(parent, classScope); + } + } + function handleParentBinaryExpression(node, parent, classScope) { + if (parent.left === node && + tsutils.isAssignmentKind(parent.operatorToken.kind)) { + classScope.addVariableModification(node); + } + } + function handleParentPostfixOrPrefixUnaryExpression(node, classScope) { + if (node.operator === ts.SyntaxKind.PlusPlusToken || + node.operator === ts.SyntaxKind.MinusMinusToken) { + classScope.addVariableModification(node.operand); + } + } + function isDestructuringAssignment(node) { + let current = node.parent; + while (current) { + const parent = current.parent; + if (ts.isObjectLiteralExpression(parent) || + ts.isArrayLiteralExpression(parent) || + ts.isSpreadAssignment(parent) || + (ts.isSpreadElement(parent) && + ts.isArrayLiteralExpression(parent.parent))) { + current = parent; + } + else if (ts.isBinaryExpression(parent)) { + return (parent.left === current && + parent.operatorToken.kind === ts.SyntaxKind.EqualsToken); + } + else { + break; + } + } + return false; + } + function isConstructor(node) { + return (node.type === experimental_utils_1.AST_NODE_TYPES.MethodDefinition && + node.kind === 'constructor'); + } + function isFunctionScopeBoundaryInStack(node) { + if (classScopeStack.length === 0) { + return false; + } + const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node); + if (ts.isConstructorDeclaration(tsNode)) { + return false; + } + return tsutils.isFunctionScopeBoundary(tsNode); + } + function getEsNodesFromViolatingNode(violatingNode) { + if (ts.isParameterPropertyDeclaration(violatingNode, violatingNode.parent)) { + return { + esNode: parserServices.tsNodeToESTreeNodeMap.get(violatingNode.name), + nameNode: parserServices.tsNodeToESTreeNodeMap.get(violatingNode.name), + }; + } + return { + esNode: parserServices.tsNodeToESTreeNodeMap.get(violatingNode), + nameNode: parserServices.tsNodeToESTreeNodeMap.get(violatingNode.name), + }; + } + return { + 'ClassDeclaration, ClassExpression'(node) { + classScopeStack.push(new ClassScope(checker, parserServices.esTreeNodeToTSNodeMap.get(node), onlyInlineLambdas)); + }, + 'ClassDeclaration, ClassExpression:exit'() { + const finalizedClassScope = classScopeStack.pop(); + const sourceCode = context.getSourceCode(); + for (const violatingNode of finalizedClassScope.finalizeUnmodifiedPrivateNonReadonlys()) { + const { esNode, nameNode } = getEsNodesFromViolatingNode(violatingNode); + context.report({ + data: { + name: sourceCode.getText(nameNode), + }, + fix: fixer => fixer.insertTextBefore(nameNode, 'readonly '), + messageId: 'preferReadonly', + node: esNode, + }); + } + }, + MemberExpression(node) { + if (classScopeStack.length !== 0 && !node.computed) { + const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node); + handlePropertyAccessExpression(tsNode, tsNode.parent, classScopeStack[classScopeStack.length - 1]); + } + }, + [functionScopeBoundaries](node) { + if (isConstructor(node)) { + classScopeStack[classScopeStack.length - 1].enterConstructor(parserServices.esTreeNodeToTSNodeMap.get(node)); + } + else if (isFunctionScopeBoundaryInStack(node)) { + classScopeStack[classScopeStack.length - 1].enterNonConstructor(); + } + }, + [`${functionScopeBoundaries}:exit`](node) { + if (isConstructor(node)) { + classScopeStack[classScopeStack.length - 1].exitConstructor(); + } + else if (isFunctionScopeBoundaryInStack(node)) { + classScopeStack[classScopeStack.length - 1].exitNonConstructor(); + } + }, + }; + }, +}); +const OUTSIDE_CONSTRUCTOR = -1; +const DIRECTLY_INSIDE_CONSTRUCTOR = 0; +class ClassScope { + constructor(checker, classNode, onlyInlineLambdas) { + this.checker = checker; + this.onlyInlineLambdas = onlyInlineLambdas; + this.privateModifiableMembers = new Map(); + this.privateModifiableStatics = new Map(); + this.memberVariableModifications = new Set(); + this.staticVariableModifications = new Set(); + this.constructorScopeDepth = OUTSIDE_CONSTRUCTOR; + this.checker = checker; + this.classType = checker.getTypeAtLocation(classNode); + for (const member of classNode.members) { + if (ts.isPropertyDeclaration(member)) { + this.addDeclaredVariable(member); + } + } + } + addDeclaredVariable(node) { + if (!tsutils.isModifierFlagSet(node, ts.ModifierFlags.Private) || + tsutils.isModifierFlagSet(node, ts.ModifierFlags.Readonly) || + ts.isComputedPropertyName(node.name)) { + return; + } + if (this.onlyInlineLambdas && + node.initializer !== undefined && + !ts.isArrowFunction(node.initializer)) { + return; + } + (tsutils.isModifierFlagSet(node, ts.ModifierFlags.Static) + ? this.privateModifiableStatics + : this.privateModifiableMembers).set(node.name.getText(), node); + } + addVariableModification(node) { + const modifierType = this.checker.getTypeAtLocation(node.expression); + if (!modifierType.getSymbol() || + !util_1.typeIsOrHasBaseType(modifierType, this.classType)) { + return; + } + const modifyingStatic = tsutils.isObjectType(modifierType) && + tsutils.isObjectFlagSet(modifierType, ts.ObjectFlags.Anonymous); + if (!modifyingStatic && + this.constructorScopeDepth === DIRECTLY_INSIDE_CONSTRUCTOR) { + return; + } + (modifyingStatic + ? this.staticVariableModifications + : this.memberVariableModifications).add(node.name.text); + } + enterConstructor(node) { + this.constructorScopeDepth = DIRECTLY_INSIDE_CONSTRUCTOR; + for (const parameter of node.parameters) { + if (tsutils.isModifierFlagSet(parameter, ts.ModifierFlags.Private)) { + this.addDeclaredVariable(parameter); + } + } + } + exitConstructor() { + this.constructorScopeDepth = OUTSIDE_CONSTRUCTOR; + } + enterNonConstructor() { + if (this.constructorScopeDepth !== OUTSIDE_CONSTRUCTOR) { + this.constructorScopeDepth += 1; + } + } + exitNonConstructor() { + if (this.constructorScopeDepth !== OUTSIDE_CONSTRUCTOR) { + this.constructorScopeDepth -= 1; + } + } + finalizeUnmodifiedPrivateNonReadonlys() { + this.memberVariableModifications.forEach(variableName => { + this.privateModifiableMembers.delete(variableName); + }); + this.staticVariableModifications.forEach(variableName => { + this.privateModifiableStatics.delete(variableName); + }); + return [ + ...Array.from(this.privateModifiableMembers.values()), + ...Array.from(this.privateModifiableStatics.values()), + ]; + } +} +//# sourceMappingURL=prefer-readonly.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.js.map new file mode 100644 index 000000000..1aae677d9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.js.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-readonly.js","sourceRoot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IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;QAEH,OAAO;YACL,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,wBAAwB,CAAC,MAAM,EAAE,CAAC;YACrD,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,wBAAwB,CAAC,MAAM,EAAE,CAAC;SACtD,CAAC;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter.js new file mode 100644 index 000000000..d10847962 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter.js @@ -0,0 +1,92 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +const getMemberExpressionName = (member) => { + if (!member.computed) { + return member.property.name; + } + if (member.property.type === experimental_utils_1.AST_NODE_TYPES.Literal && + typeof member.property.value === 'string') { + return member.property.value; + } + return null; +}; +exports.default = util.createRule({ + name: 'prefer-reduce-type-parameter', + meta: { + type: 'problem', + docs: { + category: 'Best Practices', + recommended: false, + description: 'Prefer using type parameter when calling `Array#reduce` instead of casting', + requiresTypeChecking: true, + }, + messages: { + preferTypeParameter: 'Unnecessary cast: Array#reduce accepts a type parameter for the default value.', + }, + fixable: 'code', + schema: [], + }, + defaultOptions: [], + create(context) { + const service = util.getParserServices(context); + const checker = service.program.getTypeChecker(); + return { + 'CallExpression > MemberExpression.callee'(callee) { + if (getMemberExpressionName(callee) !== 'reduce') { + return; + } + const [, secondArg] = callee.parent.arguments; + if (callee.parent.arguments.length < 2 || + !util.isTypeAssertion(secondArg)) { + return; + } + // Get the symbol of the `reduce` method. + const tsNode = service.esTreeNodeToTSNodeMap.get(callee.object); + const calleeObjType = util.getConstrainedTypeAtLocation(checker, tsNode); + // Check the owner type of the `reduce` method. + if (checker.isArrayType(calleeObjType)) { + context.report({ + messageId: 'preferTypeParameter', + node: secondArg, + fix: fixer => [ + fixer.removeRange([ + secondArg.range[0], + secondArg.expression.range[0], + ]), + fixer.removeRange([ + secondArg.expression.range[1], + secondArg.range[1], + ]), + fixer.insertTextAfter(callee, `<${context + .getSourceCode() + .getText(secondArg.typeAnnotation)}>`), + ], + }); + return; + } + }, + }; + }, +}); +//# sourceMappingURL=prefer-reduce-type-parameter.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter.js.map new file mode 100644 index 000000000..647e71661 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-reduce-type-parameter.js","sourceRoot":"","sources":["../../src/rules/prefer-reduce-type-parameter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,8CAAgC;AAMhC,MAAM,uBAAuB,GAAG,CAC9B,MAAiC,EAClB,EAAE;IACjB,IAAI,CAAC,MA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AG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBAChE,MAAM,aAAa,GAAG,IAAI,CAAC,4BAA4B,CACrD,OAAO,EACP,MAAM,CACP,CAAC;gBAEF,+CAA+C;gBAC/C,IAAI,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE;oBACtC,OAAO,CAAC,MAAM,CAAC;wBACb,SAAS,EAAE,qBAAqB;wBAChC,IAAI,EAAE,SAAS;wBACf,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC;4BACZ,KAAK,CAAC,WAAW,CAAC;gCAChB,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;gCAClB,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;6BAC9B,CAAC;4BACF,KAAK,CAAC,WAAW,CAAC;gCAChB,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;gCAC7B,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;6BACnB,CAAC;4BACF,KAAK,CAAC,eAAe,CACnB,MAAM,EACN,IAAI,OAAO;iCACR,aAAa,EAAE;iCACf,OAAO,CAAC,SAAS,CAAC,cAAc,CAAC,GAAG,CACxC;yBACF;qBACF,CAAC,CAAC;oBAEH,OAAO;iBACR;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.js new file mode 100644 index 000000000..a09b65595 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../util"); +exports.default = util_1.createRule({ + name: 'prefer-regexp-exec', + defaultOptions: [], + meta: { + type: 'suggestion', + docs: { + description: 'Enforce that `RegExp#exec` is used instead of `String#match` if no global flag is provided', + category: 'Best Practices', + recommended: 'error', + requiresTypeChecking: true, + }, + messages: { + regExpExecOverStringMatch: 'Use the `RegExp#exec()` method instead.', + }, + schema: [], + }, + create(context) { + const globalScope = context.getScope(); + const service = util_1.getParserServices(context); + const typeChecker = service.program.getTypeChecker(); + /** + * Check if a given node is a string. + * @param node The node to check. + */ + function isStringType(node) { + const objectType = typeChecker.getTypeAtLocation(service.esTreeNodeToTSNodeMap.get(node)); + return util_1.getTypeName(typeChecker, objectType) === 'string'; + } + return { + "CallExpression[arguments.length=1] > MemberExpression.callee[property.name='match'][computed=false]"(node) { + const callNode = node.parent; + const arg = callNode.arguments[0]; + const evaluated = util_1.getStaticValue(arg, globalScope); + // Don't report regular expressions with global flag. + if (evaluated && + evaluated.value instanceof RegExp && + evaluated.value.flags.includes('g')) { + return; + } + if (isStringType(node.object)) { + context.report({ + node: callNode, + messageId: 'regExpExecOverStringMatch', + }); + return; + } + }, + }; + }, +}); +//# sourceMappingURL=prefer-regexp-exec.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.js.map new file mode 100644 index 000000000..3aa5e7362 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-regexp-exec.js","sourceRoot":"","sources":["../../src/rules/prefer-regexp-exec.ts"],"names":[],"mappings":";;AACA,kCAKiB;AAEjB,kBAAe,iBAAU,CAAC;IACxB,IAAI,EAAE,oBAAoB;IAC1B,cAAc,EAAE,EAAE;IAElB,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EACT,4FAA4F;YAC9F,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,OAAO;YACpB,oBAAoB,EAAE,IAAI;SAC3B;QACD,QAAQ,EAAE;YACR,yBAAyB,EAAE,yCAAyC;SACrE;QACD,MAAM,EAAE,EAAE;KACX;IAED,MAAM,CAAC,OAAO;QACZ,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;QACvC,MAAM,OAAO,GAAG,wBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3C,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;QAErD;;;WAGG;QACH,SAAS,YAAY,CAAC,IAAqC;YACzD,MAAM,UAAU,GAAG,WAAW,CAAC,iBAAiB,CAC9C,OAAO,CAAC,qBAAqB,CAAC,GAAG,CAAC,IAAI,CAAC,CACxC,CAAC;YACF,OAAO,kBAAW,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,QAAQ,CAAC;QAC3D,CAAC;QAED,OAAO;YACL,qGAAqG,CACnG,IAA+B;gBAE/B,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAiC,CAAC;gBACxD,MAAM,GAAG,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;gBAClC,MAAM,SAAS,GAAG,qBAAc,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;gBAEnD,qDAAqD;gBACrD,IACE,SAAS;oBACT,SAAS,CAAC,KAAK,YAAY,MAAM;oBACjC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EACnC;oBACA,OAAO;iBACR;gBAED,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;oBAC7B,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI,EAAE,QAAQ;wBACd,SAAS,EAAE,2BAA2B;qBACvC,CAAC,CAAC;oBACH,OAAO;iBACR;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.js new file mode 100644 index 000000000..5b3e02830 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.js @@ -0,0 +1,489 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const regexpp_1 = require("regexpp"); +const util_1 = require("../util"); +const EQ_OPERATORS = /^[=!]=/; +const regexpp = new regexpp_1.RegExpParser(); +exports.default = util_1.createRule({ + name: 'prefer-string-starts-ends-with', + defaultOptions: [], + meta: { + type: 'suggestion', + docs: { + description: 'Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings', + category: 'Best Practices', + recommended: false, + requiresTypeChecking: true, + }, + messages: { + preferStartsWith: "Use 'String#startsWith' method instead.", + preferEndsWith: "Use the 'String#endsWith' method instead.", + }, + schema: [], + fixable: 'code', + }, + create(context) { + const globalScope = context.getScope(); + const sourceCode = context.getSourceCode(); + const service = util_1.getParserServices(context); + const typeChecker = service.program.getTypeChecker(); + /** + * Check if a given node is a string. + * @param node The node to check. + */ + function isStringType(node) { + const objectType = typeChecker.getTypeAtLocation(service.esTreeNodeToTSNodeMap.get(node)); + return util_1.getTypeName(typeChecker, objectType) === 'string'; + } + /** + * Check if a given node is a `Literal` node that is null. + * @param node The node to check. + */ + function isNull(node) { + const evaluated = util_1.getStaticValue(node, globalScope); + return evaluated != null && evaluated.value === null; + } + /** + * Check if a given node is a `Literal` node that is a given value. + * @param node The node to check. + * @param value The expected value of the `Literal` node. + */ + function isNumber(node, value) { + const evaluated = util_1.getStaticValue(node, globalScope); + return evaluated != null && evaluated.value === value; + } + /** + * Check if a given node is a `Literal` node that is a character. + * @param node The node to check. + * @param kind The method name to get a character. + */ + function isCharacter(node) { + const evaluated = util_1.getStaticValue(node, globalScope); + return (evaluated != null && + typeof evaluated.value === 'string' && + // checks if the string is a character long + evaluated.value[0] === evaluated.value); + } + /** + * Check if a given node is `==`, `===`, `!=`, or `!==`. + * @param node The node to check. + */ + function isEqualityComparison(node) { + return (node.type === experimental_utils_1.AST_NODE_TYPES.BinaryExpression && + EQ_OPERATORS.test(node.operator)); + } + /** + * Check if two given nodes are the same meaning. + * @param node1 A node to compare. + * @param node2 Another node to compare. + */ + function isSameTokens(node1, node2) { + const tokens1 = sourceCode.getTokens(node1); + const tokens2 = sourceCode.getTokens(node2); + if (tokens1.length !== tokens2.length) { + return false; + } + for (let i = 0; i < tokens1.length; ++i) { + const token1 = tokens1[i]; + const token2 = tokens2[i]; + if (token1.type !== token2.type || token1.value !== token2.value) { + return false; + } + } + return true; + } + /** + * Check if a given node is the expression of the length of a string. + * + * - If `length` property access of `expectedObjectNode`, it's `true`. + * E.g., `foo` → `foo.length` / `"foo"` → `"foo".length` + * - If `expectedObjectNode` is a string literal, `node` can be a number. + * E.g., `"foo"` → `3` + * + * @param node The node to check. + * @param expectedObjectNode The node which is expected as the receiver of `length` property. + */ + function isLengthExpression(node, expectedObjectNode) { + if (node.type === experimental_utils_1.AST_NODE_TYPES.MemberExpression) { + return (util_1.getPropertyName(node, globalScope) === 'length' && + isSameTokens(node.object, expectedObjectNode)); + } + const evaluatedLength = util_1.getStaticValue(node, globalScope); + const evaluatedString = util_1.getStaticValue(expectedObjectNode, globalScope); + return (evaluatedLength != null && + evaluatedString != null && + typeof evaluatedLength.value === 'number' && + typeof evaluatedString.value === 'string' && + evaluatedLength.value === evaluatedString.value.length); + } + /** + * Check if a given node is a negative index expression + * + * E.g. `s.slice(- )`, `s.substring(s.length - )` + * + * @param node The node to check. + * @param expectedIndexedNode The node which is expected as the receiver of index expression. + */ + function isNegativeIndexExpression(node, expectedIndexedNode) { + return ((node.type === experimental_utils_1.AST_NODE_TYPES.UnaryExpression && + node.operator === '-') || + (node.type === experimental_utils_1.AST_NODE_TYPES.BinaryExpression && + node.operator === '-' && + isLengthExpression(node.left, expectedIndexedNode))); + } + /** + * Check if a given node is the expression of the last index. + * + * E.g. `foo.length - 1` + * + * @param node The node to check. + * @param expectedObjectNode The node which is expected as the receiver of `length` property. + */ + function isLastIndexExpression(node, expectedObjectNode) { + return (node.type === experimental_utils_1.AST_NODE_TYPES.BinaryExpression && + node.operator === '-' && + isLengthExpression(node.left, expectedObjectNode) && + isNumber(node.right, 1)); + } + /** + * Get the range of the property of a given `MemberExpression` node. + * + * - `obj[foo]` → the range of `[foo]` + * - `obf.foo` → the range of `.foo` + * - `(obj).foo` → the range of `.foo` + * + * @param node The member expression node to get. + */ + function getPropertyRange(node) { + const dotOrOpenBracket = sourceCode.getTokenAfter(node.object, util_1.isNotClosingParenToken); + return [dotOrOpenBracket.range[0], node.range[1]]; + } + /** + * Parse a given `RegExp` pattern to that string if it's a static string. + * @param pattern The RegExp pattern text to parse. + * @param uFlag The Unicode flag of the RegExp. + */ + function parseRegExpText(pattern, uFlag) { + // Parse it. + const ast = regexpp.parsePattern(pattern, undefined, undefined, uFlag); + if (ast.alternatives.length !== 1) { + return null; + } + // Drop `^`/`$` assertion. + const chars = ast.alternatives[0].elements; + const first = chars[0]; + if (first.type === 'Assertion' && first.kind === 'start') { + chars.shift(); + } + else { + chars.pop(); + } + // Check if it can determine a unique string. + if (!chars.every(c => c.type === 'Character')) { + return null; + } + // To string. + return String.fromCodePoint(...chars.map(c => c.value)); + } + /** + * Parse a given node if it's a `RegExp` instance. + * @param node The node to parse. + */ + function parseRegExp(node) { + const evaluated = util_1.getStaticValue(node, globalScope); + if (evaluated == null || !(evaluated.value instanceof RegExp)) { + return null; + } + const { source, flags } = evaluated.value; + const isStartsWith = source.startsWith('^'); + const isEndsWith = source.endsWith('$'); + if (isStartsWith === isEndsWith || + flags.includes('i') || + flags.includes('m')) { + return null; + } + const text = parseRegExpText(source, flags.includes('u')); + if (text == null) { + return null; + } + return { isEndsWith, isStartsWith, text }; + } + function getLeftNode(node) { + if (node.type === experimental_utils_1.AST_NODE_TYPES.ChainExpression) { + return getLeftNode(node.expression); + } + let leftNode; + if (node.type === experimental_utils_1.AST_NODE_TYPES.CallExpression) { + leftNode = node.callee; + } + else { + leftNode = node; + } + if (leftNode.type !== experimental_utils_1.AST_NODE_TYPES.MemberExpression) { + throw new Error(`Expected a MemberExpression, got ${leftNode.type}`); + } + return leftNode; + } + /** + * Fix code with using the right operand as the search string. + * For example: `foo.slice(0, 3) === 'bar'` → `foo.startsWith('bar')` + * @param fixer The rule fixer. + * @param node The node which was reported. + * @param kind The kind of the report. + * @param isNegative The flag to fix to negative condition. + */ + function* fixWithRightOperand(fixer, node, kind, isNegative, isOptional) { + // left is CallExpression or MemberExpression. + const leftNode = getLeftNode(node.left); + const propertyRange = getPropertyRange(leftNode); + if (isNegative) { + yield fixer.insertTextBefore(node, '!'); + } + yield fixer.replaceTextRange([propertyRange[0], node.right.range[0]], `${isOptional ? '?.' : '.'}${kind}sWith(`); + yield fixer.replaceTextRange([node.right.range[1], node.range[1]], ')'); + } + /** + * Fix code with using the first argument as the search string. + * For example: `foo.indexOf('bar') === 0` → `foo.startsWith('bar')` + * @param fixer The rule fixer. + * @param node The node which was reported. + * @param kind The kind of the report. + * @param negative The flag to fix to negative condition. + */ + function* fixWithArgument(fixer, node, callNode, calleeNode, kind, negative, isOptional) { + if (negative) { + yield fixer.insertTextBefore(node, '!'); + } + yield fixer.replaceTextRange(getPropertyRange(calleeNode), `${isOptional ? '?.' : '.'}${kind}sWith`); + yield fixer.removeRange([callNode.range[1], node.range[1]]); + } + function getParent(node) { + var _a; + return util_1.nullThrows(((_a = node.parent) === null || _a === void 0 ? void 0 : _a.type) === experimental_utils_1.AST_NODE_TYPES.ChainExpression + ? node.parent.parent + : node.parent, util_1.NullThrowsReasons.MissingParent); + } + return { + // foo[0] === "a" + // foo.charAt(0) === "a" + // foo[foo.length - 1] === "a" + // foo.charAt(foo.length - 1) === "a" + [[ + 'BinaryExpression > MemberExpression.left[computed=true]', + 'BinaryExpression > CallExpression.left > MemberExpression.callee[property.name="charAt"][computed=false]', + 'BinaryExpression > ChainExpression.left > MemberExpression[computed=true]', + 'BinaryExpression > ChainExpression.left > CallExpression > MemberExpression.callee[property.name="charAt"][computed=false]', + ].join(', ')](node) { + let parentNode = getParent(node); + let indexNode = null; + if ((parentNode === null || parentNode === void 0 ? void 0 : parentNode.type) === experimental_utils_1.AST_NODE_TYPES.CallExpression) { + if (parentNode.arguments.length === 1) { + indexNode = parentNode.arguments[0]; + } + parentNode = getParent(parentNode); + } + else { + indexNode = node.property; + } + if (indexNode == null || + !isEqualityComparison(parentNode) || + !isStringType(node.object)) { + return; + } + const isEndsWith = isLastIndexExpression(indexNode, node.object); + const isStartsWith = !isEndsWith && isNumber(indexNode, 0); + if (!isStartsWith && !isEndsWith) { + return; + } + const eqNode = parentNode; + context.report({ + node: parentNode, + messageId: isStartsWith ? 'preferStartsWith' : 'preferEndsWith', + fix(fixer) { + // Don't fix if it can change the behavior. + if (!isCharacter(eqNode.right)) { + return null; + } + return fixWithRightOperand(fixer, eqNode, isStartsWith ? 'start' : 'end', eqNode.operator.startsWith('!'), node.optional); + }, + }); + }, + // foo.indexOf('bar') === 0 + [[ + 'BinaryExpression > CallExpression.left > MemberExpression.callee[property.name="indexOf"][computed=false]', + 'BinaryExpression > ChainExpression.left > CallExpression > MemberExpression.callee[property.name="indexOf"][computed=false]', + ].join(', ')](node) { + const callNode = getParent(node); + const parentNode = getParent(callNode); + if (callNode.arguments.length !== 1 || + !isEqualityComparison(parentNode) || + !isNumber(parentNode.right, 0) || + !isStringType(node.object)) { + return; + } + context.report({ + node: parentNode, + messageId: 'preferStartsWith', + fix(fixer) { + return fixWithArgument(fixer, parentNode, callNode, node, 'start', parentNode.operator.startsWith('!'), node.optional); + }, + }); + }, + // foo.lastIndexOf('bar') === foo.length - 3 + // foo.lastIndexOf(bar) === foo.length - bar.length + [[ + 'BinaryExpression > CallExpression.left > MemberExpression.callee[property.name="lastIndexOf"][computed=false]', + 'BinaryExpression > ChainExpression.left > CallExpression > MemberExpression.callee[property.name="lastIndexOf"][computed=false]', + ].join(', ')](node) { + const callNode = getParent(node); + const parentNode = getParent(callNode); + if (callNode.arguments.length !== 1 || + !isEqualityComparison(parentNode) || + parentNode.right.type !== experimental_utils_1.AST_NODE_TYPES.BinaryExpression || + parentNode.right.operator !== '-' || + !isLengthExpression(parentNode.right.left, node.object) || + !isLengthExpression(parentNode.right.right, callNode.arguments[0]) || + !isStringType(node.object)) { + return; + } + context.report({ + node: parentNode, + messageId: 'preferEndsWith', + fix(fixer) { + return fixWithArgument(fixer, parentNode, callNode, node, 'end', parentNode.operator.startsWith('!'), node.optional); + }, + }); + }, + // foo.match(/^bar/) === null + // foo.match(/bar$/) === null + [[ + 'BinaryExpression > CallExpression.left > MemberExpression.callee[property.name="match"][computed=false]', + 'BinaryExpression > ChainExpression.left > CallExpression > MemberExpression.callee[property.name="match"][computed=false]', + ].join(', ')](node) { + const callNode = getParent(node); + const parentNode = getParent(callNode); + if (!isEqualityComparison(parentNode) || + !isNull(parentNode.right) || + !isStringType(node.object)) { + return; + } + const parsed = callNode.arguments.length === 1 + ? parseRegExp(callNode.arguments[0]) + : null; + if (parsed == null) { + return; + } + const { isStartsWith, text } = parsed; + context.report({ + node: callNode, + messageId: isStartsWith ? 'preferStartsWith' : 'preferEndsWith', + *fix(fixer) { + if (!parentNode.operator.startsWith('!')) { + yield fixer.insertTextBefore(parentNode, '!'); + } + yield fixer.replaceTextRange(getPropertyRange(node), `${node.optional ? '?.' : '.'}${isStartsWith ? 'start' : 'end'}sWith`); + yield fixer.replaceText(callNode.arguments[0], JSON.stringify(text)); + yield fixer.removeRange([callNode.range[1], parentNode.range[1]]); + }, + }); + }, + // foo.slice(0, 3) === 'bar' + // foo.slice(-3) === 'bar' + // foo.slice(-3, foo.length) === 'bar' + // foo.substring(0, 3) === 'bar' + // foo.substring(foo.length - 3) === 'bar' + // foo.substring(foo.length - 3, foo.length) === 'bar' + [[ + 'BinaryExpression > CallExpression.left > MemberExpression.callee[property.name="slice"][computed=false]', + 'BinaryExpression > CallExpression.left > MemberExpression.callee[property.name="substring"][computed=false]', + 'BinaryExpression > ChainExpression.left > CallExpression > MemberExpression.callee[property.name="slice"][computed=false]', + 'BinaryExpression > ChainExpression.left > CallExpression > MemberExpression.callee[property.name="substring"][computed=false]', + ].join(', ')](node) { + const callNode = getParent(node); + const parentNode = getParent(callNode); + if (!isEqualityComparison(parentNode) || !isStringType(node.object)) { + return; + } + const isEndsWith = (callNode.arguments.length === 1 || + (callNode.arguments.length === 2 && + isLengthExpression(callNode.arguments[1], node.object))) && + isNegativeIndexExpression(callNode.arguments[0], node.object); + const isStartsWith = !isEndsWith && + callNode.arguments.length === 2 && + isNumber(callNode.arguments[0], 0); + if (!isStartsWith && !isEndsWith) { + return; + } + const eqNode = parentNode; + const negativeIndexSupported = node.property.name === 'slice'; + context.report({ + node: parentNode, + messageId: isStartsWith ? 'preferStartsWith' : 'preferEndsWith', + fix(fixer) { + // Don't fix if it can change the behavior. + if (eqNode.operator.length === 2 && + (eqNode.right.type !== experimental_utils_1.AST_NODE_TYPES.Literal || + typeof eqNode.right.value !== 'string')) { + return null; + } + // code being checked is likely mistake: + // unequal length of strings being checked for equality + // or reliant on behavior of substring (negative indices interpreted as 0) + if (isStartsWith) { + if (!isLengthExpression(callNode.arguments[1], eqNode.right)) { + return null; + } + } + else { + const posNode = callNode.arguments[0]; + const posNodeIsAbsolutelyValid = (posNode.type === experimental_utils_1.AST_NODE_TYPES.BinaryExpression && + posNode.operator === '-' && + isLengthExpression(posNode.left, node.object) && + isLengthExpression(posNode.right, eqNode.right)) || + (negativeIndexSupported && + posNode.type === experimental_utils_1.AST_NODE_TYPES.UnaryExpression && + posNode.operator === '-' && + isLengthExpression(posNode.argument, eqNode.right)); + if (!posNodeIsAbsolutelyValid) { + return null; + } + } + return fixWithRightOperand(fixer, parentNode, isStartsWith ? 'start' : 'end', parentNode.operator.startsWith('!'), node.optional); + }, + }); + }, + // /^bar/.test(foo) + // /bar$/.test(foo) + 'CallExpression > MemberExpression.callee[property.name="test"][computed=false]'(node) { + const callNode = getParent(node); + const parsed = callNode.arguments.length === 1 ? parseRegExp(node.object) : null; + if (parsed == null) { + return; + } + const { isStartsWith, text } = parsed; + const messageId = isStartsWith ? 'preferStartsWith' : 'preferEndsWith'; + const methodName = isStartsWith ? 'startsWith' : 'endsWith'; + context.report({ + node: callNode, + messageId, + *fix(fixer) { + const argNode = callNode.arguments[0]; + const needsParen = argNode.type !== experimental_utils_1.AST_NODE_TYPES.Literal && + argNode.type !== experimental_utils_1.AST_NODE_TYPES.TemplateLiteral && + argNode.type !== experimental_utils_1.AST_NODE_TYPES.Identifier && + argNode.type !== experimental_utils_1.AST_NODE_TYPES.MemberExpression && + argNode.type !== experimental_utils_1.AST_NODE_TYPES.CallExpression; + yield fixer.removeRange([callNode.range[0], argNode.range[0]]); + if (needsParen) { + yield fixer.insertTextBefore(argNode, '('); + yield fixer.insertTextAfter(argNode, ')'); + } + yield fixer.insertTextAfter(argNode, `${node.optional ? '?.' : '.'}${methodName}(${JSON.stringify(text)}`); + }, + }); + }, + }; + }, +}); +//# sourceMappingURL=prefer-string-starts-ends-with.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.js.map new file mode 100644 index 000000000..55dc08b9e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.js.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-string-starts-ends-with.js","sourceRoot":"","sources":["../../src/rules/prefer-string-starts-ends-with.ts"],"names":[],"mappings":";;AAAA,8EAI+C;AAC/C,qCAAyD;AACzD,kCASiB;AAEjB,MAAM,YAAY,GAAG,QAAQ,CAAC;AAC9B,MAAM,OAAO,GAAG,IAAI,sBAAY,EAAE,CAAC;AAEnC,kBAAe,iBAAU,CAAC;IACxB,IAAI,EAAE,gCAAgC;IACtC,cAAc,EAAE,EAAE;IAElB,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IA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UAAU,GACd,OAAO,CAAC,IAAI,KAAK,mCAAc,CAAC,OAAO;4BACvC,OAAO,CAAC,IAAI,KAAK,mCAAc,CAAC,eAAe;4BAC/C,OAAO,CAAC,IAAI,KAAK,mCAAc,CAAC,UAAU;4BAC1C,OAAO,CAAC,IAAI,KAAK,mCAAc,CAAC,gBAAgB;4BAChD,OAAO,CAAC,IAAI,KAAK,mCAAc,CAAC,cAAc,CAAC;wBAEjD,MAAM,KAAK,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;wBAC/D,IAAI,UAAU,EAAE;4BACd,MAAM,KAAK,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;4BAC3C,MAAM,KAAK,CAAC,eAAe,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;yBAC3C;wBACD,MAAM,KAAK,CAAC,eAAe,CACzB,OAAO,EACP,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,UAAU,IAAI,IAAI,CAAC,SAAS,CAC1D,IAAI,CACL,EAAE,CACJ,CAAC;oBACJ,CAAC;iBACF,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error.js new file mode 100644 index 000000000..c0179f850 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error.js @@ -0,0 +1,62 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'prefer-ts-expect-error', + meta: { + type: 'problem', + docs: { + description: 'Recommends using `// @ts-expect-error` over `// @ts-ignore`', + category: 'Best Practices', + recommended: false, + }, + fixable: 'code', + messages: { + preferExpectErrorComment: 'Use "// @ts-expect-error" to ensure an error is actually being suppressed.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const tsIgnoreRegExp = /^\/*\s*@ts-ignore/; + const sourceCode = context.getSourceCode(); + return { + Program() { + const comments = sourceCode.getAllComments(); + comments.forEach(comment => { + if (comment.type !== experimental_utils_1.AST_TOKEN_TYPES.Line) { + return; + } + if (tsIgnoreRegExp.test(comment.value)) { + context.report({ + node: comment, + messageId: 'preferExpectErrorComment', + fix: fixer => fixer.replaceText(comment, `//${comment.value.replace('@ts-ignore', '@ts-expect-error')}`), + }); + } + }); + }, + }; + }, +}); +//# sourceMappingURL=prefer-ts-expect-error.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error.js.map new file mode 100644 index 000000000..3b812041e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error.js.map @@ -0,0 +1 @@ +{"version":3,"file":"prefer-ts-expect-error.js","sourceRoot":"","sources":["../../src/rules/prefer-ts-expect-error.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAAwE;AACxE,8CAAgC;AAIhC,kBAAe,IAAI,CAAC,UAAU,CAAiB;IAC7C,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EACT,6DAA6D;YAC/D,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,KAAK;SACnB;QACD,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE;YACR,wBAAwB,EACtB,4EAA4E;SAC/E;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,MAAM,cAAc,GAAG,mBAAmB,CAAC;QAC3C,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;QAE3C,OAAO;YACL,OAAO;gBACL,MAAM,QAAQ,GAAG,UAAU,CAAC,cAAc,EAAE,CAAC;gBAE7C,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;oBACzB,IAAI,OAAO,CAAC,IAAI,KAAK,oCAAe,CAAC,IAAI,EAAE;wBACzC,OAAO;qBACR;oBAED,IAAI,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;wBACtC,OAAO,CAAC,MAAM,CAAC;4BACb,IAAI,EAAE,OAAO;4BACb,SAAS,EAAE,0BAA0B;4BACrC,GAAG,EAAE,KAAK,CAAC,EAAE,CACX,KAAK,CAAC,WAAW,CACf,OAAO,EACP,KAAK,OAAO,CAAC,KAAK,CAAC,OAAO,CACxB,YAAY,EACZ,kBAAkB,CACnB,EAAE,CACJ;yBACJ,CAAC,CAAC;qBACJ;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js new file mode 100644 index 000000000..b216a9c5e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js @@ -0,0 +1,133 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'promise-function-async', + meta: { + type: 'suggestion', + docs: { + description: 'Requires any function or method that returns a Promise to be marked async', + category: 'Best Practices', + recommended: false, + requiresTypeChecking: true, + }, + messages: { + missingAsync: 'Functions that return promises must be async.', + }, + schema: [ + { + type: 'object', + properties: { + allowAny: { + type: 'boolean', + }, + allowedPromiseNames: { + type: 'array', + items: { + type: 'string', + }, + }, + checkArrowFunctions: { + type: 'boolean', + }, + checkFunctionDeclarations: { + type: 'boolean', + }, + checkFunctionExpressions: { + type: 'boolean', + }, + checkMethodDeclarations: { + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], + }, + defaultOptions: [ + { + allowAny: true, + allowedPromiseNames: [], + checkArrowFunctions: true, + checkFunctionDeclarations: true, + checkFunctionExpressions: true, + checkMethodDeclarations: true, + }, + ], + create(context, [{ allowAny, allowedPromiseNames, checkArrowFunctions, checkFunctionDeclarations, checkFunctionExpressions, checkMethodDeclarations, },]) { + const allAllowedPromiseNames = new Set([ + 'Promise', + ...allowedPromiseNames, + ]); + const parserServices = util.getParserServices(context); + const checker = parserServices.program.getTypeChecker(); + function validateNode(node) { + const originalNode = parserServices.esTreeNodeToTSNodeMap.get(node); + const signatures = checker + .getTypeAtLocation(originalNode) + .getCallSignatures(); + if (!signatures.length) { + return; + } + const returnType = checker.getReturnTypeOfSignature(signatures[0]); + if (!util.containsAllTypesByName(returnType, allowAny, allAllowedPromiseNames)) { + return; + } + if (node.parent && + (node.parent.type === experimental_utils_1.AST_NODE_TYPES.Property || + node.parent.type === experimental_utils_1.AST_NODE_TYPES.MethodDefinition) && + (node.parent.kind === 'get' || node.parent.kind === 'set')) { + return; + } + context.report({ + messageId: 'missingAsync', + node, + }); + } + return { + 'ArrowFunctionExpression[async = false]'(node) { + if (checkArrowFunctions) { + validateNode(node); + } + }, + 'FunctionDeclaration[async = false]'(node) { + if (checkFunctionDeclarations) { + validateNode(node); + } + }, + 'FunctionExpression[async = false]'(node) { + if (node.parent && + 'kind' in node.parent && + node.parent.kind === 'method') { + if (checkMethodDeclarations) { + validateNode(node.parent); + } + } + else if (checkFunctionExpressions) { + validateNode(node); + } + }, + }; + }, +}); +//# sourceMappingURL=promise-function-async.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js.map new file mode 100644 index 000000000..bfd56d5d9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js.map @@ -0,0 +1 @@ +{"version":3,"file":"promise-function-async.js","sourceRoot":"","sources":["../../src/rules/promise-function-async.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,8CAAgC;AAchC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,wBAAwB;IAC9B,IAAI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C7B;oBACA,IAAI,uBAAuB,EAAE;wBAC3B,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;qBAC3B;iBACF;qBAAM,IAAI,wBAAwB,EAAE;oBACnC,YAAY,CAAC,IAAI,CAAC,CAAC;iBACpB;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/quotes.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/quotes.js new file mode 100644 index 000000000..17e820c1a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/quotes.js @@ -0,0 +1,86 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const quotes_1 = __importDefault(require("eslint/lib/rules/quotes")); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'quotes', + meta: { + type: 'layout', + docs: { + description: 'Enforce the consistent use of either backticks, double, or single quotes', + category: 'Stylistic Issues', + recommended: false, + extendsBaseRule: true, + }, + fixable: 'code', + messages: (_a = quotes_1.default.meta.messages) !== null && _a !== void 0 ? _a : { + wrongQuotes: 'Strings must use {{description}}.', + }, + schema: quotes_1.default.meta.schema, + }, + defaultOptions: [ + 'double', + { + allowTemplateLiterals: false, + avoidEscape: false, + }, + ], + create(context, [option]) { + const rules = quotes_1.default.create(context); + function isAllowedAsNonBacktick(node) { + const parent = node.parent; + switch (parent === null || parent === void 0 ? void 0 : parent.type) { + case experimental_utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition: + case experimental_utils_1.AST_NODE_TYPES.TSMethodSignature: + case experimental_utils_1.AST_NODE_TYPES.TSPropertySignature: + case experimental_utils_1.AST_NODE_TYPES.TSModuleDeclaration: + case experimental_utils_1.AST_NODE_TYPES.TSLiteralType: + case experimental_utils_1.AST_NODE_TYPES.TSExternalModuleReference: + return true; + case experimental_utils_1.AST_NODE_TYPES.TSEnumMember: + return node === parent.id; + case experimental_utils_1.AST_NODE_TYPES.TSAbstractClassProperty: + case experimental_utils_1.AST_NODE_TYPES.ClassProperty: + return node === parent.key; + default: + return false; + } + } + return { + Literal(node) { + if (option === 'backtick' && isAllowedAsNonBacktick(node)) { + return; + } + rules.Literal(node); + }, + TemplateLiteral(node) { + rules.TemplateLiteral(node); + }, + }; + }, +}); +//# sourceMappingURL=quotes.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/quotes.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/quotes.js.map new file mode 100644 index 000000000..de3a0e5dc --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/quotes.js.map @@ -0,0 +1 @@ +{"version":3,"file":"quotes.js","sourceRoot":"","sources":["../../src/rules/quotes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,qEAA+C;AAC/C,8CAAgC;AAKhC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,IA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U,IAAI,sBAAsB,CAAC,IAAI,CAAC,EAAE;oBACzD,OAAO;iBACR;gBAED,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACtB,CAAC;YAED,eAAe,CAAC,IAAI;gBAClB,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;YAC9B,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js new file mode 100644 index 000000000..e71e0d511 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js @@ -0,0 +1,81 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'require-array-sort-compare', + defaultOptions: [ + { + ignoreStringArrays: false, + }, + ], + meta: { + type: 'problem', + docs: { + description: 'Requires `Array#sort` calls to always provide a `compareFunction`', + category: 'Best Practices', + recommended: false, + requiresTypeChecking: true, + }, + messages: { + requireCompare: "Require 'compare' argument.", + }, + schema: [ + { + type: 'object', + properties: { + ignoreStringArrays: { + type: 'boolean', + }, + }, + }, + ], + }, + create(context, [options]) { + const service = util.getParserServices(context); + const checker = service.program.getTypeChecker(); + /** + * Check if a given node is an array which all elements are string. + * @param node + */ + function isStringArrayNode(node) { + const type = checker.getTypeAtLocation(service.esTreeNodeToTSNodeMap.get(node)); + if (checker.isArrayType(type) || checker.isTupleType(type)) { + const typeArgs = checker.getTypeArguments(type); + return typeArgs.every(arg => util.getTypeName(checker, arg) === 'string'); + } + return false; + } + return { + "CallExpression[arguments.length=0] > MemberExpression[property.name='sort'][computed=false]"(callee) { + const tsNode = service.esTreeNodeToTSNodeMap.get(callee.object); + const calleeObjType = util.getConstrainedTypeAtLocation(checker, tsNode); + if (options.ignoreStringArrays && isStringArrayNode(callee.object)) { + return; + } + if (util.isTypeArrayTypeOrUnionOfArrayTypes(calleeObjType, checker)) { + context.report({ node: callee.parent, messageId: 'requireCompare' }); + } + }, + }; + }, +}); +//# sourceMappingURL=require-array-sort-compare.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js.map new file mode 100644 index 000000000..1a04cc46e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js.map @@ -0,0 +1 @@ +{"version":3,"file":"require-array-sort-compare.js","sourceRoot":"","sources":["../../src/rules/require-array-sort-compare.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,8CAAgC;AAShC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,4BAA4B;IAClC,cAAc,EAAE;QACd;YACE,kBAAkB,EAAE,KAAK;SAC1B;KACF;IAED,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EACT,mEAAmE;YACrE,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,KAAK;YAClB,oBAAoB,EAAE,IAAI;SAC3B;QACD,QAAQ,EAAE;YACR,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AAE;oBACnE,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC;iBACvE;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.js new file mode 100644 index 000000000..3bdbc095a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.js @@ -0,0 +1,193 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const tsutils = __importStar(require("tsutils")); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'require-await', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow async functions which have no `await` expression', + category: 'Best Practices', + recommended: 'error', + requiresTypeChecking: true, + extendsBaseRule: true, + }, + schema: [], + messages: { + missingAwait: "{{name}} has no 'await' expression.", + }, + }, + defaultOptions: [], + create(context) { + const parserServices = util.getParserServices(context); + const checker = parserServices.program.getTypeChecker(); + const sourceCode = context.getSourceCode(); + let scopeInfo = null; + /** + * Push the scope info object to the stack. + */ + function enterFunction(node) { + scopeInfo = { + upper: scopeInfo, + hasAwait: false, + hasAsync: node.async, + isGen: node.generator || false, + isAsyncYield: false, + }; + } + /** + * Pop the top scope info object from the stack. + * Also, it reports the function if needed. + */ + function exitFunction(node) { + /* istanbul ignore if */ if (!scopeInfo) { + // this shouldn't ever happen, as we have to exit a function after we enter it + return; + } + if (node.async && + !scopeInfo.hasAwait && + !isEmptyFunction(node) && + !(scopeInfo.isGen && scopeInfo.isAsyncYield)) { + context.report({ + node, + loc: getFunctionHeadLoc(node, sourceCode), + messageId: 'missingAwait', + data: { + name: util.upperCaseFirst(util.getFunctionNameWithKind(node)), + }, + }); + } + scopeInfo = scopeInfo.upper; + } + /** + * Checks if the node returns a thenable type + */ + function isThenableType(node) { + const type = checker.getTypeAtLocation(node); + return tsutils.isThenableType(checker, node, type); + } + /** + * Marks the current scope as having an await + */ + function markAsHasAwait() { + if (!scopeInfo) { + return; + } + scopeInfo.hasAwait = true; + } + /** + * mark `scopeInfo.isAsyncYield` to `true` if its a generator + * function and the delegate is `true` + */ + function markAsHasDelegateGen(node) { + var _a; + if (!scopeInfo || !scopeInfo.isGen || !node.argument) { + return; + } + if (((_a = node === null || node === void 0 ? void 0 : node.argument) === null || _a === void 0 ? void 0 : _a.type) === experimental_utils_1.AST_NODE_TYPES.Literal) { + // making this `false` as for literals we don't need to check the definition + // eg : async function* run() { yield* 1 } + scopeInfo.isAsyncYield = false; + } + const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node === null || node === void 0 ? void 0 : node.argument); + const type = checker.getTypeAtLocation(tsNode); + const symbol = type.getSymbol(); + // async function* test1() {yield* asyncGenerator() } + if ((symbol === null || symbol === void 0 ? void 0 : symbol.getName()) === 'AsyncGenerator') { + scopeInfo.isAsyncYield = true; + } + } + return { + FunctionDeclaration: enterFunction, + FunctionExpression: enterFunction, + ArrowFunctionExpression: enterFunction, + 'FunctionDeclaration:exit': exitFunction, + 'FunctionExpression:exit': exitFunction, + 'ArrowFunctionExpression:exit': exitFunction, + AwaitExpression: markAsHasAwait, + 'ForOfStatement[await = true]': markAsHasAwait, + 'YieldExpression[delegate = true]': markAsHasDelegateGen, + // check body-less async arrow function. + // ignore `async () => await foo` because it's obviously correct + 'ArrowFunctionExpression[async = true] > :not(BlockStatement, AwaitExpression)'(node) { + const expression = parserServices.esTreeNodeToTSNodeMap.get(node); + if (expression && isThenableType(expression)) { + markAsHasAwait(); + } + }, + ReturnStatement(node) { + // short circuit early to avoid unnecessary type checks + if (!scopeInfo || scopeInfo.hasAwait || !scopeInfo.hasAsync) { + return; + } + const { expression } = parserServices.esTreeNodeToTSNodeMap.get(node); + if (expression && isThenableType(expression)) { + markAsHasAwait(); + } + }, + }; + }, +}); +function isEmptyFunction(node) { + var _a; + return (((_a = node.body) === null || _a === void 0 ? void 0 : _a.type) === experimental_utils_1.AST_NODE_TYPES.BlockStatement && + node.body.body.length === 0); +} +// https://github.com/eslint/eslint/blob/03a69dbe86d5b5768a310105416ae726822e3c1c/lib/rules/utils/ast-utils.js#L382-L392 +/** + * Gets the `(` token of the given function node. + */ +function getOpeningParenOfParams(node, sourceCode) { + return util.nullThrows(node.id + ? sourceCode.getTokenAfter(node.id, util.isOpeningParenToken) + : sourceCode.getFirstToken(node, util.isOpeningParenToken), util.NullThrowsReasons.MissingToken('(', node.type)); +} +// https://github.com/eslint/eslint/blob/03a69dbe86d5b5768a310105416ae726822e3c1c/lib/rules/utils/ast-utils.js#L1220-L1242 +/** + * Gets the location of the given function node for reporting. + */ +function getFunctionHeadLoc(node, sourceCode) { + const parent = util.nullThrows(node.parent, util.NullThrowsReasons.MissingParent); + let start = null; + let end = null; + if (node.type === experimental_utils_1.AST_NODE_TYPES.ArrowFunctionExpression) { + const arrowToken = util.nullThrows(sourceCode.getTokenBefore(node.body, util.isArrowToken), util.NullThrowsReasons.MissingToken('=>', node.type)); + start = arrowToken.loc.start; + end = arrowToken.loc.end; + } + else if (parent.type === experimental_utils_1.AST_NODE_TYPES.Property || + parent.type === experimental_utils_1.AST_NODE_TYPES.MethodDefinition) { + start = parent.loc.start; + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } + else { + start = node.loc.start; + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } + return { + start, + end, + }; +} +//# sourceMappingURL=require-await.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.js.map new file mode 100644 index 000000000..bab6931d7 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.js.map @@ -0,0 +1 @@ +{"version":3,"file":"require-await.js","sourceRoot":"","sources":["../../src/rules/require-await.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAI+C;AAC/C,iDAAmC;AAEnC,8CAAgC;AAchC,kBAAe,IAAI,CAAC,UAAU,CAAC;IAC7B,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,2DAA2D;YACxE,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,OAAO;YACpB,oBAAoB,EAAE,IAAI;YAC1B,eAAe,EAAE,IAAI;SACtB;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,YAAY,EAAE,qCAAqC;SACpD;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,MAAM,cAAc,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QACvD,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;QAExD,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;QAC3C,IAAI,SAAS,GAAqB,IAAI,CAAC;QAEvC;;WAEG;QACH,SAAS,aAAa,CAAC,IAAkB;YACvC,SAAS,GAAG;gBACV,KAAK,EAAE,SAAS;gBAChB,QA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C,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,EACvD,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CACrD,CAAC;QAEF,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC;QAC7B,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC;KAC1B;SAAM,IACL,MAAM,CAAC,IAAI,KAAK,mCAAc,CAAC,QAAQ;QACvC,MAAM,CAAC,IAAI,KAAK,mCAAc,CAAC,gBAAgB,EAC/C;QACA,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC;QACzB,GAAG,GAAG,uBAAuB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC;KAC3D;SAAM;QACL,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;QACvB,GAAG,GAAG,uBAAuB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC;KAC3D;IAED,OAAO;QACL,KAAK;QACL,GAAG;KACJ,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js new file mode 100644 index 000000000..aa2ba0742 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js @@ -0,0 +1,130 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const ts = __importStar(require("typescript")); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'restrict-plus-operands', + meta: { + type: 'problem', + docs: { + description: 'When adding two variables, operands must both be of type number or of type string', + category: 'Best Practices', + recommended: 'error', + requiresTypeChecking: true, + }, + messages: { + notNumbers: "Operands of '+' operation must either be both strings or both numbers.", + notStrings: "Operands of '+' operation must either be both strings or both numbers. Consider using a template literal.", + notBigInts: "Operands of '+' operation must be both bigints.", + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + checkCompoundAssignments: { + type: 'boolean', + }, + }, + }, + ], + }, + defaultOptions: [ + { + checkCompoundAssignments: false, + }, + ], + create(context, [{ checkCompoundAssignments }]) { + const service = util.getParserServices(context); + const typeChecker = service.program.getTypeChecker(); + /** + * Helper function to get base type of node + */ + function getBaseTypeOfLiteralType(type) { + if (type.isNumberLiteral()) { + return 'number'; + } + if (type.isStringLiteral()) { + return 'string'; + } + // is BigIntLiteral + if (type.flags & ts.TypeFlags.BigIntLiteral) { + return 'bigint'; + } + if (type.isUnion()) { + const types = type.types.map(getBaseTypeOfLiteralType); + return types.every(value => value === types[0]) ? types[0] : 'invalid'; + } + const stringType = typeChecker.typeToString(type); + if (stringType === 'number' || + stringType === 'string' || + stringType === 'bigint') { + return stringType; + } + return 'invalid'; + } + /** + * Helper function to get base type of node + * @param node the node to be evaluated. + */ + function getNodeType(node) { + const tsNode = service.esTreeNodeToTSNodeMap.get(node); + const type = util.getConstrainedTypeAtLocation(typeChecker, tsNode); + return getBaseTypeOfLiteralType(type); + } + function checkPlusOperands(node) { + const leftType = getNodeType(node.left); + const rightType = getNodeType(node.right); + if (leftType === 'invalid' || + rightType === 'invalid' || + leftType !== rightType) { + if (leftType === 'string' || rightType === 'string') { + context.report({ + node, + messageId: 'notStrings', + }); + } + else if (leftType === 'bigint' || rightType === 'bigint') { + context.report({ + node, + messageId: 'notBigInts', + }); + } + else { + context.report({ + node, + messageId: 'notNumbers', + }); + } + } + } + return { + "BinaryExpression[operator='+']": checkPlusOperands, + "AssignmentExpression[operator='+=']"(node) { + if (checkCompoundAssignments) { + checkPlusOperands(node); + } + }, + }; + }, +}); +//# sourceMappingURL=restrict-plus-operands.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js.map new file mode 100644 index 000000000..df5c3ce75 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js.map @@ -0,0 +1 @@ +{"version":3,"file":"restrict-plus-operands.js","sourceRoot":"","sources":["../../src/rules/restrict-plus-operands.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,+CAAiC;AACjC,8CAAgC;AAShC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EACT,mFAAmF;YACrF,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,OAAO;YACpB,oBAAoB,EAAE,IAAI;SAC3B;QACD,QAAQ,EAAE;YACR,UAAU,EACR,wEAAwE;YAC1E,UAAU,EACR,2GAA2G;YAC7G,UAAU,EAAE,iDAAiD;SAC9D;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,oBAAoB,EAAE,KAAK;gBAC3B,UAAU,EAAE;oBACV,wBAAwB,EAAE;wBACxB,IAAI,EAAE,SAAS;qBAChB;iBACF;aACF;SACF;KACF;IACD,cAAc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AG,IAAI,CAAC,4BAA4B,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;YAEpE,OAAO,wBAAwB,CAAC,IAAI,CAAC,CAAC;QACxC,CAAC;QAED,SAAS,iBAAiB,CACxB,IAA+D;YAE/D,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACxC,MAAM,SAAS,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAE1C,IACE,QAAQ,KAAK,SAAS;gBACtB,SAAS,KAAK,SAAS;gBACvB,QAAQ,KAAK,SAAS,EACtB;gBACA,IAAI,QAAQ,KAAK,QAAQ,IAAI,SAAS,KAAK,QAAQ,EAAE;oBACnD,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI;wBACJ,SAAS,EAAE,YAAY;qBACxB,CAAC,CAAC;iBACJ;qBAAM,IAAI,QAAQ,KAAK,QAAQ,IAAI,SAAS,KAAK,QAAQ,EAAE;oBAC1D,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI;wBACJ,SAAS,EAAE,YAAY;qBACxB,CAAC,CAAC;iBACJ;qBAAM;oBACL,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI;wBACJ,SAAS,EAAE,YAAY;qBACxB,CAAC,CAAC;iBACJ;aACF;QACH,CAAC;QAED,OAAO;YACL,gCAAgC,EAAE,iBAAiB;YACnD,qCAAqC,CAAC,IAAI;gBACxC,IAAI,wBAAwB,EAAE;oBAC5B,iBAAiB,CAAC,IAAI,CAAC,CAAC;iBACzB;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.js new file mode 100644 index 000000000..e72f79197 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.js @@ -0,0 +1,111 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const ts = __importStar(require("typescript")); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'restrict-template-expressions', + meta: { + type: 'problem', + docs: { + description: 'Enforce template literal expressions to be of string type', + category: 'Best Practices', + recommended: 'error', + requiresTypeChecking: true, + }, + messages: { + invalidType: 'Invalid type "{{type}}" of template literal expression.', + }, + schema: [ + { + type: 'object', + properties: { + allowNumber: { type: 'boolean' }, + allowBoolean: { type: 'boolean' }, + allowAny: { type: 'boolean' }, + allowNullish: { type: 'boolean' }, + }, + }, + ], + }, + defaultOptions: [ + { + allowNumber: true, + }, + ], + create(context, [options]) { + const service = util.getParserServices(context); + const typeChecker = service.program.getTypeChecker(); + function isUnderlyingTypePrimitive(type) { + if (util.isTypeFlagSet(type, ts.TypeFlags.StringLike)) { + return true; + } + if (options.allowNumber && + util.isTypeFlagSet(type, ts.TypeFlags.NumberLike | ts.TypeFlags.BigIntLike)) { + return true; + } + if (options.allowBoolean && + util.isTypeFlagSet(type, ts.TypeFlags.BooleanLike)) { + return true; + } + if (options.allowAny && util.isTypeAnyType(type)) { + return true; + } + if (options.allowNullish && + util.isTypeFlagSet(type, ts.TypeFlags.Null | ts.TypeFlags.Undefined)) { + return true; + } + return false; + } + return { + TemplateLiteral(node) { + // don't check tagged template literals + if (node.parent.type === experimental_utils_1.AST_NODE_TYPES.TaggedTemplateExpression) { + return; + } + for (const expression of node.expressions) { + const expressionType = util.getConstrainedTypeAtLocation(typeChecker, service.esTreeNodeToTSNodeMap.get(expression)); + if (!isInnerUnionOrIntersectionConformingTo(expressionType, isUnderlyingTypePrimitive)) { + context.report({ + node: expression, + messageId: 'invalidType', + data: { type: typeChecker.typeToString(expressionType) }, + }); + } + } + }, + }; + function isInnerUnionOrIntersectionConformingTo(type, predicate) { + return rec(type); + function rec(innerType) { + if (innerType.isUnion()) { + return innerType.types.every(rec); + } + if (innerType.isIntersection()) { + return innerType.types.some(rec); + } + return predicate(innerType); + } + } + }, +}); +//# sourceMappingURL=restrict-template-expressions.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.js.map new file mode 100644 index 000000000..2e5170559 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"restrict-template-expressions.js","sourceRoot":"","sources":["../../src/rules/restrict-template-expressions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,+CAAiC;AACjC,8CAAgC;AAahC,kBAAe,IAAI,CAAC,UAAU,CAAqB;IACjD,IAAI,EAAE,+BAA+B;IACrC,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,2DAA2D;YACxE,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,OAAO;YACpB,oBAAoB,EAAE,IAAI;SAC3B;QACD,QAAQ,EAAE;YACR,WAAW,EAAE,yDAAyD;SACvE;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,UAAU,E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KAAK,CAAC;QACf,CAAC;QAED,OAAO;YACL,eAAe,CAAC,IAA8B;gBAC5C,uCAAuC;gBACvC,IAAI,IAAI,CAAC,MAAO,CAAC,IAAI,KAAK,mCAAc,CAAC,wBAAwB,EAAE;oBACjE,OAAO;iBACR;gBAED,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,WAAW,EAAE;oBACzC,MAAM,cAAc,GAAG,IAAI,CAAC,4BAA4B,CACtD,WAAW,EACX,OAAO,CAAC,qBAAqB,CAAC,GAAG,CAAC,UAAU,CAAC,CAC9C,CAAC;oBAEF,IACE,CAAC,sCAAsC,CACrC,cAAc,EACd,yBAAyB,CAC1B,EACD;wBACA,OAAO,CAAC,MAAM,CAAC;4BACb,IAAI,EAAE,UAAU;4BAChB,SAAS,EAAE,aAAa;4BACxB,IAAI,EAAE,EAAE,IAAI,EAAE,WAAW,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE;yBACzD,CAAC,CAAC;qBACJ;iBACF;YACH,CAAC;SACF,CAAC;QAEF,SAAS,sCAAsC,CAC7C,IAAa,EACb,SAA+C;YAE/C,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC;YAEjB,SAAS,GAAG,CAAC,SAAkB;gBAC7B,IAAI,SAAS,CAAC,OAAO,EAAE,EAAE;oBACvB,OAAO,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;iBACnC;gBAED,IAAI,SAAS,CAAC,cAAc,EAAE,EAAE;oBAC9B,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;iBAClC;gBAED,OAAO,SAAS,CAAC,SAAS,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js new file mode 100644 index 000000000..578f2f2ae --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js @@ -0,0 +1,190 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const tsutils = __importStar(require("tsutils")); +const ts = __importStar(require("typescript")); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'return-await', + meta: { + docs: { + description: 'Enforces consistent returning of awaited values', + category: 'Best Practices', + recommended: false, + requiresTypeChecking: true, + extendsBaseRule: 'no-return-await', + }, + fixable: 'code', + type: 'problem', + messages: { + nonPromiseAwait: 'Returning an awaited value that is not a promise is not allowed.', + disallowedPromiseAwait: 'Returning an awaited promise is not allowed in this context.', + requiredPromiseAwait: 'Returning an awaited promise is required in this context.', + }, + schema: [ + { + enum: ['in-try-catch', 'always', 'never'], + }, + ], + }, + defaultOptions: ['in-try-catch'], + create(context, [option]) { + const parserServices = util.getParserServices(context); + const checker = parserServices.program.getTypeChecker(); + const sourceCode = context.getSourceCode(); + let scopeInfo = null; + function enterFunction(node) { + scopeInfo = { + hasAsync: node.async, + }; + } + function inTryCatch(node) { + let ancestor = node.parent; + while (ancestor && !ts.isFunctionLike(ancestor)) { + if (tsutils.isTryStatement(ancestor) || + tsutils.isCatchClause(ancestor)) { + return true; + } + ancestor = ancestor.parent; + } + return false; + } + // function findTokensToRemove() + function removeAwait(fixer, node) { + // Should always be an await node; but let's be safe. + /* istanbul ignore if */ if (!util.isAwaitExpression(node)) { + return null; + } + const awaitToken = sourceCode.getFirstToken(node, util.isAwaitKeyword); + // Should always be the case; but let's be safe. + /* istanbul ignore if */ if (!awaitToken) { + return null; + } + const startAt = awaitToken.range[0]; + let endAt = awaitToken.range[1]; + // Also remove any extraneous whitespace after `await`, if there is any. + const nextToken = sourceCode.getTokenAfter(awaitToken, { + includeComments: true, + }); + if (nextToken) { + endAt = nextToken.range[0]; + } + return fixer.removeRange([startAt, endAt]); + } + function insertAwait(fixer, node) { + return fixer.insertTextBefore(node, 'await '); + } + function test(node, expression) { + let child; + const isAwait = tsutils.isAwaitExpression(expression); + if (isAwait) { + child = expression.getChildAt(1); + } + else { + child = expression; + } + const type = checker.getTypeAtLocation(child); + const isThenable = tsutils.isThenableType(checker, expression, type); + if (!isAwait && !isThenable) { + return; + } + if (isAwait && !isThenable) { + context.report({ + messageId: 'nonPromiseAwait', + node, + fix: fixer => removeAwait(fixer, node), + }); + return; + } + if (option === 'always') { + if (!isAwait && isThenable) { + context.report({ + messageId: 'requiredPromiseAwait', + node, + fix: fixer => insertAwait(fixer, node), + }); + } + return; + } + if (option === 'never') { + if (isAwait) { + context.report({ + messageId: 'disallowedPromiseAwait', + node, + fix: fixer => removeAwait(fixer, node), + }); + } + return; + } + if (option === 'in-try-catch') { + const isInTryCatch = inTryCatch(expression); + if (isAwait && !isInTryCatch) { + context.report({ + messageId: 'disallowedPromiseAwait', + node, + fix: fixer => removeAwait(fixer, node), + }); + } + else if (!isAwait && isInTryCatch) { + context.report({ + messageId: 'requiredPromiseAwait', + node, + fix: fixer => insertAwait(fixer, node), + }); + } + return; + } + } + function findPossiblyReturnedNodes(node) { + if (node.type === experimental_utils_1.AST_NODE_TYPES.ConditionalExpression) { + return [ + ...findPossiblyReturnedNodes(node.alternate), + ...findPossiblyReturnedNodes(node.consequent), + ]; + } + return [node]; + } + return { + FunctionDeclaration: enterFunction, + FunctionExpression: enterFunction, + ArrowFunctionExpression: enterFunction, + 'ArrowFunctionExpression[async = true]:exit'(node) { + if (node.body.type !== experimental_utils_1.AST_NODE_TYPES.BlockStatement) { + findPossiblyReturnedNodes(node.body).forEach(node => { + const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node); + test(node, tsNode); + }); + } + }, + ReturnStatement(node) { + if (!scopeInfo || !scopeInfo.hasAsync || !node.argument) { + return; + } + findPossiblyReturnedNodes(node.argument).forEach(node => { + const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node); + test(node, tsNode); + }); + }, + }; + }, +}); +//# sourceMappingURL=return-await.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js.map new file mode 100644 index 000000000..311a5366a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js.map @@ -0,0 +1 @@ +{"version":3,"file":"return-await.js","sourceRoot":"","sources":["../../src/rules/return-await.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAI+C;AAC/C,iDAAmC;AACnC,+CAAiC;AACjC,8CAAgC;AAWhC,kBAAe,IAAI,CAAC,UAAU,CAAC;IAC7B,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,WAAW,EAAE,iDAAiD;YAC9D,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,KAAK;YAClB,oBAAoB,EAAE,IAAI;YAC1B,eAAe,EAAE,iBAAiB;SACnC;QACD,OAAO,EAAE,MAAM;QACf,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE;YACR,eAAe,EACb,kEAAkE;YACpE,sBAAsB,EACpB,8DAA8D;YAChE,oBAAoB,EAClB,2DAA2D;SAC9D;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,CAAC,cAAc,EAAE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,yBAAyB,CAAC,IAAI,CAAC,SAAS,CAAC;oBAC5C,GAAG,yBAAyB,CAAC,IAAI,CAAC,UAAU,CAAC;iBAC9C,CAAC;aACH;YACD,OAAO,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC;QAED,OAAO;YACL,mBAAmB,EAAE,aAAa;YAClC,kBAAkB,EAAE,aAAa;YACjC,uBAAuB,EAAE,aAAa;YAEtC,4CAA4C,CAC1C,IAAsC;gBAEtC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,mCAAc,CAAC,cAAc,EAAE;oBACpD,yBAAyB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;wBAClD,MAAM,MAAM,GAAG,cAAc,CAAC,qBAAqB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;wBAC9D,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;oBACrB,CAAC,CAAC,CAAC;iBACJ;YACH,CAAC;YACD,eAAe,CAAC,IAAI;gBAClB,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;oBACvD,OAAO;iBACR;gBACD,yBAAyB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;oBACtD,MAAM,MAAM,GAAG,cAAc,CAAC,qBAAqB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;oBAC9D,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;gBACrB,CAAC,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/semi.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/semi.js new file mode 100644 index 000000000..7e2ccde16 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/semi.js @@ -0,0 +1,84 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const semi_1 = __importDefault(require("eslint/lib/rules/semi")); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'semi', + meta: { + type: 'layout', + docs: { + description: 'Require or disallow semicolons instead of ASI', + category: 'Stylistic Issues', + // too opinionated to be recommended + recommended: false, + extendsBaseRule: true, + }, + fixable: 'code', + schema: semi_1.default.meta.schema, + messages: (_a = semi_1.default.meta.messages) !== null && _a !== void 0 ? _a : { + missingSemi: 'Missing semicolon.', + extraSemi: 'Extra semicolon.', + }, + }, + defaultOptions: [ + 'always', + { + omitLastInOneLineBlock: false, + beforeStatementContinuationChars: 'any', + }, + ], + create(context) { + const rules = semi_1.default.create(context); + const checkForSemicolon = rules.ExpressionStatement; + /* + The following nodes are handled by the member-delimiter-style rule + AST_NODE_TYPES.TSCallSignatureDeclaration, + AST_NODE_TYPES.TSConstructSignatureDeclaration, + AST_NODE_TYPES.TSIndexSignature, + AST_NODE_TYPES.TSMethodSignature, + AST_NODE_TYPES.TSPropertySignature, + */ + const nodesToCheck = [ + experimental_utils_1.AST_NODE_TYPES.ClassProperty, + experimental_utils_1.AST_NODE_TYPES.TSAbstractClassProperty, + experimental_utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition, + experimental_utils_1.AST_NODE_TYPES.TSDeclareFunction, + experimental_utils_1.AST_NODE_TYPES.TSExportAssignment, + experimental_utils_1.AST_NODE_TYPES.TSImportEqualsDeclaration, + experimental_utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration, + ].reduce((acc, node) => { + acc[node] = checkForSemicolon; + return acc; + }, {}); + return Object.assign(Object.assign(Object.assign({}, rules), nodesToCheck), { ExportDefaultDeclaration(node) { + if (node.declaration.type !== experimental_utils_1.AST_NODE_TYPES.TSInterfaceDeclaration) { + rules.ExportDefaultDeclaration(node); + } + } }); + }, +}); +//# sourceMappingURL=semi.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/semi.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/semi.js.map new file mode 100644 index 000000000..5c2e0f7f7 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/semi.js.map @@ -0,0 +1 @@ +{"version":3,"file":"semi.js","sourceRoot":"","sources":["../../src/rules/semi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8EAI+C;AAC/C,iEAA6C;AAC7C,8CAAgC;AAKhC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE;YACJ,WAAW,EAAE,+CAA+C;YAC5D,QAAQ,EAAE,kBAAkB;YAC5B,oCAAoC;YACpC,WAAW,EAAE,KAAK;YAClB,eAAe,EAAE,IAAI;SACtB;QACD,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,cAAQ,CAAC,IAAI,CAAC,MAAM;QAC5B,QAAQ,QAAE,cAAQ,CAAC,IAAI,CAAC,QAAQ,mCAAI;YAClC,WAAW,EAAE,oBAAoB;YACjC,SAAS,EAAE,kBAAkB;SAC9B;KACF;IACD,cAAc,EAAE;QACd,QAAQ;QACR;YACE,sBAAsB,EAAE,KAAK;YAC7B,gCAAgC,EAAE,KAAK;SACxC;KACF;IACD,MAAM,CAAC,OAAO;QACZ,MAAM,KAAK,GAAG,cAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACvC,MAAM,iBAAiB,GAAG,KAAK,CAAC,mBAE/B,CAAC;QAEF;;;;;;;UAOE;QACF,MAAM,YAAY,GAAG;YACnB,mCAAc,CAAC,aAAa;YAC5B,mCAAc,CAAC,uBAAuB;YACtC,mCAAc,CAAC,0BAA0B;YACzC,mCAAc,CAAC,iBAAiB;YAChC,mCAAc,CAAC,kBAAkB;YACjC,mCAAc,CAAC,yBAAyB;YACxC,mCAAc,CAAC,sBAAsB;SACtC,CAAC,MAAM,CAAwB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YAC5C,GAAG,CAAC,IAAc,CAAC,GAAG,iBAAiB,CAAC;YACxC,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAE,CAAC,CAAC;QAEP,qDACK,KAAK,GACL,YAAY,KACf,wBAAwB,CAAC,IAAI;gBAC3B,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,mCAAc,CAAC,sBAAsB,EAAE;oBACnE,KAAK,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;iBACtC;YACH,CAAC,IACD;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/space-before-function-paren.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/space-before-function-paren.js new file mode 100644 index 000000000..3d9772307 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/space-before-function-paren.js @@ -0,0 +1,158 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'space-before-function-paren', + meta: { + type: 'layout', + docs: { + description: 'Enforces consistent spacing before function parenthesis', + category: 'Stylistic Issues', + recommended: false, + extendsBaseRule: true, + }, + fixable: 'whitespace', + schema: [ + { + oneOf: [ + { + enum: ['always', 'never'], + }, + { + type: 'object', + properties: { + anonymous: { + enum: ['always', 'never', 'ignore'], + }, + named: { + enum: ['always', 'never', 'ignore'], + }, + asyncArrow: { + enum: ['always', 'never', 'ignore'], + }, + }, + additionalProperties: false, + }, + ], + }, + ], + messages: { + unexpected: 'Unexpected space before function parentheses.', + missing: 'Missing space before function parentheses.', + }, + }, + defaultOptions: ['always'], + create(context) { + const sourceCode = context.getSourceCode(); + const baseConfig = typeof context.options[0] === 'string' ? context.options[0] : 'always'; + const overrideConfig = typeof context.options[0] === 'object' ? context.options[0] : {}; + /** + * Determines whether a function has a name. + * @param {ASTNode} node The function node. + * @returns {boolean} Whether the function has a name. + */ + function isNamedFunction(node) { + if (node.id != null) { + return true; + } + const parent = node.parent; + return (parent.type === experimental_utils_1.AST_NODE_TYPES.MethodDefinition || + parent.type === experimental_utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition || + (parent.type === experimental_utils_1.AST_NODE_TYPES.Property && + (parent.kind === 'get' || parent.kind === 'set' || parent.method))); + } + /** + * Gets the config for a given function + * @param {ASTNode} node The function node + * @returns {string} "always", "never", or "ignore" + */ + function getConfigForFunction(node) { + var _a, _b, _c; + if (node.type === experimental_utils_1.AST_NODE_TYPES.ArrowFunctionExpression) { + // Always ignore non-async functions and arrow functions without parens, e.g. async foo => bar + if (node.async && + util.isOpeningParenToken(sourceCode.getFirstToken(node, { skip: 1 }))) { + return (_a = overrideConfig.asyncArrow) !== null && _a !== void 0 ? _a : baseConfig; + } + } + else if (isNamedFunction(node)) { + return (_b = overrideConfig.named) !== null && _b !== void 0 ? _b : baseConfig; + // `generator-star-spacing` should warn anonymous generators. E.g. `function* () {}` + } + else if (!node.generator) { + return (_c = overrideConfig.anonymous) !== null && _c !== void 0 ? _c : baseConfig; + } + return 'ignore'; + } + /** + * Checks the parens of a function node + * @param {ASTNode} node A function node + * @returns {void} + */ + function checkFunction(node) { + const functionConfig = getConfigForFunction(node); + if (functionConfig === 'ignore') { + return; + } + let leftToken, rightToken; + if (node.typeParameters) { + leftToken = sourceCode.getLastToken(node.typeParameters); + rightToken = sourceCode.getTokenAfter(leftToken); + } + else { + rightToken = sourceCode.getFirstToken(node, util.isOpeningParenToken); + leftToken = sourceCode.getTokenBefore(rightToken); + } + const hasSpacing = sourceCode.isSpaceBetweenTokens(leftToken, rightToken); + if (hasSpacing && functionConfig === 'never') { + context.report({ + node, + loc: { + start: leftToken.loc.end, + end: rightToken.loc.start, + }, + messageId: 'unexpected', + fix: fixer => fixer.removeRange([leftToken.range[1], rightToken.range[0]]), + }); + } + else if (!hasSpacing && + functionConfig === 'always' && + (!node.typeParameters || node.id)) { + context.report({ + node, + loc: rightToken.loc, + messageId: 'missing', + fix: fixer => fixer.insertTextAfter(leftToken, ' '), + }); + } + } + return { + ArrowFunctionExpression: checkFunction, + FunctionDeclaration: checkFunction, + FunctionExpression: checkFunction, + TSEmptyBodyFunctionExpression: checkFunction, + TSDeclareFunction: checkFunction, + }; + }, +}); +//# sourceMappingURL=space-before-function-paren.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/space-before-function-paren.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/space-before-function-paren.js.map new file mode 100644 index 000000000..4f69e1993 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/space-before-function-paren.js.map @@ -0,0 +1 @@ +{"version":3,"file":"space-before-function-paren.js","sourceRoot":"","sources":["../../src/rules/space-before-function-paren.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,8CAAgC;AAehC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,6BAA6B;IACnC,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE;YACJ,WAAW,EAAE,yDAAyD;YACtE,QAAQ,EAAE,kBAAkB;YAC5B,WAAW,EAAE,KAAK;YAClB,eAAe,EAAE,IAAI;SACtB;QACD,OAAO,EAAE,YAAY;QACrB,MAAM,EAAE;YACN;gBACE,KAAK,EAAE;oBACL;wBACE,IAAI,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;qBAC1B;oBACD;wBACE,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,SAAS,EAAE;gCACT,IAAI,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC;6BACpC;4BACD,KAAK,EAAE;gCACL,IAAI,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC;6BACpC;4BACD,UAAU,EAAE;gCACV,IAAI,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC;6BACpC;yBACF;wBACD,oBAAoB,EAAE,KAAK;qBAC5B;iBACF;aACF;SACF;QACD,QAAQ,EAAE;YACR,UAAU,EAAE,+CAA+C;YAC3D,OAAO,EAAE,4CAA4C;SACtD;KACF;IACD,cAAc,EAAE,CAAC,QAAQ,CAAC;I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AAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;iBAC/D,CAAC,CAAC;aACJ;iBAAM,IACL,CAAC,UAAU;gBACX,cAAc,KAAK,QAAQ;gBAC3B,CAAC,CAAC,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,EAAE,CAAC,EACjC;gBACA,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI;oBACJ,GAAG,EAAE,UAAU,CAAC,GAAG;oBACnB,SAAS,EAAE,SAAS;oBACpB,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,SAAS,EAAE,GAAG,CAAC;iBACpD,CAAC,CAAC;aACJ;QACH,CAAC;QAED,OAAO;YACL,uBAAuB,EAAE,aAAa;YACtC,mBAAmB,EAAE,aAAa;YAClC,kBAAkB,EAAE,aAAa;YACjC,6BAA6B,EAAE,aAAa;YAC5C,iBAAiB,EAAE,aAAa;SACjC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.js new file mode 100644 index 000000000..3f2454c2a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.js @@ -0,0 +1,265 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const ts = __importStar(require("typescript")); +const tsutils = __importStar(require("tsutils")); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'strict-boolean-expressions', + meta: { + type: 'suggestion', + docs: { + description: 'Restricts the types allowed in boolean expressions', + category: 'Best Practices', + recommended: false, + requiresTypeChecking: true, + }, + schema: [ + { + type: 'object', + properties: { + allowString: { type: 'boolean' }, + allowNumber: { type: 'boolean' }, + allowNullableObject: { type: 'boolean' }, + allowNullableBoolean: { type: 'boolean' }, + allowNullableString: { type: 'boolean' }, + allowNullableNumber: { type: 'boolean' }, + allowAny: { type: 'boolean' }, + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: { + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], + messages: { + conditionErrorOther: 'Unexpected value in conditional. ' + + 'A boolean expression is required.', + conditionErrorAny: 'Unexpected any value in conditional. ' + + 'An explicit comparison or type cast is required.', + conditionErrorNullish: 'Unexpected nullish value in conditional. ' + + 'The condition is always false.', + conditionErrorNullableBoolean: 'Unexpected nullable boolean value in conditional. ' + + 'Please handle the nullish case explicitly.', + conditionErrorString: 'Unexpected string value in conditional. ' + + 'An explicit empty string check is required.', + conditionErrorNullableString: 'Unexpected nullable string value in conditional. ' + + 'Please handle the nullish/empty cases explicitly.', + conditionErrorNumber: 'Unexpected number value in conditional. ' + + 'An explicit zero/NaN check is required.', + conditionErrorNullableNumber: 'Unexpected nullable number value in conditional. ' + + 'Please handle the nullish/zero/NaN cases explicitly.', + conditionErrorObject: 'Unexpected object value in conditional. ' + + 'The condition is always true.', + conditionErrorNullableObject: 'Unexpected nullable object value in conditional. ' + + 'An explicit null check is required.', + noStrictNullCheck: 'This rule requires the `strictNullChecks` compiler option to be turned on to function correctly.', + }, + }, + defaultOptions: [ + { + allowString: true, + allowNumber: true, + allowNullableObject: true, + allowNullableBoolean: false, + allowNullableString: false, + allowNullableNumber: false, + allowAny: false, + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false, + }, + ], + create(context, [options]) { + const service = util.getParserServices(context); + const checker = service.program.getTypeChecker(); + const compilerOptions = service.program.getCompilerOptions(); + const isStrictNullChecks = tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'strictNullChecks'); + if (!isStrictNullChecks && + options.allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing !== true) { + context.report({ + loc: { + start: { line: 0, column: 0 }, + end: { line: 0, column: 0 }, + }, + messageId: 'noStrictNullCheck', + }); + } + const checkedNodes = new Set(); + return { + ConditionalExpression: checkTestExpression, + DoWhileStatement: checkTestExpression, + ForStatement: checkTestExpression, + IfStatement: checkTestExpression, + WhileStatement: checkTestExpression, + 'LogicalExpression[operator!="??"]': checkNode, + 'UnaryExpression[operator="!"]': checkUnaryLogicalExpression, + }; + function checkTestExpression(node) { + if (node.test == null) { + return; + } + checkNode(node.test, true); + } + function checkUnaryLogicalExpression(node) { + checkNode(node.argument, true); + } + /** + * This function analyzes the type of a node and checks if it is allowed in a boolean context. + * It can recurse when checking nested logical operators, so that only the outermost operands are reported. + * The right operand of a logical expression is ignored unless it's a part of a test expression (if/while/ternary/etc). + * @param node The AST node to check. + * @param isTestExpr Whether the node is a descendant of a test expression. + */ + function checkNode(node, isTestExpr = false) { + // prevent checking the same node multiple times + if (checkedNodes.has(node)) { + return; + } + checkedNodes.add(node); + // for logical operator, we check its operands + if (node.type === experimental_utils_1.AST_NODE_TYPES.LogicalExpression && + node.operator !== '??') { + checkNode(node.left, isTestExpr); + // we ignore the right operand when not in a context of a test expression + if (isTestExpr) { + checkNode(node.right, isTestExpr); + } + return; + } + const tsNode = service.esTreeNodeToTSNodeMap.get(node); + const type = util.getConstrainedTypeAtLocation(checker, tsNode); + const types = inspectVariantTypes(tsutils.unionTypeParts(type)); + const is = (...wantedTypes) => types.size === wantedTypes.length && + wantedTypes.every(type => types.has(type)); + // boolean + if (is('boolean')) { + // boolean is always okay + return; + } + // never + if (is('never')) { + // never is always okay + return; + } + // nullish + if (is('nullish')) { + // condition is always false + context.report({ node, messageId: 'conditionErrorNullish' }); + return; + } + // nullable boolean + if (is('nullish', 'boolean')) { + if (!options.allowNullableBoolean) { + context.report({ node, messageId: 'conditionErrorNullableBoolean' }); + } + return; + } + // string + if (is('string')) { + if (!options.allowString) { + context.report({ node, messageId: 'conditionErrorString' }); + } + return; + } + // nullable string + if (is('nullish', 'string')) { + if (!options.allowNullableString) { + context.report({ node, messageId: 'conditionErrorNullableString' }); + } + return; + } + // number + if (is('number')) { + if (!options.allowNumber) { + context.report({ node, messageId: 'conditionErrorNumber' }); + } + return; + } + // nullable number + if (is('nullish', 'number')) { + if (!options.allowNullableNumber) { + context.report({ node, messageId: 'conditionErrorNullableNumber' }); + } + return; + } + // object + if (is('object')) { + // condition is always true + context.report({ node, messageId: 'conditionErrorObject' }); + return; + } + // nullable object + if (is('nullish', 'object')) { + if (!options.allowNullableObject) { + context.report({ node, messageId: 'conditionErrorNullableObject' }); + } + return; + } + // any + if (is('any')) { + if (!options.allowAny) { + context.report({ node, messageId: 'conditionErrorAny' }); + } + return; + } + // other + context.report({ node, messageId: 'conditionErrorOther' }); + } + /** + * Check union variants for the types we care about + */ + function inspectVariantTypes(types) { + const variantTypes = new Set(); + if (types.some(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.Null | ts.TypeFlags.Undefined | ts.TypeFlags.VoidLike))) { + variantTypes.add('nullish'); + } + if (types.some(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.BooleanLike))) { + variantTypes.add('boolean'); + } + if (types.some(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.StringLike))) { + variantTypes.add('string'); + } + if (types.some(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.NumberLike | ts.TypeFlags.BigIntLike))) { + variantTypes.add('number'); + } + if (types.some(type => !tsutils.isTypeFlagSet(type, ts.TypeFlags.Null | + ts.TypeFlags.Undefined | + ts.TypeFlags.VoidLike | + ts.TypeFlags.BooleanLike | + ts.TypeFlags.StringLike | + ts.TypeFlags.NumberLike | + ts.TypeFlags.BigIntLike | + ts.TypeFlags.Any | + ts.TypeFlags.Unknown | + ts.TypeFlags.Never))) { + variantTypes.add('object'); + } + if (types.some(type => util.isTypeAnyType(type) || util.isTypeUnknownType(type))) { + variantTypes.add('any'); + } + if (types.some(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.Never))) { + variantTypes.add('never'); + } + return variantTypes; + } + }, +}); +//# sourceMappingURL=strict-boolean-expressions.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.js.map new file mode 100644 index 000000000..0c4d8dfb5 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"strict-boolean-expressions.js","sourceRoot":"","sources":["../../src/rules/strict-boolean-expressions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,+CAAiC;AACjC,iDAAmC;AACnC,8CAAgC;AA4BhC,kBAAe,IAAI,CAAC,UAAU,CAAqB;IACjD,IAAI,EAAE,4BAA4B;IAClC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,oDAAoD;YACjE,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,KAAK;YAClB,oBAAoB,EAAE,IAAI;SAC3B;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,WAAW,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;oBAChC,WAAW,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;oBAChC,mBAAmB,EAAE,EAAE,IAAI,E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CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js new file mode 100644 index 000000000..92ea5fa38 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js @@ -0,0 +1,158 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const tsutils_1 = require("tsutils"); +exports.default = util_1.createRule({ + name: 'switch-exhaustiveness-check', + meta: { + type: 'suggestion', + docs: { + description: 'Exhaustiveness checking in switch with union type', + category: 'Best Practices', + recommended: false, + suggestion: true, + requiresTypeChecking: true, + }, + schema: [], + messages: { + switchIsNotExhaustive: 'Switch is not exhaustive. Cases not matched: {{missingBranches}}', + addMissingCases: 'Add branches for missing cases.', + }, + }, + defaultOptions: [], + create(context) { + const sourceCode = context.getSourceCode(); + const service = util_1.getParserServices(context); + const checker = service.program.getTypeChecker(); + const compilerOptions = service.program.getCompilerOptions(); + function requiresQuoting(name) { + if (name.length === 0) { + return true; + } + if (!ts.isIdentifierStart(name.charCodeAt(0), compilerOptions.target)) { + return true; + } + for (let i = 1; i < name.length; i += 1) { + if (!ts.isIdentifierPart(name.charCodeAt(i), compilerOptions.target)) { + return true; + } + } + return false; + } + function getNodeType(node) { + const tsNode = service.esTreeNodeToTSNodeMap.get(node); + return util_1.getConstrainedTypeAtLocation(checker, tsNode); + } + function fixSwitch(fixer, node, missingBranchTypes, symbolName) { + var _a; + const lastCase = node.cases.length > 0 ? node.cases[node.cases.length - 1] : null; + const caseIndent = lastCase + ? ' '.repeat(lastCase.loc.start.column) + : // if there are no cases, use indentation of the switch statement + // and leave it to user to format it correctly + ' '.repeat(node.loc.start.column); + const missingCases = []; + for (const missingBranchType of missingBranchTypes) { + // While running this rule on checker.ts of TypeScript project + // the fix introduced a compiler error due to: + // + // type __String = (string & { + // __escapedIdentifier: void; + // }) | (void & { + // __escapedIdentifier: void; + // }) | InternalSymbolName; + // + // The following check fixes it. + if (missingBranchType.isIntersection()) { + continue; + } + const missingBranchName = (_a = missingBranchType.getSymbol()) === null || _a === void 0 ? void 0 : _a.escapedName; + let caseTest = checker.typeToString(missingBranchType); + if (symbolName && + (missingBranchName || missingBranchName === '') && + requiresQuoting(missingBranchName.toString())) { + caseTest = `${symbolName}['${missingBranchName}']`; + } + const errorMessage = `Not implemented yet: ${caseTest} case`; + missingCases.push(`case ${caseTest}: { throw new Error('${errorMessage}') }`); + } + const fixString = missingCases + .map(code => `${caseIndent}${code}`) + .join('\n'); + if (lastCase) { + return fixer.insertTextAfter(lastCase, `\n${fixString}`); + } + // there were no existing cases + const openingBrace = sourceCode.getTokenAfter(node.discriminant, util_1.isOpeningBraceToken); + const closingBrace = sourceCode.getTokenAfter(node.discriminant, util_1.isClosingBraceToken); + return fixer.replaceTextRange([openingBrace.range[0], closingBrace.range[1]], ['{', fixString, `${caseIndent}}`].join('\n')); + } + function checkSwitchExhaustive(node) { + var _a; + const discriminantType = getNodeType(node.discriminant); + const symbolName = (_a = discriminantType.getSymbol()) === null || _a === void 0 ? void 0 : _a.escapedName; + if (discriminantType.isUnion()) { + const unionTypes = tsutils_1.unionTypeParts(discriminantType); + const caseTypes = new Set(); + for (const switchCase of node.cases) { + if (switchCase.test === null) { + // Switch has 'default' branch - do nothing. + return; + } + caseTypes.add(getNodeType(switchCase.test)); + } + const missingBranchTypes = unionTypes.filter(unionType => !caseTypes.has(unionType)); + if (missingBranchTypes.length === 0) { + // All cases matched - do nothing. + return; + } + context.report({ + node: node.discriminant, + messageId: 'switchIsNotExhaustive', + data: { + missingBranches: missingBranchTypes + .map(missingType => { + var _a; + return tsutils_1.isTypeFlagSet(missingType, ts.TypeFlags.ESSymbolLike) + ? `typeof ${(_a = missingType.getSymbol()) === null || _a === void 0 ? void 0 : _a.escapedName}` + : checker.typeToString(missingType); + }) + .join(' | '), + }, + suggest: [ + { + messageId: 'addMissingCases', + fix(fixer) { + return fixSwitch(fixer, node, missingBranchTypes, symbolName === null || symbolName === void 0 ? void 0 : symbolName.toString()); + }, + }, + ], + }); + } + } + return { + SwitchStatement: checkSwitchExhaustive, + }; + }, +}); +//# sourceMappingURL=switch-exhaustiveness-check.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js.map new file mode 100644 index 000000000..0a8b9daf6 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js.map @@ -0,0 +1 @@ +{"version":3,"file":"switch-exhaustiveness-check.js","sourceRoot":"","sources":["../../src/rules/switch-exhaustiveness-check.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,+CAAiC;AACjC,kCAMiB;AACjB,qCAAwD;AAExD,kBAAe,iBAAU,CAAC;IACxB,IAAI,EAAE,6BAA6B;IACnC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,mDAAmD;YAChE,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,E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AC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;iBAC7C;gBAED,MAAM,kBAAkB,GAAG,UAAU,CAAC,MAAM,CAC1C,SAAS,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CACvC,CAAC;gBAEF,IAAI,kBAAkB,CAAC,MAAM,KAAK,CAAC,EAAE;oBACnC,kCAAkC;oBAClC,OAAO;iBACR;gBAED,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI,EAAE,IAAI,CAAC,YAAY;oBACvB,SAAS,EAAE,uBAAuB;oBAClC,IAAI,EAAE;wBACJ,eAAe,EAAE,kBAAkB;6BAChC,GAAG,CAAC,WAAW,CAAC,EAAE;;4BACjB,OAAA,uBAAa,CAAC,WAAW,EAAE,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC;gCACnD,CAAC,CAAC,UAAU,MAAA,WAAW,CAAC,SAAS,EAAE,0CAAE,WAAW,EAAE;gCAClD,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,CAAA;yBAAA,CACtC;6BACA,IAAI,CAAC,KAAK,CAAC;qBACf;oBACD,OAAO,EAAE;wBACP;4BACE,SAAS,EAAE,iBAAiB;4BAC5B,GAAG,CAAC,KAAK;gCACP,OAAO,SAAS,CACd,KAAK,EACL,IAAI,EACJ,kBAAkB,EAClB,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,QAAQ,GACrB,CAAC;4BACJ,CAAC;yBACF;qBACF;iBACF,CAAC,CAAC;aACJ;QACH,CAAC;QAED,OAAO;YACL,eAAe,EAAE,qBAAqB;SACvC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference.js new file mode 100644 index 000000000..943df2eb8 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference.js @@ -0,0 +1,125 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'triple-slash-reference', + meta: { + type: 'suggestion', + docs: { + description: 'Sets preference level for triple slash directives versus ES6-style import declarations', + category: 'Best Practices', + recommended: 'error', + }, + messages: { + tripleSlashReference: 'Do not use a triple slash reference for {{module}}, use `import` style instead.', + }, + schema: [ + { + type: 'object', + properties: { + lib: { + enum: ['always', 'never'], + }, + path: { + enum: ['always', 'never'], + }, + types: { + enum: ['always', 'never', 'prefer-import'], + }, + }, + additionalProperties: false, + }, + ], + }, + defaultOptions: [ + { + lib: 'always', + path: 'never', + types: 'prefer-import', + }, + ], + create(context, [{ lib, path, types }]) { + let programNode; + const sourceCode = context.getSourceCode(); + const references = []; + function hasMatchingReference(source) { + references.forEach(reference => { + if (reference.importName === source.value) { + context.report({ + node: reference.comment, + messageId: 'tripleSlashReference', + data: { + module: reference.importName, + }, + }); + } + }); + } + return { + ImportDeclaration(node) { + if (programNode) { + hasMatchingReference(node.source); + } + }, + TSImportEqualsDeclaration(node) { + if (programNode) { + const source = node.moduleReference + .expression; + hasMatchingReference(source); + } + }, + Program(node) { + if (lib === 'always' && path === 'always' && types == 'always') { + return; + } + programNode = node; + const referenceRegExp = /^\/\s* { + if (comment.type !== experimental_utils_1.AST_TOKEN_TYPES.Line) { + return; + } + const referenceResult = referenceRegExp.exec(comment.value); + if (referenceResult) { + if ((referenceResult[1] === 'types' && types === 'never') || + (referenceResult[1] === 'path' && path === 'never') || + (referenceResult[1] === 'lib' && lib === 'never')) { + context.report({ + node: comment, + messageId: 'tripleSlashReference', + data: { + module: referenceResult[2], + }, + }); + return; + } + if (referenceResult[1] === 'types' && types === 'prefer-import') { + references.push({ comment, importName: referenceResult[2] }); + } + } + }); + }, + }; + }, +}); +//# sourceMappingURL=triple-slash-reference.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference.js.map new file mode 100644 index 000000000..3efae8a3f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference.js.map @@ -0,0 +1 @@ +{"version":3,"file":"triple-slash-reference.js","sourceRoot":"","sources":["../../src/rules/triple-slash-reference.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,8CAAgC;AAWhC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EACT,wFAAwF;YAC1F,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,OAAO;SACrB;QACD,QAAQ,EAAE;YACR,oBAAoB,EAClB,iFAAiF;SACpF;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,GAAG,EAAE;wBACH,IAAI,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;qBAC1B;oBACD,IAAI,EAAE;wBACJ,IAAI,EAAE,CAAC,Q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AAI,QAAQ,EAAE;oBAC9D,OAAO;iBACR;gBACD,WAAW,GAAG,IAAI,CAAC;gBACnB,MAAM,eAAe,GAAG,0DAA0D,CAAC;gBACnF,MAAM,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;gBAEjE,cAAc,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;oBAC/B,IAAI,OAAO,CAAC,IAAI,KAAK,oCAAe,CAAC,IAAI,EAAE;wBACzC,OAAO;qBACR;oBACD,MAAM,eAAe,GAAG,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;oBAE5D,IAAI,eAAe,EAAE;wBACnB,IACE,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,OAAO,IAAI,KAAK,KAAK,OAAO,CAAC;4BACrD,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,MAAM,IAAI,IAAI,KAAK,OAAO,CAAC;4BACnD,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,KAAK,IAAI,GAAG,KAAK,OAAO,CAAC,EACjD;4BACA,OAAO,CAAC,MAAM,CAAC;gCACb,IAAI,EAAE,OAAO;gCACb,SAAS,EAAE,sBAAsB;gCACjC,IAAI,EAAE;oCACJ,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC;iCAC3B;6BACF,CAAC,CAAC;4BACH,OAAO;yBACR;wBACD,IAAI,eAAe,CAAC,CAAC,CAAC,KAAK,OAAO,IAAI,KAAK,KAAK,eAAe,EAAE;4BAC/D,UAAU,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;yBAC9D;qBACF;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/type-annotation-spacing.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/type-annotation-spacing.js new file mode 100644 index 000000000..fc017d7a9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/type-annotation-spacing.js @@ -0,0 +1,221 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const util = __importStar(require("../util")); +const util_1 = require("../util"); +const definition = { + type: 'object', + properties: { + before: { type: 'boolean' }, + after: { type: 'boolean' }, + }, + additionalProperties: false, +}; +function createRules(options) { + var _a; + const globals = Object.assign(Object.assign({}, ((options === null || options === void 0 ? void 0 : options.before) !== undefined ? { before: options.before } : {})), ((options === null || options === void 0 ? void 0 : options.after) !== undefined ? { after: options.after } : {})); + const override = (_a = options === null || options === void 0 ? void 0 : options.overrides) !== null && _a !== void 0 ? _a : {}; + const colon = Object.assign(Object.assign({ before: false, after: true }, globals), override === null || override === void 0 ? void 0 : override.colon); + const arrow = Object.assign(Object.assign({ before: true, after: true }, globals), override === null || override === void 0 ? void 0 : override.arrow); + return { + colon: colon, + arrow: arrow, + variable: Object.assign(Object.assign({}, colon), override === null || override === void 0 ? void 0 : override.variable), + property: Object.assign(Object.assign({}, colon), override === null || override === void 0 ? void 0 : override.property), + parameter: Object.assign(Object.assign({}, colon), override === null || override === void 0 ? void 0 : override.parameter), + returnType: Object.assign(Object.assign({}, colon), override === null || override === void 0 ? void 0 : override.returnType), + }; +} +function getIdentifierRules(rules, node) { + const scope = node === null || node === void 0 ? void 0 : node.parent; + if (util_1.isVariableDeclarator(scope)) { + return rules.variable; + } + else if (util_1.isFunctionOrFunctionType(scope)) { + return rules.parameter; + } + else { + return rules.colon; + } +} +function getRules(rules, node) { + var _a; + const scope = (_a = node === null || node === void 0 ? void 0 : node.parent) === null || _a === void 0 ? void 0 : _a.parent; + if (util_1.isTSFunctionType(scope) || util_1.isTSConstructorType(scope)) { + return rules.arrow; + } + else if (util_1.isIdentifier(scope)) { + return getIdentifierRules(rules, scope); + } + else if (util_1.isClassOrTypeElement(scope)) { + return rules.property; + } + else if (util_1.isFunction(scope)) { + return rules.returnType; + } + else { + return rules.colon; + } +} +exports.default = util.createRule({ + name: 'type-annotation-spacing', + meta: { + type: 'layout', + docs: { + description: 'Require consistent spacing around type annotations', + category: 'Stylistic Issues', + recommended: false, + }, + fixable: 'whitespace', + messages: { + expectedSpaceAfter: "Expected a space after the '{{type}}'.", + expectedSpaceBefore: "Expected a space before the '{{type}}'.", + unexpectedSpaceAfter: "Unexpected space after the '{{type}}'.", + unexpectedSpaceBefore: "Unexpected space before the '{{type}}'.", + }, + schema: [ + { + type: 'object', + properties: { + before: { type: 'boolean' }, + after: { type: 'boolean' }, + overrides: { + type: 'object', + properties: { + colon: definition, + arrow: definition, + variable: definition, + parameter: definition, + property: definition, + returnType: definition, + }, + additionalProperties: false, + }, + }, + additionalProperties: false, + }, + ], + }, + defaultOptions: [ + // technically there is a default, but the overrides mean + // that if we apply them here, it will break the no override case. + {}, + ], + create(context, [options]) { + const punctuators = [':', '=>']; + const sourceCode = context.getSourceCode(); + const ruleSet = createRules(options); + /** + * Checks if there's proper spacing around type annotations (no space + * before colon, one space after). + */ + function checkTypeAnnotationSpacing(typeAnnotation) { + const nextToken = typeAnnotation; + const punctuatorTokenEnd = sourceCode.getTokenBefore(nextToken); + let punctuatorTokenStart = punctuatorTokenEnd; + let previousToken = sourceCode.getTokenBefore(punctuatorTokenEnd); + let type = punctuatorTokenEnd.value; + if (!punctuators.includes(type)) { + return; + } + const { before, after } = getRules(ruleSet, typeAnnotation); + if (type === ':' && previousToken.value === '?') { + // shift the start to the ? + type = '?:'; + punctuatorTokenStart = previousToken; + previousToken = sourceCode.getTokenBefore(previousToken); + // handle the +/- modifiers for optional modification operators + if (previousToken.value === '+' || previousToken.value === '-') { + type = `${previousToken.value}?:`; + punctuatorTokenStart = previousToken; + previousToken = sourceCode.getTokenBefore(previousToken); + } + } + const previousDelta = punctuatorTokenStart.range[0] - previousToken.range[1]; + const nextDelta = nextToken.range[0] - punctuatorTokenEnd.range[1]; + if (after && nextDelta === 0) { + context.report({ + node: punctuatorTokenEnd, + messageId: 'expectedSpaceAfter', + data: { + type, + }, + fix(fixer) { + return fixer.insertTextAfter(punctuatorTokenEnd, ' '); + }, + }); + } + else if (!after && nextDelta > 0) { + context.report({ + node: punctuatorTokenEnd, + messageId: 'unexpectedSpaceAfter', + data: { + type, + }, + fix(fixer) { + return fixer.removeRange([ + punctuatorTokenEnd.range[1], + nextToken.range[0], + ]); + }, + }); + } + if (before && previousDelta === 0) { + context.report({ + node: punctuatorTokenStart, + messageId: 'expectedSpaceBefore', + data: { + type, + }, + fix(fixer) { + return fixer.insertTextAfter(previousToken, ' '); + }, + }); + } + else if (!before && previousDelta > 0) { + context.report({ + node: punctuatorTokenStart, + messageId: 'unexpectedSpaceBefore', + data: { + type, + }, + fix(fixer) { + return fixer.removeRange([ + previousToken.range[1], + punctuatorTokenStart.range[0], + ]); + }, + }); + } + } + return { + TSMappedType(node) { + if (node.typeAnnotation) { + checkTypeAnnotationSpacing(node.typeAnnotation); + } + }, + TSTypeAnnotation(node) { + checkTypeAnnotationSpacing(node.typeAnnotation); + }, + }; + }, +}); +//# sourceMappingURL=type-annotation-spacing.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/type-annotation-spacing.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/type-annotation-spacing.js.map new file mode 100644 index 000000000..fb0086405 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/type-annotation-spacing.js.map @@ -0,0 +1 @@ +{"version":3,"file":"type-annotation-spacing.js","sourceRoot":"","sources":["../../src/rules/type-annotation-spacing.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,8CAAgC;AAChC,kCAQiB;AA6BjB,MAAM,UAAU,GAAG;IACjB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QAC3B,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC3B;IACD,oBAAoB,EAAE,KAAK;CAC5B,CAAC;AAEF,SAAS,WAAW,CAAC,OAAgB;;IACnC,MAAM,OAAO,mCACR,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,MAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GACjE,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,MAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAClE,CAAC;IACF,MAAM,QAAQ,SAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,mCAAI,EAAE,CAAC;IAC1C,MAAM,KAAK,+BACN,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAC9B,OAAO,GACP,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,CACnB,CAAC;IACF,MAAM,KAAK,+BACN,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAC7B,OAAO,GACP,QAAQ,aAAR,QAAQ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KAAK;wBACP,OAAO,KAAK,CAAC,WAAW,CAAC;4BACvB,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;4BACtB,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC;yBAC9B,CAAC,CAAC;oBACL,CAAC;iBACF,CAAC,CAAC;aACJ;QACH,CAAC;QAED,OAAO;YACL,YAAY,CAAC,IAAI;gBACf,IAAI,IAAI,CAAC,cAAc,EAAE;oBACvB,0BAA0B,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;iBACjD;YACH,CAAC;YACD,gBAAgB,CAAC,IAAI;gBACnB,0BAA0B,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAClD,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.js new file mode 100644 index 000000000..fb4c63ca4 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.js @@ -0,0 +1,204 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'typedef', + meta: { + docs: { + description: 'Requires type annotations to exist', + category: 'Stylistic Issues', + recommended: false, + }, + messages: { + expectedTypedef: 'Expected a type annotation.', + expectedTypedefNamed: 'Expected {{name}} to have a type annotation.', + }, + schema: [ + { + type: 'object', + properties: { + ["arrayDestructuring" /* ArrayDestructuring */]: { type: 'boolean' }, + ["arrowParameter" /* ArrowParameter */]: { type: 'boolean' }, + ["memberVariableDeclaration" /* MemberVariableDeclaration */]: { type: 'boolean' }, + ["objectDestructuring" /* ObjectDestructuring */]: { type: 'boolean' }, + ["parameter" /* Parameter */]: { type: 'boolean' }, + ["propertyDeclaration" /* PropertyDeclaration */]: { type: 'boolean' }, + ["variableDeclaration" /* VariableDeclaration */]: { type: 'boolean' }, + ["variableDeclarationIgnoreFunction" /* VariableDeclarationIgnoreFunction */]: { type: 'boolean' }, + }, + }, + ], + type: 'suggestion', + }, + defaultOptions: [ + { + ["arrayDestructuring" /* ArrayDestructuring */]: false, + ["arrowParameter" /* ArrowParameter */]: false, + ["memberVariableDeclaration" /* MemberVariableDeclaration */]: false, + ["objectDestructuring" /* ObjectDestructuring */]: false, + ["parameter" /* Parameter */]: false, + ["propertyDeclaration" /* PropertyDeclaration */]: false, + ["variableDeclaration" /* VariableDeclaration */]: false, + ["variableDeclarationIgnoreFunction" /* VariableDeclarationIgnoreFunction */]: false, + }, + ], + create(context, [options]) { + function report(location, name) { + context.report({ + node: location, + messageId: name ? 'expectedTypedefNamed' : 'expectedTypedef', + data: { name }, + }); + } + function getNodeName(node) { + return node.type === experimental_utils_1.AST_NODE_TYPES.Identifier ? node.name : undefined; + } + function isForOfStatementContext(node) { + let current = node.parent; + while (current) { + switch (current.type) { + case experimental_utils_1.AST_NODE_TYPES.VariableDeclarator: + case experimental_utils_1.AST_NODE_TYPES.VariableDeclaration: + case experimental_utils_1.AST_NODE_TYPES.ObjectPattern: + case experimental_utils_1.AST_NODE_TYPES.ArrayPattern: + case experimental_utils_1.AST_NODE_TYPES.Property: + current = current.parent; + break; + case experimental_utils_1.AST_NODE_TYPES.ForOfStatement: + return true; + default: + current = undefined; + } + } + return false; + } + function checkParameters(params) { + for (const param of params) { + let annotationNode; + switch (param.type) { + case experimental_utils_1.AST_NODE_TYPES.AssignmentPattern: + annotationNode = param.left; + break; + case experimental_utils_1.AST_NODE_TYPES.TSParameterProperty: + annotationNode = param.parameter; + // Check TS parameter property with default value like `constructor(private param: string = 'something') {}` + if (annotationNode && + annotationNode.type === experimental_utils_1.AST_NODE_TYPES.AssignmentPattern) { + annotationNode = annotationNode.left; + } + break; + default: + annotationNode = param; + break; + } + if (annotationNode !== undefined && !annotationNode.typeAnnotation) { + report(param, getNodeName(param)); + } + } + } + function isVariableDeclarationIgnoreFunction(node) { + return (!!options["variableDeclarationIgnoreFunction" /* VariableDeclarationIgnoreFunction */] && + (node.type === experimental_utils_1.AST_NODE_TYPES.FunctionExpression || + node.type === experimental_utils_1.AST_NODE_TYPES.ArrowFunctionExpression)); + } + return { + ArrayPattern(node) { + var _a; + if (((_a = node.parent) === null || _a === void 0 ? void 0 : _a.type) === experimental_utils_1.AST_NODE_TYPES.RestElement && + node.parent.typeAnnotation) { + return; + } + if (options["arrayDestructuring" /* ArrayDestructuring */] && + !node.typeAnnotation && + !isForOfStatementContext(node)) { + report(node); + } + }, + ArrowFunctionExpression(node) { + if (options["arrowParameter" /* ArrowParameter */]) { + checkParameters(node.params); + } + }, + ClassProperty(node) { + if (node.value && isVariableDeclarationIgnoreFunction(node.value)) { + return; + } + if (options["memberVariableDeclaration" /* MemberVariableDeclaration */] && + !node.typeAnnotation) { + report(node, node.key.type === experimental_utils_1.AST_NODE_TYPES.Identifier + ? node.key.name + : undefined); + } + }, + 'FunctionDeclaration, FunctionExpression'(node) { + if (options["parameter" /* Parameter */]) { + checkParameters(node.params); + } + }, + ObjectPattern(node) { + if (options["objectDestructuring" /* ObjectDestructuring */] && + !node.typeAnnotation && + !isForOfStatementContext(node)) { + report(node); + } + }, + 'TSIndexSignature, TSPropertySignature'(node) { + if (options["propertyDeclaration" /* PropertyDeclaration */] && !node.typeAnnotation) { + report(node, node.type === experimental_utils_1.AST_NODE_TYPES.TSPropertySignature + ? getNodeName(node.key) + : undefined); + } + }, + VariableDeclarator(node) { + if (!options["variableDeclaration" /* VariableDeclaration */] || + node.id.typeAnnotation || + (node.id.type === experimental_utils_1.AST_NODE_TYPES.ArrayPattern && + !options["arrayDestructuring" /* ArrayDestructuring */]) || + (node.id.type === experimental_utils_1.AST_NODE_TYPES.ObjectPattern && + !options["objectDestructuring" /* ObjectDestructuring */]) || + (node.init && isVariableDeclarationIgnoreFunction(node.init))) { + return; + } + let current = node.parent; + while (current) { + switch (current.type) { + case experimental_utils_1.AST_NODE_TYPES.VariableDeclaration: + // Keep looking upwards + current = current.parent; + break; + case experimental_utils_1.AST_NODE_TYPES.ForOfStatement: + case experimental_utils_1.AST_NODE_TYPES.ForInStatement: + // Stop traversing and don't report an error + return; + default: + // Stop traversing + current = undefined; + break; + } + } + report(node, getNodeName(node.id)); + }, + }; + }, +}); +//# sourceMappingURL=typedef.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.js.map new file mode 100644 index 000000000..bc2080836 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.js.map @@ -0,0 +1 @@ +{"version":3,"file":"typedef.js","sourceRoot":"","sources":["../../src/rules/typedef.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,8CAAgC;AAiBhC,kBAAe,IAAI,CAAC,UAAU,CAAwB;IACpD,IAAI,EAAE,SAAS;IACf,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,WAAW,EAAE,oCAAoC;YACjD,QAAQ,EAAE,kBAAkB;YAC5B,WAAW,EAAE,KAAK;SACnB;QACD,QAAQ,EAAE;YACR,eAAe,EAAE,6BAA6B;YAC9C,oBAAoB,EAAE,8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AW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;YACrC,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js new file mode 100644 index 000000000..88777e02a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js @@ -0,0 +1,258 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const tsutils = __importStar(require("tsutils")); +const ts = __importStar(require("typescript")); +const util = __importStar(require("../util")); +/** + * The following is a list of exceptions to the rule + * Generated via the following script. + * This is statically defined to save making purposely invalid calls every lint run + * ``` +SUPPORTED_GLOBALS.flatMap(namespace => { + const object = window[namespace]; + return Object.getOwnPropertyNames(object) + .filter( + name => + !name.startsWith('_') && + typeof object[name] === 'function', + ) + .map(name => { + try { + const x = object[name]; + x(); + } catch (e) { + if (e.message.includes("called on non-object")) { + return `${namespace}.${name}`; + } + } + }); +}).filter(Boolean); + * ``` + */ +const nativelyNotBoundMembers = new Set([ + 'Promise.all', + 'Promise.race', + 'Promise.resolve', + 'Promise.reject', + 'Promise.allSettled', + 'Object.defineProperties', + 'Object.defineProperty', + 'Reflect.defineProperty', + 'Reflect.deleteProperty', + 'Reflect.get', + 'Reflect.getOwnPropertyDescriptor', + 'Reflect.getPrototypeOf', + 'Reflect.has', + 'Reflect.isExtensible', + 'Reflect.ownKeys', + 'Reflect.preventExtensions', + 'Reflect.set', + 'Reflect.setPrototypeOf', +]); +const SUPPORTED_GLOBALS = [ + 'Number', + 'Object', + 'String', + 'RegExp', + 'Symbol', + 'Array', + 'Proxy', + 'Date', + 'Infinity', + 'Atomics', + 'Reflect', + 'console', + 'Math', + 'JSON', + 'Intl', +]; +const nativelyBoundMembers = SUPPORTED_GLOBALS.map(namespace => { + if (!(namespace in global)) { + // node.js might not have namespaces like Intl depending on compilation options + // https://nodejs.org/api/intl.html#intl_options_for_building_node_js + return []; + } + const object = global[namespace]; + return Object.getOwnPropertyNames(object) + .filter(name => !name.startsWith('_') && + typeof object[name] === 'function') + .map(name => `${namespace}.${name}`); +}) + .reduce((arr, names) => arr.concat(names), []) + .filter(name => !nativelyNotBoundMembers.has(name)); +const isNotImported = (symbol, currentSourceFile) => { + const { valueDeclaration } = symbol; + if (!valueDeclaration) { + // working around https://github.com/microsoft/TypeScript/issues/31294 + return false; + } + return (!!currentSourceFile && + currentSourceFile !== valueDeclaration.getSourceFile()); +}; +const getNodeName = (node) => node.type === experimental_utils_1.AST_NODE_TYPES.Identifier ? node.name : null; +const getMemberFullName = (node) => `${getNodeName(node.object)}.${getNodeName(node.property)}`; +exports.default = util.createRule({ + name: 'unbound-method', + meta: { + docs: { + category: 'Best Practices', + description: 'Enforces unbound methods are called with their expected scope', + recommended: 'error', + requiresTypeChecking: true, + }, + messages: { + unbound: 'Avoid referencing unbound methods which may cause unintentional scoping of `this`.', + }, + schema: [ + { + type: 'object', + properties: { + ignoreStatic: { + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], + type: 'problem', + }, + defaultOptions: [ + { + ignoreStatic: false, + }, + ], + create(context, [{ ignoreStatic }]) { + const parserServices = util.getParserServices(context); + const checker = parserServices.program.getTypeChecker(); + const currentSourceFile = parserServices.program.getSourceFile(context.getFilename()); + return { + MemberExpression(node) { + if (isSafeUse(node)) { + return; + } + const objectSymbol = checker.getSymbolAtLocation(parserServices.esTreeNodeToTSNodeMap.get(node.object)); + if (objectSymbol && + nativelyBoundMembers.includes(getMemberFullName(node)) && + isNotImported(objectSymbol, currentSourceFile)) { + return; + } + const originalNode = parserServices.esTreeNodeToTSNodeMap.get(node); + const symbol = checker.getSymbolAtLocation(originalNode); + if (symbol && isDangerousMethod(symbol, ignoreStatic)) { + context.report({ + messageId: 'unbound', + node, + }); + } + }, + 'VariableDeclarator, AssignmentExpression'(node) { + const [idNode, initNode] = node.type === experimental_utils_1.AST_NODE_TYPES.VariableDeclarator + ? [node.id, node.init] + : [node.left, node.right]; + if (initNode && idNode.type === experimental_utils_1.AST_NODE_TYPES.ObjectPattern) { + const tsNode = parserServices.esTreeNodeToTSNodeMap.get(initNode); + const rightSymbol = checker.getSymbolAtLocation(tsNode); + const initTypes = checker.getTypeAtLocation(tsNode); + const notImported = rightSymbol && isNotImported(rightSymbol, currentSourceFile); + idNode.properties.forEach(property => { + if (property.type === experimental_utils_1.AST_NODE_TYPES.Property && + property.key.type === experimental_utils_1.AST_NODE_TYPES.Identifier) { + if (notImported && + util.isIdentifier(initNode) && + nativelyBoundMembers.includes(`${initNode.name}.${property.key.name}`)) { + return; + } + const symbol = initTypes.getProperty(property.key.name); + if (symbol && isDangerousMethod(symbol, ignoreStatic)) { + context.report({ + messageId: 'unbound', + node, + }); + } + } + }); + } + }, + }; + }, +}); +function isDangerousMethod(symbol, ignoreStatic) { + var _a; + const { valueDeclaration } = symbol; + if (!valueDeclaration) { + // working around https://github.com/microsoft/TypeScript/issues/31294 + return false; + } + switch (valueDeclaration.kind) { + case ts.SyntaxKind.PropertyDeclaration: + return (((_a = valueDeclaration.initializer) === null || _a === void 0 ? void 0 : _a.kind) === + ts.SyntaxKind.FunctionExpression); + case ts.SyntaxKind.MethodDeclaration: + case ts.SyntaxKind.MethodSignature: + return !(ignoreStatic && + tsutils.hasModifier(valueDeclaration.modifiers, ts.SyntaxKind.StaticKeyword)); + } + return false; +} +function isSafeUse(node) { + const parent = node.parent; + switch (parent === null || parent === void 0 ? void 0 : parent.type) { + case experimental_utils_1.AST_NODE_TYPES.IfStatement: + case experimental_utils_1.AST_NODE_TYPES.ForStatement: + case experimental_utils_1.AST_NODE_TYPES.MemberExpression: + case experimental_utils_1.AST_NODE_TYPES.SwitchStatement: + case experimental_utils_1.AST_NODE_TYPES.UpdateExpression: + case experimental_utils_1.AST_NODE_TYPES.WhileStatement: + return true; + case experimental_utils_1.AST_NODE_TYPES.CallExpression: + return parent.callee === node; + case experimental_utils_1.AST_NODE_TYPES.ConditionalExpression: + return parent.test === node; + case experimental_utils_1.AST_NODE_TYPES.TaggedTemplateExpression: + return parent.tag === node; + case experimental_utils_1.AST_NODE_TYPES.UnaryExpression: + // the first case is safe for obvious + // reasons. The second one is also fine + // since we're returning something falsy + return ['typeof', '!', 'void', 'delete'].includes(parent.operator); + case experimental_utils_1.AST_NODE_TYPES.BinaryExpression: + return ['instanceof', '==', '!=', '===', '!=='].includes(parent.operator); + case experimental_utils_1.AST_NODE_TYPES.AssignmentExpression: + return parent.operator === '=' && node === parent.left; + case experimental_utils_1.AST_NODE_TYPES.ChainExpression: + case experimental_utils_1.AST_NODE_TYPES.TSNonNullExpression: + case experimental_utils_1.AST_NODE_TYPES.TSAsExpression: + case experimental_utils_1.AST_NODE_TYPES.TSTypeAssertion: + return isSafeUse(parent); + case experimental_utils_1.AST_NODE_TYPES.LogicalExpression: + if (parent.operator === '&&' && parent.left === node) { + // this is safe, as && will return the left if and only if it's falsy + return true; + } + // in all other cases, it's likely the logical expression will return the method ref + // so make sure the parent is a safe usage + return isSafeUse(parent); + } + return false; +} +//# sourceMappingURL=unbound-method.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js.map new file mode 100644 index 000000000..a42745e42 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js.map @@ -0,0 +1 @@ +{"version":3,"file":"unbound-method.js","sourceRoot":"","sources":["../../src/rules/unbound-method.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,8EAG+C;AAC/C,iDAAmC;AACnC,+CAAiC;AACjC,8CAAgC;AAchC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAC;IACtC,aAAa;IACb,cAAc;IACd,iBAAiB;IACjB,gBAAgB;IAChB,oBAAoB;IACpB,yBAAyB;IACzB,uBAAuB;IACvB,wBAAwB;IACxB,wBAAwB;IACxB,aAAa;IACb,kCAAkC;IAClC,wBAAwB;IACxB,aAAa;IACb,sBAAsB;IACtB,iBAAiB;IACjB,2BAA2B;IAC3B,aAAa;IACb,wBAAwB;CACzB,CAAC,CAAC;AACH,MAAM,iBAAiB,GAAG;IACxB,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,OAAO;IACP,MAAM;IACN,UAAU;IACV,SAAS;IACT,SAAS;IACT,SAAS;IACT,MAAM;IACN,MAAM;IACN,MAAM;CACE,CAAC;AACX,MAAM,oBAAoB,GAAG,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;IAC7D,IAAI,CAAC,CAAC,SAAS,IAAI,MAAM,CAAC,EAAE;QAC1B,+EAA+E;QAC/E,qEAAqE;QACrE,OAAO,EAAE,CAAC;KACX;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IACjC,OAAO,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC;SACtC,MAAM,CACL,IAAI,CAAC,EAAE,CACL,CAAC,IAAI,CAAC,UAAU,C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-eslint/eslint-plugin/dist/rules/unified-signatures.js b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js new file mode 100644 index 000000000..c20553a4c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js @@ -0,0 +1,396 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'unified-signatures', + meta: { + docs: { + description: 'Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter', + category: 'Variables', + // too opinionated to be recommended + recommended: false, + }, + type: 'suggestion', + messages: { + omittingRestParameter: '{{failureStringStart}} with a rest parameter.', + omittingSingleParameter: '{{failureStringStart}} with an optional parameter.', + singleParameterDifference: '{{failureStringStart}} taking `{{type1}} | {{type2}}`.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const sourceCode = context.getSourceCode(); + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + function failureStringStart(otherLine) { + // For only 2 overloads we don't need to specify which is the other one. + const overloads = otherLine === undefined + ? 'These overloads' + : `This overload and the one on line ${otherLine}`; + return `${overloads} can be combined into one signature`; + } + function addFailures(failures) { + for (const failure of failures) { + const { unify, only2 } = failure; + switch (unify.kind) { + case 'single-parameter-difference': { + const { p0, p1 } = unify; + const lineOfOtherOverload = only2 ? undefined : p0.loc.start.line; + const typeAnnotation0 = isTSParameterProperty(p0) + ? p0.parameter.typeAnnotation + : p0.typeAnnotation; + const typeAnnotation1 = isTSParameterProperty(p1) + ? p1.parameter.typeAnnotation + : p1.typeAnnotation; + context.report({ + loc: p1.loc, + messageId: 'singleParameterDifference', + data: { + failureStringStart: failureStringStart(lineOfOtherOverload), + type1: sourceCode.getText(typeAnnotation0 === null || typeAnnotation0 === void 0 ? void 0 : typeAnnotation0.typeAnnotation), + type2: sourceCode.getText(typeAnnotation1 === null || typeAnnotation1 === void 0 ? void 0 : typeAnnotation1.typeAnnotation), + }, + node: p1, + }); + break; + } + case 'extra-parameter': { + const { extraParameter, otherSignature } = unify; + const lineOfOtherOverload = only2 + ? undefined + : otherSignature.loc.start.line; + context.report({ + loc: extraParameter.loc, + messageId: extraParameter.type === experimental_utils_1.AST_NODE_TYPES.RestElement + ? 'omittingRestParameter' + : 'omittingSingleParameter', + data: { + failureStringStart: failureStringStart(lineOfOtherOverload), + }, + node: extraParameter, + }); + } + } + } + } + function checkOverloads(signatures, typeParameters) { + const result = []; + const isTypeParameter = getIsTypeParameter(typeParameters); + for (const overloads of signatures) { + if (overloads.length === 2) { + const signature0 = overloads[0].value || overloads[0]; + const signature1 = overloads[1].value || overloads[1]; + const unify = compareSignatures(signature0, signature1, isTypeParameter); + if (unify !== undefined) { + result.push({ unify, only2: true }); + } + } + else { + forEachPair(overloads, (a, b) => { + const signature0 = a.value || a; + const signature1 = b.value || b; + const unify = compareSignatures(signature0, signature1, isTypeParameter); + if (unify !== undefined) { + result.push({ unify, only2: false }); + } + }); + } + } + return result; + } + function compareSignatures(a, b, isTypeParameter) { + if (!signaturesCanBeUnified(a, b, isTypeParameter)) { + return undefined; + } + return a.params.length === b.params.length + ? signaturesDifferBySingleParameter(a.params, b.params) + : signaturesDifferByOptionalOrRestParameter(a, b); + } + function signaturesCanBeUnified(a, b, isTypeParameter) { + // Must return the same type. + const aTypeParams = a.typeParameters !== undefined ? a.typeParameters.params : undefined; + const bTypeParams = b.typeParameters !== undefined ? b.typeParameters.params : undefined; + return (typesAreEqual(a.returnType, b.returnType) && + // Must take the same type parameters. + // If one uses a type parameter (from outside) and the other doesn't, they shouldn't be joined. + util.arraysAreEqual(aTypeParams, bTypeParams, typeParametersAreEqual) && + signatureUsesTypeParameter(a, isTypeParameter) === + signatureUsesTypeParameter(b, isTypeParameter)); + } + /** Detect `a(x: number, y: number, z: number)` and `a(x: number, y: string, z: number)`. */ + function signaturesDifferBySingleParameter(types1, types2) { + const index = getIndexOfFirstDifference(types1, types2, parametersAreEqual); + if (index === undefined) { + return undefined; + } + // If remaining arrays are equal, the signatures differ by just one parameter type + if (!util.arraysAreEqual(types1.slice(index + 1), types2.slice(index + 1), parametersAreEqual)) { + return undefined; + } + const a = types1[index]; + const b = types2[index]; + // Can unify `a?: string` and `b?: number`. Can't unify `...args: string[]` and `...args: number[]`. + // See https://github.com/Microsoft/TypeScript/issues/5077 + return parametersHaveEqualSigils(a, b) && + a.type !== experimental_utils_1.AST_NODE_TYPES.RestElement + ? { kind: 'single-parameter-difference', p0: a, p1: b } + : undefined; + } + /** + * Detect `a(): void` and `a(x: number): void`. + * Returns the parameter declaration (`x: number` in this example) that should be optional/rest, and overload it's a part of. + */ + function signaturesDifferByOptionalOrRestParameter(a, b) { + const sig1 = a.params; + const sig2 = b.params; + const minLength = Math.min(sig1.length, sig2.length); + const longer = sig1.length < sig2.length ? sig2 : sig1; + const shorter = sig1.length < sig2.length ? sig1 : sig2; + const shorterSig = sig1.length < sig2.length ? a : b; + // If one is has 2+ parameters more than the other, they must all be optional/rest. + // Differ by optional parameters: f() and f(x), f() and f(x, ?y, ...z) + // Not allowed: f() and f(x, y) + for (let i = minLength + 1; i < longer.length; i++) { + if (!parameterMayBeMissing(longer[i])) { + return undefined; + } + } + for (let i = 0; i < minLength; i++) { + const sig1i = sig1[i]; + const sig2i = sig2[i]; + const typeAnnotation1 = isTSParameterProperty(sig1i) + ? sig1i.parameter.typeAnnotation + : sig1i.typeAnnotation; + const typeAnnotation2 = isTSParameterProperty(sig2i) + ? sig2i.parameter.typeAnnotation + : sig2i.typeAnnotation; + if (!typesAreEqual(typeAnnotation1, typeAnnotation2)) { + return undefined; + } + } + if (minLength > 0 && + shorter[minLength - 1].type === experimental_utils_1.AST_NODE_TYPES.RestElement) { + return undefined; + } + return { + extraParameter: longer[longer.length - 1], + kind: 'extra-parameter', + otherSignature: shorterSig, + }; + } + /** Given type parameters, returns a function to test whether a type is one of those parameters. */ + function getIsTypeParameter(typeParameters) { + if (typeParameters === undefined) { + return (() => false); + } + const set = new Set(); + for (const t of typeParameters.params) { + set.add(t.name.name); + } + return (typeName => set.has(typeName)); + } + /** True if any of the outer type parameters are used in a signature. */ + function signatureUsesTypeParameter(sig, isTypeParameter) { + return sig.params.some((p) => typeContainsTypeParameter(isTSParameterProperty(p) + ? p.parameter.typeAnnotation + : p.typeAnnotation)); + function typeContainsTypeParameter(type) { + if (!type) { + return false; + } + if (type.type === experimental_utils_1.AST_NODE_TYPES.TSTypeReference) { + const typeName = type.typeName; + if (isIdentifier(typeName) && isTypeParameter(typeName.name)) { + return true; + } + } + return typeContainsTypeParameter(type.typeAnnotation || + type.elementType); + } + } + function isTSParameterProperty(node) { + return (node.type === + experimental_utils_1.AST_NODE_TYPES.TSParameterProperty); + } + function parametersAreEqual(a, b) { + const typeAnnotationA = isTSParameterProperty(a) + ? a.parameter.typeAnnotation + : a.typeAnnotation; + const typeAnnotationB = isTSParameterProperty(b) + ? b.parameter.typeAnnotation + : b.typeAnnotation; + return (parametersHaveEqualSigils(a, b) && + typesAreEqual(typeAnnotationA, typeAnnotationB)); + } + /** True for optional/rest parameters. */ + function parameterMayBeMissing(p) { + const optional = isTSParameterProperty(p) + ? p.parameter.optional + : p.optional; + return p.type === experimental_utils_1.AST_NODE_TYPES.RestElement || optional; + } + /** False if one is optional and the other isn't, or one is a rest parameter and the other isn't. */ + function parametersHaveEqualSigils(a, b) { + const optionalA = isTSParameterProperty(a) + ? a.parameter.optional + : a.optional; + const optionalB = isTSParameterProperty(b) + ? b.parameter.optional + : b.optional; + return ((a.type === experimental_utils_1.AST_NODE_TYPES.RestElement) === + (b.type === experimental_utils_1.AST_NODE_TYPES.RestElement) && + (optionalA !== undefined) === (optionalB !== undefined)); + } + function typeParametersAreEqual(a, b) { + return (a.name.name === b.name.name && + constraintsAreEqual(a.constraint, b.constraint)); + } + function typesAreEqual(a, b) { + return (a === b || + (a !== undefined && + b !== undefined && + sourceCode.getText(a.typeAnnotation) === + sourceCode.getText(b.typeAnnotation))); + } + function constraintsAreEqual(a, b) { + return (a === b || (a !== undefined && b !== undefined && a.type === b.type)); + } + /* Returns the first index where `a` and `b` differ. */ + function getIndexOfFirstDifference(a, b, equal) { + for (let i = 0; i < a.length && i < b.length; i++) { + if (!equal(a[i], b[i])) { + return i; + } + } + return undefined; + } + /** Calls `action` for every pair of values in `values`. */ + function forEachPair(values, action) { + for (let i = 0; i < values.length; i++) { + for (let j = i + 1; j < values.length; j++) { + action(values[i], values[j]); + } + } + } + const scopes = []; + let currentScope = { + overloads: new Map(), + }; + function createScope(parent, typeParameters) { + currentScope && scopes.push(currentScope); + currentScope = { + overloads: new Map(), + parent, + typeParameters, + }; + } + function checkScope() { + const failures = checkOverloads(Array.from(currentScope.overloads.values()), currentScope.typeParameters); + addFailures(failures); + currentScope = scopes.pop(); + } + function addOverload(signature, key, containingNode) { + key = key !== null && key !== void 0 ? key : getOverloadKey(signature); + if (currentScope && + (containingNode || signature).parent === currentScope.parent) { + const overloads = currentScope.overloads.get(key); + if (overloads !== undefined) { + overloads.push(signature); + } + else { + currentScope.overloads.set(key, [signature]); + } + } + } + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + return { + Program: createScope, + TSModuleBlock: createScope, + TSInterfaceDeclaration(node) { + createScope(node.body, node.typeParameters); + }, + ClassDeclaration(node) { + createScope(node.body, node.typeParameters); + }, + TSTypeLiteral: createScope, + // collect overloads + TSDeclareFunction(node) { + var _a, _b; + const exportingNode = getExportingNode(node); + addOverload(node, (_b = (_a = node.id) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : exportingNode === null || exportingNode === void 0 ? void 0 : exportingNode.type, exportingNode); + }, + TSCallSignatureDeclaration: addOverload, + TSConstructSignatureDeclaration: addOverload, + TSMethodSignature: addOverload, + TSAbstractMethodDefinition(node) { + if (!node.value.body) { + addOverload(node); + } + }, + MethodDefinition(node) { + if (!node.value.body) { + addOverload(node); + } + }, + // validate scopes + 'Program:exit': checkScope, + 'TSModuleBlock:exit': checkScope, + 'TSInterfaceDeclaration:exit': checkScope, + 'ClassDeclaration:exit': checkScope, + 'TSTypeLiteral:exit': checkScope, + }; + }, +}); +function getExportingNode(node) { + return node.parent && + (node.parent.type === experimental_utils_1.AST_NODE_TYPES.ExportNamedDeclaration || + node.parent.type === experimental_utils_1.AST_NODE_TYPES.ExportDefaultDeclaration) + ? node.parent + : undefined; +} +function getOverloadKey(node) { + const info = getOverloadInfo(node); + return ((node.computed ? '0' : '1') + + (node.static ? '0' : '1') + + info); +} +function getOverloadInfo(node) { + switch (node.type) { + case experimental_utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration: + return 'constructor'; + case experimental_utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration: + return '()'; + default: { + const { key } = node; + return isIdentifier(key) ? key.name : key.raw; + } + } +} +function isIdentifier(node) { + return node.type === experimental_utils_1.AST_NODE_TYPES.Identifier; +} +//# sourceMappingURL=unified-signatures.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js.map new file mode 100644 index 000000000..ce84d5caf --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js.map @@ -0,0 +1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C;CACF,CAAC,CAAC;AAEH,SAAS,gBAAgB,CACvB,IAAgC;IAKhC,OAAO,IAAI,CAAC,MAAM;QAChB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,mCAAc,CAAC,sBAAsB;YACzD,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,mCAAc,CAAC,wBAAwB,CAAC;QAC/D,CAAC,CAAC,IAAI,CAAC,MAAM;QACb,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,SAAS,cAAc,CAAC,IAAkB;IACxC,MAAM,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAEnC,OAAO,CACL,CAAE,IAAyB,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;QACjD,CAAE,IAAyB,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;QAC/C,IAAI,CACL,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,IAAkB;IACzC,QAAQ,IAAI,CAAC,IAAI,EAAE;QACjB,KAAK,mCAAc,CAAC,+BAA+B;YACjD,OAAO,aAAa,CAAC;QACvB,KAAK,mCAAc,CAAC,0BAA0B;YAC5C,OAAO,IAAI,CAAC;QACd,OAAO,CAAC,CAAC;YACP,MAAM,EAAE,GAAG,EAAE,GAAG,IAAwB,CAAC;YAEzC,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAE,GAAwB,CAAC,GAAG,CAAC;SACrE;KACF;AACH,CAAC;AAED,SAAS,YAAY,CAAC,IAAmB;IACvC,OAAO,IAAI,CAAC,IAAI,KAAK,mCAAc,CAAC,UAAU,CAAC;AACjD,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.js new file mode 100644 index 000000000..249bf798b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.js @@ -0,0 +1,15 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// deeply re-export, for convenience +__exportStar(require("@typescript-eslint/experimental-utils/dist/ast-utils"), exports); +//# sourceMappingURL=astUtils.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.js.map new file mode 100644 index 000000000..872e04e40 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"astUtils.js","sourceRoot":"","sources":["../../src/util/astUtils.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oCAAoC;AACpC,uFAAqE"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/createRule.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/createRule.js new file mode 100644 index 000000000..b7066ab41 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/createRule.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createRule = void 0; +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder +const version = require('../../package.json').version; +exports.createRule = experimental_utils_1.ESLintUtils.RuleCreator(name => `https://github.com/typescript-eslint/typescript-eslint/blob/v${version}/packages/eslint-plugin/docs/rules/${name}.md`); +//# sourceMappingURL=createRule.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/createRule.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/createRule.js.map new file mode 100644 index 000000000..768d51b07 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/createRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"createRule.js","sourceRoot":"","sources":["../../src/util/createRule.ts"],"names":[],"mappings":";;;AAAA,8EAAoE;AAEpE,sHAAsH;AACtH,MAAM,OAAO,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC;AAEzC,QAAA,UAAU,GAAG,gCAAW,CAAC,WAAW,CAC/C,IAAI,CAAC,EAAE,CACL,gEAAgE,OAAO,sCAAsC,IAAI,KAAK,CACzH,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/explicitReturnTypeUtils.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/explicitReturnTypeUtils.js new file mode 100644 index 000000000..ad102492d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/explicitReturnTypeUtils.js @@ -0,0 +1,241 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isTypedFunctionExpression = exports.doesImmediatelyReturnFunctionExpression = exports.checkFunctionReturnType = exports.checkFunctionExpressionReturnType = void 0; +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +const astUtils_1 = require("./astUtils"); +const nullThrows_1 = require("./nullThrows"); +/** + * Creates a report location for the given function. + * The location only encompasses the "start" of the function, and not the body + * + * eg. + * function foo(args) {} + * ^^^^^^^^^^^^^^^^^^ + * + * get y(args) {} + * ^^^^^^^^^^^ + * + * const x = (args) => {} + * ^^^^^^^^^ + */ +function getReporLoc(node, sourceCode) { + /** + * Returns start column position + * @param node + */ + function getLocStart() { + /* highlight method name */ + const parent = node.parent; + if (parent && + (parent.type === experimental_utils_1.AST_NODE_TYPES.MethodDefinition || + (parent.type === experimental_utils_1.AST_NODE_TYPES.Property && parent.method))) { + return parent.loc.start; + } + return node.loc.start; + } + /** + * Returns end column position + * @param node + */ + function getLocEnd() { + /* highlight `=>` */ + if (node.type === experimental_utils_1.AST_NODE_TYPES.ArrowFunctionExpression) { + return sourceCode.getTokenBefore(node.body, token => token.type === experimental_utils_1.AST_TOKEN_TYPES.Punctuator && token.value === '=>').loc.end; + } + return sourceCode.getTokenBefore(node.body).loc.end; + } + return { + start: getLocStart(), + end: getLocEnd(), + }; +} +/** + * Checks if a node is a variable declarator with a type annotation. + * ``` + * const x: Foo = ... + * ``` + */ +function isVariableDeclaratorWithTypeAnnotation(node) { + return (node.type === experimental_utils_1.AST_NODE_TYPES.VariableDeclarator && !!node.id.typeAnnotation); +} +/** + * Checks if a node is a class property with a type annotation. + * ``` + * public x: Foo = ... + * ``` + */ +function isClassPropertyWithTypeAnnotation(node) { + return node.type === experimental_utils_1.AST_NODE_TYPES.ClassProperty && !!node.typeAnnotation; +} +/** + * Checks if a node belongs to: + * ``` + * new Foo(() => {}) + * ^^^^^^^^ + * ``` + */ +function isConstructorArgument(node) { + return node.type === experimental_utils_1.AST_NODE_TYPES.NewExpression; +} +/** + * Checks if a node belongs to: + * ``` + * const x: Foo = { prop: () => {} } + * const x = { prop: () => {} } as Foo + * const x = { prop: () => {} } + * ``` + */ +function isPropertyOfObjectWithType(property) { + if (!property || property.type !== experimental_utils_1.AST_NODE_TYPES.Property) { + return false; + } + const objectExpr = property.parent; // this shouldn't happen, checking just in case + /* istanbul ignore if */ if (!objectExpr || + objectExpr.type !== experimental_utils_1.AST_NODE_TYPES.ObjectExpression) { + return false; + } + const parent = objectExpr.parent; // this shouldn't happen, checking just in case + /* istanbul ignore if */ if (!parent) { + return false; + } + return (astUtils_1.isTypeAssertion(parent) || + isClassPropertyWithTypeAnnotation(parent) || + isVariableDeclaratorWithTypeAnnotation(parent) || + isFunctionArgument(parent)); +} +/** + * Checks if a function belongs to: + * ``` + * () => () => ... + * () => function () { ... } + * () => { return () => ... } + * () => { return function () { ... } } + * function fn() { return () => ... } + * function fn() { return function() { ... } } + * ``` + */ +function doesImmediatelyReturnFunctionExpression({ body, }) { + // Should always have a body; really checking just in case + /* istanbul ignore if */ if (!body) { + return false; + } + // Check if body is a block with a single statement + if (body.type === experimental_utils_1.AST_NODE_TYPES.BlockStatement && body.body.length === 1) { + const [statement] = body.body; + // Check if that statement is a return statement with an argument + if (statement.type === experimental_utils_1.AST_NODE_TYPES.ReturnStatement && + !!statement.argument) { + // If so, check that returned argument as body + body = statement.argument; + } + } + // Check if the body being returned is a function expression + return (body.type === experimental_utils_1.AST_NODE_TYPES.ArrowFunctionExpression || + body.type === experimental_utils_1.AST_NODE_TYPES.FunctionExpression); +} +exports.doesImmediatelyReturnFunctionExpression = doesImmediatelyReturnFunctionExpression; +/** + * Checks if a node belongs to: + * ``` + * foo(() => 1) + * ``` + */ +function isFunctionArgument(parent, callee) { + return (parent.type === experimental_utils_1.AST_NODE_TYPES.CallExpression && + // make sure this isn't an IIFE + parent.callee !== callee); +} +/** + * Checks if a function belongs to: + * ``` + * () => ({ action: 'xxx' } as const) + * ``` + */ +function returnsConstAssertionDirectly(node) { + const { body } = node; + if (astUtils_1.isTypeAssertion(body)) { + const { typeAnnotation } = body; + if (typeAnnotation.type === experimental_utils_1.AST_NODE_TYPES.TSTypeReference) { + const { typeName } = typeAnnotation; + if (typeName.type === experimental_utils_1.AST_NODE_TYPES.Identifier && + typeName.name === 'const') { + return true; + } + } + } + return false; +} +/** + * True when the provided function expression is typed. + */ +function isTypedFunctionExpression(node, options) { + const parent = nullThrows_1.nullThrows(node.parent, nullThrows_1.NullThrowsReasons.MissingParent); + if (!options.allowTypedFunctionExpressions) { + return false; + } + return (astUtils_1.isTypeAssertion(parent) || + isVariableDeclaratorWithTypeAnnotation(parent) || + isClassPropertyWithTypeAnnotation(parent) || + isPropertyOfObjectWithType(parent) || + isFunctionArgument(parent, node) || + isConstructorArgument(parent)); +} +exports.isTypedFunctionExpression = isTypedFunctionExpression; +/** + * Check whether the function expression return type is either typed or valid + * with the provided options. + */ +function isValidFunctionExpressionReturnType(node, options) { + if (isTypedFunctionExpression(node, options)) { + return true; + } + const parent = nullThrows_1.nullThrows(node.parent, nullThrows_1.NullThrowsReasons.MissingParent); + if (options.allowExpressions && + parent.type !== experimental_utils_1.AST_NODE_TYPES.VariableDeclarator && + parent.type !== experimental_utils_1.AST_NODE_TYPES.MethodDefinition && + parent.type !== experimental_utils_1.AST_NODE_TYPES.ExportDefaultDeclaration && + parent.type !== experimental_utils_1.AST_NODE_TYPES.ClassProperty) { + return true; + } + // https://github.com/typescript-eslint/typescript-eslint/issues/653 + if (options.allowDirectConstAssertionInArrowFunctions && + node.type === experimental_utils_1.AST_NODE_TYPES.ArrowFunctionExpression && + returnsConstAssertionDirectly(node)) { + return true; + } + return false; +} +/** + * Check that the function expression or declaration is valid. + */ +function isValidFunctionReturnType(node, options) { + if (options.allowHigherOrderFunctions && + doesImmediatelyReturnFunctionExpression(node)) { + return true; + } + if (node.returnType || astUtils_1.isConstructor(node.parent) || astUtils_1.isSetter(node.parent)) { + return true; + } + return false; +} +/** + * Checks if a function declaration/expression has a return type. + */ +function checkFunctionReturnType(node, options, sourceCode, report) { + if (isValidFunctionReturnType(node, options)) { + return; + } + report(getReporLoc(node, sourceCode)); +} +exports.checkFunctionReturnType = checkFunctionReturnType; +/** + * Checks if a function declaration/expression has a return type. + */ +function checkFunctionExpressionReturnType(node, options, sourceCode, report) { + if (isValidFunctionExpressionReturnType(node, options)) { + return; + } + checkFunctionReturnType(node, options, sourceCode, report); +} +exports.checkFunctionExpressionReturnType = checkFunctionExpressionReturnType; +//# sourceMappingURL=explicitReturnTypeUtils.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/explicitReturnTypeUtils.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/explicitReturnTypeUtils.js.map new file mode 100644 index 000000000..1dbb920a0 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/explicitReturnTypeUtils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"explicitReturnTypeUtils.js","sourceRoot":"","sources":["../../src/util/explicitReturnTypeUtils.ts"],"names":[],"mappings":";;;AAAA,8EAK+C;AAC/C,yCAAsE;AACtE,6CAA6D;AAO7D;;;;;;;;;;;;;GAaG;AACH,SAAS,WAAW,CAClB,IAAkB,EAClB,UAA+B;IAE/B;;;OAGG;IACH,SAAS,WAAW;QAClB,2BAA2B;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,IACE,MAAM;YACN,CAAC,MAAM,CAAC,IAAI,KAAK,mCAAc,CAAC,gBAAgB;gBAC9C,CAAC,MAAM,CAAC,IAAI,KAAK,mCAAc,CAAC,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,EAC7D;YACA,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC;SACzB;QAED,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;IACxB,CAAC;IAED;;;OAGG;IACH,SAAS,SAAS;QAChB,oBAAoB;QACpB,IAAI,IAAI,CAAC,IAAI,KAAK,mCAAc,CAAC,uBAAuB,EAAE;YACxD,OAAO,UAAU,CAAC,cAAc,CAC9B,IAAI,CAAC,IAAI,EACT,KAAK,CAAC,EAAE,CACN,KAAK,CAAC,IAAI,KAAK,oCAAe,CAAC,UAAU,IAAI,KAAK,CAAC,KAAK,KAAK,IAAI,CACnE,CAAC,GAAG,CAAC,GAAG,CAAC;SACZ;QAED,OAAO,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAE,CAAC,GAAG,CAAC,GAAG,CAAC;IACvD,CAAC;IAED,OAAO;QACL,KAAK,EAAE,WAAW,EAAE;QACpB,GAAG,EAAE,SAAS,EAAE;KACjB,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAS,sCAAsC,CAC7C,IAAmB;IAE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E,OAAO,CAAC,yBAAyB;QACjC,uCAAuC,CAAC,IAAI,CAAC,EAC7C;QACA,OAAO,IAAI,CAAC;KACb;IAED,IAAI,IAAI,CAAC,UAAU,IAAI,wBAAa,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,mBAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;QAC1E,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAS,uBAAuB,CAC9B,IAAkB,EAClB,OAAgB,EAChB,UAA+B,EAC/B,MAA8C;IAE9C,IAAI,yBAAyB,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE;QAC5C,OAAO;KACR;IAED,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC;AACxC,CAAC;AAoBC,0DAAuB;AAlBzB;;GAEG;AACH,SAAS,iCAAiC,CACxC,IAAwB,EACxB,OAAgB,EAChB,UAA+B,EAC/B,MAA8C;IAE9C,IAAI,mCAAmC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE;QACtD,OAAO;KACR;IAED,uBAAuB,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AAC7D,CAAC;AAGC,8EAAiC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js new file mode 100644 index 000000000..9ab6ac9a2 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js @@ -0,0 +1,28 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getParserServices = exports.isObjectNotArray = exports.deepMerge = exports.applyDefault = void 0; +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +__exportStar(require("./astUtils"), exports); +__exportStar(require("./createRule"), exports); +__exportStar(require("./isTypeReadonly"), exports); +__exportStar(require("./misc"), exports); +__exportStar(require("./nullThrows"), exports); +__exportStar(require("./objectIterators"), exports); +__exportStar(require("./types"), exports); +// this is done for convenience - saves migrating all of the old rules +const { applyDefault, deepMerge, isObjectNotArray, getParserServices, } = experimental_utils_1.ESLintUtils; +exports.applyDefault = applyDefault; +exports.deepMerge = deepMerge; +exports.isObjectNotArray = isObjectNotArray; +exports.getParserServices = getParserServices; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js.map new file mode 100644 index 000000000..d3ef1edb1 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,8EAAoE;AAEpE,6CAA2B;AAC3B,+CAA6B;AAC7B,mDAAiC;AACjC,yCAAuB;AACvB,+CAA6B;AAC7B,oDAAkC;AAClC,0CAAwB;AAExB,sEAAsE;AACtE,MAAM,EACJ,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,iBAAiB,GAClB,GAAG,gCAAW,CAAC;AAOd,oCAAY;AACZ,8BAAS;AACT,4CAAgB;AAChB,8CAAiB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/isTypeReadonly.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isTypeReadonly.js new file mode 100644 index 000000000..754b09d2a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isTypeReadonly.js @@ -0,0 +1,140 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isTypeReadonly = void 0; +const tsutils_1 = require("tsutils"); +const ts = __importStar(require("typescript")); +const _1 = require("."); +function isTypeReadonlyArrayOrTuple(checker, type, seenTypes) { + function checkTypeArguments(arrayType) { + const typeArguments = checker.getTypeArguments(arrayType); + // this shouldn't happen in reality as: + // - tuples require at least 1 type argument + // - ReadonlyArray requires at least 1 type argument + /* istanbul ignore if */ if (typeArguments.length === 0) { + return 3 /* Readonly */; + } + // validate the element types are also readonly + if (typeArguments.some(typeArg => isTypeReadonlyRecurser(checker, typeArg, seenTypes) === + 2 /* Mutable */)) { + return 2 /* Mutable */; + } + return 3 /* Readonly */; + } + if (checker.isArrayType(type)) { + const symbol = _1.nullThrows(type.getSymbol(), _1.NullThrowsReasons.MissingToken('symbol', 'array type')); + const escapedName = symbol.getEscapedName(); + if (escapedName === 'Array') { + return 2 /* Mutable */; + } + return checkTypeArguments(type); + } + if (checker.isTupleType(type)) { + if (!type.target.readonly) { + return 2 /* Mutable */; + } + return checkTypeArguments(type); + } + return 1 /* UnknownType */; +} +function isTypeReadonlyObject(checker, type, seenTypes) { + function checkIndexSignature(kind) { + const indexInfo = checker.getIndexInfoOfType(type, kind); + if (indexInfo) { + return indexInfo.isReadonly + ? 3 /* Readonly */ + : 2 /* Mutable */; + } + return 1 /* UnknownType */; + } + const properties = type.getProperties(); + if (properties.length) { + // ensure the properties are marked as readonly + for (const property of properties) { + if (!tsutils_1.isPropertyReadonlyInType(type, property.getEscapedName(), checker)) { + return 2 /* Mutable */; + } + } + // all properties were readonly + // now ensure that all of the values are readonly also. + // do this after checking property readonly-ness as a perf optimization, + // as we might be able to bail out early due to a mutable property before + // doing this deep, potentially expensive check. + for (const property of properties) { + const propertyType = _1.nullThrows(checker.getTypeOfPropertyOfType(type, property.getName()), _1.NullThrowsReasons.MissingToken(`property "${property.name}"`, 'type')); + // handle recursive types. + // we only need this simple check, because a mutable recursive type will break via the above prop readonly check + if (seenTypes.has(propertyType)) { + continue; + } + if (isTypeReadonlyRecurser(checker, propertyType, seenTypes) === + 2 /* Mutable */) { + return 2 /* Mutable */; + } + } + } + const isStringIndexSigReadonly = checkIndexSignature(ts.IndexKind.String); + if (isStringIndexSigReadonly === 2 /* Mutable */) { + return isStringIndexSigReadonly; + } + const isNumberIndexSigReadonly = checkIndexSignature(ts.IndexKind.Number); + if (isNumberIndexSigReadonly === 2 /* Mutable */) { + return isNumberIndexSigReadonly; + } + return 3 /* Readonly */; +} +// a helper function to ensure the seenTypes map is always passed down, except by the external caller +function isTypeReadonlyRecurser(checker, type, seenTypes) { + seenTypes.add(type); + if (tsutils_1.isUnionType(type)) { + // all types in the union must be readonly + const result = tsutils_1.unionTypeParts(type).every(t => isTypeReadonlyRecurser(checker, t, seenTypes)); + const readonlyness = result ? 3 /* Readonly */ : 2 /* Mutable */; + return readonlyness; + } + // all non-object, non-intersection types are readonly. + // this should only be primitive types + if (!tsutils_1.isObjectType(type) && !tsutils_1.isUnionOrIntersectionType(type)) { + return 3 /* Readonly */; + } + // pure function types are readonly + if (type.getCallSignatures().length > 0 && + type.getProperties().length === 0) { + return 3 /* Readonly */; + } + const isReadonlyArray = isTypeReadonlyArrayOrTuple(checker, type, seenTypes); + if (isReadonlyArray !== 1 /* UnknownType */) { + return isReadonlyArray; + } + const isReadonlyObject = isTypeReadonlyObject(checker, type, seenTypes); + /* istanbul ignore else */ if (isReadonlyObject !== 1 /* UnknownType */) { + return isReadonlyObject; + } + throw new Error('Unhandled type'); +} +/** + * Checks if the given type is readonly + */ +function isTypeReadonly(checker, type) { + return (isTypeReadonlyRecurser(checker, type, new Set()) === 3 /* Readonly */); +} +exports.isTypeReadonly = isTypeReadonly; +//# sourceMappingURL=isTypeReadonly.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/isTypeReadonly.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isTypeReadonly.js.map new file mode 100644 index 000000000..e4705c029 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/isTypeReadonly.js.map @@ -0,0 +1 @@ +{"version":3,"file":"isTypeReadonly.js","sourceRoot":"","sources":["../../src/util/isTypeReadonly.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,qCAMiB;AACjB,+CAAiC;AACjC,wBAAkD;AAWlD,SAAS,0BAA0B,CACjC,OAAuB,EACvB,IAAa,EACb,SAAuB;IAEvB,SAAS,kBAAkB,CAAC,SAA2B;QACrD,MAAM,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAC1D,uCAAuC;QACvC,4CAA4C;QAC5C,oDAAoD;QACpD,wBAAwB,CAAC,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE;YACvD,wBAA6B;SAC9B;QAED,+CAA+C;QAC/C,IACE,aAAa,CAAC,IAAI,CAChB,OAAO,CAAC,EAAE,CACR,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC;2BAC/B,CACvB,EACD;YACA,uBAA4B;SAC7B;QACD,wBAA6B;IAC/B,CAAC;IAED,IAAI,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,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IAAI,CAAC,EAAE;QAC3D,wBAA6B;KAC9B;IAED,mCAAmC;IACnC,IACE,IAAI,CAAC,iBAAiB,EAAE,CAAC,MAAM,GAAG,CAAC;QACnC,IAAI,CAAC,aAAa,EAAE,CAAC,MAAM,KAAK,CAAC,EACjC;QACA,wBAA6B;KAC9B;IAED,MAAM,eAAe,GAAG,0BAA0B,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;IAC7E,IAAI,eAAe,wBAA6B,EAAE;QAChD,OAAO,eAAe,CAAC;KACxB;IAED,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;IACxE,0BAA0B,CAAC,IACzB,gBAAgB,wBAA6B,EAC7C;QACA,OAAO,gBAAgB,CAAC;KACzB;IAED,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;AACpC,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,OAAuB,EAAE,IAAa;IAC5D,OAAO,CACL,sBAAsB,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,EAAE,CAAC,qBAA0B,CAC3E,CAAC;AACJ,CAAC;AAEQ,wCAAc"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.js new file mode 100644 index 000000000..0cb96ca50 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.js @@ -0,0 +1,67 @@ +"use strict"; +/** + * @fileoverview Really small utility functions that didn't deserve their own files + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.upperCaseFirst = exports.isDefinitionFile = exports.getNameFromMember = exports.getNameFromIndexSignature = exports.getEnumNames = exports.findFirstResult = exports.arraysAreEqual = void 0; +const experimental_utils_1 = require("@typescript-eslint/experimental-utils"); +/** + * Check if the context file name is *.d.ts or *.d.tsx + */ +function isDefinitionFile(fileName) { + return /\.d\.tsx?$/i.test(fileName || ''); +} +exports.isDefinitionFile = isDefinitionFile; +/** + * Upper cases the first character or the string + */ +function upperCaseFirst(str) { + return str[0].toUpperCase() + str.slice(1); +} +exports.upperCaseFirst = upperCaseFirst; +function arraysAreEqual(a, b, eq) { + return (a === b || + (a !== undefined && + b !== undefined && + a.length === b.length && + a.every((x, idx) => eq(x, b[idx])))); +} +exports.arraysAreEqual = arraysAreEqual; +/** Returns the first non-`undefined` result. */ +function findFirstResult(inputs, getResult) { + for (const element of inputs) { + const result = getResult(element); + if (result !== undefined) { + return result; + } + } + return undefined; +} +exports.findFirstResult = findFirstResult; +/** + * Gets a string representation of the name of the index signature. + */ +function getNameFromIndexSignature(node) { + const propName = node.parameters.find((parameter) => parameter.type === experimental_utils_1.AST_NODE_TYPES.Identifier); + return propName ? propName.name : '(index signature)'; +} +exports.getNameFromIndexSignature = getNameFromIndexSignature; +/** + * Gets a string name representation of the name of the given MethodDefinition + * or ClassProperty node, with handling for computed property names. + */ +function getNameFromMember(member, sourceCode) { + if (member.key.type === experimental_utils_1.AST_NODE_TYPES.Identifier) { + return member.key.name; + } + if (member.key.type === experimental_utils_1.AST_NODE_TYPES.Literal) { + return `${member.key.value}`; + } + return sourceCode.text.slice(...member.key.range); +} +exports.getNameFromMember = getNameFromMember; +function getEnumNames(myEnum) { + return Object.keys(myEnum).filter(x => isNaN(parseInt(x))); +} +exports.getEnumNames = getEnumNames; +//# sourceMappingURL=misc.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.js.map new file mode 100644 index 000000000..c3a0e4802 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.js.map @@ -0,0 +1 @@ +{"version":3,"file":"misc.js","sourceRoot":"","sources":["../../src/util/misc.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,8EAI+C;AAE/C;;GAEG;AACH,SAAS,gBAAgB,CAAC,QAAgB;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AA5C3B;;;GAGG;AACH,SAAS,iBAAiB,CACxB,MAOgC,EAChC,UAA+B;IAE/B,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,KAAK,mCAAc,CAAC,UAAU,EAAE;QACjD,OAAO,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;KACxB;IACD,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,KAAK,mCAAc,CAAC,OAAO,EAAE;QAC9C,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;KAC9B;IAED,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACpD,CAAC;AAsBC,8CAAiB;AAXnB,SAAS,YAAY,CAAmB,MAA0B;IAChE,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAQ,CAAC;AACpE,CAAC;AAOC,oCAAY"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/nullThrows.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/nullThrows.js new file mode 100644 index 000000000..e5507a2ed --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/nullThrows.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NullThrowsReasons = exports.nullThrows = void 0; +/** + * A set of common reasons for calling nullThrows + */ +const NullThrowsReasons = { + MissingParent: 'Expected node to have a parent.', + MissingToken: (token, thing) => `Expected to find a ${token} for the ${thing}.`, +}; +exports.NullThrowsReasons = NullThrowsReasons; +/** + * Assert that a value must not be null or undefined. + * This is a nice explicit alternative to the non-null assertion operator. + */ +function nullThrows(value, message) { + // this function is primarily used to keep types happy in a safe way + // i.e. is used when we expect that a value is never nullish + // this means that it's pretty much impossible to test the below if... + // so ignore it in coverage metrics. + /* istanbul ignore if */ + if (value === null || value === undefined) { + throw new Error(`Non-null Assertion Failed: ${message}`); + } + return value; +} +exports.nullThrows = nullThrows; +//# sourceMappingURL=nullThrows.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/nullThrows.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/nullThrows.js.map new file mode 100644 index 000000000..acc485af0 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/nullThrows.js.map @@ -0,0 +1 @@ +{"version":3,"file":"nullThrows.js","sourceRoot":"","sources":["../../src/util/nullThrows.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAM,iBAAiB,GAAG;IACxB,aAAa,EAAE,iCAAiC;IAChD,YAAY,EAAE,CAAC,KAAa,EAAE,KAAa,EAAE,EAAE,CAC7C,sBAAsB,KAAK,YAAY,KAAK,GAAG;CACzC,CAAC;AAoBU,8CAAiB;AAlBtC;;;GAGG;AACH,SAAS,UAAU,CAAI,KAA2B,EAAE,OAAe;IACjE,oEAAoE;IACpE,4DAA4D;IAC5D,sEAAsE;IAEtE,oCAAoC;IACpC,wBAAwB;IACxB,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;QACzC,MAAM,IAAI,KAAK,CAAC,8BAA8B,OAAO,EAAE,CAAC,CAAC;KAC1D;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAEQ,gCAAU"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/objectIterators.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/objectIterators.js new file mode 100644 index 000000000..16f733641 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/objectIterators.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.objectReduceKey = exports.objectMapKey = exports.objectForEachKey = void 0; +function objectForEachKey(obj, callback) { + const keys = Object.keys(obj); + for (const key of keys) { + callback(key); + } +} +exports.objectForEachKey = objectForEachKey; +function objectMapKey(obj, callback) { + const values = []; + objectForEachKey(obj, key => { + values.push(callback(key)); + }); + return values; +} +exports.objectMapKey = objectMapKey; +function objectReduceKey(obj, callback, initial) { + let accumulator = initial; + objectForEachKey(obj, key => { + accumulator = callback(accumulator, key); + }); + return accumulator; +} +exports.objectReduceKey = objectReduceKey; +//# sourceMappingURL=objectIterators.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/objectIterators.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/objectIterators.js.map new file mode 100644 index 000000000..82a35bf95 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/objectIterators.js.map @@ -0,0 +1 @@ +{"version":3,"file":"objectIterators.js","sourceRoot":"","sources":["../../src/util/objectIterators.ts"],"names":[],"mappings":";;;AAAA,SAAS,gBAAgB,CACvB,GAAM,EACN,QAAgC;IAEhC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,QAAQ,CAAC,GAAG,CAAC,CAAC;KACf;AACH,CAAC;AAyBQ,4CAAgB;AAvBzB,SAAS,YAAY,CACnB,GAAM,EACN,QAAmC;IAEnC,MAAM,MAAM,GAAc,EAAE,CAAC;IAC7B,gBAAgB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE;QAC1B,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC;AAc0B,oCAAY;AAZvC,SAAS,eAAe,CACtB,GAAM,EACN,QAA2D,EAC3D,OAAqB;IAErB,IAAI,WAAW,GAAG,OAAO,CAAC;IAC1B,gBAAgB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE;QAC1B,WAAW,GAAG,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;IACH,OAAO,WAAW,CAAC;AACrB,CAAC;AAEwC,0CAAe"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/types.js b/node_modules/@typescript-eslint/eslint-plugin/dist/util/types.js new file mode 100644 index 000000000..bb543a358 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/types.js @@ -0,0 +1,411 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getContextualType = exports.isUnsafeAssignment = exports.isAnyOrAnyArrayTypeDiscriminated = exports.isTypeUnknownArrayType = exports.isTypeAnyArrayType = exports.isTypeAnyType = exports.isTypeUnknownType = exports.getTypeArguments = exports.getEqualsKind = exports.getTokenAtPosition = exports.getSourceFileOfNode = exports.typeIsOrHasBaseType = exports.isTypeFlagSet = exports.getTypeFlags = exports.getDeclaration = exports.isNullableType = exports.getConstrainedTypeAtLocation = exports.getTypeName = exports.containsAllTypesByName = exports.isTypeArrayTypeOrUnionOfArrayTypes = void 0; +const debug_1 = __importDefault(require("debug")); +const tsutils_1 = require("tsutils"); +const ts = __importStar(require("typescript")); +const log = debug_1.default('typescript-eslint:eslint-plugin:utils:types'); +/** + * Checks if the given type is either an array type, + * or a union made up solely of array types. + */ +function isTypeArrayTypeOrUnionOfArrayTypes(type, checker) { + for (const t of tsutils_1.unionTypeParts(type)) { + if (!checker.isArrayType(t)) { + return false; + } + } + return true; +} +exports.isTypeArrayTypeOrUnionOfArrayTypes = isTypeArrayTypeOrUnionOfArrayTypes; +/** + * @param type Type being checked by name. + * @param allowedNames Symbol names checking on the type. + * @returns Whether the type is, extends, or contains all of the allowed names. + */ +function containsAllTypesByName(type, allowAny, allowedNames) { + if (isTypeFlagSet(type, ts.TypeFlags.Any | ts.TypeFlags.Unknown)) { + return !allowAny; + } + if (tsutils_1.isTypeReference(type)) { + type = type.target; + } + const symbol = type.getSymbol(); + if (symbol && allowedNames.has(symbol.name)) { + return true; + } + if (tsutils_1.isUnionOrIntersectionType(type)) { + return type.types.every(t => containsAllTypesByName(t, allowAny, allowedNames)); + } + const bases = type.getBaseTypes(); + return (typeof bases !== 'undefined' && + bases.length > 0 && + bases.every(t => containsAllTypesByName(t, allowAny, allowedNames))); +} +exports.containsAllTypesByName = containsAllTypesByName; +/** + * Get the type name of a given type. + * @param typeChecker The context sensitive TypeScript TypeChecker. + * @param type The type to get the name of. + */ +function getTypeName(typeChecker, type) { + // It handles `string` and string literal types as string. + if ((type.flags & ts.TypeFlags.StringLike) !== 0) { + return 'string'; + } + // If the type is a type parameter which extends primitive string types, + // but it was not recognized as a string like. So check the constraint + // type of the type parameter. + if ((type.flags & ts.TypeFlags.TypeParameter) !== 0) { + // `type.getConstraint()` method doesn't return the constraint type of + // the type parameter for some reason. So this gets the constraint type + // via AST. + const symbol = type.getSymbol(); + const decls = symbol === null || symbol === void 0 ? void 0 : symbol.getDeclarations(); + const typeParamDecl = decls === null || decls === void 0 ? void 0 : decls[0]; + if (ts.isTypeParameterDeclaration(typeParamDecl) && + typeParamDecl.constraint != null) { + return getTypeName(typeChecker, typeChecker.getTypeFromTypeNode(typeParamDecl.constraint)); + } + } + // If the type is a union and all types in the union are string like, + // return `string`. For example: + // - `"a" | "b"` is string. + // - `string | string[]` is not string. + if (type.isUnion() && + type.types + .map(value => getTypeName(typeChecker, value)) + .every(t => t === 'string')) { + return 'string'; + } + // If the type is an intersection and a type in the intersection is string + // like, return `string`. For example: `string & {__htmlEscaped: void}` + if (type.isIntersection() && + type.types + .map(value => getTypeName(typeChecker, value)) + .some(t => t === 'string')) { + return 'string'; + } + return typeChecker.typeToString(type); +} +exports.getTypeName = getTypeName; +/** + * Resolves the given node's type. Will resolve to the type's generic constraint, if it has one. + */ +function getConstrainedTypeAtLocation(checker, node) { + const nodeType = checker.getTypeAtLocation(node); + const constrained = checker.getBaseConstraintOfType(nodeType); + return constrained !== null && constrained !== void 0 ? constrained : nodeType; +} +exports.getConstrainedTypeAtLocation = getConstrainedTypeAtLocation; +/** + * Checks if the given type is (or accepts) nullable + * @param isReceiver true if the type is a receiving type (i.e. the type of a called function's parameter) + */ +function isNullableType(type, { isReceiver = false, allowUndefined = true, } = {}) { + const flags = getTypeFlags(type); + if (isReceiver && flags & (ts.TypeFlags.Any | ts.TypeFlags.Unknown)) { + return true; + } + if (allowUndefined) { + return (flags & (ts.TypeFlags.Null | ts.TypeFlags.Undefined)) !== 0; + } + else { + return (flags & ts.TypeFlags.Null) !== 0; + } +} +exports.isNullableType = isNullableType; +/** + * Gets the declaration for the given variable + */ +function getDeclaration(checker, node) { + var _a; + const symbol = checker.getSymbolAtLocation(node); + if (!symbol) { + return null; + } + const declarations = symbol.getDeclarations(); + return (_a = declarations === null || declarations === void 0 ? void 0 : declarations[0]) !== null && _a !== void 0 ? _a : null; +} +exports.getDeclaration = getDeclaration; +/** + * Gets all of the type flags in a type, iterating through unions automatically + */ +function getTypeFlags(type) { + let flags = 0; + for (const t of tsutils_1.unionTypeParts(type)) { + flags |= t.flags; + } + return flags; +} +exports.getTypeFlags = getTypeFlags; +/** + * Checks if the given type is (or accepts) the given flags + * @param isReceiver true if the type is a receiving type (i.e. the type of a called function's parameter) + */ +function isTypeFlagSet(type, flagsToCheck, isReceiver) { + const flags = getTypeFlags(type); + if (isReceiver && flags & (ts.TypeFlags.Any | ts.TypeFlags.Unknown)) { + return true; + } + return (flags & flagsToCheck) !== 0; +} +exports.isTypeFlagSet = isTypeFlagSet; +/** + * @returns Whether a type is an instance of the parent type, including for the parent's base types. + */ +function typeIsOrHasBaseType(type, parentType) { + const parentSymbol = parentType.getSymbol(); + if (!type.getSymbol() || !parentSymbol) { + return false; + } + const typeAndBaseTypes = [type]; + const ancestorTypes = type.getBaseTypes(); + if (ancestorTypes) { + typeAndBaseTypes.push(...ancestorTypes); + } + for (const baseType of typeAndBaseTypes) { + const baseSymbol = baseType.getSymbol(); + if (baseSymbol && baseSymbol.name === parentSymbol.name) { + return true; + } + } + return false; +} +exports.typeIsOrHasBaseType = typeIsOrHasBaseType; +/** + * Gets the source file for a given node + */ +function getSourceFileOfNode(node) { + while (node && node.kind !== ts.SyntaxKind.SourceFile) { + node = node.parent; + } + return node; +} +exports.getSourceFileOfNode = getSourceFileOfNode; +function getTokenAtPosition(sourceFile, position) { + const queue = [sourceFile]; + let current; + while (queue.length > 0) { + current = queue.shift(); + // find the child that contains 'position' + for (const child of current.getChildren(sourceFile)) { + const start = child.getFullStart(); + if (start > position) { + // If this child begins after position, then all subsequent children will as well. + return current; + } + const end = child.getEnd(); + if (position < end || + (position === end && child.kind === ts.SyntaxKind.EndOfFileToken)) { + queue.push(child); + break; + } + } + } + return current; +} +exports.getTokenAtPosition = getTokenAtPosition; +function getEqualsKind(operator) { + switch (operator) { + case '==': + return { + isPositive: true, + isStrict: false, + }; + case '===': + return { + isPositive: true, + isStrict: true, + }; + case '!=': + return { + isPositive: false, + isStrict: false, + }; + case '!==': + return { + isPositive: false, + isStrict: true, + }; + default: + return undefined; + } +} +exports.getEqualsKind = getEqualsKind; +function getTypeArguments(type, checker) { + var _a; + // getTypeArguments was only added in TS3.7 + if (checker.getTypeArguments) { + return checker.getTypeArguments(type); + } + return (_a = type.typeArguments) !== null && _a !== void 0 ? _a : []; +} +exports.getTypeArguments = getTypeArguments; +/** + * @returns true if the type is `unknown` + */ +function isTypeUnknownType(type) { + return isTypeFlagSet(type, ts.TypeFlags.Unknown); +} +exports.isTypeUnknownType = isTypeUnknownType; +/** + * @returns true if the type is `any` + */ +function isTypeAnyType(type) { + if (isTypeFlagSet(type, ts.TypeFlags.Any)) { + if (type.intrinsicName === 'error') { + log('Found an "error" any type'); + } + return true; + } + return false; +} +exports.isTypeAnyType = isTypeAnyType; +/** + * @returns true if the type is `any[]` + */ +function isTypeAnyArrayType(type, checker) { + return (checker.isArrayType(type) && + isTypeAnyType( + // getTypeArguments was only added in TS3.7 + getTypeArguments(type, checker)[0])); +} +exports.isTypeAnyArrayType = isTypeAnyArrayType; +/** + * @returns true if the type is `unknown[]` + */ +function isTypeUnknownArrayType(type, checker) { + return (checker.isArrayType(type) && + isTypeUnknownType( + // getTypeArguments was only added in TS3.7 + getTypeArguments(type, checker)[0])); +} +exports.isTypeUnknownArrayType = isTypeUnknownArrayType; +/** + * @returns `AnyType.Any` if the type is `any`, `AnyType.AnyArray` if the type is `any[]` or `readonly any[]`, + * otherwise it returns `AnyType.Safe`. + */ +function isAnyOrAnyArrayTypeDiscriminated(node, checker) { + const type = checker.getTypeAtLocation(node); + if (isTypeAnyType(type)) { + return 0 /* Any */; + } + if (isTypeAnyArrayType(type, checker)) { + return 1 /* AnyArray */; + } + return 2 /* Safe */; +} +exports.isAnyOrAnyArrayTypeDiscriminated = isAnyOrAnyArrayTypeDiscriminated; +/** + * Does a simple check to see if there is an any being assigned to a non-any type. + * + * This also checks generic positions to ensure there's no unsafe sub-assignments. + * Note: in the case of generic positions, it makes the assumption that the two types are the same. + * + * @example See tests for examples + * + * @returns false if it's safe, or an object with the two types if it's unsafe + */ +function isUnsafeAssignment(type, receiver, checker) { + var _a, _b; + if (isTypeAnyType(type)) { + // Allow assignment of any ==> unknown. + if (isTypeUnknownType(receiver)) { + return false; + } + if (!isTypeAnyType(receiver)) { + return { sender: type, receiver }; + } + } + if (tsutils_1.isTypeReference(type) && tsutils_1.isTypeReference(receiver)) { + // TODO - figure out how to handle cases like this, + // where the types are assignable, but not the same type + /* + function foo(): ReadonlySet { return new Set(); } + + // and + + type Test = { prop: T } + type Test2 = { prop: string } + declare const a: Test; + const b: Test2 = a; + */ + if (type.target !== receiver.target) { + // if the type references are different, assume safe, as we won't know how to compare the two types + // the generic positions might not be equivalent for both types + return false; + } + const typeArguments = (_a = type.typeArguments) !== null && _a !== void 0 ? _a : []; + const receiverTypeArguments = (_b = receiver.typeArguments) !== null && _b !== void 0 ? _b : []; + for (let i = 0; i < typeArguments.length; i += 1) { + const arg = typeArguments[i]; + const receiverArg = receiverTypeArguments[i]; + const unsafe = isUnsafeAssignment(arg, receiverArg, checker); + if (unsafe) { + return { sender: type, receiver }; + } + } + return false; + } + return false; +} +exports.isUnsafeAssignment = isUnsafeAssignment; +/** + * Returns the contextual type of a given node. + * Contextual type is the type of the target the node is going into. + * i.e. the type of a called function's parameter, or the defined type of a variable declaration + */ +function getContextualType(checker, node) { + const parent = node.parent; + if (!parent) { + return; + } + if (tsutils_1.isCallExpression(parent) || tsutils_1.isNewExpression(parent)) { + if (node === parent.expression) { + // is the callee, so has no contextual type + return; + } + } + else if (tsutils_1.isVariableDeclaration(parent) || + tsutils_1.isPropertyDeclaration(parent) || + tsutils_1.isParameterDeclaration(parent)) { + return parent.type ? checker.getTypeFromTypeNode(parent.type) : undefined; + } + else if (tsutils_1.isJsxExpression(parent)) { + return checker.getContextualType(parent); + } + else if (tsutils_1.isPropertyAssignment(parent) && tsutils_1.isIdentifier(node)) { + return checker.getContextualType(node); + } + else if (![ts.SyntaxKind.TemplateSpan, ts.SyntaxKind.JsxExpression].includes(parent.kind)) { + // parent is not something we know we can get the contextual type of + return; + } + // TODO - support return statement checking + return checker.getContextualType(node); +} +exports.getContextualType = getContextualType; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/dist/util/types.js.map b/node_modules/@typescript-eslint/eslint-plugin/dist/util/types.js.map new file mode 100644 index 000000000..275e1eedd --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/dist/util/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/util/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,qCAYiB;AACjB,+CAAiC;AAEjC,MAAM,GAAG,GAAG,eAAK,CAAC,6CAA6C,CAAC,CAAC;AAEjE;;;GAGG;AACH,SAAgB,kCAAkC,CAChD,IAAa,EACb,OAAuB;IAEvB,KAAK,MAAM,CAAC,IAAI,wBAAc,CAAC,IAAI,CAAC,EAAE;QACpC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;YAC3B,OAAO,KAAK,CAAC;SACd;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAXD,gFAWC;AAED;;;;GAIG;AACH,SAAgB,sBAAsB,CACpC,IAAa,EACb,QAAiB,EACjB,YAAyB;IAEzB,IAAI,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE;QAChE,OAAO,CAAC,QAAQ,CAAC;KAClB;IAED,IAAI,yBAAe,CAAC,IAAI,CAAC,EAAE;QACzB,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;KACpB;IAED,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;IAChC,IAAI,MAAM,IAAI,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;QAC3C,OAAO,IAAI,CAAC;KACb;IAED,IAAI,mCAAyB,CAAC,IAAI,CAAC,EAAE;QACnC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,E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AAe,CAAC,MAAM,CAAC,EAAE;QACvD,IAAI,IAAI,KAAK,MAAM,CAAC,UAAU,EAAE;YAC9B,2CAA2C;YAC3C,OAAO;SACR;KACF;SAAM,IACL,+BAAqB,CAAC,MAAM,CAAC;QAC7B,+BAAqB,CAAC,MAAM,CAAC;QAC7B,gCAAsB,CAAC,MAAM,CAAC,EAC9B;QACA,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;KAC3E;SAAM,IAAI,yBAAe,CAAC,MAAM,CAAC,EAAE;QAClC,OAAO,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;KAC1C;SAAM,IAAI,8BAAoB,CAAC,MAAM,CAAC,IAAI,sBAAY,CAAC,IAAI,CAAC,EAAE;QAC7D,OAAO,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;KACxC;SAAM,IACL,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,EAAE,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,QAAQ,CACjE,MAAM,CAAC,IAAI,CACZ,EACD;QACA,oEAAoE;QACpE,OAAO;KACR;IACD,2CAA2C;IAE3C,OAAO,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AAnCD,8CAmCC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/adjacent-overload-signatures.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/adjacent-overload-signatures.md new file mode 100644 index 000000000..e7a1596d1 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/adjacent-overload-signatures.md @@ -0,0 +1,89 @@ +# Require that member overloads be consecutive (`adjacent-overload-signatures`) + +Grouping overloaded members together can improve readability of the code. + +## Rule Details + +This rule aims to standardize the way overloaded members are organized. + +The following patterns are considered warnings: + +```ts +declare namespace Foo { + export function foo(s: string): void; + export function foo(n: number): void; + export function bar(): void; + export function foo(sn: string | number): void; +} + +type Foo = { + foo(s: string): void; + foo(n: number): void; + bar(): void; + foo(sn: string | number): void; +}; + +interface Foo { + foo(s: string): void; + foo(n: number): void; + bar(): void; + foo(sn: string | number): void; +} + +class Foo { + foo(s: string): void; + foo(n: number): void; + bar(): void {} + foo(sn: string | number): void {} +} + +export function foo(s: string): void; +export function foo(n: number): void; +export function bar(): void; +export function foo(sn: string | number): void; +``` + +The following patterns are not warnings: + +```ts +declare namespace Foo { + export function foo(s: string): void; + export function foo(n: number): void; + export function foo(sn: string | number): void; + export function bar(): void; +} + +type Foo = { + foo(s: string): void; + foo(n: number): void; + foo(sn: string | number): void; + bar(): void; +}; + +interface Foo { + foo(s: string): void; + foo(n: number): void; + foo(sn: string | number): void; + bar(): void; +} + +class Foo { + foo(s: string): void; + foo(n: number): void; + foo(sn: string | number): void {} + bar(): void {} +} + +export function bar(): void; +export function foo(s: string): void; +export function foo(n: number): void; +export function foo(sn: string | number): void; +``` + +## When Not To Use It + +If you don't care about the general structure of the code, then you will not need this rule. + +## Compatibility + +- TSLint: [adjacent-overload-signatures](https://palantir.github.io/tslint/rules/adjacent-overload-signatures/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/array-type.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/array-type.md new file mode 100644 index 000000000..2ed521c29 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/array-type.md @@ -0,0 +1,97 @@ +# Requires using either `T[]` or `Array` for arrays (`array-type`) + +Using the same style for array definitions across your codebase makes it easier for your developers to read and understand the types. + +## Rule Details + +This rule aims to standardize usage of array types within your codebase. + +## Options + +```ts +type ArrayOption = 'array' | 'generic' | 'array-simple'; +type Options = { + default: ArrayOption; + readonly?: ArrayOption; +}; + +const defaultOptions: Options = { + default: 'array', +}; +``` + +The rule accepts an options object with the following properties: + +- `default` - sets the array type expected for mutable cases. +- `readonly` - sets the array type expected for readonly arrays. If this is omitted, then the value for `default` will be used. + +Each property can be set to one of three strings: `'array' | 'generic' | 'array-simple'`. + +The default config will enforce that all mutable and readonly arrays use the `'array'` syntax. + +### `"array"` + +Always use `T[]` or `readonly T[]` for all array types. + +Incorrect code for `"array"`: + +```ts +const x: Array = ['a', 'b']; +const y: ReadonlyArray = ['a', 'b']; +``` + +Correct code for `"array"`: + +```ts +const x: string[] = ['a', 'b']; +const y: readonly string[] = ['a', 'b']; +``` + +### `"generic"` + +Always use `Array` or `ReadonlyArray` for all array types. + +Incorrect code for `"generic"`: + +```ts +const x: string[] = ['a', 'b']; +const y: readonly string[] = ['a', 'b']; +``` + +Correct code for `"generic"`: + +```ts +const x: Array = ['a', 'b']; +const y: ReadonlyArray = ['a', 'b']; +``` + +### `"array-simple"` + +Use `T[]` or `readonly T[]` for simple types (i.e. types which are just primitive names or type references). +Use `Array` or `ReadonlyArray` for all other types (union types, intersection types, object types, function types, etc). + +Incorrect code for `"array-simple"`: + +```ts +const a: (string | number)[] = ['a', 'b']; +const b: { prop: string }[] = [{ prop: 'a' }]; +const c: (() => void)[] = [() => {}]; +const d: Array = ['a', 'b']; +const e: Array = ['a', 'b']; +const f: ReadonlyArray = ['a', 'b']; +``` + +Correct code for `"array-simple"`: + +```ts +const a: Array = ['a', 'b']; +const b: Array<{ prop: string }> = [{ prop: 'a' }]; +const c: Array<() => void> = [() => {}]; +const d: MyType[] = ['a', 'b']; +const e: string[] = ['a', 'b']; +const f: readonly string[] = ['a', 'b']; +``` + +## Related to + +- TSLint: [array-type](https://palantir.github.io/tslint/rules/array-type/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/await-thenable.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/await-thenable.md new file mode 100644 index 000000000..fc65df9be --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/await-thenable.md @@ -0,0 +1,33 @@ +# Disallows awaiting a value that is not a Thenable (`await-thenable`) + +This rule disallows awaiting a value that is not a "Thenable" (an object which has `then` method, such as a Promise). +While it is valid JavaScript to await a non-`Promise`-like value (it will resolve immediately), this pattern is often a programmer error, such as forgetting to add parenthesis to call a function that returns a Promise. + +## Rule Details + +Examples of **incorrect** code for this rule: + +```ts +await 'value'; + +const createValue = () => 'value'; +await createValue(); +``` + +Examples of **correct** code for this rule: + +```ts +await Promise.resolve('value'); + +const createValue = async () => 'value'; +await createValue(); +``` + +## When Not To Use It + +If you want to allow code to `await` non-Promise values. +This is generally not preferred, but can sometimes be useful for visual consistency. + +## Related to + +- TSLint: ['await-promise'](https://palantir.github.io/tslint/rules/await-promise) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-ts-comment.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-ts-comment.md new file mode 100644 index 000000000..2509793eb --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-ts-comment.md @@ -0,0 +1,116 @@ +# Bans `// @ts-` comments from being used or requires descriptions after directive (`ban-ts-comment`) + +TypeScript provides several directive comments that can be used to alter how it processes files. +Using these to suppress TypeScript Compiler Errors reduces the effectiveness of TypeScript overall. + +The directive comments supported by TypeScript are: + +```ts +// @ts-expect-error +// @ts-ignore +// @ts-nocheck +// @ts-check +``` + +## Rule Details + +This rule lets you set which directive comments you want to allow in your codebase. +By default, only `@ts-check` is allowed, as it enables rather than suppresses errors. + +The configuration looks like this: + +```ts +interface Options { + 'ts-expect-error'?: boolean | 'allow-with-description'; + 'ts-ignore'?: boolean | 'allow-with-description'; + 'ts-nocheck'?: boolean | 'allow-with-description'; + 'ts-check'?: boolean | 'allow-with-description'; + minimumDescriptionLength?: number; +} + +const defaultOptions: Options = { + 'ts-expect-error': 'allow-with-description', + 'ts-ignore': true, + 'ts-nocheck': true, + 'ts-check': false, + minimumDescriptionLength: 3, +}; +``` + +### `ts-expect-error`, `ts-ignore`, `ts-nocheck`, `ts-check` directives + +A value of `true` for a particular directive means that this rule will report if it finds any usage of said directive. + +For example, with the defaults above the following patterns are considered warnings: + +```ts +if (false) { + // @ts-ignore: Unreachable code error + console.log('hello'); +} +``` + +The following patterns are not warnings: + +```ts +if (false) { + // Compiler warns about unreachable code error + console.log('hello'); +} +``` + +### `allow-with-description` + +A value of `'allow-with-description'` for a particular directive means that this rule will report if it finds a directive that does not have a description following the directive (on the same line). + +For example, with `{ 'ts-expect-error': 'allow-with-description' }` the following pattern is considered a warning: + +```ts +if (false) { + // @ts-expect-error + console.log('hello'); +} +``` + +The following pattern is not a warning: + +```ts +if (false) { + // @ts-expect-error: Unreachable code error + console.log('hello'); +} +``` + +### `minimumDescriptionLength` + +Use `minimumDescriptionLength` to set a minimum length for descriptions when using the `allow-with-description` option for a directive. + +For example, with `{ 'ts-expect-error': 'allow-with-description', minimumDescriptionLength: 10 }` the following pattern is considered a warning: + +```ts +if (false) { + // @ts-expect-error: TODO + console.log('hello'); +} +``` + +The following pattern is not a warning: + +```ts +if (false) { + // @ts-expect-error The rationale for this override is described in issue #1337 on GitLab + console.log('hello'); +} +``` + +## When Not To Use It + +If you want to use all of the TypeScript directives. + +## Further Reading + +- TypeScript [Type Checking JavaScript Files](https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html) + +## Compatibility + +- TSLint: [ban-ts-ignore](https://palantir.github.io/tslint/rules/ban-ts-ignore/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-tslint-comment.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-tslint-comment.md new file mode 100644 index 000000000..6af168f4b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-tslint-comment.md @@ -0,0 +1,29 @@ +# Bans `// tslint:` comments from being used (`ban-tslint-comment`) + +Useful when migrating from TSLint to ESLint. Once TSLint has been removed, this rule helps locate TSLint annotations (e.g. `// tslint:disable`). + +## Rule Details + +Examples of **incorrect** code for this rule: + +All TSLint [rule flags](https://palantir.github.io/tslint/usage/rule-flags/) + +```js +/* tslint:disable */ +/* tslint:enable */ +/* tslint:disable:rule1 rule2 rule3... */ +/* tslint:enable:rule1 rule2 rule3... */ +// tslint:disable-next-line +someCode(); // tslint:disable-line +// tslint:disable-next-line:rule1 rule2 rule3... +``` + +Examples of **correct** code for this rule: + +```js +// This is a comment that just happens to mention tslint +``` + +## When Not To Use It + +If you are still using TSLint. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-types.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-types.md new file mode 100644 index 000000000..9f279ea7b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-types.md @@ -0,0 +1,187 @@ +# Bans specific types from being used (`ban-types`) + +Some builtin types have aliases, some types are considered dangerous or harmful. +It's often a good idea to ban certain types to help with consistency and safety. + +## Rule Details + +This rule bans specific types and can suggest alternatives. +Note that it does not ban the corresponding runtime objects from being used. + +## Options + +```ts +type Options = { + types?: { + [typeName: string]: + | false + | string + | { + message: string; + fixWith?: string; + }; + }; + extendDefaults?: boolean; +}; +``` + +The rule accepts a single object as options, with the following keys: + +- `types` - An object whose keys are the types you want to ban, and the values are error messages. + - The type can either be a type name literal (`Foo`), a type name with generic parameter instantiation(s) (`Foo`), or the empty object literal (`{}`). + - The values can be a string, which is the error message to be reported, `false` to specifically disable this type + or it can be an object with the following properties: + - `message: string` - the message to display when the type is matched. + - `fixWith?: string` - a string to replace the banned type with when the fixer is run. If this is omitted, no fix will be done. +- `extendDefaults` - if you're specifying custom `types`, you can set this to `true` to extend the default `types` configuration. + - This is a convenience option to save you copying across the defaults when adding another type. + - If this is `false`, the rule will _only_ use the types defined in your configuration. + +Example configuration: + +```jsonc +{ + "@typescript-eslint/ban-types": [ + "error", + { + "types": { + // add a custom message to help explain why not to use it + "Foo": "Don't use Far because it is unsafe", + + // add a custom message, AND tell the plugin how to fix it + "String": { + "message": "Use string instead", + "fixWith": "string" + }, + + "{}": { + "message": "Use object instead", + "fixWith": "object" + } + } + } + ] +} +``` + +### Default Options + +The default options provide a set of "best practices", intended to provide safety and standardization in your codebase: + +- Don't use the upper-case primitive types, you should use the lower-case types for consistency. +- Avoid the `Function` type, as it provides little safety for the following reasons: + - It provides no type safety when calling the value, which means it's easy to provide the wrong arguments. + - It accepts class declarations, which will fail when called, as they are called without the `new` keyword. +- Avoid the `Object` and `{}` types, as they mean "any non-nullish value". + - This is a point of confusion for many developers, who think it means "any object type". +- Avoid the `object` type, as it is currently hard to use due to not being able to assert that keys exist. + - See [microsoft/TypeScript#21732](https://github.com/microsoft/TypeScript/issues/21732). + +**_Important note:_** the default options suggest using `Record`; this was a stylistic decision, as the built-in `Record` type is considered to look cleaner. + +
+Default Options + +```ts +const defaultTypes = { + String: { + message: 'Use string instead', + fixWith: 'string', + }, + Boolean: { + message: 'Use boolean instead', + fixWith: 'boolean', + }, + Number: { + message: 'Use number instead', + fixWith: 'number', + }, + Symbol: { + message: 'Use symbol instead', + fixWith: 'symbol', + }, + + Function: { + message: [ + 'The `Function` type accepts any function-like value.', + 'It provides no type safety when calling the function, which can be a common source of bugs.', + 'It also accepts things like class declarations, which will throw at runtime as they will not be called with `new`.', + 'If you are expecting the function to accept certain arguments, you should explicitly define the function shape.', + ].join('\n'), + }, + + // object typing + Object: { + message: [ + 'The `Object` type actually means "any non-nullish value", so it is marginally better than `unknown`.', + '- If you want a type meaning "any object", you probably want `Record` instead.', + '- If you want a type meaning "any value", you probably want `unknown` instead.', + ].join('\n'), + }, + '{}': { + message: [ + '`{}` actually means "any non-nullish value".', + '- If you want a type meaning "any object", you probably want `Record` instead.', + '- If you want a type meaning "any value", you probably want `unknown` instead.', + ].join('\n'), + }, + object: { + message: [ + 'The `object` type is currently hard to use ([see this issue](https://github.com/microsoft/TypeScript/issues/21732)).', + 'Consider using `Record` instead, as it allows you to more easily inspect and use the keys.', + ].join('\n'), + }, +}; +``` + +
+ +### Examples + +Examples of **incorrect** code with the default options: + +```ts +// use lower-case primitives for consistency +const str: String = 'foo'; +const bool: Boolean = true; +const num: Number = 1; +const symb: Symbol = Symbol('foo'); + +// use a proper function type +const func: Function = () => 1; + +// use safer object types +const lowerObj: object = {}; + +const capitalObj1: Object = 1; +const capitalObj2: Object = { a: 'string' }; + +const curly1: {} = 1; +const curly2: {} = { a: 'string' }; +``` + +Examples of **correct** code with the default options: + +```ts +// use lower-case primitives for consistency +const str: string = 'foo'; +const bool: boolean = true; +const num: number = 1; +const symb: symbol = Symbol('foo'); + +// use a proper function type +const func: () => number = () => 1; + +// use safer object types +const lowerObj: Record = {}; + +const capitalObj1: number = 1; +const capitalObj2: { a: string } = { a: 'string' }; + +const curly1: number = 1; +const curly2: Record<'a', string> = { a: 'string' }; +``` + +## Compatibility + +- TSLint: [ban-types](https://palantir.github.io/tslint/rules/ban-types/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/brace-style.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/brace-style.md new file mode 100644 index 000000000..06dfa1619 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/brace-style.md @@ -0,0 +1,22 @@ +# Enforce consistent brace style for blocks (`brace-style`) + +## Rule Details + +This rule extends the base [`eslint/brace-style`](https://eslint.org/docs/rules/brace-style) rule. +It adds support for `enum`, `interface`, `namespace` and `module` declarations. + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "brace-style": "off", + "@typescript-eslint/brace-style": ["error"] +} +``` + +## Options + +See [`eslint/brace-style` options](https://eslint.org/docs/rules/brace-style#options). + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/brace-style.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/camelcase.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/camelcase.md new file mode 100644 index 000000000..cea282249 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/camelcase.md @@ -0,0 +1,8 @@ +## DEPRECATED + +This rule has been deprecated in favour of the [`naming-convention`](./naming-convention.md) rule. + + diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/class-literal-property-style.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/class-literal-property-style.md new file mode 100644 index 000000000..1bca8390f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/class-literal-property-style.md @@ -0,0 +1,96 @@ +# Ensures that literals on classes are exposed in a consistent style (`class-literal-property-style`) + +When writing TypeScript applications, it's typically safe to store literal values on classes using fields with the `readonly` modifier to prevent them from being reassigned. +When writing TypeScript libraries that could be used by JavaScript users however, it's typically safer to expose these literals using `getter`s, since the `readonly` modifier is enforced at compile type. + +## Rule Details + +This rule aims to ensure that literals exposed by classes are done so consistently, in one of the two style described above. +By default this rule prefers the `fields` style as it means JS doesn't have to setup & teardown a function closure. + +Note that this rule only checks for constant _literal_ values (string, template string, number, bigint, boolean, regexp, null). It does not check objects or arrays, because a readonly field behaves differently to a getter in those cases. It also does not check functions, as it is a common pattern to use readonly fields with arrow function values as auto-bound methods. +This is because these types can be mutated and carry with them more complex implications about their usage. + +### The `fields` style + +This style checks for any getter methods that return literal values, and requires them to be defined using fields with the `readonly` modifier instead. + +Examples of **correct** code with the `fields` style: + +```ts +/* eslint @typescript-eslint/class-literal-property-style: ["error", "fields"] */ + +class Mx { + public readonly myField1 = 1; + + // not a literal + public readonly myField2 = [1, 2, 3]; + + private readonly ['myField3'] = 'hello world'; + + public get myField4() { + return `hello from ${window.location.href}`; + } +} +``` + +Examples of **incorrect** code with the `fields` style: + +```ts +/* eslint @typescript-eslint/class-literal-property-style: ["error", "fields"] */ + +class Mx { + public static get myField1() { + return 1; + } + + private get ['myField2']() { + return 'hello world'; + } +} +``` + +### The `getters` style + +This style checks for any `readonly` fields that are assigned literal values, and requires them to be defined as getters instead. +This style pairs well with the [`@typescript-eslint/prefer-readonly`](prefer-readonly.md) rule, +as it will identify fields that can be `readonly`, and thus should be made into getters. + +Examples of **correct** code with the `getters` style: + +```ts +/* eslint @typescript-eslint/class-literal-property-style: ["error", "getters"] */ + +class Mx { + // no readonly modifier + public myField1 = 'hello'; + + // not a literal + public readonly myField2 = [1, 2, 3]; + + public static get myField3() { + return 1; + } + + private get ['myField4']() { + return 'hello world'; + } +} +``` + +Examples of **incorrect** code with the `getters` style: + +```ts +/* eslint @typescript-eslint/class-literal-property-style: ["error", "getters"] */ + +class Mx { + readonly myField1 = 1; + readonly myField2 = `hello world`; + private readonly myField3 = 'hello world'; +} +``` + +## When Not To Use It + +When you have no strong preference, or do not wish to enforce a particular style +for how literal values are exposed by your classes. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-spacing.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-spacing.md new file mode 100644 index 000000000..092018041 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-spacing.md @@ -0,0 +1,22 @@ +# Enforces consistent spacing before and after commas (`comma-spacing`) + +## Rule Details + +This rule extends the base [`eslint/comma-spacing`](https://eslint.org/docs/rules/comma-spacing) rule. +It adds support for trailing comma in a types parameters list. + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "comma-spacing": "off", + "@typescript-eslint/comma-spacing": ["error"] +} +``` + +## Options + +See [`eslint/comma-spacing` options](https://eslint.org/docs/rules/comma-spacing#options). + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/comma-spacing.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-assertions.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-assertions.md new file mode 100644 index 000000000..43e67b755 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-assertions.md @@ -0,0 +1,93 @@ +# Enforces consistent usage of type assertions (`consistent-type-assertions`) + +## Rule Details + +This rule aims to standardize the use of type assertion style across the codebase. + +Type assertions are also commonly referred as "type casting" in TypeScript (even though it is technically slightly different to what is understood by type casting in other languages), so you can think of type assertions and type casting referring to the same thing. It is essentially you saying to the TypeScript compiler, "in this case, I know better than you!". + +In addition to ensuring that type assertions are written in a consistent way, this rule also helps make your codebase more type-safe. + +`const` assertions, [introduced in TypeScript 3.4](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions), is always allowed by this rule. Examples of it include `let x = "hello" as const;` and `let x = "hello";`. + +## Options + +```ts +type Options = + | { + assertionStyle: 'as' | 'angle-bracket'; + objectLiteralTypeAssertions: 'allow' | 'allow-as-parameter' | 'never'; + } + | { + assertionStyle: 'never'; + }; + +const defaultOptions: Options = { + assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow', +}; +``` + +### `assertionStyle` + +This option defines the expected assertion style. Valid values for `assertionStyle` are: + +- `as` will enforce that you always use `... as foo`. +- `angle-bracket` will enforce that you always use `...` +- `never` will enforce that you do not do any type assertions. + +Most codebases will want to enforce not using `angle-bracket` style because it conflicts with JSX syntax, and is confusing when paired with generic syntax. + +Some codebases like to go for an extra level of type safety, and ban assertions altogether via the `never` option. + +### `objectLiteralTypeAssertions` + +Always prefer `const x: T = { ... };` to `const x = { ... } as T;` (or similar with angle brackets). The type assertion in the latter case is either unnecessary or will probably hide an error. + +The compiler will warn for excess properties with this syntax, but not missing _required_ fields. For example: `const x: { foo: number } = {};` will fail to compile, but `const x = {} as { foo: number }` will succeed. + +The const assertion `const x = { foo: 1 } as const`, introduced in TypeScript 3.4, is considered beneficial and is ignored by this option. + +Assertions to `any` are also ignored by this option. + +Examples of **incorrect** code for `{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }` (and for `{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow-as-parameter' }`) + +```ts +const x = { ... } as T; + +function foo() { + return { ... } as T; +} +``` + +Examples of **correct** code for `{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }`. + +```ts +const x: T = { ... }; +const y = { ... } as any; +const z = { ... } as unknown; + +function foo(): T { + return { ... }; +} +``` + +Examples of **correct** code for `{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow-as-parameter' }`. + +```ts +const x: T = { ... }; +const y = { ... } as any; +const z = { ... } as unknown; +foo({ ... } as T); +new Clazz({ ... } as T); +function foo() { throw { bar: 5 } as Foo } +``` + +## When Not To Use It + +If you do not want to enforce consistent type assertions. + +## Compatibility + +- TSLint: [no-angle-bracket-type-assertion](https://palantir.github.io/tslint/rules/no-angle-bracket-type-assertion/) +- TSLint: [no-object-literal-type-assertion](https://palantir.github.io/tslint/rules/no-object-literal-type-assertion/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-definitions.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-definitions.md new file mode 100644 index 000000000..1688552d8 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-definitions.md @@ -0,0 +1,74 @@ +# Consistent with type definition either `interface` or `type` (`consistent-type-definitions`) + +There are two ways to define a type. + +```ts +// type alias +type T1 = { + a: string; + b: number; +}; + +// interface keyword +interface T2 { + a: string; + b: number; +} +``` + +## Options + +This rule accepts one string option: + +- `"interface"`: enforce using `interface`s for object type definitions. +- `"type"`: enforce using `type`s for object type definitions. + +For example: + +```CJSON +{ + // Use type for object definitions + "@typescript-eslint/consistent-type-definitions": ["error", "type"] +} +``` + +## Rule Details + +Examples of **incorrect** code with `interface` option. + +```ts +type T = { x: number }; +``` + +Examples of **correct** code with `interface` option. + +```ts +type T = string; +type Foo = string | {}; + +interface T { + x: number; +} +``` + +Examples of **incorrect** code with `type` option. + +```ts +interface T { + x: number; +} +``` + +Examples of **correct** code with `type` option. + +```ts +type T = { x: number }; +``` + +## When Not To Use It + +If you specifically want to use an interface or type literal for stylistic reasons, you can disable this rule. + +## Compatibility + +- TSLint: [interface-over-type-literal](https://palantir.github.io/tslint/rules/interface-over-type-literal/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-imports.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-imports.md new file mode 100644 index 000000000..3487bf9b5 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-imports.md @@ -0,0 +1,64 @@ +# Enforces consistent usage of type imports (`consistent-type-imports`) + +TypeScript 3.8 added support for type-only imports. +Type-only imports allow you to specify that an import can only be used in a type location, allowing certain optimizations within compilers. + +## Rule Details + +This rule aims to standardize the use of type imports style across the codebase. + +## Options + +```ts +type Options = { + prefer: 'type-imports' | 'no-type-imports'; + disallowTypeAnnotations: boolean; +}; + +const defaultOptions: Options = { + prefer: 'type-imports', + disallowTypeAnnotations: true, +}; +``` + +### `prefer` + +This option defines the expected import kind for type-only imports. Valid values for `prefer` are: + +- `type-imports` will enforce that you always use `import type Foo from '...'`. It is default. +- `no-type-imports` will enforce that you always use `import Foo from '...'`. + +Examples of **correct** code with `{prefer: 'type-imports'}`, and **incorrect** code with `{prefer: 'no-type-imports'}`. + +```ts +import type { Foo } from 'Foo'; +import type Bar from 'Bar'; +type T = Foo; +const x: Bar = 1; +``` + +Examples of **incorrect** code with `{prefer: 'type-imports'}`, and **correct** code with `{prefer: 'no-type-imports'}`. + +```ts +import { Foo } from 'Foo'; +import Bar from 'Bar'; +type T = Foo; +const x: Bar = 1; +``` + +### `disallowTypeAnnotations` + +If `true`, type imports in type annotations (`import()`) is not allowed. +Default is `true`. + +Examples of **incorrect** code with `{disallowTypeAnnotations: true}`. + +```ts +type T = import('Foo').Foo; +const x: import('Bar') = 1; +``` + +## When Not To Use It + +- If you are not using TypeScript 3.8 (or greater), then you will not be able to use this rule, as type-only imports are not allowed. +- If you specifically want to use both import kinds for stylistic reasons, you can disable this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/default-param-last.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/default-param-last.md new file mode 100644 index 000000000..c9c51df40 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/default-param-last.md @@ -0,0 +1,56 @@ +# Enforce default parameters to be last (`default-param-last`) + +## Rule Details + +This rule extends the base [`eslint/default-param-last`](https://eslint.org/docs/rules/default-param-last) rule. +It adds support for optional parameters. + +Examples of **incorrect** code for this rule: + +```ts +/* eslint @typescript-eslint/default-param-last: ["error"] */ + +function f(a = 0, b: number) {} +function f(a: number, b = 0, c: number) {} +function f(a: number, b?: number, c: number) {} +class Foo { + constructor(public a = 10, private b: number) {} +} +class Foo { + constructor(public a?: number, private b: number) {} +} +``` + +Examples of **correct** code for this rule: + +```ts +/* eslint @typescript-eslint/default-param-last: ["error"] */ + +function f(a = 0) {} +function f(a: number, b = 0) {} +function f(a: number, b?: number) {} +function f(a: number, b?: number, c = 0) {} +function f(a: number, b = 0, c?: number) {} +class Foo { + constructor(public a, private b = 0) {} +} +class Foo { + constructor(public a, private b?: number) {} +} +``` + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "default-param-last": "off", + "@typescript-eslint/default-param-last": ["error"] +} +``` + +## Options + +See [`eslint/default-param-last` options](https://eslint.org/docs/rules/default-param-last#options). + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/default-param-last.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/dot-notation.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/dot-notation.md new file mode 100644 index 000000000..f827b003e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/dot-notation.md @@ -0,0 +1,46 @@ +# enforce dot notation whenever possible (`dot-notation`) + +## Rule Details + +This rule extends the base [`eslint/dot-notation`](https://eslint.org/docs/rules/dot-notation) rule. +It adds support for optionally ignoring computed `private` member access. + +## How to use + +```cjson +{ + // note you must disable the base rule as it can report incorrect errors + "dot-notation": "off", + "@typescript-eslint/dot-notation": ["error"] +} +``` + +## Options + +See [`eslint/dot-notation`](https://eslint.org/docs/rules/dot-notation#options) options. +This rule adds the following options: + +```ts +interface Options extends BaseDotNotationOptions { + allowPrivateClassPropertyAccess?: boolean; +} +const defaultOptions: Options = { + ...baseDotNotationDefaultOptions, + allowPrivateClassPropertyAccess: false, +}; +``` + +### `allowPrivateClassPropertyAccess` + +Example of a correct code when `allowPrivateClassPropertyAccess` is set to `true` + +```ts +class X { + private priv_prop = 123; +} + +const x = new X(); +x['priv_prop'] = 123; +``` + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/dot-notation.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-function-return-type.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-function-return-type.md new file mode 100644 index 000000000..3cafe4224 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-function-return-type.md @@ -0,0 +1,229 @@ +# Require explicit return types on functions and class methods (`explicit-function-return-type`) + +Explicit types for function return values makes it clear to any calling code what type is returned. +This ensures that the return value is assigned to a variable of the correct type; or in the case +where there is no return value, that the calling code doesn't try to use the undefined value when it +shouldn't. + +## Rule Details + +This rule aims to ensure that the values returned from functions are of the expected type. + +The following patterns are considered warnings: + +```ts +// Should indicate that no value is returned (void) +function test() { + return; +} + +// Should indicate that a number is returned +var fn = function () { + return 1; +}; + +// Should indicate that a string is returned +var arrowFn = () => 'test'; + +class Test { + // Should indicate that no value is returned (void) + method() { + return; + } +} +``` + +The following patterns are not warnings: + +```ts +// No return value should be expected (void) +function test(): void { + return; +} + +// A return value of type number +var fn = function (): number { + return 1; +}; + +// A return value of type string +var arrowFn = (): string => 'test'; + +class Test { + // No return value should be expected (void) + method(): void { + return; + } +} +``` + +## Options + +The rule accepts an options object with the following properties: + +```ts +type Options = { + // if true, only functions which are part of a declaration will be checked + allowExpressions?: boolean; + // if true, type annotations are also allowed on the variable of a function expression rather than on the function directly + allowTypedFunctionExpressions?: boolean; + // if true, functions immediately returning another function expression will not be checked + allowHigherOrderFunctions?: boolean; + // if true, concise arrow functions that start with the void keyword will not be checked + allowConciseArrowFunctionExpressionsStartingWithVoid?: boolean; +}; + +const defaults = { + allowExpressions: false, + allowTypedFunctionExpressions: true, + allowHigherOrderFunctions: true, + allowConciseArrowFunctionExpressionsStartingWithVoid: true, +}; +``` + +### Configuring in a mixed JS/TS codebase + +If you are working on a codebase within which you lint non-TypeScript code (i.e. `.js`/`.jsx`), you should ensure that you should use [ESLint `overrides`](https://eslint.org/docs/user-guide/configuring#disabling-rules-only-for-a-group-of-files) to only enable the rule on `.ts`/`.tsx` files. If you don't, then you will get unfixable lint errors reported within `.js`/`.jsx` files. + +```jsonc +{ + "rules": { + // disable the rule for all files + "@typescript-eslint/explicit-function-return-type": "off" + }, + "overrides": [ + { + // enable the rule specifically for TypeScript files + "files": ["*.ts", "*.tsx"], + "rules": { + "@typescript-eslint/explicit-function-return-type": ["error"] + } + } + ] +} +``` + +### `allowExpressions` + +Examples of **incorrect** code for this rule with `{ allowExpressions: true }`: + +```ts +function test() {} + +const fn = () => {}; + +export default () => {}; +``` + +Examples of **correct** code for this rule with `{ allowExpressions: true }`: + +```ts +node.addEventListener('click', () => {}); + +node.addEventListener('click', function () {}); + +const foo = arr.map(i => i * i); +``` + +### `allowTypedFunctionExpressions` + +Examples of **incorrect** code for this rule with `{ allowTypedFunctionExpressions: true }`: + +```ts +let arrowFn = () => 'test'; + +let funcExpr = function () { + return 'test'; +}; + +let objectProp = { + foo: () => 1, +}; +``` + +Examples of additional **correct** code for this rule with `{ allowTypedFunctionExpressions: true }`: + +```ts +type FuncType = () => string; + +let arrowFn: FuncType = () => 'test'; + +let funcExpr: FuncType = function() { + return 'test'; +}; + +let asTyped = (() => '') as () => string; +let castTyped = <() => string>(() => ''); + +interface ObjectType { + foo(): number; +} +let objectProp: ObjectType = { + foo: () => 1, +}; +let objectPropAs = { + foo: () => 1, +} as ObjectType; +let objectPropCast = { + foo: () => 1, +}; + +declare functionWithArg(arg: () => number); +functionWithArg(() => 1); + +declare functionWithObjectArg(arg: { method: () => number }); +functionWithObjectArg({ + method() { + return 1; + }, +}); +``` + +### `allowHigherOrderFunctions` + +Examples of **incorrect** code for this rule with `{ allowHigherOrderFunctions: true }`: + +```ts +var arrowFn = () => () => {}; + +function fn() { + return function () {}; +} +``` + +Examples of **correct** code for this rule with `{ allowHigherOrderFunctions: true }`: + +```ts +var arrowFn = () => (): void => {}; + +function fn() { + return function (): void {}; +} +``` + +### `allowConciseArrowFunctionExpressionsStartingWithVoid` + +Examples of **incorrect** code for this rule with `{ allowConciseArrowFunctionExpressionsStartingWithVoid: true }`: + +```ts +var join = (a: string, b: string) => `${a}${b}`; + +const log = (message: string) => { + console.log(message); +}; +``` + +Examples of **correct** code for this rule with `{ allowConciseArrowFunctionExpressionsStartingWithVoid: true }`: + +```ts +var log = (message: string) => void console.log(message); +``` + +## When Not To Use It + +If you don't wish to prevent calling code from using function return values in unexpected ways, then +you will not need this rule. + +## Further Reading + +- TypeScript [Functions](https://www.typescriptlang.org/docs/handbook/functions.html#function-types) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-member-accessibility.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-member-accessibility.md new file mode 100644 index 000000000..9b148d95c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-member-accessibility.md @@ -0,0 +1,344 @@ +# Require explicit accessibility modifiers on class properties and methods (`explicit-member-accessibility`) + +Leaving off accessibility modifier and making everything public can make +your interface hard to use by others. +If you make all internal pieces private or protected, your interface will +be easier to use. + +## Rule Details + +This rule aims to make code more readable and explicit about who can use +which properties. + +## Options + +```ts +type AccessibilityLevel = + | 'explicit' // require an accessor (including public) + | 'no-public' // don't require public + | 'off'; // don't check + +type Options = { + accessibility?: AccessibilityLevel; + ignoredMethodNames?: string[]; + overrides?: { + accessors?: AccessibilityLevel; + constructors?: AccessibilityLevel; + methods?: AccessibilityLevel; + properties?: AccessibilityLevel; + parameterProperties?: AccessibilityLevel; + }; +}; + +const defaultOptions: Options = { + accessibility: 'explicit', +}; +``` + +### Configuring in a mixed JS/TS codebase + +If you are working on a codebase within which you lint non-TypeScript code (i.e. `.js`/`.jsx`), you should ensure that you should use [ESLint `overrides`](https://eslint.org/docs/user-guide/configuring#disabling-rules-only-for-a-group-of-files) to only enable the rule on `.ts`/`.tsx` files. If you don't, then you will get unfixable lint errors reported within `.js`/`.jsx` files. + +```jsonc +{ + "rules": { + // disable the rule for all files + "@typescript-eslint/explicit-member-accessibility": "off" + }, + "overrides": [ + { + // enable the rule specifically for TypeScript files + "files": ["*.ts", "*.tsx"], + "rules": { + "@typescript-eslint/explicit-member-accessibility": ["error"] + } + } + ] +} +``` + +### `accessibility` + +This rule in its default state requires no configuration and will enforce that every class member has an accessibility modifier. If you would like to allow for some implicit public members then you have the following options: + +```ts +{ + accessibility: 'explicit', + overrides: { + accessors: 'explicit', + constructors: 'no-public', + methods: 'explicit', + properties: 'off', + parameterProperties: 'explicit' + } +} +``` + +Note the above is an example of a possible configuration you could use - it is not the default configuration. + +The following patterns are considered incorrect code if no options are provided: + +```ts +class Animal { + constructor(name) { + // No accessibility modifier + this.animalName = name; + } + animalName: string; // No accessibility modifier + get name(): string { + // No accessibility modifier + return this.animalName; + } + set name(value: string) { + // No accessibility modifier + this.animalName = value; + } + walk() { + // method + } +} +``` + +The following patterns are considered correct with the default options `{ accessibility: 'explicit' }`: + +```ts +class Animal { + public constructor(public breed, name) { + // Parameter property and constructor + this.animalName = name; + } + private animalName: string; // Property + get name(): string { + // get accessor + return this.animalName; + } + set name(value: string) { + // set accessor + this.animalName = value; + } + public walk() { + // method + } +} +``` + +The following patterns are considered incorrect with the accessibility set to **no-public** `[{ accessibility: 'no-public' }]`: + +```ts +class Animal { + public constructor(public breed, name) { + // Parameter property and constructor + this.animalName = name; + } + public animalName: string; // Property + public get name(): string { + // get accessor + return this.animalName; + } + public set name(value: string) { + // set accessor + this.animalName = value; + } + public walk() { + // method + } +} +``` + +The following patterns are considered correct with the accessibility set to **no-public** `[{ accessibility: 'no-public' }]`: + +```ts +class Animal { + constructor(protected breed, name) { + // Parameter property and constructor + this.name = name; + } + private animalName: string; // Property + get name(): string { + // get accessor + return this.animalName; + } + private set name(value: string) { + // set accessor + this.animalName = value; + } + protected walk() { + // method + } +} +``` + +### Overrides + +There are three ways in which an override can be used. + +- To disallow the use of public on a given member. +- To enforce explicit member accessibility when the root has allowed implicit public accessibility +- To disable any checks on given member type + +#### Disallow the use of public on a given member + +e.g. `[ { overrides: { constructors: 'no-public' } } ]` + +The following patterns are considered incorrect with the example override + +```ts +class Animal { + public constructor(protected animalName) {} + public get name() { + return this.animalName; + } +} +``` + +The following patterns are considered correct with the example override + +```ts +class Animal { + constructor(protected animalName) {} + public get name() { + return this.animalName; + } +} +``` + +#### Require explicit accessibility for a given member + +e.g. `[ { accessibility: 'no-public', overrides: { properties: 'explicit' } } ]` + +The following patterns are considered incorrect with the example override + +```ts +class Animal { + constructor(protected animalName) {} + get name() { + return this.animalName; + } + protected set name(value: string) { + this.animalName = value; + } + legs: number; + private hasFleas: boolean; +} +``` + +The following patterns are considered correct with the example override + +```ts +class Animal { + constructor(protected animalName) {} + get name() { + return this.animalName; + } + protected set name(value: string) { + this.animalName = value; + } + public legs: number; + private hasFleas: boolean; +} +``` + +e.g. `[ { accessibility: 'off', overrides: { parameterProperties: 'explicit' } } ]` + +The following code is considered incorrect with the example override + +```ts +class Animal { + constructor(readonly animalName: string) {} +} +``` + +The following code patterns are considered correct with the example override + +```ts +class Animal { + constructor(public readonly animalName: string) {} +} + +class Animal { + constructor(public animalName: string) {} +} +``` + +e.g. `[ { accessibility: 'off', overrides: { parameterProperties: 'no-public' } } ]` + +The following code is considered incorrect with the example override + +```ts +class Animal { + constructor(public readonly animalName: string) {} +} +``` + +The following code is considered correct with the example override + +```ts +class Animal { + constructor(public animalName: string) {} +} +``` + +#### Disable any checks on given member type + +e.g. `[{ overrides: { accessors : 'off' } } ]` + +As no checks on the overridden member type are performed all permutations of visibility are permitted for that member type + +The follow pattern is considered incorrect for the given configuration + +```ts +class Animal { + constructor(protected animalName) {} + public get name() { + return this.animalName; + } + get legs() { + return this.legCount; + } +} +``` + +The following patterns are considered correct with the example override + +```ts +class Animal { + public constructor(protected animalName) {} + public get name() { + return this.animalName; + } + get legs() { + return this.legCount; + } +} +``` + +### Except specific methods + +If you want to ignore some specific methods, you can do it by specifying method names. Note that this option does not care for the context, and will ignore every method with these names, which could lead to it missing some cases. You should use this sparingly. +e.g. `[ { ignoredMethodNames: ['specificMethod', 'whateverMethod'] } ]` + +```ts +class Animal { + get specificMethod() { + console.log('No error because you specified this method on option'); + } + get whateverMethod() { + console.log('No error because you specified this method on option'); + } + public get otherMethod() { + console.log('This method comply with this rule'); + } +} +``` + +## When Not To Use It + +If you think defaulting to public is a good default, then you should consider using the `no-public` setting. If you want to mix implicit and explicit public members then disable this rule. + +## Further Reading + +- TypeScript [Accessibility Modifiers](https://www.typescriptlang.org/docs/handbook/classes.html#public-private-and-protected-modifiers) + +## Compatibility + +- TSLint: [member-access](http://palantir.github.io/tslint/rules/member-access/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-module-boundary-types.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-module-boundary-types.md new file mode 100644 index 000000000..f33a8d5b7 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-module-boundary-types.md @@ -0,0 +1,274 @@ +# Require explicit return and argument types on exported functions' and classes' public class methods (`explicit-module-boundary-types`) + +Explicit types for function return values and arguments makes it clear to any calling code what is the module boundary's input and output. + +Consider using this rule in place of [`no-untyped-public-signature`](./no-untyped-public-signature.md) which has been deprecated. + +## Rule Details + +This rule aims to ensure that the values returned from a module are of the expected type. + +The following patterns are considered warnings: + +```ts +// Should indicate that no value is returned (void) +export function test() { + return; +} + +// Should indicate that a number is returned +export default function () { + return 1; +} + +// Should indicate that a string is returned +export var arrowFn = () => 'test'; + +// All arguments should be typed +export var arrowFn = (arg): string => `test ${arg}`; +export var arrowFn = (arg: any): string => `test ${arg}`; + +export class Test { + // Should indicate that no value is returned (void) + method() { + return; + } +} +``` + +The following patterns are not warnings: + +```ts +// Function is not exported +function test() { + return; +} + +// A return value of type number +export var fn = function (): number { + return 1; +}; + +// A return value of type string +export var arrowFn = (arg: string): string => `test ${arg}`; + +// All arguments should be typed +export var arrowFn = (arg: string): string => `test ${arg}`; +export var arrowFn = (arg: unknown): string => `test ${arg}`; + +// Class is not exported +class Test { + method() { + return; + } +} +``` + +## Options + +The rule accepts an options object with the following properties: + +```ts +type Options = { + /** + * If true, the rule will not report for arguments that are explicitly typed as `any` + */ + allowArgumentsExplicitlyTypedAsAny?: boolean; + /** + * If true, body-less arrow functions that return an `as const` type assertion will not + * require an explicit return value annotation. + * You must still type the parameters of the function. + */ + allowDirectConstAssertionInArrowFunctions?: boolean; + /** + * An array of function/method names that will not have their arguments or their return values checked. + */ + allowedNames?: string[]; + /** + * If true, functions immediately returning another function expression will not + * require an explicit return value annotation. + * You must still type the parameters of the function. + */ + allowHigherOrderFunctions?: boolean; + /** + * If true, type annotations are also allowed on the variable of a function expression + * rather than on the function arguments/return value directly. + */ + allowTypedFunctionExpressions?: boolean; +}; + +const defaults = { + allowArgumentsExplicitlyTypedAsAny: false, + allowDirectConstAssertionInArrowFunctions: true, + allowedNames: [], + allowHigherOrderFunctions: true, + allowTypedFunctionExpressions: true, +}; +``` + +### Configuring in a mixed JS/TS codebase + +If you are working on a codebase within which you lint non-TypeScript code (i.e. `.js`/`.jsx`), you should ensure that you should use [ESLint `overrides`](https://eslint.org/docs/user-guide/configuring#disabling-rules-only-for-a-group-of-files) to only enable the rule on `.ts`/`.tsx` files. If you don't, then you will get unfixable lint errors reported within `.js`/`.jsx` files. + +```jsonc +{ + "rules": { + // disable the rule for all files + "@typescript-eslint/explicit-module-boundary-types": "off" + }, + "overrides": [ + { + // enable the rule specifically for TypeScript files + "files": ["*.ts", "*.tsx"], + "rules": { + "@typescript-eslint/explicit-module-boundary-types": ["error"] + } + } + ] +} +``` + +### `allowArgumentsExplicitlyTypedAsAny` + +Examples of **incorrect** code for this rule with `{ allowArgumentsExplicitlyTypedAsAny: true }`: + +```ts +export const func = (value: any): void => ({ type: 'X', value }); +export function foo(value: any): void {} +``` + +Examples of **correct** code for this rule with `{ allowArgumentsExplicitlyTypedAsAny: true }`: + +```ts +export const func = (value: number): void => ({ type: 'X', value }); +export function foo(value: number): void {} +``` + +### `allowDirectConstAssertionInArrowFunctions` + +Examples of **incorrect** code for this rule with `{ allowDirectConstAssertionInArrowFunctions: true }`: + +```ts +export const func = (value: number) => ({ type: 'X', value }); +export const foo = () => { + return { + bar: true, + } as const; +}; +export const bar = () => 1; +export const baz = arg => arg as const; +``` + +Examples of **correct** code for this rule with `{ allowDirectConstAssertionInArrowFunctions: true }`: + +```ts +export const func = (value: number) => ({ type: 'X', value } as const); +export const foo = () => + ({ + bar: true, + } as const); +export const bar = () => 1 as const; +export const baz = (arg: string) => arg as const; +``` + +### `allowedNames` + +You may pass function/method names you would like this rule to ignore, like so: + +```json +{ + "@typescript-eslint/explicit-module-boundary-types": [ + "error", + { + "allowedNames": ["ignoredFunctionName", "ignoredMethodName"] + } + ] +} +``` + +### `allowHigherOrderFunctions` + +Examples of **incorrect** code for this rule with `{ allowHigherOrderFunctions: true }`: + +```ts +export var arrowFn = () => () => {}; + +export function fn() { + return function () {}; +} + +export function foo(outer) { + return function (inner): void {}; +} +``` + +Examples of **correct** code for this rule with `{ allowHigherOrderFunctions: true }`: + +```ts +export var arrowFn = () => (): void => {}; + +export function fn() { + return function (): void {}; +} + +export function foo(outer: string) { + return function (inner: string): void {}; +} +``` + +### `allowTypedFunctionExpressions` + +Examples of **incorrect** code for this rule with `{ allowTypedFunctionExpressions: true }`: + +```ts +export let arrowFn = () => 'test'; + +export let funcExpr = function () { + return 'test'; +}; + +export let objectProp = { + foo: () => 1, +}; + +export const foo = bar => {}; +``` + +Examples of additional **correct** code for this rule with `{ allowTypedFunctionExpressions: true }`: + +```ts +type FuncType = () => string; + +export let arrowFn: FuncType = () => 'test'; + +export let funcExpr: FuncType = function () { + return 'test'; +}; + +export let asTyped = (() => '') as () => string; +export let castTyped = <() => string>(() => ''); + +interface ObjectType { + foo(): number; +} +export let objectProp: ObjectType = { + foo: () => 1, +}; +export let objectPropAs = { + foo: () => 1, +} as ObjectType; +export let objectPropCast = { + foo: () => 1, +}; + +type FooType = (bar: string) => void; +export const foo: FooType = bar => {}; +``` + +## When Not To Use It + +If you wish to make sure all functions have explicit return types, as opposed to only the module boundaries, you can use [explicit-function-return-type](./explicit-function-return-type.md) + +## Further Reading + +- TypeScript [Functions](https://www.typescriptlang.org/docs/handbook/functions.html#function-types) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/func-call-spacing.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/func-call-spacing.md new file mode 100644 index 000000000..8aa9e7e0c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/func-call-spacing.md @@ -0,0 +1,22 @@ +# Require or disallow spacing between function identifiers and their invocations (`func-call-spacing`) + +## Rule Details + +This rule extends the base [`eslint/func-call-spacing`](https://eslint.org/docs/rules/func-call-spacing) rule. +It adds support for generic type parameters on function calls. + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "func-call-spacing": "off", + "@typescript-eslint/func-call-spacing": ["error"] +} +``` + +## Options + +See [`eslint/func-call-spacing` options](https://eslint.org/docs/rules/func-call-spacing#options). + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/func-call-spacing.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/indent.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/indent.md new file mode 100644 index 000000000..023c77465 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/indent.md @@ -0,0 +1,24 @@ +# Enforce consistent indentation (`indent`) + +## PLEASE READ THIS ISSUE BEFORE USING THIS RULE [#1824](https://github.com/typescript-eslint/typescript-eslint/issues/1824) + +## Rule Details + +This rule extends the base [`eslint/indent`](https://eslint.org/docs/rules/indent) rule. +It adds support for TypeScript nodes. + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "indent": "off", + "@typescript-eslint/indent": ["error"] +} +``` + +## Options + +See [`eslint/indent` options](https://eslint.org/docs/rules/indent#options). + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/indent.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/init-declarations.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/init-declarations.md new file mode 100644 index 000000000..8888e2efe --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/init-declarations.md @@ -0,0 +1,22 @@ +# require or disallow initialization in variable declarations (`init-declarations`) + +## Rule Details + +This rule extends the base [`eslint/init-declarations`](https://eslint.org/docs/rules/init-declarations) rule. +It adds support for TypeScript's `declare` variables. + +## How to use + +```cjson +{ + // note you must disable the base rule as it can report incorrect errors + "init-declarations": "off", + "@typescript-eslint/init-declarations": ["error"] +} +``` + +## Options + +See [`eslint/init-declarations` options](https://eslint.org/docs/rules/init-declarations#options). + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/init-declarations.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/keyword-spacing.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/keyword-spacing.md new file mode 100644 index 000000000..ca2926d6c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/keyword-spacing.md @@ -0,0 +1,22 @@ +# Enforce consistent spacing before and after keywords (`keyword-spacing`) + +## Rule Details + +This rule extends the base [`eslint/keyword-spacing`](https://eslint.org/docs/rules/keyword-spacing) rule. +This version adds support for generic type parameters on function calls. + +## How to use + +```cjson +{ + // note you must disable the base rule as it can report incorrect errors + "keyword-spacing": "off", + "@typescript-eslint/keyword-spacing": ["error"] +} +``` + +## Options + +See [`eslint/keyword-spacing` options](https://eslint.org/docs/rules/keyword-spacing#options). + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/keyword-spacing.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-between-class-members.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-between-class-members.md new file mode 100644 index 000000000..06cdf5542 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-between-class-members.md @@ -0,0 +1,73 @@ +# Require or disallow an empty line between class members (`lines-between-class-members`) + +This rule improves readability by enforcing lines between class members. It will not check empty lines before the first member and after the last member. This rule require or disallow an empty line between class members. + +## Rule Details + +This rule extends the base [`eslint/lines-between-class-members`](https://eslint.org/docs/rules/lines-between-class-members) rule. +It adds support for ignoring overload methods in a class. + +See the [ESLint documentation](https://eslint.org/docs/rules/lines-between-class-members) for more details on the `lines-between-class-members` rule. + +## Rule Changes + +```cjson +{ + // note you must disable the base rule as it can report incorrect errors + "lines-between-class-members": "off", + "@typescript-eslint/lines-between-class-members": ["error"] +} +``` + +In addition to the options supported by the `lines-between-class-members` rule in ESLint core, the rule adds the following options: + +## Options + +This rule has a string option and an object option. + +- Object option: + + - `"exceptAfterOverload": true` (default) - Skip checking empty lines after overload class members + - `"exceptAfterOverload": false` - **do not** skip checking empty lines after overload class members + +- [See the other options allowed](https://github.com/eslint/eslint/blob/master/docs/rules/lines-between-class-members.md#options) + +### `exceptAfterOverload: true` + +Examples of **correct** code for the `{ "exceptAfterOverload": true }` option: + +```ts +/*eslint @typescript-eslint/lines-between-class-members: ["error", "always", { "exceptAfterOverload": true }]*/ + +class foo { + bar(a: string): void; + bar(a: string, b: string): void; + bar(a: string, b: string) {} + + baz() {} + + qux() {} +} +``` + +### `exceptAfterOverload: false` + +Examples of **correct** code for the `{ "exceptAfterOverload": false }` option: + +```ts +/*eslint @typescript-eslint/lines-between-class-members: ["error", "always", { "exceptAfterOverload": false }]*/ + +class foo { + bar(a: string): void; + + bar(a: string, b: string): void; + + bar(a: string, b: string) {} + + baz() {} + + qux() {} +} +``` + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/lines-between-class-members.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-delimiter-style.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-delimiter-style.md new file mode 100644 index 000000000..ed1b09577 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-delimiter-style.md @@ -0,0 +1,194 @@ +# Require a specific member delimiter style for interfaces and type literals (`member-delimiter-style`) + +Enforces a consistent member delimiter style in interfaces and type literals. There are three member delimiter styles primarily used in TypeScript: + +- Semicolon style (default, preferred in TypeScript). + + +```ts +interface Foo { + name: string; + greet(): void; +} + +type Bar = { + name: string; + greet(): void; +} +``` + +- Comma style (JSON style). + + +```ts +interface Foo { + name: string, + greet(): void, +} + +type Bar = { + name: string, + greet(): void, +} +``` + +- Line break (none) style. + + +```ts +interface Foo { + name: string + greet(): void +} + +type Bar = { + name: string + greet(): void +} +``` + +The rule also enforces the presence (or absence) of the delimiter in the last member of the interface and/or type literal. +Finally, this rule can enforce separate delimiter syntax for single line declarations. + +## Rule Details + +This rule aims to standardize the way interface and type literal members are delimited. + +## Options + +```ts +interface BaseConfig { + multiline?: { + delimiter?: 'none' | 'semi' | 'comma'; + requireLast?: boolean; + }; + singleline?: { + delimiter?: 'semi' | 'comma'; + requireLast?: boolean; + }; +} +type Config = BaseConfig & { + overrides?: { + interface?: BaseConfig; + typeLiteral?: BaseConfig; + }; +}; +``` + +Default config: + +```JSON +{ + "multiline": { + "delimiter": "semi", + "requireLast": true + }, + "singleline": { + "delimiter": "semi", + "requireLast": false + } +} +``` + +`multiline` config only applies to multiline `interface`/`type` definitions. +`singleline` config only applies to single line `interface`/`type` definitions. +The two configs are entirely separate, and do not effect one another. + +### `delimiter` + +Accepts three values (or two for `singleline`): + +- `comma` - each member should be delimited with a comma (`,`). +- `semi` - each member should be delimited with a semicolon (`;`). +- `none` - each member should be delimited with nothing. + - NOTE - this is not an option for `singleline` because having no delimiter between members on a single line is a syntax error in TS. + +### `requireLast` + +Determines whether or not the last member in the `interface`/`type` should have a delimiter: + +- `true` - the last member **_must_** have a delimiter. +- `false` - the last member **_must not_** have a delimiter. + +### `overrides` + +Allows you to specify options specifically for either `interface`s or `type` definitions / inline `type`s. + +For example, to require commas for `type`s, and semicolons for multiline `interface`s: + +```JSON +{ + "multiline": { + "delimiter": "comma", + "requireLast": true + }, + "singleline": { + "delimiter": "comma", + "requireLast": true + }, + "overrides": { + "interface": { + "multiline": { + "delimiter": "semi", + "requireLast": true + } + } + } +} +``` + +## Examples + +Examples of **incorrect** code for this rule with the default config: + + +```ts +// missing semicolon delimiter +interface Foo { + name: string + greet(): string +} + +// using incorrect delimiter +interface Bar { + name: string, + greet(): string, +} + +// missing last member delimiter +interface Baz { + name: string; + greet(): string +} + +// incorrect delimiter +type FooBar = { name: string, greet(): string } + +// last member should not have delimiter +type FooBar = { name: string; greet(): string; } +``` + +Examples of **correct** code for this rule with the default config: + + +```ts +interface Foo { + name: string; + greet(): string; +} + +interface Foo { name: string } + +type Bar = { + name: string; + greet(): string; +} + +type Bar = { name: string } + +type FooBar = { name: string; greet(): string } +``` + +## When Not To Use It + +If you don't care about enforcing a consistent member delimiter in interfaces and type literals, then you will not need this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-ordering.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-ordering.md new file mode 100644 index 000000000..eda1c573c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-ordering.md @@ -0,0 +1,867 @@ +# Require a consistent member declaration order (`member-ordering`) + +A consistent ordering of fields, methods and constructors can make interfaces, type literals, classes and class expressions easier to read, navigate and edit. + +## Rule Details + +This rule aims to standardize the way class declarations, class expressions, interfaces and type literals are structured and ordered. + +### Grouping and sorting member groups + +It allows to group members by their type (e.g. `public-static-field`, `protected-static-field`, `private-static-field`, `public-instance-field`, ...) and enforce a certain order for these groups. By default, their order is the same inside `classes`, `classExpressions`, `interfaces` and `typeLiterals` (note: not all member types apply to `interfaces` and `typeLiterals`). It is possible to define the order for any of those individually or to change the default order for all of them by setting the `default` option. + +### Sorting members + +Besides grouping the members and sorting their groups, this rule also allows to sort the members themselves (e.g. `a`, `b`, `c`, ...). You have 2 options: Sort all of them while ignoring their type or sort them while respecting their types (e.g. sort all fields in an interface alphabetically). + +## Options + +These options allow to specify how to group the members and sort their groups. + +- Sort groups, don't enforce member order: Use `memberTypes` +- Sort members, don't enforce group order: Use `order` +- Sort members within groups: Use `memberTypes` and `order` + +```ts +type TypeOptions = + | { + memberTypes: Array | 'never', + order?: 'alphabetically' | 'as-written', + } + | { + order: 'alphabetically', + }; + +{ + default?: TypeOptions, + + classes?: TypeOptions, + classExpressions?: TypeOptions, + + interfaces?: TypeOptions<'signature' | 'field' | 'method' | 'constructor'>, + typeLiterals?: TypeOptions<'signature' | 'field' | 'method' | 'constructor'>, +} +``` + +See below for the possible definitions of `MemberType`. + +### Deprecated syntax + +Note: There is a deprecated syntax to specify the member types as an array. + +### Member types (granular form) + +There are multiple ways to specify the member types. The most explicit and granular form is the following: + +```jsonc +[ + // Index signature + "signature", + + // Fields + "public-static-field", + "protected-static-field", + "private-static-field", + "public-decorated-field", + "protected-decorated-field", + "private-decorated-field", + "public-instance-field", + "protected-instance-field", + "private-instance-field", + "public-abstract-field", + "protected-abstract-field", + "private-abstract-field", + + // Constructors + "public-constructor", + "protected-constructor", + "private-constructor", + + // Methods + "public-static-method", + "protected-static-method", + "private-static-method", + "public-decorated-method", + "protected-decorated-method", + "private-decorated-method", + "public-instance-method", + "protected-instance-method", + "private-instance-method", + "public-abstract-method", + "protected-abstract-method", + "private-abstract-method" +] +``` + +Note: If you only specify some of the possible types, the non-specified ones can have any particular order. This means that they can be placed before, within or after the specified types and the linter won't complain about it. + +### Member group types (with accessibility, ignoring scope) + +It is also possible to group member types by their accessibility (`static`, `instance`, `abstract`), ignoring their scope. + +```jsonc +[ + // Index signature + // No accessibility for index signature. See above. + + // Fields + "public-field", // = ["public-static-field", "public-instance-field"] + "protected-field", // = ["protected-static-field", "protected-instance-field"] + "private-field", // = ["private-static-field", "private-instance-field"] + + // Constructors + // Only the accessibility of constructors is configurable. See below. + + // Methods + "public-method", // = ["public-static-method", "public-instance-method"] + "protected-method", // = ["protected-static-method", "protected-instance-method"] + "private-method" // = ["private-static-method", "private-instance-method"] +] +``` + +### Member group types (with accessibility and a decorator) + +It is also possible to group methods or fields with a decorator separately, optionally specifying +their accessibility. + +```jsonc +[ + // Index signature + // No decorators for index signature. + + // Fields + "public-decorated-field", + "protected-decorated-field", + "private-decorated-field", + + "decorated-field", // = ["public-decorated-field", "protected-decorated-field", "private-decorated-field"] + + // Constructors + // There are no decorators for constructors. + + "public-decorated-method", + "protected-decorated-method", + "private-decorated-method", + + "decorated-method" // = ["public-decorated-method", "protected-decorated-method", "private-decorated-method"] +] +``` + +### Member group types (with scope, ignoring accessibility) + +Another option is to group the member types by their scope (`public`, `protected`, `private`), ignoring their accessibility. + +```jsonc +[ + // Index signature + // No scope for index signature. See above. + + // Fields + "static-field", // = ["public-static-field", "protected-static-field", "private-static-field"] + "instance-field", // = ["public-instance-field", "protected-instance-field", "private-instance-field"] + "abstract-field", // = ["public-abstract-field", "protected-abstract-field", "private-abstract-field"] + + // Constructors + "constructor", // = ["public-constructor", "protected-constructor", "private-constructor"] + + // Methods + "static-method", // = ["public-static-method", "protected-static-method", "private-static-method"] + "instance-method", // = ["public-instance-method", "protected-instance-method", "private-instance-method"] + "abstract-method" // = ["public-abstract-method", "protected-abstract-method", "private-abstract-method"] +] +``` + +### Member group types (with scope and accessibility) + +The third grouping option is to ignore both scope and accessibility. + +```jsonc +[ + // Index signature + // No grouping for index signature. See above. + + // Fields + "field", // = ["public-static-field", "protected-static-field", "private-static-field", "public-instance-field", "protected-instance-field", "private-instance-field", + // "public-abstract-field", "protected-abstract-field", private-abstract-field"] + + // Constructors + // Only the accessibility of constructors is configurable. See above. + + // Methods + "method" // = ["public-static-method", "protected-static-method", "private-static-method", "public-instance-method", "protected-instance-method", "private-instance-method", + // "public-abstract-method", "protected-abstract-method", "private-abstract-method"] +] +``` + +### Default configuration + +The default configuration looks as follows: + +```jsonc +{ + "default": [ + // Index signature + "signature", + + // Fields + "public-static-field", + "protected-static-field", + "private-static-field", + + "public-decorated-field", + "protected-decorated-field", + "private-decorated-field", + + "public-instance-field", + "protected-instance-field", + "private-instance-field", + + "public-abstract-field", + "protected-abstract-field", + "private-abstract-field", + + "public-field", + "protected-field", + "private-field", + + "static-field", + "instance-field", + "abstract-field", + + "decorated-field", + + "field", + + // Constructors + "public-constructor", + "protected-constructor", + "private-constructor", + + "constructor", + + // Methods + "public-static-method", + "protected-static-method", + "private-static-method", + + "public-decorated-method", + "protected-decorated-method", + "private-decorated-method", + + "public-instance-method", + "protected-instance-method", + "private-instance-method", + + "public-abstract-method", + "protected-abstract-method", + "private-abstract-method", + + "public-method", + "protected-method", + "private-method", + + "static-method", + "instance-method", + "abstract-method", + + "decorated-method", + + "method" + ] +} +``` + +Note: The default configuration contains member group types which contain other member types (see above). This is intentional to provide better error messages. + +Note: By default, the members are not sorted. If you want to sort them alphabetically, you have to provide a custom configuration. + +## Examples + +### Custom `default` configuration + +Note: The `default` options are overwritten in these examples. + +#### Configuration: `{ "default": ["signature", "method", "constructor", "field"] }` + +##### Incorrect examples + +```ts +interface Foo { + B: string; // -> field + + new (); // -> constructor + + A(): void; // -> method + + [Z: string]: any; // -> signature +} +``` + +Note: Wrong order. + +```ts +type Foo = { + B: string; // -> field + + // no constructor + + A(): void; // -> method + + // no signature +}; +``` + +Note: Not all specified member types have to exist. + +```ts +class Foo { + private C: string; // -> field + public D: string; // -> field + protected static E: string; // -> field + + constructor() {} // -> constructor + + public static A(): void {} // -> method + public B(): void {} // -> method + + [Z: string]: any; // -> signature +} +``` + +Note: Accessibility or scope are ignored with this configuration. + +```ts +const Foo = class { + private C: string; // -> field + public D: string; // -> field + + constructor() {} // -> constructor + + public static A(): void {} // -> method + public B(): void {} // -> method + + [Z: string]: any; // -> signature + + protected static E: string; // -> field +}; +``` + +Note: Not all members have to be grouped to find rule violations. + +##### Correct examples + +```ts +interface Foo { + [Z: string]: any; // -> signature + + A(): void; // -> method + + new (); // -> constructor + + B: string; // -> field +} +``` + +```ts +type Foo = { + // no signature + + A(): void; // -> method + + // no constructor + + B: string; // -> field +}; +``` + +```ts +class Foo { + [Z: string]: any; // -> signature + + public static A(): void {} // -> method + public B(): void {} // -> method + + constructor() {} // -> constructor + + private C: string; // -> field + public D: string; // -> field + protected static E: string; // -> field +} +``` + +```ts +const Foo = class { + [Z: string]: any; // -> signature + + public static A(): void {} // -> method + public B(): void {} // -> method + + constructor() {} // -> constructor + + private C: string; // -> field + public D: string; // -> field + protected static E: string; // -> field +}; +``` + +#### Configuration: `{ "default": ["public-instance-method", "public-static-field"] }` + +Note: This configuration does not apply to interfaces/type literals as accessibility and scope are not part of interfaces/type literals. + +##### Incorrect examples + +```ts +class Foo { + private C: string; // (irrelevant) + + public D: string; // (irrelevant) + + public static E: string; // -> public static field + + constructor() {} // (irrelevant) + + public static A(): void {} // (irrelevant) + + [Z: string]: any; // (irrelevant) + + public B(): void {} // -> public instance method +} +``` + +Note: Public instance methods should come first before public static fields. Everything else can be placed anywhere. + +```ts +const Foo = class { + private C: string; // (irrelevant) + + [Z: string]: any; // (irrelevant) + + public static E: string; // -> public static field + + public D: string; // (irrelevant) + + constructor() {} // (irrelevant) + + public static A(): void {} // (irrelevant) + + public B(): void {} // -> public instance method +}; +``` + +Note: Public instance methods should come first before public static fields. Everything else can be placed anywhere. + +##### Correct examples + +```ts +class Foo { + public B(): void {} // -> public instance method + + private C: string; // (irrelevant) + + public D: string; // (irrelevant) + + public static E: string; // -> public static field + + constructor() {} // (irrelevant) + + public static A(): void {} // (irrelevant) + + [Z: string]: any; // (irrelevant) +} +``` + +```ts +const Foo = class { + public B(): void {} // -> public instance method + + private C: string; // (irrelevant) + + [Z: string]: any; // (irrelevant) + + public D: string; // (irrelevant) + + constructor() {} // (irrelevant) + + public static A(): void {} // (irrelevant) + + public static E: string; // -> public static field +}; +``` + +#### Configuration: `{ "default": ["public-static-field", "static-field", "instance-field"] }` + +Note: This configuration does not apply to interfaces/type literals as accessibility and scope are not part of interfaces/type literals. + +##### Incorrect examples + +```ts +class Foo { + private E: string; // -> instance field + + private static B: string; // -> static field + protected static C: string; // -> static field + private static D: string; // -> static field + + public static A: string; // -> public static field + + [Z: string]: any; // (irrelevant) +} +``` + +Note: Public static fields should come first, followed by static fields and instance fields. + +```ts +const foo = class { + public T(): void {} // (irrelevant) + + private static B: string; // -> static field + + constructor() {} // (irrelevant) + + private E: string; // -> instance field + + protected static C: string; // -> static field + private static D: string; // -> static field + + [Z: string]: any; // (irrelevant) + + public static A: string; // -> public static field +}; +``` + +Note: Public static fields should come first, followed by static fields and instance fields. + +##### Correct examples + +```ts +class Foo { + public static A: string; // -> public static field + + private static B: string; // -> static field + protected static C: string; // -> static field + private static D: string; // -> static field + + private E: string; // -> instance field +} +``` + +```ts +const foo = class { + [Z: string]: any; // -> signature + + public static A: string; // -> public static field + + constructor() {} // -> constructor + + private static B: string; // -> static field + protected static C: string; // -> static field + private static D: string; // -> static field + + private E: string; // -> instance field + + public T(): void {} // -> method +}; +``` + +### Custom `classes` configuration + +Note: If this is not set, the `default` will automatically be applied to classes as well. If a `classes` configuration is provided, only this configuration will be used for `classes` (i.e. nothing will be merged with `default`). + +Note: The configuration for `classes` does not apply to class expressions (use `classExpressions` for them). + +#### Configuration: `{ "classes": ["method", "constructor", "field"] }` + +##### Incorrect example + +```ts +class Foo { + private C: string; // -> field + public D: string; // -> field + protected static E: string; // -> field + + constructor() {} // -> constructor + + public static A(): void {} // -> method + public B(): void {} // -> method +} +``` + +##### Correct example + +```ts +class Foo { + public static A(): void {} // -> method + public B(): void {} // -> method + + constructor() {} // -> constructor + + private C: string; // -> field + public D: string; // -> field + protected static E: string; // -> field +} +``` + +#### Configuration: `{ "classes": ["public-instance-method", "public-static-field"] }` + +##### Incorrect example + +```ts +class Foo { + private C: string; // (irrelevant) + + public D: string; // (irrelevant) + + public static E: string; // -> public static field + + constructor() {} // (irrelevant) + + public static A(): void {} // (irrelevant) + + public B(): void {} // -> public instance method +} +``` + +##### Correct example + +```ts +class Foo { + private C: string; // (irrelevant) + + public D: string; // (irrelevant) + + public B(): void {} // -> public instance method + + constructor() {} // (irrelevant) + + public static A(): void {} // (irrelevant) + + public static E: string; // -> public static field +} +``` + +### Custom `classExpressions` configuration + +Note: If this is not set, the `default` will automatically be applied to classes expressions as well. If a `classExpressions` configuration is provided, only this configuration will be used for `classExpressions` (i.e. nothing will be merged with `default`). + +Note: The configuration for `classExpressions` does not apply to classes (use `classes` for them). + +#### Configuration: `{ "classExpressions": ["method", "constructor", "field"] }` + +##### Incorrect example + +```ts +const foo = class { + private C: string; // -> field + public D: string; // -> field + protected static E: string; // -> field + + constructor() {} // -> constructor + + public static A(): void {} // -> method + public B(): void {} // -> method +}; +``` + +##### Correct example + +```ts +const foo = class { + public static A(): void {} // -> method + public B(): void {} // -> method + + constructor() {} // -> constructor + + private C: string; // -> field + public D: string; // -> field + protected static E: string; // -> field +}; +``` + +#### Configuration: `{ "classExpressions": ["public-instance-method", "public-static-field"] }` + +##### Incorrect example + +```ts +const foo = class { + private C: string; // (irrelevant) + + public D: string; // (irrelevant) + + public static E: string; // -> public static field + + constructor() {} // (irrelevant) + + public static A(): void {} // (irrelevant) + + public B(): void {} // -> public instance method +}; +``` + +##### Correct example + +```ts +const foo = class { + private C: string; // (irrelevant) + + public D: string; // (irrelevant) + + public B(): void {} // -> public instance method + + public static E: string; // -> public static field + + constructor() {} // (irrelevant) + + public static A(): void {} // (irrelevant) +}; +``` + +### Custom `interfaces` configuration + +Note: If this is not set, the `default` will automatically be applied to classes expressions as well. If a `interfaces` configuration is provided, only this configuration will be used for `interfaces` (i.e. nothing will be merged with `default`). + +Note: The configuration for `interfaces` only allows a limited set of member types: `signature`, `field`, `constructor` and `method`. + +Note: The configuration for `interfaces` does not apply to type literals (use `typeLiterals` for them). + +#### Configuration: `{ "interfaces": ["signature", "method", "constructor", "field"] }` + +##### Incorrect example + +```ts +interface Foo { + B: string; // -> field + + new (); // -> constructor + + A(): void; // -> method + + [Z: string]: any; // -> signature +} +``` + +##### Correct example + +```ts +interface Foo { + [Z: string]: any; // -> signature + + A(): void; // -> method + + new (); // -> constructor + + B: string; // -> field +} +``` + +### Custom `typeLiterals` configuration + +Note: If this is not set, the `default` will automatically be applied to classes expressions as well. If a `typeLiterals` configuration is provided, only this configuration will be used for `typeLiterals` (i.e. nothing will be merged with `default`). + +Note: The configuration for `typeLiterals` only allows a limited set of member types: `signature`, `field`, `constructor` and `method`. + +Note: The configuration for `typeLiterals` does not apply to interfaces (use `interfaces` for them). + +#### Configuration: `{ "typeLiterals": ["signature", "method", "constructor", "field"] }` + +##### Incorrect example + +```ts +type Foo = { + B: string; // -> field + + A(): void; // -> method + + new (); // -> constructor + + [Z: string]: any; // -> signature +}; +``` + +##### Correct example + +```ts +type Foo = { + [Z: string]: any; // -> signature + + A(): void; // -> method + + new (); // -> constructor + + B: string; // -> field +}; +``` + +### Sorting alphabetically within member groups + +It is possible to sort all members within a group alphabetically. + +#### Configuration: `{ "default": { "memberTypes": , "order": "alphabetically" } }` + +This will apply the default order (see above) and enforce an alphabetic order within each group. + +##### Incorrect examples + +```ts +interface Foo { + a: x; + b: x; + c: x; + + new (): Bar; + (): Baz; + + a(): void; + b(): void; + c(): void; + + // Wrong group order, should be placed before all field definitions + [a: string]: number; +} +``` + +```ts +interface Foo { + [a: string]: number; + + a: x; + b: x; + c: x; + + new (): Bar; + (): Baz; + + // Wrong alphabetic order within group + c(): void; + b(): void; + a(): void; +} +``` + +### Sorting alphabetically while ignoring member groups + +It is also possible to sort all members and ignore the member groups completely. + +#### Configuration: `{ "default": { "memberTypes": "never", "order": "alphabetically" } }` + +##### Incorrect example + +```ts +interface Foo { + b(): void; + a: b; + + [a: string]: number; // Order doesn't matter (no sortable identifier) + new (): Bar; // Order doesn't matter (no sortable identifier) + (): Baz; // Order doesn't matter (no sortable identifier) +} +``` + +Note: Wrong alphabetic order `b(): void` should come after `a: b`. + +## When Not To Use It + +If you don't care about the general structure of your classes and interfaces, then you will not need this rule. + +## Compatibility + +- TSLint: [member-ordering](https://palantir.github.io/tslint/rules/member-ordering/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/method-signature-style.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/method-signature-style.md new file mode 100644 index 000000000..4358ee36c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/method-signature-style.md @@ -0,0 +1,94 @@ +# Enforces using a particular method signature syntax. (`method-signature-style`) + +There are two ways to define an object/interface function property. + +```ts +// method shorthand syntax +interface T1 { + func(arg: string): number; +} + +// regular property with function type +interface T2 { + func: (arg: string) => number; +} +``` + +A good practice is to use the TypeScript's `strict` option (which implies `strictFunctionTypes`) which enables correct typechecking for function properties only (method signatures get old behavior). + +TypeScript FAQ: + +> A method and a function property of the same type behave differently. +> Methods are always bivariant in their argument, while function properties are contravariant in their argument under `strictFunctionTypes`. + +See the reasoning behind that in the [TypeScript PR for the compiler option](https://github.com/microsoft/TypeScript/pull/18654). + +## Options + +This rule accepts one string option: + +- `"property"`: Enforce using property signature for functions. Use this to enforce maximum correctness together with TypeScript's strict mode. +- `"method"`: Enforce using method signature for functions. Use this if you aren't using TypeScript's strict mode and prefer this style. + +The default is `"property"`. + +## Rule Details + +Examples of **incorrect** code with `property` option. + +```ts +interface T1 { + func(arg: string): number; +} +type T2 = { + func(arg: boolean): void; +}; +interface T3 { + func(arg: number): void; + func(arg: string): void; + func(arg: boolean): void; +} +``` + +Examples of **correct** code with `property` option. + +```ts +interface T1 { + func: (arg: string) => number; +} +type T2 = { + func: (arg: boolean) => void; +}; +// this is equivalent to the overload +interface T3 { + func: ((arg: number) => void) & + ((arg: string) => void) & + ((arg: boolean) => void); +} +``` + +Examples of **incorrect** code with `method` option. + +```ts +interface T1 { + func: (arg: string) => number; +} +type T2 = { + func: (arg: boolean) => void; +}; +``` + +Examples of **correct** code with `method` option. + +```ts +interface T1 { + func(arg: string): number; +} +type T2 = { + func(arg: boolean): void; +}; +``` + +## When Not To Use It + +If you don't want to enforce a particular style for object/interface function types, and/or if you don't use `strictFunctionTypes`, then you don't need this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/naming-convention.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/naming-convention.md new file mode 100644 index 000000000..d57bc1c69 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/naming-convention.md @@ -0,0 +1,465 @@ +# Enforces naming conventions for everything across a codebase (`naming-convention`) + +Enforcing naming conventions helps keep the codebase consistent, and reduces overhead when thinking about how to name a variable. +Additionally, a well-designed style guide can help communicate intent, such as by enforcing all private properties begin with an `_`, and all global-level constants are written in `UPPER_CASE`. + +There are many different rules that have existed over time, but they have had the problem of not having enough granularity, meaning it was hard to have a well defined style guide, and most of the time you needed 3 or more rules at once to enforce different conventions, hoping they didn't conflict. + +## Rule Details + +This rule allows you to enforce conventions for any identifier, using granular selectors to create a fine-grained style guide. + +### Note - this rule only needs type information in specific cases, detailed below + +## Options + +This rule accepts an array of objects, with each object describing a different naming convention. +Each property will be described in detail below. Also see the examples section below for illustrated examples. + +```ts +type Options = { + // format options + format: + | ( + | 'camelCase' + | 'strictCamelCase' + | 'PascalCase' + | 'StrictPascalCase' + | 'snake_case' + | 'UPPER_CASE' + )[] + | null; + custom?: { + regex: string; + match: boolean; + }; + leadingUnderscore?: 'forbid' | 'allow' | 'require'; + trailingUnderscore?: 'forbid' | 'allow' | 'require'; + prefix?: string[]; + suffix?: string[]; + + // selector options + selector: Selector | Selector[]; + filter?: + | string + | { + regex: string; + match: boolean; + }; + // the allowed values for these are dependent on the selector - see below + modifiers?: Modifiers[]; + types?: Types[]; +}[]; + +// the default config is similar to ESLint's camelcase rule but more strict +const defaultOptions: Options = [ + { + selector: 'default', + format: ['camelCase'], + leadingUnderscore: 'allow', + trailingUnderscore: 'allow', + }, + + { + selector: 'variable', + format: ['camelCase', 'UPPER_CASE'], + leadingUnderscore: 'allow', + trailingUnderscore: 'allow', + }, + + { + selector: 'typeLike', + format: ['PascalCase'], + }, +]; +``` + +### Format Options + +Every single selector can have the same set of format options. +When the format of an identifier is checked, it is checked in the following order: + +1. validate leading underscore +1. validate trailing underscore +1. validate prefix +1. validate suffix +1. validate custom +1. validate format + +For steps 1-4, if the identifier matches the option, the matching part will be removed. +For example, if you provide the following formatting option: `{ leadingUnderscore: 'allow', prefix: ['I'], format: ['StrictPascalCase'] }`, for the identifier `_IMyInterface`, then the following checks will occur: + +1. `name = _IMyInterface` +1. validate leading underscore - pass + - Trim leading underscore - `name = IMyInterface` +1. validate trailing underscore - no check +1. validate prefix - pass + - Trim prefix - `name = MyInterface` +1. validate suffix - no check +1. validate custom - no check +1. validate format - pass + +One final note is that if the name were to become empty via this trimming process, it is considered to match all `format`s. An example of where this might be useful is for generic type parameters, where you want all names to be prefixed with `T`, but also want to allow for the single character `T` name. + +#### `format` + +The `format` option defines the allowed formats for the identifier. This option accepts an array of the following values, and the identifier can match any of them: + +- `camelCase` - standard camelCase format - no underscores are allowed between characters, and consecutive capitals are allowed (i.e. both `myID` and `myId` are valid). +- `strictCamelCase` - same as `camelCase`, but consecutive capitals are not allowed (i.e. `myId` is valid, but `myID` is not). +- `PascalCase` - same as `camelCase`, except the first character must be upper-case. +- `StrictPascalCase` - same as `strictCamelCase`, except the first character must be upper-case. +- `snake_case` - standard snake_case format - all characters must be lower-case, and underscores are allowed. +- `UPPER_CASE` - same as `snake_case`, except all characters must be upper-case. + +Instead of an array, you may also pass `null`. This signifies "this selector shall not have its format checked". +This can be useful if you want to enforce no particular format for a specific selector, after applying a group selector. + +### `custom` + +The `custom` option defines a custom regex that the identifier must (or must not) match. This option allows you to have a bit more finer-grained control over identifiers, letting you ban (or force) certain patterns and substrings. +Accepts an object with the following properties: + +- `regex` - accepts a regular expression (anything accepted into `new RegExp(regex)`). +- `match` - true if the identifier _must_ match the `regex`, false if the identifier _must not_ match the `regex`. + +### `filter` + +The `filter` option operates similar to `custom`, accepting the same shaped object, except that it controls if the rest of the configuration should or should not be applied to an identifier. + +You can use this to include or exclude specific identifiers from specific configurations. + +Accepts an object with the following properties: + +- `regex` - accepts a regular expression (anything accepted into `new RegExp(regex)`). +- `match` - true if the identifier _must_ match the `regex`, false if the identifier _must not_ match the `regex`. + +Alternatively, `filter` accepts a regular expression (anything accepted into `new RegExp(filter)`). In this case, it's treated as if you had passed an object with the regex and `match: true`. + +#### `leadingUnderscore` / `trailingUnderscore` + +The `leadingUnderscore` / `trailingUnderscore` options control whether leading/trailing underscores are considered valid. Accepts one of the following values: + +- `forbid` - a leading/trailing underscore is not allowed at all. +- `allow` - existence of a leading/trailing underscore is not explicitly enforced. +- `require` - a leading/trailing underscore must be included. + +#### `prefix` / `suffix` + +The `prefix` / `suffix` options control which prefix/suffix strings must exist for the identifier. Accepts an array of strings. + +If these are provided, the identifier must start with one of the provided values. For example, if you provide `{ prefix: ['IFace', 'Class', 'Type'] }`, then the following names are valid: `IFaceFoo`, `ClassBar`, `TypeBaz`, but the name `Bang` is not valid, as it contains none of the prefixes. + +**Note:** As [documented above](#format-options), the prefix is trimmed before format is validated, therefore PascalCase must be used to allow variables such as `isEnabled` using the prefix `is`. + +### Selector Options + +- `selector` (see "Allowed Selectors, Modifiers and Types" below). + - Accepts one or array of selectors to define an option block that applies to one or multiple selectors. + - For example, if you provide `{ selector: ['variable', 'function'] }`, then it will apply the same option to variable and function nodes. +- `modifiers` allows you to specify which modifiers to granularly apply to, such as the accessibility (`private`/`public`/`protected`), or if the thing is `static`, etc. + - The name must match _all_ of the modifiers. + - For example, if you provide `{ modifiers: ['private', 'static', 'readonly'] }`, then it will only match something that is `private static readonly`, and something that is just `private` will not match. +- `types` allows you to specify which types to match. This option supports simple, primitive types only (`boolean`, `string`, `number`, `array`, `function`). + - The name must match _one_ of the types. + - **_NOTE - Using this option will require that you lint with type information._** + - For example, this lets you do things like enforce that `boolean` variables are prefixed with a verb. + - `boolean` matches any type assignable to `boolean | null | undefined` + - `string` matches any type assignable to `string | null | undefined` + - `number` matches any type assignable to `number | null | undefined` + - `array` matches any type assignable to `Array | null | undefined` + - `function` matches any type assignable to `Function | null | undefined` + +The ordering of selectors does not matter. The implementation will automatically sort the selectors to ensure they match from most-specific to least specific. It will keep checking selectors in that order until it finds one that matches the name. + +For example, if you provide the following config: + +```ts +[ + /* 1 */ { selector: 'default', format: ['camelCase'] }, + /* 2 */ { selector: 'variable', format: ['snake_case'] }, + /* 3 */ { selector: 'variable', types: ['boolean'], format: ['UPPER_CASE'] }, + /* 4 */ { selector: 'variableLike', format: ['PascalCase'] }, +]; +``` + +Then for the code `const x = 1`, the rule will validate the selectors in the following order: `3`, `2`, `4`, `1`. + +#### Allowed Selectors, Modifiers and Types + +There are two types of selectors, individual selectors, and grouped selectors. + +##### Individual Selectors + +Individual Selectors match specific, well-defined sets. There is no overlap between each of the individual selectors. + +- `variable` - matches any `var` / `let` / `const` variable name. + - Allowed `modifiers`: `const`. + - Allowed `types`: `boolean`, `string`, `number`, `function`, `array`. +- `function` - matches any named function declaration or named function expression. + - Allowed `modifiers`: none. + - Allowed `types`: none. +- `parameter` - matches any function parameter. Does not match parameter properties. + - Allowed `modifiers`: none. + - Allowed `types`: `boolean`, `string`, `number`, `function`, `array`. +- `property` - matches any object, class, or object type property. Does not match properties that have direct function expression or arrow function expression values. + - Allowed `modifiers`: `private`, `protected`, `public`, `static`, `readonly`, `abstract`. + - Allowed `types`: `boolean`, `string`, `number`, `function`, `array`. +- `parameterProperty` - matches any parameter property. + - Allowed `modifiers`: `private`, `protected`, `public`, `readonly`. + - Allowed `types`: `boolean`, `string`, `number`, `function`, `array`. +- `method` - matches any object, class, or object type method. Also matches properties that have direct function expression or arrow function expression values. Does not match accessors. + - Allowed `modifiers`: `private`, `protected`, `public`, `static`, `readonly`, `abstract`. + - Allowed `types`: none. +- `accessor` - matches any accessor. + - Allowed `modifiers`: `private`, `protected`, `public`, `static`, `readonly`, `abstract`. + - Allowed `types`: `boolean`, `string`, `number`, `function`, `array`. +- `enumMember` - matches any enum member. + - Allowed `modifiers`: none. + - Allowed `types`: none. +- `class` - matches any class declaration. + - Allowed `modifiers`: `abstract`. + - Allowed `types`: none. +- `interface` - matches any interface declaration. + - Allowed `modifiers`: none. + - Allowed `types`: none. +- `typeAlias` - matches any type alias declaration. + - Allowed `modifiers`: none. + - Allowed `types`: none. +- `enum` - matches any enum declaration. + - Allowed `modifiers`: none. + - Allowed `types`: none. +- `typeParameter` - matches any generic type parameter declaration. + - Allowed `modifiers`: none. + - Allowed `types`: none. + +##### Group Selectors + +Group Selectors are provided for convenience, and essentially bundle up sets of individual selectors. + +- `default` - matches everything. + - Allowed `modifiers`: `private`, `protected`, `public`, `static`, `readonly`, `abstract`. + - Allowed `types`: none. +- `variableLike` - matches the same as `variable`, `function` and `parameter`. + - Allowed `modifiers`: none. + - Allowed `types`: none. +- `memberLike` - matches the same as `property`, `parameterProperty`, `method`, `accessor`, `enumMember`. + - Allowed `modifiers`: `private`, `protected`, `public`, `static`, `readonly`, `abstract`. + - Allowed `types`: none. +- `typeLike` - matches the same as `class`, `interface`, `typeAlias`, `enum`, `typeParameter`. + - Allowed `modifiers`: `abstract`. + - Allowed `types`: none. + +## Examples + +### Enforce that all variables, functions and properties follow are camelCase + +```json +{ + "@typescript-eslint/naming-convention": [ + "error", + { "selector": "variableLike", "format": ["camelCase"] } + ] +} +``` + +### Enforce that private members are prefixed with an underscore + +```json +{ + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "memberLike", + "modifiers": ["private"], + "format": ["camelCase"], + "leadingUnderscore": "require" + } + ] +} +``` + +### Enforce that boolean variables are prefixed with an allowed verb + +**Note:** As [documented above](#format-options), the prefix is trimmed before format is validated, thus PascalCase must be used to allow variables such as `isEnabled`. + +```json +{ + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "variable", + "types": ["boolean"], + "format": ["PascalCase"], + "prefix": ["is", "should", "has", "can", "did", "will"] + } + ] +} +``` + +### Enforce that all variables are either in camelCase or UPPER_CASE + +```json +{ + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "variable", + "format": ["camelCase", "UPPER_CASE"] + } + ] +} +``` + +### Enforce that all const variables are in UPPER_CASE + +```json +{ + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "variable", + "modifiers": ["const"], + "format": ["UPPER_CASE"] + } + ] +} +``` + +### Enforce that type parameters (generics) are prefixed with `T` + +This allows you to emulate the old `generic-type-naming` rule. + +```json +{ + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "typeParameter", + "format": ["PascalCase"], + "prefix": ["T"] + } + ] +} +``` + +### Enforce that interface names do not begin with an `I` + +This allows you to emulate the old `interface-name-prefix` rule. + +```json +{ + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "interface", + "format": ["PascalCase"], + "custom": { + "regex": "^I[A-Z]", + "match": false + } + } + ] +} +``` + +### Enforce that variable and function names are in camelCase + +This allows you to lint multiple type with same pattern. + +```json +{ + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": ["variable", "function"], + "format": ["camelCase"], + "leadingUnderscore": "allow" + } + ] +} +``` + +### Ignore properties that require quotes + +Sometimes you have to use a quoted name that breaks the convention (for example, HTTP headers). +If this is a common thing in your codebase, then you can use the `filter` option in one of two ways: + +You can use the `filter` option to ignore specific names only: + +```jsonc +{ + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "property", + "format": ["strictCamelCase"], + "filter": { + // you can expand this regex to add more allowed names + "regex": "^(Property-Name-One|Property-Name-Two)$", + "match": false + } + } + ] +} +``` + +You can use the `filter` option to ignore names that require quoting: + +```jsonc +{ + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "property", + "format": ["strictCamelCase"], + "filter": { + // you can expand this regex as you find more cases that require quoting that you want to allow + "regex": "[- ]", + "match": false + } + } + ] +} +``` + +### Enforce the codebase follows ESLint's `camelcase` conventions + +```json +{ + "camelcase": "off", + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "default", + "format": ["camelCase"] + }, + + { + "selector": "variable", + "format": ["camelCase", "UPPER_CASE"] + }, + { + "selector": "parameter", + "format": ["camelCase"], + "leadingUnderscore": "allow" + }, + + { + "selector": "memberLike", + "modifiers": ["private"], + "format": ["camelCase"], + "leadingUnderscore": "require" + }, + + { + "selector": "typeLike", + "format": ["PascalCase"] + } + ] +} +``` + +## When Not To Use It + +If you do not want to enforce naming conventions for anything. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-array-constructor.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-array-constructor.md new file mode 100644 index 000000000..fb9a68e74 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-array-constructor.md @@ -0,0 +1,43 @@ +# Disallow generic `Array` constructors (`no-array-constructor`) + +## Rule Details + +This rule extends the base [`eslint/no-array-constructor`](https://eslint.org/docs/rules/no-array-constructor) rule. +It adds support for the generically typed `Array` constructor (`new Array()`). + +Examples of **incorrect** code for this rule: + +```ts +/*eslint no-array-constructor: "error"*/ + +Array(0, 1, 2); +new Array(0, 1, 2); +``` + +Examples of **correct** code for this rule: + +```ts +/*eslint no-array-constructor: "error"*/ + +Array(0, 1, 2); +new Array(x, y, z); + +Array(500); +new Array(someOtherArray.length); +``` + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "no-array-constructor": "off", + "@typescript-eslint/no-array-constructor": ["error"] +} +``` + +## Options + +See [`eslint/no-array-constructor` options](https://eslint.org/docs/rules/no-array-constructor#options). + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-array-constructor.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-base-to-string.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-base-to-string.md new file mode 100644 index 000000000..f1c2abab3 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-base-to-string.md @@ -0,0 +1,87 @@ +# Requires that `.toString()` is only called on objects which provide useful information when stringified (`no-base-to-string`) + +JavaScript will call `toString()` on an object when it is converted to a string, such as when `+` adding to a string or in `${}` template literals. + +The default Object `.toString()` returns `"[object Object]"`, so this rule requires stringified objects define a more useful `.toString()` method. + +Note that `Function` provides its own `.toString()` that returns the function's code. +Functions are not flagged by this rule. + +This rule has some overlap with [`restrict-plus-operands`](./restrict-plus-operands.md) and [`restrict-template-expressions`](./restrict-template-expressions.md). + +## Rule Details + +This rule prevents accidentally defaulting to the base Object `.toString()` method. + +Examples of **incorrect** code for this rule: + +```ts +// Passing an object or class instance to string concatenation: +'' + {}; + +class MyClass {} +const value = new MyClass(); +value + ''; + +// Interpolation and manual .toString() calls too: +`Value: ${value}`; +({}.toString()); +``` + +Examples of **correct** code for this rule: + +```ts +// These types all have useful .toString()s +'Text' + true; +`Value: ${123}`; +`Arrays too: ${[1, 2, 3]}`; +(() => {}).toString(); + +// Defining a custom .toString class is considered acceptable +class CustomToString { + toString() { + return 'Hello, world!'; + } +} +`Value: ${new CustomToString()}`; + +const literalWithToString = { + toString: () => 'Hello, world!', +}; + +`Value: ${literalWithToString}`; +``` + +## Options + +```ts +type Options = { + ignoredTypeNames?: string[]; +}; + +const defaultOptions: Options = { + ignoredTypeNames: ['RegExp'], +}; +``` + +### `ignoredTypeNames` + +A string array of type names to ignore, this is useful for types missing `toString()` (but actually has `toString()`). +There are some types missing `toString()` in old version TypeScript, like `RegExp`, `URL`, `URLSearchParams` etc. + +The following patterns are considered correct with the default options `{ ignoredTypeNames: ["RegExp"] }`: + +```ts +`${/regex/}`; +'' + /regex/; +/regex/.toString(); +let value = /regex/; +value.toString(); +let text = `${value}`; +``` + +## When Not To Use It + +If you don't mind `"[object Object]"` in your strings, then you will not need this rule. + +- [`Object.prototype.toString()` MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md new file mode 100644 index 000000000..a61f6a8a9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md @@ -0,0 +1,46 @@ +# Disallow non-null assertion in locations that may be confusing (`no-confusing-non-null-assertion`) + +## Rule Details + +Using a non-null assertion (`!`) next to an assign or equals check (`=` or `==` or `===`) creates code that is confusing as it looks similar to a not equals check (`!=` `!==`). + +```typescript +a! == b; // a non-null assertions(`!`) and an equals test(`==`) +a !== b; // not equals test(`!==`) +a! === b; // a non-null assertions(`!`) and an triple equals test(`===`) +``` + +Examples of **incorrect** code for this rule: + +```ts +interface Foo { + bar?: string; + num?: number; +} + +const foo: Foo = getFoo(); +const isEqualsBar = foo.bar! == 'hello'; +const isEqualsNum = 1 + foo.num! == 2; +``` + +Examples of **correct** code for this rule: + + +```ts +interface Foo { + bar?: string; + num?: number; +} + +const foo: Foo = getFoo(); +const isEqualsBar = foo.bar == 'hello'; +const isEqualsNum = (1 + foo.num!) == 2; +``` + +## When Not To Use It + +If you don't care about this confusion, then you will not need this rule. + +## Further Reading + +- [`Issue: Easy misunderstanding: "! ==="`](https://github.com/microsoft/TypeScript/issues/37837) in [TypeScript repo](https://github.com/microsoft/TypeScript) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dupe-class-members.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dupe-class-members.md new file mode 100644 index 000000000..ddfc1b9f1 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dupe-class-members.md @@ -0,0 +1,22 @@ +# Disallow duplicate class members (`no-dupe-class-members`) + +## Rule Details + +This rule extends the base [`eslint/no-dupe-class-members`](https://eslint.org/docs/rules/no-dupe-class-members) rule. +It adds support for TypeScript's method overload definitions. + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "no-dupe-class-members": "off", + "@typescript-eslint/no-dupe-class-members": ["error"] +} +``` + +## Options + +See [`eslint/no-dupe-class-members` options](https://eslint.org/docs/rules/no-dupe-class-members#options). + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-dupe-class-members.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dynamic-delete.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dynamic-delete.md new file mode 100644 index 000000000..5d84cb1c9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dynamic-delete.md @@ -0,0 +1,49 @@ +# Disallow the delete operator with computed key expressions (`no-dynamic-delete`) + +Deleting dynamically computed keys can be dangerous and in some cases not well optimized. + +## Rule Details + +Using the `delete` operator on keys that aren't runtime constants could be a sign that you're using the wrong data structures. +Using `Object`s with added and removed keys can cause occasional edge case bugs, such as if a key is named `"hasOwnProperty"`. +Consider using a `Map` or `Set` if you’re storing collections of objects. + +Examples of **correct** code with this rule: + +```ts +const container: { [i: string]: number } = { + /* ... */ +}; + +// Constant runtime lookups by string index +delete container.aaa; + +// Constants that must be accessed by [] +delete container[7]; +delete container['-Infinity']; +``` + +Examples of **incorrect** code with this rule: + +```ts +// Can be replaced with the constant equivalents, such as container.aaa +delete container['aaa']; +delete container['Infinity']; + +// Dynamic, difficult-to-reason-about lookups +const name = 'name'; +delete container[name]; +delete container[name.toUpperCase()]; +``` + +## When Not To Use It + +When you know your keys are safe to delete, this rule can be unnecessary. +Some environments such as older browsers might not support `Map` and `Set`. + +Do not consider this rule as performance advice before profiling your code's bottlenecks. +Even repeated minor performance slowdowns likely do not significantly affect your application's general perceived speed. + +## Related to + +- TSLint: [no-dynamic-delete](https://palantir.github.io/tslint/rules/no-dynamic-delete) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-function.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-function.md new file mode 100644 index 000000000..071584e99 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-function.md @@ -0,0 +1,78 @@ +# Disallow empty functions (`no-empty-function`) + +## Rule Details + +This rule extends the base [`eslint/no-empty-function`](https://eslint.org/docs/rules/no-empty-function) rule. +It adds support for handling TypeScript specific code that would otherwise trigger the rule. + +One example of valid TypeScript specific code that would otherwise trigger the `no-empty-function` rule is the use of [parameter properties](https://www.typescriptlang.org/docs/handbook/classes.html#parameter-properties) in constructor functions. + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "no-empty-function": "off", + "@typescript-eslint/no-empty-function": ["error"] +} +``` + +## Options + +See [`eslint/no-empty-function` options](https://eslint.org/docs/rules/no-empty-function#options). +This rule adds the following options: + +```ts +type AdditionalAllowOptionEntries = + | 'private-constructors' + | 'protected-constructors' + | 'decoratedFunctions'; + +type AllowOptionEntries = + | BaseNoEmptyFunctionAllowOptionEntries + | AdditionalAllowOptionEntries; + +interface Options extends BaseNoEmptyFunctionOptions { + allow?: Array; +} +const defaultOptions: Options = { + ...baseNoEmptyFunctionDefaultOptions, + allow: [], +}; +``` + +### allow: `private-constructors` + +Examples of correct code for the `{ "allow": ["private-constructors"] }` option: + +```ts +class Foo { + private constructor() {} +} +``` + +### allow: `protected-constructors` + +Examples of correct code for the `{ "allow": ["protected-constructors"] }` option: + +```ts +class Foo { + protected constructor() {} +} +``` + +### allow: `decoratedFunctions` + +Examples of correct code for the `{ "allow": ["decoratedFunctions"] }` option: + +```ts +@decorator() +function foo() {} + +class Foo { + @decorator() + foo() {} +} +``` + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-empty-function.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-interface.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-interface.md new file mode 100644 index 000000000..7df218a7e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-interface.md @@ -0,0 +1,64 @@ +# Disallow the declaration of empty interfaces (`no-empty-interface`) + +An empty interface is equivalent to its supertype. If the interface does not implement a supertype, then +the interface is equivalent to an empty object (`{}`). In both cases it can be omitted. + +## Rule Details + +This rule aims to ensure that only meaningful interfaces are declared in the code. + +The following patterns are considered warnings: + +```ts +// an empty interface +interface Foo {} + +// an interface with only one supertype (Bar === Foo) +interface Bar extends Foo {} + +// an interface with an empty list of supertypes +interface Baz {} +``` + +The following patterns are not warnings: + +```ts +// an interface with any number of members +interface Foo { + name: string; +} + +// same as above +interface Bar { + age: number; +} + +// an interface with more than one supertype +// in this case the interface can be used as a replacement of a union type. +interface Baz extends Foo, Bar {} +``` + +### Options + +This rule accepts a single object option with the following default configuration: + +```json +{ + "@typescript-eslint/no-empty-interface": [ + "error", + { + "allowSingleExtends": false + } + ] +} +``` + +- `allowSingleExtends: true` will silence warnings about extending a single interface without adding additional members + +## When Not To Use It + +If you don't care about having empty/meaningless interfaces, then you will not need this rule. + +## Compatibility + +- TSLint: [no-empty-interface](https://palantir.github.io/tslint/rules/no-empty-interface/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-explicit-any.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-explicit-any.md new file mode 100644 index 000000000..7aeb46587 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-explicit-any.md @@ -0,0 +1,181 @@ +# Disallow usage of the `any` type (`no-explicit-any`) + +Using the `any` type defeats the purpose of using TypeScript. +When `any` is used, all compiler type checks around that value are ignored. + +## Rule Details + +This rule doesn't allow `any` types to be defined. +It aims to keep TypeScript maximally useful. +TypeScript has a compiler flag for `--noImplicitAny` that will prevent +an `any` type from being implied by the compiler, but doesn't prevent +`any` from being explicitly used. + +The following patterns are considered warnings: + +```ts +const age: any = 'seventeen'; +``` + +```ts +const ages: any[] = ['seventeen']; +``` + +```ts +const ages: Array = ['seventeen']; +``` + +```ts +function greet(): any {} +``` + +```ts +function greet(): any[] {} +``` + +```ts +function greet(): Array {} +``` + +```ts +function greet(): Array> {} +``` + +```ts +function greet(param: Array): string {} +``` + +```ts +function greet(param: Array): Array {} +``` + +The following patterns are not warnings: + +```ts +const age: number = 17; +``` + +```ts +const ages: number[] = [17]; +``` + +```ts +const ages: Array = [17]; +``` + +```ts +function greet(): string {} +``` + +```ts +function greet(): string[] {} +``` + +```ts +function greet(): Array {} +``` + +```ts +function greet(): Array> {} +``` + +```ts +function greet(param: Array): string {} +``` + +```ts +function greet(param: Array): Array {} +``` + +## Options + +The rule accepts an options object with the following properties: + +```ts +type Options = { + // if true, auto-fixing will be made available in which the "any" type is converted to an "unknown" type + fixToUnknown: boolean; + // specify if arrays from the rest operator are considered okay + ignoreRestArgs: boolean; +}; + +const defaults = { + fixToUnknown: false, + ignoreRestArgs: false, +}; +``` + +### `ignoreRestArgs` + +A boolean to specify if arrays from the rest operator are considered okay. `false` by default. + +Examples of **incorrect** code for the `{ "ignoreRestArgs": false }` option: + +```ts +/*eslint @typescript-eslint/no-explicit-any: ["error", { "ignoreRestArgs": false }]*/ + +function foo1(...args: any[]): void {} +function foo2(...args: readonly any[]): void {} +function foo3(...args: Array): void {} +function foo4(...args: ReadonlyArray): void {} + +declare function bar(...args: any[]): void; + +const baz = (...args: any[]) => {}; +const qux = function (...args: any[]) {}; + +type Quux = (...args: any[]) => void; +type Quuz = new (...args: any[]) => void; + +interface Grault { + (...args: any[]): void; +} +interface Corge { + new (...args: any[]): void; +} +interface Garply { + f(...args: any[]): void; +} +``` + +Examples of **correct** code for the `{ "ignoreRestArgs": true }` option: + +```ts +/*eslint @typescript-eslint/no-explicit-any: ["error", { "ignoreRestArgs": true }]*/ + +function foo1(...args: any[]): void {} +function foo2(...args: readonly any[]): void {} +function foo3(...args: Array): void {} +function foo4(...args: ReadonlyArray): void {} + +declare function bar(...args: any[]): void; + +const baz = (...args: any[]) => {}; +const qux = function (...args: any[]) {}; + +type Quux = (...args: any[]) => void; +type Quuz = new (...args: any[]) => void; + +interface Grault { + (...args: any[]): void; +} +interface Corge { + new (...args: any[]): void; +} +interface Garply { + f(...args: any[]): void; +} +``` + +## When Not To Use It + +If an unknown type or a library without typings is used +and you want to be able to specify `any`. + +## Further Reading + +- TypeScript [any type](https://www.typescriptlang.org/docs/handbook/basic-types.html#any) + +## Compatibility + +- TSLint: [no-any](https://palantir.github.io/tslint/rules/no-any/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-non-null-assertion.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-non-null-assertion.md new file mode 100644 index 000000000..0991efdee --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-non-null-assertion.md @@ -0,0 +1,49 @@ +# Disallow extra non-null assertion (`no-extra-non-null-assertion`) + +## Rule Details + +Examples of **incorrect** code for this rule: + +```ts +const foo: { bar: number } | null = null; +const bar = foo!!!.bar; +``` + +```ts +function foo(bar: number | undefined) { + const bar: number = bar!!!; +} +``` + +```ts +function foo(bar?: { n: number }) { + return bar!?.n; +} +``` + +Examples of **correct** code for this rule: + +```ts +const foo: { bar: number } | null = null; +const bar = foo!.bar; +``` + +```ts +function foo(bar: number | undefined) { + const bar: number = bar!; +} +``` + +```ts +function foo(bar?: { n: number }) { + return bar?.n; +} +``` + +## How to use + +```json +{ + "@typescript-eslint/no-extra-non-null-assertion": ["error"] +} +``` diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-parens.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-parens.md new file mode 100644 index 000000000..8173b2ef1 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-parens.md @@ -0,0 +1,22 @@ +# Disallow unnecessary parentheses (`no-extra-parens`) + +## Rule Details + +This rule extends the base [`eslint/no-extra-parens`](https://eslint.org/docs/rules/no-extra-parens) rule. +It adds support for TypeScript type assertions. + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "no-extra-parens": "off", + "@typescript-eslint/no-extra-parens": ["error"] +} +``` + +## Options + +See [`eslint/no-extra-parens` options](https://eslint.org/docs/rules/no-extra-parens#options). + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-extra-parens.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-semi.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-semi.md new file mode 100644 index 000000000..f6865bd8b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-semi.md @@ -0,0 +1,22 @@ +# Disallow unnecessary semicolons (`no-extra-semi`) + +## Rule Details + +This rule extends the base [`eslint/no-extra-semi`](https://eslint.org/docs/rules/no-extra-semi) rule. +It adds support for class properties. + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "no-extra-semi": "off", + "@typescript-eslint/no-extra-semi": ["error"] +} +``` + +## Options + +See [`eslint/no-extra-semi` options](https://eslint.org/docs/rules/no-extra-semi#options). + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-extra-semi.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extraneous-class.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extraneous-class.md new file mode 100644 index 000000000..abc84f272 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extraneous-class.md @@ -0,0 +1,80 @@ +# Forbids the use of classes as namespaces (`no-extraneous-class`) + +This rule warns when a class is accidentally used as a namespace. + +## Rule Details + +From TSLint’s docs: + +> Users who come from a Java-style OO language may wrap their utility functions in an extra class, +> instead of putting them at the top level. + +Examples of **incorrect** code for this rule: + +```ts +class EmptyClass {} + +class ConstructorOnly { + constructor() { + foo(); + } +} + +// Use an object instead: +class StaticOnly { + static version = 42; + static hello() { + console.log('Hello, world!'); + } +} +``` + +Examples of **correct** code for this rule: + +```ts +class EmptyClass extends SuperClass {} + +class ParameterProperties { + constructor(public name: string) {} +} + +const StaticOnly = { + version: 42, + hello() { + console.log('Hello, world!'); + }, +}; +``` + +### Options + +This rule accepts a single object option. + +```ts +type Options = { + // allow extraneous classes if they only contain a constructor + allowConstructorOnly?: boolean; + // allow extraneous classes if they have no body (i.e. are empty) + allowEmpty?: boolean; + // allow extraneous classes if they only contain static members + allowStaticOnly?: boolean; + // allow extraneous classes if they have a decorator + allowWithDecorator?: boolean; +}; + +const defaultOptions: Options = { + allowConstructorOnly: false, + allowEmpty: false, + allowStaticOnly: false, + allowWithDecorator: false, +}; +``` + +## When Not To Use It + +You can disable this rule if you don’t have anyone who would make these kinds of mistakes on your +team or if you use classes as namespaces. + +## Compatibility + +[`no-unnecessary-class`](https://palantir.github.io/tslint/rules/no-unnecessary-class/) from TSLint diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-floating-promises.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-floating-promises.md new file mode 100644 index 000000000..bda8c26b7 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-floating-promises.md @@ -0,0 +1,104 @@ +# Requires Promise-like values to be handled appropriately (`no-floating-promises`) + +This rule forbids usage of Promise-like values in statements without handling +their errors appropriately. Unhandled promises can cause several issues, such +as improperly sequenced operations, ignored Promise rejections and more. Valid +ways of handling a Promise-valued statement include `await`ing, returning, and +either calling `.then()` with two arguments or `.catch()` with one argument. + +## Rule Details + +Examples of **incorrect** code for this rule: + +```ts +const promise = new Promise((resolve, reject) => resolve('value')); +promise; + +async function returnsPromise() { + return 'value'; +} +returnsPromise().then(() => {}); + +Promise.reject('value').catch(); + +Promise.reject('value').finally(); +``` + +Examples of **correct** code for this rule: + +```ts +const promise = new Promise((resolve, reject) => resolve('value')); +await promise; + +async function returnsPromise() { + return 'value'; +} +returnsPromise().then( + () => {}, + () => {}, +); + +Promise.reject('value').catch(() => {}); + +Promise.reject('value').finally(() => {}); +``` + +## Options + +The rule accepts an options object with the following properties: + +```ts +type Options = { + // if true, checking void expressions will be skipped + ignoreVoid?: boolean; + // if true, checking for async iife will be skipped + ignoreIIFE?: boolean; +}; + +const defaults = { + ignoreVoid: true, + ignoreIIFE: false, +}; +``` + +### `ignoreVoid` + +This allows you to stop the rule reporting promises consumed with void operator. +This can be a good way to explicitly mark a promise as intentionally not awaited. + +Examples of **correct** code for this rule with `{ ignoreVoid: true }`: + +```ts +async function returnsPromise() { + return 'value'; +} +void returnsPromise(); + +void Promise.reject('value'); +``` + +With this option set to `true`, and if you are using `no-void`, you should turn on the [`allowAsAStatement`](https://eslint.org/docs/rules/no-void#allowasstatement) option. + +### `ignoreIIFE` + +This allows you to skip checking of async iife + +Examples of **correct** code for this rule with `{ ignoreIIFE: true }`: + +```ts +await(async function () { + await res(1); +})(); + +(async function () { + await res(1); +})(); +``` + +## When Not To Use It + +If you do not use Promise-like values in your codebase, or want to allow them to remain unhandled. + +## Related to + +- TSLint: ['no-floating-promises'](https://palantir.github.io/tslint/rules/no-floating-promises/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-for-in-array.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-for-in-array.md new file mode 100644 index 000000000..c5d4c3f64 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-for-in-array.md @@ -0,0 +1,44 @@ +# Disallow iterating over an array with a for-in loop (`no-for-in-array`) + +This rule prohibits iterating over an array with a for-in loop. + +## Rule Details + +Rationale from TSLint: + +A for-in loop (`for (var k in o)`) iterates over the properties of an Object. +While it is legal to use for-in loops with array types, it is not common. +for-in will iterate over the indices of the array as strings, omitting any "holes" in +the array. +More common is to use for-of, which iterates over the values of an array. +If you want to iterate over the indices, alternatives include: + +```js +array.forEach((value, index) => { ... }); +for (const [index, value] of array.entries()) { ... } +for (let i = 0; i < array.length; i++) { ... } +``` + +Examples of **incorrect** code for this rule: + +```js +for (const x in [3, 4, 5]) { + console.log(x); +} +``` + +Examples of **correct** code for this rule: + +```js +for (const x in { a: 3, b: 4, c: 5 }) { + console.log(x); +} +``` + +## When Not To Use It + +If you want to iterate through a loop using the indices in an array as strings, you can turn off this rule. + +## Related to + +- TSLint: ['no-for-in-array'](https://palantir.github.io/tslint/rules/no-for-in-array/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implicit-any-catch.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implicit-any-catch.md new file mode 100644 index 000000000..8ef946b42 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implicit-any-catch.md @@ -0,0 +1,76 @@ +# Disallow usage of the implicit `any` type in catch clauses (`no-implicit-any-catch`) + +TypeScript 4.0 added support for adding an explicit `any` or `unknown` type annotation on a catch clause variable. + +By default, TypeScript will type a catch clause variable as `any`, so explicitly annotating it as `unknown` can add a lot of safety to your codebase. + +The `noImplicitAny` flag in TypeScript does not cover this for backwards compatibility reasons. + +## Rule Details + +This rule requires an explicit type to be declared on a catch clause variable. + +The following pattern is considered a warning: + +```ts +try { + // ... +} catch (e) { + // ... +} +``` + +The following pattern is **_not_** considered a warning: + + + + +```ts +try { + // ... +} catch (e: unknown) { + // ... +} +``` + + + +## Options + +The rule accepts an options object with the following properties: + +```ts +type Options = { + // if false, disallow specifying `: any` as the error type as well. See also `no-explicit-any` + allowExplicitAny: boolean; +}; + +const defaults = { + allowExplicitAny: false, +}; +``` + +### `allowExplicitAny` + +The follow is is **_not_** considered a warning with `{ allowExplicitAny: true }` + + + + +```ts +try { + // ... +} catch (e: any) { + // ... +} +``` + + + +## When Not To Use It + +If you are not using TypeScript 4.0 (or greater), then you will not be able to use this rule, annotations on catch clauses is not supported. + +## Further Reading + +- [TypeScript 4.0 Beta Release Notes](https://devblogs.microsoft.com/typescript/announcing-typescript-4-0-beta/#unknown-on-catch) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implied-eval.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implied-eval.md new file mode 100644 index 000000000..3753adf26 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implied-eval.md @@ -0,0 +1,95 @@ +# Disallow the use of `eval()`-like methods (`no-implied-eval`) + +It's considered a good practice to avoid using `eval()`. There are security and performance implications involved with doing so, which is why many linters recommend disallowing `eval()`. However, there are some other ways to pass a string and have it interpreted as JavaScript code that have similar concerns. + +The first is using `setTimeout()`, `setInterval()`, `setImmediate` or `execScript()` (Internet Explorer only), all of which can accept a string of code as their first argument + +```ts +setTimeout('alert(`Hi!`);', 100); +``` + +or using `new Function()` + +```ts +const fn = new Function('a', 'b', 'return a + b'); +``` + +This is considered an implied `eval()` because a string of code is +passed in to be interpreted. The same can be done with `setInterval()`, `setImmediate()` and `execScript()`. All interpret the JavaScript code in the global scope. + +The best practice is to avoid using `new Function()` or `execScript()` and always use a function for the first argument of `setTimeout()`, `setInterval()` and `setImmediate()`. + +## Rule Details + +This rule aims to eliminate implied `eval()` through the use of `new Function()`, `setTimeout()`, `setInterval()`, `setImmediate()` or `execScript()`. + +Examples of **incorrect** code for this rule: + +```ts +/* eslint @typescript-eslint/no-implied-eval: "error" */ + +setTimeout('alert(`Hi!`);', 100); + +setInterval('alert(`Hi!`);', 100); + +setImmediate('alert(`Hi!`)'); + +execScript('alert(`Hi!`)'); + +window.setTimeout('count = 5', 10); + +window.setInterval('foo = bar', 10); + +const fn = '() = {}'; +setTimeout(fn, 100); + +const fn = () => { + return 'x = 10'; +}; +setTimeout(fn(), 100); + +const fn = new Function('a', 'b', 'return a + b'); +``` + +Examples of **correct** code for this rule: + +```ts +/* eslint @typescript-eslint/no-implied-eval: "error" */ + +setTimeout(function () { + alert('Hi!'); +}, 100); + +setInterval(function () { + alert('Hi!'); +}, 100); + +setImmediate(function () { + alert('Hi!'); +}); + +execScript(function () { + alert('Hi!'); +}); + +const fn = () => {}; +setTimeout(fn, 100); + +const foo = { + fn: function () {}, +}; +setTimeout(foo.fn, 100); +setTimeout(foo.fn.bind(this), 100); + +class Foo { + static fn = () => {}; +} + +setTimeout(Foo.fn, 100); +``` + +## When Not To Use It + +If you want to allow `new Function()` or `setTimeout()`, `setInterval()`, `setImmediate()` and `execScript()` with string arguments, then you can safely disable this rule. + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-implied-eval.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-inferrable-types.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-inferrable-types.md new file mode 100644 index 000000000..91fdfe678 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-inferrable-types.md @@ -0,0 +1,146 @@ +# Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean (`no-inferrable-types`) + +Explicit types where they can be easily inferred may add unnecessary verbosity. + +## Rule Details + +This rule disallows explicit type declarations on parameters, variables +and properties where the type can be easily inferred from its value. + +## Options + +This rule accepts the following options: + +```ts +interface Options { + ignoreParameters?: boolean; + ignoreProperties?: boolean; +} +``` + +### Default + +The default options are: + +```JSON +{ + "ignoreParameters": false, + "ignoreProperties": false, +} +``` + +With these options, the following patterns are valid: + +```ts +const a = 10n; +const a = -10n; +const a = BigInt(10); +const a = -BigInt(10); +const a = false; +const a = true; +const a = Boolean(null); +const a = !0; +const a = 10; +const a = +10; +const a = -10; +const a = Number('1'); +const a = +Number('1'); +const a = -Number('1'); +const a = Infinity; +const a = +Infinity; +const a = -Infinity; +const a = NaN; +const a = +NaN; +const a = -NaN; +const a = null; +const a = /a/; +const a = RegExp('a'); +const a = new RegExp('a'); +const a = 'str'; +const a = `str`; +const a = String(1); +const a = Symbol('a'); +const a = undefined; +const a = void someValue; + +class Foo { + prop = 5; +} + +function fn(a = 5, b = true) {} + +function fn(a: number, b: boolean, c: string) {} +``` + +The following are invalid: + +```ts +const a: bigint = 10n; +const a: bigint = -10n; +const a: bigint = BigInt(10); +const a: bigint = -BigInt(10); +const a: boolean = false; +const a: boolean = true; +const a: boolean = Boolean(null); +const a: boolean = !0; +const a: number = 10; +const a: number = +10; +const a: number = -10; +const a: number = Number('1'); +const a: number = +Number('1'); +const a: number = -Number('1'); +const a: number = Infinity; +const a: number = +Infinity; +const a: number = -Infinity; +const a: number = NaN; +const a: number = +NaN; +const a: number = -NaN; +const a: null = null; +const a: RegExp = /a/; +const a: RegExp = RegExp('a'); +const a: RegExp = new RegExp('a'); +const a: string = 'str'; +const a: string = `str`; +const a: string = String(1); +const a: symbol = Symbol('a'); +const a: undefined = undefined; +const a: undefined = void someValue; + +class Foo { + prop: number = 5; +} + +function fn(a: number = 5, b: boolean = true) {} +``` + +### `ignoreParameters` + +When set to true, the following pattern is considered valid: + +```ts +function foo(a: number = 5, b: boolean = true) { + // ... +} +``` + +### `ignoreProperties` + +When set to true, the following pattern is considered valid: + +```ts +class Foo { + prop: number = 5; +} +``` + +## When Not To Use It + +If you do not want to enforce inferred types. + +## Further Reading + +TypeScript [Inference](https://www.typescriptlang.org/docs/handbook/type-inference.html) + +## Compatibility + +TSLint: [no-inferrable-types](https://palantir.github.io/tslint/rules/no-inferrable-types/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-this.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-this.md new file mode 100644 index 000000000..ac9dc3012 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-this.md @@ -0,0 +1,26 @@ +# disallow `this` keywords outside of classes or class-like objects (`no-invalid-this`) + +## Rule Details + +This rule extends the base [`eslint/no-invalid-this`](https://eslint.org/docs/rules/no-invalid-this) rule. +It adds support for TypeScript's `this` parameters. + +## How to use + +```cjson +{ + // note you must disable the base rule as it can report incorrect errors + "no-invalid-this": "off", + "@typescript-eslint/no-invalid-this": ["error"] +} +``` + +## Options + +See [`eslint/no-invalid-this` options](https://eslint.org/docs/rules/no-invalid-this#options). + +## When Not To Use It + +When you are indifferent as to how your variables are initialized. + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-invalid-this.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-void-type.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-void-type.md new file mode 100644 index 000000000..f1607478a --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-void-type.md @@ -0,0 +1,107 @@ +# Disallows usage of `void` type outside of generic or return types (`no-invalid-void-type`) + +Disallows usage of `void` type outside of return types or generic type arguments. +If `void` is used as return type, it shouldn’t be a part of intersection/union type with most other types. + +## Rationale + +The `void` type means “nothing” or that a function does not return any value, +in contrast with implicit `undefined` type which means that a function returns a value `undefined`. +So “nothing” cannot be mixed with any other types, other than `never`, which accepts all types. +If you need this - use the `undefined` type instead. + +## Rule Details + +This rule aims to ensure that the `void` type is only used in valid places. + +The following patterns are considered warnings: + +```ts +type PossibleValues = string | number | void; +type MorePossibleValues = string | ((number & any) | (string | void)); + +function logSomething(thing: void) {} +function printArg(arg: T) {} + +logAndReturn(undefined); + +interface Interface { + lambda: () => void; + prop: void; +} + +class MyClass { + private readonly propName: void; +} +``` + +The following patterns are not considered warnings: + +```ts +type NoOp = () => void; + +function noop(): void {} + +let trulyUndefined = void 0; + +async function promiseMeSomething(): Promise {} + +type stillVoid = void | never; +``` + +### Options + +```ts +interface Options { + allowInGenericTypeArguments?: boolean | string[]; +} + +const defaultOptions: Options = { + allowInGenericTypeArguments: true, +}; +``` + +#### `allowInGenericTypeArguments` + +This option lets you control if `void` can be used as a valid value for generic type parameters. + +Alternatively, you can provide an array of strings which whitelist which types may accept `void` as a generic type parameter. + +Any types considered valid by this option will be considered valid as part of a union type with `void`. + +This option is `true` by default. + +The following patterns are considered warnings with `{ allowInGenericTypeArguments: false }`: + +```ts +logAndReturn(undefined); + +let voidPromise: Promise = new Promise(() => {}); +let voidMap: Map = new Map(); +``` + +The following patterns are considered warnings with `{ allowInGenericTypeArguments: ['Ex.Mx.Tx'] }`: + +```ts +logAndReturn(undefined); + +type NotAllowedVoid1 = Mx.Tx; +type NotAllowedVoid2 = Tx; +type NotAllowedVoid3 = Promise; +``` + +The following patterns are not considered warnings with `{ allowInGenericTypeArguments: ['Ex.Mx.Tx'] }`: + +```ts +type AllowedVoid = Ex.Mx.Tx; +type AllowedVoidUnion = void | Ex.Mx.Tx; +``` + +## When Not To Use It + +If you don't care about if `void` is used with other types, +or in invalid places, then you don't need this rule. + +## Compatibility + +- TSLint: [invalid-void](https://palantir.github.io/tslint/rules/invalid-void/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loop-func.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loop-func.md new file mode 100644 index 000000000..d48d38c20 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loop-func.md @@ -0,0 +1,22 @@ +# Disallow function declarations that contain unsafe references inside loop statements (`no-loop-func`) + +## Rule Details + +This rule extends the base [`eslint/no-loop-func`](https://eslint.org/docs/rules/no-loop-func) rule. +It adds support for TypeScript types. + +## How to use + +```cjson +{ + // note you must disable the base rule as it can report incorrect errors + "no-loop-func": "off", + "@typescript-eslint/no-loop-func": ["error"] +} +``` + +## Options + +See [`eslint/no-loop-func` options](https://eslint.org/docs/rules/no-loop-func#options). + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-loop-func.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loss-of-precision.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loss-of-precision.md new file mode 100644 index 000000000..d6cf7b71c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loss-of-precision.md @@ -0,0 +1,19 @@ +# Disallow literal numbers that lose precision (`no-loss-of-precision`) + +## Rule Details + +This rule extends the base [`eslint/no-loss-of-precision`](https://eslint.org/docs/rules/no-loss-of-precision) rule. +It adds support for [numeric separators](https://github.com/tc39/proposal-numeric-separator). +Note that this rule requires ESLint v7. + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "no-loss-of-precision": "off", + "@typescript-eslint/no-loss-of-precision": ["error"] +} +``` + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-loss-of-precision.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-magic-numbers.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-magic-numbers.md new file mode 100644 index 000000000..f41204c13 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-magic-numbers.md @@ -0,0 +1,119 @@ +# Disallow magic numbers (`no-magic-numbers`) + +## Rule Details + +This rule extends the base [`eslint/no-magic-numbers`](https://eslint.org/docs/rules/no-magic-numbers) rule. +It adds support for: + +- numeric literal types (`type T = 1`), +- `enum` members (`enum Foo { bar = 1 }`), +- `readonly` class properties (`class Foo { readonly bar = 1 }`). + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "no-magic-numbers": "off", + "@typescript-eslint/no-magic-numbers": [ + "error", + { + /* options */ + } + ] +} +``` + +## Options + +See [`eslint/no-magic-numbers` options](https://eslint.org/docs/rules/no-magic-numbers#options). +This rule adds the following options: + +```ts +interface Options extends BaseNoMagicNumbersOptions { + ignoreEnums?: boolean; + ignoreNumericLiteralTypes?: boolean; + ignoreReadonlyClassProperties?: boolean; +} + +const defaultOptions: Options = { + ...baseNoMagicNumbersDefaultOptions, + ignoreEnums: false, + ignoreNumericLiteralTypes: false, + ignoreReadonlyClassProperties: false, +}; +``` + +### `ignoreEnums` + +A boolean to specify if enums used in TypeScript are considered okay. `false` by default. + +Examples of **incorrect** code for the `{ "ignoreEnums": false }` option: + +```ts +/*eslint @typescript-eslint/no-magic-numbers: ["error", { "ignoreEnums": false }]*/ + +enum foo = { + SECOND = 1000, +} +``` + +Examples of **correct** code for the `{ "ignoreEnums": true }` option: + +```ts +/*eslint @typescript-eslint/no-magic-numbers: ["error", { "ignoreEnums": true }]*/ + +enum foo = { + SECOND = 1000, +} +``` + +### `ignoreNumericLiteralTypes` + +A boolean to specify if numbers used in TypeScript numeric literal types are considered okay. `false` by default. + +Examples of **incorrect** code for the `{ "ignoreNumericLiteralTypes": false }` option: + +```ts +/*eslint @typescript-eslint/no-magic-numbers: ["error", { "ignoreNumericLiteralTypes": false }]*/ + +type SmallPrimes = 2 | 3 | 5 | 7 | 11; +``` + +Examples of **correct** code for the `{ "ignoreNumericLiteralTypes": true }` option: + +```ts +/*eslint @typescript-eslint/no-magic-numbers: ["error", { "ignoreNumericLiteralTypes": true }]*/ + +type SmallPrimes = 2 | 3 | 5 | 7 | 11; +``` + +### `ignoreReadonlyClassProperties` + +Examples of **incorrect** code for the `{ "ignoreReadonlyClassProperties": false }` option: + +```ts +/*eslint @typescript-eslint/no-magic-numbers: ["error", { "ignoreReadonlyClassProperties": false }]*/ + +class Foo { + readonly A = 1; + readonly B = 2; + public static readonly C = 1; + static readonly D = 1; +} +``` + +Examples of **correct** code for the `{ "ignoreReadonlyClassProperties": true }` option: + +```ts +/*eslint @typescript-eslint/no-magic-numbers: ["error", { "ignoreReadonlyClassProperties": true }]*/ + +class Foo { + readonly A = 1; + readonly B = 2; + public static readonly C = 1; + static readonly D = 1; +} +``` + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-magic-numbers.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-new.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-new.md new file mode 100644 index 000000000..f315fcac2 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-new.md @@ -0,0 +1,41 @@ +# Enforce valid definition of `new` and `constructor` (`no-misused-new`) + +Warns on apparent attempts to define constructors for interfaces or `new` for classes. + +## Rule Details + +Examples of **incorrect** code for this rule. + +```ts +class C { + new(): C; +} + +interface I { + new (): I; + constructor(): void; +} +``` + +Examples of **correct** code for this rule. + +```ts +class C { + constructor() {} +} +interface I { + new (): C; +} +``` + +## Options + +```json +{ + "@typescript-eslint/no-misused-new": "error" +} +``` + +## Compatibility + +- TSLint: [no-misused-new](https://palantir.github.io/tslint/rules/no-misused-new/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-promises.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-promises.md new file mode 100644 index 000000000..6a4c2a557 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-promises.md @@ -0,0 +1,119 @@ +# Avoid using promises in places not designed to handle them (`no-misused-promises`) + +This rule forbids using promises in places where the TypeScript compiler +allows them but they are not handled properly. These situations can often arise +due to a missing `await` keyword or just a misunderstanding of the way async +functions are handled/awaited. + +## Rule Details + +Examples of **incorrect** code for this rule with `checksConditionals: true`: + +```ts +const promise = Promise.resolve('value'); + +if (promise) { + // Do something +} + +const val = promise ? 123 : 456; + +while (promise) { + // Do something +} +``` + +Examples of **incorrect** code for this rule with `checksVoidReturn: true`: + +```ts +[1, 2, 3].forEach(async value => { + await doSomething(value); +}); + +new Promise(async (resolve, reject) => { + await doSomething(); + resolve(); +}); + +const eventEmitter = new EventEmitter(); +eventEmitter.on('some-event', async () => { + await doSomething(); +}); +``` + +Examples of **correct** code for this rule: + +```ts +const promise = Promise.resolve('value'); + +if (await promise) { + // Do something +} + +const val = (await promise) ? 123 : 456; + +while (await promise) { + // Do something +} + +for (const value of [1, 2, 3]) { + await doSomething(value); +} + +new Promise((resolve, reject) => { + // Do something + resolve(); +}); + +const eventEmitter = new EventEmitter(); +eventEmitter.on('some-event', () => { + doSomething(); +}); +``` + +## Options + +This rule accepts a single option which is an object with `checksConditionals` +and `checksVoidReturn` properties indicating which types of misuse to flag. +Both are enabled by default + +If you don't want functions that return promises where a void return is +expected to be checked, your configuration will look like this: + +```json +{ + "@typescript-eslint/no-misused-promises": [ + "error", + { + "checksVoidReturn": false + } + ] +} +``` + +Likewise, if you don't want to check conditionals, you can configure the rule +like this: + +```json +{ + "@typescript-eslint/no-misused-promises": [ + "error", + { + "checksConditionals": false + } + ] +} +``` + +## When Not To Use It + +If you do not use Promises in your codebase or are not concerned with possible +misuses of them outside of what the TypeScript compiler will check. + +## Related to + +- [`no-floating-promises`](./no-floating-promises.md) + +## Further Reading + +- [TypeScript void function assignability](https://github.com/Microsoft/TypeScript/wiki/FAQ#why-are-functions-returning-non-void-assignable-to-function-returning-void) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-namespace.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-namespace.md new file mode 100644 index 000000000..b155c2aeb --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-namespace.md @@ -0,0 +1,115 @@ +# Disallow the use of custom TypeScript modules and namespaces (`no-namespace`) + +Custom TypeScript modules (`module foo {}`) and namespaces (`namespace foo {}`) are considered outdated +ways to organize TypeScript code. ES2015 module syntax is now preferred (`import`/`export`). + +This rule still allows the use of TypeScript module declarations to describe external APIs (`declare module 'foo' {}`). + +## Rule Details + +This rule aims to standardize the way modules are declared. + +## Options + +This rule, in its default state, does not require any argument. If you would like to enable one +or more of the following you may pass an object with the options set as follows: + +- `allowDeclarations` set to `true` will allow you to `declare` custom TypeScript modules and namespaces (Default: `false`). +- `allowDefinitionFiles` set to `true` will allow you to `declare` and use custom TypeScript modules and namespaces + inside definition files (Default: `true`). + +Examples of **incorrect** code for the default `{ "allowDeclarations": false, "allowDefinitionFiles": false }` options: + +```ts +module foo {} +namespace foo {} + +declare module foo {} +declare namespace foo {} + +// anything inside a d.ts file +``` + +Examples of **correct** code for the default `{ "allowDeclarations": false, "allowDefinitionFiles": false }` options: + +```ts +declare module 'foo' {} +``` + +### `allowDeclarations` + +Examples of **incorrect** code for the `{ "allowDeclarations": true }` option: + +```ts +module foo {} +namespace foo {} +``` + +Examples of **correct** code for the `{ "allowDeclarations": true }` option: + +```ts +declare module 'foo' {} +declare module foo {} +declare namespace foo {} + +declare global { + namespace foo {} +} + +declare module foo { + namespace foo {} +} +``` + +Examples of **incorrect** code for the `{ "allowDeclarations": false }` option: + +```ts +module foo {} +namespace foo {} +declare module foo {} +declare namespace foo {} +``` + +Examples of **correct** code for the `{ "allowDeclarations": false }` option: + +```ts +declare module 'foo' {} +``` + +### `allowDefinitionFiles` + +Examples of **incorrect** code for the `{ "allowDefinitionFiles": true }` option: + +```ts +// if outside a d.ts file +module foo {} +namespace foo {} + +// if outside a d.ts file and allowDeclarations = false +module foo {} +namespace foo {} +declare module foo {} +declare namespace foo {} +``` + +Examples of **correct** code for the `{ "allowDefinitionFiles": true }` option: + +```ts +declare module 'foo' {} + +// anything inside a d.ts file +``` + +## When Not To Use It + +If you are using the ES2015 module syntax, then you will not need this rule. + +## Further Reading + +- [Modules](https://www.typescriptlang.org/docs/handbook/modules.html) +- [Namespaces](https://www.typescriptlang.org/docs/handbook/namespaces.html) +- [Namespaces and Modules](https://www.typescriptlang.org/docs/handbook/namespaces-and-modules.html) + +## Compatibility + +- TSLint: [no-namespace](https://palantir.github.io/tslint/rules/no-namespace/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md new file mode 100644 index 000000000..fdb2a8a18 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md @@ -0,0 +1,48 @@ +# Disallows using a non-null assertion after an optional chain expression (`no-non-null-asserted-optional-chain`) + +## Rule Details + +Optional chain expressions are designed to return `undefined` if the optional property is nullish. +Using non-null assertions after an optional chain expression is wrong, and introduces a serious type safety hole into your code. + +Examples of **incorrect** code for this rule: + +```ts +/* eslint @typescript-eslint/no-non-null-asserted-optional-chain: "error" */ + +foo?.bar!; +foo?.bar()!; + +// Prior to TS3.9, foo?.bar!.baz meant (foo?.bar).baz - i.e. the non-null assertion is applied to the entire chain so far. +// For TS3.9 and greater, the non-null assertion is only applied to the property itself, so it's safe. +// The following is incorrect code if you're using less than TS3.9 +foo?.bar!.baz; +foo?.bar!(); +foo?.bar!().baz; +``` + +Examples of **correct** code for this rule: + +```ts +/* eslint @typescript-eslint/no-non-null-asserted-optional-chain: "error" */ + +foo?.bar; +(foo?.bar).baz; +foo?.bar(); +foo?.bar(); +foo?.bar().baz; + +// The following is correct code if you're using TS3.9 or greater +foo?.bar!.baz; +foo?.bar!(); +foo?.bar!().baz; +``` + +## When Not To Use It + +If you are not using TypeScript 3.7 (or greater), then you will not need to use this rule, as the operator is not supported. + +## Further Reading + +- [TypeScript 3.7 Release Notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html) +- [Optional Chaining Proposal](https://github.com/tc39/proposal-optional-chaining/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-assertion.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-assertion.md new file mode 100644 index 000000000..04de57686 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-assertion.md @@ -0,0 +1,35 @@ +# Disallows non-null assertions using the `!` postfix operator (`no-non-null-assertion`) + +## Rule Details + +Using non-null assertions cancels the benefits of the strict null-checking mode. + +Examples of **incorrect** code for this rule: + +```ts +interface Foo { + bar?: string; +} + +const foo: Foo = getFoo(); +const includesBaz: boolean = foo.bar!.includes('baz'); +``` + +Examples of **correct** code for this rule: + +```ts +interface Foo { + bar?: string; +} + +const foo: Foo = getFoo(); +const includesBaz: boolean = foo.bar?.includes('baz') ?? false; +``` + +## When Not To Use It + +If you don't care about strict null-checking, then you will not need this rule. + +## Further Reading + +- [`no-non-null-assertion`](https://palantir.github.io/tslint/rules/no-non-null-assertion/) in [TSLint](https://palantir.github.io/tslint/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-parameter-properties.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-parameter-properties.md new file mode 100644 index 000000000..bb2fd2691 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-parameter-properties.md @@ -0,0 +1,367 @@ +# Disallow the use of parameter properties in class constructors (`no-parameter-properties`) + +Parameter properties can be confusing to those new to TypeScript as they are less explicit than other ways +of declaring and initializing class members. + +## Rule Details + +This rule disallows the use of parameter properties in constructors, forcing the user to explicitly +declare all properties in the class. + +## Options + +This rule, in its default state, does not require any argument and would completely disallow the use of parameter properties. +If you would like to allow certain types of parameter properties then you may pass an object with the following options: + +- `allows`, an array containing one or more of the allowed modifiers. Valid values are: + - `readonly`, allows **readonly** parameter properties. + - `private`, allows **private** parameter properties. + - `protected`, allows **protected** parameter properties. + - `public`, allows **public** parameter properties. + - `private readonly`, allows **private readonly** parameter properties. + - `protected readonly`, allows **protected readonly** parameter properties. + - `public readonly`, allows **public readonly** parameter properties. + +### default + +Examples of **incorrect** code for this rule with no options at all: + +```ts +class Foo { + constructor(readonly name: string) {} +} + +class Foo { + constructor(private name: string) {} +} + +class Foo { + constructor(protected name: string) {} +} + +class Foo { + constructor(public name: string) {} +} + +class Foo { + constructor(private readonly name: string) {} +} + +class Foo { + constructor(protected readonly name: string) {} +} + +class Foo { + constructor(public readonly name: string) {} +} +``` + +Examples of **correct** code for this rule with no options at all: + +```ts +class Foo { + constructor(name: string) {} +} +``` + +### readonly + +Examples of **incorrect** code for the `{ "allows": ["readonly"] }` options: + +```ts +class Foo { + constructor(private name: string) {} +} + +class Foo { + constructor(protected name: string) {} +} + +class Foo { + constructor(public name: string) {} +} + +class Foo { + constructor(private readonly name: string) {} +} + +class Foo { + constructor(protected readonly name: string) {} +} + +class Foo { + constructor(public readonly name: string) {} +} +``` + +Examples of **correct** code for the `{ "allows": ["readonly"] }` options: + +```ts +class Foo { + constructor(name: string) {} +} + +class Foo { + constructor(readonly name: string) {} +} +``` + +### private + +Examples of **incorrect** code for the `{ "allows": ["private"] }` options: + +```ts +class Foo { + constructor(readonly name: string) {} +} + +class Foo { + constructor(protected name: string) {} +} + +class Foo { + constructor(public name: string) {} +} + +class Foo { + constructor(private readonly name: string) {} +} + +class Foo { + constructor(protected readonly name: string) {} +} + +class Foo { + constructor(public readonly name: string) {} +} +``` + +Examples of **correct** code for the `{ "allows": ["private"] }` options: + +```ts +class Foo { + constructor(name: string) {} +} + +class Foo { + constructor(private name: string) {} +} +``` + +### protected + +Examples of **incorrect** code for the `{ "allows": ["protected"] }` options: + +```ts +class Foo { + constructor(readonly name: string) {} +} + +class Foo { + constructor(private name: string) {} +} + +class Foo { + constructor(public name: string) {} +} + +class Foo { + constructor(private readonly name: string) {} +} + +class Foo { + constructor(protected readonly name: string) {} +} + +class Foo { + constructor(public readonly name: string) {} +} +``` + +Examples of **correct** code for the `{ "allows": ["protected"] }` options: + +```ts +class Foo { + constructor(name: string) {} +} + +class Foo { + constructor(protected name: string) {} +} +``` + +### public + +Examples of **incorrect** code for the `{ "allows": ["public"] }` options: + +```ts +class Foo { + constructor(readonly name: string) {} +} + +class Foo { + constructor(private name: string) {} +} + +class Foo { + constructor(protected name: string) {} +} + +class Foo { + constructor(private readonly name: string) {} +} + +class Foo { + constructor(protected readonly name: string) {} +} + +class Foo { + constructor(public readonly name: string) {} +} +``` + +Examples of **correct** code for the `{ "allows": ["public"] }` options: + +```ts +class Foo { + constructor(name: string) {} +} + +class Foo { + constructor(public name: string) {} +} +``` + +### private readonly + +Examples of **incorrect** code for the `{ "allows": ["private readonly"] }` options: + +```ts +class Foo { + constructor(readonly name: string) {} +} + +class Foo { + constructor(private name: string) {} +} + +class Foo { + constructor(protected name: string) {} +} + +class Foo { + constructor(public name: string) {} +} + +class Foo { + constructor(protected readonly name: string) {} +} + +class Foo { + constructor(public readonly name: string) {} +} +``` + +Examples of **correct** code for the `{ "allows": ["private readonly"] }` options: + +```ts +class Foo { + constructor(name: string) {} +} + +class Foo { + constructor(private readonly name: string) {} +} +``` + +### protected readonly + +Examples of **incorrect** code for the `{ "allows": ["protected readonly"] }` options: + +```ts +class Foo { + constructor(readonly name: string) {} +} + +class Foo { + constructor(private name: string) {} +} + +class Foo { + constructor(protected name: string) {} +} + +class Foo { + constructor(public name: string) {} +} + +class Foo { + constructor(private readonly name: string) {} +} + +class Foo { + constructor(public readonly name: string) {} +} +``` + +Examples of **correct** code for the `{ "allows": ["protected readonly"] }` options: + +```ts +class Foo { + constructor(name: string) {} +} + +class Foo { + constructor(protected readonly name: string) {} +} +``` + +### public readonly + +Examples of **incorrect** code for the `{ "allows": ["public readonly"] }` options: + +```ts +class Foo { + constructor(readonly name: string) {} +} + +class Foo { + constructor(private name: string) {} +} + +class Foo { + constructor(protected name: string) {} +} + +class Foo { + constructor(public name: string) {} +} + +class Foo { + constructor(private readonly name: string) {} +} + +class Foo { + constructor(protected readonly name: string) {} +} +``` + +Examples of **correct** code for the `{ "allows": ["public readonly"] }` options: + +```ts +class Foo { + constructor(name: string) {} +} + +class Foo { + constructor(public readonly name: string) {} +} +``` + +## When Not To Use It + +If you don't care about the using parameter properties in constructors, then you will not need this rule. + +## Compatibility + +- TSLint: [no-parameter-properties](https://palantir.github.io/tslint/rules/no-parameter-properties/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redeclare.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redeclare.md new file mode 100644 index 000000000..d9e704244 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redeclare.md @@ -0,0 +1,79 @@ +# Disallow variable redeclaration (`no-redeclare`) + +## Rule Details + +This rule extends the base [`eslint/no-redeclare`](https://eslint.org/docs/rules/no-redeclare) rule. +It adds support for TypeScript function overloads, and declaration merging. + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "no-redeclare": "off", + "@typescript-eslint/no-redeclare": ["error"] +} +``` + +## Options + +See [`eslint/no-redeclare` options](https://eslint.org/docs/rules/no-redeclare#options). +This rule adds the following options: + +```ts +interface Options extends BaseNoShadowOptions { + ignoreDeclarationMerge?: boolean; +} + +const defaultOptions: Options = { + ...baseNoShadowDefaultOptions, + ignoreDeclarationMerge: true, +}; +``` + +### `ignoreDeclarationMerge` + +When set to `true`, the rule will ignore declaration merges between the following sets: + +- interface + interface +- namespace + namespace +- class + interface +- class + namespace +- class + interface + namespace +- function + namespace + +Examples of **correct** code with `{ ignoreDeclarationMerge: true }`: + +```ts +interface A { + prop1: 1; +} +interface A { + prop2: 2; +} + +namespace Foo { + export const a = 1; +} +namespace Foo { + export const b = 2; +} + +class Bar {} +namespace Bar {} + +function Baz() {} +namespace Baz {} +``` + +**Note:** Even with this option set to true, this rule will report if you name a type and a variable the same name. **_This is intentional_**. +Declaring a variable and a type and a variable the same is usually an accident, and it can lead to hard-to-understand code. +If you have a rare case where you're intentionally naming a type the same name as a variable, use a disable comment. For example: + +```ts +type something = string; +// eslint-disable-next-line @typescript-eslint/no-redeclare -- intentionally naming the variable the same as the type +const something = 2; +``` + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-redeclare.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-require-imports.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-require-imports.md new file mode 100644 index 000000000..655fc57bd --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-require-imports.md @@ -0,0 +1,34 @@ +# Disallows invocation of `require()` (`no-require-imports`) + +Prefer the newer ES6-style imports over `require()`. + +## Rule Details + +Examples of **incorrect** code for this rule: + +```ts +var lib = require('lib'); +let lib2 = require('lib2'); +var lib5 = require('lib5'), + lib6 = require('lib6'); +import lib8 = require('lib8'); +``` + +Examples of **correct** code for this rule: + +```ts +import { l } from 'lib'; +var lib3 = load('not_an_import'); +var lib4 = lib2.subImport; +var lib7 = 700; +import lib9 = lib2.anotherSubImport; +import lib10 from 'lib10'; +``` + +## When Not To Use It + +If you don't care about TypeScript module syntax, then you will not need this rule. + +## Compatibility + +- TSLint: [no-require-imports](https://palantir.github.io/tslint/rules/no-require-imports/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-shadow.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-shadow.md new file mode 100644 index 000000000..ed241b807 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-shadow.md @@ -0,0 +1,87 @@ +# Disallow variable declarations from shadowing variables declared in the outer scope (`no-shadow`) + +## Rule Details + +This rule extends the base [`eslint/no-shadow`](https://eslint.org/docs/rules/no-shadow) rule. +It adds support for TypeScript's `this` parameters, and adds options for TypeScript features. + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "no-shadow": "off", + "@typescript-eslint/no-shadow": ["error"] +} +``` + +## Options + +See [`eslint/no-shadow` options](https://eslint.org/docs/rules/no-shadow#options). +This rule adds the following options: + +```ts +interface Options extends BaseNoShadowOptions { + ignoreTypeValueShadow?: boolean; + ignoreFunctionTypeParameterNameValueShadow?: boolean; +} + +const defaultOptions: Options = { + ...baseNoShadowDefaultOptions, + ignoreTypeValueShadow: true, + ignoreFunctionTypeParameterNameValueShadow: true, +}; +``` + +### `ignoreTypeValueShadow` + +When set to `true`, the rule will ignore the case when you name a type the same as a variable. + +TypeScript allows types and variables to shadow one-another. This is generally safe because you cannot use variables in type locations without a `typeof` operator, so there's little risk of confusion. + +Examples of **correct** code with `{ ignoreTypeValueShadow: true }`: + +```ts +type Foo = number; +const Foo = 1; + +interface Bar { + prop: number; +} +const Bar = 'test'; +``` + +### `ignoreFunctionTypeParameterNameValueShadow` + +When set to `true`, the rule will ignore the case when you name a function type argument the same as a variable. + +Each of a function type's arguments creates a value variable within the scope of the function type. This is done so that you can reference the type later using the `typeof` operator: + +```ts +type Func = (test: string) => typeof test; + +declare const fn: Func; +const result = fn('str'); // typeof result === string +``` + +This means that function type arguments shadow value variable names in parent scopes: + +```ts +let test = 1; +type TestType = typeof test; // === number +type Func = (test: string) => typeof test; // this "test" references the argument, not the variable + +declare const fn: Func; +const result = fn('str'); // typeof result === string +``` + +If you do not use the `typeof` operator in a function type return type position, you can safely turn this option on. + +Examples of **correct** code with `{ ignoreFunctionTypeParameterNameValueShadow: true }`: + +```ts +const test = 1; +type Func = (test: string) => typeof test; +``` + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-shadow.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-this-alias.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-this-alias.md new file mode 100644 index 000000000..324929e52 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-this-alias.md @@ -0,0 +1,60 @@ +# Disallow aliasing `this` (`no-this-alias`) + +This rule prohibits assigning variables to `this`. + +## Rule Details + +Rationale from TSLint: + +> Assigning a variable to `this` instead of properly using arrow lambdas may be a symptom of pre-ES6 practices +> or not managing scope well. +> +> Instead of storing a reference to `this` and using it inside a `function () {`: +> +> ```js +> const self = this; +> +> setTimeout(function () { +> self.doWork(); +> }); +> ``` +> +> Use `() =>` arrow lambdas, as they preserve `this` scope for you: +> +> ```js +> setTimeout(() => { +> this.doWork(); +> }); +> ``` + +Examples of **incorrect** code for this rule: + +(see the rationale above) + +Examples of **correct** code for this rule: + +(see the rationale above) + +### Options + +You can pass an object option: + +```jsonc +{ + "@typescript-eslint/no-this-alias": [ + "error", + { + "allowDestructuring": true, // Allow `const { props, state } = this`; false by default + "allowedNames": ["self"] // Allow `const self = this`; `[]` by default + } + ] +} +``` + +## When Not To Use It + +If you need to assign `this` to variables, you shouldn’t use this rule. + +## Related to + +- TSLint: [`no-this-assignment`](https://palantir.github.io/tslint/rules/no-this-assignment/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-throw-literal.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-throw-literal.md new file mode 100644 index 000000000..3b7ee9c2d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-throw-literal.md @@ -0,0 +1,84 @@ +# Disallow throwing literals as exceptions (`no-throw-literal`) + +It is considered good practice to only `throw` the `Error` object itself or an object using the `Error` object as base objects for user-defined exceptions. +The fundamental benefit of `Error` objects is that they automatically keep track of where they were built and originated. + +This rule restricts what can be thrown as an exception. When it was first created, it only prevented literals from being thrown (hence the name), but it has now been expanded to only allow expressions which have a possibility of being an `Error` object. + +## Rule Details + +This rule is aimed at maintaining consistency when throwing exception by disallowing to throw literals and other expressions which cannot possibly be an `Error` object. + +Examples of **incorrect** code for this rule: + +```ts +/*eslint @typescript-eslint/no-throw-literal: "error"*/ + +throw 'error'; + +throw 0; + +throw undefined; + +throw null; + +const err = new Error(); +throw 'an ' + err; + +const err = new Error(); +throw `${err}`; + +const err = ''; +throw err; + +function err() { + return ''; +} +throw err(); + +const foo = { + bar: '', +}; +throw foo.bar; +``` + +Examples of **correct** code for this rule: + +```ts +/*eslint @typescript-eslint/no-throw-literal: "error"*/ + +throw new Error(); + +throw new Error("error"); + +const e = new Error("error"); +throw e; + +try { + throw new Error("error"); +} catch (e) { + throw e; +} + +const err = new Error(); +throw err; + +function err() { + return new Error(); +} +throw err(); + +const foo = { + bar: new Error(); +} +throw foo.bar; + +class CustomError extends Error { + // ... +}; +throw new CustomError(); +``` + +--- + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-throw-literal.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-type-alias.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-type-alias.md new file mode 100644 index 000000000..5b720b2f3 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-type-alias.md @@ -0,0 +1,569 @@ +# Disallow the use of type aliases (`no-type-alias`) + +In TypeScript, type aliases serve three purposes: + +- Aliasing other types so that we can refer to them using a simpler name. + +```ts +// this... +type Person = { + firstName: string, + lastName: string, + age: number +}; + +function addPerson(person : Person) { ... } + +// is easier to read than this... +function addPerson(person : { firstName: string, lastName: string, age: number}) { ... } +``` + +- Act sort of like an interface, providing a set of methods and properties that must exist + in the objects implementing the type. + +```ts +type Person = { + firstName: string, + lastName: string, + age: number, + walk: () => void, + talk: () => void +}; + +// you know person will have 3 properties and 2 methods, +// because the structure has already been defined. +var person : Person = { ... } + +// so we can be sure that this will work +person.walk(); +``` + +- Act like mapping tools between types to allow quick modifications. + +```ts +type Immutable = { readonly [P in keyof T]: T[P] }; + +type Person = { + name: string; + age: number; +}; + +type ImmutablePerson = Immutable; + +var person: ImmutablePerson = { name: 'John', age: 30 }; +person.name = 'Brad'; // error, readonly property +``` + +When aliasing, the type alias does not create a new type, it just creates a new name +to refer to the original type. So aliasing primitives and other simple types, tuples, unions +or intersections can some times be redundant. + +```ts +// this doesn't make much sense +type myString = string; +``` + +On the other hand, using a type alias as an interface can limit your ability to: + +- Reuse your code: interfaces can be extended or implemented by other types. Type aliases cannot. +- Debug your code: interfaces create a new name, so is easy to identify the base type of an object + while debugging the application. + +Finally, mapping types is an advanced technique and leaving it open can quickly become a pain point +in your application. + +## Rule Details + +This rule disallows the use of type aliases in favor of interfaces +and simplified types (primitives, tuples, unions, intersections, etc). + +## Options + +This rule, in its default state, does not require any argument. If you would like to enable one +or more of the following you may pass an object with the options set as follows: + +- `allowAliases` set to `"always"` will allow you to do aliasing (Defaults to `"never"`). +- `allowCallbacks` set to `"always"` will allow you to use type aliases with callbacks (Defaults to `"never"`) +- `allowConditionalTypes` set to `"always"` will allow you to use type aliases with conditional types (Defaults to `"never"`) +- `allowConstructors` set to `"always"` will allow you to use type aliases with constructors (Defaults to `"never"`) +- `allowLiterals` set to `"always"` will allow you to use type aliases with literal objects (Defaults to `"never"`) +- `allowMappedTypes` set to `"always"` will allow you to use type aliases as mapping tools (Defaults to `"never"`) +- `allowTupleTypes` set to `"always"` will allow you to use type aliases with tuples (Defaults to `"never"`) + +### `allowAliases` + +This applies to primitive types and reference types. + +The setting accepts the following values: + +- `"always"` or `"never"` to active or deactivate the feature. +- `"in-unions"`, allows aliasing in union statements, e.g. `type Foo = string | string[];` +- `"in-intersections"`, allows aliasing in intersection statements, e.g. `type Foo = string & string[];` +- `"in-unions-and-intersections"`, allows aliasing in union and/or intersection statements. + +Examples of **correct** code for the `{ "allowAliases": "always" }` options: + +```ts +// primitives +type Foo = 'a'; + +type Foo = 'a' | 'b'; + +type Foo = string; + +type Foo = string | string[]; + +type Foo = string & string[]; + +// reference types +interface Bar {} +class Baz implements Bar {} + +type Foo = Bar; + +type Foo = Bar | Baz; + +type Foo = Bar & Baz; +``` + +Examples of **incorrect** code for the `{ "allowAliases": "in-unions" }` option: + +```ts +// primitives +type Foo = 'a'; + +type Foo = string; + +type Foo = string & string[]; + +// reference types +interface Bar {} +class Baz implements Bar {} + +type Foo = Bar; + +type Foo = Bar & Baz; +``` + +Examples of **correct** code for the `{ "allowAliases": "in-unions" }` option: + +```ts +// primitives +type Foo = 'a' | 'b'; + +type Foo = string | string[]; + +// reference types +interface Bar {} +class Baz implements Bar {} + +type Foo = Bar | Baz; +``` + +Examples of **incorrect** code for the `{ "allowAliases": "in-intersections" }` option: + +```ts +// primitives +type Foo = 'a'; + +type Foo = 'a' | 'b'; + +type Foo = string; + +type Foo = string | string[]; + +// reference types +interface Bar {} +class Baz implements Bar {} + +type Foo = Bar; + +type Foo = Bar | Baz; +``` + +Examples of **correct** code for the `{ "allowAliases": "in-intersections" }` option: + +```ts +// primitives +type Foo = string & string[]; + +// reference types +interface Bar {} +class Baz implements Bar {} + +type Foo = Bar & Baz; +``` + +Examples of **incorrect** code for the `{ "allowAliases": "in-unions-and-intersections" }` option: + +```ts +// primitives +type Foo = 'a'; + +type Foo = string; + +// reference types +interface Bar {} +class Baz implements Bar {} + +type Foo = Bar; +``` + +Examples of **correct** code for the `{ "allowAliases": "in-unions-and-intersections" }` option: + +```ts +// primitives +type Foo = 'a' | 'b'; + +type Foo = string | string[]; + +type Foo = string & string[]; + +// reference types +interface Bar {} +class Baz implements Bar {} + +type Foo = Bar | Baz; + +type Foo = Bar & Baz; +``` + +### `allowCallbacks` + +This applies to function types. + +The setting accepts the following values: + +- `"always"` or `"never"` to active or deactivate the feature. + +Examples of **correct** code for the `{ "allowCallbacks": "always" }` option: + +```ts +type Foo = () => void; + +type Foo = (name: string) => string; + +class Person {} + +type Foo = (name: string, age: number) => string | Person; + +type Foo = (name: string, age: number) => string & Person; +``` + +### `allowConditionalTypes` + +This applies to conditional types. + +Examples of **correct** code for the `{ "allowConditionalTypes": "always" }` option: + +```ts +type Foo = T extends number ? number : null; +``` + +### `allowConstructors` + +This applies to constructor types. + +The setting accepts the following values: + +- `"always"` or `"never"` to active or deactivate the feature. + +Examples of **correct** code for the `{ "allowConstructors": "always" }` option: + +```ts +type Foo = new () => void; +``` + +### `allowLiterals` + +This applies to literal types (`type Foo = { ... }`). + +The setting accepts the following options: + +- `"always"` or `"never"` to active or deactivate the feature. +- `"in-unions"`, allows literals in union statements, e.g. `type Foo = string | string[];` +- `"in-intersections"`, allows literals in intersection statements, e.g. `type Foo = string & string[];` +- `"in-unions-and-intersections"`, allows literals in union and/or intersection statements. + +Examples of **correct** code for the `{ "allowLiterals": "always" }` options: + +```ts +type Foo = {}; + +type Foo = { + name: string; + age: number; +}; + +type Foo = { + name: string; + age: number; + walk: (miles: number) => void; +}; + +type Foo = { name: string } | { age: number }; + +type Foo = { name: string } & { age: number }; +``` + +Examples of **incorrect** code for the `{ "allowLiterals": "in-unions" }` option: + +```ts +type Foo = {}; + +type Foo = { + name: string; + age: number; +}; + +type Foo = { + name: string; + age: number; + walk: (miles: number) => void; +}; + +type Foo = { name: string } & { age: number }; +``` + +Examples of **correct** code for the `{ "allowLiterals": "in-unions" }` option: + +```ts +type Foo = { name: string } | { age: number }; +``` + +Examples of **incorrect** code for the `{ "allowLiterals": "in-intersections" }` option: + +```ts +type Foo = {}; + +type Foo = { + name: string; + age: number; +}; + +type Foo = { + name: string; + age: number; + walk: (miles: number) => void; +}; + +type Foo = { name: string } | { age: number }; +``` + +Examples of **correct** code for the `{ "allowLiterals": "in-intersections" }` option: + +```ts +type Foo = { name: string } & { age: number }; +``` + +Examples of **incorrect** code for the `{ "allowLiterals": "in-unions-and-intersections" }` option: + +```ts +type Foo = {}; + +type Foo = { + name: string; + age: number; +}; + +type Foo = { + name: string; + age: number; + walk: (miles: number) => void; +}; +``` + +Examples of **correct** code for the `{ "allowLiterals": "in-unions-and-intersections" }` option: + +```ts +type Foo = { name: string } | { age: number }; + +type Foo = { name: string } & { age: number }; +``` + +### `allowMappedTypes` + +This applies to literal types. + +The setting accepts the following values: + +- `"always"` or `"never"` to active or deactivate the feature. +- `"in-unions"`, allows aliasing in union statements, e.g. `type Foo = string | string[];` +- `"in-intersections"`, allows aliasing in intersection statements, e.g. `type Foo = string & string[];` +- `"in-unions-and-intersections"`, allows aliasing in union and/or intersection statements. + +Examples of **correct** code for the `{ "allowMappedTypes": "always" }` options: + +```ts +type Foo = { readonly [P in keyof T]: T[P] }; + +type Foo = { [P in keyof T]?: T[P] }; + +type Foo = + | { readonly [P in keyof T]: T[P] } + | { readonly [P in keyof U]: U[P] }; + +type Foo = { [P in keyof T]?: T[P] } | { [P in keyof U]?: U[P] }; + +type Foo = { readonly [P in keyof T]: T[P] } & + { readonly [P in keyof U]: U[P] }; + +type Foo = { [P in keyof T]?: T[P] } & { [P in keyof U]?: U[P] }; +``` + +Examples of **incorrect** code for the `{ "allowMappedTypes": "in-unions" }` option: + +```ts +type Foo = { readonly [P in keyof T]: T[P] }; + +type Foo = { [P in keyof T]?: T[P] }; + +type Foo = { readonly [P in keyof T]: T[P] } & + { readonly [P in keyof U]: U[P] }; + +type Foo = { [P in keyof T]?: T[P] } & { [P in keyof U]?: U[P] }; +``` + +Examples of **correct** code for the `{ "allowMappedTypes": "in-unions" }` option: + +```ts +type Foo = + | { readonly [P in keyof T]: T[P] } + | { readonly [P in keyof U]: U[P] }; + +type Foo = { [P in keyof T]?: T[P] } | { [P in keyof U]?: U[P] }; +``` + +Examples of **incorrect** code for the `{ "allowMappedTypes": "in-intersections" }` option: + +```ts +type Foo = { readonly [P in keyof T]: T[P] }; + +type Foo = { [P in keyof T]?: T[P] }; + +type Foo = + | { readonly [P in keyof T]: T[P] } + | { readonly [P in keyof U]: U[P] }; + +type Foo = { [P in keyof T]?: T[P] } | { [P in keyof U]?: U[P] }; +``` + +Examples of **correct** code for the `{ "allowMappedTypes": "in-intersections" }` option: + +```ts +type Foo = { readonly [P in keyof T]: T[P] } & + { readonly [P in keyof U]: U[P] }; + +type Foo = { [P in keyof T]?: T[P] } & { [P in keyof U]?: U[P] }; +``` + +Examples of **incorrect** code for the `{ "allowMappedTypes": "in-unions-and-intersections" }` option: + +```ts +type Foo = { readonly [P in keyof T]: T[P] }; + +type Foo = { [P in keyof T]?: T[P] }; +``` + +Examples of **correct** code for the `{ "allowMappedTypes": "in-unions-and-intersections" }` option: + +```ts +type Foo = + | { readonly [P in keyof T]: T[P] } + | { readonly [P in keyof U]: U[P] }; + +type Foo = { [P in keyof T]?: T[P] } | { [P in keyof U]?: U[P] }; + +type Foo = { readonly [P in keyof T]: T[P] } & + { readonly [P in keyof U]: U[P] }; + +type Foo = { [P in keyof T]?: T[P] } & { [P in keyof U]?: U[P] }; +``` + +### `allowTupleTypes` + +This applies to tuple types (`type Foo = [number]`). + +The setting accepts the following options: + +- `"always"` or `"never"` to active or deactivate the feature. +- `"in-unions"`, allows tuples in union statements, e.g. `type Foo = [string] | [string, string];` +- `"in-intersections"`, allows tuples in intersection statements, e.g. `type Foo = [string] & [string, string];` +- `"in-unions-and-intersections"`, allows tuples in union and/or intersection statements. + +Examples of **correct** code for the `{ "allowTupleTypes": "always" }` options: + +```ts +type Foo = [number]; + +type Foo = [number] | [number, number]; + +type Foo = [number] & [number, number]; + +type Foo = [number] | ([number, number] & [string, string]); +``` + +Examples of **incorrect** code for the `{ "allowTupleTypes": "in-unions" }` option: + +```ts +type Foo = [number]; + +type Foo = [number] & [number, number]; + +type Foo = [string] & [number]; +``` + +Examples of **correct** code for the `{ "allowTupleTypes": "in-unions" }` option: + +```ts +type Foo = [number] | [number, number]; + +type Foo = [string] | [number]; +``` + +Examples of **incorrect** code for the `{ "allowTupleTypes": "in-intersections" }` option: + +```ts +type Foo = [number]; + +type Foo = [number] | [number, number]; + +type Foo = [string] | [number]; +``` + +Examples of **correct** code for the `{ "allowTupleTypes": "in-intersections" }` option: + +```ts +type Foo = [number] & [number, number]; + +type Foo = [string] & [number]; +``` + +Examples of **incorrect** code for the `{ "allowTupleTypes": "in-unions-and-intersections" }` option: + +```ts +type Foo = [number]; + +type Foo = [string]; +``` + +Examples of **correct** code for the `{ "allowLiterals": "in-unions-and-intersections" }` option: + +```ts +type Foo = [number] & [number, number]; + +type Foo = [string] | [number]; +``` + +## When Not To Use It + +When you can't express some shape with an interface or you need to use a union, tuple type, +callback, etc. that would cause the code to be unreadable or impractical. + +## Further Reading + +- [Advance Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html) + +## Related to + +- TSLint: [interface-over-type-literal](https://palantir.github.io/tslint/rules/interface-over-type-literal/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md new file mode 100644 index 000000000..d600bb793 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md @@ -0,0 +1,134 @@ +# Flags unnecessary equality comparisons against boolean literals (`no-unnecessary-boolean-literal-compare`) + +Comparing boolean values to boolean literals is unnecessary, those comparisons result in the same booleans. Using the boolean values directly, or via a unary negation (`!value`), is more concise and clearer. + +## Rule Details + +This rule ensures that you do not include unnecessary comparisons with boolean literals. +A comparison is considered unnecessary if it checks a boolean literal against any variable with just the `boolean` type. +A comparison is **_not_** considered unnecessary if the type is a union of booleans (`string | boolean`, `someObject | boolean`). + +**Note**: Throughout this page, only strict equality (`===` and `!==`) are +used in the examples. However, the implementation of the rule does not +distinguish between strict and loose equality. Any example below that uses +`===` would be treated the same way if `==` was used, and any example below +that uses `!==` would be treated the same way if `!=` was used. + +Examples of **incorrect** code for this rule: + +```ts +declare const someCondition: boolean; +if (someCondition === true) { +} +``` + +Examples of **correct** code for this rule + +```ts +declare const someCondition: boolean; +if (someCondition) { +} + +declare const someObjectBoolean: boolean | Record; +if (someObjectBoolean === true) { +} + +declare const someStringBoolean: boolean | string; +if (someStringBoolean === true) { +} +``` + +## Options + +The rule accepts an options object with the following properties. + +```ts +type Options = { + // if false, comparisons between a nullable boolean variable to `true` will be checked and fixed + allowComparingNullableBooleansToTrue?: boolean; + // if false, comparisons between a nullable boolean variable to `false` will be checked and fixed + allowComparingNullableBooleansToFalse?: boolean; +}; +``` + +### Defaults + +This rule always checks comparisons between a boolean variable and a boolean +literal. Comparisons between nullable boolean variables and boolean literals +are **not** checked by default. + +```ts +const defaults = { + allowComparingNullableBooleansToTrue: true, + allowComparingNullableBooleansToFalse: true, +}; +``` + +### `allowComparingNullableBooleansToTrue` + +Examples of **incorrect** code for this rule with `{ allowComparingNullableBooleansToTrue: false }`: + +```ts +declare const someUndefinedCondition: boolean | undefined; +if (someUndefinedCondition === true) { +} + +declare const someNullCondition: boolean | null; +if (someNullCondition !== true) { +} +``` + +Examples of **correct** code for this rule with `{ allowComparingNullableBooleansToTrue: false }`: + +```ts +declare const someUndefinedCondition: boolean | undefined; +if (someUndefinedCondition) { +} + +declare const someNullCondition: boolean | null; +if (!someNullCondition) { +} +``` + +### `allowComparingNullableBooleansToFalse` + +Examples of **incorrect** code for this rule with `{ allowComparingNullableBooleansToFalse: false }`: + +```ts +declare const someUndefinedCondition: boolean | undefined; +if (someUndefinedCondition === false) { +} + +declare const someNullCondition: boolean | null; +if (someNullCondition !== false) { +} +``` + +Examples of **correct** code for this rule with `{ allowComparingNullableBooleansToFalse: false }`: + +```ts +declare const someUndefinedCondition: boolean | undefined; +if (someUndefinedCondition ?? true) { +} + +declare const someNullCondition: boolean | null; +if (!(someNullCondition ?? true)) { +} +``` + +## Fixer + +| Comparison | Fixer Output | Notes | +| :----------------------------: | ------------------------------- | ----------------------------------------------------------------------------------- | +| `booleanVar === true` | `booleanLiteral` | | +| `booleanVar !== true` | `!booleanLiteral` | | +| `booleanVar === false` | `!booleanLiteral` | | +| `booleanVar !== false` | `booleanLiteral` | | +| `nullableBooleanVar === true` | `nullableBooleanVar` | Only checked/fixed if the `allowComparingNullableBooleansToTrue` option is `false` | +| `nullableBooleanVar !== true` | `!nullableBooleanVar` | Only checked/fixed if the `allowComparingNullableBooleansToTrue` option is `false` | +| `nullableBooleanVar === false` | `nullableBooleanVar ?? true` | Only checked/fixed if the `allowComparingNullableBooleansToFalse` option is `false` | +| `nullableBooleanVar !== false` | `!(nullableBooleanVar ?? true)` | Only checked/fixed if the `allowComparingNullableBooleansToFalse` option is `false` | + +## Related to + +- TSLint: [no-boolean-literal-compare](https://palantir.github.io/tslint/rules/no-boolean-literal-compare) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-condition.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-condition.md new file mode 100644 index 000000000..bff0f548f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-condition.md @@ -0,0 +1,107 @@ +# Prevents conditionals where the type is always truthy or always falsy (`no-unnecessary-condition`) + +Any expression being used as a condition must be able to evaluate as truthy or falsy in order to be considered "necessary". Conversely, any expression that always evaluates to truthy or always evaluates to falsy, as determined by the type of the expression, is considered unnecessary and will be flagged by this rule. + +The following expressions are checked: + +- Arguments to the `&&`, `||` and `?:` (ternary) operators +- Conditions for `if`, `for`, `while`, and `do-while` statements +- Base values of optional chain expressions + +Examples of **incorrect** code for this rule: + +```ts +function head(items: T[]) { + // items can never be nullable, so this is unnecessary + if (items) { + return items[0].toUpperCase(); + } +} + +function foo(arg: 'bar' | 'baz') { + // arg is never nullable or empty string, so this is unnecessary + if (arg) { + } +} + +function bar(arg: string) { + // arg can never be nullish, so ?. is unnecessary + return arg?.length; +} + +// Checks array predicate return types, where possible +[ + [1, 2], + [3, 4], +].filter(t => t); // number[] is always truthy +``` + +Examples of **correct** code for this rule: + +```ts +function head(items: T[]) { + // Necessary, since items.length might be 0 + if (items.length) { + return items[0].toUpperCase(); + } +} + +function foo(arg: string) { + // Necessary, since foo might be ''. + if (arg) { + } +} + +function bar(arg?: string | null) { + // Necessary, since arg might be nullish + return arg?.length; +} + +[0, 1, 2, 3].filter(t => t); // number can be truthy or falsy +``` + +## Options + +```ts +type Options = { + // if true, the rule will ignore constant loop conditions + allowConstantLoopConditions?: boolean; + // if true, the rule will not error when running with a tsconfig that has strictNullChecks turned **off** + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing?: boolean; +}; + +const defaultOptions: Options = { + allowConstantLoopConditions: false, + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false, +}; +``` + +### `allowConstantLoopConditions` + +Example of correct code for `{ allowConstantLoopConditions: true }`: + +```ts +while (true) {} +for (; true; ) {} +do {} while (true); +``` + +### `allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing` + +If this is set to `false`, then the rule will error on every file whose `tsconfig.json` does _not_ have the `strictNullChecks` compiler option (or `strict`) set to `true`. + +Without `strictNullChecks`, TypeScript essentially erases `undefined` and `null` from the types. This means when this rule inspects the types from a variable, **it will not be able to tell that the variable might be `null` or `undefined`**, which essentially makes this rule useless. + +You should be using `strictNullChecks` to ensure complete type-safety in your codebase. + +If for some reason you cannot turn on `strictNullChecks`, but still want to use this rule - you can use this option to allow it - but know that the behavior of this rule is _undefined_ with the compiler option turned off. We will not accept bug reports if you are using this option. + +## When Not To Use It + +The main downside to using this rule is the need for type information. + +## Related To + +- ESLint: [no-constant-condition](https://eslint.org/docs/rules/no-constant-condition) - `no-unnecessary-condition` is essentially a stronger version of `no-constant-condition`, but requires type information. + +- [strict-boolean-expressions](./strict-boolean-expressions.md) - a more opinionated version of `no-unnecessary-condition`. `strict-boolean-expressions` enforces a specific code style, while `no-unnecessary-condition` is about correctness. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-qualifier.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-qualifier.md new file mode 100644 index 000000000..56aba181c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-qualifier.md @@ -0,0 +1,79 @@ +# Warns when a namespace qualifier is unnecessary (`no-unnecessary-qualifier`) + +## Rule Details + +This rule aims to let users know when a namespace or enum qualifier is unnecessary, +whether used for a type or for a value. + +Examples of **incorrect** code for this rule: + +```ts +namespace A { + export type B = number; + const x: A.B = 3; +} +``` + +```ts +namespace A { + export const x = 3; + export const y = A.x; +} +``` + +```ts +enum A { + B, + C = A.B, +} +``` + +```ts +namespace A { + export namespace B { + export type T = number; + const x: A.B.T = 3; + } +} +``` + +Examples of **correct** code for this rule: + +```ts +namespace X { + export type T = number; +} + +namespace Y { + export const x: X.T = 3; +} +``` + +```ts +enum A { + X, + Y, +} + +enum B { + Z = A.X, +} +``` + +```ts +namespace X { + export type T = number; + namespace Y { + type T = string; + const x: X.T = 0; + } +} +``` + +## When Not To Use It + +If you don't care about having unneeded namespace or enum qualifiers, then you don't need to use this rule. + +## Further Reading + +- TSLint: [no-unnecessary-qualifier](https://palantir.github.io/tslint/rules/no-unnecessary-qualifier/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md new file mode 100644 index 000000000..f5caaa42c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md @@ -0,0 +1,53 @@ +# Enforces that type arguments will not be used if not required (`no-unnecessary-type-arguments`) + +Warns if an explicitly specified type argument is the default for that type parameter. + +## Rule Details + +Type parameters in TypeScript may specify a default value. +For example: + +```ts +function f() {} +``` + +It is redundant to provide an explicit type parameter equal to that default. + +Examples of **incorrect** code for this rule: + +```ts +function f() {} +f(); + +function g() {} +g(); + +class C {} +function h(c: C) {} +new C(); +class D extends C {} + +interface I {} +class Impl implements I {} +``` + +Examples of **correct** code for this rule: + +```ts +function f() {} +f(); + +function g() {} +g(); + +class C {} +new C(); +class D extends C {} + +interface I {} +class Impl implements I {} +``` + +## Related to + +- TSLint: [use-default-type-parameter](https://palantir.github.io/tslint/rules/use-default-type-parameter) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md new file mode 100644 index 000000000..4464b6483 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md @@ -0,0 +1,73 @@ +# Warns if a type assertion does not change the type of an expression (`no-unnecessary-type-assertion`) + +This rule prohibits using a type assertion that does not change the type of an expression. + +## Rule Details + +This rule aims to prevent unnecessary type assertions. + +Examples of **incorrect** code for this rule: + +```ts +const foo = 3; +const bar = foo!; +``` + +```ts +const foo = <3>3; +``` + +```ts +type Foo = 3; +const foo = 3; +``` + +```ts +type Foo = 3; +const foo = 3 as Foo; +``` + +```ts +function foo(x: number): number { + return x!; // unnecessary non-null +} +``` + +Examples of **correct** code for this rule: + +```ts +const foo = 3; +``` + +```ts +const foo = 3 as number; +``` + +```ts +const foo = 'foo' as const; +``` + +```ts +function foo(x: number | undefined): number { + return x!; +} +``` + +### Options + +This rule optionally takes an object with a single property `typesToIgnore`, which can be set to a list of type names to ignore. + +For example, with `@typescript-eslint/no-unnecessary-type-assertion: ["error", { typesToIgnore: ['Foo'] }]`, the following is **correct** code": + +```ts +type Foo = 3; +const foo: Foo = 3; +``` + +## When Not To Use It + +If you don't care about having no-op type assertions in your code, then you can turn off this rule. + +## Related to + +- TSLint: ['no-unnecessary-type-assertion`](https://palantir.github.io/tslint/rules/no-unnecessary-type-assertion/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-assignment.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-assignment.md new file mode 100644 index 000000000..64207e536 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-assignment.md @@ -0,0 +1,72 @@ +# Disallows assigning any to variables and properties (`no-unsafe-assignment`) + +Despite your best intentions, the `any` type can sometimes leak into your codebase. +Assigning an `any` typed value to a variable can be hard to pick up on, particularly if it leaks in from an external library. Operations on the variable will not be checked at all by TypeScript, so it creates a potential safety hole, and source of bugs in your codebase. + +## Rule Details + +This rule disallows assigning `any` to a variable, and assigning `any[]` to an array destructuring. +This rule also compares the assigned type to the variable's type to ensure you don't assign an unsafe `any` in a generic position to a receiver that's expecting a specific type. For example, it will error if you assign `Set` to a variable declared as `Set`. + +Examples of **incorrect** code for this rule: + +```ts +const x = 1 as any, + y = 1 as any; +const [x] = 1 as any; +const [x] = [] as any[]; +const [x] = [1 as any]; +[x] = [1] as [any]; + +function foo(a = 1 as any) {} +class Foo { + constructor(private a = 1 as any) {} +} +class Foo { + private a = 1 as any; +} + +// generic position examples +const x: Set = new Set(); +const x: Map = new Map(); +const x: Set = new Set(); +const x: Set>> = new Set>>(); +``` + +Examples of **correct** code for this rule: + +```ts +const x = 1, + y = 1; +const [x] = [1]; +[x] = [1] as [number]; + +function foo(a = 1) {} +class Foo { + constructor(private a = 1) {} +} +class Foo { + private a = 1; +} + +// generic position examples +const x: Set = new Set(); +const x: Map = new Map(); +const x: Set = new Set(); +const x: Set>> = new Set>>(); +``` + +There are cases where the rule allows assignment of `any` to `unknown`. + +Example of `any` to `unknown` assignment that are allowed. + +```ts +const x: unknown = y as any; +const x: unknown[] = y as any[]; +const x: Set = y as Set; +``` + +## Related to + +- [`no-explicit-any`](./no-explicit-any.md) +- TSLint: [`no-unsafe-any`](https://palantir.github.io/tslint/rules/no-unsafe-any/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-call.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-call.md new file mode 100644 index 000000000..1000e5921 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-call.md @@ -0,0 +1,48 @@ +# Disallows calling an any type value (`no-unsafe-call`) + +Despite your best intentions, the `any` type can sometimes leak into your codebase. +The arguments to, and return value of calling an `any` typed variable are not checked at all by TypeScript, so it creates a potential safety hole, and source of bugs in your codebase. + +## Rule Details + +This rule disallows calling any variable that is typed as `any`. + +Examples of **incorrect** code for this rule: + +```ts +declare const anyVar: any; +declare const nestedAny: { prop: any }; + +anyVar(); +anyVar.a.b(); + +nestedAny.prop(); +nestedAny.prop['a'](); + +new anyVar(); +new nestedAny.prop(); + +anyVar`foo`; +nestedAny.prop`foo`; +``` + +Examples of **correct** code for this rule: + +```ts +declare const typedVar: () => void; +declare const typedNested: { prop: { a: () => void } }; + +typedVar(); +typedNested.prop.a(); + +(() => {})(); + +new Map(); + +String.raw`foo`; +``` + +## Related to + +- [`no-explicit-any`](./no-explicit-any.md) +- TSLint: [`no-unsafe-any`](https://palantir.github.io/tslint/rules/no-unsafe-any/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-member-access.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-member-access.md new file mode 100644 index 000000000..2c2d8831f --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-member-access.md @@ -0,0 +1,54 @@ +# Disallows member access on any typed variables (`no-unsafe-member-access`) + +Despite your best intentions, the `any` type can sometimes leak into your codebase. +Member access on `any` typed variables is not checked at all by TypeScript, so it creates a potential safety hole, and source of bugs in your codebase. + +## Rule Details + +This rule disallows member access on any variable that is typed as `any`. + +Examples of **incorrect** code for this rule: + +```ts +declare const anyVar: any; +declare const nestedAny: { prop: any }; + +anyVar.a; +anyVar.a.b; +anyVar['a']; +anyVar['a']['b']; + +nestedAny.prop.a; +nestedAny.prop['a']; + +const key = 'a'; +nestedAny.prop[key]; + +// Using an any to access a member is unsafe +const arr = [1, 2, 3]; +arr[anyVar]; +nestedAny[anyVar]; +``` + +Examples of **correct** code for this rule: + +```ts +declare const properlyTyped: { prop: { a: string } }; + +nestedAny.prop.a; +nestedAny.prop['a']; + +const key = 'a'; +nestedAny.prop[key]; + +const arr = [1, 2, 3]; +arr[1]; +const idx = 1; +arr[idx]; +arr[idx++]; +``` + +## Related to + +- [`no-explicit-any`](./no-explicit-any.md) +- TSLint: [`no-unsafe-any`](https://palantir.github.io/tslint/rules/no-unsafe-any/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-return.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-return.md new file mode 100644 index 000000000..9810be3cf --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-return.md @@ -0,0 +1,89 @@ +# Disallows returning any from a function (`no-unsafe-return`) + +Despite your best intentions, the `any` type can sometimes leak into your codebase. +Returned `any` typed values not checked at all by TypeScript, so it creates a potential safety hole, and source of bugs in your codebase. + +## Rule Details + +This rule disallows returning `any` or `any[]` from a function. +This rule also compares the return type to the function's declared/inferred return type to ensure you don't return an unsafe `any` in a generic position to a receiver that's expecting a specific type. For example, it will error if you return `Set` from a function declared as returning `Set`. + +Examples of **incorrect** code for this rule: + +```ts +function foo1() { + return 1 as any; +} +function foo2() { + return Object.create(null); +} +const foo3 = () => { + return 1 as any; +}; +const foo4 = () => Object.create(null); + +function foo5() { + return [] as any[]; +} +function foo6() { + return [] as Array; +} +function foo7() { + return [] as readonly any[]; +} +function foo8() { + return [] as Readonly; +} +const foo9 = () => { + return [] as any[]; +}; +const foo10 = () => [] as any[]; + +const foo11 = (): string[] => [1, 2, 3] as any[]; + +// generic position examples +function assignability1(): Set { + return new Set([1]); +} +type TAssign = () => Set; +const assignability2: TAssign = () => new Set([true]); +``` + +Examples of **correct** code for this rule: + +```ts +function foo1() { + return 1; +} +function foo2() { + return Object.create(null) as Record; +} + +const foo3 = () => []; +const foo4 = () => ['a']; + +function assignability1(): Set { + return new Set(['foo']); +} +type TAssign = () => Set; +const assignability2: TAssign = () => new Set(['foo']); +``` + +There are cases where the rule allows to return `any` to `unknown`. + +Examples of `any` to `unknown` return that are allowed. + +```ts +function foo1(): unknown { + return JSON.parse(singleObjString); // Return type for JSON.parse is any. +} + +function foo2(): unknown[] { + return [] as any[]; +} +``` + +## Related to + +- [`no-explicit-any`](./no-explicit-any.md) +- TSLint: [`no-unsafe-any`](https://palantir.github.io/tslint/rules/no-unsafe-any/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-expressions.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-expressions.md new file mode 100644 index 000000000..cb61c2ed0 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-expressions.md @@ -0,0 +1,22 @@ +# Disallow unused expressions (`no-unused-expressions`) + +## Rule Details + +This rule extends the base [`eslint/no-unused-expressions`](https://eslint.org/docs/rules/no-unused-expressions) rule. +It adds support for optional call expressions `x?.()`, and directive in module declarations. + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "no-unused-expressions": "off", + "@typescript-eslint/no-unused-expressions": ["error"] +} +``` + +## Options + +See [`eslint/no-unused-expressions` options](https://eslint.org/docs/rules/no-unused-expressions#options). + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-unused-expressions.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-vars-experimental.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-vars-experimental.md new file mode 100644 index 000000000..918cbc595 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-vars-experimental.md @@ -0,0 +1,115 @@ +# Disallow unused variables and arguments (`no-unused-vars-experimental`) + +Variables that are declared and not used anywhere in the code are most likely an error due to incomplete refactoring. Such variables take up space in the code and can lead to confusion by readers. + +## Rule Details + +This rule leverages the TypeScript compiler's unused variable checks to report. This means that with all rule options set to `false`, it should report the same errors as if you used both the `noUnusedLocals` and `noUnusedParameters` compiler options. + +This rule is vastly different to, and maintains no compatibility with the base ESLint version of the rule. + +### Limitations + +There are two limitations to this rule when compared with ESLint's `no-unused-vars` rule, which are imposed by the fact that it directly uses TypeScript's implementation. + +1. This rule only works on files that TypeScript deems is a module (i.e. it has an `import` or an `export` statement). +2. The rule is significantly less configurable, as it cannot deviate too far from the base implementation. + +## Supported Nodes + +This rule supports checks on the following features: + +- Declarations: + - `var` / `const` / `let` + - `function` + - `class` + - `enum` + - `interface` + - `type` +- Class methods +- Class properties and parameter properties +- Function parameters +- Generic type parameters +- Import statements + +## Options + +```ts +type Options = { + ignoredNamesRegex?: string | boolean; + ignoreArgsIfArgsAfterAreUsed?: boolean; +}; + +const defaultOptions: Options = { + ignoredNamesRegex: '^_', + ignoreArgsIfArgsAfterAreUsed: false, +}; +``` + +### `ignoredNamesRegex` + +This option accepts a regex string to match names against. +Any matched names will be ignored and have no errors reported. +If you set it to false, it will never ignore any names. + +The default value is `'^_'` (i.e. matches any name prefixed with an underscore). + +Examples of valid code with `{ variables: { ignoredNamesRegex: '^_' } }`. + +```ts +const _unusedVar = 'unused'; +class _Unused { + private _unused = 1; + private _unusedMethod() {} +} +function _unusedFunction() {} +enum _UnusedEnum { + a = 1, +} +interface _UnusedInterface {} +type _UnusedType = {}; +``` + +**_NOTE:_** The TypeScript compiler automatically ignores imports, function arguments, type parameter declarations, and object destructuring variables prefixed with an underscore. +As this is hard-coded into the compiler, we cannot change this. + +Examples of valid code based on the unchangeable compiler settings + +```ts +import _UnusedDefault, { _UnusedNamed } from 'foo'; +export function foo(_unusedProp: string) {} +export class Foo<_UnusedGeneric> {} +const { prop: _unusedDestructure } = foo; +``` + +## `ignoreArgsIfArgsAfterAreUsed` + +When true, this option will ignore unused function arguments if the arguments proceeding arguments are used. + +Examples of invalid code with `{ ignoreArgsIfArgsAfterAreUsed: false }` + +```ts +function foo(unused: string, used: number) { + console.log(used); +} + +class Foo { + constructor(unused: string, public used: number) { + console.log(used); + } +} +``` + +Examples of valid code with `{ ignoreArgsIfArgsAfterAreUsed: true }` + +```ts +function foo(unused: string, used: number) { + console.log(used); +} + +class Foo { + constructor(unused: string, public used: number) { + console.log(used); + } +} +``` diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-vars.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-vars.md new file mode 100644 index 000000000..5eaf167a3 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-vars.md @@ -0,0 +1,22 @@ +# Disallow unused variables (`no-unused-vars`) + +## Rule Details + +This rule extends the base [`eslint/no-unused-vars`](https://eslint.org/docs/rules/no-unused-vars) rule. +It adds support for TypeScript features, such as types. + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "no-unused-vars": "off", + "@typescript-eslint/no-unused-vars": ["error"] +} +``` + +## Options + +See [`eslint/no-unused-vars` options](https://eslint.org/docs/rules/no-unused-vars#options). + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-unused-vars.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-use-before-define.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-use-before-define.md new file mode 100644 index 000000000..dfdab4d60 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-use-before-define.md @@ -0,0 +1,106 @@ +# Disallow the use of variables before they are defined (`no-use-before-define`) + +## PLEASE READ THIS ISSUE BEFORE USING THIS RULE [#1856](https://github.com/typescript-eslint/typescript-eslint/issues/1856) + +## Rule Details + +This rule extends the base [`eslint/no-use-before-define`](https://eslint.org/docs/rules/no-use-before-define) rule. +It adds support for `type`, `interface` and `enum` declarations. + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "no-use-before-define": "off", + "@typescript-eslint/no-use-before-define": ["error"] +} +``` + +## Options + +See [`eslint/no-use-before-define` options](https://eslint.org/docs/rules/no-use-before-define#options). +This rule adds the following options: + +```ts +interface Options extends BaseNoUseBeforeDefineOptions { + enums?: boolean; + typedefs?: boolean; + ignoreTypeReferences?: boolean; +} + +const defaultOptions: Options = { + ...baseNoUseBeforeDefineDefaultOptions, + enums: true, + typedefs: true, + ignoreTypeReferences: true, +}; +``` + +### `enums` + +If this is `true`, this rule warns every reference to a enum before the enum declaration. +If this is `false`, this rule will ignore references to enums, when the reference is in a child scope. + +Examples of **incorrect** code for the `{ "enums": false }` option: + +```ts +/*eslint no-use-before-define: ["error", { "enums": false }]*/ + +const x = Foo.FOO; + +enum Foo { + FOO, +} +``` + +Examples of **correct** code for the `{ "enums": false }` option: + +```ts +/*eslint no-use-before-define: ["error", { "enums": false }]*/ + +function foo() { + return Foo.FOO; +} + +enum Foo { + FOO, +} +``` + +### `typedefs` + +If this is `true`, this rule warns every reference to a type before the type declaration. +If this is `false`, this rule will ignore references to types. + +Examples of **correct** code for the `{ "typedefs": false }` option: + +```ts +/*eslint no-use-before-define: ["error", { "typedefs": false }]*/ + +let myVar: StringOrNumber; +type StringOrNumber = string | number; +``` + +### `ignoreTypeReferences` + +If this is `true`, this rule ignores all type references, such as in type annotations and assertions. +If this is `false`, this will will check all type references. + +Examples of **correct** code for the `{ "ignoreTypeReferences": true }` option: + +```ts +/*eslint no-use-before-define: ["error", { "ignoreTypeReferences": true }]*/ + +let var1: StringOrNumber; +type StringOrNumber = string | number; + +let var2: Enum; +enum Enum {} +``` + +### Other Options + +See [`eslint/no-use-before-define` options](https://eslint.org/docs/rules/no-use-before-define#options). + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-use-before-define.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-constructor.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-constructor.md new file mode 100644 index 000000000..524ad4b92 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-constructor.md @@ -0,0 +1,26 @@ +# Disallow unnecessary constructors (`no-useless-constructor`) + +## Rule Details + +This rule extends the base [`eslint/no-useless-constructor`](https://eslint.org/docs/rules/no-useless-constructor) rule. +It adds support for: + +- constructors marked as `protected` / `private` (i.e. marking a constructor as non-public), +- `public` constructors when there is no superclass, +- constructors with only parameter properties. + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "no-useless-constructor": "off", + "@typescript-eslint/no-useless-constructor": ["error"] +} +``` + +## Options + +See [`eslint/no-useless-constructor` options](https://eslint.org/docs/rules/no-useless-constructor#options). + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-useless-constructor.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-var-requires.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-var-requires.md new file mode 100644 index 000000000..104a54943 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-var-requires.md @@ -0,0 +1,29 @@ +# Disallows the use of require statements except in import statements (`no-var-requires`) + +In other words, the use of forms such as `var foo = require("foo")` are banned. Instead use ES6 style imports or `import foo = require("foo")` imports. + +## Rule Details + +Examples of **incorrect** code for this rule: + +```ts +var foo = require('foo'); +const foo = require('foo'); +let foo = require('foo'); +``` + +Examples of **correct** code for this rule: + +```ts +import foo = require('foo'); +require('foo'); +import foo from 'foo'; +``` + +## When Not To Use It + +If you don't care about TypeScript module syntax, then you will not need this rule. + +## Compatibility + +- TSLint: [no-var-requires](https://palantir.github.io/tslint/rules/no-var-requires/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-as-const.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-as-const.md new file mode 100644 index 000000000..b710a8275 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-as-const.md @@ -0,0 +1,28 @@ +# Prefer usage of `as const` over literal type (`prefer-as-const`) + +This rule recommends usage of `const` assertion when type primitive value is equal to type. + +## Rule Details + +Examples of **incorrect** code for this rule: + +```ts +let bar: 2 = 2; +let foo = <'bar'>'bar'; +let foo = { bar: 'baz' as 'baz' }; +``` + +Examples of **correct** code for this rule: + +```ts +let foo = 'bar'; +let foo = 'bar' as const; +let foo: 'bar' = 'bar' as const; +let bar = 'bar' as string; +let foo = 'bar'; +let foo = { bar: 'baz' }; +``` + +## When Not To Use It + +If you are using TypeScript < 3.4 diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-enum-initializers.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-enum-initializers.md new file mode 100644 index 000000000..1e8f568d7 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-enum-initializers.md @@ -0,0 +1,70 @@ +# Prefer initializing each enums member value (`prefer-enum-initializers`) + +This rule recommends having each `enum`s member value explicitly initialized. + +`enum`s are a practical way to organize semantically related constant values. However, by implicitly defining values, `enum`s can lead to unexpected bugs if it's modified without paying attention to the order of its items. + +## Rule Details + +`enum`s infers sequential numbers automatically when initializers are omitted: + +```ts +enum Status { + Open, // infer 0 + Closed, // infer 1 +} +``` + +If a new member is added to the top of `Status`, both `Open` and `Closed` would have its values altered: + +```ts +enum Status { + Pending, // infer 0 + Open, // infer 1 + Closed, // infer 2 +} +``` + +Examples of **incorrect** code for this rule: + +```ts +enum Status { + Open = 1, + Close, +} + +enum Direction { + Up, + Down, +} + +enum Color { + Red, + Green = 'Green' + Blue = 'Blue', +} +``` + +Examples of **correct** code for this rule: + +```ts +enum Status { + Open = 'Open', + Close = 'Close', +} + +enum Direction { + Up = 1, + Down = 2, +} + +enum Color { + Red = 'Red', + Green = 'Green', + Blue = 'Blue', +} +``` + +## When Not To Use It + +If you don't care about `enum`s having implicit values you can safely disable this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-for-of.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-for-of.md new file mode 100644 index 000000000..0b1e5570d --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-for-of.md @@ -0,0 +1,41 @@ +# Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated (`prefer-for-of`) + +This rule recommends a for-of loop when the loop index is only used to read from an array that is being iterated. + +## Rule Details + +For cases where the index is only used to read from the array being iterated, a for-of loop is easier to read and write. + +Examples of **incorrect** code for this rule: + +```js +for (let i = 0; i < arr.length; i++) { + console.log(arr[i]); +} +``` + +Examples of **correct** code for this rule: + +```js +for (const x of arr) { + console.log(x); +} + +for (let i = 0; i < arr.length; i++) { + // i is used to write to arr, so for-of could not be used. + arr[i] = 0; +} + +for (let i = 0; i < arr.length; i++) { + // i is used independent of arr, so for-of could not be used. + console.log(i, arr[i]); +} +``` + +## When Not To Use It + +If you transpile for browsers that do not support for-of loops, you may wish to use traditional for loops that produce more compact code. + +## Related to + +- TSLint: ['prefer-for-of'](https://palantir.github.io/tslint/rules/prefer-for-of/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-function-type.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-function-type.md new file mode 100644 index 000000000..a3210a133 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-function-type.md @@ -0,0 +1,57 @@ +# Use function types instead of interfaces with call signatures (`prefer-function-type`) + +## Rule Details + +This rule suggests using a function type instead of an interface or object type literal with a single call signature. + +Examples of **incorrect** code for this rule: + +```ts +interface Foo { + (): string; +} +``` + +```ts +function foo(bar: { (): number }): number { + return bar(); +} +``` + +```ts +interface Foo extends Function { + (): void; +} +``` + +Examples of **correct** code for this rule: + +```ts +interface Foo { + (): void; + bar: number; +} +``` + +```ts +function foo(bar: { (): string; baz: number }): string { + return bar(); +} +``` + +```ts +interface Foo { + bar: string; +} +interface Bar extends Foo { + (): void; +} +``` + +## When Not To Use It + +If you specifically want to use an interface or type literal with a single call signature for stylistic reasons, you can disable this rule. + +## Further Reading + +- TSLint: [`callable-types`](https://palantir.github.io/tslint/rules/callable-types/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-includes.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-includes.md new file mode 100644 index 000000000..07cc9ea44 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-includes.md @@ -0,0 +1,71 @@ +# Enforce `includes` method over `indexOf` method (`prefer-includes`) + +Until ES5, we were using `String#indexOf` method to check whether a string contains an arbitrary substring or not. +Until ES2015, we were using `Array#indexOf` method to check whether an array contains an arbitrary value or not. + +ES2015 has added `String#includes` and ES2016 has added `Array#includes`. +It makes code more understandable if we use those `includes` methods for the purpose. + +## Rule Details + +This rule is aimed at suggesting `includes` method if `indexOf` method was used to check whether an object contains an arbitrary value or not. + +If the receiver object of the `indexOf` method call has `includes` method and the two methods have the same parameters, this rule does suggestion. +There are such types: `String`, `Array`, `ReadonlyArray`, and typed arrays. + +Additionally, this rule reports the tests of simple regular expressions in favor of `String#includes`. + +Examples of **incorrect** code for this rule: + +```ts +let str: string; +let array: any[]; +let readonlyArray: ReadonlyArray; +let typedArray: UInt8Array; +let userDefined: { + indexOf(x: any): number; + includes(x: any): boolean; +}; + +str.indexOf(value) !== -1; +array.indexOf(value) !== -1; +readonlyArray.indexOf(value) === -1; +typedArray.indexOf(value) > -1; +userDefined.indexOf(value) >= 0; + +// simple RegExp test +/foo/.test(str); +``` + +Examples of **correct** code for this rule: + +```ts +let array: any[]; +let readonlyArray: ReadonlyArray; +let typedArray: UInt8Array; +let userDefined: { + indexOf(x: any): number; + includes(x: any): boolean; +}; +let mismatchExample: { + indexOf(x: any, fromIndex?: number): number; + includes(x: any): boolean; +}; + +str.includes(value); +array.includes(value); +readonlyArray.includes(value); +typedArray.includes(value); +userDefined.includes(value); + +// the two methods have different parameters. +mismatchExample.indexOf(value) >= 0; +``` + +## Options + +There are no options. + +## When Not To Use It + +If you don't want to suggest `includes`, you can safely turn this rule off. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-literal-enum-member.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-literal-enum-member.md new file mode 100644 index 000000000..e2350f357 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-literal-enum-member.md @@ -0,0 +1,51 @@ +# Require that all enum members be literal values to prevent unintended enum member name shadow issues (`prefer-literal-enum-member`) + +TypeScript allows the value of an enum member to be many different kinds of valid JavaScript expressions. However, because enums create their own scope whereby each enum member becomes a variable in that scope, unexpected values could be used at runtime. Example: + +```ts +const imOutside = 2; +const b = 2; +enum Foo { + outer = imOutside, + a = 1, + b = a, + c = b, + // does c == Foo.b == Foo.c == 1? + // or does c == b == 2? +} +``` + +The answer is that `Foo.c` will be `1` at runtime. The [playground](https://www.typescriptlang.org/play/#src=const%20imOutside%20%3D%202%3B%0D%0Aconst%20b%20%3D%202%3B%0D%0Aenum%20Foo%20%7B%0D%0A%20%20%20%20outer%20%3D%20imOutside%2C%0D%0A%20%20%20%20a%20%3D%201%2C%0D%0A%20%20%20%20b%20%3D%20a%2C%0D%0A%20%20%20%20c%20%3D%20b%2C%0D%0A%20%20%20%20%2F%2F%20does%20c%20%3D%3D%20Foo.b%20%3D%3D%20Foo.c%20%3D%3D%201%3F%0D%0A%20%20%20%20%2F%2F%20or%20does%20c%20%3D%3D%20b%20%3D%3D%202%3F%0D%0A%7D) illustrates this quite nicely. + +## Rule Details + +This rule is meant to prevent unexpected results in code by requiring the use of literal values as enum members to prevent unexpected runtime behavior. Template literals, arrays, objects, constructors, and all other expression types can end up using a variable from its scope or the parent scope, which can result in the same unexpected behavior at runtime. + +Examples of **incorrect** code for this rule: + +```ts +const str = 'Test'; +enum Invalid { + A = str, // Variable assignment + B = {}, // Object assignment + C = `A template literal string`, // Template literal + D = new Set(1, 2, 3), // Constructor in assignment + E = 2 + 2, // Expression assignment +} +``` + +Examples of **correct** code for this rule: + +```ts +enum Valid { + A, + B = 'TestStr', // A regular string + C = 4, // A number + D = null, + E = /some_regex/, +} +``` + +## When Not To Use It + +If you want use anything other than simple literals as an enum value. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-namespace-keyword.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-namespace-keyword.md new file mode 100644 index 000000000..faeeaadf8 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-namespace-keyword.md @@ -0,0 +1,22 @@ +# Require the use of the `namespace` keyword instead of the `module` keyword to declare custom TypeScript modules (`prefer-namespace-keyword`) + +In an effort to prevent further confusion between custom TypeScript modules and the new ES2015 modules, starting +with TypeScript `v1.5` the keyword `namespace` is now the preferred way to declare custom TypeScript modules. + +## Rule Details + +This rule aims to standardize the way modules are declared. + +## When Not To Use It + +If you are using the ES2015 module syntax, then you will not need this rule. + +## Further Reading + +- [Modules](https://www.typescriptlang.org/docs/handbook/modules.html) +- [Namespaces](https://www.typescriptlang.org/docs/handbook/namespaces.html) +- [Namespaces and Modules](https://www.typescriptlang.org/docs/handbook/namespaces-and-modules.html) + +## Compatibility + +- TSLint: [no-internal-module](https://palantir.github.io/tslint/rules/no-internal-module/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-nullish-coalescing.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-nullish-coalescing.md new file mode 100644 index 000000000..bb32c0289 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-nullish-coalescing.md @@ -0,0 +1,141 @@ +# Enforce the usage of the nullish coalescing operator instead of logical chaining (`prefer-nullish-coalescing`) + +TypeScript 3.7 added support for the nullish coalescing operator. +This operator allows you to safely cascade a value when dealing with `null` or `undefined`. + +```ts +function myFunc(foo: string | null) { + return foo ?? 'a string'; +} + +// is equivalent to + +function myFunc(foo: string | null) { + return foo !== null && foo !== undefined ? foo : 'a string'; +} +``` + +Because the nullish coalescing operator _only_ coalesces when the original value is `null` or `undefined`, it is much safer than relying upon logical OR operator chaining `||`; which coalesces on any _falsy_ value: + +```ts +const emptyString = ''; + +const nullish1 = emptyString ?? 'unsafe'; +const logical1 = emptyString || 'unsafe'; + +// nullish1 === '' +// logical1 === 'unsafe' + +declare const nullString: string | null; + +const nullish2 = nullString ?? 'safe'; +const logical2 = nullString || 'safe'; + +// nullish2 === 'safe' +// logical2 === 'safe' +``` + +## Rule Details + +This rule aims enforce the usage of the safer operator. + +## Options + +```ts +type Options = [ + { + ignoreConditionalTests?: boolean; + ignoreMixedLogicalExpressions?: boolean; + }, +]; + +const defaultOptions = [ + { + ignoreConditionalTests: true, + ignoreMixedLogicalExpressions: true, + }, +]; +``` + +### `ignoreConditionalTests` + +Setting this option to `true` (the default) will cause the rule to ignore any cases that are located within a conditional test. + +Generally expressions within conditional tests intentionally use the falsy fallthrough behavior of the logical or operator, meaning that fixing the operator to the nullish coalesce operator could cause bugs. + +If you're looking to enforce stricter conditional tests, you should consider using the `strict-boolean-expressions` rule. + +Incorrect code for `ignoreConditionalTests: false`, and correct code for `ignoreConditionalTests: true`: + +```ts +declare const a: string | null; +declare const b: string | null; + +if (a || b) { +} +while (a || b) {} +do {} while (a || b); +for (let i = 0; a || b; i += 1) {} +a || b ? true : false; +``` + +Correct code for `ignoreConditionalTests: false`: + +```ts +declare const a: string | null; +declare const b: string | null; + +if (a ?? b) { +} +while (a ?? b) {} +do {} while (a ?? b); +for (let i = 0; a ?? b; i += 1) {} +a ?? b ? true : false; +``` + +### `ignoreMixedLogicalExpressions` + +Setting this option to `true` (the default) will cause the rule to ignore any logical or expressions that are part of a mixed logical expression (with `&&`). + +Generally expressions within mixed logical expressions intentionally use the falsy fallthrough behavior of the logical or operator, meaning that fixing the operator to the nullish coalesce operator could cause bugs. + +If you're looking to enforce stricter conditional tests, you should consider using the `strict-boolean-expressions` rule. + +Incorrect code for `ignoreMixedLogicalExpressions: false`, and correct code for `ignoreMixedLogicalExpressions: true`: + +```ts +declare const a: string | null; +declare const b: string | null; +declare const c: string | null; +declare const d: string | null; + +a || (b && c); +(a && b) || c || d; +a || (b && c) || d; +a || (b && c && d); +``` + +Correct code for `ignoreMixedLogicalExpressions: false`: + +```ts +declare const a: string | null; +declare const b: string | null; +declare const c: string | null; +declare const d: string | null; + +a ?? (b && c); +(a && b) ?? c ?? d; +a ?? (b && c) ?? d; +a ?? (b && c && d); +``` + +**_NOTE:_** Errors for this specific case will be presented as suggestions (see below), instead of fixes. This is because it is not always safe to automatically convert `||` to `??` within a mixed logical expression, as we cannot tell the intended precedence of the operator. Note that by design, `??` requires parentheses when used with `&&` or `||` in the same expression. + +## When Not To Use It + +If you are not using TypeScript 3.7 (or greater), then you will not be able to use this rule, as the operator is not supported. + +## Further Reading + +- [TypeScript 3.7 Release Notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html) +- [Nullish Coalescing Operator Proposal](https://github.com/tc39/proposal-nullish-coalescing/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-optional-chain.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-optional-chain.md new file mode 100644 index 000000000..6505c9395 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-optional-chain.md @@ -0,0 +1,82 @@ +# Prefer using concise optional chain expressions instead of chained logical ands (`prefer-optional-chain`) + +TypeScript 3.7 added support for the optional chain operator. +This operator allows you to safely access properties and methods on objects when they are potentially `null` or `undefined`. + +```ts +type T = { + a?: { + b?: { + c: string; + method?: () => void; + }; + }; +}; + +function myFunc(foo: T | null) { + return foo?.a?.b?.c; +} +// is roughly equivalent to +function myFunc(foo: T | null) { + return foo && foo.a && foo.a.b && foo.a.b.c; +} + +function myFunc(foo: T | null) { + return foo?.['a']?.b?.c; +} +// is roughly equivalent to +function myFunc(foo: T | null) { + return foo && foo['a'] && foo['a'].b && foo['a'].b.c; +} + +function myFunc(foo: T | null) { + return foo?.a?.b?.method?.(); +} +// is roughly equivalent to +function myFunc(foo: T | null) { + return foo && foo.a && foo.a.b && foo.a.b.method && foo.a.b.method(); +} +``` + +Because the optional chain operator _only_ chains when the property value is `null` or `undefined`, it is much safer than relying upon logical AND operator chaining `&&`; which chains on any _truthy_ value. + +## Rule Details + +This rule aims enforce the usage of the safer operator. + +Examples of **incorrect** code for this rule: + +```ts +foo && foo.a && foo.a.b && foo.a.b.c; +foo && foo['a'] && foo['a'].b && foo['a'].b.c; +foo && foo.a && foo.a.b && foo.a.b.method && foo.a.b.method(); + +// this rule also supports converting chained strict nullish checks: +foo && + foo.a != null && + foo.a.b !== null && + foo.a.b.c != undefined && + foo.a.b.c.d !== undefined && + foo.a.b.c.d.e; +``` + +Examples of **correct** code for this rule: + +```ts +foo?.a?.b?.c; +foo?.['a']?.b?.c; +foo?.a?.b?.method?.(); + +foo?.a?.b?.c?.d?.e; +``` + +**Note:** there are a few edge cases where this rule will false positive. Use your best judgement when evaluating reported errors. + +## When Not To Use It + +If you are not using TypeScript 3.7 (or greater), then you will not be able to use this rule, as the operator is not supported. + +## Further Reading + +- [TypeScript 3.7 Release Notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html) +- [Optional Chaining Proposal](https://github.com/tc39/proposal-optional-chaining/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md new file mode 100644 index 000000000..74697f2d3 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md @@ -0,0 +1,164 @@ +# Requires that function parameters are typed as readonly to prevent accidental mutation of inputs (`prefer-readonly-parameter-types`) + +Mutating function arguments can lead to confusing, hard to debug behavior. +Whilst it's easy to implicitly remember to not modify function arguments, explicitly typing arguments as readonly provides clear contract to consumers. +This contract makes it easier for a consumer to reason about if a function has side-effects. + +## Rule Details + +This rule allows you to enforce that function parameters resolve to readonly types. +A type is considered readonly if: + +- it is a primitive type (`string`, `number`, `boolean`, `symbol`, or an enum), +- it is a function signature type, +- it is a readonly array type whose element type is considered readonly. +- it is a readonly tuple type whose elements are all considered readonly. +- it is an object type whose properties are all marked as readonly, and whose values are all considered readonly. + +Examples of **incorrect** code for this rule: + +```ts +function array1(arg: string[]) {} // array is not readonly +function array2(arg: readonly string[][]) {} // array element is not readonly +function array3(arg: [string, number]) {} // tuple is not readonly +function array4(arg: readonly [string[], number]) {} // tuple element is not readonly +// the above examples work the same if you use ReadonlyArray instead + +function object1(arg: { prop: string }) {} // property is not readonly +function object2(arg: { readonly prop: string; prop2: string }) {} // not all properties are readonly +function object3(arg: { readonly prop: { prop2: string } }) {} // nested property is not readonly +// the above examples work the same if you use Readonly instead + +interface CustomArrayType extends ReadonlyArray { + prop: string; // note: this property is mutable +} +function custom1(arg: CustomArrayType) {} + +interface CustomFunction { + (): void; + prop: string; // note: this property is mutable +} +function custom2(arg: CustomFunction) {} + +function union(arg: string[] | ReadonlyArray) {} // not all types are readonly + +// rule also checks function types +interface Foo { + (arg: string[]): void; +} +interface Foo { + new (arg: string[]): void; +} +const x = { foo(arg: string[]): void; }; +function foo(arg: string[]); +type Foo = (arg: string[]) => void; +interface Foo { + foo(arg: string[]): void; +} +``` + +Examples of **correct** code for this rule: + +```ts +function array1(arg: readonly string[]) {} +function array2(arg: readonly (readonly string[])[]) {} +function array3(arg: readonly [string, number]) {} +function array4(arg: readonly [readonly string[], number]) {} +// the above examples work the same if you use ReadonlyArray instead + +function object1(arg: { readonly prop: string }) {} +function object2(arg: { readonly prop: string; readonly prop2: string }) {} +function object3(arg: { readonly prop: { readonly prop2: string } }) {} +// the above examples work the same if you use Readonly instead + +interface CustomArrayType extends ReadonlyArray { + readonly prop: string; +} +function custom1(arg: Readonly) {} +// interfaces that extend the array types are not considered arrays, and thus must be made readonly. + +interface CustomFunction { + (): void; + readonly prop: string; +} +function custom2(arg: CustomFunction) {} + +function union(arg: readonly string[] | ReadonlyArray) {} + +function primitive1(arg: string) {} +function primitive2(arg: number) {} +function primitive3(arg: boolean) {} +function primitive4(arg: unknown) {} +function primitive5(arg: null) {} +function primitive6(arg: undefined) {} +function primitive7(arg: any) {} +function primitive8(arg: never) {} +function primitive9(arg: string | number | undefined) {} + +function fnSig(arg: () => void) {} + +enum Foo { a, b } +function enum(arg: Foo) {} + +function symb1(arg: symbol) {} +const customSymbol = Symbol('a'); +function symb2(arg: typeof customSymbol) {} + +// function types +interface Foo { + (arg: readonly string[]): void; +} +interface Foo { + new (arg: readonly string[]): void; +} +const x = { foo(arg: readonly string[]): void; }; +function foo(arg: readonly string[]); +type Foo = (arg: readonly string[]) => void; +interface Foo { + foo(arg: readonly string[]): void; +} +``` + +## Options + +```ts +interface Options { + checkParameterProperties?: boolean; +} + +const defaultOptions: Options = { + checkParameterProperties: true, +}; +``` + +### `checkParameterProperties` + +This option allows you to enable or disable the checking of parameter properties. +Because parameter properties create properties on the class, it may be undesirable to force them to be readonly. + +Examples of **incorrect** code for this rule with `{checkParameterProperties: true}`: + +```ts +class Foo { + constructor(private paramProp: string[]) {} +} +``` + +Examples of **correct** code for this rule with `{checkParameterProperties: true}`: + +```ts +class Foo { + constructor(private paramProp: readonly string[]) {} +} +``` + +Examples of **correct** code for this rule with `{checkParameterProperties: false}`: + +```ts +class Foo { + constructor( + private paramProp1: string[], + private paramProp2: readonly string[], + ) {} +} +``` diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly.md new file mode 100644 index 000000000..9ce16a8c3 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly.md @@ -0,0 +1,81 @@ +# Requires that private members are marked as `readonly` if they're never modified outside of the constructor (`prefer-readonly`) + +This rule enforces that private members are marked as `readonly` if they're never modified outside of the constructor. + +## Rule Details + +Member variables with the privacy `private` are never permitted to be modified outside of their declaring class. +If that class never modifies their value, they may safely be marked as `readonly`. + +Examples of **incorrect** code for this rule: + +```ts +class Container { + // These member variables could be marked as readonly + private neverModifiedMember = true; + private onlyModifiedInConstructor: number; + + public constructor( + onlyModifiedInConstructor: number, + // Private parameter properties can also be marked as readonly + private neverModifiedParameter: string, + ) { + this.onlyModifiedInConstructor = onlyModifiedInConstructor; + } +} +``` + +Examples of **correct** code for this rule: + +```ts +class Container { + // Public members might be modified externally + public publicMember: boolean; + + // Protected members might be modified by child classes + protected protectedMember: number; + + // This is modified later on by the class + private modifiedLater = 'unchanged'; + + public mutate() { + this.modifiedLater = 'mutated'; + } +} +``` + +## Options + +This rule, in its default state, does not require any argument. + +### `onlyInlineLambdas` + +You may pass `"onlyInlineLambdas": true` as a rule option within an object to restrict checking only to members immediately assigned a lambda value. + +```jsonc +{ + "@typescript-eslint/prefer-readonly": ["error", { "onlyInlineLambdas": true }] +} +``` + +Example of **correct** code for the `{ "onlyInlineLambdas": true }` options: + +```ts +class Container { + private neverModifiedPrivate = 'unchanged'; +} +``` + +Example of **incorrect** code for the `{ "onlyInlineLambdas": true }` options: + +```ts +class Container { + private onClick = () => { + /* ... */ + }; +} +``` + +## Related to + +- TSLint: ['prefer-readonly'](https://palantir.github.io/tslint/rules/prefer-readonly) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md new file mode 100644 index 000000000..d6f68021c --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md @@ -0,0 +1,54 @@ +# Prefer using type parameter when calling `Array#reduce` instead of casting (`prefer-reduce-type-parameter`) + +It's common to call `Array#reduce` with a generic type, such as an array or object, as the initial value. +Since these values are empty, their types are not usable: + +- `[]` has type `never[]`, which can't have items pushed into it as nothing is type `never` +- `{}` has type `{}`, which doesn't have an index signature and so can't have properties added to it + +A common solution to this problem is to cast the initial value. While this will work, it's not the most optimal +solution as casting has subtle effects on the underlying types that can allow bugs to slip in. + +A better (and lesser known) solution is to pass the type in as a generic parameter to `Array#reduce` explicitly. +This means that TypeScript doesn't have to try to infer the type, and avoids the common pitfalls that come with casting. + +## Rule Details + +This rule looks for calls to `Array#reduce`, and warns if an initial value is being passed & casted, +suggesting instead to pass the cast type to `Array#reduce` as its generic parameter. + +Examples of **incorrect** code for this rule: + +```ts +[1, 2, 3].reduce((arr, num) => arr.concat(num * 2), [] as number[]); + +['a', 'b'].reduce( + (accum, name) => ({ + ...accum, + [name]: true, + }), + {} as Record, +); +``` + +Examples of **correct** code for this rule: + +```ts +[1, 2, 3].reduce((arr, num) => arr.concat(num * 2), []); + +['a', 'b'].reduce>( + (accum, name) => ({ + ...accum, + [name]: true, + }), + {}, +); +``` + +## Options + +There are no options. + +## When Not To Use It + +If you don't want to use typechecking in your linting, you can't use this rule. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-regexp-exec.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-regexp-exec.md new file mode 100644 index 000000000..4640d35a9 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-regexp-exec.md @@ -0,0 +1,53 @@ +# Enforce that `RegExp#exec` is used instead of `String#match` if no global flag is provided (`prefer-regexp-exec`) + +`RegExp#exec` is faster than `String#match` and both work the same when not using the `/g` flag. + +## Rule Details + +This rule is aimed at enforcing the more performant way of applying regular expressions on strings. + +From [`String#match` on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match): + +> If the regular expression does not include the g flag, returns the same result as `RegExp.exec()`. + +From [Stack Overflow](https://stackoverflow.com/questions/9214754/what-is-the-difference-between-regexp-s-exec-function-and-string-s-match-fun) + +> `RegExp.prototype.exec` is a lot faster than `String.prototype.match`, but that’s because they are not exactly the same thing, they are different. + +Examples of **incorrect** code for this rule: + +```ts +'something'.match(/thing/); + +'some things are just things'.match(/thing/); + +const text = 'something'; +const search = /thing/; +text.match(search); +``` + +Examples of **correct** code for this rule: + +```ts +/thing/.exec('something'); + +'some things are just things'.match(/thing/g); + +const text = 'something'; +const search = /thing/; +search.exec(text); +``` + +## Options + +There are no options. + +```json +{ + "@typescript-eslint/prefer-regexp-exec": "error" +} +``` + +## When Not To Use It + +If you prefer consistent use of `String#match` for both, with `g` flag and without it, you can turn this rule off. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md new file mode 100644 index 000000000..110061d55 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md @@ -0,0 +1,54 @@ +# Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings (`prefer-string-starts-ends-with`) + +There are multiple ways to verify if a string starts or ends with a specific string, such as `foo.indexOf('bar') === 0`. + +Since ES2015 has added `String#startsWith` and `String#endsWith`, this rule reports other ways to be consistent. + +## Rule Details + +This rule is aimed at enforcing a consistent way to check whether a string starts or ends with a specific string. + +Examples of **incorrect** code for this rule: + +```ts +let foo: string; + +// starts with +foo[0] === 'b'; +foo.charAt(0) === 'b'; +foo.indexOf('bar') === 0; +foo.slice(0, 3) === 'bar'; +foo.substring(0, 3) === 'bar'; +foo.match(/^bar/) != null; +/^bar/.test(foo); + +// ends with +foo[foo.length - 1] === 'b'; +foo.charAt(foo.length - 1) === 'b'; +foo.lastIndexOf('bar') === foo.length - 3; +foo.slice(-3) === 'bar'; +foo.substring(foo.length - 3) === 'bar'; +foo.match(/bar$/) != null; +/bar$/.test(foo); +``` + +Examples of **correct** code for this rule: + +```ts +foo.startsWith('bar'); +foo.endsWith('bar'); +``` + +## Options + +There are no options. + +```JSON +{ + "@typescript-eslint/prefer-string-starts-ends-with": "error" +} +``` + +## When Not To Use It + +If you don't mind that style, you can turn this rule off safely. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-ts-expect-error.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-ts-expect-error.md new file mode 100644 index 000000000..7ec0cac77 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-ts-expect-error.md @@ -0,0 +1,47 @@ +# Recommends using `// @ts-expect-error` over `// @ts-ignore` (`prefer-ts-expect-error`) + +TypeScript allows you to suppress all errors on a line by placing a single-line comment starting with `@ts-ignore` immediately before the erroring line. +While powerful, there is no way to know if a `@ts-ignore` is actually suppressing an error without manually investigating what happens when the `@ts-ignore` is removed. + +This means its easy for `@ts-ignore`s to be forgotten about, and remain in code even after the error they were suppressing is fixed. +This is dangerous, as if a new error arises on that line it'll be suppressed by the forgotten about `@ts-ignore`, and so be missed. + +To address this, TS3.9 ships with a new single-line comment directive: `// @ts-expect-error`. + +This directive operates in the same manner as `@ts-ignore`, but will error if the line it's meant to be suppressing doesn't actually contain an error, making it a lot safer. + +## Rule Details + +This rule looks for usages of `@ts-ignore`, and flags them to be replaced with `@ts-expect-error`. + +Examples of **incorrect** code for this rule: + +```ts +// @ts-ignore +const str: string = 1; + +const isOptionEnabled = (key: string): boolean => { + // @ts-ignore: if key isn't in globalOptions it'll be undefined which is false + return !!globalOptions[key]; +}; +``` + +Examples of **correct** code for this rule: + +```ts +// @ts-expect-error +const str: string = 1; + +const isOptionEnabled = (key: string): boolean => { + // @ts-expect-error: if key isn't in globalOptions it'll be undefined which is false + return !!globalOptions[key]; +}; +``` + +## When Not To Use It + +If you are not using TypeScript 3.9 (or greater), then you will not be able to use this rule, as the directive is not supported + +## Further Reading + +- [Original Implementing PR](https://github.com/microsoft/TypeScript/pull/36014) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/promise-function-async.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/promise-function-async.md new file mode 100644 index 000000000..192e66a35 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/promise-function-async.md @@ -0,0 +1,66 @@ +# Requires any function or method that returns a Promise to be marked async (`promise-function-async`) + +Requires any function or method that returns a Promise to be marked async. +Ensures that each function is only capable of: + +- returning a rejected promise, or +- throwing an Error object. + +In contrast, non-`async` `Promise` - returning functions are technically capable of either. +Code that handles the results of those functions will often need to handle both cases, which can get complex. +This rule's practice removes a requirement for creating code to handle both cases. + +## Rule Details + +Examples of **incorrect** code for this rule + +```ts +const arrowFunctionReturnsPromise = () => Promise.resolve('value'); + +function functionReturnsPromise() { + return Promise.resolve('value'); +} +``` + +Examples of **correct** code for this rule + +```ts +const arrowFunctionReturnsPromise = async () => Promise.resolve('value'); + +async function functionReturnsPromise() { + return Promise.resolve('value'); +} +``` + +## Options + +Options may be provided as an object with: + +- `allowAny` to indicate that `any` or `unknown` shouldn't be considered Promises (`true` by default). +- `allowedPromiseNames` to indicate any extra names of classes or interfaces to be considered Promises when returned. + +In addition, each of the following properties may be provided, and default to `true`: + +- `checkArrowFunctions` +- `checkFunctionDeclarations` +- `checkFunctionExpressions` +- `checkMethodDeclarations` + +```json +{ + "@typescript-eslint/promise-function-async": [ + "error", + { + "allowedPromiseNames": ["Thenable"], + "checkArrowFunctions": true, + "checkFunctionDeclarations": true, + "checkFunctionExpressions": true, + "checkMethodDeclarations": true + } + ] +} +``` + +## Related To + +- TSLint: [promise-function-async](https://palantir.github.io/tslint/rules/promise-function-async) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/quotes.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/quotes.md new file mode 100644 index 000000000..6b63587f6 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/quotes.md @@ -0,0 +1,22 @@ +# Enforce the consistent use of either backticks, double, or single quotes (`quotes`) + +## Rule Details + +This rule extends the base [`eslint/quotes`](https://eslint.org/docs/rules/quotes) rule. +It adds support for TypeScript features which allow quoted names, but not backtick quoted names. + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "quotes": "off", + "@typescript-eslint/quotes": ["error"] +} +``` + +## Options + +See [`eslint/quotes` options](https://eslint.org/docs/rules/quotes#options). + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/quotes.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-array-sort-compare.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-array-sort-compare.md new file mode 100644 index 000000000..78de19863 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-array-sort-compare.md @@ -0,0 +1,85 @@ +# Requires `Array#sort` calls to always provide a `compareFunction` (`require-array-sort-compare`) + +This rule prevents invoking the `Array#sort()` method without providing a `compare` argument. + +When called without a compare function, `Array#sort()` converts all non-undefined array elements into strings and then compares said strings based off their UTF-16 code units. + +The result is that elements are sorted alphabetically, regardless of their type. +When sorting numbers, this results in the classic "10 before 2" order: + +```ts +[1, 2, 3, 10, 20, 30].sort(); //→ [1, 10, 2, 20, 3, 30] +``` + +This also means that `Array#sort` does not always sort consistently, as elements may have custom `#toString` implementations that are not deterministic; this trap is noted in the noted in the language specification thusly: + +> NOTE 2: Method calls performed by the `ToString` abstract operations in steps 5 and 7 have the potential to cause `SortCompare` to not behave as a consistent comparison function.
> https://www.ecma-international.org/ecma-262/9.0/#sec-sortcompare + +## Rule Details + +This rule aims to ensure all calls of the native `Array#sort` method provide a `compareFunction`, while ignoring calls to user-defined `sort` methods. + +Examples of **incorrect** code for this rule: + +```ts +const array: any[]; +const stringArray: string[]; + +array.sort(); + +// String arrays should be sorted using `String#localeCompare`. +stringArray.sort(); +``` + +Examples of **correct** code for this rule: + +```ts +const array: any[]; +const userDefinedType: { sort(): void }; + +array.sort((a, b) => a - b); +array.sort((a, b) => a.localeCompare(b)); + +userDefinedType.sort(); +``` + +## Options + +The rule accepts an options object with the following properties: + +```ts +type Options = { + /** + * If true, an array which all elements are string is ignored. + */ + ignoreStringArrays?: boolean; +}; + +const defaults = { + ignoreStringArrays: false, +}; +``` + +### `ignoreStringArrays` + +Examples of **incorrect** code for this rule with `{ ignoreStringArrays: true }`: + +```ts +const one = 1; +const two = 2; +const three = 3; +[one, two, three].sort(); +``` + +Examples of **correct** code for this rule with `{ ignoreStringArrays: true }`: + +```ts +const one = '1'; +const two = '2'; +const three = '3'; +[one, two, three].sort(); +``` + +## When Not To Use It + +If you understand the language specification enough, you can turn this rule off safely. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-await.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-await.md new file mode 100644 index 000000000..2d8ad41fd --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-await.md @@ -0,0 +1,32 @@ +# Disallow async functions which have no `await` expression (`require-await`) + +## Rule Details + +This rule extends the base [`eslint/require-await`](https://eslint.org/docs/rules/require-await) rule. +It uses type information to add support for `async` functions that return a `Promise`. + +Examples of **correct** code for this rule: + +```ts +async function returnsPromise1() { + return Promise.resolve(1); +} + +const returnsPromise2 = () => returnsPromise1(); +``` + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "require-await": "off", + "@typescript-eslint/require-await": "error" +} +``` + +## Options + +See [`eslint/require-await` options](https://eslint.org/docs/rules/require-await#options). + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/require-await.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-plus-operands.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-plus-operands.md new file mode 100644 index 000000000..0959f8377 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-plus-operands.md @@ -0,0 +1,58 @@ +# When adding two variables, operands must both be of type number or of type string (`restrict-plus-operands`) + +Examples of **correct** code: + +```ts +var foo = parseInt('5.5', 10) + 10; +var foo = 1n + 1n; +``` + +Examples of **incorrect** code: + +```ts +var foo = '5.5' + 5; +var foo = 1n + 1; +``` + +## Options + +This rule has an object option: + +- `"checkCompoundAssignments": false`: (default) does not check compound assignments (`+=`) +- `"checkCompoundAssignments": true` + +### `checkCompoundAssignments` + +Examples of **incorrect** code for the `{ "checkCompoundAssignments": true }` option: + +```ts +/*eslint @typescript-eslint/restrict-plus-operands: ["error", { "checkCompoundAssignments": true }]*/ + +let foo: string | undefined; +foo += 'some data'; + +let bar: string = ''; +bar += 0; +``` + +Examples of **correct** code for the `{ "checkCompoundAssignments": true }` option: + +```ts +/*eslint @typescript-eslint/restrict-plus-operands: ["error", { "checkCompoundAssignments": true }]*/ + +let foo: number = 0; +foo += 1; + +let bar = ''; +bar += 'test'; +``` + +```json +{ + "@typescript-eslint/restrict-plus-operands": "error" +} +``` + +## Compatibility + +- TSLint: [restrict-plus-operands](https://palantir.github.io/tslint/rules/restrict-plus-operands/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-template-expressions.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-template-expressions.md new file mode 100644 index 000000000..0ee7427dd --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-template-expressions.md @@ -0,0 +1,85 @@ +# Enforce template literal expressions to be of string type (`restrict-template-expressions`) + +Examples of **correct** code: + +```ts +const arg = 'foo'; +const msg1 = `arg = ${arg}`; +const msg2 = `arg = ${arg || 'default'}`; + +const stringWithKindProp: string & { _kind?: 'MyString' } = 'foo'; +const msg3 = `stringWithKindProp = ${stringWithKindProp}`; +``` + +Examples of **incorrect** code: + +```ts +const arg1 = [1, 2]; +const msg1 = `arg1 = ${arg1}`; + +const arg2 = { name: 'Foo' }; +const msg2 = `arg2 = ${arg2 || null}`; +``` + +## Options + +The rule accepts an options object with the following properties: + +```ts +type Options = { + // if true, also allow number type in template expressions + allowNumber?: boolean; + // if true, also allow boolean type in template expressions + allowBoolean?: boolean; + // if true, also allow any in template expressions + allowAny?: boolean; + // if true, also allow null and undefined in template expressions + allowNullish?: boolean; +}; + +const defaults = { + allowNumber: true, + allowBoolean: false, + allowAny: false, + allowNullish: false, +}; +``` + +### `allowNumber` + +Examples of additional **correct** code for this rule with `{ allowNumber: true }`: + +```ts +const arg = 123; +const msg1 = `arg = ${arg}`; +const msg2 = `arg = ${arg || 'zero'}`; +``` + +### `allowBoolean` + +Examples of additional **correct** code for this rule with `{ allowBoolean: true }`: + +```ts +const arg = true; +const msg1 = `arg = ${arg}`; +const msg2 = `arg = ${arg || 'not truthy'}`; +``` + +### `allowAny` + +Examples of additional **correct** code for this rule with `{ allowAny: true }`: + +```ts +const user = JSON.parse('{ "name": "foo" }'); +const msg1 = `arg = ${user.name}`; +const msg2 = `arg = ${user.name || 'the user with no name'}`; +``` + +### `allowNullish` + +Examples of additional **correct** code for this rule with `{ allowNullish: true }`: + +```ts +const arg = condition ? 'ok' : null; +const msg1 = `arg = ${arg}`; +``` diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/return-await.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/return-await.md new file mode 100644 index 000000000..1f0adc71e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/return-await.md @@ -0,0 +1,146 @@ +# Enforces consistent returning of awaited values (`return-await`) + +Returning an awaited promise can make sense for better stack trace information as well as for consistent error handling (returned promises will not be caught in an async function try/catch). + +## Rule Details + +This rule builds on top of the [`eslint/no-return-await`](https://eslint.org/docs/rules/no-return-await) rule. +It expands upon the base rule to add support for optionally requiring `return await` in certain cases. + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "no-return-await": "off", + "@typescript-eslint/return-await": "error" +} +``` + +## Options + +```ts +type Options = 'in-try-catch' | 'always' | 'never'; + +const defaultOptions: Options = 'in-try-catch'; +``` + +### `in-try-catch` + +Requires that a returned promise must be `await`ed in `try-catch-finally` blocks, and disallows it elsewhere. + +Examples of **incorrect** code with `in-try-catch`: + +```ts +async function invalidInTryCatch1() { + try { + return Promise.resolve('try'); + } catch (e) {} +} + +async function invalidInTryCatch2() { + return await Promise.resolve('try'); +} + +async function invalidInTryCatch3() { + return await 'value'; +} +``` + +Examples of **correct** code with `in-try-catch`: + +```ts +async function validInTryCatch1() { + try { + return await Promise.resolve('try'); + } catch (e) {} +} + +async function validInTryCatch2() { + return Promise.resolve('try'); +} + +async function validInTryCatch3() { + return 'value'; +} +``` + +### `always` + +Requires that all returned promises are `await`ed. + +Examples of **incorrect** code with `always`: + +```ts +async function invalidAlways1() { + try { + return Promise.resolve('try'); + } catch (e) {} +} + +async function invalidAlways2() { + return Promise.resolve('try'); +} + +async function invalidAlways3() { + return await 'value'; +} +``` + +Examples of **correct** code with `always`: + +```ts +async function validAlways1() { + try { + return await Promise.resolve('try'); + } catch (e) {} +} + +async function validAlways2() { + return await Promise.resolve('try'); +} + +async function validAlways3() { + return 'value'; +} +``` + +### `never` + +Disallows all `await`ing any returned promises. + +Examples of **incorrect** code with `never`: + +```ts +async function invalidNever1() { + try { + return await Promise.resolve('try'); + } catch (e) {} +} + +async function invalidNever2() { + return await Promise.resolve('try'); +} + +async function invalidNever3() { + return await 'value'; +} +``` + +Examples of **correct** code with `never`: + +```ts +async function validNever1() { + try { + return Promise.resolve('try'); + } catch (e) {} +} + +async function validNever2() { + return Promise.resolve('try'); +} + +async function validNever3() { + return 'value'; +} +``` diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/semi.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/semi.md new file mode 100644 index 000000000..c233d3546 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/semi.md @@ -0,0 +1,26 @@ +# Require or disallow semicolons instead of ASI (`semi`) + +This rule enforces consistent use of semicolons after statements. + +## Rule Details + +This rule extends the base [`eslint/semi`](https://eslint.org/docs/rules/semi) rule. +It adds support for TypeScript features that require semicolons. + +See also the [`@typescript-eslint/member-delimiter-style`](member-delimiter-style.md) rule, which allows you to specify the delimiter for `type` and `interface` members. + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "semi": "off", + "@typescript-eslint/semi": ["error"] +} +``` + +## Options + +See [`eslint/semi` options](https://eslint.org/docs/rules/semi#options). + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/semi.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-function-paren.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-function-paren.md new file mode 100644 index 000000000..db2579e44 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-function-paren.md @@ -0,0 +1,22 @@ +# Enforces consistent spacing before function parenthesis (`space-before-function-paren`) + +## Rule Details + +This rule extends the base [`eslint/space-before-function-paren`](https://eslint.org/docs/rules/space-before-function-paren) rule. +It adds support for generic type parameters on function calls. + +## How to use + +```jsonc +{ + // note you must disable the base rule as it can report incorrect errors + "space-before-function-paren": "off", + "@typescript-eslint/space-before-function-paren": ["error"] +} +``` + +## Options + +See [`eslint/space-before-function-paren` options](https://eslint.org/docs/rules/space-before-function-paren#options). + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/space-before-function-paren.md) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/strict-boolean-expressions.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/strict-boolean-expressions.md new file mode 100644 index 000000000..243d54fda --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/strict-boolean-expressions.md @@ -0,0 +1,162 @@ +# Restricts the types allowed in boolean expressions (`strict-boolean-expressions`) + +Forbids usage of non-boolean types in expressions where a boolean is expected. +`boolean` and `never` types are always allowed. +Additional types which are considered safe in a boolean context can be configured via options. + +The following nodes are considered boolean expressions and their type is checked: + +- Argument to the logical negation operator (`!arg`). +- The condition in a conditional expression (`cond ? x : y`). +- Conditions for `if`, `for`, `while`, and `do-while` statements. +- Operands of logical binary operators (`lhs || rhs` and `lhs && rhs`). + - Right-hand side operand is ignored when it's not a descendant of another boolean expression. + This is to allow usage of boolean operators for their short-circuiting behavior. + +## Examples + +Examples of **incorrect** code for this rule: + +```ts +// nullable numbers are considered unsafe by default +let num: number | undefined = 0; +if (num) { + console.log('num is defined'); +} + +// nullable strings are considered unsafe by default +let str: string | null = null; +if (!str) { + console.log('str is empty'); +} + +// nullable booleans are considered unsafe by default +function foo(bool?: boolean) { + if (bool) { + bar(); + } +} + +// `any`, unconstrained generics and unions of more than one primitive type are disallowed +const foo = (arg: T) => (arg ? 1 : 0); + +// always-truthy and always-falsy types are disallowed +let obj = {}; +while (obj) { + obj = getObj(); +} +``` + +Examples of **correct** code for this rule: + +```tsx +// Using logical operators for their side effects is allowed +const Component = () => { + const entry = map.get('foo') || {}; + return entry &&

Name: {entry.name}

; +}; + +// nullable values should be checked explicitly against null or undefined +let num: number | undefined = 0; +if (num != null) { + console.log('num is defined'); +} + +let str: string | null = null; +if (str != null && !str) { + console.log('str is empty'); +} + +function foo(bool?: boolean) { + if (bool ?? false) { + bar(); + } +} + +// `any` types should be cast to boolean explicitly +const foo = (arg: any) => (Boolean(arg) ? 1 : 0); +``` + +## Options + +```ts +type Options = { + allowString?: boolean; + allowNumber?: boolean; + allowNullableObject?: boolean; + allowNullableBoolean?: boolean; + allowNullableString?: boolean; + allowNullableNumber?: boolean; + allowAny?: boolean; +}; + +const defaultOptions: Options = { + allowString: true, + allowNumber: true, + allowNullableObject: true, + allowNullableBoolean: false, + allowNullableString: false, + allowNullableNumber: false, + allowAny: false, + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false, +}; +``` + +### `allowString` + +Allows `string` in a boolean context. +This is safe because strings have only one falsy value (`""`). +Set this to `false` if you prefer the explicit `str != ""` or `str.length > 0` style. + +### `allowNumber` + +Allows `number` in a boolean context. +This is safe because numbers have only two falsy values (`0` and `NaN`). +Set this to `false` if you prefer the explicit `num != 0` and `!Number.isNaN(num)` style. + +### `allowNullableObject` + +Allows `object | function | symbol | null | undefined` in a boolean context. +This is safe because objects, functions and symbols don't have falsy values. +Set this to `false` if you prefer the explicit `obj != null` style. + +### `allowNullableBoolean` + +Allows `boolean | null | undefined` in a boolean context. +This is unsafe because nullable booleans can be either `false` or nullish. +Set this to `false` if you want to enforce explicit `bool ?? false` or `bool ?? true` style. +Set this to `true` if you don't mind implicitly treating false the same as a nullish value. + +### `allowNullableString` + +Allows `string | null | undefined` in a boolean context. +This is unsafe because nullable strings can be either an empty string or nullish. +Set this to `true` if you don't mind implicitly treating an empty string the same as a nullish value. + +### `allowNullableNumber` + +Allows `number | null | undefined` in a boolean context. +This is unsafe because nullable numbers can be either a falsy number or nullish. +Set this to `true` if you don't mind implicitly treating zero or NaN the same as a nullish value. + +### `allowAny` + +Allows `any` in a boolean context. +This is unsafe for obvious reasons. +Set this to `true` at your own risk. + +### `allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing` + +If this is set to `false`, then the rule will error on every file whose `tsconfig.json` does _not_ have the `strictNullChecks` compiler option (or `strict`) set to `true`. + +Without `strictNullChecks`, TypeScript essentially erases `undefined` and `null` from the types. This means when this rule inspects the types from a variable, **it will not be able to tell that the variable might be `null` or `undefined`**, which essentially makes this rule a lot less useful. + +You should be using `strictNullChecks` to ensure complete type-safety in your codebase. + +If for some reason you cannot turn on `strictNullChecks`, but still want to use this rule - you can use this option to allow it - but know that the behavior of this rule is _undefined_ with the compiler option turned off. We will not accept bug reports if you are using this option. + +## Related To + +- TSLint: [strict-boolean-expressions](https://palantir.github.io/tslint/rules/strict-boolean-expressions) + +- [no-unnecessary-condition](./no-unnecessary-condition.md) - Similar rule which reports always-truthy and always-falsy values in conditions diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/switch-exhaustiveness-check.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/switch-exhaustiveness-check.md new file mode 100644 index 000000000..a26c6e6df --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/switch-exhaustiveness-check.md @@ -0,0 +1,103 @@ +# Exhaustiveness checking in switch with union type (`switch-exhaustiveness-check`) + +Union type may have a lot of parts. It's easy to forget to consider all cases in switch. This rule reminds which parts are missing. If domain of the problem requires to have only a partial switch, developer may _explicitly_ add a default clause. + +Examples of **incorrect** code for this rule: + +```ts +type Day = + | 'Monday' + | 'Tuesday' + | 'Wednesday' + | 'Thursday' + | 'Friday' + | 'Saturday' + | 'Sunday'; + +const day = 'Monday' as Day; +let result = 0; + +switch (day) { + case 'Monday': { + result = 1; + break; + } +} +``` + +Examples of **correct** code for this rule: + +```ts +type Day = + | 'Monday' + | 'Tuesday' + | 'Wednesday' + | 'Thursday' + | 'Friday' + | 'Saturday' + | 'Sunday'; + +const day = 'Monday' as Day; +let result = 0; + +switch (day) { + case 'Monday': { + result = 1; + break; + } + case 'Tuesday': { + result = 2; + break; + } + case 'Wednesday': { + result = 3; + break; + } + case 'Thursday': { + result = 4; + break; + } + case 'Friday': { + result = 5; + break; + } + case 'Saturday': { + result = 6; + break; + } + case 'Sunday': { + result = 7; + break; + } +} +``` + +or + +```ts +type Day = + | 'Monday' + | 'Tuesday' + | 'Wednesday' + | 'Thursday' + | 'Friday' + | 'Saturday' + | 'Sunday'; + +const day = 'Monday' as Day; +let result = 0; + +switch (day) { + case 'Monday': { + result = 1; + break; + } + default: { + result = 42; + } +} +``` + +## When Not To Use It + +If program doesn't have union types with many parts. Downside of this rule is the need for type information, so it's slower than regular rules. diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/triple-slash-reference.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/triple-slash-reference.md new file mode 100644 index 000000000..af9e5498b --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/triple-slash-reference.md @@ -0,0 +1,58 @@ +# Sets preference level for triple slash directives versus ES6-style import declarations (`triple-slash-reference`) + +Use of triple-slash reference type directives is discouraged in favor of the newer `import` style. This rule allows you to ban use of `/// `, `/// `, or `/// ` directives. + +Consider using this rule in place of [`no-triple-slash-reference`](./no-triple-slash-reference.md) which has been deprecated. + +## Rule Details + +With `{ "path": "never", "types": "never", "lib": "never" }` options set, the following will all be **incorrect** usage: + +```ts +/// +/// +/// +``` + +Examples of **incorrect** code for the `{ "types": "prefer-import" }` option. Note that these are only errors when **both** styles are used for the **same** module: + +```ts +/// +import * as foo from 'foo'; +``` + +```ts +/// +import foo = require('foo'); +``` + +With `{ "path": "always", "types": "always", "lib": "always" }` options set, the following will all be **correct** usage: + +```ts +/// +/// +/// +``` + +Examples of **correct** code for the `{ "types": "prefer-import" }` option: + +```ts +import * as foo from 'foo'; +``` + +```ts +import foo = require('foo'); +``` + +## When To Use It + +If you want to ban use of one or all of the triple slash reference directives, or any time you might use triple-slash type reference directives and ES6 import declarations in the same file. + +## When Not To Use It + +If you want to use all flavors of triple slash reference directives. + +## Compatibility + +- TSLint: [no-reference](http://palantir.github.io/tslint/rules/no-reference/) +- TSLint: [no-reference-import](https://palantir.github.io/tslint/rules/no-reference-import/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/type-annotation-spacing.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/type-annotation-spacing.md new file mode 100644 index 000000000..32b7b6558 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/type-annotation-spacing.md @@ -0,0 +1,291 @@ +# Require consistent spacing around type annotations (`type-annotation-spacing`) + +Spacing around type annotations improves readability of the code. Although the most commonly used style guideline for type annotations in TypeScript prescribes adding a space after the colon, but not before it, it is subjective to the preferences of a project. For example: + + +```ts +// with space after, but not before (default if no option is specified) +let foo: string = "bar"; + +// with no spaces +let foo:string = "bar"; + +// with space before and after +let foo : string = "bar"; + +// with space before, but not after +let foo :string = "bar"; + +// with spaces before and after the fat arrow (default if no option is specified) +type Foo = (string: name) => string; + +// with no spaces between the fat arrow +type Foo = (string: name)=>string; + +// with space after, but not before the fat arrow +type Foo = (string: name)=> string; + +// with space before, but not after the fat arrow +type Foo = (string: name) =>string; +``` + +## Rule Details + +This rule aims to enforce specific spacing patterns around type annotations and function types in type literals. + +## Options + +This rule has an object option: + +- `"before": false`, (default for colon) disallows spaces before the colon/arrow. +- `"before": true`, (default for arrow) requires a space before the colon/arrow. +- `"after": true`, (default) requires a space after the colon/arrow. +- `"after": false`, disallows spaces after the colon/arrow. +- `"overrides"`, overrides the default options for type annotations with `colon` (e.g. `const foo: string`) and function types with `arrow` (e.g. `type Foo = () => {}`). Additionally allows granular overrides for `variable` (`const foo: string`),`parameter` (`function foo(bar: string) {...}`),`property` (`interface Foo { bar: string }`) and `returnType` (`function foo(): string {...}`) annotations. + +### defaults + +Examples of **incorrect** code for this rule with no options at all: + + +```ts +let foo:string = "bar"; +let foo :string = "bar"; +let foo : string = "bar"; + +function foo():string {} +function foo() :string {} +function foo() : string {} + +class Foo { + name:string; +} + +class Foo { + name :string; +} + +class Foo { + name : string; +} + +type Foo = ()=>{}; +type Foo = () =>{}; +type Foo = ()=> {}; +``` + +Examples of **correct** code for this rule with no options at all: + + +```ts +let foo: string = "bar"; + +function foo(): string {} + +class Foo { + name: string; +} + +type Foo = () => {}; +``` + +### after + +Examples of **incorrect** code for this rule with `{ "before": false, "after": true }`: + + +```ts +let foo:string = "bar"; +let foo :string = "bar"; +let foo : string = "bar"; + +function foo():string {} +function foo() :string {} +function foo() : string {} + +class Foo { + name:string; +} + +class Foo { + name :string; +} + +class Foo { + name : string; +} + +type Foo = ()=>{}; +type Foo = () =>{}; +type Foo = () => {}; +``` + +Examples of **correct** code for this rule with `{ "before": false, "after": true }`: + + +```ts +let foo: string = "bar"; + +function foo(): string {} + +class Foo { + name: string; +} + +type Foo = ()=> {}; +``` + +### before + +Examples of **incorrect** code for this rule with `{ "before": true, "after": true }` options: + + +```ts +let foo: string = "bar"; +let foo:string = "bar"; +let foo :string = "bar"; + +function foo(): string {} +function foo():string {} +function foo() :string {} + +class Foo { + name: string; +} + +class Foo { + name:string; +} + +class Foo { + name :string; +} + +type Foo = ()=>{}; +type Foo = () =>{}; +type Foo = ()=> {}; +``` + +Examples of **correct** code for this rule with `{ "before": true, "after": true }` options: + + +```ts +let foo : string = "bar"; + +function foo() : string {} + +class Foo { + name : string; +} + +type Foo = () => {}; +``` + +### overrides - colon + +Examples of **incorrect** code for this rule with `{ "before": false, "after": false, overrides: { colon: { before: true, after: true }} }` options: + + +```ts +let foo: string = "bar"; +let foo:string = "bar"; +let foo :string = "bar"; + +function foo(): string {} +function foo():string {} +function foo() :string {} + +class Foo { + name: string; +} + +class Foo { + name:string; +} + +class Foo { + name :string; +} + +type Foo = () =>{}; +type Foo = ()=> {}; +type Foo = () => {}; +``` + +Examples of **correct** code for this rule with `{ "before": false, "after": false, overrides: { colon: { before: true, after: true }} }` options: + + +```ts +let foo : string = "bar"; + +function foo() : string {} + +class Foo { + name : string; +} + +type Foo = { + name: (name : string)=>string; +} + +type Foo = ()=>{}; +``` + +### overrides - arrow + +Examples of **incorrect** code for this rule with `{ "before": false, "after": false, overrides: { arrow: { before: true, after: true }} }` options: + + +```ts +let foo: string = "bar"; +let foo : string = "bar"; +let foo :string = "bar"; + +function foo(): string {} +function foo():string {} +function foo() :string {} + +class Foo { + name: string; +} + +class Foo { + name : string; +} + +class Foo { + name :string; +} + +type Foo = ()=>{}; +type Foo = () =>{}; +type Foo = ()=> {}; +``` + +Examples of **correct** code for this rule with `{ "before": false, "after": false, overrides: { arrow: { before: true, after: true }} }` options: + + +```ts +let foo:string = "bar"; + +function foo():string {} + +class Foo { + name:string; +} + +type Foo = () => {}; +``` + +## When Not To Use It + +If you don't want to enforce spacing for your type annotations, you can safely turn this rule off. + +## Further Reading + +- [TypeScript Type System](https://basarat.gitbooks.io/typescript/docs/types/type-system.html) +- [Type Inference](https://www.typescriptlang.org/docs/handbook/type-inference.html) + +## Compatibility + +- TSLint: [`typedef-whitespace`](https://palantir.github.io/tslint/rules/typedef-whitespace/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/typedef.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/typedef.md new file mode 100644 index 000000000..6c96fa031 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/typedef.md @@ -0,0 +1,308 @@ +# Requires type annotations to exist (`typedef`) + +TypeScript cannot always infer types for all places in code. +Some locations require type annotations for their types to be inferred. + +```ts +class ContainsText { + // There must be a type annotation here to infer the type + delayedText: string; + + // `typedef` requires a type annotation here to maintain consistency + immediateTextExplicit: string = 'text'; + + // This is still a string type because of its initial value + immediateTextImplicit = 'text'; +} +``` + +**_Note:_** requiring type annotations unnecessarily can be cumbersome to maintain and generally reduces code readability. +TypeScript is often better at inferring types than easily written type annotations would allow. + +**Instead of enabling `typedef`, it is generally recommended to use the `--noImplicitAny` and `--strictPropertyInitialization` compiler options to enforce type annotations only when useful.** + +## Rule Details + +This rule can enforce type annotations in locations regardless of whether they're required. +This is typically used to maintain consistency for element types that sometimes require them. + +> To enforce type definitions existing on call signatures as per TSLint's `arrow-call-signature` and `call-signature` options, use `explicit-function-return-type`, or `explicit-module-boundary-types`. + +## Options + +```ts +type Options = { + arrayDestructuring?: boolean; + arrowParameter?: boolean; + memberVariableDeclaration?: boolean; + objectDestructuring?: boolean; + parameter?: boolean; + propertyDeclaration?: boolean; + variableDeclaration?: boolean; + variableDeclarationIgnoreFunction?: boolean; +}; + +const defaultOptions: Options = { + arrayDestructuring: false, + arrowParameter: false, + memberVariableDeclaration: false, + objectDestructuring: false, + parameter: false, + propertyDeclaration: false, + variableDeclaration: false, + variableDeclarationIgnoreFunction: false, +}; +``` + +For example, with the following configuration: + +```json +{ + "rules": { + "@typescript-eslint/typedef": [ + "error", + { + "arrowParameter": true, + "variableDeclaration": true + } + ] + } +} +``` + +- Type annotations on arrow function parameters are required +- Type annotations on variables are required + +### `arrayDestructuring` + +Whether to enforce type annotations on variables declared using array destructuring. + +Examples of **incorrect** code with `{ "arrayDestructuring": true }`: + +```ts +const [a] = [1]; +const [b, c] = [1, 2]; +``` + +Examples of **correct** code with `{ "arrayDestructuring": true }`: + +```ts +const [a]: number[] = [1]; +const [b]: [number] = [2]; +const [c, d]: [boolean, string] = [true, 'text']; + +for (const [key, val] of new Map([['key', 1]])) { +} +``` + +### `arrowParameter` + +Whether to enforce type annotations for parameters of arrow functions. + +Examples of **incorrect** code with `{ "arrowParameter": true }`: + +```ts +const logsSize = size => console.log(size); + +['hello', 'world'].map(text => text.length); + +const mapper = { + map: text => text + '...', +}; +``` + +Examples of **correct** code with `{ "arrowParameter": true }`: + +```ts +const logsSize = (size: number) => console.log(text); + +['hello', 'world'].map((text: string) => text.length); + +const mapper = { + map: (text: string) => text + '...', +}; +``` + +### `memberVariableDeclaration` + +Whether to enforce type annotations on member variables of classes. + +Examples of **incorrect** code with `{ "memberVariableDeclaration": true }`: + +```ts +class ContainsText { + delayedText; + immediateTextImplicit = 'text'; +} +``` + +Examples of **correct** code with `{ "memberVariableDeclaration": true }`: + +```ts +class ContainsText { + delayedText: string; + immediateTextImplicit: string = 'text'; +} +``` + +### `objectDestructuring` + +Whether to enforce type annotations on variables declared using object destructuring. + +Examples of **incorrect** code with `{ "objectDestructuring": true }`: + +```ts +const { length } = 'text'; +const [b, c] = Math.random() ? [1, 2] : [3, 4]; +``` + +Examples of **correct** code with `{ "objectDestructuring": true }`: + +```ts +const { length }: { length: number } = 'text'; +const [b, c]: [number, number] = Math.random() ? [1, 2] : [3, 4]; + +for (const { key, val } of [{ key: 'key', val: 1 }]) { +} +``` + +### `parameter` + +Whether to enforce type annotations for parameters of functions and methods. + +Examples of **incorrect** code with `{ "parameter": true }`: + +```ts +function logsSize(size): void { + console.log(size); +} + +const doublesSize = function (size): number { + return size * 2; +}; + +const divider = { + curriesSize(size): number { + return size; + }, + dividesSize: function (size): number { + return size / 2; + }, +}; + +class Logger { + log(text): boolean { + console.log('>', text); + return true; + } +} +``` + +Examples of **correct** code with `{ "parameter": true }`: + +```ts +function logsSize(size: number): void { + console.log(size); +} + +const doublesSize = function (size: number): number { + return size * 2; +}; + +const divider = { + curriesSize(size: number): number { + return size; + }, + dividesSize: function (size: number): number { + return size / 2; + }, +}; + +class Logger { + log(text: boolean): boolean { + console.log('>', text); + return true; + } +} +``` + +### `propertyDeclaration` + +Whether to enforce type annotations for properties of interfaces and types. + +Examples of **incorrect** code with `{ "propertyDeclaration": true }`: + +```ts +type Members = { + member; + otherMember; +}; +``` + +Examples of **correct** code with `{ "propertyDeclaration": true }`: + +```ts +type Members = { + member: boolean; + otherMember: string; +}; +``` + +### `variableDeclaration` + +Whether to enforce type annotations for variable declarations, excluding array and object destructuring. + +Examples of **incorrect** code with `{ "variableDeclaration": true }`: + +```ts +const text = 'text'; +let initialText = 'text'; +let delayedText; +``` + +Examples of **correct** code with `{ "variableDeclaration": true }`: + +```ts +const text: string = 'text'; +let initialText: string = 'text'; +let delayedText: string; +``` + +### `variableDeclarationIgnoreFunction` + +Ignore variable declarations for non-arrow and arrow functions. + +Examples of **incorrect** code with `{ "variableDeclaration": true, "variableDeclarationIgnoreFunction": true }`: + +```ts +const text = 'text'; +``` + +Examples of **correct** code with `{ "variableDeclaration": true, "variableDeclarationIgnoreFunction": true }`: + +```ts +const a = (): void => {}; +const b = function (): void => {}; +const c: () => void = (): void => {}; + +class Foo { + a = (): void => {}; + b = function (): void => {}; + c = () => void = (): void => {}; +} +``` + +## When Not To Use It + +If you are using stricter TypeScript compiler options, particularly `--noImplicitAny` and/or `--strictPropertyInitialization`, you likely don't need this rule. + +In general, if you do not consider the cost of writing unnecessary type annotations reasonable, then do not use this rule. + +## Further Reading + +- [TypeScript Type System](https://basarat.gitbooks.io/typescript/docs/types/type-system.html) +- [Type Inference](https://www.typescriptlang.org/docs/handbook/type-inference.html) + +## Compatibility + +- TSLint: [`typedef`](https://palantir.github.io/tslint/rules/typedef) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unbound-method.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unbound-method.md new file mode 100644 index 000000000..0de7b17ab --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unbound-method.md @@ -0,0 +1,92 @@ +# Enforces unbound methods are called with their expected scope (`unbound-method`) + +Warns when a method is used outside of a method call. + +Class functions don't preserve the class scope when passed as standalone variables. + +## Rule Details + +Examples of **incorrect** code for this rule + +```ts +class MyClass { + public log(): void { + console.log(this); + } +} + +const instance = new MyClass(); + +// This logs the global scope (`window`/`global`), not the class instance +const myLog = instance.log; +myLog(); + +// This log might later be called with an incorrect scope +const { log } = instance; +``` + +Examples of **correct** code for this rule + +```ts +class MyClass { + public logUnbound(): void { + console.log(this); + } + + public logBound = () => console.log(this); +} + +const instance = new MyClass(); + +// logBound will always be bound with the correct scope +const { logBound } = instance; +logBound(); + +// .bind and lambdas will also add a correct scope +const dotBindLog = instance.logBound.bind(instance); +const innerLog = () => instance.logBound(); +``` + +## Options + +The rule accepts an options object with the following property: + +- `ignoreStatic` to not check whether `static` methods are correctly bound + +### `ignoreStatic` + +Examples of **correct** code for this rule with `{ ignoreStatic: true }`: + +```ts +class OtherClass { + static log() { + console.log(OtherClass); + } +} + +// With `ignoreStatic`, statics are assumed to not rely on a particular scope +const { log } = OtherClass; + +log(); +``` + +### Example + +```json +{ + "@typescript-eslint/unbound-method": [ + "error", + { + "ignoreStatic": true + } + ] +} +``` + +## When Not To Use It + +If your code intentionally waits to bind methods after use, such as by passing a `scope: this` along with the method, you can disable this rule. + +## Related To + +- TSLint: [no-unbound-method](https://palantir.github.io/tslint/rules/no-unbound-method/) diff --git a/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unified-signatures.md b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unified-signatures.md new file mode 100644 index 000000000..7ed5116c2 --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unified-signatures.md @@ -0,0 +1,33 @@ +# Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter (`unified-signatures`) + +Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter. + +## Rule Details + +This rule aims to keep the source code as maintainable as possible by reducing the amount of overloads. + +Examples of **incorrect** code for this rule: + +```ts +function f(x: number): void; +function f(x: string): void; +``` + +```ts +f(): void; +f(...x: number[]): void; +``` + +Examples of **correct** code for this rule: + +```ts +function f(x: number | string): void; +``` + +```ts +function f(x?: ...number[]): void; +``` + +## Related to + +- TSLint: [`unified-signatures`](https://palantir.github.io/tslint/rules/unified-signatures/) diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/.editorconfig b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/.editorconfig similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/.editorconfig rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/.editorconfig diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/.fimbullinter.yaml b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/.fimbullinter.yaml similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/.fimbullinter.yaml rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/.fimbullinter.yaml diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/.wotanrc.yaml b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/.wotanrc.yaml similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/.wotanrc.yaml rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/.wotanrc.yaml diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/CHANGELOG.md b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/CHANGELOG.md similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/CHANGELOG.md rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/CHANGELOG.md diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/LICENSE b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/LICENSE similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/LICENSE rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/LICENSE diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/README.md b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/README.md similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/README.md rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/README.md diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/index.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/index.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/index.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/index.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/index.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/index.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/index.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/index.js diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/package.json b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/package.json similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/package.json rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/package.json diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/2.8/index.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/2.8/index.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/2.8/index.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/2.8/index.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/2.8/index.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/2.8/index.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/2.8/index.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/2.8/index.js diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/2.8/node.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/2.8/node.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/2.8/node.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/2.8/node.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/2.8/node.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/2.8/node.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/2.8/node.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/2.8/node.js diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/2.8/type.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/2.8/type.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/2.8/type.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/2.8/type.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/2.8/type.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/2.8/type.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/2.8/type.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/2.8/type.js diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/2.9/index.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/2.9/index.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/2.9/index.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/2.9/index.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/2.9/index.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/2.9/index.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/2.9/index.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/2.9/index.js diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/2.9/node.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/2.9/node.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/2.9/node.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/2.9/node.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/2.9/node.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/2.9/node.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/2.9/node.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/2.9/node.js diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/2.9/type.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/2.9/type.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/2.9/type.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/2.9/type.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/2.9/type.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/2.9/type.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/2.9/type.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/2.9/type.js diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/3.0/index.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/3.0/index.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/3.0/index.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/3.0/index.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/3.0/index.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/3.0/index.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/3.0/index.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/3.0/index.js diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/3.0/node.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/3.0/node.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/3.0/node.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/3.0/node.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/3.0/node.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/3.0/node.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/3.0/node.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/3.0/node.js diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/3.0/type.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/3.0/type.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/3.0/type.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/3.0/type.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/3.0/type.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/3.0/type.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/3.0/type.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/3.0/type.js diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/3.2/index.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/3.2/index.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/3.2/index.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/3.2/index.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/3.2/index.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/3.2/index.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/3.2/index.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/3.2/index.js diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/3.2/node.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/3.2/node.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/3.2/node.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/3.2/node.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/3.2/node.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/3.2/node.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/3.2/node.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/3.2/node.js diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/3.2/type.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/3.2/type.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/3.2/type.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/3.2/type.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/3.2/type.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/3.2/type.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/3.2/type.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/3.2/type.js diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/index.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/index.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/index.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/index.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/index.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/index.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/index.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/index.js diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/next/index.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/next/index.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/next/index.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/next/index.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/next/index.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/next/index.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/next/index.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/next/index.js diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/next/node.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/next/node.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/next/node.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/next/node.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/next/node.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/next/node.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/next/node.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/next/node.js diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/next/type.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/next/type.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/next/type.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/next/type.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/next/type.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/next/type.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/next/type.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/next/type.js diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/node.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/node.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/node.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/node.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/node.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/node.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/node.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/node.js diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/type.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/type.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/type.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/type.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/type.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/type.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/typeguard/type.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/typeguard/type.js diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/util/control-flow.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/util/control-flow.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/util/control-flow.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/util/control-flow.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/util/control-flow.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/util/control-flow.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/util/control-flow.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/util/control-flow.js diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/util/convert-ast.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/util/convert-ast.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/util/convert-ast.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/util/convert-ast.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/util/convert-ast.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/util/convert-ast.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/util/convert-ast.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/util/convert-ast.js diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/util/index.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/util/index.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/util/index.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/util/index.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/util/index.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/util/index.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/util/index.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/util/index.js diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/util/type.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/util/type.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/util/type.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/util/type.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/util/type.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/util/type.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/util/type.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/util/type.js diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/util/usage.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/util/usage.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/util/usage.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/util/usage.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/util/usage.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/util/usage.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/util/usage.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/util/usage.js diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/util/util.d.ts b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/util/util.d.ts similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/util/util.d.ts rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/util/util.d.ts diff --git a/node_modules/tslint-eslint-rules/node_modules/tsutils/util/util.js b/node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/util/util.js similarity index 100% rename from node_modules/tslint-eslint-rules/node_modules/tsutils/util/util.js rename to node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils/util/util.js diff --git a/node_modules/@typescript-eslint/eslint-plugin/package.json b/node_modules/@typescript-eslint/eslint-plugin/package.json new file mode 100644 index 000000000..a6a1ba32e --- /dev/null +++ b/node_modules/@typescript-eslint/eslint-plugin/package.json @@ -0,0 +1,76 @@ +{ + "name": "@typescript-eslint/eslint-plugin", + "version": "4.1.0", + "description": "TypeScript plugin for ESLint", + "keywords": [ + "eslint", + "eslintplugin", + "eslint-plugin", + "typescript" + ], + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "files": [ + "dist", + "docs", + "package.json", + "README.md", + "LICENSE" + ], + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/eslint-plugin" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "license": "MIT", + "main": "dist/index.js", + "scripts": { + "build": "tsc -b tsconfig.build.json", + "check:docs": "jest tests/docs.test.ts --runTestsByPath --silent --runInBand", + "check:configs": "jest tests/configs.test.ts --runTestsByPath --silent --runInBand", + "clean": "tsc -b tsconfig.build.json --clean", + "postclean": "rimraf dist", + "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", + "generate:configs": "../../node_modules/.bin/ts-node --files --transpile-only tools/generate-configs.ts", + "generate:rules-lists": "../../node_modules/.bin/ts-node --files --transpile-only tools/generate-rules-lists.ts", + "lint": "eslint . --ext .js,.ts --ignore-path ../../.eslintignore", + "test": "jest --coverage", + "typecheck": "tsc -p tsconfig.json --noEmit" + }, + "dependencies": { + "@typescript-eslint/experimental-utils": "4.1.0", + "@typescript-eslint/scope-manager": "4.1.0", + "debug": "^4.1.1", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^3.0.0", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "devDependencies": { + "@types/debug": "*", + "@types/marked": "^1.1.0", + "@types/prettier": "*", + "chalk": "^4.0.0", + "marked": "^1.0.0", + "prettier": "*", + "typescript": "*" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^4.0.0", + "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "gitHead": "00a24706222254774121ee62038e67d0efa993e7" +} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/CHANGELOG.md b/node_modules/@typescript-eslint/experimental-utils/CHANGELOG.md new file mode 100644 index 000000000..b32112bea --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/CHANGELOG.md @@ -0,0 +1,698 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) + +## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) + +### Features + +* consume new scope analysis package ([#2039](https://github.com/typescript-eslint/typescript-eslint/issues/2039)) ([3be125d](https://github.com/typescript-eslint/typescript-eslint/commit/3be125d9bdbee1984ac6037874edf619213bd3d0)) +* support ESTree optional chaining representation ([#2308](https://github.com/typescript-eslint/typescript-eslint/issues/2308)) ([e9d2ab6](https://github.com/typescript-eslint/typescript-eslint/commit/e9d2ab638b6767700b52797e74b814ea059beaae)) + + + + + +## [3.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.0...v3.10.1) (2020-08-25) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [3.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.1...v3.10.0) (2020-08-24) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +## [3.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.0...v3.9.1) (2020-08-17) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [3.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.8.0...v3.9.0) (2020-08-10) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [3.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.1...v3.8.0) (2020-08-03) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +## [3.7.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.0...v3.7.1) (2020-07-27) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [3.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.1...v3.7.0) (2020-07-20) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [3.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.4.0...v3.5.0) (2020-06-29) + + +### Features + +* add package scope-manager ([#1939](https://github.com/typescript-eslint/typescript-eslint/issues/1939)) ([682eb7e](https://github.com/typescript-eslint/typescript-eslint/commit/682eb7e009c3f22a542882dfd3602196a60d2a1e)) +* split types into their own package ([#2229](https://github.com/typescript-eslint/typescript-eslint/issues/2229)) ([5f45918](https://github.com/typescript-eslint/typescript-eslint/commit/5f4591886f3438329fbf2229b03ac66174334a24)) + + + + + +# [3.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.3.0...v3.4.0) (2020-06-22) + + +### Bug Fixes + +* **experimental-utils:** correct types for TS versions older than 3.8 ([#2217](https://github.com/typescript-eslint/typescript-eslint/issues/2217)) ([5e4dda2](https://github.com/typescript-eslint/typescript-eslint/commit/5e4dda264a7d6a6a1626848e7599faea1ac34922)) +* **experimental-utils:** getParserServices takes a readonly context ([#2235](https://github.com/typescript-eslint/typescript-eslint/issues/2235)) ([26da8de](https://github.com/typescript-eslint/typescript-eslint/commit/26da8de7fcde9eddec63212d79af781c4bb22991)) + + + + + +# [3.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.2.0...v3.3.0) (2020-06-15) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [3.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.1.0...v3.2.0) (2020-06-08) + + +### Bug Fixes + +* **eslint-plugin:** [prefer-optional-chain] handling first member expression ([#2156](https://github.com/typescript-eslint/typescript-eslint/issues/2156)) ([de18660](https://github.com/typescript-eslint/typescript-eslint/commit/de18660a8cf8f7033798646d8c5b0938d1accb12)) + + + + + +# [3.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.2...v3.1.0) (2020-06-01) + + +### Bug Fixes + +* **experimental-utils:** downlevel type declarations for versions older than 3.8 ([#2133](https://github.com/typescript-eslint/typescript-eslint/issues/2133)) ([7925823](https://github.com/typescript-eslint/typescript-eslint/commit/792582326a8065270b69a0ffcaad5a7b4b103ff3)) + + +### Features + +* **eslint-plugin:** [explicit-module-boundary-types] improve accuracy and coverage ([#2135](https://github.com/typescript-eslint/typescript-eslint/issues/2135)) ([caaa859](https://github.com/typescript-eslint/typescript-eslint/commit/caaa8599284d02ab3341e282cad35a52d0fb86c7)) + + + + + +## [3.0.2](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.1...v3.0.2) (2020-05-27) + + +### Bug Fixes + +* regression for eslint v6 ([#2105](https://github.com/typescript-eslint/typescript-eslint/issues/2105)) ([31fc503](https://github.com/typescript-eslint/typescript-eslint/commit/31fc5039ed919e1515fda673c186d5c83eb5beb3)) + + + + + +## [3.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.0...v3.0.1) (2020-05-25) + + +### Bug Fixes + +* **experimental-utils:** export `CLIEngine` & `ESLint` ([#2083](https://github.com/typescript-eslint/typescript-eslint/issues/2083)) ([014341b](https://github.com/typescript-eslint/typescript-eslint/commit/014341bb23261f609fc2a6fe7fece191466a084a)) + + + + + +# [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) + +## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) + +### Bug Fixes + +* **experimental-utils:** add back SourceCode.isSpaceBetweenTokens ([ae82ea4](https://github.com/typescript-eslint/typescript-eslint/commit/ae82ea4a85a4ca332ebe6104e96c59dba30411be)) +* **typescript-estree:** remove now defunct `Import` node type ([f199cbd](https://github.com/typescript-eslint/typescript-eslint/commit/f199cbdbbd892b5ba03bfff66f463f3d9c92ee9b)) + + +### Features + +* **experimental-utils:** upgrade eslint types for v7 ([#2023](https://github.com/typescript-eslint/typescript-eslint/issues/2023)) ([06869c9](https://github.com/typescript-eslint/typescript-eslint/commit/06869c9656fa37936126666845aee40aad546ebd)) +* drop support for node v8 ([#1997](https://github.com/typescript-eslint/typescript-eslint/issues/1997)) ([b6c3b7b](https://github.com/typescript-eslint/typescript-eslint/commit/b6c3b7b84b8d199fa75a46432febd4a364a63217)) +* upgrade to ESLint v7 ([#2022](https://github.com/typescript-eslint/typescript-eslint/issues/2022)) ([208de71](https://github.com/typescript-eslint/typescript-eslint/commit/208de71059746bf38e94bd460346ffb2698a3e12)) +* **eslint-plugin:** [ban-types] rework default options ([#848](https://github.com/typescript-eslint/typescript-eslint/issues/848)) ([8e31d5d](https://github.com/typescript-eslint/typescript-eslint/commit/8e31d5dbe9fe5227fdbefcecfd50ce5dd51360c3)) +* **typescript-estree:** always return parserServices ([#716](https://github.com/typescript-eslint/typescript-eslint/issues/716)) ([5b23443](https://github.com/typescript-eslint/typescript-eslint/commit/5b23443c48f3f62424db3e742243f3568080b946)) + + + + + +# [2.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.33.0...v2.34.0) (2020-05-18) + + +### Features + +* **experimental-utils:** add `suggestion` property for rule modules ([#2033](https://github.com/typescript-eslint/typescript-eslint/issues/2033)) ([f42a5b0](https://github.com/typescript-eslint/typescript-eslint/commit/f42a5b09ebfa173f418a99c552b0cbe221567194)) + + + + + +# [2.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.32.0...v2.33.0) (2020-05-12) + + +### Bug Fixes + +* **experimental-utils:** remove accidental dep on json-schema ([#2010](https://github.com/typescript-eslint/typescript-eslint/issues/2010)) ([1875fba](https://github.com/typescript-eslint/typescript-eslint/commit/1875fbad41f2a3dda8f610f5dcd180c6205b73d3)) + + + + + +# [2.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.31.0...v2.32.0) (2020-05-11) + + +### Features + +* bump dependencies and align AST ([#2007](https://github.com/typescript-eslint/typescript-eslint/issues/2007)) ([18668b7](https://github.com/typescript-eslint/typescript-eslint/commit/18668b78fd7d1e5281af7fc26c76e0ca53297f69)) + + + + + +# [2.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.30.0...v2.31.0) (2020-05-04) + + +### Features + +* **experimental-utils:** expose our RuleTester extension ([#1948](https://github.com/typescript-eslint/typescript-eslint/issues/1948)) ([2dd1638](https://github.com/typescript-eslint/typescript-eslint/commit/2dd1638aaa2658ba99b2341861146b586f489121)) + + + + + +# [2.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.29.0...v2.30.0) (2020-04-27) + + +### Features + +* **experimental-utils:** allow rule options to be a readonly tuple ([#1924](https://github.com/typescript-eslint/typescript-eslint/issues/1924)) ([4ef6788](https://github.com/typescript-eslint/typescript-eslint/commit/4ef67884962b6aac61cc895aaa3ba16aa892ecf4)) + + + + + +# [2.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.28.0...v2.29.0) (2020-04-20) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [2.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.27.0...v2.28.0) (2020-04-13) + + +### Features + +* **eslint-plugin:** add rule `prefer-reduce-type-parameter` ([#1707](https://github.com/typescript-eslint/typescript-eslint/issues/1707)) ([c92d240](https://github.com/typescript-eslint/typescript-eslint/commit/c92d240e49113779053eac32038382b282812afc)) + + + + + +# [2.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.26.0...v2.27.0) (2020-04-06) + + +### Features + +* **experimental-utils:** add types for suggestions from CLIEngine ([#1844](https://github.com/typescript-eslint/typescript-eslint/issues/1844)) ([7c11bd6](https://github.com/typescript-eslint/typescript-eslint/commit/7c11bd66f2d0e5ea9d3943e6b8c66e6ddff50862)) +* **experimental-utils:** update eslint types to match v6.8 ([#1846](https://github.com/typescript-eslint/typescript-eslint/issues/1846)) ([16ce74d](https://github.com/typescript-eslint/typescript-eslint/commit/16ce74d247781ac890dc0baa30c384f97e581b6b)) + + + + + +# [2.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.25.0...v2.26.0) (2020-03-30) + + +### Features + +* **typescript-estree:** add option to ignore certain folders from glob resolution ([#1802](https://github.com/typescript-eslint/typescript-eslint/issues/1802)) ([1e29e69](https://github.com/typescript-eslint/typescript-eslint/commit/1e29e69b289d61107a7de67592beae331ba50222)) + + + + + +# [2.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.24.0...v2.25.0) (2020-03-23) + + +### Features + +* **experimental-utils:** expose ast utility functions ([#1670](https://github.com/typescript-eslint/typescript-eslint/issues/1670)) ([3eb5d45](https://github.com/typescript-eslint/typescript-eslint/commit/3eb5d4525e95c8ab990f55588b8d830a02ce5a9c)) + + + + + +# [2.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.23.0...v2.24.0) (2020-03-16) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [2.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.22.0...v2.23.0) (2020-03-09) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [2.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.21.0...v2.22.0) (2020-03-02) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [2.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.20.0...v2.21.0) (2020-02-24) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [2.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.2...v2.20.0) (2020-02-17) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +## [2.19.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.1...v2.19.2) (2020-02-10) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +## [2.19.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.0...v2.19.1) (2020-02-10) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [2.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.18.0...v2.19.0) (2020-02-03) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [2.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.17.0...v2.18.0) (2020-01-27) + + +### Bug Fixes + +* improve token types and add missing type guards ([#1497](https://github.com/typescript-eslint/typescript-eslint/issues/1497)) ([ce41d7d](https://github.com/typescript-eslint/typescript-eslint/commit/ce41d7de33bcb7ccf96c03ac1438304c5a49ff54)) +* **experimental-utils:** widen type of `settings` property ([#1527](https://github.com/typescript-eslint/typescript-eslint/issues/1527)) ([b515e47](https://github.com/typescript-eslint/typescript-eslint/commit/b515e47af2bc914c7ebcfa4be813409dcd86b1c3)) + + +### Features + +* **experimental-utils:** make RuleMetaData.docs optional ([#1462](https://github.com/typescript-eslint/typescript-eslint/issues/1462)) ([cde97ac](https://github.com/typescript-eslint/typescript-eslint/commit/cde97aca24df5a0f28f37006ed130ebc217fb2ad)) +* **parser:** clean up scope-analysis types ([#1481](https://github.com/typescript-eslint/typescript-eslint/issues/1481)) ([4a727fa](https://github.com/typescript-eslint/typescript-eslint/commit/4a727fa083d749dba9eaf39322856f5f69c28cd8)) + + + + + +# [2.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.16.0...v2.17.0) (2020-01-20) + + +### Features + +* **experimental-utils:** expose getParserServices from utils ([#1448](https://github.com/typescript-eslint/typescript-eslint/issues/1448)) ([982c8bc](https://github.com/typescript-eslint/typescript-eslint/commit/982c8bc)) + + + + + +# [2.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.15.0...v2.16.0) (2020-01-13) + + +### Features + +* **typescript-estree:** add parserOption to turn on debug logs ([#1413](https://github.com/typescript-eslint/typescript-eslint/issues/1413)) ([25092fd](https://github.com/typescript-eslint/typescript-eslint/commit/25092fd)) +* **typescript-estree:** add strict type mapping to esTreeNodeToTSNodeMap ([#1382](https://github.com/typescript-eslint/typescript-eslint/issues/1382)) ([d3d70a3](https://github.com/typescript-eslint/typescript-eslint/commit/d3d70a3)) + + + + + +# [2.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.14.0...v2.15.0) (2020-01-06) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [2.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.13.0...v2.14.0) (2019-12-30) + + +### Features + +* add internal eslint plugin for repo-specific lint rules ([#1373](https://github.com/typescript-eslint/typescript-eslint/issues/1373)) ([3a15413](https://github.com/typescript-eslint/typescript-eslint/commit/3a15413)) + + + + + +# [2.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.12.0...v2.13.0) (2019-12-23) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [2.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.11.0...v2.12.0) (2019-12-16) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [2.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.10.0...v2.11.0) (2019-12-09) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [2.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.9.0...v2.10.0) (2019-12-02) + + +### Features + +* **eslint-plugin:** [no-non-null-assert] add suggestion fixer ([#1260](https://github.com/typescript-eslint/typescript-eslint/issues/1260)) ([e350a21](https://github.com/typescript-eslint/typescript-eslint/commit/e350a21)) +* **experimental-utils:** add isSpaceBetween declaration to Sou… ([#1268](https://github.com/typescript-eslint/typescript-eslint/issues/1268)) ([f83f04b](https://github.com/typescript-eslint/typescript-eslint/commit/f83f04b)) + + + + + +# [2.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.8.0...v2.9.0) (2019-11-25) + + +### Features + +* suggestion types, suggestions for no-explicit-any ([#1250](https://github.com/typescript-eslint/typescript-eslint/issues/1250)) ([b16a4b6](https://github.com/typescript-eslint/typescript-eslint/commit/b16a4b6)) +* **eslint-plugin:** add prefer-nullish-coalescing ([#1069](https://github.com/typescript-eslint/typescript-eslint/issues/1069)) ([a9cd399](https://github.com/typescript-eslint/typescript-eslint/commit/a9cd399)) +* **eslint-plugin:** add rule prefer-optional-chain ([#1213](https://github.com/typescript-eslint/typescript-eslint/issues/1213)) ([ad7e1a7](https://github.com/typescript-eslint/typescript-eslint/commit/ad7e1a7)) + + + + + +# [2.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.7.0...v2.8.0) (2019-11-18) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [2.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.1...v2.7.0) (2019-11-11) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +## [2.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.0...v2.6.1) (2019-11-04) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [2.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.5.0...v2.6.0) (2019-10-28) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [2.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.4.0...v2.5.0) (2019-10-21) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [2.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.3...v2.4.0) (2019-10-14) + + +### Bug Fixes + +* support long running "watch" lint sessions ([#973](https://github.com/typescript-eslint/typescript-eslint/issues/973)) ([854620e](https://github.com/typescript-eslint/typescript-eslint/commit/854620e)) + + +### Features + +* **typescript-estree:** support for parsing 3.7 features ([#1045](https://github.com/typescript-eslint/typescript-eslint/issues/1045)) ([623febf](https://github.com/typescript-eslint/typescript-eslint/commit/623febf)) + + + + + +## [2.3.3](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.2...v2.3.3) (2019-10-07) + + +### Bug Fixes + +* **experimental-utils:** remove Rule.meta.extraDescription ([#1036](https://github.com/typescript-eslint/typescript-eslint/issues/1036)) ([192e23d](https://github.com/typescript-eslint/typescript-eslint/commit/192e23d)) + + + + + +## [2.3.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.1...v2.3.2) (2019-09-30) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +## [2.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.0...v2.3.1) (2019-09-23) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [2.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.2.0...v2.3.0) (2019-09-16) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [2.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.1.0...v2.2.0) (2019-09-09) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [2.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.0.0...v2.1.0) (2019-09-02) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [2.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.13.0...v2.0.0) (2019-08-13) + + +### Bug Fixes + +* **eslint-plugin:** add `Literal` to `RuleListener` types ([#824](https://github.com/typescript-eslint/typescript-eslint/issues/824)) ([3c902a1](https://github.com/typescript-eslint/typescript-eslint/commit/3c902a1)) +* **utils:** add ES2019 as valid `ecmaVersion` ([#746](https://github.com/typescript-eslint/typescript-eslint/issues/746)) ([d11fbbe](https://github.com/typescript-eslint/typescript-eslint/commit/d11fbbe)) + + +### Features + +* explicitly support eslint v6 ([#645](https://github.com/typescript-eslint/typescript-eslint/issues/645)) ([34a7cf6](https://github.com/typescript-eslint/typescript-eslint/commit/34a7cf6)) + + +* feat(eslint-plugin)!: recommended-requiring-type-checking config (#846) ([d3470c9](https://github.com/typescript-eslint/typescript-eslint/commit/d3470c9)), closes [#846](https://github.com/typescript-eslint/typescript-eslint/issues/846) +* feat(eslint-plugin)!: change recommended config (#729) ([428567d](https://github.com/typescript-eslint/typescript-eslint/commit/428567d)), closes [#729](https://github.com/typescript-eslint/typescript-eslint/issues/729) +* feat(eslint-plugin)!: add rule `consistent-type-assertions` (#731) ([92e98de](https://github.com/typescript-eslint/typescript-eslint/commit/92e98de)), closes [#731](https://github.com/typescript-eslint/typescript-eslint/issues/731) + + +### BREAKING CHANGES + +* removed some rules from recommended config +* recommended config changes are considered breaking +* Merges both no-angle-bracket-type-assertion and no-object-literal-type-assertion into one rule +* Node 6 is no longer supported + + + + + +# [1.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.12.0...v1.13.0) (2019-07-21) + + +### Bug Fixes + +* Correct `@types/json-schema` dependency ([#675](https://github.com/typescript-eslint/typescript-eslint/issues/675)) ([a5398ce](https://github.com/typescript-eslint/typescript-eslint/commit/a5398ce)) +* **utils:** move `typescript` from peer dep to dev dep ([#712](https://github.com/typescript-eslint/typescript-eslint/issues/712)) ([f949355](https://github.com/typescript-eslint/typescript-eslint/commit/f949355)) +* **utils:** RuleTester should not require a parser ([#713](https://github.com/typescript-eslint/typescript-eslint/issues/713)) ([158a417](https://github.com/typescript-eslint/typescript-eslint/commit/158a417)) + + +### Features + +* **eslint-plugin:** add new rule no-misused-promises ([#612](https://github.com/typescript-eslint/typescript-eslint/issues/612)) ([28a131d](https://github.com/typescript-eslint/typescript-eslint/commit/28a131d)) + + + + + +# [1.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.11.0...v1.12.0) (2019-07-12) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [1.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.10.2...v1.11.0) (2019-06-23) + + +### Bug Fixes + +* **eslint-plugin:** Remove duplicated code ([#611](https://github.com/typescript-eslint/typescript-eslint/issues/611)) ([c4df4ff](https://github.com/typescript-eslint/typescript-eslint/commit/c4df4ff)) + + +### Features + +* **eslint-plugin:** add `consistent-type-definitions` rule ([#463](https://github.com/typescript-eslint/typescript-eslint/issues/463)) ([ec87d06](https://github.com/typescript-eslint/typescript-eslint/commit/ec87d06)) + + + + + +## [1.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v1.10.1...v1.10.2) (2019-06-10) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + +## [1.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v1.10.0...v1.10.1) (2019-06-09) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + +# [1.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.9.0...v1.10.0) (2019-06-09) + +### Bug Fixes + +- **experimental-utils:** add `endLine` and `endColumn` ([#517](https://github.com/typescript-eslint/typescript-eslint/issues/517)) ([d9e5f15](https://github.com/typescript-eslint/typescript-eslint/commit/d9e5f15)) +- **experimental-utils:** Avoid typescript import at runtime ([#584](https://github.com/typescript-eslint/typescript-eslint/issues/584)) ([fac5c7d](https://github.com/typescript-eslint/typescript-eslint/commit/fac5c7d)), closes [/github.com/typescript-eslint/typescript-eslint/pull/425#issuecomment-498162293](https://github.com//github.com/typescript-eslint/typescript-eslint/pull/425/issues/issuecomment-498162293) + +### Features + +- make utils/TSESLint export typed classes instead of just types ([#526](https://github.com/typescript-eslint/typescript-eslint/issues/526)) ([370ac72](https://github.com/typescript-eslint/typescript-eslint/commit/370ac72)) +- support TypeScript versions >=3.2.1 <3.6.0 ([#597](https://github.com/typescript-eslint/typescript-eslint/issues/597)) ([5d2b962](https://github.com/typescript-eslint/typescript-eslint/commit/5d2b962)) + +# [1.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.8.0...v1.9.0) (2019-05-12) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + +# [1.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.7.0...v1.8.0) (2019-05-10) + +### Features + +- Move shared types into their own package ([#425](https://github.com/typescript-eslint/typescript-eslint/issues/425)) ([a7a03ce](https://github.com/typescript-eslint/typescript-eslint/commit/a7a03ce)) diff --git a/node_modules/@typescript-eslint/experimental-utils/LICENSE b/node_modules/@typescript-eslint/experimental-utils/LICENSE new file mode 100644 index 000000000..7e7370143 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 TypeScript ESLint and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@typescript-eslint/experimental-utils/README.md b/node_modules/@typescript-eslint/experimental-utils/README.md new file mode 100644 index 000000000..208578bfc --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/README.md @@ -0,0 +1,37 @@ +

Utils for ESLint Plugins

+ +

Utilities for working with TypeScript + ESLint together.

+ +

+ CI + NPM Version + NPM Downloads +

+ +## Note + +This package has inherited its version number from the `@typescript-eslint` project. +Meaning that even though this package is `2.x.y`, you shouldn't expect 100% stability between minor version bumps. +i.e. treat it as a `0.x.y` package. + +Feel free to use it now, and let us know what utilities you need or send us PRs with utilities you build on top of it. + +Once it is stable, it will be renamed to `@typescript-eslint/util` for a `4.0.0` release. + +## Exports + +| Name | Description | +| -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [`ASTUtils`](./src/ast-utils) | Tools for operating on the ESTree AST. Also includes the [`eslint-utils`](https://www.npmjs.com/package/eslint-utils) package, correctly typed to work with the types found in `TSESTree` | +| [`ESLintUtils`](./src/eslint-utils) | Tools for creating ESLint rules with TypeScript. | +| `JSONSchema` | Types from the [`@types/json-schema`](https://www.npmjs.com/package/@types/json-schema) package, re-exported to save you having to manually import them. Also ensures you're using the same version of the types as this package. | +| [`TSESLint`](./src/ts-eslint) | Types for ESLint, correctly typed to work with the types found in `TSESTree`. | +| [`TSESLintScope`](./src/ts-eslint-scope) | The [`eslint-scope`](https://www.npmjs.com/package/eslint-scope) package, correctly typed to work with the types found in both `TSESTree` and `TSESLint` | +| [`TSESTree`](../types/src/ts-estree.ts) | Types for the TypeScript flavor of ESTree created by `@typescript-eslint/typescript-estree`. | +| [`AST_NODE_TYPES`](../types/src/ast-node-types.ts) | An enum with the names of every single _node_ found in `TSESTree`. | +| [`AST_TOKEN_TYPES`](../types/src/ast-token-types.ts) | An enum with the names of every single _token_ found in `TSESTree`. | +| [`ParserServices`](../typescript-estree/src/parser-options.ts) | Typing for the parser services provided when parsing a file using `@typescript-eslint/typescript-estree`. | + +## Contributing + +[See the contributing guide here](../../CONTRIBUTING.md) diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/eslint-utils/PatternMatcher.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/eslint-utils/PatternMatcher.d.ts new file mode 100644 index 000000000..5a7607159 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/eslint-utils/PatternMatcher.d.ts @@ -0,0 +1,48 @@ +interface PatternMatcher { + /** + * Iterate all matched parts in a given string. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#matcher-execall} + */ + execAll(str: string): IterableIterator; + /** + * Check whether this pattern matches a given string or not. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#matcher-test} + */ + test(str: string): boolean; + /** + * Replace all matched parts by a given replacer. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#matcher-symbol-replace} + * @example + * const { PatternMatcher } = require("eslint-utils") + * const matcher = new PatternMatcher(/\\p{Script=Greek}/g) + * + * module.exports = { + * meta: {}, + * create(context) { + * return { + * "Literal[regex]"(node) { + * const replacedPattern = node.regex.pattern.replace( + * matcher, + * "[\\u0370-\\u0373\\u0375-\\u0377\\u037A-\\u037D\\u037F\\u0384\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03E1\\u03F0-\\u03FF\\u1D26-\\u1D2A\\u1D5D-\\u1D61\\u1D66-\\u1D6A\\u1DBF\\u1F00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FC4\\u1FC6-\\u1FD3\\u1FD6-\\u1FDB\\u1FDD-\\u1FEF\\u1FF2-\\u1FF4\\u1FF6-\\u1FFE\\u2126\\uAB65]|\\uD800[\\uDD40-\\uDD8E\\uDDA0]|\\uD834[\\uDE00-\\uDE45]" + * ) + * }, + * } + * }, + * } + */ + [Symbol.replace](str: string, replacer: string | ((...strs: string[]) => string)): string; +} +/** + * The class to find a pattern in strings as handling escape sequences. + * It ignores the found pattern if it's escaped with `\`. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#patternmatcher-class} + */ +declare const PatternMatcher: new (pattern: RegExp, options?: { + escaped?: boolean | undefined; +} | undefined) => PatternMatcher; +export { PatternMatcher }; +//# sourceMappingURL=PatternMatcher.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts new file mode 100644 index 000000000..76b56772c --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts @@ -0,0 +1,72 @@ +import { TSESTree } from '../../ts-estree'; +import * as TSESLint from '../../ts-eslint'; +declare const ReferenceTrackerREAD: unique symbol; +declare const ReferenceTrackerCALL: unique symbol; +declare const ReferenceTrackerCONSTRUCT: unique symbol; +interface ReferenceTracker { + /** + * Iterate the references that the given `traceMap` determined. + * This method starts to search from global variables. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#tracker-iterateglobalreferences} + */ + iterateGlobalReferences(traceMap: ReferenceTracker.TraceMap): IterableIterator>; + /** + * Iterate the references that the given `traceMap` determined. + * This method starts to search from `require()` expression. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#tracker-iteratecjsreferences} + */ + iterateCjsReferences(traceMap: ReferenceTracker.TraceMap): IterableIterator>; + /** + * Iterate the references that the given `traceMap` determined. + * This method starts to search from `import`/`export` declarations. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#tracker-iterateesmreferences} + */ + iterateEsmReferences(traceMap: ReferenceTracker.TraceMap): IterableIterator>; +} +interface ReferenceTrackerStatic { + new (globalScope: TSESLint.Scope.Scope, options?: { + /** + * The mode which determines how the `tracker.iterateEsmReferences()` method scans CommonJS modules. + * If this is `"strict"`, the method binds CommonJS modules to the default export. Otherwise, the method binds + * CommonJS modules to both the default export and named exports. Optional. Default is `"strict"`. + */ + mode: 'strict' | 'legacy'; + /** + * The name list of Global Object. Optional. Default is `["global", "globalThis", "self", "window"]`. + */ + globalObjectNames: readonly string[]; + }): ReferenceTracker; + readonly READ: typeof ReferenceTrackerREAD; + readonly CALL: typeof ReferenceTrackerCALL; + readonly CONSTRUCT: typeof ReferenceTrackerCONSTRUCT; +} +declare namespace ReferenceTracker { + type READ = ReferenceTrackerStatic['READ']; + type CALL = ReferenceTrackerStatic['CALL']; + type CONSTRUCT = ReferenceTrackerStatic['CONSTRUCT']; + type ReferenceType = READ | CALL | CONSTRUCT; + type TraceMap = Record>; + interface TraceMapElement { + [ReferenceTrackerREAD]?: T; + [ReferenceTrackerCALL]?: T; + [ReferenceTrackerCONSTRUCT]?: T; + [key: string]: TraceMapElement; + } + interface FoundReference { + node: TSESTree.Node; + path: readonly string[]; + type: ReferenceType; + entry: T; + } +} +/** + * The tracker for references. This provides reference tracking for global variables, CommonJS modules, and ES modules. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#referencetracker-class} + */ +declare const ReferenceTracker: ReferenceTrackerStatic; +export { ReferenceTracker }; +//# sourceMappingURL=ReferenceTracker.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/eslint-utils/astUtilities.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/eslint-utils/astUtilities.d.ts new file mode 100644 index 000000000..d9c3fdfb4 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/eslint-utils/astUtilities.d.ts @@ -0,0 +1,82 @@ +import { TSESTree } from '../../ts-estree'; +import * as TSESLint from '../../ts-eslint'; +/** + * Get the proper location of a given function node to report. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getfunctionheadlocation} + */ +declare const getFunctionHeadLocation: (node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression, sourceCode: TSESLint.SourceCode) => TSESTree.SourceLocation; +/** + * Get the name and kind of a given function node. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getfunctionnamewithkind} + */ +declare const getFunctionNameWithKind: (node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression) => string; +/** + * Get the property name of a given property node. + * If the node is a computed property, this tries to compute the property name by the getStringIfConstant function. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getpropertyname} + * @returns The property name of the node. If the property name is not constant then it returns `null`. + */ +declare const getPropertyName: (node: TSESTree.MemberExpression | TSESTree.Property | TSESTree.MethodDefinition, initialScope?: import("@typescript-eslint/scope-manager/dist/scope/BlockScope").BlockScope | import("@typescript-eslint/scope-manager/dist/scope/CatchScope").CatchScope | import("@typescript-eslint/scope-manager/dist/scope/ClassScope").ClassScope | import("@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope").ConditionalTypeScope | import("@typescript-eslint/scope-manager/dist/scope/ForScope").ForScope | import("@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope").FunctionExpressionNameScope | import("@typescript-eslint/scope-manager/dist/scope/FunctionScope").FunctionScope | import("@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope").FunctionTypeScope | import("@typescript-eslint/scope-manager/dist/scope/GlobalScope").GlobalScope | import("@typescript-eslint/scope-manager/dist/scope/MappedTypeScope").MappedTypeScope | import("@typescript-eslint/scope-manager/dist/scope/ModuleScope").ModuleScope | import("@typescript-eslint/scope-manager/dist/scope/SwitchScope").SwitchScope | import("@typescript-eslint/scope-manager/dist/scope/TSEnumScope").TSEnumScope | import("@typescript-eslint/scope-manager/dist/scope/TSModuleScope").TSModuleScope | import("@typescript-eslint/scope-manager/dist/scope/TypeScope").TypeScope | import("@typescript-eslint/scope-manager/dist/scope/WithScope").WithScope | undefined) => string | null; +/** + * Get the value of a given node if it can decide the value statically. + * If the 2nd parameter `initialScope` was given, this function tries to resolve identifier references which are in the + * given node as much as possible. In the resolving way, it does on the assumption that built-in global objects have + * not been modified. + * For example, it considers `Symbol.iterator`, ` String.raw``hello`` `, and `Object.freeze({a: 1}).a` as static. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getstaticvalue} + * @returns The `{ value: any }` shaped object. The `value` property is the static value. If it couldn't compute the + * static value of the node, it returns `null`. + */ +declare const getStaticValue: (node: TSESTree.Node, initialScope?: import("@typescript-eslint/scope-manager/dist/scope/BlockScope").BlockScope | import("@typescript-eslint/scope-manager/dist/scope/CatchScope").CatchScope | import("@typescript-eslint/scope-manager/dist/scope/ClassScope").ClassScope | import("@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope").ConditionalTypeScope | import("@typescript-eslint/scope-manager/dist/scope/ForScope").ForScope | import("@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope").FunctionExpressionNameScope | import("@typescript-eslint/scope-manager/dist/scope/FunctionScope").FunctionScope | import("@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope").FunctionTypeScope | import("@typescript-eslint/scope-manager/dist/scope/GlobalScope").GlobalScope | import("@typescript-eslint/scope-manager/dist/scope/MappedTypeScope").MappedTypeScope | import("@typescript-eslint/scope-manager/dist/scope/ModuleScope").ModuleScope | import("@typescript-eslint/scope-manager/dist/scope/SwitchScope").SwitchScope | import("@typescript-eslint/scope-manager/dist/scope/TSEnumScope").TSEnumScope | import("@typescript-eslint/scope-manager/dist/scope/TSModuleScope").TSModuleScope | import("@typescript-eslint/scope-manager/dist/scope/TypeScope").TypeScope | import("@typescript-eslint/scope-manager/dist/scope/WithScope").WithScope | undefined) => { + value: unknown; +} | null; +/** + * Get the string value of a given node. + * This function is a tiny wrapper of the getStaticValue function. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getstringifconstant} + */ +declare const getStringIfConstant: (node: TSESTree.Node, initialScope?: import("@typescript-eslint/scope-manager/dist/scope/BlockScope").BlockScope | import("@typescript-eslint/scope-manager/dist/scope/CatchScope").CatchScope | import("@typescript-eslint/scope-manager/dist/scope/ClassScope").ClassScope | import("@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope").ConditionalTypeScope | import("@typescript-eslint/scope-manager/dist/scope/ForScope").ForScope | import("@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope").FunctionExpressionNameScope | import("@typescript-eslint/scope-manager/dist/scope/FunctionScope").FunctionScope | import("@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope").FunctionTypeScope | import("@typescript-eslint/scope-manager/dist/scope/GlobalScope").GlobalScope | import("@typescript-eslint/scope-manager/dist/scope/MappedTypeScope").MappedTypeScope | import("@typescript-eslint/scope-manager/dist/scope/ModuleScope").ModuleScope | import("@typescript-eslint/scope-manager/dist/scope/SwitchScope").SwitchScope | import("@typescript-eslint/scope-manager/dist/scope/TSEnumScope").TSEnumScope | import("@typescript-eslint/scope-manager/dist/scope/TSModuleScope").TSModuleScope | import("@typescript-eslint/scope-manager/dist/scope/TypeScope").TypeScope | import("@typescript-eslint/scope-manager/dist/scope/WithScope").WithScope | undefined) => string | null; +/** + * Check whether a given node has any side effect or not. + * The side effect means that it may modify a certain variable or object member. This function considers the node which + * contains the following types as the node which has side effects: + * - `AssignmentExpression` + * - `AwaitExpression` + * - `CallExpression` + * - `ImportExpression` + * - `NewExpression` + * - `UnaryExpression([operator = "delete"])` + * - `UpdateExpression` + * - `YieldExpression` + * - When `options.considerGetters` is `true`: + * - `MemberExpression` + * - When `options.considerImplicitTypeConversion` is `true`: + * - `BinaryExpression([operator = "==" | "!=" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "in"])` + * - `MemberExpression([computed = true])` + * - `MethodDefinition([computed = true])` + * - `Property([computed = true])` + * - `UnaryExpression([operator = "-" | "+" | "!" | "~"])` + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#hassideeffect} + */ +declare const hasSideEffect: (node: TSESTree.Node, sourceCode: TSESLint.SourceCode, options?: { + considerGetters?: boolean | undefined; + considerImplicitTypeConversion?: boolean | undefined; +} | undefined) => boolean; +/** + * Check whether a given node is parenthesized or not. + * This function detects it correctly even if it's parenthesized by specific syntax. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#isparenthesized} + * @returns `true` if the node is parenthesized. + * If `times` was given, it returns `true` only if the node is parenthesized the `times` times. + * For example, `isParenthesized(2, node, sourceCode)` returns true for `((foo))`, but not for `(foo)`. + */ +declare const isParenthesized: (node: TSESTree.Node, sourceCode: TSESLint.SourceCode) => boolean; +export { getFunctionHeadLocation, getFunctionNameWithKind, getPropertyName, getStaticValue, getStringIfConstant, hasSideEffect, isParenthesized, }; +//# sourceMappingURL=astUtilities.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/eslint-utils/index.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/eslint-utils/index.d.ts new file mode 100644 index 000000000..ea4158a45 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/eslint-utils/index.d.ts @@ -0,0 +1,6 @@ +export * from './astUtilities'; +export * from './PatternMatcher'; +export * from './predicates'; +export * from './ReferenceTracker'; +export * from './scopeAnalysis'; +//# sourceMappingURL=index.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/eslint-utils/predicates.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/eslint-utils/predicates.d.ts new file mode 100644 index 000000000..944c9f3d4 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/eslint-utils/predicates.d.ts @@ -0,0 +1,45 @@ +import { TSESTree } from '../../ts-estree'; +declare const isArrowToken: (token: TSESTree.Token | TSESTree.Comment) => token is TSESTree.PunctuatorToken & { + value: '=>'; +}; +declare const isNotArrowToken: (token: TSESTree.Token | TSESTree.Comment) => boolean; +declare const isClosingBraceToken: (token: TSESTree.Token | TSESTree.Comment) => token is TSESTree.PunctuatorToken & { + value: '}'; +}; +declare const isNotClosingBraceToken: (token: TSESTree.Token | TSESTree.Comment) => boolean; +declare const isClosingBracketToken: (token: TSESTree.Token | TSESTree.Comment) => token is TSESTree.PunctuatorToken & { + value: ']'; +}; +declare const isNotClosingBracketToken: (token: TSESTree.Token | TSESTree.Comment) => boolean; +declare const isClosingParenToken: (token: TSESTree.Token | TSESTree.Comment) => token is TSESTree.PunctuatorToken & { + value: ')'; +}; +declare const isNotClosingParenToken: (token: TSESTree.Token | TSESTree.Comment) => boolean; +declare const isColonToken: (token: TSESTree.Token | TSESTree.Comment) => token is TSESTree.PunctuatorToken & { + value: ':'; +}; +declare const isNotColonToken: (token: TSESTree.Token | TSESTree.Comment) => boolean; +declare const isCommaToken: (token: TSESTree.Token | TSESTree.Comment) => token is TSESTree.PunctuatorToken & { + value: ','; +}; +declare const isNotCommaToken: (token: TSESTree.Token | TSESTree.Comment) => boolean; +declare const isCommentToken: (token: TSESTree.Token | TSESTree.Comment) => token is TSESTree.Comment; +declare const isNotCommentToken: (token: T) => token is Exclude; +declare const isOpeningBraceToken: (token: TSESTree.Token | TSESTree.Comment) => token is TSESTree.PunctuatorToken & { + value: '{'; +}; +declare const isNotOpeningBraceToken: (token: TSESTree.Token | TSESTree.Comment) => boolean; +declare const isOpeningBracketToken: (token: TSESTree.Token | TSESTree.Comment) => token is TSESTree.PunctuatorToken & { + value: '['; +}; +declare const isNotOpeningBracketToken: (token: TSESTree.Token | TSESTree.Comment) => boolean; +declare const isOpeningParenToken: (token: TSESTree.Token | TSESTree.Comment) => token is TSESTree.PunctuatorToken & { + value: '('; +}; +declare const isNotOpeningParenToken: (token: TSESTree.Token | TSESTree.Comment) => boolean; +declare const isSemicolonToken: (token: TSESTree.Token | TSESTree.Comment) => token is TSESTree.PunctuatorToken & { + value: ';'; +}; +declare const isNotSemicolonToken: (token: TSESTree.Token | TSESTree.Comment) => boolean; +export { isArrowToken, isClosingBraceToken, isClosingBracketToken, isClosingParenToken, isColonToken, isCommaToken, isCommentToken, isNotArrowToken, isNotClosingBraceToken, isNotClosingBracketToken, isNotClosingParenToken, isNotColonToken, isNotCommaToken, isNotCommentToken, isNotOpeningBraceToken, isNotOpeningBracketToken, isNotOpeningParenToken, isNotSemicolonToken, isOpeningBraceToken, isOpeningBracketToken, isOpeningParenToken, isSemicolonToken, }; +//# sourceMappingURL=predicates.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts new file mode 100644 index 000000000..3a1e615c1 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts @@ -0,0 +1,18 @@ +import { TSESTree } from '../../ts-estree'; +import * as TSESLint from '../../ts-eslint'; +/** + * Get the variable of a given name. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#findvariable} + */ +declare const findVariable: (initialScope: TSESLint.Scope.Scope, name: string) => TSESLint.Scope.Variable | null; +/** + * Get the innermost scope which contains a given node. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#getinnermostscope} + * @returns The innermost scope which contains the given node. + * If such scope doesn't exist then it returns the 1st argument `initialScope`. + */ +declare const getInnermostScope: (initialScope: TSESLint.Scope.Scope, node: TSESTree.Node) => TSESLint.Scope.Scope; +export { findVariable, getInnermostScope }; +//# sourceMappingURL=scopeAnalysis.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/index.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/index.d.ts new file mode 100644 index 000000000..ff62a803e --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/index.d.ts @@ -0,0 +1,4 @@ +export * from './misc'; +export * from './predicates'; +export * from './eslint-utils'; +//# sourceMappingURL=index.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/misc.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/misc.d.ts new file mode 100644 index 000000000..6adacba74 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/misc.d.ts @@ -0,0 +1,8 @@ +import { TSESTree } from '../ts-estree'; +declare const LINEBREAK_MATCHER: RegExp; +/** + * Determines whether two adjacent tokens are on the same line + */ +declare function isTokenOnSameLine(left: TSESTree.Token | TSESTree.Comment, right: TSESTree.Token | TSESTree.Comment): boolean; +export { isTokenOnSameLine, LINEBREAK_MATCHER }; +//# sourceMappingURL=misc.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/predicates.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/predicates.d.ts new file mode 100644 index 000000000..37e436317 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/predicates.d.ts @@ -0,0 +1,57 @@ +import { TSESTree } from '../ts-estree'; +declare function isOptionalChainPunctuator(token: TSESTree.Token | TSESTree.Comment): token is TSESTree.PunctuatorToken & { + value: '?.'; +}; +declare function isNotOptionalChainPunctuator(token: TSESTree.Token | TSESTree.Comment): boolean; +declare function isNonNullAssertionPunctuator(token: TSESTree.Token | TSESTree.Comment): token is TSESTree.PunctuatorToken & { + value: '!'; +}; +declare function isNotNonNullAssertionPunctuator(token: TSESTree.Token | TSESTree.Comment): boolean; +/** + * Returns true if and only if the node represents: foo?.() or foo.bar?.() + */ +declare function isOptionalCallExpression(node: TSESTree.Node): node is TSESTree.CallExpression & { + optional: true; +}; +/** + * Returns true if and only if the node represents logical OR + */ +declare function isLogicalOrOperator(node: TSESTree.Node): node is TSESTree.LogicalExpression & { + operator: '||'; +}; +/** + * Checks if a node is a type assertion: + * ``` + * x as foo + * x + * ``` + */ +declare function isTypeAssertion(node: TSESTree.Node | undefined | null): node is TSESTree.TSAsExpression | TSESTree.TSTypeAssertion; +declare function isVariableDeclarator(node: TSESTree.Node | undefined): node is TSESTree.VariableDeclarator; +declare function isFunction(node: TSESTree.Node | undefined): node is TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression; +declare function isFunctionType(node: TSESTree.Node | undefined): node is TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructorType | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSFunctionType | TSESTree.TSMethodSignature; +declare function isFunctionOrFunctionType(node: TSESTree.Node | undefined): node is TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructorType | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSFunctionType | TSESTree.TSMethodSignature; +declare function isTSFunctionType(node: TSESTree.Node | undefined): node is TSESTree.TSFunctionType; +declare function isTSConstructorType(node: TSESTree.Node | undefined): node is TSESTree.TSConstructorType; +declare function isClassOrTypeElement(node: TSESTree.Node | undefined): node is TSESTree.ClassElement | TSESTree.TypeElement; +/** + * Checks if a node is a constructor method. + */ +declare function isConstructor(node: TSESTree.Node | undefined): node is TSESTree.MethodDefinition; +/** + * Checks if a node is a setter method. + */ +declare function isSetter(node: TSESTree.Node | undefined): node is TSESTree.MethodDefinition | TSESTree.Property; +declare function isIdentifier(node: TSESTree.Node | undefined): node is TSESTree.Identifier; +/** + * Checks if a node represents an `await …` expression. + */ +declare function isAwaitExpression(node: TSESTree.Node | undefined | null): node is TSESTree.AwaitExpression; +/** + * Checks if a possible token is the `await` keyword. + */ +declare function isAwaitKeyword(node: TSESTree.Token | TSESTree.Comment | undefined | null): node is TSESTree.KeywordToken & { + value: 'await'; +}; +export { isAwaitExpression, isAwaitKeyword, isConstructor, isClassOrTypeElement, isFunction, isFunctionOrFunctionType, isFunctionType, isIdentifier, isLogicalOrOperator, isNonNullAssertionPunctuator, isNotNonNullAssertionPunctuator, isNotOptionalChainPunctuator, isOptionalChainPunctuator, isOptionalCallExpression, isSetter, isTSConstructorType, isTSFunctionType, isTypeAssertion, isVariableDeclarator, }; +//# sourceMappingURL=predicates.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/InferTypesFromRule.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/InferTypesFromRule.d.ts new file mode 100644 index 000000000..b87b7e836 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/InferTypesFromRule.d.ts @@ -0,0 +1,12 @@ +import { RuleModule } from '../ts-eslint'; +declare type InferOptionsTypeFromRuleNever = T extends RuleModule ? TOptions : unknown; +/** + * Uses type inference to fetch the TOptions type from the given RuleModule + */ +declare type InferOptionsTypeFromRule = T extends RuleModule ? TOptions : InferOptionsTypeFromRuleNever; +/** + * Uses type inference to fetch the TMessageIds type from the given RuleModule + */ +declare type InferMessageIdsTypeFromRule = T extends RuleModule ? TMessageIds : unknown; +export { InferOptionsTypeFromRule, InferMessageIdsTypeFromRule }; +//# sourceMappingURL=InferTypesFromRule.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/RuleCreator.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/RuleCreator.d.ts new file mode 100644 index 000000000..e775786b7 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/RuleCreator.d.ts @@ -0,0 +1,13 @@ +import { RuleMetaData, RuleMetaDataDocs, RuleListener, RuleContext, RuleModule } from '../ts-eslint/Rule'; +declare type CreateRuleMetaDocs = Pick>; +declare type CreateRuleMeta = { + docs: CreateRuleMetaDocs; +} & Pick, Exclude, 'docs'>>; +declare function RuleCreator(urlCreator: (ruleName: string) => string): ({ name, meta, defaultOptions, create, }: Readonly<{ + name: string; + meta: CreateRuleMeta; + defaultOptions: Readonly; + create: (context: Readonly>, optionsWithDefault: Readonly) => TRuleListener; +}>) => RuleModule; +export { RuleCreator }; +//# sourceMappingURL=RuleCreator.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/RuleTester.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/RuleTester.d.ts new file mode 100644 index 000000000..0eaa2fd66 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/RuleTester.d.ts @@ -0,0 +1,18 @@ +import * as TSESLint from '../ts-eslint'; +declare const parser = "@typescript-eslint/parser"; +declare type RuleTesterConfig = Pick> & { + parser: typeof parser; +}; +declare class RuleTester extends TSESLint.RuleTester { + private "RuleTester.#private"; + constructor(options: RuleTesterConfig); + private getFilename; + run>(name: string, rule: TSESLint.RuleModule, testsReadonly: TSESLint.RunTests): void; +} +/** + * Simple no-op tag to mark code samples as "should not format with prettier" + * for the internal/plugin-test-formatting lint rule + */ +declare function noFormat(strings: TemplateStringsArray, ...keys: string[]): string; +export { noFormat, RuleTester }; +//# sourceMappingURL=RuleTester.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/applyDefault.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/applyDefault.d.ts new file mode 100644 index 000000000..feac266f4 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/applyDefault.d.ts @@ -0,0 +1,10 @@ +/** + * Pure function - doesn't mutate either parameter! + * Uses the default options and overrides with the options provided by the user + * @param defaultOptions the defaults + * @param userOptions the user opts + * @returns the options with defaults + */ +declare function applyDefault(defaultOptions: TDefault, userOptions: TUser | null): TDefault; +export { applyDefault }; +//# sourceMappingURL=applyDefault.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/batchedSingleLineTests.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/batchedSingleLineTests.d.ts new file mode 100644 index 000000000..72d832393 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/batchedSingleLineTests.d.ts @@ -0,0 +1,24 @@ +import { ValidTestCase, InvalidTestCase } from '../ts-eslint'; +/** + * Converts a batch of single line tests into a number of separate test cases. + * This makes it easier to write tests which use the same options. + * + * Why wouldn't you just leave them as one test? + * Because it makes the test error messages harder to decipher. + * This way each line will fail separately, instead of them all failing together. + */ +declare function batchedSingleLineTests>(test: ValidTestCase): ValidTestCase[]; +/** + * Converts a batch of single line tests into a number of separate test cases. + * This makes it easier to write tests which use the same options. + * + * Why wouldn't you just leave them as one test? + * Because it makes the test error messages harder to decipher. + * This way each line will fail separately, instead of them all failing together. + * + * Make sure you have your line numbers correct for error reporting, as it will match + * the line numbers up with the split tests! + */ +declare function batchedSingleLineTests>(test: InvalidTestCase): InvalidTestCase[]; +export { batchedSingleLineTests }; +//# sourceMappingURL=batchedSingleLineTests.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/deepMerge.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/deepMerge.d.ts new file mode 100644 index 000000000..98cd0721b --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/deepMerge.d.ts @@ -0,0 +1,17 @@ +declare type ObjectLike = Record; +/** + * Check if the variable contains an object strictly rejecting arrays + * @param obj an object + * @returns `true` if obj is an object + */ +declare function isObjectNotArray(obj: unknown | unknown[]): obj is T; +/** + * Pure function - doesn't mutate either parameter! + * Merges two objects together deeply, overwriting the properties in first with the properties in second + * @param first The first object + * @param second The second object + * @returns a new object + */ +export declare function deepMerge(first?: ObjectLike, second?: ObjectLike): Record; +export { isObjectNotArray }; +//# sourceMappingURL=deepMerge.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/getParserServices.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/getParserServices.d.ts new file mode 100644 index 000000000..43ab65863 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/getParserServices.d.ts @@ -0,0 +1,8 @@ +import * as TSESLint from '../ts-eslint'; +import { ParserServices } from '../ts-estree'; +/** + * Try to retrieve typescript parser service from context + */ +declare function getParserServices(context: Readonly>, allowWithoutFullTypeInformation?: boolean): ParserServices; +export { getParserServices }; +//# sourceMappingURL=getParserServices.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/index.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/index.d.ts new file mode 100644 index 000000000..58a6a091a --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/eslint-utils/index.d.ts @@ -0,0 +1,8 @@ +export * from './applyDefault'; +export * from './batchedSingleLineTests'; +export * from './getParserServices'; +export * from './InferTypesFromRule'; +export * from './RuleCreator'; +export * from './RuleTester'; +export * from './deepMerge'; +//# sourceMappingURL=index.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/index.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/index.d.ts new file mode 100644 index 000000000..9d012254e --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/index.d.ts @@ -0,0 +1,8 @@ +import * as ASTUtils from './ast-utils'; +import * as ESLintUtils from './eslint-utils'; +import * as JSONSchema from './json-schema'; +import * as TSESLint from './ts-eslint'; +import * as TSESLintScope from './ts-eslint-scope'; +export { ASTUtils, ESLintUtils, JSONSchema, TSESLint, TSESLintScope }; +export * from './ts-estree'; +//# sourceMappingURL=index.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/json-schema.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/json-schema.d.ts new file mode 100644 index 000000000..fdef110f1 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/json-schema.d.ts @@ -0,0 +1,2 @@ +export { JSONSchema4, JSONSchema4Type, JSONSchema4TypeName, JSONSchema4Version, JSONSchema6, JSONSchema6Definition, JSONSchema6Type, JSONSchema6TypeName, JSONSchema6Version, JSONSchema7, JSONSchema7Array, JSONSchema7Definition, JSONSchema7Type, JSONSchema7TypeName, JSONSchema7Version, ValidationError, ValidationResult, } from 'json-schema'; +//# sourceMappingURL=json-schema.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Definition.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Definition.d.ts new file mode 100644 index 000000000..84164fd4f --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Definition.d.ts @@ -0,0 +1,19 @@ +import { TSESTree } from '../ts-estree'; +interface Definition { + type: string; + name: TSESTree.BindingName; + node: TSESTree.Node; + parent?: TSESTree.Node | null; + index?: number | null; + kind?: string | null; + rest?: boolean; +} +interface DefinitionConstructor { + new (type: string, name: TSESTree.BindingName | TSESTree.PropertyName, node: TSESTree.Node, parent?: TSESTree.Node | null, index?: number | null, kind?: string | null): Definition; +} +declare const Definition: DefinitionConstructor; +interface ParameterDefinition extends Definition { +} +declare const ParameterDefinition: DefinitionConstructor & (new (name: TSESTree.Node, node: TSESTree.Node, index?: number | null | undefined, rest?: boolean | undefined) => ParameterDefinition); +export { Definition, ParameterDefinition }; +//# sourceMappingURL=Definition.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Options.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Options.d.ts new file mode 100644 index 000000000..9dd326d3b --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Options.d.ts @@ -0,0 +1,15 @@ +import { TSESTree } from '../ts-estree'; +declare type PatternVisitorCallback = (pattern: TSESTree.Identifier, info: { + rest: boolean; + topLevel: boolean; + assignments: TSESTree.AssignmentPattern[]; +}) => void; +interface PatternVisitorOptions { + processRightHandNodes?: boolean; +} +interface Visitor { + visitChildren(node?: T): void; + visit(node?: T): void; +} +export { PatternVisitorCallback, PatternVisitorOptions, Visitor }; +//# sourceMappingURL=Options.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/PatternVisitor.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/PatternVisitor.d.ts new file mode 100644 index 000000000..334fc655f --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/PatternVisitor.d.ts @@ -0,0 +1,25 @@ +import { TSESTree } from '../ts-estree'; +import { ScopeManager } from './ScopeManager'; +import { PatternVisitorCallback, PatternVisitorOptions, Visitor } from './Options'; +interface PatternVisitor extends Visitor { + options: PatternVisitorOptions; + scopeManager: ScopeManager; + parent?: TSESTree.Node; + rightHandNodes: TSESTree.Node[]; + Identifier(pattern: TSESTree.Node): void; + Property(property: TSESTree.Node): void; + ArrayPattern(pattern: TSESTree.Node): void; + AssignmentPattern(pattern: TSESTree.Node): void; + RestElement(pattern: TSESTree.Node): void; + MemberExpression(node: TSESTree.Node): void; + SpreadElement(node: TSESTree.Node): void; + ArrayExpression(node: TSESTree.Node): void; + AssignmentExpression(node: TSESTree.Node): void; + CallExpression(node: TSESTree.Node): void; +} +declare const PatternVisitor: { + new (options: PatternVisitorOptions, rootPattern: TSESTree.BaseNode, callback: PatternVisitorCallback): PatternVisitor; + isPattern(node: TSESTree.Node): boolean; +}; +export { PatternVisitor }; +//# sourceMappingURL=PatternVisitor.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Reference.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Reference.d.ts new file mode 100644 index 000000000..e2b7fbe9d --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Reference.d.ts @@ -0,0 +1,28 @@ +import { TSESTree } from '../ts-estree'; +import { Scope } from './Scope'; +import { Variable } from './Variable'; +export declare type ReferenceFlag = 0x1 | 0x2 | 0x3; +interface Reference { + identifier: TSESTree.Identifier; + from: Scope; + resolved: Variable | null; + writeExpr: TSESTree.Node | null; + init: boolean; + partial: boolean; + __maybeImplicitGlobal: boolean; + tainted?: boolean; + typeMode?: boolean; + isWrite(): boolean; + isRead(): boolean; + isWriteOnly(): boolean; + isReadOnly(): boolean; + isReadWrite(): boolean; +} +declare const Reference: { + new (identifier: TSESTree.Identifier, scope: Scope, flag?: 2 | 3 | 1 | undefined, writeExpr?: TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpression | TSESTree.AssignmentExpression | TSESTree.AssignmentPattern | TSESTree.AwaitExpression | TSESTree.BigIntLiteral | TSESTree.BinaryExpression | TSESTree.BlockStatement | TSESTree.BreakStatement | TSESTree.CallExpression | TSESTree.CatchClause | TSESTree.ChainExpression | TSESTree.ClassBody | TSESTree.ClassDeclaration | TSESTree.ClassExpression | TSESTree.ClassPropertyComputedName | TSESTree.ClassPropertyNonComputedName | TSESTree.ConditionalExpression | TSESTree.ContinueStatement | TSESTree.DebuggerStatement | TSESTree.Decorator | TSESTree.DoWhileStatement | TSESTree.EmptyStatement | TSESTree.ExportAllDeclaration | TSESTree.ExportDefaultDeclaration | TSESTree.ExportNamedDeclaration | TSESTree.ExportSpecifier | TSESTree.ExpressionStatement | TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.Identifier | TSESTree.IfStatement | TSESTree.ImportDeclaration | TSESTree.ImportDefaultSpecifier | TSESTree.ImportExpression | TSESTree.ImportNamespaceSpecifier | TSESTree.ImportSpecifier | TSESTree.JSXAttribute | TSESTree.JSXClosingElement | TSESTree.JSXClosingFragment | TSESTree.JSXElement | TSESTree.JSXEmptyExpression | TSESTree.JSXExpressionContainer | TSESTree.JSXFragment | TSESTree.JSXIdentifier | TSESTree.JSXMemberExpression | TSESTree.JSXOpeningElement | TSESTree.JSXOpeningFragment | TSESTree.JSXSpreadAttribute | TSESTree.JSXSpreadChild | TSESTree.JSXText | TSESTree.LabeledStatement | TSESTree.BooleanLiteral | TSESTree.NumberLiteral | TSESTree.NullLiteral | TSESTree.RegExpLiteral | TSESTree.StringLiteral | TSESTree.LogicalExpression | TSESTree.MemberExpressionComputedName | TSESTree.MemberExpressionNonComputedName | TSESTree.MetaProperty | TSESTree.MethodDefinitionComputedName | TSESTree.MethodDefinitionNonComputedName | TSESTree.NewExpression | TSESTree.ObjectExpression | TSESTree.ObjectPattern | TSESTree.Program | TSESTree.PropertyComputedName | TSESTree.PropertyNonComputedName | TSESTree.RestElement | TSESTree.ReturnStatement | TSESTree.SequenceExpression | TSESTree.SpreadElement | TSESTree.Super | TSESTree.SwitchCase | TSESTree.SwitchStatement | TSESTree.TaggedTemplateExpression | TSESTree.TemplateElement | TSESTree.TemplateLiteral | TSESTree.ThisExpression | TSESTree.ThrowStatement | TSESTree.TryStatement | TSESTree.TSAbstractClassPropertyComputedName | TSESTree.TSAbstractClassPropertyNonComputedName | TSESTree.TSAbstractKeyword | TSESTree.TSAbstractMethodDefinitionComputedName | TSESTree.TSAbstractMethodDefinitionNonComputedName | TSESTree.TSAnyKeyword | TSESTree.TSArrayType | TSESTree.TSAsExpression | TSESTree.TSAsyncKeyword | TSESTree.TSBigIntKeyword | TSESTree.TSBooleanKeyword | TSESTree.TSCallSignatureDeclaration | TSESTree.TSClassImplements | TSESTree.TSConditionalType | TSESTree.TSConstructorType | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSDeclareFunction | TSESTree.TSDeclareKeyword | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSEnumDeclaration | TSESTree.TSEnumMemberComputedName | TSESTree.TSEnumMemberNonComputedName | TSESTree.TSExportAssignment | TSESTree.TSExportKeyword | TSESTree.TSExternalModuleReference | TSESTree.TSFunctionType | TSESTree.TSImportEqualsDeclaration | TSESTree.TSImportType | TSESTree.TSIndexedAccessType | TSESTree.TSIndexSignature | TSESTree.TSInferType | TSESTree.TSInterfaceBody | TSESTree.TSInterfaceDeclaration | TSESTree.TSInterfaceHeritage | TSESTree.TSIntersectionType | TSESTree.TSLiteralType | TSESTree.TSMappedType | TSESTree.TSMethodSignatureComputedName | TSESTree.TSMethodSignatureNonComputedName | TSESTree.TSModuleBlock | TSESTree.TSModuleDeclaration | TSESTree.TSNamedTupleMember | TSESTree.TSNamespaceExportDeclaration | TSESTree.TSNeverKeyword | TSESTree.TSNonNullExpression | TSESTree.TSNullKeyword | TSESTree.TSNumberKeyword | TSESTree.TSObjectKeyword | TSESTree.TSOptionalType | TSESTree.TSParameterProperty | TSESTree.TSParenthesizedType | TSESTree.TSPrivateKeyword | TSESTree.TSPropertySignatureComputedName | TSESTree.TSPropertySignatureNonComputedName | TSESTree.TSProtectedKeyword | TSESTree.TSPublicKeyword | TSESTree.TSQualifiedName | TSESTree.TSReadonlyKeyword | TSESTree.TSRestType | TSESTree.TSStaticKeyword | TSESTree.TSStringKeyword | TSESTree.TSSymbolKeyword | TSESTree.TSThisType | TSESTree.TSTupleType | TSESTree.TSTypeAliasDeclaration | TSESTree.TSTypeAnnotation | TSESTree.TSTypeAssertion | TSESTree.TSTypeLiteral | TSESTree.TSTypeOperator | TSESTree.TSTypeParameter | TSESTree.TSTypeParameterDeclaration | TSESTree.TSTypeParameterInstantiation | TSESTree.TSTypePredicate | TSESTree.TSTypeQuery | TSESTree.TSTypeReference | TSESTree.TSUndefinedKeyword | TSESTree.TSUnionType | TSESTree.TSUnknownKeyword | TSESTree.TSVoidKeyword | TSESTree.UnaryExpression | TSESTree.UpdateExpression | TSESTree.VariableDeclaration | TSESTree.VariableDeclarator | TSESTree.WhileStatement | TSESTree.WithStatement | TSESTree.YieldExpression | null | undefined, maybeImplicitGlobal?: boolean | undefined, partial?: boolean | undefined, init?: boolean | undefined): Reference; + READ: 0x1; + WRITE: 0x2; + RW: 0x3; +}; +export { Reference }; +//# sourceMappingURL=Reference.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Referencer.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Referencer.d.ts new file mode 100644 index 000000000..eb5565a2e --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Referencer.d.ts @@ -0,0 +1,55 @@ +import { TSESTree } from '../ts-estree'; +import { PatternVisitorCallback, PatternVisitorOptions, Visitor } from './Options'; +import { Scope } from './Scope'; +import { ScopeManager } from './ScopeManager'; +interface Referencer extends Visitor { + isInnerMethodDefinition: boolean; + options: any; + scopeManager: SM; + parent?: TSESTree.Node; + currentScope(): Scope; + close(node: TSESTree.Node): void; + pushInnerMethodDefinition(isInnerMethodDefinition: boolean): boolean; + popInnerMethodDefinition(isInnerMethodDefinition: boolean): void; + referencingDefaultValue(pattern: any, assignments: any, maybeImplicitGlobal: any, init: boolean): void; + visitPattern(node: TSESTree.Node, options: PatternVisitorOptions, callback: PatternVisitorCallback): void; + visitFunction(node: TSESTree.Node): void; + visitClass(node: TSESTree.Node): void; + visitProperty(node: TSESTree.Node): void; + visitForIn(node: TSESTree.Node): void; + visitVariableDeclaration(variableTargetScope: any, type: any, node: TSESTree.Node, index: any): void; + AssignmentExpression(node: TSESTree.Node): void; + CatchClause(node: TSESTree.Node): void; + Program(node: TSESTree.Program): void; + Identifier(node: TSESTree.Identifier): void; + UpdateExpression(node: TSESTree.Node): void; + MemberExpression(node: TSESTree.Node): void; + Property(node: TSESTree.Node): void; + MethodDefinition(node: TSESTree.Node): void; + BreakStatement(): void; + ContinueStatement(): void; + LabeledStatement(node: TSESTree.Node): void; + ForStatement(node: TSESTree.Node): void; + ClassExpression(node: TSESTree.Node): void; + ClassDeclaration(node: TSESTree.Node): void; + CallExpression(node: TSESTree.Node): void; + BlockStatement(node: TSESTree.Node): void; + ThisExpression(): void; + WithStatement(node: TSESTree.Node): void; + VariableDeclaration(node: TSESTree.Node): void; + SwitchStatement(node: TSESTree.Node): void; + FunctionDeclaration(node: TSESTree.Node): void; + FunctionExpression(node: TSESTree.Node): void; + ForOfStatement(node: TSESTree.Node): void; + ForInStatement(node: TSESTree.Node): void; + ArrowFunctionExpression(node: TSESTree.Node): void; + ImportDeclaration(node: TSESTree.Node): void; + visitExportDeclaration(node: TSESTree.Node): void; + ExportDeclaration(node: TSESTree.Node): void; + ExportNamedDeclaration(node: TSESTree.Node): void; + ExportSpecifier(node: TSESTree.Node): void; + MetaProperty(): void; +} +declare const Referencer: new (options: any, scopeManager: SM) => Referencer; +export { Referencer }; +//# sourceMappingURL=Referencer.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Scope.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Scope.d.ts new file mode 100644 index 000000000..f87892c4d --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Scope.d.ts @@ -0,0 +1,103 @@ +import { TSESTree } from '../ts-estree'; +import { Definition } from './Definition'; +import { Reference, ReferenceFlag } from './Reference'; +import { ScopeManager } from './ScopeManager'; +import { Variable } from './Variable'; +declare type ScopeType = 'block' | 'catch' | 'class' | 'for' | 'function' | 'function-expression-name' | 'global' | 'module' | 'switch' | 'with' | 'TDZ' | 'enum' | 'empty-function'; +interface Scope { + type: ScopeType; + isStrict: boolean; + upper: Scope | null; + childScopes: Scope[]; + variableScope: Scope; + block: TSESTree.Node; + variables: Variable[]; + set: Map; + references: Reference[]; + through: Reference[]; + thisFound?: boolean; + taints: Map; + functionExpressionScope: boolean; + __left: Reference[]; + __shouldStaticallyClose(scopeManager: ScopeManager): boolean; + __shouldStaticallyCloseForGlobal(ref: any): boolean; + __staticCloseRef(ref: any): void; + __dynamicCloseRef(ref: any): void; + __globalCloseRef(ref: any): void; + __close(scopeManager: ScopeManager): Scope; + __isValidResolution(ref: any, variable: any): variable is Variable; + __resolve(ref: Reference): boolean; + __delegateToUpperScope(ref: any): void; + __addDeclaredVariablesOfNode(variable: any, node: TSESTree.Node): void; + __defineGeneric(name: string, set: Map, variables: Variable[], node: TSESTree.Identifier, def: Definition): void; + __define(node: TSESTree.Node, def: Definition): void; + __referencing(node: TSESTree.Node, assign?: ReferenceFlag, writeExpr?: TSESTree.Node, maybeImplicitGlobal?: any, partial?: any, init?: any): void; + __detectEval(): void; + __detectThis(): void; + __isClosed(): boolean; + /** + * returns resolved {Reference} + * @method Scope#resolve + * @param {Espree.Identifier} ident - identifier to be resolved. + * @returns {Reference} reference + */ + resolve(ident: TSESTree.Node): Reference; + /** + * returns this scope is static + * @method Scope#isStatic + * @returns {boolean} static + */ + isStatic(): boolean; + /** + * returns this scope has materialized arguments + * @method Scope#isArgumentsMaterialized + * @returns {boolean} arguments materialized + */ + isArgumentsMaterialized(): boolean; + /** + * returns this scope has materialized `this` reference + * @method Scope#isThisMaterialized + * @returns {boolean} this materialized + */ + isThisMaterialized(): boolean; + isUsedName(name: any): boolean; +} +interface ScopeConstructor { + new (scopeManager: ScopeManager, type: ScopeType, upperScope: Scope | null, block: TSESTree.Node | null, isMethodDefinition: boolean): Scope; +} +declare const Scope: ScopeConstructor; +interface ScopeChildConstructorWithUpperScope { + new (scopeManager: ScopeManager, upperScope: Scope, block: TSESTree.Node | null): T; +} +interface GlobalScope extends Scope { +} +declare const GlobalScope: ScopeConstructor & (new (scopeManager: ScopeManager, block: TSESTree.Node | null) => GlobalScope); +interface ModuleScope extends Scope { +} +declare const ModuleScope: ScopeConstructor & ScopeChildConstructorWithUpperScope; +interface FunctionExpressionNameScope extends Scope { +} +declare const FunctionExpressionNameScope: ScopeConstructor & ScopeChildConstructorWithUpperScope; +interface CatchScope extends Scope { +} +declare const CatchScope: ScopeConstructor & ScopeChildConstructorWithUpperScope; +interface WithScope extends Scope { +} +declare const WithScope: ScopeConstructor & ScopeChildConstructorWithUpperScope; +interface BlockScope extends Scope { +} +declare const BlockScope: ScopeConstructor & ScopeChildConstructorWithUpperScope; +interface SwitchScope extends Scope { +} +declare const SwitchScope: ScopeConstructor & ScopeChildConstructorWithUpperScope; +interface FunctionScope extends Scope { +} +declare const FunctionScope: ScopeConstructor & (new (scopeManager: ScopeManager, upperScope: Scope, block: TSESTree.Node | null, isMethodDefinition: boolean) => FunctionScope); +interface ForScope extends Scope { +} +declare const ForScope: ScopeConstructor & ScopeChildConstructorWithUpperScope; +interface ClassScope extends Scope { +} +declare const ClassScope: ScopeConstructor & ScopeChildConstructorWithUpperScope; +export { ScopeType, Scope, GlobalScope, ModuleScope, FunctionExpressionNameScope, CatchScope, WithScope, BlockScope, SwitchScope, FunctionScope, ForScope, ClassScope, }; +//# sourceMappingURL=Scope.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/ScopeManager.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/ScopeManager.d.ts new file mode 100644 index 000000000..b5d89e5dc --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/ScopeManager.d.ts @@ -0,0 +1,50 @@ +import { TSESTree } from '../ts-estree'; +import { EcmaVersion } from '../ts-eslint'; +import { Scope } from './Scope'; +import { Variable } from './Variable'; +interface ScopeManagerOptions { + directive?: boolean; + optimistic?: boolean; + ignoreEval?: boolean; + nodejsScope?: boolean; + sourceType?: 'module' | 'script'; + impliedStrict?: boolean; + ecmaVersion?: EcmaVersion; +} +interface ScopeManager { + __options: ScopeManagerOptions; + __currentScope: Scope; + __nodeToScope: WeakMap; + __declaredVariables: WeakMap; + scopes: Scope[]; + globalScope: Scope; + __useDirective(): boolean; + __isOptimistic(): boolean; + __ignoreEval(): boolean; + __isNodejsScope(): boolean; + isModule(): boolean; + isImpliedStrict(): boolean; + isStrictModeSupported(): boolean; + __get(node: TSESTree.Node): Scope | undefined; + getDeclaredVariables(node: TSESTree.Node): Variable[]; + acquire(node: TSESTree.Node, inner?: boolean): Scope | null; + acquireAll(node: TSESTree.Node): Scope | null; + release(node: TSESTree.Node, inner?: boolean): Scope | null; + attach(): void; + detach(): void; + __nestScope(scope: T): T; + __nestGlobalScope(node: TSESTree.Node): Scope; + __nestBlockScope(node: TSESTree.Node): Scope; + __nestFunctionScope(node: TSESTree.Node, isMethodDefinition: boolean): Scope; + __nestForScope(node: TSESTree.Node): Scope; + __nestCatchScope(node: TSESTree.Node): Scope; + __nestWithScope(node: TSESTree.Node): Scope; + __nestClassScope(node: TSESTree.Node): Scope; + __nestSwitchScope(node: TSESTree.Node): Scope; + __nestModuleScope(node: TSESTree.Node): Scope; + __nestFunctionExpressionNameScope(node: TSESTree.Node): Scope; + __isES6(): boolean; +} +declare const ScopeManager: new (options: ScopeManagerOptions) => ScopeManager; +export { ScopeManager, ScopeManagerOptions }; +//# sourceMappingURL=ScopeManager.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Variable.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Variable.d.ts new file mode 100644 index 000000000..f5e65e6b3 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Variable.d.ts @@ -0,0 +1,17 @@ +import { TSESTree } from '../ts-estree'; +import { Reference } from './Reference'; +import { Definition } from './Definition'; +import { Scope } from './Scope'; +interface Variable { + name: string; + identifiers: TSESTree.Identifier[]; + references: Reference[]; + defs: Definition[]; + eslintUsed?: boolean; + stack?: unknown; + tainted?: boolean; + scope?: Scope; +} +declare const Variable: new () => Variable; +export { Variable }; +//# sourceMappingURL=Variable.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/analyze.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/analyze.d.ts new file mode 100644 index 000000000..dd3220729 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/analyze.d.ts @@ -0,0 +1,16 @@ +import { EcmaVersion } from '../ts-eslint'; +import { TSESTree } from '../ts-estree'; +import { ScopeManager } from './ScopeManager'; +interface AnalysisOptions { + optimistic?: boolean; + directive?: boolean; + ignoreEval?: boolean; + nodejsScope?: boolean; + impliedStrict?: boolean; + fallback?: string | ((node: TSESTree.Node) => string[]); + sourceType?: 'script' | 'module'; + ecmaVersion?: EcmaVersion; +} +declare const analyze: (ast: TSESTree.Node, options?: AnalysisOptions | undefined) => ScopeManager; +export { analyze, AnalysisOptions }; +//# sourceMappingURL=analyze.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/index.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/index.d.ts new file mode 100644 index 000000000..579b7f8b1 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/index.d.ts @@ -0,0 +1,11 @@ +export * from './analyze'; +export * from './Definition'; +export * from './Options'; +export * from './PatternVisitor'; +export * from './Reference'; +export * from './Referencer'; +export * from './Scope'; +export * from './ScopeManager'; +export * from './Variable'; +export declare const version: string; +//# sourceMappingURL=index.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/AST.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/AST.d.ts new file mode 100644 index 000000000..8cc612141 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/AST.d.ts @@ -0,0 +1,9 @@ +import { TSESTree, AST_TOKEN_TYPES } from '../ts-estree'; +declare namespace AST { + type TokenType = AST_TOKEN_TYPES; + type Token = TSESTree.Token; + type SourceLocation = TSESTree.SourceLocation; + type Range = TSESTree.Range; +} +export { AST }; +//# sourceMappingURL=AST.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/CLIEngine.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/CLIEngine.d.ts new file mode 100644 index 000000000..d84234601 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/CLIEngine.d.ts @@ -0,0 +1,143 @@ +import { Linter } from './Linter'; +import { RuleListener, RuleMetaData, RuleModule } from './Rule'; +declare class CLIEngineBase { + /** + * Creates a new instance of the core CLI engine. + * @param providedOptions The options for this instance. + */ + constructor(options: CLIEngine.Options); + /** + * Add a plugin by passing its configuration + * @param name Name of the plugin. + * @param pluginObject Plugin configuration object. + */ + addPlugin(name: string, pluginObject: Linter.Plugin): void; + /** + * Executes the current configuration on an array of file and directory names. + * @param patterns An array of file and directory names. + * @returns The results for all files that were linted. + */ + executeOnFiles(patterns: string[]): CLIEngine.LintReport; + /** + * Executes the current configuration on text. + * @param text A string of JavaScript code to lint. + * @param filename An optional string representing the texts filename. + * @param warnIgnored Always warn when a file is ignored + * @returns The results for the linting. + */ + executeOnText(text: string, filename?: string, warnIgnored?: boolean): CLIEngine.LintReport; + /** + * Returns a configuration object for the given file based on the CLI options. + * This is the same logic used by the ESLint CLI executable to determine configuration for each file it processes. + * @param filePath The path of the file to retrieve a config object for. + * @returns A configuration object for the file. + */ + getConfigForFile(filePath: string): Linter.Config; + /** + * Returns the formatter representing the given format. + * @param format The name of the format to load or the path to a custom formatter. + * @returns The formatter function. + */ + getFormatter(format?: string): CLIEngine.Formatter; + /** + * Checks if a given path is ignored by ESLint. + * @param filePath The path of the file to check. + * @returns Whether or not the given path is ignored. + */ + isPathIgnored(filePath: string): boolean; + /** + * Resolves the patterns passed into `executeOnFiles()` into glob-based patterns for easier handling. + * @param patterns The file patterns passed on the command line. + * @returns The equivalent glob patterns. + */ + resolveFileGlobPatterns(patterns: string[]): string[]; + getRules(): Map>; + /** + * Returns results that only contains errors. + * @param results The results to filter. + * @returns The filtered results. + */ + static getErrorResults(results: CLIEngine.LintResult[]): CLIEngine.LintResult[]; + /** + * Returns the formatter representing the given format or null if the `format` is not a string. + * @param format The name of the format to load or the path to a custom formatter. + * @returns The formatter function. + */ + static getFormatter(format?: string): CLIEngine.Formatter; + /** + * Outputs fixes from the given results to files. + * @param report The report object created by CLIEngine. + */ + static outputFixes(report: CLIEngine.LintReport): void; + static version: string; +} +declare namespace CLIEngine { + interface Options { + allowInlineConfig?: boolean; + baseConfig?: false | { + [name: string]: unknown; + }; + cache?: boolean; + cacheFile?: string; + cacheLocation?: string; + configFile?: string; + cwd?: string; + envs?: string[]; + errorOnUnmatchedPattern?: boolean; + extensions?: string[]; + fix?: boolean; + globals?: string[]; + ignore?: boolean; + ignorePath?: string; + ignorePattern?: string | string[]; + useEslintrc?: boolean; + parser?: string; + parserOptions?: Linter.ParserOptions; + plugins?: string[]; + resolvePluginsRelativeTo?: string; + rules?: { + [name: string]: Linter.RuleLevel | Linter.RuleLevelAndOptions; + }; + rulePaths?: string[]; + reportUnusedDisableDirectives?: boolean; + } + interface LintResult { + filePath: string; + messages: Linter.LintMessage[]; + errorCount: number; + warningCount: number; + fixableErrorCount: number; + fixableWarningCount: number; + output?: string; + source?: string; + } + interface LintReport { + results: LintResult[]; + errorCount: number; + warningCount: number; + fixableErrorCount: number; + fixableWarningCount: number; + usedDeprecatedRules: DeprecatedRuleUse[]; + } + interface DeprecatedRuleUse { + ruleId: string; + replacedBy: string[]; + } + interface LintResultData { + rulesMeta: { + [ruleId: string]: RuleMetaData; + }; + } + type Formatter = (results: LintResult[], data?: LintResultData) => string; +} +declare const CLIEngine_base: typeof CLIEngineBase; +/** + * The underlying utility that runs the ESLint command line interface. This object will read the filesystem for + * configuration and file information but will not output any results. Instead, it allows you direct access to the + * important information so you can deal with the output yourself. + * @deprecated use the ESLint class instead + */ +declare class CLIEngine extends CLIEngine_base { +} +export { CLIEngine }; +//# sourceMappingURL=CLIEngine.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/ESLint.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/ESLint.d.ts new file mode 100644 index 000000000..974606764 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/ESLint.d.ts @@ -0,0 +1,341 @@ +import { Linter } from './Linter'; +declare class ESLintBase { + /** + * Creates a new instance of the main ESLint API. + * @param options The options for this instance. + */ + constructor(options?: ESLint.ESLintOptions); + /** + * This method calculates the configuration for a given file, which can be useful for debugging purposes. + * - It resolves and merges extends and overrides settings into the top level configuration. + * - It resolves the parser setting to absolute paths. + * - It normalizes the plugins setting to align short names. (e.g., eslint-plugin-foo → foo) + * - It adds the processor setting if a legacy file extension processor is matched. + * - It doesn't interpret the env setting to the globals and parserOptions settings, so the result object contains + * the env setting as is. + * @param filePath The path to the file whose configuration you would like to calculate. Directory paths are forbidden + * because ESLint cannot handle the overrides setting. + * @returns The promise that will be fulfilled with a configuration object. + */ + calculateConfigForFile(filePath: string): Promise; + /** + * This method checks if a given file is ignored by your configuration. + * @param filePath The path to the file you want to check. + * @returns The promise that will be fulfilled with whether the file is ignored or not. If the file is ignored, then + * it will return true. + */ + isPathIgnored(filePath: string): Promise; + /** + * This method lints the files that match the glob patterns and then returns the results. + * @param patterns The lint target files. This can contain any of file paths, directory paths, and glob patterns. + * @returns The promise that will be fulfilled with an array of LintResult objects. + */ + lintFiles(patterns: string | string[]): Promise; + /** + * This method lints the given source code text and then returns the results. + * + * By default, this method uses the configuration that applies to files in the current working directory (the cwd + * constructor option). If you want to use a different configuration, pass options.filePath, and ESLint will load the + * same configuration that eslint.lintFiles() would use for a file at options.filePath. + * + * If the options.filePath value is configured to be ignored, this method returns an empty array. If the + * options.warnIgnored option is set along with the options.filePath option, this method returns a LintResult object. + * In that case, the result may contain a warning that indicates the file was ignored. + * @param code The source code text to check. + * @param options The options. + * @returns The promise that will be fulfilled with an array of LintResult objects. This is an array (despite there + * being only one lint result) in order to keep the interfaces between this and the eslint.lintFiles() + * method similar. + */ + lintText(code: string, options?: ESLint.LintTextOptions): Promise; + /** + * This method loads a formatter. Formatters convert lint results to a human- or machine-readable string. + * @param name TThe path to the file you want to check. + * The following values are allowed: + * - undefined. In this case, loads the "stylish" built-in formatter. + * - A name of built-in formatters. + * - A name of third-party formatters. For examples: + * -- `foo` will load eslint-formatter-foo. + * -- `@foo` will load `@foo/eslint-formatter`. + * -- `@foo/bar` will load `@foo/eslint-formatter-bar`. + * - A path to the file that defines a formatter. The path must contain one or more path separators (/) in order to distinguish if it's a path or not. For example, start with ./. + * @returns The promise that will be fulfilled with a Formatter object. + */ + loadFormatter(name?: string): Promise; + /** + * This method copies the given results and removes warnings. The returned value contains only errors. + * @param results The LintResult objects to filter. + * @returns The filtered LintResult objects. + */ + static getErrorResults(results: ESLint.LintResult): ESLint.LintResult; + /** + * This method writes code modified by ESLint's autofix feature into its respective file. If any of the modified + * files don't exist, this method does nothing. + * @param results The LintResult objects to write. + * @returns The promise that will be fulfilled after all files are written. + */ + static outputFixes(results: ESLint.LintResult): Promise; + /** + * The version text. + */ + static readonly version: string; +} +declare namespace ESLint { + interface ESLintOptions { + /** + * If false is present, ESLint suppresses directive comments in source code. + * If this option is false, it overrides the noInlineConfig setting in your configurations. + */ + allowInlineConfig?: boolean; + /** + * Configuration object, extended by all configurations used with this instance. + * You can use this option to define the default settings that will be used if your configuration files don't + * configure it. + */ + baseConfig?: Linter.Config | null; + /** + * If true is present, the eslint.lintFiles() method caches lint results and uses it if each target file is not + * changed. Please mind that ESLint doesn't clear the cache when you upgrade ESLint plugins. In that case, you have + * to remove the cache file manually. The eslint.lintText() method doesn't use caches even if you pass the + * options.filePath to the method. + */ + cache?: boolean; + /** + * The eslint.lintFiles() method writes caches into this file. + */ + cacheLocation?: string; + /** + * The working directory. This must be an absolute path. + */ + cwd?: string; + /** + * Unless set to false, the eslint.lintFiles() method will throw an error when no target files are found. + */ + errorOnUnmatchedPattern?: boolean; + /** + * If you pass directory paths to the eslint.lintFiles() method, ESLint checks the files in those directories that + * have the given extensions. For example, when passing the src/ directory and extensions is [".js", ".ts"], ESLint + * will lint *.js and *.ts files in src/. If extensions is null, ESLint checks *.js files and files that match + * overrides[].files patterns in your configuration. + * Note: This option only applies when you pass directory paths to the eslint.lintFiles() method. + * If you pass glob patterns, ESLint will lint all files matching the glob pattern regardless of extension. + */ + extensions?: string[] | null; + /** + * If true is present, the eslint.lintFiles() and eslint.lintText() methods work in autofix mode. + * If a predicate function is present, the methods pass each lint message to the function, then use only the + * lint messages for which the function returned true. + */ + fix?: boolean | ((message: LintMessage) => boolean); + /** + * The types of the rules that the eslint.lintFiles() and eslint.lintText() methods use for autofix. + */ + fixTypes?: string[]; + /** + * If false is present, the eslint.lintFiles() method doesn't interpret glob patterns. + */ + globInputPaths?: boolean; + /** + * If false is present, the eslint.lintFiles() method doesn't respect `.eslintignore` files or ignorePatterns in + * your configuration. + */ + ignore?: boolean; + /** + * The path to a file ESLint uses instead of `$CWD/.eslintignore`. + * If a path is present and the file doesn't exist, this constructor will throw an error. + */ + ignorePath?: string; + /** + * Configuration object, overrides all configurations used with this instance. + * You can use this option to define the settings that will be used even if your configuration files configure it. + */ + overrideConfig?: Linter.ConfigOverride | null; + /** + * The path to a configuration file, overrides all configurations used with this instance. + * The options.overrideConfig option is applied after this option is applied. + */ + overrideConfigFile?: string | null; + /** + * The plugin implementations that ESLint uses for the plugins setting of your configuration. + * This is a map-like object. Those keys are plugin IDs and each value is implementation. + */ + plugins?: Record | null; + /** + * The severity to report unused eslint-disable directives. + * If this option is a severity, it overrides the reportUnusedDisableDirectives setting in your configurations. + */ + reportUnusedDisableDirectives?: Linter.SeverityString | null; + /** + * The path to a directory where plugins should be resolved from. + * If null is present, ESLint loads plugins from the location of the configuration file that contains the plugin + * setting. + * If a path is present, ESLint loads all plugins from there. + */ + resolvePluginsRelativeTo?: string | null; + /** + * An array of paths to directories to load custom rules from. + */ + rulePaths?: string[]; + /** + * If false is present, ESLint doesn't load configuration files (.eslintrc.* files). + * Only the configuration of the constructor options is valid. + */ + useEslintrc?: boolean; + } + interface DeprecatedRuleInfo { + /** + * The rule ID. + */ + ruleId: string; + /** + * The rule IDs that replace this deprecated rule. + */ + replacedBy: string[]; + } + /** + * The LintResult value is the information of the linting result of each file. + */ + interface LintResult { + /** + * The number of errors. This includes fixable errors. + */ + errorCount: number; + /** + * The absolute path to the file of this result. This is the string "" if the file path is unknown (when you + * didn't pass the options.filePath option to the eslint.lintText() method). + */ + filePath: string; + /** + * The number of errors that can be fixed automatically by the fix constructor option. + */ + fixableErrorCount: number; + /** + * The number of warnings that can be fixed automatically by the fix constructor option. + */ + fixableWarningCount: number; + /** + * The array of LintMessage objects. + */ + messages: Linter.LintMessage[]; + /** + * The source code of the file that was linted, with as many fixes applied as possible. + */ + output?: string; + /** + * The original source code text. This property is undefined if any messages didn't exist or the output + * property exists. + */ + source?: string; + /** + * The information about the deprecated rules that were used to check this file. + */ + usedDeprecatedRules: DeprecatedRuleInfo[]; + /** + * The number of warnings. This includes fixable warnings. + */ + warningCount: number; + } + interface LintTextOptions { + /** + * The path to the file of the source code text. If omitted, the result.filePath becomes the string "". + */ + filePath?: string; + /** + * If true is present and the options.filePath is a file ESLint should ignore, this method returns a lint result + * contains a warning message. + */ + warnIgnored?: boolean; + } + /** + * The LintMessage value is the information of each linting error. + */ + interface LintMessage { + /** + * The 1-based column number of the begin point of this message. + */ + column: number; + /** + * The 1-based column number of the end point of this message. This property is undefined if this message + * is not a range. + */ + endColumn: number | undefined; + /** + * The 1-based line number of the end point of this message. This property is undefined if this + * message is not a range. + */ + endLine: number | undefined; + /** + * The EditInfo object of autofix. This property is undefined if this message is not fixable. + */ + fix: EditInfo | undefined; + /** + * The 1-based line number of the begin point of this message. + */ + line: number; + /** + * The error message + */ + message: string; + /** + * The rule name that generates this lint message. If this message is generated by the ESLint core rather than + * rules, this is null. + */ + ruleId: string | null; + /** + * The severity of this message. 1 means warning and 2 means error. + */ + severity: 1 | 2; + /** + * The list of suggestions. Each suggestion is the pair of a description and an EditInfo object to fix code. API + * users such as editor integrations can choose one of them to fix the problem of this message. This property is + * undefined if this message doesn't have any suggestions. + */ + suggestions: { + desc: string; + fix: EditInfo; + }[] | undefined; + } + /** + * The EditInfo value is information to edit text. + * + * This edit information means replacing the range of the range property by the text property value. It's like + * sourceCodeText.slice(0, edit.range[0]) + edit.text + sourceCodeText.slice(edit.range[1]). Therefore, it's an add + * if the range[0] and range[1] property values are the same value, and it's removal if the text property value is + * empty string. + */ + interface EditInfo { + /** + * The pair of 0-based indices in source code text to remove. + */ + range: [ + number, + number + ]; + /** + * The text to add. + */ + text: string; + } + /** + * The Formatter value is the object to convert the LintResult objects to text. + */ + interface Formatter { + /** + * The method to convert the LintResult objects to text + */ + format(results: LintResult[]): string; + } +} +declare const _ESLint: typeof ESLintBase; +/** + * The ESLint class is the primary class to use in Node.js applications. + * This class depends on the Node.js fs module and the file system, so you cannot use it in browsers. + * + * If you want to lint code on browsers, use the Linter class instead. + * + * @since 7.0.0 + */ +declare class ESLint extends _ESLint { +} +export { ESLint }; +//# sourceMappingURL=ESLint.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/Linter.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/Linter.d.ts new file mode 100644 index 000000000..3fc0d035b --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/Linter.d.ts @@ -0,0 +1,327 @@ +import { TSESTree, ParserServices } from '../ts-estree'; +import { ParserOptions as TSParserOptions } from './ParserOptions'; +import { RuleCreateFunction, RuleFix, RuleModule } from './Rule'; +import { Scope } from './Scope'; +import { SourceCode } from './SourceCode'; +declare class LinterBase { + /** + * Initialize the Linter. + * @param config the config object + */ + constructor(config?: Linter.LinterOptions); + /** + * Define a new parser module + * @param parserId Name of the parser + * @param parserModule The parser object + */ + defineParser(parserId: string, parserModule: Linter.ParserModule): void; + /** + * Defines a new linting rule. + * @param ruleId A unique rule identifier + * @param ruleModule Function from context to object mapping AST node types to event handlers + */ + defineRule(ruleId: string, ruleModule: RuleModule | RuleCreateFunction): void; + /** + * Defines many new linting rules. + * @param rulesToDefine map from unique rule identifier to rule + */ + defineRules(rulesToDefine: Record | RuleCreateFunction>): void; + /** + * Gets an object with all loaded rules. + * @returns All loaded rules + */ + getRules(): Map>; + /** + * Gets the `SourceCode` object representing the parsed source. + * @returns The `SourceCode` object. + */ + getSourceCode(): SourceCode; + /** + * Verifies the text against the rules specified by the second argument. + * @param textOrSourceCode The text to parse or a SourceCode object. + * @param config An ESLintConfig instance to configure everything. + * @param filenameOrOptions The optional filename of the file being checked. + * If this is not set, the filename will default to '' in the rule context. + * If this is an object, then it has "filename", "allowInlineConfig", and some properties. + * @returns The results as an array of messages or an empty array if no messages. + */ + verify(textOrSourceCode: SourceCode | string, config: Linter.Config, filenameOrOptions?: string | Linter.VerifyOptions): Linter.LintMessage[]; + /** + * Performs multiple autofix passes over the text until as many fixes as possible have been applied. + * @param text The source text to apply fixes to. + * @param config The ESLint config object to use. + * @param options The ESLint options object to use. + * @returns The result of the fix operation as returned from the SourceCodeFixer. + */ + verifyAndFix(code: string, config: Linter.Config, options: Linter.FixOptions): Linter.FixReport; + /** + * The version from package.json. + */ + readonly version: string; + /** + * The version from package.json. + */ + static readonly version: string; +} +declare namespace Linter { + export interface LinterOptions { + /** + * path to a directory that should be considered as the current working directory. + */ + cwd?: string; + } + export type Severity = 0 | 1 | 2; + export type SeverityString = 'off' | 'warn' | 'error'; + export type RuleLevel = Severity | SeverityString; + export type RuleLevelAndOptions = [ + RuleLevel, + ...unknown[] + ]; + export type RuleEntry = RuleLevel | RuleLevelAndOptions; + export type RulesRecord = Partial>; + interface BaseConfig { + $schema?: string; + /** + * The environment settings. + */ + env?: { + [name: string]: boolean; + }; + /** + * The path to other config files or the package name of shareable configs. + */ + extends?: string | string[]; + /** + * The global variable settings. + */ + globals?: { + [name: string]: boolean; + }; + /** + * The flag that disables directive comments. + */ + noInlineConfig?: boolean; + /** + * The override settings per kind of files. + */ + overrides?: ConfigOverride[]; + /** + * The path to a parser or the package name of a parser. + */ + parser?: string; + /** + * The parser options. + */ + parserOptions?: ParserOptions; + /** + * The plugin specifiers. + */ + plugins?: string[]; + /** + * The processor specifier. + */ + processor?: string; + /** + * The flag to report unused `eslint-disable` comments. + */ + reportUnusedDisableDirectives?: boolean; + /** + * The rule settings. + */ + rules?: RulesRecord; + /** + * The shared settings. + */ + settings?: { + [name: string]: unknown; + }; + } + export interface ConfigOverride extends BaseConfig { + excludedFiles?: string | string[]; + files: string | string[]; + } + export interface Config extends BaseConfig { + /** + * The glob patterns that ignore to lint. + */ + ignorePatterns?: string | string[]; + /** + * The root flag. + */ + root?: boolean; + } + export type ParserOptions = TSParserOptions; + export interface VerifyOptions { + /** + * Allow/disallow inline comments' ability to change config once it is set. Defaults to true if not supplied. + * Useful if you want to validate JS without comments overriding rules. + */ + allowInlineConfig?: boolean; + /** + * if `true` then the linter doesn't make `fix` properties into the lint result. + */ + disableFixes?: boolean; + /** + * the filename of the source code. + */ + filename?: string; + /** + * the predicate function that selects adopt code blocks. + */ + filterCodeBlock?: (filename: string, text: string) => boolean; + /** + * postprocessor for report messages. + * If provided, this should accept an array of the message lists + * for each code block returned from the preprocessor, apply a mapping to + * the messages as appropriate, and return a one-dimensional array of + * messages. + */ + postprocess?: Processor['postprocess']; + /** + * preprocessor for source text. + * If provided, this should accept a string of source text, and return an array of code blocks to lint. + */ + preprocess?: Processor['preprocess']; + /** + * Adds reported errors for unused `eslint-disable` directives. + */ + reportUnusedDisableDirectives?: boolean | SeverityString; + } + export interface FixOptions extends VerifyOptions { + /** + * Determines whether fixes should be applied. + */ + fix?: boolean; + } + export interface LintSuggestion { + desc: string; + fix: RuleFix; + messageId?: string; + } + export interface LintMessage { + /** + * The 1-based column number. + */ + column: number; + /** + * The 1-based column number of the end location. + */ + endColumn?: number; + /** + * The 1-based line number of the end location. + */ + endLine?: number; + /** + * If `true` then this is a fatal error. + */ + fatal?: true; + /** + * Information for autofix. + */ + fix?: RuleFix; + /** + * The 1-based line number. + */ + line: number; + /** + * The error message. + */ + message: string; + messageId?: string; + nodeType: string; + /** + * The ID of the rule which makes this message. + */ + ruleId: string | null; + /** + * The severity of this message. + */ + severity: Severity; + source: string | null; + /** + * Information for suggestions + */ + suggestions?: LintSuggestion[]; + } + export interface FixReport { + /** + * True, if the code was fixed + */ + fixed: boolean; + /** + * Fixed code text (might be the same as input if no fixes were applied). + */ + output: string; + /** + * Collection of all messages for the given code + */ + messages: LintMessage[]; + } + export type ParserModule = { + parse(text: string, options?: ParserOptions): TSESTree.Program; + } | { + parseForESLint(text: string, options?: ParserOptions): ESLintParseResult; + }; + export interface ESLintParseResult { + ast: TSESTree.Program; + parserServices?: ParserServices; + scopeManager?: Scope.ScopeManager; + visitorKeys?: SourceCode.VisitorKeys; + } + export interface Processor { + /** + * The function to extract code blocks. + */ + preprocess?: (text: string, filename: string) => Array; + /** + * The function to merge messages. + */ + postprocess?: (messagesList: Linter.LintMessage[][], filename: string) => Linter.LintMessage[]; + /** + * If `true` then it means the processor supports autofix. + */ + supportsAutofix?: boolean; + } + export interface Environment { + /** + * The definition of global variables. + */ + globals?: Record; + /** + * The parser options that will be enabled under this environment. + */ + parserOptions?: ParserOptions; + } + export interface Plugin { + /** + * The definition of plugin configs. + */ + configs?: Record; + /** + * The definition of plugin environments. + */ + environments?: Record; + /** + * The definition of plugin processors. + */ + processors?: Record; + /** + * The definition of plugin rules. + */ + rules?: Record>; + } + export {}; +} +declare const Linter_base: typeof LinterBase; +/** + * The Linter object does the actual evaluation of the JavaScript code. It doesn't do any filesystem operations, it + * simply parses and reports on the code. In particular, the Linter object does not process configuration objects + * or files. + */ +declare class Linter extends Linter_base { +} +export { Linter }; +//# sourceMappingURL=Linter.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/ParserOptions.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/ParserOptions.d.ts new file mode 100644 index 000000000..3956b84ec --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/ParserOptions.d.ts @@ -0,0 +1,2 @@ +export { DebugLevel, EcmaVersion, ParserOptions, SourceType, } from '@typescript-eslint/types'; +//# sourceMappingURL=ParserOptions.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/Rule.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/Rule.d.ts new file mode 100644 index 000000000..3a47b7080 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/Rule.d.ts @@ -0,0 +1,369 @@ +import { JSONSchema4 } from '../json-schema'; +import { ParserServices, TSESTree } from '../ts-estree'; +import { AST } from './AST'; +import { Linter } from './Linter'; +import { Scope } from './Scope'; +import { SourceCode } from './SourceCode'; +interface RuleMetaDataDocs { + /** + * The general category the rule falls within + */ + category: 'Best Practices' | 'Stylistic Issues' | 'Variables' | 'Possible Errors'; + /** + * Concise description of the rule + */ + description: string; + /** + * The recommendation level for the rule. + * Used by the build tools to generate the recommended config. + * Set to false to not include it as a recommendation + */ + recommended: 'error' | 'warn' | false; + /** + * The URL of the rule's docs + */ + url: string; + /** + * Specifies whether the rule can return suggestions. + */ + suggestion?: boolean; + /** + * Does the rule require us to create a full TypeScript Program in order for it + * to type-check code. This is only used for documentation purposes. + */ + requiresTypeChecking?: boolean; + /** + * Does the rule extend (or is it based off of) an ESLint code rule? + * Alternately accepts the name of the base rule, in case the rule has been renamed. + * This is only used for documentation purposes. + */ + extendsBaseRule?: boolean | string; +} +interface RuleMetaData { + /** + * True if the rule is deprecated, false otherwise + */ + deprecated?: boolean; + /** + * Documentation for the rule, unnecessary for custom rules/plugins + */ + docs?: RuleMetaDataDocs; + /** + * The fixer category. Omit if there is no fixer + */ + fixable?: 'code' | 'whitespace'; + /** + * A map of messages which the rule can report. + * The key is the messageId, and the string is the parameterised error string. + * See: https://eslint.org/docs/developer-guide/working-with-rules#messageids + */ + messages: Record; + /** + * The type of rule. + * - `"problem"` means the rule is identifying code that either will cause an error or may cause a confusing behavior. Developers should consider this a high priority to resolve. + * - `"suggestion"` means the rule is identifying something that could be done in a better way but no errors will occur if the code isn’t changed. + * - `"layout"` means the rule cares primarily about whitespace, semicolons, commas, and parentheses, all the parts of the program that determine how the code looks rather than how it executes. These rules work on parts of the code that aren’t specified in the AST. + */ + type: 'suggestion' | 'problem' | 'layout'; + /** + * The name of the rule this rule was replaced by, if it was deprecated. + */ + replacedBy?: string[]; + /** + * The options schema. Supply an empty array if there are no options. + */ + schema: JSONSchema4 | JSONSchema4[]; +} +interface RuleFix { + range: AST.Range; + text: string; +} +interface RuleFixer { + insertTextAfter(nodeOrToken: TSESTree.Node | TSESTree.Token, text: string): RuleFix; + insertTextAfterRange(range: AST.Range, text: string): RuleFix; + insertTextBefore(nodeOrToken: TSESTree.Node | TSESTree.Token, text: string): RuleFix; + insertTextBeforeRange(range: AST.Range, text: string): RuleFix; + remove(nodeOrToken: TSESTree.Node | TSESTree.Token): RuleFix; + removeRange(range: AST.Range): RuleFix; + replaceText(nodeOrToken: TSESTree.Node | TSESTree.Token, text: string): RuleFix; + replaceTextRange(range: AST.Range, text: string): RuleFix; +} +declare type ReportFixFunction = (fixer: RuleFixer) => null | RuleFix | RuleFix[] | IterableIterator; +declare type ReportSuggestionArray = ReportDescriptorBase[]; +interface ReportDescriptorBase { + /** + * The parameters for the message string associated with `messageId`. + */ + readonly data?: Readonly>; + /** + * The fixer function. + */ + readonly fix?: ReportFixFunction | null; + /** + * The messageId which is being reported. + */ + readonly messageId: TMessageIds; +} +interface ReportDescriptorWithSuggestion extends ReportDescriptorBase { + /** + * 6.7's Suggestions API + */ + readonly suggest?: Readonly> | null; +} +interface ReportDescriptorNodeOptionalLoc { + /** + * The Node or AST Token which the report is being attached to + */ + readonly node: TSESTree.Node | TSESTree.Comment | TSESTree.Token; + /** + * An override of the location of the report + */ + readonly loc?: Readonly | Readonly; +} +interface ReportDescriptorLocOnly { + /** + * An override of the location of the report + */ + loc: Readonly | Readonly; +} +declare type ReportDescriptor = ReportDescriptorWithSuggestion & (ReportDescriptorNodeOptionalLoc | ReportDescriptorLocOnly); +interface RuleContext { + /** + * The rule ID. + */ + id: string; + /** + * An array of the configured options for this rule. + * This array does not include the rule severity. + */ + options: TOptions; + /** + * The name of the parser from configuration. + */ + parserPath: string; + /** + * The parser options configured for this run + */ + parserOptions: Linter.ParserOptions; + /** + * An object containing parser-provided services for rules + */ + parserServices?: ParserServices; + /** + * The shared settings from configuration. + * We do not have any shared settings in this plugin. + */ + settings: Record; + /** + * Returns an array of the ancestors of the currently-traversed node, starting at + * the root of the AST and continuing through the direct parent of the current node. + * This array does not include the currently-traversed node itself. + */ + getAncestors(): TSESTree.Node[]; + /** + * Returns a list of variables declared by the given node. + * This information can be used to track references to variables. + */ + getDeclaredVariables(node: TSESTree.Node): Scope.Variable[]; + /** + * Returns the filename associated with the source. + */ + getFilename(): string; + /** + * Returns the scope of the currently-traversed node. + * This information can be used track references to variables. + */ + getScope(): Scope.Scope; + /** + * Returns a SourceCode object that you can use to work with the source that + * was passed to ESLint. + */ + getSourceCode(): Readonly; + /** + * Marks a variable with the given name in the current scope as used. + * This affects the no-unused-vars rule. + */ + markVariableAsUsed(name: string): boolean; + /** + * Reports a problem in the code. + */ + report(descriptor: ReportDescriptor): void; +} +declare type RuleFunction = (node: T) => void; +interface RuleListener { + [nodeSelector: string]: RuleFunction | undefined; + ArrayExpression?: RuleFunction; + ArrayPattern?: RuleFunction; + ArrowFunctionExpression?: RuleFunction; + AssignmentPattern?: RuleFunction; + AssignmentExpression?: RuleFunction; + AwaitExpression?: RuleFunction; + BigIntLiteral?: RuleFunction; + BinaryExpression?: RuleFunction; + BlockStatement?: RuleFunction; + BreakStatement?: RuleFunction; + CallExpression?: RuleFunction; + CatchClause?: RuleFunction; + ChainExpression?: RuleFunction; + ClassBody?: RuleFunction; + ClassDeclaration?: RuleFunction; + ClassExpression?: RuleFunction; + ClassProperty?: RuleFunction; + Comment?: RuleFunction; + ConditionalExpression?: RuleFunction; + ContinueStatement?: RuleFunction; + DebuggerStatement?: RuleFunction; + Decorator?: RuleFunction; + DoWhileStatement?: RuleFunction; + EmptyStatement?: RuleFunction; + ExportAllDeclaration?: RuleFunction; + ExportDefaultDeclaration?: RuleFunction; + ExportNamedDeclaration?: RuleFunction; + ExportSpecifier?: RuleFunction; + ExpressionStatement?: RuleFunction; + ForInStatement?: RuleFunction; + ForOfStatement?: RuleFunction; + ForStatement?: RuleFunction; + FunctionDeclaration?: RuleFunction; + FunctionExpression?: RuleFunction; + Identifier?: RuleFunction; + IfStatement?: RuleFunction; + ImportDeclaration?: RuleFunction; + ImportDefaultSpecifier?: RuleFunction; + ImportExpression?: RuleFunction; + ImportNamespaceSpecifier?: RuleFunction; + ImportSpecifier?: RuleFunction; + JSXAttribute?: RuleFunction; + JSXClosingElement?: RuleFunction; + JSXClosingFragment?: RuleFunction; + JSXElement?: RuleFunction; + JSXEmptyExpression?: RuleFunction; + JSXExpressionContainer?: RuleFunction; + JSXFragment?: RuleFunction; + JSXIdentifier?: RuleFunction; + JSXMemberExpression?: RuleFunction; + JSXOpeningElement?: RuleFunction; + JSXOpeningFragment?: RuleFunction; + JSXSpreadAttribute?: RuleFunction; + JSXSpreadChild?: RuleFunction; + JSXText?: RuleFunction; + LabeledStatement?: RuleFunction; + Literal?: RuleFunction; + LogicalExpression?: RuleFunction; + MemberExpression?: RuleFunction; + MetaProperty?: RuleFunction; + MethodDefinition?: RuleFunction; + NewExpression?: RuleFunction; + ObjectExpression?: RuleFunction; + ObjectPattern?: RuleFunction; + Program?: RuleFunction; + Property?: RuleFunction; + RestElement?: RuleFunction; + ReturnStatement?: RuleFunction; + SequenceExpression?: RuleFunction; + SpreadElement?: RuleFunction; + Super?: RuleFunction; + SwitchCase?: RuleFunction; + SwitchStatement?: RuleFunction; + TaggedTemplateExpression?: RuleFunction; + TemplateElement?: RuleFunction; + TemplateLiteral?: RuleFunction; + ThisExpression?: RuleFunction; + ThrowStatement?: RuleFunction; + Token?: RuleFunction; + TryStatement?: RuleFunction; + TSAbstractClassProperty?: RuleFunction; + TSAbstractKeyword?: RuleFunction; + TSAbstractMethodDefinition?: RuleFunction; + TSAnyKeyword?: RuleFunction; + TSArrayType?: RuleFunction; + TSAsExpression?: RuleFunction; + TSAsyncKeyword?: RuleFunction; + TSBigIntKeyword?: RuleFunction; + TSBooleanKeyword?: RuleFunction; + TSCallSignatureDeclaration?: RuleFunction; + TSClassImplements?: RuleFunction; + TSConditionalType?: RuleFunction; + TSConstructorType?: RuleFunction; + TSConstructSignatureDeclaration?: RuleFunction; + TSDeclareKeyword?: RuleFunction; + TSDeclareFunction?: RuleFunction; + TSEmptyBodyFunctionExpression?: RuleFunction; + TSEnumDeclaration?: RuleFunction; + TSEnumMember?: RuleFunction; + TSExportAssignment?: RuleFunction; + TSExportKeyword?: RuleFunction; + TSExternalModuleReference?: RuleFunction; + TSFunctionType?: RuleFunction; + TSImportEqualsDeclaration?: RuleFunction; + TSImportType?: RuleFunction; + TSIndexedAccessType?: RuleFunction; + TSIndexSignature?: RuleFunction; + TSInferType?: RuleFunction; + TSInterfaceBody?: RuleFunction; + TSInterfaceDeclaration?: RuleFunction; + TSInterfaceHeritage?: RuleFunction; + TSIntersectionType?: RuleFunction; + TSLiteralType?: RuleFunction; + TSMappedType?: RuleFunction; + TSMethodSignature?: RuleFunction; + TSModuleBlock?: RuleFunction; + TSModuleDeclaration?: RuleFunction; + TSNamespaceExportDeclaration?: RuleFunction; + TSNeverKeyword?: RuleFunction; + TSNonNullExpression?: RuleFunction; + TSNullKeyword?: RuleFunction; + TSNumberKeyword?: RuleFunction; + TSObjectKeyword?: RuleFunction; + TSOptionalType?: RuleFunction; + TSParameterProperty?: RuleFunction; + TSParenthesizedType?: RuleFunction; + TSPrivateKeyword?: RuleFunction; + TSPropertySignature?: RuleFunction; + TSProtectedKeyword?: RuleFunction; + TSPublicKeyword?: RuleFunction; + TSQualifiedName?: RuleFunction; + TSReadonlyKeyword?: RuleFunction; + TSRestType?: RuleFunction; + TSStaticKeyword?: RuleFunction; + TSStringKeyword?: RuleFunction; + TSSymbolKeyword?: RuleFunction; + TSThisType?: RuleFunction; + TSTupleType?: RuleFunction; + TSTypeAliasDeclaration?: RuleFunction; + TSTypeAnnotation?: RuleFunction; + TSTypeAssertion?: RuleFunction; + TSTypeLiteral?: RuleFunction; + TSTypeOperator?: RuleFunction; + TSTypeParameter?: RuleFunction; + TSTypeParameterDeclaration?: RuleFunction; + TSTypeParameterInstantiation?: RuleFunction; + TSTypePredicate?: RuleFunction; + TSTypeQuery?: RuleFunction; + TSTypeReference?: RuleFunction; + TSUndefinedKeyword?: RuleFunction; + TSUnionType?: RuleFunction; + TSUnknownKeyword?: RuleFunction; + TSVoidKeyword?: RuleFunction; + UnaryExpression?: RuleFunction; + UpdateExpression?: RuleFunction; + VariableDeclaration?: RuleFunction; + VariableDeclarator?: RuleFunction; + WhileStatement?: RuleFunction; + WithStatement?: RuleFunction; + YieldExpression?: RuleFunction; +} +interface RuleModule { + /** + * Metadata about the rule + */ + meta: RuleMetaData; + /** + * Function which returns an object with methods that ESLint calls to “visit” + * nodes while traversing the abstract syntax tree. + */ + create(context: Readonly>): TRuleListener; +} +declare type RuleCreateFunction = (context: Readonly>) => RuleListener; +export { ReportDescriptor, ReportFixFunction, ReportSuggestionArray, RuleContext, RuleCreateFunction, RuleFix, RuleFixer, RuleFunction, RuleListener, RuleMetaData, RuleMetaDataDocs, RuleModule, }; +//# sourceMappingURL=Rule.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/RuleTester.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/RuleTester.d.ts new file mode 100644 index 000000000..2479b2e2e --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/RuleTester.d.ts @@ -0,0 +1,137 @@ +import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '../ts-estree'; +import { ParserOptions } from './ParserOptions'; +import { RuleModule } from './Rule'; +interface ValidTestCase> { + /** + * Code for the test case. + */ + readonly code: string; + /** + * Environments for the test case. + */ + readonly env?: Readonly>; + /** + * The fake filename for the test case. Useful for rules that make assertion about filenames. + */ + readonly filename?: string; + /** + * The additional global variables. + */ + readonly globals?: Record; + /** + * Options for the test case. + */ + readonly options?: Readonly; + /** + * The absolute path for the parser. + */ + readonly parser?: string; + /** + * Options for the parser. + */ + readonly parserOptions?: Readonly; + /** + * Settings for the test case. + */ + readonly settings?: Readonly>; +} +interface SuggestionOutput { + /** + * Reported message ID. + */ + readonly messageId: TMessageIds; + /** + * The data used to fill the message template. + */ + readonly data?: Readonly>; + /** + * NOTE: Suggestions will be applied as a stand-alone change, without triggering multi-pass fixes. + * Each individual error has its own suggestion, so you have to show the correct, _isolated_ output for each suggestion. + */ + readonly output: string; +} +interface InvalidTestCase> extends ValidTestCase { + /** + * Expected errors. + */ + readonly errors: TestCaseError[]; + /** + * The expected code after autofixes are applied. If set to `null`, the test runner will assert that no autofix is suggested. + */ + readonly output?: string | null; +} +interface TestCaseError { + /** + * The 1-based column number of the reported start location. + */ + readonly column?: number; + /** + * The data used to fill the message template. + */ + readonly data?: Readonly>; + /** + * The 1-based column number of the reported end location. + */ + readonly endColumn?: number; + /** + * The 1-based line number of the reported end location. + */ + readonly endLine?: number; + /** + * The 1-based line number of the reported start location. + */ + readonly line?: number; + /** + * Reported message ID. + */ + readonly messageId: TMessageIds; + /** + * Reported suggestions. + */ + readonly suggestions?: SuggestionOutput[] | null; + /** + * The type of the reported AST node. + */ + readonly type?: AST_NODE_TYPES | AST_TOKEN_TYPES; +} +interface RunTests> { + readonly valid: (ValidTestCase | string)[]; + readonly invalid: InvalidTestCase[]; +} +interface RuleTesterConfig { + readonly parser: string; + readonly parserOptions?: Readonly; +} +declare class RuleTesterBase { + /** + * Creates a new instance of RuleTester. + * @param testerConfig extra configuration for the tester + */ + constructor(testerConfig?: RuleTesterConfig); + /** + * Adds a new rule test to execute. + * @param ruleName The name of the rule to run. + * @param rule The rule to test. + * @param test The collection of tests to run. + */ + run>(ruleName: string, rule: RuleModule, tests: RunTests): void; + /** + * If you supply a value to this property, the rule tester will call this instead of using the version defined on + * the global namespace. + * @param text a string describing the rule + * @param callback the test callback + */ + static describe?: (text: string, callback: () => void) => void; + /** + * If you supply a value to this property, the rule tester will call this instead of using the version defined on + * the global namespace. + * @param text a string describing the test case + * @param callback the test callback + */ + static it?: (text: string, callback: () => void) => void; +} +declare const RuleTester_base: typeof RuleTesterBase; +declare class RuleTester extends RuleTester_base { +} +export { InvalidTestCase, SuggestionOutput, RuleTester, RuleTesterConfig, RunTests, TestCaseError, ValidTestCase, }; +//# sourceMappingURL=RuleTester.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/Scope.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/Scope.d.ts new file mode 100644 index 000000000..79dfc9dfc --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/Scope.d.ts @@ -0,0 +1,44 @@ +import * as scopeManager from '@typescript-eslint/scope-manager'; +import { TSESTree } from '@typescript-eslint/types'; +declare namespace Scope { + class ESLintScopeVariable { + readonly defs: Definition[]; + readonly identifiers: TSESTree.Identifier[]; + readonly name: string; + readonly references: Reference[]; + readonly scope: Scope; + /** + * Written to by ESLint. + * If this key exists, this variable is a global variable added by ESLint. + * If this is `true`, this variable can be assigned arbitrary values. + * If this is `false`, this variable is readonly. + */ + writeable?: boolean; + /** + * Written to by ESLint. + * This property is undefined if there are no globals directive comments. + * The array of globals directive comments which defined this global variable in the source code file. + */ + eslintExplicitGlobal?: boolean; + /** + * Written to by ESLint. + * The configured value in config files. This can be different from `variable.writeable` if there are globals directive comments. + */ + eslintImplicitGlobalSetting?: 'readonly' | 'writable'; + /** + * Written to by ESLint. + * If this key exists, it is a global variable added by ESLint. + * If `true`, this global variable was defined by a globals directive comment in the source code file. + */ + eslintExplicitGlobalComments?: TSESTree.Comment[]; + } + export type ScopeManager = scopeManager.ScopeManager; + export type Reference = scopeManager.Reference; + export type Variable = scopeManager.Variable | ESLintScopeVariable; + export type Scope = scopeManager.Scope; + export type DefinitionType = scopeManager.Definition; + export type Definition = scopeManager.Definition; + export {}; +} +export { Scope }; +//# sourceMappingURL=Scope.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/SourceCode.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/SourceCode.d.ts new file mode 100644 index 000000000..af0775fb8 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/SourceCode.d.ts @@ -0,0 +1,350 @@ +import { ParserServices, TSESTree } from '../ts-estree'; +import { Scope } from './Scope'; +declare class TokenStore { + /** + * Checks whether any comments exist or not between the given 2 nodes. + * @param left The node to check. + * @param right The node to check. + * @returns `true` if one or more comments exist. + */ + commentsExistBetween(left: TSESTree.Node | TSESTree.Token, right: TSESTree.Node | TSESTree.Token): boolean; + /** + * Gets all comment tokens directly after the given node or token. + * @param nodeOrToken The AST node or token to check for adjacent comment tokens. + * @returns An array of comments in occurrence order. + */ + getCommentsAfter(nodeOrToken: TSESTree.Node | TSESTree.Token): TSESTree.Comment[]; + /** + * Gets all comment tokens directly before the given node or token. + * @param nodeOrToken The AST node or token to check for adjacent comment tokens. + * @returns An array of comments in occurrence order. + */ + getCommentsBefore(nodeOrToken: TSESTree.Node | TSESTree.Token): TSESTree.Comment[]; + /** + * Gets all comment tokens inside the given node. + * @param node The AST node to get the comments for. + * @returns An array of comments in occurrence order. + */ + getCommentsInside(node: TSESTree.Node): TSESTree.Comment[]; + /** + * Gets the first token of the given node. + * @param node The AST node. + * @param option The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`. + * @returns An object representing the token. + */ + getFirstToken(node: TSESTree.Node, options?: T): SourceCode.ReturnTypeFromOptions | null; + /** + * Gets the first token between two non-overlapping nodes. + * @param left Node before the desired token range. + * @param right Node after the desired token range. + * @param option The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`. + * @returns An object representing the token. + */ + getFirstTokenBetween(left: TSESTree.Node | TSESTree.Token | TSESTree.Comment, right: TSESTree.Node | TSESTree.Token | TSESTree.Comment, options?: T): SourceCode.ReturnTypeFromOptions | null; + /** + * Gets the first `count` tokens of the given node. + * @param node The AST node. + * @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`. + * @returns Tokens. + */ + getFirstTokens(node: TSESTree.Node, options?: T): SourceCode.ReturnTypeFromOptions[]; + /** + * Gets the first `count` tokens between two non-overlapping nodes. + * @param left Node before the desired token range. + * @param right Node after the desired token range. + * @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`. + * @returns Tokens between left and right. + */ + getFirstTokensBetween(left: TSESTree.Node | TSESTree.Token | TSESTree.Comment, right: TSESTree.Node | TSESTree.Token | TSESTree.Comment, options?: T): SourceCode.ReturnTypeFromOptions[]; + /** + * Gets the last token of the given node. + * @param node The AST node. + * @param option The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`. + * @returns An object representing the token. + */ + getLastToken(node: TSESTree.Node, options?: T): SourceCode.ReturnTypeFromOptions | null; + /** + * Gets the last token between two non-overlapping nodes. + * @param left Node before the desired token range. + * @param right Node after the desired token range. + * @param option The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`. + * @returns An object representing the token. + */ + getLastTokenBetween(left: TSESTree.Node | TSESTree.Token | TSESTree.Comment, right: TSESTree.Node | TSESTree.Token | TSESTree.Comment, options?: T): SourceCode.ReturnTypeFromOptions | null; + /** + * Gets the last `count` tokens of the given node. + * @param node The AST node. + * @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`. + * @returns Tokens. + */ + getLastTokens(node: TSESTree.Node, options?: T): SourceCode.ReturnTypeFromOptions[]; + /** + * Gets the last `count` tokens between two non-overlapping nodes. + * @param left Node before the desired token range. + * @param right Node after the desired token range. + * @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`. + * @returns Tokens between left and right. + */ + getLastTokensBetween(left: TSESTree.Node | TSESTree.Token | TSESTree.Comment, right: TSESTree.Node | TSESTree.Token | TSESTree.Comment, options?: T): SourceCode.ReturnTypeFromOptions[]; + /** + * Gets the token that follows a given node or token. + * @param node The AST node or token. + * @param option The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`. + * @returns An object representing the token. + */ + getTokenAfter(node: TSESTree.Node | TSESTree.Token | TSESTree.Comment, options?: T): SourceCode.ReturnTypeFromOptions | null; + /** + * Gets the token that precedes a given node or token. + * @param node The AST node or token. + * @param options The option object + * @returns An object representing the token. + */ + getTokenBefore(node: TSESTree.Node | TSESTree.Token | TSESTree.Comment, options?: T): SourceCode.ReturnTypeFromOptions | null; + /** + * Gets the token starting at the specified index. + * @param offset Index of the start of the token's range. + * @param option The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`. + * @returns The token starting at index, or null if no such token. + */ + getTokenByRangeStart(offset: number, options?: T): SourceCode.ReturnTypeFromOptions | null; + /** + * Gets all tokens that are related to the given node. + * @param node The AST node. + * @param beforeCount The number of tokens before the node to retrieve. + * @param afterCount The number of tokens after the node to retrieve. + * @returns Array of objects representing tokens. + */ + getTokens(node: TSESTree.Node, beforeCount?: number, afterCount?: number): TSESTree.Token[]; + /** + * Gets all tokens that are related to the given node. + * @param node The AST node. + * @param options The option object. If this is a function then it's `options.filter`. + * @returns Array of objects representing tokens. + */ + getTokens(node: TSESTree.Node, options: T): SourceCode.ReturnTypeFromOptions[]; + /** + * Gets the `count` tokens that follows a given node or token. + * @param node The AST node. + * @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`. + * @returns Tokens. + */ + getTokensAfter(node: TSESTree.Node | TSESTree.Token | TSESTree.Comment, options?: T): SourceCode.ReturnTypeFromOptions[]; + /** + * Gets the `count` tokens that precedes a given node or token. + * @param node The AST node. + * @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`. + * @returns Tokens. + */ + getTokensBefore(node: TSESTree.Node | TSESTree.Token | TSESTree.Comment, options?: T): SourceCode.ReturnTypeFromOptions[]; + /** + * Gets all of the tokens between two non-overlapping nodes. + * @param left Node before the desired token range. + * @param right Node after the desired token range. + * @param options The option object. If this is a function then it's `options.filter`. + * @returns Tokens between left and right. + */ + getTokensBetween(left: TSESTree.Node | TSESTree.Token | TSESTree.Comment, right: TSESTree.Node | TSESTree.Token | TSESTree.Comment, padding?: T): SourceCode.ReturnTypeFromOptions[]; + /** + * Gets all of the tokens between two non-overlapping nodes. + * @param left Node before the desired token range. + * @param right Node after the desired token range. + * @param padding Number of extra tokens on either side of center. + * @returns Tokens between left and right. + */ + getTokensBetween(left: TSESTree.Node | TSESTree.Token | TSESTree.Comment, right: TSESTree.Node | TSESTree.Token | TSESTree.Comment, padding?: number): SourceCode.ReturnTypeFromOptions[]; +} +declare class SourceCodeBase extends TokenStore { + /** + * Represents parsed source code. + * @param text The source code text. + * @param ast The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped. + */ + constructor(text: string, ast: SourceCode.Program); + /** + * Represents parsed source code. + * @param config The config object. + */ + constructor(config: SourceCode.SourceCodeConfig); + /** + * The parsed AST for the source code. + */ + ast: SourceCode.Program; + /** + * Retrieves an array containing all comments in the source code. + * @returns An array of comment nodes. + */ + getAllComments(): TSESTree.Comment[]; + /** + * Gets all comments for the given node. + * @param node The AST node to get the comments for. + * @returns An object containing a leading and trailing array of comments indexed by their position. + */ + getComments(node: TSESTree.Node): { + leading: TSESTree.Comment[]; + trailing: TSESTree.Comment[]; + }; + /** + * Converts a (line, column) pair into a range index. + * @param loc A line/column location + * @returns The range index of the location in the file. + */ + getIndexFromLoc(location: TSESTree.LineAndColumnData): number; + /** + * Gets the entire source text split into an array of lines. + * @returns The source text as an array of lines. + */ + getLines(): string[]; + /** + * Converts a source text index into a (line, column) pair. + * @param index The index of a character in a file + * @returns A {line, column} location object with a 0-indexed column + */ + getLocFromIndex(index: number): TSESTree.LineAndColumnData; + /** + * Gets the deepest node containing a range index. + * @param index Range index of the desired node. + * @returns The node if found or `null` if not found. + */ + getNodeByRangeIndex(index: number): TSESTree.Node | null; + /** + * Gets the source code for the given node. + * @param node The AST node to get the text for. + * @param beforeCount The number of characters before the node to retrieve. + * @param afterCount The number of characters after the node to retrieve. + * @returns The text representing the AST node. + */ + getText(node?: TSESTree.Node, beforeCount?: number, afterCount?: number): string; + /** + * The flag to indicate that the source code has Unicode BOM. + */ + hasBOM: boolean; + /** + * Determines if two nodes or tokens have at least one whitespace character + * between them. Order does not matter. Returns false if the given nodes or + * tokens overlap. + * This was added in v6.7.0. + * @since 6.7.0 + * @param first The first node or token to check between. + * @param second The second node or token to check between. + * @returns True if there is a whitespace character between any of the tokens found between the two given nodes or tokens. + */ + isSpaceBetween?(first: TSESTree.Token | TSESTree.Comment | TSESTree.Node, second: TSESTree.Token | TSESTree.Comment | TSESTree.Node): boolean; + /** + * Determines if two nodes or tokens have at least one whitespace character + * between them. Order does not matter. Returns false if the given nodes or + * tokens overlap. + * For backward compatibility, this method returns true if there are + * `JSXText` tokens that contain whitespace between the two. + * @param first The first node or token to check between. + * @param second The second node or token to check between. + * @returns {boolean} True if there is a whitespace character between + * any of the tokens found between the two given nodes or tokens. + * @deprecated in favor of isSpaceBetween + */ + isSpaceBetweenTokens(first: TSESTree.Token, second: TSESTree.Token): boolean; + /** + * The source code split into lines according to ECMA-262 specification. + * This is done to avoid each rule needing to do so separately. + */ + lines: string[]; + /** + * The indexes in `text` that each line starts + */ + lineStartIndices: number[]; + /** + * The parser services of this source code. + */ + parserServices: ParserServices; + /** + * The scope of this source code. + */ + scopeManager: Scope.ScopeManager | null; + /** + * The original text source code. BOM was stripped from this text. + */ + text: string; + /** + * All of the tokens and comments in the AST. + */ + tokensAndComments: (TSESTree.Comment | TSESTree.Token)[]; + /** + * The visitor keys to traverse AST. + */ + visitorKeys: SourceCode.VisitorKeys; + /** + * Split the source code into multiple lines based on the line delimiters. + * @param text Source code as a string. + * @returns Array of source code lines. + */ + static splitLines(text: string): string[]; +} +declare namespace SourceCode { + interface Program extends TSESTree.Program { + comments: TSESTree.Comment[]; + tokens: TSESTree.Token[]; + } + interface SourceCodeConfig { + /** + * The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped. + */ + ast: Program; + /** + * The parser services. + */ + parserServices: ParserServices | null; + /** + * The scope of this source code. + */ + scopeManager: Scope.ScopeManager | null; + /** + * The source code text. + */ + text: string; + /** + * The visitor keys to traverse AST. + */ + visitorKeys: VisitorKeys | null; + } + interface VisitorKeys { + [nodeType: string]: string[]; + } + type FilterPredicate = (tokenOrComment: TSESTree.Token | TSESTree.Comment) => boolean; + type ReturnTypeFromOptions = T extends { + includeComments: true; + } ? TSESTree.Token : Exclude; + type CursorWithSkipOptions = number | FilterPredicate | { + /** + * The predicate function to choose tokens. + */ + filter?: FilterPredicate; + /** + * The flag to iterate comments as well. + */ + includeComments?: boolean; + /** + * The count of tokens the cursor skips. + */ + skip?: number; + }; + type CursorWithCountOptions = number | FilterPredicate | { + /** + * The predicate function to choose tokens. + */ + filter?: FilterPredicate; + /** + * The flag to iterate comments as well. + */ + includeComments?: boolean; + /** + * The maximum count of tokens the cursor iterates. + */ + count?: number; + }; +} +declare const SourceCode_base: typeof SourceCodeBase; +declare class SourceCode extends SourceCode_base { +} +export { SourceCode }; +//# sourceMappingURL=SourceCode.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/index.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/index.d.ts new file mode 100644 index 000000000..2b6338ef4 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/index.d.ts @@ -0,0 +1,10 @@ +export * from './AST'; +export * from './CLIEngine'; +export * from './ESLint'; +export * from './Linter'; +export * from './ParserOptions'; +export * from './Rule'; +export * from './RuleTester'; +export * from './Scope'; +export * from './SourceCode'; +//# sourceMappingURL=index.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-estree.d.ts b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-estree.d.ts new file mode 100644 index 000000000..3129348e9 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-estree.d.ts @@ -0,0 +1,3 @@ +export { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree, } from '@typescript-eslint/types'; +export { ParserServices } from '@typescript-eslint/typescript-estree/dist/parser-options'; +//# sourceMappingURL=ts-estree.d.ts.map diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/PatternMatcher.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/PatternMatcher.d.ts new file mode 100644 index 000000000..436baca27 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/PatternMatcher.d.ts @@ -0,0 +1,48 @@ +interface PatternMatcher { + /** + * Iterate all matched parts in a given string. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#matcher-execall} + */ + execAll(str: string): IterableIterator; + /** + * Check whether this pattern matches a given string or not. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#matcher-test} + */ + test(str: string): boolean; + /** + * Replace all matched parts by a given replacer. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#matcher-symbol-replace} + * @example + * const { PatternMatcher } = require("eslint-utils") + * const matcher = new PatternMatcher(/\\p{Script=Greek}/g) + * + * module.exports = { + * meta: {}, + * create(context) { + * return { + * "Literal[regex]"(node) { + * const replacedPattern = node.regex.pattern.replace( + * matcher, + * "[\\u0370-\\u0373\\u0375-\\u0377\\u037A-\\u037D\\u037F\\u0384\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03E1\\u03F0-\\u03FF\\u1D26-\\u1D2A\\u1D5D-\\u1D61\\u1D66-\\u1D6A\\u1DBF\\u1F00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FC4\\u1FC6-\\u1FD3\\u1FD6-\\u1FDB\\u1FDD-\\u1FEF\\u1FF2-\\u1FF4\\u1FF6-\\u1FFE\\u2126\\uAB65]|\\uD800[\\uDD40-\\uDD8E\\uDDA0]|\\uD834[\\uDE00-\\uDE45]" + * ) + * }, + * } + * }, + * } + */ + [Symbol.replace](str: string, replacer: string | ((...strs: string[]) => string)): string; +} +/** + * The class to find a pattern in strings as handling escape sequences. + * It ignores the found pattern if it's escaped with `\`. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#patternmatcher-class} + */ +declare const PatternMatcher: new (pattern: RegExp, options?: { + escaped?: boolean | undefined; +} | undefined) => PatternMatcher; +export { PatternMatcher }; +//# sourceMappingURL=PatternMatcher.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/PatternMatcher.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/PatternMatcher.d.ts.map new file mode 100644 index 000000000..29c100aa2 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/PatternMatcher.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"PatternMatcher.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/PatternMatcher.ts"],"names":[],"mappings":"AAEA,UAAU,cAAc;IACtB;;;;OAIG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC,eAAe,CAAC,CAAC;IAExD;;;;OAIG;IACH,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAE3B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC,CACd,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC,GACjD,MAAM,CAAC;CACX;AAED;;;;;GAKG;AACH,QAAA,MAAM,cAAc,gBACJ,MAAM;;kBAAoC,cACzD,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/PatternMatcher.js b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/PatternMatcher.js new file mode 100644 index 000000000..0f2983d6d --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/PatternMatcher.js @@ -0,0 +1,32 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PatternMatcher = void 0; +const eslintUtils = __importStar(require("eslint-utils")); +/** + * The class to find a pattern in strings as handling escape sequences. + * It ignores the found pattern if it's escaped with `\`. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#patternmatcher-class} + */ +const PatternMatcher = eslintUtils.PatternMatcher; +exports.PatternMatcher = PatternMatcher; +//# sourceMappingURL=PatternMatcher.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/PatternMatcher.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/PatternMatcher.js.map new file mode 100644 index 000000000..886c2d0c8 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/PatternMatcher.js.map @@ -0,0 +1 @@ +{"version":3,"file":"PatternMatcher.js","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/PatternMatcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4C;AA6C5C;;;;;GAKG;AACH,MAAM,cAAc,GAAG,WAAW,CAAC,cAElC,CAAC;AAEO,wCAAc"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts new file mode 100644 index 000000000..2a5135775 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts @@ -0,0 +1,72 @@ +import { TSESTree } from '../../ts-estree'; +import * as TSESLint from '../../ts-eslint'; +declare const ReferenceTrackerREAD: unique symbol; +declare const ReferenceTrackerCALL: unique symbol; +declare const ReferenceTrackerCONSTRUCT: unique symbol; +interface ReferenceTracker { + /** + * Iterate the references that the given `traceMap` determined. + * This method starts to search from global variables. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#tracker-iterateglobalreferences} + */ + iterateGlobalReferences(traceMap: ReferenceTracker.TraceMap): IterableIterator>; + /** + * Iterate the references that the given `traceMap` determined. + * This method starts to search from `require()` expression. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#tracker-iteratecjsreferences} + */ + iterateCjsReferences(traceMap: ReferenceTracker.TraceMap): IterableIterator>; + /** + * Iterate the references that the given `traceMap` determined. + * This method starts to search from `import`/`export` declarations. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#tracker-iterateesmreferences} + */ + iterateEsmReferences(traceMap: ReferenceTracker.TraceMap): IterableIterator>; +} +interface ReferenceTrackerStatic { + new (globalScope: TSESLint.Scope.Scope, options?: { + /** + * The mode which determines how the `tracker.iterateEsmReferences()` method scans CommonJS modules. + * If this is `"strict"`, the method binds CommonJS modules to the default export. Otherwise, the method binds + * CommonJS modules to both the default export and named exports. Optional. Default is `"strict"`. + */ + mode: 'strict' | 'legacy'; + /** + * The name list of Global Object. Optional. Default is `["global", "globalThis", "self", "window"]`. + */ + globalObjectNames: readonly string[]; + }): ReferenceTracker; + readonly READ: typeof ReferenceTrackerREAD; + readonly CALL: typeof ReferenceTrackerCALL; + readonly CONSTRUCT: typeof ReferenceTrackerCONSTRUCT; +} +declare namespace ReferenceTracker { + type READ = ReferenceTrackerStatic['READ']; + type CALL = ReferenceTrackerStatic['CALL']; + type CONSTRUCT = ReferenceTrackerStatic['CONSTRUCT']; + type ReferenceType = READ | CALL | CONSTRUCT; + type TraceMap = Record>; + interface TraceMapElement { + [ReferenceTrackerREAD]?: T; + [ReferenceTrackerCALL]?: T; + [ReferenceTrackerCONSTRUCT]?: T; + [key: string]: TraceMapElement; + } + interface FoundReference { + node: TSESTree.Node; + path: readonly string[]; + type: ReferenceType; + entry: T; + } +} +/** + * The tracker for references. This provides reference tracking for global variables, CommonJS modules, and ES modules. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#referencetracker-class} + */ +declare const ReferenceTracker: ReferenceTrackerStatic; +export { ReferenceTracker }; +//# sourceMappingURL=ReferenceTracker.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts.map new file mode 100644 index 000000000..84fa9dd5e --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ReferenceTracker.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/ReferenceTracker.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C,QAAA,MAAM,oBAAoB,EAAE,OAAO,MAA0C,CAAC;AAC9E,QAAA,MAAM,o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D,KAAY,aAAa,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;IAEpD,KAAY,QAAQ,CAAC,CAAC,GAAG,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IACnE,UAAiB,eAAe,CAAC,CAAC;QAChC,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC;QAC3B,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC;QAC3B,CAAC,yBAAyB,CAAC,CAAC,EAAE,CAAC,CAAC;QAChC,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;KACnC;IAED,UAAiB,cAAc,CAAC,CAAC,GAAG,GAAG;QACrC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;QACpB,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;QACxB,IAAI,EAAE,aAAa,CAAC;QACpB,KAAK,EAAE,CAAC,CAAC;KACV;CACF;AAED;;;;GAIG;AACH,QAAA,MAAM,gBAAgB,wBAAyD,CAAC;AAEhF,OAAO,EAAE,gBAAgB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/ReferenceTracker.js b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/ReferenceTracker.js new file mode 100644 index 000000000..89f1f7d2e --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/ReferenceTracker.js @@ -0,0 +1,35 @@ +"use strict"; +/* eslint-disable @typescript-eslint/no-namespace */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ReferenceTracker = void 0; +const eslintUtils = __importStar(require("eslint-utils")); +const ReferenceTrackerREAD = eslintUtils.ReferenceTracker.READ; +const ReferenceTrackerCALL = eslintUtils.ReferenceTracker.CALL; +const ReferenceTrackerCONSTRUCT = eslintUtils.ReferenceTracker.CONSTRUCT; +/** + * The tracker for references. This provides reference tracking for global variables, CommonJS modules, and ES modules. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#referencetracker-class} + */ +const ReferenceTracker = eslintUtils.ReferenceTracker; +exports.ReferenceTracker = ReferenceTracker; +//# sourceMappingURL=ReferenceTracker.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/ReferenceTracker.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/ReferenceTracker.js.map new file mode 100644 index 000000000..52d6efde1 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/ReferenceTracker.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ReferenceTracker.js","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/ReferenceTracker.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;;;;;;;;;;;;;;;;;;;;AAEpD,0DAA4C;AAI5C,MAAM,oBAAoB,GAAkB,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC;AAC9E,MAAM,oBAAoB,GAAkB,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC;AAC9E,MAAM,yBAAyB,GAC7B,WAAW,CAAC,gBAAgB,CAAC,SAAS,CAAC;AA6EzC;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,WAAW,CAAC,gBAA0C,CAAC;AAEvE,4CAAgB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/astUtilities.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/astUtilities.d.ts new file mode 100644 index 000000000..fec065f43 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/astUtilities.d.ts @@ -0,0 +1,82 @@ +import { TSESTree } from '../../ts-estree'; +import * as TSESLint from '../../ts-eslint'; +/** + * Get the proper location of a given function node to report. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getfunctionheadlocation} + */ +declare const getFunctionHeadLocation: (node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression, sourceCode: TSESLint.SourceCode) => TSESTree.SourceLocation; +/** + * Get the name and kind of a given function node. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getfunctionnamewithkind} + */ +declare const getFunctionNameWithKind: (node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression) => string; +/** + * Get the property name of a given property node. + * If the node is a computed property, this tries to compute the property name by the getStringIfConstant function. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getpropertyname} + * @returns The property name of the node. If the property name is not constant then it returns `null`. + */ +declare const getPropertyName: (node: TSESTree.MemberExpression | TSESTree.Property | TSESTree.MethodDefinition, initialScope?: import("@typescript-eslint/scope-manager/dist/scope/BlockScope").BlockScope | import("@typescript-eslint/scope-manager/dist/scope/CatchScope").CatchScope | import("@typescript-eslint/scope-manager/dist/scope/ClassScope").ClassScope | import("@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope").ConditionalTypeScope | import("@typescript-eslint/scope-manager/dist/scope/ForScope").ForScope | import("@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope").FunctionExpressionNameScope | import("@typescript-eslint/scope-manager/dist/scope/FunctionScope").FunctionScope | import("@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope").FunctionTypeScope | import("@typescript-eslint/scope-manager/dist/scope/GlobalScope").GlobalScope | import("@typescript-eslint/scope-manager/dist/scope/MappedTypeScope").MappedTypeScope | import("@typescript-eslint/scope-manager/dist/scope/ModuleScope").ModuleScope | import("@typescript-eslint/scope-manager/dist/scope/SwitchScope").SwitchScope | import("@typescript-eslint/scope-manager/dist/scope/TSEnumScope").TSEnumScope | import("@typescript-eslint/scope-manager/dist/scope/TSModuleScope").TSModuleScope | import("@typescript-eslint/scope-manager/dist/scope/TypeScope").TypeScope | import("@typescript-eslint/scope-manager/dist/scope/WithScope").WithScope | undefined) => string | null; +/** + * Get the value of a given node if it can decide the value statically. + * If the 2nd parameter `initialScope` was given, this function tries to resolve identifier references which are in the + * given node as much as possible. In the resolving way, it does on the assumption that built-in global objects have + * not been modified. + * For example, it considers `Symbol.iterator`, ` String.raw``hello`` `, and `Object.freeze({a: 1}).a` as static. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getstaticvalue} + * @returns The `{ value: any }` shaped object. The `value` property is the static value. If it couldn't compute the + * static value of the node, it returns `null`. + */ +declare const getStaticValue: (node: TSESTree.Node, initialScope?: import("@typescript-eslint/scope-manager/dist/scope/BlockScope").BlockScope | import("@typescript-eslint/scope-manager/dist/scope/CatchScope").CatchScope | import("@typescript-eslint/scope-manager/dist/scope/ClassScope").ClassScope | import("@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope").ConditionalTypeScope | import("@typescript-eslint/scope-manager/dist/scope/ForScope").ForScope | import("@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope").FunctionExpressionNameScope | import("@typescript-eslint/scope-manager/dist/scope/FunctionScope").FunctionScope | import("@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope").FunctionTypeScope | import("@typescript-eslint/scope-manager/dist/scope/GlobalScope").GlobalScope | import("@typescript-eslint/scope-manager/dist/scope/MappedTypeScope").MappedTypeScope | import("@typescript-eslint/scope-manager/dist/scope/ModuleScope").ModuleScope | import("@typescript-eslint/scope-manager/dist/scope/SwitchScope").SwitchScope | import("@typescript-eslint/scope-manager/dist/scope/TSEnumScope").TSEnumScope | import("@typescript-eslint/scope-manager/dist/scope/TSModuleScope").TSModuleScope | import("@typescript-eslint/scope-manager/dist/scope/TypeScope").TypeScope | import("@typescript-eslint/scope-manager/dist/scope/WithScope").WithScope | undefined) => { + value: unknown; +} | null; +/** + * Get the string value of a given node. + * This function is a tiny wrapper of the getStaticValue function. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getstringifconstant} + */ +declare const getStringIfConstant: (node: TSESTree.Node, initialScope?: import("@typescript-eslint/scope-manager/dist/scope/BlockScope").BlockScope | import("@typescript-eslint/scope-manager/dist/scope/CatchScope").CatchScope | import("@typescript-eslint/scope-manager/dist/scope/ClassScope").ClassScope | import("@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope").ConditionalTypeScope | import("@typescript-eslint/scope-manager/dist/scope/ForScope").ForScope | import("@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope").FunctionExpressionNameScope | import("@typescript-eslint/scope-manager/dist/scope/FunctionScope").FunctionScope | import("@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope").FunctionTypeScope | import("@typescript-eslint/scope-manager/dist/scope/GlobalScope").GlobalScope | import("@typescript-eslint/scope-manager/dist/scope/MappedTypeScope").MappedTypeScope | import("@typescript-eslint/scope-manager/dist/scope/ModuleScope").ModuleScope | import("@typescript-eslint/scope-manager/dist/scope/SwitchScope").SwitchScope | import("@typescript-eslint/scope-manager/dist/scope/TSEnumScope").TSEnumScope | import("@typescript-eslint/scope-manager/dist/scope/TSModuleScope").TSModuleScope | import("@typescript-eslint/scope-manager/dist/scope/TypeScope").TypeScope | import("@typescript-eslint/scope-manager/dist/scope/WithScope").WithScope | undefined) => string | null; +/** + * Check whether a given node has any side effect or not. + * The side effect means that it may modify a certain variable or object member. This function considers the node which + * contains the following types as the node which has side effects: + * - `AssignmentExpression` + * - `AwaitExpression` + * - `CallExpression` + * - `ImportExpression` + * - `NewExpression` + * - `UnaryExpression([operator = "delete"])` + * - `UpdateExpression` + * - `YieldExpression` + * - When `options.considerGetters` is `true`: + * - `MemberExpression` + * - When `options.considerImplicitTypeConversion` is `true`: + * - `BinaryExpression([operator = "==" | "!=" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "in"])` + * - `MemberExpression([computed = true])` + * - `MethodDefinition([computed = true])` + * - `Property([computed = true])` + * - `UnaryExpression([operator = "-" | "+" | "!" | "~"])` + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#hassideeffect} + */ +declare const hasSideEffect: (node: TSESTree.Node, sourceCode: TSESLint.SourceCode, options?: { + considerGetters?: boolean | undefined; + considerImplicitTypeConversion?: boolean | undefined; +} | undefined) => boolean; +/** + * Check whether a given node is parenthesized or not. + * This function detects it correctly even if it's parenthesized by specific syntax. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#isparenthesized} + * @returns `true` if the node is parenthesized. + * If `times` was given, it returns `true` only if the node is parenthesized the `times` times. + * For example, `isParenthesized(2, node, sourceCode)` returns true for `((foo))`, but not for `(foo)`. + */ +declare const isParenthesized: (node: TSESTree.Node, sourceCode: TSESLint.SourceCode) => boolean; +export { getFunctionHeadLocation, getFunctionNameWithKind, getPropertyName, getStaticValue, getStringIfConstant, hasSideEffect, isParenthesized, }; +//# sourceMappingURL=astUtilities.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/astUtilities.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/astUtilities.d.ts.map new file mode 100644 index 000000000..18cbf2dcf --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/astUtilities.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"astUtilities.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/astUtilities.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C;;;;GAIG;AACH,QAAA,MAAM,uBAAuB,SAEvB,SAAS,mBAAmB,GAC5B,SAAS,kBAAkB,GAC3B,SAAS,uBAAuB,cACxB,SAAS,UAAU,KAC5B,SAAS,cAAc,CAAC;AAE7B;;;;GAIG;AACH,QAAA,MAAM,uBAAuB,SAEvB,SAAS,mBAAmB,GAC5B,SAAS,kBAAkB,GAC3B,SAAS,uBAAuB,KACjC,MAAM,CAAC;AAEZ;;;;;;GAMG;AACH,QAAA,MAAM,eAAe,SAEf,SAAS,gBAAgB,GACzB,SAAS,QAAQ,GACjB,SAAS,gBAAgB,y1CAE1B,MAAM,GAAG,IAAI,CAAC;AAEnB;;;;;;;;;;GAUG;AACH,QAAA,MAAM,cAAc,SACZ,SAAS,IAAI,y1CAEhB;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAAC;AAE/B;;;;;GAKG;AACH,QAAA,MAAM,mBAAmB,SACjB,SAAS,IAAI,y1CAEhB,MAAM,GAAG,IAAI,CAAC;AAEnB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,QAAA,MAAM,aAAa,SACX,SAAS,IAAI,cACP,SAAS,UAAU;;;kBAK5B,OAAO,CAAC;AAEb;;;;;;;;GAQG;AACH,QAAA,MAAM,eAAe,SACb,SAAS,IAAI,cACP,SAAS,UAAU,KAC5B,OAAO,CAAC;AAEb,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,eAAe,GAChB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/astUtilities.js b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/astUtilities.js new file mode 100644 index 000000000..a7f6458c8 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/astUtilities.js @@ -0,0 +1,104 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isParenthesized = exports.hasSideEffect = exports.getStringIfConstant = exports.getStaticValue = exports.getPropertyName = exports.getFunctionNameWithKind = exports.getFunctionHeadLocation = void 0; +const eslintUtils = __importStar(require("eslint-utils")); +/** + * Get the proper location of a given function node to report. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getfunctionheadlocation} + */ +const getFunctionHeadLocation = eslintUtils.getFunctionHeadLocation; +exports.getFunctionHeadLocation = getFunctionHeadLocation; +/** + * Get the name and kind of a given function node. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getfunctionnamewithkind} + */ +const getFunctionNameWithKind = eslintUtils.getFunctionNameWithKind; +exports.getFunctionNameWithKind = getFunctionNameWithKind; +/** + * Get the property name of a given property node. + * If the node is a computed property, this tries to compute the property name by the getStringIfConstant function. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getpropertyname} + * @returns The property name of the node. If the property name is not constant then it returns `null`. + */ +const getPropertyName = eslintUtils.getPropertyName; +exports.getPropertyName = getPropertyName; +/** + * Get the value of a given node if it can decide the value statically. + * If the 2nd parameter `initialScope` was given, this function tries to resolve identifier references which are in the + * given node as much as possible. In the resolving way, it does on the assumption that built-in global objects have + * not been modified. + * For example, it considers `Symbol.iterator`, ` String.raw``hello`` `, and `Object.freeze({a: 1}).a` as static. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getstaticvalue} + * @returns The `{ value: any }` shaped object. The `value` property is the static value. If it couldn't compute the + * static value of the node, it returns `null`. + */ +const getStaticValue = eslintUtils.getStaticValue; +exports.getStaticValue = getStaticValue; +/** + * Get the string value of a given node. + * This function is a tiny wrapper of the getStaticValue function. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getstringifconstant} + */ +const getStringIfConstant = eslintUtils.getStringIfConstant; +exports.getStringIfConstant = getStringIfConstant; +/** + * Check whether a given node has any side effect or not. + * The side effect means that it may modify a certain variable or object member. This function considers the node which + * contains the following types as the node which has side effects: + * - `AssignmentExpression` + * - `AwaitExpression` + * - `CallExpression` + * - `ImportExpression` + * - `NewExpression` + * - `UnaryExpression([operator = "delete"])` + * - `UpdateExpression` + * - `YieldExpression` + * - When `options.considerGetters` is `true`: + * - `MemberExpression` + * - When `options.considerImplicitTypeConversion` is `true`: + * - `BinaryExpression([operator = "==" | "!=" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "in"])` + * - `MemberExpression([computed = true])` + * - `MethodDefinition([computed = true])` + * - `Property([computed = true])` + * - `UnaryExpression([operator = "-" | "+" | "!" | "~"])` + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#hassideeffect} + */ +const hasSideEffect = eslintUtils.hasSideEffect; +exports.hasSideEffect = hasSideEffect; +/** + * Check whether a given node is parenthesized or not. + * This function detects it correctly even if it's parenthesized by specific syntax. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#isparenthesized} + * @returns `true` if the node is parenthesized. + * If `times` was given, it returns `true` only if the node is parenthesized the `times` times. + * For example, `isParenthesized(2, node, sourceCode)` returns true for `((foo))`, but not for `(foo)`. + */ +const isParenthesized = eslintUtils.isParenthesized; +exports.isParenthesized = isParenthesized; +//# sourceMappingURL=astUtilities.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/astUtilities.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/astUtilities.js.map new file mode 100644 index 000000000..5227cc018 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/astUtilities.js.map @@ -0,0 +1 @@ +{"version":3,"file":"astUtilities.js","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/astUtilities.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4C;AAI5C;;;;GAIG;AACH,MAAM,uBAAuB,GAAG,WAAW,CAAC,uBAMhB,CAAC;AAuG3B,0DAAuB;AArGzB;;;;GAIG;AACH,MAAM,uBAAuB,GAAG,WAAW,CAAC,uBAKjC,CAAC;AA4FV,0DAAuB;AA1FzB;;;;;;GAMG;AACH,MAAM,eAAe,GAAG,WAAW,CAAC,eAMlB,CAAC;AA8EjB,0CAAe;AA5EjB;;;;;;;;;;GAUG;AACH,MAAM,cAAc,GAAG,WAAW,CAAC,cAGL,CAAC;AA+D7B,wCAAc;AA7DhB;;;;;GAKG;AACH,MAAM,mBAAmB,GAAG,WAAW,CAAC,mBAGtB,CAAC;AAqDjB,kDAAmB;AAnDrB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,aAAa,GAAG,WAAW,CAAC,aAOtB,CAAC;AAsBX,sCAAa;AApBf;;;;;;;;GAQG;AACH,MAAM,eAAe,GAAG,WAAW,CAAC,eAGxB,CAAC;AASX,0CAAe"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/index.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/index.d.ts new file mode 100644 index 000000000..3ec74aa22 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/index.d.ts @@ -0,0 +1,6 @@ +export * from './astUtilities'; +export * from './PatternMatcher'; +export * from './predicates'; +export * from './ReferenceTracker'; +export * from './scopeAnalysis'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/index.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/index.d.ts.map new file mode 100644 index 000000000..e6a667206 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/index.js b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/index.js new file mode 100644 index 000000000..67dc7ce35 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/index.js @@ -0,0 +1,18 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./astUtilities"), exports); +__exportStar(require("./PatternMatcher"), exports); +__exportStar(require("./predicates"), exports); +__exportStar(require("./ReferenceTracker"), exports); +__exportStar(require("./scopeAnalysis"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/index.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/index.js.map new file mode 100644 index 000000000..f2e4e02d6 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA+B;AAC/B,mDAAiC;AACjC,+CAA6B;AAC7B,qDAAmC;AACnC,kDAAgC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/predicates.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/predicates.d.ts new file mode 100644 index 000000000..867d24b69 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/predicates.d.ts @@ -0,0 +1,45 @@ +import { TSESTree } from '../../ts-estree'; +declare const isArrowToken: (token: TSESTree.Token | TSESTree.Comment) => token is TSESTree.PunctuatorToken & { + value: '=>'; +}; +declare const isNotArrowToken: (token: TSESTree.Token | TSESTree.Comment) => boolean; +declare const isClosingBraceToken: (token: TSESTree.Token | TSESTree.Comment) => token is TSESTree.PunctuatorToken & { + value: '}'; +}; +declare const isNotClosingBraceToken: (token: TSESTree.Token | TSESTree.Comment) => boolean; +declare const isClosingBracketToken: (token: TSESTree.Token | TSESTree.Comment) => token is TSESTree.PunctuatorToken & { + value: ']'; +}; +declare const isNotClosingBracketToken: (token: TSESTree.Token | TSESTree.Comment) => boolean; +declare const isClosingParenToken: (token: TSESTree.Token | TSESTree.Comment) => token is TSESTree.PunctuatorToken & { + value: ')'; +}; +declare const isNotClosingParenToken: (token: TSESTree.Token | TSESTree.Comment) => boolean; +declare const isColonToken: (token: TSESTree.Token | TSESTree.Comment) => token is TSESTree.PunctuatorToken & { + value: ':'; +}; +declare const isNotColonToken: (token: TSESTree.Token | TSESTree.Comment) => boolean; +declare const isCommaToken: (token: TSESTree.Token | TSESTree.Comment) => token is TSESTree.PunctuatorToken & { + value: ','; +}; +declare const isNotCommaToken: (token: TSESTree.Token | TSESTree.Comment) => boolean; +declare const isCommentToken: (token: TSESTree.Token | TSESTree.Comment) => token is TSESTree.Comment; +declare const isNotCommentToken: (token: T) => token is Exclude; +declare const isOpeningBraceToken: (token: TSESTree.Token | TSESTree.Comment) => token is TSESTree.PunctuatorToken & { + value: '{'; +}; +declare const isNotOpeningBraceToken: (token: TSESTree.Token | TSESTree.Comment) => boolean; +declare const isOpeningBracketToken: (token: TSESTree.Token | TSESTree.Comment) => token is TSESTree.PunctuatorToken & { + value: '['; +}; +declare const isNotOpeningBracketToken: (token: TSESTree.Token | TSESTree.Comment) => boolean; +declare const isOpeningParenToken: (token: TSESTree.Token | TSESTree.Comment) => token is TSESTree.PunctuatorToken & { + value: '('; +}; +declare const isNotOpeningParenToken: (token: TSESTree.Token | TSESTree.Comment) => boolean; +declare const isSemicolonToken: (token: TSESTree.Token | TSESTree.Comment) => token is TSESTree.PunctuatorToken & { + value: ';'; +}; +declare const isNotSemicolonToken: (token: TSESTree.Token | TSESTree.Comment) => boolean; +export { isArrowToken, isClosingBraceToken, isClosingBracketToken, isClosingParenToken, isColonToken, isCommaToken, isCommentToken, isNotArrowToken, isNotClosingBraceToken, isNotClosingBracketToken, isNotClosingParenToken, isNotColonToken, isNotCommaToken, isNotCommentToken, isNotOpeningBraceToken, isNotOpeningBracketToken, isNotOpeningParenToken, isNotSemicolonToken, isOpeningBraceToken, isOpeningBracketToken, isOpeningParenToken, isSemicolonToken, }; +//# sourceMappingURL=predicates.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/predicates.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/predicates.d.ts.map new file mode 100644 index 000000000..e8079514c --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/predicates.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"predicates.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/predicates.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,QAAA,MAAM,YAAY,UACT,SAAS,KAAK,GAAG,SAAS,OAAO;WACQ,IAAI;CAAE,CAAC;AACzD,QAAA,MAAM,eAAe,UACZ,SAAS,KAAK,GAAG,SAAS,OAAO,KACrC,OAAO,CAAC;AAEb,QAAA,MAAM,mBAAmB,UAChB,SAAS,KAAK,GAAG,SAAS,OAAO;WACQ,GAAG;CAAE,CAAC;AACxD,QAAA,MAAM,sBAAsB,UACnB,SAAS,KAAK,GAAG,SAAS,OAAO,KACrC,OAAO,CAAC;AAEb,QAAA,MAAM,qBAAqB,UAClB,SAAS,KAAK,GAAG,SAAS,OAAO;WACQ,GAAG;CAAE,CAAC;AACxD,QAAA,MAAM,wBAAwB,UACrB,SAAS,KAAK,GAAG,SAAS,OAAO,KACrC,OAAO,CAAC;AAEb,QAAA,MAAM,mBAAmB,UAChB,SAAS,KAAK,GAAG,SAAS,OAAO;WACQ,GAAG;CAAE,CAAC;AACxD,QAAA,MAAM,sBAAsB,UACnB,SAAS,KAAK,GAAG,SAAS,OAAO,KACrC,OAAO,CAAC;AAEb,QAAA,MAAM,YAAY,UACT,SAAS,KAAK,GAAG,SAAS,OAAO;WACQ,GAAG;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BAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,GACjB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/predicates.js b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/predicates.js new file mode 100644 index 000000000..cea9b9828 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/predicates.js @@ -0,0 +1,68 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isSemicolonToken = exports.isOpeningParenToken = exports.isOpeningBracketToken = exports.isOpeningBraceToken = exports.isNotSemicolonToken = exports.isNotOpeningParenToken = exports.isNotOpeningBracketToken = exports.isNotOpeningBraceToken = exports.isNotCommentToken = exports.isNotCommaToken = exports.isNotColonToken = exports.isNotClosingParenToken = exports.isNotClosingBracketToken = exports.isNotClosingBraceToken = exports.isNotArrowToken = exports.isCommentToken = exports.isCommaToken = exports.isColonToken = exports.isClosingParenToken = exports.isClosingBracketToken = exports.isClosingBraceToken = exports.isArrowToken = void 0; +const eslintUtils = __importStar(require("eslint-utils")); +const isArrowToken = eslintUtils.isArrowToken; +exports.isArrowToken = isArrowToken; +const isNotArrowToken = eslintUtils.isNotArrowToken; +exports.isNotArrowToken = isNotArrowToken; +const isClosingBraceToken = eslintUtils.isClosingBraceToken; +exports.isClosingBraceToken = isClosingBraceToken; +const isNotClosingBraceToken = eslintUtils.isNotClosingBraceToken; +exports.isNotClosingBraceToken = isNotClosingBraceToken; +const isClosingBracketToken = eslintUtils.isClosingBracketToken; +exports.isClosingBracketToken = isClosingBracketToken; +const isNotClosingBracketToken = eslintUtils.isNotClosingBracketToken; +exports.isNotClosingBracketToken = isNotClosingBracketToken; +const isClosingParenToken = eslintUtils.isClosingParenToken; +exports.isClosingParenToken = isClosingParenToken; +const isNotClosingParenToken = eslintUtils.isNotClosingParenToken; +exports.isNotClosingParenToken = isNotClosingParenToken; +const isColonToken = eslintUtils.isColonToken; +exports.isColonToken = isColonToken; +const isNotColonToken = eslintUtils.isNotColonToken; +exports.isNotColonToken = isNotColonToken; +const isCommaToken = eslintUtils.isCommaToken; +exports.isCommaToken = isCommaToken; +const isNotCommaToken = eslintUtils.isNotCommaToken; +exports.isNotCommaToken = isNotCommaToken; +const isCommentToken = eslintUtils.isCommentToken; +exports.isCommentToken = isCommentToken; +const isNotCommentToken = eslintUtils.isNotCommentToken; +exports.isNotCommentToken = isNotCommentToken; +const isOpeningBraceToken = eslintUtils.isOpeningBraceToken; +exports.isOpeningBraceToken = isOpeningBraceToken; +const isNotOpeningBraceToken = eslintUtils.isNotOpeningBraceToken; +exports.isNotOpeningBraceToken = isNotOpeningBraceToken; +const isOpeningBracketToken = eslintUtils.isOpeningBracketToken; +exports.isOpeningBracketToken = isOpeningBracketToken; +const isNotOpeningBracketToken = eslintUtils.isNotOpeningBracketToken; +exports.isNotOpeningBracketToken = isNotOpeningBracketToken; +const isOpeningParenToken = eslintUtils.isOpeningParenToken; +exports.isOpeningParenToken = isOpeningParenToken; +const isNotOpeningParenToken = eslintUtils.isNotOpeningParenToken; +exports.isNotOpeningParenToken = isNotOpeningParenToken; +const isSemicolonToken = eslintUtils.isSemicolonToken; +exports.isSemicolonToken = isSemicolonToken; +const isNotSemicolonToken = eslintUtils.isNotSemicolonToken; +exports.isNotSemicolonToken = isNotSemicolonToken; +//# sourceMappingURL=predicates.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/predicates.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/predicates.js.map new file mode 100644 index 000000000..b39d5cf4b --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/predicates.js.map @@ -0,0 +1 @@ +{"version":3,"file":"predicates.js","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/predicates.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4C;AAG5C,MAAM,YAAY,GAAG,WAAW,CAAC,YAEuB,CAAC;AA8EvD,oCAAY;AA7Ed,MAAM,eAAe,GAAG,WAAW,CAAC,eAExB,CAAC;AAkFX,0CAAe;AAhFjB,MAAM,mBAAmB,GAAG,WAAW,CAAC,mBAEe,CAAC;AAwEtD,kDAAmB;AAvErB,MAAM,sBAAsB,GAAG,WAAW,CAAC,sBAE/B,CAAC;AA4EX,wDAAsB;AA1ExB,MAAM,qBAAqB,GAAG,WAAW,CAAC,qBAEa,CAAC;AAkEtD,sDAAqB;AAjEvB,MAAM,wBAAwB,GAAG,WAAW,CAAC,wBAEjC,CAAC;AAsEX,4DAAwB;AApE1B,MAAM,mBAAmB,GAAG,WAAW,CAAC,mBAEe,CAAC;AA4DtD,kDAAmB;AA3DrB,MAAM,sBAAsB,GAAG,WAAW,CAAC,sBAE/B,CAAC;AAgEX,wDAAsB;AA9DxB,MAAM,YAAY,GAAG,WAAW,CAAC,YAEsB,CAAC;AAsDtD,oCAAY;AArDd,MAAM,eAAe,GAAG,WAAW,CAAC,eAExB,CAAC;AA0DX,0CAAe;AAxDjB,MAAM,YAAY,GAAG,WAAW,CAAC,YAEsB,CAAC;AAgDtD,oCAAY;AA/Cd,MAAM,eAAe,GAAG,WAAW,CAAC,eAExB,CAAC;AAoDX,0CAAe;AAlDjB,MAAM,cAAc,GAAG,WAAW,CAAC,cAEL,CAAC;AA0C7B,wCAAc;AAzChB,MAAM,iBAAiB,GAAG,WAAW,CAAC,iBAII,CAAC;AA4CzC,8CAAiB;AA1CnB,MAAM,mBAAmB,GAAG,WAAW,CAAC,mBAEe,CAAC;AA6CtD,kDAAmB;AA5CrB,MAAM,sBAAsB,GAAG,WAAW,CAAC,sBAE/B,CAAC;AAsCX,wDAAsB;AApCxB,MAAM,qBAAqB,GAAG,WAAW,CAAC,qBAEa,CAAC;AAuCtD,sDAAqB;AAtCvB,MAAM,wBAAwB,GAAG,WAAW,CAAC,wBAEjC,CAAC;AAgCX,4DAAwB;AA9B1B,MAAM,mBAAmB,GAAG,WAAW,CAAC,mBAEe,CAAC;AAiCtD,kDAAmB;AAhCrB,MAAM,sBAAsB,GAAG,WAAW,CAAC,sBAE/B,CAAC;AA0BX,wDAAsB;AAxBxB,MAAM,gBAAgB,GAAG,WAAW,CAAC,gBAEkB,CAAC;AA2BtD,4CAAgB;AA1BlB,MAAM,mBAAmB,GAAG,WAAW,CAAC,mBAE5B,CAAC;AAoBX,kDAAmB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts new file mode 100644 index 000000000..750950f58 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts @@ -0,0 +1,18 @@ +import { TSESTree } from '../../ts-estree'; +import * as TSESLint from '../../ts-eslint'; +/** + * Get the variable of a given name. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#findvariable} + */ +declare const findVariable: (initialScope: TSESLint.Scope.Scope, name: string) => TSESLint.Scope.Variable | null; +/** + * Get the innermost scope which contains a given node. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#getinnermostscope} + * @returns The innermost scope which contains the given node. + * If such scope doesn't exist then it returns the 1st argument `initialScope`. + */ +declare const getInnermostScope: (initialScope: TSESLint.Scope.Scope, node: TSESTree.Node) => TSESLint.Scope.Scope; +export { findVariable, getInnermostScope }; +//# sourceMappingURL=scopeAnalysis.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts.map new file mode 100644 index 000000000..19abf1c40 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"scopeAnalysis.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/scopeAnalysis.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C;;;;GAIG;AACH,QAAA,MAAM,YAAY,iBACF,SAAS,KAAK,CAAC,KAAK,QAC5B,MAAM,KACT,SAAS,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;AAEpC;;;;;;GAMG;AACH,QAAA,MAAM,iBAAiB,iBACP,SAAS,KAAK,CAAC,KAAK,QAC5B,SAAS,IAAI,KAChB,SAAS,KAAK,CAAC,KAAK,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/scopeAnalysis.js b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/scopeAnalysis.js new file mode 100644 index 000000000..18c8c6b30 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/scopeAnalysis.js @@ -0,0 +1,40 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getInnermostScope = exports.findVariable = void 0; +const eslintUtils = __importStar(require("eslint-utils")); +/** + * Get the variable of a given name. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#findvariable} + */ +const findVariable = eslintUtils.findVariable; +exports.findVariable = findVariable; +/** + * Get the innermost scope which contains a given node. + * + * @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#getinnermostscope} + * @returns The innermost scope which contains the given node. + * If such scope doesn't exist then it returns the 1st argument `initialScope`. + */ +const getInnermostScope = eslintUtils.getInnermostScope; +exports.getInnermostScope = getInnermostScope; +//# sourceMappingURL=scopeAnalysis.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/scopeAnalysis.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/scopeAnalysis.js.map new file mode 100644 index 000000000..1f966eb47 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/scopeAnalysis.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scopeAnalysis.js","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/scopeAnalysis.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4C;AAI5C;;;;GAIG;AACH,MAAM,YAAY,GAAG,WAAW,CAAC,YAGE,CAAC;AAc3B,oCAAY;AAZrB;;;;;;GAMG;AACH,MAAM,iBAAiB,GAAG,WAAW,CAAC,iBAGb,CAAC;AAEH,8CAAiB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/index.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/index.d.ts new file mode 100644 index 000000000..bd7408efe --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/index.d.ts @@ -0,0 +1,4 @@ +export * from './misc'; +export * from './predicates'; +export * from './eslint-utils'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/index.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/index.d.ts.map new file mode 100644 index 000000000..246226046 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ast-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/index.js b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/index.js new file mode 100644 index 000000000..1f3ae5e2b --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/index.js @@ -0,0 +1,16 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./misc"), exports); +__exportStar(require("./predicates"), exports); +__exportStar(require("./eslint-utils"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/index.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/index.js.map new file mode 100644 index 000000000..df9a52caf --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ast-utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAuB;AACvB,+CAA6B;AAC7B,iDAA+B"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/misc.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/misc.d.ts new file mode 100644 index 000000000..498e01da9 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/misc.d.ts @@ -0,0 +1,8 @@ +import { TSESTree } from '../ts-estree'; +declare const LINEBREAK_MATCHER: RegExp; +/** + * Determines whether two adjacent tokens are on the same line + */ +declare function isTokenOnSameLine(left: TSESTree.Token | TSESTree.Comment, right: TSESTree.Token | TSESTree.Comment): boolean; +export { isTokenOnSameLine, LINEBREAK_MATCHER }; +//# sourceMappingURL=misc.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/misc.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/misc.d.ts.map new file mode 100644 index 000000000..635a9160e --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/misc.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../src/ast-utils/misc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,QAAA,MAAM,iBAAiB,QAA4B,CAAC;AAEpD;;GAEG;AACH,iBAAS,iBAAiB,CACxB,IAAI,EAAE,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,OAAO,EACvC,KAAK,EAAE,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,OAAO,GACvC,OAAO,CAET;AAED,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/misc.js b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/misc.js new file mode 100644 index 000000000..ea03c98e9 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/misc.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LINEBREAK_MATCHER = exports.isTokenOnSameLine = void 0; +const LINEBREAK_MATCHER = /\r\n|[\r\n\u2028\u2029]/; +exports.LINEBREAK_MATCHER = LINEBREAK_MATCHER; +/** + * Determines whether two adjacent tokens are on the same line + */ +function isTokenOnSameLine(left, right) { + return left.loc.end.line === right.loc.start.line; +} +exports.isTokenOnSameLine = isTokenOnSameLine; +//# sourceMappingURL=misc.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/misc.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/misc.js.map new file mode 100644 index 000000000..b1f3f3930 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/misc.js.map @@ -0,0 +1 @@ +{"version":3,"file":"misc.js","sourceRoot":"","sources":["../../src/ast-utils/misc.ts"],"names":[],"mappings":";;;AAEA,MAAM,iBAAiB,GAAG,yBAAyB,CAAC;AAYxB,8CAAiB;AAV7C;;GAEG;AACH,SAAS,iBAAiB,CACxB,IAAuC,EACvC,KAAwC;IAExC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;AACpD,CAAC;AAEQ,8CAAiB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/predicates.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/predicates.d.ts new file mode 100644 index 000000000..3fbd696cd --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/predicates.d.ts @@ -0,0 +1,57 @@ +import { TSESTree } from '../ts-estree'; +declare function isOptionalChainPunctuator(token: TSESTree.Token | TSESTree.Comment): token is TSESTree.PunctuatorToken & { + value: '?.'; +}; +declare function isNotOptionalChainPunctuator(token: TSESTree.Token | TSESTree.Comment): boolean; +declare function isNonNullAssertionPunctuator(token: TSESTree.Token | TSESTree.Comment): token is TSESTree.PunctuatorToken & { + value: '!'; +}; +declare function isNotNonNullAssertionPunctuator(token: TSESTree.Token | TSESTree.Comment): boolean; +/** + * Returns true if and only if the node represents: foo?.() or foo.bar?.() + */ +declare function isOptionalCallExpression(node: TSESTree.Node): node is TSESTree.CallExpression & { + optional: true; +}; +/** + * Returns true if and only if the node represents logical OR + */ +declare function isLogicalOrOperator(node: TSESTree.Node): node is TSESTree.LogicalExpression & { + operator: '||'; +}; +/** + * Checks if a node is a type assertion: + * ``` + * x as foo + * x + * ``` + */ +declare function isTypeAssertion(node: TSESTree.Node | undefined | null): node is TSESTree.TSAsExpression | TSESTree.TSTypeAssertion; +declare function isVariableDeclarator(node: TSESTree.Node | undefined): node is TSESTree.VariableDeclarator; +declare function isFunction(node: TSESTree.Node | undefined): node is TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression; +declare function isFunctionType(node: TSESTree.Node | undefined): node is TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructorType | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSFunctionType | TSESTree.TSMethodSignature; +declare function isFunctionOrFunctionType(node: TSESTree.Node | undefined): node is TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructorType | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSFunctionType | TSESTree.TSMethodSignature; +declare function isTSFunctionType(node: TSESTree.Node | undefined): node is TSESTree.TSFunctionType; +declare function isTSConstructorType(node: TSESTree.Node | undefined): node is TSESTree.TSConstructorType; +declare function isClassOrTypeElement(node: TSESTree.Node | undefined): node is TSESTree.ClassElement | TSESTree.TypeElement; +/** + * Checks if a node is a constructor method. + */ +declare function isConstructor(node: TSESTree.Node | undefined): node is TSESTree.MethodDefinition; +/** + * Checks if a node is a setter method. + */ +declare function isSetter(node: TSESTree.Node | undefined): node is TSESTree.MethodDefinition | TSESTree.Property; +declare function isIdentifier(node: TSESTree.Node | undefined): node is TSESTree.Identifier; +/** + * Checks if a node represents an `await …` expression. + */ +declare function isAwaitExpression(node: TSESTree.Node | undefined | null): node is TSESTree.AwaitExpression; +/** + * Checks if a possible token is the `await` keyword. + */ +declare function isAwaitKeyword(node: TSESTree.Token | TSESTree.Comment | undefined | null): node is TSESTree.KeywordToken & { + value: 'await'; +}; +export { isAwaitExpression, isAwaitKeyword, isConstructor, isClassOrTypeElement, isFunction, isFunctionOrFunctionType, isFunctionType, isIdentifier, isLogicalOrOperator, isNonNullAssertionPunctuator, isNotNonNullAssertionPunctuator, isNotOptionalChainPunctuator, isOptionalChainPunctuator, isOptionalCallExpression, isSetter, isTSConstructorType, isTSFunctionType, isTypeAssertion, isVariableDeclarator, }; +//# sourceMappingURL=predicates.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/predicates.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/predicates.d.ts.map new file mode 100644 index 000000000..237c92e03 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/predicates.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"predicates.d.ts","sourceRoot":"","sources":["../../src/ast-utils/predicates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEzE,iBAAS,yBAAyB,CAChC,KAAK,EAAE,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,OAAO,GACvC,KAAK,IAAI,QAAQ,CAAC,eAAe,GAAG;IAAE,KAAK,EAAE,IAAI,CAAA;CAAE,CAErD;AACD,iBAAS,4BAA4B,CACnC,KAAK,EAAE,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,OAAO,GACvC,OAAO,CAET;AAED,iBAAS,4BAA4B,CACnC,KAAK,EAAE,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,OAAO,GACvC,KAAK,IAAI,QAAQ,CAAC,eAAe,GAAG;IAAE,KAAK,EAAE,GAAG,CAAA;CAAE,CAEpD;AACD,iBAAS,+BAA+B,CACtC,KAAK,EAAE,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,OAAO,GACvC,OAAO,CAET;AAED;;GAEG;AACH,iBAAS,wBAAwB,CAC/B,IAAI,EAAE,QAAQ,CAAC,IAAI,GAClB,IAAI,IAAI,QAAQ,CAAC,cAAc,GAAG;IAAE,QAAQ,EAAE,IAAI,CAAA;CAAE,CAOtD;AAED;;GAEG;AACH,iBAAS,mBAAmB,CAC1B,IAAI,EAAE,QAAQ,CAAC,IAAI,GAClB,IAAI,IAAI,QAAQ,CAAC,iBAAiB,GAAG;IAAE,QAAQ,EAAE,IAAI,CAAA;CAAE,CAIzD;AAED;;;;;;GAMG;AACH,iBAAS,eAAe,CACtB,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,SAAS,GAAG,IAAI,GACrC,IAAI,IAAI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G,SAAS,GAC9B,IAAI,IAAI,QAAQ,CAAC,YAAY,GAAG,QAAQ,CAAC,WAAW,CAqBtD;AAED;;GAEG;AACH,iBAAS,aAAa,CACpB,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,SAAS,GAC9B,IAAI,IAAI,QAAQ,CAAC,gBAAgB,CAKnC;AAED;;GAEG;AACH,iBAAS,QAAQ,CACf,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,SAAS,GAC9B,IAAI,IAAI,QAAQ,CAAC,gBAAgB,GAAG,QAAQ,CAAC,QAAQ,CAOvD;AAED,iBAAS,YAAY,CACnB,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,SAAS,GAC9B,IAAI,IAAI,QAAQ,CAAC,UAAU,CAE7B;AAED;;GAEG;AACH,iBAAS,iBAAiB,CACxB,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,SAAS,GAAG,IAAI,GACrC,IAAI,IAAI,QAAQ,CAAC,eAAe,CAElC;AAED;;GAEG;AACH,iBAAS,cAAc,CACrB,IAAI,EAAE,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,OAAO,GAAG,SAAS,GAAG,IAAI,GACzD,IAAI,IAAI,QAAQ,CAAC,YAAY,GAAG;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,CAEpD;AAED,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,UAAU,EACV,wBAAwB,EACxB,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,4BAA4B,EAC5B,+BAA+B,EAC/B,4BAA4B,EAC5B,yBAAyB,EACzB,wBAAwB,EACxB,QAAQ,EACR,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,GACrB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/predicates.js b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/predicates.js new file mode 100644 index 000000000..007d6047b --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/predicates.js @@ -0,0 +1,152 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isVariableDeclarator = exports.isTypeAssertion = exports.isTSFunctionType = exports.isTSConstructorType = exports.isSetter = exports.isOptionalCallExpression = exports.isOptionalChainPunctuator = exports.isNotOptionalChainPunctuator = exports.isNotNonNullAssertionPunctuator = exports.isNonNullAssertionPunctuator = exports.isLogicalOrOperator = exports.isIdentifier = exports.isFunctionType = exports.isFunctionOrFunctionType = exports.isFunction = exports.isClassOrTypeElement = exports.isConstructor = exports.isAwaitKeyword = exports.isAwaitExpression = void 0; +const ts_estree_1 = require("../ts-estree"); +function isOptionalChainPunctuator(token) { + return token.type === ts_estree_1.AST_TOKEN_TYPES.Punctuator && token.value === '?.'; +} +exports.isOptionalChainPunctuator = isOptionalChainPunctuator; +function isNotOptionalChainPunctuator(token) { + return !isOptionalChainPunctuator(token); +} +exports.isNotOptionalChainPunctuator = isNotOptionalChainPunctuator; +function isNonNullAssertionPunctuator(token) { + return token.type === ts_estree_1.AST_TOKEN_TYPES.Punctuator && token.value === '!'; +} +exports.isNonNullAssertionPunctuator = isNonNullAssertionPunctuator; +function isNotNonNullAssertionPunctuator(token) { + return !isNonNullAssertionPunctuator(token); +} +exports.isNotNonNullAssertionPunctuator = isNotNonNullAssertionPunctuator; +/** + * Returns true if and only if the node represents: foo?.() or foo.bar?.() + */ +function isOptionalCallExpression(node) { + return (node.type === ts_estree_1.AST_NODE_TYPES.CallExpression && + // this flag means the call expression itself is option + // i.e. it is foo.bar?.() and not foo?.bar() + node.optional); +} +exports.isOptionalCallExpression = isOptionalCallExpression; +/** + * Returns true if and only if the node represents logical OR + */ +function isLogicalOrOperator(node) { + return (node.type === ts_estree_1.AST_NODE_TYPES.LogicalExpression && node.operator === '||'); +} +exports.isLogicalOrOperator = isLogicalOrOperator; +/** + * Checks if a node is a type assertion: + * ``` + * x as foo + * x + * ``` + */ +function isTypeAssertion(node) { + if (!node) { + return false; + } + return (node.type === ts_estree_1.AST_NODE_TYPES.TSAsExpression || + node.type === ts_estree_1.AST_NODE_TYPES.TSTypeAssertion); +} +exports.isTypeAssertion = isTypeAssertion; +function isVariableDeclarator(node) { + return (node === null || node === void 0 ? void 0 : node.type) === ts_estree_1.AST_NODE_TYPES.VariableDeclarator; +} +exports.isVariableDeclarator = isVariableDeclarator; +function isFunction(node) { + if (!node) { + return false; + } + return [ + ts_estree_1.AST_NODE_TYPES.ArrowFunctionExpression, + ts_estree_1.AST_NODE_TYPES.FunctionDeclaration, + ts_estree_1.AST_NODE_TYPES.FunctionExpression, + ].includes(node.type); +} +exports.isFunction = isFunction; +function isFunctionType(node) { + if (!node) { + return false; + } + return [ + ts_estree_1.AST_NODE_TYPES.TSCallSignatureDeclaration, + ts_estree_1.AST_NODE_TYPES.TSConstructorType, + ts_estree_1.AST_NODE_TYPES.TSConstructSignatureDeclaration, + ts_estree_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression, + ts_estree_1.AST_NODE_TYPES.TSFunctionType, + ts_estree_1.AST_NODE_TYPES.TSMethodSignature, + ].includes(node.type); +} +exports.isFunctionType = isFunctionType; +function isFunctionOrFunctionType(node) { + return isFunction(node) || isFunctionType(node); +} +exports.isFunctionOrFunctionType = isFunctionOrFunctionType; +function isTSFunctionType(node) { + return (node === null || node === void 0 ? void 0 : node.type) === ts_estree_1.AST_NODE_TYPES.TSFunctionType; +} +exports.isTSFunctionType = isTSFunctionType; +function isTSConstructorType(node) { + return (node === null || node === void 0 ? void 0 : node.type) === ts_estree_1.AST_NODE_TYPES.TSConstructorType; +} +exports.isTSConstructorType = isTSConstructorType; +function isClassOrTypeElement(node) { + if (!node) { + return false; + } + return [ + // ClassElement + ts_estree_1.AST_NODE_TYPES.ClassProperty, + ts_estree_1.AST_NODE_TYPES.FunctionExpression, + ts_estree_1.AST_NODE_TYPES.MethodDefinition, + ts_estree_1.AST_NODE_TYPES.TSAbstractClassProperty, + ts_estree_1.AST_NODE_TYPES.TSAbstractMethodDefinition, + ts_estree_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression, + ts_estree_1.AST_NODE_TYPES.TSIndexSignature, + // TypeElement + ts_estree_1.AST_NODE_TYPES.TSCallSignatureDeclaration, + ts_estree_1.AST_NODE_TYPES.TSConstructSignatureDeclaration, + // AST_NODE_TYPES.TSIndexSignature, + ts_estree_1.AST_NODE_TYPES.TSMethodSignature, + ts_estree_1.AST_NODE_TYPES.TSPropertySignature, + ].includes(node.type); +} +exports.isClassOrTypeElement = isClassOrTypeElement; +/** + * Checks if a node is a constructor method. + */ +function isConstructor(node) { + return ((node === null || node === void 0 ? void 0 : node.type) === ts_estree_1.AST_NODE_TYPES.MethodDefinition && + node.kind === 'constructor'); +} +exports.isConstructor = isConstructor; +/** + * Checks if a node is a setter method. + */ +function isSetter(node) { + return (!!node && + (node.type === ts_estree_1.AST_NODE_TYPES.MethodDefinition || + node.type === ts_estree_1.AST_NODE_TYPES.Property) && + node.kind === 'set'); +} +exports.isSetter = isSetter; +function isIdentifier(node) { + return (node === null || node === void 0 ? void 0 : node.type) === ts_estree_1.AST_NODE_TYPES.Identifier; +} +exports.isIdentifier = isIdentifier; +/** + * Checks if a node represents an `await …` expression. + */ +function isAwaitExpression(node) { + return (node === null || node === void 0 ? void 0 : node.type) === ts_estree_1.AST_NODE_TYPES.AwaitExpression; +} +exports.isAwaitExpression = isAwaitExpression; +/** + * Checks if a possible token is the `await` keyword. + */ +function isAwaitKeyword(node) { + return (node === null || node === void 0 ? void 0 : node.type) === ts_estree_1.AST_TOKEN_TYPES.Identifier && node.value === 'await'; +} +exports.isAwaitKeyword = isAwaitKeyword; +//# sourceMappingURL=predicates.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/predicates.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/predicates.js.map new file mode 100644 index 000000000..555abb708 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/predicates.js.map @@ -0,0 +1 @@ +{"version":3,"file":"predicates.js","sourceRoot":"","sources":["../../src/ast-utils/predicates.ts"],"names":[],"mappings":";;;AAAA,4CAAyE;AAEzE,SAAS,yBAAyB,CAChC,KAAwC;IAExC,OAAO,KAAK,CAAC,IAAI,KAAK,2BAAe,CAAC,UAAU,IAAI,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC;AAC3E,CAAC;AA+NC,8DAAyB;AA9N3B,SAAS,4BAA4B,CACnC,KAAwC;IAExC,OAAO,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC;AAC3C,CAAC;AAyNC,oEAA4B;AAvN9B,SAAS,4BAA4B,CACnC,KAAwC;IAExC,OAAO,KAAK,CAAC,IAAI,KAAK,2BAAe,CAAC,UAAU,IAAI,KAAK,CAAC,KAAK,KAAK,GAAG,CAAC;AAC1E,CAAC;AAiNC,oEAA4B;AAhN9B,SAAS,+BAA+B,CACtC,KAAwC;IAExC,OAAO,CAAC,4BAA4B,CAAC,KAAK,CAAC,CAAC;AAC9C,CAAC;AA6MC,0EAA+B;AA3MjC;;GAEG;AACH,SAAS,wBAAwB,CAC/B,IAAmB;IAEnB,OAAO,CACL,IAAI,CAAC,IAAI,KAAK,0BAAc,CAAC,cAAc;QAC3C,uDAAuD;QACvD,4CAA4C;QAC5C,IAAI,CAAC,QAAQ,CACd,CAAC;AACJ,CAAC;AAkMC,4DAAwB;AAhM1B;;GAEG;AACH,SAAS,mBAAmB,CAC1B,IAAmB;IAEnB,OAAO,CACL,IAAI,CAAC,IAAI,KAAK,0BAAc,CAAC,iBAAiB,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CACzE,CAAC;AACJ,CAAC;AAkLC,kDAAmB;AAhLrB;;;;;;GAMG;AACH,SAAS,eAAe,CACtB,IAAsC;IAEtC,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,KAAK,CAAC;KACd;IACD,OAAO,CACL,IAAI,CAAC,IAAI,KAAK,0B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AAE,IAAI,MAAK,0BAAc,CAAC,UAAU,CAAC;AAClD,CAAC;AA4BC,oCAAY;AA1Bd;;GAEG;AACH,SAAS,iBAAiB,CACxB,IAAsC;IAEtC,OAAO,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,MAAK,0BAAc,CAAC,eAAe,CAAC;AACvD,CAAC;AAYC,8CAAiB;AAVnB;;GAEG;AACH,SAAS,cAAc,CACrB,IAA0D;IAE1D,OAAO,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,MAAK,2BAAe,CAAC,UAAU,IAAI,IAAI,CAAC,KAAK,KAAK,OAAO,CAAC;AAC7E,CAAC;AAIC,wCAAc"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/InferTypesFromRule.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/InferTypesFromRule.d.ts new file mode 100644 index 000000000..2074ddc39 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/InferTypesFromRule.d.ts @@ -0,0 +1,12 @@ +import { RuleModule } from '../ts-eslint'; +declare type InferOptionsTypeFromRuleNever = T extends RuleModule ? TOptions : unknown; +/** + * Uses type inference to fetch the TOptions type from the given RuleModule + */ +declare type InferOptionsTypeFromRule = T extends RuleModule ? TOptions : InferOptionsTypeFromRuleNever; +/** + * Uses type inference to fetch the TMessageIds type from the given RuleModule + */ +declare type InferMessageIdsTypeFromRule = T extends RuleModule ? TMessageIds : unknown; +export { InferOptionsTypeFromRule, InferMessageIdsTypeFromRule }; +//# sourceMappingURL=InferTypesFromRule.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/InferTypesFromRule.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/InferTypesFromRule.d.ts.map new file mode 100644 index 000000000..0d6570b23 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/InferTypesFromRule.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"InferTypesFromRule.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/InferTypesFromRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,aAAK,6BAA6B,CAAC,CAAC,IAAI,CAAC,SAAS,UAAU,CAC1D,KAAK,EACL,MAAM,QAAQ,CACf,GACG,QAAQ,GACR,OAAO,CAAC;AACZ;;GAEG;AACH,aAAK,wBAAwB,CAAC,CAAC,IAAI,CAAC,SAAS,UAAU,CAAC,MAAM,EAAE,MAAM,QAAQ,CAAC,GAC3E,QAAQ,GACR,6BAA6B,CAAC,CAAC,CAAC,CAAC;AAErC;;GAEG;AACH,aAAK,2BAA2B,CAAC,CAAC,IAAI,CAAC,SAAS,UAAU,CACxD,MAAM,WAAW,EACjB,OAAO,EAAE,CACV,GACG,WAAW,GACX,OAAO,CAAC;AAEZ,OAAO,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/InferTypesFromRule.js b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/InferTypesFromRule.js new file mode 100644 index 000000000..9305805b4 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/InferTypesFromRule.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=InferTypesFromRule.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/InferTypesFromRule.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/InferTypesFromRule.js.map new file mode 100644 index 000000000..99fe846c4 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/InferTypesFromRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"InferTypesFromRule.js","sourceRoot":"","sources":["../../src/eslint-utils/InferTypesFromRule.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleCreator.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleCreator.d.ts new file mode 100644 index 000000000..565a6a9d7 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleCreator.d.ts @@ -0,0 +1,13 @@ +import { RuleMetaData, RuleMetaDataDocs, RuleListener, RuleContext, RuleModule } from '../ts-eslint/Rule'; +declare type CreateRuleMetaDocs = Omit; +declare type CreateRuleMeta = { + docs: CreateRuleMetaDocs; +} & Omit, 'docs'>; +declare function RuleCreator(urlCreator: (ruleName: string) => string): ({ name, meta, defaultOptions, create, }: Readonly<{ + name: string; + meta: CreateRuleMeta; + defaultOptions: Readonly; + create: (context: Readonly>, optionsWithDefault: Readonly) => TRuleListener; +}>) => RuleModule; +export { RuleCreator }; +//# sourceMappingURL=RuleCreator.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleCreator.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleCreator.d.ts.map new file mode 100644 index 000000000..2d86f2a58 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleCreator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RuleCreator.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/RuleCreator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,UAAU,EACX,MAAM,mBAAmB,CAAC;AAI3B,aAAK,kBAAkB,GAAG,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;AACxD,aAAK,cAAc,CAAC,WAAW,SAAS,MAAM,IAAI;IAChD,IAAI,EAAE,kBAAkB,CAAC;CAC1B,GAAG,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC;AAE5C,iBAAS,WAAW,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM;UAanD,MAAM;;;;wDA2Bf;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleCreator.js b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleCreator.js new file mode 100644 index 000000000..cba8ed64e --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleCreator.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RuleCreator = void 0; +const applyDefault_1 = require("./applyDefault"); +function RuleCreator(urlCreator) { + // This function will get much easier to call when this is merged https://github.com/Microsoft/TypeScript/pull/26349 + // TODO - when the above PR lands; add type checking for the context.report `data` property + return function createRule({ name, meta, defaultOptions, create, }) { + return { + meta: Object.assign(Object.assign({}, meta), { docs: Object.assign(Object.assign({}, meta.docs), { url: urlCreator(name) }) }), + create(context) { + const optionsWithDefault = applyDefault_1.applyDefault(defaultOptions, context.options); + return create(context, optionsWithDefault); + }, + }; + }; +} +exports.RuleCreator = RuleCreator; +//# sourceMappingURL=RuleCreator.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleCreator.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleCreator.js.map new file mode 100644 index 000000000..cea4eb08c --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleCreator.js.map @@ -0,0 +1 @@ +{"version":3,"file":"RuleCreator.js","sourceRoot":"","sources":["../../src/eslint-utils/RuleCreator.ts"],"names":[],"mappings":";;;AAOA,iDAA8C;AAQ9C,SAAS,WAAW,CAAC,UAAwC;IAC3D,oHAAoH;IACpH,2FAA2F;IAC3F,OAAO,SAAS,UAAU,CAIxB,EACA,IAAI,EACJ,IAAI,EACJ,cAAc,EACd,MAAM,GASN;QACA,OAAO;YACL,IAAI,kCACC,IAAI,KACP,IAAI,kCACC,IAAI,CAAC,IAAI,KACZ,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC,MAExB;YACD,MAAM,CACJ,OAAqD;gBAErD,MAAM,kBAAkB,GAAG,2BAAY,CACrC,cAAc,EACd,OAAO,CAAC,OAAO,CAChB,CAAC;gBACF,OAAO,MAAM,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;YAC7C,CAAC;SACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAEQ,kCAAW"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleTester.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleTester.d.ts new file mode 100644 index 000000000..82d3f731b --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleTester.d.ts @@ -0,0 +1,18 @@ +import * as TSESLint from '../ts-eslint'; +declare const parser = "@typescript-eslint/parser"; +declare type RuleTesterConfig = Omit & { + parser: typeof parser; +}; +declare class RuleTester extends TSESLint.RuleTester { + #private; + constructor(options: RuleTesterConfig); + private getFilename; + run>(name: string, rule: TSESLint.RuleModule, testsReadonly: TSESLint.RunTests): void; +} +/** + * Simple no-op tag to mark code samples as "should not format with prettier" + * for the internal/plugin-test-formatting lint rule + */ +declare function noFormat(strings: TemplateStringsArray, ...keys: string[]): string; +export { noFormat, RuleTester }; +//# sourceMappingURL=RuleTester.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleTester.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleTester.d.ts.map new file mode 100644 index 000000000..26af05f3e --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleTester.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RuleTester.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/RuleTester.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,cAAc,CAAC;AAEzC,QAAA,MAAM,MAAM,8BAA8B,CAAC;AAE3C,aAAK,gBAAgB,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,QAAQ,CAAC,GAAG;IAClE,MAAM,EAAE,OAAO,MAAM,CAAC;CACvB,CAAC;AAEF,cAAM,UAAW,SAAQ,QAAQ,CAAC,UAAU;;gBAM9B,OAAO,EAAE,gBAAgB;IAyBrC,OAAO,CAAC,WAAW;IAuBnB,GAAG,CAAC,WAAW,SAAS,MAAM,EAAE,QAAQ,SAAS,QAAQ,CAAC,OAAO,EAAE,CAAC,EAClE,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,WAAW,EAAE,QAAQ,CAAC,EAChD,aAAa,EAAE,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,GACtD,IAAI;CA4CR;AAED;;;GAGG;AACH,iBAAS,QAAQ,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAM1E;AAED,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleTester.js b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleTester.js new file mode 100644 index 000000000..348238a1d --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleTester.js @@ -0,0 +1,128 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; +}; +var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); +}; +var _options; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RuleTester = exports.noFormat = void 0; +const path = __importStar(require("path")); +const TSESLint = __importStar(require("../ts-eslint")); +const parser = '@typescript-eslint/parser'; +class RuleTester extends TSESLint.RuleTester { + // as of eslint 6 you have to provide an absolute path to the parser + // but that's not as clean to type, this saves us trying to manually enforce + // that contributors require.resolve everything + constructor(options) { + var _a, _b; + super(Object.assign(Object.assign({}, options), { parserOptions: Object.assign(Object.assign({}, options.parserOptions), { warnOnUnsupportedTypeScriptVersion: (_b = (_a = options.parserOptions) === null || _a === void 0 ? void 0 : _a.warnOnUnsupportedTypeScriptVersion) !== null && _b !== void 0 ? _b : false }), parser: require.resolve(options.parser) })); + _options.set(this, void 0); + __classPrivateFieldSet(this, _options, options); + // make sure that the parser doesn't hold onto file handles between tests + // on linux (i.e. our CI env), there can be very a limited number of watch handles available + afterAll(() => { + try { + // instead of creating a hard dependency, just use a soft require + // a bit weird, but if they're using this tooling, it'll be installed + require(parser).clearCaches(); + } + catch (_a) { + // ignored + } + }); + } + getFilename(options) { + var _a; + if (options) { + const filename = `file.ts${((_a = options.ecmaFeatures) === null || _a === void 0 ? void 0 : _a.jsx) ? 'x' : ''}`; + if (options.project) { + return path.join(options.tsconfigRootDir != null + ? options.tsconfigRootDir + : process.cwd(), filename); + } + return filename; + } + else if (__classPrivateFieldGet(this, _options).parserOptions) { + return this.getFilename(__classPrivateFieldGet(this, _options).parserOptions); + } + return 'file.ts'; + } + // as of eslint 6 you have to provide an absolute path to the parser + // If you don't do that at the test level, the test will fail somewhat cryptically... + // This is a lot more explicit + run(name, rule, testsReadonly) { + const errorMessage = `Do not set the parser at the test level unless you want to use a parser other than ${parser}`; + const tests = Object.assign({}, testsReadonly); + // standardize the valid tests as objects + tests.valid = tests.valid.map(test => { + if (typeof test === 'string') { + return { + code: test, + }; + } + return test; + }); + tests.valid = tests.valid.map(test => { + if (typeof test !== 'string') { + if (test.parser === parser) { + throw new Error(errorMessage); + } + if (!test.filename) { + return Object.assign(Object.assign({}, test), { filename: this.getFilename(test.parserOptions) }); + } + } + return test; + }); + tests.invalid = tests.invalid.map(test => { + if (test.parser === parser) { + throw new Error(errorMessage); + } + if (!test.filename) { + return Object.assign(Object.assign({}, test), { filename: this.getFilename(test.parserOptions) }); + } + return test; + }); + super.run(name, rule, tests); + } +} +exports.RuleTester = RuleTester; +_options = new WeakMap(); +/** + * Simple no-op tag to mark code samples as "should not format with prettier" + * for the internal/plugin-test-formatting lint rule + */ +function noFormat(strings, ...keys) { + const lastIndex = strings.length - 1; + return (strings.slice(0, lastIndex).reduce((p, s, i) => p + s + keys[i], '') + + strings[lastIndex]); +} +exports.noFormat = noFormat; +//# sourceMappingURL=RuleTester.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleTester.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleTester.js.map new file mode 100644 index 000000000..bff9ff199 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleTester.js.map @@ -0,0 +1 @@ +{"version":3,"file":"RuleTester.js","sourceRoot":"","sources":["../../src/eslint-utils/RuleTester.ts"],"names":[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ACH;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC;CACF;AAckB,gCAAU;;AAZ7B;;;GAGG;AACH,SAAS,QAAQ,CAAC,OAA6B,EAAE,GAAG,IAAc;IAChE,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IACrC,OAAO,CACL,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QACpE,OAAO,CAAC,SAAS,CAAC,CACnB,CAAC;AACJ,CAAC;AAEQ,4BAAQ"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/applyDefault.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/applyDefault.d.ts new file mode 100644 index 000000000..b92df58f5 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/applyDefault.d.ts @@ -0,0 +1,10 @@ +/** + * Pure function - doesn't mutate either parameter! + * Uses the default options and overrides with the options provided by the user + * @param defaultOptions the defaults + * @param userOptions the user opts + * @returns the options with defaults + */ +declare function applyDefault(defaultOptions: TDefault, userOptions: TUser | null): TDefault; +export { applyDefault }; +//# sourceMappingURL=applyDefault.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/applyDefault.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/applyDefault.d.ts.map new file mode 100644 index 000000000..50c710ed4 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/applyDefault.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"applyDefault.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/applyDefault.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,iBAAS,YAAY,CAAC,KAAK,SAAS,SAAS,OAAO,EAAE,EAAE,QAAQ,SAAS,KAAK,EAC5E,cAAc,EAAE,QAAQ,EACxB,WAAW,EAAE,KAAK,GAAG,IAAI,GACxB,QAAQ,CAuBV;AAMD,OAAO,EAAE,YAAY,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/applyDefault.js b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/applyDefault.js new file mode 100644 index 000000000..6ae1a7954 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/applyDefault.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.applyDefault = void 0; +const deepMerge_1 = require("./deepMerge"); +/** + * Pure function - doesn't mutate either parameter! + * Uses the default options and overrides with the options provided by the user + * @param defaultOptions the defaults + * @param userOptions the user opts + * @returns the options with defaults + */ +function applyDefault(defaultOptions, userOptions) { + // clone defaults + const options = JSON.parse(JSON.stringify(defaultOptions)); + if (userOptions === null || userOptions === undefined) { + return options; + } + options.forEach((opt, i) => { + if (userOptions[i] !== undefined) { + const userOpt = userOptions[i]; + if (deepMerge_1.isObjectNotArray(userOpt) && deepMerge_1.isObjectNotArray(opt)) { + options[i] = deepMerge_1.deepMerge(opt, userOpt); + } + else { + options[i] = userOpt; + } + } + }); + return options; +} +exports.applyDefault = applyDefault; +//# sourceMappingURL=applyDefault.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/applyDefault.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/applyDefault.js.map new file mode 100644 index 000000000..797a3b509 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/applyDefault.js.map @@ -0,0 +1 @@ +{"version":3,"file":"applyDefault.js","sourceRoot":"","sources":["../../src/eslint-utils/applyDefault.ts"],"names":[],"mappings":";;;AAAA,2CAA0D;AAE1D;;;;;;GAMG;AACH,SAAS,YAAY,CACnB,cAAwB,EACxB,WAAyB;IAEzB,iBAAiB;IACjB,MAAM,OAAO,GAAwB,IAAI,CAAC,KAAK,CAC7C,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAC/B,CAAC;IAEF,IAAI,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,SAAS,EAAE;QACrD,OAAO,OAAO,CAAC;KAChB;IAED,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;QACzB,IAAI,WAAW,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE;YAChC,MAAM,OAAO,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;YAE/B,IAAI,4BAAgB,CAAC,OAAO,CAAC,IAAI,4BAAgB,CAAC,GAAG,CAAC,EAAE;gBACtD,OAAO,CAAC,CAAC,CAAC,GAAG,qBAAS,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;aACtC;iBAAM;gBACL,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;aACtB;SACF;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC;AAMQ,oCAAY"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/batchedSingleLineTests.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/batchedSingleLineTests.d.ts new file mode 100644 index 000000000..341180255 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/batchedSingleLineTests.d.ts @@ -0,0 +1,24 @@ +import { ValidTestCase, InvalidTestCase } from '../ts-eslint'; +/** + * Converts a batch of single line tests into a number of separate test cases. + * This makes it easier to write tests which use the same options. + * + * Why wouldn't you just leave them as one test? + * Because it makes the test error messages harder to decipher. + * This way each line will fail separately, instead of them all failing together. + */ +declare function batchedSingleLineTests>(test: ValidTestCase): ValidTestCase[]; +/** + * Converts a batch of single line tests into a number of separate test cases. + * This makes it easier to write tests which use the same options. + * + * Why wouldn't you just leave them as one test? + * Because it makes the test error messages harder to decipher. + * This way each line will fail separately, instead of them all failing together. + * + * Make sure you have your line numbers correct for error reporting, as it will match + * the line numbers up with the split tests! + */ +declare function batchedSingleLineTests>(test: InvalidTestCase): InvalidTestCase[]; +export { batchedSingleLineTests }; +//# sourceMappingURL=batchedSingleLineTests.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/batchedSingleLineTests.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/batchedSingleLineTests.d.ts.map new file mode 100644 index 000000000..55841a1eb --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/batchedSingleLineTests.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"batchedSingleLineTests.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/batchedSingleLineTests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE9D;;;;;;;GAOG;AACH,iBAAS,sBAAsB,CAAC,QAAQ,SAAS,QAAQ,CAAC,OAAO,EAAE,CAAC,EAClE,IAAI,EAAE,aAAa,CAAC,QAAQ,CAAC,GAC5B,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC;AAC7B;;;;;;;;;;GAUG;AACH,iBAAS,sBAAsB,CAC7B,WAAW,SAAS,MAAM,EAC1B,QAAQ,SAAS,QAAQ,CAAC,OAAO,EAAE,CAAC,EAEpC,IAAI,EAAE,eAAe,CAAC,WAAW,EAAE,QAAQ,CAAC,GAC3C,eAAe,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,CAAC;AAwC5C,OAAO,EAAE,sBAAsB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/batchedSingleLineTests.js b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/batchedSingleLineTests.js new file mode 100644 index 000000000..7ff93904e --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/batchedSingleLineTests.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.batchedSingleLineTests = void 0; +function batchedSingleLineTests(options) { + // eslint counts lines from 1 + const lineOffset = options.code.startsWith('\n') ? 2 : 1; + const output = 'output' in options && options.output + ? options.output.trim().split('\n') + : null; + return options.code + .trim() + .split('\n') + .map((code, i) => { + const lineNum = i + lineOffset; + const errors = 'errors' in options + ? options.errors.filter(e => e.line === lineNum) + : []; + const returnVal = Object.assign(Object.assign({}, options), { code, errors: errors.map(e => (Object.assign(Object.assign({}, e), { line: 1 }))) }); + if (output === null || output === void 0 ? void 0 : output[i]) { + return Object.assign(Object.assign({}, returnVal), { output: output[i] }); + } + return returnVal; + }); +} +exports.batchedSingleLineTests = batchedSingleLineTests; +//# sourceMappingURL=batchedSingleLineTests.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/batchedSingleLineTests.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/batchedSingleLineTests.js.map new file mode 100644 index 000000000..31f68d688 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/batchedSingleLineTests.js.map @@ -0,0 +1 @@ +{"version":3,"file":"batchedSingleLineTests.js","sourceRoot":"","sources":["../../src/eslint-utils/batchedSingleLineTests.ts"],"names":[],"mappings":";;;AA8BA,SAAS,sBAAsB,CAI7B,OAAyE;IAEzE,6BAA6B;IAC7B,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACzD,MAAM,MAAM,GACV,QAAQ,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM;QACnC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;QACnC,CAAC,CAAC,IAAI,CAAC;IACX,OAAO,OAAO,CAAC,IAAI;SAChB,IAAI,EAAE;SACN,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;QACf,MAAM,OAAO,GAAG,CAAC,GAAG,UAAU,CAAC;QAC/B,MAAM,MAAM,GACV,QAAQ,IAAI,OAAO;YACjB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC;YAChD,CAAC,CAAC,EAAE,CAAC;QACT,MAAM,SAAS,mCACV,OAAO,KACV,IAAI,EACJ,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,iCACnB,CAAC,KACJ,IAAI,EAAE,CAAC,IACP,CAAC,GACJ,CAAC;QACF,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAG,CAAC,GAAG;YACf,uCACK,SAAS,KACZ,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,IACjB;SACH;QACD,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC,CAAC;AACP,CAAC;AAEQ,wDAAsB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/deepMerge.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/deepMerge.d.ts new file mode 100644 index 000000000..9650020aa --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/deepMerge.d.ts @@ -0,0 +1,17 @@ +declare type ObjectLike = Record; +/** + * Check if the variable contains an object strictly rejecting arrays + * @param obj an object + * @returns `true` if obj is an object + */ +declare function isObjectNotArray(obj: unknown | unknown[]): obj is T; +/** + * Pure function - doesn't mutate either parameter! + * Merges two objects together deeply, overwriting the properties in first with the properties in second + * @param first The first object + * @param second The second object + * @returns a new object + */ +export declare function deepMerge(first?: ObjectLike, second?: ObjectLike): Record; +export { isObjectNotArray }; +//# sourceMappingURL=deepMerge.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/deepMerge.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/deepMerge.d.ts.map new file mode 100644 index 000000000..769f39c19 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/deepMerge.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"deepMerge.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/deepMerge.ts"],"names":[],"mappings":"AAAA,aAAK,UAAU,CAAC,CAAC,GAAG,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAEjD;;;;GAIG;AACH,iBAAS,gBAAgB,CAAC,CAAC,SAAS,UAAU,EAC5C,GAAG,EAAE,OAAO,GAAG,OAAO,EAAE,GACvB,GAAG,IAAI,CAAC,CAEV;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,KAAK,GAAE,UAAe,EACtB,MAAM,GAAE,UAAe,GACtB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA0BzB;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/deepMerge.js b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/deepMerge.js new file mode 100644 index 000000000..34fdffc5f --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/deepMerge.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isObjectNotArray = exports.deepMerge = void 0; +/** + * Check if the variable contains an object strictly rejecting arrays + * @param obj an object + * @returns `true` if obj is an object + */ +function isObjectNotArray(obj) { + return typeof obj === 'object' && !Array.isArray(obj); +} +exports.isObjectNotArray = isObjectNotArray; +/** + * Pure function - doesn't mutate either parameter! + * Merges two objects together deeply, overwriting the properties in first with the properties in second + * @param first The first object + * @param second The second object + * @returns a new object + */ +function deepMerge(first = {}, second = {}) { + // get the unique set of keys across both objects + const keys = new Set(Object.keys(first).concat(Object.keys(second))); + return Array.from(keys).reduce((acc, key) => { + const firstHasKey = key in first; + const secondHasKey = key in second; + const firstValue = first[key]; + const secondValue = second[key]; + if (firstHasKey && secondHasKey) { + if (isObjectNotArray(firstValue) && isObjectNotArray(secondValue)) { + // object type + acc[key] = deepMerge(firstValue, secondValue); + } + else { + // value type + acc[key] = secondValue; + } + } + else if (firstHasKey) { + acc[key] = firstValue; + } + else { + acc[key] = secondValue; + } + return acc; + }, {}); +} +exports.deepMerge = deepMerge; +//# sourceMappingURL=deepMerge.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/deepMerge.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/deepMerge.js.map new file mode 100644 index 000000000..7ee4604b8 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/deepMerge.js.map @@ -0,0 +1 @@ +{"version":3,"file":"deepMerge.js","sourceRoot":"","sources":["../../src/eslint-utils/deepMerge.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACH,SAAS,gBAAgB,CACvB,GAAwB;IAExB,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACxD,CAAC;AAwCQ,4CAAgB;AAtCzB;;;;;;GAMG;AACH,SAAgB,SAAS,CACvB,QAAoB,EAAE,EACtB,SAAqB,EAAE;IAEvB,iDAAiD;IACjD,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAErE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAa,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACtD,MAAM,WAAW,GAAG,GAAG,IAAI,KAAK,CAAC;QACjC,MAAM,YAAY,GAAG,GAAG,IAAI,MAAM,CAAC;QACnC,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9B,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAEhC,IAAI,WAAW,IAAI,YAAY,EAAE;YAC/B,IAAI,gBAAgB,CAAC,UAAU,CAAC,IAAI,gBAAgB,CAAC,WAAW,CAAC,EAAE;gBACjE,cAAc;gBACd,GAAG,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;aAC/C;iBAAM;gBACL,aAAa;gBACb,GAAG,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC;aACxB;SACF;aAAM,IAAI,WAAW,EAAE;YACtB,GAAG,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC;SACvB;aAAM;YACL,GAAG,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC;SACxB;QAED,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AA7BD,8BA6BC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/getParserServices.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/getParserServices.d.ts new file mode 100644 index 000000000..98626f43e --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/getParserServices.d.ts @@ -0,0 +1,8 @@ +import * as TSESLint from '../ts-eslint'; +import { ParserServices } from '../ts-estree'; +/** + * Try to retrieve typescript parser service from context + */ +declare function getParserServices(context: Readonly>, allowWithoutFullTypeInformation?: boolean): ParserServices; +export { getParserServices }; +//# sourceMappingURL=getParserServices.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/getParserServices.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/getParserServices.d.ts.map new file mode 100644 index 000000000..52fea2c4e --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/getParserServices.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getParserServices.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/getParserServices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAK9C;;GAEG;AACH,iBAAS,iBAAiB,CACxB,WAAW,SAAS,MAAM,EAC1B,QAAQ,SAAS,SAAS,OAAO,EAAE,EAEnC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,EAC9D,+BAA+B,UAAQ,GACtC,cAAc,CAuBhB;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/getParserServices.js b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/getParserServices.js new file mode 100644 index 000000000..09302fd81 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/getParserServices.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getParserServices = void 0; +const ERROR_MESSAGE = 'You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser.'; +/** + * Try to retrieve typescript parser service from context + */ +function getParserServices(context, allowWithoutFullTypeInformation = false) { + var _a; + // backwards compatibility check + // old versions of the parser would not return any parserServices unless parserOptions.project was set + if (!context.parserServices || + !context.parserServices.program || + !context.parserServices.esTreeNodeToTSNodeMap || + !context.parserServices.tsNodeToESTreeNodeMap) { + throw new Error(ERROR_MESSAGE); + } + const hasFullTypeInformation = (_a = context.parserServices.hasFullTypeInformation) !== null && _a !== void 0 ? _a : + /* backwards compatible */ true; + // if a rule requires full type information, then hard fail if it doesn't exist + // this forces the user to supply parserOptions.project + if (!hasFullTypeInformation && !allowWithoutFullTypeInformation) { + throw new Error(ERROR_MESSAGE); + } + return context.parserServices; +} +exports.getParserServices = getParserServices; +//# sourceMappingURL=getParserServices.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/getParserServices.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/getParserServices.js.map new file mode 100644 index 000000000..4d4012577 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/getParserServices.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getParserServices.js","sourceRoot":"","sources":["../../src/eslint-utils/getParserServices.ts"],"names":[],"mappings":";;;AAGA,MAAM,aAAa,GACjB,gLAAgL,CAAC;AAEnL;;GAEG;AACH,SAAS,iBAAiB,CAIxB,OAA8D,EAC9D,+BAA+B,GAAG,KAAK;;IAEvC,gCAAgC;IAChC,sGAAsG;IACtG,IACE,CAAC,OAAO,CAAC,cAAc;QACvB,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO;QAC/B,CAAC,OAAO,CAAC,cAAc,CAAC,qBAAqB;QAC7C,CAAC,OAAO,CAAC,cAAc,CAAC,qBAAqB,EAC7C;QACA,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC;KAChC;IAED,MAAM,sBAAsB,SAC1B,OAAO,CAAC,cAAc,CAAC,sBAAsB;IAC7C,0BAA0B,CAAC,IAAI,CAAC;IAElC,+EAA+E;IAC/E,uDAAuD;IACvD,IAAI,CAAC,sBAAsB,IAAI,CAAC,+BAA+B,EAAE;QAC/D,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC;KAChC;IAED,OAAO,OAAO,CAAC,cAAc,CAAC;AAChC,CAAC;AAEQ,8CAAiB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/index.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/index.d.ts new file mode 100644 index 000000000..8cdfcb01e --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/index.d.ts @@ -0,0 +1,8 @@ +export * from './applyDefault'; +export * from './batchedSingleLineTests'; +export * from './getParserServices'; +export * from './InferTypesFromRule'; +export * from './RuleCreator'; +export * from './RuleTester'; +export * from './deepMerge'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/index.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/index.d.ts.map new file mode 100644 index 000000000..7aca90d99 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/index.js b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/index.js new file mode 100644 index 000000000..dde280d2d --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/index.js @@ -0,0 +1,20 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./applyDefault"), exports); +__exportStar(require("./batchedSingleLineTests"), exports); +__exportStar(require("./getParserServices"), exports); +__exportStar(require("./InferTypesFromRule"), exports); +__exportStar(require("./RuleCreator"), exports); +__exportStar(require("./RuleTester"), exports); +__exportStar(require("./deepMerge"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/index.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/index.js.map new file mode 100644 index 000000000..f24be4767 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/eslint-utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA+B;AAC/B,2DAAyC;AACzC,sDAAoC;AACpC,uDAAqC;AACrC,gDAA8B;AAC9B,+CAA6B;AAC7B,8CAA4B"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/index.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/index.d.ts new file mode 100644 index 000000000..b8a60a9b4 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/index.d.ts @@ -0,0 +1,8 @@ +import * as ASTUtils from './ast-utils'; +import * as ESLintUtils from './eslint-utils'; +import * as JSONSchema from './json-schema'; +import * as TSESLint from './ts-eslint'; +import * as TSESLintScope from './ts-eslint-scope'; +export { ASTUtils, ESLintUtils, JSONSchema, TSESLint, TSESLintScope }; +export * from './ts-estree'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/index.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/index.d.ts.map new file mode 100644 index 000000000..822db0741 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,aAAa,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;AACtE,cAAc,aAAa,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/index.js b/node_modules/@typescript-eslint/experimental-utils/dist/index.js new file mode 100644 index 000000000..ef12e06df --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/index.js @@ -0,0 +1,37 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TSESLintScope = exports.TSESLint = exports.JSONSchema = exports.ESLintUtils = exports.ASTUtils = void 0; +const ASTUtils = __importStar(require("./ast-utils")); +exports.ASTUtils = ASTUtils; +const ESLintUtils = __importStar(require("./eslint-utils")); +exports.ESLintUtils = ESLintUtils; +const JSONSchema = __importStar(require("./json-schema")); +exports.JSONSchema = JSONSchema; +const TSESLint = __importStar(require("./ts-eslint")); +exports.TSESLint = TSESLint; +const TSESLintScope = __importStar(require("./ts-eslint-scope")); +exports.TSESLintScope = TSESLintScope; +__exportStar(require("./ts-estree"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/index.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/index.js.map new file mode 100644 index 000000000..b500da1a6 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAwC;AAM/B,4BAAQ;AALjB,4DAA8C;AAK3B,kCAAW;AAJ9B,0DAA4C;AAIZ,gCAAU;AAH1C,sDAAwC;AAGI,4BAAQ;AAFpD,iEAAmD;AAEG,sCAAa;AACnE,8CAA4B"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/json-schema.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/json-schema.d.ts new file mode 100644 index 000000000..bd6f29cd3 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/json-schema.d.ts @@ -0,0 +1,2 @@ +export { JSONSchema4, JSONSchema4Type, JSONSchema4TypeName, JSONSchema4Version, JSONSchema6, JSONSchema6Definition, JSONSchema6Type, JSONSchema6TypeName, JSONSchema6Version, JSONSchema7, JSONSchema7Array, JSONSchema7Definition, JSONSchema7Type, JSONSchema7TypeName, JSONSchema7Version, ValidationError, ValidationResult, } from 'json-schema'; +//# sourceMappingURL=json-schema.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/json-schema.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/json-schema.d.ts.map new file mode 100644 index 000000000..845788b30 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/json-schema.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"json-schema.d.ts","sourceRoot":"","sources":["../src/json-schema.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,GACjB,MAAM,aAAa,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/json-schema.js b/node_modules/@typescript-eslint/experimental-utils/dist/json-schema.js new file mode 100644 index 000000000..289fb57eb --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/json-schema.js @@ -0,0 +1,6 @@ +"use strict"; +// Note - @types/json-schema@7.0.4 added some function declarations to the type package +// If we do export *, then it will also export these function declarations. +// This will cause typescript to not scrub the require from the build, breaking anyone who doesn't have it as a dependency +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=json-schema.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/json-schema.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/json-schema.js.map new file mode 100644 index 000000000..51d0b026e --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/json-schema.js.map @@ -0,0 +1 @@ +{"version":3,"file":"json-schema.js","sourceRoot":"","sources":["../src/json-schema.ts"],"names":[],"mappings":";AAAA,uFAAuF;AACvF,2EAA2E;AAC3E,0HAA0H"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Definition.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Definition.d.ts new file mode 100644 index 000000000..bcaf94a2e --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Definition.d.ts @@ -0,0 +1,19 @@ +import { TSESTree } from '../ts-estree'; +interface Definition { + type: string; + name: TSESTree.BindingName; + node: TSESTree.Node; + parent?: TSESTree.Node | null; + index?: number | null; + kind?: string | null; + rest?: boolean; +} +interface DefinitionConstructor { + new (type: string, name: TSESTree.BindingName | TSESTree.PropertyName, node: TSESTree.Node, parent?: TSESTree.Node | null, index?: number | null, kind?: string | null): Definition; +} +declare const Definition: DefinitionConstructor; +interface ParameterDefinition extends Definition { +} +declare const ParameterDefinition: DefinitionConstructor & (new (name: TSESTree.Node, node: TSESTree.Node, index?: number | null | undefined, rest?: boolean | undefined) => ParameterDefinition); +export { Definition, ParameterDefinition }; +//# sourceMappingURL=Definition.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Definition.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Definition.d.ts.map new file mode 100644 index 000000000..ab9c63877 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Definition.d.ts","sourceRoot":"","sources":["../../src/ts-eslint-scope/Definition.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC,WAAW,CAAC;IAC3B,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AACD,UAAU,qBAAqB;IAC7B,KACE,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,QAAQ,CAAC,WAAW,GAAG,QAAQ,CAAC,YAAY,EAClD,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,MAAM,CAAC,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,EAC7B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,EACrB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GACnB,UAAU,CAAC;CACf;AACD,QAAA,MAAM,UAAU,uBAA4C,CAAC;AAG7D,UAAU,mBAAoB,SAAQ,UAAU;CAAG;AACnD,QAAA,MAAM,mBAAmB,sCAEf,SAAS,IAAI,QACb,SAAS,IAAI,oEAGlB,mBAAmB,CACvB,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Definition.js b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Definition.js new file mode 100644 index 000000000..dd3de1f5e --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Definition.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParameterDefinition = exports.Definition = void 0; +const definition_1 = require("eslint-scope/lib/definition"); +const Definition = definition_1.Definition; +exports.Definition = Definition; +const ParameterDefinition = definition_1.ParameterDefinition; +exports.ParameterDefinition = ParameterDefinition; +//# sourceMappingURL=Definition.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Definition.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Definition.js.map new file mode 100644 index 000000000..fa19c8c14 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Definition.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Definition.js","sourceRoot":"","sources":["../../src/ts-eslint-scope/Definition.ts"],"names":[],"mappings":";;;AAAA,4DAGqC;AAsBrC,MAAM,UAAU,GAAG,uBAAyC,CAAC;AAapD,gCAAU;AATnB,MAAM,mBAAmB,GAAG,gCAO3B,CAAC;AAEmB,kDAAmB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Options.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Options.d.ts new file mode 100644 index 000000000..48ce3c57b --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Options.d.ts @@ -0,0 +1,15 @@ +import { TSESTree } from '../ts-estree'; +declare type PatternVisitorCallback = (pattern: TSESTree.Identifier, info: { + rest: boolean; + topLevel: boolean; + assignments: TSESTree.AssignmentPattern[]; +}) => void; +interface PatternVisitorOptions { + processRightHandNodes?: boolean; +} +interface Visitor { + visitChildren(node?: T): void; + visit(node?: T): void; +} +export { PatternVisitorCallback, PatternVisitorOptions, Visitor }; +//# sourceMappingURL=Options.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Options.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Options.d.ts.map new file mode 100644 index 000000000..fae66aaa0 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Options.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Options.d.ts","sourceRoot":"","sources":["../../src/ts-eslint-scope/Options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,aAAK,sBAAsB,GAAG,CAC5B,OAAO,EAAE,QAAQ,CAAC,UAAU,EAC5B,IAAI,EAAE;IACJ,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,QAAQ,CAAC,iBAAiB,EAAE,CAAC;CAC3C,KACE,IAAI,CAAC;AAEV,UAAU,qBAAqB;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,UAAU,OAAO;IACf,aAAa,CAAC,CAAC,SAAS,QAAQ,CAAC,QAAQ,GAAG,SAAS,GAAG,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;IAC9E,KAAK,CAAC,CAAC,SAAS,QAAQ,CAAC,QAAQ,GAAG,SAAS,GAAG,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;CACvE;AAED,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,OAAO,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Options.js b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Options.js new file mode 100644 index 000000000..08cea8940 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Options.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=Options.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Options.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Options.js.map new file mode 100644 index 000000000..8d8fb9ec1 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Options.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Options.js","sourceRoot":"","sources":["../../src/ts-eslint-scope/Options.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/PatternVisitor.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/PatternVisitor.d.ts new file mode 100644 index 000000000..e21224bc9 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/PatternVisitor.d.ts @@ -0,0 +1,25 @@ +import { TSESTree } from '../ts-estree'; +import { ScopeManager } from './ScopeManager'; +import { PatternVisitorCallback, PatternVisitorOptions, Visitor } from './Options'; +interface PatternVisitor extends Visitor { + options: PatternVisitorOptions; + scopeManager: ScopeManager; + parent?: TSESTree.Node; + rightHandNodes: TSESTree.Node[]; + Identifier(pattern: TSESTree.Node): void; + Property(property: TSESTree.Node): void; + ArrayPattern(pattern: TSESTree.Node): void; + AssignmentPattern(pattern: TSESTree.Node): void; + RestElement(pattern: TSESTree.Node): void; + MemberExpression(node: TSESTree.Node): void; + SpreadElement(node: TSESTree.Node): void; + ArrayExpression(node: TSESTree.Node): void; + AssignmentExpression(node: TSESTree.Node): void; + CallExpression(node: TSESTree.Node): void; +} +declare const PatternVisitor: { + new (options: PatternVisitorOptions, rootPattern: TSESTree.BaseNode, callback: PatternVisitorCallback): PatternVisitor; + isPattern(node: TSESTree.Node): boolean; +}; +export { PatternVisitor }; +//# sourceMappingURL=PatternVisitor.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/PatternVisitor.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/PatternVisitor.d.ts.map new file mode 100644 index 000000000..eec5b0b10 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/PatternVisitor.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"PatternVisitor.d.ts","sourceRoot":"","sources":["../../src/ts-eslint-scope/PatternVisitor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,OAAO,EACR,MAAM,WAAW,CAAC;AAEnB,UAAU,cAAe,SAAQ,OAAO;IACtC,OAAO,EAAE,qBAAqB,CAAC;IAC/B,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC;IACvB,cAAc,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC;IAEhC,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IACzC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IACxC,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IAC3C,iBAAiB,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IAChD,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IAC1C,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IAC5C,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IACzC,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IAC3C,oBAAoB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IAChD,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;CAC3C;AACD,QAAA,MAAM,cAAc;kBAEP,qBAAqB,eACjB,SAAS,QAAQ,YACpB,sBAAsB,GAC/B,cAAc;oBAGD,SAAS,IAAI,GAAG,OAAO;CACxC,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/PatternVisitor.js b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/PatternVisitor.js new file mode 100644 index 000000000..43aa849aa --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/PatternVisitor.js @@ -0,0 +1,10 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PatternVisitor = void 0; +const pattern_visitor_1 = __importDefault(require("eslint-scope/lib/pattern-visitor")); +const PatternVisitor = pattern_visitor_1.default; +exports.PatternVisitor = PatternVisitor; +//# sourceMappingURL=PatternVisitor.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/PatternVisitor.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/PatternVisitor.js.map new file mode 100644 index 000000000..e08efc857 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/PatternVisitor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"PatternVisitor.js","sourceRoot":"","sources":["../../src/ts-eslint-scope/PatternVisitor.ts"],"names":[],"mappings":";;;;;;AAAA,uFAAoE;AA0BpE,MAAM,cAAc,GAAG,yBAStB,CAAC;AAEO,wCAAc"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Reference.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Reference.d.ts new file mode 100644 index 000000000..0d479b39b --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Reference.d.ts @@ -0,0 +1,28 @@ +import { TSESTree } from '../ts-estree'; +import { Scope } from './Scope'; +import { Variable } from './Variable'; +export declare type ReferenceFlag = 0x1 | 0x2 | 0x3; +interface Reference { + identifier: TSESTree.Identifier; + from: Scope; + resolved: Variable | null; + writeExpr: TSESTree.Node | null; + init: boolean; + partial: boolean; + __maybeImplicitGlobal: boolean; + tainted?: boolean; + typeMode?: boolean; + isWrite(): boolean; + isRead(): boolean; + isWriteOnly(): boolean; + isReadOnly(): boolean; + isReadWrite(): boolean; +} +declare const Reference: { + new (identifier: TSESTree.Identifier, scope: Scope, flag?: 2 | 3 | 1 | undefined, writeExpr?: TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpression | TSESTree.AssignmentExpression | TSESTree.AssignmentPattern | TSESTree.AwaitExpression | TSESTree.BigIntLiteral | TSESTree.BinaryExpression | TSESTree.BlockStatement | TSESTree.BreakStatement | TSESTree.CallExpression | TSESTree.CatchClause | TSESTree.ChainExpression | TSESTree.ClassBody | TSESTree.ClassDeclaration | TSESTree.ClassExpression | TSESTree.ClassPropertyComputedName | TSESTree.ClassPropertyNonComputedName | TSESTree.ConditionalExpression | TSESTree.ContinueStatement | TSESTree.DebuggerStatement | TSESTree.Decorator | TSESTree.DoWhileStatement | TSESTree.EmptyStatement | TSESTree.ExportAllDeclaration | TSESTree.ExportDefaultDeclaration | TSESTree.ExportNamedDeclaration | TSESTree.ExportSpecifier | TSESTree.ExpressionStatement | TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.Identifier | TSESTree.IfStatement | TSESTree.ImportDeclaration | TSESTree.ImportDefaultSpecifier | TSESTree.ImportExpression | TSESTree.ImportNamespaceSpecifier | TSESTree.ImportSpecifier | TSESTree.JSXAttribute | TSESTree.JSXClosingElement | TSESTree.JSXClosingFragment | TSESTree.JSXElement | TSESTree.JSXEmptyExpression | TSESTree.JSXExpressionContainer | TSESTree.JSXFragment | TSESTree.JSXIdentifier | TSESTree.JSXMemberExpression | TSESTree.JSXOpeningElement | TSESTree.JSXOpeningFragment | TSESTree.JSXSpreadAttribute | TSESTree.JSXSpreadChild | TSESTree.JSXText | TSESTree.LabeledStatement | TSESTree.BooleanLiteral | TSESTree.NumberLiteral | TSESTree.NullLiteral | TSESTree.RegExpLiteral | TSESTree.StringLiteral | TSESTree.LogicalExpression | TSESTree.MemberExpressionComputedName | TSESTree.MemberExpressionNonComputedName | TSESTree.MetaProperty | TSESTree.MethodDefinitionComputedName | TSESTree.MethodDefinitionNonComputedName | TSESTree.NewExpression | TSESTree.ObjectExpression | TSESTree.ObjectPattern | TSESTree.Program | TSESTree.PropertyComputedName | TSESTree.PropertyNonComputedName | TSESTree.RestElement | TSESTree.ReturnStatement | TSESTree.SequenceExpression | TSESTree.SpreadElement | TSESTree.Super | TSESTree.SwitchCase | TSESTree.SwitchStatement | TSESTree.TaggedTemplateExpression | TSESTree.TemplateElement | TSESTree.TemplateLiteral | TSESTree.ThisExpression | TSESTree.ThrowStatement | TSESTree.TryStatement | TSESTree.TSAbstractClassPropertyComputedName | TSESTree.TSAbstractClassPropertyNonComputedName | TSESTree.TSAbstractKeyword | TSESTree.TSAbstractMethodDefinitionComputedName | TSESTree.TSAbstractMethodDefinitionNonComputedName | TSESTree.TSAnyKeyword | TSESTree.TSArrayType | TSESTree.TSAsExpression | TSESTree.TSAsyncKeyword | TSESTree.TSBigIntKeyword | TSESTree.TSBooleanKeyword | TSESTree.TSCallSignatureDeclaration | TSESTree.TSClassImplements | TSESTree.TSConditionalType | TSESTree.TSConstructorType | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSDeclareFunction | TSESTree.TSDeclareKeyword | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSEnumDeclaration | TSESTree.TSEnumMemberComputedName | TSESTree.TSEnumMemberNonComputedName | TSESTree.TSExportAssignment | TSESTree.TSExportKeyword | TSESTree.TSExternalModuleReference | TSESTree.TSFunctionType | TSESTree.TSImportEqualsDeclaration | TSESTree.TSImportType | TSESTree.TSIndexedAccessType | TSESTree.TSIndexSignature | TSESTree.TSInferType | TSESTree.TSInterfaceBody | TSESTree.TSInterfaceDeclaration | TSESTree.TSInterfaceHeritage | TSESTree.TSIntersectionType | TSESTree.TSLiteralType | TSESTree.TSMappedType | TSESTree.TSMethodSignatureComputedName | TSESTree.TSMethodSignatureNonComputedName | TSESTree.TSModuleBlock | TSESTree.TSModuleDeclaration | TSESTree.TSNamedTupleMember | TSESTree.TSNamespaceExportDeclaration | TSESTree.TSNeverKeyword | TSESTree.TSNonNullExpression | TSESTree.TSNullKeyword | TSESTree.TSNumberKeyword | TSESTree.TSObjectKeyword | TSESTree.TSOptionalType | TSESTree.TSParameterProperty | TSESTree.TSParenthesizedType | TSESTree.TSPrivateKeyword | TSESTree.TSPropertySignatureComputedName | TSESTree.TSPropertySignatureNonComputedName | TSESTree.TSProtectedKeyword | TSESTree.TSPublicKeyword | TSESTree.TSQualifiedName | TSESTree.TSReadonlyKeyword | TSESTree.TSRestType | TSESTree.TSStaticKeyword | TSESTree.TSStringKeyword | TSESTree.TSSymbolKeyword | TSESTree.TSThisType | TSESTree.TSTupleType | TSESTree.TSTypeAliasDeclaration | TSESTree.TSTypeAnnotation | TSESTree.TSTypeAssertion | TSESTree.TSTypeLiteral | TSESTree.TSTypeOperator | TSESTree.TSTypeParameter | TSESTree.TSTypeParameterDeclaration | TSESTree.TSTypeParameterInstantiation | TSESTree.TSTypePredicate | TSESTree.TSTypeQuery | TSESTree.TSTypeReference | TSESTree.TSUndefinedKeyword | TSESTree.TSUnionType | TSESTree.TSUnknownKeyword | TSESTree.TSVoidKeyword | TSESTree.UnaryExpression | TSESTree.UpdateExpression | TSESTree.VariableDeclaration | TSESTree.VariableDeclarator | TSESTree.WhileStatement | TSESTree.WithStatement | TSESTree.YieldExpression | null | undefined, maybeImplicitGlobal?: boolean | undefined, partial?: boolean | undefined, init?: boolean | undefined): Reference; + READ: 0x1; + WRITE: 0x2; + RW: 0x3; +}; +export { Reference }; +//# sourceMappingURL=Reference.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Reference.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Reference.d.ts.map new file mode 100644 index 000000000..1384afbb9 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Reference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Reference.d.ts","sourceRoot":"","sources":["../../src/ts-eslint-scope/Reference.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,oBAAY,aAAa,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAE5C,UAAU,SAAS;IACjB,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC;IAChC,IAAI,EAAE,KAAK,CAAC;IACZ,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IAChC,IAAI,EAAE,OAAO,CAAC;IAEd,OAAO,EAAE,OAAO,CAAC;IACjB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,OAAO,IAAI,OAAO,CAAC;IACnB,MAAM,IAAI,OAAO,CAAC;IAClB,WAAW,IAAI,OAAO,CAAC;IACvB,UAAU,IAAI,OAAO,CAAC;IACtB,WAAW,IAAI,OAAO,CAAC;CACxB;AACD,QAAA,MAAM,SAAS;qBAEC,SAAS,UAAU,SACxB,KAAK,2lKAMX,SAAS;UAEN,GAAG;WACF,GAAG;QACN,GAAG;CACR,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Reference.js b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Reference.js new file mode 100644 index 000000000..71a4559af --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Reference.js @@ -0,0 +1,10 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Reference = void 0; +const reference_1 = __importDefault(require("eslint-scope/lib/reference")); +const Reference = reference_1.default; +exports.Reference = Reference; +//# sourceMappingURL=Reference.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Reference.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Reference.js.map new file mode 100644 index 000000000..8b1c95b4a --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Reference.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Reference.js","sourceRoot":"","sources":["../../src/ts-eslint-scope/Reference.ts"],"names":[],"mappings":";;;;;;AAAA,2EAAyD;AAyBzD,MAAM,SAAS,GAAG,mBAcjB,CAAC;AAEO,8BAAS"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Referencer.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Referencer.d.ts new file mode 100644 index 000000000..beeb2888d --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Referencer.d.ts @@ -0,0 +1,55 @@ +import { TSESTree } from '../ts-estree'; +import { PatternVisitorCallback, PatternVisitorOptions, Visitor } from './Options'; +import { Scope } from './Scope'; +import { ScopeManager } from './ScopeManager'; +interface Referencer extends Visitor { + isInnerMethodDefinition: boolean; + options: any; + scopeManager: SM; + parent?: TSESTree.Node; + currentScope(): Scope; + close(node: TSESTree.Node): void; + pushInnerMethodDefinition(isInnerMethodDefinition: boolean): boolean; + popInnerMethodDefinition(isInnerMethodDefinition: boolean): void; + referencingDefaultValue(pattern: any, assignments: any, maybeImplicitGlobal: any, init: boolean): void; + visitPattern(node: TSESTree.Node, options: PatternVisitorOptions, callback: PatternVisitorCallback): void; + visitFunction(node: TSESTree.Node): void; + visitClass(node: TSESTree.Node): void; + visitProperty(node: TSESTree.Node): void; + visitForIn(node: TSESTree.Node): void; + visitVariableDeclaration(variableTargetScope: any, type: any, node: TSESTree.Node, index: any): void; + AssignmentExpression(node: TSESTree.Node): void; + CatchClause(node: TSESTree.Node): void; + Program(node: TSESTree.Program): void; + Identifier(node: TSESTree.Identifier): void; + UpdateExpression(node: TSESTree.Node): void; + MemberExpression(node: TSESTree.Node): void; + Property(node: TSESTree.Node): void; + MethodDefinition(node: TSESTree.Node): void; + BreakStatement(): void; + ContinueStatement(): void; + LabeledStatement(node: TSESTree.Node): void; + ForStatement(node: TSESTree.Node): void; + ClassExpression(node: TSESTree.Node): void; + ClassDeclaration(node: TSESTree.Node): void; + CallExpression(node: TSESTree.Node): void; + BlockStatement(node: TSESTree.Node): void; + ThisExpression(): void; + WithStatement(node: TSESTree.Node): void; + VariableDeclaration(node: TSESTree.Node): void; + SwitchStatement(node: TSESTree.Node): void; + FunctionDeclaration(node: TSESTree.Node): void; + FunctionExpression(node: TSESTree.Node): void; + ForOfStatement(node: TSESTree.Node): void; + ForInStatement(node: TSESTree.Node): void; + ArrowFunctionExpression(node: TSESTree.Node): void; + ImportDeclaration(node: TSESTree.Node): void; + visitExportDeclaration(node: TSESTree.Node): void; + ExportDeclaration(node: TSESTree.Node): void; + ExportNamedDeclaration(node: TSESTree.Node): void; + ExportSpecifier(node: TSESTree.Node): void; + MetaProperty(): void; +} +declare const Referencer: new (options: any, scopeManager: SM) => Referencer; +export { Referencer }; +//# sourceMappingURL=Referencer.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Referencer.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Referencer.d.ts.map new file mode 100644 index 000000000..37a11bf7e --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Referencer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Referencer.d.ts","sourceRoot":"","sources":["../../src/ts-eslint-scope/Referencer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACx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Ae,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IAC3C,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IAC/C,kBAAkB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IAC9C,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IAC1C,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IAC1C,uBAAuB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IACnD,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IAC7C,sBAAsB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IAClD,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IAC7C,sBAAsB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IAClD,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IAC3C,YAAY,IAAI,IAAI,CAAC;CACtB;AACD,QAAA,MAAM,UAAU,yCACyB,GAAG,qCAC3C,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Referencer.js b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Referencer.js new file mode 100644 index 000000000..4aafa5aa5 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Referencer.js @@ -0,0 +1,11 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Referencer = void 0; +/* eslint-disable @typescript-eslint/no-explicit-any */ +const referencer_1 = __importDefault(require("eslint-scope/lib/referencer")); +const Referencer = referencer_1.default; +exports.Referencer = Referencer; +//# sourceMappingURL=Referencer.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Referencer.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Referencer.js.map new file mode 100644 index 000000000..2d80e28d5 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Referencer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Referencer.js","sourceRoot":"","sources":["../../src/ts-eslint-scope/Referencer.ts"],"names":[],"mappings":";;;;;;AAAA,uDAAuD;AACvD,6EAA2D;AA2E3D,MAAM,UAAU,GAAG,oBAElB,CAAC;AAEO,gCAAU"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Scope.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Scope.d.ts new file mode 100644 index 000000000..ae6bd1144 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Scope.d.ts @@ -0,0 +1,103 @@ +import { TSESTree } from '../ts-estree'; +import { Definition } from './Definition'; +import { Reference, ReferenceFlag } from './Reference'; +import { ScopeManager } from './ScopeManager'; +import { Variable } from './Variable'; +declare type ScopeType = 'block' | 'catch' | 'class' | 'for' | 'function' | 'function-expression-name' | 'global' | 'module' | 'switch' | 'with' | 'TDZ' | 'enum' | 'empty-function'; +interface Scope { + type: ScopeType; + isStrict: boolean; + upper: Scope | null; + childScopes: Scope[]; + variableScope: Scope; + block: TSESTree.Node; + variables: Variable[]; + set: Map; + references: Reference[]; + through: Reference[]; + thisFound?: boolean; + taints: Map; + functionExpressionScope: boolean; + __left: Reference[]; + __shouldStaticallyClose(scopeManager: ScopeManager): boolean; + __shouldStaticallyCloseForGlobal(ref: any): boolean; + __staticCloseRef(ref: any): void; + __dynamicCloseRef(ref: any): void; + __globalCloseRef(ref: any): void; + __close(scopeManager: ScopeManager): Scope; + __isValidResolution(ref: any, variable: any): variable is Variable; + __resolve(ref: Reference): boolean; + __delegateToUpperScope(ref: any): void; + __addDeclaredVariablesOfNode(variable: any, node: TSESTree.Node): void; + __defineGeneric(name: string, set: Map, variables: Variable[], node: TSESTree.Identifier, def: Definition): void; + __define(node: TSESTree.Node, def: Definition): void; + __referencing(node: TSESTree.Node, assign?: ReferenceFlag, writeExpr?: TSESTree.Node, maybeImplicitGlobal?: any, partial?: any, init?: any): void; + __detectEval(): void; + __detectThis(): void; + __isClosed(): boolean; + /** + * returns resolved {Reference} + * @method Scope#resolve + * @param {Espree.Identifier} ident - identifier to be resolved. + * @returns {Reference} reference + */ + resolve(ident: TSESTree.Node): Reference; + /** + * returns this scope is static + * @method Scope#isStatic + * @returns {boolean} static + */ + isStatic(): boolean; + /** + * returns this scope has materialized arguments + * @method Scope#isArgumentsMaterialized + * @returns {boolean} arguments materialized + */ + isArgumentsMaterialized(): boolean; + /** + * returns this scope has materialized `this` reference + * @method Scope#isThisMaterialized + * @returns {boolean} this materialized + */ + isThisMaterialized(): boolean; + isUsedName(name: any): boolean; +} +interface ScopeConstructor { + new (scopeManager: ScopeManager, type: ScopeType, upperScope: Scope | null, block: TSESTree.Node | null, isMethodDefinition: boolean): Scope; +} +declare const Scope: ScopeConstructor; +interface ScopeChildConstructorWithUpperScope { + new (scopeManager: ScopeManager, upperScope: Scope, block: TSESTree.Node | null): T; +} +interface GlobalScope extends Scope { +} +declare const GlobalScope: ScopeConstructor & (new (scopeManager: ScopeManager, block: TSESTree.Node | null) => GlobalScope); +interface ModuleScope extends Scope { +} +declare const ModuleScope: ScopeConstructor & ScopeChildConstructorWithUpperScope; +interface FunctionExpressionNameScope extends Scope { +} +declare const FunctionExpressionNameScope: ScopeConstructor & ScopeChildConstructorWithUpperScope; +interface CatchScope extends Scope { +} +declare const CatchScope: ScopeConstructor & ScopeChildConstructorWithUpperScope; +interface WithScope extends Scope { +} +declare const WithScope: ScopeConstructor & ScopeChildConstructorWithUpperScope; +interface BlockScope extends Scope { +} +declare const BlockScope: ScopeConstructor & ScopeChildConstructorWithUpperScope; +interface SwitchScope extends Scope { +} +declare const SwitchScope: ScopeConstructor & ScopeChildConstructorWithUpperScope; +interface FunctionScope extends Scope { +} +declare const FunctionScope: ScopeConstructor & (new (scopeManager: ScopeManager, upperScope: Scope, block: TSESTree.Node | null, isMethodDefinition: boolean) => FunctionScope); +interface ForScope extends Scope { +} +declare const ForScope: ScopeConstructor & ScopeChildConstructorWithUpperScope; +interface ClassScope extends Scope { +} +declare const ClassScope: ScopeConstructor & ScopeChildConstructorWithUpperScope; +export { ScopeType, Scope, GlobalScope, ModuleScope, FunctionExpressionNameScope, CatchScope, WithScope, BlockScope, SwitchScope, FunctionScope, ForScope, ClassScope, }; +//# sourceMappingURL=Scope.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Scope.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Scope.d.ts.map new file mode 100644 index 000000000..8b6f342ec --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Scope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Scope.d.ts","sourceRoot":"","sources":["../../src/ts-eslint-scope/Scope.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,aAAK,SAAS,GACV,OAAO,GACP,OAAO,GACP,OAAO,GACP,KAAK,GACL,UAAU,GACV,0B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experimental-utils/dist/ts-eslint-scope/Scope.js b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Scope.js new file mode 100644 index 000000000..f4f604fcb --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Scope.js @@ -0,0 +1,28 @@ +"use strict"; +/* eslint-disable @typescript-eslint/no-empty-interface, @typescript-eslint/no-explicit-any */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClassScope = exports.ForScope = exports.FunctionScope = exports.SwitchScope = exports.BlockScope = exports.WithScope = exports.CatchScope = exports.FunctionExpressionNameScope = exports.ModuleScope = exports.GlobalScope = exports.Scope = void 0; +const scope_1 = require("eslint-scope/lib/scope"); +const Scope = scope_1.Scope; +exports.Scope = Scope; +const GlobalScope = scope_1.GlobalScope; +exports.GlobalScope = GlobalScope; +const ModuleScope = scope_1.ModuleScope; +exports.ModuleScope = ModuleScope; +const FunctionExpressionNameScope = scope_1.FunctionExpressionNameScope; +exports.FunctionExpressionNameScope = FunctionExpressionNameScope; +const CatchScope = scope_1.CatchScope; +exports.CatchScope = CatchScope; +const WithScope = scope_1.WithScope; +exports.WithScope = WithScope; +const BlockScope = scope_1.BlockScope; +exports.BlockScope = BlockScope; +const SwitchScope = scope_1.SwitchScope; +exports.SwitchScope = SwitchScope; +const FunctionScope = scope_1.FunctionScope; +exports.FunctionScope = FunctionScope; +const ForScope = scope_1.ForScope; +exports.ForScope = ForScope; +const ClassScope = scope_1.ClassScope; +exports.ClassScope = ClassScope; +//# sourceMappingURL=Scope.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Scope.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Scope.js.map new file mode 100644 index 000000000..b0d79696e --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Scope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Scope.js","sourceRoot":"","sources":["../../src/ts-eslint-scope/Scope.ts"],"names":[],"mappings":";AAAA,8FAA8F;;;AAE9F,kDAYgC;AA8GhC,MAAM,KAAK,GAAG,aAA+B,CAAC;AA2D5C,sBAAK;AAhDP,MAAM,WAAW,GAAG,mBAEnB,CAAC;AA+CA,kCAAW;AA5Cb,MAAM,WAAW,GAAG,mBAC8B,CAAC;AA4CjD,kCAAW;AAzCb,MAAM,2BAA2B,GAAG,mCAC8B,CAAC;AAyCjE,kEAA2B;AAtC7B,MAAM,UAAU,GAAG,kBAC8B,CAAC;AAsChD,gCAAU;AAnCZ,MAAM,SAAS,GAAG,iBAC8B,CAAC;AAmC/C,8BAAS;AAhCX,MAAM,UAAU,GAAG,kBAC8B,CAAC;AAgChD,gCAAU;AA7BZ,MAAM,WAAW,GAAG,mBAC8B,CAAC;AA6BjD,kCAAW;AA1Bb,MAAM,aAAa,GAAG,qBAOrB,CAAC;AAoBA,sCAAa;AAjBf,MAAM,QAAQ,GAAG,gBAC8B,CAAC;AAiB9C,4BAAQ;AAdV,MAAM,UAAU,GAAG,kBAC8B,CAAC;AAchD,gCAAU"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/ScopeManager.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/ScopeManager.d.ts new file mode 100644 index 000000000..9b7e929a2 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/ScopeManager.d.ts @@ -0,0 +1,50 @@ +import { TSESTree } from '../ts-estree'; +import { EcmaVersion } from '../ts-eslint'; +import { Scope } from './Scope'; +import { Variable } from './Variable'; +interface ScopeManagerOptions { + directive?: boolean; + optimistic?: boolean; + ignoreEval?: boolean; + nodejsScope?: boolean; + sourceType?: 'module' | 'script'; + impliedStrict?: boolean; + ecmaVersion?: EcmaVersion; +} +interface ScopeManager { + __options: ScopeManagerOptions; + __currentScope: Scope; + __nodeToScope: WeakMap; + __declaredVariables: WeakMap; + scopes: Scope[]; + globalScope: Scope; + __useDirective(): boolean; + __isOptimistic(): boolean; + __ignoreEval(): boolean; + __isNodejsScope(): boolean; + isModule(): boolean; + isImpliedStrict(): boolean; + isStrictModeSupported(): boolean; + __get(node: TSESTree.Node): Scope | undefined; + getDeclaredVariables(node: TSESTree.Node): Variable[]; + acquire(node: TSESTree.Node, inner?: boolean): Scope | null; + acquireAll(node: TSESTree.Node): Scope | null; + release(node: TSESTree.Node, inner?: boolean): Scope | null; + attach(): void; + detach(): void; + __nestScope(scope: T): T; + __nestGlobalScope(node: TSESTree.Node): Scope; + __nestBlockScope(node: TSESTree.Node): Scope; + __nestFunctionScope(node: TSESTree.Node, isMethodDefinition: boolean): Scope; + __nestForScope(node: TSESTree.Node): Scope; + __nestCatchScope(node: TSESTree.Node): Scope; + __nestWithScope(node: TSESTree.Node): Scope; + __nestClassScope(node: TSESTree.Node): Scope; + __nestSwitchScope(node: TSESTree.Node): Scope; + __nestModuleScope(node: TSESTree.Node): Scope; + __nestFunctionExpressionNameScope(node: TSESTree.Node): Scope; + __isES6(): boolean; +} +declare const ScopeManager: new (options: ScopeManagerOptions) => ScopeManager; +export { ScopeManager, ScopeManagerOptions }; +//# sourceMappingURL=ScopeManager.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/ScopeManager.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/ScopeManager.d.ts.map new file mode 100644 index 000000000..7c9ba533e --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/ScopeManager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ScopeManager.d.ts","sourceRoot":"","sources":["../../src/ts-eslint-scope/ScopeManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACh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AO,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,IAAI,CAAC;IAC5D,MAAM,IAAI,IAAI,CAAC;IACf,MAAM,IAAI,IAAI,CAAC;IAEf,WAAW,CAAC,CAAC,SAAS,KAAK,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;IAC1C,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,KAAK,CAAC;IAC9C,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,KAAK,CAAC;IAC7C,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,GAAG,KAAK,CAAC;IAC7E,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,KAAK,CAAC;IAC3C,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,KAAK,CAAC;IAC7C,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,KAAK,CAAC;IAC5C,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,KAAK,CAAC;IAC7C,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,KAAK,CAAC;IAC9C,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,KAAK,CAAC;IAC9C,iCAAiC,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,KAAK,CAAC;IAE9D,OAAO,IAAI,OAAO,CAAC;CACpB;AACD,QAAA,MAAM,YAAY,gBACF,mBAAmB,KAAG,YACrC,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/ScopeManager.js b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/ScopeManager.js new file mode 100644 index 000000000..c886eb72f --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/ScopeManager.js @@ -0,0 +1,10 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ScopeManager = void 0; +const scope_manager_1 = __importDefault(require("eslint-scope/lib/scope-manager")); +const ScopeManager = scope_manager_1.default; +exports.ScopeManager = ScopeManager; +//# sourceMappingURL=ScopeManager.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/ScopeManager.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/ScopeManager.js.map new file mode 100644 index 000000000..35d90d13c --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/ScopeManager.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ScopeManager.js","sourceRoot":"","sources":["../../src/ts-eslint-scope/ScopeManager.ts"],"names":[],"mappings":";;;;;;AAAA,mFAAgE;AAwDhE,MAAM,YAAY,GAAG,uBAEpB,CAAC;AAEO,oCAAY"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Variable.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Variable.d.ts new file mode 100644 index 000000000..a5d6ddff6 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Variable.d.ts @@ -0,0 +1,17 @@ +import { TSESTree } from '../ts-estree'; +import { Reference } from './Reference'; +import { Definition } from './Definition'; +import { Scope } from './Scope'; +interface Variable { + name: string; + identifiers: TSESTree.Identifier[]; + references: Reference[]; + defs: Definition[]; + eslintUsed?: boolean; + stack?: unknown; + tainted?: boolean; + scope?: Scope; +} +declare const Variable: new () => Variable; +export { Variable }; +//# sourceMappingURL=Variable.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Variable.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Variable.d.ts.map new file mode 100644 index 000000000..604e18552 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Variable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Variable.d.ts","sourceRoot":"","sources":["../../src/ts-eslint-scope/Variable.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC;IACnC,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,QAAA,MAAM,QAAQ,YACJ,QACT,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Variable.js b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Variable.js new file mode 100644 index 000000000..c0fdac2b3 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Variable.js @@ -0,0 +1,10 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Variable = void 0; +const variable_1 = __importDefault(require("eslint-scope/lib/variable")); +const Variable = variable_1.default; +exports.Variable = Variable; +//# sourceMappingURL=Variable.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Variable.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Variable.js.map new file mode 100644 index 000000000..d6545bb0b --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/Variable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Variable.js","sourceRoot":"","sources":["../../src/ts-eslint-scope/Variable.ts"],"names":[],"mappings":";;;;;;AAAA,yEAAuD;AAiBvD,MAAM,QAAQ,GAAG,kBAEhB,CAAC;AAEO,4BAAQ"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/analyze.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/analyze.d.ts new file mode 100644 index 000000000..dbcb76bb2 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/analyze.d.ts @@ -0,0 +1,16 @@ +import { EcmaVersion } from '../ts-eslint'; +import { TSESTree } from '../ts-estree'; +import { ScopeManager } from './ScopeManager'; +interface AnalysisOptions { + optimistic?: boolean; + directive?: boolean; + ignoreEval?: boolean; + nodejsScope?: boolean; + impliedStrict?: boolean; + fallback?: string | ((node: TSESTree.Node) => string[]); + sourceType?: 'script' | 'module'; + ecmaVersion?: EcmaVersion; +} +declare const analyze: (ast: TSESTree.Node, options?: AnalysisOptions | undefined) => ScopeManager; +export { analyze, AnalysisOptions }; +//# sourceMappingURL=analyze.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/analyze.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/analyze.d.ts.map new file mode 100644 index 000000000..9a3654b6f --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/analyze.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../src/ts-eslint-scope/analyze.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,UAAU,eAAe;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC,CAAC;IACxD,UAAU,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACjC,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AACD,QAAA,MAAM,OAAO,QACN,SAAS,IAAI,4CAEf,YAAY,CAAC;AAElB,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/analyze.js b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/analyze.js new file mode 100644 index 000000000..7fddff179 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/analyze.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.analyze = void 0; +const eslint_scope_1 = require("eslint-scope"); +const analyze = eslint_scope_1.analyze; +exports.analyze = analyze; +//# sourceMappingURL=analyze.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/analyze.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/analyze.js.map new file mode 100644 index 000000000..f015cc4ef --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/analyze.js.map @@ -0,0 +1 @@ +{"version":3,"file":"analyze.js","sourceRoot":"","sources":["../../src/ts-eslint-scope/analyze.ts"],"names":[],"mappings":";;;AAAA,+CAAwD;AAexD,MAAM,OAAO,GAAG,sBAGC,CAAC;AAET,0BAAO"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/index.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/index.d.ts new file mode 100644 index 000000000..c795b88d2 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/index.d.ts @@ -0,0 +1,11 @@ +export * from './analyze'; +export * from './Definition'; +export * from './Options'; +export * from './PatternVisitor'; +export * from './Reference'; +export * from './Referencer'; +export * from './Scope'; +export * from './ScopeManager'; +export * from './Variable'; +export declare const version: string; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/index.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/index.d.ts.map new file mode 100644 index 000000000..26afd66cf --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts-eslint-scope/index.ts"],"names":[],"mappings":"AAEA,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,eAAO,MAAM,OAAO,EAAE,MAAsB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/index.js b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/index.js new file mode 100644 index 000000000..34d3243cf --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/index.js @@ -0,0 +1,25 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.version = void 0; +const eslint_scope_1 = require("eslint-scope"); +__exportStar(require("./analyze"), exports); +__exportStar(require("./Definition"), exports); +__exportStar(require("./Options"), exports); +__exportStar(require("./PatternVisitor"), exports); +__exportStar(require("./Reference"), exports); +__exportStar(require("./Referencer"), exports); +__exportStar(require("./Scope"), exports); +__exportStar(require("./ScopeManager"), exports); +__exportStar(require("./Variable"), exports); +exports.version = eslint_scope_1.version; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/index.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/index.js.map new file mode 100644 index 000000000..8872a9fbd --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint-scope/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ts-eslint-scope/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAwD;AAExD,4CAA0B;AAC1B,+CAA6B;AAC7B,4CAA0B;AAC1B,mDAAiC;AACjC,8CAA4B;AAC5B,+CAA6B;AAC7B,0CAAwB;AACxB,iDAA+B;AAC/B,6CAA2B;AACd,QAAA,OAAO,GAAW,sBAAa,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/AST.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/AST.d.ts new file mode 100644 index 000000000..88d637901 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/AST.d.ts @@ -0,0 +1,9 @@ +import { TSESTree, AST_TOKEN_TYPES } from '../ts-estree'; +declare namespace AST { + type TokenType = AST_TOKEN_TYPES; + type Token = TSESTree.Token; + type SourceLocation = TSESTree.SourceLocation; + type Range = TSESTree.Range; +} +export { AST }; +//# sourceMappingURL=AST.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/AST.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/AST.d.ts.map new file mode 100644 index 000000000..8dca544ba --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/AST.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"AST.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/AST.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEzD,kBAAU,GAAG,CAAC;IACZ,KAAY,SAAS,GAAG,eAAe,CAAC;IAExC,KAAY,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;IAEnC,KAAY,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAC;IAErD,KAAY,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;CACpC;AAED,OAAO,EAAE,GAAG,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/AST.js b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/AST.js new file mode 100644 index 000000000..323ed5563 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/AST.js @@ -0,0 +1,4 @@ +"use strict"; +/* eslint-disable @typescript-eslint/no-namespace */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=AST.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/AST.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/AST.js.map new file mode 100644 index 000000000..2aa7f04b4 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/AST.js.map @@ -0,0 +1 @@ +{"version":3,"file":"AST.js","sourceRoot":"","sources":["../../src/ts-eslint/AST.ts"],"names":[],"mappings":";AAAA,oDAAoD"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/CLIEngine.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/CLIEngine.d.ts new file mode 100644 index 000000000..f996162e0 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/CLIEngine.d.ts @@ -0,0 +1,143 @@ +import { Linter } from './Linter'; +import { RuleListener, RuleMetaData, RuleModule } from './Rule'; +declare class CLIEngineBase { + /** + * Creates a new instance of the core CLI engine. + * @param providedOptions The options for this instance. + */ + constructor(options: CLIEngine.Options); + /** + * Add a plugin by passing its configuration + * @param name Name of the plugin. + * @param pluginObject Plugin configuration object. + */ + addPlugin(name: string, pluginObject: Linter.Plugin): void; + /** + * Executes the current configuration on an array of file and directory names. + * @param patterns An array of file and directory names. + * @returns The results for all files that were linted. + */ + executeOnFiles(patterns: string[]): CLIEngine.LintReport; + /** + * Executes the current configuration on text. + * @param text A string of JavaScript code to lint. + * @param filename An optional string representing the texts filename. + * @param warnIgnored Always warn when a file is ignored + * @returns The results for the linting. + */ + executeOnText(text: string, filename?: string, warnIgnored?: boolean): CLIEngine.LintReport; + /** + * Returns a configuration object for the given file based on the CLI options. + * This is the same logic used by the ESLint CLI executable to determine configuration for each file it processes. + * @param filePath The path of the file to retrieve a config object for. + * @returns A configuration object for the file. + */ + getConfigForFile(filePath: string): Linter.Config; + /** + * Returns the formatter representing the given format. + * @param format The name of the format to load or the path to a custom formatter. + * @returns The formatter function. + */ + getFormatter(format?: string): CLIEngine.Formatter; + /** + * Checks if a given path is ignored by ESLint. + * @param filePath The path of the file to check. + * @returns Whether or not the given path is ignored. + */ + isPathIgnored(filePath: string): boolean; + /** + * Resolves the patterns passed into `executeOnFiles()` into glob-based patterns for easier handling. + * @param patterns The file patterns passed on the command line. + * @returns The equivalent glob patterns. + */ + resolveFileGlobPatterns(patterns: string[]): string[]; + getRules(): Map>; + /** + * Returns results that only contains errors. + * @param results The results to filter. + * @returns The filtered results. + */ + static getErrorResults(results: CLIEngine.LintResult[]): CLIEngine.LintResult[]; + /** + * Returns the formatter representing the given format or null if the `format` is not a string. + * @param format The name of the format to load or the path to a custom formatter. + * @returns The formatter function. + */ + static getFormatter(format?: string): CLIEngine.Formatter; + /** + * Outputs fixes from the given results to files. + * @param report The report object created by CLIEngine. + */ + static outputFixes(report: CLIEngine.LintReport): void; + static version: string; +} +declare namespace CLIEngine { + interface Options { + allowInlineConfig?: boolean; + baseConfig?: false | { + [name: string]: unknown; + }; + cache?: boolean; + cacheFile?: string; + cacheLocation?: string; + configFile?: string; + cwd?: string; + envs?: string[]; + errorOnUnmatchedPattern?: boolean; + extensions?: string[]; + fix?: boolean; + globals?: string[]; + ignore?: boolean; + ignorePath?: string; + ignorePattern?: string | string[]; + useEslintrc?: boolean; + parser?: string; + parserOptions?: Linter.ParserOptions; + plugins?: string[]; + resolvePluginsRelativeTo?: string; + rules?: { + [name: string]: Linter.RuleLevel | Linter.RuleLevelAndOptions; + }; + rulePaths?: string[]; + reportUnusedDisableDirectives?: boolean; + } + interface LintResult { + filePath: string; + messages: Linter.LintMessage[]; + errorCount: number; + warningCount: number; + fixableErrorCount: number; + fixableWarningCount: number; + output?: string; + source?: string; + } + interface LintReport { + results: LintResult[]; + errorCount: number; + warningCount: number; + fixableErrorCount: number; + fixableWarningCount: number; + usedDeprecatedRules: DeprecatedRuleUse[]; + } + interface DeprecatedRuleUse { + ruleId: string; + replacedBy: string[]; + } + interface LintResultData { + rulesMeta: { + [ruleId: string]: RuleMetaData; + }; + } + type Formatter = (results: LintResult[], data?: LintResultData) => string; +} +declare const CLIEngine_base: typeof CLIEngineBase; +/** + * The underlying utility that runs the ESLint command line interface. This object will read the filesystem for + * configuration and file information but will not output any results. Instead, it allows you direct access to the + * important information so you can deal with the output yourself. + * @deprecated use the ESLint class instead + */ +declare class CLIEngine extends CLIEngine_base { +} +export { CLIEngine }; +//# sourceMappingURL=CLIEngine.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/CLIEngine.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/CLIEngine.d.ts.map new file mode 100644 index 000000000..6d8d24e00 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/CLIEngine.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CLIEngine.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/CLIEngine.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEhE,OAAO,OAAO,aAAa;IACzB;;;OAGG;gBACS,OAAO,EAAE,SAAS,CAAC,OAAO;IAEtC;;;;OAIG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,MAAM,GAAG,IAAI;IAE1D;;;;OAIG;IACH,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC,UAAU;IAExD;;;;;;OAMG;IACH,aAAa,CACX,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,MAAM,EACjB,WAAW,CAAC,EAAE,OAAO,GACpB,SAAS,CAAC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C5B,mBAAmB,EAAE,iBAAiB,EAAE,CAAC;KAC1C;IAED,UAAiB,iBAAiB;QAChC,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,EAAE,CAAC;KACtB;IAED,UAAiB,cAAc,CAAC,WAAW,SAAS,MAAM;QACxD,SAAS,EAAE;YACT,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;SAC7C,CAAC;KACH;IAED,KAAY,SAAS,GAAG,CAAC,WAAW,SAAS,MAAM,EACjD,OAAO,EAAE,UAAU,EAAE,EACrB,IAAI,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,KAC/B,MAAM,CAAC;CACb;;AAED;;;;;GAKG;AACH,cAAM,SAAU,SAAQ,cAAyC;CAAG;AAEpE,OAAO,EAAE,SAAS,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/CLIEngine.js b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/CLIEngine.js new file mode 100644 index 000000000..8ccf2b7e7 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/CLIEngine.js @@ -0,0 +1,15 @@ +"use strict"; +/* eslint-disable @typescript-eslint/no-namespace */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CLIEngine = void 0; +const eslint_1 = require("eslint"); +/** + * The underlying utility that runs the ESLint command line interface. This object will read the filesystem for + * configuration and file information but will not output any results. Instead, it allows you direct access to the + * important information so you can deal with the output yourself. + * @deprecated use the ESLint class instead + */ +class CLIEngine extends eslint_1.CLIEngine { +} +exports.CLIEngine = CLIEngine; +//# sourceMappingURL=CLIEngine.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/CLIEngine.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/CLIEngine.js.map new file mode 100644 index 000000000..4ac14814a --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/CLIEngine.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CLIEngine.js","sourceRoot":"","sources":["../../src/ts-eslint/CLIEngine.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAEpD,mCAAsD;AAyKtD;;;;;GAKG;AACH,MAAM,SAAU,SAAS,kBAAwC;CAAG;AAE3D,8BAAS"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ESLint.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ESLint.d.ts new file mode 100644 index 000000000..99133e7a2 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ESLint.d.ts @@ -0,0 +1,338 @@ +import { Linter } from './Linter'; +declare class ESLintBase { + /** + * Creates a new instance of the main ESLint API. + * @param options The options for this instance. + */ + constructor(options?: ESLint.ESLintOptions); + /** + * This method calculates the configuration for a given file, which can be useful for debugging purposes. + * - It resolves and merges extends and overrides settings into the top level configuration. + * - It resolves the parser setting to absolute paths. + * - It normalizes the plugins setting to align short names. (e.g., eslint-plugin-foo → foo) + * - It adds the processor setting if a legacy file extension processor is matched. + * - It doesn't interpret the env setting to the globals and parserOptions settings, so the result object contains + * the env setting as is. + * @param filePath The path to the file whose configuration you would like to calculate. Directory paths are forbidden + * because ESLint cannot handle the overrides setting. + * @returns The promise that will be fulfilled with a configuration object. + */ + calculateConfigForFile(filePath: string): Promise; + /** + * This method checks if a given file is ignored by your configuration. + * @param filePath The path to the file you want to check. + * @returns The promise that will be fulfilled with whether the file is ignored or not. If the file is ignored, then + * it will return true. + */ + isPathIgnored(filePath: string): Promise; + /** + * This method lints the files that match the glob patterns and then returns the results. + * @param patterns The lint target files. This can contain any of file paths, directory paths, and glob patterns. + * @returns The promise that will be fulfilled with an array of LintResult objects. + */ + lintFiles(patterns: string | string[]): Promise; + /** + * This method lints the given source code text and then returns the results. + * + * By default, this method uses the configuration that applies to files in the current working directory (the cwd + * constructor option). If you want to use a different configuration, pass options.filePath, and ESLint will load the + * same configuration that eslint.lintFiles() would use for a file at options.filePath. + * + * If the options.filePath value is configured to be ignored, this method returns an empty array. If the + * options.warnIgnored option is set along with the options.filePath option, this method returns a LintResult object. + * In that case, the result may contain a warning that indicates the file was ignored. + * @param code The source code text to check. + * @param options The options. + * @returns The promise that will be fulfilled with an array of LintResult objects. This is an array (despite there + * being only one lint result) in order to keep the interfaces between this and the eslint.lintFiles() + * method similar. + */ + lintText(code: string, options?: ESLint.LintTextOptions): Promise; + /** + * This method loads a formatter. Formatters convert lint results to a human- or machine-readable string. + * @param name TThe path to the file you want to check. + * The following values are allowed: + * - undefined. In this case, loads the "stylish" built-in formatter. + * - A name of built-in formatters. + * - A name of third-party formatters. For examples: + * -- `foo` will load eslint-formatter-foo. + * -- `@foo` will load `@foo/eslint-formatter`. + * -- `@foo/bar` will load `@foo/eslint-formatter-bar`. + * - A path to the file that defines a formatter. The path must contain one or more path separators (/) in order to distinguish if it's a path or not. For example, start with ./. + * @returns The promise that will be fulfilled with a Formatter object. + */ + loadFormatter(name?: string): Promise; + /** + * This method copies the given results and removes warnings. The returned value contains only errors. + * @param results The LintResult objects to filter. + * @returns The filtered LintResult objects. + */ + static getErrorResults(results: ESLint.LintResult): ESLint.LintResult; + /** + * This method writes code modified by ESLint's autofix feature into its respective file. If any of the modified + * files don't exist, this method does nothing. + * @param results The LintResult objects to write. + * @returns The promise that will be fulfilled after all files are written. + */ + static outputFixes(results: ESLint.LintResult): Promise; + /** + * The version text. + */ + static readonly version: string; +} +declare namespace ESLint { + interface ESLintOptions { + /** + * If false is present, ESLint suppresses directive comments in source code. + * If this option is false, it overrides the noInlineConfig setting in your configurations. + */ + allowInlineConfig?: boolean; + /** + * Configuration object, extended by all configurations used with this instance. + * You can use this option to define the default settings that will be used if your configuration files don't + * configure it. + */ + baseConfig?: Linter.Config | null; + /** + * If true is present, the eslint.lintFiles() method caches lint results and uses it if each target file is not + * changed. Please mind that ESLint doesn't clear the cache when you upgrade ESLint plugins. In that case, you have + * to remove the cache file manually. The eslint.lintText() method doesn't use caches even if you pass the + * options.filePath to the method. + */ + cache?: boolean; + /** + * The eslint.lintFiles() method writes caches into this file. + */ + cacheLocation?: string; + /** + * The working directory. This must be an absolute path. + */ + cwd?: string; + /** + * Unless set to false, the eslint.lintFiles() method will throw an error when no target files are found. + */ + errorOnUnmatchedPattern?: boolean; + /** + * If you pass directory paths to the eslint.lintFiles() method, ESLint checks the files in those directories that + * have the given extensions. For example, when passing the src/ directory and extensions is [".js", ".ts"], ESLint + * will lint *.js and *.ts files in src/. If extensions is null, ESLint checks *.js files and files that match + * overrides[].files patterns in your configuration. + * Note: This option only applies when you pass directory paths to the eslint.lintFiles() method. + * If you pass glob patterns, ESLint will lint all files matching the glob pattern regardless of extension. + */ + extensions?: string[] | null; + /** + * If true is present, the eslint.lintFiles() and eslint.lintText() methods work in autofix mode. + * If a predicate function is present, the methods pass each lint message to the function, then use only the + * lint messages for which the function returned true. + */ + fix?: boolean | ((message: LintMessage) => boolean); + /** + * The types of the rules that the eslint.lintFiles() and eslint.lintText() methods use for autofix. + */ + fixTypes?: string[]; + /** + * If false is present, the eslint.lintFiles() method doesn't interpret glob patterns. + */ + globInputPaths?: boolean; + /** + * If false is present, the eslint.lintFiles() method doesn't respect `.eslintignore` files or ignorePatterns in + * your configuration. + */ + ignore?: boolean; + /** + * The path to a file ESLint uses instead of `$CWD/.eslintignore`. + * If a path is present and the file doesn't exist, this constructor will throw an error. + */ + ignorePath?: string; + /** + * Configuration object, overrides all configurations used with this instance. + * You can use this option to define the settings that will be used even if your configuration files configure it. + */ + overrideConfig?: Linter.ConfigOverride | null; + /** + * The path to a configuration file, overrides all configurations used with this instance. + * The options.overrideConfig option is applied after this option is applied. + */ + overrideConfigFile?: string | null; + /** + * The plugin implementations that ESLint uses for the plugins setting of your configuration. + * This is a map-like object. Those keys are plugin IDs and each value is implementation. + */ + plugins?: Record | null; + /** + * The severity to report unused eslint-disable directives. + * If this option is a severity, it overrides the reportUnusedDisableDirectives setting in your configurations. + */ + reportUnusedDisableDirectives?: Linter.SeverityString | null; + /** + * The path to a directory where plugins should be resolved from. + * If null is present, ESLint loads plugins from the location of the configuration file that contains the plugin + * setting. + * If a path is present, ESLint loads all plugins from there. + */ + resolvePluginsRelativeTo?: string | null; + /** + * An array of paths to directories to load custom rules from. + */ + rulePaths?: string[]; + /** + * If false is present, ESLint doesn't load configuration files (.eslintrc.* files). + * Only the configuration of the constructor options is valid. + */ + useEslintrc?: boolean; + } + interface DeprecatedRuleInfo { + /** + * The rule ID. + */ + ruleId: string; + /** + * The rule IDs that replace this deprecated rule. + */ + replacedBy: string[]; + } + /** + * The LintResult value is the information of the linting result of each file. + */ + interface LintResult { + /** + * The number of errors. This includes fixable errors. + */ + errorCount: number; + /** + * The absolute path to the file of this result. This is the string "" if the file path is unknown (when you + * didn't pass the options.filePath option to the eslint.lintText() method). + */ + filePath: string; + /** + * The number of errors that can be fixed automatically by the fix constructor option. + */ + fixableErrorCount: number; + /** + * The number of warnings that can be fixed automatically by the fix constructor option. + */ + fixableWarningCount: number; + /** + * The array of LintMessage objects. + */ + messages: Linter.LintMessage[]; + /** + * The source code of the file that was linted, with as many fixes applied as possible. + */ + output?: string; + /** + * The original source code text. This property is undefined if any messages didn't exist or the output + * property exists. + */ + source?: string; + /** + * The information about the deprecated rules that were used to check this file. + */ + usedDeprecatedRules: DeprecatedRuleInfo[]; + /** + * The number of warnings. This includes fixable warnings. + */ + warningCount: number; + } + interface LintTextOptions { + /** + * The path to the file of the source code text. If omitted, the result.filePath becomes the string "". + */ + filePath?: string; + /** + * If true is present and the options.filePath is a file ESLint should ignore, this method returns a lint result + * contains a warning message. + */ + warnIgnored?: boolean; + } + /** + * The LintMessage value is the information of each linting error. + */ + interface LintMessage { + /** + * The 1-based column number of the begin point of this message. + */ + column: number; + /** + * The 1-based column number of the end point of this message. This property is undefined if this message + * is not a range. + */ + endColumn: number | undefined; + /** + * The 1-based line number of the end point of this message. This property is undefined if this + * message is not a range. + */ + endLine: number | undefined; + /** + * The EditInfo object of autofix. This property is undefined if this message is not fixable. + */ + fix: EditInfo | undefined; + /** + * The 1-based line number of the begin point of this message. + */ + line: number; + /** + * The error message + */ + message: string; + /** + * The rule name that generates this lint message. If this message is generated by the ESLint core rather than + * rules, this is null. + */ + ruleId: string | null; + /** + * The severity of this message. 1 means warning and 2 means error. + */ + severity: 1 | 2; + /** + * The list of suggestions. Each suggestion is the pair of a description and an EditInfo object to fix code. API + * users such as editor integrations can choose one of them to fix the problem of this message. This property is + * undefined if this message doesn't have any suggestions. + */ + suggestions: { + desc: string; + fix: EditInfo; + }[] | undefined; + } + /** + * The EditInfo value is information to edit text. + * + * This edit information means replacing the range of the range property by the text property value. It's like + * sourceCodeText.slice(0, edit.range[0]) + edit.text + sourceCodeText.slice(edit.range[1]). Therefore, it's an add + * if the range[0] and range[1] property values are the same value, and it's removal if the text property value is + * empty string. + */ + interface EditInfo { + /** + * The pair of 0-based indices in source code text to remove. + */ + range: [number, number]; + /** + * The text to add. + */ + text: string; + } + /** + * The Formatter value is the object to convert the LintResult objects to text. + */ + interface Formatter { + /** + * The method to convert the LintResult objects to text + */ + format(results: LintResult[]): string; + } +} +declare const _ESLint: typeof ESLintBase; +/** + * The ESLint class is the primary class to use in Node.js applications. + * This class depends on the Node.js fs module and the file system, so you cannot use it in browsers. + * + * If you want to lint code on browsers, use the Linter class instead. + * + * @since 7.0.0 + */ +declare class ESLint extends _ESLint { +} +export { ESLint }; +//# sourceMappingURL=ESLint.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ESLint.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ESLint.d.ts.map new file mode 100644 index 000000000..8a60f43e8 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ESLint.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ESLint.d.ts","sourceRoot":"","sources":["../../src/ts-e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UAAiB,SAAS;QACxB;;WAEG;QACH,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;KACvC;CACF;AAKD,QAAA,MAAM,OAAO,mBAKY,CAAC;AAE1B;;;;;;;GAOG;AACH,cAAM,MAAO,SAAQ,OAAO;CAAG;AAE/B,OAAO,EAAE,MAAM,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ESLint.js b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ESLint.js new file mode 100644 index 000000000..5b5099692 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ESLint.js @@ -0,0 +1,23 @@ +"use strict"; +/* eslint-disable @typescript-eslint/no-namespace */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ESLint = void 0; +const eslint_1 = require("eslint"); +// We want to export this class always so it's easy for end users to consume. +// However on ESLint v6, this class will not exist, so we provide a fallback to make it clear +// The only users of this should be users scripting ESLint locally, so _they_ should have the correct version installed. +const _ESLint = (eslint_1.ESLint !== null && eslint_1.ESLint !== void 0 ? eslint_1.ESLint : function () { + throw new Error('Attempted to construct an ESLint instance on less than ESLint v7.0.0'); +}); +/** + * The ESLint class is the primary class to use in Node.js applications. + * This class depends on the Node.js fs module and the file system, so you cannot use it in browsers. + * + * If you want to lint code on browsers, use the Linter class instead. + * + * @since 7.0.0 + */ +class ESLint extends _ESLint { +} +exports.ESLint = ESLint; +//# sourceMappingURL=ESLint.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ESLint.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ESLint.js.map new file mode 100644 index 000000000..50e070389 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ESLint.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ESLint.js","sourceRoot":"","sources":["../../src/ts-eslint/ESLint.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAEpD,mCAAgD;AAqVhD,6EAA6E;AAC7E,6FAA6F;AAC7F,wHAAwH;AACxH,MAAM,OAAO,GAAG,CAAC,eAAY,aAAZ,eAAY,cAAZ,eAAY,GAC3B;IACE,MAAM,IAAI,KAAK,CACb,sEAAsE,CACvE,CAAC;AACJ,CAAC,CAAsB,CAAC;AAE1B;;;;;;;GAOG;AACH,MAAM,MAAO,SAAQ,OAAO;CAAG;AAEtB,wBAAM"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Linter.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Linter.d.ts new file mode 100644 index 000000000..248e8fb2f --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Linter.d.ts @@ -0,0 +1,324 @@ +import { TSESTree, ParserServices } from '../ts-estree'; +import { ParserOptions as TSParserOptions } from './ParserOptions'; +import { RuleCreateFunction, RuleFix, RuleModule } from './Rule'; +import { Scope } from './Scope'; +import { SourceCode } from './SourceCode'; +declare class LinterBase { + /** + * Initialize the Linter. + * @param config the config object + */ + constructor(config?: Linter.LinterOptions); + /** + * Define a new parser module + * @param parserId Name of the parser + * @param parserModule The parser object + */ + defineParser(parserId: string, parserModule: Linter.ParserModule): void; + /** + * Defines a new linting rule. + * @param ruleId A unique rule identifier + * @param ruleModule Function from context to object mapping AST node types to event handlers + */ + defineRule(ruleId: string, ruleModule: RuleModule | RuleCreateFunction): void; + /** + * Defines many new linting rules. + * @param rulesToDefine map from unique rule identifier to rule + */ + defineRules(rulesToDefine: Record | RuleCreateFunction>): void; + /** + * Gets an object with all loaded rules. + * @returns All loaded rules + */ + getRules(): Map>; + /** + * Gets the `SourceCode` object representing the parsed source. + * @returns The `SourceCode` object. + */ + getSourceCode(): SourceCode; + /** + * Verifies the text against the rules specified by the second argument. + * @param textOrSourceCode The text to parse or a SourceCode object. + * @param config An ESLintConfig instance to configure everything. + * @param filenameOrOptions The optional filename of the file being checked. + * If this is not set, the filename will default to '' in the rule context. + * If this is an object, then it has "filename", "allowInlineConfig", and some properties. + * @returns The results as an array of messages or an empty array if no messages. + */ + verify(textOrSourceCode: SourceCode | string, config: Linter.Config, filenameOrOptions?: string | Linter.VerifyOptions): Linter.LintMessage[]; + /** + * Performs multiple autofix passes over the text until as many fixes as possible have been applied. + * @param text The source text to apply fixes to. + * @param config The ESLint config object to use. + * @param options The ESLint options object to use. + * @returns The result of the fix operation as returned from the SourceCodeFixer. + */ + verifyAndFix(code: string, config: Linter.Config, options: Linter.FixOptions): Linter.FixReport; + /** + * The version from package.json. + */ + readonly version: string; + /** + * The version from package.json. + */ + static readonly version: string; +} +declare namespace Linter { + export interface LinterOptions { + /** + * path to a directory that should be considered as the current working directory. + */ + cwd?: string; + } + export type Severity = 0 | 1 | 2; + export type SeverityString = 'off' | 'warn' | 'error'; + export type RuleLevel = Severity | SeverityString; + export type RuleLevelAndOptions = [RuleLevel, ...unknown[]]; + export type RuleEntry = RuleLevel | RuleLevelAndOptions; + export type RulesRecord = Partial>; + interface BaseConfig { + $schema?: string; + /** + * The environment settings. + */ + env?: { + [name: string]: boolean; + }; + /** + * The path to other config files or the package name of shareable configs. + */ + extends?: string | string[]; + /** + * The global variable settings. + */ + globals?: { + [name: string]: boolean; + }; + /** + * The flag that disables directive comments. + */ + noInlineConfig?: boolean; + /** + * The override settings per kind of files. + */ + overrides?: ConfigOverride[]; + /** + * The path to a parser or the package name of a parser. + */ + parser?: string; + /** + * The parser options. + */ + parserOptions?: ParserOptions; + /** + * The plugin specifiers. + */ + plugins?: string[]; + /** + * The processor specifier. + */ + processor?: string; + /** + * The flag to report unused `eslint-disable` comments. + */ + reportUnusedDisableDirectives?: boolean; + /** + * The rule settings. + */ + rules?: RulesRecord; + /** + * The shared settings. + */ + settings?: { + [name: string]: unknown; + }; + } + export interface ConfigOverride extends BaseConfig { + excludedFiles?: string | string[]; + files: string | string[]; + } + export interface Config extends BaseConfig { + /** + * The glob patterns that ignore to lint. + */ + ignorePatterns?: string | string[]; + /** + * The root flag. + */ + root?: boolean; + } + export type ParserOptions = TSParserOptions; + export interface VerifyOptions { + /** + * Allow/disallow inline comments' ability to change config once it is set. Defaults to true if not supplied. + * Useful if you want to validate JS without comments overriding rules. + */ + allowInlineConfig?: boolean; + /** + * if `true` then the linter doesn't make `fix` properties into the lint result. + */ + disableFixes?: boolean; + /** + * the filename of the source code. + */ + filename?: string; + /** + * the predicate function that selects adopt code blocks. + */ + filterCodeBlock?: (filename: string, text: string) => boolean; + /** + * postprocessor for report messages. + * If provided, this should accept an array of the message lists + * for each code block returned from the preprocessor, apply a mapping to + * the messages as appropriate, and return a one-dimensional array of + * messages. + */ + postprocess?: Processor['postprocess']; + /** + * preprocessor for source text. + * If provided, this should accept a string of source text, and return an array of code blocks to lint. + */ + preprocess?: Processor['preprocess']; + /** + * Adds reported errors for unused `eslint-disable` directives. + */ + reportUnusedDisableDirectives?: boolean | SeverityString; + } + export interface FixOptions extends VerifyOptions { + /** + * Determines whether fixes should be applied. + */ + fix?: boolean; + } + export interface LintSuggestion { + desc: string; + fix: RuleFix; + messageId?: string; + } + export interface LintMessage { + /** + * The 1-based column number. + */ + column: number; + /** + * The 1-based column number of the end location. + */ + endColumn?: number; + /** + * The 1-based line number of the end location. + */ + endLine?: number; + /** + * If `true` then this is a fatal error. + */ + fatal?: true; + /** + * Information for autofix. + */ + fix?: RuleFix; + /** + * The 1-based line number. + */ + line: number; + /** + * The error message. + */ + message: string; + messageId?: string; + nodeType: string; + /** + * The ID of the rule which makes this message. + */ + ruleId: string | null; + /** + * The severity of this message. + */ + severity: Severity; + source: string | null; + /** + * Information for suggestions + */ + suggestions?: LintSuggestion[]; + } + export interface FixReport { + /** + * True, if the code was fixed + */ + fixed: boolean; + /** + * Fixed code text (might be the same as input if no fixes were applied). + */ + output: string; + /** + * Collection of all messages for the given code + */ + messages: LintMessage[]; + } + export type ParserModule = { + parse(text: string, options?: ParserOptions): TSESTree.Program; + } | { + parseForESLint(text: string, options?: ParserOptions): ESLintParseResult; + }; + export interface ESLintParseResult { + ast: TSESTree.Program; + parserServices?: ParserServices; + scopeManager?: Scope.ScopeManager; + visitorKeys?: SourceCode.VisitorKeys; + } + export interface Processor { + /** + * The function to extract code blocks. + */ + preprocess?: (text: string, filename: string) => Array; + /** + * The function to merge messages. + */ + postprocess?: (messagesList: Linter.LintMessage[][], filename: string) => Linter.LintMessage[]; + /** + * If `true` then it means the processor supports autofix. + */ + supportsAutofix?: boolean; + } + export interface Environment { + /** + * The definition of global variables. + */ + globals?: Record; + /** + * The parser options that will be enabled under this environment. + */ + parserOptions?: ParserOptions; + } + export interface Plugin { + /** + * The definition of plugin configs. + */ + configs?: Record; + /** + * The definition of plugin environments. + */ + environments?: Record; + /** + * The definition of plugin processors. + */ + processors?: Record; + /** + * The definition of plugin rules. + */ + rules?: Record>; + } + export {}; +} +declare const Linter_base: typeof LinterBase; +/** + * The Linter object does the actual evaluation of the JavaScript code. It doesn't do any filesystem operations, it + * simply parses and reports on the code. In particular, the Linter object does not process configuration objects + * or files. + */ +declare class Linter extends Linter_base { +} +export { Linter }; +//# sourceMappingURL=Linter.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Linter.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Linter.d.ts.map new file mode 100644 index 000000000..5c2bc13e0 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Linter.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Linter.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/Linter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,aAAa,IAAI,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACj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EAAE,CACX,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,KACb,KAAK,CAAC,MAAM,GAAG;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QACxD;;WAEG;QACH,WAAW,CAAC,EAAE,CACZ,YAAY,EAAE,MAAM,CAAC,WAAW,EAAE,EAAE,EACpC,QAAQ,EAAE,MAAM,KACb,MAAM,CAAC,WAAW,EAAE,CAAC;QAC1B;;WAEG;QACH,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B;IAED,MAAM,WAAW,WAAW;QAC1B;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QACxC;;WAEG;QACH,aAAa,CAAC,EAAE,aAAa,CAAC;KAC/B;IAED,MAAM,WAAW,MAAM;QACrB;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QACxC;;WAEG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QAC3C;;WAEG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QACvC;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;KAC5E;;CACF;;AAED;;;;GAIG;AACH,cAAM,MAAO,SAAQ,WAAmC;CAAG;AAE3D,OAAO,EAAE,MAAM,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Linter.js b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Linter.js new file mode 100644 index 000000000..4fd16f1bf --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Linter.js @@ -0,0 +1,14 @@ +"use strict"; +/* eslint-disable @typescript-eslint/no-namespace */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Linter = void 0; +const eslint_1 = require("eslint"); +/** + * The Linter object does the actual evaluation of the JavaScript code. It doesn't do any filesystem operations, it + * simply parses and reports on the code. In particular, the Linter object does not process configuration objects + * or files. + */ +class Linter extends eslint_1.Linter { +} +exports.Linter = Linter; +//# sourceMappingURL=Linter.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Linter.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Linter.js.map new file mode 100644 index 000000000..8c8e207d1 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Linter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Linter.js","sourceRoot":"","sources":["../../src/ts-eslint/Linter.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAEpD,mCAAgD;AA8WhD;;;;GAIG;AACH,MAAM,MAAO,SAAS,eAAkC;CAAG;AAElD,wBAAM"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ParserOptions.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ParserOptions.d.ts new file mode 100644 index 000000000..d864322bd --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ParserOptions.d.ts @@ -0,0 +1,2 @@ +export { DebugLevel, EcmaVersion, ParserOptions, SourceType, } from '@typescript-eslint/types'; +//# sourceMappingURL=ParserOptions.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ParserOptions.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ParserOptions.d.ts.map new file mode 100644 index 000000000..33c6d0e00 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ParserOptions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ParserOptions.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/ParserOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,WAAW,EACX,aAAa,EACb,UAAU,GACX,MAAM,0BAA0B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ParserOptions.js b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ParserOptions.js new file mode 100644 index 000000000..40b03dd57 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ParserOptions.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=ParserOptions.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ParserOptions.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ParserOptions.js.map new file mode 100644 index 000000000..7bd7a94c5 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/ParserOptions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ParserOptions.js","sourceRoot":"","sources":["../../src/ts-eslint/ParserOptions.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Rule.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Rule.d.ts new file mode 100644 index 000000000..66a65991c --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Rule.d.ts @@ -0,0 +1,369 @@ +import { JSONSchema4 } from '../json-schema'; +import { ParserServices, TSESTree } from '../ts-estree'; +import { AST } from './AST'; +import { Linter } from './Linter'; +import { Scope } from './Scope'; +import { SourceCode } from './SourceCode'; +interface RuleMetaDataDocs { + /** + * The general category the rule falls within + */ + category: 'Best Practices' | 'Stylistic Issues' | 'Variables' | 'Possible Errors'; + /** + * Concise description of the rule + */ + description: string; + /** + * The recommendation level for the rule. + * Used by the build tools to generate the recommended config. + * Set to false to not include it as a recommendation + */ + recommended: 'error' | 'warn' | false; + /** + * The URL of the rule's docs + */ + url: string; + /** + * Specifies whether the rule can return suggestions. + */ + suggestion?: boolean; + /** + * Does the rule require us to create a full TypeScript Program in order for it + * to type-check code. This is only used for documentation purposes. + */ + requiresTypeChecking?: boolean; + /** + * Does the rule extend (or is it based off of) an ESLint code rule? + * Alternately accepts the name of the base rule, in case the rule has been renamed. + * This is only used for documentation purposes. + */ + extendsBaseRule?: boolean | string; +} +interface RuleMetaData { + /** + * True if the rule is deprecated, false otherwise + */ + deprecated?: boolean; + /** + * Documentation for the rule, unnecessary for custom rules/plugins + */ + docs?: RuleMetaDataDocs; + /** + * The fixer category. Omit if there is no fixer + */ + fixable?: 'code' | 'whitespace'; + /** + * A map of messages which the rule can report. + * The key is the messageId, and the string is the parameterised error string. + * See: https://eslint.org/docs/developer-guide/working-with-rules#messageids + */ + messages: Record; + /** + * The type of rule. + * - `"problem"` means the rule is identifying code that either will cause an error or may cause a confusing behavior. Developers should consider this a high priority to resolve. + * - `"suggestion"` means the rule is identifying something that could be done in a better way but no errors will occur if the code isn’t changed. + * - `"layout"` means the rule cares primarily about whitespace, semicolons, commas, and parentheses, all the parts of the program that determine how the code looks rather than how it executes. These rules work on parts of the code that aren’t specified in the AST. + */ + type: 'suggestion' | 'problem' | 'layout'; + /** + * The name of the rule this rule was replaced by, if it was deprecated. + */ + replacedBy?: string[]; + /** + * The options schema. Supply an empty array if there are no options. + */ + schema: JSONSchema4 | JSONSchema4[]; +} +interface RuleFix { + range: AST.Range; + text: string; +} +interface RuleFixer { + insertTextAfter(nodeOrToken: TSESTree.Node | TSESTree.Token, text: string): RuleFix; + insertTextAfterRange(range: AST.Range, text: string): RuleFix; + insertTextBefore(nodeOrToken: TSESTree.Node | TSESTree.Token, text: string): RuleFix; + insertTextBeforeRange(range: AST.Range, text: string): RuleFix; + remove(nodeOrToken: TSESTree.Node | TSESTree.Token): RuleFix; + removeRange(range: AST.Range): RuleFix; + replaceText(nodeOrToken: TSESTree.Node | TSESTree.Token, text: string): RuleFix; + replaceTextRange(range: AST.Range, text: string): RuleFix; +} +declare type ReportFixFunction = (fixer: RuleFixer) => null | RuleFix | RuleFix[] | IterableIterator; +declare type ReportSuggestionArray = ReportDescriptorBase[]; +interface ReportDescriptorBase { + /** + * The parameters for the message string associated with `messageId`. + */ + readonly data?: Readonly>; + /** + * The fixer function. + */ + readonly fix?: ReportFixFunction | null; + /** + * The messageId which is being reported. + */ + readonly messageId: TMessageIds; +} +interface ReportDescriptorWithSuggestion extends ReportDescriptorBase { + /** + * 6.7's Suggestions API + */ + readonly suggest?: Readonly> | null; +} +interface ReportDescriptorNodeOptionalLoc { + /** + * The Node or AST Token which the report is being attached to + */ + readonly node: TSESTree.Node | TSESTree.Comment | TSESTree.Token; + /** + * An override of the location of the report + */ + readonly loc?: Readonly | Readonly; +} +interface ReportDescriptorLocOnly { + /** + * An override of the location of the report + */ + loc: Readonly | Readonly; +} +declare type ReportDescriptor = ReportDescriptorWithSuggestion & (ReportDescriptorNodeOptionalLoc | ReportDescriptorLocOnly); +interface RuleContext { + /** + * The rule ID. + */ + id: string; + /** + * An array of the configured options for this rule. + * This array does not include the rule severity. + */ + options: TOptions; + /** + * The name of the parser from configuration. + */ + parserPath: string; + /** + * The parser options configured for this run + */ + parserOptions: Linter.ParserOptions; + /** + * An object containing parser-provided services for rules + */ + parserServices?: ParserServices; + /** + * The shared settings from configuration. + * We do not have any shared settings in this plugin. + */ + settings: Record; + /** + * Returns an array of the ancestors of the currently-traversed node, starting at + * the root of the AST and continuing through the direct parent of the current node. + * This array does not include the currently-traversed node itself. + */ + getAncestors(): TSESTree.Node[]; + /** + * Returns a list of variables declared by the given node. + * This information can be used to track references to variables. + */ + getDeclaredVariables(node: TSESTree.Node): Scope.Variable[]; + /** + * Returns the filename associated with the source. + */ + getFilename(): string; + /** + * Returns the scope of the currently-traversed node. + * This information can be used track references to variables. + */ + getScope(): Scope.Scope; + /** + * Returns a SourceCode object that you can use to work with the source that + * was passed to ESLint. + */ + getSourceCode(): Readonly; + /** + * Marks a variable with the given name in the current scope as used. + * This affects the no-unused-vars rule. + */ + markVariableAsUsed(name: string): boolean; + /** + * Reports a problem in the code. + */ + report(descriptor: ReportDescriptor): void; +} +declare type RuleFunction = (node: T) => void; +interface RuleListener { + [nodeSelector: string]: RuleFunction | undefined; + ArrayExpression?: RuleFunction; + ArrayPattern?: RuleFunction; + ArrowFunctionExpression?: RuleFunction; + AssignmentPattern?: RuleFunction; + AssignmentExpression?: RuleFunction; + AwaitExpression?: RuleFunction; + BigIntLiteral?: RuleFunction; + BinaryExpression?: RuleFunction; + BlockStatement?: RuleFunction; + BreakStatement?: RuleFunction; + CallExpression?: RuleFunction; + CatchClause?: RuleFunction; + ChainExpression?: RuleFunction; + ClassBody?: RuleFunction; + ClassDeclaration?: RuleFunction; + ClassExpression?: RuleFunction; + ClassProperty?: RuleFunction; + Comment?: RuleFunction; + ConditionalExpression?: RuleFunction; + ContinueStatement?: RuleFunction; + DebuggerStatement?: RuleFunction; + Decorator?: RuleFunction; + DoWhileStatement?: RuleFunction; + EmptyStatement?: RuleFunction; + ExportAllDeclaration?: RuleFunction; + ExportDefaultDeclaration?: RuleFunction; + ExportNamedDeclaration?: RuleFunction; + ExportSpecifier?: RuleFunction; + ExpressionStatement?: RuleFunction; + ForInStatement?: RuleFunction; + ForOfStatement?: RuleFunction; + ForStatement?: RuleFunction; + FunctionDeclaration?: RuleFunction; + FunctionExpression?: RuleFunction; + Identifier?: RuleFunction; + IfStatement?: RuleFunction; + ImportDeclaration?: RuleFunction; + ImportDefaultSpecifier?: RuleFunction; + ImportExpression?: RuleFunction; + ImportNamespaceSpecifier?: RuleFunction; + ImportSpecifier?: RuleFunction; + JSXAttribute?: RuleFunction; + JSXClosingElement?: RuleFunction; + JSXClosingFragment?: RuleFunction; + JSXElement?: RuleFunction; + JSXEmptyExpression?: RuleFunction; + JSXExpressionContainer?: RuleFunction; + JSXFragment?: RuleFunction; + JSXIdentifier?: RuleFunction; + JSXMemberExpression?: RuleFunction; + JSXOpeningElement?: RuleFunction; + JSXOpeningFragment?: RuleFunction; + JSXSpreadAttribute?: RuleFunction; + JSXSpreadChild?: RuleFunction; + JSXText?: RuleFunction; + LabeledStatement?: RuleFunction; + Literal?: RuleFunction; + LogicalExpression?: RuleFunction; + MemberExpression?: RuleFunction; + MetaProperty?: RuleFunction; + MethodDefinition?: RuleFunction; + NewExpression?: RuleFunction; + ObjectExpression?: RuleFunction; + ObjectPattern?: RuleFunction; + Program?: RuleFunction; + Property?: RuleFunction; + RestElement?: RuleFunction; + ReturnStatement?: RuleFunction; + SequenceExpression?: RuleFunction; + SpreadElement?: RuleFunction; + Super?: RuleFunction; + SwitchCase?: RuleFunction; + SwitchStatement?: RuleFunction; + TaggedTemplateExpression?: RuleFunction; + TemplateElement?: RuleFunction; + TemplateLiteral?: RuleFunction; + ThisExpression?: RuleFunction; + ThrowStatement?: RuleFunction; + Token?: RuleFunction; + TryStatement?: RuleFunction; + TSAbstractClassProperty?: RuleFunction; + TSAbstractKeyword?: RuleFunction; + TSAbstractMethodDefinition?: RuleFunction; + TSAnyKeyword?: RuleFunction; + TSArrayType?: RuleFunction; + TSAsExpression?: RuleFunction; + TSAsyncKeyword?: RuleFunction; + TSBigIntKeyword?: RuleFunction; + TSBooleanKeyword?: RuleFunction; + TSCallSignatureDeclaration?: RuleFunction; + TSClassImplements?: RuleFunction; + TSConditionalType?: RuleFunction; + TSConstructorType?: RuleFunction; + TSConstructSignatureDeclaration?: RuleFunction; + TSDeclareKeyword?: RuleFunction; + TSDeclareFunction?: RuleFunction; + TSEmptyBodyFunctionExpression?: RuleFunction; + TSEnumDeclaration?: RuleFunction; + TSEnumMember?: RuleFunction; + TSExportAssignment?: RuleFunction; + TSExportKeyword?: RuleFunction; + TSExternalModuleReference?: RuleFunction; + TSFunctionType?: RuleFunction; + TSImportEqualsDeclaration?: RuleFunction; + TSImportType?: RuleFunction; + TSIndexedAccessType?: RuleFunction; + TSIndexSignature?: RuleFunction; + TSInferType?: RuleFunction; + TSInterfaceBody?: RuleFunction; + TSInterfaceDeclaration?: RuleFunction; + TSInterfaceHeritage?: RuleFunction; + TSIntersectionType?: RuleFunction; + TSLiteralType?: RuleFunction; + TSMappedType?: RuleFunction; + TSMethodSignature?: RuleFunction; + TSModuleBlock?: RuleFunction; + TSModuleDeclaration?: RuleFunction; + TSNamespaceExportDeclaration?: RuleFunction; + TSNeverKeyword?: RuleFunction; + TSNonNullExpression?: RuleFunction; + TSNullKeyword?: RuleFunction; + TSNumberKeyword?: RuleFunction; + TSObjectKeyword?: RuleFunction; + TSOptionalType?: RuleFunction; + TSParameterProperty?: RuleFunction; + TSParenthesizedType?: RuleFunction; + TSPrivateKeyword?: RuleFunction; + TSPropertySignature?: RuleFunction; + TSProtectedKeyword?: RuleFunction; + TSPublicKeyword?: RuleFunction; + TSQualifiedName?: RuleFunction; + TSReadonlyKeyword?: RuleFunction; + TSRestType?: RuleFunction; + TSStaticKeyword?: RuleFunction; + TSStringKeyword?: RuleFunction; + TSSymbolKeyword?: RuleFunction; + TSThisType?: RuleFunction; + TSTupleType?: RuleFunction; + TSTypeAliasDeclaration?: RuleFunction; + TSTypeAnnotation?: RuleFunction; + TSTypeAssertion?: RuleFunction; + TSTypeLiteral?: RuleFunction; + TSTypeOperator?: RuleFunction; + TSTypeParameter?: RuleFunction; + TSTypeParameterDeclaration?: RuleFunction; + TSTypeParameterInstantiation?: RuleFunction; + TSTypePredicate?: RuleFunction; + TSTypeQuery?: RuleFunction; + TSTypeReference?: RuleFunction; + TSUndefinedKeyword?: RuleFunction; + TSUnionType?: RuleFunction; + TSUnknownKeyword?: RuleFunction; + TSVoidKeyword?: RuleFunction; + UnaryExpression?: RuleFunction; + UpdateExpression?: RuleFunction; + VariableDeclaration?: RuleFunction; + VariableDeclarator?: RuleFunction; + WhileStatement?: RuleFunction; + WithStatement?: RuleFunction; + YieldExpression?: RuleFunction; +} +interface RuleModule { + /** + * Metadata about the rule + */ + meta: RuleMetaData; + /** + * Function which returns an object with methods that ESLint calls to “visit” + * nodes while traversing the abstract syntax tree. + */ + create(context: Readonly>): TRuleListener; +} +declare type RuleCreateFunction = (context: Readonly>) => RuleListener; +export { ReportDescriptor, ReportFixFunction, ReportSuggestionArray, RuleContext, RuleCreateFunction, RuleFix, RuleFixer, RuleFunction, RuleListener, RuleMetaData, RuleMetaDataDocs, RuleModule, }; +//# sourceMappingURL=Rule.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Rule.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Rule.d.ts.map new file mode 100644 index 000000000..0e858f841 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Rule.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Rule.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/Rule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,UAAU,gBAAgB;IACxB;;OAEG;IACH,QAAQ,EACJ,gBAAgB,GAChB,kBAAkB,GAClB,WAAW,GACX,iBAAiB,CAAC;IACtB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,WAAW,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;IACtC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;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,YAAY,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IAC/D,cAAc,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IACvD,aAAa,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IACrD,eAAe,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;CAC1D;AAED,UAAU,UAAU,CAClB,WAAW,SAAS,MAAM,EAC1B,QAAQ,SAAS,SAAS,OAAO,EAAE,EAEnC,aAAa,SAAS,YAAY,GAAG,YAAY;IAEjD;;OAEG;IACH,IAAI,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IAEhC;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,WAAW,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,GAAG,aAAa,CAAC;CAC9E;AAED,aAAK,kBAAkB,GAAG,CACxB,OAAO,EAAE,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,KAC7C,YAAY,CAAC;AAElB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,WAAW,EACX,kBAAkB,EAClB,OAAO,EACP,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,UAAU,GACX,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Rule.js b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Rule.js new file mode 100644 index 000000000..8113a7ebd --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Rule.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=Rule.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Rule.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Rule.js.map new file mode 100644 index 000000000..88c1f0378 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Rule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Rule.js","sourceRoot":"","sources":["../../src/ts-eslint/Rule.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/RuleTester.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/RuleTester.d.ts new file mode 100644 index 000000000..22765608c --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/RuleTester.d.ts @@ -0,0 +1,137 @@ +import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '../ts-estree'; +import { ParserOptions } from './ParserOptions'; +import { RuleModule } from './Rule'; +interface ValidTestCase> { + /** + * Code for the test case. + */ + readonly code: string; + /** + * Environments for the test case. + */ + readonly env?: Readonly>; + /** + * The fake filename for the test case. Useful for rules that make assertion about filenames. + */ + readonly filename?: string; + /** + * The additional global variables. + */ + readonly globals?: Record; + /** + * Options for the test case. + */ + readonly options?: Readonly; + /** + * The absolute path for the parser. + */ + readonly parser?: string; + /** + * Options for the parser. + */ + readonly parserOptions?: Readonly; + /** + * Settings for the test case. + */ + readonly settings?: Readonly>; +} +interface SuggestionOutput { + /** + * Reported message ID. + */ + readonly messageId: TMessageIds; + /** + * The data used to fill the message template. + */ + readonly data?: Readonly>; + /** + * NOTE: Suggestions will be applied as a stand-alone change, without triggering multi-pass fixes. + * Each individual error has its own suggestion, so you have to show the correct, _isolated_ output for each suggestion. + */ + readonly output: string; +} +interface InvalidTestCase> extends ValidTestCase { + /** + * Expected errors. + */ + readonly errors: TestCaseError[]; + /** + * The expected code after autofixes are applied. If set to `null`, the test runner will assert that no autofix is suggested. + */ + readonly output?: string | null; +} +interface TestCaseError { + /** + * The 1-based column number of the reported start location. + */ + readonly column?: number; + /** + * The data used to fill the message template. + */ + readonly data?: Readonly>; + /** + * The 1-based column number of the reported end location. + */ + readonly endColumn?: number; + /** + * The 1-based line number of the reported end location. + */ + readonly endLine?: number; + /** + * The 1-based line number of the reported start location. + */ + readonly line?: number; + /** + * Reported message ID. + */ + readonly messageId: TMessageIds; + /** + * Reported suggestions. + */ + readonly suggestions?: SuggestionOutput[] | null; + /** + * The type of the reported AST node. + */ + readonly type?: AST_NODE_TYPES | AST_TOKEN_TYPES; +} +interface RunTests> { + readonly valid: (ValidTestCase | string)[]; + readonly invalid: InvalidTestCase[]; +} +interface RuleTesterConfig { + readonly parser: string; + readonly parserOptions?: Readonly; +} +declare class RuleTesterBase { + /** + * Creates a new instance of RuleTester. + * @param testerConfig extra configuration for the tester + */ + constructor(testerConfig?: RuleTesterConfig); + /** + * Adds a new rule test to execute. + * @param ruleName The name of the rule to run. + * @param rule The rule to test. + * @param test The collection of tests to run. + */ + run>(ruleName: string, rule: RuleModule, tests: RunTests): void; + /** + * If you supply a value to this property, the rule tester will call this instead of using the version defined on + * the global namespace. + * @param text a string describing the rule + * @param callback the test callback + */ + static describe?: (text: string, callback: () => void) => void; + /** + * If you supply a value to this property, the rule tester will call this instead of using the version defined on + * the global namespace. + * @param text a string describing the test case + * @param callback the test callback + */ + static it?: (text: string, callback: () => void) => void; +} +declare const RuleTester_base: typeof RuleTesterBase; +declare class RuleTester extends RuleTester_base { +} +export { InvalidTestCase, SuggestionOutput, RuleTester, RuleTesterConfig, RunTests, TestCaseError, ValidTestCase, }; +//# sourceMappingURL=RuleTester.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/RuleTester.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/RuleTester.d.ts.map new file mode 100644 index 000000000..045a474f6 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/RuleTester.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RuleTester.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/RuleTester.ts"],"names":[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C;IACxB,QAAQ,CAAC,aAAa,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;CAClD;AAED,OAAO,OAAO,cAAc;IAC1B;;;OAGG;gBACS,YAAY,CAAC,EAAE,gBAAgB;IAE3C;;;;;OAKG;IACH,GAAG,CAAC,WAAW,SAAS,MAAM,EAAE,QAAQ,SAAS,QAAQ,CAAC,OAAO,EAAE,CAAC,EAClE,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,UAAU,CAAC,WAAW,EAAE,QAAQ,CAAC,EACvC,KAAK,EAAE,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,GACrC,IAAI;IAEP;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IAE/D;;;;;OAKG;IACH,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;CAC1D;;AAED,cAAM,UAAW,SAAQ,eAA2C;CAAG;AAEvE,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,aAAa,EACb,aAAa,GACd,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/RuleTester.js b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/RuleTester.js new file mode 100644 index 000000000..f31d0a677 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/RuleTester.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RuleTester = void 0; +const eslint_1 = require("eslint"); +class RuleTester extends eslint_1.RuleTester { +} +exports.RuleTester = RuleTester; +//# sourceMappingURL=RuleTester.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/RuleTester.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/RuleTester.js.map new file mode 100644 index 000000000..4fe5fc649 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/RuleTester.js.map @@ -0,0 +1 @@ +{"version":3,"file":"RuleTester.js","sourceRoot":"","sources":["../../src/ts-eslint/RuleTester.ts"],"names":[],"mappings":";;;AAAA,mCAAwD;AAiKxD,MAAM,UAAW,SAAS,mBAA0C;CAAG;AAKrE,gCAAU"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Scope.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Scope.d.ts new file mode 100644 index 000000000..004dec4a1 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Scope.d.ts @@ -0,0 +1,44 @@ +import * as scopeManager from '@typescript-eslint/scope-manager'; +import { TSESTree } from '@typescript-eslint/types'; +declare namespace Scope { + class ESLintScopeVariable { + readonly defs: Definition[]; + readonly identifiers: TSESTree.Identifier[]; + readonly name: string; + readonly references: Reference[]; + readonly scope: Scope; + /** + * Written to by ESLint. + * If this key exists, this variable is a global variable added by ESLint. + * If this is `true`, this variable can be assigned arbitrary values. + * If this is `false`, this variable is readonly. + */ + writeable?: boolean; + /** + * Written to by ESLint. + * This property is undefined if there are no globals directive comments. + * The array of globals directive comments which defined this global variable in the source code file. + */ + eslintExplicitGlobal?: boolean; + /** + * Written to by ESLint. + * The configured value in config files. This can be different from `variable.writeable` if there are globals directive comments. + */ + eslintImplicitGlobalSetting?: 'readonly' | 'writable'; + /** + * Written to by ESLint. + * If this key exists, it is a global variable added by ESLint. + * If `true`, this global variable was defined by a globals directive comment in the source code file. + */ + eslintExplicitGlobalComments?: TSESTree.Comment[]; + } + export type ScopeManager = scopeManager.ScopeManager; + export type Reference = scopeManager.Reference; + export type Variable = scopeManager.Variable | ESLintScopeVariable; + export type Scope = scopeManager.Scope; + export type DefinitionType = scopeManager.Definition; + export type Definition = scopeManager.Definition; + export {}; +} +export { Scope }; +//# sourceMappingURL=Scope.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Scope.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Scope.d.ts.map new file mode 100644 index 000000000..346462293 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Scope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Scope.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/Scope.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,YAAY,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,kBAAU,KAAK,CAAC;IAGd,MAAc,mBAAmB;QAC/B,SAAgB,IAAI,EAAE,UAAU,EAAE,CAAC;QACnC,SAAgB,WAAW,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC;QACnD,SAAgB,IAAI,EAAE,MAAM,CAAC;QAC7B,SAAgB,UAAU,EAAE,SAAS,EAAE,CAAC;QACxC,SAAgB,KAAK,EAAE,KAAK,CAAC;QAE7B;;;;;WAKG;QACI,SAAS,CAAC,EAAE,OAAO,CAAC;QAE3B;;;;WAIG;QACI,oBAAoB,CAAC,EAAE,OAAO,CAAC;QAEtC;;;WAGG;QACI,2BAA2B,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;QAE7D;;;;WAIG;QACI,4BAA4B,CAAC,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;KAC1D;IAED,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC,YAAY,CAAC;IACrD,MAAM,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC;IAC/C,MAAM,MAAM,QAAQ,GAAG,YAAY,CAAC,QAAQ,GAAG,mBAAmB,CAAC;IACnE,MAAM,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC;IAEvC,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC,UAAU,CAAC;IACrD,MAAM,MAAM,UAAU,GAAG,YAAY,CAAC,UAAU,CAAC;;CAClD;AAED,OAAO,EAAE,KAAK,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Scope.js b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Scope.js new file mode 100644 index 000000000..3d9d67b98 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Scope.js @@ -0,0 +1,9 @@ +"use strict"; +/* eslint-disable @typescript-eslint/no-namespace */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Scope = void 0; +var Scope; +(function (Scope) { +})(Scope || (Scope = {})); +exports.Scope = Scope; +//# sourceMappingURL=Scope.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Scope.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Scope.js.map new file mode 100644 index 000000000..bf72f5e50 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/Scope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Scope.js","sourceRoot":"","sources":["../../src/ts-eslint/Scope.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAKpD,IAAU,KAAK,CA8Cd;AA9CD,WAAU,KAAK;AA8Cf,CAAC,EA9CS,KAAK,KAAL,KAAK,QA8Cd;AAEQ,sBAAK"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/SourceCode.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/SourceCode.d.ts new file mode 100644 index 000000000..5d5b19365 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/SourceCode.d.ts @@ -0,0 +1,350 @@ +import { ParserServices, TSESTree } from '../ts-estree'; +import { Scope } from './Scope'; +declare class TokenStore { + /** + * Checks whether any comments exist or not between the given 2 nodes. + * @param left The node to check. + * @param right The node to check. + * @returns `true` if one or more comments exist. + */ + commentsExistBetween(left: TSESTree.Node | TSESTree.Token, right: TSESTree.Node | TSESTree.Token): boolean; + /** + * Gets all comment tokens directly after the given node or token. + * @param nodeOrToken The AST node or token to check for adjacent comment tokens. + * @returns An array of comments in occurrence order. + */ + getCommentsAfter(nodeOrToken: TSESTree.Node | TSESTree.Token): TSESTree.Comment[]; + /** + * Gets all comment tokens directly before the given node or token. + * @param nodeOrToken The AST node or token to check for adjacent comment tokens. + * @returns An array of comments in occurrence order. + */ + getCommentsBefore(nodeOrToken: TSESTree.Node | TSESTree.Token): TSESTree.Comment[]; + /** + * Gets all comment tokens inside the given node. + * @param node The AST node to get the comments for. + * @returns An array of comments in occurrence order. + */ + getCommentsInside(node: TSESTree.Node): TSESTree.Comment[]; + /** + * Gets the first token of the given node. + * @param node The AST node. + * @param option The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`. + * @returns An object representing the token. + */ + getFirstToken(node: TSESTree.Node, options?: T): SourceCode.ReturnTypeFromOptions | null; + /** + * Gets the first token between two non-overlapping nodes. + * @param left Node before the desired token range. + * @param right Node after the desired token range. + * @param option The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`. + * @returns An object representing the token. + */ + getFirstTokenBetween(left: TSESTree.Node | TSESTree.Token | TSESTree.Comment, right: TSESTree.Node | TSESTree.Token | TSESTree.Comment, options?: T): SourceCode.ReturnTypeFromOptions | null; + /** + * Gets the first `count` tokens of the given node. + * @param node The AST node. + * @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`. + * @returns Tokens. + */ + getFirstTokens(node: TSESTree.Node, options?: T): SourceCode.ReturnTypeFromOptions[]; + /** + * Gets the first `count` tokens between two non-overlapping nodes. + * @param left Node before the desired token range. + * @param right Node after the desired token range. + * @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`. + * @returns Tokens between left and right. + */ + getFirstTokensBetween(left: TSESTree.Node | TSESTree.Token | TSESTree.Comment, right: TSESTree.Node | TSESTree.Token | TSESTree.Comment, options?: T): SourceCode.ReturnTypeFromOptions[]; + /** + * Gets the last token of the given node. + * @param node The AST node. + * @param option The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`. + * @returns An object representing the token. + */ + getLastToken(node: TSESTree.Node, options?: T): SourceCode.ReturnTypeFromOptions | null; + /** + * Gets the last token between two non-overlapping nodes. + * @param left Node before the desired token range. + * @param right Node after the desired token range. + * @param option The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`. + * @returns An object representing the token. + */ + getLastTokenBetween(left: TSESTree.Node | TSESTree.Token | TSESTree.Comment, right: TSESTree.Node | TSESTree.Token | TSESTree.Comment, options?: T): SourceCode.ReturnTypeFromOptions | null; + /** + * Gets the last `count` tokens of the given node. + * @param node The AST node. + * @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`. + * @returns Tokens. + */ + getLastTokens(node: TSESTree.Node, options?: T): SourceCode.ReturnTypeFromOptions[]; + /** + * Gets the last `count` tokens between two non-overlapping nodes. + * @param left Node before the desired token range. + * @param right Node after the desired token range. + * @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`. + * @returns Tokens between left and right. + */ + getLastTokensBetween(left: TSESTree.Node | TSESTree.Token | TSESTree.Comment, right: TSESTree.Node | TSESTree.Token | TSESTree.Comment, options?: T): SourceCode.ReturnTypeFromOptions[]; + /** + * Gets the token that follows a given node or token. + * @param node The AST node or token. + * @param option The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`. + * @returns An object representing the token. + */ + getTokenAfter(node: TSESTree.Node | TSESTree.Token | TSESTree.Comment, options?: T): SourceCode.ReturnTypeFromOptions | null; + /** + * Gets the token that precedes a given node or token. + * @param node The AST node or token. + * @param options The option object + * @returns An object representing the token. + */ + getTokenBefore(node: TSESTree.Node | TSESTree.Token | TSESTree.Comment, options?: T): SourceCode.ReturnTypeFromOptions | null; + /** + * Gets the token starting at the specified index. + * @param offset Index of the start of the token's range. + * @param option The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`. + * @returns The token starting at index, or null if no such token. + */ + getTokenByRangeStart(offset: number, options?: T): SourceCode.ReturnTypeFromOptions | null; + /** + * Gets all tokens that are related to the given node. + * @param node The AST node. + * @param beforeCount The number of tokens before the node to retrieve. + * @param afterCount The number of tokens after the node to retrieve. + * @returns Array of objects representing tokens. + */ + getTokens(node: TSESTree.Node, beforeCount?: number, afterCount?: number): TSESTree.Token[]; + /** + * Gets all tokens that are related to the given node. + * @param node The AST node. + * @param options The option object. If this is a function then it's `options.filter`. + * @returns Array of objects representing tokens. + */ + getTokens(node: TSESTree.Node, options: T): SourceCode.ReturnTypeFromOptions[]; + /** + * Gets the `count` tokens that follows a given node or token. + * @param node The AST node. + * @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`. + * @returns Tokens. + */ + getTokensAfter(node: TSESTree.Node | TSESTree.Token | TSESTree.Comment, options?: T): SourceCode.ReturnTypeFromOptions[]; + /** + * Gets the `count` tokens that precedes a given node or token. + * @param node The AST node. + * @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`. + * @returns Tokens. + */ + getTokensBefore(node: TSESTree.Node | TSESTree.Token | TSESTree.Comment, options?: T): SourceCode.ReturnTypeFromOptions[]; + /** + * Gets all of the tokens between two non-overlapping nodes. + * @param left Node before the desired token range. + * @param right Node after the desired token range. + * @param options The option object. If this is a function then it's `options.filter`. + * @returns Tokens between left and right. + */ + getTokensBetween(left: TSESTree.Node | TSESTree.Token | TSESTree.Comment, right: TSESTree.Node | TSESTree.Token | TSESTree.Comment, padding?: T): SourceCode.ReturnTypeFromOptions[]; + /** + * Gets all of the tokens between two non-overlapping nodes. + * @param left Node before the desired token range. + * @param right Node after the desired token range. + * @param padding Number of extra tokens on either side of center. + * @returns Tokens between left and right. + */ + getTokensBetween(left: TSESTree.Node | TSESTree.Token | TSESTree.Comment, right: TSESTree.Node | TSESTree.Token | TSESTree.Comment, padding?: number): SourceCode.ReturnTypeFromOptions[]; +} +declare class SourceCodeBase extends TokenStore { + /** + * Represents parsed source code. + * @param text The source code text. + * @param ast The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped. + */ + constructor(text: string, ast: SourceCode.Program); + /** + * Represents parsed source code. + * @param config The config object. + */ + constructor(config: SourceCode.SourceCodeConfig); + /** + * The parsed AST for the source code. + */ + ast: SourceCode.Program; + /** + * Retrieves an array containing all comments in the source code. + * @returns An array of comment nodes. + */ + getAllComments(): TSESTree.Comment[]; + /** + * Gets all comments for the given node. + * @param node The AST node to get the comments for. + * @returns An object containing a leading and trailing array of comments indexed by their position. + */ + getComments(node: TSESTree.Node): { + leading: TSESTree.Comment[]; + trailing: TSESTree.Comment[]; + }; + /** + * Converts a (line, column) pair into a range index. + * @param loc A line/column location + * @returns The range index of the location in the file. + */ + getIndexFromLoc(location: TSESTree.LineAndColumnData): number; + /** + * Gets the entire source text split into an array of lines. + * @returns The source text as an array of lines. + */ + getLines(): string[]; + /** + * Converts a source text index into a (line, column) pair. + * @param index The index of a character in a file + * @returns A {line, column} location object with a 0-indexed column + */ + getLocFromIndex(index: number): TSESTree.LineAndColumnData; + /** + * Gets the deepest node containing a range index. + * @param index Range index of the desired node. + * @returns The node if found or `null` if not found. + */ + getNodeByRangeIndex(index: number): TSESTree.Node | null; + /** + * Gets the source code for the given node. + * @param node The AST node to get the text for. + * @param beforeCount The number of characters before the node to retrieve. + * @param afterCount The number of characters after the node to retrieve. + * @returns The text representing the AST node. + */ + getText(node?: TSESTree.Node, beforeCount?: number, afterCount?: number): string; + /** + * The flag to indicate that the source code has Unicode BOM. + */ + hasBOM: boolean; + /** + * Determines if two nodes or tokens have at least one whitespace character + * between them. Order does not matter. Returns false if the given nodes or + * tokens overlap. + * This was added in v6.7.0. + * @since 6.7.0 + * @param first The first node or token to check between. + * @param second The second node or token to check between. + * @returns True if there is a whitespace character between any of the tokens found between the two given nodes or tokens. + */ + isSpaceBetween?(first: TSESTree.Token | TSESTree.Comment | TSESTree.Node, second: TSESTree.Token | TSESTree.Comment | TSESTree.Node): boolean; + /** + * Determines if two nodes or tokens have at least one whitespace character + * between them. Order does not matter. Returns false if the given nodes or + * tokens overlap. + * For backward compatibility, this method returns true if there are + * `JSXText` tokens that contain whitespace between the two. + * @param first The first node or token to check between. + * @param second The second node or token to check between. + * @returns {boolean} True if there is a whitespace character between + * any of the tokens found between the two given nodes or tokens. + * @deprecated in favor of isSpaceBetween + */ + isSpaceBetweenTokens(first: TSESTree.Token, second: TSESTree.Token): boolean; + /** + * The source code split into lines according to ECMA-262 specification. + * This is done to avoid each rule needing to do so separately. + */ + lines: string[]; + /** + * The indexes in `text` that each line starts + */ + lineStartIndices: number[]; + /** + * The parser services of this source code. + */ + parserServices: ParserServices; + /** + * The scope of this source code. + */ + scopeManager: Scope.ScopeManager | null; + /** + * The original text source code. BOM was stripped from this text. + */ + text: string; + /** + * All of the tokens and comments in the AST. + */ + tokensAndComments: (TSESTree.Comment | TSESTree.Token)[]; + /** + * The visitor keys to traverse AST. + */ + visitorKeys: SourceCode.VisitorKeys; + /** + * Split the source code into multiple lines based on the line delimiters. + * @param text Source code as a string. + * @returns Array of source code lines. + */ + static splitLines(text: string): string[]; +} +declare namespace SourceCode { + interface Program extends TSESTree.Program { + comments: TSESTree.Comment[]; + tokens: TSESTree.Token[]; + } + interface SourceCodeConfig { + /** + * The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped. + */ + ast: Program; + /** + * The parser services. + */ + parserServices: ParserServices | null; + /** + * The scope of this source code. + */ + scopeManager: Scope.ScopeManager | null; + /** + * The source code text. + */ + text: string; + /** + * The visitor keys to traverse AST. + */ + visitorKeys: VisitorKeys | null; + } + interface VisitorKeys { + [nodeType: string]: string[]; + } + type FilterPredicate = (tokenOrComment: TSESTree.Token | TSESTree.Comment) => boolean; + type ReturnTypeFromOptions = T extends { + includeComments: true; + } ? TSESTree.Token : Exclude; + type CursorWithSkipOptions = number | FilterPredicate | { + /** + * The predicate function to choose tokens. + */ + filter?: FilterPredicate; + /** + * The flag to iterate comments as well. + */ + includeComments?: boolean; + /** + * The count of tokens the cursor skips. + */ + skip?: number; + }; + type CursorWithCountOptions = number | FilterPredicate | { + /** + * The predicate function to choose tokens. + */ + filter?: FilterPredicate; + /** + * The flag to iterate comments as well. + */ + includeComments?: boolean; + /** + * The maximum count of tokens the cursor iterates. + */ + count?: number; + }; +} +declare const SourceCode_base: typeof SourceCodeBase; +declare class SourceCode extends SourceCode_base { +} +export { SourceCode }; +//# sourceMappingURL=SourceCode.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/SourceCode.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/SourceCode.d.ts.map new file mode 100644 index 000000000..18f49a7f8 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/SourceCode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SourceCode.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/SourceCode.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,OAAO,UAAU;IACtB;;;;;OAKG;IACH,oBAAoB,CAClB,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,EACpC,KAAK,EAAE,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,GACpC,OAAO;IACV;;;;OAIG;IACH,gBAAgB,CACd,WAAW,EAAE,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,GAC1C,QAAQ,CAAC,OAAO,EAAE;IACrB;;;;OAIG;IACH,iBAAiB,CACf,WAAW,EAAE,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,GAC1C,QAAQ,CAAC,OAAO,EAAE;IACrB;;;;OAIG;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} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/SourceCode.js b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/SourceCode.js new file mode 100644 index 000000000..8e029b158 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/SourceCode.js @@ -0,0 +1,9 @@ +"use strict"; +/* eslint-disable @typescript-eslint/no-namespace */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SourceCode = void 0; +const eslint_1 = require("eslint"); +class SourceCode extends eslint_1.SourceCode { +} +exports.SourceCode = SourceCode; +//# sourceMappingURL=SourceCode.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/SourceCode.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/SourceCode.js.map new file mode 100644 index 000000000..60f58ea36 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/SourceCode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"SourceCode.js","sourceRoot":"","sources":["../../src/ts-eslint/SourceCode.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAEpD,mCAAwD;AAubxD,MAAM,UAAW,SAAS,mBAA0C;CAAG;AAE9D,gCAAU"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/index.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/index.d.ts new file mode 100644 index 000000000..05d889d9d --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/index.d.ts @@ -0,0 +1,10 @@ +export * from './AST'; +export * from './CLIEngine'; +export * from './ESLint'; +export * from './Linter'; +export * from './ParserOptions'; +export * from './Rule'; +export * from './RuleTester'; +export * from './Scope'; +export * from './SourceCode'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/index.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/index.d.ts.map new file mode 100644 index 000000000..6b3df411a --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/index.js b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/index.js new file mode 100644 index 000000000..41259584e --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/index.js @@ -0,0 +1,22 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./AST"), exports); +__exportStar(require("./CLIEngine"), exports); +__exportStar(require("./ESLint"), exports); +__exportStar(require("./Linter"), exports); +__exportStar(require("./ParserOptions"), exports); +__exportStar(require("./Rule"), exports); +__exportStar(require("./RuleTester"), exports); +__exportStar(require("./Scope"), exports); +__exportStar(require("./SourceCode"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/index.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/index.js.map new file mode 100644 index 000000000..7ffb8987e --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ts-eslint/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAsB;AACtB,8CAA4B;AAC5B,2CAAyB;AACzB,2CAAyB;AACzB,kDAAgC;AAChC,yCAAuB;AACvB,+CAA6B;AAC7B,0CAAwB;AACxB,+CAA6B"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-estree.d.ts b/node_modules/@typescript-eslint/experimental-utils/dist/ts-estree.d.ts new file mode 100644 index 000000000..e72291e1f --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-estree.d.ts @@ -0,0 +1,3 @@ +export { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree, } from '@typescript-eslint/types'; +export { ParserServices } from '@typescript-eslint/typescript-estree/dist/parser-options'; +//# sourceMappingURL=ts-estree.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-estree.d.ts.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-estree.d.ts.map new file mode 100644 index 000000000..7e7b3d9f9 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-estree.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ts-estree.d.ts","sourceRoot":"","sources":["../src/ts-estree.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EACd,eAAe,EACf,QAAQ,GACT,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAAE,cAAc,EAAE,MAAM,0DAA0D,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-estree.js b/node_modules/@typescript-eslint/experimental-utils/dist/ts-estree.js new file mode 100644 index 000000000..4a32e9c8a --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-estree.js @@ -0,0 +1,10 @@ +"use strict"; +// for convenience's sake - export the types directly from here so consumers +// don't need to reference/install both packages in their code +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TSESTree = exports.AST_TOKEN_TYPES = exports.AST_NODE_TYPES = void 0; +var types_1 = require("@typescript-eslint/types"); +Object.defineProperty(exports, "AST_NODE_TYPES", { enumerable: true, get: function () { return types_1.AST_NODE_TYPES; } }); +Object.defineProperty(exports, "AST_TOKEN_TYPES", { enumerable: true, get: function () { return types_1.AST_TOKEN_TYPES; } }); +Object.defineProperty(exports, "TSESTree", { enumerable: true, get: function () { return types_1.TSESTree; } }); +//# sourceMappingURL=ts-estree.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/dist/ts-estree.js.map b/node_modules/@typescript-eslint/experimental-utils/dist/ts-estree.js.map new file mode 100644 index 000000000..4806a2840 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/dist/ts-estree.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ts-estree.js","sourceRoot":"","sources":["../src/ts-estree.ts"],"names":[],"mappings":";AAAA,4EAA4E;AAC5E,8DAA8D;;;AAE9D,kDAIkC;AAHhC,uGAAA,cAAc,OAAA;AACd,wGAAA,eAAe,OAAA;AACf,iGAAA,QAAQ,OAAA"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/experimental-utils/package.json b/node_modules/@typescript-eslint/experimental-utils/package.json new file mode 100644 index 000000000..623041ed2 --- /dev/null +++ b/node_modules/@typescript-eslint/experimental-utils/package.json @@ -0,0 +1,67 @@ +{ + "name": "@typescript-eslint/experimental-utils", + "version": "4.1.0", + "description": "(Experimental) Utilities for working with TypeScript + ESLint together", + "keywords": [ + "eslint", + "typescript", + "estree" + ], + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "files": [ + "dist", + "_ts3.4", + "package.json", + "README.md", + "LICENSE" + ], + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/experimental-utils" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "license": "MIT", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsc -b tsconfig.build.json", + "postbuild": "downlevel-dts dist _ts3.4/dist", + "clean": "tsc -b tsconfig.build.json --clean", + "postclean": "rimraf dist && rimraf _ts3.4", + "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", + "lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'", + "test": "jest --coverage", + "typecheck": "tsc -p tsconfig.json --noEmit" + }, + "dependencies": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/scope-manager": "4.1.0", + "@typescript-eslint/types": "4.1.0", + "@typescript-eslint/typescript-estree": "4.1.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + }, + "peerDependencies": { + "eslint": "*" + }, + "devDependencies": { + "typescript": "*" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "typesVersions": { + "<3.8": { + "*": [ + "_ts3.4/*" + ] + } + }, + "gitHead": "00a24706222254774121ee62038e67d0efa993e7" +} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/parser/CHANGELOG.md b/node_modules/@typescript-eslint/parser/CHANGELOG.md new file mode 100644 index 000000000..8007f5601 --- /dev/null +++ b/node_modules/@typescript-eslint/parser/CHANGELOG.md @@ -0,0 +1,776 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) + + +### Features + +* **scope-manager:** add support for JSX scope analysis ([#2498](https://github.com/typescript-eslint/typescript-eslint/issues/2498)) ([f887ab5](https://github.com/typescript-eslint/typescript-eslint/commit/f887ab51f58c1b3571f9a14832864bc0ca59623f)), closes [#2455](https://github.com/typescript-eslint/typescript-eslint/issues/2455) [#2477](https://github.com/typescript-eslint/typescript-eslint/issues/2477) + + + + + +## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) + +## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) + +### Features + +* consume new scope analysis package ([#2039](https://github.com/typescript-eslint/typescript-eslint/issues/2039)) ([3be125d](https://github.com/typescript-eslint/typescript-eslint/commit/3be125d9bdbee1984ac6037874edf619213bd3d0)) +* support ESTree optional chaining representation ([#2308](https://github.com/typescript-eslint/typescript-eslint/issues/2308)) ([e9d2ab6](https://github.com/typescript-eslint/typescript-eslint/commit/e9d2ab638b6767700b52797e74b814ea059beaae)) +* **typescript-estree:** switch to globby ([#2418](https://github.com/typescript-eslint/typescript-eslint/issues/2418)) ([3a7ec9b](https://github.com/typescript-eslint/typescript-eslint/commit/3a7ec9bcf1873a99c6da2f19ade8ab4763b4793c)), closes [#2398](https://github.com/typescript-eslint/typescript-eslint/issues/2398) + + +### BREAKING CHANGES + +* **typescript-estree:** - removes the ability to supply a `RegExp` to `projectFolderIgnoreList`, and changes the meaning of the string value from a regex to a glob. + + + + + +## [3.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.0...v3.10.1) (2020-08-25) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [3.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.1...v3.10.0) (2020-08-24) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +## [3.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.0...v3.9.1) (2020-08-17) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [3.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.8.0...v3.9.0) (2020-08-10) + + +### Features + +* **typescript-estree:** support TSv4 labelled tuple members ([#2378](https://github.com/typescript-eslint/typescript-eslint/issues/2378)) ([00d84ff](https://github.com/typescript-eslint/typescript-eslint/commit/00d84ffbcbe9d0ec98bdb2f2ce59959a27ce4dbe)) + + + + + +# [3.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.1...v3.8.0) (2020-08-03) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +## [3.7.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.0...v3.7.1) (2020-07-27) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [3.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.1...v3.7.0) (2020-07-20) + + +### Features + +* **typescript-estree:** support short-circuiting assignment operators ([#2307](https://github.com/typescript-eslint/typescript-eslint/issues/2307)) ([2c90d9f](https://github.com/typescript-eslint/typescript-eslint/commit/2c90d9fa3aa5ebd7db697dddb7762bca2dd0e06b)) +* **typescript-estree:** support type annotations on catch clauses ([#2306](https://github.com/typescript-eslint/typescript-eslint/issues/2306)) ([b5afe9c](https://github.com/typescript-eslint/typescript-eslint/commit/b5afe9c560b9f38c8dffc312a600db30944129c8)) + + + + + +## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [3.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.4.0...v3.5.0) (2020-06-29) + + +### Features + +* split types into their own package ([#2229](https://github.com/typescript-eslint/typescript-eslint/issues/2229)) ([5f45918](https://github.com/typescript-eslint/typescript-eslint/commit/5f4591886f3438329fbf2229b03ac66174334a24)) + + + + + +# [3.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.3.0...v3.4.0) (2020-06-22) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [3.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.2.0...v3.3.0) (2020-06-15) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [3.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.1.0...v3.2.0) (2020-06-08) + + +### Bug Fixes + +* **eslint-plugin:** [prefer-optional-chain] handling first member expression ([#2156](https://github.com/typescript-eslint/typescript-eslint/issues/2156)) ([de18660](https://github.com/typescript-eslint/typescript-eslint/commit/de18660a8cf8f7033798646d8c5b0938d1accb12)) + + + + + +# [3.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.2...v3.1.0) (2020-06-01) + + +### Bug Fixes + +* **experimental-utils:** downlevel type declarations for versions older than 3.8 ([#2133](https://github.com/typescript-eslint/typescript-eslint/issues/2133)) ([7925823](https://github.com/typescript-eslint/typescript-eslint/commit/792582326a8065270b69a0ffcaad5a7b4b103ff3)) + + + + + +## [3.0.2](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.1...v3.0.2) (2020-05-27) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +## [3.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.0...v3.0.1) (2020-05-25) + + +### Bug Fixes + +* **typescript-estree:** handle `BigInt` with `_` numeric separator ([#2067](https://github.com/typescript-eslint/typescript-eslint/issues/2067)) ([66f1627](https://github.com/typescript-eslint/typescript-eslint/commit/66f1627b11a566d5b925a577e800f99d5c808be2)) + + + + + +# [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) + +## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) + +### Bug Fixes + +* **typescript-estree:** use `TSEmptyBodyFunctionExpression` for body-less nodes ([#1289](https://github.com/typescript-eslint/typescript-eslint/issues/1289)) ([82e7163](https://github.com/typescript-eslint/typescript-eslint/commit/82e7163214b56ccde93ba97807b161669a50a60b)) + + +### Features + +* add index files to parser and typescript-estree ([3dfc46d](https://github.com/typescript-eslint/typescript-eslint/commit/3dfc46dccbbd28eed2d74c7b6cacddf1a0848598)) +* **experimental-utils:** upgrade eslint types for v7 ([#2023](https://github.com/typescript-eslint/typescript-eslint/issues/2023)) ([06869c9](https://github.com/typescript-eslint/typescript-eslint/commit/06869c9656fa37936126666845aee40aad546ebd)) +* upgrade to ESLint v7 ([#2022](https://github.com/typescript-eslint/typescript-eslint/issues/2022)) ([208de71](https://github.com/typescript-eslint/typescript-eslint/commit/208de71059746bf38e94bd460346ffb2698a3e12)) +* **typescript-estree:** align nodes with estree 2020 ([#1389](https://github.com/typescript-eslint/typescript-eslint/issues/1389)) ([aff5b62](https://github.com/typescript-eslint/typescript-eslint/commit/aff5b62044f9b93f2087a1d261e9be3f8d6fd54d)) +* **typescript-estree:** align optional fields ([#1429](https://github.com/typescript-eslint/typescript-eslint/issues/1429)) ([0e0010f](https://github.com/typescript-eslint/typescript-eslint/commit/0e0010f82952f9beeeb84136eea00cc5eecc9db6)) +* drop support for node v8 ([#1997](https://github.com/typescript-eslint/typescript-eslint/issues/1997)) ([b6c3b7b](https://github.com/typescript-eslint/typescript-eslint/commit/b6c3b7b84b8d199fa75a46432febd4a364a63217)) +* **eslint-plugin:** [ban-types] rework default options ([#848](https://github.com/typescript-eslint/typescript-eslint/issues/848)) ([8e31d5d](https://github.com/typescript-eslint/typescript-eslint/commit/8e31d5dbe9fe5227fdbefcecfd50ce5dd51360c3)) +* **typescript-estree:** handle 3.9's non-null assertion changes ([#2036](https://github.com/typescript-eslint/typescript-eslint/issues/2036)) ([06bec63](https://github.com/typescript-eslint/typescript-eslint/commit/06bec63c56536db070608ab136d2ad57083f0c6a)) + + + + + +# [2.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.33.0...v2.34.0) (2020-05-18) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [2.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.32.0...v2.33.0) (2020-05-12) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [2.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.31.0...v2.32.0) (2020-05-11) + + +### Features + +* bump dependencies and align AST ([#2007](https://github.com/typescript-eslint/typescript-eslint/issues/2007)) ([18668b7](https://github.com/typescript-eslint/typescript-eslint/commit/18668b78fd7d1e5281af7fc26c76e0ca53297f69)) + + + + + +# [2.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.30.0...v2.31.0) (2020-05-04) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [2.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.29.0...v2.30.0) (2020-04-27) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [2.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.28.0...v2.29.0) (2020-04-20) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [2.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.27.0...v2.28.0) (2020-04-13) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [2.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.26.0...v2.27.0) (2020-04-06) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [2.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.25.0...v2.26.0) (2020-03-30) + + +### Features + +* **typescript-estree:** add option to ignore certain folders from glob resolution ([#1802](https://github.com/typescript-eslint/typescript-eslint/issues/1802)) ([1e29e69](https://github.com/typescript-eslint/typescript-eslint/commit/1e29e69b289d61107a7de67592beae331ba50222)) + + + + + +# [2.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.24.0...v2.25.0) (2020-03-23) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [2.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.23.0...v2.24.0) (2020-03-16) + + +### Features + +* **typescript-estree:** support 3.8 `export * as ns` ([#1698](https://github.com/typescript-eslint/typescript-eslint/issues/1698)) ([133f622](https://github.com/typescript-eslint/typescript-eslint/commit/133f622f38a286eac45288a9789d2ee529d5e582)) + + + + + +# [2.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.22.0...v2.23.0) (2020-03-09) + + +### Features + +* **typescript-estree:** support 3.8 import/export type ([#1697](https://github.com/typescript-eslint/typescript-eslint/issues/1697)) ([625d603](https://github.com/typescript-eslint/typescript-eslint/commit/625d603f94bf0521f834313bf31c734ce4948b7a)) + + + + + +# [2.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.21.0...v2.22.0) (2020-03-02) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [2.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.20.0...v2.21.0) (2020-02-24) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [2.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.2...v2.20.0) (2020-02-17) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +## [2.19.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.1...v2.19.2) (2020-02-10) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +## [2.19.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.0...v2.19.1) (2020-02-10) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [2.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.18.0...v2.19.0) (2020-02-03) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [2.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.17.0...v2.18.0) (2020-01-27) + + +### Bug Fixes + +* **typescript-estree:** fix identifier tokens typed as `Keyword` ([#1487](https://github.com/typescript-eslint/typescript-eslint/issues/1487)) ([77a1caa](https://github.com/typescript-eslint/typescript-eslint/commit/77a1caa562638645b4717449800e410107d512c8)) + + +### Features + +* **eslint-plugin:** add new rule prefer-as-const ([#1431](https://github.com/typescript-eslint/typescript-eslint/issues/1431)) ([420db96](https://github.com/typescript-eslint/typescript-eslint/commit/420db96921435e8bf7fb484ae74552a912a6adde)) +* **parser:** clean up scope-analysis types ([#1481](https://github.com/typescript-eslint/typescript-eslint/issues/1481)) ([4a727fa](https://github.com/typescript-eslint/typescript-eslint/commit/4a727fa083d749dba9eaf39322856f5f69c28cd8)) + + + + + +# [2.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.16.0...v2.17.0) (2020-01-20) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [2.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.15.0...v2.16.0) (2020-01-13) + + +### Bug Fixes + +* **typescript-estree:** resolve path relative to tsconfigRootDir ([#1439](https://github.com/typescript-eslint/typescript-eslint/issues/1439)) ([c709056](https://github.com/typescript-eslint/typescript-eslint/commit/c709056)) + + + + + +# [2.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.14.0...v2.15.0) (2020-01-06) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [2.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.13.0...v2.14.0) (2019-12-30) + + +### Bug Fixes + +* **typescript-estree:** visit typeParameters in OptionalCallExpr ([#1377](https://github.com/typescript-eslint/typescript-eslint/issues/1377)) ([cba6a2a](https://github.com/typescript-eslint/typescript-eslint/commit/cba6a2a)) + + + + + +# [2.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.12.0...v2.13.0) (2019-12-23) + + +### Features + +* **typescript-estree:** computed members discriminated unions ([#1349](https://github.com/typescript-eslint/typescript-eslint/issues/1349)) ([013df9a](https://github.com/typescript-eslint/typescript-eslint/commit/013df9a)) + + + + + +# [2.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.11.0...v2.12.0) (2019-12-16) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [2.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.10.0...v2.11.0) (2019-12-09) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [2.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.9.0...v2.10.0) (2019-12-02) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [2.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.8.0...v2.9.0) (2019-11-25) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [2.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.7.0...v2.8.0) (2019-11-18) + + +### Bug Fixes + +* **typescript-estree:** options range loc being always true ([#704](https://github.com/typescript-eslint/typescript-eslint/issues/704)) ([db1aa18](https://github.com/typescript-eslint/typescript-eslint/commit/db1aa18)) + + + + + +# [2.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.1...v2.7.0) (2019-11-11) + + +### Features + +* **parser:** handle optional chaining in scope analysis ([#1169](https://github.com/typescript-eslint/typescript-eslint/issues/1169)) ([026ceb9](https://github.com/typescript-eslint/typescript-eslint/commit/026ceb9)) + + + + + +## [2.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.0...v2.6.1) (2019-11-04) + + +### Bug Fixes + +* **typescript-estree:** fix filename handling for vue JSX + markdown ([#1127](https://github.com/typescript-eslint/typescript-eslint/issues/1127)) ([366518f](https://github.com/typescript-eslint/typescript-eslint/commit/366518f)) + + + + + +# [2.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.5.0...v2.6.0) (2019-10-28) + + +### Bug Fixes + +* **typescript-estree:** correct parenthesized optional chain AST ([#1141](https://github.com/typescript-eslint/typescript-eslint/issues/1141)) ([5ae286e](https://github.com/typescript-eslint/typescript-eslint/commit/5ae286e)) + + +### Features + +* **typescript-estree:** add support for declare class properties ([#1136](https://github.com/typescript-eslint/typescript-eslint/issues/1136)) ([1508670](https://github.com/typescript-eslint/typescript-eslint/commit/1508670)) + + + + + +# [2.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.4.0...v2.5.0) (2019-10-21) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [2.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.3...v2.4.0) (2019-10-14) + + +### Bug Fixes + +* support long running "watch" lint sessions ([#973](https://github.com/typescript-eslint/typescript-eslint/issues/973)) ([854620e](https://github.com/typescript-eslint/typescript-eslint/commit/854620e)) + + +### Features + +* **typescript-estree:** support for parsing 3.7 features ([#1045](https://github.com/typescript-eslint/typescript-eslint/issues/1045)) ([623febf](https://github.com/typescript-eslint/typescript-eslint/commit/623febf)) + + + + + +## [2.3.3](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.2...v2.3.3) (2019-10-07) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +## [2.3.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.1...v2.3.2) (2019-09-30) + + +### Bug Fixes + +* **typescript-estree:** handle optional computed prop w/o type ([#1026](https://github.com/typescript-eslint/typescript-eslint/issues/1026)) ([95c13fe](https://github.com/typescript-eslint/typescript-eslint/commit/95c13fe)) + + + + + +## [2.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.0...v2.3.1) (2019-09-23) + + +### Bug Fixes + +* **typescript-estree:** parsing error for await in non-async func ([#988](https://github.com/typescript-eslint/typescript-eslint/issues/988)) ([19abbe0](https://github.com/typescript-eslint/typescript-eslint/commit/19abbe0)) + + + + + +# [2.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.2.0...v2.3.0) (2019-09-16) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [2.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.1.0...v2.2.0) (2019-09-09) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [2.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.0.0...v2.1.0) (2019-09-02) + + +### Bug Fixes + +* **typescript-estree:** improve missing project file error msg ([#866](https://github.com/typescript-eslint/typescript-eslint/issues/866)) ([8f3b0a8](https://github.com/typescript-eslint/typescript-eslint/commit/8f3b0a8)), closes [#853](https://github.com/typescript-eslint/typescript-eslint/issues/853) + + +### Features + +* **typescript-estree:** Accept a glob pattern for `options.project` ([#806](https://github.com/typescript-eslint/typescript-eslint/issues/806)) ([9e5f21e](https://github.com/typescript-eslint/typescript-eslint/commit/9e5f21e)) + + + + + +# [2.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.13.0...v2.0.0) (2019-08-13) + + +* feat(eslint-plugin)!: change recommended config (#729) ([428567d](https://github.com/typescript-eslint/typescript-eslint/commit/428567d)), closes [#729](https://github.com/typescript-eslint/typescript-eslint/issues/729) +* feat(typescript-estree)!: throw error on file not in project when `project` set (#760) ([3777b77](https://github.com/typescript-eslint/typescript-eslint/commit/3777b77)), closes [#760](https://github.com/typescript-eslint/typescript-eslint/issues/760) + + +### Bug Fixes + +* **typescript-estree:** fix `is` token typed as `Keyword ([#750](https://github.com/typescript-eslint/typescript-eslint/issues/750)) ([35dec52](https://github.com/typescript-eslint/typescript-eslint/commit/35dec52)) +* **typescript-estree:** jsx comment parsing ([#703](https://github.com/typescript-eslint/typescript-eslint/issues/703)) ([0cfc48e](https://github.com/typescript-eslint/typescript-eslint/commit/0cfc48e)) + + +### Features + +* explicitly support eslint v6 ([#645](https://github.com/typescript-eslint/typescript-eslint/issues/645)) ([34a7cf6](https://github.com/typescript-eslint/typescript-eslint/commit/34a7cf6)) + + +### BREAKING CHANGES + +* recommended config changes are considered breaking +* by default we will now throw when a file is not in the `project` provided +* Node 6 is no longer supported + + + + + +# [1.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.12.0...v1.13.0) (2019-07-21) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [1.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.11.0...v1.12.0) (2019-07-12) + + +### Bug Fixes + +* **typescript-estree:** fix `async` identifier token typed as `Keyword` ([#681](https://github.com/typescript-eslint/typescript-eslint/issues/681)) ([6de19d3](https://github.com/typescript-eslint/typescript-eslint/commit/6de19d3)) + + + + + +# [1.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.10.2...v1.11.0) (2019-06-23) + + +### Bug Fixes + +* **parser:** add simpleTraverse, replaces private ESLint util ([#628](https://github.com/typescript-eslint/typescript-eslint/issues/628)) ([aa206c4](https://github.com/typescript-eslint/typescript-eslint/commit/aa206c4)) +* **typescript-estree:** fix more cases with double slash in JSX text ([#607](https://github.com/typescript-eslint/typescript-eslint/issues/607)) ([34cfa53](https://github.com/typescript-eslint/typescript-eslint/commit/34cfa53)) + + + + + +## [1.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v1.10.1...v1.10.2) (2019-06-10) + +**Note:** Version bump only for package @typescript-eslint/parser + +## [1.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v1.10.0...v1.10.1) (2019-06-09) + +**Note:** Version bump only for package @typescript-eslint/parser + +# [1.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.9.0...v1.10.0) (2019-06-09) + +### Bug Fixes + +- **typescript-estree:** stop ignoring comments in JSX with generic ([#596](https://github.com/typescript-eslint/typescript-eslint/issues/596)) ([31d5bd4](https://github.com/typescript-eslint/typescript-eslint/commit/31d5bd4)) + +### Features + +- make utils/TSESLint export typed classes instead of just types ([#526](https://github.com/typescript-eslint/typescript-eslint/issues/526)) ([370ac72](https://github.com/typescript-eslint/typescript-eslint/commit/370ac72)) + +# [1.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.8.0...v1.9.0) (2019-05-12) + +**Note:** Version bump only for package @typescript-eslint/parser + +# [1.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.7.0...v1.8.0) (2019-05-10) + +### Bug Fixes + +- upgrade lockfile versions ([#487](https://github.com/typescript-eslint/typescript-eslint/issues/487)) ([f029dba](https://github.com/typescript-eslint/typescript-eslint/commit/f029dba)) +- **eslint-plugin:** Support more nodes [no-extra-parens](<[#465](https://github.com/typescript-eslint/typescript-eslint/issues/465)>) ([2d15644](https://github.com/typescript-eslint/typescript-eslint/commit/2d15644)) + +### Features + +- Move shared types into their own package ([#425](https://github.com/typescript-eslint/typescript-eslint/issues/425)) ([a7a03ce](https://github.com/typescript-eslint/typescript-eslint/commit/a7a03ce)) + +# [1.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.6.0...v1.7.0) (2019-04-20) + +**Note:** Version bump only for package @typescript-eslint/parser + +# [1.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.5.0...v1.6.0) (2019-04-03) + +### Bug Fixes + +- **parser:** Make eslint traverse enum id ([#383](https://github.com/typescript-eslint/typescript-eslint/issues/383)) ([492b737](https://github.com/typescript-eslint/typescript-eslint/commit/492b737)) + +### Features + +- change TypeScript version range to >=3.2.1 <3.5.0 ([#399](https://github.com/typescript-eslint/typescript-eslint/issues/399)) ([a4f95d3](https://github.com/typescript-eslint/typescript-eslint/commit/a4f95d3)) + +# [1.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.2...v1.5.0) (2019-03-20) + +**Note:** Version bump only for package @typescript-eslint/parser + +## [1.4.2](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.1...v1.4.2) (2019-02-25) + +**Note:** Version bump only for package @typescript-eslint/parser + +## [1.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.0...v1.4.1) (2019-02-23) + +**Note:** Version bump only for package @typescript-eslint/parser + +# [1.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.3.0...v1.4.0) (2019-02-19) + +### Bug Fixes + +- **parser:** fix crash when visiting decorators in parameters ([#237](https://github.com/typescript-eslint/typescript-eslint/issues/237)) ([225fc26](https://github.com/typescript-eslint/typescript-eslint/commit/225fc26)) +- **parser:** fix visiting props of TSDeclareFunction ([#244](https://github.com/typescript-eslint/typescript-eslint/issues/244)) ([b40def8](https://github.com/typescript-eslint/typescript-eslint/commit/b40def8)) + +### Features + +- **eslint-plugin:** Migrate plugin to ts ([#120](https://github.com/typescript-eslint/typescript-eslint/issues/120)) ([61c60dc](https://github.com/typescript-eslint/typescript-eslint/commit/61c60dc)) +- **ts-estree:** fix parsing nested sequence expressions ([#286](https://github.com/typescript-eslint/typescript-eslint/issues/286)) ([ecc9631](https://github.com/typescript-eslint/typescript-eslint/commit/ecc9631)) + +# [1.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.2.0...v1.3.0) (2019-02-07) + +### Bug Fixes + +- **ts-estree:** align typeArguments and typeParameters across nodes ([#223](https://github.com/typescript-eslint/typescript-eslint/issues/223)) ([3306198](https://github.com/typescript-eslint/typescript-eslint/commit/3306198)) +- **ts-estree:** convert decorators on var and fn decs ([#211](https://github.com/typescript-eslint/typescript-eslint/issues/211)) ([0a1777f](https://github.com/typescript-eslint/typescript-eslint/commit/0a1777f)) +- **ts-estree:** fix issues with typeParams in FunctionExpression ([#208](https://github.com/typescript-eslint/typescript-eslint/issues/208)) ([d4dfa3b](https://github.com/typescript-eslint/typescript-eslint/commit/d4dfa3b)) + +### Features + +- change TypeScript version range to >=3.2.1 <3.4.0 ([#184](https://github.com/typescript-eslint/typescript-eslint/issues/184)) ([f513a14](https://github.com/typescript-eslint/typescript-eslint/commit/f513a14)) +- **ts-estree:** enable errors 1098 and 1099 ([#219](https://github.com/typescript-eslint/typescript-eslint/issues/219)) ([fc50167](https://github.com/typescript-eslint/typescript-eslint/commit/fc50167)) + +# [1.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.1.1...v1.2.0) (2019-02-01) + +### Bug Fixes + +- **parser:** fix regression with no-unused-vars for jsx attributes ([#161](https://github.com/typescript-eslint/typescript-eslint/issues/161)) ([6147de1](https://github.com/typescript-eslint/typescript-eslint/commit/6147de1)) + +## [1.1.1](https://github.com/typescript-eslint/typescript-eslint/compare/v1.1.0...v1.1.1) (2019-01-29) + +### Bug Fixes + +- **eslint-plugin:** make parser services error clearer ([#132](https://github.com/typescript-eslint/typescript-eslint/issues/132)) ([aa9d1e1](https://github.com/typescript-eslint/typescript-eslint/commit/aa9d1e1)) +- **parser:** add visiting of type parameters in JSXOpeningElement ([#150](https://github.com/typescript-eslint/typescript-eslint/issues/150)) ([5e16003](https://github.com/typescript-eslint/typescript-eslint/commit/5e16003)) +- **ts-estree:** expand optional property to include question token ([#138](https://github.com/typescript-eslint/typescript-eslint/issues/138)) ([9068b62](https://github.com/typescript-eslint/typescript-eslint/commit/9068b62)) + +# [1.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.0.0...v1.1.0) (2019-01-23) + +### Bug Fixes + +- **typescript-estree:** correct range of parameters with comments ([#128](https://github.com/typescript-eslint/typescript-eslint/issues/128)) ([91eedf2](https://github.com/typescript-eslint/typescript-eslint/commit/91eedf2)) +- **typescript-estree:** fix range of assignment in parameter ([#115](https://github.com/typescript-eslint/typescript-eslint/issues/115)) ([4e781f1](https://github.com/typescript-eslint/typescript-eslint/commit/4e781f1)) + +# [1.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v0.2.1...v1.0.0) (2019-01-20) + +### Features + +- **parser:** support ecmaFeatures.jsx flag and tests ([#85](https://github.com/typescript-eslint/typescript-eslint/issues/85)) ([b321736](https://github.com/typescript-eslint/typescript-eslint/commit/b321736)) + +## [0.2.1](https://github.com/typescript-eslint/typescript-eslint/compare/v0.2.0...v0.2.1) (2019-01-20) + +**Note:** Version bump only for package @typescript-eslint/parser diff --git a/node_modules/@typescript-eslint/parser/LICENSE b/node_modules/@typescript-eslint/parser/LICENSE new file mode 100644 index 000000000..a2d896685 --- /dev/null +++ b/node_modules/@typescript-eslint/parser/LICENSE @@ -0,0 +1,22 @@ +TypeScript ESLint Parser +Copyright JS Foundation and other contributors, https://js.foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/@typescript-eslint/parser/README.md b/node_modules/@typescript-eslint/parser/README.md new file mode 100644 index 000000000..f6417fd58 --- /dev/null +++ b/node_modules/@typescript-eslint/parser/README.md @@ -0,0 +1,228 @@ +

TypeScript ESLint Parser

+ +

An ESLint parser which leverages TypeScript ESTree to allow for ESLint to lint TypeScript source code.

+ +

+ CI + NPM Version + NPM Downloads +

+ +## Getting Started + +**[You can find our Getting Started docs here](../../docs/getting-started/linting/README.md)** + +These docs walk you through setting up ESLint, this parser, and our plugin. If you know what you're doing and just want to quick start, read on... + +## Quick-start + +### Installation + +```bash +$ yarn add -D typescript @typescript-eslint/parser +$ npm i --save-dev typescript @typescript-eslint/parser +``` + +### Usage + +In your ESLint configuration file, set the `parser` property: + +```json +{ + "parser": "@typescript-eslint/parser" +} +``` + +There is sometimes an incorrect assumption that the parser itself is what does everything necessary to facilitate the use of ESLint with TypeScript. In actuality, it is the combination of the parser _and_ one or more plugins which allow you to maximize your usage of ESLint with TypeScript. + +For example, once this parser successfully produces an AST for the TypeScript source code, it might well contain some information which simply does not exist in a standard JavaScript context, such as the data for a TypeScript-specific construct, like an `interface`. + +The core rules built into ESLint, such as `indent` have no knowledge of such constructs, so it is impossible to expect them to work out of the box with them. + +Instead, you also need to make use of one more plugins which will add or extend rules with TypeScript-specific features. + +By far the most common case will be installing the [`@typescript-eslint/eslint-plugin`](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin) plugin, but there are also other relevant options available such a [`@typescript-eslint/eslint-plugin-tslint`](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin-tslint). + +## Configuration + +The following additional configuration options are available by specifying them in [`parserOptions`](https://eslint.org/docs/user-guide/configuring#specifying-parser-options) in your ESLint configuration file. + +```ts +interface ParserOptions { + ecmaFeatures?: { + jsx?: boolean; + globalReturn?: boolean; + }; + ecmaVersion?: number; + + jsxPragma?: string; + jsxFragmentName?: string | null; + lib?: string[]; + + project?: string | string[]; + projectFolderIgnoreList?: string[]; + tsconfigRootDir?: string; + extraFileExtensions?: string[]; + warnOnUnsupportedTypeScriptVersion?: boolean; +} +``` + +### `parserOptions.ecmaFeatures.jsx` + +Default `false`. + +Enable parsing JSX when `true`. More details can be found [here](https://www.typescriptlang.org/docs/handbook/jsx.html). + +**NOTE:** this setting does not affect known file types (`.js`, `.jsx`, `.ts`, `.tsx`, `.json`) because the TypeScript compiler has its own internal handling for known file extensions. The exact behavior is as follows: + +- if `parserOptions.project` is _not_ provided: + - `.js`, `.jsx`, `.tsx` files are parsed as if this is true. + - `.ts` files are parsed as if this is false. + - unknown extensions (`.md`, `.vue`) will respect this setting. +- if `parserOptions.project` is provided (i.e. you are using rules with type information): + - `.js`, `.jsx`, `.tsx` files are parsed as if this is true. + - `.ts` files are parsed as if this is false. + - "unknown" extensions (`.md`, `.vue`) **are parsed as if this is false**. + +### `parserOptions.ecmaFeatures.globalReturn` + +Default `false`. + +This options allows you to tell the parser if you want to allow global `return` statements in your codebase. + +### `parserOptions.ecmaVersion` + +Default `2018`. + +Accepts any valid ECMAScript version number: + +- A version: es3, es5, es6, es7, es8, es9, es10, es11, ..., or +- A year: es2015, es2016, es2017, es2018, es2019, es2020, ... + +Specifies the version of ECMAScript syntax you want to use. This is used by the parser to determine how to perform scope analysis, and it affects the default + +### `parserOptions.jsxPragma` + +Default `'React'` + +The identifier that's used for JSX Elements creation (after transpilation). +If you're using a library other than React (like `preact`), then you should change this value. + +This should not be a member expression - just the root identifier (i.e. use `"React"` instead of `"React.createElement"`). + +If you provide `parserOptions.project`, you do not need to set this, as it will automatically detected from the compiler. + +### `parserOptions.jsxFragmentName` + +Default `null` + +The identifier that's used for JSX fragment elements (after transpilation). +If `null`, assumes transpilation will always use a member of the configured `jsxPragma`. +This should not be a member expression - just the root identifier (i.e. use `"h"` instead of `"h.Fragment"`). + +If you provide `parserOptions.project`, you do not need to set this, as it will automatically detected from the compiler. + +### `parserOptions.lib` + +Default `['es2018']` + +For valid options, see the [TypeScript compiler options](https://www.typescriptlang.org/tsconfig#lib). + +Specifies the TypeScript `lib`s that are available. This is used by the scope analyser to ensure there are global variables declared for the types exposed by TypeScript. + +If you provide `parserOptions.project`, you do not need to set this, as it will automatically detected from the compiler. + +### `parserOptions.project` + +Default `undefined`. + +This option allows you to provide a path to your project's `tsconfig.json`. **This setting is required if you want to use rules which require type information**. Relative paths are interpreted relative to the current working directory if `tsconfigRootDir` is not set. If you intend on running ESLint from directories other than the project root, you should consider using `tsconfigRootDir`. + +- Accepted values: + + ```js + // path + project: './tsconfig.json'; + + // glob pattern + project: './packages/**/tsconfig.json'; + + // array of paths and/or glob patterns + project: ['./packages/**/tsconfig.json', './separate-package/tsconfig.json']; + ``` + +- If you use project references, TypeScript will not automatically use project references to resolve files. This means that you will have to add each referenced tsconfig to the `project` field either separately, or via a glob. + +- TypeScript will ignore files with duplicate filenames in the same folder (for example, `src/file.ts` and `src/file.js`). TypeScript purposely ignore all but one of the files, only keeping the one file with the highest priority extension (the extension priority order (from highest to lowest) is `.ts`, `.tsx`, `.d.ts`, `.js`, `.jsx`). For more info see #955. + +- Note that if this setting is specified and `createDefaultProgram` is not, you must only lint files that are included in the projects as defined by the provided `tsconfig.json` files. If your existing configuration does not include all of the files you would like to lint, you can create a separate `tsconfig.eslint.json` as follows: + + ```jsonc + { + // extend your base config so you don't have to redefine your compilerOptions + "extends": "./tsconfig.json", + "include": [ + "src/**/*.ts", + "test/**/*.ts", + "typings/**/*.ts", + // etc + + // if you have a mixed JS/TS codebase, don't forget to include your JS files + "src/**/*.js" + ] + } + ``` + +### `parserOptions.tsconfigRootDir` + +Default `undefined`. + +This option allows you to provide the root directory for relative tsconfig paths specified in the `project` option above. + +### `parserOptions.projectFolderIgnoreList` + +Default `["**/node_modules/**"]`. + +This option allows you to ignore folders from being included in your provided list of `project`s. +This is useful if you have configured glob patterns, but want to make sure you ignore certain folders. + +It accepts an array of globs to exclude from the `project` globs. + +For example, by default it will ensure that a glob like `./**/tsconfig.json` will not match any `tsconfig`s within your `node_modules` folder (some npm packages do not exclude their source files from their published packages). + +### `parserOptions.extraFileExtensions` + +Default `undefined`. + +This option allows you to provide one or more additional file extensions which should be considered in the TypeScript Program compilation. +The default extensions are `.ts`, `.tsx`, `.js`, and `.jsx`. Add extensions starting with `.`, followed by the file extension. E.g. for a `.vue` file use `"extraFileExtensions: [".vue"]`. + +### `parserOptions.warnOnUnsupportedTypeScriptVersion` + +Default `true`. + +This option allows you to toggle the warning that the parser will give you if you use a version of TypeScript which is not explicitly supported + +### `parserOptions.createDefaultProgram` + +Default `false`. + +This option allows you to request that when the `project` setting is specified, files will be allowed when not included in the projects defined by the provided `tsconfig.json` files. **Using this option will incur significant performance costs. This option is primarily included for backwards-compatibility.** See the **`project`** section above for more information. + +## Supported TypeScript Version + +Please see [`typescript-eslint`](https://github.com/typescript-eslint/typescript-eslint) for the supported TypeScript version. + +**Please ensure that you are using a supported version before submitting any issues/bug reports.** + +## Reporting Issues + +Please use the `@typescript-eslint/parser` issue template when creating your issue and fill out the information requested as best you can. This will really help us when looking into your issue. + +## License + +TypeScript ESLint Parser is licensed under a permissive BSD 2-clause license. + +## Contributing + +[See the contributing guide here](../../CONTRIBUTING.md) diff --git a/node_modules/@typescript-eslint/parser/dist/index.d.ts b/node_modules/@typescript-eslint/parser/dist/index.d.ts new file mode 100644 index 000000000..2229e017d --- /dev/null +++ b/node_modules/@typescript-eslint/parser/dist/index.d.ts @@ -0,0 +1,5 @@ +export { parse, parseForESLint, ParserOptions } from './parser'; +export { ParserServices } from '@typescript-eslint/typescript-estree'; +export { clearCaches } from '@typescript-eslint/typescript-estree'; +export declare const version: string; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/parser/dist/index.d.ts.map b/node_modules/@typescript-eslint/parser/dist/index.d.ts.map new file mode 100644 index 000000000..69632b8a0 --- /dev/null +++ b/node_modules/@typescript-eslint/parser/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAGnE,eAAO,MAAM,OAAO,EAAE,MAA2C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/parser/dist/index.js b/node_modules/@typescript-eslint/parser/dist/index.js new file mode 100644 index 000000000..b9e888ae1 --- /dev/null +++ b/node_modules/@typescript-eslint/parser/dist/index.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.version = exports.clearCaches = exports.parseForESLint = exports.parse = void 0; +var parser_1 = require("./parser"); +Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return parser_1.parse; } }); +Object.defineProperty(exports, "parseForESLint", { enumerable: true, get: function () { return parser_1.parseForESLint; } }); +var typescript_estree_1 = require("@typescript-eslint/typescript-estree"); +Object.defineProperty(exports, "clearCaches", { enumerable: true, get: function () { return typescript_estree_1.clearCaches; } }); +// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder +exports.version = require('../package.json').version; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/parser/dist/index.js.map b/node_modules/@typescript-eslint/parser/dist/index.js.map new file mode 100644 index 000000000..604901f92 --- /dev/null +++ b/node_modules/@typescript-eslint/parser/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAAgE;AAAvD,+FAAA,KAAK,OAAA;AAAE,wGAAA,cAAc,OAAA;AAE9B,0EAAmE;AAA1D,gHAAA,WAAW,OAAA;AAEpB,sHAAsH;AACzG,QAAA,OAAO,GAAW,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/parser/dist/parser-options.d.ts b/node_modules/@typescript-eslint/parser/dist/parser-options.d.ts new file mode 100644 index 000000000..a829c4016 --- /dev/null +++ b/node_modules/@typescript-eslint/parser/dist/parser-options.d.ts @@ -0,0 +1,2 @@ +export { ParserOptions } from '@typescript-eslint/types'; +//# sourceMappingURL=parser-options.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/parser/dist/parser-options.d.ts.map b/node_modules/@typescript-eslint/parser/dist/parser-options.d.ts.map new file mode 100644 index 000000000..85aeca5e1 --- /dev/null +++ b/node_modules/@typescript-eslint/parser/dist/parser-options.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parser-options.d.ts","sourceRoot":"","sources":["../src/parser-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/parser/dist/parser-options.js b/node_modules/@typescript-eslint/parser/dist/parser-options.js new file mode 100644 index 000000000..66f40a290 --- /dev/null +++ b/node_modules/@typescript-eslint/parser/dist/parser-options.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=parser-options.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/parser/dist/parser-options.js.map b/node_modules/@typescript-eslint/parser/dist/parser-options.js.map new file mode 100644 index 000000000..22b7b8ab9 --- /dev/null +++ b/node_modules/@typescript-eslint/parser/dist/parser-options.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parser-options.js","sourceRoot":"","sources":["../src/parser-options.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/parser/dist/parser.d.ts b/node_modules/@typescript-eslint/parser/dist/parser.d.ts new file mode 100644 index 000000000..0d501b821 --- /dev/null +++ b/node_modules/@typescript-eslint/parser/dist/parser.d.ts @@ -0,0 +1,17 @@ +import { ParserOptions, TSESTree } from '@typescript-eslint/types'; +import { ParserServices, visitorKeys } from '@typescript-eslint/typescript-estree'; +import { ScopeManager } from '@typescript-eslint/scope-manager'; +interface ParseForESLintResult { + ast: TSESTree.Program & { + range?: [number, number]; + tokens?: TSESTree.Token[]; + comments?: TSESTree.Comment[]; + }; + services: ParserServices; + visitorKeys: typeof visitorKeys; + scopeManager: ScopeManager; +} +declare function parse(code: string, options?: ParserOptions): ParseForESLintResult['ast']; +declare function parseForESLint(code: string, options?: ParserOptions | null): ParseForESLintResult; +export { parse, parseForESLint, ParserOptions }; +//# sourceMappingURL=parser.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/parser/dist/parser.d.ts.map b/node_modules/@typescript-eslint/parser/dist/parser.d.ts.map new file mode 100644 index 000000000..2e2563832 --- /dev/null +++ b/node_modules/@typescript-eslint/parser/dist/parser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAO,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAEL,cAAc,EAEd,WAAW,EACZ,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAGL,YAAY,EACb,MAAM,kCAAkC,CAAC;AAM1C,UAAU,oBAAoB;IAC5B,GAAG,EAAE,QAAQ,CAAC,OAAO,GAAG;QACtB,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACzB,MAAM,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC;QAC1B,QAAQ,CAAC,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;KAC/B,CAAC;IACF,QAAQ,EAAE,cAAc,CAAC;IACzB,WAAW,EAAE,OAAO,WAAW,CAAC;IAChC,YAAY,EAAE,YAAY,CAAC;CAC5B;AAiDD,iBAAS,KAAK,CACZ,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,aAAa,GACtB,oBAAoB,CAAC,KAAK,CAAC,CAE7B;AAED,iBAAS,cAAc,CACrB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,GAC7B,oBAAoB,CAwFtB;AAED,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/parser/dist/parser.js b/node_modules/@typescript-eslint/parser/dist/parser.js new file mode 100644 index 000000000..3b6a30cf9 --- /dev/null +++ b/node_modules/@typescript-eslint/parser/dist/parser.js @@ -0,0 +1,131 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseForESLint = exports.parse = void 0; +const typescript_estree_1 = require("@typescript-eslint/typescript-estree"); +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const debug_1 = __importDefault(require("debug")); +const typescript_1 = require("typescript"); +const log = debug_1.default('typescript-eslint:parser:parser'); +function validateBoolean(value, fallback = false) { + if (typeof value !== 'boolean') { + return fallback; + } + return value; +} +const LIB_FILENAME_REGEX = /lib\.(.+)\.d\.ts/; +function getLib(compilerOptions) { + var _a; + if (compilerOptions.lib) { + return compilerOptions.lib + .map(lib => { + const match = LIB_FILENAME_REGEX.exec(lib.toLowerCase()); + if (!match) { + return null; + } + return match[1]; + }) + .filter(l => l != null); + } + const target = (_a = compilerOptions.target) !== null && _a !== void 0 ? _a : typescript_1.ScriptTarget.ES5; + // https://github.com/Microsoft/TypeScript/blob/59ad375234dc2efe38d8ee0ba58414474c1d5169/src/compiler/utilitiesPublic.ts#L13-L32 + switch (target) { + case typescript_1.ScriptTarget.ESNext: + return ['esnext.full']; + case typescript_1.ScriptTarget.ES2020: + return ['es2020.full']; + case typescript_1.ScriptTarget.ES2019: + return ['es2019.full']; + case typescript_1.ScriptTarget.ES2018: + return ['es2018.full']; + case typescript_1.ScriptTarget.ES2017: + return ['es2017.full']; + case typescript_1.ScriptTarget.ES2016: + return ['es2016.full']; + case typescript_1.ScriptTarget.ES2015: + return ['es6']; + default: + return ['lib']; + } +} +function parse(code, options) { + return parseForESLint(code, options).ast; +} +exports.parse = parse; +function parseForESLint(code, options) { + if (!options || typeof options !== 'object') { + options = {}; + } + else { + options = Object.assign({}, options); + } + // https://eslint.org/docs/user-guide/configuring#specifying-parser-options + // if sourceType is not provided by default eslint expect that it will be set to "script" + if (options.sourceType !== 'module' && options.sourceType !== 'script') { + options.sourceType = 'script'; + } + if (typeof options.ecmaFeatures !== 'object') { + options.ecmaFeatures = {}; + } + const parserOptions = {}; + Object.assign(parserOptions, options, { + useJSXTextNode: validateBoolean(options.useJSXTextNode, true), + jsx: validateBoolean(options.ecmaFeatures.jsx), + }); + const analyzeOptions = { + ecmaVersion: options.ecmaVersion, + globalReturn: options.ecmaFeatures.globalReturn, + jsxPragma: options.jsxPragma, + jsxFragmentName: options.jsxFragmentName, + lib: options.lib, + sourceType: options.sourceType, + }; + if (typeof options.filePath === 'string') { + const tsx = options.filePath.endsWith('.tsx'); + if (tsx || options.filePath.endsWith('.ts')) { + parserOptions.jsx = tsx; + } + } + /** + * Allow the user to suppress the warning from typescript-estree if they are using an unsupported + * version of TypeScript + */ + const warnOnUnsupportedTypeScriptVersion = validateBoolean(options.warnOnUnsupportedTypeScriptVersion, true); + if (!warnOnUnsupportedTypeScriptVersion) { + parserOptions.loggerFn = false; + } + const { ast, services } = typescript_estree_1.parseAndGenerateServices(code, parserOptions); + ast.sourceType = options.sourceType; + if (services.hasFullTypeInformation) { + // automatically apply the options configured for the program + const compilerOptions = services.program.getCompilerOptions(); + if (analyzeOptions.lib == null) { + analyzeOptions.lib = getLib(compilerOptions); + log('Resolved libs from program: %o', analyzeOptions.lib); + } + if (parserOptions.jsx === true) { + if (analyzeOptions.jsxPragma === undefined && + compilerOptions.jsxFactory != null) { + // in case the user has specified something like "preact.h" + const factory = compilerOptions.jsxFactory.split('.')[0].trim(); + analyzeOptions.jsxPragma = factory; + log('Resolved jsxPragma from program: %s', analyzeOptions.jsxPragma); + } + if (analyzeOptions.jsxFragmentName === undefined && + compilerOptions.jsxFragmentFactory != null) { + // in case the user has specified something like "preact.Fragment" + const fragFactory = compilerOptions.jsxFragmentFactory + .split('.')[0] + .trim(); + analyzeOptions.jsxFragmentName = fragFactory; + log('Resolved jsxFragmentName from program: %s', analyzeOptions.jsxFragmentName); + } + } + } + const scopeManager = scope_manager_1.analyze(ast, analyzeOptions); + return { ast, services, scopeManager, visitorKeys: typescript_estree_1.visitorKeys }; +} +exports.parseForESLint = parseForESLint; +//# sourceMappingURL=parser.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/parser/dist/parser.js.map b/node_modules/@typescript-eslint/parser/dist/parser.js.map new file mode 100644 index 000000000..e3b8dd068 --- /dev/null +++ b/node_modules/@typescript-eslint/parser/dist/parser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parser.js","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":";;;;;;AACA,4EAK8C;AAC9C,oEAI0C;AAC1C,kDAA0B;AAC1B,2CAA2D;AAE3D,M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CAAC,CAAC;aACtE;YACD,IACE,cAAc,CAAC,eAAe,KAAK,SAAS;gBAC5C,eAAe,CAAC,kBAAkB,IAAI,IAAI,EAC1C;gBACA,kEAAkE;gBAClE,MAAM,WAAW,GAAG,eAAe,CAAC,kBAAkB;qBACnD,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;qBACb,IAAI,EAAE,CAAC;gBACV,cAAc,CAAC,eAAe,GAAG,WAAW,CAAC;gBAC7C,GAAG,CACD,2CAA2C,EAC3C,cAAc,CAAC,eAAe,CAC/B,CAAC;aACH;SACF;KACF;IAED,MAAM,YAAY,GAAG,uBAAO,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;IAElD,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAX,+BAAW,EAAE,CAAC;AACtD,CAAC;AAEe,wCAAc"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/parser/package.json b/node_modules/@typescript-eslint/parser/package.json new file mode 100644 index 000000000..31c5850c3 --- /dev/null +++ b/node_modules/@typescript-eslint/parser/package.json @@ -0,0 +1,76 @@ +{ + "name": "@typescript-eslint/parser", + "version": "4.1.0", + "description": "An ESLint custom parser which leverages TypeScript ESTree", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "files": [ + "dist", + "README.md", + "LICENSE" + ], + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/parser" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "license": "BSD-2-Clause", + "keywords": [ + "ast", + "ecmascript", + "javascript", + "typescript", + "parser", + "syntax", + "eslint" + ], + "scripts": { + "build": "tsc -b tsconfig.build.json", + "postbuild": "downlevel-dts dist _ts3.4/dist", + "clean": "tsc -b tsconfig.build.json --clean", + "postclean": "rimraf dist", + "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", + "lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'", + "test": "jest --coverage", + "typecheck": "tsc -p tsconfig.json --noEmit" + }, + "peerDependencies": { + "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" + }, + "dependencies": { + "@typescript-eslint/scope-manager": "4.1.0", + "@typescript-eslint/types": "4.1.0", + "@typescript-eslint/typescript-estree": "4.1.0", + "debug": "^4.1.1" + }, + "devDependencies": { + "@types/glob": "*", + "@typescript-eslint/experimental-utils": "4.1.0", + "@typescript-eslint/shared-fixtures": "4.1.0", + "glob": "*", + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "typesVersions": { + "<3.8": { + "*": [ + "_ts3.4/*" + ] + } + }, + "gitHead": "00a24706222254774121ee62038e67d0efa993e7" +} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/CHANGELOG.md b/node_modules/@typescript-eslint/scope-manager/CHANGELOG.md new file mode 100644 index 000000000..cf0ad482f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/CHANGELOG.md @@ -0,0 +1,135 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) + + +### Bug Fixes + +* **eslint-plugin:** [no-unused-vars] correct detection of unused vars in a declared module with `export =` ([#2505](https://github.com/typescript-eslint/typescript-eslint/issues/2505)) ([3d07a99](https://github.com/typescript-eslint/typescript-eslint/commit/3d07a99faa0a5fc1b44acdb43ddbfc90a5105833)) +* **scope-manager:** add `const` as a global type variable ([#2499](https://github.com/typescript-eslint/typescript-eslint/issues/2499)) ([eb3f6e3](https://github.com/typescript-eslint/typescript-eslint/commit/eb3f6e39391d62ac424baa305a15e61806b2fd65)) +* **scope-manager:** correctly handle inferred types in nested type scopes ([#2497](https://github.com/typescript-eslint/typescript-eslint/issues/2497)) ([95f6bf4](https://github.com/typescript-eslint/typescript-eslint/commit/95f6bf4818cdec48a0583bf82f928c598af22736)) +* **scope-manager:** don't create references for intrinsic JSX elements ([#2504](https://github.com/typescript-eslint/typescript-eslint/issues/2504)) ([cdb9807](https://github.com/typescript-eslint/typescript-eslint/commit/cdb9807a5a368a136856cd03048b68e0f2dfb405)) +* **scope-manager:** fallback to lib 'esnext' or 'es5' when ecma version is unsupported ([#2474](https://github.com/typescript-eslint/typescript-eslint/issues/2474)) ([20a7dcc](https://github.com/typescript-eslint/typescript-eslint/commit/20a7dcc808a39cd447d6e52fc5a1e1373d7122e9)) +* **scope-manager:** support rest function type parameters ([#2491](https://github.com/typescript-eslint/typescript-eslint/issues/2491)) ([9d8b4c4](https://github.com/typescript-eslint/typescript-eslint/commit/9d8b4c479c98623e4198aa07639321929a8a876f)), closes [#2449](https://github.com/typescript-eslint/typescript-eslint/issues/2449) +* **scope-manager:** support tagged template string generic type parameters ([#2492](https://github.com/typescript-eslint/typescript-eslint/issues/2492)) ([a2686c0](https://github.com/typescript-eslint/typescript-eslint/commit/a2686c04293ab9070c1500a0dab7e205bd1fa9d2)) +* **scope-manager:** support type predicates ([#2493](https://github.com/typescript-eslint/typescript-eslint/issues/2493)) ([a40f54c](https://github.com/typescript-eslint/typescript-eslint/commit/a40f54c39d59096a0d12a492807dcd52fbcdc384)), closes [#2462](https://github.com/typescript-eslint/typescript-eslint/issues/2462) +* **scope-manager:** treat type imports as both values and types ([#2494](https://github.com/typescript-eslint/typescript-eslint/issues/2494)) ([916e95a](https://github.com/typescript-eslint/typescript-eslint/commit/916e95a505689746dda38a67148c95cc7d207d9f)), closes [#2453](https://github.com/typescript-eslint/typescript-eslint/issues/2453) + + +### Features + +* **scope-manager:** add support for JSX scope analysis ([#2498](https://github.com/typescript-eslint/typescript-eslint/issues/2498)) ([f887ab5](https://github.com/typescript-eslint/typescript-eslint/commit/f887ab51f58c1b3571f9a14832864bc0ca59623f)), closes [#2455](https://github.com/typescript-eslint/typescript-eslint/issues/2455) [#2477](https://github.com/typescript-eslint/typescript-eslint/issues/2477) + + + + + +## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) + +**Note:** Version bump only for package @typescript-eslint/scope-manager + + + + + +# [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) + +## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) + +### Bug Fixes + +* **scope-manager:** correct analysis of abstract class properties ([#2420](https://github.com/typescript-eslint/typescript-eslint/issues/2420)) ([cd84549](https://github.com/typescript-eslint/typescript-eslint/commit/cd84549beba3cf471d75cfd9ba26f80366842ed5)) + + +### Features + +* support ESTree optional chaining representation ([#2308](https://github.com/typescript-eslint/typescript-eslint/issues/2308)) ([e9d2ab6](https://github.com/typescript-eslint/typescript-eslint/commit/e9d2ab638b6767700b52797e74b814ea059beaae)) + + + + + +## [3.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.0...v3.10.1) (2020-08-25) + +**Note:** Version bump only for package @typescript-eslint/scope-manager + + + + + +# [3.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.1...v3.10.0) (2020-08-24) + +**Note:** Version bump only for package @typescript-eslint/scope-manager + + + + + +## [3.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.0...v3.9.1) (2020-08-17) + +**Note:** Version bump only for package @typescript-eslint/scope-manager + + + + + +# [3.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.8.0...v3.9.0) (2020-08-10) + + +### Features + +* **typescript-estree:** support TSv4 labelled tuple members ([#2378](https://github.com/typescript-eslint/typescript-eslint/issues/2378)) ([00d84ff](https://github.com/typescript-eslint/typescript-eslint/commit/00d84ffbcbe9d0ec98bdb2f2ce59959a27ce4dbe)) + + + + + +# [3.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.1...v3.8.0) (2020-08-03) + +**Note:** Version bump only for package @typescript-eslint/scope-manager + + + + + +## [3.7.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.0...v3.7.1) (2020-07-27) + +**Note:** Version bump only for package @typescript-eslint/scope-manager + + + + + +# [3.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.1...v3.7.0) (2020-07-20) + +**Note:** Version bump only for package @typescript-eslint/scope-manager + + + + + +## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) + +**Note:** Version bump only for package @typescript-eslint/scope-manager + + + + + +# [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) + +**Note:** Version bump only for package @typescript-eslint/scope-manager + + + + + +# [3.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.4.0...v3.5.0) (2020-06-29) + + +### Features + +* add package scope-manager ([#1939](https://github.com/typescript-eslint/typescript-eslint/issues/1939)) ([682eb7e](https://github.com/typescript-eslint/typescript-eslint/commit/682eb7e009c3f22a542882dfd3602196a60d2a1e)) diff --git a/node_modules/@typescript-eslint/scope-manager/LICENSE b/node_modules/@typescript-eslint/scope-manager/LICENSE new file mode 100644 index 000000000..7e7370143 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 TypeScript ESLint and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@typescript-eslint/scope-manager/README.md b/node_modules/@typescript-eslint/scope-manager/README.md new file mode 100644 index 000000000..24ccd839d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/README.md @@ -0,0 +1,113 @@ +

TypeScript Scope Manager

+ +

+ CI + NPM Version + NPM Downloads +

+ +This is a fork of [`eslint-scope`](https://github.com/eslint/eslint-scope), enhanced to support TypeScript functionality. +[You can view the original licence for the code here](https://github.com/eslint/eslint-scope/blob/dbddf14d5771b21b5da704213e4508c660ca1c64/LICENSE). + +This package is consumed automatically by [`@typescript-eslint/parser`](../parser). +You probably don't want to use it directly. + +## Getting Started + +**[You can find our Getting Started docs here](../../docs/getting-started/linting/README.md)** + +## Installation + +```bash +$ yarn add -D typescript @typescript-eslint/scope-manager +$ npm i --save-dev typescript @typescript-eslint/scope-manager +``` + +## API + +### `analyze(tree, options)` + +Analyses a given AST and returns the resulting `ScopeManager`. + +```ts +interface AnalyzeOptions { + /** + * Known visitor keys. + */ + childVisitorKeys?: Record | null; + + /** + * Which ECMAScript version is considered. + * Defaults to `2018`. + */ + ecmaVersion?: EcmaVersion; + + /** + * Whether the whole script is executed under node.js environment. + * When enabled, the scope manager adds a function scope immediately following the global scope. + * Defaults to `false`. + */ + globalReturn?: boolean; + + /** + * Implied strict mode (if ecmaVersion >= 5). + * Defaults to `false`. + */ + impliedStrict?: boolean; + + /** + * The identifier that's used for JSX Element creation (after transpilation). + * This should not be a member expression - just the root identifier (i.e. use "React" instead of "React.createElement"). + * Defaults to `"React"`. + */ + jsxPragma?: string; + + /** + * The identifier that's used for JSX fragment elements (after transpilation). + * If `null`, assumes transpilation will always use a member on `jsxFactory` (i.e. React.Fragment). + * This should not be a member expression - just the root identifier (i.e. use "h" instead of "h.Fragment"). + * Defaults to `null`. + */ + jsxFragmentName?: string | null; + + /** + * The lib used by the project. + * This automatically defines a type variable for any types provided by the configured TS libs. + * For more information, see https://www.typescriptlang.org/tsconfig#lib + * + * Defaults to the lib for the provided `ecmaVersion`. + */ + lib?: Lib[]; + + /** + * The source type of the script. + */ + sourceType?: 'script' | 'module'; +} +``` + +Example usage: + +```ts +import { analyze } from '@typescript-eslint/scope-manager'; +import { parse } from '@typescript-eslint/typescript-estree'; + +const code = `const hello: string = 'world';`; +const ast = parse(code, { + // note that scope-manager requires ranges on the AST + range: true, +}); +const scope = analyze(ast, { + ecmaVersion: 2020, + sourceType: 'module', +}); +``` + +## References + +- https://eslint.org/docs/developer-guide/scope-manager-interface +- https://github.com/eslint/eslint-scope + +## Contributing + +[See the contributing guide here](../../CONTRIBUTING.md) diff --git a/node_modules/@typescript-eslint/scope-manager/dist/ID.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/ID.d.ts new file mode 100644 index 000000000..679109f24 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/ID.d.ts @@ -0,0 +1,4 @@ +declare function createIdGenerator(): () => number; +declare function resetIds(): void; +export { createIdGenerator, resetIds }; +//# sourceMappingURL=ID.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/ID.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/ID.d.ts.map new file mode 100644 index 000000000..2c9c0fd0d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/ID.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ID.d.ts","sourceRoot":"","sources":["../src/ID.ts"],"names":[],"mappings":"AAGA,iBAAS,iBAAiB,IAAI,MAAM,MAAM,CAUzC;AAED,iBAAS,QAAQ,IAAI,IAAI,CAExB;AAED,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/ID.js b/node_modules/@typescript-eslint/scope-manager/dist/ID.js new file mode 100644 index 000000000..a5404c07b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/ID.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resetIds = exports.createIdGenerator = void 0; +const ID_CACHE = new Map(); +let NEXT_KEY = 0; +function createIdGenerator() { + const key = (NEXT_KEY += 1); + ID_CACHE.set(key, 0); + return () => { + var _a; + const current = (_a = ID_CACHE.get(key)) !== null && _a !== void 0 ? _a : 0; + const next = current + 1; + ID_CACHE.set(key, next); + return next; + }; +} +exports.createIdGenerator = createIdGenerator; +function resetIds() { + ID_CACHE.clear(); +} +exports.resetIds = resetIds; +//# sourceMappingURL=ID.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/ID.js.map b/node_modules/@typescript-eslint/scope-manager/dist/ID.js.map new file mode 100644 index 000000000..ec2b09d01 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/ID.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ID.js","sourceRoot":"","sources":["../src/ID.ts"],"names":[],"mappings":";;;AAAA,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;AAC3C,IAAI,QAAQ,GAAG,CAAC,CAAC;AAEjB,SAAS,iBAAiB;IACxB,MAAM,GAAG,GAAG,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC;IAC5B,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IAErB,OAAO,GAAW,EAAE;;QAClB,MAAM,OAAO,SAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,mCAAI,CAAC,CAAC;QACvC,MAAM,IAAI,GAAG,OAAO,GAAG,CAAC,CAAC;QACzB,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AAMQ,8CAAiB;AAJ1B,SAAS,QAAQ;IACf,QAAQ,CAAC,KAAK,EAAE,CAAC;AACnB,CAAC;AAE2B,4BAAQ"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.d.ts new file mode 100644 index 000000000..0412263a3 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.d.ts @@ -0,0 +1,68 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { BlockScope, CatchScope, ClassScope, ConditionalTypeScope, ForScope, FunctionExpressionNameScope, FunctionScope, FunctionTypeScope, GlobalScope, MappedTypeScope, ModuleScope, Scope, SwitchScope, TSEnumScope, TSModuleScope, TypeScope, WithScope } from './scope'; +import { Variable } from './variable'; +interface ScopeManagerOptions { + globalReturn?: boolean; + sourceType?: 'module' | 'script'; + impliedStrict?: boolean; + ecmaVersion?: number; +} +declare class ScopeManager { + #private; + currentScope: Scope | null; + readonly declaredVariables: WeakMap; + /** + * The root scope + * @public + */ + globalScope: GlobalScope | null; + readonly nodeToScope: WeakMap; + /** + * All scopes + * @public + */ + readonly scopes: Scope[]; + get variables(): Variable[]; + constructor(options: ScopeManagerOptions); + isGlobalReturn(): boolean; + isModule(): boolean; + isImpliedStrict(): boolean; + isStrictModeSupported(): boolean; + isES6(): boolean; + /** + * 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. + * @param node An AST node to get their variables. + * @public + */ + getDeclaredVariables(node: TSESTree.Node): Variable[]; + /** + * 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`. + * + * @param node An AST node to get their scope. + * @param inner If the node has multiple scopes, this returns the outermost scope normally. + * If `inner` is `true` then this returns the innermost scope. + * @public + */ + acquire(node: TSESTree.Node, inner?: boolean): Scope | null; + protected nestScope(scope: T): T; + nestBlockScope(node: BlockScope['block']): BlockScope; + nestCatchScope(node: CatchScope['block']): CatchScope; + nestClassScope(node: ClassScope['block']): ClassScope; + nestConditionalTypeScope(node: ConditionalTypeScope['block']): ConditionalTypeScope; + nestForScope(node: ForScope['block']): ForScope; + nestFunctionExpressionNameScope(node: FunctionExpressionNameScope['block']): FunctionExpressionNameScope; + nestFunctionScope(node: FunctionScope['block'], isMethodDefinition: boolean): FunctionScope; + nestFunctionTypeScope(node: FunctionTypeScope['block']): FunctionTypeScope; + nestGlobalScope(node: GlobalScope['block']): GlobalScope; + nestMappedTypeScope(node: MappedTypeScope['block']): MappedTypeScope; + nestModuleScope(node: ModuleScope['block']): ModuleScope; + nestSwitchScope(node: SwitchScope['block']): SwitchScope; + nestTSEnumScope(node: TSEnumScope['block']): TSEnumScope; + nestTSModuleScope(node: TSModuleScope['block']): TSModuleScope; + nestTypeScope(node: TypeScope['block']): TypeScope; + nestWithScope(node: WithScope['block']): WithScope; +} +export { ScopeManager }; +//# sourceMappingURL=ScopeManager.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.d.ts.map new file mode 100644 index 000000000..9f80fe3d0 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ScopeManager.d.ts","sourceRoot":"","sources":["../src/ScopeManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EACL,UAAU,EACV,UAAU,EACV,UAAU,EACV,oBAAoB,EACpB,QAAQ,EACR,2BAA2B,EAC3B,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,WAAW,EACX,KAAK,EACL,WAAW,EACX,WAAW,EACX,aAAa,EACb,SAAS,E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AG,UAAU;IAKrD,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,UAAU;IAKrD,wBAAwB,CAC7B,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC,GAClC,oBAAoB;IAOhB,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,QAAQ;IAK/C,+BAA+B,CACpC,IAAI,EAAE,2BAA2B,CAAC,OAAO,CAAC,GACzC,2BAA2B;IAOvB,iBAAiB,CACtB,IAAI,EAAE,aAAa,CAAC,OAAO,CAAC,EAC5B,kBAAkB,EAAE,OAAO,GAC1B,aAAa;IAOT,qBAAqB,CAC1B,IAAI,EAAE,iBAAiB,CAAC,OAAO,CAAC,GAC/B,iBAAiB;IAKb,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,WAAW;IAIxD,mBAAmB,CAAC,IAAI,EAAE,eAAe,CAAC,OAAO,CAAC,GAAG,eAAe;IAKpE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,WAAW;IAKxD,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,WAAW;IAKxD,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,WAAW;IAKxD,iBAAiB,CAAC,IAAI,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,aAAa;IAK9D,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,SAAS;IAKlD,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,SAAS;CAI1D;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.js b/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.js new file mode 100644 index 000000000..96567915d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.js @@ -0,0 +1,181 @@ +"use strict"; +var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; +}; +var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); +}; +var _options; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ScopeManager = void 0; +const assert_1 = require("./assert"); +const scope_1 = require("./scope"); +class ScopeManager { + constructor(options) { + _options.set(this, void 0); + this.scopes = []; + this.globalScope = null; + this.nodeToScope = new WeakMap(); + this.currentScope = null; + __classPrivateFieldSet(this, _options, options); + this.declaredVariables = new WeakMap(); + } + get variables() { + const variables = new Set(); + function recurse(scope) { + scope.variables.forEach(v => variables.add(v)); + scope.childScopes.forEach(recurse); + } + this.scopes.forEach(recurse); + return Array.from(variables).sort((a, b) => a.$id - b.$id); + } + isGlobalReturn() { + return __classPrivateFieldGet(this, _options).globalReturn === true; + } + isModule() { + return __classPrivateFieldGet(this, _options).sourceType === 'module'; + } + isImpliedStrict() { + return __classPrivateFieldGet(this, _options).impliedStrict === true; + } + isStrictModeSupported() { + return __classPrivateFieldGet(this, _options).ecmaVersion != null && __classPrivateFieldGet(this, _options).ecmaVersion >= 5; + } + isES6() { + return __classPrivateFieldGet(this, _options).ecmaVersion != null && __classPrivateFieldGet(this, _options).ecmaVersion >= 6; + } + /** + * 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. + * @param node An AST node to get their variables. + * @public + */ + getDeclaredVariables(node) { + var _a; + return (_a = this.declaredVariables.get(node)) !== null && _a !== void 0 ? _a : []; + } + /** + * 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`. + * + * @param node An AST node to get their scope. + * @param inner If the node has multiple scopes, this returns the outermost scope normally. + * If `inner` is `true` then this returns the innermost scope. + * @public + */ + acquire(node, inner = false) { + function predicate(testScope) { + if (testScope.type === 'function' && testScope.functionExpressionScope) { + return false; + } + return true; + } + const scopes = this.nodeToScope.get(node); + if (!scopes || scopes.length === 0) { + return null; + } + // Heuristic selection from all scopes. + // If you would like to get all scopes, please use ScopeManager#acquireAll. + if (scopes.length === 1) { + return scopes[0]; + } + if (inner) { + for (let i = scopes.length - 1; i >= 0; --i) { + const scope = scopes[i]; + if (predicate(scope)) { + return scope; + } + } + } + else { + for (let i = 0; i < scopes.length; ++i) { + const scope = scopes[i]; + if (predicate(scope)) { + return scope; + } + } + } + return null; + } + nestScope(scope) { + if (scope instanceof scope_1.GlobalScope) { + assert_1.assert(this.currentScope === null); + this.globalScope = scope; + } + this.currentScope = scope; + return scope; + } + nestBlockScope(node) { + assert_1.assert(this.currentScope); + return this.nestScope(new scope_1.BlockScope(this, this.currentScope, node)); + } + nestCatchScope(node) { + assert_1.assert(this.currentScope); + return this.nestScope(new scope_1.CatchScope(this, this.currentScope, node)); + } + nestClassScope(node) { + assert_1.assert(this.currentScope); + return this.nestScope(new scope_1.ClassScope(this, this.currentScope, node)); + } + nestConditionalTypeScope(node) { + assert_1.assert(this.currentScope); + return this.nestScope(new scope_1.ConditionalTypeScope(this, this.currentScope, node)); + } + nestForScope(node) { + assert_1.assert(this.currentScope); + return this.nestScope(new scope_1.ForScope(this, this.currentScope, node)); + } + nestFunctionExpressionNameScope(node) { + assert_1.assert(this.currentScope); + return this.nestScope(new scope_1.FunctionExpressionNameScope(this, this.currentScope, node)); + } + nestFunctionScope(node, isMethodDefinition) { + assert_1.assert(this.currentScope); + return this.nestScope(new scope_1.FunctionScope(this, this.currentScope, node, isMethodDefinition)); + } + nestFunctionTypeScope(node) { + assert_1.assert(this.currentScope); + return this.nestScope(new scope_1.FunctionTypeScope(this, this.currentScope, node)); + } + nestGlobalScope(node) { + return this.nestScope(new scope_1.GlobalScope(this, node)); + } + nestMappedTypeScope(node) { + assert_1.assert(this.currentScope); + return this.nestScope(new scope_1.MappedTypeScope(this, this.currentScope, node)); + } + nestModuleScope(node) { + assert_1.assert(this.currentScope); + return this.nestScope(new scope_1.ModuleScope(this, this.currentScope, node)); + } + nestSwitchScope(node) { + assert_1.assert(this.currentScope); + return this.nestScope(new scope_1.SwitchScope(this, this.currentScope, node)); + } + nestTSEnumScope(node) { + assert_1.assert(this.currentScope); + return this.nestScope(new scope_1.TSEnumScope(this, this.currentScope, node)); + } + nestTSModuleScope(node) { + assert_1.assert(this.currentScope); + return this.nestScope(new scope_1.TSModuleScope(this, this.currentScope, node)); + } + nestTypeScope(node) { + assert_1.assert(this.currentScope); + return this.nestScope(new scope_1.TypeScope(this, this.currentScope, node)); + } + nestWithScope(node) { + assert_1.assert(this.currentScope); + return this.nestScope(new scope_1.WithScope(this, this.currentScope, node)); + } +} +exports.ScopeManager = ScopeManager; +_options = new WeakMap(); +//# sourceMappingURL=ScopeManager.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.js.map b/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.js.map new file mode 100644 index 000000000..2eda4ba8e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ScopeManager.js","sourceRoot":"","sources":["../src/ScopeManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,qCAAkC;AAClC,mCAkBiB;AAWjB,MAAM,YAAY;IA0BhB,YAAY,OAA4B;QAjBxC,2BAAuC;QAkBrC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,WAAW,GAAG,IAAI,OAAO,EAAE,CAAC;QACjC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,uBAAA,IAAI,YAAY,OAAO,EAAC;QACxB,IAAI,CA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AAY,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,mBAAW,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC;IACxE,CAAC;IAEM,iBAAiB,CAAC,IAA4B;QACnD,eAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,qBAAa,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC;IAC1E,CAAC;IAEM,aAAa,CAAC,IAAwB;QAC3C,eAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,iBAAS,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC;IACtE,CAAC;IAEM,aAAa,CAAC,IAAwB;QAC3C,eAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,iBAAS,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC;IACtE,CAAC;CACF;AAEQ,oCAAY"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/analyze.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/analyze.d.ts new file mode 100644 index 000000000..77c03f2a2 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/analyze.d.ts @@ -0,0 +1,56 @@ +import { TSESTree, EcmaVersion, Lib } from '@typescript-eslint/types'; +import { ReferencerOptions } from './referencer'; +import { ScopeManager } from './ScopeManager'; +interface AnalyzeOptions { + /** + * Known visitor keys. + */ + childVisitorKeys?: ReferencerOptions['childVisitorKeys']; + /** + * Which ECMAScript version is considered. + * Defaults to `2018`. + */ + ecmaVersion?: EcmaVersion; + /** + * Whether the whole script is executed under node.js environment. + * When enabled, the scope manager adds a function scope immediately following the global scope. + * Defaults to `false`. + */ + globalReturn?: boolean; + /** + * Implied strict mode (if ecmaVersion >= 5). + * Defaults to `false`. + */ + impliedStrict?: boolean; + /** + * The identifier that's used for JSX Element creation (after transpilation). + * This should not be a member expression - just the root identifier (i.e. use "React" instead of "React.createElement"). + * Defaults to `"React"`. + */ + jsxPragma?: string; + /** + * The identifier that's used for JSX fragment elements (after transpilation). + * If `null`, assumes transpilation will always use a member on `jsxFactory` (i.e. React.Fragment). + * This should not be a member expression - just the root identifier (i.e. use "h" instead of "h.Fragment"). + * Defaults to `null`. + */ + jsxFragmentName?: string | null; + /** + * The lib used by the project. + * This automatically defines a type variable for any types provided by the configured TS libs. + * Defaults to the lib for the provided `ecmaVersion`. + * + * https://www.typescriptlang.org/tsconfig#lib + */ + lib?: Lib[]; + /** + * The source type of the script. + */ + sourceType?: 'script' | 'module'; +} +/** + * Takes an AST and returns the analyzed scopes. + */ +declare function analyze(tree: TSESTree.Node, providedOptions?: AnalyzeOptions): ScopeManager; +export { analyze, AnalyzeOptions }; +//# sourceMappingURL=analyze.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/analyze.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/analyze.d.ts.map new file mode 100644 index 000000000..ce287b9be --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/analyze.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../src/analyze.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAEtE,OAAO,EAAc,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAO9C,UAAU,cAAc;IACtB;;OAEG;IACH,gBAAgB,CAAC,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;IAEzD;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC;IAEZ;;OAEG;IACH,UAAU,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAClC;AAwBD;;GAEG;AACH,iBAAS,OAAO,CACd,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,eAAe,CAAC,EAAE,cAAc,GAC/B,YAAY,CA0Bd;AAED,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/analyze.js b/node_modules/@typescript-eslint/scope-manager/dist/analyze.js new file mode 100644 index 000000000..611b2125f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/analyze.js @@ -0,0 +1,50 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.analyze = void 0; +const visitor_keys_1 = require("@typescript-eslint/visitor-keys"); +const referencer_1 = require("./referencer"); +const ScopeManager_1 = require("./ScopeManager"); +const lib_1 = require("./lib"); +const DEFAULT_OPTIONS = { + childVisitorKeys: visitor_keys_1.visitorKeys, + ecmaVersion: 2018, + globalReturn: false, + impliedStrict: false, + jsxPragma: 'React', + jsxFragmentName: null, + lib: ['es2018'], + sourceType: 'script', +}; +function mapEcmaVersion(version) { + if (version == null || version === 3 || version === 5) { + return 'es5'; + } + const year = version > 2000 ? version : 2015 + (version - 6); + const lib = `es${year}`; + return lib in lib_1.lib ? lib : year > 2020 ? 'esnext' : 'es5'; +} +/** + * Takes an AST and returns the analyzed scopes. + */ +function analyze(tree, providedOptions) { + var _a, _b, _c, _d, _e, _f, _g, _h; + const ecmaVersion = (_a = providedOptions === null || providedOptions === void 0 ? void 0 : providedOptions.ecmaVersion) !== null && _a !== void 0 ? _a : DEFAULT_OPTIONS.ecmaVersion; + const options = { + childVisitorKeys: (_b = providedOptions === null || providedOptions === void 0 ? void 0 : providedOptions.childVisitorKeys) !== null && _b !== void 0 ? _b : DEFAULT_OPTIONS.childVisitorKeys, + ecmaVersion, + globalReturn: (_c = providedOptions === null || providedOptions === void 0 ? void 0 : providedOptions.globalReturn) !== null && _c !== void 0 ? _c : DEFAULT_OPTIONS.globalReturn, + impliedStrict: (_d = providedOptions === null || providedOptions === void 0 ? void 0 : providedOptions.impliedStrict) !== null && _d !== void 0 ? _d : DEFAULT_OPTIONS.impliedStrict, + jsxPragma: (_e = providedOptions === null || providedOptions === void 0 ? void 0 : providedOptions.jsxPragma) !== null && _e !== void 0 ? _e : DEFAULT_OPTIONS.jsxPragma, + jsxFragmentName: (_f = providedOptions === null || providedOptions === void 0 ? void 0 : providedOptions.jsxFragmentName) !== null && _f !== void 0 ? _f : DEFAULT_OPTIONS.jsxFragmentName, + sourceType: (_g = providedOptions === null || providedOptions === void 0 ? void 0 : providedOptions.sourceType) !== null && _g !== void 0 ? _g : DEFAULT_OPTIONS.sourceType, + lib: (_h = providedOptions === null || providedOptions === void 0 ? void 0 : providedOptions.lib) !== null && _h !== void 0 ? _h : [mapEcmaVersion(ecmaVersion)], + }; + // ensure the option is lower cased + options.lib = options.lib.map(l => l.toLowerCase()); + const scopeManager = new ScopeManager_1.ScopeManager(options); + const referencer = new referencer_1.Referencer(options, scopeManager); + referencer.visit(tree); + return scopeManager; +} +exports.analyze = analyze; +//# sourceMappingURL=analyze.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/analyze.js.map b/node_modules/@typescript-eslint/scope-manager/dist/analyze.js.map new file mode 100644 index 000000000..dd445117b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/analyze.js.map @@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CAAC,YAAY;QAC3E,aAAa,QACX,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,aAAa,mCAAI,eAAe,CAAC,aAAa;QACjE,SAAS,QAAE,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,SAAS,mCAAI,eAAe,CAAC,SAAS;QAClE,eAAe,QACb,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,eAAe,mCAAI,eAAe,CAAC,eAAe;QACrE,UAAU,QAAE,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,UAAU,mCAAI,eAAe,CAAC,UAAU;QACrE,GAAG,QAAE,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,GAAG,mCAAI,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;KAC3D,CAAC;IAEF,mCAAmC;IACnC,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAS,CAAC,CAAC;IAE3D,MAAM,YAAY,GAAG,IAAI,2BAAY,CAAC,OAAO,CAAC,CAAC;IAC/C,MAAM,UAAU,GAAG,IAAI,uBAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAEzD,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEvB,OAAO,YAAY,CAAC;AACtB,CAAC;AAEQ,0BAAO"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/assert.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/assert.d.ts new file mode 100644 index 000000000..bd40c9e22 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/assert.d.ts @@ -0,0 +1,3 @@ +declare function assert(value: unknown, message?: string): asserts value; +export { assert }; +//# sourceMappingURL=assert.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/assert.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/assert.d.ts.map new file mode 100644 index 000000000..72f278dd6 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/assert.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../src/assert.ts"],"names":[],"mappings":"AACA,iBAAS,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAI/D;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/assert.js b/node_modules/@typescript-eslint/scope-manager/dist/assert.js new file mode 100644 index 000000000..8c805233f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/assert.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assert = void 0; +// the base assert module doesn't use ts assertion syntax +function assert(value, message) { + if (value == null) { + throw new Error(message); + } +} +exports.assert = assert; +//# sourceMappingURL=assert.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/assert.js.map b/node_modules/@typescript-eslint/scope-manager/dist/assert.js.map new file mode 100644 index 000000000..60cbdc277 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/assert.js.map @@ -0,0 +1 @@ +{"version":3,"file":"assert.js","sourceRoot":"","sources":["../src/assert.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AACzD,SAAS,MAAM,CAAC,KAAc,EAAE,OAAgB;IAC9C,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;KAC1B;AACH,CAAC;AAEQ,wBAAM"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.d.ts new file mode 100644 index 000000000..515ed1e7b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.d.ts @@ -0,0 +1,10 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { DefinitionType } from './DefinitionType'; +import { DefinitionBase } from './DefinitionBase'; +declare class CatchClauseDefinition extends DefinitionBase { + constructor(name: TSESTree.BindingName, node: CatchClauseDefinition['node']); + readonly isTypeDefinition = false; + readonly isVariableDefinition = true; +} +export { CatchClauseDefinition }; +//# sourceMappingURL=CatchClauseDefinition.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.d.ts.map new file mode 100644 index 000000000..7902e5ba7 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CatchClauseDefinition.d.ts","sourceRoot":"","sources":["../../src/definition/CatchClauseDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,cAAM,qBAAsB,SAAQ,cAAc,CAChD,cAAc,CAAC,WAAW,EAC1B,QAAQ,CAAC,WAAW,EACpB,IAAI,EACJ,QAAQ,CAAC,WAAW,CACrB;gBACa,IAAI,EAAE,QAAQ,CAAC,WAAW,EAAE,IAAI,EAAE,qBAAqB,CAAC,MAAM,CAAC;IAI3E,SAAgB,gBAAgB,SAAS;IACzC,SAAgB,oBAAoB,QAAQ;CAC7C;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.js new file mode 100644 index 000000000..78526ff58 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CatchClauseDefinition = void 0; +const DefinitionType_1 = require("./DefinitionType"); +const DefinitionBase_1 = require("./DefinitionBase"); +class CatchClauseDefinition extends DefinitionBase_1.DefinitionBase { + constructor(name, node) { + super(DefinitionType_1.DefinitionType.CatchClause, name, node, null); + this.isTypeDefinition = false; + this.isVariableDefinition = true; + } +} +exports.CatchClauseDefinition = CatchClauseDefinition; +//# sourceMappingURL=CatchClauseDefinition.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.js.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.js.map new file mode 100644 index 000000000..13ef7a581 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CatchClauseDefinition.js","sourceRoot":"","sources":["../../src/definition/CatchClauseDefinition.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAClD,qDAAkD;AAElD,MAAM,qBAAsB,SAAQ,+BAKnC;IACC,YAAY,IAA0B,EAAE,IAAmC;QACzE,KAAK,CAAC,+BAAc,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAGtC,qBAAgB,GAAG,KAAK,CAAC;QACzB,yBAAoB,GAAG,IAAI,CAAC;IAH5C,CAAC;CAIF;AAEQ,sDAAqB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.d.ts new file mode 100644 index 000000000..52efe4ca4 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.d.ts @@ -0,0 +1,10 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { DefinitionType } from './DefinitionType'; +import { DefinitionBase } from './DefinitionBase'; +declare class ClassNameDefinition extends DefinitionBase { + constructor(name: TSESTree.Identifier, node: ClassNameDefinition['node']); + readonly isTypeDefinition = true; + readonly isVariableDefinition = true; +} +export { ClassNameDefinition }; +//# sourceMappingURL=ClassNameDefinition.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.d.ts.map new file mode 100644 index 000000000..35a251f11 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ClassNameDefinition.d.ts","sourceRoot":"","sources":["../../src/definition/ClassNameDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,cAAM,mBAAoB,SAAQ,cAAc,CAC9C,cAAc,CAAC,SAAS,EACxB,QAAQ,CAAC,gBAAgB,GAAG,QAAQ,CAAC,eAAe,EACpD,IAAI,EACJ,QAAQ,CAAC,UAAU,CACpB;gBACa,IAAI,EAAE,QAAQ,CAAC,UAAU,EAAE,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC;IAIxE,SAAgB,gBAAgB,QAAQ;IACxC,SAAgB,oBAAoB,QAAQ;CAC7C;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.js new file mode 100644 index 000000000..a24d9c9a5 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClassNameDefinition = void 0; +const DefinitionType_1 = require("./DefinitionType"); +const DefinitionBase_1 = require("./DefinitionBase"); +class ClassNameDefinition extends DefinitionBase_1.DefinitionBase { + constructor(name, node) { + super(DefinitionType_1.DefinitionType.ClassName, name, node, null); + this.isTypeDefinition = true; + this.isVariableDefinition = true; + } +} +exports.ClassNameDefinition = ClassNameDefinition; +//# sourceMappingURL=ClassNameDefinition.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.js.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.js.map new file mode 100644 index 000000000..4555e1f26 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ClassNameDefinition.js","sourceRoot":"","sources":["../../src/definition/ClassNameDefinition.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAClD,qDAAkD;AAElD,MAAM,mBAAoB,SAAQ,+BAKjC;IACC,YAAY,IAAyB,EAAE,IAAiC;QACtE,KAAK,CAAC,+BAAc,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAGpC,qBAAgB,GAAG,IAAI,CAAC;QACxB,yBAAoB,GAAG,IAAI,CAAC;IAH5C,CAAC;CAIF;AAEQ,kDAAmB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.d.ts new file mode 100644 index 000000000..f95c19970 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.d.ts @@ -0,0 +1,14 @@ +import { CatchClauseDefinition } from './CatchClauseDefinition'; +import { ClassNameDefinition } from './ClassNameDefinition'; +import { FunctionNameDefinition } from './FunctionNameDefinition'; +import { ImplicitGlobalVariableDefinition } from './ImplicitGlobalVariableDefinition'; +import { ImportBindingDefinition } from './ImportBindingDefinition'; +import { ParameterDefinition } from './ParameterDefinition'; +import { TSEnumMemberDefinition } from './TSEnumMemberDefinition'; +import { TSEnumNameDefinition } from './TSEnumNameDefinition'; +import { TSModuleNameDefinition } from './TSModuleNameDefinition'; +import { TypeDefinition } from './TypeDefinition'; +import { VariableDefinition } from './VariableDefinition'; +declare type Definition = CatchClauseDefinition | ClassNameDefinition | FunctionNameDefinition | ImplicitGlobalVariableDefinition | ImportBindingDefinition | ParameterDefinition | TSEnumMemberDefinition | TSEnumNameDefinition | TSModuleNameDefinition | TypeDefinition | VariableDefinition; +export { Definition }; +//# sourceMappingURL=Definition.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.d.ts.map new file mode 100644 index 000000000..5d7bab9b5 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Definition.d.ts","sourceRoot":"","sources":["../../src/definition/Definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,aAAK,UAAU,GACX,qBAAqB,GACrB,mBAAmB,GACnB,sBAAsB,GACtB,gCAAgC,GAChC,uBAAuB,GACvB,mBAAmB,GACnB,sBAAsB,GACtB,oBAAoB,GACpB,sBAAsB,GACtB,cAAc,GACd,kBAAkB,CAAC;AAEvB,OAAO,EAAE,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.js new file mode 100644 index 000000000..0d4aab95f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=Definition.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.js.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.js.map new file mode 100644 index 000000000..be4a7fb35 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Definition.js","sourceRoot":"","sources":["../../src/definition/Definition.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.d.ts new file mode 100644 index 000000000..380859a3f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.d.ts @@ -0,0 +1,39 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { DefinitionType } from './DefinitionType'; +declare abstract class DefinitionBase { + /** + * A unique ID for this instance - primarily used to help debugging and testing + */ + readonly $id: number; + /** + * The type of the definition + * @public + */ + readonly type: TType; + /** + * The `Identifier` node of this definition + * @public + */ + readonly name: TName; + /** + * The enclosing node of the name. + * @public + */ + readonly node: TNode; + /** + * the enclosing statement node of the identifier. + * @public + */ + readonly parent: TParent; + constructor(type: TType, name: TName, node: TNode, parent: TParent); + /** + * `true` if the variable is valid in a type context, false otherwise + */ + abstract readonly isTypeDefinition: boolean; + /** + * `true` if the variable is valid in a value context, false otherwise + */ + abstract readonly isVariableDefinition: boolean; +} +export { DefinitionBase }; +//# sourceMappingURL=DefinitionBase.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.d.ts.map new file mode 100644 index 000000000..377949af9 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DefinitionBase.d.ts","sourceRoot":"","sources":["../../src/definition/DefinitionBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAKlD,uBAAe,cAAc,CAC3B,KAAK,SAAS,cAAc,EAC5B,KAAK,SAAS,QAAQ,CAAC,IAAI,EAC3B,OAAO,SAAS,QAAQ,CAAC,IAAI,GAAG,IAAI,EACpC,KAAK,SAAS,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,WAAW;IAElD;;OAEG;IACH,SAAgB,GAAG,EAAE,MAAM,CAAe;IAE1C;;;OAGG;IACH,SAAgB,IAAI,EAAE,KAAK,CAAC;IAE5B;;;OAGG;IACH,SAAgB,IAAI,EAAE,KAAK,CAAC;IAE5B;;;OAGG;IACH,SAAgB,IAAI,EAAE,KAAK,CAAC;IAE5B;;;OAGG;IACH,SAAgB,MAAM,EAAE,OAAO,CAAC;gBAEpB,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO;IAOlE;;OAEG;IACH,kBAAyB,gBAAgB,EAAE,OAAO,CAAC;IAEnD;;OAEG;IACH,kBAAyB,oBAAoB,EAAE,OAAO,CAAC;CACxD;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.js new file mode 100644 index 000000000..6e7a9f5dc --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DefinitionBase = void 0; +const ID_1 = require("../ID"); +const generator = ID_1.createIdGenerator(); +class DefinitionBase { + constructor(type, name, node, parent) { + /** + * A unique ID for this instance - primarily used to help debugging and testing + */ + this.$id = generator(); + this.type = type; + this.name = name; + this.node = node; + this.parent = parent; + } +} +exports.DefinitionBase = DefinitionBase; +//# sourceMappingURL=DefinitionBase.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.js.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.js.map new file mode 100644 index 000000000..2a1e89ed0 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.js.map @@ -0,0 +1 @@ +{"version":3,"file":"DefinitionBase.js","sourceRoot":"","sources":["../../src/definition/DefinitionBase.ts"],"names":[],"mappings":";;;AAEA,8BAA0C;AAE1C,MAAM,SAAS,GAAG,sBAAiB,EAAE,CAAC;AAEtC,MAAe,cAAc;IAmC3B,YAAY,IAAW,EAAE,IAAW,EAAE,IAAW,EAAE,MAAe;QA7BlE;;WAEG;QACa,QAAG,GAAW,SAAS,EAAE,CAAC;QA2BxC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CAWF;AAEQ,wCAAc"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.d.ts new file mode 100644 index 000000000..d86220d8c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.d.ts @@ -0,0 +1,15 @@ +declare enum DefinitionType { + CatchClause = "CatchClause", + ClassName = "ClassName", + FunctionName = "FunctionName", + ImplicitGlobalVariable = "ImplicitGlobalVariable", + ImportBinding = "ImportBinding", + Parameter = "Parameter", + TSEnumName = "TSEnumName", + TSEnumMember = "TSEnumMemberName", + TSModuleName = "TSModuleName", + Type = "Type", + Variable = "Variable" +} +export { DefinitionType }; +//# sourceMappingURL=DefinitionType.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.d.ts.map new file mode 100644 index 000000000..907e6b3fc --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DefinitionType.d.ts","sourceRoot":"","sources":["../../src/definition/DefinitionType.ts"],"names":[],"mappings":"AAAA,aAAK,cAAc;IAEjB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,YAAY,iBAAiB;IAC7B,sBAAsB,2BAA2B;IACjD,aAAa,kBAAkB;IAC/B,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,YAAY,qBAAqB;IACjC,YAAY,iBAAiB;IAC7B,IAAI,SAAS;IACb,QAAQ,aAAa;CACtB;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.js new file mode 100644 index 000000000..326303419 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DefinitionType = void 0; +var DefinitionType; +(function (DefinitionType) { + // eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum + DefinitionType["CatchClause"] = "CatchClause"; + DefinitionType["ClassName"] = "ClassName"; + DefinitionType["FunctionName"] = "FunctionName"; + DefinitionType["ImplicitGlobalVariable"] = "ImplicitGlobalVariable"; + DefinitionType["ImportBinding"] = "ImportBinding"; + DefinitionType["Parameter"] = "Parameter"; + DefinitionType["TSEnumName"] = "TSEnumName"; + DefinitionType["TSEnumMember"] = "TSEnumMemberName"; + DefinitionType["TSModuleName"] = "TSModuleName"; + DefinitionType["Type"] = "Type"; + DefinitionType["Variable"] = "Variable"; +})(DefinitionType || (DefinitionType = {})); +exports.DefinitionType = DefinitionType; +//# sourceMappingURL=DefinitionType.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.js.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.js.map new file mode 100644 index 000000000..53434c1a3 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.js.map @@ -0,0 +1 @@ +{"version":3,"file":"DefinitionType.js","sourceRoot":"","sources":["../../src/definition/DefinitionType.ts"],"names":[],"mappings":";;;AAAA,IAAK,cAaJ;AAbD,WAAK,cAAc;IACjB,6EAA6E;IAC7E,6CAA2B,CAAA;IAC3B,yCAAuB,CAAA;IACvB,+CAA6B,CAAA;IAC7B,mEAAiD,CAAA;IACjD,iDAA+B,CAAA;IAC/B,yCAAuB,CAAA;IACvB,2CAAyB,CAAA;IACzB,mDAAiC,CAAA;IACjC,+CAA6B,CAAA;IAC7B,+BAAa,CAAA;IACb,uCAAqB,CAAA;AACvB,CAAC,EAbI,cAAc,KAAd,cAAc,QAalB;AAEQ,wCAAc"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.d.ts new file mode 100644 index 000000000..03b42a585 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.d.ts @@ -0,0 +1,10 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { DefinitionType } from './DefinitionType'; +import { DefinitionBase } from './DefinitionBase'; +declare class FunctionNameDefinition extends DefinitionBase { + constructor(name: TSESTree.Identifier, node: FunctionNameDefinition['node']); + readonly isTypeDefinition = false; + readonly isVariableDefinition = true; +} +export { FunctionNameDefinition }; +//# sourceMappingURL=FunctionNameDefinition.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.d.ts.map new file mode 100644 index 000000000..667b9f274 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"FunctionNameDefinition.d.ts","sourceRoot":"","sources":["../../src/definition/FunctionNameDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,cAAM,sBAAuB,SAAQ,cAAc,CACjD,cAAc,CAAC,YAAY,EACzB,QAAQ,CAAC,mBAAmB,GAC5B,QAAQ,CAAC,kBAAkB,GAC3B,QAAQ,CAAC,iBAAiB,GAC1B,QAAQ,CAAC,6BAA6B,EACxC,IAAI,EACJ,QAAQ,CAAC,UAAU,CACpB;gBACa,IAAI,EAAE,QAAQ,CAAC,UAAU,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;IAI3E,SAAgB,gBAAgB,SAAS;IACzC,SAAgB,oBAAoB,QAAQ;CAC7C;AAED,OAAO,EAAE,sBAAsB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.js new file mode 100644 index 000000000..80692e0ba --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FunctionNameDefinition = void 0; +const DefinitionType_1 = require("./DefinitionType"); +const DefinitionBase_1 = require("./DefinitionBase"); +class FunctionNameDefinition extends DefinitionBase_1.DefinitionBase { + constructor(name, node) { + super(DefinitionType_1.DefinitionType.FunctionName, name, node, null); + this.isTypeDefinition = false; + this.isVariableDefinition = true; + } +} +exports.FunctionNameDefinition = FunctionNameDefinition; +//# sourceMappingURL=FunctionNameDefinition.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.js.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.js.map new file mode 100644 index 000000000..376c65068 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.js.map @@ -0,0 +1 @@ +{"version":3,"file":"FunctionNameDefinition.js","sourceRoot":"","sources":["../../src/definition/FunctionNameDefinition.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAClD,qDAAkD;AAElD,MAAM,sBAAuB,SAAQ,+BAQpC;IACC,YAAY,IAAyB,EAAE,IAAoC;QACzE,KAAK,CAAC,+BAAc,CAAC,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAGvC,qBAAgB,GAAG,KAAK,CAAC;QACzB,yBAAoB,GAAG,IAAI,CAAC;IAH5C,CAAC;CAIF;AAEQ,wDAAsB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.d.ts new file mode 100644 index 000000000..6b9268fc7 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.d.ts @@ -0,0 +1,10 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { DefinitionType } from './DefinitionType'; +import { DefinitionBase } from './DefinitionBase'; +declare class ImplicitGlobalVariableDefinition extends DefinitionBase { + constructor(name: TSESTree.BindingName, node: ImplicitGlobalVariableDefinition['node']); + readonly isTypeDefinition = false; + readonly isVariableDefinition = true; +} +export { ImplicitGlobalVariableDefinition }; +//# sourceMappingURL=ImplicitGlobalVariableDefinition.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.d.ts.map new file mode 100644 index 000000000..098d9a960 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ImplicitGlobalVariableDefinition.d.ts","sourceRoot":"","sources":["../../src/definition/ImplicitGlobalVariableDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,cAAM,gCAAiC,SAAQ,cAAc,CAC3D,cAAc,CAAC,sBAAsB,EACrC,QAAQ,CAAC,IAAI,EACb,IAAI,EACJ,QAAQ,CAAC,WAAW,CACrB;gBAEG,IAAI,EAAE,QAAQ,CAAC,WAAW,EAC1B,IAAI,EAAE,gCAAgC,CAAC,MAAM,CAAC;IAKhD,SAAgB,gBAAgB,SAAS;IACzC,SAAgB,oBAAoB,QAAQ;CAC7C;AAED,OAAO,EAAE,gCAAgC,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.js new file mode 100644 index 000000000..bded7a812 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ImplicitGlobalVariableDefinition = void 0; +const DefinitionType_1 = require("./DefinitionType"); +const DefinitionBase_1 = require("./DefinitionBase"); +class ImplicitGlobalVariableDefinition extends DefinitionBase_1.DefinitionBase { + constructor(name, node) { + super(DefinitionType_1.DefinitionType.ImplicitGlobalVariable, name, node, null); + this.isTypeDefinition = false; + this.isVariableDefinition = true; + } +} +exports.ImplicitGlobalVariableDefinition = ImplicitGlobalVariableDefinition; +//# sourceMappingURL=ImplicitGlobalVariableDefinition.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.js.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.js.map new file mode 100644 index 000000000..5e6cd782c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ImplicitGlobalVariableDefinition.js","sourceRoot":"","sources":["../../src/definition/ImplicitGlobalVariableDefinition.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAClD,qDAAkD;AAElD,MAAM,gCAAiC,SAAQ,+BAK9C;IACC,YACE,IAA0B,EAC1B,IAA8C;QAE9C,KAAK,CAAC,+BAAc,CAAC,sBAAsB,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAGjD,qBAAgB,GAAG,KAAK,CAAC;QACzB,yBAAoB,GAAG,IAAI,CAAC;IAH5C,CAAC;CAIF;AAEQ,4EAAgC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.d.ts new file mode 100644 index 000000000..40397a725 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.d.ts @@ -0,0 +1,11 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { DefinitionType } from './DefinitionType'; +import { DefinitionBase } from './DefinitionBase'; +declare class ImportBindingDefinition extends DefinitionBase { + constructor(name: TSESTree.Identifier, node: TSESTree.TSImportEqualsDeclaration, decl: TSESTree.TSImportEqualsDeclaration); + constructor(name: TSESTree.Identifier, node: Exclude, decl: TSESTree.ImportDeclaration); + readonly isTypeDefinition = true; + readonly isVariableDefinition = true; +} +export { ImportBindingDefinition }; +//# sourceMappingURL=ImportBindingDefinition.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.d.ts.map new file mode 100644 index 000000000..f3f5d146f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ImportBindingDefinition.d.ts","sourceRoot":"","sources":["../../src/definition/ImportBindingDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,cAAM,uBAAwB,SAAQ,cAAc,CAClD,cAAc,CAAC,aAAa,EAC1B,QAAQ,CAAC,eAAe,GACxB,QAAQ,CAAC,sBAAsB,GAC/B,QAAQ,CAAC,wBAAwB,GACjC,QAAQ,CAAC,yBAAyB,EACpC,QAAQ,CAAC,iBAAiB,GAAG,QAAQ,CAAC,yBAAyB,EAC/D,QAAQ,CAAC,UAAU,CACpB;gBAEG,IAAI,EAAE,QAAQ,CAAC,UAAU,EACzB,IAAI,EAAE,QAAQ,CAAC,yBAAyB,EACxC,IAAI,EAAE,QAAQ,CAAC,yBAAyB;gBAGxC,IAAI,EAAE,QAAQ,CAAC,UAAU,EACzB,IAAI,EAAE,OAAO,CACX,uBAAuB,CAAC,MAAM,CAAC,EAC/B,QAAQ,CAAC,yBAAyB,CACnC,EACD,IAAI,EAAE,QAAQ,CAAC,iBAAiB;IAUlC,SAAgB,gBAAgB,QAAQ;IACxC,SAAgB,oBAAoB,QAAQ;CAC7C;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.js new file mode 100644 index 000000000..f843dde9b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ImportBindingDefinition = void 0; +const DefinitionType_1 = require("./DefinitionType"); +const DefinitionBase_1 = require("./DefinitionBase"); +class ImportBindingDefinition extends DefinitionBase_1.DefinitionBase { + constructor(name, node, decl) { + super(DefinitionType_1.DefinitionType.ImportBinding, name, node, decl); + this.isTypeDefinition = true; + this.isVariableDefinition = true; + } +} +exports.ImportBindingDefinition = ImportBindingDefinition; +//# sourceMappingURL=ImportBindingDefinition.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.js.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.js.map new file mode 100644 index 000000000..73bbd1155 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ImportBindingDefinition.js","sourceRoot":"","sources":["../../src/definition/ImportBindingDefinition.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAClD,qDAAkD;AAElD,MAAM,uBAAwB,SAAQ,+BAQrC;IAcC,YACE,IAAyB,EACzB,IAAqC,EACrC,IAAqE;QAErE,KAAK,CAAC,+BAAc,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAGxC,qBAAgB,GAAG,IAAI,CAAC;QACxB,yBAAoB,GAAG,IAAI,CAAC;IAH5C,CAAC;CAIF;AAEQ,0DAAuB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.d.ts new file mode 100644 index 000000000..d65f585ee --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.d.ts @@ -0,0 +1,14 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { DefinitionType } from './DefinitionType'; +import { DefinitionBase } from './DefinitionBase'; +declare class ParameterDefinition extends DefinitionBase { + /** + * Whether the parameter definition is a part of a rest parameter. + */ + readonly rest: boolean; + constructor(name: TSESTree.BindingName, node: ParameterDefinition['node'], rest: boolean); + readonly isTypeDefinition = false; + readonly isVariableDefinition = true; +} +export { ParameterDefinition }; +//# sourceMappingURL=ParameterDefinition.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.d.ts.map new file mode 100644 index 000000000..e959c165c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ParameterDefinition.d.ts","sourceRoot":"","sources":["../../src/definition/ParameterDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,cAAM,mBAAoB,SAAQ,cAAc,CAC9C,cAAc,CAAC,SAAS,EACtB,QAAQ,CAAC,uBAAuB,GAChC,QAAQ,CAAC,mBAAmB,GAC5B,QAAQ,CAAC,kBAAkB,GAC3B,QAAQ,CAAC,0BAA0B,GACnC,QAAQ,CAAC,iBAAiB,GAC1B,QAAQ,CAAC,+BAA+B,GACxC,QAAQ,CAAC,iBAAiB,GAC1B,QAAQ,CAAC,6BAA6B,GACtC,QAAQ,CAAC,cAAc,GACvB,QAAQ,CAAC,iBAAiB,EAC5B,IAAI,EACJ,QAAQ,CAAC,WAAW,CACrB;IACC;;OAEG;IACH,SAAgB,IAAI,EAAE,OAAO,CAAC;gBAE5B,IAAI,EAAE,QAAQ,CAAC,WAAW,EAC1B,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,EACjC,IAAI,EAAE,OAAO;IAMf,SAAgB,gBAAgB,SAAS;IACzC,SAAgB,oBAAoB,QAAQ;CAC7C;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.js new file mode 100644 index 000000000..4e2a1b92d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParameterDefinition = void 0; +const DefinitionType_1 = require("./DefinitionType"); +const DefinitionBase_1 = require("./DefinitionBase"); +class ParameterDefinition extends DefinitionBase_1.DefinitionBase { + constructor(name, node, rest) { + super(DefinitionType_1.DefinitionType.Parameter, name, node, null); + this.isTypeDefinition = false; + this.isVariableDefinition = true; + this.rest = rest; + } +} +exports.ParameterDefinition = ParameterDefinition; +//# sourceMappingURL=ParameterDefinition.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.js.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.js.map new file mode 100644 index 000000000..0c322f10d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ParameterDefinition.js","sourceRoot":"","sources":["../../src/definition/ParameterDefinition.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAClD,qDAAkD;AAElD,MAAM,mBAAoB,SAAQ,+BAcjC;IAKC,YACE,IAA0B,EAC1B,IAAiC,EACjC,IAAa;QAEb,KAAK,CAAC,+BAAc,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAIpC,qBAAgB,GAAG,KAAK,CAAC;QACzB,yBAAoB,GAAG,IAAI,CAAC;QAJ1C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CAIF;AAEQ,kDAAmB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.d.ts new file mode 100644 index 000000000..3e7a4f3ed --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.d.ts @@ -0,0 +1,10 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { DefinitionType } from './DefinitionType'; +import { DefinitionBase } from './DefinitionBase'; +declare class TSEnumMemberDefinition extends DefinitionBase { + constructor(name: TSESTree.Identifier | TSESTree.StringLiteral, node: TSEnumMemberDefinition['node']); + readonly isTypeDefinition = true; + readonly isVariableDefinition = true; +} +export { TSEnumMemberDefinition }; +//# sourceMappingURL=TSEnumMemberDefinition.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.d.ts.map new file mode 100644 index 000000000..f1495a9a6 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TSEnumMemberDefinition.d.ts","sourceRoot":"","sources":["../../src/definition/TSEnumMemberDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,cAAM,sBAAuB,SAAQ,cAAc,CACjD,cAAc,CAAC,YAAY,EAC3B,QAAQ,CAAC,YAAY,EACrB,IAAI,EACJ,QAAQ,CAAC,UAAU,GAAG,QAAQ,CAAC,aAAa,CAC7C;gBAEG,IAAI,EAAE,QAAQ,CAAC,UAAU,GAAG,QAAQ,CAAC,aAAa,EAClD,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;IAKtC,SAAgB,gBAAgB,QAAQ;IACxC,SAAgB,oBAAoB,QAAQ;CAC7C;AAED,OAAO,EAAE,sBAAsB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.js new file mode 100644 index 000000000..8cc51f778 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TSEnumMemberDefinition = void 0; +const DefinitionType_1 = require("./DefinitionType"); +const DefinitionBase_1 = require("./DefinitionBase"); +class TSEnumMemberDefinition extends DefinitionBase_1.DefinitionBase { + constructor(name, node) { + super(DefinitionType_1.DefinitionType.TSEnumMember, name, node, null); + this.isTypeDefinition = true; + this.isVariableDefinition = true; + } +} +exports.TSEnumMemberDefinition = TSEnumMemberDefinition; +//# sourceMappingURL=TSEnumMemberDefinition.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.js.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.js.map new file mode 100644 index 000000000..c0112a6da --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TSEnumMemberDefinition.js","sourceRoot":"","sources":["../../src/definition/TSEnumMemberDefinition.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAClD,qDAAkD;AAElD,MAAM,sBAAuB,SAAQ,+BAKpC;IACC,YACE,IAAkD,EAClD,IAAoC;QAEpC,KAAK,CAAC,+BAAc,CAAC,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAGvC,qBAAgB,GAAG,IAAI,CAAC;QACxB,yBAAoB,GAAG,IAAI,CAAC;IAH5C,CAAC;CAIF;AAEQ,wDAAsB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.d.ts new file mode 100644 index 000000000..45cb424d9 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.d.ts @@ -0,0 +1,10 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { DefinitionType } from './DefinitionType'; +import { DefinitionBase } from './DefinitionBase'; +declare class TSEnumNameDefinition extends DefinitionBase { + constructor(name: TSESTree.Identifier, node: TSEnumNameDefinition['node']); + readonly isTypeDefinition = true; + readonly isVariableDefinition = true; +} +export { TSEnumNameDefinition }; +//# sourceMappingURL=TSEnumNameDefinition.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.d.ts.map new file mode 100644 index 000000000..6e0bc36e8 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TSEnumNameDefinition.d.ts","sourceRoot":"","sources":["../../src/definition/TSEnumNameDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,cAAM,oBAAqB,SAAQ,cAAc,CAC/C,cAAc,CAAC,UAAU,EACzB,QAAQ,CAAC,iBAAiB,EAC1B,IAAI,EACJ,QAAQ,CAAC,UAAU,CACpB;gBACa,IAAI,EAAE,QAAQ,CAAC,UAAU,EAAE,IAAI,EAAE,oBAAoB,CAAC,MAAM,CAAC;IAIzE,SAAgB,gBAAgB,QAAQ;IACxC,SAAgB,oBAAoB,QAAQ;CAC7C;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.js new file mode 100644 index 000000000..aa7875010 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TSEnumNameDefinition = void 0; +const DefinitionType_1 = require("./DefinitionType"); +const DefinitionBase_1 = require("./DefinitionBase"); +class TSEnumNameDefinition extends DefinitionBase_1.DefinitionBase { + constructor(name, node) { + super(DefinitionType_1.DefinitionType.TSEnumName, name, node, null); + this.isTypeDefinition = true; + this.isVariableDefinition = true; + } +} +exports.TSEnumNameDefinition = TSEnumNameDefinition; +//# sourceMappingURL=TSEnumNameDefinition.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.js.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.js.map new file mode 100644 index 000000000..b850d4a80 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TSEnumNameDefinition.js","sourceRoot":"","sources":["../../src/definition/TSEnumNameDefinition.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAClD,qDAAkD;AAElD,MAAM,oBAAqB,SAAQ,+BAKlC;IACC,YAAY,IAAyB,EAAE,IAAkC;QACvE,KAAK,CAAC,+BAAc,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAGrC,qBAAgB,GAAG,IAAI,CAAC;QACxB,yBAAoB,GAAG,IAAI,CAAC;IAH5C,CAAC;CAIF;AAEQ,oDAAoB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.d.ts new file mode 100644 index 000000000..390a0aacc --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.d.ts @@ -0,0 +1,10 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { DefinitionType } from './DefinitionType'; +import { DefinitionBase } from './DefinitionBase'; +declare class TSModuleNameDefinition extends DefinitionBase { + constructor(name: TSESTree.Identifier, node: TSModuleNameDefinition['node']); + readonly isTypeDefinition = true; + readonly isVariableDefinition = true; +} +export { TSModuleNameDefinition }; +//# sourceMappingURL=TSModuleNameDefinition.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.d.ts.map new file mode 100644 index 000000000..297b4f3f1 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TSModuleNameDefinition.d.ts","sourceRoot":"","sources":["../../src/definition/TSModuleNameDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,cAAM,sBAAuB,SAAQ,cAAc,CACjD,cAAc,CAAC,YAAY,EAC3B,QAAQ,CAAC,mBAAmB,EAC5B,IAAI,EACJ,QAAQ,CAAC,UAAU,CACpB;gBACa,IAAI,EAAE,QAAQ,CAAC,UAAU,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;IAI3E,SAAgB,gBAAgB,QAAQ;IACxC,SAAgB,oBAAoB,QAAQ;CAC7C;AAED,OAAO,EAAE,sBAAsB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.js new file mode 100644 index 000000000..606eac427 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TSModuleNameDefinition = void 0; +const DefinitionType_1 = require("./DefinitionType"); +const DefinitionBase_1 = require("./DefinitionBase"); +class TSModuleNameDefinition extends DefinitionBase_1.DefinitionBase { + constructor(name, node) { + super(DefinitionType_1.DefinitionType.TSModuleName, name, node, null); + this.isTypeDefinition = true; + this.isVariableDefinition = true; + } +} +exports.TSModuleNameDefinition = TSModuleNameDefinition; +//# sourceMappingURL=TSModuleNameDefinition.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.js.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.js.map new file mode 100644 index 000000000..96ecc483e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TSModuleNameDefinition.js","sourceRoot":"","sources":["../../src/definition/TSModuleNameDefinition.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAClD,qDAAkD;AAElD,MAAM,sBAAuB,SAAQ,+BAKpC;IACC,YAAY,IAAyB,EAAE,IAAoC;QACzE,KAAK,CAAC,+BAAc,CAAC,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAGvC,qBAAgB,GAAG,IAAI,CAAC;QACxB,yBAAoB,GAAG,IAAI,CAAC;IAH5C,CAAC;CAIF;AAEQ,wDAAsB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.d.ts new file mode 100644 index 000000000..91a9d1177 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.d.ts @@ -0,0 +1,10 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { DefinitionType } from './DefinitionType'; +import { DefinitionBase } from './DefinitionBase'; +declare class TypeDefinition extends DefinitionBase { + constructor(name: TSESTree.Identifier, node: TypeDefinition['node']); + readonly isTypeDefinition = true; + readonly isVariableDefinition = false; +} +export { TypeDefinition }; +//# sourceMappingURL=TypeDefinition.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.d.ts.map new file mode 100644 index 000000000..32e798a91 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TypeDefinition.d.ts","sourceRoot":"","sources":["../../src/definition/TypeDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,cAAM,cAAe,SAAQ,cAAc,CACzC,cAAc,CAAC,IAAI,EACjB,QAAQ,CAAC,sBAAsB,GAC/B,QAAQ,CAAC,sBAAsB,GAC/B,QAAQ,CAAC,eAAe,EAC1B,IAAI,EACJ,QAAQ,CAAC,UAAU,CACpB;gBACa,IAAI,EAAE,QAAQ,CAAC,UAAU,EAAE,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;IAInE,SAAgB,gBAAgB,QAAQ;IACxC,SAAgB,oBAAoB,SAAS;CAC9C;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.js new file mode 100644 index 000000000..8839eaf23 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TypeDefinition = void 0; +const DefinitionType_1 = require("./DefinitionType"); +const DefinitionBase_1 = require("./DefinitionBase"); +class TypeDefinition extends DefinitionBase_1.DefinitionBase { + constructor(name, node) { + super(DefinitionType_1.DefinitionType.Type, name, node, null); + this.isTypeDefinition = true; + this.isVariableDefinition = false; + } +} +exports.TypeDefinition = TypeDefinition; +//# sourceMappingURL=TypeDefinition.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.js.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.js.map new file mode 100644 index 000000000..fa53691cc --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TypeDefinition.js","sourceRoot":"","sources":["../../src/definition/TypeDefinition.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAClD,qDAAkD;AAElD,MAAM,cAAe,SAAQ,+BAO5B;IACC,YAAY,IAAyB,EAAE,IAA4B;QACjE,KAAK,CAAC,+BAAc,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAG/B,qBAAgB,GAAG,IAAI,CAAC;QACxB,yBAAoB,GAAG,KAAK,CAAC;IAH7C,CAAC;CAIF;AAEQ,wCAAc"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.d.ts new file mode 100644 index 000000000..f00d3dfc4 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.d.ts @@ -0,0 +1,10 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { DefinitionType } from './DefinitionType'; +import { DefinitionBase } from './DefinitionBase'; +declare class VariableDefinition extends DefinitionBase { + constructor(name: TSESTree.Identifier, node: VariableDefinition['node'], decl: TSESTree.VariableDeclaration); + readonly isTypeDefinition = false; + readonly isVariableDefinition = true; +} +export { VariableDefinition }; +//# sourceMappingURL=VariableDefinition.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.d.ts.map new file mode 100644 index 000000000..83577f726 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"VariableDefinition.d.ts","sourceRoot":"","sources":["../../src/definition/VariableDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,cAAM,kBAAmB,SAAQ,cAAc,CAC7C,cAAc,CAAC,QAAQ,EACvB,QAAQ,CAAC,kBAAkB,EAC3B,QAAQ,CAAC,mBAAmB,EAC5B,QAAQ,CAAC,UAAU,CACpB;gBAEG,IAAI,EAAE,QAAQ,CAAC,UAAU,EACzB,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAC,EAChC,IAAI,EAAE,QAAQ,CAAC,mBAAmB;IAKpC,SAAgB,gBAAgB,SAAS;IACzC,SAAgB,oBAAoB,QAAQ;CAC7C;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.js new file mode 100644 index 000000000..d377a6937 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VariableDefinition = void 0; +const DefinitionType_1 = require("./DefinitionType"); +const DefinitionBase_1 = require("./DefinitionBase"); +class VariableDefinition extends DefinitionBase_1.DefinitionBase { + constructor(name, node, decl) { + super(DefinitionType_1.DefinitionType.Variable, name, node, decl); + this.isTypeDefinition = false; + this.isVariableDefinition = true; + } +} +exports.VariableDefinition = VariableDefinition; +//# sourceMappingURL=VariableDefinition.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.js.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.js.map new file mode 100644 index 000000000..fda5fae3d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.js.map @@ -0,0 +1 @@ +{"version":3,"file":"VariableDefinition.js","sourceRoot":"","sources":["../../src/definition/VariableDefinition.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAClD,qDAAkD;AAElD,MAAM,kBAAmB,SAAQ,+BAKhC;IACC,YACE,IAAyB,EACzB,IAAgC,EAChC,IAAkC;QAElC,KAAK,CAAC,+BAAc,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAGnC,qBAAgB,GAAG,KAAK,CAAC;QACzB,yBAAoB,GAAG,IAAI,CAAC;IAH5C,CAAC;CAIF;AAEQ,gDAAkB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/index.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/definition/index.d.ts new file mode 100644 index 000000000..2be95a127 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/index.d.ts @@ -0,0 +1,14 @@ +export * from './CatchClauseDefinition'; +export * from './ClassNameDefinition'; +export * from './Definition'; +export * from './DefinitionType'; +export * from './FunctionNameDefinition'; +export * from './ImplicitGlobalVariableDefinition'; +export * from './ImportBindingDefinition'; +export * from './ParameterDefinition'; +export * from './TSEnumMemberDefinition'; +export * from './TSEnumNameDefinition'; +export * from './TSModuleNameDefinition'; +export * from './TypeDefinition'; +export * from './VariableDefinition'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/index.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/index.d.ts.map new file mode 100644 index 000000000..dfd43be8c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/definition/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/index.js b/node_modules/@typescript-eslint/scope-manager/dist/definition/index.js new file mode 100644 index 000000000..b683a079a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/index.js @@ -0,0 +1,26 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./CatchClauseDefinition"), exports); +__exportStar(require("./ClassNameDefinition"), exports); +__exportStar(require("./Definition"), exports); +__exportStar(require("./DefinitionType"), exports); +__exportStar(require("./FunctionNameDefinition"), exports); +__exportStar(require("./ImplicitGlobalVariableDefinition"), exports); +__exportStar(require("./ImportBindingDefinition"), exports); +__exportStar(require("./ParameterDefinition"), exports); +__exportStar(require("./TSEnumMemberDefinition"), exports); +__exportStar(require("./TSEnumNameDefinition"), exports); +__exportStar(require("./TSModuleNameDefinition"), exports); +__exportStar(require("./TypeDefinition"), exports); +__exportStar(require("./VariableDefinition"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/definition/index.js.map b/node_modules/@typescript-eslint/scope-manager/dist/definition/index.js.map new file mode 100644 index 000000000..715c54f54 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/definition/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/definition/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0DAAwC;AACxC,wDAAsC;AACtC,+CAA6B;AAC7B,mDAAiC;AACjC,2DAAyC;AACzC,qEAAmD;AACnD,4DAA0C;AAC1C,wDAAsC;AACtC,2DAAyC;AACzC,yDAAuC;AACvC,2DAAyC;AACzC,mDAAiC;AACjC,uDAAqC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/index.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/index.d.ts new file mode 100644 index 000000000..23ee2461a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/index.d.ts @@ -0,0 +1,9 @@ +export { analyze, AnalyzeOptions } from './analyze'; +export * from './definition'; +export { Reference } from './referencer/Reference'; +export { Visitor } from './referencer/Visitor'; +export { PatternVisitor, PatternVisitorCallback, PatternVisitorOptions, } from './referencer/PatternVisitor'; +export * from './scope'; +export { ScopeManager } from './ScopeManager'; +export * from './variable'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/index.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/index.d.ts.map new file mode 100644 index 000000000..17ddbf575 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACpD,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,6BAA6B,CAAC;AACrC,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,cAAc,YAAY,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/index.js b/node_modules/@typescript-eslint/scope-manager/dist/index.js new file mode 100644 index 000000000..49ae66477 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/index.js @@ -0,0 +1,27 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ScopeManager = exports.PatternVisitor = exports.Visitor = exports.Reference = exports.analyze = void 0; +var analyze_1 = require("./analyze"); +Object.defineProperty(exports, "analyze", { enumerable: true, get: function () { return analyze_1.analyze; } }); +__exportStar(require("./definition"), exports); +var Reference_1 = require("./referencer/Reference"); +Object.defineProperty(exports, "Reference", { enumerable: true, get: function () { return Reference_1.Reference; } }); +var Visitor_1 = require("./referencer/Visitor"); +Object.defineProperty(exports, "Visitor", { enumerable: true, get: function () { return Visitor_1.Visitor; } }); +var PatternVisitor_1 = require("./referencer/PatternVisitor"); +Object.defineProperty(exports, "PatternVisitor", { enumerable: true, get: function () { return PatternVisitor_1.PatternVisitor; } }); +__exportStar(require("./scope"), exports); +var ScopeManager_1 = require("./ScopeManager"); +Object.defineProperty(exports, "ScopeManager", { enumerable: true, get: function () { return ScopeManager_1.ScopeManager; } }); +__exportStar(require("./variable"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/index.js.map b/node_modules/@typescript-eslint/scope-manager/dist/index.js.map new file mode 100644 index 000000000..55869e4d6 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qCAAoD;AAA3C,kGAAA,OAAO,OAAA;AAChB,+CAA6B;AAC7B,oDAAmD;AAA1C,sGAAA,SAAS,OAAA;AAClB,gDAA+C;AAAtC,kGAAA,OAAO,OAAA;AAChB,8DAIqC;AAHnC,gHAAA,cAAc,OAAA;AAIhB,0CAAwB;AACxB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,6CAA2B"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.d.ts new file mode 100644 index 000000000..bb38760e0 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const dom: Record; +//# sourceMappingURL=dom.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.d.ts.map new file mode 100644 index 000000000..253949e5a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/lib/dom.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,GAAG,4CA+tP+B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.d.ts new file mode 100644 index 000000000..fc03570db --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const dom_iterable: Record; +//# sourceMappingURL=dom.iterable.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.d.ts.map new file mode 100644 index 000000000..ce174d2db --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"dom.iterable.d.ts","sourceRoot":"","sources":["../../src/lib/dom.iterable.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,YAAY,4CAyTsB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.js new file mode 100644 index 000000000..b1d6e449d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.js @@ -0,0 +1,321 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.dom_iterable = void 0; +exports.dom_iterable = { + AudioParam: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AudioParam', + }, + AudioParamMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AudioParamMap', + }, + BaseAudioContext: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BaseAudioContext', + }, + CSSRuleList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CSSRuleList', + }, + CSSStyleDeclaration: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CSSStyleDeclaration', + }, + Cache: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Cache', + }, + CanvasPathDrawingStyles: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasPathDrawingStyles', + }, + ClientRectList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ClientRectList', + }, + DOMRectList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DOMRectList', + }, + DOMStringList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DOMStringList', + }, + DOMTokenList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DOMTokenList', + }, + DataTransferItemList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DataTransferItemList', + }, + FileList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'FileList', + }, + FormData: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'FormData', + }, + HTMLAllCollection: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HTMLAllCollection', + }, + HTMLCollectionBase: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HTMLCollectionBase', + }, + HTMLCollectionOf: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HTMLCollectionOf', + }, + HTMLFormElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HTMLFormElement', + }, + HTMLSelectElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HTMLSelectElement', + }, + Headers: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Headers', + }, + IDBObjectStore: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBObjectStore', + }, + MediaKeyStatusMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaKeyStatusMap', + }, + MediaList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaList', + }, + MimeTypeArray: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MimeTypeArray', + }, + NamedNodeMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NamedNodeMap', + }, + Navigator: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Navigator', + }, + NodeList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NodeList', + }, + NodeListOf: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NodeListOf', + }, + Plugin: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Plugin', + }, + PluginArray: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PluginArray', + }, + RTCRtpTransceiver: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCRtpTransceiver', + }, + RTCStatsReport: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCStatsReport', + }, + SVGLengthList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SVGLengthList', + }, + SVGNumberList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SVGNumberList', + }, + SVGPointList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SVGPointList', + }, + SVGStringList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SVGStringList', + }, + SourceBufferList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SourceBufferList', + }, + SpeechGrammarList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SpeechGrammarList', + }, + SpeechRecognitionResult: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SpeechRecognitionResult', + }, + SpeechRecognitionResultList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SpeechRecognitionResultList', + }, + StyleSheetList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'StyleSheetList', + }, + TextTrackCueList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TextTrackCueList', + }, + TextTrackList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TextTrackList', + }, + TouchList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TouchList', + }, + URLSearchParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'URLSearchParams', + }, + VRDisplay: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'VRDisplay', + }, + WEBGL_draw_buffers: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WEBGL_draw_buffers', + }, + WebAuthentication: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WebAuthentication', + }, + WebGL2RenderingContextBase: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WebGL2RenderingContextBase', + }, + WebGL2RenderingContextOverloads: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WebGL2RenderingContextOverloads', + }, + WebGLRenderingContextBase: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WebGLRenderingContextBase', + }, + WebGLRenderingContextOverloads: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WebGLRenderingContextOverloads', + }, +}; +//# sourceMappingURL=dom.iterable.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.js.map new file mode 100644 index 000000000..5a59418f3 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dom.iterable.js","sourceRoot":"","sources":["../../src/lib/dom.iterable.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,YAAY,GAAG;IAC1B,UAAU,EAAE;QACV,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,YAAY;KACnB;IACD,aAAa,EAAE;QACb,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,eAAe;KACtB;IACD,gBAAgB,EAAE;QAChB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,kBAAkB;KACzB;IACD,WAAW,EAAE;QACX,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,aAAa;KACpB;IACD,mBAAmB,EAAE;QACnB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,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QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,iBAAiB;KACxB;IACD,SAAS,EAAE;QACT,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,WAAW;KAClB;IACD,kBAAkB,EAAE;QAClB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,oBAAoB;KAC3B;IACD,iBAAiB,EAAE;QACjB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,mBAAmB;KAC1B;IACD,0BAA0B,EAAE;QAC1B,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,4BAA4B;KACnC;IACD,+BAA+B,EAAE;QAC/B,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,iCAAiC;KACxC;IACD,yBAAyB,EAAE;QACzB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,2BAA2B;KAClC;IACD,8BAA8B,EAAE;QAC9B,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,gCAAgC;KACvC;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.js new file mode 100644 index 000000000..7ebfe9f34 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.js @@ -0,0 +1,7911 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.dom = void 0; +exports.dom = { + Account: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Account', + }, + AddEventListenerOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AddEventListenerOptions', + }, + AesCbcParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AesCbcParams', + }, + AesCtrParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AesCtrParams', + }, + AesDerivedKeyParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AesDerivedKeyParams', + }, + AesGcmParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AesGcmParams', + }, + AesKeyAlgorithm: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AesKeyAlgorithm', + }, + AesKeyGenParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AesKeyGenParams', + }, + Algorithm: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Algorithm', + }, + AnalyserOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AnalyserOptions', + }, + AnimationEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AnimationEventInit', + }, + AnimationPlaybackEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AnimationPlaybackEventInit', + }, + AssertionOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AssertionOptions', + }, + AssignedNodesOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AssignedNodesOptions', + }, + AudioBufferOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AudioBufferOptions', + }, + AudioBufferSourceOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AudioBufferSourceOptions', + }, + AudioContextInfo: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AudioContextInfo', + }, + AudioContextOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AudioContextOptions', + }, + AudioNodeOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AudioNodeOptions', + }, + AudioParamDescriptor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AudioParamDescriptor', + }, + AudioProcessingEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AudioProcessingEventInit', + }, + AudioTimestamp: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AudioTimestamp', + }, + AudioWorkletNodeOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AudioWorkletNodeOptions', + }, + AuthenticationExtensionsClientInputs: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AuthenticationExtensionsClientInputs', + }, + AuthenticationExtensionsClientOutputs: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AuthenticationExtensionsClientOutputs', + }, + AuthenticatorSelectionCriteria: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AuthenticatorSelectionCriteria', + }, + BiquadFilterOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BiquadFilterOptions', + }, + BlobPropertyBag: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BlobPropertyBag', + }, + ByteLengthChunk: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ByteLengthChunk', + }, + CacheQueryOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CacheQueryOptions', + }, + CanvasRenderingContext2DSettings: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasRenderingContext2DSettings', + }, + ChannelMergerOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ChannelMergerOptions', + }, + ChannelSplitterOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ChannelSplitterOptions', + }, + ClientData: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ClientData', + }, + ClientQueryOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ClientQueryOptions', + }, + ClipboardEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ClipboardEventInit', + }, + CloseEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CloseEventInit', + }, + CompositionEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CompositionEventInit', + }, + ComputedEffectTiming: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ComputedEffectTiming', + }, + ComputedKeyframe: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ComputedKeyframe', + }, + ConfirmSiteSpecificExceptionsInformation: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ConfirmSiteSpecificExceptionsInformation', + }, + ConstantSourceOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ConstantSourceOptions', + }, + ConstrainBooleanParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ConstrainBooleanParameters', + }, + ConstrainDOMStringParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ConstrainDOMStringParameters', + }, + ConstrainDoubleRange: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ConstrainDoubleRange', + }, + ConstrainULongRange: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ConstrainULongRange', + }, + ConstrainVideoFacingModeParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ConstrainVideoFacingModeParameters', + }, + ConvolverOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ConvolverOptions', + }, + CredentialCreationOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CredentialCreationOptions', + }, + CredentialRequestOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CredentialRequestOptions', + }, + CustomEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CustomEventInit', + }, + DOMMatrix2DInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DOMMatrix2DInit', + }, + DOMMatrixInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DOMMatrixInit', + }, + DOMPointInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DOMPointInit', + }, + DOMQuadInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DOMQuadInit', + }, + DOMRectInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DOMRectInit', + }, + DelayOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DelayOptions', + }, + DeviceLightEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DeviceLightEventInit', + }, + DeviceMotionEventAccelerationInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DeviceMotionEventAccelerationInit', + }, + DeviceMotionEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DeviceMotionEventInit', + }, + DeviceMotionEventRotationRateInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DeviceMotionEventRotationRateInit', + }, + DeviceOrientationEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DeviceOrientationEventInit', + }, + DevicePermissionDescriptor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DevicePermissionDescriptor', + }, + DocumentTimelineOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DocumentTimelineOptions', + }, + DoubleRange: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DoubleRange', + }, + DragEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DragEventInit', + }, + DynamicsCompressorOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DynamicsCompressorOptions', + }, + EcKeyAlgorithm: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EcKeyAlgorithm', + }, + EcKeyGenParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EcKeyGenParams', + }, + EcKeyImportParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EcKeyImportParams', + }, + EcdhKeyDeriveParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EcdhKeyDeriveParams', + }, + EcdsaParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EcdsaParams', + }, + EffectTiming: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EffectTiming', + }, + ElementCreationOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ElementCreationOptions', + }, + ElementDefinitionOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ElementDefinitionOptions', + }, + ErrorEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ErrorEventInit', + }, + EventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EventInit', + }, + EventListenerOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EventListenerOptions', + }, + EventModifierInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EventModifierInit', + }, + EventSourceInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EventSourceInit', + }, + ExceptionInformation: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ExceptionInformation', + }, + FilePropertyBag: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'FilePropertyBag', + }, + FocusEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'FocusEventInit', + }, + FocusNavigationEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'FocusNavigationEventInit', + }, + FocusNavigationOrigin: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'FocusNavigationOrigin', + }, + FocusOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'FocusOptions', + }, + FullscreenOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'FullscreenOptions', + }, + GainOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GainOptions', + }, + GamepadEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GamepadEventInit', + }, + GetNotificationOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GetNotificationOptions', + }, + GetRootNodeOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GetRootNodeOptions', + }, + HashChangeEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HashChangeEventInit', + }, + HkdfParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HkdfParams', + }, + HmacImportParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HmacImportParams', + }, + HmacKeyAlgorithm: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HmacKeyAlgorithm', + }, + HmacKeyGenParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HmacKeyGenParams', + }, + IDBIndexParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBIndexParameters', + }, + IDBObjectStoreParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBObjectStoreParameters', + }, + IDBVersionChangeEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBVersionChangeEventInit', + }, + IIRFilterOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IIRFilterOptions', + }, + ImageBitmapOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ImageBitmapOptions', + }, + ImageBitmapRenderingContextSettings: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ImageBitmapRenderingContextSettings', + }, + ImageEncodeOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ImageEncodeOptions', + }, + InputEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'InputEventInit', + }, + IntersectionObserverEntryInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IntersectionObserverEntryInit', + }, + IntersectionObserverInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IntersectionObserverInit', + }, + JsonWebKey: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'JsonWebKey', + }, + KeyAlgorithm: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'KeyAlgorithm', + }, + KeyboardEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'KeyboardEventInit', + }, + Keyframe: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Keyframe', + }, + KeyframeAnimationOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'KeyframeAnimationOptions', + }, + KeyframeEffectOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'KeyframeEffectOptions', + }, + MediaElementAudioSourceOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaElementAudioSourceOptions', + }, + MediaEncryptedEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaEncryptedEventInit', + }, + MediaKeyMessageEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaKeyMessageEventInit', + }, + MediaKeySystemConfiguration: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaKeySystemConfiguration', + }, + MediaKeySystemMediaCapability: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaKeySystemMediaCapability', + }, + MediaQueryListEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaQueryListEventInit', + }, + MediaStreamAudioSourceOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaStreamAudioSourceOptions', + }, + MediaStreamConstraints: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaStreamConstraints', + }, + MediaStreamErrorEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaStreamErrorEventInit', + }, + MediaStreamEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaStreamEventInit', + }, + MediaStreamTrackAudioSourceOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaStreamTrackAudioSourceOptions', + }, + MediaStreamTrackEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaStreamTrackEventInit', + }, + MediaTrackCapabilities: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaTrackCapabilities', + }, + MediaTrackConstraintSet: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaTrackConstraintSet', + }, + MediaTrackConstraints: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaTrackConstraints', + }, + MediaTrackSettings: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaTrackSettings', + }, + MediaTrackSupportedConstraints: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaTrackSupportedConstraints', + }, + MessageEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MessageEventInit', + }, + MidiPermissionDescriptor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MidiPermissionDescriptor', + }, + MouseEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MouseEventInit', + }, + MultiCacheQueryOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MultiCacheQueryOptions', + }, + MutationObserverInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MutationObserverInit', + }, + NavigationPreloadState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NavigationPreloadState', + }, + NotificationAction: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NotificationAction', + }, + NotificationOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NotificationOptions', + }, + OfflineAudioCompletionEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OfflineAudioCompletionEventInit', + }, + OfflineAudioContextOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OfflineAudioContextOptions', + }, + OptionalEffectTiming: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OptionalEffectTiming', + }, + OscillatorOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OscillatorOptions', + }, + PageTransitionEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PageTransitionEventInit', + }, + PannerOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PannerOptions', + }, + PaymentCurrencyAmount: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PaymentCurrencyAmount', + }, + PaymentDetailsBase: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PaymentDetailsBase', + }, + PaymentDetailsInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PaymentDetailsInit', + }, + PaymentDetailsModifier: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PaymentDetailsModifier', + }, + PaymentDetailsUpdate: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PaymentDetailsUpdate', + }, + PaymentItem: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PaymentItem', + }, + PaymentMethodData: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PaymentMethodData', + }, + PaymentOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PaymentOptions', + }, + PaymentRequestUpdateEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PaymentRequestUpdateEventInit', + }, + PaymentShippingOption: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PaymentShippingOption', + }, + Pbkdf2Params: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Pbkdf2Params', + }, + PerformanceObserverInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PerformanceObserverInit', + }, + PeriodicWaveConstraints: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PeriodicWaveConstraints', + }, + PeriodicWaveOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PeriodicWaveOptions', + }, + PermissionDescriptor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PermissionDescriptor', + }, + PipeOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PipeOptions', + }, + PointerEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PointerEventInit', + }, + PopStateEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PopStateEventInit', + }, + PositionOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PositionOptions', + }, + PostMessageOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PostMessageOptions', + }, + ProgressEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ProgressEventInit', + }, + PromiseRejectionEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PromiseRejectionEventInit', + }, + PropertyIndexedKeyframes: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PropertyIndexedKeyframes', + }, + PublicKeyCredentialCreationOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PublicKeyCredentialCreationOptions', + }, + PublicKeyCredentialDescriptor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PublicKeyCredentialDescriptor', + }, + PublicKeyCredentialEntity: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PublicKeyCredentialEntity', + }, + PublicKeyCredentialParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PublicKeyCredentialParameters', + }, + PublicKeyCredentialRequestOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PublicKeyCredentialRequestOptions', + }, + PublicKeyCredentialRpEntity: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PublicKeyCredentialRpEntity', + }, + PublicKeyCredentialUserEntity: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PublicKeyCredentialUserEntity', + }, + PushPermissionDescriptor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PushPermissionDescriptor', + }, + PushSubscriptionJSON: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PushSubscriptionJSON', + }, + PushSubscriptionOptionsInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PushSubscriptionOptionsInit', + }, + QueuingStrategy: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'QueuingStrategy', + }, + RTCAnswerOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCAnswerOptions', + }, + RTCCertificateExpiration: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCCertificateExpiration', + }, + RTCConfiguration: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCConfiguration', + }, + RTCDTMFToneChangeEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCDTMFToneChangeEventInit', + }, + RTCDataChannelEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCDataChannelEventInit', + }, + RTCDataChannelInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCDataChannelInit', + }, + RTCDtlsFingerprint: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCDtlsFingerprint', + }, + RTCDtlsParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCDtlsParameters', + }, + RTCErrorEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCErrorEventInit', + }, + RTCErrorInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCErrorInit', + }, + RTCIceCandidateAttributes: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIceCandidateAttributes', + }, + RTCIceCandidateComplete: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIceCandidateComplete', + }, + RTCIceCandidateDictionary: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIceCandidateDictionary', + }, + RTCIceCandidateInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIceCandidateInit', + }, + RTCIceCandidatePair: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIceCandidatePair', + }, + RTCIceCandidatePairStats: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIceCandidatePairStats', + }, + RTCIceGatherOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIceGatherOptions', + }, + RTCIceParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIceParameters', + }, + RTCIceServer: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIceServer', + }, + RTCIdentityProviderOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIdentityProviderOptions', + }, + RTCInboundRTPStreamStats: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCInboundRTPStreamStats', + }, + RTCMediaStreamTrackStats: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCMediaStreamTrackStats', + }, + RTCOAuthCredential: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCOAuthCredential', + }, + RTCOfferAnswerOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCOfferAnswerOptions', + }, + RTCOfferOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCOfferOptions', + }, + RTCOutboundRTPStreamStats: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCOutboundRTPStreamStats', + }, + RTCPeerConnectionIceErrorEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCPeerConnectionIceErrorEventInit', + }, + RTCPeerConnectionIceEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCPeerConnectionIceEventInit', + }, + RTCRTPStreamStats: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCRTPStreamStats', + }, + RTCRtcpFeedback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCRtcpFeedback', + }, + RTCRtcpParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCRtcpParameters', + }, + RTCRtpCapabilities: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCRtpCapabilities', + }, + RTCRtpCodecCapability: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCRtpCodecCapability', + }, + RTCRtpCodecParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCRtpCodecParameters', + }, + RTCRtpCodingParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCRtpCodingParameters', + }, + RTCRtpContributingSource: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCRtpContributingSource', + }, + RTCRtpDecodingParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCRtpDecodingParameters', + }, + RTCRtpEncodingParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCRtpEncodingParameters', + }, + RTCRtpFecParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCRtpFecParameters', + }, + RTCRtpHeaderExtension: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCRtpHeaderExtension', + }, + RTCRtpHeaderExtensionCapability: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCRtpHeaderExtensionCapability', + }, + RTCRtpHeaderExtensionParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCRtpHeaderExtensionParameters', + }, + RTCRtpParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCRtpParameters', + }, + RTCRtpReceiveParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCRtpReceiveParameters', + }, + RTCRtpRtxParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCRtpRtxParameters', + }, + RTCRtpSendParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCRtpSendParameters', + }, + RTCRtpSynchronizationSource: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCRtpSynchronizationSource', + }, + RTCRtpTransceiverInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCRtpTransceiverInit', + }, + RTCRtpUnhandled: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCRtpUnhandled', + }, + RTCSessionDescriptionInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCSessionDescriptionInit', + }, + RTCSrtpKeyParam: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCSrtpKeyParam', + }, + RTCSrtpSdesParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCSrtpSdesParameters', + }, + RTCSsrcRange: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCSsrcRange', + }, + RTCStats: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCStats', + }, + RTCStatsEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCStatsEventInit', + }, + RTCStatsReport: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCStatsReport', + }, + RTCTrackEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCTrackEventInit', + }, + RTCTransportStats: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCTransportStats', + }, + ReadableStreamReadDoneResult: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadableStreamReadDoneResult', + }, + ReadableStreamReadValueResult: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadableStreamReadValueResult', + }, + RegistrationOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RegistrationOptions', + }, + RequestInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RequestInit', + }, + ResponseInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ResponseInit', + }, + RsaHashedImportParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RsaHashedImportParams', + }, + RsaHashedKeyAlgorithm: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RsaHashedKeyAlgorithm', + }, + RsaHashedKeyGenParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RsaHashedKeyGenParams', + }, + RsaKeyAlgorithm: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RsaKeyAlgorithm', + }, + RsaKeyGenParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RsaKeyGenParams', + }, + RsaOaepParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RsaOaepParams', + }, + RsaOtherPrimesInfo: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RsaOtherPrimesInfo', + }, + RsaPssParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RsaPssParams', + }, + SVGBoundingBoxOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SVGBoundingBoxOptions', + }, + ScopedCredentialDescriptor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ScopedCredentialDescriptor', + }, + ScopedCredentialOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ScopedCredentialOptions', + }, + ScopedCredentialParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ScopedCredentialParameters', + }, + ScrollIntoViewOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ScrollIntoViewOptions', + }, + ScrollOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ScrollOptions', + }, + ScrollToOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ScrollToOptions', + }, + SecurityPolicyViolationEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SecurityPolicyViolationEventInit', + }, + ServiceWorkerMessageEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ServiceWorkerMessageEventInit', + }, + ShadowRootInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ShadowRootInit', + }, + ShareData: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ShareData', + }, + SpeechSynthesisErrorEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SpeechSynthesisErrorEventInit', + }, + SpeechSynthesisEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SpeechSynthesisEventInit', + }, + StaticRangeInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'StaticRangeInit', + }, + StereoPannerOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'StereoPannerOptions', + }, + StorageEstimate: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'StorageEstimate', + }, + StorageEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'StorageEventInit', + }, + StoreExceptionsInformation: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'StoreExceptionsInformation', + }, + StoreSiteSpecificExceptionsInformation: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'StoreSiteSpecificExceptionsInformation', + }, + TextDecodeOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TextDecodeOptions', + }, + TextDecoderOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TextDecoderOptions', + }, + TextEncoderEncodeIntoResult: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TextEncoderEncodeIntoResult', + }, + TouchEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TouchEventInit', + }, + TouchInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TouchInit', + }, + TrackEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TrackEventInit', + }, + Transformer: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Transformer', + }, + TransitionEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TransitionEventInit', + }, + UIEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'UIEventInit', + }, + ULongRange: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ULongRange', + }, + UnderlyingByteSource: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'UnderlyingByteSource', + }, + UnderlyingSink: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'UnderlyingSink', + }, + UnderlyingSource: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'UnderlyingSource', + }, + VRDisplayEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'VRDisplayEventInit', + }, + VRLayer: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'VRLayer', + }, + VRStageParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'VRStageParameters', + }, + WaveShaperOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WaveShaperOptions', + }, + WebAuthnExtensions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WebAuthnExtensions', + }, + WebGLContextAttributes: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WebGLContextAttributes', + }, + WebGLContextEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WebGLContextEventInit', + }, + WheelEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WheelEventInit', + }, + WorkerOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WorkerOptions', + }, + WorkletOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WorkletOptions', + }, + txAuthGenericArg: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'txAuthGenericArg', + }, + EventListener: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EventListener', + }, + XPathNSResolver: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'XPathNSResolver', + }, + ANGLE_instanced_arrays: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ANGLE_instanced_arrays', + }, + AbortController: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AbortController', + }, + AbortSignalEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AbortSignalEventMap', + }, + AbortSignal: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AbortSignal', + }, + AbstractRange: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AbstractRange', + }, + AbstractWorkerEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AbstractWorkerEventMap', + }, + AbstractWorker: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AbstractWorker', + }, + AesCfbParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AesCfbParams', + }, + AesCmacParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AesCmacParams', + }, + AnalyserNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AnalyserNode', + }, + Animatable: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Animatable', + }, + AnimationEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AnimationEventMap', + }, + Animation: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Animation', + }, + AnimationEffect: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AnimationEffect', + }, + AnimationEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AnimationEvent', + }, + AnimationFrameProvider: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AnimationFrameProvider', + }, + AnimationPlaybackEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AnimationPlaybackEvent', + }, + AnimationTimeline: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AnimationTimeline', + }, + ApplicationCacheEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ApplicationCacheEventMap', + }, + ApplicationCache: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ApplicationCache', + }, + Attr: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Attr', + }, + AudioBuffer: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AudioBuffer', + }, + AudioBufferSourceNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AudioBufferSourceNode', + }, + AudioContext: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AudioContext', + }, + AudioDestinationNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AudioDestinationNode', + }, + AudioListener: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AudioListener', + }, + AudioNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AudioNode', + }, + AudioParam: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AudioParam', + }, + AudioParamMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AudioParamMap', + }, + AudioProcessingEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AudioProcessingEvent', + }, + AudioScheduledSourceNodeEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AudioScheduledSourceNodeEventMap', + }, + AudioScheduledSourceNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AudioScheduledSourceNode', + }, + AudioWorklet: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AudioWorklet', + }, + AudioWorkletNodeEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AudioWorkletNodeEventMap', + }, + AudioWorkletNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AudioWorkletNode', + }, + AuthenticatorAssertionResponse: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AuthenticatorAssertionResponse', + }, + AuthenticatorAttestationResponse: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AuthenticatorAttestationResponse', + }, + AuthenticatorResponse: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AuthenticatorResponse', + }, + BarProp: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'BarProp', + }, + BaseAudioContextEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BaseAudioContextEventMap', + }, + BaseAudioContext: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'BaseAudioContext', + }, + BeforeUnloadEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'BeforeUnloadEvent', + }, + BhxBrowser: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'BhxBrowser', + }, + BiquadFilterNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'BiquadFilterNode', + }, + Blob: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Blob', + }, + Body: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Body', + }, + BroadcastChannelEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BroadcastChannelEventMap', + }, + BroadcastChannel: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'BroadcastChannel', + }, + ByteLengthQueuingStrategy: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ByteLengthQueuingStrategy', + }, + CDATASection: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CDATASection', + }, + CSSConditionRule: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CSSConditionRule', + }, + CSSFontFaceRule: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CSSFontFaceRule', + }, + CSSGroupingRule: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CSSGroupingRule', + }, + CSSImportRule: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CSSImportRule', + }, + CSSKeyframeRule: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CSSKeyframeRule', + }, + CSSKeyframesRule: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CSSKeyframesRule', + }, + CSSMediaRule: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CSSMediaRule', + }, + CSSNamespaceRule: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CSSNamespaceRule', + }, + CSSPageRule: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CSSPageRule', + }, + CSSRule: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CSSRule', + }, + CSSRuleList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CSSRuleList', + }, + CSSStyleDeclaration: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CSSStyleDeclaration', + }, + CSSStyleRule: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CSSStyleRule', + }, + CSSStyleSheet: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CSSStyleSheet', + }, + CSSSupportsRule: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CSSSupportsRule', + }, + Cache: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Cache', + }, + CacheStorage: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CacheStorage', + }, + CanvasCompositing: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasCompositing', + }, + CanvasDrawImage: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasDrawImage', + }, + CanvasDrawPath: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasDrawPath', + }, + CanvasFillStrokeStyles: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasFillStrokeStyles', + }, + CanvasFilters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasFilters', + }, + CanvasGradient: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CanvasGradient', + }, + CanvasImageData: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasImageData', + }, + CanvasImageSmoothing: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasImageSmoothing', + }, + CanvasPath: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasPath', + }, + CanvasPathDrawingStyles: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasPathDrawingStyles', + }, + CanvasPattern: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CanvasPattern', + }, + CanvasRect: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasRect', + }, + CanvasRenderingContext2D: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CanvasRenderingContext2D', + }, + CanvasShadowStyles: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasShadowStyles', + }, + CanvasState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasState', + }, + CanvasText: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasText', + }, + CanvasTextDrawingStyles: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasTextDrawingStyles', + }, + CanvasTransform: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasTransform', + }, + CanvasUserInterface: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasUserInterface', + }, + CaretPosition: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CaretPosition', + }, + ChannelMergerNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ChannelMergerNode', + }, + ChannelSplitterNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ChannelSplitterNode', + }, + CharacterData: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CharacterData', + }, + ChildNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ChildNode', + }, + ClientRect: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ClientRect', + }, + ClientRectList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ClientRectList', + }, + Clipboard: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Clipboard', + }, + ClipboardEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ClipboardEvent', + }, + CloseEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CloseEvent', + }, + Comment: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Comment', + }, + CompositionEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CompositionEvent', + }, + ConcatParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ConcatParams', + }, + ConstantSourceNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ConstantSourceNode', + }, + ConvolverNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ConvolverNode', + }, + Coordinates: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Coordinates', + }, + CountQueuingStrategy: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CountQueuingStrategy', + }, + Credential: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Credential', + }, + CredentialsContainer: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CredentialsContainer', + }, + Crypto: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Crypto', + }, + CryptoKey: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CryptoKey', + }, + CryptoKeyPair: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CryptoKeyPair', + }, + CustomElementRegistry: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CustomElementRegistry', + }, + CustomEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CustomEvent', + }, + DOMError: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMError', + }, + DOMException: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMException', + }, + DOMImplementation: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMImplementation', + }, + DOML2DeprecatedColorProperty: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DOML2DeprecatedColorProperty', + }, + DOMMatrix: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMMatrix', + }, + SVGMatrix: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGMatrix', + }, + WebKitCSSMatrix: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebKitCSSMatrix', + }, + DOMMatrixReadOnly: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMMatrixReadOnly', + }, + DOMParser: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMParser', + }, + DOMPoint: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMPoint', + }, + SVGPoint: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPoint', + }, + DOMPointReadOnly: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMPointReadOnly', + }, + DOMQuad: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMQuad', + }, + DOMRect: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMRect', + }, + SVGRect: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGRect', + }, + DOMRectList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMRectList', + }, + DOMRectReadOnly: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMRectReadOnly', + }, + DOMSettableTokenList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMSettableTokenList', + }, + DOMStringList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMStringList', + }, + DOMStringMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMStringMap', + }, + DOMTokenList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMTokenList', + }, + DataCue: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DataCue', + }, + DataTransfer: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DataTransfer', + }, + DataTransferItem: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DataTransferItem', + }, + DataTransferItemList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DataTransferItemList', + }, + DeferredPermissionRequest: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DeferredPermissionRequest', + }, + DelayNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DelayNode', + }, + DeviceAcceleration: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DeviceAcceleration', + }, + DeviceLightEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DeviceLightEvent', + }, + DeviceMotionEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DeviceMotionEvent', + }, + DeviceMotionEventAcceleration: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DeviceMotionEventAcceleration', + }, + DeviceMotionEventRotationRate: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DeviceMotionEventRotationRate', + }, + DeviceOrientationEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DeviceOrientationEvent', + }, + DeviceRotationRate: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DeviceRotationRate', + }, + DhImportKeyParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DhImportKeyParams', + }, + DhKeyAlgorithm: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DhKeyAlgorithm', + }, + DhKeyDeriveParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DhKeyDeriveParams', + }, + DhKeyGenParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DhKeyGenParams', + }, + DocumentEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DocumentEventMap', + }, + Document: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Document', + }, + DocumentAndElementEventHandlersEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DocumentAndElementEventHandlersEventMap', + }, + DocumentAndElementEventHandlers: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DocumentAndElementEventHandlers', + }, + DocumentEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DocumentEvent', + }, + DocumentFragment: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DocumentFragment', + }, + DocumentOrShadowRoot: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DocumentOrShadowRoot', + }, + DocumentTimeline: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DocumentTimeline', + }, + DocumentType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DocumentType', + }, + DragEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DragEvent', + }, + DynamicsCompressorNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DynamicsCompressorNode', + }, + EXT_blend_minmax: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EXT_blend_minmax', + }, + EXT_frag_depth: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EXT_frag_depth', + }, + EXT_sRGB: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EXT_sRGB', + }, + EXT_shader_texture_lod: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EXT_shader_texture_lod', + }, + EXT_texture_filter_anisotropic: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EXT_texture_filter_anisotropic', + }, + ElementEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ElementEventMap', + }, + Element: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Element', + }, + ElementCSSInlineStyle: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ElementCSSInlineStyle', + }, + ElementContentEditable: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ElementContentEditable', + }, + ErrorEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ErrorEvent', + }, + Event: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Event', + }, + EventListenerObject: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EventListenerObject', + }, + EventSourceEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EventSourceEventMap', + }, + EventSource: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'EventSource', + }, + EventTarget: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'EventTarget', + }, + ExtensionScriptApis: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ExtensionScriptApis', + }, + External: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'External', + }, + File: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'File', + }, + FileList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'FileList', + }, + FileReaderEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'FileReaderEventMap', + }, + FileReader: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'FileReader', + }, + FocusEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'FocusEvent', + }, + FocusNavigationEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'FocusNavigationEvent', + }, + FormData: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'FormData', + }, + GainNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'GainNode', + }, + Gamepad: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Gamepad', + }, + GamepadButton: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'GamepadButton', + }, + GamepadEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'GamepadEvent', + }, + GamepadHapticActuator: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'GamepadHapticActuator', + }, + GamepadPose: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'GamepadPose', + }, + GenericTransformStream: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GenericTransformStream', + }, + Geolocation: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Geolocation', + }, + GlobalEventHandlersEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GlobalEventHandlersEventMap', + }, + GlobalEventHandlers: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GlobalEventHandlers', + }, + HTMLAllCollection: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLAllCollection', + }, + HTMLAnchorElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLAnchorElement', + }, + HTMLAppletElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLAppletElement', + }, + HTMLAreaElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLAreaElement', + }, + HTMLAudioElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLAudioElement', + }, + HTMLBRElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLBRElement', + }, + HTMLBaseElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLBaseElement', + }, + HTMLBaseFontElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLBaseFontElement', + }, + HTMLBodyElementEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HTMLBodyElementEventMap', + }, + HTMLBodyElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLBodyElement', + }, + HTMLButtonElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLButtonElement', + }, + HTMLCanvasElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLCanvasElement', + }, + HTMLCollectionBase: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HTMLCollectionBase', + }, + HTMLCollection: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLCollection', + }, + HTMLCollectionOf: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HTMLCollectionOf', + }, + HTMLDListElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLDListElement', + }, + HTMLDataElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLDataElement', + }, + HTMLDataListElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLDataListElement', + }, + HTMLDetailsElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLDetailsElement', + }, + HTMLDialogElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLDialogElement', + }, + HTMLDirectoryElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLDirectoryElement', + }, + HTMLDivElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLDivElement', + }, + HTMLDocument: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLDocument', + }, + HTMLElementEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HTMLElementEventMap', + }, + HTMLElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLElement', + }, + HTMLEmbedElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLEmbedElement', + }, + HTMLFieldSetElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLFieldSetElement', + }, + HTMLFontElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLFontElement', + }, + HTMLFormControlsCollection: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLFormControlsCollection', + }, + HTMLFormElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLFormElement', + }, + HTMLFrameElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLFrameElement', + }, + HTMLFrameSetElementEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HTMLFrameSetElementEventMap', + }, + HTMLFrameSetElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLFrameSetElement', + }, + HTMLHRElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLHRElement', + }, + HTMLHeadElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLHeadElement', + }, + HTMLHeadingElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLHeadingElement', + }, + HTMLHtmlElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLHtmlElement', + }, + HTMLHyperlinkElementUtils: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HTMLHyperlinkElementUtils', + }, + HTMLIFrameElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLIFrameElement', + }, + HTMLImageElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLImageElement', + }, + HTMLInputElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLInputElement', + }, + HTMLLIElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLLIElement', + }, + HTMLLabelElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLLabelElement', + }, + HTMLLegendElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLLegendElement', + }, + HTMLLinkElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLLinkElement', + }, + HTMLMapElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLMapElement', + }, + HTMLMarqueeElementEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HTMLMarqueeElementEventMap', + }, + HTMLMarqueeElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLMarqueeElement', + }, + HTMLMediaElementEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HTMLMediaElementEventMap', + }, + HTMLMediaElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLMediaElement', + }, + HTMLMenuElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLMenuElement', + }, + HTMLMetaElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLMetaElement', + }, + HTMLMeterElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLMeterElement', + }, + HTMLModElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLModElement', + }, + HTMLOListElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLOListElement', + }, + HTMLObjectElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLObjectElement', + }, + HTMLOptGroupElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLOptGroupElement', + }, + HTMLOptionElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLOptionElement', + }, + HTMLOptionsCollection: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLOptionsCollection', + }, + HTMLOrSVGElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HTMLOrSVGElement', + }, + HTMLOutputElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLOutputElement', + }, + HTMLParagraphElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLParagraphElement', + }, + HTMLParamElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLParamElement', + }, + HTMLPictureElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLPictureElement', + }, + HTMLPreElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLPreElement', + }, + HTMLProgressElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLProgressElement', + }, + HTMLQuoteElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLQuoteElement', + }, + HTMLScriptElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLScriptElement', + }, + HTMLSelectElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLSelectElement', + }, + HTMLSlotElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLSlotElement', + }, + HTMLSourceElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLSourceElement', + }, + HTMLSpanElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLSpanElement', + }, + HTMLStyleElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLStyleElement', + }, + HTMLTableCaptionElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLTableCaptionElement', + }, + HTMLTableCellElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLTableCellElement', + }, + HTMLTableColElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLTableColElement', + }, + HTMLTableDataCellElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLTableDataCellElement', + }, + HTMLTableElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLTableElement', + }, + HTMLTableHeaderCellElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLTableHeaderCellElement', + }, + HTMLTableRowElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLTableRowElement', + }, + HTMLTableSectionElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLTableSectionElement', + }, + HTMLTemplateElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLTemplateElement', + }, + HTMLTextAreaElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLTextAreaElement', + }, + HTMLTimeElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLTimeElement', + }, + HTMLTitleElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLTitleElement', + }, + HTMLTrackElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLTrackElement', + }, + HTMLUListElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLUListElement', + }, + HTMLUnknownElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLUnknownElement', + }, + HTMLVideoElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HTMLVideoElement', + }, + HashChangeEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'HashChangeEvent', + }, + Headers: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Headers', + }, + History: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'History', + }, + HkdfCtrParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HkdfCtrParams', + }, + IDBArrayKey: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBArrayKey', + }, + IDBCursor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IDBCursor', + }, + IDBCursorWithValue: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IDBCursorWithValue', + }, + IDBDatabaseEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBDatabaseEventMap', + }, + IDBDatabase: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IDBDatabase', + }, + IDBFactory: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IDBFactory', + }, + IDBIndex: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IDBIndex', + }, + IDBKeyRange: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IDBKeyRange', + }, + IDBObjectStore: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IDBObjectStore', + }, + IDBOpenDBRequestEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBOpenDBRequestEventMap', + }, + IDBOpenDBRequest: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IDBOpenDBRequest', + }, + IDBRequestEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBRequestEventMap', + }, + IDBRequest: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IDBRequest', + }, + IDBTransactionEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBTransactionEventMap', + }, + IDBTransaction: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IDBTransaction', + }, + IDBVersionChangeEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IDBVersionChangeEvent', + }, + IIRFilterNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IIRFilterNode', + }, + ImageBitmap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ImageBitmap', + }, + ImageBitmapRenderingContext: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ImageBitmapRenderingContext', + }, + ImageData: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ImageData', + }, + InnerHTML: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'InnerHTML', + }, + InputDeviceInfo: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'InputDeviceInfo', + }, + InputEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'InputEvent', + }, + IntersectionObserver: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IntersectionObserver', + }, + IntersectionObserverEntry: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IntersectionObserverEntry', + }, + KeyboardEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'KeyboardEvent', + }, + KeyframeEffect: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'KeyframeEffect', + }, + LinkStyle: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'LinkStyle', + }, + ListeningStateChangedEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ListeningStateChangedEvent', + }, + Location: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Location', + }, + MSAssertion: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MSAssertion', + }, + MSBlobBuilder: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MSBlobBuilder', + }, + MSFIDOCredentialAssertion: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MSFIDOCredentialAssertion', + }, + MSFIDOSignature: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MSFIDOSignature', + }, + MSFIDOSignatureAssertion: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MSFIDOSignatureAssertion', + }, + MSFileSaver: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MSFileSaver', + }, + MSGesture: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MSGesture', + }, + MSGestureEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MSGestureEvent', + }, + MSGraphicsTrust: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MSGraphicsTrust', + }, + MSInputMethodContextEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MSInputMethodContextEventMap', + }, + MSInputMethodContext: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MSInputMethodContext', + }, + MSMediaKeyError: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MSMediaKeyError', + }, + MSMediaKeyMessageEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MSMediaKeyMessageEvent', + }, + MSMediaKeyNeededEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MSMediaKeyNeededEvent', + }, + MSMediaKeySession: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MSMediaKeySession', + }, + MSMediaKeys: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MSMediaKeys', + }, + MSNavigatorDoNotTrack: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MSNavigatorDoNotTrack', + }, + MSPointerEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MSPointerEvent', + }, + MSStream: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MSStream', + }, + MediaDeviceInfo: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MediaDeviceInfo', + }, + MediaDevicesEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaDevicesEventMap', + }, + MediaDevices: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MediaDevices', + }, + MediaElementAudioSourceNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MediaElementAudioSourceNode', + }, + MediaEncryptedEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MediaEncryptedEvent', + }, + MediaError: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MediaError', + }, + MediaKeyMessageEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MediaKeyMessageEvent', + }, + MediaKeySessionEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaKeySessionEventMap', + }, + MediaKeySession: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MediaKeySession', + }, + MediaKeyStatusMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MediaKeyStatusMap', + }, + MediaKeySystemAccess: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MediaKeySystemAccess', + }, + MediaKeys: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MediaKeys', + }, + MediaList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MediaList', + }, + MediaQueryListEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaQueryListEventMap', + }, + MediaQueryList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MediaQueryList', + }, + MediaQueryListEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MediaQueryListEvent', + }, + MediaSourceEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaSourceEventMap', + }, + MediaSource: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MediaSource', + }, + MediaStreamEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaStreamEventMap', + }, + MediaStream: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MediaStream', + }, + MediaStreamAudioDestinationNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MediaStreamAudioDestinationNode', + }, + MediaStreamAudioSourceNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MediaStreamAudioSourceNode', + }, + MediaStreamError: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MediaStreamError', + }, + MediaStreamErrorEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MediaStreamErrorEvent', + }, + MediaStreamEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MediaStreamEvent', + }, + MediaStreamTrackEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaStreamTrackEventMap', + }, + MediaStreamTrack: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MediaStreamTrack', + }, + MediaStreamTrackAudioSourceNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MediaStreamTrackAudioSourceNode', + }, + MediaStreamTrackEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MediaStreamTrackEvent', + }, + MessageChannel: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MessageChannel', + }, + MessageEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MessageEvent', + }, + MessagePortEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MessagePortEventMap', + }, + MessagePort: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MessagePort', + }, + MimeType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MimeType', + }, + MimeTypeArray: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MimeTypeArray', + }, + MouseEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MouseEvent', + }, + MutationEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MutationEvent', + }, + MutationObserver: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MutationObserver', + }, + MutationRecord: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MutationRecord', + }, + NamedNodeMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'NamedNodeMap', + }, + NavigationPreloadManager: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'NavigationPreloadManager', + }, + Navigator: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Navigator', + }, + NavigatorAutomationInformation: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NavigatorAutomationInformation', + }, + NavigatorBeacon: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NavigatorBeacon', + }, + NavigatorConcurrentHardware: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NavigatorConcurrentHardware', + }, + NavigatorContentUtils: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NavigatorContentUtils', + }, + NavigatorCookies: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NavigatorCookies', + }, + NavigatorID: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NavigatorID', + }, + NavigatorLanguage: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NavigatorLanguage', + }, + NavigatorOnLine: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NavigatorOnLine', + }, + NavigatorPlugins: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NavigatorPlugins', + }, + NavigatorStorage: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NavigatorStorage', + }, + Node: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Node', + }, + NodeFilter: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'NodeFilter', + }, + NodeIterator: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'NodeIterator', + }, + NodeList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'NodeList', + }, + NodeListOf: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NodeListOf', + }, + NonDocumentTypeChildNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NonDocumentTypeChildNode', + }, + NonElementParentNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NonElementParentNode', + }, + NotificationEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NotificationEventMap', + }, + Notification: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Notification', + }, + OES_element_index_uint: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OES_element_index_uint', + }, + OES_standard_derivatives: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OES_standard_derivatives', + }, + OES_texture_float: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OES_texture_float', + }, + OES_texture_float_linear: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OES_texture_float_linear', + }, + OES_texture_half_float: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OES_texture_half_float', + }, + OES_texture_half_float_linear: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OES_texture_half_float_linear', + }, + OES_vertex_array_object: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OES_vertex_array_object', + }, + OfflineAudioCompletionEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'OfflineAudioCompletionEvent', + }, + OfflineAudioContextEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OfflineAudioContextEventMap', + }, + OfflineAudioContext: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'OfflineAudioContext', + }, + OffscreenCanvas: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'OffscreenCanvas', + }, + OffscreenCanvasRenderingContext2D: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'OffscreenCanvasRenderingContext2D', + }, + OscillatorNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'OscillatorNode', + }, + OverconstrainedError: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'OverconstrainedError', + }, + OverflowEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'OverflowEvent', + }, + PageTransitionEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PageTransitionEvent', + }, + PannerNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PannerNode', + }, + ParentNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ParentNode', + }, + Path2D: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Path2D', + }, + PaymentAddress: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PaymentAddress', + }, + PaymentRequestEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PaymentRequestEventMap', + }, + PaymentRequest: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PaymentRequest', + }, + PaymentRequestUpdateEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PaymentRequestUpdateEvent', + }, + PaymentResponse: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PaymentResponse', + }, + PerfWidgetExternal: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PerfWidgetExternal', + }, + PerformanceEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PerformanceEventMap', + }, + Performance: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Performance', + }, + PerformanceEntry: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PerformanceEntry', + }, + PerformanceMark: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PerformanceMark', + }, + PerformanceMeasure: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PerformanceMeasure', + }, + PerformanceNavigation: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PerformanceNavigation', + }, + PerformanceNavigationTiming: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PerformanceNavigationTiming', + }, + PerformanceObserver: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PerformanceObserver', + }, + PerformanceObserverEntryList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PerformanceObserverEntryList', + }, + PerformanceResourceTiming: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PerformanceResourceTiming', + }, + PerformanceTiming: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PerformanceTiming', + }, + PeriodicWave: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PeriodicWave', + }, + PermissionRequest: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PermissionRequest', + }, + PermissionRequestedEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PermissionRequestedEvent', + }, + PermissionStatusEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PermissionStatusEventMap', + }, + PermissionStatus: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PermissionStatus', + }, + Permissions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Permissions', + }, + Plugin: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Plugin', + }, + PluginArray: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PluginArray', + }, + PointerEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PointerEvent', + }, + PopStateEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PopStateEvent', + }, + Position: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Position', + }, + PositionError: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PositionError', + }, + ProcessingInstruction: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ProcessingInstruction', + }, + ProgressEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ProgressEvent', + }, + PromiseRejectionEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PromiseRejectionEvent', + }, + PublicKeyCredential: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PublicKeyCredential', + }, + PushManager: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PushManager', + }, + PushSubscription: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PushSubscription', + }, + PushSubscriptionOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PushSubscriptionOptions', + }, + RTCCertificate: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCCertificate', + }, + RTCDTMFSenderEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCDTMFSenderEventMap', + }, + RTCDTMFSender: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCDTMFSender', + }, + RTCDTMFToneChangeEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCDTMFToneChangeEvent', + }, + RTCDataChannelEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCDataChannelEventMap', + }, + RTCDataChannel: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCDataChannel', + }, + RTCDataChannelEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCDataChannelEvent', + }, + RTCDtlsTransportEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCDtlsTransportEventMap', + }, + RTCDtlsTransport: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCDtlsTransport', + }, + RTCDtlsTransportStateChangedEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCDtlsTransportStateChangedEvent', + }, + RTCDtmfSenderEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCDtmfSenderEventMap', + }, + RTCDtmfSender: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCDtmfSender', + }, + RTCError: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCError', + }, + RTCErrorEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCErrorEvent', + }, + RTCIceCandidate: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCIceCandidate', + }, + RTCIceCandidatePairChangedEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCIceCandidatePairChangedEvent', + }, + RTCIceGathererEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIceGathererEventMap', + }, + RTCIceGatherer: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCIceGatherer', + }, + RTCIceGathererEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCIceGathererEvent', + }, + RTCIceTransportEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIceTransportEventMap', + }, + RTCIceTransport: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCIceTransport', + }, + RTCIceTransportStateChangedEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCIceTransportStateChangedEvent', + }, + RTCIdentityAssertion: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCIdentityAssertion', + }, + RTCPeerConnectionEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCPeerConnectionEventMap', + }, + RTCPeerConnection: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCPeerConnection', + }, + RTCPeerConnectionIceErrorEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCPeerConnectionIceErrorEvent', + }, + RTCPeerConnectionIceEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCPeerConnectionIceEvent', + }, + RTCRtpReceiver: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCRtpReceiver', + }, + RTCRtpSender: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCRtpSender', + }, + RTCRtpTransceiver: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCRtpTransceiver', + }, + RTCSctpTransportEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCSctpTransportEventMap', + }, + RTCSctpTransport: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCSctpTransport', + }, + RTCSessionDescription: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCSessionDescription', + }, + RTCSrtpSdesTransportEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCSrtpSdesTransportEventMap', + }, + RTCSrtpSdesTransport: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCSrtpSdesTransport', + }, + RTCSsrcConflictEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCSsrcConflictEvent', + }, + RTCStatsEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCStatsEvent', + }, + RTCStatsProvider: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCStatsProvider', + }, + RTCTrackEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RTCTrackEvent', + }, + RadioNodeList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RadioNodeList', + }, + RandomSource: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RandomSource', + }, + Range: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Range', + }, + ReadableByteStreamController: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadableByteStreamController', + }, + ReadableStream: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ReadableStream', + }, + ReadableStreamBYOBReader: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadableStreamBYOBReader', + }, + ReadableStreamBYOBRequest: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadableStreamBYOBRequest', + }, + ReadableStreamDefaultController: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadableStreamDefaultController', + }, + ReadableStreamDefaultReader: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadableStreamDefaultReader', + }, + ReadableStreamReader: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ReadableStreamReader', + }, + Request: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Request', + }, + Response: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Response', + }, + SVGAElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGAElement', + }, + SVGAngle: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGAngle', + }, + SVGAnimateElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGAnimateElement', + }, + SVGAnimateMotionElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGAnimateMotionElement', + }, + SVGAnimateTransformElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGAnimateTransformElement', + }, + SVGAnimatedAngle: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGAnimatedAngle', + }, + SVGAnimatedBoolean: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGAnimatedBoolean', + }, + SVGAnimatedEnumeration: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGAnimatedEnumeration', + }, + SVGAnimatedInteger: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGAnimatedInteger', + }, + SVGAnimatedLength: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGAnimatedLength', + }, + SVGAnimatedLengthList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGAnimatedLengthList', + }, + SVGAnimatedNumber: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGAnimatedNumber', + }, + SVGAnimatedNumberList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGAnimatedNumberList', + }, + SVGAnimatedPoints: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SVGAnimatedPoints', + }, + SVGAnimatedPreserveAspectRatio: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGAnimatedPreserveAspectRatio', + }, + SVGAnimatedRect: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGAnimatedRect', + }, + SVGAnimatedString: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGAnimatedString', + }, + SVGAnimatedTransformList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGAnimatedTransformList', + }, + SVGAnimationElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGAnimationElement', + }, + SVGCircleElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGCircleElement', + }, + SVGClipPathElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGClipPathElement', + }, + SVGComponentTransferFunctionElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGComponentTransferFunctionElement', + }, + SVGCursorElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGCursorElement', + }, + SVGDefsElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGDefsElement', + }, + SVGDescElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGDescElement', + }, + SVGElementEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SVGElementEventMap', + }, + SVGElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGElement', + }, + SVGElementInstance: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGElementInstance', + }, + SVGElementInstanceList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGElementInstanceList', + }, + SVGEllipseElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGEllipseElement', + }, + SVGFEBlendElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFEBlendElement', + }, + SVGFEColorMatrixElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFEColorMatrixElement', + }, + SVGFEComponentTransferElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFEComponentTransferElement', + }, + SVGFECompositeElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFECompositeElement', + }, + SVGFEConvolveMatrixElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFEConvolveMatrixElement', + }, + SVGFEDiffuseLightingElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFEDiffuseLightingElement', + }, + SVGFEDisplacementMapElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFEDisplacementMapElement', + }, + SVGFEDistantLightElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFEDistantLightElement', + }, + SVGFEDropShadowElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFEDropShadowElement', + }, + SVGFEFloodElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFEFloodElement', + }, + SVGFEFuncAElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFEFuncAElement', + }, + SVGFEFuncBElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFEFuncBElement', + }, + SVGFEFuncGElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFEFuncGElement', + }, + SVGFEFuncRElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFEFuncRElement', + }, + SVGFEGaussianBlurElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFEGaussianBlurElement', + }, + SVGFEImageElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFEImageElement', + }, + SVGFEMergeElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFEMergeElement', + }, + SVGFEMergeNodeElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFEMergeNodeElement', + }, + SVGFEMorphologyElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFEMorphologyElement', + }, + SVGFEOffsetElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFEOffsetElement', + }, + SVGFEPointLightElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFEPointLightElement', + }, + SVGFESpecularLightingElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFESpecularLightingElement', + }, + SVGFESpotLightElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFESpotLightElement', + }, + SVGFETileElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFETileElement', + }, + SVGFETurbulenceElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFETurbulenceElement', + }, + SVGFilterElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGFilterElement', + }, + SVGFilterPrimitiveStandardAttributes: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SVGFilterPrimitiveStandardAttributes', + }, + SVGFitToViewBox: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SVGFitToViewBox', + }, + SVGForeignObjectElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGForeignObjectElement', + }, + SVGGElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGGElement', + }, + SVGGeometryElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGGeometryElement', + }, + SVGGradientElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGGradientElement', + }, + SVGGraphicsElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGGraphicsElement', + }, + SVGImageElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGImageElement', + }, + SVGLength: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGLength', + }, + SVGLengthList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGLengthList', + }, + SVGLineElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGLineElement', + }, + SVGLinearGradientElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGLinearGradientElement', + }, + SVGMarkerElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGMarkerElement', + }, + SVGMaskElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGMaskElement', + }, + SVGMetadataElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGMetadataElement', + }, + SVGNumber: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGNumber', + }, + SVGNumberList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGNumberList', + }, + SVGPathElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPathElement', + }, + SVGPathSeg: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPathSeg', + }, + SVGPathSegArcAbs: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPathSegArcAbs', + }, + SVGPathSegArcRel: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPathSegArcRel', + }, + SVGPathSegClosePath: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPathSegClosePath', + }, + SVGPathSegCurvetoCubicAbs: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPathSegCurvetoCubicAbs', + }, + SVGPathSegCurvetoCubicRel: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPathSegCurvetoCubicRel', + }, + SVGPathSegCurvetoCubicSmoothAbs: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPathSegCurvetoCubicSmoothAbs', + }, + SVGPathSegCurvetoCubicSmoothRel: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPathSegCurvetoCubicSmoothRel', + }, + SVGPathSegCurvetoQuadraticAbs: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPathSegCurvetoQuadraticAbs', + }, + SVGPathSegCurvetoQuadraticRel: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPathSegCurvetoQuadraticRel', + }, + SVGPathSegCurvetoQuadraticSmoothAbs: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPathSegCurvetoQuadraticSmoothAbs', + }, + SVGPathSegCurvetoQuadraticSmoothRel: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPathSegCurvetoQuadraticSmoothRel', + }, + SVGPathSegLinetoAbs: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPathSegLinetoAbs', + }, + SVGPathSegLinetoHorizontalAbs: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPathSegLinetoHorizontalAbs', + }, + SVGPathSegLinetoHorizontalRel: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPathSegLinetoHorizontalRel', + }, + SVGPathSegLinetoRel: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPathSegLinetoRel', + }, + SVGPathSegLinetoVerticalAbs: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPathSegLinetoVerticalAbs', + }, + SVGPathSegLinetoVerticalRel: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPathSegLinetoVerticalRel', + }, + SVGPathSegList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPathSegList', + }, + SVGPathSegMovetoAbs: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPathSegMovetoAbs', + }, + SVGPathSegMovetoRel: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPathSegMovetoRel', + }, + SVGPatternElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPatternElement', + }, + SVGPointList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPointList', + }, + SVGPolygonElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPolygonElement', + }, + SVGPolylineElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPolylineElement', + }, + SVGPreserveAspectRatio: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGPreserveAspectRatio', + }, + SVGRadialGradientElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGRadialGradientElement', + }, + SVGRectElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGRectElement', + }, + SVGSVGElementEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SVGSVGElementEventMap', + }, + SVGSVGElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGSVGElement', + }, + SVGScriptElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGScriptElement', + }, + SVGStopElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGStopElement', + }, + SVGStringList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGStringList', + }, + SVGStyleElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGStyleElement', + }, + SVGSwitchElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGSwitchElement', + }, + SVGSymbolElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGSymbolElement', + }, + SVGTSpanElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGTSpanElement', + }, + SVGTests: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SVGTests', + }, + SVGTextContentElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGTextContentElement', + }, + SVGTextElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGTextElement', + }, + SVGTextPathElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGTextPathElement', + }, + SVGTextPositioningElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGTextPositioningElement', + }, + SVGTitleElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGTitleElement', + }, + SVGTransform: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGTransform', + }, + SVGTransformList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGTransformList', + }, + SVGURIReference: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SVGURIReference', + }, + SVGUnitTypes: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGUnitTypes', + }, + SVGUseElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGUseElement', + }, + SVGViewElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGViewElement', + }, + SVGZoomAndPan: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGZoomAndPan', + }, + SVGZoomEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SVGZoomEvent', + }, + ScopedCredential: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ScopedCredential', + }, + ScopedCredentialInfo: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ScopedCredentialInfo', + }, + Screen: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Screen', + }, + ScreenOrientationEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ScreenOrientationEventMap', + }, + ScreenOrientation: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ScreenOrientation', + }, + ScriptProcessorNodeEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ScriptProcessorNodeEventMap', + }, + ScriptProcessorNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ScriptProcessorNode', + }, + SecurityPolicyViolationEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SecurityPolicyViolationEvent', + }, + Selection: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Selection', + }, + ServiceUIFrameContext: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ServiceUIFrameContext', + }, + ServiceWorkerEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ServiceWorkerEventMap', + }, + ServiceWorker: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ServiceWorker', + }, + ServiceWorkerContainerEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ServiceWorkerContainerEventMap', + }, + ServiceWorkerContainer: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ServiceWorkerContainer', + }, + ServiceWorkerMessageEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ServiceWorkerMessageEvent', + }, + ServiceWorkerRegistrationEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ServiceWorkerRegistrationEventMap', + }, + ServiceWorkerRegistration: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ServiceWorkerRegistration', + }, + ShadowRoot: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ShadowRoot', + }, + SharedWorker: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SharedWorker', + }, + Slottable: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Slottable', + }, + SourceBufferEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SourceBufferEventMap', + }, + SourceBuffer: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SourceBuffer', + }, + SourceBufferListEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SourceBufferListEventMap', + }, + SourceBufferList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SourceBufferList', + }, + SpeechGrammar: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SpeechGrammar', + }, + SpeechGrammarList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SpeechGrammarList', + }, + SpeechRecognitionEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SpeechRecognitionEventMap', + }, + SpeechRecognition: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SpeechRecognition', + }, + SpeechRecognitionAlternative: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SpeechRecognitionAlternative', + }, + SpeechRecognitionEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SpeechRecognitionEvent', + }, + SpeechRecognitionResult: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SpeechRecognitionResult', + }, + SpeechRecognitionResultList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SpeechRecognitionResultList', + }, + SpeechSynthesisEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SpeechSynthesisEventMap', + }, + SpeechSynthesis: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SpeechSynthesis', + }, + SpeechSynthesisErrorEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SpeechSynthesisErrorEvent', + }, + SpeechSynthesisEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SpeechSynthesisEvent', + }, + SpeechSynthesisUtteranceEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SpeechSynthesisUtteranceEventMap', + }, + SpeechSynthesisUtterance: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SpeechSynthesisUtterance', + }, + SpeechSynthesisVoice: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SpeechSynthesisVoice', + }, + StaticRange: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'StaticRange', + }, + StereoPannerNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'StereoPannerNode', + }, + Storage: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Storage', + }, + StorageEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'StorageEvent', + }, + StorageManager: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'StorageManager', + }, + StyleMedia: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'StyleMedia', + }, + StyleSheet: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'StyleSheet', + }, + StyleSheetList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'StyleSheetList', + }, + SubtleCrypto: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SubtleCrypto', + }, + SyncManager: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SyncManager', + }, + Text: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Text', + }, + TextDecoder: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'TextDecoder', + }, + TextDecoderCommon: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TextDecoderCommon', + }, + TextDecoderStream: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'TextDecoderStream', + }, + TextEncoder: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'TextEncoder', + }, + TextEncoderCommon: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TextEncoderCommon', + }, + TextEncoderStream: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'TextEncoderStream', + }, + TextEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'TextEvent', + }, + TextMetrics: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'TextMetrics', + }, + TextTrackEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TextTrackEventMap', + }, + TextTrack: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'TextTrack', + }, + TextTrackCueEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TextTrackCueEventMap', + }, + TextTrackCue: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'TextTrackCue', + }, + TextTrackCueList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'TextTrackCueList', + }, + TextTrackListEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TextTrackListEventMap', + }, + TextTrackList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'TextTrackList', + }, + TimeRanges: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'TimeRanges', + }, + Touch: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Touch', + }, + TouchEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'TouchEvent', + }, + TouchList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'TouchList', + }, + TrackEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'TrackEvent', + }, + TransformStream: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'TransformStream', + }, + TransformStreamDefaultController: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TransformStreamDefaultController', + }, + TransitionEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'TransitionEvent', + }, + TreeWalker: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'TreeWalker', + }, + UIEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'UIEvent', + }, + URL: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'URL', + }, + webkitURL: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'webkitURL', + }, + URLSearchParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'URLSearchParams', + }, + VRDisplay: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'VRDisplay', + }, + VRDisplayCapabilities: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'VRDisplayCapabilities', + }, + VRDisplayEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'VRDisplayEvent', + }, + VREyeParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'VREyeParameters', + }, + VRFieldOfView: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'VRFieldOfView', + }, + VRFrameData: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'VRFrameData', + }, + VRPose: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'VRPose', + }, + VTTCue: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'VTTCue', + }, + VTTRegion: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'VTTRegion', + }, + ValidityState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ValidityState', + }, + VideoPlaybackQuality: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'VideoPlaybackQuality', + }, + VisualViewportEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'VisualViewportEventMap', + }, + VisualViewport: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'VisualViewport', + }, + WEBGL_color_buffer_float: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WEBGL_color_buffer_float', + }, + WEBGL_compressed_texture_astc: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WEBGL_compressed_texture_astc', + }, + WEBGL_compressed_texture_s3tc: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WEBGL_compressed_texture_s3tc', + }, + WEBGL_compressed_texture_s3tc_srgb: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WEBGL_compressed_texture_s3tc_srgb', + }, + WEBGL_debug_renderer_info: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WEBGL_debug_renderer_info', + }, + WEBGL_debug_shaders: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WEBGL_debug_shaders', + }, + WEBGL_depth_texture: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WEBGL_depth_texture', + }, + WEBGL_draw_buffers: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WEBGL_draw_buffers', + }, + WEBGL_lose_context: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WEBGL_lose_context', + }, + WaveShaperNode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WaveShaperNode', + }, + WebAuthentication: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebAuthentication', + }, + WebAuthnAssertion: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebAuthnAssertion', + }, + WebGL2RenderingContext: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGL2RenderingContext', + }, + WebGL2RenderingContextBase: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WebGL2RenderingContextBase', + }, + WebGL2RenderingContextOverloads: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WebGL2RenderingContextOverloads', + }, + WebGLActiveInfo: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLActiveInfo', + }, + WebGLBuffer: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLBuffer', + }, + WebGLContextEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLContextEvent', + }, + WebGLFramebuffer: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLFramebuffer', + }, + WebGLObject: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLObject', + }, + WebGLProgram: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLProgram', + }, + WebGLQuery: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLQuery', + }, + WebGLRenderbuffer: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLRenderbuffer', + }, + WebGLRenderingContext: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLRenderingContext', + }, + WebGLRenderingContextBase: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WebGLRenderingContextBase', + }, + WebGLRenderingContextOverloads: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WebGLRenderingContextOverloads', + }, + WebGLSampler: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLSampler', + }, + WebGLShader: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLShader', + }, + WebGLShaderPrecisionFormat: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLShaderPrecisionFormat', + }, + WebGLSync: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLSync', + }, + WebGLTexture: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLTexture', + }, + WebGLTransformFeedback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLTransformFeedback', + }, + WebGLUniformLocation: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLUniformLocation', + }, + WebGLVertexArrayObject: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLVertexArrayObject', + }, + WebGLVertexArrayObjectOES: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WebGLVertexArrayObjectOES', + }, + WebKitPoint: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebKitPoint', + }, + WebSocketEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WebSocketEventMap', + }, + WebSocket: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebSocket', + }, + WheelEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WheelEvent', + }, + WindowEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WindowEventMap', + }, + Window: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Window', + }, + WindowEventHandlersEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WindowEventHandlersEventMap', + }, + WindowEventHandlers: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WindowEventHandlers', + }, + WindowLocalStorage: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WindowLocalStorage', + }, + WindowOrWorkerGlobalScope: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WindowOrWorkerGlobalScope', + }, + WindowSessionStorage: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WindowSessionStorage', + }, + WorkerEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WorkerEventMap', + }, + Worker: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Worker', + }, + Worklet: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Worklet', + }, + WritableStream: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WritableStream', + }, + WritableStreamDefaultController: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WritableStreamDefaultController', + }, + WritableStreamDefaultWriter: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WritableStreamDefaultWriter', + }, + XMLDocument: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'XMLDocument', + }, + XMLHttpRequestEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'XMLHttpRequestEventMap', + }, + XMLHttpRequest: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'XMLHttpRequest', + }, + XMLHttpRequestEventTargetEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'XMLHttpRequestEventTargetEventMap', + }, + XMLHttpRequestEventTarget: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'XMLHttpRequestEventTarget', + }, + XMLHttpRequestUpload: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'XMLHttpRequestUpload', + }, + XMLSerializer: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'XMLSerializer', + }, + XPathEvaluator: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'XPathEvaluator', + }, + XPathEvaluatorBase: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'XPathEvaluatorBase', + }, + XPathExpression: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'XPathExpression', + }, + XPathResult: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'XPathResult', + }, + XSLTProcessor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'XSLTProcessor', + }, + webkitRTCPeerConnection: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'webkitRTCPeerConnection', + }, + EventListenerOrEventListenerObject: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EventListenerOrEventListenerObject', + }, + Console: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Console', + }, + CSS: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CSS', + }, + WebAssembly: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebAssembly', + }, + BlobCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BlobCallback', + }, + CustomElementConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CustomElementConstructor', + }, + DecodeErrorCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DecodeErrorCallback', + }, + DecodeSuccessCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DecodeSuccessCallback', + }, + EventHandlerNonNull: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EventHandlerNonNull', + }, + ForEachCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ForEachCallback', + }, + FrameRequestCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'FrameRequestCallback', + }, + FunctionStringCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'FunctionStringCallback', + }, + IntersectionObserverCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IntersectionObserverCallback', + }, + MSLaunchUriCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MSLaunchUriCallback', + }, + MutationCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MutationCallback', + }, + NavigatorUserMediaErrorCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NavigatorUserMediaErrorCallback', + }, + NavigatorUserMediaSuccessCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NavigatorUserMediaSuccessCallback', + }, + NotificationPermissionCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NotificationPermissionCallback', + }, + OnBeforeUnloadEventHandlerNonNull: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OnBeforeUnloadEventHandlerNonNull', + }, + OnErrorEventHandlerNonNull: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OnErrorEventHandlerNonNull', + }, + PerformanceObserverCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PerformanceObserverCallback', + }, + PositionCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PositionCallback', + }, + PositionErrorCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PositionErrorCallback', + }, + QueuingStrategySizeCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'QueuingStrategySizeCallback', + }, + RTCPeerConnectionErrorCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCPeerConnectionErrorCallback', + }, + RTCSessionDescriptionCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCSessionDescriptionCallback', + }, + RTCStatsCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCStatsCallback', + }, + ReadableByteStreamControllerCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadableByteStreamControllerCallback', + }, + ReadableStreamDefaultControllerCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadableStreamDefaultControllerCallback', + }, + ReadableStreamErrorCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadableStreamErrorCallback', + }, + TransformStreamDefaultControllerCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TransformStreamDefaultControllerCallback', + }, + TransformStreamDefaultControllerTransformCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TransformStreamDefaultControllerTransformCallback', + }, + VoidFunction: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'VoidFunction', + }, + WritableStreamDefaultControllerCloseCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WritableStreamDefaultControllerCloseCallback', + }, + WritableStreamDefaultControllerStartCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WritableStreamDefaultControllerStartCallback', + }, + WritableStreamDefaultControllerWriteCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WritableStreamDefaultControllerWriteCallback', + }, + WritableStreamErrorCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WritableStreamErrorCallback', + }, + HTMLElementTagNameMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HTMLElementTagNameMap', + }, + HTMLElementDeprecatedTagNameMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HTMLElementDeprecatedTagNameMap', + }, + SVGElementTagNameMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SVGElementTagNameMap', + }, + ElementTagNameMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ElementTagNameMap', + }, + HeadersInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HeadersInit', + }, + BodyInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BodyInit', + }, + RequestInfo: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RequestInfo', + }, + BlobPart: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BlobPart', + }, + DOMHighResTimeStamp: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DOMHighResTimeStamp', + }, + RenderingContext: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RenderingContext', + }, + HTMLOrSVGImageElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HTMLOrSVGImageElement', + }, + CanvasImageSource: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasImageSource', + }, + OffscreenRenderingContext: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OffscreenRenderingContext', + }, + MessageEventSource: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MessageEventSource', + }, + HTMLOrSVGScriptElement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HTMLOrSVGScriptElement', + }, + ImageBitmapSource: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ImageBitmapSource', + }, + MediaProvider: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaProvider', + }, + OnErrorEventHandler: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OnErrorEventHandler', + }, + OnBeforeUnloadEventHandler: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OnBeforeUnloadEventHandler', + }, + TimerHandler: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TimerHandler', + }, + ConstrainULong: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ConstrainULong', + }, + ConstrainDouble: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ConstrainDouble', + }, + ConstrainBoolean: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ConstrainBoolean', + }, + ConstrainDOMString: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ConstrainDOMString', + }, + PerformanceEntryList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PerformanceEntryList', + }, + ReadableStreamReadResult: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadableStreamReadResult', + }, + VibratePattern: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'VibratePattern', + }, + COSEAlgorithmIdentifier: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'COSEAlgorithmIdentifier', + }, + AuthenticatorSelectionList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AuthenticatorSelectionList', + }, + AAGUID: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AAGUID', + }, + AuthenticationExtensionsSupported: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AuthenticationExtensionsSupported', + }, + UvmEntry: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'UvmEntry', + }, + UvmEntries: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'UvmEntries', + }, + AlgorithmIdentifier: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AlgorithmIdentifier', + }, + HashAlgorithmIdentifier: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HashAlgorithmIdentifier', + }, + BigInteger: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BigInteger', + }, + NamedCurve: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NamedCurve', + }, + GLenum: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GLenum', + }, + GLboolean: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GLboolean', + }, + GLbitfield: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GLbitfield', + }, + GLint: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GLint', + }, + GLsizei: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GLsizei', + }, + GLintptr: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GLintptr', + }, + GLsizeiptr: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GLsizeiptr', + }, + GLuint: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GLuint', + }, + GLfloat: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GLfloat', + }, + GLclampf: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GLclampf', + }, + TexImageSource: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TexImageSource', + }, + Float32List: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Float32List', + }, + Int32List: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Int32List', + }, + GLint64: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GLint64', + }, + GLuint64: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GLuint64', + }, + Uint32List: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint32List', + }, + BufferSource: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BufferSource', + }, + DOMTimeStamp: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DOMTimeStamp', + }, + LineAndPositionSetting: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'LineAndPositionSetting', + }, + FormDataEntryValue: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'FormDataEntryValue', + }, + InsertPosition: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'InsertPosition', + }, + IDBValidKey: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBValidKey', + }, + MutationRecordType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MutationRecordType', + }, + IDBKeyPath: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBKeyPath', + }, + Transferable: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Transferable', + }, + RTCIceGatherCandidate: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIceGatherCandidate', + }, + RTCTransport: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCTransport', + }, + MouseWheelEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MouseWheelEvent', + }, + WindowProxy: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WindowProxy', + }, + AlignSetting: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AlignSetting', + }, + AnimationPlayState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AnimationPlayState', + }, + AppendMode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AppendMode', + }, + AttestationConveyancePreference: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AttestationConveyancePreference', + }, + AudioContextLatencyCategory: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AudioContextLatencyCategory', + }, + AudioContextState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AudioContextState', + }, + AuthenticatorAttachment: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AuthenticatorAttachment', + }, + AuthenticatorTransport: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AuthenticatorTransport', + }, + AutoKeyword: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AutoKeyword', + }, + AutomationRate: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AutomationRate', + }, + BinaryType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BinaryType', + }, + BiquadFilterType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BiquadFilterType', + }, + CanPlayTypeResult: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanPlayTypeResult', + }, + CanvasDirection: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasDirection', + }, + CanvasFillRule: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasFillRule', + }, + CanvasLineCap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasLineCap', + }, + CanvasLineJoin: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasLineJoin', + }, + CanvasTextAlign: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasTextAlign', + }, + CanvasTextBaseline: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasTextBaseline', + }, + ChannelCountMode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ChannelCountMode', + }, + ChannelInterpretation: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ChannelInterpretation', + }, + ClientTypes: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ClientTypes', + }, + ColorSpaceConversion: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ColorSpaceConversion', + }, + CompositeOperation: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CompositeOperation', + }, + CompositeOperationOrAuto: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CompositeOperationOrAuto', + }, + CredentialMediationRequirement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CredentialMediationRequirement', + }, + DOMParserSupportedType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DOMParserSupportedType', + }, + DirectionSetting: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DirectionSetting', + }, + DisplayCaptureSurfaceType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DisplayCaptureSurfaceType', + }, + DistanceModelType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DistanceModelType', + }, + DocumentReadyState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DocumentReadyState', + }, + EndOfStreamError: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EndOfStreamError', + }, + EndingType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EndingType', + }, + FillMode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'FillMode', + }, + FullscreenNavigationUI: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'FullscreenNavigationUI', + }, + GamepadHand: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GamepadHand', + }, + GamepadHapticActuatorType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GamepadHapticActuatorType', + }, + GamepadMappingType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GamepadMappingType', + }, + IDBCursorDirection: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBCursorDirection', + }, + IDBRequestReadyState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBRequestReadyState', + }, + IDBTransactionMode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBTransactionMode', + }, + ImageOrientation: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ImageOrientation', + }, + ImageSmoothingQuality: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ImageSmoothingQuality', + }, + IterationCompositeOperation: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IterationCompositeOperation', + }, + KeyFormat: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'KeyFormat', + }, + KeyType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'KeyType', + }, + KeyUsage: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'KeyUsage', + }, + LineAlignSetting: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'LineAlignSetting', + }, + ListeningState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ListeningState', + }, + MSCredentialType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MSCredentialType', + }, + MSTransportType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MSTransportType', + }, + MSWebViewPermissionState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MSWebViewPermissionState', + }, + MSWebViewPermissionType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MSWebViewPermissionType', + }, + MediaDeviceKind: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaDeviceKind', + }, + MediaKeyMessageType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaKeyMessageType', + }, + MediaKeySessionType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaKeySessionType', + }, + MediaKeyStatus: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaKeyStatus', + }, + MediaKeysRequirement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaKeysRequirement', + }, + MediaStreamTrackState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MediaStreamTrackState', + }, + NavigationReason: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NavigationReason', + }, + NavigationType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NavigationType', + }, + NotificationDirection: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NotificationDirection', + }, + NotificationPermission: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NotificationPermission', + }, + OffscreenRenderingContextId: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OffscreenRenderingContextId', + }, + OrientationLockType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OrientationLockType', + }, + OrientationType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OrientationType', + }, + OscillatorType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OscillatorType', + }, + OverSampleType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OverSampleType', + }, + PanningModelType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PanningModelType', + }, + PaymentComplete: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PaymentComplete', + }, + PaymentShippingType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PaymentShippingType', + }, + PermissionName: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PermissionName', + }, + PermissionState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PermissionState', + }, + PlaybackDirection: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PlaybackDirection', + }, + PositionAlignSetting: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PositionAlignSetting', + }, + PremultiplyAlpha: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PremultiplyAlpha', + }, + PublicKeyCredentialType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PublicKeyCredentialType', + }, + PushEncryptionKeyName: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PushEncryptionKeyName', + }, + PushPermissionState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PushPermissionState', + }, + RTCBundlePolicy: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCBundlePolicy', + }, + RTCDataChannelState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCDataChannelState', + }, + RTCDegradationPreference: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCDegradationPreference', + }, + RTCDtlsRole: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCDtlsRole', + }, + RTCDtlsTransportState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCDtlsTransportState', + }, + RTCDtxStatus: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCDtxStatus', + }, + RTCErrorDetailType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCErrorDetailType', + }, + RTCIceCandidateType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIceCandidateType', + }, + RTCIceComponent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIceComponent', + }, + RTCIceConnectionState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIceConnectionState', + }, + RTCIceCredentialType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIceCredentialType', + }, + RTCIceGatherPolicy: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIceGatherPolicy', + }, + RTCIceGathererState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIceGathererState', + }, + RTCIceGatheringState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIceGatheringState', + }, + RTCIceProtocol: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIceProtocol', + }, + RTCIceRole: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIceRole', + }, + RTCIceTcpCandidateType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIceTcpCandidateType', + }, + RTCIceTransportPolicy: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIceTransportPolicy', + }, + RTCIceTransportState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCIceTransportState', + }, + RTCPeerConnectionState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCPeerConnectionState', + }, + RTCPriorityType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCPriorityType', + }, + RTCRtcpMuxPolicy: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCRtcpMuxPolicy', + }, + RTCRtpTransceiverDirection: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCRtpTransceiverDirection', + }, + RTCSctpTransportState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCSctpTransportState', + }, + RTCSdpType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCSdpType', + }, + RTCSignalingState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCSignalingState', + }, + RTCStatsIceCandidatePairState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCStatsIceCandidatePairState', + }, + RTCStatsIceCandidateType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCStatsIceCandidateType', + }, + RTCStatsType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RTCStatsType', + }, + ReadyState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadyState', + }, + ReferrerPolicy: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReferrerPolicy', + }, + RequestCache: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RequestCache', + }, + RequestCredentials: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RequestCredentials', + }, + RequestDestination: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RequestDestination', + }, + RequestMode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RequestMode', + }, + RequestRedirect: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RequestRedirect', + }, + ResizeQuality: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ResizeQuality', + }, + ResponseType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ResponseType', + }, + ScopedCredentialType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ScopedCredentialType', + }, + ScrollBehavior: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ScrollBehavior', + }, + ScrollLogicalPosition: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ScrollLogicalPosition', + }, + ScrollRestoration: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ScrollRestoration', + }, + ScrollSetting: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ScrollSetting', + }, + SelectionMode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SelectionMode', + }, + ServiceWorkerState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ServiceWorkerState', + }, + ServiceWorkerUpdateViaCache: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ServiceWorkerUpdateViaCache', + }, + ShadowRootMode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ShadowRootMode', + }, + SpeechSynthesisErrorCode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SpeechSynthesisErrorCode', + }, + TextTrackKind: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TextTrackKind', + }, + TextTrackMode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TextTrackMode', + }, + TouchType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TouchType', + }, + Transport: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Transport', + }, + UserVerificationRequirement: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'UserVerificationRequirement', + }, + VRDisplayEventReason: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'VRDisplayEventReason', + }, + VideoFacingModeEnum: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'VideoFacingModeEnum', + }, + VisibilityState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'VisibilityState', + }, + WebGLPowerPreference: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WebGLPowerPreference', + }, + WorkerType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WorkerType', + }, + XMLHttpRequestResponseType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'XMLHttpRequestResponseType', + }, +}; +//# sourceMappingURL=dom.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.js.map new file mode 100644 index 000000000..147cdfb72 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dom.js","sourceRoot":"","sources":["../../src/lib/dom.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,GAAG,GAAG;IACjB,OAAO,EAAE;QACP,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,SAAS;KAChB;IACD,uBAAuB,EAAE;QACvB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,yBAAyB;KAChC;IACD,YAAY,EAAE;QACZ,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,cAAc;KACrB;IACD,YAAY,EAAE;QACZ,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,cAAc;KACrB;IACD,mBAAmB,EAAE;QACnB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,qBAAqB;KAC5B;IACD,YAAY,EAAE;QACZ,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IA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c,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,WAAW;KAClB;IACD,SAAS,EAAE;QACT,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,WAAW;KAClB;IACD,2BAA2B,EAAE;QAC3B,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,6BAA6B;KACpC;IACD,oBAAoB,EAAE;QACpB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,sBAAsB;KAC7B;IACD,mBAAmB,EAAE;QACnB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,qBAAqB;KAC5B;IACD,eAAe,EAAE;QACf,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,iBAAiB;KACxB;IACD,oBAAoB,EAAE;QACpB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,sBAAsB;KAC7B;IACD,UAAU,EAAE;QACV,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,YAAY;KACnB;IACD,0BAA0B,EAAE;QAC1B,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,4BAA4B;KACnC;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.d.ts new file mode 100644 index 000000000..7d16c6c91 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2015_collection: Record; +//# sourceMappingURL=es2015.collection.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.d.ts.map new file mode 100644 index 000000000..88c3754f4 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.collection.d.ts","sourceRoot":"","sources":["../../src/lib/es2015.collection.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,iBAAiB,4CA6DiB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.js new file mode 100644 index 000000000..cf4b8951e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.js @@ -0,0 +1,69 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_collection = void 0; +exports.es2015_collection = { + Map: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Map', + }, + MapConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MapConstructor', + }, + ReadonlyMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadonlyMap', + }, + WeakMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WeakMap', + }, + WeakMapConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WeakMapConstructor', + }, + Set: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Set', + }, + SetConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SetConstructor', + }, + ReadonlySet: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadonlySet', + }, + WeakSet: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WeakSet', + }, + WeakSetConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WeakSetConstructor', + }, +}; +//# sourceMappingURL=es2015.collection.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.js.map new file mode 100644 index 000000000..388b6d0e6 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.collection.js","sourceRoot":"","sources":["../../src/lib/es2015.collection.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,iBAAiB,GAAG;IAC/B,GAAG,EAAE;QACH,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE,KAAK;KACZ;IACD,cAAc,EAAE;QACd,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,gBAAgB;KACvB;IACD,WAAW,EAAE;QACX,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,aAAa;KACpB;IACD,OAAO,EAAE;QACP,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE,SAAS;KAChB;IACD,kBAAkB,EAAE;QAClB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,oBAAoB;KAC3B;IACD,GAAG,EAAE;QACH,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE,KAAK;KACZ;IACD,cAAc,EAAE;QACd,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,gBAAgB;KACvB;IACD,WAAW,EAAE;QACX,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,aAAa;KACpB;IACD,OAAO,EAAE;QACP,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE,SAAS;KAChB;IACD,kBAAkB,EAAE;QAClB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,oBAAoB;KAC3B;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.d.ts new file mode 100644 index 000000000..f07145e05 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2015_core: Record; +//# sourceMappingURL=es2015.core.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.d.ts.map new file mode 100644 index 000000000..5d53767e5 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.core.d.ts","sourceRoot":"","sources":["../../src/lib/es2015.core.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,WAAW,4CAyEuB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.js new file mode 100644 index 000000000..ce70b37c2 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.js @@ -0,0 +1,81 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_core = void 0; +exports.es2015_core = { + Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Array', + }, + ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ArrayConstructor', + }, + DateConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DateConstructor', + }, + Function: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Function', + }, + Math: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Math', + }, + NumberConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NumberConstructor', + }, + ObjectConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ObjectConstructor', + }, + ReadonlyArray: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadonlyArray', + }, + RegExp: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RegExp', + }, + RegExpConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RegExpConstructor', + }, + String: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'String', + }, + StringConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'StringConstructor', + }, +}; +//# sourceMappingURL=es2015.core.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.js.map new file mode 100644 index 000000000..76a05087f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.core.js","sourceRoot":"","sources":["../../src/lib/es2015.core.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,WAAW,GAAG;IACzB,KAAK,EAAE;QACL,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,OAAO;KACd;IACD,gBAAgB,EAAE;QAChB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,kBAAkB;KACzB;IACD,eAAe,EAAE;QACf,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,iBAAiB;KACxB;IACD,QAAQ,EAAE;QACR,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,UAAU;KACjB;IACD,IAAI,EAAE;QACJ,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,MAAM;KACb;IACD,iBAAiB,EAAE;QACjB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,mBAAmB;KAC1B;IACD,iBAAiB,EAAE;QACjB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,mBAAmB;KAC1B;IACD,aAAa,EAAE;QACb,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,eAAe;KACtB;IACD,MAAM,EAAE;QACN,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,QAAQ;KACf;IACD,iBAAiB,EAAE;QACjB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,mBAAmB;KAC1B;IACD,MAAM,EAAE;QACN,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,QAAQ;KACf;IACD,iBAAiB,EAAE;QACjB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,mBAAmB;KAC1B;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.d.ts new file mode 100644 index 000000000..d296ffed6 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2015: Record; +//# sourceMappingURL=es2015.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.d.ts.map new file mode 100644 index 000000000..5eebd55d6 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.d.ts","sourceRoot":"","sources":["../../src/lib/es2015.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAYzD,eAAO,MAAM,MAAM,4CAW4B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.d.ts new file mode 100644 index 000000000..90080d8c0 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2015_generator: Record; +//# sourceMappingURL=es2015.generator.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.d.ts.map new file mode 100644 index 000000000..fdb649330 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.generator.d.ts","sourceRoot":"","sources":["../../src/lib/es2015.generator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAGzD,eAAO,MAAM,gBAAgB,4CAoBkB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.js new file mode 100644 index 000000000..5600c3347 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_generator = void 0; +const es2015_iterable_1 = require("./es2015.iterable"); +exports.es2015_generator = Object.assign(Object.assign({}, es2015_iterable_1.es2015_iterable), { Generator: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Generator', + }, GeneratorFunction: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GeneratorFunction', + }, GeneratorFunctionConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GeneratorFunctionConstructor', + } }); +//# sourceMappingURL=es2015.generator.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.js.map new file mode 100644 index 000000000..80048e13b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.generator.js","sourceRoot":"","sources":["../../src/lib/es2015.generator.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,uDAAoD;AAEvC,QAAA,gBAAgB,GAAG,gCAC3B,iCAAe,KAClB,SAAS,EAAE;QACT,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,WAAW;KAClB,EACD,iBAAiB,EAAE;QACjB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,mBAAmB;KAC1B,EACD,4BAA4B,EAAE;QAC5B,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,8BAA8B;KACrC,GAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.d.ts new file mode 100644 index 000000000..c2ff28a50 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2015_iterable: Record; +//# sourceMappingURL=es2015.iterable.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.d.ts.map new file mode 100644 index 000000000..583cb28b4 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.iterable.d.ts","sourceRoot":"","sources":["../../src/lib/es2015.iterable.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAGzD,eAAO,MAAM,eAAe,4CAoQmB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.js new file mode 100644 index 000000000..28b02e905 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.js @@ -0,0 +1,224 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_iterable = void 0; +const es2015_symbol_1 = require("./es2015.symbol"); +exports.es2015_iterable = Object.assign(Object.assign({}, es2015_symbol_1.es2015_symbol), { SymbolConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SymbolConstructor', + }, IteratorYieldResult: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IteratorYieldResult', + }, IteratorReturnResult: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IteratorReturnResult', + }, IteratorResult: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IteratorResult', + }, Iterator: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Iterator', + }, Iterable: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Iterable', + }, IterableIterator: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IterableIterator', + }, Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Array', + }, ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ArrayConstructor', + }, ReadonlyArray: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadonlyArray', + }, IArguments: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IArguments', + }, Map: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Map', + }, ReadonlyMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadonlyMap', + }, MapConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MapConstructor', + }, WeakMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WeakMap', + }, WeakMapConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WeakMapConstructor', + }, Set: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Set', + }, ReadonlySet: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadonlySet', + }, SetConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SetConstructor', + }, WeakSet: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WeakSet', + }, WeakSetConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WeakSetConstructor', + }, Promise: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Promise', + }, PromiseConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PromiseConstructor', + }, Reflect: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Reflect', + }, String: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'String', + }, Int8Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Int8Array', + }, Int8ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Int8ArrayConstructor', + }, Uint8Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint8Array', + }, Uint8ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint8ArrayConstructor', + }, Uint8ClampedArray: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint8ClampedArray', + }, Uint8ClampedArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint8ClampedArrayConstructor', + }, Int16Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Int16Array', + }, Int16ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Int16ArrayConstructor', + }, Uint16Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint16Array', + }, Uint16ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint16ArrayConstructor', + }, Int32Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Int32Array', + }, Int32ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Int32ArrayConstructor', + }, Uint32Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint32Array', + }, Uint32ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint32ArrayConstructor', + }, Float32Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Float32Array', + }, Float32ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Float32ArrayConstructor', + }, Float64Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Float64Array', + }, Float64ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Float64ArrayConstructor', + } }); +//# sourceMappingURL=es2015.iterable.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.js.map new file mode 100644 index 000000000..a674421cd --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.iterable.js","sourceRoot":"","sources":["../../src/lib/es2015.iterable.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,mDAAgD;AAEnC,QAAA,eAAe,GAAG,gCAC1B,6BAAa,KAChB,iBAAiB,EAAE;QACjB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,mBAAmB;KAC1B,EACD,mBAAmB,EAAE;QACnB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,qBAAqB;KAC5B,EACD,oBAAoB,EAAE;QACpB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,sBAAsB;KAC7B,EACD,cAAc,EAAE;QACd,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,gBAAgB;KACvB,EACD,QAAQ,EAAE;QACR,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,UAAU;KACjB,EACD,QAAQ,EAAE;QACR,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,UAAU;KACjB,EACD,gBAAgB,EAAE;QAChB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,kBAAkB;KACzB,EACD,KAAK,EAAE;QACL,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,OA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ACpB,EACD,sBAAsB,EAAE;QACtB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,wBAAwB;KAC/B,EACD,YAAY,EAAE;QACZ,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,cAAc;KACrB,EACD,uBAAuB,EAAE;QACvB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,yBAAyB;KAChC,EACD,YAAY,EAAE;QACZ,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,cAAc;KACrB,EACD,uBAAuB,EAAE;QACvB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,yBAAyB;KAChC,GAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.js new file mode 100644 index 000000000..de74ee26d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.js @@ -0,0 +1,18 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015 = void 0; +const es5_1 = require("./es5"); +const es2015_core_1 = require("./es2015.core"); +const es2015_collection_1 = require("./es2015.collection"); +const es2015_iterable_1 = require("./es2015.iterable"); +const es2015_generator_1 = require("./es2015.generator"); +const es2015_promise_1 = require("./es2015.promise"); +const es2015_proxy_1 = require("./es2015.proxy"); +const es2015_reflect_1 = require("./es2015.reflect"); +const es2015_symbol_1 = require("./es2015.symbol"); +const es2015_symbol_wellknown_1 = require("./es2015.symbol.wellknown"); +exports.es2015 = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, es5_1.es5), es2015_core_1.es2015_core), es2015_collection_1.es2015_collection), es2015_iterable_1.es2015_iterable), es2015_generator_1.es2015_generator), es2015_promise_1.es2015_promise), es2015_proxy_1.es2015_proxy), es2015_reflect_1.es2015_reflect), es2015_symbol_1.es2015_symbol), es2015_symbol_wellknown_1.es2015_symbol_wellknown); +//# sourceMappingURL=es2015.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.js.map new file mode 100644 index 000000000..968635e83 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.js","sourceRoot":"","sources":["../../src/lib/es2015.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,+BAA4B;AAC5B,+CAA4C;AAC5C,2DAAwD;AACxD,uDAAoD;AACpD,yDAAsD;AACtD,qDAAkD;AAClD,iDAA8C;AAC9C,qDAAkD;AAClD,mDAAgD;AAChD,uEAAoE;AAEvD,QAAA,MAAM,GAAG,gJACjB,SAAG,GACH,yBAAW,GACX,qCAAiB,GACjB,iCAAe,GACf,mCAAgB,GAChB,+BAAc,GACd,2BAAY,GACZ,+BAAc,GACd,6BAAa,GACb,iDAAuB,CACmB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.d.ts new file mode 100644 index 000000000..f52ceb382 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2015_promise: Record; +//# sourceMappingURL=es2015.promise.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.d.ts.map new file mode 100644 index 000000000..ed845312a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.promise.d.ts","sourceRoot":"","sources":["../../src/lib/es2015.promise.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,cAAc,4CAOoB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.js new file mode 100644 index 000000000..ed607da82 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_promise = void 0; +exports.es2015_promise = { + PromiseConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PromiseConstructor', + }, +}; +//# sourceMappingURL=es2015.promise.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.js.map new file mode 100644 index 000000000..d5f255ee2 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.promise.js","sourceRoot":"","sources":["../../src/lib/es2015.promise.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,cAAc,GAAG;IAC5B,kBAAkB,EAAE;QAClB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,oBAAoB;KAC3B;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.d.ts new file mode 100644 index 000000000..503eab04d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2015_proxy: Record; +//# sourceMappingURL=es2015.proxy.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.d.ts.map new file mode 100644 index 000000000..c93307e88 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.proxy.d.ts","sourceRoot":"","sources":["../../src/lib/es2015.proxy.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,YAAY,4CAasB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.js new file mode 100644 index 000000000..f74d7315b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.js @@ -0,0 +1,21 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_proxy = void 0; +exports.es2015_proxy = { + ProxyHandler: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ProxyHandler', + }, + ProxyConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ProxyConstructor', + }, +}; +//# sourceMappingURL=es2015.proxy.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.js.map new file mode 100644 index 000000000..4b8876aba --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.proxy.js","sourceRoot":"","sources":["../../src/lib/es2015.proxy.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,YAAY,GAAG;IAC1B,YAAY,EAAE;QACZ,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,cAAc;KACrB;IACD,gBAAgB,EAAE;QAChB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,kBAAkB;KACzB;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.d.ts new file mode 100644 index 000000000..3f3b7018a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2015_reflect: Record; +//# sourceMappingURL=es2015.reflect.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.d.ts.map new file mode 100644 index 000000000..730708a28 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.reflect.d.ts","sourceRoot":"","sources":["../../src/lib/es2015.reflect.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,cAAc,4CAOoB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.js new file mode 100644 index 000000000..d149f07c5 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_reflect = void 0; +exports.es2015_reflect = { + Reflect: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Reflect', + }, +}; +//# sourceMappingURL=es2015.reflect.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.js.map new file mode 100644 index 000000000..770a7708b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.reflect.js","sourceRoot":"","sources":["../../src/lib/es2015.reflect.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,cAAc,GAAG;IAC5B,OAAO,EAAE;QACP,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE,SAAS;KAChB;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.d.ts new file mode 100644 index 000000000..fa3012345 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2015_symbol: Record; +//# sourceMappingURL=es2015.symbol.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.d.ts.map new file mode 100644 index 000000000..e64431f0c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.symbol.d.ts","sourceRoot":"","sources":["../../src/lib/es2015.symbol.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,aAAa,4CAOqB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.js new file mode 100644 index 000000000..e7a3fd43e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_symbol = void 0; +exports.es2015_symbol = { + SymbolConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SymbolConstructor', + }, +}; +//# sourceMappingURL=es2015.symbol.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.js.map new file mode 100644 index 000000000..97e8384d4 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.symbol.js","sourceRoot":"","sources":["../../src/lib/es2015.symbol.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,aAAa,GAAG;IAC3B,iBAAiB,EAAE;QACjB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,mBAAmB;KAC1B;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.d.ts new file mode 100644 index 000000000..852896d5f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2015_symbol_wellknown: Record; +//# sourceMappingURL=es2015.symbol.wellknown.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.d.ts.map new file mode 100644 index 000000000..4aa79bab3 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.symbol.wellknown.d.ts","sourceRoot":"","sources":["../../src/lib/es2015.symbol.wellknown.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAGzD,eAAO,MAAM,uBAAuB,4CAkMW,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.js new file mode 100644 index 000000000..7c12d5f36 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.js @@ -0,0 +1,169 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_symbol_wellknown = void 0; +const es2015_symbol_1 = require("./es2015.symbol"); +exports.es2015_symbol_wellknown = Object.assign(Object.assign({}, es2015_symbol_1.es2015_symbol), { SymbolConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SymbolConstructor', + }, Symbol: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Symbol', + }, Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Array', + }, Date: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Date', + }, Map: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Map', + }, WeakMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WeakMap', + }, Set: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Set', + }, WeakSet: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WeakSet', + }, JSON: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'JSON', + }, Function: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Function', + }, GeneratorFunction: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GeneratorFunction', + }, Math: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Math', + }, Promise: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Promise', + }, PromiseConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PromiseConstructor', + }, RegExp: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RegExp', + }, RegExpConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RegExpConstructor', + }, String: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'String', + }, ArrayBuffer: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ArrayBuffer', + }, DataView: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DataView', + }, Int8Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Int8Array', + }, Uint8Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint8Array', + }, Uint8ClampedArray: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint8ClampedArray', + }, Int16Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Int16Array', + }, Uint16Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint16Array', + }, Int32Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Int32Array', + }, Uint32Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint32Array', + }, Float32Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Float32Array', + }, Float64Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Float64Array', + }, ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ArrayConstructor', + }, MapConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MapConstructor', + }, SetConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SetConstructor', + }, ArrayBufferConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ArrayBufferConstructor', + } }); +//# sourceMappingURL=es2015.symbol.wellknown.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.js.map new file mode 100644 index 000000000..55f628c72 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2015.symbol.wellknown.js","sourceRoot":"","sources":["../../src/lib/es2015.symbol.wellknown.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,mDAAgD;AAEnC,QAAA,uBAAuB,GAAG,gCAClC,6BAAa,KAChB,iBAAiB,EAAE;QACjB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,mBAAmB;KAC1B,EACD,MAAM,EAAE;QACN,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,QAAQ;KACf,EACD,KAAK,EAAE;QACL,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAA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AE;QACX,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,aAAa;KACpB,EACD,UAAU,EAAE;QACV,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,YAAY;KACnB,EACD,WAAW,EAAE;QACX,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,aAAa;KACpB,EACD,YAAY,EAAE;QACZ,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,cAAc;KACrB,EACD,YAAY,EAAE;QACZ,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,cAAc;KACrB,EACD,gBAAgB,EAAE;QAChB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,kBAAkB;KACzB,EACD,cAAc,EAAE;QACd,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,gBAAgB;KACvB,EACD,cAAc,EAAE;QACd,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,gBAAgB;KACvB,EACD,sBAAsB,EAAE;QACtB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,wBAAwB;KAC/B,GAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.d.ts new file mode 100644 index 000000000..c0ffb1b9e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2016_array_include: Record; +//# sourceMappingURL=es2016.array.include.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.d.ts.map new file mode 100644 index 000000000..fc357c38c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2016.array.include.d.ts","sourceRoot":"","sources":["../../src/lib/es2016.array.include.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,oBAAoB,4CAmEc,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.js new file mode 100644 index 000000000..6b67414b5 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.js @@ -0,0 +1,75 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2016_array_include = void 0; +exports.es2016_array_include = { + Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Array', + }, + ReadonlyArray: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadonlyArray', + }, + Int8Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Int8Array', + }, + Uint8Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint8Array', + }, + Uint8ClampedArray: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint8ClampedArray', + }, + Int16Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Int16Array', + }, + Uint16Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint16Array', + }, + Int32Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Int32Array', + }, + Uint32Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint32Array', + }, + Float32Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Float32Array', + }, + Float64Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Float64Array', + }, +}; +//# sourceMappingURL=es2016.array.include.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.js.map new file mode 100644 index 000000000..458d3ec5c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2016.array.include.js","sourceRoot":"","sources":["../../src/lib/es2016.array.include.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,oBAAoB,GAAG;IAClC,KAAK,EAAE;QACL,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,OAAO;KACd;IACD,aAAa,EAAE;QACb,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,eAAe;KACtB;IACD,SAAS,EAAE;QACT,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,WAAW;KAClB;IACD,UAAU,EAAE;QACV,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,YAAY;KACnB;IACD,iBAAiB,EAAE;QACjB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,mBAAmB;KAC1B;IACD,UAAU,EAAE;QACV,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,YAAY;KACnB;IACD,WAAW,EAAE;QACX,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,aAAa;KACpB;IACD,UAAU,EAAE;QACV,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,YAAY;KACnB;IACD,WAAW,EAAE;QACX,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,aAAa;KACpB;IACD,YAAY,EAAE;QACZ,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,cAAc;KACrB;IACD,YAAY,EAAE;QACZ,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,cAAc;KACrB;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.d.ts new file mode 100644 index 000000000..7d33b4225 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2016: Record; +//# sourceMappingURL=es2016.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.d.ts.map new file mode 100644 index 000000000..57e9e9abe --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2016.d.ts","sourceRoot":"","sources":["../../src/lib/es2016.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAIzD,eAAO,MAAM,MAAM,4CAG4B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.d.ts new file mode 100644 index 000000000..6d10510ad --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2016_full: Record; +//# sourceMappingURL=es2016.full.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.d.ts.map new file mode 100644 index 000000000..e2b011c78 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2016.full.d.ts","sourceRoot":"","sources":["../../src/lib/es2016.full.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAOzD,eAAO,MAAM,WAAW,4CAMuB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.js new file mode 100644 index 000000000..6fa1b85c9 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.js @@ -0,0 +1,13 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2016_full = void 0; +const es2016_1 = require("./es2016"); +const dom_1 = require("./dom"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +const scripthost_1 = require("./scripthost"); +const dom_iterable_1 = require("./dom.iterable"); +exports.es2016_full = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, es2016_1.es2016), dom_1.dom), webworker_importscripts_1.webworker_importscripts), scripthost_1.scripthost), dom_iterable_1.dom_iterable); +//# sourceMappingURL=es2016.full.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.js.map new file mode 100644 index 000000000..32bff4157 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2016.full.js","sourceRoot":"","sources":["../../src/lib/es2016.full.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,qCAAkC;AAClC,+BAA4B;AAC5B,uEAAoE;AACpE,6CAA0C;AAC1C,iDAA8C;AAEjC,QAAA,WAAW,GAAG,0EACtB,eAAM,GACN,SAAG,GACH,iDAAuB,GACvB,uBAAU,GACV,2BAAY,CAC8B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.js new file mode 100644 index 000000000..e60a35a77 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.js @@ -0,0 +1,10 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2016 = void 0; +const es2015_1 = require("./es2015"); +const es2016_array_include_1 = require("./es2016.array.include"); +exports.es2016 = Object.assign(Object.assign({}, es2015_1.es2015), es2016_array_include_1.es2016_array_include); +//# sourceMappingURL=es2016.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.js.map new file mode 100644 index 000000000..d7dce2041 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2016.js","sourceRoot":"","sources":["../../src/lib/es2016.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,qCAAkC;AAClC,iEAA8D;AAEjD,QAAA,MAAM,GAAG,gCACjB,eAAM,GACN,2CAAoB,CACsB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.d.ts new file mode 100644 index 000000000..fa8737b9d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2017: Record; +//# sourceMappingURL=es2017.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.d.ts.map new file mode 100644 index 000000000..a9c615fe3 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2017.d.ts","sourceRoot":"","sources":["../../src/lib/es2017.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAQzD,eAAO,MAAM,MAAM,4CAO4B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.d.ts new file mode 100644 index 000000000..d461e8989 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2017_full: Record; +//# sourceMappingURL=es2017.full.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.d.ts.map new file mode 100644 index 000000000..40214b79e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2017.full.d.ts","sourceRoot":"","sources":["../../src/lib/es2017.full.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAOzD,eAAO,MAAM,WAAW,4CAMuB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.js new file mode 100644 index 000000000..9cefd9659 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.js @@ -0,0 +1,13 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017_full = void 0; +const es2017_1 = require("./es2017"); +const dom_1 = require("./dom"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +const scripthost_1 = require("./scripthost"); +const dom_iterable_1 = require("./dom.iterable"); +exports.es2017_full = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, es2017_1.es2017), dom_1.dom), webworker_importscripts_1.webworker_importscripts), scripthost_1.scripthost), dom_iterable_1.dom_iterable); +//# sourceMappingURL=es2017.full.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.js.map new file mode 100644 index 000000000..430ad0d3c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2017.full.js","sourceRoot":"","sources":["../../src/lib/es2017.full.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,qCAAkC;AAClC,+BAA4B;AAC5B,uEAAoE;AACpE,6CAA0C;AAC1C,iDAA8C;AAEjC,QAAA,WAAW,GAAG,0EACtB,eAAM,GACN,SAAG,GACH,iDAAuB,GACvB,uBAAU,GACV,2BAAY,CAC8B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.d.ts new file mode 100644 index 000000000..14e4a8537 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2017_intl: Record; +//# sourceMappingURL=es2017.intl.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.d.ts.map new file mode 100644 index 000000000..acd44df10 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2017.intl.d.ts","sourceRoot":"","sources":["../../src/lib/es2017.intl.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,WAAW,4CAOuB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.js new file mode 100644 index 000000000..27f2dfa0d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017_intl = void 0; +exports.es2017_intl = { + Intl: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Intl', + }, +}; +//# sourceMappingURL=es2017.intl.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.js.map new file mode 100644 index 000000000..8c277bb1a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2017.intl.js","sourceRoot":"","sources":["../../src/lib/es2017.intl.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,WAAW,GAAG;IACzB,IAAI,EAAE;QACJ,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE,MAAM;KACb;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.js new file mode 100644 index 000000000..3c39cb393 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.js @@ -0,0 +1,14 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017 = void 0; +const es2016_1 = require("./es2016"); +const es2017_object_1 = require("./es2017.object"); +const es2017_sharedmemory_1 = require("./es2017.sharedmemory"); +const es2017_string_1 = require("./es2017.string"); +const es2017_intl_1 = require("./es2017.intl"); +const es2017_typedarrays_1 = require("./es2017.typedarrays"); +exports.es2017 = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, es2016_1.es2016), es2017_object_1.es2017_object), es2017_sharedmemory_1.es2017_sharedmemory), es2017_string_1.es2017_string), es2017_intl_1.es2017_intl), es2017_typedarrays_1.es2017_typedarrays); +//# sourceMappingURL=es2017.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.js.map new file mode 100644 index 000000000..1b6769cd6 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2017.js","sourceRoot":"","sources":["../../src/lib/es2017.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,qCAAkC;AAClC,mDAAgD;AAChD,+DAA4D;AAC5D,mDAAgD;AAChD,+CAA4C;AAC5C,6DAA0D;AAE7C,QAAA,MAAM,GAAG,wFACjB,eAAM,GACN,6BAAa,GACb,yCAAmB,GACnB,6BAAa,GACb,yBAAW,GACX,uCAAkB,CACwB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.d.ts new file mode 100644 index 000000000..ce6b72355 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2017_object: Record; +//# sourceMappingURL=es2017.object.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.d.ts.map new file mode 100644 index 000000000..a0b40ce60 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2017.object.d.ts","sourceRoot":"","sources":["../../src/lib/es2017.object.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,aAAa,4CAOqB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.js new file mode 100644 index 000000000..c8fd03ac7 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017_object = void 0; +exports.es2017_object = { + ObjectConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ObjectConstructor', + }, +}; +//# sourceMappingURL=es2017.object.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.js.map new file mode 100644 index 000000000..a248d3cd7 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2017.object.js","sourceRoot":"","sources":["../../src/lib/es2017.object.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,aAAa,GAAG;IAC3B,iBAAiB,EAAE;QACjB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,mBAAmB;KAC1B;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.d.ts new file mode 100644 index 000000000..b5ea8e421 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2017_sharedmemory: Record; +//# sourceMappingURL=es2017.sharedmemory.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.d.ts.map new file mode 100644 index 000000000..920157f9b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2017.sharedmemory.d.ts","sourceRoot":"","sources":["../../src/lib/es2017.sharedmemory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAIzD,eAAO,MAAM,mBAAmB,4CA2Be,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.js new file mode 100644 index 000000000..5f2f1b276 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.js @@ -0,0 +1,30 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017_sharedmemory = void 0; +const es2015_symbol_1 = require("./es2015.symbol"); +const es2015_symbol_wellknown_1 = require("./es2015.symbol.wellknown"); +exports.es2017_sharedmemory = Object.assign(Object.assign(Object.assign({}, es2015_symbol_1.es2015_symbol), es2015_symbol_wellknown_1.es2015_symbol_wellknown), { SharedArrayBuffer: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SharedArrayBuffer', + }, SharedArrayBufferConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SharedArrayBufferConstructor', + }, ArrayBufferTypes: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ArrayBufferTypes', + }, Atomics: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Atomics', + } }); +//# sourceMappingURL=es2017.sharedmemory.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.js.map new file mode 100644 index 000000000..58d86ca06 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2017.sharedmemory.js","sourceRoot":"","sources":["../../src/lib/es2017.sharedmemory.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,mDAAgD;AAChD,uEAAoE;AAEvD,QAAA,mBAAmB,GAAG,8CAC9B,6BAAa,GACb,iDAAuB,KAC1B,iBAAiB,EAAE;QACjB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE,mBAAmB;KAC1B,EACD,4BAA4B,EAAE;QAC5B,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,8BAA8B;KACrC,EACD,gBAAgB,EAAE;QAChB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,kBAAkB;KACzB,EACD,OAAO,EAAE;QACP,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE,SAAS;KAChB,GAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.d.ts new file mode 100644 index 000000000..d666da6b7 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2017_string: Record; +//# sourceMappingURL=es2017.string.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.d.ts.map new file mode 100644 index 000000000..c141c9b61 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2017.string.d.ts","sourceRoot":"","sources":["../../src/lib/es2017.string.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,aAAa,4CAOqB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.js new file mode 100644 index 000000000..51d9181ac --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017_string = void 0; +exports.es2017_string = { + String: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'String', + }, +}; +//# sourceMappingURL=es2017.string.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.js.map new file mode 100644 index 000000000..f536a801f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2017.string.js","sourceRoot":"","sources":["../../src/lib/es2017.string.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,aAAa,GAAG;IAC3B,MAAM,EAAE;QACN,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,QAAQ;KACf;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.d.ts new file mode 100644 index 000000000..c62bf4da3 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2017_typedarrays: Record; +//# sourceMappingURL=es2017.typedarrays.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.d.ts.map new file mode 100644 index 000000000..a5fdfc356 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2017.typedarrays.d.ts","sourceRoot":"","sources":["../../src/lib/es2017.typedarrays.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,kBAAkB,4CAuDgB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.js new file mode 100644 index 000000000..ef4cee5a5 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.js @@ -0,0 +1,63 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017_typedarrays = void 0; +exports.es2017_typedarrays = { + Int8ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Int8ArrayConstructor', + }, + Uint8ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint8ArrayConstructor', + }, + Uint8ClampedArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint8ClampedArrayConstructor', + }, + Int16ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Int16ArrayConstructor', + }, + Uint16ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint16ArrayConstructor', + }, + Int32ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Int32ArrayConstructor', + }, + Uint32ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint32ArrayConstructor', + }, + Float32ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Float32ArrayConstructor', + }, + Float64ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Float64ArrayConstructor', + }, +}; +//# sourceMappingURL=es2017.typedarrays.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.js.map new file mode 100644 index 000000000..448b55284 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2017.typedarrays.js","sourceRoot":"","sources":["../../src/lib/es2017.typedarrays.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,kBAAkB,GAAG;IAChC,oBAAoB,EAAE;QACpB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,sBAAsB;KAC7B;IACD,qBAAqB,EAAE;QACrB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,uBAAuB;KAC9B;IACD,4BAA4B,EAAE;QAC5B,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,8BAA8B;KACrC;IACD,qBAAqB,EAAE;QACrB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,uBAAuB;KAC9B;IACD,sBAAsB,EAAE;QACtB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,wBAAwB;KAC/B;IACD,qBAAqB,EAAE;QACrB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,uBAAuB;KAC9B;IACD,sBAAsB,EAAE;QACtB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,wBAAwB;KAC/B;IACD,uBAAuB,EAAE;QACvB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,yBAAyB;KAChC;IACD,uBAAuB,EAAE;QACvB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,yBAAyB;KAChC;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.d.ts new file mode 100644 index 000000000..a62d132f6 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2018_asyncgenerator: Record; +//# sourceMappingURL=es2018.asyncgenerator.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.d.ts.map new file mode 100644 index 000000000..66d72e455 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2018.asyncgenerator.d.ts","sourceRoot":"","sources":["../../src/lib/es2018.asyncgenerator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAGzD,eAAO,MAAM,qBAAqB,4CAoBa,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.js new file mode 100644 index 000000000..8d58ab5e9 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2018_asyncgenerator = void 0; +const es2018_asynciterable_1 = require("./es2018.asynciterable"); +exports.es2018_asyncgenerator = Object.assign(Object.assign({}, es2018_asynciterable_1.es2018_asynciterable), { AsyncGenerator: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AsyncGenerator', + }, AsyncGeneratorFunction: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AsyncGeneratorFunction', + }, AsyncGeneratorFunctionConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AsyncGeneratorFunctionConstructor', + } }); +//# sourceMappingURL=es2018.asyncgenerator.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.js.map new file mode 100644 index 000000000..992b7c929 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2018.asyncgenerator.js","sourceRoot":"","sources":["../../src/lib/es2018.asyncgenerator.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,iEAA8D;AAEjD,QAAA,qBAAqB,GAAG,gCAChC,2CAAoB,KACvB,cAAc,EAAE;QACd,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,gBAAgB;KACvB,EACD,sBAAsB,EAAE;QACtB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,wBAAwB;KAC/B,EACD,iCAAiC,EAAE;QACjC,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,mCAAmC;KAC1C,GAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.d.ts new file mode 100644 index 000000000..fe7dd494f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2018_asynciterable: Record; +//# sourceMappingURL=es2018.asynciterable.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.d.ts.map new file mode 100644 index 000000000..b8d5be53f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2018.asynciterable.d.ts","sourceRoot":"","sources":["../../src/lib/es2018.asynciterable.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAIzD,eAAO,MAAM,oBAAoB,4CA2Bc,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.js new file mode 100644 index 000000000..fafa6bb7c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.js @@ -0,0 +1,30 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2018_asynciterable = void 0; +const es2015_symbol_1 = require("./es2015.symbol"); +const es2015_iterable_1 = require("./es2015.iterable"); +exports.es2018_asynciterable = Object.assign(Object.assign(Object.assign({}, es2015_symbol_1.es2015_symbol), es2015_iterable_1.es2015_iterable), { SymbolConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SymbolConstructor', + }, AsyncIterator: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AsyncIterator', + }, AsyncIterable: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AsyncIterable', + }, AsyncIterableIterator: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AsyncIterableIterator', + } }); +//# sourceMappingURL=es2018.asynciterable.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.js.map new file mode 100644 index 000000000..361aa69dd --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2018.asynciterable.js","sourceRoot":"","sources":["../../src/lib/es2018.asynciterable.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,mDAAgD;AAChD,uDAAoD;AAEvC,QAAA,oBAAoB,GAAG,8CAC/B,6BAAa,GACb,iCAAe,KAClB,iBAAiB,EAAE;QACjB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,mBAAmB;KAC1B,EACD,aAAa,EAAE;QACb,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,eAAe;KACtB,EACD,aAAa,EAAE;QACb,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,eAAe;KACtB,EACD,qBAAqB,EAAE;QACrB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,uBAAuB;KAC9B,GAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.d.ts new file mode 100644 index 000000000..bee2f0a88 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2018: Record; +//# sourceMappingURL=es2018.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.d.ts.map new file mode 100644 index 000000000..e8155f85f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2018.d.ts","sourceRoot":"","sources":["../../src/lib/es2018.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAQzD,eAAO,MAAM,MAAM,4CAO4B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.d.ts new file mode 100644 index 000000000..11cc00c77 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2018_full: Record; +//# sourceMappingURL=es2018.full.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.d.ts.map new file mode 100644 index 000000000..db6b3f0b8 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2018.full.d.ts","sourceRoot":"","sources":["../../src/lib/es2018.full.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAOzD,eAAO,MAAM,WAAW,4CAMuB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.js new file mode 100644 index 000000000..039b35bc6 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.js @@ -0,0 +1,13 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2018_full = void 0; +const es2018_1 = require("./es2018"); +const dom_1 = require("./dom"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +const scripthost_1 = require("./scripthost"); +const dom_iterable_1 = require("./dom.iterable"); +exports.es2018_full = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, es2018_1.es2018), dom_1.dom), webworker_importscripts_1.webworker_importscripts), scripthost_1.scripthost), dom_iterable_1.dom_iterable); +//# sourceMappingURL=es2018.full.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.js.map new file mode 100644 index 000000000..56b1f4e2f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2018.full.js","sourceRoot":"","sources":["../../src/lib/es2018.full.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,qCAAkC;AAClC,+BAA4B;AAC5B,uEAAoE;AACpE,6CAA0C;AAC1C,iDAA8C;AAEjC,QAAA,WAAW,GAAG,0EACtB,eAAM,GACN,SAAG,GACH,iDAAuB,GACvB,uBAAU,GACV,2BAAY,CAC8B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.d.ts new file mode 100644 index 000000000..d262e6ef2 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2018_intl: Record; +//# sourceMappingURL=es2018.intl.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.d.ts.map new file mode 100644 index 000000000..19b35f0a4 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2018.intl.d.ts","sourceRoot":"","sources":["../../src/lib/es2018.intl.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,WAAW,4CAOuB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.js new file mode 100644 index 000000000..769ed3583 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2018_intl = void 0; +exports.es2018_intl = { + Intl: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Intl', + }, +}; +//# sourceMappingURL=es2018.intl.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.js.map new file mode 100644 index 000000000..baec0edec --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2018.intl.js","sourceRoot":"","sources":["../../src/lib/es2018.intl.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,WAAW,GAAG;IACzB,IAAI,EAAE;QACJ,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE,MAAM;KACb;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.js new file mode 100644 index 000000000..8c7883927 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.js @@ -0,0 +1,14 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2018 = void 0; +const es2017_1 = require("./es2017"); +const es2018_asynciterable_1 = require("./es2018.asynciterable"); +const es2018_asyncgenerator_1 = require("./es2018.asyncgenerator"); +const es2018_promise_1 = require("./es2018.promise"); +const es2018_regexp_1 = require("./es2018.regexp"); +const es2018_intl_1 = require("./es2018.intl"); +exports.es2018 = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, es2017_1.es2017), es2018_asynciterable_1.es2018_asynciterable), es2018_asyncgenerator_1.es2018_asyncgenerator), es2018_promise_1.es2018_promise), es2018_regexp_1.es2018_regexp), es2018_intl_1.es2018_intl); +//# sourceMappingURL=es2018.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.js.map new file mode 100644 index 000000000..247602fc2 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2018.js","sourceRoot":"","sources":["../../src/lib/es2018.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,qCAAkC;AAClC,iEAA8D;AAC9D,mEAAgE;AAChE,qDAAkD;AAClD,mDAAgD;AAChD,+CAA4C;AAE/B,QAAA,MAAM,GAAG,wFACjB,eAAM,GACN,2CAAoB,GACpB,6CAAqB,GACrB,+BAAc,GACd,6BAAa,GACb,yBAAW,CAC+B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.d.ts new file mode 100644 index 000000000..b145cd236 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2018_promise: Record; +//# sourceMappingURL=es2018.promise.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.d.ts.map new file mode 100644 index 000000000..4f244488e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2018.promise.d.ts","sourceRoot":"","sources":["../../src/lib/es2018.promise.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,cAAc,4CAOoB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.js new file mode 100644 index 000000000..27e5ef121 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2018_promise = void 0; +exports.es2018_promise = { + Promise: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Promise', + }, +}; +//# sourceMappingURL=es2018.promise.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.js.map new file mode 100644 index 000000000..62968a0d4 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2018.promise.js","sourceRoot":"","sources":["../../src/lib/es2018.promise.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,cAAc,GAAG;IAC5B,OAAO,EAAE;QACP,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,SAAS;KAChB;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.d.ts new file mode 100644 index 000000000..afcc4fbd3 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2018_regexp: Record; +//# sourceMappingURL=es2018.regexp.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.d.ts.map new file mode 100644 index 000000000..371fba888 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2018.regexp.d.ts","sourceRoot":"","sources":["../../src/lib/es2018.regexp.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,aAAa,4CAmBqB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.js new file mode 100644 index 000000000..fc21009eb --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.js @@ -0,0 +1,27 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2018_regexp = void 0; +exports.es2018_regexp = { + RegExpMatchArray: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RegExpMatchArray', + }, + RegExpExecArray: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RegExpExecArray', + }, + RegExp: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RegExp', + }, +}; +//# sourceMappingURL=es2018.regexp.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.js.map new file mode 100644 index 000000000..c52510597 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2018.regexp.js","sourceRoot":"","sources":["../../src/lib/es2018.regexp.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,aAAa,GAAG;IAC3B,gBAAgB,EAAE;QAChB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,kBAAkB;KACzB;IACD,eAAe,EAAE;QACf,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,iBAAiB;KACxB;IACD,MAAM,EAAE;QACN,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,QAAQ;KACf;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.d.ts new file mode 100644 index 000000000..7de499ab3 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2019_array: Record; +//# sourceMappingURL=es2019.array.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.d.ts.map new file mode 100644 index 000000000..85a5b81e4 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2019.array.d.ts","sourceRoot":"","sources":["../../src/lib/es2019.array.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,YAAY,4CAmBsB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.js new file mode 100644 index 000000000..8561f4069 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.js @@ -0,0 +1,27 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2019_array = void 0; +exports.es2019_array = { + FlatArray: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'FlatArray', + }, + ReadonlyArray: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadonlyArray', + }, + Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Array', + }, +}; +//# sourceMappingURL=es2019.array.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.js.map new file mode 100644 index 000000000..fde39349b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2019.array.js","sourceRoot":"","sources":["../../src/lib/es2019.array.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,YAAY,GAAG;IAC1B,SAAS,EAAE;QACT,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,WAAW;KAClB;IACD,aAAa,EAAE;QACb,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,eAAe;KACtB;IACD,KAAK,EAAE;QACL,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,OAAO;KACd;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.d.ts new file mode 100644 index 000000000..63a0c2394 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2019: Record; +//# sourceMappingURL=es2019.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.d.ts.map new file mode 100644 index 000000000..d330a016d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2019.d.ts","sourceRoot":"","sources":["../../src/lib/es2019.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAOzD,eAAO,MAAM,MAAM,4CAM4B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.d.ts new file mode 100644 index 000000000..fbd163b9b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2019_full: Record; +//# sourceMappingURL=es2019.full.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.d.ts.map new file mode 100644 index 000000000..7a75588f4 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2019.full.d.ts","sourceRoot":"","sources":["../../src/lib/es2019.full.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAOzD,eAAO,MAAM,WAAW,4CAMuB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.js new file mode 100644 index 000000000..87e87c75f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.js @@ -0,0 +1,13 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2019_full = void 0; +const es2019_1 = require("./es2019"); +const dom_1 = require("./dom"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +const scripthost_1 = require("./scripthost"); +const dom_iterable_1 = require("./dom.iterable"); +exports.es2019_full = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, es2019_1.es2019), dom_1.dom), webworker_importscripts_1.webworker_importscripts), scripthost_1.scripthost), dom_iterable_1.dom_iterable); +//# sourceMappingURL=es2019.full.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.js.map new file mode 100644 index 000000000..9043ff247 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2019.full.js","sourceRoot":"","sources":["../../src/lib/es2019.full.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,qCAAkC;AAClC,+BAA4B;AAC5B,uEAAoE;AACpE,6CAA0C;AAC1C,iDAA8C;AAEjC,QAAA,WAAW,GAAG,0EACtB,eAAM,GACN,SAAG,GACH,iDAAuB,GACvB,uBAAU,GACV,2BAAY,CAC8B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.js new file mode 100644 index 000000000..b59dffbe9 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.js @@ -0,0 +1,13 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2019 = void 0; +const es2018_1 = require("./es2018"); +const es2019_array_1 = require("./es2019.array"); +const es2019_object_1 = require("./es2019.object"); +const es2019_string_1 = require("./es2019.string"); +const es2019_symbol_1 = require("./es2019.symbol"); +exports.es2019 = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, es2018_1.es2018), es2019_array_1.es2019_array), es2019_object_1.es2019_object), es2019_string_1.es2019_string), es2019_symbol_1.es2019_symbol); +//# sourceMappingURL=es2019.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.js.map new file mode 100644 index 000000000..d1e0f25ea --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2019.js","sourceRoot":"","sources":["../../src/lib/es2019.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,qCAAkC;AAClC,iDAA8C;AAC9C,mDAAgD;AAChD,mDAAgD;AAChD,mDAAgD;AAEnC,QAAA,MAAM,GAAG,0EACjB,eAAM,GACN,2BAAY,GACZ,6BAAa,GACb,6BAAa,GACb,6BAAa,CAC6B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.d.ts new file mode 100644 index 000000000..8e34cf5e7 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2019_object: Record; +//# sourceMappingURL=es2019.object.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.d.ts.map new file mode 100644 index 000000000..6cc0c03eb --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2019.object.d.ts","sourceRoot":"","sources":["../../src/lib/es2019.object.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAGzD,eAAO,MAAM,aAAa,4CAQqB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.js new file mode 100644 index 000000000..b3c669200 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.js @@ -0,0 +1,14 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2019_object = void 0; +const es2015_iterable_1 = require("./es2015.iterable"); +exports.es2019_object = Object.assign(Object.assign({}, es2015_iterable_1.es2015_iterable), { ObjectConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ObjectConstructor', + } }); +//# sourceMappingURL=es2019.object.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.js.map new file mode 100644 index 000000000..d926a916a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2019.object.js","sourceRoot":"","sources":["../../src/lib/es2019.object.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,uDAAoD;AAEvC,QAAA,aAAa,GAAG,gCACxB,iCAAe,KAClB,iBAAiB,EAAE;QACjB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,mBAAmB;KAC1B,GAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.d.ts new file mode 100644 index 000000000..ff338dd56 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2019_string: Record; +//# sourceMappingURL=es2019.string.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.d.ts.map new file mode 100644 index 000000000..a2bf20136 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2019.string.d.ts","sourceRoot":"","sources":["../../src/lib/es2019.string.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,aAAa,4CAOqB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.js new file mode 100644 index 000000000..23884fae4 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2019_string = void 0; +exports.es2019_string = { + String: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'String', + }, +}; +//# sourceMappingURL=es2019.string.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.js.map new file mode 100644 index 000000000..aba9cf9a7 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2019.string.js","sourceRoot":"","sources":["../../src/lib/es2019.string.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,aAAa,GAAG;IAC3B,MAAM,EAAE;QACN,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,QAAQ;KACf;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.d.ts new file mode 100644 index 000000000..0a5f503af --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2019_symbol: Record; +//# sourceMappingURL=es2019.symbol.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.d.ts.map new file mode 100644 index 000000000..172b59f23 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2019.symbol.d.ts","sourceRoot":"","sources":["../../src/lib/es2019.symbol.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,aAAa,4CAOqB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.js new file mode 100644 index 000000000..c71974ba0 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2019_symbol = void 0; +exports.es2019_symbol = { + Symbol: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Symbol', + }, +}; +//# sourceMappingURL=es2019.symbol.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.js.map new file mode 100644 index 000000000..9d29d8fa9 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2019.symbol.js","sourceRoot":"","sources":["../../src/lib/es2019.symbol.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,aAAa,GAAG;IAC3B,MAAM,EAAE;QACN,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,QAAQ;KACf;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.d.ts new file mode 100644 index 000000000..4e2e1220b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2020_bigint: Record; +//# sourceMappingURL=es2020.bigint.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.d.ts.map new file mode 100644 index 000000000..70995c8db --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2020.bigint.d.ts","sourceRoot":"","sources":["../../src/lib/es2020.bigint.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,aAAa,4CAuDqB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.js new file mode 100644 index 000000000..625895c33 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.js @@ -0,0 +1,63 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020_bigint = void 0; +exports.es2020_bigint = { + BigIntToLocaleStringOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BigIntToLocaleStringOptions', + }, + BigInt: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'BigInt', + }, + BigIntConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BigIntConstructor', + }, + BigInt64Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'BigInt64Array', + }, + BigInt64ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BigInt64ArrayConstructor', + }, + BigUint64Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'BigUint64Array', + }, + BigUint64ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BigUint64ArrayConstructor', + }, + DataView: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DataView', + }, + Intl: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Intl', + }, +}; +//# sourceMappingURL=es2020.bigint.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.js.map new file mode 100644 index 000000000..885f48d00 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2020.bigint.js","sourceRoot":"","sources":["../../src/lib/es2020.bigint.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,aAAa,GAAG;IAC3B,2BAA2B,EAAE;QAC3B,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,6BAA6B;KACpC;IACD,MAAM,EAAE;QACN,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE,QAAQ;KACf;IACD,iBAAiB,EAAE;QACjB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,mBAAmB;KAC1B;IACD,aAAa,EAAE;QACb,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE,eAAe;KACtB;IACD,wBAAwB,EAAE;QACxB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,0BAA0B;KACjC;IACD,cAAc,EAAE;QACd,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE,gBAAgB;KACvB;IACD,yBAAyB,EAAE;QACzB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,2BAA2B;KAClC;IACD,QAAQ,EAAE;QACR,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,UAAU;KACjB;IACD,IAAI,EAAE;QACJ,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE,MAAM;KACb;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.d.ts new file mode 100644 index 000000000..6515a7aa2 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2020: Record; +//# sourceMappingURL=es2020.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.d.ts.map new file mode 100644 index 000000000..f632671a3 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2020.d.ts","sourceRoot":"","sources":["../../src/lib/es2020.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAQzD,eAAO,MAAM,MAAM,4CAO4B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.d.ts new file mode 100644 index 000000000..957436711 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2020_full: Record; +//# sourceMappingURL=es2020.full.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.d.ts.map new file mode 100644 index 000000000..8bd0e9c3a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2020.full.d.ts","sourceRoot":"","sources":["../../src/lib/es2020.full.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAOzD,eAAO,MAAM,WAAW,4CAMuB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.js new file mode 100644 index 000000000..f0dc0bbf7 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.js @@ -0,0 +1,13 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020_full = void 0; +const es2020_1 = require("./es2020"); +const dom_1 = require("./dom"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +const scripthost_1 = require("./scripthost"); +const dom_iterable_1 = require("./dom.iterable"); +exports.es2020_full = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, es2020_1.es2020), dom_1.dom), webworker_importscripts_1.webworker_importscripts), scripthost_1.scripthost), dom_iterable_1.dom_iterable); +//# sourceMappingURL=es2020.full.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.js.map new file mode 100644 index 000000000..e955800f7 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2020.full.js","sourceRoot":"","sources":["../../src/lib/es2020.full.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,qCAAkC;AAClC,+BAA4B;AAC5B,uEAAoE;AACpE,6CAA0C;AAC1C,iDAA8C;AAEjC,QAAA,WAAW,GAAG,0EACtB,eAAM,GACN,SAAG,GACH,iDAAuB,GACvB,uBAAU,GACV,2BAAY,CAC8B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.d.ts new file mode 100644 index 000000000..f2bbf09a8 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2020_intl: Record; +//# sourceMappingURL=es2020.intl.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.d.ts.map new file mode 100644 index 000000000..fd5aeef6b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2020.intl.d.ts","sourceRoot":"","sources":["../../src/lib/es2020.intl.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,WAAW,4CAOuB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.js new file mode 100644 index 000000000..fa32f4775 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020_intl = void 0; +exports.es2020_intl = { + Intl: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Intl', + }, +}; +//# sourceMappingURL=es2020.intl.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.js.map new file mode 100644 index 000000000..c0ceb5ea0 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2020.intl.js","sourceRoot":"","sources":["../../src/lib/es2020.intl.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,WAAW,GAAG;IACzB,IAAI,EAAE;QACJ,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE,MAAM;KACb;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.js new file mode 100644 index 000000000..642d3609a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.js @@ -0,0 +1,14 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020 = void 0; +const es2019_1 = require("./es2019"); +const es2020_bigint_1 = require("./es2020.bigint"); +const es2020_promise_1 = require("./es2020.promise"); +const es2020_string_1 = require("./es2020.string"); +const es2020_symbol_wellknown_1 = require("./es2020.symbol.wellknown"); +const es2020_intl_1 = require("./es2020.intl"); +exports.es2020 = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, es2019_1.es2019), es2020_bigint_1.es2020_bigint), es2020_promise_1.es2020_promise), es2020_string_1.es2020_string), es2020_symbol_wellknown_1.es2020_symbol_wellknown), es2020_intl_1.es2020_intl); +//# sourceMappingURL=es2020.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.js.map new file mode 100644 index 000000000..8c8360ea8 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2020.js","sourceRoot":"","sources":["../../src/lib/es2020.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,qCAAkC;AAClC,mDAAgD;AAChD,qDAAkD;AAClD,mDAAgD;AAChD,uEAAoE;AACpE,+CAA4C;AAE/B,QAAA,MAAM,GAAG,wFACjB,eAAM,GACN,6BAAa,GACb,+BAAc,GACd,6BAAa,GACb,iDAAuB,GACvB,yBAAW,CAC+B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.d.ts new file mode 100644 index 000000000..bac68d1fc --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2020_promise: Record; +//# sourceMappingURL=es2020.promise.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.d.ts.map new file mode 100644 index 000000000..33b4c473c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2020.promise.d.ts","sourceRoot":"","sources":["../../src/lib/es2020.promise.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,cAAc,4CAyBoB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.js new file mode 100644 index 000000000..6650bedf8 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.js @@ -0,0 +1,33 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020_promise = void 0; +exports.es2020_promise = { + PromiseFulfilledResult: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PromiseFulfilledResult', + }, + PromiseRejectedResult: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PromiseRejectedResult', + }, + PromiseSettledResult: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PromiseSettledResult', + }, + PromiseConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PromiseConstructor', + }, +}; +//# sourceMappingURL=es2020.promise.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.js.map new file mode 100644 index 000000000..1dbd10fa6 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2020.promise.js","sourceRoot":"","sources":["../../src/lib/es2020.promise.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,cAAc,GAAG;IAC5B,sBAAsB,EAAE;QACtB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,wBAAwB;KAC/B;IACD,qBAAqB,EAAE;QACrB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,uBAAuB;KAC9B;IACD,oBAAoB,EAAE;QACpB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,sBAAsB;KAC7B;IACD,kBAAkB,EAAE;QAClB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,oBAAoB;KAC3B;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.d.ts new file mode 100644 index 000000000..17dd64b9a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2020_string: Record; +//# sourceMappingURL=es2020.string.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.d.ts.map new file mode 100644 index 000000000..b2d3f9cad --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2020.string.d.ts","sourceRoot":"","sources":["../../src/lib/es2020.string.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAGzD,eAAO,MAAM,aAAa,4CAQqB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.js new file mode 100644 index 000000000..cb7451e9c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.js @@ -0,0 +1,14 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020_string = void 0; +const es2015_iterable_1 = require("./es2015.iterable"); +exports.es2020_string = Object.assign(Object.assign({}, es2015_iterable_1.es2015_iterable), { String: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'String', + } }); +//# sourceMappingURL=es2020.string.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.js.map new file mode 100644 index 000000000..b13bab139 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2020.string.js","sourceRoot":"","sources":["../../src/lib/es2020.string.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,uDAAoD;AAEvC,QAAA,aAAa,GAAG,gCACxB,iCAAe,KAClB,MAAM,EAAE;QACN,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,QAAQ;KACf,GAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.d.ts new file mode 100644 index 000000000..62f06ebaa --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es2020_symbol_wellknown: Record; +//# sourceMappingURL=es2020.symbol.wellknown.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.d.ts.map new file mode 100644 index 000000000..e4de6204f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es2020.symbol.wellknown.d.ts","sourceRoot":"","sources":["../../src/lib/es2020.symbol.wellknown.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAIzD,eAAO,MAAM,uBAAuB,4CAeW,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.js new file mode 100644 index 000000000..0dd89aa2f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.js @@ -0,0 +1,20 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020_symbol_wellknown = void 0; +const es2015_iterable_1 = require("./es2015.iterable"); +const es2015_symbol_1 = require("./es2015.symbol"); +exports.es2020_symbol_wellknown = Object.assign(Object.assign(Object.assign({}, es2015_iterable_1.es2015_iterable), es2015_symbol_1.es2015_symbol), { SymbolConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SymbolConstructor', + }, RegExp: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RegExp', + } }); +//# sourceMappingURL=es2020.symbol.wellknown.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.js.map new file mode 100644 index 000000000..1e220dfca --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es2020.symbol.wellknown.js","sourceRoot":"","sources":["../../src/lib/es2020.symbol.wellknown.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,uDAAoD;AACpD,mDAAgD;AAEnC,QAAA,uBAAuB,GAAG,8CAClC,iCAAe,GACf,6BAAa,KAChB,iBAAiB,EAAE;QACjB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,mBAAmB;KAC1B,EACD,MAAM,EAAE;QACN,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,QAAQ;KACf,GAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.d.ts new file mode 100644 index 000000000..65478e0e9 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es5: Record; +//# sourceMappingURL=es5.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.d.ts.map new file mode 100644 index 000000000..f935434f7 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es5.d.ts","sourceRoot":"","sources":["../../src/lib/es5.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,GAAG,4CAikB+B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.js new file mode 100644 index 000000000..1d036766b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.js @@ -0,0 +1,585 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es5 = void 0; +exports.es5 = { + Symbol: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Symbol', + }, + PropertyKey: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PropertyKey', + }, + PropertyDescriptor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PropertyDescriptor', + }, + PropertyDescriptorMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PropertyDescriptorMap', + }, + Object: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Object', + }, + ObjectConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ObjectConstructor', + }, + Function: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Function', + }, + FunctionConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'FunctionConstructor', + }, + ThisParameterType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ThisParameterType', + }, + OmitThisParameter: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OmitThisParameter', + }, + CallableFunction: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CallableFunction', + }, + NewableFunction: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NewableFunction', + }, + IArguments: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IArguments', + }, + String: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'String', + }, + StringConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'StringConstructor', + }, + Boolean: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Boolean', + }, + BooleanConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BooleanConstructor', + }, + Number: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Number', + }, + NumberConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NumberConstructor', + }, + TemplateStringsArray: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TemplateStringsArray', + }, + ImportMeta: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ImportMeta', + }, + Math: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Math', + }, + Date: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Date', + }, + DateConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DateConstructor', + }, + RegExpMatchArray: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RegExpMatchArray', + }, + RegExpExecArray: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RegExpExecArray', + }, + RegExp: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RegExp', + }, + RegExpConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RegExpConstructor', + }, + Error: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Error', + }, + ErrorConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ErrorConstructor', + }, + EvalError: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'EvalError', + }, + EvalErrorConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EvalErrorConstructor', + }, + RangeError: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'RangeError', + }, + RangeErrorConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RangeErrorConstructor', + }, + ReferenceError: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ReferenceError', + }, + ReferenceErrorConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReferenceErrorConstructor', + }, + SyntaxError: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SyntaxError', + }, + SyntaxErrorConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SyntaxErrorConstructor', + }, + TypeError: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'TypeError', + }, + TypeErrorConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TypeErrorConstructor', + }, + URIError: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'URIError', + }, + URIErrorConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'URIErrorConstructor', + }, + JSON: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'JSON', + }, + ReadonlyArray: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadonlyArray', + }, + ConcatArray: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ConcatArray', + }, + Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Array', + }, + ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ArrayConstructor', + }, + TypedPropertyDescriptor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TypedPropertyDescriptor', + }, + ClassDecorator: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ClassDecorator', + }, + PropertyDecorator: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PropertyDecorator', + }, + MethodDecorator: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MethodDecorator', + }, + ParameterDecorator: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ParameterDecorator', + }, + PromiseConstructorLike: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PromiseConstructorLike', + }, + PromiseLike: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PromiseLike', + }, + Promise: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Promise', + }, + ArrayLike: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ArrayLike', + }, + Partial: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Partial', + }, + Required: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Required', + }, + Readonly: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Readonly', + }, + Pick: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Pick', + }, + Record: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Record', + }, + Exclude: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Exclude', + }, + Extract: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Extract', + }, + Omit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Omit', + }, + NonNullable: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NonNullable', + }, + Parameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Parameters', + }, + ConstructorParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ConstructorParameters', + }, + ReturnType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReturnType', + }, + InstanceType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'InstanceType', + }, + ThisType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ThisType', + }, + ArrayBuffer: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ArrayBuffer', + }, + ArrayBufferTypes: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ArrayBufferTypes', + }, + ArrayBufferLike: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ArrayBufferLike', + }, + ArrayBufferConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ArrayBufferConstructor', + }, + ArrayBufferView: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ArrayBufferView', + }, + DataView: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DataView', + }, + DataViewConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DataViewConstructor', + }, + Int8Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Int8Array', + }, + Int8ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Int8ArrayConstructor', + }, + Uint8Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Uint8Array', + }, + Uint8ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint8ArrayConstructor', + }, + Uint8ClampedArray: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Uint8ClampedArray', + }, + Uint8ClampedArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint8ClampedArrayConstructor', + }, + Int16Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Int16Array', + }, + Int16ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Int16ArrayConstructor', + }, + Uint16Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Uint16Array', + }, + Uint16ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint16ArrayConstructor', + }, + Int32Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Int32Array', + }, + Int32ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Int32ArrayConstructor', + }, + Uint32Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Uint32Array', + }, + Uint32ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint32ArrayConstructor', + }, + Float32Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Float32Array', + }, + Float32ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Float32ArrayConstructor', + }, + Float64Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Float64Array', + }, + Float64ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Float64ArrayConstructor', + }, + Intl: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Intl', + }, +}; +//# sourceMappingURL=es5.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.js.map new file mode 100644 index 000000000..b3a378351 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es5.js","sourceRoot":"","sources":["../../src/lib/es5.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,GAAG,GAAG;IACjB,MAAM,EAAE;QACN,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,QAAQ;KACf;IACD,WAAW,EAAE;QACX,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,aAAa;KACpB;IACD,kBAAkB,EAAE;QAClB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,oBAAoB;K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tB,IAAI,EAAE,yBAAyB;KAChC;IACD,YAAY,EAAE;QACZ,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE,cAAc;KACrB;IACD,uBAAuB,EAAE;QACvB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,yBAAyB;KAChC;IACD,IAAI,EAAE;QACJ,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE,MAAM;KACb;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.d.ts new file mode 100644 index 000000000..448148ed3 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es6: Record; +//# sourceMappingURL=es6.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.d.ts.map new file mode 100644 index 000000000..b8b38ac16 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es6.d.ts","sourceRoot":"","sources":["../../src/lib/es6.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAYzD,eAAO,MAAM,GAAG,4CAW+B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.js new file mode 100644 index 000000000..3fdf1b462 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.js @@ -0,0 +1,18 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es6 = void 0; +const es5_1 = require("./es5"); +const es2015_core_1 = require("./es2015.core"); +const es2015_collection_1 = require("./es2015.collection"); +const es2015_iterable_1 = require("./es2015.iterable"); +const es2015_generator_1 = require("./es2015.generator"); +const es2015_promise_1 = require("./es2015.promise"); +const es2015_proxy_1 = require("./es2015.proxy"); +const es2015_reflect_1 = require("./es2015.reflect"); +const es2015_symbol_1 = require("./es2015.symbol"); +const es2015_symbol_wellknown_1 = require("./es2015.symbol.wellknown"); +exports.es6 = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, es5_1.es5), es2015_core_1.es2015_core), es2015_collection_1.es2015_collection), es2015_iterable_1.es2015_iterable), es2015_generator_1.es2015_generator), es2015_promise_1.es2015_promise), es2015_proxy_1.es2015_proxy), es2015_reflect_1.es2015_reflect), es2015_symbol_1.es2015_symbol), es2015_symbol_wellknown_1.es2015_symbol_wellknown); +//# sourceMappingURL=es6.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.js.map new file mode 100644 index 000000000..f03b45e30 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es6.js","sourceRoot":"","sources":["../../src/lib/es6.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,+BAA4B;AAC5B,+CAA4C;AAC5C,2DAAwD;AACxD,uDAAoD;AACpD,yDAAsD;AACtD,qDAAkD;AAClD,iDAA8C;AAC9C,qDAAkD;AAClD,mDAAgD;AAChD,uEAAoE;AAEvD,QAAA,GAAG,GAAG,gJACd,SAAG,GACH,yBAAW,GACX,qCAAiB,GACjB,iCAAe,GACf,mCAAgB,GAChB,+BAAc,GACd,2BAAY,GACZ,+BAAc,GACd,6BAAa,GACb,iDAAuB,CACmB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.d.ts new file mode 100644 index 000000000..bb2bebda5 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const es7: Record; +//# sourceMappingURL=es7.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.d.ts.map new file mode 100644 index 000000000..f0edb6e2b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"es7.d.ts","sourceRoot":"","sources":["../../src/lib/es7.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAIzD,eAAO,MAAM,GAAG,4CAG+B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.js new file mode 100644 index 000000000..029cb52a1 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.js @@ -0,0 +1,10 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es7 = void 0; +const es2015_1 = require("./es2015"); +const es2016_array_include_1 = require("./es2016.array.include"); +exports.es7 = Object.assign(Object.assign({}, es2015_1.es2015), es2016_array_include_1.es2016_array_include); +//# sourceMappingURL=es7.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.js.map new file mode 100644 index 000000000..9fe94f9d6 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.js.map @@ -0,0 +1 @@ +{"version":3,"file":"es7.js","sourceRoot":"","sources":["../../src/lib/es7.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,qCAAkC;AAClC,iEAA8D;AAEjD,QAAA,GAAG,GAAG,gCACd,eAAM,GACN,2CAAoB,CACsB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.d.ts new file mode 100644 index 000000000..276c04f7a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const esnext_array: Record; +//# sourceMappingURL=esnext.array.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.d.ts.map new file mode 100644 index 000000000..d3f7ae6f8 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.array.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.array.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,YAAY,4CAmBsB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.js new file mode 100644 index 000000000..716509406 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.js @@ -0,0 +1,27 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_array = void 0; +exports.esnext_array = { + FlatArray: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'FlatArray', + }, + ReadonlyArray: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadonlyArray', + }, + Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Array', + }, +}; +//# sourceMappingURL=esnext.array.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.js.map new file mode 100644 index 000000000..72c450ae4 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.js.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.array.js","sourceRoot":"","sources":["../../src/lib/esnext.array.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,YAAY,GAAG;IAC1B,SAAS,EAAE;QACT,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,WAAW;KAClB;IACD,aAAa,EAAE;QACb,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,eAAe;KACtB;IACD,KAAK,EAAE;QACL,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,OAAO;KACd;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.d.ts new file mode 100644 index 000000000..c1765d02f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const esnext_asynciterable: Record; +//# sourceMappingURL=esnext.asynciterable.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.d.ts.map new file mode 100644 index 000000000..4bc2c4a61 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.asynciterable.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.asynciterable.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAIzD,eAAO,MAAM,oBAAoB,4CA2Bc,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.js new file mode 100644 index 000000000..00ac9b168 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.js @@ -0,0 +1,30 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_asynciterable = void 0; +const es2015_symbol_1 = require("./es2015.symbol"); +const es2015_iterable_1 = require("./es2015.iterable"); +exports.esnext_asynciterable = Object.assign(Object.assign(Object.assign({}, es2015_symbol_1.es2015_symbol), es2015_iterable_1.es2015_iterable), { SymbolConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SymbolConstructor', + }, AsyncIterator: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AsyncIterator', + }, AsyncIterable: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AsyncIterable', + }, AsyncIterableIterator: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AsyncIterableIterator', + } }); +//# sourceMappingURL=esnext.asynciterable.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.js.map new file mode 100644 index 000000000..bc3312d27 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.asynciterable.js","sourceRoot":"","sources":["../../src/lib/esnext.asynciterable.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,mDAAgD;AAChD,uDAAoD;AAEvC,QAAA,oBAAoB,GAAG,8CAC/B,6BAAa,GACb,iCAAe,KAClB,iBAAiB,EAAE;QACjB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,mBAAmB;KAC1B,EACD,aAAa,EAAE;QACb,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,eAAe;KACtB,EACD,aAAa,EAAE;QACb,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,eAAe;KACtB,EACD,qBAAqB,EAAE;QACrB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,uBAAuB;KAC9B,GAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.d.ts new file mode 100644 index 000000000..411e2a444 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const esnext_bigint: Record; +//# sourceMappingURL=esnext.bigint.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.d.ts.map new file mode 100644 index 000000000..69b5ddde2 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.bigint.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.bigint.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,aAAa,4CAuDqB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.js new file mode 100644 index 000000000..ea080ba2d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.js @@ -0,0 +1,63 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_bigint = void 0; +exports.esnext_bigint = { + BigIntToLocaleStringOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BigIntToLocaleStringOptions', + }, + BigInt: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'BigInt', + }, + BigIntConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BigIntConstructor', + }, + BigInt64Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'BigInt64Array', + }, + BigInt64ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BigInt64ArrayConstructor', + }, + BigUint64Array: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'BigUint64Array', + }, + BigUint64ArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BigUint64ArrayConstructor', + }, + DataView: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DataView', + }, + Intl: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Intl', + }, +}; +//# sourceMappingURL=esnext.bigint.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.js.map new file mode 100644 index 000000000..44d4092fb --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.js.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.bigint.js","sourceRoot":"","sources":["../../src/lib/esnext.bigint.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,aAAa,GAAG;IAC3B,2BAA2B,EAAE;QAC3B,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,6BAA6B;KACpC;IACD,MAAM,EAAE;QACN,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE,QAAQ;KACf;IACD,iBAAiB,EAAE;QACjB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,mBAAmB;KAC1B;IACD,aAAa,EAAE;QACb,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE,eAAe;KACtB;IACD,wBAAwB,EAAE;QACxB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,0BAA0B;KACjC;IACD,cAAc,EAAE;QACd,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE,gBAAgB;KACvB;IACD,yBAAyB,EAAE;QACzB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,2BAA2B;KAClC;IACD,QAAQ,EAAE;QACR,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,UAAU;KACjB;IACD,IAAI,EAAE;QACJ,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE,MAAM;KACb;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.d.ts new file mode 100644 index 000000000..b082597e0 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const esnext: Record; +//# sourceMappingURL=esnext.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.d.ts.map new file mode 100644 index 000000000..e414c2771 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAMzD,eAAO,MAAM,MAAM,4CAK4B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.d.ts new file mode 100644 index 000000000..2518eb1db --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const esnext_full: Record; +//# sourceMappingURL=esnext.full.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.d.ts.map new file mode 100644 index 000000000..7fd743b13 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.full.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.full.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAOzD,eAAO,MAAM,WAAW,4CAMuB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.js new file mode 100644 index 000000000..8f2ac415f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.js @@ -0,0 +1,13 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_full = void 0; +const esnext_1 = require("./esnext"); +const dom_1 = require("./dom"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +const scripthost_1 = require("./scripthost"); +const dom_iterable_1 = require("./dom.iterable"); +exports.esnext_full = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, esnext_1.esnext), dom_1.dom), webworker_importscripts_1.webworker_importscripts), scripthost_1.scripthost), dom_iterable_1.dom_iterable); +//# sourceMappingURL=esnext.full.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.js.map new file mode 100644 index 000000000..f2f15ff9b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.js.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.full.js","sourceRoot":"","sources":["../../src/lib/esnext.full.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,qCAAkC;AAClC,+BAA4B;AAC5B,uEAAoE;AACpE,6CAA0C;AAC1C,iDAA8C;AAEjC,QAAA,WAAW,GAAG,0EACtB,eAAM,GACN,SAAG,GACH,iDAAuB,GACvB,uBAAU,GACV,2BAAY,CAC8B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.d.ts new file mode 100644 index 000000000..7edf1b124 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const esnext_intl: Record; +//# sourceMappingURL=esnext.intl.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.d.ts.map new file mode 100644 index 000000000..f955c8425 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.intl.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.intl.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,WAAW,4CAOuB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.js new file mode 100644 index 000000000..7e87a0e7a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_intl = void 0; +exports.esnext_intl = { + Intl: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Intl', + }, +}; +//# sourceMappingURL=esnext.intl.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.js.map new file mode 100644 index 000000000..c1d75c5f8 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.js.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.intl.js","sourceRoot":"","sources":["../../src/lib/esnext.intl.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,WAAW,GAAG;IACzB,IAAI,EAAE;QACJ,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE,MAAM;KACb;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.js new file mode 100644 index 000000000..5bf51829c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext = void 0; +const es2020_1 = require("./es2020"); +const esnext_intl_1 = require("./esnext.intl"); +const esnext_string_1 = require("./esnext.string"); +const esnext_promise_1 = require("./esnext.promise"); +exports.esnext = Object.assign(Object.assign(Object.assign(Object.assign({}, es2020_1.es2020), esnext_intl_1.esnext_intl), esnext_string_1.esnext_string), esnext_promise_1.esnext_promise); +//# sourceMappingURL=esnext.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.js.map new file mode 100644 index 000000000..be61999c5 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.js.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.js","sourceRoot":"","sources":["../../src/lib/esnext.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,qCAAkC;AAClC,+CAA4C;AAC5C,mDAAgD;AAChD,qDAAkD;AAErC,QAAA,MAAM,GAAG,4DACjB,eAAM,GACN,yBAAW,GACX,6BAAa,GACb,+BAAc,CAC4B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.d.ts new file mode 100644 index 000000000..cea7a9acf --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const esnext_promise: Record; +//# sourceMappingURL=esnext.promise.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.d.ts.map new file mode 100644 index 000000000..5421852e4 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.promise.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.promise.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,cAAc,4CAmBoB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.js new file mode 100644 index 000000000..8e297b69b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.js @@ -0,0 +1,27 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_promise = void 0; +exports.esnext_promise = { + AggregateError: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AggregateError', + }, + AggregateErrorConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AggregateErrorConstructor', + }, + PromiseConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PromiseConstructor', + }, +}; +//# sourceMappingURL=esnext.promise.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.js.map new file mode 100644 index 000000000..aca57a1cb --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.js.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.promise.js","sourceRoot":"","sources":["../../src/lib/esnext.promise.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,cAAc,GAAG;IAC5B,cAAc,EAAE;QACd,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE,gBAAgB;KACvB;IACD,yBAAyB,EAAE;QACzB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,2BAA2B;KAClC;IACD,kBAAkB,EAAE;QAClB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,oBAAoB;KAC3B;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.d.ts new file mode 100644 index 000000000..f16c10ece --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const esnext_string: Record; +//# sourceMappingURL=esnext.string.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.d.ts.map new file mode 100644 index 000000000..32451ca31 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.string.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.string.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,aAAa,4CAOqB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.js new file mode 100644 index 000000000..5cec00be6 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_string = void 0; +exports.esnext_string = { + String: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'String', + }, +}; +//# sourceMappingURL=esnext.string.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.js.map new file mode 100644 index 000000000..714de47ee --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.js.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.string.js","sourceRoot":"","sources":["../../src/lib/esnext.string.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,aAAa,GAAG;IAC3B,MAAM,EAAE;QACN,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,QAAQ;KACf;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.d.ts new file mode 100644 index 000000000..ecc40efc4 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const esnext_symbol: Record; +//# sourceMappingURL=esnext.symbol.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.d.ts.map new file mode 100644 index 000000000..ac7c90a56 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.symbol.d.ts","sourceRoot":"","sources":["../../src/lib/esnext.symbol.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,aAAa,4CAOqB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.js new file mode 100644 index 000000000..72e7bc227 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_symbol = void 0; +exports.esnext_symbol = { + Symbol: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Symbol', + }, +}; +//# sourceMappingURL=esnext.symbol.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.js.map new file mode 100644 index 000000000..605f87c5c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.js.map @@ -0,0 +1 @@ +{"version":3,"file":"esnext.symbol.js","sourceRoot":"","sources":["../../src/lib/esnext.symbol.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,aAAa,GAAG;IAC3B,MAAM,EAAE;QACN,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,QAAQ;KACf;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/index.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/index.d.ts new file mode 100644 index 000000000..548ac55d0 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/index.d.ts @@ -0,0 +1,62 @@ +declare const lib: { + readonly es5: Record; + readonly es6: Record; + readonly es2015: Record; + readonly es7: Record; + readonly es2016: Record; + readonly es2017: Record; + readonly es2018: Record; + readonly es2019: Record; + readonly es2020: Record; + readonly esnext: Record; + readonly dom: Record; + readonly 'dom.iterable': Record; + readonly webworker: Record; + readonly 'webworker.importscripts': Record; + readonly scripthost: Record; + readonly 'es2015.core': Record; + readonly 'es2015.collection': Record; + readonly 'es2015.generator': Record; + readonly 'es2015.iterable': Record; + readonly 'es2015.promise': Record; + readonly 'es2015.proxy': Record; + readonly 'es2015.reflect': Record; + readonly 'es2015.symbol': Record; + readonly 'es2015.symbol.wellknown': Record; + readonly 'es2016.array.include': Record; + readonly 'es2017.object': Record; + readonly 'es2017.sharedmemory': Record; + readonly 'es2017.string': Record; + readonly 'es2017.intl': Record; + readonly 'es2017.typedarrays': Record; + readonly 'es2018.asyncgenerator': Record; + readonly 'es2018.asynciterable': Record; + readonly 'es2018.intl': Record; + readonly 'es2018.promise': Record; + readonly 'es2018.regexp': Record; + readonly 'es2019.array': Record; + readonly 'es2019.object': Record; + readonly 'es2019.string': Record; + readonly 'es2019.symbol': Record; + readonly 'es2020.bigint': Record; + readonly 'es2020.promise': Record; + readonly 'es2020.string': Record; + readonly 'es2020.symbol.wellknown': Record; + readonly 'es2020.intl': Record; + readonly 'esnext.array': Record; + readonly 'esnext.symbol': Record; + readonly 'esnext.asynciterable': Record; + readonly 'esnext.intl': Record; + readonly 'esnext.bigint': Record; + readonly 'esnext.string': Record; + readonly 'esnext.promise': Record; + readonly 'es2016.full': Record; + readonly 'es2017.full': Record; + readonly 'es2018.full': Record; + readonly 'es2019.full': Record; + readonly 'es2020.full': Record; + readonly 'esnext.full': Record; + readonly lib: Record; +}; +export { lib }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/index.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/index.d.ts.map new file mode 100644 index 000000000..31708d098 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AA+DA,QAAA,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2DC,CAAC;AAEX,OAAO,EAAE,GAAG,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/index.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/index.js new file mode 100644 index 000000000..52518e697 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/index.js @@ -0,0 +1,126 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.lib = void 0; +const es5_1 = require("./es5"); +const es6_1 = require("./es6"); +const es2015_1 = require("./es2015"); +const es7_1 = require("./es7"); +const es2016_1 = require("./es2016"); +const es2017_1 = require("./es2017"); +const es2018_1 = require("./es2018"); +const es2019_1 = require("./es2019"); +const es2020_1 = require("./es2020"); +const esnext_1 = require("./esnext"); +const dom_1 = require("./dom"); +const dom_iterable_1 = require("./dom.iterable"); +const webworker_1 = require("./webworker"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +const scripthost_1 = require("./scripthost"); +const es2015_core_1 = require("./es2015.core"); +const es2015_collection_1 = require("./es2015.collection"); +const es2015_generator_1 = require("./es2015.generator"); +const es2015_iterable_1 = require("./es2015.iterable"); +const es2015_promise_1 = require("./es2015.promise"); +const es2015_proxy_1 = require("./es2015.proxy"); +const es2015_reflect_1 = require("./es2015.reflect"); +const es2015_symbol_1 = require("./es2015.symbol"); +const es2015_symbol_wellknown_1 = require("./es2015.symbol.wellknown"); +const es2016_array_include_1 = require("./es2016.array.include"); +const es2017_object_1 = require("./es2017.object"); +const es2017_sharedmemory_1 = require("./es2017.sharedmemory"); +const es2017_string_1 = require("./es2017.string"); +const es2017_intl_1 = require("./es2017.intl"); +const es2017_typedarrays_1 = require("./es2017.typedarrays"); +const es2018_asyncgenerator_1 = require("./es2018.asyncgenerator"); +const es2018_asynciterable_1 = require("./es2018.asynciterable"); +const es2018_intl_1 = require("./es2018.intl"); +const es2018_promise_1 = require("./es2018.promise"); +const es2018_regexp_1 = require("./es2018.regexp"); +const es2019_array_1 = require("./es2019.array"); +const es2019_object_1 = require("./es2019.object"); +const es2019_string_1 = require("./es2019.string"); +const es2019_symbol_1 = require("./es2019.symbol"); +const es2020_bigint_1 = require("./es2020.bigint"); +const es2020_promise_1 = require("./es2020.promise"); +const es2020_string_1 = require("./es2020.string"); +const es2020_symbol_wellknown_1 = require("./es2020.symbol.wellknown"); +const es2020_intl_1 = require("./es2020.intl"); +const esnext_array_1 = require("./esnext.array"); +const esnext_symbol_1 = require("./esnext.symbol"); +const esnext_asynciterable_1 = require("./esnext.asynciterable"); +const esnext_intl_1 = require("./esnext.intl"); +const esnext_bigint_1 = require("./esnext.bigint"); +const esnext_string_1 = require("./esnext.string"); +const esnext_promise_1 = require("./esnext.promise"); +const es2016_full_1 = require("./es2016.full"); +const es2017_full_1 = require("./es2017.full"); +const es2018_full_1 = require("./es2018.full"); +const es2019_full_1 = require("./es2019.full"); +const es2020_full_1 = require("./es2020.full"); +const esnext_full_1 = require("./esnext.full"); +const lib_1 = require("./lib"); +const lib = { + es5: es5_1.es5, + es6: es6_1.es6, + es2015: es2015_1.es2015, + es7: es7_1.es7, + es2016: es2016_1.es2016, + es2017: es2017_1.es2017, + es2018: es2018_1.es2018, + es2019: es2019_1.es2019, + es2020: es2020_1.es2020, + esnext: esnext_1.esnext, + dom: dom_1.dom, + 'dom.iterable': dom_iterable_1.dom_iterable, + webworker: webworker_1.webworker, + 'webworker.importscripts': webworker_importscripts_1.webworker_importscripts, + scripthost: scripthost_1.scripthost, + 'es2015.core': es2015_core_1.es2015_core, + 'es2015.collection': es2015_collection_1.es2015_collection, + 'es2015.generator': es2015_generator_1.es2015_generator, + 'es2015.iterable': es2015_iterable_1.es2015_iterable, + 'es2015.promise': es2015_promise_1.es2015_promise, + 'es2015.proxy': es2015_proxy_1.es2015_proxy, + 'es2015.reflect': es2015_reflect_1.es2015_reflect, + 'es2015.symbol': es2015_symbol_1.es2015_symbol, + 'es2015.symbol.wellknown': es2015_symbol_wellknown_1.es2015_symbol_wellknown, + 'es2016.array.include': es2016_array_include_1.es2016_array_include, + 'es2017.object': es2017_object_1.es2017_object, + 'es2017.sharedmemory': es2017_sharedmemory_1.es2017_sharedmemory, + 'es2017.string': es2017_string_1.es2017_string, + 'es2017.intl': es2017_intl_1.es2017_intl, + 'es2017.typedarrays': es2017_typedarrays_1.es2017_typedarrays, + 'es2018.asyncgenerator': es2018_asyncgenerator_1.es2018_asyncgenerator, + 'es2018.asynciterable': es2018_asynciterable_1.es2018_asynciterable, + 'es2018.intl': es2018_intl_1.es2018_intl, + 'es2018.promise': es2018_promise_1.es2018_promise, + 'es2018.regexp': es2018_regexp_1.es2018_regexp, + 'es2019.array': es2019_array_1.es2019_array, + 'es2019.object': es2019_object_1.es2019_object, + 'es2019.string': es2019_string_1.es2019_string, + 'es2019.symbol': es2019_symbol_1.es2019_symbol, + 'es2020.bigint': es2020_bigint_1.es2020_bigint, + 'es2020.promise': es2020_promise_1.es2020_promise, + 'es2020.string': es2020_string_1.es2020_string, + 'es2020.symbol.wellknown': es2020_symbol_wellknown_1.es2020_symbol_wellknown, + 'es2020.intl': es2020_intl_1.es2020_intl, + 'esnext.array': esnext_array_1.esnext_array, + 'esnext.symbol': esnext_symbol_1.esnext_symbol, + 'esnext.asynciterable': esnext_asynciterable_1.esnext_asynciterable, + 'esnext.intl': esnext_intl_1.esnext_intl, + 'esnext.bigint': esnext_bigint_1.esnext_bigint, + 'esnext.string': esnext_string_1.esnext_string, + 'esnext.promise': esnext_promise_1.esnext_promise, + 'es2016.full': es2016_full_1.es2016_full, + 'es2017.full': es2017_full_1.es2017_full, + 'es2018.full': es2018_full_1.es2018_full, + 'es2019.full': es2019_full_1.es2019_full, + 'es2020.full': es2020_full_1.es2020_full, + 'esnext.full': esnext_full_1.esnext_full, + lib: lib_1.lib, +}; +exports.lib = lib; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/index.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/index.js.map new file mode 100644 index 000000000..5b17b816d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAEhD,+BAA4B;AAC5B,+BAA4B;AAC5B,qCAAkC;AAClC,+BAA4B;AAC5B,qCAAkC;AAClC,qCAAkC;AAClC,qCAAkC;AAClC,qCAAkC;AAClC,qCAAkC;AAClC,qCAAkC;AAClC,+BAA4B;AAC5B,iDAA8C;AAC9C,2CAAwC;AACxC,uEAAoE;AACpE,6CAA0C;AAC1C,+CAA4C;AAC5C,2DAAwD;AACxD,yDAAsD;AACtD,uDAAoD;AACpD,qDAAkD;AAClD,iDAA8C;AAC9C,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IAC9B,qBAAqB,EAAE,yCAAmB;IAC1C,eAAe,EAAE,6BAAa;IAC9B,aAAa,EAAE,yBAAW;IAC1B,oBAAoB,EAAE,uCAAkB;IACxC,uBAAuB,EAAE,6CAAqB;IAC9C,sBAAsB,EAAE,2CAAoB;IAC5C,aAAa,EAAE,yBAAW;IAC1B,gBAAgB,EAAE,+BAAc;IAChC,eAAe,EAAE,6BAAa;IAC9B,cAAc,EAAE,2BAAY;IAC5B,eAAe,EAAE,6BAAa;IAC9B,eAAe,EAAE,6BAAa;IAC9B,eAAe,EAAE,6BAAa;IAC9B,eAAe,EAAE,6BAAa;IAC9B,gBAAgB,EAAE,+BAAc;IAChC,eAAe,EAAE,6BAAa;IAC9B,yBAAyB,EAAE,iDAAuB;IAClD,aAAa,EAAE,yBAAW;IAC1B,cAAc,EAAE,2BAAY;IAC5B,eAAe,EAAE,6BAAa;IAC9B,sBAAsB,EAAE,2CAAoB;IAC5C,aAAa,EAAE,yBAAW;IAC1B,eAAe,EAAE,6BAAa;IAC9B,eAAe,EAAE,6BAAa;IAC9B,gBAAgB,EAAE,+BAAc;IAChC,aAAa,EAAE,yBAAW;IAC1B,aAAa,EAAE,yBAAW;IAC1B,aAAa,EAAE,yBAAW;IAC1B,aAAa,EAAE,yBAAW;IAC1B,aAAa,EAAE,yBAAW;IAC1B,aAAa,EAAE,yBAAW;IAC1B,GAAG,EAAE,SAAO;CACJ,CAAC;AAEF,kBAAG"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.d.ts new file mode 100644 index 000000000..a59826ca7 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const lib: Record; +//# sourceMappingURL=lib.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.d.ts.map new file mode 100644 index 000000000..223c3077c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib/lib.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAMzD,eAAO,MAAM,GAAG,4CAK+B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.js new file mode 100644 index 000000000..e68c7ae71 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.lib = void 0; +const es5_1 = require("./es5"); +const dom_1 = require("./dom"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +const scripthost_1 = require("./scripthost"); +exports.lib = Object.assign(Object.assign(Object.assign(Object.assign({}, es5_1.es5), dom_1.dom), webworker_importscripts_1.webworker_importscripts), scripthost_1.scripthost); +//# sourceMappingURL=lib.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.js.map new file mode 100644 index 000000000..75d60bd8d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.js.map @@ -0,0 +1 @@ +{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../src/lib/lib.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAGhD,+BAA4B;AAC5B,+BAA4B;AAC5B,uEAAoE;AACpE,6CAA0C;AAE7B,QAAA,GAAG,GAAG,4DACd,SAAG,GACH,SAAG,GACH,iDAAuB,GACvB,uBAAU,CACgC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.d.ts new file mode 100644 index 000000000..21802c256 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const scripthost: Record; +//# sourceMappingURL=scripthost.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.d.ts.map new file mode 100644 index 000000000..5ea9f54c2 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"scripthost.d.ts","sourceRoot":"","sources":["../../src/lib/scripthost.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,UAAU,4CA+EwB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.js new file mode 100644 index 000000000..34407089c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.js @@ -0,0 +1,87 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.scripthost = void 0; +exports.scripthost = { + ActiveXObject: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ActiveXObject', + }, + ITextWriter: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ITextWriter', + }, + TextStreamBase: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TextStreamBase', + }, + TextStreamWriter: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TextStreamWriter', + }, + TextStreamReader: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TextStreamReader', + }, + SafeArray: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SafeArray', + }, + Enumerator: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Enumerator', + }, + EnumeratorConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EnumeratorConstructor', + }, + VBArray: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'VBArray', + }, + VBArrayConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'VBArrayConstructor', + }, + VarDate: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'VarDate', + }, + DateConstructor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DateConstructor', + }, + Date: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Date', + }, +}; +//# sourceMappingURL=scripthost.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.js.map new file mode 100644 index 000000000..8684ff1ae --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scripthost.js","sourceRoot":"","sources":["../../src/lib/scripthost.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,UAAU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;KAC3B;IACD,OAAO,EAAE;QACP,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE,SAAS;KAChB;IACD,eAAe,EAAE;QACf,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,iBAAiB;KACxB;IACD,IAAI,EAAE;QACJ,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,MAAM;KACb;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.d.ts new file mode 100644 index 000000000..11d4c2968 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const webworker: Record; +//# sourceMappingURL=webworker.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.d.ts.map new file mode 100644 index 000000000..6e64e1ba8 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"webworker.d.ts","sourceRoot":"","sources":["../../src/lib/webworker.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,SAAS,4CAm6EyB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.d.ts new file mode 100644 index 000000000..5bf227c59 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.d.ts @@ -0,0 +1,3 @@ +import { ImplicitLibVariableOptions } from '../variable'; +export declare const webworker_importscripts: Record; +//# sourceMappingURL=webworker.importscripts.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.d.ts.map new file mode 100644 index 000000000..98ed3cbc1 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"webworker.importscripts.d.ts","sourceRoot":"","sources":["../../src/lib/webworker.importscripts.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,uBAAuB,4CAGnC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.js new file mode 100644 index 000000000..1692132fd --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.js @@ -0,0 +1,8 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.webworker_importscripts = void 0; +exports.webworker_importscripts = {}; +//# sourceMappingURL=webworker.importscripts.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.js.map new file mode 100644 index 000000000..c91e303be --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.js.map @@ -0,0 +1 @@ +{"version":3,"file":"webworker.importscripts.js","sourceRoot":"","sources":["../../src/lib/webworker.importscripts.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,uBAAuB,GAAG,EAGtC,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.js b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.js new file mode 100644 index 000000000..7d53aed19 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.js @@ -0,0 +1,2475 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +exports.webworker = void 0; +exports.webworker = { + AddEventListenerOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AddEventListenerOptions', + }, + AesCbcParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AesCbcParams', + }, + AesCtrParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AesCtrParams', + }, + AesDerivedKeyParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AesDerivedKeyParams', + }, + AesGcmParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AesGcmParams', + }, + AesKeyAlgorithm: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AesKeyAlgorithm', + }, + AesKeyGenParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AesKeyGenParams', + }, + Algorithm: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Algorithm', + }, + BlobPropertyBag: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BlobPropertyBag', + }, + CacheQueryOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CacheQueryOptions', + }, + CanvasRenderingContext2DSettings: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasRenderingContext2DSettings', + }, + ClientQueryOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ClientQueryOptions', + }, + CloseEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CloseEventInit', + }, + CryptoKeyPair: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CryptoKeyPair', + }, + CustomEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CustomEventInit', + }, + DOMMatrix2DInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DOMMatrix2DInit', + }, + DOMMatrixInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DOMMatrixInit', + }, + DOMPointInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DOMPointInit', + }, + DOMQuadInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DOMQuadInit', + }, + DOMRectInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DOMRectInit', + }, + DevicePermissionDescriptor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DevicePermissionDescriptor', + }, + EcKeyGenParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EcKeyGenParams', + }, + EcKeyImportParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EcKeyImportParams', + }, + EcdhKeyDeriveParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EcdhKeyDeriveParams', + }, + EcdsaParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EcdsaParams', + }, + ErrorEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ErrorEventInit', + }, + EventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EventInit', + }, + EventListenerOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EventListenerOptions', + }, + EventSourceInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EventSourceInit', + }, + ExtendableEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ExtendableEventInit', + }, + ExtendableMessageEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ExtendableMessageEventInit', + }, + FetchEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'FetchEventInit', + }, + FilePropertyBag: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'FilePropertyBag', + }, + GetNotificationOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GetNotificationOptions', + }, + HmacImportParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HmacImportParams', + }, + HmacKeyGenParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HmacKeyGenParams', + }, + IDBIndexParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBIndexParameters', + }, + IDBObjectStoreParameters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBObjectStoreParameters', + }, + IDBVersionChangeEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBVersionChangeEventInit', + }, + ImageBitmapOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ImageBitmapOptions', + }, + ImageBitmapRenderingContextSettings: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ImageBitmapRenderingContextSettings', + }, + ImageEncodeOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ImageEncodeOptions', + }, + JsonWebKey: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'JsonWebKey', + }, + KeyAlgorithm: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'KeyAlgorithm', + }, + MessageEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MessageEventInit', + }, + MidiPermissionDescriptor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MidiPermissionDescriptor', + }, + MultiCacheQueryOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MultiCacheQueryOptions', + }, + NavigationPreloadState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NavigationPreloadState', + }, + NotificationAction: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NotificationAction', + }, + NotificationEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NotificationEventInit', + }, + NotificationOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NotificationOptions', + }, + Pbkdf2Params: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Pbkdf2Params', + }, + PerformanceObserverInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PerformanceObserverInit', + }, + PermissionDescriptor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PermissionDescriptor', + }, + PipeOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PipeOptions', + }, + PostMessageOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PostMessageOptions', + }, + ProgressEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ProgressEventInit', + }, + PromiseRejectionEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PromiseRejectionEventInit', + }, + PushEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PushEventInit', + }, + PushPermissionDescriptor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PushPermissionDescriptor', + }, + PushSubscriptionChangeEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PushSubscriptionChangeEventInit', + }, + PushSubscriptionJSON: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PushSubscriptionJSON', + }, + PushSubscriptionOptionsInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PushSubscriptionOptionsInit', + }, + QueuingStrategy: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'QueuingStrategy', + }, + ReadableStreamReadDoneResult: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadableStreamReadDoneResult', + }, + ReadableStreamReadValueResult: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadableStreamReadValueResult', + }, + RegistrationOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RegistrationOptions', + }, + RequestInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RequestInit', + }, + ResponseInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ResponseInit', + }, + RsaHashedImportParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RsaHashedImportParams', + }, + RsaHashedKeyGenParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RsaHashedKeyGenParams', + }, + RsaKeyGenParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RsaKeyGenParams', + }, + RsaOaepParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RsaOaepParams', + }, + RsaOtherPrimesInfo: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RsaOtherPrimesInfo', + }, + RsaPssParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RsaPssParams', + }, + StorageEstimate: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'StorageEstimate', + }, + SyncEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SyncEventInit', + }, + TextDecodeOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TextDecodeOptions', + }, + TextDecoderOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TextDecoderOptions', + }, + TextEncoderEncodeIntoResult: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TextEncoderEncodeIntoResult', + }, + Transformer: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Transformer', + }, + UnderlyingByteSource: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'UnderlyingByteSource', + }, + UnderlyingSink: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'UnderlyingSink', + }, + UnderlyingSource: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'UnderlyingSource', + }, + WebGLContextAttributes: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WebGLContextAttributes', + }, + WebGLContextEventInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WebGLContextEventInit', + }, + WorkerOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WorkerOptions', + }, + EventListener: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EventListener', + }, + ANGLE_instanced_arrays: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ANGLE_instanced_arrays', + }, + AbortController: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AbortController', + }, + AbortSignalEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AbortSignalEventMap', + }, + AbortSignal: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'AbortSignal', + }, + AbstractWorkerEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AbstractWorkerEventMap', + }, + AbstractWorker: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AbstractWorker', + }, + AesCfbParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AesCfbParams', + }, + AesCmacParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AesCmacParams', + }, + AnimationFrameProvider: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AnimationFrameProvider', + }, + Blob: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Blob', + }, + Body: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Body', + }, + BroadcastChannelEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BroadcastChannelEventMap', + }, + BroadcastChannel: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'BroadcastChannel', + }, + ByteLengthQueuingStrategy: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ByteLengthQueuingStrategy', + }, + Cache: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Cache', + }, + CacheStorage: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CacheStorage', + }, + CanvasCompositing: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasCompositing', + }, + CanvasDrawImage: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasDrawImage', + }, + CanvasDrawPath: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasDrawPath', + }, + CanvasFillStrokeStyles: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasFillStrokeStyles', + }, + CanvasFilters: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasFilters', + }, + CanvasGradient: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CanvasGradient', + }, + CanvasImageData: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasImageData', + }, + CanvasImageSmoothing: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasImageSmoothing', + }, + CanvasPath: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasPath', + }, + CanvasPathDrawingStyles: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasPathDrawingStyles', + }, + CanvasPattern: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CanvasPattern', + }, + CanvasRect: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasRect', + }, + CanvasShadowStyles: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasShadowStyles', + }, + CanvasState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasState', + }, + CanvasText: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasText', + }, + CanvasTextDrawingStyles: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasTextDrawingStyles', + }, + CanvasTransform: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasTransform', + }, + Client: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Client', + }, + Clients: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Clients', + }, + CloseEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CloseEvent', + }, + ConcatParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ConcatParams', + }, + CountQueuingStrategy: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CountQueuingStrategy', + }, + Crypto: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Crypto', + }, + CryptoKey: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CryptoKey', + }, + CustomEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'CustomEvent', + }, + DOMException: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMException', + }, + DOMMatrix: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMMatrix', + }, + DOMMatrixReadOnly: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMMatrixReadOnly', + }, + DOMPoint: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMPoint', + }, + DOMPointReadOnly: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMPointReadOnly', + }, + DOMQuad: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMQuad', + }, + DOMRect: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMRect', + }, + DOMRectReadOnly: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMRectReadOnly', + }, + DOMStringList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DOMStringList', + }, + DedicatedWorkerGlobalScopeEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DedicatedWorkerGlobalScopeEventMap', + }, + DedicatedWorkerGlobalScope: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'DedicatedWorkerGlobalScope', + }, + DhImportKeyParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DhImportKeyParams', + }, + DhKeyAlgorithm: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DhKeyAlgorithm', + }, + DhKeyDeriveParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DhKeyDeriveParams', + }, + DhKeyGenParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DhKeyGenParams', + }, + EXT_blend_minmax: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EXT_blend_minmax', + }, + EXT_frag_depth: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EXT_frag_depth', + }, + EXT_sRGB: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EXT_sRGB', + }, + EXT_shader_texture_lod: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EXT_shader_texture_lod', + }, + EXT_texture_filter_anisotropic: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EXT_texture_filter_anisotropic', + }, + ErrorEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ErrorEvent', + }, + Event: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Event', + }, + EventListenerObject: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EventListenerObject', + }, + EventSourceEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EventSourceEventMap', + }, + EventSource: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'EventSource', + }, + EventTarget: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'EventTarget', + }, + ExtendableEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ExtendableEvent', + }, + ExtendableMessageEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ExtendableMessageEvent', + }, + FetchEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'FetchEvent', + }, + File: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'File', + }, + FileList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'FileList', + }, + FileReaderEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'FileReaderEventMap', + }, + FileReader: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'FileReader', + }, + FileReaderSync: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'FileReaderSync', + }, + FormData: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'FormData', + }, + GenericTransformStream: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GenericTransformStream', + }, + Headers: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Headers', + }, + HkdfCtrParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HkdfCtrParams', + }, + IDBArrayKey: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBArrayKey', + }, + IDBCursor: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IDBCursor', + }, + IDBCursorWithValue: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IDBCursorWithValue', + }, + IDBDatabaseEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBDatabaseEventMap', + }, + IDBDatabase: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IDBDatabase', + }, + IDBFactory: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IDBFactory', + }, + IDBIndex: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IDBIndex', + }, + IDBKeyRange: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IDBKeyRange', + }, + IDBObjectStore: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IDBObjectStore', + }, + IDBOpenDBRequestEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBOpenDBRequestEventMap', + }, + IDBOpenDBRequest: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IDBOpenDBRequest', + }, + IDBRequestEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBRequestEventMap', + }, + IDBRequest: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IDBRequest', + }, + IDBTransactionEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBTransactionEventMap', + }, + IDBTransaction: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IDBTransaction', + }, + IDBVersionChangeEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'IDBVersionChangeEvent', + }, + ImageBitmap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ImageBitmap', + }, + ImageBitmapRenderingContext: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ImageBitmapRenderingContext', + }, + ImageData: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ImageData', + }, + MessageChannel: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MessageChannel', + }, + MessageEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MessageEvent', + }, + MessagePortEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MessagePortEventMap', + }, + MessagePort: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'MessagePort', + }, + NavigationPreloadManager: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'NavigationPreloadManager', + }, + NavigatorConcurrentHardware: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NavigatorConcurrentHardware', + }, + NavigatorID: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NavigatorID', + }, + NavigatorLanguage: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NavigatorLanguage', + }, + NavigatorOnLine: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NavigatorOnLine', + }, + NavigatorStorage: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NavigatorStorage', + }, + NotificationEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NotificationEventMap', + }, + Notification: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Notification', + }, + NotificationEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'NotificationEvent', + }, + OES_element_index_uint: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OES_element_index_uint', + }, + OES_standard_derivatives: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OES_standard_derivatives', + }, + OES_texture_float: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OES_texture_float', + }, + OES_texture_float_linear: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OES_texture_float_linear', + }, + OES_texture_half_float: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OES_texture_half_float', + }, + OES_texture_half_float_linear: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OES_texture_half_float_linear', + }, + OES_vertex_array_object: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OES_vertex_array_object', + }, + OffscreenCanvas: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'OffscreenCanvas', + }, + OffscreenCanvasRenderingContext2D: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'OffscreenCanvasRenderingContext2D', + }, + Path2D: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Path2D', + }, + PerformanceEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PerformanceEventMap', + }, + Performance: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Performance', + }, + PerformanceEntry: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PerformanceEntry', + }, + PerformanceMark: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PerformanceMark', + }, + PerformanceMeasure: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PerformanceMeasure', + }, + PerformanceObserver: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PerformanceObserver', + }, + PerformanceObserverEntryList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PerformanceObserverEntryList', + }, + PerformanceResourceTiming: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PerformanceResourceTiming', + }, + PermissionStatusEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PermissionStatusEventMap', + }, + PermissionStatus: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PermissionStatus', + }, + Permissions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Permissions', + }, + ProgressEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ProgressEvent', + }, + PromiseRejectionEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PromiseRejectionEvent', + }, + PushEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PushEvent', + }, + PushManager: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PushManager', + }, + PushMessageData: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PushMessageData', + }, + PushSubscription: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PushSubscription', + }, + PushSubscriptionChangeEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PushSubscriptionChangeEvent', + }, + PushSubscriptionOptions: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'PushSubscriptionOptions', + }, + ReadableByteStreamController: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadableByteStreamController', + }, + ReadableStream: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ReadableStream', + }, + ReadableStreamBYOBReader: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadableStreamBYOBReader', + }, + ReadableStreamBYOBRequest: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadableStreamBYOBRequest', + }, + ReadableStreamDefaultController: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadableStreamDefaultController', + }, + ReadableStreamDefaultReader: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadableStreamDefaultReader', + }, + ReadableStreamReader: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ReadableStreamReader', + }, + Request: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Request', + }, + Response: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Response', + }, + ServiceWorkerEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ServiceWorkerEventMap', + }, + ServiceWorker: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ServiceWorker', + }, + ServiceWorkerContainerEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ServiceWorkerContainerEventMap', + }, + ServiceWorkerContainer: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ServiceWorkerContainer', + }, + ServiceWorkerGlobalScopeEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ServiceWorkerGlobalScopeEventMap', + }, + ServiceWorkerGlobalScope: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ServiceWorkerGlobalScope', + }, + ServiceWorkerRegistrationEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ServiceWorkerRegistrationEventMap', + }, + ServiceWorkerRegistration: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'ServiceWorkerRegistration', + }, + SharedWorker: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SharedWorker', + }, + SharedWorkerGlobalScopeEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'SharedWorkerGlobalScopeEventMap', + }, + SharedWorkerGlobalScope: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SharedWorkerGlobalScope', + }, + StorageManager: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'StorageManager', + }, + SubtleCrypto: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SubtleCrypto', + }, + SyncEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SyncEvent', + }, + SyncManager: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'SyncManager', + }, + TextDecoder: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'TextDecoder', + }, + TextDecoderCommon: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TextDecoderCommon', + }, + TextDecoderStream: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'TextDecoderStream', + }, + TextEncoder: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'TextEncoder', + }, + TextEncoderCommon: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TextEncoderCommon', + }, + TextEncoderStream: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'TextEncoderStream', + }, + TextMetrics: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'TextMetrics', + }, + TransformStream: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'TransformStream', + }, + TransformStreamDefaultController: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TransformStreamDefaultController', + }, + URL: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'URL', + }, + URLSearchParams: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'URLSearchParams', + }, + WEBGL_color_buffer_float: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WEBGL_color_buffer_float', + }, + WEBGL_compressed_texture_astc: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WEBGL_compressed_texture_astc', + }, + WEBGL_compressed_texture_s3tc: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WEBGL_compressed_texture_s3tc', + }, + WEBGL_compressed_texture_s3tc_srgb: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WEBGL_compressed_texture_s3tc_srgb', + }, + WEBGL_debug_renderer_info: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WEBGL_debug_renderer_info', + }, + WEBGL_debug_shaders: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WEBGL_debug_shaders', + }, + WEBGL_depth_texture: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WEBGL_depth_texture', + }, + WEBGL_draw_buffers: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WEBGL_draw_buffers', + }, + WEBGL_lose_context: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WEBGL_lose_context', + }, + WebGL2RenderingContext: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGL2RenderingContext', + }, + WebGL2RenderingContextBase: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WebGL2RenderingContextBase', + }, + WebGL2RenderingContextOverloads: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WebGL2RenderingContextOverloads', + }, + WebGLActiveInfo: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLActiveInfo', + }, + WebGLBuffer: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLBuffer', + }, + WebGLContextEvent: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLContextEvent', + }, + WebGLFramebuffer: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLFramebuffer', + }, + WebGLObject: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLObject', + }, + WebGLProgram: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLProgram', + }, + WebGLQuery: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLQuery', + }, + WebGLRenderbuffer: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLRenderbuffer', + }, + WebGLRenderingContext: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLRenderingContext', + }, + WebGLRenderingContextBase: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WebGLRenderingContextBase', + }, + WebGLRenderingContextOverloads: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WebGLRenderingContextOverloads', + }, + WebGLSampler: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLSampler', + }, + WebGLShader: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLShader', + }, + WebGLShaderPrecisionFormat: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLShaderPrecisionFormat', + }, + WebGLSync: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLSync', + }, + WebGLTexture: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLTexture', + }, + WebGLTransformFeedback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLTransformFeedback', + }, + WebGLUniformLocation: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLUniformLocation', + }, + WebGLVertexArrayObject: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebGLVertexArrayObject', + }, + WebGLVertexArrayObjectOES: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WebGLVertexArrayObjectOES', + }, + WebSocketEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WebSocketEventMap', + }, + WebSocket: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebSocket', + }, + WindowClient: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WindowClient', + }, + WindowOrWorkerGlobalScope: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WindowOrWorkerGlobalScope', + }, + WorkerEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WorkerEventMap', + }, + Worker: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'Worker', + }, + WorkerGlobalScopeEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WorkerGlobalScopeEventMap', + }, + WorkerGlobalScope: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WorkerGlobalScope', + }, + WorkerLocation: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WorkerLocation', + }, + WorkerNavigator: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WorkerNavigator', + }, + WritableStream: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WritableStream', + }, + WritableStreamDefaultController: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WritableStreamDefaultController', + }, + WritableStreamDefaultWriter: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WritableStreamDefaultWriter', + }, + XMLHttpRequestEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'XMLHttpRequestEventMap', + }, + XMLHttpRequest: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'XMLHttpRequest', + }, + XMLHttpRequestEventTargetEventMap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'XMLHttpRequestEventTargetEventMap', + }, + XMLHttpRequestEventTarget: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'XMLHttpRequestEventTarget', + }, + XMLHttpRequestUpload: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'XMLHttpRequestUpload', + }, + EventListenerOrEventListenerObject: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EventListenerOrEventListenerObject', + }, + Console: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Console', + }, + WebAssembly: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + name: 'WebAssembly', + }, + FrameRequestCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'FrameRequestCallback', + }, + OnErrorEventHandlerNonNull: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OnErrorEventHandlerNonNull', + }, + PerformanceObserverCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PerformanceObserverCallback', + }, + QueuingStrategySizeCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'QueuingStrategySizeCallback', + }, + ReadableByteStreamControllerCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadableByteStreamControllerCallback', + }, + ReadableStreamDefaultControllerCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadableStreamDefaultControllerCallback', + }, + ReadableStreamErrorCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadableStreamErrorCallback', + }, + TransformStreamDefaultControllerCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TransformStreamDefaultControllerCallback', + }, + TransformStreamDefaultControllerTransformCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TransformStreamDefaultControllerTransformCallback', + }, + VoidFunction: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'VoidFunction', + }, + WritableStreamDefaultControllerCloseCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WritableStreamDefaultControllerCloseCallback', + }, + WritableStreamDefaultControllerStartCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WritableStreamDefaultControllerStartCallback', + }, + WritableStreamDefaultControllerWriteCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WritableStreamDefaultControllerWriteCallback', + }, + WritableStreamErrorCallback: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WritableStreamErrorCallback', + }, + HeadersInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HeadersInit', + }, + BodyInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BodyInit', + }, + RequestInfo: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RequestInfo', + }, + BlobPart: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BlobPart', + }, + DOMHighResTimeStamp: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DOMHighResTimeStamp', + }, + CanvasImageSource: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasImageSource', + }, + OffscreenRenderingContext: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OffscreenRenderingContext', + }, + MessageEventSource: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'MessageEventSource', + }, + ImageBitmapSource: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ImageBitmapSource', + }, + OnErrorEventHandler: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OnErrorEventHandler', + }, + TimerHandler: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TimerHandler', + }, + PerformanceEntryList: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PerformanceEntryList', + }, + PushMessageDataInit: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PushMessageDataInit', + }, + ReadableStreamReadResult: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReadableStreamReadResult', + }, + VibratePattern: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'VibratePattern', + }, + AlgorithmIdentifier: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'AlgorithmIdentifier', + }, + HashAlgorithmIdentifier: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'HashAlgorithmIdentifier', + }, + BigInteger: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BigInteger', + }, + NamedCurve: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NamedCurve', + }, + GLenum: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GLenum', + }, + GLboolean: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GLboolean', + }, + GLbitfield: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GLbitfield', + }, + GLint: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GLint', + }, + GLsizei: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GLsizei', + }, + GLintptr: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GLintptr', + }, + GLsizeiptr: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GLsizeiptr', + }, + GLuint: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GLuint', + }, + GLfloat: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GLfloat', + }, + GLclampf: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GLclampf', + }, + TexImageSource: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'TexImageSource', + }, + Float32List: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Float32List', + }, + Int32List: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Int32List', + }, + GLint64: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GLint64', + }, + GLuint64: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'GLuint64', + }, + Uint32List: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Uint32List', + }, + BufferSource: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BufferSource', + }, + DOMTimeStamp: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'DOMTimeStamp', + }, + FormDataEntryValue: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'FormDataEntryValue', + }, + IDBValidKey: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBValidKey', + }, + Transferable: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'Transferable', + }, + BinaryType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'BinaryType', + }, + CanvasDirection: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasDirection', + }, + CanvasFillRule: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasFillRule', + }, + CanvasLineCap: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasLineCap', + }, + CanvasLineJoin: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasLineJoin', + }, + CanvasTextAlign: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasTextAlign', + }, + CanvasTextBaseline: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'CanvasTextBaseline', + }, + ClientTypes: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ClientTypes', + }, + ColorSpaceConversion: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ColorSpaceConversion', + }, + EndingType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'EndingType', + }, + FrameType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'FrameType', + }, + IDBCursorDirection: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBCursorDirection', + }, + IDBRequestReadyState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBRequestReadyState', + }, + IDBTransactionMode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'IDBTransactionMode', + }, + ImageOrientation: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ImageOrientation', + }, + ImageSmoothingQuality: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ImageSmoothingQuality', + }, + KeyFormat: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'KeyFormat', + }, + KeyType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'KeyType', + }, + KeyUsage: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'KeyUsage', + }, + NotificationDirection: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NotificationDirection', + }, + NotificationPermission: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'NotificationPermission', + }, + OffscreenRenderingContextId: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'OffscreenRenderingContextId', + }, + PermissionName: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PermissionName', + }, + PermissionState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PermissionState', + }, + PremultiplyAlpha: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PremultiplyAlpha', + }, + PushEncryptionKeyName: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PushEncryptionKeyName', + }, + PushPermissionState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'PushPermissionState', + }, + ReferrerPolicy: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ReferrerPolicy', + }, + RequestCache: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RequestCache', + }, + RequestCredentials: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RequestCredentials', + }, + RequestDestination: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RequestDestination', + }, + RequestMode: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RequestMode', + }, + RequestRedirect: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'RequestRedirect', + }, + ResizeQuality: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ResizeQuality', + }, + ResponseType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ResponseType', + }, + ServiceWorkerState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ServiceWorkerState', + }, + ServiceWorkerUpdateViaCache: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'ServiceWorkerUpdateViaCache', + }, + VisibilityState: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'VisibilityState', + }, + WebGLPowerPreference: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WebGLPowerPreference', + }, + WorkerType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'WorkerType', + }, + XMLHttpRequestResponseType: { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + name: 'XMLHttpRequestResponseType', + }, +}; +//# sourceMappingURL=webworker.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.js.map b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.js.map new file mode 100644 index 000000000..56390fe3e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.js.map @@ -0,0 +1 @@ +{"version":3,"file":"webworker.js","sourceRoot":"","sources":["../../src/lib/webworker.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD;;;AAInC,QAAA,SAAS,GAAG;IACvB,uBAAuB,EAAE;QACvB,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,yBAAyB;KAChC;IACD,YAAY,EAAE;QACZ,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,cAAc;KACrB;IACD,YAAY,EAAE;QACZ,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACt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A2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,YAAY;KACnB;IACD,0BAA0B,EAAE;QAC1B,2BAA2B,EAAE,UAAU;QACvC,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE,4BAA4B;KACnC;CAC4C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.d.ts new file mode 100644 index 000000000..32e105dff --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.d.ts @@ -0,0 +1,15 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { Referencer } from './Referencer'; +import { Visitor } from './Visitor'; +declare type ExportNode = TSESTree.ExportAllDeclaration | TSESTree.ExportDefaultDeclaration | TSESTree.ExportNamedDeclaration; +declare class ExportVisitor extends Visitor { + #private; + constructor(node: ExportNode, referencer: Referencer); + static visit(referencer: Referencer, node: ExportNode): void; + protected Identifier(node: TSESTree.Identifier): void; + protected ExportDefaultDeclaration(node: TSESTree.ExportDefaultDeclaration): void; + protected ExportNamedDeclaration(node: TSESTree.ExportNamedDeclaration): void; + protected ExportSpecifier(node: TSESTree.ExportSpecifier): void; +} +export { ExportVisitor }; +//# sourceMappingURL=ExportVisitor.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.d.ts.map new file mode 100644 index 000000000..8d04119ee --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ExportVisitor.d.ts","sourceRoot":"","sources":["../../src/referencer/ExportVisitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,aAAK,UAAU,GACX,QAAQ,CAAC,oBAAoB,GAC7B,QAAQ,CAAC,wBAAwB,GACjC,QAAQ,CAAC,sBAAsB,CAAC;AAEpC,cAAM,aAAc,SAAQ,OAAO;;gBAIrB,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAMpD,MAAM,CAAC,KAAK,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI;IAK5D,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,GAAG,IAAI;IASrD,SAAS,CAAC,wBAAwB,CAChC,IAAI,EAAE,QAAQ,CAAC,wBAAwB,GACtC,IAAI;IAaP,SAAS,CAAC,sBAAsB,CAC9B,IAAI,EAAE,QAAQ,CAAC,sBAAsB,GACpC,IAAI;IAgBP,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,eAAe,GAAG,IAAI;CAGhE;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.js b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.js new file mode 100644 index 000000000..67c77246e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.js @@ -0,0 +1,75 @@ +"use strict"; +var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; +}; +var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); +}; +var _referencer, _exportNode; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExportVisitor = void 0; +const types_1 = require("@typescript-eslint/types"); +const Visitor_1 = require("./Visitor"); +class ExportVisitor extends Visitor_1.Visitor { + constructor(node, referencer) { + super(referencer); + _referencer.set(this, void 0); + _exportNode.set(this, void 0); + __classPrivateFieldSet(this, _exportNode, node); + __classPrivateFieldSet(this, _referencer, referencer); + } + static visit(referencer, node) { + const exportReferencer = new ExportVisitor(node, referencer); + exportReferencer.visit(node); + } + Identifier(node) { + if (__classPrivateFieldGet(this, _exportNode).exportKind === 'type') { + // type exports can only reference types + __classPrivateFieldGet(this, _referencer).currentScope().referenceType(node); + } + else { + __classPrivateFieldGet(this, _referencer).currentScope().referenceDualValueType(node); + } + } + ExportDefaultDeclaration(node) { + if (node.declaration.type === types_1.AST_NODE_TYPES.Identifier) { + // export default A; + // this could be a type or a variable + this.visit(node.declaration); + } + else { + // export const a = 1; + // export something(); + // etc + // these not included in the scope of this visitor as they are all guaranteed to be values or declare variables + } + } + ExportNamedDeclaration(node) { + if (node.source) { + // export ... from 'foo'; + // these are external identifiers so there shouldn't be references or defs + return; + } + if (!node.declaration) { + // export { x }; + this.visitChildren(node); + } + else { + // export const x = 1; + // this is not included in the scope of this visitor as it creates a variable + } + } + ExportSpecifier(node) { + this.visit(node.local); + } +} +exports.ExportVisitor = ExportVisitor; +_referencer = new WeakMap(), _exportNode = new WeakMap(); +//# sourceMappingURL=ExportVisitor.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.js.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.js.map new file mode 100644 index 000000000..607277429 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ExportVisitor.js","sourceRoot":"","sources":["../../src/referencer/ExportVisitor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oDAAoE;AAEpE,uCAAoC;AAOp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C,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;CACF;AAEQ,sCAAa"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.d.ts new file mode 100644 index 000000000..dbad76685 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.d.ts @@ -0,0 +1,14 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { Referencer } from './Referencer'; +import { Visitor } from './Visitor'; +declare class ImportVisitor extends Visitor { + #private; + constructor(declaration: TSESTree.ImportDeclaration, referencer: Referencer); + static visit(referencer: Referencer, declaration: TSESTree.ImportDeclaration): void; + protected visitImport(id: TSESTree.Identifier, specifier: TSESTree.ImportDefaultSpecifier | TSESTree.ImportNamespaceSpecifier | TSESTree.ImportSpecifier): void; + protected ImportNamespaceSpecifier(node: TSESTree.ImportNamespaceSpecifier): void; + protected ImportDefaultSpecifier(node: TSESTree.ImportDefaultSpecifier): void; + protected ImportSpecifier(node: TSESTree.ImportSpecifier): void; +} +export { ImportVisitor }; +//# sourceMappingURL=ImportVisitor.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.d.ts.map new file mode 100644 index 000000000..87f59ff57 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ImportVisitor.d.ts","sourceRoot":"","sources":["../../src/referencer/ImportVisitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,cAAM,aAAc,SAAQ,OAAO;;gBAIrB,WAAW,EAAE,QAAQ,CAAC,iBAAiB,EAAE,UAAU,EAAE,UAAU;IAM3E,MAAM,CAAC,KAAK,CACV,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,QAAQ,CAAC,iBAAiB,GACtC,IAAI;IAKP,SAAS,CAAC,WAAW,CACnB,EAAE,EAAE,QAAQ,CAAC,UAAU,EACvB,SAAS,EACL,QAAQ,CAAC,sBAAsB,GAC/B,QAAQ,CAAC,wBAAwB,GACjC,QAAQ,CAAC,eAAe,GAC3B,IAAI;IASP,SAAS,CAAC,wBAAwB,CAChC,IAAI,EAAE,QAAQ,CAAC,wBAAwB,GACtC,IAAI;IAKP,SAAS,CAAC,sBAAsB,CAC9B,IAAI,EAAE,QAAQ,CAAC,sBAAsB,GACpC,IAAI;IAKP,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,eAAe,GAAG,IAAI;CAIhE;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.js b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.js new file mode 100644 index 000000000..dcc08d6b9 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.js @@ -0,0 +1,51 @@ +"use strict"; +var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; +}; +var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); +}; +var _declaration, _referencer; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ImportVisitor = void 0; +const definition_1 = require("../definition"); +const Visitor_1 = require("./Visitor"); +class ImportVisitor extends Visitor_1.Visitor { + constructor(declaration, referencer) { + super(referencer); + _declaration.set(this, void 0); + _referencer.set(this, void 0); + __classPrivateFieldSet(this, _declaration, declaration); + __classPrivateFieldSet(this, _referencer, referencer); + } + static visit(referencer, declaration) { + const importReferencer = new ImportVisitor(declaration, referencer); + importReferencer.visit(declaration); + } + visitImport(id, specifier) { + __classPrivateFieldGet(this, _referencer).currentScope() + .defineIdentifier(id, new definition_1.ImportBindingDefinition(id, specifier, __classPrivateFieldGet(this, _declaration))); + } + ImportNamespaceSpecifier(node) { + const local = node.local; + this.visitImport(local, node); + } + ImportDefaultSpecifier(node) { + const local = node.local; + this.visitImport(local, node); + } + ImportSpecifier(node) { + const local = node.local; + this.visitImport(local, node); + } +} +exports.ImportVisitor = ImportVisitor; +_declaration = new WeakMap(), _referencer = new WeakMap(); +//# sourceMappingURL=ImportVisitor.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.js.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.js.map new file mode 100644 index 000000000..220a7c856 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ImportVisitor.js","sourceRoot":"","sources":["../../src/referencer/ImportVisitor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,8CAAwD;AAExD,uCAAoC;AAEpC,MAAM,aAAc,SAAQ,iBAAO;IAIjC,YAAY,WAAuC,EAAE,UAAsB;QACzE,KAAK,CAAC,UAAU,CAAC,CAAC;QAJpB,+BAAkD;QAClD,8BAAiC;QAI/B,uBAAA,IAAI,gBAAgB,WAAW,EAAC;QAChC,uBAAA,IAAI,eAAe,UAAU,EAAC;IAChC,CAAC;IAED,MAAM,CAAC,KAAK,CACV,UAAsB,EACtB,WAAuC;QAEvC,MAAM,gBAAgB,GAAG,IAAI,aAAa,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QACpE,gBAAgB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IACtC,CAAC;IAES,WAAW,CACnB,EAAuB,EACvB,SAG4B;QAE5B,0CACG,YAAY,EAAE;aACd,gBAAgB,CACf,EAAE,EACF,IAAI,oCAAuB,CAAC,EAAE,EAAE,SAAS,6CAAoB,CAC9D,CAAC;IACN,CAAC;IAES,wBAAwB,CAChC,IAAuC;QAEvC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC;IAES,sBAAsB,CAC9B,IAAqC;QAErC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC;IAES,eAAe,CAAC,IAA8B;QACtD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC;CACF;AAEQ,sCAAa"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.d.ts new file mode 100644 index 000000000..1ab9b4309 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.d.ts @@ -0,0 +1,28 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { VisitorBase, VisitorOptions } from './Visitor'; +declare type PatternVisitorCallback = (pattern: TSESTree.Identifier, info: { + assignments: (TSESTree.AssignmentPattern | TSESTree.AssignmentExpression)[]; + rest: boolean; + topLevel: boolean; +}) => void; +declare type PatternVisitorOptions = VisitorOptions; +declare class PatternVisitor extends VisitorBase { + #private; + static isPattern(node: TSESTree.Node): node is TSESTree.Identifier | TSESTree.ObjectPattern | TSESTree.ArrayPattern | TSESTree.SpreadElement | TSESTree.RestElement | TSESTree.AssignmentPattern; + readonly rightHandNodes: TSESTree.Node[]; + constructor(options: PatternVisitorOptions, rootPattern: TSESTree.Node, callback: PatternVisitorCallback); + protected ArrayExpression(node: TSESTree.ArrayExpression): void; + protected ArrayPattern(pattern: TSESTree.ArrayPattern): void; + protected AssignmentExpression(node: TSESTree.AssignmentExpression): void; + protected AssignmentPattern(pattern: TSESTree.AssignmentPattern): void; + protected CallExpression(node: TSESTree.CallExpression): void; + protected Decorator(): void; + protected Identifier(pattern: TSESTree.Identifier): void; + protected MemberExpression(node: TSESTree.MemberExpression): void; + protected Property(property: TSESTree.Property): void; + protected RestElement(pattern: TSESTree.RestElement): void; + protected SpreadElement(node: TSESTree.SpreadElement): void; + protected TSTypeAnnotation(): void; +} +export { PatternVisitor, PatternVisitorCallback, PatternVisitorOptions }; +//# sourceMappingURL=PatternVisitor.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.d.ts.map new file mode 100644 index 000000000..2a559f944 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"PatternVisitor.d.ts","sourceRoot":"","sources":["../../src/referencer/PatternVisitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAExD,aAAK,sBAAsB,GAAG,CAC5B,OAAO,EAAE,QAAQ,CAAC,UAAU,EAC5B,IAAI,EAAE;IACJ,WAAW,EAAE,CAAC,QAAQ,CAAC,iBAAiB,GAAG,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAAC;IAC5E,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CACnB,KACE,IAAI,CAAC;AAEV,aAAK,qBAAqB,GAAG,cAAc,CAAC;AAC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I,IAAI;CAGnC;AAED,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.js b/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.js new file mode 100644 index 000000000..6e96a7bcd --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.js @@ -0,0 +1,113 @@ +"use strict"; +var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; +}; +var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); +}; +var _rootPattern, _callback, _assignments, _restElements; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PatternVisitor = void 0; +const types_1 = require("@typescript-eslint/types"); +const Visitor_1 = require("./Visitor"); +class PatternVisitor extends Visitor_1.VisitorBase { + constructor(options, rootPattern, callback) { + super(options); + _rootPattern.set(this, void 0); + _callback.set(this, void 0); + _assignments.set(this, []); + this.rightHandNodes = []; + _restElements.set(this, []); + __classPrivateFieldSet(this, _rootPattern, rootPattern); + __classPrivateFieldSet(this, _callback, callback); + } + static isPattern(node) { + const nodeType = node.type; + return (nodeType === types_1.AST_NODE_TYPES.Identifier || + nodeType === types_1.AST_NODE_TYPES.ObjectPattern || + nodeType === types_1.AST_NODE_TYPES.ArrayPattern || + nodeType === types_1.AST_NODE_TYPES.SpreadElement || + nodeType === types_1.AST_NODE_TYPES.RestElement || + nodeType === types_1.AST_NODE_TYPES.AssignmentPattern); + } + ArrayExpression(node) { + node.elements.forEach(this.visit, this); + } + ArrayPattern(pattern) { + for (const element of pattern.elements) { + this.visit(element); + } + } + AssignmentExpression(node) { + __classPrivateFieldGet(this, _assignments).push(node); + this.visit(node.left); + this.rightHandNodes.push(node.right); + __classPrivateFieldGet(this, _assignments).pop(); + } + AssignmentPattern(pattern) { + __classPrivateFieldGet(this, _assignments).push(pattern); + this.visit(pattern.left); + this.rightHandNodes.push(pattern.right); + __classPrivateFieldGet(this, _assignments).pop(); + } + CallExpression(node) { + // arguments are right hand nodes. + node.arguments.forEach(a => { + this.rightHandNodes.push(a); + }); + this.visit(node.callee); + } + Decorator() { + // don't visit any decorators when exploring a pattern + } + Identifier(pattern) { + var _a; + const lastRestElement = (_a = __classPrivateFieldGet(this, _restElements)[__classPrivateFieldGet(this, _restElements).length - 1]) !== null && _a !== void 0 ? _a : null; + __classPrivateFieldGet(this, _callback).call(this, pattern, { + topLevel: pattern === __classPrivateFieldGet(this, _rootPattern), + rest: lastRestElement !== null && + lastRestElement !== undefined && + lastRestElement.argument === pattern, + assignments: __classPrivateFieldGet(this, _assignments), + }); + } + MemberExpression(node) { + // Computed property's key is a right hand node. + if (node.computed) { + this.rightHandNodes.push(node.property); + } + // the object is only read, write to its property. + this.rightHandNodes.push(node.object); + } + Property(property) { + // Computed property's key is a right hand node. + if (property.computed) { + this.rightHandNodes.push(property.key); + } + // If it's shorthand, its key is same as its value. + // If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern). + // If it's not shorthand, the name of new variable is its value's. + this.visit(property.value); + } + RestElement(pattern) { + __classPrivateFieldGet(this, _restElements).push(pattern); + this.visit(pattern.argument); + __classPrivateFieldGet(this, _restElements).pop(); + } + SpreadElement(node) { + this.visit(node.argument); + } + TSTypeAnnotation() { + // we don't want to visit types + } +} +exports.PatternVisitor = PatternVisitor; +_rootPattern = new WeakMap(), _callback = new WeakMap(), _assignments = new WeakMap(), _restElements = new WeakMap(); +//# sourceMappingURL=PatternVisitor.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.js.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.js.map new file mode 100644 index 000000000..e4c57bdf9 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"PatternVisitor.js","sourceRoot":"","sources":["../../src/referencer/PatternVisitor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oDAAoE;AACpE,uCAAwD;AAYxD,MAAM,cAAe,SAAQ,qBAAW;IA+BtC,YACE,OAA8B,EAC9B,WAA0B,EAC1B,QAAgC;QAEhC,KAAK,CAAC,OAAO,CAAC,CAAC;QAdjB,+BAAqC;QACrC,4BAA2C;QAC3C,uBAGM,EAAE,EAAC;QACO,mBAAc,GAAoB,EAAE,CAAC;QACrD,wBAAiD,EAAE,EAAC;QAQlD,uBAAA,IAAI,gBAAgB,WAAW,EAAC;QAChC,uBAAA,IAAI,aAAa,QAAQ,EAAC;IAC5B,CAAC;IAtCM,MAAM,CAAC,SAAS,CACrB,IAAmB;QAQnB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;QAE3B,OAAO,CACL,QAAQ,KAAK,sBAAc,CAAC,UAAU;YACtC,QAAQ,KAAK,sBAAc,CAAC,aAAa;YACzC,QAAQ,KAAK,sBAAc,CAAC,YAAY;YACxC,QAAQ,KAAK,sBAAc,CAAC,aAAa;YACzC,QAAQ,KAAK,sBAAc,CAAC,WAAW;YACvC,QAAQ,KAAK,sBAAc,CAAC,iBAAiB,CAC9C,CAAC;IACJ,CAAC;IAqBS,eAAe,CAAC,IAA8B;QACtD,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC;IAES,YAAY,CAAC,OAA8B;QACnD,KAAK,MAAM,OAAO,IAAI,OAAO,CAAC,QAAQ,EAAE;YACtC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;SACrB;IACH,CAAC;IAES,oBAAoB,CAAC,IAAmC;QAChE,2CAAkB,IAAI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;SACzC;QAED,kDAAkD;QAClD,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IAES,QAAQ,CAAC,QAA2B;QAC5C,gDAAgD;QAChD,IAAI,QAAQ,CAAC,QAAQ,EAAE;YACrB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;SACxC;QAED,mDAAmD;QACnD,mHAAmH;QACnH,kEAAkE;QAClE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IAES,WAAW,CAAC,OAA6B;QACjD,4CAAmB,IAAI,CAAC,OAAO,CAAC,CAAC;QACjC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC7B,4CAAmB,GAAG,EAAE,CAAC;IAC3B,CAAC;IAES,aAAa,CAAC,IAA4B;QAClD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC;IAES,gBAAgB;QACxB,+BAA+B;IACjC,CAAC;CACF;AAEQ,wCAAc"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.d.ts new file mode 100644 index 000000000..306cd8420 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.d.ts @@ -0,0 +1,89 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { Scope } from '../scope'; +import { Variable } from '../variable'; +declare enum ReferenceFlag { + Read = 1, + Write = 2, + ReadWrite = 3 +} +interface ReferenceImplicitGlobal { + node: TSESTree.Node; + pattern: TSESTree.BindingName; + ref?: Reference; +} +declare enum ReferenceTypeFlag { + Value = 1, + Type = 2 +} +/** + * A Reference represents a single occurrence of an identifier in code. + */ +declare class Reference { + #private; + /** + * A unique ID for this instance - primarily used to help debugging and testing + */ + readonly $id: number; + /** + * Reference to the enclosing Scope. + * @public + */ + readonly from: Scope; + /** + * Identifier syntax node. + * @public + */ + readonly identifier: TSESTree.Identifier | TSESTree.JSXIdentifier; + /** + * `true` if this writing reference is a variable initializer or a default value. + * @public + */ + readonly init?: boolean; + /** + * The {@link Variable} object that this reference refers to. If such variable was not defined, this is `null`. + * @public + */ + resolved: Variable | null; + /** + * If reference is writeable, this is the node being written to it. + * @public + */ + readonly writeExpr?: TSESTree.Node | null; + readonly maybeImplicitGlobal?: ReferenceImplicitGlobal | null; + /** + * True if this reference can reference types + */ + get isTypeReference(): boolean; + /** + * True if this reference can reference values + */ + get isValueReference(): boolean; + constructor(identifier: TSESTree.Identifier | TSESTree.JSXIdentifier, scope: Scope, flag: ReferenceFlag, writeExpr?: TSESTree.Node | null, maybeImplicitGlobal?: ReferenceImplicitGlobal | null, init?: boolean, referenceType?: ReferenceTypeFlag); + /** + * Whether the reference is writeable. + * @public + */ + isWrite(): boolean; + /** + * Whether the reference is readable. + * @public + */ + isRead(): boolean; + /** + * Whether the reference is read-only. + * @public + */ + isReadOnly(): boolean; + /** + * Whether the reference is write-only. + * @public + */ + isWriteOnly(): boolean; + /** + * Whether the reference is read-write. + * @public + */ + isReadWrite(): boolean; +} +export { Reference, ReferenceFlag, ReferenceTypeFlag, ReferenceImplicitGlobal }; +//# sourceMappingURL=Reference.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.d.ts.map new file mode 100644 index 000000000..b5dc6c6d3 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Reference.d.ts","sourceRoot":"","sources":["../../src/referencer/Reference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC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G;IACI,MAAM,IAAI,OAAO;IAIxB;;;OAGG;IACI,UAAU,IAAI,OAAO;IAI5B;;;OAGG;IACI,WAAW,IAAI,OAAO;IAI7B;;;OAGG;IACI,WAAW,IAAI,OAAO;CAG9B;AAED,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.js b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.js new file mode 100644 index 000000000..31bd82893 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.js @@ -0,0 +1,111 @@ +"use strict"; +var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; +}; +var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); +}; +var _flag, _referenceType; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ReferenceTypeFlag = exports.ReferenceFlag = exports.Reference = void 0; +const ID_1 = require("../ID"); +var ReferenceFlag; +(function (ReferenceFlag) { + ReferenceFlag[ReferenceFlag["Read"] = 1] = "Read"; + ReferenceFlag[ReferenceFlag["Write"] = 2] = "Write"; + ReferenceFlag[ReferenceFlag["ReadWrite"] = 3] = "ReadWrite"; +})(ReferenceFlag || (ReferenceFlag = {})); +exports.ReferenceFlag = ReferenceFlag; +const generator = ID_1.createIdGenerator(); +var ReferenceTypeFlag; +(function (ReferenceTypeFlag) { + ReferenceTypeFlag[ReferenceTypeFlag["Value"] = 1] = "Value"; + ReferenceTypeFlag[ReferenceTypeFlag["Type"] = 2] = "Type"; +})(ReferenceTypeFlag || (ReferenceTypeFlag = {})); +exports.ReferenceTypeFlag = ReferenceTypeFlag; +/** + * A Reference represents a single occurrence of an identifier in code. + */ +class Reference { + constructor(identifier, scope, flag, writeExpr, maybeImplicitGlobal, init, referenceType = ReferenceTypeFlag.Value) { + /** + * A unique ID for this instance - primarily used to help debugging and testing + */ + this.$id = generator(); + /** + * The read-write mode of the reference. + */ + _flag.set(this, void 0); + /** + * In some cases, a reference may be a type, value or both a type and value reference. + */ + _referenceType.set(this, void 0); + this.identifier = identifier; + this.from = scope; + this.resolved = null; + __classPrivateFieldSet(this, _flag, flag); + if (this.isWrite()) { + this.writeExpr = writeExpr; + this.init = init; + } + this.maybeImplicitGlobal = maybeImplicitGlobal; + __classPrivateFieldSet(this, _referenceType, referenceType); + } + /** + * True if this reference can reference types + */ + get isTypeReference() { + return (__classPrivateFieldGet(this, _referenceType) & ReferenceTypeFlag.Type) !== 0; + } + /** + * True if this reference can reference values + */ + get isValueReference() { + return (__classPrivateFieldGet(this, _referenceType) & ReferenceTypeFlag.Value) !== 0; + } + /** + * Whether the reference is writeable. + * @public + */ + isWrite() { + return !!(__classPrivateFieldGet(this, _flag) & ReferenceFlag.Write); + } + /** + * Whether the reference is readable. + * @public + */ + isRead() { + return !!(__classPrivateFieldGet(this, _flag) & ReferenceFlag.Read); + } + /** + * Whether the reference is read-only. + * @public + */ + isReadOnly() { + return __classPrivateFieldGet(this, _flag) === ReferenceFlag.Read; + } + /** + * Whether the reference is write-only. + * @public + */ + isWriteOnly() { + return __classPrivateFieldGet(this, _flag) === ReferenceFlag.Write; + } + /** + * Whether the reference is read-write. + * @public + */ + isReadWrite() { + return __classPrivateFieldGet(this, _flag) === ReferenceFlag.ReadWrite; + } +} +exports.Reference = Reference; +_flag = new WeakMap(), _referenceType = new WeakMap(); +//# sourceMappingURL=Reference.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.js.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.js.map new file mode 100644 index 000000000..159218251 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Reference.js","sourceRoot":"","sources":["../../src/referencer/Reference.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,8BAA0C;AAI1C,IAAK,aAIJ;AAJD,WAAK,aAAa;IAChB,iDAAU,CAAA;IACV,mDAAW,CAAA;IACX,2DAAe,CAAA;AACjB,CAAC,EAJI,aAAa,KAAb,aAAa,QAIjB;AA0ImB,sCAAa;AAlIjC,MAAM,SAAS,GAAG,sBAAiB,EAAE,CAAC;AAEtC,IAAK,iBAGJ;AAHD,WAAK,iBAAiB;IACpB,2DAAW,CAAA;IACX,yDAAU,CAAA;AACZ,CAAC,EAHI,iBAAiB,KAAjB,iBAAiB,QAGrB;AA6HkC,8CAAiB;AA3HpD;;GAEG;AACH,MAAM,SAAS;IAwDb,YACE,UAAwD,EACxD,KAAY,EACZ,IAAmB,EACnB,SAAgC,EAChC,mBAAoD,EACpD,IAAc,EACd,aAAa,GAAG,iBAAiB,CAAC,KAAK;QA9DzC;;WAEG;QACa,QAAG,GAAW,SAAS,EAAE,CAAC;QAC1C;;WAEG;QACH,wBAA8B;QA6B9B;;WAEG;QACH,iCAA2C;QAyBzC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,uBAAA,IAAI,SAAS,IAAI,EAAC;QAElB,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE;YAClB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;YAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;SAClB;QAED,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;QAC/C,uBAAA,IAAI,kBAAkB,aAAa,EAAC;IACtC,CAAC;IAnCD;;OAEG;IACH,IAAW,eAAe;QACxB,OAAO,CAAC,+CAAsB,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACH,IAAW,gBAAgB;QACzB,OAAO,CAAC,+CAAsB,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC/D,CAAC;IAyBD;;;OAGG;IACI,OAAO;QACZ,OAAO,CAAC,CAAC,CAAC,sCAAa,aAAa,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED;;;OAGG;IACI,MAAM;QACX,OAAO,CAAC,CAAC,CAAC,sCAAa,aAAa,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACI,UAAU;QACf,OAAO,wCAAe,aAAa,CAAC,IAAI,CAAC;IAC3C,CAAC;IAED;;;OAGG;IACI,WAAW;QAChB,OAAO,wCAAe,aAAa,CAAC,KAAK,CAAC;IAC5C,CAAC;IAED;;;OAGG;IACI,WAAW;QAChB,OAAO,wCAAe,aAAa,CAAC,SAAS,CAAC;IAChD,CAAC;CACF;AAEQ,8BAAS"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts new file mode 100644 index 000000000..86346bc3a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts @@ -0,0 +1,87 @@ +import { Lib, TSESTree } from '@typescript-eslint/types'; +import { ReferenceImplicitGlobal } from './Reference'; +import { ScopeManager } from '../ScopeManager'; +import { Visitor, VisitorOptions } from './Visitor'; +import { Scope } from '../scope'; +interface ReferencerOptions extends VisitorOptions { + jsxPragma: string; + jsxFragmentName: string | null; + lib: Lib[]; +} +declare class Referencer extends Visitor { + #private; + readonly scopeManager: ScopeManager; + constructor(options: ReferencerOptions, scopeManager: ScopeManager); + currentScope(): Scope; + currentScope(throwOnNull: true): Scope | null; + close(node: TSESTree.Node): void; + protected pushInnerMethodDefinition(isInnerMethodDefinition: boolean): boolean; + protected popInnerMethodDefinition(isInnerMethodDefinition: boolean | undefined): void; + protected referencingDefaultValue(pattern: TSESTree.Identifier, assignments: (TSESTree.AssignmentExpression | TSESTree.AssignmentPattern)[], maybeImplicitGlobal: ReferenceImplicitGlobal | null, init: boolean): void; + private populateGlobalsFromLib; + /** + * Searches for a variable named "name" in the upper scopes and adds a pseudo-reference from itself to itself + */ + private referenceInSomeUpperScope; + private referenceJsxPragma; + private referenceJsxFragment; + protected visitClass(node: TSESTree.ClassDeclaration | TSESTree.ClassExpression): void; + protected visitClassProperty(node: TSESTree.TSAbstractClassProperty | TSESTree.ClassProperty): void; + protected visitForIn(node: TSESTree.ForInStatement | TSESTree.ForOfStatement): void; + protected visitFunctionParameterTypeAnnotation(node: TSESTree.Parameter): void; + protected visitFunction(node: TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.TSDeclareFunction | TSESTree.TSEmptyBodyFunctionExpression): void; + protected visitProperty(node: TSESTree.ClassProperty | TSESTree.MethodDefinition | TSESTree.Property | TSESTree.TSAbstractClassProperty | TSESTree.TSAbstractMethodDefinition): void; + protected visitType(node: TSESTree.Node | null | undefined): void; + protected visitTypeAssertion(node: TSESTree.TSAsExpression | TSESTree.TSTypeAssertion): void; + protected ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void; + protected AssignmentExpression(node: TSESTree.AssignmentExpression): void; + protected BlockStatement(node: TSESTree.BlockStatement): void; + protected BreakStatement(): void; + protected CallExpression(node: TSESTree.CallExpression): void; + protected CatchClause(node: TSESTree.CatchClause): void; + protected ClassExpression(node: TSESTree.ClassExpression): void; + protected ClassDeclaration(node: TSESTree.ClassDeclaration): void; + protected ClassProperty(node: TSESTree.ClassProperty): void; + protected ContinueStatement(): void; + protected ExportAllDeclaration(): void; + protected ExportDefaultDeclaration(node: TSESTree.ExportDefaultDeclaration): void; + protected ExportNamedDeclaration(node: TSESTree.ExportNamedDeclaration): void; + protected ForInStatement(node: TSESTree.ForInStatement): void; + protected ForOfStatement(node: TSESTree.ForOfStatement): void; + protected ForStatement(node: TSESTree.ForStatement): void; + protected FunctionDeclaration(node: TSESTree.FunctionDeclaration): void; + protected FunctionExpression(node: TSESTree.FunctionExpression): void; + protected Identifier(node: TSESTree.Identifier): void; + protected ImportDeclaration(node: TSESTree.ImportDeclaration): void; + protected JSXAttribute(node: TSESTree.JSXAttribute): void; + protected JSXClosingElement(): void; + protected JSXFragment(node: TSESTree.JSXFragment): void; + protected JSXIdentifier(node: TSESTree.JSXIdentifier): void; + protected JSXMemberExpression(node: TSESTree.JSXMemberExpression): void; + protected JSXOpeningElement(node: TSESTree.JSXOpeningElement): void; + protected LabeledStatement(node: TSESTree.LabeledStatement): void; + protected MemberExpression(node: TSESTree.MemberExpression): void; + protected MetaProperty(): void; + protected MethodDefinition(node: TSESTree.MethodDefinition): void; + protected NewExpression(node: TSESTree.NewExpression): void; + protected Program(node: TSESTree.Program): void; + protected Property(node: TSESTree.Property): void; + protected SwitchStatement(node: TSESTree.SwitchStatement): void; + protected TaggedTemplateExpression(node: TSESTree.TaggedTemplateExpression): void; + protected TSAbstractClassProperty(node: TSESTree.TSAbstractClassProperty): void; + protected TSAbstractMethodDefinition(node: TSESTree.TSAbstractMethodDefinition): void; + protected TSAsExpression(node: TSESTree.TSAsExpression): void; + protected TSDeclareFunction(node: TSESTree.TSDeclareFunction): void; + protected TSImportEqualsDeclaration(node: TSESTree.TSImportEqualsDeclaration): void; + protected TSEmptyBodyFunctionExpression(node: TSESTree.TSEmptyBodyFunctionExpression): void; + protected TSEnumDeclaration(node: TSESTree.TSEnumDeclaration): void; + protected TSInterfaceDeclaration(node: TSESTree.TSInterfaceDeclaration): void; + protected TSModuleDeclaration(node: TSESTree.TSModuleDeclaration): void; + protected TSTypeAliasDeclaration(node: TSESTree.TSTypeAliasDeclaration): void; + protected TSTypeAssertion(node: TSESTree.TSTypeAssertion): void; + protected UpdateExpression(node: TSESTree.UpdateExpression): void; + protected VariableDeclaration(node: TSESTree.VariableDeclaration): void; + protected WithStatement(node: TSESTree.WithStatement): void; +} +export { Referencer, ReferencerOptions }; +//# sourceMappingURL=Referencer.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts.map new file mode 100644 index 000000000..326dccdba --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Referencer.d.ts","sourceRoot":"","sources":["../../src/referencer/Referencer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,GAAG,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzE,OAAO,EAAiB,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAcpD,OAAO,EAAE,KAAK,EAAe,MAAM,UAAU,CAAC;AAE9C,UAAU,iBAAkB,SAAQ,cAAc;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,GAAG,EAAE,GAAG,EAAE,CAAC;CACZ;AAGD,cAAM,UAAW,SAAQ,OAAO;;IAO9B,SAAgB,YAAY,EAAE,YAAY,CAAC;gBAE/B,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,YAAY;IAS3D,YAAY,IAAI,KAAK;IACrB,YAAY,CAAC,WAAW,EAAE,IAAI,GAAG,KAAK,GAAG,IAAI;IAQ7C,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI;IAQvC,SAAS,CAAC,yBAAyB,CACjC,uBAAuB,EAAE,OAAO,GAC/B,OAAO;IAOV,SAAS,CAAC,wBAAwB,CAChC,uBAAuB,EAAE,OAAO,GAAG,SAAS,GAC3C,IAAI;IAIP,SAAS,CAAC,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AiB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js new file mode 100644 index 000000000..839dae98a --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js @@ -0,0 +1,569 @@ +"use strict"; +var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; +}; +var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); +}; +var _isInnerMethodDefinition, _jsxPragma, _jsxFragmentName, _hasReferencedJsxFactory, _hasReferencedJsxFragmentFactory, _lib; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Referencer = void 0; +const types_1 = require("@typescript-eslint/types"); +const ExportVisitor_1 = require("./ExportVisitor"); +const ImportVisitor_1 = require("./ImportVisitor"); +const PatternVisitor_1 = require("./PatternVisitor"); +const Reference_1 = require("./Reference"); +const TypeVisitor_1 = require("./TypeVisitor"); +const Visitor_1 = require("./Visitor"); +const assert_1 = require("../assert"); +const definition_1 = require("../definition"); +const lib_1 = require("../lib"); +// Referencing variables and creating bindings. +class Referencer extends Visitor_1.Visitor { + constructor(options, scopeManager) { + super(options); + _isInnerMethodDefinition.set(this, void 0); + _jsxPragma.set(this, void 0); + _jsxFragmentName.set(this, void 0); + _hasReferencedJsxFactory.set(this, false); + _hasReferencedJsxFragmentFactory.set(this, false); + _lib.set(this, void 0); + this.scopeManager = scopeManager; + __classPrivateFieldSet(this, _jsxPragma, options.jsxPragma); + __classPrivateFieldSet(this, _jsxFragmentName, options.jsxFragmentName); + __classPrivateFieldSet(this, _lib, options.lib); + __classPrivateFieldSet(this, _isInnerMethodDefinition, false); + } + currentScope(dontThrowOnNull) { + if (!dontThrowOnNull) { + assert_1.assert(this.scopeManager.currentScope, 'aaa'); + } + return this.scopeManager.currentScope; + } + close(node) { + while (this.currentScope(true) && node === this.currentScope().block) { + this.scopeManager.currentScope = this.currentScope().close(this.scopeManager); + } + } + pushInnerMethodDefinition(isInnerMethodDefinition) { + const previous = __classPrivateFieldGet(this, _isInnerMethodDefinition); + __classPrivateFieldSet(this, _isInnerMethodDefinition, isInnerMethodDefinition); + return previous; + } + popInnerMethodDefinition(isInnerMethodDefinition) { + __classPrivateFieldSet(this, _isInnerMethodDefinition, !!isInnerMethodDefinition); + } + referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) { + assignments.forEach(assignment => { + this.currentScope().referenceValue(pattern, Reference_1.ReferenceFlag.Write, assignment.right, maybeImplicitGlobal, init); + }); + } + populateGlobalsFromLib(globalScope) { + for (const lib of __classPrivateFieldGet(this, _lib)) { + const variables = lib_1.lib[lib]; + /* istanbul ignore if */ if (!variables) { + throw new Error(`Invalid value for lib provided: ${lib}`); + } + for (const variable of Object.values(variables)) { + globalScope.defineImplicitVariable(variable); + } + } + // for const assertions (`{} as const` / `{}`) + globalScope.defineImplicitVariable({ + name: 'const', + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + }); + } + /** + * Searches for a variable named "name" in the upper scopes and adds a pseudo-reference from itself to itself + */ + referenceInSomeUpperScope(name) { + let scope = this.scopeManager.currentScope; + while (scope) { + const variable = scope.set.get(name); + if (!variable) { + scope = scope.upper; + continue; + } + scope.referenceValue(variable.identifiers[0]); + return true; + } + return false; + } + referenceJsxPragma() { + if (__classPrivateFieldGet(this, _hasReferencedJsxFactory)) { + return; + } + __classPrivateFieldSet(this, _hasReferencedJsxFactory, this.referenceInSomeUpperScope(__classPrivateFieldGet(this, _jsxPragma))); + } + referenceJsxFragment() { + if (__classPrivateFieldGet(this, _jsxFragmentName) === null || __classPrivateFieldGet(this, _hasReferencedJsxFragmentFactory)) { + return; + } + __classPrivateFieldSet(this, _hasReferencedJsxFragmentFactory, this.referenceInSomeUpperScope(__classPrivateFieldGet(this, _jsxFragmentName))); + } + /////////////////// + // Visit helpers // + /////////////////// + visitClass(node) { + var _a, _b; + if (node.type === types_1.AST_NODE_TYPES.ClassDeclaration && node.id) { + this.currentScope().defineIdentifier(node.id, new definition_1.ClassNameDefinition(node.id, node)); + } + (_a = node.decorators) === null || _a === void 0 ? void 0 : _a.forEach(d => this.visit(d)); + this.scopeManager.nestClassScope(node); + if (node.id) { + // define the class name again inside the new scope + // references to the class should not resolve directly to the parent class + this.currentScope().defineIdentifier(node.id, new definition_1.ClassNameDefinition(node.id, node)); + } + this.visit(node.superClass); + // visit the type param declarations + this.visitType(node.typeParameters); + // then the usages + this.visitType(node.superTypeParameters); + (_b = node.implements) === null || _b === void 0 ? void 0 : _b.forEach(imp => this.visitType(imp)); + this.visit(node.body); + this.close(node); + } + visitClassProperty(node) { + this.visitProperty(node); + this.visitType(node.typeAnnotation); + } + visitForIn(node) { + if (node.left.type === types_1.AST_NODE_TYPES.VariableDeclaration && + node.left.kind !== 'var') { + this.scopeManager.nestForScope(node); + } + if (node.left.type === types_1.AST_NODE_TYPES.VariableDeclaration) { + this.visit(node.left); + this.visitPattern(node.left.declarations[0].id, pattern => { + this.currentScope().referenceValue(pattern, Reference_1.ReferenceFlag.Write, node.right, null, true); + }); + } + else { + this.visitPattern(node.left, (pattern, info) => { + const maybeImplicitGlobal = !this.currentScope().isStrict + ? { + pattern, + node, + } + : null; + this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); + this.currentScope().referenceValue(pattern, Reference_1.ReferenceFlag.Write, node.right, maybeImplicitGlobal, false); + }, { processRightHandNodes: true }); + } + this.visit(node.right); + this.visit(node.body); + this.close(node); + } + visitFunctionParameterTypeAnnotation(node) { + if ('typeAnnotation' in node) { + this.visitType(node.typeAnnotation); + } + else if (node.type === types_1.AST_NODE_TYPES.AssignmentPattern) { + this.visitType(node.left.typeAnnotation); + } + else if (node.type === types_1.AST_NODE_TYPES.TSParameterProperty) { + this.visitFunctionParameterTypeAnnotation(node.parameter); + } + } + visitFunction(node) { + // FunctionDeclaration name is defined in upper scope + // NOTE: Not referring variableScope. It is intended. + // Since + // in ES5, FunctionDeclaration should be in FunctionBody. + // in ES6, FunctionDeclaration should be block scoped. + var _a; + if (node.type === types_1.AST_NODE_TYPES.FunctionExpression) { + if (node.id) { + // FunctionExpression with name creates its special scope; + // FunctionExpressionNameScope. + this.scopeManager.nestFunctionExpressionNameScope(node); + } + } + else if (node.id) { + // id is defined in upper scope + this.currentScope().defineIdentifier(node.id, new definition_1.FunctionNameDefinition(node.id, node)); + } + // Consider this function is in the MethodDefinition. + this.scopeManager.nestFunctionScope(node, __classPrivateFieldGet(this, _isInnerMethodDefinition)); + // Process parameter declarations. + for (const param of node.params) { + this.visitPattern(param, (pattern, info) => { + this.currentScope().defineIdentifier(pattern, new definition_1.ParameterDefinition(pattern, node, info.rest)); + this.referencingDefaultValue(pattern, info.assignments, null, true); + }, { processRightHandNodes: true }); + this.visitFunctionParameterTypeAnnotation(param); + (_a = param.decorators) === null || _a === void 0 ? void 0 : _a.forEach(d => this.visit(d)); + } + this.visitType(node.returnType); + this.visitType(node.typeParameters); + // In TypeScript there are a number of function-like constructs which have no body, + // so check it exists before traversing + if (node.body) { + // Skip BlockStatement to prevent creating BlockStatement scope. + if (node.body.type === types_1.AST_NODE_TYPES.BlockStatement) { + this.visitChildren(node.body); + } + else { + this.visit(node.body); + } + } + this.close(node); + } + visitProperty(node) { + var _a; + let previous; + if (node.computed) { + this.visit(node.key); + } + const isMethodDefinition = node.type === types_1.AST_NODE_TYPES.MethodDefinition; + if (isMethodDefinition) { + previous = this.pushInnerMethodDefinition(true); + } + this.visit(node.value); + if (isMethodDefinition) { + this.popInnerMethodDefinition(previous); + } + if ('decorators' in node) { + (_a = node.decorators) === null || _a === void 0 ? void 0 : _a.forEach(d => this.visit(d)); + } + } + visitType(node) { + if (!node) { + return; + } + TypeVisitor_1.TypeVisitor.visit(this, node); + } + visitTypeAssertion(node) { + this.visit(node.expression); + this.visitType(node.typeAnnotation); + } + ///////////////////// + // Visit selectors // + ///////////////////// + ArrowFunctionExpression(node) { + this.visitFunction(node); + } + AssignmentExpression(node) { + if (PatternVisitor_1.PatternVisitor.isPattern(node.left)) { + if (node.operator === '=') { + this.visitPattern(node.left, (pattern, info) => { + const maybeImplicitGlobal = !this.currentScope().isStrict + ? { + pattern, + node, + } + : null; + this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); + this.currentScope().referenceValue(pattern, Reference_1.ReferenceFlag.Write, node.right, maybeImplicitGlobal, false); + }, { processRightHandNodes: true }); + } + else if (node.left.type === types_1.AST_NODE_TYPES.Identifier) { + this.currentScope().referenceValue(node.left, Reference_1.ReferenceFlag.ReadWrite, node.right); + } + } + else { + this.visit(node.left); + } + this.visit(node.right); + } + BlockStatement(node) { + if (this.scopeManager.isES6()) { + this.scopeManager.nestBlockScope(node); + } + this.visitChildren(node); + this.close(node); + } + BreakStatement() { + // don't reference the break statement's label + } + CallExpression(node) { + this.visitChildren(node, ['typeParameters']); + this.visitType(node.typeParameters); + } + CatchClause(node) { + this.scopeManager.nestCatchScope(node); + if (node.param) { + const param = node.param; + this.visitPattern(param, (pattern, info) => { + this.currentScope().defineIdentifier(pattern, new definition_1.CatchClauseDefinition(param, node)); + this.referencingDefaultValue(pattern, info.assignments, null, true); + }, { processRightHandNodes: true }); + } + this.visit(node.body); + this.close(node); + } + ClassExpression(node) { + this.visitClass(node); + } + ClassDeclaration(node) { + this.visitClass(node); + } + ClassProperty(node) { + this.visitClassProperty(node); + } + ContinueStatement() { + // don't reference the continue statement's label + } + ExportAllDeclaration() { + // this defines no local variables + } + ExportDefaultDeclaration(node) { + if (node.declaration.type === types_1.AST_NODE_TYPES.Identifier) { + ExportVisitor_1.ExportVisitor.visit(this, node); + } + else { + this.visit(node.declaration); + } + } + ExportNamedDeclaration(node) { + if (node.declaration) { + this.visit(node.declaration); + } + else { + ExportVisitor_1.ExportVisitor.visit(this, node); + } + } + ForInStatement(node) { + this.visitForIn(node); + } + ForOfStatement(node) { + this.visitForIn(node); + } + ForStatement(node) { + // Create ForStatement declaration. + // NOTE: In ES6, ForStatement dynamically generates per iteration environment. However, this is + // a static analyzer, we only generate one scope for ForStatement. + if (node.init && + node.init.type === types_1.AST_NODE_TYPES.VariableDeclaration && + node.init.kind !== 'var') { + this.scopeManager.nestForScope(node); + } + this.visitChildren(node); + this.close(node); + } + FunctionDeclaration(node) { + this.visitFunction(node); + } + FunctionExpression(node) { + this.visitFunction(node); + } + Identifier(node) { + this.currentScope().referenceValue(node); + this.visitType(node.typeAnnotation); + } + ImportDeclaration(node) { + assert_1.assert(this.scopeManager.isES6() && this.scopeManager.isModule(), 'ImportDeclaration should appear when the mode is ES6 and in the module context.'); + ImportVisitor_1.ImportVisitor.visit(this, node); + } + JSXAttribute(node) { + this.visit(node.value); + } + JSXClosingElement() { + // should not be counted as a reference + } + JSXFragment(node) { + this.referenceJsxPragma(); + this.referenceJsxFragment(); + this.visitChildren(node); + } + JSXIdentifier(node) { + this.currentScope().referenceValue(node); + } + JSXMemberExpression(node) { + this.visit(node.object); + // we don't ever reference the property as it's always going to be a property on the thing + } + JSXOpeningElement(node) { + this.referenceJsxPragma(); + if (node.name.type === types_1.AST_NODE_TYPES.JSXIdentifier) { + if (node.name.name[0].toUpperCase() === node.name.name[0]) { + // lower cased component names are always treated as "intrinsic" names, and are converted to a string, + // not a variable by JSX transforms: + //
=> React.createElement("div", null) + this.visit(node.name); + } + } + else { + this.visit(node.name); + } + this.visitType(node.typeParameters); + for (const attr of node.attributes) { + this.visit(attr); + } + } + LabeledStatement(node) { + this.visit(node.body); + } + MemberExpression(node) { + this.visit(node.object); + if (node.computed) { + this.visit(node.property); + } + } + MetaProperty() { + // meta properties all builtin globals + } + MethodDefinition(node) { + this.visitProperty(node); + } + NewExpression(node) { + this.visitChildren(node, ['typeParameters']); + this.visitType(node.typeParameters); + } + Program(node) { + const globalScope = this.scopeManager.nestGlobalScope(node); + this.populateGlobalsFromLib(globalScope); + if (this.scopeManager.isGlobalReturn()) { + // Force strictness of GlobalScope to false when using node.js scope. + this.currentScope().isStrict = false; + this.scopeManager.nestFunctionScope(node, false); + } + if (this.scopeManager.isES6() && this.scopeManager.isModule()) { + this.scopeManager.nestModuleScope(node); + } + if (this.scopeManager.isStrictModeSupported() && + this.scopeManager.isImpliedStrict()) { + this.currentScope().isStrict = true; + } + this.visitChildren(node); + this.close(node); + } + Property(node) { + this.visitProperty(node); + } + SwitchStatement(node) { + this.visit(node.discriminant); + if (this.scopeManager.isES6()) { + this.scopeManager.nestSwitchScope(node); + } + for (const switchCase of node.cases) { + this.visit(switchCase); + } + this.close(node); + } + TaggedTemplateExpression(node) { + this.visit(node.tag); + this.visit(node.quasi); + this.visitType(node.typeParameters); + } + TSAbstractClassProperty(node) { + this.visitClassProperty(node); + } + TSAbstractMethodDefinition(node) { + this.visitProperty(node); + } + TSAsExpression(node) { + this.visitTypeAssertion(node); + } + TSDeclareFunction(node) { + this.visitFunction(node); + } + TSImportEqualsDeclaration(node) { + this.currentScope().defineIdentifier(node.id, new definition_1.ImportBindingDefinition(node.id, node, node)); + if (node.moduleReference.type === types_1.AST_NODE_TYPES.TSQualifiedName) { + this.visit(node.moduleReference.left); + } + else { + this.visit(node.moduleReference); + } + } + TSEmptyBodyFunctionExpression(node) { + this.visitFunction(node); + } + TSEnumDeclaration(node) { + this.currentScope().defineIdentifier(node.id, new definition_1.TSEnumNameDefinition(node.id, node)); + // enum members can be referenced within the enum body + this.scopeManager.nestTSEnumScope(node); + // define the enum name again inside the new enum scope + // references to the enum should not resolve directly to the enum + this.currentScope().defineIdentifier(node.id, new definition_1.TSEnumNameDefinition(node.id, node)); + for (const member of node.members) { + // TS resolves literal named members to be actual names + // enum Foo { + // 'a' = 1, + // b = a, // this references the 'a' member + // } + if (member.id.type === types_1.AST_NODE_TYPES.Literal && + typeof member.id.value === 'string') { + const name = member.id; + this.currentScope().defineLiteralIdentifier(name, new definition_1.TSEnumMemberDefinition(name, member)); + } + else if (!member.computed && + member.id.type === types_1.AST_NODE_TYPES.Identifier) { + this.currentScope().defineIdentifier(member.id, new definition_1.TSEnumMemberDefinition(member.id, member)); + } + this.visit(member.initializer); + } + this.close(node); + } + TSInterfaceDeclaration(node) { + this.visitType(node); + } + TSModuleDeclaration(node) { + if (node.id.type === types_1.AST_NODE_TYPES.Identifier) { + this.currentScope().defineIdentifier(node.id, new definition_1.TSModuleNameDefinition(node.id, node)); + } + this.scopeManager.nestTSModuleScope(node); + this.visit(node.body); + this.close(node); + } + TSTypeAliasDeclaration(node) { + this.visitType(node); + } + TSTypeAssertion(node) { + this.visitTypeAssertion(node); + } + UpdateExpression(node) { + if (PatternVisitor_1.PatternVisitor.isPattern(node.argument)) { + this.visitPattern(node.argument, pattern => { + this.currentScope().referenceValue(pattern, Reference_1.ReferenceFlag.ReadWrite, null); + }); + } + else { + this.visitChildren(node); + } + } + VariableDeclaration(node) { + const variableTargetScope = node.kind === 'var' + ? this.currentScope().variableScope + : this.currentScope(); + for (const decl of node.declarations) { + const init = decl.init; + this.visitPattern(decl.id, (pattern, info) => { + variableTargetScope.defineIdentifier(pattern, new definition_1.VariableDefinition(pattern, decl, node)); + this.referencingDefaultValue(pattern, info.assignments, null, true); + if (init) { + this.currentScope().referenceValue(pattern, Reference_1.ReferenceFlag.Write, init, null, true); + } + }, { processRightHandNodes: true }); + if (decl.init) { + this.visit(decl.init); + } + if ('typeAnnotation' in decl.id) { + this.visitType(decl.id.typeAnnotation); + } + } + } + WithStatement(node) { + this.visit(node.object); + // Then nest scope for WithStatement. + this.scopeManager.nestWithScope(node); + this.visit(node.body); + this.close(node); + } +} +exports.Referencer = Referencer; +_isInnerMethodDefinition = new WeakMap(), _jsxPragma = new WeakMap(), _jsxFragmentName = new WeakMap(), _hasReferencedJsxFactory = new WeakMap(), _hasReferencedJsxFragmentFactory = new WeakMap(), _lib = new WeakMap(); +//# sourceMappingURL=Referencer.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js.map new file mode 100644 index 000000000..38ae759dd --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Referencer.js","sourceRoot":"","sources":["../../src/referencer/Referencer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oDAAyE;AACzE,mDAAgD;AAChD,mDAAgD;AAChD,qDAAkD;AAClD,2CAAqE;AAErE,+CAA4C;AAC5C,uCAAoD;AACpD,sCAAmC;AACnC,8CAUuB;AACvB,gCAA4C;AAS5C,+CAA+C;AAC/C,MAAM,UAAW,SAAQ,iBAAO;IAS9B,YAAY,OAA0B,EAAE,YAA0B;QAChE,KAAK,CAAC,OAAO,CAAC,CAAC;QATjB,2CAAkC;QAClC,6BAAmB;QACnB,mCAAgC;QAChC,mCAA2B,KAAK,EAAC;QACjC,2CAAmC,KAAK,EAAC;QACzC,uBAAY;QAKV,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,uBAAA,IAAI,cAAc,OAAO,CAAC,SAAS,EAAC;QACpC,uBAAA,IAAI,oBAAoB,OAAO,CAAC,eAAe,EAAC;QAChD,uBAAA,IAAI,QAAQ,OAAO,CAAC,GAAG,EAAC;QACxB,uBAAA,IAAI,4BAA4B,KAAK,EAAC;IACxC,CAAC;IAIM,YAAY,CAAC,eAAsB;QACxC,IAAI,CAAC,eAAe,EAAE;YACpB,eAAM,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;SAC/C;QACD,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC;IACxC,CAAC;IAEM,KAAK,CAAC,IAAmB;QAC9B,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,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EAAE;YACpC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;YAEvB,IAAI,CAAC,YAAY,CACf,IAAI,CAAC,EAAE,EACP,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;gBAChB,mBAAmB,CAAC,gBAAgB,CAClC,OAAO,EACP,IAAI,+BAAkB,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAC5C,CAAC;gBAEF,IAAI,CAAC,uBAAuB,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;gBACpE,IAAI,IAAI,EAAE;oBACR,IAAI,CAAC,YAAY,EAAE,CAAC,cAAc,CAChC,OAAO,EACP,yBAAa,CAAC,KAAK,EACnB,IAAI,EACJ,IAAI,EACJ,IAAI,CACL,CAAC;iBACH;YACH,CAAC,EACD,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAChC,CAAC;YAEF,IAAI,IAAI,CAAC,IAAI,EAAE;gBACb,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACvB;YAED,IAAI,gBAAgB,IAAI,IAAI,CAAC,EAAE,EAAE;gBAC/B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC;aACxC;SACF;IACH,CAAC;IAES,aAAa,CAAC,IAA4B;QAClD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAExB,qCAAqC;QACrC,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAEtC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEtB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;CACF;AAEQ,gCAAU"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.d.ts new file mode 100644 index 000000000..fe358826d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.d.ts @@ -0,0 +1,31 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { Referencer } from './Referencer'; +import { Visitor } from './Visitor'; +declare class TypeVisitor extends Visitor { + #private; + constructor(referencer: Referencer); + static visit(referencer: Referencer, node: TSESTree.Node): void; + protected visitFunctionType(node: TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructorType | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSFunctionType | TSESTree.TSMethodSignature): void; + protected visitPropertyKey(node: TSESTree.TSMethodSignature | TSESTree.TSPropertySignature): void; + protected Identifier(node: TSESTree.Identifier): void; + protected MemberExpression(node: TSESTree.MemberExpression): void; + protected TSCallSignatureDeclaration(node: TSESTree.TSCallSignatureDeclaration): void; + protected TSConditionalType(node: TSESTree.TSConditionalType): void; + protected TSConstructorType(node: TSESTree.TSConstructorType): void; + protected TSConstructSignatureDeclaration(node: TSESTree.TSConstructSignatureDeclaration): void; + protected TSFunctionType(node: TSESTree.TSFunctionType): void; + protected TSIndexSignature(node: TSESTree.TSIndexSignature): void; + protected TSInferType(node: TSESTree.TSInferType): void; + protected TSInterfaceDeclaration(node: TSESTree.TSInterfaceDeclaration): void; + protected TSMappedType(node: TSESTree.TSMappedType): void; + protected TSMethodSignature(node: TSESTree.TSMethodSignature): void; + protected TSNamedTupleMember(node: TSESTree.TSNamedTupleMember): void; + protected TSPropertySignature(node: TSESTree.TSPropertySignature): void; + protected TSQualifiedName(node: TSESTree.TSQualifiedName): void; + protected TSTypeAliasDeclaration(node: TSESTree.TSTypeAliasDeclaration): void; + protected TSTypeParameter(node: TSESTree.TSTypeParameter): void; + protected TSTypePredicate(node: TSESTree.TSTypePredicate): void; + protected TSTypeQuery(node: TSESTree.TSTypeQuery): void; +} +export { TypeVisitor }; +//# sourceMappingURL=TypeVisitor.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.d.ts.map new file mode 100644 index 000000000..a471358d7 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TypeVisitor.d.ts","sourceRoot":"","sources":["../../src/referencer/TypeVisitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,cAAM,WAAY,SAAQ,OAAO;;gBAGnB,UAAU,EAAE,UAAU;IAKlC,MAAM,CAAC,KAAK,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI;IAS/D,SAAS,CAAC,iBAAiB,CACzB,IAAI,EACA,QAAQ,CAAC,0BAA0B,GACnC,QAAQ,CAAC,iBAAiB,GAC1B,QAAQ,CAAC,+BAA+B,GACxC,QAAQ,CAAC,cAAc,GACvB,QAAQ,CAAC,iBAAiB,GAC7B,IAAI;IAgCP,SAAS,CAAC,gBAAgB,CACxB,IAAI,EAAE,QAAQ,CAAC,iBAAiB,GAAG,QAAQ,CAAC,mBAAmB,GAC9D,IAAI;IAYP,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,GAAG,IAAI;IAIrD,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,gBAAgB,GAAG,IAAI;IAKjE,SAAS,CAAC,0BAA0B,CAClC,IAAI,EAAE,QAAQ,CAAC,0BAA0B,GACxC,IAAI;IAIP,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,iBAAiB,GAAG,IAAI;IAUnE,SAAS,CAAC,iBAAiB,CAAC,IAA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modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.js new file mode 100644 index 000000000..6a3d4e6ee --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.js @@ -0,0 +1,209 @@ +"use strict"; +var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; +}; +var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); +}; +var _referencer; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TypeVisitor = void 0; +const types_1 = require("@typescript-eslint/types"); +const Visitor_1 = require("./Visitor"); +const definition_1 = require("../definition"); +const scope_1 = require("../scope"); +class TypeVisitor extends Visitor_1.Visitor { + constructor(referencer) { + super(referencer); + _referencer.set(this, void 0); + __classPrivateFieldSet(this, _referencer, referencer); + } + static visit(referencer, node) { + const typeReferencer = new TypeVisitor(referencer); + typeReferencer.visit(node); + } + /////////////////// + // Visit helpers // + /////////////////// + visitFunctionType(node) { + // arguments and type parameters can only be referenced from within the function + __classPrivateFieldGet(this, _referencer).scopeManager.nestFunctionTypeScope(node); + this.visit(node.typeParameters); + for (const param of node.params) { + let didVisitAnnotation = false; + this.visitPattern(param, (pattern, info) => { + // a parameter name creates a value type variable which can be referenced later via typeof arg + __classPrivateFieldGet(this, _referencer).currentScope() + .defineIdentifier(pattern, new definition_1.ParameterDefinition(pattern, node, info.rest)); + if (pattern.typeAnnotation) { + this.visit(pattern.typeAnnotation); + didVisitAnnotation = true; + } + }); + // there are a few special cases where the type annotation is owned by the parameter, not the pattern + if (!didVisitAnnotation && 'typeAnnotation' in param) { + this.visit(param.typeAnnotation); + } + } + this.visit(node.returnType); + __classPrivateFieldGet(this, _referencer).close(node); + } + visitPropertyKey(node) { + if (!node.computed) { + return; + } + // computed members are treated as value references, and TS expects they have a literal type + __classPrivateFieldGet(this, _referencer).visit(node.key); + } + ///////////////////// + // Visit selectors // + ///////////////////// + Identifier(node) { + __classPrivateFieldGet(this, _referencer).currentScope().referenceType(node); + } + MemberExpression(node) { + this.visit(node.object); + // don't visit the property + } + TSCallSignatureDeclaration(node) { + this.visitFunctionType(node); + } + TSConditionalType(node) { + // conditional types can define inferred type parameters + // which are only accessible from inside the conditional parameter + __classPrivateFieldGet(this, _referencer).scopeManager.nestConditionalTypeScope(node); + this.visitChildren(node); + __classPrivateFieldGet(this, _referencer).close(node); + } + TSConstructorType(node) { + this.visitFunctionType(node); + } + TSConstructSignatureDeclaration(node) { + this.visitFunctionType(node); + } + TSFunctionType(node) { + this.visitFunctionType(node); + } + TSIndexSignature(node) { + for (const param of node.parameters) { + if (param.type === types_1.AST_NODE_TYPES.Identifier) { + this.visit(param.typeAnnotation); + } + } + this.visit(node.typeAnnotation); + } + TSInferType(node) { + const typeParameter = node.typeParameter; + let scope = __classPrivateFieldGet(this, _referencer).currentScope(); + /* + In cases where there is a sub-type scope created within a conditional type, then the generic should be defined in the + conditional type's scope, not the child type scope. + If we define it within the child type's scope then it won't be able to be referenced outside the child type + */ + if (scope.type === scope_1.ScopeType.functionType || + scope.type === scope_1.ScopeType.mappedType) { + // search up the scope tree to figure out if we're in a nested type scope + let currentScope = scope.upper; + while (currentScope) { + if (currentScope.type === scope_1.ScopeType.functionType || + currentScope.type === scope_1.ScopeType.mappedType) { + // ensure valid type parents only + currentScope = currentScope.upper; + continue; + } + if (currentScope.type === scope_1.ScopeType.conditionalType) { + scope = currentScope; + break; + } + break; + } + } + scope.defineIdentifier(typeParameter.name, new definition_1.TypeDefinition(typeParameter.name, typeParameter)); + } + TSInterfaceDeclaration(node) { + var _a, _b; + __classPrivateFieldGet(this, _referencer).currentScope() + .defineIdentifier(node.id, new definition_1.TypeDefinition(node.id, node)); + if (node.typeParameters) { + // type parameters cannot be referenced from outside their current scope + __classPrivateFieldGet(this, _referencer).scopeManager.nestTypeScope(node); + this.visit(node.typeParameters); + } + (_a = node.extends) === null || _a === void 0 ? void 0 : _a.forEach(this.visit, this); + (_b = node.implements) === null || _b === void 0 ? void 0 : _b.forEach(this.visit, this); + this.visit(node.body); + if (node.typeParameters) { + __classPrivateFieldGet(this, _referencer).close(node); + } + } + TSMappedType(node) { + // mapped types key can only be referenced within their return value + __classPrivateFieldGet(this, _referencer).scopeManager.nestMappedTypeScope(node); + this.visitChildren(node); + __classPrivateFieldGet(this, _referencer).close(node); + } + TSMethodSignature(node) { + this.visitPropertyKey(node); + this.visitFunctionType(node); + } + TSNamedTupleMember(node) { + this.visit(node.elementType); + // we don't visit the label as the label only exists for the purposes of documentation + } + TSPropertySignature(node) { + this.visitPropertyKey(node); + this.visit(node.typeAnnotation); + } + TSQualifiedName(node) { + this.visit(node.left); + // we don't visit the right as it a name on the thing, not a name to reference + } + TSTypeAliasDeclaration(node) { + __classPrivateFieldGet(this, _referencer).currentScope() + .defineIdentifier(node.id, new definition_1.TypeDefinition(node.id, node)); + if (node.typeParameters) { + // type parameters cannot be referenced from outside their current scope + __classPrivateFieldGet(this, _referencer).scopeManager.nestTypeScope(node); + this.visit(node.typeParameters); + } + this.visit(node.typeAnnotation); + if (node.typeParameters) { + __classPrivateFieldGet(this, _referencer).close(node); + } + } + TSTypeParameter(node) { + __classPrivateFieldGet(this, _referencer).currentScope() + .defineIdentifier(node.name, new definition_1.TypeDefinition(node.name, node)); + this.visit(node.constraint); + this.visit(node.default); + } + TSTypePredicate(node) { + if (node.parameterName.type !== types_1.AST_NODE_TYPES.TSThisType) { + __classPrivateFieldGet(this, _referencer).currentScope().referenceValue(node.parameterName); + } + this.visit(node.typeAnnotation); + } + // a type query `typeof foo` is a special case that references a _non-type_ variable, + TSTypeQuery(node) { + if (node.exprName.type === types_1.AST_NODE_TYPES.Identifier) { + __classPrivateFieldGet(this, _referencer).currentScope().referenceValue(node.exprName); + } + else { + let expr = node.exprName.left; + while (expr.type !== types_1.AST_NODE_TYPES.Identifier) { + expr = expr.left; + } + __classPrivateFieldGet(this, _referencer).currentScope().referenceValue(expr); + } + } +} +exports.TypeVisitor = TypeVisitor; +_referencer = new WeakMap(); +//# sourceMappingURL=TypeVisitor.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.js.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.js.map new file mode 100644 index 000000000..6ef5c83e1 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TypeVisitor.js","sourceRoot":"","sources":["../../src/referencer/TypeVisitor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oDAAoE;AAEpE,uCAAoC;AACpC,8CAAoE;AACpE,oCAAqC;AAErC,MAAM,WAAY,SAAQ,iBAAO;IAG/B,YAAY,UAAsB;QAChC,KAAK,CAAC,UAAU,CAAC,CAAC;QAHpB,8BAAiC;QAI/B,uBAAA,IAAI,eAAe,UAAU,EAAC;IAChC,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,UAAsB,EAAE,IAAmB;QACtD,MAAM,cAAc,GAAG,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC;QACnD,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,mBAAmB;IACnB,mBAAmB;IACnB,mBAAmB;IAET,iBAAiB,CACzB,IAK8B;QAE9B,gFAAgF;QAChF,0CAAiB,YAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;QAC1D,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAEhC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE;YAC/B,IAAI,kBAAkB,GAAG,KAAK,CAAC;YAC/B,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,IAAI,E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AAC,IAAI,KAAK,sBAAc,CAAC,UAAU,EAAE;YACzD,0CAAiB,YAAY,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;SACpE;QACD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAClC,CAAC;IAED,qFAAqF;IAC3E,WAAW,CAAC,IAA0B;QAC9C,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,sBAAc,CAAC,UAAU,EAAE;YACpD,0CAAiB,YAAY,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SAC/D;aAAM;YACL,IAAI,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC9B,OAAO,IAAI,CAAC,IAAI,KAAK,sBAAc,CAAC,UAAU,EAAE;gBAC9C,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;aAClB;YACD,0CAAiB,YAAY,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;SACtD;IACH,CAAC;CACF;AAEQ,kCAAW"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.d.ts new file mode 100644 index 000000000..7de6a73ab --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.d.ts @@ -0,0 +1,13 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { VisitorBase, VisitorOptions } from './VisitorBase'; +import { PatternVisitorCallback, PatternVisitorOptions } from './PatternVisitor'; +interface VisitPatternOptions extends PatternVisitorOptions { + processRightHandNodes?: boolean; +} +declare class Visitor extends VisitorBase { + #private; + constructor(optionsOrVisitor: VisitorOptions | Visitor); + protected visitPattern(node: TSESTree.Node, callback: PatternVisitorCallback, options?: VisitPatternOptions): void; +} +export { Visitor, VisitorBase, VisitorOptions }; +//# sourceMappingURL=Visitor.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.d.ts.map new file mode 100644 index 000000000..4c82fae28 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Visitor.d.ts","sourceRoot":"","sources":["../../src/referencer/Visitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAEL,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAE1B,UAAU,mBAAoB,SAAQ,qBAAqB;IACzD,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AACD,cAAM,OAAQ,SAAQ,WAAW;;gBAEnB,gBAAgB,EAAE,cAAc,GAAG,OAAO;IAatD,SAAS,CAAC,YAAY,CACpB,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,QAAQ,EAAE,sBAAsB,EAChC,OAAO,GAAE,mBAAsD,GAC9D,IAAI;CAWR;AAED,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.js b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.js new file mode 100644 index 000000000..e3021eec1 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.js @@ -0,0 +1,41 @@ +"use strict"; +var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); +}; +var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; +}; +var _options; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VisitorBase = exports.Visitor = void 0; +const VisitorBase_1 = require("./VisitorBase"); +Object.defineProperty(exports, "VisitorBase", { enumerable: true, get: function () { return VisitorBase_1.VisitorBase; } }); +const PatternVisitor_1 = require("./PatternVisitor"); +class Visitor extends VisitorBase_1.VisitorBase { + constructor(optionsOrVisitor) { + super(optionsOrVisitor instanceof Visitor + ? __classPrivateFieldGet(optionsOrVisitor, _options) : optionsOrVisitor); + _options.set(this, void 0); + __classPrivateFieldSet(this, _options, optionsOrVisitor instanceof Visitor + ? __classPrivateFieldGet(optionsOrVisitor, _options) : optionsOrVisitor); + } + visitPattern(node, callback, options = { processRightHandNodes: false }) { + // Call the callback at left hand identifier nodes, and Collect right hand nodes. + const visitor = new PatternVisitor_1.PatternVisitor(__classPrivateFieldGet(this, _options), node, callback); + visitor.visit(node); + // Process the right hand nodes recursively. + if (options.processRightHandNodes) { + visitor.rightHandNodes.forEach(this.visit, this); + } + } +} +exports.Visitor = Visitor; +_options = new WeakMap(); +//# sourceMappingURL=Visitor.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.js.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.js.map new file mode 100644 index 000000000..45ed8ca36 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Visitor.js","sourceRoot":"","sources":["../../src/referencer/Visitor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,+CAA4D;AA0C1C,4FA1CT,yBAAW,OA0CS;AAzC7B,qDAI0B;AAK1B,MAAM,OAAQ,SAAQ,yBAAW;IAE/B,YAAY,gBAA0C;QACpD,KAAK,CACH,gBAAgB,YAAY,OAAO;YACjC,CAAC,oDACD,CAAC,CAAC,gBAAgB,CACrB,CAAC;QANJ,2BAAkC;QAQhC,uBAAA,IAAI,YACF,gBAAgB,YAAY,OAAO;YACjC,CAAC,oDACD,CAAC,CAAC,gBAAgB,EAAC;IACzB,CAAC;IAES,YAAY,CACpB,IAAmB,EACnB,QAAgC,EAChC,UAA+B,EAAE,qBAAqB,EAAE,KAAK,EAAE;QAE/D,iFAAiF;QACjF,MAAM,OAAO,GAAG,IAAI,+BAAc,yCAAgB,IAAI,EAAE,QAAQ,CAAC,CAAC;QAElE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAEpB,4CAA4C;QAC5C,IAAI,OAAO,CAAC,qBAAqB,EAAE;YACjC,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;SAClD;IACH,CAAC;CACF;AAEQ,0BAAO"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.d.ts new file mode 100644 index 000000000..297fe7126 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.d.ts @@ -0,0 +1,21 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { VisitorKeys } from '@typescript-eslint/visitor-keys'; +interface VisitorOptions { + childVisitorKeys?: VisitorKeys | null; +} +declare abstract class VisitorBase { + #private; + constructor(options: VisitorOptions); + /** + * Default method for visiting children. + * @param node the node whose children should be visited + * @param exclude a list of keys to not visit + */ + visitChildren(node: T | null | undefined, excludeArr?: (keyof T)[]): void; + /** + * Dispatching node. + */ + visit(node: TSESTree.Node | null | undefined): void; +} +export { VisitorBase, VisitorOptions, VisitorKeys }; +//# sourceMappingURL=VisitorBase.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.d.ts.map new file mode 100644 index 000000000..43ca6b239 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"VisitorBase.d.ts","sourceRoot":"","sources":["../../src/referencer/VisitorBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAe,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE3E,UAAU,cAAc;IACtB,gBAAgB,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CACvC;AAaD,uBAAe,WAAW;;gBAEZ,OAAO,EAAE,cAAc;IAInC;;;;OAIG;IACH,aAAa,CAAC,CAAC,SAAS,QAAQ,CAAC,IAAI,EACnC,IAAI,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,EAC1B,UAAU,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,GACvB,IAAI;IA6BP;;OAEG;IACH,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;CAYpD;AAED,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js b/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js new file mode 100644 index 000000000..10ff0cb49 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js @@ -0,0 +1,79 @@ +"use strict"; +var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; +}; +var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); +}; +var _childVisitorKeys; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VisitorBase = void 0; +const visitor_keys_1 = require("@typescript-eslint/visitor-keys"); +function isObject(obj) { + return typeof obj === 'object' && obj != null; +} +function isNode(node) { + return isObject(node) && typeof node.type === 'string'; +} +class VisitorBase { + constructor(options) { + var _a; + _childVisitorKeys.set(this, void 0); + __classPrivateFieldSet(this, _childVisitorKeys, (_a = options.childVisitorKeys) !== null && _a !== void 0 ? _a : visitor_keys_1.visitorKeys); + } + /** + * Default method for visiting children. + * @param node the node whose children should be visited + * @param exclude a list of keys to not visit + */ + visitChildren(node, excludeArr) { + var _a; + if (node == null || node.type == null) { + return; + } + const exclude = new Set(excludeArr); + const children = (_a = __classPrivateFieldGet(this, _childVisitorKeys)[node.type]) !== null && _a !== void 0 ? _a : Object.keys(node); + for (const key of children) { + if (exclude.has(key)) { + continue; + } + const child = node[key]; + if (!child) { + continue; + } + if (Array.isArray(child)) { + for (const subChild of child) { + if (isNode(subChild)) { + this.visit(subChild); + } + } + } + else if (isNode(child)) { + this.visit(child); + } + } + } + /** + * Dispatching node. + */ + visit(node) { + if (node == null || node.type == null) { + return; + } + const visitor = this[node.type]; + if (visitor) { + return visitor.call(this, node); + } + this.visitChildren(node); + } +} +exports.VisitorBase = VisitorBase; +_childVisitorKeys = new WeakMap(); +//# sourceMappingURL=VisitorBase.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js.map new file mode 100644 index 000000000..878c1233e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js.map @@ -0,0 +1 @@ +{"version":3,"file":"VisitorBase.js","sourceRoot":"","sources":["../../src/referencer/VisitorBase.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,kEAA2E;AAM3E,SAAS,QAAQ,CAAC,GAAY;IAC5B,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,IAAI,IAAI,CAAC;AAChD,CAAC;AACD,SAAS,MAAM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,MAAM,OAAO,GAAI,IAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjD,IAAI,OAAO,EAAE;YACX,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;SACjC;QAED,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;CACF;AAEQ,kCAAW"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.d.ts new file mode 100644 index 000000000..d2a8121c1 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.d.ts @@ -0,0 +1,2 @@ +export { Referencer, ReferencerOptions } from './Referencer'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.d.ts.map new file mode 100644 index 000000000..5b48579f3 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/referencer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.js b/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.js new file mode 100644 index 000000000..16625137c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Referencer = void 0; +var Referencer_1 = require("./Referencer"); +Object.defineProperty(exports, "Referencer", { enumerable: true, get: function () { return Referencer_1.Referencer; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.js.map b/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.js.map new file mode 100644 index 000000000..aa5dc621d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/referencer/index.ts"],"names":[],"mappings":";;;AAAA,2CAA6D;AAApD,wGAAA,UAAU,OAAA"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.d.ts new file mode 100644 index 000000000..7e274f6e3 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.d.ts @@ -0,0 +1,10 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +import { ScopeManager } from '../ScopeManager'; +declare class BlockScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: BlockScope['upper'], block: BlockScope['block']); +} +export { BlockScope }; +//# sourceMappingURL=BlockScope.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.d.ts.map new file mode 100644 index 000000000..b3b3cb480 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"BlockScope.d.ts","sourceRoot":"","sources":["../../src/scope/BlockScope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,cAAM,UAAW,SAAQ,SAAS,CAChC,SAAS,CAAC,KAAK,EACf,QAAQ,CAAC,cAAc,EACvB,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,EAC/B,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC;CAI7B;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.js new file mode 100644 index 000000000..0fc34d615 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BlockScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class BlockScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.block, upperScope, block, false); + } +} +exports.BlockScope = BlockScope; +//# sourceMappingURL=BlockScope.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.js.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.js.map new file mode 100644 index 000000000..67896a4f2 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"BlockScope.js","sourceRoot":"","sources":["../../src/scope/BlockScope.ts"],"names":[],"mappings":";;;AAEA,2CAAwC;AACxC,2CAAwC;AAGxC,MAAM,UAAW,SAAQ,qBAIxB;IACC,YACE,YAA0B,EAC1B,UAA+B,EAC/B,KAA0B;QAE1B,KAAK,CAAC,YAAY,EAAE,qBAAS,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IACjE,CAAC;CACF;AAEQ,gCAAU"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.d.ts new file mode 100644 index 000000000..535df5e3f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.d.ts @@ -0,0 +1,10 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +import { ScopeManager } from '../ScopeManager'; +declare class CatchScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: CatchScope['upper'], block: CatchScope['block']); +} +export { CatchScope }; +//# sourceMappingURL=CatchScope.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.d.ts.map new file mode 100644 index 000000000..bdc822950 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CatchScope.d.ts","sourceRoot":"","sources":["../../src/scope/CatchScope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,cAAM,UAAW,SAAQ,SAAS,CAChC,SAAS,CAAC,KAAK,EACf,QAAQ,CAAC,WAAW,EACpB,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,EAC/B,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC;CAI7B;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.js new file mode 100644 index 000000000..dbb630f25 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CatchScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class CatchScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.catch, upperScope, block, false); + } +} +exports.CatchScope = CatchScope; +//# sourceMappingURL=CatchScope.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.js.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.js.map new file mode 100644 index 000000000..3984d7bb0 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CatchScope.js","sourceRoot":"","sources":["../../src/scope/CatchScope.ts"],"names":[],"mappings":";;;AAEA,2CAAwC;AACxC,2CAAwC;AAGxC,MAAM,UAAW,SAAQ,qBAIxB;IACC,YACE,YAA0B,EAC1B,UAA+B,EAC/B,KAA0B;QAE1B,KAAK,CAAC,YAAY,EAAE,qBAAS,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IACjE,CAAC;CACF;AAEQ,gCAAU"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.d.ts new file mode 100644 index 000000000..2f0da98b2 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.d.ts @@ -0,0 +1,10 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +import { ScopeManager } from '../ScopeManager'; +declare class ClassScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: ClassScope['upper'], block: ClassScope['block']); +} +export { ClassScope }; +//# sourceMappingURL=ClassScope.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.d.ts.map new file mode 100644 index 000000000..d6c49361d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ClassScope.d.ts","sourceRoot":"","sources":["../../src/scope/ClassScope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,cAAM,UAAW,SAAQ,SAAS,CAChC,SAAS,CAAC,KAAK,EACf,QAAQ,CAAC,gBAAgB,GAAG,QAAQ,CAAC,eAAe,EACpD,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,EAC/B,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC;CAI7B;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.js new file mode 100644 index 000000000..003e214fd --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClassScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class ClassScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.class, upperScope, block, false); + } +} +exports.ClassScope = ClassScope; +//# sourceMappingURL=ClassScope.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.js.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.js.map new file mode 100644 index 000000000..f12bf2955 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ClassScope.js","sourceRoot":"","sources":["../../src/scope/ClassScope.ts"],"names":[],"mappings":";;;AAEA,2CAAwC;AACxC,2CAAwC;AAGxC,MAAM,UAAW,SAAQ,qBAIxB;IACC,YACE,YAA0B,EAC1B,UAA+B,EAC/B,KAA0B;QAE1B,KAAK,CAAC,YAAY,EAAE,qBAAS,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IACjE,CAAC;CACF;AAEQ,gCAAU"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.d.ts new file mode 100644 index 000000000..316ac0c03 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.d.ts @@ -0,0 +1,10 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +import { ScopeManager } from '../ScopeManager'; +declare class ConditionalTypeScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: ConditionalTypeScope['upper'], block: ConditionalTypeScope['block']); +} +export { ConditionalTypeScope }; +//# sourceMappingURL=ConditionalTypeScope.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.d.ts.map new file mode 100644 index 000000000..9c23c1587 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ConditionalTypeScope.d.ts","sourceRoot":"","sources":["../../src/scope/ConditionalTypeScope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,cAAM,oBAAqB,SAAQ,SAAS,CAC1C,SAAS,CAAC,eAAe,EACzB,QAAQ,CAAC,iBAAiB,EAC1B,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,oBAAoB,CAAC,OAAO,CAAC,EACzC,KAAK,EAAE,oBAAoB,CAAC,OAAO,CAAC;CAIvC;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.js new file mode 100644 index 000000000..8fbd7c50d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConditionalTypeScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class ConditionalTypeScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.conditionalType, upperScope, block, false); + } +} +exports.ConditionalTypeScope = ConditionalTypeScope; +//# sourceMappingURL=ConditionalTypeScope.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.js.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.js.map new file mode 100644 index 000000000..dc549a727 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ConditionalTypeScope.js","sourceRoot":"","sources":["../../src/scope/ConditionalTypeScope.ts"],"names":[],"mappings":";;;AAEA,2CAAwC;AACxC,2CAAwC;AAGxC,MAAM,oBAAqB,SAAQ,qBAIlC;IACC,YACE,YAA0B,EAC1B,UAAyC,EACzC,KAAoC;QAEpC,KAAK,CAAC,YAAY,EAAE,qBAAS,CAAC,eAAe,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAC3E,CAAC;CACF;AAEQ,oDAAoB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.d.ts new file mode 100644 index 000000000..190679836 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.d.ts @@ -0,0 +1,10 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +import { ScopeManager } from '../ScopeManager'; +declare class ForScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: ForScope['upper'], block: ForScope['block']); +} +export { ForScope }; +//# sourceMappingURL=ForScope.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.d.ts.map new file mode 100644 index 000000000..62990b8b5 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ForScope.d.ts","sourceRoot":"","sources":["../../src/scope/ForScope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,cAAM,QAAS,SAAQ,SAAS,CAC9B,SAAS,CAAC,GAAG,EACb,QAAQ,CAAC,cAAc,GAAG,QAAQ,CAAC,cAAc,GAAG,QAAQ,CAAC,YAAY,EACzE,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,EAC7B,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC;CAI3B;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.js new file mode 100644 index 000000000..cd27683ed --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ForScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class ForScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.for, upperScope, block, false); + } +} +exports.ForScope = ForScope; +//# sourceMappingURL=ForScope.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.js.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.js.map new file mode 100644 index 000000000..908369d56 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ForScope.js","sourceRoot":"","sources":["../../src/scope/ForScope.ts"],"names":[],"mappings":";;;AAEA,2CAAwC;AACxC,2CAAwC;AAGxC,MAAM,QAAS,SAAQ,qBAItB;IACC,YACE,YAA0B,EAC1B,UAA6B,EAC7B,KAAwB;QAExB,KAAK,CAAC,YAAY,EAAE,qBAAS,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAC/D,CAAC;CACF;AAEQ,4BAAQ"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.d.ts new file mode 100644 index 000000000..952d7a92d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.d.ts @@ -0,0 +1,11 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +import { Scope } from './Scope'; +import { ScopeManager } from '../ScopeManager'; +declare class FunctionExpressionNameScope extends ScopeBase { + readonly functionExpressionScope: true; + constructor(scopeManager: ScopeManager, upperScope: FunctionExpressionNameScope['upper'], block: FunctionExpressionNameScope['block']); +} +export { FunctionExpressionNameScope }; +//# sourceMappingURL=FunctionExpressionNameScope.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.d.ts.map new file mode 100644 index 000000000..929ca3242 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"FunctionExpressionNameScope.d.ts","sourceRoot":"","sources":["../../src/scope/FunctionExpressionNameScope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,cAAM,2BAA4B,SAAQ,SAAS,CACjD,SAAS,CAAC,sBAAsB,EAChC,QAAQ,CAAC,kBAAkB,EAC3B,KAAK,CACN;IACC,SAAgB,uBAAuB,EAAE,IAAI,CAAC;gBAE5C,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,2BAA2B,CAAC,OAAO,CAAC,EAChD,KAAK,EAAE,2BAA2B,CAAC,OAAO,CAAC;CAiB9C;AAED,OAAO,EAAE,2BAA2B,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.js new file mode 100644 index 000000000..4abe1ef33 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FunctionExpressionNameScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +const definition_1 = require("../definition"); +class FunctionExpressionNameScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.functionExpressionName, upperScope, block, false); + if (block.id) { + this.defineIdentifier(block.id, new definition_1.FunctionNameDefinition(block.id, block)); + } + this.functionExpressionScope = true; + } +} +exports.FunctionExpressionNameScope = FunctionExpressionNameScope; +//# sourceMappingURL=FunctionExpressionNameScope.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.js.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.js.map new file mode 100644 index 000000000..54910b199 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"FunctionExpressionNameScope.js","sourceRoot":"","sources":["../../src/scope/FunctionExpressionNameScope.ts"],"names":[],"mappings":";;;AACA,2CAAwC;AACxC,2CAAwC;AAExC,8CAAuD;AAGvD,MAAM,2BAA4B,SAAQ,qBAIzC;IAEC,YACE,YAA0B,EAC1B,UAAgD,EAChD,KAA2C;QAE3C,KAAK,CACH,YAAY,EACZ,qBAAS,CAAC,sBAAsB,EAChC,UAAU,EACV,KAAK,EACL,KAAK,CACN,CAAC;QACF,IAAI,KAAK,CAAC,EAAE,EAAE;YACZ,IAAI,CAAC,gBAAgB,CACnB,KAAK,CAAC,EAAE,EACR,IAAI,mCAAsB,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAC5C,CAAC;SACH;QACD,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC;IACtC,CAAC;CACF;AAEQ,kEAA2B"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.d.ts new file mode 100644 index 000000000..725a59ad6 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.d.ts @@ -0,0 +1,13 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +import { Reference } from '../referencer/Reference'; +import { ScopeManager } from '../ScopeManager'; +import { Variable } from '../variable'; +declare class FunctionScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: FunctionScope['upper'], block: FunctionScope['block'], isMethodDefinition: boolean); + protected isValidResolution(ref: Reference, variable: Variable): boolean; +} +export { FunctionScope }; +//# sourceMappingURL=FunctionScope.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.d.ts.map new file mode 100644 index 000000000..250222f5b --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"FunctionScope.d.ts","sourceRoot":"","sources":["../../src/scope/FunctionScope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,cAAM,aAAc,SAAQ,SAAS,CACnC,SAAS,CAAC,QAAQ,EAChB,QAAQ,CAAC,uBAAuB,GAChC,QAAQ,CAAC,mBAAmB,GAC5B,QAAQ,CAAC,kBAAkB,GAC3B,QAAQ,CAAC,iBAAiB,GAC1B,QAAQ,CAAC,6BAA6B,GACtC,QAAQ,CAAC,OAAO,EAClB,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC,EAClC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,EAC7B,kBAAkB,EAAE,OAAO;IAuB7B,SAAS,CAAC,iBAAiB,CAAC,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO;CAiBzE;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.js new file mode 100644 index 000000000..cccb1c39e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.js @@ -0,0 +1,37 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FunctionScope = void 0; +const types_1 = require("@typescript-eslint/types"); +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class FunctionScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block, isMethodDefinition) { + super(scopeManager, ScopeType_1.ScopeType.function, upperScope, block, isMethodDefinition); + // section 9.2.13, FunctionDeclarationInstantiation. + // NOTE Arrow functions never have an arguments objects. + if (this.block.type !== types_1.AST_NODE_TYPES.ArrowFunctionExpression) { + this.defineVariable('arguments', this.set, this.variables, null, null); + } + } + // References in default parameters isn't resolved to variables which are in their function body. + // const x = 1 + // function f(a = x) { // This `x` is resolved to the `x` in the outer scope. + // const x = 2 + // console.log(a) + // } + isValidResolution(ref, variable) { + var _a, _b; + // If `options.gloablReturn` is true, `this.block` becomes a Program node. + if (this.block.type === types_1.AST_NODE_TYPES.Program) { + return true; + } + const bodyStart = (_b = (_a = this.block.body) === null || _a === void 0 ? void 0 : _a.range[0]) !== null && _b !== void 0 ? _b : -1; + // It's invalid resolution in the following case: + return !((variable.scope === this && + ref.identifier.range[0] < bodyStart && // the reference is in the parameter part. + variable.defs.every(d => d.name.range[0] >= bodyStart)) // the variable is in the body. + ); + } +} +exports.FunctionScope = FunctionScope; +//# sourceMappingURL=FunctionScope.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.js.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.js.map new file mode 100644 index 000000000..097c56767 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"FunctionScope.js","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"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.d.ts new file mode 100644 index 000000000..cb80056a6 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.d.ts @@ -0,0 +1,10 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +import { ScopeManager } from '../ScopeManager'; +declare class FunctionTypeScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: FunctionTypeScope['upper'], block: FunctionTypeScope['block']); +} +export { FunctionTypeScope }; +//# sourceMappingURL=FunctionTypeScope.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.d.ts.map new file mode 100644 index 000000000..8914604c8 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"FunctionTypeScope.d.ts","sourceRoot":"","sources":["../../src/scope/FunctionTypeScope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,cAAM,iBAAkB,SAAQ,SAAS,CACvC,SAAS,CAAC,YAAY,EACpB,QAAQ,CAAC,0BAA0B,GACnC,QAAQ,CAAC,iBAAiB,GAC1B,QAAQ,CAAC,+BAA+B,GACxC,QAAQ,CAAC,cAAc,GACvB,QAAQ,CAAC,iBAAiB,EAC5B,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,iBAAiB,CAAC,OAAO,CAAC,EACtC,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC;CAIpC;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.js new file mode 100644 index 000000000..3d7fe797f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FunctionTypeScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class FunctionTypeScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.functionType, upperScope, block, false); + } +} +exports.FunctionTypeScope = FunctionTypeScope; +//# sourceMappingURL=FunctionTypeScope.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.js.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.js.map new file mode 100644 index 000000000..a303d8ea7 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"FunctionTypeScope.js","sourceRoot":"","sources":["../../src/scope/FunctionTypeScope.ts"],"names":[],"mappings":";;;AAEA,2CAAwC;AACxC,2CAAwC;AAGxC,MAAM,iBAAkB,SAAQ,qBAQ/B;IACC,YACE,YAA0B,EAC1B,UAAsC,EACtC,KAAiC;QAEjC,KAAK,CAAC,YAAY,EAAE,qBAAS,CAAC,YAAY,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IACxE,CAAC;CACF;AAEQ,8CAAiB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.d.ts new file mode 100644 index 000000000..018fcd4b5 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.d.ts @@ -0,0 +1,18 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +import { ScopeManager } from '../ScopeManager'; +import { ImplicitLibVariableOptions } from '../variable'; +declare class GlobalScope extends ScopeBase { + private readonly implicit; + constructor(scopeManager: ScopeManager, block: GlobalScope['block']); + defineImplicitVariable(options: ImplicitLibVariableOptions): void; + close(scopeManager: ScopeManager): Scope | null; +} +export { GlobalScope }; +//# sourceMappingURL=GlobalScope.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.d.ts.map new file mode 100644 index 000000000..be9a0123d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"GlobalScope.d.ts","sourceRoot":"","sources":["../../src/scope/GlobalScope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAGL,0BAA0B,EAC3B,MAAM,aAAa,CAAC;AAErB,cAAM,WAAY,SAAQ,SAAS,CACjC,SAAS,CAAC,MAAM,EAChB,QAAQ,CAAC,OAAO;AAChB;;GAEG;AACH,IAAI,CACL;IAEC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAQvB;gBAEU,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC;IAS5D,sBAAsB,CAAC,OAAO,EAAE,0BAA0B,GAAG,IAAI;IAUjE,KAAK,CAAC,YAAY,EAAE,YAAY,GAAG,KAAK,GAAG,IAAI;CAuBvD;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.js new file mode 100644 index 000000000..d3fa4bfd2 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GlobalScope = void 0; +const types_1 = require("@typescript-eslint/types"); +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +const assert_1 = require("../assert"); +const ImplicitGlobalVariableDefinition_1 = require("../definition/ImplicitGlobalVariableDefinition"); +const variable_1 = require("../variable"); +class GlobalScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, block) { + super(scopeManager, ScopeType_1.ScopeType.global, null, block, false); + this.implicit = { + set: new Map(), + variables: [], + leftToBeResolved: [], + }; + } + defineImplicitVariable(options) { + this.defineVariable(new variable_1.ImplicitLibVariable(this, options), this.set, this.variables, null, null); + } + close(scopeManager) { + assert_1.assert(this.leftToResolve); + for (const ref of this.leftToResolve) { + if (ref.maybeImplicitGlobal && !this.set.has(ref.identifier.name)) { + // create an implicit global variable from assignment expression + const info = ref.maybeImplicitGlobal; + const node = info.pattern; + if (node && node.type === types_1.AST_NODE_TYPES.Identifier) { + this.defineVariable(node.name, this.implicit.set, this.implicit.variables, node, new ImplicitGlobalVariableDefinition_1.ImplicitGlobalVariableDefinition(info.pattern, info.node)); + } + } + } + this.implicit.leftToBeResolved = this.leftToResolve; + return super.close(scopeManager); + } +} +exports.GlobalScope = GlobalScope; +//# sourceMappingURL=GlobalScope.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.js.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.js.map new file mode 100644 index 000000000..38deb003e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"GlobalScope.js","sourceRoot":"","sources":["../../src/scope/GlobalScope.ts"],"names":[],"mappings":";;;AAAA,oDAAoE;AAEpE,2CAAwC;AACxC,2CAAwC;AACxC,sCAAmC;AACnC,qGAAkG;AAGlG,0CAIqB;AAErB,MAAM,WAAY,SAAQ,qBAOzB;IAYC,YAAY,YAA0B,EAAE,KAA2B;QACjE,KAAK,CAAC,YAAY,EAAE,qBAAS,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAC1D,IAAI,CAAC,QAAQ,GAAG;YACd,GAAG,EAAE,IAAI,GAAG,EAAE;YACd,SAAS,EAAE,EAAE;YACb,gBAAgB,EAAE,EAAE;SACrB,CAAC;IACJ,CAAC;IAEM,sBAAsB,CAAC,OAAmC;QAC/D,IAAI,CAAC,cAAc,CACjB,IAAI,8BAAmB,CAAC,IAAI,EAAE,OAAO,CAAC,EACtC,IAAI,CAAC,GAAG,EACR,IAAI,CAAC,SAAS,EACd,IAAI,EACJ,IAAI,CACL,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,YAA0B;QACrC,eAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAE3B,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,aAAa,EAAE;YACpC,IAAI,GAAG,CAAC,mBAAmB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;gBACjE,gEAAgE;gBAChE,MAAM,IAAI,GAAG,GAAG,CAAC,mBAAmB,CAAC;gBACrC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC;gBAC1B,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,sBAAc,CAAC,UAAU,EAAE;oBACnD,IAAI,CAAC,cAAc,CACjB,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,QAAQ,CAAC,GAAG,EACjB,IAAI,CAAC,QAAQ,CAAC,SAAS,EACvB,IAAI,EACJ,IAAI,mEAAgC,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAC9D,CAAC;iBACH;aACF;SACF;QAED,IAAI,CAAC,QAAQ,CAAC,gBAAgB,GAAG,IAAI,CAAC,aAAa,CAAC;QACpD,OAAO,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACnC,CAAC;CACF;AAEQ,kCAAW"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.d.ts new file mode 100644 index 000000000..30fbc47a3 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.d.ts @@ -0,0 +1,10 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +import { ScopeManager } from '../ScopeManager'; +declare class MappedTypeScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: MappedTypeScope['upper'], block: MappedTypeScope['block']); +} +export { MappedTypeScope }; +//# sourceMappingURL=MappedTypeScope.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.d.ts.map new file mode 100644 index 000000000..15921f2c7 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MappedTypeScope.d.ts","sourceRoot":"","sources":["../../src/scope/MappedTypeScope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,cAAM,eAAgB,SAAQ,SAAS,CACrC,SAAS,CAAC,UAAU,EACpB,QAAQ,CAAC,YAAY,EACrB,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,eAAe,CAAC,OAAO,CAAC,EACpC,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC;CAIlC;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.js new file mode 100644 index 000000000..81879c5ff --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MappedTypeScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class MappedTypeScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.mappedType, upperScope, block, false); + } +} +exports.MappedTypeScope = MappedTypeScope; +//# sourceMappingURL=MappedTypeScope.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.js.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.js.map new file mode 100644 index 000000000..e5253b9ba --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"MappedTypeScope.js","sourceRoot":"","sources":["../../src/scope/MappedTypeScope.ts"],"names":[],"mappings":";;;AAEA,2CAAwC;AACxC,2CAAwC;AAGxC,MAAM,eAAgB,SAAQ,qBAI7B;IACC,YACE,YAA0B,EAC1B,UAAoC,EACpC,KAA+B;QAE/B,KAAK,CAAC,YAAY,EAAE,qBAAS,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC;CACF;AAEQ,0CAAe"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.d.ts new file mode 100644 index 000000000..ab4541bdb --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.d.ts @@ -0,0 +1,10 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +import { ScopeManager } from '../ScopeManager'; +declare class ModuleScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: ModuleScope['upper'], block: ModuleScope['block']); +} +export { ModuleScope }; +//# sourceMappingURL=ModuleScope.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.d.ts.map new file mode 100644 index 000000000..6a4890dae --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ModuleScope.d.ts","sourceRoot":"","sources":["../../src/scope/ModuleScope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,cAAM,WAAY,SAAQ,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;gBAE1E,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,EAChC,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC;CAI9B;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.js new file mode 100644 index 000000000..9d84e34a9 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ModuleScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class ModuleScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.module, upperScope, block, false); + } +} +exports.ModuleScope = ModuleScope; +//# sourceMappingURL=ModuleScope.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.js.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.js.map new file mode 100644 index 000000000..a2596f899 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ModuleScope.js","sourceRoot":"","sources":["../../src/scope/ModuleScope.ts"],"names":[],"mappings":";;;AAEA,2CAAwC;AACxC,2CAAwC;AAGxC,MAAM,WAAY,SAAQ,qBAAoD;IAC5E,YACE,YAA0B,EAC1B,UAAgC,EAChC,KAA2B;QAE3B,KAAK,CAAC,YAAY,EAAE,qBAAS,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAClE,CAAC;CACF;AAEQ,kCAAW"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.d.ts new file mode 100644 index 000000000..096539fa8 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.d.ts @@ -0,0 +1,19 @@ +import { BlockScope } from './BlockScope'; +import { CatchScope } from './CatchScope'; +import { ClassScope } from './ClassScope'; +import { ConditionalTypeScope } from './ConditionalTypeScope'; +import { ForScope } from './ForScope'; +import { FunctionExpressionNameScope } from './FunctionExpressionNameScope'; +import { FunctionScope } from './FunctionScope'; +import { FunctionTypeScope } from './FunctionTypeScope'; +import { GlobalScope } from './GlobalScope'; +import { MappedTypeScope } from './MappedTypeScope'; +import { ModuleScope } from './ModuleScope'; +import { SwitchScope } from './SwitchScope'; +import { TSEnumScope } from './TSEnumScope'; +import { TSModuleScope } from './TSModuleScope'; +import { TypeScope } from './TypeScope'; +import { WithScope } from './WithScope'; +declare type Scope = BlockScope | CatchScope | ClassScope | ConditionalTypeScope | ForScope | FunctionExpressionNameScope | FunctionScope | FunctionTypeScope | GlobalScope | MappedTypeScope | ModuleScope | SwitchScope | TSEnumScope | TSModuleScope | TypeScope | WithScope; +export { Scope }; +//# sourceMappingURL=Scope.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.d.ts.map new file mode 100644 index 000000000..48fc461b0 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Scope.d.ts","sourceRoot":"","sources":["../../src/scope/Scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,aAAK,KAAK,GACN,UAAU,GACV,UAAU,GACV,UAAU,GACV,oBAAoB,GACpB,QAAQ,GACR,2BAA2B,GAC3B,aAAa,GACb,iBAAiB,GACjB,WAAW,GACX,eAAe,GACf,WAAW,GACX,WAAW,GACX,WAAW,GACX,aAAa,GACb,SAAS,GACT,SAAS,CAAC;AAEd,OAAO,EAAE,KAAK,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.js new file mode 100644 index 000000000..676430c1c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=Scope.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.js.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.js.map new file mode 100644 index 000000000..03b04c832 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Scope.js","sourceRoot":"","sources":["../../src/scope/Scope.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.d.ts new file mode 100644 index 000000000..0adffd272 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.d.ts @@ -0,0 +1,106 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { FunctionScope } from './FunctionScope'; +import { GlobalScope } from './GlobalScope'; +import { ScopeType } from './ScopeType'; +import { ScopeManager } from '../ScopeManager'; +import { Scope } from './Scope'; +import { ModuleScope } from './ModuleScope'; +import { Definition } from '../definition'; +import { Reference, ReferenceFlag, ReferenceImplicitGlobal } from '../referencer/Reference'; +import { Variable } from '../variable'; +import { TSModuleScope } from './TSModuleScope'; +declare type VariableScope = GlobalScope | FunctionScope | ModuleScope | TSModuleScope; +declare abstract class ScopeBase { + #private; + /** + * A unique ID for this instance - primarily used to help debugging and testing + */ + readonly $id: number; + /** + * The AST node which created this scope. + * @public + */ + readonly block: TBlock; + /** + * The array of child scopes. This does not include grandchild scopes. + * @public + */ + readonly childScopes: Scope[]; + /** + * Whether this scope is created by a FunctionExpression. + * @public + */ + readonly functionExpressionScope: boolean; + /** + * Whether 'use strict' is in effect in this scope. + * @public + */ + isStrict: boolean; + /** + * List of {@link Reference}s that are left to be resolved (i.e. which + * need to be linked to the variable they refer to). + */ + protected leftToResolve: Reference[] | null; + /** + * Any variable {@link Reference} found in this scope. + * This includes occurrences of local variables as well as variables from parent scopes (including the global scope). + * For local variables this also includes defining occurrences (like in a 'var' statement). + * In a 'function' scope this does not include the occurrences of the formal parameter in the parameter list. + * @public + */ + readonly references: Reference[]; + /** + * The map from variable names to variable objects. + * @public + */ + readonly set: Map; + /** + * The {@link Reference}s that are not resolved with this scope. + * @public + */ + readonly through: Reference[]; + /** + * The type of scope + * @public + */ + readonly type: TType; + /** + * Reference to the parent {@link Scope}. + * @public + */ + readonly upper: TUpper; + /** + * The scoped {@link Variable}s of this scope. + * In the case of a 'function' scope this includes the automatic argument `arguments` as its first element, as well + * as all further formal arguments. + * This does not include variables which are defined in child scopes. + * @public + */ + readonly variables: Variable[]; + /** + * For scopes that can contain variable declarations, this is a self-reference. + * For other scope types this is the *variableScope* value of the parent scope. + * @public + */ + readonly variableScope: VariableScope; + constructor(scopeManager: ScopeManager, type: TType, upperScope: TUpper, block: TBlock, isMethodDefinition: boolean); + private isVariableScope; + shouldStaticallyClose(): boolean; + private shouldStaticallyCloseForGlobal; + close(scopeManager: ScopeManager): Scope | null; + /** + * To override by function scopes. + * References in default parameters isn't resolved to variables which are in their function body. + */ + protected isValidResolution(_ref: Reference, _variable: Variable): boolean; + protected delegateToUpperScope(ref: Reference): void; + private addDeclaredVariablesOfNode; + protected defineVariable(nameOrVariable: string | Variable, set: Map, variables: Variable[], node: TSESTree.Identifier | null, def: Definition | null): void; + defineIdentifier(node: TSESTree.Identifier, def: Definition): void; + defineLiteralIdentifier(node: TSESTree.StringLiteral, def: Definition): void; + referenceValue(node: TSESTree.Identifier | TSESTree.JSXIdentifier, assign?: ReferenceFlag, writeExpr?: TSESTree.Expression | null, maybeImplicitGlobal?: ReferenceImplicitGlobal | null, init?: boolean): void; + referenceType(node: TSESTree.Identifier): void; + referenceDualValueType(node: TSESTree.Identifier): void; +} +export { ScopeBase }; +//# sourceMappingURL=ScopeBase.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.d.ts.map new file mode 100644 index 000000000..d4c55a3c4 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ScopeBase.d.ts","sourceRoot":"","sources":["../../src/scope/ScopeBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAkB,MAAM,eAAe,CAAC;AAE3D,OAAO,EACL,SAAS,EACT,aAAa,EACb,uBAAuB,EAExB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AA8GhD,aAAK,aAAa,GAAG,WAAW,GAAG,aAAa,GAAG,WAAW,GAAG,aAAa,CAAC;AAS/E,uBAAe,SAAS,CACtB,KAAK,SAAS,SAAS,EACvB,MAAM,SAAS,QAAQ,CAAC,IAAI,EAC5B,MAAM,SAAS,KAAK,GAAG,IAAI;;IAE3B;;OAEG;IACH,SAAgB,GAAG,EAAE,MAAM,CAAe;IAE1C;;;OAGG;IACH,SAAgB,KAAK,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,SAAgB,WAAW,EAAE,KAAK,EAAE,CAAM;IAa1C;;;OAGG;IACH,SAAgB,uBAAuB,EAAE,OAAO,CAAS;IACzD;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AE,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,IAAI;IAIlE,uBAAuB,CAC5B,IAAI,EAAE,QAAQ,CAAC,aAAa,EAC5B,GAAG,EAAE,UAAU,GACd,IAAI;IAIA,cAAc,CACnB,IAAI,EAAE,QAAQ,CAAC,UAAU,GAAG,QAAQ,CAAC,aAAa,EAClD,MAAM,GAAE,aAAkC,EAC1C,SAAS,CAAC,EAAE,QAAQ,CAAC,UAAU,GAAG,IAAI,EACtC,mBAAmB,CAAC,EAAE,uBAAuB,GAAG,IAAI,EACpD,IAAI,UAAQ,GACX,IAAI;IAeA,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,GAAG,IAAI;IAe9C,sBAAsB,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,GAAG,IAAI;CAc/D;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.js new file mode 100644 index 000000000..d62fec586 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.js @@ -0,0 +1,369 @@ +"use strict"; +var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; +}; +var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); +}; +var _declaredVariables, _dynamic, _staticCloseRef, _dynamicCloseRef, _globalCloseRef; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ScopeBase = void 0; +const types_1 = require("@typescript-eslint/types"); +const ScopeType_1 = require("./ScopeType"); +const assert_1 = require("../assert"); +const definition_1 = require("../definition"); +const ID_1 = require("../ID"); +const Reference_1 = require("../referencer/Reference"); +const variable_1 = require("../variable"); +/** + * Test if scope is strict + */ +function isStrictScope(scope, block, isMethodDefinition) { + var _a; + let body; + // When upper scope is exists and strict, inner scope is also strict. + if ((_a = scope.upper) === null || _a === void 0 ? void 0 : _a.isStrict) { + return true; + } + if (isMethodDefinition) { + return true; + } + if (scope.type === ScopeType_1.ScopeType.class || + scope.type === ScopeType_1.ScopeType.conditionalType || + scope.type === ScopeType_1.ScopeType.functionType || + scope.type === ScopeType_1.ScopeType.mappedType || + scope.type === ScopeType_1.ScopeType.module || + scope.type === ScopeType_1.ScopeType.tsEnum || + scope.type === ScopeType_1.ScopeType.tsModule || + scope.type === ScopeType_1.ScopeType.type) { + return true; + } + if (scope.type === ScopeType_1.ScopeType.block || scope.type === ScopeType_1.ScopeType.switch) { + return false; + } + if (scope.type === ScopeType_1.ScopeType.function) { + const functionBody = block; + switch (functionBody.type) { + case types_1.AST_NODE_TYPES.ArrowFunctionExpression: + if (functionBody.body.type !== types_1.AST_NODE_TYPES.BlockStatement) { + return false; + } + body = functionBody.body; + break; + case types_1.AST_NODE_TYPES.Program: + body = functionBody; + break; + default: + body = functionBody.body; + } + if (!body) { + return false; + } + } + else if (scope.type === ScopeType_1.ScopeType.global) { + body = block; + } + else { + return false; + } + // Search 'use strict' directive. + for (let i = 0; i < body.body.length; ++i) { + const stmt = body.body[i]; + if (stmt.type !== types_1.AST_NODE_TYPES.ExpressionStatement) { + break; + } + const expr = stmt.expression; + if (expr.type !== types_1.AST_NODE_TYPES.Literal || + typeof expr.value !== 'string') { + break; + } + if (expr.raw !== null && expr.raw !== undefined) { + if (expr.raw === '"use strict"' || expr.raw === "'use strict'") { + return true; + } + } + else { + if (expr.value === 'use strict') { + return true; + } + } + } + return false; +} +/** + * Register scope + */ +function registerScope(scopeManager, scope) { + scopeManager.scopes.push(scope); + const scopes = scopeManager.nodeToScope.get(scope.block); + if (scopes) { + scopes.push(scope); + } + else { + scopeManager.nodeToScope.set(scope.block, [scope]); + } +} +const generator = ID_1.createIdGenerator(); +const VARIABLE_SCOPE_TYPES = new Set([ + ScopeType_1.ScopeType.global, + ScopeType_1.ScopeType.function, + ScopeType_1.ScopeType.module, + ScopeType_1.ScopeType.tsModule, +]); +class ScopeBase { + constructor(scopeManager, type, upperScope, block, isMethodDefinition) { + /** + * A unique ID for this instance - primarily used to help debugging and testing + */ + this.$id = generator(); + /** + * The array of child scopes. This does not include grandchild scopes. + * @public + */ + this.childScopes = []; + /** + * A map of the variables for each node in this scope. + * This is map is a pointer to the one in the parent ScopeManager instance + */ + _declaredVariables.set(this, void 0); + /** + * Generally, through the lexical scoping of JS you can always know which variable an identifier in the source code + * refers to. There are a few exceptions to this rule. With `global` and `with` scopes you can only decide at runtime + * which variable a reference refers to. + * All those scopes are considered "dynamic". + */ + _dynamic.set(this, void 0); + /** + * Whether this scope is created by a FunctionExpression. + * @public + */ + this.functionExpressionScope = false; + /** + * List of {@link Reference}s that are left to be resolved (i.e. which + * need to be linked to the variable they refer to). + */ + this.leftToResolve = []; + /** + * Any variable {@link Reference} found in this scope. + * This includes occurrences of local variables as well as variables from parent scopes (including the global scope). + * For local variables this also includes defining occurrences (like in a 'var' statement). + * In a 'function' scope this does not include the occurrences of the formal parameter in the parameter list. + * @public + */ + this.references = []; + /** + * The map from variable names to variable objects. + * @public + */ + this.set = new Map(); + /** + * The {@link Reference}s that are not resolved with this scope. + * @public + */ + this.through = []; + /** + * The scoped {@link Variable}s of this scope. + * In the case of a 'function' scope this includes the automatic argument `arguments` as its first element, as well + * as all further formal arguments. + * This does not include variables which are defined in child scopes. + * @public + */ + this.variables = []; + _staticCloseRef.set(this, (ref) => { + const resolve = () => { + const name = ref.identifier.name; + const variable = this.set.get(name); + if (!variable) { + return false; + } + if (!this.isValidResolution(ref, variable)) { + return false; + } + // make sure we don't match a type reference to a value variable + const isValidTypeReference = ref.isTypeReference && variable.isTypeVariable; + const isValidValueReference = ref.isValueReference && variable.isValueVariable; + if (!isValidTypeReference && !isValidValueReference) { + return false; + } + variable.references.push(ref); + ref.resolved = variable; + return true; + }; + if (!resolve()) { + this.delegateToUpperScope(ref); + } + }); + _dynamicCloseRef.set(this, (ref) => { + // notify all names are through to global + let current = this; + do { + current.through.push(ref); + current = current.upper; + } while (current); + }); + _globalCloseRef.set(this, (ref, scopeManager) => { + // let/const/class declarations should be resolved statically. + // others should be resolved dynamically. + if (this.shouldStaticallyCloseForGlobal(ref, scopeManager)) { + __classPrivateFieldGet(this, _staticCloseRef).call(this, ref); + } + else { + __classPrivateFieldGet(this, _dynamicCloseRef).call(this, ref); + } + }); + const upperScopeAsScopeBase = upperScope; + this.type = type; + __classPrivateFieldSet(this, _dynamic, this.type === ScopeType_1.ScopeType.global || this.type === ScopeType_1.ScopeType.with); + this.block = block; + this.variableScope = this.isVariableScope() + ? this + : upperScopeAsScopeBase.variableScope; + this.upper = upperScope; + /** + * Whether 'use strict' is in effect in this scope. + * @member {boolean} Scope#isStrict + */ + this.isStrict = isStrictScope(this, block, isMethodDefinition); + if (upperScopeAsScopeBase) { + // this is guaranteed to be correct at runtime + upperScopeAsScopeBase.childScopes.push(this); + } + __classPrivateFieldSet(this, _declaredVariables, scopeManager.declaredVariables); + registerScope(scopeManager, this); + } + isVariableScope() { + return VARIABLE_SCOPE_TYPES.has(this.type); + } + shouldStaticallyClose() { + return !__classPrivateFieldGet(this, _dynamic); + } + shouldStaticallyCloseForGlobal(ref, scopeManager) { + // On global scope, let/const/class declarations should be resolved statically. + const name = ref.identifier.name; + const variable = this.set.get(name); + if (!variable) { + return false; + } + // variable exists on the scope + // in module mode, we can statically resolve everything, regardless of its decl type + if (scopeManager.isModule()) { + return true; + } + // in script mode, only certain cases should be statically resolved + // Example: + // a `var` decl is ignored by the runtime if it clashes with a global name + // this means that we should not resolve the reference to the variable + const defs = variable.defs; + return (defs.length > 0 && + defs.every(def => { + var _a; + if (def.type === definition_1.DefinitionType.Variable && + ((_a = def.parent) === null || _a === void 0 ? void 0 : _a.type) === types_1.AST_NODE_TYPES.VariableDeclaration && + def.parent.kind === 'var') { + return false; + } + return true; + })); + } + close(scopeManager) { + let closeRef; + if (this.shouldStaticallyClose()) { + closeRef = __classPrivateFieldGet(this, _staticCloseRef); + } + else if (this.type !== 'global') { + closeRef = __classPrivateFieldGet(this, _dynamicCloseRef); + } + else { + closeRef = __classPrivateFieldGet(this, _globalCloseRef); + } + // Try Resolving all references in this scope. + assert_1.assert(this.leftToResolve); + for (let i = 0; i < this.leftToResolve.length; ++i) { + const ref = this.leftToResolve[i]; + closeRef(ref, scopeManager); + } + this.leftToResolve = null; + return this.upper; + } + /** + * To override by function scopes. + * References in default parameters isn't resolved to variables which are in their function body. + */ + isValidResolution(_ref, _variable) { + return true; + } + delegateToUpperScope(ref) { + const upper = this.upper; + if (upper === null || upper === void 0 ? void 0 : upper.leftToResolve) { + upper.leftToResolve.push(ref); + } + this.through.push(ref); + } + addDeclaredVariablesOfNode(variable, node) { + if (node == null) { + return; + } + let variables = __classPrivateFieldGet(this, _declaredVariables).get(node); + if (variables == null) { + variables = []; + __classPrivateFieldGet(this, _declaredVariables).set(node, variables); + } + if (!variables.includes(variable)) { + variables.push(variable); + } + } + defineVariable(nameOrVariable, set, variables, node, def) { + const name = typeof nameOrVariable === 'string' ? nameOrVariable : nameOrVariable.name; + let variable = set.get(name); + if (!variable) { + variable = + typeof nameOrVariable === 'string' + ? new variable_1.Variable(name, this) + : nameOrVariable; + set.set(name, variable); + variables.push(variable); + } + if (def) { + variable.defs.push(def); + this.addDeclaredVariablesOfNode(variable, def.node); + this.addDeclaredVariablesOfNode(variable, def.parent); + } + if (node) { + variable.identifiers.push(node); + } + } + defineIdentifier(node, def) { + this.defineVariable(node.name, this.set, this.variables, node, def); + } + defineLiteralIdentifier(node, def) { + this.defineVariable(node.value, this.set, this.variables, null, def); + } + referenceValue(node, assign = Reference_1.ReferenceFlag.Read, writeExpr, maybeImplicitGlobal, init = false) { + var _a; + const ref = new Reference_1.Reference(node, this, assign, writeExpr, maybeImplicitGlobal, init, Reference_1.ReferenceTypeFlag.Value); + this.references.push(ref); + (_a = this.leftToResolve) === null || _a === void 0 ? void 0 : _a.push(ref); + } + referenceType(node) { + var _a; + const ref = new Reference_1.Reference(node, this, Reference_1.ReferenceFlag.Read, null, null, false, Reference_1.ReferenceTypeFlag.Type); + this.references.push(ref); + (_a = this.leftToResolve) === null || _a === void 0 ? void 0 : _a.push(ref); + } + referenceDualValueType(node) { + var _a; + const ref = new Reference_1.Reference(node, this, Reference_1.ReferenceFlag.Read, null, null, false, Reference_1.ReferenceTypeFlag.Type | Reference_1.ReferenceTypeFlag.Value); + this.references.push(ref); + (_a = this.leftToResolve) === null || _a === void 0 ? void 0 : _a.push(ref); + } +} +exports.ScopeBase = ScopeBase; +_declaredVariables = new WeakMap(), _dynamic = new WeakMap(), _staticCloseRef = new WeakMap(), _dynamicCloseRef = new WeakMap(), _globalCloseRef = new WeakMap(); +//# sourceMappingURL=ScopeBase.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.js.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.js.map new file mode 100644 index 000000000..5adba46a8 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ScopeBase.js","sourceRoot":"","sources":["../../src/scope/ScopeBase.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oDAAoE;AAGpE,2CAAwC;AAIxC,sCAAmC;AACnC,8CAA2D;AAC3D,8BAA0C;AAC1C,uDAKiC;AACjC,0CAAuC;AAGvC;;GAEG;AACH,SAAS,aAAa,CACpB,KAAY,EACZ,KAAoB,EACpB,kBAA2B;;IAE3B,IAAI,IAAmE,CAAC;IAExE,qEAAqE;IACrE,UAAI,KAAK,CAAC,KAAK,0CAAE,QAAQ,EAAE;QACzB,OAAO,IAAI,CAAC;KACb;IAED,IAAI,kBAAkB,EAAE;QACtB,OAAO,IAAI,C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I,EACJ,KAAK,EACL,6BAAiB,CAAC,IAAI,GAAG,6BAAiB,CAAC,KAAK,CACjD,CAAC;QAEF,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1B,MAAA,IAAI,CAAC,aAAa,0CAAE,IAAI,CAAC,GAAG,EAAE;IAChC,CAAC;CACF;AAEQ,8BAAS"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.d.ts new file mode 100644 index 000000000..25620ea99 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.d.ts @@ -0,0 +1,20 @@ +declare enum ScopeType { + block = "block", + catch = "catch", + class = "class", + conditionalType = "conditionalType", + for = "for", + function = "function", + functionExpressionName = "function-expression-name", + functionType = "functionType", + global = "global", + mappedType = "mappedType", + module = "module", + switch = "switch", + tsEnum = "tsEnum", + tsModule = "tsModule", + type = "type", + with = "with" +} +export { ScopeType }; +//# sourceMappingURL=ScopeType.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.d.ts.map new file mode 100644 index 000000000..9cbf79064 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ScopeType.d.ts","sourceRoot":"","sources":["../../src/scope/ScopeType.ts"],"names":[],"mappings":"AAAA,aAAK,SAAS;IACZ,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,UAAU;IACf,eAAe,oBAAoB;IACnC,GAAG,QAAQ;IACX,QAAQ,aAAa;IACrB,sBAAsB,6BAA6B;IACnD,YAAY,iBAAiB;IAC7B,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.js new file mode 100644 index 000000000..32b0d4a84 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ScopeType = void 0; +var ScopeType; +(function (ScopeType) { + ScopeType["block"] = "block"; + ScopeType["catch"] = "catch"; + ScopeType["class"] = "class"; + ScopeType["conditionalType"] = "conditionalType"; + ScopeType["for"] = "for"; + ScopeType["function"] = "function"; + ScopeType["functionExpressionName"] = "function-expression-name"; + ScopeType["functionType"] = "functionType"; + ScopeType["global"] = "global"; + ScopeType["mappedType"] = "mappedType"; + ScopeType["module"] = "module"; + ScopeType["switch"] = "switch"; + ScopeType["tsEnum"] = "tsEnum"; + ScopeType["tsModule"] = "tsModule"; + ScopeType["type"] = "type"; + ScopeType["with"] = "with"; +})(ScopeType || (ScopeType = {})); +exports.ScopeType = ScopeType; +//# sourceMappingURL=ScopeType.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.js.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.js.map new file mode 100644 index 000000000..6544bc157 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ScopeType.js","sourceRoot":"","sources":["../../src/scope/ScopeType.ts"],"names":[],"mappings":";;;AAAA,IAAK,SAiBJ;AAjBD,WAAK,SAAS;IACZ,4BAAe,CAAA;IACf,4BAAe,CAAA;IACf,4BAAe,CAAA;IACf,gDAAmC,CAAA;IACnC,wBAAW,CAAA;IACX,kCAAqB,CAAA;IACrB,gEAAmD,CAAA;IACnD,0CAA6B,CAAA;IAC7B,8BAAiB,CAAA;IACjB,sCAAyB,CAAA;IACzB,8BAAiB,CAAA;IACjB,8BAAiB,CAAA;IACjB,8BAAiB,CAAA;IACjB,kCAAqB,CAAA;IACrB,0BAAa,CAAA;IACb,0BAAa,CAAA;AACf,CAAC,EAjBI,SAAS,KAAT,SAAS,QAiBb;AAEQ,8BAAS"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.d.ts new file mode 100644 index 000000000..32c51c717 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.d.ts @@ -0,0 +1,10 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +import { ScopeManager } from '../ScopeManager'; +declare class SwitchScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: SwitchScope['upper'], block: SwitchScope['block']); +} +export { SwitchScope }; +//# sourceMappingURL=SwitchScope.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.d.ts.map new file mode 100644 index 000000000..d992332f8 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SwitchScope.d.ts","sourceRoot":"","sources":["../../src/scope/SwitchScope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,cAAM,WAAY,SAAQ,SAAS,CACjC,SAAS,CAAC,MAAM,EAChB,QAAQ,CAAC,eAAe,EACxB,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,EAChC,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC;CAI9B;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.js new file mode 100644 index 000000000..9229e4edc --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SwitchScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class SwitchScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.switch, upperScope, block, false); + } +} +exports.SwitchScope = SwitchScope; +//# sourceMappingURL=SwitchScope.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.js.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.js.map new file mode 100644 index 000000000..0e3d4095e --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"SwitchScope.js","sourceRoot":"","sources":["../../src/scope/SwitchScope.ts"],"names":[],"mappings":";;;AAEA,2CAAwC;AACxC,2CAAwC;AAGxC,MAAM,WAAY,SAAQ,qBAIzB;IACC,YACE,YAA0B,EAC1B,UAAgC,EAChC,KAA2B;QAE3B,KAAK,CAAC,YAAY,EAAE,qBAAS,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAClE,CAAC;CACF;AAEQ,kCAAW"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.d.ts new file mode 100644 index 000000000..708fef31d --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.d.ts @@ -0,0 +1,10 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +import { ScopeManager } from '../ScopeManager'; +declare class TSEnumScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: TSEnumScope['upper'], block: TSEnumScope['block']); +} +export { TSEnumScope }; +//# sourceMappingURL=TSEnumScope.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.d.ts.map new file mode 100644 index 000000000..e47c446b8 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TSEnumScope.d.ts","sourceRoot":"","sources":["../../src/scope/TSEnumScope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,cAAM,WAAY,SAAQ,SAAS,CACjC,SAAS,CAAC,MAAM,EAChB,QAAQ,CAAC,iBAAiB,EAC1B,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,EAChC,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC;CAI9B;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.js new file mode 100644 index 000000000..1f51bfb1c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TSEnumScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class TSEnumScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.tsEnum, upperScope, block, false); + } +} +exports.TSEnumScope = TSEnumScope; +//# sourceMappingURL=TSEnumScope.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.js.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.js.map new file mode 100644 index 000000000..57369e313 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TSEnumScope.js","sourceRoot":"","sources":["../../src/scope/TSEnumScope.ts"],"names":[],"mappings":";;;AAEA,2CAAwC;AACxC,2CAAwC;AAGxC,MAAM,WAAY,SAAQ,qBAIzB;IACC,YACE,YAA0B,EAC1B,UAAgC,EAChC,KAA2B;QAE3B,KAAK,CAAC,YAAY,EAAE,qBAAS,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAClE,CAAC;CACF;AAEQ,kCAAW"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.d.ts new file mode 100644 index 000000000..fda2795c6 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.d.ts @@ -0,0 +1,10 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +import { ScopeManager } from '../ScopeManager'; +declare class TSModuleScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: TSModuleScope['upper'], block: TSModuleScope['block']); +} +export { TSModuleScope }; +//# sourceMappingURL=TSModuleScope.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.d.ts.map new file mode 100644 index 000000000..131196af4 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TSModuleScope.d.ts","sourceRoot":"","sources":["../../src/scope/TSModuleScope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,cAAM,aAAc,SAAQ,SAAS,CACnC,SAAS,CAAC,QAAQ,EAClB,QAAQ,CAAC,mBAAmB,EAC5B,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC,EAClC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC;CAIhC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.js new file mode 100644 index 000000000..86279082f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TSModuleScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class TSModuleScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.tsModule, upperScope, block, false); + } +} +exports.TSModuleScope = TSModuleScope; +//# sourceMappingURL=TSModuleScope.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.js.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.js.map new file mode 100644 index 000000000..c48350e16 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TSModuleScope.js","sourceRoot":"","sources":["../../src/scope/TSModuleScope.ts"],"names":[],"mappings":";;;AAEA,2CAAwC;AACxC,2CAAwC;AAGxC,MAAM,aAAc,SAAQ,qBAI3B;IACC,YACE,YAA0B,EAC1B,UAAkC,EAClC,KAA6B;QAE7B,KAAK,CAAC,YAAY,EAAE,qBAAS,CAAC,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IACpE,CAAC;CACF;AAEQ,sCAAa"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.d.ts new file mode 100644 index 000000000..f9313a220 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.d.ts @@ -0,0 +1,10 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +import { ScopeManager } from '../ScopeManager'; +declare class TypeScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: TypeScope['upper'], block: TypeScope['block']); +} +export { TypeScope }; +//# sourceMappingURL=TypeScope.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.d.ts.map new file mode 100644 index 000000000..cbc122914 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TypeScope.d.ts","sourceRoot":"","sources":["../../src/scope/TypeScope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,cAAM,SAAU,SAAQ,SAAS,CAC/B,SAAS,CAAC,IAAI,EACd,QAAQ,CAAC,sBAAsB,GAAG,QAAQ,CAAC,sBAAsB,EACjE,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,SAAS,CAAC,OAAO,CAAC,EAC9B,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC;CAI5B;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.js new file mode 100644 index 000000000..ebbf5fe65 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TypeScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class TypeScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.type, upperScope, block, false); + } +} +exports.TypeScope = TypeScope; +//# sourceMappingURL=TypeScope.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.js.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.js.map new file mode 100644 index 000000000..74dc282c2 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TypeScope.js","sourceRoot":"","sources":["../../src/scope/TypeScope.ts"],"names":[],"mappings":";;;AAEA,2CAAwC;AACxC,2CAAwC;AAGxC,MAAM,SAAU,SAAQ,qBAIvB;IACC,YACE,YAA0B,EAC1B,UAA8B,EAC9B,KAAyB;QAEzB,KAAK,CAAC,YAAY,EAAE,qBAAS,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAChE,CAAC;CACF;AAEQ,8BAAS"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.d.ts new file mode 100644 index 000000000..8859b66b3 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.d.ts @@ -0,0 +1,11 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +import { ScopeManager } from '../ScopeManager'; +declare class WithScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: WithScope['upper'], block: WithScope['block']); + close(scopeManager: ScopeManager): Scope | null; +} +export { WithScope }; +//# sourceMappingURL=WithScope.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.d.ts.map new file mode 100644 index 000000000..f885c28db --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"WithScope.d.ts","sourceRoot":"","sources":["../../src/scope/WithScope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,cAAM,SAAU,SAAQ,SAAS,CAC/B,SAAS,CAAC,IAAI,EACd,QAAQ,CAAC,aAAa,EACtB,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,SAAS,CAAC,OAAO,CAAC,EAC9B,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC;IAI3B,KAAK,CAAC,YAAY,EAAE,YAAY,GAAG,KAAK,GAAG,IAAI;CAYhD;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.js new file mode 100644 index 000000000..896d27df4 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WithScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +const assert_1 = require("../assert"); +class WithScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.with, upperScope, block, false); + } + close(scopeManager) { + if (this.shouldStaticallyClose()) { + return super.close(scopeManager); + } + assert_1.assert(this.leftToResolve); + for (let i = 0; i < this.leftToResolve.length; ++i) { + const ref = this.leftToResolve[i]; + this.delegateToUpperScope(ref); + } + this.leftToResolve = null; + return this.upper; + } +} +exports.WithScope = WithScope; +//# sourceMappingURL=WithScope.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.js.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.js.map new file mode 100644 index 000000000..afab84e78 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"WithScope.js","sourceRoot":"","sources":["../../src/scope/WithScope.ts"],"names":[],"mappings":";;;AAEA,2CAAwC;AACxC,2CAAwC;AACxC,sCAAmC;AAGnC,MAAM,SAAU,SAAQ,qBAIvB;IACC,YACE,YAA0B,EAC1B,UAA8B,EAC9B,KAAyB;QAEzB,KAAK,CAAC,YAAY,EAAE,qBAAS,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAChE,CAAC;IACD,KAAK,CAAC,YAA0B;QAC9B,IAAI,IAAI,CAAC,qBAAqB,EAAE,EAAE;YAChC,OAAO,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;SAClC;QACD,eAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;YAClD,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;YAClC,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC;SAChC;QACD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF;AAEQ,8BAAS"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/index.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/scope/index.d.ts new file mode 100644 index 000000000..3bbcd26f1 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/index.d.ts @@ -0,0 +1,19 @@ +export * from './BlockScope'; +export * from './CatchScope'; +export * from './ClassScope'; +export * from './ConditionalTypeScope'; +export * from './ForScope'; +export * from './FunctionExpressionNameScope'; +export * from './FunctionScope'; +export * from './FunctionTypeScope'; +export * from './GlobalScope'; +export * from './MappedTypeScope'; +export * from './ModuleScope'; +export * from './Scope'; +export * from './ScopeType'; +export * from './SwitchScope'; +export * from './TSEnumScope'; +export * from './TSModuleScope'; +export * from './TypeScope'; +export * from './WithScope'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/index.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/index.d.ts.map new file mode 100644 index 000000000..15054aacf --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scope/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/index.js b/node_modules/@typescript-eslint/scope-manager/dist/scope/index.js new file mode 100644 index 000000000..62800830c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/index.js @@ -0,0 +1,31 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./BlockScope"), exports); +__exportStar(require("./CatchScope"), exports); +__exportStar(require("./ClassScope"), exports); +__exportStar(require("./ConditionalTypeScope"), exports); +__exportStar(require("./ForScope"), exports); +__exportStar(require("./FunctionExpressionNameScope"), exports); +__exportStar(require("./FunctionScope"), exports); +__exportStar(require("./FunctionTypeScope"), exports); +__exportStar(require("./GlobalScope"), exports); +__exportStar(require("./MappedTypeScope"), exports); +__exportStar(require("./ModuleScope"), exports); +__exportStar(require("./Scope"), exports); +__exportStar(require("./ScopeType"), exports); +__exportStar(require("./SwitchScope"), exports); +__exportStar(require("./TSEnumScope"), exports); +__exportStar(require("./TSModuleScope"), exports); +__exportStar(require("./TypeScope"), exports); +__exportStar(require("./WithScope"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/scope/index.js.map b/node_modules/@typescript-eslint/scope-manager/dist/scope/index.js.map new file mode 100644 index 000000000..23098f0a6 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/scope/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scope/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA6B;AAC7B,+CAA6B;AAC7B,+CAA6B;AAC7B,yDAAuC;AACvC,6CAA2B;AAC3B,gEAA8C;AAC9C,kDAAgC;AAChC,sDAAoC;AACpC,gDAA8B;AAC9B,oDAAkC;AAClC,gDAA8B;AAC9B,0CAAwB;AACxB,8CAA4B;AAC5B,gDAA8B;AAC9B,gDAA8B;AAC9B,kDAAgC;AAChC,8CAA4B;AAC5B,8CAA4B"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.d.ts new file mode 100644 index 000000000..29e3faf79 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.d.ts @@ -0,0 +1,34 @@ +import { VariableBase } from './VariableBase'; +import { TSESTree } from '@typescript-eslint/types'; +/** + * ESLint defines global variables using the eslint-scope Variable class + * This is declared her for consumers to use + */ +declare class ESLintScopeVariable extends VariableBase { + /** + * Written to by ESLint. + * If this key exists, this variable is a global variable added by ESLint. + * If this is `true`, this variable can be assigned arbitrary values. + * If this is `false`, this variable is readonly. + */ + writeable?: boolean; + /** + * Written to by ESLint. + * This property is undefined if there are no globals directive comments. + * The array of globals directive comments which defined this global variable in the source code file. + */ + eslintExplicitGlobal?: boolean; + /** + * Written to by ESLint. + * The configured value in config files. This can be different from `variable.writeable` if there are globals directive comments. + */ + eslintImplicitGlobalSetting?: 'readonly' | 'writable'; + /** + * Written to by ESLint. + * If this key exists, it is a global variable added by ESLint. + * If `true`, this global variable was defined by a globals directive comment in the source code file. + */ + eslintExplicitGlobalComments?: TSESTree.Comment[]; +} +export { ESLintScopeVariable }; +//# sourceMappingURL=ESLintScopeVariable.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.d.ts.map new file mode 100644 index 000000000..e13cbdc15 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ESLintScopeVariable.d.ts","sourceRoot":"","sources":["../../src/variable/ESLintScopeVariable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD;;;GAGG;AACH,cAAM,mBAAoB,SAAQ,YAAY;IAC5C;;;;;OAKG;IACI,SAAS,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;OAIG;IACI,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAEtC;;;OAGG;IACI,2BAA2B,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IAE7D;;;;OAIG;IACI,4BAA4B,CAAC,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;CAC1D;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.js b/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.js new file mode 100644 index 000000000..f0a2f6098 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ESLintScopeVariable = void 0; +const VariableBase_1 = require("./VariableBase"); +/** + * ESLint defines global variables using the eslint-scope Variable class + * This is declared her for consumers to use + */ +class ESLintScopeVariable extends VariableBase_1.VariableBase { +} +exports.ESLintScopeVariable = ESLintScopeVariable; +//# sourceMappingURL=ESLintScopeVariable.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.js.map b/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.js.map new file mode 100644 index 000000000..9769938ee --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ESLintScopeVariable.js","sourceRoot":"","sources":["../../src/variable/ESLintScopeVariable.ts"],"names":[],"mappings":";;;AAAA,iDAA8C;AAG9C;;;GAGG;AACH,MAAM,mBAAoB,SAAQ,2BAAY;CA4B7C;AAEQ,kDAAmB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.d.ts new file mode 100644 index 000000000..9622d1766 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.d.ts @@ -0,0 +1,26 @@ +import { ESLintScopeVariable } from './ESLintScopeVariable'; +import { Variable } from './Variable'; +import { Scope } from '../scope'; +interface ImplicitLibVariableOptions { + readonly eslintImplicitGlobalSetting?: ESLintScopeVariable['eslintImplicitGlobalSetting']; + readonly isTypeVariable?: boolean; + readonly isValueVariable?: boolean; + readonly name: string; + readonly writeable?: boolean; +} +/** + * An variable implicitly defined by the TS Lib + */ +declare class ImplicitLibVariable extends ESLintScopeVariable implements Variable { + /** + * `true` if the variable is valid in a type context, false otherwise + */ + readonly isTypeVariable: boolean; + /** + * `true` if the variable is valid in a value context, false otherwise + */ + readonly isValueVariable: boolean; + constructor(scope: Scope, { isTypeVariable, isValueVariable, name, writeable, eslintImplicitGlobalSetting, }: ImplicitLibVariableOptions); +} +export { ImplicitLibVariable, ImplicitLibVariableOptions }; +//# sourceMappingURL=ImplicitLibVariable.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.d.ts.map new file mode 100644 index 000000000..a9bc0c596 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ImplicitLibVariable.d.ts","sourceRoot":"","sources":["../../src/variable/ImplicitLibVariable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,UAAU,0BAA0B;IAClC,QAAQ,CAAC,2BAA2B,CAAC,EAAE,mBAAmB,CAAC,6BAA6B,CAAC,CAAC;IAC1F,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;GAEG;AACH,cAAM,mBAAoB,SAAQ,mBAAoB,YAAW,QAAQ;IACvE;;OAEG;IACH,SAAgB,cAAc,EAAE,OAAO,CAAC;IAExC;;OAEG;IACH,SAAgB,eAAe,EAAE,OAAO,CAAC;gBAGvC,KAAK,EAAE,KAAK,EACZ,EACE,cAAc,EACd,eAAe,EACf,IAAI,EACJ,SAAS,EACT,2BAA2B,GAC5B,EAAE,0BAA0B;CAShC;AAED,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.js b/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.js new file mode 100644 index 000000000..2f0a9e3d0 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ImplicitLibVariable = void 0; +const ESLintScopeVariable_1 = require("./ESLintScopeVariable"); +/** + * An variable implicitly defined by the TS Lib + */ +class ImplicitLibVariable extends ESLintScopeVariable_1.ESLintScopeVariable { + constructor(scope, { isTypeVariable, isValueVariable, name, writeable, eslintImplicitGlobalSetting, }) { + super(name, scope); + this.isTypeVariable = isTypeVariable !== null && isTypeVariable !== void 0 ? isTypeVariable : false; + this.isValueVariable = isValueVariable !== null && isValueVariable !== void 0 ? isValueVariable : false; + this.writeable = writeable !== null && writeable !== void 0 ? writeable : false; + this.eslintImplicitGlobalSetting = eslintImplicitGlobalSetting !== null && eslintImplicitGlobalSetting !== void 0 ? eslintImplicitGlobalSetting : 'readonly'; + } +} +exports.ImplicitLibVariable = ImplicitLibVariable; +//# sourceMappingURL=ImplicitLibVariable.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.js.map b/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.js.map new file mode 100644 index 000000000..7e62cbee2 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ImplicitLibVariable.js","sourceRoot":"","sources":["../../src/variable/ImplicitLibVariable.ts"],"names":[],"mappings":";;;AAAA,+DAA4D;AAY5D;;GAEG;AACH,MAAM,mBAAoB,SAAQ,yCAAmB;IAWnD,YACE,KAAY,EACZ,EACE,cAAc,EACd,eAAe,EACf,IAAI,EACJ,SAAS,EACT,2BAA2B,GACA;QAE7B,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACnB,IAAI,CAAC,cAAc,GAAG,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,KAAK,CAAC;QAC9C,IAAI,CAAC,eAAe,GAAG,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,KAAK,CAAC;QAChD,IAAI,CAAC,SAAS,GAAG,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,KAAK,CAAC;QACpC,IAAI,CAAC,2BAA2B,GAC9B,2BAA2B,aAA3B,2BAA2B,cAA3B,2BAA2B,GAAI,UAAU,CAAC;IAC9C,CAAC;CACF;AAEQ,kDAAmB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.d.ts new file mode 100644 index 000000000..83754b17f --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.d.ts @@ -0,0 +1,18 @@ +import { VariableBase } from './VariableBase'; +/** + * A Variable represents a locally scoped identifier. These include arguments to functions. + */ +declare class Variable extends VariableBase { + /** + * `true` if the variable is valid in a type context, false otherwise + * @public + */ + get isTypeVariable(): boolean; + /** + * `true` if the variable is valid in a value context, false otherwise + * @public + */ + get isValueVariable(): boolean; +} +export { Variable }; +//# sourceMappingURL=Variable.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.d.ts.map new file mode 100644 index 000000000..9b56c4f47 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Variable.d.ts","sourceRoot":"","sources":["../../src/variable/Variable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;GAEG;AACH,cAAM,QAAS,SAAQ,YAAY;IACjC;;;OAGG;IACH,IAAW,cAAc,IAAI,OAAO,CAOnC;IAED;;;OAGG;IACH,IAAW,eAAe,IAAI,OAAO,CAOpC;CACF;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.js b/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.js new file mode 100644 index 000000000..8b72550ee --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Variable = void 0; +const VariableBase_1 = require("./VariableBase"); +/** + * A Variable represents a locally scoped identifier. These include arguments to functions. + */ +class Variable extends VariableBase_1.VariableBase { + /** + * `true` if the variable is valid in a type context, false otherwise + * @public + */ + get isTypeVariable() { + if (this.defs.length === 0) { + // we don't statically know whether this is a type or a value + return true; + } + return this.defs.some(def => def.isTypeDefinition); + } + /** + * `true` if the variable is valid in a value context, false otherwise + * @public + */ + get isValueVariable() { + if (this.defs.length === 0) { + // we don't statically know whether this is a type or a value + return true; + } + return this.defs.some(def => def.isVariableDefinition); + } +} +exports.Variable = Variable; +//# sourceMappingURL=Variable.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.js.map b/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.js.map new file mode 100644 index 000000000..43c4b8c63 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Variable.js","sourceRoot":"","sources":["../../src/variable/Variable.ts"],"names":[],"mappings":";;;AAAA,iDAA8C;AAE9C;;GAEG;AACH,MAAM,QAAS,SAAQ,2BAAY;IACjC;;;OAGG;IACH,IAAW,cAAc;QACvB,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1B,6DAA6D;YAC7D,OAAO,IAAI,CAAC;SACb;QAED,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACrD,CAAC;IAED;;;OAGG;IACH,IAAW,eAAe;QACxB,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1B,6DAA6D;YAC7D,OAAO,IAAI,CAAC;SACb;QAED,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACzD,CAAC;CACF;AAEQ,4BAAQ"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.d.ts new file mode 100644 index 000000000..983dcd048 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.d.ts @@ -0,0 +1,44 @@ +import { TSESTree } from '@typescript-eslint/types'; +import { Definition } from '../definition'; +import { Reference } from '../referencer/Reference'; +import { Scope } from '../scope'; +declare class VariableBase { + /** + * A unique ID for this instance - primarily used to help debugging and testing + */ + readonly $id: number; + /** + * The array of the definitions of this variable. + * @public + */ + readonly defs: Definition[]; + /** + * True if the variable is considered used for the purposes of `no-unused-vars`, false otherwise. + * @public + */ + eslintUsed: boolean; + /** + * The array of `Identifier` nodes which define this variable. + * If this variable is redeclared, this array includes two or more nodes. + * @public + */ + readonly identifiers: TSESTree.Identifier[]; + /** + * The variable name, as given in the source code. + * @public + */ + readonly name: string; + /** + * List of {@link Reference} of this variable (excluding parameter entries) in its defining scope and all nested scopes. + * For defining occurrences only see {@link Variable#defs}. + * @public + */ + readonly references: Reference[]; + /** + * Reference to the enclosing Scope. + */ + readonly scope: Scope; + constructor(name: string, scope: Scope); +} +export { VariableBase }; +//# sourceMappingURL=VariableBase.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.d.ts.map new file mode 100644 index 000000000..23304c964 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"VariableBase.d.ts","sourceRoot":"","sources":["../../src/variable/VariableBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAIjC,cAAM,YAAY;IAChB;;OAEG;IACH,SAAgB,GAAG,EAAE,MAAM,CAAe;IAE1C;;;OAGG;IACH,SAAgB,IAAI,EAAE,UAAU,EAAE,CAAM;IACxC;;;OAGG;IACI,UAAU,UAAS;IAC1B;;;;OAIG;IACH,SAAgB,WAAW,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAM;IACxD;;;OAGG;IACH,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B;;;;OAIG;IACH,SAAgB,UAAU,EAAE,SAAS,EAAE,CAAM;IAC7C;;OAEG;IACH,SAAgB,KAAK,EAAE,KAAK,CAAC;gBAEjB,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK;CAIvC;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.js b/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.js new file mode 100644 index 000000000..706ab8990 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VariableBase = void 0; +const ID_1 = require("../ID"); +const generator = ID_1.createIdGenerator(); +class VariableBase { + constructor(name, scope) { + /** + * A unique ID for this instance - primarily used to help debugging and testing + */ + this.$id = generator(); + /** + * The array of the definitions of this variable. + * @public + */ + this.defs = []; + /** + * True if the variable is considered used for the purposes of `no-unused-vars`, false otherwise. + * @public + */ + this.eslintUsed = false; + /** + * The array of `Identifier` nodes which define this variable. + * If this variable is redeclared, this array includes two or more nodes. + * @public + */ + this.identifiers = []; + /** + * List of {@link Reference} of this variable (excluding parameter entries) in its defining scope and all nested scopes. + * For defining occurrences only see {@link Variable#defs}. + * @public + */ + this.references = []; + this.name = name; + this.scope = scope; + } +} +exports.VariableBase = VariableBase; +//# sourceMappingURL=VariableBase.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.js.map b/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.js.map new file mode 100644 index 000000000..457d60d66 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.js.map @@ -0,0 +1 @@ +{"version":3,"file":"VariableBase.js","sourceRoot":"","sources":["../../src/variable/VariableBase.ts"],"names":[],"mappings":";;;AAEA,8BAA0C;AAI1C,MAAM,SAAS,GAAG,sBAAiB,EAAE,CAAC;AAEtC,MAAM,YAAY;IAsChB,YAAY,IAAY,EAAE,KAAY;QArCtC;;WAEG;QACa,QAAG,GAAW,SAAS,EAAE,CAAC;QAE1C;;;WAGG;QACa,SAAI,GAAiB,EAAE,CAAC;QACxC;;;WAGG;QACI,eAAU,GAAG,KAAK,CAAC;QAC1B;;;;WAIG;QACa,gBAAW,GAA0B,EAAE,CAAC;QAMxD;;;;WAIG;QACa,eAAU,GAAgB,EAAE,CAAC;QAO3C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF;AAEQ,oCAAY"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/index.d.ts b/node_modules/@typescript-eslint/scope-manager/dist/variable/index.d.ts new file mode 100644 index 000000000..e62df9833 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/index.d.ts @@ -0,0 +1,4 @@ +export { ESLintScopeVariable } from './ESLintScopeVariable'; +export { ImplicitLibVariable, ImplicitLibVariableOptions, } from './ImplicitLibVariable'; +export { Variable } from './Variable'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/index.d.ts.map b/node_modules/@typescript-eslint/scope-manager/dist/variable/index.d.ts.map new file mode 100644 index 000000000..4fdcff24c --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/variable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EACL,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/index.js b/node_modules/@typescript-eslint/scope-manager/dist/variable/index.js new file mode 100644 index 000000000..1e36582b7 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/index.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Variable = exports.ImplicitLibVariable = exports.ESLintScopeVariable = void 0; +var ESLintScopeVariable_1 = require("./ESLintScopeVariable"); +Object.defineProperty(exports, "ESLintScopeVariable", { enumerable: true, get: function () { return ESLintScopeVariable_1.ESLintScopeVariable; } }); +var ImplicitLibVariable_1 = require("./ImplicitLibVariable"); +Object.defineProperty(exports, "ImplicitLibVariable", { enumerable: true, get: function () { return ImplicitLibVariable_1.ImplicitLibVariable; } }); +var Variable_1 = require("./Variable"); +Object.defineProperty(exports, "Variable", { enumerable: true, get: function () { return Variable_1.Variable; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/dist/variable/index.js.map b/node_modules/@typescript-eslint/scope-manager/dist/variable/index.js.map new file mode 100644 index 000000000..4798d0e27 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/dist/variable/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/variable/index.ts"],"names":[],"mappings":";;;AAAA,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,6DAG+B;AAF7B,0HAAA,mBAAmB,OAAA;AAGrB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/scope-manager/package.json b/node_modules/@typescript-eslint/scope-manager/package.json new file mode 100644 index 000000000..8af22e772 --- /dev/null +++ b/node_modules/@typescript-eslint/scope-manager/package.json @@ -0,0 +1,68 @@ +{ + "name": "@typescript-eslint/scope-manager", + "version": "4.1.0", + "description": "TypeScript scope analyser for ESLint", + "keywords": [ + "eslint", + "typescript", + "estree" + ], + "engines": { + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + }, + "files": [ + "dist", + "package.json", + "README.md", + "LICENSE" + ], + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/scope-manager" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "license": "MIT", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsc -b tsconfig.build.json", + "postbuild": "downlevel-dts dist _ts3.4/dist", + "clean": "tsc -b tsconfig.build.json --clean", + "postclean": "rimraf dist", + "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", + "generate:lib": "../../node_modules/.bin/ts-node --files --transpile-only tools/generate-lib.ts", + "lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'", + "test": "jest --coverage", + "typecheck": "tsc -p tsconfig.json --noEmit" + }, + "dependencies": { + "@typescript-eslint/types": "4.1.0", + "@typescript-eslint/visitor-keys": "4.1.0" + }, + "devDependencies": { + "@types/glob": "*", + "@typescript-eslint/typescript-estree": "4.1.0", + "glob": "*", + "jest-specific-snapshot": "*", + "make-dir": "*", + "prettier": "*", + "pretty-format": "^26.4.2", + "rimraf": "*", + "typescript": "*" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "typesVersions": { + "<3.8": { + "*": [ + "_ts3.4/*" + ] + } + }, + "gitHead": "00a24706222254774121ee62038e67d0efa993e7" +} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/CHANGELOG.md b/node_modules/@typescript-eslint/types/CHANGELOG.md new file mode 100644 index 000000000..43d03464c --- /dev/null +++ b/node_modules/@typescript-eslint/types/CHANGELOG.md @@ -0,0 +1,140 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) + + +### Bug Fixes + +* **eslint-plugin:** [no-unused-vars] correct detection of unused vars in a declared module with `export =` ([#2505](https://github.com/typescript-eslint/typescript-eslint/issues/2505)) ([3d07a99](https://github.com/typescript-eslint/typescript-eslint/commit/3d07a99faa0a5fc1b44acdb43ddbfc90a5105833)) + + +### Features + +* **scope-manager:** add support for JSX scope analysis ([#2498](https://github.com/typescript-eslint/typescript-eslint/issues/2498)) ([f887ab5](https://github.com/typescript-eslint/typescript-eslint/commit/f887ab51f58c1b3571f9a14832864bc0ca59623f)), closes [#2455](https://github.com/typescript-eslint/typescript-eslint/issues/2455) [#2477](https://github.com/typescript-eslint/typescript-eslint/issues/2477) + + + + + +## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) + +**Note:** Version bump only for package @typescript-eslint/types + + + + + +# [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) + +## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) + +### Bug Fixes + +* correct decorator traversal for AssignmentPattern ([#2375](https://github.com/typescript-eslint/typescript-eslint/issues/2375)) ([d738fa4](https://github.com/typescript-eslint/typescript-eslint/commit/d738fa4eff0a5c4cfc9b30b1c0502f8d1e78d7b6)) +* **typescript-estree:** correct ChainExpression interaction with parentheses and non-nulls ([#2380](https://github.com/typescript-eslint/typescript-eslint/issues/2380)) ([762bc99](https://github.com/typescript-eslint/typescript-eslint/commit/762bc99584ede4d0b8099a743991e957aec86aa8)) + + +### Features + +* consume new scope analysis package ([#2039](https://github.com/typescript-eslint/typescript-eslint/issues/2039)) ([3be125d](https://github.com/typescript-eslint/typescript-eslint/commit/3be125d9bdbee1984ac6037874edf619213bd3d0)) +* support ESTree optional chaining representation ([#2308](https://github.com/typescript-eslint/typescript-eslint/issues/2308)) ([e9d2ab6](https://github.com/typescript-eslint/typescript-eslint/commit/e9d2ab638b6767700b52797e74b814ea059beaae)) + + +### BREAKING CHANGES + +* - Removed decorators property from several Nodes that could never semantically have them (FunctionDeclaration, TSEnumDeclaration, and TSInterfaceDeclaration) +- Removed AST_NODE_TYPES.Import. This is a minor breaking change as the node type that used this was removed ages ago. + + + + + +## [3.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.0...v3.10.1) (2020-08-25) + +**Note:** Version bump only for package @typescript-eslint/types + + + + + +# [3.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.1...v3.10.0) (2020-08-24) + +**Note:** Version bump only for package @typescript-eslint/types + + + + + +## [3.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.0...v3.9.1) (2020-08-17) + +**Note:** Version bump only for package @typescript-eslint/types + + + + + +# [3.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.8.0...v3.9.0) (2020-08-10) + + +### Features + +* **typescript-estree:** support TSv4 labelled tuple members ([#2378](https://github.com/typescript-eslint/typescript-eslint/issues/2378)) ([00d84ff](https://github.com/typescript-eslint/typescript-eslint/commit/00d84ffbcbe9d0ec98bdb2f2ce59959a27ce4dbe)) + + + + + +# [3.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.1...v3.8.0) (2020-08-03) + +**Note:** Version bump only for package @typescript-eslint/types + + + + + +## [3.7.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.0...v3.7.1) (2020-07-27) + +**Note:** Version bump only for package @typescript-eslint/types + + + + + +# [3.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.1...v3.7.0) (2020-07-20) + + +### Features + +* **eslint-plugin:** [no-empty-function] add `decoratedFunctions` option ([#2295](https://github.com/typescript-eslint/typescript-eslint/issues/2295)) ([88f08f4](https://github.com/typescript-eslint/typescript-eslint/commit/88f08f410760f58fdc2de58ecd9dab9610821642)) +* **typescript-estree:** support short-circuiting assignment operators ([#2307](https://github.com/typescript-eslint/typescript-eslint/issues/2307)) ([2c90d9f](https://github.com/typescript-eslint/typescript-eslint/commit/2c90d9fa3aa5ebd7db697dddb7762bca2dd0e06b)) + + + + + +## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) + +**Note:** Version bump only for package @typescript-eslint/types + + + + + +# [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) + +**Note:** Version bump only for package @typescript-eslint/types + + + + + +# [3.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.4.0...v3.5.0) (2020-06-29) + + +### Features + +* add package scope-manager ([#1939](https://github.com/typescript-eslint/typescript-eslint/issues/1939)) ([682eb7e](https://github.com/typescript-eslint/typescript-eslint/commit/682eb7e009c3f22a542882dfd3602196a60d2a1e)) +* split types into their own package ([#2229](https://github.com/typescript-eslint/typescript-eslint/issues/2229)) ([5f45918](https://github.com/typescript-eslint/typescript-eslint/commit/5f4591886f3438329fbf2229b03ac66174334a24)) diff --git a/node_modules/@typescript-eslint/types/LICENSE b/node_modules/@typescript-eslint/types/LICENSE new file mode 100644 index 000000000..7e7370143 --- /dev/null +++ b/node_modules/@typescript-eslint/types/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 TypeScript ESLint and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@typescript-eslint/types/README.md b/node_modules/@typescript-eslint/types/README.md new file mode 100644 index 000000000..5c91f1687 --- /dev/null +++ b/node_modules/@typescript-eslint/types/README.md @@ -0,0 +1,17 @@ +

TypeScript-ESTree Types

+ +

+ CI + NPM Version + NPM Downloads +

+ +This package exists to help us reduce cycles and provide lighter-weight packages at runtime. +You probably don't want to use it directly. + +If you're building an ESLint plugin, consider using [`@typescript-eslint/experimental-utils`](../experimental-utils). +If you're parsing TypeScript code, consider using [`@typescript-eslint/typescript-estree`](../typescript-estree). + +## Contributing + +[See the contributing guide here](../../CONTRIBUTING.md) diff --git a/node_modules/@typescript-eslint/types/dist/ast-node-types.d.ts b/node_modules/@typescript-eslint/types/dist/ast-node-types.d.ts new file mode 100644 index 000000000..d3338c8cb --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/ast-node-types.d.ts @@ -0,0 +1,165 @@ +declare enum AST_NODE_TYPES { + ArrayExpression = "ArrayExpression", + ArrayPattern = "ArrayPattern", + ArrowFunctionExpression = "ArrowFunctionExpression", + AssignmentExpression = "AssignmentExpression", + AssignmentPattern = "AssignmentPattern", + AwaitExpression = "AwaitExpression", + BinaryExpression = "BinaryExpression", + BlockStatement = "BlockStatement", + BreakStatement = "BreakStatement", + CallExpression = "CallExpression", + CatchClause = "CatchClause", + ChainExpression = "ChainExpression", + ClassBody = "ClassBody", + ClassDeclaration = "ClassDeclaration", + ClassExpression = "ClassExpression", + ClassProperty = "ClassProperty", + ConditionalExpression = "ConditionalExpression", + ContinueStatement = "ContinueStatement", + DebuggerStatement = "DebuggerStatement", + Decorator = "Decorator", + DoWhileStatement = "DoWhileStatement", + EmptyStatement = "EmptyStatement", + ExportAllDeclaration = "ExportAllDeclaration", + ExportDefaultDeclaration = "ExportDefaultDeclaration", + ExportNamedDeclaration = "ExportNamedDeclaration", + ExportSpecifier = "ExportSpecifier", + ExpressionStatement = "ExpressionStatement", + ForInStatement = "ForInStatement", + ForOfStatement = "ForOfStatement", + ForStatement = "ForStatement", + FunctionDeclaration = "FunctionDeclaration", + FunctionExpression = "FunctionExpression", + Identifier = "Identifier", + IfStatement = "IfStatement", + ImportDeclaration = "ImportDeclaration", + ImportDefaultSpecifier = "ImportDefaultSpecifier", + ImportExpression = "ImportExpression", + ImportNamespaceSpecifier = "ImportNamespaceSpecifier", + ImportSpecifier = "ImportSpecifier", + JSXAttribute = "JSXAttribute", + JSXClosingElement = "JSXClosingElement", + JSXClosingFragment = "JSXClosingFragment", + JSXElement = "JSXElement", + JSXEmptyExpression = "JSXEmptyExpression", + JSXExpressionContainer = "JSXExpressionContainer", + JSXFragment = "JSXFragment", + JSXIdentifier = "JSXIdentifier", + JSXMemberExpression = "JSXMemberExpression", + JSXOpeningElement = "JSXOpeningElement", + JSXOpeningFragment = "JSXOpeningFragment", + JSXSpreadAttribute = "JSXSpreadAttribute", + JSXSpreadChild = "JSXSpreadChild", + JSXText = "JSXText", + LabeledStatement = "LabeledStatement", + Literal = "Literal", + LogicalExpression = "LogicalExpression", + MemberExpression = "MemberExpression", + MetaProperty = "MetaProperty", + MethodDefinition = "MethodDefinition", + NewExpression = "NewExpression", + ObjectExpression = "ObjectExpression", + ObjectPattern = "ObjectPattern", + Program = "Program", + Property = "Property", + RestElement = "RestElement", + ReturnStatement = "ReturnStatement", + SequenceExpression = "SequenceExpression", + SpreadElement = "SpreadElement", + Super = "Super", + SwitchCase = "SwitchCase", + SwitchStatement = "SwitchStatement", + TaggedTemplateExpression = "TaggedTemplateExpression", + TemplateElement = "TemplateElement", + TemplateLiteral = "TemplateLiteral", + ThisExpression = "ThisExpression", + ThrowStatement = "ThrowStatement", + TryStatement = "TryStatement", + UnaryExpression = "UnaryExpression", + UpdateExpression = "UpdateExpression", + VariableDeclaration = "VariableDeclaration", + VariableDeclarator = "VariableDeclarator", + WhileStatement = "WhileStatement", + WithStatement = "WithStatement", + YieldExpression = "YieldExpression", + /** + * TS-prefixed nodes + */ + TSAbstractClassProperty = "TSAbstractClassProperty", + TSAbstractKeyword = "TSAbstractKeyword", + TSAbstractMethodDefinition = "TSAbstractMethodDefinition", + TSAnyKeyword = "TSAnyKeyword", + TSArrayType = "TSArrayType", + TSAsExpression = "TSAsExpression", + TSAsyncKeyword = "TSAsyncKeyword", + TSBigIntKeyword = "TSBigIntKeyword", + TSBooleanKeyword = "TSBooleanKeyword", + TSCallSignatureDeclaration = "TSCallSignatureDeclaration", + TSClassImplements = "TSClassImplements", + TSConditionalType = "TSConditionalType", + TSConstructorType = "TSConstructorType", + TSConstructSignatureDeclaration = "TSConstructSignatureDeclaration", + TSDeclareFunction = "TSDeclareFunction", + TSDeclareKeyword = "TSDeclareKeyword", + TSEmptyBodyFunctionExpression = "TSEmptyBodyFunctionExpression", + TSEnumDeclaration = "TSEnumDeclaration", + TSEnumMember = "TSEnumMember", + TSExportAssignment = "TSExportAssignment", + TSExportKeyword = "TSExportKeyword", + TSExternalModuleReference = "TSExternalModuleReference", + TSFunctionType = "TSFunctionType", + TSImportEqualsDeclaration = "TSImportEqualsDeclaration", + TSImportType = "TSImportType", + TSIndexedAccessType = "TSIndexedAccessType", + TSIndexSignature = "TSIndexSignature", + TSInferType = "TSInferType", + TSInterfaceBody = "TSInterfaceBody", + TSInterfaceDeclaration = "TSInterfaceDeclaration", + TSInterfaceHeritage = "TSInterfaceHeritage", + TSIntersectionType = "TSIntersectionType", + TSLiteralType = "TSLiteralType", + TSMappedType = "TSMappedType", + TSMethodSignature = "TSMethodSignature", + TSModuleBlock = "TSModuleBlock", + TSModuleDeclaration = "TSModuleDeclaration", + TSNamedTupleMember = "TSNamedTupleMember", + TSNamespaceExportDeclaration = "TSNamespaceExportDeclaration", + TSNeverKeyword = "TSNeverKeyword", + TSNonNullExpression = "TSNonNullExpression", + TSNullKeyword = "TSNullKeyword", + TSNumberKeyword = "TSNumberKeyword", + TSObjectKeyword = "TSObjectKeyword", + TSOptionalType = "TSOptionalType", + TSParameterProperty = "TSParameterProperty", + TSParenthesizedType = "TSParenthesizedType", + TSPrivateKeyword = "TSPrivateKeyword", + TSPropertySignature = "TSPropertySignature", + TSProtectedKeyword = "TSProtectedKeyword", + TSPublicKeyword = "TSPublicKeyword", + TSQualifiedName = "TSQualifiedName", + TSReadonlyKeyword = "TSReadonlyKeyword", + TSRestType = "TSRestType", + TSStaticKeyword = "TSStaticKeyword", + TSStringKeyword = "TSStringKeyword", + TSSymbolKeyword = "TSSymbolKeyword", + TSThisType = "TSThisType", + TSTupleType = "TSTupleType", + TSTypeAliasDeclaration = "TSTypeAliasDeclaration", + TSTypeAnnotation = "TSTypeAnnotation", + TSTypeAssertion = "TSTypeAssertion", + TSTypeLiteral = "TSTypeLiteral", + TSTypeOperator = "TSTypeOperator", + TSTypeParameter = "TSTypeParameter", + TSTypeParameterDeclaration = "TSTypeParameterDeclaration", + TSTypeParameterInstantiation = "TSTypeParameterInstantiation", + TSTypePredicate = "TSTypePredicate", + TSTypeQuery = "TSTypeQuery", + TSTypeReference = "TSTypeReference", + TSUndefinedKeyword = "TSUndefinedKeyword", + TSUnionType = "TSUnionType", + TSUnknownKeyword = "TSUnknownKeyword", + TSVoidKeyword = "TSVoidKeyword" +} +export { AST_NODE_TYPES }; +//# sourceMappingURL=ast-node-types.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/ast-node-types.d.ts.map b/node_modules/@typescript-eslint/types/dist/ast-node-types.d.ts.map new file mode 100644 index 000000000..f9db685e7 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/ast-node-types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ast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mB,wBAAwB;IAC3C,gBAAgB,qBAAqB;IACrC,WAAW,gBAAgB;IAC3B,eAAe,oBAAoB;IACnC,sBAAsB,2BAA2B;IACjD,mBAAmB,wBAAwB;IAC3C,kBAAkB,uBAAuB;IACzC,aAAa,kBAAkB;IAC/B,YAAY,iBAAiB;IAC7B,iBAAiB,sBAAsB;IACvC,aAAa,kBAAkB;IAC/B,mBAAmB,wBAAwB;IAC3C,kBAAkB,uBAAuB;IACzC,4BAA4B,iCAAiC;IAC7D,cAAc,mBAAmB;IACjC,mBAAmB,wBAAwB;IAC3C,aAAa,kBAAkB;IAC/B,eAAe,oBAAoB;IACnC,eAAe,oBAAoB;IACnC,cAAc,mBAAmB;IACjC,mBAAmB,wBAAwB;IAC3C,mBAAmB,wBAAwB;IAC3C,gBAAgB,qBAAqB;IACrC,mBAAmB,wBAAwB;IAC3C,kBAAkB,uBAAuB;IACzC,eAAe,oBAAoB;IACnC,eAAe,oBAAoB;IACnC,iBAAiB,sBAAsB;IACvC,UAAU,eAAe;IACzB,eAAe,oBAAoB;IACnC,eAAe,oBAAoB;IACnC,eAAe,oBAAoB;IACnC,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAC3B,sBAAsB,2BAA2B;IACjD,gBAAgB,qBAAqB;IACrC,eAAe,oBAAoB;IACnC,aAAa,kBAAkB;IAC/B,cAAc,mBAAmB;IACjC,eAAe,oBAAoB;IACnC,0BAA0B,+BAA+B;IACzD,4BAA4B,iCAAiC;IAC7D,eAAe,oBAAoB;IACnC,WAAW,gBAAgB;IAC3B,eAAe,oBAAoB;IACnC,kBAAkB,uBAAuB;IACzC,WAAW,gBAAgB;IAC3B,gBAAgB,qBAAqB;IACrC,aAAa,kBAAkB;CAChC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/ast-node-types.js b/node_modules/@typescript-eslint/types/dist/ast-node-types.js new file mode 100644 index 000000000..7345e80be --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/ast-node-types.js @@ -0,0 +1,169 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AST_NODE_TYPES = void 0; +var AST_NODE_TYPES; +(function (AST_NODE_TYPES) { + AST_NODE_TYPES["ArrayExpression"] = "ArrayExpression"; + AST_NODE_TYPES["ArrayPattern"] = "ArrayPattern"; + AST_NODE_TYPES["ArrowFunctionExpression"] = "ArrowFunctionExpression"; + AST_NODE_TYPES["AssignmentExpression"] = "AssignmentExpression"; + AST_NODE_TYPES["AssignmentPattern"] = "AssignmentPattern"; + AST_NODE_TYPES["AwaitExpression"] = "AwaitExpression"; + AST_NODE_TYPES["BinaryExpression"] = "BinaryExpression"; + AST_NODE_TYPES["BlockStatement"] = "BlockStatement"; + AST_NODE_TYPES["BreakStatement"] = "BreakStatement"; + AST_NODE_TYPES["CallExpression"] = "CallExpression"; + AST_NODE_TYPES["CatchClause"] = "CatchClause"; + AST_NODE_TYPES["ChainExpression"] = "ChainExpression"; + AST_NODE_TYPES["ClassBody"] = "ClassBody"; + AST_NODE_TYPES["ClassDeclaration"] = "ClassDeclaration"; + AST_NODE_TYPES["ClassExpression"] = "ClassExpression"; + AST_NODE_TYPES["ClassProperty"] = "ClassProperty"; + AST_NODE_TYPES["ConditionalExpression"] = "ConditionalExpression"; + AST_NODE_TYPES["ContinueStatement"] = "ContinueStatement"; + AST_NODE_TYPES["DebuggerStatement"] = "DebuggerStatement"; + AST_NODE_TYPES["Decorator"] = "Decorator"; + AST_NODE_TYPES["DoWhileStatement"] = "DoWhileStatement"; + AST_NODE_TYPES["EmptyStatement"] = "EmptyStatement"; + AST_NODE_TYPES["ExportAllDeclaration"] = "ExportAllDeclaration"; + AST_NODE_TYPES["ExportDefaultDeclaration"] = "ExportDefaultDeclaration"; + AST_NODE_TYPES["ExportNamedDeclaration"] = "ExportNamedDeclaration"; + AST_NODE_TYPES["ExportSpecifier"] = "ExportSpecifier"; + AST_NODE_TYPES["ExpressionStatement"] = "ExpressionStatement"; + AST_NODE_TYPES["ForInStatement"] = "ForInStatement"; + AST_NODE_TYPES["ForOfStatement"] = "ForOfStatement"; + AST_NODE_TYPES["ForStatement"] = "ForStatement"; + AST_NODE_TYPES["FunctionDeclaration"] = "FunctionDeclaration"; + AST_NODE_TYPES["FunctionExpression"] = "FunctionExpression"; + AST_NODE_TYPES["Identifier"] = "Identifier"; + AST_NODE_TYPES["IfStatement"] = "IfStatement"; + AST_NODE_TYPES["ImportDeclaration"] = "ImportDeclaration"; + AST_NODE_TYPES["ImportDefaultSpecifier"] = "ImportDefaultSpecifier"; + AST_NODE_TYPES["ImportExpression"] = "ImportExpression"; + AST_NODE_TYPES["ImportNamespaceSpecifier"] = "ImportNamespaceSpecifier"; + AST_NODE_TYPES["ImportSpecifier"] = "ImportSpecifier"; + AST_NODE_TYPES["JSXAttribute"] = "JSXAttribute"; + AST_NODE_TYPES["JSXClosingElement"] = "JSXClosingElement"; + AST_NODE_TYPES["JSXClosingFragment"] = "JSXClosingFragment"; + AST_NODE_TYPES["JSXElement"] = "JSXElement"; + AST_NODE_TYPES["JSXEmptyExpression"] = "JSXEmptyExpression"; + AST_NODE_TYPES["JSXExpressionContainer"] = "JSXExpressionContainer"; + AST_NODE_TYPES["JSXFragment"] = "JSXFragment"; + AST_NODE_TYPES["JSXIdentifier"] = "JSXIdentifier"; + AST_NODE_TYPES["JSXMemberExpression"] = "JSXMemberExpression"; + AST_NODE_TYPES["JSXOpeningElement"] = "JSXOpeningElement"; + AST_NODE_TYPES["JSXOpeningFragment"] = "JSXOpeningFragment"; + AST_NODE_TYPES["JSXSpreadAttribute"] = "JSXSpreadAttribute"; + AST_NODE_TYPES["JSXSpreadChild"] = "JSXSpreadChild"; + AST_NODE_TYPES["JSXText"] = "JSXText"; + AST_NODE_TYPES["LabeledStatement"] = "LabeledStatement"; + AST_NODE_TYPES["Literal"] = "Literal"; + AST_NODE_TYPES["LogicalExpression"] = "LogicalExpression"; + AST_NODE_TYPES["MemberExpression"] = "MemberExpression"; + AST_NODE_TYPES["MetaProperty"] = "MetaProperty"; + AST_NODE_TYPES["MethodDefinition"] = "MethodDefinition"; + AST_NODE_TYPES["NewExpression"] = "NewExpression"; + AST_NODE_TYPES["ObjectExpression"] = "ObjectExpression"; + AST_NODE_TYPES["ObjectPattern"] = "ObjectPattern"; + AST_NODE_TYPES["Program"] = "Program"; + AST_NODE_TYPES["Property"] = "Property"; + AST_NODE_TYPES["RestElement"] = "RestElement"; + AST_NODE_TYPES["ReturnStatement"] = "ReturnStatement"; + AST_NODE_TYPES["SequenceExpression"] = "SequenceExpression"; + AST_NODE_TYPES["SpreadElement"] = "SpreadElement"; + AST_NODE_TYPES["Super"] = "Super"; + AST_NODE_TYPES["SwitchCase"] = "SwitchCase"; + AST_NODE_TYPES["SwitchStatement"] = "SwitchStatement"; + AST_NODE_TYPES["TaggedTemplateExpression"] = "TaggedTemplateExpression"; + AST_NODE_TYPES["TemplateElement"] = "TemplateElement"; + AST_NODE_TYPES["TemplateLiteral"] = "TemplateLiteral"; + AST_NODE_TYPES["ThisExpression"] = "ThisExpression"; + AST_NODE_TYPES["ThrowStatement"] = "ThrowStatement"; + AST_NODE_TYPES["TryStatement"] = "TryStatement"; + AST_NODE_TYPES["UnaryExpression"] = "UnaryExpression"; + AST_NODE_TYPES["UpdateExpression"] = "UpdateExpression"; + AST_NODE_TYPES["VariableDeclaration"] = "VariableDeclaration"; + AST_NODE_TYPES["VariableDeclarator"] = "VariableDeclarator"; + AST_NODE_TYPES["WhileStatement"] = "WhileStatement"; + AST_NODE_TYPES["WithStatement"] = "WithStatement"; + AST_NODE_TYPES["YieldExpression"] = "YieldExpression"; + /** + * TS-prefixed nodes + */ + AST_NODE_TYPES["TSAbstractClassProperty"] = "TSAbstractClassProperty"; + AST_NODE_TYPES["TSAbstractKeyword"] = "TSAbstractKeyword"; + AST_NODE_TYPES["TSAbstractMethodDefinition"] = "TSAbstractMethodDefinition"; + AST_NODE_TYPES["TSAnyKeyword"] = "TSAnyKeyword"; + AST_NODE_TYPES["TSArrayType"] = "TSArrayType"; + AST_NODE_TYPES["TSAsExpression"] = "TSAsExpression"; + AST_NODE_TYPES["TSAsyncKeyword"] = "TSAsyncKeyword"; + AST_NODE_TYPES["TSBigIntKeyword"] = "TSBigIntKeyword"; + AST_NODE_TYPES["TSBooleanKeyword"] = "TSBooleanKeyword"; + AST_NODE_TYPES["TSCallSignatureDeclaration"] = "TSCallSignatureDeclaration"; + AST_NODE_TYPES["TSClassImplements"] = "TSClassImplements"; + AST_NODE_TYPES["TSConditionalType"] = "TSConditionalType"; + AST_NODE_TYPES["TSConstructorType"] = "TSConstructorType"; + AST_NODE_TYPES["TSConstructSignatureDeclaration"] = "TSConstructSignatureDeclaration"; + AST_NODE_TYPES["TSDeclareFunction"] = "TSDeclareFunction"; + AST_NODE_TYPES["TSDeclareKeyword"] = "TSDeclareKeyword"; + AST_NODE_TYPES["TSEmptyBodyFunctionExpression"] = "TSEmptyBodyFunctionExpression"; + AST_NODE_TYPES["TSEnumDeclaration"] = "TSEnumDeclaration"; + AST_NODE_TYPES["TSEnumMember"] = "TSEnumMember"; + AST_NODE_TYPES["TSExportAssignment"] = "TSExportAssignment"; + AST_NODE_TYPES["TSExportKeyword"] = "TSExportKeyword"; + AST_NODE_TYPES["TSExternalModuleReference"] = "TSExternalModuleReference"; + AST_NODE_TYPES["TSFunctionType"] = "TSFunctionType"; + AST_NODE_TYPES["TSImportEqualsDeclaration"] = "TSImportEqualsDeclaration"; + AST_NODE_TYPES["TSImportType"] = "TSImportType"; + AST_NODE_TYPES["TSIndexedAccessType"] = "TSIndexedAccessType"; + AST_NODE_TYPES["TSIndexSignature"] = "TSIndexSignature"; + AST_NODE_TYPES["TSInferType"] = "TSInferType"; + AST_NODE_TYPES["TSInterfaceBody"] = "TSInterfaceBody"; + AST_NODE_TYPES["TSInterfaceDeclaration"] = "TSInterfaceDeclaration"; + AST_NODE_TYPES["TSInterfaceHeritage"] = "TSInterfaceHeritage"; + AST_NODE_TYPES["TSIntersectionType"] = "TSIntersectionType"; + AST_NODE_TYPES["TSLiteralType"] = "TSLiteralType"; + AST_NODE_TYPES["TSMappedType"] = "TSMappedType"; + AST_NODE_TYPES["TSMethodSignature"] = "TSMethodSignature"; + AST_NODE_TYPES["TSModuleBlock"] = "TSModuleBlock"; + AST_NODE_TYPES["TSModuleDeclaration"] = "TSModuleDeclaration"; + AST_NODE_TYPES["TSNamedTupleMember"] = "TSNamedTupleMember"; + AST_NODE_TYPES["TSNamespaceExportDeclaration"] = "TSNamespaceExportDeclaration"; + AST_NODE_TYPES["TSNeverKeyword"] = "TSNeverKeyword"; + AST_NODE_TYPES["TSNonNullExpression"] = "TSNonNullExpression"; + AST_NODE_TYPES["TSNullKeyword"] = "TSNullKeyword"; + AST_NODE_TYPES["TSNumberKeyword"] = "TSNumberKeyword"; + AST_NODE_TYPES["TSObjectKeyword"] = "TSObjectKeyword"; + AST_NODE_TYPES["TSOptionalType"] = "TSOptionalType"; + AST_NODE_TYPES["TSParameterProperty"] = "TSParameterProperty"; + AST_NODE_TYPES["TSParenthesizedType"] = "TSParenthesizedType"; + AST_NODE_TYPES["TSPrivateKeyword"] = "TSPrivateKeyword"; + AST_NODE_TYPES["TSPropertySignature"] = "TSPropertySignature"; + AST_NODE_TYPES["TSProtectedKeyword"] = "TSProtectedKeyword"; + AST_NODE_TYPES["TSPublicKeyword"] = "TSPublicKeyword"; + AST_NODE_TYPES["TSQualifiedName"] = "TSQualifiedName"; + AST_NODE_TYPES["TSReadonlyKeyword"] = "TSReadonlyKeyword"; + AST_NODE_TYPES["TSRestType"] = "TSRestType"; + AST_NODE_TYPES["TSStaticKeyword"] = "TSStaticKeyword"; + AST_NODE_TYPES["TSStringKeyword"] = "TSStringKeyword"; + AST_NODE_TYPES["TSSymbolKeyword"] = "TSSymbolKeyword"; + AST_NODE_TYPES["TSThisType"] = "TSThisType"; + AST_NODE_TYPES["TSTupleType"] = "TSTupleType"; + AST_NODE_TYPES["TSTypeAliasDeclaration"] = "TSTypeAliasDeclaration"; + AST_NODE_TYPES["TSTypeAnnotation"] = "TSTypeAnnotation"; + AST_NODE_TYPES["TSTypeAssertion"] = "TSTypeAssertion"; + AST_NODE_TYPES["TSTypeLiteral"] = "TSTypeLiteral"; + AST_NODE_TYPES["TSTypeOperator"] = "TSTypeOperator"; + AST_NODE_TYPES["TSTypeParameter"] = "TSTypeParameter"; + AST_NODE_TYPES["TSTypeParameterDeclaration"] = "TSTypeParameterDeclaration"; + AST_NODE_TYPES["TSTypeParameterInstantiation"] = "TSTypeParameterInstantiation"; + AST_NODE_TYPES["TSTypePredicate"] = "TSTypePredicate"; + AST_NODE_TYPES["TSTypeQuery"] = "TSTypeQuery"; + AST_NODE_TYPES["TSTypeReference"] = "TSTypeReference"; + AST_NODE_TYPES["TSUndefinedKeyword"] = "TSUndefinedKeyword"; + AST_NODE_TYPES["TSUnionType"] = "TSUnionType"; + AST_NODE_TYPES["TSUnknownKeyword"] = "TSUnknownKeyword"; + AST_NODE_TYPES["TSVoidKeyword"] = "TSVoidKeyword"; +})(AST_NODE_TYPES || (AST_NODE_TYPES = {})); +exports.AST_NODE_TYPES = AST_NODE_TYPES; +//# sourceMappingURL=ast-node-types.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/ast-node-types.js.map b/node_modules/@typescript-eslint/types/dist/ast-node-types.js.map new file mode 100644 index 000000000..7d7ba41f6 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/ast-node-types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ast-node-types.js","sourceRoot":"","sources":["../src/ast-node-types.ts"],"names":[],"mappings":";;;AAAA,IAAK,cAkKJ;AAlKD,WAAK,cAAc;IACjB,qDAAmC,CAAA;IACnC,+CAA6B,CAAA;IAC7B,qEAAmD,CAAA;IACnD,+DAA6C,CAAA;IAC7C,yDAAuC,CAAA;IACvC,qDAAmC,CAAA;IACnC,uDAAqC,CAAA;IACrC,mDAAiC,CAAA;IACjC,mDAAi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mC,CAAA;IACnC,qDAAmC,CAAA;IACnC,mDAAiC,CAAA;IACjC,6DAA2C,CAAA;IAC3C,6DAA2C,CAAA;IAC3C,uDAAqC,CAAA;IACrC,6DAA2C,CAAA;IAC3C,2DAAyC,CAAA;IACzC,qDAAmC,CAAA;IACnC,qDAAmC,CAAA;IACnC,yDAAuC,CAAA;IACvC,2CAAyB,CAAA;IACzB,qDAAmC,CAAA;IACnC,qDAAmC,CAAA;IACnC,qDAAmC,CAAA;IACnC,2CAAyB,CAAA;IACzB,6CAA2B,CAAA;IAC3B,mEAAiD,CAAA;IACjD,uDAAqC,CAAA;IACrC,qDAAmC,CAAA;IACnC,iDAA+B,CAAA;IAC/B,mDAAiC,CAAA;IACjC,qDAAmC,CAAA;IACnC,2EAAyD,CAAA;IACzD,+EAA6D,CAAA;IAC7D,qDAAmC,CAAA;IACnC,6CAA2B,CAAA;IAC3B,qDAAmC,CAAA;IACnC,2DAAyC,CAAA;IACzC,6CAA2B,CAAA;IAC3B,uDAAqC,CAAA;IACrC,iDAA+B,CAAA;AACjC,CAAC,EAlKI,cAAc,KAAd,cAAc,QAkKlB;AAEQ,wCAAc"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/ast-token-types.d.ts b/node_modules/@typescript-eslint/types/dist/ast-token-types.d.ts new file mode 100644 index 000000000..6536628f2 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/ast-token-types.d.ts @@ -0,0 +1,17 @@ +declare enum AST_TOKEN_TYPES { + Boolean = "Boolean", + Identifier = "Identifier", + JSXIdentifier = "JSXIdentifier", + JSXText = "JSXText", + Keyword = "Keyword", + Null = "Null", + Numeric = "Numeric", + Punctuator = "Punctuator", + RegularExpression = "RegularExpression", + String = "String", + Template = "Template", + Block = "Block", + Line = "Line" +} +export { AST_TOKEN_TYPES }; +//# sourceMappingURL=ast-token-types.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/ast-token-types.d.ts.map b/node_modules/@typescript-eslint/types/dist/ast-token-types.d.ts.map new file mode 100644 index 000000000..46cc6f7b0 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/ast-token-types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ast-token-types.d.ts","sourceRoot":"","sources":["../src/ast-token-types.ts"],"names":[],"mappings":"AAAA,aAAK,eAAe;IAClB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,aAAa,kBAAkB;IAC/B,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,iBAAiB,sBAAsB;IACvC,MAAM,WAAW;IACjB,QAAQ,aAAa;IAGrB,KAAK,UAAU;IACf,IAAI,SAAS;CACd;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/ast-token-types.js b/node_modules/@typescript-eslint/types/dist/ast-token-types.js new file mode 100644 index 000000000..4a4bc4ad0 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/ast-token-types.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AST_TOKEN_TYPES = void 0; +var AST_TOKEN_TYPES; +(function (AST_TOKEN_TYPES) { + AST_TOKEN_TYPES["Boolean"] = "Boolean"; + AST_TOKEN_TYPES["Identifier"] = "Identifier"; + AST_TOKEN_TYPES["JSXIdentifier"] = "JSXIdentifier"; + AST_TOKEN_TYPES["JSXText"] = "JSXText"; + AST_TOKEN_TYPES["Keyword"] = "Keyword"; + AST_TOKEN_TYPES["Null"] = "Null"; + AST_TOKEN_TYPES["Numeric"] = "Numeric"; + AST_TOKEN_TYPES["Punctuator"] = "Punctuator"; + AST_TOKEN_TYPES["RegularExpression"] = "RegularExpression"; + AST_TOKEN_TYPES["String"] = "String"; + AST_TOKEN_TYPES["Template"] = "Template"; + // comment types + AST_TOKEN_TYPES["Block"] = "Block"; + AST_TOKEN_TYPES["Line"] = "Line"; +})(AST_TOKEN_TYPES || (AST_TOKEN_TYPES = {})); +exports.AST_TOKEN_TYPES = AST_TOKEN_TYPES; +//# sourceMappingURL=ast-token-types.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/ast-token-types.js.map b/node_modules/@typescript-eslint/types/dist/ast-token-types.js.map new file mode 100644 index 000000000..10b2fa5f2 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/ast-token-types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ast-token-types.js","sourceRoot":"","sources":["../src/ast-token-types.ts"],"names":[],"mappings":";;;AAAA,IAAK,eAgBJ;AAhBD,WAAK,eAAe;IAClB,sCAAmB,CAAA;IACnB,4CAAyB,CAAA;IACzB,kDAA+B,CAAA;IAC/B,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;IACnB,gCAAa,CAAA;IACb,sCAAmB,CAAA;IACnB,4CAAyB,CAAA;IACzB,0DAAuC,CAAA;IACvC,oCAAiB,CAAA;IACjB,wCAAqB,CAAA;IAErB,gBAAgB;IAChB,kCAAe,CAAA;IACf,gCAAa,CAAA;AACf,CAAC,EAhBI,eAAe,KAAf,eAAe,QAgBnB;AAEQ,0CAAe"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/index.d.ts b/node_modules/@typescript-eslint/types/dist/index.d.ts new file mode 100644 index 000000000..8f03adbbc --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/index.d.ts @@ -0,0 +1,7 @@ +import * as TSESTree from './ts-estree'; +export { AST_NODE_TYPES } from './ast-node-types'; +export { AST_TOKEN_TYPES } from './ast-token-types'; +export * from './lib'; +export * from './parser-options'; +export { TSESTree }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/index.d.ts.map b/node_modules/@typescript-eslint/types/dist/index.d.ts.map new file mode 100644 index 000000000..bdebc7c4f --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,cAAc,OAAO,CAAC;AACtB,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/index.js b/node_modules/@typescript-eslint/types/dist/index.js new file mode 100644 index 000000000..cf76bb387 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/index.js @@ -0,0 +1,36 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TSESTree = exports.AST_TOKEN_TYPES = exports.AST_NODE_TYPES = void 0; +// TODO(Brad Zacher) - convert this to export * as TSESTree from './ts-estree' +// https://github.com/sandersn/downlevel-dts/pull/42 +const TSESTree = __importStar(require("./ts-estree")); +exports.TSESTree = TSESTree; +var ast_node_types_1 = require("./ast-node-types"); +Object.defineProperty(exports, "AST_NODE_TYPES", { enumerable: true, get: function () { return ast_node_types_1.AST_NODE_TYPES; } }); +var ast_token_types_1 = require("./ast-token-types"); +Object.defineProperty(exports, "AST_TOKEN_TYPES", { enumerable: true, get: function () { return ast_token_types_1.AST_TOKEN_TYPES; } }); +__exportStar(require("./lib"), exports); +__exportStar(require("./parser-options"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/index.js.map b/node_modules/@typescript-eslint/types/dist/index.js.map new file mode 100644 index 000000000..43ca6e568 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8EAA8E;AAC9E,oDAAoD;AACpD,sDAAwC;AAM/B,4BAAQ;AAJjB,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,wCAAsB;AACtB,mDAAiC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/lib.d.ts b/node_modules/@typescript-eslint/types/dist/lib.d.ts new file mode 100644 index 000000000..afbb6a199 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/lib.d.ts @@ -0,0 +1,3 @@ +declare type Lib = 'es5' | 'es6' | 'es2015' | 'es7' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'esnext' | 'dom' | 'dom.iterable' | 'webworker' | 'webworker.importscripts' | 'scripthost' | 'es2015.core' | 'es2015.collection' | 'es2015.generator' | 'es2015.iterable' | 'es2015.promise' | 'es2015.proxy' | 'es2015.reflect' | 'es2015.symbol' | 'es2015.symbol.wellknown' | 'es2016.array.include' | 'es2017.object' | 'es2017.sharedmemory' | 'es2017.string' | 'es2017.intl' | 'es2017.typedarrays' | 'es2018.asyncgenerator' | 'es2018.asynciterable' | 'es2018.intl' | 'es2018.promise' | 'es2018.regexp' | 'es2019.array' | 'es2019.object' | 'es2019.string' | 'es2019.symbol' | 'es2020.bigint' | 'es2020.promise' | 'es2020.string' | 'es2020.symbol.wellknown' | 'es2020.intl' | 'esnext.array' | 'esnext.symbol' | 'esnext.asynciterable' | 'esnext.intl' | 'esnext.bigint' | 'esnext.string' | 'esnext.promise' | 'es2016.full' | 'es2017.full' | 'es2018.full' | 'es2019.full' | 'es2020.full' | 'esnext.full' | 'lib'; +export { Lib }; +//# sourceMappingURL=lib.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/lib.d.ts.map b/node_modules/@typescript-eslint/types/dist/lib.d.ts.map new file mode 100644 index 000000000..d464c4630 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/lib.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAIA,aAAK,GAAG,GACJ,KAAK,GACL,KAAK,GACL,QAAQ,GACR,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,KAAK,GACL,cAAc,GACd,WAAW,GACX,yBAAyB,GACzB,YAAY,GACZ,aAAa,GACb,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,gBAAgB,GAChB,cAAc,GACd,gBAAgB,GAChB,eAAe,GACf,yBAAyB,GACzB,sBAAsB,GACtB,eAAe,GACf,qBAAqB,GACrB,eAAe,GACf,aAAa,GACb,oBAAoB,GACpB,uBAAuB,GACvB,sBAAsB,GACtB,aAAa,GACb,gBAAgB,GAChB,eAAe,GACf,cAAc,GACd,eAAe,GACf,eAAe,GACf,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,eAAe,GACf,yBAAyB,GACzB,aAAa,GACb,cAAc,GACd,eAAe,GACf,sBAAsB,GACtB,aAAa,GACb,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,aAAa,GACb,aAAa,GACb,aAAa,GACb,aAAa,GACb,aAAa,GACb,aAAa,GACb,KAAK,CAAC;AAEV,OAAO,EAAE,GAAG,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/lib.js b/node_modules/@typescript-eslint/types/dist/lib.js new file mode 100644 index 000000000..fc0e81547 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/lib.js @@ -0,0 +1,6 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// YOU CAN REGENERATE IT USING yarn generate:lib +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=lib.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/lib.js.map b/node_modules/@typescript-eslint/types/dist/lib.js.map new file mode 100644 index 000000000..67615c340 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/lib.js.map @@ -0,0 +1 @@ +{"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,gCAAgC;AAChC,gDAAgD"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/parser-options.d.ts b/node_modules/@typescript-eslint/types/dist/parser-options.d.ts new file mode 100644 index 000000000..5d2953d39 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/parser-options.d.ts @@ -0,0 +1,31 @@ +import { Lib } from './lib'; +declare type DebugLevel = boolean | ('typescript-eslint' | 'eslint' | 'typescript')[]; +declare type EcmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020; +declare type SourceType = 'script' | 'module'; +interface ParserOptions { + ecmaFeatures?: { + globalReturn?: boolean; + jsx?: boolean; + }; + ecmaVersion?: EcmaVersion; + jsxPragma?: string; + jsxFragmentName?: string | null; + lib?: Lib[]; + comment?: boolean; + debugLevel?: DebugLevel; + errorOnTypeScriptSyntacticAndSemanticIssues?: boolean; + errorOnUnknownASTType?: boolean; + extraFileExtensions?: string[]; + filePath?: string; + loc?: boolean; + project?: string | string[]; + projectFolderIgnoreList?: (string | RegExp)[]; + range?: boolean; + sourceType?: SourceType; + tokens?: boolean; + tsconfigRootDir?: string; + useJSXTextNode?: boolean; + warnOnUnsupportedTypeScriptVersion?: boolean; +} +export { DebugLevel, EcmaVersion, ParserOptions, SourceType }; +//# sourceMappingURL=parser-options.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/parser-options.d.ts.map b/node_modules/@typescript-eslint/types/dist/parser-options.d.ts.map new file mode 100644 index 000000000..4ebe73379 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/parser-options.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parser-options.d.ts","sourceRoot":"","sources":["../src/parser-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,aAAK,UAAU,GAAG,OAAO,GAAG,CAAC,mBAAmB,GAAG,QAAQ,GAAG,YAAY,CAAC,EAAE,CAAC;AAE9E,aAAK,WAAW,GACZ,CAAC,GACD,CAAC,GACD,CAAC,GACD,CAAC,GACD,CAAC,GACD,CAAC,GACD,EAAE,GACF,EAAE,GACF,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,CAAC;AAET,aAAK,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEtC,UAAU,aAAa;IACrB,YAAY,CAAC,EAAE;QACb,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,GAAG,CAAC,EAAE,OAAO,CAAC;KACf,CAAC;IACF,WAAW,CAAC,EAAE,WAAW,CAAC;IAG1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC;IAGZ,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,2CAA2C,CAAC,EAAE,OAAO,CAAC;IACtD,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B,uBAAuB,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAC9C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kCAAkC,CAAC,EAAE,OAAO,CAAC;CAC9C;AAED,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/parser-options.js b/node_modules/@typescript-eslint/types/dist/parser-options.js new file mode 100644 index 000000000..66f40a290 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/parser-options.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=parser-options.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/parser-options.js.map b/node_modules/@typescript-eslint/types/dist/parser-options.js.map new file mode 100644 index 000000000..22b7b8ab9 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/parser-options.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parser-options.js","sourceRoot":"","sources":["../src/parser-options.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/ts-estree.d.ts b/node_modules/@typescript-eslint/types/dist/ts-estree.d.ts new file mode 100644 index 000000000..1bf72ebaf --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/ts-estree.d.ts @@ -0,0 +1,1070 @@ +import { AST_NODE_TYPES } from './ast-node-types'; +import { AST_TOKEN_TYPES } from './ast-token-types'; +export interface LineAndColumnData { + /** + * Line number (1-indexed) + */ + line: number; + /** + * Column number on the line (0-indexed) + */ + column: number; +} +export interface SourceLocation { + /** + * The position of the first character of the parsed source region + */ + start: LineAndColumnData; + /** + * The position of the first character after the parsed source region + */ + end: LineAndColumnData; +} +export declare type Range = [number, number]; +export interface BaseNode { + /** + * The source location information of the node. + */ + loc: SourceLocation; + /** + * An array of two numbers. + * Both numbers are a 0-based index which is the position in the array of source code characters. + * The first is the start position of the node, the second is the end position of the node. + */ + range: Range; + /** + * The parent node of the current node + */ + parent?: Node; +} +interface BaseToken extends BaseNode { + value: string; +} +export interface BooleanToken extends BaseToken { + type: AST_TOKEN_TYPES.Boolean; +} +export interface IdentifierToken extends BaseToken { + type: AST_TOKEN_TYPES.Identifier; +} +export interface JSXIdentifierToken extends BaseToken { + type: AST_TOKEN_TYPES.JSXIdentifier; +} +export interface JSXTextToken extends BaseToken { + type: AST_TOKEN_TYPES.JSXText; +} +export interface KeywordToken extends BaseToken { + type: AST_TOKEN_TYPES.Keyword; +} +export interface NullToken extends BaseToken { + type: AST_TOKEN_TYPES.Null; +} +export interface NumericToken extends BaseToken { + type: AST_TOKEN_TYPES.Numeric; +} +export interface PunctuatorToken extends BaseToken { + type: AST_TOKEN_TYPES.Punctuator; +} +export interface RegularExpressionToken extends BaseToken { + type: AST_TOKEN_TYPES.RegularExpression; + regex: { + pattern: string; + flags: string; + }; +} +export interface StringToken extends BaseToken { + type: AST_TOKEN_TYPES.String; +} +export interface TemplateToken extends BaseToken { + type: AST_TOKEN_TYPES.Template; +} +export interface BlockComment extends BaseToken { + type: AST_TOKEN_TYPES.Block; +} +export interface LineComment extends BaseToken { + type: AST_TOKEN_TYPES.Line; +} +export declare type Comment = BlockComment | LineComment; +export declare type Token = BooleanToken | Comment | IdentifierToken | JSXIdentifierToken | JSXTextToken | KeywordToken | NullToken | NumericToken | PunctuatorToken | RegularExpressionToken | StringToken | TemplateToken; +export declare type OptionalRangeAndLoc = Pick> & { + range?: Range; + loc?: SourceLocation; +}; +export declare type Node = ArrayExpression | ArrayPattern | ArrowFunctionExpression | AssignmentExpression | AssignmentPattern | AwaitExpression | BigIntLiteral | BinaryExpression | BlockStatement | BreakStatement | CallExpression | CatchClause | ChainExpression | ClassBody | ClassDeclaration | ClassExpression | ClassProperty | ConditionalExpression | ContinueStatement | DebuggerStatement | Decorator | DoWhileStatement | EmptyStatement | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ExportSpecifier | ExpressionStatement | ForInStatement | ForOfStatement | ForStatement | FunctionDeclaration | FunctionExpression | Identifier | IfStatement | ImportDeclaration | ImportDefaultSpecifier | ImportExpression | ImportNamespaceSpecifier | ImportSpecifier | JSXAttribute | JSXClosingElement | JSXClosingFragment | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXFragment | JSXIdentifier | JSXMemberExpression | JSXOpeningElement | JSXOpeningFragment | JSXSpreadAttribute | JSXSpreadChild | JSXText | LabeledStatement | Literal | LogicalExpression | MemberExpression | MetaProperty | MethodDefinition | NewExpression | ObjectExpression | ObjectPattern | Program | Property | RestElement | ReturnStatement | SequenceExpression | SpreadElement | Super | SwitchCase | SwitchStatement | TaggedTemplateExpression | TemplateElement | TemplateLiteral | ThisExpression | ThrowStatement | TryStatement | TSAbstractClassProperty | TSAbstractKeyword | TSAbstractMethodDefinition | TSAnyKeyword | TSArrayType | TSAsExpression | TSAsyncKeyword | TSBigIntKeyword | TSBooleanKeyword | TSCallSignatureDeclaration | TSClassImplements | TSConditionalType | TSConstructorType | TSConstructSignatureDeclaration | TSDeclareFunction | TSDeclareKeyword | TSEmptyBodyFunctionExpression | TSEnumDeclaration | TSEnumMember | TSExportAssignment | TSExportKeyword | TSExternalModuleReference | TSFunctionType | TSImportEqualsDeclaration | TSImportType | TSIndexedAccessType | TSIndexSignature | TSInferType | TSInterfaceBody | TSInterfaceDeclaration | TSInterfaceHeritage | TSIntersectionType | TSLiteralType | TSMappedType | TSMethodSignature | TSModuleBlock | TSModuleDeclaration | TSNamedTupleMember | TSNamespaceExportDeclaration | TSNeverKeyword | TSNonNullExpression | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSParameterProperty | TSParenthesizedType | TSPrivateKeyword | TSPropertySignature | TSProtectedKeyword | TSPublicKeyword | TSQualifiedName | TSReadonlyKeyword | TSRestType | TSStaticKeyword | TSStringKeyword | TSSymbolKeyword | TSThisType | TSTupleType | TSTypeAliasDeclaration | TSTypeAnnotation | TSTypeAssertion | TSTypeLiteral | TSTypeOperator | TSTypeParameter | TSTypeParameterDeclaration | TSTypeParameterInstantiation | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUndefinedKeyword | TSUnionType | TSUnknownKeyword | TSVoidKeyword | UnaryExpression | UpdateExpression | VariableDeclaration | VariableDeclarator | WhileStatement | WithStatement | YieldExpression; +export declare type Accessibility = 'public' | 'protected' | 'private'; +export declare type BindingPattern = ArrayPattern | ObjectPattern; +export declare type BindingName = BindingPattern | Identifier; +export declare type ChainElement = CallExpression | MemberExpression | TSNonNullExpression; +export declare type ClassElement = ClassProperty | MethodDefinition | TSAbstractClassProperty | TSAbstractMethodDefinition | TSIndexSignature; +export declare type ClassProperty = ClassPropertyComputedName | ClassPropertyNonComputedName; +export declare type DeclarationStatement = ClassDeclaration | ClassExpression | ExportDefaultDeclaration | ExportAllDeclaration | ExportNamedDeclaration | FunctionDeclaration | TSDeclareFunction | TSImportEqualsDeclaration | TSInterfaceDeclaration | TSModuleDeclaration | TSNamespaceExportDeclaration | TSTypeAliasDeclaration | TSEnumDeclaration; +export declare type DestructuringPattern = Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression; +export declare type EntityName = Identifier | TSQualifiedName; +export declare type ExportDeclaration = ClassDeclaration | ClassExpression | FunctionDeclaration | TSDeclareFunction | TSEnumDeclaration | TSInterfaceDeclaration | TSModuleDeclaration | TSTypeAliasDeclaration | VariableDeclaration; +export declare type Expression = ArrowFunctionExpression | AssignmentExpression | BinaryExpression | ChainExpression | ConditionalExpression | ImportExpression | JSXClosingElement | JSXClosingFragment | JSXExpressionContainer | JSXOpeningElement | JSXOpeningFragment | JSXSpreadChild | LogicalExpression | NewExpression | RestElement | SequenceExpression | SpreadElement | TSAsExpression | TSUnaryExpression | YieldExpression; +export declare type ForInitialiser = Expression | VariableDeclaration; +export declare type ImportClause = ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier; +export declare type IterationStatement = DoWhileStatement | ForInStatement | ForOfStatement | ForStatement | WhileStatement; +export declare type JSXChild = JSXElement | JSXExpression | JSXFragment | JSXText; +export declare type JSXExpression = JSXEmptyExpression | JSXSpreadChild | JSXExpressionContainer; +export declare type JSXTagNameExpression = JSXIdentifier | JSXMemberExpression; +export declare type LeftHandSideExpression = CallExpression | ClassExpression | ClassDeclaration | FunctionExpression | LiteralExpression | MemberExpression | PrimaryExpression | TaggedTemplateExpression | TSNonNullExpression | TSAsExpression | ArrowFunctionExpression; +export declare type Literal = BigIntLiteral | BooleanLiteral | NumberLiteral | NullLiteral | RegExpLiteral | StringLiteral; +export declare type LiteralExpression = Literal | TemplateLiteral; +export declare type MemberExpression = MemberExpressionComputedName | MemberExpressionNonComputedName; +export declare type MethodDefinition = MethodDefinitionComputedName | MethodDefinitionNonComputedName; +export declare type Modifier = TSAbstractKeyword | TSAsyncKeyword | TSDeclareKeyword | TSExportKeyword | TSPublicKeyword | TSPrivateKeyword | TSProtectedKeyword | TSReadonlyKeyword | TSStaticKeyword; +export declare type ObjectLiteralElementLike = MethodDefinition | Property | SpreadElement | TSAbstractMethodDefinition; +export declare type Parameter = ArrayPattern | AssignmentPattern | Identifier | ObjectPattern | RestElement | TSParameterProperty; +export declare type PrimaryExpression = ArrayExpression | ArrayPattern | ClassExpression | FunctionExpression | Identifier | JSXElement | JSXFragment | JSXOpeningElement | Literal | LiteralExpression | MetaProperty | ObjectExpression | ObjectPattern | Super | TemplateLiteral | ThisExpression | TSNullKeyword; +export declare type ProgramStatement = ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration | Statement | TSDeclareFunction | TSEnumDeclaration | TSExportAssignment | TSImportEqualsDeclaration | TSInterfaceDeclaration | TSNamespaceExportDeclaration | TSTypeAliasDeclaration; +export declare type Property = PropertyComputedName | PropertyNonComputedName; +export declare type PropertyName = PropertyNameComputed | PropertyNameNonComputed; +export declare type PropertyNameComputed = Expression; +export declare type PropertyNameNonComputed = Identifier | StringLiteral | NumberLiteral; +export declare type Statement = BlockStatement | BreakStatement | ContinueStatement | DebuggerStatement | DeclarationStatement | EmptyStatement | ExpressionStatement | IfStatement | IterationStatement | ImportDeclaration | LabeledStatement | TSModuleBlock | ReturnStatement | SwitchStatement | ThrowStatement | TryStatement | VariableDeclaration | WithStatement; +export declare type TSAbstractClassProperty = TSAbstractClassPropertyComputedName | TSAbstractClassPropertyNonComputedName; +export declare type TSAbstractMethodDefinition = TSAbstractMethodDefinitionComputedName | TSAbstractMethodDefinitionNonComputedName; +export declare type TSMethodSignature = TSMethodSignatureComputedName | TSMethodSignatureNonComputedName; +export declare type TSPropertySignature = TSPropertySignatureComputedName | TSPropertySignatureNonComputedName; +export declare type TSEnumMember = TSEnumMemberComputedName | TSEnumMemberNonComputedName; +export declare type TSUnaryExpression = AwaitExpression | LeftHandSideExpression | TSTypeAssertion | UnaryExpression | UpdateExpression; +export declare type TypeElement = TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSIndexSignature | TSMethodSignature | TSPropertySignature; +export declare type TypeNode = TSAnyKeyword | TSArrayType | TSBigIntKeyword | TSBooleanKeyword | TSConditionalType | TSConstructorType | TSFunctionType | TSImportType | TSIndexedAccessType | TSInferType | TSInterfaceHeritage | TSIntersectionType | TSLiteralType | TSMappedType | TSNamedTupleMember | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSParenthesizedType | TSRestType | TSStringKeyword | TSSymbolKeyword | TSThisType | TSTupleType | TSTypeLiteral | TSTypeOperator | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUndefinedKeyword | TSUnionType | TSUnknownKeyword | TSVoidKeyword; +interface BinaryExpressionBase extends BaseNode { + operator: string; + left: Expression; + right: Expression; +} +interface CallExpressionBase extends BaseNode { + callee: LeftHandSideExpression; + arguments: Expression[]; + typeParameters?: TSTypeParameterInstantiation; + optional: boolean; +} +interface ClassDeclarationBase extends BaseNode { + typeParameters?: TSTypeParameterDeclaration; + superTypeParameters?: TSTypeParameterInstantiation; + id: Identifier | null; + body: ClassBody; + superClass: LeftHandSideExpression | null; + implements?: TSClassImplements[]; + abstract?: boolean; + declare?: boolean; + decorators?: Decorator[]; +} +/** this should not be directly used - instead use ClassPropertyComputedNameBase or ClassPropertyNonComputedNameBase */ +interface ClassPropertyBase extends BaseNode { + key: PropertyName; + value: Expression | null; + computed: boolean; + static: boolean; + declare: boolean; + readonly?: boolean; + decorators?: Decorator[]; + accessibility?: Accessibility; + optional?: boolean; + definite?: boolean; + typeAnnotation?: TSTypeAnnotation; +} +interface ClassPropertyComputedNameBase extends ClassPropertyBase { + key: PropertyNameComputed; + computed: true; +} +interface ClassPropertyNonComputedNameBase extends ClassPropertyBase { + key: PropertyNameNonComputed; + computed: false; +} +interface FunctionDeclarationBase extends BaseNode { + id: Identifier | null; + generator: boolean; + expression: boolean; + async: boolean; + params: Parameter[]; + body?: BlockStatement | null; + returnType?: TSTypeAnnotation; + typeParameters?: TSTypeParameterDeclaration; + declare?: boolean; +} +interface FunctionSignatureBase extends BaseNode { + params: Parameter[]; + returnType?: TSTypeAnnotation; + typeParameters?: TSTypeParameterDeclaration; +} +interface LiteralBase extends BaseNode { + raw: string; + value: string | boolean | null | number | RegExp | bigint; + regex?: { + pattern: string; + flags: string; + }; +} +/** this should not be directly used - instead use MemberExpressionComputedNameBase or MemberExpressionNonComputedNameBase */ +interface MemberExpressionBase extends BaseNode { + object: LeftHandSideExpression; + property: Expression | Identifier; + computed: boolean; + optional: boolean; +} +interface MemberExpressionComputedNameBase extends MemberExpressionBase { + property: Expression; + computed: true; +} +interface MemberExpressionNonComputedNameBase extends MemberExpressionBase { + property: Identifier; + computed: false; +} +/** this should not be directly used - instead use MethodDefinitionComputedNameBase or MethodDefinitionNonComputedNameBase */ +interface MethodDefinitionBase extends BaseNode { + key: PropertyName; + value: FunctionExpression | TSEmptyBodyFunctionExpression; + computed: boolean; + static: boolean; + kind: 'method' | 'get' | 'set' | 'constructor'; + optional?: boolean; + decorators?: Decorator[]; + accessibility?: Accessibility; + typeParameters?: TSTypeParameterDeclaration; +} +interface MethodDefinitionComputedNameBase extends MethodDefinitionBase { + key: PropertyNameComputed; + computed: true; +} +interface MethodDefinitionNonComputedNameBase extends MethodDefinitionBase { + key: PropertyNameNonComputed; + computed: false; +} +interface PropertyBase extends BaseNode { + type: AST_NODE_TYPES.Property; + key: PropertyName; + value: Expression | AssignmentPattern | BindingName | TSEmptyBodyFunctionExpression; + computed: boolean; + method: boolean; + shorthand: boolean; + optional?: boolean; + kind: 'init' | 'get' | 'set'; +} +interface TSEnumMemberBase extends BaseNode { + type: AST_NODE_TYPES.TSEnumMember; + id: PropertyNameNonComputed | PropertyNameComputed; + initializer?: Expression; + computed?: boolean; +} +interface TSHeritageBase extends BaseNode { + expression: Expression; + typeParameters?: TSTypeParameterInstantiation; +} +interface TSMethodSignatureBase extends BaseNode { + type: AST_NODE_TYPES.TSMethodSignature; + key: PropertyName; + computed: boolean; + params: Parameter[]; + optional?: boolean; + returnType?: TSTypeAnnotation; + readonly?: boolean; + typeParameters?: TSTypeParameterDeclaration; + accessibility?: Accessibility; + export?: boolean; + static?: boolean; +} +interface TSPropertySignatureBase extends BaseNode { + type: AST_NODE_TYPES.TSPropertySignature; + key: PropertyName; + optional?: boolean; + computed: boolean; + typeAnnotation?: TSTypeAnnotation; + initializer?: Expression; + readonly?: boolean; + static?: boolean; + export?: boolean; + accessibility?: Accessibility; +} +interface UnaryExpressionBase extends BaseNode { + operator: string; + prefix: boolean; + argument: LeftHandSideExpression | Literal | UnaryExpression; +} +export interface ArrayExpression extends BaseNode { + type: AST_NODE_TYPES.ArrayExpression; + elements: Expression[]; +} +export interface ArrayPattern extends BaseNode { + type: AST_NODE_TYPES.ArrayPattern; + elements: (DestructuringPattern | null)[]; + typeAnnotation?: TSTypeAnnotation; + optional?: boolean; + decorators?: Decorator[]; +} +export interface ArrowFunctionExpression extends BaseNode { + type: AST_NODE_TYPES.ArrowFunctionExpression; + generator: boolean; + id: null; + params: Parameter[]; + body: Expression | BlockStatement; + async: boolean; + expression: boolean; + returnType?: TSTypeAnnotation; + typeParameters?: TSTypeParameterDeclaration; +} +export interface AssignmentExpression extends BinaryExpressionBase { + type: AST_NODE_TYPES.AssignmentExpression; + operator: '-=' | '??=' | '**=' | '*=' | '/=' | '&&=' | '&=' | '%=' | '^=' | '+=' | '<<=' | '=' | '>>=' | '>>>=' | '|=' | '||='; +} +export interface AssignmentPattern extends BaseNode { + type: AST_NODE_TYPES.AssignmentPattern; + left: BindingName; + right: Expression; + typeAnnotation?: TSTypeAnnotation; + optional?: boolean; + decorators?: Decorator[]; +} +export interface AwaitExpression extends BaseNode { + type: AST_NODE_TYPES.AwaitExpression; + argument: TSUnaryExpression; +} +export interface BigIntLiteral extends LiteralBase { + type: AST_NODE_TYPES.Literal; + value: bigint | null; + bigint: string; +} +export interface BinaryExpression extends BinaryExpressionBase { + type: AST_NODE_TYPES.BinaryExpression; +} +export interface BlockStatement extends BaseNode { + type: AST_NODE_TYPES.BlockStatement; + body: Statement[]; +} +export interface BooleanLiteral extends LiteralBase { + type: AST_NODE_TYPES.Literal; + value: boolean; +} +export interface BreakStatement extends BaseNode { + type: AST_NODE_TYPES.BreakStatement; + label: Identifier | null; +} +export interface ChainExpression extends BaseNode { + type: AST_NODE_TYPES.ChainExpression; + expression: ChainElement; +} +export interface CallExpression extends CallExpressionBase { + type: AST_NODE_TYPES.CallExpression; +} +export interface CatchClause extends BaseNode { + type: AST_NODE_TYPES.CatchClause; + param: BindingName | null; + body: BlockStatement; +} +export interface ClassBody extends BaseNode { + type: AST_NODE_TYPES.ClassBody; + body: ClassElement[]; +} +export interface ClassDeclaration extends ClassDeclarationBase { + type: AST_NODE_TYPES.ClassDeclaration; +} +export interface ClassExpression extends ClassDeclarationBase { + type: AST_NODE_TYPES.ClassExpression; +} +export interface ClassPropertyComputedName extends ClassPropertyComputedNameBase { + type: AST_NODE_TYPES.ClassProperty; +} +export interface ClassPropertyNonComputedName extends ClassPropertyNonComputedNameBase { + type: AST_NODE_TYPES.ClassProperty; +} +export interface ConditionalExpression extends BaseNode { + type: AST_NODE_TYPES.ConditionalExpression; + test: Expression; + consequent: Expression; + alternate: Expression; +} +export interface ContinueStatement extends BaseNode { + type: AST_NODE_TYPES.ContinueStatement; + label: Identifier | null; +} +export interface DebuggerStatement extends BaseNode { + type: AST_NODE_TYPES.DebuggerStatement; +} +export interface Decorator extends BaseNode { + type: AST_NODE_TYPES.Decorator; + expression: LeftHandSideExpression; +} +export interface DoWhileStatement extends BaseNode { + type: AST_NODE_TYPES.DoWhileStatement; + test: Expression; + body: Statement; +} +export interface EmptyStatement extends BaseNode { + type: AST_NODE_TYPES.EmptyStatement; +} +export interface ExportAllDeclaration extends BaseNode { + type: AST_NODE_TYPES.ExportAllDeclaration; + source: Expression | null; + exportKind: 'type' | 'value'; + exported: Identifier | null; +} +export interface ExportDefaultDeclaration extends BaseNode { + type: AST_NODE_TYPES.ExportDefaultDeclaration; + declaration: ExportDeclaration | Expression; + exportKind: 'type' | 'value'; +} +export interface ExportNamedDeclaration extends BaseNode { + type: AST_NODE_TYPES.ExportNamedDeclaration; + declaration: ExportDeclaration | null; + specifiers: ExportSpecifier[]; + source: Expression | null; + exportKind: 'type' | 'value'; +} +export interface ExportSpecifier extends BaseNode { + type: AST_NODE_TYPES.ExportSpecifier; + local: Identifier; + exported: Identifier; +} +export interface ExpressionStatement extends BaseNode { + type: AST_NODE_TYPES.ExpressionStatement; + expression: Expression; + directive?: string; +} +export interface ForInStatement extends BaseNode { + type: AST_NODE_TYPES.ForInStatement; + left: ForInitialiser; + right: Expression; + body: Statement; +} +export interface ForOfStatement extends BaseNode { + type: AST_NODE_TYPES.ForOfStatement; + left: ForInitialiser; + right: Expression; + body: Statement; + await: boolean; +} +export interface ForStatement extends BaseNode { + type: AST_NODE_TYPES.ForStatement; + init: Expression | ForInitialiser | null; + test: Expression | null; + update: Expression | null; + body: Statement; +} +export interface FunctionDeclaration extends FunctionDeclarationBase { + type: AST_NODE_TYPES.FunctionDeclaration; + body: BlockStatement; +} +export interface FunctionExpression extends FunctionDeclarationBase { + type: AST_NODE_TYPES.FunctionExpression; + body: BlockStatement; +} +export interface Identifier extends BaseNode { + type: AST_NODE_TYPES.Identifier; + name: string; + typeAnnotation?: TSTypeAnnotation; + optional?: boolean; + decorators?: Decorator[]; +} +export interface IfStatement extends BaseNode { + type: AST_NODE_TYPES.IfStatement; + test: Expression; + consequent: Statement; + alternate: Statement | null; +} +export interface ImportDeclaration extends BaseNode { + type: AST_NODE_TYPES.ImportDeclaration; + source: Literal; + specifiers: ImportClause[]; + importKind: 'type' | 'value'; +} +export interface ImportDefaultSpecifier extends BaseNode { + type: AST_NODE_TYPES.ImportDefaultSpecifier; + local: Identifier; +} +export interface ImportExpression extends BaseNode { + type: AST_NODE_TYPES.ImportExpression; + source: Expression; +} +export interface ImportNamespaceSpecifier extends BaseNode { + type: AST_NODE_TYPES.ImportNamespaceSpecifier; + local: Identifier; +} +export interface ImportSpecifier extends BaseNode { + type: AST_NODE_TYPES.ImportSpecifier; + local: Identifier; + imported: Identifier; +} +export interface JSXAttribute extends BaseNode { + type: AST_NODE_TYPES.JSXAttribute; + name: JSXIdentifier; + value: Literal | JSXExpression | null; +} +export interface JSXClosingElement extends BaseNode { + type: AST_NODE_TYPES.JSXClosingElement; + name: JSXTagNameExpression; +} +export interface JSXClosingFragment extends BaseNode { + type: AST_NODE_TYPES.JSXClosingFragment; +} +export interface JSXElement extends BaseNode { + type: AST_NODE_TYPES.JSXElement; + openingElement: JSXOpeningElement; + closingElement: JSXClosingElement | null; + children: JSXChild[]; +} +export interface JSXEmptyExpression extends BaseNode { + type: AST_NODE_TYPES.JSXEmptyExpression; +} +export interface JSXExpressionContainer extends BaseNode { + type: AST_NODE_TYPES.JSXExpressionContainer; + expression: Expression | JSXEmptyExpression; +} +export interface JSXFragment extends BaseNode { + type: AST_NODE_TYPES.JSXFragment; + openingFragment: JSXOpeningFragment; + closingFragment: JSXClosingFragment; + children: JSXChild[]; +} +export interface JSXIdentifier extends BaseNode { + type: AST_NODE_TYPES.JSXIdentifier; + name: string; +} +export interface JSXMemberExpression extends BaseNode { + type: AST_NODE_TYPES.JSXMemberExpression; + object: JSXTagNameExpression; + property: JSXIdentifier; +} +export interface JSXOpeningElement extends BaseNode { + type: AST_NODE_TYPES.JSXOpeningElement; + typeParameters?: TSTypeParameterInstantiation; + selfClosing: boolean; + name: JSXTagNameExpression; + attributes: JSXAttribute[]; +} +export interface JSXOpeningFragment extends BaseNode { + type: AST_NODE_TYPES.JSXOpeningFragment; +} +export interface JSXSpreadAttribute extends BaseNode { + type: AST_NODE_TYPES.JSXSpreadAttribute; + argument: Expression; +} +export interface JSXSpreadChild extends BaseNode { + type: AST_NODE_TYPES.JSXSpreadChild; + expression: Expression | JSXEmptyExpression; +} +export interface JSXText extends BaseNode { + type: AST_NODE_TYPES.JSXText; + value: string; + raw: string; +} +export interface LabeledStatement extends BaseNode { + type: AST_NODE_TYPES.LabeledStatement; + label: Identifier; + body: Statement; +} +export interface LogicalExpression extends BinaryExpressionBase { + type: AST_NODE_TYPES.LogicalExpression; +} +export interface MemberExpressionComputedName extends MemberExpressionComputedNameBase { + type: AST_NODE_TYPES.MemberExpression; +} +export interface MemberExpressionNonComputedName extends MemberExpressionNonComputedNameBase { + type: AST_NODE_TYPES.MemberExpression; +} +export interface MetaProperty extends BaseNode { + type: AST_NODE_TYPES.MetaProperty; + meta: Identifier; + property: Identifier; +} +export interface MethodDefinitionComputedName extends MethodDefinitionComputedNameBase { + type: AST_NODE_TYPES.MethodDefinition; +} +export interface MethodDefinitionNonComputedName extends MethodDefinitionNonComputedNameBase { + type: AST_NODE_TYPES.MethodDefinition; +} +export interface NewExpression extends BaseNode { + type: AST_NODE_TYPES.NewExpression; + callee: LeftHandSideExpression; + arguments: Expression[]; + typeParameters?: TSTypeParameterInstantiation; +} +export interface NumberLiteral extends LiteralBase { + type: AST_NODE_TYPES.Literal; + value: number; +} +export interface NullLiteral extends LiteralBase { + type: AST_NODE_TYPES.Literal; + value: null; +} +export interface ObjectExpression extends BaseNode { + type: AST_NODE_TYPES.ObjectExpression; + properties: ObjectLiteralElementLike[]; +} +export interface ObjectPattern extends BaseNode { + type: AST_NODE_TYPES.ObjectPattern; + properties: (Property | RestElement)[]; + typeAnnotation?: TSTypeAnnotation; + optional?: boolean; + decorators?: Decorator[]; +} +export interface Program extends BaseNode { + type: AST_NODE_TYPES.Program; + body: ProgramStatement[]; + sourceType: 'module' | 'script'; + comments?: Comment[]; + tokens?: Token[]; +} +export interface PropertyComputedName extends PropertyBase { + key: PropertyNameComputed; + computed: true; +} +export interface PropertyNonComputedName extends PropertyBase { + key: PropertyNameNonComputed; + computed: false; +} +export interface RegExpLiteral extends LiteralBase { + type: AST_NODE_TYPES.Literal; + value: RegExp; +} +export interface RestElement extends BaseNode { + type: AST_NODE_TYPES.RestElement; + argument: DestructuringPattern; + typeAnnotation?: TSTypeAnnotation; + optional?: boolean; + value?: AssignmentPattern; + decorators?: Decorator[]; +} +export interface ReturnStatement extends BaseNode { + type: AST_NODE_TYPES.ReturnStatement; + argument: Expression | null; +} +export interface SequenceExpression extends BaseNode { + type: AST_NODE_TYPES.SequenceExpression; + expressions: Expression[]; +} +export interface SpreadElement extends BaseNode { + type: AST_NODE_TYPES.SpreadElement; + argument: Expression; +} +export interface StringLiteral extends LiteralBase { + type: AST_NODE_TYPES.Literal; + value: string; +} +export interface Super extends BaseNode { + type: AST_NODE_TYPES.Super; +} +export interface SwitchCase extends BaseNode { + type: AST_NODE_TYPES.SwitchCase; + test: Expression | null; + consequent: Statement[]; +} +export interface SwitchStatement extends BaseNode { + type: AST_NODE_TYPES.SwitchStatement; + discriminant: Expression; + cases: SwitchCase[]; +} +export interface TaggedTemplateExpression extends BaseNode { + type: AST_NODE_TYPES.TaggedTemplateExpression; + typeParameters?: TSTypeParameterInstantiation; + tag: LeftHandSideExpression; + quasi: TemplateLiteral; +} +export interface TemplateElement extends BaseNode { + type: AST_NODE_TYPES.TemplateElement; + value: { + raw: string; + cooked: string; + }; + tail: boolean; +} +export interface TemplateLiteral extends BaseNode { + type: AST_NODE_TYPES.TemplateLiteral; + quasis: TemplateElement[]; + expressions: Expression[]; +} +export interface ThisExpression extends BaseNode { + type: AST_NODE_TYPES.ThisExpression; +} +export interface ThrowStatement extends BaseNode { + type: AST_NODE_TYPES.ThrowStatement; + argument: Statement | TSAsExpression | null; +} +export interface TryStatement extends BaseNode { + type: AST_NODE_TYPES.TryStatement; + block: BlockStatement; + handler: CatchClause | null; + finalizer: BlockStatement; +} +export interface TSAbstractClassPropertyComputedName extends ClassPropertyComputedNameBase { + type: AST_NODE_TYPES.TSAbstractClassProperty; +} +export interface TSAbstractClassPropertyNonComputedName extends ClassPropertyNonComputedNameBase { + type: AST_NODE_TYPES.TSAbstractClassProperty; +} +export interface TSAbstractKeyword extends BaseNode { + type: AST_NODE_TYPES.TSAbstractKeyword; +} +export interface TSAbstractMethodDefinitionComputedName extends MethodDefinitionComputedNameBase { + type: AST_NODE_TYPES.TSAbstractMethodDefinition; +} +export interface TSAbstractMethodDefinitionNonComputedName extends MethodDefinitionNonComputedNameBase { + type: AST_NODE_TYPES.TSAbstractMethodDefinition; +} +export interface TSAnyKeyword extends BaseNode { + type: AST_NODE_TYPES.TSAnyKeyword; +} +export interface TSArrayType extends BaseNode { + type: AST_NODE_TYPES.TSArrayType; + elementType: TypeNode; +} +export interface TSAsExpression extends BaseNode { + type: AST_NODE_TYPES.TSAsExpression; + expression: Expression; + typeAnnotation: TypeNode; +} +export interface TSAsyncKeyword extends BaseNode { + type: AST_NODE_TYPES.TSAsyncKeyword; +} +export interface TSBigIntKeyword extends BaseNode { + type: AST_NODE_TYPES.TSBigIntKeyword; +} +export interface TSBooleanKeyword extends BaseNode { + type: AST_NODE_TYPES.TSBooleanKeyword; +} +export interface TSCallSignatureDeclaration extends FunctionSignatureBase { + type: AST_NODE_TYPES.TSCallSignatureDeclaration; +} +export interface TSClassImplements extends TSHeritageBase { + type: AST_NODE_TYPES.TSClassImplements; +} +export interface TSConditionalType extends BaseNode { + type: AST_NODE_TYPES.TSConditionalType; + checkType: TypeNode; + extendsType: TypeNode; + trueType: TypeNode; + falseType: TypeNode; +} +export interface TSConstructorType extends FunctionSignatureBase { + type: AST_NODE_TYPES.TSConstructorType; +} +export interface TSConstructSignatureDeclaration extends FunctionSignatureBase { + type: AST_NODE_TYPES.TSConstructSignatureDeclaration; +} +export interface TSDeclareFunction extends FunctionDeclarationBase { + type: AST_NODE_TYPES.TSDeclareFunction; +} +export interface TSDeclareKeyword extends BaseNode { + type: AST_NODE_TYPES.TSDeclareKeyword; +} +export interface TSEmptyBodyFunctionExpression extends FunctionDeclarationBase { + type: AST_NODE_TYPES.TSEmptyBodyFunctionExpression; + body: null; +} +export interface TSEnumDeclaration extends BaseNode { + type: AST_NODE_TYPES.TSEnumDeclaration; + id: Identifier; + members: TSEnumMember[]; + const?: boolean; + declare?: boolean; + modifiers?: Modifier[]; +} +/** + * this should only really happen in semantically invalid code (errors 1164 and 2452) + * + * VALID: + * enum Foo { ['a'] } + * + * INVALID: + * const x = 'a'; + * enum Foo { [x] } + * enum Bar { ['a' + 'b'] } + */ +export interface TSEnumMemberComputedName extends TSEnumMemberBase { + id: PropertyNameComputed; + computed: true; +} +export interface TSEnumMemberNonComputedName extends TSEnumMemberBase { + id: PropertyNameNonComputed; + computed?: false; +} +export interface TSExportAssignment extends BaseNode { + type: AST_NODE_TYPES.TSExportAssignment; + expression: Expression; +} +export interface TSExportKeyword extends BaseNode { + type: AST_NODE_TYPES.TSExportKeyword; +} +export interface TSExternalModuleReference extends BaseNode { + type: AST_NODE_TYPES.TSExternalModuleReference; + expression: Expression; +} +export interface TSFunctionType extends FunctionSignatureBase { + type: AST_NODE_TYPES.TSFunctionType; +} +export interface TSImportEqualsDeclaration extends BaseNode { + type: AST_NODE_TYPES.TSImportEqualsDeclaration; + id: Identifier; + moduleReference: EntityName | TSExternalModuleReference; + isExport: boolean; +} +export interface TSImportType extends BaseNode { + type: AST_NODE_TYPES.TSImportType; + isTypeOf: boolean; + parameter: TypeNode; + qualifier: EntityName | null; + typeParameters: TSTypeParameterInstantiation | null; +} +export interface TSIndexedAccessType extends BaseNode { + type: AST_NODE_TYPES.TSIndexedAccessType; + objectType: TypeNode; + indexType: TypeNode; +} +export interface TSIndexSignature extends BaseNode { + type: AST_NODE_TYPES.TSIndexSignature; + parameters: Parameter[]; + typeAnnotation?: TSTypeAnnotation; + readonly?: boolean; + accessibility?: Accessibility; + export?: boolean; + static?: boolean; +} +export interface TSInferType extends BaseNode { + type: AST_NODE_TYPES.TSInferType; + typeParameter: TSTypeParameter; +} +export interface TSInterfaceDeclaration extends BaseNode { + type: AST_NODE_TYPES.TSInterfaceDeclaration; + body: TSInterfaceBody; + id: Identifier; + typeParameters?: TSTypeParameterDeclaration; + extends?: TSInterfaceHeritage[]; + implements?: TSInterfaceHeritage[]; + abstract?: boolean; + declare?: boolean; +} +export interface TSInterfaceBody extends BaseNode { + type: AST_NODE_TYPES.TSInterfaceBody; + body: TypeElement[]; +} +export interface TSInterfaceHeritage extends TSHeritageBase { + type: AST_NODE_TYPES.TSInterfaceHeritage; +} +export interface TSIntersectionType extends BaseNode { + type: AST_NODE_TYPES.TSIntersectionType; + types: TypeNode[]; +} +export interface TSLiteralType extends BaseNode { + type: AST_NODE_TYPES.TSLiteralType; + literal: LiteralExpression | UnaryExpression | UpdateExpression; +} +export interface TSMappedType extends BaseNode { + type: AST_NODE_TYPES.TSMappedType; + typeParameter: TSTypeParameter; + readonly?: boolean | '-' | '+'; + optional?: boolean | '-' | '+'; + typeAnnotation?: TypeNode; +} +export interface TSMethodSignatureComputedName extends TSMethodSignatureBase { + key: PropertyNameComputed; + computed: true; +} +export interface TSMethodSignatureNonComputedName extends TSMethodSignatureBase { + key: PropertyNameNonComputed; + computed: false; +} +export interface TSModuleBlock extends BaseNode { + type: AST_NODE_TYPES.TSModuleBlock; + body: ProgramStatement[]; +} +export interface TSModuleDeclaration extends BaseNode { + type: AST_NODE_TYPES.TSModuleDeclaration; + id: Identifier | Literal; + body?: TSModuleBlock; + global?: boolean; + declare?: boolean; + modifiers?: Modifier[]; +} +export interface TSNamespaceExportDeclaration extends BaseNode { + type: AST_NODE_TYPES.TSNamespaceExportDeclaration; + id: Identifier; +} +export interface TSNeverKeyword extends BaseNode { + type: AST_NODE_TYPES.TSNeverKeyword; +} +export interface TSNonNullExpression extends BaseNode { + type: AST_NODE_TYPES.TSNonNullExpression; + expression: Expression; +} +export interface TSNullKeyword extends BaseNode { + type: AST_NODE_TYPES.TSNullKeyword; +} +export interface TSNumberKeyword extends BaseNode { + type: AST_NODE_TYPES.TSNumberKeyword; +} +export interface TSObjectKeyword extends BaseNode { + type: AST_NODE_TYPES.TSObjectKeyword; +} +export interface TSOptionalType extends BaseNode { + type: AST_NODE_TYPES.TSOptionalType; + typeAnnotation: TypeNode; +} +export interface TSParameterProperty extends BaseNode { + type: AST_NODE_TYPES.TSParameterProperty; + accessibility?: Accessibility; + readonly?: boolean; + static?: boolean; + export?: boolean; + parameter: AssignmentPattern | BindingName | RestElement; + decorators?: Decorator[]; +} +export interface TSParenthesizedType extends BaseNode { + type: AST_NODE_TYPES.TSParenthesizedType; + typeAnnotation: TypeNode; +} +export interface TSPropertySignatureComputedName extends TSPropertySignatureBase { + key: PropertyNameComputed; + computed: true; +} +export interface TSPropertySignatureNonComputedName extends TSPropertySignatureBase { + key: PropertyNameNonComputed; + computed: false; +} +export interface TSPublicKeyword extends BaseNode { + type: AST_NODE_TYPES.TSPublicKeyword; +} +export interface TSPrivateKeyword extends BaseNode { + type: AST_NODE_TYPES.TSPrivateKeyword; +} +export interface TSProtectedKeyword extends BaseNode { + type: AST_NODE_TYPES.TSProtectedKeyword; +} +export interface TSQualifiedName extends BaseNode { + type: AST_NODE_TYPES.TSQualifiedName; + left: EntityName; + right: Identifier; +} +export interface TSReadonlyKeyword extends BaseNode { + type: AST_NODE_TYPES.TSReadonlyKeyword; +} +export interface TSRestType extends BaseNode { + type: AST_NODE_TYPES.TSRestType; + typeAnnotation: TypeNode; +} +export interface TSStaticKeyword extends BaseNode { + type: AST_NODE_TYPES.TSStaticKeyword; +} +export interface TSStringKeyword extends BaseNode { + type: AST_NODE_TYPES.TSStringKeyword; +} +export interface TSSymbolKeyword extends BaseNode { + type: AST_NODE_TYPES.TSSymbolKeyword; +} +export interface TSThisType extends BaseNode { + type: AST_NODE_TYPES.TSThisType; +} +export interface TSNamedTupleMember extends BaseNode { + type: AST_NODE_TYPES.TSNamedTupleMember; + elementType: TypeNode; + label: Identifier; + optional: boolean; +} +export interface TSTupleType extends BaseNode { + type: AST_NODE_TYPES.TSTupleType; + elementTypes: TypeNode[]; +} +export interface TSTypeAliasDeclaration extends BaseNode { + type: AST_NODE_TYPES.TSTypeAliasDeclaration; + id: Identifier; + typeAnnotation: TypeNode; + declare?: boolean; + typeParameters?: TSTypeParameterDeclaration; +} +export interface TSTypeAnnotation extends BaseNode { + type: AST_NODE_TYPES.TSTypeAnnotation; + typeAnnotation: TypeNode; +} +export interface TSTypeAssertion extends BaseNode { + type: AST_NODE_TYPES.TSTypeAssertion; + typeAnnotation: TypeNode; + expression: Expression; +} +export interface TSTypeLiteral extends BaseNode { + type: AST_NODE_TYPES.TSTypeLiteral; + members: TypeElement[]; +} +export interface TSTypeOperator extends BaseNode { + type: AST_NODE_TYPES.TSTypeOperator; + operator: 'keyof' | 'unique' | 'readonly'; + typeAnnotation?: TypeNode; +} +export interface TSTypeParameter extends BaseNode { + type: AST_NODE_TYPES.TSTypeParameter; + name: Identifier; + constraint?: TypeNode; + default?: TypeNode; +} +export interface TSTypeParameterDeclaration extends BaseNode { + type: AST_NODE_TYPES.TSTypeParameterDeclaration; + params: TSTypeParameter[]; +} +export interface TSTypeParameterInstantiation extends BaseNode { + type: AST_NODE_TYPES.TSTypeParameterInstantiation; + params: TypeNode[]; +} +export interface TSTypePredicate extends BaseNode { + type: AST_NODE_TYPES.TSTypePredicate; + asserts: boolean; + parameterName: Identifier | TSThisType; + typeAnnotation: TSTypeAnnotation | null; +} +export interface TSTypeQuery extends BaseNode { + type: AST_NODE_TYPES.TSTypeQuery; + exprName: EntityName; +} +export interface TSTypeReference extends BaseNode { + type: AST_NODE_TYPES.TSTypeReference; + typeName: EntityName; + typeParameters?: TSTypeParameterInstantiation; +} +export interface TSUndefinedKeyword extends BaseNode { + type: AST_NODE_TYPES.TSUndefinedKeyword; +} +export interface TSUnionType extends BaseNode { + type: AST_NODE_TYPES.TSUnionType; + types: TypeNode[]; +} +export interface TSUnknownKeyword extends BaseNode { + type: AST_NODE_TYPES.TSUnknownKeyword; +} +export interface TSVoidKeyword extends BaseNode { + type: AST_NODE_TYPES.TSVoidKeyword; +} +export interface UpdateExpression extends UnaryExpressionBase { + type: AST_NODE_TYPES.UpdateExpression; + operator: '++' | '--'; +} +export interface UnaryExpression extends UnaryExpressionBase { + type: AST_NODE_TYPES.UnaryExpression; + operator: '+' | '-' | '!' | '~' | 'delete' | 'void' | 'typeof'; +} +export interface VariableDeclaration extends BaseNode { + type: AST_NODE_TYPES.VariableDeclaration; + declarations: VariableDeclarator[]; + kind: 'let' | 'const' | 'var'; + declare?: boolean; +} +export interface VariableDeclarator extends BaseNode { + type: AST_NODE_TYPES.VariableDeclarator; + id: BindingName; + init: Expression | null; + definite?: boolean; +} +export interface WhileStatement extends BaseNode { + type: AST_NODE_TYPES.WhileStatement; + test: Expression; + body: Statement; +} +export interface WithStatement extends BaseNode { + type: AST_NODE_TYPES.WithStatement; + object: Expression; + body: Statement; +} +export interface YieldExpression extends BaseNode { + type: AST_NODE_TYPES.YieldExpression; + delegate: boolean; + argument?: Expression; +} +export {}; +//# sourceMappingURL=ts-estree.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/ts-estree.d.ts.map b/node_modules/@typescript-eslint/types/dist/ts-estree.d.ts.map new file mode 100644 index 000000000..16b0634ab --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/ts-estree.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ts-estree.d.ts","sourceRoot":"","sources":["../src/ts-estree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,KAAK,EAAE,iBAAiB,CAAC;IACzB;;OAEG;IACH,GAAG,EAAE,iBAAiB,CAAC;CACxB;AACD,oBAAY,KAAK,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAErC,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,GAAG,EAAE,cAAc,CAAC;IACpB;;;;OAIG;IACH,KAAK,EAAE,KAAK,CAAC;IACb;;OAEG;IACH,MAAM,CAAC,EAAE,IAAI,CAAC;CAOf;AASD,UAAU,SAAU,SAAQ,QAAQ;IAClC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC7C,IAAI,EA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Ac,CAAC;IACpC,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,aAAc,SAAQ,QAAQ;IAC7C,IAAI,EAAE,cAAc,CAAC,aAAa,CAAC;IACnC,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,IAAI,EAAE,cAAc,CAAC,eAAe,CAAC;IACrC,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,UAAU,CAAC;CACvB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/ts-estree.js b/node_modules/@typescript-eslint/types/dist/ts-estree.js new file mode 100644 index 000000000..47f7a01f1 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/ts-estree.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=ts-estree.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/dist/ts-estree.js.map b/node_modules/@typescript-eslint/types/dist/ts-estree.js.map new file mode 100644 index 000000000..c41387a13 --- /dev/null +++ b/node_modules/@typescript-eslint/types/dist/ts-estree.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ts-estree.js","sourceRoot":"","sources":["../src/ts-estree.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/types/package.json b/node_modules/@typescript-eslint/types/package.json new file mode 100644 index 000000000..2e42e476a --- /dev/null +++ b/node_modules/@typescript-eslint/types/package.json @@ -0,0 +1,52 @@ +{ + "name": "@typescript-eslint/types", + "version": "4.1.0", + "description": "Types for the TypeScript-ESTree AST spec", + "keywords": [ + "eslint", + "typescript", + "estree" + ], + "engines": { + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + }, + "files": [ + "dist", + "package.json", + "README.md", + "LICENSE" + ], + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/visitor-keys" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "license": "MIT", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsc -b tsconfig.build.json", + "postbuild": "downlevel-dts dist _ts3.4/dist", + "clean": "tsc -b tsconfig.build.json --clean", + "postclean": "rimraf dist", + "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", + "generate:lib": "../../node_modules/.bin/ts-node --files --transpile-only ../scope-manager/tools/generate-lib.ts", + "lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'", + "typecheck": "tsc -p tsconfig.json --noEmit" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "typesVersions": { + "<3.8": { + "*": [ + "_ts3.4/*" + ] + } + }, + "gitHead": "00a24706222254774121ee62038e67d0efa993e7" +} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/CHANGELOG.md b/node_modules/@typescript-eslint/typescript-estree/CHANGELOG.md new file mode 100644 index 000000000..284d90a3f --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/CHANGELOG.md @@ -0,0 +1,925 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) + +**Note:** Version bump only for package @typescript-eslint/typescript-estree + + + + + +## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) + +**Note:** Version bump only for package @typescript-eslint/typescript-estree + + + + + +# [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) + + +### Bug Fixes + +* correct decorator traversal for AssignmentPattern ([#2375](https://github.com/typescript-eslint/typescript-eslint/issues/2375)) ([d738fa4](https://github.com/typescript-eslint/typescript-eslint/commit/d738fa4eff0a5c4cfc9b30b1c0502f8d1e78d7b6)) +* **typescript-estree:** correct ChainExpression interaction with parentheses and non-nulls ([#2380](https://github.com/typescript-eslint/typescript-eslint/issues/2380)) ([762bc99](https://github.com/typescript-eslint/typescript-eslint/commit/762bc99584ede4d0b8099a743991e957aec86aa8)) + + +### Features + +* support ESTree optional chaining representation ([#2308](https://github.com/typescript-eslint/typescript-eslint/issues/2308)) ([e9d2ab6](https://github.com/typescript-eslint/typescript-eslint/commit/e9d2ab638b6767700b52797e74b814ea059beaae)) +* **typescript-estree:** switch to globby ([#2418](https://github.com/typescript-eslint/typescript-eslint/issues/2418)) ([3a7ec9b](https://github.com/typescript-eslint/typescript-eslint/commit/3a7ec9bcf1873a99c6da2f19ade8ab4763b4793c)), closes [#2398](https://github.com/typescript-eslint/typescript-eslint/issues/2398) + + +### BREAKING CHANGES + +* **typescript-estree:** - removes the ability to supply a `RegExp` to `projectFolderIgnoreList`, and changes the meaning of the string value from a regex to a glob. +* - Removed decorators property from several Nodes that could never semantically have them (FunctionDeclaration, TSEnumDeclaration, and TSInterfaceDeclaration) +- Removed AST_NODE_TYPES.Import. This is a minor breaking change as the node type that used this was removed ages ago. + + + + + +## [3.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.0...v3.10.1) (2020-08-25) + +**Note:** Version bump only for package @typescript-eslint/typescript-estree + + + + + +# [3.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.1...v3.10.0) (2020-08-24) + + +### Bug Fixes + +* **typescript-estree:** ts.NamedTupleMember workaround for =3.2.1 <3.6.0 ([#597](https://github.com/typescript-eslint/typescript-eslint/issues/597)) ([5d2b962](https://github.com/typescript-eslint/typescript-eslint/commit/5d2b962)) + +# [1.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.8.0...v1.9.0) (2019-05-12) + +**Note:** Version bump only for package @typescript-eslint/typescript-estree + +# [1.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.7.0...v1.8.0) (2019-05-10) + +### Bug Fixes + +- **eslint-plugin:** [array-type] support readonly operator ([#429](https://github.com/typescript-eslint/typescript-eslint/issues/429)) ([8e2d2f5](https://github.com/typescript-eslint/typescript-eslint/commit/8e2d2f5)) +- **eslint-plugin:** Support more nodes [no-extra-parens](<[#465](https://github.com/typescript-eslint/typescript-eslint/issues/465)>) ([2d15644](https://github.com/typescript-eslint/typescript-eslint/commit/2d15644)) +- **typescript-estree:** ensure parents are defined during subsequent parses ([#500](https://github.com/typescript-eslint/typescript-eslint/issues/500)) ([665278f](https://github.com/typescript-eslint/typescript-eslint/commit/665278f)) + +### Features + +- **eslint-plugin:** (EXPERIMENTAL) begin indent rewrite ([#439](https://github.com/typescript-eslint/typescript-eslint/issues/439)) ([6eb97d4](https://github.com/typescript-eslint/typescript-eslint/commit/6eb97d4)) +- **eslint-plugin:** no-inferrable-types: Support more primitives ([#442](https://github.com/typescript-eslint/typescript-eslint/issues/442)) ([4e193ca](https://github.com/typescript-eslint/typescript-eslint/commit/4e193ca)) +- **ts-estree:** add preserveNodeMaps option ([#494](https://github.com/typescript-eslint/typescript-eslint/issues/494)) ([c3061f9](https://github.com/typescript-eslint/typescript-eslint/commit/c3061f9)) +- Move shared types into their own package ([#425](https://github.com/typescript-eslint/typescript-eslint/issues/425)) ([a7a03ce](https://github.com/typescript-eslint/typescript-eslint/commit/a7a03ce)) + +# [1.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.6.0...v1.7.0) (2019-04-20) + +### Features + +- **eslint-plugin:** support type assertions in no-extra-parens rule ([#311](https://github.com/typescript-eslint/typescript-eslint/issues/311)) ([116ca75](https://github.com/typescript-eslint/typescript-eslint/commit/116ca75)) + +# [1.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.5.0...v1.6.0) (2019-04-03) + +### Bug Fixes + +- **typescript-estree:** add ExportDefaultDeclaration to union DeclarationStatement ([#378](https://github.com/typescript-eslint/typescript-eslint/issues/378)) ([bf04398](https://github.com/typescript-eslint/typescript-eslint/commit/bf04398)) + +### Features + +- change TypeScript version range to >=3.2.1 <3.5.0 ([#399](https://github.com/typescript-eslint/typescript-eslint/issues/399)) ([a4f95d3](https://github.com/typescript-eslint/typescript-eslint/commit/a4f95d3)) + +# [1.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.2...v1.5.0) (2019-03-20) + +### Bug Fixes + +- **eslint-plugin:** fix false positives for adjacent-overload-signatures regarding computed property names ([#340](https://github.com/typescript-eslint/typescript-eslint/issues/340)) ([f6e5118](https://github.com/typescript-eslint/typescript-eslint/commit/f6e5118)) +- **typescript-estree:** only call watch callback on new files ([#367](https://github.com/typescript-eslint/typescript-eslint/issues/367)) ([0ef07c4](https://github.com/typescript-eslint/typescript-eslint/commit/0ef07c4)) + +## [1.4.2](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.1...v1.4.2) (2019-02-25) + +**Note:** Version bump only for package @typescript-eslint/typescript-estree + +## [1.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.0...v1.4.1) (2019-02-23) + +**Note:** Version bump only for package @typescript-eslint/typescript-estree + +# [1.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.3.0...v1.4.0) (2019-02-19) + +### Bug Fixes + +- **ts-estree:** make sure that every node can be converted to tsNode ([#287](https://github.com/typescript-eslint/typescript-eslint/issues/287)) ([9f1d314](https://github.com/typescript-eslint/typescript-eslint/commit/9f1d314)) +- **typescript-estree, eslint-plugin:** stop adding ParenthesizedExpressions to node maps ([#226](https://github.com/typescript-eslint/typescript-eslint/issues/226)) ([317405a](https://github.com/typescript-eslint/typescript-eslint/commit/317405a)) + +### Features + +- **eslint-plugin:** add 'no-unnecessary-qualifier' rule ([#231](https://github.com/typescript-eslint/typescript-eslint/issues/231)) ([cc8f906](https://github.com/typescript-eslint/typescript-eslint/commit/cc8f906)) +- **eslint-plugin:** Migrate plugin to ts ([#120](https://github.com/typescript-eslint/typescript-eslint/issues/120)) ([61c60dc](https://github.com/typescript-eslint/typescript-eslint/commit/61c60dc)) +- **ts-estree:** fix parsing nested sequence expressions ([#286](https://github.com/typescript-eslint/typescript-eslint/issues/286)) ([ecc9631](https://github.com/typescript-eslint/typescript-eslint/commit/ecc9631)) + +# [1.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.2.0...v1.3.0) (2019-02-07) + +### Bug Fixes + +- **ts-estree:** align typeArguments and typeParameters across nodes ([#223](https://github.com/typescript-eslint/typescript-eslint/issues/223)) ([3306198](https://github.com/typescript-eslint/typescript-eslint/commit/3306198)) +- **ts-estree:** convert decorators on var and fn decs ([#211](https://github.com/typescript-eslint/typescript-eslint/issues/211)) ([0a1777f](https://github.com/typescript-eslint/typescript-eslint/commit/0a1777f)) +- **ts-estree:** fix issues with typeParams in FunctionExpression ([#208](https://github.com/typescript-eslint/typescript-eslint/issues/208)) ([d4dfa3b](https://github.com/typescript-eslint/typescript-eslint/commit/d4dfa3b)) + +### Features + +- change TypeScript version range to >=3.2.1 <3.4.0 ([#184](https://github.com/typescript-eslint/typescript-eslint/issues/184)) ([f513a14](https://github.com/typescript-eslint/typescript-eslint/commit/f513a14)) +- **ts-estree:** enable errors 1098 and 1099 ([#219](https://github.com/typescript-eslint/typescript-eslint/issues/219)) ([fc50167](https://github.com/typescript-eslint/typescript-eslint/commit/fc50167)) + +# [1.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.1.1...v1.2.0) (2019-02-01) + +**Note:** Version bump only for package @typescript-eslint/typescript-estree + +## [1.1.1](https://github.com/typescript-eslint/typescript-eslint/compare/v1.1.0...v1.1.1) (2019-01-29) + +### Bug Fixes + +- **parser:** add visiting of type parameters in JSXOpeningElement ([#150](https://github.com/typescript-eslint/typescript-eslint/issues/150)) ([5e16003](https://github.com/typescript-eslint/typescript-eslint/commit/5e16003)) +- **ts-estree:** expand optional property to include question token ([#138](https://github.com/typescript-eslint/typescript-eslint/issues/138)) ([9068b62](https://github.com/typescript-eslint/typescript-eslint/commit/9068b62)) + +### Performance Improvements + +- **ts-estree:** don't create Program in parse() ([#148](https://github.com/typescript-eslint/typescript-eslint/issues/148)) ([aacf5b0](https://github.com/typescript-eslint/typescript-eslint/commit/aacf5b0)) + +# [1.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.0.0...v1.1.0) (2019-01-23) + +### Bug Fixes + +- **typescript-estree:** correct range of parameters with comments ([#128](https://github.com/typescript-eslint/typescript-eslint/issues/128)) ([91eedf2](https://github.com/typescript-eslint/typescript-eslint/commit/91eedf2)) +- **typescript-estree:** fix range of assignment in parameter ([#115](https://github.com/typescript-eslint/typescript-eslint/issues/115)) ([4e781f1](https://github.com/typescript-eslint/typescript-eslint/commit/4e781f1)) + +# [1.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v0.2.1...v1.0.0) (2019-01-20) + +### Features + +- **parser:** support ecmaFeatures.jsx flag and tests ([#85](https://github.com/typescript-eslint/typescript-eslint/issues/85)) ([b321736](https://github.com/typescript-eslint/typescript-eslint/commit/b321736)) + +## [0.2.1](https://github.com/typescript-eslint/typescript-eslint/compare/v0.2.0...v0.2.1) (2019-01-20) + +**Note:** Version bump only for package @typescript-eslint/typescript-estree diff --git a/node_modules/@typescript-eslint/typescript-estree/LICENSE b/node_modules/@typescript-eslint/typescript-estree/LICENSE new file mode 100644 index 000000000..fda3b7546 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/LICENSE @@ -0,0 +1,26 @@ +TypeScript ESTree + +Originally extracted from: + +TypeScript ESLint Parser +Copyright JS Foundation and other contributors, https://js.foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/@typescript-eslint/typescript-estree/README.md b/node_modules/@typescript-eslint/typescript-estree/README.md new file mode 100644 index 000000000..3a434c784 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/README.md @@ -0,0 +1,287 @@ +

TypeScript ESTree

+ +

A parser that converts TypeScript source code into an ESTree-compatible form

+ +

+ CI + NPM Version + NPM Downloads +

+ +## Getting Started + +**[You can find our Getting Started docs here](../../docs/getting-started/linting/README.md)** + +## About + +This parser is somewhat generic and robust, and could be used to power any use-case which requires taking TypeScript source code and producing an ESTree-compatible AST. + +In fact, it is already used within these hyper-popular open-source projects to power their TypeScript support: + +- [ESLint](https://eslint.org), the pluggable linting utility for JavaScript and JSX +- [Prettier](https://prettier.io), an opinionated code formatter + +## Installation + +```sh +yarn add -D @typescript-eslint/typescript-estree +``` + +## API + +### Parsing + +#### `parse(code, options)` + +Parses the given string of code with the options provided and returns an ESTree-compatible AST. + +```ts +interface ParseOptions { + /** + * create a top-level comments array containing all comments + */ + comment?: boolean; + + /** + * An array of modules to turn explicit debugging on for. + * - 'typescript-eslint' is the same as setting the env var `DEBUG=typescript-eslint:*` + * - 'eslint' is the same as setting the env var `DEBUG=eslint:*` + * - 'typescript' is the same as setting `extendedDiagnostics: true` in your tsconfig compilerOptions + * + * For convenience, also supports a boolean: + * - true === ['typescript-eslint'] + * - false === [] + */ + debugLevel?: boolean | ('typescript-eslint' | 'eslint' | 'typescript')[]; + + /** + * Cause the parser to error if it encounters an unknown AST node type (useful for testing). + * This case only usually occurs when TypeScript releases new features. + */ + errorOnUnknownASTType?: boolean; + + /** + * Absolute (or relative to `cwd`) path to the file being parsed. + */ + filePath?: string; + + /** + * Enable parsing of JSX. + * For more details, see https://www.typescriptlang.org/docs/handbook/jsx.html + * + * NOTE: this setting does not effect known file types (.js, .jsx, .ts, .tsx, .json) because the + * TypeScript compiler has its own internal handling for known file extensions. + * + * For the exact behavior, see https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#parseroptionsecmafeaturesjsx + */ + jsx?: boolean; + + /** + * Controls whether the `loc` information to each node. + * The `loc` property is an object which contains the exact line/column the node starts/ends on. + * This is similar to the `range` property, except it is line/column relative. + */ + loc?: boolean; + + /* + * Allows overriding of function used for logging. + * When value is `false`, no logging will occur. + * When value is not provided, `console.log()` will be used. + */ + loggerFn?: Function | false; + + /** + * Controls whether the `range` property is included on AST nodes. + * The `range` property is a [number, number] which indicates the start/end index of the node in the file contents. + * This is similar to the `loc` property, except this is the absolute index. + */ + range?: boolean; + + /** + * Set to true to create a top-level array containing all tokens from the file. + */ + tokens?: boolean; + + /* + * The JSX AST changed the node type for string literals + * inside a JSX Element from `Literal` to `JSXText`. + * When value is `true`, these nodes will be parsed as type `JSXText`. + * When value is `false`, these nodes will be parsed as type `Literal`. + */ + useJSXTextNode?: boolean; +} + +const PARSE_DEFAULT_OPTIONS: ParseOptions = { + comment: false, + errorOnUnknownASTType: false, + filePath: 'estree.ts', // or 'estree.tsx', if you pass jsx: true + jsx: false, + loc: false, + loggerFn: undefined, + range: false, + tokens: false, + useJSXTextNode: false, +}; + +declare function parse( + code: string, + options: ParseOptions = PARSE_DEFAULT_OPTIONS, +): TSESTree.Program; +``` + +Example usage: + +```js +import { parse } from '@typescript-eslint/typescript-estree'; + +const code = `const hello: string = 'world';`; +const ast = parse(code, { + loc: true, + range: true, +}); +``` + +#### `parseAndGenerateServices(code, options)` + +Parses the given string of code with the options provided and returns an ESTree-compatible AST. Accepts additional options which can be used to generate type information along with the AST. + +```ts +interface ParseAndGenerateServicesOptions extends ParseOptions { + /** + * Causes the parser to error if the TypeScript compiler returns any unexpected syntax/semantic errors. + */ + errorOnTypeScriptSyntacticAndSemanticIssues?: boolean; + + /** + * When `project` is provided, this controls the non-standard file extensions which will be parsed. + * It accepts an array of file extensions, each preceded by a `.`. + */ + extraFileExtensions?: string[]; + + /** + * Absolute (or relative to `tsconfigRootDir`) path to the file being parsed. + * When `project` is provided, this is required, as it is used to fetch the file from the TypeScript compiler's cache. + */ + filePath?: string; + + /** + * Allows the user to control whether or not two-way AST node maps are preserved + * during the AST conversion process. + * + * By default: the AST node maps are NOT preserved, unless `project` has been specified, + * in which case the maps are made available on the returned `parserServices`. + * + * NOTE: If `preserveNodeMaps` is explicitly set by the user, it will be respected, + * regardless of whether or not `project` is in use. + */ + preserveNodeMaps?: boolean; + + /** + * Absolute (or relative to `tsconfigRootDir`) paths to the tsconfig(s). + * If this is provided, type information will be returned. + */ + project?: string | string[]; + + /** + * If you provide a glob (or globs) to the project option, you can use this option to ignore certain folders from + * being matched by the globs. + * This accepts an array of globs to ignore. + * + * By default, this is set to ["/node_modules/"] + */ + projectFolderIgnoreList?: string[]; + + /** + * The absolute path to the root directory for all provided `project`s. + */ + tsconfigRootDir?: string; + + /** + *************************************************************************************** + * IT IS RECOMMENDED THAT YOU DO NOT USE THIS OPTION, AS IT CAUSES PERFORMANCE ISSUES. * + *************************************************************************************** + * + * When passed with `project`, this allows the parser to create a catch-all, default program. + * This means that if the parser encounters a file not included in any of the provided `project`s, + * it will not error, but will instead parse the file and its dependencies in a new program. + */ + createDefaultProgram?: boolean; +} + +const PARSE_AND_GENERATE_SERVICES_DEFAULT_OPTIONS: ParseOptions = { + ...PARSE_DEFAULT_OPTIONS, + errorOnTypeScriptSyntacticAndSemanticIssues: false, + extraFileExtensions: [], + preserveNodeMaps: false, // or true, if you do not set this, but pass `project` + project: undefined, + projectFolderIgnoreList: ['/node_modules/'], + tsconfigRootDir: process.cwd(), +}; + +declare function parseAndGenerateServices( + code: string, + options: ParseOptions = PARSE_DEFAULT_OPTIONS, +): TSESTree.Program; +``` + +Example usage: + +```js +import { parseAndGenerateServices } from '@typescript-eslint/typescript-estree'; + +const code = `const hello: string = 'world';`; +const ast = parseAndGenerateServices(code, { + filePath: '/some/path/to/file/foo.ts', + loc: true, + project: './tsconfig.json', + range: true, +}); +``` + +### `TSESTree`, `AST_NODE_TYPES` and `AST_TOKEN_TYPES` + +Types for the AST produced by the parse functions. + +- `TSESTree` is a namespace which contains object types representing all of the AST Nodes produced by the parser. +- `AST_NODE_TYPES` is an enum which provides the values for every single AST node's `type` property. +- `AST_TOKEN_TYPES` is an enum which provides the values for every single AST token's `type` property. + +## Supported TypeScript Version + +See the [Supported TypeScript Version](../../README.md#supported-typescript-version) section in the project root. + +If you use a non-supported version of TypeScript, the parser will log a warning to the console. + +**Please ensure that you are using a supported version before submitting any issues/bug reports.** + +## Reporting Issues + +Please check the current list of open and known issues and ensure the issue has not been reported before. When creating a new issue provide as much information about your environment as possible. This includes: + +- TypeScript version +- The `typescript-estree` version + +## AST Alignment Tests + +A couple of years after work on this parser began, the TypeScript Team at Microsoft began [officially supporting TypeScript parsing via Babel](https://blogs.msdn.microsoft.com/typescript/2018/08/27/typescript-and-babel-7/). + +I work closely with the TypeScript Team and we are gradually aligning the AST of this project with the one produced by Babel's parser. To that end, I have created a full test harness to compare the ASTs of the two projects which runs on every PR, please see the code for more details. + +## Build/Test Commands + +- `npm test` - run all tests +- `npm run unit-tests` - run only unit tests +- `npm run ast-alignment-tests` - run only Babylon AST alignment tests + +## Debugging + +If you encounter a bug with the parser that you want to investigate, you can turn on the debug logging via setting the environment variable: `DEBUG=typescript-eslint:*`. +I.e. in this repo you can run: `DEBUG=typescript-eslint:* yarn lint`. + +## License + +TypeScript ESTree inherits from the the original TypeScript ESLint Parser license, as the majority of the work began there. It is licensed under a permissive BSD 2-clause license. + +## Contributing + +[See the contributing guide here](../../CONTRIBUTING.md) diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.d.ts b/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.d.ts new file mode 100644 index 000000000..61bc2f1be --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.d.ts @@ -0,0 +1,9 @@ +import { SourceFile } from 'typescript'; +import { ASTMaps } from './convert'; +import { Extra } from './parser-options'; +import { TSESTree } from './ts-estree'; +export declare function astConverter(ast: SourceFile, extra: Extra, shouldPreserveNodeMaps: boolean): { + estree: TSESTree.Program; + astMaps: ASTMaps; +}; +//# sourceMappingURL=ast-converter.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.d.ts.map new file mode 100644 index 000000000..df6276c5a --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ast-converter.d.ts","sourceRoot":"","sources":["../src/ast-converter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAA2B,OAAO,EAAE,MAAM,WAAW,CAAC;AAG7D,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,wBAAgB,YAAY,CAC1B,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,KAAK,EACZ,sBAAsB,EAAE,OAAO,GAC9B;IAAE,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CA4DhD"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.js b/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.js new file mode 100644 index 000000000..6af960ee3 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.js @@ -0,0 +1,63 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.astConverter = void 0; +const convert_1 = require("./convert"); +const convert_comments_1 = require("./convert-comments"); +const node_utils_1 = require("./node-utils"); +const simple_traverse_1 = require("./simple-traverse"); +function astConverter(ast, extra, shouldPreserveNodeMaps) { + /** + * The TypeScript compiler produced fundamental parse errors when parsing the + * source. + */ + // internal typescript api... + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const parseDiagnostics = ast.parseDiagnostics; + if (parseDiagnostics.length) { + throw convert_1.convertError(parseDiagnostics[0]); + } + /** + * Recursively convert the TypeScript AST into an ESTree-compatible AST + */ + const instance = new convert_1.Converter(ast, { + errorOnUnknownASTType: extra.errorOnUnknownASTType || false, + useJSXTextNode: extra.useJSXTextNode || false, + shouldPreserveNodeMaps, + }); + const estree = instance.convertProgram(); + /** + * Optionally remove range and loc if specified + */ + if (!extra.range || !extra.loc) { + simple_traverse_1.simpleTraverse(estree, { + enter: node => { + if (!extra.range) { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- TS 4.0 made this an error because the types aren't optional + // @ts-expect-error + delete node.range; + } + if (!extra.loc) { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- TS 4.0 made this an error because the types aren't optional + // @ts-expect-error + delete node.loc; + } + }, + }); + } + /** + * Optionally convert and include all tokens in the AST + */ + if (extra.tokens) { + estree.tokens = node_utils_1.convertTokens(ast); + } + /** + * Optionally convert and include all comments in the AST + */ + if (extra.comment) { + estree.comments = convert_comments_1.convertComments(ast, extra.code); + } + const astMaps = instance.getASTMaps(); + return { estree, astMaps }; +} +exports.astConverter = astConverter; +//# sourceMappingURL=ast-converter.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.js.map b/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.js.map new file mode 100644 index 000000000..6a5b21558 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ast-converter.js","sourceRoot":"","sources":["../src/ast-converter.ts"],"names":[],"mappings":";;;AACA,uCAA6D;AAC7D,yDAAqD;AACrD,6CAA6C;AAG7C,uDAAmD;AAEnD,SAAgB,YAAY,CAC1B,GAAe,EACf,KAAY,EACZ,sBAA+B;IAE/B;;;OAGG;IACH,6BAA6B;IAC7B,8DAA8D;IAC9D,MAAM,gBAAgB,GAAI,GAAW,CAAC,gBAAgB,CAAC;IACvD,IAAI,gBAAgB,CAAC,MAAM,EAAE;QAC3B,MAAM,sBAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;KACzC;IAED;;OAEG;IACH,MAAM,QAAQ,GAAG,IAAI,mBAAS,CAAC,GAAG,EAAE;QAClC,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,IAAI,KAAK;QAC3D,cAAc,EAAE,KAAK,CAAC,cAAc,IAAI,KAAK;QAC7C,sBAAsB;KACvB,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC;IAEzC;;OAEG;IACH,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;QAC9B,gCAAc,CAAC,MAAM,EAAE;YACrB,KAAK,EAAE,IAAI,CAAC,EAAE;gBACZ,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;oBAChB,4HAA4H;oBAC5H,mBAAmB;oBACnB,OAAO,IAAI,CAAC,KAAK,CAAC;iBACnB;gBACD,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;oBACd,4HAA4H;oBAC5H,mBAAmB;oBACnB,OAAO,IAAI,CAAC,GAAG,CAAC;iBACjB;YACH,CAAC;SACF,CAAC,CAAC;KACJ;IAED;;OAEG;IACH,IAAI,KAAK,CAAC,MAAM,EAAE;QAChB,MAAM,CAAC,MAAM,GAAG,0BAAa,CAAC,GAAG,CAAC,CAAC;KACpC;IAED;;OAEG;IACH,IAAI,KAAK,CAAC,OAAO,EAAE;QACjB,MAAM,CAAC,QAAQ,GAAG,kCAAe,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;KACpD;IAED,MAAM,OAAO,GAAG,QAAQ,CAAC,UAAU,EAAE,CAAC;IAEtC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAC7B,CAAC;AAhED,oCAgEC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.d.ts b/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.d.ts new file mode 100644 index 000000000..3f081e699 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.d.ts @@ -0,0 +1,11 @@ +import * as ts from 'typescript'; +import { TSESTree } from './ts-estree'; +/** + * Convert all comments for the given AST. + * @param ast the AST object + * @param code the TypeScript code + * @returns the converted ESTreeComment + * @private + */ +export declare function convertComments(ast: ts.SourceFile, code: string): TSESTree.Comment[]; +//# sourceMappingURL=convert-comments.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.d.ts.map new file mode 100644 index 000000000..e3e8a043b --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"convert-comments.d.ts","sourceRoot":"","sources":["../src/convert-comments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAGjC,OAAO,EAAmB,QAAQ,EAAE,MAAM,aAAa,CAAC;AAExD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,EAAE,CAAC,UAAU,EAClB,IAAI,EAAE,MAAM,GACX,QAAQ,CAAC,OAAO,EAAE,CAgCpB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js b/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js new file mode 100644 index 000000000..de4a735a6 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js @@ -0,0 +1,59 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.convertComments = void 0; +const ts = __importStar(require("typescript")); +const util_1 = require("tsutils/util/util"); +const node_utils_1 = require("./node-utils"); +const ts_estree_1 = require("./ts-estree"); +/** + * Convert all comments for the given AST. + * @param ast the AST object + * @param code the TypeScript code + * @returns the converted ESTreeComment + * @private + */ +function convertComments(ast, code) { + const comments = []; + util_1.forEachComment(ast, (_, comment) => { + const type = comment.kind == ts.SyntaxKind.SingleLineCommentTrivia + ? ts_estree_1.AST_TOKEN_TYPES.Line + : ts_estree_1.AST_TOKEN_TYPES.Block; + const range = [comment.pos, comment.end]; + const loc = node_utils_1.getLocFor(range[0], range[1], ast); + // both comments start with 2 characters - /* or // + const textStart = range[0] + 2; + const textEnd = comment.kind === ts.SyntaxKind.SingleLineCommentTrivia + ? // single line comments end at the end + range[1] - textStart + : // multiline comments end 2 characters early + range[1] - textStart - 2; + comments.push({ + type, + value: code.substr(textStart, textEnd), + range, + loc, + }); + }, ast); + return comments; +} +exports.convertComments = convertComments; +//# sourceMappingURL=convert-comments.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js.map b/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js.map new file mode 100644 index 000000000..6952a5893 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js.map @@ -0,0 +1 @@ +{"version":3,"file":"convert-comments.js","sourceRoot":"","sources":["../src/convert-comments.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,4CAAmD;AACnD,6CAAyC;AACzC,2CAAwD;AAExD;;;;;;GAMG;AACH,SAAgB,eAAe,CAC7B,GAAkB,EAClB,IAAY;IAEZ,MAAM,QAAQ,GAAuB,EAAE,CAAC;IAExC,qBAAc,CACZ,GAAG,EACH,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE;QACb,MAAM,IAAI,GACR,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,UAAU,CAAC,uBAAuB;YACnD,CAAC,CAAC,2BAAe,CAAC,IAAI;YACtB,CAAC,CAAC,2BAAe,CAAC,KAAK,CAAC;QAC5B,MAAM,KAAK,GAAmB,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;QACzD,MAAM,GAAG,GAAG,sBAAS,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAE/C,mDAAmD;QACnD,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,OAAO,GACX,OAAO,CAAC,IAAI,KAAK,EAAE,CAAC,UAAU,CAAC,uBAAuB;YACpD,CAAC,CAAC,sCAAsC;gBACtC,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS;YACtB,CAAC,CAAC,4CAA4C;gBAC5C,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,CAAC,CAAC;QAC/B,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI;YACJ,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC;YACtC,KAAK;YACL,GAAG;SACJ,CAAC,CAAC;IACL,CAAC,EACD,GAAG,CACJ,CAAC;IAEF,OAAO,QAAQ,CAAC;AAClB,CAAC;AAnCD,0CAmCC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts b/node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts new file mode 100644 index 000000000..c065e15d0 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts @@ -0,0 +1,152 @@ +import * as ts from 'typescript'; +import { TSError } from './node-utils'; +import { ParserWeakMap, ParserWeakMapESTreeToTSNode } from './parser-options'; +import { TSESTree, TSNode } from './ts-estree'; +interface ConverterOptions { + errorOnUnknownASTType: boolean; + useJSXTextNode: boolean; + shouldPreserveNodeMaps: boolean; +} +/** + * Extends and formats a given error object + * @param error the error object + * @returns converted error object + */ +export declare function convertError(error: any): TSError; +export interface ASTMaps { + esTreeNodeToTSNodeMap: ParserWeakMapESTreeToTSNode; + tsNodeToESTreeNodeMap: ParserWeakMap; +} +export declare class Converter { + private readonly ast; + private readonly options; + private readonly esTreeNodeToTSNodeMap; + private readonly tsNodeToESTreeNodeMap; + private allowPattern; + private inTypeMode; + /** + * Converts a TypeScript node into an ESTree node + * @param ast the full TypeScript AST + * @param options additional options for the conversion + * @returns the converted ESTreeNode + */ + constructor(ast: ts.SourceFile, options: ConverterOptions); + getASTMaps(): ASTMaps; + convertProgram(): TSESTree.Program; + /** + * Converts a TypeScript node into an ESTree node. + * @param node the child ts.Node + * @param parent parentNode + * @param inTypeMode flag to determine if we are in typeMode + * @param allowPattern flag to determine if patterns are allowed + * @returns the converted ESTree node + */ + private converter; + /** + * Fixes the exports of the given ts.Node + * @param node the ts.Node + * @param result result + * @returns the ESTreeNode with fixed exports + */ + private fixExports; + /** + * Register specific TypeScript node into map with first ESTree node provided + */ + private registerTSNodeInNodeMap; + /** + * Converts a TypeScript node into an ESTree node. + * @param child the child ts.Node + * @param parent parentNode + * @returns the converted ESTree node + */ + private convertPattern; + /** + * Converts a TypeScript node into an ESTree node. + * @param child the child ts.Node + * @param parent parentNode + * @returns the converted ESTree node + */ + private convertChild; + /** + * Converts a TypeScript node into an ESTree node. + * @param child the child ts.Node + * @param parent parentNode + * @returns the converted ESTree node + */ + private convertType; + private createNode; + private convertBindingNameWithTypeAnnotation; + /** + * Converts a child into a type annotation. This creates an intermediary + * TypeAnnotation node to match what Flow does. + * @param child The TypeScript AST node to convert. + * @param parent parentNode + * @returns The type annotation node. + */ + private convertTypeAnnotation; + /** + * Coverts body Nodes and add a directive field to StringLiterals + * @param nodes of ts.Node + * @param parent parentNode + * @returns Array of body statements + */ + private convertBodyExpressions; + /** + * Converts a ts.Node's typeArguments to TSTypeParameterInstantiation node + * @param typeArguments ts.NodeArray typeArguments + * @param node parent used to create this node + * @returns TypeParameterInstantiation node + */ + private convertTypeArgumentsToTypeParameters; + /** + * Converts a ts.Node's typeParameters to TSTypeParameterDeclaration node + * @param typeParameters ts.Node typeParameters + * @returns TypeParameterDeclaration node + */ + private convertTSTypeParametersToTypeParametersDeclaration; + /** + * Converts an array of ts.Node parameters into an array of ESTreeNode params + * @param parameters An array of ts.Node params to be converted + * @returns an array of converted ESTreeNode params + */ + private convertParameters; + private convertChainExpression; + /** + * For nodes that are copied directly from the TypeScript AST into + * ESTree mostly as-is. The only difference is the addition of a type + * property instead of a kind property. Recursively copies all children. + */ + private deeplyCopy; + /** + * Converts a TypeScript JSX node.tagName into an ESTree node.name + * @param node the tagName object from a JSX ts.Node + * @param parent + * @returns the converted ESTree name object + */ + private convertJSXTagName; + /** + * Applies the given TS modifiers to the given result object. + * @param result + * @param modifiers original ts.Nodes from the node.modifiers array + * @returns the current result object will be mutated + * @deprecated This method adds not standardized `modifiers` property in nodes + */ + private applyModifiersToResult; + /** + * Uses the provided range location to adjust the location data of the given Node + * @param result The node that will have its location data mutated + * @param childRange The child node range used to expand location + */ + private fixParentLocation; + /** + * Converts a TypeScript node into an ESTree node. + * The core of the conversion logic: + * Identify and convert each relevant TypeScript SyntaxKind + * @param node the child ts.Node + * @param parent parentNode + * @returns the converted ESTree node + */ + private convertNode; +} +export {}; +//# sourceMappingURL=convert.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts.map new file mode 100644 index 000000000..c1f6816c1 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../src/convert.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAkBL,OAAO,EAGR,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAEL,QAAQ,EACR,MAAM,EAEP,MAAM,aAAa,CAAC;AAKrB,UAAU,gBAAgB;IACxB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,cAAc,EAAE,OAAO,CAAC;IACxB,sBAAsB,EAAE,OAAO,CAAC;CACjC;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAMhD;AAED,MAAM,WAAW,OAAO;IACtB,qBAAqB,EAAE,2BAA2B,CAAC;IACnD,qBAAqB,EAAE,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;CAC7D;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAgB;IACpC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmB;IAC3C,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAiB;IACvD,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAiB;IAEvD,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,UAAU,CAAS;IAE3B;;;;;OAKG;gBACS,GAAG,EAAE,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,gBAAgB;IAKzD,UAAU,IAAI,OAAO;IAOrB,cAAc,IAAI,QAAQ,CAAC,OAAO;IAIlC;;;;;;;OAOG;IACH,OAAO,CAAC,SAAS;IAkCjB;;;;;OAKG;IACH,OAAO,CAAC,UAAU;IAyDlB;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAW/B;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAItB;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAIpB;;;;;OAKG;IACH,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,UAAU;IAsBlB,OAAO,CAAC,oCAAoC;IAe5C;;;;;;OAMG;IACH,OAAO,CAAC,qBAAqB;IAqB7B;;;;;OAKG;IACH,OAAO,CAAC,sBAAsB;IA8B9B;;;;;OAKG;IACH,OAAO,CAAC,oCAAoC;IAa5C;;;;OAIG;IACH,OAAO,CAAC,kDAAkD;IAe1D;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAkBzB,OAAO,CAAC,sBAAsB;IA4C9B;;;;OAIG;IACH,OAAO,CAAC,UAAU;IAmElB;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IA2CzB;;;;;;OAMG;IACH,OAAO,CAAC,sBAAsB;IAkD9B;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAczB;;;;;;;OAOG;IACH,OAAO,CAAC,WAAW;CA8iEpB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/convert.js b/node_modules/@typescript-eslint/typescript-estree/dist/convert.js new file mode 100644 index 000000000..e45592f53 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/convert.js @@ -0,0 +1,2206 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Converter = exports.convertError = void 0; +// There's lots of funny stuff due to the typing of ts.Node +/* eslint-disable @typescript-eslint/no-explicit-any */ +const ts = __importStar(require("typescript")); +const node_utils_1 = require("./node-utils"); +const ts_estree_1 = require("./ts-estree"); +const version_check_1 = require("./version-check"); +const SyntaxKind = ts.SyntaxKind; +/** + * Extends and formats a given error object + * @param error the error object + * @returns converted error object + */ +function convertError(error) { + return node_utils_1.createError(error.file, error.start, error.message || error.messageText); +} +exports.convertError = convertError; +class Converter { + /** + * Converts a TypeScript node into an ESTree node + * @param ast the full TypeScript AST + * @param options additional options for the conversion + * @returns the converted ESTreeNode + */ + constructor(ast, options) { + this.esTreeNodeToTSNodeMap = new WeakMap(); + this.tsNodeToESTreeNodeMap = new WeakMap(); + this.allowPattern = false; + this.inTypeMode = false; + this.ast = ast; + this.options = Object.assign({}, options); + } + getASTMaps() { + return { + esTreeNodeToTSNodeMap: this.esTreeNodeToTSNodeMap, + tsNodeToESTreeNodeMap: this.tsNodeToESTreeNodeMap, + }; + } + convertProgram() { + return this.converter(this.ast); + } + /** + * Converts a TypeScript node into an ESTree node. + * @param node the child ts.Node + * @param parent parentNode + * @param inTypeMode flag to determine if we are in typeMode + * @param allowPattern flag to determine if patterns are allowed + * @returns the converted ESTree node + */ + converter(node, parent, inTypeMode, allowPattern) { + /** + * Exit early for null and undefined + */ + if (!node) { + return null; + } + const typeMode = this.inTypeMode; + const pattern = this.allowPattern; + if (inTypeMode !== undefined) { + this.inTypeMode = inTypeMode; + } + if (allowPattern !== undefined) { + this.allowPattern = allowPattern; + } + const result = this.convertNode(node, (parent !== null && parent !== void 0 ? parent : node.parent)); + this.registerTSNodeInNodeMap(node, result); + this.inTypeMode = typeMode; + this.allowPattern = pattern; + return result; + } + /** + * Fixes the exports of the given ts.Node + * @param node the ts.Node + * @param result result + * @returns the ESTreeNode with fixed exports + */ + fixExports(node, result) { + // check for exports + if (node.modifiers && node.modifiers[0].kind === SyntaxKind.ExportKeyword) { + /** + * Make sure that original node is registered instead of export + */ + this.registerTSNodeInNodeMap(node, result); + const exportKeyword = node.modifiers[0]; + const nextModifier = node.modifiers[1]; + const declarationIsDefault = nextModifier && nextModifier.kind === SyntaxKind.DefaultKeyword; + const varToken = declarationIsDefault + ? node_utils_1.findNextToken(nextModifier, this.ast, this.ast) + : node_utils_1.findNextToken(exportKeyword, this.ast, this.ast); + result.range[0] = varToken.getStart(this.ast); + result.loc = node_utils_1.getLocFor(result.range[0], result.range[1], this.ast); + if (declarationIsDefault) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ExportDefaultDeclaration, + declaration: result, + range: [exportKeyword.getStart(this.ast), result.range[1]], + exportKind: 'value', + }); + } + else { + const isType = result.type === ts_estree_1.AST_NODE_TYPES.TSInterfaceDeclaration || + result.type === ts_estree_1.AST_NODE_TYPES.TSTypeAliasDeclaration; + const isDeclare = result.declare === true; + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ExportNamedDeclaration, + declaration: result, + specifiers: [], + source: null, + exportKind: isType || isDeclare ? 'type' : 'value', + range: [exportKeyword.getStart(this.ast), result.range[1]], + }); + } + } + return result; + } + /** + * Register specific TypeScript node into map with first ESTree node provided + */ + registerTSNodeInNodeMap(node, result) { + if (result && this.options.shouldPreserveNodeMaps) { + if (!this.tsNodeToESTreeNodeMap.has(node)) { + this.tsNodeToESTreeNodeMap.set(node, result); + } + } + } + /** + * Converts a TypeScript node into an ESTree node. + * @param child the child ts.Node + * @param parent parentNode + * @returns the converted ESTree node + */ + convertPattern(child, parent) { + return this.converter(child, parent, this.inTypeMode, true); + } + /** + * Converts a TypeScript node into an ESTree node. + * @param child the child ts.Node + * @param parent parentNode + * @returns the converted ESTree node + */ + convertChild(child, parent) { + return this.converter(child, parent, this.inTypeMode, false); + } + /** + * Converts a TypeScript node into an ESTree node. + * @param child the child ts.Node + * @param parent parentNode + * @returns the converted ESTree node + */ + convertType(child, parent) { + return this.converter(child, parent, true, false); + } + createNode(node, data) { + const result = data; + if (!result.range) { + result.range = node_utils_1.getRange( + // this is completely valid, but TS hates it + node, this.ast); + } + if (!result.loc) { + result.loc = node_utils_1.getLocFor(result.range[0], result.range[1], this.ast); + } + if (result && this.options.shouldPreserveNodeMaps) { + this.esTreeNodeToTSNodeMap.set(result, node); + } + return result; + } + convertBindingNameWithTypeAnnotation(name, tsType, parent) { + const id = this.convertPattern(name); + if (tsType) { + id.typeAnnotation = this.convertTypeAnnotation(tsType, parent); + this.fixParentLocation(id, id.typeAnnotation.range); + } + return id; + } + /** + * Converts a child into a type annotation. This creates an intermediary + * TypeAnnotation node to match what Flow does. + * @param child The TypeScript AST node to convert. + * @param parent parentNode + * @returns The type annotation node. + */ + convertTypeAnnotation(child, parent) { + // in FunctionType and ConstructorType typeAnnotation has 2 characters `=>` and in other places is just colon + const offset = (parent === null || parent === void 0 ? void 0 : parent.kind) === SyntaxKind.FunctionType || + (parent === null || parent === void 0 ? void 0 : parent.kind) === SyntaxKind.ConstructorType + ? 2 + : 1; + const annotationStartCol = child.getFullStart() - offset; + const loc = node_utils_1.getLocFor(annotationStartCol, child.end, this.ast); + return { + type: ts_estree_1.AST_NODE_TYPES.TSTypeAnnotation, + loc, + range: [annotationStartCol, child.end], + typeAnnotation: this.convertType(child), + }; + } + /** + * Coverts body Nodes and add a directive field to StringLiterals + * @param nodes of ts.Node + * @param parent parentNode + * @returns Array of body statements + */ + convertBodyExpressions(nodes, parent) { + let allowDirectives = node_utils_1.canContainDirective(parent); + return (nodes + .map(statement => { + const child = this.convertChild(statement); + if (allowDirectives) { + if ((child === null || child === void 0 ? void 0 : child.expression) && + ts.isExpressionStatement(statement) && + ts.isStringLiteral(statement.expression)) { + const raw = child.expression.raw; + child.directive = raw.slice(1, -1); + return child; // child can be null, but it's filtered below + } + else { + allowDirectives = false; + } + } + return child; // child can be null, but it's filtered below + }) + // filter out unknown nodes for now + .filter(statement => statement)); + } + /** + * Converts a ts.Node's typeArguments to TSTypeParameterInstantiation node + * @param typeArguments ts.NodeArray typeArguments + * @param node parent used to create this node + * @returns TypeParameterInstantiation node + */ + convertTypeArgumentsToTypeParameters(typeArguments, node) { + const greaterThanToken = node_utils_1.findNextToken(typeArguments, this.ast, this.ast); + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeParameterInstantiation, + range: [typeArguments.pos - 1, greaterThanToken.end], + params: typeArguments.map(typeArgument => this.convertType(typeArgument)), + }); + } + /** + * Converts a ts.Node's typeParameters to TSTypeParameterDeclaration node + * @param typeParameters ts.Node typeParameters + * @returns TypeParameterDeclaration node + */ + convertTSTypeParametersToTypeParametersDeclaration(typeParameters) { + const greaterThanToken = node_utils_1.findNextToken(typeParameters, this.ast, this.ast); + return { + type: ts_estree_1.AST_NODE_TYPES.TSTypeParameterDeclaration, + range: [typeParameters.pos - 1, greaterThanToken.end], + loc: node_utils_1.getLocFor(typeParameters.pos - 1, greaterThanToken.end, this.ast), + params: typeParameters.map(typeParameter => this.convertType(typeParameter)), + }; + } + /** + * Converts an array of ts.Node parameters into an array of ESTreeNode params + * @param parameters An array of ts.Node params to be converted + * @returns an array of converted ESTreeNode params + */ + convertParameters(parameters) { + if (!parameters || !parameters.length) { + return []; + } + return parameters.map(param => { + var _a; + const convertedParam = this.convertChild(param); + if ((_a = param.decorators) === null || _a === void 0 ? void 0 : _a.length) { + convertedParam.decorators = param.decorators.map(el => this.convertChild(el)); + } + return convertedParam; + }); + } + convertChainExpression(node, tsNode) { + const { child, isOptional } = (() => { + if (node.type === ts_estree_1.AST_NODE_TYPES.MemberExpression) { + return { child: node.object, isOptional: node.optional }; + } + if (node.type === ts_estree_1.AST_NODE_TYPES.CallExpression) { + return { child: node.callee, isOptional: node.optional }; + } + return { child: node.expression, isOptional: false }; + })(); + const isChildUnwrappable = node_utils_1.isChildUnwrappableOptionalChain(tsNode, child); + if (!isChildUnwrappable && !isOptional) { + return node; + } + if (isChildUnwrappable && node_utils_1.isChainExpression(child)) { + // unwrap the chain expression child + const newChild = child.expression; + if (node.type === ts_estree_1.AST_NODE_TYPES.MemberExpression) { + node.object = newChild; + } + else if (node.type === ts_estree_1.AST_NODE_TYPES.CallExpression) { + node.callee = newChild; + } + else { + node.expression = newChild; + } + } + return this.createNode(tsNode, { + type: ts_estree_1.AST_NODE_TYPES.ChainExpression, + expression: node, + }); + } + /** + * For nodes that are copied directly from the TypeScript AST into + * ESTree mostly as-is. The only difference is the addition of a type + * property instead of a kind property. Recursively copies all children. + */ + deeplyCopy(node) { + if (node.kind === ts.SyntaxKind.JSDocFunctionType) { + throw node_utils_1.createError(this.ast, node.pos, 'JSDoc types can only be used inside documentation comments.'); + } + const customType = `TS${SyntaxKind[node.kind]}`; + /** + * If the "errorOnUnknownASTType" option is set to true, throw an error, + * otherwise fallback to just including the unknown type as-is. + */ + if (this.options.errorOnUnknownASTType && !ts_estree_1.AST_NODE_TYPES[customType]) { + throw new Error(`Unknown AST_NODE_TYPE: "${customType}"`); + } + const result = this.createNode(node, { + type: customType, + }); + if ('type' in node) { + result.typeAnnotation = + node.type && 'kind' in node.type && ts.isTypeNode(node.type) + ? this.convertTypeAnnotation(node.type, node) + : null; + } + if ('typeArguments' in node) { + result.typeParameters = + node.typeArguments && 'pos' in node.typeArguments + ? this.convertTypeArgumentsToTypeParameters(node.typeArguments, node) + : null; + } + if ('typeParameters' in node) { + result.typeParameters = + node.typeParameters && 'pos' in node.typeParameters + ? this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters) + : null; + } + if ('decorators' in node && node.decorators && node.decorators.length) { + result.decorators = node.decorators.map(el => this.convertChild(el)); + } + Object.entries(node) + .filter(([key]) => !/^(?:_children|kind|parent|pos|end|flags|modifierFlagsCache|jsDoc|type|typeArguments|typeParameters|decorators)$/.test(key)) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + result[key] = value.map(el => this.convertChild(el)); + } + else if (value && typeof value === 'object' && value.kind) { + // need to check node[key].kind to ensure we don't try to convert a symbol + result[key] = this.convertChild(value); + } + else { + result[key] = value; + } + }); + return result; + } + /** + * Converts a TypeScript JSX node.tagName into an ESTree node.name + * @param node the tagName object from a JSX ts.Node + * @param parent + * @returns the converted ESTree name object + */ + convertJSXTagName(node, parent) { + let result; + switch (node.kind) { + case SyntaxKind.PropertyAccessExpression: + if (node.name.kind === SyntaxKind.PrivateIdentifier) { + // This is one of the few times where TS explicitly errors, and doesn't even gracefully handle the syntax. + // So we shouldn't ever get into this state to begin with. + throw new Error('Non-private identifier expected.'); + } + result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXMemberExpression, + object: this.convertJSXTagName(node.expression, parent), + property: this.convertJSXTagName(node.name, parent), + }); + break; + case SyntaxKind.ThisKeyword: + result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier, + name: 'this', + }); + break; + case SyntaxKind.Identifier: + default: + result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier, + name: node.text, + }); + break; + } + this.registerTSNodeInNodeMap(node, result); + return result; + } + /** + * Applies the given TS modifiers to the given result object. + * @param result + * @param modifiers original ts.Nodes from the node.modifiers array + * @returns the current result object will be mutated + * @deprecated This method adds not standardized `modifiers` property in nodes + */ + applyModifiersToResult(result, modifiers) { + if (!modifiers || !modifiers.length) { + return; + } + /** + * Some modifiers are explicitly handled by applying them as + * boolean values on the result node. As well as adding them + * to the result, we remove them from the array, so that they + * are not handled twice. + */ + const handledModifierIndices = {}; + for (let i = 0; i < modifiers.length; i++) { + const modifier = modifiers[i]; + switch (modifier.kind) { + /** + * Ignore ExportKeyword and DefaultKeyword, they are handled + * via the fixExports utility function + */ + case SyntaxKind.ExportKeyword: + case SyntaxKind.DefaultKeyword: + handledModifierIndices[i] = true; + break; + case SyntaxKind.ConstKeyword: + result.const = true; + handledModifierIndices[i] = true; + break; + case SyntaxKind.DeclareKeyword: + result.declare = true; + handledModifierIndices[i] = true; + break; + default: + } + } + /** + * If there are still valid modifiers available which have + * not been explicitly handled above, we just convert and + * add the modifiers array to the result node. + */ + const remainingModifiers = modifiers.filter((_, i) => !handledModifierIndices[i]); + if (!remainingModifiers || !remainingModifiers.length) { + return; + } + result.modifiers = remainingModifiers.map(el => this.convertChild(el)); + } + /** + * Uses the provided range location to adjust the location data of the given Node + * @param result The node that will have its location data mutated + * @param childRange The child node range used to expand location + */ + fixParentLocation(result, childRange) { + if (childRange[0] < result.range[0]) { + result.range[0] = childRange[0]; + result.loc.start = node_utils_1.getLineAndCharacterFor(result.range[0], this.ast); + } + if (childRange[1] > result.range[1]) { + result.range[1] = childRange[1]; + result.loc.end = node_utils_1.getLineAndCharacterFor(result.range[1], this.ast); + } + } + /** + * Converts a TypeScript node into an ESTree node. + * The core of the conversion logic: + * Identify and convert each relevant TypeScript SyntaxKind + * @param node the child ts.Node + * @param parent parentNode + * @returns the converted ESTree node + */ + convertNode(node, parent) { + var _a, _b, _c, _d, _e, _f, _g, _h, _j; + switch (node.kind) { + case SyntaxKind.SourceFile: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Program, + body: this.convertBodyExpressions(node.statements, node), + sourceType: node.externalModuleIndicator ? 'module' : 'script', + range: [node.getStart(this.ast), node.endOfFileToken.end], + }); + } + case SyntaxKind.Block: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.BlockStatement, + body: this.convertBodyExpressions(node.statements, node), + }); + } + case SyntaxKind.Identifier: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Identifier, + name: node.text, + }); + } + case SyntaxKind.WithStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.WithStatement, + object: this.convertChild(node.expression), + body: this.convertChild(node.statement), + }); + // Control Flow + case SyntaxKind.ReturnStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ReturnStatement, + argument: this.convertChild(node.expression), + }); + case SyntaxKind.LabeledStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.LabeledStatement, + label: this.convertChild(node.label), + body: this.convertChild(node.statement), + }); + case SyntaxKind.ContinueStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ContinueStatement, + label: this.convertChild(node.label), + }); + case SyntaxKind.BreakStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.BreakStatement, + label: this.convertChild(node.label), + }); + // Choice + case SyntaxKind.IfStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.IfStatement, + test: this.convertChild(node.expression), + consequent: this.convertChild(node.thenStatement), + alternate: this.convertChild(node.elseStatement), + }); + case SyntaxKind.SwitchStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.SwitchStatement, + discriminant: this.convertChild(node.expression), + cases: node.caseBlock.clauses.map(el => this.convertChild(el)), + }); + case SyntaxKind.CaseClause: + case SyntaxKind.DefaultClause: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.SwitchCase, + // expression is present in case only + test: node.kind === SyntaxKind.CaseClause + ? this.convertChild(node.expression) + : null, + consequent: node.statements.map(el => this.convertChild(el)), + }); + // Exceptions + case SyntaxKind.ThrowStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ThrowStatement, + argument: this.convertChild(node.expression), + }); + case SyntaxKind.TryStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TryStatement, + block: this.convertChild(node.tryBlock), + handler: this.convertChild(node.catchClause), + finalizer: this.convertChild(node.finallyBlock), + }); + case SyntaxKind.CatchClause: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.CatchClause, + param: node.variableDeclaration + ? this.convertBindingNameWithTypeAnnotation(node.variableDeclaration.name, node.variableDeclaration.type) + : null, + body: this.convertChild(node.block), + }); + // Loops + case SyntaxKind.WhileStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.WhileStatement, + test: this.convertChild(node.expression), + body: this.convertChild(node.statement), + }); + /** + * Unlike other parsers, TypeScript calls a "DoWhileStatement" + * a "DoStatement" + */ + case SyntaxKind.DoStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.DoWhileStatement, + test: this.convertChild(node.expression), + body: this.convertChild(node.statement), + }); + case SyntaxKind.ForStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ForStatement, + init: this.convertChild(node.initializer), + test: this.convertChild(node.condition), + update: this.convertChild(node.incrementor), + body: this.convertChild(node.statement), + }); + case SyntaxKind.ForInStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ForInStatement, + left: this.convertPattern(node.initializer), + right: this.convertChild(node.expression), + body: this.convertChild(node.statement), + }); + case SyntaxKind.ForOfStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ForOfStatement, + left: this.convertPattern(node.initializer), + right: this.convertChild(node.expression), + body: this.convertChild(node.statement), + await: Boolean(node.awaitModifier && + node.awaitModifier.kind === SyntaxKind.AwaitKeyword), + }); + // Declarations + case SyntaxKind.FunctionDeclaration: { + const isDeclare = node_utils_1.hasModifier(SyntaxKind.DeclareKeyword, node); + const result = this.createNode(node, { + type: isDeclare || !node.body + ? ts_estree_1.AST_NODE_TYPES.TSDeclareFunction + : ts_estree_1.AST_NODE_TYPES.FunctionDeclaration, + id: this.convertChild(node.name), + generator: !!node.asteriskToken, + expression: false, + async: node_utils_1.hasModifier(SyntaxKind.AsyncKeyword, node), + params: this.convertParameters(node.parameters), + body: this.convertChild(node.body) || undefined, + }); + // Process returnType + if (node.type) { + result.returnType = this.convertTypeAnnotation(node.type, node); + } + if (isDeclare) { + result.declare = true; + } + // Process typeParameters + if (node.typeParameters) { + result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); + } + // check for exports + return this.fixExports(node, result); + } + case SyntaxKind.VariableDeclaration: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.VariableDeclarator, + id: this.convertBindingNameWithTypeAnnotation(node.name, node.type, node), + init: this.convertChild(node.initializer), + }); + if (node.exclamationToken) { + result.definite = true; + } + return result; + } + case SyntaxKind.VariableStatement: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.VariableDeclaration, + declarations: node.declarationList.declarations.map(el => this.convertChild(el)), + kind: node_utils_1.getDeclarationKind(node.declarationList), + }); + /** + * Semantically, decorators are not allowed on variable declarations, + * but the TypeScript compiler will parse them and produce a valid AST, + * so we handle them here too. + */ + if (node.decorators) { + result.decorators = node.decorators.map(el => this.convertChild(el)); + } + if (node_utils_1.hasModifier(SyntaxKind.DeclareKeyword, node)) { + result.declare = true; + } + // check for exports + return this.fixExports(node, result); + } + // mostly for for-of, for-in + case SyntaxKind.VariableDeclarationList: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.VariableDeclaration, + declarations: node.declarations.map(el => this.convertChild(el)), + kind: node_utils_1.getDeclarationKind(node), + }); + // Expressions + case SyntaxKind.ExpressionStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ExpressionStatement, + expression: this.convertChild(node.expression), + }); + case SyntaxKind.ThisKeyword: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ThisExpression, + }); + case SyntaxKind.ArrayLiteralExpression: { + // TypeScript uses ArrayLiteralExpression in destructuring assignment, too + if (this.allowPattern) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ArrayPattern, + elements: node.elements.map(el => this.convertPattern(el)), + }); + } + else { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ArrayExpression, + elements: node.elements.map(el => this.convertChild(el)), + }); + } + } + case SyntaxKind.ObjectLiteralExpression: { + // TypeScript uses ObjectLiteralExpression in destructuring assignment, too + if (this.allowPattern) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ObjectPattern, + properties: node.properties.map(el => this.convertPattern(el)), + }); + } + else { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ObjectExpression, + properties: node.properties.map(el => this.convertChild(el)), + }); + } + } + case SyntaxKind.PropertyAssignment: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Property, + key: this.convertChild(node.name), + value: this.converter(node.initializer, node, this.inTypeMode, this.allowPattern), + computed: node_utils_1.isComputedProperty(node.name), + method: false, + shorthand: false, + kind: 'init', + }); + case SyntaxKind.ShorthandPropertyAssignment: { + if (node.objectAssignmentInitializer) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Property, + key: this.convertChild(node.name), + value: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern, + left: this.convertPattern(node.name), + right: this.convertChild(node.objectAssignmentInitializer), + }), + computed: false, + method: false, + shorthand: true, + kind: 'init', + }); + } + else { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Property, + key: this.convertChild(node.name), + value: this.convertChild(node.name), + computed: false, + method: false, + shorthand: true, + kind: 'init', + }); + } + } + case SyntaxKind.ComputedPropertyName: + return this.convertChild(node.expression); + case SyntaxKind.PropertyDeclaration: { + const isAbstract = node_utils_1.hasModifier(SyntaxKind.AbstractKeyword, node); + const result = this.createNode(node, { + type: isAbstract + ? ts_estree_1.AST_NODE_TYPES.TSAbstractClassProperty + : ts_estree_1.AST_NODE_TYPES.ClassProperty, + key: this.convertChild(node.name), + value: this.convertChild(node.initializer), + computed: node_utils_1.isComputedProperty(node.name), + static: node_utils_1.hasModifier(SyntaxKind.StaticKeyword, node), + readonly: node_utils_1.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, + declare: node_utils_1.hasModifier(SyntaxKind.DeclareKeyword, node), + }); + if (node.type) { + result.typeAnnotation = this.convertTypeAnnotation(node.type, node); + } + if (node.decorators) { + result.decorators = node.decorators.map(el => this.convertChild(el)); + } + const accessibility = node_utils_1.getTSNodeAccessibility(node); + if (accessibility) { + result.accessibility = accessibility; + } + if ((node.name.kind === SyntaxKind.Identifier || + node.name.kind === SyntaxKind.ComputedPropertyName) && + node.questionToken) { + result.optional = true; + } + if (node.exclamationToken) { + result.definite = true; + } + if (result.key.type === ts_estree_1.AST_NODE_TYPES.Literal && node.questionToken) { + result.optional = true; + } + return result; + } + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.MethodDeclaration: { + const method = this.createNode(node, { + type: !node.body + ? ts_estree_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression + : ts_estree_1.AST_NODE_TYPES.FunctionExpression, + id: null, + generator: !!node.asteriskToken, + expression: false, + async: node_utils_1.hasModifier(SyntaxKind.AsyncKeyword, node), + body: this.convertChild(node.body), + range: [node.parameters.pos - 1, node.end], + params: [], + }); + if (node.type) { + method.returnType = this.convertTypeAnnotation(node.type, node); + } + // Process typeParameters + if (node.typeParameters) { + method.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); + this.fixParentLocation(method, method.typeParameters.range); + } + let result; + if (parent.kind === SyntaxKind.ObjectLiteralExpression) { + method.params = node.parameters.map(el => this.convertChild(el)); + result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Property, + key: this.convertChild(node.name), + value: method, + computed: node_utils_1.isComputedProperty(node.name), + method: node.kind === SyntaxKind.MethodDeclaration, + shorthand: false, + kind: 'init', + }); + } + else { + // class + /** + * Unlike in object literal methods, class method params can have decorators + */ + method.params = this.convertParameters(node.parameters); + /** + * TypeScript class methods can be defined as "abstract" + */ + const methodDefinitionType = node_utils_1.hasModifier(SyntaxKind.AbstractKeyword, node) + ? ts_estree_1.AST_NODE_TYPES.TSAbstractMethodDefinition + : ts_estree_1.AST_NODE_TYPES.MethodDefinition; + result = this.createNode(node, { + type: methodDefinitionType, + key: this.convertChild(node.name), + value: method, + computed: node_utils_1.isComputedProperty(node.name), + static: node_utils_1.hasModifier(SyntaxKind.StaticKeyword, node), + kind: 'method', + }); + if (node.decorators) { + result.decorators = node.decorators.map(el => this.convertChild(el)); + } + const accessibility = node_utils_1.getTSNodeAccessibility(node); + if (accessibility) { + result.accessibility = accessibility; + } + } + if (node.questionToken) { + result.optional = true; + } + if (node.kind === SyntaxKind.GetAccessor) { + result.kind = 'get'; + } + else if (node.kind === SyntaxKind.SetAccessor) { + result.kind = 'set'; + } + else if (!result.static && + node.name.kind === SyntaxKind.StringLiteral && + node.name.text === 'constructor' && + result.type !== ts_estree_1.AST_NODE_TYPES.Property) { + result.kind = 'constructor'; + } + return result; + } + // TypeScript uses this even for static methods named "constructor" + case SyntaxKind.Constructor: { + const lastModifier = node_utils_1.getLastModifier(node); + const constructorToken = (lastModifier && node_utils_1.findNextToken(lastModifier, node, this.ast)) || + node.getFirstToken(); + const constructor = this.createNode(node, { + type: !node.body + ? ts_estree_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression + : ts_estree_1.AST_NODE_TYPES.FunctionExpression, + id: null, + params: this.convertParameters(node.parameters), + generator: false, + expression: false, + async: false, + body: this.convertChild(node.body), + range: [node.parameters.pos - 1, node.end], + }); + // Process typeParameters + if (node.typeParameters) { + constructor.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); + this.fixParentLocation(constructor, constructor.typeParameters.range); + } + // Process returnType + if (node.type) { + constructor.returnType = this.convertTypeAnnotation(node.type, node); + } + const constructorKey = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Identifier, + name: 'constructor', + range: [constructorToken.getStart(this.ast), constructorToken.end], + }); + const isStatic = node_utils_1.hasModifier(SyntaxKind.StaticKeyword, node); + const result = this.createNode(node, { + type: node_utils_1.hasModifier(SyntaxKind.AbstractKeyword, node) + ? ts_estree_1.AST_NODE_TYPES.TSAbstractMethodDefinition + : ts_estree_1.AST_NODE_TYPES.MethodDefinition, + key: constructorKey, + value: constructor, + computed: false, + static: isStatic, + kind: isStatic ? 'method' : 'constructor', + }); + const accessibility = node_utils_1.getTSNodeAccessibility(node); + if (accessibility) { + result.accessibility = accessibility; + } + return result; + } + case SyntaxKind.FunctionExpression: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.FunctionExpression, + id: this.convertChild(node.name), + generator: !!node.asteriskToken, + params: this.convertParameters(node.parameters), + body: this.convertChild(node.body), + async: node_utils_1.hasModifier(SyntaxKind.AsyncKeyword, node), + expression: false, + }); + // Process returnType + if (node.type) { + result.returnType = this.convertTypeAnnotation(node.type, node); + } + // Process typeParameters + if (node.typeParameters) { + result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); + } + return result; + } + case SyntaxKind.SuperKeyword: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Super, + }); + case SyntaxKind.ArrayBindingPattern: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ArrayPattern, + elements: node.elements.map(el => this.convertPattern(el)), + }); + // occurs with missing array elements like [,] + case SyntaxKind.OmittedExpression: + return null; + case SyntaxKind.ObjectBindingPattern: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ObjectPattern, + properties: node.elements.map(el => this.convertPattern(el)), + }); + case SyntaxKind.BindingElement: { + if (parent.kind === SyntaxKind.ArrayBindingPattern) { + const arrayItem = this.convertChild(node.name, parent); + if (node.initializer) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern, + left: arrayItem, + right: this.convertChild(node.initializer), + }); + } + else if (node.dotDotDotToken) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.RestElement, + argument: arrayItem, + }); + } + else { + return arrayItem; + } + } + else { + let result; + if (node.dotDotDotToken) { + result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.RestElement, + argument: this.convertChild((_a = node.propertyName) !== null && _a !== void 0 ? _a : node.name), + }); + } + else { + result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Property, + key: this.convertChild((_b = node.propertyName) !== null && _b !== void 0 ? _b : node.name), + value: this.convertChild(node.name), + computed: Boolean(node.propertyName && + node.propertyName.kind === SyntaxKind.ComputedPropertyName), + method: false, + shorthand: !node.propertyName, + kind: 'init', + }); + } + if (node.initializer) { + result.value = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern, + left: this.convertChild(node.name), + right: this.convertChild(node.initializer), + range: [node.name.getStart(this.ast), node.initializer.end], + }); + } + return result; + } + } + case SyntaxKind.ArrowFunction: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ArrowFunctionExpression, + generator: false, + id: null, + params: this.convertParameters(node.parameters), + body: this.convertChild(node.body), + async: node_utils_1.hasModifier(SyntaxKind.AsyncKeyword, node), + expression: node.body.kind !== SyntaxKind.Block, + }); + // Process returnType + if (node.type) { + result.returnType = this.convertTypeAnnotation(node.type, node); + } + // Process typeParameters + if (node.typeParameters) { + result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); + } + return result; + } + case SyntaxKind.YieldExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.YieldExpression, + delegate: !!node.asteriskToken, + argument: this.convertChild(node.expression), + }); + case SyntaxKind.AwaitExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.AwaitExpression, + argument: this.convertChild(node.expression), + }); + // Template Literals + case SyntaxKind.NoSubstitutionTemplateLiteral: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TemplateLiteral, + quasis: [ + this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TemplateElement, + value: { + raw: this.ast.text.slice(node.getStart(this.ast) + 1, node.end - 1), + cooked: node.text, + }, + tail: true, + }), + ], + expressions: [], + }); + case SyntaxKind.TemplateExpression: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TemplateLiteral, + quasis: [this.convertChild(node.head)], + expressions: [], + }); + node.templateSpans.forEach(templateSpan => { + result.expressions.push(this.convertChild(templateSpan.expression)); + result.quasis.push(this.convertChild(templateSpan.literal)); + }); + return result; + } + case SyntaxKind.TaggedTemplateExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TaggedTemplateExpression, + typeParameters: node.typeArguments + ? this.convertTypeArgumentsToTypeParameters(node.typeArguments, node) + : undefined, + tag: this.convertChild(node.tag), + quasi: this.convertChild(node.template), + }); + case SyntaxKind.TemplateHead: + case SyntaxKind.TemplateMiddle: + case SyntaxKind.TemplateTail: { + const tail = node.kind === SyntaxKind.TemplateTail; + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TemplateElement, + value: { + raw: this.ast.text.slice(node.getStart(this.ast) + 1, node.end - (tail ? 1 : 2)), + cooked: node.text, + }, + tail, + }); + } + // Patterns + case SyntaxKind.SpreadAssignment: + case SyntaxKind.SpreadElement: { + if (this.allowPattern) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.RestElement, + argument: this.convertPattern(node.expression), + }); + } + else { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.SpreadElement, + argument: this.convertChild(node.expression), + }); + } + } + case SyntaxKind.Parameter: { + let parameter; + let result; + if (node.dotDotDotToken) { + parameter = result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.RestElement, + argument: this.convertChild(node.name), + }); + } + else if (node.initializer) { + parameter = this.convertChild(node.name); + result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern, + left: parameter, + right: this.convertChild(node.initializer), + }); + if (node.modifiers) { + // AssignmentPattern should not contain modifiers in range + result.range[0] = parameter.range[0]; + result.loc = node_utils_1.getLocFor(result.range[0], result.range[1], this.ast); + } + } + else { + parameter = result = this.convertChild(node.name, parent); + } + if (node.type) { + parameter.typeAnnotation = this.convertTypeAnnotation(node.type, node); + this.fixParentLocation(parameter, parameter.typeAnnotation.range); + } + if (node.questionToken) { + if (node.questionToken.end > parameter.range[1]) { + parameter.range[1] = node.questionToken.end; + parameter.loc.end = node_utils_1.getLineAndCharacterFor(parameter.range[1], this.ast); + } + parameter.optional = true; + } + if (node.modifiers) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSParameterProperty, + accessibility: (_c = node_utils_1.getTSNodeAccessibility(node)) !== null && _c !== void 0 ? _c : undefined, + readonly: node_utils_1.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, + static: node_utils_1.hasModifier(SyntaxKind.StaticKeyword, node) || undefined, + export: node_utils_1.hasModifier(SyntaxKind.ExportKeyword, node) || undefined, + parameter: result, + }); + } + return result; + } + // Classes + case SyntaxKind.ClassDeclaration: + case SyntaxKind.ClassExpression: { + const heritageClauses = (_d = node.heritageClauses) !== null && _d !== void 0 ? _d : []; + const classNodeType = node.kind === SyntaxKind.ClassDeclaration + ? ts_estree_1.AST_NODE_TYPES.ClassDeclaration + : ts_estree_1.AST_NODE_TYPES.ClassExpression; + const superClass = heritageClauses.find(clause => clause.token === SyntaxKind.ExtendsKeyword); + const implementsClause = heritageClauses.find(clause => clause.token === SyntaxKind.ImplementsKeyword); + const result = this.createNode(node, { + type: classNodeType, + id: this.convertChild(node.name), + body: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ClassBody, + body: [], + range: [node.members.pos - 1, node.end], + }), + superClass: (superClass === null || superClass === void 0 ? void 0 : superClass.types[0]) ? this.convertChild(superClass.types[0].expression) + : null, + }); + if (superClass) { + if (superClass.types.length > 1) { + throw node_utils_1.createError(this.ast, superClass.types[1].pos, 'Classes can only extend a single class.'); + } + if ((_e = superClass.types[0]) === null || _e === void 0 ? void 0 : _e.typeArguments) { + result.superTypeParameters = this.convertTypeArgumentsToTypeParameters(superClass.types[0].typeArguments, superClass.types[0]); + } + } + if (node.typeParameters) { + result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); + } + if (implementsClause) { + result.implements = implementsClause.types.map(el => this.convertChild(el)); + } + /** + * TypeScript class declarations can be defined as "abstract" + */ + if (node_utils_1.hasModifier(SyntaxKind.AbstractKeyword, node)) { + result.abstract = true; + } + if (node_utils_1.hasModifier(SyntaxKind.DeclareKeyword, node)) { + result.declare = true; + } + if (node.decorators) { + result.decorators = node.decorators.map(el => this.convertChild(el)); + } + const filteredMembers = node.members.filter(node_utils_1.isESTreeClassMember); + if (filteredMembers.length) { + result.body.body = filteredMembers.map(el => this.convertChild(el)); + } + // check for exports + return this.fixExports(node, result); + } + // Modules + case SyntaxKind.ModuleBlock: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSModuleBlock, + body: this.convertBodyExpressions(node.statements, node), + }); + case SyntaxKind.ImportDeclaration: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ImportDeclaration, + source: this.convertChild(node.moduleSpecifier), + specifiers: [], + importKind: 'value', + }); + if (node.importClause) { + if (node.importClause.isTypeOnly) { + result.importKind = 'type'; + } + if (node.importClause.name) { + result.specifiers.push(this.convertChild(node.importClause)); + } + if (node.importClause.namedBindings) { + switch (node.importClause.namedBindings.kind) { + case SyntaxKind.NamespaceImport: + result.specifiers.push(this.convertChild(node.importClause.namedBindings)); + break; + case SyntaxKind.NamedImports: + result.specifiers = result.specifiers.concat(node.importClause.namedBindings.elements.map(el => this.convertChild(el))); + break; + } + } + } + return result; + } + case SyntaxKind.NamespaceImport: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ImportNamespaceSpecifier, + local: this.convertChild(node.name), + }); + case SyntaxKind.ImportSpecifier: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ImportSpecifier, + local: this.convertChild(node.name), + imported: this.convertChild((_f = node.propertyName) !== null && _f !== void 0 ? _f : node.name), + }); + case SyntaxKind.ImportClause: { + const local = this.convertChild(node.name); + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ImportDefaultSpecifier, + local, + range: local.range, + }); + } + case SyntaxKind.ExportDeclaration: + if (((_g = node.exportClause) === null || _g === void 0 ? void 0 : _g.kind) === SyntaxKind.NamedExports) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ExportNamedDeclaration, + source: this.convertChild(node.moduleSpecifier), + specifiers: node.exportClause.elements.map(el => this.convertChild(el)), + exportKind: node.isTypeOnly ? 'type' : 'value', + declaration: null, + }); + } + else { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ExportAllDeclaration, + source: this.convertChild(node.moduleSpecifier), + exportKind: node.isTypeOnly ? 'type' : 'value', + exported: + // note - for compat with 3.7.x, where node.exportClause is always undefined and + // SyntaxKind.NamespaceExport does not exist yet (i.e. is undefined), this + // cannot be shortened to an optional chain, or else you end up with + // undefined === undefined, and the true path will hard error at runtime + node.exportClause && + node.exportClause.kind === SyntaxKind.NamespaceExport + ? this.convertChild(node.exportClause.name) + : null, + }); + } + case SyntaxKind.ExportSpecifier: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ExportSpecifier, + local: this.convertChild((_h = node.propertyName) !== null && _h !== void 0 ? _h : node.name), + exported: this.convertChild(node.name), + }); + case SyntaxKind.ExportAssignment: + if (node.isExportEquals) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSExportAssignment, + expression: this.convertChild(node.expression), + }); + } + else { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ExportDefaultDeclaration, + declaration: this.convertChild(node.expression), + exportKind: 'value', + }); + } + // Unary Operations + case SyntaxKind.PrefixUnaryExpression: + case SyntaxKind.PostfixUnaryExpression: { + const operator = node_utils_1.getTextForTokenKind(node.operator); + /** + * ESTree uses UpdateExpression for ++/-- + */ + if (operator === '++' || operator === '--') { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.UpdateExpression, + operator, + prefix: node.kind === SyntaxKind.PrefixUnaryExpression, + argument: this.convertChild(node.operand), + }); + } + else { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.UnaryExpression, + operator, + prefix: node.kind === SyntaxKind.PrefixUnaryExpression, + argument: this.convertChild(node.operand), + }); + } + } + case SyntaxKind.DeleteExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.UnaryExpression, + operator: 'delete', + prefix: true, + argument: this.convertChild(node.expression), + }); + case SyntaxKind.VoidExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.UnaryExpression, + operator: 'void', + prefix: true, + argument: this.convertChild(node.expression), + }); + case SyntaxKind.TypeOfExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.UnaryExpression, + operator: 'typeof', + prefix: true, + argument: this.convertChild(node.expression), + }); + case SyntaxKind.TypeOperator: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeOperator, + operator: node_utils_1.getTextForTokenKind(node.operator), + typeAnnotation: this.convertChild(node.type), + }); + // Binary Operations + case SyntaxKind.BinaryExpression: { + // TypeScript uses BinaryExpression for sequences as well + if (node_utils_1.isComma(node.operatorToken)) { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.SequenceExpression, + expressions: [], + }); + const left = this.convertChild(node.left); + if (left.type === ts_estree_1.AST_NODE_TYPES.SequenceExpression && + node.left.kind !== SyntaxKind.ParenthesizedExpression) { + result.expressions = result.expressions.concat(left.expressions); + } + else { + result.expressions.push(left); + } + result.expressions.push(this.convertChild(node.right)); + return result; + } + else { + const type = node_utils_1.getBinaryExpressionType(node.operatorToken); + if (this.allowPattern && + type === ts_estree_1.AST_NODE_TYPES.AssignmentExpression) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern, + left: this.convertPattern(node.left, node), + right: this.convertChild(node.right), + }); + } + return this.createNode(node, { + type, + operator: node_utils_1.getTextForTokenKind(node.operatorToken.kind), + left: this.converter(node.left, node, this.inTypeMode, type === ts_estree_1.AST_NODE_TYPES.AssignmentExpression), + right: this.convertChild(node.right), + }); + } + } + case SyntaxKind.PropertyAccessExpression: { + const object = this.convertChild(node.expression); + const property = this.convertChild(node.name); + const computed = false; + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.MemberExpression, + object, + property, + computed, + optional: node.questionDotToken !== undefined, + }); + return this.convertChainExpression(result, node); + } + case SyntaxKind.ElementAccessExpression: { + const object = this.convertChild(node.expression); + const property = this.convertChild(node.argumentExpression); + const computed = true; + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.MemberExpression, + object, + property, + computed, + optional: node.questionDotToken !== undefined, + }); + return this.convertChainExpression(result, node); + } + case SyntaxKind.CallExpression: { + if (node.expression.kind === SyntaxKind.ImportKeyword) { + if (node.arguments.length !== 1) { + throw node_utils_1.createError(this.ast, node.arguments.pos, 'Dynamic import must have one specifier as an argument.'); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ImportExpression, + source: this.convertChild(node.arguments[0]), + }); + } + const callee = this.convertChild(node.expression); + const args = node.arguments.map(el => this.convertChild(el)); + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.CallExpression, + callee, + arguments: args, + optional: node.questionDotToken !== undefined, + }); + if (node.typeArguments) { + result.typeParameters = this.convertTypeArgumentsToTypeParameters(node.typeArguments, node); + } + return this.convertChainExpression(result, node); + } + case SyntaxKind.NewExpression: { + // NOTE - NewExpression cannot have an optional chain in it + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.NewExpression, + callee: this.convertChild(node.expression), + arguments: node.arguments + ? node.arguments.map(el => this.convertChild(el)) + : [], + }); + if (node.typeArguments) { + result.typeParameters = this.convertTypeArgumentsToTypeParameters(node.typeArguments, node); + } + return result; + } + case SyntaxKind.ConditionalExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ConditionalExpression, + test: this.convertChild(node.condition), + consequent: this.convertChild(node.whenTrue), + alternate: this.convertChild(node.whenFalse), + }); + case SyntaxKind.MetaProperty: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.MetaProperty, + meta: this.createNode( + // TODO: do we really want to convert it to Token? + node.getFirstToken(), { + type: ts_estree_1.AST_NODE_TYPES.Identifier, + name: node_utils_1.getTextForTokenKind(node.keywordToken), + }), + property: this.convertChild(node.name), + }); + } + case SyntaxKind.Decorator: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Decorator, + expression: this.convertChild(node.expression), + }); + } + // Literals + case SyntaxKind.StringLiteral: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + raw: '', + value: '', + }); + result.raw = this.ast.text.slice(result.range[0], result.range[1]); + if ('name' in parent && parent.name === node) { + result.value = node.text; + } + else { + result.value = node_utils_1.unescapeStringLiteralText(node.text); + } + return result; + } + case SyntaxKind.NumericLiteral: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + value: Number(node.text), + raw: node.getText(), + }); + } + case SyntaxKind.BigIntLiteral: { + const range = node_utils_1.getRange(node, this.ast); + const rawValue = this.ast.text.slice(range[0], range[1]); + const bigint = rawValue + // remove suffix `n` + .slice(0, -1) + // `BigInt` doesn't accept numeric separator + // and `bigint` property should not include numeric separator + .replace(/_/g, ''); + const value = typeof BigInt !== 'undefined' ? BigInt(bigint) : null; + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + raw: rawValue, + value: value, + bigint: value === null ? bigint : String(value), + range, + }); + } + case SyntaxKind.RegularExpressionLiteral: { + const pattern = node.text.slice(1, node.text.lastIndexOf('/')); + const flags = node.text.slice(node.text.lastIndexOf('/') + 1); + let regex = null; + try { + regex = new RegExp(pattern, flags); + } + catch (exception) { + regex = null; + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + value: regex, + raw: node.text, + regex: { + pattern, + flags, + }, + }); + } + case SyntaxKind.TrueKeyword: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + value: true, + raw: 'true', + }); + case SyntaxKind.FalseKeyword: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + value: false, + raw: 'false', + }); + case SyntaxKind.NullKeyword: { + if (!version_check_1.typescriptVersionIsAtLeast['4.0'] && this.inTypeMode) { + // 4.0 started nesting null types inside a LiteralType node, but we still need to support pre-4.0 + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSNullKeyword, + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + value: null, + raw: 'null', + }); + } + case SyntaxKind.EmptyStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.EmptyStatement, + }); + case SyntaxKind.DebuggerStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.DebuggerStatement, + }); + // JSX + case SyntaxKind.JsxElement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXElement, + openingElement: this.convertChild(node.openingElement), + closingElement: this.convertChild(node.closingElement), + children: node.children.map(el => this.convertChild(el)), + }); + case SyntaxKind.JsxFragment: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXFragment, + openingFragment: this.convertChild(node.openingFragment), + closingFragment: this.convertChild(node.closingFragment), + children: node.children.map(el => this.convertChild(el)), + }); + case SyntaxKind.JsxSelfClosingElement: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXElement, + /** + * Convert SyntaxKind.JsxSelfClosingElement to SyntaxKind.JsxOpeningElement, + * TypeScript does not seem to have the idea of openingElement when tag is self-closing + */ + openingElement: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXOpeningElement, + typeParameters: node.typeArguments + ? this.convertTypeArgumentsToTypeParameters(node.typeArguments, node) + : undefined, + selfClosing: true, + name: this.convertJSXTagName(node.tagName, node), + attributes: node.attributes.properties.map(el => this.convertChild(el)), + range: node_utils_1.getRange(node, this.ast), + }), + closingElement: null, + children: [], + }); + } + case SyntaxKind.JsxOpeningElement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXOpeningElement, + typeParameters: node.typeArguments + ? this.convertTypeArgumentsToTypeParameters(node.typeArguments, node) + : undefined, + selfClosing: false, + name: this.convertJSXTagName(node.tagName, node), + attributes: node.attributes.properties.map(el => this.convertChild(el)), + }); + case SyntaxKind.JsxClosingElement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXClosingElement, + name: this.convertJSXTagName(node.tagName, node), + }); + case SyntaxKind.JsxOpeningFragment: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXOpeningFragment, + }); + case SyntaxKind.JsxClosingFragment: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXClosingFragment, + }); + case SyntaxKind.JsxExpression: { + const expression = node.expression + ? this.convertChild(node.expression) + : this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXEmptyExpression, + range: [node.getStart(this.ast) + 1, node.getEnd() - 1], + }); + if (node.dotDotDotToken) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXSpreadChild, + expression, + }); + } + else { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXExpressionContainer, + expression, + }); + } + } + case SyntaxKind.JsxAttribute: { + const attributeName = this.convertChild(node.name); + attributeName.type = ts_estree_1.AST_NODE_TYPES.JSXIdentifier; + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXAttribute, + name: attributeName, + value: this.convertChild(node.initializer), + }); + } + /** + * The JSX AST changed the node type for string literals + * inside a JSX Element from `Literal` to `JSXText`. We + * provide a flag to support both types until `Literal` + * node type is deprecated in ESLint v5. + */ + case SyntaxKind.JsxText: { + const start = node.getFullStart(); + const end = node.getEnd(); + if (this.options.useJSXTextNode) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXText, + value: this.ast.text.slice(start, end), + raw: this.ast.text.slice(start, end), + range: [start, end], + }); + } + else { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + value: this.ast.text.slice(start, end), + raw: this.ast.text.slice(start, end), + range: [start, end], + }); + } + } + case SyntaxKind.JsxSpreadAttribute: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXSpreadAttribute, + argument: this.convertChild(node.expression), + }); + case SyntaxKind.QualifiedName: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSQualifiedName, + left: this.convertChild(node.left), + right: this.convertChild(node.right), + }); + } + // TypeScript specific + case SyntaxKind.TypeReference: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeReference, + typeName: this.convertType(node.typeName), + typeParameters: node.typeArguments + ? this.convertTypeArgumentsToTypeParameters(node.typeArguments, node) + : undefined, + }); + } + case SyntaxKind.TypeParameter: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeParameter, + name: this.convertType(node.name), + constraint: node.constraint + ? this.convertType(node.constraint) + : undefined, + default: node.default ? this.convertType(node.default) : undefined, + }); + } + case SyntaxKind.ThisType: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSThisType, + }); + case SyntaxKind.AnyKeyword: + case SyntaxKind.BigIntKeyword: + case SyntaxKind.BooleanKeyword: + case SyntaxKind.NeverKeyword: + case SyntaxKind.NumberKeyword: + case SyntaxKind.ObjectKeyword: + case SyntaxKind.StringKeyword: + case SyntaxKind.SymbolKeyword: + case SyntaxKind.UnknownKeyword: + case SyntaxKind.VoidKeyword: + case SyntaxKind.UndefinedKeyword: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES[`TS${SyntaxKind[node.kind]}`], + }); + } + case SyntaxKind.NonNullExpression: { + const nnExpr = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSNonNullExpression, + expression: this.convertChild(node.expression), + }); + return this.convertChainExpression(nnExpr, node); + } + case SyntaxKind.TypeLiteral: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeLiteral, + members: node.members.map(el => this.convertChild(el)), + }); + } + case SyntaxKind.ArrayType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSArrayType, + elementType: this.convertType(node.elementType), + }); + } + case SyntaxKind.IndexedAccessType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSIndexedAccessType, + objectType: this.convertType(node.objectType), + indexType: this.convertType(node.indexType), + }); + } + case SyntaxKind.ConditionalType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSConditionalType, + checkType: this.convertType(node.checkType), + extendsType: this.convertType(node.extendsType), + trueType: this.convertType(node.trueType), + falseType: this.convertType(node.falseType), + }); + } + case SyntaxKind.TypeQuery: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeQuery, + exprName: this.convertType(node.exprName), + }); + } + case SyntaxKind.MappedType: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSMappedType, + typeParameter: this.convertType(node.typeParameter), + }); + if (node.readonlyToken) { + if (node.readonlyToken.kind === SyntaxKind.ReadonlyKeyword) { + result.readonly = true; + } + else { + result.readonly = node_utils_1.getTextForTokenKind(node.readonlyToken.kind); + } + } + if (node.questionToken) { + if (node.questionToken.kind === SyntaxKind.QuestionToken) { + result.optional = true; + } + else { + result.optional = node_utils_1.getTextForTokenKind(node.questionToken.kind); + } + } + if (node.type) { + result.typeAnnotation = this.convertType(node.type); + } + return result; + } + case SyntaxKind.ParenthesizedExpression: + return this.convertChild(node.expression, parent); + case SyntaxKind.TypeAliasDeclaration: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeAliasDeclaration, + id: this.convertChild(node.name), + typeAnnotation: this.convertType(node.type), + }); + if (node_utils_1.hasModifier(SyntaxKind.DeclareKeyword, node)) { + result.declare = true; + } + // Process typeParameters + if (node.typeParameters) { + result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); + } + // check for exports + return this.fixExports(node, result); + } + case SyntaxKind.MethodSignature: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSMethodSignature, + computed: node_utils_1.isComputedProperty(node.name), + key: this.convertChild(node.name), + params: this.convertParameters(node.parameters), + }); + if (node_utils_1.isOptional(node)) { + result.optional = true; + } + if (node.type) { + result.returnType = this.convertTypeAnnotation(node.type, node); + } + if (node_utils_1.hasModifier(SyntaxKind.ReadonlyKeyword, node)) { + result.readonly = true; + } + if (node.typeParameters) { + result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); + } + const accessibility = node_utils_1.getTSNodeAccessibility(node); + if (accessibility) { + result.accessibility = accessibility; + } + if (node_utils_1.hasModifier(SyntaxKind.ExportKeyword, node)) { + result.export = true; + } + if (node_utils_1.hasModifier(SyntaxKind.StaticKeyword, node)) { + result.static = true; + } + return result; + } + case SyntaxKind.PropertySignature: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSPropertySignature, + optional: node_utils_1.isOptional(node) || undefined, + computed: node_utils_1.isComputedProperty(node.name), + key: this.convertChild(node.name), + typeAnnotation: node.type + ? this.convertTypeAnnotation(node.type, node) + : undefined, + initializer: this.convertChild(node.initializer) || undefined, + readonly: node_utils_1.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, + static: node_utils_1.hasModifier(SyntaxKind.StaticKeyword, node) || undefined, + export: node_utils_1.hasModifier(SyntaxKind.ExportKeyword, node) || undefined, + }); + const accessibility = node_utils_1.getTSNodeAccessibility(node); + if (accessibility) { + result.accessibility = accessibility; + } + return result; + } + case SyntaxKind.IndexSignature: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSIndexSignature, + parameters: node.parameters.map(el => this.convertChild(el)), + }); + if (node.type) { + result.typeAnnotation = this.convertTypeAnnotation(node.type, node); + } + if (node_utils_1.hasModifier(SyntaxKind.ReadonlyKeyword, node)) { + result.readonly = true; + } + const accessibility = node_utils_1.getTSNodeAccessibility(node); + if (accessibility) { + result.accessibility = accessibility; + } + if (node_utils_1.hasModifier(SyntaxKind.ExportKeyword, node)) { + result.export = true; + } + if (node_utils_1.hasModifier(SyntaxKind.StaticKeyword, node)) { + result.static = true; + } + return result; + } + case SyntaxKind.ConstructorType: + case SyntaxKind.FunctionType: + case SyntaxKind.ConstructSignature: + case SyntaxKind.CallSignature: { + let type; + switch (node.kind) { + case SyntaxKind.ConstructSignature: + type = ts_estree_1.AST_NODE_TYPES.TSConstructSignatureDeclaration; + break; + case SyntaxKind.CallSignature: + type = ts_estree_1.AST_NODE_TYPES.TSCallSignatureDeclaration; + break; + case SyntaxKind.FunctionType: + type = ts_estree_1.AST_NODE_TYPES.TSFunctionType; + break; + case SyntaxKind.ConstructorType: + default: + type = ts_estree_1.AST_NODE_TYPES.TSConstructorType; + break; + } + const result = this.createNode(node, { + type: type, + params: this.convertParameters(node.parameters), + }); + if (node.type) { + result.returnType = this.convertTypeAnnotation(node.type, node); + } + if (node.typeParameters) { + result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); + } + return result; + } + case SyntaxKind.ExpressionWithTypeArguments: { + const result = this.createNode(node, { + type: parent && parent.kind === SyntaxKind.InterfaceDeclaration + ? ts_estree_1.AST_NODE_TYPES.TSInterfaceHeritage + : ts_estree_1.AST_NODE_TYPES.TSClassImplements, + expression: this.convertChild(node.expression), + }); + if (node.typeArguments) { + result.typeParameters = this.convertTypeArgumentsToTypeParameters(node.typeArguments, node); + } + return result; + } + case SyntaxKind.InterfaceDeclaration: { + const interfaceHeritageClauses = (_j = node.heritageClauses) !== null && _j !== void 0 ? _j : []; + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSInterfaceDeclaration, + body: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSInterfaceBody, + body: node.members.map(member => this.convertChild(member)), + range: [node.members.pos - 1, node.end], + }), + id: this.convertChild(node.name), + }); + if (node.typeParameters) { + result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); + } + if (interfaceHeritageClauses.length > 0) { + const interfaceExtends = []; + const interfaceImplements = []; + for (const heritageClause of interfaceHeritageClauses) { + if (heritageClause.token === SyntaxKind.ExtendsKeyword) { + for (const n of heritageClause.types) { + interfaceExtends.push(this.convertChild(n, node)); + } + } + else { + for (const n of heritageClause.types) { + interfaceImplements.push(this.convertChild(n, node)); + } + } + } + if (interfaceExtends.length) { + result.extends = interfaceExtends; + } + if (interfaceImplements.length) { + result.implements = interfaceImplements; + } + } + if (node_utils_1.hasModifier(SyntaxKind.AbstractKeyword, node)) { + result.abstract = true; + } + if (node_utils_1.hasModifier(SyntaxKind.DeclareKeyword, node)) { + result.declare = true; + } + // check for exports + return this.fixExports(node, result); + } + case SyntaxKind.TypePredicate: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypePredicate, + asserts: node.assertsModifier !== undefined, + parameterName: this.convertChild(node.parameterName), + typeAnnotation: null, + }); + /** + * Specific fix for type-guard location data + */ + if (node.type) { + result.typeAnnotation = this.convertTypeAnnotation(node.type, node); + result.typeAnnotation.loc = result.typeAnnotation.typeAnnotation.loc; + result.typeAnnotation.range = + result.typeAnnotation.typeAnnotation.range; + } + return result; + } + case SyntaxKind.ImportType: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSImportType, + isTypeOf: !!node.isTypeOf, + parameter: this.convertChild(node.argument), + qualifier: this.convertChild(node.qualifier), + typeParameters: node.typeArguments + ? this.convertTypeArgumentsToTypeParameters(node.typeArguments, node) + : null, + }); + case SyntaxKind.EnumDeclaration: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSEnumDeclaration, + id: this.convertChild(node.name), + members: node.members.map(el => this.convertChild(el)), + }); + // apply modifiers first... + this.applyModifiersToResult(result, node.modifiers); + // ...then check for exports + return this.fixExports(node, result); + } + case SyntaxKind.EnumMember: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSEnumMember, + id: this.convertChild(node.name), + }); + if (node.initializer) { + result.initializer = this.convertChild(node.initializer); + } + if (node.name.kind === ts.SyntaxKind.ComputedPropertyName) { + result.computed = true; + } + return result; + } + case SyntaxKind.ModuleDeclaration: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSModuleDeclaration, + id: this.convertChild(node.name), + }); + if (node.body) { + result.body = this.convertChild(node.body); + } + // apply modifiers first... + this.applyModifiersToResult(result, node.modifiers); + if (node.flags & ts.NodeFlags.GlobalAugmentation) { + result.global = true; + } + // ...then check for exports + return this.fixExports(node, result); + } + // TypeScript specific types + case SyntaxKind.ParenthesizedType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSParenthesizedType, + typeAnnotation: this.convertType(node.type), + }); + } + case SyntaxKind.UnionType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSUnionType, + types: node.types.map(el => this.convertType(el)), + }); + } + case SyntaxKind.IntersectionType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSIntersectionType, + types: node.types.map(el => this.convertType(el)), + }); + } + case SyntaxKind.AsExpression: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSAsExpression, + expression: this.convertChild(node.expression), + typeAnnotation: this.convertType(node.type), + }); + } + case SyntaxKind.InferType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSInferType, + typeParameter: this.convertType(node.typeParameter), + }); + } + case SyntaxKind.LiteralType: { + if (version_check_1.typescriptVersionIsAtLeast['4.0'] && + node.literal.kind === SyntaxKind.NullKeyword) { + // 4.0 started nesting null types inside a LiteralType node + // but our AST is designed around the old way of null being a keyword + return this.createNode(node.literal, { + type: ts_estree_1.AST_NODE_TYPES.TSNullKeyword, + }); + } + else { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSLiteralType, + literal: this.convertType(node.literal), + }); + } + } + case SyntaxKind.TypeAssertionExpression: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeAssertion, + typeAnnotation: this.convertType(node.type), + expression: this.convertChild(node.expression), + }); + } + case SyntaxKind.ImportEqualsDeclaration: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSImportEqualsDeclaration, + id: this.convertChild(node.name), + moduleReference: this.convertChild(node.moduleReference), + isExport: node_utils_1.hasModifier(SyntaxKind.ExportKeyword, node), + }); + } + case SyntaxKind.ExternalModuleReference: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSExternalModuleReference, + expression: this.convertChild(node.expression), + }); + } + case SyntaxKind.NamespaceExportDeclaration: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSNamespaceExportDeclaration, + id: this.convertChild(node.name), + }); + } + case SyntaxKind.AbstractKeyword: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSAbstractKeyword, + }); + } + // Tuple + case SyntaxKind.TupleType: { + // In TS 4.0, the `elementTypes` property was changed to `elements`. + // To support both at compile time, we cast to access the newer version + // if the former does not exist. + const elementTypes = 'elementTypes' in node + ? node.elementTypes.map((el) => this.convertType(el)) + : node.elements.map((el) => this.convertType(el)); + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTupleType, + elementTypes, + }); + } + case SyntaxKind.NamedTupleMember: { + const member = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSNamedTupleMember, + elementType: this.convertType(node.type, node), + label: this.convertChild(node.name, node), + optional: node.questionToken != null, + }); + if (node.dotDotDotToken) { + // adjust the start to account for the "..." + member.range[0] = member.label.range[0]; + member.loc.start = member.label.loc.start; + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSRestType, + typeAnnotation: member, + }); + } + return member; + } + case SyntaxKind.OptionalType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSOptionalType, + typeAnnotation: this.convertType(node.type), + }); + } + case SyntaxKind.RestType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSRestType, + typeAnnotation: this.convertType(node.type), + }); + } + default: + return this.deeplyCopy(node); + } + } +} +exports.Converter = Converter; +//# sourceMappingURL=convert.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/convert.js.map b/node_modules/@typescript-eslint/typescript-estree/dist/convert.js.map new file mode 100644 index 000000000..da4e64df7 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/convert.js.map @@ -0,0 +1 @@ +{"version":3,"file":"convert.js","sourceRoot":"","sources":["../src/convert.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,2DAA2D;AAC3D,uDAAuD;AACvD,+CAAiC;AACjC,6CAqBsB;AAEtB,2CAKqB;AACrB,mDAA6D;AAE7D,MAAM,UAAU,GAAG,EAAE,CAAC,UAAU,CAAC;AAQjC;;;;GAIG;AACH,SAAgB,YAAY,CAAC,KAAU;IACrC,OAAO,wBAAW,CAChB,KAAK,CAAC,IAAI,EACV,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,WAAW,CACnC,CAAC;AACJ,CAAC;AAND,oCAMC;AAOD,MAAa,SAAS;IASpB;;;;;OAKG;IACH,YAAY,GAAkB,EAAE,OAAyB;QAZxC,0BAAqB,GAAG,IAAI,OAAO,EAAE,CAAC;QACtC,0BAAqB,GAAG,IAAI,OAAO,EAAE,CAAC;QAE/C,iBAAY,GAAG,KAAK,CAAC;QACrB,eAAU,GAAG,KAAK,CAAC;QASzB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,OAAO,qBAAQ,OAAO,CAAE,CAAC;IAChC,CAAC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AC,IAAI,CAAC,IAAI,CAAC;iBAC5C,CAAC,CAAC;aACJ;YAED;gBACE,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;SAChC;IACH,CAAC;CACF;AA9nFD,8BA8nFC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.d.ts b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.d.ts new file mode 100644 index 000000000..85764acf9 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.d.ts @@ -0,0 +1,13 @@ +import * as ts from 'typescript'; +interface DirectoryStructureHost { + readDirectory?(path: string, extensions?: ReadonlyArray, exclude?: ReadonlyArray, include?: ReadonlyArray, depth?: number): string[]; +} +interface CachedDirectoryStructureHost extends DirectoryStructureHost { + readDirectory(path: string, extensions?: ReadonlyArray, exclude?: ReadonlyArray, include?: ReadonlyArray, depth?: number): string[]; +} +interface WatchCompilerHostOfConfigFile extends ts.WatchCompilerHostOfConfigFile { + onCachedDirectoryStructureHostCreate(host: CachedDirectoryStructureHost): void; + extraFileExtensions?: readonly ts.FileExtensionInfo[]; +} +export { WatchCompilerHostOfConfigFile }; +//# sourceMappingURL=WatchCompilerHostOfConfigFile.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.d.ts.map new file mode 100644 index 000000000..408e42e8e --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"WatchCompilerHostOfConfigFile.d.ts","sourceRoot":"","sources":["../../src/create-program/WatchCompilerHostOfConfigFile.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAGjC,UAAU,sBAAsB;IAC9B,aAAa,CAAC,CACZ,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,EAClC,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,EAC/B,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,EAC/B,KAAK,CAAC,EAAE,MAAM,GACb,MAAM,EAAE,CAAC;CACb;AAGD,UAAU,4BAA6B,SAAQ,sBAAsB;IACnE,aAAa,CACX,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,EAClC,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,EAC/B,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,EAC/B,KAAK,CAAC,EAAE,MAAM,GACb,MAAM,EAAE,CAAC;CACb;AAGD,UAAU,6BAA6B,CAAC,CAAC,SAAS,EAAE,CAAC,cAAc,CACjE,SAAQ,EAAE,CAAC,6BAA6B,CAAC,CAAC,CAAC;IAC3C,oCAAoC,CAClC,IAAI,EAAE,4BAA4B,GACjC,IAAI,CAAC;IACR,mBAAmB,CAAC,EAAE,SAAS,EAAE,CAAC,iBAAiB,EAAE,CAAC;CACvD;AAED,OAAO,EAAE,6BAA6B,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.js b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.js new file mode 100644 index 000000000..dcb071299 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.js @@ -0,0 +1,6 @@ +"use strict"; +// These types are internal to TS. +// They have been trimmed down to only include the relevant bits +// We use some special internal TS apis to help us do our parsing flexibly +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=WatchCompilerHostOfConfigFile.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.js.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.js.map new file mode 100644 index 000000000..757e885cc --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.js.map @@ -0,0 +1 @@ +{"version":3,"file":"WatchCompilerHostOfConfigFile.js","sourceRoot":"","sources":["../../src/create-program/WatchCompilerHostOfConfigFile.ts"],"names":[],"mappings":";AAAA,kCAAkC;AAClC,gEAAgE;AAChE,0EAA0E"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createDefaultProgram.d.ts b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createDefaultProgram.d.ts new file mode 100644 index 000000000..ea80b7334 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createDefaultProgram.d.ts @@ -0,0 +1,12 @@ +import { Extra } from '../parser-options'; +import { ASTAndProgram } from './shared'; +/** + * @param code The code of the file being linted + * @param extra The config object + * @param extra.tsconfigRootDir The root directory for relative tsconfig paths + * @param extra.projects Provided tsconfig paths + * @returns If found, returns the source file corresponding to the code and the containing program + */ +declare function createDefaultProgram(code: string, extra: Extra): ASTAndProgram | undefined; +export { createDefaultProgram }; +//# sourceMappingURL=createDefaultProgram.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createDefaultProgram.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createDefaultProgram.d.ts.map new file mode 100644 index 000000000..2c26fe561 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createDefaultProgram.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"createDefaultProgram.d.ts","sourceRoot":"","sources":["../../src/create-program/createDefaultProgram.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EACL,aAAa,EAGd,MAAM,UAAU,CAAC;AAIlB;;;;;;GAMG;AACH,iBAAS,oBAAoB,CAC3B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,KAAK,GACX,aAAa,GAAG,SAAS,CAqC3B;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createDefaultProgram.js b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createDefaultProgram.js new file mode 100644 index 000000000..9f60bc04c --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createDefaultProgram.js @@ -0,0 +1,59 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createDefaultProgram = void 0; +const debug_1 = __importDefault(require("debug")); +const path_1 = __importDefault(require("path")); +const ts = __importStar(require("typescript")); +const shared_1 = require("./shared"); +const log = debug_1.default('typescript-eslint:typescript-estree:createDefaultProgram'); +/** + * @param code The code of the file being linted + * @param extra The config object + * @param extra.tsconfigRootDir The root directory for relative tsconfig paths + * @param extra.projects Provided tsconfig paths + * @returns If found, returns the source file corresponding to the code and the containing program + */ +function createDefaultProgram(code, extra) { + log('Getting default program for: %s', extra.filePath || 'unnamed file'); + if (!extra.projects || extra.projects.length !== 1) { + return undefined; + } + const tsconfigPath = shared_1.getTsconfigPath(extra.projects[0], extra); + const commandLine = ts.getParsedCommandLineOfConfigFile(tsconfigPath, shared_1.createDefaultCompilerOptionsFromExtra(extra), Object.assign(Object.assign({}, ts.sys), { onUnRecoverableConfigFileDiagnostic: () => { } })); + if (!commandLine) { + return undefined; + } + const compilerHost = ts.createCompilerHost(commandLine.options, + /* setParentNodes */ true); + const oldReadFile = compilerHost.readFile; + compilerHost.readFile = (fileName) => path_1.default.normalize(fileName) === path_1.default.normalize(extra.filePath) + ? code + : oldReadFile(fileName); + const program = ts.createProgram([extra.filePath], commandLine.options, compilerHost); + const ast = program.getSourceFile(extra.filePath); + return ast && { ast, program }; +} +exports.createDefaultProgram = createDefaultProgram; +//# sourceMappingURL=createDefaultProgram.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createDefaultProgram.js.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createDefaultProgram.js.map new file mode 100644 index 000000000..7ae63e4af --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createDefaultProgram.js.map @@ -0,0 +1 @@ +{"version":3,"file":"createDefaultProgram.js","sourceRoot":"","sources":["../../src/create-program/createDefaultProgram.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,gDAAwB;AACxB,+CAAiC;AAEjC,qCAIkB;AAElB,MAAM,GAAG,GAAG,eAAK,CAAC,0DAA0D,CAAC,CAAC;AAE9E;;;;;;GAMG;AACH,SAAS,oBAAoB,CAC3B,IAAY,EACZ,KAAY;IAEZ,GAAG,CAAC,iCAAiC,EAAE,KAAK,CAAC,QAAQ,IAAI,cAAc,CAAC,CAAC;IAEzE,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;QAClD,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,YAAY,GAAG,wBAAe,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IAE/D,MAAM,WAAW,GAAG,EAAE,CAAC,gCAAgC,CACrD,YAAY,EACZ,8CAAqC,CAAC,KAAK,CAAC,kCACvC,EAAE,CAAC,GAAG,KAAE,mCAAmC,EAAE,GAAG,EAAE,GAAE,CAAC,IAC3D,CAAC;IAEF,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,YAAY,GAAG,EAAE,CAAC,kBAAkB,CACxC,WAAW,CAAC,OAAO;IACnB,oBAAoB,CAAC,IAAI,CAC1B,CAAC;IACF,MAAM,WAAW,GAAG,YAAY,CAAC,QAAQ,CAAC;IAC1C,YAAY,CAAC,QAAQ,GAAG,CAAC,QAAgB,EAAsB,EAAE,CAC/D,cAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,cAAI,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC;QACzD,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAE5B,MAAM,OAAO,GAAG,EAAE,CAAC,aAAa,CAC9B,CAAC,KAAK,CAAC,QAAQ,CAAC,EAChB,WAAW,CAAC,OAAO,EACnB,YAAY,CACb,CAAC;IACF,MAAM,GAAG,GAAG,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAElD,OAAO,GAAG,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;AACjC,CAAC;AAEQ,oDAAoB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.d.ts b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.d.ts new file mode 100644 index 000000000..26bc6e4b3 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.d.ts @@ -0,0 +1,9 @@ +import { Extra } from '../parser-options'; +import { ASTAndProgram } from './shared'; +/** + * @param code The code of the file being linted + * @returns Returns a new source file and program corresponding to the linted code + */ +declare function createIsolatedProgram(code: string, extra: Extra): ASTAndProgram; +export { createIsolatedProgram }; +//# sourceMappingURL=createIsolatedProgram.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.d.ts.map new file mode 100644 index 000000000..d246fcaf8 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"createIsolatedProgram.d.ts","sourceRoot":"","sources":["../../src/create-program/createIsolatedProgram.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EACL,aAAa,EAGd,MAAM,UAAU,CAAC;AAIlB;;;GAGG;AACH,iBAAS,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,aAAa,CAmExE;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js new file mode 100644 index 000000000..88d4ba3b6 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js @@ -0,0 +1,78 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createIsolatedProgram = void 0; +const debug_1 = __importDefault(require("debug")); +const ts = __importStar(require("typescript")); +const shared_1 = require("./shared"); +const log = debug_1.default('typescript-eslint:typescript-estree:createIsolatedProgram'); +/** + * @param code The code of the file being linted + * @returns Returns a new source file and program corresponding to the linted code + */ +function createIsolatedProgram(code, extra) { + log('Getting isolated program in %s mode for: %s', extra.jsx ? 'TSX' : 'TS', extra.filePath); + const compilerHost = { + fileExists() { + return true; + }, + getCanonicalFileName() { + return extra.filePath; + }, + getCurrentDirectory() { + return ''; + }, + getDirectories() { + return []; + }, + getDefaultLibFileName() { + return 'lib.d.ts'; + }, + // TODO: Support Windows CRLF + getNewLine() { + return '\n'; + }, + getSourceFile(filename) { + return ts.createSourceFile(filename, code, ts.ScriptTarget.Latest, + /* setParentNodes */ true, shared_1.getScriptKind(extra, filename)); + }, + readFile() { + return undefined; + }, + useCaseSensitiveFileNames() { + return true; + }, + writeFile() { + return null; + }, + }; + const program = ts.createProgram([extra.filePath], Object.assign({ noResolve: true, target: ts.ScriptTarget.Latest, jsx: extra.jsx ? ts.JsxEmit.Preserve : undefined }, shared_1.createDefaultCompilerOptionsFromExtra(extra)), compilerHost); + const ast = program.getSourceFile(extra.filePath); + if (!ast) { + throw new Error('Expected an ast to be returned for the single-file isolated program.'); + } + return { ast, program }; +} +exports.createIsolatedProgram = createIsolatedProgram; +//# sourceMappingURL=createIsolatedProgram.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js.map new file mode 100644 index 000000000..75a61456f --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js.map @@ -0,0 +1 @@ +{"version":3,"file":"createIsolatedProgram.js","sourceRoot":"","sources":["../../src/create-program/createIsolatedProgram.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,+CAAiC;AAEjC,qCAIkB;AAElB,MAAM,GAAG,GAAG,eAAK,CAAC,2DAA2D,CAAC,CAAC;AAE/E;;;GAGG;AACH,SAAS,qBAAqB,CAAC,IAAY,EAAE,KAAY;IACvD,GAAG,CACD,6CAA6C,EAC7C,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EACxB,KAAK,CAAC,QAAQ,CACf,CAAC;IAEF,MAAM,YAAY,GAAoB;QACpC,UAAU;YACR,OAAO,IAAI,CAAC;QACd,CAAC;QACD,oBAAoB;YAClB,OAAO,KAAK,CAAC,QAAQ,CAAC;QACxB,CAAC;QACD,mBAAmB;YACjB,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,cAAc;YACZ,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,qBAAqB;YACnB,OAAO,UAAU,CAAC;QACpB,CAAC;QAED,6BAA6B;QAC7B,UAAU;YACR,OAAO,IAAI,CAAC;QACd,CAAC;QACD,aAAa,CAAC,QAAgB;YAC5B,OAAO,EAAE,CAAC,gBAAgB,CACxB,QAAQ,EACR,IAAI,EACJ,EAAE,CAAC,YAAY,CAAC,MAAM;YACtB,oBAAoB,CAAC,IAAI,EACzB,sBAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,CAC/B,CAAC;QACJ,CAAC;QACD,QAAQ;YACN,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,yBAAyB;YACvB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,SAAS;YACP,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC;IAEF,MAAM,OAAO,GAAG,EAAE,CAAC,aAAa,CAC9B,CAAC,KAAK,CAAC,QAAQ,CAAC,kBAEd,SAAS,EAAE,IAAI,EACf,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAC9B,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,IAC7C,8CAAqC,CAAC,KAAK,CAAC,GAEjD,YAAY,CACb,CAAC;IAEF,MAAM,GAAG,GAAG,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAClD,IAAI,CAAC,GAAG,EAAE;QACR,MAAM,IAAI,KAAK,CACb,sEAAsE,CACvE,CAAC;KACH;IAED,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;AAC1B,CAAC;AAEQ,sDAAqB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.d.ts b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.d.ts new file mode 100644 index 000000000..04a7e1032 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.d.ts @@ -0,0 +1,11 @@ +import { Extra } from '../parser-options'; +import { ASTAndProgram } from './shared'; +/** + * @param code The code of the file being linted + * @param createDefaultProgram True if the default program should be created + * @param extra The config object + * @returns If found, returns the source file corresponding to the code and the containing program + */ +declare function createProjectProgram(code: string, createDefaultProgram: boolean, extra: Extra): ASTAndProgram | undefined; +export { createProjectProgram }; +//# sourceMappingURL=createProjectProgram.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.d.ts.map new file mode 100644 index 000000000..18380901c --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"createProjectProgram.d.ts","sourceRoot":"","sources":["../../src/create-program/createProjectProgram.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAazC;;;;;GAKG;AACH,iBAAS,oBAAoB,CAC3B,IAAI,EAAE,MAAM,EACZ,oBAAoB,EAAE,OAAO,EAC7B,KAAK,EAAE,KAAK,GACX,aAAa,GAAG,SAAS,CAyE3B;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js new file mode 100644 index 000000000..917330b7e --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js @@ -0,0 +1,75 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createProjectProgram = void 0; +const debug_1 = __importDefault(require("debug")); +const path_1 = __importDefault(require("path")); +const createWatchProgram_1 = require("./createWatchProgram"); +const node_utils_1 = require("../node-utils"); +const log = debug_1.default('typescript-eslint:typescript-estree:createProjectProgram'); +const DEFAULT_EXTRA_FILE_EXTENSIONS = ['.ts', '.tsx', '.js', '.jsx']; +function getExtension(fileName) { + if (!fileName) { + return null; + } + return fileName.endsWith('.d.ts') ? '.d.ts' : path_1.default.extname(fileName); +} +/** + * @param code The code of the file being linted + * @param createDefaultProgram True if the default program should be created + * @param extra The config object + * @returns If found, returns the source file corresponding to the code and the containing program + */ +function createProjectProgram(code, createDefaultProgram, extra) { + log('Creating project program for: %s', extra.filePath); + const astAndProgram = node_utils_1.firstDefined(createWatchProgram_1.getProgramsForProjects(code, extra.filePath, extra), currentProgram => { + const ast = currentProgram.getSourceFile(extra.filePath); + // working around https://github.com/typescript-eslint/typescript-eslint/issues/1573 + const expectedExt = getExtension(extra.filePath); + const returnedExt = getExtension(ast === null || ast === void 0 ? void 0 : ast.fileName); + if (expectedExt !== returnedExt) { + return; + } + return ast && { ast, program: currentProgram }; + }); + if (!astAndProgram && !createDefaultProgram) { + // the file was either not matched within the tsconfig, or the extension wasn't expected + const errorLines = [ + '"parserOptions.project" has been set for @typescript-eslint/parser.', + `The file does not match your project config: ${path_1.default.relative(extra.tsconfigRootDir || process.cwd(), extra.filePath)}.`, + ]; + let hasMatchedAnError = false; + const extraFileExtensions = extra.extraFileExtensions || []; + extraFileExtensions.forEach(extraExtension => { + if (!extraExtension.startsWith('.')) { + errorLines.push(`Found unexpected extension "${extraExtension}" specified with the "extraFileExtensions" option. Did you mean ".${extraExtension}"?`); + } + if (DEFAULT_EXTRA_FILE_EXTENSIONS.includes(extraExtension)) { + errorLines.push(`You unnecessarily included the extension "${extraExtension}" with the "extraFileExtensions" option. This extension is already handled by the parser by default.`); + } + }); + const fileExtension = path_1.default.extname(extra.filePath); + if (!DEFAULT_EXTRA_FILE_EXTENSIONS.includes(fileExtension)) { + const nonStandardExt = `The extension for the file (${fileExtension}) is non-standard`; + if (extraFileExtensions.length > 0) { + if (!extraFileExtensions.includes(fileExtension)) { + errorLines.push(`${nonStandardExt}. It should be added to your existing "parserOptions.extraFileExtensions".`); + hasMatchedAnError = true; + } + } + else { + errorLines.push(`${nonStandardExt}. You should add "parserOptions.extraFileExtensions" to your config.`); + hasMatchedAnError = true; + } + } + if (!hasMatchedAnError) { + errorLines.push('The file must be included in at least one of the projects provided.'); + } + throw new Error(errorLines.join('\n')); + } + return astAndProgram; +} +exports.createProjectProgram = createProjectProgram; +//# sourceMappingURL=createProjectProgram.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js.map new file mode 100644 index 000000000..a39bb006e --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js.map @@ -0,0 +1 @@ +{"version":3,"file":"createProjectProgram.js","sourceRoot":"","sources":["../../src/create-program/createProjectProgram.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,gDAAwB;AACxB,6DAA8D;AAC9D,8CAA6C;AAI7C,MAAM,GAAG,GAAG,eAAK,CAAC,0DAA0D,CAAC,CAAC;AAE9E,MAAM,6BAA6B,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAErE,SAAS,YAAY,CAAC,QAA4B;IAChD,IAAI,CAAC,QAAQ,EAAE;QACb,OAAO,IAAI,CAAC;KACb;IACD,OAAO,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AACvE,CAAC;AAED;;;;;GAKG;AACH,SAAS,oBAAoB,CAC3B,IAAY,EACZ,oBAA6B,EAC7B,KAAY;IAEZ,GAAG,CAAC,kCAAkC,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAExD,MAAM,aAAa,GAAG,yBAAY,CAChC,2CAAsB,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,EACnD,cAAc,CAAC,EAAE;QACf,MAAM,GAAG,GAAG,cAAc,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAEzD,oFAAoF;QACpF,MAAM,WAAW,GAAG,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACjD,MAAM,WAAW,GAAG,YAAY,CAAC,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,QAAQ,CAAC,CAAC;Q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,IAAI,CAAC;iBAC1B;aACF;iBAAM;gBACL,UAAU,CAAC,IAAI,CACb,GAAG,cAAc,sEAAsE,CACxF,CAAC;gBACF,iBAAiB,GAAG,IAAI,CAAC;aAC1B;SACF;QAED,IAAI,CAAC,iBAAiB,EAAE;YACtB,UAAU,CAAC,IAAI,CACb,qEAAqE,CACtE,CAAC;SACH;QAED,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;KACxC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC;AAEQ,oDAAoB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.d.ts b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.d.ts new file mode 100644 index 000000000..340cdd985 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.d.ts @@ -0,0 +1,5 @@ +import * as ts from 'typescript'; +import { Extra } from '../parser-options'; +declare function createSourceFile(code: string, extra: Extra): ts.SourceFile; +export { createSourceFile }; +//# sourceMappingURL=createSourceFile.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.d.ts.map new file mode 100644 index 000000000..68f375dac --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"createSourceFile.d.ts","sourceRoot":"","sources":["../../src/create-program/createSourceFile.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAK1C,iBAAS,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,EAAE,CAAC,UAAU,CAcnE;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.js b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.js new file mode 100644 index 000000000..910a1fa36 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.js @@ -0,0 +1,36 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createSourceFile = void 0; +const debug_1 = __importDefault(require("debug")); +const ts = __importStar(require("typescript")); +const shared_1 = require("./shared"); +const log = debug_1.default('typescript-eslint:typescript-estree:createSourceFile'); +function createSourceFile(code, extra) { + log('Getting AST without type information in %s mode for: %s', extra.jsx ? 'TSX' : 'TS', extra.filePath); + return ts.createSourceFile(extra.filePath, code, ts.ScriptTarget.Latest, + /* setParentNodes */ true, shared_1.getScriptKind(extra)); +} +exports.createSourceFile = createSourceFile; +//# sourceMappingURL=createSourceFile.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.js.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.js.map new file mode 100644 index 000000000..693f43c7a --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.js.map @@ -0,0 +1 @@ +{"version":3,"file":"createSourceFile.js","sourceRoot":"","sources":["../../src/create-program/createSourceFile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,+CAAiC;AAEjC,qCAAyC;AAEzC,MAAM,GAAG,GAAG,eAAK,CAAC,sDAAsD,CAAC,CAAC;AAE1E,SAAS,gBAAgB,CAAC,IAAY,EAAE,KAAY;IAClD,GAAG,CACD,yDAAyD,EACzD,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EACxB,KAAK,CAAC,QAAQ,CACf,CAAC;IAEF,OAAO,EAAE,CAAC,gBAAgB,CACxB,KAAK,CAAC,QAAQ,EACd,IAAI,EACJ,EAAE,CAAC,YAAY,CAAC,MAAM;IACtB,oBAAoB,CAAC,IAAI,EACzB,sBAAa,CAAC,KAAK,CAAC,CACrB,CAAC;AACJ,CAAC;AAEQ,4CAAgB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.d.ts b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.d.ts new file mode 100644 index 000000000..af73e0c66 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.d.ts @@ -0,0 +1,19 @@ +import * as ts from 'typescript'; +import { Extra } from '../parser-options'; +/** + * Clear all of the parser caches. + * This should only be used in testing to ensure the parser is clean between tests. + */ +declare function clearCaches(): void; +/** + * Calculate project environments using options provided by consumer and paths from config + * @param code The code being linted + * @param filePathIn The path of the file being parsed + * @param extra.tsconfigRootDir The root directory for relative tsconfig paths + * @param extra.projects Provided tsconfig paths + * @returns The programs corresponding to the supplied tsconfig paths + */ +declare function getProgramsForProjects(code: string, filePathIn: string, extra: Extra): ts.Program[]; +declare function createWatchProgram(tsconfigPath: string, extra: Extra): ts.WatchOfConfigFile; +export { clearCaches, createWatchProgram, getProgramsForProjects }; +//# sourceMappingURL=createWatchProgram.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.d.ts.map new file mode 100644 index 000000000..5e6bce836 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"createWatchProgram.d.ts","sourceRoot":"","sources":["../../src/create-program/createWatchProgram.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AA6C1C;;;GAGG;AACH,iBAAS,WAAW,IAAI,IAAI,CAO3B;AA2DD;;;;;;;GAOG;AACH,iBAAS,sBAAsB,CAC7B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,KAAK,GACX,EAAE,CAAC,OAAO,EAAE,CAgGd;AAMD,iBAAS,kBAAkB,CACzB,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,KAAK,GACX,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC,cAAc,CAAC,CAwHzC;AAoJD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.js b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.js new file mode 100644 index 000000000..fe0366330 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.js @@ -0,0 +1,388 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getProgramsForProjects = exports.createWatchProgram = exports.clearCaches = void 0; +const debug_1 = __importDefault(require("debug")); +const fs_1 = __importDefault(require("fs")); +const semver_1 = __importDefault(require("semver")); +const ts = __importStar(require("typescript")); +const shared_1 = require("./shared"); +const log = debug_1.default('typescript-eslint:typescript-estree:createWatchProgram'); +/** + * Maps tsconfig paths to their corresponding file contents and resulting watches + */ +const knownWatchProgramMap = new Map(); +/** + * Maps file/folder paths to their set of corresponding watch callbacks + * There may be more than one per file/folder if a file/folder is shared between projects + */ +const fileWatchCallbackTrackingMap = new Map(); +const folderWatchCallbackTrackingMap = new Map(); +/** + * Stores the list of known files for each program + */ +const programFileListCache = new Map(); +/** + * Caches the last modified time of the tsconfig files + */ +const tsconfigLastModifiedTimestampCache = new Map(); +const parsedFilesSeenHash = new Map(); +/** + * Clear all of the parser caches. + * This should only be used in testing to ensure the parser is clean between tests. + */ +function clearCaches() { + knownWatchProgramMap.clear(); + fileWatchCallbackTrackingMap.clear(); + folderWatchCallbackTrackingMap.clear(); + parsedFilesSeenHash.clear(); + programFileListCache.clear(); + tsconfigLastModifiedTimestampCache.clear(); +} +exports.clearCaches = clearCaches; +function saveWatchCallback(trackingMap) { + return (fileName, callback) => { + const normalizedFileName = shared_1.getCanonicalFileName(fileName); + const watchers = (() => { + let watchers = trackingMap.get(normalizedFileName); + if (!watchers) { + watchers = new Set(); + trackingMap.set(normalizedFileName, watchers); + } + return watchers; + })(); + watchers.add(callback); + return { + close: () => { + watchers.delete(callback); + }, + }; + }; +} +/** + * Holds information about the file currently being linted + */ +const currentLintOperationState = { + code: '', + filePath: '', +}; +/** + * Appropriately report issues found when reading a config file + * @param diagnostic The diagnostic raised when creating a program + */ +function diagnosticReporter(diagnostic) { + throw new Error(ts.flattenDiagnosticMessageText(diagnostic.messageText, ts.sys.newLine)); +} +/** + * Hash content for compare content. + * @param content hashed contend + * @returns hashed result + */ +function createHash(content) { + var _a; + // No ts.sys in browser environments. + if ((_a = ts.sys) === null || _a === void 0 ? void 0 : _a.createHash) { + return ts.sys.createHash(content); + } + return content; +} +/** + * Calculate project environments using options provided by consumer and paths from config + * @param code The code being linted + * @param filePathIn The path of the file being parsed + * @param extra.tsconfigRootDir The root directory for relative tsconfig paths + * @param extra.projects Provided tsconfig paths + * @returns The programs corresponding to the supplied tsconfig paths + */ +function getProgramsForProjects(code, filePathIn, extra) { + const filePath = shared_1.getCanonicalFileName(filePathIn); + const results = []; + // preserve reference to code and file being linted + currentLintOperationState.code = code; + currentLintOperationState.filePath = filePath; + // Update file version if necessary + const fileWatchCallbacks = fileWatchCallbackTrackingMap.get(filePath); + const codeHash = createHash(code); + if (parsedFilesSeenHash.get(filePath) !== codeHash && + fileWatchCallbacks && + fileWatchCallbacks.size > 0) { + fileWatchCallbacks.forEach(cb => cb(filePath, ts.FileWatcherEventKind.Changed)); + } + /* + * before we go into the process of attempting to find and update every program + * see if we know of a program that contains this file + */ + for (const rawTsconfigPath of extra.projects) { + const tsconfigPath = shared_1.getTsconfigPath(rawTsconfigPath, extra); + const existingWatch = knownWatchProgramMap.get(tsconfigPath); + if (!existingWatch) { + continue; + } + let fileList = programFileListCache.get(tsconfigPath); + let updatedProgram = null; + if (!fileList) { + updatedProgram = existingWatch.getProgram().getProgram(); + fileList = new Set(updatedProgram.getRootFileNames().map(f => shared_1.getCanonicalFileName(f))); + programFileListCache.set(tsconfigPath, fileList); + } + if (fileList.has(filePath)) { + log('Found existing program for file. %s', filePath); + updatedProgram = updatedProgram !== null && updatedProgram !== void 0 ? updatedProgram : existingWatch.getProgram().getProgram(); + // sets parent pointers in source files + updatedProgram.getTypeChecker(); + return [updatedProgram]; + } + } + log('File did not belong to any existing programs, moving to create/update. %s', filePath); + /* + * We don't know of a program that contains the file, this means that either: + * - the required program hasn't been created yet, or + * - the file is new/renamed, and the program hasn't been updated. + */ + for (const rawTsconfigPath of extra.projects) { + const tsconfigPath = shared_1.getTsconfigPath(rawTsconfigPath, extra); + const existingWatch = knownWatchProgramMap.get(tsconfigPath); + if (existingWatch) { + const updatedProgram = maybeInvalidateProgram(existingWatch, filePath, tsconfigPath); + if (!updatedProgram) { + continue; + } + // sets parent pointers in source files + updatedProgram.getTypeChecker(); + results.push(updatedProgram); + continue; + } + const programWatch = createWatchProgram(tsconfigPath, extra); + const program = programWatch.getProgram().getProgram(); + // cache watch program and return current program + knownWatchProgramMap.set(tsconfigPath, programWatch); + // sets parent pointers in source files + program.getTypeChecker(); + results.push(program); + } + return results; +} +exports.getProgramsForProjects = getProgramsForProjects; +const isRunningNoTimeoutFix = semver_1.default.satisfies(ts.version, '>=3.9.0-beta', { + includePrerelease: true, +}); +function createWatchProgram(tsconfigPath, extra) { + log('Creating watch program for %s.', tsconfigPath); + // create compiler host + const watchCompilerHost = ts.createWatchCompilerHost(tsconfigPath, shared_1.createDefaultCompilerOptionsFromExtra(extra), ts.sys, ts.createAbstractBuilder, diagnosticReporter, + /*reportWatchStatus*/ () => { }); + // ensure readFile reads the code being linted instead of the copy on disk + const oldReadFile = watchCompilerHost.readFile; + watchCompilerHost.readFile = (filePathIn, encoding) => { + const filePath = shared_1.getCanonicalFileName(filePathIn); + const fileContent = filePath === currentLintOperationState.filePath + ? currentLintOperationState.code + : oldReadFile(filePath, encoding); + if (fileContent !== undefined) { + parsedFilesSeenHash.set(filePath, createHash(fileContent)); + } + return fileContent; + }; + // ensure process reports error on failure instead of exiting process immediately + watchCompilerHost.onUnRecoverableConfigFileDiagnostic = diagnosticReporter; + // ensure process doesn't emit programs + watchCompilerHost.afterProgramCreate = (program) => { + // report error if there are any errors in the config file + const configFileDiagnostics = program + .getConfigFileParsingDiagnostics() + .filter(diag => diag.category === ts.DiagnosticCategory.Error && diag.code !== 18003); + if (configFileDiagnostics.length > 0) { + diagnosticReporter(configFileDiagnostics[0]); + } + }; + /* + * From the CLI, the file watchers won't matter, as the files will be parsed once and then forgotten. + * When running from an IDE, these watchers will let us tell typescript about changes. + * + * ESLint IDE plugins will send us unfinished file content as the user types (before it's saved to disk). + * We use the file watchers to tell typescript about this latest file content. + * + * When files are created (or renamed), we won't know about them because we have no filesystem watchers attached. + * We use the folder watchers to tell typescript it needs to go and find new files in the project folders. + */ + watchCompilerHost.watchFile = saveWatchCallback(fileWatchCallbackTrackingMap); + watchCompilerHost.watchDirectory = saveWatchCallback(folderWatchCallbackTrackingMap); + // allow files with custom extensions to be included in program (uses internal ts api) + const oldOnDirectoryStructureHostCreate = watchCompilerHost.onCachedDirectoryStructureHostCreate; + watchCompilerHost.onCachedDirectoryStructureHostCreate = (host) => { + const oldReadDirectory = host.readDirectory; + host.readDirectory = (path, extensions, exclude, include, depth) => oldReadDirectory(path, !extensions ? undefined : extensions.concat(extra.extraFileExtensions), exclude, include, depth); + oldOnDirectoryStructureHostCreate(host); + }; + // This works only on 3.9 + watchCompilerHost.extraFileExtensions = extra.extraFileExtensions.map(extension => ({ + extension, + isMixedContent: true, + scriptKind: ts.ScriptKind.Deferred, + })); + watchCompilerHost.trace = log; + // Since we don't want to asynchronously update program we want to disable timeout methods + // So any changes in the program will be delayed and updated when getProgram is called on watch + let callback; + if (isRunningNoTimeoutFix) { + watchCompilerHost.setTimeout = undefined; + watchCompilerHost.clearTimeout = undefined; + } + else { + log('Running without timeout fix'); + // But because of https://github.com/microsoft/TypeScript/pull/37308 we cannot just set it to undefined + // instead save it and call before getProgram is called + watchCompilerHost.setTimeout = (cb, _ms, ...args) => { + callback = cb.bind(/*this*/ undefined, ...args); + return callback; + }; + watchCompilerHost.clearTimeout = () => { + callback = undefined; + }; + } + const watch = ts.createWatchProgram(watchCompilerHost); + if (!isRunningNoTimeoutFix) { + const originalGetProgram = watch.getProgram; + watch.getProgram = () => { + if (callback) { + callback(); + } + callback = undefined; + return originalGetProgram.call(watch); + }; + } + return watch; +} +exports.createWatchProgram = createWatchProgram; +function hasTSConfigChanged(tsconfigPath) { + const stat = fs_1.default.statSync(tsconfigPath); + const lastModifiedAt = stat.mtimeMs; + const cachedLastModifiedAt = tsconfigLastModifiedTimestampCache.get(tsconfigPath); + tsconfigLastModifiedTimestampCache.set(tsconfigPath, lastModifiedAt); + if (cachedLastModifiedAt === undefined) { + return false; + } + return Math.abs(cachedLastModifiedAt - lastModifiedAt) > Number.EPSILON; +} +function maybeInvalidateProgram(existingWatch, filePath, tsconfigPath) { + /* + * By calling watchProgram.getProgram(), it will trigger a resync of the program based on + * whatever new file content we've given it from our input. + */ + let updatedProgram = existingWatch.getProgram().getProgram(); + // In case this change causes problems in larger real world codebases + // Provide an escape hatch so people don't _have_ to revert to an older version + if (process.env.TSESTREE_NO_INVALIDATION === 'true') { + return updatedProgram; + } + if (hasTSConfigChanged(tsconfigPath)) { + /* + * If the stat of the tsconfig has changed, that could mean the include/exclude/files lists has changed + * We need to make sure typescript knows this so it can update appropriately + */ + log('tsconfig has changed - triggering program update. %s', tsconfigPath); + fileWatchCallbackTrackingMap + .get(tsconfigPath) + .forEach(cb => cb(tsconfigPath, ts.FileWatcherEventKind.Changed)); + // tsconfig change means that the file list more than likely changed, so clear the cache + programFileListCache.delete(tsconfigPath); + } + let sourceFile = updatedProgram.getSourceFile(filePath); + if (sourceFile) { + return updatedProgram; + } + /* + * Missing source file means our program's folder structure might be out of date. + * So we need to tell typescript it needs to update the correct folder. + */ + log('File was not found in program - triggering folder update. %s', filePath); + // Find the correct directory callback by climbing the folder tree + const currentDir = shared_1.canonicalDirname(filePath); + let current = null; + let next = currentDir; + let hasCallback = false; + while (current !== next) { + current = next; + const folderWatchCallbacks = folderWatchCallbackTrackingMap.get(current); + if (folderWatchCallbacks) { + folderWatchCallbacks.forEach(cb => { + if (currentDir !== current) { + cb(currentDir, ts.FileWatcherEventKind.Changed); + } + cb(current, ts.FileWatcherEventKind.Changed); + }); + hasCallback = true; + } + next = shared_1.canonicalDirname(current); + } + if (!hasCallback) { + /* + * No callback means the paths don't matchup - so no point returning any program + * this will signal to the caller to skip this program + */ + log('No callback found for file, not part of this program. %s', filePath); + return null; + } + // directory update means that the file list more than likely changed, so clear the cache + programFileListCache.delete(tsconfigPath); + // force the immediate resync + updatedProgram = existingWatch.getProgram().getProgram(); + sourceFile = updatedProgram.getSourceFile(filePath); + if (sourceFile) { + return updatedProgram; + } + /* + * At this point we're in one of two states: + * - The file isn't supposed to be in this program due to exclusions + * - The file is new, and was renamed from an old, included filename + * + * For the latter case, we need to tell typescript that the old filename is now deleted + */ + log('File was still not found in program after directory update - checking file deletions. %s', filePath); + const rootFilenames = updatedProgram.getRootFileNames(); + // use find because we only need to "delete" one file to cause typescript to do a full resync + const deletedFile = rootFilenames.find(file => !fs_1.default.existsSync(file)); + if (!deletedFile) { + // There are no deleted files, so it must be the former case of the file not belonging to this program + return null; + } + const fileWatchCallbacks = fileWatchCallbackTrackingMap.get(shared_1.getCanonicalFileName(deletedFile)); + if (!fileWatchCallbacks) { + // shouldn't happen, but just in case + log('Could not find watch callbacks for root file. %s', deletedFile); + return updatedProgram; + } + log('Marking file as deleted. %s', deletedFile); + fileWatchCallbacks.forEach(cb => cb(deletedFile, ts.FileWatcherEventKind.Deleted)); + // deleted files means that the file list _has_ changed, so clear the cache + programFileListCache.delete(tsconfigPath); + updatedProgram = existingWatch.getProgram().getProgram(); + sourceFile = updatedProgram.getSourceFile(filePath); + if (sourceFile) { + return updatedProgram; + } + log('File was still not found in program after deletion check, assuming it is not part of this program. %s', filePath); + return null; +} +//# sourceMappingURL=createWatchProgram.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.js.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.js.map new file mode 100644 index 000000000..326e15ae2 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.js.map @@ -0,0 +1 @@ +{"version":3,"file":"createWatchProgram.js","sourceRoot":"","sources":["../../src/create-program/createWatchProgram.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,4CAAoB;AACpB,oDAA4B;AAC5B,+CAAiC;AAGjC,qCAMkB;AAElB,MAAM,GAAG,GAAG,eAAK,CAAC,wDAAwD,CAAC,CAAC;AAE5E;;GAEG;AACH,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAGjC,CAAC;AAEJ;;;GAGG;AACH,MAAM,4BAA4B,GAAG,IAAI,GAAG,EAGzC,CAAC;AACJ,MAAM,8BAA8B,GAAG,IAAI,GAAG,EAG3C,CAAC;AAEJ;;GAEG;AACH,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAAqC,CAAC;AAE1E;;GAEG;AACH,MAAM,kCAAkC,GAAG,IAAI,GAAG,EAAyB,CAAC;AAE5E,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAyB,CAAC;AAE7D;;;GAGG;AACH,SAAS,WAAW;IAClB,oBAAoB,CAAC,KAAK,EAAE,CAAC;IAC7B,4BAA4B,CAAC,KAAK,EAAE,CAAC;IACrC,8BAA8B,CAAC,KAAK,EAAE,CAAC;IACvC,mBAAmB,CAAC,KAAK,EAAE,CAAC;IAC5B,oBAAoB,CAAC,KAAK,EAAE,CAAC;IAC7B,kCAAkC,CAAC,KAAK,EAAE,CAAC;AAC7C,CAAC;AA4bQ,kCAAW;AA1bpB,SAAS,iBAAiB,CACxB,WAAqD;IAErD,OAAO,CACL,QAAgB,EAChB,QAAgC,EAChB,EAAE;QAClB,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QACvB,qCAAqC;QACrC,GAAG,CAAC,kDAAkD,EAAE,WAAW,CAAC,CAAC;QACrE,OAAO,cAAc,CAAC;KACvB;IAED,GAAG,CAAC,6BAA6B,EAAE,WAAW,CAAC,CAAC;IAChD,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAC9B,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,oBAAoB,CAAC,OAAO,CAAC,CACjD,CAAC;IAEF,2EAA2E;IAC3E,oBAAoB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAE1C,cAAc,GAAG,aAAa,CAAC,UAAU,EAAE,CAAC,UAAU,EAAE,CAAC;IACzD,UAAU,GAAG,cAAc,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACpD,IAAI,UAAU,EAAE;QACd,OAAO,cAAc,CAAC;KACvB;IAED,GAAG,CACD,uGAAuG,EACvG,QAAQ,CACT,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.d.ts b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.d.ts new file mode 100644 index 000000000..ea10a4804 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.d.ts @@ -0,0 +1,17 @@ +import * as ts from 'typescript'; +import { Extra } from '../parser-options'; +interface ASTAndProgram { + ast: ts.SourceFile; + program: ts.Program; +} +declare function createDefaultCompilerOptionsFromExtra(extra: Extra): ts.CompilerOptions; +declare type CanonicalPath = string & { + __brand: unknown; +}; +declare function getCanonicalFileName(filePath: string): CanonicalPath; +declare function ensureAbsolutePath(p: string, extra: Extra): string; +declare function getTsconfigPath(tsconfigPath: string, extra: Extra): CanonicalPath; +declare function canonicalDirname(p: CanonicalPath): CanonicalPath; +declare function getScriptKind(extra: Extra, filePath?: string): ts.ScriptKind; +export { ASTAndProgram, canonicalDirname, CanonicalPath, createDefaultCompilerOptionsFromExtra, ensureAbsolutePath, getCanonicalFileName, getScriptKind, getTsconfigPath, }; +//# sourceMappingURL=shared.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.d.ts.map new file mode 100644 index 000000000..3e22bc40a --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/create-program/shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,UAAU,aAAa;IACrB,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC;IACnB,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC;CACrB;AAkBD,iBAAS,qCAAqC,CAC5C,KAAK,EAAE,KAAK,GACX,EAAE,CAAC,eAAe,CASpB;AAGD,aAAK,aAAa,GAAG,MAAM,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AASnD,iBAAS,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa,CAM7D;AAED,iBAAS,kBAAkB,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,MAAM,CAI3D;AAED,iBAAS,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,aAAa,CAE1E;AAED,iBAAS,gBAAgB,CAAC,CAAC,EAAE,aAAa,GAAG,aAAa,CAEzD;AAED,iBAAS,aAAa,CACpB,KAAK,EAAE,KAAK,EACZ,QAAQ,GAAE,MAAuB,GAChC,EAAE,CAAC,UAAU,CAwBf;AAED,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,qCAAqC,EACrC,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,eAAe,GAChB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.js b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.js new file mode 100644 index 000000000..5e8c1986f --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.js @@ -0,0 +1,98 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getTsconfigPath = exports.getScriptKind = exports.getCanonicalFileName = exports.ensureAbsolutePath = exports.createDefaultCompilerOptionsFromExtra = exports.canonicalDirname = void 0; +const path_1 = __importDefault(require("path")); +const ts = __importStar(require("typescript")); +/** + * Default compiler options for program generation from single root file + */ +const DEFAULT_COMPILER_OPTIONS = { + allowNonTsExtensions: true, + allowJs: true, + checkJs: true, + noEmit: true, + // extendedDiagnostics: true, + /** + * Flags required to make no-unused-vars work + */ + noUnusedLocals: true, + noUnusedParameters: true, +}; +function createDefaultCompilerOptionsFromExtra(extra) { + if (extra.debugLevel.has('typescript')) { + return Object.assign(Object.assign({}, DEFAULT_COMPILER_OPTIONS), { extendedDiagnostics: true }); + } + return DEFAULT_COMPILER_OPTIONS; +} +exports.createDefaultCompilerOptionsFromExtra = createDefaultCompilerOptionsFromExtra; +// typescript doesn't provide a ts.sys implementation for browser environments +const useCaseSensitiveFileNames = ts.sys !== undefined ? ts.sys.useCaseSensitiveFileNames : true; +const correctPathCasing = useCaseSensitiveFileNames + ? (filePath) => filePath + : (filePath) => filePath.toLowerCase(); +function getCanonicalFileName(filePath) { + let normalized = path_1.default.normalize(filePath); + if (normalized.endsWith(path_1.default.sep)) { + normalized = normalized.substr(0, normalized.length - 1); + } + return correctPathCasing(normalized); +} +exports.getCanonicalFileName = getCanonicalFileName; +function ensureAbsolutePath(p, extra) { + return path_1.default.isAbsolute(p) + ? p + : path_1.default.join(extra.tsconfigRootDir || process.cwd(), p); +} +exports.ensureAbsolutePath = ensureAbsolutePath; +function getTsconfigPath(tsconfigPath, extra) { + return getCanonicalFileName(ensureAbsolutePath(tsconfigPath, extra)); +} +exports.getTsconfigPath = getTsconfigPath; +function canonicalDirname(p) { + return path_1.default.dirname(p); +} +exports.canonicalDirname = canonicalDirname; +function getScriptKind(extra, filePath = extra.filePath) { + const extension = path_1.default.extname(filePath).toLowerCase(); + // note - we respect the user's extension when it is known we could override it and force it to match their + // jsx setting, but that could create weird situations where we throw parse errors when TSC doesn't + switch (extension) { + case '.ts': + return ts.ScriptKind.TS; + case '.tsx': + return ts.ScriptKind.TSX; + case '.js': + return ts.ScriptKind.JS; + case '.jsx': + return ts.ScriptKind.JSX; + case '.json': + return ts.ScriptKind.JSON; + default: + // unknown extension, force typescript to ignore the file extension, and respect the user's setting + return extra.jsx ? ts.ScriptKind.TSX : ts.ScriptKind.TS; + } +} +exports.getScriptKind = getScriptKind; +//# sourceMappingURL=shared.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.js.map b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.js.map new file mode 100644 index 000000000..30f05b202 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.js.map @@ -0,0 +1 @@ +{"version":3,"file":"shared.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ASC,sCAAa"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/index.d.ts b/node_modules/@typescript-eslint/typescript-estree/dist/index.d.ts new file mode 100644 index 000000000..14e0d8b7a --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/index.d.ts @@ -0,0 +1,8 @@ +export { AST, parse, parseAndGenerateServices, ParseAndGenerateServicesResult, } from './parser'; +export { ParserServices, TSESTreeOptions } from './parser-options'; +export { simpleTraverse } from './simple-traverse'; +export * from './ts-estree'; +export { clearCaches } from './create-program/createWatchProgram'; +export { visitorKeys } from '@typescript-eslint/visitor-keys'; +export declare const version: string; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/index.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/index.d.ts.map new file mode 100644 index 000000000..41ffbdc63 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG,EACH,KAAK,EACL,wBAAwB,EACxB,8BAA8B,GAC/B,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAGlE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAG9D,eAAO,MAAM,OAAO,EAAE,MAA2C,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/index.js b/node_modules/@typescript-eslint/typescript-estree/dist/index.js new file mode 100644 index 000000000..4df304cb2 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/index.js @@ -0,0 +1,27 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.version = exports.visitorKeys = exports.clearCaches = exports.simpleTraverse = exports.parseAndGenerateServices = exports.parse = void 0; +var parser_1 = require("./parser"); +Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return parser_1.parse; } }); +Object.defineProperty(exports, "parseAndGenerateServices", { enumerable: true, get: function () { return parser_1.parseAndGenerateServices; } }); +var simple_traverse_1 = require("./simple-traverse"); +Object.defineProperty(exports, "simpleTraverse", { enumerable: true, get: function () { return simple_traverse_1.simpleTraverse; } }); +__exportStar(require("./ts-estree"), exports); +var createWatchProgram_1 = require("./create-program/createWatchProgram"); +Object.defineProperty(exports, "clearCaches", { enumerable: true, get: function () { return createWatchProgram_1.clearCaches; } }); +// re-export for backwards-compat +var visitor_keys_1 = require("@typescript-eslint/visitor-keys"); +Object.defineProperty(exports, "visitorKeys", { enumerable: true, get: function () { return visitor_keys_1.visitorKeys; } }); +// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder +exports.version = require('../package.json').version; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/index.js.map b/node_modules/@typescript-eslint/typescript-estree/dist/index.js.map new file mode 100644 index 000000000..a17f0a342 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mCAKkB;AAHhB,+FAAA,KAAK,OAAA;AACL,kHAAA,wBAAwB,OAAA;AAI1B,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AACvB,8CAA4B;AAC5B,0EAAkE;AAAzD,iHAAA,WAAW,OAAA;AAEpB,iCAAiC;AACjC,gEAA8D;AAArD,2GAAA,WAAW,OAAA;AAEpB,sHAAsH;AACzG,QAAA,OAAO,GAAW,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.d.ts b/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.d.ts new file mode 100644 index 000000000..e9b5d410e --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.d.ts @@ -0,0 +1,282 @@ +import * as ts from 'typescript'; +import { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree } from './ts-estree'; +declare const SyntaxKind: typeof ts.SyntaxKind; +interface TokenToText { + [SyntaxKind.OpenBraceToken]: '{'; + [SyntaxKind.CloseBraceToken]: '}'; + [SyntaxKind.OpenParenToken]: '('; + [SyntaxKind.CloseParenToken]: ')'; + [SyntaxKind.OpenBracketToken]: '['; + [SyntaxKind.CloseBracketToken]: ']'; + [SyntaxKind.DotToken]: '.'; + [SyntaxKind.DotDotDotToken]: '...'; + [SyntaxKind.SemicolonToken]: ';'; + [SyntaxKind.CommaToken]: ','; + [SyntaxKind.LessThanToken]: '<'; + [SyntaxKind.GreaterThanToken]: '>'; + [SyntaxKind.LessThanEqualsToken]: '<='; + [SyntaxKind.GreaterThanEqualsToken]: '>='; + [SyntaxKind.EqualsEqualsToken]: '=='; + [SyntaxKind.ExclamationEqualsToken]: '!='; + [SyntaxKind.EqualsEqualsEqualsToken]: '==='; + [SyntaxKind.InstanceOfKeyword]: 'instanceof'; + [SyntaxKind.ExclamationEqualsEqualsToken]: '!=='; + [SyntaxKind.EqualsGreaterThanToken]: '=>'; + [SyntaxKind.PlusToken]: '+'; + [SyntaxKind.MinusToken]: '-'; + [SyntaxKind.AsteriskToken]: '*'; + [SyntaxKind.AsteriskAsteriskToken]: '**'; + [SyntaxKind.SlashToken]: '/'; + [SyntaxKind.PercentToken]: '%'; + [SyntaxKind.PlusPlusToken]: '++'; + [SyntaxKind.MinusMinusToken]: '--'; + [SyntaxKind.LessThanLessThanToken]: '<<'; + [SyntaxKind.LessThanSlashToken]: '>'; + [SyntaxKind.GreaterThanGreaterThanGreaterThanToken]: '>>>'; + [SyntaxKind.AmpersandToken]: '&'; + [SyntaxKind.BarToken]: '|'; + [SyntaxKind.CaretToken]: '^'; + [SyntaxKind.ExclamationToken]: '!'; + [SyntaxKind.TildeToken]: '~'; + [SyntaxKind.AmpersandAmpersandToken]: '&&'; + [SyntaxKind.BarBarToken]: '||'; + [SyntaxKind.QuestionToken]: '?'; + [SyntaxKind.ColonToken]: ':'; + [SyntaxKind.EqualsToken]: '='; + [SyntaxKind.PlusEqualsToken]: '+='; + [SyntaxKind.MinusEqualsToken]: '-='; + [SyntaxKind.AsteriskEqualsToken]: '*='; + [SyntaxKind.AsteriskAsteriskEqualsToken]: '**='; + [SyntaxKind.SlashEqualsToken]: '/='; + [SyntaxKind.PercentEqualsToken]: '%='; + [SyntaxKind.LessThanLessThanEqualsToken]: '<<='; + [SyntaxKind.GreaterThanGreaterThanEqualsToken]: '>>='; + [SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken]: '>>>='; + [SyntaxKind.AmpersandEqualsToken]: '&='; + [SyntaxKind.AmpersandAmpersandEqualsToken]: '&&='; + [SyntaxKind.BarEqualsToken]: '|='; + [SyntaxKind.BarBarEqualsToken]: '||='; + [SyntaxKind.CaretEqualsToken]: '^='; + [SyntaxKind.QuestionQuestionEqualsToken]: '??='; + [SyntaxKind.AtToken]: '@'; + [SyntaxKind.InKeyword]: 'in'; + [SyntaxKind.UniqueKeyword]: 'unique'; + [SyntaxKind.KeyOfKeyword]: 'keyof'; + [SyntaxKind.NewKeyword]: 'new'; + [SyntaxKind.ImportKeyword]: 'import'; + [SyntaxKind.ReadonlyKeyword]: 'readonly'; + [SyntaxKind.QuestionQuestionToken]: '??'; + [SyntaxKind.QuestionDotToken]: '?.'; +} +/** + * Returns true if the given ts.Token is the assignment operator + * @param operator the operator token + * @returns is assignment + */ +export declare function isAssignmentOperator(operator: ts.Token): boolean; +/** + * Returns true if the given ts.Token is a logical operator + * @param operator the operator token + * @returns is a logical operator + */ +export declare function isLogicalOperator(operator: ts.Token): boolean; +/** + * Returns the string form of the given TSToken SyntaxKind + * @param kind the token's SyntaxKind + * @returns the token applicable token as a string + */ +export declare function getTextForTokenKind(kind: T): T extends keyof TokenToText ? TokenToText[T] : string | undefined; +/** + * Returns true if the given ts.Node is a valid ESTree class member + * @param node TypeScript AST node + * @returns is valid ESTree class member + */ +export declare function isESTreeClassMember(node: ts.Node): boolean; +/** + * Checks if a ts.Node has a modifier + * @param modifierKind TypeScript SyntaxKind modifier + * @param node TypeScript AST node + * @returns has the modifier specified + */ +export declare function hasModifier(modifierKind: ts.KeywordSyntaxKind, node: ts.Node): boolean; +/** + * Get last last modifier in ast + * @param node TypeScript AST node + * @returns returns last modifier if present or null + */ +export declare function getLastModifier(node: ts.Node): ts.Modifier | null; +/** + * Returns true if the given ts.Token is a comma + * @param token the TypeScript token + * @returns is comma + */ +export declare function isComma(token: ts.Node): boolean; +/** + * Returns true if the given ts.Node is a comment + * @param node the TypeScript node + * @returns is comment + */ +export declare function isComment(node: ts.Node): boolean; +/** + * Returns true if the given ts.Node is a JSDoc comment + * @param node the TypeScript node + * @returns is JSDoc comment + */ +export declare function isJSDocComment(node: ts.Node): boolean; +/** + * Returns the binary expression type of the given ts.Token + * @param operator the operator token + * @returns the binary expression type + */ +export declare function getBinaryExpressionType(operator: ts.Token): AST_NODE_TYPES.AssignmentExpression | AST_NODE_TYPES.LogicalExpression | AST_NODE_TYPES.BinaryExpression; +/** + * Returns line and column data for the given positions, + * @param pos position to check + * @param ast the AST object + * @returns line and column + */ +export declare function getLineAndCharacterFor(pos: number, ast: ts.SourceFile): TSESTree.LineAndColumnData; +/** + * Returns line and column data for the given start and end positions, + * for the given AST + * @param start start data + * @param end end data + * @param ast the AST object + * @returns the loc data + */ +export declare function getLocFor(start: number, end: number, ast: ts.SourceFile): TSESTree.SourceLocation; +/** + * Check whatever node can contain directive + * @param node + * @returns returns true if node can contain directive + */ +export declare function canContainDirective(node: ts.SourceFile | ts.Block | ts.ModuleBlock): boolean; +/** + * Returns range for the given ts.Node + * @param node the ts.Node or ts.Token + * @param ast the AST object + * @returns the range data + */ +export declare function getRange(node: ts.Node, ast: ts.SourceFile): [number, number]; +/** + * Returns true if a given ts.Node is a token + * @param node the ts.Node + * @returns is a token + */ +export declare function isToken(node: ts.Node): boolean; +/** + * Returns true if a given ts.Node is a JSX token + * @param node ts.Node to be checked + * @returns is a JSX token + */ +export declare function isJSXToken(node: ts.Node): boolean; +/** + * Returns the declaration kind of the given ts.Node + * @param node TypeScript AST node + * @returns declaration kind + */ +export declare function getDeclarationKind(node: ts.VariableDeclarationList): 'let' | 'const' | 'var'; +/** + * Gets a ts.Node's accessibility level + * @param node The ts.Node + * @returns accessibility "public", "protected", "private", or null + */ +export declare function getTSNodeAccessibility(node: ts.Node): 'public' | 'protected' | 'private' | null; +/** + * Finds the next token based on the previous one and its parent + * Had to copy this from TS instead of using TS's version because theirs doesn't pass the ast to getChildren + * @param previousToken The previous TSToken + * @param parent The parent TSNode + * @param ast The TS AST + * @returns the next TSToken + */ +export declare function findNextToken(previousToken: ts.TextRange, parent: ts.Node, ast: ts.SourceFile): ts.Node | undefined; +/** + * Find the first matching ancestor based on the given predicate function. + * @param node The current ts.Node + * @param predicate The predicate function to apply to each checked ancestor + * @returns a matching parent ts.Node + */ +export declare function findFirstMatchingAncestor(node: ts.Node, predicate: (node: ts.Node) => boolean): ts.Node | undefined; +/** + * Returns true if a given ts.Node has a JSX token within its hierarchy + * @param node ts.Node to be checked + * @returns has JSX ancestor + */ +export declare function hasJSXAncestor(node: ts.Node): boolean; +/** + * Unescape the text content of string literals, e.g. & -> & + * @param text The escaped string literal text. + * @returns The unescaped string literal text. + */ +export declare function unescapeStringLiteralText(text: string): string; +/** + * Returns true if a given ts.Node is a computed property + * @param node ts.Node to be checked + * @returns is Computed Property + */ +export declare function isComputedProperty(node: ts.Node): boolean; +/** + * Returns true if a given ts.Node is optional (has QuestionToken) + * @param node ts.Node to be checked + * @returns is Optional + */ +export declare function isOptional(node: { + questionToken?: ts.QuestionToken; +}): boolean; +/** + * Returns true if the node is an optional chain node + */ +export declare function isChainExpression(node: TSESTree.Node): node is TSESTree.ChainExpression; +/** + * Returns true of the child of property access expression is an optional chain + */ +export declare function isChildUnwrappableOptionalChain(node: ts.PropertyAccessExpression | ts.ElementAccessExpression | ts.CallExpression | ts.NonNullExpression, child: TSESTree.Node): boolean; +/** + * Returns the type of a given ts.Token + * @param token the ts.Token + * @returns the token type + */ +export declare function getTokenType(token: ts.Identifier | ts.Token): Exclude; +/** + * Extends and formats a given ts.Token, for a given AST + * @param token the ts.Token + * @param ast the AST object + * @returns the converted Token + */ +export declare function convertToken(token: ts.Node, ast: ts.SourceFile): TSESTree.Token; +/** + * Converts all tokens for the given AST + * @param ast the AST object + * @returns the converted Tokens + */ +export declare function convertTokens(ast: ts.SourceFile): TSESTree.Token[]; +export interface TSError { + index: number; + lineNumber: number; + column: number; + message: string; +} +/** + * @param ast the AST object + * @param start the index at which the error starts + * @param message the error message + * @returns converted error object + */ +export declare function createError(ast: ts.SourceFile, start: number, message: string): TSError; +/** + * @param n the TSNode + * @param ast the TS AST + */ +export declare function nodeHasTokens(n: ts.Node, ast: ts.SourceFile): boolean; +/** + * Like `forEach`, but suitable for use with numbers and strings (which may be falsy). + * @template T + * @template U + * @param array + * @param callback + */ +export declare function firstDefined(array: readonly T[] | undefined, callback: (element: T, index: number) => U | undefined): U | undefined; +export {}; +//# sourceMappingURL=node-utils.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.d.ts.map new file mode 100644 index 000000000..f898a2f28 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"node-utils.d.ts","sourceRoot":"","sources":["../src/node-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAExE,QAAA,MAAM,UAAU,sBAAgB,CAAC;AAWjC,UAAU,WAAW;IACnB,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,GAAG,CAAC;IACjC,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,GAAG,CAAC;IAClC,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,GAAG,CAAC;IACjC,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,GAAG,CAAC;IAClC,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,GAAG,CAAC;IACnC,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,GAAG,CAAC;IACpC,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC;IAC3B,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,KAAK,CAAC;IACnC,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,GAAG,CAAC;IACjC,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,GAAG,CAAC;IAC7B,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,GAAG,CAAC;IAChC,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,GAAG,CAAC;IACnC,CAAC,UAAU,CAAC,mBAAmB,CAAC,EAAE,IAAI,CAAC;IACvC,CAAC,UAAU,CAAC,sBAAsB,CAAC,EAAE,IAAI,CAAC;IAC1C,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC;IACrC,CAAC,UAAU,CA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xB,KAAK,EAAE,QAAQ,CAAC,IAAI,GACnB,OAAO,CAUT;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,EAAE,CAAC,UAAU,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,GAC7C,OAAO,CAAC,eAAe,EAAE,eAAe,CAAC,IAAI,GAAG,eAAe,CAAC,KAAK,CAAC,CAwFxE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,EAAE,CAAC,IAAI,EACd,GAAG,EAAE,EAAE,CAAC,UAAU,GACjB,QAAQ,CAAC,KAAK,CA4BhB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,GAAG,QAAQ,CAAC,KAAK,EAAE,CAwBlE;AAED,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,GAAG,EAAE,EAAE,CAAC,UAAU,EAClB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,GACd,OAAO,CAQT;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,UAAU,GAAG,OAAO,CAOrE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,EAC/B,KAAK,EAAE,SAAS,CAAC,EAAE,GAAG,SAAS,EAC/B,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,GAAG,SAAS,GACrD,CAAC,GAAG,SAAS,CAYf"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js b/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js new file mode 100644 index 000000000..05c95cf2f --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js @@ -0,0 +1,543 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.firstDefined = exports.nodeHasTokens = exports.createError = exports.convertTokens = exports.convertToken = exports.getTokenType = exports.isChildUnwrappableOptionalChain = exports.isChainExpression = exports.isOptional = exports.isComputedProperty = exports.unescapeStringLiteralText = exports.hasJSXAncestor = exports.findFirstMatchingAncestor = exports.findNextToken = exports.getTSNodeAccessibility = exports.getDeclarationKind = exports.isJSXToken = exports.isToken = exports.getRange = exports.canContainDirective = exports.getLocFor = exports.getLineAndCharacterFor = exports.getBinaryExpressionType = exports.isJSDocComment = exports.isComment = exports.isComma = exports.getLastModifier = exports.hasModifier = exports.isESTreeClassMember = exports.getTextForTokenKind = exports.isLogicalOperator = exports.isAssignmentOperator = void 0; +const unescape_1 = __importDefault(require("lodash/unescape")); +const ts = __importStar(require("typescript")); +const ts_estree_1 = require("./ts-estree"); +const SyntaxKind = ts.SyntaxKind; +const LOGICAL_OPERATORS = [ + SyntaxKind.BarBarToken, + SyntaxKind.AmpersandAmpersandToken, + SyntaxKind.QuestionQuestionToken, +]; +/** + * Returns true if the given ts.Token is the assignment operator + * @param operator the operator token + * @returns is assignment + */ +function isAssignmentOperator(operator) { + return (operator.kind >= SyntaxKind.FirstAssignment && + operator.kind <= SyntaxKind.LastAssignment); +} +exports.isAssignmentOperator = isAssignmentOperator; +/** + * Returns true if the given ts.Token is a logical operator + * @param operator the operator token + * @returns is a logical operator + */ +function isLogicalOperator(operator) { + return LOGICAL_OPERATORS.includes(operator.kind); +} +exports.isLogicalOperator = isLogicalOperator; +/** + * Returns the string form of the given TSToken SyntaxKind + * @param kind the token's SyntaxKind + * @returns the token applicable token as a string + */ +function getTextForTokenKind(kind) { + return ts.tokenToString(kind); +} +exports.getTextForTokenKind = getTextForTokenKind; +/** + * Returns true if the given ts.Node is a valid ESTree class member + * @param node TypeScript AST node + * @returns is valid ESTree class member + */ +function isESTreeClassMember(node) { + return node.kind !== SyntaxKind.SemicolonClassElement; +} +exports.isESTreeClassMember = isESTreeClassMember; +/** + * Checks if a ts.Node has a modifier + * @param modifierKind TypeScript SyntaxKind modifier + * @param node TypeScript AST node + * @returns has the modifier specified + */ +function hasModifier(modifierKind, node) { + return (!!node.modifiers && + !!node.modifiers.length && + node.modifiers.some(modifier => modifier.kind === modifierKind)); +} +exports.hasModifier = hasModifier; +/** + * Get last last modifier in ast + * @param node TypeScript AST node + * @returns returns last modifier if present or null + */ +function getLastModifier(node) { + return ((!!node.modifiers && + !!node.modifiers.length && + node.modifiers[node.modifiers.length - 1]) || + null); +} +exports.getLastModifier = getLastModifier; +/** + * Returns true if the given ts.Token is a comma + * @param token the TypeScript token + * @returns is comma + */ +function isComma(token) { + return token.kind === SyntaxKind.CommaToken; +} +exports.isComma = isComma; +/** + * Returns true if the given ts.Node is a comment + * @param node the TypeScript node + * @returns is comment + */ +function isComment(node) { + return (node.kind === SyntaxKind.SingleLineCommentTrivia || + node.kind === SyntaxKind.MultiLineCommentTrivia); +} +exports.isComment = isComment; +/** + * Returns true if the given ts.Node is a JSDoc comment + * @param node the TypeScript node + * @returns is JSDoc comment + */ +function isJSDocComment(node) { + return node.kind === SyntaxKind.JSDocComment; +} +exports.isJSDocComment = isJSDocComment; +/** + * Returns the binary expression type of the given ts.Token + * @param operator the operator token + * @returns the binary expression type + */ +function getBinaryExpressionType(operator) { + if (isAssignmentOperator(operator)) { + return ts_estree_1.AST_NODE_TYPES.AssignmentExpression; + } + else if (isLogicalOperator(operator)) { + return ts_estree_1.AST_NODE_TYPES.LogicalExpression; + } + return ts_estree_1.AST_NODE_TYPES.BinaryExpression; +} +exports.getBinaryExpressionType = getBinaryExpressionType; +/** + * Returns line and column data for the given positions, + * @param pos position to check + * @param ast the AST object + * @returns line and column + */ +function getLineAndCharacterFor(pos, ast) { + const loc = ast.getLineAndCharacterOfPosition(pos); + return { + line: loc.line + 1, + column: loc.character, + }; +} +exports.getLineAndCharacterFor = getLineAndCharacterFor; +/** + * Returns line and column data for the given start and end positions, + * for the given AST + * @param start start data + * @param end end data + * @param ast the AST object + * @returns the loc data + */ +function getLocFor(start, end, ast) { + return { + start: getLineAndCharacterFor(start, ast), + end: getLineAndCharacterFor(end, ast), + }; +} +exports.getLocFor = getLocFor; +/** + * Check whatever node can contain directive + * @param node + * @returns returns true if node can contain directive + */ +function canContainDirective(node) { + if (node.kind === ts.SyntaxKind.Block) { + switch (node.parent.kind) { + case ts.SyntaxKind.Constructor: + case ts.SyntaxKind.GetAccessor: + case ts.SyntaxKind.SetAccessor: + case ts.SyntaxKind.ArrowFunction: + case ts.SyntaxKind.FunctionExpression: + case ts.SyntaxKind.FunctionDeclaration: + case ts.SyntaxKind.MethodDeclaration: + return true; + default: + return false; + } + } + return true; +} +exports.canContainDirective = canContainDirective; +/** + * Returns range for the given ts.Node + * @param node the ts.Node or ts.Token + * @param ast the AST object + * @returns the range data + */ +function getRange(node, ast) { + return [node.getStart(ast), node.getEnd()]; +} +exports.getRange = getRange; +/** + * Returns true if a given ts.Node is a token + * @param node the ts.Node + * @returns is a token + */ +function isToken(node) { + return (node.kind >= SyntaxKind.FirstToken && node.kind <= SyntaxKind.LastToken); +} +exports.isToken = isToken; +/** + * Returns true if a given ts.Node is a JSX token + * @param node ts.Node to be checked + * @returns is a JSX token + */ +function isJSXToken(node) { + return (node.kind >= SyntaxKind.JsxElement && node.kind <= SyntaxKind.JsxAttribute); +} +exports.isJSXToken = isJSXToken; +/** + * Returns the declaration kind of the given ts.Node + * @param node TypeScript AST node + * @returns declaration kind + */ +function getDeclarationKind(node) { + if (node.flags & ts.NodeFlags.Let) { + return 'let'; + } + if (node.flags & ts.NodeFlags.Const) { + return 'const'; + } + return 'var'; +} +exports.getDeclarationKind = getDeclarationKind; +/** + * Gets a ts.Node's accessibility level + * @param node The ts.Node + * @returns accessibility "public", "protected", "private", or null + */ +function getTSNodeAccessibility(node) { + const modifiers = node.modifiers; + if (!modifiers) { + return null; + } + for (let i = 0; i < modifiers.length; i++) { + const modifier = modifiers[i]; + switch (modifier.kind) { + case SyntaxKind.PublicKeyword: + return 'public'; + case SyntaxKind.ProtectedKeyword: + return 'protected'; + case SyntaxKind.PrivateKeyword: + return 'private'; + default: + break; + } + } + return null; +} +exports.getTSNodeAccessibility = getTSNodeAccessibility; +/** + * Finds the next token based on the previous one and its parent + * Had to copy this from TS instead of using TS's version because theirs doesn't pass the ast to getChildren + * @param previousToken The previous TSToken + * @param parent The parent TSNode + * @param ast The TS AST + * @returns the next TSToken + */ +function findNextToken(previousToken, parent, ast) { + return find(parent); + function find(n) { + if (ts.isToken(n) && n.pos === previousToken.end) { + // this is token that starts at the end of previous token - return it + return n; + } + return firstDefined(n.getChildren(ast), (child) => { + const shouldDiveInChildNode = + // previous token is enclosed somewhere in the child + (child.pos <= previousToken.pos && child.end > previousToken.end) || + // previous token ends exactly at the beginning of child + child.pos === previousToken.end; + return shouldDiveInChildNode && nodeHasTokens(child, ast) + ? find(child) + : undefined; + }); + } +} +exports.findNextToken = findNextToken; +/** + * Find the first matching ancestor based on the given predicate function. + * @param node The current ts.Node + * @param predicate The predicate function to apply to each checked ancestor + * @returns a matching parent ts.Node + */ +function findFirstMatchingAncestor(node, predicate) { + while (node) { + if (predicate(node)) { + return node; + } + node = node.parent; + } + return undefined; +} +exports.findFirstMatchingAncestor = findFirstMatchingAncestor; +/** + * Returns true if a given ts.Node has a JSX token within its hierarchy + * @param node ts.Node to be checked + * @returns has JSX ancestor + */ +function hasJSXAncestor(node) { + return !!findFirstMatchingAncestor(node, isJSXToken); +} +exports.hasJSXAncestor = hasJSXAncestor; +/** + * Unescape the text content of string literals, e.g. & -> & + * @param text The escaped string literal text. + * @returns The unescaped string literal text. + */ +function unescapeStringLiteralText(text) { + return unescape_1.default(text); +} +exports.unescapeStringLiteralText = unescapeStringLiteralText; +/** + * Returns true if a given ts.Node is a computed property + * @param node ts.Node to be checked + * @returns is Computed Property + */ +function isComputedProperty(node) { + return node.kind === SyntaxKind.ComputedPropertyName; +} +exports.isComputedProperty = isComputedProperty; +/** + * Returns true if a given ts.Node is optional (has QuestionToken) + * @param node ts.Node to be checked + * @returns is Optional + */ +function isOptional(node) { + return node.questionToken + ? node.questionToken.kind === SyntaxKind.QuestionToken + : false; +} +exports.isOptional = isOptional; +/** + * Returns true if the node is an optional chain node + */ +function isChainExpression(node) { + return node.type === ts_estree_1.AST_NODE_TYPES.ChainExpression; +} +exports.isChainExpression = isChainExpression; +/** + * Returns true of the child of property access expression is an optional chain + */ +function isChildUnwrappableOptionalChain(node, child) { + if (isChainExpression(child) && + // (x?.y).z is semantically different, and as such .z is no longer optional + node.expression.kind !== ts.SyntaxKind.ParenthesizedExpression) { + return true; + } + return false; +} +exports.isChildUnwrappableOptionalChain = isChildUnwrappableOptionalChain; +/** + * Returns the type of a given ts.Token + * @param token the ts.Token + * @returns the token type + */ +function getTokenType(token) { + if ('originalKeywordKind' in token && token.originalKeywordKind) { + if (token.originalKeywordKind === SyntaxKind.NullKeyword) { + return ts_estree_1.AST_TOKEN_TYPES.Null; + } + else if (token.originalKeywordKind >= SyntaxKind.FirstFutureReservedWord && + token.originalKeywordKind <= SyntaxKind.LastKeyword) { + return ts_estree_1.AST_TOKEN_TYPES.Identifier; + } + return ts_estree_1.AST_TOKEN_TYPES.Keyword; + } + if (token.kind >= SyntaxKind.FirstKeyword && + token.kind <= SyntaxKind.LastFutureReservedWord) { + if (token.kind === SyntaxKind.FalseKeyword || + token.kind === SyntaxKind.TrueKeyword) { + return ts_estree_1.AST_TOKEN_TYPES.Boolean; + } + return ts_estree_1.AST_TOKEN_TYPES.Keyword; + } + if (token.kind >= SyntaxKind.FirstPunctuation && + token.kind <= SyntaxKind.LastBinaryOperator) { + return ts_estree_1.AST_TOKEN_TYPES.Punctuator; + } + if (token.kind >= SyntaxKind.NoSubstitutionTemplateLiteral && + token.kind <= SyntaxKind.TemplateTail) { + return ts_estree_1.AST_TOKEN_TYPES.Template; + } + switch (token.kind) { + case SyntaxKind.NumericLiteral: + return ts_estree_1.AST_TOKEN_TYPES.Numeric; + case SyntaxKind.JsxText: + return ts_estree_1.AST_TOKEN_TYPES.JSXText; + case SyntaxKind.StringLiteral: + // A TypeScript-StringLiteral token with a TypeScript-JsxAttribute or TypeScript-JsxElement parent, + // must actually be an ESTree-JSXText token + if (token.parent && + (token.parent.kind === SyntaxKind.JsxAttribute || + token.parent.kind === SyntaxKind.JsxElement)) { + return ts_estree_1.AST_TOKEN_TYPES.JSXText; + } + return ts_estree_1.AST_TOKEN_TYPES.String; + case SyntaxKind.RegularExpressionLiteral: + return ts_estree_1.AST_TOKEN_TYPES.RegularExpression; + case SyntaxKind.Identifier: + case SyntaxKind.ConstructorKeyword: + case SyntaxKind.GetKeyword: + case SyntaxKind.SetKeyword: + // falls through + default: + } + // Some JSX tokens have to be determined based on their parent + if (token.parent && token.kind === SyntaxKind.Identifier) { + if (isJSXToken(token.parent)) { + return ts_estree_1.AST_TOKEN_TYPES.JSXIdentifier; + } + if (token.parent.kind === SyntaxKind.PropertyAccessExpression && + hasJSXAncestor(token)) { + return ts_estree_1.AST_TOKEN_TYPES.JSXIdentifier; + } + } + return ts_estree_1.AST_TOKEN_TYPES.Identifier; +} +exports.getTokenType = getTokenType; +/** + * Extends and formats a given ts.Token, for a given AST + * @param token the ts.Token + * @param ast the AST object + * @returns the converted Token + */ +function convertToken(token, ast) { + const start = token.kind === SyntaxKind.JsxText + ? token.getFullStart() + : token.getStart(ast); + const end = token.getEnd(); + const value = ast.text.slice(start, end); + const tokenType = getTokenType(token); + if (tokenType === ts_estree_1.AST_TOKEN_TYPES.RegularExpression) { + return { + type: tokenType, + value, + range: [start, end], + loc: getLocFor(start, end, ast), + regex: { + pattern: value.slice(1, value.lastIndexOf('/')), + flags: value.slice(value.lastIndexOf('/') + 1), + }, + }; + } + else { + return { + type: tokenType, + value, + range: [start, end], + loc: getLocFor(start, end, ast), + }; + } +} +exports.convertToken = convertToken; +/** + * Converts all tokens for the given AST + * @param ast the AST object + * @returns the converted Tokens + */ +function convertTokens(ast) { + const result = []; + /** + * @param node the ts.Node + */ + function walk(node) { + // TypeScript generates tokens for types in JSDoc blocks. Comment tokens + // and their children should not be walked or added to the resulting tokens list. + if (isComment(node) || isJSDocComment(node)) { + return; + } + if (isToken(node) && node.kind !== SyntaxKind.EndOfFileToken) { + const converted = convertToken(node, ast); + if (converted) { + result.push(converted); + } + } + else { + node.getChildren(ast).forEach(walk); + } + } + walk(ast); + return result; +} +exports.convertTokens = convertTokens; +/** + * @param ast the AST object + * @param start the index at which the error starts + * @param message the error message + * @returns converted error object + */ +function createError(ast, start, message) { + const loc = ast.getLineAndCharacterOfPosition(start); + return { + index: start, + lineNumber: loc.line + 1, + column: loc.character, + message, + }; +} +exports.createError = createError; +/** + * @param n the TSNode + * @param ast the TS AST + */ +function nodeHasTokens(n, ast) { + // If we have a token or node that has a non-zero width, it must have tokens. + // Note: getWidth() does not take trivia into account. + return n.kind === SyntaxKind.EndOfFileToken + ? // eslint-disable-next-line @typescript-eslint/no-explicit-any + !!n.jsDoc + : n.getWidth(ast) !== 0; +} +exports.nodeHasTokens = nodeHasTokens; +/** + * Like `forEach`, but suitable for use with numbers and strings (which may be falsy). + * @template T + * @template U + * @param array + * @param callback + */ +function firstDefined(array, callback) { + if (array === undefined) { + return undefined; + } + for (let i = 0; i < array.length; i++) { + const result = callback(array[i], i); + if (result !== undefined) { + return result; + } + } + return undefined; +} +exports.firstDefined = firstDefined; +//# sourceMappingURL=node-utils.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js.map b/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js.map new file mode 100644 index 000000000..306ba3668 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"node-utils.js","sourceRoot":"","sources":["../src/node-utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAAuC;AACvC,+CAAiC;AACjC,2CAAwE;AAExE,MAAM,UAAU,GAAG,EAAE,CAAC,UAAU,CAAC;AAEjC,MAAM,iBAAiB,GAGjB;IACJ,UAAU,CAAC,WAAW;IACtB,UAAU,CAAC,uBAAuB;IAClC,UAAU,CAAC,qBAAqB;CACjC,CAAC;AAuEF;;;;GAIG;AACH,SAAgB,oBAAoB,CAClC,QAAqB;IAErB,OAAO,CACL,QAAQ,CAAC,IAAI,IAAI,UAAU,CAAC,eAAe;QAC3C,QAAQ,CAAC,IAAI,IAAI,UAAU,CAAC,cAAc,CAC3C,CAAC;AACJ,CAAC;AAPD,oDAOC;AAED;;;;GAIG;AACH,SAAgB,iBAAiB,CAC/B,QAAqB;IAErB,OAAQ,iBAAqC,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACxE,CAAC;AAJD,8CAIC;AAED;;;;GAIG;AACH,SAAgB,mBAAmB,CACjC,IAAO;IAEP,OAAO,EAAE,CAAC,aAAa,CAAC,IAAI,CAEN,CAAC;AACzB,CAAC;AAND,kDAM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eslint/typescript-estree/dist/parser-options.d.ts b/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.d.ts new file mode 100644 index 000000000..e64a09d25 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.d.ts @@ -0,0 +1,150 @@ +import { DebugLevel } from '@typescript-eslint/types'; +import { Program } from 'typescript'; +import { TSESTree, TSNode, TSESTreeToTSNode, TSToken } from './ts-estree'; +declare type DebugModule = 'typescript-eslint' | 'eslint' | 'typescript'; +export interface Extra { + code: string; + comment: boolean; + comments: TSESTree.Comment[]; + createDefaultProgram: boolean; + debugLevel: Set; + errorOnTypeScriptSyntacticAndSemanticIssues: boolean; + errorOnUnknownASTType: boolean; + extraFileExtensions: string[]; + filePath: string; + jsx: boolean; + loc: boolean; + log: (message: string) => void; + preserveNodeMaps?: boolean; + projects: string[]; + range: boolean; + strict: boolean; + tokens: null | TSESTree.Token[]; + tsconfigRootDir: string; + useJSXTextNode: boolean; +} +interface ParseOptions { + /** + * create a top-level comments array containing all comments + */ + comment?: boolean; + /** + * An array of modules to turn explicit debugging on for. + * - 'typescript-eslint' is the same as setting the env var `DEBUG=typescript-eslint:*` + * - 'eslint' is the same as setting the env var `DEBUG=eslint:*` + * - 'typescript' is the same as setting `extendedDiagnostics: true` in your tsconfig compilerOptions + * + * For convenience, also supports a boolean: + * - true === ['typescript-eslint'] + * - false === [] + */ + debugLevel?: DebugLevel; + /** + * Cause the parser to error if it encounters an unknown AST node type (useful for testing). + * This case only usually occurs when TypeScript releases new features. + */ + errorOnUnknownASTType?: boolean; + /** + * Absolute (or relative to `cwd`) path to the file being parsed. + */ + filePath?: string; + /** + * Enable parsing of JSX. + * For more details, see https://www.typescriptlang.org/docs/handbook/jsx.html + * + * NOTE: this setting does not effect known file types (.js, .jsx, .ts, .tsx, .json) because the + * TypeScript compiler has its own internal handling for known file extensions. + * + * For the exact behavior, see https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#parseroptionsecmafeaturesjsx + */ + jsx?: boolean; + /** + * Controls whether the `loc` information to each node. + * The `loc` property is an object which contains the exact line/column the node starts/ends on. + * This is similar to the `range` property, except it is line/column relative. + */ + loc?: boolean; + loggerFn?: ((message: string) => void) | false; + /** + * Controls whether the `range` property is included on AST nodes. + * The `range` property is a [number, number] which indicates the start/end index of the node in the file contents. + * This is similar to the `loc` property, except this is the absolute index. + */ + range?: boolean; + /** + * Set to true to create a top-level array containing all tokens from the file. + */ + tokens?: boolean; + useJSXTextNode?: boolean; +} +interface ParseAndGenerateServicesOptions extends ParseOptions { + /** + * Causes the parser to error if the TypeScript compiler returns any unexpected syntax/semantic errors. + */ + errorOnTypeScriptSyntacticAndSemanticIssues?: boolean; + /** + * When `project` is provided, this controls the non-standard file extensions which will be parsed. + * It accepts an array of file extensions, each preceded by a `.`. + */ + extraFileExtensions?: string[]; + /** + * Absolute (or relative to `tsconfigRootDir`) path to the file being parsed. + * When `project` is provided, this is required, as it is used to fetch the file from the TypeScript compiler's cache. + */ + filePath?: string; + /** + * Allows the user to control whether or not two-way AST node maps are preserved + * during the AST conversion process. + * + * By default: the AST node maps are NOT preserved, unless `project` has been specified, + * in which case the maps are made available on the returned `parserServices`. + * + * NOTE: If `preserveNodeMaps` is explicitly set by the user, it will be respected, + * regardless of whether or not `project` is in use. + */ + preserveNodeMaps?: boolean; + /** + * Absolute (or relative to `tsconfigRootDir`) paths to the tsconfig(s). + * If this is provided, type information will be returned. + */ + project?: string | string[]; + /** + * If you provide a glob (or globs) to the project option, you can use this option to ignore certain folders from + * being matched by the globs. + * This accepts an array of globs to ignore. + * + * By default, this is set to ["**\/node_modules/**"] + */ + projectFolderIgnoreList?: string[]; + /** + * The absolute path to the root directory for all provided `project`s. + */ + tsconfigRootDir?: string; + /** + *************************************************************************************** + * IT IS RECOMMENDED THAT YOU DO NOT USE THIS OPTION, AS IT CAUSES PERFORMANCE ISSUES. * + *************************************************************************************** + * + * When passed with `project`, this allows the parser to create a catch-all, default program. + * This means that if the parser encounters a file not included in any of the provided `project`s, + * it will not error, but will instead parse the file and its dependencies in a new program. + */ + createDefaultProgram?: boolean; +} +export declare type TSESTreeOptions = ParseAndGenerateServicesOptions; +export interface ParserWeakMap { + get(key: TKey): TValue; + has(key: unknown): boolean; +} +export interface ParserWeakMapESTreeToTSNode { + get(key: TKeyBase): TSESTreeToTSNode; + has(key: unknown): boolean; +} +export interface ParserServices { + program: Program; + esTreeNodeToTSNodeMap: ParserWeakMapESTreeToTSNode; + tsNodeToESTreeNodeMap: ParserWeakMap; + hasFullTypeInformation: boolean; +} +export {}; +//# sourceMappingURL=parser-options.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.d.ts.map new file mode 100644 index 000000000..af6375f00 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parser-options.d.ts","sourceRoot":"","sources":["../src/parser-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE1E,aAAK,WAAW,GAAG,mBAAmB,GAAG,QAAQ,GAAG,YAAY,CAAC;AAEjE,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;IAC7B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,UAAU,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;IAC7B,2CAA2C,EAAE,OAAO,CAAC;IACrD,qBAAqB,EAAE,OAAO,CAAC;IAC/B,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,QAAQ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AGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE5B;;;;;;OAMG;IACH,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnC;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;;;;;OAQG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,oBAAY,eAAe,GAAG,+BAA+B,CAAC;AAI9D,MAAM,WAAW,aAAa,CAAC,IAAI,EAAE,UAAU;IAC7C,GAAG,CAAC,MAAM,SAAS,UAAU,EAAE,GAAG,EAAE,IAAI,GAAG,MAAM,CAAC;IAClD,GAAG,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,2BAA2B,CAC1C,IAAI,SAAS,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI;IAE1C,GAAG,CAAC,QAAQ,SAAS,IAAI,EAAE,GAAG,EAAE,QAAQ,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACtE,GAAG,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,qBAAqB,EAAE,2BAA2B,CAAC;IACnD,qBAAqB,EAAE,aAAa,CAAC,MAAM,GAAG,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IACtE,sBAAsB,EAAE,OAAO,CAAC;CACjC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.js b/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.js new file mode 100644 index 000000000..66f40a290 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=parser-options.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.js.map b/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.js.map new file mode 100644 index 000000000..22b7b8ab9 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parser-options.js","sourceRoot":"","sources":["../src/parser-options.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parser.d.ts b/node_modules/@typescript-eslint/typescript-estree/dist/parser.d.ts new file mode 100644 index 000000000..d31f3a7ab --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parser.d.ts @@ -0,0 +1,17 @@ +import { TSESTreeOptions, ParserServices } from './parser-options'; +import { TSESTree } from './ts-estree'; +interface EmptyObject { +} +declare type AST = TSESTree.Program & (T['tokens'] extends true ? { + tokens: TSESTree.Token[]; +} : EmptyObject) & (T['comment'] extends true ? { + comments: TSESTree.Comment[]; +} : EmptyObject); +interface ParseAndGenerateServicesResult { + ast: AST; + services: ParserServices; +} +declare function parse(code: string, options?: T): AST; +declare function parseAndGenerateServices(code: string, options: T): ParseAndGenerateServicesResult; +export { AST, parse, parseAndGenerateServices, ParseAndGenerateServicesResult }; +//# sourceMappingURL=parser.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parser.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/parser.d.ts.map new file mode 100644 index 000000000..064703353 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":"AAWA,OAAO,EAAS,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE1E,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAwSvC,UAAU,WAAW;CAAG;AACxB,aAAK,GAAG,CAAC,CAAC,SAAS,eAAe,IAAI,QAAQ,CAAC,OAAO,GACpD,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,IAAI,GAAG;IAAE,MAAM,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAA;CAAE,GAAG,WAAW,CAAC,GACvE,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,IAAI,GAAG;IAAE,QAAQ,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAA;CAAE,GAAG,WAAW,CAAC,CAAC;AAE/E,UAAU,8BAA8B,CAAC,CAAC,SAAS,eAAe;IAChE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IACZ,QAAQ,EAAE,cAAc,CAAC;CAC1B;AAED,iBAAS,KAAK,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,EACxD,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,CAAC,GACV,GAAG,CAAC,CAAC,CAAC,CA4CR;AAED,iBAAS,wBAAwB,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,EAC3E,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,CAAC,GACT,8BAA8B,CAAC,CAAC,CAAC,CA0EnC;AAED,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,wBAAwB,EAAE,8BAA8B,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parser.js b/node_modules/@typescript-eslint/typescript-estree/dist/parser.js new file mode 100644 index 000000000..20db62122 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parser.js @@ -0,0 +1,380 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseAndGenerateServices = exports.parse = void 0; +const debug_1 = __importDefault(require("debug")); +const globby_1 = require("globby"); +const is_glob_1 = __importDefault(require("is-glob")); +const semver_1 = __importDefault(require("semver")); +const ts = __importStar(require("typescript")); +const ast_converter_1 = require("./ast-converter"); +const convert_1 = require("./convert"); +const createDefaultProgram_1 = require("./create-program/createDefaultProgram"); +const createIsolatedProgram_1 = require("./create-program/createIsolatedProgram"); +const createProjectProgram_1 = require("./create-program/createProjectProgram"); +const createSourceFile_1 = require("./create-program/createSourceFile"); +const semantic_or_syntactic_errors_1 = require("./semantic-or-syntactic-errors"); +const shared_1 = require("./create-program/shared"); +const log = debug_1.default('typescript-eslint:typescript-estree:parser'); +/** + * This needs to be kept in sync with the top-level README.md in the + * typescript-eslint monorepo + */ +const SUPPORTED_TYPESCRIPT_VERSIONS = '>=3.3.1 <4.1.0'; +/* + * The semver package will ignore prerelease ranges, and we don't want to explicitly document every one + * List them all separately here, so we can automatically create the full string + */ +const SUPPORTED_PRERELEASE_RANGES = []; +const ACTIVE_TYPESCRIPT_VERSION = ts.version; +const isRunningSupportedTypeScriptVersion = semver_1.default.satisfies(ACTIVE_TYPESCRIPT_VERSION, [SUPPORTED_TYPESCRIPT_VERSIONS] + .concat(SUPPORTED_PRERELEASE_RANGES) + .join(' || ')); +let extra; +let warnedAboutTSVersion = false; +function enforceString(code) { + /** + * Ensure the source code is a string + */ + if (typeof code !== 'string') { + return String(code); + } + return code; +} +/** + * @param code The code of the file being linted + * @param shouldProvideParserServices True if the program should be attempted to be calculated from provided tsconfig files + * @param shouldCreateDefaultProgram True if the program should be created from compiler host + * @returns Returns a source file and program corresponding to the linted code + */ +function getProgramAndAST(code, shouldProvideParserServices, shouldCreateDefaultProgram) { + return ((shouldProvideParserServices && + createProjectProgram_1.createProjectProgram(code, shouldCreateDefaultProgram, extra)) || + (shouldProvideParserServices && + shouldCreateDefaultProgram && + createDefaultProgram_1.createDefaultProgram(code, extra)) || + createIsolatedProgram_1.createIsolatedProgram(code, extra)); +} +/** + * Compute the filename based on the parser options. + * + * Even if jsx option is set in typescript compiler, filename still has to + * contain .tsx file extension. + * + * @param options Parser options + */ +function getFileName({ jsx } = {}) { + return jsx ? 'estree.tsx' : 'estree.ts'; +} +/** + * Resets the extra config object + */ +function resetExtra() { + extra = { + code: '', + comment: false, + comments: [], + createDefaultProgram: false, + debugLevel: new Set(), + errorOnTypeScriptSyntacticAndSemanticIssues: false, + errorOnUnknownASTType: false, + extraFileExtensions: [], + filePath: getFileName(), + jsx: false, + loc: false, + log: console.log, + preserveNodeMaps: true, + projects: [], + range: false, + strict: false, + tokens: null, + tsconfigRootDir: process.cwd(), + useJSXTextNode: false, + }; +} +/** + * Normalizes, sanitizes, resolves and filters the provided + */ +function prepareAndTransformProjects(projectsInput, ignoreListInput) { + let projects = []; + // Normalize and sanitize the project paths + if (typeof projectsInput === 'string') { + projects.push(projectsInput); + } + else if (Array.isArray(projectsInput)) { + for (const project of projectsInput) { + if (typeof project === 'string') { + projects.push(project); + } + } + } + if (projects.length === 0) { + return projects; + } + // Transform glob patterns into paths + const globbedProjects = projects.filter(project => is_glob_1.default(project)); + projects = projects + .filter(project => !is_glob_1.default(project)) + .concat(globby_1.sync([...globbedProjects, ...ignoreListInput], { + cwd: extra.tsconfigRootDir, + })); + log('parserOptions.project (excluding ignored) matched projects: %s', projects); + return projects; +} +function applyParserOptionsToExtra(options) { + var _a; + /** + * Configure Debug logging + */ + if (options.debugLevel === true) { + extra.debugLevel = new Set(['typescript-eslint']); + } + else if (Array.isArray(options.debugLevel)) { + extra.debugLevel = new Set(options.debugLevel); + } + if (extra.debugLevel.size > 0) { + // debug doesn't support multiple `enable` calls, so have to do it all at once + const namespaces = []; + if (extra.debugLevel.has('typescript-eslint')) { + namespaces.push('typescript-eslint:*'); + } + if (extra.debugLevel.has('eslint') || + // make sure we don't turn off the eslint debug if it was enabled via --debug + debug_1.default.enabled('eslint:*')) { + // https://github.com/eslint/eslint/blob/9dfc8501fb1956c90dc11e6377b4cb38a6bea65d/bin/eslint.js#L25 + namespaces.push('eslint:*,-eslint:code-path'); + } + debug_1.default.enable(namespaces.join(',')); + } + /** + * Track range information in the AST + */ + extra.range = typeof options.range === 'boolean' && options.range; + extra.loc = typeof options.loc === 'boolean' && options.loc; + /** + * Track tokens in the AST + */ + if (typeof options.tokens === 'boolean' && options.tokens) { + extra.tokens = []; + } + /** + * Track comments in the AST + */ + if (typeof options.comment === 'boolean' && options.comment) { + extra.comment = true; + extra.comments = []; + } + /** + * Enable JSX - note the applicable file extension is still required + */ + if (typeof options.jsx === 'boolean' && options.jsx) { + extra.jsx = true; + } + /** + * Get the file path + */ + if (typeof options.filePath === 'string' && options.filePath !== '') { + extra.filePath = options.filePath; + } + else { + extra.filePath = getFileName(extra); + } + /** + * The JSX AST changed the node type for string literals + * inside a JSX Element from `Literal` to `JSXText`. + * + * When value is `true`, these nodes will be parsed as type `JSXText`. + * When value is `false`, these nodes will be parsed as type `Literal`. + */ + if (typeof options.useJSXTextNode === 'boolean' && options.useJSXTextNode) { + extra.useJSXTextNode = true; + } + /** + * Allow the user to cause the parser to error if it encounters an unknown AST Node Type + * (used in testing) + */ + if (typeof options.errorOnUnknownASTType === 'boolean' && + options.errorOnUnknownASTType) { + extra.errorOnUnknownASTType = true; + } + /** + * Allow the user to override the function used for logging + */ + if (typeof options.loggerFn === 'function') { + extra.log = options.loggerFn; + } + else if (options.loggerFn === false) { + extra.log = () => { }; + } + if (typeof options.tsconfigRootDir === 'string') { + extra.tsconfigRootDir = options.tsconfigRootDir; + } + // NOTE - ensureAbsolutePath relies upon having the correct tsconfigRootDir in extra + extra.filePath = shared_1.ensureAbsolutePath(extra.filePath, extra); + // NOTE - prepareAndTransformProjects relies upon having the correct tsconfigRootDir in extra + const projectFolderIgnoreList = ((_a = options.projectFolderIgnoreList) !== null && _a !== void 0 ? _a : []) + .reduce((acc, folder) => { + if (typeof folder === 'string') { + acc.push(folder); + } + return acc; + }, []) + // prefix with a ! for not match glob + .map(folder => (folder.startsWith('!') ? folder : `!${folder}`)); + extra.projects = prepareAndTransformProjects(options.project, projectFolderIgnoreList); + if (Array.isArray(options.extraFileExtensions) && + options.extraFileExtensions.every(ext => typeof ext === 'string')) { + extra.extraFileExtensions = options.extraFileExtensions; + } + /** + * Allow the user to enable or disable the preservation of the AST node maps + * during the conversion process. + */ + if (typeof options.preserveNodeMaps === 'boolean') { + extra.preserveNodeMaps = options.preserveNodeMaps; + } + extra.createDefaultProgram = + typeof options.createDefaultProgram === 'boolean' && + options.createDefaultProgram; +} +function warnAboutTSVersion() { + var _a; + if (!isRunningSupportedTypeScriptVersion && !warnedAboutTSVersion) { + const isTTY = typeof process === undefined ? false : (_a = process.stdout) === null || _a === void 0 ? void 0 : _a.isTTY; + if (isTTY) { + const border = '============='; + const versionWarning = [ + border, + 'WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.', + 'You may find that it works just fine, or you may not.', + `SUPPORTED TYPESCRIPT VERSIONS: ${SUPPORTED_TYPESCRIPT_VERSIONS}`, + `YOUR TYPESCRIPT VERSION: ${ACTIVE_TYPESCRIPT_VERSION}`, + 'Please only submit bug reports when using the officially supported version.', + border, + ]; + extra.log(versionWarning.join('\n\n')); + } + warnedAboutTSVersion = true; + } +} +function parse(code, options) { + /** + * Reset the parse configuration + */ + resetExtra(); + /** + * Ensure users do not attempt to use parse() when they need parseAndGenerateServices() + */ + if (options === null || options === void 0 ? void 0 : options.errorOnTypeScriptSyntacticAndSemanticIssues) { + throw new Error(`"errorOnTypeScriptSyntacticAndSemanticIssues" is only supported for parseAndGenerateServices()`); + } + /** + * Ensure the source code is a string, and store a reference to it + */ + code = enforceString(code); + extra.code = code; + /** + * Apply the given parser options + */ + if (typeof options !== 'undefined') { + applyParserOptionsToExtra(options); + } + /** + * Warn if the user is using an unsupported version of TypeScript + */ + warnAboutTSVersion(); + /** + * Create a ts.SourceFile directly, no ts.Program is needed for a simple + * parse + */ + const ast = createSourceFile_1.createSourceFile(code, extra); + /** + * Convert the TypeScript AST to an ESTree-compatible one + */ + const { estree } = ast_converter_1.astConverter(ast, extra, false); + return estree; +} +exports.parse = parse; +function parseAndGenerateServices(code, options) { + /** + * Reset the parse configuration + */ + resetExtra(); + /** + * Ensure the source code is a string, and store a reference to it + */ + code = enforceString(code); + extra.code = code; + /** + * Apply the given parser options + */ + if (typeof options !== 'undefined') { + applyParserOptionsToExtra(options); + if (typeof options.errorOnTypeScriptSyntacticAndSemanticIssues === + 'boolean' && + options.errorOnTypeScriptSyntacticAndSemanticIssues) { + extra.errorOnTypeScriptSyntacticAndSemanticIssues = true; + } + } + /** + * Warn if the user is using an unsupported version of TypeScript + */ + warnAboutTSVersion(); + /** + * Generate a full ts.Program in order to be able to provide parser + * services, such as type-checking + */ + const shouldProvideParserServices = extra.projects && extra.projects.length > 0; + const { ast, program } = getProgramAndAST(code, shouldProvideParserServices, extra.createDefaultProgram); + /** + * Convert the TypeScript AST to an ESTree-compatible one, and optionally preserve + * mappings between converted and original AST nodes + */ + const preserveNodeMaps = typeof extra.preserveNodeMaps === 'boolean' ? extra.preserveNodeMaps : true; + const { estree, astMaps } = ast_converter_1.astConverter(ast, extra, preserveNodeMaps); + /** + * Even if TypeScript parsed the source code ok, and we had no problems converting the AST, + * there may be other syntactic or semantic issues in the code that we can optionally report on. + */ + if (program && extra.errorOnTypeScriptSyntacticAndSemanticIssues) { + const error = semantic_or_syntactic_errors_1.getFirstSemanticOrSyntacticError(program, ast); + if (error) { + throw convert_1.convertError(error); + } + } + /** + * Return the converted AST and additional parser services + */ + return { + ast: estree, + services: { + hasFullTypeInformation: shouldProvideParserServices, + program, + esTreeNodeToTSNodeMap: astMaps.esTreeNodeToTSNodeMap, + tsNodeToESTreeNodeMap: astMaps.tsNodeToESTreeNodeMap, + }, + }; +} +exports.parseAndGenerateServices = parseAndGenerateServices; +//# sourceMappingURL=parser.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/parser.js.map b/node_modules/@typescript-eslint/typescript-estree/dist/parser.js.map new file mode 100644 index 000000000..d717c37d4 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/parser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parser.js","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,mCAA0C;AAC1C,sDAA6B;AAC7B,oDAA4B;AAC5B,+CAAiC;AACjC,mDAA+C;AAC/C,uCAAyC;AACzC,gFAA6E;AAC7E,kFAA+E;AAC/E,gFAA6E;AAC7E,wEAAqE;AAErE,iFAAkF;AAElF,oDAA4E;AAE5E,MAAM,GAAG,GAAG,eAAK,CAAC,4CAA4C,CAAC,CAAC;AAEhE;;;GAGG;AACH,MAAM,6BAA6B,GAAG,gBAAgB,CAAC;AACvD;;;GAGG;AACH,MAAM,2BAA2B,GAAa,EAAE,CAAC;AACjD,MAAM,yBAAyB,GAAG,EAAE,CAAC,OAAO,CAAC;AAC7C,MAAM,mCAAmC,GAAG,gBAAM,CAAC,SAAS,CAC1D,yBAAyB,EACzB,CAAC,6BAA6B,CAAC;KAC5B,MAAM,CAAC,2BAA2B,CAAC;KACnC,IAAI,CAAC,MAAM,CAAC,CAChB,CAAC;AAEF,IAAI,KAAY,CAAC;AACjB,IAAI,oBAAoB,GAAG,KAAK,CAAC;AAEjC,SAAS,aAAa,CAAC,IAAa;IAClC;;OAEG;IACH,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,OAAO,MAAM,CAAC,IAAI,CAA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,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;IAC9C,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,gBAAgB,CACvC,IAAI,EACJ,2BAA2B,EAC3B,KAAK,CAAC,oBAAoB,CAC1B,CAAC;IAEH;;;OAGG;IACH,MAAM,gBAAgB,GACpB,OAAO,KAAK,CAAC,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9E,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,4BAAY,CAAC,GAAG,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC;IAEvE;;;OAGG;IACH,IAAI,OAAO,IAAI,KAAK,CAAC,2CAA2C,EAAE;QAChE,MAAM,KAAK,GAAG,+DAAgC,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC7D,IAAI,KAAK,EAAE;YACT,MAAM,sBAAY,CAAC,KAAK,CAAC,CAAC;SAC3B;KACF;IAED;;OAEG;IACH,OAAO;QACL,GAAG,EAAE,MAAgB;QACrB,QAAQ,EAAE;YACR,sBAAsB,EAAE,2BAA2B;YACnD,OAAO;YACP,qBAAqB,EAAE,OAAO,CAAC,qBAAqB;YACpD,qBAAqB,EAAE,OAAO,CAAC,qBAAqB;SACrD;KACF,CAAC;AACJ,CAAC;AAEoB,4DAAwB"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.d.ts b/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.d.ts new file mode 100644 index 000000000..06b3e12a6 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.d.ts @@ -0,0 +1,14 @@ +import * as ts from 'typescript'; +interface SemanticOrSyntacticError extends ts.Diagnostic { + message: string; +} +/** + * By default, diagnostics from the TypeScript compiler contain all errors - regardless of whether + * they are related to generic ECMAScript standards, or TypeScript-specific constructs. + * + * Therefore, we filter out all diagnostics, except for the ones we explicitly want to consider when + * the user opts in to throwing errors on semantic issues. + */ +export declare function getFirstSemanticOrSyntacticError(program: ts.Program, ast: ts.SourceFile): SemanticOrSyntacticError | undefined; +export {}; +//# sourceMappingURL=semantic-or-syntactic-errors.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.d.ts.map new file mode 100644 index 000000000..83299c596 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"semantic-or-syntactic-errors.d.ts","sourceRoot":"","sources":["../src/semantic-or-syntactic-errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,UAAU,wBAAyB,SAAQ,EAAE,CAAC,UAAU;IACtD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,EAAE,CAAC,OAAO,EACnB,GAAG,EAAE,EAAE,CAAC,UAAU,GACjB,wBAAwB,GAAG,SAAS,CAmCtC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.js b/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.js new file mode 100644 index 000000000..96473c4e1 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.js @@ -0,0 +1,112 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getFirstSemanticOrSyntacticError = void 0; +const ts = __importStar(require("typescript")); +/** + * By default, diagnostics from the TypeScript compiler contain all errors - regardless of whether + * they are related to generic ECMAScript standards, or TypeScript-specific constructs. + * + * Therefore, we filter out all diagnostics, except for the ones we explicitly want to consider when + * the user opts in to throwing errors on semantic issues. + */ +function getFirstSemanticOrSyntacticError(program, ast) { + try { + const supportedSyntacticDiagnostics = whitelistSupportedDiagnostics(program.getSyntacticDiagnostics(ast)); + if (supportedSyntacticDiagnostics.length) { + return convertDiagnosticToSemanticOrSyntacticError(supportedSyntacticDiagnostics[0]); + } + const supportedSemanticDiagnostics = whitelistSupportedDiagnostics(program.getSemanticDiagnostics(ast)); + if (supportedSemanticDiagnostics.length) { + return convertDiagnosticToSemanticOrSyntacticError(supportedSemanticDiagnostics[0]); + } + return undefined; + } + catch (e) { + /** + * TypeScript compiler has certain Debug.fail() statements in, which will cause the diagnostics + * retrieval above to throw. + * + * E.g. from ast-alignment-tests + * "Debug Failure. Shouldn't ever directly check a JsxOpeningElement" + * + * For our current use-cases this is undesired behavior, so we just suppress it + * and log a a warning. + */ + /* istanbul ignore next */ + console.warn(`Warning From TSC: "${e.message}`); // eslint-disable-line no-console + /* istanbul ignore next */ + return undefined; + } +} +exports.getFirstSemanticOrSyntacticError = getFirstSemanticOrSyntacticError; +function whitelistSupportedDiagnostics(diagnostics) { + return diagnostics.filter(diagnostic => { + switch (diagnostic.code) { + case 1013: // "A rest parameter or binding pattern may not have a trailing comma." + case 1014: // "A rest parameter must be last in a parameter list." + case 1044: // "'{0}' modifier cannot appear on a module or namespace element." + case 1045: // "A '{0}' modifier cannot be used with an interface declaration." + case 1048: // "A rest parameter cannot have an initializer." + case 1049: // "A 'set' accessor must have exactly one parameter." + case 1070: // "'{0}' modifier cannot appear on a type member." + case 1071: // "'{0}' modifier cannot appear on an index signature." + case 1085: // "Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '{0}'." + case 1090: // "'{0}' modifier cannot appear on a parameter." + case 1096: // "An index signature must have exactly one parameter." + case 1097: // "'{0}' list cannot be empty." + case 1098: // "Type parameter list cannot be empty." + case 1099: // "Type argument list cannot be empty." + case 1117: // "An object literal cannot have multiple properties with the same name in strict mode." + case 1121: // "Octal literals are not allowed in strict mode." + case 1123: // "Variable declaration list cannot be empty." + case 1141: // "String literal expected." + case 1162: // "An object member cannot be declared optional." + case 1164: // "Computed property names are not allowed in enums." + case 1172: // "'extends' clause already seen." + case 1173: // "'extends' clause must precede 'implements' clause." + case 1175: // "'implements' clause already seen." + case 1176: // "Interface declaration cannot have 'implements' clause." + case 1190: // "The variable declaration of a 'for...of' statement cannot have an initializer." + case 1196: // "Catch clause variable type annotation must be 'any' or 'unknown' if specified." + case 1200: // "Line terminator not permitted before arrow." + case 1206: // "Decorators are not valid here." + case 1211: // "A class declaration without the 'default' modifier must have a name." + case 1242: // "'abstract' modifier can only appear on a class, method, or property declaration." + case 1246: // "An interface property cannot have an initializer." + case 1255: // "A definite assignment assertion '!' is not permitted in this context." + case 1308: // "'await' expression is only allowed within an async function." + case 2364: // "The left-hand side of an assignment expression must be a variable or a property access." + case 2369: // "A parameter property is only allowed in a constructor implementation." + case 2452: // "An enum member cannot have a numeric name." + case 2462: // "A rest element must be last in a destructuring pattern." + case 8017: // "Octal literal types must use ES2015 syntax. Use the syntax '{0}'." + case 17012: // "'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?" + case 17013: // "Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor." + return true; + } + return false; + }); +} +function convertDiagnosticToSemanticOrSyntacticError(diagnostic) { + return Object.assign(Object.assign({}, diagnostic), { message: ts.flattenDiagnosticMessageText(diagnostic.messageText, ts.sys.newLine) }); +} +//# sourceMappingURL=semantic-or-syntactic-errors.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.js.map b/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.js.map new file mode 100644 index 000000000..af69657e4 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.js.map @@ -0,0 +1 @@ +{"version":3,"file":"semantic-or-syntactic-errors.js","sourceRoot":"","sources":["../src/semantic-or-syntactic-errors.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAMjC;;;;;;GAMG;AACH,SAAgB,gCAAgC,CAC9C,OAAmB,EACnB,GAAkB;IAElB,IAAI;QACF,MAAM,6BAA6B,GAAG,6BAA6B,CACjE,OAAO,CAAC,uBAAuB,CAAC,GAAG,CAAC,CACrC,CAAC;QACF,IAAI,6BAA6B,CAAC,MAAM,EAAE;YACxC,OAAO,2CAA2C,CAChD,6BAA6B,CAAC,CAAC,CAAC,CACjC,CAAC;SACH;QACD,MAAM,4BAA4B,GAAG,6BAA6B,CAChE,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,CACpC,CAAC;QACF,IAAI,4BAA4B,CAAC,MAAM,EAAE;YACvC,OAAO,2CAA2C,CAChD,4BAA4B,CAAC,CAAC,CAAC,CAChC,CAAC;SACH;QACD,OAAO,SAAS,CAAC;KAClB;IAAC,OAAO,CAAC,EAAE;QACV;;;;;;;;;WASG;QACH,0BAA0B;QAC1B,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,iCAAiC;QAClF,0BAA0B;QAC1B,OAAO,SAAS,CAAC;KAClB;AACH,CAAC;AAtCD,4EAsCC;AAED,SAAS,6BAA6B,CACpC,WAAmE;IA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AAK,IAAI,CAAC,CAAC,qFAAqF;YAChG,KAAK,IAAI,CAAC,CAAC,sDAAsD;YACjE,KAAK,IAAI,CAAC,CAAC,0EAA0E;YACrF,KAAK,IAAI,CAAC,CAAC,iEAAiE;YAC5E,KAAK,IAAI,CAAC,CAAC,4FAA4F;YACvG,KAAK,IAAI,CAAC,CAAC,0EAA0E;YACrF,KAAK,IAAI,CAAC,CAAC,+CAA+C;YAC1D,KAAK,IAAI,CAAC,CAAC,4DAA4D;YACvE,KAAK,IAAI,CAAC,CAAC,sEAAsE;YACjF,KAAK,KAAK,CAAC,CAAC,8EAA8E;YAC1F,KAAK,KAAK,EAAE,oHAAoH;gBAC9H,OAAO,IAAI,CAAC;SACf;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,2CAA2C,CAClD,UAAyB;IAEzB,uCACK,UAAU,KACb,OAAO,EAAE,EAAE,CAAC,4BAA4B,CACtC,UAAU,CAAC,WAAW,EACtB,EAAE,CAAC,GAAG,CAAC,OAAO,CACf,IACD;AACJ,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.d.ts b/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.d.ts new file mode 100644 index 000000000..be2b1fcab --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.d.ts @@ -0,0 +1,9 @@ +import { TSESTree } from './ts-estree'; +declare type SimpleTraverseOptions = { + enter: (node: TSESTree.Node, parent: TSESTree.Node | undefined) => void; +} | { + [key: string]: (node: TSESTree.Node, parent: TSESTree.Node | undefined) => void; +}; +export declare function simpleTraverse(startingNode: TSESTree.Node, options: SimpleTraverseOptions, setParentPointers?: boolean): void; +export {}; +//# sourceMappingURL=simple-traverse.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.d.ts.map new file mode 100644 index 000000000..7acdb8698 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"simple-traverse.d.ts","sourceRoot":"","sources":["../src/simple-traverse.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAevC,aAAK,qBAAqB,GACtB;IACE,KAAK,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,GAAG,SAAS,KAAK,IAAI,CAAC;CACzE,GACD;IACE,CAAC,GAAG,EAAE,MAAM,GAAG,CACb,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,MAAM,EAAE,QAAQ,CAAC,IAAI,GAAG,SAAS,KAC9B,IAAI,CAAC;CACX,CAAC;AA8CN,wBAAgB,cAAc,CAC5B,YAAY,EAAE,QAAQ,CAAC,IAAI,EAC3B,OAAO,EAAE,qBAAqB,EAC9B,iBAAiB,UAAQ,GACxB,IAAI,CAKN"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.js b/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.js new file mode 100644 index 000000000..b19f9b77c --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.js @@ -0,0 +1,53 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.simpleTraverse = void 0; +const visitor_keys_1 = require("@typescript-eslint/visitor-keys"); +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function isValidNode(x) { + return x !== null && typeof x === 'object' && typeof x.type === 'string'; +} +function getVisitorKeysForNode(allVisitorKeys, node) { + const keys = allVisitorKeys[node.type]; + return (keys !== null && keys !== void 0 ? keys : []); +} +class SimpleTraverser { + constructor(selectors, setParentPointers = false) { + this.allVisitorKeys = visitor_keys_1.visitorKeys; + this.selectors = selectors; + this.setParentPointers = setParentPointers; + } + traverse(node, parent) { + if (!isValidNode(node)) { + return; + } + if (this.setParentPointers) { + node.parent = parent; + } + if ('enter' in this.selectors) { + this.selectors.enter(node, parent); + } + else if (node.type in this.selectors) { + this.selectors[node.type](node, parent); + } + const keys = getVisitorKeysForNode(this.allVisitorKeys, node); + if (keys.length < 1) { + return; + } + for (const key of keys) { + const childOrChildren = node[key]; + if (Array.isArray(childOrChildren)) { + for (const child of childOrChildren) { + this.traverse(child, node); + } + } + else { + this.traverse(childOrChildren, node); + } + } + } +} +function simpleTraverse(startingNode, options, setParentPointers = false) { + new SimpleTraverser(options, setParentPointers).traverse(startingNode, undefined); +} +exports.simpleTraverse = simpleTraverse; +//# sourceMappingURL=simple-traverse.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.js.map b/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.js.map new file mode 100644 index 000000000..910f55ed1 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.js.map @@ -0,0 +1 @@ +{"version":3,"file":"simple-traverse.js","sourceRoot":"","sources":["../src/simple-traverse.ts"],"names":[],"mappings":";;;AAAA,kEAA8D;AAG9D,8DAA8D;AAC9D,SAAS,WAAW,CAAC,CAAM;IACzB,OAAO,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC;AAC3E,CAAC;AAED,SAAS,qBAAqB,CAC5B,cAAkC,EAClC,IAAmB;IAEnB,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvC,OAAO,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAU,CAAC;AAC/B,CAAC;AAaD,MAAM,eAAe;IAKnB,YAAY,SAAgC,EAAE,iBAAiB,GAAG,KAAK;QAJtD,mBAAc,GAAG,0BAAW,CAAC;QAK5C,IAAI,CAAC,SAAS,GAAG,SAAS,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C;AATD,wCASC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.d.ts b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.d.ts new file mode 100644 index 000000000..c3aa41b7a --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.d.ts @@ -0,0 +1,169 @@ +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/types'; +import * as ts from 'typescript'; +import { TSNode } from './ts-nodes'; +export interface EstreeToTsNodeTypes { + [AST_NODE_TYPES.ArrayExpression]: ts.ArrayLiteralExpression; + [AST_NODE_TYPES.ArrayPattern]: ts.ArrayLiteralExpression | ts.ArrayBindingPattern; + [AST_NODE_TYPES.ArrowFunctionExpression]: ts.ArrowFunction; + [AST_NODE_TYPES.AssignmentExpression]: ts.BinaryExpression; + [AST_NODE_TYPES.AssignmentPattern]: ts.ShorthandPropertyAssignment | ts.BindingElement | ts.BinaryExpression | ts.ParameterDeclaration; + [AST_NODE_TYPES.AwaitExpression]: ts.AwaitExpression; + [AST_NODE_TYPES.BinaryExpression]: ts.BinaryExpression; + [AST_NODE_TYPES.BlockStatement]: ts.Block; + [AST_NODE_TYPES.BreakStatement]: ts.BreakStatement; + [AST_NODE_TYPES.CallExpression]: ts.CallExpression; + [AST_NODE_TYPES.CatchClause]: ts.CatchClause; + [AST_NODE_TYPES.ChainExpression]: ts.CallExpression | ts.PropertyAccessExpression | ts.ElementAccessExpression | ts.NonNullExpression; + [AST_NODE_TYPES.ClassBody]: ts.ClassDeclaration | ts.ClassExpression; + [AST_NODE_TYPES.ClassDeclaration]: ts.ClassDeclaration; + [AST_NODE_TYPES.ClassExpression]: ts.ClassExpression; + [AST_NODE_TYPES.ClassProperty]: ts.PropertyDeclaration; + [AST_NODE_TYPES.ConditionalExpression]: ts.ConditionalExpression; + [AST_NODE_TYPES.ContinueStatement]: ts.ContinueStatement; + [AST_NODE_TYPES.DebuggerStatement]: ts.DebuggerStatement; + [AST_NODE_TYPES.Decorator]: ts.Decorator; + [AST_NODE_TYPES.DoWhileStatement]: ts.DoStatement; + [AST_NODE_TYPES.EmptyStatement]: ts.EmptyStatement; + [AST_NODE_TYPES.ExportAllDeclaration]: ts.ExportDeclaration; + [AST_NODE_TYPES.ExportDefaultDeclaration]: ts.ExportAssignment | ts.FunctionDeclaration | ts.VariableStatement | ts.ClassDeclaration | ts.ClassExpression | ts.TypeAliasDeclaration | ts.InterfaceDeclaration | ts.EnumDeclaration | ts.ModuleDeclaration; + [AST_NODE_TYPES.ExportNamedDeclaration]: ts.ExportDeclaration | ts.FunctionDeclaration | ts.VariableStatement | ts.ClassDeclaration | ts.ClassExpression | ts.TypeAliasDeclaration | ts.InterfaceDeclaration | ts.EnumDeclaration | ts.ModuleDeclaration; + [AST_NODE_TYPES.ExportSpecifier]: ts.ExportSpecifier; + [AST_NODE_TYPES.ExpressionStatement]: ts.ExpressionStatement; + [AST_NODE_TYPES.ForInStatement]: ts.ForInStatement; + [AST_NODE_TYPES.ForOfStatement]: ts.ForOfStatement; + [AST_NODE_TYPES.ForStatement]: ts.ForStatement; + [AST_NODE_TYPES.FunctionDeclaration]: ts.FunctionDeclaration; + [AST_NODE_TYPES.FunctionExpression]: ts.FunctionExpression | ts.ConstructorDeclaration | ts.GetAccessorDeclaration | ts.SetAccessorDeclaration | ts.MethodDeclaration; + [AST_NODE_TYPES.Identifier]: ts.Identifier | ts.ConstructorDeclaration | ts.Token; + [AST_NODE_TYPES.IfStatement]: ts.IfStatement; + [AST_NODE_TYPES.ImportDeclaration]: ts.ImportDeclaration; + [AST_NODE_TYPES.ImportDefaultSpecifier]: ts.ImportClause; + [AST_NODE_TYPES.ImportExpression]: ts.CallExpression; + [AST_NODE_TYPES.ImportNamespaceSpecifier]: ts.NamespaceImport; + [AST_NODE_TYPES.ImportSpecifier]: ts.ImportSpecifier; + [AST_NODE_TYPES.JSXAttribute]: ts.JsxAttribute; + [AST_NODE_TYPES.JSXClosingElement]: ts.JsxClosingElement; + [AST_NODE_TYPES.JSXClosingFragment]: ts.JsxClosingFragment; + [AST_NODE_TYPES.JSXElement]: ts.JsxElement | ts.JsxSelfClosingElement; + [AST_NODE_TYPES.JSXEmptyExpression]: ts.JsxExpression; + [AST_NODE_TYPES.JSXExpressionContainer]: ts.JsxExpression; + [AST_NODE_TYPES.JSXFragment]: ts.JsxFragment; + [AST_NODE_TYPES.JSXIdentifier]: ts.Identifier | ts.ThisExpression; + [AST_NODE_TYPES.JSXOpeningElement]: ts.JsxOpeningElement | ts.JsxSelfClosingElement; + [AST_NODE_TYPES.JSXOpeningFragment]: ts.JsxOpeningFragment; + [AST_NODE_TYPES.JSXSpreadAttribute]: ts.JsxSpreadAttribute; + [AST_NODE_TYPES.JSXSpreadChild]: ts.JsxExpression; + [AST_NODE_TYPES.JSXMemberExpression]: ts.PropertyAccessExpression; + [AST_NODE_TYPES.JSXText]: ts.JsxText; + [AST_NODE_TYPES.LabeledStatement]: ts.LabeledStatement; + [AST_NODE_TYPES.Literal]: ts.StringLiteral | ts.NumericLiteral | ts.RegularExpressionLiteral | ts.JsxText | ts.NullLiteral | ts.BooleanLiteral | ts.BigIntLiteral; + [AST_NODE_TYPES.LogicalExpression]: ts.BinaryExpression; + [AST_NODE_TYPES.MemberExpression]: ts.PropertyAccessExpression | ts.ElementAccessExpression; + [AST_NODE_TYPES.MetaProperty]: ts.MetaProperty; + [AST_NODE_TYPES.MethodDefinition]: ts.GetAccessorDeclaration | ts.SetAccessorDeclaration | ts.MethodDeclaration | ts.ConstructorDeclaration; + [AST_NODE_TYPES.NewExpression]: ts.NewExpression; + [AST_NODE_TYPES.ObjectExpression]: ts.ObjectLiteralExpression; + [AST_NODE_TYPES.ObjectPattern]: ts.ObjectLiteralExpression | ts.ObjectBindingPattern; + [AST_NODE_TYPES.Program]: ts.SourceFile; + [AST_NODE_TYPES.Property]: ts.PropertyAssignment | ts.ShorthandPropertyAssignment | ts.GetAccessorDeclaration | ts.SetAccessorDeclaration | ts.MethodDeclaration | ts.BindingElement; + [AST_NODE_TYPES.RestElement]: ts.BindingElement | ts.SpreadAssignment | ts.SpreadElement | ts.ParameterDeclaration; + [AST_NODE_TYPES.ReturnStatement]: ts.ReturnStatement; + [AST_NODE_TYPES.SequenceExpression]: ts.BinaryExpression; + [AST_NODE_TYPES.SpreadElement]: ts.SpreadElement | ts.SpreadAssignment; + [AST_NODE_TYPES.Super]: ts.SuperExpression; + [AST_NODE_TYPES.SwitchCase]: ts.CaseClause | ts.DefaultClause; + [AST_NODE_TYPES.SwitchStatement]: ts.SwitchStatement; + [AST_NODE_TYPES.TaggedTemplateExpression]: ts.TaggedTemplateExpression; + [AST_NODE_TYPES.TemplateElement]: ts.NoSubstitutionTemplateLiteral | ts.TemplateHead | ts.TemplateMiddle | ts.TemplateTail; + [AST_NODE_TYPES.TemplateLiteral]: ts.NoSubstitutionTemplateLiteral | ts.TemplateExpression; + [AST_NODE_TYPES.ThisExpression]: ts.ThisExpression | ts.KeywordTypeNode; + [AST_NODE_TYPES.ThrowStatement]: ts.ThrowStatement; + [AST_NODE_TYPES.TryStatement]: ts.TryStatement; + [AST_NODE_TYPES.TSAbstractClassProperty]: ts.PropertyDeclaration; + [AST_NODE_TYPES.TSAbstractMethodDefinition]: ts.GetAccessorDeclaration | ts.SetAccessorDeclaration | ts.MethodDeclaration | ts.ConstructorDeclaration; + [AST_NODE_TYPES.TSArrayType]: ts.ArrayTypeNode; + [AST_NODE_TYPES.TSAsExpression]: ts.AsExpression; + [AST_NODE_TYPES.TSCallSignatureDeclaration]: ts.PropertySignature; + [AST_NODE_TYPES.TSClassImplements]: ts.ExpressionWithTypeArguments; + [AST_NODE_TYPES.TSConditionalType]: ts.ConditionalTypeNode; + [AST_NODE_TYPES.TSConstructorType]: ts.ConstructorTypeNode; + [AST_NODE_TYPES.TSConstructSignatureDeclaration]: ts.ConstructorTypeNode | ts.FunctionTypeNode | ts.ConstructSignatureDeclaration | ts.CallSignatureDeclaration; + [AST_NODE_TYPES.TSDeclareFunction]: ts.FunctionDeclaration; + [AST_NODE_TYPES.TSEnumDeclaration]: ts.EnumDeclaration; + [AST_NODE_TYPES.TSEnumMember]: ts.EnumMember; + [AST_NODE_TYPES.TSExportAssignment]: ts.ExportAssignment; + [AST_NODE_TYPES.TSExternalModuleReference]: ts.ExternalModuleReference; + [AST_NODE_TYPES.TSFunctionType]: ts.FunctionTypeNode; + [AST_NODE_TYPES.TSImportEqualsDeclaration]: ts.ImportEqualsDeclaration; + [AST_NODE_TYPES.TSImportType]: ts.ImportTypeNode; + [AST_NODE_TYPES.TSIndexedAccessType]: ts.IndexedAccessTypeNode; + [AST_NODE_TYPES.TSIndexSignature]: ts.IndexSignatureDeclaration; + [AST_NODE_TYPES.TSInferType]: ts.InferTypeNode; + [AST_NODE_TYPES.TSInterfaceDeclaration]: ts.InterfaceDeclaration; + [AST_NODE_TYPES.TSInterfaceBody]: ts.InterfaceDeclaration; + [AST_NODE_TYPES.TSInterfaceHeritage]: ts.ExpressionWithTypeArguments; + [AST_NODE_TYPES.TSIntersectionType]: ts.IntersectionTypeNode; + [AST_NODE_TYPES.TSLiteralType]: ts.LiteralTypeNode; + [AST_NODE_TYPES.TSMappedType]: ts.MappedTypeNode; + [AST_NODE_TYPES.TSMethodSignature]: ts.MethodSignature; + [AST_NODE_TYPES.TSModuleBlock]: ts.ModuleBlock; + [AST_NODE_TYPES.TSModuleDeclaration]: ts.ModuleDeclaration; + [AST_NODE_TYPES.TSNamedTupleMember]: ts.NamedTupleMember; + [AST_NODE_TYPES.TSNamespaceExportDeclaration]: ts.NamespaceExportDeclaration; + [AST_NODE_TYPES.TSNonNullExpression]: ts.NonNullExpression; + [AST_NODE_TYPES.TSOptionalType]: ts.OptionalTypeNode; + [AST_NODE_TYPES.TSParameterProperty]: ts.ParameterDeclaration; + [AST_NODE_TYPES.TSParenthesizedType]: ts.ParenthesizedTypeNode; + [AST_NODE_TYPES.TSPropertySignature]: ts.PropertySignature; + [AST_NODE_TYPES.TSQualifiedName]: ts.QualifiedName; + [AST_NODE_TYPES.TSRestType]: ts.RestTypeNode | ts.NamedTupleMember; + [AST_NODE_TYPES.TSThisType]: ts.ThisTypeNode; + [AST_NODE_TYPES.TSTupleType]: ts.TupleTypeNode; + [AST_NODE_TYPES.TSTypeAliasDeclaration]: ts.TypeAliasDeclaration; + [AST_NODE_TYPES.TSTypeAnnotation]: undefined; + [AST_NODE_TYPES.TSTypeAssertion]: ts.TypeAssertion; + [AST_NODE_TYPES.TSTypeLiteral]: ts.TypeLiteralNode; + [AST_NODE_TYPES.TSTypeOperator]: ts.TypeOperatorNode; + [AST_NODE_TYPES.TSTypeParameter]: ts.TypeParameterDeclaration; + [AST_NODE_TYPES.TSTypeParameterDeclaration]: undefined; + [AST_NODE_TYPES.TSTypeParameterInstantiation]: ts.TaggedTemplateExpression | ts.ImportTypeNode | ts.ExpressionWithTypeArguments | ts.TypeReferenceNode | ts.JsxOpeningElement | ts.JsxSelfClosingElement | ts.NewExpression | ts.CallExpression; + [AST_NODE_TYPES.TSTypePredicate]: ts.TypePredicateNode; + [AST_NODE_TYPES.TSTypeQuery]: ts.TypeQueryNode; + [AST_NODE_TYPES.TSTypeReference]: ts.TypeReferenceNode; + [AST_NODE_TYPES.TSUnionType]: ts.UnionTypeNode; + [AST_NODE_TYPES.UpdateExpression]: ts.PrefixUnaryExpression | ts.PostfixUnaryExpression; + [AST_NODE_TYPES.UnaryExpression]: ts.PrefixUnaryExpression | ts.PostfixUnaryExpression | ts.DeleteExpression | ts.VoidExpression | ts.TypeOfExpression; + [AST_NODE_TYPES.VariableDeclaration]: ts.VariableDeclarationList | ts.VariableStatement; + [AST_NODE_TYPES.VariableDeclarator]: ts.VariableDeclaration; + [AST_NODE_TYPES.WhileStatement]: ts.WhileStatement; + [AST_NODE_TYPES.WithStatement]: ts.WithStatement; + [AST_NODE_TYPES.YieldExpression]: ts.YieldExpression; + [AST_NODE_TYPES.TSEmptyBodyFunctionExpression]: ts.FunctionExpression | ts.ConstructorDeclaration | ts.GetAccessorDeclaration | ts.SetAccessorDeclaration | ts.MethodDeclaration; + [AST_NODE_TYPES.TSAbstractKeyword]: ts.Token; + [AST_NODE_TYPES.TSNullKeyword]: ts.NullLiteral | ts.KeywordTypeNode; + [AST_NODE_TYPES.TSAnyKeyword]: ts.KeywordTypeNode; + [AST_NODE_TYPES.TSBigIntKeyword]: ts.KeywordTypeNode; + [AST_NODE_TYPES.TSBooleanKeyword]: ts.KeywordTypeNode; + [AST_NODE_TYPES.TSNeverKeyword]: ts.KeywordTypeNode; + [AST_NODE_TYPES.TSNumberKeyword]: ts.KeywordTypeNode; + [AST_NODE_TYPES.TSObjectKeyword]: ts.KeywordTypeNode; + [AST_NODE_TYPES.TSStringKeyword]: ts.KeywordTypeNode; + [AST_NODE_TYPES.TSSymbolKeyword]: ts.KeywordTypeNode; + [AST_NODE_TYPES.TSUnknownKeyword]: ts.KeywordTypeNode; + [AST_NODE_TYPES.TSVoidKeyword]: ts.KeywordTypeNode; + [AST_NODE_TYPES.TSUndefinedKeyword]: ts.KeywordTypeNode; + [AST_NODE_TYPES.TSAsyncKeyword]: ts.Token; + [AST_NODE_TYPES.TSDeclareKeyword]: ts.Token; + [AST_NODE_TYPES.TSExportKeyword]: ts.Token; + [AST_NODE_TYPES.TSStaticKeyword]: ts.Token; + [AST_NODE_TYPES.TSPublicKeyword]: ts.Token; + [AST_NODE_TYPES.TSPrivateKeyword]: ts.Token; + [AST_NODE_TYPES.TSProtectedKeyword]: ts.Token; + [AST_NODE_TYPES.TSReadonlyKeyword]: ts.Token; +} +/** + * Maps TSESTree AST Node type to the expected TypeScript AST Node type(s). + * This mapping is based on the internal logic of the parser. + */ +export declare type TSESTreeToTSNode = Extract, EstreeToTsNodeTypes[T['type']]>; +//# sourceMappingURL=estree-to-ts-node-types.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.d.ts.map new file mode 100644 index 000000000..8704471bf --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"estree-to-ts-node-types.d.ts","sourceRoot":"","sources":["../../src/ts-estree/estree-to-ts-node-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,WAAW,mBAAmB;IAClC,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC,sBAAsB,CAAC;IAC5D,CAAC,cAAc,CAAC,YAAY,CAAC,EACzB,EAAE,CAAC,sBAAsB,GACzB,EAAE,CAAC,mBAAmB,CAAC;IAC3B,CAAC,cAAc,CAAC,uBAAuB,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC;IAC3D,CAAC,cAAc,CAAC,oBAAoB,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC;IAC3D,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAC9B,EAAE,CAAC,2BAA2B,GAC9B,EAAE,CAAC,cAAc,GACjB,EAAE,CAAC,gBAAgB,GACnB,EAAE,CAAC,oBAAoB,CAAC;IAC5B,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC;IACrD,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC;IACvD,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC;IAC1C,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC;IACnD,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,EAAE,CAAC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,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACxE,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;IAC1E,CAAC,cAAc,CAAC,kBAAkB,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC9E,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;CAC7E;AAED;;;GAGG;AACH,oBAAY,gBAAgB,CAAC,CAAC,SAAS,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,OAAO,CAC7E,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,GAAG,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAEzE,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAC/B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.js b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.js new file mode 100644 index 000000000..1a133cdbd --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const types_1 = require("@typescript-eslint/types"); +//# sourceMappingURL=estree-to-ts-node-types.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.js.map b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.js.map new file mode 100644 index 000000000..b48e0fd37 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"estree-to-ts-node-types.js","sourceRoot":"","sources":["../../src/ts-estree/estree-to-ts-node-types.ts"],"names":[],"mappings":";;AAAA,oDAAoE"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.d.ts b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.d.ts new file mode 100644 index 000000000..37f26a395 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.d.ts @@ -0,0 +1,4 @@ +export { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree, } from '@typescript-eslint/types'; +export * from './ts-nodes'; +export * from './estree-to-ts-node-types'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.d.ts.map new file mode 100644 index 000000000..6a839dc66 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts-estree/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,eAAe,EACf,QAAQ,GACT,MAAM,0BAA0B,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,2BAA2B,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.js b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.js new file mode 100644 index 000000000..7f938027b --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.js @@ -0,0 +1,21 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TSESTree = exports.AST_TOKEN_TYPES = exports.AST_NODE_TYPES = void 0; +// for simplicity and backwards-compatibility +var types_1 = require("@typescript-eslint/types"); +Object.defineProperty(exports, "AST_NODE_TYPES", { enumerable: true, get: function () { return types_1.AST_NODE_TYPES; } }); +Object.defineProperty(exports, "AST_TOKEN_TYPES", { enumerable: true, get: function () { return types_1.AST_TOKEN_TYPES; } }); +Object.defineProperty(exports, "TSESTree", { enumerable: true, get: function () { return types_1.TSESTree; } }); +__exportStar(require("./ts-nodes"), exports); +__exportStar(require("./estree-to-ts-node-types"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.js.map b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.js.map new file mode 100644 index 000000000..5325d5dcb --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ts-estree/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA6C;AAC7C,kDAIkC;AAHhC,uGAAA,cAAc,OAAA;AACd,wGAAA,eAAe,OAAA;AACf,iGAAA,QAAQ,OAAA;AAEV,6CAA2B;AAC3B,4DAA0C"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts new file mode 100644 index 000000000..8142fc45f --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts @@ -0,0 +1,8 @@ +import * as ts from 'typescript'; +declare module 'typescript' { + interface NamedTupleMember extends ts.Node { + } +} +export declare type TSToken = ts.Token; +export declare type TSNode = ts.Modifier | ts.Identifier | ts.QualifiedName | ts.ComputedPropertyName | ts.Decorator | ts.TypeParameterDeclaration | ts.CallSignatureDeclaration | ts.ConstructSignatureDeclaration | ts.VariableDeclaration | ts.VariableDeclarationList | ts.ParameterDeclaration | ts.BindingElement | ts.PropertySignature | ts.PropertyDeclaration | ts.PropertyAssignment | ts.ShorthandPropertyAssignment | ts.SpreadAssignment | ts.ObjectBindingPattern | ts.ArrayBindingPattern | ts.FunctionDeclaration | ts.MethodSignature | ts.MethodDeclaration | ts.ConstructorDeclaration | ts.SemicolonClassElement | ts.GetAccessorDeclaration | ts.SetAccessorDeclaration | ts.IndexSignatureDeclaration | ts.KeywordTypeNode | ts.ImportTypeNode | ts.ThisTypeNode | ts.ConstructorTypeNode | ts.FunctionTypeNode | ts.TypeReferenceNode | ts.TypePredicateNode | ts.TypeQueryNode | ts.TypeLiteralNode | ts.ArrayTypeNode | ts.NamedTupleMember | ts.TupleTypeNode | ts.OptionalTypeNode | ts.RestTypeNode | ts.UnionTypeNode | ts.IntersectionTypeNode | ts.ConditionalTypeNode | ts.InferTypeNode | ts.ParenthesizedTypeNode | ts.TypeOperatorNode | ts.IndexedAccessTypeNode | ts.MappedTypeNode | ts.LiteralTypeNode | ts.StringLiteral | ts.OmittedExpression | ts.PartiallyEmittedExpression | ts.PrefixUnaryExpression | ts.PostfixUnaryExpression | ts.NullLiteral | ts.BooleanLiteral | ts.ThisExpression | ts.SuperExpression | ts.ImportExpression | ts.DeleteExpression | ts.TypeOfExpression | ts.VoidExpression | ts.AwaitExpression | ts.YieldExpression | ts.SyntheticExpression | ts.BinaryExpression | ts.ConditionalExpression | ts.FunctionExpression | ts.ArrowFunction | ts.RegularExpressionLiteral | ts.NoSubstitutionTemplateLiteral | ts.NumericLiteral | ts.BigIntLiteral | ts.TemplateHead | ts.TemplateMiddle | ts.TemplateTail | ts.TemplateExpression | ts.TemplateSpan | ts.ParenthesizedExpression | ts.ArrayLiteralExpression | ts.SpreadElement | ts.ObjectLiteralExpression | ts.PropertyAccessExpression | ts.ElementAccessExpression | ts.CallExpression | ts.ExpressionWithTypeArguments | ts.NewExpression | ts.TaggedTemplateExpression | ts.AsExpression | ts.TypeAssertion | ts.NonNullExpression | ts.MetaProperty | ts.JsxElement | ts.JsxOpeningElement | ts.JsxSelfClosingElement | ts.JsxFragment | ts.JsxOpeningFragment | ts.JsxClosingFragment | ts.JsxAttribute | ts.JsxSpreadAttribute | ts.JsxClosingElement | ts.JsxExpression | ts.JsxText | ts.NotEmittedStatement | ts.CommaListExpression | ts.EmptyStatement | ts.DebuggerStatement | ts.MissingDeclaration | ts.Block | ts.VariableStatement | ts.ExpressionStatement | ts.IfStatement | ts.DoStatement | ts.WhileStatement | ts.ForStatement | ts.ForInStatement | ts.ForOfStatement | ts.BreakStatement | ts.ContinueStatement | ts.ReturnStatement | ts.WithStatement | ts.SwitchStatement | ts.CaseBlock | ts.CaseClause | ts.DefaultClause | ts.LabeledStatement | ts.ThrowStatement | ts.TryStatement | ts.CatchClause | ts.ClassDeclaration | ts.ClassExpression | ts.InterfaceDeclaration | ts.HeritageClause | ts.TypeAliasDeclaration | ts.EnumMember | ts.EnumDeclaration | ts.ModuleDeclaration | ts.ModuleBlock | ts.ImportEqualsDeclaration | ts.ExternalModuleReference | ts.ImportDeclaration | ts.ImportClause | ts.NamespaceImport | ts.NamespaceExportDeclaration | ts.ExportDeclaration | ts.NamedImports | ts.NamedExports | ts.ImportSpecifier | ts.ExportSpecifier | ts.ExportAssignment | ts.SourceFile | ts.Bundle | ts.InputFiles | ts.UnparsedSource | ts.JsonMinusNumericLiteral | ts.JSDoc | ts.JSDocTypeExpression | ts.JSDocUnknownTag | ts.JSDocAugmentsTag | ts.JSDocClassTag | ts.JSDocEnumTag | ts.JSDocThisTag | ts.JSDocTemplateTag | ts.JSDocReturnTag | ts.JSDocTypeTag | ts.JSDocTypedefTag | ts.JSDocCallbackTag | ts.JSDocSignature | ts.JSDocPropertyTag | ts.JSDocParameterTag | ts.JSDocTypeLiteral | ts.JSDocFunctionType | ts.JSDocAllType | ts.JSDocUnknownType | ts.JSDocNullableType | ts.JSDocNonNullableType | ts.JSDocOptionalType | ts.JSDocVariadicType | ts.JSDocAuthorTag; +//# sourceMappingURL=ts-nodes.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts.map new file mode 100644 index 000000000..aacaf8190 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ts-nodes.d.ts","sourceRoot":"","sources":["../../src/ts-estree/ts-nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAKjC,OAAO,QAAQ,YAAY,CAAC;IAE1B,UAAiB,gBAAiB,SAAQ,EAAE,CAAC,IAAI;KAAG;CACrD;AAED,oBAAY,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;AAE9C,oBAAY,MAAM,GACd,EAAE,CAAC,QAAQ,GACX,EAAE,CAAC,UAAU,GACb,EAAE,CAAC,aAAa,GAChB,EAAE,CAAC,oBAAoB,GACvB,EAAE,CAAC,SAAS,GACZ,EAAE,CAAC,wBAAwB,GAE3B,EAAE,CAAC,wBAAwB,GAC3B,EAAE,CAAC,6BAA6B,GAChC,EAAE,CAAC,mBAAmB,GACtB,EAAE,CAAC,uBAAuB,GAC1B,EAAE,CAAC,oBAAoB,GACvB,EAAE,CAAC,cAAc,GACjB,EAAE,CAAC,iBAAiB,GACpB,EAAE,CAAC,mBAAmB,GACtB,EAAE,CAAC,kBAAkB,GACrB,EAAE,CAAC,2BAA2B,GAC9B,EAAE,CAAC,gBAAgB,GACnB,EAAE,CAAC,oBAAoB,GACv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AC,YAAY,GACf,EAAE,CAAC,eAAe,GAClB,EAAE,CAAC,gBAAgB,GACnB,EAAE,CAAC,cAAc,GACjB,EAAE,CAAC,gBAAgB,GACnB,EAAE,CAAC,iBAAiB,GACpB,EAAE,CAAC,gBAAgB,GACnB,EAAE,CAAC,iBAAiB,GACpB,EAAE,CAAC,YAAY,GACf,EAAE,CAAC,gBAAgB,GACnB,EAAE,CAAC,iBAAiB,GACpB,EAAE,CAAC,oBAAoB,GACvB,EAAE,CAAC,iBAAiB,GACpB,EAAE,CAAC,iBAAiB,GACpB,EAAE,CAAC,cAAc,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.js b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.js new file mode 100644 index 000000000..ba99b5f13 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=ts-nodes.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.js.map b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.js.map new file mode 100644 index 000000000..a4fa02c49 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ts-nodes.js","sourceRoot":"","sources":["../../src/ts-estree/ts-nodes.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/version-check.d.ts b/node_modules/@typescript-eslint/typescript-estree/dist/version-check.d.ts new file mode 100644 index 000000000..e5aa34ee7 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/version-check.d.ts @@ -0,0 +1,3 @@ +declare const typescriptVersionIsAtLeast: Record<"4.0" | "3.7" | "3.8" | "3.9", boolean>; +export { typescriptVersionIsAtLeast }; +//# sourceMappingURL=version-check.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/version-check.d.ts.map b/node_modules/@typescript-eslint/typescript-estree/dist/version-check.d.ts.map new file mode 100644 index 000000000..ffc7335f6 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/version-check.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"version-check.d.ts","sourceRoot":"","sources":["../src/version-check.ts"],"names":[],"mappings":"AAsBA,QAAA,MAAM,0BAA0B,gDAAkC,CAAC;AAKnE,OAAO,EAAE,0BAA0B,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/version-check.js b/node_modules/@typescript-eslint/typescript-estree/dist/version-check.js new file mode 100644 index 000000000..811b0397e --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/version-check.js @@ -0,0 +1,42 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.typescriptVersionIsAtLeast = void 0; +const semver = __importStar(require("semver")); +const ts = __importStar(require("typescript")); +function semverCheck(version) { + return semver.satisfies(ts.version, `>= ${version}.0 || >= ${version}.1-rc || >= ${version}.0-beta`, { + includePrerelease: true, + }); +} +const versions = [ + // + '3.7', + '3.8', + '3.9', + '4.0', +]; +const typescriptVersionIsAtLeast = {}; +exports.typescriptVersionIsAtLeast = typescriptVersionIsAtLeast; +for (const version of versions) { + typescriptVersionIsAtLeast[version] = semverCheck(version); +} +//# sourceMappingURL=version-check.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/dist/version-check.js.map b/node_modules/@typescript-eslint/typescript-estree/dist/version-check.js.map new file mode 100644 index 000000000..50620437a --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/dist/version-check.js.map @@ -0,0 +1 @@ +{"version":3,"file":"version-check.js","sourceRoot":"","sources":["../src/version-check.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,+CAAiC;AAEjC,SAAS,WAAW,CAAC,OAAe;IAClC,OAAO,MAAM,CAAC,SAAS,CACrB,EAAE,CAAC,OAAO,EACV,MAAM,OAAO,YAAY,OAAO,eAAe,OAAO,SAAS,EAC/D;QACE,iBAAiB,EAAE,IAAI;KACxB,CACF,CAAC;AACJ,CAAC;AAED,MAAM,QAAQ,GAAG;IACf,EAAE;IACF,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;CACG,CAAC;AAGX,MAAM,0BAA0B,GAAG,EAA+B,CAAC;AAK1D,gEAA0B;AAJnC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;IAC9B,0BAA0B,CAAC,OAAO,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;CAC5D"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/gitignore.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/gitignore.js new file mode 100644 index 000000000..6a1a57afd --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/gitignore.js @@ -0,0 +1,118 @@ +'use strict'; +const {promisify} = require('util'); +const fs = require('fs'); +const path = require('path'); +const fastGlob = require('fast-glob'); +const gitIgnore = require('ignore'); +const slash = require('slash'); + +const DEFAULT_IGNORE = [ + '**/node_modules/**', + '**/flow-typed/**', + '**/coverage/**', + '**/.git' +]; + +const readFileP = promisify(fs.readFile); + +const mapGitIgnorePatternTo = base => ignore => { + if (ignore.startsWith('!')) { + return '!' + path.posix.join(base, ignore.slice(1)); + } + + return path.posix.join(base, ignore); +}; + +const parseGitIgnore = (content, options) => { + const base = slash(path.relative(options.cwd, path.dirname(options.fileName))); + + return content + .split(/\r?\n/) + .filter(Boolean) + .filter(line => !line.startsWith('#')) + .map(mapGitIgnorePatternTo(base)); +}; + +const reduceIgnore = files => { + return files.reduce((ignores, file) => { + ignores.add(parseGitIgnore(file.content, { + cwd: file.cwd, + fileName: file.filePath + })); + return ignores; + }, gitIgnore()); +}; + +const ensureAbsolutePathForCwd = (cwd, p) => { + cwd = slash(cwd); + if (path.isAbsolute(p)) { + if (p.startsWith(cwd)) { + return p; + } + + throw new Error(`Path ${p} is not in cwd ${cwd}`); + } + + return path.join(cwd, p); +}; + +const getIsIgnoredPredecate = (ignores, cwd) => { + return p => ignores.ignores(slash(path.relative(cwd, ensureAbsolutePathForCwd(cwd, p)))); +}; + +const getFile = async (file, cwd) => { + const filePath = path.join(cwd, file); + const content = await readFileP(filePath, 'utf8'); + + return { + cwd, + filePath, + content + }; +}; + +const getFileSync = (file, cwd) => { + const filePath = path.join(cwd, file); + const content = fs.readFileSync(filePath, 'utf8'); + + return { + cwd, + filePath, + content + }; +}; + +const normalizeOptions = ({ + ignore = [], + cwd = slash(process.cwd()) +} = {}) => { + return {ignore, cwd}; +}; + +module.exports = async options => { + options = normalizeOptions(options); + + const paths = await fastGlob('**/.gitignore', { + ignore: DEFAULT_IGNORE.concat(options.ignore), + cwd: options.cwd + }); + + const files = await Promise.all(paths.map(file => getFile(file, options.cwd))); + const ignores = reduceIgnore(files); + + return getIsIgnoredPredecate(ignores, options.cwd); +}; + +module.exports.sync = options => { + options = normalizeOptions(options); + + const paths = fastGlob.sync('**/.gitignore', { + ignore: DEFAULT_IGNORE.concat(options.ignore), + cwd: options.cwd + }); + + const files = paths.map(file => getFileSync(file, options.cwd)); + const ignores = reduceIgnore(files); + + return getIsIgnoredPredecate(ignores, options.cwd); +}; diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/index.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/index.d.ts new file mode 100644 index 000000000..c40e4fec4 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/index.d.ts @@ -0,0 +1,176 @@ +import {Options as FastGlobOptions} from 'fast-glob'; + +declare namespace globby { + type ExpandDirectoriesOption = + | boolean + | readonly string[] + | {files?: readonly string[]; extensions?: readonly string[]}; + + interface GlobbyOptions extends FastGlobOptions { + /** + If set to `true`, `globby` will automatically glob directories for you. If you define an `Array` it will only glob files that matches the patterns inside the `Array`. You can also define an `Object` with `files` and `extensions` like in the example below. + + Note that if you set this option to `false`, you won't get back matched directories unless you set `onlyFiles: false`. + + @default true + + @example + ``` + import globby = require('globby'); + + (async () => { + const paths = await globby('images', { + expandDirectories: { + files: ['cat', 'unicorn', '*.jpg'], + extensions: ['png'] + } + }); + + console.log(paths); + //=> ['cat.png', 'unicorn.png', 'cow.jpg', 'rainbow.jpg'] + })(); + ``` + */ + readonly expandDirectories?: ExpandDirectoriesOption; + + /** + Respect ignore patterns in `.gitignore` files that apply to the globbed files. + + @default false + */ + readonly gitignore?: boolean; + } + + interface GlobTask { + readonly pattern: string; + readonly options: globby.GlobbyOptions; + } + + interface GitignoreOptions { + readonly cwd?: string; + readonly ignore?: readonly string[]; + } + + type FilterFunction = (path: string) => boolean; +} + +interface Gitignore { + /** + `.gitignore` files matched by the ignore config are not used for the resulting filter function. + + @returns A filter function indicating whether a given path is ignored via a `.gitignore` file. + + @example + ``` + import {gitignore} from 'globby'; + + (async () => { + const isIgnored = await gitignore(); + console.log(isIgnored('some/file')); + })(); + ``` + */ + (options?: globby.GitignoreOptions): Promise; + + /** + @returns A filter function indicating whether a given path is ignored via a `.gitignore` file. + */ + sync(options?: globby.GitignoreOptions): globby.FilterFunction; +} + +declare const globby: { + /** + Find files and directories using glob patterns. + + Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`. + + @param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns). + @param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in addition to the ones in this package. + @returns The matching paths. + + @example + ``` + import globby = require('globby'); + + (async () => { + const paths = await globby(['*', '!cake']); + + console.log(paths); + //=> ['unicorn', 'rainbow'] + })(); + ``` + */ + ( + patterns: string | readonly string[], + options?: globby.GlobbyOptions + ): Promise; + + /** + Find files and directories using glob patterns. + + Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`. + + @param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns). + @param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in addition to the ones in this package. + @returns The matching paths. + */ + sync( + patterns: string | readonly string[], + options?: globby.GlobbyOptions + ): string[]; + + /** + Find files and directories using glob patterns. + + Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`. + + @param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns). + @param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in addition to the ones in this package. + @returns The stream of matching paths. + + @example + ``` + import globby = require('globby'); + + (async () => { + for await (const path of globby.stream('*.tmp')) { + console.log(path); + } + })(); + ``` + */ + stream( + patterns: string | readonly string[], + options?: globby.GlobbyOptions + ): NodeJS.ReadableStream; + + /** + Note that you should avoid running the same tasks multiple times as they contain a file system cache. Instead, run this method each time to ensure file system changes are taken into consideration. + + @param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns). + @param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in addition to the ones in this package. + @returns An object in the format `{pattern: string, options: object}`, which can be passed as arguments to [`fast-glob`](https://github.com/mrmlnc/fast-glob). This is useful for other globbing-related packages. + */ + generateGlobTasks( + patterns: string | readonly string[], + options?: globby.GlobbyOptions + ): globby.GlobTask[]; + + /** + Note that the options affect the results. + + This function is backed by [`fast-glob`](https://github.com/mrmlnc/fast-glob#isdynamicpatternpattern-options). + + @param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns). + @param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3). + @returns Whether there are any special glob characters in the `patterns`. + */ + hasMagic( + patterns: string | readonly string[], + options?: FastGlobOptions + ): boolean; + + readonly gitignore: Gitignore; +}; + +export = globby; diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/index.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/index.js new file mode 100644 index 000000000..350405711 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/index.js @@ -0,0 +1,177 @@ +'use strict'; +const fs = require('fs'); +const arrayUnion = require('array-union'); +const merge2 = require('merge2'); +const fastGlob = require('fast-glob'); +const dirGlob = require('dir-glob'); +const gitignore = require('./gitignore'); +const {FilterStream, UniqueStream} = require('./stream-utils'); + +const DEFAULT_FILTER = () => false; + +const isNegative = pattern => pattern[0] === '!'; + +const assertPatternsInput = patterns => { + if (!patterns.every(pattern => typeof pattern === 'string')) { + throw new TypeError('Patterns must be a string or an array of strings'); + } +}; + +const checkCwdOption = (options = {}) => { + if (!options.cwd) { + return; + } + + let stat; + try { + stat = fs.statSync(options.cwd); + } catch (_) { + return; + } + + if (!stat.isDirectory()) { + throw new Error('The `cwd` option must be a path to a directory'); + } +}; + +const getPathString = p => p.stats instanceof fs.Stats ? p.path : p; + +const generateGlobTasks = (patterns, taskOptions) => { + patterns = arrayUnion([].concat(patterns)); + assertPatternsInput(patterns); + checkCwdOption(taskOptions); + + const globTasks = []; + + taskOptions = { + ignore: [], + expandDirectories: true, + ...taskOptions + }; + + for (const [index, pattern] of patterns.entries()) { + if (isNegative(pattern)) { + continue; + } + + const ignore = patterns + .slice(index) + .filter(isNegative) + .map(pattern => pattern.slice(1)); + + const options = { + ...taskOptions, + ignore: taskOptions.ignore.concat(ignore) + }; + + globTasks.push({pattern, options}); + } + + return globTasks; +}; + +const globDirs = (task, fn) => { + let options = {}; + if (task.options.cwd) { + options.cwd = task.options.cwd; + } + + if (Array.isArray(task.options.expandDirectories)) { + options = { + ...options, + files: task.options.expandDirectories + }; + } else if (typeof task.options.expandDirectories === 'object') { + options = { + ...options, + ...task.options.expandDirectories + }; + } + + return fn(task.pattern, options); +}; + +const getPattern = (task, fn) => task.options.expandDirectories ? globDirs(task, fn) : [task.pattern]; + +const getFilterSync = options => { + return options && options.gitignore ? + gitignore.sync({cwd: options.cwd, ignore: options.ignore}) : + DEFAULT_FILTER; +}; + +const globToTask = task => glob => { + const {options} = task; + if (options.ignore && Array.isArray(options.ignore) && options.expandDirectories) { + options.ignore = dirGlob.sync(options.ignore); + } + + return { + pattern: glob, + options + }; +}; + +module.exports = async (patterns, options) => { + const globTasks = generateGlobTasks(patterns, options); + + const getFilter = async () => { + return options && options.gitignore ? + gitignore({cwd: options.cwd, ignore: options.ignore}) : + DEFAULT_FILTER; + }; + + const getTasks = async () => { + const tasks = await Promise.all(globTasks.map(async task => { + const globs = await getPattern(task, dirGlob); + return Promise.all(globs.map(globToTask(task))); + })); + + return arrayUnion(...tasks); + }; + + const [filter, tasks] = await Promise.all([getFilter(), getTasks()]); + const paths = await Promise.all(tasks.map(task => fastGlob(task.pattern, task.options))); + + return arrayUnion(...paths).filter(path_ => !filter(getPathString(path_))); +}; + +module.exports.sync = (patterns, options) => { + const globTasks = generateGlobTasks(patterns, options); + + const tasks = globTasks.reduce((tasks, task) => { + const newTask = getPattern(task, dirGlob.sync).map(globToTask(task)); + return tasks.concat(newTask); + }, []); + + const filter = getFilterSync(options); + + return tasks.reduce( + (matches, task) => arrayUnion(matches, fastGlob.sync(task.pattern, task.options)), + [] + ).filter(path_ => !filter(path_)); +}; + +module.exports.stream = (patterns, options) => { + const globTasks = generateGlobTasks(patterns, options); + + const tasks = globTasks.reduce((tasks, task) => { + const newTask = getPattern(task, dirGlob.sync).map(globToTask(task)); + return tasks.concat(newTask); + }, []); + + const filter = getFilterSync(options); + const filterStream = new FilterStream(p => !filter(p)); + const uniqueStream = new UniqueStream(); + + return merge2(tasks.map(task => fastGlob.stream(task.pattern, task.options))) + .pipe(filterStream) + .pipe(uniqueStream); +}; + +module.exports.generateGlobTasks = generateGlobTasks; + +module.exports.hasMagic = (patterns, options) => [] + .concat(patterns) + .some(pattern => fastGlob.isDynamicPattern(pattern, options)); + +module.exports.gitignore = gitignore; diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/license b/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/package.json b/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/package.json new file mode 100644 index 000000000..bf95095ee --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/package.json @@ -0,0 +1,82 @@ +{ + "name": "globby", + "version": "11.0.1", + "description": "User-friendly glob matching", + "license": "MIT", + "repository": "sindresorhus/globby", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "bench": "npm update glob-stream fast-glob && matcha bench.js", + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts", + "gitignore.js", + "stream-utils.js" + ], + "keywords": [ + "all", + "array", + "directories", + "expand", + "files", + "filesystem", + "filter", + "find", + "fnmatch", + "folders", + "fs", + "glob", + "globbing", + "globs", + "gulpfriendly", + "match", + "matcher", + "minimatch", + "multi", + "multiple", + "paths", + "pattern", + "patterns", + "traverse", + "util", + "utility", + "wildcard", + "wildcards", + "promise", + "gitignore", + "git" + ], + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + }, + "devDependencies": { + "ava": "^2.1.0", + "get-stream": "^5.1.0", + "glob-stream": "^6.1.0", + "globby": "sindresorhus/globby#master", + "matcha": "^0.7.0", + "rimraf": "^3.0.0", + "tsd": "^0.11.0", + "xo": "^0.25.3" + }, + "xo": { + "ignores": [ + "fixtures" + ] + } +} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/readme.md b/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/readme.md new file mode 100644 index 000000000..709e5aa8c --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/readme.md @@ -0,0 +1,170 @@ +# globby [![Build Status](https://travis-ci.org/sindresorhus/globby.svg?branch=master)](https://travis-ci.org/sindresorhus/globby) + +> User-friendly glob matching + +Based on [`fast-glob`](https://github.com/mrmlnc/fast-glob) but adds a bunch of useful features. + +## Features + +- Promise API +- Multiple patterns +- Negated patterns: `['foo*', '!foobar']` +- Expands directories: `foo` → `foo/**/*` +- Supports `.gitignore` + +## Install + +``` +$ npm install globby +``` + +## Usage + +``` +├── unicorn +├── cake +└── rainbow +``` + +```js +const globby = require('globby'); + +(async () => { + const paths = await globby(['*', '!cake']); + + console.log(paths); + //=> ['unicorn', 'rainbow'] +})(); +``` + +## API + +Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`. + +### globby(patterns, options?) + +Returns a `Promise` of matching paths. + +#### patterns + +Type: `string | string[]` + +See supported `minimatch` [patterns](https://github.com/isaacs/minimatch#usage). + +#### options + +Type: `object` + +See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in addition to the ones below. + +##### expandDirectories + +Type: `boolean | string[] | object`\ +Default: `true` + +If set to `true`, `globby` will automatically glob directories for you. If you define an `Array` it will only glob files that matches the patterns inside the `Array`. You can also define an `object` with `files` and `extensions` like below: + +```js +const globby = require('globby'); + +(async () => { + const paths = await globby('images', { + expandDirectories: { + files: ['cat', 'unicorn', '*.jpg'], + extensions: ['png'] + } + }); + + console.log(paths); + //=> ['cat.png', 'unicorn.png', 'cow.jpg', 'rainbow.jpg'] +})(); +``` + +Note that if you set this option to `false`, you won't get back matched directories unless you set `onlyFiles: false`. + +##### gitignore + +Type: `boolean`\ +Default: `false` + +Respect ignore patterns in `.gitignore` files that apply to the globbed files. + +### globby.sync(patterns, options?) + +Returns `string[]` of matching paths. + +### globby.stream(patterns, options?) + +Returns a [`stream.Readable`](https://nodejs.org/api/stream.html#stream_readable_streams) of matching paths. + +Since Node.js 10, [readable streams are iterable](https://nodejs.org/api/stream.html#stream_readable_symbol_asynciterator), so you can loop over glob matches in a [`for await...of` loop](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of) like this: + +```js +const globby = require('globby'); + +(async () => { + for await (const path of globby.stream('*.tmp')) { + console.log(path); + } +})(); +``` + +### globby.generateGlobTasks(patterns, options?) + +Returns an `object[]` in the format `{pattern: string, options: Object}`, which can be passed as arguments to [`fast-glob`](https://github.com/mrmlnc/fast-glob). This is useful for other globbing-related packages. + +Note that you should avoid running the same tasks multiple times as they contain a file system cache. Instead, run this method each time to ensure file system changes are taken into consideration. + +### globby.hasMagic(patterns, options?) + +Returns a `boolean` of whether there are any special glob characters in the `patterns`. + +Note that the options affect the results. + +This function is backed by [`fast-glob`](https://github.com/mrmlnc/fast-glob#isdynamicpatternpattern-options). + +### globby.gitignore(options?) + +Returns a `Promise<(path: string) => boolean>` indicating whether a given path is ignored via a `.gitignore` file. + +Takes `cwd?: string` and `ignore?: string[]` as options. `.gitignore` files matched by the ignore config are not used for the resulting filter function. + +```js +const {gitignore} = require('globby'); + +(async () => { + const isIgnored = await gitignore(); + console.log(isIgnored('some/file')); +})(); +``` + +### globby.gitignore.sync(options?) + +Returns a `(path: string) => boolean` indicating whether a given path is ignored via a `.gitignore` file. + +Takes the same options as `globby.gitignore`. + +## Globbing patterns + +Just a quick overview. + +- `*` matches any number of characters, but not `/` +- `?` matches a single character, but not `/` +- `**` matches any number of characters, including `/`, as long as it's the only thing in a path part +- `{}` allows for a comma-separated list of "or" expressions +- `!` at the beginning of a pattern will negate the match + +[Various patterns and expected matches.](https://github.com/sindresorhus/multimatch/blob/master/test/test.js) + +## globby for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of globby and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-globby?utm_source=npm-globby&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +## Related + +- [multimatch](https://github.com/sindresorhus/multimatch) - Match against a list instead of the filesystem +- [matcher](https://github.com/sindresorhus/matcher) - Simple wildcard matching +- [del](https://github.com/sindresorhus/del) - Delete files and directories +- [make-dir](https://github.com/sindresorhus/make-dir) - Make a directory and its parents if needed diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/stream-utils.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/stream-utils.js new file mode 100644 index 000000000..98aedc896 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/stream-utils.js @@ -0,0 +1,46 @@ +'use strict'; +const {Transform} = require('stream'); + +class ObjectTransform extends Transform { + constructor() { + super({ + objectMode: true + }); + } +} + +class FilterStream extends ObjectTransform { + constructor(filter) { + super(); + this._filter = filter; + } + + _transform(data, encoding, callback) { + if (this._filter(data)) { + this.push(data); + } + + callback(); + } +} + +class UniqueStream extends ObjectTransform { + constructor() { + super(); + this._pushed = new Set(); + } + + _transform(data, encoding, callback) { + if (!this._pushed.has(data)) { + this.push(data); + this._pushed.add(data); + } + + callback(); + } +} + +module.exports = { + FilterStream, + UniqueStream +}; diff --git a/node_modules/tsutils/.editorconfig b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/.editorconfig similarity index 100% rename from node_modules/tsutils/.editorconfig rename to node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/.editorconfig diff --git a/node_modules/tsutils/.fimbullinter.yaml b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/.fimbullinter.yaml similarity index 100% rename from node_modules/tsutils/.fimbullinter.yaml rename to node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/.fimbullinter.yaml diff --git a/node_modules/tsutils/.wotanrc.yaml b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/.wotanrc.yaml similarity index 100% rename from node_modules/tsutils/.wotanrc.yaml rename to node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/.wotanrc.yaml diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/CHANGELOG.md b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/CHANGELOG.md new file mode 100644 index 000000000..0d01e793b --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/CHANGELOG.md @@ -0,0 +1,741 @@ +# 3.17.1 + +**Bugfixes:** + +* `isValidJsxIdentifier`, `isValidPropertyAccess`, `isValidPropertyName`: fix unicode character width handling + +# 3.17.0 + +**Features:** + +* `isValidJsxIdentifier` added an optional parameter to specify the target ECMAScript version + +**Bugfixes:** + +* `isValidJsxIdentifier` now handles astral plane characters + +# 3.16.0 + +**Features:** + +* added `getIteratorYieldResultFromIteratorResult` to extract the `yield`ed type from `IteratorResult` + +# 3.15.0 + +**Features:** + +* `isValidIdentifier`, `isValidPropertyName`, `isValidPropertyAccess`, `isValidNumericLiteral` added an optional parameter to specify the target ECMAScript version + +**Bugfixes:** + +* `isValidPropertyName`, `isValidPropertyAccess` now handle astral plane characters + +# 3.14.1 + +**Bugfixes:** + +* `findImports`: fixed crash on nested namespaces + +# 3.14.0 + +**Features:** + +* added `getInstanceTypeOfClassLikeDeclaration` and `getConstructorTypeOfClassLikeDeclaration` +* added `AccessKind.Delete` to `getAccessKind`: `getAccessKind(node) & AccessKind.Modification` can now be used to restore the old behavior of `isReassignmentTarget(node)` + +# 3.13.0 + +**Features:** + +* `getAccessKind` determines whether an expression is read from, written to or both +* optimized `getPropertyOfType` for unambiguous property names to partially work around https://github.com/microsoft/TypeScript/issues/31565 + +**Bugfixes:** + +* `isReassignmentTarget` no longer returns `true` for `DeleteExpression` as it doesn't **assign** a value to the operand + +# 3.12.0 + +**Features:** + +* `getLateBoundPropertyNamesOfPropertyName` returns all statically analyzable names of a property, method, ... +* `getSingleLateBoundPropertyNameOfPropertyName` returns the literal name of a property, method, ... if statically analyzable + +**Bugfixes:** + +* fixed circular import + +# 3.11.0 + +**Features:** + +* typeguards: `isNumericOrStringLikeLiteral`, `isTupleTypeReference` +* `intersectionTypeParts` as counterpart to `unionTypeParts` +* `someTypePart` to execute a callback for each union or intersection constituent until the callback returns true +* `getPropertyOfType` looks up a property by its escaped name +* `isPropertyReadonlyInType` determines whether a property in a given type cannot be written to +* `symbolHasReadonlyDeclaration` determines if a Symbol has any readonly or constant declaration +* `isNumericPropertyName` determines whether a property name would match an index signature +* `isBindableObjectDefinePropertyCall` returns true for statically analyzable forms of `Object.defineProperty(o, 'p', {value, writable})` +* `isReadonlyAssignmentDeclaration` determines whether an `Object.defineProperty` call is known to result in a readonly property +* `getLateBoundPropertyNames` returns all known property names of an expression +* `getPropertyNameFromType` extracts the property name of literal types +* `isWellKnownSymbolLiterally` to recognize expressions in the form of `Symbol.` +* `getPropertyNameOfWellKnownSymbol` returns the escaped name for a well known symbol literal +* `unwrapParentheses` returns the first child expression that is not a `ParenthesizedExpression` + +# 3.10.0 + +**Features:** + +* `isCompilerOptionEnabled`: `incremental` is implicitly enabled by `composite` + +**Bugfixes:** + +* `collectVariableUsage`/`getUsageDomain`: no longer treat `as const` as type usage + +# 3.9.1 + +**Bugfixes:** + +* reverted invalid deprecation of `canHaveJsdoc` +* fixed condition in `parseJsdocOfNode` + +# 3.9.0 + +**Features:** + +* added typeguards: `isNullLiteral` and `isBooleanLiteral` + +# 3.8.0 + +**Features:** + +* exposes typeguards for typescript@3.2 by default +* added utilities: `isConstAssertion` and `isInConstContext` + +# 3.7.0 + +**Features:** + +* added `isBlockScopedDeclarationStatement` +* added `isInSingleStatementContext` + +# 3.6.0 + +**Features:** + +* added `getCheckJsDirective` utility to parse `// @ts-check` and `// @ts-nocheck` pragmas + +# 3.5.2 + +**Bugfixes:** + +* Published declaration files no longer contain `const enum`. They are now declared as regular enums instead. + +# 3.5.1 + +**Bugfixes:** + +* `isThenableType` allows `Node` instead of `Expression` as parameter +* `isBlockScopeBoundary` and `isScopeBoundary` consider `WithStatement` as scope boundary + +# 3.5.0 + +**Features:** + +* correctly handle BigInt literals + * added typeguard `isBigIntLiteral` + * `isLiteralType` recognises BigInt + * `getPropertyName` adds special handling for BigInt + +# 3.4.0 + +**Features:** + +* added utility `commentText` to get the actual text content of a comment excluding the characters needed to start and end the comment + +# 3.3.1 + +**Bugfixes:** + +* `findImports`: fixed handling of ImportEqualsDeclaration + +# 3.3.0 + +**Features:** + +* `isCompilerOptionEnabled`: recognizes `strictBindCallApply` +* `getTokenAtPosition`: optionally includes JSDoc during lookup + +**Bugfixes:** + +* `isCompilerOptionEnabled`: correctly implements logic for `allowSyntheticDefaultImports` +* `findImportLikeNodes`: correctly finds imports in namespaces +* `findImportLikeNodes` / `findImports`: finds import types in JSDoc of JS files + +# 3.2.0 + +**Features:** + +* added utility `findImportLikeNodes` that works similar to `findImports` but returns the import statement or expression instead of the module specifier and doesn't filter non-string module specifiers + +# 3.1.0 + +**Features:** + +* added utilities: `isKeywordKind` and `isValidJsxIdentifier` +* exposes typeguards for typescript@3.0 by default + +# 3.0.0 + +:warning: **Breaking Changes:** + +* Dropped support for `typescript@<2.8.0` +* Dropped support for Node.js 4 +* Removed deprecated APIs: + * `getIdentifierText`, `isJsxFramgment`, `ImportOptions` + * deprected overloads of `isModifierFlagSet`, `findImports` and `getControlFlowEnd` +* control flow related symbols can no longer be imported from `'tsutils/util/util'`, import directly from `'tsutils/util/control-flow'` or `'tsutils/util'` +* `isFunctionScopeBoundary` and `isBlockScopeBoundary` now return a enum member of `ScopeBoundary` instead of a boolean +* `isFunctionScopeBoundary` no longer returns a truthy value for `InterfaceDeclaration`, `TypeAliasDeclaration` + +**Features:** + +* added utility `isTypeScopeBoundary` returning `ScopeBoundary.Type` or `ScopeBoundary.ConditionalType` +* added enum `ScopeBoundarySelector` whose members can be used to determine if a declaration belongs to a given `ScopeBoundary` by using bitwise AND + +**Bugfixes:** + +* `collectVariableUsage` now correctly handles `infer T` nested inside function signatures or mapped types +* `isCompilerOptionEnabled` correctly handles `skipDefaultLibCHeck` and `suppressImplicitAnyIndexErrors` + +# 2.29.0 + +**Features:** + +* added utility `isCompilerOptionEnabled` + +# 2.28.0 + +Typeguards are now split into multiple submodules for each version of TypeScript (starting with 2.8.0). +That means you can now import directly from `"tsutils/typeguard/2.8"` to get compatible declaraton files for TypeScript@2.8. +For more information please read the relevant section in [README.md](README.md). + +**Features:** + +* added typeguards: `isTupleType`, `isOptionalTypeNode`, `isRestTypeNode`, `isSyntheticExpression` (currently available from `"tsutils/typeguard/3.0"`) +* added utility `isStrictCompilerOptionEnabled` + +# 2.27.2 + +Avoid crash caused by removed function in `typescript@3.0.0`. + +# 2.27.1 + +Added support for TypeScript@3.0.0 nightly builds. + +# 2.27.0 + +**Features:** + +* added `getIIFE` utility + +# 2.26.2 + +**Bugfixes:** + +* `forEachComment` and `forEachTokenWithTrivia` no longer duplicate comments around missing nodes + +# 2.26.1 + +**Bugfixes:** + +* fixed crash in `hasSideEffects` with tagged template literal without substitution: ``tag`template` `` + +# 2.26.0 + +**Features:** + +* added typeguard `isLiteralTypeNode` +* added support for type imports (`type T = import('foo')`) to `findImports` via `ImportKind.ImportType` + +# 2.25.1 + +**Bugfixes:** + +* `collectVariableUsage`: fixed name lookup in function signatures to match runtime behavior. Note that this is not completely fixed in TypeScript, yet. See: [Microsoft/TypeScript#22825](https://github.com/Microsoft/TypeScript/issues/22825) and [Microsoft/TypeScript#22769](https://github.com/Microsoft/TypeScript/issues/22769) + +# 2.25.0 + +**Features:** + +* added utilities: `isStatementInAmbientContext` and `isAmbientModuleBlock` + +# 2.24.0 + +**Features:** + +* added typeguards for typescript@2.8: `isConditionalTypeNode`, `isInferTypeNode`, `isConditionalType`, `isInstantiableType`, `isSubstitutionType` + +# 2.23.0 + +**Features:** + +* added typeguard `isForInOrOfStatement` + +**Bugfixes:** + +* correctly handle comments in generic JSX elements: `/*comment*/>` +* fixed a bug with false positive trailing comments at the end of JSX self closing element: `

/*no comment*/
` + +# 2.22.2 + +**Bugfixes:** + +* `collectVariableUsage`: handle ConditionalTypes and `infer T`, which will be introduced in TypeScript@2.8.0 and are already available in nightly builds +* `isLiteralType` no longer returns true for `ts.TypeFlags.BooleanLiteral` as this is not a `ts.LiteralType` + +# 2.22.1 + +**Bugfixes:** + +* `endsControlFlow`: + * handle loops that might not even run a single iteration + * handle constant boolean conditions in loops and if + +# 2.22.0 + +**Features:** + +* added `isFalsyType` utility + +# 2.21.2 + +**Bugfixes:** + +* fixed compile error with `typescript@2.8.0-dev` + +# 2.21.1 + +**Bugfixes:** + +* `isReassignmentTarget`: handle type assertions and non-null assertion + +# 2.21.0 + +**Bugfixes:** + +* `forEachDeclaredVariable` uses a more precise type for the callback parameter to make it useable again with typescript@2.7.1 + +**Features:** + +* added `isUniqueESSymbolType` typeguard + +# 2.20.0 + +**Features:** + +* added `isThenableType` utility +* added `unionTypeParts` utility + +# 2.19.1 + +**Bugfixes:** + +* `forEachComment`, `getCommentAtPosition` and `isPositionInComment`: skip shebang (`#! something`) to not miss following comments at the start of the file + +# 2.19.0 + +**Features:** + +* added `WrappedAst` interface that models the type of a wrapped SourceFile more accurate +* added `getWrappedNodeAtPosition` utiltiy that takes a `NodeWrap` and returns the most deeply nested NodeWrap that contains the given position + +# 2.18.0 + +**Features:** + +* `getControlFlowEnd` accepts BlockLike as argument + +**Bugfixes:** + +* `getControlFlowEnd` and `endsControlFlow`: correctly handle nested LabeledStatements +* `endsControlFlow` removed erroneous special case when an IterationStatement is passed as argument whose parent is a LabeledStatement. + * if you want labels of an IterationStatement (or SwitchStatement) to be handled, you need to pass the LabeledStatement as argument. + * :warning: this fix may change the returned value if you relied on the buggy behavior + +**Deprecations:** + +* deprecated overload of `getControlFlowEnd` that contains the `label` parameter. This parameter is no longer used and should no longer be passed to the function. + +# 2.17.1 + +**Bugfixes:** + +* `getControlFlowEnd` and `endsControlFlow` (#22) + * ThrowStatements inside `try` are filtered out if there is a `catch` clause + * TryStatements with `catch` only end control flow if `try` AND `catch` definitely end control flow + +# 2.17.0 + +**Features:** + +* added `kind` property to `NodeWrap` +* added `getControlFlowEnd` to public API + +# 2.16.0 + +**Features:** + +* added `isDecorator` and `isCallLikeExpression` typeguards + +# 2.15.0 + +**Features:** + +* added `convertAst` utility to produce a flattened and wrapped version of the AST + +# 2.14.0 + +**Features:** + +* added `isDeleteExpression` +* added `getLineBreakStyle` + +# 2.13.1 + +**Bugfixes:** + +* fixed name of `isJsxFragment` + +# 2.13.0 + +**Features:** + +* added support for `JsxFragment` introduced in typescript@2.6.2 +* added corresponding typeguard functions + +# 2.12.2 + +**Bugfixes:** + +* `endsControlFlow` + * added missing logic for labeled statement, iteration statements and try-catch + * added missing logic for `break` and `continue` with labels + * take all jump statements into account, not only the last statement +* `isValidIdentifier` and `isValidNumericLiteral` handle irregular whitespace +* `findImports` searches in ambient modules inside regular `.ts` files (not only `.d.ts`) +* `canHaveJsDoc` is now a typeguard + +# 2.12.1 + +**Bugfixes:** + +* `forEachTokenWithTrivia` + * handles irregular whitespace and no longer visits some tokens twice + * correctly calculates the range of JsxText + +# 2.12.0 + +**API-Changes:** + +* deprecated `ImportOptions` if favor of the new `ImportKind` enum + +# 2.11.2 + +**Bugfixes:** + +* `parseJsDocOfNode`: set correct `pos`, `end` and `parent` properties. Also affects `getJsDoc` of `EndOfFileToken` + +# 2.11.1 + +**Bugfixes:** + +* `collectVariableUsage`: correctly consider catch binding as block scoped declaration inside catch block + +# 2.11.0 + +**Bugfixes:** + +* `getJsDoc` now correctly returns JsDoc for `EndOfFileToken` + +**Features:** + +* added utility `parseJsDocOfNode` + +# 2.10.0 + +**Features:** + +* added utility `findImports` to find all kinds of imports in a source file + +# 2.9.0 + +**Features:** + +* added typeguard `isMappedTypeNode` +* added utilities `canHaveJsDoc` and `getJsDoc` + +# 2.8.2 + +**Bugfixes:** + +* `collectVariableUsage`: handle global augmentation like other module augmentations + +# 2.8.1 + +**Bugfixes:** + +* Support `typescript@2.5.1` with optional catch binding +* `collectVariableUsage` fixed a bug where method decorator had method's parameters in scope + +# 2.8.0 + +* Compatibility with the latest typescript nightly +* Added `getIdentifierText` to unescape identifiers across typescript versions + +# 2.7.1 + +**Bugfixes:** + +* `isReassignmentTarget` don't return `true` for right side of assignment + +# 2.7.0 + +**Features:** + +* Added `isReassignmentTarget` utility + +# 2.6.1 + +**Bugfixes:** + +* `getDeclarationDomain` now returns `undefined` for Parameter in IndexSignature +* `collectVariableUsage` ignores Parameter in IndexSignature + +# 2.6.0 + +**Bugfixes:** + +* `collectVariableUsage`: + * don't merge imports with global declarations + * treat everything in a declaration file as exported if there is no explicit `export {};` +* `isExpressionValueUsed`: handle destructuring in `for...of` + +**Features:** + +* Added `getModifier` utility +* Added `DeclarationDomain.Import` to distinguish imports from other declarations + +# 2.5.1 + +**Bugfixes:** + +* `collectVariableUsage` ignore jump labels as in `break label;` + +# 2.5.0 + +**Bugfixes:** + +* `isFunctionWithBody` handles constructor overload correctly. + +**Features:** + +* Implemented `isExpressionValueUsed` to check whether the result of an expression is actually used. +* Implemented `getDeclarationDomain` to determine if a given declaration introduces a new symbol in the value or type domain. + +**`collectVariableUses` is now usable** + +* no longer ignores signatures and its parameters +* don't merge declarations and uses across domains +* no longer marks exceptions in catch clause or parameter properties as exported +* fixed exports of namespaces +* fixed scoping of ClassExpression name +* correcly handle ambient namespaces and module augmentations +* fixed how `: typeof foo` is handled for parameters and function return type +* **still WIP**: `export {Foo as Bar}` inside ambient namespaces and modules + +# 2.4.0 + +**Bugfixes:** + +* `getLineRanges`: `contentLength` now contains the correct line length when there are multiple consecutive line break characters +* `getTokenAtPosition`: don't match tokens that end at the specified position (because that's already outside of their range) +* deprecated the misnamed `isModfierFlagSet`, use the new `isModifierFlagSet` instead + +**Features:** + +* Added typeguard: `isJsDoc` +* Added experimental scope and usage analysis (`getUsageDomain` and `collectVariableUsage`) + +# 2.3.0 + +**Bugfixes:** + +* `forEachComment` no longer omits some comments when callback returns a truthy value +* `isPositionInComment` fixed false positive inside JSXText + +**Features:** + +* Added utility: `getCommentAtPosition` + +# 2.2.0 + +**Bugfixes:** + +* Fixed bit value of `SideEffectOptions.JsxElement` to be a power of 2 + +**Features:** + +* Added utilities: `getTokenAtPosition` and `isPositionInComment` + +# 2.1.0 + +**Features:** + +* Added typeguard `isExpression` +* Added utilities: `hasSideEffects`, `getDeclarationOfBindingElement` + +# 2.0.0 + +**Breaking Changes:** + +* Dropped compatibility with `typescript@<2.1.0` +* Removed misnamed `isNumericliteral`, use `isNumericLiteral` instead (notice the uppercase L) +* Removed `isEnumLiteralType` which will cause compile errors with typescript@2.4.0 +* Refactored directory structure: all imports that referenced subdirectories (e.g. `require('tsutils/src/typeguard')` will be broken + +**Features:** + +* New directory structure allows imports of typeguards or utils independently, e.g. (`require('tsutils/typeguard')`) + +# 1.9.1 + +**Bugfixes:** + +* `isObjectFlagSet` now uses the correct `objectFlags` property + +# 1.9.0 + +**Bugfixes:** + +* `getNextToken` no longer omits `EndOfFileToken` when there is no trivia before EOF. That means the only inputs where `getNextToken` returns `undefined` are `SourceFile` and `EndOfFileToken` + +**Features**: + +* Added typeguards for types +* Added utilities for flag checking: `isNodeFlagSet`, `isTypeFlagSet`, `isSymbolFlagSet`,`isObjectFlagSet`, `isModifierFlagSet` + +# 1.8.0 + +**Features:** + +* Support peer dependency of typescript nightlies of 2.4.0 +* Added typeguards: `isJsxAttributes`, `isIntersectionTypeNode`, `isTypeOperatorNode`, `isTypePredicateNode`, `isTypeQueryNode`, `isUnionTypeNode` + +# 1.7.0 + +**Bugfixes:** + +* `isFunctionScopeBoundary` now handles Interfaces, TypeAliases, FunctionSignatures, etc + +**Features:** + +* Added utilities: `isThisParameter`, `isSameLine` and `isFunctionWithBody` + +# 1.6.0 + +**Features:** + +* Add `isValidPropertyAccess`, `isValidNumericLiteral` and `isValidPropertyName` + +# 1.5.0 + +**Features:** + +* Add `isValidIdentifier` + +# 1.4.0 + +**Features:** + +* Add `contentLength` property to the result of `getLineRanges` + +# 1.3.0 + +**Bugfixes:** + +* `canHaveLeadingTrivia`: + * Fix property access on undefined parent reference + * Fixes: [palantir/tslint#2330](https://github.com/palantir/tslint/issues/2330) +* `hasOwnThisReference`: now includes accessors on object literals + +**Features:** + +* Typeguards: + * isTypeParameterDeclaration + * isEnitityName + +# 1.2.2 + +**Bugfixes:** + +* `hasOwnThisReference`: + * exclude overload signatures of function declarations + * add method declarations on object literals + +# 1.2.1 + +**Bugfixes:** + +* Fix name of `isNumericLiteral` + +# 1.2.0 + +**Features:** + +* Typeguards: + * isEnumMember + * isExpressionWithTypeArguments + * isImportSpecifier +* Utilities: + * isJsDocKind, isTypeNodeKind +* Allow typescript@next in peerDependencies + +# 1.1.0 + +**Bugfixes:** + +* Fix isBlockScopeBoundary: Remove WithStatement, IfStatment, DoStatement and WhileStatement because they are no scope boundary whitout a block. + +**Features:** + +* Added more typeguards: + * isAssertionExpression + * isEmptyStatement + * isJsxAttributeLike + * isJsxOpeningLikeElement + * isNonNullExpression + * isSyntaxList +* Utilities: + * getNextToken, getPreviousToken + * hasOwnThisReference + * getLineRanges + +# 1.0.0 + +**Features:** + +* Initial implementation of typeguards +* Utilities: + * getChildOfKind + * isNodeKind, isAssignmentKind + * hasModifier, isParameterProperty, hasAccessModifier + * getPreviousStatement, getNextStatement + * getPropertyName + * forEachDestructuringIdentifier, forEachDeclaredVariable + * getVariableDeclarationKind, isBlockScopedVariableDeclarationList, isBlockScopedVariableDeclaration + * isScopeBoundary, isFunctionScopeBoundary, isBlockScopeBoundary + * forEachToken, forEachTokenWithTrivia, forEachComment + * endsControlFlow diff --git a/node_modules/tsutils/LICENSE b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/LICENSE similarity index 100% rename from node_modules/tsutils/LICENSE rename to node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/LICENSE diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/README.md b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/README.md new file mode 100644 index 000000000..a2363e6ac --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/README.md @@ -0,0 +1,61 @@ +# Utility functions for working with typescript's AST + +[![Greenkeeper badge](https://badges.greenkeeper.io/ajafff/tsutils.svg)](https://greenkeeper.io/) + +## Usage + +This package consists of two major parts: utilities and typeguard functions. +By importing the project you will get both of them. +```js +import * as utils from "tsutils"; +utils.isIdentifier(node); // typeguard +utils.getLineRanges(sourceFile); // utilities +``` + +If you don't need everything offered by this package, you can select what should be imported. The parts that are not imported are never read from disk and may save some startup time and reduce memory consumtion. + +If you only need typeguards you can explicitly import them: +```js +import { isIdentifier } from "tsutils/typeguard"; +// You can even distiguish between typeguards for nodes and types +import { isUnionTypeNode } from "tsutils/typeguard/node"; +import { isUnionType } from "tsutils/typeguard/type"; +``` + +If you only need the utilities you can also explicitly import them: +```js +import { forEachComment, forEachToken } from "tsutils/util"; +``` + +### Typescript version dependency + +This package is backwards compatible with typescript 2.8.0 at runtime although compiling might need a newer version of typescript installed. + +Using `typescript@next` might work, but it's not officially supported. If you encounter any bugs, please open an issue. + +For compatibility with older versions of TypeScript typeguard functions are separated by TypeScript version. If you are stuck on `typescript@2.8`, you should import directly from the submodule for that version: + +```js +// all typeguards compatible with typescript@2.8 +import { isIdentifier } from "tsutils/typeguard/2.8"; +// you can even use nested submodules +import { isIdentifier } from "tsutils/typeguard/2.8/node"; + +// all typeguards compatible with typescript@2.9 (includes those of 2.8) +import { isIdentifier } from "tsutils/typeguard/2.9"; + +// always points to the latest stable version (2.9 as of writing this) +import { isIdentifier } from "tsutils/typeguard"; +import { isIdentifier } from "tsutils"; + +// always points to the typeguards for the next TypeScript version (3.0 as of writing this) +import { isIdentifier } from "tsutils/typeguard/next"; +``` + +Note that if you are also using utility functions, you should prefer the relevant submodule: + +```js +// importing directly from 'tsutils' would pull in the latest typeguards +import { forEachToken } from 'tsutils/util'; +import { isIdentifier } from 'tsutils/typeguard/2.8'; +``` diff --git a/node_modules/tsutils/index.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/index.d.ts similarity index 100% rename from node_modules/tsutils/index.d.ts rename to node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/index.d.ts diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/index.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/index.js new file mode 100644 index 000000000..4ee8dc264 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./typeguard"), exports); +tslib_1.__exportStar(require("./util"), exports); diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/package.json b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/package.json new file mode 100644 index 000000000..dbe0a2098 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/package.json @@ -0,0 +1,61 @@ +{ + "name": "tsutils", + "version": "3.17.1", + "description": "utilities for working with typescript's AST", + "scripts": { + "compile": "rm -rf {,util,typeguard,test/**}/*.js; ttsc -p .", + "lint:tslint": "wotan -m @fimbul/valtyr", + "lint:wotan": "wotan", + "lint": "run-p lint:*", + "test": "mocha test/*Tests.js && tslint --test 'test/rules/**/tslint.json'", + "verify": "run-s compile lint coverage", + "prepublishOnly": "run-s verify", + "coverage": "nyc run-s test", + "report-coverage": "cat ./coverage/lcov.info | coveralls", + "github-release": "GITHUB_TOKEN=$(cat ~/github_token.txt) github-release-from-changelog", + "postpublish": "git push origin master --tags; run-s github-release" + }, + "repository": { + "type": "git", + "url": "https://github.com/ajafff/tsutils" + }, + "keywords": [ + "typescript", + "ts", + "ast", + "typeguard", + "utils", + "helper", + "node" + ], + "author": "Klaus Meinhardt", + "license": "MIT", + "devDependencies": { + "@fimbul/mithotyn": "^0.17.0", + "@fimbul/valtyr": "^0.20.0", + "@fimbul/wotan": "^0.20.0", + "@types/chai": "^4.0.10", + "@types/mocha": "^5.0.0", + "@types/node": "^11.13.0", + "chai": "^4.1.2", + "coveralls": "^3.0.0", + "github-release-from-changelog": "^1.3.0", + "mocha": "^6.0.2", + "npm-run-all": "^4.1.2", + "nyc": "^13.3.0", + "ts-transform-const-enum": "^0.0.1", + "tslint": "^5.8.0", + "tslint-consistent-codestyle": "^1.11.0", + "ttypescript": "^1.5.5", + "typescript": "^3.6.0-dev.20190804" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + }, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + } +} \ No newline at end of file diff --git a/node_modules/tsutils/typeguard/2.8/index.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.8/index.d.ts similarity index 100% rename from node_modules/tsutils/typeguard/2.8/index.d.ts rename to node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.8/index.d.ts diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.8/index.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.8/index.js new file mode 100644 index 000000000..0c381e79a --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.8/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./node"), exports); +tslib_1.__exportStar(require("./type"), exports); diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.8/node.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.8/node.d.ts new file mode 100644 index 000000000..c5aa5a9d1 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.8/node.d.ts @@ -0,0 +1,155 @@ +import * as ts from 'typescript'; +export declare function isAccessorDeclaration(node: ts.Node): node is ts.AccessorDeclaration; +export declare function isArrayBindingPattern(node: ts.Node): node is ts.ArrayBindingPattern; +export declare function isArrayLiteralExpression(node: ts.Node): node is ts.ArrayLiteralExpression; +export declare function isArrayTypeNode(node: ts.Node): node is ts.ArrayTypeNode; +export declare function isArrowFunction(node: ts.Node): node is ts.ArrowFunction; +export declare function isAsExpression(node: ts.Node): node is ts.AsExpression; +export declare function isAssertionExpression(node: ts.Node): node is ts.AssertionExpression; +export declare function isAwaitExpression(node: ts.Node): node is ts.AwaitExpression; +export declare function isBinaryExpression(node: ts.Node): node is ts.BinaryExpression; +export declare function isBindingElement(node: ts.Node): node is ts.BindingElement; +export declare function isBindingPattern(node: ts.Node): node is ts.BindingPattern; +export declare function isBlock(node: ts.Node): node is ts.Block; +export declare function isBlockLike(node: ts.Node): node is ts.BlockLike; +export declare function isBooleanLiteral(node: ts.Node): node is ts.BooleanLiteral; +export declare function isBreakOrContinueStatement(node: ts.Node): node is ts.BreakOrContinueStatement; +export declare function isBreakStatement(node: ts.Node): node is ts.BreakStatement; +export declare function isCallExpression(node: ts.Node): node is ts.CallExpression; +export declare function isCallLikeExpression(node: ts.Node): node is ts.CallLikeExpression; +export declare function isCallSignatureDeclaration(node: ts.Node): node is ts.CallSignatureDeclaration; +export declare function isCaseBlock(node: ts.Node): node is ts.CaseBlock; +export declare function isCaseClause(node: ts.Node): node is ts.CaseClause; +export declare function isCaseOrDefaultClause(node: ts.Node): node is ts.CaseOrDefaultClause; +export declare function isCatchClause(node: ts.Node): node is ts.CatchClause; +export declare function isClassDeclaration(node: ts.Node): node is ts.ClassDeclaration; +export declare function isClassExpression(node: ts.Node): node is ts.ClassExpression; +export declare function isClassLikeDeclaration(node: ts.Node): node is ts.ClassLikeDeclaration; +export declare function isCommaListExpression(node: ts.Node): node is ts.CommaListExpression; +export declare function isConditionalExpression(node: ts.Node): node is ts.ConditionalExpression; +export declare function isConditionalTypeNode(node: ts.Node): node is ts.ConditionalTypeNode; +export declare function isConstructorDeclaration(node: ts.Node): node is ts.ConstructorDeclaration; +export declare function isConstructorTypeNode(node: ts.Node): node is ts.ConstructorTypeNode; +export declare function isConstructSignatureDeclaration(node: ts.Node): node is ts.ConstructSignatureDeclaration; +export declare function isContinueStatement(node: ts.Node): node is ts.ContinueStatement; +export declare function isComputedPropertyName(node: ts.Node): node is ts.ComputedPropertyName; +export declare function isDebuggerStatement(node: ts.Node): node is ts.DebuggerStatement; +export declare function isDecorator(node: ts.Node): node is ts.Decorator; +export declare function isDefaultClause(node: ts.Node): node is ts.DefaultClause; +export declare function isDeleteExpression(node: ts.Node): node is ts.DeleteExpression; +export declare function isDoStatement(node: ts.Node): node is ts.DoStatement; +export declare function isElementAccessExpression(node: ts.Node): node is ts.ElementAccessExpression; +export declare function isEmptyStatement(node: ts.Node): node is ts.EmptyStatement; +export declare function isEntityName(node: ts.Node): node is ts.EntityName; +export declare function isEntityNameExpression(node: ts.Node): node is ts.EntityNameExpression; +export declare function isEnumDeclaration(node: ts.Node): node is ts.EnumDeclaration; +export declare function isEnumMember(node: ts.Node): node is ts.EnumMember; +export declare function isExportAssignment(node: ts.Node): node is ts.ExportAssignment; +export declare function isExportDeclaration(node: ts.Node): node is ts.ExportDeclaration; +export declare function isExportSpecifier(node: ts.Node): node is ts.ExportSpecifier; +export declare function isExpression(node: ts.Node): node is ts.Expression; +export declare function isExpressionStatement(node: ts.Node): node is ts.ExpressionStatement; +export declare function isExpressionWithTypeArguments(node: ts.Node): node is ts.ExpressionWithTypeArguments; +export declare function isExternalModuleReference(node: ts.Node): node is ts.ExternalModuleReference; +export declare function isForInStatement(node: ts.Node): node is ts.ForInStatement; +export declare function isForInOrOfStatement(node: ts.Node): node is ts.ForInOrOfStatement; +export declare function isForOfStatement(node: ts.Node): node is ts.ForOfStatement; +export declare function isForStatement(node: ts.Node): node is ts.ForStatement; +export declare function isFunctionDeclaration(node: ts.Node): node is ts.FunctionDeclaration; +export declare function isFunctionExpression(node: ts.Node): node is ts.FunctionExpression; +export declare function isFunctionTypeNode(node: ts.Node): node is ts.FunctionTypeNode; +export declare function isGetAccessorDeclaration(node: ts.Node): node is ts.GetAccessorDeclaration; +export declare function isIdentifier(node: ts.Node): node is ts.Identifier; +export declare function isIfStatement(node: ts.Node): node is ts.IfStatement; +export declare function isImportClause(node: ts.Node): node is ts.ImportClause; +export declare function isImportDeclaration(node: ts.Node): node is ts.ImportDeclaration; +export declare function isImportEqualsDeclaration(node: ts.Node): node is ts.ImportEqualsDeclaration; +export declare function isImportSpecifier(node: ts.Node): node is ts.ImportSpecifier; +export declare function isIndexedAccessTypeNode(node: ts.Node): node is ts.IndexedAccessTypeNode; +export declare function isIndexSignatureDeclaration(node: ts.Node): node is ts.IndexSignatureDeclaration; +export declare function isInferTypeNode(node: ts.Node): node is ts.InferTypeNode; +export declare function isInterfaceDeclaration(node: ts.Node): node is ts.InterfaceDeclaration; +export declare function isIntersectionTypeNode(node: ts.Node): node is ts.IntersectionTypeNode; +export declare function isIterationStatement(node: ts.Node): node is ts.IterationStatement; +export declare function isJsDoc(node: ts.Node): node is ts.JSDoc; +export declare function isJsxAttribute(node: ts.Node): node is ts.JsxAttribute; +export declare function isJsxAttributeLike(node: ts.Node): node is ts.JsxAttributeLike; +export declare function isJsxAttributes(node: ts.Node): node is ts.JsxAttributes; +export declare function isJsxClosingElement(node: ts.Node): node is ts.JsxClosingElement; +export declare function isJsxClosingFragment(node: ts.Node): node is ts.JsxClosingFragment; +export declare function isJsxElement(node: ts.Node): node is ts.JsxElement; +export declare function isJsxExpression(node: ts.Node): node is ts.JsxExpression; +export declare function isJsxFragment(node: ts.Node): node is ts.JsxFragment; +export declare function isJsxOpeningElement(node: ts.Node): node is ts.JsxOpeningElement; +export declare function isJsxOpeningFragment(node: ts.Node): node is ts.JsxOpeningFragment; +export declare function isJsxOpeningLikeElement(node: ts.Node): node is ts.JsxOpeningLikeElement; +export declare function isJsxSelfClosingElement(node: ts.Node): node is ts.JsxSelfClosingElement; +export declare function isJsxSpreadAttribute(node: ts.Node): node is ts.JsxSpreadAttribute; +export declare function isJsxText(node: ts.Node): node is ts.JsxText; +export declare function isLabeledStatement(node: ts.Node): node is ts.LabeledStatement; +export declare function isLiteralExpression(node: ts.Node): node is ts.LiteralExpression; +export declare function isLiteralTypeNode(node: ts.Node): node is ts.LiteralTypeNode; +export declare function isMappedTypeNode(node: ts.Node): node is ts.MappedTypeNode; +export declare function isMetaProperty(node: ts.Node): node is ts.MetaProperty; +export declare function isMethodDeclaration(node: ts.Node): node is ts.MethodDeclaration; +export declare function isMethodSignature(node: ts.Node): node is ts.MethodSignature; +export declare function isModuleBlock(node: ts.Node): node is ts.ModuleBlock; +export declare function isModuleDeclaration(node: ts.Node): node is ts.ModuleDeclaration; +export declare function isNamedExports(node: ts.Node): node is ts.NamedExports; +export declare function isNamedImports(node: ts.Node): node is ts.NamedImports; +export declare function isNamespaceDeclaration(node: ts.Node): node is ts.NamespaceDeclaration; +export declare function isNamespaceImport(node: ts.Node): node is ts.NamespaceImport; +export declare function isNamespaceExportDeclaration(node: ts.Node): node is ts.NamespaceExportDeclaration; +export declare function isNewExpression(node: ts.Node): node is ts.NewExpression; +export declare function isNonNullExpression(node: ts.Node): node is ts.NonNullExpression; +export declare function isNoSubstitutionTemplateLiteral(node: ts.Node): node is ts.NoSubstitutionTemplateLiteral; +export declare function isNullLiteral(node: ts.Node): node is ts.NullLiteral; +export declare function isNumericLiteral(node: ts.Node): node is ts.NumericLiteral; +export declare function isNumericOrStringLikeLiteral(node: ts.Node): node is ts.NumericLiteral | ts.StringLiteral | ts.NoSubstitutionTemplateLiteral; +export declare function isObjectBindingPattern(node: ts.Node): node is ts.ObjectBindingPattern; +export declare function isObjectLiteralExpression(node: ts.Node): node is ts.ObjectLiteralExpression; +export declare function isOmittedExpression(node: ts.Node): node is ts.OmittedExpression; +export declare function isParameterDeclaration(node: ts.Node): node is ts.ParameterDeclaration; +export declare function isParenthesizedExpression(node: ts.Node): node is ts.ParenthesizedExpression; +export declare function isParenthesizedTypeNode(node: ts.Node): node is ts.ParenthesizedTypeNode; +export declare function isPostfixUnaryExpression(node: ts.Node): node is ts.PostfixUnaryExpression; +export declare function isPrefixUnaryExpression(node: ts.Node): node is ts.PrefixUnaryExpression; +export declare function isPropertyAccessExpression(node: ts.Node): node is ts.PropertyAccessExpression; +export declare function isPropertyAssignment(node: ts.Node): node is ts.PropertyAssignment; +export declare function isPropertyDeclaration(node: ts.Node): node is ts.PropertyDeclaration; +export declare function isPropertySignature(node: ts.Node): node is ts.PropertySignature; +export declare function isQualifiedName(node: ts.Node): node is ts.QualifiedName; +export declare function isRegularExpressionLiteral(node: ts.Node): node is ts.RegularExpressionLiteral; +export declare function isReturnStatement(node: ts.Node): node is ts.ReturnStatement; +export declare function isSetAccessorDeclaration(node: ts.Node): node is ts.SetAccessorDeclaration; +export declare function isShorthandPropertyAssignment(node: ts.Node): node is ts.ShorthandPropertyAssignment; +export declare function isSignatureDeclaration(node: ts.Node): node is ts.SignatureDeclaration; +export declare function isSourceFile(node: ts.Node): node is ts.SourceFile; +export declare function isSpreadAssignment(node: ts.Node): node is ts.SpreadAssignment; +export declare function isSpreadElement(node: ts.Node): node is ts.SpreadElement; +export declare function isStringLiteral(node: ts.Node): node is ts.StringLiteral; +export declare function isSwitchStatement(node: ts.Node): node is ts.SwitchStatement; +export declare function isSyntaxList(node: ts.Node): node is ts.SyntaxList; +export declare function isTaggedTemplateExpression(node: ts.Node): node is ts.TaggedTemplateExpression; +export declare function isTemplateExpression(node: ts.Node): node is ts.TemplateExpression; +export declare function isTemplateLiteral(node: ts.Node): node is ts.TemplateLiteral; +export declare function isTextualLiteral(node: ts.Node): node is ts.StringLiteral | ts.NoSubstitutionTemplateLiteral; +export declare function isThrowStatement(node: ts.Node): node is ts.ThrowStatement; +export declare function isTryStatement(node: ts.Node): node is ts.TryStatement; +export declare function isTupleTypeNode(node: ts.Node): node is ts.TupleTypeNode; +export declare function isTypeAliasDeclaration(node: ts.Node): node is ts.TypeAliasDeclaration; +export declare function isTypeAssertion(node: ts.Node): node is ts.TypeAssertion; +export declare function isTypeLiteralNode(node: ts.Node): node is ts.TypeLiteralNode; +export declare function isTypeOfExpression(node: ts.Node): node is ts.TypeOfExpression; +export declare function isTypeOperatorNode(node: ts.Node): node is ts.TypeOperatorNode; +export declare function isTypeParameterDeclaration(node: ts.Node): node is ts.TypeParameterDeclaration; +export declare function isTypePredicateNode(node: ts.Node): node is ts.TypePredicateNode; +export declare function isTypeReferenceNode(node: ts.Node): node is ts.TypeReferenceNode; +export declare function isTypeQueryNode(node: ts.Node): node is ts.TypeQueryNode; +export declare function isUnionTypeNode(node: ts.Node): node is ts.UnionTypeNode; +export declare function isVariableDeclaration(node: ts.Node): node is ts.VariableDeclaration; +export declare function isVariableStatement(node: ts.Node): node is ts.VariableStatement; +export declare function isVariableDeclarationList(node: ts.Node): node is ts.VariableDeclarationList; +export declare function isVoidExpression(node: ts.Node): node is ts.VoidExpression; +export declare function isWhileStatement(node: ts.Node): node is ts.WhileStatement; +export declare function isWithStatement(node: ts.Node): node is ts.WithStatement; diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.8/node.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.8/node.js new file mode 100644 index 000000000..b63a09be9 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.8/node.js @@ -0,0 +1,709 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const ts = require("typescript"); +function isAccessorDeclaration(node) { + return node.kind === ts.SyntaxKind.GetAccessor || + node.kind === ts.SyntaxKind.SetAccessor; +} +exports.isAccessorDeclaration = isAccessorDeclaration; +function isArrayBindingPattern(node) { + return node.kind === ts.SyntaxKind.ArrayBindingPattern; +} +exports.isArrayBindingPattern = isArrayBindingPattern; +function isArrayLiteralExpression(node) { + return node.kind === ts.SyntaxKind.ArrayLiteralExpression; +} +exports.isArrayLiteralExpression = isArrayLiteralExpression; +function isArrayTypeNode(node) { + return node.kind === ts.SyntaxKind.ArrayType; +} +exports.isArrayTypeNode = isArrayTypeNode; +function isArrowFunction(node) { + return node.kind === ts.SyntaxKind.ArrowFunction; +} +exports.isArrowFunction = isArrowFunction; +function isAsExpression(node) { + return node.kind === ts.SyntaxKind.AsExpression; +} +exports.isAsExpression = isAsExpression; +function isAssertionExpression(node) { + return node.kind === ts.SyntaxKind.AsExpression || + node.kind === ts.SyntaxKind.TypeAssertionExpression; +} +exports.isAssertionExpression = isAssertionExpression; +function isAwaitExpression(node) { + return node.kind === ts.SyntaxKind.AwaitExpression; +} +exports.isAwaitExpression = isAwaitExpression; +function isBinaryExpression(node) { + return node.kind === ts.SyntaxKind.BinaryExpression; +} +exports.isBinaryExpression = isBinaryExpression; +function isBindingElement(node) { + return node.kind === ts.SyntaxKind.BindingElement; +} +exports.isBindingElement = isBindingElement; +function isBindingPattern(node) { + return node.kind === ts.SyntaxKind.ArrayBindingPattern || + node.kind === ts.SyntaxKind.ObjectBindingPattern; +} +exports.isBindingPattern = isBindingPattern; +function isBlock(node) { + return node.kind === ts.SyntaxKind.Block; +} +exports.isBlock = isBlock; +function isBlockLike(node) { + return node.statements !== undefined; +} +exports.isBlockLike = isBlockLike; +function isBooleanLiteral(node) { + return node.kind === ts.SyntaxKind.TrueKeyword || node.kind === ts.SyntaxKind.FalseKeyword; +} +exports.isBooleanLiteral = isBooleanLiteral; +function isBreakOrContinueStatement(node) { + return node.kind === ts.SyntaxKind.BreakStatement || + node.kind === ts.SyntaxKind.ContinueStatement; +} +exports.isBreakOrContinueStatement = isBreakOrContinueStatement; +function isBreakStatement(node) { + return node.kind === ts.SyntaxKind.BreakStatement; +} +exports.isBreakStatement = isBreakStatement; +function isCallExpression(node) { + return node.kind === ts.SyntaxKind.CallExpression; +} +exports.isCallExpression = isCallExpression; +function isCallLikeExpression(node) { + switch (node.kind) { + case ts.SyntaxKind.CallExpression: + case ts.SyntaxKind.Decorator: + case ts.SyntaxKind.JsxOpeningElement: + case ts.SyntaxKind.JsxSelfClosingElement: + case ts.SyntaxKind.NewExpression: + case ts.SyntaxKind.TaggedTemplateExpression: + return true; + default: + return false; + } +} +exports.isCallLikeExpression = isCallLikeExpression; +function isCallSignatureDeclaration(node) { + return node.kind === ts.SyntaxKind.CallSignature; +} +exports.isCallSignatureDeclaration = isCallSignatureDeclaration; +function isCaseBlock(node) { + return node.kind === ts.SyntaxKind.CaseBlock; +} +exports.isCaseBlock = isCaseBlock; +function isCaseClause(node) { + return node.kind === ts.SyntaxKind.CaseClause; +} +exports.isCaseClause = isCaseClause; +function isCaseOrDefaultClause(node) { + return node.kind === ts.SyntaxKind.CaseClause || + node.kind === ts.SyntaxKind.DefaultClause; +} +exports.isCaseOrDefaultClause = isCaseOrDefaultClause; +function isCatchClause(node) { + return node.kind === ts.SyntaxKind.CatchClause; +} +exports.isCatchClause = isCatchClause; +function isClassDeclaration(node) { + return node.kind === ts.SyntaxKind.ClassDeclaration; +} +exports.isClassDeclaration = isClassDeclaration; +function isClassExpression(node) { + return node.kind === ts.SyntaxKind.ClassExpression; +} +exports.isClassExpression = isClassExpression; +function isClassLikeDeclaration(node) { + return node.kind === ts.SyntaxKind.ClassDeclaration || + node.kind === ts.SyntaxKind.ClassExpression; +} +exports.isClassLikeDeclaration = isClassLikeDeclaration; +function isCommaListExpression(node) { + return node.kind === ts.SyntaxKind.CommaListExpression; +} +exports.isCommaListExpression = isCommaListExpression; +function isConditionalExpression(node) { + return node.kind === ts.SyntaxKind.ConditionalExpression; +} +exports.isConditionalExpression = isConditionalExpression; +function isConditionalTypeNode(node) { + return node.kind === ts.SyntaxKind.ConditionalType; +} +exports.isConditionalTypeNode = isConditionalTypeNode; +function isConstructorDeclaration(node) { + return node.kind === ts.SyntaxKind.Constructor; +} +exports.isConstructorDeclaration = isConstructorDeclaration; +function isConstructorTypeNode(node) { + return node.kind === ts.SyntaxKind.ConstructorType; +} +exports.isConstructorTypeNode = isConstructorTypeNode; +function isConstructSignatureDeclaration(node) { + return node.kind === ts.SyntaxKind.ConstructSignature; +} +exports.isConstructSignatureDeclaration = isConstructSignatureDeclaration; +function isContinueStatement(node) { + return node.kind === ts.SyntaxKind.ContinueStatement; +} +exports.isContinueStatement = isContinueStatement; +function isComputedPropertyName(node) { + return node.kind === ts.SyntaxKind.ComputedPropertyName; +} +exports.isComputedPropertyName = isComputedPropertyName; +function isDebuggerStatement(node) { + return node.kind === ts.SyntaxKind.DebuggerStatement; +} +exports.isDebuggerStatement = isDebuggerStatement; +function isDecorator(node) { + return node.kind === ts.SyntaxKind.Decorator; +} +exports.isDecorator = isDecorator; +function isDefaultClause(node) { + return node.kind === ts.SyntaxKind.DefaultClause; +} +exports.isDefaultClause = isDefaultClause; +function isDeleteExpression(node) { + return node.kind === ts.SyntaxKind.DeleteExpression; +} +exports.isDeleteExpression = isDeleteExpression; +function isDoStatement(node) { + return node.kind === ts.SyntaxKind.DoStatement; +} +exports.isDoStatement = isDoStatement; +function isElementAccessExpression(node) { + return node.kind === ts.SyntaxKind.ElementAccessExpression; +} +exports.isElementAccessExpression = isElementAccessExpression; +function isEmptyStatement(node) { + return node.kind === ts.SyntaxKind.EmptyStatement; +} +exports.isEmptyStatement = isEmptyStatement; +function isEntityName(node) { + return node.kind === ts.SyntaxKind.Identifier || isQualifiedName(node); +} +exports.isEntityName = isEntityName; +function isEntityNameExpression(node) { + return node.kind === ts.SyntaxKind.Identifier || + isPropertyAccessExpression(node) && isEntityNameExpression(node.expression); +} +exports.isEntityNameExpression = isEntityNameExpression; +function isEnumDeclaration(node) { + return node.kind === ts.SyntaxKind.EnumDeclaration; +} +exports.isEnumDeclaration = isEnumDeclaration; +function isEnumMember(node) { + return node.kind === ts.SyntaxKind.EnumMember; +} +exports.isEnumMember = isEnumMember; +function isExportAssignment(node) { + return node.kind === ts.SyntaxKind.ExportAssignment; +} +exports.isExportAssignment = isExportAssignment; +function isExportDeclaration(node) { + return node.kind === ts.SyntaxKind.ExportDeclaration; +} +exports.isExportDeclaration = isExportDeclaration; +function isExportSpecifier(node) { + return node.kind === ts.SyntaxKind.ExportSpecifier; +} +exports.isExportSpecifier = isExportSpecifier; +function isExpression(node) { + switch (node.kind) { + case ts.SyntaxKind.ArrayLiteralExpression: + case ts.SyntaxKind.ArrowFunction: + case ts.SyntaxKind.AsExpression: + case ts.SyntaxKind.AwaitExpression: + case ts.SyntaxKind.BinaryExpression: + case ts.SyntaxKind.CallExpression: + case ts.SyntaxKind.ClassExpression: + case ts.SyntaxKind.CommaListExpression: + case ts.SyntaxKind.ConditionalExpression: + case ts.SyntaxKind.DeleteExpression: + case ts.SyntaxKind.ElementAccessExpression: + case ts.SyntaxKind.FalseKeyword: + case ts.SyntaxKind.FunctionExpression: + case ts.SyntaxKind.Identifier: + case ts.SyntaxKind.JsxElement: + case ts.SyntaxKind.JsxFragment: + case ts.SyntaxKind.JsxExpression: + case ts.SyntaxKind.JsxOpeningElement: + case ts.SyntaxKind.JsxOpeningFragment: + case ts.SyntaxKind.JsxSelfClosingElement: + case ts.SyntaxKind.MetaProperty: + case ts.SyntaxKind.NewExpression: + case ts.SyntaxKind.NonNullExpression: + case ts.SyntaxKind.NoSubstitutionTemplateLiteral: + case ts.SyntaxKind.NullKeyword: + case ts.SyntaxKind.NumericLiteral: + case ts.SyntaxKind.ObjectLiteralExpression: + case ts.SyntaxKind.OmittedExpression: + case ts.SyntaxKind.ParenthesizedExpression: + case ts.SyntaxKind.PostfixUnaryExpression: + case ts.SyntaxKind.PrefixUnaryExpression: + case ts.SyntaxKind.PropertyAccessExpression: + case ts.SyntaxKind.RegularExpressionLiteral: + case ts.SyntaxKind.SpreadElement: + case ts.SyntaxKind.StringLiteral: + case ts.SyntaxKind.SuperKeyword: + case ts.SyntaxKind.TaggedTemplateExpression: + case ts.SyntaxKind.TemplateExpression: + case ts.SyntaxKind.ThisKeyword: + case ts.SyntaxKind.TrueKeyword: + case ts.SyntaxKind.TypeAssertionExpression: + case ts.SyntaxKind.TypeOfExpression: + case ts.SyntaxKind.VoidExpression: + case ts.SyntaxKind.YieldExpression: + return true; + default: + return false; + } +} +exports.isExpression = isExpression; +function isExpressionStatement(node) { + return node.kind === ts.SyntaxKind.ExpressionStatement; +} +exports.isExpressionStatement = isExpressionStatement; +function isExpressionWithTypeArguments(node) { + return node.kind === ts.SyntaxKind.ExpressionWithTypeArguments; +} +exports.isExpressionWithTypeArguments = isExpressionWithTypeArguments; +function isExternalModuleReference(node) { + return node.kind === ts.SyntaxKind.ExternalModuleReference; +} +exports.isExternalModuleReference = isExternalModuleReference; +function isForInStatement(node) { + return node.kind === ts.SyntaxKind.ForInStatement; +} +exports.isForInStatement = isForInStatement; +function isForInOrOfStatement(node) { + return node.kind === ts.SyntaxKind.ForOfStatement || node.kind === ts.SyntaxKind.ForInStatement; +} +exports.isForInOrOfStatement = isForInOrOfStatement; +function isForOfStatement(node) { + return node.kind === ts.SyntaxKind.ForOfStatement; +} +exports.isForOfStatement = isForOfStatement; +function isForStatement(node) { + return node.kind === ts.SyntaxKind.ForStatement; +} +exports.isForStatement = isForStatement; +function isFunctionDeclaration(node) { + return node.kind === ts.SyntaxKind.FunctionDeclaration; +} +exports.isFunctionDeclaration = isFunctionDeclaration; +function isFunctionExpression(node) { + return node.kind === ts.SyntaxKind.FunctionExpression; +} +exports.isFunctionExpression = isFunctionExpression; +function isFunctionTypeNode(node) { + return node.kind === ts.SyntaxKind.FunctionType; +} +exports.isFunctionTypeNode = isFunctionTypeNode; +function isGetAccessorDeclaration(node) { + return node.kind === ts.SyntaxKind.GetAccessor; +} +exports.isGetAccessorDeclaration = isGetAccessorDeclaration; +function isIdentifier(node) { + return node.kind === ts.SyntaxKind.Identifier; +} +exports.isIdentifier = isIdentifier; +function isIfStatement(node) { + return node.kind === ts.SyntaxKind.IfStatement; +} +exports.isIfStatement = isIfStatement; +function isImportClause(node) { + return node.kind === ts.SyntaxKind.ImportClause; +} +exports.isImportClause = isImportClause; +function isImportDeclaration(node) { + return node.kind === ts.SyntaxKind.ImportDeclaration; +} +exports.isImportDeclaration = isImportDeclaration; +function isImportEqualsDeclaration(node) { + return node.kind === ts.SyntaxKind.ImportEqualsDeclaration; +} +exports.isImportEqualsDeclaration = isImportEqualsDeclaration; +function isImportSpecifier(node) { + return node.kind === ts.SyntaxKind.ImportSpecifier; +} +exports.isImportSpecifier = isImportSpecifier; +function isIndexedAccessTypeNode(node) { + return node.kind === ts.SyntaxKind.IndexedAccessType; +} +exports.isIndexedAccessTypeNode = isIndexedAccessTypeNode; +function isIndexSignatureDeclaration(node) { + return node.kind === ts.SyntaxKind.IndexSignature; +} +exports.isIndexSignatureDeclaration = isIndexSignatureDeclaration; +function isInferTypeNode(node) { + return node.kind === ts.SyntaxKind.InferType; +} +exports.isInferTypeNode = isInferTypeNode; +function isInterfaceDeclaration(node) { + return node.kind === ts.SyntaxKind.InterfaceDeclaration; +} +exports.isInterfaceDeclaration = isInterfaceDeclaration; +function isIntersectionTypeNode(node) { + return node.kind === ts.SyntaxKind.IntersectionType; +} +exports.isIntersectionTypeNode = isIntersectionTypeNode; +function isIterationStatement(node) { + switch (node.kind) { + case ts.SyntaxKind.ForStatement: + case ts.SyntaxKind.ForOfStatement: + case ts.SyntaxKind.ForInStatement: + case ts.SyntaxKind.WhileStatement: + case ts.SyntaxKind.DoStatement: + return true; + default: + return false; + } +} +exports.isIterationStatement = isIterationStatement; +function isJsDoc(node) { + return node.kind === ts.SyntaxKind.JSDocComment; +} +exports.isJsDoc = isJsDoc; +function isJsxAttribute(node) { + return node.kind === ts.SyntaxKind.JsxAttribute; +} +exports.isJsxAttribute = isJsxAttribute; +function isJsxAttributeLike(node) { + return node.kind === ts.SyntaxKind.JsxAttribute || + node.kind === ts.SyntaxKind.JsxSpreadAttribute; +} +exports.isJsxAttributeLike = isJsxAttributeLike; +function isJsxAttributes(node) { + return node.kind === ts.SyntaxKind.JsxAttributes; +} +exports.isJsxAttributes = isJsxAttributes; +function isJsxClosingElement(node) { + return node.kind === ts.SyntaxKind.JsxClosingElement; +} +exports.isJsxClosingElement = isJsxClosingElement; +function isJsxClosingFragment(node) { + return node.kind === ts.SyntaxKind.JsxClosingFragment; +} +exports.isJsxClosingFragment = isJsxClosingFragment; +function isJsxElement(node) { + return node.kind === ts.SyntaxKind.JsxElement; +} +exports.isJsxElement = isJsxElement; +function isJsxExpression(node) { + return node.kind === ts.SyntaxKind.JsxExpression; +} +exports.isJsxExpression = isJsxExpression; +function isJsxFragment(node) { + return node.kind === ts.SyntaxKind.JsxFragment; +} +exports.isJsxFragment = isJsxFragment; +function isJsxOpeningElement(node) { + return node.kind === ts.SyntaxKind.JsxOpeningElement; +} +exports.isJsxOpeningElement = isJsxOpeningElement; +function isJsxOpeningFragment(node) { + return node.kind === ts.SyntaxKind.JsxOpeningFragment; +} +exports.isJsxOpeningFragment = isJsxOpeningFragment; +function isJsxOpeningLikeElement(node) { + return node.kind === ts.SyntaxKind.JsxOpeningElement || + node.kind === ts.SyntaxKind.JsxSelfClosingElement; +} +exports.isJsxOpeningLikeElement = isJsxOpeningLikeElement; +function isJsxSelfClosingElement(node) { + return node.kind === ts.SyntaxKind.JsxSelfClosingElement; +} +exports.isJsxSelfClosingElement = isJsxSelfClosingElement; +function isJsxSpreadAttribute(node) { + return node.kind === ts.SyntaxKind.JsxSpreadAttribute; +} +exports.isJsxSpreadAttribute = isJsxSpreadAttribute; +function isJsxText(node) { + return node.kind === ts.SyntaxKind.JsxText; +} +exports.isJsxText = isJsxText; +function isLabeledStatement(node) { + return node.kind === ts.SyntaxKind.LabeledStatement; +} +exports.isLabeledStatement = isLabeledStatement; +function isLiteralExpression(node) { + return node.kind >= ts.SyntaxKind.FirstLiteralToken && + node.kind <= ts.SyntaxKind.LastLiteralToken; +} +exports.isLiteralExpression = isLiteralExpression; +function isLiteralTypeNode(node) { + return node.kind === ts.SyntaxKind.LiteralType; +} +exports.isLiteralTypeNode = isLiteralTypeNode; +function isMappedTypeNode(node) { + return node.kind === ts.SyntaxKind.MappedType; +} +exports.isMappedTypeNode = isMappedTypeNode; +function isMetaProperty(node) { + return node.kind === ts.SyntaxKind.MetaProperty; +} +exports.isMetaProperty = isMetaProperty; +function isMethodDeclaration(node) { + return node.kind === ts.SyntaxKind.MethodDeclaration; +} +exports.isMethodDeclaration = isMethodDeclaration; +function isMethodSignature(node) { + return node.kind === ts.SyntaxKind.MethodSignature; +} +exports.isMethodSignature = isMethodSignature; +function isModuleBlock(node) { + return node.kind === ts.SyntaxKind.ModuleBlock; +} +exports.isModuleBlock = isModuleBlock; +function isModuleDeclaration(node) { + return node.kind === ts.SyntaxKind.ModuleDeclaration; +} +exports.isModuleDeclaration = isModuleDeclaration; +function isNamedExports(node) { + return node.kind === ts.SyntaxKind.NamedExports; +} +exports.isNamedExports = isNamedExports; +function isNamedImports(node) { + return node.kind === ts.SyntaxKind.NamedImports; +} +exports.isNamedImports = isNamedImports; +function isNamespaceDeclaration(node) { + return isModuleDeclaration(node) && + node.name.kind === ts.SyntaxKind.Identifier && + node.body !== undefined && + (node.body.kind === ts.SyntaxKind.ModuleBlock || + isNamespaceDeclaration(node.body)); +} +exports.isNamespaceDeclaration = isNamespaceDeclaration; +function isNamespaceImport(node) { + return node.kind === ts.SyntaxKind.NamespaceImport; +} +exports.isNamespaceImport = isNamespaceImport; +function isNamespaceExportDeclaration(node) { + return node.kind === ts.SyntaxKind.NamespaceExportDeclaration; +} +exports.isNamespaceExportDeclaration = isNamespaceExportDeclaration; +function isNewExpression(node) { + return node.kind === ts.SyntaxKind.NewExpression; +} +exports.isNewExpression = isNewExpression; +function isNonNullExpression(node) { + return node.kind === ts.SyntaxKind.NonNullExpression; +} +exports.isNonNullExpression = isNonNullExpression; +function isNoSubstitutionTemplateLiteral(node) { + return node.kind === ts.SyntaxKind.NoSubstitutionTemplateLiteral; +} +exports.isNoSubstitutionTemplateLiteral = isNoSubstitutionTemplateLiteral; +function isNullLiteral(node) { + return node.kind === ts.SyntaxKind.NullKeyword; +} +exports.isNullLiteral = isNullLiteral; +function isNumericLiteral(node) { + return node.kind === ts.SyntaxKind.NumericLiteral; +} +exports.isNumericLiteral = isNumericLiteral; +function isNumericOrStringLikeLiteral(node) { + switch (node.kind) { + case ts.SyntaxKind.StringLiteral: + case ts.SyntaxKind.NumericLiteral: + case ts.SyntaxKind.NoSubstitutionTemplateLiteral: + return true; + default: + return false; + } +} +exports.isNumericOrStringLikeLiteral = isNumericOrStringLikeLiteral; +function isObjectBindingPattern(node) { + return node.kind === ts.SyntaxKind.ObjectBindingPattern; +} +exports.isObjectBindingPattern = isObjectBindingPattern; +function isObjectLiteralExpression(node) { + return node.kind === ts.SyntaxKind.ObjectLiteralExpression; +} +exports.isObjectLiteralExpression = isObjectLiteralExpression; +function isOmittedExpression(node) { + return node.kind === ts.SyntaxKind.OmittedExpression; +} +exports.isOmittedExpression = isOmittedExpression; +function isParameterDeclaration(node) { + return node.kind === ts.SyntaxKind.Parameter; +} +exports.isParameterDeclaration = isParameterDeclaration; +function isParenthesizedExpression(node) { + return node.kind === ts.SyntaxKind.ParenthesizedExpression; +} +exports.isParenthesizedExpression = isParenthesizedExpression; +function isParenthesizedTypeNode(node) { + return node.kind === ts.SyntaxKind.ParenthesizedType; +} +exports.isParenthesizedTypeNode = isParenthesizedTypeNode; +function isPostfixUnaryExpression(node) { + return node.kind === ts.SyntaxKind.PostfixUnaryExpression; +} +exports.isPostfixUnaryExpression = isPostfixUnaryExpression; +function isPrefixUnaryExpression(node) { + return node.kind === ts.SyntaxKind.PrefixUnaryExpression; +} +exports.isPrefixUnaryExpression = isPrefixUnaryExpression; +function isPropertyAccessExpression(node) { + return node.kind === ts.SyntaxKind.PropertyAccessExpression; +} +exports.isPropertyAccessExpression = isPropertyAccessExpression; +function isPropertyAssignment(node) { + return node.kind === ts.SyntaxKind.PropertyAssignment; +} +exports.isPropertyAssignment = isPropertyAssignment; +function isPropertyDeclaration(node) { + return node.kind === ts.SyntaxKind.PropertyDeclaration; +} +exports.isPropertyDeclaration = isPropertyDeclaration; +function isPropertySignature(node) { + return node.kind === ts.SyntaxKind.PropertySignature; +} +exports.isPropertySignature = isPropertySignature; +function isQualifiedName(node) { + return node.kind === ts.SyntaxKind.QualifiedName; +} +exports.isQualifiedName = isQualifiedName; +function isRegularExpressionLiteral(node) { + return node.kind === ts.SyntaxKind.RegularExpressionLiteral; +} +exports.isRegularExpressionLiteral = isRegularExpressionLiteral; +function isReturnStatement(node) { + return node.kind === ts.SyntaxKind.ReturnStatement; +} +exports.isReturnStatement = isReturnStatement; +function isSetAccessorDeclaration(node) { + return node.kind === ts.SyntaxKind.SetAccessor; +} +exports.isSetAccessorDeclaration = isSetAccessorDeclaration; +function isShorthandPropertyAssignment(node) { + return node.kind === ts.SyntaxKind.ShorthandPropertyAssignment; +} +exports.isShorthandPropertyAssignment = isShorthandPropertyAssignment; +function isSignatureDeclaration(node) { + return node.parameters !== undefined; +} +exports.isSignatureDeclaration = isSignatureDeclaration; +function isSourceFile(node) { + return node.kind === ts.SyntaxKind.SourceFile; +} +exports.isSourceFile = isSourceFile; +function isSpreadAssignment(node) { + return node.kind === ts.SyntaxKind.SpreadAssignment; +} +exports.isSpreadAssignment = isSpreadAssignment; +function isSpreadElement(node) { + return node.kind === ts.SyntaxKind.SpreadElement; +} +exports.isSpreadElement = isSpreadElement; +function isStringLiteral(node) { + return node.kind === ts.SyntaxKind.StringLiteral; +} +exports.isStringLiteral = isStringLiteral; +function isSwitchStatement(node) { + return node.kind === ts.SyntaxKind.SwitchStatement; +} +exports.isSwitchStatement = isSwitchStatement; +function isSyntaxList(node) { + return node.kind === ts.SyntaxKind.SyntaxList; +} +exports.isSyntaxList = isSyntaxList; +function isTaggedTemplateExpression(node) { + return node.kind === ts.SyntaxKind.TaggedTemplateExpression; +} +exports.isTaggedTemplateExpression = isTaggedTemplateExpression; +function isTemplateExpression(node) { + return node.kind === ts.SyntaxKind.TemplateExpression; +} +exports.isTemplateExpression = isTemplateExpression; +function isTemplateLiteral(node) { + return node.kind === ts.SyntaxKind.TemplateExpression || + node.kind === ts.SyntaxKind.NoSubstitutionTemplateLiteral; +} +exports.isTemplateLiteral = isTemplateLiteral; +function isTextualLiteral(node) { + return node.kind === ts.SyntaxKind.StringLiteral || + node.kind === ts.SyntaxKind.NoSubstitutionTemplateLiteral; +} +exports.isTextualLiteral = isTextualLiteral; +function isThrowStatement(node) { + return node.kind === ts.SyntaxKind.ThrowStatement; +} +exports.isThrowStatement = isThrowStatement; +function isTryStatement(node) { + return node.kind === ts.SyntaxKind.TryStatement; +} +exports.isTryStatement = isTryStatement; +function isTupleTypeNode(node) { + return node.kind === ts.SyntaxKind.TupleType; +} +exports.isTupleTypeNode = isTupleTypeNode; +function isTypeAliasDeclaration(node) { + return node.kind === ts.SyntaxKind.TypeAliasDeclaration; +} +exports.isTypeAliasDeclaration = isTypeAliasDeclaration; +function isTypeAssertion(node) { + return node.kind === ts.SyntaxKind.TypeAssertionExpression; +} +exports.isTypeAssertion = isTypeAssertion; +function isTypeLiteralNode(node) { + return node.kind === ts.SyntaxKind.TypeLiteral; +} +exports.isTypeLiteralNode = isTypeLiteralNode; +function isTypeOfExpression(node) { + return node.kind === ts.SyntaxKind.TypeOfExpression; +} +exports.isTypeOfExpression = isTypeOfExpression; +function isTypeOperatorNode(node) { + return node.kind === ts.SyntaxKind.TypeOperator; +} +exports.isTypeOperatorNode = isTypeOperatorNode; +function isTypeParameterDeclaration(node) { + return node.kind === ts.SyntaxKind.TypeParameter; +} +exports.isTypeParameterDeclaration = isTypeParameterDeclaration; +function isTypePredicateNode(node) { + return node.kind === ts.SyntaxKind.TypePredicate; +} +exports.isTypePredicateNode = isTypePredicateNode; +function isTypeReferenceNode(node) { + return node.kind === ts.SyntaxKind.TypeReference; +} +exports.isTypeReferenceNode = isTypeReferenceNode; +function isTypeQueryNode(node) { + return node.kind === ts.SyntaxKind.TypeQuery; +} +exports.isTypeQueryNode = isTypeQueryNode; +function isUnionTypeNode(node) { + return node.kind === ts.SyntaxKind.UnionType; +} +exports.isUnionTypeNode = isUnionTypeNode; +function isVariableDeclaration(node) { + return node.kind === ts.SyntaxKind.VariableDeclaration; +} +exports.isVariableDeclaration = isVariableDeclaration; +function isVariableStatement(node) { + return node.kind === ts.SyntaxKind.VariableStatement; +} +exports.isVariableStatement = isVariableStatement; +function isVariableDeclarationList(node) { + return node.kind === ts.SyntaxKind.VariableDeclarationList; +} +exports.isVariableDeclarationList = isVariableDeclarationList; +function isVoidExpression(node) { + return node.kind === ts.SyntaxKind.VoidExpression; +} +exports.isVoidExpression = isVoidExpression; +function isWhileStatement(node) { + return node.kind === ts.SyntaxKind.WhileStatement; +} +exports.isWhileStatement = isWhileStatement; +function isWithStatement(node) { + return node.kind === ts.SyntaxKind.WithStatement; +} +exports.isWithStatement = isWithStatement; diff --git a/node_modules/tsutils/typeguard/2.8/type.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.8/type.d.ts similarity index 100% rename from node_modules/tsutils/typeguard/2.8/type.d.ts rename to node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.8/type.d.ts diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.8/type.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.8/type.js new file mode 100644 index 000000000..01fc06ead --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.8/type.js @@ -0,0 +1,75 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const ts = require("typescript"); +function isConditionalType(type) { + return (type.flags & ts.TypeFlags.Conditional) !== 0; +} +exports.isConditionalType = isConditionalType; +function isEnumType(type) { + return (type.flags & ts.TypeFlags.Enum) !== 0; +} +exports.isEnumType = isEnumType; +function isGenericType(type) { + return (type.flags & ts.TypeFlags.Object) !== 0 && + (type.objectFlags & ts.ObjectFlags.ClassOrInterface) !== 0 && + (type.objectFlags & ts.ObjectFlags.Reference) !== 0; +} +exports.isGenericType = isGenericType; +function isIndexedAccessType(type) { + return (type.flags & ts.TypeFlags.IndexedAccess) !== 0; +} +exports.isIndexedAccessType = isIndexedAccessType; +function isIndexedAccessype(type) { + return (type.flags & ts.TypeFlags.Index) !== 0; +} +exports.isIndexedAccessype = isIndexedAccessype; +function isInstantiableType(type) { + return (type.flags & ts.TypeFlags.Instantiable) !== 0; +} +exports.isInstantiableType = isInstantiableType; +function isInterfaceType(type) { + return (type.flags & ts.TypeFlags.Object) !== 0 && + (type.objectFlags & ts.ObjectFlags.ClassOrInterface) !== 0; +} +exports.isInterfaceType = isInterfaceType; +function isIntersectionType(type) { + return (type.flags & ts.TypeFlags.Intersection) !== 0; +} +exports.isIntersectionType = isIntersectionType; +function isLiteralType(type) { + return (type.flags & (ts.TypeFlags.StringOrNumberLiteral | ts.TypeFlags.BigIntLiteral)) !== 0; +} +exports.isLiteralType = isLiteralType; +function isObjectType(type) { + return (type.flags & ts.TypeFlags.Object) !== 0; +} +exports.isObjectType = isObjectType; +function isSubstitutionType(type) { + return (type.flags & ts.TypeFlags.Substitution) !== 0; +} +exports.isSubstitutionType = isSubstitutionType; +function isTypeParameter(type) { + return (type.flags & ts.TypeFlags.TypeParameter) !== 0; +} +exports.isTypeParameter = isTypeParameter; +function isTypeReference(type) { + return (type.flags & ts.TypeFlags.Object) !== 0 && + (type.objectFlags & ts.ObjectFlags.Reference) !== 0; +} +exports.isTypeReference = isTypeReference; +function isTypeVariable(type) { + return (type.flags & ts.TypeFlags.TypeVariable) !== 0; +} +exports.isTypeVariable = isTypeVariable; +function isUnionOrIntersectionType(type) { + return (type.flags & ts.TypeFlags.UnionOrIntersection) !== 0; +} +exports.isUnionOrIntersectionType = isUnionOrIntersectionType; +function isUnionType(type) { + return (type.flags & ts.TypeFlags.Union) !== 0; +} +exports.isUnionType = isUnionType; +function isUniqueESSymbolType(type) { + return (type.flags & ts.TypeFlags.UniqueESSymbol) !== 0; +} +exports.isUniqueESSymbolType = isUniqueESSymbolType; diff --git a/node_modules/tsutils/typeguard/2.9/index.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.9/index.d.ts similarity index 100% rename from node_modules/tsutils/typeguard/2.9/index.d.ts rename to node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.9/index.d.ts diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.9/index.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.9/index.js new file mode 100644 index 000000000..0c381e79a --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.9/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./node"), exports); +tslib_1.__exportStar(require("./type"), exports); diff --git a/node_modules/tsutils/typeguard/2.9/node.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.9/node.d.ts similarity index 100% rename from node_modules/tsutils/typeguard/2.9/node.d.ts rename to node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.9/node.d.ts diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.9/node.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.9/node.js new file mode 100644 index 000000000..e24159778 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.9/node.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("../2.8/node"), exports); +const ts = require("typescript"); +function isImportTypeNode(node) { + return node.kind === ts.SyntaxKind.ImportType; +} +exports.isImportTypeNode = isImportTypeNode; diff --git a/node_modules/tsutils/typeguard/2.9/type.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.9/type.d.ts similarity index 100% rename from node_modules/tsutils/typeguard/2.9/type.d.ts rename to node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.9/type.d.ts diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.9/type.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.9/type.js new file mode 100644 index 000000000..9315cac2b --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/2.9/type.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("../2.8/type"), exports); diff --git a/node_modules/tsutils/typeguard/3.0/index.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.0/index.d.ts similarity index 100% rename from node_modules/tsutils/typeguard/3.0/index.d.ts rename to node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.0/index.d.ts diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.0/index.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.0/index.js new file mode 100644 index 000000000..0c381e79a --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.0/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./node"), exports); +tslib_1.__exportStar(require("./type"), exports); diff --git a/node_modules/tsutils/typeguard/3.0/node.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.0/node.d.ts similarity index 100% rename from node_modules/tsutils/typeguard/3.0/node.d.ts rename to node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.0/node.d.ts diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.0/node.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.0/node.js new file mode 100644 index 000000000..943bb36e8 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.0/node.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("../2.9/node"), exports); +const ts = require("typescript"); +function isOptionalTypeNode(node) { + return node.kind === ts.SyntaxKind.OptionalType; +} +exports.isOptionalTypeNode = isOptionalTypeNode; +function isRestTypeNode(node) { + return node.kind === ts.SyntaxKind.RestType; +} +exports.isRestTypeNode = isRestTypeNode; +function isSyntheticExpression(node) { + return node.kind === ts.SyntaxKind.SyntheticExpression; +} +exports.isSyntheticExpression = isSyntheticExpression; diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.0/type.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.0/type.d.ts new file mode 100644 index 000000000..5cf0df95a --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.0/type.d.ts @@ -0,0 +1,6 @@ +export * from '../2.9/type'; +import * as ts from 'typescript'; +export declare function isTupleType(type: ts.Type): type is ts.TupleType; +export declare function isTupleTypeReference(type: ts.Type): type is ts.TypeReference & { + target: ts.TupleType; +}; diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.0/type.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.0/type.js new file mode 100644 index 000000000..7ec876f8f --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.0/type.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("../2.9/type"), exports); +const ts = require("typescript"); +const type_1 = require("../2.9/type"); +function isTupleType(type) { + return (type.flags & ts.TypeFlags.Object && type.objectFlags & ts.ObjectFlags.Tuple) !== 0; +} +exports.isTupleType = isTupleType; +function isTupleTypeReference(type) { + return type_1.isTypeReference(type) && isTupleType(type.target); +} +exports.isTupleTypeReference = isTupleTypeReference; diff --git a/node_modules/tsutils/typeguard/index.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.2/index.d.ts similarity index 100% rename from node_modules/tsutils/typeguard/index.d.ts rename to node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.2/index.d.ts diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.2/index.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.2/index.js new file mode 100644 index 000000000..0c381e79a --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.2/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./node"), exports); +tslib_1.__exportStar(require("./type"), exports); diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.2/node.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.2/node.d.ts new file mode 100644 index 000000000..cf88ae114 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.2/node.d.ts @@ -0,0 +1,3 @@ +export * from '../3.0/node'; +import * as ts from 'typescript'; +export declare function isBigIntLiteral(node: ts.Node): node is ts.BigIntLiteral; diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.2/node.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.2/node.js new file mode 100644 index 000000000..26e8c1a74 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.2/node.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("../3.0/node"), exports); +const ts = require("typescript"); +function isBigIntLiteral(node) { + return node.kind === ts.SyntaxKind.BigIntLiteral; +} +exports.isBigIntLiteral = isBigIntLiteral; diff --git a/node_modules/tsutils/typeguard/next/type.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.2/type.d.ts similarity index 100% rename from node_modules/tsutils/typeguard/next/type.d.ts rename to node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.2/type.d.ts diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.2/type.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.2/type.js new file mode 100644 index 000000000..d800ef841 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/3.2/type.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("../3.0/type"), exports); diff --git a/node_modules/tsutils/typeguard/next/index.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/index.d.ts similarity index 100% rename from node_modules/tsutils/typeguard/next/index.d.ts rename to node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/index.d.ts diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/index.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/index.js new file mode 100644 index 000000000..0c381e79a --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./node"), exports); +tslib_1.__exportStar(require("./type"), exports); diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/next/index.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/next/index.d.ts new file mode 100644 index 000000000..71762921c --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/next/index.d.ts @@ -0,0 +1,2 @@ +export * from './node'; +export * from './type'; diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/next/index.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/next/index.js new file mode 100644 index 000000000..0c381e79a --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/next/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./node"), exports); +tslib_1.__exportStar(require("./type"), exports); diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/next/node.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/next/node.d.ts new file mode 100644 index 000000000..d64678a34 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/next/node.d.ts @@ -0,0 +1 @@ +export * from '../3.2/node'; diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/next/node.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/next/node.js new file mode 100644 index 000000000..e2c022f12 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/next/node.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("../3.2/node"), exports); diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/next/type.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/next/type.d.ts new file mode 100644 index 000000000..6cd4408ac --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/next/type.d.ts @@ -0,0 +1 @@ +export * from '../3.2/type'; diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/next/type.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/next/type.js new file mode 100644 index 000000000..ef88473b6 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/next/type.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("../3.2/type"), exports); diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/node.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/node.d.ts new file mode 100644 index 000000000..f6a9f8b7d --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/node.d.ts @@ -0,0 +1 @@ +export * from './3.2/node'; diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/node.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/node.js new file mode 100644 index 000000000..3d8e37608 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/node.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./3.2/node"), exports); diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/type.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/type.d.ts new file mode 100644 index 000000000..8a20aeb1f --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/type.d.ts @@ -0,0 +1 @@ +export * from './3.2/type'; diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/type.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/type.js new file mode 100644 index 000000000..cecc6fd6c --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/typeguard/type.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./3.2/type"), exports); diff --git a/node_modules/tsutils/util/control-flow.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/control-flow.d.ts similarity index 79% rename from node_modules/tsutils/util/control-flow.d.ts rename to node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/control-flow.d.ts index f7c101d82..528155c1b 100644 --- a/node_modules/tsutils/util/control-flow.d.ts +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/control-flow.d.ts @@ -6,4 +6,3 @@ export interface ControlFlowEnd { readonly end: boolean; } export declare function getControlFlowEnd(statement: ts.Statement | ts.BlockLike): ControlFlowEnd; -export declare function getControlFlowEnd(statement: ts.Statement | ts.BlockLike, label?: ts.Identifier): ControlFlowEnd; diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/control-flow.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/control-flow.js new file mode 100644 index 000000000..7e83773f0 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/control-flow.js @@ -0,0 +1,171 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const ts = require("typescript"); +const node_1 = require("../typeguard/node"); +function endsControlFlow(statement) { + return getControlFlowEnd(statement).end; +} +exports.endsControlFlow = endsControlFlow; +const defaultControlFlowEnd = { statements: [], end: false }; +function getControlFlowEnd(statement) { + return node_1.isBlockLike(statement) ? handleBlock(statement) : getControlFlowEndWorker(statement); +} +exports.getControlFlowEnd = getControlFlowEnd; +function getControlFlowEndWorker(statement) { + switch (statement.kind) { + case ts.SyntaxKind.ReturnStatement: + case ts.SyntaxKind.ThrowStatement: + case ts.SyntaxKind.ContinueStatement: + case ts.SyntaxKind.BreakStatement: + return { statements: [statement], end: true }; + case ts.SyntaxKind.Block: + return handleBlock(statement); + case ts.SyntaxKind.ForStatement: + case ts.SyntaxKind.WhileStatement: + return handleForAndWhileStatement(statement); + case ts.SyntaxKind.ForOfStatement: + case ts.SyntaxKind.ForInStatement: + return handleForInOrOfStatement(statement); + case ts.SyntaxKind.DoStatement: + return matchBreakOrContinue(getControlFlowEndWorker(statement.statement), node_1.isBreakOrContinueStatement); + case ts.SyntaxKind.IfStatement: + return handleIfStatement(statement); + case ts.SyntaxKind.SwitchStatement: + return matchBreakOrContinue(handleSwitchStatement(statement), node_1.isBreakStatement); + case ts.SyntaxKind.TryStatement: + return handleTryStatement(statement); + case ts.SyntaxKind.LabeledStatement: + return matchLabel(getControlFlowEndWorker(statement.statement), statement.label); + case ts.SyntaxKind.WithStatement: + return getControlFlowEndWorker(statement.statement); + default: + return defaultControlFlowEnd; + } +} +function handleBlock(statement) { + const result = { statements: [], end: false }; + for (const s of statement.statements) { + const current = getControlFlowEndWorker(s); + result.statements.push(...current.statements); + if (current.end) { + result.end = true; + break; + } + } + return result; +} +function handleForInOrOfStatement(statement) { + const end = matchBreakOrContinue(getControlFlowEndWorker(statement.statement), node_1.isBreakOrContinueStatement); + end.end = false; + return end; +} +function handleForAndWhileStatement(statement) { + const constantCondition = statement.kind === ts.SyntaxKind.WhileStatement + ? getConstantCondition(statement.expression) + : statement.condition === undefined || getConstantCondition(statement.condition); + if (constantCondition === false) + return defaultControlFlowEnd; + const end = matchBreakOrContinue(getControlFlowEndWorker(statement.statement), node_1.isBreakOrContinueStatement); + if (constantCondition === undefined) + end.end = false; + return end; +} +function getConstantCondition(node) { + switch (node.kind) { + case ts.SyntaxKind.TrueKeyword: + return true; + case ts.SyntaxKind.FalseKeyword: + return false; + default: + return; + } +} +function handleIfStatement(node) { + switch (getConstantCondition(node.expression)) { + case true: + return getControlFlowEndWorker(node.thenStatement); + case false: + return node.elseStatement === undefined + ? defaultControlFlowEnd + : getControlFlowEndWorker(node.elseStatement); + } + const then = getControlFlowEndWorker(node.thenStatement); + if (node.elseStatement === undefined) + return { + statements: then.statements, + end: false, + }; + const elze = getControlFlowEndWorker(node.elseStatement); + return { + statements: [...then.statements, ...elze.statements], + end: then.end && elze.end, + }; +} +function handleSwitchStatement(node) { + let hasDefault = false; + const result = { + statements: [], + end: false, + }; + for (const clause of node.caseBlock.clauses) { + if (clause.kind === ts.SyntaxKind.DefaultClause) + hasDefault = true; + const current = handleBlock(clause); + result.end = current.end; + result.statements.push(...current.statements); + } + if (!hasDefault) + result.end = false; + return result; +} +function handleTryStatement(node) { + let finallyResult; + if (node.finallyBlock !== undefined) { + finallyResult = handleBlock(node.finallyBlock); + if (finallyResult.end) + return finallyResult; + } + const tryResult = handleBlock(node.tryBlock); + if (node.catchClause === undefined) + return { statements: finallyResult.statements.concat(tryResult.statements), end: tryResult.end }; + const catchResult = handleBlock(node.catchClause.block); + return { + statements: tryResult.statements + .filter((s) => s.kind !== ts.SyntaxKind.ThrowStatement) + .concat(catchResult.statements, finallyResult === undefined ? [] : finallyResult.statements), + end: tryResult.end && catchResult.end, + }; +} +function matchBreakOrContinue(current, pred) { + const result = { + statements: [], + end: current.end, + }; + for (const statement of current.statements) { + if (pred(statement) && statement.label === undefined) { + result.end = false; + continue; + } + result.statements.push(statement); + } + return result; +} +function matchLabel(current, label) { + const result = { + statements: [], + end: current.end, + }; + const labelText = label.text; + for (const statement of current.statements) { + switch (statement.kind) { + case ts.SyntaxKind.BreakStatement: + case ts.SyntaxKind.ContinueStatement: + if (statement.label !== undefined && statement.label.text === labelText) { + result.end = false; + continue; + } + } + result.statements.push(statement); + } + return result; +} diff --git a/node_modules/tsutils/util/convert-ast.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/convert-ast.d.ts similarity index 95% rename from node_modules/tsutils/util/convert-ast.d.ts rename to node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/convert-ast.d.ts index c7291e3ed..7e95feaf0 100644 --- a/node_modules/tsutils/util/convert-ast.d.ts +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/convert-ast.d.ts @@ -8,6 +8,7 @@ export interface NodeWrap { parent?: NodeWrap; } export interface WrappedAst extends NodeWrap { + node: ts.SourceFile; next: NodeWrap; skip: undefined; parent: undefined; diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/convert-ast.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/convert-ast.js new file mode 100644 index 000000000..bfdb0282c --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/convert-ast.js @@ -0,0 +1,47 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const ts = require("typescript"); +const util_1 = require("./util"); +function convertAst(sourceFile) { + const wrapped = { + node: sourceFile, + parent: undefined, + kind: ts.SyntaxKind.SourceFile, + children: [], + next: undefined, + skip: undefined, + }; + const flat = []; + let current = wrapped; + let previous = current; + ts.forEachChild(sourceFile, function wrap(node) { + flat.push(node); + const parent = current; + previous.next = current = { + node, + parent, + kind: node.kind, + children: [], + next: undefined, + skip: undefined, + }; + if (previous !== parent) + setSkip(previous, current); + previous = current; + parent.children.push(current); + if (util_1.isNodeKind(node.kind)) + ts.forEachChild(node, wrap); + current = parent; + }); + return { + wrapped, + flat, + }; +} +exports.convertAst = convertAst; +function setSkip(node, skip) { + do { + node.skip = skip; + node = node.parent; + } while (node !== skip.parent); +} diff --git a/node_modules/tsutils/util/index.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/index.d.ts similarity index 100% rename from node_modules/tsutils/util/index.d.ts rename to node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/index.d.ts diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/index.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/index.js new file mode 100644 index 000000000..2087d2a37 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/index.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./util"), exports); +tslib_1.__exportStar(require("./usage"), exports); +tslib_1.__exportStar(require("./control-flow"), exports); +tslib_1.__exportStar(require("./type"), exports); +tslib_1.__exportStar(require("./convert-ast"), exports); diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/type.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/type.d.ts new file mode 100644 index 000000000..f4343a458 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/type.d.ts @@ -0,0 +1,21 @@ +import * as ts from 'typescript'; +import { PropertyName } from './util'; +export declare function isEmptyObjectType(type: ts.Type): type is ts.ObjectType; +export declare function removeOptionalityFromType(checker: ts.TypeChecker, type: ts.Type): ts.Type; +export declare function isTypeAssignableToNumber(checker: ts.TypeChecker, type: ts.Type): boolean; +export declare function isTypeAssignableToString(checker: ts.TypeChecker, type: ts.Type): boolean; +export declare function getCallSignaturesOfType(type: ts.Type): ReadonlyArray; +export declare function unionTypeParts(type: ts.Type): ts.Type[]; +export declare function intersectionTypeParts(type: ts.Type): ts.Type[]; +export declare function someTypePart(type: ts.Type, predicate: (t: ts.Type) => t is ts.UnionOrIntersectionType, cb: (t: ts.Type) => boolean): boolean; +export declare function isThenableType(checker: ts.TypeChecker, node: ts.Node, type: ts.Type): boolean; +export declare function isThenableType(checker: ts.TypeChecker, node: ts.Expression, type?: ts.Type): boolean; +export declare function isFalsyType(type: ts.Type): boolean; +export declare function isBooleanLiteralType(type: ts.Type, literal: boolean): boolean; +export declare function getPropertyOfType(type: ts.Type, name: ts.__String): ts.Symbol | undefined; +export declare function isPropertyReadonlyInType(type: ts.Type, name: ts.__String, checker: ts.TypeChecker): boolean; +export declare function symbolHasReadonlyDeclaration(symbol: ts.Symbol, checker: ts.TypeChecker): boolean; +export declare function getPropertyNameFromType(type: ts.Type): PropertyName | undefined; +export declare function getConstructorTypeOfClassLikeDeclaration(node: ts.ClassLikeDeclaration, checker: ts.TypeChecker): ts.Type; +export declare function getInstanceTypeOfClassLikeDeclaration(node: ts.ClassLikeDeclaration, checker: ts.TypeChecker): ts.Type; +export declare function getIteratorYieldResultFromIteratorResult(type: ts.Type, node: ts.Node, checker: ts.TypeChecker): ts.Type; diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/type.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/type.js new file mode 100644 index 000000000..7a530d9fd --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/type.js @@ -0,0 +1,238 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const ts = require("typescript"); +const type_1 = require("../typeguard/type"); +const util_1 = require("./util"); +const node_1 = require("../typeguard/node"); +function isEmptyObjectType(type) { + if (type_1.isObjectType(type) && + type.objectFlags & ts.ObjectFlags.Anonymous && + type.getProperties().length === 0 && + type.getCallSignatures().length === 0 && + type.getConstructSignatures().length === 0 && + type.getStringIndexType() === undefined && + type.getNumberIndexType() === undefined) { + const baseTypes = type.getBaseTypes(); + return baseTypes === undefined || baseTypes.every(isEmptyObjectType); + } + return false; +} +exports.isEmptyObjectType = isEmptyObjectType; +function removeOptionalityFromType(checker, type) { + if (!containsTypeWithFlag(type, ts.TypeFlags.Undefined)) + return type; + const allowsNull = containsTypeWithFlag(type, ts.TypeFlags.Null); + type = checker.getNonNullableType(type); + return allowsNull ? checker.getNullableType(type, ts.TypeFlags.Null) : type; +} +exports.removeOptionalityFromType = removeOptionalityFromType; +function containsTypeWithFlag(type, flag) { + for (const t of unionTypeParts(type)) + if (util_1.isTypeFlagSet(t, flag)) + return true; + return false; +} +function isTypeAssignableToNumber(checker, type) { + return isTypeAssignableTo(checker, type, ts.TypeFlags.NumberLike); +} +exports.isTypeAssignableToNumber = isTypeAssignableToNumber; +function isTypeAssignableToString(checker, type) { + return isTypeAssignableTo(checker, type, ts.TypeFlags.StringLike); +} +exports.isTypeAssignableToString = isTypeAssignableToString; +function isTypeAssignableTo(checker, type, flags) { + flags |= ts.TypeFlags.Any; + let typeParametersSeen; + return (function check(t) { + if (type_1.isTypeParameter(t) && t.symbol !== undefined && t.symbol.declarations !== undefined) { + if (typeParametersSeen === undefined) { + typeParametersSeen = new Set([t]); + } + else if (!typeParametersSeen.has(t)) { + typeParametersSeen.add(t); + } + else { + return false; + } + const declaration = t.symbol.declarations[0]; + if (declaration.constraint === undefined) + return true; + return check(checker.getTypeFromTypeNode(declaration.constraint)); + } + if (type_1.isUnionType(t)) + return t.types.every(check); + if (type_1.isIntersectionType(t)) + return t.types.some(check); + return util_1.isTypeFlagSet(t, flags); + })(type); +} +function getCallSignaturesOfType(type) { + if (type_1.isUnionType(type)) { + const signatures = []; + for (const t of type.types) + signatures.push(...getCallSignaturesOfType(t)); + return signatures; + } + if (type_1.isIntersectionType(type)) { + let signatures; + for (const t of type.types) { + const sig = getCallSignaturesOfType(t); + if (sig.length !== 0) { + if (signatures !== undefined) + return []; + signatures = sig; + } + } + return signatures === undefined ? [] : signatures; + } + return type.getCallSignatures(); +} +exports.getCallSignaturesOfType = getCallSignaturesOfType; +function unionTypeParts(type) { + return type_1.isUnionType(type) ? type.types : [type]; +} +exports.unionTypeParts = unionTypeParts; +function intersectionTypeParts(type) { + return type_1.isIntersectionType(type) ? type.types : [type]; +} +exports.intersectionTypeParts = intersectionTypeParts; +function someTypePart(type, predicate, cb) { + return predicate(type) ? type.types.some(cb) : cb(type); +} +exports.someTypePart = someTypePart; +function isThenableType(checker, node, type = checker.getTypeAtLocation(node)) { + for (const ty of unionTypeParts(checker.getApparentType(type))) { + const then = ty.getProperty('then'); + if (then === undefined) + continue; + const thenType = checker.getTypeOfSymbolAtLocation(then, node); + for (const t of unionTypeParts(thenType)) + for (const signature of t.getCallSignatures()) + if (signature.parameters.length !== 0 && isCallback(checker, signature.parameters[0], node)) + return true; + } + return false; +} +exports.isThenableType = isThenableType; +function isCallback(checker, param, node) { + let type = checker.getApparentType(checker.getTypeOfSymbolAtLocation(param, node)); + if (param.valueDeclaration.dotDotDotToken) { + type = type.getNumberIndexType(); + if (type === undefined) + return false; + } + for (const t of unionTypeParts(type)) + if (t.getCallSignatures().length !== 0) + return true; + return false; +} +function isFalsyType(type) { + if (type.flags & (ts.TypeFlags.Undefined | ts.TypeFlags.Null | ts.TypeFlags.Void)) + return true; + if (type_1.isLiteralType(type)) + return !type.value; + return isBooleanLiteralType(type, false); +} +exports.isFalsyType = isFalsyType; +function isBooleanLiteralType(type, literal) { + return util_1.isTypeFlagSet(type, ts.TypeFlags.BooleanLiteral) && + type.intrinsicName === (literal ? 'true' : 'false'); +} +exports.isBooleanLiteralType = isBooleanLiteralType; +function getPropertyOfType(type, name) { + if (!name.startsWith('__')) + return type.getProperty(name); + return type.getProperties().find((s) => s.escapedName === name); +} +exports.getPropertyOfType = getPropertyOfType; +function isPropertyReadonlyInType(type, name, checker) { + let seenProperty = false; + let seenReadonlySignature = false; + for (const t of unionTypeParts(type)) { + if (getPropertyOfType(t, name) === undefined) { + const index = (util_1.isNumericPropertyName(name) ? checker.getIndexInfoOfType(t, ts.IndexKind.Number) : undefined) || + checker.getIndexInfoOfType(t, ts.IndexKind.String); + if (index !== undefined && index.isReadonly) { + if (seenProperty) + return true; + seenReadonlySignature = true; + } + } + else if (seenReadonlySignature || isReadonlyPropertyIntersection(t, name, checker)) { + return true; + } + else { + seenProperty = true; + } + } + return false; +} +exports.isPropertyReadonlyInType = isPropertyReadonlyInType; +function isReadonlyPropertyIntersection(type, name, checker) { + return someTypePart(type, type_1.isIntersectionType, (t) => { + const prop = getPropertyOfType(t, name); + if (prop === undefined) + return false; + if (prop.flags & ts.SymbolFlags.Transient) { + if (/^(?:[1-9]\d*|0)$/.test(name) && type_1.isTupleTypeReference(t)) + return t.target.readonly; + switch (isReadonlyPropertyFromMappedType(t, name, checker)) { + case true: + return true; + case false: + return false; + default: + } + } + return (util_1.isSymbolFlagSet(prop, ts.SymbolFlags.ValueModule) || + symbolHasReadonlyDeclaration(prop, checker)); + }); +} +function isReadonlyPropertyFromMappedType(type, name, checker) { + if (!type_1.isObjectType(type) || !util_1.isObjectFlagSet(type, ts.ObjectFlags.Mapped)) + return; + const declaration = type.symbol.declarations[0]; + if (declaration.readonlyToken !== undefined && !/^__@[^@]+$/.test(name)) + return declaration.readonlyToken.kind !== ts.SyntaxKind.MinusToken; + return isPropertyReadonlyInType(type.modifiersType, name, checker); +} +function symbolHasReadonlyDeclaration(symbol, checker) { + return (symbol.flags & ts.SymbolFlags.Accessor) === ts.SymbolFlags.GetAccessor || + symbol.declarations !== undefined && + symbol.declarations.some((node) => util_1.isModifierFlagSet(node, ts.ModifierFlags.Readonly) || + node_1.isVariableDeclaration(node) && util_1.isNodeFlagSet(node.parent, ts.NodeFlags.Const) || + node_1.isCallExpression(node) && util_1.isReadonlyAssignmentDeclaration(node, checker) || + node_1.isEnumMember(node) || + (node_1.isPropertyAssignment(node) || node_1.isShorthandPropertyAssignment(node)) && util_1.isInConstContext(node.parent)); +} +exports.symbolHasReadonlyDeclaration = symbolHasReadonlyDeclaration; +function getPropertyNameFromType(type) { + if (type.flags & (ts.TypeFlags.StringLiteral | ts.TypeFlags.NumberLiteral)) { + const value = String(type.value); + return { displayName: value, symbolName: ts.escapeLeadingUnderscores(value) }; + } + if (type_1.isUniqueESSymbolType(type)) + return { + displayName: `[${type.symbol ? type.symbol.name : type.escapedName.replace(/^__@|@\d+$/g, '')}]`, + symbolName: type.escapedName, + }; +} +exports.getPropertyNameFromType = getPropertyNameFromType; +function getConstructorTypeOfClassLikeDeclaration(node, checker) { + return checker.getDeclaredTypeOfSymbol(node.name !== undefined ? checker.getSymbolAtLocation(node.name) : checker.getTypeAtLocation(node).symbol); +} +exports.getConstructorTypeOfClassLikeDeclaration = getConstructorTypeOfClassLikeDeclaration; +function getInstanceTypeOfClassLikeDeclaration(node, checker) { + return node.kind === ts.SyntaxKind.ClassDeclaration + ? checker.getTypeAtLocation(node) + : checker.getTypeOfSymbolAtLocation(checker.getTypeAtLocation(node).getProperty('prototype'), node); +} +exports.getInstanceTypeOfClassLikeDeclaration = getInstanceTypeOfClassLikeDeclaration; +function getIteratorYieldResultFromIteratorResult(type, node, checker) { + return type_1.isUnionType(type) && type.types.find((t) => { + const done = t.getProperty('done'); + return done !== undefined && + isBooleanLiteralType(removeOptionalityFromType(checker, checker.getTypeOfSymbolAtLocation(done, node)), false); + }) || type; +} +exports.getIteratorYieldResultFromIteratorResult = getIteratorYieldResultFromIteratorResult; diff --git a/node_modules/tsutils/util/usage.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/usage.d.ts similarity index 89% rename from node_modules/tsutils/util/usage.d.ts rename to node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/usage.d.ts index 3ffa3360f..a4c022c9d 100644 --- a/node_modules/tsutils/util/usage.d.ts +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/usage.d.ts @@ -10,14 +10,14 @@ export interface VariableUse { domain: UsageDomain; location: ts.Identifier; } -export declare const enum DeclarationDomain { +export declare enum DeclarationDomain { Namespace = 1, Type = 2, Value = 4, Import = 8, Any = 7 } -export declare const enum UsageDomain { +export declare enum UsageDomain { Namespace = 1, Type = 2, Value = 4, diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/usage.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/usage.js new file mode 100644 index 000000000..372d38a69 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/usage.js @@ -0,0 +1,645 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("./util"); +const ts = require("typescript"); +var DeclarationDomain; +(function (DeclarationDomain) { + DeclarationDomain[DeclarationDomain["Namespace"] = 1] = "Namespace"; + DeclarationDomain[DeclarationDomain["Type"] = 2] = "Type"; + DeclarationDomain[DeclarationDomain["Value"] = 4] = "Value"; + DeclarationDomain[DeclarationDomain["Import"] = 8] = "Import"; + DeclarationDomain[DeclarationDomain["Any"] = 7] = "Any"; +})(DeclarationDomain = exports.DeclarationDomain || (exports.DeclarationDomain = {})); +var UsageDomain; +(function (UsageDomain) { + UsageDomain[UsageDomain["Namespace"] = 1] = "Namespace"; + UsageDomain[UsageDomain["Type"] = 2] = "Type"; + UsageDomain[UsageDomain["Value"] = 4] = "Value"; + UsageDomain[UsageDomain["ValueOrNamespace"] = 5] = "ValueOrNamespace"; + UsageDomain[UsageDomain["Any"] = 7] = "Any"; + UsageDomain[UsageDomain["TypeQuery"] = 8] = "TypeQuery"; +})(UsageDomain = exports.UsageDomain || (exports.UsageDomain = {})); +function getUsageDomain(node) { + const parent = node.parent; + switch (parent.kind) { + case ts.SyntaxKind.TypeReference: + return node.originalKeywordKind !== ts.SyntaxKind.ConstKeyword ? 2 : undefined; + case ts.SyntaxKind.ExpressionWithTypeArguments: + return parent.parent.token === ts.SyntaxKind.ImplementsKeyword || + parent.parent.parent.kind === ts.SyntaxKind.InterfaceDeclaration + ? 2 + : 4; + case ts.SyntaxKind.TypeQuery: + return 5 | 8; + case ts.SyntaxKind.QualifiedName: + if (parent.left === node) { + if (getEntityNameParent(parent).kind === ts.SyntaxKind.TypeQuery) + return 1 | 8; + return 1; + } + break; + case ts.SyntaxKind.ExportSpecifier: + if (parent.propertyName === undefined || + parent.propertyName === node) + return 7; + break; + case ts.SyntaxKind.ExportAssignment: + return 7; + case ts.SyntaxKind.BindingElement: + if (parent.initializer === node) + return 5; + break; + case ts.SyntaxKind.Parameter: + case ts.SyntaxKind.EnumMember: + case ts.SyntaxKind.PropertyDeclaration: + case ts.SyntaxKind.VariableDeclaration: + case ts.SyntaxKind.PropertyAssignment: + case ts.SyntaxKind.PropertyAccessExpression: + case ts.SyntaxKind.ImportEqualsDeclaration: + if (parent.name !== node) + return 5; + break; + case ts.SyntaxKind.JsxAttribute: + case ts.SyntaxKind.FunctionDeclaration: + case ts.SyntaxKind.FunctionExpression: + case ts.SyntaxKind.NamespaceImport: + case ts.SyntaxKind.ClassDeclaration: + case ts.SyntaxKind.ClassExpression: + case ts.SyntaxKind.ModuleDeclaration: + case ts.SyntaxKind.MethodDeclaration: + case ts.SyntaxKind.EnumDeclaration: + case ts.SyntaxKind.GetAccessor: + case ts.SyntaxKind.SetAccessor: + case ts.SyntaxKind.LabeledStatement: + case ts.SyntaxKind.BreakStatement: + case ts.SyntaxKind.ContinueStatement: + case ts.SyntaxKind.ImportClause: + case ts.SyntaxKind.ImportSpecifier: + case ts.SyntaxKind.TypePredicate: + case ts.SyntaxKind.MethodSignature: + case ts.SyntaxKind.PropertySignature: + case ts.SyntaxKind.NamespaceExportDeclaration: + case ts.SyntaxKind.InterfaceDeclaration: + case ts.SyntaxKind.TypeAliasDeclaration: + case ts.SyntaxKind.TypeParameter: + break; + default: + return 5; + } +} +exports.getUsageDomain = getUsageDomain; +function getDeclarationDomain(node) { + switch (node.parent.kind) { + case ts.SyntaxKind.TypeParameter: + case ts.SyntaxKind.InterfaceDeclaration: + case ts.SyntaxKind.TypeAliasDeclaration: + return 2; + case ts.SyntaxKind.ClassDeclaration: + case ts.SyntaxKind.ClassExpression: + return 2 | 4; + case ts.SyntaxKind.EnumDeclaration: + return 7; + case ts.SyntaxKind.NamespaceImport: + case ts.SyntaxKind.ImportClause: + return 7 | 8; + case ts.SyntaxKind.ImportEqualsDeclaration: + case ts.SyntaxKind.ImportSpecifier: + return node.parent.name === node + ? 7 | 8 + : undefined; + case ts.SyntaxKind.ModuleDeclaration: + return 1; + case ts.SyntaxKind.Parameter: + if (node.parent.parent.kind === ts.SyntaxKind.IndexSignature || node.originalKeywordKind === ts.SyntaxKind.ThisKeyword) + return; + case ts.SyntaxKind.BindingElement: + case ts.SyntaxKind.VariableDeclaration: + return node.parent.name === node ? 4 : undefined; + case ts.SyntaxKind.FunctionDeclaration: + case ts.SyntaxKind.FunctionExpression: + return 4; + } +} +exports.getDeclarationDomain = getDeclarationDomain; +function collectVariableUsage(sourceFile) { + return new UsageWalker().getUsage(sourceFile); +} +exports.collectVariableUsage = collectVariableUsage; +class AbstractScope { + constructor(_global) { + this._global = _global; + this._variables = new Map(); + this._uses = []; + this._namespaceScopes = undefined; + this._enumScopes = undefined; + } + addVariable(identifier, name, selector, exported, domain) { + const variables = this.getDestinationScope(selector).getVariables(); + const declaration = { + domain, + exported, + declaration: name, + }; + const variable = variables.get(identifier); + if (variable === undefined) { + variables.set(identifier, { + domain, + declarations: [declaration], + uses: [], + }); + } + else { + variable.domain |= domain; + variable.declarations.push(declaration); + } + } + addUse(use) { + this._uses.push(use); + } + getVariables() { + return this._variables; + } + getFunctionScope() { + return this; + } + end(cb) { + if (this._namespaceScopes !== undefined) + this._namespaceScopes.forEach((value) => value.finish(cb)); + this._namespaceScopes = this._enumScopes = undefined; + this._applyUses(); + this._variables.forEach((variable) => { + for (const declaration of variable.declarations) { + const result = { + declarations: [], + domain: declaration.domain, + exported: declaration.exported, + inGlobalScope: this._global, + uses: [], + }; + for (const other of variable.declarations) + if (other.domain & declaration.domain) + result.declarations.push(other.declaration); + for (const use of variable.uses) + if (use.domain & declaration.domain) + result.uses.push(use); + cb(result, declaration.declaration, this); + } + }); + } + markExported(_name) { } + createOrReuseNamespaceScope(name, _exported, ambient, hasExportStatement) { + let scope; + if (this._namespaceScopes === undefined) { + this._namespaceScopes = new Map(); + } + else { + scope = this._namespaceScopes.get(name); + } + if (scope === undefined) { + scope = new NamespaceScope(ambient, hasExportStatement, this); + this._namespaceScopes.set(name, scope); + } + else { + scope.refresh(ambient, hasExportStatement); + } + return scope; + } + createOrReuseEnumScope(name, _exported) { + let scope; + if (this._enumScopes === undefined) { + this._enumScopes = new Map(); + } + else { + scope = this._enumScopes.get(name); + } + if (scope === undefined) { + scope = new EnumScope(this); + this._enumScopes.set(name, scope); + } + return scope; + } + _applyUses() { + for (const use of this._uses) + if (!this._applyUse(use)) + this._addUseToParent(use); + this._uses = []; + } + _applyUse(use, variables = this._variables) { + const variable = variables.get(use.location.text); + if (variable === undefined || (variable.domain & use.domain) === 0) + return false; + variable.uses.push(use); + return true; + } + _addUseToParent(_use) { } +} +class RootScope extends AbstractScope { + constructor(_exportAll, global) { + super(global); + this._exportAll = _exportAll; + this._exports = undefined; + this._innerScope = new NonRootScope(this, 1); + } + addVariable(identifier, name, selector, exported, domain) { + if (domain & 8) + return super.addVariable(identifier, name, selector, exported, domain); + return this._innerScope.addVariable(identifier, name, selector, exported, domain); + } + addUse(use, origin) { + if (origin === this._innerScope) + return super.addUse(use); + return this._innerScope.addUse(use); + } + markExported(id) { + if (this._exports === undefined) { + this._exports = [id.text]; + } + else { + this._exports.push(id.text); + } + } + end(cb) { + this._innerScope.end((value, key) => { + value.exported = value.exported || this._exportAll + || this._exports !== undefined && this._exports.includes(key.text); + value.inGlobalScope = this._global; + return cb(value, key, this); + }); + return super.end((value, key, scope) => { + value.exported = value.exported || scope === this + && this._exports !== undefined && this._exports.includes(key.text); + return cb(value, key, scope); + }); + } + getDestinationScope() { + return this; + } +} +class NonRootScope extends AbstractScope { + constructor(_parent, _boundary) { + super(false); + this._parent = _parent; + this._boundary = _boundary; + } + _addUseToParent(use) { + return this._parent.addUse(use, this); + } + getDestinationScope(selector) { + return this._boundary & selector + ? this + : this._parent.getDestinationScope(selector); + } +} +class EnumScope extends NonRootScope { + constructor(parent) { + super(parent, 1); + } + end() { + this._applyUses(); + } +} +class ConditionalTypeScope extends NonRootScope { + constructor(parent) { + super(parent, 8); + this._state = 0; + } + updateState(newState) { + this._state = newState; + } + addUse(use) { + if (this._state === 2) + return void this._uses.push(use); + return this._parent.addUse(use, this); + } +} +class FunctionScope extends NonRootScope { + constructor(parent) { + super(parent, 1); + } + beginBody() { + this._applyUses(); + } +} +class AbstractNamedExpressionScope extends NonRootScope { + constructor(_name, _domain, parent) { + super(parent, 1); + this._name = _name; + this._domain = _domain; + } + end(cb) { + this._innerScope.end(cb); + return cb({ + declarations: [this._name], + domain: this._domain, + exported: false, + uses: this._uses, + inGlobalScope: false, + }, this._name, this); + } + addUse(use, source) { + if (source !== this._innerScope) + return this._innerScope.addUse(use); + if (use.domain & this._domain && use.location.text === this._name.text) { + this._uses.push(use); + } + else { + return this._parent.addUse(use, this); + } + } + getFunctionScope() { + return this._innerScope; + } + getDestinationScope() { + return this._innerScope; + } +} +class FunctionExpressionScope extends AbstractNamedExpressionScope { + constructor(name, parent) { + super(name, 4, parent); + this._innerScope = new FunctionScope(this); + } + beginBody() { + return this._innerScope.beginBody(); + } +} +class ClassExpressionScope extends AbstractNamedExpressionScope { + constructor(name, parent) { + super(name, 4 | 2, parent); + this._innerScope = new NonRootScope(this, 1); + } +} +class BlockScope extends NonRootScope { + constructor(_functionScope, parent) { + super(parent, 2); + this._functionScope = _functionScope; + } + getFunctionScope() { + return this._functionScope; + } +} +function mapDeclaration(declaration) { + return { + declaration, + exported: true, + domain: getDeclarationDomain(declaration), + }; +} +class NamespaceScope extends NonRootScope { + constructor(_ambient, _hasExport, parent) { + super(parent, 1); + this._ambient = _ambient; + this._hasExport = _hasExport; + this._innerScope = new NonRootScope(this, 1); + this._exports = undefined; + } + finish(cb) { + return super.end(cb); + } + end(cb) { + this._innerScope.end((variable, key, scope) => { + if (scope !== this._innerScope || + !variable.exported && (!this._ambient || this._exports !== undefined && !this._exports.has(key.text))) + return cb(variable, key, scope); + const namespaceVar = this._variables.get(key.text); + if (namespaceVar === undefined) { + this._variables.set(key.text, { + declarations: variable.declarations.map(mapDeclaration), + domain: variable.domain, + uses: [...variable.uses], + }); + } + else { + outer: for (const declaration of variable.declarations) { + for (const existing of namespaceVar.declarations) + if (existing.declaration === declaration) + continue outer; + namespaceVar.declarations.push(mapDeclaration(declaration)); + } + namespaceVar.domain |= variable.domain; + for (const use of variable.uses) { + if (namespaceVar.uses.includes(use)) + continue; + namespaceVar.uses.push(use); + } + } + }); + this._applyUses(); + this._innerScope = new NonRootScope(this, 1); + } + createOrReuseNamespaceScope(name, exported, ambient, hasExportStatement) { + if (!exported && (!this._ambient || this._hasExport)) + return this._innerScope.createOrReuseNamespaceScope(name, exported, ambient || this._ambient, hasExportStatement); + return super.createOrReuseNamespaceScope(name, exported, ambient || this._ambient, hasExportStatement); + } + createOrReuseEnumScope(name, exported) { + if (!exported && (!this._ambient || this._hasExport)) + return this._innerScope.createOrReuseEnumScope(name, exported); + return super.createOrReuseEnumScope(name, exported); + } + addUse(use, source) { + if (source !== this._innerScope) + return this._innerScope.addUse(use); + this._uses.push(use); + } + refresh(ambient, hasExport) { + this._ambient = ambient; + this._hasExport = hasExport; + } + markExported(name, _as) { + if (this._exports === undefined) + this._exports = new Set(); + this._exports.add(name.text); + } + getDestinationScope() { + return this._innerScope; + } +} +function getEntityNameParent(name) { + let parent = name.parent; + while (parent.kind === ts.SyntaxKind.QualifiedName) + parent = parent.parent; + return parent; +} +class UsageWalker { + constructor() { + this._result = new Map(); + } + getUsage(sourceFile) { + const variableCallback = (variable, key) => { + this._result.set(key, variable); + }; + const isModule = ts.isExternalModule(sourceFile); + this._scope = new RootScope(sourceFile.isDeclarationFile && isModule && !containsExportStatement(sourceFile), !isModule); + const cb = (node) => { + if (util_1.isBlockScopeBoundary(node)) + return continueWithScope(node, new BlockScope(this._scope.getFunctionScope(), this._scope), handleBlockScope); + switch (node.kind) { + case ts.SyntaxKind.ClassExpression: + return continueWithScope(node, node.name !== undefined + ? new ClassExpressionScope(node.name, this._scope) + : new NonRootScope(this._scope, 1)); + case ts.SyntaxKind.ClassDeclaration: + this._handleDeclaration(node, true, 4 | 2); + return continueWithScope(node, new NonRootScope(this._scope, 1)); + case ts.SyntaxKind.InterfaceDeclaration: + case ts.SyntaxKind.TypeAliasDeclaration: + this._handleDeclaration(node, true, 2); + return continueWithScope(node, new NonRootScope(this._scope, 4)); + case ts.SyntaxKind.EnumDeclaration: + this._handleDeclaration(node, true, 7); + return continueWithScope(node, this._scope.createOrReuseEnumScope(node.name.text, util_1.hasModifier(node.modifiers, ts.SyntaxKind.ExportKeyword))); + case ts.SyntaxKind.ModuleDeclaration: + return this._handleModule(node, continueWithScope); + case ts.SyntaxKind.MappedType: + return continueWithScope(node, new NonRootScope(this._scope, 4)); + case ts.SyntaxKind.FunctionExpression: + case ts.SyntaxKind.ArrowFunction: + case ts.SyntaxKind.Constructor: + case ts.SyntaxKind.MethodDeclaration: + case ts.SyntaxKind.FunctionDeclaration: + case ts.SyntaxKind.GetAccessor: + case ts.SyntaxKind.SetAccessor: + case ts.SyntaxKind.MethodSignature: + case ts.SyntaxKind.CallSignature: + case ts.SyntaxKind.ConstructSignature: + case ts.SyntaxKind.ConstructorType: + case ts.SyntaxKind.FunctionType: + return this._handleFunctionLikeDeclaration(node, cb, variableCallback); + case ts.SyntaxKind.ConditionalType: + return this._handleConditionalType(node, cb, variableCallback); + case ts.SyntaxKind.VariableDeclarationList: + this._handleVariableDeclaration(node); + break; + case ts.SyntaxKind.Parameter: + if (node.parent.kind !== ts.SyntaxKind.IndexSignature && + (node.name.kind !== ts.SyntaxKind.Identifier || + node.name.originalKeywordKind !== ts.SyntaxKind.ThisKeyword)) + this._handleBindingName(node.name, false, false); + break; + case ts.SyntaxKind.EnumMember: + this._scope.addVariable(util_1.getPropertyName(node.name), node.name, 1, true, 4); + break; + case ts.SyntaxKind.ImportClause: + case ts.SyntaxKind.ImportSpecifier: + case ts.SyntaxKind.NamespaceImport: + case ts.SyntaxKind.ImportEqualsDeclaration: + this._handleDeclaration(node, false, 7 | 8); + break; + case ts.SyntaxKind.TypeParameter: + this._scope.addVariable(node.name.text, node.name, node.parent.kind === ts.SyntaxKind.InferType ? 8 : 7, false, 2); + break; + case ts.SyntaxKind.ExportSpecifier: + if (node.propertyName !== undefined) + return this._scope.markExported(node.propertyName, node.name); + return this._scope.markExported(node.name); + case ts.SyntaxKind.ExportAssignment: + if (node.expression.kind === ts.SyntaxKind.Identifier) + return this._scope.markExported(node.expression); + break; + case ts.SyntaxKind.Identifier: + const domain = getUsageDomain(node); + if (domain !== undefined) + this._scope.addUse({ domain, location: node }); + return; + } + return ts.forEachChild(node, cb); + }; + const continueWithScope = (node, scope, next = forEachChild) => { + const savedScope = this._scope; + this._scope = scope; + next(node); + this._scope.end(variableCallback); + this._scope = savedScope; + }; + const handleBlockScope = (node) => { + if (node.kind === ts.SyntaxKind.CatchClause && node.variableDeclaration !== undefined) + this._handleBindingName(node.variableDeclaration.name, true, false); + return ts.forEachChild(node, cb); + }; + ts.forEachChild(sourceFile, cb); + this._scope.end(variableCallback); + return this._result; + function forEachChild(node) { + return ts.forEachChild(node, cb); + } + } + _handleConditionalType(node, cb, varCb) { + const savedScope = this._scope; + const scope = this._scope = new ConditionalTypeScope(savedScope); + cb(node.checkType); + scope.updateState(1); + cb(node.extendsType); + scope.updateState(2); + cb(node.trueType); + scope.updateState(3); + cb(node.falseType); + scope.end(varCb); + this._scope = savedScope; + } + _handleFunctionLikeDeclaration(node, cb, varCb) { + if (node.decorators !== undefined) + node.decorators.forEach(cb); + const savedScope = this._scope; + if (node.kind === ts.SyntaxKind.FunctionDeclaration) + this._handleDeclaration(node, false, 4); + const scope = this._scope = node.kind === ts.SyntaxKind.FunctionExpression && node.name !== undefined + ? new FunctionExpressionScope(node.name, savedScope) + : new FunctionScope(savedScope); + if (node.name !== undefined) + cb(node.name); + if (node.typeParameters !== undefined) + node.typeParameters.forEach(cb); + node.parameters.forEach(cb); + if (node.type !== undefined) + cb(node.type); + if (node.body !== undefined) { + scope.beginBody(); + cb(node.body); + } + scope.end(varCb); + this._scope = savedScope; + } + _handleModule(node, next) { + if (node.flags & ts.NodeFlags.GlobalAugmentation) + return next(node, this._scope.createOrReuseNamespaceScope('-global', false, true, false)); + if (node.name.kind === ts.SyntaxKind.Identifier) { + const exported = isNamespaceExported(node); + this._scope.addVariable(node.name.text, node.name, 1, exported, 1 | 4); + const ambient = util_1.hasModifier(node.modifiers, ts.SyntaxKind.DeclareKeyword); + return next(node, this._scope.createOrReuseNamespaceScope(node.name.text, exported, ambient, ambient && namespaceHasExportStatement(node))); + } + return next(node, this._scope.createOrReuseNamespaceScope(`"${node.name.text}"`, false, true, namespaceHasExportStatement(node))); + } + _handleDeclaration(node, blockScoped, domain) { + if (node.name !== undefined) + this._scope.addVariable(node.name.text, node.name, blockScoped ? 3 : 1, util_1.hasModifier(node.modifiers, ts.SyntaxKind.ExportKeyword), domain); + } + _handleBindingName(name, blockScoped, exported) { + if (name.kind === ts.SyntaxKind.Identifier) + return this._scope.addVariable(name.text, name, blockScoped ? 3 : 1, exported, 4); + util_1.forEachDestructuringIdentifier(name, (declaration) => { + this._scope.addVariable(declaration.name.text, declaration.name, blockScoped ? 3 : 1, exported, 4); + }); + } + _handleVariableDeclaration(declarationList) { + const blockScoped = util_1.isBlockScopedVariableDeclarationList(declarationList); + const exported = declarationList.parent.kind === ts.SyntaxKind.VariableStatement && + util_1.hasModifier(declarationList.parent.modifiers, ts.SyntaxKind.ExportKeyword); + for (const declaration of declarationList.declarations) + this._handleBindingName(declaration.name, blockScoped, exported); + } +} +function isNamespaceExported(node) { + return node.parent.kind === ts.SyntaxKind.ModuleDeclaration || util_1.hasModifier(node.modifiers, ts.SyntaxKind.ExportKeyword); +} +function namespaceHasExportStatement(ns) { + if (ns.body === undefined || ns.body.kind !== ts.SyntaxKind.ModuleBlock) + return false; + return containsExportStatement(ns.body); +} +function containsExportStatement(block) { + for (const statement of block.statements) + if (statement.kind === ts.SyntaxKind.ExportDeclaration || statement.kind === ts.SyntaxKind.ExportAssignment) + return true; + return false; +} diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/util.d.ts b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/util.d.ts new file mode 100644 index 000000000..1ae3299a8 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/util.d.ts @@ -0,0 +1,167 @@ +import * as ts from 'typescript'; +import { NodeWrap } from './convert-ast'; +export declare function getChildOfKind(node: ts.Node, kind: T, sourceFile?: ts.SourceFile): ts.Token | undefined; +export declare function isTokenKind(kind: ts.SyntaxKind): boolean; +export declare function isNodeKind(kind: ts.SyntaxKind): boolean; +export declare function isAssignmentKind(kind: ts.SyntaxKind): boolean; +export declare function isTypeNodeKind(kind: ts.SyntaxKind): boolean; +export declare function isJsDocKind(kind: ts.SyntaxKind): boolean; +export declare function isKeywordKind(kind: ts.SyntaxKind): boolean; +export declare function isThisParameter(parameter: ts.ParameterDeclaration): boolean; +export declare function getModifier(node: ts.Node, kind: ts.Modifier['kind']): ts.Modifier | undefined; +export declare function hasModifier(modifiers: ts.ModifiersArray | undefined, ...kinds: Array): boolean; +export declare function isParameterProperty(node: ts.ParameterDeclaration): boolean; +export declare function hasAccessModifier(node: ts.ClassElement | ts.ParameterDeclaration): boolean; +export declare const isNodeFlagSet: (node: ts.Node, flag: ts.NodeFlags) => boolean; +export declare const isTypeFlagSet: (type: ts.Type, flag: ts.TypeFlags) => boolean; +export declare const isSymbolFlagSet: (symbol: ts.Symbol, flag: ts.SymbolFlags) => boolean; +export declare function isObjectFlagSet(objectType: ts.ObjectType, flag: ts.ObjectFlags): boolean; +export declare function isModifierFlagSet(node: ts.Node, flag: ts.ModifierFlags): boolean; +export declare function getPreviousStatement(statement: ts.Statement): ts.Statement | undefined; +export declare function getNextStatement(statement: ts.Statement): ts.Statement | undefined; +export declare function getPreviousToken(node: ts.Node, sourceFile?: ts.SourceFile): ts.Node | undefined; +export declare function getNextToken(node: ts.Node, sourceFile?: ts.SourceFile): ts.Node | undefined; +export declare function getTokenAtPosition(parent: ts.Node, pos: number, sourceFile?: ts.SourceFile, allowJsDoc?: boolean): ts.Node | undefined; +export declare function getCommentAtPosition(sourceFile: ts.SourceFile, pos: number, parent?: ts.Node): ts.CommentRange | undefined; +export declare function isPositionInComment(sourceFile: ts.SourceFile, pos: number, parent?: ts.Node): boolean; +export declare function commentText(sourceText: string, comment: ts.CommentRange): string; +export declare function getWrappedNodeAtPosition(wrap: NodeWrap, pos: number): NodeWrap | undefined; +export declare function getPropertyName(propertyName: ts.PropertyName): string | undefined; +export declare function forEachDestructuringIdentifier(pattern: ts.BindingPattern, fn: (element: ts.BindingElement & { + name: ts.Identifier; +}) => T): T | undefined; +export declare function forEachDeclaredVariable(declarationList: ts.VariableDeclarationList, cb: (element: (ts.VariableDeclaration | ts.BindingElement) & { + name: ts.Identifier; +}) => T): T | undefined; +export declare enum VariableDeclarationKind { + Var = 0, + Let = 1, + Const = 2 +} +export declare function getVariableDeclarationKind(declarationList: ts.VariableDeclarationList): VariableDeclarationKind; +export declare function isBlockScopedVariableDeclarationList(declarationList: ts.VariableDeclarationList): boolean; +export declare function isBlockScopedVariableDeclaration(declaration: ts.VariableDeclaration): boolean; +export declare function isBlockScopedDeclarationStatement(statement: ts.Statement): statement is ts.DeclarationStatement; +export declare function isInSingleStatementContext(statement: ts.Statement): boolean; +export declare enum ScopeBoundary { + None = 0, + Function = 1, + Block = 2, + Type = 4, + ConditionalType = 8 +} +export declare enum ScopeBoundarySelector { + Function = 1, + Block = 3, + Type = 7, + InferType = 8 +} +export declare function isScopeBoundary(node: ts.Node): ScopeBoundary; +export declare function isTypeScopeBoundary(node: ts.Node): ScopeBoundary; +export declare function isFunctionScopeBoundary(node: ts.Node): ScopeBoundary; +export declare function isBlockScopeBoundary(node: ts.Node): ScopeBoundary; +export declare function hasOwnThisReference(node: ts.Node): boolean; +export declare function isFunctionWithBody(node: ts.Node): node is ts.FunctionLikeDeclaration & { + body: {}; +}; +export declare function forEachToken(node: ts.Node, cb: (node: ts.Node) => void, sourceFile?: ts.SourceFile): void; +export declare type ForEachTokenCallback = (fullText: string, kind: ts.SyntaxKind, range: ts.TextRange, parent: ts.Node) => void; +export declare function forEachTokenWithTrivia(node: ts.Node, cb: ForEachTokenCallback, sourceFile?: ts.SourceFile): void; +export declare type ForEachCommentCallback = (fullText: string, comment: ts.CommentRange) => void; +export declare function forEachComment(node: ts.Node, cb: ForEachCommentCallback, sourceFile?: ts.SourceFile): void; +export interface LineRange extends ts.TextRange { + contentLength: number; +} +export declare function getLineRanges(sourceFile: ts.SourceFile): LineRange[]; +export declare function getLineBreakStyle(sourceFile: ts.SourceFile): "\n" | "\r\n"; +export declare function isValidIdentifier(text: string, languageVersion?: ts.ScriptTarget): boolean; +export declare function isValidPropertyAccess(text: string, languageVersion?: ts.ScriptTarget): boolean; +export declare function isValidPropertyName(text: string, languageVersion?: ts.ScriptTarget): boolean; +export declare function isValidNumericLiteral(text: string, languageVersion?: ts.ScriptTarget): boolean; +export declare function isValidJsxIdentifier(text: string, languageVersion?: ts.ScriptTarget): boolean; +export declare function isNumericPropertyName(name: string | ts.__String): boolean; +export declare function isSameLine(sourceFile: ts.SourceFile, pos1: number, pos2: number): boolean; +export declare enum SideEffectOptions { + None = 0, + TaggedTemplate = 1, + Constructor = 2, + JsxElement = 4 +} +export declare function hasSideEffects(node: ts.Expression, options?: SideEffectOptions): boolean; +export declare function getDeclarationOfBindingElement(node: ts.BindingElement): ts.VariableDeclaration | ts.ParameterDeclaration; +export declare function isExpressionValueUsed(node: ts.Expression): boolean; +export declare enum AccessKind { + None = 0, + Read = 1, + Write = 2, + Delete = 4, + ReadWrite = 3, + Modification = 6 +} +export declare function getAccessKind(node: ts.Node): AccessKind; +export declare function isReassignmentTarget(node: ts.Expression): boolean; +export declare function canHaveJsDoc(node: ts.Node): node is ts.HasJSDoc; +export declare function getJsDoc(node: ts.Node, sourceFile?: ts.SourceFile): ts.JSDoc[]; +export declare function parseJsDocOfNode(node: ts.Node, considerTrailingComments?: boolean, sourceFile?: ts.SourceFile): ts.JSDoc[]; +export declare enum ImportKind { + ImportDeclaration = 1, + ImportEquals = 2, + ExportFrom = 4, + DynamicImport = 8, + Require = 16, + ImportType = 32, + All = 63, + AllImports = 59, + AllStaticImports = 3, + AllImportExpressions = 24, + AllRequireLike = 18 +} +export declare function findImports(sourceFile: ts.SourceFile, kinds: ImportKind): (ts.StringLiteral | ts.NoSubstitutionTemplateLiteral)[]; +export declare type ImportLike = ts.ImportDeclaration | (ts.ImportEqualsDeclaration & { + moduleReference: ts.ExternalModuleReference; +}) | (ts.ExportDeclaration & { + moduleSpecifier: {}; +}) | (ts.CallExpression & { + expression: ts.Token | (ts.Identifier & { + text: 'require'; + }); + arguments: [ts.Expression]; +}) | ts.ImportTypeNode; +export declare function findImportLikeNodes(sourceFile: ts.SourceFile, kinds: ImportKind): ImportLike[]; +export declare function isStatementInAmbientContext(node: ts.Statement): boolean; +export declare function isAmbientModuleBlock(node: ts.Node): node is ts.ModuleBlock; +export declare function getIIFE(func: ts.FunctionExpression | ts.ArrowFunction): ts.CallExpression | undefined; +export declare type StrictCompilerOption = 'noImplicitAny' | 'noImplicitThis' | 'strictNullChecks' | 'strictFunctionTypes' | 'strictPropertyInitialization' | 'alwaysStrict' | 'strictBindCallApply'; +export declare function isStrictCompilerOptionEnabled(options: ts.CompilerOptions, option: StrictCompilerOption): boolean; +export declare type BooleanCompilerOptions = { + [K in keyof ts.CompilerOptions]: NonNullable extends boolean ? K : never; +} extends { + [_ in keyof ts.CompilerOptions]: infer U; +} ? U : never; +export declare function isCompilerOptionEnabled(options: ts.CompilerOptions, option: BooleanCompilerOptions | 'stripInternal'): boolean; +export declare function isAmbientModule(node: ts.ModuleDeclaration): boolean; +export declare function getCheckJsDirective(source: string): ts.CheckJsDirective | undefined; +export declare function isConstAssertion(node: ts.AssertionExpression): boolean; +export declare function isInConstContext(node: ts.Expression): boolean; +export declare function isReadonlyAssignmentDeclaration(node: ts.CallExpression, checker: ts.TypeChecker): boolean; +export declare function isBindableObjectDefinePropertyCall(node: ts.CallExpression): boolean; +export interface WellKnownSymbolLiteral extends ts.PropertyAccessExpression { + expression: ts.Identifier & { + text: 'Symbol'; + escapedText: 'symbol'; + }; +} +export declare function isWellKnownSymbolLiterally(node: ts.Expression): node is WellKnownSymbolLiteral; +export interface PropertyName { + displayName: string; + symbolName: ts.__String; +} +export declare function getPropertyNameOfWellKnownSymbol(node: WellKnownSymbolLiteral): PropertyName; +export interface LateBoundPropertyNames { + known: boolean; + names: PropertyName[]; +} +export declare function getLateBoundPropertyNames(node: ts.Expression, checker: ts.TypeChecker): LateBoundPropertyNames; +export declare function getLateBoundPropertyNamesOfPropertyName(node: ts.PropertyName, checker: ts.TypeChecker): LateBoundPropertyNames; +export declare function getSingleLateBoundPropertyNameOfPropertyName(node: ts.PropertyName, checker: ts.TypeChecker): PropertyName | undefined; +export declare function unwrapParentheses(node: ts.Expression): ts.Expression; diff --git a/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/util.js b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/util.js new file mode 100644 index 000000000..07b469a49 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils/util/util.js @@ -0,0 +1,1422 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const ts = require("typescript"); +const node_1 = require("../typeguard/node"); +const _3_2_1 = require("../typeguard/3.2"); +const type_1 = require("./type"); +function getChildOfKind(node, kind, sourceFile) { + for (const child of node.getChildren(sourceFile)) + if (child.kind === kind) + return child; +} +exports.getChildOfKind = getChildOfKind; +function isTokenKind(kind) { + return kind >= ts.SyntaxKind.FirstToken && kind <= ts.SyntaxKind.LastToken; +} +exports.isTokenKind = isTokenKind; +function isNodeKind(kind) { + return kind >= ts.SyntaxKind.FirstNode; +} +exports.isNodeKind = isNodeKind; +function isAssignmentKind(kind) { + return kind >= ts.SyntaxKind.FirstAssignment && kind <= ts.SyntaxKind.LastAssignment; +} +exports.isAssignmentKind = isAssignmentKind; +function isTypeNodeKind(kind) { + return kind >= ts.SyntaxKind.FirstTypeNode && kind <= ts.SyntaxKind.LastTypeNode; +} +exports.isTypeNodeKind = isTypeNodeKind; +function isJsDocKind(kind) { + return kind >= ts.SyntaxKind.FirstJSDocNode && kind <= ts.SyntaxKind.LastJSDocNode; +} +exports.isJsDocKind = isJsDocKind; +function isKeywordKind(kind) { + return kind >= ts.SyntaxKind.FirstKeyword && kind <= ts.SyntaxKind.LastKeyword; +} +exports.isKeywordKind = isKeywordKind; +function isThisParameter(parameter) { + return parameter.name.kind === ts.SyntaxKind.Identifier && parameter.name.originalKeywordKind === ts.SyntaxKind.ThisKeyword; +} +exports.isThisParameter = isThisParameter; +function getModifier(node, kind) { + if (node.modifiers !== undefined) + for (const modifier of node.modifiers) + if (modifier.kind === kind) + return modifier; +} +exports.getModifier = getModifier; +function hasModifier(modifiers, ...kinds) { + if (modifiers === undefined) + return false; + for (const modifier of modifiers) + if (kinds.includes(modifier.kind)) + return true; + return false; +} +exports.hasModifier = hasModifier; +function isParameterProperty(node) { + return hasModifier(node.modifiers, ts.SyntaxKind.PublicKeyword, ts.SyntaxKind.ProtectedKeyword, ts.SyntaxKind.PrivateKeyword, ts.SyntaxKind.ReadonlyKeyword); +} +exports.isParameterProperty = isParameterProperty; +function hasAccessModifier(node) { + return hasModifier(node.modifiers, ts.SyntaxKind.PublicKeyword, ts.SyntaxKind.ProtectedKeyword, ts.SyntaxKind.PrivateKeyword); +} +exports.hasAccessModifier = hasAccessModifier; +function isFlagSet(obj, flag) { + return (obj.flags & flag) !== 0; +} +exports.isNodeFlagSet = isFlagSet; +exports.isTypeFlagSet = isFlagSet; +exports.isSymbolFlagSet = isFlagSet; +function isObjectFlagSet(objectType, flag) { + return (objectType.objectFlags & flag) !== 0; +} +exports.isObjectFlagSet = isObjectFlagSet; +function isModifierFlagSet(node, flag) { + return (ts.getCombinedModifierFlags(node) & flag) !== 0; +} +exports.isModifierFlagSet = isModifierFlagSet; +function getPreviousStatement(statement) { + const parent = statement.parent; + if (node_1.isBlockLike(parent)) { + const index = parent.statements.indexOf(statement); + if (index > 0) + return parent.statements[index - 1]; + } +} +exports.getPreviousStatement = getPreviousStatement; +function getNextStatement(statement) { + const parent = statement.parent; + if (node_1.isBlockLike(parent)) { + const index = parent.statements.indexOf(statement); + if (index < parent.statements.length) + return parent.statements[index + 1]; + } +} +exports.getNextStatement = getNextStatement; +function getPreviousToken(node, sourceFile) { + let parent = node.parent; + while (parent !== undefined && parent.pos === node.pos) + parent = parent.parent; + if (parent === undefined) + return; + outer: while (true) { + const children = parent.getChildren(sourceFile); + for (let i = children.length - 1; i >= 0; --i) { + const child = children[i]; + if (child.pos < node.pos && child.kind !== ts.SyntaxKind.JSDocComment) { + if (isTokenKind(child.kind)) + return child; + parent = child; + continue outer; + } + } + return; + } +} +exports.getPreviousToken = getPreviousToken; +function getNextToken(node, sourceFile = node.getSourceFile()) { + if (node.kind === ts.SyntaxKind.SourceFile || node.kind === ts.SyntaxKind.EndOfFileToken) + return; + const end = node.end; + node = node.parent; + while (node.end === end) { + if (node.parent === undefined) + return node.endOfFileToken; + node = node.parent; + } + return getTokenAtPositionWorker(node, end, sourceFile, false); +} +exports.getNextToken = getNextToken; +function getTokenAtPosition(parent, pos, sourceFile, allowJsDoc) { + if (pos < parent.pos || pos >= parent.end) + return; + if (isTokenKind(parent.kind)) + return parent; + if (sourceFile === undefined) + sourceFile = parent.getSourceFile(); + return getTokenAtPositionWorker(parent, pos, sourceFile, allowJsDoc === true); +} +exports.getTokenAtPosition = getTokenAtPosition; +function getTokenAtPositionWorker(node, pos, sourceFile, allowJsDoc) { + outer: while (true) { + for (const child of node.getChildren(sourceFile)) { + if (child.end > pos && (allowJsDoc || child.kind !== ts.SyntaxKind.JSDocComment)) { + if (isTokenKind(child.kind)) + return child; + node = child; + continue outer; + } + } + return; + } +} +function getCommentAtPosition(sourceFile, pos, parent = sourceFile) { + const token = getTokenAtPosition(parent, pos, sourceFile); + if (token === undefined || token.kind === ts.SyntaxKind.JsxText || pos >= token.end - (ts.tokenToString(token.kind) || '').length) + return; + const startPos = token.pos === 0 + ? (ts.getShebang(sourceFile.text) || '').length + : token.pos; + return startPos !== 0 && ts.forEachTrailingCommentRange(sourceFile.text, startPos, commentAtPositionCallback, pos) || + ts.forEachLeadingCommentRange(sourceFile.text, startPos, commentAtPositionCallback, pos); +} +exports.getCommentAtPosition = getCommentAtPosition; +function commentAtPositionCallback(pos, end, kind, _nl, at) { + return at >= pos && at < end ? { pos, end, kind } : undefined; +} +function isPositionInComment(sourceFile, pos, parent) { + return getCommentAtPosition(sourceFile, pos, parent) !== undefined; +} +exports.isPositionInComment = isPositionInComment; +function commentText(sourceText, comment) { + return sourceText.substring(comment.pos + 2, comment.kind === ts.SyntaxKind.SingleLineCommentTrivia ? comment.end : comment.end - 2); +} +exports.commentText = commentText; +function getWrappedNodeAtPosition(wrap, pos) { + if (wrap.node.pos > pos || wrap.node.end <= pos) + return; + outer: while (true) { + for (const child of wrap.children) { + if (child.node.pos > pos) + return wrap; + if (child.node.end > pos) { + wrap = child; + continue outer; + } + } + return wrap; + } +} +exports.getWrappedNodeAtPosition = getWrappedNodeAtPosition; +function getPropertyName(propertyName) { + if (propertyName.kind === ts.SyntaxKind.ComputedPropertyName) { + if (!node_1.isLiteralExpression(propertyName.expression)) + return; + if (_3_2_1.isBigIntLiteral(propertyName.expression)) + return propertyName.expression.text.slice(0, -1); + return propertyName.expression.text; + } + return propertyName.text; +} +exports.getPropertyName = getPropertyName; +function forEachDestructuringIdentifier(pattern, fn) { + for (const element of pattern.elements) { + if (element.kind !== ts.SyntaxKind.BindingElement) + continue; + let result; + if (element.name.kind === ts.SyntaxKind.Identifier) { + result = fn(element); + } + else { + result = forEachDestructuringIdentifier(element.name, fn); + } + if (result) + return result; + } +} +exports.forEachDestructuringIdentifier = forEachDestructuringIdentifier; +function forEachDeclaredVariable(declarationList, cb) { + for (const declaration of declarationList.declarations) { + let result; + if (declaration.name.kind === ts.SyntaxKind.Identifier) { + result = cb(declaration); + } + else { + result = forEachDestructuringIdentifier(declaration.name, cb); + } + if (result) + return result; + } +} +exports.forEachDeclaredVariable = forEachDeclaredVariable; +var VariableDeclarationKind; +(function (VariableDeclarationKind) { + VariableDeclarationKind[VariableDeclarationKind["Var"] = 0] = "Var"; + VariableDeclarationKind[VariableDeclarationKind["Let"] = 1] = "Let"; + VariableDeclarationKind[VariableDeclarationKind["Const"] = 2] = "Const"; +})(VariableDeclarationKind = exports.VariableDeclarationKind || (exports.VariableDeclarationKind = {})); +function getVariableDeclarationKind(declarationList) { + if (declarationList.flags & ts.NodeFlags.Let) + return 1; + if (declarationList.flags & ts.NodeFlags.Const) + return 2; + return 0; +} +exports.getVariableDeclarationKind = getVariableDeclarationKind; +function isBlockScopedVariableDeclarationList(declarationList) { + return (declarationList.flags & ts.NodeFlags.BlockScoped) !== 0; +} +exports.isBlockScopedVariableDeclarationList = isBlockScopedVariableDeclarationList; +function isBlockScopedVariableDeclaration(declaration) { + const parent = declaration.parent; + return parent.kind === ts.SyntaxKind.CatchClause || + isBlockScopedVariableDeclarationList(parent); +} +exports.isBlockScopedVariableDeclaration = isBlockScopedVariableDeclaration; +function isBlockScopedDeclarationStatement(statement) { + switch (statement.kind) { + case ts.SyntaxKind.VariableStatement: + return isBlockScopedVariableDeclarationList(statement.declarationList); + case ts.SyntaxKind.ClassDeclaration: + case ts.SyntaxKind.EnumDeclaration: + case ts.SyntaxKind.InterfaceDeclaration: + case ts.SyntaxKind.TypeAliasDeclaration: + return true; + default: + return false; + } +} +exports.isBlockScopedDeclarationStatement = isBlockScopedDeclarationStatement; +function isInSingleStatementContext(statement) { + switch (statement.parent.kind) { + case ts.SyntaxKind.ForStatement: + case ts.SyntaxKind.ForInStatement: + case ts.SyntaxKind.ForOfStatement: + case ts.SyntaxKind.WhileStatement: + case ts.SyntaxKind.DoStatement: + case ts.SyntaxKind.IfStatement: + case ts.SyntaxKind.WithStatement: + case ts.SyntaxKind.LabeledStatement: + return true; + default: + return false; + } +} +exports.isInSingleStatementContext = isInSingleStatementContext; +var ScopeBoundary; +(function (ScopeBoundary) { + ScopeBoundary[ScopeBoundary["None"] = 0] = "None"; + ScopeBoundary[ScopeBoundary["Function"] = 1] = "Function"; + ScopeBoundary[ScopeBoundary["Block"] = 2] = "Block"; + ScopeBoundary[ScopeBoundary["Type"] = 4] = "Type"; + ScopeBoundary[ScopeBoundary["ConditionalType"] = 8] = "ConditionalType"; +})(ScopeBoundary = exports.ScopeBoundary || (exports.ScopeBoundary = {})); +var ScopeBoundarySelector; +(function (ScopeBoundarySelector) { + ScopeBoundarySelector[ScopeBoundarySelector["Function"] = 1] = "Function"; + ScopeBoundarySelector[ScopeBoundarySelector["Block"] = 3] = "Block"; + ScopeBoundarySelector[ScopeBoundarySelector["Type"] = 7] = "Type"; + ScopeBoundarySelector[ScopeBoundarySelector["InferType"] = 8] = "InferType"; +})(ScopeBoundarySelector = exports.ScopeBoundarySelector || (exports.ScopeBoundarySelector = {})); +function isScopeBoundary(node) { + return isFunctionScopeBoundary(node) || isBlockScopeBoundary(node) || isTypeScopeBoundary(node); +} +exports.isScopeBoundary = isScopeBoundary; +function isTypeScopeBoundary(node) { + switch (node.kind) { + case ts.SyntaxKind.InterfaceDeclaration: + case ts.SyntaxKind.TypeAliasDeclaration: + case ts.SyntaxKind.MappedType: + return 4; + case ts.SyntaxKind.ConditionalType: + return 8; + default: + return 0; + } +} +exports.isTypeScopeBoundary = isTypeScopeBoundary; +function isFunctionScopeBoundary(node) { + switch (node.kind) { + case ts.SyntaxKind.FunctionExpression: + case ts.SyntaxKind.ArrowFunction: + case ts.SyntaxKind.Constructor: + case ts.SyntaxKind.ModuleDeclaration: + case ts.SyntaxKind.ClassDeclaration: + case ts.SyntaxKind.ClassExpression: + case ts.SyntaxKind.EnumDeclaration: + case ts.SyntaxKind.MethodDeclaration: + case ts.SyntaxKind.FunctionDeclaration: + case ts.SyntaxKind.GetAccessor: + case ts.SyntaxKind.SetAccessor: + case ts.SyntaxKind.MethodSignature: + case ts.SyntaxKind.CallSignature: + case ts.SyntaxKind.ConstructSignature: + case ts.SyntaxKind.ConstructorType: + case ts.SyntaxKind.FunctionType: + return 1; + case ts.SyntaxKind.SourceFile: + return ts.isExternalModule(node) ? 1 : 0; + default: + return 0; + } +} +exports.isFunctionScopeBoundary = isFunctionScopeBoundary; +function isBlockScopeBoundary(node) { + switch (node.kind) { + case ts.SyntaxKind.Block: + const parent = node.parent; + return parent.kind !== ts.SyntaxKind.CatchClause && + (parent.kind === ts.SyntaxKind.SourceFile || + !isFunctionScopeBoundary(parent)) + ? 2 + : 0; + case ts.SyntaxKind.ForStatement: + case ts.SyntaxKind.ForInStatement: + case ts.SyntaxKind.ForOfStatement: + case ts.SyntaxKind.CaseBlock: + case ts.SyntaxKind.CatchClause: + case ts.SyntaxKind.WithStatement: + return 2; + default: + return 0; + } +} +exports.isBlockScopeBoundary = isBlockScopeBoundary; +function hasOwnThisReference(node) { + switch (node.kind) { + case ts.SyntaxKind.ClassDeclaration: + case ts.SyntaxKind.ClassExpression: + case ts.SyntaxKind.FunctionExpression: + return true; + case ts.SyntaxKind.FunctionDeclaration: + return node.body !== undefined; + case ts.SyntaxKind.MethodDeclaration: + case ts.SyntaxKind.GetAccessor: + case ts.SyntaxKind.SetAccessor: + return node.parent.kind === ts.SyntaxKind.ObjectLiteralExpression; + default: + return false; + } +} +exports.hasOwnThisReference = hasOwnThisReference; +function isFunctionWithBody(node) { + switch (node.kind) { + case ts.SyntaxKind.GetAccessor: + case ts.SyntaxKind.SetAccessor: + case ts.SyntaxKind.FunctionDeclaration: + case ts.SyntaxKind.MethodDeclaration: + case ts.SyntaxKind.Constructor: + return node.body !== undefined; + case ts.SyntaxKind.FunctionExpression: + case ts.SyntaxKind.ArrowFunction: + return true; + default: + return false; + } +} +exports.isFunctionWithBody = isFunctionWithBody; +function forEachToken(node, cb, sourceFile = node.getSourceFile()) { + return (function iterate(child) { + if (isTokenKind(child.kind)) + return cb(child); + if (child.kind !== ts.SyntaxKind.JSDocComment) + return child.getChildren(sourceFile).forEach(iterate); + })(node); +} +exports.forEachToken = forEachToken; +function forEachTokenWithTrivia(node, cb, sourceFile = node.getSourceFile()) { + const fullText = sourceFile.text; + const scanner = ts.createScanner(sourceFile.languageVersion, false, sourceFile.languageVariant, fullText); + return forEachToken(node, (token) => { + const tokenStart = token.kind === ts.SyntaxKind.JsxText || token.pos === token.end ? token.pos : token.getStart(sourceFile); + if (tokenStart !== token.pos) { + scanner.setTextPos(token.pos); + let kind = scanner.scan(); + let pos = scanner.getTokenPos(); + while (pos < tokenStart) { + const textPos = scanner.getTextPos(); + cb(fullText, kind, { pos, end: textPos }, token.parent); + if (textPos === tokenStart) + break; + kind = scanner.scan(); + pos = scanner.getTokenPos(); + } + } + return cb(fullText, token.kind, { end: token.end, pos: tokenStart }, token.parent); + }, sourceFile); +} +exports.forEachTokenWithTrivia = forEachTokenWithTrivia; +function forEachComment(node, cb, sourceFile = node.getSourceFile()) { + const fullText = sourceFile.text; + const notJsx = sourceFile.languageVariant !== ts.LanguageVariant.JSX; + return forEachToken(node, (token) => { + if (token.pos === token.end) + return; + if (token.kind !== ts.SyntaxKind.JsxText) + ts.forEachLeadingCommentRange(fullText, token.pos === 0 ? (ts.getShebang(fullText) || '').length : token.pos, commentCallback); + if (notJsx || canHaveTrailingTrivia(token)) + return ts.forEachTrailingCommentRange(fullText, token.end, commentCallback); + }, sourceFile); + function commentCallback(pos, end, kind) { + cb(fullText, { pos, end, kind }); + } +} +exports.forEachComment = forEachComment; +function canHaveTrailingTrivia(token) { + switch (token.kind) { + case ts.SyntaxKind.CloseBraceToken: + return token.parent.kind !== ts.SyntaxKind.JsxExpression || !isJsxElementOrFragment(token.parent.parent); + case ts.SyntaxKind.GreaterThanToken: + switch (token.parent.kind) { + case ts.SyntaxKind.JsxOpeningElement: + return token.end !== token.parent.end; + case ts.SyntaxKind.JsxOpeningFragment: + return false; + case ts.SyntaxKind.JsxSelfClosingElement: + return token.end !== token.parent.end || + !isJsxElementOrFragment(token.parent.parent); + case ts.SyntaxKind.JsxClosingElement: + case ts.SyntaxKind.JsxClosingFragment: + return !isJsxElementOrFragment(token.parent.parent.parent); + } + } + return true; +} +function isJsxElementOrFragment(node) { + return node.kind === ts.SyntaxKind.JsxElement || node.kind === ts.SyntaxKind.JsxFragment; +} +function getLineRanges(sourceFile) { + const lineStarts = sourceFile.getLineStarts(); + const result = []; + const length = lineStarts.length; + const sourceText = sourceFile.text; + let pos = 0; + for (let i = 1; i < length; ++i) { + const end = lineStarts[i]; + let lineEnd = end; + for (; lineEnd > pos; --lineEnd) + if (!ts.isLineBreak(sourceText.charCodeAt(lineEnd - 1))) + break; + result.push({ + pos, + end, + contentLength: lineEnd - pos, + }); + pos = end; + } + result.push({ + pos, + end: sourceFile.end, + contentLength: sourceFile.end - pos, + }); + return result; +} +exports.getLineRanges = getLineRanges; +function getLineBreakStyle(sourceFile) { + const lineStarts = sourceFile.getLineStarts(); + return lineStarts.length === 1 || lineStarts[1] < 2 || sourceFile.text[lineStarts[1] - 2] !== '\r' + ? '\n' + : '\r\n'; +} +exports.getLineBreakStyle = getLineBreakStyle; +let cachedScanner; +function scanToken(text, languageVersion) { + if (cachedScanner === undefined) { + cachedScanner = ts.createScanner(languageVersion, false, undefined, text); + } + else { + cachedScanner.setScriptTarget(languageVersion); + cachedScanner.setText(text); + } + cachedScanner.scan(); + return cachedScanner; +} +function isValidIdentifier(text, languageVersion = ts.ScriptTarget.Latest) { + const scan = scanToken(text, languageVersion); + return scan.isIdentifier() && scan.getTextPos() === text.length && scan.getTokenPos() === 0; +} +exports.isValidIdentifier = isValidIdentifier; +function charSize(ch) { + return ch >= 0x10000 ? 2 : 1; +} +function isValidPropertyAccess(text, languageVersion = ts.ScriptTarget.Latest) { + if (text.length === 0) + return false; + let ch = text.codePointAt(0); + if (!ts.isIdentifierStart(ch, languageVersion)) + return false; + for (let i = charSize(ch); i < text.length; i += charSize(ch)) { + ch = text.codePointAt(i); + if (!ts.isIdentifierPart(ch, languageVersion)) + return false; + } + return true; +} +exports.isValidPropertyAccess = isValidPropertyAccess; +function isValidPropertyName(text, languageVersion = ts.ScriptTarget.Latest) { + if (isValidPropertyAccess(text, languageVersion)) + return true; + const scan = scanToken(text, languageVersion); + return scan.getTextPos() === text.length && + scan.getToken() === ts.SyntaxKind.NumericLiteral && scan.getTokenValue() === text; +} +exports.isValidPropertyName = isValidPropertyName; +function isValidNumericLiteral(text, languageVersion = ts.ScriptTarget.Latest) { + const scan = scanToken(text, languageVersion); + return scan.getToken() === ts.SyntaxKind.NumericLiteral && scan.getTextPos() === text.length && scan.getTokenPos() === 0; +} +exports.isValidNumericLiteral = isValidNumericLiteral; +function isValidJsxIdentifier(text, languageVersion = ts.ScriptTarget.Latest) { + if (text.length === 0) + return false; + let ch = text.codePointAt(0); + if (!ts.isIdentifierStart(ch, languageVersion)) + return false; + for (let i = charSize(ch); i < text.length; i += charSize(ch)) { + ch = text.codePointAt(i); + if (!ts.isIdentifierPart(ch, languageVersion) && ch !== 45) + return false; + } + return true; +} +exports.isValidJsxIdentifier = isValidJsxIdentifier; +function isNumericPropertyName(name) { + return String(+name) === name; +} +exports.isNumericPropertyName = isNumericPropertyName; +function isSameLine(sourceFile, pos1, pos2) { + return ts.getLineAndCharacterOfPosition(sourceFile, pos1).line === ts.getLineAndCharacterOfPosition(sourceFile, pos2).line; +} +exports.isSameLine = isSameLine; +var SideEffectOptions; +(function (SideEffectOptions) { + SideEffectOptions[SideEffectOptions["None"] = 0] = "None"; + SideEffectOptions[SideEffectOptions["TaggedTemplate"] = 1] = "TaggedTemplate"; + SideEffectOptions[SideEffectOptions["Constructor"] = 2] = "Constructor"; + SideEffectOptions[SideEffectOptions["JsxElement"] = 4] = "JsxElement"; +})(SideEffectOptions = exports.SideEffectOptions || (exports.SideEffectOptions = {})); +function hasSideEffects(node, options) { + switch (node.kind) { + case ts.SyntaxKind.CallExpression: + case ts.SyntaxKind.PostfixUnaryExpression: + case ts.SyntaxKind.AwaitExpression: + case ts.SyntaxKind.YieldExpression: + case ts.SyntaxKind.DeleteExpression: + return true; + case ts.SyntaxKind.TypeAssertionExpression: + case ts.SyntaxKind.AsExpression: + case ts.SyntaxKind.ParenthesizedExpression: + case ts.SyntaxKind.NonNullExpression: + case ts.SyntaxKind.VoidExpression: + case ts.SyntaxKind.TypeOfExpression: + case ts.SyntaxKind.PropertyAccessExpression: + case ts.SyntaxKind.SpreadElement: + case ts.SyntaxKind.PartiallyEmittedExpression: + return hasSideEffects(node.expression, options); + case ts.SyntaxKind.BinaryExpression: + return isAssignmentKind(node.operatorToken.kind) || + hasSideEffects(node.left, options) || + hasSideEffects(node.right, options); + case ts.SyntaxKind.PrefixUnaryExpression: + switch (node.operator) { + case ts.SyntaxKind.PlusPlusToken: + case ts.SyntaxKind.MinusMinusToken: + return true; + default: + return hasSideEffects(node.operand, options); + } + case ts.SyntaxKind.ElementAccessExpression: + return hasSideEffects(node.expression, options) || + node.argumentExpression !== undefined && + hasSideEffects(node.argumentExpression, options); + case ts.SyntaxKind.ConditionalExpression: + return hasSideEffects(node.condition, options) || + hasSideEffects(node.whenTrue, options) || + hasSideEffects(node.whenFalse, options); + case ts.SyntaxKind.NewExpression: + if (options & 2 || hasSideEffects(node.expression, options)) + return true; + if (node.arguments !== undefined) + for (const child of node.arguments) + if (hasSideEffects(child, options)) + return true; + return false; + case ts.SyntaxKind.TaggedTemplateExpression: + if (options & 1 || hasSideEffects(node.tag, options)) + return true; + if (node.template.kind === ts.SyntaxKind.NoSubstitutionTemplateLiteral) + return false; + node = node.template; + case ts.SyntaxKind.TemplateExpression: + for (const child of node.templateSpans) + if (hasSideEffects(child.expression, options)) + return true; + return false; + case ts.SyntaxKind.ClassExpression: + return classExpressionHasSideEffects(node, options); + case ts.SyntaxKind.ArrayLiteralExpression: + for (const child of node.elements) + if (hasSideEffects(child, options)) + return true; + return false; + case ts.SyntaxKind.ObjectLiteralExpression: + for (const child of node.properties) { + if (child.name !== undefined && child.name.kind === ts.SyntaxKind.ComputedPropertyName && + hasSideEffects(child.name.expression, options)) + return true; + switch (child.kind) { + case ts.SyntaxKind.PropertyAssignment: + if (hasSideEffects(child.initializer, options)) + return true; + break; + case ts.SyntaxKind.SpreadAssignment: + if (hasSideEffects(child.expression, options)) + return true; + } + } + return false; + case ts.SyntaxKind.JsxExpression: + return node.expression !== undefined && hasSideEffects(node.expression, options); + case ts.SyntaxKind.JsxElement: + case ts.SyntaxKind.JsxFragment: + for (const child of node.children) + if (child.kind !== ts.SyntaxKind.JsxText && hasSideEffects(child, options)) + return true; + if (node.kind === ts.SyntaxKind.JsxFragment) + return false; + node = node.openingElement; + case ts.SyntaxKind.JsxSelfClosingElement: + case ts.SyntaxKind.JsxOpeningElement: + if (options & 4) + return true; + for (const child of node.attributes.properties) { + if (child.kind === ts.SyntaxKind.JsxSpreadAttribute) { + if (hasSideEffects(child.expression, options)) + return true; + } + else if (child.initializer !== undefined && hasSideEffects(child.initializer, options)) { + return true; + } + } + return false; + case ts.SyntaxKind.CommaListExpression: + for (const child of node.elements) + if (hasSideEffects(child, options)) + return true; + return false; + default: + return false; + } +} +exports.hasSideEffects = hasSideEffects; +function classExpressionHasSideEffects(node, options) { + if (node.heritageClauses !== undefined && node.heritageClauses[0].token === ts.SyntaxKind.ExtendsKeyword) + for (const base of node.heritageClauses[0].types) + if (hasSideEffects(base.expression, options)) + return true; + for (const child of node.members) + if (child.name !== undefined && child.name.kind === ts.SyntaxKind.ComputedPropertyName && + hasSideEffects(child.name.expression, options) || + node_1.isPropertyDeclaration(child) && child.initializer !== undefined && + hasSideEffects(child.initializer, options)) + return true; + return false; +} +function getDeclarationOfBindingElement(node) { + let parent = node.parent.parent; + while (parent.kind === ts.SyntaxKind.BindingElement) + parent = parent.parent.parent; + return parent; +} +exports.getDeclarationOfBindingElement = getDeclarationOfBindingElement; +function isExpressionValueUsed(node) { + while (true) { + const parent = node.parent; + switch (parent.kind) { + case ts.SyntaxKind.CallExpression: + case ts.SyntaxKind.NewExpression: + case ts.SyntaxKind.ElementAccessExpression: + case ts.SyntaxKind.WhileStatement: + case ts.SyntaxKind.DoStatement: + case ts.SyntaxKind.WithStatement: + case ts.SyntaxKind.ThrowStatement: + case ts.SyntaxKind.ReturnStatement: + case ts.SyntaxKind.JsxExpression: + case ts.SyntaxKind.JsxSpreadAttribute: + case ts.SyntaxKind.JsxElement: + case ts.SyntaxKind.JsxFragment: + case ts.SyntaxKind.JsxSelfClosingElement: + case ts.SyntaxKind.ComputedPropertyName: + case ts.SyntaxKind.ArrowFunction: + case ts.SyntaxKind.ExportSpecifier: + case ts.SyntaxKind.ExportAssignment: + case ts.SyntaxKind.ImportDeclaration: + case ts.SyntaxKind.ExternalModuleReference: + case ts.SyntaxKind.Decorator: + case ts.SyntaxKind.TaggedTemplateExpression: + case ts.SyntaxKind.TemplateSpan: + case ts.SyntaxKind.ExpressionWithTypeArguments: + case ts.SyntaxKind.TypeOfExpression: + case ts.SyntaxKind.AwaitExpression: + case ts.SyntaxKind.YieldExpression: + case ts.SyntaxKind.LiteralType: + case ts.SyntaxKind.JsxAttributes: + case ts.SyntaxKind.JsxOpeningElement: + case ts.SyntaxKind.JsxClosingElement: + case ts.SyntaxKind.IfStatement: + case ts.SyntaxKind.CaseClause: + case ts.SyntaxKind.SwitchStatement: + return true; + case ts.SyntaxKind.PropertyAccessExpression: + return parent.expression === node; + case ts.SyntaxKind.QualifiedName: + return parent.left === node; + case ts.SyntaxKind.ShorthandPropertyAssignment: + return parent.objectAssignmentInitializer === node || + !isInDestructuringAssignment(parent); + case ts.SyntaxKind.PropertyAssignment: + return parent.initializer === node && !isInDestructuringAssignment(parent); + case ts.SyntaxKind.SpreadAssignment: + case ts.SyntaxKind.SpreadElement: + case ts.SyntaxKind.ArrayLiteralExpression: + return !isInDestructuringAssignment(parent); + case ts.SyntaxKind.ParenthesizedExpression: + case ts.SyntaxKind.AsExpression: + case ts.SyntaxKind.TypeAssertionExpression: + case ts.SyntaxKind.PostfixUnaryExpression: + case ts.SyntaxKind.PrefixUnaryExpression: + case ts.SyntaxKind.NonNullExpression: + node = parent; + break; + case ts.SyntaxKind.ForStatement: + return parent.condition === node; + case ts.SyntaxKind.ForInStatement: + case ts.SyntaxKind.ForOfStatement: + return parent.expression === node; + case ts.SyntaxKind.ConditionalExpression: + if (parent.condition === node) + return true; + node = parent; + break; + case ts.SyntaxKind.PropertyDeclaration: + case ts.SyntaxKind.BindingElement: + case ts.SyntaxKind.VariableDeclaration: + case ts.SyntaxKind.Parameter: + case ts.SyntaxKind.EnumMember: + return parent.initializer === node; + case ts.SyntaxKind.ImportEqualsDeclaration: + return parent.moduleReference === node; + case ts.SyntaxKind.CommaListExpression: + if (parent.elements[parent.elements.length - 1] !== node) + return false; + node = parent; + break; + case ts.SyntaxKind.BinaryExpression: + if (parent.right === node) { + if (parent.operatorToken.kind === ts.SyntaxKind.CommaToken) { + node = parent; + break; + } + return true; + } + switch (parent.operatorToken.kind) { + case ts.SyntaxKind.CommaToken: + case ts.SyntaxKind.EqualsToken: + return false; + case ts.SyntaxKind.EqualsEqualsEqualsToken: + case ts.SyntaxKind.EqualsEqualsToken: + case ts.SyntaxKind.ExclamationEqualsEqualsToken: + case ts.SyntaxKind.ExclamationEqualsToken: + case ts.SyntaxKind.InstanceOfKeyword: + case ts.SyntaxKind.PlusToken: + case ts.SyntaxKind.MinusToken: + case ts.SyntaxKind.AsteriskToken: + case ts.SyntaxKind.SlashToken: + case ts.SyntaxKind.PercentToken: + case ts.SyntaxKind.AsteriskAsteriskToken: + case ts.SyntaxKind.GreaterThanToken: + case ts.SyntaxKind.GreaterThanGreaterThanToken: + case ts.SyntaxKind.GreaterThanGreaterThanGreaterThanToken: + case ts.SyntaxKind.GreaterThanEqualsToken: + case ts.SyntaxKind.LessThanToken: + case ts.SyntaxKind.LessThanLessThanToken: + case ts.SyntaxKind.LessThanEqualsToken: + case ts.SyntaxKind.AmpersandToken: + case ts.SyntaxKind.BarToken: + case ts.SyntaxKind.CaretToken: + case ts.SyntaxKind.BarBarToken: + case ts.SyntaxKind.AmpersandAmpersandToken: + case ts.SyntaxKind.InKeyword: + return true; + default: + node = parent; + } + break; + default: + return false; + } + } +} +exports.isExpressionValueUsed = isExpressionValueUsed; +function isInDestructuringAssignment(node) { + switch (node.kind) { + case ts.SyntaxKind.ShorthandPropertyAssignment: + if (node.objectAssignmentInitializer !== undefined) + return true; + case ts.SyntaxKind.PropertyAssignment: + case ts.SyntaxKind.SpreadAssignment: + node = node.parent; + break; + case ts.SyntaxKind.SpreadElement: + if (node.parent.kind !== ts.SyntaxKind.ArrayLiteralExpression) + return false; + node = node.parent; + } + while (true) { + switch (node.parent.kind) { + case ts.SyntaxKind.BinaryExpression: + return node.parent.left === node && + node.parent.operatorToken.kind === ts.SyntaxKind.EqualsToken; + case ts.SyntaxKind.ForOfStatement: + return node.parent.initializer === node; + case ts.SyntaxKind.ArrayLiteralExpression: + case ts.SyntaxKind.ObjectLiteralExpression: + node = node.parent; + break; + case ts.SyntaxKind.SpreadAssignment: + case ts.SyntaxKind.PropertyAssignment: + node = node.parent.parent; + break; + case ts.SyntaxKind.SpreadElement: + if (node.parent.parent.kind !== ts.SyntaxKind.ArrayLiteralExpression) + return false; + node = node.parent.parent; + break; + default: + return false; + } + } +} +var AccessKind; +(function (AccessKind) { + AccessKind[AccessKind["None"] = 0] = "None"; + AccessKind[AccessKind["Read"] = 1] = "Read"; + AccessKind[AccessKind["Write"] = 2] = "Write"; + AccessKind[AccessKind["Delete"] = 4] = "Delete"; + AccessKind[AccessKind["ReadWrite"] = 3] = "ReadWrite"; + AccessKind[AccessKind["Modification"] = 6] = "Modification"; +})(AccessKind = exports.AccessKind || (exports.AccessKind = {})); +function getAccessKind(node) { + const parent = node.parent; + switch (parent.kind) { + case ts.SyntaxKind.DeleteExpression: + return 4; + case ts.SyntaxKind.PostfixUnaryExpression: + return 3; + case ts.SyntaxKind.PrefixUnaryExpression: + return parent.operator === ts.SyntaxKind.PlusPlusToken || + parent.operator === ts.SyntaxKind.MinusMinusToken + ? 3 + : 1; + case ts.SyntaxKind.BinaryExpression: + return parent.right === node + ? 1 + : !isAssignmentKind(parent.operatorToken.kind) + ? 1 + : parent.operatorToken.kind === ts.SyntaxKind.EqualsToken + ? 2 + : 3; + case ts.SyntaxKind.ShorthandPropertyAssignment: + return parent.objectAssignmentInitializer === node + ? 1 + : isInDestructuringAssignment(parent) + ? 2 + : 1; + case ts.SyntaxKind.PropertyAssignment: + return parent.name === node + ? 0 + : isInDestructuringAssignment(parent) + ? 2 + : 1; + case ts.SyntaxKind.ArrayLiteralExpression: + case ts.SyntaxKind.SpreadElement: + case ts.SyntaxKind.SpreadAssignment: + return isInDestructuringAssignment(parent) + ? 2 + : 1; + case ts.SyntaxKind.ParenthesizedExpression: + case ts.SyntaxKind.NonNullExpression: + case ts.SyntaxKind.TypeAssertionExpression: + case ts.SyntaxKind.AsExpression: + return getAccessKind(parent); + case ts.SyntaxKind.ForOfStatement: + case ts.SyntaxKind.ForInStatement: + return parent.initializer === node + ? 2 + : 1; + case ts.SyntaxKind.ExpressionWithTypeArguments: + return parent.parent.token === ts.SyntaxKind.ExtendsKeyword && + parent.parent.parent.kind !== ts.SyntaxKind.InterfaceDeclaration + ? 1 + : 0; + case ts.SyntaxKind.ComputedPropertyName: + case ts.SyntaxKind.ExpressionStatement: + case ts.SyntaxKind.TypeOfExpression: + case ts.SyntaxKind.ElementAccessExpression: + case ts.SyntaxKind.ForStatement: + case ts.SyntaxKind.IfStatement: + case ts.SyntaxKind.DoStatement: + case ts.SyntaxKind.WhileStatement: + case ts.SyntaxKind.SwitchStatement: + case ts.SyntaxKind.WithStatement: + case ts.SyntaxKind.ThrowStatement: + case ts.SyntaxKind.CallExpression: + case ts.SyntaxKind.NewExpression: + case ts.SyntaxKind.TaggedTemplateExpression: + case ts.SyntaxKind.JsxExpression: + case ts.SyntaxKind.Decorator: + case ts.SyntaxKind.TemplateSpan: + case ts.SyntaxKind.JsxOpeningElement: + case ts.SyntaxKind.JsxSelfClosingElement: + case ts.SyntaxKind.JsxSpreadAttribute: + case ts.SyntaxKind.VoidExpression: + case ts.SyntaxKind.ReturnStatement: + case ts.SyntaxKind.AwaitExpression: + case ts.SyntaxKind.YieldExpression: + case ts.SyntaxKind.ConditionalExpression: + case ts.SyntaxKind.CaseClause: + case ts.SyntaxKind.JsxElement: + return 1; + case ts.SyntaxKind.ArrowFunction: + return parent.body === node + ? 1 + : 2; + case ts.SyntaxKind.PropertyDeclaration: + case ts.SyntaxKind.VariableDeclaration: + case ts.SyntaxKind.Parameter: + case ts.SyntaxKind.EnumMember: + case ts.SyntaxKind.BindingElement: + case ts.SyntaxKind.JsxAttribute: + return parent.initializer === node + ? 1 + : 0; + case ts.SyntaxKind.PropertyAccessExpression: + return parent.expression === node + ? 1 + : 0; + case ts.SyntaxKind.ExportAssignment: + return parent.isExportEquals + ? 1 + : 0; + } + return 0; +} +exports.getAccessKind = getAccessKind; +function isReassignmentTarget(node) { + return (getAccessKind(node) & 2) !== 0; +} +exports.isReassignmentTarget = isReassignmentTarget; +function canHaveJsDoc(node) { + const kind = node.kind; + switch (kind) { + case ts.SyntaxKind.Parameter: + case ts.SyntaxKind.CallSignature: + case ts.SyntaxKind.ConstructSignature: + case ts.SyntaxKind.MethodSignature: + case ts.SyntaxKind.PropertySignature: + case ts.SyntaxKind.ArrowFunction: + case ts.SyntaxKind.ParenthesizedExpression: + case ts.SyntaxKind.SpreadAssignment: + case ts.SyntaxKind.ShorthandPropertyAssignment: + case ts.SyntaxKind.PropertyAssignment: + case ts.SyntaxKind.FunctionExpression: + case ts.SyntaxKind.FunctionDeclaration: + case ts.SyntaxKind.LabeledStatement: + case ts.SyntaxKind.ExpressionStatement: + case ts.SyntaxKind.VariableStatement: + case ts.SyntaxKind.Constructor: + case ts.SyntaxKind.MethodDeclaration: + case ts.SyntaxKind.PropertyDeclaration: + case ts.SyntaxKind.GetAccessor: + case ts.SyntaxKind.SetAccessor: + case ts.SyntaxKind.ClassDeclaration: + case ts.SyntaxKind.ClassExpression: + case ts.SyntaxKind.InterfaceDeclaration: + case ts.SyntaxKind.TypeAliasDeclaration: + case ts.SyntaxKind.EnumMember: + case ts.SyntaxKind.EnumDeclaration: + case ts.SyntaxKind.ModuleDeclaration: + case ts.SyntaxKind.ImportEqualsDeclaration: + case ts.SyntaxKind.IndexSignature: + case ts.SyntaxKind.FunctionType: + case ts.SyntaxKind.ConstructorType: + case ts.SyntaxKind.JSDocFunctionType: + case ts.SyntaxKind.EndOfFileToken: + case ts.SyntaxKind.ExportDeclaration: + return true; + default: + return false; + } +} +exports.canHaveJsDoc = canHaveJsDoc; +function getJsDoc(node, sourceFile) { + if (node.kind === ts.SyntaxKind.EndOfFileToken) + return parseJsDocWorker(node, sourceFile || node.parent); + const result = []; + for (const child of node.getChildren(sourceFile)) { + if (!node_1.isJsDoc(child)) + break; + result.push(child); + } + return result; +} +exports.getJsDoc = getJsDoc; +function parseJsDocOfNode(node, considerTrailingComments, sourceFile = node.getSourceFile()) { + if (canHaveJsDoc(node) && node.kind !== ts.SyntaxKind.EndOfFileToken) { + const result = getJsDoc(node, sourceFile); + if (result.length !== 0 || !considerTrailingComments) + return result; + } + return parseJsDocWorker(node, sourceFile, considerTrailingComments); +} +exports.parseJsDocOfNode = parseJsDocOfNode; +function parseJsDocWorker(node, sourceFile, considerTrailingComments) { + const nodeStart = node.getStart(sourceFile); + const start = ts[considerTrailingComments && isSameLine(sourceFile, node.pos, nodeStart) + ? 'forEachTrailingCommentRange' + : 'forEachLeadingCommentRange'](sourceFile.text, node.pos, (pos, _end, kind) => kind === ts.SyntaxKind.MultiLineCommentTrivia && sourceFile.text[pos + 2] === '*' ? { pos } : undefined); + if (start === undefined) + return []; + const startPos = start.pos; + const text = sourceFile.text.slice(startPos, nodeStart); + const newSourceFile = ts.createSourceFile('jsdoc.ts', `${text}var a;`, sourceFile.languageVersion); + const result = getJsDoc(newSourceFile.statements[0], newSourceFile); + for (const doc of result) + updateNode(doc, node); + return result; + function updateNode(n, parent) { + n.pos += startPos; + n.end += startPos; + n.parent = parent; + return ts.forEachChild(n, (child) => updateNode(child, n), (children) => { + children.pos += startPos; + children.end += startPos; + for (const child of children) + updateNode(child, n); + }); + } +} +var ImportKind; +(function (ImportKind) { + ImportKind[ImportKind["ImportDeclaration"] = 1] = "ImportDeclaration"; + ImportKind[ImportKind["ImportEquals"] = 2] = "ImportEquals"; + ImportKind[ImportKind["ExportFrom"] = 4] = "ExportFrom"; + ImportKind[ImportKind["DynamicImport"] = 8] = "DynamicImport"; + ImportKind[ImportKind["Require"] = 16] = "Require"; + ImportKind[ImportKind["ImportType"] = 32] = "ImportType"; + ImportKind[ImportKind["All"] = 63] = "All"; + ImportKind[ImportKind["AllImports"] = 59] = "AllImports"; + ImportKind[ImportKind["AllStaticImports"] = 3] = "AllStaticImports"; + ImportKind[ImportKind["AllImportExpressions"] = 24] = "AllImportExpressions"; + ImportKind[ImportKind["AllRequireLike"] = 18] = "AllRequireLike"; + ImportKind[ImportKind["AllNestedImports"] = 56] = "AllNestedImports"; + ImportKind[ImportKind["AllTopLevelImports"] = 7] = "AllTopLevelImports"; +})(ImportKind = exports.ImportKind || (exports.ImportKind = {})); +function findImports(sourceFile, kinds) { + const result = []; + for (const node of findImportLikeNodes(sourceFile, kinds)) { + switch (node.kind) { + case ts.SyntaxKind.ImportDeclaration: + addIfTextualLiteral(node.moduleSpecifier); + break; + case ts.SyntaxKind.ImportEqualsDeclaration: + addIfTextualLiteral(node.moduleReference.expression); + break; + case ts.SyntaxKind.ExportDeclaration: + addIfTextualLiteral(node.moduleSpecifier); + break; + case ts.SyntaxKind.CallExpression: + addIfTextualLiteral(node.arguments[0]); + break; + case ts.SyntaxKind.ImportType: + if (node_1.isLiteralTypeNode(node.argument)) + addIfTextualLiteral(node.argument.literal); + break; + default: + throw new Error('unexpected node'); + } + } + return result; + function addIfTextualLiteral(node) { + if (node_1.isTextualLiteral(node)) + result.push(node); + } +} +exports.findImports = findImports; +function findImportLikeNodes(sourceFile, kinds) { + return new ImportFinder(sourceFile, kinds).find(); +} +exports.findImportLikeNodes = findImportLikeNodes; +class ImportFinder { + constructor(_sourceFile, _options) { + this._sourceFile = _sourceFile; + this._options = _options; + this._result = []; + } + find() { + if (this._sourceFile.isDeclarationFile) + this._options &= ~24; + if (this._options & 7) + this._findImports(this._sourceFile.statements); + if (this._options & 56) + this._findNestedImports(); + return this._result; + } + _findImports(statements) { + for (const statement of statements) { + if (node_1.isImportDeclaration(statement)) { + if (this._options & 1) + this._result.push(statement); + } + else if (node_1.isImportEqualsDeclaration(statement)) { + if (this._options & 2 && + statement.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) + this._result.push(statement); + } + else if (node_1.isExportDeclaration(statement)) { + if (statement.moduleSpecifier !== undefined && this._options & 4) + this._result.push(statement); + } + else if (node_1.isModuleDeclaration(statement)) { + this._findImportsInModule(statement); + } + } + } + _findImportsInModule(declaration) { + if (declaration.body === undefined) + return; + if (declaration.body.kind === ts.SyntaxKind.ModuleDeclaration) + return this._findImportsInModule(declaration.body); + this._findImports(declaration.body.statements); + } + _findNestedImports() { + let re; + if ((this._options & 56) === 16) { + re = /\brequire\s*[ { + if (kind === ts.SyntaxKind.SingleLineCommentTrivia) { + const text = source.slice(pos, end); + const match = /^\/{2,3}\s*@ts-(no)?check(?:\s|$)/i.exec(text); + if (match !== null) + directive = { pos, end, enabled: match[1] === undefined }; + } + }); + return directive; +} +exports.getCheckJsDirective = getCheckJsDirective; +function isConstAssertion(node) { + return node_1.isTypeReferenceNode(node.type) && + node.type.typeName.kind === ts.SyntaxKind.Identifier && + node.type.typeName.escapedText === 'const'; +} +exports.isConstAssertion = isConstAssertion; +function isInConstContext(node) { + let current = node; + while (true) { + const parent = current.parent; + outer: switch (parent.kind) { + case ts.SyntaxKind.TypeAssertionExpression: + case ts.SyntaxKind.AsExpression: + return isConstAssertion(parent); + case ts.SyntaxKind.PrefixUnaryExpression: + if (current.kind !== ts.SyntaxKind.NumericLiteral) + return false; + switch (parent.operator) { + case ts.SyntaxKind.PlusToken: + case ts.SyntaxKind.MinusToken: + current = parent; + break outer; + default: + return false; + } + case ts.SyntaxKind.PropertyAssignment: + if (parent.initializer !== current) + return false; + current = parent.parent; + break; + case ts.SyntaxKind.ShorthandPropertyAssignment: + current = parent.parent; + break; + case ts.SyntaxKind.ParenthesizedExpression: + case ts.SyntaxKind.ArrayLiteralExpression: + case ts.SyntaxKind.ObjectLiteralExpression: + current = parent; + break; + default: + return false; + } + } +} +exports.isInConstContext = isInConstContext; +function isReadonlyAssignmentDeclaration(node, checker) { + if (!isBindableObjectDefinePropertyCall(node)) + return false; + const descriptorType = checker.getTypeAtLocation(node.arguments[2]); + if (descriptorType.getProperty('value') === undefined) + return descriptorType.getProperty('set') === undefined; + const writableProp = descriptorType.getProperty('writable'); + if (writableProp === undefined) + return false; + const writableType = writableProp.valueDeclaration !== undefined && node_1.isPropertyAssignment(writableProp.valueDeclaration) + ? checker.getTypeAtLocation(writableProp.valueDeclaration.initializer) + : checker.getTypeOfSymbolAtLocation(writableProp, node.arguments[2]); + return type_1.isBooleanLiteralType(writableType, false); +} +exports.isReadonlyAssignmentDeclaration = isReadonlyAssignmentDeclaration; +function isBindableObjectDefinePropertyCall(node) { + return node.arguments.length === 3 && + node_1.isEntityNameExpression(node.arguments[0]) && + node_1.isNumericOrStringLikeLiteral(node.arguments[1]) && + node_1.isPropertyAccessExpression(node.expression) && + node.expression.name.escapedText === 'defineProperty' && + node_1.isIdentifier(node.expression.expression) && + node.expression.expression.escapedText === 'Object'; +} +exports.isBindableObjectDefinePropertyCall = isBindableObjectDefinePropertyCall; +function isWellKnownSymbolLiterally(node) { + return ts.isPropertyAccessExpression(node) && + ts.isIdentifier(node.expression) && + node.expression.escapedText === 'Symbol'; +} +exports.isWellKnownSymbolLiterally = isWellKnownSymbolLiterally; +function getPropertyNameOfWellKnownSymbol(node) { + return { + displayName: `[Symbol.${node.name.text}]`, + symbolName: ('__@' + node.name.text), + }; +} +exports.getPropertyNameOfWellKnownSymbol = getPropertyNameOfWellKnownSymbol; +function getLateBoundPropertyNames(node, checker) { + const result = { + known: true, + names: [], + }; + node = unwrapParentheses(node); + if (isWellKnownSymbolLiterally(node)) { + result.names.push(getPropertyNameOfWellKnownSymbol(node)); + } + else { + const type = checker.getTypeAtLocation(node); + for (const key of type_1.unionTypeParts(checker.getBaseConstraintOfType(type) || type)) { + const propertyName = type_1.getPropertyNameFromType(key); + if (propertyName) { + result.names.push(propertyName); + } + else { + result.known = false; + } + } + } + return result; +} +exports.getLateBoundPropertyNames = getLateBoundPropertyNames; +function getLateBoundPropertyNamesOfPropertyName(node, checker) { + const staticName = getPropertyName(node); + return staticName !== undefined + ? { known: true, names: [{ displayName: staticName, symbolName: ts.escapeLeadingUnderscores(staticName) }] } + : getLateBoundPropertyNames(node.expression, checker); +} +exports.getLateBoundPropertyNamesOfPropertyName = getLateBoundPropertyNamesOfPropertyName; +function getSingleLateBoundPropertyNameOfPropertyName(node, checker) { + const staticName = getPropertyName(node); + if (staticName !== undefined) + return { displayName: staticName, symbolName: ts.escapeLeadingUnderscores(staticName) }; + const { expression } = node; + return isWellKnownSymbolLiterally(expression) + ? getPropertyNameOfWellKnownSymbol(expression) + : type_1.getPropertyNameFromType(checker.getTypeAtLocation(expression)); +} +exports.getSingleLateBoundPropertyNameOfPropertyName = getSingleLateBoundPropertyNameOfPropertyName; +function unwrapParentheses(node) { + while (node.kind === ts.SyntaxKind.ParenthesizedExpression) + node = node.expression; + return node; +} +exports.unwrapParentheses = unwrapParentheses; diff --git a/node_modules/@typescript-eslint/typescript-estree/package.json b/node_modules/@typescript-eslint/typescript-estree/package.json new file mode 100644 index 000000000..a04c3ac78 --- /dev/null +++ b/node_modules/@typescript-eslint/typescript-estree/package.json @@ -0,0 +1,88 @@ +{ + "name": "@typescript-eslint/typescript-estree", + "version": "4.1.0", + "description": "A parser that converts TypeScript source code into an ESTree compatible form", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "files": [ + "dist", + "README.md", + "LICENSE" + ], + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/typescript-estree" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "license": "BSD-2-Clause", + "keywords": [ + "ast", + "estree", + "ecmascript", + "javascript", + "typescript", + "parser", + "syntax" + ], + "scripts": { + "build": "tsc -b tsconfig.build.json", + "postbuild": "downlevel-dts dist _ts3.4/dist", + "clean": "tsc -b tsconfig.build.json --clean", + "postclean": "rimraf dist", + "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", + "lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'", + "test": "jest --coverage", + "typecheck": "tsc -p tsconfig.json --noEmit" + }, + "dependencies": { + "@typescript-eslint/types": "4.1.0", + "@typescript-eslint/visitor-keys": "4.1.0", + "debug": "^4.1.1", + "globby": "^11.0.1", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "devDependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/parser": "^7.11.3", + "@babel/types": "^7.11.0", + "@types/babel__code-frame": "^7.0.1", + "@types/debug": "*", + "@types/glob": "*", + "@types/is-glob": "^4.0.1", + "@types/lodash": "*", + "@types/semver": "^7.1.0", + "@types/tmp": "^0.2.0", + "@typescript-eslint/shared-fixtures": "4.1.0", + "glob": "*", + "jest-specific-snapshot": "*", + "make-dir": "*", + "tmp": "^0.2.1", + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "typesVersions": { + "<3.8": { + "*": [ + "_ts3.4/*" + ] + } + }, + "gitHead": "00a24706222254774121ee62038e67d0efa993e7" +} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/visitor-keys/CHANGELOG.md b/node_modules/@typescript-eslint/visitor-keys/CHANGELOG.md new file mode 100644 index 000000000..ef433031f --- /dev/null +++ b/node_modules/@typescript-eslint/visitor-keys/CHANGELOG.md @@ -0,0 +1,124 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) + +**Note:** Version bump only for package @typescript-eslint/visitor-keys + + + + + +## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) + +**Note:** Version bump only for package @typescript-eslint/visitor-keys + + + + + +# [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) + + +### Bug Fixes + +* correct decorator traversal for AssignmentPattern ([#2375](https://github.com/typescript-eslint/typescript-eslint/issues/2375)) ([d738fa4](https://github.com/typescript-eslint/typescript-eslint/commit/d738fa4eff0a5c4cfc9b30b1c0502f8d1e78d7b6)) + + +### Features + +* support ESTree optional chaining representation ([#2308](https://github.com/typescript-eslint/typescript-eslint/issues/2308)) ([e9d2ab6](https://github.com/typescript-eslint/typescript-eslint/commit/e9d2ab638b6767700b52797e74b814ea059beaae)) + + +### BREAKING CHANGES + +* - Removed decorators property from several Nodes that could never semantically have them (FunctionDeclaration, TSEnumDeclaration, and TSInterfaceDeclaration) +- Removed AST_NODE_TYPES.Import. This is a minor breaking change as the node type that used this was removed ages ago. + + + + + +## [3.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.0...v3.10.1) (2020-08-25) + +**Note:** Version bump only for package @typescript-eslint/visitor-keys + + + + + +# [3.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.1...v3.10.0) (2020-08-24) + +**Note:** Version bump only for package @typescript-eslint/visitor-keys + + + + + +## [3.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.0...v3.9.1) (2020-08-17) + +**Note:** Version bump only for package @typescript-eslint/visitor-keys + + + + + +# [3.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.8.0...v3.9.0) (2020-08-10) + + +### Features + +* **typescript-estree:** support TSv4 labelled tuple members ([#2378](https://github.com/typescript-eslint/typescript-eslint/issues/2378)) ([00d84ff](https://github.com/typescript-eslint/typescript-eslint/commit/00d84ffbcbe9d0ec98bdb2f2ce59959a27ce4dbe)) + + + + + +# [3.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.1...v3.8.0) (2020-08-03) + +**Note:** Version bump only for package @typescript-eslint/visitor-keys + + + + + +## [3.7.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.0...v3.7.1) (2020-07-27) + +**Note:** Version bump only for package @typescript-eslint/visitor-keys + + + + + +# [3.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.1...v3.7.0) (2020-07-20) + +**Note:** Version bump only for package @typescript-eslint/visitor-keys + + + + + +## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) + +**Note:** Version bump only for package @typescript-eslint/visitor-keys + + + + + +# [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) + +**Note:** Version bump only for package @typescript-eslint/visitor-keys + + + + + +# [3.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.4.0...v3.5.0) (2020-06-29) + + +### Features + +* split visitor keys into their own package ([#2230](https://github.com/typescript-eslint/typescript-eslint/issues/2230)) ([689dae3](https://github.com/typescript-eslint/typescript-eslint/commit/689dae37392d527c64ae83db2a4c3e6b7fecece7)) diff --git a/node_modules/@typescript-eslint/visitor-keys/LICENSE b/node_modules/@typescript-eslint/visitor-keys/LICENSE new file mode 100644 index 000000000..7e7370143 --- /dev/null +++ b/node_modules/@typescript-eslint/visitor-keys/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 TypeScript ESLint and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@typescript-eslint/visitor-keys/README.md b/node_modules/@typescript-eslint/visitor-keys/README.md new file mode 100644 index 000000000..839c20c49 --- /dev/null +++ b/node_modules/@typescript-eslint/visitor-keys/README.md @@ -0,0 +1,13 @@ +

TypeScript-ESTree Visitor Keys

+ +

Visitor keys used to help traverse the TypeScript-ESTree AST

+ +

+ CI + NPM Version + NPM Downloads +

+ +## Contributing + +[See the contributing guide here](../../CONTRIBUTING.md) diff --git a/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.d.ts b/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.d.ts new file mode 100644 index 000000000..3ea365416 --- /dev/null +++ b/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.d.ts @@ -0,0 +1,4 @@ +import { TSESTree } from '@typescript-eslint/types'; +declare const getKeys: (node: TSESTree.Node) => ReadonlyArray; +export { getKeys }; +//# sourceMappingURL=get-keys.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.d.ts.map b/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.d.ts.map new file mode 100644 index 000000000..499c1191a --- /dev/null +++ b/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"get-keys.d.ts","sourceRoot":"","sources":["../src/get-keys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,QAAA,MAAM,OAAO,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,KAAK,aAAa,CAAC,MAAM,CAAmB,CAAC;AAEhF,OAAO,EAAE,OAAO,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.js b/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.js new file mode 100644 index 000000000..309b72b95 --- /dev/null +++ b/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getKeys = void 0; +const eslint_visitor_keys_1 = require("eslint-visitor-keys"); +const getKeys = eslint_visitor_keys_1.getKeys; +exports.getKeys = getKeys; +//# sourceMappingURL=get-keys.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.js.map b/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.js.map new file mode 100644 index 000000000..4a0c09867 --- /dev/null +++ b/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.js.map @@ -0,0 +1 @@ +{"version":3,"file":"get-keys.js","sourceRoot":"","sources":["../src/get-keys.ts"],"names":[],"mappings":";;;AACA,6DAAiE;AAEjE,MAAM,OAAO,GAAmD,6BAAe,CAAC;AAEvE,0BAAO"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/visitor-keys/dist/index.d.ts b/node_modules/@typescript-eslint/visitor-keys/dist/index.d.ts new file mode 100644 index 000000000..895ff52b8 --- /dev/null +++ b/node_modules/@typescript-eslint/visitor-keys/dist/index.d.ts @@ -0,0 +1,3 @@ +export { getKeys } from './get-keys'; +export { visitorKeys, VisitorKeys } from './visitor-keys'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/visitor-keys/dist/index.d.ts.map b/node_modules/@typescript-eslint/visitor-keys/dist/index.d.ts.map new file mode 100644 index 000000000..393a70678 --- /dev/null +++ b/node_modules/@typescript-eslint/visitor-keys/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/visitor-keys/dist/index.js b/node_modules/@typescript-eslint/visitor-keys/dist/index.js new file mode 100644 index 000000000..a5b4b62ae --- /dev/null +++ b/node_modules/@typescript-eslint/visitor-keys/dist/index.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.visitorKeys = exports.getKeys = void 0; +var get_keys_1 = require("./get-keys"); +Object.defineProperty(exports, "getKeys", { enumerable: true, get: function () { return get_keys_1.getKeys; } }); +var visitor_keys_1 = require("./visitor-keys"); +Object.defineProperty(exports, "visitorKeys", { enumerable: true, get: function () { return visitor_keys_1.visitorKeys; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/visitor-keys/dist/index.js.map b/node_modules/@typescript-eslint/visitor-keys/dist/index.js.map new file mode 100644 index 000000000..5f74496fa --- /dev/null +++ b/node_modules/@typescript-eslint/visitor-keys/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAChB,+CAA0D;AAAjD,2GAAA,WAAW,OAAA"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.d.ts b/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.d.ts new file mode 100644 index 000000000..ceb5a2b5a --- /dev/null +++ b/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.d.ts @@ -0,0 +1,6 @@ +interface VisitorKeys { + readonly [type: string]: readonly string[] | undefined; +} +declare const visitorKeys: VisitorKeys; +export { visitorKeys, VisitorKeys }; +//# sourceMappingURL=visitor-keys.d.ts.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.d.ts.map b/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.d.ts.map new file mode 100644 index 000000000..00aab33ff --- /dev/null +++ b/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"visitor-keys.d.ts","sourceRoot":"","sources":["../src/visitor-keys.ts"],"names":[],"mappings":"AAGA,UAAU,WAAW;IACnB,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;CACxD;AA4ID,QAAA,MAAM,WAAW,EAAE,WAAyD,CAAC;AAE7E,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.js b/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.js new file mode 100644 index 000000000..0813decda --- /dev/null +++ b/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.js @@ -0,0 +1,149 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.visitorKeys = void 0; +const eslintVisitorKeys = __importStar(require("eslint-visitor-keys")); +const additionalKeys = { + // ES2020 + ImportExpression: ['source'], + // Additional Properties. + ArrayPattern: ['decorators', 'elements', 'typeAnnotation'], + ArrowFunctionExpression: ['typeParameters', 'params', 'returnType', 'body'], + AssignmentPattern: ['decorators', 'left', 'right', 'typeAnnotation'], + CallExpression: ['callee', 'typeParameters', 'arguments'], + ClassDeclaration: [ + 'decorators', + 'id', + 'typeParameters', + 'superClass', + 'superTypeParameters', + 'implements', + 'body', + ], + ClassExpression: [ + 'decorators', + 'id', + 'typeParameters', + 'superClass', + 'superTypeParameters', + 'implements', + 'body', + ], + FunctionDeclaration: ['id', 'typeParameters', 'params', 'returnType', 'body'], + FunctionExpression: ['id', 'typeParameters', 'params', 'returnType', 'body'], + Identifier: ['decorators', 'typeAnnotation'], + MethodDefinition: ['decorators', 'key', 'value'], + NewExpression: ['callee', 'typeParameters', 'arguments'], + ObjectPattern: ['decorators', 'properties', 'typeAnnotation'], + RestElement: ['decorators', 'argument', 'typeAnnotation'], + TaggedTemplateExpression: ['tag', 'typeParameters', 'quasi'], + // JSX + JSXOpeningElement: ['name', 'typeParameters', 'attributes'], + JSXClosingFragment: [], + JSXOpeningFragment: [], + JSXSpreadChild: ['expression'], + // Additional Nodes. + ClassProperty: ['decorators', 'key', 'typeAnnotation', 'value'], + Decorator: ['expression'], + // TS-prefixed nodes + TSAbstractClassProperty: ['decorators', 'key', 'typeAnnotation', 'value'], + TSAbstractKeyword: [], + TSAbstractMethodDefinition: ['key', 'value'], + TSAnyKeyword: [], + TSArrayType: ['elementType'], + TSAsExpression: ['expression', 'typeAnnotation'], + TSAsyncKeyword: [], + TSBigIntKeyword: [], + TSBooleanKeyword: [], + TSCallSignatureDeclaration: ['typeParameters', 'params', 'returnType'], + TSClassImplements: ['expression', 'typeParameters'], + TSConditionalType: ['checkType', 'extendsType', 'trueType', 'falseType'], + TSConstructorType: ['typeParameters', 'params', 'returnType'], + TSConstructSignatureDeclaration: ['typeParameters', 'params', 'returnType'], + TSDeclareFunction: ['id', 'typeParameters', 'params', 'returnType', 'body'], + TSDeclareKeyword: [], + TSEmptyBodyFunctionExpression: [ + 'id', + 'typeParameters', + 'params', + 'returnType', + ], + TSEnumDeclaration: ['id', 'members'], + TSEnumMember: ['id', 'initializer'], + TSExportAssignment: ['expression'], + TSExportKeyword: [], + TSExternalModuleReference: ['expression'], + TSFunctionType: ['typeParameters', 'params', 'returnType'], + TSImportEqualsDeclaration: ['id', 'moduleReference'], + TSImportType: ['parameter', 'qualifier', 'typeParameters'], + TSIndexedAccessType: ['indexType', 'objectType'], + TSIndexSignature: ['parameters', 'typeAnnotation'], + TSInferType: ['typeParameter'], + TSInterfaceBody: ['body'], + TSInterfaceDeclaration: ['id', 'typeParameters', 'extends', 'body'], + TSInterfaceHeritage: ['expression', 'typeParameters'], + TSIntersectionType: ['types'], + TSLiteralType: ['literal'], + TSMappedType: ['typeParameter', 'typeAnnotation'], + TSMethodSignature: ['typeParameters', 'key', 'params', 'returnType'], + TSModuleBlock: ['body'], + TSModuleDeclaration: ['id', 'body'], + TSNamedTupleMember: ['elementType'], + TSNamespaceExportDeclaration: ['id'], + TSNeverKeyword: [], + TSNonNullExpression: ['expression'], + TSNullKeyword: [], + TSNumberKeyword: [], + TSObjectKeyword: [], + TSOptionalType: ['typeAnnotation'], + TSParameterProperty: ['decorators', 'parameter'], + TSParenthesizedType: ['typeAnnotation'], + TSPrivateKeyword: [], + TSPropertySignature: ['typeAnnotation', 'key', 'initializer'], + TSProtectedKeyword: [], + TSPublicKeyword: [], + TSQualifiedName: ['left', 'right'], + TSReadonlyKeyword: [], + TSRestType: ['typeAnnotation'], + TSStaticKeyword: [], + TSStringKeyword: [], + TSSymbolKeyword: [], + TSThisType: [], + TSTupleType: ['elementTypes'], + TSTypeAliasDeclaration: ['id', 'typeParameters', 'typeAnnotation'], + TSTypeAnnotation: ['typeAnnotation'], + TSTypeAssertion: ['typeAnnotation', 'expression'], + TSTypeLiteral: ['members'], + TSTypeOperator: ['typeAnnotation'], + TSTypeParameter: ['name', 'constraint', 'default'], + TSTypeParameterDeclaration: ['params'], + TSTypeParameterInstantiation: ['params'], + TSTypePredicate: ['typeAnnotation', 'parameterName'], + TSTypeQuery: ['exprName'], + TSTypeReference: ['typeName', 'typeParameters'], + TSUndefinedKeyword: [], + TSUnionType: ['types'], + TSUnknownKeyword: [], + TSVoidKeyword: [], +}; +const visitorKeys = eslintVisitorKeys.unionWith(additionalKeys); +exports.visitorKeys = visitorKeys; +//# sourceMappingURL=visitor-keys.js.map \ No newline at end of file diff --git a/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.js.map b/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.js.map new file mode 100644 index 000000000..81d0fcfbe --- /dev/null +++ b/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.js.map @@ -0,0 +1 @@ +{"version":3,"file":"visitor-keys.js","sourceRoot":"","sources":["../src/visitor-keys.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,uEAAyD;AAgBzD,MAAM,cAAc,GAAmB;IACrC,SAAS;IACT,gBAAgB,EAAE,CAAC,QAAQ,CAAC;IAE5B,yBAAyB;IACzB,YAAY,EAAE,CAAC,YAAY,EAAE,UAAU,EAAE,gBAAgB,CAAC;IAC1D,uBAAuB,EAAE,CAAC,gBAAgB,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,CAAC;IAC3E,iBAAiB,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,CAAC;IACpE,cAAc,EAAE,CAAC,QAAQ,EAAE,gBAAgB,EAAE,WAAW,CAAC;IACzD,gBAAgB,EAAE;QAChB,YAAY;QACZ,IAAI;QACJ,gBAAgB;QAChB,YAAY;QACZ,qBAAqB;QACrB,YAAY;QACZ,MAAM;KACP;IACD,eAAe,EAAE;QACf,YAAY;QACZ,IAAI;QACJ,gBAAgB;QAChB,YAAY;QACZ,qBAAqB;QACrB,YAAY;QACZ,MAAM;KACP;IACD,mBAAmB,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,CAAC;IAC7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E,CAAC,QAAQ,CAAC;IACxC,eAAe,EAAE,CAAC,gBAAgB,EAAE,eAAe,CAAC;IACpD,WAAW,EAAE,CAAC,UAAU,CAAC;IACzB,eAAe,EAAE,CAAC,UAAU,EAAE,gBAAgB,CAAC;IAC/C,kBAAkB,EAAE,EAAE;IACtB,WAAW,EAAE,CAAC,OAAO,CAAC;IACtB,gBAAgB,EAAE,EAAE;IACpB,aAAa,EAAE,EAAE;CACT,CAAC;AAEX,MAAM,WAAW,GAAgB,iBAAiB,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;AAEpE,kCAAW"} \ No newline at end of file diff --git a/node_modules/@typescript-eslint/visitor-keys/package.json b/node_modules/@typescript-eslint/visitor-keys/package.json new file mode 100644 index 000000000..71c92882a --- /dev/null +++ b/node_modules/@typescript-eslint/visitor-keys/package.json @@ -0,0 +1,59 @@ +{ + "name": "@typescript-eslint/visitor-keys", + "version": "4.1.0", + "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", + "keywords": [ + "eslint", + "typescript", + "estree" + ], + "engines": { + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + }, + "files": [ + "dist", + "package.json", + "README.md", + "LICENSE" + ], + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/visitor-keys" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "license": "MIT", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsc -b tsconfig.build.json", + "postbuild": "downlevel-dts dist _ts3.4/dist", + "clean": "tsc -b tsconfig.build.json --clean", + "postclean": "rimraf dist", + "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", + "lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'", + "test": "jest --coverage", + "typecheck": "tsc -p tsconfig.json --noEmit" + }, + "dependencies": { + "@typescript-eslint/types": "4.1.0", + "eslint-visitor-keys": "^2.0.0" + }, + "devDependencies": { + "@types/eslint-visitor-keys": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "typesVersions": { + "<3.8": { + "*": [ + "_ts3.4/*" + ] + } + }, + "gitHead": "00a24706222254774121ee62038e67d0efa993e7" +} \ No newline at end of file diff --git a/node_modules/acorn-jsx/LICENSE b/node_modules/acorn-jsx/LICENSE new file mode 100644 index 000000000..695d4b930 --- /dev/null +++ b/node_modules/acorn-jsx/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2012-2017 by Ingvar Stepanyan + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/acorn-jsx/README.md b/node_modules/acorn-jsx/README.md new file mode 100644 index 000000000..317c3ac4a --- /dev/null +++ b/node_modules/acorn-jsx/README.md @@ -0,0 +1,40 @@ +# Acorn-JSX + +[![Build Status](https://travis-ci.org/acornjs/acorn-jsx.svg?branch=master)](https://travis-ci.org/acornjs/acorn-jsx) +[![NPM version](https://img.shields.io/npm/v/acorn-jsx.svg)](https://www.npmjs.org/package/acorn-jsx) + +This is plugin for [Acorn](http://marijnhaverbeke.nl/acorn/) - a tiny, fast JavaScript parser, written completely in JavaScript. + +It was created as an experimental alternative, faster [React.js JSX](http://facebook.github.io/react/docs/jsx-in-depth.html) parser. Later, it replaced the [official parser](https://github.com/facebookarchive/esprima) and these days is used by many prominent development tools. + +## Transpiler + +Please note that this tool only parses source code to JSX AST, which is useful for various language tools and services. If you want to transpile your code to regular ES5-compliant JavaScript with source map, check out [Babel](https://babeljs.io/) and [Buble](https://buble.surge.sh/) transpilers which use `acorn-jsx` under the hood. + +## Usage + +Requiring this module provides you with an Acorn plugin that you can use like this: + +```javascript +var acorn = require("acorn"); +var jsx = require("acorn-jsx"); +acorn.Parser.extend(jsx()).parse("my(, 'code');"); +``` + +Note that official spec doesn't support mix of XML namespaces and object-style access in tag names (#27) like in ``, so it was deprecated in `acorn-jsx@3.0`. If you still want to opt-in to support of such constructions, you can pass the following option: + +```javascript +acorn.Parser.extend(jsx({ allowNamespacedObjects: true })) +``` + +Also, since most apps use pure React transformer, a new option was introduced that allows to prohibit namespaces completely: + +```javascript +acorn.Parser.extend(jsx({ allowNamespaces: false })) +``` + +Note that by default `allowNamespaces` is enabled for spec compliancy. + +## License + +This plugin is issued under the [MIT license](./LICENSE). diff --git a/node_modules/acorn-jsx/index.js b/node_modules/acorn-jsx/index.js new file mode 100644 index 000000000..004e08090 --- /dev/null +++ b/node_modules/acorn-jsx/index.js @@ -0,0 +1,488 @@ +'use strict'; + +const XHTMLEntities = require('./xhtml'); + +const hexNumber = /^[\da-fA-F]+$/; +const decimalNumber = /^\d+$/; + +// The map to `acorn-jsx` tokens from `acorn` namespace objects. +const acornJsxMap = new WeakMap(); + +// Get the original tokens for the given `acorn` namespace object. +function getJsxTokens(acorn) { + acorn = acorn.Parser.acorn || acorn; + let acornJsx = acornJsxMap.get(acorn); + if (!acornJsx) { + const tt = acorn.tokTypes; + const TokContext = acorn.TokContext; + const TokenType = acorn.TokenType; + const tc_oTag = new TokContext('...', true, true); + const tokContexts = { + tc_oTag: tc_oTag, + tc_cTag: tc_cTag, + tc_expr: tc_expr + }; + const tokTypes = { + jsxName: new TokenType('jsxName'), + jsxText: new TokenType('jsxText', {beforeExpr: true}), + jsxTagStart: new TokenType('jsxTagStart', {startsExpr: true}), + jsxTagEnd: new TokenType('jsxTagEnd') + }; + + tokTypes.jsxTagStart.updateContext = function() { + this.context.push(tc_expr); // treat as beginning of JSX expression + this.context.push(tc_oTag); // start opening tag context + this.exprAllowed = false; + }; + tokTypes.jsxTagEnd.updateContext = function(prevType) { + let out = this.context.pop(); + if (out === tc_oTag && prevType === tt.slash || out === tc_cTag) { + this.context.pop(); + this.exprAllowed = this.curContext() === tc_expr; + } else { + this.exprAllowed = true; + } + }; + + acornJsx = { tokContexts: tokContexts, tokTypes: tokTypes }; + acornJsxMap.set(acorn, acornJsx); + } + + return acornJsx; +} + +// Transforms JSX element name to string. + +function getQualifiedJSXName(object) { + if (!object) + return object; + + if (object.type === 'JSXIdentifier') + return object.name; + + if (object.type === 'JSXNamespacedName') + return object.namespace.name + ':' + object.name.name; + + if (object.type === 'JSXMemberExpression') + return getQualifiedJSXName(object.object) + '.' + + getQualifiedJSXName(object.property); +} + +module.exports = function(options) { + options = options || {}; + return function(Parser) { + return plugin({ + allowNamespaces: options.allowNamespaces !== false, + allowNamespacedObjects: !!options.allowNamespacedObjects + }, Parser); + }; +}; + +// This is `tokTypes` of the peer dep. +// This can be different instances from the actual `tokTypes` this plugin uses. +Object.defineProperty(module.exports, "tokTypes", { + get: function get_tokTypes() { + return getJsxTokens(require("acorn")).tokTypes; + }, + configurable: true, + enumerable: true +}); + +function plugin(options, Parser) { + const acorn = Parser.acorn || require("acorn"); + const acornJsx = getJsxTokens(acorn); + const tt = acorn.tokTypes; + const tok = acornJsx.tokTypes; + const tokContexts = acorn.tokContexts; + const tc_oTag = acornJsx.tokContexts.tc_oTag; + const tc_cTag = acornJsx.tokContexts.tc_cTag; + const tc_expr = acornJsx.tokContexts.tc_expr; + const isNewLine = acorn.isNewLine; + const isIdentifierStart = acorn.isIdentifierStart; + const isIdentifierChar = acorn.isIdentifierChar; + + return class extends Parser { + // Expose actual `tokTypes` and `tokContexts` to other plugins. + static get acornJsx() { + return acornJsx; + } + + // Reads inline JSX contents token. + jsx_readToken() { + let out = '', chunkStart = this.pos; + for (;;) { + if (this.pos >= this.input.length) + this.raise(this.start, 'Unterminated JSX contents'); + let ch = this.input.charCodeAt(this.pos); + + switch (ch) { + case 60: // '<' + case 123: // '{' + if (this.pos === this.start) { + if (ch === 60 && this.exprAllowed) { + ++this.pos; + return this.finishToken(tok.jsxTagStart); + } + return this.getTokenFromCode(ch); + } + out += this.input.slice(chunkStart, this.pos); + return this.finishToken(tok.jsxText, out); + + case 38: // '&' + out += this.input.slice(chunkStart, this.pos); + out += this.jsx_readEntity(); + chunkStart = this.pos; + break; + + case 62: // '>' + case 125: // '}' + this.raise( + this.pos, + "Unexpected token `" + this.input[this.pos] + "`. Did you mean `" + + (ch === 62 ? ">" : "}") + "` or " + "`{\"" + this.input[this.pos] + "\"}" + "`?" + ); + + default: + if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.pos); + out += this.jsx_readNewLine(true); + chunkStart = this.pos; + } else { + ++this.pos; + } + } + } + } + + jsx_readNewLine(normalizeCRLF) { + let ch = this.input.charCodeAt(this.pos); + let out; + ++this.pos; + if (ch === 13 && this.input.charCodeAt(this.pos) === 10) { + ++this.pos; + out = normalizeCRLF ? '\n' : '\r\n'; + } else { + out = String.fromCharCode(ch); + } + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + + return out; + } + + jsx_readString(quote) { + let out = '', chunkStart = ++this.pos; + for (;;) { + if (this.pos >= this.input.length) + this.raise(this.start, 'Unterminated string constant'); + let ch = this.input.charCodeAt(this.pos); + if (ch === quote) break; + if (ch === 38) { // '&' + out += this.input.slice(chunkStart, this.pos); + out += this.jsx_readEntity(); + chunkStart = this.pos; + } else if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.pos); + out += this.jsx_readNewLine(false); + chunkStart = this.pos; + } else { + ++this.pos; + } + } + out += this.input.slice(chunkStart, this.pos++); + return this.finishToken(tt.string, out); + } + + jsx_readEntity() { + let str = '', count = 0, entity; + let ch = this.input[this.pos]; + if (ch !== '&') + this.raise(this.pos, 'Entity must start with an ampersand'); + let startPos = ++this.pos; + while (this.pos < this.input.length && count++ < 10) { + ch = this.input[this.pos++]; + if (ch === ';') { + if (str[0] === '#') { + if (str[1] === 'x') { + str = str.substr(2); + if (hexNumber.test(str)) + entity = String.fromCharCode(parseInt(str, 16)); + } else { + str = str.substr(1); + if (decimalNumber.test(str)) + entity = String.fromCharCode(parseInt(str, 10)); + } + } else { + entity = XHTMLEntities[str]; + } + break; + } + str += ch; + } + if (!entity) { + this.pos = startPos; + return '&'; + } + return entity; + } + + // Read a JSX identifier (valid tag or attribute name). + // + // Optimized version since JSX identifiers can't contain + // escape characters and so can be read as single slice. + // Also assumes that first character was already checked + // by isIdentifierStart in readToken. + + jsx_readWord() { + let ch, start = this.pos; + do { + ch = this.input.charCodeAt(++this.pos); + } while (isIdentifierChar(ch) || ch === 45); // '-' + return this.finishToken(tok.jsxName, this.input.slice(start, this.pos)); + } + + // Parse next token as JSX identifier + + jsx_parseIdentifier() { + let node = this.startNode(); + if (this.type === tok.jsxName) + node.name = this.value; + else if (this.type.keyword) + node.name = this.type.keyword; + else + this.unexpected(); + this.next(); + return this.finishNode(node, 'JSXIdentifier'); + } + + // Parse namespaced identifier. + + jsx_parseNamespacedName() { + let startPos = this.start, startLoc = this.startLoc; + let name = this.jsx_parseIdentifier(); + if (!options.allowNamespaces || !this.eat(tt.colon)) return name; + var node = this.startNodeAt(startPos, startLoc); + node.namespace = name; + node.name = this.jsx_parseIdentifier(); + return this.finishNode(node, 'JSXNamespacedName'); + } + + // Parses element name in any form - namespaced, member + // or single identifier. + + jsx_parseElementName() { + if (this.type === tok.jsxTagEnd) return ''; + let startPos = this.start, startLoc = this.startLoc; + let node = this.jsx_parseNamespacedName(); + if (this.type === tt.dot && node.type === 'JSXNamespacedName' && !options.allowNamespacedObjects) { + this.unexpected(); + } + while (this.eat(tt.dot)) { + let newNode = this.startNodeAt(startPos, startLoc); + newNode.object = node; + newNode.property = this.jsx_parseIdentifier(); + node = this.finishNode(newNode, 'JSXMemberExpression'); + } + return node; + } + + // Parses any type of JSX attribute value. + + jsx_parseAttributeValue() { + switch (this.type) { + case tt.braceL: + let node = this.jsx_parseExpressionContainer(); + if (node.expression.type === 'JSXEmptyExpression') + this.raise(node.start, 'JSX attributes must only be assigned a non-empty expression'); + return node; + + case tok.jsxTagStart: + case tt.string: + return this.parseExprAtom(); + + default: + this.raise(this.start, 'JSX value should be either an expression or a quoted JSX text'); + } + } + + // JSXEmptyExpression is unique type since it doesn't actually parse anything, + // and so it should start at the end of last read token (left brace) and finish + // at the beginning of the next one (right brace). + + jsx_parseEmptyExpression() { + let node = this.startNodeAt(this.lastTokEnd, this.lastTokEndLoc); + return this.finishNodeAt(node, 'JSXEmptyExpression', this.start, this.startLoc); + } + + // Parses JSX expression enclosed into curly brackets. + + jsx_parseExpressionContainer() { + let node = this.startNode(); + this.next(); + node.expression = this.type === tt.braceR + ? this.jsx_parseEmptyExpression() + : this.parseExpression(); + this.expect(tt.braceR); + return this.finishNode(node, 'JSXExpressionContainer'); + } + + // Parses following JSX attribute name-value pair. + + jsx_parseAttribute() { + let node = this.startNode(); + if (this.eat(tt.braceL)) { + this.expect(tt.ellipsis); + node.argument = this.parseMaybeAssign(); + this.expect(tt.braceR); + return this.finishNode(node, 'JSXSpreadAttribute'); + } + node.name = this.jsx_parseNamespacedName(); + node.value = this.eat(tt.eq) ? this.jsx_parseAttributeValue() : null; + return this.finishNode(node, 'JSXAttribute'); + } + + // Parses JSX opening tag starting after '<'. + + jsx_parseOpeningElementAt(startPos, startLoc) { + let node = this.startNodeAt(startPos, startLoc); + node.attributes = []; + let nodeName = this.jsx_parseElementName(); + if (nodeName) node.name = nodeName; + while (this.type !== tt.slash && this.type !== tok.jsxTagEnd) + node.attributes.push(this.jsx_parseAttribute()); + node.selfClosing = this.eat(tt.slash); + this.expect(tok.jsxTagEnd); + return this.finishNode(node, nodeName ? 'JSXOpeningElement' : 'JSXOpeningFragment'); + } + + // Parses JSX closing tag starting after ''); + } + } + let fragmentOrElement = openingElement.name ? 'Element' : 'Fragment'; + + node['opening' + fragmentOrElement] = openingElement; + node['closing' + fragmentOrElement] = closingElement; + node.children = children; + if (this.type === tt.relational && this.value === "<") { + this.raise(this.start, "Adjacent JSX elements must be wrapped in an enclosing tag"); + } + return this.finishNode(node, 'JSX' + fragmentOrElement); + } + + // Parse JSX text + + jsx_parseText() { + let node = this.parseLiteral(this.value); + node.type = "JSXText"; + return node; + } + + // Parses entire JSX element from current position. + + jsx_parseElement() { + let startPos = this.start, startLoc = this.startLoc; + this.next(); + return this.jsx_parseElementAt(startPos, startLoc); + } + + parseExprAtom(refShortHandDefaultPos) { + if (this.type === tok.jsxText) + return this.jsx_parseText(); + else if (this.type === tok.jsxTagStart) + return this.jsx_parseElement(); + else + return super.parseExprAtom(refShortHandDefaultPos); + } + + readToken(code) { + let context = this.curContext(); + + if (context === tc_expr) return this.jsx_readToken(); + + if (context === tc_oTag || context === tc_cTag) { + if (isIdentifierStart(code)) return this.jsx_readWord(); + + if (code == 62) { + ++this.pos; + return this.finishToken(tok.jsxTagEnd); + } + + if ((code === 34 || code === 39) && context == tc_oTag) + return this.jsx_readString(code); + } + + if (code === 60 && this.exprAllowed && this.input.charCodeAt(this.pos + 1) !== 33) { + ++this.pos; + return this.finishToken(tok.jsxTagStart); + } + return super.readToken(code); + } + + updateContext(prevType) { + if (this.type == tt.braceL) { + var curContext = this.curContext(); + if (curContext == tc_oTag) this.context.push(tokContexts.b_expr); + else if (curContext == tc_expr) this.context.push(tokContexts.b_tmpl); + else super.updateContext(prevType); + this.exprAllowed = true; + } else if (this.type === tt.slash && prevType === tok.jsxTagStart) { + this.context.length -= 2; // do not consider JSX expr -> JSX open tag -> ... anymore + this.context.push(tc_cTag); // reconsider as closing tag context + this.exprAllowed = false; + } else { + return super.updateContext(prevType); + } + } + }; +} diff --git a/node_modules/acorn-jsx/package.json b/node_modules/acorn-jsx/package.json new file mode 100644 index 000000000..3088f9add --- /dev/null +++ b/node_modules/acorn-jsx/package.json @@ -0,0 +1,27 @@ +{ + "name": "acorn-jsx", + "description": "Modern, fast React.js JSX parser", + "homepage": "https://github.com/acornjs/acorn-jsx", + "version": "5.3.1", + "maintainers": [ + { + "name": "Ingvar Stepanyan", + "email": "me@rreverser.com", + "web": "http://rreverser.com/" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/acornjs/acorn-jsx" + }, + "license": "MIT", + "scripts": { + "test": "node test/run.js" + }, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "devDependencies": { + "acorn": "^8.0.1" + } +} \ No newline at end of file diff --git a/node_modules/acorn-jsx/xhtml.js b/node_modules/acorn-jsx/xhtml.js new file mode 100644 index 000000000..c1520092f --- /dev/null +++ b/node_modules/acorn-jsx/xhtml.js @@ -0,0 +1,255 @@ +module.exports = { + quot: '\u0022', + amp: '&', + apos: '\u0027', + lt: '<', + gt: '>', + nbsp: '\u00A0', + iexcl: '\u00A1', + cent: '\u00A2', + pound: '\u00A3', + curren: '\u00A4', + yen: '\u00A5', + brvbar: '\u00A6', + sect: '\u00A7', + uml: '\u00A8', + copy: '\u00A9', + ordf: '\u00AA', + laquo: '\u00AB', + not: '\u00AC', + shy: '\u00AD', + reg: '\u00AE', + macr: '\u00AF', + deg: '\u00B0', + plusmn: '\u00B1', + sup2: '\u00B2', + sup3: '\u00B3', + acute: '\u00B4', + micro: '\u00B5', + para: '\u00B6', + middot: '\u00B7', + cedil: '\u00B8', + sup1: '\u00B9', + ordm: '\u00BA', + raquo: '\u00BB', + frac14: '\u00BC', + frac12: '\u00BD', + frac34: '\u00BE', + iquest: '\u00BF', + Agrave: '\u00C0', + Aacute: '\u00C1', + Acirc: '\u00C2', + Atilde: '\u00C3', + Auml: '\u00C4', + Aring: '\u00C5', + AElig: '\u00C6', + Ccedil: '\u00C7', + Egrave: '\u00C8', + Eacute: '\u00C9', + Ecirc: '\u00CA', + Euml: '\u00CB', + Igrave: '\u00CC', + Iacute: '\u00CD', + Icirc: '\u00CE', + Iuml: '\u00CF', + ETH: '\u00D0', + Ntilde: '\u00D1', + Ograve: '\u00D2', + Oacute: '\u00D3', + Ocirc: '\u00D4', + Otilde: '\u00D5', + Ouml: '\u00D6', + times: '\u00D7', + Oslash: '\u00D8', + Ugrave: '\u00D9', + Uacute: '\u00DA', + Ucirc: '\u00DB', + Uuml: '\u00DC', + Yacute: '\u00DD', + THORN: '\u00DE', + szlig: '\u00DF', + agrave: '\u00E0', + aacute: '\u00E1', + acirc: '\u00E2', + atilde: '\u00E3', + auml: '\u00E4', + aring: '\u00E5', + aelig: '\u00E6', + ccedil: '\u00E7', + egrave: '\u00E8', + eacute: '\u00E9', + ecirc: '\u00EA', + euml: '\u00EB', + igrave: '\u00EC', + iacute: '\u00ED', + icirc: '\u00EE', + iuml: '\u00EF', + eth: '\u00F0', + ntilde: '\u00F1', + ograve: '\u00F2', + oacute: '\u00F3', + ocirc: '\u00F4', + otilde: '\u00F5', + ouml: '\u00F6', + divide: '\u00F7', + oslash: '\u00F8', + ugrave: '\u00F9', + uacute: '\u00FA', + ucirc: '\u00FB', + uuml: '\u00FC', + yacute: '\u00FD', + thorn: '\u00FE', + yuml: '\u00FF', + OElig: '\u0152', + oelig: '\u0153', + Scaron: '\u0160', + scaron: '\u0161', + Yuml: '\u0178', + fnof: '\u0192', + circ: '\u02C6', + tilde: '\u02DC', + Alpha: '\u0391', + Beta: '\u0392', + Gamma: '\u0393', + Delta: '\u0394', + Epsilon: '\u0395', + Zeta: '\u0396', + Eta: '\u0397', + Theta: '\u0398', + Iota: '\u0399', + Kappa: '\u039A', + Lambda: '\u039B', + Mu: '\u039C', + Nu: '\u039D', + Xi: '\u039E', + Omicron: '\u039F', + Pi: '\u03A0', + Rho: '\u03A1', + Sigma: '\u03A3', + Tau: '\u03A4', + Upsilon: '\u03A5', + Phi: '\u03A6', + Chi: '\u03A7', + Psi: '\u03A8', + Omega: '\u03A9', + alpha: '\u03B1', + beta: '\u03B2', + gamma: '\u03B3', + delta: '\u03B4', + epsilon: '\u03B5', + zeta: '\u03B6', + eta: '\u03B7', + theta: '\u03B8', + iota: '\u03B9', + kappa: '\u03BA', + lambda: '\u03BB', + mu: '\u03BC', + nu: '\u03BD', + xi: '\u03BE', + omicron: '\u03BF', + pi: '\u03C0', + rho: '\u03C1', + sigmaf: '\u03C2', + sigma: '\u03C3', + tau: '\u03C4', + upsilon: '\u03C5', + phi: '\u03C6', + chi: '\u03C7', + psi: '\u03C8', + omega: '\u03C9', + thetasym: '\u03D1', + upsih: '\u03D2', + piv: '\u03D6', + ensp: '\u2002', + emsp: '\u2003', + thinsp: '\u2009', + zwnj: '\u200C', + zwj: '\u200D', + lrm: '\u200E', + rlm: '\u200F', + ndash: '\u2013', + mdash: '\u2014', + lsquo: '\u2018', + rsquo: '\u2019', + sbquo: '\u201A', + ldquo: '\u201C', + rdquo: '\u201D', + bdquo: '\u201E', + dagger: '\u2020', + Dagger: '\u2021', + bull: '\u2022', + hellip: '\u2026', + permil: '\u2030', + prime: '\u2032', + Prime: '\u2033', + lsaquo: '\u2039', + rsaquo: '\u203A', + oline: '\u203E', + frasl: '\u2044', + euro: '\u20AC', + image: '\u2111', + weierp: '\u2118', + real: '\u211C', + trade: '\u2122', + alefsym: '\u2135', + larr: '\u2190', + uarr: '\u2191', + rarr: '\u2192', + darr: '\u2193', + harr: '\u2194', + crarr: '\u21B5', + lArr: '\u21D0', + uArr: '\u21D1', + rArr: '\u21D2', + dArr: '\u21D3', + hArr: '\u21D4', + forall: '\u2200', + part: '\u2202', + exist: '\u2203', + empty: '\u2205', + nabla: '\u2207', + isin: '\u2208', + notin: '\u2209', + ni: '\u220B', + prod: '\u220F', + sum: '\u2211', + minus: '\u2212', + lowast: '\u2217', + radic: '\u221A', + prop: '\u221D', + infin: '\u221E', + ang: '\u2220', + and: '\u2227', + or: '\u2228', + cap: '\u2229', + cup: '\u222A', + 'int': '\u222B', + there4: '\u2234', + sim: '\u223C', + cong: '\u2245', + asymp: '\u2248', + ne: '\u2260', + equiv: '\u2261', + le: '\u2264', + ge: '\u2265', + sub: '\u2282', + sup: '\u2283', + nsub: '\u2284', + sube: '\u2286', + supe: '\u2287', + oplus: '\u2295', + otimes: '\u2297', + perp: '\u22A5', + sdot: '\u22C5', + lceil: '\u2308', + rceil: '\u2309', + lfloor: '\u230A', + rfloor: '\u230B', + lang: '\u2329', + rang: '\u232A', + loz: '\u25CA', + spades: '\u2660', + clubs: '\u2663', + hearts: '\u2665', + diams: '\u2666' +}; diff --git a/node_modules/ajv/.tonic_example.js b/node_modules/ajv/.tonic_example.js new file mode 100644 index 000000000..aa11812d8 --- /dev/null +++ b/node_modules/ajv/.tonic_example.js @@ -0,0 +1,20 @@ +var Ajv = require('ajv'); +var ajv = new Ajv({allErrors: true}); + +var schema = { + "properties": { + "foo": { "type": "string" }, + "bar": { "type": "number", "maximum": 3 } + } +}; + +var validate = ajv.compile(schema); + +test({"foo": "abc", "bar": 2}); +test({"foo": 2, "bar": 4}); + +function test(data) { + var valid = validate(data); + if (valid) console.log('Valid!'); + else console.log('Invalid: ' + ajv.errorsText(validate.errors)); +} \ No newline at end of file diff --git a/node_modules/ajv/LICENSE b/node_modules/ajv/LICENSE new file mode 100644 index 000000000..96ee71998 --- /dev/null +++ b/node_modules/ajv/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017 Evgeny Poberezkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/ajv/README.md b/node_modules/ajv/README.md new file mode 100644 index 000000000..3a88820d8 --- /dev/null +++ b/node_modules/ajv/README.md @@ -0,0 +1,1477 @@ +Ajv logo + +# Ajv: Another JSON Schema Validator + +The fastest JSON Schema validator for Node.js and browser. Supports draft-04/06/07. + +[![Build Status](https://travis-ci.org/ajv-validator/ajv.svg?branch=master)](https://travis-ci.org/ajv-validator/ajv) +[![npm](https://img.shields.io/npm/v/ajv.svg)](https://www.npmjs.com/package/ajv) +[![npm downloads](https://img.shields.io/npm/dm/ajv.svg)](https://www.npmjs.com/package/ajv) +[![Coverage Status](https://coveralls.io/repos/github/ajv-validator/ajv/badge.svg?branch=master)](https://coveralls.io/github/ajv-validator/ajv?branch=master) +[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv) +[![GitHub Sponsors](https://img.shields.io/badge/$-sponsors-brightgreen)](https://github.com/sponsors/epoberezkin) + + +## Mozilla MOSS grant and OpenJS Foundation + +[](https://www.mozilla.org/en-US/moss/)     [](https://openjsf.org/blog/2020/08/14/ajv-joins-openjs-foundation-as-an-incubation-project/) + +Ajv has been awarded a grant from Mozilla’s [Open Source Support (MOSS) program](https://www.mozilla.org/en-US/moss/) in the “Foundational Technology” track! It will sponsor the development of Ajv support of [JSON Schema version 2019-09](https://tools.ietf.org/html/draft-handrews-json-schema-02) and of [JSON Type Definition](https://tools.ietf.org/html/draft-ucarion-json-type-definition-04). + +Ajv also joined [OpenJS Foundation](https://openjsf.org/) – having this support will help ensure the longevity and stability of Ajv for all its users. + +This [blog post](https://www.poberezkin.com/posts/2020-08-14-ajv-json-validator-mozilla-open-source-grant-openjs-foundation.html) has more details. + +I am looking for the long term maintainers of Ajv – working with [ReadySet](https://www.thereadyset.co/), also sponsored by Mozilla, to establish clear guidelines for the role of a "maintainer" and the contribution standards, and to encourage a wider, more inclusive, contribution from the community. + + +## Please [sponsor Ajv development](https://github.com/sponsors/epoberezkin) + +Since I asked to support Ajv development 40 people and 6 organizations contributed via GitHub and OpenCollective - this support helped receiving the MOSS grant! + +Your continuing support is very important - the funds will be used to develop and maintain Ajv once the next major version is released. + +Please sponsor Ajv via: +- [GitHub sponsors page](https://github.com/sponsors/epoberezkin) (GitHub will match it) +- [Ajv Open Collective️](https://opencollective.com/ajv) + +Thank you. + + +#### Open Collective sponsors + + + + + + + + + + + + + + + +## Using version 6 + +[JSON Schema draft-07](http://json-schema.org/latest/json-schema-validation.html) is published. + +[Ajv version 6.0.0](https://github.com/ajv-validator/ajv/releases/tag/v6.0.0) that supports draft-07 is released. It may require either migrating your schemas or updating your code (to continue using draft-04 and v5 schemas, draft-06 schemas will be supported without changes). + +__Please note__: To use Ajv with draft-06 schemas you need to explicitly add the meta-schema to the validator instance: + +```javascript +ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-06.json')); +``` + +To use Ajv with draft-04 schemas in addition to explicitly adding meta-schema you also need to use option schemaId: + +```javascript +var ajv = new Ajv({schemaId: 'id'}); +// If you want to use both draft-04 and draft-06/07 schemas: +// var ajv = new Ajv({schemaId: 'auto'}); +ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json')); +``` + + +## Contents + +- [Performance](#performance) +- [Features](#features) +- [Getting started](#getting-started) +- [Frequently Asked Questions](https://github.com/ajv-validator/ajv/blob/master/FAQ.md) +- [Using in browser](#using-in-browser) + - [Ajv and Content Security Policies (CSP)](#ajv-and-content-security-policies-csp) +- [Command line interface](#command-line-interface) +- Validation + - [Keywords](#validation-keywords) + - [Annotation keywords](#annotation-keywords) + - [Formats](#formats) + - [Combining schemas with $ref](#ref) + - [$data reference](#data-reference) + - NEW: [$merge and $patch keywords](#merge-and-patch-keywords) + - [Defining custom keywords](#defining-custom-keywords) + - [Asynchronous schema compilation](#asynchronous-schema-compilation) + - [Asynchronous validation](#asynchronous-validation) +- [Security considerations](#security-considerations) + - [Security contact](#security-contact) + - [Untrusted schemas](#untrusted-schemas) + - [Circular references in objects](#circular-references-in-javascript-objects) + - [Trusted schemas](#security-risks-of-trusted-schemas) + - [ReDoS attack](#redos-attack) +- Modifying data during validation + - [Filtering data](#filtering-data) + - [Assigning defaults](#assigning-defaults) + - [Coercing data types](#coercing-data-types) +- API + - [Methods](#api) + - [Options](#options) + - [Validation errors](#validation-errors) +- [Plugins](#plugins) +- [Related packages](#related-packages) +- [Some packages using Ajv](#some-packages-using-ajv) +- [Tests, Contributing, Changes history](#tests) +- [Support, Code of conduct, License](#open-source-software-support) + + +## Performance + +Ajv generates code using [doT templates](https://github.com/olado/doT) to turn JSON Schemas into super-fast validation functions that are efficient for v8 optimization. + +Currently Ajv is the fastest and the most standard compliant validator according to these benchmarks: + +- [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark) - 50% faster than the second place +- [jsck benchmark](https://github.com/pandastrike/jsck#benchmarks) - 20-190% faster +- [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html) +- [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html) + + +Performance of different validators by [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark): + +[![performance](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=32,4,1&chs=600x416&chxl=-1:|djv|ajv|json-schema-validator-generator|jsen|is-my-json-valid|themis|z-schema|jsck|skeemas|json-schema-library|tv4&chd=t:100,98,72.1,66.8,50.1,15.1,6.1,3.8,1.2,0.7,0.2)](https://github.com/ebdrup/json-schema-benchmark/blob/master/README.md#performance) + + +## Features + +- Ajv implements full JSON Schema [draft-06/07](http://json-schema.org/) and draft-04 standards: + - all validation keywords (see [JSON Schema validation keywords](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md)) + - full support of remote refs (remote schemas have to be added with `addSchema` or compiled to be available) + - support of circular references between schemas + - correct string lengths for strings with unicode pairs (can be turned off) + - [formats](#formats) defined by JSON Schema draft-07 standard and custom formats (can be turned off) + - [validates schemas against meta-schema](#api-validateschema) +- supports [browsers](#using-in-browser) and Node.js 0.10-14.x +- [asynchronous loading](#asynchronous-schema-compilation) of referenced schemas during compilation +- "All errors" validation mode with [option allErrors](#options) +- [error messages with parameters](#validation-errors) describing error reasons to allow creating custom error messages +- i18n error messages support with [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) package +- [filtering data](#filtering-data) from additional properties +- [assigning defaults](#assigning-defaults) to missing properties and items +- [coercing data](#coercing-data-types) to the types specified in `type` keywords +- [custom keywords](#defining-custom-keywords) +- draft-06/07 keywords `const`, `contains`, `propertyNames` and `if/then/else` +- draft-06 boolean schemas (`true`/`false` as a schema to always pass/fail). +- keywords `switch`, `patternRequired`, `formatMaximum` / `formatMinimum` and `formatExclusiveMaximum` / `formatExclusiveMinimum` from [JSON Schema extension proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals) with [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package +- [$data reference](#data-reference) to use values from the validated data as values for the schema keywords +- [asynchronous validation](#asynchronous-validation) of custom formats and keywords + + +## Install + +``` +npm install ajv +``` + + +## Getting started + +Try it in the Node.js REPL: https://tonicdev.com/npm/ajv + + +The fastest validation call: + +```javascript +// Node.js require: +var Ajv = require('ajv'); +// or ESM/TypeScript import +import Ajv from 'ajv'; + +var ajv = new Ajv(); // options can be passed, e.g. {allErrors: true} +var validate = ajv.compile(schema); +var valid = validate(data); +if (!valid) console.log(validate.errors); +``` + +or with less code + +```javascript +// ... +var valid = ajv.validate(schema, data); +if (!valid) console.log(ajv.errors); +// ... +``` + +or + +```javascript +// ... +var valid = ajv.addSchema(schema, 'mySchema') + .validate('mySchema', data); +if (!valid) console.log(ajv.errorsText()); +// ... +``` + +See [API](#api) and [Options](#options) for more details. + +Ajv compiles schemas to functions and caches them in all cases (using schema serialized with [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) or a custom function as a key), so that the next time the same schema is used (not necessarily the same object instance) it won't be compiled again. + +The best performance is achieved when using compiled functions returned by `compile` or `getSchema` methods (there is no additional function call). + +__Please note__: every time a validation function or `ajv.validate` are called `errors` property is overwritten. You need to copy `errors` array reference to another variable if you want to use it later (e.g., in the callback). See [Validation errors](#validation-errors) + +__Note for TypeScript users__: `ajv` provides its own TypeScript declarations +out of the box, so you don't need to install the deprecated `@types/ajv` +module. + + +## Using in browser + +You can require Ajv directly from the code you browserify - in this case Ajv will be a part of your bundle. + +If you need to use Ajv in several bundles you can create a separate UMD bundle using `npm run bundle` script (thanks to [siddo420](https://github.com/siddo420)). + +Then you need to load Ajv in the browser: +```html + +``` + +This bundle can be used with different module systems; it creates global `Ajv` if no module system is found. + +The browser bundle is available on [cdnjs](https://cdnjs.com/libraries/ajv). + +Ajv is tested with these browsers: + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/epoberezkin.svg)](https://saucelabs.com/u/epoberezkin) + +__Please note__: some frameworks, e.g. Dojo, may redefine global require in such way that is not compatible with CommonJS module format. In such case Ajv bundle has to be loaded before the framework and then you can use global Ajv (see issue [#234](https://github.com/ajv-validator/ajv/issues/234)). + + +### Ajv and Content Security Policies (CSP) + +If you're using Ajv to compile a schema (the typical use) in a browser document that is loaded with a Content Security Policy (CSP), that policy will require a `script-src` directive that includes the value `'unsafe-eval'`. +:warning: NOTE, however, that `unsafe-eval` is NOT recommended in a secure CSP[[1]](https://developer.chrome.com/extensions/contentSecurityPolicy#relaxing-eval), as it has the potential to open the document to cross-site scripting (XSS) attacks. + +In order to make use of Ajv without easing your CSP, you can [pre-compile a schema using the CLI](https://github.com/ajv-validator/ajv-cli#compile-schemas). This will transpile the schema JSON into a JavaScript file that exports a `validate` function that works simlarly to a schema compiled at runtime. + +Note that pre-compilation of schemas is performed using [ajv-pack](https://github.com/ajv-validator/ajv-pack) and there are [some limitations to the schema features it can compile](https://github.com/ajv-validator/ajv-pack#limitations). A successfully pre-compiled schema is equivalent to the same schema compiled at runtime. + + +## Command line interface + +CLI is available as a separate npm package [ajv-cli](https://github.com/ajv-validator/ajv-cli). It supports: + +- compiling JSON Schemas to test their validity +- BETA: generating standalone module exporting a validation function to be used without Ajv (using [ajv-pack](https://github.com/ajv-validator/ajv-pack)) +- migrate schemas to draft-07 (using [json-schema-migrate](https://github.com/epoberezkin/json-schema-migrate)) +- validating data file(s) against JSON Schema +- testing expected validity of data against JSON Schema +- referenced schemas +- custom meta-schemas +- files in JSON, JSON5, YAML, and JavaScript format +- all Ajv options +- reporting changes in data after validation in [JSON-patch](https://tools.ietf.org/html/rfc6902) format + + +## Validation keywords + +Ajv supports all validation keywords from draft-07 of JSON Schema standard: + +- [type](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#type) +- [for numbers](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-numbers) - maximum, minimum, exclusiveMaximum, exclusiveMinimum, multipleOf +- [for strings](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-strings) - maxLength, minLength, pattern, format +- [for arrays](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-arrays) - maxItems, minItems, uniqueItems, items, additionalItems, [contains](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#contains) +- [for objects](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-objects) - maxProperties, minProperties, required, properties, patternProperties, additionalProperties, dependencies, [propertyNames](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#propertynames) +- [for all types](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-all-types) - enum, [const](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#const) +- [compound keywords](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#compound-keywords) - not, oneOf, anyOf, allOf, [if/then/else](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#ifthenelse) + +With [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package Ajv also supports validation keywords from [JSON Schema extension proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals) for JSON Schema standard: + +- [patternRequired](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#patternrequired-proposed) - like `required` but with patterns that some property should match. +- [formatMaximum, formatMinimum, formatExclusiveMaximum, formatExclusiveMinimum](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#formatmaximum--formatminimum-and-exclusiveformatmaximum--exclusiveformatminimum-proposed) - setting limits for date, time, etc. + +See [JSON Schema validation keywords](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md) for more details. + + +## Annotation keywords + +JSON Schema specification defines several annotation keywords that describe schema itself but do not perform any validation. + +- `title` and `description`: information about the data represented by that schema +- `$comment` (NEW in draft-07): information for developers. With option `$comment` Ajv logs or passes the comment string to the user-supplied function. See [Options](#options). +- `default`: a default value of the data instance, see [Assigning defaults](#assigning-defaults). +- `examples` (NEW in draft-06): an array of data instances. Ajv does not check the validity of these instances against the schema. +- `readOnly` and `writeOnly` (NEW in draft-07): marks data-instance as read-only or write-only in relation to the source of the data (database, api, etc.). +- `contentEncoding`: [RFC 2045](https://tools.ietf.org/html/rfc2045#section-6.1 ), e.g., "base64". +- `contentMediaType`: [RFC 2046](https://tools.ietf.org/html/rfc2046), e.g., "image/png". + +__Please note__: Ajv does not implement validation of the keywords `examples`, `contentEncoding` and `contentMediaType` but it reserves them. If you want to create a plugin that implements some of them, it should remove these keywords from the instance. + + +## Formats + +Ajv implements formats defined by JSON Schema specification and several other formats. It is recommended NOT to use "format" keyword implementations with untrusted data, as they use potentially unsafe regular expressions - see [ReDoS attack](#redos-attack). + +__Please note__: if you need to use "format" keyword to validate untrusted data, you MUST assess their suitability and safety for your validation scenarios. + +The following formats are implemented for string validation with "format" keyword: + +- _date_: full-date according to [RFC3339](http://tools.ietf.org/html/rfc3339#section-5.6). +- _time_: time with optional time-zone. +- _date-time_: date-time from the same source (time-zone is mandatory). `date`, `time` and `date-time` validate ranges in `full` mode and only regexp in `fast` mode (see [options](#options)). +- _uri_: full URI. +- _uri-reference_: URI reference, including full and relative URIs. +- _uri-template_: URI template according to [RFC6570](https://tools.ietf.org/html/rfc6570) +- _url_ (deprecated): [URL record](https://url.spec.whatwg.org/#concept-url). +- _email_: email address. +- _hostname_: host name according to [RFC1034](http://tools.ietf.org/html/rfc1034#section-3.5). +- _ipv4_: IP address v4. +- _ipv6_: IP address v6. +- _regex_: tests whether a string is a valid regular expression by passing it to RegExp constructor. +- _uuid_: Universally Unique IDentifier according to [RFC4122](http://tools.ietf.org/html/rfc4122). +- _json-pointer_: JSON-pointer according to [RFC6901](https://tools.ietf.org/html/rfc6901). +- _relative-json-pointer_: relative JSON-pointer according to [this draft](http://tools.ietf.org/html/draft-luff-relative-json-pointer-00). + +__Please note__: JSON Schema draft-07 also defines formats `iri`, `iri-reference`, `idn-hostname` and `idn-email` for URLs, hostnames and emails with international characters. Ajv does not implement these formats. If you create Ajv plugin that implements them please make a PR to mention this plugin here. + +There are two modes of format validation: `fast` and `full`. This mode affects formats `date`, `time`, `date-time`, `uri`, `uri-reference`, and `email`. See [Options](#options) for details. + +You can add additional formats and replace any of the formats above using [addFormat](#api-addformat) method. + +The option `unknownFormats` allows changing the default behaviour when an unknown format is encountered. In this case Ajv can either fail schema compilation (default) or ignore it (default in versions before 5.0.0). You also can allow specific format(s) that will be ignored. See [Options](#options) for details. + +You can find regular expressions used for format validation and the sources that were used in [formats.js](https://github.com/ajv-validator/ajv/blob/master/lib/compile/formats.js). + + +## Combining schemas with $ref + +You can structure your validation logic across multiple schema files and have schemas reference each other using `$ref` keyword. + +Example: + +```javascript +var schema = { + "$id": "http://example.com/schemas/schema.json", + "type": "object", + "properties": { + "foo": { "$ref": "defs.json#/definitions/int" }, + "bar": { "$ref": "defs.json#/definitions/str" } + } +}; + +var defsSchema = { + "$id": "http://example.com/schemas/defs.json", + "definitions": { + "int": { "type": "integer" }, + "str": { "type": "string" } + } +}; +``` + +Now to compile your schema you can either pass all schemas to Ajv instance: + +```javascript +var ajv = new Ajv({schemas: [schema, defsSchema]}); +var validate = ajv.getSchema('http://example.com/schemas/schema.json'); +``` + +or use `addSchema` method: + +```javascript +var ajv = new Ajv; +var validate = ajv.addSchema(defsSchema) + .compile(schema); +``` + +See [Options](#options) and [addSchema](#api) method. + +__Please note__: +- `$ref` is resolved as the uri-reference using schema $id as the base URI (see the example). +- References can be recursive (and mutually recursive) to implement the schemas for different data structures (such as linked lists, trees, graphs, etc.). +- You don't have to host your schema files at the URIs that you use as schema $id. These URIs are only used to identify the schemas, and according to JSON Schema specification validators should not expect to be able to download the schemas from these URIs. +- The actual location of the schema file in the file system is not used. +- You can pass the identifier of the schema as the second parameter of `addSchema` method or as a property name in `schemas` option. This identifier can be used instead of (or in addition to) schema $id. +- You cannot have the same $id (or the schema identifier) used for more than one schema - the exception will be thrown. +- You can implement dynamic resolution of the referenced schemas using `compileAsync` method. In this way you can store schemas in any system (files, web, database, etc.) and reference them without explicitly adding to Ajv instance. See [Asynchronous schema compilation](#asynchronous-schema-compilation). + + +## $data reference + +With `$data` option you can use values from the validated data as the values for the schema keywords. See [proposal](https://github.com/json-schema-org/json-schema-spec/issues/51) for more information about how it works. + +`$data` reference is supported in the keywords: const, enum, format, maximum/minimum, exclusiveMaximum / exclusiveMinimum, maxLength / minLength, maxItems / minItems, maxProperties / minProperties, formatMaximum / formatMinimum, formatExclusiveMaximum / formatExclusiveMinimum, multipleOf, pattern, required, uniqueItems. + +The value of "$data" should be a [JSON-pointer](https://tools.ietf.org/html/rfc6901) to the data (the root is always the top level data object, even if the $data reference is inside a referenced subschema) or a [relative JSON-pointer](http://tools.ietf.org/html/draft-luff-relative-json-pointer-00) (it is relative to the current point in data; if the $data reference is inside a referenced subschema it cannot point to the data outside of the root level for this subschema). + +Examples. + +This schema requires that the value in property `smaller` is less or equal than the value in the property larger: + +```javascript +var ajv = new Ajv({$data: true}); + +var schema = { + "properties": { + "smaller": { + "type": "number", + "maximum": { "$data": "1/larger" } + }, + "larger": { "type": "number" } + } +}; + +var validData = { + smaller: 5, + larger: 7 +}; + +ajv.validate(schema, validData); // true +``` + +This schema requires that the properties have the same format as their field names: + +```javascript +var schema = { + "additionalProperties": { + "type": "string", + "format": { "$data": "0#" } + } +}; + +var validData = { + 'date-time': '1963-06-19T08:30:06.283185Z', + email: 'joe.bloggs@example.com' +} +``` + +`$data` reference is resolved safely - it won't throw even if some property is undefined. If `$data` resolves to `undefined` the validation succeeds (with the exclusion of `const` keyword). If `$data` resolves to incorrect type (e.g. not "number" for maximum keyword) the validation fails. + + +## $merge and $patch keywords + +With the package [ajv-merge-patch](https://github.com/ajv-validator/ajv-merge-patch) you can use the keywords `$merge` and `$patch` that allow extending JSON Schemas with patches using formats [JSON Merge Patch (RFC 7396)](https://tools.ietf.org/html/rfc7396) and [JSON Patch (RFC 6902)](https://tools.ietf.org/html/rfc6902). + +To add keywords `$merge` and `$patch` to Ajv instance use this code: + +```javascript +require('ajv-merge-patch')(ajv); +``` + +Examples. + +Using `$merge`: + +```json +{ + "$merge": { + "source": { + "type": "object", + "properties": { "p": { "type": "string" } }, + "additionalProperties": false + }, + "with": { + "properties": { "q": { "type": "number" } } + } + } +} +``` + +Using `$patch`: + +```json +{ + "$patch": { + "source": { + "type": "object", + "properties": { "p": { "type": "string" } }, + "additionalProperties": false + }, + "with": [ + { "op": "add", "path": "/properties/q", "value": { "type": "number" } } + ] + } +} +``` + +The schemas above are equivalent to this schema: + +```json +{ + "type": "object", + "properties": { + "p": { "type": "string" }, + "q": { "type": "number" } + }, + "additionalProperties": false +} +``` + +The properties `source` and `with` in the keywords `$merge` and `$patch` can use absolute or relative `$ref` to point to other schemas previously added to the Ajv instance or to the fragments of the current schema. + +See the package [ajv-merge-patch](https://github.com/ajv-validator/ajv-merge-patch) for more information. + + +## Defining custom keywords + +The advantages of using custom keywords are: + +- allow creating validation scenarios that cannot be expressed using JSON Schema +- simplify your schemas +- help bringing a bigger part of the validation logic to your schemas +- make your schemas more expressive, less verbose and closer to your application domain +- implement custom data processors that modify your data (`modifying` option MUST be used in keyword definition) and/or create side effects while the data is being validated + +If a keyword is used only for side-effects and its validation result is pre-defined, use option `valid: true/false` in keyword definition to simplify both generated code (no error handling in case of `valid: true`) and your keyword functions (no need to return any validation result). + +The concerns you have to be aware of when extending JSON Schema standard with custom keywords are the portability and understanding of your schemas. You will have to support these custom keywords on other platforms and to properly document these keywords so that everybody can understand them in your schemas. + +You can define custom keywords with [addKeyword](#api-addkeyword) method. Keywords are defined on the `ajv` instance level - new instances will not have previously defined keywords. + +Ajv allows defining keywords with: +- validation function +- compilation function +- macro function +- inline compilation function that should return code (as string) that will be inlined in the currently compiled schema. + +Example. `range` and `exclusiveRange` keywords using compiled schema: + +```javascript +ajv.addKeyword('range', { + type: 'number', + compile: function (sch, parentSchema) { + var min = sch[0]; + var max = sch[1]; + + return parentSchema.exclusiveRange === true + ? function (data) { return data > min && data < max; } + : function (data) { return data >= min && data <= max; } + } +}); + +var schema = { "range": [2, 4], "exclusiveRange": true }; +var validate = ajv.compile(schema); +console.log(validate(2.01)); // true +console.log(validate(3.99)); // true +console.log(validate(2)); // false +console.log(validate(4)); // false +``` + +Several custom keywords (typeof, instanceof, range and propertyNames) are defined in [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package - they can be used for your schemas and as a starting point for your own custom keywords. + +See [Defining custom keywords](https://github.com/ajv-validator/ajv/blob/master/CUSTOM.md) for more details. + + +## Asynchronous schema compilation + +During asynchronous compilation remote references are loaded using supplied function. See `compileAsync` [method](#api-compileAsync) and `loadSchema` [option](#options). + +Example: + +```javascript +var ajv = new Ajv({ loadSchema: loadSchema }); + +ajv.compileAsync(schema).then(function (validate) { + var valid = validate(data); + // ... +}); + +function loadSchema(uri) { + return request.json(uri).then(function (res) { + if (res.statusCode >= 400) + throw new Error('Loading error: ' + res.statusCode); + return res.body; + }); +} +``` + +__Please note__: [Option](#options) `missingRefs` should NOT be set to `"ignore"` or `"fail"` for asynchronous compilation to work. + + +## Asynchronous validation + +Example in Node.js REPL: https://tonicdev.com/esp/ajv-asynchronous-validation + +You can define custom formats and keywords that perform validation asynchronously by accessing database or some other service. You should add `async: true` in the keyword or format definition (see [addFormat](#api-addformat), [addKeyword](#api-addkeyword) and [Defining custom keywords](#defining-custom-keywords)). + +If your schema uses asynchronous formats/keywords or refers to some schema that contains them it should have `"$async": true` keyword so that Ajv can compile it correctly. If asynchronous format/keyword or reference to asynchronous schema is used in the schema without `$async` keyword Ajv will throw an exception during schema compilation. + +__Please note__: all asynchronous subschemas that are referenced from the current or other schemas should have `"$async": true` keyword as well, otherwise the schema compilation will fail. + +Validation function for an asynchronous custom format/keyword should return a promise that resolves with `true` or `false` (or rejects with `new Ajv.ValidationError(errors)` if you want to return custom errors from the keyword function). + +Ajv compiles asynchronous schemas to [es7 async functions](http://tc39.github.io/ecmascript-asyncawait/) that can optionally be transpiled with [nodent](https://github.com/MatAtBread/nodent). Async functions are supported in Node.js 7+ and all modern browsers. You can also supply any other transpiler as a function via `processCode` option. See [Options](#options). + +The compiled validation function has `$async: true` property (if the schema is asynchronous), so you can differentiate these functions if you are using both synchronous and asynchronous schemas. + +Validation result will be a promise that resolves with validated data or rejects with an exception `Ajv.ValidationError` that contains the array of validation errors in `errors` property. + + +Example: + +```javascript +var ajv = new Ajv; +// require('ajv-async')(ajv); + +ajv.addKeyword('idExists', { + async: true, + type: 'number', + validate: checkIdExists +}); + + +function checkIdExists(schema, data) { + return knex(schema.table) + .select('id') + .where('id', data) + .then(function (rows) { + return !!rows.length; // true if record is found + }); +} + +var schema = { + "$async": true, + "properties": { + "userId": { + "type": "integer", + "idExists": { "table": "users" } + }, + "postId": { + "type": "integer", + "idExists": { "table": "posts" } + } + } +}; + +var validate = ajv.compile(schema); + +validate({ userId: 1, postId: 19 }) +.then(function (data) { + console.log('Data is valid', data); // { userId: 1, postId: 19 } +}) +.catch(function (err) { + if (!(err instanceof Ajv.ValidationError)) throw err; + // data is invalid + console.log('Validation errors:', err.errors); +}); +``` + +### Using transpilers with asynchronous validation functions. + +[ajv-async](https://github.com/ajv-validator/ajv-async) uses [nodent](https://github.com/MatAtBread/nodent) to transpile async functions. To use another transpiler you should separately install it (or load its bundle in the browser). + + +#### Using nodent + +```javascript +var ajv = new Ajv; +require('ajv-async')(ajv); +// in the browser if you want to load ajv-async bundle separately you can: +// window.ajvAsync(ajv); +var validate = ajv.compile(schema); // transpiled es7 async function +validate(data).then(successFunc).catch(errorFunc); +``` + + +#### Using other transpilers + +```javascript +var ajv = new Ajv({ processCode: transpileFunc }); +var validate = ajv.compile(schema); // transpiled es7 async function +validate(data).then(successFunc).catch(errorFunc); +``` + +See [Options](#options). + + +## Security considerations + +JSON Schema, if properly used, can replace data sanitisation. It doesn't replace other API security considerations. It also introduces additional security aspects to consider. + + +##### Security contact + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerabilities via GitHub issues. + + +##### Untrusted schemas + +Ajv treats JSON schemas as trusted as your application code. This security model is based on the most common use case, when the schemas are static and bundled together with the application. + +If your schemas are received from untrusted sources (or generated from untrusted data) there are several scenarios you need to prevent: +- compiling schemas can cause stack overflow (if they are too deep) +- compiling schemas can be slow (e.g. [#557](https://github.com/ajv-validator/ajv/issues/557)) +- validating certain data can be slow + +It is difficult to predict all the scenarios, but at the very least it may help to limit the size of untrusted schemas (e.g. limit JSON string length) and also the maximum schema object depth (that can be high for relatively small JSON strings). You also may want to mitigate slow regular expressions in `pattern` and `patternProperties` keywords. + +Regardless the measures you take, using untrusted schemas increases security risks. + + +##### Circular references in JavaScript objects + +Ajv does not support schemas and validated data that have circular references in objects. See [issue #802](https://github.com/ajv-validator/ajv/issues/802). + +An attempt to compile such schemas or validate such data would cause stack overflow (or will not complete in case of asynchronous validation). Depending on the parser you use, untrusted data can lead to circular references. + + +##### Security risks of trusted schemas + +Some keywords in JSON Schemas can lead to very slow validation for certain data. These keywords include (but may be not limited to): + +- `pattern` and `format` for large strings - in some cases using `maxLength` can help mitigate it, but certain regular expressions can lead to exponential validation time even with relatively short strings (see [ReDoS attack](#redos-attack)). +- `patternProperties` for large property names - use `propertyNames` to mitigate, but some regular expressions can have exponential evaluation time as well. +- `uniqueItems` for large non-scalar arrays - use `maxItems` to mitigate + +__Please note__: The suggestions above to prevent slow validation would only work if you do NOT use `allErrors: true` in production code (using it would continue validation after validation errors). + +You can validate your JSON schemas against [this meta-schema](https://github.com/ajv-validator/ajv/blob/master/lib/refs/json-schema-secure.json) to check that these recommendations are followed: + +```javascript +const isSchemaSecure = ajv.compile(require('ajv/lib/refs/json-schema-secure.json')); + +const schema1 = {format: 'email'}; +isSchemaSecure(schema1); // false + +const schema2 = {format: 'email', maxLength: MAX_LENGTH}; +isSchemaSecure(schema2); // true +``` + +__Please note__: following all these recommendation is not a guarantee that validation of untrusted data is safe - it can still lead to some undesirable results. + + +##### Content Security Policies (CSP) +See [Ajv and Content Security Policies (CSP)](#ajv-and-content-security-policies-csp) + + +## ReDoS attack + +Certain regular expressions can lead to the exponential evaluation time even with relatively short strings. + +Please assess the regular expressions you use in the schemas on their vulnerability to this attack - see [safe-regex](https://github.com/substack/safe-regex), for example. + +__Please note__: some formats that Ajv implements use [regular expressions](https://github.com/ajv-validator/ajv/blob/master/lib/compile/formats.js) that can be vulnerable to ReDoS attack, so if you use Ajv to validate data from untrusted sources __it is strongly recommended__ to consider the following: + +- making assessment of "format" implementations in Ajv. +- using `format: 'fast'` option that simplifies some of the regular expressions (although it does not guarantee that they are safe). +- replacing format implementations provided by Ajv with your own implementations of "format" keyword that either uses different regular expressions or another approach to format validation. Please see [addFormat](#api-addformat) method. +- disabling format validation by ignoring "format" keyword with option `format: false` + +Whatever mitigation you choose, please assume all formats provided by Ajv as potentially unsafe and make your own assessment of their suitability for your validation scenarios. + + +## Filtering data + +With [option `removeAdditional`](#options) (added by [andyscott](https://github.com/andyscott)) you can filter data during the validation. + +This option modifies original data. + +Example: + +```javascript +var ajv = new Ajv({ removeAdditional: true }); +var schema = { + "additionalProperties": false, + "properties": { + "foo": { "type": "number" }, + "bar": { + "additionalProperties": { "type": "number" }, + "properties": { + "baz": { "type": "string" } + } + } + } +} + +var data = { + "foo": 0, + "additional1": 1, // will be removed; `additionalProperties` == false + "bar": { + "baz": "abc", + "additional2": 2 // will NOT be removed; `additionalProperties` != false + }, +} + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // { "foo": 0, "bar": { "baz": "abc", "additional2": 2 } +``` + +If `removeAdditional` option in the example above were `"all"` then both `additional1` and `additional2` properties would have been removed. + +If the option were `"failing"` then property `additional1` would have been removed regardless of its value and property `additional2` would have been removed only if its value were failing the schema in the inner `additionalProperties` (so in the example above it would have stayed because it passes the schema, but any non-number would have been removed). + +__Please note__: If you use `removeAdditional` option with `additionalProperties` keyword inside `anyOf`/`oneOf` keywords your validation can fail with this schema, for example: + +```json +{ + "type": "object", + "oneOf": [ + { + "properties": { + "foo": { "type": "string" } + }, + "required": [ "foo" ], + "additionalProperties": false + }, + { + "properties": { + "bar": { "type": "integer" } + }, + "required": [ "bar" ], + "additionalProperties": false + } + ] +} +``` + +The intention of the schema above is to allow objects with either the string property "foo" or the integer property "bar", but not with both and not with any other properties. + +With the option `removeAdditional: true` the validation will pass for the object `{ "foo": "abc"}` but will fail for the object `{"bar": 1}`. It happens because while the first subschema in `oneOf` is validated, the property `bar` is removed because it is an additional property according to the standard (because it is not included in `properties` keyword in the same schema). + +While this behaviour is unexpected (issues [#129](https://github.com/ajv-validator/ajv/issues/129), [#134](https://github.com/ajv-validator/ajv/issues/134)), it is correct. To have the expected behaviour (both objects are allowed and additional properties are removed) the schema has to be refactored in this way: + +```json +{ + "type": "object", + "properties": { + "foo": { "type": "string" }, + "bar": { "type": "integer" } + }, + "additionalProperties": false, + "oneOf": [ + { "required": [ "foo" ] }, + { "required": [ "bar" ] } + ] +} +``` + +The schema above is also more efficient - it will compile into a faster function. + + +## Assigning defaults + +With [option `useDefaults`](#options) Ajv will assign values from `default` keyword in the schemas of `properties` and `items` (when it is the array of schemas) to the missing properties and items. + +With the option value `"empty"` properties and items equal to `null` or `""` (empty string) will be considered missing and assigned defaults. + +This option modifies original data. + +__Please note__: the default value is inserted in the generated validation code as a literal, so the value inserted in the data will be the deep clone of the default in the schema. + + +Example 1 (`default` in `properties`): + +```javascript +var ajv = new Ajv({ useDefaults: true }); +var schema = { + "type": "object", + "properties": { + "foo": { "type": "number" }, + "bar": { "type": "string", "default": "baz" } + }, + "required": [ "foo", "bar" ] +}; + +var data = { "foo": 1 }; + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // { "foo": 1, "bar": "baz" } +``` + +Example 2 (`default` in `items`): + +```javascript +var schema = { + "type": "array", + "items": [ + { "type": "number" }, + { "type": "string", "default": "foo" } + ] +} + +var data = [ 1 ]; + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // [ 1, "foo" ] +``` + +`default` keywords in other cases are ignored: + +- not in `properties` or `items` subschemas +- in schemas inside `anyOf`, `oneOf` and `not` (see [#42](https://github.com/ajv-validator/ajv/issues/42)) +- in `if` subschema of `switch` keyword +- in schemas generated by custom macro keywords + +The [`strictDefaults` option](#options) customizes Ajv's behavior for the defaults that Ajv ignores (`true` raises an error, and `"log"` outputs a warning). + + +## Coercing data types + +When you are validating user inputs all your data properties are usually strings. The option `coerceTypes` allows you to have your data types coerced to the types specified in your schema `type` keywords, both to pass the validation and to use the correctly typed data afterwards. + +This option modifies original data. + +__Please note__: if you pass a scalar value to the validating function its type will be coerced and it will pass the validation, but the value of the variable you pass won't be updated because scalars are passed by value. + + +Example 1: + +```javascript +var ajv = new Ajv({ coerceTypes: true }); +var schema = { + "type": "object", + "properties": { + "foo": { "type": "number" }, + "bar": { "type": "boolean" } + }, + "required": [ "foo", "bar" ] +}; + +var data = { "foo": "1", "bar": "false" }; + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // { "foo": 1, "bar": false } +``` + +Example 2 (array coercions): + +```javascript +var ajv = new Ajv({ coerceTypes: 'array' }); +var schema = { + "properties": { + "foo": { "type": "array", "items": { "type": "number" } }, + "bar": { "type": "boolean" } + } +}; + +var data = { "foo": "1", "bar": ["false"] }; + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // { "foo": [1], "bar": false } +``` + +The coercion rules, as you can see from the example, are different from JavaScript both to validate user input as expected and to have the coercion reversible (to correctly validate cases where different types are defined in subschemas of "anyOf" and other compound keywords). + +See [Coercion rules](https://github.com/ajv-validator/ajv/blob/master/COERCION.md) for details. + + +## API + +##### new Ajv(Object options) -> Object + +Create Ajv instance. + + +##### .compile(Object schema) -> Function<Object data> + +Generate validating function and cache the compiled schema for future use. + +Validating function returns a boolean value. This function has properties `errors` and `schema`. Errors encountered during the last validation are assigned to `errors` property (it is assigned `null` if there was no errors). `schema` property contains the reference to the original schema. + +The schema passed to this method will be validated against meta-schema unless `validateSchema` option is false. If schema is invalid, an error will be thrown. See [options](#options). + + +##### .compileAsync(Object schema [, Boolean meta] [, Function callback]) -> Promise + +Asynchronous version of `compile` method that loads missing remote schemas using asynchronous function in `options.loadSchema`. This function returns a Promise that resolves to a validation function. An optional callback passed to `compileAsync` will be called with 2 parameters: error (or null) and validating function. The returned promise will reject (and the callback will be called with an error) when: + +- missing schema can't be loaded (`loadSchema` returns a Promise that rejects). +- a schema containing a missing reference is loaded, but the reference cannot be resolved. +- schema (or some loaded/referenced schema) is invalid. + +The function compiles schema and loads the first missing schema (or meta-schema) until all missing schemas are loaded. + +You can asynchronously compile meta-schema by passing `true` as the second parameter. + +See example in [Asynchronous compilation](#asynchronous-schema-compilation). + + +##### .validate(Object schema|String key|String ref, data) -> Boolean + +Validate data using passed schema (it will be compiled and cached). + +Instead of the schema you can use the key that was previously passed to `addSchema`, the schema id if it was present in the schema or any previously resolved reference. + +Validation errors will be available in the `errors` property of Ajv instance (`null` if there were no errors). + +__Please note__: every time this method is called the errors are overwritten so you need to copy them to another variable if you want to use them later. + +If the schema is asynchronous (has `$async` keyword on the top level) this method returns a Promise. See [Asynchronous validation](#asynchronous-validation). + + +##### .addSchema(Array<Object>|Object schema [, String key]) -> Ajv + +Add schema(s) to validator instance. This method does not compile schemas (but it still validates them). Because of that dependencies can be added in any order and circular dependencies are supported. It also prevents unnecessary compilation of schemas that are containers for other schemas but not used as a whole. + +Array of schemas can be passed (schemas should have ids), the second parameter will be ignored. + +Key can be passed that can be used to reference the schema and will be used as the schema id if there is no id inside the schema. If the key is not passed, the schema id will be used as the key. + + +Once the schema is added, it (and all the references inside it) can be referenced in other schemas and used to validate data. + +Although `addSchema` does not compile schemas, explicit compilation is not required - the schema will be compiled when it is used first time. + +By default the schema is validated against meta-schema before it is added, and if the schema does not pass validation the exception is thrown. This behaviour is controlled by `validateSchema` option. + +__Please note__: Ajv uses the [method chaining syntax](https://en.wikipedia.org/wiki/Method_chaining) for all methods with the prefix `add*` and `remove*`. +This allows you to do nice things like the following. + +```javascript +var validate = new Ajv().addSchema(schema).addFormat(name, regex).getSchema(uri); +``` + +##### .addMetaSchema(Array<Object>|Object schema [, String key]) -> Ajv + +Adds meta schema(s) that can be used to validate other schemas. That function should be used instead of `addSchema` because there may be instance options that would compile a meta schema incorrectly (at the moment it is `removeAdditional` option). + +There is no need to explicitly add draft-07 meta schema (http://json-schema.org/draft-07/schema) - it is added by default, unless option `meta` is set to `false`. You only need to use it if you have a changed meta-schema that you want to use to validate your schemas. See `validateSchema`. + + +##### .validateSchema(Object schema) -> Boolean + +Validates schema. This method should be used to validate schemas rather than `validate` due to the inconsistency of `uri` format in JSON Schema standard. + +By default this method is called automatically when the schema is added, so you rarely need to use it directly. + +If schema doesn't have `$schema` property, it is validated against draft 6 meta-schema (option `meta` should not be false). + +If schema has `$schema` property, then the schema with this id (that should be previously added) is used to validate passed schema. + +Errors will be available at `ajv.errors`. + + +##### .getSchema(String key) -> Function<Object data> + +Retrieve compiled schema previously added with `addSchema` by the key passed to `addSchema` or by its full reference (id). The returned validating function has `schema` property with the reference to the original schema. + + +##### .removeSchema([Object schema|String key|String ref|RegExp pattern]) -> Ajv + +Remove added/cached schema. Even if schema is referenced by other schemas it can be safely removed as dependent schemas have local references. + +Schema can be removed using: +- key passed to `addSchema` +- it's full reference (id) +- RegExp that should match schema id or key (meta-schemas won't be removed) +- actual schema object that will be stable-stringified to remove schema from cache + +If no parameter is passed all schemas but meta-schemas will be removed and the cache will be cleared. + + +##### .addFormat(String name, String|RegExp|Function|Object format) -> Ajv + +Add custom format to validate strings or numbers. It can also be used to replace pre-defined formats for Ajv instance. + +Strings are converted to RegExp. + +Function should return validation result as `true` or `false`. + +If object is passed it should have properties `validate`, `compare` and `async`: + +- _validate_: a string, RegExp or a function as described above. +- _compare_: an optional comparison function that accepts two strings and compares them according to the format meaning. This function is used with keywords `formatMaximum`/`formatMinimum` (defined in [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package). It should return `1` if the first value is bigger than the second value, `-1` if it is smaller and `0` if it is equal. +- _async_: an optional `true` value if `validate` is an asynchronous function; in this case it should return a promise that resolves with a value `true` or `false`. +- _type_: an optional type of data that the format applies to. It can be `"string"` (default) or `"number"` (see https://github.com/ajv-validator/ajv/issues/291#issuecomment-259923858). If the type of data is different, the validation will pass. + +Custom formats can be also added via `formats` option. + + +##### .addKeyword(String keyword, Object definition) -> Ajv + +Add custom validation keyword to Ajv instance. + +Keyword should be different from all standard JSON Schema keywords and different from previously defined keywords. There is no way to redefine keywords or to remove keyword definition from the instance. + +Keyword must start with a letter, `_` or `$`, and may continue with letters, numbers, `_`, `$`, or `-`. +It is recommended to use an application-specific prefix for keywords to avoid current and future name collisions. + +Example Keywords: +- `"xyz-example"`: valid, and uses prefix for the xyz project to avoid name collisions. +- `"example"`: valid, but not recommended as it could collide with future versions of JSON Schema etc. +- `"3-example"`: invalid as numbers are not allowed to be the first character in a keyword + +Keyword definition is an object with the following properties: + +- _type_: optional string or array of strings with data type(s) that the keyword applies to. If not present, the keyword will apply to all types. +- _validate_: validating function +- _compile_: compiling function +- _macro_: macro function +- _inline_: compiling function that returns code (as string) +- _schema_: an optional `false` value used with "validate" keyword to not pass schema +- _metaSchema_: an optional meta-schema for keyword schema +- _dependencies_: an optional list of properties that must be present in the parent schema - it will be checked during schema compilation +- _modifying_: `true` MUST be passed if keyword modifies data +- _statements_: `true` can be passed in case inline keyword generates statements (as opposed to expression) +- _valid_: pass `true`/`false` to pre-define validation result, the result returned from validation function will be ignored. This option cannot be used with macro keywords. +- _$data_: an optional `true` value to support [$data reference](#data-reference) as the value of custom keyword. The reference will be resolved at validation time. If the keyword has meta-schema it would be extended to allow $data and it will be used to validate the resolved value. Supporting $data reference requires that keyword has validating function (as the only option or in addition to compile, macro or inline function). +- _async_: an optional `true` value if the validation function is asynchronous (whether it is compiled or passed in _validate_ property); in this case it should return a promise that resolves with a value `true` or `false`. This option is ignored in case of "macro" and "inline" keywords. +- _errors_: an optional boolean or string `"full"` indicating whether keyword returns errors. If this property is not set Ajv will determine if the errors were set in case of failed validation. + +_compile_, _macro_ and _inline_ are mutually exclusive, only one should be used at a time. _validate_ can be used separately or in addition to them to support $data reference. + +__Please note__: If the keyword is validating data type that is different from the type(s) in its definition, the validation function will not be called (and expanded macro will not be used), so there is no need to check for data type inside validation function or inside schema returned by macro function (unless you want to enforce a specific type and for some reason do not want to use a separate `type` keyword for that). In the same way as standard keywords work, if the keyword does not apply to the data type being validated, the validation of this keyword will succeed. + +See [Defining custom keywords](#defining-custom-keywords) for more details. + + +##### .getKeyword(String keyword) -> Object|Boolean + +Returns custom keyword definition, `true` for pre-defined keywords and `false` if the keyword is unknown. + + +##### .removeKeyword(String keyword) -> Ajv + +Removes custom or pre-defined keyword so you can redefine them. + +While this method can be used to extend pre-defined keywords, it can also be used to completely change their meaning - it may lead to unexpected results. + +__Please note__: schemas compiled before the keyword is removed will continue to work without changes. To recompile schemas use `removeSchema` method and compile them again. + + +##### .errorsText([Array<Object> errors [, Object options]]) -> String + +Returns the text with all errors in a String. + +Options can have properties `separator` (string used to separate errors, ", " by default) and `dataVar` (the variable name that dataPaths are prefixed with, "data" by default). + + +## Options + +Defaults: + +```javascript +{ + // validation and reporting options: + $data: false, + allErrors: false, + verbose: false, + $comment: false, // NEW in Ajv version 6.0 + jsonPointers: false, + uniqueItems: true, + unicode: true, + nullable: false, + format: 'fast', + formats: {}, + unknownFormats: true, + schemas: {}, + logger: undefined, + // referenced schema options: + schemaId: '$id', + missingRefs: true, + extendRefs: 'ignore', // recommended 'fail' + loadSchema: undefined, // function(uri: string): Promise {} + // options to modify validated data: + removeAdditional: false, + useDefaults: false, + coerceTypes: false, + // strict mode options + strictDefaults: false, + strictKeywords: false, + strictNumbers: false, + // asynchronous validation options: + transpile: undefined, // requires ajv-async package + // advanced options: + meta: true, + validateSchema: true, + addUsedSchema: true, + inlineRefs: true, + passContext: false, + loopRequired: Infinity, + ownProperties: false, + multipleOfPrecision: false, + errorDataPath: 'object', // deprecated + messages: true, + sourceCode: false, + processCode: undefined, // function (str: string, schema: object): string {} + cache: new Cache, + serialize: undefined +} +``` + +##### Validation and reporting options + +- _$data_: support [$data references](#data-reference). Draft 6 meta-schema that is added by default will be extended to allow them. If you want to use another meta-schema you need to use $dataMetaSchema method to add support for $data reference. See [API](#api). +- _allErrors_: check all rules collecting all errors. Default is to return after the first error. +- _verbose_: include the reference to the part of the schema (`schema` and `parentSchema`) and validated data in errors (false by default). +- _$comment_ (NEW in Ajv version 6.0): log or pass the value of `$comment` keyword to a function. Option values: + - `false` (default): ignore $comment keyword. + - `true`: log the keyword value to console. + - function: pass the keyword value, its schema path and root schema to the specified function +- _jsonPointers_: set `dataPath` property of errors using [JSON Pointers](https://tools.ietf.org/html/rfc6901) instead of JavaScript property access notation. +- _uniqueItems_: validate `uniqueItems` keyword (true by default). +- _unicode_: calculate correct length of strings with unicode pairs (true by default). Pass `false` to use `.length` of strings that is faster, but gives "incorrect" lengths of strings with unicode pairs - each unicode pair is counted as two characters. +- _nullable_: support keyword "nullable" from [Open API 3 specification](https://swagger.io/docs/specification/data-models/data-types/). +- _format_: formats validation mode. Option values: + - `"fast"` (default) - simplified and fast validation (see [Formats](#formats) for details of which formats are available and affected by this option). + - `"full"` - more restrictive and slow validation. E.g., 25:00:00 and 2015/14/33 will be invalid time and date in 'full' mode but it will be valid in 'fast' mode. + - `false` - ignore all format keywords. +- _formats_: an object with custom formats. Keys and values will be passed to `addFormat` method. +- _keywords_: an object with custom keywords. Keys and values will be passed to `addKeyword` method. +- _unknownFormats_: handling of unknown formats. Option values: + - `true` (default) - if an unknown format is encountered the exception is thrown during schema compilation. If `format` keyword value is [$data reference](#data-reference) and it is unknown the validation will fail. + - `[String]` - an array of unknown format names that will be ignored. This option can be used to allow usage of third party schemas with format(s) for which you don't have definitions, but still fail if another unknown format is used. If `format` keyword value is [$data reference](#data-reference) and it is not in this array the validation will fail. + - `"ignore"` - to log warning during schema compilation and always pass validation (the default behaviour in versions before 5.0.0). This option is not recommended, as it allows to mistype format name and it won't be validated without any error message. This behaviour is required by JSON Schema specification. +- _schemas_: an array or object of schemas that will be added to the instance. In case you pass the array the schemas must have IDs in them. When the object is passed the method `addSchema(value, key)` will be called for each schema in this object. +- _logger_: sets the logging method. Default is the global `console` object that should have methods `log`, `warn` and `error`. See [Error logging](#error-logging). Option values: + - custom logger - it should have methods `log`, `warn` and `error`. If any of these methods is missing an exception will be thrown. + - `false` - logging is disabled. + + +##### Referenced schema options + +- _schemaId_: this option defines which keywords are used as schema URI. Option value: + - `"$id"` (default) - only use `$id` keyword as schema URI (as specified in JSON Schema draft-06/07), ignore `id` keyword (if it is present a warning will be logged). + - `"id"` - only use `id` keyword as schema URI (as specified in JSON Schema draft-04), ignore `$id` keyword (if it is present a warning will be logged). + - `"auto"` - use both `$id` and `id` keywords as schema URI. If both are present (in the same schema object) and different the exception will be thrown during schema compilation. +- _missingRefs_: handling of missing referenced schemas. Option values: + - `true` (default) - if the reference cannot be resolved during compilation the exception is thrown. The thrown error has properties `missingRef` (with hash fragment) and `missingSchema` (without it). Both properties are resolved relative to the current base id (usually schema id, unless it was substituted). + - `"ignore"` - to log error during compilation and always pass validation. + - `"fail"` - to log error and successfully compile schema but fail validation if this rule is checked. +- _extendRefs_: validation of other keywords when `$ref` is present in the schema. Option values: + - `"ignore"` (default) - when `$ref` is used other keywords are ignored (as per [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03#section-3) standard). A warning will be logged during the schema compilation. + - `"fail"` (recommended) - if other validation keywords are used together with `$ref` the exception will be thrown when the schema is compiled. This option is recommended to make sure schema has no keywords that are ignored, which can be confusing. + - `true` - validate all keywords in the schemas with `$ref` (the default behaviour in versions before 5.0.0). +- _loadSchema_: asynchronous function that will be used to load remote schemas when `compileAsync` [method](#api-compileAsync) is used and some reference is missing (option `missingRefs` should NOT be 'fail' or 'ignore'). This function should accept remote schema uri as a parameter and return a Promise that resolves to a schema. See example in [Asynchronous compilation](#asynchronous-schema-compilation). + + +##### Options to modify validated data + +- _removeAdditional_: remove additional properties - see example in [Filtering data](#filtering-data). This option is not used if schema is added with `addMetaSchema` method. Option values: + - `false` (default) - not to remove additional properties + - `"all"` - all additional properties are removed, regardless of `additionalProperties` keyword in schema (and no validation is made for them). + - `true` - only additional properties with `additionalProperties` keyword equal to `false` are removed. + - `"failing"` - additional properties that fail schema validation will be removed (where `additionalProperties` keyword is `false` or schema). +- _useDefaults_: replace missing or undefined properties and items with the values from corresponding `default` keywords. Default behaviour is to ignore `default` keywords. This option is not used if schema is added with `addMetaSchema` method. See examples in [Assigning defaults](#assigning-defaults). Option values: + - `false` (default) - do not use defaults + - `true` - insert defaults by value (object literal is used). + - `"empty"` - in addition to missing or undefined, use defaults for properties and items that are equal to `null` or `""` (an empty string). + - `"shared"` (deprecated) - insert defaults by reference. If the default is an object, it will be shared by all instances of validated data. If you modify the inserted default in the validated data, it will be modified in the schema as well. +- _coerceTypes_: change data type of data to match `type` keyword. See the example in [Coercing data types](#coercing-data-types) and [coercion rules](https://github.com/ajv-validator/ajv/blob/master/COERCION.md). Option values: + - `false` (default) - no type coercion. + - `true` - coerce scalar data types. + - `"array"` - in addition to coercions between scalar types, coerce scalar data to an array with one element and vice versa (as required by the schema). + + +##### Strict mode options + +- _strictDefaults_: report ignored `default` keywords in schemas. Option values: + - `false` (default) - ignored defaults are not reported + - `true` - if an ignored default is present, throw an error + - `"log"` - if an ignored default is present, log warning +- _strictKeywords_: report unknown keywords in schemas. Option values: + - `false` (default) - unknown keywords are not reported + - `true` - if an unknown keyword is present, throw an error + - `"log"` - if an unknown keyword is present, log warning +- _strictNumbers_: validate numbers strictly, failing validation for NaN and Infinity. Option values: + - `false` (default) - NaN or Infinity will pass validation for numeric types + - `true` - NaN or Infinity will not pass validation for numeric types + +##### Asynchronous validation options + +- _transpile_: Requires [ajv-async](https://github.com/ajv-validator/ajv-async) package. It determines whether Ajv transpiles compiled asynchronous validation function. Option values: + - `undefined` (default) - transpile with [nodent](https://github.com/MatAtBread/nodent) if async functions are not supported. + - `true` - always transpile with nodent. + - `false` - do not transpile; if async functions are not supported an exception will be thrown. + + +##### Advanced options + +- _meta_: add [meta-schema](http://json-schema.org/documentation.html) so it can be used by other schemas (true by default). If an object is passed, it will be used as the default meta-schema for schemas that have no `$schema` keyword. This default meta-schema MUST have `$schema` keyword. +- _validateSchema_: validate added/compiled schemas against meta-schema (true by default). `$schema` property in the schema can be http://json-schema.org/draft-07/schema or absent (draft-07 meta-schema will be used) or can be a reference to the schema previously added with `addMetaSchema` method. Option values: + - `true` (default) - if the validation fails, throw the exception. + - `"log"` - if the validation fails, log error. + - `false` - skip schema validation. +- _addUsedSchema_: by default methods `compile` and `validate` add schemas to the instance if they have `$id` (or `id`) property that doesn't start with "#". If `$id` is present and it is not unique the exception will be thrown. Set this option to `false` to skip adding schemas to the instance and the `$id` uniqueness check when these methods are used. This option does not affect `addSchema` method. +- _inlineRefs_: Affects compilation of referenced schemas. Option values: + - `true` (default) - the referenced schemas that don't have refs in them are inlined, regardless of their size - that substantially improves performance at the cost of the bigger size of compiled schema functions. + - `false` - to not inline referenced schemas (they will be compiled as separate functions). + - integer number - to limit the maximum number of keywords of the schema that will be inlined. +- _passContext_: pass validation context to custom keyword functions. If this option is `true` and you pass some context to the compiled validation function with `validate.call(context, data)`, the `context` will be available as `this` in your custom keywords. By default `this` is Ajv instance. +- _loopRequired_: by default `required` keyword is compiled into a single expression (or a sequence of statements in `allErrors` mode). In case of a very large number of properties in this keyword it may result in a very big validation function. Pass integer to set the number of properties above which `required` keyword will be validated in a loop - smaller validation function size but also worse performance. +- _ownProperties_: by default Ajv iterates over all enumerable object properties; when this option is `true` only own enumerable object properties (i.e. found directly on the object rather than on its prototype) are iterated. Contributed by @mbroadst. +- _multipleOfPrecision_: by default `multipleOf` keyword is validated by comparing the result of division with parseInt() of that result. It works for dividers that are bigger than 1. For small dividers such as 0.01 the result of the division is usually not integer (even when it should be integer, see issue [#84](https://github.com/ajv-validator/ajv/issues/84)). If you need to use fractional dividers set this option to some positive integer N to have `multipleOf` validated using this formula: `Math.abs(Math.round(division) - division) < 1e-N` (it is slower but allows for float arithmetics deviations). +- _errorDataPath_ (deprecated): set `dataPath` to point to 'object' (default) or to 'property' when validating keywords `required`, `additionalProperties` and `dependencies`. +- _messages_: Include human-readable messages in errors. `true` by default. `false` can be passed when custom messages are used (e.g. with [ajv-i18n](https://github.com/ajv-validator/ajv-i18n)). +- _sourceCode_: add `sourceCode` property to validating function (for debugging; this code can be different from the result of toString call). +- _processCode_: an optional function to process generated code before it is passed to Function constructor. It can be used to either beautify (the validating function is generated without line-breaks) or to transpile code. Starting from version 5.0.0 this option replaced options: + - `beautify` that formatted the generated function using [js-beautify](https://github.com/beautify-web/js-beautify). If you want to beautify the generated code pass a function calling `require('js-beautify').js_beautify` as `processCode: code => js_beautify(code)`. + - `transpile` that transpiled asynchronous validation function. You can still use `transpile` option with [ajv-async](https://github.com/ajv-validator/ajv-async) package. See [Asynchronous validation](#asynchronous-validation) for more information. +- _cache_: an optional instance of cache to store compiled schemas using stable-stringified schema as a key. For example, set-associative cache [sacjs](https://github.com/epoberezkin/sacjs) can be used. If not passed then a simple hash is used which is good enough for the common use case (a limited number of statically defined schemas). Cache should have methods `put(key, value)`, `get(key)`, `del(key)` and `clear()`. +- _serialize_: an optional function to serialize schema to cache key. Pass `false` to use schema itself as a key (e.g., if WeakMap used as a cache). By default [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used. + + +## Validation errors + +In case of validation failure, Ajv assigns the array of errors to `errors` property of validation function (or to `errors` property of Ajv instance when `validate` or `validateSchema` methods were called). In case of [asynchronous validation](#asynchronous-validation), the returned promise is rejected with exception `Ajv.ValidationError` that has `errors` property. + + +### Error objects + +Each error is an object with the following properties: + +- _keyword_: validation keyword. +- _dataPath_: the path to the part of the data that was validated. By default `dataPath` uses JavaScript property access notation (e.g., `".prop[1].subProp"`). When the option `jsonPointers` is true (see [Options](#options)) `dataPath` will be set using JSON pointer standard (e.g., `"/prop/1/subProp"`). +- _schemaPath_: the path (JSON-pointer as a URI fragment) to the schema of the keyword that failed validation. +- _params_: the object with the additional information about error that can be used to create custom error messages (e.g., using [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) package). See below for parameters set by all keywords. +- _message_: the standard error message (can be excluded with option `messages` set to false). +- _schema_: the schema of the keyword (added with `verbose` option). +- _parentSchema_: the schema containing the keyword (added with `verbose` option) +- _data_: the data validated by the keyword (added with `verbose` option). + +__Please note__: `propertyNames` keyword schema validation errors have an additional property `propertyName`, `dataPath` points to the object. After schema validation for each property name, if it is invalid an additional error is added with the property `keyword` equal to `"propertyNames"`. + + +### Error parameters + +Properties of `params` object in errors depend on the keyword that failed validation. + +- `maxItems`, `minItems`, `maxLength`, `minLength`, `maxProperties`, `minProperties` - property `limit` (number, the schema of the keyword). +- `additionalItems` - property `limit` (the maximum number of allowed items in case when `items` keyword is an array of schemas and `additionalItems` is false). +- `additionalProperties` - property `additionalProperty` (the property not used in `properties` and `patternProperties` keywords). +- `dependencies` - properties: + - `property` (dependent property), + - `missingProperty` (required missing dependency - only the first one is reported currently) + - `deps` (required dependencies, comma separated list as a string), + - `depsCount` (the number of required dependencies). +- `format` - property `format` (the schema of the keyword). +- `maximum`, `minimum` - properties: + - `limit` (number, the schema of the keyword), + - `exclusive` (boolean, the schema of `exclusiveMaximum` or `exclusiveMinimum`), + - `comparison` (string, comparison operation to compare the data to the limit, with the data on the left and the limit on the right; can be "<", "<=", ">", ">=") +- `multipleOf` - property `multipleOf` (the schema of the keyword) +- `pattern` - property `pattern` (the schema of the keyword) +- `required` - property `missingProperty` (required property that is missing). +- `propertyNames` - property `propertyName` (an invalid property name). +- `patternRequired` (in ajv-keywords) - property `missingPattern` (required pattern that did not match any property). +- `type` - property `type` (required type(s), a string, can be a comma-separated list) +- `uniqueItems` - properties `i` and `j` (indices of duplicate items). +- `const` - property `allowedValue` pointing to the value (the schema of the keyword). +- `enum` - property `allowedValues` pointing to the array of values (the schema of the keyword). +- `$ref` - property `ref` with the referenced schema URI. +- `oneOf` - property `passingSchemas` (array of indices of passing schemas, null if no schema passes). +- custom keywords (in case keyword definition doesn't create errors) - property `keyword` (the keyword name). + + +### Error logging + +Using the `logger` option when initiallizing Ajv will allow you to define custom logging. Here you can build upon the exisiting logging. The use of other logging packages is supported as long as the package or its associated wrapper exposes the required methods. If any of the required methods are missing an exception will be thrown. +- **Required Methods**: `log`, `warn`, `error` + +```javascript +var otherLogger = new OtherLogger(); +var ajv = new Ajv({ + logger: { + log: console.log.bind(console), + warn: function warn() { + otherLogger.logWarn.apply(otherLogger, arguments); + }, + error: function error() { + otherLogger.logError.apply(otherLogger, arguments); + console.error.apply(console, arguments); + } + } +}); +``` + + +## Plugins + +Ajv can be extended with plugins that add custom keywords, formats or functions to process generated code. When such plugin is published as npm package it is recommended that it follows these conventions: + +- it exports a function +- this function accepts ajv instance as the first parameter and returns the same instance to allow chaining +- this function can accept an optional configuration as the second parameter + +If you have published a useful plugin please submit a PR to add it to the next section. + + +## Related packages + +- [ajv-async](https://github.com/ajv-validator/ajv-async) - plugin to configure async validation mode +- [ajv-bsontype](https://github.com/BoLaMN/ajv-bsontype) - plugin to validate mongodb's bsonType formats +- [ajv-cli](https://github.com/jessedc/ajv-cli) - command line interface +- [ajv-errors](https://github.com/ajv-validator/ajv-errors) - plugin for custom error messages +- [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) - internationalised error messages +- [ajv-istanbul](https://github.com/ajv-validator/ajv-istanbul) - plugin to instrument generated validation code to measure test coverage of your schemas +- [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) - plugin with custom validation keywords (select, typeof, etc.) +- [ajv-merge-patch](https://github.com/ajv-validator/ajv-merge-patch) - plugin with keywords $merge and $patch +- [ajv-pack](https://github.com/ajv-validator/ajv-pack) - produces a compact module exporting validation functions +- [ajv-formats-draft2019](https://github.com/luzlab/ajv-formats-draft2019) - format validators for draft2019 that aren't already included in ajv (ie. `idn-hostname`, `idn-email`, `iri`, `iri-reference` and `duration`). + +## Some packages using Ajv + +- [webpack](https://github.com/webpack/webpack) - a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser +- [jsonscript-js](https://github.com/JSONScript/jsonscript-js) - the interpreter for [JSONScript](http://www.jsonscript.org) - scripted processing of existing endpoints and services +- [osprey-method-handler](https://github.com/mulesoft-labs/osprey-method-handler) - Express middleware for validating requests and responses based on a RAML method object, used in [osprey](https://github.com/mulesoft/osprey) - validating API proxy generated from a RAML definition +- [har-validator](https://github.com/ahmadnassri/har-validator) - HTTP Archive (HAR) validator +- [jsoneditor](https://github.com/josdejong/jsoneditor) - a web-based tool to view, edit, format, and validate JSON http://jsoneditoronline.org +- [JSON Schema Lint](https://github.com/nickcmaynard/jsonschemalint) - a web tool to validate JSON/YAML document against a single JSON Schema http://jsonschemalint.com +- [objection](https://github.com/vincit/objection.js) - SQL-friendly ORM for Node.js +- [table](https://github.com/gajus/table) - formats data into a string table +- [ripple-lib](https://github.com/ripple/ripple-lib) - a JavaScript API for interacting with [Ripple](https://ripple.com) in Node.js and the browser +- [restbase](https://github.com/wikimedia/restbase) - distributed storage with REST API & dispatcher for backend services built to provide a low-latency & high-throughput API for Wikipedia / Wikimedia content +- [hippie-swagger](https://github.com/CacheControl/hippie-swagger) - [Hippie](https://github.com/vesln/hippie) wrapper that provides end to end API testing with swagger validation +- [react-form-controlled](https://github.com/seeden/react-form-controlled) - React controlled form components with validation +- [rabbitmq-schema](https://github.com/tjmehta/rabbitmq-schema) - a schema definition module for RabbitMQ graphs and messages +- [@query/schema](https://www.npmjs.com/package/@query/schema) - stream filtering with a URI-safe query syntax parsing to JSON Schema +- [chai-ajv-json-schema](https://github.com/peon374/chai-ajv-json-schema) - chai plugin to us JSON Schema with expect in mocha tests +- [grunt-jsonschema-ajv](https://github.com/SignpostMarv/grunt-jsonschema-ajv) - Grunt plugin for validating files against JSON Schema +- [extract-text-webpack-plugin](https://github.com/webpack-contrib/extract-text-webpack-plugin) - extract text from bundle into a file +- [electron-builder](https://github.com/electron-userland/electron-builder) - a solution to package and build a ready for distribution Electron app +- [addons-linter](https://github.com/mozilla/addons-linter) - Mozilla Add-ons Linter +- [gh-pages-generator](https://github.com/epoberezkin/gh-pages-generator) - multi-page site generator converting markdown files to GitHub pages +- [ESLint](https://github.com/eslint/eslint) - the pluggable linting utility for JavaScript and JSX + + +## Tests + +``` +npm install +git submodule update --init +npm test +``` + +## Contributing + +All validation functions are generated using doT templates in [dot](https://github.com/ajv-validator/ajv/tree/master/lib/dot) folder. Templates are precompiled so doT is not a run-time dependency. + +`npm run build` - compiles templates to [dotjs](https://github.com/ajv-validator/ajv/tree/master/lib/dotjs) folder. + +`npm run watch` - automatically compiles templates when files in dot folder change + +Please see [Contributing guidelines](https://github.com/ajv-validator/ajv/blob/master/CONTRIBUTING.md) + + +## Changes history + +See https://github.com/ajv-validator/ajv/releases + +__Please note__: [Changes in version 6.0.0](https://github.com/ajv-validator/ajv/releases/tag/v6.0.0). + +[Version 5.0.0](https://github.com/ajv-validator/ajv/releases/tag/5.0.0). + +[Version 4.0.0](https://github.com/ajv-validator/ajv/releases/tag/4.0.0). + +[Version 3.0.0](https://github.com/ajv-validator/ajv/releases/tag/3.0.0). + +[Version 2.0.0](https://github.com/ajv-validator/ajv/releases/tag/2.0.0). + + +## Code of conduct + +Please review and follow the [Code of conduct](https://github.com/ajv-validator/ajv/blob/master/CODE_OF_CONDUCT.md). + +Please report any unacceptable behaviour to ajv.validator@gmail.com - it will be reviewed by the project team. + + +## Open-source software support + +Ajv is a part of [Tidelift subscription](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=readme) - it provides a centralised support to open-source software users, in addition to the support provided by software maintainers. + + +## License + +[MIT](https://github.com/ajv-validator/ajv/blob/master/LICENSE) diff --git a/node_modules/ajv/dist/ajv.bundle.js b/node_modules/ajv/dist/ajv.bundle.js new file mode 100644 index 000000000..2a34a771f --- /dev/null +++ b/node_modules/ajv/dist/ajv.bundle.js @@ -0,0 +1,7189 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Ajv = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i; +// For the source: https://gist.github.com/dperini/729294 +// For test cases: https://mathiasbynens.be/demo/url-regex +// @todo Delete current URL in favour of the commented out URL rule when this issue is fixed https://github.com/eslint/eslint/issues/7983. +// var URL = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu; +var URL = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i; +var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i; +var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/; +var JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i; +var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/; + + +module.exports = formats; + +function formats(mode) { + mode = mode == 'full' ? 'full' : 'fast'; + return util.copy(formats[mode]); +} + + +formats.fast = { + // date: http://tools.ietf.org/html/rfc3339#section-5.6 + date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/, + // date-time: http://tools.ietf.org/html/rfc3339#section-5.6 + time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, + 'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, + // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js + uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i, + 'uri-reference': /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, + 'uri-template': URITEMPLATE, + url: URL, + // email (sources from jsen validator): + // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363 + // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation') + email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i, + hostname: HOSTNAME, + // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html + ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, + // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, + regex: regex, + // uuid: http://tools.ietf.org/html/rfc4122 + uuid: UUID, + // JSON-pointer: https://tools.ietf.org/html/rfc6901 + // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A + 'json-pointer': JSON_POINTER, + 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT, + // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00 + 'relative-json-pointer': RELATIVE_JSON_POINTER +}; + + +formats.full = { + date: date, + time: time, + 'date-time': date_time, + uri: uri, + 'uri-reference': URIREF, + 'uri-template': URITEMPLATE, + url: URL, + email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, + hostname: HOSTNAME, + ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01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25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, + regex: regex, + uuid: UUID, + 'json-pointer': JSON_POINTER, + 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT, + 'relative-json-pointer': RELATIVE_JSON_POINTER +}; + + +function isLeapYear(year) { + // https://tools.ietf.org/html/rfc3339#appendix-C + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); +} + + +function date(str) { + // full-date from http://tools.ietf.org/html/rfc3339#section-5.6 + var matches = str.match(DATE); + if (!matches) return false; + + var year = +matches[1]; + var month = +matches[2]; + var day = +matches[3]; + + return month >= 1 && month <= 12 && day >= 1 && + day <= (month == 2 && isLeapYear(year) ? 29 : DAYS[month]); +} + + +function time(str, full) { + var matches = str.match(TIME); + if (!matches) return false; + + var hour = matches[1]; + var minute = matches[2]; + var second = matches[3]; + var timeZone = matches[5]; + return ((hour <= 23 && minute <= 59 && second <= 59) || + (hour == 23 && minute == 59 && second == 60)) && + (!full || timeZone); +} + + +var DATE_TIME_SEPARATOR = /t|\s/i; +function date_time(str) { + // http://tools.ietf.org/html/rfc3339#section-5.6 + var dateTime = str.split(DATE_TIME_SEPARATOR); + return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true); +} + + +var NOT_URI_FRAGMENT = /\/|:/; +function uri(str) { + // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "." + return NOT_URI_FRAGMENT.test(str) && URI.test(str); +} + + +var Z_ANCHOR = /[^\\]\\Z/; +function regex(str) { + if (Z_ANCHOR.test(str)) return false; + try { + new RegExp(str); + return true; + } catch(e) { + return false; + } +} + +},{"./util":10}],5:[function(require,module,exports){ +'use strict'; + +var resolve = require('./resolve') + , util = require('./util') + , errorClasses = require('./error_classes') + , stableStringify = require('fast-json-stable-stringify'); + +var validateGenerator = require('../dotjs/validate'); + +/** + * Functions below are used inside compiled validations function + */ + +var ucs2length = util.ucs2length; +var equal = require('fast-deep-equal'); + +// this error is thrown by async schemas to return validation errors via exception +var ValidationError = errorClasses.Validation; + +module.exports = compile; + + +/** + * Compiles schema to validation function + * @this Ajv + * @param {Object} schema schema object + * @param {Object} root object with information about the root schema for this schema + * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution + * @param {String} baseId base ID for IDs in the schema + * @return {Function} validation function + */ +function compile(schema, root, localRefs, baseId) { + /* jshint validthis: true, evil: true */ + /* eslint no-shadow: 0 */ + var self = this + , opts = this._opts + , refVal = [ undefined ] + , refs = {} + , patterns = [] + , patternsHash = {} + , defaults = [] + , defaultsHash = {} + , customRules = []; + + root = root || { schema: schema, refVal: refVal, refs: refs }; + + var c = checkCompiling.call(this, schema, root, baseId); + var compilation = this._compilations[c.index]; + if (c.compiling) return (compilation.callValidate = callValidate); + + var formats = this._formats; + var RULES = this.RULES; + + try { + var v = localCompile(schema, root, localRefs, baseId); + compilation.validate = v; + var cv = compilation.callValidate; + if (cv) { + cv.schema = v.schema; + cv.errors = null; + cv.refs = v.refs; + cv.refVal = v.refVal; + cv.root = v.root; + cv.$async = v.$async; + if (opts.sourceCode) cv.source = v.source; + } + return v; + } finally { + endCompiling.call(this, schema, root, baseId); + } + + /* @this {*} - custom context, see passContext option */ + function callValidate() { + /* jshint validthis: true */ + var validate = compilation.validate; + var result = validate.apply(this, arguments); + callValidate.errors = validate.errors; + return result; + } + + function localCompile(_schema, _root, localRefs, baseId) { + var isRoot = !_root || (_root && _root.schema == _schema); + if (_root.schema != root.schema) + return compile.call(self, _schema, _root, localRefs, baseId); + + var $async = _schema.$async === true; + + var sourceCode = validateGenerator({ + isTop: true, + schema: _schema, + isRoot: isRoot, + baseId: baseId, + root: _root, + schemaPath: '', + errSchemaPath: '#', + errorPath: '""', + MissingRefError: errorClasses.MissingRef, + RULES: RULES, + validate: validateGenerator, + util: util, + resolve: resolve, + resolveRef: resolveRef, + usePattern: usePattern, + useDefault: useDefault, + useCustomRule: useCustomRule, + opts: opts, + formats: formats, + logger: self.logger, + self: self + }); + + sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode) + + vars(defaults, defaultCode) + vars(customRules, customRuleCode) + + sourceCode; + + if (opts.processCode) sourceCode = opts.processCode(sourceCode, _schema); + // console.log('\n\n\n *** \n', JSON.stringify(sourceCode)); + var validate; + try { + var makeValidate = new Function( + 'self', + 'RULES', + 'formats', + 'root', + 'refVal', + 'defaults', + 'customRules', + 'equal', + 'ucs2length', + 'ValidationError', + sourceCode + ); + + validate = makeValidate( + self, + RULES, + formats, + root, + refVal, + defaults, + customRules, + equal, + ucs2length, + ValidationError + ); + + refVal[0] = validate; + } catch(e) { + self.logger.error('Error compiling schema, function code:', sourceCode); + throw e; + } + + validate.schema = _schema; + validate.errors = null; + validate.refs = refs; + validate.refVal = refVal; + validate.root = isRoot ? validate : _root; + if ($async) validate.$async = true; + if (opts.sourceCode === true) { + validate.source = { + code: sourceCode, + patterns: patterns, + defaults: defaults + }; + } + + return validate; + } + + function resolveRef(baseId, ref, isRoot) { + ref = resolve.url(baseId, ref); + var refIndex = refs[ref]; + var _refVal, refCode; + if (refIndex !== undefined) { + _refVal = refVal[refIndex]; + refCode = 'refVal[' + refIndex + ']'; + return resolvedRef(_refVal, refCode); + } + if (!isRoot && root.refs) { + var rootRefId = root.refs[ref]; + if (rootRefId !== undefined) { + _refVal = root.refVal[rootRefId]; + refCode = addLocalRef(ref, _refVal); + return resolvedRef(_refVal, refCode); + } + } + + refCode = addLocalRef(ref); + var v = resolve.call(self, localCompile, root, ref); + if (v === undefined) { + var localSchema = localRefs && localRefs[ref]; + if (localSchema) { + v = resolve.inlineRef(localSchema, opts.inlineRefs) + ? localSchema + : compile.call(self, localSchema, root, localRefs, baseId); + } + } + + if (v === undefined) { + removeLocalRef(ref); + } else { + replaceLocalRef(ref, v); + return resolvedRef(v, refCode); + } + } + + function addLocalRef(ref, v) { + var refId = refVal.length; + refVal[refId] = v; + refs[ref] = refId; + return 'refVal' + refId; + } + + function removeLocalRef(ref) { + delete refs[ref]; + } + + function replaceLocalRef(ref, v) { + var refId = refs[ref]; + refVal[refId] = v; + } + + function resolvedRef(refVal, code) { + return typeof refVal == 'object' || typeof refVal == 'boolean' + ? { code: code, schema: refVal, inline: true } + : { code: code, $async: refVal && !!refVal.$async }; + } + + function usePattern(regexStr) { + var index = patternsHash[regexStr]; + if (index === undefined) { + index = patternsHash[regexStr] = patterns.length; + patterns[index] = regexStr; + } + return 'pattern' + index; + } + + function useDefault(value) { + switch (typeof value) { + case 'boolean': + case 'number': + return '' + value; + case 'string': + return util.toQuotedString(value); + case 'object': + if (value === null) return 'null'; + var valueStr = stableStringify(value); + var index = defaultsHash[valueStr]; + if (index === undefined) { + index = defaultsHash[valueStr] = defaults.length; + defaults[index] = value; + } + return 'default' + index; + } + } + + function useCustomRule(rule, schema, parentSchema, it) { + if (self._opts.validateSchema !== false) { + var deps = rule.definition.dependencies; + if (deps && !deps.every(function(keyword) { + return Object.prototype.hasOwnProperty.call(parentSchema, keyword); + })) + throw new Error('parent schema must have all required keywords: ' + deps.join(',')); + + var validateSchema = rule.definition.validateSchema; + if (validateSchema) { + var valid = validateSchema(schema); + if (!valid) { + var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors); + if (self._opts.validateSchema == 'log') self.logger.error(message); + else throw new Error(message); + } + } + } + + var compile = rule.definition.compile + , inline = rule.definition.inline + , macro = rule.definition.macro; + + var validate; + if (compile) { + validate = compile.call(self, schema, parentSchema, it); + } else if (macro) { + validate = macro.call(self, schema, parentSchema, it); + if (opts.validateSchema !== false) self.validateSchema(validate, true); + } else if (inline) { + validate = inline.call(self, it, rule.keyword, schema, parentSchema); + } else { + validate = rule.definition.validate; + if (!validate) return; + } + + if (validate === undefined) + throw new Error('custom keyword "' + rule.keyword + '"failed to compile'); + + var index = customRules.length; + customRules[index] = validate; + + return { + code: 'customRule' + index, + validate: validate + }; + } +} + + +/** + * Checks if the schema is currently compiled + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean) + */ +function checkCompiling(schema, root, baseId) { + /* jshint validthis: true */ + var index = compIndex.call(this, schema, root, baseId); + if (index >= 0) return { index: index, compiling: true }; + index = this._compilations.length; + this._compilations[index] = { + schema: schema, + root: root, + baseId: baseId + }; + return { index: index, compiling: false }; +} + + +/** + * Removes the schema from the currently compiled list + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + */ +function endCompiling(schema, root, baseId) { + /* jshint validthis: true */ + var i = compIndex.call(this, schema, root, baseId); + if (i >= 0) this._compilations.splice(i, 1); +} + + +/** + * Index of schema compilation in the currently compiled list + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + * @return {Integer} compilation index + */ +function compIndex(schema, root, baseId) { + /* jshint validthis: true */ + for (var i=0; i= 0xD800 && value <= 0xDBFF && pos < len) { + // high surrogate, and there is a next character + value = str.charCodeAt(pos); + if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate + } + } + return length; +}; + +},{}],10:[function(require,module,exports){ +'use strict'; + + +module.exports = { + copy: copy, + checkDataType: checkDataType, + checkDataTypes: checkDataTypes, + coerceToTypes: coerceToTypes, + toHash: toHash, + getProperty: getProperty, + escapeQuotes: escapeQuotes, + equal: require('fast-deep-equal'), + ucs2length: require('./ucs2length'), + varOccurences: varOccurences, + varReplace: varReplace, + schemaHasRules: schemaHasRules, + schemaHasRulesExcept: schemaHasRulesExcept, + schemaUnknownRules: schemaUnknownRules, + toQuotedString: toQuotedString, + getPathExpr: getPathExpr, + getPath: getPath, + getData: getData, + unescapeFragment: unescapeFragment, + unescapeJsonPointer: unescapeJsonPointer, + escapeFragment: escapeFragment, + escapeJsonPointer: escapeJsonPointer +}; + + +function copy(o, to) { + to = to || {}; + for (var key in o) to[key] = o[key]; + return to; +} + + +function checkDataType(dataType, data, strictNumbers, negate) { + var EQUAL = negate ? ' !== ' : ' === ' + , AND = negate ? ' || ' : ' && ' + , OK = negate ? '!' : '' + , NOT = negate ? '' : '!'; + switch (dataType) { + case 'null': return data + EQUAL + 'null'; + case 'array': return OK + 'Array.isArray(' + data + ')'; + case 'object': return '(' + OK + data + AND + + 'typeof ' + data + EQUAL + '"object"' + AND + + NOT + 'Array.isArray(' + data + '))'; + case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND + + NOT + '(' + data + ' % 1)' + + AND + data + EQUAL + data + + (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')'; + case 'number': return '(typeof ' + data + EQUAL + '"' + dataType + '"' + + (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')'; + default: return 'typeof ' + data + EQUAL + '"' + dataType + '"'; + } +} + + +function checkDataTypes(dataTypes, data, strictNumbers) { + switch (dataTypes.length) { + case 1: return checkDataType(dataTypes[0], data, strictNumbers, true); + default: + var code = ''; + var types = toHash(dataTypes); + if (types.array && types.object) { + code = types.null ? '(': '(!' + data + ' || '; + code += 'typeof ' + data + ' !== "object")'; + delete types.null; + delete types.array; + delete types.object; + } + if (types.number) delete types.integer; + for (var t in types) + code += (code ? ' && ' : '' ) + checkDataType(t, data, strictNumbers, true); + + return code; + } +} + + +var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]); +function coerceToTypes(optionCoerceTypes, dataTypes) { + if (Array.isArray(dataTypes)) { + var types = []; + for (var i=0; i= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl); + return paths[lvl - up]; + } + + if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl); + data = 'data' + ((lvl - up) || ''); + if (!jsonPointer) return data; + } + + var expr = data; + var segments = jsonPointer.split('/'); + for (var i=0; i', + $notOp = $isMax ? '>' : '<', + $errorKeyword = undefined; + if (!($isData || typeof $schema == 'number' || $schema === undefined)) { + throw new Error($keyword + ' must be number'); + } + if (!($isDataExcl || $schemaExcl === undefined || typeof $schemaExcl == 'number' || typeof $schemaExcl == 'boolean')) { + throw new Error($exclusiveKeyword + ' must be number or boolean'); + } + if ($isDataExcl) { + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), + $exclusive = 'exclusive' + $lvl, + $exclType = 'exclType' + $lvl, + $exclIsNumber = 'exclIsNumber' + $lvl, + $opExpr = 'op' + $lvl, + $opStr = '\' + ' + $opExpr + ' + \''; + out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; + $schemaValueExcl = 'schemaExcl' + $lvl; + out += ' var ' + ($exclusive) + '; var ' + ($exclType) + ' = typeof ' + ($schemaValueExcl) + '; if (' + ($exclType) + ' != \'boolean\' && ' + ($exclType) + ' != \'undefined\' && ' + ($exclType) + ' != \'number\') { '; + var $errorKeyword = $exclusiveKeyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_exclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($exclType) + ' == \'number\' ? ( (' + ($exclusive) + ' = ' + ($schemaValue) + ' === undefined || ' + ($schemaValueExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ') ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValueExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) : ( (' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\'; '; + if ($schema === undefined) { + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; + $schemaValue = $schemaValueExcl; + $isData = $isDataExcl; + } + } else { + var $exclIsNumber = typeof $schemaExcl == 'number', + $opStr = $op; + if ($exclIsNumber && $isData) { + var $opExpr = '\'' + $opStr + '\''; + out += ' if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ( ' + ($schemaValue) + ' === undefined || ' + ($schemaExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ' ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { '; + } else { + if ($exclIsNumber && $schema === undefined) { + $exclusive = true; + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; + $schemaValue = $schemaExcl; + $notOp += '='; + } else { + if ($exclIsNumber) $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema); + if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) { + $exclusive = true; + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; + $notOp += '='; + } else { + $exclusive = false; + $opStr += '='; + } + } + var $opExpr = '\'' + $opStr + '\''; + out += ' if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') { '; + } + } + $errorKeyword = $errorKeyword || $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be ' + ($opStr) + ' '; + if ($isData) { + out += '\' + ' + ($schemaValue); + } else { + out += '' + ($schemaValue) + '\''; + } + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],14:[function(require,module,exports){ +'use strict'; +module.exports = function generate__limitItems(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!($isData || typeof $schema == 'number')) { + throw new Error($keyword + ' must be number'); + } + var $op = $keyword == 'maxItems' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have '; + if ($keyword == 'maxItems') { + out += 'more'; + } else { + out += 'fewer'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' items\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],15:[function(require,module,exports){ +'use strict'; +module.exports = function generate__limitLength(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!($isData || typeof $schema == 'number')) { + throw new Error($keyword + ' must be number'); + } + var $op = $keyword == 'maxLength' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + if (it.opts.unicode === false) { + out += ' ' + ($data) + '.length '; + } else { + out += ' ucs2length(' + ($data) + ') '; + } + out += ' ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitLength') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be '; + if ($keyword == 'maxLength') { + out += 'longer'; + } else { + out += 'shorter'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' characters\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],16:[function(require,module,exports){ +'use strict'; +module.exports = function generate__limitProperties(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!($isData || typeof $schema == 'number')) { + throw new Error($keyword + ' must be number'); + } + var $op = $keyword == 'maxProperties' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have '; + if ($keyword == 'maxProperties') { + out += 'more'; + } else { + out += 'fewer'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' properties\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],17:[function(require,module,exports){ +'use strict'; +module.exports = function generate_allOf(it, $keyword, $ruleType) { + var out = ' '; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $currentBaseId = $it.baseId, + $allSchemasEmpty = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + $allSchemasEmpty = false; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if ($breakOnError) { + if ($allSchemasEmpty) { + out += ' if (true) { '; + } else { + out += ' ' + ($closingBraces.slice(0, -1)) + ' '; + } + } + return out; +} + +},{}],18:[function(require,module,exports){ +'use strict'; +module.exports = function generate_anyOf(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $noEmptySchema = $schema.every(function($sch) { + return (it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all)); + }); + if ($noEmptySchema) { + var $currentBaseId = $it.baseId; + out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { '; + $closingBraces += '}'; + } + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should match some schema in anyOf\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; return false; '; + } + } + out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + if (it.opts.allErrors) { + out += ' } '; + } + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} + +},{}],19:[function(require,module,exports){ +'use strict'; +module.exports = function generate_comment(it, $keyword, $ruleType) { + var out = ' '; + var $schema = it.schema[$keyword]; + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $comment = it.util.toQuotedString($schema); + if (it.opts.$comment === true) { + out += ' console.log(' + ($comment) + ');'; + } else if (typeof it.opts.$comment == 'function') { + out += ' self._opts.$comment(' + ($comment) + ', ' + (it.util.toQuotedString($errSchemaPath)) + ', validate.root.schema);'; + } + return out; +} + +},{}],20:[function(require,module,exports){ +'use strict'; +module.exports = function generate_const(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!$isData) { + out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';'; + } + out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('const') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValue: schema' + ($lvl) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be equal to constant\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' }'; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],21:[function(require,module,exports){ +'use strict'; +module.exports = function generate_contains(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $idx = 'i' + $lvl, + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $currentBaseId = it.baseId, + $nonEmptySchema = (it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all)); + out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; + if ($nonEmptySchema) { + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' var ' + ($nextValid) + ' = false; for (var ' + ($idx) + ' = 0; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' if (' + ($nextValid) + ') break; } '; + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($closingBraces) + ' if (!' + ($nextValid) + ') {'; + } else { + out += ' if (' + ($data) + '.length == 0) {'; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('contains') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should contain a valid item\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + if ($nonEmptySchema) { + out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + } + if (it.opts.allErrors) { + out += ' } '; + } + return out; +} + +},{}],22:[function(require,module,exports){ +'use strict'; +module.exports = function generate_custom(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $rule = this, + $definition = 'definition' + $lvl, + $rDef = $rule.definition, + $closingBraces = ''; + var $compile, $inline, $macro, $ruleValidate, $validateCode; + if ($isData && $rDef.$data) { + $validateCode = 'keywordValidate' + $lvl; + var $validateSchema = $rDef.validateSchema; + out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;'; + } else { + $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it); + if (!$ruleValidate) return; + $schemaValue = 'validate.schema' + $schemaPath; + $validateCode = $ruleValidate.code; + $compile = $rDef.compile; + $inline = $rDef.inline; + $macro = $rDef.macro; + } + var $ruleErrs = $validateCode + '.errors', + $i = 'i' + $lvl, + $ruleErr = 'ruleErr' + $lvl, + $asyncKeyword = $rDef.async; + if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema'); + if (!($inline || $macro)) { + out += '' + ($ruleErrs) + ' = null;'; + } + out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; + if ($isData && $rDef.$data) { + $closingBraces += '}'; + out += ' if (' + ($schemaValue) + ' === undefined) { ' + ($valid) + ' = true; } else { '; + if ($validateSchema) { + $closingBraces += '}'; + out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') { '; + } + } + if ($inline) { + if ($rDef.statements) { + out += ' ' + ($ruleValidate.validate) + ' '; + } else { + out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; '; + } + } else if ($macro) { + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + $it.schema = $ruleValidate.validate; + $it.schemaPath = ''; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var $code = it.validate($it).replace(/validate\.schema/g, $validateCode); + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($code); + } else { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + out += ' ' + ($validateCode) + '.call( '; + if (it.opts.passContext) { + out += 'this'; + } else { + out += 'self'; + } + if ($compile || $rDef.schema === false) { + out += ' , ' + ($data) + ' '; + } else { + out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' '; + } + out += ' , (dataPath || \'\')'; + if (it.errorPath != '""') { + out += ' + ' + (it.errorPath); + } + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) '; + var def_callRuleValidate = out; + out = $$outStack.pop(); + if ($rDef.errors === false) { + out += ' ' + ($valid) + ' = '; + if ($asyncKeyword) { + out += 'await '; + } + out += '' + (def_callRuleValidate) + '; '; + } else { + if ($asyncKeyword) { + $ruleErrs = 'customErrors' + $lvl; + out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = await ' + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } '; + } else { + out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; '; + } + } + } + if ($rDef.modifying) { + out += ' if (' + ($parentData) + ') ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];'; + } + out += '' + ($closingBraces); + if ($rDef.valid) { + if ($breakOnError) { + out += ' if (true) { '; + } + } else { + out += ' if ( '; + if ($rDef.valid === undefined) { + out += ' !'; + if ($macro) { + out += '' + ($nextValid); + } else { + out += '' + ($valid); + } + } else { + out += ' ' + (!$rDef.valid) + ' '; + } + out += ') { '; + $errorKeyword = $rule.keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + var def_customError = out; + out = $$outStack.pop(); + if ($inline) { + if ($rDef.errors) { + if ($rDef.errors != 'full') { + out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + ' 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined '; + if ($ownProperties) { + out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') '; + } + out += ') { '; + $it.schema = $sch; + $it.schemaPath = $schemaPath + it.util.getProperty($property); + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property); + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + return out; +} + +},{}],24:[function(require,module,exports){ +'use strict'; +module.exports = function generate_enum(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $i = 'i' + $lvl, + $vSchema = 'schema' + $lvl; + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + ';'; + } + out += 'var ' + ($valid) + ';'; + if ($isData) { + out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; + } + out += '' + ($valid) + ' = false;for (var ' + ($i) + '=0; ' + ($i) + '<' + ($vSchema) + '.length; ' + ($i) + '++) if (equal(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + '])) { ' + ($valid) + ' = true; break; }'; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('enum') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValues: schema' + ($lvl) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be equal to one of the allowed values\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' }'; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],25:[function(require,module,exports){ +'use strict'; +module.exports = function generate_format(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + if (it.opts.format === false) { + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $unknownFormats = it.opts.unknownFormats, + $allowUnknown = Array.isArray($unknownFormats); + if ($isData) { + var $format = 'format' + $lvl, + $isObject = 'isObject' + $lvl, + $formatType = 'formatType' + $lvl; + out += ' var ' + ($format) + ' = formats[' + ($schemaValue) + ']; var ' + ($isObject) + ' = typeof ' + ($format) + ' == \'object\' && !(' + ($format) + ' instanceof RegExp) && ' + ($format) + '.validate; var ' + ($formatType) + ' = ' + ($isObject) + ' && ' + ($format) + '.type || \'string\'; if (' + ($isObject) + ') { '; + if (it.async) { + out += ' var async' + ($lvl) + ' = ' + ($format) + '.async; '; + } + out += ' ' + ($format) + ' = ' + ($format) + '.validate; } if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; + } + out += ' ('; + if ($unknownFormats != 'ignore') { + out += ' (' + ($schemaValue) + ' && !' + ($format) + ' '; + if ($allowUnknown) { + out += ' && self._opts.unknownFormats.indexOf(' + ($schemaValue) + ') == -1 '; + } + out += ') || '; + } + out += ' (' + ($format) + ' && ' + ($formatType) + ' == \'' + ($ruleType) + '\' && !(typeof ' + ($format) + ' == \'function\' ? '; + if (it.async) { + out += ' (async' + ($lvl) + ' ? await ' + ($format) + '(' + ($data) + ') : ' + ($format) + '(' + ($data) + ')) '; + } else { + out += ' ' + ($format) + '(' + ($data) + ') '; + } + out += ' : ' + ($format) + '.test(' + ($data) + '))))) {'; + } else { + var $format = it.formats[$schema]; + if (!$format) { + if ($unknownFormats == 'ignore') { + it.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"'); + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } else if ($allowUnknown && $unknownFormats.indexOf($schema) >= 0) { + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } else { + throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"'); + } + } + var $isObject = typeof $format == 'object' && !($format instanceof RegExp) && $format.validate; + var $formatType = $isObject && $format.type || 'string'; + if ($isObject) { + var $async = $format.async === true; + $format = $format.validate; + } + if ($formatType != $ruleType) { + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } + if ($async) { + if (!it.async) throw new Error('async format in sync schema'); + var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate'; + out += ' if (!(await ' + ($formatRef) + '(' + ($data) + '))) { '; + } else { + out += ' if (! '; + var $formatRef = 'formats' + it.util.getProperty($schema); + if ($isObject) $formatRef += '.validate'; + if (typeof $format == 'function') { + out += ' ' + ($formatRef) + '(' + ($data) + ') '; + } else { + out += ' ' + ($formatRef) + '.test(' + ($data) + ') '; + } + out += ') { '; + } + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('format') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { format: '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match format "'; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + (it.util.escapeQuotes($schema)); + } + out += '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],26:[function(require,module,exports){ +'use strict'; +module.exports = function generate_if(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + var $thenSch = it.schema['then'], + $elseSch = it.schema['else'], + $thenPresent = $thenSch !== undefined && (it.opts.strictKeywords ? (typeof $thenSch == 'object' && Object.keys($thenSch).length > 0) || $thenSch === false : it.util.schemaHasRules($thenSch, it.RULES.all)), + $elsePresent = $elseSch !== undefined && (it.opts.strictKeywords ? (typeof $elseSch == 'object' && Object.keys($elseSch).length > 0) || $elseSch === false : it.util.schemaHasRules($elseSch, it.RULES.all)), + $currentBaseId = $it.baseId; + if ($thenPresent || $elsePresent) { + var $ifClause; + $it.createErrors = false; + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = true; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + $it.createErrors = true; + out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + it.compositeRule = $it.compositeRule = $wasComposite; + if ($thenPresent) { + out += ' if (' + ($nextValid) + ') { '; + $it.schema = it.schema['then']; + $it.schemaPath = it.schemaPath + '.then'; + $it.errSchemaPath = it.errSchemaPath + '/then'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($nextValid) + '; '; + if ($thenPresent && $elsePresent) { + $ifClause = 'ifClause' + $lvl; + out += ' var ' + ($ifClause) + ' = \'then\'; '; + } else { + $ifClause = '\'then\''; + } + out += ' } '; + if ($elsePresent) { + out += ' else { '; + } + } else { + out += ' if (!' + ($nextValid) + ') { '; + } + if ($elsePresent) { + $it.schema = it.schema['else']; + $it.schemaPath = it.schemaPath + '.else'; + $it.errSchemaPath = it.errSchemaPath + '/else'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($nextValid) + '; '; + if ($thenPresent && $elsePresent) { + $ifClause = 'ifClause' + $lvl; + out += ' var ' + ($ifClause) + ' = \'else\'; '; + } else { + $ifClause = '\'else\''; + } + out += ' } '; + } + out += ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('if') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { failingKeyword: ' + ($ifClause) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match "\' + ' + ($ifClause) + ' + \'" schema\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; return false; '; + } + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} + +},{}],27:[function(require,module,exports){ +'use strict'; + +//all requires must be explicit because browserify won't work with dynamic requires +module.exports = { + '$ref': require('./ref'), + allOf: require('./allOf'), + anyOf: require('./anyOf'), + '$comment': require('./comment'), + const: require('./const'), + contains: require('./contains'), + dependencies: require('./dependencies'), + 'enum': require('./enum'), + format: require('./format'), + 'if': require('./if'), + items: require('./items'), + maximum: require('./_limit'), + minimum: require('./_limit'), + maxItems: require('./_limitItems'), + minItems: require('./_limitItems'), + maxLength: require('./_limitLength'), + minLength: require('./_limitLength'), + maxProperties: require('./_limitProperties'), + minProperties: require('./_limitProperties'), + multipleOf: require('./multipleOf'), + not: require('./not'), + oneOf: require('./oneOf'), + pattern: require('./pattern'), + properties: require('./properties'), + propertyNames: require('./propertyNames'), + required: require('./required'), + uniqueItems: require('./uniqueItems'), + validate: require('./validate') +}; + +},{"./_limit":13,"./_limitItems":14,"./_limitLength":15,"./_limitProperties":16,"./allOf":17,"./anyOf":18,"./comment":19,"./const":20,"./contains":21,"./dependencies":23,"./enum":24,"./format":25,"./if":26,"./items":28,"./multipleOf":29,"./not":30,"./oneOf":31,"./pattern":32,"./properties":33,"./propertyNames":34,"./ref":35,"./required":36,"./uniqueItems":37,"./validate":38}],28:[function(require,module,exports){ +'use strict'; +module.exports = function generate_items(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $idx = 'i' + $lvl, + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $currentBaseId = it.baseId; + out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; + if (Array.isArray($schema)) { + var $additionalItems = it.schema.additionalItems; + if ($additionalItems === false) { + out += ' ' + ($valid) + ' = ' + ($data) + '.length <= ' + ($schema.length) + '; '; + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalItems'; + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('additionalItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schema.length) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have more than ' + ($schema.length) + ' items\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + $closingBraces += '}'; + out += ' else { '; + } + } + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { '; + var $passData = $data + '[' + $i + ']'; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true); + $it.dataPathArr[$dataNxt] = $i; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if (typeof $additionalItems == 'object' && (it.opts.strictKeywords ? (typeof $additionalItems == 'object' && Object.keys($additionalItems).length > 0) || $additionalItems === false : it.util.schemaHasRules($additionalItems, it.RULES.all))) { + $it.schema = $additionalItems; + $it.schemaPath = it.schemaPath + '.additionalItems'; + $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; + out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') { for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } else if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' }'; + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + return out; +} + +},{}],29:[function(require,module,exports){ +'use strict'; +module.exports = function generate_multipleOf(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!($isData || typeof $schema == 'number')) { + throw new Error($keyword + ' must be number'); + } + out += 'var division' + ($lvl) + ';if ('; + if ($isData) { + out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || '; + } + out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', '; + if (it.opts.multipleOfPrecision) { + out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' '; + } else { + out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') '; + } + out += ' ) '; + if ($isData) { + out += ' ) '; + } + out += ' ) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be multiple of '; + if ($isData) { + out += '\' + ' + ($schemaValue); + } else { + out += '' + ($schemaValue) + '\''; + } + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],30:[function(require,module,exports){ +'use strict'; +module.exports = function generate_not(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.createErrors = false; + var $allErrorsOption; + if ($it.opts.allErrors) { + $allErrorsOption = $it.opts.allErrors; + $it.opts.allErrors = false; + } + out += ' ' + (it.validate($it)) + ' '; + $it.createErrors = true; + if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption; + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' if (' + ($nextValid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be valid\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + if (it.opts.allErrors) { + out += ' } '; + } + } else { + out += ' var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be valid\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if ($breakOnError) { + out += ' if (false) { '; + } + } + return out; +} + +},{}],31:[function(require,module,exports){ +'use strict'; +module.exports = function generate_oneOf(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $currentBaseId = $it.baseId, + $prevValid = 'prevValid' + $lvl, + $passingSchemas = 'passingSchemas' + $lvl; + out += 'var ' + ($errs) + ' = errors , ' + ($prevValid) + ' = false , ' + ($valid) + ' = false , ' + ($passingSchemas) + ' = null; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + } else { + out += ' var ' + ($nextValid) + ' = true; '; + } + if ($i) { + out += ' if (' + ($nextValid) + ' && ' + ($prevValid) + ') { ' + ($valid) + ' = false; ' + ($passingSchemas) + ' = [' + ($passingSchemas) + ', ' + ($i) + ']; } else { '; + $closingBraces += '}'; + } + out += ' if (' + ($nextValid) + ') { ' + ($valid) + ' = ' + ($prevValid) + ' = true; ' + ($passingSchemas) + ' = ' + ($i) + '; }'; + } + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { passingSchemas: ' + ($passingSchemas) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match exactly one schema in oneOf\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; return false; '; + } + } + out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }'; + if (it.opts.allErrors) { + out += ' } '; + } + return out; +} + +},{}],32:[function(require,module,exports){ +'use strict'; +module.exports = function generate_pattern(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema); + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; + } + out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('pattern') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern: '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match pattern "'; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + (it.util.escapeQuotes($schema)); + } + out += '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],33:[function(require,module,exports){ +'use strict'; +module.exports = function generate_properties(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $key = 'key' + $lvl, + $idx = 'idx' + $lvl, + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $dataProperties = 'dataProperties' + $lvl; + var $schemaKeys = Object.keys($schema || {}).filter(notProto), + $pProperties = it.schema.patternProperties || {}, + $pPropertyKeys = Object.keys($pProperties).filter(notProto), + $aProperties = it.schema.additionalProperties, + $someProperties = $schemaKeys.length || $pPropertyKeys.length, + $noAdditional = $aProperties === false, + $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length, + $removeAdditional = it.opts.removeAdditional, + $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional, + $ownProperties = it.opts.ownProperties, + $currentBaseId = it.baseId; + var $required = it.schema.required; + if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) { + var $requiredHash = it.util.toHash($required); + } + + function notProto(p) { + return p !== '__proto__'; + } + out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;'; + if ($ownProperties) { + out += ' var ' + ($dataProperties) + ' = undefined;'; + } + if ($checkAdditional) { + if ($ownProperties) { + out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; + } else { + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + } + if ($someProperties) { + out += ' var isAdditional' + ($lvl) + ' = !(false '; + if ($schemaKeys.length) { + if ($schemaKeys.length > 8) { + out += ' || validate.schema' + ($schemaPath) + '.hasOwnProperty(' + ($key) + ') '; + } else { + var arr1 = $schemaKeys; + if (arr1) { + var $propertyKey, i1 = -1, + l1 = arr1.length - 1; + while (i1 < l1) { + $propertyKey = arr1[i1 += 1]; + out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' '; + } + } + } + } + if ($pPropertyKeys.length) { + var arr2 = $pPropertyKeys; + if (arr2) { + var $pProperty, $i = -1, + l2 = arr2.length - 1; + while ($i < l2) { + $pProperty = arr2[$i += 1]; + out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') '; + } + } + } + out += ' ); if (isAdditional' + ($lvl) + ') { '; + } + if ($removeAdditional == 'all') { + out += ' delete ' + ($data) + '[' + ($key) + ']; '; + } else { + var $currentErrorPath = it.errorPath; + var $additionalProperty = '\' + ' + $key + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + } + if ($noAdditional) { + if ($removeAdditional) { + out += ' delete ' + ($data) + '[' + ($key) + ']; '; + } else { + out += ' ' + ($nextValid) + ' = false; '; + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalProperties'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is an invalid additional property'; + } else { + out += 'should NOT have additional properties'; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + out += ' break; '; + } + } + } else if ($additionalIsSchema) { + if ($removeAdditional == 'failing') { + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } '; + it.compositeRule = $it.compositeRule = $wasComposite; + } else { + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + } + } + it.errorPath = $currentErrorPath; + } + if ($someProperties) { + out += ' } '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + var $useDefaults = it.opts.useDefaults && !it.compositeRule; + if ($schemaKeys.length) { + var arr3 = $schemaKeys; + if (arr3) { + var $propertyKey, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $propertyKey = arr3[i3 += 1]; + var $sch = $schema[$propertyKey]; + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + var $prop = it.util.getProperty($propertyKey), + $passData = $data + $prop, + $hasDefault = $useDefaults && $sch.default !== undefined; + $it.schema = $sch; + $it.schemaPath = $schemaPath + $prop; + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey); + $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers); + $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey); + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + $code = it.util.varReplace($code, $nextData, $passData); + var $useData = $passData; + } else { + var $useData = $nextData; + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; '; + } + if ($hasDefault) { + out += ' ' + ($code) + ' '; + } else { + if ($requiredHash && $requiredHash[$propertyKey]) { + out += ' if ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') { ' + ($nextValid) + ' = false; '; + var $currentErrorPath = it.errorPath, + $currErrSchemaPath = $errSchemaPath, + $missingProperty = it.util.escapeQuotes($propertyKey); + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + $errSchemaPath = it.errSchemaPath + '/required'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + $errSchemaPath = $currErrSchemaPath; + it.errorPath = $currentErrorPath; + out += ' } else { '; + } else { + if ($breakOnError) { + out += ' if ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') { ' + ($nextValid) + ' = true; } else { '; + } else { + out += ' if (' + ($useData) + ' !== undefined '; + if ($ownProperties) { + out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ' ) { '; + } + } + out += ' ' + ($code) + ' } '; + } + } + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if ($pPropertyKeys.length) { + var arr4 = $pPropertyKeys; + if (arr4) { + var $pProperty, i4 = -1, + l4 = arr4.length - 1; + while (i4 < l4) { + $pProperty = arr4[i4 += 1]; + var $sch = $pProperties[$pProperty]; + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + $it.schema = $sch; + $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); + $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty); + if ($ownProperties) { + out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; + } else { + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + } + out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else ' + ($nextValid) + ' = true; '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + return out; +} + +},{}],34:[function(require,module,exports){ +'use strict'; +module.exports = function generate_propertyNames(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + out += 'var ' + ($errs) + ' = errors;'; + if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + var $key = 'key' + $lvl, + $idx = 'idx' + $lvl, + $i = 'i' + $lvl, + $invalidName = '\' + ' + $key + ' + \'', + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $dataProperties = 'dataProperties' + $lvl, + $ownProperties = it.opts.ownProperties, + $currentBaseId = it.baseId; + if ($ownProperties) { + out += ' var ' + ($dataProperties) + ' = undefined; '; + } + if ($ownProperties) { + out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; + } else { + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + } + out += ' var startErrs' + ($lvl) + ' = errors; '; + var $passData = $key; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' if (!' + ($nextValid) + ') { for (var ' + ($i) + '=startErrs' + ($lvl) + '; ' + ($i) + ' 0) || $propertySch === false : it.util.schemaHasRules($propertySch, it.RULES.all)))) { + $required[$required.length] = $property; + } + } + } + } else { + var $required = $schema; + } + } + if ($isData || $required.length) { + var $currentErrorPath = it.errorPath, + $loopRequired = $isData || $required.length >= it.opts.loopRequired, + $ownProperties = it.opts.ownProperties; + if ($breakOnError) { + out += ' var missing' + ($lvl) + '; '; + if ($loopRequired) { + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; + } + var $i = 'i' + $lvl, + $propertyPath = 'schema' + $lvl + '[' + $i + ']', + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); + } + out += ' var ' + ($valid) + ' = true; '; + if ($isData) { + out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; + } + out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined '; + if ($ownProperties) { + out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; + } + out += '; if (!' + ($valid) + ') break; } '; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + } else { + out += ' if ( '; + var arr2 = $required; + if (arr2) { + var $propertyKey, $i = -1, + l2 = arr2.length - 1; + while ($i < l2) { + $propertyKey = arr2[$i += 1]; + if ($i) { + out += ' || '; + } + var $prop = it.util.getProperty($propertyKey), + $useData = $data + $prop; + out += ' ( ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) '; + } + } + out += ') { '; + var $propertyPath = 'missing' + $lvl, + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + } + } else { + if ($loopRequired) { + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; + } + var $i = 'i' + $lvl, + $propertyPath = 'schema' + $lvl + '[' + $i + ']', + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); + } + if ($isData) { + out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { '; + } + out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; + } + out += ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } '; + if ($isData) { + out += ' } '; + } + } else { + var arr3 = $required; + if (arr3) { + var $propertyKey, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $propertyKey = arr3[i3 += 1]; + var $prop = it.util.getProperty($propertyKey), + $missingProperty = it.util.escapeQuotes($propertyKey), + $useData = $data + $prop; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + out += ' if ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; + } + } + } + } + it.errorPath = $currentErrorPath; + } else if ($breakOnError) { + out += ' if (true) {'; + } + return out; +} + +},{}],37:[function(require,module,exports){ +'use strict'; +module.exports = function generate_uniqueItems(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (($schema || $isData) && it.opts.uniqueItems !== false) { + if ($isData) { + out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'boolean\') ' + ($valid) + ' = false; else { '; + } + out += ' var i = ' + ($data) + '.length , ' + ($valid) + ' = true , j; if (i > 1) { '; + var $itemType = it.schema.items && it.schema.items.type, + $typeIsArray = Array.isArray($itemType); + if (!$itemType || $itemType == 'object' || $itemType == 'array' || ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0))) { + out += ' outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } '; + } else { + out += ' var itemIndices = {}, item; for (;i--;) { var item = ' + ($data) + '[i]; '; + var $method = 'checkDataType' + ($typeIsArray ? 's' : ''); + out += ' if (' + (it.util[$method]($itemType, 'item', it.opts.strictNumbers, true)) + ') continue; '; + if ($typeIsArray) { + out += ' if (typeof item == \'string\') item = \'"\' + item; '; + } + out += ' if (typeof itemIndices[item] == \'number\') { ' + ($valid) + ' = false; j = itemIndices[item]; break; } itemIndices[item] = i; } '; + } + out += ' } '; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('uniqueItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} + +},{}],38:[function(require,module,exports){ +'use strict'; +module.exports = function generate_validate(it, $keyword, $ruleType) { + var out = ''; + var $async = it.schema.$async === true, + $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'), + $id = it.self._getId(it.schema); + if (it.opts.strictKeywords) { + var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords); + if ($unknownKwd) { + var $keywordsMsg = 'unknown keyword: ' + $unknownKwd; + if (it.opts.strictKeywords === 'log') it.logger.warn($keywordsMsg); + else throw new Error($keywordsMsg); + } + } + if (it.isTop) { + out += ' var validate = '; + if ($async) { + it.async = true; + out += 'async '; + } + out += 'function(data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; '; + if ($id && (it.opts.sourceCode || it.opts.processCode)) { + out += ' ' + ('/\*# sourceURL=' + $id + ' */') + ' '; + } + } + if (typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref)) { + var $keyword = 'false schema'; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + if (it.schema === false) { + if (it.isTop) { + $breakOnError = true; + } else { + out += ' var ' + ($valid) + ' = false; '; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'false schema') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'boolean schema is false\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } else { + if (it.isTop) { + if ($async) { + out += ' return data; '; + } else { + out += ' validate.errors = null; return true; '; + } + } else { + out += ' var ' + ($valid) + ' = true; '; + } + } + if (it.isTop) { + out += ' }; return validate; '; + } + return out; + } + if (it.isTop) { + var $top = it.isTop, + $lvl = it.level = 0, + $dataLvl = it.dataLevel = 0, + $data = 'data'; + it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema)); + it.baseId = it.baseId || it.rootId; + delete it.isTop; + it.dataPathArr = [""]; + if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) { + var $defaultMsg = 'default is ignored in the schema root'; + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); + else throw new Error($defaultMsg); + } + out += ' var vErrors = null; '; + out += ' var errors = 0; '; + out += ' if (rootData === undefined) rootData = data; '; + } else { + var $lvl = it.level, + $dataLvl = it.dataLevel, + $data = 'data' + ($dataLvl || ''); + if ($id) it.baseId = it.resolve.url(it.baseId, $id); + if ($async && !it.async) throw new Error('async schema in sync schema'); + out += ' var errs_' + ($lvl) + ' = errors;'; + } + var $valid = 'valid' + $lvl, + $breakOnError = !it.opts.allErrors, + $closingBraces1 = '', + $closingBraces2 = ''; + var $errorKeyword; + var $typeSchema = it.schema.type, + $typeIsArray = Array.isArray($typeSchema); + if ($typeSchema && it.opts.nullable && it.schema.nullable === true) { + if ($typeIsArray) { + if ($typeSchema.indexOf('null') == -1) $typeSchema = $typeSchema.concat('null'); + } else if ($typeSchema != 'null') { + $typeSchema = [$typeSchema, 'null']; + $typeIsArray = true; + } + } + if ($typeIsArray && $typeSchema.length == 1) { + $typeSchema = $typeSchema[0]; + $typeIsArray = false; + } + if (it.schema.$ref && $refKeywords) { + if (it.opts.extendRefs == 'fail') { + throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)'); + } else if (it.opts.extendRefs !== true) { + $refKeywords = false; + it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); + } + } + if (it.schema.$comment && it.opts.$comment) { + out += ' ' + (it.RULES.all.$comment.code(it, '$comment')); + } + if ($typeSchema) { + if (it.opts.coerceTypes) { + var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); + } + var $rulesGroup = it.RULES.types[$typeSchema]; + if ($coerceToTypes || $typeIsArray || $rulesGroup === true || ($rulesGroup && !$shouldUseGroup($rulesGroup))) { + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type'; + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type', + $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; + out += ' if (' + (it.util[$method]($typeSchema, $data, it.opts.strictNumbers, true)) + ') { '; + if ($coerceToTypes) { + var $dataType = 'dataType' + $lvl, + $coerced = 'coerced' + $lvl; + out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; var ' + ($coerced) + ' = undefined; '; + if (it.opts.coerceTypes == 'array') { + out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ') && ' + ($data) + '.length == 1) { ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; if (' + (it.util.checkDataType(it.schema.type, $data, it.opts.strictNumbers)) + ') ' + ($coerced) + ' = ' + ($data) + '; } '; + } + out += ' if (' + ($coerced) + ' !== undefined) ; '; + var arr1 = $coerceToTypes; + if (arr1) { + var $type, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $type = arr1[$i += 1]; + if ($type == 'string') { + out += ' else if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; '; + } else if ($type == 'number' || $type == 'integer') { + out += ' else if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' '; + if ($type == 'integer') { + out += ' && !(' + ($data) + ' % 1)'; + } + out += ')) ' + ($coerced) + ' = +' + ($data) + '; '; + } else if ($type == 'boolean') { + out += ' else if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; '; + } else if ($type == 'null') { + out += ' else if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; '; + } else if (it.opts.coerceTypes == 'array' && $type == 'array') { + out += ' else if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; '; + } + } + } + out += ' else { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } if (' + ($coerced) + ' !== undefined) { '; + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' ' + ($data) + ' = ' + ($coerced) + '; '; + if (!$dataLvl) { + out += 'if (' + ($parentData) + ' !== undefined)'; + } + out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } '; + } else { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } + out += ' } '; + } + } + if (it.schema.$ref && !$refKeywords) { + out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' '; + if ($breakOnError) { + out += ' } if (errors === '; + if ($top) { + out += '0'; + } else { + out += 'errs_' + ($lvl); + } + out += ') { '; + $closingBraces2 += '}'; + } + } else { + var arr2 = it.RULES; + if (arr2) { + var $rulesGroup, i2 = -1, + l2 = arr2.length - 1; + while (i2 < l2) { + $rulesGroup = arr2[i2 += 1]; + if ($shouldUseGroup($rulesGroup)) { + if ($rulesGroup.type) { + out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data, it.opts.strictNumbers)) + ') { '; + } + if (it.opts.useDefaults) { + if ($rulesGroup.type == 'object' && it.schema.properties) { + var $schema = it.schema.properties, + $schemaKeys = Object.keys($schema); + var arr3 = $schemaKeys; + if (arr3) { + var $propertyKey, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $propertyKey = arr3[i3 += 1]; + var $sch = $schema[$propertyKey]; + if ($sch.default !== undefined) { + var $passData = $data + it.util.getProperty($propertyKey); + if (it.compositeRule) { + if (it.opts.strictDefaults) { + var $defaultMsg = 'default is ignored for: ' + $passData; + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); + else throw new Error($defaultMsg); + } + } else { + out += ' if (' + ($passData) + ' === undefined '; + if (it.opts.useDefaults == 'empty') { + out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' '; + } + out += ' ) ' + ($passData) + ' = '; + if (it.opts.useDefaults == 'shared') { + out += ' ' + (it.useDefault($sch.default)) + ' '; + } else { + out += ' ' + (JSON.stringify($sch.default)) + ' '; + } + out += '; '; + } + } + } + } + } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) { + var arr4 = it.schema.items; + if (arr4) { + var $sch, $i = -1, + l4 = arr4.length - 1; + while ($i < l4) { + $sch = arr4[$i += 1]; + if ($sch.default !== undefined) { + var $passData = $data + '[' + $i + ']'; + if (it.compositeRule) { + if (it.opts.strictDefaults) { + var $defaultMsg = 'default is ignored for: ' + $passData; + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); + else throw new Error($defaultMsg); + } + } else { + out += ' if (' + ($passData) + ' === undefined '; + if (it.opts.useDefaults == 'empty') { + out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' '; + } + out += ' ) ' + ($passData) + ' = '; + if (it.opts.useDefaults == 'shared') { + out += ' ' + (it.useDefault($sch.default)) + ' '; + } else { + out += ' ' + (JSON.stringify($sch.default)) + ' '; + } + out += '; '; + } + } + } + } + } + } + var arr5 = $rulesGroup.rules; + if (arr5) { + var $rule, i5 = -1, + l5 = arr5.length - 1; + while (i5 < l5) { + $rule = arr5[i5 += 1]; + if ($shouldUseRule($rule)) { + var $code = $rule.code(it, $rule.keyword, $rulesGroup.type); + if ($code) { + out += ' ' + ($code) + ' '; + if ($breakOnError) { + $closingBraces1 += '}'; + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces1) + ' '; + $closingBraces1 = ''; + } + if ($rulesGroup.type) { + out += ' } '; + if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) { + out += ' else { '; + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + } + } + if ($breakOnError) { + out += ' if (errors === '; + if ($top) { + out += '0'; + } else { + out += 'errs_' + ($lvl); + } + out += ') { '; + $closingBraces2 += '}'; + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces2) + ' '; + } + if ($top) { + if ($async) { + out += ' if (errors === 0) return data; '; + out += ' else throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; '; + out += ' return errors === 0; '; + } + out += ' }; return validate;'; + } else { + out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';'; + } + + function $shouldUseGroup($rulesGroup) { + var rules = $rulesGroup.rules; + for (var i = 0; i < rules.length; i++) + if ($shouldUseRule(rules[i])) return true; + } + + function $shouldUseRule($rule) { + return it.schema[$rule.keyword] !== undefined || ($rule.implements && $ruleImplementsSomeKeyword($rule)); + } + + function $ruleImplementsSomeKeyword($rule) { + var impl = $rule.implements; + for (var i = 0; i < impl.length; i++) + if (it.schema[impl[i]] !== undefined) return true; + } + return out; +} + +},{}],39:[function(require,module,exports){ +'use strict'; + +var IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i; +var customRuleCode = require('./dotjs/custom'); +var definitionSchema = require('./definition_schema'); + +module.exports = { + add: addKeyword, + get: getKeyword, + remove: removeKeyword, + validate: validateKeyword +}; + + +/** + * Define custom keyword + * @this Ajv + * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords). + * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`. + * @return {Ajv} this for method chaining + */ +function addKeyword(keyword, definition) { + /* jshint validthis: true */ + /* eslint no-shadow: 0 */ + var RULES = this.RULES; + if (RULES.keywords[keyword]) + throw new Error('Keyword ' + keyword + ' is already defined'); + + if (!IDENTIFIER.test(keyword)) + throw new Error('Keyword ' + keyword + ' is not a valid identifier'); + + if (definition) { + this.validateKeyword(definition, true); + + var dataType = definition.type; + if (Array.isArray(dataType)) { + for (var i=0; i 1) { + sets[0] = sets[0].slice(0, -1); + var xl = sets.length - 1; + for (var x = 1; x < xl; ++x) { + sets[x] = sets[x].slice(1, -1); + } + sets[xl] = sets[xl].slice(1); + return sets.join(''); + } else { + return sets[0]; + } +} +function subexp(str) { + return "(?:" + str + ")"; +} +function typeOf(o) { + return o === undefined ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase(); +} +function toUpperCase(str) { + return str.toUpperCase(); +} +function toArray(obj) { + return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : []; +} +function assign(target, source) { + var obj = target; + if (source) { + for (var key in source) { + obj[key] = source[key]; + } + } + return obj; +} + +function buildExps(isIRI) { + var ALPHA$$ = "[A-Za-z]", + CR$ = "[\\x0D]", + DIGIT$$ = "[0-9]", + DQUOTE$$ = "[\\x22]", + HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), + //case-insensitive + LF$$ = "[\\x0A]", + SP$$ = "[\\x20]", + PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), + //expanded + GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", + SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", + RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), + UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", + //subset, excludes bidi control characters + IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", + //subset + UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), + SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), + USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), + DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), + DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), + //relaxed parsing rules + IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), + H16$ = subexp(HEXDIG$$ + "{1,4}"), + LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), + IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), + // 6( h16 ":" ) ls32 + IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), + // "::" 5( h16 ":" ) ls32 + IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), + //[ h16 ] "::" 4( h16 ":" ) ls32 + IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), + //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 + IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), + //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 + IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), + //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 + IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), + //[ *4( h16 ":" ) h16 ] "::" ls32 + IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), + //[ *5( h16 ":" ) h16 ] "::" h16 + IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), + //[ *6( h16 ":" ) h16 ] "::" + IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), + ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), + //RFC 6874 + IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), + //RFC 6874 + IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), + //RFC 6874, with relaxed parsing rules + IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), + IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), + //RFC 6874 + REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), + HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), + PORT$ = subexp(DIGIT$$ + "*"), + AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), + PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), + SEGMENT$ = subexp(PCHAR$ + "*"), + SEGMENT_NZ$ = subexp(PCHAR$ + "+"), + SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), + PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), + PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), + //simplified + PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), + //simplified + PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), + //simplified + PATH_EMPTY$ = "(?!" + PCHAR$ + ")", + PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), + QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), + FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), + HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), + URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), + RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), + RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), + URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), + ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), + GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", + SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$"; + return { + NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), + NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), + NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), + ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), + UNRESERVED: new RegExp(UNRESERVED$$, "g"), + OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), + PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"), + IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), + IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules + }; +} +var URI_PROTOCOL = buildExps(false); + +var IRI_PROTOCOL = buildExps(true); + +var slicedToArray = function () { + function sliceIterator(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"]) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; + } + + return function (arr, i) { + if (Array.isArray(arr)) { + return arr; + } else if (Symbol.iterator in Object(arr)) { + return sliceIterator(arr, i); + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } + }; +}(); + + + + + + + + + + + + + +var toConsumableArray = function (arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; + + return arr2; + } else { + return Array.from(arr); + } +}; + +/** Highest positive signed 32-bit float value */ + +var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + +/** Bootstring parameters */ +var base = 36; +var tMin = 1; +var tMax = 26; +var skew = 38; +var damp = 700; +var initialBias = 72; +var initialN = 128; // 0x80 +var delimiter = '-'; // '\x2D' + +/** Regular expressions */ +var regexPunycode = /^xn--/; +var regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars +var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + +/** Error messages */ +var errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' +}; + +/** Convenience shortcuts */ +var baseMinusTMin = base - tMin; +var floor = Math.floor; +var stringFromCharCode = String.fromCharCode; + +/*--------------------------------------------------------------------------*/ + +/** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ +function error$1(type) { + throw new RangeError(errors[type]); +} + +/** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ +function map(array, fn) { + var result = []; + var length = array.length; + while (length--) { + result[length] = fn(array[length]); + } + return result; +} + +/** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ +function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + string = string.replace(regexSeparators, '\x2E'); + var labels = string.split('.'); + var encoded = map(labels, fn).join('.'); + return result + encoded; +} + +/** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ +function ucs2decode(string) { + var output = []; + var counter = 0; + var length = string.length; + while (counter < length) { + var value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // It's a high surrogate, and there is a next character. + var extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { + // Low surrogate. + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; +} + +/** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ +var ucs2encode = function ucs2encode(array) { + return String.fromCodePoint.apply(String, toConsumableArray(array)); +}; + +/** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ +var basicToDigit = function basicToDigit(codePoint) { + if (codePoint - 0x30 < 0x0A) { + return codePoint - 0x16; + } + if (codePoint - 0x41 < 0x1A) { + return codePoint - 0x41; + } + if (codePoint - 0x61 < 0x1A) { + return codePoint - 0x61; + } + return base; +}; + +/** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ +var digitToBasic = function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); +}; + +/** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ +var adapt = function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); +}; + +/** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ +var decode = function decode(input) { + // Don't use UCS-2. + var output = []; + var inputLength = input.length; + var i = 0; + var n = initialN; + var bias = initialBias; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + var basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (var j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error$1('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{ + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + var oldi = i; + for (var w = 1, k = base;; /* no condition */k += base) { + + if (index >= inputLength) { + error$1('invalid-input'); + } + + var digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error$1('overflow'); + } + + i += digit * w; + var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + + if (digit < t) { + break; + } + + var baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error$1('overflow'); + } + + w *= baseMinusT; + } + + var out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error$1('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output. + output.splice(i++, 0, n); + } + + return String.fromCodePoint.apply(String, output); +}; + +/** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ +var encode = function encode(input) { + var output = []; + + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); + + // Cache the length. + var inputLength = input.length; + + // Initialize the state. + var n = initialN; + var delta = 0; + var bias = initialBias; + + // Handle the basic code points. + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _currentValue2 = _step.value; + + if (_currentValue2 < 0x80) { + output.push(stringFromCharCode(_currentValue2)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + var basicLength = output.length; + var handledCPCount = basicLength; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + var m = maxInt; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var currentValue = _step2.value; + + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow. + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + var handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error$1('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var _currentValue = _step3.value; + + if (_currentValue < n && ++delta > maxInt) { + error$1('overflow'); + } + if (_currentValue == n) { + // Represent delta as a generalized variable-length integer. + var q = delta; + for (var k = base;; /* no condition */k += base) { + var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + if (q < t) { + break; + } + var qMinusT = q - t; + var baseMinusT = base - t; + output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + ++delta; + ++n; + } + return output.join(''); +}; + +/** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ +var toUnicode = function toUnicode(input) { + return mapDomain(input, function (string) { + return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; + }); +}; + +/** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ +var toASCII = function toASCII(input) { + return mapDomain(input, function (string) { + return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; + }); +}; + +/*--------------------------------------------------------------------------*/ + +/** Define the public API */ +var punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '2.1.0', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode +}; + +/** + * URI.js + * + * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript. + * @author Gary Court + * @see http://github.com/garycourt/uri-js + */ +/** + * Copyright 2011 Gary Court. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of Gary Court. + */ +var SCHEMES = {}; +function pctEncChar(chr) { + var c = chr.charCodeAt(0); + var e = void 0; + if (c < 16) e = "%0" + c.toString(16).toUpperCase();else if (c < 128) e = "%" + c.toString(16).toUpperCase();else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase(); + return e; +} +function pctDecChars(str) { + var newStr = ""; + var i = 0; + var il = str.length; + while (i < il) { + var c = parseInt(str.substr(i + 1, 2), 16); + if (c < 128) { + newStr += String.fromCharCode(c); + i += 3; + } else if (c >= 194 && c < 224) { + if (il - i >= 6) { + var c2 = parseInt(str.substr(i + 4, 2), 16); + newStr += String.fromCharCode((c & 31) << 6 | c2 & 63); + } else { + newStr += str.substr(i, 6); + } + i += 6; + } else if (c >= 224) { + if (il - i >= 9) { + var _c = parseInt(str.substr(i + 4, 2), 16); + var c3 = parseInt(str.substr(i + 7, 2), 16); + newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63); + } else { + newStr += str.substr(i, 9); + } + i += 9; + } else { + newStr += str.substr(i, 3); + i += 3; + } + } + return newStr; +} +function _normalizeComponentEncoding(components, protocol) { + function decodeUnreserved(str) { + var decStr = pctDecChars(str); + return !decStr.match(protocol.UNRESERVED) ? str : decStr; + } + if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, ""); + if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + return components; +} + +function _stripLeadingZeros(str) { + return str.replace(/^0*(.*)/, "$1") || "0"; +} +function _normalizeIPv4(host, protocol) { + var matches = host.match(protocol.IPV4ADDRESS) || []; + + var _matches = slicedToArray(matches, 2), + address = _matches[1]; + + if (address) { + return address.split(".").map(_stripLeadingZeros).join("."); + } else { + return host; + } +} +function _normalizeIPv6(host, protocol) { + var matches = host.match(protocol.IPV6ADDRESS) || []; + + var _matches2 = slicedToArray(matches, 3), + address = _matches2[1], + zone = _matches2[2]; + + if (address) { + var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(), + _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2), + last = _address$toLowerCase$2[0], + first = _address$toLowerCase$2[1]; + + var firstFields = first ? first.split(":").map(_stripLeadingZeros) : []; + var lastFields = last.split(":").map(_stripLeadingZeros); + var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]); + var fieldCount = isLastFieldIPv4Address ? 7 : 8; + var lastFieldsStart = lastFields.length - fieldCount; + var fields = Array(fieldCount); + for (var x = 0; x < fieldCount; ++x) { + fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || ''; + } + if (isLastFieldIPv4Address) { + fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol); + } + var allZeroFields = fields.reduce(function (acc, field, index) { + if (!field || field === "0") { + var lastLongest = acc[acc.length - 1]; + if (lastLongest && lastLongest.index + lastLongest.length === index) { + lastLongest.length++; + } else { + acc.push({ index: index, length: 1 }); + } + } + return acc; + }, []); + var longestZeroFields = allZeroFields.sort(function (a, b) { + return b.length - a.length; + })[0]; + var newHost = void 0; + if (longestZeroFields && longestZeroFields.length > 1) { + var newFirst = fields.slice(0, longestZeroFields.index); + var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length); + newHost = newFirst.join(":") + "::" + newLast.join(":"); + } else { + newHost = fields.join(":"); + } + if (zone) { + newHost += "%" + zone; + } + return newHost; + } else { + return host; + } +} +var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; +var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === undefined; +function parse(uriString) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var components = {}; + var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; + if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString; + var matches = uriString.match(URI_PARSE); + if (matches) { + if (NO_MATCH_IS_UNDEFINED) { + //store each component + components.scheme = matches[1]; + components.userinfo = matches[3]; + components.host = matches[4]; + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = matches[7]; + components.fragment = matches[8]; + //fix port number + if (isNaN(components.port)) { + components.port = matches[5]; + } + } else { + //IE FIX for improper RegExp matching + //store each component + components.scheme = matches[1] || undefined; + components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : undefined; + components.host = uriString.indexOf("//") !== -1 ? matches[4] : undefined; + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = uriString.indexOf("?") !== -1 ? matches[7] : undefined; + components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : undefined; + //fix port number + if (isNaN(components.port)) { + components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined; + } + } + if (components.host) { + //normalize IP hosts + components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol); + } + //determine reference type + if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) { + components.reference = "same-document"; + } else if (components.scheme === undefined) { + components.reference = "relative"; + } else if (components.fragment === undefined) { + components.reference = "absolute"; + } else { + components.reference = "uri"; + } + //check for reference errors + if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) { + components.error = components.error || "URI is not a " + options.reference + " reference."; + } + //find scheme handler + var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //check if scheme can't handle IRIs + if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { + //if host component is a domain name + if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) { + //convert Unicode IDN -> ASCII IDN + try { + components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); + } catch (e) { + components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e; + } + } + //convert IRI -> URI + _normalizeComponentEncoding(components, URI_PROTOCOL); + } else { + //normalize encodings + _normalizeComponentEncoding(components, protocol); + } + //perform scheme specific parsing + if (schemeHandler && schemeHandler.parse) { + schemeHandler.parse(components, options); + } + } else { + components.error = components.error || "URI can not be parsed."; + } + return components; +} + +function _recomposeAuthority(components, options) { + var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; + var uriTokens = []; + if (components.userinfo !== undefined) { + uriTokens.push(components.userinfo); + uriTokens.push("@"); + } + if (components.host !== undefined) { + //normalize IP hosts, add brackets and escape zone separator for IPv6 + uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) { + return "[" + $1 + ($2 ? "%25" + $2 : "") + "]"; + })); + } + if (typeof components.port === "number" || typeof components.port === "string") { + uriTokens.push(":"); + uriTokens.push(String(components.port)); + } + return uriTokens.length ? uriTokens.join("") : undefined; +} + +var RDS1 = /^\.\.?\//; +var RDS2 = /^\/\.(\/|$)/; +var RDS3 = /^\/\.\.(\/|$)/; +var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/; +function removeDotSegments(input) { + var output = []; + while (input.length) { + if (input.match(RDS1)) { + input = input.replace(RDS1, ""); + } else if (input.match(RDS2)) { + input = input.replace(RDS2, "/"); + } else if (input.match(RDS3)) { + input = input.replace(RDS3, "/"); + output.pop(); + } else if (input === "." || input === "..") { + input = ""; + } else { + var im = input.match(RDS5); + if (im) { + var s = im[0]; + input = input.slice(s.length); + output.push(s); + } else { + throw new Error("Unexpected dot segment condition"); + } + } + } + return output.join(""); +} + +function serialize(components) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL; + var uriTokens = []; + //find scheme handler + var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //perform scheme specific serialization + if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options); + if (components.host) { + //if host component is an IPv6 address + if (protocol.IPV6ADDRESS.test(components.host)) {} + //TODO: normalize IPv6 address as per RFC 5952 + + //if host component is a domain name + else if (options.domainHost || schemeHandler && schemeHandler.domainHost) { + //convert IDN via punycode + try { + components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host); + } catch (e) { + components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + } + } + //normalize encoding + _normalizeComponentEncoding(components, protocol); + if (options.reference !== "suffix" && components.scheme) { + uriTokens.push(components.scheme); + uriTokens.push(":"); + } + var authority = _recomposeAuthority(components, options); + if (authority !== undefined) { + if (options.reference !== "suffix") { + uriTokens.push("//"); + } + uriTokens.push(authority); + if (components.path && components.path.charAt(0) !== "/") { + uriTokens.push("/"); + } + } + if (components.path !== undefined) { + var s = components.path; + if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { + s = removeDotSegments(s); + } + if (authority === undefined) { + s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//" + } + uriTokens.push(s); + } + if (components.query !== undefined) { + uriTokens.push("?"); + uriTokens.push(components.query); + } + if (components.fragment !== undefined) { + uriTokens.push("#"); + uriTokens.push(components.fragment); + } + return uriTokens.join(""); //merge tokens into a string +} + +function resolveComponents(base, relative) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var skipNormalization = arguments[3]; + + var target = {}; + if (!skipNormalization) { + base = parse(serialize(base, options), options); //normalize base components + relative = parse(serialize(relative, options), options); //normalize relative components + } + options = options || {}; + if (!options.tolerant && relative.scheme) { + target.scheme = relative.scheme; + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } else { + if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) { + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } else { + if (!relative.path) { + target.path = base.path; + if (relative.query !== undefined) { + target.query = relative.query; + } else { + target.query = base.query; + } + } else { + if (relative.path.charAt(0) === "/") { + target.path = removeDotSegments(relative.path); + } else { + if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) { + target.path = "/" + relative.path; + } else if (!base.path) { + target.path = relative.path; + } else { + target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; + } + target.path = removeDotSegments(target.path); + } + target.query = relative.query; + } + //target.authority = base.authority; + target.userinfo = base.userinfo; + target.host = base.host; + target.port = base.port; + } + target.scheme = base.scheme; + } + target.fragment = relative.fragment; + return target; +} + +function resolve(baseURI, relativeURI, options) { + var schemelessOptions = assign({ scheme: 'null' }, options); + return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); +} + +function normalize(uri, options) { + if (typeof uri === "string") { + uri = serialize(parse(uri, options), options); + } else if (typeOf(uri) === "object") { + uri = parse(serialize(uri, options), options); + } + return uri; +} + +function equal(uriA, uriB, options) { + if (typeof uriA === "string") { + uriA = serialize(parse(uriA, options), options); + } else if (typeOf(uriA) === "object") { + uriA = serialize(uriA, options); + } + if (typeof uriB === "string") { + uriB = serialize(parse(uriB, options), options); + } else if (typeOf(uriB) === "object") { + uriB = serialize(uriB, options); + } + return uriA === uriB; +} + +function escapeComponent(str, options) { + return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar); +} + +function unescapeComponent(str, options) { + return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars); +} + +var handler = { + scheme: "http", + domainHost: true, + parse: function parse(components, options) { + //report missing host + if (!components.host) { + components.error = components.error || "HTTP URIs must have a host."; + } + return components; + }, + serialize: function serialize(components, options) { + var secure = String(components.scheme).toLowerCase() === "https"; + //normalize the default port + if (components.port === (secure ? 443 : 80) || components.port === "") { + components.port = undefined; + } + //normalize the empty path + if (!components.path) { + components.path = "/"; + } + //NOTE: We do not parse query strings for HTTP URIs + //as WWW Form Url Encoded query strings are part of the HTML4+ spec, + //and not the HTTP spec. + return components; + } +}; + +var handler$1 = { + scheme: "https", + domainHost: handler.domainHost, + parse: handler.parse, + serialize: handler.serialize +}; + +function isSecure(wsComponents) { + return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss"; +} +//RFC 6455 +var handler$2 = { + scheme: "ws", + domainHost: true, + parse: function parse(components, options) { + var wsComponents = components; + //indicate if the secure flag is set + wsComponents.secure = isSecure(wsComponents); + //construct resouce name + wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : ''); + wsComponents.path = undefined; + wsComponents.query = undefined; + return wsComponents; + }, + serialize: function serialize(wsComponents, options) { + //normalize the default port + if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") { + wsComponents.port = undefined; + } + //ensure scheme matches secure flag + if (typeof wsComponents.secure === 'boolean') { + wsComponents.scheme = wsComponents.secure ? 'wss' : 'ws'; + wsComponents.secure = undefined; + } + //reconstruct path from resource name + if (wsComponents.resourceName) { + var _wsComponents$resourc = wsComponents.resourceName.split('?'), + _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), + path = _wsComponents$resourc2[0], + query = _wsComponents$resourc2[1]; + + wsComponents.path = path && path !== '/' ? path : undefined; + wsComponents.query = query; + wsComponents.resourceName = undefined; + } + //forbid fragment component + wsComponents.fragment = undefined; + return wsComponents; + } +}; + +var handler$3 = { + scheme: "wss", + domainHost: handler$2.domainHost, + parse: handler$2.parse, + serialize: handler$2.serialize +}; + +var O = {}; +var isIRI = true; +//RFC 3986 +var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]"; +var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive +var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded +//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; = +//const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127) +//const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext +//const VCHAR$$ = "[\\x21-\\x7E]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext +//const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+"); +//const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$); +//const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"'); +var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]"; +var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]"; +var VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]"); +var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"; +var UNRESERVED = new RegExp(UNRESERVED$$, "g"); +var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g"); +var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g"); +var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g"); +var NOT_HFVALUE = NOT_HFNAME; +function decodeUnreserved(str) { + var decStr = pctDecChars(str); + return !decStr.match(UNRESERVED) ? str : decStr; +} +var handler$4 = { + scheme: "mailto", + parse: function parse$$1(components, options) { + var mailtoComponents = components; + var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : []; + mailtoComponents.path = undefined; + if (mailtoComponents.query) { + var unknownHeaders = false; + var headers = {}; + var hfields = mailtoComponents.query.split("&"); + for (var x = 0, xl = hfields.length; x < xl; ++x) { + var hfield = hfields[x].split("="); + switch (hfield[0]) { + case "to": + var toAddrs = hfield[1].split(","); + for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) { + to.push(toAddrs[_x]); + } + break; + case "subject": + mailtoComponents.subject = unescapeComponent(hfield[1], options); + break; + case "body": + mailtoComponents.body = unescapeComponent(hfield[1], options); + break; + default: + unknownHeaders = true; + headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options); + break; + } + } + if (unknownHeaders) mailtoComponents.headers = headers; + } + mailtoComponents.query = undefined; + for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) { + var addr = to[_x2].split("@"); + addr[0] = unescapeComponent(addr[0]); + if (!options.unicodeSupport) { + //convert Unicode IDN -> ASCII IDN + try { + addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase()); + } catch (e) { + mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e; + } + } else { + addr[1] = unescapeComponent(addr[1], options).toLowerCase(); + } + to[_x2] = addr.join("@"); + } + return mailtoComponents; + }, + serialize: function serialize$$1(mailtoComponents, options) { + var components = mailtoComponents; + var to = toArray(mailtoComponents.to); + if (to) { + for (var x = 0, xl = to.length; x < xl; ++x) { + var toAddr = String(to[x]); + var atIdx = toAddr.lastIndexOf("@"); + var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar); + var domain = toAddr.slice(atIdx + 1); + //convert IDN via punycode + try { + domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain); + } catch (e) { + components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + to[x] = localPart + "@" + domain; + } + components.path = to.join(","); + } + var headers = mailtoComponents.headers = mailtoComponents.headers || {}; + if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject; + if (mailtoComponents.body) headers["body"] = mailtoComponents.body; + var fields = []; + for (var name in headers) { + if (headers[name] !== O[name]) { + fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)); + } + } + if (fields.length) { + components.query = fields.join("&"); + } + return components; + } +}; + +var URN_PARSE = /^([^\:]+)\:(.*)/; +//RFC 2141 +var handler$5 = { + scheme: "urn", + parse: function parse$$1(components, options) { + var matches = components.path && components.path.match(URN_PARSE); + var urnComponents = components; + if (matches) { + var scheme = options.scheme || urnComponents.scheme || "urn"; + var nid = matches[1].toLowerCase(); + var nss = matches[2]; + var urnScheme = scheme + ":" + (options.nid || nid); + var schemeHandler = SCHEMES[urnScheme]; + urnComponents.nid = nid; + urnComponents.nss = nss; + urnComponents.path = undefined; + if (schemeHandler) { + urnComponents = schemeHandler.parse(urnComponents, options); + } + } else { + urnComponents.error = urnComponents.error || "URN can not be parsed."; + } + return urnComponents; + }, + serialize: function serialize$$1(urnComponents, options) { + var scheme = options.scheme || urnComponents.scheme || "urn"; + var nid = urnComponents.nid; + var urnScheme = scheme + ":" + (options.nid || nid); + var schemeHandler = SCHEMES[urnScheme]; + if (schemeHandler) { + urnComponents = schemeHandler.serialize(urnComponents, options); + } + var uriComponents = urnComponents; + var nss = urnComponents.nss; + uriComponents.path = (nid || options.nid) + ":" + nss; + return uriComponents; + } +}; + +var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; +//RFC 4122 +var handler$6 = { + scheme: "urn:uuid", + parse: function parse(urnComponents, options) { + var uuidComponents = urnComponents; + uuidComponents.uuid = uuidComponents.nss; + uuidComponents.nss = undefined; + if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { + uuidComponents.error = uuidComponents.error || "UUID is not valid."; + } + return uuidComponents; + }, + serialize: function serialize(uuidComponents, options) { + var urnComponents = uuidComponents; + //normalize UUID + urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); + return urnComponents; + } +}; + +SCHEMES[handler.scheme] = handler; +SCHEMES[handler$1.scheme] = handler$1; +SCHEMES[handler$2.scheme] = handler$2; +SCHEMES[handler$3.scheme] = handler$3; +SCHEMES[handler$4.scheme] = handler$4; +SCHEMES[handler$5.scheme] = handler$5; +SCHEMES[handler$6.scheme] = handler$6; + +exports.SCHEMES = SCHEMES; +exports.pctEncChar = pctEncChar; +exports.pctDecChars = pctDecChars; +exports.parse = parse; +exports.removeDotSegments = removeDotSegments; +exports.serialize = serialize; +exports.resolveComponents = resolveComponents; +exports.resolve = resolve; +exports.normalize = normalize; +exports.equal = equal; +exports.escapeComponent = escapeComponent; +exports.unescapeComponent = unescapeComponent; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); + + +},{}],"ajv":[function(require,module,exports){ +'use strict'; + +var compileSchema = require('./compile') + , resolve = require('./compile/resolve') + , Cache = require('./cache') + , SchemaObject = require('./compile/schema_obj') + , stableStringify = require('fast-json-stable-stringify') + , formats = require('./compile/formats') + , rules = require('./compile/rules') + , $dataMetaSchema = require('./data') + , util = require('./compile/util'); + +module.exports = Ajv; + +Ajv.prototype.validate = validate; +Ajv.prototype.compile = compile; +Ajv.prototype.addSchema = addSchema; +Ajv.prototype.addMetaSchema = addMetaSchema; +Ajv.prototype.validateSchema = validateSchema; +Ajv.prototype.getSchema = getSchema; +Ajv.prototype.removeSchema = removeSchema; +Ajv.prototype.addFormat = addFormat; +Ajv.prototype.errorsText = errorsText; + +Ajv.prototype._addSchema = _addSchema; +Ajv.prototype._compile = _compile; + +Ajv.prototype.compileAsync = require('./compile/async'); +var customKeyword = require('./keyword'); +Ajv.prototype.addKeyword = customKeyword.add; +Ajv.prototype.getKeyword = customKeyword.get; +Ajv.prototype.removeKeyword = customKeyword.remove; +Ajv.prototype.validateKeyword = customKeyword.validate; + +var errorClasses = require('./compile/error_classes'); +Ajv.ValidationError = errorClasses.Validation; +Ajv.MissingRefError = errorClasses.MissingRef; +Ajv.$dataMetaSchema = $dataMetaSchema; + +var META_SCHEMA_ID = 'http://json-schema.org/draft-07/schema'; + +var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes', 'strictDefaults' ]; +var META_SUPPORT_DATA = ['/properties']; + +/** + * Creates validator instance. + * Usage: `Ajv(opts)` + * @param {Object} opts optional options + * @return {Object} ajv instance + */ +function Ajv(opts) { + if (!(this instanceof Ajv)) return new Ajv(opts); + opts = this._opts = util.copy(opts) || {}; + setLogger(this); + this._schemas = {}; + this._refs = {}; + this._fragments = {}; + this._formats = formats(opts.format); + + this._cache = opts.cache || new Cache; + this._loadingSchemas = {}; + this._compilations = []; + this.RULES = rules(); + this._getId = chooseGetId(opts); + + opts.loopRequired = opts.loopRequired || Infinity; + if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true; + if (opts.serialize === undefined) opts.serialize = stableStringify; + this._metaOpts = getMetaSchemaOptions(this); + + if (opts.formats) addInitialFormats(this); + if (opts.keywords) addInitialKeywords(this); + addDefaultMetaSchema(this); + if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta); + if (opts.nullable) this.addKeyword('nullable', {metaSchema: {type: 'boolean'}}); + addInitialSchemas(this); +} + + + +/** + * Validate data using schema + * Schema will be compiled and cached (using serialized JSON as key. [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize. + * @this Ajv + * @param {String|Object} schemaKeyRef key, ref or schema object + * @param {Any} data to be validated + * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`). + */ +function validate(schemaKeyRef, data) { + var v; + if (typeof schemaKeyRef == 'string') { + v = this.getSchema(schemaKeyRef); + if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"'); + } else { + var schemaObj = this._addSchema(schemaKeyRef); + v = schemaObj.validate || this._compile(schemaObj); + } + + var valid = v(data); + if (v.$async !== true) this.errors = v.errors; + return valid; +} + + +/** + * Create validating function for passed schema. + * @this Ajv + * @param {Object} schema schema object + * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords. + * @return {Function} validating function + */ +function compile(schema, _meta) { + var schemaObj = this._addSchema(schema, undefined, _meta); + return schemaObj.validate || this._compile(schemaObj); +} + + +/** + * Adds schema to the instance. + * @this Ajv + * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored. + * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. + * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead. + * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. + * @return {Ajv} this for method chaining + */ +function addSchema(schema, key, _skipValidation, _meta) { + if (Array.isArray(schema)){ + for (var i=0; i} errors optional array of validation errors, if not passed errors from the instance are used. + * @param {Object} options optional options with properties `separator` and `dataVar`. + * @return {String} human readable string with all errors descriptions + */ +function errorsText(errors, options) { + errors = errors || this.errors; + if (!errors) return 'No errors'; + options = options || {}; + var separator = options.separator === undefined ? ', ' : options.separator; + var dataVar = options.dataVar === undefined ? 'data' : options.dataVar; + + var text = ''; + for (var i=0; i%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,u=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,h=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,d=/^(?:\/(?:[^~/]|~0|~1)*)*$/,p=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,f=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return a.copy(m[e="full"==e?"full":"fast"])}function v(e){var r=e.match(o);if(!r)return!1;var t,a=+r[2],s=+r[3];return 1<=a&&a<=12&&1<=s&&s<=(2!=a||((t=+r[1])%4!=0||t%100==0&&t%400!=0)?i[a]:29)}function y(e,r){var t=e.match(n);if(!t)return!1;var a=t[1],s=t[2],o=t[3];return(a<=23&&s<=59&&o<=59||23==a&&59==s&&60==o)&&(!r||t[5])}(r.exports=m).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":c,url:u,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]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}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:h,"json-pointer":d,"json-pointer-uri-fragment":p,"relative-json-pointer":f},m.full={date:v,time:y,"date-time":function(e){var r=e.split(g);return 2==r.length&&v(r[0])&&y(r[1],!0)},uri:function(e){return P.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z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?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:h,"json-pointer":d,"json-pointer-uri-fragment":p,"relative-json-pointer":f};var g=/t|\s/i;var P=/\/|:/;var E=/[^\\]\\Z/;function w(e){if(E.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":10}],5:[function(e,r,t){"use strict";var R=e("./resolve"),$=e("./util"),j=e("./error_classes"),D=e("fast-json-stable-stringify"),O=e("../dotjs/validate"),I=$.ucs2length,A=e("fast-deep-equal"),k=j.Validation;function C(e,c,u,r){var d=this,p=this._opts,h=[void 0],f={},l=[],t={},m=[],a={},v=[],s=function(e,r,t){var a=L.call(this,e,r,t);return 0<=a?{index:a,compiling:!0}:{index:a=this._compilations.length,compiling:!(this._compilations[a]={schema:e,root:r,baseId:t})}}.call(this,e,c=c||{schema:e,refVal:h,refs:f},r),o=this._compilations[s.index];if(s.compiling)return o.callValidate=P;var y=this._formats,g=this.RULES;try{var i=E(e,c,u,r);o.validate=i;var n=o.callValidate;return n&&(n.schema=i.schema,n.errors=null,n.refs=i.refs,n.refVal=i.refVal,n.root=i.root,n.$async=i.$async,p.sourceCode&&(n.source=i.source)),i}finally{(function(e,r,t){var a=L.call(this,e,r,t);0<=a&&this._compilations.splice(a,1)}).call(this,e,c,r)}function P(){var e=o.validate,r=e.apply(this,arguments);return P.errors=e.errors,r}function E(e,r,t,a){var s=!r||r&&r.schema==e;if(r.schema!=c.schema)return C.call(d,e,r,t,a);var o=!0===e.$async,i=O({isTop:!0,schema:e,isRoot:s,baseId:a,root:r,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:j.MissingRef,RULES:g,validate:O,util:$,resolve:R,resolveRef:w,usePattern:_,useDefault:F,useCustomRule:x,opts:p,formats:y,logger:d.logger,self:d}),i=Q(h,z)+Q(l,N)+Q(m,q)+Q(v,T)+i;p.processCode&&(i=p.processCode(i,e));try{var n=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",i)(d,g,y,c,h,m,v,A,I,k);h[0]=n}catch(e){throw d.logger.error("Error compiling schema, function code:",i),e}return n.schema=e,n.errors=null,n.refs=f,n.refVal=h,n.root=s?n:r,o&&(n.$async=!0),!0===p.sourceCode&&(n.source={code:i,patterns:l,defaults:m}),n}function w(e,r,t){r=R.url(e,r);var a,s,o=f[r];if(void 0!==o)return S(a=h[o],s="refVal["+o+"]");if(!t&&c.refs){var i=c.refs[r];if(void 0!==i)return S(a=c.refVal[i],s=b(r,a))}s=b(r);var n,l=R.call(d,E,c,r);if(void 0!==l||(n=u&&u[r])&&(l=R.inlineRef(n,p.inlineRefs)?n:C.call(d,n,c,u,e)),void 0!==l)return S(h[f[r]]=l,s);delete f[r]}function b(e,r){var t=h.length;return h[t]=r,"refVal"+(f[e]=t)}function S(e,r){return"object"==typeof e||"boolean"==typeof e?{code:r,schema:e,inline:!0}:{code:r,$async:e&&!!e.$async}}function _(e){var r=t[e];return void 0===r&&(r=t[e]=l.length,l[r]=e),"pattern"+r}function F(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return $.toQuotedString(e);case"object":if(null===e)return"null";var r=D(e),t=a[r];return void 0===t&&(t=a[r]=m.length,m[t]=e),"default"+t}}function x(e,r,t,a){if(!1!==d._opts.validateSchema){var s=e.definition.dependencies;if(s&&!s.every(function(e){return Object.prototype.hasOwnProperty.call(t,e)}))throw new Error("parent schema must have all required keywords: "+s.join(","));var o=e.definition.validateSchema;if(o)if(!o(r)){var i="keyword schema is invalid: "+d.errorsText(o.errors);if("log"!=d._opts.validateSchema)throw new Error(i);d.logger.error(i)}}var n,l=e.definition.compile,c=e.definition.inline,u=e.definition.macro;if(l)n=l.call(d,r,t,a);else if(u)n=u.call(d,r,t,a),!1!==p.validateSchema&&d.validateSchema(n,!0);else if(c)n=c.call(d,a,e.keyword,r,t);else if(!(n=e.definition.validate))return;if(void 0===n)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var h=v.length;return{code:"customRule"+h,validate:v[h]=n}}}function L(e,r,t){for(var a=0;a",_=P?">":"<",F=void 0;if(!y&&"number"!=typeof d&&void 0!==d)throw new Error(r+" must be number");if(!b&&void 0!==w&&"number"!=typeof w&&"boolean"!=typeof w)throw new Error(E+" must be number or boolean");b?(o="exclIsNumber"+u,i="' + "+(n="op"+u)+" + '",c+=" var schemaExcl"+u+" = "+(t=e.util.getData(w.$data,h,e.dataPathArr))+"; ",F=E,(l=l||[]).push(c+=" var "+(a="exclusive"+u)+"; var "+(s="exclType"+u)+" = typeof "+(t="schemaExcl"+u)+"; if ("+s+" != 'boolean' && "+s+" != 'undefined' && "+s+" != 'number') { "),c="",!1!==e.createErrors?(c+=" { keyword: '"+(F||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",!1!==e.opts.messages&&(c+=" , message: '"+E+" should be boolean' "),e.opts.verbose&&(c+=" , schema: validate.schema"+p+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "),c+=" } "):c+=" {} ",x=c,c=l.pop(),c+=!e.compositeRule&&m?e.async?" throw new ValidationError(["+x+"]); ":" validate.errors = ["+x+"]; return false; ":" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c+=" } else if ( ",y&&(c+=" ("+g+" !== undefined && typeof "+g+" != 'number') || "),c+=" "+s+" == 'number' ? ( ("+a+" = "+g+" === undefined || "+t+" "+S+"= "+g+") ? "+v+" "+_+"= "+t+" : "+v+" "+_+" "+g+" ) : ( ("+a+" = "+t+" === true) ? "+v+" "+_+"= "+g+" : "+v+" "+_+" "+g+" ) || "+v+" !== "+v+") { var op"+u+" = "+a+" ? '"+S+"' : '"+S+"='; ",void 0===d&&(f=e.errSchemaPath+"/"+(F=E),g=t,y=b)):(i=S,(o="number"==typeof w)&&y?(n="'"+i+"'",c+=" if ( ",y&&(c+=" ("+g+" !== undefined && typeof "+g+" != 'number') || "),c+=" ( "+g+" === undefined || "+w+" "+S+"= "+g+" ? "+v+" "+_+"= "+w+" : "+v+" "+_+" "+g+" ) || "+v+" !== "+v+") { "):(o&&void 0===d?(a=!0,f=e.errSchemaPath+"/"+(F=E),g=w,_+="="):(o&&(g=Math[P?"min":"max"](w,d)),w===(!o||g)?(a=!0,f=e.errSchemaPath+"/"+(F=E),_+="="):(a=!1,i+="=")),n="'"+i+"'",c+=" if ( ",y&&(c+=" ("+g+" !== undefined && typeof "+g+" != 'number') || "),c+=" "+v+" "+_+" "+g+" || "+v+" !== "+v+") { ")),F=F||r,(l=l||[]).push(c),c="",!1!==e.createErrors?(c+=" { keyword: '"+(F||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { comparison: "+n+", limit: "+g+", exclusive: "+a+" } ",!1!==e.opts.messages&&(c+=" , message: 'should be "+i+" ",c+=y?"' + "+g:g+"'"),e.opts.verbose&&(c+=" , schema: ",c+=y?"validate.schema"+p:""+d,c+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "),c+=" } "):c+=" {} ";var x=c;return c=l.pop(),c+=!e.compositeRule&&m?e.async?" throw new ValidationError(["+x+"]); ":" validate.errors = ["+x+"]; return false; ":" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c+=" } ",m&&(c+=" else { "),c}},{}],14:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u=e.opts.$data&&o&&o.$data,h=u?(t+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ","schema"+a):o;if(!u&&"number"!=typeof o)throw new Error(r+" must be number");t+="if ( ",u&&(t+=" ("+h+" !== undefined && typeof "+h+" != 'number') || ");var d=r,p=p||[];p.push(t+=" "+c+".length "+("maxItems"==r?">":"<")+" "+h+") { "),t="",!1!==e.createErrors?(t+=" { keyword: '"+(d||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { limit: "+h+" } ",!1!==e.opts.messages&&(t+=" , message: 'should NOT have ",t+="maxItems"==r?"more":"fewer",t+=" than ",t+=u?"' + "+h+" + '":""+o,t+=" items' "),e.opts.verbose&&(t+=" , schema: ",t+=u?"validate.schema"+i:""+o,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var f=t,t=p.pop();return t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+f+"]); ":" validate.errors = ["+f+"]; return false; ":" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",l&&(t+=" else { "),t}},{}],15:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u=e.opts.$data&&o&&o.$data,h=u?(t+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ","schema"+a):o;if(!u&&"number"!=typeof o)throw new Error(r+" must be number");t+="if ( ",u&&(t+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),t+=!1===e.opts.unicode?" "+c+".length ":" ucs2length("+c+") ";var d=r,p=p||[];p.push(t+=" "+("maxLength"==r?">":"<")+" "+h+") { "),t="",!1!==e.createErrors?(t+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { limit: "+h+" } ",!1!==e.opts.messages&&(t+=" , message: 'should NOT be ",t+="maxLength"==r?"longer":"shorter",t+=" than ",t+=u?"' + "+h+" + '":""+o,t+=" characters' "),e.opts.verbose&&(t+=" , schema: ",t+=u?"validate.schema"+i:""+o,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var f=t,t=p.pop();return t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+f+"]); ":" validate.errors = ["+f+"]; return false; ":" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",l&&(t+=" else { "),t}},{}],16:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u=e.opts.$data&&o&&o.$data,h=u?(t+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ","schema"+a):o;if(!u&&"number"!=typeof o)throw new Error(r+" must be number");t+="if ( ",u&&(t+=" ("+h+" !== undefined && typeof "+h+" != 'number') || ");var d=r,p=p||[];p.push(t+=" Object.keys("+c+").length "+("maxProperties"==r?">":"<")+" "+h+") { "),t="",!1!==e.createErrors?(t+=" { keyword: '"+(d||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { limit: "+h+" } ",!1!==e.opts.messages&&(t+=" , message: 'should NOT have ",t+="maxProperties"==r?"more":"fewer",t+=" than ",t+=u?"' + "+h+" + '":""+o,t+=" properties' "),e.opts.verbose&&(t+=" , schema: ",t+=u?"validate.schema"+i:""+o,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var f=t,t=p.pop();return t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+f+"]); ":" validate.errors = ["+f+"]; return false; ":" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",l&&(t+=" else { "),t}},{}],17:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.schema[r],s=e.schemaPath+e.util.getProperty(r),o=e.errSchemaPath+"/"+r,i=!e.opts.allErrors,n=e.util.copy(e),l="";n.level++;var c="valid"+n.level,u=n.baseId,h=!0,d=a;if(d)for(var p,f=-1,m=d.length-1;f "+_+") { ",x=c+"["+_+"]",d.schema=$,d.schemaPath=i+"["+_+"]",d.errSchemaPath=n+"/"+_,d.errorPath=e.util.getPathExpr(e.errorPath,_,e.opts.jsonPointers,!0),d.dataPathArr[v]=_,R=e.validate(d),d.baseId=g,e.util.varOccurences(R,y)<2?t+=" "+e.util.varReplace(R,y,x)+" ":t+=" var "+y+" = "+x+"; "+R+" ",t+=" } ",l&&(t+=" if ("+f+") { ",p+="}"))}"object"==typeof b&&(e.opts.strictKeywords?"object"==typeof b&&0 "+o.length+") { for (var "+m+" = "+o.length+"; "+m+" < "+c+".length; "+m+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0),x=c+"["+m+"]",d.dataPathArr[v]=m,R=e.validate(d),d.baseId=g,e.util.varOccurences(R,y)<2?t+=" "+e.util.varReplace(R,y,x)+" ":t+=" var "+y+" = "+x+"; "+R+" ",l&&(t+=" if (!"+f+") break; "),t+=" } } ",l&&(t+=" if ("+f+") { ",p+="}"))}else{(e.opts.strictKeywords?"object"==typeof o&&0 1e-"+e.opts.multipleOfPrecision+" ":" division"+a+" !== parseInt(division"+a+") ",t+=" ) ",u&&(t+=" ) ");var d=d||[];d.push(t+=" ) { "),t="",!1!==e.createErrors?(t+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { multipleOf: "+h+" } ",!1!==e.opts.messages&&(t+=" , message: 'should be multiple of ",t+=u?"' + "+h:h+"'"),e.opts.verbose&&(t+=" , schema: ",t+=u?"validate.schema"+i:""+o,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var p=t,t=d.pop();return t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+p+"]); ":" validate.errors = ["+p+"]; return false; ":" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",l&&(t+=" else { "),t}},{}],30:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="errs__"+a,h=e.util.copy(e);h.level++;var d,p,f,m,v="valid"+h.level;return(e.opts.strictKeywords?"object"==typeof o&&0 1) { ",t=e.schema.items&&e.schema.items.type,a=Array.isArray(t),!t||"object"==t||"array"==t||a&&(0<=t.indexOf("object")||0<=t.indexOf("array"))?i+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+f+" = false; break outer; } } } ":(i+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ",i+=" if ("+e.util["checkDataType"+(a?"s":"")](t,"item",e.opts.strictNumbers,!0)+") continue; ",a&&(i+=" if (typeof item == 'string') item = '\"' + item; "),i+=" if (typeof itemIndices[item] == 'number') { "+f+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "),i+=" } ",m&&(i+=" } "),(s=s||[]).push(i+=" if (!"+f+") { "),i="",!1!==e.createErrors?(i+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(i+=" , schema: ",i+=m?"validate.schema"+u:""+c,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ",o=i,i=s.pop(),i+=!e.compositeRule&&d?e.async?" throw new ValidationError(["+o+"]); ":" validate.errors = ["+o+"]; return false; ":" var err = "+o+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",d&&(i+=" else { ")):d&&(i+=" if (true) { "),i}},{}],38:[function(e,r,t){"use strict";r.exports=function(a,e){var r="",t=!0===a.schema.$async,s=a.util.schemaHasRulesExcept(a.schema,a.RULES.all,"$ref"),o=a.self._getId(a.schema);if(a.opts.strictKeywords){var i=a.util.schemaUnknownRules(a.schema,a.RULES.keywords);if(i){var n="unknown keyword: "+i;if("log"!==a.opts.strictKeywords)throw new Error(n);a.logger.warn(n)}}if(a.isTop&&(r+=" var validate = ",t&&(a.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(a.opts.sourceCode||a.opts.processCode)&&(r+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof a.schema||!s&&!a.schema.$ref){var l=a.level,c=a.dataLevel,u=a.schema[e="false schema"],h=a.schemaPath+a.util.getProperty(e),d=a.errSchemaPath+"/"+e,p=!a.opts.allErrors,f="data"+(c||""),m="valid"+l;return!1===a.schema?(a.isTop?p=!0:r+=" var "+m+" = false; ",(U=U||[]).push(r),r="",!1!==a.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(d)+" , params: {} ",!1!==a.opts.messages&&(r+=" , message: 'boolean schema is false' "),a.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+a.schemaPath+" , data: "+f+" "),r+=" } "):r+=" {} ",D=r,r=U.pop(),r+=!a.compositeRule&&p?a.async?" throw new ValidationError(["+D+"]); ":" validate.errors = ["+D+"]; return false; ":" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "):r+=a.isTop?t?" return data; ":" validate.errors = null; return true; ":" var "+m+" = true; ",a.isTop&&(r+=" }; return validate; "),r}if(a.isTop){var v=a.isTop,l=a.level=0,c=a.dataLevel=0,f="data";if(a.rootId=a.resolve.fullPath(a.self._getId(a.root.schema)),a.baseId=a.baseId||a.rootId,delete a.isTop,a.dataPathArr=[""],void 0!==a.schema.default&&a.opts.useDefaults&&a.opts.strictDefaults){var y="default is ignored in the schema root";if("log"!==a.opts.strictDefaults)throw new Error(y);a.logger.warn(y)}r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{l=a.level,f="data"+((c=a.dataLevel)||"");if(o&&(a.baseId=a.resolve.url(a.baseId,o)),t&&!a.async)throw new Error("async schema in sync schema");r+=" var errs_"+l+" = errors;"}var g,m="valid"+l,p=!a.opts.allErrors,P="",E="",w=a.schema.type,b=Array.isArray(w);if(w&&a.opts.nullable&&!0===a.schema.nullable&&(b?-1==w.indexOf("null")&&(w=w.concat("null")):"null"!=w&&(w=[w,"null"],b=!0)),b&&1==w.length&&(w=w[0],b=!1),a.schema.$ref&&s){if("fail"==a.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+a.errSchemaPath+'" (see option extendRefs)');!0!==a.opts.extendRefs&&(s=!1,a.logger.warn('$ref: keywords ignored in schema at path "'+a.errSchemaPath+'"'))}if(a.schema.$comment&&a.opts.$comment&&(r+=" "+a.RULES.all.$comment.code(a,"$comment")),w){a.opts.coerceTypes&&(g=a.util.coerceToTypes(a.opts.coerceTypes,w));var S=a.RULES.types[w];if(g||b||!0===S||S&&!Z(S)){h=a.schemaPath+".type",d=a.errSchemaPath+"/type",h=a.schemaPath+".type",d=a.errSchemaPath+"/type";if(r+=" if ("+a.util[b?"checkDataTypes":"checkDataType"](w,f,a.opts.strictNumbers,!0)+") { ",g){var _="dataType"+l,F="coerced"+l;r+=" var "+_+" = typeof "+f+"; var "+F+" = undefined; ","array"==a.opts.coerceTypes&&(r+=" if ("+_+" == 'object' && Array.isArray("+f+") && "+f+".length == 1) { "+f+" = "+f+"[0]; "+_+" = typeof "+f+"; if ("+a.util.checkDataType(a.schema.type,f,a.opts.strictNumbers)+") "+F+" = "+f+"; } "),r+=" if ("+F+" !== undefined) ; ";var x=g;if(x)for(var R,$=-1,j=x.length-1;$= 0x80 (not a basic code point)","invalid-input":"Invalid input"},k=Math.floor,C=String.fromCharCode;function L(e){throw new RangeError(i[e])}function n(e,r){var t=e.split("@"),a="";return 1>1,e+=k(e/r);455k((A-a)/h))&&L("overflow"),a+=p*h;var f=d<=o?1:o+26<=d?26:d-o;if(pk(A/m)&&L("overflow"),h*=m}var v=r.length+1,o=z(a-u,v,0==u);k(a/v)>A-s&&L("overflow"),s+=k(a/v),a%=v,r.splice(a++,0,s)}return String.fromCodePoint.apply(String,r)}function c(e){var r=[],t=(e=N(e)).length,a=128,s=0,o=72,i=!0,n=!1,l=void 0;try{for(var c,u=e[Symbol.iterator]();!(i=(c=u.next()).done);i=!0){var h=c.value;h<128&&r.push(C(h))}}catch(e){n=!0,l=e}finally{try{!i&&u.return&&u.return()}finally{if(n)throw l}}var d=r.length,p=d;for(d&&r.push("-");pk((A-s)/w)&&L("overflow"),s+=(f-a)*w,a=f;var b=!0,S=!1,_=void 0;try{for(var F,x=e[Symbol.iterator]();!(b=(F=x.next()).done);b=!0){var R=F.value;if(RA&&L("overflow"),R==a){for(var $=s,j=36;;j+=36){var D=j<=o?1:o+26<=j?26:j-o;if($>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function p(e){for(var r="",t=0,a=e.length;tA-Z\\x5E-\\x7E]",'[\\"\\\\]')),Y=new RegExp(M,"g"),W=new RegExp("(?:(?:%[EFef][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f])|(?:%[89A-Fa-f][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f])|(?:%[0-9A-Fa-f][0-9A-Fa-f]))","g"),X=new RegExp(J("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',G),"g"),ee=new RegExp(J("[^]",M,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),re=ee;function te(e){var r=p(e);return r.match(Y)?r:e}var ae={scheme:"mailto",parse:function(e,r){var t=e,a=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var s=!1,o={},i=t.query.split("&"),n=0,l=i.length;n); + + message: string; + errors: Array; + ajv: true; + validation: true; + } + + class MissingRefError extends Error { + constructor(baseId: string, ref: string, message?: string); + static message: (baseId: string, ref: string) => string; + + message: string; + missingRef: string; + missingSchema: string; + } +} + +declare namespace ajv { + type ValidationError = AjvErrors.ValidationError; + + type MissingRefError = AjvErrors.MissingRefError; + + interface Ajv { + /** + * Validate data using schema + * Schema will be compiled and cached (using serialized JSON as key, [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize by default). + * @param {string|object|Boolean} schemaKeyRef key, ref or schema object + * @param {Any} data to be validated + * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`). + */ + validate(schemaKeyRef: object | string | boolean, data: any): boolean | PromiseLike; + /** + * Create validating function for passed schema. + * @param {object|Boolean} schema schema object + * @return {Function} validating function + */ + compile(schema: object | boolean): ValidateFunction; + /** + * Creates validating function for passed schema with asynchronous loading of missing schemas. + * `loadSchema` option should be a function that accepts schema uri and node-style callback. + * @this Ajv + * @param {object|Boolean} schema schema object + * @param {Boolean} meta optional true to compile meta-schema; this parameter can be skipped + * @param {Function} callback optional node-style callback, it is always called with 2 parameters: error (or null) and validating function. + * @return {PromiseLike} validating function + */ + compileAsync(schema: object | boolean, meta?: Boolean, callback?: (err: Error, validate: ValidateFunction) => any): PromiseLike; + /** + * Adds schema to the instance. + * @param {object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored. + * @param {string} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. + * @return {Ajv} this for method chaining + */ + addSchema(schema: Array | object, key?: string): Ajv; + /** + * Add schema that will be used to validate other schemas + * options in META_IGNORE_OPTIONS are alway set to false + * @param {object} schema schema object + * @param {string} key optional schema key + * @return {Ajv} this for method chaining + */ + addMetaSchema(schema: object, key?: string): Ajv; + /** + * Validate schema + * @param {object|Boolean} schema schema to validate + * @return {Boolean} true if schema is valid + */ + validateSchema(schema: object | boolean): boolean; + /** + * Get compiled schema from the instance by `key` or `ref`. + * @param {string} keyRef `key` that was passed to `addSchema` or full schema reference (`schema.id` or resolved id). + * @return {Function} schema validating function (with property `schema`). Returns undefined if keyRef can't be resolved to an existing schema. + */ + getSchema(keyRef: string): ValidateFunction | undefined; + /** + * Remove cached schema(s). + * If no parameter is passed all schemas but meta-schemas are removed. + * If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. + * Even if schema is referenced by other schemas it still can be removed as other schemas have local references. + * @param {string|object|RegExp|Boolean} schemaKeyRef key, ref, pattern to match key/ref or schema object + * @return {Ajv} this for method chaining + */ + removeSchema(schemaKeyRef?: object | string | RegExp | boolean): Ajv; + /** + * Add custom format + * @param {string} name format name + * @param {string|RegExp|Function} format string is converted to RegExp; function should return boolean (true when valid) + * @return {Ajv} this for method chaining + */ + addFormat(name: string, format: FormatValidator | FormatDefinition): Ajv; + /** + * Define custom keyword + * @this Ajv + * @param {string} keyword custom keyword, should be a valid identifier, should be different from all standard, custom and macro keywords. + * @param {object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`. + * @return {Ajv} this for method chaining + */ + addKeyword(keyword: string, definition: KeywordDefinition): Ajv; + /** + * Get keyword definition + * @this Ajv + * @param {string} keyword pre-defined or custom keyword. + * @return {object|Boolean} custom keyword definition, `true` if it is a predefined keyword, `false` otherwise. + */ + getKeyword(keyword: string): object | boolean; + /** + * Remove keyword + * @this Ajv + * @param {string} keyword pre-defined or custom keyword. + * @return {Ajv} this for method chaining + */ + removeKeyword(keyword: string): Ajv; + /** + * Validate keyword + * @this Ajv + * @param {object} definition keyword definition object + * @param {boolean} throwError true to throw exception if definition is invalid + * @return {boolean} validation result + */ + validateKeyword(definition: KeywordDefinition, throwError: boolean): boolean; + /** + * Convert array of error message objects to string + * @param {Array} errors optional array of validation errors, if not passed errors from the instance are used. + * @param {object} options optional options with properties `separator` and `dataVar`. + * @return {string} human readable string with all errors descriptions + */ + errorsText(errors?: Array | null, options?: ErrorsTextOptions): string; + errors?: Array | null; + } + + interface CustomLogger { + log(...args: any[]): any; + warn(...args: any[]): any; + error(...args: any[]): any; + } + + interface ValidateFunction { + ( + data: any, + dataPath?: string, + parentData?: object | Array, + parentDataProperty?: string | number, + rootData?: object | Array + ): boolean | PromiseLike; + schema?: object | boolean; + errors?: null | Array; + refs?: object; + refVal?: Array; + root?: ValidateFunction | object; + $async?: true; + source?: object; + } + + interface Options { + $data?: boolean; + allErrors?: boolean; + verbose?: boolean; + jsonPointers?: boolean; + uniqueItems?: boolean; + unicode?: boolean; + format?: false | string; + formats?: object; + keywords?: object; + unknownFormats?: true | string[] | 'ignore'; + schemas?: Array | object; + schemaId?: '$id' | 'id' | 'auto'; + missingRefs?: true | 'ignore' | 'fail'; + extendRefs?: true | 'ignore' | 'fail'; + loadSchema?: (uri: string, cb?: (err: Error, schema: object) => void) => PromiseLike; + removeAdditional?: boolean | 'all' | 'failing'; + useDefaults?: boolean | 'empty' | 'shared'; + coerceTypes?: boolean | 'array'; + strictDefaults?: boolean | 'log'; + strictKeywords?: boolean | 'log'; + strictNumbers?: boolean; + async?: boolean | string; + transpile?: string | ((code: string) => string); + meta?: boolean | object; + validateSchema?: boolean | 'log'; + addUsedSchema?: boolean; + inlineRefs?: boolean | number; + passContext?: boolean; + loopRequired?: number; + ownProperties?: boolean; + multipleOfPrecision?: boolean | number; + errorDataPath?: string, + messages?: boolean; + sourceCode?: boolean; + processCode?: (code: string, schema: object) => string; + cache?: object; + logger?: CustomLogger | false; + nullable?: boolean; + serialize?: ((schema: object | boolean) => any) | false; + } + + type FormatValidator = string | RegExp | ((data: string) => boolean | PromiseLike); + type NumberFormatValidator = ((data: number) => boolean | PromiseLike); + + interface NumberFormatDefinition { + type: "number", + validate: NumberFormatValidator; + compare?: (data1: number, data2: number) => number; + async?: boolean; + } + + interface StringFormatDefinition { + type?: "string", + validate: FormatValidator; + compare?: (data1: string, data2: string) => number; + async?: boolean; + } + + type FormatDefinition = NumberFormatDefinition | StringFormatDefinition; + + interface KeywordDefinition { + type?: string | Array; + async?: boolean; + $data?: boolean; + errors?: boolean | string; + metaSchema?: object; + // schema: false makes validate not to expect schema (ValidateFunction) + schema?: boolean; + statements?: boolean; + dependencies?: Array; + modifying?: boolean; + valid?: boolean; + // one and only one of the following properties should be present + validate?: SchemaValidateFunction | ValidateFunction; + compile?: (schema: any, parentSchema: object, it: CompilationContext) => ValidateFunction; + macro?: (schema: any, parentSchema: object, it: CompilationContext) => object | boolean; + inline?: (it: CompilationContext, keyword: string, schema: any, parentSchema: object) => string; + } + + interface CompilationContext { + level: number; + dataLevel: number; + dataPathArr: string[]; + schema: any; + schemaPath: string; + baseId: string; + async: boolean; + opts: Options; + formats: { + [index: string]: FormatDefinition | undefined; + }; + keywords: { + [index: string]: KeywordDefinition | undefined; + }; + compositeRule: boolean; + validate: (schema: object) => boolean; + util: { + copy(obj: any, target?: any): any; + toHash(source: string[]): { [index: string]: true | undefined }; + equal(obj: any, target: any): boolean; + getProperty(str: string): string; + schemaHasRules(schema: object, rules: any): string; + escapeQuotes(str: string): string; + toQuotedString(str: string): string; + getData(jsonPointer: string, dataLevel: number, paths: string[]): string; + escapeJsonPointer(str: string): string; + unescapeJsonPointer(str: string): string; + escapeFragment(str: string): string; + unescapeFragment(str: string): string; + }; + self: Ajv; + } + + interface SchemaValidateFunction { + ( + schema: any, + data: any, + parentSchema?: object, + dataPath?: string, + parentData?: object | Array, + parentDataProperty?: string | number, + rootData?: object | Array + ): boolean | PromiseLike; + errors?: Array; + } + + interface ErrorsTextOptions { + separator?: string; + dataVar?: string; + } + + interface ErrorObject { + keyword: string; + dataPath: string; + schemaPath: string; + params: ErrorParameters; + // Added to validation errors of propertyNames keyword schema + propertyName?: string; + // Excluded if messages set to false. + message?: string; + // These are added with the `verbose` option. + schema?: any; + parentSchema?: object; + data?: any; + } + + type ErrorParameters = RefParams | LimitParams | AdditionalPropertiesParams | + DependenciesParams | FormatParams | ComparisonParams | + MultipleOfParams | PatternParams | RequiredParams | + TypeParams | UniqueItemsParams | CustomParams | + PatternRequiredParams | PropertyNamesParams | + IfParams | SwitchParams | NoParams | EnumParams; + + interface RefParams { + ref: string; + } + + interface LimitParams { + limit: number; + } + + interface AdditionalPropertiesParams { + additionalProperty: string; + } + + interface DependenciesParams { + property: string; + missingProperty: string; + depsCount: number; + deps: string; + } + + interface FormatParams { + format: string + } + + interface ComparisonParams { + comparison: string; + limit: number | string; + exclusive: boolean; + } + + interface MultipleOfParams { + multipleOf: number; + } + + interface PatternParams { + pattern: string; + } + + interface RequiredParams { + missingProperty: string; + } + + interface TypeParams { + type: string; + } + + interface UniqueItemsParams { + i: number; + j: number; + } + + interface CustomParams { + keyword: string; + } + + interface PatternRequiredParams { + missingPattern: string; + } + + interface PropertyNamesParams { + propertyName: string; + } + + interface IfParams { + failingKeyword: string; + } + + interface SwitchParams { + caseIndex: number; + } + + interface NoParams { } + + interface EnumParams { + allowedValues: Array; + } +} + +export = ajv; diff --git a/node_modules/ajv/lib/ajv.js b/node_modules/ajv/lib/ajv.js new file mode 100644 index 000000000..06a45b650 --- /dev/null +++ b/node_modules/ajv/lib/ajv.js @@ -0,0 +1,506 @@ +'use strict'; + +var compileSchema = require('./compile') + , resolve = require('./compile/resolve') + , Cache = require('./cache') + , SchemaObject = require('./compile/schema_obj') + , stableStringify = require('fast-json-stable-stringify') + , formats = require('./compile/formats') + , rules = require('./compile/rules') + , $dataMetaSchema = require('./data') + , util = require('./compile/util'); + +module.exports = Ajv; + +Ajv.prototype.validate = validate; +Ajv.prototype.compile = compile; +Ajv.prototype.addSchema = addSchema; +Ajv.prototype.addMetaSchema = addMetaSchema; +Ajv.prototype.validateSchema = validateSchema; +Ajv.prototype.getSchema = getSchema; +Ajv.prototype.removeSchema = removeSchema; +Ajv.prototype.addFormat = addFormat; +Ajv.prototype.errorsText = errorsText; + +Ajv.prototype._addSchema = _addSchema; +Ajv.prototype._compile = _compile; + +Ajv.prototype.compileAsync = require('./compile/async'); +var customKeyword = require('./keyword'); +Ajv.prototype.addKeyword = customKeyword.add; +Ajv.prototype.getKeyword = customKeyword.get; +Ajv.prototype.removeKeyword = customKeyword.remove; +Ajv.prototype.validateKeyword = customKeyword.validate; + +var errorClasses = require('./compile/error_classes'); +Ajv.ValidationError = errorClasses.Validation; +Ajv.MissingRefError = errorClasses.MissingRef; +Ajv.$dataMetaSchema = $dataMetaSchema; + +var META_SCHEMA_ID = 'http://json-schema.org/draft-07/schema'; + +var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes', 'strictDefaults' ]; +var META_SUPPORT_DATA = ['/properties']; + +/** + * Creates validator instance. + * Usage: `Ajv(opts)` + * @param {Object} opts optional options + * @return {Object} ajv instance + */ +function Ajv(opts) { + if (!(this instanceof Ajv)) return new Ajv(opts); + opts = this._opts = util.copy(opts) || {}; + setLogger(this); + this._schemas = {}; + this._refs = {}; + this._fragments = {}; + this._formats = formats(opts.format); + + this._cache = opts.cache || new Cache; + this._loadingSchemas = {}; + this._compilations = []; + this.RULES = rules(); + this._getId = chooseGetId(opts); + + opts.loopRequired = opts.loopRequired || Infinity; + if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true; + if (opts.serialize === undefined) opts.serialize = stableStringify; + this._metaOpts = getMetaSchemaOptions(this); + + if (opts.formats) addInitialFormats(this); + if (opts.keywords) addInitialKeywords(this); + addDefaultMetaSchema(this); + if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta); + if (opts.nullable) this.addKeyword('nullable', {metaSchema: {type: 'boolean'}}); + addInitialSchemas(this); +} + + + +/** + * Validate data using schema + * Schema will be compiled and cached (using serialized JSON as key. [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize. + * @this Ajv + * @param {String|Object} schemaKeyRef key, ref or schema object + * @param {Any} data to be validated + * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`). + */ +function validate(schemaKeyRef, data) { + var v; + if (typeof schemaKeyRef == 'string') { + v = this.getSchema(schemaKeyRef); + if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"'); + } else { + var schemaObj = this._addSchema(schemaKeyRef); + v = schemaObj.validate || this._compile(schemaObj); + } + + var valid = v(data); + if (v.$async !== true) this.errors = v.errors; + return valid; +} + + +/** + * Create validating function for passed schema. + * @this Ajv + * @param {Object} schema schema object + * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords. + * @return {Function} validating function + */ +function compile(schema, _meta) { + var schemaObj = this._addSchema(schema, undefined, _meta); + return schemaObj.validate || this._compile(schemaObj); +} + + +/** + * Adds schema to the instance. + * @this Ajv + * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored. + * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. + * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead. + * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. + * @return {Ajv} this for method chaining + */ +function addSchema(schema, key, _skipValidation, _meta) { + if (Array.isArray(schema)){ + for (var i=0; i} errors optional array of validation errors, if not passed errors from the instance are used. + * @param {Object} options optional options with properties `separator` and `dataVar`. + * @return {String} human readable string with all errors descriptions + */ +function errorsText(errors, options) { + errors = errors || this.errors; + if (!errors) return 'No errors'; + options = options || {}; + var separator = options.separator === undefined ? ', ' : options.separator; + var dataVar = options.dataVar === undefined ? 'data' : options.dataVar; + + var text = ''; + for (var i=0; i%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i; +// For the source: https://gist.github.com/dperini/729294 +// For test cases: https://mathiasbynens.be/demo/url-regex +// @todo Delete current URL in favour of the commented out URL rule when this issue is fixed https://github.com/eslint/eslint/issues/7983. +// var URL = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu; +var URL = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i; +var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i; +var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/; +var JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i; +var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/; + + +module.exports = formats; + +function formats(mode) { + mode = mode == 'full' ? 'full' : 'fast'; + return util.copy(formats[mode]); +} + + +formats.fast = { + // date: http://tools.ietf.org/html/rfc3339#section-5.6 + date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/, + // date-time: http://tools.ietf.org/html/rfc3339#section-5.6 + time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, + 'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, + // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js + uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i, + 'uri-reference': /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, + 'uri-template': URITEMPLATE, + url: URL, + // email (sources from jsen validator): + // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363 + // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation') + email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i, + hostname: HOSTNAME, + // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html + ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, + // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, + regex: regex, + // uuid: http://tools.ietf.org/html/rfc4122 + uuid: UUID, + // JSON-pointer: https://tools.ietf.org/html/rfc6901 + // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A + 'json-pointer': JSON_POINTER, + 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT, + // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00 + 'relative-json-pointer': RELATIVE_JSON_POINTER +}; + + +formats.full = { + date: date, + time: time, + 'date-time': date_time, + uri: uri, + 'uri-reference': URIREF, + 'uri-template': URITEMPLATE, + url: URL, + email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, + hostname: HOSTNAME, + ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, + ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, + regex: regex, + uuid: UUID, + 'json-pointer': JSON_POINTER, + 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT, + 'relative-json-pointer': RELATIVE_JSON_POINTER +}; + + +function isLeapYear(year) { + // https://tools.ietf.org/html/rfc3339#appendix-C + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); +} + + +function date(str) { + // full-date from http://tools.ietf.org/html/rfc3339#section-5.6 + var matches = str.match(DATE); + if (!matches) return false; + + var year = +matches[1]; + var month = +matches[2]; + var day = +matches[3]; + + return month >= 1 && month <= 12 && day >= 1 && + day <= (month == 2 && isLeapYear(year) ? 29 : DAYS[month]); +} + + +function time(str, full) { + var matches = str.match(TIME); + if (!matches) return false; + + var hour = matches[1]; + var minute = matches[2]; + var second = matches[3]; + var timeZone = matches[5]; + return ((hour <= 23 && minute <= 59 && second <= 59) || + (hour == 23 && minute == 59 && second == 60)) && + (!full || timeZone); +} + + +var DATE_TIME_SEPARATOR = /t|\s/i; +function date_time(str) { + // http://tools.ietf.org/html/rfc3339#section-5.6 + var dateTime = str.split(DATE_TIME_SEPARATOR); + return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true); +} + + +var NOT_URI_FRAGMENT = /\/|:/; +function uri(str) { + // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "." + return NOT_URI_FRAGMENT.test(str) && URI.test(str); +} + + +var Z_ANCHOR = /[^\\]\\Z/; +function regex(str) { + if (Z_ANCHOR.test(str)) return false; + try { + new RegExp(str); + return true; + } catch(e) { + return false; + } +} diff --git a/node_modules/ajv/lib/compile/index.js b/node_modules/ajv/lib/compile/index.js new file mode 100644 index 000000000..97518c424 --- /dev/null +++ b/node_modules/ajv/lib/compile/index.js @@ -0,0 +1,387 @@ +'use strict'; + +var resolve = require('./resolve') + , util = require('./util') + , errorClasses = require('./error_classes') + , stableStringify = require('fast-json-stable-stringify'); + +var validateGenerator = require('../dotjs/validate'); + +/** + * Functions below are used inside compiled validations function + */ + +var ucs2length = util.ucs2length; +var equal = require('fast-deep-equal'); + +// this error is thrown by async schemas to return validation errors via exception +var ValidationError = errorClasses.Validation; + +module.exports = compile; + + +/** + * Compiles schema to validation function + * @this Ajv + * @param {Object} schema schema object + * @param {Object} root object with information about the root schema for this schema + * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution + * @param {String} baseId base ID for IDs in the schema + * @return {Function} validation function + */ +function compile(schema, root, localRefs, baseId) { + /* jshint validthis: true, evil: true */ + /* eslint no-shadow: 0 */ + var self = this + , opts = this._opts + , refVal = [ undefined ] + , refs = {} + , patterns = [] + , patternsHash = {} + , defaults = [] + , defaultsHash = {} + , customRules = []; + + root = root || { schema: schema, refVal: refVal, refs: refs }; + + var c = checkCompiling.call(this, schema, root, baseId); + var compilation = this._compilations[c.index]; + if (c.compiling) return (compilation.callValidate = callValidate); + + var formats = this._formats; + var RULES = this.RULES; + + try { + var v = localCompile(schema, root, localRefs, baseId); + compilation.validate = v; + var cv = compilation.callValidate; + if (cv) { + cv.schema = v.schema; + cv.errors = null; + cv.refs = v.refs; + cv.refVal = v.refVal; + cv.root = v.root; + cv.$async = v.$async; + if (opts.sourceCode) cv.source = v.source; + } + return v; + } finally { + endCompiling.call(this, schema, root, baseId); + } + + /* @this {*} - custom context, see passContext option */ + function callValidate() { + /* jshint validthis: true */ + var validate = compilation.validate; + var result = validate.apply(this, arguments); + callValidate.errors = validate.errors; + return result; + } + + function localCompile(_schema, _root, localRefs, baseId) { + var isRoot = !_root || (_root && _root.schema == _schema); + if (_root.schema != root.schema) + return compile.call(self, _schema, _root, localRefs, baseId); + + var $async = _schema.$async === true; + + var sourceCode = validateGenerator({ + isTop: true, + schema: _schema, + isRoot: isRoot, + baseId: baseId, + root: _root, + schemaPath: '', + errSchemaPath: '#', + errorPath: '""', + MissingRefError: errorClasses.MissingRef, + RULES: RULES, + validate: validateGenerator, + util: util, + resolve: resolve, + resolveRef: resolveRef, + usePattern: usePattern, + useDefault: useDefault, + useCustomRule: useCustomRule, + opts: opts, + formats: formats, + logger: self.logger, + self: self + }); + + sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode) + + vars(defaults, defaultCode) + vars(customRules, customRuleCode) + + sourceCode; + + if (opts.processCode) sourceCode = opts.processCode(sourceCode, _schema); + // console.log('\n\n\n *** \n', JSON.stringify(sourceCode)); + var validate; + try { + var makeValidate = new Function( + 'self', + 'RULES', + 'formats', + 'root', + 'refVal', + 'defaults', + 'customRules', + 'equal', + 'ucs2length', + 'ValidationError', + sourceCode + ); + + validate = makeValidate( + self, + RULES, + formats, + root, + refVal, + defaults, + customRules, + equal, + ucs2length, + ValidationError + ); + + refVal[0] = validate; + } catch(e) { + self.logger.error('Error compiling schema, function code:', sourceCode); + throw e; + } + + validate.schema = _schema; + validate.errors = null; + validate.refs = refs; + validate.refVal = refVal; + validate.root = isRoot ? validate : _root; + if ($async) validate.$async = true; + if (opts.sourceCode === true) { + validate.source = { + code: sourceCode, + patterns: patterns, + defaults: defaults + }; + } + + return validate; + } + + function resolveRef(baseId, ref, isRoot) { + ref = resolve.url(baseId, ref); + var refIndex = refs[ref]; + var _refVal, refCode; + if (refIndex !== undefined) { + _refVal = refVal[refIndex]; + refCode = 'refVal[' + refIndex + ']'; + return resolvedRef(_refVal, refCode); + } + if (!isRoot && root.refs) { + var rootRefId = root.refs[ref]; + if (rootRefId !== undefined) { + _refVal = root.refVal[rootRefId]; + refCode = addLocalRef(ref, _refVal); + return resolvedRef(_refVal, refCode); + } + } + + refCode = addLocalRef(ref); + var v = resolve.call(self, localCompile, root, ref); + if (v === undefined) { + var localSchema = localRefs && localRefs[ref]; + if (localSchema) { + v = resolve.inlineRef(localSchema, opts.inlineRefs) + ? localSchema + : compile.call(self, localSchema, root, localRefs, baseId); + } + } + + if (v === undefined) { + removeLocalRef(ref); + } else { + replaceLocalRef(ref, v); + return resolvedRef(v, refCode); + } + } + + function addLocalRef(ref, v) { + var refId = refVal.length; + refVal[refId] = v; + refs[ref] = refId; + return 'refVal' + refId; + } + + function removeLocalRef(ref) { + delete refs[ref]; + } + + function replaceLocalRef(ref, v) { + var refId = refs[ref]; + refVal[refId] = v; + } + + function resolvedRef(refVal, code) { + return typeof refVal == 'object' || typeof refVal == 'boolean' + ? { code: code, schema: refVal, inline: true } + : { code: code, $async: refVal && !!refVal.$async }; + } + + function usePattern(regexStr) { + var index = patternsHash[regexStr]; + if (index === undefined) { + index = patternsHash[regexStr] = patterns.length; + patterns[index] = regexStr; + } + return 'pattern' + index; + } + + function useDefault(value) { + switch (typeof value) { + case 'boolean': + case 'number': + return '' + value; + case 'string': + return util.toQuotedString(value); + case 'object': + if (value === null) return 'null'; + var valueStr = stableStringify(value); + var index = defaultsHash[valueStr]; + if (index === undefined) { + index = defaultsHash[valueStr] = defaults.length; + defaults[index] = value; + } + return 'default' + index; + } + } + + function useCustomRule(rule, schema, parentSchema, it) { + if (self._opts.validateSchema !== false) { + var deps = rule.definition.dependencies; + if (deps && !deps.every(function(keyword) { + return Object.prototype.hasOwnProperty.call(parentSchema, keyword); + })) + throw new Error('parent schema must have all required keywords: ' + deps.join(',')); + + var validateSchema = rule.definition.validateSchema; + if (validateSchema) { + var valid = validateSchema(schema); + if (!valid) { + var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors); + if (self._opts.validateSchema == 'log') self.logger.error(message); + else throw new Error(message); + } + } + } + + var compile = rule.definition.compile + , inline = rule.definition.inline + , macro = rule.definition.macro; + + var validate; + if (compile) { + validate = compile.call(self, schema, parentSchema, it); + } else if (macro) { + validate = macro.call(self, schema, parentSchema, it); + if (opts.validateSchema !== false) self.validateSchema(validate, true); + } else if (inline) { + validate = inline.call(self, it, rule.keyword, schema, parentSchema); + } else { + validate = rule.definition.validate; + if (!validate) return; + } + + if (validate === undefined) + throw new Error('custom keyword "' + rule.keyword + '"failed to compile'); + + var index = customRules.length; + customRules[index] = validate; + + return { + code: 'customRule' + index, + validate: validate + }; + } +} + + +/** + * Checks if the schema is currently compiled + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean) + */ +function checkCompiling(schema, root, baseId) { + /* jshint validthis: true */ + var index = compIndex.call(this, schema, root, baseId); + if (index >= 0) return { index: index, compiling: true }; + index = this._compilations.length; + this._compilations[index] = { + schema: schema, + root: root, + baseId: baseId + }; + return { index: index, compiling: false }; +} + + +/** + * Removes the schema from the currently compiled list + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + */ +function endCompiling(schema, root, baseId) { + /* jshint validthis: true */ + var i = compIndex.call(this, schema, root, baseId); + if (i >= 0) this._compilations.splice(i, 1); +} + + +/** + * Index of schema compilation in the currently compiled list + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + * @return {Integer} compilation index + */ +function compIndex(schema, root, baseId) { + /* jshint validthis: true */ + for (var i=0; i= 0xD800 && value <= 0xDBFF && pos < len) { + // high surrogate, and there is a next character + value = str.charCodeAt(pos); + if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate + } + } + return length; +}; diff --git a/node_modules/ajv/lib/compile/util.js b/node_modules/ajv/lib/compile/util.js new file mode 100644 index 000000000..ef07b8c75 --- /dev/null +++ b/node_modules/ajv/lib/compile/util.js @@ -0,0 +1,239 @@ +'use strict'; + + +module.exports = { + copy: copy, + checkDataType: checkDataType, + checkDataTypes: checkDataTypes, + coerceToTypes: coerceToTypes, + toHash: toHash, + getProperty: getProperty, + escapeQuotes: escapeQuotes, + equal: require('fast-deep-equal'), + ucs2length: require('./ucs2length'), + varOccurences: varOccurences, + varReplace: varReplace, + schemaHasRules: schemaHasRules, + schemaHasRulesExcept: schemaHasRulesExcept, + schemaUnknownRules: schemaUnknownRules, + toQuotedString: toQuotedString, + getPathExpr: getPathExpr, + getPath: getPath, + getData: getData, + unescapeFragment: unescapeFragment, + unescapeJsonPointer: unescapeJsonPointer, + escapeFragment: escapeFragment, + escapeJsonPointer: escapeJsonPointer +}; + + +function copy(o, to) { + to = to || {}; + for (var key in o) to[key] = o[key]; + return to; +} + + +function checkDataType(dataType, data, strictNumbers, negate) { + var EQUAL = negate ? ' !== ' : ' === ' + , AND = negate ? ' || ' : ' && ' + , OK = negate ? '!' : '' + , NOT = negate ? '' : '!'; + switch (dataType) { + case 'null': return data + EQUAL + 'null'; + case 'array': return OK + 'Array.isArray(' + data + ')'; + case 'object': return '(' + OK + data + AND + + 'typeof ' + data + EQUAL + '"object"' + AND + + NOT + 'Array.isArray(' + data + '))'; + case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND + + NOT + '(' + data + ' % 1)' + + AND + data + EQUAL + data + + (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')'; + case 'number': return '(typeof ' + data + EQUAL + '"' + dataType + '"' + + (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')'; + default: return 'typeof ' + data + EQUAL + '"' + dataType + '"'; + } +} + + +function checkDataTypes(dataTypes, data, strictNumbers) { + switch (dataTypes.length) { + case 1: return checkDataType(dataTypes[0], data, strictNumbers, true); + default: + var code = ''; + var types = toHash(dataTypes); + if (types.array && types.object) { + code = types.null ? '(': '(!' + data + ' || '; + code += 'typeof ' + data + ' !== "object")'; + delete types.null; + delete types.array; + delete types.object; + } + if (types.number) delete types.integer; + for (var t in types) + code += (code ? ' && ' : '' ) + checkDataType(t, data, strictNumbers, true); + + return code; + } +} + + +var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]); +function coerceToTypes(optionCoerceTypes, dataTypes) { + if (Array.isArray(dataTypes)) { + var types = []; + for (var i=0; i= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl); + return paths[lvl - up]; + } + + if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl); + data = 'data' + ((lvl - up) || ''); + if (!jsonPointer) return data; + } + + var expr = data; + var segments = jsonPointer.split('/'); + for (var i=0; i' + , $notOp = $isMax ? '>' : '<' + , $errorKeyword = undefined; + + if (!($isData || typeof $schema == 'number' || $schema === undefined)) { + throw new Error($keyword + ' must be number'); + } + if (!($isDataExcl || $schemaExcl === undefined + || typeof $schemaExcl == 'number' + || typeof $schemaExcl == 'boolean')) { + throw new Error($exclusiveKeyword + ' must be number or boolean'); + } +}} + +{{? $isDataExcl }} + {{ + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr) + , $exclusive = 'exclusive' + $lvl + , $exclType = 'exclType' + $lvl + , $exclIsNumber = 'exclIsNumber' + $lvl + , $opExpr = 'op' + $lvl + , $opStr = '\' + ' + $opExpr + ' + \''; + }} + var schemaExcl{{=$lvl}} = {{=$schemaValueExcl}}; + {{ $schemaValueExcl = 'schemaExcl' + $lvl; }} + + var {{=$exclusive}}; + var {{=$exclType}} = typeof {{=$schemaValueExcl}}; + if ({{=$exclType}} != 'boolean' && {{=$exclType}} != 'undefined' && {{=$exclType}} != 'number') { + {{ var $errorKeyword = $exclusiveKeyword; }} + {{# def.error:'_exclusiveLimit' }} + } else if ({{# def.$dataNotType:'number' }} + {{=$exclType}} == 'number' + ? ( + ({{=$exclusive}} = {{=$schemaValue}} === undefined || {{=$schemaValueExcl}} {{=$op}}= {{=$schemaValue}}) + ? {{=$data}} {{=$notOp}}= {{=$schemaValueExcl}} + : {{=$data}} {{=$notOp}} {{=$schemaValue}} + ) + : ( + ({{=$exclusive}} = {{=$schemaValueExcl}} === true) + ? {{=$data}} {{=$notOp}}= {{=$schemaValue}} + : {{=$data}} {{=$notOp}} {{=$schemaValue}} + ) + || {{=$data}} !== {{=$data}}) { + var op{{=$lvl}} = {{=$exclusive}} ? '{{=$op}}' : '{{=$op}}='; + {{ + if ($schema === undefined) { + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; + $schemaValue = $schemaValueExcl; + $isData = $isDataExcl; + } + }} +{{??}} + {{ + var $exclIsNumber = typeof $schemaExcl == 'number' + , $opStr = $op; /*used in error*/ + }} + + {{? $exclIsNumber && $isData }} + {{ var $opExpr = '\'' + $opStr + '\''; /*used in error*/ }} + if ({{# def.$dataNotType:'number' }} + ( {{=$schemaValue}} === undefined + || {{=$schemaExcl}} {{=$op}}= {{=$schemaValue}} + ? {{=$data}} {{=$notOp}}= {{=$schemaExcl}} + : {{=$data}} {{=$notOp}} {{=$schemaValue}} ) + || {{=$data}} !== {{=$data}}) { + {{??}} + {{ + if ($exclIsNumber && $schema === undefined) { + {{# def.setExclusiveLimit }} + $schemaValue = $schemaExcl; + $notOp += '='; + } else { + if ($exclIsNumber) + $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema); + + if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) { + {{# def.setExclusiveLimit }} + $notOp += '='; + } else { + $exclusive = false; + $opStr += '='; + } + } + + var $opExpr = '\'' + $opStr + '\''; /*used in error*/ + }} + + if ({{# def.$dataNotType:'number' }} + {{=$data}} {{=$notOp}} {{=$schemaValue}} + || {{=$data}} !== {{=$data}}) { + {{?}} +{{?}} + {{ $errorKeyword = $errorKeyword || $keyword; }} + {{# def.error:'_limit' }} + } {{? $breakOnError }} else { {{?}} diff --git a/node_modules/ajv/lib/dot/_limitItems.jst b/node_modules/ajv/lib/dot/_limitItems.jst new file mode 100644 index 000000000..741329e77 --- /dev/null +++ b/node_modules/ajv/lib/dot/_limitItems.jst @@ -0,0 +1,12 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{# def.numberKeyword }} + +{{ var $op = $keyword == 'maxItems' ? '>' : '<'; }} +if ({{# def.$dataNotType:'number' }} {{=$data}}.length {{=$op}} {{=$schemaValue}}) { + {{ var $errorKeyword = $keyword; }} + {{# def.error:'_limitItems' }} +} {{? $breakOnError }} else { {{?}} diff --git a/node_modules/ajv/lib/dot/_limitLength.jst b/node_modules/ajv/lib/dot/_limitLength.jst new file mode 100644 index 000000000..285c66bd2 --- /dev/null +++ b/node_modules/ajv/lib/dot/_limitLength.jst @@ -0,0 +1,12 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{# def.numberKeyword }} + +{{ var $op = $keyword == 'maxLength' ? '>' : '<'; }} +if ({{# def.$dataNotType:'number' }} {{# def.strLength }} {{=$op}} {{=$schemaValue}}) { + {{ var $errorKeyword = $keyword; }} + {{# def.error:'_limitLength' }} +} {{? $breakOnError }} else { {{?}} diff --git a/node_modules/ajv/lib/dot/_limitProperties.jst b/node_modules/ajv/lib/dot/_limitProperties.jst new file mode 100644 index 000000000..c4c21551a --- /dev/null +++ b/node_modules/ajv/lib/dot/_limitProperties.jst @@ -0,0 +1,12 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{# def.numberKeyword }} + +{{ var $op = $keyword == 'maxProperties' ? '>' : '<'; }} +if ({{# def.$dataNotType:'number' }} Object.keys({{=$data}}).length {{=$op}} {{=$schemaValue}}) { + {{ var $errorKeyword = $keyword; }} + {{# def.error:'_limitProperties' }} +} {{? $breakOnError }} else { {{?}} diff --git a/node_modules/ajv/lib/dot/allOf.jst b/node_modules/ajv/lib/dot/allOf.jst new file mode 100644 index 000000000..0e782fe98 --- /dev/null +++ b/node_modules/ajv/lib/dot/allOf.jst @@ -0,0 +1,32 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + +{{ + var $currentBaseId = $it.baseId + , $allSchemasEmpty = true; +}} + +{{~ $schema:$sch:$i }} + {{? {{# def.nonEmptySchema:$sch }} }} + {{ + $allSchemasEmpty = false; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + }} + + {{# def.insertSubschemaCode }} + + {{# def.ifResultValid }} + {{?}} +{{~}} + +{{? $breakOnError }} + {{? $allSchemasEmpty }} + if (true) { + {{??}} + {{= $closingBraces.slice(0,-1) }} + {{?}} +{{?}} diff --git a/node_modules/ajv/lib/dot/anyOf.jst b/node_modules/ajv/lib/dot/anyOf.jst new file mode 100644 index 000000000..ea909ee62 --- /dev/null +++ b/node_modules/ajv/lib/dot/anyOf.jst @@ -0,0 +1,46 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + +{{ + var $noEmptySchema = $schema.every(function($sch) { + return {{# def.nonEmptySchema:$sch }}; + }); +}} +{{? $noEmptySchema }} + {{ var $currentBaseId = $it.baseId; }} + var {{=$errs}} = errors; + var {{=$valid}} = false; + + {{# def.setCompositeRule }} + + {{~ $schema:$sch:$i }} + {{ + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + }} + + {{# def.insertSubschemaCode }} + + {{=$valid}} = {{=$valid}} || {{=$nextValid}}; + + if (!{{=$valid}}) { + {{ $closingBraces += '}'; }} + {{~}} + + {{# def.resetCompositeRule }} + + {{= $closingBraces }} + + if (!{{=$valid}}) { + {{# def.extraError:'anyOf' }} + } else { + {{# def.resetErrors }} + {{? it.opts.allErrors }} } {{?}} +{{??}} + {{? $breakOnError }} + if (true) { + {{?}} +{{?}} diff --git a/node_modules/ajv/lib/dot/coerce.def b/node_modules/ajv/lib/dot/coerce.def new file mode 100644 index 000000000..c947ed6af --- /dev/null +++ b/node_modules/ajv/lib/dot/coerce.def @@ -0,0 +1,51 @@ +{{## def.coerceType: + {{ + var $dataType = 'dataType' + $lvl + , $coerced = 'coerced' + $lvl; + }} + var {{=$dataType}} = typeof {{=$data}}; + var {{=$coerced}} = undefined; + + {{? it.opts.coerceTypes == 'array' }} + if ({{=$dataType}} == 'object' && Array.isArray({{=$data}}) && {{=$data}}.length == 1) { + {{=$data}} = {{=$data}}[0]; + {{=$dataType}} = typeof {{=$data}}; + if ({{=it.util.checkDataType(it.schema.type, $data, it.opts.strictNumbers)}}) {{=$coerced}} = {{=$data}}; + } + {{?}} + + if ({{=$coerced}} !== undefined) ; + {{~ $coerceToTypes:$type:$i }} + {{? $type == 'string' }} + else if ({{=$dataType}} == 'number' || {{=$dataType}} == 'boolean') + {{=$coerced}} = '' + {{=$data}}; + else if ({{=$data}} === null) {{=$coerced}} = ''; + {{?? $type == 'number' || $type == 'integer' }} + else if ({{=$dataType}} == 'boolean' || {{=$data}} === null + || ({{=$dataType}} == 'string' && {{=$data}} && {{=$data}} == +{{=$data}} + {{? $type == 'integer' }} && !({{=$data}} % 1){{?}})) + {{=$coerced}} = +{{=$data}}; + {{?? $type == 'boolean' }} + else if ({{=$data}} === 'false' || {{=$data}} === 0 || {{=$data}} === null) + {{=$coerced}} = false; + else if ({{=$data}} === 'true' || {{=$data}} === 1) + {{=$coerced}} = true; + {{?? $type == 'null' }} + else if ({{=$data}} === '' || {{=$data}} === 0 || {{=$data}} === false) + {{=$coerced}} = null; + {{?? it.opts.coerceTypes == 'array' && $type == 'array' }} + else if ({{=$dataType}} == 'string' || {{=$dataType}} == 'number' || {{=$dataType}} == 'boolean' || {{=$data}} == null) + {{=$coerced}} = [{{=$data}}]; + {{?}} + {{~}} + else { + {{# def.error:'type' }} + } + + if ({{=$coerced}} !== undefined) { + {{# def.setParentData }} + {{=$data}} = {{=$coerced}}; + {{? !$dataLvl }}if ({{=$parentData}} !== undefined){{?}} + {{=$parentData}}[{{=$parentDataProperty}}] = {{=$coerced}}; + } +#}} diff --git a/node_modules/ajv/lib/dot/comment.jst b/node_modules/ajv/lib/dot/comment.jst new file mode 100644 index 000000000..f95915035 --- /dev/null +++ b/node_modules/ajv/lib/dot/comment.jst @@ -0,0 +1,9 @@ +{{# def.definitions }} +{{# def.setupKeyword }} + +{{ var $comment = it.util.toQuotedString($schema); }} +{{? it.opts.$comment === true }} + console.log({{=$comment}}); +{{?? typeof it.opts.$comment == 'function' }} + self._opts.$comment({{=$comment}}, {{=it.util.toQuotedString($errSchemaPath)}}, validate.root.schema); +{{?}} diff --git a/node_modules/ajv/lib/dot/const.jst b/node_modules/ajv/lib/dot/const.jst new file mode 100644 index 000000000..2aa22980d --- /dev/null +++ b/node_modules/ajv/lib/dot/const.jst @@ -0,0 +1,11 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{? !$isData }} + var schema{{=$lvl}} = validate.schema{{=$schemaPath}}; +{{?}} +var {{=$valid}} = equal({{=$data}}, schema{{=$lvl}}); +{{# def.checkError:'const' }} +{{? $breakOnError }} else { {{?}} diff --git a/node_modules/ajv/lib/dot/contains.jst b/node_modules/ajv/lib/dot/contains.jst new file mode 100644 index 000000000..4dc996741 --- /dev/null +++ b/node_modules/ajv/lib/dot/contains.jst @@ -0,0 +1,55 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + + +{{ + var $idx = 'i' + $lvl + , $dataNxt = $it.dataLevel = it.dataLevel + 1 + , $nextData = 'data' + $dataNxt + , $currentBaseId = it.baseId + , $nonEmptySchema = {{# def.nonEmptySchema:$schema }}; +}} + +var {{=$errs}} = errors; +var {{=$valid}}; + +{{? $nonEmptySchema }} + {{# def.setCompositeRule }} + + {{ + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + }} + + var {{=$nextValid}} = false; + + for (var {{=$idx}} = 0; {{=$idx}} < {{=$data}}.length; {{=$idx}}++) { + {{ + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + }} + + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} + + if ({{=$nextValid}}) break; + } + + {{# def.resetCompositeRule }} + {{= $closingBraces }} + + if (!{{=$nextValid}}) { +{{??}} + if ({{=$data}}.length == 0) { +{{?}} + + {{# def.error:'contains' }} + } else { + {{? $nonEmptySchema }} + {{# def.resetErrors }} + {{?}} + {{? it.opts.allErrors }} } {{?}} diff --git a/node_modules/ajv/lib/dot/custom.jst b/node_modules/ajv/lib/dot/custom.jst new file mode 100644 index 000000000..d30588fb0 --- /dev/null +++ b/node_modules/ajv/lib/dot/custom.jst @@ -0,0 +1,191 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{ + var $rule = this + , $definition = 'definition' + $lvl + , $rDef = $rule.definition + , $closingBraces = ''; + var $validate = $rDef.validate; + var $compile, $inline, $macro, $ruleValidate, $validateCode; +}} + +{{? $isData && $rDef.$data }} + {{ + $validateCode = 'keywordValidate' + $lvl; + var $validateSchema = $rDef.validateSchema; + }} + var {{=$definition}} = RULES.custom['{{=$keyword}}'].definition; + var {{=$validateCode}} = {{=$definition}}.validate; +{{??}} + {{ + $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it); + if (!$ruleValidate) return; + $schemaValue = 'validate.schema' + $schemaPath; + $validateCode = $ruleValidate.code; + $compile = $rDef.compile; + $inline = $rDef.inline; + $macro = $rDef.macro; + }} +{{?}} + +{{ + var $ruleErrs = $validateCode + '.errors' + , $i = 'i' + $lvl + , $ruleErr = 'ruleErr' + $lvl + , $asyncKeyword = $rDef.async; + + if ($asyncKeyword && !it.async) + throw new Error('async keyword in sync schema'); +}} + + +{{? !($inline || $macro) }}{{=$ruleErrs}} = null;{{?}} +var {{=$errs}} = errors; +var {{=$valid}}; + +{{## def.callRuleValidate: + {{=$validateCode}}.call( + {{? it.opts.passContext }}this{{??}}self{{?}} + {{? $compile || $rDef.schema === false }} + , {{=$data}} + {{??}} + , {{=$schemaValue}} + , {{=$data}} + , validate.schema{{=it.schemaPath}} + {{?}} + , {{# def.dataPath }} + {{# def.passParentData }} + , rootData + ) +#}} + +{{## def.extendErrors:_inline: + for (var {{=$i}}={{=$errs}}; {{=$i}} 0) + || _schema === false + : it.util.schemaHasRules(_schema, it.RULES.all)) +#}} + + +{{## def.strLength: + {{? it.opts.unicode === false }} + {{=$data}}.length + {{??}} + ucs2length({{=$data}}) + {{?}} +#}} + + +{{## def.willOptimize: + it.util.varOccurences($code, $nextData) < 2 +#}} + + +{{## def.generateSubschemaCode: + {{ + var $code = it.validate($it); + $it.baseId = $currentBaseId; + }} +#}} + + +{{## def.insertSubschemaCode: + {{= it.validate($it) }} + {{ $it.baseId = $currentBaseId; }} +#}} + + +{{## def._optimizeValidate: + it.util.varReplace($code, $nextData, $passData) +#}} + + +{{## def.optimizeValidate: + {{? {{# def.willOptimize}} }} + {{= {{# def._optimizeValidate }} }} + {{??}} + var {{=$nextData}} = {{=$passData}}; + {{= $code }} + {{?}} +#}} + + +{{## def.$data: + {{ + var $isData = it.opts.$data && $schema && $schema.$data + , $schemaValue; + }} + {{? $isData }} + var schema{{=$lvl}} = {{= it.util.getData($schema.$data, $dataLvl, it.dataPathArr) }}; + {{ $schemaValue = 'schema' + $lvl; }} + {{??}} + {{ $schemaValue = $schema; }} + {{?}} +#}} + + +{{## def.$dataNotType:_type: + {{?$isData}} ({{=$schemaValue}} !== undefined && typeof {{=$schemaValue}} != _type) || {{?}} +#}} + + +{{## def.check$dataIsArray: + if (schema{{=$lvl}} === undefined) {{=$valid}} = true; + else if (!Array.isArray(schema{{=$lvl}})) {{=$valid}} = false; + else { +#}} + + +{{## def.numberKeyword: + {{? !($isData || typeof $schema == 'number') }} + {{ throw new Error($keyword + ' must be number'); }} + {{?}} +#}} + + +{{## def.beginDefOut: + {{ + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + }} +#}} + + +{{## def.storeDefOut:_variable: + {{ + var _variable = out; + out = $$outStack.pop(); + }} +#}} + + +{{## def.dataPath:(dataPath || ''){{? it.errorPath != '""'}} + {{= it.errorPath }}{{?}}#}} + +{{## def.setParentData: + {{ + var $parentData = $dataLvl ? 'data' + (($dataLvl-1)||'') : 'parentData' + , $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + }} +#}} + +{{## def.passParentData: + {{# def.setParentData }} + , {{= $parentData }} + , {{= $parentDataProperty }} +#}} + + +{{## def.iterateProperties: + {{? $ownProperties }} + {{=$dataProperties}} = {{=$dataProperties}} || Object.keys({{=$data}}); + for (var {{=$idx}}=0; {{=$idx}}<{{=$dataProperties}}.length; {{=$idx}}++) { + var {{=$key}} = {{=$dataProperties}}[{{=$idx}}]; + {{??}} + for (var {{=$key}} in {{=$data}}) { + {{?}} +#}} + + +{{## def.noPropertyInData: + {{=$useData}} === undefined + {{? $ownProperties }} + || !{{# def.isOwnProperty }} + {{?}} +#}} + + +{{## def.isOwnProperty: + Object.prototype.hasOwnProperty.call({{=$data}}, '{{=it.util.escapeQuotes($propertyKey)}}') +#}} diff --git a/node_modules/ajv/lib/dot/dependencies.jst b/node_modules/ajv/lib/dot/dependencies.jst new file mode 100644 index 000000000..e4bdddec8 --- /dev/null +++ b/node_modules/ajv/lib/dot/dependencies.jst @@ -0,0 +1,79 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.missing }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + + +{{## def.propertyInData: + {{=$data}}{{= it.util.getProperty($property) }} !== undefined + {{? $ownProperties }} + && Object.prototype.hasOwnProperty.call({{=$data}}, '{{=it.util.escapeQuotes($property)}}') + {{?}} +#}} + + +{{ + var $schemaDeps = {} + , $propertyDeps = {} + , $ownProperties = it.opts.ownProperties; + + for ($property in $schema) { + if ($property == '__proto__') continue; + var $sch = $schema[$property]; + var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps; + $deps[$property] = $sch; + } +}} + +var {{=$errs}} = errors; + +{{ var $currentErrorPath = it.errorPath; }} + +var missing{{=$lvl}}; +{{ for (var $property in $propertyDeps) { }} + {{ $deps = $propertyDeps[$property]; }} + {{? $deps.length }} + if ({{# def.propertyInData }} + {{? $breakOnError }} + && ({{# def.checkMissingProperty:$deps }})) { + {{# def.errorMissingProperty:'dependencies' }} + {{??}} + ) { + {{~ $deps:$propertyKey }} + {{# def.allErrorsMissingProperty:'dependencies' }} + {{~}} + {{?}} + } {{# def.elseIfValid }} + {{?}} +{{ } }} + +{{ + it.errorPath = $currentErrorPath; + var $currentBaseId = $it.baseId; +}} + + +{{ for (var $property in $schemaDeps) { }} + {{ var $sch = $schemaDeps[$property]; }} + {{? {{# def.nonEmptySchema:$sch }} }} + {{=$nextValid}} = true; + + if ({{# def.propertyInData }}) { + {{ + $it.schema = $sch; + $it.schemaPath = $schemaPath + it.util.getProperty($property); + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property); + }} + + {{# def.insertSubschemaCode }} + } + + {{# def.ifResultValid }} + {{?}} +{{ } }} + +{{? $breakOnError }} + {{= $closingBraces }} + if ({{=$errs}} == errors) { +{{?}} diff --git a/node_modules/ajv/lib/dot/enum.jst b/node_modules/ajv/lib/dot/enum.jst new file mode 100644 index 000000000..357c2e8c0 --- /dev/null +++ b/node_modules/ajv/lib/dot/enum.jst @@ -0,0 +1,30 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{ + var $i = 'i' + $lvl + , $vSchema = 'schema' + $lvl; +}} + +{{? !$isData }} + var {{=$vSchema}} = validate.schema{{=$schemaPath}}; +{{?}} +var {{=$valid}}; + +{{?$isData}}{{# def.check$dataIsArray }}{{?}} + +{{=$valid}} = false; + +for (var {{=$i}}=0; {{=$i}}<{{=$vSchema}}.length; {{=$i}}++) + if (equal({{=$data}}, {{=$vSchema}}[{{=$i}}])) { + {{=$valid}} = true; + break; + } + +{{? $isData }} } {{?}} + +{{# def.checkError:'enum' }} + +{{? $breakOnError }} else { {{?}} diff --git a/node_modules/ajv/lib/dot/errors.def b/node_modules/ajv/lib/dot/errors.def new file mode 100644 index 000000000..5c5752cb0 --- /dev/null +++ b/node_modules/ajv/lib/dot/errors.def @@ -0,0 +1,194 @@ +{{# def.definitions }} + +{{## def._error:_rule: + {{ 'istanbul ignore else'; }} + {{? it.createErrors !== false }} + { + keyword: '{{= $errorKeyword || _rule }}' + , dataPath: (dataPath || '') + {{= it.errorPath }} + , schemaPath: {{=it.util.toQuotedString($errSchemaPath)}} + , params: {{# def._errorParams[_rule] }} + {{? it.opts.messages !== false }} + , message: {{# def._errorMessages[_rule] }} + {{?}} + {{? it.opts.verbose }} + , schema: {{# def._errorSchemas[_rule] }} + , parentSchema: validate.schema{{=it.schemaPath}} + , data: {{=$data}} + {{?}} + } + {{??}} + {} + {{?}} +#}} + + +{{## def._addError:_rule: + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; +#}} + + +{{## def.addError:_rule: + var err = {{# def._error:_rule }}; + {{# def._addError:_rule }} +#}} + + +{{## def.error:_rule: + {{# def.beginDefOut}} + {{# def._error:_rule }} + {{# def.storeDefOut:__err }} + + {{? !it.compositeRule && $breakOnError }} + {{ 'istanbul ignore if'; }} + {{? it.async }} + throw new ValidationError([{{=__err}}]); + {{??}} + validate.errors = [{{=__err}}]; + return false; + {{?}} + {{??}} + var err = {{=__err}}; + {{# def._addError:_rule }} + {{?}} +#}} + + +{{## def.extraError:_rule: + {{# def.addError:_rule}} + {{? !it.compositeRule && $breakOnError }} + {{ 'istanbul ignore if'; }} + {{? it.async }} + throw new ValidationError(vErrors); + {{??}} + validate.errors = vErrors; + return false; + {{?}} + {{?}} +#}} + + +{{## def.checkError:_rule: + if (!{{=$valid}}) { + {{# def.error:_rule }} + } +#}} + + +{{## def.resetErrors: + errors = {{=$errs}}; + if (vErrors !== null) { + if ({{=$errs}}) vErrors.length = {{=$errs}}; + else vErrors = null; + } +#}} + + +{{## def.concatSchema:{{?$isData}}' + {{=$schemaValue}} + '{{??}}{{=$schema}}{{?}}#}} +{{## def.appendSchema:{{?$isData}}' + {{=$schemaValue}}{{??}}{{=$schemaValue}}'{{?}}#}} +{{## def.concatSchemaEQ:{{?$isData}}' + {{=$schemaValue}} + '{{??}}{{=it.util.escapeQuotes($schema)}}{{?}}#}} + +{{## def._errorMessages = { + 'false schema': "'boolean schema is false'", + $ref: "'can\\\'t resolve reference {{=it.util.escapeQuotes($schema)}}'", + additionalItems: "'should NOT have more than {{=$schema.length}} items'", + additionalProperties: "'{{? it.opts._errorDataPathProperty }}is an invalid additional property{{??}}should NOT have additional properties{{?}}'", + anyOf: "'should match some schema in anyOf'", + const: "'should be equal to constant'", + contains: "'should contain a valid item'", + dependencies: "'should have {{? $deps.length == 1 }}property {{= it.util.escapeQuotes($deps[0]) }}{{??}}properties {{= it.util.escapeQuotes($deps.join(\", \")) }}{{?}} when property {{= it.util.escapeQuotes($property) }} is present'", + 'enum': "'should be equal to one of the allowed values'", + format: "'should match format \"{{#def.concatSchemaEQ}}\"'", + 'if': "'should match \"' + {{=$ifClause}} + '\" schema'", + _limit: "'should be {{=$opStr}} {{#def.appendSchema}}", + _exclusiveLimit: "'{{=$exclusiveKeyword}} should be boolean'", + _limitItems: "'should NOT have {{?$keyword=='maxItems'}}more{{??}}fewer{{?}} than {{#def.concatSchema}} items'", + _limitLength: "'should NOT be {{?$keyword=='maxLength'}}longer{{??}}shorter{{?}} than {{#def.concatSchema}} characters'", + _limitProperties:"'should NOT have {{?$keyword=='maxProperties'}}more{{??}}fewer{{?}} than {{#def.concatSchema}} properties'", + multipleOf: "'should be multiple of {{#def.appendSchema}}", + not: "'should NOT be valid'", + oneOf: "'should match exactly one schema in oneOf'", + pattern: "'should match pattern \"{{#def.concatSchemaEQ}}\"'", + propertyNames: "'property name \\'{{=$invalidName}}\\' is invalid'", + required: "'{{? it.opts._errorDataPathProperty }}is a required property{{??}}should have required property \\'{{=$missingProperty}}\\'{{?}}'", + type: "'should be {{? $typeIsArray }}{{= $typeSchema.join(\",\") }}{{??}}{{=$typeSchema}}{{?}}'", + uniqueItems: "'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)'", + custom: "'should pass \"{{=$rule.keyword}}\" keyword validation'", + patternRequired: "'should have property matching pattern \\'{{=$missingPattern}}\\''", + switch: "'should pass \"switch\" keyword validation'", + _formatLimit: "'should be {{=$opStr}} \"{{#def.concatSchemaEQ}}\"'", + _formatExclusiveLimit: "'{{=$exclusiveKeyword}} should be boolean'" +} #}} + + +{{## def.schemaRefOrVal: {{?$isData}}validate.schema{{=$schemaPath}}{{??}}{{=$schema}}{{?}} #}} +{{## def.schemaRefOrQS: {{?$isData}}validate.schema{{=$schemaPath}}{{??}}{{=it.util.toQuotedString($schema)}}{{?}} #}} + +{{## def._errorSchemas = { + 'false schema': "false", + $ref: "{{=it.util.toQuotedString($schema)}}", + additionalItems: "false", + additionalProperties: "false", + anyOf: "validate.schema{{=$schemaPath}}", + const: "validate.schema{{=$schemaPath}}", + contains: "validate.schema{{=$schemaPath}}", + dependencies: "validate.schema{{=$schemaPath}}", + 'enum': "validate.schema{{=$schemaPath}}", + format: "{{#def.schemaRefOrQS}}", + 'if': "validate.schema{{=$schemaPath}}", + _limit: "{{#def.schemaRefOrVal}}", + _exclusiveLimit: "validate.schema{{=$schemaPath}}", + _limitItems: "{{#def.schemaRefOrVal}}", + _limitLength: "{{#def.schemaRefOrVal}}", + _limitProperties:"{{#def.schemaRefOrVal}}", + multipleOf: "{{#def.schemaRefOrVal}}", + not: "validate.schema{{=$schemaPath}}", + oneOf: "validate.schema{{=$schemaPath}}", + pattern: "{{#def.schemaRefOrQS}}", + propertyNames: "validate.schema{{=$schemaPath}}", + required: "validate.schema{{=$schemaPath}}", + type: "validate.schema{{=$schemaPath}}", + uniqueItems: "{{#def.schemaRefOrVal}}", + custom: "validate.schema{{=$schemaPath}}", + patternRequired: "validate.schema{{=$schemaPath}}", + switch: "validate.schema{{=$schemaPath}}", + _formatLimit: "{{#def.schemaRefOrQS}}", + _formatExclusiveLimit: "validate.schema{{=$schemaPath}}" +} #}} + + +{{## def.schemaValueQS: {{?$isData}}{{=$schemaValue}}{{??}}{{=it.util.toQuotedString($schema)}}{{?}} #}} + +{{## def._errorParams = { + 'false schema': "{}", + $ref: "{ ref: '{{=it.util.escapeQuotes($schema)}}' }", + additionalItems: "{ limit: {{=$schema.length}} }", + additionalProperties: "{ additionalProperty: '{{=$additionalProperty}}' }", + anyOf: "{}", + const: "{ allowedValue: schema{{=$lvl}} }", + contains: "{}", + dependencies: "{ property: '{{= it.util.escapeQuotes($property) }}', missingProperty: '{{=$missingProperty}}', depsCount: {{=$deps.length}}, deps: '{{= it.util.escapeQuotes($deps.length==1 ? $deps[0] : $deps.join(\", \")) }}' }", + 'enum': "{ allowedValues: schema{{=$lvl}} }", + format: "{ format: {{#def.schemaValueQS}} }", + 'if': "{ failingKeyword: {{=$ifClause}} }", + _limit: "{ comparison: {{=$opExpr}}, limit: {{=$schemaValue}}, exclusive: {{=$exclusive}} }", + _exclusiveLimit: "{}", + _limitItems: "{ limit: {{=$schemaValue}} }", + _limitLength: "{ limit: {{=$schemaValue}} }", + _limitProperties:"{ limit: {{=$schemaValue}} }", + multipleOf: "{ multipleOf: {{=$schemaValue}} }", + not: "{}", + oneOf: "{ passingSchemas: {{=$passingSchemas}} }", + pattern: "{ pattern: {{#def.schemaValueQS}} }", + propertyNames: "{ propertyName: '{{=$invalidName}}' }", + required: "{ missingProperty: '{{=$missingProperty}}' }", + type: "{ type: '{{? $typeIsArray }}{{= $typeSchema.join(\",\") }}{{??}}{{=$typeSchema}}{{?}}' }", + uniqueItems: "{ i: i, j: j }", + custom: "{ keyword: '{{=$rule.keyword}}' }", + patternRequired: "{ missingPattern: '{{=$missingPattern}}' }", + switch: "{ caseIndex: {{=$caseIndex}} }", + _formatLimit: "{ comparison: {{=$opExpr}}, limit: {{#def.schemaValueQS}}, exclusive: {{=$exclusive}} }", + _formatExclusiveLimit: "{}" +} #}} diff --git a/node_modules/ajv/lib/dot/format.jst b/node_modules/ajv/lib/dot/format.jst new file mode 100644 index 000000000..37f14da80 --- /dev/null +++ b/node_modules/ajv/lib/dot/format.jst @@ -0,0 +1,106 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} + +{{## def.skipFormat: + {{? $breakOnError }} if (true) { {{?}} + {{ return out; }} +#}} + +{{? it.opts.format === false }}{{# def.skipFormat }}{{?}} + + +{{# def.$data }} + + +{{## def.$dataCheckFormat: + {{# def.$dataNotType:'string' }} + ({{? $unknownFormats != 'ignore' }} + ({{=$schemaValue}} && !{{=$format}} + {{? $allowUnknown }} + && self._opts.unknownFormats.indexOf({{=$schemaValue}}) == -1 + {{?}}) || + {{?}} + ({{=$format}} && {{=$formatType}} == '{{=$ruleType}}' + && !(typeof {{=$format}} == 'function' + ? {{? it.async}} + (async{{=$lvl}} ? await {{=$format}}({{=$data}}) : {{=$format}}({{=$data}})) + {{??}} + {{=$format}}({{=$data}}) + {{?}} + : {{=$format}}.test({{=$data}})))) +#}} + +{{## def.checkFormat: + {{ + var $formatRef = 'formats' + it.util.getProperty($schema); + if ($isObject) $formatRef += '.validate'; + }} + {{? typeof $format == 'function' }} + {{=$formatRef}}({{=$data}}) + {{??}} + {{=$formatRef}}.test({{=$data}}) + {{?}} +#}} + + +{{ + var $unknownFormats = it.opts.unknownFormats + , $allowUnknown = Array.isArray($unknownFormats); +}} + +{{? $isData }} + {{ + var $format = 'format' + $lvl + , $isObject = 'isObject' + $lvl + , $formatType = 'formatType' + $lvl; + }} + var {{=$format}} = formats[{{=$schemaValue}}]; + var {{=$isObject}} = typeof {{=$format}} == 'object' + && !({{=$format}} instanceof RegExp) + && {{=$format}}.validate; + var {{=$formatType}} = {{=$isObject}} && {{=$format}}.type || 'string'; + if ({{=$isObject}}) { + {{? it.async}} + var async{{=$lvl}} = {{=$format}}.async; + {{?}} + {{=$format}} = {{=$format}}.validate; + } + if ({{# def.$dataCheckFormat }}) { +{{??}} + {{ var $format = it.formats[$schema]; }} + {{? !$format }} + {{? $unknownFormats == 'ignore' }} + {{ it.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"'); }} + {{# def.skipFormat }} + {{?? $allowUnknown && $unknownFormats.indexOf($schema) >= 0 }} + {{# def.skipFormat }} + {{??}} + {{ throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"'); }} + {{?}} + {{?}} + {{ + var $isObject = typeof $format == 'object' + && !($format instanceof RegExp) + && $format.validate; + var $formatType = $isObject && $format.type || 'string'; + if ($isObject) { + var $async = $format.async === true; + $format = $format.validate; + } + }} + {{? $formatType != $ruleType }} + {{# def.skipFormat }} + {{?}} + {{? $async }} + {{ + if (!it.async) throw new Error('async format in sync schema'); + var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate'; + }} + if (!(await {{=$formatRef}}({{=$data}}))) { + {{??}} + if (!{{# def.checkFormat }}) { + {{?}} +{{?}} + {{# def.error:'format' }} + } {{? $breakOnError }} else { {{?}} diff --git a/node_modules/ajv/lib/dot/if.jst b/node_modules/ajv/lib/dot/if.jst new file mode 100644 index 000000000..adb503612 --- /dev/null +++ b/node_modules/ajv/lib/dot/if.jst @@ -0,0 +1,73 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + + +{{## def.validateIfClause:_clause: + {{ + $it.schema = it.schema['_clause']; + $it.schemaPath = it.schemaPath + '._clause'; + $it.errSchemaPath = it.errSchemaPath + '/_clause'; + }} + {{# def.insertSubschemaCode }} + {{=$valid}} = {{=$nextValid}}; + {{? $thenPresent && $elsePresent }} + {{ $ifClause = 'ifClause' + $lvl; }} + var {{=$ifClause}} = '_clause'; + {{??}} + {{ $ifClause = '\'_clause\''; }} + {{?}} +#}} + +{{ + var $thenSch = it.schema['then'] + , $elseSch = it.schema['else'] + , $thenPresent = $thenSch !== undefined && {{# def.nonEmptySchema:$thenSch }} + , $elsePresent = $elseSch !== undefined && {{# def.nonEmptySchema:$elseSch }} + , $currentBaseId = $it.baseId; +}} + +{{? $thenPresent || $elsePresent }} + {{ + var $ifClause; + $it.createErrors = false; + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + }} + var {{=$errs}} = errors; + var {{=$valid}} = true; + + {{# def.setCompositeRule }} + {{# def.insertSubschemaCode }} + {{ $it.createErrors = true; }} + {{# def.resetErrors }} + {{# def.resetCompositeRule }} + + {{? $thenPresent }} + if ({{=$nextValid}}) { + {{# def.validateIfClause:then }} + } + {{? $elsePresent }} + else { + {{?}} + {{??}} + if (!{{=$nextValid}}) { + {{?}} + + {{? $elsePresent }} + {{# def.validateIfClause:else }} + } + {{?}} + + if (!{{=$valid}}) { + {{# def.extraError:'if' }} + } + {{? $breakOnError }} else { {{?}} +{{??}} + {{? $breakOnError }} + if (true) { + {{?}} +{{?}} + diff --git a/node_modules/ajv/lib/dot/items.jst b/node_modules/ajv/lib/dot/items.jst new file mode 100644 index 000000000..acc932a26 --- /dev/null +++ b/node_modules/ajv/lib/dot/items.jst @@ -0,0 +1,98 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + + +{{## def.validateItems:startFrom: + for (var {{=$idx}} = {{=startFrom}}; {{=$idx}} < {{=$data}}.length; {{=$idx}}++) { + {{ + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + }} + + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} + + {{? $breakOnError }} + if (!{{=$nextValid}}) break; + {{?}} + } +#}} + +{{ + var $idx = 'i' + $lvl + , $dataNxt = $it.dataLevel = it.dataLevel + 1 + , $nextData = 'data' + $dataNxt + , $currentBaseId = it.baseId; +}} + +var {{=$errs}} = errors; +var {{=$valid}}; + +{{? Array.isArray($schema) }} + {{ /* 'items' is an array of schemas */}} + {{ var $additionalItems = it.schema.additionalItems; }} + {{? $additionalItems === false }} + {{=$valid}} = {{=$data}}.length <= {{= $schema.length }}; + {{ + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalItems'; + }} + {{# def.checkError:'additionalItems' }} + {{ $errSchemaPath = $currErrSchemaPath; }} + {{# def.elseIfValid}} + {{?}} + + {{~ $schema:$sch:$i }} + {{? {{# def.nonEmptySchema:$sch }} }} + {{=$nextValid}} = true; + + if ({{=$data}}.length > {{=$i}}) { + {{ + var $passData = $data + '[' + $i + ']'; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true); + $it.dataPathArr[$dataNxt] = $i; + }} + + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} + } + + {{# def.ifResultValid }} + {{?}} + {{~}} + + {{? typeof $additionalItems == 'object' && {{# def.nonEmptySchema:$additionalItems }} }} + {{ + $it.schema = $additionalItems; + $it.schemaPath = it.schemaPath + '.additionalItems'; + $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; + }} + {{=$nextValid}} = true; + + if ({{=$data}}.length > {{= $schema.length }}) { + {{# def.validateItems: $schema.length }} + } + + {{# def.ifResultValid }} + {{?}} + +{{?? {{# def.nonEmptySchema:$schema }} }} + {{ /* 'items' is a single schema */}} + {{ + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + }} + {{# def.validateItems: 0 }} +{{?}} + +{{? $breakOnError }} + {{= $closingBraces }} + if ({{=$errs}} == errors) { +{{?}} diff --git a/node_modules/ajv/lib/dot/missing.def b/node_modules/ajv/lib/dot/missing.def new file mode 100644 index 000000000..a73b9f966 --- /dev/null +++ b/node_modules/ajv/lib/dot/missing.def @@ -0,0 +1,39 @@ +{{## def.checkMissingProperty:_properties: + {{~ _properties:$propertyKey:$i }} + {{?$i}} || {{?}} + {{ + var $prop = it.util.getProperty($propertyKey) + , $useData = $data + $prop; + }} + ( ({{# def.noPropertyInData }}) && (missing{{=$lvl}} = {{= it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop) }}) ) + {{~}} +#}} + + +{{## def.errorMissingProperty:_error: + {{ + var $propertyPath = 'missing' + $lvl + , $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.opts.jsonPointers + ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) + : $currentErrorPath + ' + ' + $propertyPath; + } + }} + {{# def.error:_error }} +#}} + + +{{## def.allErrorsMissingProperty:_error: + {{ + var $prop = it.util.getProperty($propertyKey) + , $missingProperty = it.util.escapeQuotes($propertyKey) + , $useData = $data + $prop; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + }} + if ({{# def.noPropertyInData }}) { + {{# def.addError:_error }} + } +#}} diff --git a/node_modules/ajv/lib/dot/multipleOf.jst b/node_modules/ajv/lib/dot/multipleOf.jst new file mode 100644 index 000000000..6d88a456f --- /dev/null +++ b/node_modules/ajv/lib/dot/multipleOf.jst @@ -0,0 +1,22 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{# def.numberKeyword }} + +var division{{=$lvl}}; +if ({{?$isData}} + {{=$schemaValue}} !== undefined && ( + typeof {{=$schemaValue}} != 'number' || + {{?}} + (division{{=$lvl}} = {{=$data}} / {{=$schemaValue}}, + {{? it.opts.multipleOfPrecision }} + Math.abs(Math.round(division{{=$lvl}}) - division{{=$lvl}}) > 1e-{{=it.opts.multipleOfPrecision}} + {{??}} + division{{=$lvl}} !== parseInt(division{{=$lvl}}) + {{?}} + ) + {{?$isData}} ) {{?}} ) { + {{# def.error:'multipleOf' }} +} {{? $breakOnError }} else { {{?}} diff --git a/node_modules/ajv/lib/dot/not.jst b/node_modules/ajv/lib/dot/not.jst new file mode 100644 index 000000000..e03185ae8 --- /dev/null +++ b/node_modules/ajv/lib/dot/not.jst @@ -0,0 +1,43 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + +{{? {{# def.nonEmptySchema:$schema }} }} + {{ + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + }} + + var {{=$errs}} = errors; + + {{# def.setCompositeRule }} + + {{ + $it.createErrors = false; + var $allErrorsOption; + if ($it.opts.allErrors) { + $allErrorsOption = $it.opts.allErrors; + $it.opts.allErrors = false; + } + }} + {{= it.validate($it) }} + {{ + $it.createErrors = true; + if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption; + }} + + {{# def.resetCompositeRule }} + + if ({{=$nextValid}}) { + {{# def.error:'not' }} + } else { + {{# def.resetErrors }} + {{? it.opts.allErrors }} } {{?}} +{{??}} + {{# def.addError:'not' }} + {{? $breakOnError}} + if (false) { + {{?}} +{{?}} diff --git a/node_modules/ajv/lib/dot/oneOf.jst b/node_modules/ajv/lib/dot/oneOf.jst new file mode 100644 index 000000000..bcce2c6ed --- /dev/null +++ b/node_modules/ajv/lib/dot/oneOf.jst @@ -0,0 +1,54 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + +{{ + var $currentBaseId = $it.baseId + , $prevValid = 'prevValid' + $lvl + , $passingSchemas = 'passingSchemas' + $lvl; +}} + +var {{=$errs}} = errors + , {{=$prevValid}} = false + , {{=$valid}} = false + , {{=$passingSchemas}} = null; + +{{# def.setCompositeRule }} + +{{~ $schema:$sch:$i }} + {{? {{# def.nonEmptySchema:$sch }} }} + {{ + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + }} + + {{# def.insertSubschemaCode }} + {{??}} + var {{=$nextValid}} = true; + {{?}} + + {{? $i }} + if ({{=$nextValid}} && {{=$prevValid}}) { + {{=$valid}} = false; + {{=$passingSchemas}} = [{{=$passingSchemas}}, {{=$i}}]; + } else { + {{ $closingBraces += '}'; }} + {{?}} + + if ({{=$nextValid}}) { + {{=$valid}} = {{=$prevValid}} = true; + {{=$passingSchemas}} = {{=$i}}; + } +{{~}} + +{{# def.resetCompositeRule }} + +{{= $closingBraces }} + +if (!{{=$valid}}) { + {{# def.extraError:'oneOf' }} +} else { + {{# def.resetErrors }} +{{? it.opts.allErrors }} } {{?}} diff --git a/node_modules/ajv/lib/dot/pattern.jst b/node_modules/ajv/lib/dot/pattern.jst new file mode 100644 index 000000000..3a37ef6cb --- /dev/null +++ b/node_modules/ajv/lib/dot/pattern.jst @@ -0,0 +1,14 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{ + var $regexp = $isData + ? '(new RegExp(' + $schemaValue + '))' + : it.usePattern($schema); +}} + +if ({{# def.$dataNotType:'string' }} !{{=$regexp}}.test({{=$data}}) ) { + {{# def.error:'pattern' }} +} {{? $breakOnError }} else { {{?}} diff --git a/node_modules/ajv/lib/dot/properties.jst b/node_modules/ajv/lib/dot/properties.jst new file mode 100644 index 000000000..5cebb9b12 --- /dev/null +++ b/node_modules/ajv/lib/dot/properties.jst @@ -0,0 +1,245 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + + +{{## def.validateAdditional: + {{ /* additionalProperties is schema */ + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty + ? it.errorPath + : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + }} + + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} +#}} + + +{{ + var $key = 'key' + $lvl + , $idx = 'idx' + $lvl + , $dataNxt = $it.dataLevel = it.dataLevel + 1 + , $nextData = 'data' + $dataNxt + , $dataProperties = 'dataProperties' + $lvl; + + var $schemaKeys = Object.keys($schema || {}).filter(notProto) + , $pProperties = it.schema.patternProperties || {} + , $pPropertyKeys = Object.keys($pProperties).filter(notProto) + , $aProperties = it.schema.additionalProperties + , $someProperties = $schemaKeys.length || $pPropertyKeys.length + , $noAdditional = $aProperties === false + , $additionalIsSchema = typeof $aProperties == 'object' + && Object.keys($aProperties).length + , $removeAdditional = it.opts.removeAdditional + , $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional + , $ownProperties = it.opts.ownProperties + , $currentBaseId = it.baseId; + + var $required = it.schema.required; + if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) { + var $requiredHash = it.util.toHash($required); + } + + function notProto(p) { return p !== '__proto__'; } +}} + + +var {{=$errs}} = errors; +var {{=$nextValid}} = true; +{{? $ownProperties }} + var {{=$dataProperties}} = undefined; +{{?}} + +{{? $checkAdditional }} + {{# def.iterateProperties }} + {{? $someProperties }} + var isAdditional{{=$lvl}} = !(false + {{? $schemaKeys.length }} + {{? $schemaKeys.length > 8 }} + || validate.schema{{=$schemaPath}}.hasOwnProperty({{=$key}}) + {{??}} + {{~ $schemaKeys:$propertyKey }} + || {{=$key}} == {{= it.util.toQuotedString($propertyKey) }} + {{~}} + {{?}} + {{?}} + {{? $pPropertyKeys.length }} + {{~ $pPropertyKeys:$pProperty:$i }} + || {{= it.usePattern($pProperty) }}.test({{=$key}}) + {{~}} + {{?}} + ); + + if (isAdditional{{=$lvl}}) { + {{?}} + {{? $removeAdditional == 'all' }} + delete {{=$data}}[{{=$key}}]; + {{??}} + {{ + var $currentErrorPath = it.errorPath; + var $additionalProperty = '\' + ' + $key + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + } + }} + {{? $noAdditional }} + {{? $removeAdditional }} + delete {{=$data}}[{{=$key}}]; + {{??}} + {{=$nextValid}} = false; + {{ + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalProperties'; + }} + {{# def.error:'additionalProperties' }} + {{ $errSchemaPath = $currErrSchemaPath; }} + {{? $breakOnError }} break; {{?}} + {{?}} + {{?? $additionalIsSchema }} + {{? $removeAdditional == 'failing' }} + var {{=$errs}} = errors; + {{# def.setCompositeRule }} + + {{# def.validateAdditional }} + + if (!{{=$nextValid}}) { + errors = {{=$errs}}; + if (validate.errors !== null) { + if (errors) validate.errors.length = errors; + else validate.errors = null; + } + delete {{=$data}}[{{=$key}}]; + } + + {{# def.resetCompositeRule }} + {{??}} + {{# def.validateAdditional }} + {{? $breakOnError }} if (!{{=$nextValid}}) break; {{?}} + {{?}} + {{?}} + {{ it.errorPath = $currentErrorPath; }} + {{?}} + {{? $someProperties }} + } + {{?}} + } + + {{# def.ifResultValid }} +{{?}} + +{{ var $useDefaults = it.opts.useDefaults && !it.compositeRule; }} + +{{? $schemaKeys.length }} + {{~ $schemaKeys:$propertyKey }} + {{ var $sch = $schema[$propertyKey]; }} + + {{? {{# def.nonEmptySchema:$sch}} }} + {{ + var $prop = it.util.getProperty($propertyKey) + , $passData = $data + $prop + , $hasDefault = $useDefaults && $sch.default !== undefined; + $it.schema = $sch; + $it.schemaPath = $schemaPath + $prop; + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey); + $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers); + $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey); + }} + + {{# def.generateSubschemaCode }} + + {{? {{# def.willOptimize }} }} + {{ + $code = {{# def._optimizeValidate }}; + var $useData = $passData; + }} + {{??}} + {{ var $useData = $nextData; }} + var {{=$nextData}} = {{=$passData}}; + {{?}} + + {{? $hasDefault }} + {{= $code }} + {{??}} + {{? $requiredHash && $requiredHash[$propertyKey] }} + if ({{# def.noPropertyInData }}) { + {{=$nextValid}} = false; + {{ + var $currentErrorPath = it.errorPath + , $currErrSchemaPath = $errSchemaPath + , $missingProperty = it.util.escapeQuotes($propertyKey); + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + $errSchemaPath = it.errSchemaPath + '/required'; + }} + {{# def.error:'required' }} + {{ $errSchemaPath = $currErrSchemaPath; }} + {{ it.errorPath = $currentErrorPath; }} + } else { + {{??}} + {{? $breakOnError }} + if ({{# def.noPropertyInData }}) { + {{=$nextValid}} = true; + } else { + {{??}} + if ({{=$useData}} !== undefined + {{? $ownProperties }} + && {{# def.isOwnProperty }} + {{?}} + ) { + {{?}} + {{?}} + + {{= $code }} + } + {{?}} {{ /* $hasDefault */ }} + {{?}} {{ /* def.nonEmptySchema */ }} + + {{# def.ifResultValid }} + {{~}} +{{?}} + +{{? $pPropertyKeys.length }} + {{~ $pPropertyKeys:$pProperty }} + {{ var $sch = $pProperties[$pProperty]; }} + + {{? {{# def.nonEmptySchema:$sch}} }} + {{ + $it.schema = $sch; + $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); + $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + + it.util.escapeFragment($pProperty); + }} + + {{# def.iterateProperties }} + if ({{= it.usePattern($pProperty) }}.test({{=$key}})) { + {{ + $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + }} + + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} + + {{? $breakOnError }} if (!{{=$nextValid}}) break; {{?}} + } + {{? $breakOnError }} else {{=$nextValid}} = true; {{?}} + } + + {{# def.ifResultValid }} + {{?}} {{ /* def.nonEmptySchema */ }} + {{~}} +{{?}} + + +{{? $breakOnError }} + {{= $closingBraces }} + if ({{=$errs}} == errors) { +{{?}} diff --git a/node_modules/ajv/lib/dot/propertyNames.jst b/node_modules/ajv/lib/dot/propertyNames.jst new file mode 100644 index 000000000..d456ccafc --- /dev/null +++ b/node_modules/ajv/lib/dot/propertyNames.jst @@ -0,0 +1,52 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + +var {{=$errs}} = errors; + +{{? {{# def.nonEmptySchema:$schema }} }} + {{ + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + }} + + {{ + var $key = 'key' + $lvl + , $idx = 'idx' + $lvl + , $i = 'i' + $lvl + , $invalidName = '\' + ' + $key + ' + \'' + , $dataNxt = $it.dataLevel = it.dataLevel + 1 + , $nextData = 'data' + $dataNxt + , $dataProperties = 'dataProperties' + $lvl + , $ownProperties = it.opts.ownProperties + , $currentBaseId = it.baseId; + }} + + {{? $ownProperties }} + var {{=$dataProperties}} = undefined; + {{?}} + {{# def.iterateProperties }} + var startErrs{{=$lvl}} = errors; + + {{ var $passData = $key; }} + {{# def.setCompositeRule }} + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} + {{# def.resetCompositeRule }} + + if (!{{=$nextValid}}) { + for (var {{=$i}}=startErrs{{=$lvl}}; {{=$i}}= it.opts.loopRequired + , $ownProperties = it.opts.ownProperties; + }} + + {{? $breakOnError }} + var missing{{=$lvl}}; + {{? $loopRequired }} + {{# def.setupLoop }} + var {{=$valid}} = true; + + {{?$isData}}{{# def.check$dataIsArray }}{{?}} + + for (var {{=$i}} = 0; {{=$i}} < {{=$vSchema}}.length; {{=$i}}++) { + {{=$valid}} = {{=$data}}[{{=$vSchema}}[{{=$i}}]] !== undefined + {{? $ownProperties }} + && {{# def.isRequiredOwnProperty }} + {{?}}; + if (!{{=$valid}}) break; + } + + {{? $isData }} } {{?}} + + {{# def.checkError:'required' }} + else { + {{??}} + if ({{# def.checkMissingProperty:$required }}) { + {{# def.errorMissingProperty:'required' }} + } else { + {{?}} + {{??}} + {{? $loopRequired }} + {{# def.setupLoop }} + {{? $isData }} + if ({{=$vSchema}} && !Array.isArray({{=$vSchema}})) { + {{# def.addError:'required' }} + } else if ({{=$vSchema}} !== undefined) { + {{?}} + + for (var {{=$i}} = 0; {{=$i}} < {{=$vSchema}}.length; {{=$i}}++) { + if ({{=$data}}[{{=$vSchema}}[{{=$i}}]] === undefined + {{? $ownProperties }} + || !{{# def.isRequiredOwnProperty }} + {{?}}) { + {{# def.addError:'required' }} + } + } + + {{? $isData }} } {{?}} + {{??}} + {{~ $required:$propertyKey }} + {{# def.allErrorsMissingProperty:'required' }} + {{~}} + {{?}} + {{?}} + + {{ it.errorPath = $currentErrorPath; }} + +{{?? $breakOnError }} + if (true) { +{{?}} diff --git a/node_modules/ajv/lib/dot/uniqueItems.jst b/node_modules/ajv/lib/dot/uniqueItems.jst new file mode 100644 index 000000000..e69b8308d --- /dev/null +++ b/node_modules/ajv/lib/dot/uniqueItems.jst @@ -0,0 +1,62 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + + +{{? ($schema || $isData) && it.opts.uniqueItems !== false }} + {{? $isData }} + var {{=$valid}}; + if ({{=$schemaValue}} === false || {{=$schemaValue}} === undefined) + {{=$valid}} = true; + else if (typeof {{=$schemaValue}} != 'boolean') + {{=$valid}} = false; + else { + {{?}} + + var i = {{=$data}}.length + , {{=$valid}} = true + , j; + if (i > 1) { + {{ + var $itemType = it.schema.items && it.schema.items.type + , $typeIsArray = Array.isArray($itemType); + }} + {{? !$itemType || $itemType == 'object' || $itemType == 'array' || + ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0)) }} + outer: + for (;i--;) { + for (j = i; j--;) { + if (equal({{=$data}}[i], {{=$data}}[j])) { + {{=$valid}} = false; + break outer; + } + } + } + {{??}} + var itemIndices = {}, item; + for (;i--;) { + var item = {{=$data}}[i]; + {{ var $method = 'checkDataType' + ($typeIsArray ? 's' : ''); }} + if ({{= it.util[$method]($itemType, 'item', it.opts.strictNumbers, true) }}) continue; + {{? $typeIsArray}} + if (typeof item == 'string') item = '"' + item; + {{?}} + if (typeof itemIndices[item] == 'number') { + {{=$valid}} = false; + j = itemIndices[item]; + break; + } + itemIndices[item] = i; + } + {{?}} + } + + {{? $isData }} } {{?}} + + if (!{{=$valid}}) { + {{# def.error:'uniqueItems' }} + } {{? $breakOnError }} else { {{?}} +{{??}} + {{? $breakOnError }} if (true) { {{?}} +{{?}} diff --git a/node_modules/ajv/lib/dot/validate.jst b/node_modules/ajv/lib/dot/validate.jst new file mode 100644 index 000000000..32087e71c --- /dev/null +++ b/node_modules/ajv/lib/dot/validate.jst @@ -0,0 +1,276 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.defaults }} +{{# def.coerce }} + +{{ /** + * schema compilation (render) time: + * it = { schema, RULES, _validate, opts } + * it.validate - this template function, + * it is used recursively to generate code for subschemas + * + * runtime: + * "validate" is a variable name to which this function will be assigned + * validateRef etc. are defined in the parent scope in index.js + */ }} + +{{ + var $async = it.schema.$async === true + , $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref') + , $id = it.self._getId(it.schema); +}} + +{{ + if (it.opts.strictKeywords) { + var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords); + if ($unknownKwd) { + var $keywordsMsg = 'unknown keyword: ' + $unknownKwd; + if (it.opts.strictKeywords === 'log') it.logger.warn($keywordsMsg); + else throw new Error($keywordsMsg); + } + } +}} + +{{? it.isTop }} + var validate = {{?$async}}{{it.async = true;}}async {{?}}function(data, dataPath, parentData, parentDataProperty, rootData) { + 'use strict'; + {{? $id && (it.opts.sourceCode || it.opts.processCode) }} + {{= '/\*# sourceURL=' + $id + ' */' }} + {{?}} +{{?}} + +{{? typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref) }} + {{ var $keyword = 'false schema'; }} + {{# def.setupKeyword }} + {{? it.schema === false}} + {{? it.isTop}} + {{ $breakOnError = true; }} + {{??}} + var {{=$valid}} = false; + {{?}} + {{# def.error:'false schema' }} + {{??}} + {{? it.isTop}} + {{? $async }} + return data; + {{??}} + validate.errors = null; + return true; + {{?}} + {{??}} + var {{=$valid}} = true; + {{?}} + {{?}} + + {{? it.isTop}} + }; + return validate; + {{?}} + + {{ return out; }} +{{?}} + + +{{? it.isTop }} + {{ + var $top = it.isTop + , $lvl = it.level = 0 + , $dataLvl = it.dataLevel = 0 + , $data = 'data'; + it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema)); + it.baseId = it.baseId || it.rootId; + delete it.isTop; + + it.dataPathArr = [""]; + + if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) { + var $defaultMsg = 'default is ignored in the schema root'; + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); + else throw new Error($defaultMsg); + } + }} + + var vErrors = null; {{ /* don't edit, used in replace */ }} + var errors = 0; {{ /* don't edit, used in replace */ }} + if (rootData === undefined) rootData = data; {{ /* don't edit, used in replace */ }} +{{??}} + {{ + var $lvl = it.level + , $dataLvl = it.dataLevel + , $data = 'data' + ($dataLvl || ''); + + if ($id) it.baseId = it.resolve.url(it.baseId, $id); + + if ($async && !it.async) throw new Error('async schema in sync schema'); + }} + + var errs_{{=$lvl}} = errors; +{{?}} + +{{ + var $valid = 'valid' + $lvl + , $breakOnError = !it.opts.allErrors + , $closingBraces1 = '' + , $closingBraces2 = ''; + + var $errorKeyword; + var $typeSchema = it.schema.type + , $typeIsArray = Array.isArray($typeSchema); + + if ($typeSchema && it.opts.nullable && it.schema.nullable === true) { + if ($typeIsArray) { + if ($typeSchema.indexOf('null') == -1) + $typeSchema = $typeSchema.concat('null'); + } else if ($typeSchema != 'null') { + $typeSchema = [$typeSchema, 'null']; + $typeIsArray = true; + } + } + + if ($typeIsArray && $typeSchema.length == 1) { + $typeSchema = $typeSchema[0]; + $typeIsArray = false; + } +}} + +{{## def.checkType: + {{ + var $schemaPath = it.schemaPath + '.type' + , $errSchemaPath = it.errSchemaPath + '/type' + , $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; + }} + + if ({{= it.util[$method]($typeSchema, $data, it.opts.strictNumbers, true) }}) { +#}} + +{{? it.schema.$ref && $refKeywords }} + {{? it.opts.extendRefs == 'fail' }} + {{ throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)'); }} + {{?? it.opts.extendRefs !== true }} + {{ + $refKeywords = false; + it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); + }} + {{?}} +{{?}} + +{{? it.schema.$comment && it.opts.$comment }} + {{= it.RULES.all.$comment.code(it, '$comment') }} +{{?}} + +{{? $typeSchema }} + {{? it.opts.coerceTypes }} + {{ var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); }} + {{?}} + + {{ var $rulesGroup = it.RULES.types[$typeSchema]; }} + {{? $coerceToTypes || $typeIsArray || $rulesGroup === true || + ($rulesGroup && !$shouldUseGroup($rulesGroup)) }} + {{ + var $schemaPath = it.schemaPath + '.type' + , $errSchemaPath = it.errSchemaPath + '/type'; + }} + {{# def.checkType }} + {{? $coerceToTypes }} + {{# def.coerceType }} + {{??}} + {{# def.error:'type' }} + {{?}} + } + {{?}} +{{?}} + + +{{? it.schema.$ref && !$refKeywords }} + {{= it.RULES.all.$ref.code(it, '$ref') }} + {{? $breakOnError }} + } + if (errors === {{?$top}}0{{??}}errs_{{=$lvl}}{{?}}) { + {{ $closingBraces2 += '}'; }} + {{?}} +{{??}} + {{~ it.RULES:$rulesGroup }} + {{? $shouldUseGroup($rulesGroup) }} + {{? $rulesGroup.type }} + if ({{= it.util.checkDataType($rulesGroup.type, $data, it.opts.strictNumbers) }}) { + {{?}} + {{? it.opts.useDefaults }} + {{? $rulesGroup.type == 'object' && it.schema.properties }} + {{# def.defaultProperties }} + {{?? $rulesGroup.type == 'array' && Array.isArray(it.schema.items) }} + {{# def.defaultItems }} + {{?}} + {{?}} + {{~ $rulesGroup.rules:$rule }} + {{? $shouldUseRule($rule) }} + {{ var $code = $rule.code(it, $rule.keyword, $rulesGroup.type); }} + {{? $code }} + {{= $code }} + {{? $breakOnError }} + {{ $closingBraces1 += '}'; }} + {{?}} + {{?}} + {{?}} + {{~}} + {{? $breakOnError }} + {{= $closingBraces1 }} + {{ $closingBraces1 = ''; }} + {{?}} + {{? $rulesGroup.type }} + } + {{? $typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes }} + else { + {{ + var $schemaPath = it.schemaPath + '.type' + , $errSchemaPath = it.errSchemaPath + '/type'; + }} + {{# def.error:'type' }} + } + {{?}} + {{?}} + + {{? $breakOnError }} + if (errors === {{?$top}}0{{??}}errs_{{=$lvl}}{{?}}) { + {{ $closingBraces2 += '}'; }} + {{?}} + {{?}} + {{~}} +{{?}} + +{{? $breakOnError }} {{= $closingBraces2 }} {{?}} + +{{? $top }} + {{? $async }} + if (errors === 0) return data; {{ /* don't edit, used in replace */ }} + else throw new ValidationError(vErrors); {{ /* don't edit, used in replace */ }} + {{??}} + validate.errors = vErrors; {{ /* don't edit, used in replace */ }} + return errors === 0; {{ /* don't edit, used in replace */ }} + {{?}} + }; + + return validate; +{{??}} + var {{=$valid}} = errors === errs_{{=$lvl}}; +{{?}} + +{{ + function $shouldUseGroup($rulesGroup) { + var rules = $rulesGroup.rules; + for (var i=0; i < rules.length; i++) + if ($shouldUseRule(rules[i])) + return true; + } + + function $shouldUseRule($rule) { + return it.schema[$rule.keyword] !== undefined || + ($rule.implements && $ruleImplementsSomeKeyword($rule)); + } + + function $ruleImplementsSomeKeyword($rule) { + var impl = $rule.implements; + for (var i=0; i < impl.length; i++) + if (it.schema[impl[i]] !== undefined) + return true; + } +}} diff --git a/node_modules/ajv/lib/dotjs/README.md b/node_modules/ajv/lib/dotjs/README.md new file mode 100644 index 000000000..4d994846c --- /dev/null +++ b/node_modules/ajv/lib/dotjs/README.md @@ -0,0 +1,3 @@ +These files are compiled dot templates from dot folder. + +Do NOT edit them directly, edit the templates and run `npm run build` from main ajv folder. diff --git a/node_modules/ajv/lib/dotjs/_limit.js b/node_modules/ajv/lib/dotjs/_limit.js new file mode 100644 index 000000000..05a1979dc --- /dev/null +++ b/node_modules/ajv/lib/dotjs/_limit.js @@ -0,0 +1,163 @@ +'use strict'; +module.exports = function generate__limit(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $isMax = $keyword == 'maximum', + $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum', + $schemaExcl = it.schema[$exclusiveKeyword], + $isDataExcl = it.opts.$data && $schemaExcl && $schemaExcl.$data, + $op = $isMax ? '<' : '>', + $notOp = $isMax ? '>' : '<', + $errorKeyword = undefined; + if (!($isData || typeof $schema == 'number' || $schema === undefined)) { + throw new Error($keyword + ' must be number'); + } + if (!($isDataExcl || $schemaExcl === undefined || typeof $schemaExcl == 'number' || typeof $schemaExcl == 'boolean')) { + throw new Error($exclusiveKeyword + ' must be number or boolean'); + } + if ($isDataExcl) { + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), + $exclusive = 'exclusive' + $lvl, + $exclType = 'exclType' + $lvl, + $exclIsNumber = 'exclIsNumber' + $lvl, + $opExpr = 'op' + $lvl, + $opStr = '\' + ' + $opExpr + ' + \''; + out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; + $schemaValueExcl = 'schemaExcl' + $lvl; + out += ' var ' + ($exclusive) + '; var ' + ($exclType) + ' = typeof ' + ($schemaValueExcl) + '; if (' + ($exclType) + ' != \'boolean\' && ' + ($exclType) + ' != \'undefined\' && ' + ($exclType) + ' != \'number\') { '; + var $errorKeyword = $exclusiveKeyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_exclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($exclType) + ' == \'number\' ? ( (' + ($exclusive) + ' = ' + ($schemaValue) + ' === undefined || ' + ($schemaValueExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ') ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValueExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) : ( (' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\'; '; + if ($schema === undefined) { + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; + $schemaValue = $schemaValueExcl; + $isData = $isDataExcl; + } + } else { + var $exclIsNumber = typeof $schemaExcl == 'number', + $opStr = $op; + if ($exclIsNumber && $isData) { + var $opExpr = '\'' + $opStr + '\''; + out += ' if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ( ' + ($schemaValue) + ' === undefined || ' + ($schemaExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ' ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { '; + } else { + if ($exclIsNumber && $schema === undefined) { + $exclusive = true; + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; + $schemaValue = $schemaExcl; + $notOp += '='; + } else { + if ($exclIsNumber) $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema); + if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) { + $exclusive = true; + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; + $notOp += '='; + } else { + $exclusive = false; + $opStr += '='; + } + } + var $opExpr = '\'' + $opStr + '\''; + out += ' if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') { '; + } + } + $errorKeyword = $errorKeyword || $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be ' + ($opStr) + ' '; + if ($isData) { + out += '\' + ' + ($schemaValue); + } else { + out += '' + ($schemaValue) + '\''; + } + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/_limitItems.js b/node_modules/ajv/lib/dotjs/_limitItems.js new file mode 100644 index 000000000..e092a559e --- /dev/null +++ b/node_modules/ajv/lib/dotjs/_limitItems.js @@ -0,0 +1,80 @@ +'use strict'; +module.exports = function generate__limitItems(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!($isData || typeof $schema == 'number')) { + throw new Error($keyword + ' must be number'); + } + var $op = $keyword == 'maxItems' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have '; + if ($keyword == 'maxItems') { + out += 'more'; + } else { + out += 'fewer'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' items\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/_limitLength.js b/node_modules/ajv/lib/dotjs/_limitLength.js new file mode 100644 index 000000000..ecbd3fe19 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/_limitLength.js @@ -0,0 +1,85 @@ +'use strict'; +module.exports = function generate__limitLength(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!($isData || typeof $schema == 'number')) { + throw new Error($keyword + ' must be number'); + } + var $op = $keyword == 'maxLength' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + if (it.opts.unicode === false) { + out += ' ' + ($data) + '.length '; + } else { + out += ' ucs2length(' + ($data) + ') '; + } + out += ' ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitLength') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be '; + if ($keyword == 'maxLength') { + out += 'longer'; + } else { + out += 'shorter'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' characters\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/_limitProperties.js b/node_modules/ajv/lib/dotjs/_limitProperties.js new file mode 100644 index 000000000..d232755ad --- /dev/null +++ b/node_modules/ajv/lib/dotjs/_limitProperties.js @@ -0,0 +1,80 @@ +'use strict'; +module.exports = function generate__limitProperties(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!($isData || typeof $schema == 'number')) { + throw new Error($keyword + ' must be number'); + } + var $op = $keyword == 'maxProperties' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have '; + if ($keyword == 'maxProperties') { + out += 'more'; + } else { + out += 'fewer'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' properties\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/allOf.js b/node_modules/ajv/lib/dotjs/allOf.js new file mode 100644 index 000000000..fb8c2e4bb --- /dev/null +++ b/node_modules/ajv/lib/dotjs/allOf.js @@ -0,0 +1,42 @@ +'use strict'; +module.exports = function generate_allOf(it, $keyword, $ruleType) { + var out = ' '; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $currentBaseId = $it.baseId, + $allSchemasEmpty = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + $allSchemasEmpty = false; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if ($breakOnError) { + if ($allSchemasEmpty) { + out += ' if (true) { '; + } else { + out += ' ' + ($closingBraces.slice(0, -1)) + ' '; + } + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/anyOf.js b/node_modules/ajv/lib/dotjs/anyOf.js new file mode 100644 index 000000000..0600a9d42 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/anyOf.js @@ -0,0 +1,73 @@ +'use strict'; +module.exports = function generate_anyOf(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $noEmptySchema = $schema.every(function($sch) { + return (it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all)); + }); + if ($noEmptySchema) { + var $currentBaseId = $it.baseId; + out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { '; + $closingBraces += '}'; + } + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should match some schema in anyOf\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; return false; '; + } + } + out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + if (it.opts.allErrors) { + out += ' } '; + } + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/comment.js b/node_modules/ajv/lib/dotjs/comment.js new file mode 100644 index 000000000..dd66bb8f0 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/comment.js @@ -0,0 +1,14 @@ +'use strict'; +module.exports = function generate_comment(it, $keyword, $ruleType) { + var out = ' '; + var $schema = it.schema[$keyword]; + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $comment = it.util.toQuotedString($schema); + if (it.opts.$comment === true) { + out += ' console.log(' + ($comment) + ');'; + } else if (typeof it.opts.$comment == 'function') { + out += ' self._opts.$comment(' + ($comment) + ', ' + (it.util.toQuotedString($errSchemaPath)) + ', validate.root.schema);'; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/const.js b/node_modules/ajv/lib/dotjs/const.js new file mode 100644 index 000000000..15b7c619f --- /dev/null +++ b/node_modules/ajv/lib/dotjs/const.js @@ -0,0 +1,56 @@ +'use strict'; +module.exports = function generate_const(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!$isData) { + out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';'; + } + out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('const') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValue: schema' + ($lvl) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be equal to constant\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' }'; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/contains.js b/node_modules/ajv/lib/dotjs/contains.js new file mode 100644 index 000000000..7d7630090 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/contains.js @@ -0,0 +1,81 @@ +'use strict'; +module.exports = function generate_contains(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $idx = 'i' + $lvl, + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $currentBaseId = it.baseId, + $nonEmptySchema = (it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all)); + out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; + if ($nonEmptySchema) { + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' var ' + ($nextValid) + ' = false; for (var ' + ($idx) + ' = 0; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' if (' + ($nextValid) + ') break; } '; + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($closingBraces) + ' if (!' + ($nextValid) + ') {'; + } else { + out += ' if (' + ($data) + '.length == 0) {'; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('contains') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should contain a valid item\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + if ($nonEmptySchema) { + out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + } + if (it.opts.allErrors) { + out += ' } '; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/custom.js b/node_modules/ajv/lib/dotjs/custom.js new file mode 100644 index 000000000..f3e641e70 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/custom.js @@ -0,0 +1,228 @@ +'use strict'; +module.exports = function generate_custom(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $rule = this, + $definition = 'definition' + $lvl, + $rDef = $rule.definition, + $closingBraces = ''; + var $compile, $inline, $macro, $ruleValidate, $validateCode; + if ($isData && $rDef.$data) { + $validateCode = 'keywordValidate' + $lvl; + var $validateSchema = $rDef.validateSchema; + out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;'; + } else { + $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it); + if (!$ruleValidate) return; + $schemaValue = 'validate.schema' + $schemaPath; + $validateCode = $ruleValidate.code; + $compile = $rDef.compile; + $inline = $rDef.inline; + $macro = $rDef.macro; + } + var $ruleErrs = $validateCode + '.errors', + $i = 'i' + $lvl, + $ruleErr = 'ruleErr' + $lvl, + $asyncKeyword = $rDef.async; + if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema'); + if (!($inline || $macro)) { + out += '' + ($ruleErrs) + ' = null;'; + } + out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; + if ($isData && $rDef.$data) { + $closingBraces += '}'; + out += ' if (' + ($schemaValue) + ' === undefined) { ' + ($valid) + ' = true; } else { '; + if ($validateSchema) { + $closingBraces += '}'; + out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') { '; + } + } + if ($inline) { + if ($rDef.statements) { + out += ' ' + ($ruleValidate.validate) + ' '; + } else { + out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; '; + } + } else if ($macro) { + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + $it.schema = $ruleValidate.validate; + $it.schemaPath = ''; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var $code = it.validate($it).replace(/validate\.schema/g, $validateCode); + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($code); + } else { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + out += ' ' + ($validateCode) + '.call( '; + if (it.opts.passContext) { + out += 'this'; + } else { + out += 'self'; + } + if ($compile || $rDef.schema === false) { + out += ' , ' + ($data) + ' '; + } else { + out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' '; + } + out += ' , (dataPath || \'\')'; + if (it.errorPath != '""') { + out += ' + ' + (it.errorPath); + } + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) '; + var def_callRuleValidate = out; + out = $$outStack.pop(); + if ($rDef.errors === false) { + out += ' ' + ($valid) + ' = '; + if ($asyncKeyword) { + out += 'await '; + } + out += '' + (def_callRuleValidate) + '; '; + } else { + if ($asyncKeyword) { + $ruleErrs = 'customErrors' + $lvl; + out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = await ' + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } '; + } else { + out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; '; + } + } + } + if ($rDef.modifying) { + out += ' if (' + ($parentData) + ') ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];'; + } + out += '' + ($closingBraces); + if ($rDef.valid) { + if ($breakOnError) { + out += ' if (true) { '; + } + } else { + out += ' if ( '; + if ($rDef.valid === undefined) { + out += ' !'; + if ($macro) { + out += '' + ($nextValid); + } else { + out += '' + ($valid); + } + } else { + out += ' ' + (!$rDef.valid) + ' '; + } + out += ') { '; + $errorKeyword = $rule.keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + var def_customError = out; + out = $$outStack.pop(); + if ($inline) { + if ($rDef.errors) { + if ($rDef.errors != 'full') { + out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + ' 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined '; + if ($ownProperties) { + out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') '; + } + out += ') { '; + $it.schema = $sch; + $it.schemaPath = $schemaPath + it.util.getProperty($property); + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property); + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/enum.js b/node_modules/ajv/lib/dotjs/enum.js new file mode 100644 index 000000000..90580b9ff --- /dev/null +++ b/node_modules/ajv/lib/dotjs/enum.js @@ -0,0 +1,66 @@ +'use strict'; +module.exports = function generate_enum(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $i = 'i' + $lvl, + $vSchema = 'schema' + $lvl; + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + ';'; + } + out += 'var ' + ($valid) + ';'; + if ($isData) { + out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; + } + out += '' + ($valid) + ' = false;for (var ' + ($i) + '=0; ' + ($i) + '<' + ($vSchema) + '.length; ' + ($i) + '++) if (equal(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + '])) { ' + ($valid) + ' = true; break; }'; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('enum') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValues: schema' + ($lvl) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be equal to one of the allowed values\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' }'; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/format.js b/node_modules/ajv/lib/dotjs/format.js new file mode 100644 index 000000000..cd9a5693e --- /dev/null +++ b/node_modules/ajv/lib/dotjs/format.js @@ -0,0 +1,150 @@ +'use strict'; +module.exports = function generate_format(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + if (it.opts.format === false) { + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $unknownFormats = it.opts.unknownFormats, + $allowUnknown = Array.isArray($unknownFormats); + if ($isData) { + var $format = 'format' + $lvl, + $isObject = 'isObject' + $lvl, + $formatType = 'formatType' + $lvl; + out += ' var ' + ($format) + ' = formats[' + ($schemaValue) + ']; var ' + ($isObject) + ' = typeof ' + ($format) + ' == \'object\' && !(' + ($format) + ' instanceof RegExp) && ' + ($format) + '.validate; var ' + ($formatType) + ' = ' + ($isObject) + ' && ' + ($format) + '.type || \'string\'; if (' + ($isObject) + ') { '; + if (it.async) { + out += ' var async' + ($lvl) + ' = ' + ($format) + '.async; '; + } + out += ' ' + ($format) + ' = ' + ($format) + '.validate; } if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; + } + out += ' ('; + if ($unknownFormats != 'ignore') { + out += ' (' + ($schemaValue) + ' && !' + ($format) + ' '; + if ($allowUnknown) { + out += ' && self._opts.unknownFormats.indexOf(' + ($schemaValue) + ') == -1 '; + } + out += ') || '; + } + out += ' (' + ($format) + ' && ' + ($formatType) + ' == \'' + ($ruleType) + '\' && !(typeof ' + ($format) + ' == \'function\' ? '; + if (it.async) { + out += ' (async' + ($lvl) + ' ? await ' + ($format) + '(' + ($data) + ') : ' + ($format) + '(' + ($data) + ')) '; + } else { + out += ' ' + ($format) + '(' + ($data) + ') '; + } + out += ' : ' + ($format) + '.test(' + ($data) + '))))) {'; + } else { + var $format = it.formats[$schema]; + if (!$format) { + if ($unknownFormats == 'ignore') { + it.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"'); + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } else if ($allowUnknown && $unknownFormats.indexOf($schema) >= 0) { + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } else { + throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"'); + } + } + var $isObject = typeof $format == 'object' && !($format instanceof RegExp) && $format.validate; + var $formatType = $isObject && $format.type || 'string'; + if ($isObject) { + var $async = $format.async === true; + $format = $format.validate; + } + if ($formatType != $ruleType) { + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } + if ($async) { + if (!it.async) throw new Error('async format in sync schema'); + var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate'; + out += ' if (!(await ' + ($formatRef) + '(' + ($data) + '))) { '; + } else { + out += ' if (! '; + var $formatRef = 'formats' + it.util.getProperty($schema); + if ($isObject) $formatRef += '.validate'; + if (typeof $format == 'function') { + out += ' ' + ($formatRef) + '(' + ($data) + ') '; + } else { + out += ' ' + ($formatRef) + '.test(' + ($data) + ') '; + } + out += ') { '; + } + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('format') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { format: '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match format "'; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + (it.util.escapeQuotes($schema)); + } + out += '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/if.js b/node_modules/ajv/lib/dotjs/if.js new file mode 100644 index 000000000..94d27ad85 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/if.js @@ -0,0 +1,103 @@ +'use strict'; +module.exports = function generate_if(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + var $thenSch = it.schema['then'], + $elseSch = it.schema['else'], + $thenPresent = $thenSch !== undefined && (it.opts.strictKeywords ? (typeof $thenSch == 'object' && Object.keys($thenSch).length > 0) || $thenSch === false : it.util.schemaHasRules($thenSch, it.RULES.all)), + $elsePresent = $elseSch !== undefined && (it.opts.strictKeywords ? (typeof $elseSch == 'object' && Object.keys($elseSch).length > 0) || $elseSch === false : it.util.schemaHasRules($elseSch, it.RULES.all)), + $currentBaseId = $it.baseId; + if ($thenPresent || $elsePresent) { + var $ifClause; + $it.createErrors = false; + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = true; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + $it.createErrors = true; + out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + it.compositeRule = $it.compositeRule = $wasComposite; + if ($thenPresent) { + out += ' if (' + ($nextValid) + ') { '; + $it.schema = it.schema['then']; + $it.schemaPath = it.schemaPath + '.then'; + $it.errSchemaPath = it.errSchemaPath + '/then'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($nextValid) + '; '; + if ($thenPresent && $elsePresent) { + $ifClause = 'ifClause' + $lvl; + out += ' var ' + ($ifClause) + ' = \'then\'; '; + } else { + $ifClause = '\'then\''; + } + out += ' } '; + if ($elsePresent) { + out += ' else { '; + } + } else { + out += ' if (!' + ($nextValid) + ') { '; + } + if ($elsePresent) { + $it.schema = it.schema['else']; + $it.schemaPath = it.schemaPath + '.else'; + $it.errSchemaPath = it.errSchemaPath + '/else'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($nextValid) + '; '; + if ($thenPresent && $elsePresent) { + $ifClause = 'ifClause' + $lvl; + out += ' var ' + ($ifClause) + ' = \'else\'; '; + } else { + $ifClause = '\'else\''; + } + out += ' } '; + } + out += ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('if') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { failingKeyword: ' + ($ifClause) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match "\' + ' + ($ifClause) + ' + \'" schema\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; return false; '; + } + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/index.js b/node_modules/ajv/lib/dotjs/index.js new file mode 100644 index 000000000..2fb1b00ef --- /dev/null +++ b/node_modules/ajv/lib/dotjs/index.js @@ -0,0 +1,33 @@ +'use strict'; + +//all requires must be explicit because browserify won't work with dynamic requires +module.exports = { + '$ref': require('./ref'), + allOf: require('./allOf'), + anyOf: require('./anyOf'), + '$comment': require('./comment'), + const: require('./const'), + contains: require('./contains'), + dependencies: require('./dependencies'), + 'enum': require('./enum'), + format: require('./format'), + 'if': require('./if'), + items: require('./items'), + maximum: require('./_limit'), + minimum: require('./_limit'), + maxItems: require('./_limitItems'), + minItems: require('./_limitItems'), + maxLength: require('./_limitLength'), + minLength: require('./_limitLength'), + maxProperties: require('./_limitProperties'), + minProperties: require('./_limitProperties'), + multipleOf: require('./multipleOf'), + not: require('./not'), + oneOf: require('./oneOf'), + pattern: require('./pattern'), + properties: require('./properties'), + propertyNames: require('./propertyNames'), + required: require('./required'), + uniqueItems: require('./uniqueItems'), + validate: require('./validate') +}; diff --git a/node_modules/ajv/lib/dotjs/items.js b/node_modules/ajv/lib/dotjs/items.js new file mode 100644 index 000000000..bee5d67da --- /dev/null +++ b/node_modules/ajv/lib/dotjs/items.js @@ -0,0 +1,140 @@ +'use strict'; +module.exports = function generate_items(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $idx = 'i' + $lvl, + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $currentBaseId = it.baseId; + out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; + if (Array.isArray($schema)) { + var $additionalItems = it.schema.additionalItems; + if ($additionalItems === false) { + out += ' ' + ($valid) + ' = ' + ($data) + '.length <= ' + ($schema.length) + '; '; + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalItems'; + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('additionalItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schema.length) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have more than ' + ($schema.length) + ' items\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + $closingBraces += '}'; + out += ' else { '; + } + } + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { '; + var $passData = $data + '[' + $i + ']'; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true); + $it.dataPathArr[$dataNxt] = $i; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if (typeof $additionalItems == 'object' && (it.opts.strictKeywords ? (typeof $additionalItems == 'object' && Object.keys($additionalItems).length > 0) || $additionalItems === false : it.util.schemaHasRules($additionalItems, it.RULES.all))) { + $it.schema = $additionalItems; + $it.schemaPath = it.schemaPath + '.additionalItems'; + $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; + out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') { for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } else if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' }'; + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/multipleOf.js b/node_modules/ajv/lib/dotjs/multipleOf.js new file mode 100644 index 000000000..9d6401b8f --- /dev/null +++ b/node_modules/ajv/lib/dotjs/multipleOf.js @@ -0,0 +1,80 @@ +'use strict'; +module.exports = function generate_multipleOf(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!($isData || typeof $schema == 'number')) { + throw new Error($keyword + ' must be number'); + } + out += 'var division' + ($lvl) + ';if ('; + if ($isData) { + out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || '; + } + out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', '; + if (it.opts.multipleOfPrecision) { + out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' '; + } else { + out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') '; + } + out += ' ) '; + if ($isData) { + out += ' ) '; + } + out += ' ) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be multiple of '; + if ($isData) { + out += '\' + ' + ($schemaValue); + } else { + out += '' + ($schemaValue) + '\''; + } + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/not.js b/node_modules/ajv/lib/dotjs/not.js new file mode 100644 index 000000000..f50c93785 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/not.js @@ -0,0 +1,84 @@ +'use strict'; +module.exports = function generate_not(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.createErrors = false; + var $allErrorsOption; + if ($it.opts.allErrors) { + $allErrorsOption = $it.opts.allErrors; + $it.opts.allErrors = false; + } + out += ' ' + (it.validate($it)) + ' '; + $it.createErrors = true; + if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption; + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' if (' + ($nextValid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be valid\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + if (it.opts.allErrors) { + out += ' } '; + } + } else { + out += ' var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be valid\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if ($breakOnError) { + out += ' if (false) { '; + } + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/oneOf.js b/node_modules/ajv/lib/dotjs/oneOf.js new file mode 100644 index 000000000..dfe2fd550 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/oneOf.js @@ -0,0 +1,73 @@ +'use strict'; +module.exports = function generate_oneOf(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $currentBaseId = $it.baseId, + $prevValid = 'prevValid' + $lvl, + $passingSchemas = 'passingSchemas' + $lvl; + out += 'var ' + ($errs) + ' = errors , ' + ($prevValid) + ' = false , ' + ($valid) + ' = false , ' + ($passingSchemas) + ' = null; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + } else { + out += ' var ' + ($nextValid) + ' = true; '; + } + if ($i) { + out += ' if (' + ($nextValid) + ' && ' + ($prevValid) + ') { ' + ($valid) + ' = false; ' + ($passingSchemas) + ' = [' + ($passingSchemas) + ', ' + ($i) + ']; } else { '; + $closingBraces += '}'; + } + out += ' if (' + ($nextValid) + ') { ' + ($valid) + ' = ' + ($prevValid) + ' = true; ' + ($passingSchemas) + ' = ' + ($i) + '; }'; + } + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { passingSchemas: ' + ($passingSchemas) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match exactly one schema in oneOf\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; return false; '; + } + } + out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }'; + if (it.opts.allErrors) { + out += ' } '; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/pattern.js b/node_modules/ajv/lib/dotjs/pattern.js new file mode 100644 index 000000000..1d74d6b04 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/pattern.js @@ -0,0 +1,75 @@ +'use strict'; +module.exports = function generate_pattern(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema); + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; + } + out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('pattern') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern: '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match pattern "'; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + (it.util.escapeQuotes($schema)); + } + out += '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/properties.js b/node_modules/ajv/lib/dotjs/properties.js new file mode 100644 index 000000000..bc5ee5547 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/properties.js @@ -0,0 +1,335 @@ +'use strict'; +module.exports = function generate_properties(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $key = 'key' + $lvl, + $idx = 'idx' + $lvl, + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $dataProperties = 'dataProperties' + $lvl; + var $schemaKeys = Object.keys($schema || {}).filter(notProto), + $pProperties = it.schema.patternProperties || {}, + $pPropertyKeys = Object.keys($pProperties).filter(notProto), + $aProperties = it.schema.additionalProperties, + $someProperties = $schemaKeys.length || $pPropertyKeys.length, + $noAdditional = $aProperties === false, + $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length, + $removeAdditional = it.opts.removeAdditional, + $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional, + $ownProperties = it.opts.ownProperties, + $currentBaseId = it.baseId; + var $required = it.schema.required; + if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) { + var $requiredHash = it.util.toHash($required); + } + + function notProto(p) { + return p !== '__proto__'; + } + out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;'; + if ($ownProperties) { + out += ' var ' + ($dataProperties) + ' = undefined;'; + } + if ($checkAdditional) { + if ($ownProperties) { + out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; + } else { + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + } + if ($someProperties) { + out += ' var isAdditional' + ($lvl) + ' = !(false '; + if ($schemaKeys.length) { + if ($schemaKeys.length > 8) { + out += ' || validate.schema' + ($schemaPath) + '.hasOwnProperty(' + ($key) + ') '; + } else { + var arr1 = $schemaKeys; + if (arr1) { + var $propertyKey, i1 = -1, + l1 = arr1.length - 1; + while (i1 < l1) { + $propertyKey = arr1[i1 += 1]; + out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' '; + } + } + } + } + if ($pPropertyKeys.length) { + var arr2 = $pPropertyKeys; + if (arr2) { + var $pProperty, $i = -1, + l2 = arr2.length - 1; + while ($i < l2) { + $pProperty = arr2[$i += 1]; + out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') '; + } + } + } + out += ' ); if (isAdditional' + ($lvl) + ') { '; + } + if ($removeAdditional == 'all') { + out += ' delete ' + ($data) + '[' + ($key) + ']; '; + } else { + var $currentErrorPath = it.errorPath; + var $additionalProperty = '\' + ' + $key + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + } + if ($noAdditional) { + if ($removeAdditional) { + out += ' delete ' + ($data) + '[' + ($key) + ']; '; + } else { + out += ' ' + ($nextValid) + ' = false; '; + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalProperties'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is an invalid additional property'; + } else { + out += 'should NOT have additional properties'; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + out += ' break; '; + } + } + } else if ($additionalIsSchema) { + if ($removeAdditional == 'failing') { + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } '; + it.compositeRule = $it.compositeRule = $wasComposite; + } else { + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + } + } + it.errorPath = $currentErrorPath; + } + if ($someProperties) { + out += ' } '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + var $useDefaults = it.opts.useDefaults && !it.compositeRule; + if ($schemaKeys.length) { + var arr3 = $schemaKeys; + if (arr3) { + var $propertyKey, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $propertyKey = arr3[i3 += 1]; + var $sch = $schema[$propertyKey]; + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + var $prop = it.util.getProperty($propertyKey), + $passData = $data + $prop, + $hasDefault = $useDefaults && $sch.default !== undefined; + $it.schema = $sch; + $it.schemaPath = $schemaPath + $prop; + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey); + $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers); + $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey); + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + $code = it.util.varReplace($code, $nextData, $passData); + var $useData = $passData; + } else { + var $useData = $nextData; + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; '; + } + if ($hasDefault) { + out += ' ' + ($code) + ' '; + } else { + if ($requiredHash && $requiredHash[$propertyKey]) { + out += ' if ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') { ' + ($nextValid) + ' = false; '; + var $currentErrorPath = it.errorPath, + $currErrSchemaPath = $errSchemaPath, + $missingProperty = it.util.escapeQuotes($propertyKey); + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + $errSchemaPath = it.errSchemaPath + '/required'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + $errSchemaPath = $currErrSchemaPath; + it.errorPath = $currentErrorPath; + out += ' } else { '; + } else { + if ($breakOnError) { + out += ' if ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') { ' + ($nextValid) + ' = true; } else { '; + } else { + out += ' if (' + ($useData) + ' !== undefined '; + if ($ownProperties) { + out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ' ) { '; + } + } + out += ' ' + ($code) + ' } '; + } + } + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if ($pPropertyKeys.length) { + var arr4 = $pPropertyKeys; + if (arr4) { + var $pProperty, i4 = -1, + l4 = arr4.length - 1; + while (i4 < l4) { + $pProperty = arr4[i4 += 1]; + var $sch = $pProperties[$pProperty]; + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + $it.schema = $sch; + $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); + $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty); + if ($ownProperties) { + out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; + } else { + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + } + out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else ' + ($nextValid) + ' = true; '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/propertyNames.js b/node_modules/ajv/lib/dotjs/propertyNames.js new file mode 100644 index 000000000..2a54a08f4 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/propertyNames.js @@ -0,0 +1,81 @@ +'use strict'; +module.exports = function generate_propertyNames(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + out += 'var ' + ($errs) + ' = errors;'; + if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + var $key = 'key' + $lvl, + $idx = 'idx' + $lvl, + $i = 'i' + $lvl, + $invalidName = '\' + ' + $key + ' + \'', + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $dataProperties = 'dataProperties' + $lvl, + $ownProperties = it.opts.ownProperties, + $currentBaseId = it.baseId; + if ($ownProperties) { + out += ' var ' + ($dataProperties) + ' = undefined; '; + } + if ($ownProperties) { + out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; + } else { + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + } + out += ' var startErrs' + ($lvl) + ' = errors; '; + var $passData = $key; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' if (!' + ($nextValid) + ') { for (var ' + ($i) + '=startErrs' + ($lvl) + '; ' + ($i) + ' 0) || $propertySch === false : it.util.schemaHasRules($propertySch, it.RULES.all)))) { + $required[$required.length] = $property; + } + } + } + } else { + var $required = $schema; + } + } + if ($isData || $required.length) { + var $currentErrorPath = it.errorPath, + $loopRequired = $isData || $required.length >= it.opts.loopRequired, + $ownProperties = it.opts.ownProperties; + if ($breakOnError) { + out += ' var missing' + ($lvl) + '; '; + if ($loopRequired) { + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; + } + var $i = 'i' + $lvl, + $propertyPath = 'schema' + $lvl + '[' + $i + ']', + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); + } + out += ' var ' + ($valid) + ' = true; '; + if ($isData) { + out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; + } + out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined '; + if ($ownProperties) { + out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; + } + out += '; if (!' + ($valid) + ') break; } '; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + } else { + out += ' if ( '; + var arr2 = $required; + if (arr2) { + var $propertyKey, $i = -1, + l2 = arr2.length - 1; + while ($i < l2) { + $propertyKey = arr2[$i += 1]; + if ($i) { + out += ' || '; + } + var $prop = it.util.getProperty($propertyKey), + $useData = $data + $prop; + out += ' ( ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) '; + } + } + out += ') { '; + var $propertyPath = 'missing' + $lvl, + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + } + } else { + if ($loopRequired) { + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; + } + var $i = 'i' + $lvl, + $propertyPath = 'schema' + $lvl + '[' + $i + ']', + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); + } + if ($isData) { + out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { '; + } + out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; + } + out += ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } '; + if ($isData) { + out += ' } '; + } + } else { + var arr3 = $required; + if (arr3) { + var $propertyKey, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $propertyKey = arr3[i3 += 1]; + var $prop = it.util.getProperty($propertyKey), + $missingProperty = it.util.escapeQuotes($propertyKey), + $useData = $data + $prop; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + out += ' if ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; + } + } + } + } + it.errorPath = $currentErrorPath; + } else if ($breakOnError) { + out += ' if (true) {'; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/uniqueItems.js b/node_modules/ajv/lib/dotjs/uniqueItems.js new file mode 100644 index 000000000..0736a0ed2 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/uniqueItems.js @@ -0,0 +1,86 @@ +'use strict'; +module.exports = function generate_uniqueItems(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (($schema || $isData) && it.opts.uniqueItems !== false) { + if ($isData) { + out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'boolean\') ' + ($valid) + ' = false; else { '; + } + out += ' var i = ' + ($data) + '.length , ' + ($valid) + ' = true , j; if (i > 1) { '; + var $itemType = it.schema.items && it.schema.items.type, + $typeIsArray = Array.isArray($itemType); + if (!$itemType || $itemType == 'object' || $itemType == 'array' || ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0))) { + out += ' outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } '; + } else { + out += ' var itemIndices = {}, item; for (;i--;) { var item = ' + ($data) + '[i]; '; + var $method = 'checkDataType' + ($typeIsArray ? 's' : ''); + out += ' if (' + (it.util[$method]($itemType, 'item', it.opts.strictNumbers, true)) + ') continue; '; + if ($typeIsArray) { + out += ' if (typeof item == \'string\') item = \'"\' + item; '; + } + out += ' if (typeof itemIndices[item] == \'number\') { ' + ($valid) + ' = false; j = itemIndices[item]; break; } itemIndices[item] = i; } '; + } + out += ' } '; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('uniqueItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/validate.js b/node_modules/ajv/lib/dotjs/validate.js new file mode 100644 index 000000000..f295824b9 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/validate.js @@ -0,0 +1,482 @@ +'use strict'; +module.exports = function generate_validate(it, $keyword, $ruleType) { + var out = ''; + var $async = it.schema.$async === true, + $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'), + $id = it.self._getId(it.schema); + if (it.opts.strictKeywords) { + var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords); + if ($unknownKwd) { + var $keywordsMsg = 'unknown keyword: ' + $unknownKwd; + if (it.opts.strictKeywords === 'log') it.logger.warn($keywordsMsg); + else throw new Error($keywordsMsg); + } + } + if (it.isTop) { + out += ' var validate = '; + if ($async) { + it.async = true; + out += 'async '; + } + out += 'function(data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; '; + if ($id && (it.opts.sourceCode || it.opts.processCode)) { + out += ' ' + ('/\*# sourceURL=' + $id + ' */') + ' '; + } + } + if (typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref)) { + var $keyword = 'false schema'; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + if (it.schema === false) { + if (it.isTop) { + $breakOnError = true; + } else { + out += ' var ' + ($valid) + ' = false; '; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'false schema') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'boolean schema is false\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } else { + if (it.isTop) { + if ($async) { + out += ' return data; '; + } else { + out += ' validate.errors = null; return true; '; + } + } else { + out += ' var ' + ($valid) + ' = true; '; + } + } + if (it.isTop) { + out += ' }; return validate; '; + } + return out; + } + if (it.isTop) { + var $top = it.isTop, + $lvl = it.level = 0, + $dataLvl = it.dataLevel = 0, + $data = 'data'; + it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema)); + it.baseId = it.baseId || it.rootId; + delete it.isTop; + it.dataPathArr = [""]; + if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) { + var $defaultMsg = 'default is ignored in the schema root'; + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); + else throw new Error($defaultMsg); + } + out += ' var vErrors = null; '; + out += ' var errors = 0; '; + out += ' if (rootData === undefined) rootData = data; '; + } else { + var $lvl = it.level, + $dataLvl = it.dataLevel, + $data = 'data' + ($dataLvl || ''); + if ($id) it.baseId = it.resolve.url(it.baseId, $id); + if ($async && !it.async) throw new Error('async schema in sync schema'); + out += ' var errs_' + ($lvl) + ' = errors;'; + } + var $valid = 'valid' + $lvl, + $breakOnError = !it.opts.allErrors, + $closingBraces1 = '', + $closingBraces2 = ''; + var $errorKeyword; + var $typeSchema = it.schema.type, + $typeIsArray = Array.isArray($typeSchema); + if ($typeSchema && it.opts.nullable && it.schema.nullable === true) { + if ($typeIsArray) { + if ($typeSchema.indexOf('null') == -1) $typeSchema = $typeSchema.concat('null'); + } else if ($typeSchema != 'null') { + $typeSchema = [$typeSchema, 'null']; + $typeIsArray = true; + } + } + if ($typeIsArray && $typeSchema.length == 1) { + $typeSchema = $typeSchema[0]; + $typeIsArray = false; + } + if (it.schema.$ref && $refKeywords) { + if (it.opts.extendRefs == 'fail') { + throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)'); + } else if (it.opts.extendRefs !== true) { + $refKeywords = false; + it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); + } + } + if (it.schema.$comment && it.opts.$comment) { + out += ' ' + (it.RULES.all.$comment.code(it, '$comment')); + } + if ($typeSchema) { + if (it.opts.coerceTypes) { + var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); + } + var $rulesGroup = it.RULES.types[$typeSchema]; + if ($coerceToTypes || $typeIsArray || $rulesGroup === true || ($rulesGroup && !$shouldUseGroup($rulesGroup))) { + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type'; + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type', + $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; + out += ' if (' + (it.util[$method]($typeSchema, $data, it.opts.strictNumbers, true)) + ') { '; + if ($coerceToTypes) { + var $dataType = 'dataType' + $lvl, + $coerced = 'coerced' + $lvl; + out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; var ' + ($coerced) + ' = undefined; '; + if (it.opts.coerceTypes == 'array') { + out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ') && ' + ($data) + '.length == 1) { ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; if (' + (it.util.checkDataType(it.schema.type, $data, it.opts.strictNumbers)) + ') ' + ($coerced) + ' = ' + ($data) + '; } '; + } + out += ' if (' + ($coerced) + ' !== undefined) ; '; + var arr1 = $coerceToTypes; + if (arr1) { + var $type, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $type = arr1[$i += 1]; + if ($type == 'string') { + out += ' else if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; '; + } else if ($type == 'number' || $type == 'integer') { + out += ' else if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' '; + if ($type == 'integer') { + out += ' && !(' + ($data) + ' % 1)'; + } + out += ')) ' + ($coerced) + ' = +' + ($data) + '; '; + } else if ($type == 'boolean') { + out += ' else if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; '; + } else if ($type == 'null') { + out += ' else if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; '; + } else if (it.opts.coerceTypes == 'array' && $type == 'array') { + out += ' else if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; '; + } + } + } + out += ' else { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } if (' + ($coerced) + ' !== undefined) { '; + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' ' + ($data) + ' = ' + ($coerced) + '; '; + if (!$dataLvl) { + out += 'if (' + ($parentData) + ' !== undefined)'; + } + out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } '; + } else { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } + out += ' } '; + } + } + if (it.schema.$ref && !$refKeywords) { + out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' '; + if ($breakOnError) { + out += ' } if (errors === '; + if ($top) { + out += '0'; + } else { + out += 'errs_' + ($lvl); + } + out += ') { '; + $closingBraces2 += '}'; + } + } else { + var arr2 = it.RULES; + if (arr2) { + var $rulesGroup, i2 = -1, + l2 = arr2.length - 1; + while (i2 < l2) { + $rulesGroup = arr2[i2 += 1]; + if ($shouldUseGroup($rulesGroup)) { + if ($rulesGroup.type) { + out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data, it.opts.strictNumbers)) + ') { '; + } + if (it.opts.useDefaults) { + if ($rulesGroup.type == 'object' && it.schema.properties) { + var $schema = it.schema.properties, + $schemaKeys = Object.keys($schema); + var arr3 = $schemaKeys; + if (arr3) { + var $propertyKey, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $propertyKey = arr3[i3 += 1]; + var $sch = $schema[$propertyKey]; + if ($sch.default !== undefined) { + var $passData = $data + it.util.getProperty($propertyKey); + if (it.compositeRule) { + if (it.opts.strictDefaults) { + var $defaultMsg = 'default is ignored for: ' + $passData; + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); + else throw new Error($defaultMsg); + } + } else { + out += ' if (' + ($passData) + ' === undefined '; + if (it.opts.useDefaults == 'empty') { + out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' '; + } + out += ' ) ' + ($passData) + ' = '; + if (it.opts.useDefaults == 'shared') { + out += ' ' + (it.useDefault($sch.default)) + ' '; + } else { + out += ' ' + (JSON.stringify($sch.default)) + ' '; + } + out += '; '; + } + } + } + } + } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) { + var arr4 = it.schema.items; + if (arr4) { + var $sch, $i = -1, + l4 = arr4.length - 1; + while ($i < l4) { + $sch = arr4[$i += 1]; + if ($sch.default !== undefined) { + var $passData = $data + '[' + $i + ']'; + if (it.compositeRule) { + if (it.opts.strictDefaults) { + var $defaultMsg = 'default is ignored for: ' + $passData; + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); + else throw new Error($defaultMsg); + } + } else { + out += ' if (' + ($passData) + ' === undefined '; + if (it.opts.useDefaults == 'empty') { + out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' '; + } + out += ' ) ' + ($passData) + ' = '; + if (it.opts.useDefaults == 'shared') { + out += ' ' + (it.useDefault($sch.default)) + ' '; + } else { + out += ' ' + (JSON.stringify($sch.default)) + ' '; + } + out += '; '; + } + } + } + } + } + } + var arr5 = $rulesGroup.rules; + if (arr5) { + var $rule, i5 = -1, + l5 = arr5.length - 1; + while (i5 < l5) { + $rule = arr5[i5 += 1]; + if ($shouldUseRule($rule)) { + var $code = $rule.code(it, $rule.keyword, $rulesGroup.type); + if ($code) { + out += ' ' + ($code) + ' '; + if ($breakOnError) { + $closingBraces1 += '}'; + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces1) + ' '; + $closingBraces1 = ''; + } + if ($rulesGroup.type) { + out += ' } '; + if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) { + out += ' else { '; + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + } + } + if ($breakOnError) { + out += ' if (errors === '; + if ($top) { + out += '0'; + } else { + out += 'errs_' + ($lvl); + } + out += ') { '; + $closingBraces2 += '}'; + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces2) + ' '; + } + if ($top) { + if ($async) { + out += ' if (errors === 0) return data; '; + out += ' else throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; '; + out += ' return errors === 0; '; + } + out += ' }; return validate;'; + } else { + out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';'; + } + + function $shouldUseGroup($rulesGroup) { + var rules = $rulesGroup.rules; + for (var i = 0; i < rules.length; i++) + if ($shouldUseRule(rules[i])) return true; + } + + function $shouldUseRule($rule) { + return it.schema[$rule.keyword] !== undefined || ($rule.implements && $ruleImplementsSomeKeyword($rule)); + } + + function $ruleImplementsSomeKeyword($rule) { + var impl = $rule.implements; + for (var i = 0; i < impl.length; i++) + if (it.schema[impl[i]] !== undefined) return true; + } + return out; +} diff --git a/node_modules/ajv/lib/keyword.js b/node_modules/ajv/lib/keyword.js new file mode 100644 index 000000000..06da9a2df --- /dev/null +++ b/node_modules/ajv/lib/keyword.js @@ -0,0 +1,146 @@ +'use strict'; + +var IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i; +var customRuleCode = require('./dotjs/custom'); +var definitionSchema = require('./definition_schema'); + +module.exports = { + add: addKeyword, + get: getKeyword, + remove: removeKeyword, + validate: validateKeyword +}; + + +/** + * Define custom keyword + * @this Ajv + * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords). + * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`. + * @return {Ajv} this for method chaining + */ +function addKeyword(keyword, definition) { + /* jshint validthis: true */ + /* eslint no-shadow: 0 */ + var RULES = this.RULES; + if (RULES.keywords[keyword]) + throw new Error('Keyword ' + keyword + ' is already defined'); + + if (!IDENTIFIER.test(keyword)) + throw new Error('Keyword ' + keyword + ' is not a valid identifier'); + + if (definition) { + this.validateKeyword(definition, true); + + var dataType = definition.type; + if (Array.isArray(dataType)) { + for (var i=0; i ../ajv-dist/bower.json + cd ../ajv-dist + + if [[ `git status --porcelain` ]]; then + echo "Changes detected. Updating master branch..." + git add -A + git commit -m "updated by travis build #$TRAVIS_BUILD_NUMBER" + git push --quiet origin master > /dev/null 2>&1 + fi + + echo "Publishing tag..." + + git tag $TRAVIS_TAG + git push --tags > /dev/null 2>&1 + + echo "Done" +fi diff --git a/node_modules/ajv/scripts/travis-gh-pages b/node_modules/ajv/scripts/travis-gh-pages new file mode 100755 index 000000000..b3d4f3d0f --- /dev/null +++ b/node_modules/ajv/scripts/travis-gh-pages @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +set -e + +if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" && $TRAVIS_JOB_NUMBER =~ ".3" ]]; then + git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qE '\.md$|^LICENSE$|travis-gh-pages$' && { + rm -rf ../gh-pages + git clone -b gh-pages --single-branch https://${GITHUB_TOKEN}@github.com/ajv-validator/ajv.git ../gh-pages + mkdir -p ../gh-pages/_source + cp *.md ../gh-pages/_source + cp LICENSE ../gh-pages/_source + currentDir=$(pwd) + cd ../gh-pages + $currentDir/node_modules/.bin/gh-pages-generator + # remove logo from README + sed -i -E "s/]+ajv_logo[^>]+>//" index.md + git config user.email "$GIT_USER_EMAIL" + git config user.name "$GIT_USER_NAME" + git add . + git commit -am "updated by travis build #$TRAVIS_BUILD_NUMBER" + git push --quiet origin gh-pages > /dev/null 2>&1 + } +fi diff --git a/node_modules/ansi-colors/LICENSE b/node_modules/ansi-colors/LICENSE new file mode 100644 index 000000000..8749cc754 --- /dev/null +++ b/node_modules/ansi-colors/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-present, Brian Woodward. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/ansi-colors/README.md b/node_modules/ansi-colors/README.md new file mode 100644 index 000000000..dcdbcb503 --- /dev/null +++ b/node_modules/ansi-colors/README.md @@ -0,0 +1,315 @@ +# ansi-colors [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/ansi-colors.svg?style=flat)](https://www.npmjs.com/package/ansi-colors) [![NPM monthly downloads](https://img.shields.io/npm/dm/ansi-colors.svg?style=flat)](https://npmjs.org/package/ansi-colors) [![NPM total downloads](https://img.shields.io/npm/dt/ansi-colors.svg?style=flat)](https://npmjs.org/package/ansi-colors) [![Linux Build Status](https://img.shields.io/travis/doowb/ansi-colors.svg?style=flat&label=Travis)](https://travis-ci.org/doowb/ansi-colors) + +> Easily add ANSI colors to your text and symbols in the terminal. A faster drop-in replacement for chalk, kleur and turbocolor (without the dependencies and rendering bugs). + +Please consider following this project's author, [Brian Woodward](https://github.com/doowb), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save ansi-colors +``` + +![image](https://user-images.githubusercontent.com/383994/39635445-8a98a3a6-4f8b-11e8-89c1-068c45d4fff8.png) + +## Why use this? + +ansi-colors is _the fastest Node.js library for terminal styling_. A more performant drop-in replacement for chalk, with no dependencies. + +* _Blazing fast_ - Fastest terminal styling library in node.js, 10-20x faster than chalk! + +* _Drop-in replacement_ for [chalk](https://github.com/chalk/chalk). +* _No dependencies_ (Chalk has 7 dependencies in its tree!) + +* _Safe_ - Does not modify the `String.prototype` like [colors](https://github.com/Marak/colors.js). +* Supports [nested colors](#nested-colors), **and does not have the [nested styling bug](#nested-styling-bug) that is present in [colorette](https://github.com/jorgebucaran/colorette), [chalk](https://github.com/chalk/chalk), and [kleur](https://github.com/lukeed/kleur)**. +* Supports [chained colors](#chained-colors). +* [Toggle color support](#toggle-color-support) on or off. + +## Usage + +```js +const c = require('ansi-colors'); + +console.log(c.red('This is a red string!')); +console.log(c.green('This is a red string!')); +console.log(c.cyan('This is a cyan string!')); +console.log(c.yellow('This is a yellow string!')); +``` + +![image](https://user-images.githubusercontent.com/383994/39653848-a38e67da-4fc0-11e8-89ae-98c65ebe9dcf.png) + +## Chained colors + +```js +console.log(c.bold.red('this is a bold red message')); +console.log(c.bold.yellow.italic('this is a bold yellow italicized message')); +console.log(c.green.bold.underline('this is a bold green underlined message')); +``` + +![image](https://user-images.githubusercontent.com/383994/39635780-7617246a-4f8c-11e8-89e9-05216cc54e38.png) + +## Nested colors + +```js +console.log(c.yellow(`foo ${c.red.bold('red')} bar ${c.cyan('cyan')} baz`)); +``` + +![image](https://user-images.githubusercontent.com/383994/39635817-8ed93d44-4f8c-11e8-8afd-8c3ea35f5fbe.png) + +### Nested styling bug + +`ansi-colors` does not have the nested styling bug found in [colorette](https://github.com/jorgebucaran/colorette), [chalk](https://github.com/chalk/chalk), and [kleur](https://github.com/lukeed/kleur). + +```js +const { bold, red } = require('ansi-styles'); +console.log(bold(`foo ${red.dim('bar')} baz`)); + +const colorette = require('colorette'); +console.log(colorette.bold(`foo ${colorette.red(colorette.dim('bar'))} baz`)); + +const kleur = require('kleur'); +console.log(kleur.bold(`foo ${kleur.red.dim('bar')} baz`)); + +const chalk = require('chalk'); +console.log(chalk.bold(`foo ${chalk.red.dim('bar')} baz`)); +``` + +**Results in the following** + +(sans icons and labels) + +![image](https://user-images.githubusercontent.com/383994/47280326-d2ee0580-d5a3-11e8-9611-ea6010f0a253.png) + +## Toggle color support + +Easily enable/disable colors. + +```js +const c = require('ansi-colors'); + +// disable colors manually +c.enabled = false; + +// or use a library to automatically detect support +c.enabled = require('color-support').hasBasic; + +console.log(c.red('I will only be colored red if the terminal supports colors')); +``` + +## Strip ANSI codes + +Use the `.unstyle` method to strip ANSI codes from a string. + +```js +console.log(c.unstyle(c.blue.bold('foo bar baz'))); +//=> 'foo bar baz' +``` + +## Available styles + +**Note** that bright and bright-background colors are not always supported. + +| Colors | Background Colors | Bright Colors | Bright Background Colors | +| ------- | ----------------- | ------------- | ------------------------ | +| black | bgBlack | blackBright | bgBlackBright | +| red | bgRed | redBright | bgRedBright | +| green | bgGreen | greenBright | bgGreenBright | +| yellow | bgYellow | yellowBright | bgYellowBright | +| blue | bgBlue | blueBright | bgBlueBright | +| magenta | bgMagenta | magentaBright | bgMagentaBright | +| cyan | bgCyan | cyanBright | bgCyanBright | +| white | bgWhite | whiteBright | bgWhiteBright | +| gray | | | | +| grey | | | | + +_(`gray` is the U.S. spelling, `grey` is more commonly used in the Canada and U.K.)_ + +### Style modifiers + +* dim +* **bold** + +* hidden +* _italic_ + +* underline +* inverse +* ~~strikethrough~~ + +* reset + +## Aliases + +Create custom aliases for styles. + +```js +const colors = require('ansi-colors'); + +colors.alias('primary', colors.yellow); +colors.alias('secondary', colors.bold); + +console.log(colors.primary.secondary('Foo')); +``` + +## Themes + +A theme is an object of custom aliases. + +```js +const colors = require('ansi-colors'); + +colors.theme({ + danger: colors.red, + dark: colors.dim.gray, + disabled: colors.gray, + em: colors.italic, + heading: colors.bold.underline, + info: colors.cyan, + muted: colors.dim, + primary: colors.blue, + strong: colors.bold, + success: colors.green, + underline: colors.underline, + warning: colors.yellow +}); + +// Now, we can use our custom styles alongside the built-in styles! +console.log(colors.danger.strong.em('Error!')); +console.log(colors.warning('Heads up!')); +console.log(colors.info('Did you know...')); +console.log(colors.success.bold('It worked!')); +``` + +## Performance + +**Libraries tested** + +* ansi-colors v3.0.4 +* chalk v2.4.1 + +### Mac + +> MacBook Pro, Intel Core i7, 2.3 GHz, 16 GB. + +**Load time** + +Time it takes to load the first time `require()` is called: + +* ansi-colors - `1.915ms` +* chalk - `12.437ms` + +**Benchmarks** + +``` +# All Colors + ansi-colors x 173,851 ops/sec ±0.42% (91 runs sampled) + chalk x 9,944 ops/sec ±2.53% (81 runs sampled))) + +# Chained colors + ansi-colors x 20,791 ops/sec ±0.60% (88 runs sampled) + chalk x 2,111 ops/sec ±2.34% (83 runs sampled) + +# Nested colors + ansi-colors x 59,304 ops/sec ±0.98% (92 runs sampled) + chalk x 4,590 ops/sec ±2.08% (82 runs sampled) +``` + +### Windows + +> Windows 10, Intel Core i7-7700k CPU @ 4.2 GHz, 32 GB + +**Load time** + +Time it takes to load the first time `require()` is called: + +* ansi-colors - `1.494ms` +* chalk - `11.523ms` + +**Benchmarks** + +``` +# All Colors + ansi-colors x 193,088 ops/sec ±0.51% (95 runs sampled)) + chalk x 9,612 ops/sec ±3.31% (77 runs sampled))) + +# Chained colors + ansi-colors x 26,093 ops/sec ±1.13% (94 runs sampled) + chalk x 2,267 ops/sec ±2.88% (80 runs sampled)) + +# Nested colors + ansi-colors x 67,747 ops/sec ±0.49% (93 runs sampled) + chalk x 4,446 ops/sec ±3.01% (82 runs sampled)) +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [ansi-wrap](https://www.npmjs.com/package/ansi-wrap): Create ansi colors by passing the open and close codes. | [homepage](https://github.com/jonschlinkert/ansi-wrap "Create ansi colors by passing the open and close codes.") +* [strip-color](https://www.npmjs.com/package/strip-color): Strip ANSI color codes from a string. No dependencies. | [homepage](https://github.com/jonschlinkert/strip-color "Strip ANSI color codes from a string. No dependencies.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 48 | [jonschlinkert](https://github.com/jonschlinkert) | +| 42 | [doowb](https://github.com/doowb) | +| 6 | [lukeed](https://github.com/lukeed) | +| 2 | [Silic0nS0ldier](https://github.com/Silic0nS0ldier) | +| 1 | [dwieeb](https://github.com/dwieeb) | +| 1 | [jorgebucaran](https://github.com/jorgebucaran) | +| 1 | [madhavarshney](https://github.com/madhavarshney) | +| 1 | [chapterjason](https://github.com/chapterjason) | + +### Author + +**Brian Woodward** + +* [GitHub Profile](https://github.com/doowb) +* [Twitter Profile](https://twitter.com/doowb) +* [LinkedIn Profile](https://linkedin.com/in/woodwardbrian) + +### License + +Copyright © 2019, [Brian Woodward](https://github.com/doowb). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on July 01, 2019._ \ No newline at end of file diff --git a/node_modules/ansi-colors/index.js b/node_modules/ansi-colors/index.js new file mode 100644 index 000000000..8e2641904 --- /dev/null +++ b/node_modules/ansi-colors/index.js @@ -0,0 +1,177 @@ +'use strict'; + +const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); +const identity = val => val; + +/* eslint-disable no-control-regex */ +// this is a modified version of https://github.com/chalk/ansi-regex (MIT License) +const ANSI_REGEX = /[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g; + +const create = () => { + const colors = { enabled: true, visible: true, styles: {}, keys: {} }; + + if ('FORCE_COLOR' in process.env) { + colors.enabled = process.env.FORCE_COLOR !== '0'; + } + + const ansi = style => { + let open = style.open = `\u001b[${style.codes[0]}m`; + let close = style.close = `\u001b[${style.codes[1]}m`; + let regex = style.regex = new RegExp(`\\u001b\\[${style.codes[1]}m`, 'g'); + style.wrap = (input, newline) => { + if (input.includes(close)) input = input.replace(regex, close + open); + let output = open + input + close; + // see https://github.com/chalk/chalk/pull/92, thanks to the + // chalk contributors for this fix. However, we've confirmed that + // this issue is also present in Windows terminals + return newline ? output.replace(/\r*\n/g, `${close}$&${open}`) : output; + }; + return style; + }; + + const wrap = (style, input, newline) => { + return typeof style === 'function' ? style(input) : style.wrap(input, newline); + }; + + const style = (input, stack) => { + if (input === '' || input == null) return ''; + if (colors.enabled === false) return input; + if (colors.visible === false) return ''; + let str = '' + input; + let nl = str.includes('\n'); + let n = stack.length; + if (n > 0 && stack.includes('unstyle')) { + stack = [...new Set(['unstyle', ...stack])].reverse(); + } + while (n-- > 0) str = wrap(colors.styles[stack[n]], str, nl); + return str; + }; + + const define = (name, codes, type) => { + colors.styles[name] = ansi({ name, codes }); + let keys = colors.keys[type] || (colors.keys[type] = []); + keys.push(name); + + Reflect.defineProperty(colors, name, { + configurable: true, + enumerable: true, + set(value) { + colors.alias(name, value); + }, + get() { + let color = input => style(input, color.stack); + Reflect.setPrototypeOf(color, colors); + color.stack = this.stack ? this.stack.concat(name) : [name]; + return color; + } + }); + }; + + define('reset', [0, 0], 'modifier'); + define('bold', [1, 22], 'modifier'); + define('dim', [2, 22], 'modifier'); + define('italic', [3, 23], 'modifier'); + define('underline', [4, 24], 'modifier'); + define('inverse', [7, 27], 'modifier'); + define('hidden', [8, 28], 'modifier'); + define('strikethrough', [9, 29], 'modifier'); + + define('black', [30, 39], 'color'); + define('red', [31, 39], 'color'); + define('green', [32, 39], 'color'); + define('yellow', [33, 39], 'color'); + define('blue', [34, 39], 'color'); + define('magenta', [35, 39], 'color'); + define('cyan', [36, 39], 'color'); + define('white', [37, 39], 'color'); + define('gray', [90, 39], 'color'); + define('grey', [90, 39], 'color'); + + define('bgBlack', [40, 49], 'bg'); + define('bgRed', [41, 49], 'bg'); + define('bgGreen', [42, 49], 'bg'); + define('bgYellow', [43, 49], 'bg'); + define('bgBlue', [44, 49], 'bg'); + define('bgMagenta', [45, 49], 'bg'); + define('bgCyan', [46, 49], 'bg'); + define('bgWhite', [47, 49], 'bg'); + + define('blackBright', [90, 39], 'bright'); + define('redBright', [91, 39], 'bright'); + define('greenBright', [92, 39], 'bright'); + define('yellowBright', [93, 39], 'bright'); + define('blueBright', [94, 39], 'bright'); + define('magentaBright', [95, 39], 'bright'); + define('cyanBright', [96, 39], 'bright'); + define('whiteBright', [97, 39], 'bright'); + + define('bgBlackBright', [100, 49], 'bgBright'); + define('bgRedBright', [101, 49], 'bgBright'); + define('bgGreenBright', [102, 49], 'bgBright'); + define('bgYellowBright', [103, 49], 'bgBright'); + define('bgBlueBright', [104, 49], 'bgBright'); + define('bgMagentaBright', [105, 49], 'bgBright'); + define('bgCyanBright', [106, 49], 'bgBright'); + define('bgWhiteBright', [107, 49], 'bgBright'); + + colors.ansiRegex = ANSI_REGEX; + colors.hasColor = colors.hasAnsi = str => { + colors.ansiRegex.lastIndex = 0; + return typeof str === 'string' && str !== '' && colors.ansiRegex.test(str); + }; + + colors.alias = (name, color) => { + let fn = typeof color === 'string' ? colors[color] : color; + + if (typeof fn !== 'function') { + throw new TypeError('Expected alias to be the name of an existing color (string) or a function'); + } + + if (!fn.stack) { + Reflect.defineProperty(fn, 'name', { value: name }); + colors.styles[name] = fn; + fn.stack = [name]; + } + + Reflect.defineProperty(colors, name, { + configurable: true, + enumerable: true, + set(value) { + colors.alias(name, value); + }, + get() { + let color = input => style(input, color.stack); + Reflect.setPrototypeOf(color, colors); + color.stack = this.stack ? this.stack.concat(fn.stack) : fn.stack; + return color; + } + }); + }; + + colors.theme = custom => { + if (!isObject(custom)) throw new TypeError('Expected theme to be an object'); + for (let name of Object.keys(custom)) { + colors.alias(name, custom[name]); + } + return colors; + }; + + colors.alias('unstyle', str => { + if (typeof str === 'string' && str !== '') { + colors.ansiRegex.lastIndex = 0; + return str.replace(colors.ansiRegex, ''); + } + return ''; + }); + + colors.alias('noop', str => str); + colors.none = colors.clear = colors.noop; + + colors.stripColor = colors.unstyle; + colors.symbols = require('./symbols'); + colors.define = define; + return colors; +}; + +module.exports = create(); +module.exports.create = create; diff --git a/node_modules/ansi-colors/package.json b/node_modules/ansi-colors/package.json new file mode 100644 index 000000000..eb1facb6d --- /dev/null +++ b/node_modules/ansi-colors/package.json @@ -0,0 +1,109 @@ +{ + "name": "ansi-colors", + "description": "Easily add ANSI colors to your text and symbols in the terminal. A faster drop-in replacement for chalk, kleur and turbocolor (without the dependencies and rendering bugs).", + "version": "4.1.1", + "homepage": "https://github.com/doowb/ansi-colors", + "author": "Brian Woodward (https://github.com/doowb)", + "contributors": [ + "Brian Woodward (https://twitter.com/doowb)", + "Jason Schilling (https://sourecode.de)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)", + "Jordan (https://github.com/Silic0nS0ldier)" + ], + "repository": "doowb/ansi-colors", + "bugs": { + "url": "https://github.com/doowb/ansi-colors/issues" + }, + "license": "MIT", + "files": [ + "index.js", + "symbols.js", + "types/index.d.ts" + ], + "main": "index.js", + "types": "./types/index.d.ts", + "engines": { + "node": ">=6" + }, + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "decache": "^4.5.1", + "gulp-format-md": "^2.0.0", + "justified": "^1.0.1", + "mocha": "^6.1.4", + "text-table": "^0.2.0" + }, + "keywords": [ + "ansi", + "bgblack", + "bgBlack", + "bgblue", + "bgBlue", + "bgcyan", + "bgCyan", + "bggreen", + "bgGreen", + "bgmagenta", + "bgMagenta", + "bgred", + "bgRed", + "bgwhite", + "bgWhite", + "bgyellow", + "bgYellow", + "black", + "blue", + "bold", + "clorox", + "colors", + "cyan", + "dim", + "gray", + "green", + "grey", + "hidden", + "inverse", + "italic", + "kleur", + "magenta", + "red", + "reset", + "strikethrough", + "underline", + "white", + "yellow" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "data": { + "author": { + "linkedin": "woodwardbrian", + "twitter": "doowb" + } + }, + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "related": { + "list": [ + "ansi-wrap", + "strip-color" + ] + }, + "reflinks": [ + "chalk", + "colorette", + "colors", + "kleur" + ] + } +} \ No newline at end of file diff --git a/node_modules/ansi-colors/symbols.js b/node_modules/ansi-colors/symbols.js new file mode 100644 index 000000000..ee1594573 --- /dev/null +++ b/node_modules/ansi-colors/symbols.js @@ -0,0 +1,70 @@ +'use strict'; + +const isHyper = process.env.TERM_PROGRAM === 'Hyper'; +const isWindows = process.platform === 'win32'; +const isLinux = process.platform === 'linux'; + +const common = { + ballotDisabled: '☒', + ballotOff: '☐', + ballotOn: '☑', + bullet: '•', + bulletWhite: '◦', + fullBlock: '█', + heart: '❤', + identicalTo: '≡', + line: '─', + mark: '※', + middot: '·', + minus: '-', + multiplication: '×', + obelus: '÷', + pencilDownRight: '✎', + pencilRight: '✏', + pencilUpRight: '✐', + percent: '%', + pilcrow2: '❡', + pilcrow: '¶', + plusMinus: '±', + section: '§', + starsOff: '☆', + starsOn: '★', + upDownArrow: '↕' +}; + +const windows = Object.assign({}, common, { + check: '√', + cross: '×', + ellipsisLarge: '...', + ellipsis: '...', + info: 'i', + question: '?', + questionSmall: '?', + pointer: '>', + pointerSmall: '»', + radioOff: '( )', + radioOn: '(*)', + warning: '‼' +}); + +const other = Object.assign({}, common, { + ballotCross: '✘', + check: '✔', + cross: '✖', + ellipsisLarge: '⋯', + ellipsis: '…', + info: 'ℹ', + question: '?', + questionFull: '?', + questionSmall: '﹖', + pointer: isLinux ? '▸' : '❯', + pointerSmall: isLinux ? '‣' : '›', + radioOff: '◯', + radioOn: '◉', + warning: '⚠' +}); + +module.exports = (isWindows && !isHyper) ? windows : other; +Reflect.defineProperty(module.exports, 'common', { enumerable: false, value: common }); +Reflect.defineProperty(module.exports, 'windows', { enumerable: false, value: windows }); +Reflect.defineProperty(module.exports, 'other', { enumerable: false, value: other }); diff --git a/node_modules/ansi-colors/types/index.d.ts b/node_modules/ansi-colors/types/index.d.ts new file mode 100644 index 000000000..ca2d24acb --- /dev/null +++ b/node_modules/ansi-colors/types/index.d.ts @@ -0,0 +1,161 @@ +// Imported from DefinitelyTyped project. +// TypeScript definitions for ansi-colors +// Definitions by: Rogier Schouten +// Integrated by: Jordan Mele + +interface SymbolsType { + check: string; + cross: string; + info: string; + line: string; + pointer: string; + pointerSmall: string; + question: string; + warning: string; +} + +type StyleArrayStructure = [number, number]; +interface StyleArrayProperties { + open: string; + close: string; + closeRe: string; +} + +type StyleType = StyleArrayStructure & StyleArrayProperties; + +export interface StyleFunction extends StylesType { + (s: string): string; +} + +interface StylesType { + // modifiers + reset: T; + bold: T; + dim: T; + italic: T; + underline: T; + inverse: T; + hidden: T; + strikethrough: T; + + // colors + black: T; + red: T; + green: T; + yellow: T; + blue: T; + magenta: T; + cyan: T; + white: T; + gray: T; + grey: T; + + // bright colors + blackBright: T; + redBright: T; + greenBright: T; + yellowBright: T; + blueBright: T; + magentaBright: T; + cyanBright: T; + whiteBright: T; + + // background colors + bgBlack: T; + bgRed: T; + bgGreen: T; + bgYellow: T; + bgBlue: T; + bgMagenta: T; + bgCyan: T; + bgWhite: T; + + // bright background colors + bgBlackBright: T; + bgRedBright: T; + bgGreenBright: T; + bgYellowBright: T; + bgBlueBright: T; + bgMagentaBright: T; + bgCyanBright: T; + bgWhiteBright: T; +} + +// modifiers +export const reset: StyleFunction; +export const bold: StyleFunction; +export const dim: StyleFunction; +export const italic: StyleFunction; +export const underline: StyleFunction; +export const inverse: StyleFunction; +export const hidden: StyleFunction; +export const strikethrough: StyleFunction; + +// colors +export const black: StyleFunction; +export const red: StyleFunction; +export const green: StyleFunction; +export const yellow: StyleFunction; +export const blue: StyleFunction; +export const magenta: StyleFunction; +export const cyan: StyleFunction; +export const white: StyleFunction; +export const gray: StyleFunction; +export const grey: StyleFunction; + +// bright colors +export const blackBright: StyleFunction; +export const redBright: StyleFunction; +export const greenBright: StyleFunction; +export const yellowBright: StyleFunction; +export const blueBright: StyleFunction; +export const magentaBright: StyleFunction; +export const cyanBright: StyleFunction; +export const whiteBright: StyleFunction; + +// background colors +export const bgBlack: StyleFunction; +export const bgRed: StyleFunction; +export const bgGreen: StyleFunction; +export const bgYellow: StyleFunction; +export const bgBlue: StyleFunction; +export const bgMagenta: StyleFunction; +export const bgCyan: StyleFunction; +export const bgWhite: StyleFunction; + +// bright background colors +export const bgBlackBright: StyleFunction; +export const bgRedBright: StyleFunction; +export const bgGreenBright: StyleFunction; +export const bgYellowBright: StyleFunction; +export const bgBlueBright: StyleFunction; +export const bgMagentaBright: StyleFunction; +export const bgCyanBright: StyleFunction; +export const bgWhiteBright: StyleFunction; + +export let enabled: boolean; +export let visible: boolean; +export const ansiRegex: RegExp; + +/** + * Remove styles from string + */ +export function stripColor(s: string): string; + +/** + * Remove styles from string + */ +export function strip(s: string): string; + +/** + * Remove styles from string + */ +export function unstyle(s: string): string; + +export const styles: StylesType; +export const symbols: SymbolsType; + +/** + * Outputs a string with check-symbol as prefix + */ +export function ok(...args: string[]): string; diff --git a/node_modules/array-includes/.editorconfig b/node_modules/array-includes/.editorconfig new file mode 100644 index 000000000..eaa214161 --- /dev/null +++ b/node_modules/array-includes/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +indent_style = tab; +insert_final_newline = true; +quote_type = auto; +space_after_anonymous_functions = true; +space_after_control_statements = true; +spaces_around_operators = true; +trim_trailing_whitespace = true; +spaces_in_brackets = false; +end_of_line = lf; + diff --git a/node_modules/array-includes/.eslintrc b/node_modules/array-includes/.eslintrc new file mode 100644 index 000000000..0df206d50 --- /dev/null +++ b/node_modules/array-includes/.eslintrc @@ -0,0 +1,22 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "complexity": 0, + "id-length": [2, { "min": 1, "max": 26 }], + "max-statements": [2, 14], + "new-cap": [2, { capIsNewExceptions: ["GetIntrinsic", "ToObject", "ToInteger", "ToLength", "SameValueZero", "RequireObjectCoercible"] }], + }, + + "overrides": [ + { + "files": "test/**", + "rules": { + "max-lines-per-function": 0, + "no-invalid-this": 1, + }, + }, + ], +} diff --git a/node_modules/array-includes/.github/FUNDING.yml b/node_modules/array-includes/.github/FUNDING.yml new file mode 100644 index 000000000..136b2b546 --- /dev/null +++ b/node_modules/array-includes/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/array-includes +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/array-includes/.github/workflows/rebase.yml b/node_modules/array-includes/.github/workflows/rebase.yml new file mode 100644 index 000000000..436cb79dc --- /dev/null +++ b/node_modules/array-includes/.github/workflows/rebase.yml @@ -0,0 +1,15 @@ +name: Automatic Rebase + +on: [pull_request] + +jobs: + _: + name: "Automatic Rebase" + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: ljharb/rebase@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/node_modules/array-includes/.travis.yml b/node_modules/array-includes/.travis.yml new file mode 100644 index 000000000..2d1c1d25f --- /dev/null +++ b/node_modules/array-includes/.travis.yml @@ -0,0 +1,12 @@ +version: ~> 1.0 +language: node_js +os: + - linux +import: + - ljharb/travis-ci:node/all.yml + - ljharb/travis-ci:node/pretest.yml + - ljharb/travis-ci:node/posttest.yml + - ljharb/travis-ci:node/coverage.yml +matrix: + allow_failures: + - env: COVERAGE=true diff --git a/node_modules/array-includes/CHANGELOG.md b/node_modules/array-includes/CHANGELOG.md new file mode 100644 index 000000000..f82cbe09d --- /dev/null +++ b/node_modules/array-includes/CHANGELOG.md @@ -0,0 +1,101 @@ +3.1.1 / 2019-12-21 +================= + * [Fix] IE < 9 does not have index access on strings + * [Deps] update `es-abstract` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` + * [meta] remove unused Makefile and associated utilities + * [Tests] add string tests + +3.1.0 / 2019-12-11 +================= + * [New] add `auto` entry point + * [Refactor] use split-up `es-abstract` (68% bundle size decrease) + * [readme] fix repo URLs, remove testling, fix readme parsing + * [Deps] update `es-abstract`, `define-properties` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `evalmd`, `covert`, `functions-have-names`, `replace`, `semver`, `tape`, `@es-shims/api`, `function-bind` + * [meta] add `funding` field, FUNDING.yml + * [meta] Only apps should have lockfiles + * [Tests] add more `fromIndex` tests + * [Tests] use shared travis-ci configs + * [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops + * [Tests] remove `jscs` + * [Tests] use `functions-have-names` + * [Tests] use `npm audit` instead of `nsp` + * [Tests] remove `jscs` + * [actions] add automatic rebasing / merge commit blocking + +3.0.3 / 2017-04-18 +================= + * [Fix] ensure that `shim.js` actually shims when the polyfill differs from native + * [Tests] up to `node` `v7.9`, `v6.10`, `v4.8`; comment out OS X builds; improve test matrix + * [Dev Deps] update `nsp`, `eslint`, `@ljharb/eslint-config`, `tape`, `jscs`, `semver`, `function-bind`, `@es-shims/api` + * [Deps] update `es-abstract` + * [Docs] update readme: add “getting started” and “usage” (#19) + +3.0.2 / 2015-06-06 +================= + * Use the polyfill, not the implementation, as the default export + * [Deps] update `es-abstract` + * [Dev Deps] update `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver` + * [Tests] up to `node` `v5.5` + * [Tests] keep tests passing in `node` `v0.8` + * [Tests] Only run `evalmd` as part of the full test suite, since it's more like a linter + * [Tests] fix npm upgrades for older nodes + +3.0.1 / 2015-05-23 +================= + * [Fix] in "shim", assign the polyfill, not the implementation + +3.0.0 / 2015-05-23 +================= + * [Breaking] Implement the [es-shim API](es-shims/api) + * [Deps] update `define-properties`, `es-abstract` + * [Dev Deps] update `eslint`, `semver`, `nsp`, `semver`, `jscs` + * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG + * [Tests] use my personal shared `eslint` config + * [Tests] up to `io.js` `v3.0` + +2.0.0 / 2015-05-23 +================= + * Fix to not skip holes, per https://github.com/tc39/Array.prototype.includes/issues/15 + +1.1.1 / 2015-05-23 +================= + * Test up to `io.js` `v2.0` + * Update `es-abstract`, `tape`, `eslint`, `semver`, `jscs`, `semver` + +1.1.0 / 2015-03-19 +================= + * Update `es-abstract`, `editorconfig-tools`, `nsp`, `eslint`, `semver` + +1.0.6 / 2015-02-17 +================= + * All grade A-supported `node`/`iojs` versions now ship with an `npm` that understands `^`. + * Run `travis-ci` tests on `iojs` and `node` v0.12; allow 0.8 failures. + * Update `tape`, `jscs`, `es-abstract`, remove `is`. + +1.0.5 / 2015-01-30 +================= + * Update `tape`, `jscs`, `nsp`, `eslint`, `es-abstract` + +1.0.4 / 2015-01-10 +================= + * Use `es-abstract` for ECMAScript spec internal abstract operations + +1.0.3 / 2015-01-06 +================= + * Speed optimization: use Array#indexOf when available + * Fix ES3, IE 6-8, Opera 10.6, Opera 11.1 support + * Run testling on both sets of tests + +1.0.2 / 2015-01-05 +================= + * Ensure tests are includes in the module on `npm` + +1.0.1 / 2015-01-04 +================= + * Remove mistaken auto-shim. + +1.0.0 / 2015-01-04 +================= + * v1.0.0 diff --git a/node_modules/array-includes/LICENSE b/node_modules/array-includes/LICENSE new file mode 100644 index 000000000..8c271c14b --- /dev/null +++ b/node_modules/array-includes/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (C) 2015 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/array-includes/README.md b/node_modules/array-includes/README.md new file mode 100644 index 000000000..fb8758798 --- /dev/null +++ b/node_modules/array-includes/README.md @@ -0,0 +1,94 @@ +# array-includes [![Version Badge][npm-version-svg]][package-url] + +[![Build Status][travis-svg]][travis-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +An ES7/ES2016 spec-compliant `Array.prototype.includes` shim/polyfill/replacement that works as far down as ES3. + +This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the proposed [spec](http://www.ecma-international.org/ecma-262/6.0/). + +Because `Array.prototype.includes` depends on a receiver (the `this` value), the main export takes the array to operate on as the first argument. + +## Getting started + +```sh +npm install --save array-includes +``` + +## Usage + +Basic usage: **includes(array, value[, fromIndex=0])** + +```js +var includes = require('array-includes'); +var assert = require('assert'); +var arr = [ 'one', 'two' ]; + +includes(arr, 'one'); // true +includes(arr, 'three'); // false +includes(arr, 'one', 1); // false +``` + + + +## Example + +```js +var arr = [ + 1, + 'foo', + NaN, + -0 +]; + +assert.equal(arr.indexOf(0) > -1, true); +assert.equal(arr.indexOf(-0) > -1, true); +assert.equal(includes(arr, 0), true); +assert.equal(includes(arr, -0), true); + +assert.equal(arr.indexOf(NaN) > -1, false); +assert.equal(includes(arr, NaN), true); + +assert.equal(includes(arr, 'foo', 0), true); +assert.equal(includes(arr, 'foo', 1), true); +assert.equal(includes(arr, 'foo', 2), false); +``` + +```js +/* when Array#includes is not present */ +delete Array.prototype.includes; +var shimmedIncludes = includes.shim(); + +assert.equal(shimmedIncludes, includes.getPolyfill()); +assert.equal(arr.includes('foo', 1), includes(arr, 'foo', 1)); +``` + +```js +/* when Array#includes is present */ +var shimmedIncludes = includes.shim(); + +assert.equal(shimmedIncludes, Array.prototype.includes); +assert.equal(arr.includes(1, 'foo'), includes(arr, 1, 'foo')); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/array-includes +[npm-version-svg]: http://versionbadg.es/es-shims/array-includes.svg +[travis-svg]: https://travis-ci.org/es-shims/array-includes.svg +[travis-url]: https://travis-ci.org/es-shims/array-includes +[deps-svg]: https://david-dm.org/es-shims/array-includes.svg +[deps-url]: https://david-dm.org/es-shims/array-includes +[dev-deps-svg]: https://david-dm.org/es-shims/array-includes/dev-status.svg +[dev-deps-url]: https://david-dm.org/es-shims/array-includes#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/array-includes.png?downloads=true&stars=true +[license-image]: http://img.shields.io/npm/l/array-includes.svg +[license-url]: LICENSE +[downloads-image]: http://img.shields.io/npm/dm/array-includes.svg +[downloads-url]: http://npm-stat.com/charts.html?package=array-includes diff --git a/node_modules/array-includes/auto.js b/node_modules/array-includes/auto.js new file mode 100644 index 000000000..8ebf606cb --- /dev/null +++ b/node_modules/array-includes/auto.js @@ -0,0 +1,3 @@ +'use strict'; + +require('./shim')(); diff --git a/node_modules/array-includes/implementation.js b/node_modules/array-includes/implementation.js new file mode 100644 index 000000000..93fa3e890 --- /dev/null +++ b/node_modules/array-includes/implementation.js @@ -0,0 +1,35 @@ +'use strict'; + +var ToInteger = require('es-abstract/2018/ToInteger'); +var ToLength = require('es-abstract/2018/ToLength'); +var ToObject = require('es-abstract/2018/ToObject'); +var SameValueZero = require('es-abstract/2018/SameValueZero'); +var $isNaN = require('es-abstract/helpers/isNaN'); +var $isFinite = require('es-abstract/helpers/isFinite'); +var GetIntrinsic = require('es-abstract/GetIntrinsic'); +var callBound = require('es-abstract/helpers/callBound'); +var isString = require('is-string'); + +var $charAt = callBound('String.prototype.charAt'); +var $indexOf = GetIntrinsic('%Array.prototype.indexOf%'); // TODO: use callBind.apply without breaking IE 8 + +module.exports = function includes(searchElement) { + var fromIndex = arguments.length > 1 ? ToInteger(arguments[1]) : 0; + if ($indexOf && !$isNaN(searchElement) && $isFinite(fromIndex) && typeof searchElement !== 'undefined') { + return $indexOf.apply(this, arguments) > -1; + } + + var O = ToObject(this); + var length = ToLength(O.length); + if (length === 0) { + return false; + } + var k = fromIndex >= 0 ? fromIndex : Math.max(0, length + fromIndex); + while (k < length) { + if (SameValueZero(searchElement, isString(O) ? $charAt(O, k) : O[k])) { + return true; + } + k += 1; + } + return false; +}; diff --git a/node_modules/array-includes/index.js b/node_modules/array-includes/index.js new file mode 100644 index 000000000..5aaa5027a --- /dev/null +++ b/node_modules/array-includes/index.js @@ -0,0 +1,26 @@ +'use strict'; + +var define = require('define-properties'); +var RequireObjectCoercible = require('es-abstract/2018/RequireObjectCoercible'); +var callBound = require('es-abstract/helpers/callBound'); + +var implementation = require('./implementation'); +var getPolyfill = require('./polyfill'); +var polyfill = getPolyfill(); +var shim = require('./shim'); + +var $slice = callBound('Array.prototype.slice'); + +/* eslint-disable no-unused-vars */ +var boundIncludesShim = function includes(array, searchElement) { +/* eslint-enable no-unused-vars */ + RequireObjectCoercible(array); + return polyfill.apply(array, $slice(arguments, 1)); +}; +define(boundIncludesShim, { + getPolyfill: getPolyfill, + implementation: implementation, + shim: shim +}); + +module.exports = boundIncludesShim; diff --git a/node_modules/array-includes/package.json b/node_modules/array-includes/package.json new file mode 100644 index 000000000..a9ca8a4a6 --- /dev/null +++ b/node_modules/array-includes/package.json @@ -0,0 +1,89 @@ +{ + "name": "array-includes", + "version": "3.1.1", + "author": { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "description": "An ES7/ES2016 spec-compliant `Array.prototype.includes` shim/polyfill/replacement that works as far down as ES3.", + "license": "MIT", + "main": "index.js", + "scripts": { + "pretest": "npm run --silent lint && evalmd README.md", + "test": "npm run --silent tests-only", + "posttest": "npx aud", + "tests-only": "es-shim-api --bound && npm run --silent test:shimmed && npm run --silent test:module", + "test:shimmed": "node test/shimmed.js", + "test:module": "node test/index.js", + "coverage": "covert test/*.js", + "coverage:quiet": "covert test/*.js --quiet", + "lint": "eslint ." + }, + "repository": { + "type": "git", + "url": "git://github.com/es-shims/array-includes.git" + }, + "keywords": [ + "Array.prototype.includes", + "includes", + "array", + "ES7", + "shim", + "polyfill", + "contains", + "Array.prototype.contains", + "es-shim API" + ], + "dependencies": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0", + "is-string": "^1.0.5" + }, + "devDependencies": { + "@es-shims/api": "^2.1.2", + "@ljharb/eslint-config": "^15.1.0", + "covert": "^1.1.1", + "eslint": "^6.8.0", + "evalmd": "0.0.19", + "foreach": "^2.0.5", + "function-bind": "^1.1.1", + "functions-have-names": "^1.2.0", + "indexof": "^0.0.1", + "tape": "^4.12.0" + }, + "testling": { + "files": [ + "test/index.js", + "test/shimmed.js" + ], + "browsers": [ + "iexplore/6.0..latest", + "firefox/3.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/10.0..latest", + "opera/next", + "safari/4.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "engines": { + "node": ">= 0.4" + } +} \ No newline at end of file diff --git a/node_modules/array-includes/polyfill.js b/node_modules/array-includes/polyfill.js new file mode 100644 index 000000000..dfbaa4289 --- /dev/null +++ b/node_modules/array-includes/polyfill.js @@ -0,0 +1,7 @@ +'use strict'; + +var implementation = require('./implementation'); + +module.exports = function getPolyfill() { + return Array.prototype.includes || implementation; +}; diff --git a/node_modules/array-includes/shim.js b/node_modules/array-includes/shim.js new file mode 100644 index 000000000..dd01740af --- /dev/null +++ b/node_modules/array-includes/shim.js @@ -0,0 +1,14 @@ +'use strict'; + +var define = require('define-properties'); +var getPolyfill = require('./polyfill'); + +module.exports = function shimArrayPrototypeIncludes() { + var polyfill = getPolyfill(); + define( + Array.prototype, + { includes: polyfill }, + { includes: function () { return Array.prototype.includes !== polyfill; } } + ); + return polyfill; +}; diff --git a/node_modules/array-includes/test.html b/node_modules/array-includes/test.html new file mode 100644 index 000000000..5735fe5bb --- /dev/null +++ b/node_modules/array-includes/test.html @@ -0,0 +1,14606 @@ +

diff --git a/node_modules/array-includes/test/index.js b/node_modules/array-includes/test/index.js
new file mode 100644
index 000000000..61942e949
--- /dev/null
+++ b/node_modules/array-includes/test/index.js
@@ -0,0 +1,17 @@
+'use strict';
+
+var includes = require('../');
+var test = require('tape');
+var runTests = require('./tests');
+
+test('as a function', function (t) {
+	t.test('bad array/this value', function (st) {
+		st['throws'](function () { includes(undefined, 'a'); }, TypeError, 'undefined is not an object');
+		st['throws'](function () { includes(null, 'a'); }, TypeError, 'null is not an object');
+		st.end();
+	});
+
+	runTests(includes, t);
+
+	t.end();
+});
diff --git a/node_modules/array-includes/test/shimmed.js b/node_modules/array-includes/test/shimmed.js
new file mode 100644
index 000000000..f69c641b4
--- /dev/null
+++ b/node_modules/array-includes/test/shimmed.js
@@ -0,0 +1,36 @@
+'use strict';
+
+require('../shim')();
+
+var test = require('tape');
+var defineProperties = require('define-properties');
+var bind = require('function-bind');
+var isEnumerable = Object.prototype.propertyIsEnumerable;
+var functionsHaveNames = require('functions-have-names')();
+
+var runTests = require('./tests');
+
+test('shimmed', function (t) {
+	t.equal(Array.prototype.includes.length, 1, 'Array#includes has a length of 1');
+	t.test('Function name', { skip: !functionsHaveNames }, function (st) {
+		st.equal(Array.prototype.includes.name, 'includes', 'Array#includes has name "includes"');
+		st.end();
+	});
+
+	t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
+		et.equal(false, isEnumerable.call(Array.prototype, 'includes'), 'Array#includes is not enumerable');
+		et.end();
+	});
+
+	var supportsStrictMode = (function () { return typeof this === 'undefined'; }());
+
+	t.test('bad array/this value', { skip: !supportsStrictMode }, function (st) {
+		st['throws'](function () { return Array.prototype.includes.call(undefined, 'a'); }, TypeError, 'undefined is not an object');
+		st['throws'](function () { return Array.prototype.includes.call(null, 'a'); }, TypeError, 'null is not an object');
+		st.end();
+	});
+
+	runTests(bind.call(Function.call, Array.prototype.includes), t);
+
+	t.end();
+});
diff --git a/node_modules/array-includes/test/tests.js b/node_modules/array-includes/test/tests.js
new file mode 100644
index 000000000..78979d4e7
--- /dev/null
+++ b/node_modules/array-includes/test/tests.js
@@ -0,0 +1,94 @@
+'use strict';
+
+module.exports = function (includes, t) {
+	var sparseish = { length: 5, 0: 'a', 1: 'b' };
+	var overfullarrayish = { length: 2, 0: 'a', 1: 'b', 2: 'c' };
+	var thrower = { valueOf: function () { throw new RangeError('whoa'); } };
+	var numberish = { valueOf: function () { return 2; } };
+
+	t.test('simple examples', function (st) {
+		st.equal(true, includes([1, 2, 3], 1), '[1, 2, 3] includes 1');
+		st.equal(false, includes([1, 2, 3], 4), '[1, 2, 3] does not include 4');
+		st.equal(true, includes([NaN], NaN), '[NaN] includes NaN');
+		st.end();
+	});
+
+	t.test('does not skip holes', function (st) {
+		st.equal(true, includes(Array(1)), 'Array(1) includes undefined');
+		st.end();
+	});
+
+	t.test('exceptions', function (et) {
+		et.test('fromIndex conversion', function (st) {
+			st['throws'](function () { includes([0], 0, thrower); }, RangeError, 'fromIndex conversion throws');
+			st.end();
+		});
+
+		et.test('ToLength', function (st) {
+			st['throws'](function () { includes({ length: thrower, 0: true }, true); }, RangeError, 'ToLength conversion throws');
+			st.end();
+		});
+
+		et.end();
+	});
+
+	t.test('arraylike', function (st) {
+		st.equal(true, includes(sparseish, 'a'), 'sparse array-like object includes "a"');
+		st.equal(false, includes(sparseish, 'c'), 'sparse array-like object does not include "c"');
+
+		st.equal(true, includes(overfullarrayish, 'b'), 'sparse array-like object includes "b"');
+		st.equal(false, includes(overfullarrayish, 'c'), 'sparse array-like object does not include "c"');
+		st.end();
+	});
+
+	t.test('fromIndex', function (ft) {
+		ft.equal(true, includes([1], 1, NaN), 'NaN fromIndex -> 0 fromIndex');
+
+		ft.equal(true, includes([0, 1, 2], 1, 0), 'starting from 0 finds index 1');
+		ft.equal(true, includes([0, 1, 2], 1, 1), 'starting from 1 finds index 1');
+		ft.equal(false, includes([0, 1, 2], 1, 2), 'starting from 2 does not find index 1');
+
+		ft.test('number coercion', function (st) {
+			st.equal(false, includes(['a', 'b', 'c'], 'a', numberish), 'does not find "a" with object fromIndex coercing to 2');
+			st.equal(false, includes(['a', 'b', 'c'], 'a', '2'), 'does not find "a" with string fromIndex coercing to 2');
+			st.equal(true, includes(['a', 'b', 'c'], 'c', numberish), 'finds "c" with object fromIndex coercing to 2');
+			st.equal(true, includes(['a', 'b', 'c'], 'c', '2'), 'finds "c" with string fromIndex coercing to 2');
+			st.end();
+		});
+
+		ft.test('fromIndex greater than length', function (st) {
+			st.equal(false, includes([1], 1, 2), 'array of length 1 is not searched if fromIndex is > 1');
+			st.equal(false, includes([1], 1, 1), 'array of length 1 is not searched if fromIndex is >= 1');
+			st.equal(false, includes([1], 1, 1.1), 'array of length 1 is not searched if fromIndex is 1.1');
+			st.equal(false, includes([1], 1, Infinity), 'array of length 1 is not searched if fromIndex is Infinity');
+			st.end();
+		});
+
+		ft.test('negative fromIndex', function (st) {
+			st.equal(true, includes([1, 3], 1, -4), 'computed length would be negative; fromIndex is thus 0');
+			st.equal(true, includes([1, 3], 3, -4), 'computed length would be negative; fromIndex is thus 0');
+			st.equal(true, includes([1, 3], 1, -Infinity), 'computed length would be negative; fromIndex is thus 0');
+
+			st.equal(true, includes([12, 13], 13, -1), 'finds -1st item with -1 fromIndex');
+			st.equal(false, includes([12, 13], 12, -1), 'does not find -2nd item with -1 fromIndex');
+			st.equal(true, includes([12, 13], 13, -2), 'finds -2nd item with -2 fromIndex');
+
+			st.equal(true, includes(sparseish, 'b', -4), 'finds -4th item with -4 fromIndex');
+			st.equal(false, includes(sparseish, 'a', -4), 'does not find -5th item with -4 fromIndex');
+			st.equal(true, includes(sparseish, 'a', -5), 'finds -5th item with -5 fromIndex');
+			st.end();
+		});
+
+		ft.end();
+	});
+
+	t.test('strings', function (st) {
+		st.equal(true, includes('abc', 'c'), 'string includes one of its chars');
+		st.equal(false, includes('abc', 'd'), 'string does not include a char it should not');
+
+		st.equal(true, includes(Object('abc'), 'c'), 'boxed string includes one of its chars');
+		st.equal(false, includes(Object('abc'), 'd'), 'boxed string does not include a char it should not');
+
+		st.end();
+	});
+};
diff --git a/node_modules/array.prototype.flat/.editorconfig b/node_modules/array.prototype.flat/.editorconfig
new file mode 100644
index 000000000..bc228f826
--- /dev/null
+++ b/node_modules/array.prototype.flat/.editorconfig
@@ -0,0 +1,20 @@
+root = true
+
+[*]
+indent_style = tab
+indent_size = 4
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+max_line_length = 150
+
+[CHANGELOG.md]
+indent_style = space
+indent_size = 2
+
+[*.json]
+max_line_length = off
+
+[Makefile]
+max_line_length = off
diff --git a/node_modules/array.prototype.flat/.eslintrc b/node_modules/array.prototype.flat/.eslintrc
new file mode 100644
index 000000000..5a5c9c003
--- /dev/null
+++ b/node_modules/array.prototype.flat/.eslintrc
@@ -0,0 +1,40 @@
+{
+	"root": true,
+
+	"extends": "@ljharb",
+
+	"rules": {
+		"array-bracket-newline": 0,
+		"array-element-newline": 0,
+		"func-name-matching": 0,
+		"max-statements-per-line": [2, { "max": 2 }],
+		"multiline-comment-style": 0,
+		"new-cap": [2, {
+			"capIsNewExceptions": [
+				"ArraySpeciesCreate",
+				"Call",
+				"CreateDataPropertyOrThrow",
+				"FlattenIntoArray",
+				"Get",
+				"HasProperty",
+				"IsArray",
+				"Set",
+				"ToInteger",
+				"ToLength",
+				"ToObject",
+				"ToString"
+			]
+		}],
+		"no-magic-numbers": 0,
+	},
+
+	"overrides": [
+		{
+			"files": "test/**",
+			"rules": {
+				"max-params": 0,
+				"no-invalid-this": [1],
+			},
+		},
+	],
+}
diff --git a/node_modules/array.prototype.flat/.github/FUNDING.yml b/node_modules/array.prototype.flat/.github/FUNDING.yml
new file mode 100644
index 000000000..d0f1148dd
--- /dev/null
+++ b/node_modules/array.prototype.flat/.github/FUNDING.yml
@@ -0,0 +1,12 @@
+# These are supported funding model platforms
+
+github: [ljharb]
+patreon: # Replace with a single Patreon username
+open_collective: # Replace with a single Open Collective username
+ko_fi: # Replace with a single Ko-fi username
+tidelift: npm/array.prototype.flat
+community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+liberapay: # Replace with a single Liberapay username
+issuehunt: # Replace with a single IssueHunt username
+otechie: # Replace with a single Otechie username
+custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
diff --git a/node_modules/array.prototype.flat/.github/workflows/rebase.yml b/node_modules/array.prototype.flat/.github/workflows/rebase.yml
new file mode 100644
index 000000000..436cb79dc
--- /dev/null
+++ b/node_modules/array.prototype.flat/.github/workflows/rebase.yml
@@ -0,0 +1,15 @@
+name: Automatic Rebase
+
+on: [pull_request]
+
+jobs:
+  _:
+    name: "Automatic Rebase"
+
+    runs-on: ubuntu-latest
+
+    steps:
+    - uses: actions/checkout@v1
+    - uses: ljharb/rebase@master
+      env:
+        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/node_modules/array.prototype.flat/.nycrc b/node_modules/array.prototype.flat/.nycrc
new file mode 100644
index 000000000..fdab5b736
--- /dev/null
+++ b/node_modules/array.prototype.flat/.nycrc
@@ -0,0 +1,13 @@
+{
+	"all": true,
+	"check-coverage": true,
+	"reporter": ["text-summary", "text", "html", "json"],
+	"lines": 96,
+	"statements": 96,
+	"functions": 80,
+	"branches": 87,
+	"exclude": [
+		"coverage",
+		"test"
+	]
+}
diff --git a/node_modules/array.prototype.flat/.travis.yml b/node_modules/array.prototype.flat/.travis.yml
new file mode 100644
index 000000000..9c37f1b90
--- /dev/null
+++ b/node_modules/array.prototype.flat/.travis.yml
@@ -0,0 +1,9 @@
+version: ~> 1.0
+language: node_js
+os:
+ - linux
+import:
+ - ljharb/travis-ci:node/all.yml
+ - ljharb/travis-ci:node/pretest.yml
+ - ljharb/travis-ci:node/posttest.yml
+ - ljharb/travis-ci:node/coverage.yml
diff --git a/node_modules/array.prototype.flat/CHANGELOG.md b/node_modules/array.prototype.flat/CHANGELOG.md
new file mode 100644
index 000000000..d5e3b7485
--- /dev/null
+++ b/node_modules/array.prototype.flat/CHANGELOG.md
@@ -0,0 +1,53 @@
+1.2.3 / 2019-12-12
+=================
+  * [Refactor] use split-up `es-abstract` (65% bundle size decrease)
+  * [Deps] update `es-abstract`
+  * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `object-inspect`
+  * [meta] ESnext -> ES2019
+  * [meta] add `funding` field
+  * [Tests] use shared travis-ci configs
+  * [actions] add automatic rebasing / merge commit blocking
+
+1.2.2 / 2019-10-10
+=================
+  * [Deps] update `es-abstract`, `define-properties`
+  * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `covert`, `evalmd`, `object-inspect`, `safe-publish-latest`, `tape`
+  * [meta] create FUNDING.yml
+  * [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops
+  * [Tests] up to `node` `v12.11`, `v11.15`, `v10.16`, `v9.11`, `v8.16`, `v6.17`, `v4.9`; use `nvm install-latest-npm`
+
+1.2.1 / 2018-02-23
+=================
+  * [Fix] Temporarily hack main entry, so it's compatible with other resolvers (#3)
+  * [Dev Deps] update `eslint`, `nsp`, `tape`
+  * [Tests] up to `node` `v9.6`, `v6.13`
+
+1.2.0 / 2018-01-18
+=================
+  * [New] add "auto" entry point
+  * [Fix] Move the receiver length check higher
+  * [Fix] spec adjustments
+  * [Refactor] adjust shouldFlatten logic
+  * [Dev Deps] update `eslint`
+  * [Tests] up to `node` `v9.4`
+
+1.1.1 / 2017-11-29
+=================
+  * [Fix] avoid an extra hole in the array (https://github.com/es-shims/Array.prototype.flatMap/issues/1)
+  * [Deps] update `es-abstract`
+  * [Dev Deps] update `eslint`, `nsp`
+  * [Tests] up to `node` `v9.2`, `v8.9`, `v6.12`; pin included builds to LTS.
+
+1.1.0 / 2017-10-03
+=================
+  * [New] add explicit setting of “length” on target array
+  * [Fix] `FlattenIntoArray`: add assertion that `thisArg` and `mapperFunction` are both passed together
+  * [Tests] make coverage required
+
+1.0.1 / 2017-10-02
+=================
+  * Add readme
+
+1.0.0 / 2017-10-01
+=================
+  * Initial release
diff --git a/node_modules/array.prototype.flat/LICENSE b/node_modules/array.prototype.flat/LICENSE
new file mode 100644
index 000000000..999c081c6
--- /dev/null
+++ b/node_modules/array.prototype.flat/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 ECMAScript Shims
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/array.prototype.flat/README.md b/node_modules/array.prototype.flat/README.md
new file mode 100644
index 000000000..1ada9f340
--- /dev/null
+++ b/node_modules/array.prototype.flat/README.md
@@ -0,0 +1,72 @@
+# array.prototype.flat [![Version Badge][npm-version-svg]][package-url]
+
+[![Build Status][travis-svg]][travis-url]
+[![dependency status][deps-svg]][deps-url]
+[![dev dependency status][dev-deps-svg]][dev-deps-url]
+[![License][license-image]][license-url]
+[![Downloads][downloads-image]][downloads-url]
+
+[![npm badge][npm-badge-png]][package-url]
+
+An ES2019 spec-compliant `Array.prototype.flat` shim/polyfill/replacement that works as far down as ES3.
+
+This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the proposed [spec](https://tc39.github.io/proposal-flatMap/).
+
+Because `Array.prototype.flat` depends on a receiver (the `this` value), the main export takes the array to operate on as the first argument.
+
+## Getting started
+
+```sh
+npm install --save array.prototype.flat
+```
+
+## Usage/Examples
+
+```js
+var flat = require('array.prototype.flat');
+var assert = require('assert');
+
+var arr = [1, [2], [], 3, [[4]]];
+
+assert.deepEqual(flat(arr, 1), [1, 2, 3, [4]]);
+```
+
+```js
+var flat = require('array.prototype.flat');
+var assert = require('assert');
+/* when Array#flat is not present */
+delete Array.prototype.flat;
+var shimmedFlat = flat.shim();
+
+assert.equal(shimmedFlat, flat.getPolyfill());
+assert.deepEqual(arr.flat(), flat(arr));
+```
+
+```js
+var flat = require('array.prototype.flat');
+var assert = require('assert');
+/* when Array#flat is present */
+var shimmedIncludes = flat.shim();
+
+var mapper = function (x) { return [x, 1]; };
+
+assert.equal(shimmedIncludes, Array.prototype.flat);
+assert.deepEqual(arr.flat(mapper), flat(arr, mapper));
+```
+
+## Tests
+Simply clone the repo, `npm install`, and run `npm test`
+
+[package-url]: https://npmjs.org/package/array.prototype.flat
+[npm-version-svg]: http://versionbadg.es/es-shims/Array.prototype.flat.svg
+[travis-svg]: https://travis-ci.org/es-shims/Array.prototype.flat.svg
+[travis-url]: https://travis-ci.org/es-shims/Array.prototype.flat
+[deps-svg]: https://david-dm.org/es-shims/Array.prototype.flat.svg
+[deps-url]: https://david-dm.org/es-shims/Array.prototype.flat
+[dev-deps-svg]: https://david-dm.org/es-shims/Array.prototype.flat/dev-status.svg
+[dev-deps-url]: https://david-dm.org/es-shims/Array.prototype.flat#info=devDependencies
+[npm-badge-png]: https://nodei.co/npm/array.prototype.flat.png?downloads=true&stars=true
+[license-image]: http://img.shields.io/npm/l/array.prototype.flat.svg
+[license-url]: LICENSE
+[downloads-image]: http://img.shields.io/npm/dm/array.prototype.flat.svg
+[downloads-url]: http://npm-stat.com/charts.html?package=array.prototype.flat
diff --git a/node_modules/array.prototype.flat/auto.js b/node_modules/array.prototype.flat/auto.js
new file mode 100644
index 000000000..8ebf606cb
--- /dev/null
+++ b/node_modules/array.prototype.flat/auto.js
@@ -0,0 +1,3 @@
+'use strict';
+
+require('./shim')();
diff --git a/node_modules/array.prototype.flat/implementation.js b/node_modules/array.prototype.flat/implementation.js
new file mode 100644
index 000000000..61f6071f6
--- /dev/null
+++ b/node_modules/array.prototype.flat/implementation.js
@@ -0,0 +1,22 @@
+'use strict';
+
+var ArraySpeciesCreate = require('es-abstract/2019/ArraySpeciesCreate');
+var FlattenIntoArray = require('es-abstract/2019/FlattenIntoArray');
+var Get = require('es-abstract/2019/Get');
+var ToInteger = require('es-abstract/2019/ToInteger');
+var ToLength = require('es-abstract/2019/ToLength');
+var ToObject = require('es-abstract/2019/ToObject');
+
+module.exports = function flat() {
+	var O = ToObject(this);
+	var sourceLen = ToLength(Get(O, 'length'));
+
+	var depthNum = 1;
+	if (arguments.length > 0 && typeof arguments[0] !== 'undefined') {
+		depthNum = ToInteger(arguments[0]);
+	}
+
+	var A = ArraySpeciesCreate(O, 0);
+	FlattenIntoArray(A, O, sourceLen, 0, depthNum);
+	return A;
+};
diff --git a/node_modules/array.prototype.flat/index.js b/node_modules/array.prototype.flat/index.js
new file mode 100644
index 000000000..3206bbc10
--- /dev/null
+++ b/node_modules/array.prototype.flat/index.js
@@ -0,0 +1,19 @@
+'use strict';
+
+var define = require('define-properties');
+var callBind = require('es-abstract/helpers/callBind');
+
+var implementation = require('./implementation');
+var getPolyfill = require('./polyfill');
+var polyfill = getPolyfill();
+var shim = require('./shim');
+
+var boundFlat = callBind(polyfill);
+
+define(boundFlat, {
+	getPolyfill: getPolyfill,
+	implementation: implementation,
+	shim: shim
+});
+
+module.exports = boundFlat;
diff --git a/node_modules/array.prototype.flat/package.json b/node_modules/array.prototype.flat/package.json
new file mode 100644
index 000000000..8e1e119a0
--- /dev/null
+++ b/node_modules/array.prototype.flat/package.json
@@ -0,0 +1,96 @@
+{
+  "name": "array.prototype.flat",
+  "version": "1.2.3",
+  "author": {
+    "name": "Jordan Harband",
+    "email": "ljharb@gmail.com",
+    "url": "http://ljharb.codes"
+  },
+  "funding": {
+    "url": "https://github.com/sponsors/ljharb"
+  },
+  "contributors": [
+    {
+      "name": "Jordan Harband",
+      "email": "ljharb@gmail.com",
+      "url": "http://ljharb.codes"
+    }
+  ],
+  "description": "An ES2019 spec-compliant `Array.prototype.flat` shim/polyfill/replacement that works as far down as ES3.",
+  "license": "MIT",
+  "main": "index.js",
+  "scripts": {
+    "prepublish": "safe-publish-latest",
+    "pretest": "npm run --silent lint && evalmd README.md",
+    "test": "npm run --silent tests-only",
+    "posttest": "npx aud --production",
+    "pretests-only": "es-shim-api --bound",
+    "tests-only": "npm run --silent test:shimmed && npm run --silent test:module",
+    "test:shimmed": "node test/shimmed",
+    "test:module": "node test",
+    "coverage": "nyc npm run tests-only",
+    "lint": "eslint test/*.js *.js"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/es-shims/Array.prototype.flat.git"
+  },
+  "keywords": [
+    "Array.prototype.flatten",
+    "Array.prototype.flat",
+    "flatten",
+    "flat",
+    "array",
+    "ESnext",
+    "shim",
+    "polyfill",
+    "flatMap",
+    "Array.prototype.flatMap",
+    "es-shim API"
+  ],
+  "dependencies": {
+    "define-properties": "^1.1.3",
+    "es-abstract": "^1.17.0-next.1"
+  },
+  "devDependencies": {
+    "@es-shims/api": "^2.1.2",
+    "@ljharb/eslint-config": "^15.0.2",
+    "covert": "^1.1.1",
+    "eslint": "^6.7.2",
+    "evalmd": "0.0.19",
+    "function-bind": "^1.1.1",
+    "nyc": "^10.3.2",
+    "object-inspect": "^1.7.0",
+    "safe-publish-latest": "^1.1.4",
+    "tape": "^4.11.0"
+  },
+  "testling": {
+    "files": [
+      "test/index.js",
+      "test/shimmed.js"
+    ],
+    "browsers": [
+      "iexplore/6.0..latest",
+      "firefox/3.0..6.0",
+      "firefox/15.0..latest",
+      "firefox/nightly",
+      "chrome/4.0..10.0",
+      "chrome/20.0..latest",
+      "chrome/canary",
+      "opera/10.0..latest",
+      "opera/next",
+      "safari/4.0..latest",
+      "ipad/6.0..latest",
+      "iphone/6.0..latest",
+      "android-browser/4.2"
+    ]
+  },
+  "engines": {
+    "node": ">= 0.4"
+  },
+  "greenkeeper": {
+    "ignore": [
+      "nyc"
+    ]
+  }
+}
\ No newline at end of file
diff --git a/node_modules/array.prototype.flat/polyfill.js b/node_modules/array.prototype.flat/polyfill.js
new file mode 100644
index 000000000..a8829b7a0
--- /dev/null
+++ b/node_modules/array.prototype.flat/polyfill.js
@@ -0,0 +1,7 @@
+'use strict';
+
+var implementation = require('./implementation');
+
+module.exports = function getPolyfill() {
+	return Array.prototype.flat || implementation;
+};
diff --git a/node_modules/array.prototype.flat/shim.js b/node_modules/array.prototype.flat/shim.js
new file mode 100644
index 000000000..53ea7012e
--- /dev/null
+++ b/node_modules/array.prototype.flat/shim.js
@@ -0,0 +1,14 @@
+'use strict';
+
+var define = require('define-properties');
+var getPolyfill = require('./polyfill');
+
+module.exports = function shimFlat() {
+	var polyfill = getPolyfill();
+	define(
+		Array.prototype,
+		{ flat: polyfill },
+		{ flat: function () { return Array.prototype.flat !== polyfill; } }
+	);
+	return polyfill;
+};
diff --git a/node_modules/array.prototype.flat/test/index.js b/node_modules/array.prototype.flat/test/index.js
new file mode 100644
index 000000000..4e2192aae
--- /dev/null
+++ b/node_modules/array.prototype.flat/test/index.js
@@ -0,0 +1,17 @@
+'use strict';
+
+var flatten = require('../');
+var test = require('tape');
+var runTests = require('./tests');
+
+test('as a function', function (t) {
+	t.test('bad array/this value', function (st) {
+		st['throws'](flatten.bind(null, undefined, function () {}), TypeError, 'undefined is not an object');
+		st['throws'](flatten.bind(null, null, function () {}), TypeError, 'null is not an object');
+		st.end();
+	});
+
+	runTests(flatten, t);
+
+	t.end();
+});
diff --git a/node_modules/array.prototype.flat/test/shimmed.js b/node_modules/array.prototype.flat/test/shimmed.js
new file mode 100644
index 000000000..bbd786184
--- /dev/null
+++ b/node_modules/array.prototype.flat/test/shimmed.js
@@ -0,0 +1,36 @@
+'use strict';
+
+require('../shim')();
+
+var test = require('tape');
+var defineProperties = require('define-properties');
+var bind = require('function-bind');
+var isEnumerable = Object.prototype.propertyIsEnumerable;
+var functionsHaveNames = function f() {}.name === 'f';
+
+var runTests = require('./tests');
+
+test('shimmed', function (t) {
+	t.equal(Array.prototype.flat.length, 0, 'Array#flat has a length of 0');
+	t.test('Function name', { skip: !functionsHaveNames }, function (st) {
+		st.equal(Array.prototype.flat.name, 'flat', 'Array#flat has name "flat"');
+		st.end();
+	});
+
+	t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
+		et.equal(false, isEnumerable.call(Array.prototype, 'flat'), 'Array#flat is not enumerable');
+		et.end();
+	});
+
+	var supportsStrictMode = (function () { return typeof this === 'undefined'; }());
+
+	t.test('bad array/this value', { skip: !supportsStrictMode }, function (st) {
+		st['throws'](function () { return Array.prototype.flat.call(undefined, 'a'); }, TypeError, 'undefined is not an object');
+		st['throws'](function () { return Array.prototype.flat.call(null, 'a'); }, TypeError, 'null is not an object');
+		st.end();
+	});
+
+	runTests(bind.call(Function.call, Array.prototype.flat), t);
+
+	t.end();
+});
diff --git a/node_modules/array.prototype.flat/test/tests.js b/node_modules/array.prototype.flat/test/tests.js
new file mode 100644
index 000000000..5a307bd29
--- /dev/null
+++ b/node_modules/array.prototype.flat/test/tests.js
@@ -0,0 +1,30 @@
+'use strict';
+
+var testArray = function testArray(t, actual, expected, msg) {
+	t.deepEqual(actual, expected, msg);
+	t.equal(actual.length, expected.length, 'expected ' + expected.length + ', got ' + actual.length);
+};
+
+module.exports = function (flat, t) {
+	t.test('flattens', function (st) {
+		testArray(t, flat([1, [2], [[3]], [[['four']]]]), [1, 2, [3], [['four']]], 'missing depth only flattens 1 deep');
+
+		testArray(t, flat([1, [2], [[3]], [[['four']]]], 1), [1, 2, [3], [['four']]], 'depth of 1 only flattens 1 deep');
+		t.notDeepEqual(flat([1, [2], [[3]], [[['four']]]], 1), [1, 2, 3, ['four']], 'depth of 1 only flattens 1 deep: sanity check');
+
+		testArray(t, flat([1, [2], [[3]], [[['four']]]], 2), [1, 2, 3, ['four']], 'depth of 2 only flattens 2 deep');
+		t.notDeepEqual(flat([1, [2], [[3]], [[['four']]]], 2), [1, 2, 3, 'four'], 'depth of 2 only flattens 2 deep: sanity check');
+
+		testArray(t, flat([1, [2], [[3]], [[['four']]]], 3), [1, 2, 3, 'four'], 'depth of 3 only flattens 3 deep');
+		testArray(t, flat([1, [2], [[3]], [[['four']]]], Infinity), [1, 2, 3, 'four'], 'depth of Infinity flattens all the way');
+
+		st.end();
+	});
+
+	t.test('sparse arrays', function (st) {
+		// eslint-disable-next-line no-sparse-arrays
+		st.deepEqual(flat([, [1]]), flat([[], [1]]), 'an array hole is treated the same as an empty array');
+
+		st.end();
+	});
+};
diff --git a/node_modules/astral-regex/index.js b/node_modules/astral-regex/index.js
new file mode 100644
index 000000000..f90e6a225
--- /dev/null
+++ b/node_modules/astral-regex/index.js
@@ -0,0 +1,4 @@
+'use strict';
+const regex = '[\uD800-\uDBFF][\uDC00-\uDFFF]';
+
+module.exports = opts => opts && opts.exact ? new RegExp(`^${regex}$`) : new RegExp(regex, 'g');
diff --git a/node_modules/astral-regex/license b/node_modules/astral-regex/license
new file mode 100644
index 000000000..db6bc32cc
--- /dev/null
+++ b/node_modules/astral-regex/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Kevin Mårtensson  (github.com/kevva)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/astral-regex/package.json b/node_modules/astral-regex/package.json
new file mode 100644
index 000000000..9e7141ad1
--- /dev/null
+++ b/node_modules/astral-regex/package.json
@@ -0,0 +1,32 @@
+{
+  "name": "astral-regex",
+  "version": "1.0.0",
+  "description": "Regular expression for matching astral symbols",
+  "license": "MIT",
+  "repository": "kevva/astral-regex",
+  "author": {
+    "name": "Kevin Mårtensson",
+    "email": "kevinmartensson@gmail.com",
+    "url": "github.com/kevva"
+  },
+  "engines": {
+    "node": ">=4"
+  },
+  "scripts": {
+    "test": "xo && ava"
+  },
+  "files": [
+    "index.js"
+  ],
+  "keywords": [
+    "astral",
+    "emoji",
+    "regex",
+    "surrogate"
+  ],
+  "dependencies": {},
+  "devDependencies": {
+    "ava": "*",
+    "xo": "*"
+  }
+}
\ No newline at end of file
diff --git a/node_modules/astral-regex/readme.md b/node_modules/astral-regex/readme.md
new file mode 100644
index 000000000..cde44f7bc
--- /dev/null
+++ b/node_modules/astral-regex/readme.md
@@ -0,0 +1,43 @@
+# astral-regex [![Build Status](https://travis-ci.org/kevva/astral-regex.svg?branch=master)](https://travis-ci.org/kevva/astral-regex)
+
+> Regular expression for matching astral symbols
+
+
+## Install
+
+```
+$ npm install astral-regex
+```
+
+
+## Usage
+
+```js
+const astralRegex = require('astral-regex');
+
+astralRegex({exact: true}).test('');
+//=> true
+```
+
+
+## API
+
+### astralRegex([options])
+
+Returns a `RegExp` for matching astral symbols.
+
+#### options
+
+Type: `Object`
+
+##### exact
+
+Type: `boolean`
+Default: `false` *(Matches any astral symbols in a string)* + +Only match an exact string. Useful with `RegExp#test()` to check if a string is a astral symbol. + + +## License + +MIT © [Kevin Mårtensson](https://github.com/kevva) diff --git a/node_modules/builtin-modules/builtin-modules.json b/node_modules/builtin-modules/builtin-modules.json deleted file mode 100644 index 72670f6bf..000000000 --- a/node_modules/builtin-modules/builtin-modules.json +++ /dev/null @@ -1,35 +0,0 @@ -[ - "assert", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "dns", - "domain", - "events", - "fs", - "http", - "https", - "module", - "net", - "os", - "path", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "string_decoder", - "timers", - "tls", - "tty", - "url", - "util", - "v8", - "vm", - "zlib" -] diff --git a/node_modules/builtin-modules/index.js b/node_modules/builtin-modules/index.js deleted file mode 100644 index 9ef35ab06..000000000 --- a/node_modules/builtin-modules/index.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -var blacklist = [ - 'freelist', - 'sys' -]; - -module.exports = Object.keys(process.binding('natives')).filter(function (el) { - return !/^_|^internal|\//.test(el) && blacklist.indexOf(el) === -1; -}).sort(); diff --git a/node_modules/builtin-modules/package.json b/node_modules/builtin-modules/package.json deleted file mode 100644 index 3ea9033b3..000000000 --- a/node_modules/builtin-modules/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "builtin-modules", - "version": "1.1.1", - "description": "List of the Node.js builtin modules", - "license": "MIT", - "repository": "sindresorhus/builtin-modules", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "xo && ava", - "make": "node make.js" - }, - "files": [ - "index.js", - "static.js", - "builtin-modules.json" - ], - "keywords": [ - "builtin", - "built-in", - "builtins", - "node", - "modules", - "core", - "bundled", - "list", - "array", - "names" - ], - "devDependencies": { - "ava": "*", - "xo": "*" - } -} \ No newline at end of file diff --git a/node_modules/builtin-modules/readme.md b/node_modules/builtin-modules/readme.md deleted file mode 100644 index f1894b189..000000000 --- a/node_modules/builtin-modules/readme.md +++ /dev/null @@ -1,41 +0,0 @@ -# builtin-modules [![Build Status](https://travis-ci.org/sindresorhus/builtin-modules.svg?branch=master)](https://travis-ci.org/sindresorhus/builtin-modules) - -> List of the Node.js builtin modules - -The list is just a [JSON file](builtin-modules.json) and can be used wherever. - - -## Install - -``` -$ npm install --save builtin-modules -``` - - -## Usage - -```js -var builtinModules = require('builtin-modules'); - -console.log(builinModules); -//=> ['assert', 'buffer', ...] -``` - - -## API - -Returns an array of builtin modules fetched from the running Node.js version. - -### Static list - -This module also comes bundled with a static array of builtin modules generated from the latest Node.js version. You can get it with `require('builtin-modules/static');` - - -## Related - -- [is-builtin-module](https://github.com/sindresorhus/is-builtin-module) - Check if a string matches the name of a Node.js builtin module - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/builtin-modules/static.js b/node_modules/builtin-modules/static.js deleted file mode 100644 index 9508f8f4e..000000000 --- a/node_modules/builtin-modules/static.js +++ /dev/null @@ -1,2 +0,0 @@ -'use strict'; -module.exports = require('./builtin-modules.json'); diff --git a/node_modules/contains-path/LICENSE b/node_modules/contains-path/LICENSE new file mode 100644 index 000000000..65f90aca8 --- /dev/null +++ b/node_modules/contains-path/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/contains-path/README.md b/node_modules/contains-path/README.md new file mode 100644 index 000000000..d1f6ef32b --- /dev/null +++ b/node_modules/contains-path/README.md @@ -0,0 +1,83 @@ +# contains-path [![NPM version](https://badge.fury.io/js/contains-path.svg)](http://badge.fury.io/js/contains-path) + +> Return true if a file path contains the given path. + +## Install + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i contains-path --save +``` + +## Usage + +```js +var contains = require('contains-path'); +``` + +**true** + +All of the following return `true`: + +```js +containsPath('./a/b/c', 'a'); +containsPath('./a/b/c', 'a/b'); +containsPath('./b/a/b/c', 'a/b'); +containsPath('/a/b/c', '/a/b'); +containsPath('/a/b/c', 'a/b'); +containsPath('a', 'a'); +containsPath('a/b/c', 'a'); +//=> true +``` + +**false** + +All of the following return `false`: + +```js +containsPath('abc', 'a'); +containsPath('abc', 'a.md'); +containsPath('./b/a/b/c', './a/b'); +containsPath('./b/a/b/c', './a'); +containsPath('./b/a/b/c', '/a/b'); +containsPath('/b/a/b/c', '/a/b'); +//=> false +``` + +## Related projects + +* [ends-with](https://github.com/jonschlinkert/ends-with): Returns `true` if the given `string` or `array` ends with `suffix` using strict equality for… [more](https://github.com/jonschlinkert/ends-with) +* [is-absolute](https://github.com/jonschlinkert/is-absolute): Return true if a file path is absolute. +* [is-relative](https://github.com/jonschlinkert/is-relative): Returns `true` if the path appears to be relative. +* [path-ends-with](https://github.com/jonschlinkert/path-ends-with): Return `true` if a file path ends with the given string/suffix. +* [path-segments](https://github.com/jonschlinkert/path-segments): Get n specific segments of a file path, e.g. first 2, last 3, etc. +* [parse-filepath](https://github.com/jonschlinkert/parse-filepath): Parse a filepath into an object, yielding predictable results for basename and extname. + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/contains-path/issues/new) + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 07, 2015._ \ No newline at end of file diff --git a/node_modules/contains-path/index.js b/node_modules/contains-path/index.js new file mode 100644 index 000000000..24285f6d1 --- /dev/null +++ b/node_modules/contains-path/index.js @@ -0,0 +1,33 @@ +'use strict'; + +var path = require('path'); + +function containsPath(fp, segment) { + if (typeof fp !== 'string' || typeof segment !== 'string') { + throw new TypeError('contains-path expects file paths to be a string.'); + } + + var prefix = '(^|\\/)'; + if (segment.indexOf('./') === 0 || segment.charAt(0) === '/') { + prefix = '^'; + } + + var re = new RegExp(prefix + normalize(segment).join('\\/') + '($|\\/)'); + fp = normalize(fp).join('/'); + return re.test(fp); +} + +/** + * Normalize slashes + */ + +function normalize(str) { + str = path.normalize(str); + return str.split(/[\\\/]+/); +} + +/** + * Expose `containsPath` + */ + +module.exports = containsPath; diff --git a/node_modules/contains-path/package.json b/node_modules/contains-path/package.json new file mode 100644 index 000000000..dd72402ff --- /dev/null +++ b/node_modules/contains-path/package.json @@ -0,0 +1,55 @@ +{ + "name": "contains-path", + "description": "Return true if a file path contains the given path.", + "version": "0.1.0", + "homepage": "https://github.com/jonschlinkert/contains-path", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "repository": "jonschlinkert/contains-path", + "bugs": { + "url": "https://github.com/jonschlinkert/contains-path/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "dependencies": {}, + "devDependencies": { + "mocha": "*" + }, + "keywords": [ + "contains", + "directory", + "dirname", + "exec", + "ext", + "extname", + "file", + "filepath", + "fp", + "has", + "match", + "matches", + "path", + "regex", + "test" + ], + "verb": { + "related": { + "list": [ + "ends-with", + "path-ends-with", + "path-segments", + "is-absolute", + "is-relative", + "parse-filepath" + ] + } + } +} \ No newline at end of file diff --git a/node_modules/deep-is/.npmignore b/node_modules/deep-is/.npmignore new file mode 100644 index 000000000..3c3629e64 --- /dev/null +++ b/node_modules/deep-is/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/deep-is/.travis.yml b/node_modules/deep-is/.travis.yml new file mode 100644 index 000000000..d523c5f56 --- /dev/null +++ b/node_modules/deep-is/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: + - 0.4 + - 0.6 + - 0.8 + - 0.10 diff --git a/node_modules/deep-is/LICENSE b/node_modules/deep-is/LICENSE new file mode 100644 index 000000000..c38f84073 --- /dev/null +++ b/node_modules/deep-is/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2012, 2013 Thorsten Lorenz +Copyright (c) 2012 James Halliday +Copyright (c) 2009 Thomas Robinson <280north.com> + +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/deep-is/README.markdown b/node_modules/deep-is/README.markdown new file mode 100644 index 000000000..eb69a83bd --- /dev/null +++ b/node_modules/deep-is/README.markdown @@ -0,0 +1,70 @@ +deep-is +========== + +Node's `assert.deepEqual() algorithm` as a standalone module. Exactly like +[deep-equal](https://github.com/substack/node-deep-equal) except for the fact that `deepEqual(NaN, NaN) === true`. + +This module is around [5 times faster](https://gist.github.com/2790507) +than wrapping `assert.deepEqual()` in a `try/catch`. + +[![browser support](http://ci.testling.com/thlorenz/deep-is.png)](http://ci.testling.com/thlorenz/deep-is) + +[![build status](https://secure.travis-ci.org/thlorenz/deep-is.png)](http://travis-ci.org/thlorenz/deep-is) + +example +======= + +``` js +var equal = require('deep-is'); +console.dir([ + equal( + { a : [ 2, 3 ], b : [ 4 ] }, + { a : [ 2, 3 ], b : [ 4 ] } + ), + equal( + { x : 5, y : [6] }, + { x : 5, y : 6 } + ) +]); +``` + +methods +======= + +var deepIs = require('deep-is') + +deepIs(a, b) +--------------- + +Compare objects `a` and `b`, returning whether they are equal according to a +recursive equality algorithm. + +install +======= + +With [npm](http://npmjs.org) do: + +``` +npm install deep-is +``` + +test +==== + +With [npm](http://npmjs.org) do: + +``` +npm test +``` + +license +======= + +Copyright (c) 2012, 2013 Thorsten Lorenz +Copyright (c) 2012 James Halliday + +Derived largely from node's assert module, which has the copyright statement: + +Copyright (c) 2009 Thomas Robinson <280north.com> + +Released under the MIT license, see LICENSE for details. diff --git a/node_modules/deep-is/example/cmp.js b/node_modules/deep-is/example/cmp.js new file mode 100644 index 000000000..67014b88d --- /dev/null +++ b/node_modules/deep-is/example/cmp.js @@ -0,0 +1,11 @@ +var equal = require('../'); +console.dir([ + equal( + { a : [ 2, 3 ], b : [ 4 ] }, + { a : [ 2, 3 ], b : [ 4 ] } + ), + equal( + { x : 5, y : [6] }, + { x : 5, y : 6 } + ) +]); diff --git a/node_modules/deep-is/index.js b/node_modules/deep-is/index.js new file mode 100644 index 000000000..506fe2795 --- /dev/null +++ b/node_modules/deep-is/index.js @@ -0,0 +1,102 @@ +var pSlice = Array.prototype.slice; +var Object_keys = typeof Object.keys === 'function' + ? Object.keys + : function (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; + } +; + +var deepEqual = module.exports = function (actual, expected) { + // enforce Object.is +0 !== -0 + if (actual === 0 && expected === 0) { + return areZerosEqual(actual, expected); + + // 7.1. All identical values are equivalent, as determined by ===. + } else if (actual === expected) { + return true; + + } else if (actual instanceof Date && expected instanceof Date) { + return actual.getTime() === expected.getTime(); + + } else if (isNumberNaN(actual)) { + return isNumberNaN(expected); + + // 7.3. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if (typeof actual != 'object' && typeof expected != 'object') { + return actual == expected; + + // 7.4. For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else { + return objEquiv(actual, expected); + } +}; + +function isUndefinedOrNull(value) { + return value === null || value === undefined; +} + +function isArguments(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; +} + +function isNumberNaN(value) { + // NaN === NaN -> false + return typeof value == 'number' && value !== value; +} + +function areZerosEqual(zeroA, zeroB) { + // (1 / +0|0) -> Infinity, but (1 / -0) -> -Infinity and (Infinity !== -Infinity) + return (1 / zeroA) === (1 / zeroB); +} + +function objEquiv(a, b) { + if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) + return false; + + // an identical 'prototype' property. + if (a.prototype !== b.prototype) return false; + //~~~I've managed to break Object.keys through screwy arguments passing. + // Converting to array solves the problem. + if (isArguments(a)) { + if (!isArguments(b)) { + return false; + } + a = pSlice.call(a); + b = pSlice.call(b); + return deepEqual(a, b); + } + try { + var ka = Object_keys(a), + kb = Object_keys(b), + key, i; + } catch (e) {//happens when one is a string literal and the other isn't + return false; + } + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length != kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] != kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!deepEqual(a[key], b[key])) return false; + } + return true; +} diff --git a/node_modules/deep-is/package.json b/node_modules/deep-is/package.json new file mode 100644 index 000000000..d3fe0febc --- /dev/null +++ b/node_modules/deep-is/package.json @@ -0,0 +1,61 @@ +{ + "name": "deep-is", + "version": "0.1.3", + "description": "node's assert.deepEqual algorithm except for NaN being equal to NaN", + "main": "index.js", + "directories": { + "lib": ".", + "example": "example", + "test": "test" + }, + "scripts": { + "test": "tape test/*.js" + }, + "devDependencies": { + "tape": "~1.0.2" + }, + "repository": { + "type": "git", + "url": "http://github.com/thlorenz/deep-is.git" + }, + "keywords": [ + "equality", + "equal", + "compare" + ], + "author": { + "name": "Thorsten Lorenz", + "email": "thlorenz@gmx.de", + "url": "http://thlorenz.com" + }, + "license": { + "type": "MIT", + "url": "https://github.com/thlorenz/deep-is/blob/master/LICENSE" + }, + "testling": { + "files": "test/*.js", + "browsers": { + "ie": [ + 6, + 7, + 8, + 9 + ], + "ff": [ + 3.5, + 10, + 15 + ], + "chrome": [ + 10, + 22 + ], + "safari": [ + 5.1 + ], + "opera": [ + 12 + ] + } + } +} \ No newline at end of file diff --git a/node_modules/deep-is/test/NaN.js b/node_modules/deep-is/test/NaN.js new file mode 100644 index 000000000..ddaa5a77b --- /dev/null +++ b/node_modules/deep-is/test/NaN.js @@ -0,0 +1,16 @@ +var test = require('tape'); +var equal = require('../'); + +test('NaN and 0 values', function (t) { + t.ok(equal(NaN, NaN)); + t.notOk(equal(0, NaN)); + t.ok(equal(0, 0)); + t.notOk(equal(0, 1)); + t.end(); +}); + + +test('nested NaN values', function (t) { + t.ok(equal([ NaN, 1, NaN ], [ NaN, 1, NaN ])); + t.end(); +}); diff --git a/node_modules/deep-is/test/cmp.js b/node_modules/deep-is/test/cmp.js new file mode 100644 index 000000000..307101341 --- /dev/null +++ b/node_modules/deep-is/test/cmp.js @@ -0,0 +1,23 @@ +var test = require('tape'); +var equal = require('../'); + +test('equal', function (t) { + t.ok(equal( + { a : [ 2, 3 ], b : [ 4 ] }, + { a : [ 2, 3 ], b : [ 4 ] } + )); + t.end(); +}); + +test('not equal', function (t) { + t.notOk(equal( + { x : 5, y : [6] }, + { x : 5, y : 6 } + )); + t.end(); +}); + +test('nested nulls', function (t) { + t.ok(equal([ null, null, null ], [ null, null, null ])); + t.end(); +}); diff --git a/node_modules/deep-is/test/neg-vs-pos-0.js b/node_modules/deep-is/test/neg-vs-pos-0.js new file mode 100644 index 000000000..ac26130e6 --- /dev/null +++ b/node_modules/deep-is/test/neg-vs-pos-0.js @@ -0,0 +1,15 @@ +var test = require('tape'); +var equal = require('../'); + +test('0 values', function (t) { + t.ok(equal( 0, 0), ' 0 === 0'); + t.ok(equal( 0, +0), ' 0 === +0'); + t.ok(equal(+0, +0), '+0 === +0'); + t.ok(equal(-0, -0), '-0 === -0'); + + t.notOk(equal(-0, 0), '-0 !== 0'); + t.notOk(equal(-0, +0), '-0 !== +0'); + + t.end(); +}); + diff --git a/node_modules/define-properties/.editorconfig b/node_modules/define-properties/.editorconfig new file mode 100644 index 000000000..eaa214161 --- /dev/null +++ b/node_modules/define-properties/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +indent_style = tab; +insert_final_newline = true; +quote_type = auto; +space_after_anonymous_functions = true; +space_after_control_statements = true; +spaces_around_operators = true; +trim_trailing_whitespace = true; +spaces_in_brackets = false; +end_of_line = lf; + diff --git a/node_modules/define-properties/.eslintrc b/node_modules/define-properties/.eslintrc new file mode 100644 index 000000000..db992d7a9 --- /dev/null +++ b/node_modules/define-properties/.eslintrc @@ -0,0 +1,12 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "id-length": [2, { "min": 1, "max": 35 }], + "max-lines-per-function": [2, 100], + "max-params": [2, 4], + "max-statements": [2, 13] + } +} diff --git a/node_modules/define-properties/.jscs.json b/node_modules/define-properties/.jscs.json new file mode 100644 index 000000000..6f2d7f9ff --- /dev/null +++ b/node_modules/define-properties/.jscs.json @@ -0,0 +1,175 @@ +{ + "es3": true, + + "additionalRules": [], + + "requireSemicolons": true, + + "disallowMultipleSpaces": true, + + "disallowIdentifierNames": [], + + "requireCurlyBraces": { + "allExcept": [], + "keywords": ["if", "else", "for", "while", "do", "try", "catch"] + }, + + "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], + + "disallowSpaceAfterKeywords": [], + + "disallowSpaceBeforeComma": true, + "disallowSpaceAfterComma": false, + "disallowSpaceBeforeSemicolon": true, + + "disallowNodeTypes": [ + "DebuggerStatement", + "LabeledStatement", + "SwitchCase", + "SwitchStatement", + "WithStatement" + ], + + "requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] }, + + "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, + "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, + + "requireSpaceBetweenArguments": true, + + "disallowSpacesInsideParentheses": true, + + "disallowSpacesInsideArrayBrackets": true, + + "disallowQuotedKeysInObjects": { "allExcept": ["reserved"] }, + + "disallowSpaceAfterObjectKeys": true, + + "requireCommaBeforeLineBreak": true, + + "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], + "requireSpaceAfterPrefixUnaryOperators": [], + + "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], + "requireSpaceBeforePostfixUnaryOperators": [], + + "disallowSpaceBeforeBinaryOperators": [], + "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + + "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + "disallowSpaceAfterBinaryOperators": [], + + "disallowImplicitTypeConversion": ["binary", "string"], + + "disallowKeywords": ["with", "eval"], + + "requireKeywordsOnNewLine": [], + "disallowKeywordsOnNewLine": ["else"], + + "requireLineFeedAtFileEnd": true, + + "disallowTrailingWhitespace": true, + + "disallowTrailingComma": true, + + "excludeFiles": ["node_modules/**", "vendor/**"], + + "disallowMultipleLineStrings": true, + + "requireDotNotation": { "allExcept": ["keywords"] }, + + "requireParenthesesAroundIIFE": true, + + "validateLineBreaks": "LF", + + "validateQuoteMarks": { + "escape": true, + "mark": "'" + }, + + "disallowOperatorBeforeLineBreak": [], + + "requireSpaceBeforeKeywords": [ + "do", + "for", + "if", + "else", + "switch", + "case", + "try", + "catch", + "finally", + "while", + "with", + "return" + ], + + "validateAlignedFunctionParameters": { + "lineBreakAfterOpeningBraces": true, + "lineBreakBeforeClosingBraces": true + }, + + "requirePaddingNewLinesBeforeExport": true, + + "validateNewlineAfterArrayElements": { + "maximum": 3 + }, + + "requirePaddingNewLinesAfterUseStrict": true, + + "disallowArrowFunctions": true, + + "disallowMultiLineTernary": true, + + "validateOrderInObjectKeys": "asc-insensitive", + + "disallowIdenticalDestructuringNames": true, + + "disallowNestedTernaries": { "maxLevel": 1 }, + + "requireSpaceAfterComma": { "allExcept": ["trailing"] }, + "requireAlignedMultilineParams": false, + + "requireSpacesInGenerator": { + "afterStar": true + }, + + "disallowSpacesInGenerator": { + "beforeStar": true + }, + + "disallowVar": false, + + "requireArrayDestructuring": false, + + "requireEnhancedObjectLiterals": false, + + "requireObjectDestructuring": false, + + "requireEarlyReturn": false, + + "requireCapitalizedConstructorsNew": { + "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] + }, + + "requireImportAlphabetized": false, + + "requireSpaceBeforeObjectValues": true, + "requireSpaceBeforeDestructuredValues": true, + + "disallowSpacesInsideTemplateStringPlaceholders": true, + + "disallowArrayDestructuringReturn": false, + + "requireNewlineBeforeSingleStatementsInIf": false, + + "disallowUnusedVariables": true, + + "requireSpacesInsideImportedObjectBraces": true, + + "requireUseStrict": true +} + diff --git a/node_modules/define-properties/.travis.yml b/node_modules/define-properties/.travis.yml new file mode 100644 index 000000000..ec72d5f3d --- /dev/null +++ b/node_modules/define-properties/.travis.yml @@ -0,0 +1,233 @@ +language: node_js +os: + - linux +node_js: + - "10.8" + - "9.11" + - "8.11" + - "7.10" + - "6.14" + - "5.12" + - "4.9" + - "iojs-v3.3" + - "iojs-v2.5" + - "iojs-v1.8" + - "0.12" + - "0.10" + - "0.8" +before_install: + - 'case "${TRAVIS_NODE_VERSION}" in 0.*) export NPM_CONFIG_STRICT_SSL=false ;; esac' + - 'nvm install-latest-npm' +install: + - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;' +script: + - 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi' + - 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi' + - 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi' + - 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi' +sudo: false +env: + - TEST=true +matrix: + fast_finish: true + include: + - node_js: "lts/*" + env: PRETEST=true + - node_js: "lts/*" + env: POSTTEST=true + - node_js: "4" + env: COVERAGE=true + - node_js: "10.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.13" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.12" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.4" + env: TEST=true ALLOW_FAILURE=true + allow_failures: + - os: osx + - env: TEST=true ALLOW_FAILURE=true + - env: COVERAGE=true diff --git a/node_modules/define-properties/CHANGELOG.md b/node_modules/define-properties/CHANGELOG.md new file mode 100644 index 000000000..5cad1e26a --- /dev/null +++ b/node_modules/define-properties/CHANGELOG.md @@ -0,0 +1,44 @@ +1.1.3 / 2018-08-14 +================= + * [Refactor] use a for loop instead of `foreach` to make for smaller bundle sizes + * [Robustness] cache `Array.prototype.concat` and `Object.defineProperty` + * [Deps] update `object-keys` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `nsp`, `tape`, `jscs`; remove unused eccheck script + dep + * [Tests] use pretest/posttest for linting/security + * [Tests] fix npm upgrades on older nodes + +1.1.2 / 2015-10-14 +================= + * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG + * [Deps] Update `object-keys` + * [Dev Deps] update `jscs`, `tape`, `eslint`, `@ljharb/eslint-config`, `nsp` + * [Tests] up to `io.js` `v3.3`, `node` `v4.2` + +1.1.1 / 2015-07-21 +================= + * [Deps] Update `object-keys` + * [Dev Deps] Update `tape`, `eslint` + * [Tests] Test on `io.js` `v2.4` + +1.1.0 / 2015-07-01 +================= + * [New] Add support for symbol-valued properties. + * [Dev Deps] Update `nsp`, `eslint` + * [Tests] Test up to `io.js` `v2.3` + +1.0.3 / 2015-05-30 +================= + * Using a more reliable check for supported property descriptors. + +1.0.2 / 2015-05-23 +================= + * Test up to `io.js` `v2.0` + * Update `tape`, `jscs`, `nsp`, `eslint`, `object-keys`, `editorconfig-tools`, `covert` + +1.0.1 / 2015-01-06 +================= + * Update `object-keys` to fix ES3 support + +1.0.0 / 2015-01-04 +================= + * v1.0.0 diff --git a/node_modules/define-properties/LICENSE b/node_modules/define-properties/LICENSE new file mode 100644 index 000000000..8c271c14b --- /dev/null +++ b/node_modules/define-properties/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (C) 2015 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/define-properties/README.md b/node_modules/define-properties/README.md new file mode 100644 index 000000000..33b6111f1 --- /dev/null +++ b/node_modules/define-properties/README.md @@ -0,0 +1,86 @@ +#define-properties [![Version Badge][npm-version-svg]][package-url] + +[![Build Status][travis-svg]][travis-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +[![browser support][testling-svg]][testling-url] + +Define multiple non-enumerable properties at once. Uses `Object.defineProperty` when available; falls back to standard assignment in older engines. +Existing properties are not overridden. Accepts a map of property names to a predicate that, when true, force-overrides. + +## Example + +```js +var define = require('define-properties'); +var assert = require('assert'); + +var obj = define({ a: 1, b: 2 }, { + a: 10, + b: 20, + c: 30 +}); +assert(obj.a === 1); +assert(obj.b === 2); +assert(obj.c === 30); +if (define.supportsDescriptors) { + assert.deepEqual(Object.keys(obj), ['a', 'b']); + assert.deepEqual(Object.getOwnPropertyDescriptor(obj, 'c'), { + configurable: true, + enumerable: false, + value: 30, + writable: false + }); +} +``` + +Then, with predicates: +```js +var define = require('define-properties'); +var assert = require('assert'); + +var obj = define({ a: 1, b: 2, c: 3 }, { + a: 10, + b: 20, + c: 30 +}, { + a: function () { return false; }, + b: function () { return true; } +}); +assert(obj.a === 1); +assert(obj.b === 20); +assert(obj.c === 3); +if (define.supportsDescriptors) { + assert.deepEqual(Object.keys(obj), ['a', 'c']); + assert.deepEqual(Object.getOwnPropertyDescriptor(obj, 'b'), { + configurable: true, + enumerable: false, + value: 20, + writable: false + }); +} +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/define-properties +[npm-version-svg]: http://versionbadg.es/ljharb/define-properties.svg +[travis-svg]: https://travis-ci.org/ljharb/define-properties.svg +[travis-url]: https://travis-ci.org/ljharb/define-properties +[deps-svg]: https://david-dm.org/ljharb/define-properties.svg +[deps-url]: https://david-dm.org/ljharb/define-properties +[dev-deps-svg]: https://david-dm.org/ljharb/define-properties/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/define-properties#info=devDependencies +[testling-svg]: https://ci.testling.com/ljharb/define-properties.png +[testling-url]: https://ci.testling.com/ljharb/define-properties +[npm-badge-png]: https://nodei.co/npm/define-properties.png?downloads=true&stars=true +[license-image]: http://img.shields.io/npm/l/define-properties.svg +[license-url]: LICENSE +[downloads-image]: http://img.shields.io/npm/dm/define-properties.svg +[downloads-url]: http://npm-stat.com/charts.html?package=define-properties + diff --git a/node_modules/define-properties/index.js b/node_modules/define-properties/index.js new file mode 100644 index 000000000..cb3ae1c7c --- /dev/null +++ b/node_modules/define-properties/index.js @@ -0,0 +1,58 @@ +'use strict'; + +var keys = require('object-keys'); +var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; + +var toStr = Object.prototype.toString; +var concat = Array.prototype.concat; +var origDefineProperty = Object.defineProperty; + +var isFunction = function (fn) { + return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; +}; + +var arePropertyDescriptorsSupported = function () { + var obj = {}; + try { + origDefineProperty(obj, 'x', { enumerable: false, value: obj }); + // eslint-disable-next-line no-unused-vars, no-restricted-syntax + for (var _ in obj) { // jscs:ignore disallowUnusedVariables + return false; + } + return obj.x === obj; + } catch (e) { /* this is IE 8. */ + return false; + } +}; +var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported(); + +var defineProperty = function (object, name, value, predicate) { + if (name in object && (!isFunction(predicate) || !predicate())) { + return; + } + if (supportsDescriptors) { + origDefineProperty(object, name, { + configurable: true, + enumerable: false, + value: value, + writable: true + }); + } else { + object[name] = value; + } +}; + +var defineProperties = function (object, map) { + var predicates = arguments.length > 2 ? arguments[2] : {}; + var props = keys(map); + if (hasSymbols) { + props = concat.call(props, Object.getOwnPropertySymbols(map)); + } + for (var i = 0; i < props.length; i += 1) { + defineProperty(object, props[i], map[props[i]], predicates[props[i]]); + } +}; + +defineProperties.supportsDescriptors = !!supportsDescriptors; + +module.exports = defineProperties; diff --git a/node_modules/define-properties/package.json b/node_modules/define-properties/package.json new file mode 100644 index 000000000..06d4ccdeb --- /dev/null +++ b/node_modules/define-properties/package.json @@ -0,0 +1,65 @@ +{ + "name": "define-properties", + "version": "1.1.3", + "author": "Jordan Harband", + "description": "Define multiple non-enumerable properties at once. Uses `Object.defineProperty` when available; falls back to standard assignment in older engines.", + "license": "MIT", + "main": "index.js", + "scripts": { + "pretest": "npm run --silent lint", + "test": "npm run --silent tests-only", + "posttest": "npm run --silent security", + "tests-only": "node test/index.js", + "coverage": "covert test/*.js", + "coverage-quiet": "covert test/*.js --quiet", + "lint": "npm run --silent jscs && npm run --silent eslint", + "jscs": "jscs test/*.js *.js", + "eslint": "eslint test/*.js *.js", + "security": "nsp check" + }, + "repository": { + "type": "git", + "url": "git://github.com/ljharb/define-properties.git" + }, + "keywords": [ + "Object.defineProperty", + "Object.defineProperties", + "object", + "property descriptor", + "descriptor", + "define", + "ES5" + ], + "dependencies": { + "object-keys": "^1.0.12" + }, + "devDependencies": { + "@ljharb/eslint-config": "^13.0.0", + "covert": "^1.1.0", + "eslint": "^5.3.0", + "jscs": "^3.0.7", + "nsp": "^3.2.1", + "tape": "^4.9.0" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "iexplore/6.0..latest", + "firefox/3.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/10.0..latest", + "opera/next", + "safari/4.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "engines": { + "node": ">= 0.4" + } +} \ No newline at end of file diff --git a/node_modules/define-properties/test/index.js b/node_modules/define-properties/test/index.js new file mode 100644 index 000000000..3387f6bc7 --- /dev/null +++ b/node_modules/define-properties/test/index.js @@ -0,0 +1,125 @@ +'use strict'; + +var define = require('../'); +var test = require('tape'); +var keys = require('object-keys'); + +var arePropertyDescriptorsSupported = function () { + var obj = { a: 1 }; + try { + Object.defineProperty(obj, 'x', { value: obj }); + return obj.x === obj; + } catch (e) { /* this is IE 8. */ + return false; + } +}; +var descriptorsSupported = !!Object.defineProperty && arePropertyDescriptorsSupported(); + +var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; + +test('defineProperties', function (dt) { + dt.test('with descriptor support', { skip: !descriptorsSupported }, function (t) { + var getDescriptor = function (value) { + return { + configurable: true, + enumerable: false, + value: value, + writable: true + }; + }; + + var obj = { + a: 1, + b: 2, + c: 3 + }; + t.deepEqual(keys(obj), ['a', 'b', 'c'], 'all literal-set keys start enumerable'); + define(obj, { + b: 3, + c: 4, + d: 5 + }); + t.deepEqual(obj, { + a: 1, + b: 2, + c: 3 + }, 'existing properties were not overridden'); + t.deepEqual(Object.getOwnPropertyDescriptor(obj, 'd'), getDescriptor(5), 'new property "d" was added and is not enumerable'); + t.deepEqual(['a', 'b', 'c'], keys(obj), 'new keys are not enumerable'); + + define(obj, { + a: 2, + b: 3, + c: 4 + }, { + a: function () { return true; }, + b: function () { return false; } + }); + t.deepEqual(obj, { + b: 2, + c: 3 + }, 'properties only overriden when predicate exists and returns true'); + t.deepEqual(Object.getOwnPropertyDescriptor(obj, 'd'), getDescriptor(5), 'existing property "d" remained and is not enumerable'); + t.deepEqual(Object.getOwnPropertyDescriptor(obj, 'a'), getDescriptor(2), 'existing property "a" was overridden and is not enumerable'); + t.deepEqual(['b', 'c'], keys(obj), 'overridden keys are not enumerable'); + + t.end(); + }); + + dt.test('without descriptor support', { skip: descriptorsSupported }, function (t) { + var obj = { + a: 1, + b: 2, + c: 3 + }; + define(obj, { + b: 3, + c: 4, + d: 5 + }); + t.deepEqual(obj, { + a: 1, + b: 2, + c: 3, + d: 5 + }, 'existing properties were not overridden, new properties were added'); + + define(obj, { + a: 2, + b: 3, + c: 4 + }, { + a: function () { return true; }, + b: function () { return false; } + }); + t.deepEqual(obj, { + a: 2, + b: 2, + c: 3, + d: 5 + }, 'properties only overriden when predicate exists and returns true'); + + t.end(); + }); + + dt.end(); +}); + +test('symbols', { skip: !hasSymbols }, function (t) { + var sym = Symbol('foo'); + var obj = {}; + var aValue = {}; + var bValue = {}; + var properties = { a: aValue }; + properties[sym] = bValue; + + define(obj, properties); + + t.deepEqual(Object.keys(obj), [], 'object has no enumerable keys'); + t.deepEqual(Object.getOwnPropertyNames(obj), ['a'], 'object has non-enumerable "a" key'); + t.deepEqual(Object.getOwnPropertySymbols(obj), [sym], 'object has non-enumerable symbol key'); + t.equal(obj.a, aValue, 'string keyed value is defined'); + t.equal(obj[sym], bValue, 'symbol keyed value is defined'); + + t.end(); +}); diff --git a/node_modules/doctrine/README.md b/node_modules/doctrine/README.md deleted file mode 100644 index 14e3dfe68..000000000 --- a/node_modules/doctrine/README.md +++ /dev/null @@ -1,174 +0,0 @@ -[![NPM version][npm-image]][npm-url] -[![build status][travis-image]][travis-url] -[![Test coverage][coveralls-image]][coveralls-url] -[![Downloads][downloads-image]][downloads-url] -[![Join the chat at https://gitter.im/eslint/doctrine](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/eslint/doctrine?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - -# Doctrine - -Doctrine is a [JSDoc](http://usejsdoc.org) parser that parses documentation comments from JavaScript (you need to pass in the comment, not a whole JavaScript file). - -## Installation - -You can install Doctrine using [npm](https://npmjs.com): - -``` -$ npm install doctrine --save-dev -``` - -Doctrine can also be used in web browsers using [Browserify](http://browserify.org). - -## Usage - -Require doctrine inside of your JavaScript: - -```js -var doctrine = require("doctrine"); -``` - -### parse() - -The primary method is `parse()`, which accepts two arguments: the JSDoc comment to parse and an optional options object. The available options are: - -* `unwrap` - set to `true` to delete the leading `/**`, any `*` that begins a line, and the trailing `*/` from the source text. Default: `false`. -* `tags` - an array of tags to return. When specified, Doctrine returns only tags in this array. For example, if `tags` is `["param"]`, then only `@param` tags will be returned. Default: `null`. -* `recoverable` - set to `true` to keep parsing even when syntax errors occur. Default: `false`. -* `sloppy` - set to `true` to allow optional parameters to be specified in brackets (`@param {string} [foo]`). Default: `false`. -* `lineNumberes` - set to `true` to add `lineNumber` to each node, specifying the line on which the node is found in the source. Default: `false`. - -Here's a simple example: - -```js -var ast = doctrine.parse( - [ - "/**", - " * This function comment is parsed by doctrine", - " * @param {{ok:String}} userName", - "*/" - ].join('\n'), { unwrap: true }); -``` - -This example returns the following AST: - - { - "description": "This function comment is parsed by doctrine", - "tags": [ - { - "title": "param", - "description": null, - "type": { - "type": "RecordType", - "fields": [ - { - "type": "FieldType", - "key": "ok", - "value": { - "type": "NameExpression", - "name": "String" - } - } - ] - }, - "name": "userName" - } - ] - } - -See the [demo page](http://eslint.org/doctrine/demo/) more detail. - -## Team - -These folks keep the project moving and are resources for help: - -* Nicholas C. Zakas ([@nzakas](https://github.com/nzakas)) - project lead -* Yusuke Suzuki ([@constellation](https://github.com/constellation)) - reviewer - -## Contributing - -Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/doctrine/issues). - -## Frequently Asked Questions - -### Can I pass a whole JavaScript file to Doctrine? - -No. Doctrine can only parse JSDoc comments, so you'll need to pass just the JSDoc comment to Doctrine in order to work. - - -### License - -#### doctrine - -Copyright (C) 2012 [Yusuke Suzuki](http://github.com/Constellation) - (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#### esprima - -some of functions is derived from esprima - -Copyright (C) 2012, 2011 [Ariya Hidayat](http://ariya.ofilabs.com/about) - (twitter: [@ariyahidayat](http://twitter.com/ariyahidayat)) and other contributors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -#### closure-compiler - -some of extensions is derived from closure-compiler - -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses/ - - -### Where to ask for help? - -Join our [Chatroom](https://gitter.im/eslint/doctrine) - -[npm-image]: https://img.shields.io/npm/v/doctrine.svg?style=flat-square -[npm-url]: https://www.npmjs.com/package/doctrine -[travis-image]: https://img.shields.io/travis/eslint/doctrine/master.svg?style=flat-square -[travis-url]: https://travis-ci.org/eslint/doctrine -[coveralls-image]: https://img.shields.io/coveralls/eslint/doctrine/master.svg?style=flat-square -[coveralls-url]: https://coveralls.io/r/eslint/doctrine?branch=master -[downloads-image]: http://img.shields.io/npm/dm/doctrine.svg?style=flat-square -[downloads-url]: https://www.npmjs.com/package/doctrine diff --git a/node_modules/doctrine/lib/doctrine.js b/node_modules/doctrine/lib/doctrine.js deleted file mode 100644 index d7ba412a8..000000000 --- a/node_modules/doctrine/lib/doctrine.js +++ /dev/null @@ -1,833 +0,0 @@ -/* - Copyright (C) 2012-2014 Yusuke Suzuki - Copyright (C) 2014 Dan Tao - Copyright (C) 2013 Andrew Eisenberg - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -(function () { - 'use strict'; - - var typed, - utility, - isArray, - jsdoc, - esutils, - hasOwnProperty; - - esutils = require('esutils'); - isArray = require('isarray'); - typed = require('./typed'); - utility = require('./utility'); - - function sliceSource(source, index, last) { - return source.slice(index, last); - } - - hasOwnProperty = (function () { - var func = Object.prototype.hasOwnProperty; - return function hasOwnProperty(obj, name) { - return func.call(obj, name); - }; - }()); - - function shallowCopy(obj) { - var ret = {}, key; - for (key in obj) { - if (obj.hasOwnProperty(key)) { - ret[key] = obj[key]; - } - } - return ret; - } - - function isASCIIAlphanumeric(ch) { - return (ch >= 0x61 /* 'a' */ && ch <= 0x7A /* 'z' */) || - (ch >= 0x41 /* 'A' */ && ch <= 0x5A /* 'Z' */) || - (ch >= 0x30 /* '0' */ && ch <= 0x39 /* '9' */); - } - - function isParamTitle(title) { - return title === 'param' || title === 'argument' || title === 'arg'; - } - - function isReturnTitle(title) { - return title === 'return' || title === 'returns'; - } - - function isProperty(title) { - return title === 'property' || title === 'prop'; - } - - function isNameParameterRequired(title) { - return isParamTitle(title) || isProperty(title) || - title === 'alias' || title === 'this' || title === 'mixes' || title === 'requires'; - } - - function isAllowedName(title) { - return isNameParameterRequired(title) || title === 'const' || title === 'constant'; - } - - function isAllowedNested(title) { - return isProperty(title) || isParamTitle(title); - } - - function isTypeParameterRequired(title) { - return isParamTitle(title) || isReturnTitle(title) || - title === 'define' || title === 'enum' || - title === 'implements' || title === 'this' || - title === 'type' || title === 'typedef' || isProperty(title); - } - - // Consider deprecation instead using 'isTypeParameterRequired' and 'Rules' declaration to pick when a type is optional/required - // This would require changes to 'parseType' - function isAllowedType(title) { - return isTypeParameterRequired(title) || title === 'throws' || title === 'const' || title === 'constant' || - title === 'namespace' || title === 'member' || title === 'var' || title === 'module' || - title === 'constructor' || title === 'class' || title === 'extends' || title === 'augments' || - title === 'public' || title === 'private' || title === 'protected'; - } - - function trim(str) { - return str.replace(/^\s+/, '').replace(/\s+$/, ''); - } - - function unwrapComment(doc) { - // JSDoc comment is following form - // /** - // * ....... - // */ - // remove /**, */ and * - var BEFORE_STAR = 0, - STAR = 1, - AFTER_STAR = 2, - index, - len, - mode, - result, - ch; - - doc = doc.replace(/^\/\*\*?/, '').replace(/\*\/$/, ''); - index = 0; - len = doc.length; - mode = BEFORE_STAR; - result = ''; - - while (index < len) { - ch = doc.charCodeAt(index); - switch (mode) { - case BEFORE_STAR: - if (esutils.code.isLineTerminator(ch)) { - result += String.fromCharCode(ch); - } else if (ch === 0x2A /* '*' */) { - mode = STAR; - } else if (!esutils.code.isWhiteSpace(ch)) { - result += String.fromCharCode(ch); - mode = AFTER_STAR; - } - break; - - case STAR: - if (!esutils.code.isWhiteSpace(ch)) { - result += String.fromCharCode(ch); - } - mode = esutils.code.isLineTerminator(ch) ? BEFORE_STAR : AFTER_STAR; - break; - - case AFTER_STAR: - result += String.fromCharCode(ch); - if (esutils.code.isLineTerminator(ch)) { - mode = BEFORE_STAR; - } - break; - } - index += 1; - } - - return result.replace(/\s+$/, ''); - } - - // JSDoc Tag Parser - - (function (exports) { - var Rules, - index, - lineNumber, - length, - source, - recoverable, - sloppy, - strict; - - function advance() { - var ch = source.charCodeAt(index); - index += 1; - if (esutils.code.isLineTerminator(ch) && !(ch === 0x0D /* '\r' */ && source.charCodeAt(index) === 0x0A /* '\n' */)) { - lineNumber += 1; - } - return String.fromCharCode(ch); - } - - function scanTitle() { - var title = ''; - // waste '@' - advance(); - - while (index < length && isASCIIAlphanumeric(source.charCodeAt(index))) { - title += advance(); - } - - return title; - } - - function seekContent() { - var ch, waiting, last = index; - - waiting = false; - while (last < length) { - ch = source.charCodeAt(last); - if (esutils.code.isLineTerminator(ch) && !(ch === 0x0D /* '\r' */ && source.charCodeAt(last + 1) === 0x0A /* '\n' */)) { - waiting = true; - } else if (waiting) { - if (ch === 0x40 /* '@' */) { - break; - } - if (!esutils.code.isWhiteSpace(ch)) { - waiting = false; - } - } - last += 1; - } - return last; - } - - // type expression may have nest brace, such as, - // { { ok: string } } - // - // therefore, scanning type expression with balancing braces. - function parseType(title, last) { - var ch, brace, type, direct = false; - - - // search '{' - while (index < last) { - ch = source.charCodeAt(index); - if (esutils.code.isWhiteSpace(ch)) { - advance(); - } else if (ch === 0x7B /* '{' */) { - advance(); - break; - } else { - // this is direct pattern - direct = true; - break; - } - } - - - if (direct) { - return null; - } - - // type expression { is found - brace = 1; - type = ''; - while (index < last) { - ch = source.charCodeAt(index); - if (esutils.code.isLineTerminator(ch)) { - advance(); - } else { - if (ch === 0x7D /* '}' */) { - brace -= 1; - if (brace === 0) { - advance(); - break; - } - } else if (ch === 0x7B /* '{' */) { - brace += 1; - } - type += advance(); - } - } - - if (brace !== 0) { - // braces is not balanced - return utility.throwError('Braces are not balanced'); - } - - if (isParamTitle(title)) { - return typed.parseParamType(type); - } - return typed.parseType(type); - } - - function scanIdentifier(last) { - var identifier; - if (!esutils.code.isIdentifierStart(source.charCodeAt(index))) { - return null; - } - identifier = advance(); - while (index < last && esutils.code.isIdentifierPart(source.charCodeAt(index))) { - identifier += advance(); - } - return identifier; - } - - function skipWhiteSpace(last) { - while (index < last && (esutils.code.isWhiteSpace(source.charCodeAt(index)) || esutils.code.isLineTerminator(source.charCodeAt(index)))) { - advance(); - } - } - - function parseName(last, allowBrackets, allowNestedParams) { - var name = '', useBrackets; - - skipWhiteSpace(last); - - if (index >= last) { - return null; - } - - if (allowBrackets && source.charCodeAt(index) === 0x5B /* '[' */) { - useBrackets = true; - name = advance(); - } - - if (!esutils.code.isIdentifierStart(source.charCodeAt(index))) { - return null; - } - - name += scanIdentifier(last); - - if (allowNestedParams) { - if (source.charCodeAt(index) === 0x3A /* ':' */ && ( - name === 'module' || - name === 'external' || - name === 'event')) { - name += advance(); - name += scanIdentifier(last); - - } - if(source.charCodeAt(index) === 0x5B /* '[' */ && source.charCodeAt(index + 1) === 0x5D /* ']' */){ - name += advance(); - name += advance(); - } - while (source.charCodeAt(index) === 0x2E /* '.' */ || - source.charCodeAt(index) === 0x23 /* '#' */ || - source.charCodeAt(index) === 0x7E /* '~' */) { - name += advance(); - name += scanIdentifier(last); - } - } - - if (useBrackets) { - - - // do we have a default value for this? - if (source.charCodeAt(index) === 0x3D /* '=' */) { - // consume the '='' symbol - name += advance(); - var bracketDepth = 1; - // scan in the default value - while (index < last) { - if (source.charCodeAt(index) === 0x5B /* '[' */) { - bracketDepth++; - } else if (source.charCodeAt(index) === 0x5D /* ']' */ && - --bracketDepth === 0) { - break; - } - name += advance(); - } - } - - if (index >= last || source.charCodeAt(index) !== 0x5D /* ']' */) { - // we never found a closing ']' - return null; - } - - // collect the last ']' - name += advance(); - } - - return name; - } - - function skipToTag() { - while (index < length && source.charCodeAt(index) !== 0x40 /* '@' */) { - advance(); - } - if (index >= length) { - return false; - } - utility.assert(source.charCodeAt(index) === 0x40 /* '@' */); - return true; - } - - function TagParser(options, title) { - this._options = options; - this._title = title; - this._tag = { - title: title, - description: null - }; - if (this._options.lineNumbers) { - this._tag.lineNumber = lineNumber; - } - this._last = 0; - // space to save special information for title parsers. - this._extra = { }; - } - - // addError(err, ...) - TagParser.prototype.addError = function addError(errorText) { - var args = Array.prototype.slice.call(arguments, 1), - msg = errorText.replace( - /%(\d)/g, - function (whole, index) { - utility.assert(index < args.length, 'Message reference must be in range'); - return args[index]; - } - ); - - if (!this._tag.errors) { - this._tag.errors = []; - } - if (strict) { - utility.throwError(msg); - } - this._tag.errors.push(msg); - return recoverable; - }; - - TagParser.prototype.parseType = function () { - // type required titles - if (isTypeParameterRequired(this._title)) { - try { - this._tag.type = parseType(this._title, this._last); - if (!this._tag.type) { - if (!isParamTitle(this._title) && !isReturnTitle(this._title)) { - if (!this.addError('Missing or invalid tag type')) { - return false; - } - } - } - } catch (error) { - this._tag.type = null; - if (!this.addError(error.message)) { - return false; - } - } - } else if (isAllowedType(this._title)) { - // optional types - try { - this._tag.type = parseType(this._title, this._last); - } catch (e) { - //For optional types, lets drop the thrown error when we hit the end of the file - } - } - return true; - }; - - TagParser.prototype._parseNamePath = function (optional) { - var name; - name = parseName(this._last, sloppy && isParamTitle(this._title), true); - if (!name) { - if (!optional) { - if (!this.addError('Missing or invalid tag name')) { - return false; - } - } - } - this._tag.name = name; - return true; - }; - - TagParser.prototype.parseNamePath = function () { - return this._parseNamePath(false); - }; - - TagParser.prototype.parseNamePathOptional = function () { - return this._parseNamePath(true); - }; - - - TagParser.prototype.parseName = function () { - var assign, name; - - // param, property requires name - if (isAllowedName(this._title)) { - this._tag.name = parseName(this._last, sloppy && isParamTitle(this._title), isAllowedNested(this._title)); - if (!this._tag.name) { - if (!isNameParameterRequired(this._title)) { - return true; - } - - // it's possible the name has already been parsed but interpreted as a type - // it's also possible this is a sloppy declaration, in which case it will be - // fixed at the end - if (isParamTitle(this._title) && this._tag.type && this._tag.type.name) { - this._extra.name = this._tag.type; - this._tag.name = this._tag.type.name; - this._tag.type = null; - } else { - if (!this.addError('Missing or invalid tag name')) { - return false; - } - } - } else { - name = this._tag.name; - if (name.charAt(0) === '[' && name.charAt(name.length - 1) === ']') { - // extract the default value if there is one - // example: @param {string} [somebody=John Doe] description - assign = name.substring(1, name.length - 1).split('='); - if (assign[1]) { - this._tag['default'] = assign[1]; - } - this._tag.name = assign[0]; - - // convert to an optional type - if (this._tag.type && this._tag.type.type !== 'OptionalType') { - this._tag.type = { - type: 'OptionalType', - expression: this._tag.type - }; - } - } - } - } - - return true; - }; - - TagParser.prototype.parseDescription = function parseDescription() { - var description = trim(sliceSource(source, index, this._last)); - if (description) { - if ((/^-\s+/).test(description)) { - description = description.substring(2); - } - this._tag.description = description; - } - return true; - }; - - TagParser.prototype.parseKind = function parseKind() { - var kind, kinds; - kinds = { - 'class': true, - 'constant': true, - 'event': true, - 'external': true, - 'file': true, - 'function': true, - 'member': true, - 'mixin': true, - 'module': true, - 'namespace': true, - 'typedef': true - }; - kind = trim(sliceSource(source, index, this._last)); - this._tag.kind = kind; - if (!hasOwnProperty(kinds, kind)) { - if (!this.addError('Invalid kind name \'%0\'', kind)) { - return false; - } - } - return true; - }; - - TagParser.prototype.parseAccess = function parseAccess() { - var access; - access = trim(sliceSource(source, index, this._last)); - this._tag.access = access; - if (access !== 'private' && access !== 'protected' && access !== 'public') { - if (!this.addError('Invalid access name \'%0\'', access)) { - return false; - } - } - return true; - }; - - TagParser.prototype.parseVariation = function parseVariation() { - var variation, text; - text = trim(sliceSource(source, index, this._last)); - variation = parseFloat(text, 10); - this._tag.variation = variation; - if (isNaN(variation)) { - if (!this.addError('Invalid variation \'%0\'', text)) { - return false; - } - } - return true; - }; - - TagParser.prototype.ensureEnd = function () { - var shouldBeEmpty = trim(sliceSource(source, index, this._last)); - if (shouldBeEmpty) { - if (!this.addError('Unknown content \'%0\'', shouldBeEmpty)) { - return false; - } - } - return true; - }; - - TagParser.prototype.epilogue = function epilogue() { - var description; - - description = this._tag.description; - // un-fix potentially sloppy declaration - if (isParamTitle(this._title) && !this._tag.type && description && description.charAt(0) === '[') { - this._tag.type = this._extra.name; - if (!this._tag.name) { - this._tag.name = undefined; - } - - if (!sloppy) { - if (!this.addError('Missing or invalid tag name')) { - return false; - } - } - } - - return true; - }; - - Rules = { - // http://usejsdoc.org/tags-access.html - 'access': ['parseAccess'], - // http://usejsdoc.org/tags-alias.html - 'alias': ['parseNamePath', 'ensureEnd'], - // http://usejsdoc.org/tags-augments.html - 'augments': ['parseType', 'parseNamePathOptional', 'ensureEnd'], - // http://usejsdoc.org/tags-constructor.html - 'constructor': ['parseType', 'parseNamePathOptional', 'ensureEnd'], - // Synonym: http://usejsdoc.org/tags-constructor.html - 'class': ['parseType', 'parseNamePathOptional', 'ensureEnd'], - // Synonym: http://usejsdoc.org/tags-extends.html - 'extends': ['parseType', 'parseNamePathOptional', 'ensureEnd'], - // http://usejsdoc.org/tags-deprecated.html - 'deprecated': ['parseDescription'], - // http://usejsdoc.org/tags-global.html - 'global': ['ensureEnd'], - // http://usejsdoc.org/tags-inner.html - 'inner': ['ensureEnd'], - // http://usejsdoc.org/tags-instance.html - 'instance': ['ensureEnd'], - // http://usejsdoc.org/tags-kind.html - 'kind': ['parseKind'], - // http://usejsdoc.org/tags-mixes.html - 'mixes': ['parseNamePath', 'ensureEnd'], - // http://usejsdoc.org/tags-mixin.html - 'mixin': ['parseNamePathOptional', 'ensureEnd'], - // http://usejsdoc.org/tags-member.html - 'member': ['parseType', 'parseNamePathOptional', 'ensureEnd'], - // http://usejsdoc.org/tags-method.html - 'method': ['parseNamePathOptional', 'ensureEnd'], - // http://usejsdoc.org/tags-module.html - 'module': ['parseType', 'parseNamePathOptional', 'ensureEnd'], - // Synonym: http://usejsdoc.org/tags-method.html - 'func': ['parseNamePathOptional', 'ensureEnd'], - // Synonym: http://usejsdoc.org/tags-method.html - 'function': ['parseNamePathOptional', 'ensureEnd'], - // Synonym: http://usejsdoc.org/tags-member.html - 'var': ['parseType', 'parseNamePathOptional', 'ensureEnd'], - // http://usejsdoc.org/tags-name.html - 'name': ['parseNamePath', 'ensureEnd'], - // http://usejsdoc.org/tags-namespace.html - 'namespace': ['parseType', 'parseNamePathOptional', 'ensureEnd'], - // http://usejsdoc.org/tags-private.html - 'private': ['parseType', 'parseDescription'], - // http://usejsdoc.org/tags-protected.html - 'protected': ['parseType', 'parseDescription'], - // http://usejsdoc.org/tags-public.html - 'public': ['parseType', 'parseDescription'], - // http://usejsdoc.org/tags-readonly.html - 'readonly': ['ensureEnd'], - // http://usejsdoc.org/tags-requires.html - 'requires': ['parseNamePath', 'ensureEnd'], - // http://usejsdoc.org/tags-since.html - 'since': ['parseDescription'], - // http://usejsdoc.org/tags-static.html - 'static': ['ensureEnd'], - // http://usejsdoc.org/tags-summary.html - 'summary': ['parseDescription'], - // http://usejsdoc.org/tags-this.html - 'this': ['parseNamePath', 'ensureEnd'], - // http://usejsdoc.org/tags-todo.html - 'todo': ['parseDescription'], - // http://usejsdoc.org/tags-typedef.html - 'typedef': ['parseType', 'parseNamePathOptional'], - // http://usejsdoc.org/tags-variation.html - 'variation': ['parseVariation'], - // http://usejsdoc.org/tags-version.html - 'version': ['parseDescription'] - }; - - TagParser.prototype.parse = function parse() { - var i, iz, sequences, method; - - // empty title - if (!this._title) { - if (!this.addError('Missing or invalid title')) { - return null; - } - } - - // Seek to content last index. - this._last = seekContent(this._title); - - if (hasOwnProperty(Rules, this._title)) { - sequences = Rules[this._title]; - } else { - // default sequences - sequences = ['parseType', 'parseName', 'parseDescription', 'epilogue']; - } - - for (i = 0, iz = sequences.length; i < iz; ++i) { - method = sequences[i]; - if (!this[method]()) { - return null; - } - } - - return this._tag; - }; - - function parseTag(options) { - var title, parser, tag; - - // skip to tag - if (!skipToTag()) { - return null; - } - - // scan title - title = scanTitle(); - - // construct tag parser - parser = new TagParser(options, title); - tag = parser.parse(); - - // Seek global index to end of this tag. - while (index < parser._last) { - advance(); - } - return tag; - } - - // - // Parse JSDoc - // - - function scanJSDocDescription(preserveWhitespace) { - var description = '', ch, atAllowed; - - atAllowed = true; - while (index < length) { - ch = source.charCodeAt(index); - - if (atAllowed && ch === 0x40 /* '@' */) { - break; - } - - if (esutils.code.isLineTerminator(ch)) { - atAllowed = true; - } else if (atAllowed && !esutils.code.isWhiteSpace(ch)) { - atAllowed = false; - } - - description += advance(); - } - - return preserveWhitespace ? description : trim(description); - } - - function parse(comment, options) { - var tags = [], tag, description, interestingTags, i, iz; - - if (options === undefined) { - options = {}; - } - - if (typeof options.unwrap === 'boolean' && options.unwrap) { - source = unwrapComment(comment); - } else { - source = comment; - } - - // array of relevant tags - if (options.tags) { - if (isArray(options.tags)) { - interestingTags = { }; - for (i = 0, iz = options.tags.length; i < iz; i++) { - if (typeof options.tags[i] === 'string') { - interestingTags[options.tags[i]] = true; - } else { - utility.throwError('Invalid "tags" parameter: ' + options.tags); - } - } - } else { - utility.throwError('Invalid "tags" parameter: ' + options.tags); - } - } - - length = source.length; - index = 0; - lineNumber = 0; - recoverable = options.recoverable; - sloppy = options.sloppy; - strict = options.strict; - - description = scanJSDocDescription(options.preserveWhitespace); - - while (true) { - tag = parseTag(options); - if (!tag) { - break; - } - if (!interestingTags || interestingTags.hasOwnProperty(tag.title)) { - tags.push(tag); - } - } - - return { - description: description, - tags: tags - }; - } - exports.parse = parse; - }(jsdoc = {})); - - exports.version = utility.VERSION; - exports.parse = jsdoc.parse; - exports.parseType = typed.parseType; - exports.parseParamType = typed.parseParamType; - exports.unwrapComment = unwrapComment; - exports.Syntax = shallowCopy(typed.Syntax); - exports.Error = utility.DoctrineError; - exports.type = { - Syntax: exports.Syntax, - parseType: typed.parseType, - parseParamType: typed.parseParamType, - stringify: typed.stringify - }; -}()); -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/doctrine/lib/typed.js b/node_modules/doctrine/lib/typed.js deleted file mode 100644 index 2b02000e6..000000000 --- a/node_modules/doctrine/lib/typed.js +++ /dev/null @@ -1,1261 +0,0 @@ -/* - Copyright (C) 2012-2014 Yusuke Suzuki - Copyright (C) 2014 Dan Tao - Copyright (C) 2013 Andrew Eisenberg - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -// "typed", the Type Expression Parser for doctrine. - -(function () { - 'use strict'; - - var Syntax, - Token, - source, - length, - index, - previous, - token, - value, - esutils, - utility; - - esutils = require('esutils'); - utility = require('./utility'); - - Syntax = { - NullableLiteral: 'NullableLiteral', - AllLiteral: 'AllLiteral', - NullLiteral: 'NullLiteral', - UndefinedLiteral: 'UndefinedLiteral', - VoidLiteral: 'VoidLiteral', - UnionType: 'UnionType', - ArrayType: 'ArrayType', - RecordType: 'RecordType', - FieldType: 'FieldType', - FunctionType: 'FunctionType', - ParameterType: 'ParameterType', - RestType: 'RestType', - NonNullableType: 'NonNullableType', - OptionalType: 'OptionalType', - NullableType: 'NullableType', - NameExpression: 'NameExpression', - TypeApplication: 'TypeApplication' - }; - - Token = { - ILLEGAL: 0, // ILLEGAL - DOT_LT: 1, // .< - REST: 2, // ... - LT: 3, // < - GT: 4, // > - LPAREN: 5, // ( - RPAREN: 6, // ) - LBRACE: 7, // { - RBRACE: 8, // } - LBRACK: 9, // [ - RBRACK: 10, // ] - COMMA: 11, // , - COLON: 12, // : - STAR: 13, // * - PIPE: 14, // | - QUESTION: 15, // ? - BANG: 16, // ! - EQUAL: 17, // = - NAME: 18, // name token - STRING: 19, // string - NUMBER: 20, // number - EOF: 21 - }; - - function isTypeName(ch) { - return '><(){}[],:*|?!='.indexOf(String.fromCharCode(ch)) === -1 && !esutils.code.isWhiteSpace(ch) && !esutils.code.isLineTerminator(ch); - } - - function Context(previous, index, token, value) { - this._previous = previous; - this._index = index; - this._token = token; - this._value = value; - } - - Context.prototype.restore = function () { - previous = this._previous; - index = this._index; - token = this._token; - value = this._value; - }; - - Context.save = function () { - return new Context(previous, index, token, value); - }; - - function advance() { - var ch = source.charAt(index); - index += 1; - return ch; - } - - function scanHexEscape(prefix) { - var i, len, ch, code = 0; - - len = (prefix === 'u') ? 4 : 2; - for (i = 0; i < len; ++i) { - if (index < length && esutils.code.isHexDigit(source.charCodeAt(index))) { - ch = advance(); - code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase()); - } else { - return ''; - } - } - return String.fromCharCode(code); - } - - function scanString() { - var str = '', quote, ch, code, unescaped, restore; //TODO review removal octal = false - quote = source.charAt(index); - ++index; - - while (index < length) { - ch = advance(); - - if (ch === quote) { - quote = ''; - break; - } else if (ch === '\\') { - ch = advance(); - if (!esutils.code.isLineTerminator(ch.charCodeAt(0))) { - switch (ch) { - case 'n': - str += '\n'; - break; - case 'r': - str += '\r'; - break; - case 't': - str += '\t'; - break; - case 'u': - case 'x': - restore = index; - unescaped = scanHexEscape(ch); - if (unescaped) { - str += unescaped; - } else { - index = restore; - str += ch; - } - break; - case 'b': - str += '\b'; - break; - case 'f': - str += '\f'; - break; - case 'v': - str += '\v'; - break; - - default: - if (esutils.code.isOctalDigit(ch.charCodeAt(0))) { - code = '01234567'.indexOf(ch); - - // \0 is not octal escape sequence - // Deprecating unused code. TODO review removal - //if (code !== 0) { - // octal = true; - //} - - if (index < length && esutils.code.isOctalDigit(source.charCodeAt(index))) { - //TODO Review Removal octal = true; - code = code * 8 + '01234567'.indexOf(advance()); - - // 3 digits are only allowed when string starts - // with 0, 1, 2, 3 - if ('0123'.indexOf(ch) >= 0 && - index < length && - esutils.code.isOctalDigit(source.charCodeAt(index))) { - code = code * 8 + '01234567'.indexOf(advance()); - } - } - str += String.fromCharCode(code); - } else { - str += ch; - } - break; - } - } else { - if (ch === '\r' && source.charCodeAt(index) === 0x0A /* '\n' */) { - ++index; - } - } - } else if (esutils.code.isLineTerminator(ch.charCodeAt(0))) { - break; - } else { - str += ch; - } - } - - if (quote !== '') { - utility.throwError('unexpected quote'); - } - - value = str; - return Token.STRING; - } - - function scanNumber() { - var number, ch; - - number = ''; - ch = source.charCodeAt(index); - - if (ch !== 0x2E /* '.' */) { - number = advance(); - ch = source.charCodeAt(index); - - if (number === '0') { - if (ch === 0x78 /* 'x' */ || ch === 0x58 /* 'X' */) { - number += advance(); - while (index < length) { - ch = source.charCodeAt(index); - if (!esutils.code.isHexDigit(ch)) { - break; - } - number += advance(); - } - - if (number.length <= 2) { - // only 0x - utility.throwError('unexpected token'); - } - - if (index < length) { - ch = source.charCodeAt(index); - if (esutils.code.isIdentifierStart(ch)) { - utility.throwError('unexpected token'); - } - } - value = parseInt(number, 16); - return Token.NUMBER; - } - - if (esutils.code.isOctalDigit(ch)) { - number += advance(); - while (index < length) { - ch = source.charCodeAt(index); - if (!esutils.code.isOctalDigit(ch)) { - break; - } - number += advance(); - } - - if (index < length) { - ch = source.charCodeAt(index); - if (esutils.code.isIdentifierStart(ch) || esutils.code.isDecimalDigit(ch)) { - utility.throwError('unexpected token'); - } - } - value = parseInt(number, 8); - return Token.NUMBER; - } - - if (esutils.code.isDecimalDigit(ch)) { - utility.throwError('unexpected token'); - } - } - - while (index < length) { - ch = source.charCodeAt(index); - if (!esutils.code.isDecimalDigit(ch)) { - break; - } - number += advance(); - } - } - - if (ch === 0x2E /* '.' */) { - number += advance(); - while (index < length) { - ch = source.charCodeAt(index); - if (!esutils.code.isDecimalDigit(ch)) { - break; - } - number += advance(); - } - } - - if (ch === 0x65 /* 'e' */ || ch === 0x45 /* 'E' */) { - number += advance(); - - ch = source.charCodeAt(index); - if (ch === 0x2B /* '+' */ || ch === 0x2D /* '-' */) { - number += advance(); - } - - ch = source.charCodeAt(index); - if (esutils.code.isDecimalDigit(ch)) { - number += advance(); - while (index < length) { - ch = source.charCodeAt(index); - if (!esutils.code.isDecimalDigit(ch)) { - break; - } - number += advance(); - } - } else { - utility.throwError('unexpected token'); - } - } - - if (index < length) { - ch = source.charCodeAt(index); - if (esutils.code.isIdentifierStart(ch)) { - utility.throwError('unexpected token'); - } - } - - value = parseFloat(number); - return Token.NUMBER; - } - - - function scanTypeName() { - var ch, ch2; - - value = advance(); - while (index < length && isTypeName(source.charCodeAt(index))) { - ch = source.charCodeAt(index); - if (ch === 0x2E /* '.' */) { - if ((index + 1) >= length) { - return Token.ILLEGAL; - } - ch2 = source.charCodeAt(index + 1); - if (ch2 === 0x3C /* '<' */) { - break; - } - } - value += advance(); - } - return Token.NAME; - } - - function next() { - var ch; - - previous = index; - - while (index < length && esutils.code.isWhiteSpace(source.charCodeAt(index))) { - advance(); - } - if (index >= length) { - token = Token.EOF; - return token; - } - - ch = source.charCodeAt(index); - switch (ch) { - case 0x27: /* ''' */ - case 0x22: /* '"' */ - token = scanString(); - return token; - - case 0x3A: /* ':' */ - advance(); - token = Token.COLON; - return token; - - case 0x2C: /* ',' */ - advance(); - token = Token.COMMA; - return token; - - case 0x28: /* '(' */ - advance(); - token = Token.LPAREN; - return token; - - case 0x29: /* ')' */ - advance(); - token = Token.RPAREN; - return token; - - case 0x5B: /* '[' */ - advance(); - token = Token.LBRACK; - return token; - - case 0x5D: /* ']' */ - advance(); - token = Token.RBRACK; - return token; - - case 0x7B: /* '{' */ - advance(); - token = Token.LBRACE; - return token; - - case 0x7D: /* '}' */ - advance(); - token = Token.RBRACE; - return token; - - case 0x2E: /* '.' */ - if (index + 1 < length) { - ch = source.charCodeAt(index + 1); - if (ch === 0x3C /* '<' */) { - advance(); // '.' - advance(); // '<' - token = Token.DOT_LT; - return token; - } - - if (ch === 0x2E /* '.' */ && index + 2 < length && source.charCodeAt(index + 2) === 0x2E /* '.' */) { - advance(); // '.' - advance(); // '.' - advance(); // '.' - token = Token.REST; - return token; - } - - if (esutils.code.isDecimalDigit(ch)) { - token = scanNumber(); - return token; - } - } - token = Token.ILLEGAL; - return token; - - case 0x3C: /* '<' */ - advance(); - token = Token.LT; - return token; - - case 0x3E: /* '>' */ - advance(); - token = Token.GT; - return token; - - case 0x2A: /* '*' */ - advance(); - token = Token.STAR; - return token; - - case 0x7C: /* '|' */ - advance(); - token = Token.PIPE; - return token; - - case 0x3F: /* '?' */ - advance(); - token = Token.QUESTION; - return token; - - case 0x21: /* '!' */ - advance(); - token = Token.BANG; - return token; - - case 0x3D: /* '=' */ - advance(); - token = Token.EQUAL; - return token; - - default: - if (esutils.code.isDecimalDigit(ch)) { - token = scanNumber(); - return token; - } - - // type string permits following case, - // - // namespace.module.MyClass - // - // this reduced 1 token TK_NAME - utility.assert(isTypeName(ch)); - token = scanTypeName(); - return token; - } - } - - function consume(target, text) { - utility.assert(token === target, text || 'consumed token not matched'); - next(); - } - - function expect(target, message) { - if (token !== target) { - utility.throwError(message || 'unexpected token'); - } - next(); - } - - // UnionType := '(' TypeUnionList ')' - // - // TypeUnionList := - // <> - // | NonemptyTypeUnionList - // - // NonemptyTypeUnionList := - // TypeExpression - // | TypeExpression '|' NonemptyTypeUnionList - function parseUnionType() { - var elements; - consume(Token.LPAREN, 'UnionType should start with ('); - elements = []; - if (token !== Token.RPAREN) { - while (true) { - elements.push(parseTypeExpression()); - if (token === Token.RPAREN) { - break; - } - expect(Token.PIPE); - } - } - consume(Token.RPAREN, 'UnionType should end with )'); - return { - type: Syntax.UnionType, - elements: elements - }; - } - - // ArrayType := '[' ElementTypeList ']' - // - // ElementTypeList := - // <> - // | TypeExpression - // | '...' TypeExpression - // | TypeExpression ',' ElementTypeList - function parseArrayType() { - var elements; - consume(Token.LBRACK, 'ArrayType should start with ['); - elements = []; - while (token !== Token.RBRACK) { - if (token === Token.REST) { - consume(Token.REST); - elements.push({ - type: Syntax.RestType, - expression: parseTypeExpression() - }); - break; - } else { - elements.push(parseTypeExpression()); - } - if (token !== Token.RBRACK) { - expect(Token.COMMA); - } - } - expect(Token.RBRACK); - return { - type: Syntax.ArrayType, - elements: elements - }; - } - - function parseFieldName() { - var v = value; - if (token === Token.NAME || token === Token.STRING) { - next(); - return v; - } - - if (token === Token.NUMBER) { - consume(Token.NUMBER); - return String(v); - } - - utility.throwError('unexpected token'); - } - - // FieldType := - // FieldName - // | FieldName ':' TypeExpression - // - // FieldName := - // NameExpression - // | StringLiteral - // | NumberLiteral - // | ReservedIdentifier - function parseFieldType() { - var key; - - key = parseFieldName(); - if (token === Token.COLON) { - consume(Token.COLON); - return { - type: Syntax.FieldType, - key: key, - value: parseTypeExpression() - }; - } - return { - type: Syntax.FieldType, - key: key, - value: null - }; - } - - // RecordType := '{' FieldTypeList '}' - // - // FieldTypeList := - // <> - // | FieldType - // | FieldType ',' FieldTypeList - function parseRecordType() { - var fields; - - consume(Token.LBRACE, 'RecordType should start with {'); - fields = []; - if (token === Token.COMMA) { - consume(Token.COMMA); - } else { - while (token !== Token.RBRACE) { - fields.push(parseFieldType()); - if (token !== Token.RBRACE) { - expect(Token.COMMA); - } - } - } - expect(Token.RBRACE); - return { - type: Syntax.RecordType, - fields: fields - }; - } - - // NameExpression := - // Identifier - // | TagIdentifier ':' Identifier - // - // Tag identifier is one of "module", "external" or "event" - // Identifier is the same as Token.NAME, including any dots, something like - // namespace.module.MyClass - function parseNameExpression() { - var name = value; - expect(Token.NAME); - - if (token === Token.COLON && ( - name === 'module' || - name === 'external' || - name === 'event')) { - consume(Token.COLON); - name += ':' + value; - expect(Token.NAME); - } - - return { - type: Syntax.NameExpression, - name: name - }; - } - - // TypeExpressionList := - // TopLevelTypeExpression - // | TopLevelTypeExpression ',' TypeExpressionList - function parseTypeExpressionList() { - var elements = []; - - elements.push(parseTop()); - while (token === Token.COMMA) { - consume(Token.COMMA); - elements.push(parseTop()); - } - return elements; - } - - // TypeName := - // NameExpression - // | NameExpression TypeApplication - // - // TypeApplication := - // '.<' TypeExpressionList '>' - // | '<' TypeExpressionList '>' // this is extension of doctrine - function parseTypeName() { - var expr, applications; - - expr = parseNameExpression(); - if (token === Token.DOT_LT || token === Token.LT) { - next(); - applications = parseTypeExpressionList(); - expect(Token.GT); - return { - type: Syntax.TypeApplication, - expression: expr, - applications: applications - }; - } - return expr; - } - - // ResultType := - // <> - // | ':' void - // | ':' TypeExpression - // - // BNF is above - // but, we remove <> pattern, so token is always TypeToken::COLON - function parseResultType() { - consume(Token.COLON, 'ResultType should start with :'); - if (token === Token.NAME && value === 'void') { - consume(Token.NAME); - return { - type: Syntax.VoidLiteral - }; - } - return parseTypeExpression(); - } - - // ParametersType := - // RestParameterType - // | NonRestParametersType - // | NonRestParametersType ',' RestParameterType - // - // RestParameterType := - // '...' - // '...' Identifier - // - // NonRestParametersType := - // ParameterType ',' NonRestParametersType - // | ParameterType - // | OptionalParametersType - // - // OptionalParametersType := - // OptionalParameterType - // | OptionalParameterType, OptionalParametersType - // - // OptionalParameterType := ParameterType= - // - // ParameterType := TypeExpression | Identifier ':' TypeExpression - // - // Identifier is "new" or "this" - function parseParametersType() { - var params = [], optionalSequence = false, expr, rest = false; - - while (token !== Token.RPAREN) { - if (token === Token.REST) { - // RestParameterType - consume(Token.REST); - rest = true; - } - - expr = parseTypeExpression(); - if (expr.type === Syntax.NameExpression && token === Token.COLON) { - // Identifier ':' TypeExpression - consume(Token.COLON); - expr = { - type: Syntax.ParameterType, - name: expr.name, - expression: parseTypeExpression() - }; - } - if (token === Token.EQUAL) { - consume(Token.EQUAL); - expr = { - type: Syntax.OptionalType, - expression: expr - }; - optionalSequence = true; - } else { - if (optionalSequence) { - utility.throwError('unexpected token'); - } - } - if (rest) { - expr = { - type: Syntax.RestType, - expression: expr - }; - } - params.push(expr); - if (token !== Token.RPAREN) { - expect(Token.COMMA); - } - } - return params; - } - - // FunctionType := 'function' FunctionSignatureType - // - // FunctionSignatureType := - // | TypeParameters '(' ')' ResultType - // | TypeParameters '(' ParametersType ')' ResultType - // | TypeParameters '(' 'this' ':' TypeName ')' ResultType - // | TypeParameters '(' 'this' ':' TypeName ',' ParametersType ')' ResultType - function parseFunctionType() { - var isNew, thisBinding, params, result, fnType; - utility.assert(token === Token.NAME && value === 'function', 'FunctionType should start with \'function\''); - consume(Token.NAME); - - // Google Closure Compiler is not implementing TypeParameters. - // So we do not. if we don't get '(', we see it as error. - expect(Token.LPAREN); - - isNew = false; - params = []; - thisBinding = null; - if (token !== Token.RPAREN) { - // ParametersType or 'this' - if (token === Token.NAME && - (value === 'this' || value === 'new')) { - // 'this' or 'new' - // 'new' is Closure Compiler extension - isNew = value === 'new'; - consume(Token.NAME); - expect(Token.COLON); - thisBinding = parseTypeName(); - if (token === Token.COMMA) { - consume(Token.COMMA); - params = parseParametersType(); - } - } else { - params = parseParametersType(); - } - } - - expect(Token.RPAREN); - - result = null; - if (token === Token.COLON) { - result = parseResultType(); - } - - fnType = { - type: Syntax.FunctionType, - params: params, - result: result - }; - if (thisBinding) { - // avoid adding null 'new' and 'this' properties - fnType['this'] = thisBinding; - if (isNew) { - fnType['new'] = true; - } - } - return fnType; - } - - // BasicTypeExpression := - // '*' - // | 'null' - // | 'undefined' - // | TypeName - // | FunctionType - // | UnionType - // | RecordType - // | ArrayType - function parseBasicTypeExpression() { - var context; - switch (token) { - case Token.STAR: - consume(Token.STAR); - return { - type: Syntax.AllLiteral - }; - - case Token.LPAREN: - return parseUnionType(); - - case Token.LBRACK: - return parseArrayType(); - - case Token.LBRACE: - return parseRecordType(); - - case Token.NAME: - if (value === 'null') { - consume(Token.NAME); - return { - type: Syntax.NullLiteral - }; - } - - if (value === 'undefined') { - consume(Token.NAME); - return { - type: Syntax.UndefinedLiteral - }; - } - - context = Context.save(); - if (value === 'function') { - try { - return parseFunctionType(); - } catch (e) { - context.restore(); - } - } - - return parseTypeName(); - - default: - utility.throwError('unexpected token'); - } - } - - // TypeExpression := - // BasicTypeExpression - // | '?' BasicTypeExpression - // | '!' BasicTypeExpression - // | BasicTypeExpression '?' - // | BasicTypeExpression '!' - // | '?' - // | BasicTypeExpression '[]' - function parseTypeExpression() { - var expr; - - if (token === Token.QUESTION) { - consume(Token.QUESTION); - if (token === Token.COMMA || token === Token.EQUAL || token === Token.RBRACE || - token === Token.RPAREN || token === Token.PIPE || token === Token.EOF || - token === Token.RBRACK || token === Token.GT) { - return { - type: Syntax.NullableLiteral - }; - } - return { - type: Syntax.NullableType, - expression: parseBasicTypeExpression(), - prefix: true - }; - } - - if (token === Token.BANG) { - consume(Token.BANG); - return { - type: Syntax.NonNullableType, - expression: parseBasicTypeExpression(), - prefix: true - }; - } - - expr = parseBasicTypeExpression(); - if (token === Token.BANG) { - consume(Token.BANG); - return { - type: Syntax.NonNullableType, - expression: expr, - prefix: false - }; - } - - if (token === Token.QUESTION) { - consume(Token.QUESTION); - return { - type: Syntax.NullableType, - expression: expr, - prefix: false - }; - } - - if (token === Token.LBRACK) { - consume(Token.LBRACK); - expect(Token.RBRACK, 'expected an array-style type declaration (' + value + '[])'); - return { - type: Syntax.TypeApplication, - expression: { - type: Syntax.NameExpression, - name: 'Array' - }, - applications: [expr] - }; - } - - return expr; - } - - // TopLevelTypeExpression := - // TypeExpression - // | TypeUnionList - // - // This rule is Google Closure Compiler extension, not ES4 - // like, - // { number | string } - // If strict to ES4, we should write it as - // { (number|string) } - function parseTop() { - var expr, elements; - - expr = parseTypeExpression(); - if (token !== Token.PIPE) { - return expr; - } - - elements = [ expr ]; - consume(Token.PIPE); - while (true) { - elements.push(parseTypeExpression()); - if (token !== Token.PIPE) { - break; - } - consume(Token.PIPE); - } - - return { - type: Syntax.UnionType, - elements: elements - }; - } - - function parseTopParamType() { - var expr; - - if (token === Token.REST) { - consume(Token.REST); - return { - type: Syntax.RestType, - expression: parseTop() - }; - } - - expr = parseTop(); - if (token === Token.EQUAL) { - consume(Token.EQUAL); - return { - type: Syntax.OptionalType, - expression: expr - }; - } - - return expr; - } - - function parseType(src, opt) { - var expr; - - source = src; - length = source.length; - index = 0; - previous = 0; - - next(); - expr = parseTop(); - - if (opt && opt.midstream) { - return { - expression: expr, - index: previous - }; - } - - if (token !== Token.EOF) { - utility.throwError('not reach to EOF'); - } - - return expr; - } - - function parseParamType(src, opt) { - var expr; - - source = src; - length = source.length; - index = 0; - previous = 0; - - next(); - expr = parseTopParamType(); - - if (opt && opt.midstream) { - return { - expression: expr, - index: previous - }; - } - - if (token !== Token.EOF) { - utility.throwError('not reach to EOF'); - } - - return expr; - } - - function stringifyImpl(node, compact, topLevel) { - var result, i, iz; - - switch (node.type) { - case Syntax.NullableLiteral: - result = '?'; - break; - - case Syntax.AllLiteral: - result = '*'; - break; - - case Syntax.NullLiteral: - result = 'null'; - break; - - case Syntax.UndefinedLiteral: - result = 'undefined'; - break; - - case Syntax.VoidLiteral: - result = 'void'; - break; - - case Syntax.UnionType: - if (!topLevel) { - result = '('; - } else { - result = ''; - } - - for (i = 0, iz = node.elements.length; i < iz; ++i) { - result += stringifyImpl(node.elements[i], compact); - if ((i + 1) !== iz) { - result += '|'; - } - } - - if (!topLevel) { - result += ')'; - } - break; - - case Syntax.ArrayType: - result = '['; - for (i = 0, iz = node.elements.length; i < iz; ++i) { - result += stringifyImpl(node.elements[i], compact); - if ((i + 1) !== iz) { - result += compact ? ',' : ', '; - } - } - result += ']'; - break; - - case Syntax.RecordType: - result = '{'; - for (i = 0, iz = node.fields.length; i < iz; ++i) { - result += stringifyImpl(node.fields[i], compact); - if ((i + 1) !== iz) { - result += compact ? ',' : ', '; - } - } - result += '}'; - break; - - case Syntax.FieldType: - if (node.value) { - result = node.key + (compact ? ':' : ': ') + stringifyImpl(node.value, compact); - } else { - result = node.key; - } - break; - - case Syntax.FunctionType: - result = compact ? 'function(' : 'function ('; - - if (node['this']) { - if (node['new']) { - result += (compact ? 'new:' : 'new: '); - } else { - result += (compact ? 'this:' : 'this: '); - } - - result += stringifyImpl(node['this'], compact); - - if (node.params.length !== 0) { - result += compact ? ',' : ', '; - } - } - - for (i = 0, iz = node.params.length; i < iz; ++i) { - result += stringifyImpl(node.params[i], compact); - if ((i + 1) !== iz) { - result += compact ? ',' : ', '; - } - } - - result += ')'; - - if (node.result) { - result += (compact ? ':' : ': ') + stringifyImpl(node.result, compact); - } - break; - - case Syntax.ParameterType: - result = node.name + (compact ? ':' : ': ') + stringifyImpl(node.expression, compact); - break; - - case Syntax.RestType: - result = '...'; - if (node.expression) { - result += stringifyImpl(node.expression, compact); - } - break; - - case Syntax.NonNullableType: - if (node.prefix) { - result = '!' + stringifyImpl(node.expression, compact); - } else { - result = stringifyImpl(node.expression, compact) + '!'; - } - break; - - case Syntax.OptionalType: - result = stringifyImpl(node.expression, compact) + '='; - break; - - case Syntax.NullableType: - if (node.prefix) { - result = '?' + stringifyImpl(node.expression, compact); - } else { - result = stringifyImpl(node.expression, compact) + '?'; - } - break; - - case Syntax.NameExpression: - result = node.name; - break; - - case Syntax.TypeApplication: - result = stringifyImpl(node.expression, compact) + '.<'; - for (i = 0, iz = node.applications.length; i < iz; ++i) { - result += stringifyImpl(node.applications[i], compact); - if ((i + 1) !== iz) { - result += compact ? ',' : ', '; - } - } - result += '>'; - break; - - default: - utility.throwError('Unknown type ' + node.type); - } - - return result; - } - - function stringify(node, options) { - if (options == null) { - options = {}; - } - return stringifyImpl(node, options.compact, options.topLevel); - } - - exports.parseType = parseType; - exports.parseParamType = parseParamType; - exports.stringify = stringify; - exports.Syntax = Syntax; -}()); -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/doctrine/lib/utility.js b/node_modules/doctrine/lib/utility.js deleted file mode 100644 index bb4412584..000000000 --- a/node_modules/doctrine/lib/utility.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright (C) 2014 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -(function () { - 'use strict'; - - var VERSION; - - VERSION = require('../package.json').version; - exports.VERSION = VERSION; - - function DoctrineError(message) { - this.name = 'DoctrineError'; - this.message = message; - } - DoctrineError.prototype = (function () { - var Middle = function () { }; - Middle.prototype = Error.prototype; - return new Middle(); - }()); - DoctrineError.prototype.constructor = DoctrineError; - exports.DoctrineError = DoctrineError; - - function throwError(message) { - throw new DoctrineError(message); - } - exports.throwError = throwError; - - exports.assert = require('assert'); -}()); - -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/doctrine/node_modules/esutils/README.md b/node_modules/doctrine/node_modules/esutils/README.md deleted file mode 100644 index 494fac5ed..000000000 --- a/node_modules/doctrine/node_modules/esutils/README.md +++ /dev/null @@ -1,169 +0,0 @@ -### esutils [![Build Status](https://secure.travis-ci.org/Constellation/esutils.svg)](http://travis-ci.org/Constellation/esutils) -esutils ([esutils](http://github.com/Constellation/esutils)) is -utility box for ECMAScript language tools. - -### API - -### ast - -#### ast.isExpression(node) - -Returns true if `node` is an Expression as defined in ECMA262 edition 5.1 section -[11](https://es5.github.io/#x11). - -#### ast.isStatement(node) - -Returns true if `node` is a Statement as defined in ECMA262 edition 5.1 section -[12](https://es5.github.io/#x12). - -#### ast.isIterationStatement(node) - -Returns true if `node` is an IterationStatement as defined in ECMA262 edition -5.1 section [12.6](https://es5.github.io/#x12.6). - -#### ast.isSourceElement(node) - -Returns true if `node` is a SourceElement as defined in ECMA262 edition 5.1 -section [14](https://es5.github.io/#x14). - -#### ast.trailingStatement(node) - -Returns `Statement?` if `node` has trailing `Statement`. -```js -if (cond) - consequent; -``` -When taking this `IfStatement`, returns `consequent;` statement. - -#### ast.isProblematicIfStatement(node) - -Returns true if `node` is a problematic IfStatement. If `node` is a problematic `IfStatement`, `node` cannot be represented as an one on one JavaScript code. -```js -{ - type: 'IfStatement', - consequent: { - type: 'WithStatement', - body: { - type: 'IfStatement', - consequent: {type: 'EmptyStatement'} - } - }, - alternate: {type: 'EmptyStatement'} -} -``` -The above node cannot be represented as a JavaScript code, since the top level `else` alternate belongs to an inner `IfStatement`. - - -### code - -#### code.isDecimalDigit(code) - -Return true if provided code is decimal digit. - -#### code.isHexDigit(code) - -Return true if provided code is hexadecimal digit. - -#### code.isOctalDigit(code) - -Return true if provided code is octal digit. - -#### code.isWhiteSpace(code) - -Return true if provided code is white space. White space characters are formally defined in ECMA262. - -#### code.isLineTerminator(code) - -Return true if provided code is line terminator. Line terminator characters are formally defined in ECMA262. - -#### code.isIdentifierStart(code) - -Return true if provided code can be the first character of ECMA262 Identifier. They are formally defined in ECMA262. - -#### code.isIdentifierPart(code) - -Return true if provided code can be the trailing character of ECMA262 Identifier. They are formally defined in ECMA262. - -### keyword - -#### keyword.isKeywordES5(id, strict) - -Returns `true` if provided identifier string is a Keyword or Future Reserved Word -in ECMA262 edition 5.1. They are formally defined in ECMA262 sections -[7.6.1.1](http://es5.github.io/#x7.6.1.1) and [7.6.1.2](http://es5.github.io/#x7.6.1.2), -respectively. If the `strict` flag is truthy, this function additionally checks whether -`id` is a Keyword or Future Reserved Word under strict mode. - -#### keyword.isKeywordES6(id, strict) - -Returns `true` if provided identifier string is a Keyword or Future Reserved Word -in ECMA262 edition 6. They are formally defined in ECMA262 sections -[11.6.2.1](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-keywords) and -[11.6.2.2](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-future-reserved-words), -respectively. If the `strict` flag is truthy, this function additionally checks whether -`id` is a Keyword or Future Reserved Word under strict mode. - -#### keyword.isReservedWordES5(id, strict) - -Returns `true` if provided identifier string is a Reserved Word in ECMA262 edition 5.1. -They are formally defined in ECMA262 section [7.6.1](http://es5.github.io/#x7.6.1). -If the `strict` flag is truthy, this function additionally checks whether `id` -is a Reserved Word under strict mode. - -#### keyword.isReservedWordES6(id, strict) - -Returns `true` if provided identifier string is a Reserved Word in ECMA262 edition 6. -They are formally defined in ECMA262 section [11.6.2](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-reserved-words). -If the `strict` flag is truthy, this function additionally checks whether `id` -is a Reserved Word under strict mode. - -#### keyword.isRestrictedWord(id) - -Returns `true` if provided identifier string is one of `eval` or `arguments`. -They are restricted in strict mode code throughout ECMA262 edition 5.1 and -in ECMA262 edition 6 section [12.1.1](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-identifiers-static-semantics-early-errors). - -#### keyword.isIdentifierName(id) - -Return true if provided identifier string is an IdentifierName as specified in -ECMA262 edition 5.1 section [7.6](https://es5.github.io/#x7.6). - -#### keyword.isIdentifierES5(id, strict) - -Return true if provided identifier string is an Identifier as specified in -ECMA262 edition 5.1 section [7.6](https://es5.github.io/#x7.6). If the `strict` -flag is truthy, this function additionally checks whether `id` is an Identifier -under strict mode. - -#### keyword.isIdentifierES6(id, strict) - -Return true if provided identifier string is an Identifier as specified in -ECMA262 edition 6 section [12.1](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-identifiers). -If the `strict` flag is truthy, this function additionally checks whether `id` -is an Identifier under strict mode. - -### License - -Copyright (C) 2013 [Yusuke Suzuki](http://github.com/Constellation) - (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/doctrine/node_modules/esutils/lib/ast.js b/node_modules/doctrine/node_modules/esutils/lib/ast.js deleted file mode 100644 index 8faadae1c..000000000 --- a/node_modules/doctrine/node_modules/esutils/lib/ast.js +++ /dev/null @@ -1,144 +0,0 @@ -/* - Copyright (C) 2013 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -(function () { - 'use strict'; - - function isExpression(node) { - if (node == null) { return false; } - switch (node.type) { - case 'ArrayExpression': - case 'AssignmentExpression': - case 'BinaryExpression': - case 'CallExpression': - case 'ConditionalExpression': - case 'FunctionExpression': - case 'Identifier': - case 'Literal': - case 'LogicalExpression': - case 'MemberExpression': - case 'NewExpression': - case 'ObjectExpression': - case 'SequenceExpression': - case 'ThisExpression': - case 'UnaryExpression': - case 'UpdateExpression': - return true; - } - return false; - } - - function isIterationStatement(node) { - if (node == null) { return false; } - switch (node.type) { - case 'DoWhileStatement': - case 'ForInStatement': - case 'ForStatement': - case 'WhileStatement': - return true; - } - return false; - } - - function isStatement(node) { - if (node == null) { return false; } - switch (node.type) { - case 'BlockStatement': - case 'BreakStatement': - case 'ContinueStatement': - case 'DebuggerStatement': - case 'DoWhileStatement': - case 'EmptyStatement': - case 'ExpressionStatement': - case 'ForInStatement': - case 'ForStatement': - case 'IfStatement': - case 'LabeledStatement': - case 'ReturnStatement': - case 'SwitchStatement': - case 'ThrowStatement': - case 'TryStatement': - case 'VariableDeclaration': - case 'WhileStatement': - case 'WithStatement': - return true; - } - return false; - } - - function isSourceElement(node) { - return isStatement(node) || node != null && node.type === 'FunctionDeclaration'; - } - - function trailingStatement(node) { - switch (node.type) { - case 'IfStatement': - if (node.alternate != null) { - return node.alternate; - } - return node.consequent; - - case 'LabeledStatement': - case 'ForStatement': - case 'ForInStatement': - case 'WhileStatement': - case 'WithStatement': - return node.body; - } - return null; - } - - function isProblematicIfStatement(node) { - var current; - - if (node.type !== 'IfStatement') { - return false; - } - if (node.alternate == null) { - return false; - } - current = node.consequent; - do { - if (current.type === 'IfStatement') { - if (current.alternate == null) { - return true; - } - } - current = trailingStatement(current); - } while (current); - - return false; - } - - module.exports = { - isExpression: isExpression, - isStatement: isStatement, - isIterationStatement: isIterationStatement, - isSourceElement: isSourceElement, - isProblematicIfStatement: isProblematicIfStatement, - - trailingStatement: trailingStatement - }; -}()); -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/doctrine/node_modules/esutils/lib/code.js b/node_modules/doctrine/node_modules/esutils/lib/code.js deleted file mode 100644 index 730292a34..000000000 --- a/node_modules/doctrine/node_modules/esutils/lib/code.js +++ /dev/null @@ -1,101 +0,0 @@ -/* - Copyright (C) 2013-2014 Yusuke Suzuki - Copyright (C) 2014 Ivan Nikulin - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -(function () { - 'use strict'; - - var Regex, NON_ASCII_WHITESPACES; - - // See `tools/generate-identifier-regex.js`. - Regex = { - NonAsciiIdentifierStart: new RegExp('[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]'), - NonAsciiIdentifierPart: new RegExp('[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0\u08A2-\u08AC\u08E4-\u08FE\u0900-\u0963\u0966-\u096F\u0971-\u0977\u0979-\u097F\u0981-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0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\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191C\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1D00-\u1DE6\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA697\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7B\uAA80-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE26\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]') - }; - - function isDecimalDigit(ch) { - return (ch >= 48 && ch <= 57); // 0..9 - } - - function isHexDigit(ch) { - return isDecimalDigit(ch) || // 0..9 - (97 <= ch && ch <= 102) || // a..f - (65 <= ch && ch <= 70); // A..F - } - - function isOctalDigit(ch) { - return (ch >= 48 && ch <= 55); // 0..7 - } - - // 7.2 White Space - - NON_ASCII_WHITESPACES = [ - 0x1680, 0x180E, - 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, - 0x202F, 0x205F, - 0x3000, - 0xFEFF - ]; - - function isWhiteSpace(ch) { - return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) || - (ch >= 0x1680 && NON_ASCII_WHITESPACES.indexOf(ch) >= 0); - } - - // 7.3 Line Terminators - - function isLineTerminator(ch) { - return (ch === 0x0A) || (ch === 0x0D) || (ch === 0x2028) || (ch === 0x2029); - } - - // 7.6 Identifier Names and Identifiers - - function isIdentifierStart(ch) { - return (ch >= 97 && ch <= 122) || // a..z - (ch >= 65 && ch <= 90) || // A..Z - (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore) - (ch === 92) || // \ (backslash) - ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch))); - } - - function isIdentifierPart(ch) { - return (ch >= 97 && ch <= 122) || // a..z - (ch >= 65 && ch <= 90) || // A..Z - (ch >= 48 && ch <= 57) || // 0..9 - (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore) - (ch === 92) || // \ (backslash) - ((ch >= 0x80) && Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch))); - } - - module.exports = { - isDecimalDigit: isDecimalDigit, - isHexDigit: isHexDigit, - isOctalDigit: isOctalDigit, - isWhiteSpace: isWhiteSpace, - isLineTerminator: isLineTerminator, - isIdentifierStart: isIdentifierStart, - isIdentifierPart: isIdentifierPart - }; -}()); -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/doctrine/node_modules/esutils/lib/keyword.js b/node_modules/doctrine/node_modules/esutils/lib/keyword.js deleted file mode 100644 index 884be72fb..000000000 --- a/node_modules/doctrine/node_modules/esutils/lib/keyword.js +++ /dev/null @@ -1,137 +0,0 @@ -/* - Copyright (C) 2013 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -(function () { - 'use strict'; - - var code = require('./code'); - - function isStrictModeReservedWordES6(id) { - switch (id) { - case 'implements': - case 'interface': - case 'package': - case 'private': - case 'protected': - case 'public': - case 'static': - case 'let': - return true; - default: - return false; - } - } - - function isKeywordES5(id, strict) { - // yield should not be treated as keyword under non-strict mode. - if (!strict && id === 'yield') { - return false; - } - return isKeywordES6(id, strict); - } - - function isKeywordES6(id, strict) { - if (strict && isStrictModeReservedWordES6(id)) { - return true; - } - - switch (id.length) { - case 2: - return (id === 'if') || (id === 'in') || (id === 'do'); - case 3: - return (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try'); - case 4: - return (id === 'this') || (id === 'else') || (id === 'case') || - (id === 'void') || (id === 'with') || (id === 'enum'); - case 5: - return (id === 'while') || (id === 'break') || (id === 'catch') || - (id === 'throw') || (id === 'const') || (id === 'yield') || - (id === 'class') || (id === 'super'); - case 6: - return (id === 'return') || (id === 'typeof') || (id === 'delete') || - (id === 'switch') || (id === 'export') || (id === 'import'); - case 7: - return (id === 'default') || (id === 'finally') || (id === 'extends'); - case 8: - return (id === 'function') || (id === 'continue') || (id === 'debugger'); - case 10: - return (id === 'instanceof'); - default: - return false; - } - } - - function isReservedWordES5(id, strict) { - return id === 'null' || id === 'true' || id === 'false' || isKeywordES5(id, strict); - } - - function isReservedWordES6(id, strict) { - return id === 'null' || id === 'true' || id === 'false' || isKeywordES6(id, strict); - } - - function isRestrictedWord(id) { - return id === 'eval' || id === 'arguments'; - } - - function isIdentifierName(id) { - var i, iz, ch; - - if (id.length === 0) { - return false; - } - - ch = id.charCodeAt(0); - if (!code.isIdentifierStart(ch) || ch === 92) { // \ (backslash) - return false; - } - - for (i = 1, iz = id.length; i < iz; ++i) { - ch = id.charCodeAt(i); - if (!code.isIdentifierPart(ch) || ch === 92) { // \ (backslash) - return false; - } - } - return true; - } - - function isIdentifierES5(id, strict) { - return isIdentifierName(id) && !isReservedWordES5(id, strict); - } - - function isIdentifierES6(id, strict) { - return isIdentifierName(id) && !isReservedWordES6(id, strict); - } - - module.exports = { - isKeywordES5: isKeywordES5, - isKeywordES6: isKeywordES6, - isReservedWordES5: isReservedWordES5, - isReservedWordES6: isReservedWordES6, - isRestrictedWord: isRestrictedWord, - isIdentifierName: isIdentifierName, - isIdentifierES5: isIdentifierES5, - isIdentifierES6: isIdentifierES6 - }; -}()); -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/doctrine/node_modules/esutils/lib/utils.js b/node_modules/doctrine/node_modules/esutils/lib/utils.js deleted file mode 100644 index ce18faa6b..000000000 --- a/node_modules/doctrine/node_modules/esutils/lib/utils.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - Copyright (C) 2013 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -(function () { - 'use strict'; - - exports.ast = require('./ast'); - exports.code = require('./code'); - exports.keyword = require('./keyword'); -}()); -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/doctrine/node_modules/esutils/package.json b/node_modules/doctrine/node_modules/esutils/package.json deleted file mode 100644 index 70b22072a..000000000 --- a/node_modules/doctrine/node_modules/esutils/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "esutils", - "description": "utility box for ECMAScript language tools", - "homepage": "https://github.com/Constellation/esutils", - "main": "lib/utils.js", - "version": "1.1.6", - "engines": { - "node": ">=0.10.0" - }, - "directories": { - "lib": "./lib" - }, - "files": [ - "LICENSE.BSD", - "README.md", - "lib" - ], - "maintainers": [ - { - "name": "Yusuke Suzuki", - "email": "utatane.tea@gmail.com", - "web": "http://github.com/Constellation" - } - ], - "repository": { - "type": "git", - "url": "http://github.com/Constellation/esutils.git" - }, - "devDependencies": { - "mocha": "~1.12.0", - "chai": "~1.7.2", - "jshint": "2.1.5", - "coffee-script": "~1.6.3", - "unicode-6.3.0": "~0.1.1", - "regenerate": "~0.5.4" - }, - "licenses": [ - { - "type": "BSD", - "url": "http://github.com/Constellation/esutils/raw/master/LICENSE.BSD" - } - ], - "scripts": { - "test": "npm run-script lint && npm run-script unit-test", - "lint": "jshint lib/*.js", - "unit-test": "mocha --compilers coffee:coffee-script -R spec", - "generate-regex": "node tools/generate-identifier-regex.js" - } -} \ No newline at end of file diff --git a/node_modules/doctrine/package.json b/node_modules/doctrine/package.json deleted file mode 100644 index 09b0d3fa7..000000000 --- a/node_modules/doctrine/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "doctrine", - "description": "JSDoc parser", - "homepage": "https://github.com/eslint/doctrine", - "main": "lib/doctrine.js", - "version": "0.7.2", - "engines": { - "node": ">=0.10.0" - }, - "directories": { - "lib": "./lib" - }, - "files": [ - "lib", - "LICENSE.BSD", - "LICENSE.closure-compiler", - "LICENSE.esprima", - "README.md" - ], - "maintainers": [ - { - "name": "Yusuke Suzuki", - "email": "utatane.tea@gmail.com", - "web": "http://github.com/Constellation" - } - ], - "repository": { - "type": "git", - "url": "http://github.com/eslint/doctrine.git" - }, - "devDependencies": { - "coveralls": "^2.11.2", - "dateformat": "^1.0.11", - "eslint": "^1.9.0", - "gulp": "^3.8.10", - "gulp-bump": "^0.1.13", - "gulp-eslint": "^0.5.0", - "gulp-filter": "^2.0.2", - "gulp-git": "^1.0.0", - "gulp-istanbul": "^0.6.0", - "gulp-jshint": "^1.9.0", - "gulp-mocha": "^2.0.0", - "gulp-tag-version": "^1.2.1", - "jshint-stylish": "^1.0.0", - "linefix": "^0.1.1", - "mocha": "^2.3.3", - "npm-license": "^0.3.1", - "semver": "^5.0.3", - "shelljs": "^0.5.3", - "shelljs-nodecli": "^0.1.1", - "should": "^5.0.1" - }, - "licenses": [ - { - "type": "BSD", - "url": "http://github.com/eslint/doctrine/raw/master/LICENSE.BSD" - } - ], - "scripts": { - "test": "gulp", - "unit-test": "gulp test", - "lint": "gulp lint", - "coveralls": "cat ./coverage/lcov.info | coveralls && rm -rf ./coverage" - }, - "dependencies": { - "esutils": "^1.1.6", - "isarray": "0.0.1" - } -} \ No newline at end of file diff --git a/node_modules/enquirer/CHANGELOG.md b/node_modules/enquirer/CHANGELOG.md new file mode 100644 index 000000000..c9ec854a2 --- /dev/null +++ b/node_modules/enquirer/CHANGELOG.md @@ -0,0 +1,135 @@ +# Release history + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +
+ Guiding Principles + +- Changelogs are for humans, not machines. +- There should be an entry for every single version. +- The same types of changes should be grouped. +- Versions and sections should be linkable. +- The latest version comes first. +- The release date of each versions is displayed. +- Mention whether you follow Semantic Versioning. + +
+ +
+ Types of changes + +Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_): + +- `Added` for new features. +- `Changed` for changes in existing functionality. +- `Deprecated` for soon-to-be removed features. +- `Removed` for now removed features. +- `Fixed` for any bug fixes. +- `Security` in case of vulnerabilities. + +
+ +## 2.3.6 - 2020-07-02 + +### Changed + +- Upgraded [ansi-colors](https://github.com/doowb/ansi-colors) dependency to v4, thanks to [@trySound](https://github.com/TrySound), [#297](https://github.com/enquirer/enquirer/pull/297). + +## 2.3.5 - 2020-04-07 + +### Fixed + +- PR #259 fixed typing numbers in the autocomplete prompt, which fixes #112, #199, and #237 +- PR #266 add the `template` property to the `SnippetPromptOptions` TypeScript interface + +## 2.3.4 - 2020-01-13 + +### Added + +- `MultiSelectPrompt` new example for `result` option. + +### Fixed + +- Updated typings to use `EventEmitter` class from `events` directly due to changes in `@types/node`. + + +## 2.3.3 - 2020-01-13 + +### Added + +- `BooleanPrompt` new example for `header` option. + +### Fixed + +- using `await` in `keypress` and returning the `number` result in the `array` type fixes an issue with tests failing only on Travis +- `autocomplete` highlighting issue +- Typos in some documentation and example comments. +- Syntax errors in example code on the README.md. + +## 2.3.2 - 2019-09-17 + +### Added + +- `AuthPrompt` type for creating authentication based prompts. +- `BasicAuth` prompt as an example of creating an authentication prompt using basic username/password authentication +- Examples for different authentication prompts. +- `QuizPrompt` + +### Fixed + +- More examples were updated to fix any known bugs. +- Couple of fixes to the editable and autocomplete prompts. +- Documentation updates to highlight options available to some prompts. + +## 2.3.1 - 2019-07-12 + +### Fixed + +- Several examples were updated to align with latest code changes and to fix small bugs found in the implementation of the example. +- Some bugs found from updating examples were fixed. +- Updates to documentation to provide more information on how to use prompts and the options available. + +## 2.1.0 - 2018-11-29 + +### Fixed + +- Several improvements were made for handling custom `format`, `result` and `initial` functions defined on the options. + +## 2.0.7 - 2018-11-14 + +### Fixed + +- `validate` function now properly accepts `false` as a return value, thanks to [@g-plane](https://github.com/g-plane). + +### Added + +- Adds support for ctrl+n to add choices +- Adds support for `options.required` on all prompts. Uses the built-in `validate()` function, allowing this functionality to be overridden or customized. +- Adds support for `options.scroll` to disable scrolling in array prompts. +- Adds support for `options.onRun`, which is called when `prompt.run()` is called, after the readline instance is created. +- Adds support for `options.history` on the `Input` and `Text` prompts. +- Adds support for `options.term` to set the terminal, thanks to [@tunnckoCore](https://github.com/tunnckoCore). At the moment this is only used in a couple of edge cases with the `Survey` and `Scale` prompts to check if the terminal is Hyper. +- `options.skip` may now be a Boolean, thanks to [@tunnckoCore](https://github.com/tunnckoCore) + +## 2.0.0 - 2018-11-07 + +### Changed + +Enquire 2.0 is a bottom-up complete re-write: + +- Several prompts that were previously published as individual packages will be included in Enquirer itself. +- Why? - As users, we didn't like having to add commonly-used prompts as plugins. Enquirer 2.0 will still support custom prompts as plugins, but many prompts will also be built-in. +- Enquirer will only have a single dependency, https://github.com/doowb/ansi-colors, which itself has no other dependencies). This will make Enquirer easier to maintain and faster for users. +- Methods for registering "questions" have been removed. While it was nice to be able to preregister questions that could be called upon later, this is something that is better left to implementors, as it's relatively trivial to do with custom code. +- `options.default` is now `options.initial` + +### Added + +- Many prompts that were previously separate packages are now bundled into Enquirer itself. + + +[Unreleased]: https://github.com/enquirer/enquirer/compare/2.0.2...HEAD +[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog diff --git a/node_modules/enquirer/LICENSE b/node_modules/enquirer/LICENSE new file mode 100644 index 000000000..681d1bf72 --- /dev/null +++ b/node_modules/enquirer/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016-present, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/enquirer/README.md b/node_modules/enquirer/README.md new file mode 100644 index 000000000..159874228 --- /dev/null +++ b/node_modules/enquirer/README.md @@ -0,0 +1,1752 @@ +

Enquirer

+ +

+ +version + + +travis + + +downloads + +

+ +
+
+ +

+Stylish CLI prompts that are user-friendly, intuitive and easy to create.
+>_ Prompts should be more like conversations than inquisitions▌ +

+ +
+ +

+(Example shows Enquirer's Survey Prompt) +Enquirer Survey Prompt
+The terminal in all examples is Hyper, theme is hyper-monokai-extended.

+See more prompt examples +

+ +
+
+ +Created by [jonschlinkert](https://github.com/jonschlinkert) and [doowb](https://github.com/doowb), Enquirer is fast, easy to use, and lightweight enough for small projects, while also being powerful and customizable enough for the most advanced use cases. + +* **Fast** - [Loads in ~4ms](#-performance) (that's about _3-4 times faster than a [single frame of a HD movie](http://www.endmemo.com/sconvert/framespersecondframespermillisecond.php) at 60fps_) +* **Lightweight** - Only one dependency, the excellent [ansi-colors](https://github.com/doowb/ansi-colors) by [Brian Woodward](https://github.com/doowb). +* **Easy to implement** - Uses promises and async/await and sensible defaults to make prompts easy to create and implement. +* **Easy to use** - Thrill your users with a better experience! Navigating around input and choices is a breeze. You can even create [quizzes](examples/fun/countdown.js), or [record](examples/fun/record.js) and [playback](examples/fun/play.js) key bindings to aid with tutorials and videos. +* **Intuitive** - Keypress combos are available to simplify usage. +* **Flexible** - All prompts can be used standalone or chained together. +* **Stylish** - Easily override semantic styles and symbols for any part of the prompt. +* **Extensible** - Easily create and use custom prompts by extending Enquirer's built-in [prompts](#-prompts). +* **Pluggable** - Add advanced features to Enquirer using plugins. +* **Validation** - Optionally validate user input with any prompt. +* **Well tested** - All prompts are well-tested, and tests are easy to create without having to use brittle, hacky solutions to spy on prompts or "inject" values. +* **Examples** - There are numerous [examples](examples) available to help you get started. + +If you like Enquirer, please consider starring or tweeting about this project to show your support. Thanks! + +
+ +

+>_ Ready to start making prompts your users will love? ▌
+Enquirer Select Prompt with heartbeat example +

+ +
+
+ +## ❯ Getting started + +Get started with Enquirer, the most powerful and easy-to-use Node.js library for creating interactive CLI prompts. + +* [Install](#-install) +* [Usage](#-usage) +* [Enquirer](#-enquirer) +* [Prompts](#-prompts) + - [Built-in Prompts](#-prompts) + - [Custom Prompts](#-custom-prompts) +* [Key Bindings](#-key-bindings) +* [Options](#-options) +* [Release History](#-release-history) +* [Performance](#-performance) +* [About](#-about) + +
+ +## ❯ Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install enquirer --save +``` +Install with [yarn](https://yarnpkg.com/en/): + +```sh +$ yarn add enquirer +``` + +

+Install Enquirer with NPM +

+ +_(Requires Node.js 8.6 or higher. Please let us know if you need support for an earlier version by creating an [issue](../../issues/new).)_ + +
+ +## ❯ Usage + +### Single prompt + +The easiest way to get started with enquirer is to pass a [question object](#prompt-options) to the `prompt` method. + +```js +const { prompt } = require('enquirer'); + +const response = await prompt({ + type: 'input', + name: 'username', + message: 'What is your username?' +}); + +console.log(response); // { username: 'jonschlinkert' } +``` + +_(Examples with `await` need to be run inside an `async` function)_ + +### Multiple prompts + +Pass an array of ["question" objects](#prompt-options) to run a series of prompts. + +```js +const response = await prompt([ + { + type: 'input', + name: 'name', + message: 'What is your name?' + }, + { + type: 'input', + name: 'username', + message: 'What is your username?' + } +]); + +console.log(response); // { name: 'Edward Chan', username: 'edwardmchan' } +``` + +### Different ways to run enquirer + +#### 1. By importing the specific `built-in prompt` + +```js +const { Confirm } = require('enquirer'); + +const prompt = new Confirm({ + name: 'question', + message: 'Did you like enquirer?' +}); + +prompt.run() + .then(answer => console.log('Answer:', answer)); +``` + +#### 2. By passing the options to `prompt` + +```js +const { prompt } = require('enquirer'); + +prompt({ + type: 'confirm', + name: 'question', + message: 'Did you like enquirer?' +}) + .then(answer => console.log('Answer:', answer)); +``` + +**Jump to**: [Getting Started](#-getting-started) · [Prompts](#-prompts) · [Options](#-options) · [Key Bindings](#-key-bindings) + +
+ +## ❯ Enquirer + +**Enquirer is a prompt runner** + +Add Enquirer to your JavaScript project with following line of code. + +```js +const Enquirer = require('enquirer'); +``` + +The main export of this library is the `Enquirer` class, which has methods and features designed to simplify running prompts. + +```js +const { prompt } = require('enquirer'); +const question = [ + { + type: 'input', + name: 'username', + message: 'What is your username?' + }, + { + type: 'password', + name: 'password', + message: 'What is your password?' + } +]; + +let answers = await prompt(question); +console.log(answers); +``` + +**Prompts control how values are rendered and returned** + +Each individual prompt is a class with special features and functionality for rendering the types of values you want to show users in the terminal, and subsequently returning the types of values you need to use in your application. + +**How can I customize prompts?** + +Below in this guide you will find information about creating [custom prompts](#-custom-prompts). For now, we'll focus on how to customize an existing prompt. + +All of the individual [prompt classes](#built-in-prompts) in this library are exposed as static properties on Enquirer. This allows them to be used directly without using `enquirer.prompt()`. + +Use this approach if you need to modify a prompt instance, or listen for events on the prompt. + +**Example** + +```js +const { Input } = require('enquirer'); +const prompt = new Input({ + name: 'username', + message: 'What is your username?' +}); + +prompt.run() + .then(answer => console.log('Username:', answer)) + .catch(console.error); +``` + +### [Enquirer](index.js#L20) + +Create an instance of `Enquirer`. + +**Params** + +* `options` **{Object}**: (optional) Options to use with all prompts. +* `answers` **{Object}**: (optional) Answers object to initialize with. + +**Example** + +```js +const Enquirer = require('enquirer'); +const enquirer = new Enquirer(); +``` + +### [register()](index.js#L42) + +Register a custom prompt type. + +**Params** + +* `type` **{String}** +* `fn` **{Function|Prompt}**: `Prompt` class, or a function that returns a `Prompt` class. +* `returns` **{Object}**: Returns the Enquirer instance + +**Example** + +```js +const Enquirer = require('enquirer'); +const enquirer = new Enquirer(); +enquirer.register('customType', require('./custom-prompt')); +``` + +### [prompt()](index.js#L78) + +Prompt function that takes a "question" object or array of question objects, and returns an object with responses from the user. + +**Params** + +* `questions` **{Array|Object}**: Options objects for one or more prompts to run. +* `returns` **{Promise}**: Promise that returns an "answers" object with the user's responses. + +**Example** + +```js +const Enquirer = require('enquirer'); +const enquirer = new Enquirer(); + +const response = await enquirer.prompt({ + type: 'input', + name: 'username', + message: 'What is your username?' +}); +console.log(response); +``` + +### [use()](index.js#L160) + +Use an enquirer plugin. + +**Params** + +* `plugin` **{Function}**: Plugin function that takes an instance of Enquirer. +* `returns` **{Object}**: Returns the Enquirer instance. + +**Example** + +```js +const Enquirer = require('enquirer'); +const enquirer = new Enquirer(); +const plugin = enquirer => { + // do stuff to enquire instance +}; +enquirer.use(plugin); +``` + +### [Enquirer#prompt](index.js#L210) + +Prompt function that takes a "question" object or array of question objects, and returns an object with responses from the user. + +**Params** + +* `questions` **{Array|Object}**: Options objects for one or more prompts to run. +* `returns` **{Promise}**: Promise that returns an "answers" object with the user's responses. + +**Example** + +```js +const { prompt } = require('enquirer'); +const response = await prompt({ + type: 'input', + name: 'username', + message: 'What is your username?' +}); +console.log(response); +``` + +
+ +## ❯ Prompts + +This section is about Enquirer's prompts: what they look like, how they work, how to run them, available options, and how to customize the prompts or create your own prompt concept. + +**Getting started with Enquirer's prompts** + +* [Prompt](#prompt) - The base `Prompt` class used by other prompts + - [Prompt Options](#prompt-options) +* [Built-in prompts](#built-in-prompts) +* [Prompt Types](#prompt-types) - The base `Prompt` class used by other prompts +* [Custom prompts](#%E2%9D%AF-custom-prompts) - Enquirer 2.0 introduced the concept of prompt "types", with the goal of making custom prompts easier than ever to create and use. + +### Prompt + +The base `Prompt` class is used to create all other prompts. + +```js +const { Prompt } = require('enquirer'); +class MyCustomPrompt extends Prompt {} +``` + +See the documentation for [creating custom prompts](#-custom-prompts) to learn more about how this works. + +#### Prompt Options + +Each prompt takes an options object (aka "question" object), that implements the following interface: + +```js +{ + // required + type: string | function, + name: string | function, + message: string | function | async function, + + // optional + skip: boolean | function | async function, + initial: string | function | async function, + format: function | async function, + result: function | async function, + validate: function | async function, +} +``` +Each property of the options object is described below: + +| **Property** | **Required?** | **Type** | **Description** | +| ------------ | ------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | yes | `string\|function` | Enquirer uses this value to determine the type of prompt to run, but it's optional when prompts are run directly. | +| `name` | yes | `string\|function` | Used as the key for the answer on the returned values (answers) object. | +| `message` | yes | `string\|function` | The message to display when the prompt is rendered in the terminal. | +| `skip` | no | `boolean\|function` | If `true` it will not ask that prompt. | +| `initial` | no | `string\|function` | The default value to return if the user does not supply a value. | +| `format` | no | `function` | Function to format user input in the terminal. | +| `result` | no | `function` | Function to format the final submitted value before it's returned. | +| `validate` | no | `function` | Function to validate the submitted value before it's returned. This function may return a boolean or a string. If a string is returned it will be used as the validation error message. | + +**Example usage** + +```js +const { prompt } = require('enquirer'); + +const question = { + type: 'input', + name: 'username', + message: 'What is your username?' +}; + +prompt(question) + .then(answer => console.log('Answer:', answer)) + .catch(console.error); +``` + +
+ +### Built-in prompts + +* [AutoComplete Prompt](#autocomplete-prompt) +* [BasicAuth Prompt](#basicauth-prompt) +* [Confirm Prompt](#confirm-prompt) +* [Form Prompt](#form-prompt) +* [Input Prompt](#input-prompt) +* [Invisible Prompt](#invisible-prompt) +* [List Prompt](#list-prompt) +* [MultiSelect Prompt](#multiselect-prompt) +* [Numeral Prompt](#numeral-prompt) +* [Password Prompt](#password-prompt) +* [Quiz Prompt](#quiz-prompt) +* [Survey Prompt](#survey-prompt) +* [Scale Prompt](#scale-prompt) +* [Select Prompt](#select-prompt) +* [Sort Prompt](#sort-prompt) +* [Snippet Prompt](#snippet-prompt) +* [Toggle Prompt](#toggle-prompt) + +### AutoComplete Prompt + +Prompt that auto-completes as the user types, and returns the selected value as a string. + +

+Enquirer AutoComplete Prompt +

+ +**Example Usage** + +```js +const { AutoComplete } = require('enquirer'); + +const prompt = new AutoComplete({ + name: 'flavor', + message: 'Pick your favorite flavor', + limit: 10, + initial: 2, + choices: [ + 'Almond', + 'Apple', + 'Banana', + 'Blackberry', + 'Blueberry', + 'Cherry', + 'Chocolate', + 'Cinnamon', + 'Coconut', + 'Cranberry', + 'Grape', + 'Nougat', + 'Orange', + 'Pear', + 'Pineapple', + 'Raspberry', + 'Strawberry', + 'Vanilla', + 'Watermelon', + 'Wintergreen' + ] +}); + +prompt.run() + .then(answer => console.log('Answer:', answer)) + .catch(console.error); +``` + +**AutoComplete Options** + +| Option | Type | Default | Description | +| ----------- | ---------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | +| `highlight` | `function` | `dim` version of primary style | The color to use when "highlighting" characters in the list that match user input. | +| `multiple` | `boolean` | `false` | Allow multiple choices to be selected. | +| `suggest` | `function` | Greedy match, returns true if choice message contains input string. | Function that filters choices. Takes user input and a choices array, and returns a list of matching choices. | +| `initial` | `number` | 0 | Preselected item in the list of choices. | +| `footer` | `function` | None | Function that displays [footer text](https://github.com/enquirer/enquirer/blob/6c2819518a1e2ed284242a99a685655fbaabfa28/examples/autocomplete/option-footer.js#L10) | + +**Related prompts** + +* [Select](#select-prompt) +* [MultiSelect](#multiselect-prompt) +* [Survey](#survey-prompt) + +**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) + +*** + +### BasicAuth Prompt + +Prompt that asks for username and password to authenticate the user. The default implementation of `authenticate` function in `BasicAuth` prompt is to compare the username and password with the values supplied while running the prompt. The implementer is expected to override the `authenticate` function with a custom logic such as making an API request to a server to authenticate the username and password entered and expect a token back. + +

+Enquirer BasicAuth Prompt +

+ +**Example Usage** + +```js +const { BasicAuth } = require('enquirer'); + + const prompt = new BasicAuth({ + name: 'password', + message: 'Please enter your password', + username: 'rajat-sr', + password: '123', + showPassword: true +}); + + prompt + .run() + .then(answer => console.log('Answer:', answer)) + .catch(console.error); +``` + +**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) + +*** + +### Confirm Prompt + +Prompt that returns `true` or `false`. + +

+Enquirer Confirm Prompt +

+ +**Example Usage** + +```js +const { Confirm } = require('enquirer'); + +const prompt = new Confirm({ + name: 'question', + message: 'Want to answer?' +}); + +prompt.run() + .then(answer => console.log('Answer:', answer)) + .catch(console.error); +``` + +**Related prompts** + +* [Input](#input-prompt) +* [Numeral](#numeral-prompt) +* [Password](#password-prompt) + +**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) + +*** + +### Form Prompt + +Prompt that allows the user to enter and submit multiple values on a single terminal screen. + +

+Enquirer Form Prompt +

+ +**Example Usage** + +```js +const { Form } = require('enquirer'); + +const prompt = new Form({ + name: 'user', + message: 'Please provide the following information:', + choices: [ + { name: 'firstname', message: 'First Name', initial: 'Jon' }, + { name: 'lastname', message: 'Last Name', initial: 'Schlinkert' }, + { name: 'username', message: 'GitHub username', initial: 'jonschlinkert' } + ] +}); + +prompt.run() + .then(value => console.log('Answer:', value)) + .catch(console.error); +``` + +**Related prompts** + +* [Input](#input-prompt) +* [Survey](#survey-prompt) + +**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) + +*** + +### Input Prompt + +Prompt that takes user input and returns a string. + +

+Enquirer Input Prompt +

+ +**Example Usage** + +```js +const { Input } = require('enquirer'); +const prompt = new Input({ + message: 'What is your username?', + initial: 'jonschlinkert' +}); + +prompt.run() + .then(answer => console.log('Answer:', answer)) + .catch(console.log); +``` + +You can use [data-store](https://github.com/jonschlinkert/data-store) to store [input history](https://github.com/enquirer/enquirer/blob/master/examples/input/option-history.js) that the user can cycle through (see [source](https://github.com/enquirer/enquirer/blob/8407dc3579123df5e6e20215078e33bb605b0c37/lib/prompts/input.js)). + +**Related prompts** + +* [Confirm](#confirm-prompt) +* [Numeral](#numeral-prompt) +* [Password](#password-prompt) + +**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) + +*** + +### Invisible Prompt + +Prompt that takes user input, hides it from the terminal, and returns a string. + +

+Enquirer Invisible Prompt +

+ +**Example Usage** + +```js +const { Invisible } = require('enquirer'); +const prompt = new Invisible({ + name: 'secret', + message: 'What is your secret?' +}); + +prompt.run() + .then(answer => console.log('Answer:', { secret: answer })) + .catch(console.error); +``` + +**Related prompts** + +* [Password](#password-prompt) +* [Input](#input-prompt) + +**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) + +*** + +### List Prompt + +Prompt that returns a list of values, created by splitting the user input. The default split character is `,` with optional trailing whitespace. + +

+Enquirer List Prompt +

+ +**Example Usage** + +```js +const { List } = require('enquirer'); +const prompt = new List({ + name: 'keywords', + message: 'Type comma-separated keywords' +}); + +prompt.run() + .then(answer => console.log('Answer:', answer)) + .catch(console.error); +``` + +**Related prompts** + +* [Sort](#sort-prompt) +* [Select](#select-prompt) + +**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) + +*** + +### MultiSelect Prompt + +Prompt that allows the user to select multiple items from a list of options. + +

+Enquirer MultiSelect Prompt +

+ +**Example Usage** + +```js +const { MultiSelect } = require('enquirer'); + +const prompt = new MultiSelect({ + name: 'value', + message: 'Pick your favorite colors', + limit: 7, + choices: [ + { name: 'aqua', value: '#00ffff' }, + { name: 'black', value: '#000000' }, + { name: 'blue', value: '#0000ff' }, + { name: 'fuchsia', value: '#ff00ff' }, + { name: 'gray', value: '#808080' }, + { name: 'green', value: '#008000' }, + { name: 'lime', value: '#00ff00' }, + { name: 'maroon', value: '#800000' }, + { name: 'navy', value: '#000080' }, + { name: 'olive', value: '#808000' }, + { name: 'purple', value: '#800080' }, + { name: 'red', value: '#ff0000' }, + { name: 'silver', value: '#c0c0c0' }, + { name: 'teal', value: '#008080' }, + { name: 'white', value: '#ffffff' }, + { name: 'yellow', value: '#ffff00' } + ] +}); + +prompt.run() + .then(answer => console.log('Answer:', answer)) + .catch(console.error); + +// Answer: ['aqua', 'blue', 'fuchsia'] +``` + +**Example key-value pairs** + +Optionally, pass a `result` function and use the `.map` method to return an object of key-value pairs of the selected names and values: [example](./examples/multiselect/option-result.js) + +```js +const { MultiSelect } = require('enquirer'); + +const prompt = new MultiSelect({ + name: 'value', + message: 'Pick your favorite colors', + limit: 7, + choices: [ + { name: 'aqua', value: '#00ffff' }, + { name: 'black', value: '#000000' }, + { name: 'blue', value: '#0000ff' }, + { name: 'fuchsia', value: '#ff00ff' }, + { name: 'gray', value: '#808080' }, + { name: 'green', value: '#008000' }, + { name: 'lime', value: '#00ff00' }, + { name: 'maroon', value: '#800000' }, + { name: 'navy', value: '#000080' }, + { name: 'olive', value: '#808000' }, + { name: 'purple', value: '#800080' }, + { name: 'red', value: '#ff0000' }, + { name: 'silver', value: '#c0c0c0' }, + { name: 'teal', value: '#008080' }, + { name: 'white', value: '#ffffff' }, + { name: 'yellow', value: '#ffff00' } + ], + result(names) { + return this.map(names); + } +}); + +prompt.run() + .then(answer => console.log('Answer:', answer)) + .catch(console.error); + +// Answer: { aqua: '#00ffff', blue: '#0000ff', fuchsia: '#ff00ff' } +``` + +**Related prompts** + +* [AutoComplete](#autocomplete-prompt) +* [Select](#select-prompt) +* [Survey](#survey-prompt) + +**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) + +*** + +### Numeral Prompt + +Prompt that takes a number as input. + +

+Enquirer Numeral Prompt +

+ +**Example Usage** + +```js +const { NumberPrompt } = require('enquirer'); + +const prompt = new NumberPrompt({ + name: 'number', + message: 'Please enter a number' +}); + +prompt.run() + .then(answer => console.log('Answer:', answer)) + .catch(console.error); +``` + +**Related prompts** + +* [Input](#input-prompt) +* [Confirm](#confirm-prompt) + +**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) + +*** + +### Password Prompt + +Prompt that takes user input and masks it in the terminal. Also see the [invisible prompt](#invisible-prompt) + +

+Enquirer Password Prompt +

+ +**Example Usage** + +```js +const { Password } = require('enquirer'); + +const prompt = new Password({ + name: 'password', + message: 'What is your password?' +}); + +prompt.run() + .then(answer => console.log('Answer:', answer)) + .catch(console.error); +``` + +**Related prompts** + +* [Input](#input-prompt) +* [Invisible](#invisible-prompt) + +**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) + +*** + +### Quiz Prompt + +Prompt that allows the user to play multiple-choice quiz questions. + +

+Enquirer Quiz Prompt +

+ +**Example Usage** + +```js +const { Quiz } = require('enquirer'); + + const prompt = new Quiz({ + name: 'countries', + message: 'How many countries are there in the world?', + choices: ['165', '175', '185', '195', '205'], + correctChoice: 3 +}); + + prompt + .run() + .then(answer => { + if (answer.correct) { + console.log('Correct!'); + } else { + console.log(`Wrong! Correct answer is ${answer.correctAnswer}`); + } + }) + .catch(console.error); +``` + +**Quiz Options** + +| Option | Type | Required | Description | +| ----------- | ---------- | ---------- | ------------------------------------------------------------------------------------------------------------ | +| `choices` | `array` | Yes | The list of possible answers to the quiz question. | +| `correctChoice`| `number` | Yes | Index of the correct choice from the `choices` array. | + +**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) + +*** + +### Survey Prompt + +Prompt that allows the user to provide feedback for a list of questions. + +

+Enquirer Survey Prompt +

+ +**Example Usage** + +```js +const { Survey } = require('enquirer'); + +const prompt = new Survey({ + name: 'experience', + message: 'Please rate your experience', + scale: [ + { name: '1', message: 'Strongly Disagree' }, + { name: '2', message: 'Disagree' }, + { name: '3', message: 'Neutral' }, + { name: '4', message: 'Agree' }, + { name: '5', message: 'Strongly Agree' } + ], + margin: [0, 0, 2, 1], + choices: [ + { + name: 'interface', + message: 'The website has a friendly interface.' + }, + { + name: 'navigation', + message: 'The website is easy to navigate.' + }, + { + name: 'images', + message: 'The website usually has good images.' + }, + { + name: 'upload', + message: 'The website makes it easy to upload images.' + }, + { + name: 'colors', + message: 'The website has a pleasing color palette.' + } + ] +}); + +prompt.run() + .then(value => console.log('ANSWERS:', value)) + .catch(console.error); +``` + +**Related prompts** + +* [Scale](#scale-prompt) +* [Snippet](#snippet-prompt) +* [Select](#select-prompt) + +*** + +### Scale Prompt + +A more compact version of the [Survey prompt](#survey-prompt), the Scale prompt allows the user to quickly provide feedback using a [Likert Scale](https://en.wikipedia.org/wiki/Likert_scale). + +

+Enquirer Scale Prompt +

+ +**Example Usage** + +```js +const { Scale } = require('enquirer'); +const prompt = new Scale({ + name: 'experience', + message: 'Please rate your experience', + scale: [ + { name: '1', message: 'Strongly Disagree' }, + { name: '2', message: 'Disagree' }, + { name: '3', message: 'Neutral' }, + { name: '4', message: 'Agree' }, + { name: '5', message: 'Strongly Agree' } + ], + margin: [0, 0, 2, 1], + choices: [ + { + name: 'interface', + message: 'The website has a friendly interface.', + initial: 2 + }, + { + name: 'navigation', + message: 'The website is easy to navigate.', + initial: 2 + }, + { + name: 'images', + message: 'The website usually has good images.', + initial: 2 + }, + { + name: 'upload', + message: 'The website makes it easy to upload images.', + initial: 2 + }, + { + name: 'colors', + message: 'The website has a pleasing color palette.', + initial: 2 + } + ] +}); + +prompt.run() + .then(value => console.log('ANSWERS:', value)) + .catch(console.error); +``` + +**Related prompts** + +* [AutoComplete](#autocomplete-prompt) +* [Select](#select-prompt) +* [Survey](#survey-prompt) + +**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) + +*** + +### Select Prompt + +Prompt that allows the user to select from a list of options. + +

+Enquirer Select Prompt +

+ +**Example Usage** + +```js +const { Select } = require('enquirer'); + +const prompt = new Select({ + name: 'color', + message: 'Pick a flavor', + choices: ['apple', 'grape', 'watermelon', 'cherry', 'orange'] +}); + +prompt.run() + .then(answer => console.log('Answer:', answer)) + .catch(console.error); +``` + +**Related prompts** + +* [AutoComplete](#autocomplete-prompt) +* [MultiSelect](#multiselect-prompt) + +**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) + +*** + +### Sort Prompt + +Prompt that allows the user to sort items in a list. + +**Example** + +In this [example](https://github.com/enquirer/enquirer/raw/master/examples/sort/prompt.js), custom styling is applied to the returned values to make it easier to see what's happening. + +

+Enquirer Sort Prompt +

+ +**Example Usage** + +```js +const colors = require('ansi-colors'); +const { Sort } = require('enquirer'); +const prompt = new Sort({ + name: 'colors', + message: 'Sort the colors in order of preference', + hint: 'Top is best, bottom is worst', + numbered: true, + choices: ['red', 'white', 'green', 'cyan', 'yellow'].map(n => ({ + name: n, + message: colors[n](n) + })) +}); + +prompt.run() + .then(function(answer = []) { + console.log(answer); + console.log('Your preferred order of colors is:'); + console.log(answer.map(key => colors[key](key)).join('\n')); + }) + .catch(console.error); +``` + +**Related prompts** + +* [List](#list-prompt) +* [Select](#select-prompt) + +**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) + +*** + +### Snippet Prompt + +Prompt that allows the user to replace placeholders in a snippet of code or text. + +

+Prompts +

+ +**Example Usage** + +```js +const semver = require('semver'); +const { Snippet } = require('enquirer'); +const prompt = new Snippet({ + name: 'username', + message: 'Fill out the fields in package.json', + required: true, + fields: [ + { + name: 'author_name', + message: 'Author Name' + }, + { + name: 'version', + validate(value, state, item, index) { + if (item && item.name === 'version' && !semver.valid(value)) { + return prompt.styles.danger('version should be a valid semver value'); + } + return true; + } + } + ], + template: `{ + "name": "\${name}", + "description": "\${description}", + "version": "\${version}", + "homepage": "https://github.com/\${username}/\${name}", + "author": "\${author_name} (https://github.com/\${username})", + "repository": "\${username}/\${name}", + "license": "\${license:ISC}" +} +` +}); + +prompt.run() + .then(answer => console.log('Answer:', answer.result)) + .catch(console.error); +``` + +**Related prompts** + +* [Survey](#survey-prompt) +* [AutoComplete](#autocomplete-prompt) + +**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) + +*** + +### Toggle Prompt + +Prompt that allows the user to toggle between two values then returns `true` or `false`. + +

+Enquirer Toggle Prompt +

+ +**Example Usage** + +```js +const { Toggle } = require('enquirer'); + +const prompt = new Toggle({ + message: 'Want to answer?', + enabled: 'Yep', + disabled: 'Nope' +}); + +prompt.run() + .then(answer => console.log('Answer:', answer)) + .catch(console.error); +``` + +**Related prompts** + +* [Confirm](#confirm-prompt) +* [Input](#input-prompt) +* [Sort](#sort-prompt) + +**↑ back to:** [Getting Started](#-getting-started) · [Prompts](#-prompts) + +*** + +### Prompt Types + +There are 5 (soon to be 6!) type classes: + +* [ArrayPrompt](#arrayprompt) + - [Options](#options) + - [Properties](#properties) + - [Methods](#methods) + - [Choices](#choices) + - [Defining choices](#defining-choices) + - [Choice properties](#choice-properties) + - [Related prompts](#related-prompts) +* [AuthPrompt](#authprompt) +* [BooleanPrompt](#booleanprompt) +* DatePrompt (Coming Soon!) +* [NumberPrompt](#numberprompt) +* [StringPrompt](#stringprompt) + +Each type is a low-level class that may be used as a starting point for creating higher level prompts. Continue reading to learn how. + +### ArrayPrompt + +The `ArrayPrompt` class is used for creating prompts that display a list of choices in the terminal. For example, Enquirer uses this class as the basis for the [Select](#select) and [Survey](#survey) prompts. + +#### Options + +In addition to the [options](#options) available to all prompts, Array prompts also support the following options. + +| **Option** | **Required?** | **Type** | **Description** | +| ----------- | ------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `autofocus` | `no` | `string\|number` | The index or name of the choice that should have focus when the prompt loads. Only one choice may have focus at a time. | | +| `stdin` | `no` | `stream` | The input stream to use for emitting keypress events. Defaults to `process.stdin`. | +| `stdout` | `no` | `stream` | The output stream to use for writing the prompt to the terminal. Defaults to `process.stdout`. | +| | + +#### Properties + +Array prompts have the following instance properties and getters. + +| **Property name** | **Type** | **Description** | +| ----------------- | --------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `choices` | `array` | Array of choices that have been normalized from choices passed on the prompt options. | +| `cursor` | `number` | Position of the cursor relative to the _user input (string)_. | +| `enabled` | `array` | Returns an array of enabled choices. | +| `focused` | `array` | Returns the currently selected choice in the visible list of choices. This is similar to the concept of focus in HTML and CSS. Focused choices are always visible (on-screen). When a list of choices is longer than the list of visible choices, and an off-screen choice is _focused_, the list will scroll to the focused choice and re-render. | +| `focused` | Gets the currently selected choice. Equivalent to `prompt.choices[prompt.index]`. | +| `index` | `number` | Position of the pointer in the _visible list (array) of choices_. | +| `limit` | `number` | The number of choices to display on-screen. | +| `selected` | `array` | Either a list of enabled choices (when `options.multiple` is true) or the currently focused choice. | +| `visible` | `string` | | + +#### Methods + +| **Method** | **Description** | +| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `pointer()` | Returns the visual symbol to use to identify the choice that currently has focus. The `❯` symbol is often used for this. The pointer is not always visible, as with the `autocomplete` prompt. | +| `indicator()` | Returns the visual symbol that indicates whether or not a choice is checked/enabled. | +| `focus()` | Sets focus on a choice, if it can be focused. | + +#### Choices + +Array prompts support the `choices` option, which is the array of choices users will be able to select from when rendered in the terminal. + +**Type**: `string|object` + +**Example** + +```js +const { prompt } = require('enquirer'); + +const questions = [{ + type: 'select', + name: 'color', + message: 'Favorite color?', + initial: 1, + choices: [ + { name: 'red', message: 'Red', value: '#ff0000' }, //<= choice object + { name: 'green', message: 'Green', value: '#00ff00' }, //<= choice object + { name: 'blue', message: 'Blue', value: '#0000ff' } //<= choice object + ] +}]; + +let answers = await prompt(questions); +console.log('Answer:', answers.color); +``` + +#### Defining choices + +Whether defined as a string or object, choices are normalized to the following interface: + +```js +{ + name: string; + message: string | undefined; + value: string | undefined; + hint: string | undefined; + disabled: boolean | string | undefined; +} +``` + +**Example** + +```js +const question = { + name: 'fruit', + message: 'Favorite fruit?', + choices: ['Apple', 'Orange', 'Raspberry'] +}; +``` + +Normalizes to the following when the prompt is run: + +```js +const question = { + name: 'fruit', + message: 'Favorite fruit?', + choices: [ + { name: 'Apple', message: 'Apple', value: 'Apple' }, + { name: 'Orange', message: 'Orange', value: 'Orange' }, + { name: 'Raspberry', message: 'Raspberry', value: 'Raspberry' } + ] +}; +``` + +#### Choice properties + +The following properties are supported on `choice` objects. + +| **Option** | **Type** | **Description** | +| ----------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | `string` | The unique key to identify a choice | +| `message` | `string` | The message to display in the terminal. `name` is used when this is undefined. | +| `value` | `string` | Value to associate with the choice. Useful for creating key-value pairs from user choices. `name` is used when this is undefined. | +| `choices` | `array` | Array of "child" choices. | +| `hint` | `string` | Help message to display next to a choice. | +| `role` | `string` | Determines how the choice will be displayed. Currently the only role supported is `separator`. Additional roles may be added in the future (like `heading`, etc). Please create a [feature request] | +| `enabled` | `boolean` | Enabled a choice by default. This is only supported when `options.multiple` is true or on prompts that support multiple choices, like [MultiSelect](#-multiselect). | +| `disabled` | `boolean\|string` | Disable a choice so that it cannot be selected. This value may either be `true`, `false`, or a message to display. | +| `indicator` | `string\|function` | Custom indicator to render for a choice (like a check or radio button). | + +#### Related prompts + +* [AutoComplete](#autocomplete-prompt) +* [Form](#form-prompt) +* [MultiSelect](#multiselect-prompt) +* [Select](#select-prompt) +* [Survey](#survey-prompt) + +*** + +### AuthPrompt + +The `AuthPrompt` is used to create prompts to log in user using any authentication method. For example, Enquirer uses this class as the basis for the [BasicAuth Prompt](#basicauth-prompt). You can also find prompt examples in `examples/auth/` folder that utilizes `AuthPrompt` to create OAuth based authentication prompt or a prompt that authenticates using time-based OTP, among others. + +`AuthPrompt` has a factory function that creates an instance of `AuthPrompt` class and it expects an `authenticate` function, as an argument, which overrides the `authenticate` function of the `AuthPrompt` class. + +#### Methods + +| **Method** | **Description** | +| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `authenticate()` | Contain all the authentication logic. This function should be overridden to implement custom authentication logic. The default `authenticate` function throws an error if no other function is provided. | + +#### Choices + +Auth prompt supports the `choices` option, which is the similar to the choices used in [Form Prompt](#form-prompt). + +**Example** + +```js +const { AuthPrompt } = require('enquirer'); + +function authenticate(value, state) { + if (value.username === this.options.username && value.password === this.options.password) { + return true; + } + return false; +} + +const CustomAuthPrompt = AuthPrompt.create(authenticate); + +const prompt = new CustomAuthPrompt({ + name: 'password', + message: 'Please enter your password', + username: 'rajat-sr', + password: '1234567', + choices: [ + { name: 'username', message: 'username' }, + { name: 'password', message: 'password' } + ] +}); + +prompt + .run() + .then(answer => console.log('Authenticated?', answer)) + .catch(console.error); +``` + +#### Related prompts + +* [BasicAuth Prompt](#basicauth-prompt) + +*** + +### BooleanPrompt + +The `BooleanPrompt` class is used for creating prompts that display and return a boolean value. + +```js +const { BooleanPrompt } = require('enquirer'); + +const prompt = new BooleanPrompt({ + header: '========================', + message: 'Do you love enquirer?', + footer: '========================', +}); + +prompt.run() + .then(answer => console.log('Selected:', answer)) + .catch(console.error); +``` + +**Returns**: `boolean` + +*** + +### NumberPrompt + +The `NumberPrompt` class is used for creating prompts that display and return a numerical value. + +```js +const { NumberPrompt } = require('enquirer'); + +const prompt = new NumberPrompt({ + header: '************************', + message: 'Input the Numbers:', + footer: '************************', +}); + +prompt.run() + .then(answer => console.log('Numbers are:', answer)) + .catch(console.error); +``` + +**Returns**: `string|number` (number, or number formatted as a string) + +*** + +### StringPrompt + +The `StringPrompt` class is used for creating prompts that display and return a string value. + +```js +const { StringPrompt } = require('enquirer'); + +const prompt = new StringPrompt({ + header: '************************', + message: 'Input the String:', + footer: '************************' +}); + +prompt.run() + .then(answer => console.log('String is:', answer)) + .catch(console.error); +``` + +**Returns**: `string` + +
+ +## ❯ Custom prompts + +With Enquirer 2.0, custom prompts are easier than ever to create and use. + +**How do I create a custom prompt?** + +Custom prompts are created by extending either: + +* Enquirer's `Prompt` class +* one of the built-in [prompts](#-prompts), or +* low-level [types](#-types). + + + +```js +const { Prompt } = require('enquirer'); + +class HaiKarate extends Prompt { + constructor(options = {}) { + super(options); + this.value = options.initial || 0; + this.cursorHide(); + } + up() { + this.value++; + this.render(); + } + down() { + this.value--; + this.render(); + } + render() { + this.clear(); // clear previously rendered prompt from the terminal + this.write(`${this.state.message}: ${this.value}`); + } +} + +// Use the prompt by creating an instance of your custom prompt class. +const prompt = new HaiKarate({ + message: 'How many sprays do you want?', + initial: 10 +}); + +prompt.run() + .then(answer => console.log('Sprays:', answer)) + .catch(console.error); +``` + +If you want to be able to specify your prompt by `type` so that it may be used alongside other prompts, you will need to first create an instance of `Enquirer`. + +```js +const Enquirer = require('enquirer'); +const enquirer = new Enquirer(); +``` + +Then use the `.register()` method to add your custom prompt. + +```js +enquirer.register('haikarate', HaiKarate); +``` + +Now you can do the following when defining "questions". + +```js +let spritzer = require('cologne-drone'); +let answers = await enquirer.prompt([ + { + type: 'haikarate', + name: 'cologne', + message: 'How many sprays do you need?', + initial: 10, + async onSubmit(name, value) { + await spritzer.activate(value); //<= activate drone + return value; + } + } +]); +``` + +
+ +## ❯ Key Bindings + +### All prompts + +These key combinations may be used with all prompts. + +| **command** | **description** | +| -------------------------------- | -------------------------------------- | +| ctrl + c | Cancel the prompt. | +| ctrl + g | Reset the prompt to its initial state. | + +
+ +### Move cursor + +These combinations may be used on prompts that support user input (eg. [input prompt](#input-prompt), [password prompt](#password-prompt), and [invisible prompt](#invisible-prompt)). + +| **command** | **description** | +| ------------------------------ | ---------------------------------------- | +| left | Move the cursor back one character. | +| right | Move the cursor forward one character. | +| ctrl + a | Move cursor to the start of the line | +| ctrl + e | Move cursor to the end of the line | +| ctrl + b | Move cursor back one character | +| ctrl + f | Move cursor forward one character | +| ctrl + x | Toggle between first and cursor position | + +
+ +### Edit Input + +These key combinations may be used on prompts that support user input (eg. [input prompt](#input-prompt), [password prompt](#password-prompt), and [invisible prompt](#invisible-prompt)). + +| **command** | **description** | +| ------------------------------ | ---------------------------------------- | +| ctrl + a | Move cursor to the start of the line | +| ctrl + e | Move cursor to the end of the line | +| ctrl + b | Move cursor back one character | +| ctrl + f | Move cursor forward one character | +| ctrl + x | Toggle between first and cursor position | + +
+ +| **command (Mac)** | **command (Windows)** | **description** | +| ----------------------------------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| delete | backspace | Delete one character to the left. | +| fn + delete | delete | Delete one character to the right. | +| option + up | alt + up | Scroll to the previous item in history ([Input prompt](#input-prompt) only, when [history is enabled](examples/input/option-history.js)). | +| option + down | alt + down | Scroll to the next item in history ([Input prompt](#input-prompt) only, when [history is enabled](examples/input/option-history.js)). | + +### Select choices + +These key combinations may be used on prompts that support _multiple_ choices, such as the [multiselect prompt](#multiselect-prompt), or the [select prompt](#select-prompt) when the `multiple` options is true. + +| **command** | **description** | +| ----------------- | -------------------------------------------------------------------------------------------------------------------- | +| space | Toggle the currently selected choice when `options.multiple` is true. | +| number | Move the pointer to the choice at the given index. Also toggles the selected choice when `options.multiple` is true. | +| a | Toggle all choices to be enabled or disabled. | +| i | Invert the current selection of choices. | +| g | Toggle the current choice group. | + +
+ +### Hide/show choices + +| **command** | **description** | +| ------------------------------- | ---------------------------------------------- | +| fn + up | Decrease the number of visible choices by one. | +| fn + down | Increase the number of visible choices by one. | + +
+ +### Move/lock Pointer + +| **command** | **description** | +| ---------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| number | Move the pointer to the choice at the given index. Also toggles the selected choice when `options.multiple` is true. | +| up | Move the pointer up. | +| down | Move the pointer down. | +| ctrl + a | Move the pointer to the first _visible_ choice. | +| ctrl + e | Move the pointer to the last _visible_ choice. | +| shift + up | Scroll up one choice without changing pointer position (locks the pointer while scrolling). | +| shift + down | Scroll down one choice without changing pointer position (locks the pointer while scrolling). | + +
+ +| **command (Mac)** | **command (Windows)** | **description** | +| -------------------------------- | --------------------- | ---------------------------------------------------------- | +| fn + left | home | Move the pointer to the first choice in the choices array. | +| fn + right | end | Move the pointer to the last choice in the choices array. | + +
+ +## ❯ Release History + +Please see [CHANGELOG.md](CHANGELOG.md). + +## ❯ Performance + +### System specs + +MacBook Pro, Intel Core i7, 2.5 GHz, 16 GB. + +### Load time + +Time it takes for the module to load the first time (average of 3 runs): + +``` +enquirer: 4.013ms +inquirer: 286.717ms +``` + +
+ +## ❯ About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Todo + +We're currently working on documentation for the following items. Please star and watch the repository for updates! + +* [ ] Customizing symbols +* [ ] Customizing styles (palette) +* [ ] Customizing rendered input +* [ ] Customizing returned values +* [ ] Customizing key bindings +* [ ] Question validation +* [ ] Choice validation +* [ ] Skipping questions +* [ ] Async choices +* [ ] Async timers: loaders, spinners and other animations +* [ ] Links to examples +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` +```sh +$ yarn && yarn test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +#### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 283 | [jonschlinkert](https://github.com/jonschlinkert) | +| 82 | [doowb](https://github.com/doowb) | +| 32 | [rajat-sr](https://github.com/rajat-sr) | +| 20 | [318097](https://github.com/318097) | +| 15 | [g-plane](https://github.com/g-plane) | +| 12 | [pixelass](https://github.com/pixelass) | +| 5 | [adityavyas611](https://github.com/adityavyas611) | +| 5 | [satotake](https://github.com/satotake) | +| 3 | [tunnckoCore](https://github.com/tunnckoCore) | +| 3 | [Ovyerus](https://github.com/Ovyerus) | +| 3 | [sw-yx](https://github.com/sw-yx) | +| 2 | [DanielRuf](https://github.com/DanielRuf) | +| 2 | [GabeL7r](https://github.com/GabeL7r) | +| 1 | [AlCalzone](https://github.com/AlCalzone) | +| 1 | [hipstersmoothie](https://github.com/hipstersmoothie) | +| 1 | [danieldelcore](https://github.com/danieldelcore) | +| 1 | [ImgBotApp](https://github.com/ImgBotApp) | +| 1 | [jsonkao](https://github.com/jsonkao) | +| 1 | [knpwrs](https://github.com/knpwrs) | +| 1 | [yeskunall](https://github.com/yeskunall) | +| 1 | [mischah](https://github.com/mischah) | +| 1 | [renarsvilnis](https://github.com/renarsvilnis) | +| 1 | [sbugert](https://github.com/sbugert) | +| 1 | [stephencweiss](https://github.com/stephencweiss) | +| 1 | [skellock](https://github.com/skellock) | +| 1 | [whxaxes](https://github.com/whxaxes) | + +#### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +#### Credit + +Thanks to [derhuerst](https://github.com/derhuerst), creator of prompt libraries such as [prompt-skeleton](https://github.com/derhuerst/prompt-skeleton), which influenced some of the concepts we used in our prompts. + +#### License + +Copyright © 2018-present, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). \ No newline at end of file diff --git a/node_modules/enquirer/index.d.ts b/node_modules/enquirer/index.d.ts new file mode 100644 index 000000000..bcc7752a4 --- /dev/null +++ b/node_modules/enquirer/index.d.ts @@ -0,0 +1,151 @@ +import { EventEmitter } from "events"; + +interface BasePromptOptions { + name: string | (() => string) + type: string | (() => string) + message: string | (() => string) | (() => Promise) + initial?: any + required?: boolean + format?(value: string): string | Promise + result?(value: string): string | Promise + skip?: ((state: object) => boolean | Promise) | boolean + validate?(value: string): boolean | Promise | string | Promise + onSubmit?(name: string, value: any, prompt: Enquirer.Prompt): boolean | Promise + onCancel?(name: string, value: any, prompt: Enquirer.Prompt): boolean | Promise + stdin?: NodeJS.ReadStream + stdout?: NodeJS.WriteStream +} + +interface Choice { + name: string + message?: string + value?: string + hint?: string + disabled?: boolean | string +} + +interface ArrayPromptOptions extends BasePromptOptions { + type: + | 'autocomplete' + | 'editable' + | 'form' + | 'multiselect' + | 'select' + | 'survey' + | 'list' + | 'scale' + choices: string[] | Choice[] + maxChoices?: number + muliple?: boolean + initial?: number + delay?: number + separator?: boolean + sort?: boolean + linebreak?: boolean + edgeLength?: number + align?: 'left' | 'right' + scroll?: boolean +} + +interface BooleanPromptOptions extends BasePromptOptions { + type: 'confirm' + initial?: boolean +} + +interface StringPromptOptions extends BasePromptOptions { + type: 'input' | 'invisible' | 'list' | 'password' | 'text' + initial?: string + multiline?: boolean +} + +interface NumberPromptOptions extends BasePromptOptions { + type: 'numeral' + min?: number + max?: number + delay?: number + float?: boolean + round?: boolean + major?: number + minor?: number + initial?: number +} + +interface SnippetPromptOptions extends BasePromptOptions { + type: 'snippet' + newline?: string + template?: string +} + +interface SortPromptOptions extends BasePromptOptions { + type: 'sort' + hint?: string + drag?: boolean + numbered?: boolean +} + +type PromptOptions = + | BasePromptOptions + | ArrayPromptOptions + | BooleanPromptOptions + | StringPromptOptions + | NumberPromptOptions + | SnippetPromptOptions + | SortPromptOptions + +declare class BasePrompt extends EventEmitter { + constructor(options?: PromptOptions); + + render(): void; + + run(): Promise; + } + +declare class Enquirer extends EventEmitter { + constructor(options?: object, answers?: T); + + /** + * Register a custom prompt type. + * + * @param type + * @param fn `Prompt` class, or a function that returns a `Prompt` class. + */ + register(type: string, fn: typeof BasePrompt | (() => typeof BasePrompt)): this; + + /** + * Register a custom prompt type. + */ + register(type: { [key: string]: typeof BasePrompt | (() => typeof BasePrompt) }): this; + + /** + * Prompt function that takes a "question" object or array of question objects, + * and returns an object with responses from the user. + * + * @param questions Options objects for one or more prompts to run. + */ + prompt( + questions: + | PromptOptions + | ((this: Enquirer) => PromptOptions) + | (PromptOptions | ((this: Enquirer) => PromptOptions))[] + ): Promise; + + /** + * Use an enquirer plugin. + * + * @param plugin Plugin function that takes an instance of Enquirer. + */ + use(plugin: (this: this, enquirer: this) => void): this; +} + +declare namespace Enquirer { + function prompt( + questions: + | PromptOptions + | ((this: Enquirer) => PromptOptions) + | (PromptOptions | ((this: Enquirer) => PromptOptions))[] + ): Promise; + + class Prompt extends BasePrompt {} +} + +export = Enquirer; diff --git a/node_modules/enquirer/index.js b/node_modules/enquirer/index.js new file mode 100644 index 000000000..d0ef3f69b --- /dev/null +++ b/node_modules/enquirer/index.js @@ -0,0 +1,250 @@ +'use strict'; + +const assert = require('assert'); +const Events = require('events'); +const utils = require('./lib/utils'); + +/** + * Create an instance of `Enquirer`. + * + * ```js + * const Enquirer = require('enquirer'); + * const enquirer = new Enquirer(); + * ``` + * @name Enquirer + * @param {Object} `options` (optional) Options to use with all prompts. + * @param {Object} `answers` (optional) Answers object to initialize with. + * @api public + */ + +class Enquirer extends Events { + constructor(options, answers) { + super(); + this.options = utils.merge({}, options); + this.answers = { ...answers }; + } + + /** + * Register a custom prompt type. + * + * ```js + * const Enquirer = require('enquirer'); + * const enquirer = new Enquirer(); + * enquirer.register('customType', require('./custom-prompt')); + * ``` + * @name register() + * @param {String} `type` + * @param {Function|Prompt} `fn` `Prompt` class, or a function that returns a `Prompt` class. + * @return {Object} Returns the Enquirer instance + * @api public + */ + + register(type, fn) { + if (utils.isObject(type)) { + for (let key of Object.keys(type)) this.register(key, type[key]); + return this; + } + assert.equal(typeof fn, 'function', 'expected a function'); + let name = type.toLowerCase(); + if (fn.prototype instanceof this.Prompt) { + this.prompts[name] = fn; + } else { + this.prompts[name] = fn(this.Prompt, this); + } + return this; + } + + /** + * Prompt function that takes a "question" object or array of question objects, + * and returns an object with responses from the user. + * + * ```js + * const Enquirer = require('enquirer'); + * const enquirer = new Enquirer(); + * + * const response = await enquirer.prompt({ + * type: 'input', + * name: 'username', + * message: 'What is your username?' + * }); + * console.log(response); + * ``` + * @name prompt() + * @param {Array|Object} `questions` Options objects for one or more prompts to run. + * @return {Promise} Promise that returns an "answers" object with the user's responses. + * @api public + */ + + async prompt(questions = []) { + for (let question of [].concat(questions)) { + try { + if (typeof question === 'function') question = await question.call(this); + await this.ask(utils.merge({}, this.options, question)); + } catch (err) { + return Promise.reject(err); + } + } + return this.answers; + } + + async ask(question) { + if (typeof question === 'function') { + question = await question.call(this); + } + + let opts = utils.merge({}, this.options, question); + let { type, name } = question; + let { set, get } = utils; + + if (typeof type === 'function') { + type = await type.call(this, question, this.answers); + } + + if (!type) return this.answers[name]; + + assert(this.prompts[type], `Prompt "${type}" is not registered`); + + let prompt = new this.prompts[type](opts); + let value = get(this.answers, name); + + prompt.state.answers = this.answers; + prompt.enquirer = this; + + if (name) { + prompt.on('submit', value => { + this.emit('answer', name, value, prompt); + set(this.answers, name, value); + }); + } + + // bubble events + let emit = prompt.emit.bind(prompt); + prompt.emit = (...args) => { + this.emit.call(this, ...args); + return emit(...args); + }; + + this.emit('prompt', prompt, this); + + if (opts.autofill && value != null) { + prompt.value = prompt.input = value; + + // if "autofill=show" render the prompt, otherwise stay "silent" + if (opts.autofill === 'show') { + await prompt.submit(); + } + } else { + value = prompt.value = await prompt.run(); + } + + return value; + } + + /** + * Use an enquirer plugin. + * + * ```js + * const Enquirer = require('enquirer'); + * const enquirer = new Enquirer(); + * const plugin = enquirer => { + * // do stuff to enquire instance + * }; + * enquirer.use(plugin); + * ``` + * @name use() + * @param {Function} `plugin` Plugin function that takes an instance of Enquirer. + * @return {Object} Returns the Enquirer instance. + * @api public + */ + + use(plugin) { + plugin.call(this, this); + return this; + } + + set Prompt(value) { + this._Prompt = value; + } + get Prompt() { + return this._Prompt || this.constructor.Prompt; + } + + get prompts() { + return this.constructor.prompts; + } + + static set Prompt(value) { + this._Prompt = value; + } + static get Prompt() { + return this._Prompt || require('./lib/prompt'); + } + + static get prompts() { + return require('./lib/prompts'); + } + + static get types() { + return require('./lib/types'); + } + + /** + * Prompt function that takes a "question" object or array of question objects, + * and returns an object with responses from the user. + * + * ```js + * const { prompt } = require('enquirer'); + * const response = await prompt({ + * type: 'input', + * name: 'username', + * message: 'What is your username?' + * }); + * console.log(response); + * ``` + * @name Enquirer#prompt + * @param {Array|Object} `questions` Options objects for one or more prompts to run. + * @return {Promise} Promise that returns an "answers" object with the user's responses. + * @api public + */ + + static get prompt() { + const fn = (questions, ...rest) => { + let enquirer = new this(...rest); + let emit = enquirer.emit.bind(enquirer); + enquirer.emit = (...args) => { + fn.emit(...args); + return emit(...args); + }; + return enquirer.prompt(questions); + }; + utils.mixinEmitter(fn, new Events()); + return fn; + } +} + +utils.mixinEmitter(Enquirer, new Events()); +const prompts = Enquirer.prompts; + +for (let name of Object.keys(prompts)) { + let key = name.toLowerCase(); + + let run = options => new prompts[name](options).run(); + Enquirer.prompt[key] = run; + Enquirer[key] = run; + + if (!Enquirer[name]) { + Reflect.defineProperty(Enquirer, name, { get: () => prompts[name] }); + } +} + +const exp = name => { + utils.defineExport(Enquirer, name, () => Enquirer.types[name]); +}; + +exp('ArrayPrompt'); +exp('AuthPrompt'); +exp('BooleanPrompt'); +exp('NumberPrompt'); +exp('StringPrompt'); + +module.exports = Enquirer; diff --git a/node_modules/enquirer/lib/ansi.js b/node_modules/enquirer/lib/ansi.js new file mode 100644 index 000000000..1ba19813d --- /dev/null +++ b/node_modules/enquirer/lib/ansi.js @@ -0,0 +1,116 @@ +'use strict'; + +const isTerm = process.env.TERM_PROGRAM === 'Apple_Terminal'; +const colors = require('ansi-colors'); +const utils = require('./utils'); +const ansi = module.exports = exports; +const ESC = '\u001b['; +const BEL = '\u0007'; +let hidden = false; + +const code = ansi.code = { + bell: BEL, + beep: BEL, + beginning: `${ESC}G`, + down: `${ESC}J`, + esc: ESC, + getPosition: `${ESC}6n`, + hide: `${ESC}?25l`, + line: `${ESC}2K`, + lineEnd: `${ESC}K`, + lineStart: `${ESC}1K`, + restorePosition: ESC + (isTerm ? '8' : 'u'), + savePosition: ESC + (isTerm ? '7' : 's'), + screen: `${ESC}2J`, + show: `${ESC}?25h`, + up: `${ESC}1J` +}; + +const cursor = ansi.cursor = { + get hidden() { + return hidden; + }, + + hide() { + hidden = true; + return code.hide; + }, + show() { + hidden = false; + return code.show; + }, + + forward: (count = 1) => `${ESC}${count}C`, + backward: (count = 1) => `${ESC}${count}D`, + nextLine: (count = 1) => `${ESC}E`.repeat(count), + prevLine: (count = 1) => `${ESC}F`.repeat(count), + + up: (count = 1) => count ? `${ESC}${count}A` : '', + down: (count = 1) => count ? `${ESC}${count}B` : '', + right: (count = 1) => count ? `${ESC}${count}C` : '', + left: (count = 1) => count ? `${ESC}${count}D` : '', + + to(x, y) { + return y ? `${ESC}${y + 1};${x + 1}H` : `${ESC}${x + 1}G`; + }, + + move(x = 0, y = 0) { + let res = ''; + res += (x < 0) ? cursor.left(-x) : (x > 0) ? cursor.right(x) : ''; + res += (y < 0) ? cursor.up(-y) : (y > 0) ? cursor.down(y) : ''; + return res; + }, + + restore(state = {}) { + let { after, cursor, initial, input, prompt, size, value } = state; + initial = utils.isPrimitive(initial) ? String(initial) : ''; + input = utils.isPrimitive(input) ? String(input) : ''; + value = utils.isPrimitive(value) ? String(value) : ''; + + if (size) { + let codes = ansi.cursor.up(size) + ansi.cursor.to(prompt.length); + let diff = input.length - cursor; + if (diff > 0) { + codes += ansi.cursor.left(diff); + } + return codes; + } + + if (value || after) { + let pos = (!input && !!initial) ? -initial.length : -input.length + cursor; + if (after) pos -= after.length; + if (input === '' && initial && !prompt.includes(initial)) { + pos += initial.length; + } + return ansi.cursor.move(pos); + } + } +}; + +const erase = ansi.erase = { + screen: code.screen, + up: code.up, + down: code.down, + line: code.line, + lineEnd: code.lineEnd, + lineStart: code.lineStart, + lines(n) { + let str = ''; + for (let i = 0; i < n; i++) { + str += ansi.erase.line + (i < n - 1 ? ansi.cursor.up(1) : ''); + } + if (n) str += ansi.code.beginning; + return str; + } +}; + +ansi.clear = (input = '', columns = process.stdout.columns) => { + if (!columns) return erase.line + cursor.to(0); + let width = str => [...colors.unstyle(str)].length; + let lines = input.split(/\r?\n/); + let rows = 0; + for (let line of lines) { + rows += 1 + Math.floor(Math.max(width(line) - 1, 0) / columns); + } + return (erase.line + cursor.prevLine()).repeat(rows - 1) + erase.line + cursor.to(0); +}; diff --git a/node_modules/enquirer/lib/combos.js b/node_modules/enquirer/lib/combos.js new file mode 100644 index 000000000..5b9d86c55 --- /dev/null +++ b/node_modules/enquirer/lib/combos.js @@ -0,0 +1,75 @@ +'use strict'; + +/** + * Actions are mappings from keypress event names to method names + * in the prompts. + */ + +exports.ctrl = { + a: 'first', + b: 'backward', + c: 'cancel', + d: 'deleteForward', + e: 'last', + f: 'forward', + g: 'reset', + i: 'tab', + k: 'cutForward', + l: 'reset', + n: 'newItem', + m: 'cancel', + j: 'submit', + p: 'search', + r: 'remove', + s: 'save', + u: 'undo', + w: 'cutLeft', + x: 'toggleCursor', + v: 'paste' +}; + +exports.shift = { + up: 'shiftUp', + down: 'shiftDown', + left: 'shiftLeft', + right: 'shiftRight', + tab: 'prev' +}; + +exports.fn = { + up: 'pageUp', + down: 'pageDown', + left: 'pageLeft', + right: 'pageRight', + delete: 'deleteForward' +}; + +// on Windows +exports.option = { + b: 'backward', + f: 'forward', + d: 'cutRight', + left: 'cutLeft', + up: 'altUp', + down: 'altDown' +}; + +exports.keys = { + pageup: 'pageUp', // + (mac), (windows) + pagedown: 'pageDown', // + (mac), (windows) + home: 'home', // + (mac), (windows) + end: 'end', // + (mac), (windows) + cancel: 'cancel', + delete: 'deleteForward', + backspace: 'delete', + down: 'down', + enter: 'submit', + escape: 'cancel', + left: 'left', + space: 'space', + number: 'number', + return: 'submit', + right: 'right', + tab: 'next', + up: 'up' +}; diff --git a/node_modules/enquirer/lib/completer.js b/node_modules/enquirer/lib/completer.js new file mode 100644 index 000000000..4a50af0a1 --- /dev/null +++ b/node_modules/enquirer/lib/completer.js @@ -0,0 +1,52 @@ +'use strict'; + +const unique = arr => arr.filter((v, i) => arr.lastIndexOf(v) === i); +const compact = arr => unique(arr).filter(Boolean); + +module.exports = (action, data = {}, value = '') => { + let { past = [], present = '' } = data; + let rest, prev; + + switch (action) { + case 'prev': + case 'undo': + rest = past.slice(0, past.length - 1); + prev = past[past.length - 1] || ''; + return { + past: compact([value, ...rest]), + present: prev + }; + + case 'next': + case 'redo': + rest = past.slice(1); + prev = past[0] || ''; + return { + past: compact([...rest, value]), + present: prev + }; + + case 'save': + return { + past: compact([...past, value]), + present: '' + }; + + case 'remove': + prev = compact(past.filter(v => v !== value)); + present = ''; + + if (prev.length) { + present = prev.pop(); + } + + return { + past: prev, + present + }; + + default: { + throw new Error(`Invalid action: "${action}"`); + } + } +}; diff --git a/node_modules/enquirer/lib/interpolate.js b/node_modules/enquirer/lib/interpolate.js new file mode 100644 index 000000000..c3d9b3f3f --- /dev/null +++ b/node_modules/enquirer/lib/interpolate.js @@ -0,0 +1,266 @@ +'use strict'; + +const colors = require('ansi-colors'); +const clean = (str = '') => { + return typeof str === 'string' ? str.replace(/^['"]|['"]$/g, '') : ''; +}; + +/** + * This file contains the interpolation and rendering logic for + * the Snippet prompt. + */ + +class Item { + constructor(token) { + this.name = token.key; + this.field = token.field || {}; + this.value = clean(token.initial || this.field.initial || ''); + this.message = token.message || this.name; + this.cursor = 0; + this.input = ''; + this.lines = []; + } +} + +const tokenize = async(options = {}, defaults = {}, fn = token => token) => { + let unique = new Set(); + let fields = options.fields || []; + let input = options.template; + let tabstops = []; + let items = []; + let keys = []; + let line = 1; + + if (typeof input === 'function') { + input = await input(); + } + + let i = -1; + let next = () => input[++i]; + let peek = () => input[i + 1]; + let push = token => { + token.line = line; + tabstops.push(token); + }; + + push({ type: 'bos', value: '' }); + + while (i < input.length - 1) { + let value = next(); + + if (/^[^\S\n ]$/.test(value)) { + push({ type: 'text', value }); + continue; + } + + if (value === '\n') { + push({ type: 'newline', value }); + line++; + continue; + } + + if (value === '\\') { + value += next(); + push({ type: 'text', value }); + continue; + } + + if ((value === '$' || value === '#' || value === '{') && peek() === '{') { + let n = next(); + value += n; + + let token = { type: 'template', open: value, inner: '', close: '', value }; + let ch; + + while ((ch = next())) { + if (ch === '}') { + if (peek() === '}') ch += next(); + token.value += ch; + token.close = ch; + break; + } + + if (ch === ':') { + token.initial = ''; + token.key = token.inner; + } else if (token.initial !== void 0) { + token.initial += ch; + } + + token.value += ch; + token.inner += ch; + } + + token.template = token.open + (token.initial || token.inner) + token.close; + token.key = token.key || token.inner; + + if (defaults.hasOwnProperty(token.key)) { + token.initial = defaults[token.key]; + } + + token = fn(token); + push(token); + + keys.push(token.key); + unique.add(token.key); + + let item = items.find(item => item.name === token.key); + token.field = fields.find(ch => ch.name === token.key); + + if (!item) { + item = new Item(token); + items.push(item); + } + + item.lines.push(token.line - 1); + continue; + } + + let last = tabstops[tabstops.length - 1]; + if (last.type === 'text' && last.line === line) { + last.value += value; + } else { + push({ type: 'text', value }); + } + } + + push({ type: 'eos', value: '' }); + return { input, tabstops, unique, keys, items }; +}; + +module.exports = async prompt => { + let options = prompt.options; + let required = new Set(options.required === true ? [] : (options.required || [])); + let defaults = { ...options.values, ...options.initial }; + let { tabstops, items, keys } = await tokenize(options, defaults); + + let result = createFn('result', prompt, options); + let format = createFn('format', prompt, options); + let isValid = createFn('validate', prompt, options, true); + let isVal = prompt.isValue.bind(prompt); + + return async(state = {}, submitted = false) => { + let index = 0; + + state.required = required; + state.items = items; + state.keys = keys; + state.output = ''; + + let validate = async(value, state, item, index) => { + let error = await isValid(value, state, item, index); + if (error === false) { + return 'Invalid field ' + item.name; + } + return error; + }; + + for (let token of tabstops) { + let value = token.value; + let key = token.key; + + if (token.type !== 'template') { + if (value) state.output += value; + continue; + } + + if (token.type === 'template') { + let item = items.find(ch => ch.name === key); + + if (options.required === true) { + state.required.add(item.name); + } + + let val = [item.input, state.values[item.value], item.value, value].find(isVal); + let field = item.field || {}; + let message = field.message || token.inner; + + if (submitted) { + let error = await validate(state.values[key], state, item, index); + if ((error && typeof error === 'string') || error === false) { + state.invalid.set(key, error); + continue; + } + + state.invalid.delete(key); + let res = await result(state.values[key], state, item, index); + state.output += colors.unstyle(res); + continue; + } + + item.placeholder = false; + + let before = value; + value = await format(value, state, item, index); + + if (val !== value) { + state.values[key] = val; + value = prompt.styles.typing(val); + state.missing.delete(message); + + } else { + state.values[key] = void 0; + val = `<${message}>`; + value = prompt.styles.primary(val); + item.placeholder = true; + + if (state.required.has(key)) { + state.missing.add(message); + } + } + + if (state.missing.has(message) && state.validating) { + value = prompt.styles.warning(val); + } + + if (state.invalid.has(key) && state.validating) { + value = prompt.styles.danger(val); + } + + if (index === state.index) { + if (before !== value) { + value = prompt.styles.underline(value); + } else { + value = prompt.styles.heading(colors.unstyle(value)); + } + } + + index++; + } + + if (value) { + state.output += value; + } + } + + let lines = state.output.split('\n').map(l => ' ' + l); + let len = items.length; + let done = 0; + + for (let item of items) { + if (state.invalid.has(item.name)) { + item.lines.forEach(i => { + if (lines[i][0] !== ' ') return; + lines[i] = state.styles.danger(state.symbols.bullet) + lines[i].slice(1); + }); + } + + if (prompt.isValue(state.values[item.name])) { + done++; + } + } + + state.completed = ((done / len) * 100).toFixed(0); + state.output = lines.join('\n'); + return state.output; + }; +}; + +function createFn(prop, prompt, options, fallback) { + return (value, state, item, index) => { + if (typeof item.field[prop] === 'function') { + return item.field[prop].call(prompt, value, state, item, index); + } + return [fallback, value].find(v => prompt.isValue(v)); + }; +} diff --git a/node_modules/enquirer/lib/keypress.js b/node_modules/enquirer/lib/keypress.js new file mode 100644 index 000000000..15d731497 --- /dev/null +++ b/node_modules/enquirer/lib/keypress.js @@ -0,0 +1,243 @@ +'use strict'; + +const readline = require('readline'); +const combos = require('./combos'); + +/* eslint-disable no-control-regex */ +const metaKeyCodeRe = /^(?:\x1b)([a-zA-Z0-9])$/; +const fnKeyRe = /^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/; +const keyName = { + /* xterm/gnome ESC O letter */ + 'OP': 'f1', + 'OQ': 'f2', + 'OR': 'f3', + 'OS': 'f4', + /* xterm/rxvt ESC [ number ~ */ + '[11~': 'f1', + '[12~': 'f2', + '[13~': 'f3', + '[14~': 'f4', + /* from Cygwin and used in libuv */ + '[[A': 'f1', + '[[B': 'f2', + '[[C': 'f3', + '[[D': 'f4', + '[[E': 'f5', + /* common */ + '[15~': 'f5', + '[17~': 'f6', + '[18~': 'f7', + '[19~': 'f8', + '[20~': 'f9', + '[21~': 'f10', + '[23~': 'f11', + '[24~': 'f12', + /* xterm ESC [ letter */ + '[A': 'up', + '[B': 'down', + '[C': 'right', + '[D': 'left', + '[E': 'clear', + '[F': 'end', + '[H': 'home', + /* xterm/gnome ESC O letter */ + 'OA': 'up', + 'OB': 'down', + 'OC': 'right', + 'OD': 'left', + 'OE': 'clear', + 'OF': 'end', + 'OH': 'home', + /* xterm/rxvt ESC [ number ~ */ + '[1~': 'home', + '[2~': 'insert', + '[3~': 'delete', + '[4~': 'end', + '[5~': 'pageup', + '[6~': 'pagedown', + /* putty */ + '[[5~': 'pageup', + '[[6~': 'pagedown', + /* rxvt */ + '[7~': 'home', + '[8~': 'end', + /* rxvt keys with modifiers */ + '[a': 'up', + '[b': 'down', + '[c': 'right', + '[d': 'left', + '[e': 'clear', + + '[2$': 'insert', + '[3$': 'delete', + '[5$': 'pageup', + '[6$': 'pagedown', + '[7$': 'home', + '[8$': 'end', + + 'Oa': 'up', + 'Ob': 'down', + 'Oc': 'right', + 'Od': 'left', + 'Oe': 'clear', + + '[2^': 'insert', + '[3^': 'delete', + '[5^': 'pageup', + '[6^': 'pagedown', + '[7^': 'home', + '[8^': 'end', + /* misc. */ + '[Z': 'tab', +} + +function isShiftKey(code) { + return ['[a', '[b', '[c', '[d', '[e', '[2$', '[3$', '[5$', '[6$', '[7$', '[8$', '[Z'].includes(code) +} + +function isCtrlKey(code) { + return [ 'Oa', 'Ob', 'Oc', 'Od', 'Oe', '[2^', '[3^', '[5^', '[6^', '[7^', '[8^'].includes(code) +} + +const keypress = (s = '', event = {}) => { + let parts; + let key = { + name: event.name, + ctrl: false, + meta: false, + shift: false, + option: false, + sequence: s, + raw: s, + ...event + }; + + if (Buffer.isBuffer(s)) { + if (s[0] > 127 && s[1] === void 0) { + s[0] -= 128; + s = '\x1b' + String(s); + } else { + s = String(s); + } + } else if (s !== void 0 && typeof s !== 'string') { + s = String(s); + } else if (!s) { + s = key.sequence || ''; + } + + key.sequence = key.sequence || s || key.name; + + if (s === '\r') { + // carriage return + key.raw = void 0; + key.name = 'return'; + } else if (s === '\n') { + // enter, should have been called linefeed + key.name = 'enter'; + } else if (s === '\t') { + // tab + key.name = 'tab'; + } else if (s === '\b' || s === '\x7f' || s === '\x1b\x7f' || s === '\x1b\b') { + // backspace or ctrl+h + key.name = 'backspace'; + key.meta = s.charAt(0) === '\x1b'; + } else if (s === '\x1b' || s === '\x1b\x1b') { + // escape key + key.name = 'escape'; + key.meta = s.length === 2; + } else if (s === ' ' || s === '\x1b ') { + key.name = 'space'; + key.meta = s.length === 2; + } else if (s <= '\x1a') { + // ctrl+letter + key.name = String.fromCharCode(s.charCodeAt(0) + 'a'.charCodeAt(0) - 1); + key.ctrl = true; + } else if (s.length === 1 && s >= '0' && s <= '9') { + // number + key.name = 'number'; + } else if (s.length === 1 && s >= 'a' && s <= 'z') { + // lowercase letter + key.name = s; + } else if (s.length === 1 && s >= 'A' && s <= 'Z') { + // shift+letter + key.name = s.toLowerCase(); + key.shift = true; + } else if ((parts = metaKeyCodeRe.exec(s))) { + // meta+character key + key.meta = true; + key.shift = /^[A-Z]$/.test(parts[1]); + } else if ((parts = fnKeyRe.exec(s))) { + let segs = [...s]; + + if (segs[0] === '\u001b' && segs[1] === '\u001b') { + key.option = true; + } + + // ansi escape sequence + // reassemble the key code leaving out leading \x1b's, + // the modifier key bitflag and any meaningless "1;" sequence + let code = [parts[1], parts[2], parts[4], parts[6]].filter(Boolean).join(''); + let modifier = (parts[3] || parts[5] || 1) - 1; + + // Parse the key modifier + key.ctrl = !!(modifier & 4); + key.meta = !!(modifier & 10); + key.shift = !!(modifier & 1); + key.code = code; + + key.name = keyName[code]; + key.shift = isShiftKey(code) || key.shift; + key.ctrl = isCtrlKey(code) || key.ctrl; + } + return key; +}; + +keypress.listen = (options = {}, onKeypress) => { + let { stdin } = options; + + if (!stdin || (stdin !== process.stdin && !stdin.isTTY)) { + throw new Error('Invalid stream passed'); + } + + let rl = readline.createInterface({ terminal: true, input: stdin }); + readline.emitKeypressEvents(stdin, rl); + + let on = (buf, key) => onKeypress(buf, keypress(buf, key), rl); + let isRaw = stdin.isRaw; + + if (stdin.isTTY) stdin.setRawMode(true); + stdin.on('keypress', on); + rl.resume(); + + let off = () => { + if (stdin.isTTY) stdin.setRawMode(isRaw); + stdin.removeListener('keypress', on); + rl.pause(); + rl.close(); + }; + + return off; +}; + +keypress.action = (buf, key, customActions) => { + let obj = { ...combos, ...customActions }; + if (key.ctrl) { + key.action = obj.ctrl[key.name]; + return key; + } + + if (key.option && obj.option) { + key.action = obj.option[key.name]; + return key; + } + + if (key.shift) { + key.action = obj.shift[key.name]; + return key; + } + + key.action = obj.keys[key.name]; + return key; +}; + +module.exports = keypress; diff --git a/node_modules/enquirer/lib/placeholder.js b/node_modules/enquirer/lib/placeholder.js new file mode 100644 index 000000000..ae2af1cff --- /dev/null +++ b/node_modules/enquirer/lib/placeholder.js @@ -0,0 +1,63 @@ +'use strict'; + +const utils = require('./utils'); + +/** + * Render a placeholder value with cursor and styling based on the + * position of the cursor. + * + * @param {Object} `prompt` Prompt instance. + * @param {String} `input` Input string. + * @param {String} `initial` The initial user-provided value. + * @param {Number} `pos` Current cursor position. + * @param {Boolean} `showCursor` Render a simulated cursor using the inverse primary style. + * @return {String} Returns the styled placeholder string. + * @api public + */ + +module.exports = (prompt, options = {}) => { + prompt.cursorHide(); + + let { input = '', initial = '', pos, showCursor = true, color } = options; + let style = color || prompt.styles.placeholder; + let inverse = utils.inverse(prompt.styles.primary); + let blinker = str => inverse(prompt.styles.black(str)); + let output = input; + let char = ' '; + let reverse = blinker(char); + + if (prompt.blink && prompt.blink.off === true) { + blinker = str => str; + reverse = ''; + } + + if (showCursor && pos === 0 && initial === '' && input === '') { + return blinker(char); + } + + if (showCursor && pos === 0 && (input === initial || input === '')) { + return blinker(initial[0]) + style(initial.slice(1)); + } + + initial = utils.isPrimitive(initial) ? `${initial}` : ''; + input = utils.isPrimitive(input) ? `${input}` : ''; + + let placeholder = initial && initial.startsWith(input) && initial !== input; + let cursor = placeholder ? blinker(initial[input.length]) : reverse; + + if (pos !== input.length && showCursor === true) { + output = input.slice(0, pos) + blinker(input[pos]) + input.slice(pos + 1); + cursor = ''; + } + + if (showCursor === false) { + cursor = ''; + } + + if (placeholder) { + let raw = prompt.styles.unstyle(output + cursor); + return output + cursor + style(initial.slice(raw.length)); + } + + return output + cursor; +}; diff --git a/node_modules/enquirer/lib/prompt.js b/node_modules/enquirer/lib/prompt.js new file mode 100644 index 000000000..65f7bdd1e --- /dev/null +++ b/node_modules/enquirer/lib/prompt.js @@ -0,0 +1,485 @@ +'use strict'; + +const Events = require('events'); +const colors = require('ansi-colors'); +const keypress = require('./keypress'); +const timer = require('./timer'); +const State = require('./state'); +const theme = require('./theme'); +const utils = require('./utils'); +const ansi = require('./ansi'); + +/** + * Base class for creating a new Prompt. + * @param {Object} `options` Question object. + */ + +class Prompt extends Events { + constructor(options = {}) { + super(); + this.name = options.name; + this.type = options.type; + this.options = options; + theme(this); + timer(this); + this.state = new State(this); + this.initial = [options.initial, options.default].find(v => v != null); + this.stdout = options.stdout || process.stdout; + this.stdin = options.stdin || process.stdin; + this.scale = options.scale || 1; + this.term = this.options.term || process.env.TERM_PROGRAM; + this.margin = margin(this.options.margin); + this.setMaxListeners(0); + setOptions(this); + } + + async keypress(input, event = {}) { + this.keypressed = true; + let key = keypress.action(input, keypress(input, event), this.options.actions); + this.state.keypress = key; + this.emit('keypress', input, key); + this.emit('state', this.state.clone()); + let fn = this.options[key.action] || this[key.action] || this.dispatch; + if (typeof fn === 'function') { + return await fn.call(this, input, key); + } + this.alert(); + } + + alert() { + delete this.state.alert; + if (this.options.show === false) { + this.emit('alert'); + } else { + this.stdout.write(ansi.code.beep); + } + } + + cursorHide() { + this.stdout.write(ansi.cursor.hide()); + utils.onExit(() => this.cursorShow()); + } + + cursorShow() { + this.stdout.write(ansi.cursor.show()); + } + + write(str) { + if (!str) return; + if (this.stdout && this.state.show !== false) { + this.stdout.write(str); + } + this.state.buffer += str; + } + + clear(lines = 0) { + let buffer = this.state.buffer; + this.state.buffer = ''; + if ((!buffer && !lines) || this.options.show === false) return; + this.stdout.write(ansi.cursor.down(lines) + ansi.clear(buffer, this.width)); + } + + restore() { + if (this.state.closed || this.options.show === false) return; + + let { prompt, after, rest } = this.sections(); + let { cursor, initial = '', input = '', value = '' } = this; + + let size = this.state.size = rest.length; + let state = { after, cursor, initial, input, prompt, size, value }; + let codes = ansi.cursor.restore(state); + if (codes) { + this.stdout.write(codes); + } + } + + sections() { + let { buffer, input, prompt } = this.state; + prompt = colors.unstyle(prompt); + let buf = colors.unstyle(buffer); + let idx = buf.indexOf(prompt); + let header = buf.slice(0, idx); + let rest = buf.slice(idx); + let lines = rest.split('\n'); + let first = lines[0]; + let last = lines[lines.length - 1]; + let promptLine = prompt + (input ? ' ' + input : ''); + let len = promptLine.length; + let after = len < first.length ? first.slice(len + 1) : ''; + return { header, prompt: first, after, rest: lines.slice(1), last }; + } + + async submit() { + this.state.submitted = true; + this.state.validating = true; + + // this will only be called when the prompt is directly submitted + // without initializing, i.e. when the prompt is skipped, etc. Otherwize, + // "options.onSubmit" is will be handled by the "initialize()" method. + if (this.options.onSubmit) { + await this.options.onSubmit.call(this, this.name, this.value, this); + } + + let result = this.state.error || await this.validate(this.value, this.state); + if (result !== true) { + let error = '\n' + this.symbols.pointer + ' '; + + if (typeof result === 'string') { + error += result.trim(); + } else { + error += 'Invalid input'; + } + + this.state.error = '\n' + this.styles.danger(error); + this.state.submitted = false; + await this.render(); + await this.alert(); + this.state.validating = false; + this.state.error = void 0; + return; + } + + this.state.validating = false; + await this.render(); + await this.close(); + + this.value = await this.result(this.value); + this.emit('submit', this.value); + } + + async cancel(err) { + this.state.cancelled = this.state.submitted = true; + + await this.render(); + await this.close(); + + if (typeof this.options.onCancel === 'function') { + await this.options.onCancel.call(this, this.name, this.value, this); + } + + this.emit('cancel', await this.error(err)); + } + + async close() { + this.state.closed = true; + + try { + let sections = this.sections(); + let lines = Math.ceil(sections.prompt.length / this.width); + if (sections.rest) { + this.write(ansi.cursor.down(sections.rest.length)); + } + this.write('\n'.repeat(lines)); + } catch (err) { /* do nothing */ } + + this.emit('close'); + } + + start() { + if (!this.stop && this.options.show !== false) { + this.stop = keypress.listen(this, this.keypress.bind(this)); + this.once('close', this.stop); + } + } + + async skip() { + this.skipped = this.options.skip === true; + if (typeof this.options.skip === 'function') { + this.skipped = await this.options.skip.call(this, this.name, this.value); + } + return this.skipped; + } + + async initialize() { + let { format, options, result } = this; + + this.format = () => format.call(this, this.value); + this.result = () => result.call(this, this.value); + + if (typeof options.initial === 'function') { + this.initial = await options.initial.call(this, this); + } + + if (typeof options.onRun === 'function') { + await options.onRun.call(this, this); + } + + // if "options.onSubmit" is defined, we wrap the "submit" method to guarantee + // that "onSubmit" will always called first thing inside the submit + // method, regardless of how it's handled in inheriting prompts. + if (typeof options.onSubmit === 'function') { + let onSubmit = options.onSubmit.bind(this); + let submit = this.submit.bind(this); + delete this.options.onSubmit; + this.submit = async() => { + await onSubmit(this.name, this.value, this); + return submit(); + }; + } + + await this.start(); + await this.render(); + } + + render() { + throw new Error('expected prompt to have a custom render method'); + } + + run() { + return new Promise(async(resolve, reject) => { + this.once('submit', resolve); + this.once('cancel', reject); + if (await this.skip()) { + this.render = () => {}; + return this.submit(); + } + await this.initialize(); + this.emit('run'); + }); + } + + async element(name, choice, i) { + let { options, state, symbols, timers } = this; + let timer = timers && timers[name]; + state.timer = timer; + let value = options[name] || state[name] || symbols[name]; + let val = choice && choice[name] != null ? choice[name] : await value; + if (val === '') return val; + + let res = await this.resolve(val, state, choice, i); + if (!res && choice && choice[name]) { + return this.resolve(value, state, choice, i); + } + return res; + } + + async prefix() { + let element = await this.element('prefix') || this.symbols; + let timer = this.timers && this.timers.prefix; + let state = this.state; + state.timer = timer; + if (utils.isObject(element)) element = element[state.status] || element.pending; + if (!utils.hasColor(element)) { + let style = this.styles[state.status] || this.styles.pending; + return style(element); + } + return element; + } + + async message() { + let message = await this.element('message'); + if (!utils.hasColor(message)) { + return this.styles.strong(message); + } + return message; + } + + async separator() { + let element = await this.element('separator') || this.symbols; + let timer = this.timers && this.timers.separator; + let state = this.state; + state.timer = timer; + let value = element[state.status] || element.pending || state.separator; + let ele = await this.resolve(value, state); + if (utils.isObject(ele)) ele = ele[state.status] || ele.pending; + if (!utils.hasColor(ele)) { + return this.styles.muted(ele); + } + return ele; + } + + async pointer(choice, i) { + let val = await this.element('pointer', choice, i); + + if (typeof val === 'string' && utils.hasColor(val)) { + return val; + } + + if (val) { + let styles = this.styles; + let focused = this.index === i; + let style = focused ? styles.primary : val => val; + let ele = await this.resolve(val[focused ? 'on' : 'off'] || val, this.state); + let styled = !utils.hasColor(ele) ? style(ele) : ele; + return focused ? styled : ' '.repeat(ele.length); + } + } + + async indicator(choice, i) { + let val = await this.element('indicator', choice, i); + if (typeof val === 'string' && utils.hasColor(val)) { + return val; + } + if (val) { + let styles = this.styles; + let enabled = choice.enabled === true; + let style = enabled ? styles.success : styles.dark; + let ele = val[enabled ? 'on' : 'off'] || val; + return !utils.hasColor(ele) ? style(ele) : ele; + } + return ''; + } + + body() { + return null; + } + + footer() { + if (this.state.status === 'pending') { + return this.element('footer'); + } + } + + header() { + if (this.state.status === 'pending') { + return this.element('header'); + } + } + + async hint() { + if (this.state.status === 'pending' && !this.isValue(this.state.input)) { + let hint = await this.element('hint'); + if (!utils.hasColor(hint)) { + return this.styles.muted(hint); + } + return hint; + } + } + + error(err) { + return !this.state.submitted ? (err || this.state.error) : ''; + } + + format(value) { + return value; + } + + result(value) { + return value; + } + + validate(value) { + if (this.options.required === true) { + return this.isValue(value); + } + return true; + } + + isValue(value) { + return value != null && value !== ''; + } + + resolve(value, ...args) { + return utils.resolve(this, value, ...args); + } + + get base() { + return Prompt.prototype; + } + + get style() { + return this.styles[this.state.status]; + } + + get height() { + return this.options.rows || utils.height(this.stdout, 25); + } + get width() { + return this.options.columns || utils.width(this.stdout, 80); + } + get size() { + return { width: this.width, height: this.height }; + } + + set cursor(value) { + this.state.cursor = value; + } + get cursor() { + return this.state.cursor; + } + + set input(value) { + this.state.input = value; + } + get input() { + return this.state.input; + } + + set value(value) { + this.state.value = value; + } + get value() { + let { input, value } = this.state; + let result = [value, input].find(this.isValue.bind(this)); + return this.isValue(result) ? result : this.initial; + } + + static get prompt() { + return options => new this(options).run(); + } +} + +function setOptions(prompt) { + let isValidKey = key => { + return prompt[key] === void 0 || typeof prompt[key] === 'function'; + }; + + let ignore = [ + 'actions', + 'choices', + 'initial', + 'margin', + 'roles', + 'styles', + 'symbols', + 'theme', + 'timers', + 'value' + ]; + + let ignoreFn = [ + 'body', + 'footer', + 'error', + 'header', + 'hint', + 'indicator', + 'message', + 'prefix', + 'separator', + 'skip' + ]; + + for (let key of Object.keys(prompt.options)) { + if (ignore.includes(key)) continue; + if (/^on[A-Z]/.test(key)) continue; + let option = prompt.options[key]; + if (typeof option === 'function' && isValidKey(key)) { + if (!ignoreFn.includes(key)) { + prompt[key] = option.bind(prompt); + } + } else if (typeof prompt[key] !== 'function') { + prompt[key] = option; + } + } +} + +function margin(value) { + if (typeof value === 'number') { + value = [value, value, value, value]; + } + let arr = [].concat(value || []); + let pad = i => i % 2 === 0 ? '\n' : ' '; + let res = []; + for (let i = 0; i < 4; i++) { + let char = pad(i); + if (arr[i]) { + res.push(char.repeat(arr[i])); + } else { + res.push(''); + } + } + return res; +} + +module.exports = Prompt; diff --git a/node_modules/enquirer/lib/prompts/autocomplete.js b/node_modules/enquirer/lib/prompts/autocomplete.js new file mode 100644 index 000000000..daa4a16af --- /dev/null +++ b/node_modules/enquirer/lib/prompts/autocomplete.js @@ -0,0 +1,113 @@ +'use strict'; + +const Select = require('./select'); + +const highlight = (input, color) => { + let val = input.toLowerCase(); + return str => { + let s = str.toLowerCase(); + let i = s.indexOf(val); + let colored = color(str.slice(i, i + val.length)); + return i >= 0 ? str.slice(0, i) + colored + str.slice(i + val.length) : str; + }; +}; + +class AutoComplete extends Select { + constructor(options) { + super(options); + this.cursorShow(); + } + + moveCursor(n) { + this.state.cursor += n; + } + + dispatch(ch) { + return this.append(ch); + } + + space(ch) { + return this.options.multiple ? super.space(ch) : this.append(ch); + } + + append(ch) { + let { cursor, input } = this.state; + this.input = input.slice(0, cursor) + ch + input.slice(cursor); + this.moveCursor(1); + return this.complete(); + } + + delete() { + let { cursor, input } = this.state; + if (!input) return this.alert(); + this.input = input.slice(0, cursor - 1) + input.slice(cursor); + this.moveCursor(-1); + return this.complete(); + } + + deleteForward() { + let { cursor, input } = this.state; + if (input[cursor] === void 0) return this.alert(); + this.input = `${input}`.slice(0, cursor) + `${input}`.slice(cursor + 1); + return this.complete(); + } + + number(ch) { + return this.append(ch); + } + + async complete() { + this.completing = true; + this.choices = await this.suggest(this.input, this.state._choices); + this.state.limit = void 0; // allow getter/setter to reset limit + this.index = Math.min(Math.max(this.visible.length - 1, 0), this.index); + await this.render(); + this.completing = false; + } + + suggest(input = this.input, choices = this.state._choices) { + if (typeof this.options.suggest === 'function') { + return this.options.suggest.call(this, input, choices); + } + let str = input.toLowerCase(); + return choices.filter(ch => ch.message.toLowerCase().includes(str)); + } + + pointer() { + return ''; + } + + format() { + if (!this.focused) return this.input; + if (this.options.multiple && this.state.submitted) { + return this.selected.map(ch => this.styles.primary(ch.message)).join(', '); + } + if (this.state.submitted) { + let value = this.value = this.input = this.focused.value; + return this.styles.primary(value); + } + return this.input; + } + + async render() { + if (this.state.status !== 'pending') return super.render(); + let style = this.options.highlight + ? this.options.highlight.bind(this) + : this.styles.placeholder; + + let color = highlight(this.input, style); + let choices = this.choices; + this.choices = choices.map(ch => ({ ...ch, message: color(ch.message) })); + await super.render(); + this.choices = choices; + } + + submit() { + if (this.options.multiple) { + this.value = this.selected.map(ch => ch.name); + } + return super.submit(); + } +} + +module.exports = AutoComplete; diff --git a/node_modules/enquirer/lib/prompts/basicauth.js b/node_modules/enquirer/lib/prompts/basicauth.js new file mode 100644 index 000000000..54c5ea77b --- /dev/null +++ b/node_modules/enquirer/lib/prompts/basicauth.js @@ -0,0 +1,41 @@ +'use strict'; + +const AuthPrompt = require('../types/auth'); + +function defaultAuthenticate(value, state) { + if (value.username === this.options.username && value.password === this.options.password) { + return true; + } + return false; +} + +const factory = (authenticate = defaultAuthenticate) => { + const choices = [ + { name: 'username', message: 'username' }, + { + name: 'password', + message: 'password', + format(input) { + if (this.options.showPassword) { + return input; + } + let color = this.state.submitted ? this.styles.primary : this.styles.muted; + return color(this.symbols.asterisk.repeat(input.length)); + } + } + ]; + + class BasicAuthPrompt extends AuthPrompt.create(authenticate) { + constructor(options) { + super({ ...options, choices }); + } + + static create(authenticate) { + return factory(authenticate); + } + } + + return BasicAuthPrompt; +}; + +module.exports = factory(); diff --git a/node_modules/enquirer/lib/prompts/confirm.js b/node_modules/enquirer/lib/prompts/confirm.js new file mode 100644 index 000000000..61eae7ad9 --- /dev/null +++ b/node_modules/enquirer/lib/prompts/confirm.js @@ -0,0 +1,13 @@ +'use strict'; + +const BooleanPrompt = require('../types/boolean'); + +class ConfirmPrompt extends BooleanPrompt { + constructor(options) { + super(options); + this.default = this.options.default || (this.initial ? '(Y/n)' : '(y/N)'); + } +} + +module.exports = ConfirmPrompt; + diff --git a/node_modules/enquirer/lib/prompts/editable.js b/node_modules/enquirer/lib/prompts/editable.js new file mode 100644 index 000000000..042e4c9d0 --- /dev/null +++ b/node_modules/enquirer/lib/prompts/editable.js @@ -0,0 +1,136 @@ +'use strict'; + +const Select = require('./select'); +const Form = require('./form'); +const form = Form.prototype; + +class Editable extends Select { + constructor(options) { + super({ ...options, multiple: true }); + this.align = [this.options.align, 'left'].find(v => v != null); + this.emptyError = ''; + this.values = {}; + } + + dispatch(char, key) { + let choice = this.focused; + let parent = choice.parent || {}; + if (!choice.editable && !parent.editable) { + if (char === 'a' || char === 'i') return super[char](); + } + return form.dispatch.call(this, char, key); + } + + append(char, key) { + return form.append.call(this, char, key); + } + + delete(char, key) { + return form.delete.call(this, char, key); + } + + space(char) { + return this.focused.editable ? this.append(char) : super.space(); + } + + number(char) { + return this.focused.editable ? this.append(char) : super.number(char); + } + + next() { + return this.focused.editable ? form.next.call(this) : super.next(); + } + + prev() { + return this.focused.editable ? form.prev.call(this) : super.prev(); + } + + async indicator(choice, i) { + let symbol = choice.indicator || ''; + let value = choice.editable ? symbol : super.indicator(choice, i); + return await this.resolve(value, this.state, choice, i) || ''; + } + + indent(choice) { + return choice.role === 'heading' ? '' : (choice.editable ? ' ' : ' '); + } + + async renderChoice(choice, i) { + choice.indent = ''; + if (choice.editable) return form.renderChoice.call(this, choice, i); + return super.renderChoice(choice, i); + } + + error() { + return ''; + } + + footer() { + return this.state.error; + } + + async validate() { + let result = true; + + for (let choice of this.choices) { + if (typeof choice.validate !== 'function') { + continue; + } + + if (choice.role === 'heading') { + continue; + } + + let val = choice.parent ? this.value[choice.parent.name] : this.value; + + if (choice.editable) { + val = choice.value === choice.name ? choice.initial || '' : choice.value; + } else if (!this.isDisabled(choice)) { + val = choice.enabled === true; + } + + result = await choice.validate(val, this.state); + + if (result !== true) { + break; + } + } + + if (result !== true) { + this.state.error = typeof result === 'string' ? result : 'Invalid Input'; + } + + return result; + } + + submit() { + if (this.focused.newChoice === true) return super.submit(); + if (this.choices.some(ch => ch.newChoice)) { + return this.alert(); + } + + this.value = {}; + + for (let choice of this.choices) { + let val = choice.parent ? this.value[choice.parent.name] : this.value; + + if (choice.role === 'heading') { + this.value[choice.name] = {}; + continue; + } + + if (choice.editable) { + val[choice.name] = choice.value === choice.name + ? (choice.initial || '') + : choice.value; + + } else if (!this.isDisabled(choice)) { + val[choice.name] = choice.enabled === true; + } + } + + return this.base.submit.call(this); + } +} + +module.exports = Editable; diff --git a/node_modules/enquirer/lib/prompts/form.js b/node_modules/enquirer/lib/prompts/form.js new file mode 100644 index 000000000..aad4c6c6f --- /dev/null +++ b/node_modules/enquirer/lib/prompts/form.js @@ -0,0 +1,196 @@ +'use strict'; + +const colors = require('ansi-colors'); +const SelectPrompt = require('./select'); +const placeholder = require('../placeholder'); + +class FormPrompt extends SelectPrompt { + constructor(options) { + super({ ...options, multiple: true }); + this.type = 'form'; + this.initial = this.options.initial; + this.align = [this.options.align, 'right'].find(v => v != null); + this.emptyError = ''; + this.values = {}; + } + + async reset(first) { + await super.reset(); + if (first === true) this._index = this.index; + this.index = this._index; + this.values = {}; + this.choices.forEach(choice => choice.reset && choice.reset()); + return this.render(); + } + + dispatch(char) { + return !!char && this.append(char); + } + + append(char) { + let choice = this.focused; + if (!choice) return this.alert(); + let { cursor, input } = choice; + choice.value = choice.input = input.slice(0, cursor) + char + input.slice(cursor); + choice.cursor++; + return this.render(); + } + + delete() { + let choice = this.focused; + if (!choice || choice.cursor <= 0) return this.alert(); + let { cursor, input } = choice; + choice.value = choice.input = input.slice(0, cursor - 1) + input.slice(cursor); + choice.cursor--; + return this.render(); + } + + deleteForward() { + let choice = this.focused; + if (!choice) return this.alert(); + let { cursor, input } = choice; + if (input[cursor] === void 0) return this.alert(); + let str = `${input}`.slice(0, cursor) + `${input}`.slice(cursor + 1); + choice.value = choice.input = str; + return this.render(); + } + + right() { + let choice = this.focused; + if (!choice) return this.alert(); + if (choice.cursor >= choice.input.length) return this.alert(); + choice.cursor++; + return this.render(); + } + + left() { + let choice = this.focused; + if (!choice) return this.alert(); + if (choice.cursor <= 0) return this.alert(); + choice.cursor--; + return this.render(); + } + + space(ch, key) { + return this.dispatch(ch, key); + } + + number(ch, key) { + return this.dispatch(ch, key); + } + + next() { + let ch = this.focused; + if (!ch) return this.alert(); + let { initial, input } = ch; + if (initial && initial.startsWith(input) && input !== initial) { + ch.value = ch.input = initial; + ch.cursor = ch.value.length; + return this.render(); + } + return super.next(); + } + + prev() { + let ch = this.focused; + if (!ch) return this.alert(); + if (ch.cursor === 0) return super.prev(); + ch.value = ch.input = ''; + ch.cursor = 0; + return this.render(); + } + + separator() { + return ''; + } + + format(value) { + return !this.state.submitted ? super.format(value) : ''; + } + + pointer() { + return ''; + } + + indicator(choice) { + return choice.input ? '⦿' : '⊙'; + } + + async choiceSeparator(choice, i) { + let sep = await this.resolve(choice.separator, this.state, choice, i) || ':'; + return sep ? ' ' + this.styles.disabled(sep) : ''; + } + + async renderChoice(choice, i) { + await this.onChoice(choice, i); + + let { state, styles } = this; + let { cursor, initial = '', name, hint, input = '' } = choice; + let { muted, submitted, primary, danger } = styles; + + let help = hint; + let focused = this.index === i; + let validate = choice.validate || (() => true); + let sep = await this.choiceSeparator(choice, i); + let msg = choice.message; + + if (this.align === 'right') msg = msg.padStart(this.longest + 1, ' '); + if (this.align === 'left') msg = msg.padEnd(this.longest + 1, ' '); + + // re-populate the form values (answers) object + let value = this.values[name] = (input || initial); + let color = input ? 'success' : 'dark'; + + if ((await validate.call(choice, value, this.state)) !== true) { + color = 'danger'; + } + + let style = styles[color]; + let indicator = style(await this.indicator(choice, i)) + (choice.pad || ''); + + let indent = this.indent(choice); + let line = () => [indent, indicator, msg + sep, input, help].filter(Boolean).join(' '); + + if (state.submitted) { + msg = colors.unstyle(msg); + input = submitted(input); + help = ''; + return line(); + } + + if (choice.format) { + input = await choice.format.call(this, input, choice, i); + } else { + let color = this.styles.muted; + let options = { input, initial, pos: cursor, showCursor: focused, color }; + input = placeholder(this, options); + } + + if (!this.isValue(input)) { + input = this.styles.muted(this.symbols.ellipsis); + } + + if (choice.result) { + this.values[name] = await choice.result.call(this, value, choice, i); + } + + if (focused) { + msg = primary(msg); + } + + if (choice.error) { + input += (input ? ' ' : '') + danger(choice.error.trim()); + } else if (choice.hint) { + input += (input ? ' ' : '') + muted(choice.hint.trim()); + } + + return line(); + } + + async submit() { + this.value = this.values; + return super.base.submit.call(this); + } +} + +module.exports = FormPrompt; diff --git a/node_modules/enquirer/lib/prompts/index.js b/node_modules/enquirer/lib/prompts/index.js new file mode 100644 index 000000000..a82fbfb4a --- /dev/null +++ b/node_modules/enquirer/lib/prompts/index.js @@ -0,0 +1,28 @@ +'use strict'; + +const utils = require('../utils'); + +const define = (key, fn) => { + utils.defineExport(exports, key, fn); + utils.defineExport(exports, key.toLowerCase(), fn); +}; + +define('AutoComplete', () => require('./autocomplete')); +define('BasicAuth', () => require('./basicauth')); +define('Confirm', () => require('./confirm')); +define('Editable', () => require('./editable')); +define('Form', () => require('./form')); +define('Input', () => require('./input')); +define('Invisible', () => require('./invisible')); +define('List', () => require('./list')); +define('MultiSelect', () => require('./multiselect')); +define('Numeral', () => require('./numeral')); +define('Password', () => require('./password')); +define('Scale', () => require('./scale')); +define('Select', () => require('./select')); +define('Snippet', () => require('./snippet')); +define('Sort', () => require('./sort')); +define('Survey', () => require('./survey')); +define('Text', () => require('./text')); +define('Toggle', () => require('./toggle')); +define('Quiz', () => require('./quiz')); diff --git a/node_modules/enquirer/lib/prompts/input.js b/node_modules/enquirer/lib/prompts/input.js new file mode 100644 index 000000000..80ba193b4 --- /dev/null +++ b/node_modules/enquirer/lib/prompts/input.js @@ -0,0 +1,55 @@ +'use strict'; + +const Prompt = require('../types/string'); +const completer = require('../completer'); + +class Input extends Prompt { + constructor(options) { + super(options); + let history = this.options.history; + if (history && history.store) { + let initial = history.values || this.initial; + this.autosave = !!history.autosave; + this.store = history.store; + this.data = this.store.get('values') || { past: [], present: initial }; + this.initial = this.data.present || this.data.past[this.data.past.length - 1]; + } + } + + completion(action) { + if (!this.store) return this.alert(); + this.data = completer(action, this.data, this.input); + if (!this.data.present) return this.alert(); + this.input = this.data.present; + this.cursor = this.input.length; + return this.render(); + } + + altUp() { + return this.completion('prev'); + } + + altDown() { + return this.completion('next'); + } + + prev() { + this.save(); + return super.prev(); + } + + save() { + if (!this.store) return; + this.data = completer('save', this.data, this.input); + this.store.set('values', this.data); + } + + submit() { + if (this.store && this.autosave === true) { + this.save(); + } + return super.submit(); + } +} + +module.exports = Input; diff --git a/node_modules/enquirer/lib/prompts/invisible.js b/node_modules/enquirer/lib/prompts/invisible.js new file mode 100644 index 000000000..548106243 --- /dev/null +++ b/node_modules/enquirer/lib/prompts/invisible.js @@ -0,0 +1,11 @@ +'use strict'; + +const StringPrompt = require('../types/string'); + +class InvisiblePrompt extends StringPrompt { + format() { + return ''; + } +} + +module.exports = InvisiblePrompt; diff --git a/node_modules/enquirer/lib/prompts/list.js b/node_modules/enquirer/lib/prompts/list.js new file mode 100644 index 000000000..7657c7fff --- /dev/null +++ b/node_modules/enquirer/lib/prompts/list.js @@ -0,0 +1,36 @@ +'use strict'; + +const StringPrompt = require('../types/string'); + +class ListPrompt extends StringPrompt { + constructor(options = {}) { + super(options); + this.sep = this.options.separator || /, */; + this.initial = options.initial || ''; + } + + split(input = this.value) { + return input ? String(input).split(this.sep) : []; + } + + format() { + let style = this.state.submitted ? this.styles.primary : val => val; + return this.list.map(style).join(', '); + } + + async submit(value) { + let result = this.state.error || await this.validate(this.list, this.state); + if (result !== true) { + this.state.error = result; + return super.submit(); + } + this.value = this.list; + return super.submit(); + } + + get list() { + return this.split(); + } +} + +module.exports = ListPrompt; diff --git a/node_modules/enquirer/lib/prompts/multiselect.js b/node_modules/enquirer/lib/prompts/multiselect.js new file mode 100644 index 000000000..f64fcd582 --- /dev/null +++ b/node_modules/enquirer/lib/prompts/multiselect.js @@ -0,0 +1,11 @@ +'use strict'; + +const Select = require('./select'); + +class MultiSelect extends Select { + constructor(options) { + super({ ...options, multiple: true }); + } +} + +module.exports = MultiSelect; diff --git a/node_modules/enquirer/lib/prompts/numeral.js b/node_modules/enquirer/lib/prompts/numeral.js new file mode 100644 index 000000000..2a81fdd26 --- /dev/null +++ b/node_modules/enquirer/lib/prompts/numeral.js @@ -0,0 +1 @@ +module.exports = require('../types/number'); diff --git a/node_modules/enquirer/lib/prompts/password.js b/node_modules/enquirer/lib/prompts/password.js new file mode 100644 index 000000000..46df22d28 --- /dev/null +++ b/node_modules/enquirer/lib/prompts/password.js @@ -0,0 +1,18 @@ +'use strict'; + +const StringPrompt = require('../types/string'); + +class PasswordPrompt extends StringPrompt { + constructor(options) { + super(options); + this.cursorShow(); + } + + format(input = this.input) { + if (!this.keypressed) return ''; + let color = this.state.submitted ? this.styles.primary : this.styles.muted; + return color(this.symbols.asterisk.repeat(input.length)); + } +} + +module.exports = PasswordPrompt; diff --git a/node_modules/enquirer/lib/prompts/quiz.js b/node_modules/enquirer/lib/prompts/quiz.js new file mode 100644 index 000000000..2be455184 --- /dev/null +++ b/node_modules/enquirer/lib/prompts/quiz.js @@ -0,0 +1,37 @@ +'use strict'; + +const SelectPrompt = require('./select'); + +class Quiz extends SelectPrompt { + constructor(options) { + super(options); + if (typeof this.options.correctChoice !== 'number' || this.options.correctChoice < 0) { + throw new Error('Please specify the index of the correct answer from the list of choices'); + } + } + + async toChoices(value, parent) { + let choices = await super.toChoices(value, parent); + if (choices.length < 2) { + throw new Error('Please give at least two choices to the user'); + } + if (this.options.correctChoice > choices.length) { + throw new Error('Please specify the index of the correct answer from the list of choices'); + } + return choices; + } + + check(state) { + return state.index === this.options.correctChoice; + } + + async result(selected) { + return { + selectedAnswer: selected, + correctAnswer: this.options.choices[this.options.correctChoice].value, + correct: await this.check(this.state) + }; + } +} + +module.exports = Quiz; diff --git a/node_modules/enquirer/lib/prompts/scale.js b/node_modules/enquirer/lib/prompts/scale.js new file mode 100644 index 000000000..29d682964 --- /dev/null +++ b/node_modules/enquirer/lib/prompts/scale.js @@ -0,0 +1,237 @@ +'use strict'; + +const colors = require('ansi-colors'); +const ArrayPrompt = require('../types/array'); +const utils = require('../utils'); + +class LikertScale extends ArrayPrompt { + constructor(options = {}) { + super(options); + this.widths = [].concat(options.messageWidth || 50); + this.align = [].concat(options.align || 'left'); + this.linebreak = options.linebreak || false; + this.edgeLength = options.edgeLength || 3; + this.newline = options.newline || '\n '; + let start = options.startNumber || 1; + if (typeof this.scale === 'number') { + this.scaleKey = false; + this.scale = Array(this.scale).fill(0).map((v, i) => ({ name: i + start })); + } + } + + async reset() { + this.tableized = false; + await super.reset(); + return this.render(); + } + + tableize() { + if (this.tableized === true) return; + this.tableized = true; + let longest = 0; + + for (let ch of this.choices) { + longest = Math.max(longest, ch.message.length); + ch.scaleIndex = ch.initial || 2; + ch.scale = []; + + for (let i = 0; i < this.scale.length; i++) { + ch.scale.push({ index: i }); + } + } + this.widths[0] = Math.min(this.widths[0], longest + 3); + } + + async dispatch(s, key) { + if (this.multiple) { + return this[key.name] ? await this[key.name](s, key) : await super.dispatch(s, key); + } + this.alert(); + } + + heading(msg, item, i) { + return this.styles.strong(msg); + } + + separator() { + return this.styles.muted(this.symbols.ellipsis); + } + + right() { + let choice = this.focused; + if (choice.scaleIndex >= this.scale.length - 1) return this.alert(); + choice.scaleIndex++; + return this.render(); + } + + left() { + let choice = this.focused; + if (choice.scaleIndex <= 0) return this.alert(); + choice.scaleIndex--; + return this.render(); + } + + indent() { + return ''; + } + + format() { + if (this.state.submitted) { + let values = this.choices.map(ch => this.styles.info(ch.index)); + return values.join(', '); + } + return ''; + } + + pointer() { + return ''; + } + + /** + * Render the scale "Key". Something like: + * @return {String} + */ + + renderScaleKey() { + if (this.scaleKey === false) return ''; + if (this.state.submitted) return ''; + let scale = this.scale.map(item => ` ${item.name} - ${item.message}`); + let key = ['', ...scale].map(item => this.styles.muted(item)); + return key.join('\n'); + } + + /** + * Render the heading row for the scale. + * @return {String} + */ + + renderScaleHeading(max) { + let keys = this.scale.map(ele => ele.name); + if (typeof this.options.renderScaleHeading === 'function') { + keys = this.options.renderScaleHeading.call(this, max); + } + let diff = this.scaleLength - keys.join('').length; + let spacing = Math.round(diff / (keys.length - 1)); + let names = keys.map(key => this.styles.strong(key)); + let headings = names.join(' '.repeat(spacing)); + let padding = ' '.repeat(this.widths[0]); + return this.margin[3] + padding + this.margin[1] + headings; + } + + /** + * Render a scale indicator => ◯ or ◉ by default + */ + + scaleIndicator(choice, item, i) { + if (typeof this.options.scaleIndicator === 'function') { + return this.options.scaleIndicator.call(this, choice, item, i); + } + let enabled = choice.scaleIndex === item.index; + if (item.disabled) return this.styles.hint(this.symbols.radio.disabled); + if (enabled) return this.styles.success(this.symbols.radio.on); + return this.symbols.radio.off; + } + + /** + * Render the actual scale => ◯────◯────◉────◯────◯ + */ + + renderScale(choice, i) { + let scale = choice.scale.map(item => this.scaleIndicator(choice, item, i)); + let padding = this.term === 'Hyper' ? '' : ' '; + return scale.join(padding + this.symbols.line.repeat(this.edgeLength)); + } + + /** + * Render a choice, including scale => + * "The website is easy to navigate. ◯───◯───◉───◯───◯" + */ + + async renderChoice(choice, i) { + await this.onChoice(choice, i); + + let focused = this.index === i; + let pointer = await this.pointer(choice, i); + let hint = await choice.hint; + + if (hint && !utils.hasColor(hint)) { + hint = this.styles.muted(hint); + } + + let pad = str => this.margin[3] + str.replace(/\s+$/, '').padEnd(this.widths[0], ' '); + let newline = this.newline; + let ind = this.indent(choice); + let message = await this.resolve(choice.message, this.state, choice, i); + let scale = await this.renderScale(choice, i); + let margin = this.margin[1] + this.margin[3]; + this.scaleLength = colors.unstyle(scale).length; + this.widths[0] = Math.min(this.widths[0], this.width - this.scaleLength - margin.length); + let msg = utils.wordWrap(message, { width: this.widths[0], newline }); + let lines = msg.split('\n').map(line => pad(line) + this.margin[1]); + + if (focused) { + scale = this.styles.info(scale); + lines = lines.map(line => this.styles.info(line)); + } + + lines[0] += scale; + + if (this.linebreak) lines.push(''); + return [ind + pointer, lines.join('\n')].filter(Boolean); + } + + async renderChoices() { + if (this.state.submitted) return ''; + this.tableize(); + let choices = this.visible.map(async(ch, i) => await this.renderChoice(ch, i)); + let visible = await Promise.all(choices); + let heading = await this.renderScaleHeading(); + return this.margin[0] + [heading, ...visible.map(v => v.join(' '))].join('\n'); + } + + async render() { + let { submitted, size } = this.state; + + let prefix = await this.prefix(); + let separator = await this.separator(); + let message = await this.message(); + + let prompt = ''; + if (this.options.promptLine !== false) { + prompt = [prefix, message, separator, ''].join(' '); + this.state.prompt = prompt; + } + + let header = await this.header(); + let output = await this.format(); + let key = await this.renderScaleKey(); + let help = await this.error() || await this.hint(); + let body = await this.renderChoices(); + let footer = await this.footer(); + let err = this.emptyError; + + if (output) prompt += output; + if (help && !prompt.includes(help)) prompt += ' ' + help; + + if (submitted && !output && !body.trim() && this.multiple && err != null) { + prompt += this.styles.danger(err); + } + + this.clear(size); + this.write([header, prompt, key, body, footer].filter(Boolean).join('\n')); + if (!this.state.submitted) { + this.write(this.margin[2]); + } + this.restore(); + } + + submit() { + this.value = {}; + for (let choice of this.choices) { + this.value[choice.name] = choice.scaleIndex; + } + return this.base.submit.call(this); + } +} + +module.exports = LikertScale; diff --git a/node_modules/enquirer/lib/prompts/select.js b/node_modules/enquirer/lib/prompts/select.js new file mode 100644 index 000000000..5d3ad3703 --- /dev/null +++ b/node_modules/enquirer/lib/prompts/select.js @@ -0,0 +1,139 @@ +'use strict'; + +const ArrayPrompt = require('../types/array'); +const utils = require('../utils'); + +class SelectPrompt extends ArrayPrompt { + constructor(options) { + super(options); + this.emptyError = this.options.emptyError || 'No items were selected'; + } + + async dispatch(s, key) { + if (this.multiple) { + return this[key.name] ? await this[key.name](s, key) : await super.dispatch(s, key); + } + this.alert(); + } + + separator() { + if (this.options.separator) return super.separator(); + let sep = this.styles.muted(this.symbols.ellipsis); + return this.state.submitted ? super.separator() : sep; + } + + pointer(choice, i) { + return (!this.multiple || this.options.pointer) ? super.pointer(choice, i) : ''; + } + + indicator(choice, i) { + return this.multiple ? super.indicator(choice, i) : ''; + } + + choiceMessage(choice, i) { + let message = this.resolve(choice.message, this.state, choice, i); + if (choice.role === 'heading' && !utils.hasColor(message)) { + message = this.styles.strong(message); + } + return this.resolve(message, this.state, choice, i); + } + + choiceSeparator() { + return ':'; + } + + async renderChoice(choice, i) { + await this.onChoice(choice, i); + + let focused = this.index === i; + let pointer = await this.pointer(choice, i); + let check = await this.indicator(choice, i) + (choice.pad || ''); + let hint = await this.resolve(choice.hint, this.state, choice, i); + + if (hint && !utils.hasColor(hint)) { + hint = this.styles.muted(hint); + } + + let ind = this.indent(choice); + let msg = await this.choiceMessage(choice, i); + let line = () => [this.margin[3], ind + pointer + check, msg, this.margin[1], hint].filter(Boolean).join(' '); + + if (choice.role === 'heading') { + return line(); + } + + if (choice.disabled) { + if (!utils.hasColor(msg)) { + msg = this.styles.disabled(msg); + } + return line(); + } + + if (focused) { + msg = this.styles.em(msg); + } + + return line(); + } + + async renderChoices() { + if (this.state.loading === 'choices') { + return this.styles.warning('Loading choices'); + } + + if (this.state.submitted) return ''; + let choices = this.visible.map(async(ch, i) => await this.renderChoice(ch, i)); + let visible = await Promise.all(choices); + if (!visible.length) visible.push(this.styles.danger('No matching choices')); + let result = this.margin[0] + visible.join('\n'); + let header; + + if (this.options.choicesHeader) { + header = await this.resolve(this.options.choicesHeader, this.state); + } + + return [header, result].filter(Boolean).join('\n'); + } + + format() { + if (!this.state.submitted || this.state.cancelled) return ''; + if (Array.isArray(this.selected)) { + return this.selected.map(choice => this.styles.primary(choice.name)).join(', '); + } + return this.styles.primary(this.selected.name); + } + + async render() { + let { submitted, size } = this.state; + + let prompt = ''; + let header = await this.header(); + let prefix = await this.prefix(); + let separator = await this.separator(); + let message = await this.message(); + + if (this.options.promptLine !== false) { + prompt = [prefix, message, separator, ''].join(' '); + this.state.prompt = prompt; + } + + let output = await this.format(); + let help = (await this.error()) || (await this.hint()); + let body = await this.renderChoices(); + let footer = await this.footer(); + + if (output) prompt += output; + if (help && !prompt.includes(help)) prompt += ' ' + help; + + if (submitted && !output && !body.trim() && this.multiple && this.emptyError != null) { + prompt += this.styles.danger(this.emptyError); + } + + this.clear(size); + this.write([header, prompt, body, footer].filter(Boolean).join('\n')); + this.write(this.margin[2]); + this.restore(); + } +} + +module.exports = SelectPrompt; diff --git a/node_modules/enquirer/lib/prompts/snippet.js b/node_modules/enquirer/lib/prompts/snippet.js new file mode 100644 index 000000000..eec6cc3ab --- /dev/null +++ b/node_modules/enquirer/lib/prompts/snippet.js @@ -0,0 +1,185 @@ +'use strict'; + +const colors = require('ansi-colors'); +const interpolate = require('../interpolate'); +const Prompt = require('../prompt'); + +class SnippetPrompt extends Prompt { + constructor(options) { + super(options); + this.cursorHide(); + this.reset(true); + } + + async initialize() { + this.interpolate = await interpolate(this); + await super.initialize(); + } + + async reset(first) { + this.state.keys = []; + this.state.invalid = new Map(); + this.state.missing = new Set(); + this.state.completed = 0; + this.state.values = {}; + + if (first !== true) { + await this.initialize(); + await this.render(); + } + } + + moveCursor(n) { + let item = this.getItem(); + this.cursor += n; + item.cursor += n; + } + + dispatch(ch, key) { + if (!key.code && !key.ctrl && ch != null && this.getItem()) { + this.append(ch, key); + return; + } + this.alert(); + } + + append(ch, key) { + let item = this.getItem(); + let prefix = item.input.slice(0, this.cursor); + let suffix = item.input.slice(this.cursor); + this.input = item.input = `${prefix}${ch}${suffix}`; + this.moveCursor(1); + this.render(); + } + + delete() { + let item = this.getItem(); + if (this.cursor <= 0 || !item.input) return this.alert(); + let suffix = item.input.slice(this.cursor); + let prefix = item.input.slice(0, this.cursor - 1); + this.input = item.input = `${prefix}${suffix}`; + this.moveCursor(-1); + this.render(); + } + + increment(i) { + return i >= this.state.keys.length - 1 ? 0 : i + 1; + } + + decrement(i) { + return i <= 0 ? this.state.keys.length - 1 : i - 1; + } + + first() { + this.state.index = 0; + this.render(); + } + + last() { + this.state.index = this.state.keys.length - 1; + this.render(); + } + + right() { + if (this.cursor >= this.input.length) return this.alert(); + this.moveCursor(1); + this.render(); + } + + left() { + if (this.cursor <= 0) return this.alert(); + this.moveCursor(-1); + this.render(); + } + + prev() { + this.state.index = this.decrement(this.state.index); + this.getItem(); + this.render(); + } + + next() { + this.state.index = this.increment(this.state.index); + this.getItem(); + this.render(); + } + + up() { + this.prev(); + } + + down() { + this.next(); + } + + format(value) { + let color = this.state.completed < 100 ? this.styles.warning : this.styles.success; + if (this.state.submitted === true && this.state.completed !== 100) { + color = this.styles.danger; + } + return color(`${this.state.completed}% completed`); + } + + async render() { + let { index, keys = [], submitted, size } = this.state; + + let newline = [this.options.newline, '\n'].find(v => v != null); + let prefix = await this.prefix(); + let separator = await this.separator(); + let message = await this.message(); + + let prompt = [prefix, message, separator].filter(Boolean).join(' '); + this.state.prompt = prompt; + + let header = await this.header(); + let error = (await this.error()) || ''; + let hint = (await this.hint()) || ''; + let body = submitted ? '' : await this.interpolate(this.state); + + let key = this.state.key = keys[index] || ''; + let input = await this.format(key); + let footer = await this.footer(); + if (input) prompt += ' ' + input; + if (hint && !input && this.state.completed === 0) prompt += ' ' + hint; + + this.clear(size); + let lines = [header, prompt, body, footer, error.trim()]; + this.write(lines.filter(Boolean).join(newline)); + this.restore(); + } + + getItem(name) { + let { items, keys, index } = this.state; + let item = items.find(ch => ch.name === keys[index]); + if (item && item.input != null) { + this.input = item.input; + this.cursor = item.cursor; + } + return item; + } + + async submit() { + if (typeof this.interpolate !== 'function') await this.initialize(); + await this.interpolate(this.state, true); + + let { invalid, missing, output, values } = this.state; + if (invalid.size) { + let err = ''; + for (let [key, value] of invalid) err += `Invalid ${key}: ${value}\n`; + this.state.error = err; + return super.submit(); + } + + if (missing.size) { + this.state.error = 'Required: ' + [...missing.keys()].join(', '); + return super.submit(); + } + + let lines = colors.unstyle(output).split('\n'); + let result = lines.map(v => v.slice(1)).join('\n'); + this.value = { values, result }; + return super.submit(); + } +} + +module.exports = SnippetPrompt; diff --git a/node_modules/enquirer/lib/prompts/sort.js b/node_modules/enquirer/lib/prompts/sort.js new file mode 100644 index 000000000..b779b9b24 --- /dev/null +++ b/node_modules/enquirer/lib/prompts/sort.js @@ -0,0 +1,37 @@ +'use strict'; + +const hint = '(Use + to sort)'; +const Prompt = require('./select'); + +class Sort extends Prompt { + constructor(options) { + super({ ...options, reorder: false, sort: true, multiple: true }); + this.state.hint = [this.options.hint, hint].find(this.isValue.bind(this)); + } + + indicator() { + return ''; + } + + async renderChoice(choice, i) { + let str = await super.renderChoice(choice, i); + let sym = this.symbols.identicalTo + ' '; + let pre = (this.index === i && this.sorting) ? this.styles.muted(sym) : ' '; + if (this.options.drag === false) pre = ''; + if (this.options.numbered === true) { + return pre + `${i + 1} - ` + str; + } + return pre + str; + } + + get selected() { + return this.choices; + } + + submit() { + this.value = this.choices.map(choice => choice.value); + return super.submit(); + } +} + +module.exports = Sort; diff --git a/node_modules/enquirer/lib/prompts/survey.js b/node_modules/enquirer/lib/prompts/survey.js new file mode 100644 index 000000000..5d39f6bd2 --- /dev/null +++ b/node_modules/enquirer/lib/prompts/survey.js @@ -0,0 +1,163 @@ +'use strict'; + +const ArrayPrompt = require('../types/array'); + +class Survey extends ArrayPrompt { + constructor(options = {}) { + super(options); + this.emptyError = options.emptyError || 'No items were selected'; + this.term = process.env.TERM_PROGRAM; + + if (!this.options.header) { + let header = ['', '4 - Strongly Agree', '3 - Agree', '2 - Neutral', '1 - Disagree', '0 - Strongly Disagree', '']; + header = header.map(ele => this.styles.muted(ele)); + this.state.header = header.join('\n '); + } + } + + async toChoices(...args) { + if (this.createdScales) return false; + this.createdScales = true; + let choices = await super.toChoices(...args); + for (let choice of choices) { + choice.scale = createScale(5, this.options); + choice.scaleIdx = 2; + } + return choices; + } + + dispatch() { + this.alert(); + } + + space() { + let choice = this.focused; + let ele = choice.scale[choice.scaleIdx]; + let selected = ele.selected; + choice.scale.forEach(e => (e.selected = false)); + ele.selected = !selected; + return this.render(); + } + + indicator() { + return ''; + } + + pointer() { + return ''; + } + + separator() { + return this.styles.muted(this.symbols.ellipsis); + } + + right() { + let choice = this.focused; + if (choice.scaleIdx >= choice.scale.length - 1) return this.alert(); + choice.scaleIdx++; + return this.render(); + } + + left() { + let choice = this.focused; + if (choice.scaleIdx <= 0) return this.alert(); + choice.scaleIdx--; + return this.render(); + } + + indent() { + return ' '; + } + + async renderChoice(item, i) { + await this.onChoice(item, i); + let focused = this.index === i; + let isHyper = this.term === 'Hyper'; + let n = !isHyper ? 8 : 9; + let s = !isHyper ? ' ' : ''; + let ln = this.symbols.line.repeat(n); + let sp = ' '.repeat(n + (isHyper ? 0 : 1)); + let dot = enabled => (enabled ? this.styles.success('◉') : '◯') + s; + + let num = i + 1 + '.'; + let color = focused ? this.styles.heading : this.styles.noop; + let msg = await this.resolve(item.message, this.state, item, i); + let indent = this.indent(item); + let scale = indent + item.scale.map((e, i) => dot(i === item.scaleIdx)).join(ln); + let val = i => i === item.scaleIdx ? color(i) : i; + let next = indent + item.scale.map((e, i) => val(i)).join(sp); + + let line = () => [num, msg].filter(Boolean).join(' '); + let lines = () => [line(), scale, next, ' '].filter(Boolean).join('\n'); + + if (focused) { + scale = this.styles.cyan(scale); + next = this.styles.cyan(next); + } + + return lines(); + } + + async renderChoices() { + if (this.state.submitted) return ''; + let choices = this.visible.map(async(ch, i) => await this.renderChoice(ch, i)); + let visible = await Promise.all(choices); + if (!visible.length) visible.push(this.styles.danger('No matching choices')); + return visible.join('\n'); + } + + format() { + if (this.state.submitted) { + let values = this.choices.map(ch => this.styles.info(ch.scaleIdx)); + return values.join(', '); + } + return ''; + } + + async render() { + let { submitted, size } = this.state; + + let prefix = await this.prefix(); + let separator = await this.separator(); + let message = await this.message(); + + let prompt = [prefix, message, separator].filter(Boolean).join(' '); + this.state.prompt = prompt; + + let header = await this.header(); + let output = await this.format(); + let help = await this.error() || await this.hint(); + let body = await this.renderChoices(); + let footer = await this.footer(); + + if (output || !help) prompt += ' ' + output; + if (help && !prompt.includes(help)) prompt += ' ' + help; + + if (submitted && !output && !body && this.multiple && this.type !== 'form') { + prompt += this.styles.danger(this.emptyError); + } + + this.clear(size); + this.write([prompt, header, body, footer].filter(Boolean).join('\n')); + this.restore(); + } + + submit() { + this.value = {}; + for (let choice of this.choices) { + this.value[choice.name] = choice.scaleIdx; + } + return this.base.submit.call(this); + } +} + +function createScale(n, options = {}) { + if (Array.isArray(options.scale)) { + return options.scale.map(ele => ({ ...ele })); + } + let scale = []; + for (let i = 1; i < n + 1; i++) scale.push({ i, selected: false }); + return scale; +} + +module.exports = Survey; diff --git a/node_modules/enquirer/lib/prompts/text.js b/node_modules/enquirer/lib/prompts/text.js new file mode 100644 index 000000000..556e1db44 --- /dev/null +++ b/node_modules/enquirer/lib/prompts/text.js @@ -0,0 +1 @@ +module.exports = require('./input'); diff --git a/node_modules/enquirer/lib/prompts/toggle.js b/node_modules/enquirer/lib/prompts/toggle.js new file mode 100644 index 000000000..26d33945e --- /dev/null +++ b/node_modules/enquirer/lib/prompts/toggle.js @@ -0,0 +1,109 @@ +'use strict'; + +const BooleanPrompt = require('../types/boolean'); + +class TogglePrompt extends BooleanPrompt { + async initialize() { + await super.initialize(); + this.value = this.initial = !!this.options.initial; + this.disabled = this.options.disabled || 'no'; + this.enabled = this.options.enabled || 'yes'; + await this.render(); + } + + reset() { + this.value = this.initial; + this.render(); + } + + delete() { + this.alert(); + } + + toggle() { + this.value = !this.value; + this.render(); + } + + enable() { + if (this.value === true) return this.alert(); + this.value = true; + this.render(); + } + disable() { + if (this.value === false) return this.alert(); + this.value = false; + this.render(); + } + + up() { + this.toggle(); + } + down() { + this.toggle(); + } + right() { + this.toggle(); + } + left() { + this.toggle(); + } + next() { + this.toggle(); + } + prev() { + this.toggle(); + } + + dispatch(ch = '', key) { + switch (ch.toLowerCase()) { + case ' ': + return this.toggle(); + case '1': + case 'y': + case 't': + return this.enable(); + case '0': + case 'n': + case 'f': + return this.disable(); + default: { + return this.alert(); + } + } + } + + format() { + let active = str => this.styles.primary.underline(str); + let value = [ + this.value ? this.disabled : active(this.disabled), + this.value ? active(this.enabled) : this.enabled + ]; + return value.join(this.styles.muted(' / ')); + } + + async render() { + let { size } = this.state; + + let header = await this.header(); + let prefix = await this.prefix(); + let separator = await this.separator(); + let message = await this.message(); + + let output = await this.format(); + let help = (await this.error()) || (await this.hint()); + let footer = await this.footer(); + + let prompt = [prefix, message, separator, output].join(' '); + this.state.prompt = prompt; + + if (help && !prompt.includes(help)) prompt += ' ' + help; + + this.clear(size); + this.write([header, prompt, footer].filter(Boolean).join('\n')); + this.write(this.margin[2]); + this.restore(); + } +} + +module.exports = TogglePrompt; diff --git a/node_modules/enquirer/lib/render.js b/node_modules/enquirer/lib/render.js new file mode 100644 index 000000000..6a6df4a24 --- /dev/null +++ b/node_modules/enquirer/lib/render.js @@ -0,0 +1,33 @@ +'use strict'; + +module.exports = async(value, prompt, context = {}) => { + let { choices, multiple } = prompt.options; + let { size, submitted } = prompt.state; + + let prefix = context.prefix || await prompt.prefix(); + let separator = context.separator || await prompt.separator(); + let message = context.message || await prompt.message(); + + // ? Select your favorite colors > + // ^ ^ ^ + // prefix message separator + let promptLine = [prefix, message, separator].filter(Boolean).join(' '); + prompt.state.prompt = promptLine; + + let header = context.header || await prompt.header(); + let output = context.format || await prompt.format(value); + let help = context.help || await prompt.error() || await prompt.hint(); + let body = context.body || await prompt.body(); + let footer = context.footer || await prompt.footer(); + + if (output || !help) promptLine += ' ' + output; + if (help && !promptLine.includes(help)) promptLine += ' ' + help; + + if (submitted && choices && multiple && !output && !body) { + promptLine += prompt.styles.danger('No items were selected'); + } + + prompt.clear(size); + prompt.write([header, promptLine, body, footer].filter(Boolean).join('\n')); + prompt.restore(); +}; diff --git a/node_modules/enquirer/lib/roles.js b/node_modules/enquirer/lib/roles.js new file mode 100644 index 000000000..1d663d22d --- /dev/null +++ b/node_modules/enquirer/lib/roles.js @@ -0,0 +1,46 @@ +'use strict'; + +const utils = require('./utils'); +const roles = { + default(prompt, choice) { + return choice; + }, + checkbox(prompt, choice) { + throw new Error('checkbox role is not implemented yet'); + }, + editable(prompt, choice) { + throw new Error('editable role is not implemented yet'); + }, + expandable(prompt, choice) { + throw new Error('expandable role is not implemented yet'); + }, + heading(prompt, choice) { + choice.disabled = ''; + choice.indicator = [choice.indicator, ' '].find(v => v != null); + choice.message = choice.message || ''; + return choice; + }, + input(prompt, choice) { + throw new Error('input role is not implemented yet'); + }, + option(prompt, choice) { + return roles.default(prompt, choice); + }, + radio(prompt, choice) { + throw new Error('radio role is not implemented yet'); + }, + separator(prompt, choice) { + choice.disabled = ''; + choice.indicator = [choice.indicator, ' '].find(v => v != null); + choice.message = choice.message || prompt.symbols.line.repeat(5); + return choice; + }, + spacer(prompt, choice) { + return choice; + } +}; + +module.exports = (name, options = {}) => { + let role = utils.merge({}, roles, options.roles); + return role[name] || role.default; +}; diff --git a/node_modules/enquirer/lib/state.js b/node_modules/enquirer/lib/state.js new file mode 100644 index 000000000..501890b8e --- /dev/null +++ b/node_modules/enquirer/lib/state.js @@ -0,0 +1,69 @@ +'use strict'; + +const { define, width } = require('./utils'); + +class State { + constructor(prompt) { + let options = prompt.options; + define(this, '_prompt', prompt); + this.type = prompt.type; + this.name = prompt.name; + this.message = ''; + this.header = ''; + this.footer = ''; + this.error = ''; + this.hint = ''; + this.input = ''; + this.cursor = 0; + this.index = 0; + this.lines = 0; + this.tick = 0; + this.prompt = ''; + this.buffer = ''; + this.width = width(options.stdout || process.stdout); + Object.assign(this, options); + this.name = this.name || this.message; + this.message = this.message || this.name; + this.symbols = prompt.symbols; + this.styles = prompt.styles; + this.required = new Set(); + this.cancelled = false; + this.submitted = false; + } + + clone() { + let state = { ...this }; + state.status = this.status; + state.buffer = Buffer.from(state.buffer); + delete state.clone; + return state; + } + + set color(val) { + this._color = val; + } + get color() { + let styles = this.prompt.styles; + if (this.cancelled) return styles.cancelled; + if (this.submitted) return styles.submitted; + let color = this._color || styles[this.status]; + return typeof color === 'function' ? color : styles.pending; + } + + set loading(value) { + this._loading = value; + } + get loading() { + if (typeof this._loading === 'boolean') return this._loading; + if (this.loadingChoices) return 'choices'; + return false; + } + + get status() { + if (this.cancelled) return 'cancelled'; + if (this.submitted) return 'submitted'; + return 'pending'; + } +} + +module.exports = State; diff --git a/node_modules/enquirer/lib/styles.js b/node_modules/enquirer/lib/styles.js new file mode 100644 index 000000000..0a177f429 --- /dev/null +++ b/node_modules/enquirer/lib/styles.js @@ -0,0 +1,144 @@ +'use strict'; + +const utils = require('./utils'); +const colors = require('ansi-colors'); + +const styles = { + default: colors.noop, + noop: colors.noop, + + /** + * Modifiers + */ + + set inverse(custom) { + this._inverse = custom; + }, + get inverse() { + return this._inverse || utils.inverse(this.primary); + }, + + set complement(custom) { + this._complement = custom; + }, + get complement() { + return this._complement || utils.complement(this.primary); + }, + + /** + * Main color + */ + + primary: colors.cyan, + + /** + * Main palette + */ + + success: colors.green, + danger: colors.magenta, + strong: colors.bold, + warning: colors.yellow, + muted: colors.dim, + disabled: colors.gray, + dark: colors.dim.gray, + underline: colors.underline, + + set info(custom) { + this._info = custom; + }, + get info() { + return this._info || this.primary; + }, + + set em(custom) { + this._em = custom; + }, + get em() { + return this._em || this.primary.underline; + }, + + set heading(custom) { + this._heading = custom; + }, + get heading() { + return this._heading || this.muted.underline; + }, + + /** + * Statuses + */ + + set pending(custom) { + this._pending = custom; + }, + get pending() { + return this._pending || this.primary; + }, + + set submitted(custom) { + this._submitted = custom; + }, + get submitted() { + return this._submitted || this.success; + }, + + set cancelled(custom) { + this._cancelled = custom; + }, + get cancelled() { + return this._cancelled || this.danger; + }, + + /** + * Special styling + */ + + set typing(custom) { + this._typing = custom; + }, + get typing() { + return this._typing || this.dim; + }, + + set placeholder(custom) { + this._placeholder = custom; + }, + get placeholder() { + return this._placeholder || this.primary.dim; + }, + + set highlight(custom) { + this._highlight = custom; + }, + get highlight() { + return this._highlight || this.inverse; + } +}; + +styles.merge = (options = {}) => { + if (options.styles && typeof options.styles.enabled === 'boolean') { + colors.enabled = options.styles.enabled; + } + if (options.styles && typeof options.styles.visible === 'boolean') { + colors.visible = options.styles.visible; + } + + let result = utils.merge({}, styles, options.styles); + delete result.merge; + + for (let key of Object.keys(colors)) { + if (!result.hasOwnProperty(key)) { + Reflect.defineProperty(result, key, { get: () => colors[key] }); + } + } + + for (let key of Object.keys(colors.styles)) { + if (!result.hasOwnProperty(key)) { + Reflect.defineProperty(result, key, { get: () => colors[key] }); + } + } + return result; +}; + +module.exports = styles; diff --git a/node_modules/enquirer/lib/symbols.js b/node_modules/enquirer/lib/symbols.js new file mode 100644 index 000000000..16adb8690 --- /dev/null +++ b/node_modules/enquirer/lib/symbols.js @@ -0,0 +1,66 @@ +'use strict'; + +const isWindows = process.platform === 'win32'; +const colors = require('ansi-colors'); +const utils = require('./utils'); + +const symbols = { + ...colors.symbols, + upDownDoubleArrow: '⇕', + upDownDoubleArrow2: '⬍', + upDownArrow: '↕', + asterisk: '*', + asterism: '⁂', + bulletWhite: '◦', + electricArrow: '⌁', + ellipsisLarge: '⋯', + ellipsisSmall: '…', + fullBlock: '█', + identicalTo: '≡', + indicator: colors.symbols.check, + leftAngle: '‹', + mark: '※', + minus: '−', + multiplication: '×', + obelus: '÷', + percent: '%', + pilcrow: '¶', + pilcrow2: '❡', + pencilUpRight: '✐', + pencilDownRight: '✎', + pencilRight: '✏', + plus: '+', + plusMinus: '±', + pointRight: '☞', + rightAngle: '›', + section: '§', + hexagon: { off: '⬡', on: '⬢', disabled: '⬢' }, + ballot: { on: '☑', off: '☐', disabled: '☒' }, + stars: { on: '★', off: '☆', disabled: '☆' }, + folder: { on: '▼', off: '▶', disabled: '▶' }, + prefix: { + pending: colors.symbols.question, + submitted: colors.symbols.check, + cancelled: colors.symbols.cross + }, + separator: { + pending: colors.symbols.pointerSmall, + submitted: colors.symbols.middot, + cancelled: colors.symbols.middot + }, + radio: { + off: isWindows ? '( )' : '◯', + on: isWindows ? '(*)' : '◉', + disabled: isWindows ? '(|)' : 'Ⓘ' + }, + numbers: ['⓪', '①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩', '⑪', '⑫', '⑬', '⑭', '⑮', '⑯', '⑰', '⑱', '⑲', '⑳', '㉑', '㉒', '㉓', '㉔', '㉕', '㉖', '㉗', '㉘', '㉙', '㉚', '㉛', '㉜', '㉝', '㉞', '㉟', '㊱', '㊲', '㊳', '㊴', '㊵', '㊶', '㊷', '㊸', '㊹', '㊺', '㊻', '㊼', '㊽', '㊾', '㊿'] +}; + +symbols.merge = options => { + let result = utils.merge({}, colors.symbols, symbols, options.symbols); + delete result.merge; + return result; +}; + +module.exports = symbols; + diff --git a/node_modules/enquirer/lib/theme.js b/node_modules/enquirer/lib/theme.js new file mode 100644 index 000000000..f9c642ac5 --- /dev/null +++ b/node_modules/enquirer/lib/theme.js @@ -0,0 +1,11 @@ +'use strict'; + +const styles = require('./styles'); +const symbols = require('./symbols'); +const utils = require('./utils'); + +module.exports = prompt => { + prompt.options = utils.merge({}, prompt.options.theme, prompt.options); + prompt.symbols = symbols.merge(prompt.options); + prompt.styles = styles.merge(prompt.options); +}; diff --git a/node_modules/enquirer/lib/timer.js b/node_modules/enquirer/lib/timer.js new file mode 100644 index 000000000..564998b3a --- /dev/null +++ b/node_modules/enquirer/lib/timer.js @@ -0,0 +1,38 @@ +'use strict'; + +module.exports = prompt => { + prompt.timers = prompt.timers || {}; + + let timers = prompt.options.timers; + if (!timers) return; + + for (let key of Object.keys(timers)) { + let opts = timers[key]; + if (typeof opts === 'number') { + opts = { interval: opts }; + } + create(prompt, key, opts); + } +}; + +function create(prompt, name, options = {}) { + let timer = prompt.timers[name] = { name, start: Date.now(), ms: 0, tick: 0 }; + let ms = options.interval || 120; + timer.frames = options.frames || []; + timer.loading = true; + + let interval = setInterval(() => { + timer.ms = Date.now() - timer.start; + timer.tick++; + prompt.render(); + }, ms); + + timer.stop = () => { + timer.loading = false; + clearInterval(interval); + }; + + Reflect.defineProperty(timer, 'interval', { value: interval }); + prompt.once('close', () => timer.stop()); + return timer.stop; +} diff --git a/node_modules/enquirer/lib/types/array.js b/node_modules/enquirer/lib/types/array.js new file mode 100644 index 000000000..0a522cb20 --- /dev/null +++ b/node_modules/enquirer/lib/types/array.js @@ -0,0 +1,658 @@ +'use strict'; + +const colors = require('ansi-colors'); +const Prompt = require('../prompt'); +const roles = require('../roles'); +const utils = require('../utils'); +const { reorder, scrollUp, scrollDown, isObject, swap } = utils; + +class ArrayPrompt extends Prompt { + constructor(options) { + super(options); + this.cursorHide(); + this.maxSelected = options.maxSelected || Infinity; + this.multiple = options.multiple || false; + this.initial = options.initial || 0; + this.delay = options.delay || 0; + this.longest = 0; + this.num = ''; + } + + async initialize() { + if (typeof this.options.initial === 'function') { + this.initial = await this.options.initial.call(this); + } + await this.reset(true); + await super.initialize(); + } + + async reset() { + let { choices, initial, autofocus, suggest } = this.options; + this.state._choices = []; + this.state.choices = []; + + this.choices = await Promise.all(await this.toChoices(choices)); + this.choices.forEach(ch => (ch.enabled = false)); + + if (typeof suggest !== 'function' && this.selectable.length === 0) { + throw new Error('At least one choice must be selectable'); + } + + if (isObject(initial)) initial = Object.keys(initial); + if (Array.isArray(initial)) { + if (autofocus != null) this.index = this.findIndex(autofocus); + initial.forEach(v => this.enable(this.find(v))); + await this.render(); + } else { + if (autofocus != null) initial = autofocus; + if (typeof initial === 'string') initial = this.findIndex(initial); + if (typeof initial === 'number' && initial > -1) { + this.index = Math.max(0, Math.min(initial, this.choices.length)); + this.enable(this.find(this.index)); + } + } + + if (this.isDisabled(this.focused)) { + await this.down(); + } + } + + async toChoices(value, parent) { + this.state.loadingChoices = true; + let choices = []; + let index = 0; + + let toChoices = async(items, parent) => { + if (typeof items === 'function') items = await items.call(this); + if (items instanceof Promise) items = await items; + + for (let i = 0; i < items.length; i++) { + let choice = items[i] = await this.toChoice(items[i], index++, parent); + choices.push(choice); + + if (choice.choices) { + await toChoices(choice.choices, choice); + } + } + return choices; + }; + + return toChoices(value, parent) + .then(choices => { + this.state.loadingChoices = false; + return choices; + }); + } + + async toChoice(ele, i, parent) { + if (typeof ele === 'function') ele = await ele.call(this, this); + if (ele instanceof Promise) ele = await ele; + if (typeof ele === 'string') ele = { name: ele }; + + if (ele.normalized) return ele; + ele.normalized = true; + + let origVal = ele.value; + let role = roles(ele.role, this.options); + ele = role(this, ele); + + if (typeof ele.disabled === 'string' && !ele.hint) { + ele.hint = ele.disabled; + ele.disabled = true; + } + + if (ele.disabled === true && ele.hint == null) { + ele.hint = '(disabled)'; + } + + // if the choice was already normalized, return it + if (ele.index != null) return ele; + ele.name = ele.name || ele.key || ele.title || ele.value || ele.message; + ele.message = ele.message || ele.name || ''; + ele.value = [ele.value, ele.name].find(this.isValue.bind(this)); + + ele.input = ''; + ele.index = i; + ele.cursor = 0; + + utils.define(ele, 'parent', parent); + ele.level = parent ? parent.level + 1 : 1; + if (ele.indent == null) { + ele.indent = parent ? parent.indent + ' ' : (ele.indent || ''); + } + + ele.path = parent ? parent.path + '.' + ele.name : ele.name; + ele.enabled = !!(this.multiple && !this.isDisabled(ele) && (ele.enabled || this.isSelected(ele))); + + if (!this.isDisabled(ele)) { + this.longest = Math.max(this.longest, colors.unstyle(ele.message).length); + } + + // shallow clone the choice first + let choice = { ...ele }; + + // then allow the choice to be reset using the "original" values + ele.reset = (input = choice.input, value = choice.value) => { + for (let key of Object.keys(choice)) ele[key] = choice[key]; + ele.input = input; + ele.value = value; + }; + + if (origVal == null && typeof ele.initial === 'function') { + ele.input = await ele.initial.call(this, this.state, ele, i); + } + + return ele; + } + + async onChoice(choice, i) { + this.emit('choice', choice, i, this); + + if (typeof choice.onChoice === 'function') { + await choice.onChoice.call(this, this.state, choice, i); + } + } + + async addChoice(ele, i, parent) { + let choice = await this.toChoice(ele, i, parent); + this.choices.push(choice); + this.index = this.choices.length - 1; + this.limit = this.choices.length; + return choice; + } + + async newItem(item, i, parent) { + let ele = { name: 'New choice name?', editable: true, newChoice: true, ...item }; + let choice = await this.addChoice(ele, i, parent); + + choice.updateChoice = () => { + delete choice.newChoice; + choice.name = choice.message = choice.input; + choice.input = ''; + choice.cursor = 0; + }; + + return this.render(); + } + + indent(choice) { + if (choice.indent == null) { + return choice.level > 1 ? ' '.repeat(choice.level - 1) : ''; + } + return choice.indent; + } + + dispatch(s, key) { + if (this.multiple && this[key.name]) return this[key.name](); + this.alert(); + } + + focus(choice, enabled) { + if (typeof enabled !== 'boolean') enabled = choice.enabled; + if (enabled && !choice.enabled && this.selected.length >= this.maxSelected) { + return this.alert(); + } + this.index = choice.index; + choice.enabled = enabled && !this.isDisabled(choice); + return choice; + } + + space() { + if (!this.multiple) return this.alert(); + this.toggle(this.focused); + return this.render(); + } + + a() { + if (this.maxSelected < this.choices.length) return this.alert(); + let enabled = this.selectable.every(ch => ch.enabled); + this.choices.forEach(ch => (ch.enabled = !enabled)); + return this.render(); + } + + i() { + // don't allow choices to be inverted if it will result in + // more than the maximum number of allowed selected items. + if (this.choices.length - this.selected.length > this.maxSelected) { + return this.alert(); + } + this.choices.forEach(ch => (ch.enabled = !ch.enabled)); + return this.render(); + } + + g(choice = this.focused) { + if (!this.choices.some(ch => !!ch.parent)) return this.a(); + this.toggle((choice.parent && !choice.choices) ? choice.parent : choice); + return this.render(); + } + + toggle(choice, enabled) { + if (!choice.enabled && this.selected.length >= this.maxSelected) { + return this.alert(); + } + + if (typeof enabled !== 'boolean') enabled = !choice.enabled; + choice.enabled = enabled; + + if (choice.choices) { + choice.choices.forEach(ch => this.toggle(ch, enabled)); + } + + let parent = choice.parent; + while (parent) { + let choices = parent.choices.filter(ch => this.isDisabled(ch)); + parent.enabled = choices.every(ch => ch.enabled === true); + parent = parent.parent; + } + + reset(this, this.choices); + this.emit('toggle', choice, this); + return choice; + } + + enable(choice) { + if (this.selected.length >= this.maxSelected) return this.alert(); + choice.enabled = !this.isDisabled(choice); + choice.choices && choice.choices.forEach(this.enable.bind(this)); + return choice; + } + + disable(choice) { + choice.enabled = false; + choice.choices && choice.choices.forEach(this.disable.bind(this)); + return choice; + } + + number(n) { + this.num += n; + + let number = num => { + let i = Number(num); + if (i > this.choices.length - 1) return this.alert(); + + let focused = this.focused; + let choice = this.choices.find(ch => i === ch.index); + + if (!choice.enabled && this.selected.length >= this.maxSelected) { + return this.alert(); + } + + if (this.visible.indexOf(choice) === -1) { + let choices = reorder(this.choices); + let actualIdx = choices.indexOf(choice); + + if (focused.index > actualIdx) { + let start = choices.slice(actualIdx, actualIdx + this.limit); + let end = choices.filter(ch => !start.includes(ch)); + this.choices = start.concat(end); + } else { + let pos = actualIdx - this.limit + 1; + this.choices = choices.slice(pos).concat(choices.slice(0, pos)); + } + } + + this.index = this.choices.indexOf(choice); + this.toggle(this.focused); + return this.render(); + }; + + clearTimeout(this.numberTimeout); + + return new Promise(resolve => { + let len = this.choices.length; + let num = this.num; + + let handle = (val = false, res) => { + clearTimeout(this.numberTimeout); + if (val) res = number(num); + this.num = ''; + resolve(res); + }; + + if (num === '0' || (num.length === 1 && Number(num + '0') > len)) { + return handle(true); + } + + if (Number(num) > len) { + return handle(false, this.alert()); + } + + this.numberTimeout = setTimeout(() => handle(true), this.delay); + }); + } + + home() { + this.choices = reorder(this.choices); + this.index = 0; + return this.render(); + } + + end() { + let pos = this.choices.length - this.limit; + let choices = reorder(this.choices); + this.choices = choices.slice(pos).concat(choices.slice(0, pos)); + this.index = this.limit - 1; + return this.render(); + } + + first() { + this.index = 0; + return this.render(); + } + + last() { + this.index = this.visible.length - 1; + return this.render(); + } + + prev() { + if (this.visible.length <= 1) return this.alert(); + return this.up(); + } + + next() { + if (this.visible.length <= 1) return this.alert(); + return this.down(); + } + + right() { + if (this.cursor >= this.input.length) return this.alert(); + this.cursor++; + return this.render(); + } + + left() { + if (this.cursor <= 0) return this.alert(); + this.cursor--; + return this.render(); + } + + up() { + let len = this.choices.length; + let vis = this.visible.length; + let idx = this.index; + if (this.options.scroll === false && idx === 0) { + return this.alert(); + } + if (len > vis && idx === 0) { + return this.scrollUp(); + } + this.index = ((idx - 1 % len) + len) % len; + if (this.isDisabled()) { + return this.up(); + } + return this.render(); + } + + down() { + let len = this.choices.length; + let vis = this.visible.length; + let idx = this.index; + if (this.options.scroll === false && idx === vis - 1) { + return this.alert(); + } + if (len > vis && idx === vis - 1) { + return this.scrollDown(); + } + this.index = (idx + 1) % len; + if (this.isDisabled()) { + return this.down(); + } + return this.render(); + } + + scrollUp(i = 0) { + this.choices = scrollUp(this.choices); + this.index = i; + if (this.isDisabled()) { + return this.up(); + } + return this.render(); + } + + scrollDown(i = this.visible.length - 1) { + this.choices = scrollDown(this.choices); + this.index = i; + if (this.isDisabled()) { + return this.down(); + } + return this.render(); + } + + async shiftUp() { + if (this.options.sort === true) { + this.sorting = true; + this.swap(this.index - 1); + await this.up(); + this.sorting = false; + return; + } + return this.scrollUp(this.index); + } + + async shiftDown() { + if (this.options.sort === true) { + this.sorting = true; + this.swap(this.index + 1); + await this.down(); + this.sorting = false; + return; + } + return this.scrollDown(this.index); + } + + pageUp() { + if (this.visible.length <= 1) return this.alert(); + this.limit = Math.max(this.limit - 1, 0); + this.index = Math.min(this.limit - 1, this.index); + this._limit = this.limit; + if (this.isDisabled()) { + return this.up(); + } + return this.render(); + } + + pageDown() { + if (this.visible.length >= this.choices.length) return this.alert(); + this.index = Math.max(0, this.index); + this.limit = Math.min(this.limit + 1, this.choices.length); + this._limit = this.limit; + if (this.isDisabled()) { + return this.down(); + } + return this.render(); + } + + swap(pos) { + swap(this.choices, this.index, pos); + } + + isDisabled(choice = this.focused) { + let keys = ['disabled', 'collapsed', 'hidden', 'completing', 'readonly']; + if (choice && keys.some(key => choice[key] === true)) { + return true; + } + return choice && choice.role === 'heading'; + } + + isEnabled(choice = this.focused) { + if (Array.isArray(choice)) return choice.every(ch => this.isEnabled(ch)); + if (choice.choices) { + let choices = choice.choices.filter(ch => !this.isDisabled(ch)); + return choice.enabled && choices.every(ch => this.isEnabled(ch)); + } + return choice.enabled && !this.isDisabled(choice); + } + + isChoice(choice, value) { + return choice.name === value || choice.index === Number(value); + } + + isSelected(choice) { + if (Array.isArray(this.initial)) { + return this.initial.some(value => this.isChoice(choice, value)); + } + return this.isChoice(choice, this.initial); + } + + map(names = [], prop = 'value') { + return [].concat(names || []).reduce((acc, name) => { + acc[name] = this.find(name, prop); + return acc; + }, {}); + } + + filter(value, prop) { + let isChoice = (ele, i) => [ele.name, i].includes(value); + let fn = typeof value === 'function' ? value : isChoice; + let choices = this.options.multiple ? this.state._choices : this.choices; + let result = choices.filter(fn); + if (prop) { + return result.map(ch => ch[prop]); + } + return result; + } + + find(value, prop) { + if (isObject(value)) return prop ? value[prop] : value; + let isChoice = (ele, i) => [ele.name, i].includes(value); + let fn = typeof value === 'function' ? value : isChoice; + let choice = this.choices.find(fn); + if (choice) { + return prop ? choice[prop] : choice; + } + } + + findIndex(value) { + return this.choices.indexOf(this.find(value)); + } + + async submit() { + let choice = this.focused; + if (!choice) return this.alert(); + + if (choice.newChoice) { + if (!choice.input) return this.alert(); + choice.updateChoice(); + return this.render(); + } + + if (this.choices.some(ch => ch.newChoice)) { + return this.alert(); + } + + let { reorder, sort } = this.options; + let multi = this.multiple === true; + let value = this.selected; + if (value === void 0) { + return this.alert(); + } + + // re-sort choices to original order + if (Array.isArray(value) && reorder !== false && sort !== true) { + value = utils.reorder(value); + } + + this.value = multi ? value.map(ch => ch.name) : value.name; + return super.submit(); + } + + set choices(choices = []) { + this.state._choices = this.state._choices || []; + this.state.choices = choices; + + for (let choice of choices) { + if (!this.state._choices.some(ch => ch.name === choice.name)) { + this.state._choices.push(choice); + } + } + + if (!this._initial && this.options.initial) { + this._initial = true; + let init = this.initial; + if (typeof init === 'string' || typeof init === 'number') { + let choice = this.find(init); + if (choice) { + this.initial = choice.index; + this.focus(choice, true); + } + } + } + } + get choices() { + return reset(this, this.state.choices || []); + } + + set visible(visible) { + this.state.visible = visible; + } + get visible() { + return (this.state.visible || this.choices).slice(0, this.limit); + } + + set limit(num) { + this.state.limit = num; + } + get limit() { + let { state, options, choices } = this; + let limit = state.limit || this._limit || options.limit || choices.length; + return Math.min(limit, this.height); + } + + set value(value) { + super.value = value; + } + get value() { + if (typeof super.value !== 'string' && super.value === this.initial) { + return this.input; + } + return super.value; + } + + set index(i) { + this.state.index = i; + } + get index() { + return Math.max(0, this.state ? this.state.index : 0); + } + + get enabled() { + return this.filter(this.isEnabled.bind(this)); + } + + get focused() { + let choice = this.choices[this.index]; + if (choice && this.state.submitted && this.multiple !== true) { + choice.enabled = true; + } + return choice; + } + + get selectable() { + return this.choices.filter(choice => !this.isDisabled(choice)); + } + + get selected() { + return this.multiple ? this.enabled : this.focused; + } +} + +function reset(prompt, choices) { + if (choices instanceof Promise) return choices; + if (typeof choices === 'function') { + if (utils.isAsyncFn(choices)) return choices; + choices = choices.call(prompt, prompt); + } + for (let choice of choices) { + if (Array.isArray(choice.choices)) { + let items = choice.choices.filter(ch => !prompt.isDisabled(ch)); + choice.enabled = items.every(ch => ch.enabled === true); + } + if (prompt.isDisabled(choice) === true) { + delete choice.enabled; + } + } + return choices; +} + +module.exports = ArrayPrompt; diff --git a/node_modules/enquirer/lib/types/auth.js b/node_modules/enquirer/lib/types/auth.js new file mode 100644 index 000000000..c2c66fae9 --- /dev/null +++ b/node_modules/enquirer/lib/types/auth.js @@ -0,0 +1,29 @@ +'use strict'; + +const FormPrompt = require('../prompts/form'); + +const defaultAuthenticate = () => { + throw new Error('expected prompt to have a custom authenticate method'); +}; + +const factory = (authenticate = defaultAuthenticate) => { + + class AuthPrompt extends FormPrompt { + constructor(options) { + super(options); + } + + async submit() { + this.value = await authenticate.call(this, this.values, this.state); + super.base.submit.call(this); + } + + static create(authenticate) { + return factory(authenticate); + } + } + + return AuthPrompt; +}; + +module.exports = factory(); diff --git a/node_modules/enquirer/lib/types/boolean.js b/node_modules/enquirer/lib/types/boolean.js new file mode 100644 index 000000000..d3e7f3408 --- /dev/null +++ b/node_modules/enquirer/lib/types/boolean.js @@ -0,0 +1,88 @@ +'use strict'; + +const Prompt = require('../prompt'); +const { isPrimitive, hasColor } = require('../utils'); + +class BooleanPrompt extends Prompt { + constructor(options) { + super(options); + this.cursorHide(); + } + + async initialize() { + let initial = await this.resolve(this.initial, this.state); + this.input = await this.cast(initial); + await super.initialize(); + } + + dispatch(ch) { + if (!this.isValue(ch)) return this.alert(); + this.input = ch; + return this.submit(); + } + + format(value) { + let { styles, state } = this; + return !state.submitted ? styles.primary(value) : styles.success(value); + } + + cast(input) { + return this.isTrue(input); + } + + isTrue(input) { + return /^[ty1]/i.test(input); + } + + isFalse(input) { + return /^[fn0]/i.test(input); + } + + isValue(value) { + return isPrimitive(value) && (this.isTrue(value) || this.isFalse(value)); + } + + async hint() { + if (this.state.status === 'pending') { + let hint = await this.element('hint'); + if (!hasColor(hint)) { + return this.styles.muted(hint); + } + return hint; + } + } + + async render() { + let { input, size } = this.state; + + let prefix = await this.prefix(); + let sep = await this.separator(); + let msg = await this.message(); + let hint = this.styles.muted(this.default); + + let promptLine = [prefix, msg, hint, sep].filter(Boolean).join(' '); + this.state.prompt = promptLine; + + let header = await this.header(); + let value = this.value = this.cast(input); + let output = await this.format(value); + let help = (await this.error()) || (await this.hint()); + let footer = await this.footer(); + + if (help && !promptLine.includes(help)) output += ' ' + help; + promptLine += ' ' + output; + + this.clear(size); + this.write([header, promptLine, footer].filter(Boolean).join('\n')); + this.restore(); + } + + set value(value) { + super.value = value; + } + get value() { + return this.cast(super.value); + } +} + +module.exports = BooleanPrompt; diff --git a/node_modules/enquirer/lib/types/index.js b/node_modules/enquirer/lib/types/index.js new file mode 100644 index 000000000..b3a2300d8 --- /dev/null +++ b/node_modules/enquirer/lib/types/index.js @@ -0,0 +1,7 @@ +module.exports = { + ArrayPrompt: require('./array'), + AuthPrompt: require('./auth'), + BooleanPrompt: require('./boolean'), + NumberPrompt: require('./number'), + StringPrompt: require('./string') +}; diff --git a/node_modules/enquirer/lib/types/number.js b/node_modules/enquirer/lib/types/number.js new file mode 100644 index 000000000..199a7c99a --- /dev/null +++ b/node_modules/enquirer/lib/types/number.js @@ -0,0 +1,86 @@ +'use strict'; + +const StringPrompt = require('./string'); + +class NumberPrompt extends StringPrompt { + constructor(options = {}) { + super({ style: 'number', ...options }); + this.min = this.isValue(options.min) ? this.toNumber(options.min) : -Infinity; + this.max = this.isValue(options.max) ? this.toNumber(options.max) : Infinity; + this.delay = options.delay != null ? options.delay : 1000; + this.float = options.float !== false; + this.round = options.round === true || options.float === false; + this.major = options.major || 10; + this.minor = options.minor || 1; + this.initial = options.initial != null ? options.initial : ''; + this.input = String(this.initial); + this.cursor = this.input.length; + this.cursorShow(); + } + + append(ch) { + if (!/[-+.]/.test(ch) || (ch === '.' && this.input.includes('.'))) { + return this.alert('invalid number'); + } + return super.append(ch); + } + + number(ch) { + return super.append(ch); + } + + next() { + if (this.input && this.input !== this.initial) return this.alert(); + if (!this.isValue(this.initial)) return this.alert(); + this.input = this.initial; + this.cursor = String(this.initial).length; + return this.render(); + } + + up(number) { + let step = number || this.minor; + let num = this.toNumber(this.input); + if (num > this.max + step) return this.alert(); + this.input = `${num + step}`; + return this.render(); + } + + down(number) { + let step = number || this.minor; + let num = this.toNumber(this.input); + if (num < this.min - step) return this.alert(); + this.input = `${num - step}`; + return this.render(); + } + + shiftDown() { + return this.down(this.major); + } + + shiftUp() { + return this.up(this.major); + } + + format(input = this.input) { + if (typeof this.options.format === 'function') { + return this.options.format.call(this, input); + } + return this.styles.info(input); + } + + toNumber(value = '') { + return this.float ? +value : Math.round(+value); + } + + isValue(value) { + return /^[-+]?[0-9]+((\.)|(\.[0-9]+))?$/.test(value); + } + + submit() { + let value = [this.input, this.initial].find(v => this.isValue(v)); + this.value = this.toNumber(value || 0); + return super.submit(); + } +} + +module.exports = NumberPrompt; diff --git a/node_modules/enquirer/lib/types/string.js b/node_modules/enquirer/lib/types/string.js new file mode 100644 index 000000000..d4e0ce9ad --- /dev/null +++ b/node_modules/enquirer/lib/types/string.js @@ -0,0 +1,185 @@ +'use strict'; + +const Prompt = require('../prompt'); +const placeholder = require('../placeholder'); +const { isPrimitive } = require('../utils'); + +class StringPrompt extends Prompt { + constructor(options) { + super(options); + this.initial = isPrimitive(this.initial) ? String(this.initial) : ''; + if (this.initial) this.cursorHide(); + this.state.prevCursor = 0; + this.state.clipboard = []; + } + + async keypress(input, key = {}) { + let prev = this.state.prevKeypress; + this.state.prevKeypress = key; + if (this.options.multiline === true && key.name === 'return') { + if (!prev || prev.name !== 'return') { + return this.append('\n', key); + } + } + return super.keypress(input, key); + } + + moveCursor(n) { + this.cursor += n; + } + + reset() { + this.input = this.value = ''; + this.cursor = 0; + return this.render(); + } + + dispatch(ch, key) { + if (!ch || key.ctrl || key.code) return this.alert(); + this.append(ch); + } + + append(ch) { + let { cursor, input } = this.state; + this.input = `${input}`.slice(0, cursor) + ch + `${input}`.slice(cursor); + this.moveCursor(String(ch).length); + this.render(); + } + + insert(str) { + this.append(str); + } + + delete() { + let { cursor, input } = this.state; + if (cursor <= 0) return this.alert(); + this.input = `${input}`.slice(0, cursor - 1) + `${input}`.slice(cursor); + this.moveCursor(-1); + this.render(); + } + + deleteForward() { + let { cursor, input } = this.state; + if (input[cursor] === void 0) return this.alert(); + this.input = `${input}`.slice(0, cursor) + `${input}`.slice(cursor + 1); + this.render(); + } + + cutForward() { + let pos = this.cursor; + if (this.input.length <= pos) return this.alert(); + this.state.clipboard.push(this.input.slice(pos)); + this.input = this.input.slice(0, pos); + this.render(); + } + + cutLeft() { + let pos = this.cursor; + if (pos === 0) return this.alert(); + let before = this.input.slice(0, pos); + let after = this.input.slice(pos); + let words = before.split(' '); + this.state.clipboard.push(words.pop()); + this.input = words.join(' '); + this.cursor = this.input.length; + this.input += after; + this.render(); + } + + paste() { + if (!this.state.clipboard.length) return this.alert(); + this.insert(this.state.clipboard.pop()); + this.render(); + } + + toggleCursor() { + if (this.state.prevCursor) { + this.cursor = this.state.prevCursor; + this.state.prevCursor = 0; + } else { + this.state.prevCursor = this.cursor; + this.cursor = 0; + } + this.render(); + } + + first() { + this.cursor = 0; + this.render(); + } + + last() { + this.cursor = this.input.length - 1; + this.render(); + } + + next() { + let init = this.initial != null ? String(this.initial) : ''; + if (!init || !init.startsWith(this.input)) return this.alert(); + this.input = this.initial; + this.cursor = this.initial.length; + this.render(); + } + + prev() { + if (!this.input) return this.alert(); + this.reset(); + } + + backward() { + return this.left(); + } + + forward() { + return this.right(); + } + + right() { + if (this.cursor >= this.input.length) return this.alert(); + this.moveCursor(1); + return this.render(); + } + + left() { + if (this.cursor <= 0) return this.alert(); + this.moveCursor(-1); + return this.render(); + } + + isValue(value) { + return !!value; + } + + async format(input = this.value) { + let initial = await this.resolve(this.initial, this.state); + if (!this.state.submitted) { + return placeholder(this, { input, initial, pos: this.cursor }); + } + return this.styles.submitted(input || initial); + } + + async render() { + let size = this.state.size; + + let prefix = await this.prefix(); + let separator = await this.separator(); + let message = await this.message(); + + let prompt = [prefix, message, separator].filter(Boolean).join(' '); + this.state.prompt = prompt; + + let header = await this.header(); + let output = await this.format(); + let help = (await this.error()) || (await this.hint()); + let footer = await this.footer(); + + if (help && !output.includes(help)) output += ' ' + help; + prompt += ' ' + output; + + this.clear(size); + this.write([header, prompt, footer].filter(Boolean).join('\n')); + this.restore(); + } +} + +module.exports = StringPrompt; diff --git a/node_modules/enquirer/lib/utils.js b/node_modules/enquirer/lib/utils.js new file mode 100644 index 000000000..7493c0d53 --- /dev/null +++ b/node_modules/enquirer/lib/utils.js @@ -0,0 +1,268 @@ +'use strict'; + +const toString = Object.prototype.toString; +const colors = require('ansi-colors'); +let called = false; +let fns = []; + +const complements = { + 'yellow': 'blue', + 'cyan': 'red', + 'green': 'magenta', + 'black': 'white', + 'blue': 'yellow', + 'red': 'cyan', + 'magenta': 'green', + 'white': 'black' +}; + +exports.longest = (arr, prop) => { + return arr.reduce((a, v) => Math.max(a, prop ? v[prop].length : v.length), 0); +}; + +exports.hasColor = str => !!str && colors.hasColor(str); + +const isObject = exports.isObject = val => { + return val !== null && typeof val === 'object' && !Array.isArray(val); +}; + +exports.nativeType = val => { + return toString.call(val).slice(8, -1).toLowerCase().replace(/\s/g, ''); +}; + +exports.isAsyncFn = val => { + return exports.nativeType(val) === 'asyncfunction'; +}; + +exports.isPrimitive = val => { + return val != null && typeof val !== 'object' && typeof val !== 'function'; +}; + +exports.resolve = (context, value, ...rest) => { + if (typeof value === 'function') { + return value.call(context, ...rest); + } + return value; +}; + +exports.scrollDown = (choices = []) => [...choices.slice(1), choices[0]]; +exports.scrollUp = (choices = []) => [choices.pop(), ...choices]; + +exports.reorder = (arr = []) => { + let res = arr.slice(); + res.sort((a, b) => { + if (a.index > b.index) return 1; + if (a.index < b.index) return -1; + return 0; + }); + return res; +}; + +exports.swap = (arr, index, pos) => { + let len = arr.length; + let idx = pos === len ? 0 : pos < 0 ? len - 1 : pos; + let choice = arr[index]; + arr[index] = arr[idx]; + arr[idx] = choice; +}; + +exports.width = (stream, fallback = 80) => { + let columns = (stream && stream.columns) ? stream.columns : fallback; + if (stream && typeof stream.getWindowSize === 'function') { + columns = stream.getWindowSize()[0]; + } + if (process.platform === 'win32') { + return columns - 1; + } + return columns; +}; + +exports.height = (stream, fallback = 20) => { + let rows = (stream && stream.rows) ? stream.rows : fallback; + if (stream && typeof stream.getWindowSize === 'function') { + rows = stream.getWindowSize()[1]; + } + return rows; +}; + +exports.wordWrap = (str, options = {}) => { + if (!str) return str; + + if (typeof options === 'number') { + options = { width: options }; + } + + let { indent = '', newline = ('\n' + indent), width = 80 } = options; + let spaces = (newline + indent).match(/[^\S\n]/g) || []; + width -= spaces.length; + let source = `.{1,${width}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`; + let output = str.trim(); + let regex = new RegExp(source, 'g'); + let lines = output.match(regex) || []; + lines = lines.map(line => line.replace(/\n$/, '')); + if (options.padEnd) lines = lines.map(line => line.padEnd(width, ' ')); + if (options.padStart) lines = lines.map(line => line.padStart(width, ' ')); + return indent + lines.join(newline); +}; + +exports.unmute = color => { + let name = color.stack.find(n => colors.keys.color.includes(n)); + if (name) { + return colors[name]; + } + let bg = color.stack.find(n => n.slice(2) === 'bg'); + if (bg) { + return colors[name.slice(2)]; + } + return str => str; +}; + +exports.pascal = str => str ? str[0].toUpperCase() + str.slice(1) : ''; + +exports.inverse = color => { + if (!color || !color.stack) return color; + let name = color.stack.find(n => colors.keys.color.includes(n)); + if (name) { + let col = colors['bg' + exports.pascal(name)]; + return col ? col.black : color; + } + let bg = color.stack.find(n => n.slice(0, 2) === 'bg'); + if (bg) { + return colors[bg.slice(2).toLowerCase()] || color; + } + return colors.none; +}; + +exports.complement = color => { + if (!color || !color.stack) return color; + let name = color.stack.find(n => colors.keys.color.includes(n)); + let bg = color.stack.find(n => n.slice(0, 2) === 'bg'); + if (name && !bg) { + return colors[complements[name] || name]; + } + if (bg) { + let lower = bg.slice(2).toLowerCase(); + let comp = complements[lower]; + if (!comp) return color; + return colors['bg' + exports.pascal(comp)] || color; + } + return colors.none; +}; + +exports.meridiem = date => { + let hours = date.getHours(); + let minutes = date.getMinutes(); + let ampm = hours >= 12 ? 'pm' : 'am'; + hours = hours % 12; + let hrs = hours === 0 ? 12 : hours; + let min = minutes < 10 ? '0' + minutes : minutes; + return hrs + ':' + min + ' ' + ampm; +}; + +/** + * Set a value on the given object. + * @param {Object} obj + * @param {String} prop + * @param {any} value + */ + +exports.set = (obj = {}, prop = '', val) => { + return prop.split('.').reduce((acc, k, i, arr) => { + let value = arr.length - 1 > i ? (acc[k] || {}) : val; + if (!exports.isObject(value) && i < arr.length - 1) value = {}; + return (acc[k] = value); + }, obj); +}; + +/** + * Get a value from the given object. + * @param {Object} obj + * @param {String} prop + */ + +exports.get = (obj = {}, prop = '', fallback) => { + let value = obj[prop] == null + ? prop.split('.').reduce((acc, k) => acc && acc[k], obj) + : obj[prop]; + return value == null ? fallback : value; +}; + +exports.mixin = (target, b) => { + if (!isObject(target)) return b; + if (!isObject(b)) return target; + for (let key of Object.keys(b)) { + let desc = Object.getOwnPropertyDescriptor(b, key); + if (desc.hasOwnProperty('value')) { + if (target.hasOwnProperty(key) && isObject(desc.value)) { + let existing = Object.getOwnPropertyDescriptor(target, key); + if (isObject(existing.value)) { + target[key] = exports.merge({}, target[key], b[key]); + } else { + Reflect.defineProperty(target, key, desc); + } + } else { + Reflect.defineProperty(target, key, desc); + } + } else { + Reflect.defineProperty(target, key, desc); + } + } + return target; +}; + +exports.merge = (...args) => { + let target = {}; + for (let ele of args) exports.mixin(target, ele); + return target; +}; + +exports.mixinEmitter = (obj, emitter) => { + let proto = emitter.constructor.prototype; + for (let key of Object.keys(proto)) { + let val = proto[key]; + if (typeof val === 'function') { + exports.define(obj, key, val.bind(emitter)); + } else { + exports.define(obj, key, val); + } + } +}; + +exports.onExit = callback => { + const onExit = (quit, code) => { + if (called) return; + + called = true; + fns.forEach(fn => fn()); + + if (quit === true) { + process.exit(128 + code); + } + }; + + if (fns.length === 0) { + process.once('SIGTERM', onExit.bind(null, true, 15)); + process.once('SIGINT', onExit.bind(null, true, 2)); + process.once('exit', onExit); + } + + fns.push(callback); +}; + +exports.define = (obj, key, value) => { + Reflect.defineProperty(obj, key, { value }); +}; + +exports.defineExport = (obj, key, fn) => { + let custom; + Reflect.defineProperty(obj, key, { + enumerable: true, + configurable: true, + set(val) { + custom = val; + }, + get() { + return custom ? custom() : fn(); + } + }); +}; diff --git a/node_modules/enquirer/package.json b/node_modules/enquirer/package.json new file mode 100644 index 000000000..f4815e037 --- /dev/null +++ b/node_modules/enquirer/package.json @@ -0,0 +1,111 @@ +{ + "name": "enquirer", + "description": "Stylish, intuitive and user-friendly prompt system. Fast and lightweight enough for small projects, powerful and extensible enough for the most advanced use cases.", + "version": "2.3.6", + "homepage": "https://github.com/enquirer/enquirer", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Brian Woodward (https://twitter.com/doowb)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)" + ], + "repository": "enquirer/enquirer", + "bugs": { + "url": "https://github.com/enquirer/enquirer/issues" + }, + "license": "MIT", + "files": [ + "index.js", + "index.d.ts", + "lib" + ], + "main": "index.js", + "engines": { + "node": ">=8.6" + }, + "scripts": { + "test": "mocha && tsc -p ./test/types", + "cover": "nyc --reporter=text --reporter=html mocha" + }, + "dependencies": { + "ansi-colors": "^4.1.1" + }, + "devDependencies": { + "@types/node": "^8", + "gulp-format-md": "^2.0.0", + "inquirer": "^6.2.0", + "mocha": "^5.2.0", + "nyc": "^13.1.0", + "prompts": "^1.2.1", + "time-require": "github:jonschlinkert/time-require", + "typescript": "^3.1.6" + }, + "keywords": [ + "answer", + "answers", + "ask", + "base", + "cli", + "command", + "command-line", + "confirm", + "enquirer", + "generator", + "generate", + "hyper", + "input", + "inquire", + "inquirer", + "interface", + "iterm", + "javascript", + "node", + "nodejs", + "prompt", + "prompts", + "promptly", + "question", + "readline", + "scaffold", + "scaffolding", + "scaffolder", + "stdin", + "stdout", + "terminal", + "tty", + "ui", + "yeoman", + "yo", + "zsh" + ], + "lintDeps": { + "devDependencies": { + "files": { + "patterns": [ + "examples/**/*.js", + "perf/*.js", + "recipes/*.js" + ] + } + } + }, + "verb": { + "toc": false, + "layout": false, + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "helpers": [ + "./docs/helpers.js" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "inquirer", + "prompt-skeleton" + ] + } +} \ No newline at end of file diff --git a/node_modules/es-abstract/.editorconfig b/node_modules/es-abstract/.editorconfig new file mode 100644 index 000000000..eaa214161 --- /dev/null +++ b/node_modules/es-abstract/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +indent_style = tab; +insert_final_newline = true; +quote_type = auto; +space_after_anonymous_functions = true; +space_after_control_statements = true; +spaces_around_operators = true; +trim_trailing_whitespace = true; +spaces_in_brackets = false; +end_of_line = lf; + diff --git a/node_modules/es-abstract/.eslintignore b/node_modules/es-abstract/.eslintignore new file mode 100644 index 000000000..4ebc8aea5 --- /dev/null +++ b/node_modules/es-abstract/.eslintignore @@ -0,0 +1 @@ +coverage diff --git a/node_modules/es-abstract/.eslintrc b/node_modules/es-abstract/.eslintrc new file mode 100644 index 000000000..1bac5b783 --- /dev/null +++ b/node_modules/es-abstract/.eslintrc @@ -0,0 +1,66 @@ +{ + "root": true, + + "extends": "@ljharb", + + "env": { + "es6": true, + }, + + "rules": { + "array-bracket-newline": 0, + "array-element-newline": 0, + "complexity": 0, + "eqeqeq": [2, "allow-null"], + "func-name-matching": 0, + "id-length": [2, { "min": 1, "max": 40 }], + "max-params": [2, 4], + "max-statements-per-line": [2, { "max": 2 }], + "multiline-comment-style": 0, + "no-magic-numbers": 0, + "new-cap": 0, + "no-extra-parens": 1, + "operator-linebreak": [2, "before"], + "sort-keys": 0, + }, + + "overrides": [ + { + "files": "operations/*", + "rules": { + "max-lines": 0, + }, + }, + { + "files": "operations/*.js", + "parserOptions": { + "ecmaVersion": 2020, + }, + "rules": { + "no-console": 0, + "no-multi-str": 0, + }, + }, + { + "files": "operations/getOps.js", + "rules": { + "no-console": 0, + "no-process-exit": 0, + }, + }, + { + "files": "test/**", + "rules": { + "id-length": 0, + "max-lines": 0, + "max-lines-per-function": 0, + "max-statements-per-line": [2, { "max": 3 }], + "max-statements": 0, + "no-implicit-coercion": 0, + "no-invalid-this": 1, + "object-curly-newline": 0, + "prefer-regex-literals": 0, + }, + }, + ], +} diff --git a/node_modules/es-abstract/.gitattributes b/node_modules/es-abstract/.gitattributes new file mode 100644 index 000000000..0b600dc54 --- /dev/null +++ b/node_modules/es-abstract/.gitattributes @@ -0,0 +1,472 @@ +2015/AbstractRelationalComparison.js spackled linguist-generated=true +2015/DateFromTime.js spackled linguist-generated=true +2015/Day.js spackled linguist-generated=true +2015/DayFromYear.js spackled linguist-generated=true +2015/DayWithinYear.js spackled linguist-generated=true +2015/DaysInYear.js spackled linguist-generated=true +2015/HourFromTime.js spackled linguist-generated=true +2015/InLeapYear.js spackled linguist-generated=true +2015/IsCallable.js spackled linguist-generated=true +2015/IsPropertyDescriptor.js spackled linguist-generated=true +2015/MakeDate.js spackled linguist-generated=true +2015/MakeDay.js spackled linguist-generated=true +2015/MakeTime.js spackled linguist-generated=true +2015/MinFromTime.js spackled linguist-generated=true +2015/MonthFromTime.js spackled linguist-generated=true +2015/SameValue.js spackled linguist-generated=true +2015/SecFromTime.js spackled linguist-generated=true +2015/StrictEqualityComparison.js spackled linguist-generated=true +2015/TimeClip.js spackled linguist-generated=true +2015/TimeFromYear.js spackled linguist-generated=true +2015/TimeWithinDay.js spackled linguist-generated=true +2015/ToBoolean.js spackled linguist-generated=true +2015/ToInt32.js spackled linguist-generated=true +2015/ToPropertyDescriptor.js spackled linguist-generated=true +2015/ToUint16.js spackled linguist-generated=true +2015/ToUint32.js spackled linguist-generated=true +2015/WeekDay.js spackled linguist-generated=true +2015/YearFromTime.js spackled linguist-generated=true +2015/modulo.js spackled linguist-generated=true +2015/msFromTime.js spackled linguist-generated=true +2016/AbstractEqualityComparison.js spackled linguist-generated=true +2016/AbstractRelationalComparison.js spackled linguist-generated=true +2016/AdvanceStringIndex.js spackled linguist-generated=true +2016/ArrayCreate.js spackled linguist-generated=true +2016/ArraySetLength.js spackled linguist-generated=true +2016/ArraySpeciesCreate.js spackled linguist-generated=true +2016/Call.js spackled linguist-generated=true +2016/CanonicalNumericIndexString.js spackled linguist-generated=true +2016/CompletePropertyDescriptor.js spackled linguist-generated=true +2016/CreateDataProperty.js spackled linguist-generated=true +2016/CreateDataPropertyOrThrow.js spackled linguist-generated=true +2016/CreateHTML.js spackled linguist-generated=true +2016/CreateIterResultObject.js spackled linguist-generated=true +2016/CreateListFromArrayLike.js spackled linguist-generated=true +2016/CreateMethodProperty.js spackled linguist-generated=true +2016/DateFromTime.js spackled linguist-generated=true +2016/Day.js spackled linguist-generated=true +2016/DayFromYear.js spackled linguist-generated=true +2016/DayWithinYear.js spackled linguist-generated=true +2016/DaysInYear.js spackled linguist-generated=true +2016/DefinePropertyOrThrow.js spackled linguist-generated=true +2016/DeletePropertyOrThrow.js spackled linguist-generated=true +2016/EnumerableOwnNames.js spackled linguist-generated=true +2016/FromPropertyDescriptor.js spackled linguist-generated=true +2016/Get.js spackled linguist-generated=true +2016/GetIterator.js spackled linguist-generated=true +2016/GetMethod.js spackled linguist-generated=true +2016/GetOwnPropertyKeys.js spackled linguist-generated=true +2016/GetPrototypeFromConstructor.js spackled linguist-generated=true +2016/GetSubstitution.js spackled linguist-generated=true +2016/GetV.js spackled linguist-generated=true +2016/HasOwnProperty.js spackled linguist-generated=true +2016/HasProperty.js spackled linguist-generated=true +2016/HourFromTime.js spackled linguist-generated=true +2016/InLeapYear.js spackled linguist-generated=true +2016/InstanceofOperator.js spackled linguist-generated=true +2016/Invoke.js spackled linguist-generated=true +2016/IsAccessorDescriptor.js spackled linguist-generated=true +2016/IsArray.js spackled linguist-generated=true +2016/IsCallable.js spackled linguist-generated=true +2016/IsConcatSpreadable.js spackled linguist-generated=true +2016/IsConstructor.js spackled linguist-generated=true +2016/IsDataDescriptor.js spackled linguist-generated=true +2016/IsExtensible.js spackled linguist-generated=true +2016/IsGenericDescriptor.js spackled linguist-generated=true +2016/IsInteger.js spackled linguist-generated=true +2016/IsPromise.js spackled linguist-generated=true +2016/IsPropertyDescriptor.js spackled linguist-generated=true +2016/IsPropertyKey.js spackled linguist-generated=true +2016/IsRegExp.js spackled linguist-generated=true +2016/IteratorClose.js spackled linguist-generated=true +2016/IteratorComplete.js spackled linguist-generated=true +2016/IteratorNext.js spackled linguist-generated=true +2016/IteratorStep.js spackled linguist-generated=true +2016/IteratorValue.js spackled linguist-generated=true +2016/MakeDate.js spackled linguist-generated=true +2016/MakeDay.js spackled linguist-generated=true +2016/MakeTime.js spackled linguist-generated=true +2016/MinFromTime.js spackled linguist-generated=true +2016/MonthFromTime.js spackled linguist-generated=true +2016/ObjectCreate.js spackled linguist-generated=true +2016/OrdinaryDefineOwnProperty.js spackled linguist-generated=true +2016/OrdinaryGetOwnProperty.js spackled linguist-generated=true +2016/OrdinaryHasInstance.js spackled linguist-generated=true +2016/OrdinaryHasProperty.js spackled linguist-generated=true +2016/RegExpExec.js spackled linguist-generated=true +2016/RequireObjectCoercible.js spackled linguist-generated=true +2016/SameValue.js spackled linguist-generated=true +2016/SameValueZero.js spackled linguist-generated=true +2016/SecFromTime.js spackled linguist-generated=true +2016/Set.js spackled linguist-generated=true +2016/SetFunctionName.js spackled linguist-generated=true +2016/SetIntegrityLevel.js spackled linguist-generated=true +2016/SpeciesConstructor.js spackled linguist-generated=true +2016/StrictEqualityComparison.js spackled linguist-generated=true +2016/SymbolDescriptiveString.js spackled linguist-generated=true +2016/TestIntegrityLevel.js spackled linguist-generated=true +2016/TimeClip.js spackled linguist-generated=true +2016/TimeFromYear.js spackled linguist-generated=true +2016/TimeWithinDay.js spackled linguist-generated=true +2016/ToBoolean.js spackled linguist-generated=true +2016/ToDateString.js spackled linguist-generated=true +2016/ToInt16.js spackled linguist-generated=true +2016/ToInt32.js spackled linguist-generated=true +2016/ToInt8.js spackled linguist-generated=true +2016/ToInteger.js spackled linguist-generated=true +2016/ToLength.js spackled linguist-generated=true +2016/ToNumber.js spackled linguist-generated=true +2016/ToObject.js spackled linguist-generated=true +2016/ToPrimitive.js spackled linguist-generated=true +2016/ToPropertyDescriptor.js spackled linguist-generated=true +2016/ToPropertyKey.js spackled linguist-generated=true +2016/ToString.js spackled linguist-generated=true +2016/ToUint16.js spackled linguist-generated=true +2016/ToUint32.js spackled linguist-generated=true +2016/ToUint8.js spackled linguist-generated=true +2016/ToUint8Clamp.js spackled linguist-generated=true +2016/Type.js spackled linguist-generated=true +2016/ValidateAndApplyPropertyDescriptor.js spackled linguist-generated=true +2016/WeekDay.js spackled linguist-generated=true +2016/YearFromTime.js spackled linguist-generated=true +2016/modulo.js spackled linguist-generated=true +2016/msFromTime.js spackled linguist-generated=true +2016/thisBooleanValue.js spackled linguist-generated=true +2016/thisNumberValue.js spackled linguist-generated=true +2016/thisStringValue.js spackled linguist-generated=true +2016/thisTimeValue.js spackled linguist-generated=true +2017/AbstractEqualityComparison.js spackled linguist-generated=true +2017/AbstractRelationalComparison.js spackled linguist-generated=true +2017/AdvanceStringIndex.js spackled linguist-generated=true +2017/ArrayCreate.js spackled linguist-generated=true +2017/ArraySetLength.js spackled linguist-generated=true +2017/ArraySpeciesCreate.js spackled linguist-generated=true +2017/Call.js spackled linguist-generated=true +2017/CanonicalNumericIndexString.js spackled linguist-generated=true +2017/CompletePropertyDescriptor.js spackled linguist-generated=true +2017/CreateDataProperty.js spackled linguist-generated=true +2017/CreateDataPropertyOrThrow.js spackled linguist-generated=true +2017/CreateHTML.js spackled linguist-generated=true +2017/CreateIterResultObject.js spackled linguist-generated=true +2017/CreateListFromArrayLike.js spackled linguist-generated=true +2017/CreateMethodProperty.js spackled linguist-generated=true +2017/DateFromTime.js spackled linguist-generated=true +2017/Day.js spackled linguist-generated=true +2017/DayFromYear.js spackled linguist-generated=true +2017/DayWithinYear.js spackled linguist-generated=true +2017/DaysInYear.js spackled linguist-generated=true +2017/DefinePropertyOrThrow.js spackled linguist-generated=true +2017/DeletePropertyOrThrow.js spackled linguist-generated=true +2017/FromPropertyDescriptor.js spackled linguist-generated=true +2017/Get.js spackled linguist-generated=true +2017/GetIterator.js spackled linguist-generated=true +2017/GetMethod.js spackled linguist-generated=true +2017/GetOwnPropertyKeys.js spackled linguist-generated=true +2017/GetPrototypeFromConstructor.js spackled linguist-generated=true +2017/GetSubstitution.js spackled linguist-generated=true +2017/GetV.js spackled linguist-generated=true +2017/HasOwnProperty.js spackled linguist-generated=true +2017/HasProperty.js spackled linguist-generated=true +2017/HourFromTime.js spackled linguist-generated=true +2017/InLeapYear.js spackled linguist-generated=true +2017/InstanceofOperator.js spackled linguist-generated=true +2017/Invoke.js spackled linguist-generated=true +2017/IsAccessorDescriptor.js spackled linguist-generated=true +2017/IsArray.js spackled linguist-generated=true +2017/IsCallable.js spackled linguist-generated=true +2017/IsConcatSpreadable.js spackled linguist-generated=true +2017/IsConstructor.js spackled linguist-generated=true +2017/IsDataDescriptor.js spackled linguist-generated=true +2017/IsExtensible.js spackled linguist-generated=true +2017/IsGenericDescriptor.js spackled linguist-generated=true +2017/IsInteger.js spackled linguist-generated=true +2017/IsPromise.js spackled linguist-generated=true +2017/IsPropertyDescriptor.js spackled linguist-generated=true +2017/IsPropertyKey.js spackled linguist-generated=true +2017/IsRegExp.js spackled linguist-generated=true +2017/IteratorClose.js spackled linguist-generated=true +2017/IteratorComplete.js spackled linguist-generated=true +2017/IteratorNext.js spackled linguist-generated=true +2017/IteratorStep.js spackled linguist-generated=true +2017/IteratorValue.js spackled linguist-generated=true +2017/MakeDate.js spackled linguist-generated=true +2017/MakeDay.js spackled linguist-generated=true +2017/MakeTime.js spackled linguist-generated=true +2017/MinFromTime.js spackled linguist-generated=true +2017/MonthFromTime.js spackled linguist-generated=true +2017/ObjectCreate.js spackled linguist-generated=true +2017/OrdinaryDefineOwnProperty.js spackled linguist-generated=true +2017/OrdinaryGetOwnProperty.js spackled linguist-generated=true +2017/OrdinaryGetPrototypeOf.js spackled linguist-generated=true +2017/OrdinaryHasInstance.js spackled linguist-generated=true +2017/OrdinaryHasProperty.js spackled linguist-generated=true +2017/OrdinarySetPrototypeOf.js spackled linguist-generated=true +2017/RegExpExec.js spackled linguist-generated=true +2017/RequireObjectCoercible.js spackled linguist-generated=true +2017/SameValue.js spackled linguist-generated=true +2017/SameValueNonNumber.js spackled linguist-generated=true +2017/SameValueZero.js spackled linguist-generated=true +2017/SecFromTime.js spackled linguist-generated=true +2017/Set.js spackled linguist-generated=true +2017/SetFunctionName.js spackled linguist-generated=true +2017/SetIntegrityLevel.js spackled linguist-generated=true +2017/SpeciesConstructor.js spackled linguist-generated=true +2017/StrictEqualityComparison.js spackled linguist-generated=true +2017/SymbolDescriptiveString.js spackled linguist-generated=true +2017/TestIntegrityLevel.js spackled linguist-generated=true +2017/TimeClip.js spackled linguist-generated=true +2017/TimeFromYear.js spackled linguist-generated=true +2017/TimeWithinDay.js spackled linguist-generated=true +2017/ToBoolean.js spackled linguist-generated=true +2017/ToDateString.js spackled linguist-generated=true +2017/ToInt16.js spackled linguist-generated=true +2017/ToInt32.js spackled linguist-generated=true +2017/ToInt8.js spackled linguist-generated=true +2017/ToInteger.js spackled linguist-generated=true +2017/ToLength.js spackled linguist-generated=true +2017/ToNumber.js spackled linguist-generated=true +2017/ToObject.js spackled linguist-generated=true +2017/ToPrimitive.js spackled linguist-generated=true +2017/ToPropertyDescriptor.js spackled linguist-generated=true +2017/ToPropertyKey.js spackled linguist-generated=true +2017/ToString.js spackled linguist-generated=true +2017/ToUint16.js spackled linguist-generated=true +2017/ToUint32.js spackled linguist-generated=true +2017/ToUint8.js spackled linguist-generated=true +2017/ToUint8Clamp.js spackled linguist-generated=true +2017/Type.js spackled linguist-generated=true +2017/ValidateAndApplyPropertyDescriptor.js spackled linguist-generated=true +2017/WeekDay.js spackled linguist-generated=true +2017/YearFromTime.js spackled linguist-generated=true +2017/modulo.js spackled linguist-generated=true +2017/msFromTime.js spackled linguist-generated=true +2017/thisBooleanValue.js spackled linguist-generated=true +2017/thisNumberValue.js spackled linguist-generated=true +2017/thisStringValue.js spackled linguist-generated=true +2017/thisTimeValue.js spackled linguist-generated=true +2018/AbstractEqualityComparison.js spackled linguist-generated=true +2018/AbstractRelationalComparison.js spackled linguist-generated=true +2018/AdvanceStringIndex.js spackled linguist-generated=true +2018/ArrayCreate.js spackled linguist-generated=true +2018/ArraySetLength.js spackled linguist-generated=true +2018/ArraySpeciesCreate.js spackled linguist-generated=true +2018/Call.js spackled linguist-generated=true +2018/CanonicalNumericIndexString.js spackled linguist-generated=true +2018/CompletePropertyDescriptor.js spackled linguist-generated=true +2018/CreateDataProperty.js spackled linguist-generated=true +2018/CreateDataPropertyOrThrow.js spackled linguist-generated=true +2018/CreateHTML.js spackled linguist-generated=true +2018/CreateIterResultObject.js spackled linguist-generated=true +2018/CreateListFromArrayLike.js spackled linguist-generated=true +2018/CreateMethodProperty.js spackled linguist-generated=true +2018/DateFromTime.js spackled linguist-generated=true +2018/Day.js spackled linguist-generated=true +2018/DayFromYear.js spackled linguist-generated=true +2018/DayWithinYear.js spackled linguist-generated=true +2018/DaysInYear.js spackled linguist-generated=true +2018/DefinePropertyOrThrow.js spackled linguist-generated=true +2018/DeletePropertyOrThrow.js spackled linguist-generated=true +2018/FromPropertyDescriptor.js spackled linguist-generated=true +2018/Get.js spackled linguist-generated=true +2018/GetIterator.js spackled linguist-generated=true +2018/GetMethod.js spackled linguist-generated=true +2018/GetOwnPropertyKeys.js spackled linguist-generated=true +2018/GetPrototypeFromConstructor.js spackled linguist-generated=true +2018/GetV.js spackled linguist-generated=true +2018/HasOwnProperty.js spackled linguist-generated=true +2018/HasProperty.js spackled linguist-generated=true +2018/HourFromTime.js spackled linguist-generated=true +2018/InLeapYear.js spackled linguist-generated=true +2018/InstanceofOperator.js spackled linguist-generated=true +2018/Invoke.js spackled linguist-generated=true +2018/IsAccessorDescriptor.js spackled linguist-generated=true +2018/IsArray.js spackled linguist-generated=true +2018/IsCallable.js spackled linguist-generated=true +2018/IsConcatSpreadable.js spackled linguist-generated=true +2018/IsConstructor.js spackled linguist-generated=true +2018/IsDataDescriptor.js spackled linguist-generated=true +2018/IsExtensible.js spackled linguist-generated=true +2018/IsGenericDescriptor.js spackled linguist-generated=true +2018/IsInteger.js spackled linguist-generated=true +2018/IsPromise.js spackled linguist-generated=true +2018/IsPropertyKey.js spackled linguist-generated=true +2018/IsRegExp.js spackled linguist-generated=true +2018/IterableToList.js spackled linguist-generated=true +2018/IteratorClose.js spackled linguist-generated=true +2018/IteratorComplete.js spackled linguist-generated=true +2018/IteratorNext.js spackled linguist-generated=true +2018/IteratorStep.js spackled linguist-generated=true +2018/IteratorValue.js spackled linguist-generated=true +2018/MakeDate.js spackled linguist-generated=true +2018/MakeDay.js spackled linguist-generated=true +2018/MakeTime.js spackled linguist-generated=true +2018/MinFromTime.js spackled linguist-generated=true +2018/MonthFromTime.js spackled linguist-generated=true +2018/ObjectCreate.js spackled linguist-generated=true +2018/OrdinaryDefineOwnProperty.js spackled linguist-generated=true +2018/OrdinaryGetOwnProperty.js spackled linguist-generated=true +2018/OrdinaryGetPrototypeOf.js spackled linguist-generated=true +2018/OrdinaryHasInstance.js spackled linguist-generated=true +2018/OrdinaryHasProperty.js spackled linguist-generated=true +2018/OrdinarySetPrototypeOf.js spackled linguist-generated=true +2018/RegExpExec.js spackled linguist-generated=true +2018/RequireObjectCoercible.js spackled linguist-generated=true +2018/SameValue.js spackled linguist-generated=true +2018/SameValueNonNumber.js spackled linguist-generated=true +2018/SameValueZero.js spackled linguist-generated=true +2018/SecFromTime.js spackled linguist-generated=true +2018/Set.js spackled linguist-generated=true +2018/SetFunctionName.js spackled linguist-generated=true +2018/SetIntegrityLevel.js spackled linguist-generated=true +2018/SpeciesConstructor.js spackled linguist-generated=true +2018/StrictEqualityComparison.js spackled linguist-generated=true +2018/SymbolDescriptiveString.js spackled linguist-generated=true +2018/TestIntegrityLevel.js spackled linguist-generated=true +2018/TimeClip.js spackled linguist-generated=true +2018/TimeFromYear.js spackled linguist-generated=true +2018/TimeWithinDay.js spackled linguist-generated=true +2018/ToBoolean.js spackled linguist-generated=true +2018/ToDateString.js spackled linguist-generated=true +2018/ToIndex.js spackled linguist-generated=true +2018/ToInt16.js spackled linguist-generated=true +2018/ToInt32.js spackled linguist-generated=true +2018/ToInt8.js spackled linguist-generated=true +2018/ToInteger.js spackled linguist-generated=true +2018/ToLength.js spackled linguist-generated=true +2018/ToNumber.js spackled linguist-generated=true +2018/ToObject.js spackled linguist-generated=true +2018/ToPrimitive.js spackled linguist-generated=true +2018/ToPropertyDescriptor.js spackled linguist-generated=true +2018/ToPropertyKey.js spackled linguist-generated=true +2018/ToString.js spackled linguist-generated=true +2018/ToUint16.js spackled linguist-generated=true +2018/ToUint32.js spackled linguist-generated=true +2018/ToUint8.js spackled linguist-generated=true +2018/ToUint8Clamp.js spackled linguist-generated=true +2018/Type.js spackled linguist-generated=true +2018/ValidateAndApplyPropertyDescriptor.js spackled linguist-generated=true +2018/WeekDay.js spackled linguist-generated=true +2018/YearFromTime.js spackled linguist-generated=true +2018/modulo.js spackled linguist-generated=true +2018/msFromTime.js spackled linguist-generated=true +2018/thisBooleanValue.js spackled linguist-generated=true +2018/thisNumberValue.js spackled linguist-generated=true +2018/thisStringValue.js spackled linguist-generated=true +2018/thisTimeValue.js spackled linguist-generated=true +2019/AbstractEqualityComparison.js spackled linguist-generated=true +2019/AbstractRelationalComparison.js spackled linguist-generated=true +2019/AdvanceStringIndex.js spackled linguist-generated=true +2019/ArrayCreate.js spackled linguist-generated=true +2019/ArraySetLength.js spackled linguist-generated=true +2019/ArraySpeciesCreate.js spackled linguist-generated=true +2019/Call.js spackled linguist-generated=true +2019/CanonicalNumericIndexString.js spackled linguist-generated=true +2019/CompletePropertyDescriptor.js spackled linguist-generated=true +2019/CopyDataProperties.js spackled linguist-generated=true +2019/CreateDataProperty.js spackled linguist-generated=true +2019/CreateDataPropertyOrThrow.js spackled linguist-generated=true +2019/CreateHTML.js spackled linguist-generated=true +2019/CreateIterResultObject.js spackled linguist-generated=true +2019/CreateListFromArrayLike.js spackled linguist-generated=true +2019/CreateMethodProperty.js spackled linguist-generated=true +2019/DateFromTime.js spackled linguist-generated=true +2019/DateString.js spackled linguist-generated=true +2019/Day.js spackled linguist-generated=true +2019/DayFromYear.js spackled linguist-generated=true +2019/DayWithinYear.js spackled linguist-generated=true +2019/DaysInYear.js spackled linguist-generated=true +2019/DefinePropertyOrThrow.js spackled linguist-generated=true +2019/DeletePropertyOrThrow.js spackled linguist-generated=true +2019/EnumerableOwnPropertyNames.js spackled linguist-generated=true +2019/FromPropertyDescriptor.js spackled linguist-generated=true +2019/Get.js spackled linguist-generated=true +2019/GetIterator.js spackled linguist-generated=true +2019/GetMethod.js spackled linguist-generated=true +2019/GetOwnPropertyKeys.js spackled linguist-generated=true +2019/GetPrototypeFromConstructor.js spackled linguist-generated=true +2019/GetSubstitution.js spackled linguist-generated=true +2019/GetV.js spackled linguist-generated=true +2019/HasOwnProperty.js spackled linguist-generated=true +2019/HasProperty.js spackled linguist-generated=true +2019/HourFromTime.js spackled linguist-generated=true +2019/InLeapYear.js spackled linguist-generated=true +2019/InstanceofOperator.js spackled linguist-generated=true +2019/Invoke.js spackled linguist-generated=true +2019/IsAccessorDescriptor.js spackled linguist-generated=true +2019/IsArray.js spackled linguist-generated=true +2019/IsCallable.js spackled linguist-generated=true +2019/IsConcatSpreadable.js spackled linguist-generated=true +2019/IsConstructor.js spackled linguist-generated=true +2019/IsDataDescriptor.js spackled linguist-generated=true +2019/IsExtensible.js spackled linguist-generated=true +2019/IsGenericDescriptor.js spackled linguist-generated=true +2019/IsInteger.js spackled linguist-generated=true +2019/IsPromise.js spackled linguist-generated=true +2019/IsPropertyKey.js spackled linguist-generated=true +2019/IsRegExp.js spackled linguist-generated=true +2019/IsStringPrefix.js spackled linguist-generated=true +2019/IterableToList.js spackled linguist-generated=true +2019/IteratorClose.js spackled linguist-generated=true +2019/IteratorComplete.js spackled linguist-generated=true +2019/IteratorNext.js spackled linguist-generated=true +2019/IteratorStep.js spackled linguist-generated=true +2019/IteratorValue.js spackled linguist-generated=true +2019/MakeDate.js spackled linguist-generated=true +2019/MakeDay.js spackled linguist-generated=true +2019/MakeTime.js spackled linguist-generated=true +2019/MinFromTime.js spackled linguist-generated=true +2019/MonthFromTime.js spackled linguist-generated=true +2019/NumberToString.js spackled linguist-generated=true +2019/ObjectCreate.js spackled linguist-generated=true +2019/OrdinaryDefineOwnProperty.js spackled linguist-generated=true +2019/OrdinaryGetOwnProperty.js spackled linguist-generated=true +2019/OrdinaryGetPrototypeOf.js spackled linguist-generated=true +2019/OrdinaryHasInstance.js spackled linguist-generated=true +2019/OrdinaryHasProperty.js spackled linguist-generated=true +2019/OrdinarySetPrototypeOf.js spackled linguist-generated=true +2019/PromiseResolve.js spackled linguist-generated=true +2019/RegExpExec.js spackled linguist-generated=true +2019/RequireObjectCoercible.js spackled linguist-generated=true +2019/SameValue.js spackled linguist-generated=true +2019/SameValueNonNumber.js spackled linguist-generated=true +2019/SameValueZero.js spackled linguist-generated=true +2019/SecFromTime.js spackled linguist-generated=true +2019/Set.js spackled linguist-generated=true +2019/SetFunctionName.js spackled linguist-generated=true +2019/SetIntegrityLevel.js spackled linguist-generated=true +2019/SpeciesConstructor.js spackled linguist-generated=true +2019/StrictEqualityComparison.js spackled linguist-generated=true +2019/SymbolDescriptiveString.js spackled linguist-generated=true +2019/TestIntegrityLevel.js spackled linguist-generated=true +2019/TimeClip.js spackled linguist-generated=true +2019/TimeFromYear.js spackled linguist-generated=true +2019/TimeString.js spackled linguist-generated=true +2019/TimeWithinDay.js spackled linguist-generated=true +2019/ToBoolean.js spackled linguist-generated=true +2019/ToDateString.js spackled linguist-generated=true +2019/ToIndex.js spackled linguist-generated=true +2019/ToInt16.js spackled linguist-generated=true +2019/ToInt32.js spackled linguist-generated=true +2019/ToInt8.js spackled linguist-generated=true +2019/ToInteger.js spackled linguist-generated=true +2019/ToLength.js spackled linguist-generated=true +2019/ToNumber.js spackled linguist-generated=true +2019/ToObject.js spackled linguist-generated=true +2019/ToPrimitive.js spackled linguist-generated=true +2019/ToPropertyDescriptor.js spackled linguist-generated=true +2019/ToPropertyKey.js spackled linguist-generated=true +2019/ToString.js spackled linguist-generated=true +2019/ToUint16.js spackled linguist-generated=true +2019/ToUint32.js spackled linguist-generated=true +2019/ToUint8.js spackled linguist-generated=true +2019/ToUint8Clamp.js spackled linguist-generated=true +2019/Type.js spackled linguist-generated=true +2019/ValidateAndApplyPropertyDescriptor.js spackled linguist-generated=true +2019/WeekDay.js spackled linguist-generated=true +2019/YearFromTime.js spackled linguist-generated=true +2019/modulo.js spackled linguist-generated=true +2019/msFromTime.js spackled linguist-generated=true +2019/thisBooleanValue.js spackled linguist-generated=true +2019/thisNumberValue.js spackled linguist-generated=true +2019/thisStringValue.js spackled linguist-generated=true +2019/thisSymbolValue.js spackled linguist-generated=true \ No newline at end of file diff --git a/node_modules/es-abstract/.github/FUNDING.yml b/node_modules/es-abstract/.github/FUNDING.yml new file mode 100644 index 000000000..beeb7a288 --- /dev/null +++ b/node_modules/es-abstract/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/es-abstract +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/node_modules/es-abstract/.github/workflows/codeql-analysis.yml b/node_modules/es-abstract/.github/workflows/codeql-analysis.yml new file mode 100644 index 000000000..e77ad6a7c --- /dev/null +++ b/node_modules/es-abstract/.github/workflows/codeql-analysis.yml @@ -0,0 +1,52 @@ +name: "Code scanning - action" + +on: + push: + pull_request: + schedule: + - cron: '0 17 * * 4' + +jobs: + CodeQL-Build: + + # CodeQL runs on ubuntu-latest and windows-latest + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + # Override language selection by uncommenting this and choosing your languages + # with: + # languages: go, javascript, csharp, python, cpp, java + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/node_modules/es-abstract/.github/workflows/rebase.yml b/node_modules/es-abstract/.github/workflows/rebase.yml new file mode 100644 index 000000000..436cb79dc --- /dev/null +++ b/node_modules/es-abstract/.github/workflows/rebase.yml @@ -0,0 +1,15 @@ +name: Automatic Rebase + +on: [pull_request] + +jobs: + _: + name: "Automatic Rebase" + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: ljharb/rebase@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/node_modules/es-abstract/.nycrc b/node_modules/es-abstract/.nycrc new file mode 100644 index 000000000..d316b4db7 --- /dev/null +++ b/node_modules/es-abstract/.nycrc @@ -0,0 +1,14 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "operations", + "test" + ] +} diff --git a/node_modules/es-abstract/.travis.yml b/node_modules/es-abstract/.travis.yml new file mode 100644 index 000000000..5c340249c --- /dev/null +++ b/node_modules/es-abstract/.travis.yml @@ -0,0 +1,32 @@ +version: ~> 1.0 +language: node_js +os: + - linux +cache: + directories: + - "$HOME/.npm" + - "$(nvm cache dir)" + - "$(nvm_version_path $(nvm_version_remote 0.4))" + - "$(nvm_version_path $(nvm_version_remote 0.6))" + - "$(nvm_version_path $(nvm_version_remote 0.10))" +import: + - ljharb/travis-ci:node/all.yml + - ljharb/travis-ci:node/pretest.yml + - ljharb/travis-ci:node/posttest.yml +script: + - 'if [ -n "${COVERAGE-}" ]; then npm run coverage && bash <(curl -s https://codecov.io/bash) -f coverage/*.json; fi' +matrix: + include: + - node_js: "8" + env: COVERAGE=true + - node_js: "4" + env: COVERAGE=true + - node_js: "0.12" + env: COVERAGE=true + - node_js: "0.8" + env: COVERAGE=true + exclude: + - node_js: "0.12" + env: TEST=true + - node_js: "0.8" + env: TEST=true diff --git a/node_modules/es-abstract/2015/AbstractEqualityComparison.js b/node_modules/es-abstract/2015/AbstractEqualityComparison.js new file mode 100644 index 000000000..40b390986 --- /dev/null +++ b/node_modules/es-abstract/2015/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/es-abstract/2015/AbstractRelationalComparison.js b/node_modules/es-abstract/2015/AbstractRelationalComparison.js new file mode 100644 index 000000000..bc7ca8324 --- /dev/null +++ b/node_modules/es-abstract/2015/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/es-abstract/2015/AdvanceStringIndex.js b/node_modules/es-abstract/2015/AdvanceStringIndex.js new file mode 100644 index 000000000..666f578b1 --- /dev/null +++ b/node_modules/es-abstract/2015/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/es-abstract/2015/ArrayCreate.js b/node_modules/es-abstract/2015/ArrayCreate.js new file mode 100644 index 000000000..fc9a7cf82 --- /dev/null +++ b/node_modules/es-abstract/2015/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/es-abstract/2015/ArraySetLength.js b/node_modules/es-abstract/2015/ArraySetLength.js new file mode 100644 index 000000000..c9134c6e6 --- /dev/null +++ b/node_modules/es-abstract/2015/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/es-abstract/2015/ArraySpeciesCreate.js b/node_modules/es-abstract/2015/ArraySpeciesCreate.js new file mode 100644 index 000000000..98b9b561d --- /dev/null +++ b/node_modules/es-abstract/2015/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/es-abstract/2015/Call.js b/node_modules/es-abstract/2015/Call.js new file mode 100644 index 000000000..f0f045174 --- /dev/null +++ b/node_modules/es-abstract/2015/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/es-abstract/2015/CanonicalNumericIndexString.js b/node_modules/es-abstract/2015/CanonicalNumericIndexString.js new file mode 100644 index 000000000..625f8539a --- /dev/null +++ b/node_modules/es-abstract/2015/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/es-abstract/2015/CompletePropertyDescriptor.js b/node_modules/es-abstract/2015/CompletePropertyDescriptor.js new file mode 100644 index 000000000..548bf415a --- /dev/null +++ b/node_modules/es-abstract/2015/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/es-abstract/2015/CreateDataProperty.js b/node_modules/es-abstract/2015/CreateDataProperty.js new file mode 100644 index 000000000..32a86ef04 --- /dev/null +++ b/node_modules/es-abstract/2015/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js b/node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js new file mode 100644 index 000000000..9feaec8d8 --- /dev/null +++ b/node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/es-abstract/2015/CreateHTML.js b/node_modules/es-abstract/2015/CreateHTML.js new file mode 100644 index 000000000..536c92db8 --- /dev/null +++ b/node_modules/es-abstract/2015/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/es-abstract/2015/CreateIterResultObject.js b/node_modules/es-abstract/2015/CreateIterResultObject.js new file mode 100644 index 000000000..aef1d2200 --- /dev/null +++ b/node_modules/es-abstract/2015/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/es-abstract/2015/CreateListFromArrayLike.js b/node_modules/es-abstract/2015/CreateListFromArrayLike.js new file mode 100644 index 000000000..d6b44b5dc --- /dev/null +++ b/node_modules/es-abstract/2015/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/es-abstract/2015/CreateMethodProperty.js b/node_modules/es-abstract/2015/CreateMethodProperty.js new file mode 100644 index 000000000..5b599aea1 --- /dev/null +++ b/node_modules/es-abstract/2015/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/es-abstract/2015/DateFromTime.js b/node_modules/es-abstract/2015/DateFromTime.js new file mode 100644 index 000000000..962dba168 --- /dev/null +++ b/node_modules/es-abstract/2015/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/es-abstract/2015/Day.js b/node_modules/es-abstract/2015/Day.js new file mode 100644 index 000000000..00df81342 --- /dev/null +++ b/node_modules/es-abstract/2015/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/es-abstract/2015/DayFromYear.js b/node_modules/es-abstract/2015/DayFromYear.js new file mode 100644 index 000000000..08dd5af60 --- /dev/null +++ b/node_modules/es-abstract/2015/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/es-abstract/2015/DayWithinYear.js b/node_modules/es-abstract/2015/DayWithinYear.js new file mode 100644 index 000000000..cfc400288 --- /dev/null +++ b/node_modules/es-abstract/2015/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/es-abstract/2015/DaysInYear.js b/node_modules/es-abstract/2015/DaysInYear.js new file mode 100644 index 000000000..db32251ff --- /dev/null +++ b/node_modules/es-abstract/2015/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/es-abstract/2015/DefinePropertyOrThrow.js b/node_modules/es-abstract/2015/DefinePropertyOrThrow.js new file mode 100644 index 000000000..7977f6e18 --- /dev/null +++ b/node_modules/es-abstract/2015/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/es-abstract/2015/DeletePropertyOrThrow.js b/node_modules/es-abstract/2015/DeletePropertyOrThrow.js new file mode 100644 index 000000000..b47681797 --- /dev/null +++ b/node_modules/es-abstract/2015/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/es-abstract/2015/EnumerableOwnNames.js b/node_modules/es-abstract/2015/EnumerableOwnNames.js new file mode 100644 index 000000000..d06858488 --- /dev/null +++ b/node_modules/es-abstract/2015/EnumerableOwnNames.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var keys = require('object-keys'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-enumerableownnames + +module.exports = function EnumerableOwnNames(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + return keys(O); +}; diff --git a/node_modules/es-abstract/2015/FromPropertyDescriptor.js b/node_modules/es-abstract/2015/FromPropertyDescriptor.js new file mode 100644 index 000000000..5ec200edb --- /dev/null +++ b/node_modules/es-abstract/2015/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/es-abstract/2015/Get.js b/node_modules/es-abstract/2015/Get.js new file mode 100644 index 000000000..5b9ad7860 --- /dev/null +++ b/node_modules/es-abstract/2015/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/es-abstract/2015/GetIterator.js b/node_modules/es-abstract/2015/GetIterator.js new file mode 100644 index 000000000..7beddacc0 --- /dev/null +++ b/node_modules/es-abstract/2015/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/es-abstract/2015/GetMethod.js b/node_modules/es-abstract/2015/GetMethod.js new file mode 100644 index 000000000..aef8cbc4a --- /dev/null +++ b/node_modules/es-abstract/2015/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/es-abstract/2015/GetOwnPropertyKeys.js b/node_modules/es-abstract/2015/GetOwnPropertyKeys.js new file mode 100644 index 000000000..8d7e5eee5 --- /dev/null +++ b/node_modules/es-abstract/2015/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/es-abstract/2015/GetPrototypeFromConstructor.js b/node_modules/es-abstract/2015/GetPrototypeFromConstructor.js new file mode 100644 index 000000000..62da8fb5f --- /dev/null +++ b/node_modules/es-abstract/2015/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/es-abstract/2015/GetSubstitution.js b/node_modules/es-abstract/2015/GetSubstitution.js new file mode 100644 index 000000000..de41b011a --- /dev/null +++ b/node_modules/es-abstract/2015/GetSubstitution.js @@ -0,0 +1,104 @@ + +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $parseInt = GetIntrinsic('%parseInt%'); + +var inspect = require('object-inspect'); + +var regexTester = require('../helpers/regexTester'); +var callBound = require('../helpers/callBound'); +var every = require('../helpers/every'); + +var isDigit = regexTester(/^[0-9]$/); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); + +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/es-abstract/2015/GetV.js b/node_modules/es-abstract/2015/GetV.js new file mode 100644 index 000000000..7b5139ace --- /dev/null +++ b/node_modules/es-abstract/2015/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/es-abstract/2015/HasOwnProperty.js b/node_modules/es-abstract/2015/HasOwnProperty.js new file mode 100644 index 000000000..679059f2e --- /dev/null +++ b/node_modules/es-abstract/2015/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/es-abstract/2015/HasProperty.js b/node_modules/es-abstract/2015/HasProperty.js new file mode 100644 index 000000000..5f2d2122a --- /dev/null +++ b/node_modules/es-abstract/2015/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/es-abstract/2015/HourFromTime.js b/node_modules/es-abstract/2015/HourFromTime.js new file mode 100644 index 000000000..957ce321a --- /dev/null +++ b/node_modules/es-abstract/2015/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/es-abstract/2015/InLeapYear.js b/node_modules/es-abstract/2015/InLeapYear.js new file mode 100644 index 000000000..38ba8fdc8 --- /dev/null +++ b/node_modules/es-abstract/2015/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/es-abstract/2015/InstanceofOperator.js b/node_modules/es-abstract/2015/InstanceofOperator.js new file mode 100644 index 000000000..ebd308c4b --- /dev/null +++ b/node_modules/es-abstract/2015/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/es-abstract/2015/Invoke.js b/node_modules/es-abstract/2015/Invoke.js new file mode 100644 index 000000000..769f0e308 --- /dev/null +++ b/node_modules/es-abstract/2015/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/es-abstract/2015/IsAccessorDescriptor.js b/node_modules/es-abstract/2015/IsAccessorDescriptor.js new file mode 100644 index 000000000..513946462 --- /dev/null +++ b/node_modules/es-abstract/2015/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/es-abstract/2015/IsArray.js b/node_modules/es-abstract/2015/IsArray.js new file mode 100644 index 000000000..7b25f37b5 --- /dev/null +++ b/node_modules/es-abstract/2015/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/es-abstract/2015/IsCallable.js b/node_modules/es-abstract/2015/IsCallable.js new file mode 100644 index 000000000..e4bfa365c --- /dev/null +++ b/node_modules/es-abstract/2015/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/es-abstract/2015/IsConcatSpreadable.js b/node_modules/es-abstract/2015/IsConcatSpreadable.js new file mode 100644 index 000000000..dc8aae1e6 --- /dev/null +++ b/node_modules/es-abstract/2015/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/es-abstract/2015/IsConstructor.js b/node_modules/es-abstract/2015/IsConstructor.js new file mode 100644 index 000000000..8ba9fe55b --- /dev/null +++ b/node_modules/es-abstract/2015/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/es-abstract/2015/IsDataDescriptor.js b/node_modules/es-abstract/2015/IsDataDescriptor.js new file mode 100644 index 000000000..0ad304585 --- /dev/null +++ b/node_modules/es-abstract/2015/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/es-abstract/2015/IsExtensible.js b/node_modules/es-abstract/2015/IsExtensible.js new file mode 100644 index 000000000..0c4c8a60c --- /dev/null +++ b/node_modules/es-abstract/2015/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/es-abstract/2015/IsGenericDescriptor.js b/node_modules/es-abstract/2015/IsGenericDescriptor.js new file mode 100644 index 000000000..8618ce414 --- /dev/null +++ b/node_modules/es-abstract/2015/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/es-abstract/2015/IsInteger.js b/node_modules/es-abstract/2015/IsInteger.js new file mode 100644 index 000000000..0f488b39a --- /dev/null +++ b/node_modules/es-abstract/2015/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/es-abstract/2015/IsPromise.js b/node_modules/es-abstract/2015/IsPromise.js new file mode 100644 index 000000000..e8e92a2b8 --- /dev/null +++ b/node_modules/es-abstract/2015/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/es-abstract/2015/IsPropertyDescriptor.js b/node_modules/es-abstract/2015/IsPropertyDescriptor.js new file mode 100644 index 000000000..2a96c637b --- /dev/null +++ b/node_modules/es-abstract/2015/IsPropertyDescriptor.js @@ -0,0 +1,17 @@ +'use strict'; + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + +module.exports = function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor({ + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor, + Type: Type + }, Desc); +}; diff --git a/node_modules/es-abstract/2015/IsPropertyKey.js b/node_modules/es-abstract/2015/IsPropertyKey.js new file mode 100644 index 000000000..74b8d95d4 --- /dev/null +++ b/node_modules/es-abstract/2015/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/es-abstract/2015/IsRegExp.js b/node_modules/es-abstract/2015/IsRegExp.js new file mode 100644 index 000000000..fdf2323ff --- /dev/null +++ b/node_modules/es-abstract/2015/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/es-abstract/2015/IteratorClose.js b/node_modules/es-abstract/2015/IteratorClose.js new file mode 100644 index 000000000..35c8c2bea --- /dev/null +++ b/node_modules/es-abstract/2015/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/es-abstract/2015/IteratorComplete.js b/node_modules/es-abstract/2015/IteratorComplete.js new file mode 100644 index 000000000..a62b9bfc1 --- /dev/null +++ b/node_modules/es-abstract/2015/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/es-abstract/2015/IteratorNext.js b/node_modules/es-abstract/2015/IteratorNext.js new file mode 100644 index 000000000..7e5991561 --- /dev/null +++ b/node_modules/es-abstract/2015/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/es-abstract/2015/IteratorStep.js b/node_modules/es-abstract/2015/IteratorStep.js new file mode 100644 index 000000000..41b9d1b25 --- /dev/null +++ b/node_modules/es-abstract/2015/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/es-abstract/2015/IteratorValue.js b/node_modules/es-abstract/2015/IteratorValue.js new file mode 100644 index 000000000..5e71a4463 --- /dev/null +++ b/node_modules/es-abstract/2015/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/es-abstract/2015/MakeDate.js b/node_modules/es-abstract/2015/MakeDate.js new file mode 100644 index 000000000..7b592d136 --- /dev/null +++ b/node_modules/es-abstract/2015/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/es-abstract/2015/MakeDay.js b/node_modules/es-abstract/2015/MakeDay.js new file mode 100644 index 000000000..f1ab81060 --- /dev/null +++ b/node_modules/es-abstract/2015/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/es-abstract/2015/MakeTime.js b/node_modules/es-abstract/2015/MakeTime.js new file mode 100644 index 000000000..e11850040 --- /dev/null +++ b/node_modules/es-abstract/2015/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/es-abstract/2015/MinFromTime.js b/node_modules/es-abstract/2015/MinFromTime.js new file mode 100644 index 000000000..e80e19108 --- /dev/null +++ b/node_modules/es-abstract/2015/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/es-abstract/2015/MonthFromTime.js b/node_modules/es-abstract/2015/MonthFromTime.js new file mode 100644 index 000000000..4f120f2c2 --- /dev/null +++ b/node_modules/es-abstract/2015/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/es-abstract/2015/ObjectCreate.js b/node_modules/es-abstract/2015/ObjectCreate.js new file mode 100644 index 000000000..e2445b022 --- /dev/null +++ b/node_modules/es-abstract/2015/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js b/node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js new file mode 100644 index 000000000..59780b3bb --- /dev/null +++ b/node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js b/node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js new file mode 100644 index 000000000..b9882e5dc --- /dev/null +++ b/node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/es-abstract/2015/OrdinaryHasInstance.js b/node_modules/es-abstract/2015/OrdinaryHasInstance.js new file mode 100644 index 000000000..51abe26d5 --- /dev/null +++ b/node_modules/es-abstract/2015/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/es-abstract/2015/OrdinaryHasProperty.js b/node_modules/es-abstract/2015/OrdinaryHasProperty.js new file mode 100644 index 000000000..076c25ac5 --- /dev/null +++ b/node_modules/es-abstract/2015/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/es-abstract/2015/RegExpExec.js b/node_modules/es-abstract/2015/RegExpExec.js new file mode 100644 index 000000000..15c91867d --- /dev/null +++ b/node_modules/es-abstract/2015/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/es-abstract/2015/RequireObjectCoercible.js b/node_modules/es-abstract/2015/RequireObjectCoercible.js new file mode 100644 index 000000000..9008359db --- /dev/null +++ b/node_modules/es-abstract/2015/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/es-abstract/2015/SameValue.js b/node_modules/es-abstract/2015/SameValue.js new file mode 100644 index 000000000..47c936d76 --- /dev/null +++ b/node_modules/es-abstract/2015/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/es-abstract/2015/SameValueZero.js b/node_modules/es-abstract/2015/SameValueZero.js new file mode 100644 index 000000000..0dedcd2c3 --- /dev/null +++ b/node_modules/es-abstract/2015/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/es-abstract/2015/SecFromTime.js b/node_modules/es-abstract/2015/SecFromTime.js new file mode 100644 index 000000000..7190011d2 --- /dev/null +++ b/node_modules/es-abstract/2015/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/es-abstract/2015/Set.js b/node_modules/es-abstract/2015/Set.js new file mode 100644 index 000000000..9545b1325 --- /dev/null +++ b/node_modules/es-abstract/2015/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/es-abstract/2015/SetFunctionName.js b/node_modules/es-abstract/2015/SetFunctionName.js new file mode 100644 index 000000000..f93324a73 --- /dev/null +++ b/node_modules/es-abstract/2015/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/es-abstract/2015/SetIntegrityLevel.js b/node_modules/es-abstract/2015/SetIntegrityLevel.js new file mode 100644 index 000000000..3d5c81d56 --- /dev/null +++ b/node_modules/es-abstract/2015/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/es-abstract/2015/SpeciesConstructor.js b/node_modules/es-abstract/2015/SpeciesConstructor.js new file mode 100644 index 000000000..3cdcd747d --- /dev/null +++ b/node_modules/es-abstract/2015/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/es-abstract/2015/StrictEqualityComparison.js b/node_modules/es-abstract/2015/StrictEqualityComparison.js new file mode 100644 index 000000000..eea5df388 --- /dev/null +++ b/node_modules/es-abstract/2015/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/es-abstract/2015/SymbolDescriptiveString.js b/node_modules/es-abstract/2015/SymbolDescriptiveString.js new file mode 100644 index 000000000..7bd8191ad --- /dev/null +++ b/node_modules/es-abstract/2015/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/es-abstract/2015/TestIntegrityLevel.js b/node_modules/es-abstract/2015/TestIntegrityLevel.js new file mode 100644 index 000000000..7a57397d5 --- /dev/null +++ b/node_modules/es-abstract/2015/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/es-abstract/2015/TimeClip.js b/node_modules/es-abstract/2015/TimeClip.js new file mode 100644 index 000000000..57aa08cb9 --- /dev/null +++ b/node_modules/es-abstract/2015/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/es-abstract/2015/TimeFromYear.js b/node_modules/es-abstract/2015/TimeFromYear.js new file mode 100644 index 000000000..df646c36e --- /dev/null +++ b/node_modules/es-abstract/2015/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/es-abstract/2015/TimeWithinDay.js b/node_modules/es-abstract/2015/TimeWithinDay.js new file mode 100644 index 000000000..c5b21d378 --- /dev/null +++ b/node_modules/es-abstract/2015/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/es-abstract/2015/ToBoolean.js b/node_modules/es-abstract/2015/ToBoolean.js new file mode 100644 index 000000000..65d87376d --- /dev/null +++ b/node_modules/es-abstract/2015/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/es-abstract/2015/ToDateString.js b/node_modules/es-abstract/2015/ToDateString.js new file mode 100644 index 000000000..7a6d4c4e9 --- /dev/null +++ b/node_modules/es-abstract/2015/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/es-abstract/2015/ToInt16.js b/node_modules/es-abstract/2015/ToInt16.js new file mode 100644 index 000000000..5a112c237 --- /dev/null +++ b/node_modules/es-abstract/2015/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/es-abstract/2015/ToInt32.js b/node_modules/es-abstract/2015/ToInt32.js new file mode 100644 index 000000000..a8d268070 --- /dev/null +++ b/node_modules/es-abstract/2015/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/es-abstract/2015/ToInt8.js b/node_modules/es-abstract/2015/ToInt8.js new file mode 100644 index 000000000..d103123a9 --- /dev/null +++ b/node_modules/es-abstract/2015/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/es-abstract/2015/ToInteger.js b/node_modules/es-abstract/2015/ToInteger.js new file mode 100644 index 000000000..16f7db9c3 --- /dev/null +++ b/node_modules/es-abstract/2015/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/es-abstract/2015/ToLength.js b/node_modules/es-abstract/2015/ToLength.js new file mode 100644 index 000000000..1bef9bed7 --- /dev/null +++ b/node_modules/es-abstract/2015/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/es-abstract/2015/ToNumber.js b/node_modules/es-abstract/2015/ToNumber.js new file mode 100644 index 000000000..7a3cdc89e --- /dev/null +++ b/node_modules/es-abstract/2015/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/es-abstract/2015/ToObject.js b/node_modules/es-abstract/2015/ToObject.js new file mode 100644 index 000000000..50d5b94a4 --- /dev/null +++ b/node_modules/es-abstract/2015/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/es-abstract/2015/ToPrimitive.js b/node_modules/es-abstract/2015/ToPrimitive.js new file mode 100644 index 000000000..81c655d41 --- /dev/null +++ b/node_modules/es-abstract/2015/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/es-abstract/2015/ToPropertyDescriptor.js b/node_modules/es-abstract/2015/ToPropertyDescriptor.js new file mode 100644 index 000000000..38e536e2d --- /dev/null +++ b/node_modules/es-abstract/2015/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/es-abstract/2015/ToPropertyKey.js b/node_modules/es-abstract/2015/ToPropertyKey.js new file mode 100644 index 000000000..38f40dd80 --- /dev/null +++ b/node_modules/es-abstract/2015/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/es-abstract/2015/ToString.js b/node_modules/es-abstract/2015/ToString.js new file mode 100644 index 000000000..a34543126 --- /dev/null +++ b/node_modules/es-abstract/2015/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/es-abstract/2015/ToUint16.js b/node_modules/es-abstract/2015/ToUint16.js new file mode 100644 index 000000000..c8a408bfa --- /dev/null +++ b/node_modules/es-abstract/2015/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/es-abstract/2015/ToUint32.js b/node_modules/es-abstract/2015/ToUint32.js new file mode 100644 index 000000000..3660f6209 --- /dev/null +++ b/node_modules/es-abstract/2015/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/es-abstract/2015/ToUint8.js b/node_modules/es-abstract/2015/ToUint8.js new file mode 100644 index 000000000..bf8475321 --- /dev/null +++ b/node_modules/es-abstract/2015/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/es-abstract/2015/ToUint8Clamp.js b/node_modules/es-abstract/2015/ToUint8Clamp.js new file mode 100644 index 000000000..c7f9f5656 --- /dev/null +++ b/node_modules/es-abstract/2015/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/es-abstract/2015/Type.js b/node_modules/es-abstract/2015/Type.js new file mode 100644 index 000000000..0bd11659c --- /dev/null +++ b/node_modules/es-abstract/2015/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js b/node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 000000000..d4b900700 --- /dev/null +++ b/node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/es-abstract/2015/WeekDay.js b/node_modules/es-abstract/2015/WeekDay.js new file mode 100644 index 000000000..2973e0200 --- /dev/null +++ b/node_modules/es-abstract/2015/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/es-abstract/2015/YearFromTime.js b/node_modules/es-abstract/2015/YearFromTime.js new file mode 100644 index 000000000..ff5339f24 --- /dev/null +++ b/node_modules/es-abstract/2015/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/es-abstract/2015/modulo.js b/node_modules/es-abstract/2015/modulo.js new file mode 100644 index 000000000..bc04c0628 --- /dev/null +++ b/node_modules/es-abstract/2015/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/es-abstract/2015/msFromTime.js b/node_modules/es-abstract/2015/msFromTime.js new file mode 100644 index 000000000..c31eda085 --- /dev/null +++ b/node_modules/es-abstract/2015/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/es-abstract/2015/thisBooleanValue.js b/node_modules/es-abstract/2015/thisBooleanValue.js new file mode 100644 index 000000000..3ffac9cdf --- /dev/null +++ b/node_modules/es-abstract/2015/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/es-abstract/2015/thisNumberValue.js b/node_modules/es-abstract/2015/thisNumberValue.js new file mode 100644 index 000000000..0345e523f --- /dev/null +++ b/node_modules/es-abstract/2015/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/es-abstract/2015/thisStringValue.js b/node_modules/es-abstract/2015/thisStringValue.js new file mode 100644 index 000000000..3b99b6e3c --- /dev/null +++ b/node_modules/es-abstract/2015/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/es-abstract/2015/thisTimeValue.js b/node_modules/es-abstract/2015/thisTimeValue.js new file mode 100644 index 000000000..d7cda28c9 --- /dev/null +++ b/node_modules/es-abstract/2015/thisTimeValue.js @@ -0,0 +1,9 @@ +'use strict'; + +var $DateValueOf = require('../helpers/callBound')('Date.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + +module.exports = function thisTimeValue(value) { + return $DateValueOf(value); +}; diff --git a/node_modules/es-abstract/2016/AbstractEqualityComparison.js b/node_modules/es-abstract/2016/AbstractEqualityComparison.js new file mode 100644 index 000000000..40b390986 --- /dev/null +++ b/node_modules/es-abstract/2016/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/es-abstract/2016/AbstractRelationalComparison.js b/node_modules/es-abstract/2016/AbstractRelationalComparison.js new file mode 100644 index 000000000..bc7ca8324 --- /dev/null +++ b/node_modules/es-abstract/2016/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/es-abstract/2016/AdvanceStringIndex.js b/node_modules/es-abstract/2016/AdvanceStringIndex.js new file mode 100644 index 000000000..666f578b1 --- /dev/null +++ b/node_modules/es-abstract/2016/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/es-abstract/2016/ArrayCreate.js b/node_modules/es-abstract/2016/ArrayCreate.js new file mode 100644 index 000000000..fc9a7cf82 --- /dev/null +++ b/node_modules/es-abstract/2016/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/es-abstract/2016/ArraySetLength.js b/node_modules/es-abstract/2016/ArraySetLength.js new file mode 100644 index 000000000..c9134c6e6 --- /dev/null +++ b/node_modules/es-abstract/2016/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/es-abstract/2016/ArraySpeciesCreate.js b/node_modules/es-abstract/2016/ArraySpeciesCreate.js new file mode 100644 index 000000000..98b9b561d --- /dev/null +++ b/node_modules/es-abstract/2016/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/es-abstract/2016/Call.js b/node_modules/es-abstract/2016/Call.js new file mode 100644 index 000000000..f0f045174 --- /dev/null +++ b/node_modules/es-abstract/2016/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/es-abstract/2016/CanonicalNumericIndexString.js b/node_modules/es-abstract/2016/CanonicalNumericIndexString.js new file mode 100644 index 000000000..625f8539a --- /dev/null +++ b/node_modules/es-abstract/2016/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/es-abstract/2016/CompletePropertyDescriptor.js b/node_modules/es-abstract/2016/CompletePropertyDescriptor.js new file mode 100644 index 000000000..548bf415a --- /dev/null +++ b/node_modules/es-abstract/2016/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/es-abstract/2016/CreateDataProperty.js b/node_modules/es-abstract/2016/CreateDataProperty.js new file mode 100644 index 000000000..32a86ef04 --- /dev/null +++ b/node_modules/es-abstract/2016/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js b/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js new file mode 100644 index 000000000..9feaec8d8 --- /dev/null +++ b/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/es-abstract/2016/CreateHTML.js b/node_modules/es-abstract/2016/CreateHTML.js new file mode 100644 index 000000000..536c92db8 --- /dev/null +++ b/node_modules/es-abstract/2016/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/es-abstract/2016/CreateIterResultObject.js b/node_modules/es-abstract/2016/CreateIterResultObject.js new file mode 100644 index 000000000..aef1d2200 --- /dev/null +++ b/node_modules/es-abstract/2016/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/es-abstract/2016/CreateListFromArrayLike.js b/node_modules/es-abstract/2016/CreateListFromArrayLike.js new file mode 100644 index 000000000..d6b44b5dc --- /dev/null +++ b/node_modules/es-abstract/2016/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/es-abstract/2016/CreateMethodProperty.js b/node_modules/es-abstract/2016/CreateMethodProperty.js new file mode 100644 index 000000000..5b599aea1 --- /dev/null +++ b/node_modules/es-abstract/2016/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/es-abstract/2016/DateFromTime.js b/node_modules/es-abstract/2016/DateFromTime.js new file mode 100644 index 000000000..962dba168 --- /dev/null +++ b/node_modules/es-abstract/2016/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/es-abstract/2016/Day.js b/node_modules/es-abstract/2016/Day.js new file mode 100644 index 000000000..00df81342 --- /dev/null +++ b/node_modules/es-abstract/2016/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/es-abstract/2016/DayFromYear.js b/node_modules/es-abstract/2016/DayFromYear.js new file mode 100644 index 000000000..08dd5af60 --- /dev/null +++ b/node_modules/es-abstract/2016/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/es-abstract/2016/DayWithinYear.js b/node_modules/es-abstract/2016/DayWithinYear.js new file mode 100644 index 000000000..cfc400288 --- /dev/null +++ b/node_modules/es-abstract/2016/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/es-abstract/2016/DaysInYear.js b/node_modules/es-abstract/2016/DaysInYear.js new file mode 100644 index 000000000..db32251ff --- /dev/null +++ b/node_modules/es-abstract/2016/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/es-abstract/2016/DefinePropertyOrThrow.js b/node_modules/es-abstract/2016/DefinePropertyOrThrow.js new file mode 100644 index 000000000..7977f6e18 --- /dev/null +++ b/node_modules/es-abstract/2016/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/es-abstract/2016/DeletePropertyOrThrow.js b/node_modules/es-abstract/2016/DeletePropertyOrThrow.js new file mode 100644 index 000000000..b47681797 --- /dev/null +++ b/node_modules/es-abstract/2016/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/es-abstract/2016/EnumerableOwnNames.js b/node_modules/es-abstract/2016/EnumerableOwnNames.js new file mode 100644 index 000000000..d06858488 --- /dev/null +++ b/node_modules/es-abstract/2016/EnumerableOwnNames.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var keys = require('object-keys'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-enumerableownnames + +module.exports = function EnumerableOwnNames(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + return keys(O); +}; diff --git a/node_modules/es-abstract/2016/FromPropertyDescriptor.js b/node_modules/es-abstract/2016/FromPropertyDescriptor.js new file mode 100644 index 000000000..5ec200edb --- /dev/null +++ b/node_modules/es-abstract/2016/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/es-abstract/2016/Get.js b/node_modules/es-abstract/2016/Get.js new file mode 100644 index 000000000..5b9ad7860 --- /dev/null +++ b/node_modules/es-abstract/2016/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/es-abstract/2016/GetIterator.js b/node_modules/es-abstract/2016/GetIterator.js new file mode 100644 index 000000000..7beddacc0 --- /dev/null +++ b/node_modules/es-abstract/2016/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/es-abstract/2016/GetMethod.js b/node_modules/es-abstract/2016/GetMethod.js new file mode 100644 index 000000000..aef8cbc4a --- /dev/null +++ b/node_modules/es-abstract/2016/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/es-abstract/2016/GetOwnPropertyKeys.js b/node_modules/es-abstract/2016/GetOwnPropertyKeys.js new file mode 100644 index 000000000..8d7e5eee5 --- /dev/null +++ b/node_modules/es-abstract/2016/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/es-abstract/2016/GetPrototypeFromConstructor.js b/node_modules/es-abstract/2016/GetPrototypeFromConstructor.js new file mode 100644 index 000000000..62da8fb5f --- /dev/null +++ b/node_modules/es-abstract/2016/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/es-abstract/2016/GetSubstitution.js b/node_modules/es-abstract/2016/GetSubstitution.js new file mode 100644 index 000000000..de41b011a --- /dev/null +++ b/node_modules/es-abstract/2016/GetSubstitution.js @@ -0,0 +1,104 @@ + +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $parseInt = GetIntrinsic('%parseInt%'); + +var inspect = require('object-inspect'); + +var regexTester = require('../helpers/regexTester'); +var callBound = require('../helpers/callBound'); +var every = require('../helpers/every'); + +var isDigit = regexTester(/^[0-9]$/); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); + +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/es-abstract/2016/GetV.js b/node_modules/es-abstract/2016/GetV.js new file mode 100644 index 000000000..7b5139ace --- /dev/null +++ b/node_modules/es-abstract/2016/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/es-abstract/2016/HasOwnProperty.js b/node_modules/es-abstract/2016/HasOwnProperty.js new file mode 100644 index 000000000..679059f2e --- /dev/null +++ b/node_modules/es-abstract/2016/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/es-abstract/2016/HasProperty.js b/node_modules/es-abstract/2016/HasProperty.js new file mode 100644 index 000000000..5f2d2122a --- /dev/null +++ b/node_modules/es-abstract/2016/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/es-abstract/2016/HourFromTime.js b/node_modules/es-abstract/2016/HourFromTime.js new file mode 100644 index 000000000..957ce321a --- /dev/null +++ b/node_modules/es-abstract/2016/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/es-abstract/2016/InLeapYear.js b/node_modules/es-abstract/2016/InLeapYear.js new file mode 100644 index 000000000..38ba8fdc8 --- /dev/null +++ b/node_modules/es-abstract/2016/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/es-abstract/2016/InstanceofOperator.js b/node_modules/es-abstract/2016/InstanceofOperator.js new file mode 100644 index 000000000..ebd308c4b --- /dev/null +++ b/node_modules/es-abstract/2016/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/es-abstract/2016/Invoke.js b/node_modules/es-abstract/2016/Invoke.js new file mode 100644 index 000000000..769f0e308 --- /dev/null +++ b/node_modules/es-abstract/2016/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/es-abstract/2016/IsAccessorDescriptor.js b/node_modules/es-abstract/2016/IsAccessorDescriptor.js new file mode 100644 index 000000000..513946462 --- /dev/null +++ b/node_modules/es-abstract/2016/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/es-abstract/2016/IsArray.js b/node_modules/es-abstract/2016/IsArray.js new file mode 100644 index 000000000..7b25f37b5 --- /dev/null +++ b/node_modules/es-abstract/2016/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/es-abstract/2016/IsCallable.js b/node_modules/es-abstract/2016/IsCallable.js new file mode 100644 index 000000000..e4bfa365c --- /dev/null +++ b/node_modules/es-abstract/2016/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/es-abstract/2016/IsConcatSpreadable.js b/node_modules/es-abstract/2016/IsConcatSpreadable.js new file mode 100644 index 000000000..dc8aae1e6 --- /dev/null +++ b/node_modules/es-abstract/2016/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/es-abstract/2016/IsConstructor.js b/node_modules/es-abstract/2016/IsConstructor.js new file mode 100644 index 000000000..8ba9fe55b --- /dev/null +++ b/node_modules/es-abstract/2016/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/es-abstract/2016/IsDataDescriptor.js b/node_modules/es-abstract/2016/IsDataDescriptor.js new file mode 100644 index 000000000..0ad304585 --- /dev/null +++ b/node_modules/es-abstract/2016/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/es-abstract/2016/IsExtensible.js b/node_modules/es-abstract/2016/IsExtensible.js new file mode 100644 index 000000000..0c4c8a60c --- /dev/null +++ b/node_modules/es-abstract/2016/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/es-abstract/2016/IsGenericDescriptor.js b/node_modules/es-abstract/2016/IsGenericDescriptor.js new file mode 100644 index 000000000..8618ce414 --- /dev/null +++ b/node_modules/es-abstract/2016/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/es-abstract/2016/IsInteger.js b/node_modules/es-abstract/2016/IsInteger.js new file mode 100644 index 000000000..0f488b39a --- /dev/null +++ b/node_modules/es-abstract/2016/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/es-abstract/2016/IsPromise.js b/node_modules/es-abstract/2016/IsPromise.js new file mode 100644 index 000000000..e8e92a2b8 --- /dev/null +++ b/node_modules/es-abstract/2016/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/es-abstract/2016/IsPropertyDescriptor.js b/node_modules/es-abstract/2016/IsPropertyDescriptor.js new file mode 100644 index 000000000..2a96c637b --- /dev/null +++ b/node_modules/es-abstract/2016/IsPropertyDescriptor.js @@ -0,0 +1,17 @@ +'use strict'; + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + +module.exports = function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor({ + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor, + Type: Type + }, Desc); +}; diff --git a/node_modules/es-abstract/2016/IsPropertyKey.js b/node_modules/es-abstract/2016/IsPropertyKey.js new file mode 100644 index 000000000..74b8d95d4 --- /dev/null +++ b/node_modules/es-abstract/2016/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/es-abstract/2016/IsRegExp.js b/node_modules/es-abstract/2016/IsRegExp.js new file mode 100644 index 000000000..fdf2323ff --- /dev/null +++ b/node_modules/es-abstract/2016/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/es-abstract/2016/IterableToArrayLike.js b/node_modules/es-abstract/2016/IterableToArrayLike.js new file mode 100644 index 000000000..885cade8f --- /dev/null +++ b/node_modules/es-abstract/2016/IterableToArrayLike.js @@ -0,0 +1,56 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); +var $arrayPush = callBound('Array.prototype.push'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var GetIterator = require('./GetIterator'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); +var ToObject = require('./ToObject'); +var Type = require('./Type'); +var ES = { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type +}; + +// https://www.ecma-international.org/ecma-262/7.0/#sec-iterabletoarraylike +/** + * 1. Let usingIterator be ? GetMethod(items, @@iterator). + * 2. If usingIterator is not undefined, then + * 1. Let iterator be ? GetIterator(items, usingIterator). + * 2. Let values be a new empty List. + * 3. Let next be true. + * 4. Repeat, while next is not false + * 1. Let next be ? IteratorStep(iterator). + * 2. If next is not false, then + * 1. Let nextValue be ? IteratorValue(next). + * 2. Append nextValue to the end of the List values. + * 5. Return CreateArrayFromList(values). + * 3. NOTE: items is not an Iterable so assume it is already an array-like object. + * 4. Return ! ToObject(items). + */ + +module.exports = function IterableToArrayLike(items) { + var usingIterator = getIteratorMethod(ES, items); + if (typeof usingIterator !== 'undefined') { + var iterator = GetIterator(items, usingIterator); + var values = []; + var next = true; + while (next) { + next = IteratorStep(iterator); + if (next) { + var nextValue = IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; + } + + return ToObject(items); +}; diff --git a/node_modules/es-abstract/2016/IteratorClose.js b/node_modules/es-abstract/2016/IteratorClose.js new file mode 100644 index 000000000..35c8c2bea --- /dev/null +++ b/node_modules/es-abstract/2016/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/es-abstract/2016/IteratorComplete.js b/node_modules/es-abstract/2016/IteratorComplete.js new file mode 100644 index 000000000..a62b9bfc1 --- /dev/null +++ b/node_modules/es-abstract/2016/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/es-abstract/2016/IteratorNext.js b/node_modules/es-abstract/2016/IteratorNext.js new file mode 100644 index 000000000..7e5991561 --- /dev/null +++ b/node_modules/es-abstract/2016/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/es-abstract/2016/IteratorStep.js b/node_modules/es-abstract/2016/IteratorStep.js new file mode 100644 index 000000000..41b9d1b25 --- /dev/null +++ b/node_modules/es-abstract/2016/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/es-abstract/2016/IteratorValue.js b/node_modules/es-abstract/2016/IteratorValue.js new file mode 100644 index 000000000..5e71a4463 --- /dev/null +++ b/node_modules/es-abstract/2016/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/es-abstract/2016/MakeDate.js b/node_modules/es-abstract/2016/MakeDate.js new file mode 100644 index 000000000..7b592d136 --- /dev/null +++ b/node_modules/es-abstract/2016/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/es-abstract/2016/MakeDay.js b/node_modules/es-abstract/2016/MakeDay.js new file mode 100644 index 000000000..f1ab81060 --- /dev/null +++ b/node_modules/es-abstract/2016/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/es-abstract/2016/MakeTime.js b/node_modules/es-abstract/2016/MakeTime.js new file mode 100644 index 000000000..e11850040 --- /dev/null +++ b/node_modules/es-abstract/2016/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/es-abstract/2016/MinFromTime.js b/node_modules/es-abstract/2016/MinFromTime.js new file mode 100644 index 000000000..e80e19108 --- /dev/null +++ b/node_modules/es-abstract/2016/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/es-abstract/2016/MonthFromTime.js b/node_modules/es-abstract/2016/MonthFromTime.js new file mode 100644 index 000000000..4f120f2c2 --- /dev/null +++ b/node_modules/es-abstract/2016/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/es-abstract/2016/ObjectCreate.js b/node_modules/es-abstract/2016/ObjectCreate.js new file mode 100644 index 000000000..e2445b022 --- /dev/null +++ b/node_modules/es-abstract/2016/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js b/node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js new file mode 100644 index 000000000..59780b3bb --- /dev/null +++ b/node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js b/node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js new file mode 100644 index 000000000..b9882e5dc --- /dev/null +++ b/node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js b/node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js new file mode 100644 index 000000000..344077a40 --- /dev/null +++ b/node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $getProto = require('../helpers/getProto'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof + +module.exports = function OrdinaryGetPrototypeOf(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!$getProto) { + throw new $TypeError('This environment does not support fetching prototypes.'); + } + return $getProto(O); +}; diff --git a/node_modules/es-abstract/2016/OrdinaryHasInstance.js b/node_modules/es-abstract/2016/OrdinaryHasInstance.js new file mode 100644 index 000000000..51abe26d5 --- /dev/null +++ b/node_modules/es-abstract/2016/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/es-abstract/2016/OrdinaryHasProperty.js b/node_modules/es-abstract/2016/OrdinaryHasProperty.js new file mode 100644 index 000000000..076c25ac5 --- /dev/null +++ b/node_modules/es-abstract/2016/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js b/node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js new file mode 100644 index 000000000..3541331ca --- /dev/null +++ b/node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $setProto = require('../helpers/setProto'); + +var OrdinaryGetPrototypeOf = require('./OrdinaryGetPrototypeOf'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof + +module.exports = function OrdinarySetPrototypeOf(O, V) { + if (Type(V) !== 'Object' && Type(V) !== 'Null') { + throw new $TypeError('Assertion failed: V must be Object or Null'); + } + /* + var extensible = IsExtensible(O); + var current = OrdinaryGetPrototypeOf(O); + if (SameValue(V, current)) { + return true; + } + if (!extensible) { + return false; + } + */ + try { + $setProto(O, V); + } catch (e) { + return false; + } + return OrdinaryGetPrototypeOf(O) === V; + /* + var p = V; + var done = false; + while (!done) { + if (p === null) { + done = true; + } else if (SameValue(p, O)) { + return false; + } else { + if (wat) { + done = true; + } else { + p = p.[[Prototype]]; + } + } + } + O.[[Prototype]] = V; + return true; + */ +}; diff --git a/node_modules/es-abstract/2016/RegExpExec.js b/node_modules/es-abstract/2016/RegExpExec.js new file mode 100644 index 000000000..15c91867d --- /dev/null +++ b/node_modules/es-abstract/2016/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/es-abstract/2016/RequireObjectCoercible.js b/node_modules/es-abstract/2016/RequireObjectCoercible.js new file mode 100644 index 000000000..9008359db --- /dev/null +++ b/node_modules/es-abstract/2016/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/es-abstract/2016/SameValue.js b/node_modules/es-abstract/2016/SameValue.js new file mode 100644 index 000000000..47c936d76 --- /dev/null +++ b/node_modules/es-abstract/2016/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/es-abstract/2016/SameValueNonNumber.js b/node_modules/es-abstract/2016/SameValueNonNumber.js new file mode 100644 index 000000000..5668752e3 --- /dev/null +++ b/node_modules/es-abstract/2016/SameValueNonNumber.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); + +// https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber + +module.exports = function SameValueNonNumber(x, y) { + if (typeof x === 'number' || typeof x !== typeof y) { + throw new $TypeError('SameValueNonNumber requires two non-number values of the same type.'); + } + return SameValue(x, y); +}; diff --git a/node_modules/es-abstract/2016/SameValueZero.js b/node_modules/es-abstract/2016/SameValueZero.js new file mode 100644 index 000000000..0dedcd2c3 --- /dev/null +++ b/node_modules/es-abstract/2016/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/es-abstract/2016/SecFromTime.js b/node_modules/es-abstract/2016/SecFromTime.js new file mode 100644 index 000000000..7190011d2 --- /dev/null +++ b/node_modules/es-abstract/2016/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/es-abstract/2016/Set.js b/node_modules/es-abstract/2016/Set.js new file mode 100644 index 000000000..9545b1325 --- /dev/null +++ b/node_modules/es-abstract/2016/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/es-abstract/2016/SetFunctionName.js b/node_modules/es-abstract/2016/SetFunctionName.js new file mode 100644 index 000000000..f93324a73 --- /dev/null +++ b/node_modules/es-abstract/2016/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/es-abstract/2016/SetIntegrityLevel.js b/node_modules/es-abstract/2016/SetIntegrityLevel.js new file mode 100644 index 000000000..3d5c81d56 --- /dev/null +++ b/node_modules/es-abstract/2016/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/es-abstract/2016/SpeciesConstructor.js b/node_modules/es-abstract/2016/SpeciesConstructor.js new file mode 100644 index 000000000..3cdcd747d --- /dev/null +++ b/node_modules/es-abstract/2016/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/es-abstract/2016/StrictEqualityComparison.js b/node_modules/es-abstract/2016/StrictEqualityComparison.js new file mode 100644 index 000000000..eea5df388 --- /dev/null +++ b/node_modules/es-abstract/2016/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/es-abstract/2016/SymbolDescriptiveString.js b/node_modules/es-abstract/2016/SymbolDescriptiveString.js new file mode 100644 index 000000000..7bd8191ad --- /dev/null +++ b/node_modules/es-abstract/2016/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/es-abstract/2016/TestIntegrityLevel.js b/node_modules/es-abstract/2016/TestIntegrityLevel.js new file mode 100644 index 000000000..7a57397d5 --- /dev/null +++ b/node_modules/es-abstract/2016/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/es-abstract/2016/TimeClip.js b/node_modules/es-abstract/2016/TimeClip.js new file mode 100644 index 000000000..57aa08cb9 --- /dev/null +++ b/node_modules/es-abstract/2016/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/es-abstract/2016/TimeFromYear.js b/node_modules/es-abstract/2016/TimeFromYear.js new file mode 100644 index 000000000..df646c36e --- /dev/null +++ b/node_modules/es-abstract/2016/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/es-abstract/2016/TimeWithinDay.js b/node_modules/es-abstract/2016/TimeWithinDay.js new file mode 100644 index 000000000..c5b21d378 --- /dev/null +++ b/node_modules/es-abstract/2016/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/es-abstract/2016/ToBoolean.js b/node_modules/es-abstract/2016/ToBoolean.js new file mode 100644 index 000000000..65d87376d --- /dev/null +++ b/node_modules/es-abstract/2016/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/es-abstract/2016/ToDateString.js b/node_modules/es-abstract/2016/ToDateString.js new file mode 100644 index 000000000..7a6d4c4e9 --- /dev/null +++ b/node_modules/es-abstract/2016/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/es-abstract/2016/ToInt16.js b/node_modules/es-abstract/2016/ToInt16.js new file mode 100644 index 000000000..5a112c237 --- /dev/null +++ b/node_modules/es-abstract/2016/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/es-abstract/2016/ToInt32.js b/node_modules/es-abstract/2016/ToInt32.js new file mode 100644 index 000000000..a8d268070 --- /dev/null +++ b/node_modules/es-abstract/2016/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/es-abstract/2016/ToInt8.js b/node_modules/es-abstract/2016/ToInt8.js new file mode 100644 index 000000000..d103123a9 --- /dev/null +++ b/node_modules/es-abstract/2016/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/es-abstract/2016/ToInteger.js b/node_modules/es-abstract/2016/ToInteger.js new file mode 100644 index 000000000..16f7db9c3 --- /dev/null +++ b/node_modules/es-abstract/2016/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/es-abstract/2016/ToLength.js b/node_modules/es-abstract/2016/ToLength.js new file mode 100644 index 000000000..1bef9bed7 --- /dev/null +++ b/node_modules/es-abstract/2016/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/es-abstract/2016/ToNumber.js b/node_modules/es-abstract/2016/ToNumber.js new file mode 100644 index 000000000..7a3cdc89e --- /dev/null +++ b/node_modules/es-abstract/2016/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/es-abstract/2016/ToObject.js b/node_modules/es-abstract/2016/ToObject.js new file mode 100644 index 000000000..50d5b94a4 --- /dev/null +++ b/node_modules/es-abstract/2016/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/es-abstract/2016/ToPrimitive.js b/node_modules/es-abstract/2016/ToPrimitive.js new file mode 100644 index 000000000..81c655d41 --- /dev/null +++ b/node_modules/es-abstract/2016/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/es-abstract/2016/ToPropertyDescriptor.js b/node_modules/es-abstract/2016/ToPropertyDescriptor.js new file mode 100644 index 000000000..38e536e2d --- /dev/null +++ b/node_modules/es-abstract/2016/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/es-abstract/2016/ToPropertyKey.js b/node_modules/es-abstract/2016/ToPropertyKey.js new file mode 100644 index 000000000..38f40dd80 --- /dev/null +++ b/node_modules/es-abstract/2016/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/es-abstract/2016/ToString.js b/node_modules/es-abstract/2016/ToString.js new file mode 100644 index 000000000..a34543126 --- /dev/null +++ b/node_modules/es-abstract/2016/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/es-abstract/2016/ToUint16.js b/node_modules/es-abstract/2016/ToUint16.js new file mode 100644 index 000000000..c8a408bfa --- /dev/null +++ b/node_modules/es-abstract/2016/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/es-abstract/2016/ToUint32.js b/node_modules/es-abstract/2016/ToUint32.js new file mode 100644 index 000000000..3660f6209 --- /dev/null +++ b/node_modules/es-abstract/2016/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/es-abstract/2016/ToUint8.js b/node_modules/es-abstract/2016/ToUint8.js new file mode 100644 index 000000000..bf8475321 --- /dev/null +++ b/node_modules/es-abstract/2016/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/es-abstract/2016/ToUint8Clamp.js b/node_modules/es-abstract/2016/ToUint8Clamp.js new file mode 100644 index 000000000..c7f9f5656 --- /dev/null +++ b/node_modules/es-abstract/2016/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/es-abstract/2016/Type.js b/node_modules/es-abstract/2016/Type.js new file mode 100644 index 000000000..0bd11659c --- /dev/null +++ b/node_modules/es-abstract/2016/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js b/node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 000000000..d4b900700 --- /dev/null +++ b/node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/es-abstract/2016/WeekDay.js b/node_modules/es-abstract/2016/WeekDay.js new file mode 100644 index 000000000..2973e0200 --- /dev/null +++ b/node_modules/es-abstract/2016/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/es-abstract/2016/YearFromTime.js b/node_modules/es-abstract/2016/YearFromTime.js new file mode 100644 index 000000000..ff5339f24 --- /dev/null +++ b/node_modules/es-abstract/2016/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/es-abstract/2016/modulo.js b/node_modules/es-abstract/2016/modulo.js new file mode 100644 index 000000000..bc04c0628 --- /dev/null +++ b/node_modules/es-abstract/2016/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/es-abstract/2016/msFromTime.js b/node_modules/es-abstract/2016/msFromTime.js new file mode 100644 index 000000000..c31eda085 --- /dev/null +++ b/node_modules/es-abstract/2016/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/es-abstract/2016/thisBooleanValue.js b/node_modules/es-abstract/2016/thisBooleanValue.js new file mode 100644 index 000000000..3ffac9cdf --- /dev/null +++ b/node_modules/es-abstract/2016/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/es-abstract/2016/thisNumberValue.js b/node_modules/es-abstract/2016/thisNumberValue.js new file mode 100644 index 000000000..0345e523f --- /dev/null +++ b/node_modules/es-abstract/2016/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/es-abstract/2016/thisStringValue.js b/node_modules/es-abstract/2016/thisStringValue.js new file mode 100644 index 000000000..3b99b6e3c --- /dev/null +++ b/node_modules/es-abstract/2016/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/es-abstract/2016/thisTimeValue.js b/node_modules/es-abstract/2016/thisTimeValue.js new file mode 100644 index 000000000..d7cda28c9 --- /dev/null +++ b/node_modules/es-abstract/2016/thisTimeValue.js @@ -0,0 +1,9 @@ +'use strict'; + +var $DateValueOf = require('../helpers/callBound')('Date.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + +module.exports = function thisTimeValue(value) { + return $DateValueOf(value); +}; diff --git a/node_modules/es-abstract/2017/AbstractEqualityComparison.js b/node_modules/es-abstract/2017/AbstractEqualityComparison.js new file mode 100644 index 000000000..40b390986 --- /dev/null +++ b/node_modules/es-abstract/2017/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/es-abstract/2017/AbstractRelationalComparison.js b/node_modules/es-abstract/2017/AbstractRelationalComparison.js new file mode 100644 index 000000000..bc7ca8324 --- /dev/null +++ b/node_modules/es-abstract/2017/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/es-abstract/2017/AdvanceStringIndex.js b/node_modules/es-abstract/2017/AdvanceStringIndex.js new file mode 100644 index 000000000..666f578b1 --- /dev/null +++ b/node_modules/es-abstract/2017/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/es-abstract/2017/ArrayCreate.js b/node_modules/es-abstract/2017/ArrayCreate.js new file mode 100644 index 000000000..fc9a7cf82 --- /dev/null +++ b/node_modules/es-abstract/2017/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/es-abstract/2017/ArraySetLength.js b/node_modules/es-abstract/2017/ArraySetLength.js new file mode 100644 index 000000000..c9134c6e6 --- /dev/null +++ b/node_modules/es-abstract/2017/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/es-abstract/2017/ArraySpeciesCreate.js b/node_modules/es-abstract/2017/ArraySpeciesCreate.js new file mode 100644 index 000000000..98b9b561d --- /dev/null +++ b/node_modules/es-abstract/2017/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/es-abstract/2017/Call.js b/node_modules/es-abstract/2017/Call.js new file mode 100644 index 000000000..f0f045174 --- /dev/null +++ b/node_modules/es-abstract/2017/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/es-abstract/2017/CanonicalNumericIndexString.js b/node_modules/es-abstract/2017/CanonicalNumericIndexString.js new file mode 100644 index 000000000..625f8539a --- /dev/null +++ b/node_modules/es-abstract/2017/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/es-abstract/2017/CompletePropertyDescriptor.js b/node_modules/es-abstract/2017/CompletePropertyDescriptor.js new file mode 100644 index 000000000..548bf415a --- /dev/null +++ b/node_modules/es-abstract/2017/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/es-abstract/2017/CreateDataProperty.js b/node_modules/es-abstract/2017/CreateDataProperty.js new file mode 100644 index 000000000..32a86ef04 --- /dev/null +++ b/node_modules/es-abstract/2017/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js b/node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js new file mode 100644 index 000000000..9feaec8d8 --- /dev/null +++ b/node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/es-abstract/2017/CreateHTML.js b/node_modules/es-abstract/2017/CreateHTML.js new file mode 100644 index 000000000..536c92db8 --- /dev/null +++ b/node_modules/es-abstract/2017/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/es-abstract/2017/CreateIterResultObject.js b/node_modules/es-abstract/2017/CreateIterResultObject.js new file mode 100644 index 000000000..aef1d2200 --- /dev/null +++ b/node_modules/es-abstract/2017/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/es-abstract/2017/CreateListFromArrayLike.js b/node_modules/es-abstract/2017/CreateListFromArrayLike.js new file mode 100644 index 000000000..d6b44b5dc --- /dev/null +++ b/node_modules/es-abstract/2017/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/es-abstract/2017/CreateMethodProperty.js b/node_modules/es-abstract/2017/CreateMethodProperty.js new file mode 100644 index 000000000..5b599aea1 --- /dev/null +++ b/node_modules/es-abstract/2017/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/es-abstract/2017/DateFromTime.js b/node_modules/es-abstract/2017/DateFromTime.js new file mode 100644 index 000000000..962dba168 --- /dev/null +++ b/node_modules/es-abstract/2017/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/es-abstract/2017/Day.js b/node_modules/es-abstract/2017/Day.js new file mode 100644 index 000000000..00df81342 --- /dev/null +++ b/node_modules/es-abstract/2017/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/es-abstract/2017/DayFromYear.js b/node_modules/es-abstract/2017/DayFromYear.js new file mode 100644 index 000000000..08dd5af60 --- /dev/null +++ b/node_modules/es-abstract/2017/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/es-abstract/2017/DayWithinYear.js b/node_modules/es-abstract/2017/DayWithinYear.js new file mode 100644 index 000000000..cfc400288 --- /dev/null +++ b/node_modules/es-abstract/2017/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/es-abstract/2017/DaysInYear.js b/node_modules/es-abstract/2017/DaysInYear.js new file mode 100644 index 000000000..db32251ff --- /dev/null +++ b/node_modules/es-abstract/2017/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/es-abstract/2017/DefinePropertyOrThrow.js b/node_modules/es-abstract/2017/DefinePropertyOrThrow.js new file mode 100644 index 000000000..7977f6e18 --- /dev/null +++ b/node_modules/es-abstract/2017/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/es-abstract/2017/DeletePropertyOrThrow.js b/node_modules/es-abstract/2017/DeletePropertyOrThrow.js new file mode 100644 index 000000000..b47681797 --- /dev/null +++ b/node_modules/es-abstract/2017/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/es-abstract/2017/EnumerableOwnProperties.js b/node_modules/es-abstract/2017/EnumerableOwnProperties.js new file mode 100644 index 000000000..e2ed7226c --- /dev/null +++ b/node_modules/es-abstract/2017/EnumerableOwnProperties.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var objectKeys = require('object-keys'); + +var callBound = require('../helpers/callBound'); + +var callBind = require('../helpers/callBind'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); +var $pushApply = callBind.apply(GetIntrinsic('%Array.prototype.push%')); + +var forEach = require('../helpers/forEach'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-enumerableownproperties + +module.exports = function EnumerableOwnProperties(O, kind) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + var keys = objectKeys(O); + if (kind === 'key') { + return keys; + } + if (kind === 'value' || kind === 'key+value') { + var results = []; + forEach(keys, function (key) { + if ($isEnumerable(O, key)) { + $pushApply(results, [ + kind === 'value' ? O[key] : [key, O[key]] + ]); + } + }); + return results; + } + throw new $TypeError('Assertion failed: "kind" is not "key", "value", or "key+value": ' + kind); +}; diff --git a/node_modules/es-abstract/2017/FromPropertyDescriptor.js b/node_modules/es-abstract/2017/FromPropertyDescriptor.js new file mode 100644 index 000000000..5ec200edb --- /dev/null +++ b/node_modules/es-abstract/2017/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/es-abstract/2017/Get.js b/node_modules/es-abstract/2017/Get.js new file mode 100644 index 000000000..5b9ad7860 --- /dev/null +++ b/node_modules/es-abstract/2017/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/es-abstract/2017/GetIterator.js b/node_modules/es-abstract/2017/GetIterator.js new file mode 100644 index 000000000..7beddacc0 --- /dev/null +++ b/node_modules/es-abstract/2017/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/es-abstract/2017/GetMethod.js b/node_modules/es-abstract/2017/GetMethod.js new file mode 100644 index 000000000..aef8cbc4a --- /dev/null +++ b/node_modules/es-abstract/2017/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/es-abstract/2017/GetOwnPropertyKeys.js b/node_modules/es-abstract/2017/GetOwnPropertyKeys.js new file mode 100644 index 000000000..8d7e5eee5 --- /dev/null +++ b/node_modules/es-abstract/2017/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/es-abstract/2017/GetPrototypeFromConstructor.js b/node_modules/es-abstract/2017/GetPrototypeFromConstructor.js new file mode 100644 index 000000000..62da8fb5f --- /dev/null +++ b/node_modules/es-abstract/2017/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/es-abstract/2017/GetSubstitution.js b/node_modules/es-abstract/2017/GetSubstitution.js new file mode 100644 index 000000000..de41b011a --- /dev/null +++ b/node_modules/es-abstract/2017/GetSubstitution.js @@ -0,0 +1,104 @@ + +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $parseInt = GetIntrinsic('%parseInt%'); + +var inspect = require('object-inspect'); + +var regexTester = require('../helpers/regexTester'); +var callBound = require('../helpers/callBound'); +var every = require('../helpers/every'); + +var isDigit = regexTester(/^[0-9]$/); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); + +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/es-abstract/2017/GetV.js b/node_modules/es-abstract/2017/GetV.js new file mode 100644 index 000000000..7b5139ace --- /dev/null +++ b/node_modules/es-abstract/2017/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/es-abstract/2017/HasOwnProperty.js b/node_modules/es-abstract/2017/HasOwnProperty.js new file mode 100644 index 000000000..679059f2e --- /dev/null +++ b/node_modules/es-abstract/2017/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/es-abstract/2017/HasProperty.js b/node_modules/es-abstract/2017/HasProperty.js new file mode 100644 index 000000000..5f2d2122a --- /dev/null +++ b/node_modules/es-abstract/2017/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/es-abstract/2017/HourFromTime.js b/node_modules/es-abstract/2017/HourFromTime.js new file mode 100644 index 000000000..957ce321a --- /dev/null +++ b/node_modules/es-abstract/2017/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/es-abstract/2017/InLeapYear.js b/node_modules/es-abstract/2017/InLeapYear.js new file mode 100644 index 000000000..38ba8fdc8 --- /dev/null +++ b/node_modules/es-abstract/2017/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/es-abstract/2017/InstanceofOperator.js b/node_modules/es-abstract/2017/InstanceofOperator.js new file mode 100644 index 000000000..ebd308c4b --- /dev/null +++ b/node_modules/es-abstract/2017/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/es-abstract/2017/Invoke.js b/node_modules/es-abstract/2017/Invoke.js new file mode 100644 index 000000000..769f0e308 --- /dev/null +++ b/node_modules/es-abstract/2017/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/es-abstract/2017/IsAccessorDescriptor.js b/node_modules/es-abstract/2017/IsAccessorDescriptor.js new file mode 100644 index 000000000..513946462 --- /dev/null +++ b/node_modules/es-abstract/2017/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/es-abstract/2017/IsArray.js b/node_modules/es-abstract/2017/IsArray.js new file mode 100644 index 000000000..7b25f37b5 --- /dev/null +++ b/node_modules/es-abstract/2017/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/es-abstract/2017/IsCallable.js b/node_modules/es-abstract/2017/IsCallable.js new file mode 100644 index 000000000..e4bfa365c --- /dev/null +++ b/node_modules/es-abstract/2017/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/es-abstract/2017/IsConcatSpreadable.js b/node_modules/es-abstract/2017/IsConcatSpreadable.js new file mode 100644 index 000000000..dc8aae1e6 --- /dev/null +++ b/node_modules/es-abstract/2017/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/es-abstract/2017/IsConstructor.js b/node_modules/es-abstract/2017/IsConstructor.js new file mode 100644 index 000000000..8ba9fe55b --- /dev/null +++ b/node_modules/es-abstract/2017/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/es-abstract/2017/IsDataDescriptor.js b/node_modules/es-abstract/2017/IsDataDescriptor.js new file mode 100644 index 000000000..0ad304585 --- /dev/null +++ b/node_modules/es-abstract/2017/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/es-abstract/2017/IsExtensible.js b/node_modules/es-abstract/2017/IsExtensible.js new file mode 100644 index 000000000..0c4c8a60c --- /dev/null +++ b/node_modules/es-abstract/2017/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/es-abstract/2017/IsGenericDescriptor.js b/node_modules/es-abstract/2017/IsGenericDescriptor.js new file mode 100644 index 000000000..8618ce414 --- /dev/null +++ b/node_modules/es-abstract/2017/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/es-abstract/2017/IsInteger.js b/node_modules/es-abstract/2017/IsInteger.js new file mode 100644 index 000000000..0f488b39a --- /dev/null +++ b/node_modules/es-abstract/2017/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/es-abstract/2017/IsPromise.js b/node_modules/es-abstract/2017/IsPromise.js new file mode 100644 index 000000000..e8e92a2b8 --- /dev/null +++ b/node_modules/es-abstract/2017/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/es-abstract/2017/IsPropertyDescriptor.js b/node_modules/es-abstract/2017/IsPropertyDescriptor.js new file mode 100644 index 000000000..2a96c637b --- /dev/null +++ b/node_modules/es-abstract/2017/IsPropertyDescriptor.js @@ -0,0 +1,17 @@ +'use strict'; + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + +module.exports = function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor({ + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor, + Type: Type + }, Desc); +}; diff --git a/node_modules/es-abstract/2017/IsPropertyKey.js b/node_modules/es-abstract/2017/IsPropertyKey.js new file mode 100644 index 000000000..74b8d95d4 --- /dev/null +++ b/node_modules/es-abstract/2017/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/es-abstract/2017/IsRegExp.js b/node_modules/es-abstract/2017/IsRegExp.js new file mode 100644 index 000000000..fdf2323ff --- /dev/null +++ b/node_modules/es-abstract/2017/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/es-abstract/2017/IterableToList.js b/node_modules/es-abstract/2017/IterableToList.js new file mode 100644 index 000000000..0b8cdcfe3 --- /dev/null +++ b/node_modules/es-abstract/2017/IterableToList.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); +var $arrayPush = callBound('Array.prototype.push'); + +var GetIterator = require('./GetIterator'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-iterabletolist + +module.exports = function IterableToList(items, method) { + var iterator = GetIterator(items, method); + var values = []; + var next = true; + while (next) { + next = IteratorStep(iterator); + if (next) { + var nextValue = IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; +}; diff --git a/node_modules/es-abstract/2017/IteratorClose.js b/node_modules/es-abstract/2017/IteratorClose.js new file mode 100644 index 000000000..35c8c2bea --- /dev/null +++ b/node_modules/es-abstract/2017/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/es-abstract/2017/IteratorComplete.js b/node_modules/es-abstract/2017/IteratorComplete.js new file mode 100644 index 000000000..a62b9bfc1 --- /dev/null +++ b/node_modules/es-abstract/2017/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/es-abstract/2017/IteratorNext.js b/node_modules/es-abstract/2017/IteratorNext.js new file mode 100644 index 000000000..7e5991561 --- /dev/null +++ b/node_modules/es-abstract/2017/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/es-abstract/2017/IteratorStep.js b/node_modules/es-abstract/2017/IteratorStep.js new file mode 100644 index 000000000..41b9d1b25 --- /dev/null +++ b/node_modules/es-abstract/2017/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/es-abstract/2017/IteratorValue.js b/node_modules/es-abstract/2017/IteratorValue.js new file mode 100644 index 000000000..5e71a4463 --- /dev/null +++ b/node_modules/es-abstract/2017/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/es-abstract/2017/MakeDate.js b/node_modules/es-abstract/2017/MakeDate.js new file mode 100644 index 000000000..7b592d136 --- /dev/null +++ b/node_modules/es-abstract/2017/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/es-abstract/2017/MakeDay.js b/node_modules/es-abstract/2017/MakeDay.js new file mode 100644 index 000000000..f1ab81060 --- /dev/null +++ b/node_modules/es-abstract/2017/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/es-abstract/2017/MakeTime.js b/node_modules/es-abstract/2017/MakeTime.js new file mode 100644 index 000000000..e11850040 --- /dev/null +++ b/node_modules/es-abstract/2017/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/es-abstract/2017/MinFromTime.js b/node_modules/es-abstract/2017/MinFromTime.js new file mode 100644 index 000000000..e80e19108 --- /dev/null +++ b/node_modules/es-abstract/2017/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/es-abstract/2017/MonthFromTime.js b/node_modules/es-abstract/2017/MonthFromTime.js new file mode 100644 index 000000000..4f120f2c2 --- /dev/null +++ b/node_modules/es-abstract/2017/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/es-abstract/2017/ObjectCreate.js b/node_modules/es-abstract/2017/ObjectCreate.js new file mode 100644 index 000000000..e2445b022 --- /dev/null +++ b/node_modules/es-abstract/2017/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js b/node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js new file mode 100644 index 000000000..59780b3bb --- /dev/null +++ b/node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js b/node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js new file mode 100644 index 000000000..b9882e5dc --- /dev/null +++ b/node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js b/node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js new file mode 100644 index 000000000..344077a40 --- /dev/null +++ b/node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $getProto = require('../helpers/getProto'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof + +module.exports = function OrdinaryGetPrototypeOf(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!$getProto) { + throw new $TypeError('This environment does not support fetching prototypes.'); + } + return $getProto(O); +}; diff --git a/node_modules/es-abstract/2017/OrdinaryHasInstance.js b/node_modules/es-abstract/2017/OrdinaryHasInstance.js new file mode 100644 index 000000000..51abe26d5 --- /dev/null +++ b/node_modules/es-abstract/2017/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/es-abstract/2017/OrdinaryHasProperty.js b/node_modules/es-abstract/2017/OrdinaryHasProperty.js new file mode 100644 index 000000000..076c25ac5 --- /dev/null +++ b/node_modules/es-abstract/2017/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js b/node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js new file mode 100644 index 000000000..3541331ca --- /dev/null +++ b/node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $setProto = require('../helpers/setProto'); + +var OrdinaryGetPrototypeOf = require('./OrdinaryGetPrototypeOf'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof + +module.exports = function OrdinarySetPrototypeOf(O, V) { + if (Type(V) !== 'Object' && Type(V) !== 'Null') { + throw new $TypeError('Assertion failed: V must be Object or Null'); + } + /* + var extensible = IsExtensible(O); + var current = OrdinaryGetPrototypeOf(O); + if (SameValue(V, current)) { + return true; + } + if (!extensible) { + return false; + } + */ + try { + $setProto(O, V); + } catch (e) { + return false; + } + return OrdinaryGetPrototypeOf(O) === V; + /* + var p = V; + var done = false; + while (!done) { + if (p === null) { + done = true; + } else if (SameValue(p, O)) { + return false; + } else { + if (wat) { + done = true; + } else { + p = p.[[Prototype]]; + } + } + } + O.[[Prototype]] = V; + return true; + */ +}; diff --git a/node_modules/es-abstract/2017/RegExpExec.js b/node_modules/es-abstract/2017/RegExpExec.js new file mode 100644 index 000000000..15c91867d --- /dev/null +++ b/node_modules/es-abstract/2017/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/es-abstract/2017/RequireObjectCoercible.js b/node_modules/es-abstract/2017/RequireObjectCoercible.js new file mode 100644 index 000000000..9008359db --- /dev/null +++ b/node_modules/es-abstract/2017/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/es-abstract/2017/SameValue.js b/node_modules/es-abstract/2017/SameValue.js new file mode 100644 index 000000000..47c936d76 --- /dev/null +++ b/node_modules/es-abstract/2017/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/es-abstract/2017/SameValueNonNumber.js b/node_modules/es-abstract/2017/SameValueNonNumber.js new file mode 100644 index 000000000..5668752e3 --- /dev/null +++ b/node_modules/es-abstract/2017/SameValueNonNumber.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); + +// https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber + +module.exports = function SameValueNonNumber(x, y) { + if (typeof x === 'number' || typeof x !== typeof y) { + throw new $TypeError('SameValueNonNumber requires two non-number values of the same type.'); + } + return SameValue(x, y); +}; diff --git a/node_modules/es-abstract/2017/SameValueZero.js b/node_modules/es-abstract/2017/SameValueZero.js new file mode 100644 index 000000000..0dedcd2c3 --- /dev/null +++ b/node_modules/es-abstract/2017/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/es-abstract/2017/SecFromTime.js b/node_modules/es-abstract/2017/SecFromTime.js new file mode 100644 index 000000000..7190011d2 --- /dev/null +++ b/node_modules/es-abstract/2017/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/es-abstract/2017/Set.js b/node_modules/es-abstract/2017/Set.js new file mode 100644 index 000000000..9545b1325 --- /dev/null +++ b/node_modules/es-abstract/2017/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/es-abstract/2017/SetFunctionName.js b/node_modules/es-abstract/2017/SetFunctionName.js new file mode 100644 index 000000000..f93324a73 --- /dev/null +++ b/node_modules/es-abstract/2017/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/es-abstract/2017/SetIntegrityLevel.js b/node_modules/es-abstract/2017/SetIntegrityLevel.js new file mode 100644 index 000000000..3d5c81d56 --- /dev/null +++ b/node_modules/es-abstract/2017/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/es-abstract/2017/SpeciesConstructor.js b/node_modules/es-abstract/2017/SpeciesConstructor.js new file mode 100644 index 000000000..3cdcd747d --- /dev/null +++ b/node_modules/es-abstract/2017/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/es-abstract/2017/StrictEqualityComparison.js b/node_modules/es-abstract/2017/StrictEqualityComparison.js new file mode 100644 index 000000000..eea5df388 --- /dev/null +++ b/node_modules/es-abstract/2017/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/es-abstract/2017/SymbolDescriptiveString.js b/node_modules/es-abstract/2017/SymbolDescriptiveString.js new file mode 100644 index 000000000..7bd8191ad --- /dev/null +++ b/node_modules/es-abstract/2017/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/es-abstract/2017/TestIntegrityLevel.js b/node_modules/es-abstract/2017/TestIntegrityLevel.js new file mode 100644 index 000000000..7a57397d5 --- /dev/null +++ b/node_modules/es-abstract/2017/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/es-abstract/2017/TimeClip.js b/node_modules/es-abstract/2017/TimeClip.js new file mode 100644 index 000000000..57aa08cb9 --- /dev/null +++ b/node_modules/es-abstract/2017/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/es-abstract/2017/TimeFromYear.js b/node_modules/es-abstract/2017/TimeFromYear.js new file mode 100644 index 000000000..df646c36e --- /dev/null +++ b/node_modules/es-abstract/2017/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/es-abstract/2017/TimeWithinDay.js b/node_modules/es-abstract/2017/TimeWithinDay.js new file mode 100644 index 000000000..c5b21d378 --- /dev/null +++ b/node_modules/es-abstract/2017/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/es-abstract/2017/ToBoolean.js b/node_modules/es-abstract/2017/ToBoolean.js new file mode 100644 index 000000000..65d87376d --- /dev/null +++ b/node_modules/es-abstract/2017/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/es-abstract/2017/ToDateString.js b/node_modules/es-abstract/2017/ToDateString.js new file mode 100644 index 000000000..7a6d4c4e9 --- /dev/null +++ b/node_modules/es-abstract/2017/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/es-abstract/2017/ToIndex.js b/node_modules/es-abstract/2017/ToIndex.js new file mode 100644 index 000000000..a55398d3e --- /dev/null +++ b/node_modules/es-abstract/2017/ToIndex.js @@ -0,0 +1,26 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); + +var ToInteger = require('./ToInteger'); +var ToLength = require('./ToLength'); +var SameValueZero = require('./SameValueZero'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-toindex + +module.exports = function ToIndex(value) { + if (typeof value === 'undefined') { + return 0; + } + var integerIndex = ToInteger(value); + if (integerIndex < 0) { + throw new $RangeError('index must be >= 0'); + } + var index = ToLength(integerIndex); + if (!SameValueZero(integerIndex, index)) { + throw new $RangeError('index must be >= 0 and < 2 ** 53 - 1'); + } + return index; +}; diff --git a/node_modules/es-abstract/2017/ToInt16.js b/node_modules/es-abstract/2017/ToInt16.js new file mode 100644 index 000000000..5a112c237 --- /dev/null +++ b/node_modules/es-abstract/2017/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/es-abstract/2017/ToInt32.js b/node_modules/es-abstract/2017/ToInt32.js new file mode 100644 index 000000000..a8d268070 --- /dev/null +++ b/node_modules/es-abstract/2017/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/es-abstract/2017/ToInt8.js b/node_modules/es-abstract/2017/ToInt8.js new file mode 100644 index 000000000..d103123a9 --- /dev/null +++ b/node_modules/es-abstract/2017/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/es-abstract/2017/ToInteger.js b/node_modules/es-abstract/2017/ToInteger.js new file mode 100644 index 000000000..16f7db9c3 --- /dev/null +++ b/node_modules/es-abstract/2017/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/es-abstract/2017/ToLength.js b/node_modules/es-abstract/2017/ToLength.js new file mode 100644 index 000000000..1bef9bed7 --- /dev/null +++ b/node_modules/es-abstract/2017/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/es-abstract/2017/ToNumber.js b/node_modules/es-abstract/2017/ToNumber.js new file mode 100644 index 000000000..7a3cdc89e --- /dev/null +++ b/node_modules/es-abstract/2017/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/es-abstract/2017/ToObject.js b/node_modules/es-abstract/2017/ToObject.js new file mode 100644 index 000000000..50d5b94a4 --- /dev/null +++ b/node_modules/es-abstract/2017/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/es-abstract/2017/ToPrimitive.js b/node_modules/es-abstract/2017/ToPrimitive.js new file mode 100644 index 000000000..81c655d41 --- /dev/null +++ b/node_modules/es-abstract/2017/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/es-abstract/2017/ToPropertyDescriptor.js b/node_modules/es-abstract/2017/ToPropertyDescriptor.js new file mode 100644 index 000000000..38e536e2d --- /dev/null +++ b/node_modules/es-abstract/2017/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/es-abstract/2017/ToPropertyKey.js b/node_modules/es-abstract/2017/ToPropertyKey.js new file mode 100644 index 000000000..38f40dd80 --- /dev/null +++ b/node_modules/es-abstract/2017/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/es-abstract/2017/ToString.js b/node_modules/es-abstract/2017/ToString.js new file mode 100644 index 000000000..a34543126 --- /dev/null +++ b/node_modules/es-abstract/2017/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/es-abstract/2017/ToUint16.js b/node_modules/es-abstract/2017/ToUint16.js new file mode 100644 index 000000000..c8a408bfa --- /dev/null +++ b/node_modules/es-abstract/2017/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/es-abstract/2017/ToUint32.js b/node_modules/es-abstract/2017/ToUint32.js new file mode 100644 index 000000000..3660f6209 --- /dev/null +++ b/node_modules/es-abstract/2017/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/es-abstract/2017/ToUint8.js b/node_modules/es-abstract/2017/ToUint8.js new file mode 100644 index 000000000..bf8475321 --- /dev/null +++ b/node_modules/es-abstract/2017/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/es-abstract/2017/ToUint8Clamp.js b/node_modules/es-abstract/2017/ToUint8Clamp.js new file mode 100644 index 000000000..c7f9f5656 --- /dev/null +++ b/node_modules/es-abstract/2017/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/es-abstract/2017/Type.js b/node_modules/es-abstract/2017/Type.js new file mode 100644 index 000000000..0bd11659c --- /dev/null +++ b/node_modules/es-abstract/2017/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js b/node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 000000000..d4b900700 --- /dev/null +++ b/node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/es-abstract/2017/WeekDay.js b/node_modules/es-abstract/2017/WeekDay.js new file mode 100644 index 000000000..2973e0200 --- /dev/null +++ b/node_modules/es-abstract/2017/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/es-abstract/2017/YearFromTime.js b/node_modules/es-abstract/2017/YearFromTime.js new file mode 100644 index 000000000..ff5339f24 --- /dev/null +++ b/node_modules/es-abstract/2017/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/es-abstract/2017/modulo.js b/node_modules/es-abstract/2017/modulo.js new file mode 100644 index 000000000..bc04c0628 --- /dev/null +++ b/node_modules/es-abstract/2017/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/es-abstract/2017/msFromTime.js b/node_modules/es-abstract/2017/msFromTime.js new file mode 100644 index 000000000..c31eda085 --- /dev/null +++ b/node_modules/es-abstract/2017/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/es-abstract/2017/thisBooleanValue.js b/node_modules/es-abstract/2017/thisBooleanValue.js new file mode 100644 index 000000000..3ffac9cdf --- /dev/null +++ b/node_modules/es-abstract/2017/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/es-abstract/2017/thisNumberValue.js b/node_modules/es-abstract/2017/thisNumberValue.js new file mode 100644 index 000000000..0345e523f --- /dev/null +++ b/node_modules/es-abstract/2017/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/es-abstract/2017/thisStringValue.js b/node_modules/es-abstract/2017/thisStringValue.js new file mode 100644 index 000000000..3b99b6e3c --- /dev/null +++ b/node_modules/es-abstract/2017/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/es-abstract/2017/thisTimeValue.js b/node_modules/es-abstract/2017/thisTimeValue.js new file mode 100644 index 000000000..d7cda28c9 --- /dev/null +++ b/node_modules/es-abstract/2017/thisTimeValue.js @@ -0,0 +1,9 @@ +'use strict'; + +var $DateValueOf = require('../helpers/callBound')('Date.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + +module.exports = function thisTimeValue(value) { + return $DateValueOf(value); +}; diff --git a/node_modules/es-abstract/2018/AbstractEqualityComparison.js b/node_modules/es-abstract/2018/AbstractEqualityComparison.js new file mode 100644 index 000000000..40b390986 --- /dev/null +++ b/node_modules/es-abstract/2018/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/es-abstract/2018/AbstractRelationalComparison.js b/node_modules/es-abstract/2018/AbstractRelationalComparison.js new file mode 100644 index 000000000..bc7ca8324 --- /dev/null +++ b/node_modules/es-abstract/2018/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/es-abstract/2018/AdvanceStringIndex.js b/node_modules/es-abstract/2018/AdvanceStringIndex.js new file mode 100644 index 000000000..666f578b1 --- /dev/null +++ b/node_modules/es-abstract/2018/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/es-abstract/2018/ArrayCreate.js b/node_modules/es-abstract/2018/ArrayCreate.js new file mode 100644 index 000000000..fc9a7cf82 --- /dev/null +++ b/node_modules/es-abstract/2018/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/es-abstract/2018/ArraySetLength.js b/node_modules/es-abstract/2018/ArraySetLength.js new file mode 100644 index 000000000..c9134c6e6 --- /dev/null +++ b/node_modules/es-abstract/2018/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/es-abstract/2018/ArraySpeciesCreate.js b/node_modules/es-abstract/2018/ArraySpeciesCreate.js new file mode 100644 index 000000000..98b9b561d --- /dev/null +++ b/node_modules/es-abstract/2018/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/es-abstract/2018/Call.js b/node_modules/es-abstract/2018/Call.js new file mode 100644 index 000000000..f0f045174 --- /dev/null +++ b/node_modules/es-abstract/2018/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/es-abstract/2018/CanonicalNumericIndexString.js b/node_modules/es-abstract/2018/CanonicalNumericIndexString.js new file mode 100644 index 000000000..625f8539a --- /dev/null +++ b/node_modules/es-abstract/2018/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/es-abstract/2018/CompletePropertyDescriptor.js b/node_modules/es-abstract/2018/CompletePropertyDescriptor.js new file mode 100644 index 000000000..548bf415a --- /dev/null +++ b/node_modules/es-abstract/2018/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/es-abstract/2018/CopyDataProperties.js b/node_modules/es-abstract/2018/CopyDataProperties.js new file mode 100644 index 000000000..842709903 --- /dev/null +++ b/node_modules/es-abstract/2018/CopyDataProperties.js @@ -0,0 +1,64 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); +var forEach = require('../helpers/forEach'); +var OwnPropertyKeys = require('../helpers/OwnPropertyKeys'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var CreateDataProperty = require('./CreateDataProperty'); +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToObject = require('./ToObject'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-copydataproperties + +module.exports = function CopyDataProperties(target, source, excludedItems) { + if (Type(target) !== 'Object') { + throw new TypeError('Assertion failed: "target" must be an Object'); + } + + if (!IsArray(excludedItems)) { + throw new TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); + } + for (var i = 0; i < excludedItems.length; i += 1) { + if (!IsPropertyKey(excludedItems[i])) { + throw new TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); + } + } + + if (typeof source === 'undefined' || source === null) { + return target; + } + + var fromObj = ToObject(source); + + var sourceKeys = OwnPropertyKeys(fromObj); + forEach(sourceKeys, function (nextKey) { + var excluded = false; + + forEach(excludedItems, function (e) { + if (SameValue(e, nextKey) === true) { + excluded = true; + } + }); + + var enumerable = $isEnumerable(fromObj, nextKey) || ( + // this is to handle string keys being non-enumerable in older engines + typeof source === 'string' + && nextKey >= 0 + && IsInteger(ToNumber(nextKey)) + ); + if (excluded === false && enumerable) { + var propValue = Get(fromObj, nextKey); + CreateDataProperty(target, nextKey, propValue); + } + }); + + return target; +}; diff --git a/node_modules/es-abstract/2018/CreateDataProperty.js b/node_modules/es-abstract/2018/CreateDataProperty.js new file mode 100644 index 000000000..32a86ef04 --- /dev/null +++ b/node_modules/es-abstract/2018/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js b/node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js new file mode 100644 index 000000000..9feaec8d8 --- /dev/null +++ b/node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/es-abstract/2018/CreateHTML.js b/node_modules/es-abstract/2018/CreateHTML.js new file mode 100644 index 000000000..536c92db8 --- /dev/null +++ b/node_modules/es-abstract/2018/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/es-abstract/2018/CreateIterResultObject.js b/node_modules/es-abstract/2018/CreateIterResultObject.js new file mode 100644 index 000000000..aef1d2200 --- /dev/null +++ b/node_modules/es-abstract/2018/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/es-abstract/2018/CreateListFromArrayLike.js b/node_modules/es-abstract/2018/CreateListFromArrayLike.js new file mode 100644 index 000000000..d6b44b5dc --- /dev/null +++ b/node_modules/es-abstract/2018/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/es-abstract/2018/CreateMethodProperty.js b/node_modules/es-abstract/2018/CreateMethodProperty.js new file mode 100644 index 000000000..5b599aea1 --- /dev/null +++ b/node_modules/es-abstract/2018/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/es-abstract/2018/DateFromTime.js b/node_modules/es-abstract/2018/DateFromTime.js new file mode 100644 index 000000000..962dba168 --- /dev/null +++ b/node_modules/es-abstract/2018/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/es-abstract/2018/DateString.js b/node_modules/es-abstract/2018/DateString.js new file mode 100644 index 000000000..fc3032906 --- /dev/null +++ b/node_modules/es-abstract/2018/DateString.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var weekdays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; + +var $isNaN = require('../helpers/isNaN'); +var padTimeComponent = require('../helpers/padTimeComponent'); + +var Type = require('./Type'); +var WeekDay = require('./WeekDay'); +var MonthFromTime = require('./MonthFromTime'); +var YearFromTime = require('./YearFromTime'); +var DateFromTime = require('./DateFromTime'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-datestring + +module.exports = function DateString(tv) { + if (Type(tv) !== 'Number' || $isNaN(tv)) { + throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number'); + } + var weekday = weekdays[WeekDay(tv)]; + var month = months[MonthFromTime(tv)]; + var day = padTimeComponent(DateFromTime(tv)); + var year = padTimeComponent(YearFromTime(tv), 4); + return weekday + '\x20' + month + '\x20' + day + '\x20' + year; +}; diff --git a/node_modules/es-abstract/2018/Day.js b/node_modules/es-abstract/2018/Day.js new file mode 100644 index 000000000..00df81342 --- /dev/null +++ b/node_modules/es-abstract/2018/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/es-abstract/2018/DayFromYear.js b/node_modules/es-abstract/2018/DayFromYear.js new file mode 100644 index 000000000..08dd5af60 --- /dev/null +++ b/node_modules/es-abstract/2018/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/es-abstract/2018/DayWithinYear.js b/node_modules/es-abstract/2018/DayWithinYear.js new file mode 100644 index 000000000..cfc400288 --- /dev/null +++ b/node_modules/es-abstract/2018/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/es-abstract/2018/DaysInYear.js b/node_modules/es-abstract/2018/DaysInYear.js new file mode 100644 index 000000000..db32251ff --- /dev/null +++ b/node_modules/es-abstract/2018/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/es-abstract/2018/DefinePropertyOrThrow.js b/node_modules/es-abstract/2018/DefinePropertyOrThrow.js new file mode 100644 index 000000000..7977f6e18 --- /dev/null +++ b/node_modules/es-abstract/2018/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/es-abstract/2018/DeletePropertyOrThrow.js b/node_modules/es-abstract/2018/DeletePropertyOrThrow.js new file mode 100644 index 000000000..b47681797 --- /dev/null +++ b/node_modules/es-abstract/2018/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js b/node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js new file mode 100644 index 000000000..e2ed7226c --- /dev/null +++ b/node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var objectKeys = require('object-keys'); + +var callBound = require('../helpers/callBound'); + +var callBind = require('../helpers/callBind'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); +var $pushApply = callBind.apply(GetIntrinsic('%Array.prototype.push%')); + +var forEach = require('../helpers/forEach'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-enumerableownproperties + +module.exports = function EnumerableOwnProperties(O, kind) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + var keys = objectKeys(O); + if (kind === 'key') { + return keys; + } + if (kind === 'value' || kind === 'key+value') { + var results = []; + forEach(keys, function (key) { + if ($isEnumerable(O, key)) { + $pushApply(results, [ + kind === 'value' ? O[key] : [key, O[key]] + ]); + } + }); + return results; + } + throw new $TypeError('Assertion failed: "kind" is not "key", "value", or "key+value": ' + kind); +}; diff --git a/node_modules/es-abstract/2018/FromPropertyDescriptor.js b/node_modules/es-abstract/2018/FromPropertyDescriptor.js new file mode 100644 index 000000000..5ec200edb --- /dev/null +++ b/node_modules/es-abstract/2018/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/es-abstract/2018/Get.js b/node_modules/es-abstract/2018/Get.js new file mode 100644 index 000000000..5b9ad7860 --- /dev/null +++ b/node_modules/es-abstract/2018/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/es-abstract/2018/GetIterator.js b/node_modules/es-abstract/2018/GetIterator.js new file mode 100644 index 000000000..7beddacc0 --- /dev/null +++ b/node_modules/es-abstract/2018/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/es-abstract/2018/GetMethod.js b/node_modules/es-abstract/2018/GetMethod.js new file mode 100644 index 000000000..aef8cbc4a --- /dev/null +++ b/node_modules/es-abstract/2018/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/es-abstract/2018/GetOwnPropertyKeys.js b/node_modules/es-abstract/2018/GetOwnPropertyKeys.js new file mode 100644 index 000000000..8d7e5eee5 --- /dev/null +++ b/node_modules/es-abstract/2018/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/es-abstract/2018/GetPrototypeFromConstructor.js b/node_modules/es-abstract/2018/GetPrototypeFromConstructor.js new file mode 100644 index 000000000..62da8fb5f --- /dev/null +++ b/node_modules/es-abstract/2018/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/es-abstract/2018/GetSubstitution.js b/node_modules/es-abstract/2018/GetSubstitution.js new file mode 100644 index 000000000..2ec9ebc50 --- /dev/null +++ b/node_modules/es-abstract/2018/GetSubstitution.js @@ -0,0 +1,128 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var every = require('../helpers/every'); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); +var $indexOf = callBound('String.prototype.indexOf'); +var $parseInt = parseInt; + +var isDigit = regexTester(/^[0-9]$/); + +var inspect = require('object-inspect'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var ToObject = require('./ToObject'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// http://www.ecma-international.org/ecma-262/9.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, namedCaptures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + if (Type(namedCaptures) !== 'Undefined') { + namedCaptures = ToObject(namedCaptures); // eslint-disable-line no-param-reassign + } + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else if (next === '<') { + // eslint-disable-next-line max-depth + if (Type(namedCaptures) === 'Undefined') { + result += '$<'; + i += 2; + } else { + var endIndex = $indexOf(replacement, '>', i); + // eslint-disable-next-line max-depth + if (endIndex > -1) { + var groupName = $strSlice(replacement, i, endIndex); + var capture = Get(namedCaptures, groupName); + // eslint-disable-next-line max-depth + if (Type(capture) !== 'Undefined') { + result += ToString(capture); + } + i += '$<' + groupName + '>'.length; + } + } + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/es-abstract/2018/GetV.js b/node_modules/es-abstract/2018/GetV.js new file mode 100644 index 000000000..7b5139ace --- /dev/null +++ b/node_modules/es-abstract/2018/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/es-abstract/2018/HasOwnProperty.js b/node_modules/es-abstract/2018/HasOwnProperty.js new file mode 100644 index 000000000..679059f2e --- /dev/null +++ b/node_modules/es-abstract/2018/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/es-abstract/2018/HasProperty.js b/node_modules/es-abstract/2018/HasProperty.js new file mode 100644 index 000000000..5f2d2122a --- /dev/null +++ b/node_modules/es-abstract/2018/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/es-abstract/2018/HourFromTime.js b/node_modules/es-abstract/2018/HourFromTime.js new file mode 100644 index 000000000..957ce321a --- /dev/null +++ b/node_modules/es-abstract/2018/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/es-abstract/2018/InLeapYear.js b/node_modules/es-abstract/2018/InLeapYear.js new file mode 100644 index 000000000..38ba8fdc8 --- /dev/null +++ b/node_modules/es-abstract/2018/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/es-abstract/2018/InstanceofOperator.js b/node_modules/es-abstract/2018/InstanceofOperator.js new file mode 100644 index 000000000..ebd308c4b --- /dev/null +++ b/node_modules/es-abstract/2018/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/es-abstract/2018/Invoke.js b/node_modules/es-abstract/2018/Invoke.js new file mode 100644 index 000000000..769f0e308 --- /dev/null +++ b/node_modules/es-abstract/2018/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/es-abstract/2018/IsAccessorDescriptor.js b/node_modules/es-abstract/2018/IsAccessorDescriptor.js new file mode 100644 index 000000000..513946462 --- /dev/null +++ b/node_modules/es-abstract/2018/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/es-abstract/2018/IsArray.js b/node_modules/es-abstract/2018/IsArray.js new file mode 100644 index 000000000..7b25f37b5 --- /dev/null +++ b/node_modules/es-abstract/2018/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/es-abstract/2018/IsCallable.js b/node_modules/es-abstract/2018/IsCallable.js new file mode 100644 index 000000000..e4bfa365c --- /dev/null +++ b/node_modules/es-abstract/2018/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/es-abstract/2018/IsConcatSpreadable.js b/node_modules/es-abstract/2018/IsConcatSpreadable.js new file mode 100644 index 000000000..dc8aae1e6 --- /dev/null +++ b/node_modules/es-abstract/2018/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/es-abstract/2018/IsConstructor.js b/node_modules/es-abstract/2018/IsConstructor.js new file mode 100644 index 000000000..8ba9fe55b --- /dev/null +++ b/node_modules/es-abstract/2018/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/es-abstract/2018/IsDataDescriptor.js b/node_modules/es-abstract/2018/IsDataDescriptor.js new file mode 100644 index 000000000..0ad304585 --- /dev/null +++ b/node_modules/es-abstract/2018/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/es-abstract/2018/IsExtensible.js b/node_modules/es-abstract/2018/IsExtensible.js new file mode 100644 index 000000000..0c4c8a60c --- /dev/null +++ b/node_modules/es-abstract/2018/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/es-abstract/2018/IsGenericDescriptor.js b/node_modules/es-abstract/2018/IsGenericDescriptor.js new file mode 100644 index 000000000..8618ce414 --- /dev/null +++ b/node_modules/es-abstract/2018/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/es-abstract/2018/IsInteger.js b/node_modules/es-abstract/2018/IsInteger.js new file mode 100644 index 000000000..0f488b39a --- /dev/null +++ b/node_modules/es-abstract/2018/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/es-abstract/2018/IsPromise.js b/node_modules/es-abstract/2018/IsPromise.js new file mode 100644 index 000000000..e8e92a2b8 --- /dev/null +++ b/node_modules/es-abstract/2018/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/es-abstract/2018/IsPropertyKey.js b/node_modules/es-abstract/2018/IsPropertyKey.js new file mode 100644 index 000000000..74b8d95d4 --- /dev/null +++ b/node_modules/es-abstract/2018/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/es-abstract/2018/IsRegExp.js b/node_modules/es-abstract/2018/IsRegExp.js new file mode 100644 index 000000000..fdf2323ff --- /dev/null +++ b/node_modules/es-abstract/2018/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/es-abstract/2018/IsStringPrefix.js b/node_modules/es-abstract/2018/IsStringPrefix.js new file mode 100644 index 000000000..f5e299623 --- /dev/null +++ b/node_modules/es-abstract/2018/IsStringPrefix.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPrefixOf = require('../helpers/isPrefixOf'); + +// var callBound = require('../helpers/callBound'); + +// var $charAt = callBound('String.prototype.charAt'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-isstringprefix + +module.exports = function IsStringPrefix(p, q) { + if (Type(p) !== 'String') { + throw new $TypeError('Assertion failed: "p" must be a String'); + } + + if (Type(q) !== 'String') { + throw new $TypeError('Assertion failed: "q" must be a String'); + } + + return isPrefixOf(p, q); + /* + if (p === q || p === '') { + return true; + } + + var pLength = p.length; + var qLength = q.length; + if (pLength >= qLength) { + return false; + } + + // assert: pLength < qLength + + for (var i = 0; i < pLength; i += 1) { + if ($charAt(p, i) !== $charAt(q, i)) { + return false; + } + } + return true; + */ +}; diff --git a/node_modules/es-abstract/2018/IterableToList.js b/node_modules/es-abstract/2018/IterableToList.js new file mode 100644 index 000000000..0b8cdcfe3 --- /dev/null +++ b/node_modules/es-abstract/2018/IterableToList.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); +var $arrayPush = callBound('Array.prototype.push'); + +var GetIterator = require('./GetIterator'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-iterabletolist + +module.exports = function IterableToList(items, method) { + var iterator = GetIterator(items, method); + var values = []; + var next = true; + while (next) { + next = IteratorStep(iterator); + if (next) { + var nextValue = IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; +}; diff --git a/node_modules/es-abstract/2018/IteratorClose.js b/node_modules/es-abstract/2018/IteratorClose.js new file mode 100644 index 000000000..35c8c2bea --- /dev/null +++ b/node_modules/es-abstract/2018/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/es-abstract/2018/IteratorComplete.js b/node_modules/es-abstract/2018/IteratorComplete.js new file mode 100644 index 000000000..a62b9bfc1 --- /dev/null +++ b/node_modules/es-abstract/2018/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/es-abstract/2018/IteratorNext.js b/node_modules/es-abstract/2018/IteratorNext.js new file mode 100644 index 000000000..7e5991561 --- /dev/null +++ b/node_modules/es-abstract/2018/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/es-abstract/2018/IteratorStep.js b/node_modules/es-abstract/2018/IteratorStep.js new file mode 100644 index 000000000..41b9d1b25 --- /dev/null +++ b/node_modules/es-abstract/2018/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/es-abstract/2018/IteratorValue.js b/node_modules/es-abstract/2018/IteratorValue.js new file mode 100644 index 000000000..5e71a4463 --- /dev/null +++ b/node_modules/es-abstract/2018/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/es-abstract/2018/MakeDate.js b/node_modules/es-abstract/2018/MakeDate.js new file mode 100644 index 000000000..7b592d136 --- /dev/null +++ b/node_modules/es-abstract/2018/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/es-abstract/2018/MakeDay.js b/node_modules/es-abstract/2018/MakeDay.js new file mode 100644 index 000000000..f1ab81060 --- /dev/null +++ b/node_modules/es-abstract/2018/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/es-abstract/2018/MakeTime.js b/node_modules/es-abstract/2018/MakeTime.js new file mode 100644 index 000000000..e11850040 --- /dev/null +++ b/node_modules/es-abstract/2018/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/es-abstract/2018/MinFromTime.js b/node_modules/es-abstract/2018/MinFromTime.js new file mode 100644 index 000000000..e80e19108 --- /dev/null +++ b/node_modules/es-abstract/2018/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/es-abstract/2018/MonthFromTime.js b/node_modules/es-abstract/2018/MonthFromTime.js new file mode 100644 index 000000000..4f120f2c2 --- /dev/null +++ b/node_modules/es-abstract/2018/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/es-abstract/2018/NumberToString.js b/node_modules/es-abstract/2018/NumberToString.js new file mode 100644 index 000000000..2cc70e008 --- /dev/null +++ b/node_modules/es-abstract/2018/NumberToString.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-tostring-applied-to-the-number-type + +module.exports = function NumberToString(m) { + if (Type(m) !== 'Number') { + throw new TypeError('Assertion failed: "m" must be a String'); + } + + return $String(m); +}; + diff --git a/node_modules/es-abstract/2018/ObjectCreate.js b/node_modules/es-abstract/2018/ObjectCreate.js new file mode 100644 index 000000000..e2445b022 --- /dev/null +++ b/node_modules/es-abstract/2018/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js b/node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js new file mode 100644 index 000000000..59780b3bb --- /dev/null +++ b/node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js b/node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js new file mode 100644 index 000000000..b9882e5dc --- /dev/null +++ b/node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js b/node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js new file mode 100644 index 000000000..344077a40 --- /dev/null +++ b/node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $getProto = require('../helpers/getProto'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof + +module.exports = function OrdinaryGetPrototypeOf(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!$getProto) { + throw new $TypeError('This environment does not support fetching prototypes.'); + } + return $getProto(O); +}; diff --git a/node_modules/es-abstract/2018/OrdinaryHasInstance.js b/node_modules/es-abstract/2018/OrdinaryHasInstance.js new file mode 100644 index 000000000..51abe26d5 --- /dev/null +++ b/node_modules/es-abstract/2018/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/es-abstract/2018/OrdinaryHasProperty.js b/node_modules/es-abstract/2018/OrdinaryHasProperty.js new file mode 100644 index 000000000..076c25ac5 --- /dev/null +++ b/node_modules/es-abstract/2018/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js b/node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js new file mode 100644 index 000000000..3541331ca --- /dev/null +++ b/node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $setProto = require('../helpers/setProto'); + +var OrdinaryGetPrototypeOf = require('./OrdinaryGetPrototypeOf'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof + +module.exports = function OrdinarySetPrototypeOf(O, V) { + if (Type(V) !== 'Object' && Type(V) !== 'Null') { + throw new $TypeError('Assertion failed: V must be Object or Null'); + } + /* + var extensible = IsExtensible(O); + var current = OrdinaryGetPrototypeOf(O); + if (SameValue(V, current)) { + return true; + } + if (!extensible) { + return false; + } + */ + try { + $setProto(O, V); + } catch (e) { + return false; + } + return OrdinaryGetPrototypeOf(O) === V; + /* + var p = V; + var done = false; + while (!done) { + if (p === null) { + done = true; + } else if (SameValue(p, O)) { + return false; + } else { + if (wat) { + done = true; + } else { + p = p.[[Prototype]]; + } + } + } + O.[[Prototype]] = V; + return true; + */ +}; diff --git a/node_modules/es-abstract/2018/PromiseResolve.js b/node_modules/es-abstract/2018/PromiseResolve.js new file mode 100644 index 000000000..f70745df7 --- /dev/null +++ b/node_modules/es-abstract/2018/PromiseResolve.js @@ -0,0 +1,15 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseResolve = callBound('Promise.resolve', true); + +// https://ecma-international.org/ecma-262/9.0/#sec-promise-resolve + +module.exports = function PromiseResolve(C, x) { + if (!$PromiseResolve) { + throw new SyntaxError('This environment does not support Promises.'); + } + return $PromiseResolve(C, x); +}; + diff --git a/node_modules/es-abstract/2018/RegExpExec.js b/node_modules/es-abstract/2018/RegExpExec.js new file mode 100644 index 000000000..15c91867d --- /dev/null +++ b/node_modules/es-abstract/2018/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/es-abstract/2018/RequireObjectCoercible.js b/node_modules/es-abstract/2018/RequireObjectCoercible.js new file mode 100644 index 000000000..9008359db --- /dev/null +++ b/node_modules/es-abstract/2018/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/es-abstract/2018/SameValue.js b/node_modules/es-abstract/2018/SameValue.js new file mode 100644 index 000000000..47c936d76 --- /dev/null +++ b/node_modules/es-abstract/2018/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/es-abstract/2018/SameValueNonNumber.js b/node_modules/es-abstract/2018/SameValueNonNumber.js new file mode 100644 index 000000000..5668752e3 --- /dev/null +++ b/node_modules/es-abstract/2018/SameValueNonNumber.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); + +// https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber + +module.exports = function SameValueNonNumber(x, y) { + if (typeof x === 'number' || typeof x !== typeof y) { + throw new $TypeError('SameValueNonNumber requires two non-number values of the same type.'); + } + return SameValue(x, y); +}; diff --git a/node_modules/es-abstract/2018/SameValueZero.js b/node_modules/es-abstract/2018/SameValueZero.js new file mode 100644 index 000000000..0dedcd2c3 --- /dev/null +++ b/node_modules/es-abstract/2018/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/es-abstract/2018/SecFromTime.js b/node_modules/es-abstract/2018/SecFromTime.js new file mode 100644 index 000000000..7190011d2 --- /dev/null +++ b/node_modules/es-abstract/2018/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/es-abstract/2018/Set.js b/node_modules/es-abstract/2018/Set.js new file mode 100644 index 000000000..9545b1325 --- /dev/null +++ b/node_modules/es-abstract/2018/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/es-abstract/2018/SetFunctionName.js b/node_modules/es-abstract/2018/SetFunctionName.js new file mode 100644 index 000000000..f93324a73 --- /dev/null +++ b/node_modules/es-abstract/2018/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/es-abstract/2018/SetIntegrityLevel.js b/node_modules/es-abstract/2018/SetIntegrityLevel.js new file mode 100644 index 000000000..3d5c81d56 --- /dev/null +++ b/node_modules/es-abstract/2018/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/es-abstract/2018/SpeciesConstructor.js b/node_modules/es-abstract/2018/SpeciesConstructor.js new file mode 100644 index 000000000..3cdcd747d --- /dev/null +++ b/node_modules/es-abstract/2018/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/es-abstract/2018/StrictEqualityComparison.js b/node_modules/es-abstract/2018/StrictEqualityComparison.js new file mode 100644 index 000000000..eea5df388 --- /dev/null +++ b/node_modules/es-abstract/2018/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/es-abstract/2018/SymbolDescriptiveString.js b/node_modules/es-abstract/2018/SymbolDescriptiveString.js new file mode 100644 index 000000000..7bd8191ad --- /dev/null +++ b/node_modules/es-abstract/2018/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/es-abstract/2018/TestIntegrityLevel.js b/node_modules/es-abstract/2018/TestIntegrityLevel.js new file mode 100644 index 000000000..7a57397d5 --- /dev/null +++ b/node_modules/es-abstract/2018/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/es-abstract/2018/TimeClip.js b/node_modules/es-abstract/2018/TimeClip.js new file mode 100644 index 000000000..57aa08cb9 --- /dev/null +++ b/node_modules/es-abstract/2018/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/es-abstract/2018/TimeFromYear.js b/node_modules/es-abstract/2018/TimeFromYear.js new file mode 100644 index 000000000..df646c36e --- /dev/null +++ b/node_modules/es-abstract/2018/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/es-abstract/2018/TimeString.js b/node_modules/es-abstract/2018/TimeString.js new file mode 100644 index 000000000..87642eb54 --- /dev/null +++ b/node_modules/es-abstract/2018/TimeString.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var padTimeComponent = require('../helpers/padTimeComponent'); + +var HourFromTime = require('./HourFromTime'); +var MinFromTime = require('./MinFromTime'); +var SecFromTime = require('./SecFromTime'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-timestring + +module.exports = function TimeString(tv) { + if (Type(tv) !== 'Number' || $isNaN(tv)) { + throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number'); + } + var hour = HourFromTime(tv); + var minute = MinFromTime(tv); + var second = SecFromTime(tv); + return padTimeComponent(hour) + ':' + padTimeComponent(minute) + ':' + padTimeComponent(second) + '\x20GMT'; +}; diff --git a/node_modules/es-abstract/2018/TimeWithinDay.js b/node_modules/es-abstract/2018/TimeWithinDay.js new file mode 100644 index 000000000..c5b21d378 --- /dev/null +++ b/node_modules/es-abstract/2018/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/es-abstract/2018/ToBoolean.js b/node_modules/es-abstract/2018/ToBoolean.js new file mode 100644 index 000000000..65d87376d --- /dev/null +++ b/node_modules/es-abstract/2018/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/es-abstract/2018/ToDateString.js b/node_modules/es-abstract/2018/ToDateString.js new file mode 100644 index 000000000..7a6d4c4e9 --- /dev/null +++ b/node_modules/es-abstract/2018/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/es-abstract/2018/ToIndex.js b/node_modules/es-abstract/2018/ToIndex.js new file mode 100644 index 000000000..a55398d3e --- /dev/null +++ b/node_modules/es-abstract/2018/ToIndex.js @@ -0,0 +1,26 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); + +var ToInteger = require('./ToInteger'); +var ToLength = require('./ToLength'); +var SameValueZero = require('./SameValueZero'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-toindex + +module.exports = function ToIndex(value) { + if (typeof value === 'undefined') { + return 0; + } + var integerIndex = ToInteger(value); + if (integerIndex < 0) { + throw new $RangeError('index must be >= 0'); + } + var index = ToLength(integerIndex); + if (!SameValueZero(integerIndex, index)) { + throw new $RangeError('index must be >= 0 and < 2 ** 53 - 1'); + } + return index; +}; diff --git a/node_modules/es-abstract/2018/ToInt16.js b/node_modules/es-abstract/2018/ToInt16.js new file mode 100644 index 000000000..5a112c237 --- /dev/null +++ b/node_modules/es-abstract/2018/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/es-abstract/2018/ToInt32.js b/node_modules/es-abstract/2018/ToInt32.js new file mode 100644 index 000000000..a8d268070 --- /dev/null +++ b/node_modules/es-abstract/2018/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/es-abstract/2018/ToInt8.js b/node_modules/es-abstract/2018/ToInt8.js new file mode 100644 index 000000000..d103123a9 --- /dev/null +++ b/node_modules/es-abstract/2018/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/es-abstract/2018/ToInteger.js b/node_modules/es-abstract/2018/ToInteger.js new file mode 100644 index 000000000..16f7db9c3 --- /dev/null +++ b/node_modules/es-abstract/2018/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/es-abstract/2018/ToLength.js b/node_modules/es-abstract/2018/ToLength.js new file mode 100644 index 000000000..1bef9bed7 --- /dev/null +++ b/node_modules/es-abstract/2018/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/es-abstract/2018/ToNumber.js b/node_modules/es-abstract/2018/ToNumber.js new file mode 100644 index 000000000..7a3cdc89e --- /dev/null +++ b/node_modules/es-abstract/2018/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/es-abstract/2018/ToObject.js b/node_modules/es-abstract/2018/ToObject.js new file mode 100644 index 000000000..50d5b94a4 --- /dev/null +++ b/node_modules/es-abstract/2018/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/es-abstract/2018/ToPrimitive.js b/node_modules/es-abstract/2018/ToPrimitive.js new file mode 100644 index 000000000..81c655d41 --- /dev/null +++ b/node_modules/es-abstract/2018/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/es-abstract/2018/ToPropertyDescriptor.js b/node_modules/es-abstract/2018/ToPropertyDescriptor.js new file mode 100644 index 000000000..38e536e2d --- /dev/null +++ b/node_modules/es-abstract/2018/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/es-abstract/2018/ToPropertyKey.js b/node_modules/es-abstract/2018/ToPropertyKey.js new file mode 100644 index 000000000..38f40dd80 --- /dev/null +++ b/node_modules/es-abstract/2018/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/es-abstract/2018/ToString.js b/node_modules/es-abstract/2018/ToString.js new file mode 100644 index 000000000..a34543126 --- /dev/null +++ b/node_modules/es-abstract/2018/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/es-abstract/2018/ToUint16.js b/node_modules/es-abstract/2018/ToUint16.js new file mode 100644 index 000000000..c8a408bfa --- /dev/null +++ b/node_modules/es-abstract/2018/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/es-abstract/2018/ToUint32.js b/node_modules/es-abstract/2018/ToUint32.js new file mode 100644 index 000000000..3660f6209 --- /dev/null +++ b/node_modules/es-abstract/2018/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/es-abstract/2018/ToUint8.js b/node_modules/es-abstract/2018/ToUint8.js new file mode 100644 index 000000000..bf8475321 --- /dev/null +++ b/node_modules/es-abstract/2018/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/es-abstract/2018/ToUint8Clamp.js b/node_modules/es-abstract/2018/ToUint8Clamp.js new file mode 100644 index 000000000..c7f9f5656 --- /dev/null +++ b/node_modules/es-abstract/2018/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/es-abstract/2018/Type.js b/node_modules/es-abstract/2018/Type.js new file mode 100644 index 000000000..0bd11659c --- /dev/null +++ b/node_modules/es-abstract/2018/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js b/node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 000000000..d4b900700 --- /dev/null +++ b/node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/es-abstract/2018/WeekDay.js b/node_modules/es-abstract/2018/WeekDay.js new file mode 100644 index 000000000..2973e0200 --- /dev/null +++ b/node_modules/es-abstract/2018/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/es-abstract/2018/YearFromTime.js b/node_modules/es-abstract/2018/YearFromTime.js new file mode 100644 index 000000000..ff5339f24 --- /dev/null +++ b/node_modules/es-abstract/2018/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/es-abstract/2018/modulo.js b/node_modules/es-abstract/2018/modulo.js new file mode 100644 index 000000000..bc04c0628 --- /dev/null +++ b/node_modules/es-abstract/2018/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/es-abstract/2018/msFromTime.js b/node_modules/es-abstract/2018/msFromTime.js new file mode 100644 index 000000000..c31eda085 --- /dev/null +++ b/node_modules/es-abstract/2018/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/es-abstract/2018/thisBooleanValue.js b/node_modules/es-abstract/2018/thisBooleanValue.js new file mode 100644 index 000000000..3ffac9cdf --- /dev/null +++ b/node_modules/es-abstract/2018/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/es-abstract/2018/thisNumberValue.js b/node_modules/es-abstract/2018/thisNumberValue.js new file mode 100644 index 000000000..0345e523f --- /dev/null +++ b/node_modules/es-abstract/2018/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/es-abstract/2018/thisStringValue.js b/node_modules/es-abstract/2018/thisStringValue.js new file mode 100644 index 000000000..3b99b6e3c --- /dev/null +++ b/node_modules/es-abstract/2018/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/es-abstract/2018/thisSymbolValue.js b/node_modules/es-abstract/2018/thisSymbolValue.js new file mode 100644 index 000000000..3c3b3475d --- /dev/null +++ b/node_modules/es-abstract/2018/thisSymbolValue.js @@ -0,0 +1,19 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $SymbolValueOf = callBound('Symbol.prototype.valueOf', true); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/9.0/#sec-thissymbolvalue + +module.exports = function thisSymbolValue(value) { + if (!$SymbolValueOf) { + throw new SyntaxError('Symbols are not supported; thisSymbolValue requires that `value` be a Symbol or a Symbol object'); + } + if (Type(value) === 'Symbol') { + return value; + } + return $SymbolValueOf(value); +}; diff --git a/node_modules/es-abstract/2018/thisTimeValue.js b/node_modules/es-abstract/2018/thisTimeValue.js new file mode 100644 index 000000000..d7cda28c9 --- /dev/null +++ b/node_modules/es-abstract/2018/thisTimeValue.js @@ -0,0 +1,9 @@ +'use strict'; + +var $DateValueOf = require('../helpers/callBound')('Date.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + +module.exports = function thisTimeValue(value) { + return $DateValueOf(value); +}; diff --git a/node_modules/es-abstract/2019/AbstractEqualityComparison.js b/node_modules/es-abstract/2019/AbstractEqualityComparison.js new file mode 100644 index 000000000..40b390986 --- /dev/null +++ b/node_modules/es-abstract/2019/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/es-abstract/2019/AbstractRelationalComparison.js b/node_modules/es-abstract/2019/AbstractRelationalComparison.js new file mode 100644 index 000000000..bc7ca8324 --- /dev/null +++ b/node_modules/es-abstract/2019/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/es-abstract/2019/AddEntriesFromIterable.js b/node_modules/es-abstract/2019/AddEntriesFromIterable.js new file mode 100644 index 000000000..5aed44753 --- /dev/null +++ b/node_modules/es-abstract/2019/AddEntriesFromIterable.js @@ -0,0 +1,52 @@ +'use strict'; + +var inspect = require('object-inspect'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var Get = require('./Get'); +var GetIterator = require('./GetIterator'); +var IsCallable = require('./IsCallable'); +var IteratorClose = require('./IteratorClose'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); +var Type = require('./Type'); + +// https://tc39.es/ecma262/#sec-add-entries-from-iterable + +module.exports = function AddEntriesFromIterable(target, iterable, adder) { + if (!IsCallable(adder)) { + throw new $TypeError('Assertion failed: `adder` is not callable'); + } + if (iterable == null) { + throw new $TypeError('Assertion failed: `iterable` is present, and not nullish'); + } + var iteratorRecord = GetIterator(iterable); + while (true) { // eslint-disable-line no-constant-condition + var next = IteratorStep(iteratorRecord); + if (!next) { + return target; + } + var nextItem = IteratorValue(next); + if (Type(nextItem) !== 'Object') { + var error = new $TypeError('iterator next must return an Object, got ' + inspect(nextItem)); + return IteratorClose( + iteratorRecord, + function () { throw error; } // eslint-disable-line no-loop-func + ); + } + try { + var k = Get(nextItem, '0'); + var v = Get(nextItem, '1'); + Call(adder, target, [k, v]); + } catch (e) { + return IteratorClose( + iteratorRecord, + function () { throw e; } + ); + } + } +}; diff --git a/node_modules/es-abstract/2019/AdvanceStringIndex.js b/node_modules/es-abstract/2019/AdvanceStringIndex.js new file mode 100644 index 000000000..666f578b1 --- /dev/null +++ b/node_modules/es-abstract/2019/AdvanceStringIndex.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt'); + +// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + +module.exports = function AdvanceStringIndex(S, index, unicode) { + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); + } + if (Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; +}; diff --git a/node_modules/es-abstract/2019/ArrayCreate.js b/node_modules/es-abstract/2019/ArrayCreate.js new file mode 100644 index 000000000..fc9a7cf82 --- /dev/null +++ b/node_modules/es-abstract/2019/ArrayCreate.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ArrayPrototype = GetIntrinsic('%Array.prototype%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsInteger = require('./IsInteger'); + +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; + +var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayPrototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + +module.exports = function ArrayCreate(length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; +}; diff --git a/node_modules/es-abstract/2019/ArraySetLength.js b/node_modules/es-abstract/2019/ArraySetLength.js new file mode 100644 index 000000000..c9134c6e6 --- /dev/null +++ b/node_modules/es-abstract/2019/ArraySetLength.js @@ -0,0 +1,85 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var assign = require('object.assign'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsArray = require('./IsArray'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var ToUint32 = require('./ToUint32'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function ArraySetLength(A, Desc) { + if (!IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = ToUint32(Desc['[[Value]]']); + var numberLen = ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = OrdinaryGetOwnProperty(A, 'length'); + if (!IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + // eslint-disable-next-line no-param-reassign + var deleteSucceeded = delete A[ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; +}; diff --git a/node_modules/es-abstract/2019/ArraySpeciesCreate.js b/node_modules/es-abstract/2019/ArraySpeciesCreate.js new file mode 100644 index 000000000..98b9b561d --- /dev/null +++ b/node_modules/es-abstract/2019/ArraySpeciesCreate.js @@ -0,0 +1,46 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsConstructor = require('./IsConstructor'); +var IsInteger = require('./IsInteger'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + +module.exports = function ArraySpeciesCreate(originalArray, length) { + if (!IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = IsArray(originalArray); + if (isArray) { + C = Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if ($species && Type(C) === 'Object') { + C = Get(C, $species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // Construct(C, len); +}; + diff --git a/node_modules/es-abstract/2019/Call.js b/node_modules/es-abstract/2019/Call.js new file mode 100644 index 000000000..f0f045174 --- /dev/null +++ b/node_modules/es-abstract/2019/Call.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('../helpers/callBound'); + +var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-call + +module.exports = function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + return $apply(F, V, args); +}; diff --git a/node_modules/es-abstract/2019/CanonicalNumericIndexString.js b/node_modules/es-abstract/2019/CanonicalNumericIndexString.js new file mode 100644 index 000000000..625f8539a --- /dev/null +++ b/node_modules/es-abstract/2019/CanonicalNumericIndexString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + +module.exports = function CanonicalNumericIndexString(argument) { + if (Type(argument) !== 'String') { + throw new $TypeError('Assertion failed: `argument` must be a String'); + } + if (argument === '-0') { return -0; } + var n = ToNumber(argument); + if (SameValue(ToString(n), argument)) { return n; } + return void 0; +}; diff --git a/node_modules/es-abstract/2019/CompletePropertyDescriptor.js b/node_modules/es-abstract/2019/CompletePropertyDescriptor.js new file mode 100644 index 000000000..548bf415a --- /dev/null +++ b/node_modules/es-abstract/2019/CompletePropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + +module.exports = function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; +}; diff --git a/node_modules/es-abstract/2019/CopyDataProperties.js b/node_modules/es-abstract/2019/CopyDataProperties.js new file mode 100644 index 000000000..842709903 --- /dev/null +++ b/node_modules/es-abstract/2019/CopyDataProperties.js @@ -0,0 +1,64 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); +var forEach = require('../helpers/forEach'); +var OwnPropertyKeys = require('../helpers/OwnPropertyKeys'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var CreateDataProperty = require('./CreateDataProperty'); +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToNumber = require('./ToNumber'); +var ToObject = require('./ToObject'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-copydataproperties + +module.exports = function CopyDataProperties(target, source, excludedItems) { + if (Type(target) !== 'Object') { + throw new TypeError('Assertion failed: "target" must be an Object'); + } + + if (!IsArray(excludedItems)) { + throw new TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); + } + for (var i = 0; i < excludedItems.length; i += 1) { + if (!IsPropertyKey(excludedItems[i])) { + throw new TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); + } + } + + if (typeof source === 'undefined' || source === null) { + return target; + } + + var fromObj = ToObject(source); + + var sourceKeys = OwnPropertyKeys(fromObj); + forEach(sourceKeys, function (nextKey) { + var excluded = false; + + forEach(excludedItems, function (e) { + if (SameValue(e, nextKey) === true) { + excluded = true; + } + }); + + var enumerable = $isEnumerable(fromObj, nextKey) || ( + // this is to handle string keys being non-enumerable in older engines + typeof source === 'string' + && nextKey >= 0 + && IsInteger(ToNumber(nextKey)) + ); + if (excluded === false && enumerable) { + var propValue = Get(fromObj, nextKey); + CreateDataProperty(target, nextKey, propValue); + } + }); + + return target; +}; diff --git a/node_modules/es-abstract/2019/CreateDataProperty.js b/node_modules/es-abstract/2019/CreateDataProperty.js new file mode 100644 index 000000000..32a86ef04 --- /dev/null +++ b/node_modules/es-abstract/2019/CreateDataProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty + +module.exports = function CreateDataProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = OrdinaryGetOwnProperty(O, P); + var extensible = !oldDesc || IsExtensible(O); + var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + } + ); +}; diff --git a/node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js b/node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js new file mode 100644 index 000000000..9feaec8d8 --- /dev/null +++ b/node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var CreateDataProperty = require('./CreateDataProperty'); +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + +module.exports = function CreateDataPropertyOrThrow(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; +}; diff --git a/node_modules/es-abstract/2019/CreateHTML.js b/node_modules/es-abstract/2019/CreateHTML.js new file mode 100644 index 000000000..536c92db8 --- /dev/null +++ b/node_modules/es-abstract/2019/CreateHTML.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $replace = callBound('String.prototype.replace'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + +module.exports = function CreateHTML(string, tag, attribute, value) { + if (Type(tag) !== 'String' || Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = RequireObjectCoercible(string); + var S = ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + ''; +}; diff --git a/node_modules/es-abstract/2019/CreateIterResultObject.js b/node_modules/es-abstract/2019/CreateIterResultObject.js new file mode 100644 index 000000000..aef1d2200 --- /dev/null +++ b/node_modules/es-abstract/2019/CreateIterResultObject.js @@ -0,0 +1,19 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + +module.exports = function CreateIterResultObject(value, done) { + if (Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; +}; diff --git a/node_modules/es-abstract/2019/CreateListFromArrayLike.js b/node_modules/es-abstract/2019/CreateListFromArrayLike.js new file mode 100644 index 000000000..d6b44b5dc --- /dev/null +++ b/node_modules/es-abstract/2019/CreateListFromArrayLike.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('../helpers/callBound'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike +module.exports = function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = ToLength(Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = ToString(index); + var next = Get(obj, indexName); + var nextType = Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; +}; diff --git a/node_modules/es-abstract/2019/CreateMethodProperty.js b/node_modules/es-abstract/2019/CreateMethodProperty.js new file mode 100644 index 000000000..5b599aea1 --- /dev/null +++ b/node_modules/es-abstract/2019/CreateMethodProperty.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + +module.exports = function CreateMethodProperty(O, P, V) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + newDesc + ); +}; diff --git a/node_modules/es-abstract/2019/DateFromTime.js b/node_modules/es-abstract/2019/DateFromTime.js new file mode 100644 index 000000000..962dba168 --- /dev/null +++ b/node_modules/es-abstract/2019/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/es-abstract/2019/DateString.js b/node_modules/es-abstract/2019/DateString.js new file mode 100644 index 000000000..fc3032906 --- /dev/null +++ b/node_modules/es-abstract/2019/DateString.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var weekdays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; + +var $isNaN = require('../helpers/isNaN'); +var padTimeComponent = require('../helpers/padTimeComponent'); + +var Type = require('./Type'); +var WeekDay = require('./WeekDay'); +var MonthFromTime = require('./MonthFromTime'); +var YearFromTime = require('./YearFromTime'); +var DateFromTime = require('./DateFromTime'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-datestring + +module.exports = function DateString(tv) { + if (Type(tv) !== 'Number' || $isNaN(tv)) { + throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number'); + } + var weekday = weekdays[WeekDay(tv)]; + var month = months[MonthFromTime(tv)]; + var day = padTimeComponent(DateFromTime(tv)); + var year = padTimeComponent(YearFromTime(tv), 4); + return weekday + '\x20' + month + '\x20' + day + '\x20' + year; +}; diff --git a/node_modules/es-abstract/2019/Day.js b/node_modules/es-abstract/2019/Day.js new file mode 100644 index 000000000..00df81342 --- /dev/null +++ b/node_modules/es-abstract/2019/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/es-abstract/2019/DayFromYear.js b/node_modules/es-abstract/2019/DayFromYear.js new file mode 100644 index 000000000..08dd5af60 --- /dev/null +++ b/node_modules/es-abstract/2019/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/es-abstract/2019/DayWithinYear.js b/node_modules/es-abstract/2019/DayWithinYear.js new file mode 100644 index 000000000..cfc400288 --- /dev/null +++ b/node_modules/es-abstract/2019/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/es-abstract/2019/DaysInYear.js b/node_modules/es-abstract/2019/DaysInYear.js new file mode 100644 index 000000000..db32251ff --- /dev/null +++ b/node_modules/es-abstract/2019/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/es-abstract/2019/DefinePropertyOrThrow.js b/node_modules/es-abstract/2019/DefinePropertyOrThrow.js new file mode 100644 index 000000000..7977f6e18 --- /dev/null +++ b/node_modules/es-abstract/2019/DefinePropertyOrThrow.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + +module.exports = function DefinePropertyOrThrow(O, P, desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, desc) ? desc : ToPropertyDescriptor(desc); + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); +}; diff --git a/node_modules/es-abstract/2019/DeletePropertyOrThrow.js b/node_modules/es-abstract/2019/DeletePropertyOrThrow.js new file mode 100644 index 000000000..b47681797 --- /dev/null +++ b/node_modules/es-abstract/2019/DeletePropertyOrThrow.js @@ -0,0 +1,27 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + +module.exports = function DeletePropertyOrThrow(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // eslint-disable-next-line no-param-reassign + var success = delete O[P]; + if (!success) { + throw new $TypeError('Attempt to delete property failed.'); + } + return success; +}; diff --git a/node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js b/node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js new file mode 100644 index 000000000..e2ed7226c --- /dev/null +++ b/node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js @@ -0,0 +1,43 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var objectKeys = require('object-keys'); + +var callBound = require('../helpers/callBound'); + +var callBind = require('../helpers/callBind'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); +var $pushApply = callBind.apply(GetIntrinsic('%Array.prototype.push%')); + +var forEach = require('../helpers/forEach'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-enumerableownproperties + +module.exports = function EnumerableOwnProperties(O, kind) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + var keys = objectKeys(O); + if (kind === 'key') { + return keys; + } + if (kind === 'value' || kind === 'key+value') { + var results = []; + forEach(keys, function (key) { + if ($isEnumerable(O, key)) { + $pushApply(results, [ + kind === 'value' ? O[key] : [key, O[key]] + ]); + } + }); + return results; + } + throw new $TypeError('Assertion failed: "kind" is not "key", "value", or "key+value": ' + kind); +}; diff --git a/node_modules/es-abstract/2019/FlattenIntoArray.js b/node_modules/es-abstract/2019/FlattenIntoArray.js new file mode 100644 index 000000000..313a6ed9b --- /dev/null +++ b/node_modules/es-abstract/2019/FlattenIntoArray.js @@ -0,0 +1,58 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var Call = require('./Call'); +var CreateDataPropertyOrThrow = require('./CreateDataPropertyOrThrow'); +var Get = require('./Get'); +var HasProperty = require('./HasProperty'); +var IsArray = require('./IsArray'); +var ToLength = require('./ToLength'); +var ToString = require('./ToString'); + +// https://ecma-international.org/ecma-262/10.0/#sec-flattenintoarray + +// eslint-disable-next-line max-params, max-statements +module.exports = function FlattenIntoArray(target, source, sourceLen, start, depth) { + var mapperFunction; + if (arguments.length > 5) { + mapperFunction = arguments[5]; + } + + var targetIndex = start; + var sourceIndex = 0; + while (sourceIndex < sourceLen) { + var P = ToString(sourceIndex); + var exists = HasProperty(source, P); + if (exists === true) { + var element = Get(source, P); + if (typeof mapperFunction !== 'undefined') { + if (arguments.length <= 6) { + throw new $TypeError('Assertion failed: thisArg is required when mapperFunction is provided'); + } + element = Call(mapperFunction, arguments[6], [element, sourceIndex, source]); + } + var shouldFlatten = false; + if (depth > 0) { + shouldFlatten = IsArray(element); + } + if (shouldFlatten) { + var elementLen = ToLength(Get(element, 'length')); + targetIndex = FlattenIntoArray(target, element, elementLen, targetIndex, depth - 1); + } else { + if (targetIndex >= MAX_SAFE_INTEGER) { + throw new $TypeError('index too large'); + } + CreateDataPropertyOrThrow(target, ToString(targetIndex), element); + targetIndex += 1; + } + } + sourceIndex += 1; + } + + return targetIndex; +}; diff --git a/node_modules/es-abstract/2019/FromPropertyDescriptor.js b/node_modules/es-abstract/2019/FromPropertyDescriptor.js new file mode 100644 index 000000000..5ec200edb --- /dev/null +++ b/node_modules/es-abstract/2019/FromPropertyDescriptor.js @@ -0,0 +1,36 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; +}; diff --git a/node_modules/es-abstract/2019/Get.js b/node_modules/es-abstract/2019/Get.js new file mode 100644 index 000000000..5b9ad7860 --- /dev/null +++ b/node_modules/es-abstract/2019/Get.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var inspect = require('object-inspect'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +/** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + +module.exports = function Get(O, P) { + // 7.3.1.1 + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; +}; diff --git a/node_modules/es-abstract/2019/GetIterator.js b/node_modules/es-abstract/2019/GetIterator.js new file mode 100644 index 000000000..7beddacc0 --- /dev/null +++ b/node_modules/es-abstract/2019/GetIterator.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getIteratorMethod = require('../helpers/getIteratorMethod'); +var AdvanceStringIndex = require('./AdvanceStringIndex'); +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsArray = require('./IsArray'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getiterator + +module.exports = function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod( + { + AdvanceStringIndex: AdvanceStringIndex, + GetMethod: GetMethod, + IsArray: IsArray, + Type: Type + }, + obj + ); + } + var iterator = Call(actualMethod, obj); + if (Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; +}; diff --git a/node_modules/es-abstract/2019/GetMethod.js b/node_modules/es-abstract/2019/GetMethod.js new file mode 100644 index 000000000..aef8cbc4a --- /dev/null +++ b/node_modules/es-abstract/2019/GetMethod.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var GetV = require('./GetV'); +var IsCallable = require('./IsCallable'); +var IsPropertyKey = require('./IsPropertyKey'); + +/** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + +module.exports = function GetMethod(O, P) { + // 7.3.9.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; +}; diff --git a/node_modules/es-abstract/2019/GetOwnPropertyKeys.js b/node_modules/es-abstract/2019/GetOwnPropertyKeys.js new file mode 100644 index 000000000..8d7e5eee5 --- /dev/null +++ b/node_modules/es-abstract/2019/GetOwnPropertyKeys.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var hasSymbols = require('has-symbols')(); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%'); +var keys = require('object-keys'); + +var esType = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + +module.exports = function GetOwnPropertyKeys(O, Type) { + if (esType(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); +}; diff --git a/node_modules/es-abstract/2019/GetPrototypeFromConstructor.js b/node_modules/es-abstract/2019/GetPrototypeFromConstructor.js new file mode 100644 index 000000000..62da8fb5f --- /dev/null +++ b/node_modules/es-abstract/2019/GetPrototypeFromConstructor.js @@ -0,0 +1,28 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Function = GetIntrinsic('%Function%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + +module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = Get(constructor, 'prototype'); + if (Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; +}; diff --git a/node_modules/es-abstract/2019/GetSubstitution.js b/node_modules/es-abstract/2019/GetSubstitution.js new file mode 100644 index 000000000..2ec9ebc50 --- /dev/null +++ b/node_modules/es-abstract/2019/GetSubstitution.js @@ -0,0 +1,128 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var every = require('../helpers/every'); + +var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); +var $indexOf = callBound('String.prototype.indexOf'); +var $parseInt = parseInt; + +var isDigit = regexTester(/^[0-9]$/); + +var inspect = require('object-inspect'); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var IsInteger = require('./IsInteger'); +var ToObject = require('./ToObject'); +var ToString = require('./ToString'); +var Type = require('./Type'); + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +var isStringOrHole = function (capture, index, arr) { + return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined'); +}; + +// http://www.ecma-international.org/ecma-262/9.0/#sec-getsubstitution + +// eslint-disable-next-line max-statements, max-params, max-lines-per-function +module.exports = function GetSubstitution(matched, str, position, captures, namedCaptures, replacement) { + if (Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + if (!IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + if (Type(namedCaptures) !== 'Undefined') { + namedCaptures = ToObject(namedCaptures); // eslint-disable-line no-param-reassign + } + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = $charAt(replacement, i); + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = $charAt(replacement, i + 1); + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : $charAt(replacement, i + 2); + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else if (next === '<') { + // eslint-disable-next-line max-depth + if (Type(namedCaptures) === 'Undefined') { + result += '$<'; + i += 2; + } else { + var endIndex = $indexOf(replacement, '>', i); + // eslint-disable-next-line max-depth + if (endIndex > -1) { + var groupName = $strSlice(replacement, i, endIndex); + var capture = Get(namedCaptures, groupName); + // eslint-disable-next-line max-depth + if (Type(capture) !== 'Undefined') { + result += ToString(capture); + } + i += '$<' + groupName + '>'.length; + } + } + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += $charAt(replacement, i); + } + } + return result; +}; diff --git a/node_modules/es-abstract/2019/GetV.js b/node_modules/es-abstract/2019/GetV.js new file mode 100644 index 000000000..7b5139ace --- /dev/null +++ b/node_modules/es-abstract/2019/GetV.js @@ -0,0 +1,29 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var ToObject = require('./ToObject'); + +/** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + +module.exports = function GetV(V, P) { + // 7.3.2.1 + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = ToObject(V); + + // 7.3.2.4 + return O[P]; +}; diff --git a/node_modules/es-abstract/2019/HasOwnProperty.js b/node_modules/es-abstract/2019/HasOwnProperty.js new file mode 100644 index 000000000..679059f2e --- /dev/null +++ b/node_modules/es-abstract/2019/HasOwnProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var has = require('has'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + +module.exports = function HasOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return has(O, P); +}; diff --git a/node_modules/es-abstract/2019/HasProperty.js b/node_modules/es-abstract/2019/HasProperty.js new file mode 100644 index 000000000..5f2d2122a --- /dev/null +++ b/node_modules/es-abstract/2019/HasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + +module.exports = function HasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/es-abstract/2019/HourFromTime.js b/node_modules/es-abstract/2019/HourFromTime.js new file mode 100644 index 000000000..957ce321a --- /dev/null +++ b/node_modules/es-abstract/2019/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/es-abstract/2019/InLeapYear.js b/node_modules/es-abstract/2019/InLeapYear.js new file mode 100644 index 000000000..38ba8fdc8 --- /dev/null +++ b/node_modules/es-abstract/2019/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/es-abstract/2019/InstanceofOperator.js b/node_modules/es-abstract/2019/InstanceofOperator.js new file mode 100644 index 000000000..ebd308c4b --- /dev/null +++ b/node_modules/es-abstract/2019/InstanceofOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $hasInstance = GetIntrinsic('Symbol.hasInstance', true); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var OrdinaryHasInstance = require('./OrdinaryHasInstance'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + +module.exports = function InstanceofOperator(O, C) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return ToBoolean(Call(instOfHandler, C, [O])); + } + if (!IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return OrdinaryHasInstance(C, O); +}; diff --git a/node_modules/es-abstract/2019/Invoke.js b/node_modules/es-abstract/2019/Invoke.js new file mode 100644 index 000000000..769f0e308 --- /dev/null +++ b/node_modules/es-abstract/2019/Invoke.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $arraySlice = require('../helpers/callBound')('Array.prototype.slice'); + +var Call = require('./Call'); +var GetV = require('./GetV'); +var IsPropertyKey = require('./IsPropertyKey'); + +// https://ecma-international.org/ecma-262/6.0/#sec-invoke + +module.exports = function Invoke(O, P) { + if (!IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = $arraySlice(arguments, 2); + var func = GetV(O, P); + return Call(func, O, argumentsList); +}; diff --git a/node_modules/es-abstract/2019/IsAccessorDescriptor.js b/node_modules/es-abstract/2019/IsAccessorDescriptor.js new file mode 100644 index 000000000..513946462 --- /dev/null +++ b/node_modules/es-abstract/2019/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/es-abstract/2019/IsArray.js b/node_modules/es-abstract/2019/IsArray.js new file mode 100644 index 000000000..7b25f37b5 --- /dev/null +++ b/node_modules/es-abstract/2019/IsArray.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Array = GetIntrinsic('%Array%'); + +// eslint-disable-next-line global-require +var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray + +module.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; +}; diff --git a/node_modules/es-abstract/2019/IsCallable.js b/node_modules/es-abstract/2019/IsCallable.js new file mode 100644 index 000000000..e4bfa365c --- /dev/null +++ b/node_modules/es-abstract/2019/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/es-abstract/2019/IsConcatSpreadable.js b/node_modules/es-abstract/2019/IsConcatSpreadable.js new file mode 100644 index 000000000..dc8aae1e6 --- /dev/null +++ b/node_modules/es-abstract/2019/IsConcatSpreadable.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true); + +var Get = require('./Get'); +var IsArray = require('./IsArray'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + +module.exports = function IsConcatSpreadable(O) { + if (Type(O) !== 'Object') { + return false; + } + if ($isConcatSpreadable) { + var spreadable = Get(O, $isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return ToBoolean(spreadable); + } + } + return IsArray(O); +}; diff --git a/node_modules/es-abstract/2019/IsConstructor.js b/node_modules/es-abstract/2019/IsConstructor.js new file mode 100644 index 000000000..8ba9fe55b --- /dev/null +++ b/node_modules/es-abstract/2019/IsConstructor.js @@ -0,0 +1,40 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic.js'); + +var $construct = GetIntrinsic('%Reflect.construct%', true); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +try { + DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); +} catch (e) { + // Accessor properties aren't supported + DefinePropertyOrThrow = null; +} + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor + +if (DefinePropertyOrThrow && $construct) { + var isConstructorMarker = {}; + var badArrayLike = {}; + DefinePropertyOrThrow(badArrayLike, 'length', { + '[[Get]]': function () { + throw isConstructorMarker; + }, + '[[Enumerable]]': true + }); + + module.exports = function IsConstructor(argument) { + try { + // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: + $construct(argument, badArrayLike); + } catch (err) { + return err === isConstructorMarker; + } + }; +} else { + module.exports = function IsConstructor(argument) { + // unfortunately there's no way to truly check this without try/catch `new argument` in old environments + return typeof argument === 'function' && !!argument.prototype; + }; +} diff --git a/node_modules/es-abstract/2019/IsDataDescriptor.js b/node_modules/es-abstract/2019/IsDataDescriptor.js new file mode 100644 index 000000000..0ad304585 --- /dev/null +++ b/node_modules/es-abstract/2019/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var assertRecord = require('../helpers/assertRecord'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/es-abstract/2019/IsExtensible.js b/node_modules/es-abstract/2019/IsExtensible.js new file mode 100644 index 000000000..0c4c8a60c --- /dev/null +++ b/node_modules/es-abstract/2019/IsExtensible.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var isPrimitive = require('../helpers/isPrimitive'); + +var $preventExtensions = $Object.preventExtensions; +var $isExtensible = $Object.isExtensible; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o + +module.exports = $preventExtensions + ? function IsExtensible(obj) { + return !isPrimitive(obj) && $isExtensible(obj); + } + : function IsExtensible(obj) { + return !isPrimitive(obj); + }; diff --git a/node_modules/es-abstract/2019/IsGenericDescriptor.js b/node_modules/es-abstract/2019/IsGenericDescriptor.js new file mode 100644 index 000000000..8618ce414 --- /dev/null +++ b/node_modules/es-abstract/2019/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/es-abstract/2019/IsInteger.js b/node_modules/es-abstract/2019/IsInteger.js new file mode 100644 index 000000000..0f488b39a --- /dev/null +++ b/node_modules/es-abstract/2019/IsInteger.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger + +module.exports = function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; +}; diff --git a/node_modules/es-abstract/2019/IsPromise.js b/node_modules/es-abstract/2019/IsPromise.js new file mode 100644 index 000000000..e8e92a2b8 --- /dev/null +++ b/node_modules/es-abstract/2019/IsPromise.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseThen = callBound('Promise.prototype.then', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + +module.exports = function IsPromise(x) { + if (Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; +}; diff --git a/node_modules/es-abstract/2019/IsPropertyKey.js b/node_modules/es-abstract/2019/IsPropertyKey.js new file mode 100644 index 000000000..74b8d95d4 --- /dev/null +++ b/node_modules/es-abstract/2019/IsPropertyKey.js @@ -0,0 +1,7 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey + +module.exports = function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; +}; diff --git a/node_modules/es-abstract/2019/IsRegExp.js b/node_modules/es-abstract/2019/IsRegExp.js new file mode 100644 index 000000000..fdf2323ff --- /dev/null +++ b/node_modules/es-abstract/2019/IsRegExp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $match = GetIntrinsic('%Symbol.match%', true); + +var hasRegExpMatcher = require('is-regex'); + +var ToBoolean = require('./ToBoolean'); + +// https://ecma-international.org/ecma-262/6.0/#sec-isregexp + +module.exports = function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if ($match) { + var isRegExp = argument[$match]; + if (typeof isRegExp !== 'undefined') { + return ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); +}; diff --git a/node_modules/es-abstract/2019/IsStringPrefix.js b/node_modules/es-abstract/2019/IsStringPrefix.js new file mode 100644 index 000000000..f5e299623 --- /dev/null +++ b/node_modules/es-abstract/2019/IsStringPrefix.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPrefixOf = require('../helpers/isPrefixOf'); + +// var callBound = require('../helpers/callBound'); + +// var $charAt = callBound('String.prototype.charAt'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-isstringprefix + +module.exports = function IsStringPrefix(p, q) { + if (Type(p) !== 'String') { + throw new $TypeError('Assertion failed: "p" must be a String'); + } + + if (Type(q) !== 'String') { + throw new $TypeError('Assertion failed: "q" must be a String'); + } + + return isPrefixOf(p, q); + /* + if (p === q || p === '') { + return true; + } + + var pLength = p.length; + var qLength = q.length; + if (pLength >= qLength) { + return false; + } + + // assert: pLength < qLength + + for (var i = 0; i < pLength; i += 1) { + if ($charAt(p, i) !== $charAt(q, i)) { + return false; + } + } + return true; + */ +}; diff --git a/node_modules/es-abstract/2019/IterableToList.js b/node_modules/es-abstract/2019/IterableToList.js new file mode 100644 index 000000000..0b8cdcfe3 --- /dev/null +++ b/node_modules/es-abstract/2019/IterableToList.js @@ -0,0 +1,24 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); +var $arrayPush = callBound('Array.prototype.push'); + +var GetIterator = require('./GetIterator'); +var IteratorStep = require('./IteratorStep'); +var IteratorValue = require('./IteratorValue'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-iterabletolist + +module.exports = function IterableToList(items, method) { + var iterator = GetIterator(items, method); + var values = []; + var next = true; + while (next) { + next = IteratorStep(iterator); + if (next) { + var nextValue = IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; +}; diff --git a/node_modules/es-abstract/2019/IteratorClose.js b/node_modules/es-abstract/2019/IteratorClose.js new file mode 100644 index 000000000..35c8c2bea --- /dev/null +++ b/node_modules/es-abstract/2019/IteratorClose.js @@ -0,0 +1,50 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Call = require('./Call'); +var GetMethod = require('./GetMethod'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + +module.exports = function IteratorClose(iterator, completion) { + if (Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; +}; diff --git a/node_modules/es-abstract/2019/IteratorComplete.js b/node_modules/es-abstract/2019/IteratorComplete.js new file mode 100644 index 000000000..a62b9bfc1 --- /dev/null +++ b/node_modules/es-abstract/2019/IteratorComplete.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var ToBoolean = require('./ToBoolean'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + +module.exports = function IteratorComplete(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return ToBoolean(Get(iterResult, 'done')); +}; diff --git a/node_modules/es-abstract/2019/IteratorNext.js b/node_modules/es-abstract/2019/IteratorNext.js new file mode 100644 index 000000000..7e5991561 --- /dev/null +++ b/node_modules/es-abstract/2019/IteratorNext.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Invoke = require('./Invoke'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + +module.exports = function IteratorNext(iterator, value) { + var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; +}; diff --git a/node_modules/es-abstract/2019/IteratorStep.js b/node_modules/es-abstract/2019/IteratorStep.js new file mode 100644 index 000000000..41b9d1b25 --- /dev/null +++ b/node_modules/es-abstract/2019/IteratorStep.js @@ -0,0 +1,13 @@ +'use strict'; + +var IteratorComplete = require('./IteratorComplete'); +var IteratorNext = require('./IteratorNext'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + +module.exports = function IteratorStep(iterator) { + var result = IteratorNext(iterator); + var done = IteratorComplete(result); + return done === true ? false : result; +}; + diff --git a/node_modules/es-abstract/2019/IteratorValue.js b/node_modules/es-abstract/2019/IteratorValue.js new file mode 100644 index 000000000..5e71a4463 --- /dev/null +++ b/node_modules/es-abstract/2019/IteratorValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + +module.exports = function IteratorValue(iterResult) { + if (Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return Get(iterResult, 'value'); +}; + diff --git a/node_modules/es-abstract/2019/MakeDate.js b/node_modules/es-abstract/2019/MakeDate.js new file mode 100644 index 000000000..7b592d136 --- /dev/null +++ b/node_modules/es-abstract/2019/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/es-abstract/2019/MakeDay.js b/node_modules/es-abstract/2019/MakeDay.js new file mode 100644 index 000000000..f1ab81060 --- /dev/null +++ b/node_modules/es-abstract/2019/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/es-abstract/2019/MakeTime.js b/node_modules/es-abstract/2019/MakeTime.js new file mode 100644 index 000000000..e11850040 --- /dev/null +++ b/node_modules/es-abstract/2019/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/es-abstract/2019/MinFromTime.js b/node_modules/es-abstract/2019/MinFromTime.js new file mode 100644 index 000000000..e80e19108 --- /dev/null +++ b/node_modules/es-abstract/2019/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/es-abstract/2019/MonthFromTime.js b/node_modules/es-abstract/2019/MonthFromTime.js new file mode 100644 index 000000000..4f120f2c2 --- /dev/null +++ b/node_modules/es-abstract/2019/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/es-abstract/2019/NumberToString.js b/node_modules/es-abstract/2019/NumberToString.js new file mode 100644 index 000000000..2cc70e008 --- /dev/null +++ b/node_modules/es-abstract/2019/NumberToString.js @@ -0,0 +1,18 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-tostring-applied-to-the-number-type + +module.exports = function NumberToString(m) { + if (Type(m) !== 'Number') { + throw new TypeError('Assertion failed: "m" must be a String'); + } + + return $String(m); +}; + diff --git a/node_modules/es-abstract/2019/ObjectCreate.js b/node_modules/es-abstract/2019/ObjectCreate.js new file mode 100644 index 000000000..e2445b022 --- /dev/null +++ b/node_modules/es-abstract/2019/ObjectCreate.js @@ -0,0 +1,37 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $ObjectCreate = GetIntrinsic('%Object.create%', true); +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var Type = require('./Type'); + +var hasProto = !({ __proto__: null } instanceof Object); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + +module.exports = function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: `proto` must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if ($ObjectCreate) { + return $ObjectCreate(proto); + } + if (hasProto) { + return { __proto__: proto }; + } + + if (proto === null) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + var T = function T() {}; + T.prototype = proto; + return new T(); +}; diff --git a/node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js b/node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js new file mode 100644 index 000000000..59780b3bb --- /dev/null +++ b/node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js @@ -0,0 +1,61 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var IsPropertyKey = require('./IsPropertyKey'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); +var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + +module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!$gOPD) { + // ES3/IE 8 fallback + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError('This environment does not support accessor property descriptors.'); + } + var creatingNormalDataProperty = !(P in O) + && Desc['[[Writable]]'] + && Desc['[[Enumerable]]'] + && Desc['[[Configurable]]'] + && '[[Value]]' in Desc; + var settingExistingDataProperty = (P in O) + && (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]']) + && (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]']) + && (!('[[Writable]]' in Desc) || Desc['[[Writable]]']) + && '[[Value]]' in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign + return SameValue(O[P], Desc['[[Value]]']); + } + throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties'); + } + var desc = $gOPD(O, P); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O); + return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); +}; diff --git a/node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js b/node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js new file mode 100644 index 000000000..b9882e5dc --- /dev/null +++ b/node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var has = require('has'); + +var IsArray = require('./IsArray'); +var IsPropertyKey = require('./IsPropertyKey'); +var IsRegExp = require('./IsRegExp'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + +module.exports = function OrdinaryGetOwnProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 / IE 8 fallback + var arrayLength = IsArray(O) && P === 'length'; + var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return ToPropertyDescriptor($gOPD(O, P)); +}; diff --git a/node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js b/node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js new file mode 100644 index 000000000..344077a40 --- /dev/null +++ b/node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $getProto = require('../helpers/getProto'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof + +module.exports = function OrdinaryGetPrototypeOf(O) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!$getProto) { + throw new $TypeError('This environment does not support fetching prototypes.'); + } + return $getProto(O); +}; diff --git a/node_modules/es-abstract/2019/OrdinaryHasInstance.js b/node_modules/es-abstract/2019/OrdinaryHasInstance.js new file mode 100644 index 000000000..51abe26d5 --- /dev/null +++ b/node_modules/es-abstract/2019/OrdinaryHasInstance.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + +module.exports = function OrdinaryHasInstance(C, O) { + if (IsCallable(C) === false) { + return false; + } + if (Type(O) !== 'Object') { + return false; + } + var P = Get(C, 'prototype'); + if (Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; +}; diff --git a/node_modules/es-abstract/2019/OrdinaryHasProperty.js b/node_modules/es-abstract/2019/OrdinaryHasProperty.js new file mode 100644 index 000000000..076c25ac5 --- /dev/null +++ b/node_modules/es-abstract/2019/OrdinaryHasProperty.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + +module.exports = function OrdinaryHasProperty(O, P) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; +}; diff --git a/node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js b/node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js new file mode 100644 index 000000000..3541331ca --- /dev/null +++ b/node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js @@ -0,0 +1,53 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $setProto = require('../helpers/setProto'); + +var OrdinaryGetPrototypeOf = require('./OrdinaryGetPrototypeOf'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof + +module.exports = function OrdinarySetPrototypeOf(O, V) { + if (Type(V) !== 'Object' && Type(V) !== 'Null') { + throw new $TypeError('Assertion failed: V must be Object or Null'); + } + /* + var extensible = IsExtensible(O); + var current = OrdinaryGetPrototypeOf(O); + if (SameValue(V, current)) { + return true; + } + if (!extensible) { + return false; + } + */ + try { + $setProto(O, V); + } catch (e) { + return false; + } + return OrdinaryGetPrototypeOf(O) === V; + /* + var p = V; + var done = false; + while (!done) { + if (p === null) { + done = true; + } else if (SameValue(p, O)) { + return false; + } else { + if (wat) { + done = true; + } else { + p = p.[[Prototype]]; + } + } + } + O.[[Prototype]] = V; + return true; + */ +}; diff --git a/node_modules/es-abstract/2019/PromiseResolve.js b/node_modules/es-abstract/2019/PromiseResolve.js new file mode 100644 index 000000000..f70745df7 --- /dev/null +++ b/node_modules/es-abstract/2019/PromiseResolve.js @@ -0,0 +1,15 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $PromiseResolve = callBound('Promise.resolve', true); + +// https://ecma-international.org/ecma-262/9.0/#sec-promise-resolve + +module.exports = function PromiseResolve(C, x) { + if (!$PromiseResolve) { + throw new SyntaxError('This environment does not support Promises.'); + } + return $PromiseResolve(C, x); +}; + diff --git a/node_modules/es-abstract/2019/RegExpExec.js b/node_modules/es-abstract/2019/RegExpExec.js new file mode 100644 index 000000000..15c91867d --- /dev/null +++ b/node_modules/es-abstract/2019/RegExpExec.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var regexExec = require('../helpers/callBound')('RegExp.prototype.exec'); + +var Call = require('./Call'); +var Get = require('./Get'); +var IsCallable = require('./IsCallable'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + +module.exports = function RegExpExec(R, S) { + if (Type(R) !== 'Object') { + throw new $TypeError('Assertion failed: `R` must be an Object'); + } + if (Type(S) !== 'String') { + throw new $TypeError('Assertion failed: `S` must be a String'); + } + var exec = Get(R, 'exec'); + if (IsCallable(exec)) { + var result = Call(exec, R, [S]); + if (result === null || Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); +}; diff --git a/node_modules/es-abstract/2019/RequireObjectCoercible.js b/node_modules/es-abstract/2019/RequireObjectCoercible.js new file mode 100644 index 000000000..9008359db --- /dev/null +++ b/node_modules/es-abstract/2019/RequireObjectCoercible.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../5/CheckObjectCoercible'); diff --git a/node_modules/es-abstract/2019/SameValue.js b/node_modules/es-abstract/2019/SameValue.js new file mode 100644 index 000000000..47c936d76 --- /dev/null +++ b/node_modules/es-abstract/2019/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/es-abstract/2019/SameValueNonNumber.js b/node_modules/es-abstract/2019/SameValueNonNumber.js new file mode 100644 index 000000000..5668752e3 --- /dev/null +++ b/node_modules/es-abstract/2019/SameValueNonNumber.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var SameValue = require('./SameValue'); + +// https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber + +module.exports = function SameValueNonNumber(x, y) { + if (typeof x === 'number' || typeof x !== typeof y) { + throw new $TypeError('SameValueNonNumber requires two non-number values of the same type.'); + } + return SameValue(x, y); +}; diff --git a/node_modules/es-abstract/2019/SameValueZero.js b/node_modules/es-abstract/2019/SameValueZero.js new file mode 100644 index 000000000..0dedcd2c3 --- /dev/null +++ b/node_modules/es-abstract/2019/SameValueZero.js @@ -0,0 +1,9 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero + +module.exports = function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); +}; diff --git a/node_modules/es-abstract/2019/SecFromTime.js b/node_modules/es-abstract/2019/SecFromTime.js new file mode 100644 index 000000000..7190011d2 --- /dev/null +++ b/node_modules/es-abstract/2019/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/es-abstract/2019/Set.js b/node_modules/es-abstract/2019/Set.js new file mode 100644 index 000000000..9545b1325 --- /dev/null +++ b/node_modules/es-abstract/2019/Set.js @@ -0,0 +1,47 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + +module.exports = function Set(O, P, V, Throw) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: `O` must be an Object'); + } + if (!IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: `P` must be a Property Key'); + } + if (Type(Throw) !== 'Boolean') { + throw new $TypeError('Assertion failed: `Throw` must be a Boolean'); + } + if (Throw) { + O[P] = V; // eslint-disable-line no-param-reassign + if (noThrowOnStrictViolation && !SameValue(O[P], V)) { + throw new $TypeError('Attempted to assign to readonly property.'); + } + return true; + } else { + try { + O[P] = V; // eslint-disable-line no-param-reassign + return noThrowOnStrictViolation ? SameValue(O[P], V) : true; + } catch (e) { + return false; + } + } +}; diff --git a/node_modules/es-abstract/2019/SetFunctionName.js b/node_modules/es-abstract/2019/SetFunctionName.js new file mode 100644 index 000000000..f93324a73 --- /dev/null +++ b/node_modules/es-abstract/2019/SetFunctionName.js @@ -0,0 +1,44 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var getSymbolDescription = require('../helpers/getSymbolDescription'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsExtensible = require('./IsExtensible'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + +module.exports = function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); +}; diff --git a/node_modules/es-abstract/2019/SetIntegrityLevel.js b/node_modules/es-abstract/2019/SetIntegrityLevel.js new file mode 100644 index 000000000..3d5c81d56 --- /dev/null +++ b/node_modules/es-abstract/2019/SetIntegrityLevel.js @@ -0,0 +1,57 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $preventExtensions = GetIntrinsic('%Object.preventExtensions%'); +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); + +var forEach = require('../helpers/forEach'); + +var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + +module.exports = function SetIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + if (level === 'sealed') { + forEach(theKeys, function (k) { + DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; +}; diff --git a/node_modules/es-abstract/2019/SpeciesConstructor.js b/node_modules/es-abstract/2019/SpeciesConstructor.js new file mode 100644 index 000000000..3cdcd747d --- /dev/null +++ b/node_modules/es-abstract/2019/SpeciesConstructor.js @@ -0,0 +1,32 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $species = GetIntrinsic('%Symbol.species%', true); +var $TypeError = GetIntrinsic('%TypeError%'); + +var IsConstructor = require('./IsConstructor'); +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + +module.exports = function SpeciesConstructor(O, defaultConstructor) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = $species ? C[$species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); +}; diff --git a/node_modules/es-abstract/2019/StrictEqualityComparison.js b/node_modules/es-abstract/2019/StrictEqualityComparison.js new file mode 100644 index 000000000..eea5df388 --- /dev/null +++ b/node_modules/es-abstract/2019/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/es-abstract/2019/SymbolDescriptiveString.js b/node_modules/es-abstract/2019/SymbolDescriptiveString.js new file mode 100644 index 000000000..7bd8191ad --- /dev/null +++ b/node_modules/es-abstract/2019/SymbolDescriptiveString.js @@ -0,0 +1,20 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = require('../helpers/callBound'); + +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + +module.exports = function SymbolDescriptiveString(sym) { + if (Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); +}; diff --git a/node_modules/es-abstract/2019/TestIntegrityLevel.js b/node_modules/es-abstract/2019/TestIntegrityLevel.js new file mode 100644 index 000000000..7a57397d5 --- /dev/null +++ b/node_modules/es-abstract/2019/TestIntegrityLevel.js @@ -0,0 +1,42 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = require('../helpers/getOwnPropertyDescriptor'); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var every = require('../helpers/every'); + +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsExtensible = require('./IsExtensible'); +var ToPropertyDescriptor = require('./ToPropertyDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + +module.exports = function TestIntegrityLevel(O, level) { + if (Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); +}; diff --git a/node_modules/es-abstract/2019/TimeClip.js b/node_modules/es-abstract/2019/TimeClip.js new file mode 100644 index 000000000..57aa08cb9 --- /dev/null +++ b/node_modules/es-abstract/2019/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/es-abstract/2019/TimeFromYear.js b/node_modules/es-abstract/2019/TimeFromYear.js new file mode 100644 index 000000000..df646c36e --- /dev/null +++ b/node_modules/es-abstract/2019/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/es-abstract/2019/TimeString.js b/node_modules/es-abstract/2019/TimeString.js new file mode 100644 index 000000000..87642eb54 --- /dev/null +++ b/node_modules/es-abstract/2019/TimeString.js @@ -0,0 +1,25 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var padTimeComponent = require('../helpers/padTimeComponent'); + +var HourFromTime = require('./HourFromTime'); +var MinFromTime = require('./MinFromTime'); +var SecFromTime = require('./SecFromTime'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/9.0/#sec-timestring + +module.exports = function TimeString(tv) { + if (Type(tv) !== 'Number' || $isNaN(tv)) { + throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number'); + } + var hour = HourFromTime(tv); + var minute = MinFromTime(tv); + var second = SecFromTime(tv); + return padTimeComponent(hour) + ':' + padTimeComponent(minute) + ':' + padTimeComponent(second) + '\x20GMT'; +}; diff --git a/node_modules/es-abstract/2019/TimeWithinDay.js b/node_modules/es-abstract/2019/TimeWithinDay.js new file mode 100644 index 000000000..c5b21d378 --- /dev/null +++ b/node_modules/es-abstract/2019/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/es-abstract/2019/ToBoolean.js b/node_modules/es-abstract/2019/ToBoolean.js new file mode 100644 index 000000000..65d87376d --- /dev/null +++ b/node_modules/es-abstract/2019/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/es-abstract/2019/ToDateString.js b/node_modules/es-abstract/2019/ToDateString.js new file mode 100644 index 000000000..7a6d4c4e9 --- /dev/null +++ b/node_modules/es-abstract/2019/ToDateString.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Date = GetIntrinsic('%Date%'); + +var $isNaN = require('../helpers/isNaN'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-todatestring + +module.exports = function ToDateString(tv) { + if (Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); +}; diff --git a/node_modules/es-abstract/2019/ToIndex.js b/node_modules/es-abstract/2019/ToIndex.js new file mode 100644 index 000000000..a55398d3e --- /dev/null +++ b/node_modules/es-abstract/2019/ToIndex.js @@ -0,0 +1,26 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $RangeError = GetIntrinsic('%RangeError%'); + +var ToInteger = require('./ToInteger'); +var ToLength = require('./ToLength'); +var SameValueZero = require('./SameValueZero'); + +// https://www.ecma-international.org/ecma-262/8.0/#sec-toindex + +module.exports = function ToIndex(value) { + if (typeof value === 'undefined') { + return 0; + } + var integerIndex = ToInteger(value); + if (integerIndex < 0) { + throw new $RangeError('index must be >= 0'); + } + var index = ToLength(integerIndex); + if (!SameValueZero(integerIndex, index)) { + throw new $RangeError('index must be >= 0 and < 2 ** 53 - 1'); + } + return index; +}; diff --git a/node_modules/es-abstract/2019/ToInt16.js b/node_modules/es-abstract/2019/ToInt16.js new file mode 100644 index 000000000..5a112c237 --- /dev/null +++ b/node_modules/es-abstract/2019/ToInt16.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint16 = require('./ToUint16'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16 + +module.exports = function ToInt16(argument) { + var int16bit = ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; +}; diff --git a/node_modules/es-abstract/2019/ToInt32.js b/node_modules/es-abstract/2019/ToInt32.js new file mode 100644 index 000000000..a8d268070 --- /dev/null +++ b/node_modules/es-abstract/2019/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/es-abstract/2019/ToInt8.js b/node_modules/es-abstract/2019/ToInt8.js new file mode 100644 index 000000000..d103123a9 --- /dev/null +++ b/node_modules/es-abstract/2019/ToInt8.js @@ -0,0 +1,10 @@ +'use strict'; + +var ToUint8 = require('./ToUint8'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8 + +module.exports = function ToInt8(argument) { + var int8bit = ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; +}; diff --git a/node_modules/es-abstract/2019/ToInteger.js b/node_modules/es-abstract/2019/ToInteger.js new file mode 100644 index 000000000..16f7db9c3 --- /dev/null +++ b/node_modules/es-abstract/2019/ToInteger.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5ToInteger = require('../5/ToInteger'); + +var ToNumber = require('./ToNumber'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + return ES5ToInteger(number); +}; diff --git a/node_modules/es-abstract/2019/ToLength.js b/node_modules/es-abstract/2019/ToLength.js new file mode 100644 index 000000000..1bef9bed7 --- /dev/null +++ b/node_modules/es-abstract/2019/ToLength.js @@ -0,0 +1,12 @@ +'use strict'; + +var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); + +var ToInteger = require('./ToInteger'); + +module.exports = function ToLength(argument) { + var len = ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; +}; diff --git a/node_modules/es-abstract/2019/ToNumber.js b/node_modules/es-abstract/2019/ToNumber.js new file mode 100644 index 000000000..7a3cdc89e --- /dev/null +++ b/node_modules/es-abstract/2019/ToNumber.js @@ -0,0 +1,59 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $Number = GetIntrinsic('%Number%'); +var $RegExp = GetIntrinsic('%RegExp%'); +var $parseInteger = GetIntrinsic('%parseInt%'); + +var callBound = require('../helpers/callBound'); +var regexTester = require('../helpers/regexTester'); +var isPrimitive = require('../helpers/isPrimitive'); + +var $strSlice = callBound('String.prototype.slice'); +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var $trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ToPrimitive = require('./ToPrimitive'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber + +module.exports = function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return ToNumber($parseInteger($strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = $trim(value); + if (trimmed !== value) { + return ToNumber(trimmed); + } + } + } + return $Number(value); +}; diff --git a/node_modules/es-abstract/2019/ToObject.js b/node_modules/es-abstract/2019/ToObject.js new file mode 100644 index 000000000..50d5b94a4 --- /dev/null +++ b/node_modules/es-abstract/2019/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject + +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/es-abstract/2019/ToPrimitive.js b/node_modules/es-abstract/2019/ToPrimitive.js new file mode 100644 index 000000000..81c655d41 --- /dev/null +++ b/node_modules/es-abstract/2019/ToPrimitive.js @@ -0,0 +1,12 @@ +'use strict'; + +var toPrimitive = require('es-to-primitive/es2015'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive + +module.exports = function ToPrimitive(input) { + if (arguments.length > 1) { + return toPrimitive(input, arguments[1]); + } + return toPrimitive(input); +}; diff --git a/node_modules/es-abstract/2019/ToPropertyDescriptor.js b/node_modules/es-abstract/2019/ToPropertyDescriptor.js new file mode 100644 index 000000000..38e536e2d --- /dev/null +++ b/node_modules/es-abstract/2019/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/es-abstract/2019/ToPropertyKey.js b/node_modules/es-abstract/2019/ToPropertyKey.js new file mode 100644 index 000000000..38f40dd80 --- /dev/null +++ b/node_modules/es-abstract/2019/ToPropertyKey.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +var ToPrimitive = require('./ToPrimitive'); +var ToString = require('./ToString'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey + +module.exports = function ToPropertyKey(argument) { + var key = ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : ToString(key); +}; diff --git a/node_modules/es-abstract/2019/ToString.js b/node_modules/es-abstract/2019/ToString.js new file mode 100644 index 000000000..a34543126 --- /dev/null +++ b/node_modules/es-abstract/2019/ToString.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring + +module.exports = function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); +}; diff --git a/node_modules/es-abstract/2019/ToUint16.js b/node_modules/es-abstract/2019/ToUint16.js new file mode 100644 index 000000000..c8a408bfa --- /dev/null +++ b/node_modules/es-abstract/2019/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/es-abstract/2019/ToUint32.js b/node_modules/es-abstract/2019/ToUint32.js new file mode 100644 index 000000000..3660f6209 --- /dev/null +++ b/node_modules/es-abstract/2019/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/es-abstract/2019/ToUint8.js b/node_modules/es-abstract/2019/ToUint8.js new file mode 100644 index 000000000..bf8475321 --- /dev/null +++ b/node_modules/es-abstract/2019/ToUint8.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +module.exports = function ToUint8(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x100); +}; diff --git a/node_modules/es-abstract/2019/ToUint8Clamp.js b/node_modules/es-abstract/2019/ToUint8Clamp.js new file mode 100644 index 000000000..c7f9f5656 --- /dev/null +++ b/node_modules/es-abstract/2019/ToUint8Clamp.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); + +var $floor = $Math.floor; + +// https://www.ecma-international.org/ecma-262/6.0/#sec-touint8clamp + +module.exports = function ToUint8Clamp(argument) { + var number = ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; +}; diff --git a/node_modules/es-abstract/2019/TrimString.js b/node_modules/es-abstract/2019/TrimString.js new file mode 100644 index 000000000..b27112cd5 --- /dev/null +++ b/node_modules/es-abstract/2019/TrimString.js @@ -0,0 +1,29 @@ +'use strict'; + +var trimStart = require('string.prototype.trimstart'); +var trimEnd = require('string.prototype.trimend'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var RequireObjectCoercible = require('./RequireObjectCoercible'); +var ToString = require('./ToString'); + +// https://ecma-international.org/ecma-262/10.0/#sec-trimstring + +module.exports = function TrimString(string, where) { + var str = RequireObjectCoercible(string); + var S = ToString(str); + var T; + if (where === 'start') { + T = trimStart(S); + } else if (where === 'end') { + T = trimEnd(S); + } else if (where === 'start+end') { + T = trimStart(trimEnd(S)); + } else { + throw new $TypeError('Assertion failed: invalid `where` value; must be "start", "end", or "start+end"'); + } + return T; +}; diff --git a/node_modules/es-abstract/2019/Type.js b/node_modules/es-abstract/2019/Type.js new file mode 100644 index 000000000..0bd11659c --- /dev/null +++ b/node_modules/es-abstract/2019/Type.js @@ -0,0 +1,12 @@ +'use strict'; + +var ES5Type = require('../5/Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values + +module.exports = function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5Type(x); +}; diff --git a/node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js b/node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js new file mode 100644 index 000000000..d4b900700 --- /dev/null +++ b/node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js @@ -0,0 +1,170 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var DefineOwnProperty = require('../helpers/DefineOwnProperty'); +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isSamePropertyDescriptor = require('../helpers/isSamePropertyDescriptor'); + +var FromPropertyDescriptor = require('./FromPropertyDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsGenericDescriptor = require('./IsGenericDescriptor'); +var IsPropertyKey = require('./IsPropertyKey'); +var SameValue = require('./SameValue'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor +// https://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor + +// eslint-disable-next-line max-lines-per-function, max-statements, max-params +module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (Type(current) !== 'Undefined' && !isPropertyDescriptor({ + Type: Type, + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor + }, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + } + ); + } + } else { + if (!IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + } + return true; + } + if (IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor({ SameValue: SameValue }, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (IsDataDescriptor(current) !== IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + } + ); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + } + ); + } + } else if (IsDataDescriptor(current) && IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (IsAccessorDescriptor(current) && IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O, + P, + Desc + ); + } + return true; +}; diff --git a/node_modules/es-abstract/2019/WeekDay.js b/node_modules/es-abstract/2019/WeekDay.js new file mode 100644 index 000000000..2973e0200 --- /dev/null +++ b/node_modules/es-abstract/2019/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/es-abstract/2019/YearFromTime.js b/node_modules/es-abstract/2019/YearFromTime.js new file mode 100644 index 000000000..ff5339f24 --- /dev/null +++ b/node_modules/es-abstract/2019/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/es-abstract/2019/modulo.js b/node_modules/es-abstract/2019/modulo.js new file mode 100644 index 000000000..bc04c0628 --- /dev/null +++ b/node_modules/es-abstract/2019/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/es-abstract/2019/msFromTime.js b/node_modules/es-abstract/2019/msFromTime.js new file mode 100644 index 000000000..c31eda085 --- /dev/null +++ b/node_modules/es-abstract/2019/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/es-abstract/2019/thisBooleanValue.js b/node_modules/es-abstract/2019/thisBooleanValue.js new file mode 100644 index 000000000..3ffac9cdf --- /dev/null +++ b/node_modules/es-abstract/2019/thisBooleanValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $BooleanValueOf = require('../helpers/callBound')('Boolean.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + +module.exports = function thisBooleanValue(value) { + if (Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); +}; diff --git a/node_modules/es-abstract/2019/thisNumberValue.js b/node_modules/es-abstract/2019/thisNumberValue.js new file mode 100644 index 000000000..0345e523f --- /dev/null +++ b/node_modules/es-abstract/2019/thisNumberValue.js @@ -0,0 +1,18 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var Type = require('./Type'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + +module.exports = function thisNumberValue(value) { + if (Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); +}; + diff --git a/node_modules/es-abstract/2019/thisStringValue.js b/node_modules/es-abstract/2019/thisStringValue.js new file mode 100644 index 000000000..3b99b6e3c --- /dev/null +++ b/node_modules/es-abstract/2019/thisStringValue.js @@ -0,0 +1,15 @@ +'use strict'; + +var $StringValueOf = require('../helpers/callBound')('String.prototype.valueOf'); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + +module.exports = function thisStringValue(value) { + if (Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); +}; diff --git a/node_modules/es-abstract/2019/thisSymbolValue.js b/node_modules/es-abstract/2019/thisSymbolValue.js new file mode 100644 index 000000000..3c3b3475d --- /dev/null +++ b/node_modules/es-abstract/2019/thisSymbolValue.js @@ -0,0 +1,19 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $SymbolValueOf = callBound('Symbol.prototype.valueOf', true); + +var Type = require('./Type'); + +// https://ecma-international.org/ecma-262/9.0/#sec-thissymbolvalue + +module.exports = function thisSymbolValue(value) { + if (!$SymbolValueOf) { + throw new SyntaxError('Symbols are not supported; thisSymbolValue requires that `value` be a Symbol or a Symbol object'); + } + if (Type(value) === 'Symbol') { + return value; + } + return $SymbolValueOf(value); +}; diff --git a/node_modules/es-abstract/2019/thisTimeValue.js b/node_modules/es-abstract/2019/thisTimeValue.js new file mode 100644 index 000000000..a9a47ace2 --- /dev/null +++ b/node_modules/es-abstract/2019/thisTimeValue.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../2018/thisTimeValue'); diff --git a/node_modules/es-abstract/5/AbstractEqualityComparison.js b/node_modules/es-abstract/5/AbstractEqualityComparison.js new file mode 100644 index 000000000..e55c7647f --- /dev/null +++ b/node_modules/es-abstract/5/AbstractEqualityComparison.js @@ -0,0 +1,37 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.3 + +module.exports = function AbstractEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (xType === 'Boolean') { + return AbstractEqualityComparison(ToNumber(x), y); + } + if (yType === 'Boolean') { + return AbstractEqualityComparison(x, ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number') && yType === 'Object') { + return AbstractEqualityComparison(x, ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number')) { + return AbstractEqualityComparison(ToPrimitive(x), y); + } + return false; +}; diff --git a/node_modules/es-abstract/5/AbstractRelationalComparison.js b/node_modules/es-abstract/5/AbstractRelationalComparison.js new file mode 100644 index 000000000..bc7ca8324 --- /dev/null +++ b/node_modules/es-abstract/5/AbstractRelationalComparison.js @@ -0,0 +1,66 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Number = GetIntrinsic('%Number%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var isPrefixOf = require('../helpers/isPrefixOf'); + +var ToNumber = require('./ToNumber'); +var ToPrimitive = require('./ToPrimitive'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + +// eslint-disable-next-line max-statements +module.exports = function AbstractRelationalComparison(x, y, LeftFirst) { + if (Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = ToPrimitive(x, $Number); + py = ToPrimitive(y, $Number); + } else { + py = ToPrimitive(y, $Number); + px = ToPrimitive(x, $Number); + } + var bothStrings = Type(px) === 'String' && Type(py) === 'String'; + if (!bothStrings) { + var nx = ToNumber(px); + var ny = ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f +}; diff --git a/node_modules/es-abstract/5/CheckObjectCoercible.js b/node_modules/es-abstract/5/CheckObjectCoercible.js new file mode 100644 index 000000000..f02b28911 --- /dev/null +++ b/node_modules/es-abstract/5/CheckObjectCoercible.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.10 + +module.exports = function CheckObjectCoercible(value, optMessage) { + if (value == null) { + throw new $TypeError(optMessage || ('Cannot call method on ' + value)); + } + return value; +}; diff --git a/node_modules/es-abstract/5/DateFromTime.js b/node_modules/es-abstract/5/DateFromTime.js new file mode 100644 index 000000000..962dba168 --- /dev/null +++ b/node_modules/es-abstract/5/DateFromTime.js @@ -0,0 +1,54 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); +var MonthFromTime = require('./MonthFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + +module.exports = function DateFromTime(t) { + var m = MonthFromTime(t); + var d = DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); +}; diff --git a/node_modules/es-abstract/5/Day.js b/node_modules/es-abstract/5/Day.js new file mode 100644 index 000000000..00df81342 --- /dev/null +++ b/node_modules/es-abstract/5/Day.js @@ -0,0 +1,13 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function Day(t) { + return $floor(t / msPerDay); +}; diff --git a/node_modules/es-abstract/5/DayFromYear.js b/node_modules/es-abstract/5/DayFromYear.js new file mode 100644 index 000000000..08dd5af60 --- /dev/null +++ b/node_modules/es-abstract/5/DayFromYear.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); +}; + diff --git a/node_modules/es-abstract/5/DayWithinYear.js b/node_modules/es-abstract/5/DayWithinYear.js new file mode 100644 index 000000000..cfc400288 --- /dev/null +++ b/node_modules/es-abstract/5/DayWithinYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var Day = require('./Day'); +var DayFromYear = require('./DayFromYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function DayWithinYear(t) { + return Day(t) - DayFromYear(YearFromTime(t)); +}; diff --git a/node_modules/es-abstract/5/DaysInYear.js b/node_modules/es-abstract/5/DaysInYear.js new file mode 100644 index 000000000..db32251ff --- /dev/null +++ b/node_modules/es-abstract/5/DaysInYear.js @@ -0,0 +1,18 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; +}; diff --git a/node_modules/es-abstract/5/FromPropertyDescriptor.js b/node_modules/es-abstract/5/FromPropertyDescriptor.js new file mode 100644 index 000000000..a3cefbe51 --- /dev/null +++ b/node_modules/es-abstract/5/FromPropertyDescriptor.js @@ -0,0 +1,39 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +var assertRecord = require('../helpers/assertRecord'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.4 + +module.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (IsDataDescriptor(Desc)) { + return { + value: Desc['[[Value]]'], + writable: !!Desc['[[Writable]]'], + enumerable: !!Desc['[[Enumerable]]'], + configurable: !!Desc['[[Configurable]]'] + }; + } else if (IsAccessorDescriptor(Desc)) { + return { + get: Desc['[[Get]]'], + set: Desc['[[Set]]'], + enumerable: !!Desc['[[Enumerable]]'], + configurable: !!Desc['[[Configurable]]'] + }; + } else { + throw new $TypeError('FromPropertyDescriptor must be called with a fully populated Property Descriptor'); + } +}; diff --git a/node_modules/es-abstract/5/HourFromTime.js b/node_modules/es-abstract/5/HourFromTime.js new file mode 100644 index 000000000..957ce321a --- /dev/null +++ b/node_modules/es-abstract/5/HourFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerHour = timeConstants.msPerHour; +var HoursPerDay = timeConstants.HoursPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); +}; diff --git a/node_modules/es-abstract/5/InLeapYear.js b/node_modules/es-abstract/5/InLeapYear.js new file mode 100644 index 000000000..38ba8fdc8 --- /dev/null +++ b/node_modules/es-abstract/5/InLeapYear.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $EvalError = GetIntrinsic('%EvalError%'); + +var DaysInYear = require('./DaysInYear'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function InLeapYear(t) { + var days = DaysInYear(YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); +}; diff --git a/node_modules/es-abstract/5/IsAccessorDescriptor.js b/node_modules/es-abstract/5/IsAccessorDescriptor.js new file mode 100644 index 000000000..561382a10 --- /dev/null +++ b/node_modules/es-abstract/5/IsAccessorDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var Type = require('./Type'); + +var assertRecord = require('../helpers/assertRecord'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.1 + +module.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/es-abstract/5/IsCallable.js b/node_modules/es-abstract/5/IsCallable.js new file mode 100644 index 000000000..e4bfa365c --- /dev/null +++ b/node_modules/es-abstract/5/IsCallable.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 + +module.exports = require('is-callable'); diff --git a/node_modules/es-abstract/5/IsDataDescriptor.js b/node_modules/es-abstract/5/IsDataDescriptor.js new file mode 100644 index 000000000..783e2dc6a --- /dev/null +++ b/node_modules/es-abstract/5/IsDataDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var has = require('has'); + +var Type = require('./Type'); + +var assertRecord = require('../helpers/assertRecord'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.2 + +module.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; +}; diff --git a/node_modules/es-abstract/5/IsGenericDescriptor.js b/node_modules/es-abstract/5/IsGenericDescriptor.js new file mode 100644 index 000000000..93340e987 --- /dev/null +++ b/node_modules/es-abstract/5/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +var assertRecord = require('../helpers/assertRecord'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.3 + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; diff --git a/node_modules/es-abstract/5/IsPropertyDescriptor.js b/node_modules/es-abstract/5/IsPropertyDescriptor.js new file mode 100644 index 000000000..2a96c637b --- /dev/null +++ b/node_modules/es-abstract/5/IsPropertyDescriptor.js @@ -0,0 +1,17 @@ +'use strict'; + +var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); + +var Type = require('./Type'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); + +// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + +module.exports = function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor({ + IsDataDescriptor: IsDataDescriptor, + IsAccessorDescriptor: IsAccessorDescriptor, + Type: Type + }, Desc); +}; diff --git a/node_modules/es-abstract/5/MakeDate.js b/node_modules/es-abstract/5/MakeDate.js new file mode 100644 index 000000000..7b592d136 --- /dev/null +++ b/node_modules/es-abstract/5/MakeDate.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + +module.exports = function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; +}; diff --git a/node_modules/es-abstract/5/MakeDay.js b/node_modules/es-abstract/5/MakeDay.js new file mode 100644 index 000000000..f1ab81060 --- /dev/null +++ b/node_modules/es-abstract/5/MakeDay.js @@ -0,0 +1,33 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); + +var mod = require('../helpers/mod'); +var $isFinite = require('../helpers/isFinite'); + +var DateFromTime = require('./DateFromTime'); +var Day = require('./Day'); +var MonthFromTime = require('./MonthFromTime'); +var ToInteger = require('./ToInteger'); +var YearFromTime = require('./YearFromTime'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + +module.exports = function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = ToInteger(year); + var m = ToInteger(month); + var dt = ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) { + return NaN; + } + return Day(t) + dt - 1; +}; diff --git a/node_modules/es-abstract/5/MakeTime.js b/node_modules/es-abstract/5/MakeTime.js new file mode 100644 index 000000000..e11850040 --- /dev/null +++ b/node_modules/es-abstract/5/MakeTime.js @@ -0,0 +1,23 @@ +'use strict'; + +var $isFinite = require('../helpers/isFinite'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var msPerMinute = timeConstants.msPerMinute; +var msPerHour = timeConstants.msPerHour; + +var ToInteger = require('./ToInteger'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + +module.exports = function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = ToInteger(hour); + var m = ToInteger(min); + var s = ToInteger(sec); + var milli = ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; +}; diff --git a/node_modules/es-abstract/5/MinFromTime.js b/node_modules/es-abstract/5/MinFromTime.js new file mode 100644 index 000000000..e80e19108 --- /dev/null +++ b/node_modules/es-abstract/5/MinFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerMinute = timeConstants.msPerMinute; +var MinutesPerHour = timeConstants.MinutesPerHour; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); +}; diff --git a/node_modules/es-abstract/5/MonthFromTime.js b/node_modules/es-abstract/5/MonthFromTime.js new file mode 100644 index 000000000..4f120f2c2 --- /dev/null +++ b/node_modules/es-abstract/5/MonthFromTime.js @@ -0,0 +1,47 @@ +'use strict'; + +var DayWithinYear = require('./DayWithinYear'); +var InLeapYear = require('./InLeapYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + +module.exports = function MonthFromTime(t) { + var day = DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } +}; diff --git a/node_modules/es-abstract/5/SameValue.js b/node_modules/es-abstract/5/SameValue.js new file mode 100644 index 000000000..47c936d76 --- /dev/null +++ b/node_modules/es-abstract/5/SameValue.js @@ -0,0 +1,13 @@ +'use strict'; + +var $isNaN = require('../helpers/isNaN'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 + +module.exports = function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); +}; diff --git a/node_modules/es-abstract/5/SecFromTime.js b/node_modules/es-abstract/5/SecFromTime.js new file mode 100644 index 000000000..7190011d2 --- /dev/null +++ b/node_modules/es-abstract/5/SecFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $floor = GetIntrinsic('%Math.floor%'); + +var mod = require('../helpers/mod'); +var timeConstants = require('../helpers/timeConstants'); +var msPerSecond = timeConstants.msPerSecond; +var SecondsPerMinute = timeConstants.SecondsPerMinute; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); +}; diff --git a/node_modules/es-abstract/5/StrictEqualityComparison.js b/node_modules/es-abstract/5/StrictEqualityComparison.js new file mode 100644 index 000000000..eea5df388 --- /dev/null +++ b/node_modules/es-abstract/5/StrictEqualityComparison.js @@ -0,0 +1,17 @@ +'use strict'; + +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + +module.exports = function StrictEqualityComparison(x, y) { + var xType = Type(x); + var yType = Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 +}; diff --git a/node_modules/es-abstract/5/TimeClip.js b/node_modules/es-abstract/5/TimeClip.js new file mode 100644 index 000000000..57aa08cb9 --- /dev/null +++ b/node_modules/es-abstract/5/TimeClip.js @@ -0,0 +1,21 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var $isFinite = require('../helpers/isFinite'); + +var ToNumber = require('./ToNumber'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + +module.exports = function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(ToNumber(time))); +}; + diff --git a/node_modules/es-abstract/5/TimeFromYear.js b/node_modules/es-abstract/5/TimeFromYear.js new file mode 100644 index 000000000..df646c36e --- /dev/null +++ b/node_modules/es-abstract/5/TimeFromYear.js @@ -0,0 +1,11 @@ +'use strict'; + +var msPerDay = require('../helpers/timeConstants').msPerDay; + +var DayFromYear = require('./DayFromYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function TimeFromYear(y) { + return msPerDay * DayFromYear(y); +}; diff --git a/node_modules/es-abstract/5/TimeWithinDay.js b/node_modules/es-abstract/5/TimeWithinDay.js new file mode 100644 index 000000000..c5b21d378 --- /dev/null +++ b/node_modules/es-abstract/5/TimeWithinDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerDay = require('../helpers/timeConstants').msPerDay; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + +module.exports = function TimeWithinDay(t) { + return mod(t, msPerDay); +}; + diff --git a/node_modules/es-abstract/5/ToBoolean.js b/node_modules/es-abstract/5/ToBoolean.js new file mode 100644 index 000000000..65d87376d --- /dev/null +++ b/node_modules/es-abstract/5/ToBoolean.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 + +module.exports = function ToBoolean(value) { return !!value; }; diff --git a/node_modules/es-abstract/5/ToInt32.js b/node_modules/es-abstract/5/ToInt32.js new file mode 100644 index 000000000..a8d268070 --- /dev/null +++ b/node_modules/es-abstract/5/ToInt32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5 + +module.exports = function ToInt32(x) { + return ToNumber(x) >> 0; +}; diff --git a/node_modules/es-abstract/5/ToInteger.js b/node_modules/es-abstract/5/ToInteger.js new file mode 100644 index 000000000..a95265b9e --- /dev/null +++ b/node_modules/es-abstract/5/ToInteger.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.4 + +module.exports = function ToInteger(value) { + var number = ToNumber(value); + if ($isNaN(number)) { return 0; } + if (number === 0 || !$isFinite(number)) { return number; } + return $sign(number) * $floor($abs(number)); +}; diff --git a/node_modules/es-abstract/5/ToNumber.js b/node_modules/es-abstract/5/ToNumber.js new file mode 100644 index 000000000..4a7a3b885 --- /dev/null +++ b/node_modules/es-abstract/5/ToNumber.js @@ -0,0 +1,7 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.3 + +module.exports = function ToNumber(value) { + return +value; // eslint-disable-line no-implicit-coercion +}; diff --git a/node_modules/es-abstract/5/ToObject.js b/node_modules/es-abstract/5/ToObject.js new file mode 100644 index 000000000..1d27a134b --- /dev/null +++ b/node_modules/es-abstract/5/ToObject.js @@ -0,0 +1,14 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Object = GetIntrinsic('%Object%'); + +var CheckObjectCoercible = require('./CheckObjectCoercible'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.9 + +module.exports = function ToObject(value) { + CheckObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/es-abstract/5/ToPrimitive.js b/node_modules/es-abstract/5/ToPrimitive.js new file mode 100644 index 000000000..071df7049 --- /dev/null +++ b/node_modules/es-abstract/5/ToPrimitive.js @@ -0,0 +1,5 @@ +'use strict'; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.1 + +module.exports = require('es-to-primitive/es5'); diff --git a/node_modules/es-abstract/5/ToPropertyDescriptor.js b/node_modules/es-abstract/5/ToPropertyDescriptor.js new file mode 100644 index 000000000..38e536e2d --- /dev/null +++ b/node_modules/es-abstract/5/ToPropertyDescriptor.js @@ -0,0 +1,52 @@ +'use strict'; + +var has = require('has'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var Type = require('./Type'); +var ToBoolean = require('./ToBoolean'); +var IsCallable = require('./IsCallable'); + +// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + +module.exports = function ToPropertyDescriptor(Obj) { + if (Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !IsCallable(getter)) { + throw new TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; +}; diff --git a/node_modules/es-abstract/5/ToString.js b/node_modules/es-abstract/5/ToString.js new file mode 100644 index 000000000..80ece429b --- /dev/null +++ b/node_modules/es-abstract/5/ToString.js @@ -0,0 +1,12 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $String = GetIntrinsic('%String%'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.8 + +module.exports = function ToString(value) { + return $String(value); +}; + diff --git a/node_modules/es-abstract/5/ToUint16.js b/node_modules/es-abstract/5/ToUint16.js new file mode 100644 index 000000000..c8a408bfa --- /dev/null +++ b/node_modules/es-abstract/5/ToUint16.js @@ -0,0 +1,24 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); + +var ToNumber = require('./ToNumber'); + +var $isNaN = require('../helpers/isNaN'); +var $isFinite = require('../helpers/isFinite'); +var $sign = require('../helpers/sign'); +var $mod = require('../helpers/mod'); + +var $floor = $Math.floor; +var $abs = $Math.abs; + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.7 + +module.exports = function ToUint16(value) { + var number = ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = $sign(number) * $floor($abs(number)); + return $mod(posInt, 0x10000); +}; diff --git a/node_modules/es-abstract/5/ToUint32.js b/node_modules/es-abstract/5/ToUint32.js new file mode 100644 index 000000000..3660f6209 --- /dev/null +++ b/node_modules/es-abstract/5/ToUint32.js @@ -0,0 +1,9 @@ +'use strict'; + +var ToNumber = require('./ToNumber'); + +// http://www.ecma-international.org/ecma-262/5.1/#sec-9.6 + +module.exports = function ToUint32(x) { + return ToNumber(x) >>> 0; +}; diff --git a/node_modules/es-abstract/5/Type.js b/node_modules/es-abstract/5/Type.js new file mode 100644 index 000000000..9cc750cd5 --- /dev/null +++ b/node_modules/es-abstract/5/Type.js @@ -0,0 +1,24 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/5.1/#sec-8 + +module.exports = function Type(x) { + if (x === null) { + return 'Null'; + } + if (typeof x === 'undefined') { + return 'Undefined'; + } + if (typeof x === 'function' || typeof x === 'object') { + return 'Object'; + } + if (typeof x === 'number') { + return 'Number'; + } + if (typeof x === 'boolean') { + return 'Boolean'; + } + if (typeof x === 'string') { + return 'String'; + } +}; diff --git a/node_modules/es-abstract/5/WeekDay.js b/node_modules/es-abstract/5/WeekDay.js new file mode 100644 index 000000000..2973e0200 --- /dev/null +++ b/node_modules/es-abstract/5/WeekDay.js @@ -0,0 +1,11 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +var Day = require('./Day'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + +module.exports = function WeekDay(t) { + return mod(Day(t) + 4, 7); +}; diff --git a/node_modules/es-abstract/5/YearFromTime.js b/node_modules/es-abstract/5/YearFromTime.js new file mode 100644 index 000000000..ff5339f24 --- /dev/null +++ b/node_modules/es-abstract/5/YearFromTime.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Date = GetIntrinsic('%Date%'); + +var callBound = require('../helpers/callBound'); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + +module.exports = function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); +}; diff --git a/node_modules/es-abstract/5/modulo.js b/node_modules/es-abstract/5/modulo.js new file mode 100644 index 000000000..bc04c0628 --- /dev/null +++ b/node_modules/es-abstract/5/modulo.js @@ -0,0 +1,9 @@ +'use strict'; + +var mod = require('../helpers/mod'); + +// https://ecma-international.org/ecma-262/5.1/#sec-5.2 + +module.exports = function modulo(x, y) { + return mod(x, y); +}; diff --git a/node_modules/es-abstract/5/msFromTime.js b/node_modules/es-abstract/5/msFromTime.js new file mode 100644 index 000000000..c31eda085 --- /dev/null +++ b/node_modules/es-abstract/5/msFromTime.js @@ -0,0 +1,10 @@ +'use strict'; + +var mod = require('../helpers/mod'); +var msPerSecond = require('../helpers/timeConstants').msPerSecond; + +// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + +module.exports = function msFromTime(t) { + return mod(t, msPerSecond); +}; diff --git a/node_modules/es-abstract/CHANGELOG.md b/node_modules/es-abstract/CHANGELOG.md new file mode 100644 index 000000000..b5c414d89 --- /dev/null +++ b/node_modules/es-abstract/CHANGELOG.md @@ -0,0 +1,357 @@ +1.17.6 / 2020-06-13 +================= + * [Fix] `helpers/getSymbolDescription`: use the global Symbol registry when available (#92) + * [Fix] `ES2015+`: `IsConstructor`: when `Reflect.construct` is available, be spec-accurate (#93) + * [Fix] `ES2015+`: `Set`: Always return boolean value (#101) + * [Fix] `ES2015+`: `Set`: ensure exceptions are thrown in IE 9 when requested + * [Fix] Use `Reflect.apply(…)` if available (#99) + * [Fix] `helpers/floor`: module-cache `Math.floor` + * [Fix] `helpers/getSymbolDescription`: Prefer bound `description` getter when present + * [Fix] `2016`: Use `getIteratorMethod` in `IterableToArrayLike` (#94) + * [Fix] `helpers/OwnPropertyKeys`: Use `Reflect.ownKeys(…)` if available (#91) + * [Fix] `2018+`: Fix `CopyDataProperties` depending on `this` (#95) + * [meta] mark spackled files as autogenerated + * [meta] `Type`: fix spec URL + * [meta] `ES2015`: complete ops list + * [Deps] update `is‑callable`, `is‑regex` + * [Deps] switch from `string.prototype.trimleft`/`string.prototype.trimright` to `string.prototype.trimstart`/`string.prototype.trimend` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `in-publish`, `object-is`, `tape`; add `aud` + * [eslint] `helpers/isPropertyDescriptor`: fix indentation + * [Tests] `helpers/getSymbolDescription`: add test cases; some envs have `Symbol.for` but can not infer a name (#92) + * [Tests] try out CodeQL analysis + * [Tests] reformat expected missing ops + * [Tests] Run tests with `undefined` this (#96) + +1.17.5 / 2020-03-22 +================= + * [Fix] `CreateDataProperty`: update an existing property + * [Fix] run missing spackle from cd7504701879ddea0f5981e99cbcf93bfea9171d + * [Dev Deps] update `make-arrow-function`, `tape`, `@ljharb/eslint-config` + +1.17.4 / 2020-01-21 +================= + * [Fix] `2015+`: add code to handle IE 8’s problems + * [Tests] fix tests for IE 8 + +1.17.3 / 2020-01-19 +================= + * [Fix] `ObjectCreate` `2015+`: Fall back to `__proto__` and normal `new` in older browsers + * [Fix] `GetIntrinsic`: ensure the `allowMissing` property actually works on dotted intrinsics + +1.17.2 / 2020-01-14 +================= + * [Fix] `helpers/OwnPropertyKeys`: include non-enumerables too + +1.17.1 / 2020-01-14 +================= + * [Refactor] add `OwnPropertyKeys` helper, use it in `CopyDataProperties` + * [Refactor] `IteratorClose`: remove useless assignment + * [Dev Deps] update `eslint`, `tape`, `diff` + +1.17.0 / 2019-12-20 +================= + * [New] Split up each operation into its own file (prereleased) + * [Fix] `GetIntrinsic`: IE 8 has a broken `Object.getOwnPropertyDescriptor` + * [Fix] `object.assign` is a runtime dep (prereleased) + * [Refactor] `GetIntrinsic`: remove the internal property salts, since % already handles that + * [Refactor] `GetIntrinsic`: further simplification + * [Deps] update `is-callable`, `string.prototype.trimleft`, `string.prototype.trimright`, `is-regex` + * [Dev Deps] update `@ljharb/eslint-config`, `object-is`, `object.fromentries`, `tape` + * [Tests] add `.eslintignore` + * [meta] remove unused Makefile and associated utils + * [meta] only run spackle script in publish (#78) (prereleased) + +1.17.0-next.1 / 2019-12-11 +================= + * [Fix] `object.assign` is a runtime dep + * [meta] only run spackle script in publish (#78) + +1.17.0-next.0 / 2019-12-11 +================= + * [New] Split up each operation into its own file + +1.16.3 / 2019-12-04 +================= + * [Fix] `GetIntrinsic`: when given a path to a getter, return the actual getter + * [Dev Deps] update `eslint` + +1.16.2 / 2019-11-24 +================= + * [Fix] IE 6-7 lack JSON + * [Fix] IE 6-8 strings can’t use array slice, they need string slice + * [Dev Deps] update `eslint` + +1.16.1 / 2019-11-24 +================= + * [Fix] `GetIntrinsics`: turns out IE 8 throws when `Object.getOwnPropertyDescriptor(arguments);`, and does not throw on `callee` anyways + * [Deps] update `es-to-primitive`, `has-symbols`, `object-inspect` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest` + * [meta] re-include year files inside `operations` + * [meta] add `funding` field + * [actions] add Automatic Rebase github action + * [Tests] use shared travis-ci config + * [Tests] disable `check-coverage`, and let codecov do it + +1.16.0 / 2019-10-18 +================= + * [New] `ES2015+`: add `SetFunctionName` + * [New] `ES2015+`: add `GetPrototypeFromConstructor`, with caveats + * [New] `ES2015+`: add `CreateListFromArrayLike` + * [New] `ES2016+`: add `OrdinarySetPrototypeOf` + * [New] `ES2016+`: add `OrdinaryGetPrototypeOf` + * [New] add `getSymbolDescription` and `getInferredName` helpers + * [Fix] `GetIterator`: add fallback for pre-Symbol environments, tests + * [Dev Deps] update `object.fromentries` + * [Tests] add `node` `v12.2` + +1.15.0 / 2019-10-02 +================= + * [New] `ES2018`+: add `DateString`, `TimeString` + * [New] `ES2015`+: add `ToDateString` + * [New] `ES5`+: add `msFromTime`, `SecFromTime`, `MinFromTime`, `HourFromTime`, `TimeWithinDay`, `Day`, `DayFromYear`, `TimeFromYear`, `YearFromTime`, `WeekDay`, `DaysInYear`, `InLeapYear`, `DayWithinYear`, `MonthFromTime`, `DateFromTime`, `MakeDay`, `MakeDate`, `MakeTime`, `TimeClip`, `modulo` + * [New] add `regexTester` helper + * [New] add `callBound` helper + * [New] add ES2020’s intrinsic dot notation + * [New] add `isPrefixOf` helper + * [New] add `maxSafeInteger` helper + * [Deps] update `string.prototype.trimleft`, `string.prototype.trimright` + * [Dev Deps] update `eslint` + * [Tests] on `node` `v12.11` + * [meta] npmignore operations scripts; add "deltas" + +1.14.2 / 2019-09-08 +================= + * [Fix] `ES2016`: `IterableToArrayLike`: add proper fallback for strings, pre-Symbols + * [Tests] on `node` `v12.10` + +1.14.1 / 2019-09-03 +================= + * [meta] republish with some extra files removed + +1.14.0 / 2019-09-02 +================= + * [New] add ES2019 + * [New] `ES2017+`: add `IterableToList` + * [New] `ES2016`: add `IterableToArrayLike` + * [New] `ES2015+`: add `ArrayCreate`, `ArraySetLength`, `OrdinaryDefineOwnProperty`, `OrdinaryGetOwnProperty`, `OrdinaryHasProperty`, `CreateHTML`, `GetOwnPropertyKeys`, `InstanceofOperator`, `SymbolDescriptiveString`, `GetSubstitution`, `ValidateAndApplyPropertyDescriptor`, `IsPromise`, `OrdinaryHasInstance`, `TestIntegrityLevel`, `SetIntegrityLevel` + * [New] add `callBind` helper, and use it + * [New] add helpers: `isPropertyDescriptor`, `every` + * [New] ES5+: add `Abstract Relational Comparison` + * [New] ES5+: add `Abstract Equality Comparison`, `Strict Equality Comparison` + * [Fix] `ES2015+`: `GetIterator`: only require native Symbols when `method` is omitted + * [Fix] `ES2015`: `Call`: error message now properly displays Symbols using `object-inspect` + * [Fix] `ES2015+`: `ValidateAndApplyPropertyDescriptor`: use ES2017 logic to bypass spec bugs + * [Fix] `ES2015+`: `CreateDataProperty`, `DefinePropertyOrThrow`, `ValidateAndApplyPropertyDescriptor`: add fallbacks for ES3 + * [Fix] `ES2015+`: `FromPropertyDescriptor`: no longer requires a fully complete Property Descriptor + * [Fix] `ES5`: `IsPropertyDescriptor`: call into `IsDataDescriptor` and `IsAccessorDescriptor` + * [Refactor] use `has-symbols` for Symbol detection + * [Fix] `helpers/assertRecord`: remove `console.log` + * [Deps] update `object-keys` + * [readme] add security note + * [meta] change http URLs to https + * [meta] linter cleanup + * [meta] fix getOps script + * [meta] add FUNDING.yml + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `semver`, `replace`, `cheerio`, `tape` + * [Tests] up to `node` `v12.9`, `v11.15`, `v10.16`, `v8.16`, `v6.17` + * [Tests] temporarily allow node 0.6 to fail; segfaulting in travis + * [Tests] use the values helper more in es5 tests + * [Tests] fix linting to apply to all files + * [Tests] run `npx aud` only on prod deps + * [Tests] add v.descriptors helpers + * [Tests] use `npx aud` instead of `npm audit` with hoops + * [Tests] use `eclint` instead of `editorconfig-tools` + * [Tests] some intrinsic cleanup + * [Tests] migrate es5 tests to use values helper + * [Tests] add some missing ES2015 ops + +1.13.0 / 2019-01-02 +================= + * [New] add ES2018 + * [New] add ES2015/ES2016: EnumerableOwnNames; ES2017: EnumerableOwnProperties + * [New] `ES2015+`: add `thisBooleanValue`, `thisNumberValue`, `thisStringValue`, `thisTimeValue` + * [New] `ES2015+`: add `DefinePropertyOrThrow`, `DeletePropertyOrThrow`, `CreateMethodProperty` + * [New] add `assertRecord` helper + * [Deps] update `is-callable`, `has`, `object-keys`, `es-to-primitive` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `semver`, `safe-publish-latest`, `replace` + * [Tests] use `npm audit` instead of `nsp` + * [Tests] remove `jscs` + * [Tests] up to `node` `v11.6`, `v10.15`, `v8.15`, `v6.16` + * [Tests] move descriptor factories to `values` helper + * [Tests] add `getOps` to programmatically fetch abstract operation names + +1.12.0 / 2018-05-31 +================= + * [New] add `GetIntrinsic` entry point + * [New] `ES2015`+: add `ObjectCreate` + * [Robustness]: `ES2015+`: ensure `Math.{abs,floor}` and `Function.call` are cached + +1.11.0 / 2018-03-21 +================= + * [New] `ES2015+`: add iterator abstract ops + * [Dev Deps] update `eslint`, `nsp`, `object.assign`, `semver`, `tape` + * [Tests] up to `node` `v9.8`, `v8.10`, `v6.13` + +1.10.0 / 2017-11-24 +================= + * [New] ES2015+: `AdvanceStringIndex` + * [Dev Deps] update `eslint`, `nsp` + * [Tests] require node 0.6 to pass again + * [Tests] up to `node` `v9.2`, `v8.9`, `v6.12`; use `nvm install-latest-npm`; pin included builds to LTS + +1.9.0 / 2017-09-30 +================= + * [New] `es2015+`: add `ArraySpeciesCreate` + * [New] ES2015+: add `CreateDataProperty` and `CreateDataPropertyOrThrow` + * [Tests] consolidate duplicated tests + * [Tests] increase coverage + * [Dev Deps] update `nsp`, `eslint` + +1.8.2 / 2017-09-03 +================= + * [Fix] `es2015`+: `ToNumber`: provide the proper hint for Date objects (#27) + * [Dev Deps] update `eslint` + +1.8.1 / 2017-08-30 +================= + * [Fix] ES2015+: `ToPropertyKey`: should return a symbol for Symbols (#26) + * [Deps] update `function-bind` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config` + * [Docs] github broke markdown parsing + +1.8.0 / 2017-08-04 +================= + * [New] add ES2017 + * [New] move es6+ to es2015+; leave es6/es7 as aliases + * [New] ES5+: add `IsPropertyDescriptor`, `IsAccessorDescriptor`, `IsDataDescriptor`, `IsGenericDescriptor`, `FromPropertyDescriptor`, `ToPropertyDescriptor` + * [New] ES2015+: add `CompletePropertyDescriptor`, `Set`, `HasOwnProperty`, `HasProperty`, `IsConcatSpreadable`, `Invoke`, `CreateIterResultObject`, `RegExpExec` + * [Fix] es7/es2016: do not mutate ES6 + * [Fix] assign helper only supports one source + * [Deps] update `is-regex` + * [Dev Deps] update `nsp`, `eslint`, `@ljharb/eslint-config` + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `nsp`, `semver`, `tape` + * [Tests] add tests for missing and excess operations + * [Tests] add codecov for coverage + * [Tests] up to `node` `v8.2`, `v7.10`, `v6.11`, `v4.8`; newer npm breaks on older node + * [Tests] use same lists of value types across tests; ensure tests are the same when ops are the same + * [Tests] ES2015: add ToNumber symbol tests + * [Tests] switch to `nyc` for code coverage + * [Tests] make IsRegExp tests consistent across editions + +1.7.0 / 2017-01-22 +================= + * [New] ES6: Add `GetMethod` (#16) + * [New] ES6: Add `GetV` (#16) + * [New] ES6: Add `Get` (#17) + * [Tests] up to `node` `v7.4`, `v6.9`, `v4.6`; improve test matrix + * [Dev Deps] update `tape`, `nsp`, `eslint`, `@ljharb/eslint-config`, `safe-publish-latest` + +1.6.1 / 2016-08-21 +================= + * [Fix] ES6: IsConstructor should return true for `class` constructors. + +1.6.0 / 2016-08-20 +================= + * [New] ES5 / ES6: add `Type` + * [New] ES6: `SpeciesConstructor` + * [Dev Deps] update `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver`; add `safe-publish-latest` + * [Tests] up to `node` `v6.4`, `v5.12`, `v4.5` + +1.5.1 / 2016-05-30 +================= + * [Fix] `ES.IsRegExp`: actually look up `Symbol.match` on the argument + * [Refactor] create `isNaN` helper + * [Deps] update `is-callable`, `function-bind` + * [Deps] update `es-to-primitive`, fix ES5 tests + * [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config`, `tape`, `nsp` + * [Tests] up to `node` `v6.2`, `v5.11`, `v4.4` + * [Tests] use pretest/posttest for linting/security + +1.5.0 / 2015-12-27 +================= + * [New] adds `Symbol.toPrimitive` support via `es-to-primitive` + * [Deps] update `is-callable`, `es-to-primitive` + * [Dev Deps] update `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver`, `tape` + * [Tests] up to `node` `v5.3` + +1.4.3 / 2015-11-04 +================= + * [Fix] `ES6.ToNumber`: should give `NaN` for explicitly signed hex strings (#4) + * [Refactor] `ES6.ToNumber`: No need to double-trim + * [Refactor] group tests better + * [Tests] should still pass on `node` `v0.8` + +1.4.2 / 2015-11-02 +================= + * [Fix] ensure `ES.ToNumber` trims whitespace, and does not trim non-whitespace (#3) + +1.4.1 / 2015-10-31 +================= + * [Fix] ensure only 0-1 are valid binary and 0-7 are valid octal digits (#2) + * [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config` + * [Tests] on `node` `v5.0` + * [Tests] fix npm upgrades for older node versions + * package.json: use object form of "authors", add "contributors" + +1.4.0 / 2015-09-26 +================= + * [Deps] update `is-callable` + * [Dev Deps] update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` + * [Tests] on `node` `v4.2` + * [New] Add `SameValueNonNumber` to ES7 + +1.3.2 / 2015-09-26 +================= + * [Fix] Fix `ES6.IsRegExp` to properly handle `Symbol.match`, per spec. + * [Tests] up to `io.js` `v3.3`, `node` `v4.1` + * [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver` + +1.3.1 / 2015-08-15 +================= + * [Fix] Ensure that objects that `toString` to a binary or octal literal also convert properly + +1.3.0 / 2015-08-15 +================= + * [New] ES6’s ToNumber now supports binary and octal literals. + * [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config`, `tape` + * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG + * [Tests] up to `io.js` `v3.0` + +1.2.2 / 2015-07-28 +================= + * [Fix] Both `ES5.CheckObjectCoercible` and `ES6.RequireObjectCoercible` return the value if they don't throw. + * [Tests] Test on latest `io.js` versions. + * [Dev Deps] Update `eslint`, `jscs`, `tape`, `semver`, `covert`, `nsp` + +1.2.1 / 2015-03-20 +================= + * Fix `isFinite` helper. + +1.2.0 / 2015-03-19 +================= + * Use `es-to-primitive` for ToPrimitive methods. + * Test on latest `io.js` versions; allow failures on all but 2 latest `node`/`io.js` versions. + +1.1.2 / 2015-03-20 +================= + * Fix isFinite helper. + +1.1.1 / 2015-03-19 +================= + * Fix isPrimitive check for functions + * Update `eslint`, `editorconfig-tools`, `semver`, `nsp` + +1.1.0 / 2015-02-17 +================= + * Add ES7 export (non-default). + * All grade A-supported `node`/`iojs` versions now ship with an `npm` that understands `^`. + * Test on `iojs-v1.2`. + +1.0.1 / 2015-01-30 +================= + * Use `is-callable` instead of an internal function. + * Update `tape`, `jscs`, `nsp`, `eslint` + +1.0.0 / 2015-01-10 +================= + * v1.0.0 diff --git a/node_modules/es-abstract/GetIntrinsic.js b/node_modules/es-abstract/GetIntrinsic.js new file mode 100644 index 000000000..6e0af004a --- /dev/null +++ b/node_modules/es-abstract/GetIntrinsic.js @@ -0,0 +1,218 @@ +'use strict'; + +/* globals + Atomics, + SharedArrayBuffer, +*/ + +var undefined; + +var $TypeError = TypeError; + +var $gOPD = Object.getOwnPropertyDescriptor; +if ($gOPD) { + try { + $gOPD({}, ''); + } catch (e) { + $gOPD = null; // this is IE 8, which has a broken gOPD + } +} + +var throwTypeError = function () { throw new $TypeError(); }; +var ThrowTypeError = $gOPD + ? (function () { + try { + // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties + arguments.callee; // IE 8 does not throw here + return throwTypeError; + } catch (calleeThrows) { + try { + // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') + return $gOPD(arguments, 'callee').get; + } catch (gOPDthrows) { + return throwTypeError; + } + } + }()) + : throwTypeError; + +var hasSymbols = require('has-symbols')(); + +var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto + +var generator; // = function * () {}; +var generatorFunction = generator ? getProto(generator) : undefined; +var asyncFn; // async function() {}; +var asyncFunction = asyncFn ? asyncFn.constructor : undefined; +var asyncGen; // async function * () {}; +var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined; +var asyncGenIterator = asyncGen ? asyncGen() : undefined; + +var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); + +var INTRINSICS = { + '%Array%': Array, + '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, + '%ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype, + '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, + '%ArrayPrototype%': Array.prototype, + '%ArrayProto_entries%': Array.prototype.entries, + '%ArrayProto_forEach%': Array.prototype.forEach, + '%ArrayProto_keys%': Array.prototype.keys, + '%ArrayProto_values%': Array.prototype.values, + '%AsyncFromSyncIteratorPrototype%': undefined, + '%AsyncFunction%': asyncFunction, + '%AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined, + '%AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined, + '%AsyncGeneratorFunction%': asyncGenFunction, + '%AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined, + '%AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined, + '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, + '%Boolean%': Boolean, + '%BooleanPrototype%': Boolean.prototype, + '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, + '%DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype, + '%Date%': Date, + '%DatePrototype%': Date.prototype, + '%decodeURI%': decodeURI, + '%decodeURIComponent%': decodeURIComponent, + '%encodeURI%': encodeURI, + '%encodeURIComponent%': encodeURIComponent, + '%Error%': Error, + '%ErrorPrototype%': Error.prototype, + '%eval%': eval, // eslint-disable-line no-eval + '%EvalError%': EvalError, + '%EvalErrorPrototype%': EvalError.prototype, + '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, + '%Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype, + '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, + '%Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype, + '%Function%': Function, + '%FunctionPrototype%': Function.prototype, + '%Generator%': generator ? getProto(generator()) : undefined, + '%GeneratorFunction%': generatorFunction, + '%GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined, + '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, + '%Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype, + '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, + '%Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype, + '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, + '%Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype, + '%isFinite%': isFinite, + '%isNaN%': isNaN, + '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, + '%JSON%': typeof JSON === 'object' ? JSON : undefined, + '%JSONParse%': typeof JSON === 'object' ? JSON.parse : undefined, + '%Map%': typeof Map === 'undefined' ? undefined : Map, + '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), + '%MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype, + '%Math%': Math, + '%Number%': Number, + '%NumberPrototype%': Number.prototype, + '%Object%': Object, + '%ObjectPrototype%': Object.prototype, + '%ObjProto_toString%': Object.prototype.toString, + '%ObjProto_valueOf%': Object.prototype.valueOf, + '%parseFloat%': parseFloat, + '%parseInt%': parseInt, + '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, + '%PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype, + '%PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then, + '%Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all, + '%Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject, + '%Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve, + '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, + '%RangeError%': RangeError, + '%RangeErrorPrototype%': RangeError.prototype, + '%ReferenceError%': ReferenceError, + '%ReferenceErrorPrototype%': ReferenceError.prototype, + '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, + '%RegExp%': RegExp, + '%RegExpPrototype%': RegExp.prototype, + '%Set%': typeof Set === 'undefined' ? undefined : Set, + '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), + '%SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype, + '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, + '%SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype, + '%String%': String, + '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, + '%StringPrototype%': String.prototype, + '%Symbol%': hasSymbols ? Symbol : undefined, + '%SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined, + '%SyntaxError%': SyntaxError, + '%SyntaxErrorPrototype%': SyntaxError.prototype, + '%ThrowTypeError%': ThrowTypeError, + '%TypedArray%': TypedArray, + '%TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined, + '%TypeError%': $TypeError, + '%TypeErrorPrototype%': $TypeError.prototype, + '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, + '%Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype, + '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, + '%Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype, + '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, + '%Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype, + '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, + '%Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype, + '%URIError%': URIError, + '%URIErrorPrototype%': URIError.prototype, + '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, + '%WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype, + '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, + '%WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype +}; + +var bind = require('function-bind'); +var $replace = bind.call(Function.call, String.prototype.replace); + +/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ +var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; +var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ +var stringToPath = function stringToPath(string) { + var result = []; + $replace(string, rePropName, function (match, number, quote, subString) { + result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : (number || match); + }); + return result; +}; +/* end adaptation */ + +var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { + if (!(name in INTRINSICS)) { + throw new SyntaxError('intrinsic ' + name + ' does not exist!'); + } + + // istanbul ignore if // hopefully this is impossible to test :-) + if (typeof INTRINSICS[name] === 'undefined' && !allowMissing) { + throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); + } + + return INTRINSICS[name]; +}; + +module.exports = function GetIntrinsic(name, allowMissing) { + if (typeof name !== 'string' || name.length === 0) { + throw new TypeError('intrinsic name must be a non-empty string'); + } + if (arguments.length > 1 && typeof allowMissing !== 'boolean') { + throw new TypeError('"allowMissing" argument must be a boolean'); + } + + var parts = stringToPath(name); + + var value = getBaseIntrinsic('%' + (parts.length > 0 ? parts[0] : '') + '%', allowMissing); + for (var i = 1; i < parts.length; i += 1) { + if (value != null) { + if ($gOPD && (i + 1) >= parts.length) { + var desc = $gOPD(value, parts[i]); + if (!allowMissing && !(parts[i] in value)) { + throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); + } + value = desc ? (desc.get || desc.value) : value[parts[i]]; + } else { + value = value[parts[i]]; + } + } + } + return value; +}; diff --git a/node_modules/es-abstract/LICENSE b/node_modules/es-abstract/LICENSE new file mode 100644 index 000000000..8c271c14b --- /dev/null +++ b/node_modules/es-abstract/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (C) 2015 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/es-abstract/README.md b/node_modules/es-abstract/README.md new file mode 100644 index 000000000..20342d118 --- /dev/null +++ b/node_modules/es-abstract/README.md @@ -0,0 +1,48 @@ +# es-abstract [![Version Badge][npm-version-svg]][package-url] + +[![Build Status][travis-svg]][travis-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +[![browser support][testling-svg]][testling-url] + +ECMAScript spec abstract operations. +When different versions of the spec conflict, the default export will be the latest version of the abstract operation. +All abstract operations will also be available under an `es5`/`es2015`/`es2016`/`es2017`/`es2018`/`es2019` entry point, and exported property, if you require a specific version. + +## Example + +```js +var ES = require('es-abstract'); +var assert = require('assert'); + +assert(ES.isCallable(function () {})); +assert(!ES.isCallable(/a/g)); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +## Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. + +[package-url]: https://npmjs.org/package/es-abstract +[npm-version-svg]: http://versionbadg.es/ljharb/es-abstract.svg +[travis-svg]: https://travis-ci.org/ljharb/es-abstract.svg +[travis-url]: https://travis-ci.org/ljharb/es-abstract +[deps-svg]: https://david-dm.org/ljharb/es-abstract.svg +[deps-url]: https://david-dm.org/ljharb/es-abstract +[dev-deps-svg]: https://david-dm.org/ljharb/es-abstract/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/es-abstract#info=devDependencies +[testling-svg]: https://ci.testling.com/ljharb/es-abstract.png +[testling-url]: https://ci.testling.com/ljharb/es-abstract +[npm-badge-png]: https://nodei.co/npm/es-abstract.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/es-abstract.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/es-abstract.svg +[downloads-url]: https://npm-stat.com/charts.html?package=es-abstract diff --git a/node_modules/es-abstract/es2015.js b/node_modules/es-abstract/es2015.js new file mode 100644 index 000000000..dc02ca4c8 --- /dev/null +++ b/node_modules/es-abstract/es2015.js @@ -0,0 +1,115 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-operations +var ES6 = { + 'Abstract Equality Comparison': require('./2015/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2015/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2015/StrictEqualityComparison'), + AdvanceStringIndex: require('./2015/AdvanceStringIndex'), + ArrayCreate: require('./2015/ArrayCreate'), + ArraySetLength: require('./2015/ArraySetLength'), + ArraySpeciesCreate: require('./2015/ArraySpeciesCreate'), + Call: require('./2015/Call'), + CanonicalNumericIndexString: require('./2015/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2015/CompletePropertyDescriptor'), + CreateDataProperty: require('./2015/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2015/CreateDataPropertyOrThrow'), + CreateHTML: require('./2015/CreateHTML'), + CreateIterResultObject: require('./2015/CreateIterResultObject'), + CreateListFromArrayLike: require('./2015/CreateListFromArrayLike'), + CreateMethodProperty: require('./2015/CreateMethodProperty'), + DateFromTime: require('./2015/DateFromTime'), + Day: require('./2015/Day'), + DayFromYear: require('./2015/DayFromYear'), + DaysInYear: require('./2015/DaysInYear'), + DayWithinYear: require('./2015/DayWithinYear'), + DefinePropertyOrThrow: require('./2015/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2015/DeletePropertyOrThrow'), + EnumerableOwnNames: require('./2015/EnumerableOwnNames'), + FromPropertyDescriptor: require('./2015/FromPropertyDescriptor'), + Get: require('./2015/Get'), + GetIterator: require('./2015/GetIterator'), + GetMethod: require('./2015/GetMethod'), + GetOwnPropertyKeys: require('./2015/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2015/GetPrototypeFromConstructor'), + GetSubstitution: require('./2015/GetSubstitution'), + GetV: require('./2015/GetV'), + HasOwnProperty: require('./2015/HasOwnProperty'), + HasProperty: require('./2015/HasProperty'), + HourFromTime: require('./2015/HourFromTime'), + InLeapYear: require('./2015/InLeapYear'), + InstanceofOperator: require('./2015/InstanceofOperator'), + Invoke: require('./2015/Invoke'), + IsAccessorDescriptor: require('./2015/IsAccessorDescriptor'), + IsArray: require('./2015/IsArray'), + IsCallable: require('./2015/IsCallable'), + IsConcatSpreadable: require('./2015/IsConcatSpreadable'), + IsConstructor: require('./2015/IsConstructor'), + IsDataDescriptor: require('./2015/IsDataDescriptor'), + IsExtensible: require('./2015/IsExtensible'), + IsGenericDescriptor: require('./2015/IsGenericDescriptor'), + IsInteger: require('./2015/IsInteger'), + IsPromise: require('./2015/IsPromise'), + IsPropertyDescriptor: require('./2015/IsPropertyDescriptor'), + IsPropertyKey: require('./2015/IsPropertyKey'), + IsRegExp: require('./2015/IsRegExp'), + IteratorClose: require('./2015/IteratorClose'), + IteratorComplete: require('./2015/IteratorComplete'), + IteratorNext: require('./2015/IteratorNext'), + IteratorStep: require('./2015/IteratorStep'), + IteratorValue: require('./2015/IteratorValue'), + MakeDate: require('./2015/MakeDate'), + MakeDay: require('./2015/MakeDay'), + MakeTime: require('./2015/MakeTime'), + MinFromTime: require('./2015/MinFromTime'), + modulo: require('./2015/modulo'), + MonthFromTime: require('./2015/MonthFromTime'), + msFromTime: require('./2015/msFromTime'), + ObjectCreate: require('./2015/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2015/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2015/OrdinaryGetOwnProperty'), + OrdinaryHasInstance: require('./2015/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2015/OrdinaryHasProperty'), + RegExpExec: require('./2015/RegExpExec'), + RequireObjectCoercible: require('./2015/RequireObjectCoercible'), + SameValue: require('./2015/SameValue'), + SameValueZero: require('./2015/SameValueZero'), + SecFromTime: require('./2015/SecFromTime'), + Set: require('./2015/Set'), + SetFunctionName: require('./2015/SetFunctionName'), + SetIntegrityLevel: require('./2015/SetIntegrityLevel'), + SpeciesConstructor: require('./2015/SpeciesConstructor'), + SymbolDescriptiveString: require('./2015/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2015/TestIntegrityLevel'), + thisBooleanValue: require('./2015/thisBooleanValue'), + thisNumberValue: require('./2015/thisNumberValue'), + thisStringValue: require('./2015/thisStringValue'), + thisTimeValue: require('./2015/thisTimeValue'), + TimeClip: require('./2015/TimeClip'), + TimeFromYear: require('./2015/TimeFromYear'), + TimeWithinDay: require('./2015/TimeWithinDay'), + ToBoolean: require('./2015/ToBoolean'), + ToDateString: require('./2015/ToDateString'), + ToInt16: require('./2015/ToInt16'), + ToInt32: require('./2015/ToInt32'), + ToInt8: require('./2015/ToInt8'), + ToInteger: require('./2015/ToInteger'), + ToLength: require('./2015/ToLength'), + ToNumber: require('./2015/ToNumber'), + ToObject: require('./2015/ToObject'), + ToPrimitive: require('./2015/ToPrimitive'), + ToPropertyDescriptor: require('./2015/ToPropertyDescriptor'), + ToPropertyKey: require('./2015/ToPropertyKey'), + ToString: require('./2015/ToString'), + ToUint16: require('./2015/ToUint16'), + ToUint32: require('./2015/ToUint32'), + ToUint8: require('./2015/ToUint8'), + ToUint8Clamp: require('./2015/ToUint8Clamp'), + Type: require('./2015/Type'), + ValidateAndApplyPropertyDescriptor: require('./2015/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2015/WeekDay'), + YearFromTime: require('./2015/YearFromTime') +}; + +module.exports = ES6; diff --git a/node_modules/es-abstract/es2016.js b/node_modules/es-abstract/es2016.js new file mode 100644 index 000000000..9e72e82c3 --- /dev/null +++ b/node_modules/es-abstract/es2016.js @@ -0,0 +1,119 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/7.0/#sec-abstract-operations +var ES2016 = { + 'Abstract Equality Comparison': require('./2016/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2016/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2016/StrictEqualityComparison'), + AdvanceStringIndex: require('./2016/AdvanceStringIndex'), + ArrayCreate: require('./2016/ArrayCreate'), + ArraySetLength: require('./2016/ArraySetLength'), + ArraySpeciesCreate: require('./2016/ArraySpeciesCreate'), + Call: require('./2016/Call'), + CanonicalNumericIndexString: require('./2016/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2016/CompletePropertyDescriptor'), + CreateDataProperty: require('./2016/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2016/CreateDataPropertyOrThrow'), + CreateHTML: require('./2016/CreateHTML'), + CreateIterResultObject: require('./2016/CreateIterResultObject'), + CreateListFromArrayLike: require('./2016/CreateListFromArrayLike'), + CreateMethodProperty: require('./2016/CreateMethodProperty'), + DateFromTime: require('./2016/DateFromTime'), + Day: require('./2016/Day'), + DayFromYear: require('./2016/DayFromYear'), + DaysInYear: require('./2016/DaysInYear'), + DayWithinYear: require('./2016/DayWithinYear'), + DefinePropertyOrThrow: require('./2016/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2016/DeletePropertyOrThrow'), + EnumerableOwnNames: require('./2016/EnumerableOwnNames'), + FromPropertyDescriptor: require('./2016/FromPropertyDescriptor'), + Get: require('./2016/Get'), + GetIterator: require('./2016/GetIterator'), + GetMethod: require('./2016/GetMethod'), + GetOwnPropertyKeys: require('./2016/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2016/GetPrototypeFromConstructor'), + GetSubstitution: require('./2016/GetSubstitution'), + GetV: require('./2016/GetV'), + HasOwnProperty: require('./2016/HasOwnProperty'), + HasProperty: require('./2016/HasProperty'), + HourFromTime: require('./2016/HourFromTime'), + InLeapYear: require('./2016/InLeapYear'), + InstanceofOperator: require('./2016/InstanceofOperator'), + Invoke: require('./2016/Invoke'), + IsAccessorDescriptor: require('./2016/IsAccessorDescriptor'), + IsArray: require('./2016/IsArray'), + IsCallable: require('./2016/IsCallable'), + IsConcatSpreadable: require('./2016/IsConcatSpreadable'), + IsConstructor: require('./2016/IsConstructor'), + IsDataDescriptor: require('./2016/IsDataDescriptor'), + IsExtensible: require('./2016/IsExtensible'), + IsGenericDescriptor: require('./2016/IsGenericDescriptor'), + IsInteger: require('./2016/IsInteger'), + IsPromise: require('./2016/IsPromise'), + IsPropertyDescriptor: require('./2016/IsPropertyDescriptor'), + IsPropertyKey: require('./2016/IsPropertyKey'), + IsRegExp: require('./2016/IsRegExp'), + IterableToArrayLike: require('./2016/IterableToArrayLike'), + IteratorClose: require('./2016/IteratorClose'), + IteratorComplete: require('./2016/IteratorComplete'), + IteratorNext: require('./2016/IteratorNext'), + IteratorStep: require('./2016/IteratorStep'), + IteratorValue: require('./2016/IteratorValue'), + MakeDate: require('./2016/MakeDate'), + MakeDay: require('./2016/MakeDay'), + MakeTime: require('./2016/MakeTime'), + MinFromTime: require('./2016/MinFromTime'), + modulo: require('./2016/modulo'), + MonthFromTime: require('./2016/MonthFromTime'), + msFromTime: require('./2016/msFromTime'), + ObjectCreate: require('./2016/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2016/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2016/OrdinaryGetOwnProperty'), + OrdinaryGetPrototypeOf: require('./2016/OrdinaryGetPrototypeOf'), + OrdinarySetPrototypeOf: require('./2016/OrdinarySetPrototypeOf'), + OrdinaryHasInstance: require('./2016/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2016/OrdinaryHasProperty'), + RegExpExec: require('./2016/RegExpExec'), + RequireObjectCoercible: require('./2016/RequireObjectCoercible'), + SameValue: require('./2016/SameValue'), + SameValueNonNumber: require('./2016/SameValueNonNumber'), + SameValueZero: require('./2016/SameValueZero'), + SecFromTime: require('./2016/SecFromTime'), + Set: require('./2016/Set'), + SetFunctionName: require('./2016/SetFunctionName'), + SetIntegrityLevel: require('./2016/SetIntegrityLevel'), + SpeciesConstructor: require('./2016/SpeciesConstructor'), + SymbolDescriptiveString: require('./2016/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2016/TestIntegrityLevel'), + thisBooleanValue: require('./2016/thisBooleanValue'), + thisNumberValue: require('./2016/thisNumberValue'), + thisStringValue: require('./2016/thisStringValue'), + thisTimeValue: require('./2016/thisTimeValue'), + TimeClip: require('./2016/TimeClip'), + TimeFromYear: require('./2016/TimeFromYear'), + TimeWithinDay: require('./2016/TimeWithinDay'), + ToBoolean: require('./2016/ToBoolean'), + ToDateString: require('./2016/ToDateString'), + ToInt16: require('./2016/ToInt16'), + ToInt32: require('./2016/ToInt32'), + ToInt8: require('./2016/ToInt8'), + ToInteger: require('./2016/ToInteger'), + ToLength: require('./2016/ToLength'), + ToNumber: require('./2016/ToNumber'), + ToObject: require('./2016/ToObject'), + ToPrimitive: require('./2016/ToPrimitive'), + ToPropertyDescriptor: require('./2016/ToPropertyDescriptor'), + ToPropertyKey: require('./2016/ToPropertyKey'), + ToString: require('./2016/ToString'), + ToUint16: require('./2016/ToUint16'), + ToUint32: require('./2016/ToUint32'), + ToUint8: require('./2016/ToUint8'), + ToUint8Clamp: require('./2016/ToUint8Clamp'), + Type: require('./2016/Type'), + ValidateAndApplyPropertyDescriptor: require('./2016/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2016/WeekDay'), + YearFromTime: require('./2016/YearFromTime') +}; + +module.exports = ES2016; diff --git a/node_modules/es-abstract/es2017.js b/node_modules/es-abstract/es2017.js new file mode 100644 index 000000000..5f317b7a6 --- /dev/null +++ b/node_modules/es-abstract/es2017.js @@ -0,0 +1,120 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/8.0/#sec-abstract-operations +var ES2017 = { + 'Abstract Equality Comparison': require('./2017/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2017/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2017/StrictEqualityComparison'), + AdvanceStringIndex: require('./2017/AdvanceStringIndex'), + ArrayCreate: require('./2017/ArrayCreate'), + ArraySetLength: require('./2017/ArraySetLength'), + ArraySpeciesCreate: require('./2017/ArraySpeciesCreate'), + Call: require('./2017/Call'), + CanonicalNumericIndexString: require('./2017/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2017/CompletePropertyDescriptor'), + CreateDataProperty: require('./2017/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2017/CreateDataPropertyOrThrow'), + CreateHTML: require('./2017/CreateHTML'), + CreateIterResultObject: require('./2017/CreateIterResultObject'), + CreateListFromArrayLike: require('./2017/CreateListFromArrayLike'), + CreateMethodProperty: require('./2017/CreateMethodProperty'), + DateFromTime: require('./2017/DateFromTime'), + Day: require('./2017/Day'), + DayFromYear: require('./2017/DayFromYear'), + DaysInYear: require('./2017/DaysInYear'), + DayWithinYear: require('./2017/DayWithinYear'), + DefinePropertyOrThrow: require('./2017/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2017/DeletePropertyOrThrow'), + EnumerableOwnProperties: require('./2017/EnumerableOwnProperties'), + FromPropertyDescriptor: require('./2017/FromPropertyDescriptor'), + Get: require('./2017/Get'), + GetIterator: require('./2017/GetIterator'), + GetMethod: require('./2017/GetMethod'), + GetOwnPropertyKeys: require('./2017/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2017/GetPrototypeFromConstructor'), + GetSubstitution: require('./2017/GetSubstitution'), + GetV: require('./2017/GetV'), + HasOwnProperty: require('./2017/HasOwnProperty'), + HasProperty: require('./2017/HasProperty'), + HourFromTime: require('./2017/HourFromTime'), + InLeapYear: require('./2017/InLeapYear'), + InstanceofOperator: require('./2017/InstanceofOperator'), + Invoke: require('./2017/Invoke'), + IsAccessorDescriptor: require('./2017/IsAccessorDescriptor'), + IsArray: require('./2017/IsArray'), + IsCallable: require('./2017/IsCallable'), + IsConcatSpreadable: require('./2017/IsConcatSpreadable'), + IsConstructor: require('./2017/IsConstructor'), + IsDataDescriptor: require('./2017/IsDataDescriptor'), + IsExtensible: require('./2017/IsExtensible'), + IsGenericDescriptor: require('./2017/IsGenericDescriptor'), + IsInteger: require('./2017/IsInteger'), + IsPromise: require('./2017/IsPromise'), + IsPropertyDescriptor: require('./2017/IsPropertyDescriptor'), + IsPropertyKey: require('./2017/IsPropertyKey'), + IsRegExp: require('./2017/IsRegExp'), + IterableToList: require('./2017/IterableToList'), + IteratorClose: require('./2017/IteratorClose'), + IteratorComplete: require('./2017/IteratorComplete'), + IteratorNext: require('./2017/IteratorNext'), + IteratorStep: require('./2017/IteratorStep'), + IteratorValue: require('./2017/IteratorValue'), + MakeDate: require('./2017/MakeDate'), + MakeDay: require('./2017/MakeDay'), + MakeTime: require('./2017/MakeTime'), + MinFromTime: require('./2017/MinFromTime'), + modulo: require('./2017/modulo'), + MonthFromTime: require('./2017/MonthFromTime'), + msFromTime: require('./2017/msFromTime'), + ObjectCreate: require('./2017/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2017/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2017/OrdinaryGetOwnProperty'), + OrdinarySetPrototypeOf: require('./2017/OrdinarySetPrototypeOf'), + OrdinaryGetPrototypeOf: require('./2017/OrdinaryGetPrototypeOf'), + OrdinaryHasInstance: require('./2017/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2017/OrdinaryHasProperty'), + RegExpExec: require('./2017/RegExpExec'), + RequireObjectCoercible: require('./2017/RequireObjectCoercible'), + SameValue: require('./2017/SameValue'), + SameValueNonNumber: require('./2017/SameValueNonNumber'), + SameValueZero: require('./2017/SameValueZero'), + SecFromTime: require('./2017/SecFromTime'), + Set: require('./2017/Set'), + SetFunctionName: require('./2017/SetFunctionName'), + SetIntegrityLevel: require('./2017/SetIntegrityLevel'), + SpeciesConstructor: require('./2017/SpeciesConstructor'), + SymbolDescriptiveString: require('./2017/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2017/TestIntegrityLevel'), + thisBooleanValue: require('./2017/thisBooleanValue'), + thisNumberValue: require('./2017/thisNumberValue'), + thisStringValue: require('./2017/thisStringValue'), + thisTimeValue: require('./2017/thisTimeValue'), + TimeClip: require('./2017/TimeClip'), + TimeFromYear: require('./2017/TimeFromYear'), + TimeWithinDay: require('./2017/TimeWithinDay'), + ToBoolean: require('./2017/ToBoolean'), + ToDateString: require('./2017/ToDateString'), + ToIndex: require('./2017/ToIndex'), + ToInt16: require('./2017/ToInt16'), + ToInt32: require('./2017/ToInt32'), + ToInt8: require('./2017/ToInt8'), + ToInteger: require('./2017/ToInteger'), + ToLength: require('./2017/ToLength'), + ToNumber: require('./2017/ToNumber'), + ToObject: require('./2017/ToObject'), + ToPrimitive: require('./2017/ToPrimitive'), + ToPropertyDescriptor: require('./2017/ToPropertyDescriptor'), + ToPropertyKey: require('./2017/ToPropertyKey'), + ToString: require('./2017/ToString'), + ToUint16: require('./2017/ToUint16'), + ToUint32: require('./2017/ToUint32'), + ToUint8: require('./2017/ToUint8'), + ToUint8Clamp: require('./2017/ToUint8Clamp'), + Type: require('./2017/Type'), + ValidateAndApplyPropertyDescriptor: require('./2017/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2017/WeekDay'), + YearFromTime: require('./2017/YearFromTime') +}; + +module.exports = ES2017; diff --git a/node_modules/es-abstract/es2018.js b/node_modules/es-abstract/es2018.js new file mode 100644 index 000000000..e68910b71 --- /dev/null +++ b/node_modules/es-abstract/es2018.js @@ -0,0 +1,126 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/9.0/#sec-abstract-operations +var ES2018 = { + 'Abstract Equality Comparison': require('./2018/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2018/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2018/StrictEqualityComparison'), + AdvanceStringIndex: require('./2018/AdvanceStringIndex'), + ArrayCreate: require('./2018/ArrayCreate'), + ArraySetLength: require('./2018/ArraySetLength'), + ArraySpeciesCreate: require('./2018/ArraySpeciesCreate'), + Call: require('./2018/Call'), + CanonicalNumericIndexString: require('./2018/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2018/CompletePropertyDescriptor'), + CopyDataProperties: require('./2018/CopyDataProperties'), + CreateDataProperty: require('./2018/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2018/CreateDataPropertyOrThrow'), + CreateHTML: require('./2018/CreateHTML'), + CreateIterResultObject: require('./2018/CreateIterResultObject'), + CreateListFromArrayLike: require('./2018/CreateListFromArrayLike'), + CreateMethodProperty: require('./2018/CreateMethodProperty'), + DateFromTime: require('./2018/DateFromTime'), + DateString: require('./2018/DateString'), + Day: require('./2018/Day'), + DayFromYear: require('./2018/DayFromYear'), + DaysInYear: require('./2018/DaysInYear'), + DayWithinYear: require('./2018/DayWithinYear'), + DefinePropertyOrThrow: require('./2018/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2018/DeletePropertyOrThrow'), + EnumerableOwnPropertyNames: require('./2018/EnumerableOwnPropertyNames'), + FromPropertyDescriptor: require('./2018/FromPropertyDescriptor'), + Get: require('./2018/Get'), + GetIterator: require('./2018/GetIterator'), + GetMethod: require('./2018/GetMethod'), + GetOwnPropertyKeys: require('./2018/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2018/GetPrototypeFromConstructor'), + GetSubstitution: require('./2018/GetSubstitution'), + GetV: require('./2018/GetV'), + HasOwnProperty: require('./2018/HasOwnProperty'), + HasProperty: require('./2018/HasProperty'), + HourFromTime: require('./2018/HourFromTime'), + InLeapYear: require('./2018/InLeapYear'), + InstanceofOperator: require('./2018/InstanceofOperator'), + Invoke: require('./2018/Invoke'), + IsAccessorDescriptor: require('./2018/IsAccessorDescriptor'), + IsArray: require('./2018/IsArray'), + IsCallable: require('./2018/IsCallable'), + IsConcatSpreadable: require('./2018/IsConcatSpreadable'), + IsConstructor: require('./2018/IsConstructor'), + IsDataDescriptor: require('./2018/IsDataDescriptor'), + IsExtensible: require('./2018/IsExtensible'), + IsGenericDescriptor: require('./2018/IsGenericDescriptor'), + IsInteger: require('./2018/IsInteger'), + IsPromise: require('./2018/IsPromise'), + IsPropertyKey: require('./2018/IsPropertyKey'), + IsRegExp: require('./2018/IsRegExp'), + IsStringPrefix: require('./2018/IsStringPrefix'), + IterableToList: require('./2018/IterableToList'), + IteratorClose: require('./2018/IteratorClose'), + IteratorComplete: require('./2018/IteratorComplete'), + IteratorNext: require('./2018/IteratorNext'), + IteratorStep: require('./2018/IteratorStep'), + IteratorValue: require('./2018/IteratorValue'), + MakeDate: require('./2018/MakeDate'), + MakeDay: require('./2018/MakeDay'), + MakeTime: require('./2018/MakeTime'), + MinFromTime: require('./2018/MinFromTime'), + modulo: require('./2018/modulo'), + MonthFromTime: require('./2018/MonthFromTime'), + msFromTime: require('./2018/msFromTime'), + NumberToString: require('./2018/NumberToString'), + ObjectCreate: require('./2018/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2018/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2018/OrdinaryGetOwnProperty'), + OrdinaryGetPrototypeOf: require('./2018/OrdinaryGetPrototypeOf'), + OrdinarySetPrototypeOf: require('./2018/OrdinarySetPrototypeOf'), + OrdinaryHasInstance: require('./2018/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2018/OrdinaryHasProperty'), + PromiseResolve: require('./2018/PromiseResolve'), + RegExpExec: require('./2018/RegExpExec'), + RequireObjectCoercible: require('./2018/RequireObjectCoercible'), + SameValue: require('./2018/SameValue'), + SameValueNonNumber: require('./2018/SameValueNonNumber'), + SameValueZero: require('./2018/SameValueZero'), + SecFromTime: require('./2018/SecFromTime'), + Set: require('./2018/Set'), + SetFunctionName: require('./2018/SetFunctionName'), + SetIntegrityLevel: require('./2018/SetIntegrityLevel'), + SpeciesConstructor: require('./2018/SpeciesConstructor'), + SymbolDescriptiveString: require('./2018/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2018/TestIntegrityLevel'), + thisBooleanValue: require('./2018/thisBooleanValue'), + thisNumberValue: require('./2018/thisNumberValue'), + thisStringValue: require('./2018/thisStringValue'), + thisSymbolValue: require('./2018/thisSymbolValue'), + thisTimeValue: require('./2018/thisTimeValue'), + TimeClip: require('./2018/TimeClip'), + TimeFromYear: require('./2018/TimeFromYear'), + TimeString: require('./2018/TimeString'), + TimeWithinDay: require('./2018/TimeWithinDay'), + ToBoolean: require('./2018/ToBoolean'), + ToDateString: require('./2018/ToDateString'), + ToIndex: require('./2018/ToIndex'), + ToInt16: require('./2018/ToInt16'), + ToInt32: require('./2018/ToInt32'), + ToInt8: require('./2018/ToInt8'), + ToInteger: require('./2018/ToInteger'), + ToLength: require('./2018/ToLength'), + ToNumber: require('./2018/ToNumber'), + ToObject: require('./2018/ToObject'), + ToPrimitive: require('./2018/ToPrimitive'), + ToPropertyDescriptor: require('./2018/ToPropertyDescriptor'), + ToPropertyKey: require('./2018/ToPropertyKey'), + ToString: require('./2018/ToString'), + ToUint16: require('./2018/ToUint16'), + ToUint32: require('./2018/ToUint32'), + ToUint8: require('./2018/ToUint8'), + ToUint8Clamp: require('./2018/ToUint8Clamp'), + Type: require('./2018/Type'), + ValidateAndApplyPropertyDescriptor: require('./2018/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2018/WeekDay'), + YearFromTime: require('./2018/YearFromTime') +}; + +module.exports = ES2018; diff --git a/node_modules/es-abstract/es2019.js b/node_modules/es-abstract/es2019.js new file mode 100644 index 000000000..3bd65e427 --- /dev/null +++ b/node_modules/es-abstract/es2019.js @@ -0,0 +1,129 @@ +'use strict'; + +/* eslint global-require: 0 */ +// https://www.ecma-international.org/ecma-262/10.0/#sec-abstract-operations +var ES2019 = { + 'Abstract Equality Comparison': require('./2019/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./2019/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./2019/StrictEqualityComparison'), + AddEntriesFromIterable: require('./2019/AddEntriesFromIterable'), + AdvanceStringIndex: require('./2019/AdvanceStringIndex'), + ArrayCreate: require('./2019/ArrayCreate'), + ArraySetLength: require('./2019/ArraySetLength'), + ArraySpeciesCreate: require('./2019/ArraySpeciesCreate'), + Call: require('./2019/Call'), + CanonicalNumericIndexString: require('./2019/CanonicalNumericIndexString'), + CompletePropertyDescriptor: require('./2019/CompletePropertyDescriptor'), + CopyDataProperties: require('./2019/CopyDataProperties'), + CreateDataProperty: require('./2019/CreateDataProperty'), + CreateDataPropertyOrThrow: require('./2019/CreateDataPropertyOrThrow'), + CreateHTML: require('./2019/CreateHTML'), + CreateIterResultObject: require('./2019/CreateIterResultObject'), + CreateListFromArrayLike: require('./2019/CreateListFromArrayLike'), + CreateMethodProperty: require('./2019/CreateMethodProperty'), + DateFromTime: require('./2019/DateFromTime'), + DateString: require('./2019/DateString'), + Day: require('./2019/Day'), + DayFromYear: require('./2019/DayFromYear'), + DaysInYear: require('./2019/DaysInYear'), + DayWithinYear: require('./2019/DayWithinYear'), + DefinePropertyOrThrow: require('./2019/DefinePropertyOrThrow'), + DeletePropertyOrThrow: require('./2019/DeletePropertyOrThrow'), + EnumerableOwnPropertyNames: require('./2019/EnumerableOwnPropertyNames'), + FlattenIntoArray: require('./2019/FlattenIntoArray'), + FromPropertyDescriptor: require('./2019/FromPropertyDescriptor'), + Get: require('./2019/Get'), + GetIterator: require('./2019/GetIterator'), + GetMethod: require('./2019/GetMethod'), + GetOwnPropertyKeys: require('./2019/GetOwnPropertyKeys'), + GetPrototypeFromConstructor: require('./2019/GetPrototypeFromConstructor'), + GetSubstitution: require('./2019/GetSubstitution'), + GetV: require('./2019/GetV'), + HasOwnProperty: require('./2019/HasOwnProperty'), + HasProperty: require('./2019/HasProperty'), + HourFromTime: require('./2019/HourFromTime'), + InLeapYear: require('./2019/InLeapYear'), + InstanceofOperator: require('./2019/InstanceofOperator'), + Invoke: require('./2019/Invoke'), + IsAccessorDescriptor: require('./2019/IsAccessorDescriptor'), + IsArray: require('./2019/IsArray'), + IsCallable: require('./2019/IsCallable'), + IsConcatSpreadable: require('./2019/IsConcatSpreadable'), + IsConstructor: require('./2019/IsConstructor'), + IsDataDescriptor: require('./2019/IsDataDescriptor'), + IsExtensible: require('./2019/IsExtensible'), + IsGenericDescriptor: require('./2019/IsGenericDescriptor'), + IsInteger: require('./2019/IsInteger'), + IsPromise: require('./2019/IsPromise'), + IsPropertyKey: require('./2019/IsPropertyKey'), + IsRegExp: require('./2019/IsRegExp'), + IsStringPrefix: require('./2019/IsStringPrefix'), + IterableToList: require('./2019/IterableToList'), + IteratorClose: require('./2019/IteratorClose'), + IteratorComplete: require('./2019/IteratorComplete'), + IteratorNext: require('./2019/IteratorNext'), + IteratorStep: require('./2019/IteratorStep'), + IteratorValue: require('./2019/IteratorValue'), + MakeDate: require('./2019/MakeDate'), + MakeDay: require('./2019/MakeDay'), + MakeTime: require('./2019/MakeTime'), + MinFromTime: require('./2019/MinFromTime'), + modulo: require('./2019/modulo'), + MonthFromTime: require('./2019/MonthFromTime'), + msFromTime: require('./2019/msFromTime'), + NumberToString: require('./2019/NumberToString'), + ObjectCreate: require('./2019/ObjectCreate'), + OrdinaryDefineOwnProperty: require('./2019/OrdinaryDefineOwnProperty'), + OrdinaryGetOwnProperty: require('./2019/OrdinaryGetOwnProperty'), + OrdinaryGetPrototypeOf: require('./2019/OrdinaryGetPrototypeOf'), + OrdinarySetPrototypeOf: require('./2019/OrdinarySetPrototypeOf'), + OrdinaryHasInstance: require('./2019/OrdinaryHasInstance'), + OrdinaryHasProperty: require('./2019/OrdinaryHasProperty'), + PromiseResolve: require('./2019/PromiseResolve'), + RegExpExec: require('./2019/RegExpExec'), + RequireObjectCoercible: require('./2019/RequireObjectCoercible'), + SameValue: require('./2019/SameValue'), + SameValueNonNumber: require('./2019/SameValueNonNumber'), + SameValueZero: require('./2019/SameValueZero'), + SecFromTime: require('./2019/SecFromTime'), + Set: require('./2019/Set'), + SetFunctionName: require('./2019/SetFunctionName'), + SetIntegrityLevel: require('./2019/SetIntegrityLevel'), + SpeciesConstructor: require('./2019/SpeciesConstructor'), + SymbolDescriptiveString: require('./2019/SymbolDescriptiveString'), + TestIntegrityLevel: require('./2019/TestIntegrityLevel'), + thisBooleanValue: require('./2019/thisBooleanValue'), + thisNumberValue: require('./2019/thisNumberValue'), + thisStringValue: require('./2019/thisStringValue'), + thisSymbolValue: require('./2019/thisSymbolValue'), + thisTimeValue: require('./2019/thisTimeValue'), + TimeClip: require('./2019/TimeClip'), + TimeFromYear: require('./2019/TimeFromYear'), + TimeString: require('./2019/TimeString'), + TimeWithinDay: require('./2019/TimeWithinDay'), + ToBoolean: require('./2019/ToBoolean'), + ToDateString: require('./2019/ToDateString'), + ToIndex: require('./2019/ToIndex'), + ToInt16: require('./2019/ToInt16'), + ToInt32: require('./2019/ToInt32'), + ToInt8: require('./2019/ToInt8'), + ToInteger: require('./2019/ToInteger'), + ToLength: require('./2019/ToLength'), + ToNumber: require('./2019/ToNumber'), + ToObject: require('./2019/ToObject'), + ToPrimitive: require('./2019/ToPrimitive'), + ToPropertyDescriptor: require('./2019/ToPropertyDescriptor'), + ToPropertyKey: require('./2019/ToPropertyKey'), + ToString: require('./2019/ToString'), + ToUint16: require('./2019/ToUint16'), + ToUint32: require('./2019/ToUint32'), + ToUint8: require('./2019/ToUint8'), + ToUint8Clamp: require('./2019/ToUint8Clamp'), + TrimString: require('./2019/TrimString'), + Type: require('./2019/Type'), + ValidateAndApplyPropertyDescriptor: require('./2019/ValidateAndApplyPropertyDescriptor'), + WeekDay: require('./2019/WeekDay'), + YearFromTime: require('./2019/YearFromTime') +}; + +module.exports = ES2019; diff --git a/node_modules/es-abstract/es5.js b/node_modules/es-abstract/es5.js new file mode 100644 index 000000000..2cc951519 --- /dev/null +++ b/node_modules/es-abstract/es5.js @@ -0,0 +1,49 @@ +'use strict'; + +/* eslint global-require: 0 */ + +// https://es5.github.io/#x9 +module.exports = { + 'Abstract Equality Comparison': require('./5/AbstractEqualityComparison'), + 'Abstract Relational Comparison': require('./5/AbstractRelationalComparison'), + 'Strict Equality Comparison': require('./5/StrictEqualityComparison'), + CheckObjectCoercible: require('./5/CheckObjectCoercible'), + DateFromTime: require('./5/DateFromTime'), + Day: require('./5/Day'), + DayFromYear: require('./5/DayFromYear'), + DaysInYear: require('./5/DaysInYear'), + DayWithinYear: require('./5/DayWithinYear'), + FromPropertyDescriptor: require('./5/FromPropertyDescriptor'), + HourFromTime: require('./5/HourFromTime'), + InLeapYear: require('./5/InLeapYear'), + IsAccessorDescriptor: require('./5/IsAccessorDescriptor'), + IsCallable: require('./5/IsCallable'), + IsDataDescriptor: require('./5/IsDataDescriptor'), + IsGenericDescriptor: require('./5/IsGenericDescriptor'), + IsPropertyDescriptor: require('./5/IsPropertyDescriptor'), + MakeDate: require('./5/MakeDate'), + MakeDay: require('./5/MakeDay'), + MakeTime: require('./5/MakeTime'), + MinFromTime: require('./5/MinFromTime'), + modulo: require('./5/modulo'), + MonthFromTime: require('./5/MonthFromTime'), + msFromTime: require('./5/msFromTime'), + SameValue: require('./5/SameValue'), + SecFromTime: require('./5/SecFromTime'), + TimeClip: require('./5/TimeClip'), + TimeFromYear: require('./5/TimeFromYear'), + TimeWithinDay: require('./5/TimeWithinDay'), + ToBoolean: require('./5/ToBoolean'), + ToInt32: require('./5/ToInt32'), + ToInteger: require('./5/ToInteger'), + ToNumber: require('./5/ToNumber'), + ToObject: require('./5/ToObject'), + ToPrimitive: require('./5/ToPrimitive'), + ToPropertyDescriptor: require('./5/ToPropertyDescriptor'), + ToString: require('./5/ToString'), + ToUint16: require('./5/ToUint16'), + ToUint32: require('./5/ToUint32'), + Type: require('./5/Type'), + WeekDay: require('./5/WeekDay'), + YearFromTime: require('./5/YearFromTime') +}; diff --git a/node_modules/es-abstract/es6.js b/node_modules/es-abstract/es6.js new file mode 100644 index 000000000..2d1f4dc92 --- /dev/null +++ b/node_modules/es-abstract/es6.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./es2015'); diff --git a/node_modules/es-abstract/es7.js b/node_modules/es-abstract/es7.js new file mode 100644 index 000000000..f2f15c0a8 --- /dev/null +++ b/node_modules/es-abstract/es7.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./es2016'); diff --git a/node_modules/es-abstract/helpers/DefineOwnProperty.js b/node_modules/es-abstract/helpers/DefineOwnProperty.js new file mode 100644 index 000000000..99ace1077 --- /dev/null +++ b/node_modules/es-abstract/helpers/DefineOwnProperty.js @@ -0,0 +1,45 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); + +if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + } catch (e) { + // IE 8 has a broken defineProperty + $defineProperty = null; + } +} + +var callBound = require('../helpers/callBound'); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +// eslint-disable-next-line max-params +module.exports = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) { + if (!$defineProperty) { + if (!IsDataDescriptor(desc)) { + // ES3 does not support getters/setters + return false; + } + if (!desc['[[Configurable]]'] || !desc['[[Writable]]']) { + return false; + } + + // fallback for ES3 + if (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) { + // a non-enumerable existing property + return false; + } + + // property does not exist at all, or exists but is enumerable + var V = desc['[[Value]]']; + // eslint-disable-next-line no-param-reassign + O[P] = V; // will use [[Define]] + return SameValue(O[P], V); + } + $defineProperty(O, P, FromPropertyDescriptor(desc)); + return true; +}; diff --git a/node_modules/es-abstract/helpers/OwnPropertyKeys.js b/node_modules/es-abstract/helpers/OwnPropertyKeys.js new file mode 100644 index 000000000..4a06ce344 --- /dev/null +++ b/node_modules/es-abstract/helpers/OwnPropertyKeys.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBind = require('./callBind'); +var callBound = require('./callBound'); + +var $ownKeys = GetIntrinsic('%Reflect.ownKeys%', true); +var $pushApply = callBind.apply(GetIntrinsic('%Array.prototype.push%')); +var $SymbolValueOf = callBound('Symbol.prototype.valueOf', true); +var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%', true); +var $gOPS = $SymbolValueOf ? GetIntrinsic('%Object.getOwnPropertySymbols%') : null; + +var keys = require('object-keys'); + +module.exports = $ownKeys || function OwnPropertyKeys(source) { + var ownKeys = ($gOPN || keys)(source); + if ($gOPS) { + $pushApply(ownKeys, $gOPS(source)); + } + return ownKeys; +}; diff --git a/node_modules/es-abstract/helpers/assertRecord.js b/node_modules/es-abstract/helpers/assertRecord.js new file mode 100644 index 000000000..45e115a44 --- /dev/null +++ b/node_modules/es-abstract/helpers/assertRecord.js @@ -0,0 +1,48 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var has = require('has'); + +var predicates = { + // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + 'Property Descriptor': function isPropertyDescriptor(Type, Desc) { + if (Type(Desc) !== 'Object') { + return false; + } + var allowed = { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Get]]': true, + '[[Set]]': true, + '[[Value]]': true, + '[[Writable]]': true + }; + + for (var key in Desc) { // eslint-disable-line + if (has(Desc, key) && !allowed[key]) { + return false; + } + } + + var isData = has(Desc, '[[Value]]'); + var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]'); + if (isData && IsAccessor) { + throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); + } + return true; + } +}; + +module.exports = function assertRecord(Type, recordType, argumentName, value) { + var predicate = predicates[recordType]; + if (typeof predicate !== 'function') { + throw new $SyntaxError('unknown record type: ' + recordType); + } + if (!predicate(Type, value)) { + throw new $TypeError(argumentName + ' must be a ' + recordType); + } +}; diff --git a/node_modules/es-abstract/helpers/assign.js b/node_modules/es-abstract/helpers/assign.js new file mode 100644 index 000000000..7e6666e7a --- /dev/null +++ b/node_modules/es-abstract/helpers/assign.js @@ -0,0 +1,22 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); + +var $assign = GetIntrinsic('%Object%').assign; + +module.exports = function assign(target, source) { + if ($assign) { + return $assign(target, source); + } + + // eslint-disable-next-line no-restricted-syntax + for (var key in source) { + if (has(source, key)) { + // eslint-disable-next-line no-param-reassign + target[key] = source[key]; + } + } + return target; +}; diff --git a/node_modules/es-abstract/helpers/callBind.js b/node_modules/es-abstract/helpers/callBind.js new file mode 100644 index 000000000..81b02ec93 --- /dev/null +++ b/node_modules/es-abstract/helpers/callBind.js @@ -0,0 +1,17 @@ +'use strict'; + +var bind = require('function-bind'); + +var GetIntrinsic = require('../GetIntrinsic'); + +var $apply = GetIntrinsic('%Function.prototype.apply%'); +var $call = GetIntrinsic('%Function.prototype.call%'); +var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); + +module.exports = function callBind() { + return $reflectApply(bind, $call, arguments); +}; + +module.exports.apply = function applyBind() { + return $reflectApply(bind, $apply, arguments); +}; diff --git a/node_modules/es-abstract/helpers/callBound.js b/node_modules/es-abstract/helpers/callBound.js new file mode 100644 index 000000000..9dc8fc518 --- /dev/null +++ b/node_modules/es-abstract/helpers/callBound.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBind = require('./callBind'); + +var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); + +module.exports = function callBoundIntrinsic(name, allowMissing) { + var intrinsic = GetIntrinsic(name, !!allowMissing); + if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.')) { + return callBind(intrinsic); + } + return intrinsic; +}; diff --git a/node_modules/es-abstract/helpers/every.js b/node_modules/es-abstract/helpers/every.js new file mode 100644 index 000000000..42a458211 --- /dev/null +++ b/node_modules/es-abstract/helpers/every.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function every(array, predicate) { + for (var i = 0; i < array.length; i += 1) { + if (!predicate(array[i], i, array)) { + return false; + } + } + return true; +}; diff --git a/node_modules/es-abstract/helpers/forEach.js b/node_modules/es-abstract/helpers/forEach.js new file mode 100644 index 000000000..35915a656 --- /dev/null +++ b/node_modules/es-abstract/helpers/forEach.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function forEach(array, callback) { + for (var i = 0; i < array.length; i += 1) { + callback(array[i], i, array); // eslint-disable-line callback-return + } +}; diff --git a/node_modules/es-abstract/helpers/getInferredName.js b/node_modules/es-abstract/helpers/getInferredName.js new file mode 100644 index 000000000..2dab6e77b --- /dev/null +++ b/node_modules/es-abstract/helpers/getInferredName.js @@ -0,0 +1,10 @@ +'use strict'; + +var getInferredName; +try { + // eslint-disable-next-line no-new-func + getInferredName = Function('s', 'return { [s]() {} }[s].name;'); +} catch (e) {} + +var inferred = function () {}; +module.exports = getInferredName && inferred.name === 'inferred' ? getInferredName : null; diff --git a/node_modules/es-abstract/helpers/getIteratorMethod.js b/node_modules/es-abstract/helpers/getIteratorMethod.js new file mode 100644 index 000000000..02f932c19 --- /dev/null +++ b/node_modules/es-abstract/helpers/getIteratorMethod.js @@ -0,0 +1,45 @@ +'use strict'; + +var hasSymbols = require('has-symbols')(); +var GetIntrinsic = require('../GetIntrinsic'); +var callBound = require('./callBound'); + +var $iterator = GetIntrinsic('%Symbol.iterator%', true); +var $stringSlice = callBound('String.prototype.slice'); + +module.exports = function getIteratorMethod(ES, iterable) { + var usingIterator; + if (hasSymbols) { + usingIterator = ES.GetMethod(iterable, $iterator); + } else if (ES.IsArray(iterable)) { + usingIterator = function () { + var i = -1; + var arr = this; // eslint-disable-line no-invalid-this + return { + next: function () { + i += 1; + return { + done: i >= arr.length, + value: arr[i] + }; + } + }; + }; + } else if (ES.Type(iterable) === 'String') { + usingIterator = function () { + var i = 0; + return { + next: function () { + var nextIndex = ES.AdvanceStringIndex(iterable, i, true); + var value = $stringSlice(iterable, i, nextIndex); + i = nextIndex; + return { + done: nextIndex > iterable.length, + value: value + }; + } + }; + }; + } + return usingIterator; +}; diff --git a/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js b/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js new file mode 100644 index 000000000..71168e93e --- /dev/null +++ b/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%'); +if ($gOPD) { + try { + $gOPD([], 'length'); + } catch (e) { + // IE 8 has a broken gOPD + $gOPD = null; + } +} + +module.exports = $gOPD; diff --git a/node_modules/es-abstract/helpers/getProto.js b/node_modules/es-abstract/helpers/getProto.js new file mode 100644 index 000000000..af10fd8a1 --- /dev/null +++ b/node_modules/es-abstract/helpers/getProto.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var originalGetProto = GetIntrinsic('%Object.getPrototypeOf%', true); +var $ArrayProto = GetIntrinsic('%Array.prototype%'); + +module.exports = originalGetProto || ( + // eslint-disable-next-line no-proto + [].__proto__ === $ArrayProto + ? function (O) { + return O.__proto__; // eslint-disable-line no-proto + } + : null +); diff --git a/node_modules/es-abstract/helpers/getSymbolDescription.js b/node_modules/es-abstract/helpers/getSymbolDescription.js new file mode 100644 index 000000000..45d80d253 --- /dev/null +++ b/node_modules/es-abstract/helpers/getSymbolDescription.js @@ -0,0 +1,41 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var callBound = require('./callBound'); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var getGlobalSymbolDescription = GetIntrinsic('%Symbol.keyFor%', true); +var thisSymbolValue = callBound('%Symbol.prototype.valueOf%', true); +var symToStr = callBound('Symbol.prototype.toString', true); + +var getInferredName = require('./getInferredName'); + +/* eslint-disable consistent-return */ +module.exports = callBound('%Symbol.prototype.description%', true) || function getSymbolDescription(symbol) { + if (!thisSymbolValue) { + throw new $SyntaxError('Symbols are not supported in this environment'); + } + + // will throw if not a symbol primitive or wrapper object + var sym = thisSymbolValue(symbol); + + if (getInferredName) { + var name = getInferredName(sym); + if (name === '') { return; } + return name.slice(1, -1); // name.slice('['.length, -']'.length); + } + + var desc; + if (getGlobalSymbolDescription) { + desc = getGlobalSymbolDescription(sym); + if (typeof desc === 'string') { + return desc; + } + } + + desc = symToStr(sym).slice(7, -1); // str.slice('Symbol('.length, -')'.length); + if (desc) { + return desc; + } +}; diff --git a/node_modules/es-abstract/helpers/isFinite.js b/node_modules/es-abstract/helpers/isFinite.js new file mode 100644 index 000000000..9e7cd4f82 --- /dev/null +++ b/node_modules/es-abstract/helpers/isFinite.js @@ -0,0 +1,5 @@ +'use strict'; + +var $isNaN = Number.isNaN || function (a) { return a !== a; }; + +module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; }; diff --git a/node_modules/es-abstract/helpers/isNaN.js b/node_modules/es-abstract/helpers/isNaN.js new file mode 100644 index 000000000..cb8631dca --- /dev/null +++ b/node_modules/es-abstract/helpers/isNaN.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = Number.isNaN || function isNaN(a) { + return a !== a; +}; diff --git a/node_modules/es-abstract/helpers/isPrefixOf.js b/node_modules/es-abstract/helpers/isPrefixOf.js new file mode 100644 index 000000000..b67d64056 --- /dev/null +++ b/node_modules/es-abstract/helpers/isPrefixOf.js @@ -0,0 +1,13 @@ +'use strict'; + +var $strSlice = require('../helpers/callBound')('String.prototype.slice'); + +module.exports = function isPrefixOf(prefix, string) { + if (prefix === string) { + return true; + } + if (prefix.length > string.length) { + return false; + } + return $strSlice(string, 0, prefix.length) === prefix; +}; diff --git a/node_modules/es-abstract/helpers/isPrimitive.js b/node_modules/es-abstract/helpers/isPrimitive.js new file mode 100644 index 000000000..06f0bf042 --- /dev/null +++ b/node_modules/es-abstract/helpers/isPrimitive.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function isPrimitive(value) { + return value === null || (typeof value !== 'function' && typeof value !== 'object'); +}; diff --git a/node_modules/es-abstract/helpers/isPropertyDescriptor.js b/node_modules/es-abstract/helpers/isPropertyDescriptor.js new file mode 100644 index 000000000..3eff7eb8f --- /dev/null +++ b/node_modules/es-abstract/helpers/isPropertyDescriptor.js @@ -0,0 +1,31 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var has = require('has'); +var $TypeError = GetIntrinsic('%TypeError%'); + +module.exports = function IsPropertyDescriptor(ES, Desc) { + if (ES.Type(Desc) !== 'Object') { + return false; + } + var allowed = { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Get]]': true, + '[[Set]]': true, + '[[Value]]': true, + '[[Writable]]': true + }; + + for (var key in Desc) { // eslint-disable-line no-restricted-syntax + if (has(Desc, key) && !allowed[key]) { + return false; + } + } + + if (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) { + throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); + } + return true; +}; diff --git a/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js b/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js new file mode 100644 index 000000000..a6162a1d3 --- /dev/null +++ b/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js @@ -0,0 +1,20 @@ +'use strict'; + +var every = require('./every'); + +module.exports = function isSamePropertyDescriptor(ES, D1, D2) { + var fields = [ + '[[Configurable]]', + '[[Enumerable]]', + '[[Get]]', + '[[Set]]', + '[[Value]]', + '[[Writable]]' + ]; + return every(fields, function (field) { + if ((field in D1) !== (field in D2)) { + return false; + } + return ES.SameValue(D1[field], D2[field]); + }); +}; diff --git a/node_modules/es-abstract/helpers/maxSafeInteger.js b/node_modules/es-abstract/helpers/maxSafeInteger.js new file mode 100644 index 000000000..2fe8f38e1 --- /dev/null +++ b/node_modules/es-abstract/helpers/maxSafeInteger.js @@ -0,0 +1,8 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $Math = GetIntrinsic('%Math%'); +var $Number = GetIntrinsic('%Number%'); + +module.exports = $Number.MAX_SAFE_INTEGER || $Math.pow(2, 53) - 1; diff --git a/node_modules/es-abstract/helpers/mod.js b/node_modules/es-abstract/helpers/mod.js new file mode 100644 index 000000000..67c8b78a2 --- /dev/null +++ b/node_modules/es-abstract/helpers/mod.js @@ -0,0 +1,8 @@ +'use strict'; + +var $floor = Math.floor; + +module.exports = function mod(number, modulo) { + var remain = number % modulo; + return $floor(remain >= 0 ? remain : remain + modulo); +}; diff --git a/node_modules/es-abstract/helpers/padTimeComponent.js b/node_modules/es-abstract/helpers/padTimeComponent.js new file mode 100644 index 000000000..cbd8d0612 --- /dev/null +++ b/node_modules/es-abstract/helpers/padTimeComponent.js @@ -0,0 +1,9 @@ +'use strict'; + +var callBound = require('../helpers/callBound'); + +var $strSlice = callBound('String.prototype.slice'); + +module.exports = function padTimeComponent(c, count) { + return $strSlice('00' + c, -(count || 2)); +}; diff --git a/node_modules/es-abstract/helpers/regexTester.js b/node_modules/es-abstract/helpers/regexTester.js new file mode 100644 index 000000000..982cc9f77 --- /dev/null +++ b/node_modules/es-abstract/helpers/regexTester.js @@ -0,0 +1,11 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var $test = GetIntrinsic('RegExp.prototype.test'); + +var callBind = require('./callBind'); + +module.exports = function regexTester(regex) { + return callBind($test, regex); +}; diff --git a/node_modules/es-abstract/helpers/setProto.js b/node_modules/es-abstract/helpers/setProto.js new file mode 100644 index 000000000..29ec9914b --- /dev/null +++ b/node_modules/es-abstract/helpers/setProto.js @@ -0,0 +1,16 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var originalSetProto = GetIntrinsic('%Object.setPrototypeOf%', true); +var $ArrayProto = GetIntrinsic('%Array.prototype%'); + +module.exports = originalSetProto || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayProto + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); diff --git a/node_modules/es-abstract/helpers/sign.js b/node_modules/es-abstract/helpers/sign.js new file mode 100644 index 000000000..598ea7d8b --- /dev/null +++ b/node_modules/es-abstract/helpers/sign.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function sign(number) { + return number >= 0 ? 1 : -1; +}; diff --git a/node_modules/es-abstract/helpers/timeConstants.js b/node_modules/es-abstract/helpers/timeConstants.js new file mode 100644 index 000000000..c275b40e7 --- /dev/null +++ b/node_modules/es-abstract/helpers/timeConstants.js @@ -0,0 +1,19 @@ +'use strict'; + +var HoursPerDay = 24; +var MinutesPerHour = 60; +var SecondsPerMinute = 60; +var msPerSecond = 1e3; +var msPerMinute = msPerSecond * SecondsPerMinute; +var msPerHour = msPerMinute * MinutesPerHour; +var msPerDay = 86400000; + +module.exports = { + HoursPerDay: HoursPerDay, + MinutesPerHour: MinutesPerHour, + SecondsPerMinute: SecondsPerMinute, + msPerSecond: msPerSecond, + msPerMinute: msPerMinute, + msPerHour: msPerHour, + msPerDay: msPerDay +}; diff --git a/node_modules/es-abstract/index.js b/node_modules/es-abstract/index.js new file mode 100644 index 000000000..7cef0395e --- /dev/null +++ b/node_modules/es-abstract/index.js @@ -0,0 +1,26 @@ +'use strict'; + +var assign = require('./helpers/assign'); + +var ES5 = require('./es5'); +var ES2015 = require('./es2015'); +var ES2016 = require('./es2016'); +var ES2017 = require('./es2017'); +var ES2018 = require('./es2018'); +var ES2019 = require('./es2019'); + +var ES = { + ES5: ES5, + ES6: ES2015, + ES2015: ES2015, + ES7: ES2016, + ES2016: ES2016, + ES2017: ES2017, + ES2018: ES2018, + ES2019: ES2019 +}; +assign(ES, ES5); +delete ES.CheckObjectCoercible; // renamed in ES6 to RequireObjectCoercible +assign(ES, ES2015); + +module.exports = ES; diff --git a/node_modules/es-abstract/operations/.eslintrc b/node_modules/es-abstract/operations/.eslintrc new file mode 100644 index 000000000..bcd76f767 --- /dev/null +++ b/node_modules/es-abstract/operations/.eslintrc @@ -0,0 +1,5 @@ +{ + "rules": { + "id-length": 0, + }, +} diff --git a/node_modules/es-abstract/operations/2015.js b/node_modules/es-abstract/operations/2015.js new file mode 100644 index 000000000..6c508918e --- /dev/null +++ b/node_modules/es-abstract/operations/2015.js @@ -0,0 +1,249 @@ +'use strict'; + +module.exports = { + IsPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type', // not actually an abstract op + + abs: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/6.0/#sec-abstract-relational-comparison', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/6.0/#sec-addrestrictedfunctionproperties', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-allocatearraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/6.0/#sec-allocatetypedarray', + ArrayCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/6.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/6.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring', + CharacterRange: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/6.0/#sec-implicit-completion-values', + Construct: 'https://ecma-international.org/ecma-262/6.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/6.0/#sec-copydatablockbytes', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/6.0/#sec-createarrayfromlist', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/6.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/6.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/6.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/6.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/6.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike', + CreateListIterator: 'https://ecma-international.org/ecma-262/6.0/#sec-createlistiterator', + CreateMapIterator: 'https://ecma-international.org/ecma-262/6.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/6.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/6.0/#sec-createrealm', + CreateSetIterator: 'https://ecma-international.org/ecma-262/6.0/#sec-createsetiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/6.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-date-number', + Day: 'https://ecma-international.org/ecma-262/6.0/#sec-day-number-and-time-within-day', + DayFromYear: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number', + DaysInYear: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number', + DayWithinYear: 'https://ecma-international.org/ecma-262/6.0/#sec-month-number', + Decode: 'https://ecma-international.org/ecma-262/6.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/6.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/6.0/#sec-enqueuejob', + EnumerableOwnNames: 'https://ecma-international.org/ecma-262/6.0/#sec-enumerableownnames', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/6.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/6.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/6.0/#sec-evaluatecall', + EvaluateDirectCall: 'https://ecma-international.org/ecma-262/6.0/#sec-evaluatedirectcall', + EvaluateNew: 'https://ecma-international.org/ecma-262/6.0/#sec-evaluatenew', + floor: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/6.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/6.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/6.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-functioncreate', + FunctionInitialize: 'https://ecma-international.org/ecma-262/6.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/6.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/6.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/6.0/#sec-get-o-p', + GetBase: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/6.0/#sec-getfunctionrealm', + GetGlobalObject: 'https://ecma-international.org/ecma-262/6.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/6.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/6.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/6.0/#sec-getmethod', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/6.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/6.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor', + GetReferencedName: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + GetSubstitution: 'https://ecma-international.org/ecma-262/6.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/6.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/6.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/6.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/6.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/6.0/#sec-getviewvalue', + HasOwnProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty', + HasPrimitiveBase: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + HasProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-hasproperty', + HostResolveImportedModule: 'sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-hours-minutes-second-and-milliseconds', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/6.0/#sec-importedlocalnames', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/6.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/6.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number', + InstanceofOperator: 'https://ecma-international.org/ecma-262/6.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/6.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/6.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/6.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/6.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/6.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/6.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/6.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/6.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/6.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/6.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/6.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/6.0/#sec-ispropertykey', + IsPropertyReference: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + IsRegExp: 'https://ecma-international.org/ecma-262/6.0/#sec-isregexp', + IsStrictReference: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + IsSuperReference: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + IsUnresolvableReference: 'https://ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues', + IsWordChar: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IteratorClose: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue', + LocalTime: 'https://ecma-international.org/ecma-262/6.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/6.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/6.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/6.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/6.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/6.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/6.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/6.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/6.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + min: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + MinFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-hours-minutes-second-and-milliseconds', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + MonthFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-month-number', + msFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-hours-minutes-second-and-milliseconds', + msPerDay: 'https://ecma-international.org/ecma-262/6.0/#sec-day-number-and-time-within-day', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/6.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/6.0/#sec-newpromisecapability', + NormalCompletion: 'https://ecma-international.org/ecma-262/6.0/#sec-normalcompletion', + ObjectCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/6.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty', + ParseModule: 'https://ecma-international.org/ecma-262/6.0/#sec-parsemodule', + PerformEval: 'https://ecma-international.org/ecma-262/6.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/6.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/6.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/6.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/6.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/6.0/#sec-preparefortailcall', + ProxyCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/6.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/6.0/#sec-quotejsonstring', + RegExpAlloc: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/6.0/#sec-rejectpromise', + RepeatMatcher: 'https://ecma-international.org/ecma-262/6.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/6.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/6.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/6.0/#sec-resolvethisbinding', + SameValue: 'https://ecma-international.org/ecma-262/6.0/#sec-samevalue', + SameValueZero: 'https://ecma-international.org/ecma-262/6.0/#sec-samevaluezero', + SecFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-hours-minutes-second-and-milliseconds', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/6.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/6.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/6.0/#sec-setdefaultglobalbindings', + SetFunctionName: 'https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/6.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/6.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/6.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/6.0/#sec-setviewvalue', + sign: 'https://ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions', + SortCompare: 'https://ecma-international.org/ecma-262/6.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/6.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/6.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-stringcreate', + StringGetIndexProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-stringgetindexproperty', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/6.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object', + thisNumberValue: 'https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object', + thisStringValue: 'https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object', + thisTimeValue: 'https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object', + TimeClip: 'https://ecma-international.org/ecma-262/6.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number', + TimeWithinDay: 'https://ecma-international.org/ecma-262/6.0/#sec-day-number-and-time-within-day', + ToBoolean: 'https://ecma-international.org/ecma-262/6.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/6.0/#sec-todatestring', + ToInt16: 'https://ecma-international.org/ecma-262/6.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/6.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/6.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/6.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/6.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/6.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/6.0/#sec-toobject', + ToPrimitive: 'https://ecma-international.org/ecma-262/6.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/6.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/6.0/#sec-tostring', + ToUint16: 'https://ecma-international.org/ecma-262/6.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/6.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/6.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/6.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/6.0/#sec-triggerpromisereactions', + Type: 'https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values', + TypedArrayFrom: 'https://ecma-international.org/ecma-262/6.0/#sec-typedarrayfrom', + UpdateEmpty: 'https://ecma-international.org/ecma-262/6.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/6.0/#sec-utc-t', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor', + WeekDay: 'https://ecma-international.org/ecma-262/6.0/#sec-week-day', + YearFromTime: 'https://ecma-international.org/ecma-262/6.0/#sec-year-number' +}; diff --git a/node_modules/es-abstract/operations/2016.js b/node_modules/es-abstract/operations/2016.js new file mode 100644 index 000000000..6a58b9cc1 --- /dev/null +++ b/node_modules/es-abstract/operations/2016.js @@ -0,0 +1,276 @@ +'use strict'; + +module.exports = { + IsPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type', // not actually an abstract op + + abs: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/7.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/7.0/#sec-abstract-relational-comparison', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/7.0/#sec-addrestrictedfunctionproperties', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/7.0/#sec-advancestringindex', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-allocatearraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/7.0/#sec-allocatetypedarray', + AllocateTypedArrayBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-allocatetypedarraybuffer', + ArrayCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/7.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-arrayspeciescreate', + BlockDeclarationInstantiation: 'https://ecma-international.org/ecma-262/7.0/#sec-blockdeclarationinstantiation', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/7.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/7.0/#sec-canonicalnumericindexstring', + CharacterRange: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterRangeOrUnion: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-characterrangeorunion-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/7.0/#sec-completion-record-specification-type', + Construct: 'https://ecma-international.org/ecma-262/7.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/7.0/#sec-copydatablockbytes', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/7.0/#sec-createarrayfromlist', + CreateArrayIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createarrayiterator', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/7.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/7.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/7.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/7.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/7.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/7.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/7.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/7.0/#sec-createlistfromarraylike', + CreateListIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createlistiterator', + CreateMapIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/7.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/7.0/#sec-createrealm', + CreateResolvingFunctions: 'https://ecma-international.org/ecma-262/7.0/#sec-createresolvingfunctions', + CreateSetIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createsetiterator', + CreateStringIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-createstringiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/7.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-date-number', + Day: 'https://ecma-international.org/ecma-262/7.0/#sec-day-number-and-time-within-day', + DayFromYear: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number', + DaysInYear: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number', + DayWithinYear: 'https://ecma-international.org/ecma-262/7.0/#sec-month-number', + Decode: 'https://ecma-international.org/ecma-262/7.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/7.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/7.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/7.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/7.0/#sec-enqueuejob', + EnumerableOwnNames: 'https://ecma-international.org/ecma-262/7.0/#sec-enumerableownnames', + EnumerateObjectProperties: 'https://ecma-international.org/ecma-262/7.0/#sec-enumerate-object-properties', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/7.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/7.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/7.0/#sec-evaluatecall', + EvaluateDirectCall: 'https://ecma-international.org/ecma-262/7.0/#sec-evaluatedirectcall', + EvaluateNew: 'https://ecma-international.org/ecma-262/7.0/#sec-evaluatenew', + floor: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/7.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/7.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/7.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-functioncreate', + FunctionDeclarationInstantiation: 'https://ecma-international.org/ecma-262/7.0/#sec-functiondeclarationinstantiation', + FunctionInitialize: 'https://ecma-international.org/ecma-262/7.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/7.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/7.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/7.0/#sec-get-o-p', + GetActiveScriptOrModule: 'https://ecma-international.org/ecma-262/7.0/#sec-getactivescriptormodule', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/7.0/#sec-getfunctionrealm', + GetGlobalObject: 'https://ecma-international.org/ecma-262/7.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/7.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/7.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/7.0/#sec-getmethod', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/7.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/7.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/7.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-getprototypefromconstructor', + GetSubstitution: 'https://ecma-international.org/ecma-262/7.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/7.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/7.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/7.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/7.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/7.0/#sec-getviewvalue', + GlobalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/7.0/#sec-globaldeclarationinstantiation', + HasOwnProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-hasownproperty', + HasProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-hasproperty', + HostPromiseRejectionTracker: 'https://ecma-international.org/ecma-262/7.0/#sec-host-promise-rejection-tracker', + HostReportErrors: 'https://ecma-international.org/ecma-262/7.0/#sec-host-report-errors', + HostResolveImportedModule: 'https://ecma-international.org/ecma-262/7.0/#sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-hours-minutes-second-and-milliseconds', + IfAbruptRejectPromise: 'https://ecma-international.org/ecma-262/7.0/#sec-ifabruptrejectpromise', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/7.0/#sec-importedlocalnames', + InitializeBoundName: 'https://ecma-international.org/ecma-262/7.0/#sec-initializeboundname', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/7.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/7.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number', + InstanceofOperator: 'https://ecma-international.org/ecma-262/7.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/7.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/7.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/7.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/7.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/7.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/7.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/7.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/7.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/7.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/7.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/7.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/7.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/7.0/#sec-ispropertykey', + IsRegExp: 'https://ecma-international.org/ecma-262/7.0/#sec-isregexp', + IsWordChar: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IterableToArrayLike: 'https://ecma-international.org/ecma-262/7.0/#sec-iterabletoarraylike', + IteratorClose: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/7.0/#sec-iteratorvalue', + LocalTime: 'https://ecma-international.org/ecma-262/7.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/7.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/7.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/7.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/7.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/7.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/7.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/7.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/7.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + min: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + MinFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-hours-minutes-second-and-milliseconds', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/7.0/#sec-algorithm-conventions', + MonthFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-month-number', + msFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-hours-minutes-second-and-milliseconds', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/7.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/7.0/#sec-newpromisecapability', + NextJob: 'https://ecma-international.org/ecma-262/7.0/#sec-nextjob-result', + NormalCompletion: 'https://ecma-international.org/ecma-262/7.0/#sec-normalcompletion', + ObjectCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/7.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarydefineownproperty', + OrdinaryDelete: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarydelete', + OrdinaryGet: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryget', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetownproperty', + OrdinaryGetPrototypeOf: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryhasproperty', + OrdinaryIsExtensible: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryisextensible', + OrdinaryOwnPropertyKeys: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryownpropertykeys', + OrdinaryPreventExtensions: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarypreventextensions', + OrdinarySet: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinaryset', + OrdinarySetPrototypeOf: 'https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof', + ParseModule: 'https://ecma-international.org/ecma-262/7.0/#sec-parsemodule', + ParseScript: 'https://ecma-international.org/ecma-262/7.0/#sec-parse-script', + PerformEval: 'https://ecma-international.org/ecma-262/7.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/7.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/7.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/7.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/7.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/7.0/#sec-preparefortailcall', + PromiseReactionJob: 'https://ecma-international.org/ecma-262/7.0/#sec-promisereactionjob', + PromiseResolveThenableJob: 'https://ecma-international.org/ecma-262/7.0/#sec-promiseresolvethenablejob', + ProxyCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/7.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/7.0/#sec-quotejsonstring', + RegExpAlloc: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/7.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/7.0/#sec-rejectpromise', + RepeatMatcher: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/7.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/7.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/7.0/#sec-resolvethisbinding', + ReturnIfAbrupt: 'https://ecma-international.org/ecma-262/7.0/#sec-returnifabrupt', + SameValue: 'https://ecma-international.org/ecma-262/7.0/#sec-samevalue', + SameValueNonNumber: 'https://ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber', + SameValueZero: 'https://ecma-international.org/ecma-262/7.0/#sec-samevaluezero', + ScriptEvaluation: 'https://ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-scriptevaluation', + ScriptEvaluationJob: 'https://ecma-international.org/ecma-262/7.0/#sec-scriptevaluationjob', + SecFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-hours-minutes-second-and-milliseconds', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/7.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/7.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/7.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/7.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/7.0/#sec-setdefaultglobalbindings', + SetFunctionName: 'https://ecma-international.org/ecma-262/7.0/#sec-setfunctionname', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/7.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/7.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/7.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/7.0/#sec-setviewvalue', + SortCompare: 'https://ecma-international.org/ecma-262/7.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/7.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/7.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/7.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/7.0/#sec-stringcreate', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/7.0/#sec-symboldescriptivestring', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/7.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/7.0/#sec-thisbooleanvalue', + thisNumberValue: 'https://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-number-prototype-object', + thisStringValue: 'https://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-string-prototype-object', + thisTimeValue: 'https://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-date-prototype-object', + TimeClip: 'https://ecma-international.org/ecma-262/7.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number', + TimeWithinDay: 'https://ecma-international.org/ecma-262/7.0/#sec-day-number-and-time-within-day', + ToBoolean: 'https://ecma-international.org/ecma-262/7.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/7.0/#sec-todatestring', + ToInt16: 'https://ecma-international.org/ecma-262/7.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/7.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/7.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/7.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/7.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/7.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/7.0/#sec-toobject', + TopLevelModuleEvaluationJob: 'https://ecma-international.org/ecma-262/7.0/#sec-toplevelmoduleevaluationjob', + ToPrimitive: 'https://ecma-international.org/ecma-262/7.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/7.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/7.0/#sec-tostring', + 'ToString Applied to the Number Type': 'https://ecma-international.org/ecma-262/7.0/#sec-tostring-applied-to-the-number-type', + ToUint16: 'https://ecma-international.org/ecma-262/7.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/7.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/7.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/7.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/7.0/#sec-triggerpromisereactions', + Type: 'https://ecma-international.org/ecma-262/7.0/#sec-ecmascript-data-types-and-values', + TypedArrayCreate: 'https://ecma-international.org/ecma-262/7.0/#typedarray-create', + TypedArraySpeciesCreate: 'https://ecma-international.org/ecma-262/7.0/#typedarray-species-create', + UpdateEmpty: 'https://ecma-international.org/ecma-262/7.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/7.0/#sec-utc-t', + UTF16Decode: 'https://ecma-international.org/ecma-262/7.0/#sec-utf16decode', + UTF16Encoding: 'https://ecma-international.org/ecma-262/7.0/#sec-utf16encoding', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/7.0/#sec-validateandapplypropertydescriptor', + ValidateTypedArray: 'https://ecma-international.org/ecma-262/7.0/#sec-validatetypedarray', + WeekDay: 'https://ecma-international.org/ecma-262/7.0/#sec-week-day', + YearFromTime: 'https://ecma-international.org/ecma-262/7.0/#sec-year-number' +}; diff --git a/node_modules/es-abstract/operations/2017.js b/node_modules/es-abstract/operations/2017.js new file mode 100644 index 000000000..896fcee50 --- /dev/null +++ b/node_modules/es-abstract/operations/2017.js @@ -0,0 +1,324 @@ +'use strict'; + +module.exports = { + IsPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type', // not actually an abstract op + + abs: 'https://ecma-international.org/ecma-262/8.0/#eqn-abs', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/8.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/8.0/#sec-abstract-relational-comparison', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/8.0/#sec-addrestrictedfunctionproperties', + AddWaiter: 'https://ecma-international.org/ecma-262/8.0/#sec-addwaiter', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/8.0/#sec-advancestringindex', + 'agent-order': 'https://ecma-international.org/ecma-262/8.0/#sec-agent-order', + AgentCanSuspend: 'https://ecma-international.org/ecma-262/8.0/#sec-agentcansuspend', + AgentSignifier: 'https://ecma-international.org/ecma-262/8.0/#sec-agentsignifier', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-allocatearraybuffer', + AllocateSharedArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-allocatesharedarraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/8.0/#sec-allocatetypedarray', + AllocateTypedArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-allocatetypedarraybuffer', + ArrayCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/8.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-arrayspeciescreate', + AsyncFunctionAwait: 'https://ecma-international.org/ecma-262/8.0/#sec-async-functions-abstract-operations-async-function-await', + AsyncFunctionCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-async-functions-abstract-operations-async-function-create', + AsyncFunctionStart: 'https://ecma-international.org/ecma-262/8.0/#sec-async-functions-abstract-operations-async-function-start', + AtomicLoad: 'https://ecma-international.org/ecma-262/8.0/#sec-atomicload', + AtomicReadModifyWrite: 'https://ecma-international.org/ecma-262/8.0/#sec-atomicreadmodifywrite', + BlockDeclarationInstantiation: 'https://ecma-international.org/ecma-262/8.0/#sec-blockdeclarationinstantiation', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/8.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/8.0/#sec-canonicalnumericindexstring', + CharacterRange: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterRangeOrUnion: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-characterrangeorunion-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/8.0/#sec-completion-record-specification-type', + ComposeWriteEventBytes: 'https://ecma-international.org/ecma-262/8.0/#sec-composewriteeventbytes', + Construct: 'https://ecma-international.org/ecma-262/8.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/8.0/#sec-copydatablockbytes', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/8.0/#sec-createarrayfromlist', + CreateArrayIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createarrayiterator', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/8.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/8.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/8.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/8.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/8.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/8.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/8.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/8.0/#sec-createlistfromarraylike', + CreateListIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createlistiterator', + CreateMapIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/8.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/8.0/#sec-createrealm', + CreateResolvingFunctions: 'https://ecma-international.org/ecma-262/8.0/#sec-createresolvingfunctions', + CreateSetIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createsetiterator', + CreateSharedByteDataBlock: 'https://ecma-international.org/ecma-262/8.0/#sec-createsharedbytedatablock', + CreateStringIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-createstringiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/8.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/8.0/#sec-date-number', + Day: 'https://ecma-international.org/ecma-262/8.0/#eqn-Day', + DayFromYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-DaysFromYear', + DaysInYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-DaysInYear', + DayWithinYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-DayWithinYear', + Decode: 'https://ecma-international.org/ecma-262/8.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/8.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/8.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/8.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/8.0/#sec-enqueuejob', + EnterCriticalSection: 'https://ecma-international.org/ecma-262/8.0/#sec-entercriticalsection', + EnumerableOwnProperties: 'https://ecma-international.org/ecma-262/8.0/#sec-enumerableownproperties', + EnumerateObjectProperties: 'https://ecma-international.org/ecma-262/8.0/#sec-enumerate-object-properties', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/8.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/8.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/8.0/#sec-evaluatecall', + EvaluateDirectCall: 'https://ecma-international.org/ecma-262/8.0/#sec-evaluatedirectcall', + EvaluateNew: 'https://ecma-international.org/ecma-262/8.0/#sec-evaluatenew', + EventSet: 'https://ecma-international.org/ecma-262/8.0/#sec-event-set', + floor: 'https://ecma-international.org/ecma-262/8.0/#eqn-floor', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/8.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/8.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/8.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-functioncreate', + FunctionDeclarationInstantiation: 'https://ecma-international.org/ecma-262/8.0/#sec-functiondeclarationinstantiation', + FunctionInitialize: 'https://ecma-international.org/ecma-262/8.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/8.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/8.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/8.0/#sec-get-o-p', + GetActiveScriptOrModule: 'https://ecma-international.org/ecma-262/8.0/#sec-getactivescriptormodule', + GetBase: 'https://ecma-international.org/ecma-262/8.0/#ao-getbase', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/8.0/#sec-getfunctionrealm', + GetGlobalObject: 'https://ecma-international.org/ecma-262/8.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/8.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/8.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/8.0/#sec-getmethod', + GetModifySetValueInBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-getmodifysetvalueinbuffer', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/8.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/8.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/8.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-getprototypefromconstructor', + GetReferencedName: 'https://ecma-international.org/ecma-262/8.0/#ao-getreferencedname', + GetSubstitution: 'https://ecma-international.org/ecma-262/8.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/8.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/8.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/8.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/8.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/8.0/#sec-getviewvalue', + GetWaiterList: 'https://ecma-international.org/ecma-262/8.0/#sec-getwaiterlist', + GlobalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/8.0/#sec-globaldeclarationinstantiation', + 'happens-before': 'https://ecma-international.org/ecma-262/8.0/#sec-happens-before', + HasOwnProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-hasownproperty', + HasPrimitiveBase: 'https://ecma-international.org/ecma-262/8.0/#ao-hasprimitivebase', + HasProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-hasproperty', + 'host-synchronizes-with': 'https://ecma-international.org/ecma-262/8.0/#sec-host-synchronizes-with', + HostEnsureCanCompileStrings: 'https://ecma-international.org/ecma-262/8.0/#sec-hostensurecancompilestrings', + HostEventSet: 'https://ecma-international.org/ecma-262/8.0/#sec-hosteventset', + HostPromiseRejectionTracker: 'https://ecma-international.org/ecma-262/8.0/#sec-host-promise-rejection-tracker', + HostReportErrors: 'https://ecma-international.org/ecma-262/8.0/#sec-host-report-errors', + HostResolveImportedModule: 'https://ecma-international.org/ecma-262/8.0/#sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-HourFromTime', + IfAbruptRejectPromise: 'https://ecma-international.org/ecma-262/8.0/#sec-ifabruptrejectpromise', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/8.0/#sec-importedlocalnames', + InitializeBoundName: 'https://ecma-international.org/ecma-262/8.0/#sec-initializeboundname', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/8.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/8.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-InLeapYear', + InstanceofOperator: 'https://ecma-international.org/ecma-262/8.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/8.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/8.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/8.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/8.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/8.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/8.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/8.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/8.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/8.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/8.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/8.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/8.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/8.0/#sec-ispropertykey', + IsPropertyReference: 'https://ecma-international.org/ecma-262/8.0/#ao-ispropertyreference', + IsRegExp: 'https://ecma-international.org/ecma-262/8.0/#sec-isregexp', + IsSharedArrayBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-issharedarraybuffer', + IsStrictReference: 'https://ecma-international.org/ecma-262/8.0/#ao-isstrictreference', + IsSuperReference: 'https://ecma-international.org/ecma-262/8.0/#ao-issuperreference', + IsUnresolvableReference: 'https://ecma-international.org/ecma-262/8.0/#ao-isunresolvablereference', + IsWordChar: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IterableToList: 'https://ecma-international.org/ecma-262/8.0/#sec-iterabletolist', + IteratorClose: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/8.0/#sec-iteratorvalue', + LeaveCriticalSection: 'https://ecma-international.org/ecma-262/8.0/#sec-leavecriticalsection', + LocalTime: 'https://ecma-international.org/ecma-262/8.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/8.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/8.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/8.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/8.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/8.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/8.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/8.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/8.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/8.0/#eqn-max', + 'memory-order': 'https://ecma-international.org/ecma-262/8.0/#sec-memory-order', + min: 'https://ecma-international.org/ecma-262/8.0/#eqn-min', + MinFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-MinFromTime', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/8.0/#eqn-modulo', + MonthFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-MonthFromTime', + msFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-msFromTime', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/8.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/8.0/#sec-newpromisecapability', + NormalCompletion: 'https://ecma-international.org/ecma-262/8.0/#sec-normalcompletion', + NumberToRawBytes: 'https://ecma-international.org/ecma-262/8.0/#sec-numbertorawbytes', + ObjectCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/8.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarydefineownproperty', + OrdinaryDelete: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarydelete', + OrdinaryGet: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryget', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarygetownproperty', + OrdinaryGetPrototypeOf: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarygetprototypeof', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryhasproperty', + OrdinaryIsExtensible: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryisextensible', + OrdinaryOwnPropertyKeys: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryownpropertykeys', + OrdinaryPreventExtensions: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarypreventextensions', + OrdinarySet: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinaryset', + OrdinarySetPrototypeOf: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarysetprototypeof', + OrdinaryToPrimitive: 'https://ecma-international.org/ecma-262/8.0/#sec-ordinarytoprimitive', + ParseModule: 'https://ecma-international.org/ecma-262/8.0/#sec-parsemodule', + ParseScript: 'https://ecma-international.org/ecma-262/8.0/#sec-parse-script', + PerformEval: 'https://ecma-international.org/ecma-262/8.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/8.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/8.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/8.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/8.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/8.0/#sec-preparefortailcall', + PromiseReactionJob: 'https://ecma-international.org/ecma-262/8.0/#sec-promisereactionjob', + PromiseResolveThenableJob: 'https://ecma-international.org/ecma-262/8.0/#sec-promiseresolvethenablejob', + ProxyCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/8.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/8.0/#sec-quotejsonstring', + RawBytesToNumber: 'https://ecma-international.org/ecma-262/8.0/#sec-rawbytestonumber', + 'reads-bytes-from': 'https://ecma-international.org/ecma-262/8.0/#sec-reads-bytes-from', + 'reads-from': 'https://ecma-international.org/ecma-262/8.0/#sec-reads-from', + RegExpAlloc: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/8.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/8.0/#sec-rejectpromise', + RemoveWaiter: 'https://ecma-international.org/ecma-262/8.0/#sec-removewaiter', + RemoveWaiters: 'https://ecma-international.org/ecma-262/8.0/#sec-removewaiters', + RepeatMatcher: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/8.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/8.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/8.0/#sec-resolvethisbinding', + ReturnIfAbrupt: 'https://ecma-international.org/ecma-262/8.0/#sec-returnifabrupt', + RunJobs: 'https://ecma-international.org/ecma-262/8.0/#sec-runjobs', + SameValue: 'https://ecma-international.org/ecma-262/8.0/#sec-samevalue', + SameValueNonNumber: 'https://ecma-international.org/ecma-262/8.0/#sec-samevaluenonnumber', + SameValueZero: 'https://ecma-international.org/ecma-262/8.0/#sec-samevaluezero', + ScriptEvaluation: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-scriptevaluation', + ScriptEvaluationJob: 'https://ecma-international.org/ecma-262/8.0/#sec-scriptevaluationjob', + SecFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-SecFromTime', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/8.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/8.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/8.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/8.0/#sec-setdefaultglobalbindings', + SetFunctionName: 'https://ecma-international.org/ecma-262/8.0/#sec-setfunctionname', + SetImmutablePrototype: 'https://ecma-international.org/ecma-262/8.0/#sec-set-immutable-prototype', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/8.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/8.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/8.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/8.0/#sec-setviewvalue', + SharedDataBlockEventSet: 'https://ecma-international.org/ecma-262/8.0/#sec-sharedatablockeventset', + SortCompare: 'https://ecma-international.org/ecma-262/8.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/8.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/8.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/8.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/8.0/#sec-stringcreate', + StringGetOwnProperty: 'https://ecma-international.org/ecma-262/8.0/#sec-stringgetownproperty', + Suspend: 'https://ecma-international.org/ecma-262/8.0/#sec-suspend', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/8.0/#sec-symboldescriptivestring', + 'synchronizes-with': 'https://ecma-international.org/ecma-262/8.0/#sec-synchronizes-with', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/8.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/8.0/#sec-thisbooleanvalue', + thisNumberValue: 'https://ecma-international.org/ecma-262/8.0/#sec-thisnumbervalue', + thisStringValue: 'https://ecma-international.org/ecma-262/8.0/#sec-thisstringvalue', + thisTimeValue: 'https://ecma-international.org/ecma-262/8.0/#sec-thistimevalue', + TimeClip: 'https://ecma-international.org/ecma-262/8.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/8.0/#eqn-TimeFromYear', + TimeWithinDay: 'https://ecma-international.org/ecma-262/8.0/#eqn-TimeWithinDay', + ToBoolean: 'https://ecma-international.org/ecma-262/8.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/8.0/#sec-todatestring', + ToIndex: 'https://ecma-international.org/ecma-262/8.0/#sec-toindex', + ToInt16: 'https://ecma-international.org/ecma-262/8.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/8.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/8.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/8.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/8.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/8.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/8.0/#sec-toobject', + TopLevelModuleEvaluationJob: 'https://ecma-international.org/ecma-262/8.0/#sec-toplevelmoduleevaluationjob', + ToPrimitive: 'https://ecma-international.org/ecma-262/8.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/8.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/8.0/#sec-tostring', + 'ToString Applied to the Number Type': 'https://ecma-international.org/ecma-262/8.0/#sec-tostring-applied-to-the-number-type', + ToUint16: 'https://ecma-international.org/ecma-262/8.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/8.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/8.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/8.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/8.0/#sec-triggerpromisereactions', + Type: 'https://ecma-international.org/ecma-262/8.0/#sec-ecmascript-data-types-and-values', + TypedArrayCreate: 'https://ecma-international.org/ecma-262/8.0/#typedarray-create', + TypedArraySpeciesCreate: 'https://ecma-international.org/ecma-262/8.0/#typedarray-species-create', + UpdateEmpty: 'https://ecma-international.org/ecma-262/8.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/8.0/#sec-utc-t', + UTF16Decode: 'https://ecma-international.org/ecma-262/8.0/#sec-utf16decode', + UTF16Encoding: 'https://ecma-international.org/ecma-262/8.0/#sec-utf16encoding', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor', + ValidateAtomicAccess: 'https://ecma-international.org/ecma-262/8.0/#sec-validateatomicaccess', + ValidateSharedIntegerTypedArray: 'https://ecma-international.org/ecma-262/8.0/#sec-validatesharedintegertypedarray', + ValidateTypedArray: 'https://ecma-international.org/ecma-262/8.0/#sec-validatetypedarray', + ValueOfReadEvent: 'https://ecma-international.org/ecma-262/8.0/#sec-valueofreadevent', + WakeWaiter: 'https://ecma-international.org/ecma-262/8.0/#sec-wakewaiter', + WeekDay: 'https://ecma-international.org/ecma-262/8.0/#sec-week-day', + WordCharacters: 'https://ecma-international.org/ecma-262/8.0/#sec-runtime-semantics-wordcharacters-abstract-operation', + YearFromTime: 'https://ecma-international.org/ecma-262/8.0/#eqn-YearFromTime' +}; diff --git a/node_modules/es-abstract/operations/2018.js b/node_modules/es-abstract/operations/2018.js new file mode 100644 index 000000000..c93b561d6 --- /dev/null +++ b/node_modules/es-abstract/operations/2018.js @@ -0,0 +1,350 @@ +'use strict'; + +module.exports = { + abs: 'https://ecma-international.org/ecma-262/9.0/#eqn-abs', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/9.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/9.0/#sec-abstract-relational-comparison', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/9.0/#sec-addrestrictedfunctionproperties', + AddWaiter: 'https://ecma-international.org/ecma-262/9.0/#sec-addwaiter', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/9.0/#sec-advancestringindex', + 'agent-order': 'https://ecma-international.org/ecma-262/9.0/#sec-agent-order', + AgentCanSuspend: 'https://ecma-international.org/ecma-262/9.0/#sec-agentcansuspend', + AgentSignifier: 'https://ecma-international.org/ecma-262/9.0/#sec-agentsignifier', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-allocatearraybuffer', + AllocateSharedArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-allocatesharedarraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/9.0/#sec-allocatetypedarray', + AllocateTypedArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-allocatetypedarraybuffer', + ArrayCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/9.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-arrayspeciescreate', + AsyncFunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-async-functions-abstract-operations-async-function-create', + AsyncFunctionStart: 'https://ecma-international.org/ecma-262/9.0/#sec-async-functions-abstract-operations-async-function-start', + AsyncGeneratorEnqueue: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorenqueue', + AsyncGeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorfunctioncreate', + AsyncGeneratorReject: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorreject', + AsyncGeneratorResolve: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorresolve', + AsyncGeneratorResumeNext: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorresumenext', + AsyncGeneratorStart: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratorstart', + AsyncGeneratorYield: 'https://ecma-international.org/ecma-262/9.0/#sec-asyncgeneratoryield', + AsyncIteratorClose: 'https://ecma-international.org/ecma-262/9.0/#sec-asynciteratorclose', + AtomicLoad: 'https://ecma-international.org/ecma-262/9.0/#sec-atomicload', + AtomicReadModifyWrite: 'https://ecma-international.org/ecma-262/9.0/#sec-atomicreadmodifywrite', + Await: 'https://ecma-international.org/ecma-262/9.0/#await', + BackreferenceMatcher: 'https://ecma-international.org/ecma-262/9.0/#sec-backreference-matcher', + BlockDeclarationInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-blockdeclarationinstantiation', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/9.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/9.0/#sec-canonicalnumericindexstring', + CaseClauseIsSelected: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-caseclauseisselected', + CharacterRange: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterRangeOrUnion: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-characterrangeorunion-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/9.0/#sec-completion-record-specification-type', + ComposeWriteEventBytes: 'https://ecma-international.org/ecma-262/9.0/#sec-composewriteeventbytes', + Construct: 'https://ecma-international.org/ecma-262/9.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/9.0/#sec-copydatablockbytes', + CopyDataProperties: 'https://ecma-international.org/ecma-262/9.0/#sec-copydataproperties', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/9.0/#sec-createarrayfromlist', + CreateArrayIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createarrayiterator', + CreateAsyncFromSyncIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createasyncfromsynciterator', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/9.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/9.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/9.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/9.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/9.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/9.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/9.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/9.0/#sec-createlistfromarraylike', + CreateListIteratorRecord: 'https://ecma-international.org/ecma-262/9.0/#sec-createlistiteratorRecord', + CreateMapIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/9.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/9.0/#sec-createrealm', + CreateResolvingFunctions: 'https://ecma-international.org/ecma-262/9.0/#sec-createresolvingfunctions', + CreateSetIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createsetiterator', + CreateSharedByteDataBlock: 'https://ecma-international.org/ecma-262/9.0/#sec-createsharedbytedatablock', + CreateStringIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-createstringiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/9.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/9.0/#sec-date-number', + DateString: 'https://ecma-international.org/ecma-262/9.0/#sec-datestring', + Day: 'https://ecma-international.org/ecma-262/9.0/#eqn-Day', + DayFromYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-DaysFromYear', + DaysInYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-DaysInYear', + DayWithinYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-DayWithinYear', + Decode: 'https://ecma-international.org/ecma-262/9.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/9.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/9.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/9.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/9.0/#sec-enqueuejob', + EnterCriticalSection: 'https://ecma-international.org/ecma-262/9.0/#sec-entercriticalsection', + EnumerableOwnPropertyNames: 'https://ecma-international.org/ecma-262/9.0/#sec-enumerableownpropertynames', + EnumerateObjectProperties: 'https://ecma-international.org/ecma-262/9.0/#sec-enumerate-object-properties', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/9.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/9.0/#sec-evaluatecall', + EvaluateNew: 'https://ecma-international.org/ecma-262/9.0/#sec-evaluatenew', + EventSet: 'https://ecma-international.org/ecma-262/9.0/#sec-event-set', + floor: 'https://ecma-international.org/ecma-262/9.0/#eqn-floor', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/9.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/9.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/9.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-functioncreate', + FunctionDeclarationInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-functiondeclarationinstantiation', + FunctionInitialize: 'https://ecma-international.org/ecma-262/9.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/9.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/9.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/9.0/#sec-get-o-p', + GetActiveScriptOrModule: 'https://ecma-international.org/ecma-262/9.0/#sec-getactivescriptormodule', + GetBase: 'https://ecma-international.org/ecma-262/9.0/#sec-getbase', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/9.0/#sec-getfunctionrealm', + GetGeneratorKind: 'https://ecma-international.org/ecma-262/9.0/#sec-getgeneratorkind', + GetGlobalObject: 'https://ecma-international.org/ecma-262/9.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/9.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/9.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/9.0/#sec-getmethod', + GetModifySetValueInBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-getmodifysetvalueinbuffer', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/9.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/9.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/9.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-getprototypefromconstructor', + GetReferencedName: 'https://ecma-international.org/ecma-262/9.0/#sec-getreferencedname', + GetSubstitution: 'https://ecma-international.org/ecma-262/9.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/9.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/9.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/9.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/9.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/9.0/#sec-getviewvalue', + GetWaiterList: 'https://ecma-international.org/ecma-262/9.0/#sec-getwaiterlist', + GlobalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-globaldeclarationinstantiation', + 'happens-before': 'https://ecma-international.org/ecma-262/9.0/#sec-happens-before', + HasOwnProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-hasownproperty', + HasPrimitiveBase: 'https://ecma-international.org/ecma-262/9.0/#sec-hasprimitivebase', + HasProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-hasproperty', + 'host-synchronizes-with': 'https://ecma-international.org/ecma-262/9.0/#sec-host-synchronizes-with', + HostEnsureCanCompileStrings: 'https://ecma-international.org/ecma-262/9.0/#sec-hostensurecancompilestrings', + HostEventSet: 'https://ecma-international.org/ecma-262/9.0/#sec-hosteventset', + HostPromiseRejectionTracker: 'https://ecma-international.org/ecma-262/9.0/#sec-host-promise-rejection-tracker', + HostReportErrors: 'https://ecma-international.org/ecma-262/9.0/#sec-host-report-errors', + HostResolveImportedModule: 'https://ecma-international.org/ecma-262/9.0/#sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-HourFromTime', + IfAbruptRejectPromise: 'https://ecma-international.org/ecma-262/9.0/#sec-ifabruptrejectpromise', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/9.0/#sec-importedlocalnames', + InitializeBoundName: 'https://ecma-international.org/ecma-262/9.0/#sec-initializeboundname', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/9.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/9.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-InLeapYear', + InnerModuleEvaluation: 'https://ecma-international.org/ecma-262/9.0/#sec-innermoduleevaluation', + InnerModuleInstantiation: 'https://ecma-international.org/ecma-262/9.0/#sec-innermoduleinstantiation', + InstanceofOperator: 'https://ecma-international.org/ecma-262/9.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/9.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/9.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/9.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/9.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/9.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/9.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/9.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/9.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/9.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/9.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/9.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/9.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/9.0/#sec-ispropertykey', + IsPropertyReference: 'https://ecma-international.org/ecma-262/9.0/#sec-ispropertyreference', + IsRegExp: 'https://ecma-international.org/ecma-262/9.0/#sec-isregexp', + IsSharedArrayBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-issharedarraybuffer', + IsStrictReference: 'https://ecma-international.org/ecma-262/9.0/#sec-isstrictreference', + IsStringPrefix: 'https://ecma-international.org/ecma-262/9.0/#sec-isstringprefix', + IsSuperReference: 'https://ecma-international.org/ecma-262/9.0/#sec-issuperreference', + IsUnresolvableReference: 'https://ecma-international.org/ecma-262/9.0/#sec-isunresolvablereference', + IsWordChar: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IterableToList: 'https://ecma-international.org/ecma-262/9.0/#sec-iterabletolist', + IteratorClose: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/9.0/#sec-iteratorvalue', + LeaveCriticalSection: 'https://ecma-international.org/ecma-262/9.0/#sec-leavecriticalsection', + LocalTime: 'https://ecma-international.org/ecma-262/9.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/9.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/9.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/9.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/9.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/9.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/9.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/9.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/9.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/9.0/#eqn-max', + 'memory-order': 'https://ecma-international.org/ecma-262/9.0/#sec-memory-order', + min: 'https://ecma-international.org/ecma-262/9.0/#eqn-min', + MinFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-MinFromTime', + ModuleDeclarationEnvironmentSetup: 'https://ecma-international.org/ecma-262/9.0/#sec-moduledeclarationenvironmentsetup', + ModuleExecution: 'https://ecma-international.org/ecma-262/9.0/#sec-moduleexecution', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/9.0/#eqn-modulo', + MonthFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-MonthFromTime', + msFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-msFromTime', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/9.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/9.0/#sec-newpromisecapability', + NormalCompletion: 'https://ecma-international.org/ecma-262/9.0/#sec-normalcompletion', + NumberToRawBytes: 'https://ecma-international.org/ecma-262/9.0/#sec-numbertorawbytes', + NumberToString: 'https://ecma-international.org/ecma-262/9.0/#sec-tostring-applied-to-the-number-type', + ObjectCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/9.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarydefineownproperty', + OrdinaryDelete: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarydelete', + OrdinaryGet: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryget', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarygetownproperty', + OrdinaryGetPrototypeOf: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarygetprototypeof', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryhasproperty', + OrdinaryIsExtensible: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryisextensible', + OrdinaryOwnPropertyKeys: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryownpropertykeys', + OrdinaryPreventExtensions: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarypreventextensions', + OrdinarySet: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinaryset', + OrdinarySetPrototypeOf: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarysetprototypeof', + OrdinarySetWithOwnDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarysetwithowndescriptor', + OrdinaryToPrimitive: 'https://ecma-international.org/ecma-262/9.0/#sec-ordinarytoprimitive', + ParseModule: 'https://ecma-international.org/ecma-262/9.0/#sec-parsemodule', + ParseScript: 'https://ecma-international.org/ecma-262/9.0/#sec-parse-script', + PerformEval: 'https://ecma-international.org/ecma-262/9.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/9.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/9.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/9.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/9.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/9.0/#sec-preparefortailcall', + PromiseReactionJob: 'https://ecma-international.org/ecma-262/9.0/#sec-promisereactionjob', + PromiseResolve: 'https://ecma-international.org/ecma-262/9.0/#sec-promise-resolve', + PromiseResolveThenableJob: 'https://ecma-international.org/ecma-262/9.0/#sec-promiseresolvethenablejob', + ProxyCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/9.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/9.0/#sec-quotejsonstring', + RawBytesToNumber: 'https://ecma-international.org/ecma-262/9.0/#sec-rawbytestonumber', + 'reads-bytes-from': 'https://ecma-international.org/ecma-262/9.0/#sec-reads-bytes-from', + 'reads-from': 'https://ecma-international.org/ecma-262/9.0/#sec-reads-from', + RegExpAlloc: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/9.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/9.0/#sec-rejectpromise', + RemoveWaiter: 'https://ecma-international.org/ecma-262/9.0/#sec-removewaiter', + RemoveWaiters: 'https://ecma-international.org/ecma-262/9.0/#sec-removewaiters', + RepeatMatcher: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/9.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/9.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/9.0/#sec-resolvethisbinding', + ReturnIfAbrupt: 'https://ecma-international.org/ecma-262/9.0/#sec-returnifabrupt', + RunJobs: 'https://ecma-international.org/ecma-262/9.0/#sec-runjobs', + SameValue: 'https://ecma-international.org/ecma-262/9.0/#sec-samevalue', + SameValueNonNumber: 'https://ecma-international.org/ecma-262/9.0/#sec-samevaluenonnumber', + SameValueZero: 'https://ecma-international.org/ecma-262/9.0/#sec-samevaluezero', + ScriptEvaluation: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-scriptevaluation', + ScriptEvaluationJob: 'https://ecma-international.org/ecma-262/9.0/#sec-scriptevaluationjob', + SecFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-SecFromTime', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/9.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/9.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/9.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/9.0/#sec-setdefaultglobalbindings', + SetFunctionLength: 'https://ecma-international.org/ecma-262/9.0/#sec-setfunctionlength', + SetFunctionName: 'https://ecma-international.org/ecma-262/9.0/#sec-setfunctionname', + SetImmutablePrototype: 'https://ecma-international.org/ecma-262/9.0/#sec-set-immutable-prototype', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/9.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/9.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/9.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/9.0/#sec-setviewvalue', + SharedDataBlockEventSet: 'https://ecma-international.org/ecma-262/9.0/#sec-sharedatablockeventset', + SortCompare: 'https://ecma-international.org/ecma-262/9.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/9.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/9.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/9.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/9.0/#sec-stringcreate', + StringGetOwnProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-stringgetownproperty', + Suspend: 'https://ecma-international.org/ecma-262/9.0/#sec-suspend', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/9.0/#sec-symboldescriptivestring', + 'synchronizes-with': 'https://ecma-international.org/ecma-262/9.0/#sec-synchronizes-with', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/9.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thisbooleanvalue', + thisNumberValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thisnumbervalue', + thisStringValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thisstringvalue', + thisSymbolValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thissymbolvalue', + thisTimeValue: 'https://ecma-international.org/ecma-262/9.0/#sec-thistimevalue', + ThrowCompletion: 'https://ecma-international.org/ecma-262/9.0/#sec-throwcompletion', + TimeClip: 'https://ecma-international.org/ecma-262/9.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/9.0/#eqn-TimeFromYear', + TimeString: 'https://ecma-international.org/ecma-262/9.0/#sec-timestring', + TimeWithinDay: 'https://ecma-international.org/ecma-262/9.0/#eqn-TimeWithinDay', + TimeZoneString: 'https://ecma-international.org/ecma-262/9.0/#sec-timezoneestring', + ToBoolean: 'https://ecma-international.org/ecma-262/9.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/9.0/#sec-todatestring', + ToIndex: 'https://ecma-international.org/ecma-262/9.0/#sec-toindex', + ToInt16: 'https://ecma-international.org/ecma-262/9.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/9.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/9.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/9.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/9.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/9.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/9.0/#sec-toobject', + TopLevelModuleEvaluationJob: 'https://ecma-international.org/ecma-262/9.0/#sec-toplevelmoduleevaluationjob', + ToPrimitive: 'https://ecma-international.org/ecma-262/9.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/9.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/9.0/#sec-tostring', + ToUint16: 'https://ecma-international.org/ecma-262/9.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/9.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/9.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/9.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/9.0/#sec-triggerpromisereactions', + Type: 'https://ecma-international.org/ecma-262/9.0/#sec-ecmascript-data-types-and-values', + TypedArrayCreate: 'https://ecma-international.org/ecma-262/9.0/#typedarray-create', + TypedArraySpeciesCreate: 'https://ecma-international.org/ecma-262/9.0/#typedarray-species-create', + UnicodeEscape: 'https://ecma-international.org/ecma-262/9.0/#sec-unicodeescape', + UnicodeMatchProperty: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-unicodematchproperty-p', + UnicodeMatchPropertyValue: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-unicodematchpropertyvalue-p-v', + UpdateEmpty: 'https://ecma-international.org/ecma-262/9.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/9.0/#sec-utc-t', + UTF16Decode: 'https://ecma-international.org/ecma-262/9.0/#sec-utf16decode', + UTF16Encoding: 'https://ecma-international.org/ecma-262/9.0/#sec-utf16encoding', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/9.0/#sec-validateandapplypropertydescriptor', + ValidateAtomicAccess: 'https://ecma-international.org/ecma-262/9.0/#sec-validateatomicaccess', + ValidateSharedIntegerTypedArray: 'https://ecma-international.org/ecma-262/9.0/#sec-validatesharedintegertypedarray', + ValidateTypedArray: 'https://ecma-international.org/ecma-262/9.0/#sec-validatetypedarray', + ValueOfReadEvent: 'https://ecma-international.org/ecma-262/9.0/#sec-valueofreadevent', + WakeWaiter: 'https://ecma-international.org/ecma-262/9.0/#sec-wakewaiter', + WeekDay: 'https://ecma-international.org/ecma-262/9.0/#sec-week-day', + WordCharacters: 'https://ecma-international.org/ecma-262/9.0/#sec-runtime-semantics-wordcharacters-abstract-operation', + YearFromTime: 'https://ecma-international.org/ecma-262/9.0/#eqn-YearFromTime' +}; diff --git a/node_modules/es-abstract/operations/2019.js b/node_modules/es-abstract/operations/2019.js new file mode 100644 index 000000000..73f05e8db --- /dev/null +++ b/node_modules/es-abstract/operations/2019.js @@ -0,0 +1,355 @@ +'use strict'; + +module.exports = { + abs: 'https://ecma-international.org/ecma-262/10.0/#eqn-abs', + 'Abstract Equality Comparison': 'https://ecma-international.org/ecma-262/10.0/#sec-abstract-equality-comparison', + 'Abstract Relational Comparison': 'https://ecma-international.org/ecma-262/10.0/#sec-abstract-relational-comparison', + AddEntriesFromIterable: 'https://ecma-international.org/ecma-262/10.0/#sec-add-entries-from-iterable', + AddRestrictedFunctionProperties: 'https://ecma-international.org/ecma-262/10.0/#sec-addrestrictedfunctionproperties', + AddWaiter: 'https://ecma-international.org/ecma-262/10.0/#sec-addwaiter', + AdvanceStringIndex: 'https://ecma-international.org/ecma-262/10.0/#sec-advancestringindex', + 'agent-order': 'https://ecma-international.org/ecma-262/10.0/#sec-agent-order', + AgentCanSuspend: 'https://ecma-international.org/ecma-262/10.0/#sec-agentcansuspend', + AgentSignifier: 'https://ecma-international.org/ecma-262/10.0/#sec-agentsignifier', + AllocateArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-allocatearraybuffer', + AllocateSharedArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-allocatesharedarraybuffer', + AllocateTypedArray: 'https://ecma-international.org/ecma-262/10.0/#sec-allocatetypedarray', + AllocateTypedArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-allocatetypedarraybuffer', + ArrayCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-arraycreate', + ArraySetLength: 'https://ecma-international.org/ecma-262/10.0/#sec-arraysetlength', + ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-arrayspeciescreate', + AsyncFromSyncIteratorContinuation: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncfromsynciteratorcontinuation', + AsyncFunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-async-functions-abstract-operations-async-function-create', + AsyncFunctionStart: 'https://ecma-international.org/ecma-262/10.0/#sec-async-functions-abstract-operations-async-function-start', + AsyncGeneratorEnqueue: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorenqueue', + AsyncGeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorfunctioncreate', + AsyncGeneratorReject: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorreject', + AsyncGeneratorResolve: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorresolve', + AsyncGeneratorResumeNext: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorresumenext', + AsyncGeneratorStart: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratorstart', + AsyncGeneratorYield: 'https://ecma-international.org/ecma-262/10.0/#sec-asyncgeneratoryield', + AsyncIteratorClose: 'https://ecma-international.org/ecma-262/10.0/#sec-asynciteratorclose', + AtomicLoad: 'https://ecma-international.org/ecma-262/10.0/#sec-atomicload', + AtomicReadModifyWrite: 'https://ecma-international.org/ecma-262/10.0/#sec-atomicreadmodifywrite', + Await: 'https://ecma-international.org/ecma-262/10.0/#await', + BackreferenceMatcher: 'https://ecma-international.org/ecma-262/10.0/#sec-backreference-matcher', + BlockDeclarationInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-blockdeclarationinstantiation', + BoundFunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-boundfunctioncreate', + Call: 'https://ecma-international.org/ecma-262/10.0/#sec-call', + Canonicalize: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-canonicalize-ch', + CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/10.0/#sec-canonicalnumericindexstring', + CaseClauseIsSelected: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-caseclauseisselected', + CharacterRange: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-characterrange-abstract-operation', + CharacterRangeOrUnion: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-characterrangeorunion-abstract-operation', + CharacterSetMatcher: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation', + CloneArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-clonearraybuffer', + CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-completepropertydescriptor', + Completion: 'https://ecma-international.org/ecma-262/10.0/#sec-completion-record-specification-type', + ComposeWriteEventBytes: 'https://ecma-international.org/ecma-262/10.0/#sec-composewriteeventbytes', + Construct: 'https://ecma-international.org/ecma-262/10.0/#sec-construct', + CopyDataBlockBytes: 'https://ecma-international.org/ecma-262/10.0/#sec-copydatablockbytes', + CopyDataProperties: 'https://ecma-international.org/ecma-262/10.0/#sec-copydataproperties', + CreateArrayFromList: 'https://ecma-international.org/ecma-262/10.0/#sec-createarrayfromlist', + CreateArrayIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createarrayiterator', + CreateAsyncFromSyncIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createasyncfromsynciterator', + CreateBuiltinFunction: 'https://ecma-international.org/ecma-262/10.0/#sec-createbuiltinfunction', + CreateByteDataBlock: 'https://ecma-international.org/ecma-262/10.0/#sec-createbytedatablock', + CreateDataProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-createdataproperty', + CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/10.0/#sec-createdatapropertyorthrow', + CreateDynamicFunction: 'https://ecma-international.org/ecma-262/10.0/#sec-createdynamicfunction', + CreateHTML: 'https://ecma-international.org/ecma-262/10.0/#sec-createhtml', + CreateIntrinsics: 'https://ecma-international.org/ecma-262/10.0/#sec-createintrinsics', + CreateIterResultObject: 'https://ecma-international.org/ecma-262/10.0/#sec-createiterresultobject', + CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/10.0/#sec-createlistfromarraylike', + CreateListIteratorRecord: 'https://ecma-international.org/ecma-262/10.0/#sec-createlistiteratorRecord', + CreateMapIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createmapiterator', + CreateMappedArgumentsObject: 'https://ecma-international.org/ecma-262/10.0/#sec-createmappedargumentsobject', + CreateMethodProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-createmethodproperty', + CreatePerIterationEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-createperiterationenvironment', + CreateRealm: 'https://ecma-international.org/ecma-262/10.0/#sec-createrealm', + CreateResolvingFunctions: 'https://ecma-international.org/ecma-262/10.0/#sec-createresolvingfunctions', + CreateSetIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createsetiterator', + CreateSharedByteDataBlock: 'https://ecma-international.org/ecma-262/10.0/#sec-createsharedbytedatablock', + CreateStringIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-createstringiterator', + CreateUnmappedArgumentsObject: 'https://ecma-international.org/ecma-262/10.0/#sec-createunmappedargumentsobject', + DateFromTime: 'https://ecma-international.org/ecma-262/10.0/#sec-date-number', + DateString: 'https://ecma-international.org/ecma-262/10.0/#sec-datestring', + Day: 'https://ecma-international.org/ecma-262/10.0/#eqn-Day', + DayFromYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-DaysFromYear', + DaysInYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-DaysInYear', + DayWithinYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-DayWithinYear', + Decode: 'https://ecma-international.org/ecma-262/10.0/#sec-decode', + DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/10.0/#sec-definepropertyorthrow', + DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/10.0/#sec-deletepropertyorthrow', + DetachArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-detacharraybuffer', + Encode: 'https://ecma-international.org/ecma-262/10.0/#sec-encode', + EnqueueJob: 'https://ecma-international.org/ecma-262/10.0/#sec-enqueuejob', + EnterCriticalSection: 'https://ecma-international.org/ecma-262/10.0/#sec-entercriticalsection', + EnumerableOwnPropertyNames: 'https://ecma-international.org/ecma-262/10.0/#sec-enumerableownpropertynames', + EnumerateObjectProperties: 'https://ecma-international.org/ecma-262/10.0/#sec-enumerate-object-properties', + EscapeRegExpPattern: 'https://ecma-international.org/ecma-262/10.0/#sec-escaperegexppattern', + EvalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-evaldeclarationinstantiation', + EvaluateCall: 'https://ecma-international.org/ecma-262/10.0/#sec-evaluatecall', + EvaluateNew: 'https://ecma-international.org/ecma-262/10.0/#sec-evaluatenew', + EventSet: 'https://ecma-international.org/ecma-262/10.0/#sec-event-set', + ExecuteModule: 'https://ecma-international.org/ecma-262/10.0/#sec-source-text-module-record-execute-module', + FlattenIntoArray: 'https://ecma-international.org/ecma-262/10.0/#sec-flattenintoarray', + floor: 'https://ecma-international.org/ecma-262/10.0/#eqn-floor', + ForBodyEvaluation: 'https://ecma-international.org/ecma-262/10.0/#sec-forbodyevaluation', + 'ForIn/OfBodyEvaluation': 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset', + 'ForIn/OfHeadEvaluation': 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind', + FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-frompropertydescriptor', + FulfillPromise: 'https://ecma-international.org/ecma-262/10.0/#sec-fulfillpromise', + FunctionAllocate: 'https://ecma-international.org/ecma-262/10.0/#sec-functionallocate', + FunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-functioncreate', + FunctionDeclarationInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-functiondeclarationinstantiation', + FunctionInitialize: 'https://ecma-international.org/ecma-262/10.0/#sec-functioninitialize', + GeneratorFunctionCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorfunctioncreate', + GeneratorResume: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorresume', + GeneratorResumeAbrupt: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorresumeabrupt', + GeneratorStart: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorstart', + GeneratorValidate: 'https://ecma-international.org/ecma-262/10.0/#sec-generatorvalidate', + GeneratorYield: 'https://ecma-international.org/ecma-262/10.0/#sec-generatoryield', + Get: 'https://ecma-international.org/ecma-262/10.0/#sec-get-o-p', + GetActiveScriptOrModule: 'https://ecma-international.org/ecma-262/10.0/#sec-getactivescriptormodule', + GetBase: 'https://ecma-international.org/ecma-262/10.0/#sec-getbase', + GetFunctionRealm: 'https://ecma-international.org/ecma-262/10.0/#sec-getfunctionrealm', + GetGeneratorKind: 'https://ecma-international.org/ecma-262/10.0/#sec-getgeneratorkind', + GetGlobalObject: 'https://ecma-international.org/ecma-262/10.0/#sec-getglobalobject', + GetIdentifierReference: 'https://ecma-international.org/ecma-262/10.0/#sec-getidentifierreference', + GetIterator: 'https://ecma-international.org/ecma-262/10.0/#sec-getiterator', + GetMethod: 'https://ecma-international.org/ecma-262/10.0/#sec-getmethod', + GetModifySetValueInBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-getmodifysetvalueinbuffer', + GetModuleNamespace: 'https://ecma-international.org/ecma-262/10.0/#sec-getmodulenamespace', + GetNewTarget: 'https://ecma-international.org/ecma-262/10.0/#sec-getnewtarget', + GetOwnPropertyKeys: 'https://ecma-international.org/ecma-262/10.0/#sec-getownpropertykeys', + GetPrototypeFromConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-getprototypefromconstructor', + GetReferencedName: 'https://ecma-international.org/ecma-262/10.0/#sec-getreferencedname', + GetSubstitution: 'https://ecma-international.org/ecma-262/10.0/#sec-getsubstitution', + GetSuperConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-getsuperconstructor', + GetTemplateObject: 'https://ecma-international.org/ecma-262/10.0/#sec-gettemplateobject', + GetThisEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-getthisenvironment', + GetThisValue: 'https://ecma-international.org/ecma-262/10.0/#sec-getthisvalue', + GetV: 'https://ecma-international.org/ecma-262/10.0/#sec-getv', + GetValue: 'https://ecma-international.org/ecma-262/10.0/#sec-getvalue', + GetValueFromBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-getvaluefrombuffer', + GetViewValue: 'https://ecma-international.org/ecma-262/10.0/#sec-getviewvalue', + GetWaiterList: 'https://ecma-international.org/ecma-262/10.0/#sec-getwaiterlist', + GlobalDeclarationInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-globaldeclarationinstantiation', + 'happens-before': 'https://ecma-international.org/ecma-262/10.0/#sec-happens-before', + HasOwnProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-hasownproperty', + HasPrimitiveBase: 'https://ecma-international.org/ecma-262/10.0/#sec-hasprimitivebase', + HasProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-hasproperty', + 'host-synchronizes-with': 'https://ecma-international.org/ecma-262/10.0/#sec-host-synchronizes-with', + HostEnsureCanCompileStrings: 'https://ecma-international.org/ecma-262/10.0/#sec-hostensurecancompilestrings', + HostEventSet: 'https://ecma-international.org/ecma-262/10.0/#sec-hosteventset', + HostPromiseRejectionTracker: 'https://ecma-international.org/ecma-262/10.0/#sec-host-promise-rejection-tracker', + HostReportErrors: 'https://ecma-international.org/ecma-262/10.0/#sec-host-report-errors', + HostResolveImportedModule: 'https://ecma-international.org/ecma-262/10.0/#sec-hostresolveimportedmodule', + HourFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-HourFromTime', + IfAbruptRejectPromise: 'https://ecma-international.org/ecma-262/10.0/#sec-ifabruptrejectpromise', + ImportedLocalNames: 'https://ecma-international.org/ecma-262/10.0/#sec-importedlocalnames', + InitializeBoundName: 'https://ecma-international.org/ecma-262/10.0/#sec-initializeboundname', + InitializeEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-source-text-module-record-initialize-environment', + InitializeHostDefinedRealm: 'https://ecma-international.org/ecma-262/10.0/#sec-initializehostdefinedrealm', + InitializeReferencedBinding: 'https://ecma-international.org/ecma-262/10.0/#sec-initializereferencedbinding', + InLeapYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-InLeapYear', + InnerModuleEvaluation: 'https://ecma-international.org/ecma-262/10.0/#sec-innermoduleevaluation', + InnerModuleInstantiation: 'https://ecma-international.org/ecma-262/10.0/#sec-innermoduleinstantiation', + InstanceofOperator: 'https://ecma-international.org/ecma-262/10.0/#sec-instanceofoperator', + IntegerIndexedElementGet: 'https://ecma-international.org/ecma-262/10.0/#sec-integerindexedelementget', + IntegerIndexedElementSet: 'https://ecma-international.org/ecma-262/10.0/#sec-integerindexedelementset', + IntegerIndexedObjectCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-integerindexedobjectcreate', + InternalizeJSONProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-internalizejsonproperty', + Invoke: 'https://ecma-international.org/ecma-262/10.0/#sec-invoke', + IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-isaccessordescriptor', + IsAnonymousFunctionDefinition: 'https://ecma-international.org/ecma-262/10.0/#sec-isanonymousfunctiondefinition', + IsArray: 'https://ecma-international.org/ecma-262/10.0/#sec-isarray', + IsCallable: 'https://ecma-international.org/ecma-262/10.0/#sec-iscallable', + IsCompatiblePropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-iscompatiblepropertydescriptor', + IsConcatSpreadable: 'https://ecma-international.org/ecma-262/10.0/#sec-isconcatspreadable', + IsConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-isconstructor', + IsDataDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-isdatadescriptor', + IsDetachedBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-isdetachedbuffer', + IsExtensible: 'https://ecma-international.org/ecma-262/10.0/#sec-isextensible-o', + IsGenericDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-isgenericdescriptor', + IsInTailPosition: 'https://ecma-international.org/ecma-262/10.0/#sec-isintailposition', + IsInteger: 'https://ecma-international.org/ecma-262/10.0/#sec-isinteger', + IsLabelledFunction: 'https://ecma-international.org/ecma-262/10.0/#sec-islabelledfunction', + IsPromise: 'https://ecma-international.org/ecma-262/10.0/#sec-ispromise', + IsPropertyKey: 'https://ecma-international.org/ecma-262/10.0/#sec-ispropertykey', + IsPropertyReference: 'https://ecma-international.org/ecma-262/10.0/#sec-ispropertyreference', + IsRegExp: 'https://ecma-international.org/ecma-262/10.0/#sec-isregexp', + IsSharedArrayBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-issharedarraybuffer', + IsStrictReference: 'https://ecma-international.org/ecma-262/10.0/#sec-isstrictreference', + IsStringPrefix: 'https://ecma-international.org/ecma-262/10.0/#sec-isstringprefix', + IsSuperReference: 'https://ecma-international.org/ecma-262/10.0/#sec-issuperreference', + IsUnresolvableReference: 'https://ecma-international.org/ecma-262/10.0/#sec-isunresolvablereference', + IsWordChar: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-iswordchar-abstract-operation', + IterableToList: 'https://ecma-international.org/ecma-262/10.0/#sec-iterabletolist', + IteratorClose: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratorclose', + IteratorComplete: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratorcomplete', + IteratorNext: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratornext', + IteratorStep: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratorstep', + IteratorValue: 'https://ecma-international.org/ecma-262/10.0/#sec-iteratorvalue', + LeaveCriticalSection: 'https://ecma-international.org/ecma-262/10.0/#sec-leavecriticalsection', + LocalTime: 'https://ecma-international.org/ecma-262/10.0/#sec-localtime', + LoopContinues: 'https://ecma-international.org/ecma-262/10.0/#sec-loopcontinues', + MakeArgGetter: 'https://ecma-international.org/ecma-262/10.0/#sec-makearggetter', + MakeArgSetter: 'https://ecma-international.org/ecma-262/10.0/#sec-makeargsetter', + MakeClassConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-makeclassconstructor', + MakeConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-makeconstructor', + MakeDate: 'https://ecma-international.org/ecma-262/10.0/#sec-makedate', + MakeDay: 'https://ecma-international.org/ecma-262/10.0/#sec-makeday', + MakeMethod: 'https://ecma-international.org/ecma-262/10.0/#sec-makemethod', + MakeSuperPropertyReference: 'https://ecma-international.org/ecma-262/10.0/#sec-makesuperpropertyreference', + MakeTime: 'https://ecma-international.org/ecma-262/10.0/#sec-maketime', + max: 'https://ecma-international.org/ecma-262/10.0/#eqn-max', + 'memory-order': 'https://ecma-international.org/ecma-262/10.0/#sec-memory-order', + min: 'https://ecma-international.org/ecma-262/10.0/#eqn-min', + MinFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-MinFromTime', + ModuleNamespaceCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-modulenamespacecreate', + modulo: 'https://ecma-international.org/ecma-262/10.0/#eqn-modulo', + MonthFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-MonthFromTime', + msFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-msFromTime', + NewDeclarativeEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newdeclarativeenvironment', + NewFunctionEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newfunctionenvironment', + NewGlobalEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newglobalenvironment', + NewModuleEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newmoduleenvironment', + NewObjectEnvironment: 'https://ecma-international.org/ecma-262/10.0/#sec-newobjectenvironment', + NewPromiseCapability: 'https://ecma-international.org/ecma-262/10.0/#sec-newpromisecapability', + NormalCompletion: 'https://ecma-international.org/ecma-262/10.0/#sec-normalcompletion', + NotifyWaiter: 'https://ecma-international.org/ecma-262/10.0/#sec-notifywaiter', + NumberToRawBytes: 'https://ecma-international.org/ecma-262/10.0/#sec-numbertorawbytes', + NumberToString: 'https://ecma-international.org/ecma-262/10.0/#sec-tostring-applied-to-the-number-type', + ObjectCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-objectcreate', + ObjectDefineProperties: 'https://ecma-international.org/ecma-262/10.0/#sec-objectdefineproperties', + OrdinaryCallBindThis: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarycallbindthis', + OrdinaryCallEvaluateBody: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarycallevaluatebody', + OrdinaryCreateFromConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarycreatefromconstructor', + OrdinaryDefineOwnProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarydefineownproperty', + OrdinaryDelete: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarydelete', + OrdinaryGet: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryget', + OrdinaryGetOwnProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarygetownproperty', + OrdinaryGetPrototypeOf: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarygetprototypeof', + OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryhasinstance', + OrdinaryHasProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryhasproperty', + OrdinaryIsExtensible: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryisextensible', + OrdinaryOwnPropertyKeys: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryownpropertykeys', + OrdinaryPreventExtensions: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarypreventextensions', + OrdinarySet: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinaryset', + OrdinarySetPrototypeOf: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarysetprototypeof', + OrdinarySetWithOwnDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarysetwithowndescriptor', + OrdinaryToPrimitive: 'https://ecma-international.org/ecma-262/10.0/#sec-ordinarytoprimitive', + ParseModule: 'https://ecma-international.org/ecma-262/10.0/#sec-parsemodule', + ParseScript: 'https://ecma-international.org/ecma-262/10.0/#sec-parse-script', + PerformEval: 'https://ecma-international.org/ecma-262/10.0/#sec-performeval', + PerformPromiseAll: 'https://ecma-international.org/ecma-262/10.0/#sec-performpromiseall', + PerformPromiseRace: 'https://ecma-international.org/ecma-262/10.0/#sec-performpromiserace', + PerformPromiseThen: 'https://ecma-international.org/ecma-262/10.0/#sec-performpromisethen', + PrepareForOrdinaryCall: 'https://ecma-international.org/ecma-262/10.0/#sec-prepareforordinarycall', + PrepareForTailCall: 'https://ecma-international.org/ecma-262/10.0/#sec-preparefortailcall', + PromiseReactionJob: 'https://ecma-international.org/ecma-262/10.0/#sec-promisereactionjob', + PromiseResolve: 'https://ecma-international.org/ecma-262/10.0/#sec-promise-resolve', + PromiseResolveThenableJob: 'https://ecma-international.org/ecma-262/10.0/#sec-promiseresolvethenablejob', + ProxyCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-proxycreate', + PutValue: 'https://ecma-international.org/ecma-262/10.0/#sec-putvalue', + QuoteJSONString: 'https://ecma-international.org/ecma-262/10.0/#sec-quotejsonstring', + RawBytesToNumber: 'https://ecma-international.org/ecma-262/10.0/#sec-rawbytestonumber', + 'reads-bytes-from': 'https://ecma-international.org/ecma-262/10.0/#sec-reads-bytes-from', + 'reads-from': 'https://ecma-international.org/ecma-262/10.0/#sec-reads-from', + RegExpAlloc: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpalloc', + RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpbuiltinexec', + RegExpCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpcreate', + RegExpExec: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpexec', + RegExpInitialize: 'https://ecma-international.org/ecma-262/10.0/#sec-regexpinitialize', + RejectPromise: 'https://ecma-international.org/ecma-262/10.0/#sec-rejectpromise', + RemoveWaiter: 'https://ecma-international.org/ecma-262/10.0/#sec-removewaiter', + RemoveWaiters: 'https://ecma-international.org/ecma-262/10.0/#sec-removewaiters', + RepeatMatcher: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-repeatmatcher-abstract-operation', + RequireObjectCoercible: 'https://ecma-international.org/ecma-262/10.0/#sec-requireobjectcoercible', + ResolveBinding: 'https://ecma-international.org/ecma-262/10.0/#sec-resolvebinding', + ResolveThisBinding: 'https://ecma-international.org/ecma-262/10.0/#sec-resolvethisbinding', + ReturnIfAbrupt: 'https://ecma-international.org/ecma-262/10.0/#sec-returnifabrupt', + RunJobs: 'https://ecma-international.org/ecma-262/10.0/#sec-runjobs', + SameValue: 'https://ecma-international.org/ecma-262/10.0/#sec-samevalue', + SameValueNonNumber: 'https://ecma-international.org/ecma-262/10.0/#sec-samevaluenonnumber', + SameValueZero: 'https://ecma-international.org/ecma-262/10.0/#sec-samevaluezero', + ScriptEvaluation: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-scriptevaluation', + ScriptEvaluationJob: 'https://ecma-international.org/ecma-262/10.0/#sec-scriptevaluationjob', + SecFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-SecFromTime', + SerializeJSONArray: 'https://ecma-international.org/ecma-262/10.0/#sec-serializejsonarray', + SerializeJSONObject: 'https://ecma-international.org/ecma-262/10.0/#sec-serializejsonobject', + SerializeJSONProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-serializejsonproperty', + Set: 'https://ecma-international.org/ecma-262/10.0/#sec-set-o-p-v-throw', + SetDefaultGlobalBindings: 'https://ecma-international.org/ecma-262/10.0/#sec-setdefaultglobalbindings', + SetFunctionLength: 'https://ecma-international.org/ecma-262/10.0/#sec-setfunctionlength', + SetFunctionName: 'https://ecma-international.org/ecma-262/10.0/#sec-setfunctionname', + SetImmutablePrototype: 'https://ecma-international.org/ecma-262/10.0/#sec-set-immutable-prototype', + SetIntegrityLevel: 'https://ecma-international.org/ecma-262/10.0/#sec-setintegritylevel', + SetRealmGlobalObject: 'https://ecma-international.org/ecma-262/10.0/#sec-setrealmglobalobject', + SetValueInBuffer: 'https://ecma-international.org/ecma-262/10.0/#sec-setvalueinbuffer', + SetViewValue: 'https://ecma-international.org/ecma-262/10.0/#sec-setviewvalue', + SharedDataBlockEventSet: 'https://ecma-international.org/ecma-262/10.0/#sec-sharedatablockeventset', + SortCompare: 'https://ecma-international.org/ecma-262/10.0/#sec-sortcompare', + SpeciesConstructor: 'https://ecma-international.org/ecma-262/10.0/#sec-speciesconstructor', + SplitMatch: 'https://ecma-international.org/ecma-262/10.0/#sec-splitmatch', + 'Strict Equality Comparison': 'https://ecma-international.org/ecma-262/10.0/#sec-strict-equality-comparison', + StringCreate: 'https://ecma-international.org/ecma-262/10.0/#sec-stringcreate', + StringGetOwnProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-stringgetownproperty', + Suspend: 'https://ecma-international.org/ecma-262/10.0/#sec-suspend', + SymbolDescriptiveString: 'https://ecma-international.org/ecma-262/10.0/#sec-symboldescriptivestring', + SynchronizeEventSet: 'https://ecma-international.org/ecma-262/10.0/#sec-synchronizeeventset', + 'synchronizes-with': 'https://ecma-international.org/ecma-262/10.0/#sec-synchronizes-with', + TestIntegrityLevel: 'https://ecma-international.org/ecma-262/10.0/#sec-testintegritylevel', + thisBooleanValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thisbooleanvalue', + thisNumberValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thisnumbervalue', + thisStringValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thisstringvalue', + thisSymbolValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thissymbolvalue', + thisTimeValue: 'https://ecma-international.org/ecma-262/10.0/#sec-thistimevalue', + ThrowCompletion: 'https://ecma-international.org/ecma-262/10.0/#sec-throwcompletion', + TimeClip: 'https://ecma-international.org/ecma-262/10.0/#sec-timeclip', + TimeFromYear: 'https://ecma-international.org/ecma-262/10.0/#eqn-TimeFromYear', + TimeString: 'https://ecma-international.org/ecma-262/10.0/#sec-timestring', + TimeWithinDay: 'https://ecma-international.org/ecma-262/10.0/#eqn-TimeWithinDay', + TimeZoneString: 'https://ecma-international.org/ecma-262/10.0/#sec-timezoneestring', + ToBoolean: 'https://ecma-international.org/ecma-262/10.0/#sec-toboolean', + ToDateString: 'https://ecma-international.org/ecma-262/10.0/#sec-todatestring', + ToIndex: 'https://ecma-international.org/ecma-262/10.0/#sec-toindex', + ToInt16: 'https://ecma-international.org/ecma-262/10.0/#sec-toint16', + ToInt32: 'https://ecma-international.org/ecma-262/10.0/#sec-toint32', + ToInt8: 'https://ecma-international.org/ecma-262/10.0/#sec-toint8', + ToInteger: 'https://ecma-international.org/ecma-262/10.0/#sec-tointeger', + ToLength: 'https://ecma-international.org/ecma-262/10.0/#sec-tolength', + ToNumber: 'https://ecma-international.org/ecma-262/10.0/#sec-tonumber', + ToObject: 'https://ecma-international.org/ecma-262/10.0/#sec-toobject', + TopLevelModuleEvaluationJob: 'https://ecma-international.org/ecma-262/10.0/#sec-toplevelmoduleevaluationjob', + ToPrimitive: 'https://ecma-international.org/ecma-262/10.0/#sec-toprimitive', + ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-topropertydescriptor', + ToPropertyKey: 'https://ecma-international.org/ecma-262/10.0/#sec-topropertykey', + ToString: 'https://ecma-international.org/ecma-262/10.0/#sec-tostring', + ToUint16: 'https://ecma-international.org/ecma-262/10.0/#sec-touint16', + ToUint32: 'https://ecma-international.org/ecma-262/10.0/#sec-touint32', + ToUint8: 'https://ecma-international.org/ecma-262/10.0/#sec-touint8', + ToUint8Clamp: 'https://ecma-international.org/ecma-262/10.0/#sec-touint8clamp', + TriggerPromiseReactions: 'https://ecma-international.org/ecma-262/10.0/#sec-triggerpromisereactions', + TrimString: 'https://ecma-international.org/ecma-262/10.0/#sec-trimstring', + Type: 'https://ecma-international.org/ecma-262/10.0/#sec-ecmascript-data-types-and-values', + TypedArrayCreate: 'https://ecma-international.org/ecma-262/10.0/#typedarray-create', + TypedArraySpeciesCreate: 'https://ecma-international.org/ecma-262/10.0/#typedarray-species-create', + UnicodeEscape: 'https://ecma-international.org/ecma-262/10.0/#sec-unicodeescape', + UnicodeMatchProperty: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-unicodematchproperty-p', + UnicodeMatchPropertyValue: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-unicodematchpropertyvalue-p-v', + UpdateEmpty: 'https://ecma-international.org/ecma-262/10.0/#sec-updateempty', + UTC: 'https://ecma-international.org/ecma-262/10.0/#sec-utc-t', + UTF16Decode: 'https://ecma-international.org/ecma-262/10.0/#sec-utf16decode', + UTF16Encoding: 'https://ecma-international.org/ecma-262/10.0/#sec-utf16encoding', + ValidateAndApplyPropertyDescriptor: 'https://ecma-international.org/ecma-262/10.0/#sec-validateandapplypropertydescriptor', + ValidateAtomicAccess: 'https://ecma-international.org/ecma-262/10.0/#sec-validateatomicaccess', + ValidateSharedIntegerTypedArray: 'https://ecma-international.org/ecma-262/10.0/#sec-validatesharedintegertypedarray', + ValidateTypedArray: 'https://ecma-international.org/ecma-262/10.0/#sec-validatetypedarray', + ValueOfReadEvent: 'https://ecma-international.org/ecma-262/10.0/#sec-valueofreadevent', + WeekDay: 'https://ecma-international.org/ecma-262/10.0/#sec-week-day', + WordCharacters: 'https://ecma-international.org/ecma-262/10.0/#sec-runtime-semantics-wordcharacters-abstract-operation', + YearFromTime: 'https://ecma-international.org/ecma-262/10.0/#eqn-YearFromTime' +}; diff --git a/node_modules/es-abstract/package.json b/node_modules/es-abstract/package.json new file mode 100644 index 000000000..4b9662eb1 --- /dev/null +++ b/node_modules/es-abstract/package.json @@ -0,0 +1,110 @@ +{ + "name": "es-abstract", + "version": "1.17.6", + "author": { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "description": "ECMAScript spec abstract operations.", + "license": "MIT", + "main": "index.js", + "scripts": { + "prespackle": "git ls-files | xargs git check-attr spackled | grep -v 'unspecified$' | cut -d: -f1 | xargs rm || true", + "spackle": "node operations/spackle 1", + "postspackle": "git ls-files | xargs git check-attr spackled | grep -v 'unspecified$' | cut -d: -f1 | xargs git add", + "prepublish": "safe-publish-latest && (not-in-publish || npm run spackle)", + "pretest": "npm run lint", + "test": "npm run tests-only", + "posttest": "aud --production", + "tests-only": "node test", + "coverage": "nyc npm run tests-only >/dev/null", + "postcoverage": "nyc report", + "lint": "eslint .", + "eccheck": "eclint check *.js **/*.js > /dev/null" + }, + "repository": { + "type": "git", + "url": "git://github.com/ljharb/es-abstract.git" + }, + "keywords": [ + "ECMAScript", + "ES", + "abstract", + "operation", + "abstract operation", + "JavaScript", + "ES5", + "ES6", + "ES7" + ], + "dependencies": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + }, + "devDependencies": { + "@ljharb/eslint-config": "^17.1.0", + "array.prototype.indexof": "^1.0.0", + "aud": "^1.1.2", + "cheerio": "^1.0.0-rc.3", + "diff": "^4.0.2", + "eclint": "^2.8.1", + "eslint": "^7.2.0", + "foreach": "^2.0.5", + "functions-have-names": "^1.2.1", + "has-strict-mode": "^1.0.0", + "in-publish": "^2.0.1", + "make-arrow-function": "^1.2.0", + "nyc": "^10.3.2", + "object-is": "^1.1.2", + "object.fromentries": "^2.0.2", + "safe-publish-latest": "^1.1.4", + "tape": "^5.0.1" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "iexplore/6.0..latest", + "firefox/3.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/10.0..latest", + "opera/next", + "safari/4.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "engines": { + "node": ">= 0.4" + }, + "greenkeeper": { + "//": "nyc is ignored because it requires node 4+, and we support older than that", + "ignore": [ + "nyc" + ] + } +} \ No newline at end of file diff --git a/node_modules/es-abstract/test/GetIntrinsic.js b/node_modules/es-abstract/test/GetIntrinsic.js new file mode 100644 index 000000000..a3e69a7bc --- /dev/null +++ b/node_modules/es-abstract/test/GetIntrinsic.js @@ -0,0 +1,94 @@ +'use strict'; + +var GetIntrinsic = require('../GetIntrinsic'); + +var test = require('tape'); +var forEach = require('foreach'); +var debug = require('object-inspect'); + +var v = require('./helpers/values'); + +test('export', function (t) { + t.equal(typeof GetIntrinsic, 'function', 'it is a function'); + t.equal(GetIntrinsic.length, 2, 'function has length of 2'); + + t.end(); +}); + +test('throws', function (t) { + t['throws']( + function () { GetIntrinsic('not an intrinsic'); }, + SyntaxError, + 'nonexistent intrinsic throws a syntax error' + ); + + t['throws']( + function () { GetIntrinsic(''); }, + TypeError, + 'empty string intrinsic throws a type error' + ); + + t['throws']( + function () { GetIntrinsic('.'); }, + SyntaxError, + '"just a dot" intrinsic throws a syntax error' + ); + + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { GetIntrinsic(nonString); }, + TypeError, + debug(nonString) + ' is not a String' + ); + }); + + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { GetIntrinsic('%', nonBoolean); }, + TypeError, + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + forEach([ + 'toString', + 'propertyIsEnumerable', + 'hasOwnProperty' + ], function (objectProtoMember) { + t['throws']( + function () { GetIntrinsic(objectProtoMember); }, + SyntaxError, + debug(objectProtoMember) + ' is not an intrinsic' + ); + }); + + t.end(); +}); + +test('base intrinsics', function (t) { + t.equal(GetIntrinsic('%Object%'), Object, '%Object% yields Object'); + t.equal(GetIntrinsic('Object'), Object, 'Object yields Object'); + t.equal(GetIntrinsic('%Array%'), Array, '%Array% yields Array'); + t.equal(GetIntrinsic('Array'), Array, 'Array yields Array'); + + t.end(); +}); + +test('dotted paths', function (t) { + t.equal(GetIntrinsic('%Object.prototype.toString%'), Object.prototype.toString, '%Object.prototype.toString% yields Object.prototype.toString'); + t.equal(GetIntrinsic('Object.prototype.toString'), Object.prototype.toString, 'Object.prototype.toString yields Object.prototype.toString'); + t.equal(GetIntrinsic('%Array.prototype.push%'), Array.prototype.push, '%Array.prototype.push% yields Array.prototype.push'); + t.equal(GetIntrinsic('Array.prototype.push'), Array.prototype.push, 'Array.prototype.push yields Array.prototype.push'); + + t.end(); +}); + +test('accessors', { skip: !Object.getOwnPropertyDescriptor || typeof Map !== 'function' }, function (t) { + var actual = Object.getOwnPropertyDescriptor(Map.prototype, 'size'); + t.ok(actual, 'Map.prototype.size has a descriptor'); + t.equal(typeof actual.get, 'function', 'Map.prototype.size has a getter function'); + t.equal(GetIntrinsic('%Map.prototype.size%'), actual.get, '%Map.prototype.size% yields the getter for it'); + t.equal(GetIntrinsic('Map.prototype.size'), actual.get, 'Map.prototype.size yields the getter for it'); + + t.end(); +}); diff --git a/node_modules/es-abstract/test/diffOps.js b/node_modules/es-abstract/test/diffOps.js new file mode 100644 index 000000000..602098dd3 --- /dev/null +++ b/node_modules/es-abstract/test/diffOps.js @@ -0,0 +1,27 @@ +'use strict'; + +var keys = require('object-keys'); +var forEach = require('foreach'); +var indexOf = require('array.prototype.indexof'); + +module.exports = function diffOperations(actual, expected, expectedMissing) { + var actualKeys = keys(actual); + var expectedKeys = keys(expected); + + var extra = []; + var missing = []; + forEach(actualKeys, function (op) { + if (!(op in expected)) { + extra.push(op); + } else if (indexOf(expectedMissing, op) !== -1) { + extra.push(op); + } + }); + forEach(expectedKeys, function (op) { + if (typeof actual[op] !== 'function' && indexOf(expectedMissing, op) === -1) { + missing.push(op); + } + }); + + return { missing: missing, extra: extra }; +}; diff --git a/node_modules/es-abstract/test/es2015.js b/node_modules/es-abstract/test/es2015.js new file mode 100644 index 000000000..9bb8ec99d --- /dev/null +++ b/node_modules/es-abstract/test/es2015.js @@ -0,0 +1,150 @@ +'use strict'; + +var ES = require('../').ES2015; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2015'); + +var expectedMissing = [ + 'abs', + 'AddRestrictedFunctionProperties', + 'AllocateArrayBuffer', + 'AllocateTypedArray', + 'BoundFunctionCreate', + 'Canonicalize', + 'CharacterRange', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIterator', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateSetIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateDirectCall', + 'EvaluateNew', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetBase', + 'GetFunctionRealm', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetReferencedName', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'HasPrimitiveBase', + 'HostResolveImportedModule', + 'ImportedLocalNames', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsPropertyReference', + 'IsStrictReference', + 'IsSuperReference', + 'IsUnresolvableReference', + 'IsWordChar', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'min', + 'ModuleNamespaceCreate', + 'msPerDay', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NormalCompletion', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'ParseModule', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'sign', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'StringGetIndexProperty', + 'TriggerPromiseReactions', + 'TypedArrayFrom', + 'UpdateEmpty', + 'UTC' +]; + +require('./tests').es2015(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2015); diff --git a/node_modules/es-abstract/test/es2016.js b/node_modules/es-abstract/test/es2016.js new file mode 100644 index 000000000..611ea6a07 --- /dev/null +++ b/node_modules/es-abstract/test/es2016.js @@ -0,0 +1,173 @@ +'use strict'; + +var ES = require('../').ES2016; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2016'); + +var expectedMissing = [ + 'abs', + 'AddRestrictedFunctionProperties', + 'AllocateArrayBuffer', + 'AllocateTypedArray', + 'AllocateTypedArrayBuffer', + 'BlockDeclarationInstantiation', + 'BoundFunctionCreate', + 'Canonicalize', + 'CharacterRange', + 'CharacterRangeOrUnion', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateArrayIterator', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIterator', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateResolvingFunctions', + 'CreateSetIterator', + 'CreateStringIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EnumerateObjectProperties', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateDirectCall', + 'EvaluateNew', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionDeclarationInstantiation', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetActiveScriptOrModule', + 'GetFunctionRealm', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'GlobalDeclarationInstantiation', + 'HostPromiseRejectionTracker', + 'HostReportErrors', + 'HostResolveImportedModule', + 'IfAbruptRejectPromise', + 'ImportedLocalNames', + 'InitializeBoundName', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsWordChar', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'min', + 'ModuleNamespaceCreate', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NextJob', + 'NormalCompletion', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'OrdinaryDelete', + 'OrdinaryGet', + 'OrdinaryIsExtensible', + 'OrdinaryOwnPropertyKeys', + 'OrdinaryPreventExtensions', + 'OrdinarySet', + 'ParseModule', + 'ParseScript', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'PromiseReactionJob', + 'PromiseResolveThenableJob', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'ReturnIfAbrupt', + 'ScriptEvaluation', + 'ScriptEvaluationJob', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'TopLevelModuleEvaluationJob', + 'ToString Applied to the Number Type', + 'TriggerPromiseReactions', + 'TypedArrayCreate', + 'TypedArraySpeciesCreate', + 'UpdateEmpty', + 'UTC', + 'UTF16Decode', + 'UTF16Encoding', + 'ValidateTypedArray' +]; + +require('./tests').es2016(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2016); diff --git a/node_modules/es-abstract/test/es2017.js b/node_modules/es-abstract/test/es2017.js new file mode 100644 index 000000000..74eb38e8b --- /dev/null +++ b/node_modules/es-abstract/test/es2017.js @@ -0,0 +1,220 @@ +'use strict'; + +var ES = require('../').ES2017; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2017'); + +var expectedMissing = [ + 'abs', + 'AddWaiter', + 'agent-order', + 'AgentCanSuspend', + 'AgentSignifier', + 'AllocateArrayBuffer', + 'AllocateSharedArrayBuffer', + 'AllocateTypedArray', + 'AllocateTypedArrayBuffer', + 'AsyncFunctionAwait', + 'AsyncFunctionCreate', + 'AsyncFunctionStart', + 'AtomicLoad', + 'AtomicReadModifyWrite', + 'BlockDeclarationInstantiation', + 'BoundFunctionCreate', + 'Canonicalize', + 'CharacterRange', + 'CharacterRangeOrUnion', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'ComposeWriteEventBytes', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateArrayIterator', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIterator', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateResolvingFunctions', + 'CreateSetIterator', + 'CreateSharedByteDataBlock', + 'CreateStringIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EnterCriticalSection', + 'EnumerateObjectProperties', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateDirectCall', + 'EvaluateNew', + 'EventSet', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionDeclarationInstantiation', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetActiveScriptOrModule', + 'GetBase', + 'GetFunctionRealm', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModifySetValueInBuffer', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetReferencedName', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'GetWaiterList', + 'GlobalDeclarationInstantiation', + 'happens-before', + 'HasPrimitiveBase', + 'host-synchronizes-with', + 'HostEnsureCanCompileStrings', + 'HostEventSet', + 'HostPromiseRejectionTracker', + 'HostReportErrors', + 'HostResolveImportedModule', + 'IfAbruptRejectPromise', + 'ImportedLocalNames', + 'InitializeBoundName', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsPropertyReference', + 'IsSharedArrayBuffer', + 'IsStrictReference', + 'IsSuperReference', + 'IsUnresolvableReference', + 'IsWordChar', + 'LeaveCriticalSection', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'memory-order', + 'min', + 'ModuleNamespaceCreate', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NormalCompletion', + 'NumberToRawBytes', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'OrdinaryDelete', + 'OrdinaryGet', + 'OrdinaryIsExtensible', + 'OrdinaryOwnPropertyKeys', + 'OrdinaryPreventExtensions', + 'OrdinarySet', + 'OrdinaryToPrimitive', + 'ParseModule', + 'ParseScript', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'PromiseReactionJob', + 'PromiseResolveThenableJob', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RawBytesToNumber', + 'reads-bytes-from', + 'reads-from', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RemoveWaiter', + 'RemoveWaiters', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'ReturnIfAbrupt', + 'RunJobs', + 'ScriptEvaluation', + 'ScriptEvaluationJob', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetImmutablePrototype', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'SharedDataBlockEventSet', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'StringGetOwnProperty', + 'Suspend', + 'TopLevelModuleEvaluationJob', + 'ToString Applied to the Number Type', + 'TriggerPromiseReactions', + 'TypedArrayCreate', + 'TypedArraySpeciesCreate', + 'UpdateEmpty', + 'UTC', + 'UTF16Decode', + 'UTF16Encoding', + 'ValidateAtomicAccess', + 'ValidateSharedIntegerTypedArray', + 'ValidateTypedArray', + 'ValueOfReadEvent', + 'WakeWaiter', + 'WordCharacters', + 'AddRestrictedFunctionProperties', + 'synchronizes-with' +]; + +require('./tests').es2017(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2017); diff --git a/node_modules/es-abstract/test/es2018.js b/node_modules/es-abstract/test/es2018.js new file mode 100644 index 000000000..5ca108718 --- /dev/null +++ b/node_modules/es-abstract/test/es2018.js @@ -0,0 +1,241 @@ +'use strict'; + +var ES = require('../').ES2018; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2018'); + +var expectedMissing = [ + 'abs', + 'AddRestrictedFunctionProperties', + 'AddWaiter', + 'agent-order', + 'AgentCanSuspend', + 'AgentSignifier', + 'AllocateArrayBuffer', + 'AllocateSharedArrayBuffer', + 'AllocateTypedArray', + 'AllocateTypedArrayBuffer', + 'AsyncFunctionCreate', + 'AsyncFunctionStart', + 'AsyncGeneratorEnqueue', + 'AsyncGeneratorFunctionCreate', + 'AsyncGeneratorReject', + 'AsyncGeneratorResolve', + 'AsyncGeneratorResumeNext', + 'AsyncGeneratorStart', + 'AsyncGeneratorYield', + 'AsyncIteratorClose', + 'AtomicLoad', + 'AtomicReadModifyWrite', + 'Await', + 'BackreferenceMatcher', + 'BlockDeclarationInstantiation', + 'BoundFunctionCreate', + 'Canonicalize', + 'CaseClauseIsSelected', + 'CharacterRange', + 'CharacterRangeOrUnion', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'ComposeWriteEventBytes', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateArrayIterator', + 'CreateAsyncFromSyncIterator', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIteratorRecord', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateResolvingFunctions', + 'CreateSetIterator', + 'CreateSharedByteDataBlock', + 'CreateStringIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EnterCriticalSection', + 'EnumerateObjectProperties', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateNew', + 'EventSet', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionDeclarationInstantiation', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetActiveScriptOrModule', + 'GetBase', + 'GetFunctionRealm', + 'GetGeneratorKind', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModifySetValueInBuffer', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetReferencedName', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'GetWaiterList', + 'GlobalDeclarationInstantiation', + 'happens-before', + 'HasPrimitiveBase', + 'host-synchronizes-with', + 'HostEnsureCanCompileStrings', + 'HostEventSet', + 'HostPromiseRejectionTracker', + 'HostReportErrors', + 'HostResolveImportedModule', + 'IfAbruptRejectPromise', + 'ImportedLocalNames', + 'InitializeBoundName', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'InnerModuleEvaluation', + 'InnerModuleInstantiation', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsPropertyReference', + 'IsSharedArrayBuffer', + 'IsStrictReference', + 'IsSuperReference', + 'IsUnresolvableReference', + 'IsWordChar', + 'LeaveCriticalSection', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'memory-order', + 'min', + 'ModuleDeclarationEnvironmentSetup', + 'ModuleExecution', + 'ModuleNamespaceCreate', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NormalCompletion', + 'NumberToRawBytes', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'OrdinaryDelete', + 'OrdinaryGet', + 'OrdinaryIsExtensible', + 'OrdinaryOwnPropertyKeys', + 'OrdinaryPreventExtensions', + 'OrdinarySet', + 'OrdinarySetWithOwnDescriptor', + 'OrdinaryToPrimitive', + 'ParseModule', + 'ParseScript', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'PromiseReactionJob', + 'PromiseResolveThenableJob', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RawBytesToNumber', + 'reads-bytes-from', + 'reads-from', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RemoveWaiter', + 'RemoveWaiters', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'ReturnIfAbrupt', + 'RunJobs', + 'ScriptEvaluation', + 'ScriptEvaluationJob', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetFunctionLength', + 'SetImmutablePrototype', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'SharedDataBlockEventSet', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'StringGetOwnProperty', + 'Suspend', + 'synchronizes-with', + 'ThrowCompletion', + 'TimeZoneString', + 'TopLevelModuleEvaluationJob', + 'TriggerPromiseReactions', + 'TypedArrayCreate', + 'TypedArraySpeciesCreate', + 'UnicodeEscape', + 'UnicodeMatchProperty', + 'UnicodeMatchPropertyValue', + 'UpdateEmpty', + 'UTC', + 'UTF16Decode', + 'UTF16Encoding', + 'ValidateAtomicAccess', + 'ValidateSharedIntegerTypedArray', + 'ValidateTypedArray', + 'ValueOfReadEvent', + 'WakeWaiter', + 'WordCharacters' +]; + +require('./tests').es2018(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2018); diff --git a/node_modules/es-abstract/test/es2019.js b/node_modules/es-abstract/test/es2019.js new file mode 100644 index 000000000..c034b601e --- /dev/null +++ b/node_modules/es-abstract/test/es2019.js @@ -0,0 +1,246 @@ +'use strict'; + +var ES = require('../').ES2019; +var boundES = require('./helpers/createBoundESNamespace')(ES); + +var ops = require('../operations/2019'); + +var expectedMissing = [ + 'abs', + 'AddRestrictedFunctionProperties', + 'AddWaiter', + 'agent-order', + 'AgentCanSuspend', + 'AgentSignifier', + 'AllocateArrayBuffer', + 'AllocateSharedArrayBuffer', + 'AllocateTypedArray', + 'AllocateTypedArrayBuffer', + 'AsyncFromSyncIteratorContinuation', + 'AsyncFunctionCreate', + 'AsyncFunctionStart', + 'AsyncGeneratorEnqueue', + 'AsyncGeneratorFunctionCreate', + 'AsyncGeneratorReject', + 'AsyncGeneratorResolve', + 'AsyncGeneratorResumeNext', + 'AsyncGeneratorStart', + 'AsyncGeneratorYield', + 'AsyncIteratorClose', + 'AtomicLoad', + 'AtomicReadModifyWrite', + 'Await', + 'BackreferenceMatcher', + 'BlockDeclarationInstantiation', + 'BoundFunctionCreate', + 'Canonicalize', + 'CaseClauseIsSelected', + 'CharacterRange', + 'CharacterRangeOrUnion', + 'CharacterSetMatcher', + 'CloneArrayBuffer', + 'Completion', + 'ComposeWriteEventBytes', + 'Construct', + 'CopyDataBlockBytes', + 'CreateArrayFromList', + 'CreateArrayIterator', + 'CreateAsyncFromSyncIterator', + 'CreateBuiltinFunction', + 'CreateByteDataBlock', + 'CreateDynamicFunction', + 'CreateIntrinsics', + 'CreateListIteratorRecord', + 'CreateMapIterator', + 'CreateMappedArgumentsObject', + 'CreatePerIterationEnvironment', + 'CreateRealm', + 'CreateResolvingFunctions', + 'CreateSetIterator', + 'CreateSharedByteDataBlock', + 'CreateStringIterator', + 'CreateUnmappedArgumentsObject', + 'Decode', + 'DetachArrayBuffer', + 'Encode', + 'EnqueueJob', + 'EnterCriticalSection', + 'EnumerateObjectProperties', + 'EscapeRegExpPattern', + 'EvalDeclarationInstantiation', + 'EvaluateCall', + 'EvaluateNew', + 'EventSet', + 'ExecuteModule', + 'floor', + 'ForBodyEvaluation', + 'ForIn/OfBodyEvaluation', + 'ForIn/OfHeadEvaluation', + 'FulfillPromise', + 'FunctionAllocate', + 'FunctionCreate', + 'FunctionDeclarationInstantiation', + 'FunctionInitialize', + 'GeneratorFunctionCreate', + 'GeneratorResume', + 'GeneratorResumeAbrupt', + 'GeneratorStart', + 'GeneratorValidate', + 'GeneratorYield', + 'GetActiveScriptOrModule', + 'GetBase', + 'GetFunctionRealm', + 'GetGeneratorKind', + 'GetGlobalObject', + 'GetIdentifierReference', + 'GetModifySetValueInBuffer', + 'GetModuleNamespace', + 'GetNewTarget', + 'GetReferencedName', + 'GetSuperConstructor', + 'GetTemplateObject', + 'GetThisEnvironment', + 'GetThisValue', + 'GetValue', + 'GetValueFromBuffer', + 'GetViewValue', + 'GetWaiterList', + 'GlobalDeclarationInstantiation', + 'happens-before', + 'HasPrimitiveBase', + 'host-synchronizes-with', + 'HostEnsureCanCompileStrings', + 'HostEventSet', + 'HostPromiseRejectionTracker', + 'HostReportErrors', + 'HostResolveImportedModule', + 'IfAbruptRejectPromise', + 'ImportedLocalNames', + 'InitializeBoundName', + 'InitializeEnvironment', + 'InitializeHostDefinedRealm', + 'InitializeReferencedBinding', + 'InnerModuleEvaluation', + 'InnerModuleInstantiation', + 'IntegerIndexedElementGet', + 'IntegerIndexedElementSet', + 'IntegerIndexedObjectCreate', + 'InternalizeJSONProperty', + 'IsAnonymousFunctionDefinition', + 'IsCompatiblePropertyDescriptor', + 'IsDetachedBuffer', + 'IsInTailPosition', + 'IsLabelledFunction', + 'IsPropertyReference', + 'IsSharedArrayBuffer', + 'IsStrictReference', + 'IsSuperReference', + 'IsUnresolvableReference', + 'IsWordChar', + 'LeaveCriticalSection', + 'LocalTime', + 'LoopContinues', + 'MakeArgGetter', + 'MakeArgSetter', + 'MakeClassConstructor', + 'MakeConstructor', + 'MakeMethod', + 'MakeSuperPropertyReference', + 'max', + 'memory-order', + 'min', + 'ModuleDeclarationEnvironmentSetup', + 'ModuleExecution', + 'ModuleNamespaceCreate', + 'NewDeclarativeEnvironment', + 'NewFunctionEnvironment', + 'NewGlobalEnvironment', + 'NewModuleEnvironment', + 'NewObjectEnvironment', + 'NewPromiseCapability', + 'NormalCompletion', + 'NotifyWaiter', + 'NumberToRawBytes', + 'ObjectDefineProperties', + 'OrdinaryCallBindThis', + 'OrdinaryCallEvaluateBody', + 'OrdinaryCreateFromConstructor', + 'OrdinaryDelete', + 'OrdinaryGet', + 'OrdinaryIsExtensible', + 'OrdinaryOwnPropertyKeys', + 'OrdinaryPreventExtensions', + 'OrdinarySet', + 'OrdinarySetWithOwnDescriptor', + 'OrdinaryToPrimitive', + 'ParseModule', + 'ParseScript', + 'PerformEval', + 'PerformPromiseAll', + 'PerformPromiseRace', + 'PerformPromiseThen', + 'PrepareForOrdinaryCall', + 'PrepareForTailCall', + 'PromiseReactionJob', + 'PromiseResolveThenableJob', + 'ProxyCreate', + 'PutValue', + 'QuoteJSONString', + 'RawBytesToNumber', + 'reads-bytes-from', + 'reads-from', + 'RegExpAlloc', + 'RegExpBuiltinExec', + 'RegExpCreate', + 'RegExpInitialize', + 'RejectPromise', + 'RemoveWaiter', + 'RemoveWaiters', + 'RepeatMatcher', + 'ResolveBinding', + 'ResolveThisBinding', + 'ReturnIfAbrupt', + 'RunJobs', + 'ScriptEvaluation', + 'ScriptEvaluationJob', + 'SerializeJSONArray', + 'SerializeJSONObject', + 'SerializeJSONProperty', + 'SetDefaultGlobalBindings', + 'SetFunctionLength', + 'SetImmutablePrototype', + 'SetRealmGlobalObject', + 'SetValueInBuffer', + 'SetViewValue', + 'SharedDataBlockEventSet', + 'SortCompare', + 'SplitMatch', + 'StringCreate', + 'StringGetOwnProperty', + 'Suspend', + 'SynchronizeEventSet', + 'synchronizes-with', + 'ThrowCompletion', + 'TimeZoneString', + 'TopLevelModuleEvaluationJob', + 'TriggerPromiseReactions', + 'TypedArrayCreate', + 'TypedArraySpeciesCreate', + 'UnicodeEscape', + 'UnicodeMatchProperty', + 'UnicodeMatchPropertyValue', + 'UpdateEmpty', + 'UTC', + 'UTF16Decode', + 'UTF16Encoding', + 'ValidateAtomicAccess', + 'ValidateSharedIntegerTypedArray', + 'ValidateTypedArray', + 'ValueOfReadEvent', + 'WakeWaiter', + 'WordCharacters' +]; + +require('./tests').es2019(boundES, ops, expectedMissing); + +require('./helpers/runManifestTest')(require('tape'), ES, 2019); diff --git a/node_modules/es-abstract/test/es5.js b/node_modules/es-abstract/test/es5.js new file mode 100644 index 000000000..6647a1b2f --- /dev/null +++ b/node_modules/es-abstract/test/es5.js @@ -0,0 +1,786 @@ +'use strict'; + +var ES = require('../').ES5; +var test = require('tape'); + +var forEach = require('foreach'); +var is = require('object-is'); +var debug = require('object-inspect'); + +var v = require('./helpers/values'); + +require('./helpers/runManifestTest')(test, ES, 5); + +ES = require('./helpers/createBoundESNamespace')(ES); + +test('ToPrimitive', function (t) { + t.test('primitives', function (st) { + var testPrimitive = function (primitive) { + st.ok(is(ES.ToPrimitive(primitive), primitive), debug(primitive) + ' is returned correctly'); + }; + forEach(v.primitives, testPrimitive); + st.end(); + }); + + t.test('objects', function (st) { + st.equal(ES.ToPrimitive(v.coercibleObject), v.coercibleObject.valueOf(), 'coercibleObject coerces to valueOf'); + st.equal(ES.ToPrimitive(v.coercibleObject, Number), v.coercibleObject.valueOf(), 'coercibleObject with hint Number coerces to valueOf'); + st.equal(ES.ToPrimitive(v.coercibleObject, String), v.coercibleObject.toString(), 'coercibleObject with hint String coerces to toString'); + st.equal(ES.ToPrimitive(v.coercibleFnObject), v.coercibleFnObject.toString(), 'coercibleFnObject coerces to toString'); + st.equal(ES.ToPrimitive(v.toStringOnlyObject), v.toStringOnlyObject.toString(), 'toStringOnlyObject returns toString'); + st.equal(ES.ToPrimitive(v.valueOfOnlyObject), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject returns valueOf'); + st.equal(ES.ToPrimitive({}), '[object Object]', '{} with no hint coerces to Object#toString'); + st.equal(ES.ToPrimitive({}, String), '[object Object]', '{} with hint String coerces to Object#toString'); + st.equal(ES.ToPrimitive({}, Number), '[object Object]', '{} with hint Number coerces to Object#toString'); + st['throws'](function () { return ES.ToPrimitive(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws a TypeError'); + st['throws'](function () { return ES.ToPrimitive(v.uncoercibleFnObject); }, TypeError, 'uncoercibleFnObject throws a TypeError'); + st.end(); + }); + + t.end(); +}); + +test('ToBoolean', function (t) { + t.equal(false, ES.ToBoolean(undefined), 'undefined coerces to false'); + t.equal(false, ES.ToBoolean(null), 'null coerces to false'); + t.equal(false, ES.ToBoolean(false), 'false returns false'); + t.equal(true, ES.ToBoolean(true), 'true returns true'); + forEach([0, -0, NaN], function (falsyNumber) { + t.equal(false, ES.ToBoolean(falsyNumber), 'falsy number ' + falsyNumber + ' coerces to false'); + }); + forEach([Infinity, 42, 1, -Infinity], function (truthyNumber) { + t.equal(true, ES.ToBoolean(truthyNumber), 'truthy number ' + truthyNumber + ' coerces to true'); + }); + t.equal(false, ES.ToBoolean(''), 'empty string coerces to false'); + t.equal(true, ES.ToBoolean('foo'), 'nonempty string coerces to true'); + forEach(v.objects, function (obj) { + t.equal(true, ES.ToBoolean(obj), 'object coerces to true'); + }); + t.equal(true, ES.ToBoolean(v.uncoercibleObject), 'uncoercibleObject coerces to true'); + t.end(); +}); + +test('ToNumber', function (t) { + t.ok(is(NaN, ES.ToNumber(undefined)), 'undefined coerces to NaN'); + t.ok(is(ES.ToNumber(null), 0), 'null coerces to +0'); + t.ok(is(ES.ToNumber(false), 0), 'false coerces to +0'); + t.equal(1, ES.ToNumber(true), 'true coerces to 1'); + t.ok(is(NaN, ES.ToNumber(NaN)), 'NaN returns itself'); + forEach([0, -0, 42, Infinity, -Infinity], function (num) { + t.equal(num, ES.ToNumber(num), num + ' returns itself'); + }); + forEach(['foo', '0', '4a', '2.0', 'Infinity', '-Infinity'], function (numString) { + t.ok(is(+numString, ES.ToNumber(numString)), '"' + numString + '" coerces to ' + Number(numString)); + }); + forEach(v.objects, function (object) { + t.ok(is(ES.ToNumber(object), ES.ToNumber(ES.ToPrimitive(object))), 'object ' + object + ' coerces to same as ToPrimitive of object does'); + }); + t['throws'](function () { return ES.ToNumber(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.end(); +}); + +test('ToInteger', function (t) { + t.ok(is(0, ES.ToInteger(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity, 42], function (num) { + t.ok(is(num, ES.ToInteger(num)), num + ' returns itself'); + t.ok(is(-num, ES.ToInteger(-num)), '-' + num + ' returns itself'); + }); + t.equal(3, ES.ToInteger(Math.PI), 'pi returns 3'); + t['throws'](function () { return ES.ToInteger(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.end(); +}); + +test('ToInt32', function (t) { + t.ok(is(0, ES.ToInt32(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToInt32(num)), num + ' returns +0'); + t.ok(is(0, ES.ToInt32(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToInt32(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToInt32(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToInt32(0x100000000 - 1), -1), '2^32 - 1 returns -1'); + t.ok(is(ES.ToInt32(0x80000000), -0x80000000), '2^31 returns -2^31'); + t.ok(is(ES.ToInt32(0x80000000 - 1), 0x80000000 - 1), '2^31 - 1 returns 2^31 - 1'); + forEach([0, Infinity, NaN, 0x100000000, 0x80000000, 0x10000, 0x42], function (num) { + t.ok(is(ES.ToInt32(num), ES.ToInt32(ES.ToUint32(num))), 'ToInt32(x) === ToInt32(ToUint32(x)) for 0x' + num.toString(16)); + t.ok(is(ES.ToInt32(-num), ES.ToInt32(ES.ToUint32(-num))), 'ToInt32(x) === ToInt32(ToUint32(x)) for -0x' + num.toString(16)); + }); + t.end(); +}); + +test('ToUint32', function (t) { + t.ok(is(0, ES.ToUint32(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint32(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint32(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint32(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint32(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint32(0x100000000 - 1), 0x100000000 - 1), '2^32 - 1 returns 2^32 - 1'); + t.ok(is(ES.ToUint32(0x80000000), 0x80000000), '2^31 returns 2^31'); + t.ok(is(ES.ToUint32(0x80000000 - 1), 0x80000000 - 1), '2^31 - 1 returns 2^31 - 1'); + forEach([0, Infinity, NaN, 0x100000000, 0x80000000, 0x10000, 0x42], function (num) { + t.ok(is(ES.ToUint32(num), ES.ToUint32(ES.ToInt32(num))), 'ToUint32(x) === ToUint32(ToInt32(x)) for 0x' + num.toString(16)); + t.ok(is(ES.ToUint32(-num), ES.ToUint32(ES.ToInt32(-num))), 'ToUint32(x) === ToUint32(ToInt32(x)) for -0x' + num.toString(16)); + }); + t.end(); +}); + +test('ToUint16', function (t) { + t.ok(is(0, ES.ToUint16(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint16(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint16(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint16(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint16(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint16(0x100000000 - 1), 0x10000 - 1), '2^32 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint16(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToUint16(0x80000000 - 1), 0x10000 - 1), '2^31 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint16(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToUint16(0x10000 - 1), 0x10000 - 1), '2^16 - 1 returns 2^16 - 1'); + t.end(); +}); + +test('ToString', function (t) { + t['throws'](function () { return ES.ToString(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.end(); +}); + +test('ToObject', function (t) { + t['throws'](function () { return ES.ToObject(undefined); }, TypeError, 'undefined throws'); + t['throws'](function () { return ES.ToObject(null); }, TypeError, 'null throws'); + forEach(v.numbers, function (number) { + var obj = ES.ToObject(number); + t.equal(typeof obj, 'object', 'number ' + number + ' coerces to object'); + t.equal(true, obj instanceof Number, 'object of ' + number + ' is Number object'); + t.ok(is(obj.valueOf(), number), 'object of ' + number + ' coerces to ' + number); + }); + t.end(); +}); + +test('CheckObjectCoercible', function (t) { + t['throws'](function () { return ES.CheckObjectCoercible(undefined); }, TypeError, 'undefined throws'); + t['throws'](function () { return ES.CheckObjectCoercible(null); }, TypeError, 'null throws'); + var checkCoercible = function (value) { + t.doesNotThrow(function () { return ES.CheckObjectCoercible(value); }, debug(value) + ' does not throw'); + }; + forEach(v.objects.concat(v.nonNullPrimitives), checkCoercible); + t.end(); +}); + +test('IsCallable', function (t) { + t.equal(true, ES.IsCallable(function () {}), 'function is callable'); + var nonCallables = [/a/g, {}, Object.prototype, NaN].concat(v.primitives); + forEach(nonCallables, function (nonCallable) { + t.equal(false, ES.IsCallable(nonCallable), debug(nonCallable) + ' is not callable'); + }); + t.end(); +}); + +test('SameValue', function (t) { + t.equal(true, ES.SameValue(NaN, NaN), 'NaN is SameValue as NaN'); + t.equal(false, ES.SameValue(0, -0), '+0 is not SameValue as -0'); + forEach(v.objects.concat(v.primitives), function (val) { + t.equal(val === val, ES.SameValue(val, val), debug(val) + ' is SameValue to itself'); + }); + t.end(); +}); + +test('Type', function (t) { + t.equal(ES.Type(), 'Undefined', 'Type() is Undefined'); + t.equal(ES.Type(undefined), 'Undefined', 'Type(undefined) is Undefined'); + t.equal(ES.Type(null), 'Null', 'Type(null) is Null'); + t.equal(ES.Type(true), 'Boolean', 'Type(true) is Boolean'); + t.equal(ES.Type(false), 'Boolean', 'Type(false) is Boolean'); + t.equal(ES.Type(0), 'Number', 'Type(0) is Number'); + t.equal(ES.Type(NaN), 'Number', 'Type(NaN) is Number'); + t.equal(ES.Type('abc'), 'String', 'Type("abc") is String'); + t.equal(ES.Type(function () {}), 'Object', 'Type(function () {}) is Object'); + t.equal(ES.Type({}), 'Object', 'Type({}) is Object'); + t.end(); +}); + +test('IsPropertyDescriptor', function (t) { + forEach(v.primitives, function (primitive) { + t.equal(ES.IsPropertyDescriptor(primitive), false, debug(primitive) + ' is not a Property Descriptor'); + }); + + t.equal(ES.IsPropertyDescriptor({ invalid: true }), false, 'invalid keys not allowed on a Property Descriptor'); + + t.equal(ES.IsPropertyDescriptor({}), true, 'empty object is an incomplete Property Descriptor'); + + t.equal(ES.IsPropertyDescriptor(v.accessorDescriptor()), true, 'accessor descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.mutatorDescriptor()), true, 'mutator descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.dataDescriptor()), true, 'data descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.genericDescriptor()), true, 'generic descriptor is a Property Descriptor'); + + t['throws']( + function () { ES.IsPropertyDescriptor(v.bothDescriptor()); }, + TypeError, + 'a Property Descriptor can not be both a Data and an Accessor Descriptor' + ); + + t['throws']( + function () { ES.IsPropertyDescriptor(v.bothDescriptorWritable()); }, + TypeError, + 'a Property Descriptor can not be both a Data and an Accessor Descriptor' + ); + + t.end(); +}); + +test('IsAccessorDescriptor', function (t) { + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws'](function () { ES.IsAccessorDescriptor(primitive); }, TypeError, debug(primitive) + ' is not a Property Descriptor'); + }); + + t.equal(ES.IsAccessorDescriptor(), false, 'no value is not an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(undefined), false, 'undefined value is not an Accessor Descriptor'); + + t.equal(ES.IsAccessorDescriptor(v.accessorDescriptor()), true, 'accessor descriptor is an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.mutatorDescriptor()), true, 'mutator descriptor is an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.dataDescriptor()), false, 'data descriptor is not an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.genericDescriptor()), false, 'generic descriptor is not an Accessor Descriptor'); + + t.end(); +}); + +test('IsDataDescriptor', function (t) { + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws'](function () { ES.IsDataDescriptor(primitive); }, TypeError, debug(primitive) + ' is not a Property Descriptor'); + }); + + t.equal(ES.IsDataDescriptor(), false, 'no value is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(undefined), false, 'undefined value is not a Data Descriptor'); + + t.equal(ES.IsDataDescriptor(v.accessorDescriptor()), false, 'accessor descriptor is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.mutatorDescriptor()), false, 'mutator descriptor is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.dataDescriptor()), true, 'data descriptor is a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.genericDescriptor()), false, 'generic descriptor is not a Data Descriptor'); + + t.end(); +}); + +test('IsGenericDescriptor', function (t) { + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws']( + function () { ES.IsGenericDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsGenericDescriptor(), false, 'no value is not a Data Descriptor'); + t.equal(ES.IsGenericDescriptor(undefined), false, 'undefined value is not a Data Descriptor'); + + t.equal(ES.IsGenericDescriptor(v.accessorDescriptor()), false, 'accessor descriptor is not a generic Descriptor'); + t.equal(ES.IsGenericDescriptor(v.mutatorDescriptor()), false, 'mutator descriptor is not a generic Descriptor'); + t.equal(ES.IsGenericDescriptor(v.dataDescriptor()), false, 'data descriptor is not a generic Descriptor'); + + t.equal(ES.IsGenericDescriptor(v.genericDescriptor()), true, 'generic descriptor is a generic Descriptor'); + + t.end(); +}); + +test('FromPropertyDescriptor', function (t) { + t.equal(ES.FromPropertyDescriptor(), undefined, 'no value begets undefined'); + t.equal(ES.FromPropertyDescriptor(undefined), undefined, 'undefined value begets undefined'); + + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws']( + function () { ES.FromPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(accessor), { + get: accessor['[[Get]]'], + set: accessor['[[Set]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(mutator), { + get: mutator['[[Get]]'], + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }); + var data = v.dataDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(data), { + value: data['[[Value]]'], + writable: data['[[Writable]]'], + enumerable: !!data['[[Enumerable]]'], + configurable: !!data['[[Configurable]]'] + }); + + t['throws']( + function () { ES.FromPropertyDescriptor(v.genericDescriptor()); }, + TypeError, + 'a complete Property Descriptor is required' + ); + + t.end(); +}); + +test('ToPropertyDescriptor', function (t) { + forEach(v.nonNullPrimitives.concat(null), function (primitive) { + t['throws']( + function () { ES.ToPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + get: accessor['[[Get]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }), accessor); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }), mutator); + + var data = v.descriptors.nonConfigurable(v.dataDescriptor()); + t.deepEqual(ES.ToPropertyDescriptor({ + value: data['[[Value]]'], + writable: data['[[Writable]]'], + configurable: !!data['[[Configurable]]'] + }), data); + + var both = v.bothDescriptor(); + t['throws']( + function () { + ES.ToPropertyDescriptor({ get: both['[[Get]]'], value: both['[[Value]]'] }); + }, + TypeError, + 'data and accessor descriptors are mutually exclusive' + ); + + t['throws']( + function () { ES.ToPropertyDescriptor({ get: 'not callable' }); }, + TypeError, + '"get" must be undefined or callable' + ); + + t['throws']( + function () { ES.ToPropertyDescriptor({ set: 'not callable' }); }, + TypeError, + '"set" must be undefined or callable' + ); + + t.end(); +}); + +test('Abstract Equality Comparison', function (t) { + t.test('same types use ===', function (st) { + forEach(v.primitives.concat(v.objects), function (value) { + st.equal(ES['Abstract Equality Comparison'](value, value), value === value, debug(value) + ' is abstractly equal to itself'); + }); + st.end(); + }); + + t.test('different types coerce', function (st) { + var pairs = [ + [null, undefined], + [3, '3'], + [true, '3'], + [true, 3], + [false, 0], + [false, '0'], + [3, [3]], + ['3', [3]], + [true, [1]], + [false, [0]], + [String(v.coercibleObject), v.coercibleObject], + [Number(String(v.coercibleObject)), v.coercibleObject], + [Number(v.coercibleObject), v.coercibleObject], + [String(Number(v.coercibleObject)), v.coercibleObject] + ]; + forEach(pairs, function (pair) { + var a = pair[0]; + var b = pair[1]; + // eslint-disable-next-line eqeqeq + st.equal(ES['Abstract Equality Comparison'](a, b), a == b, debug(a) + ' == ' + debug(b)); + // eslint-disable-next-line eqeqeq + st.equal(ES['Abstract Equality Comparison'](b, a), b == a, debug(b) + ' == ' + debug(a)); + }); + st.end(); + }); + + t.end(); +}); + +test('Strict Equality Comparison', function (t) { + t.test('same types use ===', function (st) { + forEach(v.primitives.concat(v.objects), function (value) { + st.equal(ES['Strict Equality Comparison'](value, value), value === value, debug(value) + ' is strictly equal to itself'); + }); + st.end(); + }); + + t.test('different types are not ===', function (st) { + var pairs = [ + [null, undefined], + [3, '3'], + [true, '3'], + [true, 3], + [false, 0], + [false, '0'], + [3, [3]], + ['3', [3]], + [true, [1]], + [false, [0]], + [String(v.coercibleObject), v.coercibleObject], + [Number(String(v.coercibleObject)), v.coercibleObject], + [Number(v.coercibleObject), v.coercibleObject], + [String(Number(v.coercibleObject)), v.coercibleObject] + ]; + forEach(pairs, function (pair) { + var a = pair[0]; + var b = pair[1]; + st.equal(ES['Strict Equality Comparison'](a, b), a === b, debug(a) + ' === ' + debug(b)); + st.equal(ES['Strict Equality Comparison'](b, a), b === a, debug(b) + ' === ' + debug(a)); + }); + st.end(); + }); + + t.end(); +}); + +test('Abstract Relational Comparison', function (t) { + t.test('at least one operand is NaN', function (st) { + st.equal(ES['Abstract Relational Comparison'](NaN, {}, true), undefined, 'LeftFirst: first is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison']({}, NaN, true), undefined, 'LeftFirst: second is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison'](NaN, {}, false), undefined, '!LeftFirst: first is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison']({}, NaN, false), undefined, '!LeftFirst: second is NaN, returns undefined'); + st.end(); + }); + + t.equal(ES['Abstract Relational Comparison'](3, 4, true), true, 'LeftFirst: 3 is less than 4'); + t.equal(ES['Abstract Relational Comparison'](4, 3, true), false, 'LeftFirst: 3 is not less than 4'); + t.equal(ES['Abstract Relational Comparison'](3, 4, false), true, '!LeftFirst: 3 is less than 4'); + t.equal(ES['Abstract Relational Comparison'](4, 3, false), false, '!LeftFirst: 3 is not less than 4'); + + t.equal(ES['Abstract Relational Comparison']('3', '4', true), true, 'LeftFirst: "3" is less than "4"'); + t.equal(ES['Abstract Relational Comparison']('4', '3', true), false, 'LeftFirst: "3" is not less than "4"'); + t.equal(ES['Abstract Relational Comparison']('3', '4', false), true, '!LeftFirst: "3" is less than "4"'); + t.equal(ES['Abstract Relational Comparison']('4', '3', false), false, '!LeftFirst: "3" is not less than "4"'); + + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, 42, true), true, 'LeftFirst: coercible object is less than 42'); + t.equal(ES['Abstract Relational Comparison'](42, v.coercibleObject, true), false, 'LeftFirst: 42 is not less than coercible object'); + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, 42, false), true, '!LeftFirst: coercible object is less than 42'); + t.equal(ES['Abstract Relational Comparison'](42, v.coercibleObject, false), false, '!LeftFirst: 42 is not less than coercible object'); + + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, '3', true), false, 'LeftFirst: coercible object is not less than "3"'); + t.equal(ES['Abstract Relational Comparison']('3', v.coercibleObject, true), false, 'LeftFirst: "3" is not less than coercible object'); + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, '3', false), false, '!LeftFirst: coercible object is not less than "3"'); + t.equal(ES['Abstract Relational Comparison']('3', v.coercibleObject, false), false, '!LeftFirst: "3" is not less than coercible object'); + + t.end(); +}); + +test('FromPropertyDescriptor', function (t) { + t.equal(ES.FromPropertyDescriptor(), undefined, 'no value begets undefined'); + t.equal(ES.FromPropertyDescriptor(undefined), undefined, 'undefined value begets undefined'); + + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.FromPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(accessor), { + get: accessor['[[Get]]'], + set: accessor['[[Set]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(mutator), { + get: mutator['[[Get]]'], + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }); + var data = v.dataDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(data), { + value: data['[[Value]]'], + writable: data['[[Writable]]'], + enumerable: !!data['[[Enumerable]]'], + configurable: !!data['[[Configurable]]'] + }); + + t['throws']( + function () { ES.FromPropertyDescriptor(v.genericDescriptor()); }, + TypeError, + 'a complete Property Descriptor is required' + ); + + t.end(); +}); + +test('SecFromTime', function (t) { + var now = new Date(); + t.equal(ES.SecFromTime(now.getTime()), now.getUTCSeconds(), 'second from Date timestamp matches getUTCSeconds'); + t.end(); +}); + +test('MinFromTime', function (t) { + var now = new Date(); + t.equal(ES.MinFromTime(now.getTime()), now.getUTCMinutes(), 'minute from Date timestamp matches getUTCMinutes'); + t.end(); +}); + +test('HourFromTime', function (t) { + var now = new Date(); + t.equal(ES.HourFromTime(now.getTime()), now.getUTCHours(), 'hour from Date timestamp matches getUTCHours'); + t.end(); +}); + +test('msFromTime', function (t) { + var now = new Date(); + t.equal(ES.msFromTime(now.getTime()), now.getUTCMilliseconds(), 'ms from Date timestamp matches getUTCMilliseconds'); + t.end(); +}); + +var msPerSecond = 1e3; +var msPerMinute = 60 * msPerSecond; +var msPerHour = 60 * msPerMinute; +var msPerDay = 24 * msPerHour; + +test('Day', function (t) { + var time = Date.UTC(2019, 8, 10, 2, 3, 4, 5); + var add = 2.5; + var later = new Date(time + (add * msPerDay)); + + t.equal(ES.Day(later.getTime()), ES.Day(time) + Math.floor(add), 'adding 2.5 days worth of ms, gives a Day delta of 2'); + t.end(); +}); + +test('TimeWithinDay', function (t) { + var time = Date.UTC(2019, 8, 10, 2, 3, 4, 5); + var add = 2.5; + var later = new Date(time + (add * msPerDay)); + + t.equal(ES.TimeWithinDay(later.getTime()), ES.TimeWithinDay(time) + (0.5 * msPerDay), 'adding 2.5 days worth of ms, gives a TimeWithinDay delta of +0.5'); + t.end(); +}); + +test('DayFromYear', function (t) { + t.equal(ES.DayFromYear(2021) - ES.DayFromYear(2020), 366, '2021 is a leap year, has 366 days'); + t.equal(ES.DayFromYear(2020) - ES.DayFromYear(2019), 365, '2020 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2019) - ES.DayFromYear(2018), 365, '2019 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2018) - ES.DayFromYear(2017), 365, '2018 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2017) - ES.DayFromYear(2016), 366, '2017 is a leap year, has 366 days'); + + t.end(); +}); + +test('TimeFromYear', function (t) { + for (var i = 1900; i < 2100; i += 1) { + t.equal(ES.TimeFromYear(i), Date.UTC(i, 0, 1), 'TimeFromYear matches a Date object’s year: ' + i); + } + t.end(); +}); + +test('YearFromTime', function (t) { + for (var i = 1900; i < 2100; i += 1) { + t.equal(ES.YearFromTime(Date.UTC(i, 0, 1)), i, 'YearFromTime matches a Date object’s year on 1/1: ' + i); + t.equal(ES.YearFromTime(Date.UTC(i, 10, 1)), i, 'YearFromTime matches a Date object’s year on 10/1: ' + i); + } + t.end(); +}); + +test('WeekDay', function (t) { + var now = new Date(); + var today = now.getUTCDay(); + for (var i = 0; i < 7; i += 1) { + var weekDay = ES.WeekDay(now.getTime() + (i * msPerDay)); + t.equal(weekDay, (today + i) % 7, i + ' days after today (' + today + '), WeekDay is ' + weekDay); + } + t.end(); +}); + +test('DaysInYear', function (t) { + t.equal(ES.DaysInYear(2021), 365, '2021 is not a leap year'); + t.equal(ES.DaysInYear(2020), 366, '2020 is a leap year'); + t.equal(ES.DaysInYear(2019), 365, '2019 is not a leap year'); + t.equal(ES.DaysInYear(2018), 365, '2018 is not a leap year'); + t.equal(ES.DaysInYear(2017), 365, '2017 is not a leap year'); + t.equal(ES.DaysInYear(2016), 366, '2016 is a leap year'); + + t.end(); +}); + +test('InLeapYear', function (t) { + t.equal(ES.InLeapYear(Date.UTC(2021, 0, 1)), 0, '2021 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2020, 0, 1)), 1, '2020 is a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2019, 0, 1)), 0, '2019 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2018, 0, 1)), 0, '2018 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2017, 0, 1)), 0, '2017 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2016, 0, 1)), 1, '2016 is a leap year'); + + t.end(); +}); + +test('DayWithinYear', function (t) { + t.equal(ES.DayWithinYear(Date.UTC(2019, 0, 1)), 0, '1/1 is the 1st day'); + t.equal(ES.DayWithinYear(Date.UTC(2019, 11, 31)), 364, '12/31 is the 365th day in a non leap year'); + t.equal(ES.DayWithinYear(Date.UTC(2016, 11, 31)), 365, '12/31 is the 366th day in a leap year'); + + t.end(); +}); + +test('MonthFromTime', function (t) { + t.equal(ES.MonthFromTime(Date.UTC(2019, 0, 1)), 0, 'non-leap: 1/1 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 0, 31)), 0, 'non-leap: 1/31 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 1)), 1, 'non-leap: 2/1 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 28)), 1, 'non-leap: 2/28 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 29)), 2, 'non-leap: 2/29 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 2, 1)), 2, 'non-leap: 3/1 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 2, 31)), 2, 'non-leap: 3/31 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 3, 1)), 3, 'non-leap: 4/1 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 3, 30)), 3, 'non-leap: 4/30 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 4, 1)), 4, 'non-leap: 5/1 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 4, 31)), 4, 'non-leap: 5/31 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 5, 1)), 5, 'non-leap: 6/1 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 5, 30)), 5, 'non-leap: 6/30 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 6, 1)), 6, 'non-leap: 7/1 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 6, 31)), 6, 'non-leap: 7/31 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 7, 1)), 7, 'non-leap: 8/1 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 7, 30)), 7, 'non-leap: 8/30 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 8, 1)), 8, 'non-leap: 9/1 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 8, 30)), 8, 'non-leap: 9/30 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 9, 1)), 9, 'non-leap: 10/1 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 9, 31)), 9, 'non-leap: 10/31 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 10, 1)), 10, 'non-leap: 11/1 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 10, 30)), 10, 'non-leap: 11/30 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 11, 1)), 11, 'non-leap: 12/1 gives December'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 11, 31)), 11, 'non-leap: 12/31 gives December'); + + t.equal(ES.MonthFromTime(Date.UTC(2016, 0, 1)), 0, 'leap: 1/1 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 0, 31)), 0, 'leap: 1/31 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 1)), 1, 'leap: 2/1 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 28)), 1, 'leap: 2/28 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 29)), 1, 'leap: 2/29 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 2, 1)), 2, 'leap: 3/1 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 2, 31)), 2, 'leap: 3/31 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 3, 1)), 3, 'leap: 4/1 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 3, 30)), 3, 'leap: 4/30 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 4, 1)), 4, 'leap: 5/1 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 4, 31)), 4, 'leap: 5/31 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 5, 1)), 5, 'leap: 6/1 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 5, 30)), 5, 'leap: 6/30 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 6, 1)), 6, 'leap: 7/1 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 6, 31)), 6, 'leap: 7/31 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 7, 1)), 7, 'leap: 8/1 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 7, 30)), 7, 'leap: 8/30 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 8, 1)), 8, 'leap: 9/1 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 8, 30)), 8, 'leap: 9/30 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 9, 1)), 9, 'leap: 10/1 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 9, 31)), 9, 'leap: 10/31 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 10, 1)), 10, 'leap: 11/1 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 10, 30)), 10, 'leap: 11/30 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 11, 1)), 11, 'leap: 12/1 gives December'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 11, 31)), 11, 'leap: 12/31 gives December'); + t.end(); +}); + +test('DateFromTime', function (t) { + var i; + for (i = 1; i <= 28; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 1, i)), i, '2019.02.' + i + ' is date ' + i); + } + for (i = 1; i <= 29; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2016, 1, i)), i, '2016.02.' + i + ' is date ' + i); + } + for (i = 1; i <= 30; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 8, i)), i, '2019.09.' + i + ' is date ' + i); + } + for (i = 1; i <= 31; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 9, i)), i, '2019.10.' + i + ' is date ' + i); + } + t.end(); +}); + +test('MakeDay', function (t) { + var day2015 = 16687; + t.equal(ES.MakeDay(2015, 8, 9), day2015, '2015.09.09 is day 16687'); + var day2016 = day2015 + 366; // 2016 is a leap year + t.equal(ES.MakeDay(2016, 8, 9), day2016, '2015.09.09 is day 17053'); + var day2017 = day2016 + 365; + t.equal(ES.MakeDay(2017, 8, 9), day2017, '2017.09.09 is day 17418'); + var day2018 = day2017 + 365; + t.equal(ES.MakeDay(2018, 8, 9), day2018, '2018.09.09 is day 17783'); + var day2019 = day2018 + 365; + t.equal(ES.MakeDay(2019, 8, 9), day2019, '2019.09.09 is day 18148'); + t.end(); +}); + +test('MakeDate', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.MakeDate(nonFiniteNumber, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `day`'); + t.ok(is(ES.MakeDate(0, nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `time`'); + }); + t.equal(ES.MakeDate(0, 0), 0, 'zero day and zero time is zero date'); + t.equal(ES.MakeDate(0, 123), 123, 'zero day and nonzero time is a date of the "time"'); + t.equal(ES.MakeDate(1, 0), msPerDay, 'day of 1 and zero time is a date of "ms per day"'); + t.equal(ES.MakeDate(3, 0), 3 * msPerDay, 'day of 3 and zero time is a date of thrice "ms per day"'); + t.equal(ES.MakeDate(1, 123), msPerDay + 123, 'day of 1 and nonzero time is a date of "ms per day" plus the "time"'); + t.equal(ES.MakeDate(3, 123), (3 * msPerDay) + 123, 'day of 3 and nonzero time is a date of thrice "ms per day" plus the "time"'); + + t.end(); +}); + +test('MakeTime', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.MakeTime(nonFiniteNumber, 0, 0, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `hour`'); + t.ok(is(ES.MakeTime(0, nonFiniteNumber, 0, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `min`'); + t.ok(is(ES.MakeTime(0, 0, nonFiniteNumber, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `sec`'); + t.ok(is(ES.MakeTime(0, 0, 0, nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `ms`'); + }); + + t.equal( + ES.MakeTime(1.2, 2.3, 3.4, 4.5), + (1 * msPerHour) + (2 * msPerMinute) + (3 * msPerSecond) + 4, + 'all numbers are converted to integer, multiplied by the right number of ms, and summed' + ); + t.end(); +}); + +test('TimeClip', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.TimeClip(nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `time`'); + }); + t.ok(is(ES.TimeClip(8.64e15 + 1), NaN), '8.64e15 is the largest magnitude considered "finite"'); + t.ok(is(ES.TimeClip(-8.64e15 - 1), NaN), '-8.64e15 is the largest magnitude considered "finite"'); + + forEach(v.zeroes.concat([-10, 10, +new Date()]), function (time) { + t.looseEqual(ES.TimeClip(time), time, debug(time) + ' is a time of ' + debug(time)); + }); + + t.end(); +}); + +test('modulo', function (t) { + t.equal(3 % 2, 1, '+3 % 2 is +1'); + t.equal(ES.modulo(3, 2), 1, '+3 mod 2 is +1'); + + t.equal(-3 % 2, -1, '-3 % 2 is -1'); + t.equal(ES.modulo(-3, 2), 1, '-3 mod 2 is +1'); + t.end(); +}); diff --git a/node_modules/es-abstract/test/es6.js b/node_modules/es-abstract/test/es6.js new file mode 100644 index 000000000..e7c9d98a2 --- /dev/null +++ b/node_modules/es-abstract/test/es6.js @@ -0,0 +1,18 @@ +'use strict'; + +var test = require('tape'); + +var ES = require('../'); +var ES6 = ES.ES6; +var ES2015 = ES.ES2015; +var ES6entry = require('../es6'); + +test('legacy es6 export', function (t) { + t.equal(ES6, ES2015, 'main ES6 === main ES2015'); + t.end(); +}); + +test('legacy es6 entry point', function (t) { + t.equal(ES6, ES6entry, 'main ES6 === ES6 entry point'); + t.end(); +}); diff --git a/node_modules/es-abstract/test/es7.js b/node_modules/es-abstract/test/es7.js new file mode 100644 index 000000000..ee57e153b --- /dev/null +++ b/node_modules/es-abstract/test/es7.js @@ -0,0 +1,18 @@ +'use strict'; + +var test = require('tape'); + +var ES = require('../'); +var ES7 = ES.ES7; +var ES2016 = ES.ES2016; +var ES7entry = require('../es7'); + +test('legacy es7 export', function (t) { + t.equal(ES7, ES2016, 'main ES7 === main ES2016'); + t.end(); +}); + +test('legacy es7 entry point', function (t) { + t.equal(ES7, ES7entry, 'main ES7 === ES7 entry point'); + t.end(); +}); diff --git a/node_modules/es-abstract/test/helpers/OwnPropertyKeys.js b/node_modules/es-abstract/test/helpers/OwnPropertyKeys.js new file mode 100644 index 000000000..9c2b4fc44 --- /dev/null +++ b/node_modules/es-abstract/test/helpers/OwnPropertyKeys.js @@ -0,0 +1,42 @@ +'use strict'; + +var test = require('tape'); +var hasSymbols = require('has-symbols')(); + +var OwnPropertyKeys = require('../../helpers/OwnPropertyKeys'); +var defineProperty = require('./defineProperty'); + +test('OwnPropertyKeys', function (t) { + t.deepEqual(OwnPropertyKeys({ a: 1, b: 2 }).sort(), ['a', 'b'].sort(), 'returns own string keys'); + + t.test('Symbols', { skip: !hasSymbols }, function (st) { + var o = { a: 1 }; + var sym = Symbol(); + o[sym] = 2; + + st.deepEqual(OwnPropertyKeys(o), ['a', sym], 'returns own string and symbol keys'); + + st.end(); + }); + + t.test('non-enumerables', { skip: !defineProperty.oDP }, function (st) { + var o = { a: 1, b: 42, c: NaN }; + defineProperty(o, 'b', { enumerable: false, value: 42 }); + defineProperty(o, 'c', { enumerable: false, get: function () { return NaN; } }); + + if (hasSymbols) { + defineProperty(o, 'd', { enumerable: false, value: true }); + defineProperty(o, 'e', { enumerable: false, get: function () { return true; } }); + } + + st.deepEqual( + OwnPropertyKeys(o).sort(), + (hasSymbols ? ['a', 'b', 'c', 'd', 'e'] : ['a', 'b', 'c']).sort(), + 'returns non-enumerable own keys, including accessors and symbols if available' + ); + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/es-abstract/test/helpers/assertRecord.js b/node_modules/es-abstract/test/helpers/assertRecord.js new file mode 100644 index 000000000..d6a80c2bf --- /dev/null +++ b/node_modules/es-abstract/test/helpers/assertRecord.js @@ -0,0 +1,60 @@ +'use strict'; + +var forEach = require('foreach'); +var debug = require('object-inspect'); + +var assertRecord = require('../../helpers/assertRecord'); +var v = require('./values'); + +module.exports = function assertRecordTests(ES, test) { + test('Property Descriptor', function (t) { + var record = 'Property Descriptor'; + + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { assertRecord(ES.Type, record, 'arg', primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t['throws']( + function () { assertRecord(ES.Type, record, 'arg', { invalid: true }); }, + TypeError, + 'invalid keys not allowed on a Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', {}); }, + 'empty object is an incomplete Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', v.accessorDescriptor()); }, + 'accessor descriptor is a Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', v.mutatorDescriptor()); }, + 'mutator descriptor is a Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', v.dataDescriptor()); }, + 'data descriptor is a Property Descriptor' + ); + + t.doesNotThrow( + function () { assertRecord(ES.Type, record, 'arg', v.genericDescriptor()); }, + 'generic descriptor is a Property Descriptor' + ); + + t['throws']( + function () { assertRecord(ES.Type, record, 'arg', v.bothDescriptor()); }, + TypeError, + 'a Property Descriptor can not be both a Data and an Accessor Descriptor' + ); + + t.end(); + }); +}; diff --git a/node_modules/es-abstract/test/helpers/createBoundESNamespace.js b/node_modules/es-abstract/test/helpers/createBoundESNamespace.js new file mode 100644 index 000000000..880ba3d51 --- /dev/null +++ b/node_modules/es-abstract/test/helpers/createBoundESNamespace.js @@ -0,0 +1,21 @@ +'use strict'; + +var bind = require('function-bind'); + +var OwnPropertyKeys = require('../../helpers/OwnPropertyKeys'); + +module.exports = function createBoundESNamespace(ES) { + var keys = OwnPropertyKeys(ES); + var result = {}; + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var prop = ES[key]; + if (typeof prop === 'function') { + prop = bind.call(prop, undefined); + } + result[key] = prop; + } + + return result; +}; diff --git a/node_modules/es-abstract/test/helpers/defineProperty.js b/node_modules/es-abstract/test/helpers/defineProperty.js new file mode 100644 index 000000000..8f925bea8 --- /dev/null +++ b/node_modules/es-abstract/test/helpers/defineProperty.js @@ -0,0 +1,22 @@ +'use strict'; + +var oDP = Object.defineProperty; +try { + oDP({}, 'a', { value: 1 }); +} catch (e) { + // IE 8 + oDP = null; +} + +module.exports = function defineProperty(O, P, Desc) { + if (oDP) { + return oDP(O, P, Desc); + } + if ((Desc.enumerable && Desc.configurable && Desc.writable) || !(P in O)) { + O[P] = Desc.value; // eslint-disable-line no-param-reassign + return O; + } + + throw new SyntaxError('helper does not yet support this configuration'); +}; +module.exports.oDP = oDP; diff --git a/node_modules/es-abstract/test/helpers/getSymbolDescription.js b/node_modules/es-abstract/test/helpers/getSymbolDescription.js new file mode 100644 index 000000000..fbe7a7b29 --- /dev/null +++ b/node_modules/es-abstract/test/helpers/getSymbolDescription.js @@ -0,0 +1,67 @@ +'use strict'; + +var test = require('tape'); +var debug = require('object-inspect'); +var forEach = require('foreach'); +var has = require('has'); + +var v = require('./values'); +var getSymbolDescription = require('../../helpers/getSymbolDescription'); +var getInferredName = require('../../helpers/getInferredName'); + +test('getSymbolDescription', function (t) { + t.test('no symbols', { skip: v.hasSymbols }, function (st) { + st['throws']( + getSymbolDescription, + SyntaxError, + 'requires Symbol support' + ); + + st.end(); + }); + + forEach(v.nonSymbolPrimitives.concat(v.objects), function (nonSymbol) { + t['throws']( + function () { getSymbolDescription(nonSymbol); }, + v.hasSymbols ? TypeError : SyntaxError, + debug(nonSymbol) + ' is not a Symbol' + ); + }); + + t.test('with symbols', { skip: !v.hasSymbols }, function (st) { + forEach( + [ + [Symbol(), undefined], + [Symbol(undefined), undefined], + [Symbol(null), 'null'], + [Symbol.iterator, 'Symbol.iterator'], + [Symbol('foo'), 'foo'] + ], + function (pair) { + var sym = pair[0]; + var desc = pair[1]; + st.equal(getSymbolDescription(sym), desc, debug(sym) + ' description is ' + debug(desc)); + } + ); + + st.test('only possible when inference or native `Symbol.prototype.description` is supported', { + skip: !getInferredName && !has(Symbol.prototype, 'description') + }, function (s2t) { + s2t.equal(getSymbolDescription(Symbol('')), '', 'Symbol("") description is ""'); + + s2t.end(); + }); + + st.test('only possible when global symbols are supported', { + skip: !has(Symbol, 'for') || !has(Symbol, 'keyFor') + }, function (s2t) { + // eslint-disable-next-line no-restricted-properties + s2t.equal(getSymbolDescription(Symbol['for']('')), '', 'Symbol.for("") description is ""'); + s2t.end(); + }); + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/es-abstract/test/helpers/runManifestTest.js b/node_modules/es-abstract/test/helpers/runManifestTest.js new file mode 100644 index 000000000..2fdb4f216 --- /dev/null +++ b/node_modules/es-abstract/test/helpers/runManifestTest.js @@ -0,0 +1,27 @@ +'use strict'; + +var path = require('path'); +var fs = require('fs'); + +var forEach = require('foreach'); +var keys = require('object-keys'); + +module.exports = function runManifestTest(test, ES, edition) { + test('ES' + edition + ' manifest', { skip: !fs.readdirSync }, function (t) { + var files = fs.readdirSync(path.join(__dirname, '../../' + edition), 'utf-8'); + var map = { + AbstractEqualityComparison: 'Abstract Equality Comparison', + AbstractRelationalComparison: 'Abstract Relational Comparison', + StrictEqualityComparison: 'Strict Equality Comparison' + }; + forEach(files, function (file) { + var name = path.basename(file, path.extname(file)); + var actual = ES[map[name] || name]; + var expected = require(path.join(__dirname, '../../' + edition + '/', file)); // eslint-disable-line global-require + t.equal(actual, expected, 'ES["' + name + '"] === ' + file); + }); + var actualCount = keys(ES).length; + t.equal(actualCount, files.length, 'expected ' + files.length + ' files, got ' + actualCount); + t.end(); + }); +}; diff --git a/node_modules/es-abstract/test/helpers/values.js b/node_modules/es-abstract/test/helpers/values.js new file mode 100644 index 000000000..ccef743a7 --- /dev/null +++ b/node_modules/es-abstract/test/helpers/values.js @@ -0,0 +1,121 @@ +'use strict'; + +var assign = require('../../helpers/assign'); + +var hasSymbols = require('has-symbols')(); + +var coercibleObject = { valueOf: function () { return 3; }, toString: function () { return 42; } }; +var coercibleFnObject = { + valueOf: function () { return function valueOfFn() {}; }, + toString: function () { return 42; } +}; +var valueOfOnlyObject = { valueOf: function () { return 4; }, toString: function () { return {}; } }; +var toStringOnlyObject = { valueOf: function () { return {}; }, toString: function () { return 7; } }; +var uncoercibleObject = { valueOf: function () { return {}; }, toString: function () { return {}; } }; +var uncoercibleFnObject = { + valueOf: function () { return function valueOfFn() {}; }, + toString: function () { return function toStrFn() {}; } +}; +var objects = [{}, coercibleObject, coercibleFnObject, toStringOnlyObject, valueOfOnlyObject]; +var nullPrimitives = [undefined, null]; +var nonIntegerNumbers = [-1.3, 0.2, 1.8, 1 / 3]; +var zeroes = [0, -0]; +var infinities = [Infinity, -Infinity]; +var numbers = zeroes.concat([42], infinities, nonIntegerNumbers); +var strings = ['', 'foo', 'a\uD83D\uDCA9c']; +var booleans = [true, false]; +var symbols = hasSymbols ? [Symbol.iterator, Symbol('foo')] : []; +var nonSymbolPrimitives = [].concat(nullPrimitives, booleans, strings, numbers); +var nonNumberPrimitives = [].concat(nullPrimitives, booleans, strings, symbols); +var nonNullPrimitives = [].concat(booleans, strings, numbers, symbols); +var nonUndefinedPrimitives = [].concat(null, nonNullPrimitives); +var nonStrings = [].concat(nullPrimitives, booleans, numbers, symbols, objects); +var primitives = [].concat(nullPrimitives, nonNullPrimitives); +var nonPropertyKeys = [].concat(nullPrimitives, booleans, numbers, objects); +var propertyKeys = [].concat(strings, symbols); +var nonBooleans = [].concat(nullPrimitives, strings, symbols, numbers, objects); +var falsies = [].concat(nullPrimitives, false, '', 0, -0, NaN); +var truthies = [].concat(true, 'foo', 42, symbols, objects); +var timestamps = [].concat(0, 946713600000, 1546329600000); +var nonFunctions = [].concat(primitives, objects, [42]); +var nonArrays = [].concat(nonFunctions); + +var descriptors = { + configurable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Configurable]]': true }); + }, + nonConfigurable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Configurable]]': false }); + }, + enumerable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Enumerable]]': true }); + }, + nonEnumerable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Enumerable]]': false }); + }, + writable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Writable]]': true }); + }, + nonWritable: function (descriptor) { + return assign(assign({}, descriptor), { '[[Writable]]': false }); + } +}; + +module.exports = { + coercibleObject: coercibleObject, + coercibleFnObject: coercibleFnObject, + valueOfOnlyObject: valueOfOnlyObject, + toStringOnlyObject: toStringOnlyObject, + uncoercibleObject: uncoercibleObject, + uncoercibleFnObject: uncoercibleFnObject, + objects: objects, + nonFunctions: nonFunctions, + nonArrays: nonArrays, + nullPrimitives: nullPrimitives, + numbers: numbers, + zeroes: zeroes, + infinities: infinities, + strings: strings, + booleans: booleans, + symbols: symbols, + hasSymbols: hasSymbols, + nonSymbolPrimitives: nonSymbolPrimitives, + nonNumberPrimitives: nonNumberPrimitives, + nonNullPrimitives: nonNullPrimitives, + nonUndefinedPrimitives: nonUndefinedPrimitives, + nonStrings: nonStrings, + nonNumbers: nonNumberPrimitives.concat(objects), + nonIntegerNumbers: nonIntegerNumbers, + primitives: primitives, + nonPropertyKeys: nonPropertyKeys, + propertyKeys: propertyKeys, + nonBooleans: nonBooleans, + falsies: falsies, + truthies: truthies, + timestamps: timestamps, + bothDescriptor: function () { + return { '[[Get]]': function () {}, '[[Value]]': true }; + }, + bothDescriptorWritable: function () { + return descriptors.writable({ '[[Get]]': function () {} }); + }, + accessorDescriptor: function (value) { + return descriptors.enumerable(descriptors.configurable({ + '[[Get]]': function get() { return value; } + })); + }, + mutatorDescriptor: function () { + return descriptors.enumerable(descriptors.configurable({ + '[[Set]]': function () {} + })); + }, + dataDescriptor: function (value) { + return descriptors.nonWritable({ + '[[Value]]': arguments.length > 0 ? value : 42 + }); + }, + genericDescriptor: function () { + return descriptors.configurable(descriptors.nonEnumerable()); + }, + descriptors: descriptors +}; diff --git a/node_modules/es-abstract/test/index.js b/node_modules/es-abstract/test/index.js new file mode 100644 index 000000000..3f1adba9f --- /dev/null +++ b/node_modules/es-abstract/test/index.js @@ -0,0 +1,35 @@ +'use strict'; + +var ES = require('../'); +var test = require('tape'); +var keys = require('object-keys'); +var forEach = require('foreach'); + +var ESkeys = keys(ES).sort(); +var ES6keys = keys(ES.ES6).sort(); + +test('exposed properties', function (t) { + t.deepEqual(ESkeys, ES6keys.concat(['ES2019', 'ES2018', 'ES2017', 'ES7', 'ES2016', 'ES6', 'ES2015', 'ES5']).sort(), 'main ES object keys match ES6 keys'); + t.end(); +}); + +test('methods match', function (t) { + forEach(ES6keys, function (key) { + t.equal(ES.ES6[key], ES[key], 'method ' + key + ' on main ES object is ES6 method'); + }); + t.end(); +}); + +require('./GetIntrinsic'); + +require('./helpers/getSymbolDescription'); +require('./helpers/OwnPropertyKeys'); + +require('./es5'); +require('./es6'); +require('./es2015'); +require('./es7'); +require('./es2016'); +require('./es2017'); +require('./es2018'); +require('./es2019'); diff --git a/node_modules/es-abstract/test/tests.js b/node_modules/es-abstract/test/tests.js new file mode 100644 index 000000000..844846f04 --- /dev/null +++ b/node_modules/es-abstract/test/tests.js @@ -0,0 +1,4193 @@ +'use strict'; + +var test = require('tape'); + +var forEach = require('foreach'); +var is = require('object-is'); +var debug = require('object-inspect'); +var assign = require('object.assign'); +var keys = require('object-keys'); +var has = require('has'); +var arrowFns = require('make-arrow-function').list(); +var hasStrictMode = require('has-strict-mode')(); +var functionsHaveNames = require('functions-have-names')(); +var functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames(); + +var $getProto = require('../helpers/getProto'); +var $setProto = require('../helpers/setProto'); +var defineProperty = require('./helpers/defineProperty'); +var getInferredName = require('../helpers/getInferredName'); +var getOwnPropertyDescriptor = require('../helpers/getOwnPropertyDescriptor'); +var assertRecordTests = require('./helpers/assertRecord'); +var v = require('./helpers/values'); +var diffOps = require('./diffOps'); + +var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1; + +var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false + +// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated +var noThrowOnStrictViolation = (function () { + try { + delete [].length; + return true; + } catch (e) { + return false; + } +}()); + +var getArraySubclassWithSpeciesConstructor = function getArraySubclass(speciesConstructor) { + var Bar = function Bar() { + var inst = []; + Object.setPrototypeOf(inst, Bar.prototype); + defineProperty(inst, 'constructor', { value: Bar }); + return inst; + }; + Bar.prototype = Object.create(Array.prototype); + Object.setPrototypeOf(Bar, Array); + defineProperty(Bar, Symbol.species, { value: speciesConstructor }); + + return Bar; +}; + +var testIterator = function (t, iterator, expected) { + var resultCount = 0; + var result; + while (result = iterator.next(), !result.done) { // eslint-disable-line no-sequences + t.deepEqual(result, { done: false, value: expected[resultCount] }, 'result ' + resultCount); + resultCount += 1; + } + t.equal(resultCount, expected.length, 'expected ' + expected.length + ', got ' + resultCount); +}; + +var hasSpecies = v.hasSymbols && Symbol.species; + +var hasLastIndex = 'lastIndex' in (/a/).exec('a'); // IE 8 +var hasGroups = 'groups' in (/a/).exec('a'); // modern engines +var kludgeMatch = function kludgeMatch(R, matchObject) { + if (hasGroups) { + assign(matchObject, { groups: matchObject.groups }); + } + if (hasLastIndex) { + assign(matchObject, { lastIndex: R.lastIndex }); + } + return matchObject; +}; + +var testEnumerableOwnNames = function (t, enumerableOwnNames) { + forEach(v.primitives, function (nonObject) { + t['throws']( + function () { enumerableOwnNames(nonObject); }, + debug(nonObject) + ' is not an Object' + ); + }); + + var Child = function Child() { + this.own = {}; + }; + Child.prototype = { + inherited: {} + }; + + var obj = new Child(); + + t.equal('own' in obj, true, 'has "own"'); + t.equal(has(obj, 'own'), true, 'has own "own"'); + t.equal(Object.prototype.propertyIsEnumerable.call(obj, 'own'), true, 'has enumerable "own"'); + + t.equal('inherited' in obj, true, 'has "inherited"'); + t.equal(has(obj, 'inherited'), false, 'has non-own "inherited"'); + t.equal(has(Child.prototype, 'inherited'), true, 'Child.prototype has own "inherited"'); + t.equal(Child.prototype.inherited, obj.inherited, 'Child.prototype.inherited === obj.inherited'); + t.equal(Object.prototype.propertyIsEnumerable.call(Child.prototype, 'inherited'), true, 'has enumerable "inherited"'); + + t.equal('toString' in obj, true, 'has "toString"'); + t.equal(has(obj, 'toString'), false, 'has non-own "toString"'); + t.equal(has(Object.prototype, 'toString'), true, 'Object.prototype has own "toString"'); + t.equal(Object.prototype.toString, obj.toString, 'Object.prototype.toString === obj.toString'); + // eslint-disable-next-line no-useless-call + t.equal(Object.prototype.propertyIsEnumerable.call(Object.prototype, 'toString'), false, 'has non-enumerable "toString"'); + + return obj; +}; + +var es2015 = function ES2015(ES, ops, expectedMissing, skips) { + test('has expected operations', function (t) { + var diff = diffOps(ES, ops, expectedMissing); + + t.deepEqual(diff.extra, [], 'no extra ops'); + + t.deepEqual(diff.missing, [], 'no unexpected missing ops'); + + t.end(); + }); + + test('ToPrimitive', function (t) { + t.test('primitives', function (st) { + var testPrimitive = function (primitive) { + st.ok(is(ES.ToPrimitive(primitive), primitive), debug(primitive) + ' is returned correctly'); + }; + forEach(v.primitives, testPrimitive); + st.end(); + }); + + t.test('objects', function (st) { + st.equal(ES.ToPrimitive(v.coercibleObject), 3, 'coercibleObject with no hint coerces to valueOf'); + st.ok(is(ES.ToPrimitive({}), '[object Object]'), '{} with no hint coerces to Object#toString'); + st.equal(ES.ToPrimitive(v.coercibleObject, Number), 3, 'coercibleObject with hint Number coerces to valueOf'); + st.ok(is(ES.ToPrimitive({}, Number), '[object Object]'), '{} with hint Number coerces to NaN'); + st.equal(ES.ToPrimitive(v.coercibleObject, String), 42, 'coercibleObject with hint String coerces to nonstringified toString'); + st.equal(ES.ToPrimitive({}, String), '[object Object]', '{} with hint String coerces to Object#toString'); + st.equal(ES.ToPrimitive(v.toStringOnlyObject), 7, 'toStringOnlyObject returns non-stringified toString'); + st.equal(ES.ToPrimitive(v.valueOfOnlyObject), 4, 'valueOfOnlyObject returns valueOf'); + st['throws'](function () { return ES.ToPrimitive(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws a TypeError'); + st.end(); + }); + + t.test('dates', function (st) { + var invalid = new Date(NaN); + st.equal(ES.ToPrimitive(invalid), Date.prototype.toString.call(invalid), 'invalid Date coerces to Date#toString'); + var now = new Date(); + st.equal(ES.ToPrimitive(now), Date.prototype.toString.call(now), 'Date coerces to Date#toString'); + st.end(); + }); + + t.end(); + }); + + test('ToBoolean', function (t) { + t.equal(false, ES.ToBoolean(undefined), 'undefined coerces to false'); + t.equal(false, ES.ToBoolean(null), 'null coerces to false'); + t.equal(false, ES.ToBoolean(false), 'false returns false'); + t.equal(true, ES.ToBoolean(true), 'true returns true'); + + t.test('numbers', function (st) { + forEach(v.zeroes.concat(NaN), function (falsyNumber) { + st.equal(false, ES.ToBoolean(falsyNumber), 'falsy number ' + falsyNumber + ' coerces to false'); + }); + forEach(v.infinities.concat([42, 1]), function (truthyNumber) { + st.equal(true, ES.ToBoolean(truthyNumber), 'truthy number ' + truthyNumber + ' coerces to true'); + }); + + st.end(); + }); + + t.equal(false, ES.ToBoolean(''), 'empty string coerces to false'); + t.equal(true, ES.ToBoolean('foo'), 'nonempty string coerces to true'); + + t.test('objects', function (st) { + forEach(v.objects, function (obj) { + st.equal(true, ES.ToBoolean(obj), 'object coerces to true'); + }); + st.equal(true, ES.ToBoolean(v.uncoercibleObject), 'uncoercibleObject coerces to true'); + + st.end(); + }); + + t.end(); + }); + + test('ToNumber', function (t) { + t.ok(is(NaN, ES.ToNumber(undefined)), 'undefined coerces to NaN'); + t.ok(is(ES.ToNumber(null), 0), 'null coerces to +0'); + t.ok(is(ES.ToNumber(false), 0), 'false coerces to +0'); + t.equal(1, ES.ToNumber(true), 'true coerces to 1'); + + t.test('numbers', function (st) { + st.ok(is(NaN, ES.ToNumber(NaN)), 'NaN returns itself'); + forEach(v.zeroes.concat(v.infinities, 42), function (num) { + st.equal(num, ES.ToNumber(num), num + ' returns itself'); + }); + forEach(['foo', '0', '4a', '2.0', 'Infinity', '-Infinity'], function (numString) { + st.ok(is(+numString, ES.ToNumber(numString)), '"' + numString + '" coerces to ' + Number(numString)); + }); + st.end(); + }); + + t.test('objects', function (st) { + forEach(v.objects, function (object) { + st.ok(is(ES.ToNumber(object), ES.ToNumber(ES.ToPrimitive(object))), 'object ' + object + ' coerces to same as ToPrimitive of object does'); + }); + st['throws'](function () { return ES.ToNumber(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + st.end(); + }); + + t.test('binary literals', function (st) { + st.equal(ES.ToNumber('0b10'), 2, '0b10 is 2'); + st.equal(ES.ToNumber({ toString: function () { return '0b11'; } }), 3, 'Object that toStrings to 0b11 is 3'); + + st.equal(true, is(ES.ToNumber('0b12'), NaN), '0b12 is NaN'); + st.equal(true, is(ES.ToNumber({ toString: function () { return '0b112'; } }), NaN), 'Object that toStrings to 0b112 is NaN'); + st.end(); + }); + + t.test('octal literals', function (st) { + st.equal(ES.ToNumber('0o10'), 8, '0o10 is 8'); + st.equal(ES.ToNumber({ toString: function () { return '0o11'; } }), 9, 'Object that toStrings to 0o11 is 9'); + + st.equal(true, is(ES.ToNumber('0o18'), NaN), '0o18 is NaN'); + st.equal(true, is(ES.ToNumber({ toString: function () { return '0o118'; } }), NaN), 'Object that toStrings to 0o118 is NaN'); + st.end(); + }); + + t.test('signed hex numbers', function (st) { + st.equal(true, is(ES.ToNumber('-0xF'), NaN), '-0xF is NaN'); + st.equal(true, is(ES.ToNumber(' -0xF '), NaN), 'space-padded -0xF is NaN'); + st.equal(true, is(ES.ToNumber('+0xF'), NaN), '+0xF is NaN'); + st.equal(true, is(ES.ToNumber(' +0xF '), NaN), 'space-padded +0xF is NaN'); + + st.end(); + }); + + t.test('trimming of whitespace and non-whitespace characters', function (st) { + var whitespace = ' \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000'; + st.equal(0, ES.ToNumber(whitespace + 0 + whitespace), 'whitespace is trimmed'); + + // Zero-width space (zws), next line character (nel), and non-character (bom) are not whitespace. + var nonWhitespaces = { + '\\u0085': '\u0085', + '\\u200b': '\u200b', + '\\ufffe': '\ufffe' + }; + + forEach(nonWhitespaces, function (desc, nonWS) { + st.equal(true, is(ES.ToNumber(nonWS + 0 + nonWS), NaN), 'non-whitespace ' + desc + ' not trimmed'); + }); + + st.end(); + }); + + forEach(v.symbols, function (symbol) { + t['throws']( + function () { ES.ToNumber(symbol); }, + TypeError, + 'Symbols can’t be converted to a Number: ' + debug(symbol) + ); + }); + + t.test('dates', function (st) { + var invalid = new Date(NaN); + st.ok(is(ES.ToNumber(invalid), NaN), 'invalid Date coerces to NaN'); + var now = +new Date(); + st.equal(ES.ToNumber(new Date(now)), now, 'Date coerces to timestamp'); + st.end(); + }); + + t.end(); + }); + + test('ToInteger', function (t) { + t.ok(is(0, ES.ToInteger(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity, 42], function (num) { + t.ok(is(num, ES.ToInteger(num)), num + ' returns itself'); + t.ok(is(-num, ES.ToInteger(-num)), '-' + num + ' returns itself'); + }); + t.equal(3, ES.ToInteger(Math.PI), 'pi returns 3'); + t['throws'](function () { return ES.ToInteger(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.end(); + }); + + test('ToInt32', function (t) { + t.ok(is(0, ES.ToInt32(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToInt32(num)), num + ' returns +0'); + t.ok(is(0, ES.ToInt32(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToInt32(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToInt32(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToInt32(0x100000000 - 1), -1), '2^32 - 1 returns -1'); + t.ok(is(ES.ToInt32(0x80000000), -0x80000000), '2^31 returns -2^31'); + t.ok(is(ES.ToInt32(0x80000000 - 1), 0x80000000 - 1), '2^31 - 1 returns 2^31 - 1'); + forEach([0, Infinity, NaN, 0x100000000, 0x80000000, 0x10000, 0x42], function (num) { + t.ok(is(ES.ToInt32(num), ES.ToInt32(ES.ToUint32(num))), 'ToInt32(x) === ToInt32(ToUint32(x)) for 0x' + num.toString(16)); + t.ok(is(ES.ToInt32(-num), ES.ToInt32(ES.ToUint32(-num))), 'ToInt32(x) === ToInt32(ToUint32(x)) for -0x' + num.toString(16)); + }); + t.end(); + }); + + test('ToUint32', function (t) { + t.ok(is(0, ES.ToUint32(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint32(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint32(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint32(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint32(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint32(0x100000000 - 1), 0x100000000 - 1), '2^32 - 1 returns 2^32 - 1'); + t.ok(is(ES.ToUint32(0x80000000), 0x80000000), '2^31 returns 2^31'); + t.ok(is(ES.ToUint32(0x80000000 - 1), 0x80000000 - 1), '2^31 - 1 returns 2^31 - 1'); + forEach([0, Infinity, NaN, 0x100000000, 0x80000000, 0x10000, 0x42], function (num) { + t.ok(is(ES.ToUint32(num), ES.ToUint32(ES.ToInt32(num))), 'ToUint32(x) === ToUint32(ToInt32(x)) for 0x' + num.toString(16)); + t.ok(is(ES.ToUint32(-num), ES.ToUint32(ES.ToInt32(-num))), 'ToUint32(x) === ToUint32(ToInt32(x)) for -0x' + num.toString(16)); + }); + t.end(); + }); + + test('ToInt16', function (t) { + t.ok(is(0, ES.ToInt16(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToInt16(num)), num + ' returns +0'); + t.ok(is(0, ES.ToInt16(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToInt16(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToInt16(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToInt16(0x100000000 - 1), -1), '2^32 - 1 returns -1'); + t.ok(is(ES.ToInt16(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToInt16(0x80000000 - 1), -1), '2^31 - 1 returns -1'); + t.ok(is(ES.ToInt16(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToInt16(0x10000 - 1), -1), '2^16 - 1 returns -1'); + t.end(); + }); + + test('ToUint16', function (t) { + t.ok(is(0, ES.ToUint16(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint16(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint16(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint16(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint16(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint16(0x100000000 - 1), 0x10000 - 1), '2^32 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint16(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToUint16(0x80000000 - 1), 0x10000 - 1), '2^31 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint16(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToUint16(0x10000 - 1), 0x10000 - 1), '2^16 - 1 returns 2^16 - 1'); + t.end(); + }); + + test('ToInt8', function (t) { + t.ok(is(0, ES.ToInt8(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToInt8(num)), num + ' returns +0'); + t.ok(is(0, ES.ToInt8(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToInt8(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToInt8(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToInt8(0x100000000 - 1), -1), '2^32 - 1 returns -1'); + t.ok(is(ES.ToInt8(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToInt8(0x80000000 - 1), -1), '2^31 - 1 returns -1'); + t.ok(is(ES.ToInt8(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToInt8(0x10000 - 1), -1), '2^16 - 1 returns -1'); + t.ok(is(ES.ToInt8(0x100), 0), '2^8 returns +0'); + t.ok(is(ES.ToInt8(0x100 - 1), -1), '2^8 - 1 returns -1'); + t.ok(is(ES.ToInt8(0x10), 0x10), '2^4 returns 2^4'); + t.end(); + }); + + test('ToUint8', function (t) { + t.ok(is(0, ES.ToUint8(NaN)), 'NaN coerces to +0'); + forEach([0, Infinity], function (num) { + t.ok(is(0, ES.ToUint8(num)), num + ' returns +0'); + t.ok(is(0, ES.ToUint8(-num)), '-' + num + ' returns +0'); + }); + t['throws'](function () { return ES.ToUint8(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + t.ok(is(ES.ToUint8(0x100000000), 0), '2^32 returns +0'); + t.ok(is(ES.ToUint8(0x100000000 - 1), 0x100 - 1), '2^32 - 1 returns 2^8 - 1'); + t.ok(is(ES.ToUint8(0x80000000), 0), '2^31 returns +0'); + t.ok(is(ES.ToUint8(0x80000000 - 1), 0x100 - 1), '2^31 - 1 returns 2^8 - 1'); + t.ok(is(ES.ToUint8(0x10000), 0), '2^16 returns +0'); + t.ok(is(ES.ToUint8(0x10000 - 1), 0x100 - 1), '2^16 - 1 returns 2^8 - 1'); + t.ok(is(ES.ToUint8(0x100), 0), '2^8 returns +0'); + t.ok(is(ES.ToUint8(0x100 - 1), 0x100 - 1), '2^8 - 1 returns 2^16 - 1'); + t.ok(is(ES.ToUint8(0x10), 0x10), '2^4 returns 2^4'); + t.ok(is(ES.ToUint8(0x10 - 1), 0x10 - 1), '2^4 - 1 returns 2^4 - 1'); + t.end(); + }); + + test('ToUint8Clamp', function (t) { + t.ok(is(0, ES.ToUint8Clamp(NaN)), 'NaN coerces to +0'); + t.ok(is(0, ES.ToUint8Clamp(0)), '+0 returns +0'); + t.ok(is(0, ES.ToUint8Clamp(-0)), '-0 returns +0'); + t.ok(is(0, ES.ToUint8Clamp(-Infinity)), '-Infinity returns +0'); + t['throws'](function () { return ES.ToUint8Clamp(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + forEach([255, 256, 0x100000, Infinity], function (number) { + t.ok(is(255, ES.ToUint8Clamp(number)), number + ' coerces to 255'); + }); + t.equal(1, ES.ToUint8Clamp(1.49), '1.49 coerces to 1'); + t.equal(2, ES.ToUint8Clamp(1.5), '1.5 coerces to 2, because 2 is even'); + t.equal(2, ES.ToUint8Clamp(1.51), '1.51 coerces to 2'); + + t.equal(2, ES.ToUint8Clamp(2.49), '2.49 coerces to 2'); + t.equal(2, ES.ToUint8Clamp(2.5), '2.5 coerces to 2, because 2 is even'); + t.equal(3, ES.ToUint8Clamp(2.51), '2.51 coerces to 3'); + t.end(); + }); + + test('ToString', function (t) { + forEach(v.objects.concat(v.nonSymbolPrimitives), function (item) { + t.equal(ES.ToString(item), String(item), 'ES.ToString(' + debug(item) + ') ToStrings to String(' + debug(item) + ')'); + }); + + t['throws'](function () { return ES.ToString(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws'); + + forEach(v.symbols, function (symbol) { + t['throws'](function () { return ES.ToString(symbol); }, TypeError, debug(symbol) + ' throws'); + }); + t.end(); + }); + + test('ToObject', function (t) { + t['throws'](function () { return ES.ToObject(undefined); }, TypeError, 'undefined throws'); + t['throws'](function () { return ES.ToObject(null); }, TypeError, 'null throws'); + forEach(v.numbers, function (number) { + var obj = ES.ToObject(number); + t.equal(typeof obj, 'object', 'number ' + number + ' coerces to object'); + t.equal(true, obj instanceof Number, 'object of ' + number + ' is Number object'); + t.ok(is(obj.valueOf(), number), 'object of ' + number + ' coerces to ' + number); + }); + t.end(); + }); + + test('RequireObjectCoercible', function (t) { + t.equal(false, 'CheckObjectCoercible' in ES, 'CheckObjectCoercible -> RequireObjectCoercible in ES6'); + t['throws'](function () { return ES.RequireObjectCoercible(undefined); }, TypeError, 'undefined throws'); + t['throws'](function () { return ES.RequireObjectCoercible(null); }, TypeError, 'null throws'); + var isCoercible = function (value) { + t.doesNotThrow(function () { return ES.RequireObjectCoercible(value); }, debug(value) + ' does not throw'); + }; + forEach(v.objects.concat(v.nonNullPrimitives), isCoercible); + t.end(); + }); + + test('IsCallable', function (t) { + t.equal(true, ES.IsCallable(function () {}), 'function is callable'); + var nonCallables = [/a/g, {}, Object.prototype, NaN].concat(v.nonFunctions); + forEach(nonCallables, function (nonCallable) { + t.equal(false, ES.IsCallable(nonCallable), debug(nonCallable) + ' is not callable'); + }); + t.end(); + }); + + test('SameValue', function (t) { + t.equal(true, ES.SameValue(NaN, NaN), 'NaN is SameValue as NaN'); + t.equal(false, ES.SameValue(0, -0), '+0 is not SameValue as -0'); + forEach(v.objects.concat(v.primitives), function (val) { + t.equal(val === val, ES.SameValue(val, val), debug(val) + ' is SameValue to itself'); + }); + t.end(); + }); + + test('SameValueZero', function (t) { + t.equal(true, ES.SameValueZero(NaN, NaN), 'NaN is SameValueZero as NaN'); + t.equal(true, ES.SameValueZero(0, -0), '+0 is SameValueZero as -0'); + forEach(v.objects.concat(v.primitives), function (val) { + t.equal(val === val, ES.SameValueZero(val, val), debug(val) + ' is SameValueZero to itself'); + }); + t.end(); + }); + + test('ToPropertyKey', function (t) { + forEach(v.objects.concat(v.nonSymbolPrimitives), function (value) { + t.equal(ES.ToPropertyKey(value), String(value), 'ToPropertyKey(value) === String(value) for non-Symbols'); + }); + + forEach(v.symbols, function (symbol) { + t.equal( + ES.ToPropertyKey(symbol), + symbol, + 'ToPropertyKey(' + debug(symbol) + ') === ' + debug(symbol) + ); + t.equal( + ES.ToPropertyKey(Object(symbol)), + symbol, + 'ToPropertyKey(' + debug(Object(symbol)) + ') === ' + debug(symbol) + ); + }); + + t.end(); + }); + + test('ToLength', function (t) { + t['throws'](function () { return ES.ToLength(v.uncoercibleObject); }, TypeError, 'uncoercibleObject throws a TypeError'); + t.equal(3, ES.ToLength(v.coercibleObject), 'coercibleObject coerces to 3'); + t.equal(42, ES.ToLength('42.5'), '"42.5" coerces to 42'); + t.equal(7, ES.ToLength(7.3), '7.3 coerces to 7'); + forEach([-0, -1, -42, -Infinity], function (negative) { + t.ok(is(0, ES.ToLength(negative)), negative + ' coerces to +0'); + }); + t.equal(MAX_SAFE_INTEGER, ES.ToLength(MAX_SAFE_INTEGER + 1), '2^53 coerces to 2^53 - 1'); + t.equal(MAX_SAFE_INTEGER, ES.ToLength(MAX_SAFE_INTEGER + 3), '2^53 + 2 coerces to 2^53 - 1'); + t.end(); + }); + + test('IsArray', function (t) { + t.equal(true, ES.IsArray([]), '[] is array'); + t.equal(false, ES.IsArray({}), '{} is not array'); + t.equal(false, ES.IsArray({ length: 1, 0: true }), 'arraylike object is not array'); + forEach(v.objects.concat(v.primitives), function (value) { + t.equal(false, ES.IsArray(value), debug(value) + ' is not array'); + }); + t.end(); + }); + + test('IsRegExp', function (t) { + forEach([/a/g, new RegExp('a', 'g')], function (regex) { + t.equal(true, ES.IsRegExp(regex), regex + ' is regex'); + }); + + forEach(v.objects.concat(v.primitives), function (nonRegex) { + t.equal(false, ES.IsRegExp(nonRegex), debug(nonRegex) + ' is not regex'); + }); + + t.test('Symbol.match', { skip: !v.hasSymbols || !Symbol.match }, function (st) { + var obj = {}; + obj[Symbol.match] = true; + st.equal(true, ES.IsRegExp(obj), 'object with truthy Symbol.match is regex'); + + var regex = /a/; + regex[Symbol.match] = false; + st.equal(false, ES.IsRegExp(regex), 'regex with falsy Symbol.match is not regex'); + + st.end(); + }); + + t.end(); + }); + + test('IsPropertyKey', function (t) { + forEach(v.numbers.concat(v.objects), function (notKey) { + t.equal(false, ES.IsPropertyKey(notKey), debug(notKey) + ' is not property key'); + }); + + t.equal(true, ES.IsPropertyKey('foo'), 'string is property key'); + + forEach(v.symbols, function (symbol) { + t.equal(true, ES.IsPropertyKey(symbol), debug(symbol) + ' is property key'); + }); + t.end(); + }); + + test('IsInteger', function (t) { + for (var i = -100; i < 100; i += 10) { + t.equal(true, ES.IsInteger(i), i + ' is integer'); + t.equal(false, ES.IsInteger(i + 0.2), (i + 0.2) + ' is not integer'); + } + t.equal(true, ES.IsInteger(-0), '-0 is integer'); + var notInts = v.nonNumbers.concat(v.nonIntegerNumbers, v.infinities, [NaN, [], new Date()]); + forEach(notInts, function (notInt) { + t.equal(false, ES.IsInteger(notInt), debug(notInt) + ' is not integer'); + }); + t.equal(false, ES.IsInteger(v.uncoercibleObject), 'uncoercibleObject is not integer'); + t.end(); + }); + + test('IsExtensible', function (t) { + forEach(v.objects, function (object) { + t.equal(true, ES.IsExtensible(object), debug(object) + ' object is extensible'); + }); + forEach(v.primitives, function (primitive) { + t.equal(false, ES.IsExtensible(primitive), debug(primitive) + ' is not extensible'); + }); + if (Object.preventExtensions) { + t.equal(false, ES.IsExtensible(Object.preventExtensions({})), 'object with extensions prevented is not extensible'); + } + t.end(); + }); + + test('CanonicalNumericIndexString', function (t) { + var throwsOnNonString = function (notString) { + t['throws']( + function () { return ES.CanonicalNumericIndexString(notString); }, + TypeError, + debug(notString) + ' is not a string' + ); + }; + forEach(v.objects.concat(v.numbers), throwsOnNonString); + t.ok(is(-0, ES.CanonicalNumericIndexString('-0')), '"-0" returns -0'); + for (var i = -50; i < 50; i += 10) { + t.equal(i, ES.CanonicalNumericIndexString(String(i)), '"' + i + '" returns ' + i); + t.equal(undefined, ES.CanonicalNumericIndexString(String(i) + 'a'), '"' + i + 'a" returns undefined'); + } + t.end(); + }); + + test('IsConstructor', function (t) { + t.equal(true, ES.IsConstructor(function () {}), 'function is constructor'); + t.equal(false, ES.IsConstructor(/a/g), 'regex is not constructor'); + forEach(v.objects, function (object) { + t.equal(false, ES.IsConstructor(object), object + ' object is not constructor'); + }); + + try { + var arrow = Function('return () => {}')(); // eslint-disable-line no-new-func + t.equal(ES.IsConstructor(arrow), false, 'arrow function is not constructor'); + } catch (e) { + t.comment('SKIP: arrow function syntax not supported.'); + } + + try { + var foo = Function('return class Foo {}')(); // eslint-disable-line no-new-func + t.equal(ES.IsConstructor(foo), true, 'class is constructor'); + } catch (e) { + t.comment('SKIP: class syntax not supported.'); + } + + if (typeof Reflect !== 'object' || typeof Proxy !== 'function' || has(Proxy, 'prototype')) { + t.comment('SKIP: Proxy is constructor'); + } else { + t.equal(ES.IsConstructor(Proxy), true, 'Proxy is constructor'); + } + + t.end(); + }); + + test('Call', function (t) { + var receiver = {}; + var notFuncs = v.nonFunctions.concat([/a/g, new RegExp('a', 'g')]); + t.plan(notFuncs.length + 5); + var throwsIfNotCallable = function (notFunc) { + t['throws']( + function () { return ES.Call(notFunc, receiver); }, + TypeError, + debug(notFunc) + ' (' + typeof notFunc + ') is not callable' + ); + }; + forEach(notFuncs, throwsIfNotCallable); + ES.Call( + function (a, b) { + t.equal(this, receiver, 'context matches expected'); + t.deepEqual([a, b], [1, 2], 'named args are correct'); + t.equal(arguments.length, 3, 'extra argument was passed'); + t.equal(arguments[2], 3, 'extra argument was correct'); + }, + receiver, + [1, 2, 3] + ); + + t.test('Call doesn’t use func.apply', function (st) { + st.plan(4); + + var bad = function (a, b) { + st.equal(this, receiver, 'context matches expected'); + st.deepEqual([a, b], [1, 2], 'named args are correct'); + st.equal(arguments.length, 3, 'extra argument was passed'); + st.equal(arguments[2], 3, 'extra argument was correct'); + }; + + bad.apply = function () { + st.fail('bad.apply shouldn’t get called'); + }; + + ES.Call(bad, receiver, [1, 2, 3]); + st.end(); + }); + + t.end(); + }); + + test('GetV', function (t) { + t['throws'](function () { return ES.GetV({ 7: 7 }, 7); }, TypeError, 'Throws a TypeError if `P` is not a property key'); + var obj = { a: function () {} }; + t.equal(ES.GetV(obj, 'a'), obj.a, 'returns property if it exists'); + t.equal(ES.GetV(obj, 'b'), undefined, 'returns undefiend if property does not exist'); + t.end(); + }); + + test('GetMethod', function (t) { + t['throws'](function () { return ES.GetMethod({ 7: 7 }, 7); }, TypeError, 'Throws a TypeError if `P` is not a property key'); + t.equal(ES.GetMethod({}, 'a'), undefined, 'returns undefined in property is undefined'); + t.equal(ES.GetMethod({ a: null }, 'a'), undefined, 'returns undefined if property is null'); + t.equal(ES.GetMethod({ a: undefined }, 'a'), undefined, 'returns undefined if property is undefined'); + var obj = { a: function () {} }; + t['throws'](function () { ES.GetMethod({ a: 'b' }, 'a'); }, TypeError, 'throws TypeError if property exists and is not callable'); + t.equal(ES.GetMethod(obj, 'a'), obj.a, 'returns property if it is callable'); + t.end(); + }); + + test('Get', function (t) { + t['throws'](function () { return ES.Get('a', 'a'); }, TypeError, 'Throws a TypeError if `O` is not an Object'); + t['throws'](function () { return ES.Get({ 7: 7 }, 7); }, TypeError, 'Throws a TypeError if `P` is not a property key'); + + var value = {}; + t.test('Symbols', { skip: !v.hasSymbols }, function (st) { + var sym = Symbol('sym'); + var obj = {}; + obj[sym] = value; + st.equal(ES.Get(obj, sym), value, 'returns property `P` if it exists on object `O`'); + st.end(); + }); + t.equal(ES.Get({ a: value }, 'a'), value, 'returns property `P` if it exists on object `O`'); + t.end(); + }); + + test('Type', { skip: !v.hasSymbols }, function (t) { + t.equal(ES.Type(Symbol.iterator), 'Symbol', 'Type(Symbol.iterator) is Symbol'); + t.end(); + }); + + test('SpeciesConstructor', function (t) { + t['throws'](function () { ES.SpeciesConstructor(null); }, TypeError); + t['throws'](function () { ES.SpeciesConstructor(undefined); }, TypeError); + + var defaultConstructor = function Foo() {}; + + t.equal( + ES.SpeciesConstructor({ constructor: undefined }, defaultConstructor), + defaultConstructor, + 'undefined constructor returns defaultConstructor' + ); + + t['throws']( + function () { return ES.SpeciesConstructor({ constructor: null }, defaultConstructor); }, + TypeError, + 'non-undefined non-object constructor throws' + ); + + t.test('with Symbol.species', { skip: !hasSpecies }, function (st) { + var Bar = function Bar() {}; + Bar[Symbol.species] = null; + + st.equal( + ES.SpeciesConstructor(new Bar(), defaultConstructor), + defaultConstructor, + 'undefined/null Symbol.species returns default constructor' + ); + + var Baz = function Baz() {}; + Baz[Symbol.species] = Bar; + st.equal( + ES.SpeciesConstructor(new Baz(), defaultConstructor), + Bar, + 'returns Symbol.species constructor value' + ); + + Baz[Symbol.species] = {}; + st['throws']( + function () { ES.SpeciesConstructor(new Baz(), defaultConstructor); }, + TypeError, + 'throws when non-constructor non-null non-undefined species value found' + ); + + st.end(); + }); + + t.end(); + }); + + test('IsPropertyDescriptor', { skip: skips && skips.IsPropertyDescriptor }, function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t.equal( + ES.IsPropertyDescriptor(primitive), + false, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsPropertyDescriptor({ invalid: true }), false, 'invalid keys not allowed on a Property Descriptor'); + + t.equal(ES.IsPropertyDescriptor({}), true, 'empty object is an incomplete Property Descriptor'); + + t.equal(ES.IsPropertyDescriptor(v.accessorDescriptor()), true, 'accessor descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.mutatorDescriptor()), true, 'mutator descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.dataDescriptor()), true, 'data descriptor is a Property Descriptor'); + t.equal(ES.IsPropertyDescriptor(v.genericDescriptor()), true, 'generic descriptor is a Property Descriptor'); + + t['throws']( + function () { ES.IsPropertyDescriptor(v.bothDescriptor()); }, + TypeError, + 'a Property Descriptor can not be both a Data and an Accessor Descriptor' + ); + + t.end(); + }); + + assertRecordTests(ES, test); + + test('IsAccessorDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.IsAccessorDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsAccessorDescriptor(), false, 'no value is not an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(undefined), false, 'undefined value is not an Accessor Descriptor'); + + t.equal(ES.IsAccessorDescriptor(v.accessorDescriptor()), true, 'accessor descriptor is an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.mutatorDescriptor()), true, 'mutator descriptor is an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.dataDescriptor()), false, 'data descriptor is not an Accessor Descriptor'); + t.equal(ES.IsAccessorDescriptor(v.genericDescriptor()), false, 'generic descriptor is not an Accessor Descriptor'); + + t.end(); + }); + + test('IsDataDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.IsDataDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsDataDescriptor(), false, 'no value is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(undefined), false, 'undefined value is not a Data Descriptor'); + + t.equal(ES.IsDataDescriptor(v.accessorDescriptor()), false, 'accessor descriptor is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.mutatorDescriptor()), false, 'mutator descriptor is not a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.dataDescriptor()), true, 'data descriptor is a Data Descriptor'); + t.equal(ES.IsDataDescriptor(v.genericDescriptor()), false, 'generic descriptor is not a Data Descriptor'); + + t.end(); + }); + + test('IsGenericDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.IsGenericDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.equal(ES.IsGenericDescriptor(), false, 'no value is not a Data Descriptor'); + t.equal(ES.IsGenericDescriptor(undefined), false, 'undefined value is not a Data Descriptor'); + + t.equal(ES.IsGenericDescriptor(v.accessorDescriptor()), false, 'accessor descriptor is not a generic Descriptor'); + t.equal(ES.IsGenericDescriptor(v.mutatorDescriptor()), false, 'mutator descriptor is not a generic Descriptor'); + t.equal(ES.IsGenericDescriptor(v.dataDescriptor()), false, 'data descriptor is not a generic Descriptor'); + + t.equal(ES.IsGenericDescriptor(v.genericDescriptor()), true, 'generic descriptor is a generic Descriptor'); + + t.end(); + }); + + test('FromPropertyDescriptor', function (t) { + t.equal(ES.FromPropertyDescriptor(), undefined, 'no value begets undefined'); + t.equal(ES.FromPropertyDescriptor(undefined), undefined, 'undefined value begets undefined'); + + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.FromPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(accessor), { + get: accessor['[[Get]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(mutator), { + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }); + var data = v.dataDescriptor(); + t.deepEqual(ES.FromPropertyDescriptor(data), { + value: data['[[Value]]'], + writable: data['[[Writable]]'] + }); + + t.deepEqual(ES.FromPropertyDescriptor(v.genericDescriptor()), { + enumerable: false, + configurable: true + }); + + t.end(); + }); + + test('ToPropertyDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.ToPropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + var accessor = v.accessorDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + get: accessor['[[Get]]'], + enumerable: !!accessor['[[Enumerable]]'], + configurable: !!accessor['[[Configurable]]'] + }), accessor); + + var mutator = v.mutatorDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + set: mutator['[[Set]]'], + enumerable: !!mutator['[[Enumerable]]'], + configurable: !!mutator['[[Configurable]]'] + }), mutator); + + var data = v.dataDescriptor(); + t.deepEqual(ES.ToPropertyDescriptor({ + value: data['[[Value]]'], + writable: data['[[Writable]]'], + configurable: !!data['[[Configurable]]'] + }), assign(data, { '[[Configurable]]': false })); + + var both = v.bothDescriptor(); + t['throws']( + function () { + ES.FromPropertyDescriptor({ get: both['[[Get]]'], value: both['[[Value]]'] }); + }, + TypeError, + 'data and accessor descriptors are mutually exclusive' + ); + + t.end(); + }); + + test('CompletePropertyDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.CompletePropertyDescriptor(primitive); }, + TypeError, + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var generic = v.genericDescriptor(); + t.deepEqual( + ES.CompletePropertyDescriptor(generic), + { + '[[Configurable]]': !!generic['[[Configurable]]'], + '[[Enumerable]]': !!generic['[[Enumerable]]'], + '[[Value]]': undefined, + '[[Writable]]': false + }, + 'completes a Generic Descriptor' + ); + + var data = v.dataDescriptor(); + t.deepEqual( + ES.CompletePropertyDescriptor(data), + { + '[[Configurable]]': !!data['[[Configurable]]'], + '[[Enumerable]]': false, + '[[Value]]': data['[[Value]]'], + '[[Writable]]': !!data['[[Writable]]'] + }, + 'completes a Data Descriptor' + ); + + var accessor = v.accessorDescriptor(); + t.deepEqual( + ES.CompletePropertyDescriptor(accessor), + { + '[[Get]]': accessor['[[Get]]'], + '[[Enumerable]]': !!accessor['[[Enumerable]]'], + '[[Configurable]]': !!accessor['[[Configurable]]'], + '[[Set]]': undefined + }, + 'completes an Accessor Descriptor' + ); + + var mutator = v.mutatorDescriptor(); + t.deepEqual( + ES.CompletePropertyDescriptor(mutator), + { + '[[Set]]': mutator['[[Set]]'], + '[[Enumerable]]': !!mutator['[[Enumerable]]'], + '[[Configurable]]': !!mutator['[[Configurable]]'], + '[[Get]]': undefined + }, + 'completes a mutator Descriptor' + ); + + t['throws']( + function () { ES.CompletePropertyDescriptor(v.bothDescriptor()); }, + TypeError, + 'data and accessor descriptors are mutually exclusive' + ); + + t.end(); + }); + + test('Set', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.Set(primitive, '', null, false); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonKey) { + t['throws']( + function () { ES.Set({}, nonKey, null, false); }, + TypeError, + debug(nonKey) + ' is not a Property Key' + ); + }); + + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { ES.Set({}, '', null, nonBoolean); }, + TypeError, + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + var o = {}; + var value = {}; + ES.Set(o, 'key', value, true); + t.deepEqual(o, { key: value }, 'key is set'); + + t.test('nonwritable', { skip: !defineProperty.oDP }, function (st) { + var obj = { a: value }; + defineProperty(obj, 'a', { writable: false }); + + st['throws']( + function () { ES.Set(obj, 'a', {}, true); }, + TypeError, + 'can not Set nonwritable property' + ); + + st.doesNotThrow( + function () { + st.equal(ES.Set(obj, 'a', {}, false), false, 'unsuccessful Set returns false'); + }, + 'setting Throw to false prevents an exception' + ); + + st.end(); + }); + + t.test('nonconfigurable', { skip: !defineProperty.oDP }, function (st) { + var obj = { a: value }; + defineProperty(obj, 'a', { configurable: false }); + + st.equal(ES.Set(obj, 'a', value, true), true, 'successful Set returns true'); + st.deepEqual(obj, { a: value }, 'key is set'); + + st.end(); + }); + + t.test('doesn’t call [[Get]] in conforming strict mode environments', { skip: noThrowOnStrictViolation }, function (st) { + var getterCalled = false; + var setterCalls = 0; + var obj = {}; + defineProperty(obj, 'a', { + get: function () { + getterCalled = true; + }, + set: function () { + setterCalls += 1; + } + }); + + st.equal(ES.Set(obj, 'a', value, false), true, 'successful Set returns true'); + st.equal(setterCalls, 1, 'setter was called once'); + st.equal(getterCalled, false, 'getter was not called'); + + st.end(); + }); + + t.end(); + }); + + test('HasOwnProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.HasOwnProperty(primitive, 'key'); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonKey) { + t['throws']( + function () { ES.HasOwnProperty({}, nonKey); }, + TypeError, + debug(nonKey) + ' is not a Property Key' + ); + }); + + t.equal(ES.HasOwnProperty({}, 'toString'), false, 'inherited properties are not own'); + t.equal( + ES.HasOwnProperty({ toString: 1 }, 'toString'), + true, + 'shadowed inherited own properties are own' + ); + t.equal(ES.HasOwnProperty({ a: 1 }, 'a'), true, 'own properties are own'); + + t.end(); + }); + + test('HasProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.HasProperty(primitive, 'key'); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonKey) { + t['throws']( + function () { ES.HasProperty({}, nonKey); }, + TypeError, + debug(nonKey) + ' is not a Property Key' + ); + }); + + t.equal(ES.HasProperty({}, 'nope'), false, 'object does not have nonexistent properties'); + t.equal(ES.HasProperty({}, 'toString'), true, 'object has inherited properties'); + t.equal( + ES.HasProperty({ toString: 1 }, 'toString'), + true, + 'object has shadowed inherited own properties' + ); + t.equal(ES.HasProperty({ a: 1 }, 'a'), true, 'object has own properties'); + + t.end(); + }); + + test('IsConcatSpreadable', function (t) { + forEach(v.primitives, function (primitive) { + t.equal(ES.IsConcatSpreadable(primitive), false, debug(primitive) + ' is not an Object'); + }); + + var hasSymbolConcatSpreadable = v.hasSymbols && Symbol.isConcatSpreadable; + t.test('Symbol.isConcatSpreadable', { skip: !hasSymbolConcatSpreadable }, function (st) { + forEach(v.falsies, function (falsy) { + var obj = {}; + obj[Symbol.isConcatSpreadable] = falsy; + st.equal( + ES.IsConcatSpreadable(obj), + false, + 'an object with ' + debug(falsy) + ' as Symbol.isConcatSpreadable is not concat spreadable' + ); + }); + + forEach(v.truthies, function (truthy) { + var obj = {}; + obj[Symbol.isConcatSpreadable] = truthy; + st.equal( + ES.IsConcatSpreadable(obj), + true, + 'an object with ' + debug(truthy) + ' as Symbol.isConcatSpreadable is concat spreadable' + ); + }); + + st.end(); + }); + + forEach(v.objects, function (object) { + t.equal( + ES.IsConcatSpreadable(object), + false, + 'non-array without Symbol.isConcatSpreadable is not concat spreadable' + ); + }); + + t.equal(ES.IsConcatSpreadable([]), true, 'arrays are concat spreadable'); + + t.end(); + }); + + test('Invoke', function (t) { + forEach(v.nonPropertyKeys, function (nonKey) { + t['throws']( + function () { ES.Invoke({}, nonKey); }, + TypeError, + debug(nonKey) + ' is not a Property Key' + ); + }); + + t['throws'](function () { ES.Invoke({ o: false }, 'o'); }, TypeError, 'fails on a non-function'); + + t.test('invoked callback', function (st) { + var aValue = {}; + var bValue = {}; + var obj = { + f: function (a) { + st.equal(arguments.length, 2, '2 args passed'); + st.equal(a, aValue, 'first arg is correct'); + st.equal(arguments[1], bValue, 'second arg is correct'); + } + }; + st.plan(3); + ES.Invoke(obj, 'f', aValue, bValue); + }); + + t.end(); + }); + + test('GetIterator', function (t) { + var arr = [1, 2]; + testIterator(t, ES.GetIterator(arr), arr); + + testIterator(t, ES.GetIterator('abc'), 'abc'.split('')); + + t.test('Symbol.iterator', { skip: !v.hasSymbols }, function (st) { + var m = new Map(); + m.set(1, 'a'); + m.set(2, 'b'); + + testIterator(st, ES.GetIterator(m), [[1, 'a'], [2, 'b']]); + + st.end(); + }); + + t.end(); + }); + + test('IteratorNext', { skip: true }); + + test('IteratorComplete', { skip: true }); + + test('IteratorValue', { skip: true }); + + test('IteratorStep', { skip: true }); + + test('IteratorClose', { skip: true }); + + test('CreateIterResultObject', function (t) { + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { ES.CreateIterResultObject({}, nonBoolean); }, + TypeError, + '"done" argument must be a boolean; ' + debug(nonBoolean) + ' is not' + ); + }); + + var value = {}; + t.deepEqual( + ES.CreateIterResultObject(value, true), + { value: value, done: true }, + 'creates a "done" iteration result' + ); + t.deepEqual( + ES.CreateIterResultObject(value, false), + { value: value, done: false }, + 'creates a "not done" iteration result' + ); + + t.end(); + }); + + test('RegExpExec', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.RegExpExec(primitive); }, + TypeError, + '"R" argument must be an object; ' + debug(primitive) + ' is not' + ); + }); + + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.RegExpExec({}, nonString); }, + TypeError, + '"S" argument must be a String; ' + debug(nonString) + ' is not' + ); + }); + + t.test('gets and calls a callable "exec"', function (st) { + var str = '123'; + var o = { + exec: function (S) { + st.equal(this, o, '"exec" receiver is R'); + st.equal(S, str, '"exec" argument is S'); + + return null; + } + }; + st.plan(2); + ES.RegExpExec(o, str); + st.end(); + }); + + t.test('throws if a callable "exec" returns a non-null non-object', function (st) { + var str = '123'; + st.plan(v.nonNullPrimitives.length); + forEach(v.nonNullPrimitives, function (nonNullPrimitive) { + st['throws']( + function () { ES.RegExpExec({ exec: function () { return nonNullPrimitive; } }, str); }, + TypeError, + '"exec" method must return `null` or an Object; ' + debug(nonNullPrimitive) + ' is not' + ); + }); + st.end(); + }); + + t.test('actual regex that should match against a string', function (st) { + var S = 'aabc'; + var R = /a/g; + var match1 = ES.RegExpExec(R, S); + var expected1 = assign(['a'], kludgeMatch(R, { index: 0, input: S })); + var match2 = ES.RegExpExec(R, S); + var expected2 = assign(['a'], kludgeMatch(R, { index: 1, input: S })); + var match3 = ES.RegExpExec(R, S); + st.deepEqual(match1, expected1, 'match object 1 is as expected'); + st.deepEqual(match2, expected2, 'match object 2 is as expected'); + st.equal(match3, null, 'match 3 is null as expected'); + st.end(); + }); + + t.test('actual regex that should match against a string, with shadowed "exec"', function (st) { + var S = 'aabc'; + var R = /a/g; + R.exec = undefined; + var match1 = ES.RegExpExec(R, S); + var expected1 = assign(['a'], kludgeMatch(R, { index: 0, input: S })); + var match2 = ES.RegExpExec(R, S); + var expected2 = assign(['a'], kludgeMatch(R, { index: 1, input: S })); + var match3 = ES.RegExpExec(R, S); + st.deepEqual(match1, expected1, 'match object 1 is as expected'); + st.deepEqual(match2, expected2, 'match object 2 is as expected'); + st.equal(match3, null, 'match 3 is null as expected'); + st.end(); + }); + t.end(); + }); + + test('ArraySpeciesCreate', function (t) { + t.test('errors', function (st) { + var testNonNumber = function (nonNumber) { + st['throws']( + function () { ES.ArraySpeciesCreate([], nonNumber); }, + TypeError, + debug(nonNumber) + ' is not a number' + ); + }; + forEach(v.nonNumbers, testNonNumber); + + st['throws']( + function () { ES.ArraySpeciesCreate([], -1); }, + TypeError, + '-1 is not >= 0' + ); + st['throws']( + function () { ES.ArraySpeciesCreate([], -Infinity); }, + TypeError, + '-Infinity is not >= 0' + ); + + var testNonIntegers = function (nonInteger) { + st['throws']( + function () { ES.ArraySpeciesCreate([], nonInteger); }, + TypeError, + debug(nonInteger) + ' is not an integer' + ); + }; + forEach(v.nonIntegerNumbers, testNonIntegers); + + st.end(); + }); + + t.test('works with a non-array', function (st) { + forEach(v.objects.concat(v.primitives), function (nonArray) { + var arr = ES.ArraySpeciesCreate(nonArray, 0); + st.ok(ES.IsArray(arr), 'is an array'); + st.equal(arr.length, 0, 'length is correct'); + st.equal(arr.constructor, Array, 'constructor is correct'); + }); + + st.end(); + }); + + t.test('works with a normal array', function (st) { + var len = 2; + var orig = [1, 2, 3]; + var arr = ES.ArraySpeciesCreate(orig, len); + + st.ok(ES.IsArray(arr), 'is an array'); + st.equal(arr.length, len, 'length is correct'); + st.equal(arr.constructor, orig.constructor, 'constructor is correct'); + + st.end(); + }); + + t.test('-0 length produces +0 length', function (st) { + var len = -0; + st.ok(is(len, -0), '-0 is negative zero'); + st.notOk(is(len, 0), '-0 is not positive zero'); + + var orig = [1, 2, 3]; + var arr = ES.ArraySpeciesCreate(orig, len); + + st.equal(ES.IsArray(arr), true); + st.ok(is(arr.length, 0)); + st.equal(arr.constructor, orig.constructor); + + st.end(); + }); + + t.test('works with species construtor', { skip: !hasSpecies }, function (st) { + var sentinel = {}; + var Foo = function Foo(len) { + this.length = len; + this.sentinel = sentinel; + }; + var Bar = getArraySubclassWithSpeciesConstructor(Foo); + var bar = new Bar(); + + st.equal(ES.IsArray(bar), true, 'Bar instance is an array'); + + var arr = ES.ArraySpeciesCreate(bar, 3); + st.equal(arr.constructor, Foo, 'result used species constructor'); + st.equal(arr.length, 3, 'length property is correct'); + st.equal(arr.sentinel, sentinel, 'Foo constructor was exercised'); + + st.end(); + }); + + t.test('works with null species constructor', { skip: !hasSpecies }, function (st) { + var Bar = getArraySubclassWithSpeciesConstructor(null); + var bar = new Bar(); + + st.equal(ES.IsArray(bar), true, 'Bar instance is an array'); + + var arr = ES.ArraySpeciesCreate(bar, 3); + st.equal(arr.constructor, Array, 'result used default constructor'); + st.equal(arr.length, 3, 'length property is correct'); + + st.end(); + }); + + t.test('works with undefined species constructor', { skip: !hasSpecies }, function (st) { + var Bar = getArraySubclassWithSpeciesConstructor(); + var bar = new Bar(); + + st.equal(ES.IsArray(bar), true, 'Bar instance is an array'); + + var arr = ES.ArraySpeciesCreate(bar, 3); + st.equal(arr.constructor, Array, 'result used default constructor'); + st.equal(arr.length, 3, 'length property is correct'); + + st.end(); + }); + + t.test('throws with object non-construtor species constructor', { skip: !hasSpecies }, function (st) { + forEach(v.objects, function (obj) { + var Bar = getArraySubclassWithSpeciesConstructor(obj); + var bar = new Bar(); + + st.equal(ES.IsArray(bar), true, 'Bar instance is an array'); + + st['throws']( + function () { ES.ArraySpeciesCreate(bar, 3); }, + TypeError, + debug(obj) + ' is not a constructor' + ); + }); + + st.end(); + }); + + t.end(); + }); + + test('CreateDataProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.CreateDataProperty(primitive); }, + TypeError, + debug(primitive) + ' is not an object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.CreateDataProperty({}, nonPropertyKey); }, + TypeError, + debug(nonPropertyKey) + ' is not a property key' + ); + }); + + var sentinel = { id: 'sentinel' }; + var secondSentinel = { id: 'second sentinel' }; + forEach(v.propertyKeys, function (propertyKey) { + var obj = {}; + var status = ES.CreateDataProperty(obj, propertyKey, sentinel); + t.equal(status, true, 'status is true'); + t.equal( + obj[propertyKey], + sentinel, + debug(sentinel) + ' is installed on "' + debug(propertyKey) + '" on the object' + ); + var secondStatus = ES.CreateDataProperty(obj, propertyKey, secondSentinel); + t.equal(secondStatus, true, 'second status is true'); + t.equal( + obj[propertyKey], + secondSentinel, + debug(secondSentinel) + ' is installed on "' + debug(propertyKey) + '" on the object' + ); + + t.test('with defineProperty', { skip: !defineProperty.oDP }, function (st) { + var nonWritable = defineProperty({}, propertyKey, { configurable: true, writable: false }); + + var nonWritableStatus = ES.CreateDataProperty(nonWritable, propertyKey, sentinel); + st.equal(nonWritableStatus, false, 'create data property failed'); + st.notEqual( + nonWritable[propertyKey], + sentinel, + debug(sentinel) + ' is not installed on "' + debug(propertyKey) + '" on the object when key is nonwritable' + ); + + var nonConfigurable = defineProperty({}, propertyKey, { configurable: false, writable: true }); + + var nonConfigurableStatus = ES.CreateDataProperty(nonConfigurable, propertyKey, sentinel); + st.equal(nonConfigurableStatus, false, 'create data property failed'); + st.notEqual( + nonConfigurable[propertyKey], + sentinel, + debug(sentinel) + ' is not installed on "' + debug(propertyKey) + '" on the object when key is nonconfigurable' + ); + st.end(); + }); + }); + + t.end(); + }); + + test('CreateDataPropertyOrThrow', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.CreateDataPropertyOrThrow(primitive); }, + TypeError, + debug(primitive) + ' is not an object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.CreateDataPropertyOrThrow({}, nonPropertyKey); }, + TypeError, + debug(nonPropertyKey) + ' is not a property key' + ); + }); + + var sentinel = {}; + forEach(v.propertyKeys, function (propertyKey) { + var obj = {}; + var status = ES.CreateDataPropertyOrThrow(obj, propertyKey, sentinel); + t.equal(status, true, 'status is true'); + t.equal( + obj[propertyKey], + sentinel, + debug(sentinel) + ' is installed on "' + debug(propertyKey) + '" on the object' + ); + + if (typeof Object.preventExtensions === 'function') { + var notExtensible = {}; + Object.preventExtensions(notExtensible); + + t['throws']( + function () { ES.CreateDataPropertyOrThrow(notExtensible, propertyKey, sentinel); }, + TypeError, + 'can not install ' + debug(propertyKey) + ' on non-extensible object' + ); + t.notEqual( + notExtensible[propertyKey], + sentinel, + debug(sentinel) + ' is not installed on "' + debug(propertyKey) + '" on the object' + ); + } + }); + + t.end(); + }); + + test('ObjectCreate', function (t) { + forEach(v.nonNullPrimitives, function (value) { + t['throws']( + function () { ES.ObjectCreate(value); }, + TypeError, + debug(value) + ' is not null, or an object' + ); + }); + + t.test('proto arg', function (st) { + var Parent = function Parent() {}; + Parent.prototype.foo = {}; + var child = ES.ObjectCreate(Parent.prototype); + st.equal(child instanceof Parent, true, 'child is instanceof Parent'); + st.equal(child.foo, Parent.prototype.foo, 'child inherits properties from Parent.prototype'); + + st.end(); + }); + + t.test('internal slots arg', function (st) { + st.doesNotThrow(function () { ES.ObjectCreate({}, []); }, 'an empty slot list is valid'); + + st['throws']( + function () { ES.ObjectCreate({}, ['a']); }, + SyntaxError, + 'internal slots are not supported' + ); + + st.end(); + }); + + t.test('null proto', { skip: !Object.create && !$setProto }, function (st) { + st.equal('toString' in {}, true, 'normal objects have toString'); + st.equal('toString' in ES.ObjectCreate(null), false, 'makes a null object'); + + st.end(); + }); + + t.test('null proto when no native Object.create', { skip: Object.create || $setProto }, function (st) { + st['throws']( + function () { ES.ObjectCreate(null); }, + SyntaxError, + 'without a native Object.create, can not create null objects' + ); + + st.end(); + }); + + t.end(); + }); + + test('AdvanceStringIndex', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.AdvanceStringIndex(nonString); }, + TypeError, + '"S" argument must be a String; ' + debug(nonString) + ' is not' + ); + }); + + var notInts = v.nonNumbers.concat( + v.nonIntegerNumbers, + v.infinities, + [NaN, [], new Date(), Math.pow(2, 53), -1] + ); + forEach(notInts, function (nonInt) { + t['throws']( + function () { ES.AdvanceStringIndex('abc', nonInt); }, + TypeError, + '"index" argument must be an integer, ' + debug(nonInt) + ' is not.' + ); + }); + + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { ES.AdvanceStringIndex('abc', 0, nonBoolean); }, + TypeError, + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + var str = 'a\uD83D\uDCA9c'; + + t.test('non-unicode mode', function (st) { + for (var i = 0; i < str.length + 2; i += 1) { + st.equal(ES.AdvanceStringIndex(str, i, false), i + 1, i + ' advances to ' + (i + 1)); + } + + st.end(); + }); + + t.test('unicode mode', function (st) { + st.equal(ES.AdvanceStringIndex(str, 0, true), 1, '0 advances to 1'); + st.equal(ES.AdvanceStringIndex(str, 1, true), 3, '1 advances to 3'); + st.equal(ES.AdvanceStringIndex(str, 2, true), 3, '2 advances to 3'); + st.equal(ES.AdvanceStringIndex(str, 3, true), 4, '3 advances to 4'); + st.equal(ES.AdvanceStringIndex(str, 4, true), 5, '4 advances to 5'); + + st.end(); + }); + + t.test('lone surrogates', function (st) { + var halfPoo = 'a\uD83Dc'; + + st.equal(ES.AdvanceStringIndex(halfPoo, 0, true), 1, '0 advances to 1'); + st.equal(ES.AdvanceStringIndex(halfPoo, 1, true), 2, '1 advances to 2'); + st.equal(ES.AdvanceStringIndex(halfPoo, 2, true), 3, '2 advances to 3'); + st.equal(ES.AdvanceStringIndex(halfPoo, 3, true), 4, '3 advances to 4'); + + st.end(); + }); + + t.test('surrogate pairs', function (st) { + var lowestPair = String.fromCharCode('0xD800') + String.fromCharCode('0xDC00'); + var highestPair = String.fromCharCode('0xDBFF') + String.fromCharCode('0xDFFF'); + var poop = String.fromCharCode('0xD83D') + String.fromCharCode('0xDCA9'); + + st.equal(ES.AdvanceStringIndex(lowestPair, 0, true), 2, 'lowest surrogate pair, 0 -> 2'); + st.equal(ES.AdvanceStringIndex(highestPair, 0, true), 2, 'highest surrogate pair, 0 -> 2'); + st.equal(ES.AdvanceStringIndex(poop, 0, true), 2, 'poop, 0 -> 2'); + + st.end(); + }); + + t.end(); + }); + + test('CreateMethodProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.CreateMethodProperty(primitive, 'key'); }, + TypeError, + 'O must be an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.CreateMethodProperty({}, nonPropertyKey); }, + TypeError, + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.test('defines correctly', function (st) { + var obj = {}; + var key = 'the key'; + var value = { foo: 'bar' }; + + st.equal(ES.CreateMethodProperty(obj, key, value), true, 'defines property successfully'); + st.test('property descriptor', { skip: !getOwnPropertyDescriptor }, function (s2t) { + s2t.deepEqual( + getOwnPropertyDescriptor(obj, key), + { + configurable: true, + enumerable: false, + value: value, + writable: true + }, + 'sets the correct property descriptor' + ); + + s2t.end(); + }); + st.equal(obj[key], value, 'sets the correct value'); + + st.end(); + }); + + t.test('fails as expected on a frozen object', { skip: !Object.freeze }, function (st) { + var obj = Object.freeze({ foo: 'bar' }); + st['throws']( + function () { ES.CreateMethodProperty(obj, 'foo', { value: 'baz' }); }, + TypeError, + 'nonconfigurable key can not be defined' + ); + + st.end(); + }); + + t.test('fails as expected on a function with a nonconfigurable name', { skip: !functionsHaveNames || functionsHaveConfigurableNames }, function (st) { + st['throws']( + function () { ES.CreateMethodProperty(function () {}, 'name', { value: 'baz' }); }, + TypeError, + 'nonconfigurable function name can not be defined' + ); + st.end(); + }); + + t.end(); + }); + + test('DefinePropertyOrThrow', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.DefinePropertyOrThrow(primitive, 'key', {}); }, + TypeError, + 'O must be an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.DefinePropertyOrThrow({}, nonPropertyKey, {}); }, + TypeError, + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.test('defines correctly', function (st) { + var obj = {}; + var key = 'the key'; + var descriptor = { + configurable: true, + enumerable: false, + value: { foo: 'bar' }, + writable: true + }; + + st.equal(ES.DefinePropertyOrThrow(obj, key, descriptor), true, 'defines property successfully'); + st.test('property descriptor', { skip: !getOwnPropertyDescriptor }, function (s2t) { + s2t.deepEqual( + getOwnPropertyDescriptor(obj, key), + descriptor, + 'sets the correct property descriptor' + ); + + s2t.end(); + }); + st.deepEqual(obj[key], descriptor.value, 'sets the correct value'); + + st.end(); + }); + + t.test('fails as expected on a frozen object', { skip: !Object.freeze }, function (st) { + var obj = Object.freeze({ foo: 'bar' }); + st['throws']( + function () { + ES.DefinePropertyOrThrow(obj, 'foo', { configurable: true, value: 'baz' }); + }, + TypeError, + 'nonconfigurable key can not be defined' + ); + + st.end(); + }); + + t.test('fails as expected on a function with a nonconfigurable name', { skip: !functionsHaveNames || functionsHaveConfigurableNames }, function (st) { + st['throws']( + function () { + ES.DefinePropertyOrThrow(function () {}, 'name', { configurable: true, value: 'baz' }); + }, + TypeError, + 'nonconfigurable function name can not be defined' + ); + st.end(); + }); + + t.end(); + }); + + test('DeletePropertyOrThrow', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.DeletePropertyOrThrow(primitive, 'key', {}); }, + TypeError, + 'O must be an Object' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.DeletePropertyOrThrow({}, nonPropertyKey, {}); }, + TypeError, + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.test('defines correctly', function (st) { + var obj = { 'the key': 42 }; + var key = 'the key'; + + st.equal(ES.DeletePropertyOrThrow(obj, key), true, 'deletes property successfully'); + st.equal(key in obj, false, 'key is no longer in the object'); + + st.end(); + }); + + t.test('fails as expected on a frozen object', { skip: !Object.freeze }, function (st) { + var obj = Object.freeze({ foo: 'bar' }); + st['throws']( + function () { ES.DeletePropertyOrThrow(obj, 'foo'); }, + TypeError, + 'nonconfigurable key can not be deleted' + ); + + st.end(); + }); + + t.test('fails as expected on a function with a nonconfigurable name', { skip: !functionsHaveNames || functionsHaveConfigurableNames }, function (st) { + st['throws']( + function () { ES.DeletePropertyOrThrow(function () {}, 'name'); }, + TypeError, + 'nonconfigurable function name can not be deleted' + ); + st.end(); + }); + + t.end(); + }); + + test('EnumerableOwnNames', { skip: skips && skips.EnumerableOwnNames }, function (t) { + var obj = testEnumerableOwnNames(t, function (O) { return ES.EnumerableOwnNames(O); }); + + t.deepEqual( + ES.EnumerableOwnNames(obj), + ['own'], + 'returns enumerable own names' + ); + + t.end(); + }); + + test('thisNumberValue', function (t) { + forEach(v.nonNumbers, function (nonNumber) { + t['throws']( + function () { ES.thisNumberValue(nonNumber); }, + TypeError, + debug(nonNumber) + ' is not a Number' + ); + }); + + forEach(v.numbers, function (number) { + t.equal(ES.thisNumberValue(number), number, debug(number) + ' is its own thisNumberValue'); + var obj = Object(number); + t.equal(ES.thisNumberValue(obj), number, debug(obj) + ' is the boxed thisNumberValue'); + }); + + t.end(); + }); + + test('thisBooleanValue', function (t) { + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { ES.thisBooleanValue(nonBoolean); }, + TypeError, + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + forEach(v.booleans, function (boolean) { + t.equal(ES.thisBooleanValue(boolean), boolean, debug(boolean) + ' is its own thisBooleanValue'); + var obj = Object(boolean); + t.equal(ES.thisBooleanValue(obj), boolean, debug(obj) + ' is the boxed thisBooleanValue'); + }); + + t.end(); + }); + + test('thisStringValue', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.thisStringValue(nonString); }, + TypeError, + debug(nonString) + ' is not a String' + ); + }); + + forEach(v.strings, function (string) { + t.equal(ES.thisStringValue(string), string, debug(string) + ' is its own thisStringValue'); + var obj = Object(string); + t.equal(ES.thisStringValue(obj), string, debug(obj) + ' is the boxed thisStringValue'); + }); + + t.end(); + }); + + test('thisTimeValue', function (t) { + forEach(v.primitives.concat(v.objects), function (nonDate) { + t['throws']( + function () { ES.thisTimeValue(nonDate); }, + TypeError, + debug(nonDate) + ' is not a Date' + ); + }); + + forEach(v.timestamps, function (timestamp) { + var date = new Date(timestamp); + + t.equal(ES.thisTimeValue(date), timestamp, debug(date) + ' is its own thisTimeValue'); + }); + + t.end(); + }); + + test('SetIntegrityLevel', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.SetIntegrityLevel(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + t['throws']( + function () { ES.SetIntegrityLevel({}); }, + /^TypeError: Assertion failed: `level` must be `"sealed"` or `"frozen"`$/, + '`level` must be `"sealed"` or `"frozen"`' + ); + + var O = { a: 1 }; + t.test('sealed', { skip: !Object.preventExtensions || noThrowOnStrictViolation }, function (st) { + st.equal(ES.SetIntegrityLevel(O, 'sealed'), true); + st['throws']( + function () { O.b = 2; }, + /^TypeError: (Cannot|Can't) add property b, object is not extensible$/, + 'sealing prevent new properties from being added' + ); + O.a = 2; + st.equal(O.a, 2, 'pre-frozen, existing properties are mutable'); + st.end(); + }); + + t.test('frozen', { skip: !Object.freeze || noThrowOnStrictViolation }, function (st) { + st.equal(ES.SetIntegrityLevel(O, 'frozen'), true); + st['throws']( + function () { O.a = 3; }, + /^TypeError: Cannot assign to read only property 'a' of /, + 'freezing prevents existing properties from being mutated' + ); + st.end(); + }); + + t.end(); + }); + + test('TestIntegrityLevel', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.TestIntegrityLevel(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + + t['throws']( + function () { ES.TestIntegrityLevel({ a: 1 }); }, + /^TypeError: Assertion failed: `level` must be `"sealed"` or `"frozen"`$/, + '`level` must be `"sealed"` or `"frozen"`' + ); + + t.equal(ES.TestIntegrityLevel({ a: 1 }, 'sealed'), false, 'basic object is not sealed'); + t.equal(ES.TestIntegrityLevel({ a: 1 }, 'frozen'), false, 'basic object is not frozen'); + + t.test('preventExtensions', { skip: !Object.preventExtensions }, function (st) { + var o = Object.preventExtensions({ a: 1 }); + st.equal(ES.TestIntegrityLevel(o, 'sealed'), false, 'nonextensible object is not sealed'); + st.equal(ES.TestIntegrityLevel(o, 'frozen'), false, 'nonextensible object is not frozen'); + + var empty = Object.preventExtensions({}); + st.equal(ES.TestIntegrityLevel(empty, 'sealed'), true, 'empty nonextensible object is sealed'); + st.equal(ES.TestIntegrityLevel(empty, 'frozen'), true, 'empty nonextensible object is frozen'); + st.end(); + }); + + t.test('seal', { skip: !Object.seal }, function (st) { + var o = Object.seal({ a: 1 }); + st.equal(ES.TestIntegrityLevel(o, 'sealed'), true, 'sealed object is sealed'); + st.equal(ES.TestIntegrityLevel(o, 'frozen'), false, 'sealed object is not frozen'); + + var empty = Object.seal({}); + st.equal(ES.TestIntegrityLevel(empty, 'sealed'), true, 'empty sealed object is sealed'); + st.equal(ES.TestIntegrityLevel(empty, 'frozen'), true, 'empty sealed object is frozen'); + + st.end(); + }); + + t.test('freeze', { skip: !Object.freeze }, function (st) { + var o = Object.freeze({ a: 1 }); + st.equal(ES.TestIntegrityLevel(o, 'sealed'), true, 'frozen object is sealed'); + st.equal(ES.TestIntegrityLevel(o, 'frozen'), true, 'frozen object is frozen'); + + var empty = Object.freeze({}); + st.equal(ES.TestIntegrityLevel(empty, 'sealed'), true, 'empty frozen object is sealed'); + st.equal(ES.TestIntegrityLevel(empty, 'frozen'), true, 'empty frozen object is frozen'); + + st.end(); + }); + + t.end(); + }); + + test('OrdinaryHasInstance', function (t) { + forEach(v.nonFunctions, function (nonFunction) { + t.equal(ES.OrdinaryHasInstance(nonFunction, {}), false, debug(nonFunction) + ' is not callable'); + }); + + forEach(v.primitives, function (primitive) { + t.equal(ES.OrdinaryHasInstance(function () {}, primitive), false, debug(primitive) + ' is not an object'); + }); + + var C = function C() {}; + var D = function D() {}; + t.equal(ES.OrdinaryHasInstance(C, new C()), true, 'constructor function has an instance of itself'); + t.equal(ES.OrdinaryHasInstance(C, new D()), false, 'constructor/instance mismatch is false'); + t.equal(ES.OrdinaryHasInstance(D, new C()), false, 'instance/constructor mismatch is false'); + t.equal(ES.OrdinaryHasInstance(C, {}), false, 'plain object is not an instance of a constructor'); + t.equal(ES.OrdinaryHasInstance(Object, {}), true, 'plain object is an instance of Object'); + + t.end(); + }); + + test('OrdinaryHasProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.OrdinaryHasProperty(primitive, ''); }, + TypeError, + debug(primitive) + ' is not an object' + ); + }); + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.OrdinaryHasProperty({}, nonPropertyKey); }, + TypeError, + 'P: ' + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.equal(ES.OrdinaryHasProperty({ a: 1 }, 'a'), true, 'own property is true'); + t.equal(ES.OrdinaryHasProperty({}, 'toString'), true, 'inherited property is true'); + t.equal(ES.OrdinaryHasProperty({}, 'nope'), false, 'absent property is false'); + + t.end(); + }); + + test('InstanceofOperator', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.InstanceofOperator(primitive, function () {}); }, + TypeError, + debug(primitive) + ' is not an object' + ); + }); + + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { ES.InstanceofOperator({}, nonFunction); }, + TypeError, + debug(nonFunction) + ' is not callable' + ); + }); + + var C = function C() {}; + var D = function D() {}; + + t.equal(ES.InstanceofOperator(new C(), C), true, 'constructor function has an instance of itself'); + t.equal(ES.InstanceofOperator(new D(), C), false, 'constructor/instance mismatch is false'); + t.equal(ES.InstanceofOperator(new C(), D), false, 'instance/constructor mismatch is false'); + t.equal(ES.InstanceofOperator({}, C), false, 'plain object is not an instance of a constructor'); + t.equal(ES.InstanceofOperator({}, Object), true, 'plain object is an instance of Object'); + + t.test('Symbol.hasInstance', { skip: !v.hasSymbols || !Symbol.hasInstance }, function (st) { + st.plan(4); + + var O = {}; + var C2 = function () {}; + st.equal(ES.InstanceofOperator(O, C2), false, 'O is not an instance of C2'); + + defineProperty(C2, Symbol.hasInstance, { + value: function (obj) { + st.equal(this, C2, 'hasInstance receiver is C2'); + st.equal(obj, O, 'hasInstance argument is O'); + + return {}; // testing coercion to boolean + } + }); + + st.equal(ES.InstanceofOperator(O, C2), true, 'O is now an instance of C2'); + + st.end(); + }); + + t.end(); + }); + + test('Abstract Equality Comparison', function (t) { + t.test('same types use ===', function (st) { + forEach(v.primitives.concat(v.objects), function (value) { + st.equal(ES['Abstract Equality Comparison'](value, value), value === value, debug(value) + ' is abstractly equal to itself'); + }); + st.end(); + }); + + t.test('different types coerce', function (st) { + var pairs = [ + [null, undefined], + [3, '3'], + [true, '3'], + [true, 3], + [false, 0], + [false, '0'], + [3, [3]], + ['3', [3]], + [true, [1]], + [false, [0]], + [String(v.coercibleObject), v.coercibleObject], + [Number(String(v.coercibleObject)), v.coercibleObject], + [Number(v.coercibleObject), v.coercibleObject], + [String(Number(v.coercibleObject)), v.coercibleObject] + ]; + forEach(pairs, function (pair) { + var a = pair[0]; + var b = pair[1]; + // eslint-disable-next-line eqeqeq + st.equal(ES['Abstract Equality Comparison'](a, b), a == b, debug(a) + ' == ' + debug(b)); + // eslint-disable-next-line eqeqeq + st.equal(ES['Abstract Equality Comparison'](b, a), b == a, debug(b) + ' == ' + debug(a)); + }); + st.end(); + }); + + t.end(); + }); + + test('Strict Equality Comparison', function (t) { + t.test('same types use ===', function (st) { + forEach(v.primitives.concat(v.objects), function (value) { + st.equal(ES['Strict Equality Comparison'](value, value), value === value, debug(value) + ' is strictly equal to itself'); + }); + st.end(); + }); + + t.test('different types are not ===', function (st) { + var pairs = [ + [null, undefined], + [3, '3'], + [true, '3'], + [true, 3], + [false, 0], + [false, '0'], + [3, [3]], + ['3', [3]], + [true, [1]], + [false, [0]], + [String(v.coercibleObject), v.coercibleObject], + [Number(String(v.coercibleObject)), v.coercibleObject], + [Number(v.coercibleObject), v.coercibleObject], + [String(Number(v.coercibleObject)), v.coercibleObject] + ]; + forEach(pairs, function (pair) { + var a = pair[0]; + var b = pair[1]; + st.equal(ES['Strict Equality Comparison'](a, b), a === b, debug(a) + ' === ' + debug(b)); + st.equal(ES['Strict Equality Comparison'](b, a), b === a, debug(b) + ' === ' + debug(a)); + }); + st.end(); + }); + + t.end(); + }); + + test('Abstract Relational Comparison', function (t) { + t.test('at least one operand is NaN', function (st) { + st.equal(ES['Abstract Relational Comparison'](NaN, {}, true), undefined, 'LeftFirst: first is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison']({}, NaN, true), undefined, 'LeftFirst: second is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison'](NaN, {}, false), undefined, '!LeftFirst: first is NaN, returns undefined'); + st.equal(ES['Abstract Relational Comparison']({}, NaN, false), undefined, '!LeftFirst: second is NaN, returns undefined'); + st.end(); + }); + + t.equal(ES['Abstract Relational Comparison'](3, 4, true), true, 'LeftFirst: 3 is less than 4'); + t.equal(ES['Abstract Relational Comparison'](4, 3, true), false, 'LeftFirst: 3 is not less than 4'); + t.equal(ES['Abstract Relational Comparison'](3, 4, false), true, '!LeftFirst: 3 is less than 4'); + t.equal(ES['Abstract Relational Comparison'](4, 3, false), false, '!LeftFirst: 3 is not less than 4'); + + t.equal(ES['Abstract Relational Comparison']('3', '4', true), true, 'LeftFirst: "3" is less than "4"'); + t.equal(ES['Abstract Relational Comparison']('4', '3', true), false, 'LeftFirst: "3" is not less than "4"'); + t.equal(ES['Abstract Relational Comparison']('3', '4', false), true, '!LeftFirst: "3" is less than "4"'); + t.equal(ES['Abstract Relational Comparison']('4', '3', false), false, '!LeftFirst: "3" is not less than "4"'); + + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, 42, true), true, 'LeftFirst: coercible object is less than 42'); + t.equal(ES['Abstract Relational Comparison'](42, v.coercibleObject, true), false, 'LeftFirst: 42 is not less than coercible object'); + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, 42, false), true, '!LeftFirst: coercible object is less than 42'); + t.equal(ES['Abstract Relational Comparison'](42, v.coercibleObject, false), false, '!LeftFirst: 42 is not less than coercible object'); + + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, '3', true), false, 'LeftFirst: coercible object is not less than "3"'); + t.equal(ES['Abstract Relational Comparison']('3', v.coercibleObject, true), false, 'LeftFirst: "3" is not less than coercible object'); + t.equal(ES['Abstract Relational Comparison'](v.coercibleObject, '3', false), false, '!LeftFirst: coercible object is not less than "3"'); + t.equal(ES['Abstract Relational Comparison']('3', v.coercibleObject, false), false, '!LeftFirst: "3" is not less than coercible object'); + + t.end(); + }); + + test('ValidateAndApplyPropertyDescriptor', function (t) { + forEach(v.nonUndefinedPrimitives, function (nonUndefinedPrimitive) { + t['throws']( + function () { ES.ValidateAndApplyPropertyDescriptor(nonUndefinedPrimitive, '', false, v.genericDescriptor(), v.genericDescriptor()); }, + TypeError, + 'O: ' + debug(nonUndefinedPrimitive) + ' is not undefined or an Object' + ); + }); + + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { + return ES.ValidateAndApplyPropertyDescriptor( + undefined, + null, + nonBoolean, + v.genericDescriptor(), + v.genericDescriptor() + ); + }, + TypeError, + 'extensible: ' + debug(nonBoolean) + ' is not a Boolean' + ); + }); + + forEach(v.primitives, function (primitive) { + // Desc must be a Property Descriptor + t['throws']( + function () { + return ES.ValidateAndApplyPropertyDescriptor( + undefined, + null, + false, + primitive, + v.genericDescriptor() + ); + }, + TypeError, + 'Desc: ' + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + forEach(v.nonUndefinedPrimitives, function (primitive) { + // current must be undefined or a Property Descriptor + t['throws']( + function () { + return ES.ValidateAndApplyPropertyDescriptor( + undefined, + null, + false, + v.genericDescriptor(), + primitive + ); + }, + TypeError, + 'current: ' + debug(primitive) + ' is not a Property Descriptor or undefined' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + // if O is an object, P must be a property key + t['throws']( + function () { + return ES.ValidateAndApplyPropertyDescriptor( + {}, + nonPropertyKey, + false, + v.genericDescriptor(), + v.genericDescriptor() + ); + }, + TypeError, + 'P: ' + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.test('current is undefined', function (st) { + var propertyKey = 'howdy'; + + st.test('generic descriptor', function (s2t) { + var generic = v.genericDescriptor(); + generic['[[Enumerable]]'] = true; + var O = {}; + ES.ValidateAndApplyPropertyDescriptor(undefined, propertyKey, true, generic); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, false, generic), + false, + 'when extensible is false, nothing happens' + ); + s2t.deepEqual(O, {}, 'no changes applied when O is undefined or extensible is false'); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, true, generic), + true, + 'operation is successful' + ); + var expected = {}; + expected[propertyKey] = undefined; + s2t.deepEqual(O, expected, 'generic descriptor has been defined as an own data property'); + s2t.end(); + }); + + st.test('data descriptor', function (s2t) { + var data = v.dataDescriptor(); + data['[[Enumerable]]'] = true; + + var O = {}; + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(undefined, propertyKey, true, data), + true, + 'noop when O is undefined' + ); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, false, data), + false, + 'when extensible is false, nothing happens' + ); + s2t.deepEqual(O, {}, 'no changes applied when O is undefined or extensible is false'); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, true, data), + true, + 'operation is successful' + ); + var expected = {}; + expected[propertyKey] = data['[[Value]]']; + s2t.deepEqual(O, expected, 'data descriptor has been defined as an own data property'); + s2t.end(); + }); + + st.test('accessor descriptor', { skip: !defineProperty.oDP }, function (s2t) { + var count = 0; + var accessor = v.accessorDescriptor(); + accessor['[[Enumerable]]'] = true; + accessor['[[Get]]'] = function () { + count += 1; + return count; + }; + + var O = {}; + ES.ValidateAndApplyPropertyDescriptor(undefined, propertyKey, true, accessor); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, false, accessor), + false, + 'when extensible is false, nothing happens' + ); + s2t.deepEqual(O, {}, 'no changes applied when O is undefined or extensible is false'); + s2t.equal( + ES.ValidateAndApplyPropertyDescriptor(O, propertyKey, true, accessor), + true, + 'operation is successful' + ); + var expected = {}; + expected[propertyKey] = accessor['[[Get]]']() + 1; + s2t.deepEqual(O, expected, 'accessor descriptor has been defined as an own accessor property'); + s2t.end(); + }); + + st.end(); + }); + + t.test('every field in Desc is absent', { skip: 'it is unclear if having no fields qualifies Desc to be a Property Descriptor' }); + + forEach([v.dataDescriptor, v.accessorDescriptor, v.mutatorDescriptor], function (getDescriptor) { + t.equal( + ES.ValidateAndApplyPropertyDescriptor(undefined, 'property key', true, getDescriptor(), getDescriptor()), + true, + 'when Desc and current are the same, early return true' + ); + }); + + t.test('current is nonconfigurable', function (st) { + // note: these must not be generic descriptors, or else the algorithm returns an early true + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.configurable(v.dataDescriptor()), + v.descriptors.nonConfigurable(v.dataDescriptor()) + ), + false, + 'false if Desc is configurable' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.enumerable(v.dataDescriptor()), + v.descriptors.nonEnumerable(v.dataDescriptor()) + ), + false, + 'false if Desc is Enumerable and current is not' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.nonEnumerable(v.dataDescriptor()), + v.descriptors.enumerable(v.dataDescriptor()) + ), + false, + 'false if Desc is not Enumerable and current is' + ); + + var descLackingEnumerable = v.accessorDescriptor(); + delete descLackingEnumerable['[[Enumerable]]']; + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + descLackingEnumerable, + v.descriptors.enumerable(v.accessorDescriptor()) + ), + true, + 'not false if Desc lacks Enumerable' + ); + + st.end(); + }); + + t.test('Desc and current: one is a data descriptor, one is not', { skip: !defineProperty || !getOwnPropertyDescriptor }, function (st) { + // note: Desc must be configurable if current is nonconfigurable, to hit this branch + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.configurable(v.accessorDescriptor()), + v.descriptors.nonConfigurable(v.dataDescriptor()) + ), + false, + 'false if current (data) is nonconfigurable' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.configurable(v.dataDescriptor()), + v.descriptors.nonConfigurable(v.accessorDescriptor()) + ), + false, + 'false if current (not data) is nonconfigurable' + ); + + // one is data and one is not, + // // if current is data, convert to accessor + // // else convert to data + + var startsWithData = { + 'property key': 42 + }; + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + startsWithData, + 'property key', + true, + v.descriptors.enumerable(v.descriptors.configurable(v.accessorDescriptor())), + v.descriptors.enumerable(v.descriptors.configurable(v.dataDescriptor())) + ), + true, + 'operation is successful: current is data, Desc is accessor' + ); + var shouldBeAccessor = getOwnPropertyDescriptor(startsWithData, 'property key'); + st.equal(typeof shouldBeAccessor.get, 'function', 'has a getter'); + + var key = 'property key'; + var startsWithAccessor = {}; + defineProperty(startsWithAccessor, key, { + configurable: true, + enumerable: true, + get: function get() { return 42; } + }); + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + startsWithAccessor, + key, + true, + v.descriptors.enumerable(v.descriptors.configurable(v.dataDescriptor())), + v.descriptors.enumerable(v.descriptors.configurable(v.accessorDescriptor(42))) + ), + true, + 'operation is successful: current is accessor, Desc is data' + ); + var shouldBeData = getOwnPropertyDescriptor(startsWithAccessor, 'property key'); + st.deepEqual(shouldBeData, { configurable: true, enumerable: true, value: 42, writable: false }, 'is a data property'); + + st.end(); + }); + + t.test('Desc and current are both data descriptors', function (st) { + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.writable(v.dataDescriptor()), + v.descriptors.nonWritable(v.descriptors.nonConfigurable(v.dataDescriptor())) + ), + false, + 'false if frozen current and writable Desc' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.descriptors.configurable({ '[[Value]]': 42 }), + v.descriptors.nonWritable({ '[[Value]]': 7 }) + ), + false, + 'false if nonwritable current has a different value than Desc' + ); + + st.end(); + }); + + t.test('current is nonconfigurable; Desc and current are both accessor descriptors', function (st) { + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.mutatorDescriptor(), + v.descriptors.nonConfigurable(v.mutatorDescriptor()) + ), + false, + 'false if both Sets are not equal' + ); + + st.equal( + ES.ValidateAndApplyPropertyDescriptor( + undefined, + 'property key', + true, + v.accessorDescriptor(), + v.descriptors.nonConfigurable(v.accessorDescriptor()) + ), + false, + 'false if both Gets are not equal' + ); + + st.end(); + }); + + t.end(); + }); + + test('OrdinaryGetOwnProperty', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.OrdinaryGetOwnProperty(primitive, ''); }, + TypeError, + 'O: ' + debug(primitive) + ' is not an Object' + ); + }); + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.OrdinaryGetOwnProperty({}, nonPropertyKey); }, + TypeError, + 'P: ' + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + t.equal(ES.OrdinaryGetOwnProperty({}, 'not in the object'), undefined, 'missing property yields undefined'); + t.equal(ES.OrdinaryGetOwnProperty({}, 'toString'), undefined, 'inherited non-own property yields undefined'); + + t.deepEqual( + ES.OrdinaryGetOwnProperty({ a: 1 }, 'a'), + ES.ToPropertyDescriptor({ + configurable: true, + enumerable: true, + value: 1, + writable: true + }), + 'own assigned data property yields expected descriptor' + ); + + t.deepEqual( + ES.OrdinaryGetOwnProperty(/a/, 'lastIndex'), + ES.ToPropertyDescriptor({ + configurable: false, + enumerable: false, + value: 0, + writable: true + }), + 'regex lastIndex yields expected descriptor' + ); + + t.deepEqual( + ES.OrdinaryGetOwnProperty([], 'length'), + ES.ToPropertyDescriptor({ + configurable: false, + enumerable: false, + value: 0, + writable: true + }), + 'array length yields expected descriptor' + ); + + t.deepEqual( + ES.OrdinaryGetOwnProperty(Object.prototype, 'toString'), + ES.ToPropertyDescriptor({ + configurable: true, + enumerable: false, + value: Object.prototype.toString, + writable: true + }), + 'own non-enumerable data property yields expected descriptor' + ); + + t.test('ES5+', { skip: !defineProperty.oDP }, function (st) { + var O = {}; + defineProperty(O, 'foo', { + configurable: false, + enumerable: false, + value: O, + writable: true + }); + + st.deepEqual( + ES.OrdinaryGetOwnProperty(O, 'foo'), + ES.ToPropertyDescriptor({ + configurable: false, + enumerable: false, + value: O, + writable: true + }), + 'defined own property yields expected descriptor' + ); + + st.end(); + }); + + t.end(); + }); + + test('OrdinaryDefineOwnProperty', { skip: !getOwnPropertyDescriptor }, function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.CopyDataProperties(primitive, {}, []); }, + TypeError, + 'O: ' + debug(primitive) + ' is not an Object' + ); + }); + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.OrdinaryDefineOwnProperty({}, nonPropertyKey, v.genericDescriptor()); }, + TypeError, + 'P: ' + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.OrdinaryDefineOwnProperty(primitive, '', v.genericDescriptor()); }, + TypeError, + 'Desc: ' + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + var O = {}; + var P = 'property key'; + var Desc = v.accessorDescriptor(); + t.equal( + ES.OrdinaryDefineOwnProperty(O, P, Desc), + true, + 'operation is successful' + ); + t.deepEqual( + getOwnPropertyDescriptor(O, P), + ES.FromPropertyDescriptor(ES.CompletePropertyDescriptor(Desc)), + 'expected property descriptor is defined' + ); + + t.end(); + }); + + test('ArrayCreate', function (t) { + forEach(v.nonIntegerNumbers.concat([-1]), function (nonIntegerNumber) { + t['throws']( + function () { ES.ArrayCreate(nonIntegerNumber); }, + TypeError, + 'length must be an integer number >= 0' + ); + }); + + t['throws']( + function () { ES.ArrayCreate(Math.pow(2, 32)); }, + RangeError, + 'length must be < 2**32' + ); + + t.deepEqual(ES.ArrayCreate(-0), [], 'length of -0 creates an empty array'); + t.deepEqual(ES.ArrayCreate(0), [], 'length of +0 creates an empty array'); + // eslint-disable-next-line no-sparse-arrays, comma-spacing + t.deepEqual(ES.ArrayCreate(1), [,], 'length of 1 creates a sparse array of length 1'); + // eslint-disable-next-line no-sparse-arrays, comma-spacing + t.deepEqual(ES.ArrayCreate(2), [,,], 'length of 2 creates a sparse array of length 2'); + + t.test('proto argument', { skip: !$setProto }, function (st) { + var fakeProto = { + push: { toString: function () { return 'not array push'; } } + }; + st.equal(ES.ArrayCreate(0, fakeProto).push, fakeProto.push, 'passing the proto argument works'); + st.end(); + }); + + t.end(); + }); + + test('ArraySetLength', function (t) { + forEach(v.primitives.concat(v.objects), function (nonArray) { + t['throws']( + function () { ES.ArraySetLength(nonArray, 0); }, + TypeError, + 'A: ' + debug(nonArray) + ' is not an Array' + ); + }); + + forEach(v.nonUndefinedPrimitives, function (primitive) { + t['throws']( + function () { ES.ArraySetLength([], primitive); }, + TypeError, + 'Desc: ' + debug(primitive) + ' is not a Property Descriptor' + ); + }); + + t.test('making length nonwritable', { skip: !getOwnPropertyDescriptor }, function (st) { + var a = []; + ES.ArraySetLength(a, { '[[Writable]]': false }); + st.deepEqual( + getOwnPropertyDescriptor(a, 'length'), + { + configurable: false, + enumerable: false, + value: 0, + writable: false + }, + 'without a value, length becomes nonwritable' + ); + st.end(); + }); + + var arr = []; + ES.ArraySetLength(arr, { '[[Value]]': 7 }); + t.equal(arr.length, 7, 'array now has a length of 7'); + + t.end(); + }); + + test('CreateHTML', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.CreateHTML('', nonString, '', ''); }, + TypeError, + 'tag: ' + debug(nonString) + ' is not a String' + ); + t['throws']( + function () { ES.CreateHTML('', '', nonString, ''); }, + TypeError, + 'attribute: ' + debug(nonString) + ' is not a String' + ); + }); + + t.equal( + ES.CreateHTML( + { toString: function () { return 'the string'; } }, + 'some HTML tag!', + '' + ), + 'the string', + 'works with an empty string attribute value' + ); + + t.equal( + ES.CreateHTML( + { toString: function () { return 'the string'; } }, + 'some HTML tag!', + 'attr', + 'value "with quotes"' + ), + 'the string', + 'works with an attribute, and a value with quotes' + ); + + t.end(); + }); + + test('GetOwnPropertyKeys', function (t) { + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.GetOwnPropertyKeys(primitive, 'String'); }, + TypeError, + 'O: ' + debug(primitive) + ' is not an Object' + ); + }); + + t['throws']( + function () { ES.GetOwnPropertyKeys({}, 'not string or symbol'); }, + TypeError, + 'Type: must be "String" or "Symbol"' + ); + + t.test('Symbols', { skip: !v.hasSymbols }, function (st) { + var O = { a: 1 }; + O[Symbol.iterator] = true; + var s = Symbol('test'); + defineProperty(O, s, { enumerable: false, value: true }); + + st.deepEqual( + ES.GetOwnPropertyKeys(O, 'Symbol'), + [Symbol.iterator, s], + 'works with Symbols, enumerable or not' + ); + + st.end(); + }); + + t.test('non-enumerable names', { skip: !defineProperty.oDP }, function (st) { + var O = { a: 1 }; + defineProperty(O, 'b', { enumerable: false, value: 2 }); + if (v.hasSymbols) { + O[Symbol.iterator] = true; + } + + st.deepEqual( + ES.GetOwnPropertyKeys(O, 'String').sort(), + ['a', 'b'].sort(), + 'works with Strings, enumerable or not' + ); + + st.end(); + }); + + t.deepEqual( + ES.GetOwnPropertyKeys({ a: 1, b: 2 }, 'String').sort(), + ['a', 'b'].sort(), + 'works with enumerable keys' + ); + + t.end(); + }); + + test('SymbolDescriptiveString', function (t) { + forEach(v.nonSymbolPrimitives.concat(v.objects), function (nonSymbol) { + t['throws']( + function () { ES.SymbolDescriptiveString(nonSymbol); }, + TypeError, + debug(nonSymbol) + ' is not a Symbol' + ); + }); + + t.test('Symbols', { skip: !v.hasSymbols }, function (st) { + st.equal(ES.SymbolDescriptiveString(Symbol()), 'Symbol()', 'undefined description'); + st.equal(ES.SymbolDescriptiveString(Symbol('')), 'Symbol()', 'empty string description'); + st.equal(ES.SymbolDescriptiveString(Symbol.iterator), 'Symbol(Symbol.iterator)', 'well-known symbol'); + st.equal(ES.SymbolDescriptiveString(Symbol('foo')), 'Symbol(foo)', 'string description'); + + st.end(); + }); + + t.end(); + }); + + test('GetSubstitution', { skip: skips && skips.GetSubstitution }, function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.GetSubstitution(nonString, '', 0, [], ''); }, + TypeError, + '`matched`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', nonString, 0, [], ''); }, + TypeError, + '`str`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', '', 0, [], nonString); }, + TypeError, + '`replacement`: ' + debug(nonString) + ' is not a String' + ); + + if (canDistinguishSparseFromUndefined || typeof nonString !== 'undefined') { + t['throws']( + function () { ES.GetSubstitution('', '', 0, [nonString], ''); }, + TypeError, + '`captures`: ' + debug([nonString]) + ' is not an Array of strings' + ); + } + }); + + forEach(v.nonIntegerNumbers.concat([-1, -42, -Infinity]), function (nonNonNegativeInteger) { + t['throws']( + function () { ES.GetSubstitution('', '', nonNonNegativeInteger, [], ''); }, + TypeError, + '`position`: ' + debug(nonNonNegativeInteger) + ' is not a non-negative integer' + ); + }); + + forEach(v.nonArrays, function (nonArray) { + t['throws']( + function () { ES.GetSubstitution('', '', 0, nonArray, ''); }, + TypeError, + '`captures`: ' + debug(nonArray) + ' is not an Array' + ); + }); + + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], '123'), + '123', + 'returns the substitution' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '$$2$'), + '$2$', + 'supports $$, and trailing $' + ); + + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$&<'), + '>abcdef<', + 'supports $&' + ); + + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$`<'), + '><', + 'supports $` at position 0' + ); + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], '>$`<'), + '>ab<', + 'supports $` at position > 0' + ); + + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 7, [], ">$'<"), + '><', + "supports $' at a position where there's less than `matched.length` chars left" + ); + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], ">$'<"), + '>ghi<', + "supports $' at a position where there's more than `matched.length` chars left" + ); + + for (var i = 0; i < 100; i += 1) { + var captures = []; + captures[i] = 'test'; + if (i > 0) { + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$' + i + '<'), + '>undefined<', + 'supports $' + i + ' with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$' + i), + '>undefined', + 'supports $' + i + ' at the end of the replacement, with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, '>$' + i + '<'), + '><', + 'supports $' + i + ' with a capture at that index' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, '>$' + i), + '>', + 'supports $' + i + ' at the end of the replacement, with a capture at that index' + ); + } + if (i < 10) { + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$0' + i + '<'), + i === 0 ? '><' : '>undefined<', + 'supports $0' + i + ' with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], '>$0' + i), + i === 0 ? '>' : '>undefined', + 'supports $0' + i + ' at the end of the replacement, with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, '>$0' + i + '<'), + '><', + 'supports $0' + i + ' with a capture at that index' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, '>$0' + i), + '>', + 'supports $0' + i + ' at the end of the replacement, with a capture at that index' + ); + } + } + + t.end(); + }); + + test('SecFromTime', function (t) { + var now = new Date(); + t.equal(ES.SecFromTime(now.getTime()), now.getUTCSeconds(), 'second from Date timestamp matches getUTCSeconds'); + t.end(); + }); + + test('MinFromTime', function (t) { + var now = new Date(); + t.equal(ES.MinFromTime(now.getTime()), now.getUTCMinutes(), 'minute from Date timestamp matches getUTCMinutes'); + t.end(); + }); + + test('HourFromTime', function (t) { + var now = new Date(); + t.equal(ES.HourFromTime(now.getTime()), now.getUTCHours(), 'hour from Date timestamp matches getUTCHours'); + t.end(); + }); + + test('msFromTime', function (t) { + var now = new Date(); + t.equal(ES.msFromTime(now.getTime()), now.getUTCMilliseconds(), 'ms from Date timestamp matches getUTCMilliseconds'); + t.end(); + }); + + var msPerSecond = 1e3; + var msPerMinute = 60 * msPerSecond; + var msPerHour = 60 * msPerMinute; + var msPerDay = 24 * msPerHour; + + test('Day', function (t) { + var time = Date.UTC(2019, 8, 10, 2, 3, 4, 5); + var add = 2.5; + var later = new Date(time + (add * msPerDay)); + + t.equal(ES.Day(later.getTime()), ES.Day(time) + Math.floor(add), 'adding 2.5 days worth of ms, gives a Day delta of 2'); + t.end(); + }); + + test('TimeWithinDay', function (t) { + var time = Date.UTC(2019, 8, 10, 2, 3, 4, 5); + var add = 2.5; + var later = new Date(time + (add * msPerDay)); + + t.equal(ES.TimeWithinDay(later.getTime()), ES.TimeWithinDay(time) + (0.5 * msPerDay), 'adding 2.5 days worth of ms, gives a TimeWithinDay delta of +0.5'); + t.end(); + }); + + test('DayFromYear', function (t) { + t.equal(ES.DayFromYear(2021) - ES.DayFromYear(2020), 366, '2021 is a leap year, has 366 days'); + t.equal(ES.DayFromYear(2020) - ES.DayFromYear(2019), 365, '2020 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2019) - ES.DayFromYear(2018), 365, '2019 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2018) - ES.DayFromYear(2017), 365, '2018 is not a leap year, has 365 days'); + t.equal(ES.DayFromYear(2017) - ES.DayFromYear(2016), 366, '2017 is a leap year, has 366 days'); + + t.end(); + }); + + test('TimeFromYear', function (t) { + for (var i = 1900; i < 2100; i += 1) { + t.equal(ES.TimeFromYear(i), Date.UTC(i, 0, 1), 'TimeFromYear matches a Date object’s year: ' + i); + } + t.end(); + }); + + test('YearFromTime', function (t) { + for (var i = 1900; i < 2100; i += 1) { + t.equal(ES.YearFromTime(Date.UTC(i, 0, 1)), i, 'YearFromTime matches a Date object’s year on 1/1: ' + i); + t.equal(ES.YearFromTime(Date.UTC(i, 10, 1)), i, 'YearFromTime matches a Date object’s year on 10/1: ' + i); + } + t.end(); + }); + + test('WeekDay', function (t) { + var now = new Date(); + var today = now.getUTCDay(); + for (var i = 0; i < 7; i += 1) { + var weekDay = ES.WeekDay(now.getTime() + (i * msPerDay)); + t.equal(weekDay, (today + i) % 7, i + ' days after today (' + today + '), WeekDay is ' + weekDay); + } + t.end(); + }); + + test('DaysInYear', function (t) { + t.equal(ES.DaysInYear(2021), 365, '2021 is not a leap year'); + t.equal(ES.DaysInYear(2020), 366, '2020 is a leap year'); + t.equal(ES.DaysInYear(2019), 365, '2019 is not a leap year'); + t.equal(ES.DaysInYear(2018), 365, '2018 is not a leap year'); + t.equal(ES.DaysInYear(2017), 365, '2017 is not a leap year'); + t.equal(ES.DaysInYear(2016), 366, '2016 is a leap year'); + + t.end(); + }); + + test('InLeapYear', function (t) { + t.equal(ES.InLeapYear(Date.UTC(2021, 0, 1)), 0, '2021 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2020, 0, 1)), 1, '2020 is a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2019, 0, 1)), 0, '2019 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2018, 0, 1)), 0, '2018 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2017, 0, 1)), 0, '2017 is not a leap year'); + t.equal(ES.InLeapYear(Date.UTC(2016, 0, 1)), 1, '2016 is a leap year'); + + t.end(); + }); + + test('DayWithinYear', function (t) { + t.equal(ES.DayWithinYear(Date.UTC(2019, 0, 1)), 0, '1/1 is the 1st day'); + t.equal(ES.DayWithinYear(Date.UTC(2019, 11, 31)), 364, '12/31 is the 365th day in a non leap year'); + t.equal(ES.DayWithinYear(Date.UTC(2016, 11, 31)), 365, '12/31 is the 366th day in a leap year'); + + t.end(); + }); + + test('MonthFromTime', function (t) { + t.equal(ES.MonthFromTime(Date.UTC(2019, 0, 1)), 0, 'non-leap: 1/1 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 0, 31)), 0, 'non-leap: 1/31 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 1)), 1, 'non-leap: 2/1 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 28)), 1, 'non-leap: 2/28 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 1, 29)), 2, 'non-leap: 2/29 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 2, 1)), 2, 'non-leap: 3/1 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 2, 31)), 2, 'non-leap: 3/31 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 3, 1)), 3, 'non-leap: 4/1 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 3, 30)), 3, 'non-leap: 4/30 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 4, 1)), 4, 'non-leap: 5/1 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 4, 31)), 4, 'non-leap: 5/31 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 5, 1)), 5, 'non-leap: 6/1 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 5, 30)), 5, 'non-leap: 6/30 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 6, 1)), 6, 'non-leap: 7/1 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 6, 31)), 6, 'non-leap: 7/31 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 7, 1)), 7, 'non-leap: 8/1 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 7, 30)), 7, 'non-leap: 8/30 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 8, 1)), 8, 'non-leap: 9/1 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 8, 30)), 8, 'non-leap: 9/30 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 9, 1)), 9, 'non-leap: 10/1 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 9, 31)), 9, 'non-leap: 10/31 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 10, 1)), 10, 'non-leap: 11/1 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 10, 30)), 10, 'non-leap: 11/30 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 11, 1)), 11, 'non-leap: 12/1 gives December'); + t.equal(ES.MonthFromTime(Date.UTC(2019, 11, 31)), 11, 'non-leap: 12/31 gives December'); + + t.equal(ES.MonthFromTime(Date.UTC(2016, 0, 1)), 0, 'leap: 1/1 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 0, 31)), 0, 'leap: 1/31 gives January'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 1)), 1, 'leap: 2/1 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 28)), 1, 'leap: 2/28 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 1, 29)), 1, 'leap: 2/29 gives February'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 2, 1)), 2, 'leap: 3/1 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 2, 31)), 2, 'leap: 3/31 gives March'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 3, 1)), 3, 'leap: 4/1 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 3, 30)), 3, 'leap: 4/30 gives April'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 4, 1)), 4, 'leap: 5/1 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 4, 31)), 4, 'leap: 5/31 gives May'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 5, 1)), 5, 'leap: 6/1 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 5, 30)), 5, 'leap: 6/30 gives June'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 6, 1)), 6, 'leap: 7/1 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 6, 31)), 6, 'leap: 7/31 gives July'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 7, 1)), 7, 'leap: 8/1 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 7, 30)), 7, 'leap: 8/30 gives August'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 8, 1)), 8, 'leap: 9/1 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 8, 30)), 8, 'leap: 9/30 gives September'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 9, 1)), 9, 'leap: 10/1 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 9, 31)), 9, 'leap: 10/31 gives October'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 10, 1)), 10, 'leap: 11/1 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 10, 30)), 10, 'leap: 11/30 gives November'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 11, 1)), 11, 'leap: 12/1 gives December'); + t.equal(ES.MonthFromTime(Date.UTC(2016, 11, 31)), 11, 'leap: 12/31 gives December'); + t.end(); + }); + + test('DateFromTime', function (t) { + var i; + for (i = 1; i <= 28; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 1, i)), i, '2019.02.' + i + ' is date ' + i); + } + for (i = 1; i <= 29; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2016, 1, i)), i, '2016.02.' + i + ' is date ' + i); + } + for (i = 1; i <= 30; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 8, i)), i, '2019.09.' + i + ' is date ' + i); + } + for (i = 1; i <= 31; i += 1) { + t.equal(ES.DateFromTime(Date.UTC(2019, 9, i)), i, '2019.10.' + i + ' is date ' + i); + } + t.end(); + }); + + test('MakeDay', function (t) { + var day2015 = 16687; + t.equal(ES.MakeDay(2015, 8, 9), day2015, '2015.09.09 is day 16687'); + var day2016 = day2015 + 366; // 2016 is a leap year + t.equal(ES.MakeDay(2016, 8, 9), day2016, '2015.09.09 is day 17053'); + var day2017 = day2016 + 365; + t.equal(ES.MakeDay(2017, 8, 9), day2017, '2017.09.09 is day 17418'); + var day2018 = day2017 + 365; + t.equal(ES.MakeDay(2018, 8, 9), day2018, '2018.09.09 is day 17783'); + var day2019 = day2018 + 365; + t.equal(ES.MakeDay(2019, 8, 9), day2019, '2019.09.09 is day 18148'); + t.end(); + }); + + test('MakeDate', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.MakeDate(nonFiniteNumber, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `day`'); + t.ok(is(ES.MakeDate(0, nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `time`'); + }); + t.equal(ES.MakeDate(0, 0), 0, 'zero day and zero time is zero date'); + t.equal(ES.MakeDate(0, 123), 123, 'zero day and nonzero time is a date of the "time"'); + t.equal(ES.MakeDate(1, 0), msPerDay, 'day of 1 and zero time is a date of "ms per day"'); + t.equal(ES.MakeDate(3, 0), 3 * msPerDay, 'day of 3 and zero time is a date of thrice "ms per day"'); + t.equal(ES.MakeDate(1, 123), msPerDay + 123, 'day of 1 and nonzero time is a date of "ms per day" plus the "time"'); + t.equal(ES.MakeDate(3, 123), (3 * msPerDay) + 123, 'day of 3 and nonzero time is a date of thrice "ms per day" plus the "time"'); + + t.end(); + }); + + test('MakeTime', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.MakeTime(nonFiniteNumber, 0, 0, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `hour`'); + t.ok(is(ES.MakeTime(0, nonFiniteNumber, 0, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `min`'); + t.ok(is(ES.MakeTime(0, 0, nonFiniteNumber, 0), NaN), debug(nonFiniteNumber) + ' is not a finite `sec`'); + t.ok(is(ES.MakeTime(0, 0, 0, nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `ms`'); + }); + + t.equal( + ES.MakeTime(1.2, 2.3, 3.4, 4.5), + (1 * msPerHour) + (2 * msPerMinute) + (3 * msPerSecond) + 4, + 'all numbers are converted to integer, multiplied by the right number of ms, and summed' + ); + + t.end(); + }); + + test('TimeClip', function (t) { + forEach(v.infinities.concat(NaN), function (nonFiniteNumber) { + t.ok(is(ES.TimeClip(nonFiniteNumber), NaN), debug(nonFiniteNumber) + ' is not a finite `time`'); + }); + t.ok(is(ES.TimeClip(8.64e15 + 1), NaN), '8.64e15 is the largest magnitude considered "finite"'); + t.ok(is(ES.TimeClip(-8.64e15 - 1), NaN), '-8.64e15 is the largest magnitude considered "finite"'); + + forEach(v.zeroes.concat([-10, 10, +new Date()]), function (time) { + t.looseEqual(ES.TimeClip(time), time, debug(time) + ' is a time of ' + debug(time)); + }); + + t.end(); + }); + + test('modulo', function (t) { + t.equal(3 % 2, 1, '+3 % 2 is +1'); + t.equal(ES.modulo(3, 2), 1, '+3 mod 2 is +1'); + + t.equal(-3 % 2, -1, '-3 % 2 is -1'); + t.equal(ES.modulo(-3, 2), 1, '-3 mod 2 is +1'); + t.end(); + }); + + test('ToDateString', function (t) { + forEach(v.nonNumbers, function (nonNumber) { + t['throws']( + function () { ES.ToDateString(nonNumber); }, + TypeError, + debug(nonNumber) + ' is not a Number' + ); + }); + + t.equal(ES.ToDateString(NaN), 'Invalid Date', 'NaN becomes "Invalid Date"'); + var now = +new Date(); + t.equal(ES.ToDateString(now), Date(now), 'any timestamp becomes `Date(timestamp)`'); + t.end(); + }); + + test('CreateListFromArrayLike', function (t) { + forEach(v.primitives, function (nonObject) { + t['throws']( + function () { ES.CreateListFromArrayLike(nonObject); }, + TypeError, + debug(nonObject) + ' is not an Object' + ); + }); + forEach(v.nonArrays, function (nonArray) { + t['throws']( + function () { ES.CreateListFromArrayLike({}, nonArray); }, + TypeError, + debug(nonArray) + ' is not an Array' + ); + }); + + t.deepEqual( + ES.CreateListFromArrayLike({ length: 2, 0: 'a', 1: 'b', 2: 'c' }), + ['a', 'b'], + 'arraylike stops at the length' + ); + + t.end(); + }); + + test('GetPrototypeFromConstructor', function (t) { + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { ES.GetPrototypeFromConstructor(nonFunction, '%Array%'); }, + TypeError, + debug(nonFunction) + ' is not a constructor' + ); + }); + + forEach(arrowFns, function (arrowFn) { + t['throws']( + function () { ES.GetPrototypeFromConstructor(arrowFn, '%Array%'); }, + TypeError, + debug(arrowFn) + ' is not a constructor' + ); + }); + + var f = function () {}; + t.equal( + ES.GetPrototypeFromConstructor(f, '%Array.prototype%'), + f.prototype, + 'function with normal `prototype` property returns it' + ); + forEach([true, 'foo', 42], function (truthyPrimitive) { + f.prototype = truthyPrimitive; + t.equal( + ES.GetPrototypeFromConstructor(f, '%Array.prototype%'), + Array.prototype, + 'function with non-object `prototype` property (' + debug(truthyPrimitive) + ') returns default intrinsic' + ); + }); + + t.end(); + }); + + var getNamelessFunction = function () { + var f = Object(function () {}); + try { + delete f.name; + } catch (e) { /**/ } + return f; + }; + + test('SetFunctionName', function (t) { + t.test('non-extensible function', { skip: !Object.preventExtensions }, function (st) { + var f = getNamelessFunction(); + Object.preventExtensions(f); + st['throws']( + function () { ES.SetFunctionName(f, ''); }, + TypeError, + 'throws on a non-extensible function' + ); + st.end(); + }); + + t.test('has an own name property', { skip: !functionsHaveNames }, function (st) { + st['throws']( + function () { ES.SetFunctionName(function g() {}, ''); }, + TypeError, + 'throws if function has an own `name` property' + ); + st.end(); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + t['throws']( + function () { ES.SetFunctionName(getNamelessFunction(), nonPropertyKey); }, + TypeError, + debug(nonPropertyKey) + ' is not a Symbol or String' + ); + }); + + t.test('symbols', { skip: !v.hasSymbols || has(getNamelessFunction(), 'name') }, function (st) { + var pairs = [ + [Symbol(), ''], + [Symbol(undefined), ''], + [Symbol(null), '[null]'], + [Symbol(''), getInferredName ? '[]' : ''], + [Symbol.iterator, '[Symbol.iterator]'], + [Symbol('foo'), '[foo]'] + ]; + forEach(pairs, function (pair) { + var sym = pair[0]; + var desc = pair[1]; + var f = getNamelessFunction(); + ES.SetFunctionName(f, sym); + st.equal(f.name, desc, debug(sym) + ' yields a name of ' + debug(desc)); + }); + + st.end(); + }); + + var f = getNamelessFunction(); + t.test('when names are configurable', { skip: !functionsHaveConfigurableNames || has(f, 'name') }, function (st) { + // without prefix + st.notEqual(f.name, 'foo', 'precondition'); + ES.SetFunctionName(f, 'foo'); + st.equal(f.name, 'foo', 'function name is set without a prefix'); + + // with prefix + var g = getNamelessFunction(); + st.notEqual(g.name, 'pre- foo', 'precondition'); + ES.SetFunctionName(g, 'foo', 'pre-'); + st.equal(g.name, 'pre- foo', 'function name is set with a prefix'); + + st.end(); + }); + + t.end(); + }); +}; + +var es2016 = function ES2016(ES, ops, expectedMissing, skips) { + es2015(ES, ops, expectedMissing, skips); + + test('SameValueNonNumber', function (t) { + var willThrow = [ + [3, 4], + [NaN, 4], + [4, ''], + ['abc', true], + [{}, false] + ]; + forEach(willThrow, function (nums) { + t['throws'](function () { return ES.SameValueNonNumber.apply(ES, nums); }, TypeError, 'value must be same type and non-number'); + }); + + forEach(v.objects.concat(v.nonNumberPrimitives), function (val) { + t.equal(val === val, ES.SameValueNonNumber(val, val), debug(val) + ' is SameValueNonNumber to itself'); + }); + + t.end(); + }); + + test('IterableToArrayLike', { skip: skips && skips.IterableToArrayLike }, function (t) { + t.test('custom iterables', { skip: !v.hasSymbols }, function (st) { + var O = {}; + O[Symbol.iterator] = function () { + var i = -1; + return { + next: function () { + i += 1; + return { + done: i >= 5, + value: i + }; + } + }; + }; + st.deepEqual( + ES.IterableToArrayLike(O), + [0, 1, 2, 3, 4], + 'Symbol.iterator method is called and values collected' + ); + + st.end(); + }); + + t.deepEqual(ES.IterableToArrayLike('abc'), ['a', 'b', 'c'], 'a string of code units spreads'); + t.deepEqual(ES.IterableToArrayLike('💩'), ['💩'], 'a string of code points spreads'); + t.deepEqual(ES.IterableToArrayLike('a💩c'), ['a', '💩', 'c'], 'a string of code points and units spreads'); + + var arr = [1, 2, 3]; + t.deepEqual(ES.IterableToArrayLike(arr), arr, 'an array becomes a similar array'); + t.notEqual(ES.IterableToArrayLike(arr), arr, 'an array becomes a different, but similar, array'); + + var O = {}; + t.equal(ES.IterableToArrayLike(O), O, 'a non-iterable non-array non-string object is returned directly'); + + t.end(); + }); + + test('OrdinaryGetPrototypeOf', function (t) { + t.test('values', { skip: !$getProto }, function (st) { + st.equal(ES.OrdinaryGetPrototypeOf([]), Array.prototype, 'array [[Prototype]] is Array.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf({}), Object.prototype, 'object [[Prototype]] is Object.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf(/a/g), RegExp.prototype, 'regex [[Prototype]] is RegExp.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf(Object('')), String.prototype, 'boxed string [[Prototype]] is String.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf(Object(42)), Number.prototype, 'boxed number [[Prototype]] is Number.prototype'); + st.equal(ES.OrdinaryGetPrototypeOf(Object(true)), Boolean.prototype, 'boxed boolean [[Prototype]] is Boolean.prototype'); + if (v.hasSymbols) { + st.equal(ES.OrdinaryGetPrototypeOf(Object(Symbol.iterator)), Symbol.prototype, 'boxed symbol [[Prototype]] is Symbol.prototype'); + } + st.end(); + }); + + forEach(v.primitives, function (primitive) { + t['throws']( + function () { ES.OrdinaryGetPrototypeOf(primitive); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + t.end(); + }); + + test('OrdinarySetPrototypeOf', { skip: !$getProto || !$setProto }, function (t) { + var a = []; + var proto = {}; + + t.equal(ES.OrdinaryGetPrototypeOf(a), Array.prototype, 'precondition'); + t.equal(ES.OrdinarySetPrototypeOf(a, proto), true, 'setting prototype is successful'); + t.equal(ES.OrdinaryGetPrototypeOf(a), proto, 'postcondition'); + + t.end(); + }); +}; + +var es2017 = function ES2017(ES, ops, expectedMissing, skips) { + es2016(ES, ops, expectedMissing, assign({}, skips, { + EnumerableOwnNames: true, + IterableToArrayLike: true + })); + + test('ToIndex', function (t) { + t.ok(is(ES.ToIndex(), 0), 'no value gives 0'); + t.ok(is(ES.ToIndex(undefined), 0), 'undefined value gives 0'); + + t['throws'](function () { ES.ToIndex(-1); }, RangeError, 'negative numbers throw'); + + t['throws'](function () { ES.ToIndex(MAX_SAFE_INTEGER + 1); }, RangeError, 'too large numbers throw'); + + t.equal(ES.ToIndex(3), 3, 'numbers work'); + t.equal(ES.ToIndex(v.valueOfOnlyObject), 4, 'coercible objects are coerced'); + + t.end(); + }); + + test('EnumerableOwnProperties', { skip: skips && skips.EnumerableOwnProperties }, function (t) { + var obj = testEnumerableOwnNames(t, function (O) { + return ES.EnumerableOwnProperties(O, 'key'); + }); + + t.deepEqual( + ES.EnumerableOwnProperties(obj, 'value'), + [obj.own], + 'returns enumerable own values' + ); + + t.deepEqual( + ES.EnumerableOwnProperties(obj, 'key+value'), + [['own', obj.own]], + 'returns enumerable own entries' + ); + + t.end(); + }); + + test('IterableToList', function (t) { + var customIterator = function () { + var i = -1; + return { + next: function () { + i += 1; + return { + done: i >= 5, + value: i + }; + } + }; + }; + + t.deepEqual( + ES.IterableToList({}, customIterator), + [0, 1, 2, 3, 4], + 'iterator method is called and values collected' + ); + + t.test('Symbol support', { skip: !v.hasSymbols }, function (st) { + st.deepEqual(ES.IterableToList('abc', String.prototype[Symbol.iterator]), ['a', 'b', 'c'], 'a string of code units spreads'); + st.deepEqual(ES.IterableToList('☃', String.prototype[Symbol.iterator]), ['☃'], 'a string of code points spreads'); + + var arr = [1, 2, 3]; + st.deepEqual(ES.IterableToList(arr, arr[Symbol.iterator]), arr, 'an array becomes a similar array'); + st.notEqual(ES.IterableToList(arr, arr[Symbol.iterator]), arr, 'an array becomes a different, but similar, array'); + + st.end(); + }); + + t['throws']( + function () { ES.IterableToList({}, void 0); }, + TypeError, + 'non-function iterator method' + ); + + t.end(); + }); +}; + +var es2018 = function ES2018(ES, ops, expectedMissing, skips) { + es2017(ES, ops, expectedMissing, assign({}, skips, { + EnumerableOwnProperties: true, + GetSubstitution: true, + IsPropertyDescriptor: true + })); + + test('thisSymbolValue', function (t) { + forEach(v.nonSymbolPrimitives.concat(v.objects), function (nonSymbol) { + t['throws']( + function () { ES.thisSymbolValue(nonSymbol); }, + v.hasSymbols ? TypeError : SyntaxError, + debug(nonSymbol) + ' is not a Symbol' + ); + }); + + t.test('no native Symbols', { skip: v.hasSymbols }, function (st) { + forEach(v.objects.concat(v.primitives), function (value) { + st['throws']( + function () { ES.thisSymbolValue(value); }, + SyntaxError, + 'Symbols are not supported' + ); + }); + st.end(); + }); + + t.test('symbol values', { skip: !v.hasSymbols }, function (st) { + forEach(v.symbols, function (symbol) { + st.equal(ES.thisSymbolValue(symbol), symbol, 'Symbol value of ' + debug(symbol) + ' is same symbol'); + + st.equal( + ES.thisSymbolValue(Object(symbol)), + symbol, + 'Symbol value of ' + debug(Object(symbol)) + ' is ' + debug(symbol) + ); + }); + + st.end(); + }); + + t.end(); + }); + + test('IsStringPrefix', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.IsStringPrefix(nonString, 'a'); }, + TypeError, + 'first arg: ' + debug(nonString) + ' is not a string' + ); + t['throws']( + function () { ES.IsStringPrefix('a', nonString); }, + TypeError, + 'second arg: ' + debug(nonString) + ' is not a string' + ); + }); + + forEach(v.strings, function (string) { + t.equal(ES.IsStringPrefix(string, string), true, debug(string) + ' is a prefix of itself'); + + t.equal(ES.IsStringPrefix('', string), true, 'the empty string is a prefix of everything'); + }); + + t.equal(ES.IsStringPrefix('abc', 'abcd'), true, '"abc" is a prefix of "abcd"'); + t.equal(ES.IsStringPrefix('abcd', 'abc'), false, '"abcd" is not a prefix of "abc"'); + + t.equal(ES.IsStringPrefix('a', 'bc'), false, '"a" is not a prefix of "bc"'); + + t.end(); + }); + + test('NumberToString', function (t) { + forEach(v.nonNumbers, function (nonNumber) { + t['throws']( + function () { ES.NumberToString(nonNumber); }, + TypeError, + debug(nonNumber) + ' is not a Number' + ); + }); + + forEach(v.numbers, function (number) { + t.equal(ES.NumberToString(number), String(number), debug(number) + ' stringifies to ' + number); + }); + + t.end(); + }); + + test('CopyDataProperties', function (t) { + t.test('first argument: target', function (st) { + forEach(v.primitives, function (primitive) { + st['throws']( + function () { ES.CopyDataProperties(primitive, {}, []); }, + TypeError, + debug(primitive) + ' is not an Object' + ); + }); + st.end(); + }); + + t.test('second argument: source', function (st) { + var frozenTarget = Object.freeze ? Object.freeze({}) : {}; + forEach(v.nullPrimitives, function (nullish) { + st.equal( + ES.CopyDataProperties(frozenTarget, nullish, []), + frozenTarget, + debug(nullish) + ' "source" yields identical, unmodified target' + ); + }); + + forEach(v.nonNullPrimitives, function (objectCoercible) { + var target = {}; + var result = ES.CopyDataProperties(target, objectCoercible, []); + st.equal(result, target, 'result === target'); + st.deepEqual(keys(result), keys(Object(objectCoercible)), 'target ends up with keys of ' + debug(objectCoercible)); + }); + + st.test('enumerable accessor property', { skip: !defineProperty.oDP }, function (s2t) { + var target = {}; + var source = {}; + defineProperty(source, 'a', { + enumerable: true, + get: function () { return 42; } + }); + var result = ES.CopyDataProperties(target, source, []); + s2t.equal(result, target, 'result === target'); + s2t.deepEqual(result, { a: 42 }, 'target ends up with enumerable accessor of source'); + s2t.end(); + }); + + st.end(); + }); + + t.test('third argument: excludedItems', function (st) { + forEach(v.objects.concat(v.primitives), function (nonArray) { + st['throws']( + function () { ES.CopyDataProperties({}, {}, nonArray); }, + TypeError, + debug(nonArray) + ' is not an Array' + ); + }); + + forEach(v.nonPropertyKeys, function (nonPropertyKey) { + st['throws']( + function () { ES.CopyDataProperties({}, {}, [nonPropertyKey]); }, + TypeError, + debug(nonPropertyKey) + ' is not a Property Key' + ); + }); + + var result = ES.CopyDataProperties({}, { a: 1, b: 2, c: 3 }, ['b']); + st.deepEqual(keys(result).sort(), ['a', 'c'].sort(), 'excluded string keys are excluded'); + + st.test('excluding symbols', { skip: !v.hasSymbols }, function (s2t) { + var source = {}; + forEach(v.symbols, function (symbol) { + source[symbol] = true; + }); + + var includedSymbols = v.symbols.slice(1); + var excludedSymbols = v.symbols.slice(0, 1); + var target = ES.CopyDataProperties({}, source, excludedSymbols); + + forEach(includedSymbols, function (symbol) { + s2t.equal(has(target, symbol), true, debug(symbol) + ' is included'); + }); + + forEach(excludedSymbols, function (symbol) { + s2t.equal(has(target, symbol), false, debug(symbol) + ' is excluded'); + }); + + s2t.end(); + }); + + st.end(); + }); + + t.end(); + }); + + test('PromiseResolve', function (t) { + t.test('Promises unsupported', { skip: typeof Promise === 'function' }, function (st) { + st['throws']( + function () { ES.PromiseResolve(); }, + SyntaxError, + 'Promises are not supported' + ); + st.end(); + }); + + t.test('Promises supported', { skip: typeof Promise !== 'function' }, function (st) { + st.plan(2); + + var a = {}; + var b = {}; + var fulfilled = Promise.resolve(a); + var rejected = Promise.reject(b); + + ES.PromiseResolve(Promise, fulfilled).then(function (x) { + st.equal(x, a, 'fulfilled promise resolves to fulfilled'); + }); + + ES.PromiseResolve(Promise, rejected)['catch'](function (e) { + st.equal(e, b, 'rejected promise resolves to rejected'); + }); + }); + + t.end(); + }); + + test('EnumerableOwnPropertyNames', { skip: skips && skips.EnumerableOwnPropertyNames }, function (t) { + var obj = testEnumerableOwnNames(t, function (O) { + return ES.EnumerableOwnPropertyNames(O, 'key'); + }); + + t.deepEqual( + ES.EnumerableOwnPropertyNames(obj, 'value'), + [obj.own], + 'returns enumerable own values' + ); + + t.deepEqual( + ES.EnumerableOwnPropertyNames(obj, 'key+value'), + [['own', obj.own]], + 'returns enumerable own entries' + ); + + t.end(); + }); + + test('IsPromise', { skip: typeof Promise !== 'function' }, function (t) { + forEach(v.objects.concat(v.primitives), function (nonPromise) { + t.equal(ES.IsPromise(nonPromise), false, debug(nonPromise) + ' is not a Promise'); + }); + + var thenable = { then: Promise.prototype.then }; + t.equal(ES.IsPromise(thenable), false, 'generic thenable is not a Promise'); + + t.equal(ES.IsPromise(Promise.resolve()), true, 'Promise is a Promise'); + + t.end(); + }); + + test('GetSubstitution (ES2018+)', function (t) { + forEach(v.nonStrings, function (nonString) { + t['throws']( + function () { ES.GetSubstitution(nonString, '', 0, [], undefined, ''); }, + TypeError, + '`matched`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', nonString, 0, [], undefined, ''); }, + TypeError, + '`str`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', '', 0, [], undefined, nonString); }, + TypeError, + '`replacement`: ' + debug(nonString) + ' is not a String' + ); + + t['throws']( + function () { ES.GetSubstitution('', '', 0, [nonString], undefined, ''); }, + TypeError, + '`captures`: ' + debug([nonString]) + ' is not an Array of strings' + ); + }); + + forEach(v.nonIntegerNumbers.concat([-1, -42, -Infinity]), function (nonNonNegativeInteger) { + t['throws']( + function () { ES.GetSubstitution('', '', nonNonNegativeInteger, [], undefined, ''); }, + TypeError, + '`position`: ' + debug(nonNonNegativeInteger) + ' is not a non-negative integer' + ); + }); + + forEach(v.nonArrays, function (nonArray) { + t['throws']( + function () { ES.GetSubstitution('', '', 0, nonArray, undefined, ''); }, + TypeError, + '`captures`: ' + debug(nonArray) + ' is not an Array' + ); + }); + + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], undefined, '123'), + '123', + 'returns the substitution' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '$$2$'), + '$2$', + 'supports $$, and trailing $' + ); + + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$&<'), + '>abcdef<', + 'supports $&' + ); + + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$`<'), + '><', + 'supports $` at position 0' + ); + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], undefined, '>$`<'), + '>ab<', + 'supports $` at position > 0' + ); + + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 7, [], undefined, ">$'<"), + '><', + "supports $' at a position where there's less than `matched.length` chars left" + ); + t.equal( + ES.GetSubstitution('def', 'abcdefghi', 3, [], undefined, ">$'<"), + '>ghi<', + "supports $' at a position where there's more than `matched.length` chars left" + ); + + for (var i = 0; i < 100; i += 1) { + var captures = []; + captures[i] = 'test'; + if (i > 0) { + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$' + i + '<'), + '>undefined<', + 'supports $' + i + ' with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$' + i), + '>undefined', + 'supports $' + i + ' at the end of the replacement, with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, undefined, '>$' + i + '<'), + '><', + 'supports $' + i + ' with a capture at that index' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, undefined, '>$' + i), + '>', + 'supports $' + i + ' at the end of the replacement, with a capture at that index' + ); + } + if (i < 10) { + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$0' + i + '<'), + i === 0 ? '><' : '>undefined<', + 'supports $0' + i + ' with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, [], undefined, '>$0' + i), + i === 0 ? '>' : '>undefined', + 'supports $0' + i + ' at the end of the replacement, with no captures' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, undefined, '>$0' + i + '<'), + '><', + 'supports $0' + i + ' with a capture at that index' + ); + t.equal( + ES.GetSubstitution('abcdef', 'abcdefghi', 0, captures, undefined, '>$0' + i), + '>', + 'supports $0' + i + ' at the end of the replacement, with a capture at that index' + ); + } + } + + t.end(); + }); + + test('DateString', function (t) { + forEach(v.nonNumbers.concat(NaN), function (nonNumberOrNaN) { + t['throws']( + function () { ES.DateString(nonNumberOrNaN); }, + TypeError, + debug(nonNumberOrNaN) + ' is not a non-NaN Number' + ); + }); + + t.equal(ES.DateString(Date.UTC(2019, 8, 10, 7, 8, 9)), 'Tue Sep 10 2019'); + t.equal(ES.DateString(Date.UTC(2016, 1, 29, 7, 8, 9)), 'Mon Feb 29 2016'); // leap day + t.end(); + }); + + test('TimeString', function (t) { + forEach(v.nonNumbers.concat(NaN), function (nonNumberOrNaN) { + t['throws']( + function () { ES.TimeString(nonNumberOrNaN); }, + TypeError, + debug(nonNumberOrNaN) + ' is not a non-NaN Number' + ); + }); + + var tv = Date.UTC(2019, 8, 10, 7, 8, 9); + t.equal(ES.TimeString(tv), '07:08:09 GMT'); + t.end(); + }); +}; + +var es2019 = function ES2018(ES, ops, expectedMissing, skips) { + es2018(ES, ops, expectedMissing, assign({}, skips, { + })); + + test('AddEntriesFromIterable', function (t) { + t['throws']( + function () { ES.AddEntriesFromIterable({}, undefined, function () {}); }, + TypeError, + 'iterable must not be undefined' + ); + t['throws']( + function () { ES.AddEntriesFromIterable({}, null, function () {}); }, + TypeError, + 'iterable must not be null' + ); + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { ES.AddEntriesFromIterable({}, {}, nonFunction); }, + TypeError, + debug(nonFunction) + ' is not a function' + ); + }); + + t.test('Symbol support', { skip: !v.hasSymbols }, function (st) { + st.plan(4); + + var O = {}; + st.equal(ES.AddEntriesFromIterable(O, [], function () {}), O, 'returns the target'); + + var adder = function (key, value) { + st.equal(this, O, 'adder gets proper receiver'); + st.equal(key, 0, 'k is key'); + st.equal(value, 'a', 'v is value'); + }; + ES.AddEntriesFromIterable(O, ['a'].entries(), adder); + + st.end(); + }); + + t.end(); + }); + + test('FlattenIntoArray', function (t) { + t.test('no mapper function', function (st) { + var testDepth = function testDepth(tt, depth, expected) { + var a = []; + var o = [[1], 2, , [[3]], [], 4, [[[[5]]]]]; // eslint-disable-line no-sparse-arrays + ES.FlattenIntoArray(a, o, o.length, 0, depth); + tt.deepEqual(a, expected, 'depth: ' + depth); + }; + + testDepth(st, 1, [1, 2, [3], 4, [[[5]]]]); + testDepth(st, 2, [1, 2, 3, 4, [[5]]]); + testDepth(st, 3, [1, 2, 3, 4, [5]]); + testDepth(st, 4, [1, 2, 3, 4, 5]); + testDepth(st, Infinity, [1, 2, 3, 4, 5]); + st.end(); + }); + + t.test('mapper function', function (st) { + var testMapper = function testMapper(tt, mapper, expected, thisArg) { + var a = []; + var o = [[1], 2, , [[3]], [], 4, [[[[5]]]]]; // eslint-disable-line no-sparse-arrays + ES.FlattenIntoArray(a, o, o.length, 0, 1, mapper, thisArg); + tt.deepEqual(a, expected); + }; + + var double = function double(x) { + return typeof x === 'number' ? 2 * x : x; + }; + testMapper( + st, + double, + [1, 4, [3], 8, [[[5]]]] + ); + var receiver = hasStrictMode ? 42 : Object(42); + testMapper( + st, + function (x) { return [this, double(x)]; }, + [receiver, [1], receiver, 4, receiver, [[3]], receiver, [], receiver, 8, receiver, [[[[5]]]]], + 42 + ); + st.end(); + }); + + t.end(); + }); + + test('TrimString', function (t) { + t.test('non-object string', function (st) { + forEach(v.nullPrimitives, function (nullish) { + st['throws']( + function () { ES.TrimString(nullish); }, + debug(nullish) + ' is not an Object' + ); + }); + st.end(); + }); + + var string = ' \n abc \n '; + t.equal(ES.TrimString(string, 'start'), string.slice(string.indexOf('a'))); + t.equal(ES.TrimString(string, 'end'), string.slice(0, string.lastIndexOf('c') + 1)); + t.equal(ES.TrimString(string, 'start+end'), string.slice(string.indexOf('a'), string.lastIndexOf('c') + 1)); + + t.end(); + }); +}; + +module.exports = { + es2015: es2015, + es2016: es2016, + es2017: es2017, + es2018: es2018, + es2019: es2019 +}; diff --git a/node_modules/es-to-primitive/.eslintrc b/node_modules/es-to-primitive/.eslintrc new file mode 100644 index 000000000..b6639b96c --- /dev/null +++ b/node_modules/es-to-primitive/.eslintrc @@ -0,0 +1,22 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "complexity": [2, 14], + "func-name-matching": 0, + "id-length": [2, { "min": 1, "max": 24, "properties": "never" }], + "max-statements": [2, 20], + "new-cap": [2, { "capIsNewExceptions": ["GetMethod"] }] + }, + + "overrides": [ + { + "files": "test/**", + "rules": { + "max-lines-per-function": [2, { "max": 68 }], + }, + } + ], +} diff --git a/node_modules/es-to-primitive/.github/FUNDING.yml b/node_modules/es-to-primitive/.github/FUNDING.yml new file mode 100644 index 000000000..9f928ae80 --- /dev/null +++ b/node_modules/es-to-primitive/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/es-to-primitive +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/es-to-primitive/.travis.yml b/node_modules/es-to-primitive/.travis.yml new file mode 100644 index 000000000..d4c5a842f --- /dev/null +++ b/node_modules/es-to-primitive/.travis.yml @@ -0,0 +1,15 @@ +version: ~> 1.0 +language: node_js +cache: + directories: + - "$(nvm cache dir)" +os: + - linux +import: + - ljharb/travis-ci:node/all.yml + - ljharb/travis-ci:node/pretest.yml + - ljharb/travis-ci:node/posttest.yml + - ljharb/travis-ci:node/coverage.yml +matrix: + allow_failures: + - env: COVERAGE=true diff --git a/node_modules/es-to-primitive/CHANGELOG.md b/node_modules/es-to-primitive/CHANGELOG.md new file mode 100644 index 000000000..0a5dda780 --- /dev/null +++ b/node_modules/es-to-primitive/CHANGELOG.md @@ -0,0 +1,49 @@ +1.2.1 / 2019-11-08 +================= + * [readme] remove testling URLs + * [meta] add `funding` field + * [meta] create FUNDING.yml + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `covert`, `replace`, `semver`, `tape`, `function.prototype.name` + * [Tests] use shared travis-ci configs + * [Tests] Add es5 tests for `symbol` types (#45) + * [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops + * [Tests] remove `jscs` + +1.2.0 / 2018-09-27 +================= + * [New] create ES2015 entry point/property, to replace ES6 + * [Fix] Ensure optional arguments are not part of the length (#29) + * [Deps] update `is-callable` + * [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver`, `object-inspect`, `replace` + * [Tests] avoid util.inspect bug with `new Date(NaN)` on node v6.0 and v6.1. + * [Tests] up to `node` `v10.11`, `v9.11`, `v8.12`, `v6.14`, `v4.9` + +1.1.1 / 2016-01-03 +================= + * [Fix: ES5] fix coercion logic: ES5’s ToPrimitive does not coerce any primitive value, regardless of hint (#2) + +1.1.0 / 2015-12-27 +================= + * [New] add `Symbol.toPrimitive` support + * [Deps] update `is-callable`, `is-date-object` + * [Dev Deps] update `eslint`, `tape`, `semver`, `jscs`, `covert`, `nsp`, `@ljharb/eslint-config` + * [Dev Deps] remove unused deps + * [Tests] up to `node` `v5.3` + * [Tests] fix npm upgrades on older node versions + * [Tests] fix testling + * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG + +1.0.1 / 2016-01-03 +================= + * [Fix: ES5] fix coercion logic: ES5’s ToPrimitive does not coerce any primitive value, regardless of hint (#2) + * [Deps] update `is-callable`, `is-date-object` + * [Dev Deps] update `eslint`, `tape`, `semver`, `jscs`, `covert`, `nsp`, `@ljharb/eslint-config` + * [Dev Deps] remove unused deps + * [Tests] up to `node` `v5.3` + * [Tests] fix npm upgrades on older node versions + * [Tests] fix testling + * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG + +1.0.0 / 2015-03-19 +================= + * Initial release. diff --git a/node_modules/es-to-primitive/LICENSE b/node_modules/es-to-primitive/LICENSE new file mode 100644 index 000000000..b43df444e --- /dev/null +++ b/node_modules/es-to-primitive/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/es-to-primitive/Makefile b/node_modules/es-to-primitive/Makefile new file mode 100644 index 000000000..b9e4fe1aa --- /dev/null +++ b/node_modules/es-to-primitive/Makefile @@ -0,0 +1,61 @@ +# Since we rely on paths relative to the makefile location, abort if make isn't being run from there. +$(if $(findstring /,$(MAKEFILE_LIST)),$(error Please only invoke this makefile from the directory it resides in)) + + # The files that need updating when incrementing the version number. +VERSIONED_FILES := *.js *.json README* + + +# Add the local npm packages' bin folder to the PATH, so that `make` can find them, when invoked directly. +# Note that rather than using `$(npm bin)` the 'node_modules/.bin' path component is hard-coded, so that invocation works even from an environment +# where npm is (temporarily) unavailable due to having deactivated an nvm instance loaded into the calling shell in order to avoid interference with tests. +export PATH := $(shell printf '%s' "$$PWD/node_modules/.bin:$$PATH") +UTILS := semver +# Make sure that all required utilities can be located. +UTIL_CHECK := $(or $(shell PATH="$(PATH)" which $(UTILS) >/dev/null && echo 'ok'),$(error Did you forget to run `npm install` after cloning the repo? At least one of the required supporting utilities not found: $(UTILS))) + +# Default target (by virtue of being the first non '.'-prefixed in the file). +.PHONY: _no-target-specified +_no-target-specified: + $(error Please specify the target to make - `make list` shows targets. Alternatively, use `npm test` to run the default tests; `npm run` shows all tests) + +# Lists all targets defined in this makefile. +.PHONY: list +list: + @$(MAKE) -pRrn : -f $(MAKEFILE_LIST) 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | command grep -v -e '^[^[:alnum:]]' -e '^$@$$command ' | sort + +# All-tests target: invokes the specified test suites for ALL shells defined in $(SHELLS). +.PHONY: test +test: + @npm test + +.PHONY: _ensure-tag +_ensure-tag: +ifndef TAG + $(error Please invoke with `make TAG= release`, where is either an increment specifier (patch, minor, major, prepatch, preminor, premajor, prerelease), or an explicit major.minor.patch version number) +endif + +CHANGELOG_ERROR = $(error No CHANGELOG specified) +.PHONY: _ensure-changelog +_ensure-changelog: + @ (git status -sb --porcelain | command grep -E '^( M|[MA] ) CHANGELOG.md' > /dev/null) || (echo no CHANGELOG.md specified && exit 2) + +# Ensures that the git workspace is clean. +.PHONY: _ensure-clean +_ensure-clean: + @[ -z "$$((git status --porcelain --untracked-files=no || echo err) | command grep -v 'CHANGELOG.md')" ] || { echo "Workspace is not clean; please commit changes first." >&2; exit 2; } + +# Makes a release; invoke with `make TAG= release`. +.PHONY: release +release: _ensure-tag _ensure-changelog _ensure-clean + @old_ver=`git describe --abbrev=0 --tags --match 'v[0-9]*.[0-9]*.[0-9]*'` || { echo "Failed to determine current version." >&2; exit 1; }; old_ver=$${old_ver#v}; \ + new_ver=`echo "$(TAG)" | sed 's/^v//'`; new_ver=$${new_ver:-patch}; \ + if printf "$$new_ver" | command grep -q '^[0-9]'; then \ + semver "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be major.minor.patch' >&2; exit 2; }; \ + semver -r "> $$old_ver" "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be HIGHER than current one.' >&2; exit 2; } \ + else \ + new_ver=`semver -i "$$new_ver" "$$old_ver"` || { echo 'Invalid version-increment specifier: $(TAG)' >&2; exit 2; } \ + fi; \ + printf "=== Bumping version **$$old_ver** to **$$new_ver** before committing and tagging:\n=== TYPE 'proceed' TO PROCEED, anything else to abort: " && read response && [ "$$response" = 'proceed' ] || { echo 'Aborted.' >&2; exit 2; }; \ + replace "$$old_ver" "$$new_ver" -- $(VERSIONED_FILES) && \ + git commit -m "v$$new_ver" $(VERSIONED_FILES) CHANGELOG.md && \ + git tag -a -m "v$$new_ver" "v$$new_ver" diff --git a/node_modules/es-to-primitive/README.md b/node_modules/es-to-primitive/README.md new file mode 100644 index 000000000..5ce322bfa --- /dev/null +++ b/node_modules/es-to-primitive/README.md @@ -0,0 +1,49 @@ +# es-to-primitive [![Version Badge][npm-version-svg]][package-url] + +[![Build Status][travis-svg]][travis-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +ECMAScript “ToPrimitive” algorithm. Provides ES5 and ES2015 versions. +When different versions of the spec conflict, the default export will be the latest version of the abstract operation. +Alternative versions will also be available under an `es5`/`es2015` exported property if you require a specific version. + +## Example + +```js +var toPrimitive = require('es-to-primitive'); +var assert = require('assert'); + +assert(toPrimitive(function () {}) === String(function () {})); + +var date = new Date(); +assert(toPrimitive(date) === String(date)); + +assert(toPrimitive({ valueOf: function () { return 3; } }) === 3); + +assert(toPrimitive(['a', 'b', 3]) === String(['a', 'b', 3])); + +var sym = Symbol(); +assert(toPrimitive(Object(sym)) === sym); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/es-to-primitive +[npm-version-svg]: http://versionbadg.es/ljharb/es-to-primitive.svg +[travis-svg]: https://travis-ci.org/ljharb/es-to-primitive.svg +[travis-url]: https://travis-ci.org/ljharb/es-to-primitive +[deps-svg]: https://david-dm.org/ljharb/es-to-primitive.svg +[deps-url]: https://david-dm.org/ljharb/es-to-primitive +[dev-deps-svg]: https://david-dm.org/ljharb/es-to-primitive/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/es-to-primitive#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/es-to-primitive.png?downloads=true&stars=true +[license-image]: http://img.shields.io/npm/l/es-to-primitive.svg +[license-url]: LICENSE +[downloads-image]: http://img.shields.io/npm/dm/es-to-primitive.svg +[downloads-url]: http://npm-stat.com/charts.html?package=es-to-primitive diff --git a/node_modules/es-to-primitive/es2015.js b/node_modules/es-to-primitive/es2015.js new file mode 100644 index 000000000..4a11a346c --- /dev/null +++ b/node_modules/es-to-primitive/es2015.js @@ -0,0 +1,75 @@ +'use strict'; + +var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; + +var isPrimitive = require('./helpers/isPrimitive'); +var isCallable = require('is-callable'); +var isDate = require('is-date-object'); +var isSymbol = require('is-symbol'); + +var ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) { + if (typeof O === 'undefined' || O === null) { + throw new TypeError('Cannot call method on ' + O); + } + if (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) { + throw new TypeError('hint must be "string" or "number"'); + } + var methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString']; + var method, result, i; + for (i = 0; i < methodNames.length; ++i) { + method = O[methodNames[i]]; + if (isCallable(method)) { + result = method.call(O); + if (isPrimitive(result)) { + return result; + } + } + } + throw new TypeError('No default value'); +}; + +var GetMethod = function GetMethod(O, P) { + var func = O[P]; + if (func !== null && typeof func !== 'undefined') { + if (!isCallable(func)) { + throw new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function'); + } + return func; + } + return void 0; +}; + +// http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive +module.exports = function ToPrimitive(input) { + if (isPrimitive(input)) { + return input; + } + var hint = 'default'; + if (arguments.length > 1) { + if (arguments[1] === String) { + hint = 'string'; + } else if (arguments[1] === Number) { + hint = 'number'; + } + } + + var exoticToPrim; + if (hasSymbols) { + if (Symbol.toPrimitive) { + exoticToPrim = GetMethod(input, Symbol.toPrimitive); + } else if (isSymbol(input)) { + exoticToPrim = Symbol.prototype.valueOf; + } + } + if (typeof exoticToPrim !== 'undefined') { + var result = exoticToPrim.call(input, hint); + if (isPrimitive(result)) { + return result; + } + throw new TypeError('unable to convert exotic object to primitive'); + } + if (hint === 'default' && (isDate(input) || isSymbol(input))) { + hint = 'string'; + } + return ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint); +}; diff --git a/node_modules/es-to-primitive/es5.js b/node_modules/es-to-primitive/es5.js new file mode 100644 index 000000000..602aa362c --- /dev/null +++ b/node_modules/es-to-primitive/es5.js @@ -0,0 +1,45 @@ +'use strict'; + +var toStr = Object.prototype.toString; + +var isPrimitive = require('./helpers/isPrimitive'); + +var isCallable = require('is-callable'); + +// http://ecma-international.org/ecma-262/5.1/#sec-8.12.8 +var ES5internalSlots = { + '[[DefaultValue]]': function (O) { + var actualHint; + if (arguments.length > 1) { + actualHint = arguments[1]; + } else { + actualHint = toStr.call(O) === '[object Date]' ? String : Number; + } + + if (actualHint === String || actualHint === Number) { + var methods = actualHint === String ? ['toString', 'valueOf'] : ['valueOf', 'toString']; + var value, i; + for (i = 0; i < methods.length; ++i) { + if (isCallable(O[methods[i]])) { + value = O[methods[i]](); + if (isPrimitive(value)) { + return value; + } + } + } + throw new TypeError('No default value'); + } + throw new TypeError('invalid [[DefaultValue]] hint supplied'); + } +}; + +// http://ecma-international.org/ecma-262/5.1/#sec-9.1 +module.exports = function ToPrimitive(input) { + if (isPrimitive(input)) { + return input; + } + if (arguments.length > 1) { + return ES5internalSlots['[[DefaultValue]]'](input, arguments[1]); + } + return ES5internalSlots['[[DefaultValue]]'](input); +}; diff --git a/node_modules/es-to-primitive/es6.js b/node_modules/es-to-primitive/es6.js new file mode 100644 index 000000000..2d1f4dc92 --- /dev/null +++ b/node_modules/es-to-primitive/es6.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./es2015'); diff --git a/node_modules/es-to-primitive/helpers/isPrimitive.js b/node_modules/es-to-primitive/helpers/isPrimitive.js new file mode 100644 index 000000000..06f0bf042 --- /dev/null +++ b/node_modules/es-to-primitive/helpers/isPrimitive.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function isPrimitive(value) { + return value === null || (typeof value !== 'function' && typeof value !== 'object'); +}; diff --git a/node_modules/es-to-primitive/index.js b/node_modules/es-to-primitive/index.js new file mode 100644 index 000000000..e60d912e1 --- /dev/null +++ b/node_modules/es-to-primitive/index.js @@ -0,0 +1,17 @@ +'use strict'; + +var ES5 = require('./es5'); +var ES6 = require('./es6'); +var ES2015 = require('./es2015'); + +if (Object.defineProperty) { + Object.defineProperty(ES2015, 'ES5', { enumerable: false, value: ES5 }); + Object.defineProperty(ES2015, 'ES6', { enumerable: false, value: ES6 }); + Object.defineProperty(ES2015, 'ES2015', { enumerable: false, value: ES2015 }); +} else { + ES6.ES5 = ES5; + ES6.ES6 = ES6; + ES6.ES2015 = ES2015; +} + +module.exports = ES2015; diff --git a/node_modules/es-to-primitive/package.json b/node_modules/es-to-primitive/package.json new file mode 100644 index 000000000..475c3ffdb --- /dev/null +++ b/node_modules/es-to-primitive/package.json @@ -0,0 +1,81 @@ +{ + "name": "es-to-primitive", + "version": "1.2.1", + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "description": "ECMAScript “ToPrimitive” algorithm. Provides ES5 and ES2015 versions.", + "license": "MIT", + "main": "index.js", + "scripts": { + "pretest": "npm run --silent lint", + "test": "npm run --silent tests-only", + "posttest": "npx aud", + "tests-only": "node --es-staging test", + "coverage": "covert test/*.js", + "coverage-quiet": "covert test/*.js --quiet", + "lint": "eslint ." + }, + "repository": { + "type": "git", + "url": "git://github.com/ljharb/es-to-primitive.git" + }, + "keywords": [ + "primitive", + "abstract", + "ecmascript", + "es5", + "es6", + "es2015", + "toPrimitive", + "coerce", + "type", + "object", + "string", + "number", + "boolean", + "symbol", + "null", + "undefined" + ], + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "devDependencies": { + "@ljharb/eslint-config": "^15.0.0", + "covert": "^1.1.1", + "eslint": "^6.6.0", + "foreach": "^2.0.5", + "function.prototype.name": "^1.1.1", + "has-symbols": "^1.0.0", + "object-inspect": "^1.6.0", + "object-is": "^1.0.1", + "replace": "^1.1.1", + "semver": "^6.3.0", + "tape": "^4.11.0" + }, + "testling": { + "files": "test", + "browsers": [ + "iexplore/6.0..latest", + "firefox/3.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/10.0..latest", + "opera/next", + "safari/4.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "engines": { + "node": ">= 0.4" + } +} \ No newline at end of file diff --git a/node_modules/es-to-primitive/test/es2015.js b/node_modules/es-to-primitive/test/es2015.js new file mode 100644 index 000000000..80f4083dd --- /dev/null +++ b/node_modules/es-to-primitive/test/es2015.js @@ -0,0 +1,151 @@ +'use strict'; + +var test = require('tape'); +var toPrimitive = require('../es2015'); +var is = require('object-is'); +var forEach = require('foreach'); +var functionName = require('function.prototype.name'); +var debug = require('object-inspect'); + +var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; +var hasSymbolToPrimitive = hasSymbols && typeof Symbol.toPrimitive === 'symbol'; + +test('function properties', function (t) { + t.equal(toPrimitive.length, 1, 'length is 1'); + t.equal(functionName(toPrimitive), 'ToPrimitive', 'name is ToPrimitive'); + + t.end(); +}); + +var primitives = [null, undefined, true, false, 0, -0, 42, NaN, Infinity, -Infinity, '', 'abc']; + +test('primitives', function (t) { + forEach(primitives, function (i) { + t.ok(is(toPrimitive(i), i), 'toPrimitive(' + debug(i) + ') returns the same value'); + t.ok(is(toPrimitive(i, String), i), 'toPrimitive(' + debug(i) + ', String) returns the same value'); + t.ok(is(toPrimitive(i, Number), i), 'toPrimitive(' + debug(i) + ', Number) returns the same value'); + }); + t.end(); +}); + +test('Symbols', { skip: !hasSymbols }, function (t) { + var symbols = [ + Symbol('foo'), + Symbol.iterator, + Symbol['for']('foo') // eslint-disable-line no-restricted-properties + ]; + forEach(symbols, function (sym) { + t.equal(toPrimitive(sym), sym, 'toPrimitive(' + debug(sym) + ') returns the same value'); + t.equal(toPrimitive(sym, String), sym, 'toPrimitive(' + debug(sym) + ', String) returns the same value'); + t.equal(toPrimitive(sym, Number), sym, 'toPrimitive(' + debug(sym) + ', Number) returns the same value'); + }); + + var primitiveSym = Symbol('primitiveSym'); + var objectSym = Object(primitiveSym); + t.equal(toPrimitive(objectSym), primitiveSym, 'toPrimitive(' + debug(objectSym) + ') returns ' + debug(primitiveSym)); + t.equal(toPrimitive(objectSym, String), primitiveSym, 'toPrimitive(' + debug(objectSym) + ', String) returns ' + debug(primitiveSym)); + t.equal(toPrimitive(objectSym, Number), primitiveSym, 'toPrimitive(' + debug(objectSym) + ', Number) returns ' + debug(primitiveSym)); + t.end(); +}); + +test('Arrays', function (t) { + var arrays = [[], ['a', 'b'], [1, 2]]; + forEach(arrays, function (arr) { + t.equal(toPrimitive(arr), String(arr), 'toPrimitive(' + debug(arr) + ') returns the string version of the array'); + t.equal(toPrimitive(arr, String), String(arr), 'toPrimitive(' + debug(arr) + ') returns the string version of the array'); + t.equal(toPrimitive(arr, Number), String(arr), 'toPrimitive(' + debug(arr) + ') returns the string version of the array'); + }); + t.end(); +}); + +test('Dates', function (t) { + var dates = [new Date(), new Date(0), new Date(NaN)]; + forEach(dates, function (date) { + t.equal(toPrimitive(date), String(date), 'toPrimitive(' + debug(date) + ') returns the string version of the date'); + t.equal(toPrimitive(date, String), String(date), 'toPrimitive(' + debug(date) + ') returns the string version of the date'); + t.ok(is(toPrimitive(date, Number), Number(date)), 'toPrimitive(' + debug(date) + ') returns the number version of the date'); + }); + t.end(); +}); + +var coercibleObject = { valueOf: function () { return 3; }, toString: function () { return 42; } }; +var valueOfOnlyObject = { valueOf: function () { return 4; }, toString: function () { return {}; } }; +var toStringOnlyObject = { valueOf: function () { return {}; }, toString: function () { return 7; } }; +var coercibleFnObject = { + valueOf: function () { return function valueOfFn() {}; }, + toString: function () { return 42; } +}; +var uncoercibleObject = { valueOf: function () { return {}; }, toString: function () { return {}; } }; +var uncoercibleFnObject = { + valueOf: function () { return function valueOfFn() {}; }, + toString: function () { return function toStrFn() {}; } +}; + +test('Objects', function (t) { + t.equal(toPrimitive(coercibleObject), coercibleObject.valueOf(), 'coercibleObject with no hint coerces to valueOf'); + t.equal(toPrimitive(coercibleObject, Number), coercibleObject.valueOf(), 'coercibleObject with hint Number coerces to valueOf'); + t.equal(toPrimitive(coercibleObject, String), coercibleObject.toString(), 'coercibleObject with hint String coerces to non-stringified toString'); + + t.equal(toPrimitive(coercibleFnObject), coercibleFnObject.toString(), 'coercibleFnObject coerces to non-stringified toString'); + t.equal(toPrimitive(coercibleFnObject, Number), coercibleFnObject.toString(), 'coercibleFnObject with hint Number coerces to non-stringified toString'); + t.equal(toPrimitive(coercibleFnObject, String), coercibleFnObject.toString(), 'coercibleFnObject with hint String coerces to non-stringified toString'); + + t.equal(toPrimitive({}), '[object Object]', '{} with no hint coerces to Object#toString'); + t.equal(toPrimitive({}, Number), '[object Object]', '{} with hint Number coerces to Object#toString'); + t.equal(toPrimitive({}, String), '[object Object]', '{} with hint String coerces to Object#toString'); + + t.equal(toPrimitive(toStringOnlyObject), toStringOnlyObject.toString(), 'toStringOnlyObject returns non-stringified toString'); + t.equal(toPrimitive(toStringOnlyObject, Number), toStringOnlyObject.toString(), 'toStringOnlyObject with hint Number returns non-stringified toString'); + t.equal(toPrimitive(toStringOnlyObject, String), toStringOnlyObject.toString(), 'toStringOnlyObject with hint String returns non-stringified toString'); + + t.equal(toPrimitive(valueOfOnlyObject), valueOfOnlyObject.valueOf(), 'valueOfOnlyObject returns valueOf'); + t.equal(toPrimitive(valueOfOnlyObject, Number), valueOfOnlyObject.valueOf(), 'valueOfOnlyObject with hint Number returns valueOf'); + t.equal(toPrimitive(valueOfOnlyObject, String), valueOfOnlyObject.valueOf(), 'valueOfOnlyObject with hint String returns non-stringified valueOf'); + + t.test('Symbol.toPrimitive', { skip: !hasSymbolToPrimitive }, function (st) { + var overriddenObject = { toString: st.fail, valueOf: st.fail }; + overriddenObject[Symbol.toPrimitive] = function (hint) { return String(hint); }; + + st.equal(toPrimitive(overriddenObject), 'default', 'object with Symbol.toPrimitive + no hint invokes that'); + st.equal(toPrimitive(overriddenObject, Number), 'number', 'object with Symbol.toPrimitive + hint Number invokes that'); + st.equal(toPrimitive(overriddenObject, String), 'string', 'object with Symbol.toPrimitive + hint String invokes that'); + + var nullToPrimitive = { toString: coercibleObject.toString, valueOf: coercibleObject.valueOf }; + nullToPrimitive[Symbol.toPrimitive] = null; + st.equal(toPrimitive(nullToPrimitive), toPrimitive(coercibleObject), 'object with no hint + null Symbol.toPrimitive ignores it'); + st.equal(toPrimitive(nullToPrimitive, Number), toPrimitive(coercibleObject, Number), 'object with hint Number + null Symbol.toPrimitive ignores it'); + st.equal(toPrimitive(nullToPrimitive, String), toPrimitive(coercibleObject, String), 'object with hint String + null Symbol.toPrimitive ignores it'); + + st.test('exceptions', function (sst) { + var nonFunctionToPrimitive = { toString: sst.fail, valueOf: sst.fail }; + nonFunctionToPrimitive[Symbol.toPrimitive] = {}; + sst['throws'](toPrimitive.bind(null, nonFunctionToPrimitive), TypeError, 'Symbol.toPrimitive returning a non-function throws'); + + var uncoercibleToPrimitive = { toString: sst.fail, valueOf: sst.fail }; + uncoercibleToPrimitive[Symbol.toPrimitive] = function (hint) { + return { toString: function () { return hint; } }; + }; + sst['throws'](toPrimitive.bind(null, uncoercibleToPrimitive), TypeError, 'Symbol.toPrimitive returning an object throws'); + + var throwingToPrimitive = { toString: sst.fail, valueOf: sst.fail }; + throwingToPrimitive[Symbol.toPrimitive] = function (hint) { throw new RangeError(hint); }; + sst['throws'](toPrimitive.bind(null, throwingToPrimitive), RangeError, 'Symbol.toPrimitive throwing throws'); + + sst.end(); + }); + + st.end(); + }); + + t.test('exceptions', function (st) { + st['throws'](toPrimitive.bind(null, uncoercibleObject), TypeError, 'uncoercibleObject throws a TypeError'); + st['throws'](toPrimitive.bind(null, uncoercibleObject, Number), TypeError, 'uncoercibleObject with hint Number throws a TypeError'); + st['throws'](toPrimitive.bind(null, uncoercibleObject, String), TypeError, 'uncoercibleObject with hint String throws a TypeError'); + + st['throws'](toPrimitive.bind(null, uncoercibleFnObject), TypeError, 'uncoercibleFnObject throws a TypeError'); + st['throws'](toPrimitive.bind(null, uncoercibleFnObject, Number), TypeError, 'uncoercibleFnObject with hint Number throws a TypeError'); + st['throws'](toPrimitive.bind(null, uncoercibleFnObject, String), TypeError, 'uncoercibleFnObject with hint String throws a TypeError'); + st.end(); + }); + t.end(); +}); diff --git a/node_modules/es-to-primitive/test/es5.js b/node_modules/es-to-primitive/test/es5.js new file mode 100644 index 000000000..79444b0b4 --- /dev/null +++ b/node_modules/es-to-primitive/test/es5.js @@ -0,0 +1,118 @@ +'use strict'; + +var test = require('tape'); +var toPrimitive = require('../es5'); +var is = require('object-is'); +var forEach = require('foreach'); +var functionName = require('function.prototype.name'); +var debug = require('object-inspect'); +var hasSymbols = require('has-symbols')(); + +test('function properties', function (t) { + t.equal(toPrimitive.length, 1, 'length is 1'); + t.equal(functionName(toPrimitive), 'ToPrimitive', 'name is ToPrimitive'); + + t.end(); +}); + +var primitives = [null, undefined, true, false, 0, -0, 42, NaN, Infinity, -Infinity, '', 'abc']; + +test('primitives', function (t) { + forEach(primitives, function (i) { + t.ok(is(toPrimitive(i), i), 'toPrimitive(' + debug(i) + ') returns the same value'); + t.ok(is(toPrimitive(i, String), i), 'toPrimitive(' + debug(i) + ', String) returns the same value'); + t.ok(is(toPrimitive(i, Number), i), 'toPrimitive(' + debug(i) + ', Number) returns the same value'); + }); + t.end(); +}); + +test('Symbols', { skip: !hasSymbols }, function (t) { + var symbols = [ + Symbol('foo'), + Symbol.iterator, + Symbol['for']('foo') // eslint-disable-line no-restricted-properties + ]; + forEach(symbols, function (sym) { + t.equal(toPrimitive(sym), sym, 'toPrimitive(' + debug(sym) + ') returns the same value'); + t.equal(toPrimitive(sym, String), sym, 'toPrimitive(' + debug(sym) + ', String) returns the same value'); + t.equal(toPrimitive(sym, Number), sym, 'toPrimitive(' + debug(sym) + ', Number) returns the same value'); + }); + + var primitiveSym = Symbol('primitiveSym'); + var stringSym = Symbol.prototype.toString.call(primitiveSym); + var objectSym = Object(primitiveSym); + t.equal(toPrimitive(objectSym), primitiveSym, 'toPrimitive(' + debug(objectSym) + ') returns ' + debug(primitiveSym)); + + // This is different from ES2015, as the ES5 algorithm doesn't account for the existence of Symbols: + t.equal(toPrimitive(objectSym, String), stringSym, 'toPrimitive(' + debug(objectSym) + ', String) returns ' + debug(stringSym)); + t.equal(toPrimitive(objectSym, Number), primitiveSym, 'toPrimitive(' + debug(objectSym) + ', Number) returns ' + debug(primitiveSym)); + t.end(); +}); + +test('Arrays', function (t) { + var arrays = [[], ['a', 'b'], [1, 2]]; + forEach(arrays, function (arr) { + t.ok(is(toPrimitive(arr), arr.toString()), 'toPrimitive(' + debug(arr) + ') returns toString of the array'); + t.equal(toPrimitive(arr, String), arr.toString(), 'toPrimitive(' + debug(arr) + ') returns toString of the array'); + t.ok(is(toPrimitive(arr, Number), arr.toString()), 'toPrimitive(' + debug(arr) + ') returns toString of the array'); + }); + t.end(); +}); + +test('Dates', function (t) { + var dates = [new Date(), new Date(0), new Date(NaN)]; + forEach(dates, function (date) { + t.equal(toPrimitive(date), date.toString(), 'toPrimitive(' + debug(date) + ') returns toString of the date'); + t.equal(toPrimitive(date, String), date.toString(), 'toPrimitive(' + debug(date) + ') returns toString of the date'); + t.ok(is(toPrimitive(date, Number), date.valueOf()), 'toPrimitive(' + debug(date) + ') returns valueOf of the date'); + }); + t.end(); +}); + +var coercibleObject = { valueOf: function () { return 3; }, toString: function () { return 42; } }; +var valueOfOnlyObject = { valueOf: function () { return 4; }, toString: function () { return {}; } }; +var toStringOnlyObject = { valueOf: function () { return {}; }, toString: function () { return 7; } }; +var coercibleFnObject = { + valueOf: function () { return function valueOfFn() {}; }, + toString: function () { return 42; } +}; +var uncoercibleObject = { valueOf: function () { return {}; }, toString: function () { return {}; } }; +var uncoercibleFnObject = { + valueOf: function () { return function valueOfFn() {}; }, + toString: function () { return function toStrFn() {}; } +}; + +test('Objects', function (t) { + t.equal(toPrimitive(coercibleObject), coercibleObject.valueOf(), 'coercibleObject with no hint coerces to valueOf'); + t.equal(toPrimitive(coercibleObject, String), coercibleObject.toString(), 'coercibleObject with hint String coerces to toString'); + t.equal(toPrimitive(coercibleObject, Number), coercibleObject.valueOf(), 'coercibleObject with hint Number coerces to valueOf'); + + t.equal(toPrimitive(coercibleFnObject), coercibleFnObject.toString(), 'coercibleFnObject coerces to toString'); + t.equal(toPrimitive(coercibleFnObject, String), coercibleFnObject.toString(), 'coercibleFnObject with hint String coerces to toString'); + t.equal(toPrimitive(coercibleFnObject, Number), coercibleFnObject.toString(), 'coercibleFnObject with hint Number coerces to toString'); + + t.ok(is(toPrimitive({}), '[object Object]'), '{} with no hint coerces to Object#toString'); + t.equal(toPrimitive({}, String), '[object Object]', '{} with hint String coerces to Object#toString'); + t.ok(is(toPrimitive({}, Number), '[object Object]'), '{} with hint Number coerces to Object#toString'); + + t.equal(toPrimitive(toStringOnlyObject), toStringOnlyObject.toString(), 'toStringOnlyObject returns toString'); + t.equal(toPrimitive(toStringOnlyObject, String), toStringOnlyObject.toString(), 'toStringOnlyObject with hint String returns toString'); + t.equal(toPrimitive(toStringOnlyObject, Number), toStringOnlyObject.toString(), 'toStringOnlyObject with hint Number returns toString'); + + t.equal(toPrimitive(valueOfOnlyObject), valueOfOnlyObject.valueOf(), 'valueOfOnlyObject returns valueOf'); + t.equal(toPrimitive(valueOfOnlyObject, String), valueOfOnlyObject.valueOf(), 'valueOfOnlyObject with hint String returns valueOf'); + t.equal(toPrimitive(valueOfOnlyObject, Number), valueOfOnlyObject.valueOf(), 'valueOfOnlyObject with hint Number returns valueOf'); + + t.test('exceptions', function (st) { + st['throws'](toPrimitive.bind(null, uncoercibleObject), TypeError, 'uncoercibleObject throws a TypeError'); + st['throws'](toPrimitive.bind(null, uncoercibleObject, String), TypeError, 'uncoercibleObject with hint String throws a TypeError'); + st['throws'](toPrimitive.bind(null, uncoercibleObject, Number), TypeError, 'uncoercibleObject with hint Number throws a TypeError'); + + st['throws'](toPrimitive.bind(null, uncoercibleFnObject), TypeError, 'uncoercibleFnObject throws a TypeError'); + st['throws'](toPrimitive.bind(null, uncoercibleFnObject, String), TypeError, 'uncoercibleFnObject with hint String throws a TypeError'); + st['throws'](toPrimitive.bind(null, uncoercibleFnObject, Number), TypeError, 'uncoercibleFnObject with hint Number throws a TypeError'); + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/es-to-primitive/test/es6.js b/node_modules/es-to-primitive/test/es6.js new file mode 100644 index 000000000..16ea0e8f3 --- /dev/null +++ b/node_modules/es-to-primitive/test/es6.js @@ -0,0 +1,151 @@ +'use strict'; + +var test = require('tape'); +var toPrimitive = require('../es6'); +var is = require('object-is'); +var forEach = require('foreach'); +var functionName = require('function.prototype.name'); +var debug = require('object-inspect'); + +var hasSymbols = require('has-symbols')(); +var hasSymbolToPrimitive = hasSymbols && typeof Symbol.toPrimitive === 'symbol'; + +test('function properties', function (t) { + t.equal(toPrimitive.length, 1, 'length is 1'); + t.equal(functionName(toPrimitive), 'ToPrimitive', 'name is ToPrimitive'); + + t.end(); +}); + +var primitives = [null, undefined, true, false, 0, -0, 42, NaN, Infinity, -Infinity, '', 'abc']; + +test('primitives', function (t) { + forEach(primitives, function (i) { + t.ok(is(toPrimitive(i), i), 'toPrimitive(' + debug(i) + ') returns the same value'); + t.ok(is(toPrimitive(i, String), i), 'toPrimitive(' + debug(i) + ', String) returns the same value'); + t.ok(is(toPrimitive(i, Number), i), 'toPrimitive(' + debug(i) + ', Number) returns the same value'); + }); + t.end(); +}); + +test('Symbols', { skip: !hasSymbols }, function (t) { + var symbols = [ + Symbol('foo'), + Symbol.iterator, + Symbol['for']('foo') // eslint-disable-line no-restricted-properties + ]; + forEach(symbols, function (sym) { + t.equal(toPrimitive(sym), sym, 'toPrimitive(' + debug(sym) + ') returns the same value'); + t.equal(toPrimitive(sym, String), sym, 'toPrimitive(' + debug(sym) + ', String) returns the same value'); + t.equal(toPrimitive(sym, Number), sym, 'toPrimitive(' + debug(sym) + ', Number) returns the same value'); + }); + + var primitiveSym = Symbol('primitiveSym'); + var objectSym = Object(primitiveSym); + t.equal(toPrimitive(objectSym), primitiveSym, 'toPrimitive(' + debug(objectSym) + ') returns ' + debug(primitiveSym)); + t.equal(toPrimitive(objectSym, String), primitiveSym, 'toPrimitive(' + debug(objectSym) + ', String) returns ' + debug(primitiveSym)); + t.equal(toPrimitive(objectSym, Number), primitiveSym, 'toPrimitive(' + debug(objectSym) + ', Number) returns ' + debug(primitiveSym)); + t.end(); +}); + +test('Arrays', function (t) { + var arrays = [[], ['a', 'b'], [1, 2]]; + forEach(arrays, function (arr) { + t.equal(toPrimitive(arr), String(arr), 'toPrimitive(' + debug(arr) + ') returns the string version of the array'); + t.equal(toPrimitive(arr, String), String(arr), 'toPrimitive(' + debug(arr) + ') returns the string version of the array'); + t.equal(toPrimitive(arr, Number), String(arr), 'toPrimitive(' + debug(arr) + ') returns the string version of the array'); + }); + t.end(); +}); + +test('Dates', function (t) { + var dates = [new Date(), new Date(0), new Date(NaN)]; + forEach(dates, function (date) { + t.equal(toPrimitive(date), String(date), 'toPrimitive(' + debug(date) + ') returns the string version of the date'); + t.equal(toPrimitive(date, String), String(date), 'toPrimitive(' + debug(date) + ') returns the string version of the date'); + t.ok(is(toPrimitive(date, Number), Number(date)), 'toPrimitive(' + debug(date) + ') returns the number version of the date'); + }); + t.end(); +}); + +var coercibleObject = { valueOf: function () { return 3; }, toString: function () { return 42; } }; +var valueOfOnlyObject = { valueOf: function () { return 4; }, toString: function () { return {}; } }; +var toStringOnlyObject = { valueOf: function () { return {}; }, toString: function () { return 7; } }; +var coercibleFnObject = { + valueOf: function () { return function valueOfFn() {}; }, + toString: function () { return 42; } +}; +var uncoercibleObject = { valueOf: function () { return {}; }, toString: function () { return {}; } }; +var uncoercibleFnObject = { + valueOf: function () { return function valueOfFn() {}; }, + toString: function () { return function toStrFn() {}; } +}; + +test('Objects', function (t) { + t.equal(toPrimitive(coercibleObject), coercibleObject.valueOf(), 'coercibleObject with no hint coerces to valueOf'); + t.equal(toPrimitive(coercibleObject, Number), coercibleObject.valueOf(), 'coercibleObject with hint Number coerces to valueOf'); + t.equal(toPrimitive(coercibleObject, String), coercibleObject.toString(), 'coercibleObject with hint String coerces to non-stringified toString'); + + t.equal(toPrimitive(coercibleFnObject), coercibleFnObject.toString(), 'coercibleFnObject coerces to non-stringified toString'); + t.equal(toPrimitive(coercibleFnObject, Number), coercibleFnObject.toString(), 'coercibleFnObject with hint Number coerces to non-stringified toString'); + t.equal(toPrimitive(coercibleFnObject, String), coercibleFnObject.toString(), 'coercibleFnObject with hint String coerces to non-stringified toString'); + + t.equal(toPrimitive({}), '[object Object]', '{} with no hint coerces to Object#toString'); + t.equal(toPrimitive({}, Number), '[object Object]', '{} with hint Number coerces to Object#toString'); + t.equal(toPrimitive({}, String), '[object Object]', '{} with hint String coerces to Object#toString'); + + t.equal(toPrimitive(toStringOnlyObject), toStringOnlyObject.toString(), 'toStringOnlyObject returns non-stringified toString'); + t.equal(toPrimitive(toStringOnlyObject, Number), toStringOnlyObject.toString(), 'toStringOnlyObject with hint Number returns non-stringified toString'); + t.equal(toPrimitive(toStringOnlyObject, String), toStringOnlyObject.toString(), 'toStringOnlyObject with hint String returns non-stringified toString'); + + t.equal(toPrimitive(valueOfOnlyObject), valueOfOnlyObject.valueOf(), 'valueOfOnlyObject returns valueOf'); + t.equal(toPrimitive(valueOfOnlyObject, Number), valueOfOnlyObject.valueOf(), 'valueOfOnlyObject with hint Number returns valueOf'); + t.equal(toPrimitive(valueOfOnlyObject, String), valueOfOnlyObject.valueOf(), 'valueOfOnlyObject with hint String returns non-stringified valueOf'); + + t.test('Symbol.toPrimitive', { skip: !hasSymbolToPrimitive }, function (st) { + var overriddenObject = { toString: st.fail, valueOf: st.fail }; + overriddenObject[Symbol.toPrimitive] = function (hint) { return String(hint); }; + + st.equal(toPrimitive(overriddenObject), 'default', 'object with Symbol.toPrimitive + no hint invokes that'); + st.equal(toPrimitive(overriddenObject, Number), 'number', 'object with Symbol.toPrimitive + hint Number invokes that'); + st.equal(toPrimitive(overriddenObject, String), 'string', 'object with Symbol.toPrimitive + hint String invokes that'); + + var nullToPrimitive = { toString: coercibleObject.toString, valueOf: coercibleObject.valueOf }; + nullToPrimitive[Symbol.toPrimitive] = null; + st.equal(toPrimitive(nullToPrimitive), toPrimitive(coercibleObject), 'object with no hint + null Symbol.toPrimitive ignores it'); + st.equal(toPrimitive(nullToPrimitive, Number), toPrimitive(coercibleObject, Number), 'object with hint Number + null Symbol.toPrimitive ignores it'); + st.equal(toPrimitive(nullToPrimitive, String), toPrimitive(coercibleObject, String), 'object with hint String + null Symbol.toPrimitive ignores it'); + + st.test('exceptions', function (sst) { + var nonFunctionToPrimitive = { toString: sst.fail, valueOf: sst.fail }; + nonFunctionToPrimitive[Symbol.toPrimitive] = {}; + sst['throws'](toPrimitive.bind(null, nonFunctionToPrimitive), TypeError, 'Symbol.toPrimitive returning a non-function throws'); + + var uncoercibleToPrimitive = { toString: sst.fail, valueOf: sst.fail }; + uncoercibleToPrimitive[Symbol.toPrimitive] = function (hint) { + return { toString: function () { return hint; } }; + }; + sst['throws'](toPrimitive.bind(null, uncoercibleToPrimitive), TypeError, 'Symbol.toPrimitive returning an object throws'); + + var throwingToPrimitive = { toString: sst.fail, valueOf: sst.fail }; + throwingToPrimitive[Symbol.toPrimitive] = function (hint) { throw new RangeError(hint); }; + sst['throws'](toPrimitive.bind(null, throwingToPrimitive), RangeError, 'Symbol.toPrimitive throwing throws'); + + sst.end(); + }); + + st.end(); + }); + + t.test('exceptions', function (st) { + st['throws'](toPrimitive.bind(null, uncoercibleObject), TypeError, 'uncoercibleObject throws a TypeError'); + st['throws'](toPrimitive.bind(null, uncoercibleObject, Number), TypeError, 'uncoercibleObject with hint Number throws a TypeError'); + st['throws'](toPrimitive.bind(null, uncoercibleObject, String), TypeError, 'uncoercibleObject with hint String throws a TypeError'); + + st['throws'](toPrimitive.bind(null, uncoercibleFnObject), TypeError, 'uncoercibleFnObject throws a TypeError'); + st['throws'](toPrimitive.bind(null, uncoercibleFnObject, Number), TypeError, 'uncoercibleFnObject with hint Number throws a TypeError'); + st['throws'](toPrimitive.bind(null, uncoercibleFnObject, String), TypeError, 'uncoercibleFnObject with hint String throws a TypeError'); + st.end(); + }); + t.end(); +}); diff --git a/node_modules/es-to-primitive/test/index.js b/node_modules/es-to-primitive/test/index.js new file mode 100644 index 000000000..ad71f39e2 --- /dev/null +++ b/node_modules/es-to-primitive/test/index.js @@ -0,0 +1,20 @@ +'use strict'; + +var toPrimitive = require('../'); +var ES5 = require('../es5'); +var ES6 = require('../es6'); +var ES2015 = require('../es2015'); + +var test = require('tape'); + +test('default export', function (t) { + t.equal(toPrimitive, ES2015, 'default export is ES2015'); + t.equal(toPrimitive.ES5, ES5, 'ES5 property has ES5 method'); + t.equal(toPrimitive.ES6, ES6, 'ES6 property has ES6 method'); + t.equal(toPrimitive.ES2015, ES2015, 'ES2015 property has ES2015 method'); + t.end(); +}); + +require('./es5'); +require('./es6'); +require('./es2015'); diff --git a/node_modules/eslint-config-prettier/@typescript-eslint.js b/node_modules/eslint-config-prettier/@typescript-eslint.js new file mode 100644 index 000000000..26df23cb9 --- /dev/null +++ b/node_modules/eslint-config-prettier/@typescript-eslint.js @@ -0,0 +1,19 @@ +"use strict"; + +module.exports = { + rules: { + "@typescript-eslint/quotes": 0, + + "@typescript-eslint/brace-style": "off", + "@typescript-eslint/comma-spacing": "off", + "@typescript-eslint/func-call-spacing": "off", + "@typescript-eslint/indent": "off", + "@typescript-eslint/keyword-spacing": "off", + "@typescript-eslint/member-delimiter-style": "off", + "@typescript-eslint/no-extra-parens": "off", + "@typescript-eslint/no-extra-semi": "off", + "@typescript-eslint/semi": "off", + "@typescript-eslint/space-before-function-paren": "off", + "@typescript-eslint/type-annotation-spacing": "off", + }, +}; diff --git a/node_modules/eslint-config-prettier/CHANGELOG.md b/node_modules/eslint-config-prettier/CHANGELOG.md new file mode 100644 index 000000000..0e55d5ac5 --- /dev/null +++ b/node_modules/eslint-config-prettier/CHANGELOG.md @@ -0,0 +1,340 @@ +### Version 6.11.0 (2020-04-21) + +- Added: [@typescript-eslint/keyword-spacing]. Thanks to Hans Bergren (@hbergren)!! + +### Version 6.10.1 (2020-03-22) + +- Improved: Recommend using `npx` when running the CLI helper tool. +- Updated: Mention that eslint-config-prettier has been tested with Prettier 2.0 and the latest versions of plugins. + +### Version 6.10.0 (2020-01-28) + +- Added: [@typescript-eslint/comma-spacing]. Thanks to Masafumi Koba (@ybiquitous)!! + +### Version 6.9.0 (2019-12-27) + +- Added: [vue/max-len]. Thanks to @xcatliu! + +### Version 6.8.0 (2019-12-25) + +- Added: [@typescript-eslint/no-extra-semi]. Thanks to @xcatliu! + +### Version 6.7.0 (2019-11-19) + +- Added: [@typescript-eslint/space-before-function-paren]. Thanks to Masafumi Koba (@ybiquitous)! + +### Version 6.6.0 (2019-11-17) + +- Added: New [eslint-plugin-vue] rules: [vue/dot-location] and [vue/keyword-spacing]. Thanks to @xcatliu! + +### Version 6.5.0 (2019-10-26) + +- Added: Support for [excluding deprecated rules]. Thanks to Alex Ilyaev (@alexilyaev)! + +### Version 6.4.0 (2019-10-05) + +- Added: [unicorn/no-nested-ternary]. Thanks to Yang Mingshan (@yangmingshan)! + +### Version 6.3.0 (2019-09-10) + +- Added: [@typescript-eslint/brace-style]. Thanks to Masafumi Koba (@ybiquitous)! + +### Version 6.2.0 (2019-09-03) + +- Added: [@typescript-eslint/quotes] (as a [special rule][@typescript-eslint/quotes-special]). Thanks to Masafumi Koba (@ybiquitous)! + +### Version 6.1.0 (2019-08-19) + +- Added: [function-call-argument-newline] \(new in ESLint 6.2.0). Thanks to Masafumi Koba (@ybiquitous)! + +### Version 6.0.0 (2019-06-25) + +- Changed: The CLI helper tool now considers [no-confusing-arrow] to conflict if you use the default value of its `allowParens` option. The default was changed to `true` in ESLint 6, which conflicts with Prettier. + + If the CLI helper tool gives you errors about this after upgrading, the solution is to change this: + + ```json + { + "rules": { + "no-confusing-arrow": ["error"] + } + } + ``` + + Into this: + + ```json + { + "rules": { + "no-confusing-arrow": ["error", { "allowParens": false }] + } + } + ``` + + The latter works in both ESLint 6 as well as in ESLint 5 and older. + +- Improved: `eslint --print-config` usage instructions. The CLI tool help text as well as the documentation has been updated to suggest commands that work in ESLint 6.0 as well as in ESLint 5 and older. (Instead of `eslint --print-config .`, use `eslint --print-config path/to/main.js`.) + +### Version 5.1.0 (2019-06-25) + +- Added: [react/jsx-curly-newline]. Thanks to Masafumi Koba (@ybiquitous)! + +### Version 5.0.0 (2019-06-15) + +- Removed: [react/self-closing-comp]. This rule was added in v4.1.0 not because it _conflicted_ with Prettier but because it was _unnecessary_ when using Prettier. However, in v1.18.0 [Prettier stopped converting empty elements to self-closing elements][prettier-self-closing]. So the rule is not unnecessary anymore. + + If you use Prettier v1.17.1 or older you should be able to upgrade eslint-config-prettier to v5.0.0 without having to do anything else. + + If you use Prettier v1.18.0 or newer, you might get lint errors about for example changing `
` into `
`. You have two options: + + - Run `eslint --fix` if you prefer to enforce self-closing elements where possible. This should fix all the errors. + - Add `"react/self-closing-comp": "off"` to your ESLint config if you use autofix from your editor and you face the same [issue as Prettier did][prettier-self-closing]. + +- Changed: Node.js 6 is no longer officially supported, but v5.0.0 should still work with it. + +### Version 4.3.0 (2019-05-16) + +- Added: New [eslint-plugin-vue] rules: [vue/arrow-spacing], [vue/block-spacing], [vue/brace-style] and [vue/comma-dangle]. +- Added: New [@typescript-eslint/eslint-plugin] rules: [@typescript-eslint/func-call-spacing] and [@typescript-eslint/semi]. + +### Version 4.2.0 (2019-04-25) + +- Added: [@typescript-eslint/no-extra-parens]. Thanks to Keiichiro Amemiya (@Hoishin) and Jen Gorfine (@jgorfine)! + +### Version 4.1.0 (2019-02-26) + +- Added: [linebreak-style]. Use Prettier’s [end-of-line] option instead. +- Added: [react/self-closing-comp]. Thanks to Gaurav Gupta (@gaurav5430)! + +### Version 4.0.0 (2019-01-26) + +- Breaking change: Support for [eslint-plugin-typescript] has been removed and replaced with support for its successor [@typescript-eslint/eslint-plugin]. Thanks to TANIGUCHI Masaya (@ta2gch) and everyone else who helped with this! +- Changed: [arrow-body-style] and [prefer-arrow-callback] are now marked as [special rules][arrow-special], since they might cause problems if using [eslint-plugin-prettier] and `--fix`. They are turned off by default, and the CLI helper tool will _warn_ about them (but not error if you do enable them). This won’t break your linting checks, but do note that these rules will be disabled unless you explicitly enable them again, and that you might see new warnings when running the CLI helper tool. + +### Version 3.6.0 (2019-01-19) + +- Added: Support for [eslint-plugin-babel]. Thanks to Matija Marohnić (@silvenon)! + +### Version 3.5.0 (2019-01-16) + +- Fixed: The eslint-plugin-vue change from 3.4.0 has been reverted. That change requires eslint-plugin-vue@5, while many use eslint-plugin-vue@4. In other words, it was an accidental breaking change. Also, after thinking about it some more, it makes sense to have a Prettier-specific list of rules, rather than using the `vue/no-layout-rules` list, since there can be layout rules that don’t conflict with but rather complement Prettier. +- Added: New eslint-plugin-vue rules coming in the next version after 5.1.0. + +### Version 3.4.0 (2019-01-13) + +- Added: Support for [eslint-plugin-typescript]. Thanks to Jed Fox (@j-f1)! +- Improved: The eslint-plugin-vue integration is now using the `vue/no-layout-rules` config behind the scenes, so it should automatically stay up-to-date when new eslint-plugin-vue versions are released. Thanks to Michał Sajnóg (@michalsnik)! + +### Version 3.3.0 (2018-11-11) + +- Added: The [vue/html-self-closing] rule (as a [special rule][vue/html-self-closing-special]). Thanks to Yamagishi Kazutoshi (@ykzts)! + +### Version 3.2.0 (2018-11-10) + +- Added: Support for [eslint-plugin-vue]. +- Fixed: The CLI helper tool should now work in Node.js 6 with npm 3 again. Thanks to Grant Snodgrass (@meeber)! +- Improved: Updated documentation. + +### Version 3.1.0 (2018-09-22) + +- Added: Support for [eslint-plugin-unicorn]. Thanks to John Mars (@j0hnm4r5)! +- Changed: The [quotes] rule is now allowed to be used to forbid unnecessary backticks. This means that the CLI helper tool no longer can automatically validate it, so you’ll need to refer the [quotes special rule documentation][quotes-special]. Thanks to Nick Petruzzelli (@npetruzzelli)! + +### Version 3.0.1 (2018-08-13) + +- Improved: `eslint --print-config` usage instructions. + +### Version 3.0.0 (2018-08-13) + +- Breaking change: Dropped Node.js 4 support. + +### Version 2.10.0 (2018-08-13) + +- Added: [flowtype/boolean-style]. Thanks to Mayank Agarwal (@Mayank1791989)! +- Added: [react/jsx-child-element-spacing] +- Added: [react/jsx-props-no-multi-spaces] + +### Version 2.9.0 (2017-11-26) + +- Added: The [implicit-arrow-linebreak] rule. + +### Version 2.8.0 (2017-11-19) + +- Added: The [react/jsx-one-expression-per-line] rule. + +### Version 2.7.0 (2017-11-01) + +- Added: The [lines-around-comment] rule (as a [special rule][lines-around-comment-special]). Thanks to Maurice de Beijer (@mauricedb)! +- Added: The [no-unexpected-multiline] rule (as a [special rule][no-unexpected-multiline-special]). Thanks to Suhas Karanth (@sudo-suhas)! + +### Version 2.6.0 (2017-09-23) + +- Added: The [no-floating-decimal] rule. + +### Version 2.5.0 (2017-09-16) + +- Added: Support for [eslint-plugin-standard]. Thanks to Christian Pekeler (@pekeler)! + +### Version 2.4.0 (2017-09-02) + +- Added: The [function-paren-newline] rule (new in [ESLint 4.6.0]). Thanks to Pierre Vanduynslager (@vanduynslagerp)! + +### Version 2.3.0 (2017-06-30) + +- Added: The (deprecated) [indent-legacy] rule. Thanks to M. Ian Graham (@miangraham)! + +### Version 2.2.0 (2017-06-17) + +- Added: New rules from [ESLint 4.0.0]: + - [array-element-newline] + - [array-bracket-newline] + - [semi-style] + - [switch-colon-spacing] +- Added: [react/jsx-closing-tag-location] + +### Version 2.1.1 (2017-05-20) + +- No code changes. Just updates to the readme. + +### Version 2.1.0 (2017-05-13) + +- Added: The [no-tabs] rule (as a [special rule][no-tabs-special]). Thanks to Alex Meah (@AlexMeah)! + +### Version 2.0.0 (2017-05-07) + +- Changed/Improved: The CLI helper tool is now more helpful. + + - The options of special rules are now validated if possible. If a special rule is enabled with non-conflicting options, the CLI no longer warns about it. + - If only special rules that cannot be automatically checked are found, the CLI no longer exists with a non-zero exit code. Instead, it only warns about the rules. + +- Changed: The [no-confusing-arrow] is now a special rule again, since it might conflict with recent Prettier versions. + +- Removed: The `react/wrap-multilines` rule (which has been deprecated for a while), since it was removed in eslint-plugin-react@7. + +### Version 1.7.0 (2017-04-19) + +- Changed: The [no-confusing-arrow] is no longer a special rule, but simply turned off, since recent Prettier versions make it redundant. +- Improved: The CLI helper tool now has a more helpful message for special rules, and exits with a different status code if only special rules were found. The exit codes are now documented as well. + +### Version 1.6.0 (2017-04-05) + +- Added: The [curly] rule. Thanks to Martin Rädlinger (@formatlos)! + +### Version 1.5.0 (2017-03-04) + +- Added: The [nonblock-statement-body-position] rule. + +### Version 1.4.1 (2017-02-28) + +- Improved: eslint-config-prettier is now part of the [prettier] organization! This version updates all URLs to point to the new home of the project. + +### Version 1.4.0 (2017-02-26) + +- Added: The [no-confusing-arrow] rule (as a [special rule][no-confusing-arrow-special]). Thanks to Dominik Ferber (@dferber90)! +- Added: Deprecated or removed rules that might conflict with prettier. Thanks to Dominik Ferber (@dferber90)! + +### Version 1.3.0 (2017-02-21) + +- Added: The [template-tag-spacing] rule. Thanks to Thibault Derousseaux (@tibdex)! + +### Version 1.2.0 (2017-02-14) + +- Added: The [one-var-declaration-per-line] rule. Thanks to Ruben Oostinga (@0xR)! + +### Version 1.1.1 (2017-02-12) + +- Minor documentation tweak: Changed "Exceptions" into "Special rules". + +### Version 1.1.0 (2017-02-10) + +- Fixed: The [eslint-plugin-react] exclusion rules now actually work. +- Fixed: The CLI helper tool now works in Node.js 4. Thanks to Nathan Friedly (@nfriedly)! +- Added: Support for [eslint-plugin-flowtype]. +- Improved: Minor things for the CLI helper tool. +- Improved: There are now tests for everything. + +### Version 1.0.3 (2017-02-03) + +- Fixed: `"extends": "prettier/react"` now actually works. + +### Version 1.0.2 (2017-01-30) + +- Improved: CLI helper tool instructions. + +### Version 1.0.1 (2017-01-29) + +- No difference from 1.0.0. Just an `npm publish` mistake. + +### Version 1.0.0 (2017-01-29) + +- Initial release. + +[@typescript-eslint/brace-style]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/brace-style.md +[@typescript-eslint/comma-spacing]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/comma-spacing.md +[@typescript-eslint/eslint-plugin]: https://github.com/typescript-eslint/typescript-eslint +[@typescript-eslint/func-call-spacing]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/func-call-spacing.md +[@typescript-eslint/keyword-spacing]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/keyword-spacing.md +[@typescript-eslint/no-extra-parens]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-parens.md +[@typescript-eslint/no-extra-semi]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-semi.md +[@typescript-eslint/quotes-special]: https://github.com/prettier/eslint-config-prettier/blob/857257179fe69715362dfa9300762d6e534c0603/README.md#quotes +[@typescript-eslint/quotes]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/quotes.md +[@typescript-eslint/semi]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/semi.md +[@typescript-eslint/space-before-function-paren]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-before-function-paren.md +[array-bracket-newline]: https://eslint.org/docs/rules/array-bracket-newline +[array-element-newline]: https://eslint.org/docs/rules/array-element-newline +[arrow-body-style]: https://eslint.org/docs/rules/arrow-body-style +[arrow-special]: https://github.com/prettier/eslint-config-prettier/blob/2c842675e55b91aecaef6f997d234ebf2d220ffb/README.md#arrow-body-style-and-prefer-arrow-callback +[curly]: https://eslint.org/docs/rules/curly +[end-of-line]: https://prettier.io/docs/en/options.html#end-of-line +[eslint 4.0.0]: https://eslint.org/blog/2017/06/eslint-v4.0.0-released +[eslint 4.6.0]: https://eslint.org/blog/2017/09/eslint-v4.6.0-released +[eslint-plugin-babel]: https://github.com/babel/eslint-plugin-babel +[eslint-plugin-flowtype]: https://github.com/gajus/eslint-plugin-flowtype +[eslint-plugin-prettier]: https://github.com/prettier/eslint-plugin-prettier +[eslint-plugin-react]: https://github.com/yannickcr/eslint-plugin-react +[eslint-plugin-standard]: https://github.com/xjamundx/eslint-plugin-standard +[eslint-plugin-typescript]: https://github.com/bradzacher/eslint-plugin-typescript +[eslint-plugin-unicorn]: https://github.com/sindresorhus/eslint-plugin-unicorn +[eslint-plugin-vue]: https://github.com/vuejs/eslint-plugin-vue +[excluding deprecated rules]: https://github.com/prettier/eslint-config-prettier/tree/9f6b59486ad742dc12ad3be157ddff5f8454ef7a#excluding-deprecated-rules +[flowtype/boolean-style]: https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-boolean-style +[function-call-argument-newline]: https://eslint.org/docs/rules/function-call-argument-newline +[function-paren-newline]: https://eslint.org/docs/rules/function-paren-newline +[implicit-arrow-linebreak]: https://eslint.org/docs/rules/implicit-arrow-linebreak +[indent-legacy]: https://eslint.org/docs/rules/indent-legacy +[linebreak-style]: https://eslint.org/docs/rules/linebreak-style +[lines-around-comment-special]: https://github.com/prettier/eslint-config-prettier/blob/5399175c37466747aae9d407021dffec2c169c8b/README.md#lines-around-comment +[lines-around-comment]: https://eslint.org/docs/rules/lines-around-comment +[no-confusing-arrow-special]: https://github.com/prettier/eslint-config-prettier/blob/08ac5bcc25c9cdc71864b4a1e4191e7d28dd2bc2/README.md#no-confusing-arrow +[no-confusing-arrow]: https://eslint.org/docs/rules/no-confusing-arrow +[no-floating-decimal]: https://eslint.org/docs/rules/no-floating-decimal +[no-tabs-special]: https://github.com/prettier/eslint-config-prettier/blob/dfa6e2b51f11a8001e9e7d38b78f03c7d75175ec/README.md#no-tabs +[no-tabs]: https://eslint.org/docs/rules/no-tabs +[no-unexpected-multiline-special]: https://github.com/prettier/eslint-config-prettier/blob/5399175c37466747aae9d407021dffec2c169c8b/README.md#no-unexpected-multiline +[no-unexpected-multiline]: https://eslint.org/docs/rules/no-unexpected-multiline +[nonblock-statement-body-position]: https://eslint.org/docs/rules/nonblock-statement-body-position +[one-var-declaration-per-line]: https://eslint.org/docs/rules/one-var-declaration-per-line +[prefer-arrow-callback]: https://eslint.org/docs/rules/prefer-arrow-callback +[prettier-self-closing]: https://prettier.io/blog/2019/06/06/1.18.0.html#stop-converting-empty-jsx-elements-to-self-closing-elements-6127-by-duailibe +[prettier]: https://github.com/prettier +[quotes-special]: https://github.com/prettier/eslint-config-prettier/blob/8d264cd0a7f06c12e2e05415e0282a4f8f21ebc9/README.md#quotes +[quotes]: https://eslint.org/docs/rules/quotes +[react/jsx-child-element-spacing]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-child-element-spacing.md +[react/jsx-closing-tag-location]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-tag-location.md +[react/jsx-curly-newline]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-newline.md +[react/jsx-one-expression-per-line]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-one-expression-per-line.md +[react/jsx-props-no-multi-spaces]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-multi-spaces.md +[react/self-closing-comp]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md +[semi-style]: https://eslint.org/docs/rules/semi-style +[switch-colon-spacing]: https://eslint.org/docs/rules/switch-colon-spacing +[template-tag-spacing]: https://eslint.org/docs/rules/template-tag-spacing +[unicorn/no-nested-ternary]: https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/no-nested-ternary.md +[vue/arrow-spacing]: https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/arrow-spacing.md +[vue/block-spacing]: https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/block-spacing.md +[vue/brace-style]: https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/brace-style.md +[vue/comma-dangle]: https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/comma-dangle.md +[vue/dot-location]: https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/dot-location.md +[vue/html-self-closing-special]: https://github.com/prettier/eslint-config-prettier/blob/d5e7af986221df5faedc12893d8dc3150a808693/README.md#vuehtml-self-closing +[vue/html-self-closing]: https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/html-self-closing.md +[vue/keyword-spacing]: https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/keyword-spacing.md +[vue/max-len]: https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/max-len.md diff --git a/node_modules/eslint-config-prettier/LICENSE b/node_modules/eslint-config-prettier/LICENSE new file mode 100644 index 000000000..af6f63276 --- /dev/null +++ b/node_modules/eslint-config-prettier/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017, 2018, 2019 Simon Lydell and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/eslint-config-prettier/README.md b/node_modules/eslint-config-prettier/README.md new file mode 100644 index 000000000..f9f02a705 --- /dev/null +++ b/node_modules/eslint-config-prettier/README.md @@ -0,0 +1,837 @@ +# eslint-config-prettier + +Turns off all rules that are unnecessary or might conflict with [Prettier]. + +This lets you use your favorite shareable config without letting its stylistic choices get in the way when using Prettier. + +Note that this config _only_ turns rules _off,_ so it only makes sense using it together with some other config. + +## Contents + + + + +- [Installation](#installation) + - [Excluding deprecated rules](#excluding-deprecated-rules) +- [CLI helper tool](#cli-helper-tool) +- [Example configuration](#example-configuration) +- [Special rules](#special-rules) + - [arrow-body-style and prefer-arrow-callback](#arrow-body-style-and-prefer-arrow-callback) + - [curly](#curly) + - [lines-around-comment](#lines-around-comment) + - [max-len](#max-len) + - [no-confusing-arrow](#no-confusing-arrow) + - [no-mixed-operators](#no-mixed-operators) + - [no-tabs](#no-tabs) + - [no-unexpected-multiline](#no-unexpected-multiline) + - [quotes](#quotes) + - [Enforce backticks](#enforce-backticks) + - [Forbid unnecessary backticks](#forbid-unnecessary-backticks) + - [Example _double_ quote configuration](#example-_double_-quote-configuration) + - [Example _single_ quote configuration](#example-_single_-quote-configuration) + - [vue/html-self-closing](#vuehtml-self-closing) +- [Other rules worth mentioning](#other-rules-worth-mentioning) + - [no-sequences](#no-sequences) +- [Contributing](#contributing) +- [License](#license) + + + +## Installation + +Install eslint-config-prettier: + +``` +npm install --save-dev eslint-config-prettier +``` + +Then, add eslint-config-prettier to the "extends" array in your `.eslintrc.*` file. Make sure to put it **last,** so it gets the chance to override other configs. + + +```json +{ + "extends": [ + "some-other-config-you-use", + "prettier" + ] +} +``` + +A few ESLint plugins are supported as well: + +- [@typescript-eslint/eslint-plugin] +- [eslint-plugin-babel] +- [eslint-plugin-flowtype] +- [eslint-plugin-react] +- [eslint-plugin-standard] +- [eslint-plugin-unicorn] +- [eslint-plugin-vue] + +Add extra exclusions for the plugins you use like so: + + +```json +{ + "extends": [ + "some-other-config-you-use", + "prettier", + "prettier/@typescript-eslint", + "prettier/babel", + "prettier/flowtype", + "prettier/react", + "prettier/standard", + "prettier/unicorn", + "prettier/vue" + ] +} +``` + +If you extend a config which uses a plugin, it is recommended to add `"prettier/that-plugin"` (if available). For example, [eslint-config-airbnb] enables [eslint-plugin-react] rules, so `"prettier/react"` is needed: + + +```json +{ + "extends": [ + "airbnb", + "prettier", + "prettier/react" + ] +} +``` + +If you’re unsure which plugins are used, you can usually find them in your `package.json`. + +### Excluding deprecated rules + +Some of the rules that eslint-config-prettier turns off may be deprecated. **This is perfectly fine,** but if you really need to omit the deprecated rules, you can do so by setting the `ESLINT_CONFIG_PRETTIER_NO_DEPRECATED` environment variable to a non-empty value. For example: + +``` +env ESLINT_CONFIG_PRETTIER_NO_DEPRECATED=true npx eslint-find-rules --deprecated index.js +``` + +## CLI helper tool + +eslint-config-prettier also ships with a little CLI tool to help you check if your configuration contains any rules that are unnecessary or conflict with Prettier. + +You can run it using `npx`: + +``` +npx eslint --print-config path/to/main.js | npx eslint-config-prettier-check +``` + +(Change `path/to/main.js` to a file that exists in your project.) + +In theory you need to run `npx eslint --print-config file.js | npx eslint-config-prettier-check` for every single file in your project to be 100% sure that there are no conflicting rules, because ESLint supports having different rules for different files. But usually you’ll have about the same rules for all files, so it is enough to run the command on one file (pick one that you won’t be moving). If you use [multiple configuration files] or [overrides], you can (but you probably don’t need to!) run the above script several times with different `--print-config` arguments, such as: + +``` +npx eslint --print-config index.js | npx eslint-config-prettier-check +npx eslint --print-config test/index.js | npx eslint-config-prettier-check +npx eslint --print-config legacy/main.js | npx eslint-config-prettier-check +``` + +Exit codes: + +- 0: No problems found. +- 1: Unexpected error. +- 2: Conflicting rules found. + +## Example configuration + + +```json +{ + "extends": [ + "standard", + "plugin:@typescript-eslint/recommended", + "plugin:flowtype/recommended", + "plugin:react/recommended", + "plugin:unicorn/recommended", + "plugin:vue/recommended", + "prettier", + "prettier/@typescript-eslint", + "prettier/babel", + "prettier/flowtype", + "prettier/react", + "prettier/standard", + "prettier/unicorn", + "prettier/vue" + ], + "plugins": [ + "@typescript-eslint", + "babel", + "flowtype", + "react", + "standard", + "unicorn", + "vue" + ], + "parserOptions": { + "sourceType": "module", + "ecmaFeatures": { + "jsx": true + } + }, + "env": { + "es6": true, + "node": true + } +} +``` + +## Special rules + +There a few rules that eslint-config-prettier disables that actually can be enabled in some cases. + +- Some require certain options. The CLI helper tool validates this. +- Some require special attention when writing code. The CLI helper tool warns you if any of those rules are enabled, but can’t tell if anything is problematic. +- Some can cause problems if using [eslint-plugin-prettier] and `--fix`. + +For maximum ease of use, the special rules are disabled by default. If you want them, you need to explicitly specify them in your ESLint config. + +### [arrow-body-style] and [prefer-arrow-callback] + +**These rules might cause problems if using [eslint-plugin-prettier] and `--fix`.** + +If you use any of these rules together with the `prettier/prettier` rule from [eslint-plugin-prettier], you can in some cases end up with invalid code due to a bug in ESLint’s autofix. + +These rules are safe to use if: + +- You don’t use [eslint-plugin-prettier]. In other words, you run `eslint --fix` and `prettier --write` as separate steps. +- You _do_ use [eslint-plugin-prettier], but don’t use `--fix`. (But then, what’s the point?) + +You _can_ still use these rules together with [eslint-plugin-prettier] if you want, because the bug does not occur _all the time._ But if you do, you need to keep in mind that you might end up with invalid code, where you manually have to insert a missing closing parenthesis to get going again. + +If you’re fixing large of amounts of previously unformatted code, consider temporarily disabling the `prettier/prettier` rule and running `eslint --fix` and `prettier --write` separately. + +See these issues for more information: + +- [eslint-config-prettier#31] +- [eslint-config-prettier#71] +- [eslint-plugin-prettier#65] + +When the autofix bug in ESLint has been fixed, the special case for these rules can be removed. + +### [curly] + +**This rule requires certain options.** + +If a block (for example after `if`, `else`, `for` or `while`) contains only one statement, JavaScript allows omitting the curly braces around that statement. This rule enforces if or when those optional curly braces should be omitted. + +If you use the `"multi-line"` or `"multi-or-nest"` option, the rule can conflict with Prettier. + +For example, the `"multi-line"` option allows this line: + + +```js +if (cart.items && cart.items[0] && cart.items[0].quantity === 0) updateCart(cart); +``` + +However, Prettier might consider the line too long and turn it into the following, which the `"multi-line"` option does _not_ allow: + + +```js +if (cart.items && cart.items[0] && cart.items[0].quantity === 0) + updateCart(cart); +``` + +If you like this rule, it can be used just fine with Prettier as long as you don’t use the `"multi-line"` or `"multi-or-nest"` option. + +Example ESLint configuration: + + +```json +{ + "rules": { + "curly": ["error", "all"] + } +} +``` + +### [lines-around-comment] + +**This rule can be used with certain options.** + +This rule requires empty lines before and/or after comments. Prettier preserves blank lines, with two exceptions: + +- Several blank lines in a row are collapsed into a single blank line. This is fine. +- Blank lines at the beginning and end of blocks, objects and arrays are always removed. This may lead to conflicts. + +By default, ESLint requires a blank line above the comment is this case: + + +```js +if (result) { + + /* comment */ + return result; +} +``` + +However, Prettier removes the blank line: + + +```js +if (result) { + /* comment */ + return result; +} +``` + +If you like this rule, it can be used just fine with Prettier as long as you add some extra configuration to allow comments at the start and end of blocks, objects and arrays. + +Example ESLint configuration: + + +```json +{ + "rules": { + "lines-around-comment": [ + "error", + { + "beforeBlockComment": true, + "afterBlockComment": true, + "beforeLineComment": true, + "afterLineComment": true, + "allowBlockStart": true, + "allowBlockEnd": true, + "allowObjectStart": true, + "allowObjectEnd": true, + "allowArrayStart": true, + "allowArrayEnd": true + } + ] + } +} +``` + +### [max-len] + +(The following applies to [vue/max-len] as well.) + +**This rule requires special attention when writing code.** + +Usually, Prettier takes care of following a maximum line length automatically. However, there are cases where Prettier can’t do anything, such as for long strings, regular expressions and comments. Those need to be split up by a human. + +If you’d like to enforce an even stricter maximum line length policy than Prettier can provide automatically, you can enable this rule. Just remember to keep `max-len`’s options and Prettier’s `printWidth` option in sync. + +Keep in mind that you might have to refactor code slightly if Prettier formats lines in a way that the `max-len` rule does not approve of. + +Example ESLint configuration: + + +```json +{ + "rules": { + "max-len": ["error", {"code": 80, "ignoreUrls": true}] + } +} +``` + +### [no-confusing-arrow] + +**This rule requires certain options.** + +For example, the rule could warn about this line: + + +```js +var x = a => 1 ? 2 : 3; +``` + +With `{allowParens: true}` (the default since ESLint 6.0.0), adding parentheses is considered a valid way to avoid the arrow confusion: + + +```js +var x = a => (1 ? 2 : 3); +``` + +While Prettier keeps those parentheses, it removes them if the line is long enough to introduce a line break: + + +```js +EnterpriseCalculator.prototype.calculateImportantNumbers = inputNumber => + 1 ? 2 : 3; +``` + +With `{allowParens: false}`, ESLint instead suggests switching to an explicit return: + + +```js +var x = a => { return 1 ? 2 : 3; }; +``` + +That causes no problems with Prettier. + +If you like this rule, it can be used just fine with Prettier as long as the `allowParens` option is off. + +Example ESLint configuration: + + +```json +{ + "rules": { + "no-confusing-arrow": ["error", { "allowParens": false }] + } +} +``` + +(Note: The CLI helper tool considers `{allowParens: true}` to be the default, which is the case since ESLint 6.0.0. The tool will produce a warning if you use the default even if you use an older version of ESLint. It doesn’t hurt to explicitly set `{allowParens: false}` even though it is technically redundant. This way you are prepared for a future ESLint upgrade and the CLI tool can be kept simple.) + +### [no-mixed-operators] + +**This rule requires special attention when writing code.** + +This rule forbids mixing certain operators, such as `&&` and `||`. + +For example, the rule could warn about this line: + + +```js +var foo = a + b * c; +``` + +The rule suggests adding parentheses, like this: + + +```js +var foo = a + (b * c); +``` + +However, Prettier removes many “unnecessary” parentheses, turning it back to: + + +```js +var foo = a + b * c; +``` + +If you want to use this rule with Prettier, you need to split the expression into another variable: + + +```js +var bar = b * c; +var foo = a + bar; +``` + +Keep in mind that Prettier prints _some_ “unnecessary” parentheses, though: + + +```js +var foo = (a && b) || c; +``` + +Example ESLint configuration: + + +```json +{ + "rules": { + "no-mixed-operators": "error" + } +} +``` + +### [no-tabs] + +**This rule requires certain Prettier options.** + +This rule disallows the use of tab characters at all. It can be used just fine with Prettier as long as you don’t configure Prettier to indent using tabs. + +Example ESLint configuration: + + +```json +{ + "rules": { + "no-tabs": "error" + } +} +``` + +Example Prettier configuration (this is the default, so adding this is not required): + + +```json +{ + "useTabs": false +} +``` + +**Note:** Since [ESlint 5.7.0] this rule can be configured to work regardless of your Prettier configuration: + + +```json +{ + "rules": { + "no-tabs": ["error", {"allowIndentationTabs": true}] + } +} +``` + +A future version of eslint-config-prettier might check for that automatically. + +### [no-unexpected-multiline] + +**This rule requires special attention when writing code.** + +This rule disallows confusing multiline expressions where a newline looks like it is ending a statement, but is not. + +For example, the rule could warn about this: + + +```js +var hello = "world" +[1, 2, 3].forEach(addNumber) +``` + +Prettier usually formats this in a way that makes it obvious that a semicolon was missing: + + +```js +var hello = "world"[(1, 2, 3)].forEach(addNumber); +``` + +However, there are cases where Prettier breaks things into several lines such that the `no-unexpected-multiline` conflicts. + + +```js +const value = text.trim().split("\n")[position].toLowerCase(); +``` + +Prettier breaks it up into several lines, though, causing a conflict: + + +```js +const value = text + .trim() + .split("\n") + [position].toLowerCase(); +``` + +If you like this rule, it can usually be used with Prettier without problems, but occasionally you might need to either temporarily disable the rule or refactor your code. + + +```js +const value = text + .trim() + .split("\n") + // eslint-disable-next-line no-unexpected-multiline + [position].toLowerCase(); + +// Or: + +const lines = text.trim().split("\n"); +const value = lines[position].toLowerCase(); +``` + +**Note:** If you _do_ enable this rule, you have to run ESLint and Prettier as two separate steps (and ESLint first) in order to get any value out of it. Otherwise Prettier might reformat your code in such a way that ESLint never gets a chance to report anything (as seen in the first example). + +Example configuration: + + +```json +{ + "rules": { + "no-unexpected-multiline": "error" + } +} +``` + +### [quotes] + +(The following applies to [babel/quotes] and [@typescript-eslint/quotes] as well.) + +**This rule requires certain options and certain Prettier options.** + +Usually, you don’t need this rule at all. But there are two cases where it could be useful: + +- To enforce the use of backticks rather than single or double quotes for strings. +- To forbid backticks where regular strings could have been used. + +#### Enforce backticks + +If you’d like all strings to use backticks (never quotes), enable the `"backtick"` option. + +Example ESLint configuration: + + +```json +{ + "rules": { + "quotes": ["error", "backtick"] + } +} +``` + +#### Forbid unnecessary backticks + +In the following example, the first array item could have been written with quotes instead of backticks. + + +```js +const strings = [ + `could have been a regular string`, + ` + multiple + lines + `, + `uses ${interpolation}`, + String.raw`\tagged/`, +]; +``` + +If you’d like ESLint to enforce `` `could have been a regular string` `` being written as either `"could have been a regular string"` or `'could have been a regular string'`, you need to use some specific configuration. The `quotes` rule has two options, a string option and an object option. + +- The first (string) option needs to be set to `"single"` or `"double"` and be kept in sync with Prettier’s [singleQuote] option. +- The second (object) option needs the following properties: + - `"avoidEscape": true` to follow Prettier’s [string formatting rules]. + - `"allowTemplateLiterals": false` to disallow unnecessary backticks. + +##### Example _double_ quote configuration + +ESLint: + + +```json +{ + "rules": { + "quotes": [ + "error", + "double", + { "avoidEscape": true, "allowTemplateLiterals": false } + ] + } +} +``` + +Prettier (this is the default, so adding this is not required): + + +```json +{ + "singleQuote": false +} +``` + +##### Example _single_ quote configuration + +ESLint: + + +```json +{ + "rules": { + "quotes": [ + "error", + "single", + { "avoidEscape": true, "allowTemplateLiterals": false } + ] + } +} +``` + +Prettier: + + +```json +{ + "singleQuote": true +} +``` + +### [vue/html-self-closing] + +**This rule requires certain options.** + +This rule enforces whether elements should be self-closing or not. + +Prettier generally preserves the way you wrote your elements: + + +```vue +
+
+ + + + +``` + +But for known _void_ HTML elements, Prettier always uses the self-closing style. For example, `` is turned into ``. + +If you like this rule, it can be used just fine with Prettier as long as you set `html.void` to `"any"`. + +Example ESLint configuration: + + +```json +{ + "rules": { + "vue/html-self-closing": [ + "error", + { + "html": { + "void": "any" + } + } + ] + } +} +``` + +## Other rules worth mentioning + +These rules don’t conflict with Prettier, but have some gotchas when used with Prettier. + +### [no-sequences] + +This rule forbids using JavaScript’s confusing comma operator (sequence expressions). This piece of code is not doing what it looks like: + + +```js +matrix[4, 7]; +``` + +Prettier adds parentheses to the above to make it clear that a sequence expression is used: + + +```js +matrix[(4, 7)]; +``` + +However, the `no-sequences` rule allows comma operators if the expression sequence is explicitly wrapped in parentheses. Since Prettier automatically wraps them in parentheses, you might never see any warnings from ESLint about comma operators. + +Ending up with an accidental sequence expression can easily happen while refactoring. If you want ESLint to catch such mistakes, it is recommended to forbid sequence expressions entirely using [no-restricted-syntax] \([as mentioned in the `no-sequences` documentation][no-sequences-full]): + + +```json +{ + "rules": { + "no-restricted-syntax": ["error", "SequenceExpression"] + } +} +``` + +If you still need to use the comma operator for some edge case, you can place an `// eslint-disable-next-line no-restricted-syntax` comment on the line above the expression. `no-sequences` can safely be disabled if you use the `no-restricted-syntax` approach. + +You can also supply a custom message if you want: + + +```json +{ + "rules": { + "no-restricted-syntax": [ + "error", + { + "selector": "SequenceExpression", + "message": "The comma operator is confusing and a common mistake. Don’t use it!" + } + ] + } +} +``` + +## Contributing + +eslint-config-prettier has been tested with: + +- ESLint 6.8.0 + - eslint-config-prettier 5.1.0 and older were tested with ESLint 5.x + - eslint-config-prettier 2.10.0 and older were tested with ESLint 4.x + - eslint-config-prettier 2.1.1 and older were tested with ESLint 3.x +- prettier 2.0.5 +- @typescript-eslint/eslint-plugin 2.29.0 +- eslint-plugin-babel 5.3.0 +- eslint-plugin-flowtype 4.7.0 +- eslint-plugin-react 7.19.0 +- eslint-plugin-standard 4.0.1 +- eslint-plugin-unicorn 18.0.1 +- eslint-plugin-vue 6.2.2 + +Have new rules been added since those versions? Have we missed any rules? Is there a plugin you would like to see exclusions for? Open an issue or a pull request! + +If you’d like to add support for eslint-plugin-foobar, this is how you’d go about it: + +First, create `foobar.js`: + + +```js +"use strict"; + +module.exports = { + rules: { + "foobar/some-rule": "off" + } +}; +``` + +Then, create `test-lint/foobar.js`: + + +```js +/* eslint-disable quotes */ +"use strict"; + +// Prettier does not want spaces before the parentheses, but +// `plugin:foobar/recommended` wants one. +console.log(); +``` + +`test-lint/foobar.js` must fail when used with eslint-plugin-foobar and eslint-plugin-prettier at the same time – until `"prettier/foobar"` is added to the "extends" property of an ESLint config. The file should be formatted according to Prettier, and that formatting should disagree with the plugin. + +Finally, you need to mention the plugin in several places: + +- Add `"foobar.js"` to the "files" field in `package.json`. +- Add eslint-plugin-foobar to the "devDependencies" field in `package.json`. +- Make sure that at least one rule from eslint-plugin-foobar gets used in `.eslintrc.base.js`. +- Add it to the list of supported plugins, to the example config and to Contributing section in `README.md`. + +When you’re done, run `npm test` to verify that you got it all right. It runs several other npm scripts: + +- `"test:lint"` makes sure that the files in `test-lint/` pass ESLint when the exclusions from eslint-config-prettier are used. It also lints the code of eslint-config-prettier itself, and checks that Prettier has been run on all files. +- `"test:lint-verify-fail"` is run by a test in `test/lint-verify-fail.test.js`. +- `"test:lint-rules"` is run by a test in `test/rules.test.js`. +- `"test:jest"` runs unit tests that check a number of things: + - That eslint-plugin-foobar is mentioned in all the places shown above. + - That no unknown rules are turned off. This helps catching typos, for example. + - That the CLI works. +- `"test:cli-sanity"` and `"test:cli-sanity-warning"` are sanity checks for the CLI. + +## License + +[MIT](LICENSE). + +[@typescript-eslint/eslint-plugin]: https://github.com/typescript-eslint/typescript-eslint +[@typescript-eslint/quotes]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/quotes.md +[eslint 5.7.0]: https://eslint.org/blog/2018/10/eslint-v5.7.0-released +[prettier]: https://github.com/prettier/prettier +[arrow-body-style]: https://eslint.org/docs/rules/arrow-body-style +[babel/quotes]: https://github.com/babel/eslint-plugin-babel#rules +[curly]: https://eslint.org/docs/rules/curly +[eslint-config-airbnb]: https://www.npmjs.com/package/eslint-config-airbnb +[eslint-config-prettier#31]: https://github.com/prettier/eslint-config-prettier/issues/31 +[eslint-config-prettier#71]: https://github.com/prettier/eslint-config-prettier/issues/71 +[eslint-plugin-babel]: https://github.com/babel/eslint-plugin-babel +[eslint-plugin-flowtype]: https://github.com/gajus/eslint-plugin-flowtype +[eslint-plugin-prettier#65]: https://github.com/prettier/eslint-plugin-prettier/issues/65 +[eslint-plugin-prettier]: https://github.com/prettier/eslint-plugin-prettier +[eslint-plugin-react]: https://github.com/yannickcr/eslint-plugin-react +[eslint-plugin-standard]: https://github.com/xjamundx/eslint-plugin-standard +[eslint-plugin-unicorn]: https://github.com/sindresorhus/eslint-plugin-unicorn +[eslint-plugin-vue]: https://github.com/vuejs/eslint-plugin-vue +[lines-around-comment]: https://eslint.org/docs/rules/lines-around-comment +[max-len]: https://eslint.org/docs/rules/max-len +[multiple configuration files]: https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy +[no-confusing-arrow]: https://eslint.org/docs/rules/no-confusing-arrow +[no-mixed-operators]: https://eslint.org/docs/rules/no-mixed-operators +[no-restricted-syntax]: https://eslint.org/docs/rules/no-restricted-syntax +[no-sequences-full]: https://eslint.org/docs/rules/no-sequences#when-not-to-use-it +[no-sequences]: https://eslint.org/docs/rules/no-sequences +[no-tabs]: https://eslint.org/docs/rules/no-tabs +[no-unexpected-multiline]: https://eslint.org/docs/rules/no-unexpected-multiline +[overrides]: https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns +[prefer-arrow-callback]: https://eslint.org/docs/rules/prefer-arrow-callback +[quotes]: https://eslint.org/docs/rules/quotes +[singlequote]: https://prettier.io/docs/en/options.html#quotes +[string formatting rules]: https://prettier.io/docs/en/rationale.html#strings +[vue/html-self-closing]: https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/html-self-closing.md +[vue/max-len]: https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/max-len.md diff --git a/node_modules/eslint-config-prettier/babel.js b/node_modules/eslint-config-prettier/babel.js new file mode 100644 index 000000000..47d036501 --- /dev/null +++ b/node_modules/eslint-config-prettier/babel.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = { + rules: { + "babel/quotes": 0, + + "babel/object-curly-spacing": "off", + "babel/semi": "off", + }, +}; diff --git a/node_modules/eslint-config-prettier/bin/cli.js b/node_modules/eslint-config-prettier/bin/cli.js new file mode 100755 index 000000000..208b1436e --- /dev/null +++ b/node_modules/eslint-config-prettier/bin/cli.js @@ -0,0 +1,207 @@ +#!/usr/bin/env node + +"use strict"; + +const fs = require("fs"); +const path = require("path"); +const getStdin = require("get-stdin"); +const validators = require("./validators"); + +const SPECIAL_RULES_URL = + "https://github.com/prettier/eslint-config-prettier#special-rules"; + +if (module === require.main) { + if (process.argv.length > 2 || process.stdin.isTTY) { + console.error( + [ + "This tool checks whether an ESLint configuration contains rules that are", + "unnecessary or conflict with Prettier. It’s supposed to be run like this:", + "", + " npx eslint --print-config path/to/main.js | npx eslint-config-prettier-check", + " npx eslint --print-config test/index.js | npx eslint-config-prettier-check", + "", + "Exit codes:", + "", + "0: No automatically detectable problems found.", + "1: Unexpected error.", + "2: Conflicting rules found.", + "", + "For more information, see:", + "https://github.com/prettier/eslint-config-prettier#cli-helper-tool", + ].join("\n") + ); + process.exit(1); + } + + getStdin() + .then((string) => { + const result = processString(string); + if (result.stderr) { + console.error(result.stderr); + } + if (result.stdout) { + console.error(result.stdout); + } + process.exit(result.code); + }) + .catch((error) => { + console.error("Unexpected error", error); + process.exit(1); + }); +} + +function processString(string) { + let config; + try { + config = JSON.parse(string); + } catch (error) { + return { + stderr: `Failed to parse JSON:\n${error.message}`, + code: 1, + }; + } + + if ( + !( + Object.prototype.toString.call(config) === "[object Object]" && + Object.prototype.toString.call(config.rules) === "[object Object]" + ) + ) { + return { + stderr: `Expected a \`{"rules: {...}"}\` JSON object, but got:\n${string}`, + code: 1, + }; + } + + // This used to look at "files" in package.json, but that is not reliable due + // to an npm bug. See: + // https://github.com/prettier/eslint-config-prettier/issues/57 + const allRules = Object.assign( + Object.create(null), + ...fs + .readdirSync(path.join(__dirname, "..")) + .filter((name) => !name.startsWith(".") && name.endsWith(".js")) + .map((ruleFileName) => require(`../${ruleFileName}`).rules) + ); + + const regularRules = filterRules( + allRules, + (ruleName, value) => value === "off" + ); + const optionsRules = filterRules( + allRules, + (ruleName, value) => value === 0 && ruleName in validators + ); + const specialRules = filterRules( + allRules, + (ruleName, value) => value === 0 && !(ruleName in validators) + ); + + const flaggedRules = Object.keys(config.rules) + .map((ruleName) => { + const value = config.rules[ruleName]; + const arrayValue = Array.isArray(value) ? value : [value]; + const level = arrayValue[0]; + const options = arrayValue.slice(1); + const isOff = level === "off" || level === 0; + return !isOff && ruleName in allRules ? { ruleName, options } : null; + }) + .filter(Boolean); + + const regularFlaggedRuleNames = filterRuleNames( + flaggedRules, + (ruleName) => ruleName in regularRules + ); + const optionsFlaggedRuleNames = filterRuleNames( + flaggedRules, + (ruleName, options) => + ruleName in optionsRules && !validators[ruleName](options) + ); + const specialFlaggedRuleNames = filterRuleNames( + flaggedRules, + (ruleName) => ruleName in specialRules + ); + + if ( + regularFlaggedRuleNames.length === 0 && + optionsFlaggedRuleNames.length === 0 + ) { + const baseMessage = + "No rules that are unnecessary or conflict with Prettier were found."; + + const message = + specialFlaggedRuleNames.length === 0 + ? baseMessage + : [ + baseMessage, + "", + "However, the following rules are enabled but cannot be automatically checked. See:", + SPECIAL_RULES_URL, + "", + printRuleNames(specialFlaggedRuleNames), + ].join("\n"); + + return { + stdout: message, + code: 0, + }; + } + + const regularMessage = [ + "The following rules are unnecessary or might conflict with Prettier:", + "", + printRuleNames(regularFlaggedRuleNames), + ].join("\n"); + + const optionsMessage = [ + "The following rules are enabled with options that might conflict with Prettier. See:", + SPECIAL_RULES_URL, + "", + printRuleNames(optionsFlaggedRuleNames), + ].join("\n"); + + const specialMessage = [ + "The following rules are enabled but cannot be automatically checked. See:", + SPECIAL_RULES_URL, + "", + printRuleNames(specialFlaggedRuleNames), + ].join("\n"); + + const message = [ + regularFlaggedRuleNames.length === 0 ? null : regularMessage, + optionsFlaggedRuleNames.length === 0 ? null : optionsMessage, + specialFlaggedRuleNames.length === 0 ? null : specialMessage, + ] + .filter(Boolean) + .join("\n\n"); + + return { + stdout: message, + code: 2, + }; +} + +function filterRules(rules, fn) { + return Object.keys(rules) + .filter((ruleName) => fn(ruleName, rules[ruleName])) + .reduce((obj, ruleName) => { + obj[ruleName] = true; + return obj; + }, Object.create(null)); +} + +function filterRuleNames(rules, fn) { + return rules + .filter((rule) => fn(rule.ruleName, rule.options)) + .map((rule) => rule.ruleName); +} + +function printRuleNames(ruleNames) { + return ruleNames + .slice() + .sort() + .map((ruleName) => `- ${ruleName}`) + .join("\n"); +} + +exports.processString = processString; diff --git a/node_modules/eslint-config-prettier/bin/validators.js b/node_modules/eslint-config-prettier/bin/validators.js new file mode 100644 index 000000000..a6a9b8ae4 --- /dev/null +++ b/node_modules/eslint-config-prettier/bin/validators.js @@ -0,0 +1,54 @@ +"use strict"; + +// These validator functions answer the question “Is the config valid?” – return +// `false` if the options DO conflict with Prettier, and `true` if they don’t. + +module.exports = { + curly(options) { + if (options.length === 0) { + return true; + } + + const firstOption = options[0]; + return firstOption !== "multi-line" && firstOption !== "multi-or-nest"; + }, + + "lines-around-comment"(options) { + if (options.length === 0) { + return false; + } + + const firstOption = options[0]; + return Boolean( + firstOption && + firstOption.allowBlockStart && + firstOption.allowBlockEnd && + firstOption.allowObjectStart && + firstOption.allowObjectEnd && + firstOption.allowArrayStart && + firstOption.allowArrayEnd + ); + }, + + "no-confusing-arrow"(options) { + if (options.length === 0) { + return false; + } + + const firstOption = options[0]; + return firstOption ? firstOption.allowParens === false : false; + }, + + "vue/html-self-closing"(options) { + if (options.length === 0) { + return false; + } + + const firstOption = options[0]; + return Boolean( + firstOption && firstOption.html && firstOption.html.void === "any" + // Enable when Prettier supports SVG: https://github.com/prettier/prettier/issues/5322 + // && firstOption.svg === "any" + ); + }, +}; diff --git a/node_modules/eslint-config-prettier/flowtype.js b/node_modules/eslint-config-prettier/flowtype.js new file mode 100644 index 000000000..34b8943cf --- /dev/null +++ b/node_modules/eslint-config-prettier/flowtype.js @@ -0,0 +1,15 @@ +"use strict"; + +module.exports = { + rules: { + "flowtype/boolean-style": "off", + "flowtype/delimiter-dangle": "off", + "flowtype/generic-spacing": "off", + "flowtype/object-type-delimiter": "off", + "flowtype/semi": "off", + "flowtype/space-after-type-colon": "off", + "flowtype/space-before-generic-bracket": "off", + "flowtype/space-before-type-colon": "off", + "flowtype/union-intersection-spacing": "off", + }, +}; diff --git a/node_modules/eslint-config-prettier/index.js b/node_modules/eslint-config-prettier/index.js new file mode 100644 index 000000000..1cbfd47a5 --- /dev/null +++ b/node_modules/eslint-config-prettier/index.js @@ -0,0 +1,103 @@ +"use strict"; + +const includeDeprecated = !process.env.ESLINT_CONFIG_PRETTIER_NO_DEPRECATED; + +module.exports = { + rules: Object.assign( + { + // The following rules can be used in some cases. See the README for more + // information. (These are marked with `0` instead of `"off"` so that a + // script can distinguish them.) + "arrow-body-style": 0, + curly: 0, + "lines-around-comment": 0, + "max-len": 0, + "no-confusing-arrow": 0, + "no-mixed-operators": 0, + "no-tabs": 0, + "no-unexpected-multiline": 0, + "prefer-arrow-callback": 0, + quotes: 0, + // The rest are rules that you never need to enable when using Prettier. + "array-bracket-newline": "off", + "array-bracket-spacing": "off", + "array-element-newline": "off", + "arrow-parens": "off", + "arrow-spacing": "off", + "block-spacing": "off", + "brace-style": "off", + "comma-dangle": "off", + "comma-spacing": "off", + "comma-style": "off", + "computed-property-spacing": "off", + "dot-location": "off", + "eol-last": "off", + "func-call-spacing": "off", + "function-call-argument-newline": "off", + "function-paren-newline": "off", + "generator-star": "off", + "generator-star-spacing": "off", + "implicit-arrow-linebreak": "off", + indent: "off", + "jsx-quotes": "off", + "key-spacing": "off", + "keyword-spacing": "off", + "linebreak-style": "off", + "multiline-ternary": "off", + "newline-per-chained-call": "off", + "new-parens": "off", + "no-arrow-condition": "off", + "no-comma-dangle": "off", + "no-extra-parens": "off", + "no-extra-semi": "off", + "no-floating-decimal": "off", + "no-mixed-spaces-and-tabs": "off", + "no-multi-spaces": "off", + "no-multiple-empty-lines": "off", + "no-reserved-keys": "off", + "no-space-before-semi": "off", + "no-trailing-spaces": "off", + "no-whitespace-before-property": "off", + "no-wrap-func": "off", + "nonblock-statement-body-position": "off", + "object-curly-newline": "off", + "object-curly-spacing": "off", + "object-property-newline": "off", + "one-var-declaration-per-line": "off", + "operator-linebreak": "off", + "padded-blocks": "off", + "quote-props": "off", + "rest-spread-spacing": "off", + semi: "off", + "semi-spacing": "off", + "semi-style": "off", + "space-after-function-name": "off", + "space-after-keywords": "off", + "space-before-blocks": "off", + "space-before-function-paren": "off", + "space-before-function-parentheses": "off", + "space-before-keywords": "off", + "space-in-brackets": "off", + "space-in-parens": "off", + "space-infix-ops": "off", + "space-return-throw-case": "off", + "space-unary-ops": "off", + "space-unary-word-ops": "off", + "switch-colon-spacing": "off", + "template-curly-spacing": "off", + "template-tag-spacing": "off", + "unicode-bom": "off", + "wrap-iife": "off", + "wrap-regex": "off", + "yield-star-spacing": "off", + }, + includeDeprecated && { + // Deprecated since version 4.0.0. + // https://github.com/eslint/eslint/pull/8286 + "indent-legacy": "off", + // Deprecated since version 3.3.0. + // https://eslint.org/docs/rules/no-spaced-func + "no-spaced-func": "off", + } + ), +}; diff --git a/node_modules/eslint-config-prettier/package.json b/node_modules/eslint-config-prettier/package.json new file mode 100644 index 000000000..ea6eba288 --- /dev/null +++ b/node_modules/eslint-config-prettier/package.json @@ -0,0 +1,67 @@ +{ + "name": "eslint-config-prettier", + "version": "6.11.0", + "license": "MIT", + "author": "Simon Lydell", + "description": "Turns off all rules that are unnecessary or might conflict with Prettier.", + "repository": "prettier/eslint-config-prettier", + "files": [ + "bin/", + "@typescript-eslint.js", + "babel.js", + "flowtype.js", + "index.js", + "react.js", + "standard.js", + "unicorn.js", + "vue.js" + ], + "bin": { + "eslint-config-prettier-check": "bin/cli.js" + }, + "keywords": [ + "eslint", + "eslintconfig", + "prettier" + ], + "scripts": { + "doctoc": "doctoc README.md && replace \"\\[\\[([\\w/-]+)\\](?:([^\\[\\]]+)\\[([\\w/-]+)\\])?\\]\" \"[\\$1\\$2\\$3]\" README.md", + "prettier": "prettier --write .", + "test:lint": "eslint . && prettier --check .", + "test:lint-verify-fail": "eslint \"test-lint/*.{js,ts,vue}\" --config .eslintrc.base.js --format json", + "test:lint-rules": "eslint index.js --config test-config/.eslintrc.js --format json", + "test:deprecated": "eslint-find-rules --deprecated index.js", + "test:jest": "jest", + "test:cli-sanity": "eslint --print-config index.js | node ./bin/cli.js", + "test:cli-sanity-warning": "eslint --print-config ./bin/cli.js | node ./bin/cli.js", + "test": "npm run test:lint && npm run test:jest && npm run test:cli-sanity && npm run test:cli-sanity-warning" + }, + "dependencies": { + "get-stdin": "^6.0.0" + }, + "devDependencies": { + "@typescript-eslint/eslint-plugin": "2.29.0", + "@typescript-eslint/parser": "2.29.0", + "babel-eslint": "10.1.0", + "cross-spawn": "7.0.2", + "doctoc": "1.4.0", + "eslint": "6.8.0", + "eslint-config-google": "0.14.0", + "eslint-find-rules": "3.4.0", + "eslint-plugin-babel": "5.3.0", + "eslint-plugin-flowtype": "4.7.0", + "eslint-plugin-prettier": "3.1.3", + "eslint-plugin-react": "7.19.0", + "eslint-plugin-standard": "4.0.1", + "eslint-plugin-unicorn": "18.0.1", + "eslint-plugin-vue": "6.2.2", + "jest": "25.4.0", + "prettier": "2.0.5", + "replace": "1.1.5", + "rimraf": "3.0.2", + "typescript": "3.7.5" + }, + "peerDependencies": { + "eslint": ">=3.14.1" + } +} \ No newline at end of file diff --git a/node_modules/eslint-config-prettier/react.js b/node_modules/eslint-config-prettier/react.js new file mode 100644 index 000000000..3f4855323 --- /dev/null +++ b/node_modules/eslint-config-prettier/react.js @@ -0,0 +1,29 @@ +"use strict"; + +const includeDeprecated = !process.env.ESLINT_CONFIG_PRETTIER_NO_DEPRECATED; + +module.exports = { + rules: Object.assign( + { + "react/jsx-child-element-spacing": "off", + "react/jsx-closing-bracket-location": "off", + "react/jsx-closing-tag-location": "off", + "react/jsx-curly-newline": "off", + "react/jsx-curly-spacing": "off", + "react/jsx-equals-spacing": "off", + "react/jsx-first-prop-new-line": "off", + "react/jsx-indent": "off", + "react/jsx-indent-props": "off", + "react/jsx-max-props-per-line": "off", + "react/jsx-one-expression-per-line": "off", + "react/jsx-props-no-multi-spaces": "off", + "react/jsx-tag-spacing": "off", + "react/jsx-wrap-multilines": "off", + }, + includeDeprecated && { + // Deprecated since version 7.0.0. + // https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md#700---2017-05-06 + "react/jsx-space-before-closing": "off", + } + ), +}; diff --git a/node_modules/eslint-config-prettier/standard.js b/node_modules/eslint-config-prettier/standard.js new file mode 100644 index 000000000..faacadd01 --- /dev/null +++ b/node_modules/eslint-config-prettier/standard.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = { + rules: { + "standard/array-bracket-even-spacing": "off", + "standard/computed-property-even-spacing": "off", + "standard/object-curly-even-spacing": "off", + }, +}; diff --git a/node_modules/eslint-config-prettier/unicorn.js b/node_modules/eslint-config-prettier/unicorn.js new file mode 100644 index 000000000..eb7103edc --- /dev/null +++ b/node_modules/eslint-config-prettier/unicorn.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = { + rules: { + "unicorn/no-nested-ternary": "off", + "unicorn/number-literal-case": "off", + }, +}; diff --git a/node_modules/eslint-config-prettier/vue.js b/node_modules/eslint-config-prettier/vue.js new file mode 100644 index 000000000..d60c2dea8 --- /dev/null +++ b/node_modules/eslint-config-prettier/vue.js @@ -0,0 +1,32 @@ +"use strict"; + +module.exports = { + rules: { + "vue/html-self-closing": 0, + "vue/max-len": 0, + + "vue/array-bracket-spacing": "off", + "vue/arrow-spacing": "off", + "vue/block-spacing": "off", + "vue/brace-style": "off", + "vue/comma-dangle": "off", + "vue/dot-location": "off", + "vue/html-closing-bracket-newline": "off", + "vue/html-closing-bracket-spacing": "off", + "vue/html-end-tags": "off", + "vue/html-indent": "off", + "vue/html-quotes": "off", + "vue/key-spacing": "off", + "vue/keyword-spacing": "off", + "vue/max-attributes-per-line": "off", + "vue/multiline-html-element-content-newline": "off", + "vue/mustache-interpolation-spacing": "off", + "vue/no-multi-spaces": "off", + "vue/no-spaces-around-equal-signs-in-attribute": "off", + "vue/object-curly-spacing": "off", + "vue/script-indent": "off", + "vue/singleline-html-element-content-newline": "off", + "vue/space-infix-ops": "off", + "vue/space-unary-ops": "off", + }, +}; diff --git a/node_modules/eslint-import-resolver-node/CHANGELOG.md b/node_modules/eslint-import-resolver-node/CHANGELOG.md new file mode 100644 index 000000000..8fa31bed7 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/CHANGELOG.md @@ -0,0 +1,63 @@ +# Change Log +All notable changes to this resolver will be documented in this file. +This project adheres to [Semantic Versioning](http://semver.org/). +This change log adheres to standards from [Keep a CHANGELOG](http://keepachangelog.com). + +## Unreleased + +## v0.3.4 - 2020-06-16 +### Added +- add `.node` extension ([#1663]) + +## v0.3.3 - 2020-01-10 +### Changed +- [meta] copy LICENSE file to all npm packages on prepublish ([#1595], thanks [@opichals]) + +## v0.3.2 - 2018-01-05 +### Added +- `.mjs` extension detected by default to support `experimental-modules` ([#939]) + +### Deps +- update `debug`, `resolve` + +## v0.3.1 - 2017-06-23 +### Changed +- bumped `debug` dep to match other packages + +## v0.3.0 - 2016-12-15 +### Changed +- bumped `resolve` to fix issues with Node builtins (thanks [@SkeLLLa] and [@ljharb]) + +### Fixed +- use `files` in `package.json` to ship only `index.js` ([#531], thanks for noticing [@lukeapage]) + +## v0.2.3 - 2016-08-20 +### Added +- debug logging (use `DEBUG=eslint-plugin-import:resolver:node eslint [...]`) + +## v0.2.2 - 2016-07-14 +### Fixed +- Node resolver no longer declares the import plugin as a `peerDependency`. See [#437] + for a well-articulated and thoughtful expression of why this doesn't make sense. + Thanks [@jasonkarns] for the issue and the PR to fix it ([#438]). + + Also, apologies to the others who expressed this before, but I never understood + what the problem was.😅 + +## v0.2.1 +### Fixed +- find files with `.json` extensions (#333, thanks for noticing @jfmengels) + +[#438]: https://github.com/benmosher/eslint-plugin-import/pull/438 + +[#1663]: https://github.com/benmosher/eslint-plugin-import/issues/1663 +[#1595]: https://github.com/benmosher/eslint-plugin-import/pull/1595 +[#939]: https://github.com/benmosher/eslint-plugin-import/issues/939 +[#531]: https://github.com/benmosher/eslint-plugin-import/issues/531 +[#437]: https://github.com/benmosher/eslint-plugin-import/issues/437 + +[@jasonkarns]: https://github.com/jasonkarns +[@lukeapage]: https://github.com/lukeapage +[@SkeLLLa]: https://github.com/SkeLLLa +[@ljharb]: https://github.com/ljharb +[@opichals]: https://github.com/opichals diff --git a/node_modules/eslint-import-resolver-node/LICENSE b/node_modules/eslint-import-resolver-node/LICENSE new file mode 100644 index 000000000..c6ade2a43 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Ben Mosher + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/eslint-import-resolver-node/README.md b/node_modules/eslint-import-resolver-node/README.md new file mode 100644 index 000000000..20fe1e5af --- /dev/null +++ b/node_modules/eslint-import-resolver-node/README.md @@ -0,0 +1,44 @@ +# eslint-import-resolver-node + +[![npm](https://img.shields.io/npm/v/eslint-import-resolver-node.svg)](https://www.npmjs.com/package/eslint-import-resolver-node) + +Default Node-style module resolution plugin for [`eslint-plugin-import`](https://www.npmjs.com/package/eslint-plugin-import). + +Published separately to allow pegging to a specific version in case of breaking +changes. + +Config is passed directly through to [`resolve`](https://www.npmjs.com/package/resolve#resolve-sync-id-opts) as options: + +```yaml +settings: + import/resolver: + node: + extensions: + # if unset, default is just '.js', but it must be re-added explicitly if set + - .js + - .jsx + - .es6 + - .coffee + + paths: + # an array of absolute paths which will also be searched + # think NODE_PATH + - /usr/local/share/global_modules + + # this is technically for identifying `node_modules` alternate names + moduleDirectory: + + - node_modules # defaults to 'node_modules', but... + - bower_components + + - project/src # can add a path segment here that will act like + # a source root, for in-project aliasing (i.e. + # `import MyStore from 'stores/my-store'`) +``` + +or to use the default options: + +```yaml +settings: + import/resolver: node +``` diff --git a/node_modules/eslint-import-resolver-node/index.js b/node_modules/eslint-import-resolver-node/index.js new file mode 100644 index 000000000..bf2aab382 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/index.js @@ -0,0 +1,47 @@ +var resolve = require('resolve') + , path = require('path') + +var log = require('debug')('eslint-plugin-import:resolver:node') + +exports.interfaceVersion = 2 + +exports.resolve = function (source, file, config) { + log('Resolving:', source, 'from:', file) + var resolvedPath + + if (resolve.isCore(source)) { + log('resolved to core') + return { found: true, path: null } + } + + try { + resolvedPath = resolve.sync(source, opts(file, config)) + log('Resolved to:', resolvedPath) + return { found: true, path: resolvedPath } + } catch (err) { + log('resolve threw error:', err) + return { found: false } + } +} + +function opts(file, config) { + return Object.assign({ + // more closely matches Node (#333) + // plus 'mjs' for native modules! (#939) + extensions: ['.mjs', '.js', '.json', '.node'], + }, + config, + { + // path.resolve will handle paths relative to CWD + basedir: path.dirname(path.resolve(file)), + packageFilter: packageFilter, + + }) +} + +function packageFilter(pkg) { + if (pkg['jsnext:main']) { + pkg['main'] = pkg['jsnext:main'] + } + return pkg +} diff --git a/node_modules/eslint-import-resolver-node/node_modules/debug/.coveralls.yml b/node_modules/eslint-import-resolver-node/node_modules/debug/.coveralls.yml new file mode 100644 index 000000000..20a706858 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/.coveralls.yml @@ -0,0 +1 @@ +repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve diff --git a/node_modules/eslint-import-resolver-node/node_modules/debug/.eslintrc b/node_modules/eslint-import-resolver-node/node_modules/debug/.eslintrc new file mode 100644 index 000000000..8a37ae2c2 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/.eslintrc @@ -0,0 +1,11 @@ +{ + "env": { + "browser": true, + "node": true + }, + "rules": { + "no-console": 0, + "no-empty": [1, { "allowEmptyCatch": true }] + }, + "extends": "eslint:recommended" +} diff --git a/node_modules/eslint-import-resolver-node/node_modules/debug/.npmignore b/node_modules/eslint-import-resolver-node/node_modules/debug/.npmignore new file mode 100644 index 000000000..5f60eecc8 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/.npmignore @@ -0,0 +1,9 @@ +support +test +examples +example +*.sock +dist +yarn.lock +coverage +bower.json diff --git a/node_modules/eslint-import-resolver-node/node_modules/debug/.travis.yml b/node_modules/eslint-import-resolver-node/node_modules/debug/.travis.yml new file mode 100644 index 000000000..6c6090c3b --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/.travis.yml @@ -0,0 +1,14 @@ + +language: node_js +node_js: + - "6" + - "5" + - "4" + +install: + - make node_modules + +script: + - make lint + - make test + - make coveralls diff --git a/node_modules/eslint-import-resolver-node/node_modules/debug/CHANGELOG.md b/node_modules/eslint-import-resolver-node/node_modules/debug/CHANGELOG.md new file mode 100644 index 000000000..eadaa1895 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/CHANGELOG.md @@ -0,0 +1,362 @@ + +2.6.9 / 2017-09-22 +================== + + * remove ReDoS regexp in %o formatter (#504) + +2.6.8 / 2017-05-18 +================== + + * Fix: Check for undefined on browser globals (#462, @marbemac) + +2.6.7 / 2017-05-16 +================== + + * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom) + * Fix: Inline extend function in node implementation (#452, @dougwilson) + * Docs: Fix typo (#455, @msasad) + +2.6.5 / 2017-04-27 +================== + + * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek) + * Misc: clean up browser reference checks (#447, @thebigredgeek) + * Misc: add npm-debug.log to .gitignore (@thebigredgeek) + + +2.6.4 / 2017-04-20 +================== + + * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo) + * Chore: ignore bower.json in npm installations. (#437, @joaovieira) + * Misc: update "ms" to v0.7.3 (@tootallnate) + +2.6.3 / 2017-03-13 +================== + + * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts) + * Docs: Changelog fix (@thebigredgeek) + +2.6.2 / 2017-03-10 +================== + + * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin) + * Docs: Add backers and sponsors from Open Collective (#422, @piamancini) + * Docs: Add Slackin invite badge (@tootallnate) + +2.6.1 / 2017-02-10 +================== + + * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error + * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0) + * Fix: IE8 "Expected identifier" error (#414, @vgoma) + * Fix: Namespaces would not disable once enabled (#409, @musikov) + +2.6.0 / 2016-12-28 +================== + + * Fix: added better null pointer checks for browser useColors (@thebigredgeek) + * Improvement: removed explicit `window.debug` export (#404, @tootallnate) + * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate) + +2.5.2 / 2016-12-25 +================== + + * Fix: reference error on window within webworkers (#393, @KlausTrainer) + * Docs: fixed README typo (#391, @lurch) + * Docs: added notice about v3 api discussion (@thebigredgeek) + +2.5.1 / 2016-12-20 +================== + + * Fix: babel-core compatibility + +2.5.0 / 2016-12-20 +================== + + * Fix: wrong reference in bower file (@thebigredgeek) + * Fix: webworker compatibility (@thebigredgeek) + * Fix: output formatting issue (#388, @kribblo) + * Fix: babel-loader compatibility (#383, @escwald) + * Misc: removed built asset from repo and publications (@thebigredgeek) + * Misc: moved source files to /src (#378, @yamikuronue) + * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue) + * Test: coveralls integration (#378, @yamikuronue) + * Docs: simplified language in the opening paragraph (#373, @yamikuronue) + +2.4.5 / 2016-12-17 +================== + + * Fix: `navigator` undefined in Rhino (#376, @jochenberger) + * Fix: custom log function (#379, @hsiliev) + * Improvement: bit of cleanup + linting fixes (@thebigredgeek) + * Improvement: rm non-maintainted `dist/` dir (#375, @freewil) + * Docs: simplified language in the opening paragraph. (#373, @yamikuronue) + +2.4.4 / 2016-12-14 +================== + + * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts) + +2.4.3 / 2016-12-14 +================== + + * Fix: navigation.userAgent error for react native (#364, @escwald) + +2.4.2 / 2016-12-14 +================== + + * Fix: browser colors (#367, @tootallnate) + * Misc: travis ci integration (@thebigredgeek) + * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek) + +2.4.1 / 2016-12-13 +================== + + * Fix: typo that broke the package (#356) + +2.4.0 / 2016-12-13 +================== + + * Fix: bower.json references unbuilt src entry point (#342, @justmatt) + * Fix: revert "handle regex special characters" (@tootallnate) + * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate) + * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate) + * Improvement: allow colors in workers (#335, @botverse) + * Improvement: use same color for same namespace. (#338, @lchenay) + +2.3.3 / 2016-11-09 +================== + + * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne) + * Fix: Returning `localStorage` saved values (#331, Levi Thomason) + * Improvement: Don't create an empty object when no `process` (Nathan Rajlich) + +2.3.2 / 2016-11-09 +================== + + * Fix: be super-safe in index.js as well (@TooTallNate) + * Fix: should check whether process exists (Tom Newby) + +2.3.1 / 2016-11-09 +================== + + * Fix: Added electron compatibility (#324, @paulcbetts) + * Improvement: Added performance optimizations (@tootallnate) + * Readme: Corrected PowerShell environment variable example (#252, @gimre) + * Misc: Removed yarn lock file from source control (#321, @fengmk2) + +2.3.0 / 2016-11-07 +================== + + * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic) + * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos) + * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15) + * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran) + * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom) + * Package: Update "ms" to 0.7.2 (#315, @DevSide) + * Package: removed superfluous version property from bower.json (#207 @kkirsche) + * Readme: fix USE_COLORS to DEBUG_COLORS + * Readme: Doc fixes for format string sugar (#269, @mlucool) + * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0) + * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable) + * Readme: better docs for browser support (#224, @matthewmueller) + * Tooling: Added yarn integration for development (#317, @thebigredgeek) + * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek) + * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman) + * Misc: Updated contributors (@thebigredgeek) + +2.2.0 / 2015-05-09 +================== + + * package: update "ms" to v0.7.1 (#202, @dougwilson) + * README: add logging to file example (#193, @DanielOchoa) + * README: fixed a typo (#191, @amir-s) + * browser: expose `storage` (#190, @stephenmathieson) + * Makefile: add a `distclean` target (#189, @stephenmathieson) + +2.1.3 / 2015-03-13 +================== + + * Updated stdout/stderr example (#186) + * Updated example/stdout.js to match debug current behaviour + * Renamed example/stderr.js to stdout.js + * Update Readme.md (#184) + * replace high intensity foreground color for bold (#182, #183) + +2.1.2 / 2015-03-01 +================== + + * dist: recompile + * update "ms" to v0.7.0 + * package: update "browserify" to v9.0.3 + * component: fix "ms.js" repo location + * changed bower package name + * updated documentation about using debug in a browser + * fix: security error on safari (#167, #168, @yields) + +2.1.1 / 2014-12-29 +================== + + * browser: use `typeof` to check for `console` existence + * browser: check for `console.log` truthiness (fix IE 8/9) + * browser: add support for Chrome apps + * Readme: added Windows usage remarks + * Add `bower.json` to properly support bower install + +2.1.0 / 2014-10-15 +================== + + * node: implement `DEBUG_FD` env variable support + * package: update "browserify" to v6.1.0 + * package: add "license" field to package.json (#135, @panuhorsmalahti) + +2.0.0 / 2014-09-01 +================== + + * package: update "browserify" to v5.11.0 + * node: use stderr rather than stdout for logging (#29, @stephenmathieson) + +1.0.4 / 2014-07-15 +================== + + * dist: recompile + * example: remove `console.info()` log usage + * example: add "Content-Type" UTF-8 header to browser example + * browser: place %c marker after the space character + * browser: reset the "content" color via `color: inherit` + * browser: add colors support for Firefox >= v31 + * debug: prefer an instance `log()` function over the global one (#119) + * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) + +1.0.3 / 2014-07-09 +================== + + * Add support for multiple wildcards in namespaces (#122, @seegno) + * browser: fix lint + +1.0.2 / 2014-06-10 +================== + + * browser: update color palette (#113, @gscottolson) + * common: make console logging function configurable (#108, @timoxley) + * node: fix %o colors on old node <= 0.8.x + * Makefile: find node path using shell/which (#109, @timoxley) + +1.0.1 / 2014-06-06 +================== + + * browser: use `removeItem()` to clear localStorage + * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) + * package: add "contributors" section + * node: fix comment typo + * README: list authors + +1.0.0 / 2014-06-04 +================== + + * make ms diff be global, not be scope + * debug: ignore empty strings in enable() + * node: make DEBUG_COLORS able to disable coloring + * *: export the `colors` array + * npmignore: don't publish the `dist` dir + * Makefile: refactor to use browserify + * package: add "browserify" as a dev dependency + * Readme: add Web Inspector Colors section + * node: reset terminal color for the debug content + * node: map "%o" to `util.inspect()` + * browser: map "%j" to `JSON.stringify()` + * debug: add custom "formatters" + * debug: use "ms" module for humanizing the diff + * Readme: add "bash" syntax highlighting + * browser: add Firebug color support + * browser: add colors for WebKit browsers + * node: apply log to `console` + * rewrite: abstract common logic for Node & browsers + * add .jshintrc file + +0.8.1 / 2014-04-14 +================== + + * package: re-add the "component" section + +0.8.0 / 2014-03-30 +================== + + * add `enable()` method for nodejs. Closes #27 + * change from stderr to stdout + * remove unnecessary index.js file + +0.7.4 / 2013-11-13 +================== + + * remove "browserify" key from package.json (fixes something in browserify) + +0.7.3 / 2013-10-30 +================== + + * fix: catch localStorage security error when cookies are blocked (Chrome) + * add debug(err) support. Closes #46 + * add .browser prop to package.json. Closes #42 + +0.7.2 / 2013-02-06 +================== + + * fix package.json + * fix: Mobile Safari (private mode) is broken with debug + * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript + +0.7.1 / 2013-02-05 +================== + + * add repository URL to package.json + * add DEBUG_COLORED to force colored output + * add browserify support + * fix component. Closes #24 + +0.7.0 / 2012-05-04 +================== + + * Added .component to package.json + * Added debug.component.js build + +0.6.0 / 2012-03-16 +================== + + * Added support for "-" prefix in DEBUG [Vinay Pulim] + * Added `.enabled` flag to the node version [TooTallNate] + +0.5.0 / 2012-02-02 +================== + + * Added: humanize diffs. Closes #8 + * Added `debug.disable()` to the CS variant + * Removed padding. Closes #10 + * Fixed: persist client-side variant again. Closes #9 + +0.4.0 / 2012-02-01 +================== + + * Added browser variant support for older browsers [TooTallNate] + * Added `debug.enable('project:*')` to browser variant [TooTallNate] + * Added padding to diff (moved it to the right) + +0.3.0 / 2012-01-26 +================== + + * Added millisecond diff when isatty, otherwise UTC string + +0.2.0 / 2012-01-22 +================== + + * Added wildcard support + +0.1.0 / 2011-12-02 +================== + + * Added: remove colors unless stderr isatty [TooTallNate] + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/eslint-import-resolver-node/node_modules/debug/LICENSE b/node_modules/eslint-import-resolver-node/node_modules/debug/LICENSE new file mode 100644 index 000000000..658c933d2 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/LICENSE @@ -0,0 +1,19 @@ +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the 'Software'), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/eslint-import-resolver-node/node_modules/debug/Makefile b/node_modules/eslint-import-resolver-node/node_modules/debug/Makefile new file mode 100644 index 000000000..584da8bf9 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/Makefile @@ -0,0 +1,50 @@ +# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 +THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) + +# BIN directory +BIN := $(THIS_DIR)/node_modules/.bin + +# Path +PATH := node_modules/.bin:$(PATH) +SHELL := /bin/bash + +# applications +NODE ?= $(shell which node) +YARN ?= $(shell which yarn) +PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm)) +BROWSERIFY ?= $(NODE) $(BIN)/browserify + +.FORCE: + +install: node_modules + +node_modules: package.json + @NODE_ENV= $(PKG) install + @touch node_modules + +lint: .FORCE + eslint browser.js debug.js index.js node.js + +test-node: .FORCE + istanbul cover node_modules/mocha/bin/_mocha -- test/**.js + +test-browser: .FORCE + mkdir -p dist + + @$(BROWSERIFY) \ + --standalone debug \ + . > dist/debug.js + + karma start --single-run + rimraf dist + +test: .FORCE + concurrently \ + "make test-node" \ + "make test-browser" + +coveralls: + cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js + +.PHONY: all install clean distclean diff --git a/node_modules/eslint-import-resolver-node/node_modules/debug/README.md b/node_modules/eslint-import-resolver-node/node_modules/debug/README.md new file mode 100644 index 000000000..f67be6b31 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/README.md @@ -0,0 +1,312 @@ +# debug +[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) +[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) + + + +A tiny node.js debugging utility modelled after node core's debugging technique. + +**Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)** + +## Installation + +```bash +$ npm install debug +``` + +## Usage + +`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. + +Example _app.js_: + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %s', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example _worker.js_: + +```js +var debug = require('debug')('worker'); + +setInterval(function(){ + debug('doing some work'); +}, 1000); +``` + + The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: + + ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) + + ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) + +#### Windows note + + On Windows the environment variable is set using the `set` command. + + ```cmd + set DEBUG=*,-not_this + ``` + + Note that PowerShell uses different syntax to set environment variables. + + ```cmd + $env:DEBUG = "*,-not_this" + ``` + +Then, run the program to be debugged as usual. + +## Millisecond diff + + When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) + + When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: + + ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) + +## Conventions + + If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". + +## Wildcards + + The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + + You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". + +## Environment Variables + + When running through Node.js, you can set a few environment variables that will + change the behavior of the debug logging: + +| Name | Purpose | +|-----------|-------------------------------------------------| +| `DEBUG` | Enables/disables specific debugging namespaces. | +| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | +| `DEBUG_DEPTH` | Object inspection depth. | +| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | + + + __Note:__ The environment variables beginning with `DEBUG_` end up being + converted into an Options object that gets used with `%o`/`%O` formatters. + See the Node.js documentation for + [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) + for the complete list. + +## Formatters + + + Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters: + +| Formatter | Representation | +|-----------|----------------| +| `%O` | Pretty-print an Object on multiple lines. | +| `%o` | Pretty-print an Object all on a single line. | +| `%s` | String. | +| `%d` | Number (both integer and float). | +| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | +| `%%` | Single percent sign ('%'). This does not consume an argument. | + +### Custom formatters + + You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like: + +```js +const createDebug = require('debug') +createDebug.formatters.h = (v) => { + return v.toString('hex') +} + +// …elsewhere +const debug = createDebug('foo') +debug('this is hex: %h', new Buffer('hello world')) +// foo this is hex: 68656c6c6f20776f726c6421 +0ms +``` + +## Browser support + You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), + or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), + if you don't want to build it yourself. + + Debug's enable state is currently persisted by `localStorage`. + Consider the situation shown below where you have `worker:a` and `worker:b`, + and wish to debug both. You can enable this using `localStorage.debug`: + +```js +localStorage.debug = 'worker:*' +``` + +And then refresh the page. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + +#### Web Inspector Colors + + Colors are also enabled on "Web Inspectors" that understand the `%c` formatting + option. These are WebKit web inspectors, Firefox ([since version + 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) + and the Firebug plugin for Firefox (any version). + + Colored output looks something like: + + ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) + + +## Output streams + + By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: + +Example _stdout.js_: + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + - Andrew Rhyne + +## Backers + +Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Sponsors + +Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## License + +(The MIT License) + +Copyright (c) 2014-2016 TJ Holowaychuk <tj@vision-media.ca> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/eslint-import-resolver-node/node_modules/debug/component.json b/node_modules/eslint-import-resolver-node/node_modules/debug/component.json new file mode 100644 index 000000000..9de26410f --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/component.json @@ -0,0 +1,19 @@ +{ + "name": "debug", + "repo": "visionmedia/debug", + "description": "small debugging utility", + "version": "2.6.9", + "keywords": [ + "debug", + "log", + "debugger" + ], + "main": "src/browser.js", + "scripts": [ + "src/browser.js", + "src/debug.js" + ], + "dependencies": { + "rauchg/ms.js": "0.7.1" + } +} diff --git a/node_modules/eslint-import-resolver-node/node_modules/debug/karma.conf.js b/node_modules/eslint-import-resolver-node/node_modules/debug/karma.conf.js new file mode 100644 index 000000000..103a82d15 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/karma.conf.js @@ -0,0 +1,70 @@ +// Karma configuration +// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC) + +module.exports = function(config) { + config.set({ + + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: '', + + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['mocha', 'chai', 'sinon'], + + + // list of files / patterns to load in the browser + files: [ + 'dist/debug.js', + 'test/*spec.js' + ], + + + // list of files to exclude + exclude: [ + 'src/node.js' + ], + + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + }, + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ['progress'], + + + // web server port + port: 9876, + + + // enable / disable colors in the output (reporters and logs) + colors: true, + + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: true, + + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: ['PhantomJS'], + + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: false, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: Infinity + }) +} diff --git a/node_modules/eslint-import-resolver-node/node_modules/debug/node.js b/node_modules/eslint-import-resolver-node/node_modules/debug/node.js new file mode 100644 index 000000000..7fc36fe6d --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/node.js @@ -0,0 +1 @@ +module.exports = require('./src/node'); diff --git a/node_modules/eslint-import-resolver-node/node_modules/debug/package.json b/node_modules/eslint-import-resolver-node/node_modules/debug/package.json new file mode 100644 index 000000000..0b1b9df8b --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/package.json @@ -0,0 +1,49 @@ +{ + "name": "debug", + "version": "2.6.9", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "description": "small debugging utility", + "keywords": [ + "debug", + "log", + "debugger" + ], + "author": "TJ Holowaychuk ", + "contributors": [ + "Nathan Rajlich (http://n8.io)", + "Andrew Rhyne " + ], + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + }, + "devDependencies": { + "browserify": "9.0.3", + "chai": "^3.5.0", + "concurrently": "^3.1.0", + "coveralls": "^2.11.15", + "eslint": "^3.12.1", + "istanbul": "^0.4.5", + "karma": "^1.3.0", + "karma-chai": "^0.1.0", + "karma-mocha": "^1.3.0", + "karma-phantomjs-launcher": "^1.0.2", + "karma-sinon": "^1.0.5", + "mocha": "^3.2.0", + "mocha-lcov-reporter": "^1.2.0", + "rimraf": "^2.5.4", + "sinon": "^1.17.6", + "sinon-chai": "^2.8.0" + }, + "main": "./src/index.js", + "browser": "./src/browser.js", + "component": { + "scripts": { + "debug/index.js": "browser.js", + "debug/debug.js": "debug.js" + } + } +} \ No newline at end of file diff --git a/node_modules/eslint-import-resolver-node/node_modules/debug/src/browser.js b/node_modules/eslint-import-resolver-node/node_modules/debug/src/browser.js new file mode 100644 index 000000000..710692493 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/src/browser.js @@ -0,0 +1,185 @@ +/** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = 'undefined' != typeof chrome + && 'undefined' != typeof chrome.storage + ? chrome.storage.local + : localstorage(); + +/** + * Colors. + */ + +exports.colors = [ + 'lightseagreen', + 'forestgreen', + 'goldenrod', + 'dodgerblue', + 'darkorchid', + 'crimson' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { + return true; + } + + // is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +exports.formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (err) { + return '[UnexpectedJSONParseError]: ' + err.message; + } +}; + + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs(args) { + var useColors = this.useColors; + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); + + if (!useColors) return; + + var c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit') + + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); +} + +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + +function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + try { + if (null == namespaces) { + exports.storage.removeItem('debug'); + } else { + exports.storage.debug = namespaces; + } + } catch(e) {} +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + var r; + try { + r = exports.storage.debug; + } catch(e) {} + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; +} + +/** + * Enable namespaces listed in `localStorage.debug` initially. + */ + +exports.enable(load()); + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage() { + try { + return window.localStorage; + } catch (e) {} +} diff --git a/node_modules/eslint-import-resolver-node/node_modules/debug/src/debug.js b/node_modules/eslint-import-resolver-node/node_modules/debug/src/debug.js new file mode 100644 index 000000000..6a5e3fc94 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/src/debug.js @@ -0,0 +1,202 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; +exports.coerce = coerce; +exports.disable = disable; +exports.enable = enable; +exports.enabled = enabled; +exports.humanize = require('ms'); + +/** + * The currently active debug mode names, and names to skip. + */ + +exports.names = []; +exports.skips = []; + +/** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + +exports.formatters = {}; + +/** + * Previous log timestamp. + */ + +var prevTime; + +/** + * Select a color. + * @param {String} namespace + * @return {Number} + * @api private + */ + +function selectColor(namespace) { + var hash = 0, i; + + for (i in namespace) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return exports.colors[Math.abs(hash) % exports.colors.length]; +} + +/** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + +function createDebug(namespace) { + + function debug() { + // disabled? + if (!debug.enabled) return; + + var self = debug; + + // set `diff` timestamp + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // turn the `arguments` into a proper Array + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %O + args.unshift('%O'); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); + + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // apply env-specific formatting (colors, etc.) + exports.formatArgs.call(self, args); + + var logFn = debug.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.enabled = exports.enabled(namespace); + debug.useColors = exports.useColors(); + debug.color = selectColor(namespace); + + // env-specific initialization logic for debug instances + if ('function' === typeof exports.init) { + exports.init(debug); + } + + return debug; +} + +/** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + +function enable(namespaces) { + exports.save(namespaces); + + exports.names = []; + exports.skips = []; + + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; + + for (var i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } +} + +/** + * Disable debug output. + * + * @api public + */ + +function disable() { + exports.enable(''); +} + +/** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + +function enabled(name) { + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; +} + +/** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + +function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; +} diff --git a/node_modules/eslint-import-resolver-node/node_modules/debug/src/index.js b/node_modules/eslint-import-resolver-node/node_modules/debug/src/index.js new file mode 100644 index 000000000..e12cf4d58 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/src/index.js @@ -0,0 +1,10 @@ +/** + * Detect Electron renderer process, which is node, but we should + * treat as a browser. + */ + +if (typeof process !== 'undefined' && process.type === 'renderer') { + module.exports = require('./browser.js'); +} else { + module.exports = require('./node.js'); +} diff --git a/node_modules/eslint-import-resolver-node/node_modules/debug/src/inspector-log.js b/node_modules/eslint-import-resolver-node/node_modules/debug/src/inspector-log.js new file mode 100644 index 000000000..60ea6c04a --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/src/inspector-log.js @@ -0,0 +1,15 @@ +module.exports = inspectorLog; + +// black hole +const nullStream = new (require('stream').Writable)(); +nullStream._write = () => {}; + +/** + * Outputs a `console.log()` to the Node.js Inspector console *only*. + */ +function inspectorLog() { + const stdout = console._stdout; + console._stdout = nullStream; + console.log.apply(console, arguments); + console._stdout = stdout; +} diff --git a/node_modules/eslint-import-resolver-node/node_modules/debug/src/node.js b/node_modules/eslint-import-resolver-node/node_modules/debug/src/node.js new file mode 100644 index 000000000..b15109c90 --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/debug/src/node.js @@ -0,0 +1,248 @@ +/** + * Module dependencies. + */ + +var tty = require('tty'); +var util = require('util'); + +/** + * This is the Node.js implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; + +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + +exports.inspectOpts = Object.keys(process.env).filter(function (key) { + return /^debug_/i.test(key); +}).reduce(function (obj, key) { + // camel-case + var prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() }); + + // coerce string value into JS value + var val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) val = true; + else if (/^(no|off|false|disabled)$/i.test(val)) val = false; + else if (val === 'null') val = null; + else val = Number(val); + + obj[prop] = val; + return obj; +}, {}); + +/** + * The file descriptor to write the `debug()` calls to. + * Set the `DEBUG_FD` env variable to override with another value. i.e.: + * + * $ DEBUG_FD=3 node script.js 3>debug.log + */ + +var fd = parseInt(process.env.DEBUG_FD, 10) || 2; + +if (1 !== fd && 2 !== fd) { + util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')() +} + +var stream = 1 === fd ? process.stdout : + 2 === fd ? process.stderr : + createWritableStdioStream(fd); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + return 'colors' in exports.inspectOpts + ? Boolean(exports.inspectOpts.colors) + : tty.isatty(fd); +} + +/** + * Map %o to `util.inspect()`, all on a single line. + */ + +exports.formatters.o = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n').map(function(str) { + return str.trim() + }).join(' '); +}; + +/** + * Map %o to `util.inspect()`, allowing multiple lines if needed. + */ + +exports.formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs(args) { + var name = this.namespace; + var useColors = this.useColors; + + if (useColors) { + var c = this.color; + var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m'; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); + } else { + args[0] = new Date().toUTCString() + + ' ' + name + ' ' + args[0]; + } +} + +/** + * Invokes `util.format()` with the specified arguments and writes to `stream`. + */ + +function log() { + return stream.write(util.format.apply(util, arguments) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + if (null == namespaces) { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } else { + process.env.DEBUG = namespaces; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Copied from `node/src/node.js`. + * + * XXX: It's lame that node doesn't expose this API out-of-the-box. It also + * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. + */ + +function createWritableStdioStream (fd) { + var stream; + var tty_wrap = process.binding('tty_wrap'); + + // Note stream._type is used for test-module-load-list.js + + switch (tty_wrap.guessHandleType(fd)) { + case 'TTY': + stream = new tty.WriteStream(fd); + stream._type = 'tty'; + + // Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + case 'FILE': + var fs = require('fs'); + stream = new fs.SyncWriteStream(fd, { autoClose: false }); + stream._type = 'fs'; + break; + + case 'PIPE': + case 'TCP': + var net = require('net'); + stream = new net.Socket({ + fd: fd, + readable: false, + writable: true + }); + + // FIXME Should probably have an option in net.Socket to create a + // stream from an existing fd which is writable only. But for now + // we'll just add this hack and set the `readable` member to false. + // Test: ./node test/fixtures/echo.js < /etc/passwd + stream.readable = false; + stream.read = null; + stream._type = 'pipe'; + + // FIXME Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + default: + // Probably an error on in uv_guess_handle() + throw new Error('Implement me. Unknown stream file type!'); + } + + // For supporting legacy API we put the FD here. + stream.fd = fd; + + stream._isStdio = true; + + return stream; +} + +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + +function init (debug) { + debug.inspectOpts = {}; + + var keys = Object.keys(exports.inspectOpts); + for (var i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} + +/** + * Enable namespaces listed in `process.env.DEBUG` initially. + */ + +exports.enable(load()); diff --git a/node_modules/eslint-import-resolver-node/node_modules/ms/index.js b/node_modules/eslint-import-resolver-node/node_modules/ms/index.js new file mode 100644 index 000000000..6a522b16b --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/ms/index.js @@ -0,0 +1,152 @@ +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isNaN(val) === false) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtShort(ms) { + if (ms >= d) { + return Math.round(ms / d) + 'd'; + } + if (ms >= h) { + return Math.round(ms / h) + 'h'; + } + if (ms >= m) { + return Math.round(ms / m) + 'm'; + } + if (ms >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtLong(ms) { + return plural(ms, d, 'day') || + plural(ms, h, 'hour') || + plural(ms, m, 'minute') || + plural(ms, s, 'second') || + ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, n, name) { + if (ms < n) { + return; + } + if (ms < n * 1.5) { + return Math.floor(ms / n) + ' ' + name; + } + return Math.ceil(ms / n) + ' ' + name + 's'; +} diff --git a/node_modules/eslint-import-resolver-node/node_modules/ms/license.md b/node_modules/eslint-import-resolver-node/node_modules/ms/license.md new file mode 100644 index 000000000..69b61253a --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/ms/license.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Zeit, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/eslint-import-resolver-node/node_modules/ms/package.json b/node_modules/eslint-import-resolver-node/node_modules/ms/package.json new file mode 100644 index 000000000..63aaff3ab --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/ms/package.json @@ -0,0 +1,37 @@ +{ + "name": "ms", + "version": "2.0.0", + "description": "Tiny milisecond conversion utility", + "repository": "zeit/ms", + "main": "./index", + "files": [ + "index.js" + ], + "scripts": { + "precommit": "lint-staged", + "lint": "eslint lib/* bin/*", + "test": "mocha tests.js" + }, + "eslintConfig": { + "extends": "eslint:recommended", + "env": { + "node": true, + "es6": true + } + }, + "lint-staged": { + "*.js": [ + "npm run lint", + "prettier --single-quote --write", + "git add" + ] + }, + "license": "MIT", + "devDependencies": { + "eslint": "3.19.0", + "expect.js": "0.3.1", + "husky": "0.13.3", + "lint-staged": "3.4.1", + "mocha": "3.4.1" + } +} \ No newline at end of file diff --git a/node_modules/eslint-import-resolver-node/node_modules/ms/readme.md b/node_modules/eslint-import-resolver-node/node_modules/ms/readme.md new file mode 100644 index 000000000..84a9974cc --- /dev/null +++ b/node_modules/eslint-import-resolver-node/node_modules/ms/readme.md @@ -0,0 +1,51 @@ +# ms + +[![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms) +[![Slack Channel](http://zeit-slackin.now.sh/badge.svg)](https://zeit.chat/) + +Use this package to easily convert various time formats to milliseconds. + +## Examples + +```js +ms('2 days') // 172800000 +ms('1d') // 86400000 +ms('10h') // 36000000 +ms('2.5 hrs') // 9000000 +ms('2h') // 7200000 +ms('1m') // 60000 +ms('5s') // 5000 +ms('1y') // 31557600000 +ms('100') // 100 +``` + +### Convert from milliseconds + +```js +ms(60000) // "1m" +ms(2 * 60000) // "2m" +ms(ms('10 hours')) // "10h" +``` + +### Time format written-out + +```js +ms(60000, { long: true }) // "1 minute" +ms(2 * 60000, { long: true }) // "2 minutes" +ms(ms('10 hours'), { long: true }) // "10 hours" +``` + +## Features + +- Works both in [node](https://nodejs.org) and in the browser. +- If a number is supplied to `ms`, a string with a unit is returned. +- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`). +- If you pass a string with a number and a valid unit, the number of equivalent ms is returned. + +## Caught a bug? + +1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device +2. Link the package to the global module directory: `npm link` +3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, node will now use your clone of ms! + +As always, you can run the tests using: `npm test` diff --git a/node_modules/eslint-import-resolver-node/package.json b/node_modules/eslint-import-resolver-node/package.json new file mode 100644 index 000000000..ee08f68cd --- /dev/null +++ b/node_modules/eslint-import-resolver-node/package.json @@ -0,0 +1,47 @@ +{ + "name": "eslint-import-resolver-node", + "version": "0.3.4", + "description": "Node default behavior import resolution plugin for eslint-plugin-import.", + "main": "index.js", + "files": [ + "index.js" + ], + "scripts": { + "prepublishOnly": "cp ../../{LICENSE,.npmrc} ./", + "tests-only": "nyc mocha", + "test": "npm run tests-only", + "coveralls": "nyc report --reporter lcovonly && cd ../.. && coveralls < ./resolvers/node/coverage/lcov.info" + }, + "repository": { + "type": "git", + "url": "https://github.com/benmosher/eslint-plugin-import" + }, + "keywords": [ + "eslint", + "eslintplugin", + "esnext", + "modules", + "eslint-plugin-import" + ], + "author": "Ben Mosher (me@benmosher.com)", + "license": "MIT", + "bugs": { + "url": "https://github.com/benmosher/eslint-plugin-import/issues" + }, + "homepage": "https://github.com/benmosher/eslint-plugin-import", + "dependencies": { + "debug": "^2.6.9", + "resolve": "^1.13.1" + }, + "devDependencies": { + "chai": "^3.5.0", + "coveralls": "^3.0.0", + "mocha": "^3.5.3", + "nyc": "^11.7.1" + }, + "nyc": { + "exclude": [ + "test/" + ] + } +} \ No newline at end of file diff --git a/node_modules/eslint-module-utils/.eslintrc.yml b/node_modules/eslint-module-utils/.eslintrc.yml new file mode 100644 index 000000000..d30c26465 --- /dev/null +++ b/node_modules/eslint-module-utils/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + no-console: 1 diff --git a/node_modules/eslint-module-utils/CHANGELOG.md b/node_modules/eslint-module-utils/CHANGELOG.md new file mode 100644 index 000000000..f337d3850 --- /dev/null +++ b/node_modules/eslint-module-utils/CHANGELOG.md @@ -0,0 +1,103 @@ +# Change Log +All notable changes to this module will be documented in this file. +This project adheres to [Semantic Versioning](http://semver.org/). +This change log adheres to standards from [Keep a CHANGELOG](http://keepachangelog.com). + +## Unreleased + +## v2.6.0 - 2020-03-28 + +### Added +[New] Print more helpful info if parsing fails ([#1671], thanks [@kaiyoma]) + +## v2.5.2 - 2020-01-12 + +### Fixed +- Makes the loader resolution more tolerant ([#1606], thanks [@arcanis]) +- Use `createRequire` instead of `createRequireFromPath` if available ([#1602], thanks [@iamnapo]) + +## v2.5.1 - 2020-01-11 + +### Fixed +- Uses createRequireFromPath to resolve loaders ([#1591], thanks [@arcanis]) +- report the error stack on a resolution error ([#599], thanks [@sompylasar]) + +## v2.5.0 - 2019-12-07 + +### Added +- support `parseForESLint` from custom parser ([#1435], thanks [@JounQin]) + +### Changed + - Avoid superfluous calls and code ([#1551], thanks [@brettz9]) + +## v2.4.1 - 2019-07-19 + +### Fixed + - Improve parse perf when using `@typescript-eslint/parser` ([#1409], thanks [@bradzacher]) + - Improve support for TypeScript declare structures ([#1356], thanks [@christophercurrie]) + +## v2.4.0 - 2019-04-13 + +### Added + - no-useless-path-segments: Add noUselessIndex option ([#1290], thanks [@timkraut]) + +### Fixed + - Fix overwriting of dynamic import() CallExpression ([`no-cycle`], [`no-relative-parent-import`], [`no-unresolved`], [`no-useless-path-segments`]) ([#1218], [#1166], [#1035], thanks [@vikr01]) + + +## v2.3.0 - 2019-01-22 +### Fixed +- use `process.hrtime()` for cache dates ([#1160], thanks [@hulkish]) + +## v2.2.0 - 2018-03-29 +### Changed +- `parse`: attach node locations by default. +- `moduleVisitor`: visitor now gets the full `import` statement node as a second + argument, so rules may report against the full statement / `require` call instead + of only the string literal node. + +## v2.1.1 - 2017-06-22 + +Re-releasing v2.1.0 after vetting (again) and unable to reproduce issue. + + +## v2.1.0 - 2017-06-02 [YANKED] + +Yanked due to critical issue with cache key resulting from #839. + +### Added +- `parse` now additionally passes `filePath` to `parser` in `parserOptions` like `eslint` core does + +## v2.0.0 - 2016-11-07 +### Changed +- `unambiguous` no longer exposes fast test regex + +### Fixed +- `unambiguous.test()` regex is now properly in multiline mode + +[#1671]: https://github.com/benmosher/eslint-plugin-import/pull/1671 +[#1606]: https://github.com/benmosher/eslint-plugin-import/pull/1606 +[#1602]: https://github.com/benmosher/eslint-plugin-import/pull/1602 +[#1591]: https://github.com/benmosher/eslint-plugin-import/pull/1591 +[#1551]: https://github.com/benmosher/eslint-plugin-import/pull/1551 +[#1435]: https://github.com/benmosher/eslint-plugin-import/pull/1435 +[#1409]: https://github.com/benmosher/eslint-plugin-import/pull/1409 +[#1356]: https://github.com/benmosher/eslint-plugin-import/pull/1356 +[#1290]: https://github.com/benmosher/eslint-plugin-import/pull/1290 +[#1218]: https://github.com/benmosher/eslint-plugin-import/pull/1218 +[#1166]: https://github.com/benmosher/eslint-plugin-import/issues/1166 +[#1160]: https://github.com/benmosher/eslint-plugin-import/pull/1160 +[#1035]: https://github.com/benmosher/eslint-plugin-import/issues/1035 +[#599]: https://github.com/benmosher/eslint-plugin-import/pull/599 + +[@hulkish]: https://github.com/hulkish +[@timkraut]: https://github.com/timkraut +[@vikr01]: https://github.com/vikr01 +[@bradzacher]: https://github.com/bradzacher +[@christophercurrie]: https://github.com/christophercurrie +[@brettz9]: https://github.com/brettz9 +[@JounQin]: https://github.com/JounQin +[@arcanis]: https://github.com/arcanis +[@sompylasar]: https://github.com/sompylasar +[@iamnapo]: https://github.com/iamnapo +[@kaiyoma]: https://github.com/kaiyoma diff --git a/node_modules/eslint-module-utils/LICENSE b/node_modules/eslint-module-utils/LICENSE new file mode 100644 index 000000000..c6ade2a43 --- /dev/null +++ b/node_modules/eslint-module-utils/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Ben Mosher + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/eslint-module-utils/ModuleCache.js b/node_modules/eslint-module-utils/ModuleCache.js new file mode 100644 index 000000000..b910a5810 --- /dev/null +++ b/node_modules/eslint-module-utils/ModuleCache.js @@ -0,0 +1,47 @@ +'use strict' +exports.__esModule = true + +const log = require('debug')('eslint-module-utils:ModuleCache') + +class ModuleCache { + constructor(map) { + this.map = map || new Map() + } + + /** + * returns value for returning inline + * @param {[type]} cacheKey [description] + * @param {[type]} result [description] + */ + set(cacheKey, result) { + this.map.set(cacheKey, { result, lastSeen: process.hrtime() }) + log('setting entry for', cacheKey) + return result + } + + get(cacheKey, settings) { + if (this.map.has(cacheKey)) { + const f = this.map.get(cacheKey) + // check freshness + if (process.hrtime(f.lastSeen)[0] < settings.lifetime) return f.result + } else log('cache miss for', cacheKey) + // cache miss + return undefined + } + +} + +ModuleCache.getSettings = function (settings) { + const cacheSettings = Object.assign({ + lifetime: 30, // seconds + }, settings['import/cache']) + + // parse infinity + if (cacheSettings.lifetime === '∞' || cacheSettings.lifetime === 'Infinity') { + cacheSettings.lifetime = Infinity + } + + return cacheSettings +} + +exports.default = ModuleCache diff --git a/node_modules/eslint-module-utils/declaredScope.js b/node_modules/eslint-module-utils/declaredScope.js new file mode 100644 index 000000000..904279ad7 --- /dev/null +++ b/node_modules/eslint-module-utils/declaredScope.js @@ -0,0 +1,14 @@ +'use strict' +exports.__esModule = true + +exports.default = function declaredScope(context, name) { + let references = context.getScope().references + , i + for (i = 0; i < references.length; i++) { + if (references[i].identifier.name === name) { + break + } + } + if (!references[i]) return undefined + return references[i].resolved.scope.type +} diff --git a/node_modules/eslint-module-utils/hash.js b/node_modules/eslint-module-utils/hash.js new file mode 100644 index 000000000..d69dd4df5 --- /dev/null +++ b/node_modules/eslint-module-utils/hash.js @@ -0,0 +1,59 @@ +/** + * utilities for hashing config objects. + * basically iteratively updates hash with a JSON-like format + */ +'use strict' +exports.__esModule = true + +const createHash = require('crypto').createHash + +const stringify = JSON.stringify + +function hashify(value, hash) { + if (!hash) hash = createHash('sha256') + + if (value instanceof Array) { + hashArray(value, hash) + } else if (value instanceof Object) { + hashObject(value, hash) + } else { + hash.update(stringify(value) || 'undefined') + } + + return hash +} +exports.default = hashify + +function hashArray(array, hash) { + if (!hash) hash = createHash('sha256') + + hash.update('[') + for (let i = 0; i < array.length; i++) { + hashify(array[i], hash) + hash.update(',') + } + hash.update(']') + + return hash +} +hashify.array = hashArray +exports.hashArray = hashArray + +function hashObject(object, hash) { + if (!hash) hash = createHash('sha256') + + hash.update('{') + Object.keys(object).sort().forEach(key => { + hash.update(stringify(key)) + hash.update(':') + hashify(object[key], hash) + hash.update(',') + }) + hash.update('}') + + return hash +} +hashify.object = hashObject +exports.hashObject = hashObject + + diff --git a/node_modules/eslint-module-utils/ignore.js b/node_modules/eslint-module-utils/ignore.js new file mode 100644 index 000000000..47af8122d --- /dev/null +++ b/node_modules/eslint-module-utils/ignore.js @@ -0,0 +1,60 @@ +'use strict' +exports.__esModule = true + +const extname = require('path').extname + +const log = require('debug')('eslint-plugin-import:utils:ignore') + +// one-shot memoized +let cachedSet, lastSettings +function validExtensions(context) { + if (cachedSet && context.settings === lastSettings) { + return cachedSet + } + + lastSettings = context.settings + cachedSet = makeValidExtensionSet(context.settings) + return cachedSet +} + +function makeValidExtensionSet(settings) { + // start with explicit JS-parsed extensions + const exts = new Set(settings['import/extensions'] || [ '.js' ]) + + // all alternate parser extensions are also valid + if ('import/parsers' in settings) { + for (let parser in settings['import/parsers']) { + const parserSettings = settings['import/parsers'][parser] + if (!Array.isArray(parserSettings)) { + throw new TypeError('"settings" for ' + parser + ' must be an array') + } + parserSettings.forEach(ext => exts.add(ext)) + } + } + + return exts +} +exports.getFileExtensions = makeValidExtensionSet + +exports.default = function ignore(path, context) { + // check extension whitelist first (cheap) + if (!hasValidExtension(path, context)) return true + + if (!('import/ignore' in context.settings)) return false + const ignoreStrings = context.settings['import/ignore'] + + for (let i = 0; i < ignoreStrings.length; i++) { + const regex = new RegExp(ignoreStrings[i]) + if (regex.test(path)) { + log(`ignoring ${path}, matched pattern /${ignoreStrings[i]}/`) + return true + } + } + + return false +} + +function hasValidExtension(path, context) { + return validExtensions(context).has(extname(path)) +} +exports.hasValidExtension = hasValidExtension diff --git a/node_modules/eslint-module-utils/module-require.js b/node_modules/eslint-module-utils/module-require.js new file mode 100644 index 000000000..689450658 --- /dev/null +++ b/node_modules/eslint-module-utils/module-require.js @@ -0,0 +1,30 @@ +'use strict' +exports.__esModule = true + +const Module = require('module') +const path = require('path') + +// borrowed from babel-eslint +function createModule(filename) { + const mod = new Module(filename) + mod.filename = filename + mod.paths = Module._nodeModulePaths(path.dirname(filename)) + return mod +} + +exports.default = function moduleRequire(p) { + try { + // attempt to get espree relative to eslint + const eslintPath = require.resolve('eslint') + const eslintModule = createModule(eslintPath) + return require(Module._resolveFilename(p, eslintModule)) + } catch(err) { /* ignore */ } + + try { + // try relative to entry point + return require.main.require(p) + } catch(err) { /* ignore */ } + + // finally, try from here + return require(p) +} diff --git a/node_modules/eslint-module-utils/moduleVisitor.js b/node_modules/eslint-module-utils/moduleVisitor.js new file mode 100644 index 000000000..bc8c91b0a --- /dev/null +++ b/node_modules/eslint-module-utils/moduleVisitor.js @@ -0,0 +1,141 @@ +'use strict' +exports.__esModule = true + +/** + * Returns an object of node visitors that will call + * 'visitor' with every discovered module path. + * + * todo: correct function prototype for visitor + * @param {Function(String)} visitor [description] + * @param {[type]} options [description] + * @return {object} + */ +exports.default = function visitModules(visitor, options) { + // if esmodule is not explicitly disabled, it is assumed to be enabled + options = Object.assign({ esmodule: true }, options) + + let ignoreRegExps = [] + if (options.ignore != null) { + ignoreRegExps = options.ignore.map(p => new RegExp(p)) + } + + function checkSourceValue(source, importer) { + if (source == null) return //? + + // handle ignore + if (ignoreRegExps.some(re => re.test(source.value))) return + + // fire visitor + visitor(source, importer) + } + + // for import-y declarations + function checkSource(node) { + checkSourceValue(node.source, node) + } + + // for esmodule dynamic `import()` calls + function checkImportCall(node) { + if (node.callee.type !== 'Import') return + if (node.arguments.length !== 1) return + + const modulePath = node.arguments[0] + if (modulePath.type !== 'Literal') return + if (typeof modulePath.value !== 'string') return + + checkSourceValue(modulePath, node) + } + + // for CommonJS `require` calls + // adapted from @mctep: http://git.io/v4rAu + function checkCommon(call) { + if (call.callee.type !== 'Identifier') return + if (call.callee.name !== 'require') return + if (call.arguments.length !== 1) return + + const modulePath = call.arguments[0] + if (modulePath.type !== 'Literal') return + if (typeof modulePath.value !== 'string') return + + checkSourceValue(modulePath, call) + } + + function checkAMD(call) { + if (call.callee.type !== 'Identifier') return + if (call.callee.name !== 'require' && + call.callee.name !== 'define') return + if (call.arguments.length !== 2) return + + const modules = call.arguments[0] + if (modules.type !== 'ArrayExpression') return + + for (let element of modules.elements) { + if (element.type !== 'Literal') continue + if (typeof element.value !== 'string') continue + + if (element.value === 'require' || + element.value === 'exports') continue // magic modules: http://git.io/vByan + + checkSourceValue(element, element) + } + } + + const visitors = {} + if (options.esmodule) { + Object.assign(visitors, { + 'ImportDeclaration': checkSource, + 'ExportNamedDeclaration': checkSource, + 'ExportAllDeclaration': checkSource, + 'CallExpression': checkImportCall, + }) + } + + if (options.commonjs || options.amd) { + const currentCallExpression = visitors['CallExpression'] + visitors['CallExpression'] = function (call) { + if (currentCallExpression) currentCallExpression(call) + if (options.commonjs) checkCommon(call) + if (options.amd) checkAMD(call) + } + } + + return visitors +} + +/** + * make an options schema for the module visitor, optionally + * adding extra fields. + */ +function makeOptionsSchema(additionalProperties) { + const base = { + 'type': 'object', + 'properties': { + 'commonjs': { 'type': 'boolean' }, + 'amd': { 'type': 'boolean' }, + 'esmodule': { 'type': 'boolean' }, + 'ignore': { + 'type': 'array', + 'minItems': 1, + 'items': { 'type': 'string' }, + 'uniqueItems': true, + }, + }, + 'additionalProperties': false, + } + + if (additionalProperties){ + for (let key in additionalProperties) { + base.properties[key] = additionalProperties[key] + } + } + + return base +} +exports.makeOptionsSchema = makeOptionsSchema + +/** + * json schema object for options parameter. can be used to build + * rule options schema object. + * @type {Object} + */ +exports.optionsSchema = makeOptionsSchema() diff --git a/node_modules/eslint-module-utils/node_modules/debug/.coveralls.yml b/node_modules/eslint-module-utils/node_modules/debug/.coveralls.yml new file mode 100644 index 000000000..20a706858 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/.coveralls.yml @@ -0,0 +1 @@ +repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve diff --git a/node_modules/eslint-module-utils/node_modules/debug/.eslintrc b/node_modules/eslint-module-utils/node_modules/debug/.eslintrc new file mode 100644 index 000000000..8a37ae2c2 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/.eslintrc @@ -0,0 +1,11 @@ +{ + "env": { + "browser": true, + "node": true + }, + "rules": { + "no-console": 0, + "no-empty": [1, { "allowEmptyCatch": true }] + }, + "extends": "eslint:recommended" +} diff --git a/node_modules/eslint-module-utils/node_modules/debug/.npmignore b/node_modules/eslint-module-utils/node_modules/debug/.npmignore new file mode 100644 index 000000000..5f60eecc8 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/.npmignore @@ -0,0 +1,9 @@ +support +test +examples +example +*.sock +dist +yarn.lock +coverage +bower.json diff --git a/node_modules/eslint-module-utils/node_modules/debug/.travis.yml b/node_modules/eslint-module-utils/node_modules/debug/.travis.yml new file mode 100644 index 000000000..6c6090c3b --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/.travis.yml @@ -0,0 +1,14 @@ + +language: node_js +node_js: + - "6" + - "5" + - "4" + +install: + - make node_modules + +script: + - make lint + - make test + - make coveralls diff --git a/node_modules/eslint-module-utils/node_modules/debug/CHANGELOG.md b/node_modules/eslint-module-utils/node_modules/debug/CHANGELOG.md new file mode 100644 index 000000000..eadaa1895 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/CHANGELOG.md @@ -0,0 +1,362 @@ + +2.6.9 / 2017-09-22 +================== + + * remove ReDoS regexp in %o formatter (#504) + +2.6.8 / 2017-05-18 +================== + + * Fix: Check for undefined on browser globals (#462, @marbemac) + +2.6.7 / 2017-05-16 +================== + + * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom) + * Fix: Inline extend function in node implementation (#452, @dougwilson) + * Docs: Fix typo (#455, @msasad) + +2.6.5 / 2017-04-27 +================== + + * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek) + * Misc: clean up browser reference checks (#447, @thebigredgeek) + * Misc: add npm-debug.log to .gitignore (@thebigredgeek) + + +2.6.4 / 2017-04-20 +================== + + * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo) + * Chore: ignore bower.json in npm installations. (#437, @joaovieira) + * Misc: update "ms" to v0.7.3 (@tootallnate) + +2.6.3 / 2017-03-13 +================== + + * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts) + * Docs: Changelog fix (@thebigredgeek) + +2.6.2 / 2017-03-10 +================== + + * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin) + * Docs: Add backers and sponsors from Open Collective (#422, @piamancini) + * Docs: Add Slackin invite badge (@tootallnate) + +2.6.1 / 2017-02-10 +================== + + * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error + * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0) + * Fix: IE8 "Expected identifier" error (#414, @vgoma) + * Fix: Namespaces would not disable once enabled (#409, @musikov) + +2.6.0 / 2016-12-28 +================== + + * Fix: added better null pointer checks for browser useColors (@thebigredgeek) + * Improvement: removed explicit `window.debug` export (#404, @tootallnate) + * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate) + +2.5.2 / 2016-12-25 +================== + + * Fix: reference error on window within webworkers (#393, @KlausTrainer) + * Docs: fixed README typo (#391, @lurch) + * Docs: added notice about v3 api discussion (@thebigredgeek) + +2.5.1 / 2016-12-20 +================== + + * Fix: babel-core compatibility + +2.5.0 / 2016-12-20 +================== + + * Fix: wrong reference in bower file (@thebigredgeek) + * Fix: webworker compatibility (@thebigredgeek) + * Fix: output formatting issue (#388, @kribblo) + * Fix: babel-loader compatibility (#383, @escwald) + * Misc: removed built asset from repo and publications (@thebigredgeek) + * Misc: moved source files to /src (#378, @yamikuronue) + * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue) + * Test: coveralls integration (#378, @yamikuronue) + * Docs: simplified language in the opening paragraph (#373, @yamikuronue) + +2.4.5 / 2016-12-17 +================== + + * Fix: `navigator` undefined in Rhino (#376, @jochenberger) + * Fix: custom log function (#379, @hsiliev) + * Improvement: bit of cleanup + linting fixes (@thebigredgeek) + * Improvement: rm non-maintainted `dist/` dir (#375, @freewil) + * Docs: simplified language in the opening paragraph. (#373, @yamikuronue) + +2.4.4 / 2016-12-14 +================== + + * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts) + +2.4.3 / 2016-12-14 +================== + + * Fix: navigation.userAgent error for react native (#364, @escwald) + +2.4.2 / 2016-12-14 +================== + + * Fix: browser colors (#367, @tootallnate) + * Misc: travis ci integration (@thebigredgeek) + * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek) + +2.4.1 / 2016-12-13 +================== + + * Fix: typo that broke the package (#356) + +2.4.0 / 2016-12-13 +================== + + * Fix: bower.json references unbuilt src entry point (#342, @justmatt) + * Fix: revert "handle regex special characters" (@tootallnate) + * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate) + * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate) + * Improvement: allow colors in workers (#335, @botverse) + * Improvement: use same color for same namespace. (#338, @lchenay) + +2.3.3 / 2016-11-09 +================== + + * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne) + * Fix: Returning `localStorage` saved values (#331, Levi Thomason) + * Improvement: Don't create an empty object when no `process` (Nathan Rajlich) + +2.3.2 / 2016-11-09 +================== + + * Fix: be super-safe in index.js as well (@TooTallNate) + * Fix: should check whether process exists (Tom Newby) + +2.3.1 / 2016-11-09 +================== + + * Fix: Added electron compatibility (#324, @paulcbetts) + * Improvement: Added performance optimizations (@tootallnate) + * Readme: Corrected PowerShell environment variable example (#252, @gimre) + * Misc: Removed yarn lock file from source control (#321, @fengmk2) + +2.3.0 / 2016-11-07 +================== + + * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic) + * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos) + * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15) + * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran) + * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom) + * Package: Update "ms" to 0.7.2 (#315, @DevSide) + * Package: removed superfluous version property from bower.json (#207 @kkirsche) + * Readme: fix USE_COLORS to DEBUG_COLORS + * Readme: Doc fixes for format string sugar (#269, @mlucool) + * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0) + * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable) + * Readme: better docs for browser support (#224, @matthewmueller) + * Tooling: Added yarn integration for development (#317, @thebigredgeek) + * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek) + * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman) + * Misc: Updated contributors (@thebigredgeek) + +2.2.0 / 2015-05-09 +================== + + * package: update "ms" to v0.7.1 (#202, @dougwilson) + * README: add logging to file example (#193, @DanielOchoa) + * README: fixed a typo (#191, @amir-s) + * browser: expose `storage` (#190, @stephenmathieson) + * Makefile: add a `distclean` target (#189, @stephenmathieson) + +2.1.3 / 2015-03-13 +================== + + * Updated stdout/stderr example (#186) + * Updated example/stdout.js to match debug current behaviour + * Renamed example/stderr.js to stdout.js + * Update Readme.md (#184) + * replace high intensity foreground color for bold (#182, #183) + +2.1.2 / 2015-03-01 +================== + + * dist: recompile + * update "ms" to v0.7.0 + * package: update "browserify" to v9.0.3 + * component: fix "ms.js" repo location + * changed bower package name + * updated documentation about using debug in a browser + * fix: security error on safari (#167, #168, @yields) + +2.1.1 / 2014-12-29 +================== + + * browser: use `typeof` to check for `console` existence + * browser: check for `console.log` truthiness (fix IE 8/9) + * browser: add support for Chrome apps + * Readme: added Windows usage remarks + * Add `bower.json` to properly support bower install + +2.1.0 / 2014-10-15 +================== + + * node: implement `DEBUG_FD` env variable support + * package: update "browserify" to v6.1.0 + * package: add "license" field to package.json (#135, @panuhorsmalahti) + +2.0.0 / 2014-09-01 +================== + + * package: update "browserify" to v5.11.0 + * node: use stderr rather than stdout for logging (#29, @stephenmathieson) + +1.0.4 / 2014-07-15 +================== + + * dist: recompile + * example: remove `console.info()` log usage + * example: add "Content-Type" UTF-8 header to browser example + * browser: place %c marker after the space character + * browser: reset the "content" color via `color: inherit` + * browser: add colors support for Firefox >= v31 + * debug: prefer an instance `log()` function over the global one (#119) + * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) + +1.0.3 / 2014-07-09 +================== + + * Add support for multiple wildcards in namespaces (#122, @seegno) + * browser: fix lint + +1.0.2 / 2014-06-10 +================== + + * browser: update color palette (#113, @gscottolson) + * common: make console logging function configurable (#108, @timoxley) + * node: fix %o colors on old node <= 0.8.x + * Makefile: find node path using shell/which (#109, @timoxley) + +1.0.1 / 2014-06-06 +================== + + * browser: use `removeItem()` to clear localStorage + * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) + * package: add "contributors" section + * node: fix comment typo + * README: list authors + +1.0.0 / 2014-06-04 +================== + + * make ms diff be global, not be scope + * debug: ignore empty strings in enable() + * node: make DEBUG_COLORS able to disable coloring + * *: export the `colors` array + * npmignore: don't publish the `dist` dir + * Makefile: refactor to use browserify + * package: add "browserify" as a dev dependency + * Readme: add Web Inspector Colors section + * node: reset terminal color for the debug content + * node: map "%o" to `util.inspect()` + * browser: map "%j" to `JSON.stringify()` + * debug: add custom "formatters" + * debug: use "ms" module for humanizing the diff + * Readme: add "bash" syntax highlighting + * browser: add Firebug color support + * browser: add colors for WebKit browsers + * node: apply log to `console` + * rewrite: abstract common logic for Node & browsers + * add .jshintrc file + +0.8.1 / 2014-04-14 +================== + + * package: re-add the "component" section + +0.8.0 / 2014-03-30 +================== + + * add `enable()` method for nodejs. Closes #27 + * change from stderr to stdout + * remove unnecessary index.js file + +0.7.4 / 2013-11-13 +================== + + * remove "browserify" key from package.json (fixes something in browserify) + +0.7.3 / 2013-10-30 +================== + + * fix: catch localStorage security error when cookies are blocked (Chrome) + * add debug(err) support. Closes #46 + * add .browser prop to package.json. Closes #42 + +0.7.2 / 2013-02-06 +================== + + * fix package.json + * fix: Mobile Safari (private mode) is broken with debug + * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript + +0.7.1 / 2013-02-05 +================== + + * add repository URL to package.json + * add DEBUG_COLORED to force colored output + * add browserify support + * fix component. Closes #24 + +0.7.0 / 2012-05-04 +================== + + * Added .component to package.json + * Added debug.component.js build + +0.6.0 / 2012-03-16 +================== + + * Added support for "-" prefix in DEBUG [Vinay Pulim] + * Added `.enabled` flag to the node version [TooTallNate] + +0.5.0 / 2012-02-02 +================== + + * Added: humanize diffs. Closes #8 + * Added `debug.disable()` to the CS variant + * Removed padding. Closes #10 + * Fixed: persist client-side variant again. Closes #9 + +0.4.0 / 2012-02-01 +================== + + * Added browser variant support for older browsers [TooTallNate] + * Added `debug.enable('project:*')` to browser variant [TooTallNate] + * Added padding to diff (moved it to the right) + +0.3.0 / 2012-01-26 +================== + + * Added millisecond diff when isatty, otherwise UTC string + +0.2.0 / 2012-01-22 +================== + + * Added wildcard support + +0.1.0 / 2011-12-02 +================== + + * Added: remove colors unless stderr isatty [TooTallNate] + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/eslint-module-utils/node_modules/debug/LICENSE b/node_modules/eslint-module-utils/node_modules/debug/LICENSE new file mode 100644 index 000000000..658c933d2 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/LICENSE @@ -0,0 +1,19 @@ +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the 'Software'), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/eslint-module-utils/node_modules/debug/Makefile b/node_modules/eslint-module-utils/node_modules/debug/Makefile new file mode 100644 index 000000000..584da8bf9 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/Makefile @@ -0,0 +1,50 @@ +# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 +THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) + +# BIN directory +BIN := $(THIS_DIR)/node_modules/.bin + +# Path +PATH := node_modules/.bin:$(PATH) +SHELL := /bin/bash + +# applications +NODE ?= $(shell which node) +YARN ?= $(shell which yarn) +PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm)) +BROWSERIFY ?= $(NODE) $(BIN)/browserify + +.FORCE: + +install: node_modules + +node_modules: package.json + @NODE_ENV= $(PKG) install + @touch node_modules + +lint: .FORCE + eslint browser.js debug.js index.js node.js + +test-node: .FORCE + istanbul cover node_modules/mocha/bin/_mocha -- test/**.js + +test-browser: .FORCE + mkdir -p dist + + @$(BROWSERIFY) \ + --standalone debug \ + . > dist/debug.js + + karma start --single-run + rimraf dist + +test: .FORCE + concurrently \ + "make test-node" \ + "make test-browser" + +coveralls: + cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js + +.PHONY: all install clean distclean diff --git a/node_modules/eslint-module-utils/node_modules/debug/README.md b/node_modules/eslint-module-utils/node_modules/debug/README.md new file mode 100644 index 000000000..f67be6b31 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/README.md @@ -0,0 +1,312 @@ +# debug +[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) +[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) + + + +A tiny node.js debugging utility modelled after node core's debugging technique. + +**Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)** + +## Installation + +```bash +$ npm install debug +``` + +## Usage + +`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. + +Example _app.js_: + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %s', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example _worker.js_: + +```js +var debug = require('debug')('worker'); + +setInterval(function(){ + debug('doing some work'); +}, 1000); +``` + + The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: + + ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) + + ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) + +#### Windows note + + On Windows the environment variable is set using the `set` command. + + ```cmd + set DEBUG=*,-not_this + ``` + + Note that PowerShell uses different syntax to set environment variables. + + ```cmd + $env:DEBUG = "*,-not_this" + ``` + +Then, run the program to be debugged as usual. + +## Millisecond diff + + When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) + + When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: + + ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) + +## Conventions + + If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". + +## Wildcards + + The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + + You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". + +## Environment Variables + + When running through Node.js, you can set a few environment variables that will + change the behavior of the debug logging: + +| Name | Purpose | +|-----------|-------------------------------------------------| +| `DEBUG` | Enables/disables specific debugging namespaces. | +| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | +| `DEBUG_DEPTH` | Object inspection depth. | +| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | + + + __Note:__ The environment variables beginning with `DEBUG_` end up being + converted into an Options object that gets used with `%o`/`%O` formatters. + See the Node.js documentation for + [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) + for the complete list. + +## Formatters + + + Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters: + +| Formatter | Representation | +|-----------|----------------| +| `%O` | Pretty-print an Object on multiple lines. | +| `%o` | Pretty-print an Object all on a single line. | +| `%s` | String. | +| `%d` | Number (both integer and float). | +| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | +| `%%` | Single percent sign ('%'). This does not consume an argument. | + +### Custom formatters + + You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like: + +```js +const createDebug = require('debug') +createDebug.formatters.h = (v) => { + return v.toString('hex') +} + +// …elsewhere +const debug = createDebug('foo') +debug('this is hex: %h', new Buffer('hello world')) +// foo this is hex: 68656c6c6f20776f726c6421 +0ms +``` + +## Browser support + You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), + or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), + if you don't want to build it yourself. + + Debug's enable state is currently persisted by `localStorage`. + Consider the situation shown below where you have `worker:a` and `worker:b`, + and wish to debug both. You can enable this using `localStorage.debug`: + +```js +localStorage.debug = 'worker:*' +``` + +And then refresh the page. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + +#### Web Inspector Colors + + Colors are also enabled on "Web Inspectors" that understand the `%c` formatting + option. These are WebKit web inspectors, Firefox ([since version + 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) + and the Firebug plugin for Firefox (any version). + + Colored output looks something like: + + ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) + + +## Output streams + + By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: + +Example _stdout.js_: + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + - Andrew Rhyne + +## Backers + +Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Sponsors + +Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## License + +(The MIT License) + +Copyright (c) 2014-2016 TJ Holowaychuk <tj@vision-media.ca> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/eslint-module-utils/node_modules/debug/component.json b/node_modules/eslint-module-utils/node_modules/debug/component.json new file mode 100644 index 000000000..9de26410f --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/component.json @@ -0,0 +1,19 @@ +{ + "name": "debug", + "repo": "visionmedia/debug", + "description": "small debugging utility", + "version": "2.6.9", + "keywords": [ + "debug", + "log", + "debugger" + ], + "main": "src/browser.js", + "scripts": [ + "src/browser.js", + "src/debug.js" + ], + "dependencies": { + "rauchg/ms.js": "0.7.1" + } +} diff --git a/node_modules/eslint-module-utils/node_modules/debug/karma.conf.js b/node_modules/eslint-module-utils/node_modules/debug/karma.conf.js new file mode 100644 index 000000000..103a82d15 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/karma.conf.js @@ -0,0 +1,70 @@ +// Karma configuration +// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC) + +module.exports = function(config) { + config.set({ + + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: '', + + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['mocha', 'chai', 'sinon'], + + + // list of files / patterns to load in the browser + files: [ + 'dist/debug.js', + 'test/*spec.js' + ], + + + // list of files to exclude + exclude: [ + 'src/node.js' + ], + + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + }, + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ['progress'], + + + // web server port + port: 9876, + + + // enable / disable colors in the output (reporters and logs) + colors: true, + + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: true, + + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: ['PhantomJS'], + + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: false, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: Infinity + }) +} diff --git a/node_modules/eslint-module-utils/node_modules/debug/node.js b/node_modules/eslint-module-utils/node_modules/debug/node.js new file mode 100644 index 000000000..7fc36fe6d --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/node.js @@ -0,0 +1 @@ +module.exports = require('./src/node'); diff --git a/node_modules/eslint-module-utils/node_modules/debug/package.json b/node_modules/eslint-module-utils/node_modules/debug/package.json new file mode 100644 index 000000000..0b1b9df8b --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/package.json @@ -0,0 +1,49 @@ +{ + "name": "debug", + "version": "2.6.9", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "description": "small debugging utility", + "keywords": [ + "debug", + "log", + "debugger" + ], + "author": "TJ Holowaychuk ", + "contributors": [ + "Nathan Rajlich (http://n8.io)", + "Andrew Rhyne " + ], + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + }, + "devDependencies": { + "browserify": "9.0.3", + "chai": "^3.5.0", + "concurrently": "^3.1.0", + "coveralls": "^2.11.15", + "eslint": "^3.12.1", + "istanbul": "^0.4.5", + "karma": "^1.3.0", + "karma-chai": "^0.1.0", + "karma-mocha": "^1.3.0", + "karma-phantomjs-launcher": "^1.0.2", + "karma-sinon": "^1.0.5", + "mocha": "^3.2.0", + "mocha-lcov-reporter": "^1.2.0", + "rimraf": "^2.5.4", + "sinon": "^1.17.6", + "sinon-chai": "^2.8.0" + }, + "main": "./src/index.js", + "browser": "./src/browser.js", + "component": { + "scripts": { + "debug/index.js": "browser.js", + "debug/debug.js": "debug.js" + } + } +} \ No newline at end of file diff --git a/node_modules/eslint-module-utils/node_modules/debug/src/browser.js b/node_modules/eslint-module-utils/node_modules/debug/src/browser.js new file mode 100644 index 000000000..710692493 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/src/browser.js @@ -0,0 +1,185 @@ +/** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = 'undefined' != typeof chrome + && 'undefined' != typeof chrome.storage + ? chrome.storage.local + : localstorage(); + +/** + * Colors. + */ + +exports.colors = [ + 'lightseagreen', + 'forestgreen', + 'goldenrod', + 'dodgerblue', + 'darkorchid', + 'crimson' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { + return true; + } + + // is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +exports.formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (err) { + return '[UnexpectedJSONParseError]: ' + err.message; + } +}; + + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs(args) { + var useColors = this.useColors; + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); + + if (!useColors) return; + + var c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit') + + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); +} + +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + +function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + try { + if (null == namespaces) { + exports.storage.removeItem('debug'); + } else { + exports.storage.debug = namespaces; + } + } catch(e) {} +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + var r; + try { + r = exports.storage.debug; + } catch(e) {} + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; +} + +/** + * Enable namespaces listed in `localStorage.debug` initially. + */ + +exports.enable(load()); + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage() { + try { + return window.localStorage; + } catch (e) {} +} diff --git a/node_modules/eslint-module-utils/node_modules/debug/src/debug.js b/node_modules/eslint-module-utils/node_modules/debug/src/debug.js new file mode 100644 index 000000000..6a5e3fc94 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/src/debug.js @@ -0,0 +1,202 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; +exports.coerce = coerce; +exports.disable = disable; +exports.enable = enable; +exports.enabled = enabled; +exports.humanize = require('ms'); + +/** + * The currently active debug mode names, and names to skip. + */ + +exports.names = []; +exports.skips = []; + +/** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + +exports.formatters = {}; + +/** + * Previous log timestamp. + */ + +var prevTime; + +/** + * Select a color. + * @param {String} namespace + * @return {Number} + * @api private + */ + +function selectColor(namespace) { + var hash = 0, i; + + for (i in namespace) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return exports.colors[Math.abs(hash) % exports.colors.length]; +} + +/** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + +function createDebug(namespace) { + + function debug() { + // disabled? + if (!debug.enabled) return; + + var self = debug; + + // set `diff` timestamp + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // turn the `arguments` into a proper Array + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %O + args.unshift('%O'); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); + + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // apply env-specific formatting (colors, etc.) + exports.formatArgs.call(self, args); + + var logFn = debug.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.enabled = exports.enabled(namespace); + debug.useColors = exports.useColors(); + debug.color = selectColor(namespace); + + // env-specific initialization logic for debug instances + if ('function' === typeof exports.init) { + exports.init(debug); + } + + return debug; +} + +/** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + +function enable(namespaces) { + exports.save(namespaces); + + exports.names = []; + exports.skips = []; + + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; + + for (var i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } +} + +/** + * Disable debug output. + * + * @api public + */ + +function disable() { + exports.enable(''); +} + +/** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + +function enabled(name) { + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; +} + +/** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + +function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; +} diff --git a/node_modules/eslint-module-utils/node_modules/debug/src/index.js b/node_modules/eslint-module-utils/node_modules/debug/src/index.js new file mode 100644 index 000000000..e12cf4d58 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/src/index.js @@ -0,0 +1,10 @@ +/** + * Detect Electron renderer process, which is node, but we should + * treat as a browser. + */ + +if (typeof process !== 'undefined' && process.type === 'renderer') { + module.exports = require('./browser.js'); +} else { + module.exports = require('./node.js'); +} diff --git a/node_modules/eslint-module-utils/node_modules/debug/src/inspector-log.js b/node_modules/eslint-module-utils/node_modules/debug/src/inspector-log.js new file mode 100644 index 000000000..60ea6c04a --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/src/inspector-log.js @@ -0,0 +1,15 @@ +module.exports = inspectorLog; + +// black hole +const nullStream = new (require('stream').Writable)(); +nullStream._write = () => {}; + +/** + * Outputs a `console.log()` to the Node.js Inspector console *only*. + */ +function inspectorLog() { + const stdout = console._stdout; + console._stdout = nullStream; + console.log.apply(console, arguments); + console._stdout = stdout; +} diff --git a/node_modules/eslint-module-utils/node_modules/debug/src/node.js b/node_modules/eslint-module-utils/node_modules/debug/src/node.js new file mode 100644 index 000000000..b15109c90 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/debug/src/node.js @@ -0,0 +1,248 @@ +/** + * Module dependencies. + */ + +var tty = require('tty'); +var util = require('util'); + +/** + * This is the Node.js implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; + +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + +exports.inspectOpts = Object.keys(process.env).filter(function (key) { + return /^debug_/i.test(key); +}).reduce(function (obj, key) { + // camel-case + var prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() }); + + // coerce string value into JS value + var val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) val = true; + else if (/^(no|off|false|disabled)$/i.test(val)) val = false; + else if (val === 'null') val = null; + else val = Number(val); + + obj[prop] = val; + return obj; +}, {}); + +/** + * The file descriptor to write the `debug()` calls to. + * Set the `DEBUG_FD` env variable to override with another value. i.e.: + * + * $ DEBUG_FD=3 node script.js 3>debug.log + */ + +var fd = parseInt(process.env.DEBUG_FD, 10) || 2; + +if (1 !== fd && 2 !== fd) { + util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')() +} + +var stream = 1 === fd ? process.stdout : + 2 === fd ? process.stderr : + createWritableStdioStream(fd); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + return 'colors' in exports.inspectOpts + ? Boolean(exports.inspectOpts.colors) + : tty.isatty(fd); +} + +/** + * Map %o to `util.inspect()`, all on a single line. + */ + +exports.formatters.o = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n').map(function(str) { + return str.trim() + }).join(' '); +}; + +/** + * Map %o to `util.inspect()`, allowing multiple lines if needed. + */ + +exports.formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs(args) { + var name = this.namespace; + var useColors = this.useColors; + + if (useColors) { + var c = this.color; + var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m'; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); + } else { + args[0] = new Date().toUTCString() + + ' ' + name + ' ' + args[0]; + } +} + +/** + * Invokes `util.format()` with the specified arguments and writes to `stream`. + */ + +function log() { + return stream.write(util.format.apply(util, arguments) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + if (null == namespaces) { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } else { + process.env.DEBUG = namespaces; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Copied from `node/src/node.js`. + * + * XXX: It's lame that node doesn't expose this API out-of-the-box. It also + * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. + */ + +function createWritableStdioStream (fd) { + var stream; + var tty_wrap = process.binding('tty_wrap'); + + // Note stream._type is used for test-module-load-list.js + + switch (tty_wrap.guessHandleType(fd)) { + case 'TTY': + stream = new tty.WriteStream(fd); + stream._type = 'tty'; + + // Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + case 'FILE': + var fs = require('fs'); + stream = new fs.SyncWriteStream(fd, { autoClose: false }); + stream._type = 'fs'; + break; + + case 'PIPE': + case 'TCP': + var net = require('net'); + stream = new net.Socket({ + fd: fd, + readable: false, + writable: true + }); + + // FIXME Should probably have an option in net.Socket to create a + // stream from an existing fd which is writable only. But for now + // we'll just add this hack and set the `readable` member to false. + // Test: ./node test/fixtures/echo.js < /etc/passwd + stream.readable = false; + stream.read = null; + stream._type = 'pipe'; + + // FIXME Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + default: + // Probably an error on in uv_guess_handle() + throw new Error('Implement me. Unknown stream file type!'); + } + + // For supporting legacy API we put the FD here. + stream.fd = fd; + + stream._isStdio = true; + + return stream; +} + +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + +function init (debug) { + debug.inspectOpts = {}; + + var keys = Object.keys(exports.inspectOpts); + for (var i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} + +/** + * Enable namespaces listed in `process.env.DEBUG` initially. + */ + +exports.enable(load()); diff --git a/node_modules/eslint-module-utils/node_modules/find-up/index.js b/node_modules/eslint-module-utils/node_modules/find-up/index.js new file mode 100644 index 000000000..939c9553d --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/find-up/index.js @@ -0,0 +1,48 @@ +'use strict'; +const path = require('path'); +const locatePath = require('locate-path'); + +module.exports = (filename, opts) => { + opts = opts || {}; + + const startDir = path.resolve(opts.cwd || ''); + const root = path.parse(startDir).root; + + const filenames = [].concat(filename); + + return new Promise(resolve => { + (function find(dir) { + locatePath(filenames, {cwd: dir}).then(file => { + if (file) { + resolve(path.join(dir, file)); + } else if (dir === root) { + resolve(null); + } else { + find(path.dirname(dir)); + } + }); + })(startDir); + }); +}; + +module.exports.sync = (filename, opts) => { + opts = opts || {}; + + let dir = path.resolve(opts.cwd || ''); + const root = path.parse(dir).root; + + const filenames = [].concat(filename); + + // eslint-disable-next-line no-constant-condition + while (true) { + const file = locatePath.sync(filenames, {cwd: dir}); + + if (file) { + return path.join(dir, file); + } else if (dir === root) { + return null; + } + + dir = path.dirname(dir); + } +}; diff --git a/node_modules/builtin-modules/license b/node_modules/eslint-module-utils/node_modules/find-up/license similarity index 100% rename from node_modules/builtin-modules/license rename to node_modules/eslint-module-utils/node_modules/find-up/license diff --git a/node_modules/eslint-module-utils/node_modules/find-up/package.json b/node_modules/eslint-module-utils/node_modules/find-up/package.json new file mode 100644 index 000000000..7ec1b7ef8 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/find-up/package.json @@ -0,0 +1,53 @@ +{ + "name": "find-up", + "version": "2.1.0", + "description": "Find a file by walking up parent directories", + "license": "MIT", + "repository": "sindresorhus/find-up", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "find", + "up", + "find-up", + "findup", + "look-up", + "look", + "file", + "search", + "match", + "package", + "resolve", + "parent", + "parents", + "folder", + "directory", + "dir", + "walk", + "walking", + "path" + ], + "dependencies": { + "locate-path": "^2.0.0" + }, + "devDependencies": { + "ava": "*", + "tempfile": "^1.1.1", + "xo": "*" + }, + "xo": { + "esnext": true + } +} \ No newline at end of file diff --git a/node_modules/eslint-module-utils/node_modules/find-up/readme.md b/node_modules/eslint-module-utils/node_modules/find-up/readme.md new file mode 100644 index 000000000..b5ad69455 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/find-up/readme.md @@ -0,0 +1,85 @@ +# find-up [![Build Status: Linux and macOS](https://travis-ci.org/sindresorhus/find-up.svg?branch=master)](https://travis-ci.org/sindresorhus/find-up) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/l0cyjmvh5lq72vq2/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/find-up/branch/master) + +> Find a file by walking up parent directories + + +## Install + +``` +$ npm install --save find-up +``` + + +## Usage + +``` +/ +└── Users + └── sindresorhus + ├── unicorn.png + └── foo + └── bar + ├── baz + └── example.js +``` + +```js +// example.js +const findUp = require('find-up'); + +findUp('unicorn.png').then(filepath => { + console.log(filepath); + //=> '/Users/sindresorhus/unicorn.png' +}); + +findUp(['rainbow.png', 'unicorn.png']).then(filepath => { + console.log(filepath); + //=> '/Users/sindresorhus/unicorn.png' +}); +``` + + +## API + +### findUp(filename, [options]) + +Returns a `Promise` for the filepath or `null`. + +### findUp([filenameA, filenameB], [options]) + +Returns a `Promise` for the first filepath found (by respecting the order) or `null`. + +### findUp.sync(filename, [options]) + +Returns a filepath or `null`. + +### findUp.sync([filenameA, filenameB], [options]) + +Returns the first filepath found (by respecting the order) or `null`. + +#### filename + +Type: `string` + +Filename of the file to find. + +#### options + +##### cwd + +Type: `string`
+Default: `process.cwd()` + +Directory to start from. + + +## Related + +- [find-up-cli](https://github.com/sindresorhus/find-up-cli) - CLI for this module +- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file +- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/eslint-module-utils/node_modules/locate-path/index.js b/node_modules/eslint-module-utils/node_modules/locate-path/index.js new file mode 100644 index 000000000..32b108d19 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/locate-path/index.js @@ -0,0 +1,24 @@ +'use strict'; +const path = require('path'); +const pathExists = require('path-exists'); +const pLocate = require('p-locate'); + +module.exports = (iterable, opts) => { + opts = Object.assign({ + cwd: process.cwd() + }, opts); + + return pLocate(iterable, el => pathExists(path.resolve(opts.cwd, el)), opts); +}; + +module.exports.sync = (iterable, opts) => { + opts = Object.assign({ + cwd: process.cwd() + }, opts); + + for (const el of iterable) { + if (pathExists.sync(path.resolve(opts.cwd, el))) { + return el; + } + } +}; diff --git a/node_modules/eslint-module-utils/node_modules/locate-path/license b/node_modules/eslint-module-utils/node_modules/locate-path/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/locate-path/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/eslint-module-utils/node_modules/locate-path/package.json b/node_modules/eslint-module-utils/node_modules/locate-path/package.json new file mode 100644 index 000000000..e05a6304b --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/locate-path/package.json @@ -0,0 +1,47 @@ +{ + "name": "locate-path", + "version": "2.0.0", + "description": "Get the first path that exists on disk of multiple paths", + "license": "MIT", + "repository": "sindresorhus/locate-path", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "locate", + "path", + "paths", + "file", + "files", + "exists", + "find", + "finder", + "search", + "searcher", + "array", + "iterable", + "iterator" + ], + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "xo": { + "esnext": true + } +} \ No newline at end of file diff --git a/node_modules/eslint-module-utils/node_modules/locate-path/readme.md b/node_modules/eslint-module-utils/node_modules/locate-path/readme.md new file mode 100644 index 000000000..f7b337bb2 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/locate-path/readme.md @@ -0,0 +1,99 @@ +# locate-path [![Build Status](https://travis-ci.org/sindresorhus/locate-path.svg?branch=master)](https://travis-ci.org/sindresorhus/locate-path) + +> Get the first path that exists on disk of multiple paths + + +## Install + +``` +$ npm install --save locate-path +``` + + +## Usage + +Here we find the first file that exists on disk, in array order. + +```js +const locatePath = require('locate-path'); + +const files = [ + 'unicorn.png', + 'rainbow.png', // only this one actually exists on disk + 'pony.png' +]; + +locatePath(files).then(foundPath => { + console.log(foundPath); + //=> 'rainbow' +}); +``` + + +## API + +### locatePath(input, [options]) + +Returns a `Promise` for the first path that exists or `undefined` if none exists. + +#### input + +Type: `Iterable` + +Paths to check. + +#### options + +Type: `Object` + +##### concurrency + +Type: `number`
+Default: `Infinity`
+Minimum: `1` + +Number of concurrently pending promises. + +##### preserveOrder + +Type: `boolean`
+Default: `true` + +Preserve `input` order when searching. + +Disable this to improve performance if you don't care about the order. + +##### cwd + +Type: `string`
+Default: `process.cwd()` + +Current working directory. + +### locatePath.sync(input, [options]) + +Returns the first path that exists or `undefined` if none exists. + +#### input + +Type: `Iterable` + +Paths to check. + +#### options + +Type: `Object` + +##### cwd + +Same as above. + + +## Related + +- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/eslint-module-utils/node_modules/ms/index.js b/node_modules/eslint-module-utils/node_modules/ms/index.js new file mode 100644 index 000000000..6a522b16b --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/ms/index.js @@ -0,0 +1,152 @@ +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isNaN(val) === false) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtShort(ms) { + if (ms >= d) { + return Math.round(ms / d) + 'd'; + } + if (ms >= h) { + return Math.round(ms / h) + 'h'; + } + if (ms >= m) { + return Math.round(ms / m) + 'm'; + } + if (ms >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtLong(ms) { + return plural(ms, d, 'day') || + plural(ms, h, 'hour') || + plural(ms, m, 'minute') || + plural(ms, s, 'second') || + ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, n, name) { + if (ms < n) { + return; + } + if (ms < n * 1.5) { + return Math.floor(ms / n) + ' ' + name; + } + return Math.ceil(ms / n) + ' ' + name + 's'; +} diff --git a/node_modules/eslint-module-utils/node_modules/ms/license.md b/node_modules/eslint-module-utils/node_modules/ms/license.md new file mode 100644 index 000000000..69b61253a --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/ms/license.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Zeit, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/eslint-module-utils/node_modules/ms/package.json b/node_modules/eslint-module-utils/node_modules/ms/package.json new file mode 100644 index 000000000..63aaff3ab --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/ms/package.json @@ -0,0 +1,37 @@ +{ + "name": "ms", + "version": "2.0.0", + "description": "Tiny milisecond conversion utility", + "repository": "zeit/ms", + "main": "./index", + "files": [ + "index.js" + ], + "scripts": { + "precommit": "lint-staged", + "lint": "eslint lib/* bin/*", + "test": "mocha tests.js" + }, + "eslintConfig": { + "extends": "eslint:recommended", + "env": { + "node": true, + "es6": true + } + }, + "lint-staged": { + "*.js": [ + "npm run lint", + "prettier --single-quote --write", + "git add" + ] + }, + "license": "MIT", + "devDependencies": { + "eslint": "3.19.0", + "expect.js": "0.3.1", + "husky": "0.13.3", + "lint-staged": "3.4.1", + "mocha": "3.4.1" + } +} \ No newline at end of file diff --git a/node_modules/eslint-module-utils/node_modules/ms/readme.md b/node_modules/eslint-module-utils/node_modules/ms/readme.md new file mode 100644 index 000000000..84a9974cc --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/ms/readme.md @@ -0,0 +1,51 @@ +# ms + +[![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms) +[![Slack Channel](http://zeit-slackin.now.sh/badge.svg)](https://zeit.chat/) + +Use this package to easily convert various time formats to milliseconds. + +## Examples + +```js +ms('2 days') // 172800000 +ms('1d') // 86400000 +ms('10h') // 36000000 +ms('2.5 hrs') // 9000000 +ms('2h') // 7200000 +ms('1m') // 60000 +ms('5s') // 5000 +ms('1y') // 31557600000 +ms('100') // 100 +``` + +### Convert from milliseconds + +```js +ms(60000) // "1m" +ms(2 * 60000) // "2m" +ms(ms('10 hours')) // "10h" +``` + +### Time format written-out + +```js +ms(60000, { long: true }) // "1 minute" +ms(2 * 60000, { long: true }) // "2 minutes" +ms(ms('10 hours'), { long: true }) // "10 hours" +``` + +## Features + +- Works both in [node](https://nodejs.org) and in the browser. +- If a number is supplied to `ms`, a string with a unit is returned. +- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`). +- If you pass a string with a number and a valid unit, the number of equivalent ms is returned. + +## Caught a bug? + +1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device +2. Link the package to the global module directory: `npm link` +3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, node will now use your clone of ms! + +As always, you can run the tests using: `npm test` diff --git a/node_modules/eslint-module-utils/node_modules/p-limit/index.js b/node_modules/eslint-module-utils/node_modules/p-limit/index.js new file mode 100644 index 000000000..873f0e70d --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/p-limit/index.js @@ -0,0 +1,42 @@ +'use strict'; +const pTry = require('p-try'); + +module.exports = concurrency => { + if (concurrency < 1) { + throw new TypeError('Expected `concurrency` to be a number from 1 and up'); + } + + const queue = []; + let activeCount = 0; + + const next = () => { + activeCount--; + + if (queue.length > 0) { + queue.shift()(); + } + }; + + return fn => new Promise((resolve, reject) => { + const run = () => { + activeCount++; + + pTry(fn).then( + val => { + resolve(val); + next(); + }, + err => { + reject(err); + next(); + } + ); + }; + + if (activeCount < concurrency) { + run(); + } else { + queue.push(run); + } + }); +}; diff --git a/node_modules/eslint-module-utils/node_modules/p-limit/license b/node_modules/eslint-module-utils/node_modules/p-limit/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/p-limit/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/eslint-module-utils/node_modules/p-limit/package.json b/node_modules/eslint-module-utils/node_modules/p-limit/package.json new file mode 100644 index 000000000..275cb73ae --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/p-limit/package.json @@ -0,0 +1,49 @@ +{ + "name": "p-limit", + "version": "1.3.0", + "description": "Run multiple promise-returning & async functions with limited concurrency", + "license": "MIT", + "repository": "sindresorhus/p-limit", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "promise", + "limit", + "limited", + "concurrency", + "throttle", + "throat", + "rate", + "batch", + "ratelimit", + "task", + "queue", + "async", + "await", + "promises", + "bluebird" + ], + "dependencies": { + "p-try": "^1.0.0" + }, + "devDependencies": { + "ava": "*", + "delay": "^2.0.0", + "in-range": "^1.0.0", + "random-int": "^1.0.0", + "time-span": "^2.0.0", + "xo": "*" + } +} \ No newline at end of file diff --git a/node_modules/eslint-module-utils/node_modules/p-limit/readme.md b/node_modules/eslint-module-utils/node_modules/p-limit/readme.md new file mode 100644 index 000000000..90129925c --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/p-limit/readme.md @@ -0,0 +1,69 @@ +# p-limit [![Build Status](https://travis-ci.org/sindresorhus/p-limit.svg?branch=master)](https://travis-ci.org/sindresorhus/p-limit) + +> Run multiple promise-returning & async functions with limited concurrency + + +## Install + +``` +$ npm install p-limit +``` + + +## Usage + +```js +const pLimit = require('p-limit'); + +const limit = pLimit(1); + +const input = [ + limit(() => fetchSomething('foo')), + limit(() => fetchSomething('bar')), + limit(() => doSomething()) +]; + +(async () => { + // Only one promise is run at once + const result = await Promise.all(input); + console.log(result); +})(); +``` + + +## API + +### pLimit(concurrency) + +Returns a `limit` function. + +#### concurrency + +Type: `number`
+Minimum: `1` + +Concurrency limit. + +### limit(fn) + +Returns the promise returned by calling `fn`. + +#### fn + +Type: `Function` + +Promise-returning/async function. + + +## Related + +- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control +- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions +- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions +- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency +- [More…](https://github.com/sindresorhus/promise-fun) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/eslint-module-utils/node_modules/p-locate/index.js b/node_modules/eslint-module-utils/node_modules/p-locate/index.js new file mode 100644 index 000000000..7461d665b --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/p-locate/index.js @@ -0,0 +1,31 @@ +'use strict'; +const pLimit = require('p-limit'); + +class EndError extends Error { + constructor(value) { + super(); + this.value = value; + } +} + +// the input can also be a promise, so we `Promise.all()` them both +const finder = el => Promise.all(el).then(val => val[1] === true && Promise.reject(new EndError(val[0]))); + +module.exports = (iterable, tester, opts) => { + opts = Object.assign({ + concurrency: Infinity, + preserveOrder: true + }, opts); + + const limit = pLimit(opts.concurrency); + + // start all the promises concurrently with optional limit + const items = Array.from(iterable).map(el => [el, limit(() => Promise.resolve(el).then(tester))]); + + // check the promises either serially or concurrently + const checkLimit = pLimit(opts.preserveOrder ? 1 : Infinity); + + return Promise.all(items.map(el => checkLimit(() => finder(el)))) + .then(() => {}) + .catch(err => err instanceof EndError ? err.value : Promise.reject(err)); +}; diff --git a/node_modules/eslint-module-utils/node_modules/p-locate/license b/node_modules/eslint-module-utils/node_modules/p-locate/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/p-locate/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/eslint-module-utils/node_modules/p-locate/package.json b/node_modules/eslint-module-utils/node_modules/p-locate/package.json new file mode 100644 index 000000000..b938aa4c5 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/p-locate/package.json @@ -0,0 +1,54 @@ +{ + "name": "p-locate", + "version": "2.0.0", + "description": "Get the first fulfilled promise that satisfies the provided testing function", + "license": "MIT", + "repository": "sindresorhus/p-locate", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "promise", + "locate", + "find", + "finder", + "search", + "searcher", + "test", + "array", + "collection", + "iterable", + "iterator", + "race", + "fulfilled", + "fastest", + "async", + "await", + "promises", + "bluebird" + ], + "dependencies": { + "p-limit": "^1.1.0" + }, + "devDependencies": { + "ava": "*", + "delay": "^1.3.1", + "in-range": "^1.0.0", + "time-span": "^1.0.0", + "xo": "*" + }, + "xo": { + "esnext": true + } +} \ No newline at end of file diff --git a/node_modules/eslint-module-utils/node_modules/p-locate/readme.md b/node_modules/eslint-module-utils/node_modules/p-locate/readme.md new file mode 100644 index 000000000..68b96a47e --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/p-locate/readme.md @@ -0,0 +1,86 @@ +# p-locate [![Build Status](https://travis-ci.org/sindresorhus/p-locate.svg?branch=master)](https://travis-ci.org/sindresorhus/p-locate) + +> Get the first fulfilled promise that satisfies the provided testing function + +Think of it like an async version of [`Array#find`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find). + + +## Install + +``` +$ npm install --save p-locate +``` + + +## Usage + +Here we find the first file that exists on disk, in array order. + +```js +const pathExists = require('path-exists'); +const pLocate = require('p-locate'); + +const files = [ + 'unicorn.png', + 'rainbow.png', // only this one actually exists on disk + 'pony.png' +]; + +pLocate(files, file => pathExists(file)).then(foundPath => { + console.log(foundPath); + //=> 'rainbow' +}); +``` + +*The above is just an example. Use [`locate-path`](https://github.com/sindresorhus/locate-path) if you need this.* + + +## API + +### pLocate(input, tester, [options]) + +Returns a `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`. + +#### input + +Type: `Iterable` + +#### tester(element) + +Type: `Function` + +Expected to return a `Promise` or boolean. + +#### options + +Type: `Object` + +##### concurrency + +Type: `number`
+Default: `Infinity`
+Minimum: `1` + +Number of concurrently pending promises returned by `tester`. + +##### preserveOrder + +Type: `boolean`
+Default: `true` + +Preserve `input` order when searching. + +Disable this to improve performance if you don't care about the order. + + +## Related + +- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently +- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently +- [p-any](https://github.com/sindresorhus/p-any) - Wait for any promise to be fulfilled +- [More…](https://github.com/sindresorhus/promise-fun) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/eslint-module-utils/node_modules/p-try/index.js b/node_modules/eslint-module-utils/node_modules/p-try/index.js new file mode 100644 index 000000000..efa2f7433 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/p-try/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = cb => new Promise(resolve => { + resolve(cb()); +}); diff --git a/node_modules/eslint-module-utils/node_modules/p-try/license b/node_modules/eslint-module-utils/node_modules/p-try/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/p-try/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/eslint-module-utils/node_modules/p-try/package.json b/node_modules/eslint-module-utils/node_modules/p-try/package.json new file mode 100644 index 000000000..a4623262b --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/p-try/package.json @@ -0,0 +1,43 @@ +{ + "name": "p-try", + "version": "1.0.0", + "description": "`Promise#try()` ponyfill - Starts a promise chain", + "license": "MIT", + "repository": "sindresorhus/p-try", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "promise", + "try", + "resolve", + "function", + "catch", + "async", + "await", + "promises", + "settled", + "ponyfill", + "polyfill", + "shim", + "bluebird" + ], + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "xo": { + "esnext": true + } +} \ No newline at end of file diff --git a/node_modules/eslint-module-utils/node_modules/p-try/readme.md b/node_modules/eslint-module-utils/node_modules/p-try/readme.md new file mode 100644 index 000000000..8e5fdddbe --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/p-try/readme.md @@ -0,0 +1,38 @@ +# p-try [![Build Status](https://travis-ci.org/sindresorhus/p-try.svg?branch=master)](https://travis-ci.org/sindresorhus/p-try) + +> [`Promise#try()`](https://github.com/ljharb/proposal-promise-try) [ponyfill](https://ponyfill.com) - Starts a promise chain + +[How is it useful?](http://cryto.net/~joepie91/blog/2016/05/11/what-is-promise-try-and-why-does-it-matter/) + + +## Install + +``` +$ npm install --save p-try +``` + + +## Usage + +```js +const pTry = require('p-try'); + +pTry(() => { + return synchronousFunctionThatMightThrow(); +}).then(value => { + console.log(value); +}).catch(error => { + console.error(error); +}); +``` + + +## Related + +- [p-finally](https://github.com/sindresorhus/p-finally) - `Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome +- [More…](https://github.com/sindresorhus/promise-fun) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/eslint-module-utils/node_modules/path-exists/index.js b/node_modules/eslint-module-utils/node_modules/path-exists/index.js new file mode 100644 index 000000000..16ae60acb --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/path-exists/index.js @@ -0,0 +1,17 @@ +'use strict'; +const fs = require('fs'); + +module.exports = fp => new Promise(resolve => { + fs.access(fp, err => { + resolve(!err); + }); +}); + +module.exports.sync = fp => { + try { + fs.accessSync(fp); + return true; + } catch (err) { + return false; + } +}; diff --git a/node_modules/eslint-module-utils/node_modules/path-exists/license b/node_modules/eslint-module-utils/node_modules/path-exists/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/path-exists/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/eslint-module-utils/node_modules/path-exists/package.json b/node_modules/eslint-module-utils/node_modules/path-exists/package.json new file mode 100644 index 000000000..ed507545d --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/path-exists/package.json @@ -0,0 +1,40 @@ +{ + "name": "path-exists", + "version": "3.0.0", + "description": "Check if a path exists", + "license": "MIT", + "repository": "sindresorhus/path-exists", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "path", + "exists", + "exist", + "file", + "filepath", + "fs", + "filesystem", + "file-system", + "access", + "stat" + ], + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "xo": { + "esnext": true + } +} \ No newline at end of file diff --git a/node_modules/eslint-module-utils/node_modules/path-exists/readme.md b/node_modules/eslint-module-utils/node_modules/path-exists/readme.md new file mode 100644 index 000000000..1b65fa705 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/path-exists/readme.md @@ -0,0 +1,50 @@ +# path-exists [![Build Status](https://travis-ci.org/sindresorhus/path-exists.svg?branch=master)](https://travis-ci.org/sindresorhus/path-exists) + +> Check if a path exists + +Because [`fs.exists()`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback) is being [deprecated](https://github.com/iojs/io.js/issues/103), but there's still a genuine use-case of being able to check if a path exists for other purposes than doing IO with it. + +Never use this before handling a file though: + +> In particular, checking if a file exists before opening it is an anti-pattern that leaves you vulnerable to race conditions: another process may remove the file between the calls to `fs.exists()` and `fs.open()`. Just open the file and handle the error when it's not there. + + +## Install + +``` +$ npm install --save path-exists +``` + + +## Usage + +```js +// foo.js +const pathExists = require('path-exists'); + +pathExists('foo.js').then(exists => { + console.log(exists); + //=> true +}); +``` + + +## API + +### pathExists(path) + +Returns a promise for a boolean of whether the path exists. + +### pathExists.sync(path) + +Returns a boolean of whether the path exists. + + +## Related + +- [path-exists-cli](https://github.com/sindresorhus/path-exists-cli) - CLI for this module + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/eslint-module-utils/node_modules/pkg-dir/index.js b/node_modules/eslint-module-utils/node_modules/pkg-dir/index.js new file mode 100644 index 000000000..f2fa20110 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/pkg-dir/index.js @@ -0,0 +1,10 @@ +'use strict'; +const path = require('path'); +const findUp = require('find-up'); + +module.exports = cwd => findUp('package.json', {cwd}).then(fp => fp ? path.dirname(fp) : null); + +module.exports.sync = cwd => { + const fp = findUp.sync('package.json', {cwd}); + return fp ? path.dirname(fp) : null; +}; diff --git a/node_modules/eslint-module-utils/node_modules/pkg-dir/license b/node_modules/eslint-module-utils/node_modules/pkg-dir/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/pkg-dir/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/eslint-module-utils/node_modules/pkg-dir/package.json b/node_modules/eslint-module-utils/node_modules/pkg-dir/package.json new file mode 100644 index 000000000..267b3ae01 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/pkg-dir/package.json @@ -0,0 +1,53 @@ +{ + "name": "pkg-dir", + "version": "2.0.0", + "description": "Find the root directory of a Node.js project or npm package", + "license": "MIT", + "repository": "sindresorhus/pkg-dir", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "package", + "json", + "root", + "npm", + "entry", + "find", + "up", + "find-up", + "findup", + "look-up", + "look", + "file", + "search", + "match", + "resolve", + "parent", + "parents", + "folder", + "directory", + "dir", + "walk", + "walking", + "path" + ], + "dependencies": { + "find-up": "^2.1.0" + }, + "devDependencies": { + "ava": "*", + "xo": "*" + } +} \ No newline at end of file diff --git a/node_modules/eslint-module-utils/node_modules/pkg-dir/readme.md b/node_modules/eslint-module-utils/node_modules/pkg-dir/readme.md new file mode 100644 index 000000000..3cab12ef0 --- /dev/null +++ b/node_modules/eslint-module-utils/node_modules/pkg-dir/readme.md @@ -0,0 +1,64 @@ +# pkg-dir [![Build Status](https://travis-ci.org/sindresorhus/pkg-dir.svg?branch=master)](https://travis-ci.org/sindresorhus/pkg-dir) + +> Find the root directory of a Node.js project or npm package + + +## Install + +``` +$ npm install --save pkg-dir +``` + + +## Usage + +``` +/ +└── Users + └── sindresorhus + └── foo + ├── package.json + └── bar + ├── baz + └── example.js +``` + +```js +// example.js +const pkgDir = require('pkg-dir'); + +pkgDir(__dirname).then(rootDir => { + console.log(rootDir); + //=> '/Users/sindresorhus/foo' +}); +``` + + +## API + +### pkgDir([cwd]) + +Returns a `Promise` for either the project root path or `null` if it couldn't be found. + +### pkgDir.sync([cwd]) + +Returns the project root path or `null`. + +#### cwd + +Type: `string`
+Default: `process.cwd()` + +Directory to start from. + + +## Related + +- [pkg-dir-cli](https://github.com/sindresorhus/pkg-dir-cli) - CLI for this module +- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file +- [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/eslint-module-utils/package.json b/node_modules/eslint-module-utils/package.json new file mode 100644 index 000000000..f311b235a --- /dev/null +++ b/node_modules/eslint-module-utils/package.json @@ -0,0 +1,32 @@ +{ + "name": "eslint-module-utils", + "version": "2.6.0", + "description": "Core utilities to support eslint-plugin-import and other module-related plugins.", + "engines": { + "node": ">=4" + }, + "scripts": { + "prepublishOnly": "cp ../{LICENSE,.npmrc} ./", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/benmosher/eslint-plugin-import.git" + }, + "keywords": [ + "eslint-plugin-import", + "eslint", + "modules", + "esmodules" + ], + "author": "Ben Mosher ", + "license": "MIT", + "bugs": { + "url": "https://github.com/benmosher/eslint-plugin-import/issues" + }, + "homepage": "https://github.com/benmosher/eslint-plugin-import#readme", + "dependencies": { + "debug": "^2.6.9", + "pkg-dir": "^2.0.0" + } +} \ No newline at end of file diff --git a/node_modules/eslint-module-utils/parse.js b/node_modules/eslint-module-utils/parse.js new file mode 100644 index 000000000..b3a469221 --- /dev/null +++ b/node_modules/eslint-module-utils/parse.js @@ -0,0 +1,82 @@ +'use strict' +exports.__esModule = true + +const moduleRequire = require('./module-require').default +const extname = require('path').extname + +const log = require('debug')('eslint-plugin-import:parse') + +exports.default = function parse(path, content, context) { + + if (context == null) throw new Error('need context to parse properly') + + let parserOptions = context.parserOptions + const parserPath = getParserPath(path, context) + + if (!parserPath) throw new Error('parserPath is required!') + + // hack: espree blows up with frozen options + parserOptions = Object.assign({}, parserOptions) + parserOptions.ecmaFeatures = Object.assign({}, parserOptions.ecmaFeatures) + + // always include comments and tokens (for doc parsing) + parserOptions.comment = true + parserOptions.attachComment = true // keeping this for backward-compat with older parsers + parserOptions.tokens = true + + // attach node locations + parserOptions.loc = true + parserOptions.range = true + + // provide the `filePath` like eslint itself does, in `parserOptions` + // https://github.com/eslint/eslint/blob/3ec436ee/lib/linter.js#L637 + parserOptions.filePath = path + + // @typescript-eslint/parser will parse the entire project with typechecking if you provide + // "project" or "projects" in parserOptions. Removing these options means the parser will + // only parse one file in isolate mode, which is much, much faster. + // https://github.com/benmosher/eslint-plugin-import/issues/1408#issuecomment-509298962 + delete parserOptions.project + delete parserOptions.projects + + // require the parser relative to the main module (i.e., ESLint) + const parser = moduleRequire(parserPath) + + if (typeof parser.parseForESLint === 'function') { + let ast + try { + ast = parser.parseForESLint(content, parserOptions).ast + } catch (e) { + console.warn() + console.warn('Error while parsing ' + parserOptions.filePath) + console.warn('Line ' + e.lineNumber + ', column ' + e.column + ': ' + e.message) + } + if (!ast || typeof ast !== 'object') { + console.warn( + '`parseForESLint` from parser `' + + parserPath + + '` is invalid and will just be ignored' + ) + } else { + return ast + } + } + + return parser.parse(content, parserOptions) +} + +function getParserPath(path, context) { + const parsers = context.settings['import/parsers'] + if (parsers != null) { + const extension = extname(path) + for (let parserPath in parsers) { + if (parsers[parserPath].indexOf(extension) > -1) { + // use this alternate parser + log('using alt parser:', parserPath) + return parserPath + } + } + } + // default to use ESLint parser + return context.parserPath +} diff --git a/node_modules/eslint-module-utils/resolve.js b/node_modules/eslint-module-utils/resolve.js new file mode 100644 index 000000000..3138194a9 --- /dev/null +++ b/node_modules/eslint-module-utils/resolve.js @@ -0,0 +1,241 @@ +'use strict' +exports.__esModule = true + +const pkgDir = require('pkg-dir') + +const fs = require('fs') +const Module = require('module') +const path = require('path') + +const hashObject = require('./hash').hashObject + , ModuleCache = require('./ModuleCache').default + +const CASE_SENSITIVE_FS = !fs.existsSync(path.join(__dirname, 'reSOLVE.js')) +exports.CASE_SENSITIVE_FS = CASE_SENSITIVE_FS + +const ERROR_NAME = 'EslintPluginImportResolveError' + +const fileExistsCache = new ModuleCache() + +// Polyfill Node's `Module.createRequireFromPath` if not present (added in Node v10.12.0) +// Use `Module.createRequire` if available (added in Node v12.2.0) +const createRequire = Module.createRequire || Module.createRequireFromPath || function (filename) { + const mod = new Module(filename, null) + mod.filename = filename + mod.paths = Module._nodeModulePaths(path.dirname(filename)) + + mod._compile(`module.exports = require;`, filename) + + return mod.exports +} + +function tryRequire(target, sourceFile) { + let resolved + try { + // Check if the target exists + if (sourceFile != null) { + try { + resolved = createRequire(path.resolve(sourceFile)).resolve(target) + } catch (e) { + resolved = require.resolve(target) + } + } else { + resolved = require.resolve(target) + } + } catch(e) { + // If the target does not exist then just return undefined + return undefined + } + + // If the target exists then return the loaded module + return require(resolved) +} + +// http://stackoverflow.com/a/27382838 +exports.fileExistsWithCaseSync = function fileExistsWithCaseSync(filepath, cacheSettings) { + // don't care if the FS is case-sensitive + if (CASE_SENSITIVE_FS) return true + + // null means it resolved to a builtin + if (filepath === null) return true + if (filepath.toLowerCase() === process.cwd().toLowerCase()) return true + const parsedPath = path.parse(filepath) + , dir = parsedPath.dir + + let result = fileExistsCache.get(filepath, cacheSettings) + if (result != null) return result + + // base case + if (dir === '' || parsedPath.root === filepath) { + result = true + } else { + const filenames = fs.readdirSync(dir) + if (filenames.indexOf(parsedPath.base) === -1) { + result = false + } else { + result = fileExistsWithCaseSync(dir, cacheSettings) + } + } + fileExistsCache.set(filepath, result) + return result +} + +function relative(modulePath, sourceFile, settings) { + return fullResolve(modulePath, sourceFile, settings).path +} + +function fullResolve(modulePath, sourceFile, settings) { + // check if this is a bonus core module + const coreSet = new Set(settings['import/core-modules']) + if (coreSet.has(modulePath)) return { found: true, path: null } + + const sourceDir = path.dirname(sourceFile) + , cacheKey = sourceDir + hashObject(settings).digest('hex') + modulePath + + const cacheSettings = ModuleCache.getSettings(settings) + + const cachedPath = fileExistsCache.get(cacheKey, cacheSettings) + if (cachedPath !== undefined) return { found: true, path: cachedPath } + + function cache(resolvedPath) { + fileExistsCache.set(cacheKey, resolvedPath) + } + + function withResolver(resolver, config) { + + function v1() { + try { + const resolved = resolver.resolveImport(modulePath, sourceFile, config) + if (resolved === undefined) return { found: false } + return { found: true, path: resolved } + } catch (err) { + return { found: false } + } + } + + function v2() { + return resolver.resolve(modulePath, sourceFile, config) + } + + switch (resolver.interfaceVersion) { + case 2: + return v2() + + default: + case 1: + return v1() + } + } + + const configResolvers = (settings['import/resolver'] + || { 'node': settings['import/resolve'] }) // backward compatibility + + const resolvers = resolverReducer(configResolvers, new Map()) + + for (let pair of resolvers) { + let name = pair[0] + , config = pair[1] + const resolver = requireResolver(name, sourceFile) + , resolved = withResolver(resolver, config) + + if (!resolved.found) continue + + // else, counts + cache(resolved.path) + return resolved + } + + // failed + // cache(undefined) + return { found: false } +} +exports.relative = relative + +function resolverReducer(resolvers, map) { + if (resolvers instanceof Array) { + resolvers.forEach(r => resolverReducer(r, map)) + return map + } + + if (typeof resolvers === 'string') { + map.set(resolvers, null) + return map + } + + if (typeof resolvers === 'object') { + for (let key in resolvers) { + map.set(key, resolvers[key]) + } + return map + } + + const err = new Error('invalid resolver config') + err.name = ERROR_NAME + throw err +} + +function getBaseDir(sourceFile) { + return pkgDir.sync(sourceFile) || process.cwd() +} +function requireResolver(name, sourceFile) { + // Try to resolve package with conventional name + let resolver = tryRequire(`eslint-import-resolver-${name}`, sourceFile) || + tryRequire(name, sourceFile) || + tryRequire(path.resolve(getBaseDir(sourceFile), name)) + + if (!resolver) { + const err = new Error(`unable to load resolver "${name}".`) + err.name = ERROR_NAME + throw err + } + if (!isResolverValid(resolver)) { + const err = new Error(`${name} with invalid interface loaded as resolver`) + err.name = ERROR_NAME + throw err + } + + return resolver +} + +function isResolverValid(resolver) { + if (resolver.interfaceVersion === 2) { + return resolver.resolve && typeof resolver.resolve === 'function' + } else { + return resolver.resolveImport && typeof resolver.resolveImport === 'function' + } +} + +const erroredContexts = new Set() + +/** + * Given + * @param {string} p - module path + * @param {object} context - ESLint context + * @return {string} - the full module filesystem path; + * null if package is core; + * undefined if not found + */ +function resolve(p, context) { + try { + return relative( p + , context.getFilename() + , context.settings + ) + } catch (err) { + if (!erroredContexts.has(context)) { + // The `err.stack` string starts with `err.name` followed by colon and `err.message`. + // We're filtering out the default `err.name` because it adds little value to the message. + let errMessage = err.message + if (err.name !== ERROR_NAME && err.stack) { + errMessage = err.stack.replace(/^Error: /, '') + } + context.report({ + message: `Resolve error: ${errMessage}`, + loc: { line: 1, column: 0 }, + }) + erroredContexts.add(context) + } + } +} +resolve.relative = relative +exports.default = resolve diff --git a/node_modules/eslint-module-utils/unambiguous.js b/node_modules/eslint-module-utils/unambiguous.js new file mode 100644 index 000000000..1dae1d616 --- /dev/null +++ b/node_modules/eslint-module-utils/unambiguous.js @@ -0,0 +1,30 @@ +'use strict' +exports.__esModule = true + + +const pattern = /(^|;)\s*(export|import)((\s+\w)|(\s*[{*=]))/m +/** + * detect possible imports/exports without a full parse. + * + * A negative test means that a file is definitely _not_ a module. + * A positive test means it _could_ be. + * + * Not perfect, just a fast way to disqualify large non-ES6 modules and + * avoid a parse. + * @type {RegExp} + */ +exports.test = function isMaybeUnambiguousModule(content) { + return pattern.test(content) +} + +// future-/Babel-proof at the expense of being a little loose +const unambiguousNodeType = /^(?:(?:Exp|Imp)ort.*Declaration|TSExportAssignment)$/ + +/** + * Given an AST, return true if the AST unambiguously represents a module. + * @param {Program node} ast + * @return {Boolean} + */ +exports.isModule = function isUnambiguousModule(ast) { + return ast.body.some(node => unambiguousNodeType.test(node.type)) +} diff --git a/node_modules/eslint-plugin-eslint-comments/LICENSE b/node_modules/eslint-plugin-eslint-comments/LICENSE new file mode 100644 index 000000000..19def00a8 --- /dev/null +++ b/node_modules/eslint-plugin-eslint-comments/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Toru Nagashima + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/eslint-plugin-eslint-comments/README.md b/node_modules/eslint-plugin-eslint-comments/README.md new file mode 100644 index 000000000..db6799947 --- /dev/null +++ b/node_modules/eslint-plugin-eslint-comments/README.md @@ -0,0 +1,36 @@ +# eslint-plugin-eslint-comments + +[![npm version](https://img.shields.io/npm/v/eslint-plugin-eslint-comments.svg)](https://www.npmjs.com/package/eslint-plugin-eslint-comments) +[![Downloads/month](https://img.shields.io/npm/dm/eslint-plugin-eslint-comments.svg)](http://www.npmtrends.com/eslint-plugin-eslint-comments) +[![Build Status](https://github.com/mysticatea/eslint-plugin-eslint-comments/workflows/CI/badge.svg)](https://github.com/mysticatea/eslint-plugin-eslint-comments/actions) +[![codecov](https://codecov.io/gh/mysticatea/eslint-plugin-eslint-comments/branch/master/graph/badge.svg)](https://codecov.io/gh/mysticatea/eslint-plugin-eslint-comments) +[![Dependency Status](https://david-dm.org/mysticatea/eslint-plugin-eslint-comments.svg)](https://david-dm.org/mysticatea/eslint-plugin-eslint-comments) + +Additional ESLint rules for ESLint directive comments (e.g. `//eslint-disable-line`). + +## 📖 Usage + +- [Documentation](https://mysticatea.github.io/eslint-plugin-eslint-comments) + +## 🚥 Semantic Versioning Policy + +`eslint-plugin-eslint-comments` follows [semantic versioning](http://semver.org/) and [ESLint's Semantic Versioning Policy](https://github.com/eslint/eslint#semantic-versioning-policy). + +## 📰 Changelog + +- [GitHub Releases](https://github.com/mysticatea/eslint-plugin-eslint-comments/releases) + +## 🍻 Contributing + +Welcome contributing! + +Please use GitHub's Issues/PRs. + +### Development Tools + +- `npm test` runs tests and measures coverage. +- `npm run build` updates `README.md`, `index.js`, and the header of all rule's documents. +- `npm run clean` removes the coverage of the last `npm test` command. +- `npm run coverage` shows the coverage of the last `npm test` command. +- `npm run lint` runs ESLint for this codebase. +- `npm run watch` runs tests and measures coverage when source code are changed. diff --git a/node_modules/eslint-plugin-eslint-comments/index.js b/node_modules/eslint-plugin-eslint-comments/index.js new file mode 100644 index 000000000..5ace35b12 --- /dev/null +++ b/node_modules/eslint-plugin-eslint-comments/index.js @@ -0,0 +1,8 @@ +/** DON'T EDIT THIS FILE WHICH WAS CREATED BY 'scripts/generate-index.js'. */ +"use strict" + +module.exports = { + configs: require("./lib/configs"), + rules: require("./lib/rules"), + utils: require("./lib/utils"), +} diff --git a/node_modules/eslint-plugin-eslint-comments/lib/configs.js b/node_modules/eslint-plugin-eslint-comments/lib/configs.js new file mode 100644 index 000000000..4a330b415 --- /dev/null +++ b/node_modules/eslint-plugin-eslint-comments/lib/configs.js @@ -0,0 +1,6 @@ +/** DON'T EDIT THIS FILE; was created by scripts. */ +"use strict" + +module.exports = { + recommended: require("./configs/recommended"), +} diff --git a/node_modules/eslint-plugin-eslint-comments/lib/configs/recommended.js b/node_modules/eslint-plugin-eslint-comments/lib/configs/recommended.js new file mode 100644 index 000000000..7eeb0c144 --- /dev/null +++ b/node_modules/eslint-plugin-eslint-comments/lib/configs/recommended.js @@ -0,0 +1,13 @@ +/** DON'T EDIT THIS FILE; was created by scripts. */ +"use strict" + +module.exports = { + plugins: ["eslint-comments"], + rules: { + "eslint-comments/disable-enable-pair": "error", + "eslint-comments/no-aggregating-enable": "error", + "eslint-comments/no-duplicate-disable": "error", + "eslint-comments/no-unlimited-disable": "error", + "eslint-comments/no-unused-enable": "error", + }, +} diff --git a/node_modules/eslint-plugin-eslint-comments/lib/internal/disabled-area.js b/node_modules/eslint-plugin-eslint-comments/lib/internal/disabled-area.js new file mode 100644 index 000000000..bad87a8d8 --- /dev/null +++ b/node_modules/eslint-plugin-eslint-comments/lib/internal/disabled-area.js @@ -0,0 +1,211 @@ +/** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ +"use strict" + +const utils = require("./utils") +const DELIMITER = /[\s,]+/gu +const pool = new WeakMap() + +module.exports = class DisabledArea { + /** + * Get singleton instance for the given source code. + * + * @param {eslint.SourceCode} sourceCode - The source code to get. + * @returns {DisabledArea} The singleton object for the source code. + */ + static get(sourceCode) { + let retv = pool.get(sourceCode.ast) + + if (retv == null) { + retv = new DisabledArea() + retv._scan(sourceCode) + pool.set(sourceCode.ast, retv) + } + + return retv + } + + /** + * Constructor. + */ + constructor() { + this.areas = [] + this.duplicateDisableDirectives = [] + this.unusedEnableDirectives = [] + this.numberOfRelatedDisableDirectives = new Map() + } + + /** + * Make disabled area. + * + * @param {Token} comment - The comment token to disable. + * @param {object} location - The start location to disable. + * @param {string[]|null} ruleIds - The ruleId names to disable. + * @param {string} kind - The kind of disable-comments. + * @returns {void} + * @private + */ + _disable(comment, location, ruleIds, kind) { + if (ruleIds) { + for (const ruleId of ruleIds) { + if (this._getArea(ruleId, location) != null) { + this.duplicateDisableDirectives.push({ comment, ruleId }) + } + + this.areas.push({ + comment, + ruleId, + kind, + start: location, + end: null, + }) + } + } else { + if (this._getArea(null, location) != null) { + this.duplicateDisableDirectives.push({ comment, ruleId: null }) + } + + this.areas.push({ + comment, + ruleId: null, + kind, + start: location, + end: null, + }) + } + } + + /** + * Close disabled area. + * + * @param {Token} comment - The comment token to enable. + * @param {object} location - The start location to enable. + * @param {string[]|null} ruleIds - The ruleId names to enable. + * @param {string} kind - The kind of disable-comments. + * @returns {void} + * @private + */ + _enable(comment, location, ruleIds, kind) { + const relatedDisableDirectives = new Set() + + if (ruleIds) { + for (const ruleId of ruleIds) { + let used = false + + for (let i = this.areas.length - 1; i >= 0; --i) { + const area = this.areas[i] + + if ( + area.end === null && + area.kind === kind && + area.ruleId === ruleId + ) { + relatedDisableDirectives.add(area.comment) + area.end = location + used = true + } + } + + if (!used) { + this.unusedEnableDirectives.push({ comment, ruleId }) + } + } + } else { + let used = false + + for (let i = this.areas.length - 1; i >= 0; --i) { + const area = this.areas[i] + + if (area.end === null && area.kind === kind) { + relatedDisableDirectives.add(area.comment) + area.end = location + used = true + } + } + + if (!used) { + this.unusedEnableDirectives.push({ comment, ruleId: null }) + } + } + + this.numberOfRelatedDisableDirectives.set( + comment, + relatedDisableDirectives.size + ) + } + + /** + * Gets the area of the given ruleId and location. + * + * @param {string|null} ruleId - The ruleId name to get. + * @param {object} location - The location to get. + * @returns {object|null} The area of the given ruleId and location. + * @private + */ + _getArea(ruleId, location) { + for (let i = this.areas.length - 1; i >= 0; --i) { + const area = this.areas[i] + + if ( + (area.ruleId === null || area.ruleId === ruleId) && + utils.lte(area.start, location) && + (area.end === null || utils.lte(location, area.end)) + ) { + return area + } + } + + return null + } + + /** + * Scan the source code and setup disabled area list. + * + * @param {eslint.SourceCode} sourceCode - The source code to scan. + * @returns {void} + * @private + */ + _scan(sourceCode) { + for (const comment of sourceCode.getAllComments()) { + const directiveComment = utils.parseDirectiveComment(comment) + if (directiveComment == null) { + continue + } + + const kind = directiveComment.kind + if ( + kind !== "eslint-disable" && + kind !== "eslint-enable" && + kind !== "eslint-disable-line" && + kind !== "eslint-disable-next-line" + ) { + continue + } + const ruleIds = directiveComment.value + ? directiveComment.value.split(DELIMITER) + : null + + if (kind === "eslint-disable") { + this._disable(comment, comment.loc.start, ruleIds, "block") + } else if (kind === "eslint-enable") { + this._enable(comment, comment.loc.start, ruleIds, "block") + } else if (kind === "eslint-disable-line") { + const line = comment.loc.start.line + const start = { line, column: 0 } + const end = { line: line + 1, column: -1 } + + this._disable(comment, start, ruleIds, "line") + this._enable(comment, end, ruleIds, "line") + } else if (kind === "eslint-disable-next-line") { + const line = comment.loc.start.line + const start = { line: line + 1, column: 0 } + const end = { line: line + 2, column: -1 } + + this._disable(comment, start, ruleIds, "line") + this._enable(comment, end, ruleIds, "line") + } + } + } +} diff --git a/node_modules/eslint-plugin-eslint-comments/lib/internal/get-linters.js b/node_modules/eslint-plugin-eslint-comments/lib/internal/get-linters.js new file mode 100644 index 000000000..2482662a6 --- /dev/null +++ b/node_modules/eslint-plugin-eslint-comments/lib/internal/get-linters.js @@ -0,0 +1,33 @@ +/** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ +"use strict" + +const path = require("path") +const needle = `${path.sep}node_modules${path.sep}eslint${path.sep}` + +module.exports = () => { + const eslintPaths = new Set( + Object.keys(require.cache) + .filter(id => id.includes(needle)) + .map(id => id.slice(0, id.indexOf(needle) + needle.length)) + ) + const linters = [] + + for (const eslintPath of eslintPaths) { + try { + const linter = require(eslintPath).Linter + + if (linter) { + linters.push(linter) + } + } catch (error) { + if (error.code !== "MODULE_NOT_FOUND") { + throw error + } + } + } + + return linters +} diff --git a/node_modules/eslint-plugin-eslint-comments/lib/internal/utils.js b/node_modules/eslint-plugin-eslint-comments/lib/internal/utils.js new file mode 100644 index 000000000..849bb0472 --- /dev/null +++ b/node_modules/eslint-plugin-eslint-comments/lib/internal/utils.js @@ -0,0 +1,152 @@ +/** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ +"use strict" + +const escapeStringRegexp = require("escape-string-regexp") +const LINE_PATTERN = /[^\r\n\u2028\u2029]*(?:\r\n|[\r\n\u2028\u2029]|$)/gu + +const DIRECTIVE_PATTERN = /^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u +const LINE_COMMENT_PATTERN = /^eslint-disable-(next-)?line$/u + +module.exports = { + /** + * Make the location ignoring `eslint-disable` comments. + * + * @param {object} location - The location to convert. + * @returns {object} Converted location. + */ + toForceLocation(location) { + return { + start: { + line: location.start.line, + column: -1, + }, + end: location.end, + } + }, + + /** + * Calculate the location of the given rule in the given comment token. + * + * @param {Token} comment - The comment token to calculate. + * @param {string|null} ruleId - The rule name to calculate. + * @returns {object} The location of the given information. + */ + toRuleIdLocation(comment, ruleId) { + if (ruleId == null) { + return module.exports.toForceLocation(comment.loc) + } + + const lines = comment.value.match(LINE_PATTERN) + //eslint-disable-next-line require-unicode-regexp + const ruleIdPattern = new RegExp( + `([\\s,]|^)${escapeStringRegexp(ruleId)}(?:[\\s,]|$)` + ) + + { + const m = ruleIdPattern.exec(lines[0]) + if (m != null) { + const start = comment.loc.start + return { + start: { + line: start.line, + column: 2 + start.column + m.index + m[1].length, + }, + end: { + line: start.line, + column: + 2 + + start.column + + m.index + + m[1].length + + ruleId.length, + }, + } + } + } + + for (let i = 1; i < lines.length; ++i) { + const m = ruleIdPattern.exec(lines[i]) + if (m != null) { + const start = comment.loc.start + return { + start: { + line: start.line + i, + column: m.index + m[1].length, + }, + end: { + line: start.line + i, + column: m.index + m[1].length + ruleId.length, + }, + } + } + } + + /*istanbul ignore next : foolproof */ + return comment.loc + }, + + /** + * Checks `a` is less than `b` or `a` equals `b`. + * + * @param {{line: number, column: number}} a - A location to compare. + * @param {{line: number, column: number}} b - Another location to compare. + * @returns {boolean} `true` if `a` is less than `b` or `a` equals `b`. + */ + lte(a, b) { + return a.line < b.line || (a.line === b.line && a.column <= b.column) + }, + + /** + * Parse the given comment token as a directive comment. + * + * @param {Token} comment - The comment token to parse. + * @returns {{kind: string, value: string, description: string | null}|null} The parsed data of the given comment. If `null`, it is not a directive comment. + */ + parseDirectiveComment(comment) { + const { text, description } = divideDirectiveComment(comment.value) + const match = DIRECTIVE_PATTERN.exec(text) + + if (!match) { + return null + } + const directiveText = match[1] + const lineCommentSupported = LINE_COMMENT_PATTERN.test(directiveText) + + if (comment.type === "Line" && !lineCommentSupported) { + return null + } + + if ( + lineCommentSupported && + comment.loc.start.line !== comment.loc.end.line + ) { + // disable-line comment should not span multiple lines. + return null + } + + const directiveValue = text.slice(match.index + directiveText.length) + + return { + kind: directiveText, + value: directiveValue.trim(), + description, + } + }, +} + +/** + * Divides and trims description text and directive comments. + * @param {string} value The comment text to strip. + * @returns {{text: string, description: string | null}} The stripped text. + */ +function divideDirectiveComment(value) { + const divided = value.split(/\s-{2,}\s/u) + const text = divided[0].trim() + return { + text, + description: divided.length > 1 ? divided[1].trim() : null, + } +} diff --git a/node_modules/eslint-plugin-eslint-comments/lib/rules.js b/node_modules/eslint-plugin-eslint-comments/lib/rules.js new file mode 100644 index 000000000..c91b9f5b9 --- /dev/null +++ b/node_modules/eslint-plugin-eslint-comments/lib/rules.js @@ -0,0 +1,14 @@ +/** DON'T EDIT THIS FILE; was created by scripts. */ +"use strict" + +module.exports = { + "disable-enable-pair": require("./rules/disable-enable-pair"), + "no-aggregating-enable": require("./rules/no-aggregating-enable"), + "no-duplicate-disable": require("./rules/no-duplicate-disable"), + "no-restricted-disable": require("./rules/no-restricted-disable"), + "no-unlimited-disable": require("./rules/no-unlimited-disable"), + "no-unused-disable": require("./rules/no-unused-disable"), + "no-unused-enable": require("./rules/no-unused-enable"), + "no-use": require("./rules/no-use"), + "require-description": require("./rules/require-description"), +} diff --git a/node_modules/eslint-plugin-eslint-comments/lib/rules/disable-enable-pair.js b/node_modules/eslint-plugin-eslint-comments/lib/rules/disable-enable-pair.js new file mode 100644 index 000000000..3f800cbb9 --- /dev/null +++ b/node_modules/eslint-plugin-eslint-comments/lib/rules/disable-enable-pair.js @@ -0,0 +1,69 @@ +/** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ +"use strict" + +const DisabledArea = require("../internal/disabled-area") +const utils = require("../internal/utils") + +module.exports = { + meta: { + docs: { + description: + "require a `eslint-enable` comment for every `eslint-disable` comment", + category: "Best Practices", + recommended: true, + url: + "https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/disable-enable-pair.html", + }, + fixable: null, + schema: [ + { + type: "object", + properties: { + allowWholeFile: { + type: "boolean", + }, + }, + additionalProperties: false, + }, + ], + type: "suggestion", + }, + + create(context) { + const allowWholeFile = + context.options[0] && context.options[0].allowWholeFile + const sourceCode = context.getSourceCode() + const disabledArea = DisabledArea.get(sourceCode) + + return { + Program(node) { + if (allowWholeFile && node.body.length === 0) { + return + } + + for (const area of disabledArea.areas) { + if (area.end != null) { + continue + } + if ( + allowWholeFile && + utils.lte(area.start, node.loc.start) + ) { + continue + } + + context.report({ + loc: utils.toRuleIdLocation(area.comment, area.ruleId), + message: area.ruleId + ? "Requires 'eslint-enable' directive for '{{ruleId}}'." + : "Requires 'eslint-enable' directive.", + data: area, + }) + } + }, + } + }, +} diff --git a/node_modules/eslint-plugin-eslint-comments/lib/rules/no-aggregating-enable.js b/node_modules/eslint-plugin-eslint-comments/lib/rules/no-aggregating-enable.js new file mode 100644 index 000000000..529e23587 --- /dev/null +++ b/node_modules/eslint-plugin-eslint-comments/lib/rules/no-aggregating-enable.js @@ -0,0 +1,47 @@ +/** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ +"use strict" + +const DisabledArea = require("../internal/disabled-area") +const utils = require("../internal/utils") + +module.exports = { + meta: { + docs: { + description: + "disallow a `eslint-enable` comment for multiple `eslint-disable` comments", + category: "Best Practices", + recommended: true, + url: + "https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-aggregating-enable.html", + }, + fixable: null, + schema: [], + type: "suggestion", + }, + + create(context) { + const sourceCode = context.getSourceCode() + const disabledArea = DisabledArea.get(sourceCode) + + return { + Program() { + for (const entry of disabledArea.numberOfRelatedDisableDirectives) { + const comment = entry[0] + const count = entry[1] + + if (count >= 2) { + context.report({ + loc: utils.toForceLocation(comment.loc), + message: + "This `eslint-enable` comment affects {{count}} `eslint-disable` comments. An `eslint-enable` comment should be for an `eslint-disable` comment.", + data: { count }, + }) + } + } + }, + } + }, +} diff --git a/node_modules/eslint-plugin-eslint-comments/lib/rules/no-duplicate-disable.js b/node_modules/eslint-plugin-eslint-comments/lib/rules/no-duplicate-disable.js new file mode 100644 index 000000000..5435b182e --- /dev/null +++ b/node_modules/eslint-plugin-eslint-comments/lib/rules/no-duplicate-disable.js @@ -0,0 +1,42 @@ +/** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ +"use strict" + +const DisabledArea = require("../internal/disabled-area") +const utils = require("../internal/utils") + +module.exports = { + meta: { + docs: { + description: "disallow duplicate `eslint-disable` comments", + category: "Best Practices", + recommended: true, + url: + "https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-duplicate-disable.html", + }, + fixable: null, + schema: [], + type: "problem", + }, + + create(context) { + const sourceCode = context.getSourceCode() + const disabledArea = DisabledArea.get(sourceCode) + + return { + Program() { + for (const item of disabledArea.duplicateDisableDirectives) { + context.report({ + loc: utils.toRuleIdLocation(item.comment, item.ruleId), + message: item.ruleId + ? "'{{ruleId}}' rule has been disabled already." + : "ESLint rules have been disabled already.", + data: item, + }) + } + }, + } + }, +} diff --git a/node_modules/eslint-plugin-eslint-comments/lib/rules/no-restricted-disable.js b/node_modules/eslint-plugin-eslint-comments/lib/rules/no-restricted-disable.js new file mode 100644 index 000000000..e11957586 --- /dev/null +++ b/node_modules/eslint-plugin-eslint-comments/lib/rules/no-restricted-disable.js @@ -0,0 +1,62 @@ +/** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ +"use strict" + +const ignore = require("ignore") +const DisabledArea = require("../internal/disabled-area") +const utils = require("../internal/utils") + +module.exports = { + meta: { + docs: { + description: + "disallow `eslint-disable` comments about specific rules", + category: "Stylistic Issues", + recommended: false, + url: + "https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-restricted-disable.html", + }, + fixable: null, + schema: { + type: "array", + items: { type: "string" }, + uniqueItems: true, + }, + type: "suggestion", + }, + + create(context) { + const sourceCode = context.getSourceCode() + const disabledArea = DisabledArea.get(sourceCode) + + if (context.options.length === 0) { + return {} + } + + const ig = ignore() + for (const pattern of context.options) { + ig.add(pattern) + } + + return { + Program() { + for (const area of disabledArea.areas) { + if (area.ruleId == null || ig.ignores(area.ruleId)) { + context.report({ + loc: utils.toRuleIdLocation( + area.comment, + area.ruleId + ), + message: "Disabling '{{ruleId}}' is not allowed.", + data: { + ruleId: area.ruleId || String(context.options), + }, + }) + } + } + }, + } + }, +} diff --git a/node_modules/eslint-plugin-eslint-comments/lib/rules/no-unlimited-disable.js b/node_modules/eslint-plugin-eslint-comments/lib/rules/no-unlimited-disable.js new file mode 100644 index 000000000..6c7683eb5 --- /dev/null +++ b/node_modules/eslint-plugin-eslint-comments/lib/rules/no-unlimited-disable.js @@ -0,0 +1,57 @@ +/** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ +"use strict" + +const utils = require("../internal/utils") + +module.exports = { + meta: { + docs: { + description: + "disallow `eslint-disable` comments without rule names", + category: "Best Practices", + recommended: true, + url: + "https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-unlimited-disable.html", + }, + fixable: null, + schema: [], + type: "suggestion", + }, + + create(context) { + const sourceCode = context.getSourceCode() + + return { + Program() { + for (const comment of sourceCode.getAllComments()) { + const directiveComment = utils.parseDirectiveComment( + comment + ) + if (directiveComment == null) { + continue + } + + const kind = directiveComment.kind + if ( + kind !== "eslint-disable" && + kind !== "eslint-disable-line" && + kind !== "eslint-disable-next-line" + ) { + continue + } + if (!directiveComment.value) { + context.report({ + loc: utils.toForceLocation(comment.loc), + message: + "Unexpected unlimited '{{kind}}' comment. Specify some rule names to disable.", + data: { kind: directiveComment.kind }, + }) + } + } + }, + } + }, +} diff --git a/node_modules/eslint-plugin-eslint-comments/lib/rules/no-unused-disable.js b/node_modules/eslint-plugin-eslint-comments/lib/rules/no-unused-disable.js new file mode 100644 index 000000000..84dabd7bc --- /dev/null +++ b/node_modules/eslint-plugin-eslint-comments/lib/rules/no-unused-disable.js @@ -0,0 +1,34 @@ +/** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ +"use strict" + +// Patch `Linter#verify` to work. +require("../utils/patch")() + +module.exports = { + meta: { + docs: { + description: "disallow unused `eslint-disable` comments", + category: "Best Practices", + recommended: false, + url: + "https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-unused-disable.html", + }, + fixable: null, + schema: [], + type: "problem", + }, + + create() { + // This rule patches `Linter#verify` method and: + // + // 1. enables `reportUnusedDisableDirectives` option. + // 2. verifies the code. + // 3. converts `reportUnusedDisableDirectives` errors to `no-unused-disable` errors. + // + // So this rule itself does nothing. + return {} + }, +} diff --git a/node_modules/eslint-plugin-eslint-comments/lib/rules/no-unused-enable.js b/node_modules/eslint-plugin-eslint-comments/lib/rules/no-unused-enable.js new file mode 100644 index 000000000..94e9c49df --- /dev/null +++ b/node_modules/eslint-plugin-eslint-comments/lib/rules/no-unused-enable.js @@ -0,0 +1,42 @@ +/** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ +"use strict" + +const DisabledArea = require("../internal/disabled-area") +const utils = require("../internal/utils") + +module.exports = { + meta: { + docs: { + description: "disallow unused `eslint-enable` comments", + category: "Best Practices", + recommended: true, + url: + "https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-unused-enable.html", + }, + fixable: null, + schema: [], + type: "problem", + }, + + create(context) { + const sourceCode = context.getSourceCode() + const disabledArea = DisabledArea.get(sourceCode) + + return { + Program() { + for (const item of disabledArea.unusedEnableDirectives) { + context.report({ + loc: utils.toRuleIdLocation(item.comment, item.ruleId), + message: item.ruleId + ? "'{{ruleId}}' rule is re-enabled but it has not been disabled." + : "ESLint rules are re-enabled but those have not been disabled.", + data: item, + }) + } + }, + } + }, +} diff --git a/node_modules/eslint-plugin-eslint-comments/lib/rules/no-use.js b/node_modules/eslint-plugin-eslint-comments/lib/rules/no-use.js new file mode 100644 index 000000000..cf9c1d962 --- /dev/null +++ b/node_modules/eslint-plugin-eslint-comments/lib/rules/no-use.js @@ -0,0 +1,74 @@ +/** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ +"use strict" + +const utils = require("../internal/utils") + +module.exports = { + meta: { + docs: { + description: "disallow ESLint directive-comments", + category: "Stylistic Issues", + recommended: false, + url: + "https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-use.html", + }, + fixable: null, + schema: [ + { + type: "object", + properties: { + allow: { + type: "array", + items: { + enum: [ + "eslint", + "eslint-disable", + "eslint-disable-line", + "eslint-disable-next-line", + "eslint-enable", + "eslint-env", + "exported", + "global", + "globals", + ], + }, + additionalItems: false, + uniqueItems: true, + }, + }, + additionalProperties: false, + }, + ], + type: "suggestion", + }, + + create(context) { + const sourceCode = context.getSourceCode() + const allowed = new Set( + (context.options[0] && context.options[0].allow) || [] + ) + + return { + Program() { + for (const comment of sourceCode.getAllComments()) { + const directiveComment = utils.parseDirectiveComment( + comment + ) + if (directiveComment == null) { + continue + } + + if (!allowed.has(directiveComment.kind)) { + context.report({ + loc: utils.toForceLocation(comment.loc), + message: "Unexpected ESLint directive comment.", + }) + } + } + }, + } + }, +} diff --git a/node_modules/eslint-plugin-eslint-comments/lib/rules/require-description.js b/node_modules/eslint-plugin-eslint-comments/lib/rules/require-description.js new file mode 100644 index 000000000..3a03c6e73 --- /dev/null +++ b/node_modules/eslint-plugin-eslint-comments/lib/rules/require-description.js @@ -0,0 +1,78 @@ +/** + * @author Yosuke Ota + * See LICENSE file in root directory for full license. + */ +"use strict" + +const utils = require("../internal/utils") + +module.exports = { + meta: { + docs: { + description: + "require include descriptions in ESLint directive-comments", + category: "Stylistic Issues", + recommended: false, + url: + "https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/require-description.html", + }, + fixable: null, + schema: [ + { + type: "object", + properties: { + ignore: { + type: "array", + items: { + enum: [ + "eslint", + "eslint-disable", + "eslint-disable-line", + "eslint-disable-next-line", + "eslint-enable", + "eslint-env", + "exported", + "global", + "globals", + ], + }, + additionalItems: false, + uniqueItems: true, + }, + }, + additionalProperties: false, + }, + ], + type: "suggestion", + }, + + create(context) { + const sourceCode = context.getSourceCode() + const ignores = new Set( + (context.options[0] && context.options[0].ignore) || [] + ) + + return { + Program() { + for (const comment of sourceCode.getAllComments()) { + const directiveComment = utils.parseDirectiveComment( + comment + ) + if (directiveComment == null) { + continue + } + if (ignores.has(directiveComment.kind)) { + continue + } + if (!directiveComment.description) { + context.report({ + loc: utils.toForceLocation(comment.loc), + message: + "Unexpected undescribed directive comment. Include descriptions to explain why the comment is necessary.", + }) + } + } + }, + } + }, +} diff --git a/node_modules/eslint-plugin-eslint-comments/lib/utils.js b/node_modules/eslint-plugin-eslint-comments/lib/utils.js new file mode 100644 index 000000000..ec0f993b8 --- /dev/null +++ b/node_modules/eslint-plugin-eslint-comments/lib/utils.js @@ -0,0 +1,6 @@ +/** DON'T EDIT THIS FILE; was created by scripts. */ +"use strict" + +module.exports = { + patch: require("./utils/patch"), +} diff --git a/node_modules/eslint-plugin-eslint-comments/lib/utils/patch.js b/node_modules/eslint-plugin-eslint-comments/lib/utils/patch.js new file mode 100644 index 000000000..fe2519460 --- /dev/null +++ b/node_modules/eslint-plugin-eslint-comments/lib/utils/patch.js @@ -0,0 +1,201 @@ +/** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ +"use strict" + +const getLinters = require("../internal/get-linters") +const { toRuleIdLocation } = require("../internal/utils") +const quotedName = /'(.+?)'/u + +/** + * Get the severity of a given rule. + * @param {object} config The config object to check. + * @param {string} ruleId The rule ID to check. + * @returns {number} The severity of the rule. + */ +function getSeverity(config, ruleId) { + const rules = config && config.rules + const ruleOptions = rules && rules[ruleId] + const severity = Array.isArray(ruleOptions) ? ruleOptions[0] : ruleOptions + + switch (severity) { + case 2: + case "error": + return 2 + + case 1: + case "warn": + return 1 + + default: + return 0 + } +} + +/** + * Get the comment which is at a given message location. + * @param {Message} message The message to get. + * @param {SourceCode|undefined} sourceCode The source code object to get. + * @returns {Comment|undefined} The gotten comment. + */ +function getCommentAt(message, sourceCode) { + if (sourceCode != null) { + const loc = { line: message.line, column: message.column - 1 } + const index = sourceCode.getIndexFromLoc(loc) + const options = { includeComments: true } + const comment = sourceCode.getTokenByRangeStart(index, options) + if ( + comment != null && + (comment.type === "Line" || comment.type === "Block") + ) { + return comment + } + } + return undefined +} + +/** + * Check whether a given message is a `reportUnusedDisableDirectives` error. + * @param {Message} message The message. + * @returns {boolean} `true` if the message is a `reportUnusedDisableDirectives` error. + */ +function isUnusedDisableDirectiveError(message) { + return ( + !message.fatal && + !message.ruleId && + message.message.includes("eslint-disable") + ) +} + +/** + * Create `eslint-comments/no-unused-disable` error. + * @param {string} ruleId The ruleId. + * @param {number} severity The severity of the rule. + * @param {Message} message The original message. + * @param {Comment|undefined} comment The directive comment. + * @returns {Message} The created error. + */ +function createNoUnusedDisableError(ruleId, severity, message, comment) { + const clone = Object.assign({}, message) + const match = quotedName.exec(message.message) + const targetRuleId = match && match[1] + + clone.ruleId = ruleId + clone.severity = severity + clone.message = targetRuleId + ? `'${targetRuleId}' rule is disabled but never reported.` + : "ESLint rules are disabled but never reported." + clone.suggestions = [] + + if (comment != null) { + if (targetRuleId) { + const loc = toRuleIdLocation(comment, targetRuleId) + clone.line = loc.start.line + clone.column = loc.start.column + 1 + clone.endLine = loc.end.line + clone.endColumn = loc.end.column + 1 + } else { + clone.endLine = comment.loc.end.line + clone.endColumn = comment.loc.end.column + 1 + } + // Remove the whole node if it is the only rule, otherwise + // don't try to fix because it is quite complicated. + if (!comment.value.includes(",") && !comment.value.includes("--")) { + // We can't use the typical `fixer` helper because we are injecting + // this message after the fixes are resolved. + clone.suggestions = [ + { + desc: "Remove `eslint-disable` comment.", + fix: { + range: comment.range, + text: comment.value.includes("\n") ? "\n" : "", + }, + }, + ] + } + } + + return clone +} + +/** + * Convert `reportUnusedDisableDirectives` errors to `eslint-comments/no-unused-disable` errors. + * @param {Message[]} messages The original messages. + * @param {SourceCode|undefined} sourceCode The source code object. + * @param {string} ruleId The rule ID to convert. + * @param {number} severity The severity of the rule. + * @param {boolean} keepAsIs The flag to keep original errors as is. + * @returns {Message[]} The converted messages. + */ +function convert(messages, sourceCode, ruleId, severity, keepAsIs) { + for (let i = messages.length - 1; i >= 0; --i) { + const message = messages[i] + if (!isUnusedDisableDirectiveError(message)) { + continue + } + + const newMessage = createNoUnusedDisableError( + ruleId, + severity, + message, + getCommentAt(message, sourceCode) + ) + + if (keepAsIs) { + messages.splice(i + 1, 0, newMessage) + } else { + messages.splice(i, 1, newMessage) + } + } + + return messages +} + +module.exports = (ruleId = "eslint-comments/no-unused-disable") => { + for (const Linter of getLinters()) { + const verify0 = Linter.prototype._verifyWithoutProcessors + Object.defineProperty(Linter.prototype, "_verifyWithoutProcessors", { + value: function _verifyWithoutProcessors( + textOrSourceCode, + config, + filenameOrOptions + ) { + const severity = getSeverity(config, ruleId) + if (severity === 0) { + return verify0.call( + this, + textOrSourceCode, + config, + filenameOrOptions + ) + } + + const options = + typeof filenameOrOptions === "string" + ? { filename: filenameOrOptions } + : filenameOrOptions || {} + const reportUnusedDisableDirectives = Boolean( + options.reportUnusedDisableDirectives + ) + const messages = verify0.call( + this, + textOrSourceCode, + config, + Object.assign({}, options, { + reportUnusedDisableDirectives: true, + }) + ) + return convert( + messages, + this.getSourceCode(), + ruleId, + severity, + reportUnusedDisableDirectives + ) + }, + configurable: true, + writable: true, + }) + } +} diff --git a/node_modules/eslint-plugin-eslint-comments/package.json b/node_modules/eslint-plugin-eslint-comments/package.json new file mode 100644 index 000000000..cbae8dda3 --- /dev/null +++ b/node_modules/eslint-plugin-eslint-comments/package.json @@ -0,0 +1,83 @@ +{ + "name": "eslint-plugin-eslint-comments", + "version": "3.2.0", + "description": "Additional ESLint rules for ESLint directive comments.", + "engines": { + "node": ">=6.5.0" + }, + "main": "index.js", + "files": [ + "lib" + ], + "peerDependencies": { + "eslint": ">=4.19.1" + }, + "dependencies": { + "escape-string-regexp": "^1.0.5", + "ignore": "^5.0.5" + }, + "devDependencies": { + "@mysticatea/eslint-plugin": "^13.0.0", + "@types/node": "^14.0.1", + "@vuepress/plugin-pwa": "^1.0.1", + "babel-eslint": "^10.0.1", + "codecov": "^3.3.0", + "cross-spawn": "^6.0.5", + "eslint": "^7.0.0", + "eslint4b": "^7.0.0", + "fs-extra": "^8.0.1", + "mocha": "^6.1.4", + "nyc": "^14.1.1", + "opener": "^1.4.3", + "rimraf": "^2.6.2", + "semver": "^7.3.2", + "string-replace-loader": "^2.1.1", + "vue-eslint-editor": "^1.1.0", + "vuepress": "^1.0.1" + }, + "scripts": { + "preversion": "npm test", + "version": "node scripts/update && git add .", + "postversion": "git push && git push --tags", + "clean": "rimraf .nyc_output coverage docs/.vuepress/dist", + "docs:build": "vuepress build docs", + "docs:watch": "vuepress dev docs", + "docs:deploy": "node scripts/deploy", + "lint": "eslint lib scripts tests", + "pretest": "npm run -s lint", + "test": "nyc npm run -s test:mocha", + "test:ci": "nyc npm run -s test:mocha", + "test:mocha": "mocha \"tests/lib/**/*.js\" --reporter dot --timeout 8000", + "watch": "npm run -s test:mocha -- --watch --growl", + "coverage": "nyc report --reporter lcov && opener coverage/lcov-report/index.html", + "codecov": "nyc report --reporter text-lcov | codecov --pipe --disable=gcov" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/mysticatea/eslint-plugin-eslint-comments.git" + }, + "keywords": [ + "eslint", + "eslintplugin", + "eslint-plugin", + "plugin", + "comment", + "comments", + "directive", + "global", + "globals", + "exported", + "eslint-env", + "eslint-enable", + "eslint-disable", + "eslint-disable-line", + "eslint-disable-next-line" + ], + "author": "Toru Nagashima", + "license": "MIT", + "bugs": { + "url": "https://github.com/mysticatea/eslint-plugin-eslint-comments/issues" + }, + "homepage": "https://github.com/mysticatea/eslint-plugin-eslint-comments#readme", + "funding": "https://github.com/sponsors/mysticatea" +} \ No newline at end of file diff --git a/node_modules/eslint-plugin-filenames/.eslintignore b/node_modules/eslint-plugin-filenames/.eslintignore new file mode 100644 index 000000000..0d67df3ff --- /dev/null +++ b/node_modules/eslint-plugin-filenames/.eslintignore @@ -0,0 +1,3 @@ +node_modules/** +.idea/** +build/** diff --git a/node_modules/eslint-plugin-filenames/.eslintrc b/node_modules/eslint-plugin-filenames/.eslintrc new file mode 100644 index 000000000..efd3b4117 --- /dev/null +++ b/node_modules/eslint-plugin-filenames/.eslintrc @@ -0,0 +1,14 @@ +{ + "extends": "eslint:recommended", + "plugins": [ + "filenames" + ], + "rules": { + "eol-last": 2, + "filenames/match-regex": [2, "^[a-z-]+$", true], + "filenames/match-exported": 2 + }, + "env": { + "node": true + } +} diff --git a/node_modules/eslint-plugin-filenames/README.md b/node_modules/eslint-plugin-filenames/README.md new file mode 100644 index 000000000..4bb9a0654 --- /dev/null +++ b/node_modules/eslint-plugin-filenames/README.md @@ -0,0 +1,162 @@ +# eslint-plugin-filenames + +[![NPM Version](https://img.shields.io/npm/v/eslint-plugin-filenames.svg?style=flat-square)](https://www.npmjs.org/package/eslint-plugin-filenames) +[![Build Status](https://img.shields.io/travis/selaux/eslint-plugin-filenames.svg?style=flat-square)](https://travis-ci.org/selaux/eslint-plugin-filenames) +[![Coverage Status](https://img.shields.io/coveralls/selaux/eslint-plugin-filenames.svg?style=flat-square)](https://coveralls.io/r/selaux/eslint-plugin-filenames?branch=master) +[![Dependencies](https://img.shields.io/david/selaux/eslint-plugin-filenames.svg?style=flat-square)](https://david-dm.org/selaux/eslint-plugin-filenames) + +Adds [eslint](http://eslint.org/) rules to ensure consistent filenames for your javascript files. + +__Please note__: This plugin will only lint the filenames of the `.js`, `.jsx` files you are linting with eslint. It will ignore other files that are not linted with eslint. + +## Enabling the plugin + +This plugin requires a version of `eslint>=1.0.0` to be installed as a peer dependency. + +Modify your `.eslintrc` file to load the plugin and enable the rules you want to use. + +```json +{ + "plugins": [ + "filenames" + ], + "rules": { + "filenames/match-regex": 2, + "filenames/match-exported": 2, + "filenames/no-index": 2 + } +} +``` + +## Rules + +### Consistent Filenames via regex (match-regex) + +A rule to enforce a certain file naming convention using a regular expression. + +The convention can be configured using a regular expression (the default is `camelCase.js`). Additionally +exporting files can be ignored with a second configuration parameter. + +```json +"filenames/match-regex": [2, "^[a-z_]+$", true] +``` + +With these configuration options, `camelCase.js` will be reported as an error while `snake_case.js` will pass. +Additionally the files that have a named default export (according to the logic in the `match-exported` rule) will be +ignored. They could be linted with the `match-exported` rule. Please note that exported function calls are not +respected in this case. + +### Matching Exported Values (match-exported) + +Match the file name against the default exported value in the module. Files that dont have a default export will +be ignored. The exports of `index.js` are matched against their parent directory. + +```js +// Considered problem only if the file isn't named foo.js or foo/index.js +export default function foo() {} + +// Considered problem only if the file isn't named Foo.js or Foo/index.js +module.exports = class Foo() {} + +// Considered problem only if the file isn't named someVariable.js or someVariable/index.js +module.exports = someVariable; + +// Never considered a problem +export default { foo: "bar" }; +``` + +If your filename policy doesn't quite match with your variable naming policy, you can add one or multiple transforms: + +```json +"filenames/match-exported": [ 2, "kebab" ] +``` + +Now, in your code: + +```js +// Considered problem only if file isn't named variable-name.js or variable-name/index.js +export default function variableName; +``` + +Available transforms: +'[snake](https://www.npmjs.com/package/lodash.snakecase)', +'[kebab](https://www.npmjs.com/package/lodash.kebabcase)', +'[camel](https://www.npmjs.com/package/lodash.camelcase)', and +'pascal' (camel-cased with first letter in upper case). + +For multiple transforms simply specify an array like this (null in this case stands for no transform): + +```json +"filenames/match-exported": [2, [ null, "kebab", "snake" ] ] +``` + +If you prefer to use suffixes for your files (e.g. `Foo.react.js` for a React component file), +you can use a second configuration parameter. It allows you to remove parts of a filename matching a regex pattern +before transforming and matching against the export. + +```json +"filenames/match-exported": [ 2, null, "\\.react$" ] +``` + +Now, in your code: + +```js +// Considered problem only if file isn't named variableName.react.js, variableName.js or variableName/index.js +export default function variableName; +``` + +If you also want to match exported function calls you can use the third option (a boolean flag). + +```json +"filenames/match-exported": [ 2, null, null, true ] +``` + +Now, in your code: + +```js +// Considered problem only if file isn't named functionName.js or functionName/index.js +export default functionName(); +``` + +### Don't allow index.js files (no-index) + +Having a bunch of `index.js` files can have negative influence on developer experience, e.g. when +opening files by name. When enabling this rule. `index.js` files will always be considered a problem. + +## Changelog + +#### 1.3.2 + +- Fix issue with `match-regex` and `getExportedName` + +#### 1.3.1 + +- Put breaking change from `1.3.0` behind a flag + +#### 1.3.0 + +- Support call expressions as named exports + +#### 1.2.0 +- Introduce `strip` option for `match-exported` +- Introduce support for multiple transform options +- Introduce `pascal` transform + +#### 1.1.0 +- Introduce `transform` option for `match-exported` + +#### 1.0.0 +- Split rule into `match-regex`, `match-exported` and `no-index` + +#### 0.2.0 +- Add match-exported flags + +#### 0.1.2 +- Fix example in README + +#### 0.1.1 +- Fix: Text via stdin always passes +- Tests: Travis builds also run on node 0.12 and iojs now + +#### 0.1.0 +- Initial Release diff --git a/node_modules/eslint-plugin-filenames/index.js b/node_modules/eslint-plugin-filenames/index.js new file mode 100644 index 000000000..e225f2c3a --- /dev/null +++ b/node_modules/eslint-plugin-filenames/index.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = { + rules: { + "match-regex": require("./lib/rules/match-regex"), + "match-exported": require("./lib/rules/match-exported"), + "no-index": require("./lib/rules/no-index") + } +}; diff --git a/node_modules/eslint-plugin-filenames/lib/common/getExportedName.js b/node_modules/eslint-plugin-filenames/lib/common/getExportedName.js new file mode 100644 index 000000000..2848b2eb7 --- /dev/null +++ b/node_modules/eslint-plugin-filenames/lib/common/getExportedName.js @@ -0,0 +1,38 @@ +function getNodeName(node, options) { + var op = options || []; + + if (node.type === "Identifier") { + return node.name; + } + + if (node.id && node.id.type === "Identifier") { + return node.id.name; + } + + if (op[2] && node.type === "CallExpression" && node.callee.type === "Identifier") { + return node.callee.name; + } +} + +module.exports = function getExportedName(programNode, options) { + for (var i = 0; i < programNode.body.length; i += 1) { + var node = programNode.body[i]; + + // export default ... + if (node.type === "ExportDefaultDeclaration") { + return getNodeName(node.declaration, options); + } + + // module.exports = ... + if (node.type === "ExpressionStatement" && + node.expression.type === "AssignmentExpression" && + node.expression.left.type === "MemberExpression" && + node.expression.left.object.type === "Identifier" && + node.expression.left.object.name === "module" && + node.expression.left.property.type === "Identifier" && + node.expression.left.property.name === "exports" + ) { + return getNodeName(node.expression.right, options); + } + } +}; diff --git a/node_modules/eslint-plugin-filenames/lib/common/isIgnoredFilename.js b/node_modules/eslint-plugin-filenames/lib/common/isIgnoredFilename.js new file mode 100644 index 000000000..9662f0341 --- /dev/null +++ b/node_modules/eslint-plugin-filenames/lib/common/isIgnoredFilename.js @@ -0,0 +1,5 @@ +var ignoredFilenames = [ "", "" ]; + +module.exports = function isIgnoredFilename(filename) { + return ignoredFilenames.indexOf(filename) !== -1; +}; diff --git a/node_modules/eslint-plugin-filenames/lib/common/isIndexFile.js b/node_modules/eslint-plugin-filenames/lib/common/isIndexFile.js new file mode 100644 index 000000000..d8863df07 --- /dev/null +++ b/node_modules/eslint-plugin-filenames/lib/common/isIndexFile.js @@ -0,0 +1,3 @@ +module.exports = function isIndexFile(parsed) { + return parsed.name === 'index'; +}; diff --git a/node_modules/eslint-plugin-filenames/lib/common/parseFilename.js b/node_modules/eslint-plugin-filenames/lib/common/parseFilename.js new file mode 100644 index 000000000..dc701c96c --- /dev/null +++ b/node_modules/eslint-plugin-filenames/lib/common/parseFilename.js @@ -0,0 +1,12 @@ +var path = require('path'); + +module.exports = function parseFilename(filename) { + var ext = path.extname(filename); + + return { + dir: path.dirname(filename), + base: path.basename(filename), + ext: ext, + name: path.basename(filename, ext) + } +}; diff --git a/node_modules/eslint-plugin-filenames/lib/rules/match-exported.js b/node_modules/eslint-plugin-filenames/lib/rules/match-exported.js new file mode 100644 index 000000000..31c9ac0a6 --- /dev/null +++ b/node_modules/eslint-plugin-filenames/lib/rules/match-exported.js @@ -0,0 +1,123 @@ +/** + * @fileoverview Rule to ensure that filenames match the exports of the file + * @author Stefan Lau + */ + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +var path = require('path'), + camelCase = require('lodash.camelcase'), + upperFirst = require('lodash.upperfirst'), + parseFilename = require('../common/parseFilename'), + isIgnoredFilename = require('../common/isIgnoredFilename'), + getExportedName = require('../common/getExportedName'), + isIndexFile = require('../common/isIndexFile'), + transforms = { + kebab: require('lodash.kebabcase'), + snake: require('lodash.snakecase'), + camel: camelCase, + pascal: function (name) { + return upperFirst(camelCase(name)); + } + }, + transformNames = Object.keys(transforms), + transformSchema = { "enum": transformNames.concat([ null ]) }; + +function getStringToCheckAgainstExport(parsed, replacePattern) { + var dirArray = parsed.dir.split(path.sep); + var lastDirectory = dirArray[dirArray.length - 1]; + + if (isIndexFile(parsed)) { + return lastDirectory; + } else { + return replacePattern ? parsed.name.replace(replacePattern, '') : parsed.name; + } +} + +function getTransformsFromOptions(option) { + var usedTransforms = (option && option.push) ? option : [ option ]; + + return usedTransforms.map(function (name) { + return transforms[name]; + }); +} + +function transform(exportedName, transforms) { + return transforms.map(function (t) { + return t ? t(exportedName) : exportedName; + }); +} + +function anyMatch(expectedExport, transformedNames) { + return transformedNames.some(function (name) { + return name === expectedExport; + }); +} + +function getWhatToMatchMessage(transforms) { + if (transforms.length === 1 && !transforms[0]) { + return "the exported name"; + } + if (transforms.length > 1) { + return "any of the exported and transformed names" + } + return "the exported and transformed name"; +} + +module.exports = function(context) { + return { + "Program": function (node) { + var transforms = getTransformsFromOptions(context.options[0]), + replacePattern = context.options[1] ? new RegExp(context.options[1]) : null, + filename = context.getFilename(), + absoluteFilename = path.resolve(filename), + parsed = parseFilename(absoluteFilename), + shouldIgnore = isIgnoredFilename(filename), + exportedName = getExportedName(node, context.options), + isExporting = Boolean(exportedName), + expectedExport = getStringToCheckAgainstExport(parsed, replacePattern), + transformedNames = transform(exportedName, transforms), + everythingIsIndex = exportedName === 'index' && parsed.name === 'index', + matchesExported = anyMatch(expectedExport, transformedNames) || everythingIsIndex, + reportIf = function (condition, messageForNormalFile, messageForIndexFile) { + var message = (!messageForIndexFile || !isIndexFile(parsed)) ? messageForNormalFile : messageForIndexFile; + + if (condition) { + context.report(node, message, { + name: parsed.base, + expectedExport: expectedExport, + exportName: transformedNames.join("', '"), + extension: parsed.ext, + whatToMatch: getWhatToMatchMessage(transforms) + }); + } + }; + + if (shouldIgnore) return; + + reportIf( + isExporting && !matchesExported, + "Filename '{{expectedExport}}' must match {{whatToMatch}} '{{exportName}}'.", + "The directory '{{expectedExport}}' must be named '{{exportName}}', after the exported value of its index file." + ); + } + } +}; + +module.exports.schema = [ + { + + oneOf: [ + transformSchema, + { type: "array", items: transformSchema, minItems: 1 } + ] + }, + { + type: [ "string", "null" ] + }, + { + type: [ "boolean", "null" ] + } +]; diff --git a/node_modules/eslint-plugin-filenames/lib/rules/match-regex.js b/node_modules/eslint-plugin-filenames/lib/rules/match-regex.js new file mode 100644 index 000000000..ebdf326aa --- /dev/null +++ b/node_modules/eslint-plugin-filenames/lib/rules/match-regex.js @@ -0,0 +1,40 @@ +/** + * @fileoverview Rule to ensure that filenames match a convention (default: camelCase) + * @author Stefan Lau + */ + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +"use strict"; + +var path = require("path"), + parseFilename = require('../common/parseFilename'), + getExportedName = require('../common/getExportedName'), + isIgnoredFilename = require('../common/isIgnoredFilename'); + +module.exports = function(context) { + var defaultRegexp = /^([a-z0-9]+)([A-Z][a-z0-9]+)*$/g, + conventionRegexp = context.options[0] ? new RegExp(context.options[0]) : defaultRegexp, + ignoreExporting = context.options[1] ? context.options[1] : false; + + return { + "Program": function(node) { + var filename = context.getFilename(), + absoluteFilename = path.resolve(filename), + parsed = parseFilename(absoluteFilename), + shouldIgnore = isIgnoredFilename(filename), + isExporting = Boolean(getExportedName(node)), + matchesRegex = conventionRegexp.test(parsed.name); + + if (shouldIgnore) return; + if (ignoreExporting && isExporting) return; + if (!matchesRegex) { + context.report(node, "Filename '{{name}}' does not match the naming convention.", { + name: parsed.base + }); + } + } + }; +}; diff --git a/node_modules/eslint-plugin-filenames/lib/rules/no-index.js b/node_modules/eslint-plugin-filenames/lib/rules/no-index.js new file mode 100644 index 000000000..54f3a6283 --- /dev/null +++ b/node_modules/eslint-plugin-filenames/lib/rules/no-index.js @@ -0,0 +1,32 @@ +/** + * @fileoverview Rule to ensure that there exist no index files + * @author Stefan Lau + */ + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +var path = require('path'), + parseFilename = require('../common/parseFilename'), + isIgnoredFilename = require('../common/isIgnoredFilename'), + isIndexFile = require('../common/isIndexFile'); + +module.exports = function(context) { + return { + "Program": function(node) { + var filename = context.getFilename(), + absoluteFilename = path.resolve(filename), + parsed = parseFilename(absoluteFilename), + shouldIgnore = isIgnoredFilename(filename), + isIndex = isIndexFile(parsed); + + + if (shouldIgnore) return; + if (isIndex) { + context.report(node, "'index.js' files are not allowed."); + } + } + }; + +}; diff --git a/node_modules/eslint-plugin-filenames/package.json b/node_modules/eslint-plugin-filenames/package.json new file mode 100644 index 000000000..0402d11a2 --- /dev/null +++ b/node_modules/eslint-plugin-filenames/package.json @@ -0,0 +1,50 @@ +{ + "name": "eslint-plugin-filenames", + "version": "1.3.2", + "description": "Eslint rule for consistent filenames.", + "main": "index.js", + "scripts": { + "test": "npm run lint && npm run unit-test --coverage && npm run check-coverage", + "lint": "eslint .", + "unit-test": "istanbul test --dir build/coverage _mocha test -- --recursive --reporter dot", + "check-coverage": "istanbul check-coverage --statement 100 --branch 100 --function 100 --lines 100", + "report-coverage-html": "istanbul report --dir build/coverage html", + "coveralls": "cat ./build/coverage/lcov.info | coveralls" + }, + "dependencies": { + "lodash.camelcase": "4.3.0", + "lodash.kebabcase": "4.1.1", + "lodash.snakecase": "4.1.1", + "lodash.upperfirst": "4.3.1" + }, + "devDependencies": { + "chai": "3.5.0", + "coveralls": "2.13.0", + "eslint": "^2.0.0", + "eslint-plugin-filenames": "^1.0.0", + "istanbul": "0.4.5", + "mocha": "3.2.0", + "sinon": "2.1.0" + }, + "peerDependencies": { + "eslint": "*" + }, + "repository": { + "type": "git", + "url": "git://github.com/selaux/eslint-plugin-filenames.git" + }, + "author": "Stefan Lau ", + "license": "MIT", + "bugs": { + "url": "https://github.com/selaux/eslint-plugin-filenames/issues" + }, + "homepage": "https://github.com/selaux/eslint-plugin-filenames", + "keywords": [ + "eslint", + "eslintplugin", + "eslint-plugin", + "file", + "filename", + "path" + ] +} \ No newline at end of file diff --git a/node_modules/eslint-plugin-github/LICENSE b/node_modules/eslint-plugin-github/LICENSE new file mode 100644 index 000000000..60afff4ac --- /dev/null +++ b/node_modules/eslint-plugin-github/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2016 GitHub, Inc. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/eslint-plugin-github/README.md b/node_modules/eslint-plugin-github/README.md new file mode 100644 index 000000000..db14ae053 --- /dev/null +++ b/node_modules/eslint-plugin-github/README.md @@ -0,0 +1,38 @@ +# eslint-plugin-github + +## Installation + +```sh +$ npm install --save-dev eslint eslint-plugin-github +``` + +## Setup + +Add `github` to your list of plugins in your ESLint config. + +JSON ESLint config example: +```json +{ + "plugins": ["github"] +} +``` + +Extend the configs you wish to use. + +JSON ESLint config example: +```json +{ + "extends": ["plugin:github/recommended"] +} +``` + +The available configs are: + +- `app` + - Rules useful for github applications. +- `browser` + - Useful rules when shipping your app to the browser. +- `recommended` + - Recommended rules for every application. +- `typescript` + - Useful rules when writing TypeScript. diff --git a/node_modules/eslint-plugin-github/bin/eslint-ignore-errors.js b/node_modules/eslint-plugin-github/bin/eslint-ignore-errors.js new file mode 100755 index 000000000..643d3f775 --- /dev/null +++ b/node_modules/eslint-plugin-github/bin/eslint-ignore-errors.js @@ -0,0 +1,50 @@ +#!/usr/bin/env node +// Disables eslint rules in a JavaScript file with next-line comments. This is +// useful when introducing a new rule that causes many failures. The comments +// can be fixed and removed at while updating the file later. +// +// Usage: +// +// eslint-ignore-errors app/assets/javascripts/something.js + +const fs = require('fs') +const execFile = require('child_process').execFile + +execFile('eslint', ['--format', 'json', process.argv[2]], (error, stdout) => { + for (const result of JSON.parse(stdout)) { + const filename = result.filePath + const jsLines = fs.readFileSync(filename, 'utf8').split('\n') + const offensesByLine = {} + let addedLines = 0 + + // Produces {47: ['github/no-d-none', 'github/no-blur'], 83: ['github/no-blur']} + for (const message of result.messages) { + if (offensesByLine[message.line]) { + offensesByLine[message.line].push(message.ruleId) + } else { + offensesByLine[message.line] = [message.ruleId] + } + } + + for (const line of Object.keys(offensesByLine)) { + const lineIndex = line - 1 + addedLines + const previousLine = jsLines[lineIndex - 1] + const ruleIds = offensesByLine[line].join(', ') + if (isDisableComment(previousLine)) { + jsLines[lineIndex - 1] = previousLine.replace(/\s?\*\/$/, `, ${ruleIds} */`) + } else { + const leftPad = ' '.repeat(jsLines[lineIndex].match(/^\s*/g)[0].length) + jsLines.splice(lineIndex, 0, `${leftPad}/* eslint-disable-next-line ${ruleIds} */`) + } + addedLines += 1 + } + + if (result.messages.length !== 0) { + fs.writeFileSync(filename, jsLines.join('\n'), 'utf8') + } + } +}) + +function isDisableComment(line) { + return line.match(/\/\* eslint-disable-next-line .+\*\//) +} diff --git a/node_modules/eslint-plugin-github/lib/configs/browser.js b/node_modules/eslint-plugin-github/lib/configs/browser.js new file mode 100644 index 000000000..c2e5c4467 --- /dev/null +++ b/node_modules/eslint-plugin-github/lib/configs/browser.js @@ -0,0 +1,18 @@ +module.exports = { + env: { + browser: true + }, + plugins: ['github'], + rules: { + 'github/async-currenttarget': 'error', + 'github/async-preventdefault': 'error', + 'github/get-attribute': 'error', + 'github/no-blur': 'error', + 'github/no-dataset': 'error', + 'github/no-innerText': 'error', + 'github/unescaped-html-literal': 'error', + 'github/no-useless-passive': 'error', + 'github/require-passive-events': 'error', + 'github/prefer-observers': 'error' + } +} diff --git a/node_modules/eslint-plugin-github/lib/configs/internal.js b/node_modules/eslint-plugin-github/lib/configs/internal.js new file mode 100644 index 000000000..8de10865c --- /dev/null +++ b/node_modules/eslint-plugin-github/lib/configs/internal.js @@ -0,0 +1,8 @@ +module.exports = { + plugins: ['github'], + rules: { + 'github/authenticity-token': 'error', + 'github/js-class-name': 'error', + 'github/no-d-none': 'error' + } +} diff --git a/node_modules/eslint-plugin-github/lib/configs/recommended.js b/node_modules/eslint-plugin-github/lib/configs/recommended.js new file mode 100644 index 000000000..c164a3988 --- /dev/null +++ b/node_modules/eslint-plugin-github/lib/configs/recommended.js @@ -0,0 +1,116 @@ +module.exports = { + parserOptions: { + ecmaFeatures: { + ecmaVersion: 6 + }, + sourceType: 'module' + }, + env: { + es6: true + }, + plugins: ['github', 'prettier', 'eslint-comments', 'import'], + rules: { + 'constructor-super': 'error', + 'eslint-comments/disable-enable-pair': 'off', + 'eslint-comments/no-aggregating-enable': 'off', + 'eslint-comments/no-duplicate-disable': 'error', + 'eslint-comments/no-unlimited-disable': 'error', + 'eslint-comments/no-unused-disable': 'error', + 'eslint-comments/no-unused-enable': 'error', + 'eslint-comments/no-use': ['error', {allow: ['eslint', 'eslint-disable-next-line', 'eslint-env', 'globals']}], + 'func-style': ['error', 'declaration', {allowArrowFunctions: true}], + 'github/array-foreach': 'error', + 'github/no-implicit-buggy-globals': 'error', + 'github/no-then': 'error', + 'import/default': 'error', + 'import/export': 'error', + 'import/first': 'error', + 'import/named': 'error', + 'import/namespace': 'error', + 'import/no-absolute-path': 'error', + 'import/no-anonymous-default-export': [ + 'error', + { + allowAnonymousClass: false, + allowAnonymousFunction: false, + allowArray: true, + allowArrowFunction: false, + allowLiteral: true, + allowObject: true + } + ], + 'import/no-deprecated': 'error', + 'import/no-duplicates': 'error', + 'import/no-mutable-exports': 'error', + 'import/no-named-as-default': 'error', + 'import/no-named-as-default-member': 'error', + 'import/no-namespace': 'error', + 'no-case-declarations': 'error', + 'no-class-assign': 'error', + 'no-compare-neg-zero': 'error', + 'no-cond-assign': 'error', + 'no-console': 'error', + 'no-const-assign': 'error', + 'no-constant-condition': 'error', + 'no-control-regex': 'error', + 'no-debugger': 'error', + 'no-delete-var': 'error', + 'no-dupe-args': 'error', + 'no-dupe-class-members': 'error', + 'no-dupe-keys': 'error', + 'no-duplicate-case': 'error', + 'no-empty': 'error', + 'no-empty-character-class': 'error', + 'no-empty-pattern': 'error', + 'no-ex-assign': 'error', + 'no-extra-boolean-cast': 'error', + 'no-fallthrough': 'error', + 'no-func-assign': 'error', + 'no-global-assign': 'error', + 'no-implicit-globals': 'error', + 'no-implied-eval': 'error', + 'no-inner-declarations': 'error', + 'no-invalid-regexp': 'error', + 'no-invalid-this': 'error', + 'no-irregular-whitespace': 'error', + 'no-new-symbol': 'error', + 'no-obj-calls': 'error', + 'no-octal': 'error', + 'no-redeclare': 'error', + 'no-regex-spaces': 'error', + 'no-return-assign': 'error', + 'no-self-assign': 'error', + 'no-shadow': 'error', + 'no-sparse-arrays': 'error', + 'no-this-before-super': 'error', + 'no-throw-literal': 'error', + 'no-undef': 'error', + 'no-unreachable': 'error', + 'no-unsafe-finally': 'error', + 'no-unsafe-negation': 'error', + 'no-unused-labels': 'error', + 'no-unused-vars': 'error', + 'no-useless-concat': 'error', + 'no-useless-escape': 'error', + 'no-var': 'error', + 'object-shorthand': ['error', 'always', {avoidQuotes: true}], + 'prefer-const': 'error', + 'prefer-promise-reject-errors': 'error', + 'prefer-rest-params': 'error', + 'prefer-spread': 'error', + 'prefer-template': 'error', + 'prettier/prettier': 'error', + 'require-yield': 'error', + 'use-isnan': 'error', + 'valid-typeof': 'error', + camelcase: ['error', {properties: 'always'}], + eqeqeq: ['error', 'smart'] + }, + settings: { + 'import/resolver': { + node: { + extensions: ['.js', '.ts'] + } + } + } +} diff --git a/node_modules/eslint-plugin-github/lib/configs/typescript.js b/node_modules/eslint-plugin-github/lib/configs/typescript.js new file mode 100644 index 000000000..ff480bef7 --- /dev/null +++ b/node_modules/eslint-plugin-github/lib/configs/typescript.js @@ -0,0 +1,15 @@ +module.exports = { + extends: ['plugin:@typescript-eslint/recommended', 'prettier', 'prettier/@typescript-eslint'], + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint', 'github'], + rules: { + camelcase: 'off', + 'no-unused-vars': 'off', + '@typescript-eslint/interface-name-prefix': 'off', + '@typescript-eslint/array-type': ['error', {default: 'array-simple'}], + '@typescript-eslint/no-use-before-define': 'off', + '@typescript-eslint/explicit-member-accessibility': 'off', + '@typescript-eslint/explicit-function-return-type': 'off', + '@typescript-eslint/no-non-null-assertion': 'off' + } +} diff --git a/node_modules/eslint-plugin-github/lib/formatters/stylish-fixes.js b/node_modules/eslint-plugin-github/lib/formatters/stylish-fixes.js new file mode 100644 index 000000000..6ab58bc69 --- /dev/null +++ b/node_modules/eslint-plugin-github/lib/formatters/stylish-fixes.js @@ -0,0 +1,89 @@ +'use strict' + +const childProcess = require('child_process') +const fs = require('fs') +const os = require('os') +const path = require('path') +let SourceCodeFixer = null +try { + SourceCodeFixer = require('eslint/lib/linter/source-code-fixer') +} catch (e) { + SourceCodeFixer = require('eslint/lib/util/source-code-fixer') +} +const getRuleURI = require('eslint-rule-documentation') + +module.exports = function(results) { + let output = '\n' + let errors = 0 + let warnings = 0 + const rootPath = process.cwd() + + for (const result of results) { + const messages = result.messages + + if (messages.length === 0) { + continue + } + + errors += result.errorCount + warnings += result.warningCount + + const relativePath = path.relative(rootPath, result.filePath) + + output += `${relativePath}\n` + + for (const message of messages) { + output += `${message.line}:${message.column} ${message.ruleId || ''}` + if (message.ruleId) { + const ruleURI = getRuleURI(message.ruleId) + if (ruleURI.found) { + output += ` (${ruleURI.url})` + } + } + output += `\n\t${message.message}\n` + } + + if (messages.some(msg => msg.fix)) { + const fixResult = SourceCodeFixer.applyFixes(result.source, messages) + output += `\n\n$ eslint --fix ${relativePath}\n` + output += diff(result.source, fixResult.output) + } + + output += '\n\n' + } + + const total = errors + warnings + + if (total > 0) { + output += [ + '\u2716 ', + total, + pluralize(' problem', total), + ' (', + errors, + pluralize(' error', errors), + ', ', + warnings, + pluralize(' warning', warnings), + ')\n' + ].join('') + } + + return total > 0 ? output : '' +} + +function pluralize(word, count) { + return count === 1 ? word : `${word}s` +} + +function diff(a, b) { + const aPath = path.join(os.tmpdir(), 'a.js') + const bPath = path.join(os.tmpdir(), 'p.js') + fs.writeFileSync(aPath, a, {encoding: 'utf8'}) + fs.writeFileSync(bPath, b, {encoding: 'utf8'}) + const result = childProcess.spawnSync('diff', ['-U5', aPath, bPath], {encoding: 'utf8'}) + return result.stdout + .split('\n') + .slice(2) + .join('\n') +} diff --git a/node_modules/eslint-plugin-github/lib/index.js b/node_modules/eslint-plugin-github/lib/index.js new file mode 100644 index 000000000..63f9847b8 --- /dev/null +++ b/node_modules/eslint-plugin-github/lib/index.js @@ -0,0 +1,26 @@ +module.exports = { + rules: { + 'array-foreach': require('./rules/array-foreach'), + 'async-currenttarget': require('./rules/async-currenttarget'), + 'async-preventdefault': require('./rules/async-preventdefault'), + 'authenticity-token': require('./rules/authenticity-token'), + 'get-attribute': require('./rules/get-attribute'), + 'js-class-name': require('./rules/js-class-name'), + 'no-blur': require('./rules/no-blur'), + 'no-d-none': require('./rules/no-d-none'), + 'no-dataset': require('./rules/no-dataset'), + 'no-implicit-buggy-globals': require('./rules/no-implicit-buggy-globals'), + 'no-innerText': require('./rules/no-innerText'), + 'no-then': require('./rules/no-then'), + 'unescaped-html-literal': require('./rules/unescaped-html-literal'), + 'no-useless-passive': require('./rules/no-useless-passive'), + 'prefer-observers': require('./rules/prefer-observers'), + 'require-passive-events': require('./rules/require-passive-events') + }, + configs: { + internal: require('./configs/internal'), + browser: require('./configs/browser'), + recommended: require('./configs/recommended'), + typescript: require('./configs/typescript') + } +} diff --git a/node_modules/eslint-plugin-github/lib/rules/array-foreach.js b/node_modules/eslint-plugin-github/lib/rules/array-foreach.js new file mode 100644 index 000000000..7b5aee965 --- /dev/null +++ b/node_modules/eslint-plugin-github/lib/rules/array-foreach.js @@ -0,0 +1,16 @@ +module.exports = { + meta: { + docs: {}, + schema: [] + }, + + create(context) { + return { + CallExpression(node) { + if (node.callee.property && node.callee.property.name === 'forEach') { + context.report(node, 'Prefer for...of instead of Array.forEach') + } + } + } + } +} diff --git a/node_modules/eslint-plugin-github/lib/rules/async-currenttarget.js b/node_modules/eslint-plugin-github/lib/rules/async-currenttarget.js new file mode 100644 index 000000000..d07605ef2 --- /dev/null +++ b/node_modules/eslint-plugin-github/lib/rules/async-currenttarget.js @@ -0,0 +1,24 @@ +module.exports = { + meta: { + docs: {}, + schema: [] + }, + + create(context) { + const scopeDidWait = new WeakSet() + + return { + AwaitExpression() { + scopeDidWait.add(context.getScope(), true) + }, + MemberExpression(node) { + if (node.property && node.property.name === 'currentTarget') { + const scope = context.getScope() + if (scope.block.async && scopeDidWait.has(scope)) { + context.report(node, 'event.currentTarget inside an async function is error prone') + } + } + } + } + } +} diff --git a/node_modules/eslint-plugin-github/lib/rules/async-preventdefault.js b/node_modules/eslint-plugin-github/lib/rules/async-preventdefault.js new file mode 100644 index 000000000..ab996c495 --- /dev/null +++ b/node_modules/eslint-plugin-github/lib/rules/async-preventdefault.js @@ -0,0 +1,24 @@ +module.exports = { + meta: { + docs: {}, + schema: [] + }, + + create(context) { + const scopeDidWait = new WeakSet() + + return { + AwaitExpression() { + scopeDidWait.add(context.getScope(), true) + }, + CallExpression(node) { + if (node.callee.property && node.callee.property.name === 'preventDefault') { + const scope = context.getScope() + if (scope.block.async && scopeDidWait.has(scope)) { + context.report(node, 'event.preventDefault() inside an async function is error prone') + } + } + } + } + } +} diff --git a/node_modules/eslint-plugin-github/lib/rules/authenticity-token.js b/node_modules/eslint-plugin-github/lib/rules/authenticity-token.js new file mode 100644 index 000000000..bccc678d1 --- /dev/null +++ b/node_modules/eslint-plugin-github/lib/rules/authenticity-token.js @@ -0,0 +1,25 @@ +module.exports = { + meta: { + docs: {}, + schema: [] + }, + + create(context) { + function checkAuthenticityTokenUsage(node, str) { + if (str.includes('authenticity_token')) { + context.report( + node, + 'Form CSRF tokens (authenticity tokens) should not be created in JavaScript and their values should not be used directly for XHR requests.' + ) + } + } + + return { + Literal(node) { + if (typeof node.value === 'string') { + checkAuthenticityTokenUsage(node, node.value) + } + } + } + } +} diff --git a/node_modules/eslint-plugin-github/lib/rules/get-attribute.js b/node_modules/eslint-plugin-github/lib/rules/get-attribute.js new file mode 100644 index 000000000..27eb873b4 --- /dev/null +++ b/node_modules/eslint-plugin-github/lib/rules/get-attribute.js @@ -0,0 +1,45 @@ +const svgElementAttributes = require('svg-element-attributes') + +const attributeCalls = /^(get|has|set|remove)Attribute$/ +const validAttributeName = /^[a-z][a-z0-9-]*$/ + +// these are common SVG attributes that *must* have the correct case to work +const camelCaseAttributes = Object.values(svgElementAttributes) + .reduce((all, elementAttrs) => all.concat(elementAttrs), []) + .filter(name => !validAttributeName.test(name)) + +const validSVGAttributeSet = new Set(camelCaseAttributes) + +// lowercase variants of camelCase SVG attributes are probably an error +const invalidSVGAttributeSet = new Set(camelCaseAttributes.map(name => name.toLowerCase())) + +function isValidAttribute(name) { + return validSVGAttributeSet.has(name) || (validAttributeName.test(name) && !invalidSVGAttributeSet.has(name)) +} + +module.exports = function(context) { + return { + CallExpression(node) { + if (!node.callee.property) return + + const calleeName = node.callee.property.name + if (!attributeCalls.test(calleeName)) return + + const attributeNameNode = node.arguments[0] + if (!attributeNameNode) return + + if (!isValidAttribute(attributeNameNode.value)) { + context.report({ + meta: { + fixable: 'code' + }, + node: attributeNameNode, + message: 'Attributes should be lowercase and hyphen separated, or part of the SVG whitelist.', + fix(fixer) { + return fixer.replaceText(attributeNameNode, `'${attributeNameNode.value.toLowerCase()}'`) + } + }) + } + } + } +} diff --git a/node_modules/eslint-plugin-github/lib/rules/js-class-name.js b/node_modules/eslint-plugin-github/lib/rules/js-class-name.js new file mode 100644 index 000000000..e2f2a6c5f --- /dev/null +++ b/node_modules/eslint-plugin-github/lib/rules/js-class-name.js @@ -0,0 +1,53 @@ +module.exports = { + meta: { + docs: {}, + schema: [] + }, + + create(context) { + const allJsClassNameRegexp = /\bjs-[_a-zA-Z0-9-]*/g + const validJsClassNameRegexp = /^js(-[a-z0-9]+)+$/g + const endWithJsClassNameRegexp = /\bjs-[_a-zA-Z0-9-]*$/g + + function checkStringFormat(node, str) { + const matches = str.match(allJsClassNameRegexp) || [] + for (const match of matches) { + if (!match.match(validJsClassNameRegexp)) { + context.report(node, 'js- class names should be lowercase and only contain dashes.') + } + } + } + + function checkStringEndsWithJSClassName(node, str) { + if (str.match(endWithJsClassNameRegexp)) { + context.report(node, 'js- class names should be statically defined.') + } + } + + return { + Literal(node) { + if (typeof node.value === 'string') { + checkStringFormat(node, node.value) + + if ( + node.parent && + node.parent.type === 'BinaryExpression' && + node.parent.operator === '+' && + node.parent.left.value + ) { + checkStringEndsWithJSClassName(node.parent.left, node.parent.left.value) + } + } + }, + TemplateLiteral(node) { + for (const quasi of node.quasis) { + checkStringFormat(quasi, quasi.value.raw) + + if (quasi.tail === false) { + checkStringEndsWithJSClassName(quasi, quasi.value.raw) + } + } + } + } + } +} diff --git a/node_modules/eslint-plugin-github/lib/rules/no-blur.js b/node_modules/eslint-plugin-github/lib/rules/no-blur.js new file mode 100644 index 000000000..59b216423 --- /dev/null +++ b/node_modules/eslint-plugin-github/lib/rules/no-blur.js @@ -0,0 +1,11 @@ +module.exports = function(context) { + return { + CallExpression(node) { + if (node.callee.property && node.callee.property.name === 'blur') { + context.report(node, 'Do not use element.blur(), instead restore the focus of a previous element.') + } + } + } +} + +module.exports.schema = [] diff --git a/node_modules/eslint-plugin-github/lib/rules/no-d-none.js b/node_modules/eslint-plugin-github/lib/rules/no-d-none.js new file mode 100644 index 000000000..a742fa189 --- /dev/null +++ b/node_modules/eslint-plugin-github/lib/rules/no-d-none.js @@ -0,0 +1,23 @@ +module.exports = { + create(context) { + return { + CallExpression(node) { + if ( + node.callee.type === 'MemberExpression' && + node.callee.object.property && + node.callee.object.property.name === 'classList' + ) { + const invalidArgument = node.arguments.some(arg => { + return arg.type === 'Literal' && arg.value === 'd-none' + }) + if (invalidArgument) { + context.report({ + node, + message: 'Prefer hidden property to d-none class' + }) + } + } + } + } + } +} diff --git a/node_modules/eslint-plugin-github/lib/rules/no-dataset.js b/node_modules/eslint-plugin-github/lib/rules/no-dataset.js new file mode 100644 index 000000000..d43aad81f --- /dev/null +++ b/node_modules/eslint-plugin-github/lib/rules/no-dataset.js @@ -0,0 +1,16 @@ +module.exports = { + meta: { + docs: {}, + schema: [] + }, + + create(context) { + return { + MemberExpression(node) { + if (node.property && node.property.name === 'dataset') { + context.report(node, "Use getAttribute('data-your-attribute') instead of dataset.") + } + } + } + } +} diff --git a/node_modules/eslint-plugin-github/lib/rules/no-implicit-buggy-globals.js b/node_modules/eslint-plugin-github/lib/rules/no-implicit-buggy-globals.js new file mode 100644 index 000000000..663488122 --- /dev/null +++ b/node_modules/eslint-plugin-github/lib/rules/no-implicit-buggy-globals.js @@ -0,0 +1,31 @@ +module.exports = { + meta: { + docs: {}, + schema: [] + }, + + create(context) { + return { + Program() { + const scope = context.getScope() + + for (const variable of scope.variables) { + if (variable.writeable) { + return + } + + for (const def of variable.defs) { + if ( + def.type === 'FunctionName' || + def.type === 'ClassName' || + (def.type === 'Variable' && def.parent.kind === 'const') || + (def.type === 'Variable' && def.parent.kind === 'let') + ) { + context.report(def.node, 'Implicit global variable, assign as global property instead.') + } + } + } + } + } + } +} diff --git a/node_modules/eslint-plugin-github/lib/rules/no-innerText.js b/node_modules/eslint-plugin-github/lib/rules/no-innerText.js new file mode 100644 index 000000000..c6bf056bb --- /dev/null +++ b/node_modules/eslint-plugin-github/lib/rules/no-innerText.js @@ -0,0 +1,25 @@ +module.exports = { + meta: { + docs: {}, + fixable: 'code' + }, + + create(context) { + return { + MemberExpression(node) { + if (node.property && node.property.name === 'innerText') { + context.report({ + meta: { + fixable: 'code' + }, + node: node.property, + message: 'Prefer textContent to innerText', + fix(fixer) { + return fixer.replaceText(node.property, 'textContent') + } + }) + } + } + } + } +} diff --git a/node_modules/eslint-plugin-github/lib/rules/no-then.js b/node_modules/eslint-plugin-github/lib/rules/no-then.js new file mode 100644 index 000000000..0f152b8cb --- /dev/null +++ b/node_modules/eslint-plugin-github/lib/rules/no-then.js @@ -0,0 +1,17 @@ +module.exports = { + meta: { + docs: {} + }, + + create(context) { + return { + MemberExpression(node) { + if (node.property && node.property.name === 'then') { + context.report(node.property, 'Prefer async/await to Promise.then()') + } else if (node.property && node.property.name === 'catch') { + context.report(node.property, 'Prefer async/await to Promise.catch()') + } + } + } + } +} diff --git a/node_modules/eslint-plugin-github/lib/rules/no-useless-passive.js b/node_modules/eslint-plugin-github/lib/rules/no-useless-passive.js new file mode 100644 index 000000000..f9eef57d5 --- /dev/null +++ b/node_modules/eslint-plugin-github/lib/rules/no-useless-passive.js @@ -0,0 +1,46 @@ +const passiveEventListenerNames = new Set(['touchstart', 'touchmove', 'wheel', 'mousewheel']) + +const propIsPassiveTrue = prop => prop.key && prop.key.name === 'passive' && prop.value && prop.value.value === true + +module.exports = { + meta: { + docs: {}, + fixable: 'code' + }, + + create(context) { + return { + ['CallExpression[callee.property.name="addEventListener"]']: function(node) { + const [name, listener, options] = node.arguments + if (name.type !== 'Literal') return + if (passiveEventListenerNames.has(name.value)) return + if (options && options.type === 'ObjectExpression') { + const i = options.properties.findIndex(propIsPassiveTrue) + if (i === -1) return + const passiveProp = options.properties[i] + const l = options.properties.length + const source = context.getSourceCode() + context.report({ + node: passiveProp, + message: `"${name.value}" event listener is not cancellable and so \`passive: true\` does nothing.`, + fix(fixer) { + const removals = [] + if (l === 1) { + removals.push(options) + removals.push(...source.getTokensBetween(listener, options)) + } else { + removals.push(passiveProp) + if (i > 0) { + removals.push(...source.getTokensBetween(options.properties[i - 1], passiveProp)) + } else { + removals.push(...source.getTokensBetween(passiveProp, options.properties[i + 1])) + } + } + return removals.map(t => fixer.remove(t)) + } + }) + } + } + } + } +} diff --git a/node_modules/eslint-plugin-github/lib/rules/prefer-observers.js b/node_modules/eslint-plugin-github/lib/rules/prefer-observers.js new file mode 100644 index 000000000..0e9824a61 --- /dev/null +++ b/node_modules/eslint-plugin-github/lib/rules/prefer-observers.js @@ -0,0 +1,24 @@ +const observerMap = { + scroll: 'IntersectionObserver', + resize: 'ResizeObserver' +} +module.exports = { + meta: { + docs: {}, + fixable: 'code' + }, + + create(context) { + return { + ['CallExpression[callee.property.name="addEventListener"]']: function(node) { + const [name] = node.arguments + if (name.type !== 'Literal') return + if (!(name.value in observerMap)) return + context.report({ + node, + message: `Avoid using "${name.value}" event listener. Consider using ${observerMap[name.value]} instead` + }) + } + } + } +} diff --git a/node_modules/eslint-plugin-github/lib/rules/require-passive-events.js b/node_modules/eslint-plugin-github/lib/rules/require-passive-events.js new file mode 100644 index 000000000..72b8a6826 --- /dev/null +++ b/node_modules/eslint-plugin-github/lib/rules/require-passive-events.js @@ -0,0 +1,22 @@ +const passiveEventListenerNames = new Set(['touchstart', 'touchmove', 'wheel', 'mousewheel']) + +const propIsPassiveTrue = prop => prop.key && prop.key.name === 'passive' && prop.value && prop.value.value === true + +module.exports = { + meta: { + docs: {} + }, + + create(context) { + return { + ['CallExpression[callee.property.name="addEventListener"]']: function(node) { + const [name, listener, options] = node.arguments + if (!listener) return + if (name.type !== 'Literal') return + if (!passiveEventListenerNames.has(name.value)) return + if (options && options.type === 'ObjectExpression' && options.properties.some(propIsPassiveTrue)) return + context.report(node, `High Frequency Events like "${name.value}" should be \`passive: true\``) + } + } + } +} diff --git a/node_modules/eslint-plugin-github/lib/rules/unescaped-html-literal.js b/node_modules/eslint-plugin-github/lib/rules/unescaped-html-literal.js new file mode 100644 index 000000000..fc4f6f40c --- /dev/null +++ b/node_modules/eslint-plugin-github/lib/rules/unescaped-html-literal.js @@ -0,0 +1,25 @@ +module.exports = function(context) { + const htmlOpenTag = /^<[a-zA-Z]/ + const message = 'Unescaped HTML literal. Use html`` tag template literal for secure escaping.' + + return { + Literal(node) { + if (!htmlOpenTag.test(node.value)) return + + context.report({ + node, + message + }) + }, + TemplateLiteral(node) { + if (!htmlOpenTag.test(node.quasis[0].value.raw)) return + + if (!node.parent.tag || node.parent.tag.name !== 'html') { + context.report({ + node, + message + }) + } + } + } +} diff --git a/node_modules/eslint-plugin-github/package.json b/node_modules/eslint-plugin-github/package.json new file mode 100644 index 000000000..d30222cfb --- /dev/null +++ b/node_modules/eslint-plugin-github/package.json @@ -0,0 +1,51 @@ +{ + "name": "eslint-plugin-github", + "version": "4.1.1", + "description": "An opinionated collection of ESLint shared configs and rules used by GitHub.", + "main": "lib/index.js", + "entries": [ + "lib/formatters/stylish-fixes.js" + ], + "bin": { + "eslint-ignore-errors": "bin/eslint-ignore-errors.js" + }, + "scripts": { + "pretest": "mkdir -p node_modules/ && ln -fs $(pwd) node_modules/", + "eslint-check": "eslint --print-config .eslintrc.js | eslint-config-prettier-check", + "test": "npm run eslint-check && eslint . && mocha tests/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/github/eslint-plugin-github.git" + }, + "author": "GitHub, Inc.", + "license": "MIT", + "bugs": { + "url": "https://github.com/github/eslint-plugin-github/issues" + }, + "homepage": "https://github.com/github/eslint-plugin-github#readme", + "dependencies": { + "@typescript-eslint/eslint-plugin": ">=2.25.0", + "@typescript-eslint/parser": ">=2.25.0", + "eslint-config-prettier": ">=6.10.1", + "eslint-plugin-eslint-comments": ">=3.0.1", + "eslint-plugin-import": ">=2.20.1", + "eslint-plugin-prettier": ">=3.1.2", + "eslint-rule-documentation": ">=1.0.0", + "prettier": ">=1.12.0", + "svg-element-attributes": ">=1.3.1" + }, + "prettier": "@github/prettier-config", + "peerDependencies": { + "eslint": ">=4.19.0" + }, + "files": [ + "bin/*", + "lib/*" + ], + "devDependencies": { + "@github/prettier-config": "0.0.4", + "eslint": ">=7.0.0", + "mocha": ">=7.1.1" + } +} \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/CHANGELOG.md b/node_modules/eslint-plugin-import/CHANGELOG.md new file mode 100644 index 000000000..c0aaae190 --- /dev/null +++ b/node_modules/eslint-plugin-import/CHANGELOG.md @@ -0,0 +1,1258 @@ +# Change Log + +All notable changes to this project will be documented in this file. +This project adheres to [Semantic Versioning](http://semver.org/). +This change log adheres to standards from [Keep a CHANGELOG](http://keepachangelog.com). + +## [Unreleased] + +## [2.22.0] - 2020-06-26 +### Added +- [`no-unused-modules`]: consider exported TypeScript interfaces, types and enums ([#1819], thanks [@nicolashenry]) +- [`no-cycle`]: allow `maxDepth` option to be `"∞"` (thanks [@ljharb]) + +### Fixed +- [`order`]/TypeScript: properly support `import = object` expressions ([#1823], thanks [@manuth]) +- [`no-extraneous-dependencies`]/TypeScript: do not error when importing type from dev dependencies ([#1820], thanks [@fernandopasik]) +- [`default`]: avoid crash with `export =` ([#1822], thanks [@AndrewLeedham]) +- [`order`]/[`newline-after-import`]: ignore TypeScript's "export import object" ([#1830], thanks [@be5invis]) +- [`dynamic-import-chunkname`]/TypeScript: supports `@typescript-eslint/parser` ([#1833], thanks [@noelebrun]) +- [`order`]/TypeScript: ignore ordering of object imports ([#1831], thanks [@manuth]) +- [`namespace`]: do not report on shadowed import names ([#518], thanks [@ljharb]) +- [`export`]: avoid warning on `export * as` non-conflicts ([#1834], thanks [@ljharb]) + +### Changed +- [`no-extraneous-dependencies`]: add tests for importing types ([#1824], thanks [@taye]) +- [docs] [`no-default-export`]: Fix docs url ([#1836], thanks [@beatrizrezener]) +- [docs] [`imports-first`]: deprecation info and link to `first` docs ([#1835], thanks [@beatrizrezener]) + +## [2.21.2] - 2020-06-09 +### Fixed +- [`order`]: avoid a crash on TypeScript’s `export import` syntax ([#1808], thanks [@ljharb]) +- [`newline-after-import`]: consider TypeScript `import =` syntax' ([#1811], thanks [@ljharb]) +- [`no-internal-modules`]: avoid a crash on a named export declaration ([#1814], thanks [@ljharb]) + +## [2.21.1] - 2020-06-07 +### Fixed +- TypeScript: [`import/named`]: avoid requiring `typescript` when not using TS ([#1805], thanks [@ljharb]) + +## [2.21.0] - 2020-06-07 +### Added +- [`import/default`]: support default export in TSExportAssignment ([#1528], thanks [@joaovieira]) +- [`no-cycle`]: add `ignoreExternal` option ([#1681], thanks [@sveyret]) +- [`order`]: Add support for TypeScript's "import equals"-expressions ([#1785], thanks [@manuth]) +- [`import/default`]: support default export in TSExportAssignment ([#1689], thanks [@Maxim-Mazurok]) +- [`no-restricted-paths`]: add custom message support ([#1802], thanks [@malykhinvi]) + +### Fixed +- [`group-exports`]: Flow type export awareness ([#1702], thanks [@ernestostifano]) +- [`order`]: Recognize pathGroup config for first group ([#1719], [#1724], thanks [@forivall], [@xpl]) +- [`no-unused-modules`]: Fix re-export not counting as usage when used in combination with import ([#1722], thanks [@Ephem]) +- [`no-duplicates`]: Handle TS import type ([#1676], thanks [@kmui2]) +- [`newline-after-import`]: recognize decorators ([#1139], thanks [@atos1990]) +- [`no-unused-modules`]: Revert "[flow] `no-unused-modules`: add flow type support" ([#1770], thanks [@Hypnosphi]) +- TypeScript: Add nested namespace handling ([#1763], thanks [@julien1619]) +- [`namespace`]/`ExportMap`: Fix interface declarations for TypeScript ([#1764], thanks [@julien1619]) +- [`no-unused-modules`]: avoid order-dependence ([#1744], thanks [@darkartur]) +- [`no-internal-modules`]: also check `export from` syntax ([#1691], thanks [@adjerbetian]) +- TypeScript: [`export`]: avoid a crash with `export =` ([#1801], thanks [@ljharb]) + +### Changed +- [Refactor] `no-extraneous-dependencies`: use moduleVisitor ([#1735], thanks [@adamborowski]) +- TypeScript config: Disable [`named`][] ([#1726], thanks [@astorije]) +- [readme] Remove duplicate no-unused-modules from docs ([#1690], thanks [@arvigeus]) +- [Docs] `order`: fix bad inline config ([#1788], thanks [@nickofthyme]) +- [Tests] Add fix for Windows Subsystem for Linux ([#1786], thanks [@manuth]) +- [Docs] `no-unused-rules`: Fix docs for unused exports ([#1776], thanks [@barbogast]) +- [eslint] bump minimum v7 version to v7.2.0 + +## [2.20.2] - 2020-03-28 +### Fixed +- [`order`]: fix `isExternalModule` detect on windows ([#1651], thanks [@fisker]) +- [`order`]: recognize ".." as a "parent" path ([#1658], thanks [@golopot]) +- [`no-duplicates`]: fix fixer on cases with default import ([#1666], thanks [@golopot]) +- [`no-unused-modules`]: Handle `export { default } from` syntax ([#1631], thanks [@richardxia]) +- [`first`]: Add a way to disable `absolute-first` explicitly ([#1664], thanks [@TheCrueltySage]) +- [Docs] `no-webpack-loader-syntax`: Updates webpack URLs ([#1751], thanks [@MikeyBeLike]) + +## [2.20.1] - 2020-02-01 +### Fixed +- [`export`]: Handle function overloading in `*.d.ts` ([#1619], thanks [@IvanGoncharov]) +- [`no-absolute-path`]: fix a crash with invalid import syntax ([#1616], thanks [@ljharb]) +- [`import/external-module-folders` setting] now correctly works with directories containing modules symlinked from `node_modules` ([#1605], thanks [@skozin]) +- [`extensions`]: for invalid code where `name` does not exist, do not crash ([#1613], thanks [@ljharb]) +- [`extensions`]: Fix scope regex ([#1611], thanks [@yordis]) +- [`no-duplicates`]: allow duplicate imports if one is a namespace and the other not ([#1612], thanks [@sveyret]) +- Add some missing rule meta schemas and types ([#1620], thanks [@bmish]) +- [`named`]: for importing from a module which re-exports named exports from a `node_modules` module ([#1569], [#1447], thanks [@redbugz], [@kentcdodds]) +- [`order`]: Fix alphabetize for mixed requires and imports ([#5625], thanks [@wschurman]) + +### Changed +- [`import/external-module-folders` setting] behavior is more strict now: it will only match complete path segments ([#1605], thanks [@skozin]) +- [meta] fix "files" field to include/exclude the proper files ([#1635], thanks [@ljharb]) +- [Tests] `order`: Add TS import type tests ([#1736], thanks [@kmui2]) + +## [2.20.0] - 2020-01-10 +### Added +- [`order`]: added `caseInsensitive` as an additional option to `alphabetize` ([#1586], thanks [@dbrewer5]) +- [`no-restricted-paths`]: New `except` option per `zone`, allowing exceptions to be defined for a restricted zone ([#1238], thanks [@rsolomon]) +- [`order`]: add option pathGroupsExcludedImportTypes to allow ordering of external import types ([#1565], thanks [@Mairu]) + +### Fixed +- [`no-unused-modules`]: fix usage of `import/extensions` settings ([#1560], thanks [@stekycz]) +- [`extensions`]: ignore non-main modules ([#1563], thanks [@saschanaz]) +- TypeScript config: lookup for external modules in @types folder ([#1526], thanks [@joaovieira]) +- [`no-extraneous-dependencies`]: ensure `node.source` is truthy ([#1589], thanks [@ljharb]) +- [`extensions`]: Ignore query strings when checking for extensions ([#1572], thanks [@pcorpet]) + +### Docs +- [`extensions`]: improve `ignorePackages` docs ([#1248], thanks [@ivo-stefchev]) + +## [2.19.1] - 2019-12-08 +### Fixed +- [`no-extraneous-dependencies`]: ensure `node.source` exists + +## [2.19.0] - 2019-12-08 +### Added +- [`internal-regex` setting]: regex pattern for marking packages "internal" ([#1491], thanks [@Librazy]) +- [`group-exports`]: make aggregate module exports valid ([#1472], thanks [@atikenny]) +- [`no-namespace`]: Make rule fixable ([#1401], thanks [@TrevorBurnham]) +- support `parseForESLint` from custom parser ([#1435], thanks [@JounQin]) +- [`no-extraneous-dependencies`]: Implement support for [bundledDependencies](https://npm.github.io/using-pkgs-docs/package-json/types/bundleddependencies.html) ([#1436], thanks [@schmidsi])) +- [`no-unused-modules`]: add flow type support ([#1542], thanks [@rfermann]) +- [`order`]: Adds support for pathGroups to allow ordering by defined patterns ([#795], [#1386], thanks [@Mairu]) +- [`no-duplicates`]: Add `considerQueryString` option : allow duplicate imports with different query strings ([#1107], thanks [@pcorpet]). +- [`order`]: Add support for alphabetical sorting of import paths within import groups ([#1360], [#1105], [#629], thanks [@duncanbeevers], [@stropho], [@luczsoma], [@randallreedjr]) +- [`no-commonjs`]: add `allowConditionalRequire` option ([#1439], thanks [@Pessimistress]) + +### Fixed +- [`default`]: make error message less confusing ([#1470], thanks [@golopot]) +- Improve performance of `ExportMap.for` by only loading paths when necessary. ([#1519], thanks [@brendo]) +- Support export of a merged TypeScript namespace declaration ([#1495], thanks [@benmunro]) +- [`order`]: fix autofix to not move imports across fn calls ([#1253], thanks [@tihonove]) +- [`prefer-default-export`]: fix false positive with type export ([#1506], thanks [@golopot]) +- [`extensions`]: Fix `ignorePackages` to produce errors ([#1521], thanks [@saschanaz]) +- [`no-unused-modules`]: fix crash due to `export *` ([#1496], thanks [@Taranys]) +- [`no-cycle`]: should not warn for Flow imports ([#1494], thanks [@maxmalov]) +- [`order`]: fix `@someModule` considered as `unknown` instead of `internal` ([#1493], thanks [@aamulumi]) +- [`no-extraneous-dependencies`]: Check `export from` ([#1049], thanks [@marcusdarmstrong]) + +### Docs +- [`no-useless-path-segments`]: add docs for option `commonjs` ([#1507], thanks [@golopot]) + +### Changed +- [`no-unused-modules`]/`eslint-module-utils`: Avoid superfluous calls and code ([#1551], thanks [@brettz9]) + +## [2.18.2] - 2019-07-19 +### Fixed +- Skip warning on type interfaces ([#1425], thanks [@lencioni]) + +## [2.18.1] - 2019-07-18 +### Fixed +- Improve parse perf when using `@typescript-eslint/parser` ([#1409], thanks [@bradzacher]) +- [`prefer-default-export`]: don't warn on TypeAlias & TSTypeAliasDeclaration ([#1377], thanks [@sharmilajesupaul]) +- [`no-unused-modules`]: Exclude package "main"/"bin"/"browser" entry points ([#1404], thanks [@rfermann]) +- [`export`]: false positive for TypeScript overloads ([#1412], thanks [@golopot]) + +### Refactors +- [`no-extraneous-dependencies`], `importType`: remove lodash ([#1419], thanks [@ljharb]) + +## [2.18.0] - 2019-06-24 +### Added +- Support eslint v6 ([#1393], thanks [@sheepsteak]) +- [`order`]: Adds support for correctly sorting unknown types into a single group ([#1375], thanks [@swernerx]) +- [`order`]: add fixer for destructuring commonjs import ([#1372], thanks [@golopot]) +- TypeScript config: add TS def extensions + defer to TS over JS ([#1366], thanks [@benmosher]) + +### Fixed +- [`no-unused-modules`]: handle ClassDeclaration ([#1371], thanks [@golopot]) + +### Docs +- [`no-cycle`]: split code examples so file separation is obvious ([#1370], thanks [@alex-page]) +- [`no-named-as-default-member`]: update broken link ([#1389], thanks [@fooloomanzoo]) + +## [2.17.3] - 2019-05-23 +### Fixed +- [`no-common-js`]: Also throw an error when assigning ([#1354], thanks [@charlessuh]) +- [`no-unused-modules`]: don't crash when lint file outside src-folder ([#1347], thanks [@rfermann]) +- [`no-unused-modules`]: make `import { name as otherName }` work ([#1340], [#1342], thanks [@rfermann]) +- [`no-unused-modules`]: make appveyor tests passing ([#1333], thanks [@rfermann]) +- [`named`]: ignore Flow `typeof` imports and `type` exports ([#1345], thanks [@loganfsmyth]) +- [refactor] fix eslint 6 compat by fixing imports (thank [@ljharb]) +- Improve support for TypeScript declare structures ([#1356], thanks [@christophercurrie]) + +### Docs +- add missing `no-unused-modules` in README ([#1358], thanks [@golopot]) +- [`no-unused-modules`]: Indicates usage, plugin defaults to no-op, and add description to main README.md ([#1352], thanks [@johndevedu]) +- Document `env` option for `eslint-import-resolver-webpack` ([#1363], thanks [@kgregory]) + +## [2.17.2] - 2019-04-16 +### Fixed +- [`no-unused-modules`]: avoid crash when using `ignoreExports`-option ([#1331], [#1323], thanks [@rfermann]) +- [`no-unused-modules`]: make sure that rule with no options will not fail ([#1330], [#1334], thanks [@kiwka]) + +## [2.17.1] - 2019-04-13 +### Fixed +- require v2.4 of `eslint-module-utils` ([#1322]) + +## [2.17.0] - 2019-04-13 +### Added +- [`no-useless-path-segments`]: Add `noUselessIndex` option ([#1290], thanks [@timkraut]) +- [`no-duplicates`]: Add autofix ([#1312], thanks [@lydell]) +- Add [`no-unused-modules`] rule ([#1142], thanks [@rfermann]) +- support export type named exports from TypeScript ([#1304], thanks [@bradennapier] and [@schmod]) + +### Fixed +- [`order`]: Fix interpreting some external modules being interpreted as internal modules ([#793], [#794] thanks [@ephys]) +- allow aliases that start with @ to be "internal" ([#1293], [#1294], thanks [@jeffshaver]) +- aliased internal modules that look like core modules ([#1297], thanks [@echenley]) +- [`namespace`]: add check for null ExportMap ([#1235], [#1144], thanks [@ljqx]) +- [ExportMap] fix condition for checking if block comment ([#1234], [#1233], thanks [@ljqx]) +- Fix overwriting of dynamic import() CallExpression ([`no-cycle`], [`no-relative-parent-import`], [`no-unresolved`], [`no-useless-path-segments`]) ([#1218], [#1166], [#1035], thanks [@vikr01]) +- [`export`]: false positives for TypeScript type + value export ([#1319], thanks [@bradzacher]) +- [`export`]: Support TypeScript namespaces ([#1320], [#1300], thanks [@bradzacher]) + +### Docs +- Update readme for TypeScript ([#1256], [#1277], thanks [@kirill-konshin]) +- make rule names consistent ([#1112], thanks [@feychenie]) + +### Tests +- fix broken tests on master ([#1295], thanks [@jeffshaver] and [@ljharb]) +- [`no-commonjs`]: add tests that show corner cases ([#1308], thanks [@TakeScoop]) + +## [2.16.0] - 2019-01-29 +### Added +- `typescript` config ([#1257], thanks [@kirill-konshin]) + +### Fixed +- Memory leak of `SourceCode` objects for all parsed dependencies, resolved. (issue [#1266], thanks [@asapach] and [@sergei-startsev] for digging in) + +## [2.15.0] - 2019-01-22 +### Added +- new rule: [`no-named-export`] ([#1157], thanks [@fsmaia]) + +### Fixed +- [`no-extraneous-dependencies`]: `packageDir` option with array value was clobbering package deps instead of merging them ([#1175]/[#1176], thanks [@aravindet] & [@pzhine]) +- [`dynamic-import-chunkname`]: Add proper webpack comment parsing ([#1163], thanks [@st-sloth]) +- [`named`]: fix destructuring assignment ([#1232], thanks [@ljqx]) + +## [2.14.0] - 2018-08-13 +### Added +- [`no-useless-path-segments`]: add commonJS (CJS) support ([#1128], thanks [@1pete]) +- [`namespace`]: add JSX check ([#1151], thanks [@jf248]) + +### Fixed +- [`no-cycle`]: ignore Flow imports ([#1126], thanks [@gajus]) +- fix Flow type imports ([#1106], thanks [@syymza]) +- [`no-relative-parent-imports`]: resolve paths ([#1135], thanks [@chrislloyd]) +- [`order`]: fix autofixer when using typescript-eslint-parser ([#1137], thanks [@justinanastos]) +- repeat fix from [#797] for [#717], in another place (thanks [@ljharb]) + +### Refactors +- add explicit support for RestElement alongside ExperimentalRestProperty (thanks [@ljharb]) + +## [2.13.0] - 2018-06-24 +### Added +- Add ESLint 5 support ([#1122], thanks [@ai] and [@ljharb]) +- Add [`no-relative-parent-imports`] rule: disallow relative imports from parent directories ([#1093], thanks [@chrislloyd]) + +### Fixed +- `namespace` rule: ensure it works in eslint 5/ecmaVersion 2018 (thanks [@ljharb]) + +## [2.12.0] - 2018-05-17 +### Added +- Ignore type imports for [`named`] rule ([#931], thanks [@mattijsbliek]) +- Add documentation for [`no-useless-path-segments`] rule ([#1068], thanks [@manovotny]) +- `packageDir` option for [`no-extraneous-dependencies`] can be array-valued ([#1085], thanks [@hulkish]) + +## [2.11.0] - 2018-04-09 +### Added +- Fixer for [`first`] ([#1046], thanks [@fengkfengk]) +- `allow-require` option for [`no-commonjs`] rule ([#880], thanks [@futpib]) + +### Fixed +- memory/CPU regression where ASTs were held in memory ([#1058], thanks [@klimashkin]/[@lukeapage]) + +## [2.10.0] - 2018-03-29 +### Added +- Autofixer for [`order`] rule ([#908], thanks [@tihonove]) +- Add [`no-cycle`] rule: reports import cycles. + +## [2.9.0] - 2018-02-21 +### Added +- Add [`group-exports`] rule: style-guide rule to report use of multiple named exports ([#721], thanks [@robertrossmann]) +- Add [`no-self-import`] rule: forbids a module from importing itself. ([#727], [#449], [#447], thanks [@giodamelio]). +- Add [`no-default-export`] rule ([#889], thanks [@isiahmeadows]) +- Add [`no-useless-path-segments`] rule ([#912], thanks [@graingert] and [@danny-andrews]) +- ... and more! check the commits for v[2.9.0] + +## [2.8.0] - 2017-10-18 +### Added +- [`exports-last`] rule ([#620] + [#632], thanks [@k15a]) + +### Changed +- Case-sensitivity checking ignores working directory and ancestors. ([#720] + [#858], thanks [@laysent]) + +### Fixed +- support scoped modules containing hyphens ([#744], thanks [@rosswarren]) +- core-modules now resolves files inside declared modules ([#886] / [#891], thanks [@mplewis]) +- TypeError for missing AST fields from TypeScript ([#842] / [#944], thanks [@alexgorbatchev]) + +## [2.7.0] - 2017-07-06 +### Changed +- [`no-absolute-path`] picks up speed boost, optional AMD support ([#843], thanks [@jseminck]) + +## [2.6.1] - 2017-06-29 +### Fixed +- update bundled node resolver dependency to latest version + +## [2.6.0] - 2017-06-23 +### Changed +- update tests / peerDeps for ESLint 4.0 compatibility ([#871], thanks [@mastilver]) +- [`memo-parser`] updated to require `filePath` on parser options as it melts + down if it's not there, now that this plugin always provides it. (see [#863]) + +## [2.5.0] - 2017-06-22 + +Re-releasing v[2.4.0] after discovering that the memory leak is isolated to the [`memo-parser`], +which is more or less experimental anyway. + +### Added +- Autofixer for newline-after-import. ([#686] + [#696], thanks [@eelyafi]) + +## [2.4.0] - 2017-06-02 [YANKED] + +Yanked due to critical issue in eslint-module-utils with cache key resulting from [#839]. + +### Added +- Add `filePath` into `parserOptions` passed to `parser` ([#839], thanks [@sompylasar]) +- Add `allow` option to [`no-unassigned-import`] to allow for files that match the globs ([#671], [#737], thanks [@kevin940726]). + +## [2.3.0] - 2017-05-18 +### Added +- [`no-anonymous-default-export`] rule: report anonymous default exports ([#712], thanks [@duncanbeevers]). +- Add new value to [`order`]'s `newlines-between` option to allow newlines inside import groups ([#627], [#628], thanks [@giodamelio]) +- Add `count` option to the [`newline-after-import`] rule to allow configuration of number of newlines expected ([#742], thanks [@ntdb]) + +### Changed +- [`no-extraneous-dependencies`]: use `read-pkg-up` to simplify finding + loading `package.json` ([#680], thanks [@wtgtybhertgeghgtwtg]) +- Add support to specify the package.json [`no-extraneous-dependencies`] ([#685], thanks [@ramasilveyra]) + +### Fixed +- attempt to fix crash in [`no-mutable-exports`]. ([#660]) +- "default is a reserved keyword" in no-maned-default tests by locking down babylon to 6.15.0 (#756, thanks @gmathieu) +- support scoped modules containing non word characters + + +## [2.2.0] - 2016-11-07 +### Fixed +- Corrected a few gaffs in the auto-ignore logic to fix major performance issues + with projects that did not explicitly ignore `node_modules`. ([#654]) +- [`import/ignore` setting] was only being respected if the ignored module didn't start with + an `import` or `export` JS statement +- [`prefer-default-export`]: fixed crash on export extensions ([#653]) + +## [2.1.0] - 2016-11-02 +### Added +- Add [`no-named-default`] rule: style-guide rule to report use of unnecessarily named default imports ([#596], thanks [@ntdb]) +- [`no-extraneous-dependencies`]: check globs against CWD + absolute path ([#602] + [#630], thanks [@ljharb]) + +### Fixed +- [`prefer-default-export`] handles flow `export type` ([#484] + [#639], thanks [@jakubsta]) +- [`prefer-default-export`] handles re-exported default exports ([#609]) +- Fix crash when using [`newline-after-import`] with decorators ([#592]) +- Properly report [`newline-after-import`] when next line is a decorator +- Fixed documentation for the default values for the [`order`] rule ([#601]) + +## [2.0.1] - 2016-10-06 +### Fixed +- Fixed code that relied on removed dependencies. ([#604]) + +## [2.0.0]! - 2016-09-30 +### Added +- [`unambiguous`] rule: report modules that are not unambiguously ES modules. +- `recommended` shared config. Roughly `errors` and `warnings` mixed together, + with some `parserOptions` in the mix. ([#402]) +- `react` shared config: added `jsx: true` to `parserOptions.ecmaFeatures`. +- Added [`no-webpack-loader-syntax`] rule: forbid custom Webpack loader syntax in imports. ([#586], thanks [@fson]!) +- Add option `newlines-between: "ignore"` to [`order`] ([#519]) +- Added [`no-unassigned-import`] rule ([#529]) + +### Breaking +- [`import/extensions` setting] defaults to `['.js']`. ([#306]) +- [`import/ignore` setting] defaults to nothing, and ambiguous modules are ignored natively. This means importing from CommonJS modules will no longer be reported by [`default`], [`named`], or [`namespace`], regardless of `import/ignore`. ([#270]) +- [`newline-after-import`]: Removed need for an empty line after an inline `require` call ([#570]) +- [`order`]: Default value for `newlines-between` option is now `ignore` ([#519]) + +### Changed +- `imports-first` is renamed to [`first`]. `imports-first` alias will continue to + exist, but may be removed in a future major release. +- Case-sensitivity: now specifically (and optionally) reported by [`no-unresolved`]. + Other rules will ignore case-mismatches on paths on case-insensitive filesystems. ([#311]) + +### Fixed +- [`no-internal-modules`]: support `@`-scoped packages ([#577]+[#578], thanks [@spalger]) + +## [1.16.0] - 2016-09-22 +### Added +- Added [`no-dynamic-require`] rule: forbid `require()` calls with expressions. ([#567], [#568]) +- Added [`no-internal-modules`] rule: restrict deep package imports to specific folders. ([#485], thanks [@spalger]!) +- [`extensions`]: allow override of a chosen default with options object ([#555], thanks [@ljharb]!) + +### Fixed +- [`no-named-as-default`] no longer false-positives on `export default from '...'` ([#566], thanks [@preco21]) +- [`default`]: allow re-export of values from ignored files as default ([#545], thanks [@skyrpex]) + +## [1.15.0] - 2016-09-12 +### Added +- Added an `allow` option to [`no-nodejs-modules`] to allow exceptions ([#452], [#509]). +- Added [`no-absolute-path`] rule ([#530], [#538]) +- [`max-dependencies`] for specifying the maximum number of dependencies (both `import` and `require`) a module can have. (see [#489], thanks [@tizmagik]) +- Added glob option to config for [`no-extraneous-dependencies`], after much bikeshedding. Thanks, [@knpwrs]! ([#527]) + +### Fixed +- [`no-named-as-default-member`] Allow default import to have a property named "default" ([#507], [#508], thanks [@jquense] for both!) + +## [1.14.0] - 2016-08-22 +### Added +- [`import/parsers` setting]: parse some dependencies (i.e. TypeScript!) with a different parser than the ESLint-configured parser. ([#503]) + +### Fixed +- [`namespace`] exception for get property from `namespace` import, which are re-export from commonjs module ([#499] fixes [#416], thanks [@wKich]) + +## [1.13.0] - 2016-08-11 +### Added +- `allowComputed` option for [`namespace`] rule. If set to `true`, won't report + computed member references to namespaces. (see [#456]) + +### Changed +- Modified [`no-nodejs-modules`] error message to include the module's name ([#453], [#461]) + +### Fixed +- [`import/extensions` setting] is respected in spite of the appearance of imports + in an imported file. (fixes [#478], thanks [@rhys-vdw]) + +## [1.12.0] - 2016-07-26 +### Added +- [`import/external-module-folders` setting]: a possibility to configure folders for "external" modules ([#444], thanks [@zloirock]) + +## [1.11.1] - 2016-07-20 +### Fixed +- [`newline-after-import`] exception for `switch` branches with `require`s iff parsed as `sourceType:'module'`. + (still [#441], thanks again [@ljharb]) + +## [1.11.0] - 2016-07-17 +### Added +- Added an `peerDependencies` option to [`no-extraneous-dependencies`] to allow/forbid peer dependencies ([#423], [#428], thanks [@jfmengels]!). + +### Fixed +- [`newline-after-import`] exception for multiple `require`s in an arrow + function expression (e.g. `() => require('a') || require('b')`). ([#441], thanks [@ljharb]) + +## [1.10.3] - 2016-07-08 +### Fixed +- removing `Symbol` dependencies (i.e. `for-of` loops) due to Node 0.10 polyfill + issue (see [#415]). Should not make any discernible semantic difference. + +## [1.10.2] - 2016-07-04 +### Fixed +- Something horrible happened during `npm prepublish` of 1.10.1. + Several `rm -rf node_modules && npm i` and `gulp clean && npm prepublish`s later, it is rebuilt and republished as 1.10.2. Thanks [@rhettlivingston] for noticing and reporting! + +## [1.10.1] - 2016-07-02 [YANKED] +### Added +- Officially support ESLint 3.x. (peerDependencies updated to `2.x - 3.x`) + +## [1.10.0] - 2016-06-30 +### Added +- Added new rule [`no-restricted-paths`]. ([#155]/[#371], thanks [@lo1tuma]) +- [`import/core-modules` setting]: allow configuration of additional module names, + to be treated as builtin modules (a la `path`, etc. in Node). ([#275] + [#365], thanks [@sindresorhus] for driving) +- React Native shared config (based on comment from [#283]) + +### Fixed +- Fixed crash with `newline-after-import` related to the use of switch cases. (fixes [#386], thanks [@ljharb] for reporting) ([#395]) + +## [1.9.2] - 2016-06-21 +### Fixed +- Issues with ignored/CJS files in [`export`] and [`no-deprecated`] rules. ([#348], [#370]) + +## [1.9.1] - 2016-06-16 +### Fixed +- Reordered precedence for loading resolvers. ([#373]) + +## [1.9.0] - 2016-06-10 +### Added +- Added support TomDoc comments to [`no-deprecated`]. ([#321], thanks [@josh]) +- Added support for loading custom resolvers ([#314], thanks [@le0nik]) + +### Fixed +- [`prefer-default-export`] handles `export function` and `export const` in same file ([#359], thanks [@scottnonnenberg]) + +## [1.8.1] - 2016-05-23 +### Fixed +- `export * from 'foo'` now properly ignores a `default` export from `foo`, if any. ([#328]/[#332], thanks [@jkimbo]) + This impacts all static analysis of imported names. ([`default`], [`named`], [`namespace`], [`export`]) +- Make [`order`]'s `newline-between` option handle multiline import statements ([#313], thanks [@singles]) +- Make [`order`]'s `newline-between` option handle not assigned import statements ([#313], thanks [@singles]) +- Make [`order`]'s `newline-between` option ignore `require` statements inside object literals ([#313], thanks [@singles]) +- [`prefer-default-export`] properly handles deep destructuring, `export * from ...`, and files with no exports. ([#342]+[#343], thanks [@scottnonnenberg]) + +## [1.8.0] - 2016-05-11 +### Added +- [`prefer-default-export`], new rule. ([#308], thanks [@gavriguy]) + +### Fixed +- Ignore namespace / ES7 re-exports in [`no-mutable-exports`]. ([#317], fixed by [#322]. thanks [@borisyankov] + [@jfmengels]) +- Make [`no-extraneous-dependencies`] handle scoped packages ([#316], thanks [@jfmengels]) + +## [1.7.0] - 2016-05-06 +### Added +- [`newline-after-import`], new rule. ([#245], thanks [@singles]) +- Added an `optionalDependencies` option to [`no-extraneous-dependencies`] to allow/forbid optional dependencies ([#266], thanks [@jfmengels]). +- Added `newlines-between` option to [`order`] rule ([#298], thanks [@singles]) +- add [`no-mutable-exports`] rule ([#290], thanks [@josh]) +- [`import/extensions` setting]: a list of file extensions to parse as modules + and search for `export`s. If unspecified, all extensions are considered valid (for now). + In v2, this will likely default to `['.js', MODULE_EXT]`. ([#297], to fix [#267]) + +### Fixed +- [`extensions`]: fallback to source path for extension enforcement if imported + module is not resolved. Also, never report for builtins (i.e. `path`). ([#296]) + +## [1.6.1] - 2016-04-28 +### Fixed +- [`no-named-as-default-member`]: don't crash on rest props. ([#281], thanks [@SimenB]) +- support for Node 6: don't pass `null` to `path` functions. + Thanks to [@strawbrary] for bringing this up ([#272]) and adding OSX support to the Travis + config ([#288]). + +## [1.6.0] - 2016-04-25 +### Added +- add [`no-named-as-default-member`] to `warnings` canned config +- add [`no-extraneous-dependencies`] rule ([#241], thanks [@jfmengels]) +- add [`extensions`] rule ([#250], thanks [@lo1tuma]) +- add [`no-nodejs-modules`] rule ([#261], thanks [@jfmengels]) +- add [`order`] rule ([#247], thanks [@jfmengels]) +- consider `resolve.fallback` config option in the webpack resolver ([#254]) + +### Changed +- [`imports-first`] now allows directives (i.e. `'use strict'`) strictly before + any imports ([#256], thanks [@lemonmade]) + +### Fixed +- [`named`] now properly ignores the source module if a name is re-exported from + an ignored file (i.e. `node_modules`). Also improved the reported error. (thanks to [@jimbolla] for reporting) +- [`no-named-as-default-member`] had a crash on destructuring in loops (thanks for heads up from [@lemonmade]) + +## [1.5.0] - 2016-04-18 +### Added +- report resolver errors at the top of the linted file +- add [`no-namespace`] rule ([#239], thanks [@singles]) +- add [`no-named-as-default-member`] rule ([#243], thanks [@dmnd]) + +### Changed +- Rearranged rule groups in README in preparation for more style guide rules + +### Removed +- support for Node 0.10, via `es6-*` ponyfills. Using native Map/Set/Symbol. + +## [1.4.0] - 2016-03-25 +### Added +- Resolver plugin interface v2: more explicit response format that more clearly covers the found-but-core-module case, where there is no path. + Still backwards-compatible with the original version of the resolver spec. +- [Resolver documentation](./resolvers/README.md) + +### Changed +- using `package.json/files` instead of `.npmignore` for package file inclusion ([#228], thanks [@mathieudutour]) +- using `es6-*` ponyfills instead of `babel-runtime` + +## [1.3.0] - 2016-03-20 +Major perf improvements. Between parsing only once and ignoring gigantic, non-module `node_modules`, +there is very little added time. + +My test project takes 17s to lint completely, down from 55s, when using the +memoizing parser, and takes only 27s with naked `babel-eslint` (thus, reparsing local modules). + +### Added +- This change log ([#216]) +- Experimental memoizing [parser](./memo-parser/README.md) + +### Fixed +- Huge reduction in execution time by _only_ ignoring [`import/ignore` setting] if + something that looks like an `export` is detected in the module content. + +## [1.2.0] - 2016-03-19 +Thanks [@lencioni] for identifying a huge amount of rework in resolve and kicking +off a bunch of memoization. + +I'm seeing 62% improvement over my normal test codebase when executing only +[`no-unresolved`] in isolation, and ~35% total reduction in lint time. + +### Changed +- added caching to core/resolve via [#214], configured via [`import/cache` setting] + +## [1.1.0] - 2016-03-15 +### Added +- Added an [`ignore`](./docs/rules/no-unresolved.md#ignore) option to [`no-unresolved`] for those pesky files that no resolver can find. (still prefer enhancing the Webpack and Node resolvers to using it, though). See [#89] for details. + +## [1.0.4] - 2016-03-11 + +### Changed +- respect hoisting for deep namespaces ([`namespace`]/[`no-deprecated`]) ([#211]) + +### Fixed +- don't crash on self references ([#210]) +- correct cache behavior in `eslint_d` for deep namespaces ([#200]) + +## [1.0.3] - 2016-02-26 + +### Changed +- no-deprecated follows deep namespaces ([#191]) + +### Fixed +- [`namespace`] no longer flags modules with only a default export as having no names. (ns.default is valid ES6) + +## [1.0.2] - 2016-02-26 + +### Fixed +- don't parse imports with no specifiers ([#192]) + +## [1.0.1] - 2016-02-25 + +### Fixed +- export `stage-0` shared config +- documented [`no-deprecated`] +- deep namespaces are traversed regardless of how they get imported ([#189]) + +## [1.0.0] - 2016-02-24 + +### Added +- [`no-deprecated`]: WIP rule to let you know at lint time if you're using deprecated functions, constants, classes, or modules. + +### Changed +- [`namespace`]: support deep namespaces ([#119] via [#157]) + +## [1.0.0-beta.0] - 2016-02-13 + +### Changed +- support for (only) ESLint 2.x +- no longer needs/refers to `import/parser` or `import/parse-options`. Instead, ESLint provides the configured parser + options to the rules, and they use that to parse dependencies. + +### Removed + +- `babylon` as default import parser (see Breaking) + +## [0.13.0] - 2016-02-08 +### Added +- [`no-commonjs`] rule +- [`no-amd`] rule + +### Removed +- Removed vestigial `no-require` rule. [`no-commonjs`] is more complete. + +## [0.12.2] - 2016-02-06 [YANKED] +Unpublished from npm and re-released as 0.13.0. See [#170]. + +## [0.12.1] - 2015-12-17 +### Changed +- Broke docs for rules out into individual files. + +## [0.12.0] - 2015-12-14 +### Changed +- Ignore [`import/ignore` setting] if exports are actually found in the parsed module. Does this to support use of `jsnext:main` in `node_modules` without the pain of managing an allow list or a nuanced deny list. + +## [0.11.0] - 2015-11-27 +### Added +- Resolver plugins. Now the linter can read Webpack config, properly follow aliases and ignore externals, dismisses inline loaders, etc. etc.! + +## Earlier releases (0.10.1 and younger) +See [GitHub release notes](https://github.com/benmosher/eslint-plugin-import/releases?after=v0.11.0) +for info on changes for earlier releases. + + +[`import/cache` setting]: ./README.md#importcache +[`import/ignore` setting]: ./README.md#importignore +[`import/extensions` setting]: ./README.md#importextensions +[`import/parsers` setting]: ./README.md#importparsers +[`import/core-modules` setting]: ./README.md#importcore-modules +[`import/external-module-folders` setting]: ./README.md#importexternal-module-folders +[`internal-regex` setting]: ./README.md#importinternal-regex + +[`default`]: ./docs/rules/default.md +[`dynamic-import-chunkname`]: ./docs/rules/dynamic-import-chunkname.md +[`export`]: ./docs/rules/export.md +[`exports-last`]: ./docs/rules/exports-last.md +[`extensions`]: ./docs/rules/extensions.md +[`first`]: ./docs/rules/first.md +[`group-exports`]: ./docs/rules/group-exports.md +[`imports-first`]: ./docs/rules/first.md +[`max-dependencies`]: ./docs/rules/max-dependencies.md +[`named`]: ./docs/rules/named.md +[`namespace`]: ./docs/rules/namespace.md +[`newline-after-import`]: ./docs/rules/newline-after-import.md +[`no-absolute-path`]: ./docs/rules/no-absolute-path.md +[`no-amd`]: ./docs/rules/no-amd.md +[`no-anonymous-default-export`]: ./docs/rules/no-anonymous-default-export.md +[`no-commonjs`]: ./docs/rules/no-commonjs.md +[`no-cycle`]: ./docs/rules/no-cycle.md +[`no-default-export`]: ./docs/rules/no-default-export.md +[`no-deprecated`]: ./docs/rules/no-deprecated.md +[`no-duplicates`]: ./docs/rules/no-duplicates.md +[`no-dynamic-require`]: ./docs/rules/no-dynamic-require.md +[`no-extraneous-dependencies`]: ./docs/rules/no-extraneous-dependencies.md +[`no-internal-modules`]: ./docs/rules/no-internal-modules.md +[`no-mutable-exports`]: ./docs/rules/no-mutable-exports.md +[`no-named-as-default-member`]: ./docs/rules/no-named-as-default-member.md +[`no-named-as-default`]: ./docs/rules/no-named-as-default.md +[`no-named-default`]: ./docs/rules/no-named-default.md +[`no-named-export`]: ./docs/rules/no-named-export.md +[`no-namespace`]: ./docs/rules/no-namespace.md +[`no-nodejs-modules`]: ./docs/rules/no-nodejs-modules.md +[`no-restricted-paths`]: ./docs/rules/no-restricted-paths.md +[`no-self-import`]: ./docs/rules/no-self-import.md +[`no-unassigned-import`]: ./docs/rules/no-unassigned-import.md +[`no-unresolved`]: ./docs/rules/no-unresolved.md +[`no-unused-modules`]: ./docs/rules/no-unused-modules.md +[`no-useless-path-segments`]: ./docs/rules/no-useless-path-segments.md +[`no-webpack-loader-syntax`]: ./docs/rules/no-webpack-loader-syntax.md +[`order`]: ./docs/rules/order.md +[`prefer-default-export`]: ./docs/rules/prefer-default-export.md +[`unambiguous`]: ./docs/rules/unambiguous.md + +[`memo-parser`]: ./memo-parser/README.md + +[#1836]: https://github.com/benmosher/eslint-plugin-import/pull/1836 +[#1835]: https://github.com/benmosher/eslint-plugin-import/pull/1835 +[#1834]: https://github.com/benmosher/eslint-plugin-import/issues/1834 +[#1833]: https://github.com/benmosher/eslint-plugin-import/pull/1833 +[#1831]: https://github.com/benmosher/eslint-plugin-import/pull/1831 +[#1830]: https://github.com/benmosher/eslint-plugin-import/pull/1830 +[#1824]: https://github.com/benmosher/eslint-plugin-import/pull/1824 +[#1823]: https://github.com/benmosher/eslint-plugin-import/pull/1823 +[#1822]: https://github.com/benmosher/eslint-plugin-import/pull/1822 +[#1820]: https://github.com/benmosher/eslint-plugin-import/pull/1820 +[#1819]: https://github.com/benmosher/eslint-plugin-import/pull/1819 +[#1802]: https://github.com/benmosher/eslint-plugin-import/pull/1802 +[#1801]: https://github.com/benmosher/eslint-plugin-import/issues/1801 +[#1788]: https://github.com/benmosher/eslint-plugin-import/pull/1788 +[#1786]: https://github.com/benmosher/eslint-plugin-import/pull/1786 +[#1785]: https://github.com/benmosher/eslint-plugin-import/pull/1785 +[#1776]: https://github.com/benmosher/eslint-plugin-import/pull/1776 +[#1770]: https://github.com/benmosher/eslint-plugin-import/pull/1770 +[#1764]: https://github.com/benmosher/eslint-plugin-import/pull/1764 +[#1763]: https://github.com/benmosher/eslint-plugin-import/pull/1763 +[#1751]: https://github.com/benmosher/eslint-plugin-import/pull/1751 +[#1744]: https://github.com/benmosher/eslint-plugin-import/pull/1744 +[#1736]: https://github.com/benmosher/eslint-plugin-import/pull/1736 +[#1735]: https://github.com/benmosher/eslint-plugin-import/pull/1735 +[#1726]: https://github.com/benmosher/eslint-plugin-import/pull/1726 +[#1724]: https://github.com/benmosher/eslint-plugin-import/pull/1724 +[#1722]: https://github.com/benmosher/eslint-plugin-import/issues/1722 +[#1719]: https://github.com/benmosher/eslint-plugin-import/pull/1719 +[#1702]: https://github.com/benmosher/eslint-plugin-import/issues/1702 +[#1691]: https://github.com/benmosher/eslint-plugin-import/pull/1691 +[#1690]: https://github.com/benmosher/eslint-plugin-import/pull/1690 +[#1689]: https://github.com/benmosher/eslint-plugin-import/pull/1689 +[#1681]: https://github.com/benmosher/eslint-plugin-import/pull/1681 +[#1676]: https://github.com/benmosher/eslint-plugin-import/pull/1676 +[#1666]: https://github.com/benmosher/eslint-plugin-import/pull/1666 +[#1664]: https://github.com/benmosher/eslint-plugin-import/pull/1664 +[#1658]: https://github.com/benmosher/eslint-plugin-import/pull/1658 +[#1651]: https://github.com/benmosher/eslint-plugin-import/pull/1651 +[#1635]: https://github.com/benmosher/eslint-plugin-import/issues/1635 +[#1631]: https://github.com/benmosher/eslint-plugin-import/issues/1631 +[#1625]: https://github.com/benmosher/eslint-plugin-import/pull/1625 +[#1620]: https://github.com/benmosher/eslint-plugin-import/pull/1620 +[#1619]: https://github.com/benmosher/eslint-plugin-import/pull/1619 +[#1616]: https://github.com/benmosher/eslint-plugin-import/issues/1616 +[#1613]: https://github.com/benmosher/eslint-plugin-import/issues/1613 +[#1612]: https://github.com/benmosher/eslint-plugin-import/pull/1612 +[#1611]: https://github.com/benmosher/eslint-plugin-import/pull/1611 +[#1605]: https://github.com/benmosher/eslint-plugin-import/pull/1605 +[#1589]: https://github.com/benmosher/eslint-plugin-import/issues/1589 +[#1586]: https://github.com/benmosher/eslint-plugin-import/pull/1586 +[#1572]: https://github.com/benmosher/eslint-plugin-import/pull/1572 +[#1569]: https://github.com/benmosher/eslint-plugin-import/pull/1569 +[#1563]: https://github.com/benmosher/eslint-plugin-import/pull/1563 +[#1560]: https://github.com/benmosher/eslint-plugin-import/pull/1560 +[#1551]: https://github.com/benmosher/eslint-plugin-import/pull/1551 +[#1542]: https://github.com/benmosher/eslint-plugin-import/pull/1542 +[#1528]: https://github.com/benmosher/eslint-plugin-import/pull/1528 +[#1526]: https://github.com/benmosher/eslint-plugin-import/pull/1526 +[#1521]: https://github.com/benmosher/eslint-plugin-import/pull/1521 +[#1519]: https://github.com/benmosher/eslint-plugin-import/pull/1519 +[#1507]: https://github.com/benmosher/eslint-plugin-import/pull/1507 +[#1506]: https://github.com/benmosher/eslint-plugin-import/pull/1506 +[#1496]: https://github.com/benmosher/eslint-plugin-import/pull/1496 +[#1495]: https://github.com/benmosher/eslint-plugin-import/pull/1495 +[#1494]: https://github.com/benmosher/eslint-plugin-import/pull/1494 +[#1493]: https://github.com/benmosher/eslint-plugin-import/pull/1493 +[#1472]: https://github.com/benmosher/eslint-plugin-import/pull/1472 +[#1470]: https://github.com/benmosher/eslint-plugin-import/pull/1470 +[#1447]: https://github.com/benmosher/eslint-plugin-import/pull/1447 +[#1439]: https://github.com/benmosher/eslint-plugin-import/pull/1439 +[#1436]: https://github.com/benmosher/eslint-plugin-import/pull/1436 +[#1435]: https://github.com/benmosher/eslint-plugin-import/pull/1435 +[#1425]: https://github.com/benmosher/eslint-plugin-import/pull/1425 +[#1419]: https://github.com/benmosher/eslint-plugin-import/pull/1419 +[#1412]: https://github.com/benmosher/eslint-plugin-import/pull/1412 +[#1409]: https://github.com/benmosher/eslint-plugin-import/pull/1409 +[#1404]: https://github.com/benmosher/eslint-plugin-import/pull/1404 +[#1401]: https://github.com/benmosher/eslint-plugin-import/pull/1401 +[#1393]: https://github.com/benmosher/eslint-plugin-import/pull/1393 +[#1389]: https://github.com/benmosher/eslint-plugin-import/pull/1389 +[#1386]: https://github.com/benmosher/eslint-plugin-import/pull/1386 +[#1377]: https://github.com/benmosher/eslint-plugin-import/pull/1377 +[#1375]: https://github.com/benmosher/eslint-plugin-import/pull/1375 +[#1372]: https://github.com/benmosher/eslint-plugin-import/pull/1372 +[#1371]: https://github.com/benmosher/eslint-plugin-import/pull/1371 +[#1370]: https://github.com/benmosher/eslint-plugin-import/pull/1370 +[#1363]: https://github.com/benmosher/eslint-plugin-import/pull/1363 +[#1360]: https://github.com/benmosher/eslint-plugin-import/pull/1360 +[#1358]: https://github.com/benmosher/eslint-plugin-import/pull/1358 +[#1356]: https://github.com/benmosher/eslint-plugin-import/pull/1356 +[#1354]: https://github.com/benmosher/eslint-plugin-import/pull/1354 +[#1352]: https://github.com/benmosher/eslint-plugin-import/pull/1352 +[#1347]: https://github.com/benmosher/eslint-plugin-import/pull/1347 +[#1345]: https://github.com/benmosher/eslint-plugin-import/pull/1345 +[#1342]: https://github.com/benmosher/eslint-plugin-import/pull/1342 +[#1340]: https://github.com/benmosher/eslint-plugin-import/pull/1340 +[#1333]: https://github.com/benmosher/eslint-plugin-import/pull/1333 +[#1331]: https://github.com/benmosher/eslint-plugin-import/pull/1331 +[#1330]: https://github.com/benmosher/eslint-plugin-import/pull/1330 +[#1320]: https://github.com/benmosher/eslint-plugin-import/pull/1320 +[#1319]: https://github.com/benmosher/eslint-plugin-import/pull/1319 +[#1312]: https://github.com/benmosher/eslint-plugin-import/pull/1312 +[#1308]: https://github.com/benmosher/eslint-plugin-import/pull/1308 +[#1304]: https://github.com/benmosher/eslint-plugin-import/pull/1304 +[#1297]: https://github.com/benmosher/eslint-plugin-import/pull/1297 +[#1295]: https://github.com/benmosher/eslint-plugin-import/pull/1295 +[#1294]: https://github.com/benmosher/eslint-plugin-import/pull/1294 +[#1290]: https://github.com/benmosher/eslint-plugin-import/pull/1290 +[#1277]: https://github.com/benmosher/eslint-plugin-import/pull/1277 +[#1257]: https://github.com/benmosher/eslint-plugin-import/pull/1257 +[#1253]: https://github.com/benmosher/eslint-plugin-import/pull/1253 +[#1248]: https://github.com/benmosher/eslint-plugin-import/pull/1248 +[#1238]: https://github.com/benmosher/eslint-plugin-import/pull/1238 +[#1235]: https://github.com/benmosher/eslint-plugin-import/pull/1235 +[#1234]: https://github.com/benmosher/eslint-plugin-import/pull/1234 +[#1232]: https://github.com/benmosher/eslint-plugin-import/pull/1232 +[#1218]: https://github.com/benmosher/eslint-plugin-import/pull/1218 +[#1176]: https://github.com/benmosher/eslint-plugin-import/pull/1176 +[#1163]: https://github.com/benmosher/eslint-plugin-import/pull/1163 +[#1157]: https://github.com/benmosher/eslint-plugin-import/pull/1157 +[#1151]: https://github.com/benmosher/eslint-plugin-import/pull/1151 +[#1142]: https://github.com/benmosher/eslint-plugin-import/pull/1142 +[#1139]: https://github.com/benmosher/eslint-plugin-import/pull/1139 +[#1137]: https://github.com/benmosher/eslint-plugin-import/pull/1137 +[#1135]: https://github.com/benmosher/eslint-plugin-import/pull/1135 +[#1128]: https://github.com/benmosher/eslint-plugin-import/pull/1128 +[#1126]: https://github.com/benmosher/eslint-plugin-import/pull/1126 +[#1122]: https://github.com/benmosher/eslint-plugin-import/pull/1122 +[#1112]: https://github.com/benmosher/eslint-plugin-import/pull/1112 +[#1107]: https://github.com/benmosher/eslint-plugin-import/pull/1107 +[#1106]: https://github.com/benmosher/eslint-plugin-import/pull/1106 +[#1105]: https://github.com/benmosher/eslint-plugin-import/pull/1105 +[#1093]: https://github.com/benmosher/eslint-plugin-import/pull/1093 +[#1085]: https://github.com/benmosher/eslint-plugin-import/pull/1085 +[#1068]: https://github.com/benmosher/eslint-plugin-import/pull/1068 +[#1049]: https://github.com/benmosher/eslint-plugin-import/pull/1049 +[#1046]: https://github.com/benmosher/eslint-plugin-import/pull/1046 +[#944]: https://github.com/benmosher/eslint-plugin-import/pull/944 +[#912]: https://github.com/benmosher/eslint-plugin-import/pull/912 +[#908]: https://github.com/benmosher/eslint-plugin-import/pull/908 +[#891]: https://github.com/benmosher/eslint-plugin-import/pull/891 +[#889]: https://github.com/benmosher/eslint-plugin-import/pull/889 +[#880]: https://github.com/benmosher/eslint-plugin-import/pull/880 +[#871]: https://github.com/benmosher/eslint-plugin-import/pull/871 +[#858]: https://github.com/benmosher/eslint-plugin-import/pull/858 +[#843]: https://github.com/benmosher/eslint-plugin-import/pull/843 +[#797]: https://github.com/benmosher/eslint-plugin-import/pull/797 +[#794]: https://github.com/benmosher/eslint-plugin-import/pull/794 +[#744]: https://github.com/benmosher/eslint-plugin-import/pull/744 +[#742]: https://github.com/benmosher/eslint-plugin-import/pull/742 +[#737]: https://github.com/benmosher/eslint-plugin-import/pull/737 +[#727]: https://github.com/benmosher/eslint-plugin-import/pull/727 +[#721]: https://github.com/benmosher/eslint-plugin-import/pull/721 +[#712]: https://github.com/benmosher/eslint-plugin-import/pull/712 +[#696]: https://github.com/benmosher/eslint-plugin-import/pull/696 +[#685]: https://github.com/benmosher/eslint-plugin-import/pull/685 +[#680]: https://github.com/benmosher/eslint-plugin-import/pull/680 +[#654]: https://github.com/benmosher/eslint-plugin-import/pull/654 +[#639]: https://github.com/benmosher/eslint-plugin-import/pull/639 +[#632]: https://github.com/benmosher/eslint-plugin-import/pull/632 +[#630]: https://github.com/benmosher/eslint-plugin-import/pull/630 +[#629]: https://github.com/benmosher/eslint-plugin-import/pull/629 +[#628]: https://github.com/benmosher/eslint-plugin-import/pull/628 +[#596]: https://github.com/benmosher/eslint-plugin-import/pull/596 +[#586]: https://github.com/benmosher/eslint-plugin-import/pull/586 +[#578]: https://github.com/benmosher/eslint-plugin-import/pull/578 +[#568]: https://github.com/benmosher/eslint-plugin-import/pull/568 +[#555]: https://github.com/benmosher/eslint-plugin-import/pull/555 +[#538]: https://github.com/benmosher/eslint-plugin-import/pull/538 +[#527]: https://github.com/benmosher/eslint-plugin-import/pull/527 +[#518]: https://github.com/benmosher/eslint-plugin-import/pull/518 +[#509]: https://github.com/benmosher/eslint-plugin-import/pull/509 +[#508]: https://github.com/benmosher/eslint-plugin-import/pull/508 +[#503]: https://github.com/benmosher/eslint-plugin-import/pull/503 +[#499]: https://github.com/benmosher/eslint-plugin-import/pull/499 +[#489]: https://github.com/benmosher/eslint-plugin-import/pull/489 +[#485]: https://github.com/benmosher/eslint-plugin-import/pull/485 +[#461]: https://github.com/benmosher/eslint-plugin-import/pull/461 +[#449]: https://github.com/benmosher/eslint-plugin-import/pull/449 +[#444]: https://github.com/benmosher/eslint-plugin-import/pull/444 +[#428]: https://github.com/benmosher/eslint-plugin-import/pull/428 +[#395]: https://github.com/benmosher/eslint-plugin-import/pull/395 +[#371]: https://github.com/benmosher/eslint-plugin-import/pull/371 +[#365]: https://github.com/benmosher/eslint-plugin-import/pull/365 +[#359]: https://github.com/benmosher/eslint-plugin-import/pull/359 +[#343]: https://github.com/benmosher/eslint-plugin-import/pull/343 +[#332]: https://github.com/benmosher/eslint-plugin-import/pull/332 +[#322]: https://github.com/benmosher/eslint-plugin-import/pull/322 +[#321]: https://github.com/benmosher/eslint-plugin-import/pull/321 +[#316]: https://github.com/benmosher/eslint-plugin-import/pull/316 +[#314]: https://github.com/benmosher/eslint-plugin-import/pull/314 +[#308]: https://github.com/benmosher/eslint-plugin-import/pull/308 +[#298]: https://github.com/benmosher/eslint-plugin-import/pull/298 +[#297]: https://github.com/benmosher/eslint-plugin-import/pull/297 +[#296]: https://github.com/benmosher/eslint-plugin-import/pull/296 +[#290]: https://github.com/benmosher/eslint-plugin-import/pull/290 +[#289]: https://github.com/benmosher/eslint-plugin-import/pull/289 +[#288]: https://github.com/benmosher/eslint-plugin-import/pull/288 +[#287]: https://github.com/benmosher/eslint-plugin-import/pull/287 +[#278]: https://github.com/benmosher/eslint-plugin-import/pull/278 +[#261]: https://github.com/benmosher/eslint-plugin-import/pull/261 +[#256]: https://github.com/benmosher/eslint-plugin-import/pull/256 +[#254]: https://github.com/benmosher/eslint-plugin-import/pull/254 +[#250]: https://github.com/benmosher/eslint-plugin-import/pull/250 +[#247]: https://github.com/benmosher/eslint-plugin-import/pull/247 +[#245]: https://github.com/benmosher/eslint-plugin-import/pull/245 +[#243]: https://github.com/benmosher/eslint-plugin-import/pull/243 +[#241]: https://github.com/benmosher/eslint-plugin-import/pull/241 +[#239]: https://github.com/benmosher/eslint-plugin-import/pull/239 +[#228]: https://github.com/benmosher/eslint-plugin-import/pull/228 +[#211]: https://github.com/benmosher/eslint-plugin-import/pull/211 +[#164]: https://github.com/benmosher/eslint-plugin-import/pull/164 +[#157]: https://github.com/benmosher/eslint-plugin-import/pull/157 +[#1814]: https://github.com/benmosher/eslint-plugin-import/issues/1814 +[#1811]: https://github.com/benmosher/eslint-plugin-import/issues/1811 +[#1808]: https://github.com/benmosher/eslint-plugin-import/issues/1808 +[#1805]: https://github.com/benmosher/eslint-plugin-import/issues/1805 +[#1565]: https://github.com/benmosher/eslint-plugin-import/issues/1565 +[#1366]: https://github.com/benmosher/eslint-plugin-import/issues/1366 +[#1334]: https://github.com/benmosher/eslint-plugin-import/issues/1334 +[#1323]: https://github.com/benmosher/eslint-plugin-import/issues/1323 +[#1322]: https://github.com/benmosher/eslint-plugin-import/issues/1322 +[#1300]: https://github.com/benmosher/eslint-plugin-import/issues/1300 +[#1293]: https://github.com/benmosher/eslint-plugin-import/issues/1293 +[#1266]: https://github.com/benmosher/eslint-plugin-import/issues/1266 +[#1256]: https://github.com/benmosher/eslint-plugin-import/issues/1256 +[#1233]: https://github.com/benmosher/eslint-plugin-import/issues/1233 +[#1175]: https://github.com/benmosher/eslint-plugin-import/issues/1175 +[#1166]: https://github.com/benmosher/eslint-plugin-import/issues/1166 +[#1144]: https://github.com/benmosher/eslint-plugin-import/issues/1144 +[#1058]: https://github.com/benmosher/eslint-plugin-import/issues/1058 +[#1035]: https://github.com/benmosher/eslint-plugin-import/issues/1035 +[#931]: https://github.com/benmosher/eslint-plugin-import/issues/931 +[#886]: https://github.com/benmosher/eslint-plugin-import/issues/886 +[#863]: https://github.com/benmosher/eslint-plugin-import/issues/863 +[#842]: https://github.com/benmosher/eslint-plugin-import/issues/842 +[#839]: https://github.com/benmosher/eslint-plugin-import/issues/839 +[#795]: https://github.com/benmosher/eslint-plugin-import/issues/795 +[#793]: https://github.com/benmosher/eslint-plugin-import/issues/793 +[#720]: https://github.com/benmosher/eslint-plugin-import/issues/720 +[#717]: https://github.com/benmosher/eslint-plugin-import/issues/717 +[#686]: https://github.com/benmosher/eslint-plugin-import/issues/686 +[#671]: https://github.com/benmosher/eslint-plugin-import/issues/671 +[#660]: https://github.com/benmosher/eslint-plugin-import/issues/660 +[#653]: https://github.com/benmosher/eslint-plugin-import/issues/653 +[#627]: https://github.com/benmosher/eslint-plugin-import/issues/627 +[#620]: https://github.com/benmosher/eslint-plugin-import/issues/620 +[#609]: https://github.com/benmosher/eslint-plugin-import/issues/609 +[#604]: https://github.com/benmosher/eslint-plugin-import/issues/604 +[#602]: https://github.com/benmosher/eslint-plugin-import/issues/602 +[#601]: https://github.com/benmosher/eslint-plugin-import/issues/601 +[#592]: https://github.com/benmosher/eslint-plugin-import/issues/592 +[#577]: https://github.com/benmosher/eslint-plugin-import/issues/577 +[#570]: https://github.com/benmosher/eslint-plugin-import/issues/570 +[#567]: https://github.com/benmosher/eslint-plugin-import/issues/567 +[#566]: https://github.com/benmosher/eslint-plugin-import/issues/566 +[#545]: https://github.com/benmosher/eslint-plugin-import/issues/545 +[#530]: https://github.com/benmosher/eslint-plugin-import/issues/530 +[#529]: https://github.com/benmosher/eslint-plugin-import/issues/529 +[#519]: https://github.com/benmosher/eslint-plugin-import/issues/519 +[#507]: https://github.com/benmosher/eslint-plugin-import/issues/507 +[#484]: https://github.com/benmosher/eslint-plugin-import/issues/484 +[#478]: https://github.com/benmosher/eslint-plugin-import/issues/478 +[#456]: https://github.com/benmosher/eslint-plugin-import/issues/456 +[#453]: https://github.com/benmosher/eslint-plugin-import/issues/453 +[#452]: https://github.com/benmosher/eslint-plugin-import/issues/452 +[#447]: https://github.com/benmosher/eslint-plugin-import/issues/447 +[#441]: https://github.com/benmosher/eslint-plugin-import/issues/441 +[#423]: https://github.com/benmosher/eslint-plugin-import/issues/423 +[#416]: https://github.com/benmosher/eslint-plugin-import/issues/416 +[#415]: https://github.com/benmosher/eslint-plugin-import/issues/415 +[#402]: https://github.com/benmosher/eslint-plugin-import/issues/402 +[#386]: https://github.com/benmosher/eslint-plugin-import/issues/386 +[#373]: https://github.com/benmosher/eslint-plugin-import/issues/373 +[#370]: https://github.com/benmosher/eslint-plugin-import/issues/370 +[#348]: https://github.com/benmosher/eslint-plugin-import/issues/348 +[#342]: https://github.com/benmosher/eslint-plugin-import/issues/342 +[#328]: https://github.com/benmosher/eslint-plugin-import/issues/328 +[#317]: https://github.com/benmosher/eslint-plugin-import/issues/317 +[#313]: https://github.com/benmosher/eslint-plugin-import/issues/313 +[#311]: https://github.com/benmosher/eslint-plugin-import/issues/311 +[#306]: https://github.com/benmosher/eslint-plugin-import/issues/306 +[#286]: https://github.com/benmosher/eslint-plugin-import/issues/286 +[#283]: https://github.com/benmosher/eslint-plugin-import/issues/283 +[#281]: https://github.com/benmosher/eslint-plugin-import/issues/281 +[#275]: https://github.com/benmosher/eslint-plugin-import/issues/275 +[#272]: https://github.com/benmosher/eslint-plugin-import/issues/272 +[#270]: https://github.com/benmosher/eslint-plugin-import/issues/270 +[#267]: https://github.com/benmosher/eslint-plugin-import/issues/267 +[#266]: https://github.com/benmosher/eslint-plugin-import/issues/266 +[#216]: https://github.com/benmosher/eslint-plugin-import/issues/216 +[#214]: https://github.com/benmosher/eslint-plugin-import/issues/214 +[#210]: https://github.com/benmosher/eslint-plugin-import/issues/210 +[#200]: https://github.com/benmosher/eslint-plugin-import/issues/200 +[#192]: https://github.com/benmosher/eslint-plugin-import/issues/192 +[#191]: https://github.com/benmosher/eslint-plugin-import/issues/191 +[#189]: https://github.com/benmosher/eslint-plugin-import/issues/189 +[#170]: https://github.com/benmosher/eslint-plugin-import/issues/170 +[#155]: https://github.com/benmosher/eslint-plugin-import/issues/155 +[#119]: https://github.com/benmosher/eslint-plugin-import/issues/119 +[#89]: https://github.com/benmosher/eslint-plugin-import/issues/89 + +[Unreleased]: https://github.com/benmosher/eslint-plugin-import/compare/v2.22.0...HEAD +[2.22.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.21.1...v2.22.0 +[2.21.2]: https://github.com/benmosher/eslint-plugin-import/compare/v2.21.1...v2.21.2 +[2.21.1]: https://github.com/benmosher/eslint-plugin-import/compare/v2.21.0...v2.21.1 +[2.21.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.20.2...v2.21.0 +[2.20.1]: https://github.com/benmosher/eslint-plugin-import/compare/v2.20.1...v2.20.2 +[2.20.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.20.0...v2.20.1 +[2.19.1]: https://github.com/benmosher/eslint-plugin-import/compare/v2.19.1...v2.20.0 +[2.19.1]: https://github.com/benmosher/eslint-plugin-import/compare/v2.19.0...v2.19.1 +[2.19.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.18.2...v2.19.0 +[2.18.2]: https://github.com/benmosher/eslint-plugin-import/compare/v2.18.1...v2.18.2 +[2.18.1]: https://github.com/benmosher/eslint-plugin-import/compare/v2.18.0...v2.18.1 +[2.18.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.17.3...v2.18.0 +[2.17.3]: https://github.com/benmosher/eslint-plugin-import/compare/v2.17.2...v2.17.3 +[2.17.2]: https://github.com/benmosher/eslint-plugin-import/compare/v2.17.1...v2.17.2 +[2.17.1]: https://github.com/benmosher/eslint-plugin-import/compare/v2.17.0...v2.17.1 +[2.17.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.16.0...v2.17.0 +[2.16.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.15.0...v2.16.0 +[2.15.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.14.0...v2.15.0 +[2.14.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.13.0...v2.14.0 +[2.13.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.12.0...v2.13.0 +[2.12.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.11.0...v2.12.0 +[2.11.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.10.0...v2.11.0 +[2.10.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.9.0...v2.10.0 +[2.9.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.8.0...v2.9.0 +[2.8.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.7.0...v2.8.0 +[2.7.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.6.1...v2.7.0 +[2.6.1]: https://github.com/benmosher/eslint-plugin-import/compare/v2.6.0...v2.6.1 +[2.6.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.5.0...v2.6.0 +[2.5.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.4.0...v2.5.0 +[2.4.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.3.0...v2.4.0 +[2.3.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.2.0...v2.3.0 +[2.2.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.1.0...v2.2.0 +[2.1.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.0.1...v2.1.0 +[2.0.1]: https://github.com/benmosher/eslint-plugin-import/compare/v2.0.0...v2.0.1 +[2.0.0]: https://github.com/benmosher/eslint-plugin-import/compare/v1.16.0...v2.0.0 +[1.16.0]: https://github.com/benmosher/eslint-plugin-import/compare/v1.15.0...v1.16.0 +[1.15.0]: https://github.com/benmosher/eslint-plugin-import/compare/v1.14.0...v1.15.0 +[1.14.0]: https://github.com/benmosher/eslint-plugin-import/compare/v1.13.0...v1.14.0 +[1.13.0]: https://github.com/benmosher/eslint-plugin-import/compare/v1.12.0...v1.13.0 +[1.12.0]: https://github.com/benmosher/eslint-plugin-import/compare/v1.11.1...v1.12.0 +[1.11.1]: https://github.com/benmosher/eslint-plugin-import/compare/v1.11.0...v1.11.1 +[1.11.0]: https://github.com/benmosher/eslint-plugin-import/compare/v1.10.3...v1.11.0 +[1.10.3]: https://github.com/benmosher/eslint-plugin-import/compare/v1.10.2...v1.10.3 +[1.10.2]: https://github.com/benmosher/eslint-plugin-import/compare/v1.10.1...v1.10.2 +[1.10.1]: https://github.com/benmosher/eslint-plugin-import/compare/v1.10.0...v1.10.1 +[1.10.0]: https://github.com/benmosher/eslint-plugin-import/compare/v1.9.2...v1.10.0 +[1.9.2]: https://github.com/benmosher/eslint-plugin-import/compare/v1.9.1...v1.9.2 +[1.9.1]: https://github.com/benmosher/eslint-plugin-import/compare/v1.9.0...v1.9.1 +[1.9.0]: https://github.com/benmosher/eslint-plugin-import/compare/v1.8.1...v1.9.0 +[1.8.1]: https://github.com/benmosher/eslint-plugin-import/compare/v1.8.0...v1.8.1 +[1.8.0]: https://github.com/benmosher/eslint-plugin-import/compare/v1.7.0...v1.8.0 +[1.7.0]: https://github.com/benmosher/eslint-plugin-import/compare/v1.6.1...v1.7.0 +[1.6.1]: https://github.com/benmosher/eslint-plugin-import/compare/v1.6.0...v1.6.1 +[1.6.0]: https://github.com/benmosher/eslint-plugin-import/compare/v1.5.0...1.6.0 +[1.5.0]: https://github.com/benmosher/eslint-plugin-import/compare/v1.4.0...v1.5.0 +[1.4.0]: https://github.com/benmosher/eslint-plugin-import/compare/v1.3.0...v1.4.0 +[1.3.0]: https://github.com/benmosher/eslint-plugin-import/compare/v1.2.0...v1.3.0 +[1.2.0]: https://github.com/benmosher/eslint-plugin-import/compare/v1.1.0...v1.2.0 +[1.1.0]: https://github.com/benmosher/eslint-plugin-import/compare/v1.0.4...v1.1.0 +[1.0.4]: https://github.com/benmosher/eslint-plugin-import/compare/v1.0.3...v1.0.4 +[1.0.3]: https://github.com/benmosher/eslint-plugin-import/compare/v1.0.2...v1.0.3 +[1.0.2]: https://github.com/benmosher/eslint-plugin-import/compare/v1.0.1...v1.0.2 +[1.0.1]: https://github.com/benmosher/eslint-plugin-import/compare/v1.0.0...v1.0.1 +[1.0.0]: https://github.com/benmosher/eslint-plugin-import/compare/v1.0.0-beta.0...v1.0.0 +[1.0.0-beta.0]: https://github.com/benmosher/eslint-plugin-import/compare/v0.13.0...v1.0.0-beta.0 +[0.13.0]: https://github.com/benmosher/eslint-plugin-import/compare/v0.12.1...v0.13.0 +[0.12.2]: https://github.com/benmosher/eslint-plugin-import/compare/v0.12.1...v0.12.2 +[0.12.1]: https://github.com/benmosher/eslint-plugin-import/compare/v0.12.0...v0.12.1 +[0.12.0]: https://github.com/benmosher/eslint-plugin-import/compare/v0.11.0...v0.12.0 +[0.11.0]: https://github.com/benmosher/eslint-plugin-import/compare/v0.10.1...v0.11.0 + +[@mathieudutour]: https://github.com/mathieudutour +[@gausie]: https://github.com/gausie +[@singles]: https://github.com/singles +[@jfmengels]: https://github.com/jfmengels +[@lo1tuma]: https://github.com/lo1tuma +[@dmnd]: https://github.com/dmnd +[@lemonmade]: https://github.com/lemonmade +[@jimbolla]: https://github.com/jimbolla +[@jquense]: https://github.com/jquense +[@jonboiser]: https://github.com/jonboiser +[@taion]: https://github.com/taion +[@strawbrary]: https://github.com/strawbrary +[@SimenB]: https://github.com/SimenB +[@josh]: https://github.com/josh +[@borisyankov]: https://github.com/borisyankov +[@gavriguy]: https://github.com/gavriguy +[@jkimbo]: https://github.com/jkimbo +[@le0nik]: https://github.com/le0nik +[@scottnonnenberg]: https://github.com/scottnonnenberg +[@sindresorhus]: https://github.com/sindresorhus +[@ljharb]: https://github.com/ljharb +[@rhettlivingston]: https://github.com/rhettlivingston +[@zloirock]: https://github.com/zloirock +[@rhys-vdw]: https://github.com/rhys-vdw +[@wKich]: https://github.com/wKich +[@tizmagik]: https://github.com/tizmagik +[@knpwrs]: https://github.com/knpwrs +[@spalger]: https://github.com/spalger +[@preco21]: https://github.com/preco21 +[@skyrpex]: https://github.com/skyrpex +[@fson]: https://github.com/fson +[@ntdb]: https://github.com/ntdb +[@jakubsta]: https://github.com/jakubsta +[@wtgtybhertgeghgtwtg]: https://github.com/wtgtybhertgeghgtwtg +[@duncanbeevers]: https://github.com/duncanbeevers +[@giodamelio]: https://github.com/giodamelio +[@ntdb]: https://github.com/ntdb +[@ramasilveyra]: https://github.com/ramasilveyra +[@sompylasar]: https://github.com/sompylasar +[@kevin940726]: https://github.com/kevin940726 +[@eelyafi]: https://github.com/eelyafi +[@mastilver]: https://github.com/mastilver +[@jseminck]: https://github.com/jseminck +[@laysent]: https://github.com/laysent +[@k15a]: https://github.com/k15a +[@mplewis]: https://github.com/mplewis +[@rosswarren]: https://github.com/rosswarren +[@alexgorbatchev]: https://github.com/alexgorbatchev +[@tihonove]: https://github.com/tihonove +[@robertrossmann]: https://github.com/robertrossmann +[@isiahmeadows]: https://github.com/isiahmeadows +[@graingert]: https://github.com/graingert +[@danny-andrews]: https://github.com/dany-andrews +[@fengkfengk]: https://github.com/fengkfengk +[@futpib]: https://github.com/futpib +[@klimashkin]: https://github.com/klimashkin +[@lukeapage]: https://github.com/lukeapage +[@manovotny]: https://github.com/manovotny +[@mattijsbliek]: https://github.com/mattijsbliek +[@hulkish]: https://github.com/hulkish +[@chrislloyd]: https://github.com/chrislloyd +[@ai]: https://github.com/ai +[@syymza]: https://github.com/syymza +[@justinanastos]: https://github.com/justinanastos +[@1pete]: https://github.com/1pete +[@gajus]: https://github.com/gajus +[@jf248]: https://github.com/jf248 +[@aravindet]: https://github.com/aravindet +[@pzhine]: https://github.com/pzhine +[@st-sloth]: https://github.com/st-sloth +[@ljqx]: https://github.com/ljqx +[@kirill-konshin]: https://github.com/kirill-konshin +[@asapach]: https://github.com/asapach +[@sergei-startsev]: https://github.com/sergei-startsev +[@ephys]: https://github.com/ephys +[@lydell]: https://github.com/lydell +[@jeffshaver]: https://github.com/jeffshaver +[@timkraut]: https://github.com/timkraut +[@TakeScoop]: https://github.com/TakeScoop +[@rfermann]: https://github.com/rfermann +[@bradennapier]: https://github.com/bradennapier +[@schmod]: https://github.com/schmod +[@echenley]: https://github.com/echenley +[@vikr01]: https://github.com/vikr01 +[@bradzacher]: https://github.com/bradzacher +[@feychenie]: https://github.com/feychenie +[@kiwka]: https://github.com/kiwka +[@loganfsmyth]: https://github.com/loganfsmyth +[@johndevedu]: https://github.com/johndevedu +[@charlessuh]: https://github.com/charlessuh +[@kgregory]: https://github.com/kgregory +[@christophercurrie]: https://github.com/christophercurrie +[@alex-page]: https://github.com/alex-page +[@benmosher]: https://github.com/benmosher +[@fooloomanzoo]: https://github.com/fooloomanzoo +[@sheepsteak]: https://github.com/sheepsteak +[@sharmilajesupaul]: https://github.com/sharmilajesupaul +[@lencioni]: https://github.com/lencioni +[@JounQin]: https://github.com/JounQin +[@atikenny]: https://github.com/atikenny +[@schmidsi]: https://github.com/schmidsi +[@TrevorBurnham]: https://github.com/TrevorBurnham +[@benmunro]: https://github.com/benmunro +[@tihonove]: https://github.com/tihonove +[@brendo]: https://github.com/brendo +[@saschanaz]: https://github.com/saschanaz +[@brettz9]: https://github.com/brettz9 +[@Taranys]: https://github.com/Taranys +[@maxmalov]: https://github.com/maxmalov +[@marcusdarmstrong]: https://github.com/marcusdarmstrong +[@Mairu]: https://github.com/Mairu +[@aamulumi]: https://github.com/aamulumi +[@pcorpet]: https://github.com/pcorpet +[@stropho]: https://github.com/stropho +[@luczsoma]: https://github.com/luczsoma +[@christophercurrie]: https://github.com/christophercurrie +[@randallreedjr]: https://github.com/randallreedjr +[@Pessimistress]: https://github.com/Pessimistress +[@stekycz]: https://github.com/stekycz +[@dbrewer5]: https://github.com/dbrewer5 +[@rsolomon]: https://github.com/rsolomon +[@joaovieira]: https://github.com/joaovieira +[@ivo-stefchev]: https://github.com/ivo-stefchev +[@skozin]: https://github.com/skozin +[@yordis]: https://github.com/yordis +[@sveyret]: https://github.com/sveyret +[@bmish]: https://github.com/bmish +[@redbugz]: https://github.com/redbugz +[@kentcdodds]: https://github.com/kentcdodds +[@IvanGoncharov]: https://github.com/IvanGoncharov +[@wschurman]: https://github.com/wschurman +[@fisker]: https://github.com/fisker +[@richardxia]: https://github.com/richardxia +[@TheCrueltySage]: https://github.com/TheCrueltySage +[@ernestostifano]: https://github.com/ernestostifano +[@forivall]: https://github.com/forivall +[@xpl]: https://github.com/xpl +[@astorije]: https://github.com/astorije +[@Ephem]: https://github.com/Ephem +[@kmui2]: https://github.com/kmui2 +[@arvigeus]: https://github.com/arvigeus +[@atos1990]: https://github.com/atos1990 +[@Hypnosphi]: https://github.com/Hypnosphi +[@nickofthyme]: https://github.com/nickofthyme +[@manuth]: https://github.com/manuth +[@julien1619]: https://github.com/julien1619 +[@darkartur]: https://github.com/darkartur +[@MikeyBeLike]: https://github.com/MikeyBeLike +[@barbogast]: https://github.com/barbogast +[@adamborowski]: https://github.com/adamborowski +[@adjerbetian]: https://github.com/adjerbetian +[@Maxim-Mazurok]: https://github.com/Maxim-Mazurok +[@malykhinvi]: https://github.com/malykhinvi +[@nicolashenry]: https://github.com/nicolashenry +[@fernandopasik]: https://github.com/fernandopasik +[@taye]: https://github.com/taye +[@AndrewLeedham]: https://github.com/AndrewLeedham +[@be5invis]: https://github.com/be5invis +[@noelebrun]: https://github.com/noelebrun +[@beatrizrezener]: https://github.com/beatrizrezener diff --git a/node_modules/eslint-plugin-import/CONTRIBUTING.md b/node_modules/eslint-plugin-import/CONTRIBUTING.md new file mode 100644 index 000000000..35a6b14b5 --- /dev/null +++ b/node_modules/eslint-plugin-import/CONTRIBUTING.md @@ -0,0 +1,116 @@ +# Contributing + +Thanks for your interest in helping out! Here are a **few** _weird_ tricks to +~~cut your mortgage in half~~ maximize the global net efficiency of your efforts! + +## TL;DR: Checklist + +When opening an [issue](#issues): +- [ ] search open/closed issues +- [ ] discuss bug/enhancement in new or old issue + +[PR](#prs) time: +- [ ] write tests +- [ ] implement feature/fix bug +- [ ] update docs +- [ ] make a note in change log + +Remember, you don't need to do it all yourself; any of these are helpful! 😎 + +## Issues + +### Search open + closed issues for similar cases. + + You may find an open issue that closely matches what you are thinking. You + may also find a closed issue with discussion that either solves your problem + or explains why we are unlikely to solve it in the near future. + + If you find a matching issue that is open, and marked `accepted` and/or `help + wanted`, you might want to [open a PR](#prs). + +### Open an issue. + + Let's discuss your issue. Could be as simple as unclear documentation or a + wonky config file. + If you're suggesting a feature, it might exist and need better + documentation, or it might be in process. Even given those, some discussion might + be warranted to ensure the enhancement is clear. + + You're welcome to jump right to a PR, but without a discussion, can't make any + guarantees about merging. + + That said: sometimes seeing the code makes the discussion clearer.😄 + +This is a helpful contribution all by itself. Thanks! + +## PRs + +If you would like to implement something, firstly: thanks! Community contributions +are a magical thing. Like Redux or [the flux capacitor](https://youtu.be/SR5BfQ4rEqQ?t=2m25s), +they make open source possible. + +**Working on your first Pull Request?** +You can learn how from this _free_ series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github). + +Here are some things to keep in mind when working on a PR: + +#### Tests + +A PR that is just failing test cases for an existing issue is very helpful, as this +can take as much time (if not more) as it takes to implement a new feature or fix +a bug. + +If you only have enough time to write tests, fantastic! Submit away. This is a great +jumping-off point for a core contributor or even another PR to continue what you've started. + +#### Docs + +For enhancements to rules, please update the docs in `docs/rules` matching the rule +filename from `src/rules`. + +Also, take a quick look at the rule summary in [README.md] in case it could use tweaking, +or add a line if you've implemented a new rule. + +Bugfixes may not warrant docs changes, though it's worth skimming the existing +docs to see if there are any relevant caveats that need to be removed. + +#### Changelog + +Please add a quick blurb to the [**Unreleased**](./CHANGELOG.md#unreleased) section of the change log. Give yourself +some credit, and please link back to the PR for future reference. This is especially +helpful for resolver changes, as the resolvers are less frequently modified and published. + +Note also that the change log can't magically link back to Github entities (i.e. PRs, +issues, users) or rules; there are a handful of footnote URL definitions at the bottom. +You may need to add one or more URL if you've square-bracketed any such items. + +## Code of Conduct + +This is not so much a set of guidelines as a reference for what I hope may become +a shared perspective on the project. I hope to write a longer essay to this end +in the future. Comments are welcome, I'd like this to be as clear as possible. + +### Empathy + +People have feelings and perspectives, and people say and believe things for good reasons. + +If you find that you summarily disagree with a perspective stated by someone else, +you likely each have histories that have moved you in opposite directions on a continuum +that probably does not have a "wrong" or "right" end. It may be that you simply +are working toward different goals that require different strategies. Every decision +has pros and cons, and could result in some winners and some losers. It's great to +discuss this so that both are well-known, and realize that even with infinite discussion, +cons and losers will likely never go to zero. + +Also note that we're not doing brain surgery here, so while it's fine if we spend some time +understanding each other, cordial disagreement should not be expensive in the +long run, and we can accept that we will get some things wrong before we get them right (if ever!). + +If we can all get together behind the common goal of embracing empathy, everything else should be able to work itself out. + +#### Attribution + +Thanks for help from http://mozillascience.github.io/working-open-workshop/contributing/ +for inspiration before I wrote this. --ben + +[README.md]: ./README.md diff --git a/node_modules/eslint-plugin-import/LICENSE b/node_modules/eslint-plugin-import/LICENSE new file mode 100644 index 000000000..c6ade2a43 --- /dev/null +++ b/node_modules/eslint-plugin-import/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Ben Mosher + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/eslint-plugin-import/README.md b/node_modules/eslint-plugin-import/README.md new file mode 100644 index 000000000..e08e72ffa --- /dev/null +++ b/node_modules/eslint-plugin-import/README.md @@ -0,0 +1,505 @@ +# eslint-plugin-import + +[![build status](https://travis-ci.org/benmosher/eslint-plugin-import.svg?branch=master)](https://travis-ci.org/benmosher/eslint-plugin-import) +[![Coverage Status](https://coveralls.io/repos/github/benmosher/eslint-plugin-import/badge.svg?branch=master)](https://coveralls.io/github/benmosher/eslint-plugin-import?branch=master) +[![win32 build status](https://ci.appveyor.com/api/projects/status/3mw2fifalmjlqf56/branch/master?svg=true)](https://ci.appveyor.com/project/benmosher/eslint-plugin-import/branch/master) +[![npm](https://img.shields.io/npm/v/eslint-plugin-import.svg)](https://www.npmjs.com/package/eslint-plugin-import) +[![npm downloads](https://img.shields.io/npm/dt/eslint-plugin-import.svg?maxAge=2592000)](http://www.npmtrends.com/eslint-plugin-import) + +This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names. All the goodness that the ES2015+ static module syntax intends to provide, marked up in your editor. + +**IF YOU ARE USING THIS WITH SUBLIME**: see the [bottom section](#sublimelinter-eslint) for important info. + +## Rules + +### Static analysis + +* Ensure imports point to a file/module that can be resolved. ([`no-unresolved`]) +* Ensure named imports correspond to a named export in the remote file. ([`named`]) +* Ensure a default export is present, given a default import. ([`default`]) +* Ensure imported namespaces contain dereferenced properties as they are dereferenced. ([`namespace`]) +* Restrict which files can be imported in a given folder ([`no-restricted-paths`]) +* Forbid import of modules using absolute paths ([`no-absolute-path`]) +* Forbid `require()` calls with expressions ([`no-dynamic-require`]) +* Prevent importing the submodules of other modules ([`no-internal-modules`]) +* Forbid webpack loader syntax in imports ([`no-webpack-loader-syntax`]) +* Forbid a module from importing itself ([`no-self-import`]) +* Forbid a module from importing a module with a dependency path back to itself ([`no-cycle`]) +* Prevent unnecessary path segments in import and require statements ([`no-useless-path-segments`]) +* Forbid importing modules from parent directories ([`no-relative-parent-imports`]) + +[`no-unresolved`]: ./docs/rules/no-unresolved.md +[`named`]: ./docs/rules/named.md +[`default`]: ./docs/rules/default.md +[`namespace`]: ./docs/rules/namespace.md +[`no-restricted-paths`]: ./docs/rules/no-restricted-paths.md +[`no-absolute-path`]: ./docs/rules/no-absolute-path.md +[`no-dynamic-require`]: ./docs/rules/no-dynamic-require.md +[`no-internal-modules`]: ./docs/rules/no-internal-modules.md +[`no-webpack-loader-syntax`]: ./docs/rules/no-webpack-loader-syntax.md +[`no-self-import`]: ./docs/rules/no-self-import.md +[`no-cycle`]: ./docs/rules/no-cycle.md +[`no-useless-path-segments`]: ./docs/rules/no-useless-path-segments.md +[`no-relative-parent-imports`]: ./docs/rules/no-relative-parent-imports.md + +### Helpful warnings + + +* Report any invalid exports, i.e. re-export of the same name ([`export`]) +* Report use of exported name as identifier of default export ([`no-named-as-default`]) +* Report use of exported name as property of default export ([`no-named-as-default-member`]) +* Report imported names marked with `@deprecated` documentation tag ([`no-deprecated`]) +* Forbid the use of extraneous packages ([`no-extraneous-dependencies`]) +* Forbid the use of mutable exports with `var` or `let`. ([`no-mutable-exports`]) +* Report modules without exports, or exports without matching import in another module ([`no-unused-modules`]) + +[`export`]: ./docs/rules/export.md +[`no-named-as-default`]: ./docs/rules/no-named-as-default.md +[`no-named-as-default-member`]: ./docs/rules/no-named-as-default-member.md +[`no-deprecated`]: ./docs/rules/no-deprecated.md +[`no-extraneous-dependencies`]: ./docs/rules/no-extraneous-dependencies.md +[`no-mutable-exports`]: ./docs/rules/no-mutable-exports.md +[`no-unused-modules`]: ./docs/rules/no-unused-modules.md + +### Module systems + +* Report potentially ambiguous parse goal (`script` vs. `module`) ([`unambiguous`]) +* Report CommonJS `require` calls and `module.exports` or `exports.*`. ([`no-commonjs`]) +* Report AMD `require` and `define` calls. ([`no-amd`]) +* No Node.js builtin modules. ([`no-nodejs-modules`]) + +[`unambiguous`]: ./docs/rules/unambiguous.md +[`no-commonjs`]: ./docs/rules/no-commonjs.md +[`no-amd`]: ./docs/rules/no-amd.md +[`no-nodejs-modules`]: ./docs/rules/no-nodejs-modules.md + + +### Style guide + +* Ensure all imports appear before other statements ([`first`]) +* Ensure all exports appear after other statements ([`exports-last`]) +* Report repeated import of the same module in multiple places ([`no-duplicates`]) +* Forbid namespace (a.k.a. "wildcard" `*`) imports ([`no-namespace`]) +* Ensure consistent use of file extension within the import path ([`extensions`]) +* Enforce a convention in module import order ([`order`]) +* Enforce a newline after import statements ([`newline-after-import`]) +* Prefer a default export if module exports a single name ([`prefer-default-export`]) +* Limit the maximum number of dependencies a module can have ([`max-dependencies`]) +* Forbid unassigned imports ([`no-unassigned-import`]) +* Forbid named default exports ([`no-named-default`]) +* Forbid default exports ([`no-default-export`]) +* Forbid named exports ([`no-named-export`]) +* Forbid anonymous values as default exports ([`no-anonymous-default-export`]) +* Prefer named exports to be grouped together in a single export declaration ([`group-exports`]) +* Enforce a leading comment with the webpackChunkName for dynamic imports ([`dynamic-import-chunkname`]) + +[`first`]: ./docs/rules/first.md +[`exports-last`]: ./docs/rules/exports-last.md +[`no-duplicates`]: ./docs/rules/no-duplicates.md +[`no-namespace`]: ./docs/rules/no-namespace.md +[`extensions`]: ./docs/rules/extensions.md +[`order`]: ./docs/rules/order.md +[`newline-after-import`]: ./docs/rules/newline-after-import.md +[`prefer-default-export`]: ./docs/rules/prefer-default-export.md +[`max-dependencies`]: ./docs/rules/max-dependencies.md +[`no-unassigned-import`]: ./docs/rules/no-unassigned-import.md +[`no-named-default`]: ./docs/rules/no-named-default.md +[`no-anonymous-default-export`]: ./docs/rules/no-anonymous-default-export.md +[`group-exports`]: ./docs/rules/group-exports.md +[`no-default-export`]: ./docs/rules/no-default-export.md +[`no-named-export`]: ./docs/rules/no-named-export.md +[`dynamic-import-chunkname`]: ./docs/rules/dynamic-import-chunkname.md + +## `eslint-plugin-import` for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of `eslint-plugin-import` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-eslint-plugin-import?utm_source=npm-eslint-plugin-import&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +## Installation + +```sh +npm install eslint-plugin-import -g +``` + +or if you manage ESLint as a dev dependency: + +```sh +# inside your project's working tree +npm install eslint-plugin-import --save-dev +``` + +All rules are off by default. However, you may configure them manually +in your `.eslintrc.(yml|json|js)`, or extend one of the canned configs: + +```yaml +--- +extends: + - eslint:recommended + - plugin:import/errors + - plugin:import/warnings + +# or configure manually: +plugins: + - import + +rules: + import/no-unresolved: [2, {commonjs: true, amd: true}] + import/named: 2 + import/namespace: 2 + import/default: 2 + import/export: 2 + # etc... +``` + +# TypeScript + +You may use the following shortcut or assemble your own config using the granular settings described below. + +Make sure you have installed [`@typescript-eslint/parser`] which is used in the following configuration. Unfortunately NPM does not allow to list optional peer dependencies. + +```yaml +extends: + - eslint:recommended + - plugin:import/errors + - plugin:import/warnings + - plugin:import/typescript # this line does the trick +``` + +[`@typescript-eslint/parser`]: https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser + +# Resolvers + +With the advent of module bundlers and the current state of modules and module +syntax specs, it's not always obvious where `import x from 'module'` should look +to find the file behind `module`. + +Up through v0.10ish, this plugin has directly used substack's [`resolve`] plugin, +which implements Node's import behavior. This works pretty well in most cases. + +However, webpack allows a number of things in import module source strings that +Node does not, such as loaders (`import 'file!./whatever'`) and a number of +aliasing schemes, such as [`externals`]: mapping a module id to a global name at +runtime (allowing some modules to be included more traditionally via script tags). + +In the interest of supporting both of these, v0.11 introduces resolvers. + +Currently [Node] and [webpack] resolution have been implemented, but the +resolvers are just npm packages, so [third party packages are supported](https://github.com/benmosher/eslint-plugin-import/wiki/Resolvers) (and encouraged!). + +You can reference resolvers in several ways (in order of precedence): + +- as a conventional `eslint-import-resolver` name, like `eslint-import-resolver-foo`: + +```yaml +# .eslintrc.yml +settings: + # uses 'eslint-import-resolver-foo': + import/resolver: foo +``` +```js +// .eslintrc.js +module.exports = { + settings: { + 'import/resolver': { + foo: { someConfig: value } + } + } +} +``` + +- with a full npm module name, like `my-awesome-npm-module`: + +```yaml +# .eslintrc.yml +settings: + import/resolver: 'my-awesome-npm-module' +``` +```js +// .eslintrc.js +module.exports = { + settings: { + 'import/resolver': { + 'my-awesome-npm-module': { someConfig: value } + } + } +} +``` + +- with a filesystem path to resolver, defined in this example as a `computed property` name: + +```js +// .eslintrc.js +module.exports = { + settings: { + 'import/resolver': { + [path.resolve('../../../my-resolver')]: { someConfig: value } + } + } +} +``` + +Relative paths will be resolved relative to the source's nearest `package.json` or +the process's current working directory if no `package.json` is found. + + + +If you are interesting in writing a resolver, see the [spec](./resolvers/README.md) for more details. + +[`resolve`]: https://www.npmjs.com/package/resolve +[`externals`]: http://webpack.github.io/docs/library-and-externals.html + +[Node]: https://www.npmjs.com/package/eslint-import-resolver-node +[webpack]: https://www.npmjs.com/package/eslint-import-resolver-webpack + +# Settings + +You may set the following settings in your `.eslintrc`: + +#### `import/extensions` + +A list of file extensions that will be parsed as modules and inspected for +`export`s. + +This defaults to `['.js']`, unless you are using the `react` shared config, +in which case it is specified as `['.js', '.jsx']`. + +```js +"settings": { + "import/extensions": [ + ".js", + ".jsx" + ] +} +``` + +If you require more granular extension definitions, you can use: + +```js +"settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx" + ] + } + } +} +``` + +Note that this is different from (and likely a subset of) any `import/resolver` +extensions settings, which may include `.json`, `.coffee`, etc. which will still +factor into the `no-unresolved` rule. + +Also, the following `import/ignore` patterns will overrule this list. + +#### `import/ignore` + +A list of regex strings that, if matched by a path, will +not report the matching module if no `export`s are found. +In practice, this means rules other than [`no-unresolved`](./docs/rules/no-unresolved.md#ignore) will not report on any +`import`s with (absolute filesystem) paths matching this pattern. + +`no-unresolved` has its own [`ignore`](./docs/rules/no-unresolved.md#ignore) setting. + +```yaml +settings: + import/ignore: + - \.coffee$ # fraught with parse errors + - \.(scss|less|css)$ # can't parse unprocessed CSS modules, either +``` + +#### `import/core-modules` + +An array of additional modules to consider as "core" modules--modules that should +be considered resolved but have no path on the filesystem. Your resolver may +already define some of these (for example, the Node resolver knows about `fs` and +`path`), so you need not redefine those. + +For example, Electron exposes an `electron` module: + +```js +import 'electron' // without extra config, will be flagged as unresolved! +``` + +that would otherwise be unresolved. To avoid this, you may provide `electron` as a +core module: + +```yaml +# .eslintrc.yml +settings: + import/core-modules: [ electron ] +``` + +In Electron's specific case, there is a shared config named `electron` +that specifies this for you. + +Contribution of more such shared configs for other platforms are welcome! + +#### `import/external-module-folders` + +An array of folders. Resolved modules only from those folders will be considered as "external". By default - `["node_modules"]`. Makes sense if you have configured your path or webpack to handle your internal paths differently and want to consider modules from some folders, for example `bower_components` or `jspm_modules`, as "external". + +This option is also useful in a monorepo setup: list here all directories that contain monorepo's packages and they will be treated as external ones no matter which resolver is used. + +Each item in this array is either a folder's name, its subpath, or its absolute prefix path: + +- `jspm_modules` will match any file or folder named `jspm_modules` or which has a direct or non-direct parent named `jspm_modules`, e.g. `/home/me/project/jspm_modules` or `/home/me/project/jspm_modules/some-pkg/index.js`. + +- `packages/core` will match any path that contains these two segments, for example `/home/me/project/packages/core/src/utils.js`. + +- `/home/me/project/packages` will only match files and directories inside this directory, and the directory itself. + +Please note that incomplete names are not allowed here so `components` won't match `bower_components` and `packages/ui` won't match `packages/ui-utils` (but will match `packages/ui/utils`). + +#### `import/parsers` + +A map from parsers to file extension arrays. If a file extension is matched, the +dependency parser will require and use the map key as the parser instead of the +configured ESLint parser. This is useful if you're inter-op-ing with TypeScript +directly using webpack, for example: + +```yaml +# .eslintrc.yml +settings: + import/parsers: + @typescript-eslint/parser: [ .ts, .tsx ] +``` + +In this case, [`@typescript-eslint/parser`](https://www.npmjs.com/package/@typescript-eslint/parser) +must be installed and require-able from the running `eslint` module's location +(i.e., install it as a peer of ESLint). + +This is currently only tested with `@typescript-eslint/parser` (and its predecessor, +`typescript-eslint-parser`) but should theoretically work with any moderately +ESTree-compliant parser. + +It's difficult to say how well various plugin features will be supported, too, +depending on how far down the rabbit hole goes. Submit an issue if you find strange +behavior beyond here, but steel your heart against the likely outcome of closing +with `wontfix`. + + +#### `import/resolver` + +See [resolvers](#resolvers). + +#### `import/cache` + +Settings for cache behavior. Memoization is used at various levels to avoid the copious amount of `fs.statSync`/module parse calls required to correctly report errors. + +For normal `eslint` console runs, the cache lifetime is irrelevant, as we can strongly assume that files should not be changing during the lifetime of the linter process (and thus, the cache in memory) + +For long-lasting processes, like [`eslint_d`] or [`eslint-loader`], however, it's important that there be some notion of staleness. + +If you never use [`eslint_d`] or [`eslint-loader`], you may set the cache lifetime to `Infinity` and everything should be fine: + +```yaml +# .eslintrc.yml +settings: + import/cache: + lifetime: ∞ # or Infinity +``` + +Otherwise, set some integer, and cache entries will be evicted after that many seconds have elapsed: + +```yaml +# .eslintrc.yml +settings: + import/cache: + lifetime: 5 # 30 is the default +``` + +[`eslint_d`]: https://www.npmjs.com/package/eslint_d +[`eslint-loader`]: https://www.npmjs.com/package/eslint-loader + +#### `import/internal-regex` + +A regex for packages should be treated as internal. Useful when you are utilizing a monorepo setup or developing a set of packages that depend on each other. + +By default, any package referenced from [`import/external-module-folders`](#importexternal-module-folders) will be considered as "external", including packages in a monorepo like yarn workspace or lerna environment. If you want to mark these packages as "internal" this will be useful. + +For example, if your packages in a monorepo are all in `@scope`, you can configure `import/internal-regex` like this + +```yaml +# .eslintrc.yml +settings: + import/internal-regex: ^@scope/ +``` + + +## SublimeLinter-eslint + +SublimeLinter-eslint introduced a change to support `.eslintignore` files +which altered the way file paths are passed to ESLint when linting during editing. +This change sends a relative path instead of the absolute path to the file (as ESLint +normally provides), which can make it impossible for this plugin to resolve dependencies +on the filesystem. + +This workaround should no longer be necessary with the release of ESLint 2.0, when +`.eslintignore` will be updated to work more like a `.gitignore`, which should +support proper ignoring of absolute paths via `--stdin-filename`. + +In the meantime, see [roadhump/SublimeLinter-eslint#58](https://github.com/roadhump/SublimeLinter-eslint/issues/58) +for more details and discussion, but essentially, you may find you need to add the following +`SublimeLinter` config to your Sublime project file: + +```json +{ + "folders": + [ + { + "path": "code" + } + ], + "SublimeLinter": + { + "linters": + { + "eslint": + { + "chdir": "${project}/code" + } + } + } +} +``` + +Note that `${project}/code` matches the `code` provided at `folders[0].path`. + +The purpose of the `chdir` setting, in this case, is to set the working directory +from which ESLint is executed to be the same as the directory on which SublimeLinter-eslint +bases the relative path it provides. + +See the SublimeLinter docs on [`chdir`](http://www.sublimelinter.com/en/latest/linter_settings.html#chdir) +for more information, in case this does not work with your project. + +If you are not using `.eslintignore`, or don't have a Sublime project file, you can also +do the following via a `.sublimelinterrc` file in some ancestor directory of your +code: + +```json +{ + "linters": { + "eslint": { + "args": ["--stdin-filename", "@"] + } + } +} +``` + +I also found that I needed to set `rc_search_limit` to `null`, which removes the file +hierarchy search limit when looking up the directory tree for `.sublimelinterrc`: + +In Package Settings / SublimeLinter / User Settings: +```json +{ + "user": { + "rc_search_limit": null + } +} +``` + +I believe this defaults to `3`, so you may not need to alter it depending on your +project folder max depth. diff --git a/node_modules/eslint-plugin-import/RELEASE.md b/node_modules/eslint-plugin-import/RELEASE.md new file mode 100644 index 000000000..e16a58993 --- /dev/null +++ b/node_modules/eslint-plugin-import/RELEASE.md @@ -0,0 +1,54 @@ +# Release steps + +1. create a `release-[x.y.z]` branch from tip of `master` (or whatever release commit) + + ```bash + git checkout master && git pull && git checkout -b release-2.1.0 + ``` + +2. bump `package.json` + update CHANGELOG version links for all releasing packages (i.e., root + any resolvers) + + In changelog for core plugin, normally leave [Unreleased] but update its link at the bottom + to be rooted at the new version's tag, and add a link for the new version rooted + at last version's tag. + + ```markdown + [Unreleased]: https://github.com/benmosher/eslint-plugin-import/compare/v2.0.1...HEAD + [2.0.1]: https://github.com/benmosher/eslint-plugin-import/compare/v2.0.0...v2.0.1 + ``` + + becomes + + ```markdown + [Unreleased]: https://github.com/benmosher/eslint-plugin-import/compare/v2.1.0...HEAD + [2.1.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.0.1...v2.1.0 + [2.0.1]: https://github.com/benmosher/eslint-plugin-import/compare/v2.0.0...v2.0.1 + ``` + + Generally, don't use `npm version` for this because it creates a tag, which I normally + wait until signoff from contributors and actually `npm publish`-ing to snap the tag. + +3. create pull request from `release-[x.y.z]` into `release` branch + + I like this because it + - lists all commits in the release + - provides a commentary location to discuss the release + - builds in CI and provides test results + +4. iterate on feedback + - handle other issues + - merge more PRs + - fix issues in changelog/docs + +5. `npm publish` from `release-[x.y.z]` branch + - don't forget resolvers! + +6. tag commit (`v[x.y.z]`) + - again, not forgetting resolvers, if needed (`resolvers/[name]/v[t.u.v]`) + +7. merge `release-[x.y.z]` into `release` ( + - ideally fast-forward, probably with Git CLI instead of Github + +8. merge `release` into `master` + +Done! diff --git a/node_modules/eslint-plugin-import/SECURITY.md b/node_modules/eslint-plugin-import/SECURITY.md new file mode 100644 index 000000000..b155f54d5 --- /dev/null +++ b/node_modules/eslint-plugin-import/SECURITY.md @@ -0,0 +1,11 @@ +# Security Policy + +## Supported Versions + +Latest major/minor version is supported only for security updates. + +## Reporting a Vulnerability + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. diff --git a/node_modules/eslint-plugin-import/config/electron.js b/node_modules/eslint-plugin-import/config/electron.js new file mode 100644 index 000000000..6fab4e8b9 --- /dev/null +++ b/node_modules/eslint-plugin-import/config/electron.js @@ -0,0 +1,8 @@ +/** + * Default settings for Electron applications. + */ +module.exports = { + settings: { + 'import/core-modules': ['electron'], + }, +} diff --git a/node_modules/eslint-plugin-import/config/errors.js b/node_modules/eslint-plugin-import/config/errors.js new file mode 100644 index 000000000..d99a9dacf --- /dev/null +++ b/node_modules/eslint-plugin-import/config/errors.js @@ -0,0 +1,14 @@ +/** + * unopinionated config. just the things that are necessarily runtime errors + * waiting to happen. + * @type {Object} + */ +module.exports = { + plugins: ['import'], + rules: { 'import/no-unresolved': 2 + , 'import/named': 2 + , 'import/namespace': 2 + , 'import/default': 2 + , 'import/export': 2, + }, +} diff --git a/node_modules/eslint-plugin-import/config/react-native.js b/node_modules/eslint-plugin-import/config/react-native.js new file mode 100644 index 000000000..fbc8652c9 --- /dev/null +++ b/node_modules/eslint-plugin-import/config/react-native.js @@ -0,0 +1,13 @@ +/** + * - adds platform extensions to Node resolver + */ +module.exports = { + settings: { + 'import/resolver': { + node: { + // Note: will not complain if only _one_ of these files exists. + extensions: ['.js', '.web.js', '.ios.js', '.android.js'], + }, + }, + }, +} diff --git a/node_modules/eslint-plugin-import/config/react.js b/node_modules/eslint-plugin-import/config/react.js new file mode 100644 index 000000000..fe1b5f2ec --- /dev/null +++ b/node_modules/eslint-plugin-import/config/react.js @@ -0,0 +1,18 @@ +/** + * Adds `.jsx` as an extension, and enables JSX parsing. + * + * Even if _you_ aren't using JSX (or .jsx) directly, if your dependencies + * define jsnext:main and have JSX internally, you may run into problems + * if you don't enable these settings at the top level. + */ +module.exports = { + + settings: { + 'import/extensions': ['.js', '.jsx'], + }, + + parserOptions: { + ecmaFeatures: { jsx: true }, + }, + +} diff --git a/node_modules/eslint-plugin-import/config/recommended.js b/node_modules/eslint-plugin-import/config/recommended.js new file mode 100644 index 000000000..997091893 --- /dev/null +++ b/node_modules/eslint-plugin-import/config/recommended.js @@ -0,0 +1,28 @@ +/** + * The basics. + * @type {Object} + */ +module.exports = { + plugins: ['import'], + + rules: { + // analysis/correctness + 'import/no-unresolved': 'error', + 'import/named': 'error', + 'import/namespace': 'error', + 'import/default': 'error', + 'import/export': 'error', + + // red flags (thus, warnings) + 'import/no-named-as-default': 'warn', + 'import/no-named-as-default-member': 'warn', + 'import/no-duplicates': 'warn', + }, + + // need all these for parsing dependencies (even if _your_ code doesn't need + // all of them) + parserOptions: { + sourceType: 'module', + ecmaVersion: 2018, + }, +} diff --git a/node_modules/eslint-plugin-import/config/stage-0.js b/node_modules/eslint-plugin-import/config/stage-0.js new file mode 100644 index 000000000..25ad75feb --- /dev/null +++ b/node_modules/eslint-plugin-import/config/stage-0.js @@ -0,0 +1,12 @@ +/** + * Rules in progress. + * + * Do not expect these to adhere to semver across releases. + * @type {Object} + */ +module.exports = { + plugins: ['import'], + rules: { + 'import/no-deprecated': 1, + }, +} diff --git a/node_modules/eslint-plugin-import/config/typescript.js b/node_modules/eslint-plugin-import/config/typescript.js new file mode 100644 index 000000000..705faaf37 --- /dev/null +++ b/node_modules/eslint-plugin-import/config/typescript.js @@ -0,0 +1,28 @@ +/** + * Adds `.jsx`, `.ts` and `.tsx` as an extension, and enables JSX/TSX parsing. + */ + +var allExtensions = ['.ts', '.tsx', '.d.ts', '.js', '.jsx'] + +module.exports = { + + settings: { + 'import/extensions': allExtensions, + 'import/external-module-folders': ['node_modules', 'node_modules/@types'], + 'import/parsers': { + '@typescript-eslint/parser': ['.ts', '.tsx', '.d.ts'], + }, + 'import/resolver': { + 'node': { + 'extensions': allExtensions, + }, + }, + }, + + rules: { + // analysis/correctness + + // TypeScript compilation already ensures that named imports exist in the referenced module + 'import/named': 'off', + }, +} diff --git a/node_modules/eslint-plugin-import/config/warnings.js b/node_modules/eslint-plugin-import/config/warnings.js new file mode 100644 index 000000000..c05eb0722 --- /dev/null +++ b/node_modules/eslint-plugin-import/config/warnings.js @@ -0,0 +1,12 @@ +/** + * more opinionated config. + * @type {Object} + */ +module.exports = { + plugins: ['import'], + rules: { + 'import/no-named-as-default': 1, + 'import/no-named-as-default-member': 1, + 'import/no-duplicates': 1, + }, +} diff --git a/node_modules/eslint-plugin-import/docs/rules/default.md b/node_modules/eslint-plugin-import/docs/rules/default.md new file mode 100644 index 000000000..f69934468 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/default.md @@ -0,0 +1,71 @@ +# import/default + +If a default import is requested, this rule will report if there is no default +export in the imported module. + +For [ES7], reports if a default is named and exported but is not found in the +referenced module. + +Note: for packages, the plugin will find exported names +from [`jsnext:main`], if present in `package.json`. +Redux's npm module includes this key, and thereby is lintable, for example. + +A module path that is [ignored] or not [unambiguously an ES module] will not be reported when imported. + +[ignored]: ../README.md#importignore +[unambiguously an ES module]: https://github.com/bmeck/UnambiguousJavaScriptGrammar + + +## Rule Details + +Given: + +```js +// ./foo.js +export default function () { return 42 } + +// ./bar.js +export function bar() { return null } + +// ./baz.js +module.exports = function () { /* ... */ } + +// node_modules/some-module/index.js +exports.sharedFunction = function shared() { /* ... */ } +``` + +The following is considered valid: + +```js +import foo from './foo' + +// assuming 'node_modules' are ignored (true by default) +import someModule from 'some-module' +``` + +...and the following cases are reported: + +```js +import bar from './bar' // no default export found in ./bar +import baz from './baz' // no default export found in ./baz +``` + + +## When Not To Use It + +If you are using CommonJS and/or modifying the exported namespace of any module at +runtime, you will likely see false positives with this rule. + +This rule currently does not interpret `module.exports = ...` as a `default` export, +either, so such a situation will be reported in the importing module. + +## Further Reading + +- Lee Byron's [ES7] export proposal +- [`import/ignore`] setting +- [`jsnext:main`] (Rollup) + + +[ES7]: https://github.com/leebyron/ecmascript-more-export-from +[`import/ignore`]: ../../README.md#importignore +[`jsnext:main`]: https://github.com/rollup/rollup/wiki/jsnext:main diff --git a/node_modules/eslint-plugin-import/docs/rules/dynamic-import-chunkname.md b/node_modules/eslint-plugin-import/docs/rules/dynamic-import-chunkname.md new file mode 100644 index 000000000..4bcc5a98b --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/dynamic-import-chunkname.md @@ -0,0 +1,85 @@ +# dynamic imports require a leading comment with a webpackChunkName (dynamic-import-chunkname) + +This rule reports any dynamic imports without a webpackChunkName specified in a leading block comment in the proper format. + +This rule enforces naming of webpack chunks in dynamic imports. When you don't explicitly name chunks, webpack will autogenerate chunk names that are not consistent across builds, which prevents long-term browser caching. + +## Rule Details +This rule runs against `import()` by default, but can be configured to also run against an alternative dynamic-import function, e.g. 'dynamicImport.' +You can also configure the regex format you'd like to accept for the webpackChunkName - for example, if we don't want the number 6 to show up in our chunk names: + ```javascript +{ + "dynamic-import-chunkname": [2, { + importFunctions: ["dynamicImport"], + webpackChunknameFormat: "[a-zA-Z0-57-9-/_]+" + }] +} +``` + +### invalid +The following patterns are invalid: + +```javascript +// no leading comment +import('someModule'); + +// incorrectly formatted comment +import( + /*webpackChunkName:"someModule"*/ + 'someModule', +); +import( + /* webpackChunkName : "someModule" */ + 'someModule', +); + +// chunkname contains a 6 (forbidden by rule config) +import( + /* webpackChunkName: "someModule6" */ + 'someModule', +); + +// using single quotes instead of double quotes +import( + /* webpackChunkName: 'someModule' */ + 'someModule', +); + +// invalid syntax for webpack comment +import( + /* totally not webpackChunkName: "someModule" */ + 'someModule', +); + +// single-line comment, not a block-style comment +import( + // webpackChunkName: "someModule" + 'someModule', +); +``` +### valid +The following patterns are valid: + +```javascript + import( + /* webpackChunkName: "someModule" */ + 'someModule', + ); + import( + /* webpackChunkName: "someOtherModule12345789" */ + 'someModule', + ); + import( + /* webpackChunkName: "someModule" */ + /* webpackPrefetch: true */ + 'someModule', + ); + import( + /* webpackChunkName: "someModule", webpackPrefetch: true */ + 'someModule', + ); +``` + +## When Not To Use It + +If you don't care that webpack will autogenerate chunk names and may blow up browser caches and bundle size reports. diff --git a/node_modules/eslint-plugin-import/docs/rules/export.md b/node_modules/eslint-plugin-import/docs/rules/export.md new file mode 100644 index 000000000..e99882be8 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/export.md @@ -0,0 +1,32 @@ +# import/export + +Reports funny business with exports, like repeated exports of names or defaults. + +## Rule Details + +```js +export default class MyClass { /*...*/ } // Multiple default exports. + +function makeClass() { return new MyClass(...arguments) } + +export default makeClass // Multiple default exports. +``` + +or +```js +export const foo = function () { /*...*/ } // Multiple exports of name 'foo'. + +function bar() { /*...*/ } +export { bar as foo } // Multiple exports of name 'foo'. +``` + +In the case of named/default re-export, all `n` re-exports will be reported, +as at least `n-1` of them are clearly mistakes, but it is not clear which one +(if any) is intended. Could be the result of copy/paste, code duplication with +intent to rename, etc. + +## Further Reading + +- Lee Byron's [ES7] export proposal + +[ES7]: https://github.com/leebyron/ecmascript-more-export-from diff --git a/node_modules/eslint-plugin-import/docs/rules/exports-last.md b/node_modules/eslint-plugin-import/docs/rules/exports-last.md new file mode 100644 index 000000000..291daee48 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/exports-last.md @@ -0,0 +1,50 @@ +# import/exports-last + +This rule enforces that all exports are declared at the bottom of the file. This rule will report any export declarations that comes before any non-export statements. + + +## This will be reported + +```JS + +const bool = true + +export default bool + +const str = 'foo' + +``` + +```JS + +export const bool = true + +const str = 'foo' + +``` + +## This will not be reported + +```JS +const arr = ['bar'] + +export const bool = true + +export default bool + +export function func() { + console.log('Hello World 🌍') +} + +export const str = 'foo' +``` + +## When Not To Use It + +If you don't mind exports being sprinkled throughout a file, you may not want to enable this rule. + +#### ES6 exports only + +The exports-last rule is currently only working on ES6 exports. You may not want to enable this rule if you're using CommonJS exports. + +If you need CommonJS support feel free to open an issue or create a PR. diff --git a/node_modules/eslint-plugin-import/docs/rules/extensions.md b/node_modules/eslint-plugin-import/docs/rules/extensions.md new file mode 100644 index 000000000..2f6d4a9c7 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/extensions.md @@ -0,0 +1,167 @@ +# import/extensions - Ensure consistent use of file extension within the import path + +Some file resolve algorithms allow you to omit the file extension within the import source path. For example the `node` resolver can resolve `./foo/bar` to the absolute path `/User/someone/foo/bar.js` because the `.js` extension is resolved automatically by default. Depending on the resolver you can configure more extensions to get resolved automatically. + +In order to provide a consistent use of file extensions across your code base, this rule can enforce or disallow the use of certain file extensions. + +## Rule Details + +This rule either takes one string option, one object option, or a string and an object option. If it is the string `"never"` (the default value), then the rule forbids the use for any extension. If it is the string `"always"`, then the rule enforces the use of extensions for all import statements. If it is the string `"ignorePackages"`, then the rule enforces the use of extensions for all import statements except package imports. + +``` +"import/extensions": [, "never" | "always" | "ignorePackages"] +``` + +By providing an object you can configure each extension separately. + +``` +"import/extensions": [, { + : "never" | "always" | "ignorePackages" +}] +``` + + For example `{ "js": "always", "json": "never" }` would always enforce the use of the `.js` extension but never allow the use of the `.json` extension. + +By providing both a string and an object, the string will set the default setting for all extensions, and the object can be used to set granular overrides for specific extensions. + +``` +"import/extensions": [ + , + "never" | "always" | "ignorePackages", + { + : "never" | "always" | "ignorePackages" + } +] +``` + +For example, `["error", "never", { "svg": "always" }]` would require that all extensions are omitted, except for "svg". + +`ignorePackages` can be set as a separate boolean option like this: +``` +"import/extensions": [ + , + "never" | "always" | "ignorePackages", + { + ignorePackages: true | false, + pattern: { + : "never" | "always" | "ignorePackages" + } + } +] +``` +In that case, if you still want to specify extensions, you can do so inside the **pattern** property. +Default value of `ignorePackages` is `false`. + + +### Exception + +When disallowing the use of certain extensions this rule makes an exception and allows the use of extension when the file would not be resolvable without extension. + +For example, given the following folder structure: + +``` +├── foo +│   ├── bar.js +│   ├── bar.json +``` + +and this import statement: + +```js +import bar from './foo/bar.json'; +``` + +then the extension can’t be omitted because it would then resolve to `./foo/bar.js`. + +### Examples + +The following patterns are considered problems when configuration set to "never": + +```js +import foo from './foo.js'; + +import bar from './bar.json'; + +import Component from './Component.jsx'; + +import express from 'express/index.js'; +``` + +The following patterns are not considered problems when configuration set to "never": + +```js +import foo from './foo'; + +import bar from './bar'; + +import Component from './Component'; + +import express from 'express/index'; + +import * as path from 'path'; +``` + +The following patterns are considered problems when configuration set to "always": + +```js +import foo from './foo'; + +import bar from './bar'; + +import Component from './Component'; + +import express from 'express'; +``` + +The following patterns are not considered problems when configuration set to "always": + +```js +import foo from './foo.js'; + +import bar from './bar.json'; + +import Component from './Component.jsx'; + +import express from 'express/index.js'; + +import * as path from 'path'; +``` + +The following patterns are considered problems when configuration set to "ignorePackages": + +```js +import foo from './foo'; + +import bar from './bar'; + +import Component from './Component'; + +``` + +The following patterns are not considered problems when configuration set to "ignorePackages": + +```js +import foo from './foo.js'; + +import bar from './bar.json'; + +import Component from './Component.jsx'; + +import express from 'express'; + +``` + +The following patterns are not considered problems when configuration set to `['error', 'always', {ignorePackages: true} ]`: + +```js +import Component from './Component.jsx'; + +import baz from 'foo/baz.js'; + +import express from 'express'; + +``` + +## When Not To Use It + +If you are not concerned about a consistent usage of file extension. diff --git a/node_modules/eslint-plugin-import/docs/rules/first.md b/node_modules/eslint-plugin-import/docs/rules/first.md new file mode 100644 index 000000000..eada966c8 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/first.md @@ -0,0 +1,70 @@ +# import/first + +This rule reports any imports that come after non-import +statements. + +## Rule Details + +```js +import foo from './foo' + +// some module-level initializer +initWith(foo) + +import bar from './bar' // <- reported +``` + +Providing `absolute-first` as an option will report any absolute imports (i.e. +packages) that come after any relative imports: + +```js +import foo from 'foo' +import bar from './bar' + +import * as _ from 'lodash' // <- reported +``` + +If you really want import type ordering, check out [`import/order`]. + +Notably, `import`s are hoisted, which means the imported modules will be evaluated +before any of the statements interspersed between them. Keeping all `import`s together +at the top of the file may prevent surprises resulting from this part of the spec. + +### On directives + +Directives are allowed as long as they occur strictly before any `import` declarations, +as follows: + +```js +'use super-mega-strict' + +import { suchFoo } from 'lame-fake-module-name' // no report here +``` + +A directive in this case is assumed to be a single statement that contains only +a literal string-valued expression. + +`'use strict'` would be a good example, except that [modules are always in strict +mode](http://www.ecma-international.org/ecma-262/6.0/#sec-strict-mode-code) so it would be surprising to see a `'use strict'` sharing a file with `import`s and +`export`s. + +Given that, see [#255] for the reasoning. + +### With Fixer + +This rule contains a fixer to reorder in-body import to top, the following criteria applied: +1. Never re-order relative to each other, even if `absolute-first` is set. +2. If an import creates an identifier, and that identifier is referenced at module level *before* the import itself, that won't be re-ordered. + +## When Not To Use It + +If you don't mind imports being sprinkled throughout, you may not want to +enable this rule. + +## Further Reading + +- [`import/order`]: a major step up from `absolute-first` +- Issue [#255] + +[`import/order`]: ./order.md +[#255]: https://github.com/benmosher/eslint-plugin-import/issues/255 diff --git a/node_modules/eslint-plugin-import/docs/rules/group-exports.md b/node_modules/eslint-plugin-import/docs/rules/group-exports.md new file mode 100644 index 000000000..e6b9887b2 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/group-exports.md @@ -0,0 +1,117 @@ +# import/group-exports + +Reports when named exports are not grouped together in a single `export` declaration or when multiple assignments to CommonJS `module.exports` or `exports` object are present in a single file. + +**Rationale:** An `export` declaration or `module.exports` assignment can appear anywhere in the code. By requiring a single export declaration all your exports will remain at one place, making it easier to see what exports a module provides. + +## Rule Details + +This rule warns whenever a single file contains multiple named export declarations or multiple assignments to `module.exports` (or `exports`). + +### Valid + +```js +// A single named export declaration -> ok +export const valid = true +``` + +```js +const first = true +const second = true + +// A single named export declaration -> ok +export { + first, + second, +} +``` + +```js +// Aggregating exports -> ok +export { default as module1 } from 'module-1' +export { default as module2 } from 'module-2' +``` + +```js +// A single exports assignment -> ok +module.exports = { + first: true, + second: true +} +``` + +```js +const first = true +const second = true + +// A single exports assignment -> ok +module.exports = { + first, + second, +} +``` + +```js +function test() {} +test.property = true +test.another = true + +// A single exports assignment -> ok +module.exports = test +``` + +```flow js +const first = true; +type firstType = boolean + +// A single named export declaration (type exports handled separately) -> ok +export {first} +export type {firstType} +``` + + +### Invalid + +```js +// Multiple named export statements -> not ok! +export const first = true +export const second = true +``` + +```js +// Aggregating exports from the same module -> not ok! +export { module1 } from 'module-1' +export { module2 } from 'module-1' +``` + +```js +// Multiple exports assignments -> not ok! +exports.first = true +exports.second = true +``` + +```js +// Multiple exports assignments -> not ok! +module.exports = {} +module.exports.first = true +``` + +```js +// Multiple exports assignments -> not ok! +module.exports = () => {} +module.exports.first = true +module.exports.second = true +``` + +```flow js +type firstType = boolean +type secondType = any + +// Multiple named type export statements -> not ok! +export type {firstType} +export type {secondType} +``` + +## When Not To Use It + +If you do not mind having your exports spread across the file, you can safely turn this rule off. diff --git a/node_modules/eslint-plugin-import/docs/rules/imports-first.md b/node_modules/eslint-plugin-import/docs/rules/imports-first.md new file mode 100644 index 000000000..b7f20754a --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/imports-first.md @@ -0,0 +1,3 @@ +# imports-first + +This rule was **deprecated** in eslint-plugin-import v2.0.0. Please use the corresponding rule [`first`](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/first.md). diff --git a/node_modules/eslint-plugin-import/docs/rules/max-dependencies.md b/node_modules/eslint-plugin-import/docs/rules/max-dependencies.md new file mode 100644 index 000000000..20d29cf0e --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/max-dependencies.md @@ -0,0 +1,44 @@ +# import/max-dependencies + +Forbid modules to have too many dependencies (`import` or `require` statements). + +This is a useful rule because a module with too many dependencies is a code smell, and usually indicates the module is doing too much and/or should be broken up into smaller modules. + +Importing multiple named exports from a single module will only count once (e.g. `import {x, y, z} from './foo'` will only count as a single dependency). + +### Options + +This rule takes the following option: + +`max`: The maximum number of dependencies allowed. Anything over will trigger the rule. **Default is 10** if the rule is enabled and no `max` is specified. + +You can set the option like this: + +```js +"import/max-dependencies": ["error", {"max": 10}] +``` + + +## Example + +Given a max value of `{"max": 2}`: + +### Fail + +```js +import a from './a'; // 1 +const b = require('./b'); // 2 +import c from './c'; // 3 - exceeds max! +``` + +### Pass + +```js +import a from './a'; // 1 +const anotherA = require('./a'); // still 1 +import {x, y, z} from './foo'; // 2 +``` + +## When Not To Use It + +If you don't care how many dependencies a module has. diff --git a/node_modules/eslint-plugin-import/docs/rules/named.md b/node_modules/eslint-plugin-import/docs/rules/named.md new file mode 100644 index 000000000..01ccb14ae --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/named.md @@ -0,0 +1,98 @@ +# import/named + +Verifies that all named imports are part of the set of named exports in the referenced module. + +For `export`, verifies that all named exports exist in the referenced module. + +Note: for packages, the plugin will find exported names +from [`jsnext:main`], if present in `package.json`. +Redux's npm module includes this key, and thereby is lintable, for example. + +A module path that is [ignored] or not [unambiguously an ES module] will not be reported when imported. Note that type imports and exports, as used by [Flow], are always ignored. + +[ignored]: ../../README.md#importignore +[unambiguously an ES module]: https://github.com/bmeck/UnambiguousJavaScriptGrammar +[Flow]: https://flow.org/ + + +## Rule Details + +Given: + +```js +// ./foo.js +export const foo = "I'm so foo" +``` + +The following is considered valid: + +```js +// ./bar.js +import { foo } from './foo' + +// ES7 proposal +export { foo as bar } from './foo' + +// node_modules without jsnext:main are not analyzed by default +// (import/ignore setting) +import { SomeNonsenseThatDoesntExist } from 'react' +``` + +...and the following are reported: + +```js +// ./baz.js +import { notFoo } from './foo' + +// ES7 proposal +export { notFoo as defNotBar } from './foo' + +// will follow 'jsnext:main', if available +import { dontCreateStore } from 'redux' +``` + +### Settings + +[`import/ignore`] can be provided as a setting to ignore certain modules (node_modules, +CoffeeScript, CSS if using Webpack, etc.). + +Given: + +```yaml +# .eslintrc (YAML) +--- +settings: + import/ignore: + - node_modules # included by default, but replaced if explicitly configured + - *.coffee$ # can't parse CoffeeScript (unless a custom polyglot parser was configured) +``` + +and + +```coffeescript +# ./whatever.coffee +exports.whatever = (foo) -> console.log foo +``` + +then the following is not reported: + +```js +// ./foo.js + +// can't be analyzed, and ignored, so not reported +import { notWhatever } from './whatever' +``` + +## When Not To Use It + +If you are using CommonJS and/or modifying the exported namespace of any module at +runtime, you will likely see false positives with this rule. + +## Further Reading + +- [`import/ignore`] setting +- [`jsnext:main`] (Rollup) + + +[`jsnext:main`]: https://github.com/rollup/rollup/wiki/jsnext:main +[`import/ignore`]: ../../README.md#importignore diff --git a/node_modules/eslint-plugin-import/docs/rules/namespace.md b/node_modules/eslint-plugin-import/docs/rules/namespace.md new file mode 100644 index 000000000..4bbbd378e --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/namespace.md @@ -0,0 +1,99 @@ +# import/namespace + +Enforces names exist at the time they are dereferenced, when imported as a full namespace (i.e. `import * as foo from './foo'; foo.bar();` will report if `bar` is not exported by `./foo`.). + +Will report at the import declaration if there are _no_ exported names found. + +Also, will report for computed references (i.e. `foo["bar"]()`). + +Reports on assignment to a member of an imported namespace. + +Note: for packages, the plugin will find exported names +from [`jsnext:main`], if present in `package.json`. +Redux's npm module includes this key, and thereby is lintable, for example. + +A module path that is [ignored] or not [unambiguously an ES module] will not be reported when imported. + +[ignored]: ../README.md#importignore +[unambiguously an ES module]: https://github.com/bmeck/UnambiguousJavaScriptGrammar + +## Rule Details + +Currently, this rule does not check for possible +redefinition of the namespace in an intermediate scope. Adherence to the ESLint +`no-shadow` rule for namespaces will prevent this from being a problem. + +For [ES7], reports if an exported namespace would be empty (no names exported from the referenced module.) + +Given: +```js +// @module ./named-exports +export const a = 1 +const b = 2 +export { b } + +const c = 3 +export { c as d } + +export class ExportedClass { } + +// ES7 +export * as deep from './deep' +``` +and: +```js +// @module ./deep +export const e = "MC2" +``` + +See what is valid and reported: + +```js +// @module ./foo +import * as names from './named-exports' + +function great() { + return names.a + names.b // so great https://youtu.be/ei7mb8UxEl8 +} + +function notGreat() { + doSomethingWith(names.c) // Reported: 'c' not found in imported namespace 'names'. + + const { a, b, c } = names // also reported, only for 'c' +} + +// also tunnels through re-exported namespaces! +function deepTrouble() { + doSomethingWith(names.deep.e) // fine + doSomethingWith(names.deep.f) // Reported: 'f' not found in deeply imported namespace 'names.deep'. +} + +``` + +### Options + +#### `allowComputed` + +Defaults to `false`. When false, will report the following: + +```js +/*eslint import/namespace: [2, { allowComputed: false }]*/ +import * as a from './a' + +function f(x) { + return a[x] // Unable to validate computed reference to imported namespace 'a'. +} +``` + +When set to `true`, the above computed namespace member reference is allowed, but +still can't be statically analyzed any further. + +## Further Reading + +- Lee Byron's [ES7] export proposal +- [`import/ignore`] setting +- [`jsnext:main`](Rollup) + +[ES7]: https://github.com/leebyron/ecmascript-more-export-from +[`import/ignore`]: ../../README.md#importignore +[`jsnext:main`]: https://github.com/rollup/rollup/wiki/jsnext:main diff --git a/node_modules/eslint-plugin-import/docs/rules/newline-after-import.md b/node_modules/eslint-plugin-import/docs/rules/newline-after-import.md new file mode 100644 index 000000000..4883776c9 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/newline-after-import.md @@ -0,0 +1,87 @@ +# import/newline-after-import + +Enforces having one or more empty lines after the last top-level import statement or require call. ++(fixable) The `--fix` option on the [command line] automatically fixes problems reported by this rule. + +## Rule Details + +This rule has one option, `count` which sets the number of newlines that are enforced after the last top-level import statement or require call. This option defaults to `1`. + +Valid: + +```js +import defaultExport from './foo' + +const FOO = 'BAR' +``` + +```js +import defaultExport from './foo' +import { bar } from 'bar-lib' + +const FOO = 'BAR' +``` + +```js +const FOO = require('./foo') +const BAR = require('./bar') + +const BAZ = 1 +``` + +Invalid: + +```js +import * as foo from 'foo' +const FOO = 'BAR' +``` + +```js +import * as foo from 'foo' +const FOO = 'BAR' + +import { bar } from 'bar-lib' +``` + +```js +const FOO = require('./foo') +const BAZ = 1 +const BAR = require('./bar') +``` + +With `count` set to `2` this will be considered valid: + +```js +import defaultExport from './foo' + + +const FOO = 'BAR' +``` + +With `count` set to `2` these will be considered invalid: + +```js +import defaultExport from './foo' +const FOO = 'BAR' +``` + +```js +import defaultExport from './foo' + +const FOO = 'BAR' +``` + + +## Example options usage +```json +{ + "rules": { + "import/newline-after-import": ["error", { "count": 2 }] + } +} +``` + + +## When Not To Use It + +If you like to visually group module imports with its usage, you don't want to use this rule. diff --git a/node_modules/eslint-plugin-import/docs/rules/no-absolute-path.md b/node_modules/eslint-plugin-import/docs/rules/no-absolute-path.md new file mode 100644 index 000000000..305e8e605 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-absolute-path.md @@ -0,0 +1,48 @@ +# import/no-absolute-path: Forbid import of modules using absolute paths + +Node.js allows the import of modules using an absolute path such as `/home/xyz/file.js`. That is a bad practice as it ties the code using it to your computer, and therefore makes it unusable in packages distributed on `npm` for instance. + +## Rule Details + +### Fail + +```js +import f from '/foo'; +import f from '/some/path'; + +var f = require('/foo'); +var f = require('/some/path'); +``` + +### Pass + +```js +import _ from 'lodash'; +import foo from 'foo'; +import foo from './foo'; + +var _ = require('lodash'); +var foo = require('foo'); +var foo = require('./foo'); +``` + +### Options + +By default, only ES6 imports and CommonJS `require` calls will have this rule enforced. + +You may provide an options object providing true/false for any of + +- `esmodule`: defaults to `true` +- `commonjs`: defaults to `true` +- `amd`: defaults to `false` + +If `{ amd: true }` is provided, dependency paths for AMD-style `define` and `require` +calls will be resolved: + +```js +/*eslint import/no-absolute-path: [2, { commonjs: false, amd: true }]*/ +define(['/foo'], function (foo) { /*...*/ }) // reported +require(['/foo'], function (foo) { /*...*/ }) // reported + +const foo = require('/foo') // ignored because of explicit `commonjs: false` +``` diff --git a/node_modules/eslint-plugin-import/docs/rules/no-amd.md b/node_modules/eslint-plugin-import/docs/rules/no-amd.md new file mode 100644 index 000000000..f7146c134 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-amd.md @@ -0,0 +1,35 @@ +# import/no-amd + +Reports `require([array], ...)` and `define([array], ...)` function calls at the +module scope. Will not report if !=2 arguments, or first argument is not a literal array. + +Intended for temporary use when migrating to pure ES6 modules. + +## Rule Details + +This will be reported: + +```js +define(["a", "b"], function (a, b) { /* ... */ }) + +require(["b", "c"], function (b, c) { /* ... */ }) +``` + +CommonJS `require` is still valid. + +## When Not To Use It + +If you don't mind mixing module systems (sometimes this is useful), you probably +don't want this rule. + +It is also fairly noisy if you have a larger codebase that is being transitioned +from AMD to ES6 modules. + +## Contributors + +Special thanks to @xjamundx for donating his no-define rule as a start to this. + +## Further Reading + +- [`no-commonjs`](./no-commonjs.md): report CommonJS `require` and `exports` +- Source: https://github.com/xjamundx/eslint-plugin-modules diff --git a/node_modules/eslint-plugin-import/docs/rules/no-anonymous-default-export.md b/node_modules/eslint-plugin-import/docs/rules/no-anonymous-default-export.md new file mode 100644 index 000000000..c8db89790 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-anonymous-default-export.md @@ -0,0 +1,73 @@ +# import/no-anonymous-default-export + +Reports if a module's default export is unnamed. This includes several types of unnamed data types; literals, object expressions, arrays, anonymous functions, arrow functions, and anonymous class declarations. + +Ensuring that default exports are named helps improve the grepability of the codebase by encouraging the re-use of the same identifier for the module's default export at its declaration site and at its import sites. + +## Options + +By default, all types of anonymous default exports are forbidden, but any types can be selectively allowed by toggling them on in the options. + +The complete default configuration looks like this. + +```js +"import/no-anonymous-default-export": ["error", { + "allowArray": false, + "allowArrowFunction": false, + "allowAnonymousClass": false, + "allowAnonymousFunction": false, + "allowCallExpression": true, // The true value here is for backward compatibility + "allowLiteral": false, + "allowObject": false +}] +``` + +## Rule Details + +### Fail +```js +export default [] + +export default () => {} + +export default class {} + +export default function () {} + +/* eslint import/no-anonymous-default-export: [2, {"allowCallExpression": false}] */ +export default foo(bar) + +export default 123 + +export default {} +``` + +### Pass +```js +const foo = 123 +export default foo + +export default class MyClass() {} + +export default function foo() {} + +/* eslint import/no-anonymous-default-export: [2, {"allowArray": true}] */ +export default [] + +/* eslint import/no-anonymous-default-export: [2, {"allowArrowFunction": true}] */ +export default () => {} + +/* eslint import/no-anonymous-default-export: [2, {"allowAnonymousClass": true}] */ +export default class {} + +/* eslint import/no-anonymous-default-export: [2, {"allowAnonymousFunction": true}] */ +export default function () {} + +export default foo(bar) + +/* eslint import/no-anonymous-default-export: [2, {"allowLiteral": true}] */ +export default 123 + +/* eslint import/no-anonymous-default-export: [2, {"allowObject": true}] */ +export default {} +``` diff --git a/node_modules/eslint-plugin-import/docs/rules/no-commonjs.md b/node_modules/eslint-plugin-import/docs/rules/no-commonjs.md new file mode 100644 index 000000000..7be4bb399 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-commonjs.md @@ -0,0 +1,95 @@ +# import/no-commonjs + +Reports `require([string])` function calls. Will not report if >1 argument, +or single argument is not a literal string. + +Reports `module.exports` or `exports.*`, also. + +Intended for temporary use when migrating to pure ES6 modules. + +## Rule Details + +This will be reported: + +```js +var mod = require('./mod') + , common = require('./common') + , fs = require('fs') + , whateverModule = require('./not-found') + +module.exports = { a: "b" } +exports.c = "d" +``` + +### Allow require + +If `allowRequire` option is set to `true`, `require` calls are valid: + +```js +/*eslint no-commonjs: [2, { allowRequire: true }]*/ +var mod = require('./mod'); +``` + +but `module.exports` is reported as usual. + +### Allow conditional require + +By default, conditional requires are allowed: + +```js +var a = b && require("c") + +if (typeof window !== "undefined") { + require('that-ugly-thing'); +} + +var fs = null; +try { + fs = require("fs") +} catch (error) {} +``` + +If the `allowConditionalRequire` option is set to `false`, they will be reported. + +If you don't rely on synchronous module loading, check out [dynamic import](https://github.com/airbnb/babel-plugin-dynamic-import-node). + +### Allow primitive modules + +If `allowPrimitiveModules` option is set to `true`, the following is valid: + +```js +/*eslint no-commonjs: [2, { allowPrimitiveModules: true }]*/ + +module.exports = "foo" +module.exports = function rule(context) { return { /* ... */ } } +``` + +but this is still reported: + +```js +/*eslint no-commonjs: [2, { allowPrimitiveModules: true }]*/ + +module.exports = { x: "y" } +exports.z = function boop() { /* ... */ } +``` + +This is useful for things like ESLint rule modules, which must export a function as +the module. + +## When Not To Use It + +If you don't mind mixing module systems (sometimes this is useful), you probably +don't want this rule. + +It is also fairly noisy if you have a larger codebase that is being transitioned +from CommonJS to ES6 modules. + + +## Contributors + +Special thanks to @xjamundx for donating the module.exports and exports.* bits. + +## Further Reading + +- [`no-amd`](./no-amd.md): report on AMD `require`, `define` +- Source: https://github.com/xjamundx/eslint-plugin-modules diff --git a/node_modules/eslint-plugin-import/docs/rules/no-cycle.md b/node_modules/eslint-plugin-import/docs/rules/no-cycle.md new file mode 100644 index 000000000..7d54e81ff --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-cycle.md @@ -0,0 +1,92 @@ +# import/no-cycle + +Ensures that there is no resolvable path back to this module via its dependencies. + +This includes cycles of depth 1 (imported module imports me) to `"∞"` (or `Infinity`), if the +[`maxDepth`](#maxdepth) option is not set. + +```js +// dep-b.js +import './dep-a.js' + +export function b() { /* ... */ } +``` + +```js +// dep-a.js +import { b } from './dep-b.js' // reported: Dependency cycle detected. +``` + +This rule does _not_ detect imports that resolve directly to the linted module; +for that, see [`no-self-import`]. + + +## Rule Details + +### Options + +By default, this rule only detects cycles for ES6 imports, but see the [`no-unresolved` options](./no-unresolved.md#options) as this rule also supports the same `commonjs` and `amd` flags. However, these flags only impact which import types are _linted_; the +import/export infrastructure only registers `import` statements in dependencies, so +cycles created by `require` within imported modules may not be detected. + +#### `maxDepth` + +There is a `maxDepth` option available to prevent full expansion of very deep dependency trees: + +```js +/*eslint import/no-cycle: [2, { maxDepth: 1 }]*/ + +// dep-c.js +import './dep-a.js' +``` + +```js +// dep-b.js +import './dep-c.js' + +export function b() { /* ... */ } +``` + +```js +// dep-a.js +import { b } from './dep-b.js' // not reported as the cycle is at depth 2 +``` + +This is not necessarily recommended, but available as a cost/benefit tradeoff mechanism +for reducing total project lint time, if needed. + +#### `ignoreExternal` + +An `ignoreExternal` option is available to prevent the cycle detection to expand to external modules: + +```js +/*eslint import/no-cycle: [2, { ignoreExternal: true }]*/ + +// dep-a.js +import 'module-b/dep-b.js' + +export function a() { /* ... */ } +``` + +```js +// node_modules/module-b/dep-b.js +import { a } from './dep-a.js' // not reported as this module is external +``` + +Its value is `false` by default, but can be set to `true` for reducing total project lint time, if needed. + +## When Not To Use It + +This rule is comparatively computationally expensive. If you are pressed for lint +time, or don't think you have an issue with dependency cycles, you may not want +this rule enabled. + +## Further Reading + +- [Original inspiring issue](https://github.com/benmosher/eslint-plugin-import/issues/941) +- Rule to detect that module imports itself: [`no-self-import`] +- [`import/external-module-folders`] setting + +[`no-self-import`]: ./no-self-import.md + +[`import/external-module-folders`]: ../../README.md#importexternal-module-folders diff --git a/node_modules/eslint-plugin-import/docs/rules/no-default-export.md b/node_modules/eslint-plugin-import/docs/rules/no-default-export.md new file mode 100644 index 000000000..4f1a300a2 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-default-export.md @@ -0,0 +1,63 @@ +# `import/no-default-export` + +Prohibit default exports. Mostly an inverse of [`prefer-default-export`]. + +[`prefer-default-export`]: ./prefer-default-export.md + +## Rule Details + +The following patterns are considered warnings: + +```javascript +// bad1.js + +// There is a default export. +export const foo = 'foo'; +const bar = 'bar'; +export default 'bar'; +``` + +```javascript +// bad2.js + +// There is a default export. +const foo = 'foo'; +export { foo as default } +``` + +The following patterns are not warnings: + +```javascript +// good1.js + +// There is only a single module export and it's a named export. +export const foo = 'foo'; +``` + +```javascript +// good2.js + +// There is more than one named export in the module. +export const foo = 'foo'; +export const bar = 'bar'; +``` + +```javascript +// good3.js + +// There is more than one named export in the module +const foo = 'foo'; +const bar = 'bar'; +export { foo, bar } +``` + +```javascript +// export-star.js + +// Any batch export will disable this rule. The remote module is not inspected. +export * from './other-module' +``` + +## When Not To Use It + +If you don't care if default imports are used, or if you prefer default imports over named imports. diff --git a/node_modules/eslint-plugin-import/docs/rules/no-deprecated.md b/node_modules/eslint-plugin-import/docs/rules/no-deprecated.md new file mode 100644 index 000000000..c948b5178 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-deprecated.md @@ -0,0 +1,61 @@ +# `import/no-deprecated` + +Reports use of a deprecated name, as indicated by a JSDoc block with a `@deprecated` +tag or TomDoc `Deprecated: ` comment. + +using a JSDoc `@deprecated` tag: + +```js +// @file: ./answer.js + +/** + * this is what you get when you trust a mouse talk show + * @deprecated need to restart the experiment + * @returns {Number} nonsense + */ +export function multiply(six, nine) { + return 42 +} +``` + +will report as such: + +```js +import { multiply } from './answer' // Deprecated: need to restart the experiment + +function whatever(y, z) { + return multiply(y, z) // Deprecated: need to restart the experiment +} +``` + +or using the TomDoc equivalent: + +```js +// Deprecated: This is what you get when you trust a mouse talk show, need to +// restart the experiment. +// +// Returns a Number nonsense +export function multiply(six, nine) { + return 42 +} +``` + +Only JSDoc is enabled by default. Other documentation styles can be enabled with +the `import/docstyle` setting. + + +```yaml +# .eslintrc.yml +settings: + import/docstyle: ['jsdoc', 'tomdoc'] +``` + +### Worklist + +- [x] report explicit imports on the import node +- [x] support namespaces + - [x] should bubble up through deep namespaces (#157) +- [x] report explicit imports at reference time (at the identifier) similar to namespace +- [x] mark module deprecated if file JSDoc has a @deprecated tag? +- [ ] don't flag redeclaration of imported, deprecated names +- [ ] flag destructuring diff --git a/node_modules/eslint-plugin-import/docs/rules/no-duplicates.md b/node_modules/eslint-plugin-import/docs/rules/no-duplicates.md new file mode 100644 index 000000000..f59b14d9c --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-duplicates.md @@ -0,0 +1,69 @@ +# import/no-duplicates + +Reports if a resolved path is imported more than once. ++(fixable) The `--fix` option on the [command line] automatically fixes some problems reported by this rule. + +ESLint core has a similar rule ([`no-duplicate-imports`](http://eslint.org/docs/rules/no-duplicate-imports)), but this version +is different in two key ways: + +1. the paths in the source code don't have to exactly match, they just have to point to the same module on the filesystem. (i.e. `./foo` and `./foo.js`) +2. this version distinguishes Flow `type` imports from standard imports. ([#334](https://github.com/benmosher/eslint-plugin-import/pull/334)) + +## Rule Details + +Valid: +```js +import SomeDefaultClass, * as names from './mod' +// Flow `type` import from same module is fine +import type SomeType from './mod' +``` + +...whereas here, both `./mod` imports will be reported: + +```js +import SomeDefaultClass from './mod' + +// oops, some other import separated these lines +import foo from './some-other-mod' + +import * as names from './mod' + +// will catch this too, assuming it is the same target module +import { something } from './mod.js' +``` + +The motivation is that this is likely a result of two developers importing different +names from the same module at different times (and potentially largely different +locations in the file.) This rule brings both (or n-many) to attention. + +### Query Strings + +By default, this rule ignores query strings (i.e. paths followed by a question mark), and thus imports from `./mod?a` and `./mod?b` will be considered as duplicates. However you can use the option `considerQueryString` to handle them as different (primarily because browsers will resolve those imports differently). + +Config: + +```json +"import/no-duplicates": ["error", {"considerQueryString": true}] +``` + +And then the following code becomes valid: +```js +import minifiedMod from './mod?minify' +import noCommentsMod from './mod?comments=0' +import originalMod from './mod' +``` + +It will still catch duplicates when using the same module and the exact same query string: +```js +import SomeDefaultClass from './mod?minify' + +// This is invalid, assuming `./mod` and `./mod.js` are the same target: +import * from './mod.js?minify' +``` + +## When Not To Use It + +If the core ESLint version is good enough (i.e. you're _not_ using Flow and you _are_ using [`import/extensions`](./extensions.md)), keep it and don't use this. + +If you like to split up imports across lines or may need to import a default and a namespace, +you may not want to enable this rule. diff --git a/node_modules/eslint-plugin-import/docs/rules/no-dynamic-require.md b/node_modules/eslint-plugin-import/docs/rules/no-dynamic-require.md new file mode 100644 index 000000000..0f7bb6d37 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-dynamic-require.md @@ -0,0 +1,23 @@ +# import/no-dynamic-require: Forbid `require()` calls with expressions + +The `require` method from CommonJS is used to import modules from different files. Unlike the ES6 `import` syntax, it can be given expressions that will be resolved at runtime. While this is sometimes necessary and useful, in most cases it isn't. Using expressions (for instance, concatenating a path and variable) as the argument makes it harder for tools to do static code analysis, or to find where in the codebase a module is used. + +This rule checks every call to `require()` that uses expressions for the module name argument. + +## Rule Details + +### Fail + +```js +require(name); +require('../' + name); +require(`../${name}`); +require(name()); +``` + +### Pass + +```js +require('../name'); +require(`../name`); +``` diff --git a/node_modules/eslint-plugin-import/docs/rules/no-extraneous-dependencies.md b/node_modules/eslint-plugin-import/docs/rules/no-extraneous-dependencies.md new file mode 100644 index 000000000..295590ccd --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-extraneous-dependencies.md @@ -0,0 +1,124 @@ +# import/no-extraneous-dependencies: Forbid the use of extraneous packages + +Forbid the import of external modules that are not declared in the `package.json`'s `dependencies`, `devDependencies`, `optionalDependencies`, `peerDependencies`, or `bundledDependencies`. +The closest parent `package.json` will be used. If no `package.json` is found, the rule will not lint anything. This behaviour can be changed with the rule option `packageDir`. + +Modules have to be installed for this rule to work. + +### Options + +This rule supports the following options: + +`devDependencies`: If set to `false`, then the rule will show an error when `devDependencies` are imported. Defaults to `true`. + +`optionalDependencies`: If set to `false`, then the rule will show an error when `optionalDependencies` are imported. Defaults to `true`. + +`peerDependencies`: If set to `false`, then the rule will show an error when `peerDependencies` are imported. Defaults to `false`. + +`bundledDependencies`: If set to `false`, then the rule will show an error when `bundledDependencies` are imported. Defaults to `true`. + +You can set the options like this: + +```js +"import/no-extraneous-dependencies": ["error", {"devDependencies": false, "optionalDependencies": false, "peerDependencies": false}] +``` + +You can also use an array of globs instead of literal booleans: + +```js +"import/no-extraneous-dependencies": ["error", {"devDependencies": ["**/*.test.js", "**/*.spec.js"]}] +``` + +When using an array of globs, the setting will be set to `true` (no errors reported) if the name of the file being linted matches a single glob in the array, and `false` otherwise. + +Also there is one more option called `packageDir`, this option is to specify the path to the folder containing package.json. + +If provided as a relative path string, will be computed relative to the current working directory at linter execution time. If this is not ideal (does not work with some editor integrations), consider using `__dirname` to provide a path relative to your configuration. + +```js +"import/no-extraneous-dependencies": ["error", {"packageDir": './some-dir/'}] +// or +"import/no-extraneous-dependencies": ["error", {"packageDir": path.join(__dirname, 'some-dir')}] +``` + +It may also be an array of multiple paths, to support monorepos or other novel project +folder layouts: + +```js +"import/no-extraneous-dependencies": ["error", {"packageDir": ['./some-dir/', './root-pkg']}] +``` + +## Rule Details + +Given the following `package.json`: +```json +{ + "name": "my-project", + "...": "...", + "dependencies": { + "builtin-modules": "^1.1.1", + "lodash.cond": "^4.2.0", + "lodash.find": "^4.2.0", + "pkg-up": "^1.0.0" + }, + "devDependencies": { + "ava": "^0.13.0", + "eslint": "^2.4.0", + "eslint-plugin-ava": "^1.3.0", + "xo": "^0.13.0" + }, + "optionalDependencies": { + "lodash.isarray": "^4.0.0" + }, + "peerDependencies": { + "react": ">=15.0.0 <16.0.0" + }, + "bundledDependencies": [ + "@generated/foo", + ] +} +``` + + +## Fail + +```js +var _ = require('lodash'); +import _ from 'lodash'; + +import react from 'react'; + +/* eslint import/no-extraneous-dependencies: ["error", {"devDependencies": false}] */ +import test from 'ava'; +var test = require('ava'); + +/* eslint import/no-extraneous-dependencies: ["error", {"optionalDependencies": false}] */ +import isArray from 'lodash.isarray'; +var isArray = require('lodash.isarray'); + +/* eslint import/no-extraneous-dependencies: ["error", {"bundledDependencies": false}] */ +import foo from '"@generated/foo"'; +var foo = require('"@generated/foo"'); +``` + + +## Pass + +```js +// Builtin and internal modules are fine +var path = require('path'); +var foo = require('./foo'); + +import test from 'ava'; +import find from 'lodash.find'; +import isArray from 'lodash.isarray'; +import foo from '"@generated/foo"'; + +/* eslint import/no-extraneous-dependencies: ["error", {"peerDependencies": true}] */ +import react from 'react'; +``` + + +## When Not To Use It + +If you do not have a `package.json` file in your project. diff --git a/node_modules/eslint-plugin-import/docs/rules/no-internal-modules.md b/node_modules/eslint-plugin-import/docs/rules/no-internal-modules.md new file mode 100644 index 000000000..7bbb2edd1 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-internal-modules.md @@ -0,0 +1,70 @@ +# import/no-internal-modules + +Use this rule to prevent importing the submodules of other modules. + +## Rule Details + +This rule has one option, `allow` which is an array of [minimatch/glob patterns](https://github.com/isaacs/node-glob#glob-primer) patterns that whitelist paths and import statements that can be imported with reaching. + +### Examples + +Given the following folder structure: + +``` +my-project +├── actions +│ └── getUser.js +│ └── updateUser.js +├── reducer +│ └── index.js +│ └── user.js +├── redux +│ └── index.js +│ └── configureStore.js +└── app +│ └── index.js +│ └── settings.js +└── entry.js +``` + +And the .eslintrc file: +``` +{ + ... + "rules": { + "import/no-internal-modules": [ "error", { + "allow": [ "**/actions/*", "source-map-support/*" ] + } ] + } +} +``` + +The following patterns are considered problems: + +```js +/** + * in my-project/entry.js + */ + +import { settings } from './app/index'; // Reaching to "./app/index" is not allowed +import userReducer from './reducer/user'; // Reaching to "./reducer/user" is not allowed +import configureStore from './redux/configureStore'; // Reaching to "./redux/configureStore" is not allowed + +export { settings } from './app/index'; // Reaching to "./app/index" is not allowed +export * from './reducer/user'; // Reaching to "./reducer/user" is not allowed +``` + +The following patterns are NOT considered problems: + +```js +/** + * in my-project/entry.js + */ + +import 'source-map-support/register'; +import { settings } from '../app'; +import getUser from '../actions/getUser'; + +export * from 'source-map-support/register'; +export { settings } from '../app'; +``` diff --git a/node_modules/eslint-plugin-import/docs/rules/no-mutable-exports.md b/node_modules/eslint-plugin-import/docs/rules/no-mutable-exports.md new file mode 100644 index 000000000..e161e87b1 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-mutable-exports.md @@ -0,0 +1,52 @@ +# import/no-mutable-exports + +Forbids the use of mutable exports with `var` or `let`. + +## Rule Details + +Valid: + +```js +export const count = 1 +export function getCount() {} +export class Counter {} +``` + +...whereas here exports will be reported: + +```js +export let count = 2 +export var count = 3 + +let count = 4 +export { count } // reported here +``` + +## Functions/Classes + +Note that exported function/class declaration identifiers may be reassigned, +but are not flagged by this rule at this time. They may be in the future, if a +reassignment is detected, i.e. + +```js +// possible future behavior! +export class Counter {} // reported here: exported class is reassigned on line [x]. +Counter = KitchenSink // not reported here unless you enable no-class-assign + +// this pre-declaration reassignment is valid on account of function hoisting +getCount = function getDuke() {} // not reported here without no-func-assign +export function getCount() {} // reported here: exported function is reassigned on line [x]. +``` + +To prevent general reassignment of these identifiers, exported or not, you may +want to enable the following core ESLint rules: + +- [no-func-assign] +- [no-class-assign] + +[no-func-assign]: http://eslint.org/docs/rules/no-func-assign +[no-class-assign]: http://eslint.org/docs/rules/no-class-assign + +## When Not To Use It + +If your environment correctly implements mutable export bindings. diff --git a/node_modules/eslint-plugin-import/docs/rules/no-named-as-default-member.md b/node_modules/eslint-plugin-import/docs/rules/no-named-as-default-member.md new file mode 100644 index 000000000..da6ae3f1d --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-named-as-default-member.md @@ -0,0 +1,47 @@ +# import/no-named-as-default-member + +Reports use of an exported name as a property on the default export. + +Rationale: Accessing a property that has a name that is shared by an exported +name from the same module is likely to be a mistake. + +Named import syntax looks very similar to destructuring assignment. It's easy to +make the (incorrect) assumption that named exports are also accessible as +properties of the default export. + +Furthermore, [in Babel 5 this is actually how things worked][blog]. This was +fixed in Babel 6. Before upgrading an existing codebase to Babel 6, it can be +useful to run this lint rule. + + +[blog]: https://kentcdodds.com/blog/misunderstanding-es6-modules-upgrading-babel-tears-and-a-solution + + +## Rule Details + +Given: +```js +// foo.js +export default 'foo'; +export const bar = 'baz'; +``` + +...this would be valid: +```js +import foo, {bar} from './foo.js'; +``` + +...and the following would be reported: +```js +// Caution: `foo` also has a named export `bar`. +// Check if you meant to write `import {bar} from './foo.js'` instead. +import foo from './foo.js'; +const bar = foo.bar; +``` + +```js +// Caution: `foo` also has a named export `bar`. +// Check if you meant to write `import {bar} from './foo.js'` instead. +import foo from './foo.js'; +const {bar} = foo; +``` diff --git a/node_modules/eslint-plugin-import/docs/rules/no-named-as-default.md b/node_modules/eslint-plugin-import/docs/rules/no-named-as-default.md new file mode 100644 index 000000000..0a92b7b51 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-named-as-default.md @@ -0,0 +1,46 @@ +# import/no-named-as-default + +Reports use of an exported name as the locally imported name of a default export. + +Rationale: using an exported name as the name of the default export is likely... + +- *misleading*: others familiar with `foo.js` probably expect the name to be `foo` +- *a mistake*: only needed to import `bar` and forgot the brackets (the case that is prompting this) + +## Rule Details + +Given: +```js +// foo.js +export default 'foo'; +export const bar = 'baz'; +``` + +...this would be valid: +```js +import foo from './foo.js'; +``` + +...and this would be reported: +```js +// message: Using exported name 'bar' as identifier for default export. +import bar from './foo.js'; +``` + +For post-ES2015 `export` extensions, this also prevents exporting the default from a referenced module as a name within that module, for the same reasons: + +```js +// valid: +export foo from './foo.js' + +// message: Using exported name 'bar' as identifier for default export. +export bar from './foo.js'; +``` + +## Further Reading + +- ECMAScript Proposal: [export ns from] +- ECMAScript Proposal: [export default from] + +[export ns from]: https://github.com/leebyron/ecmascript-export-ns-from +[export default from]: https://github.com/leebyron/ecmascript-export-default-from diff --git a/node_modules/eslint-plugin-import/docs/rules/no-named-default.md b/node_modules/eslint-plugin-import/docs/rules/no-named-default.md new file mode 100644 index 000000000..86fb41d61 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-named-default.md @@ -0,0 +1,27 @@ +# import/no-named-default + +Reports use of a default export as a locally named import. + +Rationale: the syntax exists to import default exports expressively, let's use it. + +## Rule Details + +Given: +```js +// foo.js +export default 'foo'; +export const bar = 'baz'; +``` + +...these would be valid: +```js +import foo from './foo.js'; +import foo, { bar } from './foo.js'; +``` + +...and these would be reported: +```js +// message: Using exported name 'bar' as identifier for default export. +import { default as foo } from './foo.js'; +import { default as foo, bar } from './foo.js'; +``` diff --git a/node_modules/eslint-plugin-import/docs/rules/no-named-export.md b/node_modules/eslint-plugin-import/docs/rules/no-named-export.md new file mode 100644 index 000000000..0ff881e34 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-named-export.md @@ -0,0 +1,77 @@ +# `import/no-named-export` + +Prohibit named exports. Mostly an inverse of [`no-default-export`]. + +[`no-default-export`]: ./no-default-export.md + +## Rule Details + +The following patterns are considered warnings: + +```javascript +// bad1.js + +// There is only a single module export and it's a named export. +export const foo = 'foo'; +``` + +```javascript +// bad2.js + +// There is more than one named export in the module. +export const foo = 'foo'; +export const bar = 'bar'; +``` + +```javascript +// bad3.js + +// There is more than one named export in the module. +const foo = 'foo'; +const bar = 'bar'; +export { foo, bar } +``` + +```javascript +// bad4.js + +// There is more than one named export in the module. +export * from './other-module' +``` + +```javascript +// bad5.js + +// There is a default and a named export. +export const foo = 'foo'; +const bar = 'bar'; +export default 'bar'; +``` + +The following patterns are not warnings: + +```javascript +// good1.js + +// There is only a single module export and it's a default export. +export default 'bar'; +``` + +```javascript +// good2.js + +// There is only a single module export and it's a default export. +const foo = 'foo'; +export { foo as default } +``` + +```javascript +// good3.js + +// There is only a single module export and it's a default export. +export default from './other-module'; +``` + +## When Not To Use It + +If you don't care if named imports are used, or if you prefer named imports over default imports. diff --git a/node_modules/eslint-plugin-import/docs/rules/no-namespace.md b/node_modules/eslint-plugin-import/docs/rules/no-namespace.md new file mode 100644 index 000000000..e0b0f0b96 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-namespace.md @@ -0,0 +1,30 @@ +# import/no-namespace + +Enforce a convention of not using namespace (a.k.a. "wildcard" `*`) imports. + ++(fixable) The `--fix` option on the [command line] automatically fixes problems reported by this rule, provided that the namespace object is only used for direct member access, e.g. `namespace.a`. +The `--fix` functionality for this rule requires ESLint 5 or newer. + +## Rule Details + +Valid: + +```js +import defaultExport from './foo' +import { a, b } from './bar' +import defaultExport, { a, b } from './foobar' +``` + +Invalid: + +```js +import * as foo from 'foo'; +``` + +```js +import defaultExport, * as foo from 'foo'; +``` + +## When Not To Use It + +If you want to use namespaces, you don't want to use this rule. diff --git a/node_modules/eslint-plugin-import/docs/rules/no-nodejs-modules.md b/node_modules/eslint-plugin-import/docs/rules/no-nodejs-modules.md new file mode 100644 index 000000000..225adab22 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-nodejs-modules.md @@ -0,0 +1,40 @@ +# import/no-nodejs-modules: No Node.js builtin modules + +Forbid the use of Node.js builtin modules. Can be useful for client-side web projects that do not have access to those modules. + +### Options + +This rule supports the following options: + +- `allow`: Array of names of allowed modules. Defaults to an empty array. + +## Rule Details + +### Fail + +```js +import fs from 'fs'; +import path from 'path'; + +var fs = require('fs'); +var path = require('path'); +``` + +### Pass + +```js +import _ from 'lodash'; +import foo from 'foo'; +import foo from './foo'; + +var _ = require('lodash'); +var foo = require('foo'); +var foo = require('./foo'); + +/* eslint import/no-nodejs-modules: ["error", {"allow": ["path"]}] */ +import path from 'path'; +``` + +## When Not To Use It + +If you have a project that is run mainly or partially using Node.js. diff --git a/node_modules/eslint-plugin-import/docs/rules/no-relative-parent-imports.md b/node_modules/eslint-plugin-import/docs/rules/no-relative-parent-imports.md new file mode 100644 index 000000000..7d6e883cf --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-relative-parent-imports.md @@ -0,0 +1,120 @@ +# import/no-relative-parent-imports + +Use this rule to prevent imports to folders in relative parent paths. + +This rule is useful for enforcing tree-like folder structures instead of complex graph-like folder structures. While this restriction might be a departure from Node's default resolution style, it can lead large, complex codebases to be easier to maintain. If you've ever had debates over "where to put files" this rule is for you. + +To fix violations of this rule there are three general strategies. Given this example: + +``` +numbers +└── three.js +add.js +``` + +```js +// ./add.js +export default function (numbers) { + return numbers.reduce((sum, n) => sum + n, 0); +} + +// ./numbers/three.js +import add from '../add'; // violates import/no-relative-parent-imports + +export default function three() { + return add([1, 2]); +} +``` + +You can, + +1. Move the file to be in a sibling folder (or higher) of the dependency. + +`three.js` could be be in the same folder as `add.js`: + +``` +three.js +add.js +``` + +or since `add` doesn't have any imports, it could be in it's own directory (namespace): + +``` +math +└── add.js +three.js +``` + +2. Pass the dependency as an argument at runtime (dependency injection) + +```js +// three.js +export default function three(add) { + return add([1, 2]); +} + +// somewhere else when you use `three.js`: +import add from './add'; +import three from './numbers/three'; +console.log(three(add)); +``` + +3. Make the dependency a package so it's globally available to all files in your project: + +```js +import add from 'add'; // from https://www.npmjs.com/package/add +export default function three() { + return add([1,2]); +} +``` + +These are (respectively) static, dynamic & global solutions to graph-like dependency resolution. + +### Examples + +Given the following folder structure: + +``` +my-project +├── lib +│ ├── a.js +│ └── b.js +└── main.js +``` + +And the .eslintrc file: +``` +{ + ... + "rules": { + "import/no-relative-parent-imports": "error" + } +} +``` + +The following patterns are considered problems: + +```js +/** + * in my-project/lib/a.js + */ + +import bar from '../main'; // Import parent file using a relative path +``` + +The following patterns are NOT considered problems: + +```js +/** + * in my-project/main.js + */ + +import foo from 'foo'; // Import package using module path +import a from './lib/a'; // Import child file using relative path + +/** + * in my-project/lib/a.js + */ + +import b from './b'; // Import sibling file using relative path +``` diff --git a/node_modules/eslint-plugin-import/docs/rules/no-restricted-paths.md b/node_modules/eslint-plugin-import/docs/rules/no-restricted-paths.md new file mode 100644 index 000000000..bfcb9af23 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-restricted-paths.md @@ -0,0 +1,80 @@ +# import/no-restricted-paths: Restrict which files can be imported in a given folder + +Some projects contain files which are not always meant to be executed in the same environment. +For example consider a web application that contains specific code for the server and some specific code for the browser/client. In this case you don’t want to import server-only files in your client code. + +In order to prevent such scenarios this rule allows you to define restricted zones where you can forbid files from imported if they match a specific path. + +## Rule Details + +This rule has one option. The option is an object containing the definition of all restricted `zones` and the optional `basePath` which is used to resolve relative paths within. +The default value for `basePath` is the current working directory. +Each zone consists of the `target` path and a `from` path. The `target` is the path where the restricted imports should be applied. The `from` path defines the folder that is not allowed to be used in an import. An optional `except` may be defined for a zone, allowing exception paths that would otherwise violate the related `from`. Note that `except` is relative to `from` and cannot backtrack to a parent directory. +You may also specify an optional `message` for a zone, which will be displayed in case of the rule violation. + +### Examples + +Given the following folder structure: + +``` +my-project +├── client +│ └── foo.js +│ └── baz.js +└── server + └── bar.js +``` + +and the current file being linted is `my-project/client/foo.js`. + +The following patterns are considered problems when configuration set to `{ "zones": [ { "target": "./client", "from": "./server" } ] }`: + +```js +import bar from '../server/bar'; +``` + +The following patterns are not considered problems when configuration set to `{ "zones": [ { "target": "./client", "from": "./server" } ] }`: + +```js +import baz from '../client/baz'; +``` + +--------------- + +Given the following folder structure: + +``` +my-project +├── client +│ └── foo.js +│ └── baz.js +└── server + ├── one + │ └── a.js + │ └── b.js + └── two +``` + +and the current file being linted is `my-project/server/one/a.js`. + +and the current configuration is set to: + +``` +{ "zones": [ { + "target": "./tests/files/restricted-paths/server/one", + "from": "./tests/files/restricted-paths/server", + "except": ["./one"] +} ] } +``` + +The following pattern is considered a problem: + +```js +import a from '../two/a' +``` + +The following pattern is not considered a problem: + +```js +import b from './b' +``` diff --git a/node_modules/eslint-plugin-import/docs/rules/no-self-import.md b/node_modules/eslint-plugin-import/docs/rules/no-self-import.md new file mode 100644 index 000000000..bde063f5d --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-self-import.md @@ -0,0 +1,30 @@ +# Forbid a module from importing itself (`import/no-self-import`) + +Forbid a module from importing itself. This can sometimes happen during refactoring. + +## Rule Details + +### Fail + +```js +// foo.js +import foo from './foo'; + +const foo = require('./foo'); +``` + +```js +// index.js +import index from '.'; + +const index = require('.'); +``` + +### Pass + +```js +// foo.js +import bar from './bar'; + +const bar = require('./bar'); +``` diff --git a/node_modules/eslint-plugin-import/docs/rules/no-unassigned-import.md b/node_modules/eslint-plugin-import/docs/rules/no-unassigned-import.md new file mode 100644 index 000000000..fb3065c48 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-unassigned-import.md @@ -0,0 +1,59 @@ +# import/no-unassigned-import: Forbid unassigned imports + +With both CommonJS' `require` and the ES6 modules' `import` syntax, it is possible to import a module but not to use its result. This can be done explicitly by not assigning the module to as variable. Doing so can mean either of the following things: +- The module is imported but not used +- The module has side-effects (like [`should`](https://www.npmjs.com/package/should)). Having side-effects, makes it hard to know whether the module is actually used or can be removed. It can also make it harder to test or mock parts of your application. + +This rule aims to remove modules with side-effects by reporting when a module is imported but not assigned. + +### Options + +This rule supports the following option: + +`allow`: An Array of globs. The files that match any of these patterns would be ignored/allowed by the linter. This can be useful for some build environments (e.g. css-loader in webpack). + +Note that the globs start from the where the linter is executed (usually project root), but not from each file that includes the source. Learn more in both the pass and fail examples below. + + +## Fail + +```js +import 'should' +require('should') + +// In /src/app.js +import '../styles/app.css' +// {"allow": ["styles/*.css"]} +``` + + +## Pass + +```js +import _ from 'foo' +import _, {foo} from 'foo' +import _, {foo as bar} from 'foo' +import {foo as bar} from 'foo' +import * as _ from 'foo' + +const _ = require('foo') +const {foo} = require('foo') +const {foo: bar} = require('foo') +const [a, b] = require('foo') +const _ = require('foo') + +// Module is not assigned, but it is used +bar(require('foo')) +require('foo').bar +require('foo').bar() +require('foo')() + +// With allow option set +import './style.css' // {"allow": ["**/*.css"]} +import 'babel-register' // {"allow": ["babel-register"]} + +// In /src/app.js +import './styles/app.css' +import '../scripts/register.js' +// {"allow": ["src/styles/**", "**/scripts/*.js"]} +``` diff --git a/node_modules/eslint-plugin-import/docs/rules/no-unresolved.md b/node_modules/eslint-plugin-import/docs/rules/no-unresolved.md new file mode 100644 index 000000000..30cd8cb2b --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-unresolved.md @@ -0,0 +1,91 @@ +# import/no-unresolved + +Ensures an imported module can be resolved to a module on the local filesystem, +as defined by standard Node `require.resolve` behavior. + +See [settings](../../README.md#settings) for customization options for the resolution (i.e. +additional filetypes, `NODE_PATH`, etc.) + +This rule can also optionally report on unresolved modules in CommonJS `require('./foo')` calls and AMD `require(['./foo'], function (foo){...})` and `define(['./foo'], function (foo){...})`. + +To enable this, send `{ commonjs: true/false, amd: true/false }` as a rule option. +Both are disabled by default. + +If you are using Webpack, see the section on [resolvers](../../README.md#resolvers). + +## Rule Details + +### Options + +By default, only ES6 imports will be resolved: + +```js +/*eslint import/no-unresolved: 2*/ +import x from './foo' // reports if './foo' cannot be resolved on the filesystem +``` + +If `{commonjs: true}` is provided, single-argument `require` calls will be resolved: + +```js +/*eslint import/no-unresolved: [2, { commonjs: true }]*/ +const { default: x } = require('./foo') // reported if './foo' is not found + +require(0) // ignored +require(['x', 'y'], function (x, y) { /*...*/ }) // ignored +``` + +Similarly, if `{ amd: true }` is provided, dependency paths for `define` and `require` +calls will be resolved: + +```js +/*eslint import/no-unresolved: [2, { amd: true }]*/ +define(['./foo'], function (foo) { /*...*/ }) // reported if './foo' is not found +require(['./foo'], function (foo) { /*...*/ }) // reported if './foo' is not found + +const { default: x } = require('./foo') // ignored +``` + +Both may be provided, too: +```js +/*eslint import/no-unresolved: [2, { commonjs: true, amd: true }]*/ +const { default: x } = require('./foo') // reported if './foo' is not found +define(['./foo'], function (foo) { /*...*/ }) // reported if './foo' is not found +require(['./foo'], function (foo) { /*...*/ }) // reported if './foo' is not found +``` + +#### `ignore` + +This rule has its own ignore list, separate from [`import/ignore`]. This is because you may want to know whether a module can be located, regardless of whether it can be parsed for exports: `node_modules`, CoffeeScript files, etc. are all good to resolve properly, but will not be parsed if configured as such via [`import/ignore`]. + +To suppress errors from files that may not be properly resolved by your [resolver settings](../../README.md#resolver-plugins), you may add an `ignore` key with an array of `RegExp` pattern strings: + +```js +/*eslint import/no-unresolved: [2, { ignore: ['\.img$'] }]*/ + +import { x } from './mod' // may be reported, if not resolved to a module + +import coolImg from '../../img/coolImg.img' // will not be reported, even if not found +``` + +#### `caseSensitive` + +By default, this rule will report paths whose case do not match the underlying filesystem path, if the FS is not case-sensitive. To disable this behavior, set the `caseSensitive` option to `false`. + +```js +/*eslint import/no-unresolved: [2, { caseSensitive: true (default) | false }]*/ +const { default: x } = require('./foo') // reported if './foo' is actually './Foo' and caseSensitive: true +``` + +## When Not To Use It + +If you're using a module bundler other than Node or Webpack, you may end up with +a lot of false positive reports of missing dependencies. + +## Further Reading + +- [Resolver plugins](../../README.md#resolver-plugins) +- [Node resolver](https://npmjs.com/package/eslint-import-resolver-node) (default) +- [Webpack resolver](https://npmjs.com/package/eslint-import-resolver-webpack) +- [`import/ignore`] global setting + +[`import/ignore`]: ../../README.md#importignore diff --git a/node_modules/eslint-plugin-import/docs/rules/no-unused-modules.md b/node_modules/eslint-plugin-import/docs/rules/no-unused-modules.md new file mode 100644 index 000000000..8c234202f --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-unused-modules.md @@ -0,0 +1,107 @@ +# import/no-unused-modules + +Reports: + - modules without any exports + - individual exports not being statically `import`ed or `require`ed from other modules in the same project + +Note: dynamic imports are currently not supported. + +## Rule Details + +### Usage + +In order for this plugin to work, one of the options `missingExports` or `unusedExports` must be enabled (see "Options" section below). In the future, these options will be enabled by default (see https://github.com/benmosher/eslint-plugin-import/issues/1324) + +Example: +``` +"rules: { + ...otherRules, + "import/no-unused-modules": [1, {"unusedExports": true}] +} +``` + +### Options + +This rule takes the following option: + +- **`missingExports`**: if `true`, files without any exports are reported (defaults to `false`) +- **`unusedExports`**: if `true`, exports without any static usage within other modules are reported (defaults to `false`) +- `src`: an array with files/paths to be analyzed. It only applies to unused exports. Defaults to `process.cwd()`, if not provided +- `ignoreExports`: an array with files/paths for which unused exports will not be reported (e.g module entry points in a published package) + + +### Example for missing exports +#### The following will be reported +```js +const class MyClass { /*...*/ } + +function makeClass() { return new MyClass(...arguments) } +``` + +#### The following will not be reported + +```js +export default function () { /*...*/ } +``` +```js +export const foo = function () { /*...*/ } +``` +```js +export { foo, bar } +``` +```js +export { foo as bar } +``` + +### Example for unused exports +given file-f: +```js +import { e } from 'file-a' +import { f } from 'file-b' +import * as fileC from 'file-c' +export { default, i0 } from 'file-d' // both will be reported + +export const j = 99 // will be reported +``` +and file-d: +```js +export const i0 = 9 // will not be reported +export const i1 = 9 // will be reported +export default () => {} // will not be reported +``` +and file-c: +```js +export const h = 8 // will not be reported +export default () => {} // will be reported, as export * only considers named exports and ignores default exports +``` +and file-b: +```js +import two, { b, c, doAnything } from 'file-a' + +export const f = 6 // will not be reported +``` +and file-a: +```js +const b = 2 +const c = 3 +const d = 4 + +export const a = 1 // will be reported + +export { b, c } // will not be reported + +export { d as e } // will not be reported + +export function doAnything() { + // some code +} // will not be reported + +export default 5 // will not be reported +``` + +#### Important Note +Exports from files listed as a main file (`main`, `browser`, or `bin` fields in `package.json`) will be ignored by default. This only applies if the `package.json` is not set to `private: true` + +## When not to use + +If you don't mind having unused files or dead code within your codebase, you can disable this rule diff --git a/node_modules/eslint-plugin-import/docs/rules/no-useless-path-segments.md b/node_modules/eslint-plugin-import/docs/rules/no-useless-path-segments.md new file mode 100644 index 000000000..19b772585 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-useless-path-segments.md @@ -0,0 +1,79 @@ +# import/no-useless-path-segments + +Use this rule to prevent unnecessary path segments in import and require statements. + +## Rule Details + +Given the following folder structure: + +``` +my-project +├── app.js +├── footer.js +├── header.js +└── helpers.js +└── helpers + └── index.js +└── pages + ├── about.js + ├── contact.js + └── index.js +``` + +The following patterns are considered problems: + +```js +/** + * in my-project/app.js + */ + +import "./../pages/about.js"; // should be "./pages/about.js" +import "./../pages/about"; // should be "./pages/about" +import "../pages/about.js"; // should be "./pages/about.js" +import "../pages/about"; // should be "./pages/about" +import "./pages//about"; // should be "./pages/about" +import "./pages/"; // should be "./pages" +import "./pages/index"; // should be "./pages" (except if there is a ./pages.js file) +import "./pages/index.js"; // should be "./pages" (except if there is a ./pages.js file) +``` + +The following patterns are NOT considered problems: + +```js +/** + * in my-project/app.js + */ + +import "./header.js"; +import "./pages"; +import "./pages/about"; +import "."; +import ".."; +import fs from "fs"; +``` + +## Options + +### noUselessIndex + +If you want to detect unnecessary `/index` or `/index.js` (depending on the specified file extensions, see below) imports in your paths, you can enable the option `noUselessIndex`. By default it is set to `false`: +```js +"import/no-useless-path-segments": ["error", { + noUselessIndex: true, +}] +``` + +Additionally to the patterns described above, the following imports are considered problems if `noUselessIndex` is enabled: + +```js +// in my-project/app.js +import "./helpers/index"; // should be "./helpers/" (not auto-fixable to `./helpers` because this would lead to an ambiguous import of `./helpers.js` and `./helpers/index.js`) +import "./pages/index"; // should be "./pages" (auto-fixable) +import "./pages/index.js"; // should be "./pages" (auto-fixable) +``` + +Note: `noUselessIndex` only avoids ambiguous imports for `.js` files if you haven't specified other resolved file extensions. See [Settings: import/extensions](https://github.com/benmosher/eslint-plugin-import#importextensions) for details. + +### commonjs + +When set to `true`, this rule checks CommonJS imports. Default to `false`. diff --git a/node_modules/eslint-plugin-import/docs/rules/no-webpack-loader-syntax.md b/node_modules/eslint-plugin-import/docs/rules/no-webpack-loader-syntax.md new file mode 100644 index 000000000..271c76ca8 --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/no-webpack-loader-syntax.md @@ -0,0 +1,36 @@ +# import/no-webpack-loader-syntax + +Forbid Webpack loader syntax in imports. + +[Webpack](https://webpack.js.org) allows specifying the [loaders](https://webpack.js.org/concepts/loaders/) to use in the import source string using a special syntax like this: +```js +var moduleWithOneLoader = require("my-loader!./my-awesome-module"); +``` + +This syntax is non-standard, so it couples the code to Webpack. The recommended way to specify Webpack loader configuration is in a [Webpack configuration file](https://webpack.js.org/concepts/loaders/#configuration). + +## Rule Details + +### Fail + +```js +import myModule from 'my-loader!my-module'; +import theme from 'style!css!./theme.css'; + +var myModule = require('my-loader!./my-module'); +var theme = require('style!css!./theme.css'); +``` + +### Pass + +```js +import myModule from 'my-module'; +import theme from './theme.css'; + +var myModule = require('my-module'); +var theme = require('./theme.css'); +``` + +## When Not To Use It + +If you have a project that doesn't use Webpack you can safely disable this rule. diff --git a/node_modules/eslint-plugin-import/docs/rules/order.md b/node_modules/eslint-plugin-import/docs/rules/order.md new file mode 100644 index 000000000..7d91efd6f --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/order.md @@ -0,0 +1,264 @@ +# import/order: Enforce a convention in module import order + +Enforce a convention in the order of `require()` / `import` statements. ++(fixable) The `--fix` option on the [command line] automatically fixes problems reported by this rule. +The order is as shown in the following example: + +```js +// 1. node "builtin" modules +import fs from 'fs'; +import path from 'path'; +// 2. "external" modules +import _ from 'lodash'; +import chalk from 'chalk'; +// 3. "internal" modules +// (if you have configured your path or webpack to handle your internal paths differently) +import foo from 'src/foo'; +// 4. modules from a "parent" directory +import foo from '../foo'; +import qux from '../../foo/qux'; +// 5. "sibling" modules from the same or a sibling's directory +import bar from './bar'; +import baz from './bar/baz'; +// 6. "index" of the current directory +import main from './'; +// 7. "object"-imports (only available in TypeScript) +import log = console.log; +``` + +Unassigned imports are ignored, as the order they are imported in may be important. + +Statements using the ES6 `import` syntax must appear before any `require()` statements. + + +## Fail + +```js +import _ from 'lodash'; +import path from 'path'; // `path` import should occur before import of `lodash` + +// ----- + +var _ = require('lodash'); +var path = require('path'); // `path` import should occur before import of `lodash` + +// ----- + +var path = require('path'); +import foo from './foo'; // `import` statements must be before `require` statement +``` + + +## Pass + +```js +import path from 'path'; +import _ from 'lodash'; + +// ----- + +var path = require('path'); +var _ = require('lodash'); + +// ----- + +// Allowed as ̀`babel-register` is not assigned. +require('babel-register'); +var path = require('path'); + +// ----- + +// Allowed as `import` must be before `require` +import foo from './foo'; +var path = require('path'); +``` + +## Options + +This rule supports the following options: + +### `groups: [array]`: + +How groups are defined, and the order to respect. `groups` must be an array of `string` or [`string`]. The only allowed `string`s are: +`"builtin"`, `"external"`, `"internal"`, `"unknown"`, `"parent"`, `"sibling"`, `"index"`, `"object"`. +The enforced order is the same as the order of each element in a group. Omitted types are implicitly grouped together as the last element. Example: +```js +[ + 'builtin', // Built-in types are first + ['sibling', 'parent'], // Then sibling and parent types. They can be mingled together + 'index', // Then the index file + 'object', + // Then the rest: internal and external type +] +``` +The default value is `["builtin", "external", "parent", "sibling", "index"]`. + +You can set the options like this: + +```js +"import/order": ["error", {"groups": ["index", "sibling", "parent", "internal", "external", "builtin", "object"]}] +``` + +### `pathGroups: [array of objects]`: + +To be able to group by paths mostly needed with aliases pathGroups can be defined. + +Properties of the objects + +| property | required | type | description | +|----------------|:--------:|--------|---------------| +| pattern | x | string | minimatch pattern for the paths to be in this group (will not be used for builtins or externals) | +| patternOptions | | object | options for minimatch, default: { nocomment: true } | +| group | x | string | one of the allowed groups, the pathGroup will be positioned relative to this group | +| position | | string | defines where around the group the pathGroup will be positioned, can be 'after' or 'before', if not provided pathGroup will be positioned like the group | + +```json +{ + "import/order": ["error", { + "pathGroups": [ + { + "pattern": "~/**", + "group": "external" + } + ] + }] +} +``` + +### `pathGroupsExcludedImportTypes: [array]`: + +This defines import types that are not handled by configured pathGroups. +This is mostly needed when you want to handle path groups that look like external imports. + +Example: +```json +{ + "import/order": ["error", { + "pathGroups": [ + { + "pattern": "@app/**", + "group": "external", + "position": "after" + } + ], + "pathGroupsExcludedImportTypes": ["builtin"] + }] +} +``` +The default value is `["builtin", "external"]`. + +### `newlines-between: [ignore|always|always-and-inside-groups|never]`: + +Enforces or forbids new lines between import groups: + +- If set to `ignore`, no errors related to new lines between import groups will be reported (default). +- If set to `always`, at least one new line between each group will be enforced, and new lines inside a group will be forbidden. To prevent multiple lines between imports, core `no-multiple-empty-lines` rule can be used. +- If set to `always-and-inside-groups`, it will act like `always` except newlines are allowed inside import groups. +- If set to `never`, no new lines are allowed in the entire import section. + +With the default group setting, the following will be invalid: + +```js +/* eslint import/order: ["error", {"newlines-between": "always"}] */ +import fs from 'fs'; +import path from 'path'; +import index from './'; +import sibling from './foo'; +``` + +```js +/* eslint import/order: ["error", {"newlines-between": "always-and-inside-groups"}] */ +import fs from 'fs'; + +import path from 'path'; +import index from './'; +import sibling from './foo'; +``` + +```js +/* eslint import/order: ["error", {"newlines-between": "never"}] */ +import fs from 'fs'; +import path from 'path'; + +import index from './'; + +import sibling from './foo'; +``` + +while those will be valid: + +```js +/* eslint import/order: ["error", {"newlines-between": "always"}] */ +import fs from 'fs'; +import path from 'path'; + +import index from './'; + +import sibling from './foo'; +``` + +```js +/* eslint import/order: ["error", {"newlines-between": "always-and-inside-groups"}] */ +import fs from 'fs'; + +import path from 'path'; + +import index from './'; + +import sibling from './foo'; +``` + +```js +/* eslint import/order: ["error", {"newlines-between": "never"}] */ +import fs from 'fs'; +import path from 'path'; +import index from './'; +import sibling from './foo'; +``` + +### `alphabetize: {order: asc|desc|ignore, caseInsensitive: true|false}`: + +Sort the order within each group in alphabetical manner based on **import path**: + +- `order`: use `asc` to sort in ascending order, and `desc` to sort in descending order (default: `ignore`). +- `caseInsensitive`: use `true` to ignore case, and `false` to consider case (default: `false`). + +Example setting: +```js +alphabetize: { + order: 'asc', /* sort in ascending order. Options: ['ignore', 'asc', 'desc'] */ + caseInsensitive: true /* ignore case. Options: [true, false] */ +} +``` + +This will fail the rule check: + +```js +/* eslint import/order: ["error", {"alphabetize": {"order": "asc", "caseInsensitive": true}}] */ +import React, { PureComponent } from 'react'; +import aTypes from 'prop-types'; +import { compose, apply } from 'xcompose'; +import * as classnames from 'classnames'; +import blist from 'BList'; +``` + +While this will pass: + +```js +/* eslint import/order: ["error", {"alphabetize": {"order": "asc", "caseInsensitive": true}}] */ +import blist from 'BList'; +import * as classnames from 'classnames'; +import aTypes from 'prop-types'; +import React, { PureComponent } from 'react'; +import { compose, apply } from 'xcompose'; +``` + +## Related + +- [`import/external-module-folders`] setting + +- [`import/internal-regex`] setting + +[`import/external-module-folders`]: ../../README.md#importexternal-module-folders + +[`import/internal-regex`]: ../../README.md#importinternal-regex diff --git a/node_modules/eslint-plugin-import/docs/rules/prefer-default-export.md b/node_modules/eslint-plugin-import/docs/rules/prefer-default-export.md new file mode 100644 index 000000000..23e584bcc --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/prefer-default-export.md @@ -0,0 +1,58 @@ +# import/prefer-default-export + +When there is only a single export from a module, prefer using default export over named export. + +## Rule Details + +The following patterns are considered warnings: + +```javascript +// bad.js + +// There is only a single module export and it's a named export. +export const foo = 'foo'; + +``` + +The following patterns are not warnings: + +```javascript +// good1.js + +// There is a default export. +export const foo = 'foo'; +const bar = 'bar'; +export default 'bar'; +``` + +```javascript +// good2.js + +// There is more than one named export in the module. +export const foo = 'foo'; +export const bar = 'bar'; +``` + +```javascript +// good3.js + +// There is more than one named export in the module +const foo = 'foo'; +const bar = 'bar'; +export { foo, bar } +``` + +```javascript +// good4.js + +// There is a default export. +const foo = 'foo'; +export { foo as default } +``` + +```javascript +// export-star.js + +// Any batch export will disable this rule. The remote module is not inspected. +export * from './other-module' +``` diff --git a/node_modules/eslint-plugin-import/docs/rules/unambiguous.md b/node_modules/eslint-plugin-import/docs/rules/unambiguous.md new file mode 100644 index 000000000..7955c3fbc --- /dev/null +++ b/node_modules/eslint-plugin-import/docs/rules/unambiguous.md @@ -0,0 +1,54 @@ +# import/unambiguous + +Warn if a `module` could be mistakenly parsed as a `script` by a consumer leveraging +[Unambiguous JavaScript Grammar] to determine correct parsing goal. + +Will respect the [`parserOptions.sourceType`] from ESLint config, i.e. files parsed +as `script` per that setting will not be reported. + +This plugin uses [Unambiguous JavaScript Grammar] internally to decide whether +dependencies should be parsed as modules and searched for exports matching the +`import`ed names, so it may be beneficial to keep this rule on even if your application +will run in an explicit `module`-only environment. + +## Rule Details + +For files parsed as `module` by ESLint, the following are valid: + +```js +import 'foo' +function x() { return 42 } +``` + +```js +export function x() { return 42 } +``` + +```js +(function x() { return 42 })() +export {} // simple way to mark side-effects-only file as 'module' without any imports/exports +``` + +...whereas the following file would be reported: +```js +(function x() { return 42 })() +``` + +## When Not To Use It + +If your application environment will always know via [some other means](https://github.com/nodejs/node-eps/issues/13) +how to parse, regardless of syntax, you may not need this rule. + +Remember, though, that this plugin uses this strategy internally, so if you were +to `import` from a module with no `import`s or `export`s, this plugin would not +report it as it would not be clear whether it should be considered a `script` or +a `module`. + +## Further Reading + +- [Unambiguous JavaScript Grammar] +- [`parserOptions.sourceType`] +- [node-eps#13](https://github.com/nodejs/node-eps/issues/13) + +[`parserOptions.sourceType`]: http://eslint.org/docs/user-guide/configuring#specifying-parser-options +[Unambiguous JavaScript Grammar]: https://github.com/nodejs/node-eps/blob/master/002-es-modules.md#32-determining-if-source-is-an-es-module diff --git a/node_modules/eslint-plugin-import/lib/ExportMap.js b/node_modules/eslint-plugin-import/lib/ExportMap.js new file mode 100644 index 000000000..acea8797e --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/ExportMap.js @@ -0,0 +1,735 @@ +'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +recursivePatternCapture = recursivePatternCapture;var _fs = require('fs');var _fs2 = _interopRequireDefault(_fs);var _doctrine = require('doctrine');var _doctrine2 = _interopRequireDefault(_doctrine);var _debug = require('debug');var _debug2 = _interopRequireDefault(_debug);var _eslint = require('eslint');var _parse = require('eslint-module-utils/parse');var _parse2 = _interopRequireDefault(_parse);var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve);var _ignore = require('eslint-module-utils/ignore');var _ignore2 = _interopRequireDefault(_ignore);var _hash = require('eslint-module-utils/hash');var _unambiguous = require('eslint-module-utils/unambiguous');var unambiguous = _interopRequireWildcard(_unambiguous);var _tsconfigLoader = require('tsconfig-paths/lib/tsconfig-loader');var _arrayIncludes = require('array-includes');var _arrayIncludes2 = _interopRequireDefault(_arrayIncludes);function _interopRequireWildcard(obj) {if (obj && obj.__esModule) {return obj;} else {var newObj = {};if (obj != null) {for (var key in obj) {if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];}}newObj.default = obj;return newObj;}}function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}let parseConfigFileTextToJson;const log = (0, _debug2.default)('eslint-plugin-import:ExportMap');const exportCache = new Map();class ExportMap {constructor(path) {this.path = path;this.namespace = new Map(); // todo: restructure to key on path, value is resolver + map of names + this.reexports = new Map(); /** + * star-exports + * @type {Set} of () => ExportMap + */this.dependencies = new Set(); /** + * dependencies of this module that are not explicitly re-exported + * @type {Map} from path = () => ExportMap + */this.imports = new Map();this.errors = [];}get hasDefault() {return this.get('default') != null;} // stronger than this.has + get size() {let size = this.namespace.size + this.reexports.size;this.dependencies.forEach(dep => {const d = dep(); // CJS / ignored dependencies won't exist (#717) + if (d == null) return;size += d.size;});return size;} /** + * Note that this does not check explicitly re-exported names for existence + * in the base namespace, but it will expand all `export * from '...'` exports + * if not found in the explicit namespace. + * @param {string} name + * @return {Boolean} true if `name` is exported by this module. + */has(name) {if (this.namespace.has(name)) return true;if (this.reexports.has(name)) return true; // default exports must be explicitly re-exported (#328) + if (name !== 'default') {for (let dep of this.dependencies) {let innerMap = dep(); // todo: report as unresolved? + if (!innerMap) continue;if (innerMap.has(name)) return true;}}return false;} /** + * ensure that imported name fully resolves. + * @param {[type]} name [description] + * @return {Boolean} [description] + */hasDeep(name) {if (this.namespace.has(name)) return { found: true, path: [this] };if (this.reexports.has(name)) {const reexports = this.reexports.get(name),imported = reexports.getImport(); // if import is ignored, return explicit 'null' + if (imported == null) return { found: true, path: [this] // safeguard against cycles, only if name matches + };if (imported.path === this.path && reexports.local === name) {return { found: false, path: [this] };}const deep = imported.hasDeep(reexports.local);deep.path.unshift(this);return deep;} // default exports must be explicitly re-exported (#328) + if (name !== 'default') {for (let dep of this.dependencies) {let innerMap = dep();if (innerMap == null) return { found: true, path: [this] // todo: report as unresolved? + };if (!innerMap) continue; // safeguard against cycles + if (innerMap.path === this.path) continue;let innerValue = innerMap.hasDeep(name);if (innerValue.found) {innerValue.path.unshift(this);return innerValue;}}}return { found: false, path: [this] };}get(name) {if (this.namespace.has(name)) return this.namespace.get(name);if (this.reexports.has(name)) {const reexports = this.reexports.get(name),imported = reexports.getImport(); // if import is ignored, return explicit 'null' + if (imported == null) return null; // safeguard against cycles, only if name matches + if (imported.path === this.path && reexports.local === name) return undefined;return imported.get(reexports.local);} // default exports must be explicitly re-exported (#328) + if (name !== 'default') {for (let dep of this.dependencies) {let innerMap = dep(); // todo: report as unresolved? + if (!innerMap) continue; // safeguard against cycles + if (innerMap.path === this.path) continue;let innerValue = innerMap.get(name);if (innerValue !== undefined) return innerValue;}}return undefined;}forEach(callback, thisArg) {this.namespace.forEach((v, n) => callback.call(thisArg, v, n, this));this.reexports.forEach((reexports, name) => {const reexported = reexports.getImport(); // can't look up meta for ignored re-exports (#348) + callback.call(thisArg, reexported && reexported.get(reexports.local), name, this);});this.dependencies.forEach(dep => {const d = dep(); // CJS / ignored dependencies won't exist (#717) + if (d == null) return;d.forEach((v, n) => n !== 'default' && callback.call(thisArg, v, n, this));});} // todo: keys, values, entries? + reportErrors(context, declaration) {context.report({ node: declaration.source, message: `Parse errors in imported module '${declaration.source.value}': ` + `${this.errors.map(e => `${e.message} (${e.lineNumber}:${e.column})`).join(', ')}` });}}exports.default = ExportMap; /** + * parse docs from the first node that has leading comments + */function captureDoc(source, docStyleParsers) {const metadata = {}; // 'some' short-circuits on first 'true' + for (var _len = arguments.length, nodes = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {nodes[_key - 2] = arguments[_key];}nodes.some(n => {try {let leadingComments; // n.leadingComments is legacy `attachComments` behavior + if ('leadingComments' in n) {leadingComments = n.leadingComments;} else if (n.range) {leadingComments = source.getCommentsBefore(n);}if (!leadingComments || leadingComments.length === 0) return false;for (let name in docStyleParsers) {const doc = docStyleParsers[name](leadingComments);if (doc) {metadata.doc = doc;}}return true;} catch (err) {return false;}});return metadata;}const availableDocStyleParsers = { jsdoc: captureJsDoc, tomdoc: captureTomDoc /** + * parse JSDoc from leading comments + * @param {...[type]} comments [description] + * @return {{doc: object}} + */ };function captureJsDoc(comments) {let doc; // capture XSDoc + comments.forEach(comment => {// skip non-block comments + if (comment.type !== 'Block') return;try {doc = _doctrine2.default.parse(comment.value, { unwrap: true });} catch (err) {/* don't care, for now? maybe add to `errors?` */}});return doc;} /** + * parse TomDoc section from comments + */function captureTomDoc(comments) {// collect lines up to first paragraph break + const lines = [];for (let i = 0; i < comments.length; i++) {const comment = comments[i];if (comment.value.match(/^\s*$/)) break;lines.push(comment.value.trim());} // return doctrine-like object + const statusMatch = lines.join(' ').match(/^(Public|Internal|Deprecated):\s*(.+)/);if (statusMatch) {return { description: statusMatch[2], tags: [{ title: statusMatch[1].toLowerCase(), description: statusMatch[2] }] };}}ExportMap.get = function (source, context) {const path = (0, _resolve2.default)(source, context);if (path == null) return null;return ExportMap.for(childContext(path, context));};ExportMap.for = function (context) {const path = context.path;const cacheKey = (0, _hash.hashObject)(context).digest('hex');let exportMap = exportCache.get(cacheKey); // return cached ignore + if (exportMap === null) return null;const stats = _fs2.default.statSync(path);if (exportMap != null) {// date equality check + if (exportMap.mtime - stats.mtime === 0) {return exportMap;} // future: check content equality? + } // check valid extensions first + if (!(0, _ignore.hasValidExtension)(path, context)) {exportCache.set(cacheKey, null);return null;} // check for and cache ignore + if ((0, _ignore2.default)(path, context)) {log('ignored path due to ignore settings:', path);exportCache.set(cacheKey, null);return null;}const content = _fs2.default.readFileSync(path, { encoding: 'utf8' }); // check for and cache unambiguous modules + if (!unambiguous.test(content)) {log('ignored path due to unambiguous regex:', path);exportCache.set(cacheKey, null);return null;}log('cache miss', cacheKey, 'for path', path);exportMap = ExportMap.parse(path, content, context); // ambiguous modules return null + if (exportMap == null) return null;exportMap.mtime = stats.mtime;exportCache.set(cacheKey, exportMap);return exportMap;};ExportMap.parse = function (path, content, context) {var m = new ExportMap(path);try {var ast = (0, _parse2.default)(path, content, context);} catch (err) {log('parse error:', path, err);m.errors.push(err);return m; // can't continue + }if (!unambiguous.isModule(ast)) return null;const docstyle = context.settings && context.settings['import/docstyle'] || ['jsdoc'];const docStyleParsers = {};docstyle.forEach(style => {docStyleParsers[style] = availableDocStyleParsers[style];}); // attempt to collect module doc + if (ast.comments) {ast.comments.some(c => {if (c.type !== 'Block') return false;try {const doc = _doctrine2.default.parse(c.value, { unwrap: true });if (doc.tags.some(t => t.title === 'module')) {m.doc = doc;return true;}} catch (err) {/* ignore */}return false;});}const namespaces = new Map();function remotePath(value) {return _resolve2.default.relative(value, path, context.settings);}function resolveImport(value) {const rp = remotePath(value);if (rp == null) return null;return ExportMap.for(childContext(rp, context));}function getNamespace(identifier) {if (!namespaces.has(identifier.name)) return;return function () {return resolveImport(namespaces.get(identifier.name));};}function addNamespace(object, identifier) {const nsfn = getNamespace(identifier);if (nsfn) {Object.defineProperty(object, 'namespace', { get: nsfn });}return object;}function captureDependency(declaration) {if (declaration.source == null) return null;if (declaration.importKind === 'type') return null; // skip Flow type imports + const importedSpecifiers = new Set();const supportedTypes = new Set(['ImportDefaultSpecifier', 'ImportNamespaceSpecifier']);let hasImportedType = false;if (declaration.specifiers) {declaration.specifiers.forEach(specifier => {const isType = specifier.importKind === 'type';hasImportedType = hasImportedType || isType;if (supportedTypes.has(specifier.type) && !isType) {importedSpecifiers.add(specifier.type);}if (specifier.type === 'ImportSpecifier' && !isType) {importedSpecifiers.add(specifier.imported.name);}});} // only Flow types were imported + if (hasImportedType && importedSpecifiers.size === 0) return null;const p = remotePath(declaration.source.value);if (p == null) return null;const existing = m.imports.get(p);if (existing != null) return existing.getter;const getter = thunkFor(p, context);m.imports.set(p, { getter, source: { // capturing actual node reference holds full AST in memory! + value: declaration.source.value, loc: declaration.source.loc }, importedSpecifiers });return getter;}const source = makeSourceCode(content, ast);function isEsModuleInterop() {const tsConfigInfo = (0, _tsconfigLoader.tsConfigLoader)({ cwd: context.parserOptions && context.parserOptions.tsconfigRootDir || process.cwd(), getEnv: key => process.env[key] });try {if (tsConfigInfo.tsConfigPath !== undefined) {const jsonText = _fs2.default.readFileSync(tsConfigInfo.tsConfigPath).toString();if (!parseConfigFileTextToJson) {var _require = require('typescript'); // this is because projects not using TypeScript won't have typescript installed + parseConfigFileTextToJson = _require.parseConfigFileTextToJson;}const tsConfig = parseConfigFileTextToJson(tsConfigInfo.tsConfigPath, jsonText).config;return tsConfig.compilerOptions.esModuleInterop;}} catch (e) {return false;}}ast.body.forEach(function (n) {if (n.type === 'ExportDefaultDeclaration') {const exportMeta = captureDoc(source, docStyleParsers, n);if (n.declaration.type === 'Identifier') {addNamespace(exportMeta, n.declaration);}m.namespace.set('default', exportMeta);return;}if (n.type === 'ExportAllDeclaration') {const getter = captureDependency(n);if (getter) m.dependencies.add(getter);return;} // capture namespaces in case of later export + if (n.type === 'ImportDeclaration') {captureDependency(n);let ns;if (n.specifiers.some(s => s.type === 'ImportNamespaceSpecifier' && (ns = s))) {namespaces.set(ns.local.name, n.source.value);}return;}if (n.type === 'ExportNamedDeclaration') {// capture declaration + if (n.declaration != null) {switch (n.declaration.type) {case 'FunctionDeclaration':case 'ClassDeclaration':case 'TypeAlias': // flowtype with babel-eslint parser + case 'InterfaceDeclaration':case 'DeclareFunction':case 'TSDeclareFunction':case 'TSEnumDeclaration':case 'TSTypeAliasDeclaration':case 'TSInterfaceDeclaration':case 'TSAbstractClassDeclaration':case 'TSModuleDeclaration':m.namespace.set(n.declaration.id.name, captureDoc(source, docStyleParsers, n));break;case 'VariableDeclaration':n.declaration.declarations.forEach(d => recursivePatternCapture(d.id, id => m.namespace.set(id.name, captureDoc(source, docStyleParsers, d, n))));break;}}const nsource = n.source && n.source.value;n.specifiers.forEach(s => {const exportMeta = {};let local;switch (s.type) {case 'ExportDefaultSpecifier':if (!n.source) return;local = 'default';break;case 'ExportNamespaceSpecifier':m.namespace.set(s.exported.name, Object.defineProperty(exportMeta, 'namespace', { get() {return resolveImport(nsource);} }));return;case 'ExportSpecifier':if (!n.source) {m.namespace.set(s.exported.name, addNamespace(exportMeta, s.local));return;} // else falls through + default:local = s.local.name;break;} // todo: JSDoc + m.reexports.set(s.exported.name, { local, getImport: () => resolveImport(nsource) });});}const isEsModuleInteropTrue = isEsModuleInterop();const exports = ['TSExportAssignment'];if (isEsModuleInteropTrue) {exports.push('TSNamespaceExportDeclaration');} // This doesn't declare anything, but changes what's being exported. + if ((0, _arrayIncludes2.default)(exports, n.type)) {const exportedName = n.type === 'TSNamespaceExportDeclaration' ? n.id.name : n.expression && n.expression.name || n.expression.id.name;const declTypes = ['VariableDeclaration', 'ClassDeclaration', 'TSDeclareFunction', 'TSEnumDeclaration', 'TSTypeAliasDeclaration', 'TSInterfaceDeclaration', 'TSAbstractClassDeclaration', 'TSModuleDeclaration'];const exportedDecls = ast.body.filter((_ref) => {let type = _ref.type,id = _ref.id,declarations = _ref.declarations;return (0, _arrayIncludes2.default)(declTypes, type) && (id && id.name === exportedName || declarations && declarations.find(d => d.id.name === exportedName));});if (exportedDecls.length === 0) {// Export is not referencing any local declaration, must be re-exporting + m.namespace.set('default', captureDoc(source, docStyleParsers, n));return;}if (isEsModuleInteropTrue) {m.namespace.set('default', {});}exportedDecls.forEach(decl => {if (decl.type === 'TSModuleDeclaration') {if (decl.body && decl.body.type === 'TSModuleDeclaration') {m.namespace.set(decl.body.id.name, captureDoc(source, docStyleParsers, decl.body));} else if (decl.body && decl.body.body) {decl.body.body.forEach(moduleBlockNode => {// Export-assignment exports all members in the namespace, + // explicitly exported or not. + const namespaceDecl = moduleBlockNode.type === 'ExportNamedDeclaration' ? moduleBlockNode.declaration : moduleBlockNode;if (!namespaceDecl) {// TypeScript can check this for us; we needn't + } else if (namespaceDecl.type === 'VariableDeclaration') {namespaceDecl.declarations.forEach(d => recursivePatternCapture(d.id, id => m.namespace.set(id.name, captureDoc(source, docStyleParsers, decl, namespaceDecl, moduleBlockNode))));} else {m.namespace.set(namespaceDecl.id.name, captureDoc(source, docStyleParsers, moduleBlockNode));}});}} else {// Export as default + m.namespace.set('default', captureDoc(source, docStyleParsers, decl));}});}});return m;}; /** + * The creation of this closure is isolated from other scopes + * to avoid over-retention of unrelated variables, which has + * caused memory leaks. See #1266. + */function thunkFor(p, context) {return () => ExportMap.for(childContext(p, context));} /** + * Traverse a pattern/identifier node, calling 'callback' + * for each leaf identifier. + * @param {node} pattern + * @param {Function} callback + * @return {void} + */function recursivePatternCapture(pattern, callback) {switch (pattern.type) {case 'Identifier': // base case + callback(pattern);break;case 'ObjectPattern':pattern.properties.forEach(p => {recursivePatternCapture(p.value, callback);});break;case 'ArrayPattern':pattern.elements.forEach(element => {if (element == null) return;recursivePatternCapture(element, callback);});break;case 'AssignmentPattern':callback(pattern.left);break;}} /** + * don't hold full context object in memory, just grab what we need. + */function childContext(path, context) {const settings = context.settings,parserOptions = context.parserOptions,parserPath = context.parserPath;return { settings, parserOptions, parserPath, path };} /** + * sometimes legacy support isn't _that_ hard... right? + */function makeSourceCode(text, ast) {if (_eslint.SourceCode.length > 1) {// ESLint 3 + return new _eslint.SourceCode(text, ast);} else {// ESLint 4, 5 + return new _eslint.SourceCode({ text, ast });}} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi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ICAgICAgICAgIGNhc2UgJ1ZhcmlhYmxlRGVjbGFyYXRpb24nOlxuICAgICAgICAgICAgbi5kZWNsYXJhdGlvbi5kZWNsYXJhdGlvbnMuZm9yRWFjaCgoZCkgPT5cbiAgICAgICAgICAgICAgcmVjdXJzaXZlUGF0dGVybkNhcHR1cmUoZC5pZCxcbiAgICAgICAgICAgICAgICBpZCA9PiBtLm5hbWVzcGFjZS5zZXQoaWQubmFtZSwgY2FwdHVyZURvYyhzb3VyY2UsIGRvY1N0eWxlUGFyc2VycywgZCwgbikpKSlcbiAgICAgICAgICAgIGJyZWFrXG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgY29uc3QgbnNvdXJjZSA9IG4uc291cmNlICYmIG4uc291cmNlLnZhbHVlXG4gICAgICBuLnNwZWNpZmllcnMuZm9yRWFjaCgocykgPT4ge1xuICAgICAgICBjb25zdCBleHBvcnRNZXRhID0ge31cbiAgICAgICAgbGV0IGxvY2FsXG5cbiAgICAgICAgc3dpdGNoIChzLnR5cGUpIHtcbiAgICAgICAgICBjYXNlICdFeHBvcnREZWZhdWx0U3BlY2lmaWVyJzpcbiAgICAgICAgICAgIGlmICghbi5zb3VyY2UpIHJldHVyblxuICAgICAgICAgICAgbG9jYWwgPSAnZGVmYXVsdCdcbiAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgY2FzZSAnRXhwb3J0TmFtZXNwYWNlU3BlY2lmaWVyJzpcbiAgICAgICAgICAgIG0ubmFtZXNwYWNlLnNldChzLmV4cG9ydGVkLm5hbWUsIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRNZXRhLCAnbmFtZXNwYWNlJywge1xuICAgICAgICAgICAgICBnZXQoKSB7IHJldHVybiByZXNvbHZlSW1wb3J0KG5zb3VyY2UpIH0sXG4gICAgICAgICAgICB9KSlcbiAgICAgICAgICAgIHJldHVyblxuICAgICAgICAgIGNhc2UgJ0V4cG9ydFNwZWNpZmllcic6XG4gICAgICAgICAgICBpZiAoI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NlIGlmIChuYW1lc3BhY2VEZWNsLnR5cGUgPT09ICdWYXJpYWJsZURlY2xhcmF0aW9uJykge1xuICAgICAgICAgICAgICAgIG5hbWVzcGFjZURlY2wuZGVjbGFyYXRpb25zLmZvckVhY2goKGQpID0+XG4gICAgICAgICAgICAgICAgICByZWN1cnNpdmVQYXR0ZXJuQ2FwdHVyZShkLmlkLCAoaWQpID0+IG0ubmFtZXNwYWNlLnNldChcbiAgICAgICAgICAgICAgICAgICAgaWQubmFtZSxcbiAgICAgICAgICAgICAgICAgICAgY2FwdHVyZURvYyhzb3VyY2UsIGRvY1N0eWxlUGFyc2VycywgZGVjbCwgbmFtZXNwYWNlRGVjbCwgbW9kdWxlQmxvY2tOb2RlKVxuICAgICAgICAgICAgICAgICAgKSlcbiAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbS5uYW1lc3BhY2Uuc2V0KFxuICAgICAgICAgICAgICAgICAgbmFtZXNwYWNlRGVjbC5pZC5uYW1lLFxuICAgICAgICAgICAgICAgICAgY2FwdHVyZURvYyhzb3VyY2UsIGRvY1N0eWxlUGFyc2VycywgbW9kdWxlQmxvY2tOb2RlKSlcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSlcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgLy8gRXhwb3J0IGFzIGRlZmF1bHRcbiAgICAgICAgICBtLm5hbWVzcGFjZS5zZXQoJ2RlZmF1bHQnLCBjYXB0dXJlRG9jKHNvdXJjZSwgZG9jU3R5bGVQYXJzZXJzLCBkZWNsKSlcbiAgICAgICAgfVxuICAgICAgfSlcbiAgICB9XG4gIH0pXG5cbiAgcmV0dXJuIG1cbn1cblxuLyoqXG4gKiBUaGUgY3JlYXRpb24gb2YgdGhpcyBjbG9zdXJlIGlzIGlzb2xhdGVkIGZyb20gb3RoZXIgc2NvcGVzXG4gKiB0byBhdm9pZCBvdmVyLXJld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FjaylcbiAgICAgIH0pXG4gICAgICBicmVha1xuXG4gICAgY2FzZSAnQXNzaWdubWVudFBhdHRlcm4nOlxuICAgICAgY2FsbGJhY2socGF0dGVybi5sZWZ0KVxuICAgICAgYnJlYWtcbiAgfVxufVxuXG4vKipcbiAqIGRvbid0IGhvbGQgZnVsbCBjb250ZXh0IG9iamVjdCBpbiBtZW1vcnksIGp1c3QgZ3JhYiB3aGF0IHdlIG5lZWQuXG4gKi9cbmZ1bmN0aW9uIGNoaWxkQ29udGV4dChwYXRoLCBjb250ZXh0KSB7XG4gIGNvbnN0IHsgc2V0dGluZ3MsIHBhcnNlck9wdGlvbnMsIHBhcnNlclBhdGggfSA9IGNvbnRleHRcbiAgcmV0dXJuIHtcbiAgICBzZXR0aW5ncyxcbiAgICBwYXJzZXJPcHRpb25zLFxuICAgIHBhcnNlclBhdGgsXG4gICAgcGF0aCxcbiAgfVxufVxuXG5cbi8qKlxuICogc29tZXRpbWVzIGxlZ2FjeSBzdXBwb3J0IGlzbid0IF90aGF0XyBoYXJkLi4uIHJpZ2h0P1xuICovXG5mdW5jdGlvbiBtYWtlU291cmNlQ29kZSh0ZXh0LCBhc3QpIHtcbiAgaWYgKFNvdXJjZUNvZGUubGVuZ3RoID4gMSkge1xuICAgIC8vIEVTTGludCAzXG4gICAgcmV0dXJuIG5ldyBTb3VyY2VDb2RlKHRleHQsIGFzdClcbiAgfSBlbHNlIHtcbiAgICAvLyBFU0xpbnQgNCwgNVxuICAgIHJldHVybiBuZXcgU291cmNlQ29kZSh7IHRleHQsIGFzdCB9KVxuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/core/importType.js b/node_modules/eslint-plugin-import/lib/core/importType.js new file mode 100644 index 000000000..1deff7e4a --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/core/importType.js @@ -0,0 +1,102 @@ +'use strict';Object.defineProperty(exports, "__esModule", { value: true });var _slicedToArray = function () {function sliceIterator(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"]) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}return function (arr, i) {if (Array.isArray(arr)) {return arr;} else if (Symbol.iterator in Object(arr)) {return sliceIterator(arr, i);} else {throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();exports. + + + + + + + + + + + + +isAbsolute = isAbsolute;exports. + + + + +isBuiltIn = isBuiltIn;exports. + + + + + + + + + + + + + + + + + + + + + + + + + +isExternalModule = isExternalModule;exports. + + + + +isExternalModuleMain = isExternalModuleMain;exports. + + + + +isScoped = isScoped;exports. + + + + +isScopedMain = isScopedMain;exports. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +isScopedModule = isScopedModule;exports.default = + + + +resolveImportType;var _core = require('resolve/lib/core');var _core2 = _interopRequireDefault(_core);var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function baseModule(name) {if (isScoped(name)) {var _name$split = name.split('/'),_name$split2 = _slicedToArray(_name$split, 2);const scope = _name$split2[0],pkg = _name$split2[1];return `${scope}/${pkg}`;}var _name$split3 = name.split('/'),_name$split4 = _slicedToArray(_name$split3, 1);const pkg = _name$split4[0];return pkg;}function isAbsolute(name) {return name && name.startsWith('/');} // path is defined only when a resolver resolves to a non-standard path +function isBuiltIn(name, settings, path) {if (path || !name) return false;const base = baseModule(name);const extras = settings && settings['import/core-modules'] || [];return _core2.default[base] || extras.indexOf(base) > -1;}function isExternalPath(path, name, settings) {const folders = settings && settings['import/external-module-folders'] || ['node_modules'];return !path || folders.some(folder => isSubpath(folder, path));}function isSubpath(subpath, path) {const normPath = path.replace(/\\/g, '/');const normSubpath = subpath.replace(/\\/g, '/').replace(/\/$/, '');if (normSubpath.length === 0) {return false;}const left = normPath.indexOf(normSubpath);const right = left + normSubpath.length;return left !== -1 && (left === 0 || normSubpath[0] !== '/' && normPath[left - 1] === '/') && (right >= normPath.length || normPath[right] === '/');}const externalModuleRegExp = /^\w/;function isExternalModule(name, settings, path) {return externalModuleRegExp.test(name) && isExternalPath(path, name, settings);}const externalModuleMainRegExp = /^[\w]((?!\/).)*$/;function isExternalModuleMain(name, settings, path) {return externalModuleMainRegExp.test(name) && isExternalPath(path, name, settings);}const scopedRegExp = /^@[^/]*\/?[^/]+/;function isScoped(name) {return name && scopedRegExp.test(name);}const scopedMainRegExp = /^@[^/]+\/?[^/]+$/;function isScopedMain(name) {return name && scopedMainRegExp.test(name);}function isInternalModule(name, settings, path) {const internalScope = settings && settings['import/internal-regex'];const matchesScopedOrExternalRegExp = scopedRegExp.test(name) || externalModuleRegExp.test(name);return matchesScopedOrExternalRegExp && (internalScope && new RegExp(internalScope).test(name) || !isExternalPath(path, name, settings));}function isRelativeToParent(name) {return (/^\.\.$|^\.\.[\\/]/.test(name));}const indexFiles = ['.', './', './index', './index.js'];function isIndex(name) {return indexFiles.indexOf(name) !== -1;}function isRelativeToSibling(name) {return (/^\.[\\/]/.test(name));}function typeTest(name, settings, path) {if (isAbsolute(name, settings, path)) {return 'absolute';}if (isBuiltIn(name, settings, path)) {return 'builtin';}if (isInternalModule(name, settings, path)) {return 'internal';}if (isExternalModule(name, settings, path)) {return 'external';}if (isScoped(name, settings, path)) {return 'external';}if (isRelativeToParent(name, settings, path)) {return 'parent';}if (isIndex(name, settings, path)) {return 'index';}if (isRelativeToSibling(name, settings, path)) {return 'sibling';}return 'unknown';}function isScopedModule(name) {return name.indexOf('@') === 0;}function resolveImportType(name, context) {return typeTest(name, context.settings, (0, _resolve2.default)(name, context)); +} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb3JlL2ltcG9ydFR5cGUuanMiXSwibm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2ZShuYW1lLCBjb250ZXh0KSlcbn1cbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/core/staticRequire.js b/node_modules/eslint-plugin-import/lib/core/staticRequire.js new file mode 100644 index 000000000..507dce556 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/core/staticRequire.js @@ -0,0 +1,11 @@ +'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports.default = +isStaticRequire; // todo: merge with module visitor +function isStaticRequire(node) {return node && + node.callee && + node.callee.type === 'Identifier' && + node.callee.name === 'require' && + node.arguments.length === 1 && + node.arguments[0].type === 'Literal' && + typeof node.arguments[0].value === 'string'; +} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb3JlL3N0YXRpY1JlcXVpcmUuanMiXSwibmFtZXMiOlsiaXNTdGF0aWNSZXF1aXJlIiwibm9kZSIsImNhbGxlZSIsInR5cGUiLCJuYW1lIiwiYXJndW1lbnRzIiwibGVuZ3RoIiwidmFsdWUiXSwibWFwcGluZ3MiOiI7QUFDd0JBLGUsRUFEeEI7QUFDZSxTQUFTQSxlQUFULENBQXlCQyxJQUF6QixFQUErQixDQUM1QyxPQUFPQTtBQUNMQSxPQUFLQyxNQURBO0FBRUxELE9BQUtDLE1BQUwsQ0FBWUMsSUFBWixLQUFxQixZQUZoQjtBQUdMRixPQUFLQyxNQUFMLENBQVlFLElBQVosS0FBcUIsU0FIaEI7QUFJTEgsT0FBS0ksU0FBTCxDQUFlQyxNQUFmLEtBQTBCLENBSnJCO0FBS0xMLE9BQUtJLFNBQUwsQ0FBZSxDQUFmLEVBQWtCRixJQUFsQixLQUEyQixTQUx0QjtBQU1MLFNBQU9GLEtBQUtJLFNBQUwsQ0FBZSxDQUFmLEVBQWtCRSxLQUF6QixLQUFtQyxRQU5yQztBQU9EIiwiZmlsZSI6InN0YXRpY1JlcXVpcmUuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyB0b2RvOiBtZXJnZSB3aXRoIG1vZHVsZSB2aXNpdG9yXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBpc1N0YXRpY1JlcXVpcmUobm9kZSkge1xuICByZXR1cm4gbm9kZSAmJlxuICAgIG5vZGUuY2FsbGVlICYmXG4gICAgbm9kZS5jYWxsZWUudHlwZSA9PT0gJ0lkZW50aWZpZXInICYmXG4gICAgbm9kZS5jYWxsZWUubmFtZSA9PT0gJ3JlcXVpcmUnICYmXG4gICAgbm9kZS5hcmd1bWVudHMubGVuZ3RoID09PSAxICYmXG4gICAgbm9kZS5hcmd1bWVudHNbMF0udHlwZSA9PT0gJ0xpdGVyYWwnICYmXG4gICAgdHlwZW9mIG5vZGUuYXJndW1lbnRzWzBdLnZhbHVlID09PSAnc3RyaW5nJ1xufVxuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/docsUrl.js b/node_modules/eslint-plugin-import/lib/docsUrl.js new file mode 100644 index 000000000..d8aae5fc6 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/docsUrl.js @@ -0,0 +1,8 @@ +'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports.default = + + + +docsUrl;var _package = require('../package.json');var _package2 = _interopRequireDefault(_package);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}const repoUrl = 'https://github.com/benmosher/eslint-plugin-import';function docsUrl(ruleName) {let commitish = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : `v${_package2.default.version}`; + return `${repoUrl}/blob/${commitish}/docs/rules/${ruleName}.md`; +} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9kb2NzVXJsLmpzIl0sIm5hbWVzIjpbImRvY3NVcmwiLCJyZXBvVXJsIiwicnVsZU5hbWUiLCJjb21taXRpc2giLCJwa2ciLCJ2ZXJzaW9uIl0sIm1hcHBpbmdzIjoiOzs7O0FBSXdCQSxPLENBSnhCLDBDLDhJQUVBLE1BQU1DLFVBQVUsbURBQWhCLENBRWUsU0FBU0QsT0FBVCxDQUFpQkUsUUFBakIsRUFBMEQsS0FBL0JDLFNBQStCLHVFQUFsQixJQUFHQyxrQkFBSUMsT0FBUSxFQUFHO0FBQ3ZFLFNBQVEsR0FBRUosT0FBUSxTQUFRRSxTQUFVLGVBQWNELFFBQVMsS0FBM0Q7QUFDRCIsImZpbGUiOiJkb2NzVXJsLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHBrZyBmcm9tICcuLi9wYWNrYWdlLmpzb24nXG5cbmNvbnN0IHJlcG9VcmwgPSAnaHR0cHM6Ly9naXRodWIuY29tL2Jlbm1vc2hlci9lc2xpbnQtcGx1Z2luLWltcG9ydCdcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gZG9jc1VybChydWxlTmFtZSwgY29tbWl0aXNoID0gYHYke3BrZy52ZXJzaW9ufWApIHtcbiAgcmV0dXJuIGAke3JlcG9Vcmx9L2Jsb2IvJHtjb21taXRpc2h9L2RvY3MvcnVsZXMvJHtydWxlTmFtZX0ubWRgXG59XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/importDeclaration.js b/node_modules/eslint-plugin-import/lib/importDeclaration.js new file mode 100644 index 000000000..eefe50cc2 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/importDeclaration.js @@ -0,0 +1,5 @@ +"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.default = importDeclaration;function importDeclaration(context) { + var ancestors = context.getAncestors(); + return ancestors[ancestors.length - 1]; +} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbXBvcnREZWNsYXJhdGlvbi5qcyJdLCJuYW1lcyI6WyJpbXBvcnREZWNsYXJhdGlvbiIsImNvbnRleHQiLCJhbmNlc3RvcnMiLCJnZXRBbmNlc3RvcnMiLCJsZW5ndGgiXSwibWFwcGluZ3MiOiI2RkFBd0JBLGlCLENBQVQsU0FBU0EsaUJBQVQsQ0FBMkJDLE9BQTNCLEVBQW9DO0FBQ2pELE1BQUlDLFlBQVlELFFBQVFFLFlBQVIsRUFBaEI7QUFDQSxTQUFPRCxVQUFVQSxVQUFVRSxNQUFWLEdBQW1CLENBQTdCLENBQVA7QUFDRCIsImZpbGUiOiJpbXBvcnREZWNsYXJhdGlvbi5qcyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIGltcG9ydERlY2xhcmF0aW9uKGNvbnRleHQpIHtcbiAgdmFyIGFuY2VzdG9ycyA9IGNvbnRleHQuZ2V0QW5jZXN0b3JzKClcbiAgcmV0dXJuIGFuY2VzdG9yc1thbmNlc3RvcnMubGVuZ3RoIC0gMV1cbn1cbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/index.js b/node_modules/eslint-plugin-import/lib/index.js new file mode 100644 index 000000000..6497f690f --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/index.js @@ -0,0 +1,67 @@ +'use strict';Object.defineProperty(exports, "__esModule", { value: true });const rules = exports.rules = { + 'no-unresolved': require('./rules/no-unresolved'), + 'named': require('./rules/named'), + 'default': require('./rules/default'), + 'namespace': require('./rules/namespace'), + 'no-namespace': require('./rules/no-namespace'), + 'export': require('./rules/export'), + 'no-mutable-exports': require('./rules/no-mutable-exports'), + 'extensions': require('./rules/extensions'), + 'no-restricted-paths': require('./rules/no-restricted-paths'), + 'no-internal-modules': require('./rules/no-internal-modules'), + 'group-exports': require('./rules/group-exports'), + 'no-relative-parent-imports': require('./rules/no-relative-parent-imports'), + + 'no-self-import': require('./rules/no-self-import'), + 'no-cycle': require('./rules/no-cycle'), + 'no-named-default': require('./rules/no-named-default'), + 'no-named-as-default': require('./rules/no-named-as-default'), + 'no-named-as-default-member': require('./rules/no-named-as-default-member'), + 'no-anonymous-default-export': require('./rules/no-anonymous-default-export'), + 'no-unused-modules': require('./rules/no-unused-modules'), + + 'no-commonjs': require('./rules/no-commonjs'), + 'no-amd': require('./rules/no-amd'), + 'no-duplicates': require('./rules/no-duplicates'), + 'first': require('./rules/first'), + 'max-dependencies': require('./rules/max-dependencies'), + 'no-extraneous-dependencies': require('./rules/no-extraneous-dependencies'), + 'no-absolute-path': require('./rules/no-absolute-path'), + 'no-nodejs-modules': require('./rules/no-nodejs-modules'), + 'no-webpack-loader-syntax': require('./rules/no-webpack-loader-syntax'), + 'order': require('./rules/order'), + 'newline-after-import': require('./rules/newline-after-import'), + 'prefer-default-export': require('./rules/prefer-default-export'), + 'no-default-export': require('./rules/no-default-export'), + 'no-named-export': require('./rules/no-named-export'), + 'no-dynamic-require': require('./rules/no-dynamic-require'), + 'unambiguous': require('./rules/unambiguous'), + 'no-unassigned-import': require('./rules/no-unassigned-import'), + 'no-useless-path-segments': require('./rules/no-useless-path-segments'), + 'dynamic-import-chunkname': require('./rules/dynamic-import-chunkname'), + + // export + 'exports-last': require('./rules/exports-last'), + + // metadata-based + 'no-deprecated': require('./rules/no-deprecated'), + + // deprecated aliases to rules + 'imports-first': require('./rules/imports-first') }; + + +const configs = exports.configs = { + 'recommended': require('../config/recommended'), + + 'errors': require('../config/errors'), + 'warnings': require('../config/warnings'), + + // shhhh... work in progress "secret" rules + 'stage-0': require('../config/stage-0'), + + // useful stuff for folks using various environments + 'react': require('../config/react'), + 'react-native': require('../config/react-native'), + 'electron': require('../config/electron'), + 'typescript': require('../config/typescript') }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJydWxlcyIsInJlcXVpcmUiLCJjb25maWdzIl0sIm1hcHBpbmdzIjoiMkVBQU8sTUFBTUEsd0JBQVE7QUFDbkIsbUJBQWlCQyxRQUFRLHVCQUFSLENBREU7QUFFbkIsV0FBU0EsUUFBUSxlQUFSL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xuICAnaW1wb3J0cy1maXJzdCc6IHJlcXVpcmUoJy4vcnVsZXMvaW1wb3J0cy1maXJzdCcpLFxufVxuXG5leHBvcnQgY29uc3QgY29uZmlncyA9IHtcbiAgJ3JlY29tbWVuZGVkJzogcmVxdWlyZSgnLi4vY29uZmlnL3JlY29tbWVuZGVkJyksXG5cbiAgJ2Vycm9ycyc6IHJlcXVpcmUoJy4uL2NvbmZpZy9lcnJvcnMnKSxcbiAgJ3dhcm5pbmdzJzogcmVxdWlyZSgnLi4vY29uZmlnL3dhcm5pbmdzJyksXG5cbiAgLy8gc2hoaGguLi4gd29yayBpbiBwcm9ncmVzcyBcInNlY3JldFwiIHJ1bGVzXG4gICdzdGFnZS0wJzogcmVxdWlyZSgnLi4vY29uZmlnL3N0YWdlLTAnKSxcblxuICAvLyB1c2VmdWwgc3R1ZmYgZm9yIGZvbGtzIHVzaW5nIHZhcmlvdXMgZW52aXJvbm1lbnRzXG4gICdyZWFjdCc6IHJlcXVpcmUoJy4uL2NvbmZpZy9yZWFjdCcpLFxuICAncmVhY3QtbmF0aXZlJzogcmVxdWlyZSgnLi4vY29uZmlnL3JlYWN0LW5hdGl2ZScpLFxuICAnZWxlY3Ryb24nOiByZXF1aXJlKCcuLi9jb25maWcvZWxlY3Ryb24nKSxcbiAgJ3R5cGVzY3JpcHQnOiByZXF1aXJlKCcuLi9jb25maWcvdHlwZXNjcmlwdCcpLFxufVxuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/default.js b/node_modules/eslint-plugin-import/lib/rules/default.js new file mode 100644 index 000000000..933538ad5 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/default.js @@ -0,0 +1,40 @@ +'use strict';var _ExportMap = require('../ExportMap');var _ExportMap2 = _interopRequireDefault(_ExportMap); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +module.exports = { + meta: { + type: 'problem', + docs: { + url: (0, _docsUrl2.default)('default') }, + + schema: [] }, + + + create: function (context) { + + function checkDefault(specifierType, node) { + + const defaultSpecifier = node.specifiers.find( + specifier => specifier.type === specifierType); + + + if (!defaultSpecifier) return; + var imports = _ExportMap2.default.get(node.source.value, context); + if (imports == null) return; + + if (imports.errors.length) { + imports.reportErrors(context, node); + } else if (imports.get('default') === undefined) { + context.report({ + node: defaultSpecifier, + message: `No default export found in imported module "${node.source.value}".` }); + + } + } + + return { + 'ImportDeclaration': checkDefault.bind(null, 'ImportDefaultSpecifier'), + 'ExportNamedDeclaration': checkDefault.bind(null, 'ExportDefaultSpecifier') }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9kZWZhdWx0LmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJtZXRhIiwidHlwZSIsImRvY3MiLCJ1cmwiLCJzY2hlbWEiLCJjcmVhdGUiLCJjb250ZXh0IiwiY2hlY2tEZWZhdWx0Iiwic3BlY2lmaWVyVHlwZSIsIm5vZGUiLCJkZWZhdWx0U3BlY2lmaWVyIiwic3BlY2lmaWVycyIsImZpbmQiLCJzcGVjaWZpZXIiLCJpbXBvcnRzIiwiRXhwb3J0cyIsImdldCIsInNvdXJjZSIsInZhbHVlIiwiZXJyb3JzIiwibGVuZ3RoIiwicmVwb3J0RXJyb3JzIiwidW5kZWZpbmVkIiwicmVwb3J0IiwibWVzc2FnZSIsImJpbmQiXSwibWFwcGluZ3MiOiJhQUFBLHlDO0FBQ0EscUM7O0FBRUFBLE9BQU9DLE9BQVAsR0FBaUI7QUFDZkMsUUFBTTtBQUNKQyxVQUFNLFNBREY7QUFFSkMsVUFBTTtBQUNKQyxXQUFLLHVCQUFRLFNBQVIsQ0FERCxFQUZGOztBQUtKQyxZQUFRLEVBTEosRUFEUzs7O0FBU2ZDLFVBQVEsVUFBVUMsT0F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jbGFyYXRpb24nOiBjaGVja0RlZmF1bHQuYmluZChudWxsLCAnSW1wb3J0RGVmYXVsdFNwZWNpZmllcicpLFxuICAgICAgJ0V4cG9ydE5hbWVkRGVjbGFyYXRpb24nOiBjaGVja0RlZmF1bHQuYmluZChudWxsLCAnRXhwb3J0RGVmYXVsdFNwZWNpZmllcicpLFxuICAgIH1cbiAgfSxcbn1cbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/dynamic-import-chunkname.js b/node_modules/eslint-plugin-import/lib/rules/dynamic-import-chunkname.js new file mode 100644 index 000000000..de3c3cd76 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/dynamic-import-chunkname.js @@ -0,0 +1,119 @@ +'use strict';var _vm = require('vm');var _vm2 = _interopRequireDefault(_vm); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('dynamic-import-chunkname') }, + + schema: [{ + type: 'object', + properties: { + importFunctions: { + type: 'array', + uniqueItems: true, + items: { + type: 'string' } }, + + + webpackChunknameFormat: { + type: 'string' } } }] }, + + + + + + create: function (context) { + const config = context.options[0];var _ref = + config || {},_ref$importFunctions = _ref.importFunctions;const importFunctions = _ref$importFunctions === undefined ? [] : _ref$importFunctions;var _ref2 = + config || {},_ref2$webpackChunknam = _ref2.webpackChunknameFormat;const webpackChunknameFormat = _ref2$webpackChunknam === undefined ? '[0-9a-zA-Z-_/.]+' : _ref2$webpackChunknam; + + const paddedCommentRegex = /^ (\S[\s\S]+\S) $/; + const commentStyleRegex = /^( \w+: ("[^"]*"|\d+|false|true),?)+ $/; + const chunkSubstrFormat = ` webpackChunkName: "${webpackChunknameFormat}",? `; + const chunkSubstrRegex = new RegExp(chunkSubstrFormat); + + function run(node, arg) { + const sourceCode = context.getSourceCode(); + const leadingComments = sourceCode.getCommentsBefore ? + sourceCode.getCommentsBefore(arg) // This method is available in ESLint >= 4. + : sourceCode.getComments(arg).leading; // This method is deprecated in ESLint 7. + + if (!leadingComments || leadingComments.length === 0) { + context.report({ + node, + message: 'dynamic imports require a leading comment with the webpack chunkname' }); + + return; + } + + let isChunknamePresent = false; + + for (const comment of leadingComments) { + if (comment.type !== 'Block') { + context.report({ + node, + message: 'dynamic imports require a /* foo */ style comment, not a // foo comment' }); + + return; + } + + if (!paddedCommentRegex.test(comment.value)) { + context.report({ + node, + message: `dynamic imports require a block comment padded with spaces - /* foo */` }); + + return; + } + + try { + // just like webpack itself does + _vm2.default.runInNewContext(`(function(){return {${comment.value}}})()`); + } + catch (error) { + context.report({ + node, + message: `dynamic imports require a "webpack" comment with valid syntax` }); + + return; + } + + if (!commentStyleRegex.test(comment.value)) { + context.report({ + node, + message: + `dynamic imports require a leading comment in the form /*${chunkSubstrFormat}*/` }); + + return; + } + + if (chunkSubstrRegex.test(comment.value)) { + isChunknamePresent = true; + } + } + + if (!isChunknamePresent) { + context.report({ + node, + message: + `dynamic imports require a leading comment in the form /*${chunkSubstrFormat}*/` }); + + } + } + + return { + ImportExpression(node) { + run(node, node.source); + }, + + CallExpression(node) { + if (node.callee.type !== 'Import' && importFunctions.indexOf(node.callee.name) < 0) { + return; + } + + run(node, node.arguments[0]); + } }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9keW5hbWljLWltcG9ydC1jaHVua25hbWUuanMiXSwibmFtZXMiOlsibW9kdWxlIiwiZXhwb3J0cyIsIm1ldGEiLCJ0eXBlIiwiZG9jcyIsInVybCIsInNjaGVtYSIsInByb3BlcnRpZXMiLCJpbXBvcnRGdW5jdGlvbnMiLCJ1bmlxdWVJdGVtcyIsIml0ZW1zIiwid2VicGFja0NodW5rbmFtZUZvcm1hdCIsImNyZWF0ZSIsImNvbnRleHQiLCJjb25ma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m9kZSxcbiAgICAgICAgICBtZXNzYWdlOiAnZHluYW1pYyBpbXBvcnRzIHJlcXVpcmUgYSBsZWFkaW5nIGNvbW1lbnQgd2l0aCB0aGUgd2VicGFjayBjaHVua25hbWUnLFxuICAgICAgICB9KVxuICAgICAgICByZXR1cm5cbiAgICAgIH1cblxuICAgICAgbGV0IGlzQ2h1bmtuYW1lUHJlc2VudCA9IGZhbHNlXG5cbiAgICAgIGZvciAoY29uc3QgY29tbWVudCBvZiBsZWFkaW5nQ29tbWVudHMpIHtcbiAgICAgICAgaWYgKGNvbW1lbnQudHlwZSAhPT0gJ0Jsb2NrJykge1xuICAgICAgICAgIGNvbnRleHQucmVwb3J0KHtcbiAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICBtZXNzYWdlOiAnZHluYW1pYyBpbXBvcnRzIHJlcXVpcmUgYSAvKiBmb28gKi8gc3R5bGUgY29tbWVudCwgbm90IGEgLy8gZm9vIGNvbW1lbnQnLFxuICAgICAgICAgIH0pXG4gICAgICAgICAgcmV0dXJuXG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIXBhZGRlZENvbW1lbnRSZWdleC50ZXN0KGNvbW1lbnQudmFsdWUpKSB7XG4gICAgICAgICAgY29udGV4dC5yZXBvcnQoe1xuICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgIG1lc3NhZ2U6IGBkeW5hbWljIGltcG9ydHMgcmVxdWlyZSBhIGJsb2NrIGNvbW1lbnQgcGFkZGVkIHdpdGggc3BhY2VzIC0gLyogZm9vICovYCxcbiAgICAgICAgICB9KVxuICAgICAgICAgIHJldHVyblxuICAgICAgICB9XG5cbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAvLyBqdXN0IGxpa2Ugd2VicGFjayBpdHNlbGYgZG9lc1xuICAgICAgICAgIHZtLnJ1bkluTmV3Q29udGV4dChgKGZ1bmN0aW9uKCl7cmV0dXJuIHske2NvbW1lbnQudmFsdWV9fX0pKClgKVxuICAgICAgICB9XG4gICAgICAgIGNhdGNoIChlcnJvcikge1xuICAgICAgICAgIGNvbnRleHQucmVwb3J0KHtcbiAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICBtZXNzYWdlOiBgZHluYW1pYyBpbXBvcnRzIHJlcXVpcmUgYSBcIndlYnBhY2tcIiBjb21tZW50IHdpdGggdmFsaWQgc3ludGF4YCxcbiAgICAgICAgICB9KVxuICAgICAgICAgIHJldHVyblxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCFjb21tZW50U3R5bGVSZWdleC50ZXN0KGNvbW1lbnQudmFsdWUpKSB7XG4gICAgICAgICAgY29udGV4dC5yZXBvcnQoe1xuICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgIG1lc3NhZ2U6XG4gICAgICAgICAgICAgIGBkeW5hbWljIGltcG9ydHMgcmVxdWlyZSBhIGxlYWRpbmcgY29tbWVudCBpbiB0aGUgZm9ybSAvKiR7Y2h1bmtTdWJzdHJGb3JtYXR9Ki9gLFxuICAgICAgICAgIH0pXG4gICAgICAgICAgcmV0dXJuXG4gICAgICAgIH1cblxuICAgICAgICBpZiAoY2h1bmtTdWJzdHJSZWdleC50ZXN0KGNvbW1lbnQudmFsdWUpKSB7XG4gICAgICAgICAgaXNDaHVua25hbWVQcmVzZW50ID0gdHJ1ZVxuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmICghaXNDaHVua25hbWVQcmVzZW50KSB7XG4gICAgICAgIGNvbnRleHQucmVwb3J0KHtcbiAgICAgICAgICBub2RlLFxuICAgICAgICAgIG1lc3NhZ2U6XG4gICAgICAgICAgICBgZHluYW1pYyBpbXBvcnRzIHJlcXVpcmUgYSBsZWFkaW5nIGNvbW1lbnQgaW4gdGhlIGZvcm0gLyoke2NodW5rU3Vic3RyRm9ybWF0fSovYCxcbiAgICAgICAgfSlcbiAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4ge1xuICAgICAgSW1wb3J0RXhwcmVzc2lvbihub2RlKSB7XG4gICAgICAgIHJ1bihub2RlLCBub2RlLnNvdXJjZSlcbiAgICAgIH0sXG5cbiAgICAgIENhbGxFeHByZXNzaW9uKG5vZGUpIHtcbiAgICAgICAgaWYgKG5vZGUuY2FsbGVlLnR5cGUgIT09ICdJbXBvcnQnICYmIGltcG9ydEZ1bmN0aW9ucy5pbmRleE9mKG5vZGUuY2FsbGVlLm5hbWUpIDwgMCkge1xuICAgICAgICAgIHJldHVyblxuICAgICAgICB9XG5cbiAgICAgICAgcnVuKG5vZGUsIG5vZGUuYXJndW1lbnRzWzBdKVxuICAgICAgfSxcbiAgICB9XG4gIH0sXG59XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/export.js b/node_modules/eslint-plugin-import/lib/rules/export.js new file mode 100644 index 000000000..c7d1aad7a --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/export.js @@ -0,0 +1,170 @@ +'use strict';var _slicedToArray = function () {function sliceIterator(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"]) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}return function (arr, i) {if (Array.isArray(arr)) {return arr;} else if (Symbol.iterator in Object(arr)) {return sliceIterator(arr, i);} else {throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();var _ExportMap = require('../ExportMap');var _ExportMap2 = _interopRequireDefault(_ExportMap); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl); +var _arrayIncludes = require('array-includes');var _arrayIncludes2 = _interopRequireDefault(_arrayIncludes);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +/* + Notes on TypeScript namespaces aka TSModuleDeclaration: + + There are two forms: + - active namespaces: namespace Foo {} / module Foo {} + - ambient modules; declare module "eslint-plugin-import" {} + + active namespaces: + - cannot contain a default export + - cannot contain an export all + - cannot contain a multi name export (export { a, b }) + - can have active namespaces nested within them + + ambient namespaces: + - can only be defined in .d.ts files + - cannot be nested within active namespaces + - have no other restrictions + */ + +const rootProgram = 'root'; +const tsTypePrefix = 'type:'; + +/** + * Detect function overloads like: + * ```ts + * export function foo(a: number); + * export function foo(a: string); + * export function foo(a: number|string) { return a; } + * ``` + * @param {Set} nodes + * @returns {boolean} + */ +function isTypescriptFunctionOverloads(nodes) { + const types = new Set(Array.from(nodes, node => node.parent.type)); + return ( + types.has('TSDeclareFunction') && ( + + types.size === 1 || + types.size === 2 && types.has('FunctionDeclaration'))); + + +} + +module.exports = { + meta: { + type: 'problem', + docs: { + url: (0, _docsUrl2.default)('export') }, + + schema: [] }, + + + create: function (context) { + const namespace = new Map([[rootProgram, new Map()]]); + + function addNamed(name, node, parent, isType) { + if (!namespace.has(parent)) { + namespace.set(parent, new Map()); + } + const named = namespace.get(parent); + + const key = isType ? `${tsTypePrefix}${name}` : name; + let nodes = named.get(key); + + if (nodes == null) { + nodes = new Set(); + named.set(key, nodes); + } + + nodes.add(node); + } + + function getParent(node) { + if (node.parent && node.parent.type === 'TSModuleBlock') { + return node.parent.parent; + } + + // just in case somehow a non-ts namespace export declaration isn't directly + // parented to the root Program node + return rootProgram; + } + + return { + 'ExportDefaultDeclaration': node => addNamed('default', node, getParent(node)), + + 'ExportSpecifier': node => addNamed(node.exported.name, node.exported, getParent(node)), + + 'ExportNamedDeclaration': function (node) { + if (node.declaration == null) return; + + const parent = getParent(node); + // support for old TypeScript versions + const isTypeVariableDecl = node.declaration.kind === 'type'; + + if (node.declaration.id != null) { + if ((0, _arrayIncludes2.default)([ + 'TSTypeAliasDeclaration', + 'TSInterfaceDeclaration'], + node.declaration.type)) { + addNamed(node.declaration.id.name, node.declaration.id, parent, true); + } else { + addNamed(node.declaration.id.name, node.declaration.id, parent, isTypeVariableDecl); + } + } + + if (node.declaration.declarations != null) { + for (let declaration of node.declaration.declarations) { + (0, _ExportMap.recursivePatternCapture)(declaration.id, v => + addNamed(v.name, v, parent, isTypeVariableDecl)); + } + } + }, + + 'ExportAllDeclaration': function (node) { + if (node.source == null) return; // not sure if this is ever true + + // `export * as X from 'path'` does not conflict + if (node.exported && node.exported.name) return; + + const remoteExports = _ExportMap2.default.get(node.source.value, context); + if (remoteExports == null) return; + + if (remoteExports.errors.length) { + remoteExports.reportErrors(context, node); + return; + } + + const parent = getParent(node); + + let any = false; + remoteExports.forEach((v, name) => + name !== 'default' && ( + any = true) && // poor man's filter + addNamed(name, node, parent)); + + if (!any) { + context.report( + node.source, + `No named exports found in module '${node.source.value}'.`); + + } + }, + + 'Program:exit': function () { + for (let _ref of namespace) {var _ref2 = _slicedToArray(_ref, 2);let named = _ref2[1]; + for (let _ref3 of named) {var _ref4 = _slicedToArray(_ref3, 2);let name = _ref4[0];let nodes = _ref4[1]; + if (nodes.size <= 1) continue; + + if (isTypescriptFunctionOverloads(nodes)) continue; + + for (let node of nodes) { + if (name === 'default') { + context.report(node, 'Multiple default exports.'); + } else { + context.report( + node, + `Multiple exports of name '${name.replace(tsTypePrefix, '')}'.`); + + } + } + } + } + } }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9leHBvcnQuanMiXSwibmFtZXMiOlsicm9vdFByb2dyYW0iLCJ0c1R5cGVQcmVmaXgiLCJpc1R5cGVzY3JpcHRGdW5jdGlvbk92ZXJsb2FkcyIsIm5vZGVzIiwidHlwZXMiLCJTZXQiLCJBcnJheSIsImZyb20iLCJub2RlIiwicGFyZW50IiwidHlwZSIsImhhcyIsInNpemUiLCJtb2R1bGUiLCJleHBvcnRzIiwibWV0YSIsImRvY3MiLCJ1cmwiLCJzY2hlbWEiLCJjcmVhdGUiLCJjb250ZXh0IiwibmFtZXNwYWNlIiwiTWFwIiwiYWRkTmFtZWQiLCJuYW1lIiwiaXNUeXBlIiw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gICAgICAgICAgZm9yIChsZXQgW25hbWUsIG5vZGVzXSBvZiBuYW1lZCkge1xuICAgICAgICAgICAgaWYgKG5vZGVzLnNpemUgPD0gMSkgY29udGludWVcblxuICAgICAgICAgICAgaWYgKGlzVHlwZXNjcmlwdEZ1bmN0aW9uT3ZlcmxvYWRzKG5vZGVzKSkgY29udGludWVcblxuICAgICAgICAgICAgZm9yIChsZXQgbm9kZSBvZiBub2Rlcykge1xuICAgICAgICAgICAgICBpZiAobmFtZSA9PT0gJ2RlZmF1bHQnKSB7XG4gICAgICAgICAgICAgICAgY29udGV4dC5yZXBvcnQobm9kZSwgJ011bHRpcGxlIGRlZmF1bHQgZXhwb3J0cy4nKVxuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvbnRleHQucmVwb3J0KFxuICAgICAgICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgICAgICAgIGBNdWx0aXBsZSBleHBvcnRzIG9mIG5hbWUgJyR7bmFtZS5yZXBsYWNlKHRzVHlwZVByZWZpeCwgJycpfScuYFxuICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSxcbiAgICB9XG4gIH0sXG59XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/exports-last.js b/node_modules/eslint-plugin-import/lib/rules/exports-last.js new file mode 100644 index 000000000..54412a670 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/exports-last.js @@ -0,0 +1,41 @@ +'use strict';var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +function isNonExportStatement(_ref) {let type = _ref.type; + return type !== 'ExportDefaultDeclaration' && + type !== 'ExportNamedDeclaration' && + type !== 'ExportAllDeclaration'; +} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('exports-last') }, + + schema: [] }, + + + create: function (context) { + return { + Program: function (_ref2) {let body = _ref2.body; + const lastNonExportStatementIndex = body.reduce(function findLastIndex(acc, item, index) { + if (isNonExportStatement(item)) { + return index; + } + return acc; + }, -1); + + if (lastNonExportStatementIndex !== -1) { + body.slice(0, lastNonExportStatementIndex).forEach(function checkNonExport(node) { + if (!isNonExportStatement(node)) { + context.report({ + node, + message: 'Export statements should appear at the end of the file' }); + + } + }); + } + } }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9leHBvcnRzLWxhc3QuanMiXSwibmFtZXMiOlsiaXNOb25FeHBvcnRTdGF0ZW1lbnQiLCJ0eXBlIiwibW9kdWxlIiwiZXhwb3J0cyIsIm1ldGEiLCJkb2NzIiwidXJsIiwic2NoZW1hIiwiY3JlYXRlIiwiY29udGV4dCIsIlByb2dyYW0iLCJib2R5IiwibGFzdE5vbkV4cG9ydFN0YXRlbWVudEluZGV4IiwicmVkdWNlIiwiZmluZExhc3RJbmRleCIsImFjYyIsIml0ZW0iLCJpbmRleCIsInNsaWNlIiwiZm9yRWFjaCIsImNoZWNrTm9uRXhwb3J0Iiwibm9kZSIsInJlcG9ydCIsIm1lc3NhZ2UiXSwibWFwcGluZ3MiOiJhQUFBLHFDOztBQUVBLFNBQVNBLG9CQUFULE9BQXdDLEtBQVJDLElBQVEsUUFBUkEsSUFBUTtBQUN0QyxTQUFPQSxTQUFTLDBCQUFUO0FBQ0xBLFdBQVMsd0JBREo7QUFFTEEsV0FBUyxzQkFGWDtBQUdEOztBQUVEQyxPQUFPQyxPQUFQLEdBQWlCO0FBQ2ZDLFFBQU07QUFDSkgsVUFBTSxZQURGO0FBRUpJLFVBQU07QUFDSkMsV0FBSyx1QkFBUSxjQUFSLENBREQsRUFGRjs7QUFLSkMsWUFBUSxFQUxKLEVBRFM7OztBQVNmQyxVQUFRL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AgICAgfSlcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICB9XG4gIH0sXG59XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/extensions.js b/node_modules/eslint-plugin-import/lib/rules/extensions.js new file mode 100644 index 000000000..603be8609 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/extensions.js @@ -0,0 +1,189 @@ +'use strict';var _path = require('path');var _path2 = _interopRequireDefault(_path); + +var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve); +var _importType = require('../core/importType'); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +const enumValues = { enum: ['always', 'ignorePackages', 'never'] }; +const patternProperties = { + type: 'object', + patternProperties: { '.*': enumValues } }; + +const properties = { + type: 'object', + properties: { + 'pattern': patternProperties, + 'ignorePackages': { type: 'boolean' } } }; + + + +function buildProperties(context) { + + const result = { + defaultConfig: 'never', + pattern: {}, + ignorePackages: false }; + + + context.options.forEach(obj => { + + // If this is a string, set defaultConfig to its value + if (typeof obj === 'string') { + result.defaultConfig = obj; + return; + } + + // If this is not the new structure, transfer all props to result.pattern + if (obj.pattern === undefined && obj.ignorePackages === undefined) { + Object.assign(result.pattern, obj); + return; + } + + // If pattern is provided, transfer all props + if (obj.pattern !== undefined) { + Object.assign(result.pattern, obj.pattern); + } + + // If ignorePackages is provided, transfer it to result + if (obj.ignorePackages !== undefined) { + result.ignorePackages = obj.ignorePackages; + } + }); + + if (result.defaultConfig === 'ignorePackages') { + result.defaultConfig = 'always'; + result.ignorePackages = true; + } + + return result; +} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('extensions') }, + + + schema: { + anyOf: [ + { + type: 'array', + items: [enumValues], + additionalItems: false }, + + { + type: 'array', + items: [ + enumValues, + properties], + + additionalItems: false }, + + { + type: 'array', + items: [properties], + additionalItems: false }, + + { + type: 'array', + items: [patternProperties], + additionalItems: false }, + + { + type: 'array', + items: [ + enumValues, + patternProperties], + + additionalItems: false }] } }, + + + + + + create: function (context) { + + const props = buildProperties(context); + + function getModifier(extension) { + return props.pattern[extension] || props.defaultConfig; + } + + function isUseOfExtensionRequired(extension, isPackage) { + return getModifier(extension) === 'always' && (!props.ignorePackages || !isPackage); + } + + function isUseOfExtensionForbidden(extension) { + return getModifier(extension) === 'never'; + } + + function isResolvableWithoutExtension(file) { + const extension = _path2.default.extname(file); + const fileWithoutExtension = file.slice(0, -extension.length); + const resolvedFileWithoutExtension = (0, _resolve2.default)(fileWithoutExtension, context); + + return resolvedFileWithoutExtension === (0, _resolve2.default)(file, context); + } + + function isExternalRootModule(file) { + const slashCount = file.split('/').length - 1; + + if ((0, _importType.isScopedModule)(file) && slashCount <= 1) return true; + if ((0, _importType.isExternalModule)(file, context, (0, _resolve2.default)(file, context)) && !slashCount) return true; + return false; + } + + function checkFileExtension(node) {const + source = node.source; + + // bail if the declaration doesn't have a source, e.g. "export { foo };" + if (!source) return; + + const importPathWithQueryString = source.value; + + // don't enforce anything on builtins + if ((0, _importType.isBuiltIn)(importPathWithQueryString, context.settings)) return; + + const importPath = importPathWithQueryString.replace(/\?(.*)$/, ''); + + // don't enforce in root external packages as they may have names with `.js`. + // Like `import Decimal from decimal.js`) + if (isExternalRootModule(importPath)) return; + + const resolvedPath = (0, _resolve2.default)(importPath, context); + + // get extension from resolved path, if possible. + // for unresolved, use source value. + const extension = _path2.default.extname(resolvedPath || importPath).substring(1); + + // determine if this is a module + const isPackage = (0, _importType.isExternalModule)(importPath, context.settings) || + (0, _importType.isScoped)(importPath); + + if (!extension || !importPath.endsWith(`.${extension}`)) { + const extensionRequired = isUseOfExtensionRequired(extension, isPackage); + const extensionForbidden = isUseOfExtensionForbidden(extension); + if (extensionRequired && !extensionForbidden) { + context.report({ + node: source, + message: + `Missing file extension ${extension ? `"${extension}" ` : ''}for "${importPathWithQueryString}"` }); + + } + } else if (extension) { + if (isUseOfExtensionForbidden(extension) && isResolvableWithoutExtension(importPath)) { + context.report({ + node: source, + message: `Unexpected use of file extension "${extension}" for "${importPathWithQueryString}"` }); + + } + } + } + + return { + ImportDeclaration: checkFileExtension, + ExportNamedDeclaration: checkFileExtension }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9leHRlbnNpb25zLmpzIl0sIm5hbWVzIjpbImVudW1WYWx1ZXMiLCJlbnVtIiwicGF0dGVyblByb3BlcnRpZXMiLCJ0eXBlIiwicHJvcGVydGllcyIsImJ1aWxkUHJvcGVydGllcyIsImNvbnRleHQiLCJyZXN1bHQiLCJkZWZhdWx0Q29uZmlnIiwicGF0dGVybiIsImlnbm9yZVBhY2thZ2VzIiwib3B0aW9ucyIsImZvckVhY2giLCJvYmoiLCJ1bmRlZmluZWQiLCJPYmplY3QiLCJhc3NpZ24iLCJtb2R1bGUiLCJleHBvcnRzIiwibWV0YSIsImRvY3MiLCJ1cmwiLCJzY2hlbWEiLCJhbnlPZiIsIml0ZW1zIiwiYWRkaXRpb25hbEl0ZW1zIiwiY3JlYXRlIiwicHJvcHMiLCJnZXRNb2RpZmllciIsImV4dGVuc2lvbiIsImlzVXNlT2ZFeHRlbnNpb25SZXF1aXJlZCIsImlzUGFja2FnZSIsImlzVXNlT2ZFeHRlbnNpb25Gb3JiaWRkZW4iLCJpc1Jlc29sdmFibGVXaXRob3V0RXh0ZW5zaW9uIiwiZmlsZSIsInBhdGgiLCJleHRuYW1lIiwiZmlsZVdpdGhvdXRFeHRlbnNpb24iLCJzbGljZSIsImxlbmd0aCIsInJlc29sdmVkRmlsZVdpdGhvdXRFeHRlbnNpb24iLCJpc0V4dGVybmFsUm9vdE1vZHVsZSIsInNsYXNoQ291bnQiLCJzcGxpdCIsImNoZWNrRmlsZUV4dGVuc2lvbiIsIm5vZGUiLCJzb3VyY2UiLCJpb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Y3M6IHtcbiAgICAgIHVybDogZG9jc1VybCgnZXh0ZW5zaW9ucycpLFxuICAgIH0sXG5cbiAgICBzY2hlbWE6IHtcbiAgICAgIGFueU9mOiBbXG4gICAgICAgIHtcbiAgICAgICAgICB0eXBlOiAnYXJyYXknLFxuICAgICAgICAgIGl0ZW1zOiBbZW51bVZhbHVlc10sXG4gICAgICAgICAgYWRkaXRpb25hbEl0ZW1zOiBmYWxzZSxcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIHR5cGU6ICdhcnJheScsXG4gICAgICAgICAgaXRlbXM6IFtcbiAgICAgICAgICAgIGVudW1WYWx1ZXMsXG4gICAgICAgICAgICBwcm9wZXJ0aWVzLFxuICAgICAgICAgIF0sXG4gICAgICAgICAgYWRkaXRpb25hbEl0ZW1zOiBmYWxzZSxcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIHR5cGU6ICdhcnJheScsXG4gICAgICAgICAgaXRlbXM6IFtwcm9wZXJ0aWVzXSxcbiAgICAgICAgICBhZGRpdGlvbmFsSXRlbXM6IGZhbHNlLFxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgdHlwZTogJ2FycmF5JyxcbiAgICAgICAgICBpdGVtczogW3BhdHRlcm5Qcm9wZXJ0aWVzXSxcbiAgICAgICAgICBhZGRpdGlvbmFsSXRlbXM6IGZhbHNlLFxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgdHlwZTogJ2FycmF5JyxcbiAgICAgICAgICBpdGVtczogW1xuICAgICAgICAgICAgZW51bVZhbHVlcyxcbiAgICAgICAgICAgIHBhdHRlcm5Qcm9wZXJ0aWVzLFxuICAgICAgICAgIF0sXG4gICAgICAgICAgYWRkaXRpb25hbEl0ZW1zOiBmYWxzZSxcbiAgICAgICAgfSxcbiAgICAgIF0sXG4gICAgfSxcbiAgfSxcblxuICBjcmVhdGU6IGZ1bmN0aW9uIChjb250ZXh0KSB7XG5cbiAgICBjb25zdCBwc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vbn1cIiBgIDogJyd9Zm9yIFwiJHtpbXBvcnRQYXRoV2l0aFF1ZXJ5U3RyaW5nfVwiYCxcbiAgICAgICAgICB9KVxuICAgICAgICB9XG4gICAgICB9IGVsc2UgaWYgKGV4dGVuc2lvbikge1xuICAgICAgICBpZiAoaXNVc2VPZkV4dGVuc2lvbkZvcmJpZGRlbihleHRlbnNpb24pICYmIGlzUmVzb2x2YWJsZVdpdGhvdXRFeHRlbnNpb24oaW1wb3J0UGF0aCkpIHtcbiAgICAgICAgICBjb250ZXh0LnJlcG9ydCh7XG4gICAgICAgICAgICBub2RlOiBzb3VyY2UsXG4gICAgICAgICAgICBtZXNzYWdlOiBgVW5leHBlY3RlZCB1c2Ugb2YgZmlsZSBleHRlbnNpb24gXCIke2V4dGVuc2lvbn1cIiBmb3IgXCIke2ltcG9ydFBhdGhXaXRoUXVlcnlTdHJpbmd9XCJgLFxuICAgICAgICAgIH0pXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4ge1xuICAgICAgSW1wb3J0RGVjbGFyYXRpb246IGNoZWNrRmlsZUV4dGVuc2lvbixcbiAgICAgIEV4cG9ydE5hbWVkRGVjbGFyYXRpb246IGNoZWNrRmlsZUV4dGVuc2lvbixcbiAgICB9XG4gIH0sXG59XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/first.js b/node_modules/eslint-plugin-import/lib/rules/first.js new file mode 100644 index 000000000..02d8229c2 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/first.js @@ -0,0 +1,132 @@ +'use strict';var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('first') }, + + fixable: 'code', + schema: [ + { + type: 'string', + enum: ['absolute-first', 'disable-absolute-first'] }] }, + + + + + create: function (context) { + function isPossibleDirective(node) { + return node.type === 'ExpressionStatement' && + node.expression.type === 'Literal' && + typeof node.expression.value === 'string'; + } + + return { + 'Program': function (n) { + const body = n.body, + absoluteFirst = context.options[0] === 'absolute-first', + message = 'Import in body of module; reorder to top.', + sourceCode = context.getSourceCode(), + originSourceCode = sourceCode.getText(); + let nonImportCount = 0, + anyExpressions = false, + anyRelative = false, + lastLegalImp = null, + errorInfos = [], + shouldSort = true, + lastSortNodesIndex = 0; + body.forEach(function (node, index) { + if (!anyExpressions && isPossibleDirective(node)) { + return; + } + + anyExpressions = true; + + if (node.type === 'ImportDeclaration') { + if (absoluteFirst) { + if (/^\./.test(node.source.value)) { + anyRelative = true; + } else if (anyRelative) { + context.report({ + node: node.source, + message: 'Absolute imports should come before relative imports.' }); + + } + } + if (nonImportCount > 0) { + for (let variable of context.getDeclaredVariables(node)) { + if (!shouldSort) break; + const references = variable.references; + if (references.length) { + for (let reference of references) { + if (reference.identifier.range[0] < node.range[1]) { + shouldSort = false; + break; + } + } + } + } + shouldSort && (lastSortNodesIndex = errorInfos.length); + errorInfos.push({ + node, + range: [body[index - 1].range[1], node.range[1]] }); + + } else { + lastLegalImp = node; + } + } else { + nonImportCount++; + } + }); + if (!errorInfos.length) return; + errorInfos.forEach(function (errorInfo, index) { + const node = errorInfo.node, + infos = { + node, + message }; + + if (index < lastSortNodesIndex) { + infos.fix = function (fixer) { + return fixer.insertTextAfter(node, ''); + }; + } else if (index === lastSortNodesIndex) { + const sortNodes = errorInfos.slice(0, lastSortNodesIndex + 1); + infos.fix = function (fixer) { + const removeFixers = sortNodes.map(function (_errorInfo) { + return fixer.removeRange(_errorInfo.range); + }), + range = [0, removeFixers[removeFixers.length - 1].range[1]]; + let insertSourceCode = sortNodes.map(function (_errorInfo) { + const nodeSourceCode = String.prototype.slice.apply( + originSourceCode, _errorInfo.range); + + if (/\S/.test(nodeSourceCode[0])) { + return '\n' + nodeSourceCode; + } + return nodeSourceCode; + }).join(''), + insertFixer = null, + replaceSourceCode = ''; + if (!lastLegalImp) { + insertSourceCode = + insertSourceCode.trim() + insertSourceCode.match(/^(\s+)/)[0]; + } + insertFixer = lastLegalImp ? + fixer.insertTextAfter(lastLegalImp, insertSourceCode) : + fixer.insertTextBefore(body[0], insertSourceCode); + const fixers = [insertFixer].concat(removeFixers); + fixers.forEach(function (computedFixer, i) { + replaceSourceCode += originSourceCode.slice( + fixers[i - 1] ? fixers[i - 1].range[1] : 0, computedFixer.range[0]) + + computedFixer.text; + }); + return fixer.replaceTextRange(range, replaceSourceCode); + }; + } + context.report(infos); + }); + } }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9maXJzdC5qcyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwibWV0YSIsInR5cGUiLCJkb2NzIiwidXJsIiwiZml4YWJsZSIsInNjaGVtYSIsImVudW0iLCJjcmVhdGUiLCJjb250ZXh0IiwiaXNQb3NzaWJsZURpcmVjdGl2ZSIsIm5vZGUiLCJleHByZXNzaW9uIiwidmFsdWUiLCJuIiwiYm9keSIsImFic29sdXRlRmlyc3QiLCJvcHRpb25zIiwibWVzc2FnZSIsInNvdXJjZUNvZGUiLCJnZXRTb3VyY2VDb2RlIiwib3JpZ2luU291cmNlQ29kZSIsImdldFRleHQiLCJub25JbXBvcnRDb3VudCIsImFueUV4cHJlc3Npb25zIiwiYW55UmVsYXRpdmUiLCJsYXN0TGVnYWxJbXAiLCJlcnJvckluZm9zIiwic2hvdWxkU29ydCIsImxhc3RTb3J0Tm9kZXNJbmRleCIsImZvckVhY2giLCJpbmRleCIsInRlc3QiLCJzb3VyY2UiLCJyZXBvcnQiLCJ2YXJpYWJsZSIsImdldERlY2xhcmVkVmFyaWFibGVzIiwicmVmZXJlbmNlcyIsImxlbmd0aCIsInJlZmVyZW5jZSIsImlkZW50aWZpZXIiLCJyYW5nZSIsInB1c2giLCJlcnJvcklu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HNlXG4gICAgICAgICAgLCBhbnlSZWxhdGl2ZSA9IGZhbHNlXG4gICAgICAgICAgLCBsYXN0TGVnYWxJbXAgPSBudWxsXG4gICAgICAgICAgLCBlcnJvckluZm9zID0gW11cbiAgICAgICAgICAsIHNob3VsZFNvcnQgPSB0cnVlXG4gICAgICAgICAgLCBsYXN0U29ydE5vZGVzSW5kZXggPSAwXG4gICAgICAgIGJvZHkuZm9yRWFjaChmdW5jdGlvbiAobm9kZSwgaW5kZXgpe1xuICAgICAgICAgIGlmICghYW55RXhwcmVzc2lvbnMgJiYgaXNQb3NzaWJsZURpcmVjdGl2ZShub2RlKSkge1xuICAgICAgICAgICAgcmV0dXJuXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgYW55RXhwcmVzc2lvbnMgPSB0cnVlXG5cbiAgICAgICAgICBpZiAobm9kZS50eXBlID09PSAnSW1wb3J0RGVjbGFyYXRpb24nKSB7XG4gICAgICAgICAgICBpZiAoYWJzb2x1dGVGaXJzdCkge1xuICAgICAgICAgICAgICBpZiAoL15cXC4vLnRlc3Qobm9kZS5zb3VyY2UudmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgYW55UmVsYXRpdmUgPSB0cnVlXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAoYW55UmVsYXRpdmUpIHtcbiAgICAgICAgICAgICAgICBjb250ZXh0LnJlcG9ydCh7XG4gICAgICAgICAgICAgICAgICBub2RlOiBub2RlLnNvdXJjZSxcbiAgICAgICAgICAgICAgICAgIG1lc3NhZ2U6ICdBYnNvbHV0ZSBpbXBvcnRzIHNob3VsZCBjb21lIGJlZm9yZSByZWxhdGl2ZSBpbXBvcnRzLicsXG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG5vbkltcG9ydENvdW50ID4gMCkge1xuICAgICAgICAgICAgICBmb3IgKGxldCB2YXJpYWJsZSBvZiBjb250ZXh0LmdldERlY2xhcmVkVmFyaWFibGVzKG5vZGUpKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFzaG91bGRTb3J0KSBicmVha1xuICAgICAgICAgICAgICAgIGNvbnN0IHJlZmVyZW5jZXMgPSB2YXJpYWJsZS5yZWZlcmVuY2VzXG4gICAgICAgICAgICAgICAgaWYgKHJlZmVyZW5jZXMubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICBmb3IgKGxldCByZWZlcmVuY2Ugb2YgcmVmZXJlbmNlcykge1xuICAgICAgICAgICAgICAgICAgICBpZiAocmVmZXJlbmNlLmlkZW50aWZpZXIucmFuZ2VbMF0gPCBub2RlLnJhbmdlWzFdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgc2hvdWxkU29ydCA9IGZhbHNlXG4gICAgICAgICAgICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBzaG91bGRTb3J0ICYmIChsYXN0U29ydE5vZGVzSW5kZXggPSBlcnJvckluZm9zLmxlbmd0aClcbiAgICAgICAgICAgICAgZXJyb3JJbmZvcy5wdXNoKHtcbiAgICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICAgIHJhbmdlOiBbYm9keVtpbmRleCAtIDFdLnJhbmdlWzFdLCBub2RlLnJhbmdlWzFdXSxcbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGxhc3RMZWdhbEltcCA9IG5vZGVcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbm9uSW1wb3J0Q291bnQrK1xuICAgICAgICAgIH1cbiAgICAgICAgfSlcbiAgICAgICAgaWYgKCFlcnJvckluZm9zLmxlbmd0aCkgcmV0dXJuXG4gICAgICAgIGVycm9ySW5mb3MuZm9yRWFjaChmdW5jdGlvbiAoZXJyb3JJbmZvLCBpbmRleCkge1xuICAgICAgICAgIGNvbnN0IG5vZGUgPSBlcnJvckluZm8ubm9kZVxuICAgICAgICAgICAgICAsIGluZm9zID0ge1xuICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgbWVzc2FnZSxcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgIGlmIChpbmRleCA8IGxhc3RTb3J0Tm9kZXNJbmRleCkge1xuICAgICAgICAgICAgaW5mb3MuZml4ID0gZnVuY3Rpb24gKGZpeGVyKSB7XG4gICAgICAgICAgICAgIHJldHVybiBmaXhlci5pbnNlcnRUZXh0QWZ0ZXIobm9kZSwgJycpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIGlmIChpbmRleCA9PT0gbGFzdFNvcnROb2Rlc0luZGV4KSB7XG4gICAgICAgICAgICBjb25zdCBzb3J0Tm9kZXMgPSBlcnJvckluZm9zLnNsaWNlKDAsIGxhc3RTb3J0Tm9kZXNJbmRleCArIDEpXG4gICAgICAgICAgICBpbmZvcy5maXggPSBmdW5jdGlvbiAoZml4ZXIpIHtcbiAgICAgICAgICAgICAgY29uc3QgcmVtb3ZlRml4ZXJzID0gc29ydE5vZGVzLm1hcChmdW5jdGlvbiAoX2Vycm9ySW5mbykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZml4ZXIucmVtb3ZlUmFuZ2UoX2Vycm9ySW5mby5yYW5nZSlcbiAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAsIHJhbmdlID0gWzAsIHJlbW92ZUZpeGVyc1tyZW1vdmVGaXhlcnMubGVuZ3RoIC0gMV0ucmFuZ2VbMV1dXG4gICAgICAgICAgICAgIGxldCBpbnNlcnRTb3VyY2VDb2RlID0gc29ydE5vZGVzLm1hcChmdW5jdGlvbiAoX2Vycm9ySW5mbykge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBub2RlU291cmNlQ29kZSA9IFN0cmluZy5wcm90b3R5cGUuc2xpY2UuYXBwbHkoXG4gICAgICAgICAgICAgICAgICAgICAgb3JpZ2luU291cmNlQ29kZSwgX2Vycm9ySW5mby5yYW5nZVxuICAgICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICAgIGlmICgvXFxTLy50ZXN0KG5vZGVTb3VyY2VDb2RlWzBdKSkge1xuICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnXFxuJyArIG5vZGVTb3VyY2VDb2RlXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5vZGVTb3VyY2VDb2RlXG4gICAgICAgICAgICAgICAgICB9KS5qb2luKCcnKVxuICAgICAgICAgICAgICAgICwgaW5zZXJ0Rml4ZXIgPSBudWxsXG4gICAgICAgICAgICAgICAgLCByZXBsYWNlU291cmNlQ29kZSA9ICcnXG4gICAgICAgICAgICAgIGlmICghbGFzdExlZ2FsSW1wKSB7XG4gICAgICAgICAgICAgICAgICBpbnNlcnRTb3VyY2VDb2RlID1cbiAgICAgICAgICAgICAgICAgICAgaW5zZXJ0U291cmNlQ29kZS50cmltKCkgKyBpbnNlcnRTb3VyY2VDb2RlLm1hdGNoKC9eKFxccyspLylbMF1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpbnNlcnRGaXhlciA9IGxhc3RMZWdhbEltcCA/XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZml4ZXIuaW5zZXJ0VGV4dEFmdGVyKGxhc3RMZWdhbEltcCwgaW5zZXJ0U291cmNlQ29kZSkgOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpeGVyLmluc2VydFRleHRCZWZvcmUoYm9keVswXSwgaW5zZXJ0U291cmNlQ29kZSlcbiAgICAgICAgICAgICAgY29uc3QgZml4ZXJzID0gW2luc2VydEZpeGVyXS5jb25jYXQocmVtb3ZlRml4ZXJzKVxuICAgICAgICAgICAgICBmaXhlcnMuZm9yRWFjaChmdW5jdGlvbiAoY29tcHV0ZWRGaXhlciwgaSkge1xuICAgICAgICAgICAgICAgIHJlcGxhY2VTb3VyY2VDb2RlICs9IChvcmlnaW5Tb3VyY2VDb2RlLnNsaWNlKFxuICAgICAgICAgICAgICAgICAgZml4ZXJzW2kgLSAxXSA/IGZpeGVyc1tpIC0gMV0ucmFuZ2VbMV0gOiAwLCBjb21wdXRlZEZpeGVyLnJhbmdlWzBdXG4gICAgICAgICAgICAgICAgKSArIGNvbXB1dGVkRml4ZXIudGV4dClcbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgcmV0dXJuIGZpeGVyLnJlcGxhY2VUZXh0UmFuZ2UocmFuZ2UsIHJlcGxhY2VTb3VyY2VDb2RlKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBjb250ZXh0LnJlcG9ydChpbmZvcylcbiAgICAgICAgfSlcbiAgICAgIH0sXG4gICAgfVxuICB9LFxufVxuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/group-exports.js b/node_modules/eslint-plugin-import/lib/rules/group-exports.js new file mode 100644 index 000000000..42f6b4954 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/group-exports.js @@ -0,0 +1,153 @@ +'use strict';var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl); +var _object = require('object.values');var _object2 = _interopRequireDefault(_object); +var _arrayPrototype = require('array.prototype.flat');var _arrayPrototype2 = _interopRequireDefault(_arrayPrototype);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +const meta = { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('group-exports') } + + + /* eslint-disable max-len */ }; +const errors = { + ExportNamedDeclaration: 'Multiple named export declarations; consolidate all named exports into a single export declaration', + AssignmentExpression: 'Multiple CommonJS exports; consolidate all exports into a single assignment to `module.exports`' + + /* eslint-enable max-len */ + + /** + * Returns an array with names of the properties in the accessor chain for MemberExpression nodes + * + * Example: + * + * `module.exports = {}` => ['module', 'exports'] + * `module.exports.property = true` => ['module', 'exports', 'property'] + * + * @param {Node} node AST Node (MemberExpression) + * @return {Array} Array with the property names in the chain + * @private + */ }; +function accessorChain(node) { + const chain = []; + + do { + chain.unshift(node.property.name); + + if (node.object.type === 'Identifier') { + chain.unshift(node.object.name); + break; + } + + node = node.object; + } while (node.type === 'MemberExpression'); + + return chain; +} + +function create(context) { + const nodes = { + modules: { + set: new Set(), + sources: {} }, + + types: { + set: new Set(), + sources: {} }, + + commonjs: { + set: new Set() } }; + + + + return { + ExportNamedDeclaration(node) { + let target = node.exportKind === 'type' ? nodes.types : nodes.modules; + if (!node.source) { + target.set.add(node); + } else if (Array.isArray(target.sources[node.source.value])) { + target.sources[node.source.value].push(node); + } else { + target.sources[node.source.value] = [node]; + } + }, + + AssignmentExpression(node) { + if (node.left.type !== 'MemberExpression') { + return; + } + + const chain = accessorChain(node.left); + + // Assignments to module.exports + // Deeper assignments are ignored since they just modify what's already being exported + // (ie. module.exports.exported.prop = true is ignored) + if (chain[0] === 'module' && chain[1] === 'exports' && chain.length <= 3) { + nodes.commonjs.set.add(node); + return; + } + + // Assignments to exports (exports.* = *) + if (chain[0] === 'exports' && chain.length === 2) { + nodes.commonjs.set.add(node); + return; + } + }, + + 'Program:exit': function onExit() { + // Report multiple `export` declarations (ES2015 modules) + if (nodes.modules.set.size > 1) { + nodes.modules.set.forEach(node => { + context.report({ + node, + message: errors[node.type] }); + + }); + } + + // Report multiple `aggregated exports` from the same module (ES2015 modules) + (0, _arrayPrototype2.default)((0, _object2.default)(nodes.modules.sources). + filter(nodesWithSource => Array.isArray(nodesWithSource) && nodesWithSource.length > 1)). + forEach(node => { + context.report({ + node, + message: errors[node.type] }); + + }); + + // Report multiple `export type` declarations (FLOW ES2015 modules) + if (nodes.types.set.size > 1) { + nodes.types.set.forEach(node => { + context.report({ + node, + message: errors[node.type] }); + + }); + } + + // Report multiple `aggregated type exports` from the same module (FLOW ES2015 modules) + (0, _arrayPrototype2.default)((0, _object2.default)(nodes.types.sources). + filter(nodesWithSource => Array.isArray(nodesWithSource) && nodesWithSource.length > 1)). + forEach(node => { + context.report({ + node, + message: errors[node.type] }); + + }); + + // Report multiple `module.exports` assignments (CommonJS) + if (nodes.commonjs.set.size > 1) { + nodes.commonjs.set.forEach(node => { + context.report({ + node, + message: errors[node.type] }); + + }); + } + } }; + +} + +module.exports = { + meta, + create }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9ncm91cC1leHBvcnRzLmpzIl0sIm5hbWVzIjpbIm1ldGEiLCJ0eXBlIiwiZG9jcyIsInVybCIsImVycm9ycyIsIkV4cG9ydE5hbWVkRGVjbGFyYXRpb24iLCJBc3NpZ25tZW50RXhwcmVzc2lvbiIsImFjY2Vzc29yQ2hhaW4iLCJub2RlIiwiY2hhaW4iLCJ1bnNoaWZ0IiwicHJvcGVydHkiLCJuYW1lIiwib2JqZWN0IiwiY3JlYXRlIiwiY29udGV4dCIsIm5vZGVzIiwibW9kdWxlcyIsInNldCIsIlNldCIsInNvdXJjZXMiLCJ0eXBlcyIsImNvbW1vbmpzIiwidGFyZ2V0IiwiZXhwb3J0S2luZCIsInNvdXJjZSIsImFkZCIsIkFycmF5IiwiaXNBcnJheSIsInZhbHVlIiwicHVzaCIsImxlZnQiLCJsZW5ndGgiLCJvbkV4aXQiLCJzaXplIiwiZm9yRWFjaCIsInJlcG9ydCIsIm1lc3NhZ2UiLCJmaWx0ZXIiLCJub2Rlc1dpdGhTb3VyY2UiLCJtb2R1bGUiLCJleHBvcnRzIl0sIm1hcHBpbmdzIjoiYUFBQSxxQztBQUNBLHVDO0FBQ0Esc0Q7O0FBRUEsTUFBTUEsT0FBTztBQUNYQyxRQUFNLFlBREs7QUFFWEMsUUFBTTtBQUNKQyxTQUFLLHVCQUFRLGVBQVIsQ0FERDs7O0FBSVIsOEJBTmEsRUFBYjtBQU9BLE1BQ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jb250ZXh0LnJlcG9ydCh7XG4gICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgbWVzc2FnZTogZXJyb3JzW25vZGUudHlwZV0sXG4gICAgICAgICAgfSlcbiAgICAgICAgfSlcbiAgICAgIH1cblxuICAgICAgLy8gUmVwb3J0IG11bHRpcGxlIGBhZ2dyZWdhdGVkIGV4cG9ydHNgIGZyb20gdGhlIHNhbWUgbW9kdWxlIChFUzIwMTUgbW9kdWxlcylcbiAgICAgIGZsYXQodmFsdWVzKG5vZGVzLm1vZHVsZXMuc291cmNlcylcbiAgICAgICAgLmZpbHRlcihub2Rlc1dpdGhTb3VyY2UgPT4gQXJyYXkuaXNBcnJheShub2Rlc1dpdGhTb3VyY2UpICYmIG5vZGVzV2l0aFNvdXJjZS5sZW5ndGggPiAxKSlcbiAgICAgICAgLmZvckVhY2goKG5vZGUpID0+IHtcbiAgICAgICAgICBjb250ZXh0LnJlcG9ydCh7XG4gICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgbWVzc2FnZTogZXJyb3JzW25vZGUudHlwZV0sXG4gICAgICAgICAgfSlcbiAgICAgICAgfSlcblxuICAgICAgLy8gUmVwb3J0IG11bHRpcGxlIGBleHBvcnQgdHlwZWAgZGVjbGFyYXRpb25zIChGTE9XIEVTMjAxNSBtb2R1bGVzKVxuICAgICAgaWYgKG5vZGVzLnR5cGVzLnNldC5zaXplID4gMSkge1xuICAgICAgICBub2Rlcy50eXBlcy5zZXQuZm9yRWFjaChub2RlID0+IHtcbiAgICAgICAgICBjb250ZXh0LnJlcG9ydCh7XG4gICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgbWVzc2FnZTogZXJyb3JzW25vZGUudHlwZV0sXG4gICAgICAgICAgfSlcbiAgICAgICAgfSlcbiAgICAgIH1cblxuICAgICAgLy8gUmVwb3J0IG11bHRpcGxlIGBhZ2dyZWdhdGVkIHR5cGUgZXhwb3J0c2AgZnJvbSB0aGUgc2FtZSBtb2R1bGUgKEZMT1cgRVMyMDE1IG1vZHVsZXMpXG4gICAgICBmbGF0KHZhbHVlcyhub2Rlcy50eXBlcy5zb3VyY2VzKVxuICAgICAgICAuZmlsdGVyKG5vZGVzV2l0aFNvdXJjZSA9PiBBcnJheS5pc0FycmF5KG5vZGVzV2l0aFNvdXJjZSkgJiYgbm9kZXNXaXRoU291cmNlLmxlbmd0aCA+IDEpKVxuICAgICAgICAuZm9yRWFjaCgobm9kZSkgPT4ge1xuICAgICAgICAgIGNvbnRleHQucmVwb3J0KHtcbiAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICBtZXNzYWdlOiBlcnJvcnNbbm9kZS50eXBlXSxcbiAgICAgICAgICB9KVxuICAgICAgICB9KVxuXG4gICAgICAvLyBSZXBvcnQgbXVsdGlwbGUgYG1vZHVsZS5leHBvcnRzYCBhc3NpZ25tZW50cyAoQ29tbW9uSlMpXG4gICAgICBpZiAobm9kZXMuY29tbW9uanMuc2V0LnNpemUgPiAxKSB7XG4gICAgICAgIG5vZGVzLmNvbW1vbmpzLnNldC5mb3JFYWNoKG5vZGUgPT4ge1xuICAgICAgICAgIGNvbnRleHQucmVwb3J0KHtcbiAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICBtZXNzYWdlOiBlcnJvcnNbbm9kZS50eXBlXSxcbiAgICAgICAgICB9KVxuICAgICAgICB9KVxuICAgICAgfVxuICAgIH0sXG4gIH1cbn1cblxubW9kdWxlLmV4cG9ydHMgPSB7XG4gIG1ldGEsXG4gIGNyZWF0ZSxcbn1cbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/imports-first.js b/node_modules/eslint-plugin-import/lib/rules/imports-first.js new file mode 100644 index 000000000..7f6d199ca --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/imports-first.js @@ -0,0 +1,13 @@ +'use strict';var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +const first = require('./first'); + +const newMeta = Object.assign({}, first.meta, { + deprecated: true, + docs: { + url: (0, _docsUrl2.default)('imports-first', '7b25c1cb95ee18acc1531002fd343e1e6031f9ed') } }); + + + +module.exports = Object.assign({}, first, { meta: newMeta }); +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9pbXBvcnRzLWZpcnN0LmpzIl0sIm5hbWVzIjpbImZpcnN0IiwicmVxdWlyZSIsIm5ld01ldGEiLCJPYmplY3QiLCJhc3NpZ24iLCJtZXRhIiwiZGVwcmVjYXRlZCIsImRvY3MiLCJ1cmwiLCJtb2R1bGUiLCJleHBvcnRzIl0sIm1hcHBpbmdzIjoiYUFBQSxxQzs7QUFFQSxNQUFNQSxRQUFRQyxRQUFRLFNBQVIsQ0FBZDs7QUFFQSxNQUFNQyxVQUFVQyxPQUFPQyxNQUFQLENBQWMsRUFBZCxFQUFrQkosTUFBTUssSUFBeEIsRUFBOEI7QUFDNUNDLGNBQVksSUFEZ0M7QUFFNUNDLFFBQU07QUFDSkMsU0FBSyx1QkFBUSxlQUFSLEVBQXlCLDBDQUF6QixDQURELEVBRnNDLEVBQTlCLENBQWhCOzs7O0FBT0FDLE9BQU9DLE9BQVAsR0FBaUJQLE9BQU9DLE1BQVAsQ0FBYyxFQUFkLEVBQWtCSixLQUFsQixFQUF5QixFQUFFSyxNQUFNSCxPQUFSLEVBQXpCLENBQWpCIiwiZmlsZSI6ImltcG9ydHMtZmlyc3QuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgZG9jc1VybCBmcm9tICcuLi9kb2NzVXJsJ1xuXG5jb25zdCBmaXJzdCA9IHJlcXVpcmUoJy4vZmlyc3QnKVxuXG5jb25zdCBuZXdNZXRhID0gT2JqZWN0LmFzc2lnbih7fSwgZmlyc3QubWV0YSwge1xuICBkZXByZWNhdGVkOiB0cnVlLFxuICBkb2NzOiB7XG4gICAgdXJsOiBkb2NzVXJsKCdpbXBvcnRzLWZpcnN0JywgJzdiMjVjMWNiOTVlZTE4YWNjMTUzMTAwMmZkMzQzZTFlNjAzMWY5ZWQnKSxcbiAgfSxcbn0pXG5cbm1vZHVsZS5leHBvcnRzID0gT2JqZWN0LmFzc2lnbih7fSwgZmlyc3QsIHsgbWV0YTogbmV3TWV0YSB9KVxuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/max-dependencies.js b/node_modules/eslint-plugin-import/lib/rules/max-dependencies.js new file mode 100644 index 000000000..83aaeeaec --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/max-dependencies.js @@ -0,0 +1,58 @@ +'use strict';var _slicedToArray = function () {function sliceIterator(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"]) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}return function (arr, i) {if (Array.isArray(arr)) {return arr;} else if (Symbol.iterator in Object(arr)) {return sliceIterator(arr, i);} else {throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();var _staticRequire = require('../core/staticRequire');var _staticRequire2 = _interopRequireDefault(_staticRequire); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +const DEFAULT_MAX = 10; + +const countDependencies = (dependencies, lastNode, context) => {var _ref = + context.options[0] || { max: DEFAULT_MAX };const max = _ref.max; + + if (dependencies.size > max) { + context.report( + lastNode, + `Maximum number of dependencies (${max}) exceeded.`); + + } +}; + +module.exports = { + meta: { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('max-dependencies') }, + + + schema: [ + { + 'type': 'object', + 'properties': { + 'max': { 'type': 'number' } }, + + 'additionalProperties': false }] }, + + + + + create: context => { + const dependencies = new Set(); // keep track of dependencies + let lastNode; // keep track of the last node to report on + + return { + ImportDeclaration(node) { + dependencies.add(node.source.value); + lastNode = node.source; + }, + + CallExpression(node) { + if ((0, _staticRequire2.default)(node)) {var _node$arguments = _slicedToArray( + node.arguments, 1);const requirePath = _node$arguments[0]; + dependencies.add(requirePath.value); + lastNode = node; + } + }, + + 'Program:exit': function () { + countDependencies(dependencies, lastNode, context); + } }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9tYXgtZGVwZW5kZW5jaWVzLmpzIl0sIm5hbWVzIjpbIkRFRkFVTFRfTUFYIiwiY291bnREZXBlbmRlbmNpZXMiLCJkZXBlbmRlbmNpZXMiLCJsYXN0Tm9kZSIsImNvbnRleHQiLCJvcHRpb25zIiwibWF4Iiwic2l6ZSIsInJlcG9ydCIsIm1vZHVsZSIsImV4cG9ydHMiLCJtZXRhIiwidHlwZSIsImRvY3MiLCJ1cmwiLCJzY2hlbWEiLCJjcmVhdGUiLCJTZXQiLCJJbXBvcnREZWNsYXJhdGlvbiIsIm5vZGUiLCJhZGQiLCJzb3VyY2UiLCJ2YWx1ZSIsIkNhbGxFeHByZXNzaW9uIiwiYXJndW1lbnRzIiwicmVxdWlyZVBhdGgiXSwibWFwcGluZ3MiOiJxb0JBQUEsc0Q7QUFDQSxxQzs7QUFFQSxNQUFNQSxjQUFjLEVBQXBCOztBQUVBLE1BQU1DLG9CQUFvQixDQUFDQyxZQUFELEVBQWVDLFFBQWYsRUFBeUJDLE9BQXpCLEtBQXFDO0FBQy9DQSxVQUFRQyxPQUFSLENBQWdCLENBQWhCLEtBQXNCLEVBQUVDLEtBQUtOLFdBQVAsRUFEeUIsT0FDdERNLEdBRHNELFFBQ3REQSxHQURzRDs7QUFHN0QsTUFBSUosYUFBYUssSUFBYixHQUFvQkQsR0FBeEIsRUFBNkI7QUFDM0JGLFl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GUgLy8ga2VlcCB0cmFjayBvZiB0aGUgbGFzdCBub2RlIHRvIHJlcG9ydCBvblxuXG4gICAgcmV0dXJuIHtcbiAgICAgIEltcG9ydERlY2xhcmF0aW9uKG5vZGUpIHtcbiAgICAgICAgZGVwZW5kZW5jaWVzLmFkZChub2RlLnNvdXJjZS52YWx1ZSlcbiAgICAgICAgbGFzdE5vZGUgPSBub2RlLnNvdXJjZVxuICAgICAgfSxcblxuICAgICAgQ2FsbEV4cHJlc3Npb24obm9kZSkge1xuICAgICAgICBpZiAoaXNTdGF0aWNSZXF1aXJlKG5vZGUpKSB7XG4gICAgICAgICAgY29uc3QgWyByZXF1aXJlUGF0aCBdID0gbm9kZS5hcmd1bWVudHNcbiAgICAgICAgICBkZXBlbmRlbmNpZXMuYWRkKHJlcXVpcmVQYXRoLnZhbHVlKVxuICAgICAgICAgIGxhc3ROb2RlID0gbm9kZVxuICAgICAgICB9XG4gICAgICB9LFxuXG4gICAgICAnUHJvZ3JhbTpleGl0JzogZnVuY3Rpb24gKCkge1xuICAgICAgICBjb3VudERlcGVuZGVuY2llcyhkZXBlbmRlbmNpZXMsIGxhc3ROb2RlLCBjb250ZXh0KVxuICAgICAgfSxcbiAgICB9XG4gIH0sXG59XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/named.js b/node_modules/eslint-plugin-import/lib/rules/named.js new file mode 100644 index 000000000..f2b516612 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/named.js @@ -0,0 +1,72 @@ +'use strict';var _path = require('path');var path = _interopRequireWildcard(_path); +var _ExportMap = require('../ExportMap');var _ExportMap2 = _interopRequireDefault(_ExportMap); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _interopRequireWildcard(obj) {if (obj && obj.__esModule) {return obj;} else {var newObj = {};if (obj != null) {for (var key in obj) {if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];}}newObj.default = obj;return newObj;}} + +module.exports = { + meta: { + type: 'problem', + docs: { + url: (0, _docsUrl2.default)('named') }, + + schema: [] }, + + + create: function (context) { + function checkSpecifiers(key, type, node) { + // ignore local exports and type imports/exports + if (node.source == null || node.importKind === 'type' || + node.importKind === 'typeof' || node.exportKind === 'type') { + return; + } + + if (!node.specifiers. + some(function (im) {return im.type === type;})) { + return; // no named imports/exports + } + + const imports = _ExportMap2.default.get(node.source.value, context); + if (imports == null) return; + + if (imports.errors.length) { + imports.reportErrors(context, node); + return; + } + + node.specifiers.forEach(function (im) { + if (im.type !== type) return; + + // ignore type imports + if (im.importKind === 'type' || im.importKind === 'typeof') return; + + const deepLookup = imports.hasDeep(im[key].name); + + if (!deepLookup.found) { + if (deepLookup.path.length > 1) { + const deepPath = deepLookup.path. + map(i => path.relative(path.dirname(context.getFilename()), i.path)). + join(' -> '); + + context.report(im[key], + `${im[key].name} not found via ${deepPath}`); + } else { + context.report(im[key], + im[key].name + ' not found in \'' + node.source.value + '\''); + } + } + }); + } + + return { + 'ImportDeclaration': checkSpecifiers.bind(null, + 'imported', + 'ImportSpecifier'), + + + 'ExportNamedDeclaration': checkSpecifiers.bind(null, + 'local', + 'ExportSpecifier') }; + + + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uYW1lZC5qcyJdLCJuYW1lcyI6WyJwYXRoIiwibW9kdWxlIiwiZXhwb3J0cyIsIm1ldGEiLCJ0eXBlIiwiZG9jcyIsInVybCIsInNjaGVtYSIsImNyZWF0ZSIsImNvbnRleHQiLCJjaGVja1NwZWNpZmllcnMiLCJrZXkiLCJub2RlIiwic291cmNlIiwiaW1wb3J0S2luZCIsImV4cG9ydEtpbmQiLCJzcGVjaWZpZXJzIiwic29tZSIsImltIiwiaW1wb3J0cyIsIkV4cG9ydHMiLCJnZXQiLCJ2YWx1ZSI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hdGgpKVxuICAgICAgICAgICAgICAuam9pbignIC0+ICcpXG5cbiAgICAgICAgICAgIGNvbnRleHQucmVwb3J0KGltW2tleV0sXG4gICAgICAgICAgICAgIGAke2ltW2tleV0ubmFtZX0gbm90IGZvdW5kIHZpYSAke2RlZXBQYXRofWApXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbnRleHQucmVwb3J0KGltW2tleV0sXG4gICAgICAgICAgICAgIGltW2tleV0ubmFtZSArICcgbm90IGZvdW5kIGluIFxcJycgKyBub2RlLnNvdXJjZS52YWx1ZSArICdcXCcnKVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSlcbiAgICB9XG5cbiAgICByZXR1cm4ge1xuICAgICAgJ0ltcG9ydERlY2xhcmF0aW9uJzogY2hlY2tTcGVjaWZpZXJzLmJpbmQoIG51bGxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLCAnaW1wb3J0ZWQnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICwgJ0ltcG9ydFNwZWNpZmllcidcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSxcblxuICAgICAgJ0V4cG9ydE5hbWVkRGVjbGFyYXRpb24nOiBjaGVja1NwZWNpZmllcnMuYmluZCggbnVsbFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICwgJ2xvY2FsJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICwgJ0V4cG9ydFNwZWNpZmllcidcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApLFxuICAgIH1cblxuICB9LFxufVxuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/namespace.js b/node_modules/eslint-plugin-import/lib/rules/namespace.js new file mode 100644 index 000000000..0b9abf828 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/namespace.js @@ -0,0 +1,217 @@ +'use strict';var _declaredScope = require('eslint-module-utils/declaredScope');var _declaredScope2 = _interopRequireDefault(_declaredScope); +var _ExportMap = require('../ExportMap');var _ExportMap2 = _interopRequireDefault(_ExportMap); +var _importDeclaration = require('../importDeclaration');var _importDeclaration2 = _interopRequireDefault(_importDeclaration); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +module.exports = { + meta: { + type: 'problem', + docs: { + url: (0, _docsUrl2.default)('namespace') }, + + + schema: [ + { + type: 'object', + properties: { + allowComputed: { + description: 'If `false`, will report computed (and thus, un-lintable) references to namespace members.', + type: 'boolean', + default: false } }, + + + additionalProperties: false }] }, + + + + + create: function namespaceRule(context) { + + // read options + var _ref = + + context.options[0] || {},_ref$allowComputed = _ref.allowComputed;const allowComputed = _ref$allowComputed === undefined ? false : _ref$allowComputed; + + const namespaces = new Map(); + + function makeMessage(last, namepath) { + return `'${last.name}' not found in ${namepath.length > 1 ? 'deeply ' : ''}imported namespace '${namepath.join('.')}'.`; + } + + return { + // pick up all imports at body entry time, to properly respect hoisting + Program(_ref2) {let body = _ref2.body; + function processBodyStatement(declaration) { + if (declaration.type !== 'ImportDeclaration') return; + + if (declaration.specifiers.length === 0) return; + + const imports = _ExportMap2.default.get(declaration.source.value, context); + if (imports == null) return null; + + if (imports.errors.length) { + imports.reportErrors(context, declaration); + return; + } + + for (const specifier of declaration.specifiers) { + switch (specifier.type) { + case 'ImportNamespaceSpecifier': + if (!imports.size) { + context.report( + specifier, + `No exported names found in module '${declaration.source.value}'.`); + + } + namespaces.set(specifier.local.name, imports); + break; + case 'ImportDefaultSpecifier': + case 'ImportSpecifier':{ + const meta = imports.get( + // default to 'default' for default http://i.imgur.com/nj6qAWy.jpg + specifier.imported ? specifier.imported.name : 'default'); + + if (!meta || !meta.namespace) {break;} + namespaces.set(specifier.local.name, meta.namespace); + break; + }} + + } + } + body.forEach(processBodyStatement); + }, + + // same as above, but does not add names to local map + ExportNamespaceSpecifier(namespace) { + var declaration = (0, _importDeclaration2.default)(context); + + var imports = _ExportMap2.default.get(declaration.source.value, context); + if (imports == null) return null; + + if (imports.errors.length) { + imports.reportErrors(context, declaration); + return; + } + + if (!imports.size) { + context.report( + namespace, + `No exported names found in module '${declaration.source.value}'.`); + + } + }, + + // todo: check for possible redefinition + + MemberExpression(dereference) { + if (dereference.object.type !== 'Identifier') return; + if (!namespaces.has(dereference.object.name)) return; + if ((0, _declaredScope2.default)(context, dereference.object.name) !== 'module') return; + + if (dereference.parent.type === 'AssignmentExpression' && dereference.parent.left === dereference) { + context.report( + dereference.parent, + `Assignment to member of namespace '${dereference.object.name}'.`); + + } + + // go deep + var namespace = namespaces.get(dereference.object.name); + var namepath = [dereference.object.name]; + // while property is namespace and parent is member expression, keep validating + while (namespace instanceof _ExportMap2.default && dereference.type === 'MemberExpression') { + + if (dereference.computed) { + if (!allowComputed) { + context.report( + dereference.property, + `Unable to validate computed reference to imported namespace '${dereference.object.name}'.`); + + } + return; + } + + if (!namespace.has(dereference.property.name)) { + context.report( + dereference.property, + makeMessage(dereference.property, namepath)); + + break; + } + + const exported = namespace.get(dereference.property.name); + if (exported == null) return; + + // stash and pop + namepath.push(dereference.property.name); + namespace = exported.namespace; + dereference = dereference.parent; + } + + }, + + VariableDeclarator(_ref3) {let id = _ref3.id,init = _ref3.init; + if (init == null) return; + if (init.type !== 'Identifier') return; + if (!namespaces.has(init.name)) return; + + // check for redefinition in intermediate scopes + if ((0, _declaredScope2.default)(context, init.name) !== 'module') return; + + // DFS traverse child namespaces + function testKey(pattern, namespace) {let path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [init.name]; + if (!(namespace instanceof _ExportMap2.default)) return; + + if (pattern.type !== 'ObjectPattern') return; + + for (const property of pattern.properties) { + if ( + property.type === 'ExperimentalRestProperty' || + property.type === 'RestElement' || + !property.key) + { + continue; + } + + if (property.key.type !== 'Identifier') { + context.report({ + node: property, + message: 'Only destructure top-level names.' }); + + continue; + } + + if (!namespace.has(property.key.name)) { + context.report({ + node: property, + message: makeMessage(property.key, path) }); + + continue; + } + + path.push(property.key.name); + const dependencyExportMap = namespace.get(property.key.name); + // could be null when ignored or ambiguous + if (dependencyExportMap !== null) { + testKey(property.value, dependencyExportMap.namespace, path); + } + path.pop(); + } + } + + testKey(id, namespaces.get(init.name)); + }, + + JSXMemberExpression(_ref4) {let object = _ref4.object,property = _ref4.property; + if (!namespaces.has(object.name)) return; + var namespace = namespaces.get(object.name); + if (!namespace.has(property.name)) { + context.report({ + node: property, + message: makeMessage(property, [object.name]) }); + + } + } }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uYW1lc3BhY2UuanMiXSwibmFtZXMiOlsibW9kdWxlIiwiZXhwb3J0cyIsIm1ldGEiLCJ0eXBlIiwiZG9jcyIsInVybCIsInNjaGVtYSIsInByb3BlcnRpZXMiLCJhbGxvd0NvbXB1dGVkIiwiZGVzY3JpcHRpb24iLCJkZWZhdWx0IiwiYWRkaXRpb25hbFByb3BlcnRpZXMiLCJjcmVhdGUiLCJuYW1lc3BhY2VSdWxlIiwiY29udGV4dCIsIm9wdGlvbnMiLCJuYW1lc3BhY2VzIiwiTWFwIiwibWFrZU1lc3NhZ2UiLCJsYXN0IiwibmFtZXBhdGgiLCJuYW1lIiwibGVuZ3RoIiwiam9pbiIsIlByb2dyYW0iLCJib2R5IiwicHJvY2Vzc0JvZHlTdGF0ZW1lbnQiLCJkZWNsYXJhdGlvbiIsInNwZWNpZmllcnMiLCJpbXBvcnRzIiwiRXhwb3J0cyIsImdldCIsInNvdXJjZSIsInZhbHVlIiwiZXJyb3JzIiwicmVwb3J0RXJyb3JzIiwic3BlY2lmaWVyIiwic2l6ZS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gZW50cnkgdGltZSwgdG8gcHJvcGVybHkgcmVzcGVjdCBob2lzdGluZ1xuICAgICAgUHJvZ3JhbSh7IGJvZHkgfSkge1xuICAgICAgICBmdW5jdGlvbiBwcm9jZXNzQm9keVN0YXRlbWVudChkZWNsYXJhdGlvbikge1xuICAgICAgICAgIGlmIChkZWNsYXJhdGlvbi50eXBlICE9PSAnSW1wb3J0RGVjbGFyYXRpb24nKSByZXR1cm5cblxuICAgICAgICAgIGlmIChkZWNsYXJhdGlvbi5zcGVjaWZpZXJzLmxlbmd0aCA9PT0gMCkgcmV0dXJuXG5cbiAgICAgICAgICBjb25zdCBpbXBvcnRzID0gRXhwb3J0cy5nZXQoZGVjbGFyYXRpb24uc291cmNlLnZhbHVlLCBjb250ZXh0KVxuICAgICAgICAgIGlmIChpbXBvcnRzID09IG51bGwpIHJldHVybiBudWxsXG5cbiAgICAgICAgICBpZiAoaW1wb3J0cy5lcnJvcnMubGVuZ3RoKSB7XG4gICAgICAgICAgICBpbXBvcnRzLnJlcG9ydEVycm9ycyhjb250ZXh0LCBkZWNsYXJhdGlvbilcbiAgICAgICAgICAgIHJldHVyblxuICAgICAgICAgIH1cblxuICAgICAgICAgIGZvciAoY29uc3Qgc3BlY2lmaWVyIG9mIGRlY2xhcmF0aW9uLnNwZWNpZmllcnMpIHtcbiAgICAgICAgICAgIHN3aXRjaCAoc3BlY2lmaWVyLnR5cGUpIHtcbiAgICAgICAgICAgICAgY2FzZSAnSW1wb3J0TmFtZXNwYWNlU3BlY2lmaWVyJzpcbiAgICAgICAgICAgICAgICBpZiAoIWltcG9ydHMuc2l6ZSkge1xuICAgICAgICAgICAgICAgICAgY29udGV4dC5yZXBvcnQoXG4gICAgICAgICAgICAgICAgICAgIHNwZWNpZmllcixcbiAgICAgICAgICAgICAgICAgICAgYE5vIGV4cG9ydGVkIG5hbWVzIGZvdW5kIGluIG1vZHVsZSAnJHtkZWNsYXJhdGlvbi5zb3VyY2UudmFsdWV9Jy5gXG4gICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG5hbWVzcGFjZXMuc2V0KHNwZWNpZmllci5sb2NhbC5uYW1lLCBpbXBvcnRzKVxuICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgIGNhc2UgJ0ltcG9ydERlZmF1bHRTcGVjaWZpZXInOlxuICAgICAgICAgICAgICBjYXNlICdJbXBvcnRTcGVjaWZpZXInOiB7XG4gICAgICAgICAgICAgICAgY29uc3QgbWV0YSA9IGltcG9ydHMuZ2V0KFxuICAgICAgICAgICAgICAgICAgLy8gZGVmYXVsdCB0byAnZGVmYXVsdCcgZm9yIGRlZmF1bHQgaHR0cDovL2kuaW1ndXIuY29tL25qNnFBV3kuanBnXG4gICAgICAgICAgICAgICAgICBzcGVjaWZpZXIuaW1wb3J0ZWQgPyBzcGVjaWZpZXIuaW1wb3J0ZWQubmFtZSA6ICdkZWZhdWx0J1xuICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICBpZiAoIW1ldGEgfHwgIW1ldGEubmFtZXNwYWNlKSB7IGJyZWFrIH1cbiAgICAgICAgICAgICAgICBuYW1lc3BhY2VzLnNldChzcGVjaWZpZXIubG9jYWwubmFtZSwgbWV0YS5uYW1lc3BhY2UpXG4gICAgICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBib2R5LmZvckVhY2gocHJvY2Vzc0JvZHlTdGF0ZW1lbnQpXG4gICAgICB9LFxuXG4gICAgICAvLyBzYW1lIGFzIGFib3ZlLCBidXQgZG9lcyBub3QgYWRkIG5hbWVzIHRvIGxvY2FsIG1hcFxuICAgICAgRXhwb3J0TmFtZXNwYWNlU3BlY2lmaWVyKG5hbWVzcGFjZSkge1xuICAgICAgICB2YXIgZGVjbGFyYXRpb24gPSBpbXBvcnREZWNsYXJhdGlvbihjb250ZXh0KVxuXG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YWNlLmhhcyhkZXJlZmVyZW5jZS5wcm9wZXJ0eS5uYW1lKSkge1xuICAgICAgICAgICAgY29udGV4dC5yZXBvcnQoXG4gICAgICAgICAgICAgIGRlcmVmZXJlbmNlLnByb3BlcnR5LFxuICAgICAgICAgICAgICBtYWtlTWVzc2FnZShkZXJlZmVyZW5jZS5wcm9wZXJ0eSwgbmFtZXBhdGgpXG4gICAgICAgICAgICApXG4gICAgICAgICAgICBicmVha1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGNvbnN0IGV4cG9ydGVkID0gbmFtZXNwYWNlLmdldChkZXJlZmVyZW5jZS5wcm9wZXJ0eS5uYW1lKVxuICAgICAgICAgIGlmIChleHBvcnRlZCA9PSBudWxsKSByZXR1cm5cblxuICAgICAgICAgIC8vIHN0YXNoIGFuZCBwb3BcbiAgICAgICAgICBuYW1lcGF0aC5wdXNoKGRlcmVmZXJlbmNlLnByb3BlcnR5Lm5hbWUpXG4gICAgICAgICAgbmFtZXNwYWNlID0gZXhwb3J0ZWQubmFtZXNwYWNlXG4gICAgICAgICAgZGVyZWZlcmVuY2UgPSBkZXJlZmVyZW5jZS5wYXJlbnRcbiAgICAgICAgfVxuXG4gICAgICB9LFxuXG4gICAgICBWYXJpYWJsZURlY2xhcmF0b3IoeyBpZCwgaW5pdCB9KSB7XG4gICAgICAgIGlmIChpbml0ID09IG51bGwpIHJldHVyblxuICAgICAgICBpZiAoaW5pdC50eXBlICE9PSAnSWRlbnRpZmllcicpIHJldHVyblxuICAgICAgICBpZiAoIW5hbWVzcGFjZXMuaGFzKGluaXQubmFtZSkpIHJldHVyblxuXG4gICAgICAgIC8vIGNoZWNrIGZvciByZWRlZmluaXRpb24gaW4gaW50ZXJtZWRpYXRlIHNjb3Blc1xuICAgICAgICBpZiAoZGVjbGFyZWRTY29wZShjb250ZXh0LCBpbml0Lm5hbWUpICE9PSAnbW9kdWxlJykgcmV0dXJuXG5cbiAgICAgICAgLy8gREZTIHRyYXZlcnNlIGNoaWxkIG5hbWVzcGFjZXNcbiAgICAgICAgZnVuY3Rpb24gdGVzdEtleShwYXR0ZXJuLCBuYW1lc3BhY2UsIHBhdGggPSBbaW5pdC5uYW1lXSkge1xuICAgICAgICAgIGlmICghKG5hbWVzcGFjZSBpbnN0YW5jZW9mIEV4cG9ydHMpKSByZXR1cm5cblxuICAgICAgICAgIGlmIChwYXR0ZXJuLnR5cGUgIT09ICdPYmplY3RQYXR0ZXJuJykgcmV0dXJuXG5cbiAgICAgICAgICBmb3IgKGNvbnN0IHByb3BlcnR5IG9mIHBhdHRlcm4ucHJvcGVydGllcykge1xuICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICBwcm9wZXJ0eS50eXBlID09PSAnRXhwZXJpbWVudGFsUmVzdFByb3BlcnR5J1xuICAgICAgICAgICAgICB8fCBwcm9wZXJ0eS50eXBlID09PSAnUmVzdEVsZW1lbnQnXG4gICAgICAgICAgICAgIHx8ICFwcm9wZXJ0eS5rZXlcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICBjb250aW51ZVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAocHJvcGVydHkua2V5LnR5cGUgIT09ICdJZGVudGlmaWVyJykge1xuICAgICAgICAgICAgICBjb250ZXh0LnJlcG9ydCh7XG4gICAgICAgICAgICAgICAgbm9kZTogcHJvcGVydHksXG4gICAgICAgICAgICAgICAgbWVzc2FnZTogJ09ubHkgZGVzdHJ1Y3R1cmUgdG9wLWxldmVsIG5hbWVzLicsXG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgIGNvbnRpbnVlXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICghbmFtZXNwYWNlLmhhcyhwcm9wZXJ0eS5rZXkubmFtZSkpIHtcbiAgICAgICAgICAgICAgY29udGV4dC5yZXBvcnQoe1xuICAgICAgICAgICAgICAgIG5vZGU6IHByb3BlcnR5LFxuICAgICAgICAgICAgICAgIG1lc3NhZ2U6IG1ha2VNZXNzYWdlKHByb3BlcnR5LmtleSwgcGF0aCksXG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgIGNvbnRpbnVlXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHBhdGgucHVzaChwcm9wZXJ0eS5rZXkubmFtZSlcbiAgICAgICAgICAgIGNvbnN0IGRlcGVuZGVuY3lFeHBvcnRNYXAgPSBuYW1lc3BhY2UuZ2V0KHByb3BlcnR5LmtleS5uYW1lKVxuICAgICAgICAgICAgLy8gY291bGQgYmUgbnVsbCB3aGVuIGlnbm9yZWQgb3IgYW1iaWd1b3VzXG4gICAgICAgICAgICBpZiAoZGVwZW5kZW5jeUV4cG9ydE1hcCAhPT0gbnVsbCkge1xuICAgICAgICAgICAgICB0ZXN0S2V5KHByb3BlcnR5LnZhbHVlLCBkZXBlbmRlbmN5RXhwb3J0TWFwLm5hbWVzcGFjZSwgcGF0aClcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHBhdGgucG9wKClcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICB0ZXN0S2V5KGlkLCBuYW1lc3BhY2VzLmdldChpbml0Lm5hbWUpKVxuICAgICAgfSxcblxuICAgICAgSlNYTWVtYmVyRXhwcmVzc2lvbih7b2JqZWN0LCBwcm9wZXJ0eX0pIHtcbiAgICAgICAgIGlmICghbmFtZXNwYWNlcy5oYXMob2JqZWN0Lm5hbWUpKSByZXR1cm5cbiAgICAgICAgIHZhciBuYW1lc3BhY2UgPSBuYW1lc3BhY2VzLmdldChvYmplY3QubmFtZSlcbiAgICAgICAgIGlmICghbmFtZXNwYWNlLmhhcyhwcm9wZXJ0eS5uYW1lKSkge1xuICAgICAgICAgICBjb250ZXh0LnJlcG9ydCh7XG4gICAgICAgICAgICAgbm9kZTogcHJvcGVydHksXG4gICAgICAgICAgICAgbWVzc2FnZTogbWFrZU1lc3NhZ2UocHJvcGVydHksIFtvYmplY3QubmFtZV0pLFxuICAgICAgICAgICB9KVxuICAgICAgICAgfVxuICAgICAgfSxcbiAgICB9XG4gIH0sXG59XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/newline-after-import.js b/node_modules/eslint-plugin-import/lib/rules/newline-after-import.js new file mode 100644 index 000000000..d047a91e5 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/newline-after-import.js @@ -0,0 +1,179 @@ +'use strict'; + + + + +var _staticRequire = require('../core/staticRequire');var _staticRequire2 = _interopRequireDefault(_staticRequire); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl); + +var _debug = require('debug');var _debug2 = _interopRequireDefault(_debug);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} +const log = (0, _debug2.default)('eslint-plugin-import:rules:newline-after-import'); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ +/** + * @fileoverview Rule to enforce new line after import not followed by another import. + * @author Radek Benkel + */function containsNodeOrEqual(outerNode, innerNode) {return outerNode.range[0] <= innerNode.range[0] && outerNode.range[1] >= innerNode.range[1];} + +function getScopeBody(scope) { + if (scope.block.type === 'SwitchStatement') { + log('SwitchStatement scopes not supported'); + return null; + }const + + body = scope.block.body; + if (body && body.type === 'BlockStatement') { + return body.body; + } + + return body; +} + +function findNodeIndexInScopeBody(body, nodeToFind) { + return body.findIndex(node => containsNodeOrEqual(node, nodeToFind)); +} + +function getLineDifference(node, nextNode) { + return nextNode.loc.start.line - node.loc.end.line; +} + +function isClassWithDecorator(node) { + return node.type === 'ClassDeclaration' && node.decorators && node.decorators.length; +} + +function isExportDefaultClass(node) { + return node.type === 'ExportDefaultDeclaration' && node.declaration.type === 'ClassDeclaration'; +} + +module.exports = { + meta: { + type: 'layout', + docs: { + url: (0, _docsUrl2.default)('newline-after-import') }, + + fixable: 'whitespace', + schema: [ + { + 'type': 'object', + 'properties': { + 'count': { + 'type': 'integer', + 'minimum': 1 } }, + + + 'additionalProperties': false }] }, + + + + create: function (context) { + let level = 0; + const requireCalls = []; + + function checkForNewLine(node, nextNode, type) { + if (isExportDefaultClass(nextNode)) { + let classNode = nextNode.declaration; + + if (isClassWithDecorator(classNode)) { + nextNode = classNode.decorators[0]; + } + } else if (isClassWithDecorator(nextNode)) { + nextNode = nextNode.decorators[0]; + } + + const options = context.options[0] || { count: 1 }; + const lineDifference = getLineDifference(node, nextNode); + const EXPECTED_LINE_DIFFERENCE = options.count + 1; + + if (lineDifference < EXPECTED_LINE_DIFFERENCE) { + let column = node.loc.start.column; + + if (node.loc.start.line !== node.loc.end.line) { + column = 0; + } + + context.report({ + loc: { + line: node.loc.end.line, + column }, + + message: `Expected ${options.count} empty line${options.count > 1 ? 's' : ''} \ +after ${type} statement not followed by another ${type}.`, + fix: fixer => fixer.insertTextAfter( + node, + '\n'.repeat(EXPECTED_LINE_DIFFERENCE - lineDifference)) }); + + + } + } + + function incrementLevel() { + level++; + } + function decrementLevel() { + level--; + } + + function checkImport(node) {const + parent = node.parent; + const nodePosition = parent.body.indexOf(node); + const nextNode = parent.body[nodePosition + 1]; + + // skip "export import"s + if (node.type === 'TSImportEqualsDeclaration' && node.isExport) { + return; + } + + if (nextNode && nextNode.type !== 'ImportDeclaration' && (nextNode.type !== 'TSImportEqualsDeclaration' || nextNode.isExport)) { + checkForNewLine(node, nextNode, 'import'); + } + } + + return { + ImportDeclaration: checkImport, + TSImportEqualsDeclaration: checkImport, + CallExpression: function (node) { + if ((0, _staticRequire2.default)(node) && level === 0) { + requireCalls.push(node); + } + }, + 'Program:exit': function () { + log('exit processing for', context.getFilename()); + const scopeBody = getScopeBody(context.getScope()); + log('got scope:', scopeBody); + + requireCalls.forEach(function (node, index) { + const nodePosition = findNodeIndexInScopeBody(scopeBody, node); + log('node position in scope:', nodePosition); + + const statementWithRequireCall = scopeBody[nodePosition]; + const nextStatement = scopeBody[nodePosition + 1]; + const nextRequireCall = requireCalls[index + 1]; + + if (nextRequireCall && containsNodeOrEqual(statementWithRequireCall, nextRequireCall)) { + return; + } + + if (nextStatement && ( + !nextRequireCall || !containsNodeOrEqual(nextStatement, nextRequireCall))) { + + checkForNewLine(statementWithRequireCall, nextStatement, 'require'); + } + }); + }, + FunctionDeclaration: incrementLevel, + FunctionExpression: incrementLevel, + ArrowFunctionExpression: incrementLevel, + BlockStatement: incrementLevel, + ObjectExpression: incrementLevel, + Decorator: incrementLevel, + 'FunctionDeclaration:exit': decrementLevel, + 'FunctionExpression:exit': decrementLevel, + 'ArrowFunctionExpression:exit': decrementLevel, + 'BlockStatement:exit': decrementLevel, + 'ObjectExpression:exit': decrementLevel, + 'Decorator:exit': decrementLevel }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uZXdsaW5lLWFmdGVyLWltcG9ydC5qcyJdLCJuYW1lcyI6WyJsb2ciLCJjb250YWluc05vZGVPckVxdWFsIiwib3V0ZXJOb2RlIiwiaW5uZXJOb2RlIiwicmFuZ2UiLCJnZXRTY29wZUJvZHkiLCJzY29wZSIsImJsb2NrIiwidHlwZSIsImJvZHkiLCJmaW5kTm9kZUluZGV4SW5TY29wZUJvZHkiLCJub2RlVG9GaW5kIiwiZmluZEluZGV4Iiwibm9kZSIsImdldExpbmVEaWZmZXJlbmNlIiwibmV4dE5vZGUiLCJsb2MiLCJzdGFydCIsImxpbmUiLCJlbmQiLCJpc0NsYXNzV2l0aERlY29yYXRvciIsImRlY29yYXRvcnMiLCJsZW5ndGgiLCJpc0V4cG9ydERlZmF1bHRDbGFzcyIsImRlY2xhcmF0aW9uIiwibW9kdWxlIiwiZXhwb3J0cyIsIm1ldGEiLCJkb2NzIiwidXJsIiwiZml4YWJsZSIsInNjaGVtYSIsImNyZWF0ZSIsImNvbnRleHQiLCJsZXZlbCIsInJlcXVpcmVDYWxscyIsImNoZWNrRm9yTmV3TGluZSIsImNsYXNzTm9kZSIsIm9wdGlvbnMiLCJjb3VudCIsImxpbmVEaW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ICAgICBBcnJvd0Z1bmN0aW9uRXhwcmVzc2lvbjogaW5jcmVtZW50TGV2ZWwsXG4gICAgICBCbG9ja1N0YXRlbWVudDogaW5jcmVtZW50TGV2ZWwsXG4gICAgICBPYmplY3RFeHByZXNzaW9uOiBpbmNyZW1lbnRMZXZlbCxcbiAgICAgIERlY29yYXRvcjogaW5jcmVtZW50TGV2ZWwsXG4gICAgICAnRnVuY3Rpb25EZWNsYXJhdGlvbjpleGl0JzogZGVjcmVtZW50TGV2ZWwsXG4gICAgICAnRnVuY3Rpb25FeHByZXNzaW9uOmV4aXQnOiBkZWNyZW1lbnRMZXZlbCxcbiAgICAgICdBcnJvd0Z1bmN0aW9uRXhwcmVzc2lvbjpleGl0JzogZGVjcmVtZW50TGV2ZWwsXG4gICAgICAnQmxvY2tTdGF0ZW1lbnQ6ZXhpdCc6IGRlY3JlbWVudExldmVsLFxuICAgICAgJ09iamVjdEV4cHJlc3Npb246ZXhpdCc6IGRlY3JlbWVudExldmVsLFxuICAgICAgJ0RlY29yYXRvcjpleGl0JzogZGVjcmVtZW50TGV2ZWwsXG4gICAgfVxuICB9LFxufVxuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-absolute-path.js b/node_modules/eslint-plugin-import/lib/rules/no-absolute-path.js new file mode 100644 index 000000000..ff1cb22c7 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-absolute-path.js @@ -0,0 +1,24 @@ +'use strict';var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor); +var _importType = require('../core/importType'); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('no-absolute-path') }, + + schema: [(0, _moduleVisitor.makeOptionsSchema)()] }, + + + create: function (context) { + function reportIfAbsolute(source) { + if (typeof source.value === 'string' && (0, _importType.isAbsolute)(source.value)) { + context.report(source, 'Do not import modules using an absolute path'); + } + } + + const options = Object.assign({ esmodule: true, commonjs: true }, context.options[0]); + return (0, _moduleVisitor2.default)(reportIfAbsolute, options); + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1hYnNvbHV0ZS1wYXRoLmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJtZXRhIiwidHlwZSIsImRvY3MiLCJ1cmwiLCJzY2hlbWEiLCJjcmVhdGUiLCJjb250ZXh0IiwicmVwb3J0SWZBYnNvbHV0ZSIsInNvdXJjZSIsInZhbHVlIiwicmVwb3J0Iiwib3B0aW9ucyIsIk9iamVjdCIsImFzc2lnbiIsImVzbW9kdWxlIiwiY29tbW9uanMiXSwibWFwcGluZ3MiOiJhQUFBLGtFO0FBQ0E7QUFDQSxxQzs7QUFFQUEsT0FBT0MsT0FBUCxHQUFpQjtBQUNmQyxRQUFNO0FBQ0pDLFVBQU0sWUFERjtBQUVKQyxVQUFNO0FBQ0pDLFdBQUssdUJBQVEsa0JBQVIsQ0FERCxFQUZGOztBQUtKQyxZQUFRLENBQUUsdUNBQUYsQ0FMSixFQURTOzs7QUFTZkMsVUFBUSxVQUFVQyxPQUFWLEVBQW1CO0FBQ3pCLGFBQVNDLGdCQUFULENBQTBCQyxNQUExQixFQUFrQztBQUNoQyxVQUFJLE9BQU9BLE9BQU9DLEtBQWQsS0FBd0IsUUFBeEIsSUFBb0MsNEJBQVdELE9BQU9DLEtBQWxCLENBQXhDLEVBQWtFO0FBQ2hFSCxnQkFBUUksTUFBUixDQUFlRixNQUFmLEVBQXVCLDhDQUF2QjtBQUNEO0FBQ0Y7O0FBRUQsVUFBTUcsVUFBVUMsT0FBT0MsTUFBUCxDQUFjLEVBQUVDLFVBQVUsSUFBWixFQUFrQkMsVUFBVSxJQU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udGV4dC5vcHRpb25zWzBdKVxuICAgIHJldHVybiBtb2R1bGVWaXNpdG9yKHJlcG9ydElmQWJzb2x1dGUsIG9wdGlvbnMpXG4gIH0sXG59XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-amd.js b/node_modules/eslint-plugin-import/lib/rules/no-amd.js new file mode 100644 index 000000000..4eca3f461 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-amd.js @@ -0,0 +1,46 @@ +'use strict'; + + + + +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('no-amd') }, + + schema: [] }, + + + create: function (context) { + return { + 'CallExpression': function (node) { + if (context.getScope().type !== 'module') return; + + if (node.callee.type !== 'Identifier') return; + if (node.callee.name !== 'require' && + node.callee.name !== 'define') return; + + // todo: capture define((require, module, exports) => {}) form? + if (node.arguments.length !== 2) return; + + const modules = node.arguments[0]; + if (modules.type !== 'ArrayExpression') return; + + // todo: check second arg type? (identifier or callback) + + context.report(node, `Expected imports instead of AMD ${node.callee.name}().`); + } }; + + + } }; /** + * @fileoverview Rule to prefer imports to AMD + * @author Jamund Ferguson + */ +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1hbWQuanMiXSwibmFtZXMiOlsibW9kdWxlIiwiZXhwb3J0cyIsIm1ldGEiLCJ0eXBlIiwiZG9jcyIsInVybCIsInNjaGVtYSIsImNyZWF0ZSIsImNvbnRleHQiLCJub2RlIiwiZ2V0U2NvcGUiLCJjYWxsZWUiLCJuYW1lIiwiYXJndW1lbnRzIiwibGVuZ3RoIiwibW9kdWxlcyIsInJlcG9ydCJdLC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IGNvbnN0IG1vZHVsZXMgPSBub2RlLmFyZ3VtZW50c1swXVxuICAgICAgICBpZiAobW9kdWxlcy50eXBlICE9PSAnQXJyYXlFeHByZXNzaW9uJykgcmV0dXJuXG5cbiAgICAgICAgLy8gdG9kbzogY2hlY2sgc2Vjb25kIGFyZyB0eXBlPyAoaWRlbnRpZmllciBvciBjYWxsYmFjaylcblxuICAgICAgICBjb250ZXh0LnJlcG9ydChub2RlLCBgRXhwZWN0ZWQgaW1wb3J0cyBpbnN0ZWFkIG9mIEFNRCAke25vZGUuY2FsbGVlLm5hbWV9KCkuYClcbiAgICAgIH0sXG4gICAgfVxuXG4gIH0sXG59XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-anonymous-default-export.js b/node_modules/eslint-plugin-import/lib/rules/no-anonymous-default-export.js new file mode 100644 index 000000000..0c2b7dac2 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-anonymous-default-export.js @@ -0,0 +1,104 @@ +'use strict'; + + + + +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl); +var _has = require('has');var _has2 = _interopRequireDefault(_has);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} /** + * @fileoverview Rule to disallow anonymous default exports. + * @author Duncan Beevers + */const defs = { ArrayExpression: { + option: 'allowArray', + description: 'If `false`, will report default export of an array', + message: 'Assign array to a variable before exporting as module default' }, + + ArrowFunctionExpression: { + option: 'allowArrowFunction', + description: 'If `false`, will report default export of an arrow function', + message: 'Assign arrow function to a variable before exporting as module default' }, + + CallExpression: { + option: 'allowCallExpression', + description: 'If `false`, will report default export of a function call', + message: 'Assign call result to a variable before exporting as module default', + default: true }, + + ClassDeclaration: { + option: 'allowAnonymousClass', + description: 'If `false`, will report default export of an anonymous class', + message: 'Unexpected default export of anonymous class', + forbid: node => !node.declaration.id }, + + FunctionDeclaration: { + option: 'allowAnonymousFunction', + description: 'If `false`, will report default export of an anonymous function', + message: 'Unexpected default export of anonymous function', + forbid: node => !node.declaration.id }, + + Literal: { + option: 'allowLiteral', + description: 'If `false`, will report default export of a literal', + message: 'Assign literal to a variable before exporting as module default' }, + + ObjectExpression: { + option: 'allowObject', + description: 'If `false`, will report default export of an object expression', + message: 'Assign object to a variable before exporting as module default' }, + + TemplateLiteral: { + option: 'allowLiteral', + description: 'If `false`, will report default export of a literal', + message: 'Assign literal to a variable before exporting as module default' } }; + + + +const schemaProperties = Object.keys(defs). +map(key => defs[key]). +reduce((acc, def) => { + acc[def.option] = { + description: def.description, + type: 'boolean' }; + + + return acc; +}, {}); + +const defaults = Object.keys(defs). +map(key => defs[key]). +reduce((acc, def) => { + acc[def.option] = (0, _has2.default)(def, 'default') ? def.default : false; + return acc; +}, {}); + +module.exports = { + meta: { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('no-anonymous-default-export') }, + + + schema: [ + { + type: 'object', + properties: schemaProperties, + 'additionalProperties': false }] }, + + + + + create: function (context) { + const options = Object.assign({}, defaults, context.options[0]); + + return { + 'ExportDefaultDeclaration': node => { + const def = defs[node.declaration.type]; + + // Recognized node type and allowed by configuration, + // and has no forbid check, or forbid check return value is truthy + if (def && !options[def.option] && (!def.forbid || def.forbid(node))) { + context.report({ node, message: def.message }); + } + } }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1hbm9ueW1vdXMtZGVmYXVsdC1leHBvcnQuanMiXSwibmFtZXMiOlsiZGVmcyIsIkFycmF5RXhwcmVzc2lvbiIsIm9wdGlvbiIsImRlc2NyaXB0aW9uIiwibWVzc2FnZSIsIkFycm93RnVuY3Rpb25FeHByZXNzaW9uIiwiQ2FsbEV4cHJlc3Npb24iLCJkZWZhdWx0IiwiQ2xhc3NEZWNsYXJhdGlvbiIsImZvcmJpZCIsIm5vZGUiLCJkZWNsYXJhdGlvbiIsImlkIiwiRnVuY3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RvY3NVcmwoJ25vLWFub255bW91cy1kZWZhdWx0LWV4cG9ydCcpLFxuICAgIH0sXG5cbiAgICBzY2hlbWE6IFtcbiAgICAgIHtcbiAgICAgICAgdHlwZTogJ29iamVjdCcsXG4gICAgICAgIHByb3BlcnRpZXM6IHNjaGVtYVByb3BlcnRpZXMsXG4gICAgICAgICdhZGRpdGlvbmFsUHJvcGVydGllcyc6IGZhbHNlLFxuICAgICAgfSxcbiAgICBdLFxuICB9LFxuXG4gIGNyZWF0ZTogZnVuY3Rpb24gKGNvbnRleHQpIHtcbiAgICBjb25zdCBvcHRpb25zID0gT2JqZWN0LmFzc2lnbih7fSwgZGVmYXVsdHMsIGNvbnRleHQub3B0aW9uc1swXSlcblxuICAgIHJldHVybiB7XG4gICAgICAnRXhwb3J0RGVmYXVsdERlY2xhcmF0aW9uJzogKG5vZGUpID0+IHtcbiAgICAgICAgY29uc3QgZGVmID0gZGVmc1tub2RlLmRlY2xhcmF0aW9uLnR5cGVdXG5cbiAgICAgICAgLy8gUmVjb2duaXplZCBub2RlIHR5cGUgYW5kIGFsbG93ZWQgYnkgY29uZmlndXJhdGlvbixcbiAgICAgICAgLy8gICBhbmQgaGFzIG5vIGZvcmJpZCBjaGVjaywgb3IgZm9yYmlkIGNoZWNrIHJldHVybiB2YWx1ZSBpcyB0cnV0aHlcbiAgICAgICAgaWYgKGRlZiAmJiAhb3B0aW9uc1tkZWYub3B0aW9uXSAmJiAoIWRlZi5mb3JiaWQgfHwgZGVmLmZvcmJpZChub2RlKSkpIHtcbiAgICAgICAgICBjb250ZXh0LnJlcG9ydCh7IG5vZGUsIG1lc3NhZ2U6IGRlZi5tZXNzYWdlIH0pXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgfVxuICB9LFxufVxuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-commonjs.js b/node_modules/eslint-plugin-import/lib/rules/no-commonjs.js new file mode 100644 index 000000000..5fb56084e --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-commonjs.js @@ -0,0 +1,135 @@ +'use strict'; + + + + +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +const EXPORT_MESSAGE = 'Expected "export" or "export default"', +IMPORT_MESSAGE = 'Expected "import" instead of "require()"'; /** + * @fileoverview Rule to prefer ES6 to CJS + * @author Jamund Ferguson + */function normalizeLegacyOptions(options) {if (options.indexOf('allow-primitive-modules') >= 0) { + return { allowPrimitiveModules: true }; + } + return options[0] || {}; +} + +function allowPrimitive(node, options) { + if (!options.allowPrimitiveModules) return false; + if (node.parent.type !== 'AssignmentExpression') return false; + return node.parent.right.type !== 'ObjectExpression'; +} + +function allowRequire(node, options) { + return options.allowRequire; +} + +function allowConditionalRequire(node, options) { + return options.allowConditionalRequire !== false; +} + +function validateScope(scope) { + return scope.variableScope.type === 'module'; +} + +// https://github.com/estree/estree/blob/master/es5.md +function isConditional(node) { + if ( + node.type === 'IfStatement' || + node.type === 'TryStatement' || + node.type === 'LogicalExpression' || + node.type === 'ConditionalExpression') + return true; + if (node.parent) return isConditional(node.parent); + return false; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const schemaString = { enum: ['allow-primitive-modules'] }; +const schemaObject = { + type: 'object', + properties: { + allowPrimitiveModules: { 'type': 'boolean' }, + allowRequire: { 'type': 'boolean' }, + allowConditionalRequire: { 'type': 'boolean' } }, + + additionalProperties: false }; + + +module.exports = { + meta: { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('no-commonjs') }, + + + schema: { + anyOf: [ + { + type: 'array', + items: [schemaString], + additionalItems: false }, + + { + type: 'array', + items: [schemaObject], + additionalItems: false }] } }, + + + + + + create: function (context) { + const options = normalizeLegacyOptions(context.options); + + return { + + 'MemberExpression': function (node) { + + // module.exports + if (node.object.name === 'module' && node.property.name === 'exports') { + if (allowPrimitive(node, options)) return; + context.report({ node, message: EXPORT_MESSAGE }); + } + + // exports. + if (node.object.name === 'exports') { + const isInScope = context.getScope(). + variables. + some(variable => variable.name === 'exports'); + if (!isInScope) { + context.report({ node, message: EXPORT_MESSAGE }); + } + } + + }, + 'CallExpression': function (call) { + if (!validateScope(context.getScope())) return; + + if (call.callee.type !== 'Identifier') return; + if (call.callee.name !== 'require') return; + + if (call.arguments.length !== 1) return; + var module = call.arguments[0]; + + if (module.type !== 'Literal') return; + if (typeof module.value !== 'string') return; + + if (allowRequire(call, options)) return; + + if (allowConditionalRequire(call, options) && isConditional(call.parent)) return; + + // keeping it simple: all 1-string-arg `require` calls are reported + context.report({ + node: call.callee, + message: IMPORT_MESSAGE }); + + } }; + + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1jb21tb25qcy5qcyJdLCJuYW1lcyI6WyJFWFBPUlRfTUVTU0FHRSIsIklNUE9SVF9NRVNTQUdFIiwibm9ybWFsaXplTGVnYWN5T3B0aW9ucyIsIm9wdGlvbnMiLCJpbmRleE9mIiwiYWxsb3dQcmltaXRpdmVNb2R1bGVzIiwiYWxsb3dQcmltaXRpdmUiLCJub2RlIiwicGFyZW50IiwidHlwZSIsInJpZ2h0IiwiYWxsb3dSZXF1aXJlIiwiYWxsb3dDb25kaXRpb25hbFJlcXVpcmUiLCJ2YWxpZGF0ZVNjb3BlIiwic2NvcGUiLCJ2YXJpYWJsZVNjb3BlIiwiaXNDb25kaXRpb25hbCIsInNjaGVtYVN0cmluZyIsImVudW0iLCJzY2hlbWFPYmplY3QiLCJwcm9wZXJ0aWVzIiwiYWRkaXRpb25hbFByb3BlcnRpZXMiLCJtb2R1bGUiLCJleHBvcnRzIiwibWV0YSIsImRvY3MiLCJ1cmwiLCJzY2hlbWEiLCJhbnlPZiIsIml0ZW1zIiwiYWRkaXRpb25hbEl0ZW1zIiwiY3JlYXRlIiwiY29udGV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dGlvbicsXG4gICAgZG9jczoge1xuICAgICAgdXJsOiBkb2NzVXJsKCduby1jb21tb25qcycpLFxuICAgIH0sXG5cbiAgICBzY2hlbWE6IHtcbiAgICAgIGFueU9mOiBbXG4gICAgICAgIHtcbiAgICAgICAgICB0eXBlOiAnYXJyYXknLFxuICAgICAgICAgIGl0ZW1zOiBbc2NoZW1hU3RyaW5nXSxcbiAgICAgICAgICBhZGRpdGlvbmFsSXRlbXM6IGZhbHNlLFxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgdHlwZTogJ2FycmF5JyxcbiAgICAgICAgICBpdGVtczogW3NjaGVtYU9iamVjdF0sXG4gICAgICAgICAgYWRkaXRpb25hbEl0ZW1zOiBmYWxzZSxcbiAgICAgICAgfSxcbiAgICAgIF0sXG4gICAgfSxcbiAgfSxcblxuICBjcmVhdGU6IGZ1bmN0aW9uIChjb250ZXh0KSB7XG4gICAgY29uc3Qgb3B0aW9ucyA9IG5vcm1hbGl6ZUxlZ2FjeU9wdGlvbnMoY29udGV4dC5vcHRpb25zKVxuXG4gICAgcmV0dXJuIHtcblxuICAgICAgJ01lbWJlckV4cHJlc3Npb24nOiBmdW5jdGlvbiAobm9kZSkge1xuXG4gICAgICAgIC8vIG1vZHVsZS5leHBvcnRzXG4gICAgICAgIGlmIChub2RlLm9iamVjdC5uYW1lID09PSAnbW9kdWxlJyAmJiBub2RlLnByb3BlcnR5Lm5hbWUgPT09ICdleHBvcnRzJykge1xuICAgICAgICAgIGlmIChhbGxvd1ByaW1pdGl2ZShub2RlLCBvcHRpb25zKSkgcmV0dXJuXG4gICAgICAgICAgY29udGV4dC5yZXBvcnQoeyBub2RlLCBtZXNzYWdlOiBFWFBPUlRfTUVTU0FHRSB9KVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gZXhwb3J0cy5cbiAgICAgICAgaWYgKG5vZGUub2JqZWN0Lm5hbWUgPT09ICdleHBvcnRzJykge1xuICAgICAgICAgIGNvbnN0IGlzSW5TY29w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VpcmVgIGNhbGxzIGFyZSByZXBvcnRlZFxuICAgICAgICBjb250ZXh0LnJlcG9ydCh7XG4gICAgICAgICAgbm9kZTogY2FsbC5jYWxsZWUsXG4gICAgICAgICAgbWVzc2FnZTogSU1QT1JUX01FU1NBR0UsXG4gICAgICAgIH0pXG4gICAgICB9LFxuICAgIH1cblxuICB9LFxufVxuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-cycle.js b/node_modules/eslint-plugin-import/lib/rules/no-cycle.js new file mode 100644 index 000000000..84d052520 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-cycle.js @@ -0,0 +1,105 @@ +'use strict';var _slicedToArray = function () {function sliceIterator(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"]) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}return function (arr, i) {if (Array.isArray(arr)) {return arr;} else if (Symbol.iterator in Object(arr)) {return sliceIterator(arr, i);} else {throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}(); /** + * @fileOverview Ensures that no imported module imports the linted module. + * @author Ben Mosher + */ + +var _ExportMap = require('../ExportMap');var _ExportMap2 = _interopRequireDefault(_ExportMap); +var _importType = require('../core/importType'); +var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +// todo: cache cycles / deep relationships for faster repeat evaluation +module.exports = { + meta: { + type: 'suggestion', + docs: { url: (0, _docsUrl2.default)('no-cycle') }, + schema: [(0, _moduleVisitor.makeOptionsSchema)({ + maxDepth: { + oneOf: [ + { + description: 'maximum dependency depth to traverse', + type: 'integer', + minimum: 1 }, + + { + enum: ['∞'], + type: 'string' }] }, + + + + ignoreExternal: { + description: 'ignore external modules', + type: 'boolean', + default: false } })] }, + + + + + create: function (context) { + const myPath = context.getFilename(); + if (myPath === '') return {}; // can't cycle-check a non-file + + const options = context.options[0] || {}; + const maxDepth = typeof options.maxDepth === 'number' ? options.maxDepth : Infinity; + const ignoreModule = name => options.ignoreExternal ? (0, _importType.isExternalModule)(name) : false; + + function checkSourceValue(sourceNode, importer) { + if (ignoreModule(sourceNode.value)) { + return; // ignore external modules + } + + const imported = _ExportMap2.default.get(sourceNode.value, context); + + if (importer.importKind === 'type') { + return; // no Flow import resolution + } + + if (imported == null) { + return; // no-unresolved territory + } + + if (imported.path === myPath) { + return; // no-self-import territory + } + + const untraversed = [{ mget: () => imported, route: [] }]; + const traversed = new Set(); + function detectCycle(_ref) {let mget = _ref.mget,route = _ref.route; + const m = mget(); + if (m == null) return; + if (traversed.has(m.path)) return; + traversed.add(m.path); + + for (let _ref2 of m.imports) {var _ref3 = _slicedToArray(_ref2, 2);let path = _ref3[0];var _ref3$ = _ref3[1];let getter = _ref3$.getter;let source = _ref3$.source; + if (path === myPath) return true; + if (traversed.has(path)) continue; + if (ignoreModule(source.value)) continue; + if (route.length + 1 < maxDepth) { + untraversed.push({ + mget: getter, + route: route.concat(source) }); + + } + } + } + + while (untraversed.length > 0) { + const next = untraversed.shift(); // bfs! + if (detectCycle(next)) { + const message = next.route.length > 0 ? + `Dependency cycle via ${routeString(next.route)}` : + 'Dependency cycle detected.'; + context.report(importer, message); + return; + } + } + } + + return (0, _moduleVisitor2.default)(checkSourceValue, context.options[0]); + } }; + + +function routeString(route) { + return route.map(s => `${s.value}:${s.loc.start.line}`).join('=>'); +} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1jeWNsZS5qcyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBv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pfWBcbiAgICAgICAgICAgIDogJ0RlcGVuZGVuY3kgY3ljbGUgZGV0ZWN0ZWQuJylcbiAgICAgICAgICBjb250ZXh0LnJlcG9ydChpbXBvcnRlciwgbWVzc2FnZSlcbiAgICAgICAgICByZXR1cm5cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBtb2R1bGVWaXNpdG9yKGNoZWNrU291cmNlVmFsdWUsIGNvbnRleHQub3B0aW9uc1swXSlcbiAgfSxcbn1cblxuZnVuY3Rpb24gcm91dGVTdHJpbmcocm91dGUpIHtcbiAgcmV0dXJuIHJvdXRlLm1hcChzID0+IGAke3MudmFsdWV9OiR7cy5sb2Muc3RhcnQubGluZX1gKS5qb2luKCc9PicpXG59XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-default-export.js b/node_modules/eslint-plugin-import/lib/rules/no-default-export.js new file mode 100644 index 000000000..9434bcd1c --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-default-export.js @@ -0,0 +1,41 @@ +'use strict';var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('no-default-export') }, + + schema: [] }, + + + create(context) { + // ignore non-modules + if (context.parserOptions.sourceType !== 'module') { + return {}; + } + + const preferNamed = 'Prefer named exports.'; + const noAliasDefault = (_ref) => {let local = _ref.local;return ( + `Do not alias \`${local.name}\` as \`default\`. Just export ` + + `\`${local.name}\` itself instead.`);}; + + return { + ExportDefaultDeclaration(node) { + context.report({ node, message: preferNamed }); + }, + + ExportNamedDeclaration(node) { + node.specifiers.forEach(specifier => { + if (specifier.type === 'ExportDefaultSpecifier' && + specifier.exported.name === 'default') { + context.report({ node, message: preferNamed }); + } else if (specifier.type === 'ExportSpecifier' && + specifier.exported.name === 'default') { + context.report({ node, message: noAliasD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GVjaWZpZXIpfSlcbiAgICAgICAgICB9XG4gICAgICAgIH0pXG4gICAgICB9LFxuICAgIH1cbiAgfSxcbn1cbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-deprecated.js b/node_modules/eslint-plugin-import/lib/rules/no-deprecated.js new file mode 100644 index 000000000..f641eadd8 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-deprecated.js @@ -0,0 +1,143 @@ +'use strict';var _declaredScope = require('eslint-module-utils/declaredScope');var _declaredScope2 = _interopRequireDefault(_declaredScope); +var _ExportMap = require('../ExportMap');var _ExportMap2 = _interopRequireDefault(_ExportMap); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +function message(deprecation) { + return 'Deprecated' + (deprecation.description ? ': ' + deprecation.description : '.'); +} + +function getDeprecation(metadata) { + if (!metadata || !metadata.doc) return; + + let deprecation; + if (metadata.doc.tags.some(t => t.title === 'deprecated' && (deprecation = t))) { + return deprecation; + } +} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('no-deprecated') }, + + schema: [] }, + + + create: function (context) { + const deprecated = new Map(), + namespaces = new Map(); + + function checkSpecifiers(node) { + if (node.type !== 'ImportDeclaration') return; + if (node.source == null) return; // local export, ignore + + const imports = _ExportMap2.default.get(node.source.value, context); + if (imports == null) return; + + let moduleDeprecation; + if (imports.doc && + imports.doc.tags.some(t => t.title === 'deprecated' && (moduleDeprecation = t))) { + context.report({ node, message: message(moduleDeprecation) }); + } + + if (imports.errors.length) { + imports.reportErrors(context, node); + return; + } + + node.specifiers.forEach(function (im) { + let imported, local; + switch (im.type) { + + + case 'ImportNamespaceSpecifier':{ + if (!imports.size) return; + namespaces.set(im.local.name, imports); + return; + } + + case 'ImportDefaultSpecifier': + imported = 'default'; + local = im.local.name; + break; + + case 'ImportSpecifier': + imported = im.imported.name; + local = im.local.name; + break; + + default:return; // can't handle this one + } + + // unknown thing can't be deprecated + const exported = imports.get(imported); + if (exported == null) return; + + // capture import of deep namespace + if (exported.namespace) namespaces.set(local, exported.namespace); + + const deprecation = getDeprecation(imports.get(imported)); + if (!deprecation) return; + + context.report({ node: im, message: message(deprecation) }); + + deprecated.set(local, deprecation); + + }); + } + + return { + 'Program': (_ref) => {let body = _ref.body;return body.forEach(checkSpecifiers);}, + + 'Identifier': function (node) { + if (node.parent.type === 'MemberExpression' && node.parent.property === node) { + return; // handled by MemberExpression + } + + // ignore specifier identifiers + if (node.parent.type.slice(0, 6) === 'Import') return; + + if (!deprecated.has(node.name)) return; + + if ((0, _declaredScope2.default)(context, node.name) !== 'module') return; + context.report({ + node, + message: message(deprecated.get(node.name)) }); + + }, + + 'MemberExpression': function (dereference) { + if (dereference.object.type !== 'Identifier') return; + if (!namespaces.has(dereference.object.name)) return; + + if ((0, _declaredScope2.default)(context, dereference.object.name) !== 'module') return; + + // go deep + var namespace = namespaces.get(dereference.object.name); + var namepath = [dereference.object.name]; + // while property is namespace and parent is member expression, keep validating + while (namespace instanceof _ExportMap2.default && + dereference.type === 'MemberExpression') { + + // ignore computed parts for now + if (dereference.computed) return; + + const metadata = namespace.get(dereference.property.name); + + if (!metadata) break; + const deprecation = getDeprecation(metadata); + + if (deprecation) { + context.report({ node: dereference.property, message: message(deprecation) }); + } + + // stash and pop + namepath.push(dereference.property.name); + namespace = metadata.namespace; + dereference = dereference.parent; + } + } }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1kZXByZWNhdGVkLmpzIl0sIm5hbWVzIjpbIm1lc3NhZ2UiLCJkZXByZWNhdGlvbiIsImRlc2NyaXB0aW9uIiwiZ2V0RGVwcmVjYXRpb24iLCJtZXRhZGF0YSIsImRvYyIsInRhZ3MiLCJzb21lIiwidCIsInRpdGxlIiwibW9kdWxlI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AgICBjb25zdCBpbXBvcnRzID0gRXhwb3J0cy5nZXQobm9kZS5zb3VyY2UudmFsdWUsIGNvbnRleHQpXG4gICAgICBpZiAoaW1wb3J0cyA9PSBudWxsKSByZXR1cm5cblxuICAgICAgbGV0IG1vZHVsZURlcHJlY2F0aW9uXG4gICAgICBpZiAoaW1wb3J0cy5kb2MgJiZcbiAgICAgICAgICBpbXBvcnRzLmRvYy50YWdzLnNvbWUodCA9PiB0LnRpdGxlID09PSAnZGVwcmVjYXRlZCcgJiYgKG1vZHVsZURlcHJlY2F0aW9uID0gdCkpKSB7XG4gICAgICAgIGNvbnRleHQucmVwb3J0KHsgbm9kZSwgbWVzc2FnZTogbWVzc2FnZShtb2R1bGVEZXByZWNhdGlvbikgfSlcbiAgICAgIH1cblxuICAgICAgaWYgKGltcG9ydHMuZXJyb3JzLmxlbmd0aCkge1xuICAgICAgICBpbXBvcnRzLnJlcG9ydEVycm9ycyhjb250ZXh0LCBub2RlKVxuICAgICAgICByZXR1cm5cbiAgICAgIH1cblxuICAgICAgbm9kZS5zcGVjaWZpZXJzLmZvckVhY2goZnVuY3Rpb24gKGltKSB7XG4gICAgICAgIGxldCBpbXBvcnRlZCwgbG9jYWxcbiAgICAgICAgc3dpdGNoIChpbS50eXBlKSB7XG5cblxuICAgICAgICAgIGNhc2UgJ0ltcG9ydE5hbWVzcGFjZVNwZWNpZmllcic6e1xuICAgICAgICAgICAgaWYgKCFpbXBvcnRzLnNpemUpIHJldHVyblxuICAgICAgICAgICAgbmFtZXNwYWNlcy5zZXQoaW0ubG9jYWwubmFtZSwgaW1wb3J0cylcbiAgICAgICAgICAgIHJldHVyblxuICAgICAgICAgIH1cblxuICAgICAgICAgIGNhc2UgJ0ltcG9ydERlZmF1bHRTcGVjaWZpZXInOlxuICAgICAgICAgICAgaW1wb3J0ZWQgPSAnZGVmYXVsdCdcbiAgICAgICAgICAgIGxvY2FsID0gaW0ubG9jYWwubmFtZVxuICAgICAgICAgICAgYnJlYWtcblxuIC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cGF0aCA9IFtkZXJlZmVyZW5jZS5vYmplY3QubmFtZV1cbiAgICAgICAgLy8gd2hpbGUgcHJvcGVydHkgaXMgbmFtZXNwYWNlIGFuZCBwYXJlbnQgaXMgbWVtYmVyIGV4cHJlc3Npb24sIGtlZXAgdmFsaWRhdGluZ1xuICAgICAgICB3aGlsZSAobmFtZXNwYWNlIGluc3RhbmNlb2YgRXhwb3J0cyAmJlxuICAgICAgICAgICAgICAgZGVyZWZlcmVuY2UudHlwZSA9PT0gJ01lbWJlckV4cHJlc3Npb24nKSB7XG5cbiAgICAgICAgICAvLyBpZ25vcmUgY29tcHV0ZWQgcGFydHMgZm9yIG5vd1xuICAgICAgICAgIGlmIChkZXJlZmVyZW5jZS5jb21wdXRlZCkgcmV0dXJuXG5cbiAgICAgICAgICBjb25zdCBtZXRhZGF0YSA9IG5hbWVzcGFjZS5nZXQoZGVyZWZlcmVuY2UucHJvcGVydHkubmFtZSlcblxuICAgICAgICAgIGlmICghbWV0YWRhdGEpIGJyZWFrXG4gICAgICAgICAgY29uc3QgZGVwcmVjYXRpb24gPSBnZXREZXByZWNhdGlvbihtZXRhZGF0YSlcblxuICAgICAgICAgIGlmIChkZXByZWNhdGlvbikge1xuICAgICAgICAgICAgY29udGV4dC5yZXBvcnQoeyBub2RlOiBkZXJlZmVyZW5jZS5wcm9wZXJ0eSwgbWVzc2FnZTogbWVzc2FnZShkZXByZWNhdGlvbikgfSlcbiAgICAgICAgICB9XG5cbiAgICAgICAgICAvLyBzdGFzaCBhbmQgcG9wXG4gICAgICAgICAgbmFtZXBhdGgucHVzaChkZXJlZmVyZW5jZS5wcm9wZXJ0eS5uYW1lKVxuICAgICAgICAgIG5hbWVzcGFjZSA9IG1ldGFkYXRhLm5hbWVzcGFjZVxuICAgICAgICAgIGRlcmVmZXJlbmNlID0gZGVyZWZlcmVuY2UucGFyZW50XG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgfVxuICB9LFxufVxuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-duplicates.js b/node_modules/eslint-plugin-import/lib/rules/no-duplicates.js new file mode 100644 index 000000000..951f3b7fe --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-duplicates.js @@ -0,0 +1,288 @@ +'use strict';var _slicedToArray = function () {function sliceIterator(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"]) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}return function (arr, i) {if (Array.isArray(arr)) {return arr;} else if (Symbol.iterator in Object(arr)) {return sliceIterator(arr, i);} else {throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _toConsumableArray(arr) {if (Array.isArray(arr)) {for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];return arr2;} else {return Array.from(arr);}}function _toArray(arr) {return Array.isArray(arr) ? arr : Array.from(arr);} + +function checkImports(imported, context) { + for (const _ref of imported.entries()) {var _ref2 = _slicedToArray(_ref, 2);const module = _ref2[0];const nodes = _ref2[1]; + if (nodes.length > 1) { + const message = `'${module}' imported multiple times.`;var _nodes = _toArray( + nodes);const first = _nodes[0],rest = _nodes.slice(1); + const sourceCode = context.getSourceCode(); + const fix = getFix(first, rest, sourceCode); + + context.report({ + node: first.source, + message, + fix // Attach the autofix (if any) to the first import. + }); + + for (const node of rest) { + context.report({ + node: node.source, + message }); + + } + } + } +} + +function getFix(first, rest, sourceCode) { + // Sorry ESLint <= 3 users, no autofix for you. Autofixing duplicate imports + // requires multiple `fixer.whatever()` calls in the `fix`: We both need to + // update the first one, and remove the rest. Support for multiple + // `fixer.whatever()` in a single `fix` was added in ESLint 4.1. + // `sourceCode.getCommentsBefore` was added in 4.0, so that's an easy thing to + // check for. + if (typeof sourceCode.getCommentsBefore !== 'function') { + return undefined; + } + + // Adjusting the first import might make it multiline, which could break + // `eslint-disable-next-line` comments and similar, so bail if the first + // import has comments. Also, if the first import is `import * as ns from + // './foo'` there's nothing we can do. + if (hasProblematicComments(first, sourceCode) || hasNamespace(first)) { + return undefined; + } + + const defaultImportNames = new Set( + [first].concat(_toConsumableArray(rest)).map(getDefaultImportName).filter(Boolean)); + + + // Bail if there are multiple different default import names – it's up to the + // user to choose which one to keep. + if (defaultImportNames.size > 1) { + return undefined; + } + + // Leave it to the user to handle comments. Also skip `import * as ns from + // './foo'` imports, since they cannot be merged into another import. + const restWithoutComments = rest.filter(node => !( + hasProblematicComments(node, sourceCode) || + hasNamespace(node))); + + + const specifiers = restWithoutComments. + map(node => { + const tokens = sourceCode.getTokens(node); + const openBrace = tokens.find(token => isPunctuator(token, '{')); + const closeBrace = tokens.find(token => isPunctuator(token, '}')); + + if (openBrace == null || closeBrace == null) { + return undefined; + } + + return { + importNode: node, + text: sourceCode.text.slice(openBrace.range[1], closeBrace.range[0]), + hasTrailingComma: isPunctuator(sourceCode.getTokenBefore(closeBrace), ','), + isEmpty: !hasSpecifiers(node) }; + + }). + filter(Boolean); + + const unnecessaryImports = restWithoutComments.filter(node => + !hasSpecifiers(node) && + !hasNamespace(node) && + !specifiers.some(specifier => specifier.importNode === node)); + + + const shouldAddDefault = getDefaultImportName(first) == null && defaultImportNames.size === 1; + const shouldAddSpecifiers = specifiers.length > 0; + const shouldRemoveUnnecessary = unnecessaryImports.length > 0; + + if (!(shouldAddDefault || shouldAddSpecifiers || shouldRemoveUnnecessary)) { + return undefined; + } + + return fixer => { + const tokens = sourceCode.getTokens(first); + const openBrace = tokens.find(token => isPunctuator(token, '{')); + const closeBrace = tokens.find(token => isPunctuator(token, '}')); + const firstToken = sourceCode.getFirstToken(first);var _defaultImportNames = _slicedToArray( + defaultImportNames, 1);const defaultImportName = _defaultImportNames[0]; + + const firstHasTrailingComma = + closeBrace != null && + isPunctuator(sourceCode.getTokenBefore(closeBrace), ','); + const firstIsEmpty = !hasSpecifiers(first);var _specifiers$reduce = + + specifiers.reduce( + (_ref3, specifier) => {var _ref4 = _slicedToArray(_ref3, 2);let result = _ref4[0],needsComma = _ref4[1]; + return [ + needsComma && !specifier.isEmpty ? + `${result},${specifier.text}` : + `${result}${specifier.text}`, + specifier.isEmpty ? needsComma : true]; + + }, + ['', !firstHasTrailingComma && !firstIsEmpty]),_specifiers$reduce2 = _slicedToArray(_specifiers$reduce, 1);const specifiersText = _specifiers$reduce2[0]; + + + const fixes = []; + + if (shouldAddDefault && openBrace == null && shouldAddSpecifiers) { + // `import './foo'` → `import def, {...} from './foo'` + fixes.push( + fixer.insertTextAfter(firstToken, ` ${defaultImportName}, {${specifiersText}} from`)); + + } else if (shouldAddDefault && openBrace == null && !shouldAddSpecifiers) { + // `import './foo'` → `import def from './foo'` + fixes.push(fixer.insertTextAfter(firstToken, ` ${defaultImportName} from`)); + } else if (shouldAddDefault && openBrace != null && closeBrace != null) { + // `import {...} from './foo'` → `import def, {...} from './foo'` + fixes.push(fixer.insertTextAfter(firstToken, ` ${defaultImportName},`)); + if (shouldAddSpecifiers) { + // `import def, {...} from './foo'` → `import def, {..., ...} from './foo'` + fixes.push(fixer.insertTextBefore(closeBrace, specifiersText)); + } + } else if (!shouldAddDefault && openBrace == null && shouldAddSpecifiers) { + if (first.specifiers.length === 0) { + // `import './foo'` → `import {...} from './foo'` + fixes.push(fixer.insertTextAfter(firstToken, ` {${specifiersText}} from`)); + } else { + // `import def from './foo'` → `import def, {...} from './foo'` + fixes.push(fixer.insertTextAfter(first.specifiers[0], `, {${specifiersText}}`)); + } + } else if (!shouldAddDefault && openBrace != null && closeBrace != null) { + // `import {...} './foo'` → `import {..., ...} from './foo'` + fixes.push(fixer.insertTextBefore(closeBrace, specifiersText)); + } + + // Remove imports whose specifiers have been moved into the first import. + for (const specifier of specifiers) { + fixes.push(fixer.remove(specifier.importNode)); + } + + // Remove imports whose default import has been moved to the first import, + // and side-effect-only imports that are unnecessary due to the first + // import. + for (const node of unnecessaryImports) { + fixes.push(fixer.remove(node)); + } + + return fixes; + }; +} + +function isPunctuator(node, value) { + return node.type === 'Punctuator' && node.value === value; +} + +// Get the name of the default import of `node`, if any. +function getDefaultImportName(node) { + const defaultSpecifier = node.specifiers. + find(specifier => specifier.type === 'ImportDefaultSpecifier'); + return defaultSpecifier != null ? defaultSpecifier.local.name : undefined; +} + +// Checks whether `node` has a namespace import. +function hasNamespace(node) { + const specifiers = node.specifiers. + filter(specifier => specifier.type === 'ImportNamespaceSpecifier'); + return specifiers.length > 0; +} + +// Checks whether `node` has any non-default specifiers. +function hasSpecifiers(node) { + const specifiers = node.specifiers. + filter(specifier => specifier.type === 'ImportSpecifier'); + return specifiers.length > 0; +} + +// It's not obvious what the user wants to do with comments associated with +// duplicate imports, so skip imports with comments when autofixing. +function hasProblematicComments(node, sourceCode) { + return ( + hasCommentBefore(node, sourceCode) || + hasCommentAfter(node, sourceCode) || + hasCommentInsideNonSpecifiers(node, sourceCode)); + +} + +// Checks whether `node` has a comment (that ends) on the previous line or on +// the same line as `node` (starts). +function hasCommentBefore(node, sourceCode) { + return sourceCode.getCommentsBefore(node). + some(comment => comment.loc.end.line >= node.loc.start.line - 1); +} + +// Checks whether `node` has a comment (that starts) on the same line as `node` +// (ends). +function hasCommentAfter(node, sourceCode) { + return sourceCode.getCommentsAfter(node). + some(comment => comment.loc.start.line === node.loc.end.line); +} + +// Checks whether `node` has any comments _inside,_ except inside the `{...}` +// part (if any). +function hasCommentInsideNonSpecifiers(node, sourceCode) { + const tokens = sourceCode.getTokens(node); + const openBraceIndex = tokens.findIndex(token => isPunctuator(token, '{')); + const closeBraceIndex = tokens.findIndex(token => isPunctuator(token, '}')); + // Slice away the first token, since we're no looking for comments _before_ + // `node` (only inside). If there's a `{...}` part, look for comments before + // the `{`, but not before the `}` (hence the `+1`s). + const someTokens = openBraceIndex >= 0 && closeBraceIndex >= 0 ? + tokens.slice(1, openBraceIndex + 1).concat(tokens.slice(closeBraceIndex + 1)) : + tokens.slice(1); + return someTokens.some(token => sourceCode.getCommentsBefore(token).length > 0); +} + +module.exports = { + meta: { + type: 'problem', + docs: { + url: (0, _docsUrl2.default)('no-duplicates') }, + + fixable: 'code', + schema: [ + { + type: 'object', + properties: { + considerQueryString: { + type: 'boolean' } }, + + + additionalProperties: false }] }, + + + + + create: function (context) { + // Prepare the resolver from options. + const considerQueryStringOption = context.options[0] && + context.options[0]['considerQueryString']; + const defaultResolver = sourcePath => (0, _resolve2.default)(sourcePath, context) || sourcePath; + const resolver = considerQueryStringOption ? sourcePath => { + const parts = sourcePath.match(/^([^?]*)\?(.*)$/); + if (!parts) { + return defaultResolver(sourcePath); + } + return defaultResolver(parts[1]) + '?' + parts[2]; + } : defaultResolver; + + const imported = new Map(); + const nsImported = new Map(); + const typesImported = new Map(); + return { + 'ImportDeclaration': function (n) { + // resolved path will cover aliased duplicates + const resolvedPath = resolver(n.source.value); + const importMap = n.importKind === 'type' ? typesImported : + hasNamespace(n) ? nsImported : imported; + + if (importMap.has(resolvedPath)) { + importMap.get(resolvedPath).push(n); + } else { + importMap.set(resolvedPath, [n]); + } + }, + + 'Program:exit': function () { + checkImports(imported, context); + checkImports(nsImported, context); + checkImports(typesImported, context); + } }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1kdXBsaWNhdGVzLmpzIl0sIm5hbWVzIjpbImNoZWNrSW1wb3J0cyIsImltcG9ydGVkIiwiY29udGV4dCIsImVudHJpZXMiLCJtb2R1bGUiLCJub2RlcyIsImxlbmd0aCIsIm1lc3NhZ2UiLCJmaXJzdCIsInJlc3QiLCJzb3VyY2VDb2RlI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bmN0aW9uICgpIHtcbiAgICAgICAgY2hlY2tJbXBvcnRzKGltcG9ydGVkLCBjb250ZXh0KVxuICAgICAgICBjaGVja0ltcG9ydHMobnNJbXBvcnRlZCwgY29udGV4dClcbiAgICAgICAgY2hlY2tJbXBvcnRzKHR5cGVzSW1wb3J0ZWQsIGNvbnRleHQpXG4gICAgICB9LFxuICAgIH1cbiAgfSxcbn1cbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-dynamic-require.js b/node_modules/eslint-plugin-import/lib/rules/no-dynamic-require.js new file mode 100644 index 000000000..e63b3db1a --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-dynamic-require.js @@ -0,0 +1,37 @@ +'use strict';var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +function isRequire(node) { + return node && + node.callee && + node.callee.type === 'Identifier' && + node.callee.name === 'require' && + node.arguments.length >= 1; +} + +function isStaticValue(arg) { + return arg.type === 'Literal' || + arg.type === 'TemplateLiteral' && arg.expressions.length === 0; +} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('no-dynamic-require') }, + + schema: [] }, + + + create: function (context) { + return { + CallExpression(node) { + if (isRequire(node) && !isStaticValue(node.arguments[0])) { + context.report({ + node, + message: 'Calls to require() should use string literals' }); + + } + } }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1keW5hbWljLXJlcXVpcmUuanMiXSwibmFtZXMiOlsiaXNSZXF1aXJlIiwibm9kZSIsImNhbGxlZSIsInR5cGUiLCJuYW1lIiwiYXJndW1lbnRzIiwibGVuZ3RoIiwiaXNTdGF0aWNWYWx1ZSIsImFyZyIsImV4cHJlc3Npb25zIiwibW9kdWxlIiwiZXhwb3J0cyIsIm1ldGE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gICAgIH0pXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgfVxuICB9LFxufVxuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-extraneous-dependencies.js b/node_modules/eslint-plugin-import/lib/rules/no-extraneous-dependencies.js new file mode 100644 index 000000000..b8d891840 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-extraneous-dependencies.js @@ -0,0 +1,207 @@ +'use strict';var _path = require('path');var _path2 = _interopRequireDefault(_path); +var _fs = require('fs');var _fs2 = _interopRequireDefault(_fs); +var _readPkgUp = require('read-pkg-up');var _readPkgUp2 = _interopRequireDefault(_readPkgUp); +var _minimatch = require('minimatch');var _minimatch2 = _interopRequireDefault(_minimatch); +var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve); +var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor); +var _importType = require('../core/importType');var _importType2 = _interopRequireDefault(_importType); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +function hasKeys() {let obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + return Object.keys(obj).length > 0; +} + +function arrayOrKeys(arrayOrObject) { + return Array.isArray(arrayOrObject) ? arrayOrObject : Object.keys(arrayOrObject); +} + +function extractDepFields(pkg) { + return { + dependencies: pkg.dependencies || {}, + devDependencies: pkg.devDependencies || {}, + optionalDependencies: pkg.optionalDependencies || {}, + peerDependencies: pkg.peerDependencies || {}, + // BundledDeps should be in the form of an array, but object notation is also supported by + // `npm`, so we convert it to an array if it is an object + bundledDependencies: arrayOrKeys(pkg.bundleDependencies || pkg.bundledDependencies || []) }; + +} + +function getDependencies(context, packageDir) { + let paths = []; + try { + const packageContent = { + dependencies: {}, + devDependencies: {}, + optionalDependencies: {}, + peerDependencies: {}, + bundledDependencies: [] }; + + + if (packageDir && packageDir.length > 0) { + if (!Array.isArray(packageDir)) { + paths = [_path2.default.resolve(packageDir)]; + } else { + paths = packageDir.map(dir => _path2.default.resolve(dir)); + } + } + + if (paths.length > 0) { + // use rule config to find package.json + paths.forEach(dir => { + const _packageContent = extractDepFields( + JSON.parse(_fs2.default.readFileSync(_path2.default.join(dir, 'package.json'), 'utf8'))); + + Object.keys(packageContent).forEach(depsKey => + Object.assign(packageContent[depsKey], _packageContent[depsKey])); + + }); + } else { + // use closest package.json + Object.assign( + packageContent, + extractDepFields( + _readPkgUp2.default.sync({ cwd: context.getFilename(), normalize: false }).pkg)); + + + } + + if (![ + packageContent.dependencies, + packageContent.devDependencies, + packageContent.optionalDependencies, + packageContent.peerDependencies, + packageContent.bundledDependencies]. + some(hasKeys)) { + return null; + } + + return packageContent; + } catch (e) { + if (paths.length > 0 && e.code === 'ENOENT') { + context.report({ + message: 'The package.json file could not be found.', + loc: { line: 0, column: 0 } }); + + } + if (e.name === 'JSONError' || e instanceof SyntaxError) { + context.report({ + message: 'The package.json file could not be parsed: ' + e.message, + loc: { line: 0, column: 0 } }); + + } + + return null; + } +} + +function missingErrorMessage(packageName) { + return `'${packageName}' should be listed in the project's dependencies. ` + + `Run 'npm i -S ${packageName}' to add it`; +} + +function devDepErrorMessage(packageName) { + return `'${packageName}' should be listed in the project's dependencies, not devDependencies.`; +} + +function optDepErrorMessage(packageName) { + return `'${packageName}' should be listed in the project's dependencies, ` + + `not optionalDependencies.`; +} + +function reportIfMissing(context, deps, depsOptions, node, name) { + // Do not report when importing types + if (node.importKind === 'type' || node.parent && node.parent.importKind === 'type') { + return; + } + + if ((0, _importType2.default)(name, context) !== 'external') { + return; + } + + const resolved = (0, _resolve2.default)(name, context); + if (!resolved) {return;} + + const splitName = name.split('/'); + const packageName = splitName[0][0] === '@' ? + splitName.slice(0, 2).join('/') : + splitName[0]; + const isInDeps = deps.dependencies[packageName] !== undefined; + const isInDevDeps = deps.devDependencies[packageName] !== undefined; + const isInOptDeps = deps.optionalDependencies[packageName] !== undefined; + const isInPeerDeps = deps.peerDependencies[packageName] !== undefined; + const isInBundledDeps = deps.bundledDependencies.indexOf(packageName) !== -1; + + if (isInDeps || + depsOptions.allowDevDeps && isInDevDeps || + depsOptions.allowPeerDeps && isInPeerDeps || + depsOptions.allowOptDeps && isInOptDeps || + depsOptions.allowBundledDeps && isInBundledDeps) + { + return; + } + + if (isInDevDeps && !depsOptions.allowDevDeps) { + context.report(node, devDepErrorMessage(packageName)); + return; + } + + if (isInOptDeps && !depsOptions.allowOptDeps) { + context.report(node, optDepErrorMessage(packageName)); + return; + } + + context.report(node, missingErrorMessage(packageName)); +} + +function testConfig(config, filename) { + // Simplest configuration first, either a boolean or nothing. + if (typeof config === 'boolean' || typeof config === 'undefined') { + return config; + } + // Array of globs. + return config.some(c => + (0, _minimatch2.default)(filename, c) || + (0, _minimatch2.default)(filename, _path2.default.join(process.cwd(), c))); + +} + +module.exports = { + meta: { + type: 'problem', + docs: { + url: (0, _docsUrl2.default)('no-extraneous-dependencies') }, + + + schema: [ + { + 'type': 'object', + 'properties': { + 'devDependencies': { 'type': ['boolean', 'array'] }, + 'optionalDependencies': { 'type': ['boolean', 'array'] }, + 'peerDependencies': { 'type': ['boolean', 'array'] }, + 'bundledDependencies': { 'type': ['boolean', 'array'] }, + 'packageDir': { 'type': ['string', 'array'] } }, + + 'additionalProperties': false }] }, + + + + + create: function (context) { + const options = context.options[0] || {}; + const filename = context.getFilename(); + const deps = getDependencies(context, options.packageDir) || extractDepFields({}); + + const depsOptions = { + allowDevDeps: testConfig(options.devDependencies, filename) !== false, + allowOptDeps: testConfig(options.optionalDependencies, filename) !== false, + allowPeerDeps: testConfig(options.peerDependencies, filename) !== false, + allowBundledDeps: testConfig(options.bundledDependencies, filename) !== false }; + + + return (0, _moduleVisitor2.default)(node => { + reportIfMissing(context, deps, depsOptions, node, node.value); + }, { commonjs: true }); + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJz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QuZ2V0RmlsZW5hbWUoKVxuICAgIGNvbnN0IGRlcHMgPSBnZXREZXBlbmRlbmNpZXMoY29udGV4dCwgb3B0aW9ucy5wYWNrYWdlRGlyKSB8fCBleHRyYWN0RGVwRmllbGRzKHt9KVxuXG4gICAgY29uc3QgZGVwc09wdGlvbnMgPSB7XG4gICAgICBhbGxvd0RldkRlcHM6IHRlc3RDb25maWcob3B0aW9ucy5kZXZEZXBlbmRlbmNpZXMsIGZpbGVuYW1lKSAhPT0gZmFsc2UsXG4gICAgICBhbGxvd09wdERlcHM6IHRlc3RDb25maWcob3B0aW9ucy5vcHRpb25hbERlcGVuZGVuY2llcywgZmlsZW5hbWUpICE9PSBmYWxzZSxcbiAgICAgIGFsbG93UGVlckRlcHM6IHRlc3RDb25maWcob3B0aW9ucy5wZWVyRGVwZW5kZW5jaWVzLCBmaWxlbmFtZSkgIT09IGZhbHNlLFxuICAgICAgYWxsb3dCdW5kbGVkRGVwczogdGVzdENvbmZpZyhvcHRpb25zLmJ1bmRsZWREZXBlbmRlbmNpZXMsIGZpbGVuYW1lKSAhPT0gZmFsc2UsXG4gICAgfVxuXG4gICAgcmV0dXJuIG1vZHVsZVZpc2l0b3Iobm9kZSA9PiB7XG4gICAgICByZXBvcnRJZk1pc3NpbmcoY29udGV4dCwgZGVwcywgZGVwc09wdGlvbnMsIG5vZGUsIG5vZGUudmFsdWUpXG4gICAgfSwge2NvbW1vbmpzOiB0cnVlfSlcbiAgfSxcbn1cbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-internal-modules.js b/node_modules/eslint-plugin-import/lib/rules/no-internal-modules.js new file mode 100644 index 000000000..32d90d18b --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-internal-modules.js @@ -0,0 +1,110 @@ +'use strict';var _slicedToArray = function () {function sliceIterator(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"]) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}return function (arr, i) {if (Array.isArray(arr)) {return arr;} else if (Symbol.iterator in Object(arr)) {return sliceIterator(arr, i);} else {throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();var _minimatch = require('minimatch');var _minimatch2 = _interopRequireDefault(_minimatch); + +var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve); +var _importType = require('../core/importType');var _importType2 = _interopRequireDefault(_importType); +var _staticRequire = require('../core/staticRequire');var _staticRequire2 = _interopRequireDefault(_staticRequire); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('no-internal-modules') }, + + + schema: [ + { + type: 'object', + properties: { + allow: { + type: 'array', + items: { + type: 'string' } } }, + + + + additionalProperties: false }] }, + + + + + create: function noReachingInside(context) { + const options = context.options[0] || {}; + const allowRegexps = (options.allow || []).map(p => _minimatch2.default.makeRe(p)); + + // test if reaching to this destination is allowed + function reachingAllowed(importPath) { + return allowRegexps.some(re => re.test(importPath)); + } + + // minimatch patterns are expected to use / path separators, like import + // statements, so normalize paths to use the same + function normalizeSep(somePath) { + return somePath.split('\\').join('/'); + } + + // find a directory that is being reached into, but which shouldn't be + function isReachViolation(importPath) { + const steps = normalizeSep(importPath). + split('/'). + reduce((acc, step) => { + if (!step || step === '.') { + return acc; + } else if (step === '..') { + return acc.slice(0, -1); + } else { + return acc.concat(step); + } + }, []); + + const nonScopeSteps = steps.filter(step => step.indexOf('@') !== 0); + if (nonScopeSteps.length <= 1) return false; + + // before trying to resolve, see if the raw import (with relative + // segments resolved) matches an allowed pattern + const justSteps = steps.join('/'); + if (reachingAllowed(justSteps) || reachingAllowed(`/${justSteps}`)) return false; + + // if the import statement doesn't match directly, try to match the + // resolved path if the import is resolvable + const resolved = (0, _resolve2.default)(importPath, context); + if (!resolved || reachingAllowed(normalizeSep(resolved))) return false; + + // this import was not allowed by the allowed paths, and reaches + // so it is a violation + return true; + } + + function checkImportForReaching(importPath, node) { + const potentialViolationTypes = ['parent', 'index', 'sibling', 'external', 'internal']; + if (potentialViolationTypes.indexOf((0, _importType2.default)(importPath, context)) !== -1 && + isReachViolation(importPath)) + { + context.report({ + node, + message: `Reaching to "${importPath}" is not allowed.` }); + + } + } + + return { + ImportDeclaration(node) { + checkImportForReaching(node.source.value, node.source); + }, + ExportAllDeclaration(node) { + checkImportForReaching(node.source.value, node.source); + }, + ExportNamedDeclaration(node) { + if (node.source) { + checkImportForReaching(node.source.value, node.source); + } + }, + CallExpression(node) { + if ((0, _staticRequire2.default)(node)) {var _node$arguments = _slicedToArray( + node.arguments, 1);const firstArgument = _node$arguments[0]; + checkImportForReaching(firstArgument.value, firstArgument); + } + } }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1pbnRlcm5hbC1tb2R1bGVzLmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJtZXRhIiwidHlwZSIsImRvY3MiLCJ1cmwiLCJzY2hlbWEiLCJwcm9wZXJ0aWVzIiwiYWxsb3ciLCJpdGVtcyIsImFkZGl0aW9uYWxQcm9wZXJ0aWVzIiwiY3JlYXRlIiwibm9SZWFjaGluZ0luc2lkZSIsImNvbnRleHQiLCJvcHRpb25zIiwiYWxsb3dSZWdleHBzIiwibWFwIiwicCIsIm1pbmltYXRjaCIsIm1ha2VSZSIsInJlYWNoaW5nQWxsb3dlZCIsImltcG9ydFBhdGgiLCJzb21lIiwicmUiLCJ0ZXN0Iiwibm9ybWFsaXplU2VwIiwic29tZVBhdGgiLCJzcGxpdCIsImpvaW4iLCJ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HVybiB7XG4gICAgICBJbXBvcnREZWNsYXJhdGlvbihub2RlKSB7XG4gICAgICAgIGNoZWNrSW1wb3J0Rm9yUmVhY2hpbmcobm9kZS5zb3VyY2UudmFsdWUsIG5vZGUuc291cmNlKVxuICAgICAgfSxcbiAgICAgIEV4cG9ydEFsbERlY2xhcmF0aW9uKG5vZGUpIHtcbiAgICAgICAgY2hlY2tJbXBvcnRGb3JSZWFjaGluZyhub2RlLnNvdXJjZS52YWx1ZSwgbm9kZS5zb3VyY2UpXG4gICAgICB9LFxuICAgICAgRXhwb3J0TmFtZWREZWNsYXJhdGlvbihub2RlKSB7XG4gICAgICAgIGlmIChub2RlLnNvdXJjZSkge1xuICAgICAgICAgIGNoZWNrSW1wb3J0Rm9yUmVhY2hpbmcobm9kZS5zb3VyY2UudmFsdWUsIG5vZGUuc291cmNlKVxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgQ2FsbEV4cHJlc3Npb24obm9kZSkge1xuICAgICAgICBpZiAoaXNTdGF0aWNSZXF1aXJlKG5vZGUpKSB7XG4gICAgICAgICAgY29uc3QgWyBmaXJzdEFyZ3VtZW50IF0gPSBub2RlLmFyZ3VtZW50c1xuICAgICAgICAgIGNoZWNrSW1wb3J0Rm9yUmVhY2hpbmcoZmlyc3RBcmd1bWVudC52YWx1ZSwgZmlyc3RBcmd1bWVudClcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICB9XG4gIH0sXG59XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-mutable-exports.js b/node_modules/eslint-plugin-import/lib/rules/no-mutable-exports.js new file mode 100644 index 000000000..30a9effc2 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-mutable-exports.js @@ -0,0 +1,57 @@ +'use strict';var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('no-mutable-exports') }, + + schema: [] }, + + + create: function (context) { + function checkDeclaration(node) {const + kind = node.kind; + if (kind === 'var' || kind === 'let') { + context.report(node, `Exporting mutable '${kind}' binding, use 'const' instead.`); + } + } + + function checkDeclarationsInScope(_ref, name) {let variables = _ref.variables; + for (let variable of variables) { + if (variable.name === name) { + for (let def of variable.defs) { + if (def.type === 'Variable' && def.parent) { + checkDeclaration(def.parent); + } + } + } + } + } + + function handleExportDefault(node) { + const scope = context.getScope(); + + if (node.declaration.name) { + checkDeclarationsInScope(scope, node.declaration.name); + } + } + + function handleExportNamed(node) { + const scope = context.getScope(); + + if (node.declaration) { + checkDeclaration(node.declaration); + } else if (!node.source) { + for (let specifier of node.specifiers) { + checkDeclarationsInScope(scope, specifier.local.name); + } + } + } + + return { + 'ExportDefaultDeclaration': handleExportDefault, + 'ExportNamedDeclaration': handleExportNamed }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1tdXRhYmxlLWV4cG9ydHMuanMiXSwibmFtZXMiOlsibW9kdWxlIiwiZXhwb3J0cyIsIm1ldGEiLCJ0eXBlIiwiZG9jcyIsInVybCIsInNjaGVtYSIsImNyZWF0ZSIsImNvbnRleHQiLCJjaGVja0RlY2xhcmF0aW9uIiwibm9kZSIsImtpbmQiLCJyZXBvcnQiLCJjaGVja0RlY2xhcmF0aW9uc0luU2NvcGUiLCJuYW1lIiwidmFyaWFibGVzIiwidmFyaWFibGUiLCJkZWYiLCJkZWZzIiwicGFyZW50IiwiaGFuZGxlRXhwb3J0RGVmYXVsdCIsInNjb3BlIiwiZ2V0U2NvcGUiLCJkZWNsYXJhdGlvbiIsImhhbmRsZUV4cG9ydE5hbWVkIiwic291cmNlIiwic3BlY2lmaWVyIiwic3BlY2lmaWVycyIsImxvY2FsIl0sIm1hcHBpbmdzIjoiYUFBQSxxQzs7QUFFQUEs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GVjaWZpZXJzKSB7XG4gICAgICAgICAgY2hlY2tEZWNsYXJhdGlvbnNJblNjb3BlKHNjb3BlLCBzcGVjaWZpZXIubG9jYWwubmFtZSlcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiB7XG4gICAgICAnRXhwb3J0RGVmYXVsdERlY2xhcmF0aW9uJzogaGFuZGxlRXhwb3J0RGVmYXVsdCxcbiAgICAgICdFeHBvcnROYW1lZERlY2xhcmF0aW9uJzogaGFuZGxlRXhwb3J0TmFtZWQsXG4gICAgfVxuICB9LFxufVxuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-named-as-default-member.js b/node_modules/eslint-plugin-import/lib/rules/no-named-as-default-member.js new file mode 100644 index 000000000..4ef823f1c --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-named-as-default-member.js @@ -0,0 +1,107 @@ +'use strict'; + + + + + +var _ExportMap = require('../ExportMap');var _ExportMap2 = _interopRequireDefault(_ExportMap); +var _importDeclaration = require('../importDeclaration');var _importDeclaration2 = _interopRequireDefault(_importDeclaration); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('no-named-as-default-member') }, + + schema: [] }, + + + create: function (context) { + + const fileImports = new Map(); + const allPropertyLookups = new Map(); + + function handleImportDefault(node) { + const declaration = (0, _importDeclaration2.default)(context); + const exportMap = _ExportMap2.default.get(declaration.source.value, context); + if (exportMap == null) return; + + if (exportMap.errors.length) { + exportMap.reportErrors(context, declaration); + return; + } + + fileImports.set(node.local.name, { + exportMap, + sourcePath: declaration.source.value }); + + } + + function storePropertyLookup(objectName, propName, node) { + const lookups = allPropertyLookups.get(objectName) || []; + lookups.push({ node, propName }); + allPropertyLookups.set(objectName, lookups); + } + + function handlePropLookup(node) { + const objectName = node.object.name; + const propName = node.property.name; + storePropertyLookup(objectName, propName, node); + } + + function handleDestructuringAssignment(node) { + const isDestructure = + node.id.type === 'ObjectPattern' && + node.init != null && + node.init.type === 'Identifier'; + + if (!isDestructure) return; + + const objectName = node.init.name; + for (const _ref of node.id.properties) {const key = _ref.key; + if (key == null) continue; // true for rest properties + storePropertyLookup(objectName, key.name, key); + } + } + + function handleProgramExit() { + allPropertyLookups.forEach((lookups, objectName) => { + const fileImport = fileImports.get(objectName); + if (fileImport == null) return; + + for (const _ref2 of lookups) {const propName = _ref2.propName;const node = _ref2.node; + // the default import can have a "default" property + if (propName === 'default') continue; + if (!fileImport.exportMap.namespace.has(propName)) continue; + + context.report({ + node, + message: + `Caution: \`${objectName}\` also has a named export ` + + `\`${propName}\`. Check if you meant to write ` + + `\`import {${propName}} from '${fileImport.sourcePath}'\` ` + + 'instead.' }); + + + } + }); + } + + return { + 'ImportDefaultSpecifier': handleImportDefault, + 'MemberExpression': handlePropLookup, + 'VariableDeclarator': handleDestructuringAssignment, + 'Program:exit': handleProgramExit }; + + } }; /** + * @fileoverview Rule to warn about potentially confused use of name exports + * @author Desmond Brand + * @copyright 2016 Desmond Brand. All rights reserved. + * See LICENSE in root directory for full license. + */ +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1uYW1lZC1hcy1kZWZhdWx0LW1lbWJlci5qcyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwibWV0YSIsInR5cGUiLCJkb2NzIiwidXJsIiwic2NoZW1hIiwiY3JlYXRlIiwiY29udGV4dCIsImZpbGVJbXBvcnRzIiwiTWFwIiwiYWxsUHJvcGVydHlMb29rdXBzIiwiaGFuZGxlSW1wb3J0RGVmYXVsdCIsIm5vZGUiLCJkZWNsYXJhdGlvbiIsImV4cG9ydE1hcCIsI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XN0cnVjdHVyaW5nQXNzaWdubWVudCxcbiAgICAgICdQcm9ncmFtOmV4aXQnOiBoYW5kbGVQcm9ncmFtRXhpdCxcbiAgICB9XG4gIH0sXG59XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-named-as-default.js b/node_modules/eslint-plugin-import/lib/rules/no-named-as-default.js new file mode 100644 index 000000000..0b8d213c2 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-named-as-default.js @@ -0,0 +1,43 @@ +'use strict';var _ExportMap = require('../ExportMap');var _ExportMap2 = _interopRequireDefault(_ExportMap); +var _importDeclaration = require('../importDeclaration');var _importDeclaration2 = _interopRequireDefault(_importDeclaration); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +module.exports = { + meta: { + type: 'problem', + docs: { + url: (0, _docsUrl2.default)('no-named-as-default') }, + + schema: [] }, + + + create: function (context) { + function checkDefault(nameKey, defaultSpecifier) { + // #566: default is a valid specifier + if (defaultSpecifier[nameKey].name === 'default') return; + + var declaration = (0, _importDeclaration2.default)(context); + + var imports = _ExportMap2.default.get(declaration.source.value, context); + if (imports == null) return; + + if (imports.errors.length) { + imports.reportErrors(context, declaration); + return; + } + + if (imports.has('default') && + imports.has(defaultSpecifier[nameKey].name)) { + + context.report(defaultSpecifier, + 'Using exported name \'' + defaultSpecifier[nameKey].name + + '\' as identifier for default export.'); + + } + } + return { + 'ImportDefaultSpecifier': checkDefault.bind(null, 'local'), + 'ExportDefaultSpecifier': checkDefault.bind(null, 'exported') }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1uYW1lZC1hcy1kZWZhdWx0LmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJtZXRhIiwidHlwZSIsImRvY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yYXRpb24gPSBpbXBvcnREZWNsYXJhdGlvbihjb250ZXh0KVxuXG4gICAgICB2YXIgaW1wb3J0cyA9IEV4cG9ydHMuZ2V0KGRlY2xhcmF0aW9uLnNvdXJjZS52YWx1ZSwgY29udGV4dClcbiAgICAgIGlmIChpbXBvcnRzID09IG51bGwpIHJldHVyblxuXG4gICAgICBpZiAoaW1wb3J0cy5lcnJvcnMubGVuZ3RoKSB7XG4gICAgICAgIGltcG9ydHMucmVwb3J0RXJyb3JzKGNvbnRleHQsIGRlY2xhcmF0aW9uKVxuICAgICAgICByZXR1cm5cbiAgICAgIH1cblxuICAgICAgaWYgKGltcG9ydHMuaGFzKCdkZWZhdWx0JykgJiZcbiAgICAgICAgICBpbXBvcnRzLmhhcyhkZWZhdWx0U3BlY2lmaWVyW25hbWVLZXldLm5hbWUpKSB7XG5cbiAgICAgICAgY29udGV4dC5yZXBvcnQoZGVmYXVsdFNwZWNpZmllcixcbiAgICAgICAgICAnVXNpbmcgZXhwb3J0ZWQgbmFtZSBcXCcnICsgZGVmYXVsdFNwZWNpZmllcltuYW1lS2V5XS5uYW1lICtcbiAgICAgICAgICAnXFwnIGFzIGlkZW50aWZpZXIgZm9yIGRlZmF1bHQgZXhwb3J0LicpXG5cbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIHtcbiAgICAgICdJbXBvcnREZWZhdWx0U3BlY2lmaWVyJzogY2hlY2tEZWZhdWx0LmJpbmQobnVsbCwgJ2xvY2FsJyksXG4gICAgICAnRXhwb3J0RGVmYXVsdFNwZWNpZmllcic6IGNoZWNrRGVmYXVsdC5iaW5kKG51bGwsICdleHBvcnRlZCcpLFxuICAgIH1cbiAgfSxcbn1cbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-named-default.js b/node_modules/eslint-plugin-import/lib/rules/no-named-default.js new file mode 100644 index 000000000..e877c7b37 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-named-default.js @@ -0,0 +1,25 @@ +'use strict';var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('no-named-default') }, + + schema: [] }, + + + create: function (context) { + return { + 'ImportDeclaration': function (node) { + node.specifiers.forEach(function (im) { + if (im.type === 'ImportSpecifier' && im.imported.name === 'default') { + context.report({ + node: im.local, + message: `Use default import syntax to import '${im.local.name}'.` }); + } + }); + } }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1uYW1lZC1kZWZhdWx0LmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJtZXRhIiwidHlwZSIsImRvY3MiLCJ1cmwiLCJzY2hlbWEiLCJjcmVhdGUiLCJjb250ZXh0Iiwibm9kZSIsInNwZWNpZmllcnMiLCJmb3JFYWNoIiwiaW0iLCJpbXBvcnRlZCIsIm5hbWUiLCJyZXBvcnQiLCJsb2NhbCIsIm1lc3NhZ2UiXSwibWFwcGluZ3MiOiJhQUFBLHFDOztBQUVBQSxPQUFPQyxPQUFQLEdBQWlCO0FBQ2ZDLFFBQU07QUFDSkMsVUFBTSxZQURGO0FBRUpDLFVBQU07QUFDSkMsV0FBSyx1QkFBUSxrQkFBUixDQURELEVBRkY7O0FBS0pDLFlBQVEsRUFMSixFQURTOzs7QUFTZkMsVUFBUSxVQUFVQyxPQUFWLEVBQW1CO0FBQ3pCLFdBQU87QUFDTCwyQkFBcUIsVUFBVUMsSUFBVixFQUFnQjtBQUNuQ0EsYUFBS0MsVUFBTCxDQUFnQkMsT0FBaEIsQ0FBd0IsVUFBVUMsRUFBVixFQUFjO0FBQ3BDLGNBQUlBLEdBQUdULElBQUgsS0FBWSxpQkFBWixJQUFpQ1MsR0FBR0MsUUFBSCxDQU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xufVxuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-named-export.js b/node_modules/eslint-plugin-import/lib/rules/no-named-export.js new file mode 100644 index 000000000..8139a6b9b --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-named-export.js @@ -0,0 +1,35 @@ +'use strict';var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +module.exports = { + meta: { + type: 'suggestion', + docs: { url: (0, _docsUrl2.default)('no-named-export') }, + schema: [] }, + + + create(context) { + // ignore non-modules + if (context.parserOptions.sourceType !== 'module') { + return {}; + } + + const message = 'Named exports are not allowed.'; + + return { + ExportAllDeclaration(node) { + context.report({ node, message }); + }, + + ExportNamedDeclaration(node) { + if (node.specifiers.length === 0) { + return context.report({ node, message }); + } + + const someNamed = node.specifiers.some(specifier => specifier.exported.name !== 'default'); + if (someNamed) { + context.report({ node, message }); + } + } }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1uYW1lZC1leHBvcnQuanMiXSwibmFtZXMiOlsibW9kdWxlIiwiZXhwb3J0cyIsIm1ldGEiLCJ0eXBlIiwiZG9jcyIsInVybCIsInNjaGVtYSIsImNyZWF0ZSIsImNvbnRleHQiLCJwYXJzZXJPcHRpb25zIiwic291cmNlVHlwZSIsIm1lc3NhZ2UiLCJFeHBvcnRBbGxEZWNsYXJhdGlvbiIsIm5vZGUiLCJyZXBvcnQiLCJFeHBvcnROYW1lZERlY2xhcmF0aW9uIiwic3BlY2lmaWVycyIsImxlbmd0aCIsInNvbWVOYW1lZCIsInNvbWUiLCJzcGVjaWZpZXIiLCJleHBvcnRlZCIsIm5hbWUiXSwibWFwcGluZ3MiOiJhQUFBLHFDOztBQUVBQSxPQUFPQyxPQUFQLEdBQWlCO0FBQ2ZDLFF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ZTogJ3N1Z2dlc3Rpb24nLFxuICAgIGRvY3M6IHsgdXJsOiBkb2NzVXJsKCduby1uYW1lZC1leHBvcnQnKSB9LFxuICAgIHNjaGVtYTogW10sXG4gIH0sXG5cbiAgY3JlYXRlKGNvbnRleHQpIHtcbiAgICAvLyBpZ25vcmUgbm9uLW1vZHVsZXNcbiAgICBpZiAoY29udGV4dC5wYXJzZXJPcHRpb25zLnNvdXJjZVR5cGUgIT09ICdtb2R1bGUnKSB7XG4gICAgICByZXR1cm4ge31cbiAgICB9XG5cbiAgICBjb25zdCBtZXNzYWdlID0gJ05hbWVkIGV4cG9ydHMgYXJlIG5vdCBhbGxvd2VkLidcblxuICAgIHJldHVybiB7XG4gICAgICBFeHBvcnRBbGxEZWNsYXJhdGlvbihub2RlKSB7XG4gICAgICAgIGNvbnRleHQucmVwb3J0KHtub2RlLCBtZXNzYWdlfSlcbiAgICAgIH0sXG5cbiAgICAgIEV4cG9ydE5hbWVkRGVjbGFyYXRpb24obm9kZSkge1xuICAgICAgICBpZiAobm9kZS5zcGVjaWZpZXJzLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgIHJldHVybiBjb250ZXh0LnJlcG9ydCh7bm9kZSwgbWVzc2FnZX0pXG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBzb21lTmFtZWQgPSBub2RlLnNwZWNpZmllcnMuc29tZShzcGVjaWZpZXIgPT4gc3BlY2lmaWVyLmV4cG9ydGVkLm5hbWUgIT09ICdkZWZhdWx0JylcbiAgICAgICAgaWYgKHNvbWVOYW1lZCkge1xuICAgICAgICAgIGNvbnRleHQucmVwb3J0KHtub2RlLCBtZXNzYWdlfSlcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICB9XG4gIH0sXG59XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-namespace.js b/node_modules/eslint-plugin-import/lib/rules/no-namespace.js new file mode 100644 index 000000000..2a24bf8ca --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-namespace.js @@ -0,0 +1,160 @@ +'use strict'; + + + + +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _toConsumableArray(arr) {if (Array.isArray(arr)) {for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];return arr2;} else {return Array.from(arr);}} /** + * @fileoverview Rule to disallow namespace import + * @author Radek Benkel + */ //------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('no-namespace') }, + + fixable: 'code', + schema: [] }, + + + create: function (context) { + return { + 'ImportNamespaceSpecifier': function (node) { + const scopeVariables = context.getScope().variables; + const namespaceVariable = scopeVariables.find(variable => + variable.defs[0].node === node); + + const namespaceReferences = namespaceVariable.references; + const namespaceIdentifiers = namespaceReferences.map(reference => reference.identifier); + const canFix = namespaceIdentifiers.length > 0 && !usesNamespaceAsObject(namespaceIdentifiers); + + context.report({ + node, + message: `Unexpected namespace import.`, + fix: canFix && (fixer => { + const scopeManager = context.getSourceCode().scopeManager; + const fixes = []; + + // Pass 1: Collect variable names that are already in scope for each reference we want + // to transform, so that we can be sure that we choose non-conflicting import names + const importNameConflicts = {}; + namespaceIdentifiers.forEach(identifier => { + const parent = identifier.parent; + if (parent && parent.type === 'MemberExpression') { + const importName = getMemberPropertyName(parent); + const localConflicts = getVariableNamesInScope(scopeManager, parent); + if (!importNameConflicts[importName]) { + importNameConflicts[importName] = localConflicts; + } else { + localConflicts.forEach(c => importNameConflicts[importName].add(c)); + } + } + }); + + // Choose new names for each import + const importNames = Object.keys(importNameConflicts); + const importLocalNames = generateLocalNames( + importNames, + importNameConflicts, + namespaceVariable.name); + + + // Replace the ImportNamespaceSpecifier with a list of ImportSpecifiers + const namedImportSpecifiers = importNames.map(importName => + importName === importLocalNames[importName] ? + importName : + `${importName} as ${importLocalNames[importName]}`); + + fixes.push(fixer.replaceText(node, `{ ${namedImportSpecifiers.join(', ')} }`)); + + // Pass 2: Replace references to the namespace with references to the named imports + namespaceIdentifiers.forEach(identifier => { + const parent = identifier.parent; + if (parent && parent.type === 'MemberExpression') { + const importName = getMemberPropertyName(parent); + fixes.push(fixer.replaceText(parent, importLocalNames[importName])); + } + }); + + return fixes; + }) }); + + } }; + + } + + + /** + * @param {Identifier[]} namespaceIdentifiers + * @returns {boolean} `true` if the namespace variable is more than just a glorified constant + */ }; +function usesNamespaceAsObject(namespaceIdentifiers) { + return !namespaceIdentifiers.every(identifier => { + const parent = identifier.parent; + + // `namespace.x` or `namespace['x']` + return ( + parent && parent.type === 'MemberExpression' && ( + parent.property.type === 'Identifier' || parent.property.type === 'Literal')); + + }); +} + +/** + * @param {MemberExpression} memberExpression + * @returns {string} the name of the member in the object expression, e.g. the `x` in `namespace.x` + */ +function getMemberPropertyName(memberExpression) { + return memberExpression.property.type === 'Identifier' ? + memberExpression.property.name : + memberExpression.property.value; +} + +/** + * @param {ScopeManager} scopeManager + * @param {ASTNode} node + * @return {Set} + */ +function getVariableNamesInScope(scopeManager, node) { + let currentNode = node; + let scope = scopeManager.acquire(currentNode); + while (scope == null) { + currentNode = currentNode.parent; + scope = scopeManager.acquire(currentNode, true); + } + return new Set([].concat(_toConsumableArray( + scope.variables.map(variable => variable.name)), _toConsumableArray( + scope.upper.variables.map(variable => variable.name)))); + +} + +/** + * + * @param {*} names + * @param {*} nameConflicts + * @param {*} namespaceName + */ +function generateLocalNames(names, nameConflicts, namespaceName) { + const localNames = {}; + names.forEach(name => { + let localName; + if (!nameConflicts[name].has(name)) { + localName = name; + } else if (!nameConflicts[name].has(`${namespaceName}_${name}`)) { + localName = `${namespaceName}_${name}`; + } else { + for (let i = 1; i < Infinity; i++) { + if (!nameConflicts[name].has(`${namespaceName}_${name}_${i}`)) { + localName = `${namespaceName}_${name}_${i}`; + break; + } + } + } + localNames[name] = localName; + }); + return localNames; +} +//#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XggJiYgKGZpeGVyID0+IHtcbiAgICAgICAgICAgIGNvbnN0IHNjb3BlTWFuYWdlciA9IGNvbnRleHQuZ2V0U291cmNlQ29kZSgpLnNjb3BlTWFuYWdlclxuICAgICAgICAgICAgY29uc3QgZml4ZXMgPSBbXVxuXG4gICAgICAgICAgICAvLyBQYXNzIDE6IENvbGxlY3QgdmFyaWFibGUgbmFtZXMgdGhhdCBhcmUgYWxyZWFkeSBpbiBzY29wZSBmb3IgZWFjaCByZWZlcmVuY2Ugd2Ugd2FudFxuICAgICAgICAgICAgLy8gdG8gdHJhbnNmb3JtLCBzbyB0aGF0IHdlIGNhbiBiZSBzdXJlIHRoYXQgd2UgY2hvb3NlIG5vbi1jb25mbGljdGluZyBpbXBvcnQgbmFtZXNcbiAgICAgICAgICAgIGNvbnN0IGltcG9ydE5hbWVDb25mbGljdHMgPSB7fVxuICAgICAgICAgICAgbmFtZXNwYWNlSWRlbnRpZmllcnMuZm9yRWFjaCgoaWRlbnRpZmllcikgPT4ge1xuICAgICAgICAgICAgICBjb25zdCBwYXJlbnQgPSBpZGVudGlmaWVyLnBhcmVudFxuICAgICAgICAgICAgICBpZiAocGFyZW50ICYmIHBhcmVudC50eXBlID09PSAnTWVtYmVyRXhwcmVzc2lvbicpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBpbXBvcnROYW1lID0gZ2V0TWVtYmVyUHJvcGVydHlOYW1lKHBhcmVudClcbiAgICAgICAgICAgICAgICBjb25zdCBsb2NhbENvbmZsaWN0cyA9IGdldFZhcmlhYmxlTmFtZXNJblNjb3BlKHNjb3BlTWFuYWdlciwgcGFyZW50KVxuICAgICAgICAgICAgICAgIGlmICghaW1wb3J0TmFtZUNvbmZsaWN0c1tpbXBvcnROYW1lXSkge1xuICAgICAgICAgICAgICAgICAgaW1wb3J0TmFtZUNvbmZsaWN0c1tpbXBvcnROYW1lXSA9IGxvY2FsQ29uZmxpY3RzXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgIGxvY2FsQ29uZmxpY3RzLmZvckVhY2goKGMpID0+IGltcG9ydE5hbWVDb25mbGljdHNbaW1wb3J0TmFtZV0uYWRkKGMpKVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgLy8gQ2hvb3NlIG5ldyBuYW1lcyBmb3IgZWFjaCBpbXBvcnRcbiAgICAgICAgICAgIGNvbnN0IGltcG9ydE5hbWVzID0gT2JqZWN0LmtleXMoaW1wb3J0TmFtZUNvbmZsaWN0cylcbiAgICAgICAgICAgIGNvbnN0IGltcG9ydExvY2FsTmFtZXMgPSBnZW5lcmF0ZUxvY2FsTmFtZXMoXG4gICAgICAgICAgICAgIGltcG9ydE5hbWVzLFxuICAgICAgICAgICAgICBpbXBvcnROYW1lQ29uZmxpY3RzLFxuICAgICAgICAgICAgICBuYW1lc3BhY2VWYXJpYWJsZS5uYW1lXG4gICAgICAgICAgICApXG5cbiAgICAgICAgICAgIC8vIFJlcGxhY2UgdGhlIEltcG9ydE5hbWVzcGFjZVNwZWNpZmllciB3aXRoIGEgbGlzdCBvZiBJbXBvcnRTcGVjaWZpZXJzXG4gICAgICAgICAgICBjb25zdCBuYW1lZEltcG9ydFNwZWNpZmllcnMgPSBpbXBvcnROYW1lcy5tYXAoKGltcG9ydE5hbWUpID0+XG4gICAgICAgICAgICAgIGltcG9ydE5hbWUgPT09IGltcG9ydExvY2FsTmFtZXNbaW1wb3J0TmFtZV1cbiAgICAgICAgICAgICAgICA/IGltcG9ydE5hbWVcbiAgICAgICAgICAgICAgICA6IGAke2ltcG9ydE5hbWV9IGFzICR7aW1wb3J0TG9jYWxOYW1lc1tpbXBvcnROYW1lXX1gXG4gICAgICAgICAgICApXG4gICAgICAgICAgICBmaXhlcy5wdXNoKGZpeGVyLnJlcGxhY2VUZXh0KG5vZGUsIGB7ICR7bmFtZWRJbXBvcnRTcGVjaWZpZXJzLmpvaW4oJywgJyl9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fWApKSB7XG4gICAgICAgICAgbG9jYWxOYW1lID0gYCR7bmFtZXNwYWNlTmFtZX1fJHtuYW1lfV8ke2l9YFxuICAgICAgICAgIGJyZWFrXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gICAgbG9jYWxOYW1lc1tuYW1lXSA9IGxvY2FsTmFtZVxuICB9KVxuICByZXR1cm4gbG9jYWxOYW1lc1xufVxuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-nodejs-modules.js b/node_modules/eslint-plugin-import/lib/rules/no-nodejs-modules.js new file mode 100644 index 000000000..811adece1 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-nodejs-modules.js @@ -0,0 +1,49 @@ +'use strict';var _importType = require('../core/importType');var _importType2 = _interopRequireDefault(_importType); +var _staticRequire = require('../core/staticRequire');var _staticRequire2 = _interopRequireDefault(_staticRequire); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +function reportIfMissing(context, node, allowed, name) { + if (allowed.indexOf(name) === -1 && (0, _importType2.default)(name, context) === 'builtin') { + context.report(node, 'Do not import Node.js builtin module "' + name + '"'); + } +} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('no-nodejs-modules') }, + + schema: [ + { + type: 'object', + properties: { + allow: { + type: 'array', + uniqueItems: true, + items: { + type: 'string' } } }, + + + + additionalProperties: false }] }, + + + + + create: function (context) { + const options = context.options[0] || {}; + const allowed = options.allow || []; + + return { + ImportDeclaration: function handleImports(node) { + reportIfMissing(context, node, allowed, node.source.value); + }, + CallExpression: function handleRequires(node) { + if ((0, _staticRequire2.default)(node)) { + reportIfMissing(context, node, allowed, node.arguments[0].value); + } + } }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9u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AgcmVwb3J0SWZNaXNzaW5nKGNvbnRleHQsIG5vZGUsIGFsbG93ZWQsIG5vZGUuc291cmNlLnZhbHVlKVxuICAgICAgfSxcbiAgICAgIENhbGxFeHByZXNzaW9uOiBmdW5jdGlvbiBoYW5kbGVSZXF1aXJlcyhub2RlKSB7XG4gICAgICAgIGlmIChpc1N0YXRpY1JlcXVpcmUobm9kZSkpIHtcbiAgICAgICAgICByZXBvcnRJZk1pc3NpbmcoY29udGV4dCwgbm9kZSwgYWxsb3dlZCwgbm9kZS5hcmd1bWVudHNbMF0udmFsdWUpXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgfVxuICB9LFxufVxuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-relative-parent-imports.js b/node_modules/eslint-plugin-import/lib/rules/no-relative-parent-imports.js new file mode 100644 index 000000000..13695c1b0 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-relative-parent-imports.js @@ -0,0 +1,49 @@ +'use strict';var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl); +var _path = require('path'); +var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve); + +var _importType = require('../core/importType');var _importType2 = _interopRequireDefault(_importType);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('no-relative-parent-imports') }, + + schema: [(0, _moduleVisitor.makeOptionsSchema)()] }, + + + create: function noRelativePackages(context) { + const myPath = context.getFilename(); + if (myPath === '') return {}; // can't check a non-file + + function checkSourceValue(sourceNode) { + const depPath = sourceNode.value; + + if ((0, _importType2.default)(depPath, context) === 'external') {// ignore packages + return; + } + + const absDepPath = (0, _resolve2.default)(depPath, context); + + if (!absDepPath) {// unable to resolve path + return; + } + + const relDepPath = (0, _path.relative)((0, _path.dirname)(myPath), absDepPath); + + if ((0, _importType2.default)(relDepPath, context) === 'parent') { + context.report({ + node: sourceNode, + message: 'Relative imports from parent directories are not allowed. ' + + `Please either pass what you're importing through at runtime ` + + `(dependency injection), move \`${(0, _path.basename)(myPath)}\` to same ` + + `directory as \`${depPath}\` or consider making \`${depPath}\` a package.` }); + + } + } + + return (0, _moduleVisitor2.default)(checkSourceValue, context.options[0]); + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1yZWxhdGl2ZS1wYXJlbnQtaW1wb3J0cy5qcyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwibWV0YSIsInR5cGUiLCJkb2NzIiwidXJsIiwic2NoZW1hIiwiY3JlYXRlIiwibm9SZWxhdGl2ZVBhY2thZ2VzIiwiY29udGV4dCIsIm15UGF0aCIsImdldEZpbGVuYW1lIiwiY2hlY2tTb3VyY2VWYWx1ZSIsInNvdXJjZU5vZGUiLCJkZXBQYXRoIiwidmFsdWUiLCJhYnNEZXBQYXRoIiwicmVsRGVwUGF0aCIsInJlcG9ydCIsIm5vZGUiLCJtZXNzYWdlIiwib3B0aW9ucyJdLCJtYXBwaW5ncyI6ImFBQUEsa0U7QUFDQSxxQztBQUNBO0FBQ0Esc0Q7O0FBRUEsZ0Q7O0FBRUFBLE9BQU9DLE9BQVAsR0FBaUI7QUFDZkMsUUFBTTtBQUNKQyxVQUFNLFlBREY7QUFFSkMsVUFBTTtBQUNKQyxXQUFLLHVCQUFRLDRCQUFSLENBREQsRUFGRjs7QUFLSkMsWUFBUSxDQUFDLHVDQUFELENBTEosRUFEUzs7O0FBU2ZDLFVBQVEsU0FBU0Msa0JBQVQsQ0FBNEJDLE9BQTVCLEVBQXFDO0FBQzNDLFVBQU1DLFNBQVNELFFBQVFFLFdBQVIsRUFBZjtBQUNBLFFBQUlELFdBQVcs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jb25zdCByZWxEZXBQYXRoID0gcmVsYXRpdmUoZGlybmFtZShteVBhdGgpLCBhYnNEZXBQYXRoKVxuXG4gICAgICBpZiAoaW1wb3J0VHlwZShyZWxEZXBQYXRoLCBjb250ZXh0KSA9PT0gJ3BhcmVudCcpIHtcbiAgICAgICAgY29udGV4dC5yZXBvcnQoe1xuICAgICAgICAgIG5vZGU6IHNvdXJjZU5vZGUsXG4gICAgICAgICAgbWVzc2FnZTogJ1JlbGF0aXZlIGltcG9ydHMgZnJvbSBwYXJlbnQgZGlyZWN0b3JpZXMgYXJlIG5vdCBhbGxvd2VkLiAnICtcbiAgICAgICAgICAgIGBQbGVhc2UgZWl0aGVyIHBhc3Mgd2hhdCB5b3UncmUgaW1wb3J0aW5nIHRocm91Z2ggYXQgcnVudGltZSBgICtcbiAgICAgICAgICAgIGAoZGVwZW5kZW5jeSBpbmplY3Rpb24pLCBtb3ZlIFxcYCR7YmFzZW5hbWUobXlQYXRoKX1cXGAgdG8gc2FtZSBgICtcbiAgICAgICAgICAgIGBkaXJlY3RvcnkgYXMgXFxgJHtkZXBQYXRofVxcYCBvciBjb25zaWRlciBtYWtpbmcgXFxgJHtkZXBQYXRofVxcYCBhIHBhY2thZ2UuYCxcbiAgICAgICAgfSlcbiAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gbW9kdWxlVmlzaXRvcihjaGVja1NvdXJjZVZhbHVlLCBjb250ZXh0Lm9wdGlvbnNbMF0pXG4gIH0sXG59XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-restricted-paths.js b/node_modules/eslint-plugin-import/lib/rules/no-restricted-paths.js new file mode 100644 index 000000000..d318e4085 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-restricted-paths.js @@ -0,0 +1,125 @@ +'use strict';var _slicedToArray = function () {function sliceIterator(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"]) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}return function (arr, i) {if (Array.isArray(arr)) {return arr;} else if (Symbol.iterator in Object(arr)) {return sliceIterator(arr, i);} else {throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();var _containsPath = require('contains-path');var _containsPath2 = _interopRequireDefault(_containsPath); +var _path = require('path');var _path2 = _interopRequireDefault(_path); + +var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve); +var _staticRequire = require('../core/staticRequire');var _staticRequire2 = _interopRequireDefault(_staticRequire); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl); +var _importType = require('../core/importType');var _importType2 = _interopRequireDefault(_importType);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +module.exports = { + meta: { + type: 'problem', + docs: { + url: (0, _docsUrl2.default)('no-restricted-paths') }, + + + schema: [ + { + type: 'object', + properties: { + zones: { + type: 'array', + minItems: 1, + items: { + type: 'object', + properties: { + target: { type: 'string' }, + from: { type: 'string' }, + except: { + type: 'array', + items: { + type: 'string' }, + + uniqueItems: true }, + + message: { type: 'string' } }, + + additionalProperties: false } }, + + + basePath: { type: 'string' } }, + + additionalProperties: false }] }, + + + + + create: function noRestrictedPaths(context) { + const options = context.options[0] || {}; + const restrictedPaths = options.zones || []; + const basePath = options.basePath || process.cwd(); + const currentFilename = context.getFilename(); + const matchingZones = restrictedPaths.filter(zone => { + const targetPath = _path2.default.resolve(basePath, zone.target); + + return (0, _containsPath2.default)(currentFilename, targetPath); + }); + + function isValidExceptionPath(absoluteFromPath, absoluteExceptionPath) { + const relativeExceptionPath = _path2.default.relative(absoluteFromPath, absoluteExceptionPath); + + return (0, _importType2.default)(relativeExceptionPath, context) !== 'parent'; + } + + function reportInvalidExceptionPath(node) { + context.report({ + node, + message: 'Restricted path exceptions must be descendants of the configured `from` path for that zone.' }); + + } + + function checkForRestrictedImportPath(importPath, node) { + const absoluteImportPath = (0, _resolve2.default)(importPath, context); + + if (!absoluteImportPath) { + return; + } + + matchingZones.forEach(zone => { + const exceptionPaths = zone.except || []; + const absoluteFrom = _path2.default.resolve(basePath, zone.from); + + if (!(0, _containsPath2.default)(absoluteImportPath, absoluteFrom)) { + return; + } + + const absoluteExceptionPaths = exceptionPaths.map(exceptionPath => + _path2.default.resolve(absoluteFrom, exceptionPath)); + + const hasValidExceptionPaths = absoluteExceptionPaths. + every(absoluteExceptionPath => isValidExceptionPath(absoluteFrom, absoluteExceptionPath)); + + if (!hasValidExceptionPaths) { + reportInvalidExceptionPath(node); + return; + } + + const pathIsExcepted = absoluteExceptionPaths. + some(absoluteExceptionPath => (0, _containsPath2.default)(absoluteImportPath, absoluteExceptionPath)); + + if (pathIsExcepted) { + return; + } + + context.report({ + node, + message: `Unexpected path "{{importPath}}" imported in restricted zone.${zone.message ? ` ${zone.message}` : ''}`, + data: { importPath } }); + + }); + } + + return { + ImportDeclaration(node) { + checkForRestrictedImportPath(node.source.value, node.source); + }, + CallExpression(node) { + if ((0, _staticRequire2.default)(node)) {var _node$arguments = _slicedToArray( + node.arguments, 1);const firstArgument = _node$arguments[0]; + + checkForRestrictedImportPath(firstArgument.value, firstArgument); + } + } }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1yZXN0cmljdGVkLXBhdGhzLmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJtZXRhIiwidHlwZSIsImRvY3MiLCJ1cmwiLCJzY2hlbWEiLCJwcm9wZXJ0aWVzIiwiem9uZXMiLCJtaW5JdGVtcyIsIml0ZW1zIiwidGFyZ2V0IiwiZnJvbSIsImV4Y2VwdCIsInVuaXF1ZUl0ZW1zIiwibWVzc2FnZSIsImFkZGl0aW9uY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cG9ydCBjb250YWluc1BhdGggZnJvbSAnY29udGFpbnMtcGF0aCdcbmltcG9ydCBwYXRoIGZyb20gJ3BhdGgnXG5cbmltcG9ydCByZXNvbHZlIGZyb20gJ2VzbGludC1tb2R1bGUtdXRpbHMvcmVzb2x2ZSdcbmltcG9ydCBpc1N0YXRpY1JlcXVpcmUgZnJvbSAnLi4vY29yZS9zdGF0aWNSZXF1aXJlJ1xuaW1wb3J0IGRvY3NVcmwgZnJvbSAnLi4vZG9jc1VybCdcbmltcG9ydCBpbXBvcnRUeXBlIGZyb20gJy4uL2NvcmUvaW1wb3J0VHlwZSdcblxubW9kdWxlLmV4cG9ydHMgPSB7XG4gIG1ldGE6IHtcbiAgICB0eXBlOiAncHJvYmxlbScsXG4gICAgZG9jczoge1xuICAgICAgdXJsOiBkb2NzVXJsKCduby1yZXN0cmljdGVkLXBhdGhzJyksXG4gICAgfSxcblxuICAgIHNjaGVtYTogW1xuICAgICAge1xuICAgICAgICB0eXBlOiAnb2JqZWN0JyxcbiAgICAgICAgcHJvcGVydGllczoge1xuICAgICAgICAgIHpvbmVzOiB7XG4gICAgICAgICAgICB0eXBlOiAnYXJyYXknLFxuICAgICAgICAgICAgbWluSXRlbXM6IDEsXG4gICAgICAgICAgICBpdGVtczoge1xuICAgICAgICAgICAgICB0eXBlOiAnb2JqZWN0JyxcbiAgICAgICAgICAgICAgcHJvcGVydGllczoge1xuICAgICAgICAgICAgICAgIHRhcmdldDogeyB0eXBlOiAnc3RyaW5nJyB9LFxuICAgICAgICAgICAgICAgIGZyb206IHsgdHlwZTogJ3N0cmluZycgfSxcbiAgICAgICAgICAgICAgICBleGNlcHQ6IHtcbiAgICAgICAgICAgICAgICAgIHR5cGU6ICdhcnJheScsXG4gICAgICAgICAgICAgICAgICBpdGVtczoge1xuICAgICAgICAgICAgICAgICAgICB0eXBlOiAnc3RyaW5nJyxcbiAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICB1bmlxdWVJdGVtczog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WAgOiAnJ31gLFxuICAgICAgICAgICAgZGF0YTogeyBpbXBvcnRQYXRoIH0sXG4gICAgICAgICAgfSlcbiAgICAgICAgfSlcbiAgICB9XG5cbiAgICByZXR1cm4ge1xuICAgICAgSW1wb3J0RGVjbGFyYXRpb24obm9kZSkge1xuICAgICAgICBjaGVja0ZvclJlc3RyaWN0ZWRJbXBvcnRQYXRoKG5vZGUuc291cmNlLnZhbHVlLCBub2RlLnNvdXJjZSlcbiAgICAgIH0sXG4gICAgICBDYWxsRXhwcmVzc2lvbihub2RlKSB7XG4gICAgICAgIGlmIChpc1N0YXRpY1JlcXVpcmUobm9kZSkpIHtcbiAgICAgICAgICBjb25zdCBbIGZpcnN0QXJndW1lbnQgXSA9IG5vZGUuYXJndW1lbnRzXG5cbiAgICAgICAgICBjaGVja0ZvclJlc3RyaWN0ZWRJbXBvcnRQYXRoKGZpcnN0QXJndW1lbnQudmFsdWUsIGZpcnN0QXJndW1lbnQpXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgfVxuICB9LFxufVxuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-self-import.js b/node_modules/eslint-plugin-import/lib/rules/no-self-import.js new file mode 100644 index 000000000..50951630c --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-self-import.js @@ -0,0 +1,45 @@ +'use strict'; + + + + +var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve); +var _staticRequire = require('../core/staticRequire');var _staticRequire2 = _interopRequireDefault(_staticRequire); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +function isImportingSelf(context, node, requireName) { + const filePath = context.getFilename(); + + // If the input is from stdin, this test can't fail + if (filePath !== '' && filePath === (0, _resolve2.default)(requireName, context)) { + context.report({ + node, + message: 'Module imports itself.' }); + + } +} /** + * @fileOverview Forbids a module from importing itself + * @author Gio d'Amelio + */module.exports = { meta: { + type: 'problem', + docs: { + description: 'Forbid a module from importing itself', + recommended: true, + url: (0, _docsUrl2.default)('no-self-import') }, + + + schema: [] }, + + create: function (context) { + return { + ImportDeclaration(node) { + isImportingSelf(context, node, node.source.value); + }, + CallExpression(node) { + if ((0, _staticRequire2.default)(node)) { + isImportingSelf(context, node, node.arguments[0].value); + } + } }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1zZWxmLWltcG9ydC5qcyJdLCJuYW1lcyI6WyJpc0ltcG9ydGluZ1NlbGYiLCJjb250ZXh0Iiwibm9kZSIsInJlcXVpcmVOYW1lIiwiZmlsZVBhdGgiLCJnZXRGaWxlbmFtZSIsInJlcG9ydCIsIm1lc3NhZ2UiLCJtb2R1bGUiLCJleHBvcnRzIiwibWV0YSIsInR5cGUiLCJkb2NzIiwiZGVzY3JpcHRpb24iLCJyZWNvbW1lbmRlZCIsInVybCIsInNjaGVtYSIsImNyZWF0ZSIsIkltcG9ydERlY2xhcmF0aW9uIiwic291cmNlIiwidmFsdWUiLCJDYWxsRXhwcmVzc2lvbiIsImFyZ3VtZW50cyJdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFLQSxzRDtBQUNBLHNEO0FBQ0EscUM7O0FBRUEsU0FBU0EsZUFBVCxDQUF5QkMsT0FBekIsRUFBa0NDLElBQWxDLEVBQXdDQyxXQUF4QyxFQUFxRDtBQUNuRCxRQUFNQyxXQUFXSCxRQUFRSSxXQUFSLEVBQWpCOztBQUVBO0FBQ0EsTUFBSUQsYUFBYSxRQUFiLElBQXlCQSxhQUFhLHVCQUFRRCxXQUFSLEVBQXFCRixPQUFyQixDQUExQyxFQUF5RTtBQUN2RUEsWUFBUUssTUFBUixDQUFlO0FBQ1hKLFVBRFc7QUFFWEssZUFBUyx3QkFGRSxFQUFmOztBQUlEO0FBQ0YsQyxDQW5CRDs7O0t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gIH0sXG59XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-unassigned-import.js b/node_modules/eslint-plugin-import/lib/rules/no-unassigned-import.js new file mode 100644 index 000000000..1d6d3f361 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-unassigned-import.js @@ -0,0 +1,76 @@ +'use strict';var _path = require('path');var _path2 = _interopRequireDefault(_path); +var _minimatch = require('minimatch');var _minimatch2 = _interopRequireDefault(_minimatch); + +var _staticRequire = require('../core/staticRequire');var _staticRequire2 = _interopRequireDefault(_staticRequire); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +function report(context, node) { + context.report({ + node, + message: 'Imported module should be assigned' }); + +} + +function testIsAllow(globs, filename, source) { + if (!Array.isArray(globs)) { + return false; // default doesn't allow any patterns + } + + let filePath; + + if (source[0] !== '.' && source[0] !== '/') {// a node module + filePath = source; + } else { + filePath = _path2.default.resolve(_path2.default.dirname(filename), source); // get source absolute path + } + + return globs.find(glob => + (0, _minimatch2.default)(filePath, glob) || + (0, _minimatch2.default)(filePath, _path2.default.join(process.cwd(), glob))) !== + undefined; +} + +function create(context) { + const options = context.options[0] || {}; + const filename = context.getFilename(); + const isAllow = source => testIsAllow(options.allow, filename, source); + + return { + ImportDeclaration(node) { + if (node.specifiers.length === 0 && !isAllow(node.source.value)) { + report(context, node); + } + }, + ExpressionStatement(node) { + if (node.expression.type === 'CallExpression' && + (0, _staticRequire2.default)(node.expression) && + !isAllow(node.expression.arguments[0].value)) { + report(context, node.expression); + } + } }; + +} + +module.exports = { + create, + meta: { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('no-unassigned-import') }, + + schema: [ + { + 'type': 'object', + 'properties': { + 'devDependencies': { 'type': ['boolean', 'array'] }, + 'optionalDependencies': { 'type': ['boolean', 'array'] }, + 'peerDependencies': { 'type': ['boolean', 'array'] }, + 'allow': { + 'type': 'array', + 'items': { + 'type': 'string' } } }, + + + + 'additionalProperties': false }] } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby11bmFzc2lnbmVkLWltcG9ydC5qcyJdLCJuYW1lcyI6WyJyZXBvcnQiLCJjb250ZXh0Iiwibm9kZSIsIm1lc3NhZ2UiLCJ0ZXN0SXNBbGxvdyIsImdsb2JzIiwiZmlsZW5hbWUiLCJzb3VyY2UiLCJBcnJheSIsImlzQXJyYXkiLCJmaWxlUGF0aCIsInBhdGgiLCJyZXNvbHZlIiwiZGlybmFtZSIsImZpbmQiLCJnbG9iIiwiam9pbiIsInByb2Nlc3MiLCJjd2QiLCJ1bmRlZmluZWQiLCJjcmVhdGUiLCJvcHRpb25zIiwiZ2V0RmlsZW5hbWUiLCJpc0FsbG93IiwiYWxsb3ciLCJJbXBvcnREZWNsYXJhdGlvbiIsInNwZWNpZmllcnMiLCJsZW5ndGgiLCJ2YWx1ZSIsIkV4cHJlc3Npb25TdGF0ZW1lbnQiLCJleHByZXNzaW9uIiwidHlwZSIsImFyZ3VtZW50cyIsIm1vZHVsZSIsImV4cG9ydHMiLCJtZXRhIiwiZG9jcyIsInVybCIsInNjaGVtYSJdLCJtYXBwaW5ncyI6ImFBQUEsNEI7QUFDQSxzQzs7QUFFQSxzRDtBQUNBLHFDOztBQUVBLFNBQVNBLE1BQVQsQ0FBZ0JDLE9BQWhCLEVBQXlCQyxJQUF6QixFQUErQjtBQUM3QkQsVUFBUUQsTUFBUixDQUFlO0FBQ2JFLFFBRGE7QUFFYkMsYUFBUyxvQ0FGSSxFQUFmOztBQUlEOztBQUVELFNBQVNDLFdBQVQsQ0FBcUJDLEtBQXJCLEVBQTRCQyxRQUE1QixFQUFzQ0MsTUFBdEMsRUFBOEM7QUFDNUMsTUFBSSxDQUFDQyxNQUFNQyxPQUFOLENBQWNKLEtBQWQsQ0FBTCx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m9vbGVhbicsICdhcnJheSddIH0sXG4gICAgICAgICAgJ3BlZXJEZXBlbmRlbmNpZXMnOiB7ICd0eXBlJzogWydib29sZWFuJywgJ2FycmF5J10gfSxcbiAgICAgICAgICAnYWxsb3cnOiB7XG4gICAgICAgICAgICAndHlwZSc6ICdhcnJheScsXG4gICAgICAgICAgICAnaXRlbXMnOiB7XG4gICAgICAgICAgICAgICd0eXBlJzogJ3N0cmluZycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgIH0sXG4gICAgICAgIH0sXG4gICAgICAgICdhZGRpdGlvbmFsUHJvcGVydGllcyc6IGZhbHNlLFxuICAgICAgfSxcbiAgICBdLFxuICB9LFxufVxuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-unresolved.js b/node_modules/eslint-plugin-import/lib/rules/no-unresolved.js new file mode 100644 index 000000000..a3f65be4e --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-unresolved.js @@ -0,0 +1,49 @@ +'use strict'; + + + + +var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve); +var _ModuleCache = require('eslint-module-utils/ModuleCache');var _ModuleCache2 = _interopRequireDefault(_ModuleCache); +var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} /** + * @fileOverview Ensures that an imported path exists, given resolution rules. + * @author Ben Mosher + */module.exports = { meta: { + type: 'problem', + docs: { + url: (0, _docsUrl2.default)('no-unresolved') }, + + + schema: [(0, _moduleVisitor.makeOptionsSchema)({ + caseSensitive: { type: 'boolean', default: true } })] }, + + + + create: function (context) { + + function checkSourceValue(source) { + const shouldCheckCase = !_resolve.CASE_SENSITIVE_FS && ( + !context.options[0] || context.options[0].caseSensitive !== false); + + const resolvedPath = (0, _resolve2.default)(source.value, context); + + if (resolvedPath === undefined) { + context.report(source, + `Unable to resolve path to module '${source.value}'.`); + } else + + if (shouldCheckCase) { + const cacheSettings = _ModuleCache2.default.getSettings(context.settings); + if (!(0, _resolve.fileExistsWithCaseSync)(resolvedPath, cacheSettings)) { + context.report(source, + `Casing of ${source.value} does not match the underlying filesystem.`); + } + + } + } + + return (0, _moduleVisitor2.default)(checkSourceValue, context.options[0]); + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby11bnJlc29sdmVkLmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJtZXRhIiwidHlwZSIsImRvY3MiLCJ1cmwiLCJzY2hlbWEiLCJjYXNlU2Vuc2l0aXZlIiwiZGVmYXVsdCIsImNyZWF0ZSIsImNvbnRleHQiLCJjaGVja1NvdXJjZVZhbHVlIiwic291cmNlIiwic2hvdWxkQ2hlY2tDYXNlIiwiQ0FTRV9TRU5TSVRJVkVfRlMiLCJvcHRpb25zIiwicmVzb2x2ZWRQYXRoIiwidmFsdWUiLCJ1bmRlZmluZWQiLCJyZXBvcnQiLCJjYWNoZVNldHRpbmdzIiwiTW9kdWxlQ2FjaGUiLCJnZXRTZXR0aW5ncyIsInNldHRpbmdzIl0sIm1hcHBpbmdzIjoiOzs7OztBQUtBLHNEO0FBQ0EsOEQ7QUFDQSxrRTtBQUNBLHFDLCtJQVJBOzs7dUxBVUFBLE9BQU9DLE9BQVAsR0FBaUIsRUFDZkMsTUFBTTtBQUNKQyxVQUFNLFNBREY7QUFFSkMsVUFBTTtBQUNKQyxXQUFLLHVCQUFRLGVBQVIsQ0FERCxFQUZGOzs7QUFNSkMsWUFBUSxDQUFFLHNDQUFrQjtBQUMxQkMscUJBQWUsRUFBRUosTUFBTSxTQUFSLEVBQW1CSyxTQUFTLElBQTVCLEVBRFcsRUFBbEIsQ0FBRixDQU5KLEVBRFM7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bHZlZFBhdGggPT09IHVuZGVmaW5lZCkge1xuICAgICAgICBjb250ZXh0LnJlcG9ydChzb3VyY2UsXG4gICAgICAgICAgYFVuYWJsZSB0byByZXNvbHZlIHBhdGggdG8gbW9kdWxlICcke3NvdXJjZS52YWx1ZX0nLmApXG4gICAgICB9XG5cbiAgICAgIGVsc2UgaWYgKHNob3VsZENoZWNrQ2FzZSkge1xuICAgICAgICBjb25zdCBjYWNoZVNldHRpbmdzID0gTW9kdWxlQ2FjaGUuZ2V0U2V0dGluZ3MoY29udGV4dC5zZXR0aW5ncylcbiAgICAgICAgaWYgKCFmaWxlRXhpc3RzV2l0aENhc2VTeW5jKHJlc29sdmVkUGF0aCwgY2FjaGVTZXR0aW5ncykpIHtcbiAgICAgICAgICBjb250ZXh0LnJlcG9ydChzb3VyY2UsXG4gICAgICAgICAgICBgQ2FzaW5nIG9mICR7c291cmNlLnZhbHVlfSBkb2VzIG5vdCBtYXRjaCB0aGUgdW5kZXJseWluZyBmaWxlc3lzdGVtLmApXG4gICAgICAgIH1cblxuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBtb2R1bGVWaXNpdG9yKGNoZWNrU291cmNlVmFsdWUsIGNvbnRleHQub3B0aW9uc1swXSlcblxuICB9LFxufVxuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-unused-modules.js b/node_modules/eslint-plugin-import/lib/rules/no-unused-modules.js new file mode 100644 index 000000000..d75c7ef1e --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-unused-modules.js @@ -0,0 +1,907 @@ +'use strict'; + + + + + +var _ExportMap = require('../ExportMap');var _ExportMap2 = _interopRequireDefault(_ExportMap); +var _ignore = require('eslint-module-utils/ignore'); +var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl); +var _path = require('path'); +var _readPkgUp = require('read-pkg-up');var _readPkgUp2 = _interopRequireDefault(_readPkgUp); +var _object = require('object.values');var _object2 = _interopRequireDefault(_object); +var _arrayIncludes = require('array-includes');var _arrayIncludes2 = _interopRequireDefault(_arrayIncludes);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _toConsumableArray(arr) {if (Array.isArray(arr)) {for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];return arr2;} else {return Array.from(arr);}} /** + * @fileOverview Ensures that modules contain exports and/or all + * modules are consumed within other modules. + * @author René Fermann + */ // eslint/lib/util/glob-util has been moved to eslint/lib/util/glob-utils with version 5.3 +// and has been moved to eslint/lib/cli-engine/file-enumerator in version 6 +let listFilesToProcess;try {const FileEnumerator = require('eslint/lib/cli-engine/file-enumerator').FileEnumerator; + listFilesToProcess = function (src, extensions) { + const e = new FileEnumerator({ + extensions: extensions }); + + return Array.from(e.iterateFiles(src), (_ref) => {let filePath = _ref.filePath,ignored = _ref.ignored;return { + ignored, + filename: filePath };}); + + }; +} catch (e1) { + // Prevent passing invalid options (extensions array) to old versions of the function. + // https://github.com/eslint/eslint/blob/v5.16.0/lib/util/glob-utils.js#L178-L280 + // https://github.com/eslint/eslint/blob/v5.2.0/lib/util/glob-util.js#L174-L269 + let originalListFilesToProcess; + try { + originalListFilesToProcess = require('eslint/lib/util/glob-utils').listFilesToProcess; + listFilesToProcess = function (src, extensions) { + return originalListFilesToProcess(src, { + extensions: extensions }); + + }; + } catch (e2) { + originalListFilesToProcess = require('eslint/lib/util/glob-util').listFilesToProcess; + + listFilesToProcess = function (src, extensions) { + const patterns = src.reduce((carry, pattern) => { + return carry.concat(extensions.map(extension => { + return (/\*\*|\*\./.test(pattern) ? pattern : `${pattern}/**/*${extension}`); + })); + }, src.slice()); + + return originalListFilesToProcess(patterns); + }; + } +} + +const EXPORT_DEFAULT_DECLARATION = 'ExportDefaultDeclaration'; +const EXPORT_NAMED_DECLARATION = 'ExportNamedDeclaration'; +const EXPORT_ALL_DECLARATION = 'ExportAllDeclaration'; +const IMPORT_DECLARATION = 'ImportDeclaration'; +const IMPORT_NAMESPACE_SPECIFIER = 'ImportNamespaceSpecifier'; +const IMPORT_DEFAULT_SPECIFIER = 'ImportDefaultSpecifier'; +const VARIABLE_DECLARATION = 'VariableDeclaration'; +const FUNCTION_DECLARATION = 'FunctionDeclaration'; +const CLASS_DECLARATION = 'ClassDeclaration'; +const INTERFACE_DECLARATION = 'InterfaceDeclaration'; +const TYPE_ALIAS = 'TypeAlias'; +const TS_INTERFACE_DECLARATION = 'TSInterfaceDeclaration'; +const TS_TYPE_ALIAS_DECLARATION = 'TSTypeAliasDeclaration'; +const TS_ENUM_DECLARATION = 'TSEnumDeclaration'; +const DEFAULT = 'default'; + +function forEachDeclarationIdentifier(declaration, cb) { + if (declaration) { + if ( + declaration.type === FUNCTION_DECLARATION || + declaration.type === CLASS_DECLARATION || + declaration.type === INTERFACE_DECLARATION || + declaration.type === TYPE_ALIAS || + declaration.type === TS_INTERFACE_DECLARATION || + declaration.type === TS_TYPE_ALIAS_DECLARATION || + declaration.type === TS_ENUM_DECLARATION) + { + cb(declaration.id.name); + } else if (declaration.type === VARIABLE_DECLARATION) { + declaration.declarations.forEach((_ref2) => {let id = _ref2.id; + cb(id.name); + }); + } + } +} + +/** + * List of imports per file. + * + * Represented by a two-level Map to a Set of identifiers. The upper-level Map + * keys are the paths to the modules containing the imports, while the + * lower-level Map keys are the paths to the files which are being imported + * from. Lastly, the Set of identifiers contains either names being imported + * or a special AST node name listed above (e.g ImportDefaultSpecifier). + * + * For example, if we have a file named foo.js containing: + * + * import { o2 } from './bar.js'; + * + * Then we will have a structure that looks like: + * + * Map { 'foo.js' => Map { 'bar.js' => Set { 'o2' } } } + * + * @type {Map>>} + */ +const importList = new Map(); + +/** + * List of exports per file. + * + * Represented by a two-level Map to an object of metadata. The upper-level Map + * keys are the paths to the modules containing the exports, while the + * lower-level Map keys are the specific identifiers or special AST node names + * being exported. The leaf-level metadata object at the moment only contains a + * `whereUsed` propoerty, which contains a Set of paths to modules that import + * the name. + * + * For example, if we have a file named bar.js containing the following exports: + * + * const o2 = 'bar'; + * export { o2 }; + * + * And a file named foo.js containing the following import: + * + * import { o2 } from './bar.js'; + * + * Then we will have a structure that looks like: + * + * Map { 'bar.js' => Map { 'o2' => { whereUsed: Set { 'foo.js' } } } } + * + * @type {Map>} + */ +const exportList = new Map(); + +const ignoredFiles = new Set(); +const filesOutsideSrc = new Set(); + +const isNodeModule = path => { + return (/\/(node_modules)\//.test(path)); +}; + +/** + * read all files matching the patterns in src and ignoreExports + * + * return all files matching src pattern, which are not matching the ignoreExports pattern + */ +const resolveFiles = (src, ignoreExports, context) => { + const extensions = Array.from((0, _ignore.getFileExtensions)(context.settings)); + + const srcFiles = new Set(); + const srcFileList = listFilesToProcess(src, extensions); + + // prepare list of ignored files + const ignoredFilesList = listFilesToProcess(ignoreExports, extensions); + ignoredFilesList.forEach((_ref3) => {let filename = _ref3.filename;return ignoredFiles.add(filename);}); + + // prepare list of source files, don't consider files from node_modules + srcFileList.filter((_ref4) => {let filename = _ref4.filename;return !isNodeModule(filename);}).forEach((_ref5) => {let filename = _ref5.filename; + srcFiles.add(filename); + }); + return srcFiles; +}; + +/** + * parse all source files and build up 2 maps containing the existing imports and exports + */ +const prepareImportsAndExports = (srcFiles, context) => { + const exportAll = new Map(); + srcFiles.forEach(file => { + const exports = new Map(); + const imports = new Map(); + const currentExports = _ExportMap2.default.get(file, context); + if (currentExports) {const + dependencies = currentExports.dependencies,reexports = currentExports.reexports,localImportList = currentExports.imports,namespace = currentExports.namespace; + + // dependencies === export * from + const currentExportAll = new Set(); + dependencies.forEach(getDependency => { + const dependency = getDependency(); + if (dependency === null) { + return; + } + + currentExportAll.add(dependency.path); + }); + exportAll.set(file, currentExportAll); + + reexports.forEach((value, key) => { + if (key === DEFAULT) { + exports.set(IMPORT_DEFAULT_SPECIFIER, { whereUsed: new Set() }); + } else { + exports.set(key, { whereUsed: new Set() }); + } + const reexport = value.getImport(); + if (!reexport) { + return; + } + let localImport = imports.get(reexport.path); + let currentValue; + if (value.local === DEFAULT) { + currentValue = IMPORT_DEFAULT_SPECIFIER; + } else { + currentValue = value.local; + } + if (typeof localImport !== 'undefined') { + localImport = new Set([].concat(_toConsumableArray(localImport), [currentValue])); + } else { + localImport = new Set([currentValue]); + } + imports.set(reexport.path, localImport); + }); + + localImportList.forEach((value, key) => { + if (isNodeModule(key)) { + return; + } + let localImport = imports.get(key); + if (typeof localImport !== 'undefined') { + localImport = new Set([].concat(_toConsumableArray(localImport), _toConsumableArray(value.importedSpecifiers))); + } else { + localImport = value.importedSpecifiers; + } + imports.set(key, localImport); + }); + importList.set(file, imports); + + // build up export list only, if file is not ignored + if (ignoredFiles.has(file)) { + return; + } + namespace.forEach((value, key) => { + if (key === DEFAULT) { + exports.set(IMPORT_DEFAULT_SPECIFIER, { whereUsed: new Set() }); + } else { + exports.set(key, { whereUsed: new Set() }); + } + }); + } + exports.set(EXPORT_ALL_DECLARATION, { whereUsed: new Set() }); + exports.set(IMPORT_NAMESPACE_SPECIFIER, { whereUsed: new Set() }); + exportList.set(file, exports); + }); + exportAll.forEach((value, key) => { + value.forEach(val => { + const currentExports = exportList.get(val); + const currentExport = currentExports.get(EXPORT_ALL_DECLARATION); + currentExport.whereUsed.add(key); + }); + }); +}; + +/** + * traverse through all imports and add the respective path to the whereUsed-list + * of the corresponding export + */ +const determineUsage = () => { + importList.forEach((listValue, listKey) => { + listValue.forEach((value, key) => { + const exports = exportList.get(key); + if (typeof exports !== 'undefined') { + value.forEach(currentImport => { + let specifier; + if (currentImport === IMPORT_NAMESPACE_SPECIFIER) { + specifier = IMPORT_NAMESPACE_SPECIFIER; + } else if (currentImport === IMPORT_DEFAULT_SPECIFIER) { + specifier = IMPORT_DEFAULT_SPECIFIER; + } else { + specifier = currentImport; + } + if (typeof specifier !== 'undefined') { + const exportStatement = exports.get(specifier); + if (typeof exportStatement !== 'undefined') {const + whereUsed = exportStatement.whereUsed; + whereUsed.add(listKey); + exports.set(specifier, { whereUsed }); + } + } + }); + } + }); + }); +}; + +const getSrc = src => { + if (src) { + return src; + } + return [process.cwd()]; +}; + +/** + * prepare the lists of existing imports and exports - should only be executed once at + * the start of a new eslint run + */ +let srcFiles; +let lastPrepareKey; +const doPreparation = (src, ignoreExports, context) => { + const prepareKey = JSON.stringify({ + src: (src || []).sort(), + ignoreExports: (ignoreExports || []).sort(), + extensions: Array.from((0, _ignore.getFileExtensions)(context.settings)).sort() }); + + if (prepareKey === lastPrepareKey) { + return; + } + + importList.clear(); + exportList.clear(); + ignoredFiles.clear(); + filesOutsideSrc.clear(); + + srcFiles = resolveFiles(getSrc(src), ignoreExports, context); + prepareImportsAndExports(srcFiles, context); + determineUsage(); + lastPrepareKey = prepareKey; +}; + +const newNamespaceImportExists = specifiers => +specifiers.some((_ref6) => {let type = _ref6.type;return type === IMPORT_NAMESPACE_SPECIFIER;}); + +const newDefaultImportExists = specifiers => +specifiers.some((_ref7) => {let type = _ref7.type;return type === IMPORT_DEFAULT_SPECIFIER;}); + +const fileIsInPkg = file => {var _readPkgUp$sync = + _readPkgUp2.default.sync({ cwd: file, normalize: false });const path = _readPkgUp$sync.path,pkg = _readPkgUp$sync.pkg; + const basePath = (0, _path.dirname)(path); + + const checkPkgFieldString = pkgField => { + if ((0, _path.join)(basePath, pkgField) === file) { + return true; + } + }; + + const checkPkgFieldObject = pkgField => { + const pkgFieldFiles = (0, _object2.default)(pkgField).map(value => (0, _path.join)(basePath, value)); + if ((0, _arrayIncludes2.default)(pkgFieldFiles, file)) { + return true; + } + }; + + const checkPkgField = pkgField => { + if (typeof pkgField === 'string') { + return checkPkgFieldString(pkgField); + } + + if (typeof pkgField === 'object') { + return checkPkgFieldObject(pkgField); + } + }; + + if (pkg.private === true) { + return false; + } + + if (pkg.bin) { + if (checkPkgField(pkg.bin)) { + return true; + } + } + + if (pkg.browser) { + if (checkPkgField(pkg.browser)) { + return true; + } + } + + if (pkg.main) { + if (checkPkgFieldString(pkg.main)) { + return true; + } + } + + return false; +}; + +module.exports = { + meta: { + type: 'suggestion', + docs: { url: (0, _docsUrl2.default)('no-unused-modules') }, + schema: [{ + properties: { + src: { + description: 'files/paths to be analyzed (only for unused exports)', + type: 'array', + minItems: 1, + items: { + type: 'string', + minLength: 1 } }, + + + ignoreExports: { + description: + 'files/paths for which unused exports will not be reported (e.g module entry points)', + type: 'array', + minItems: 1, + items: { + type: 'string', + minLength: 1 } }, + + + missingExports: { + description: 'report modules without any exports', + type: 'boolean' }, + + unusedExports: { + description: 'report exports without any usage', + type: 'boolean' } }, + + + not: { + properties: { + unusedExports: { enum: [false] }, + missingExports: { enum: [false] } } }, + + + anyOf: [{ + not: { + properties: { + unusedExports: { enum: [true] } } }, + + + required: ['missingExports'] }, + { + not: { + properties: { + missingExports: { enum: [true] } } }, + + + required: ['unusedExports'] }, + { + properties: { + unusedExports: { enum: [true] } }, + + required: ['unusedExports'] }, + { + properties: { + missingExports: { enum: [true] } }, + + required: ['missingExports'] }] }] }, + + + + + create: context => {var _ref8 = + + + + + + context.options[0] || {};const src = _ref8.src;var _ref8$ignoreExports = _ref8.ignoreExports;const ignoreExports = _ref8$ignoreExports === undefined ? [] : _ref8$ignoreExports,missingExports = _ref8.missingExports,unusedExports = _ref8.unusedExports; + + if (unusedExports) { + doPreparation(src, ignoreExports, context); + } + + const file = context.getFilename(); + + const checkExportPresence = node => { + if (!missingExports) { + return; + } + + if (ignoredFiles.has(file)) { + return; + } + + const exportCount = exportList.get(file); + const exportAll = exportCount.get(EXPORT_ALL_DECLARATION); + const namespaceImports = exportCount.get(IMPORT_NAMESPACE_SPECIFIER); + + exportCount.delete(EXPORT_ALL_DECLARATION); + exportCount.delete(IMPORT_NAMESPACE_SPECIFIER); + if (exportCount.size < 1) { + // node.body[0] === 'undefined' only happens, if everything is commented out in the file + // being linted + context.report(node.body[0] ? node.body[0] : node, 'No exports found'); + } + exportCount.set(EXPORT_ALL_DECLARATION, exportAll); + exportCount.set(IMPORT_NAMESPACE_SPECIFIER, namespaceImports); + }; + + const checkUsage = (node, exportedValue) => { + if (!unusedExports) { + return; + } + + if (ignoredFiles.has(file)) { + return; + } + + if (fileIsInPkg(file)) { + return; + } + + if (filesOutsideSrc.has(file)) { + return; + } + + // make sure file to be linted is included in source files + if (!srcFiles.has(file)) { + srcFiles = resolveFiles(getSrc(src), ignoreExports, context); + if (!srcFiles.has(file)) { + filesOutsideSrc.add(file); + return; + } + } + + exports = exportList.get(file); + + // special case: export * from + const exportAll = exports.get(EXPORT_ALL_DECLARATION); + if (typeof exportAll !== 'undefined' && exportedValue !== IMPORT_DEFAULT_SPECIFIER) { + if (exportAll.whereUsed.size > 0) { + return; + } + } + + // special case: namespace import + const namespaceImports = exports.get(IMPORT_NAMESPACE_SPECIFIER); + if (typeof namespaceImports !== 'undefined') { + if (namespaceImports.whereUsed.size > 0) { + return; + } + } + + // exportsList will always map any imported value of 'default' to 'ImportDefaultSpecifier' + const exportsKey = exportedValue === DEFAULT ? IMPORT_DEFAULT_SPECIFIER : exportedValue; + + const exportStatement = exports.get(exportsKey); + + const value = exportsKey === IMPORT_DEFAULT_SPECIFIER ? DEFAULT : exportsKey; + + if (typeof exportStatement !== 'undefined') { + if (exportStatement.whereUsed.size < 1) { + context.report( + node, + `exported declaration '${value}' not used within other modules`); + + } + } else { + context.report( + node, + `exported declaration '${value}' not used within other modules`); + + } + }; + + /** + * only useful for tools like vscode-eslint + * + * update lists of existing exports during runtime + */ + const updateExportUsage = node => { + if (ignoredFiles.has(file)) { + return; + } + + let exports = exportList.get(file); + + // new module has been created during runtime + // include it in further processing + if (typeof exports === 'undefined') { + exports = new Map(); + } + + const newExports = new Map(); + const newExportIdentifiers = new Set(); + + node.body.forEach((_ref9) => {let type = _ref9.type,declaration = _ref9.declaration,specifiers = _ref9.specifiers; + if (type === EXPORT_DEFAULT_DECLARATION) { + newExportIdentifiers.add(IMPORT_DEFAULT_SPECIFIER); + } + if (type === EXPORT_NAMED_DECLARATION) { + if (specifiers.length > 0) { + specifiers.forEach(specifier => { + if (specifier.exported) { + newExportIdentifiers.add(specifier.exported.name); + } + }); + } + forEachDeclarationIdentifier(declaration, name => { + newExportIdentifiers.add(name); + }); + } + }); + + // old exports exist within list of new exports identifiers: add to map of new exports + exports.forEach((value, key) => { + if (newExportIdentifiers.has(key)) { + newExports.set(key, value); + } + }); + + // new export identifiers added: add to map of new exports + newExportIdentifiers.forEach(key => { + if (!exports.has(key)) { + newExports.set(key, { whereUsed: new Set() }); + } + }); + + // preserve information about namespace imports + let exportAll = exports.get(EXPORT_ALL_DECLARATION); + let namespaceImports = exports.get(IMPORT_NAMESPACE_SPECIFIER); + + if (typeof namespaceImports === 'undefined') { + namespaceImports = { whereUsed: new Set() }; + } + + newExports.set(EXPORT_ALL_DECLARATION, exportAll); + newExports.set(IMPORT_NAMESPACE_SPECIFIER, namespaceImports); + exportList.set(file, newExports); + }; + + /** + * only useful for tools like vscode-eslint + * + * update lists of existing imports during runtime + */ + const updateImportUsage = node => { + if (!unusedExports) { + return; + } + + let oldImportPaths = importList.get(file); + if (typeof oldImportPaths === 'undefined') { + oldImportPaths = new Map(); + } + + const oldNamespaceImports = new Set(); + const newNamespaceImports = new Set(); + + const oldExportAll = new Set(); + const newExportAll = new Set(); + + const oldDefaultImports = new Set(); + const newDefaultImports = new Set(); + + const oldImports = new Map(); + const newImports = new Map(); + oldImportPaths.forEach((value, key) => { + if (value.has(EXPORT_ALL_DECLARATION)) { + oldExportAll.add(key); + } + if (value.has(IMPORT_NAMESPACE_SPECIFIER)) { + oldNamespaceImports.add(key); + } + if (value.has(IMPORT_DEFAULT_SPECIFIER)) { + oldDefaultImports.add(key); + } + value.forEach(val => { + if (val !== IMPORT_NAMESPACE_SPECIFIER && + val !== IMPORT_DEFAULT_SPECIFIER) { + oldImports.set(val, key); + } + }); + }); + + node.body.forEach(astNode => { + let resolvedPath; + + // support for export { value } from 'module' + if (astNode.type === EXPORT_NAMED_DECLARATION) { + if (astNode.source) { + resolvedPath = (0, _resolve2.default)(astNode.source.raw.replace(/('|")/g, ''), context); + astNode.specifiers.forEach(specifier => { + const name = specifier.local.name; + if (specifier.local.name === DEFAULT) { + newDefaultImports.add(resolvedPath); + } else { + newImports.set(name, resolvedPath); + } + }); + } + } + + if (astNode.type === EXPORT_ALL_DECLARATION) { + resolvedPath = (0, _resolve2.default)(astNode.source.raw.replace(/('|")/g, ''), context); + newExportAll.add(resolvedPath); + } + + if (astNode.type === IMPORT_DECLARATION) { + resolvedPath = (0, _resolve2.default)(astNode.source.raw.replace(/('|")/g, ''), context); + if (!resolvedPath) { + return; + } + + if (isNodeModule(resolvedPath)) { + return; + } + + if (newNamespaceImportExists(astNode.specifiers)) { + newNamespaceImports.add(resolvedPath); + } + + if (newDefaultImportExists(astNode.specifiers)) { + newDefaultImports.add(resolvedPath); + } + + astNode.specifiers.forEach(specifier => { + if (specifier.type === IMPORT_DEFAULT_SPECIFIER || + specifier.type === IMPORT_NAMESPACE_SPECIFIER) { + return; + } + newImports.set(specifier.imported.name, resolvedPath); + }); + } + }); + + newExportAll.forEach(value => { + if (!oldExportAll.has(value)) { + let imports = oldImportPaths.get(value); + if (typeof imports === 'undefined') { + imports = new Set(); + } + imports.add(EXPORT_ALL_DECLARATION); + oldImportPaths.set(value, imports); + + let exports = exportList.get(value); + let currentExport; + if (typeof exports !== 'undefined') { + currentExport = exports.get(EXPORT_ALL_DECLARATION); + } else { + exports = new Map(); + exportList.set(value, exports); + } + + if (typeof currentExport !== 'undefined') { + currentExport.whereUsed.add(file); + } else { + const whereUsed = new Set(); + whereUsed.add(file); + exports.set(EXPORT_ALL_DECLARATION, { whereUsed }); + } + } + }); + + oldExportAll.forEach(value => { + if (!newExportAll.has(value)) { + const imports = oldImportPaths.get(value); + imports.delete(EXPORT_ALL_DECLARATION); + + const exports = exportList.get(value); + if (typeof exports !== 'undefined') { + const currentExport = exports.get(EXPORT_ALL_DECLARATION); + if (typeof currentExport !== 'undefined') { + currentExport.whereUsed.delete(file); + } + } + } + }); + + newDefaultImports.forEach(value => { + if (!oldDefaultImports.has(value)) { + let imports = oldImportPaths.get(value); + if (typeof imports === 'undefined') { + imports = new Set(); + } + imports.add(IMPORT_DEFAULT_SPECIFIER); + oldImportPaths.set(value, imports); + + let exports = exportList.get(value); + let currentExport; + if (typeof exports !== 'undefined') { + currentExport = exports.get(IMPORT_DEFAULT_SPECIFIER); + } else { + exports = new Map(); + exportList.set(value, exports); + } + + if (typeof currentExport !== 'undefined') { + currentExport.whereUsed.add(file); + } else { + const whereUsed = new Set(); + whereUsed.add(file); + exports.set(IMPORT_DEFAULT_SPECIFIER, { whereUsed }); + } + } + }); + + oldDefaultImports.forEach(value => { + if (!newDefaultImports.has(value)) { + const imports = oldImportPaths.get(value); + imports.delete(IMPORT_DEFAULT_SPECIFIER); + + const exports = exportList.get(value); + if (typeof exports !== 'undefined') { + const currentExport = exports.get(IMPORT_DEFAULT_SPECIFIER); + if (typeof currentExport !== 'undefined') { + currentExport.whereUsed.delete(file); + } + } + } + }); + + newNamespaceImports.forEach(value => { + if (!oldNamespaceImports.has(value)) { + let imports = oldImportPaths.get(value); + if (typeof imports === 'undefined') { + imports = new Set(); + } + imports.add(IMPORT_NAMESPACE_SPECIFIER); + oldImportPaths.set(value, imports); + + let exports = exportList.get(value); + let currentExport; + if (typeof exports !== 'undefined') { + currentExport = exports.get(IMPORT_NAMESPACE_SPECIFIER); + } else { + exports = new Map(); + exportList.set(value, exports); + } + + if (typeof currentExport !== 'undefined') { + currentExport.whereUsed.add(file); + } else { + const whereUsed = new Set(); + whereUsed.add(file); + exports.set(IMPORT_NAMESPACE_SPECIFIER, { whereUsed }); + } + } + }); + + oldNamespaceImports.forEach(value => { + if (!newNamespaceImports.has(value)) { + const imports = oldImportPaths.get(value); + imports.delete(IMPORT_NAMESPACE_SPECIFIER); + + const exports = exportList.get(value); + if (typeof exports !== 'undefined') { + const currentExport = exports.get(IMPORT_NAMESPACE_SPECIFIER); + if (typeof currentExport !== 'undefined') { + currentExport.whereUsed.delete(file); + } + } + } + }); + + newImports.forEach((value, key) => { + if (!oldImports.has(key)) { + let imports = oldImportPaths.get(value); + if (typeof imports === 'undefined') { + imports = new Set(); + } + imports.add(key); + oldImportPaths.set(value, imports); + + let exports = exportList.get(value); + let currentExport; + if (typeof exports !== 'undefined') { + currentExport = exports.get(key); + } else { + exports = new Map(); + exportList.set(value, exports); + } + + if (typeof currentExport !== 'undefined') { + currentExport.whereUsed.add(file); + } else { + const whereUsed = new Set(); + whereUsed.add(file); + exports.set(key, { whereUsed }); + } + } + }); + + oldImports.forEach((value, key) => { + if (!newImports.has(key)) { + const imports = oldImportPaths.get(value); + imports.delete(key); + + const exports = exportList.get(value); + if (typeof exports !== 'undefined') { + const currentExport = exports.get(key); + if (typeof currentExport !== 'undefined') { + currentExport.whereUsed.delete(file); + } + } + } + }); + }; + + return { + 'Program:exit': node => { + updateExportUsage(node); + updateImportUsage(node); + checkExportPresence(node); + }, + 'ExportDefaultDeclaration': node => { + checkUsage(node, IMPORT_DEFAULT_SPECIFIER); + }, + 'ExportNamedDeclaration': node => { + node.specifiers.forEach(specifier => { + checkUsage(node, specifier.exported.name); + }); + forEachDeclarationIdentifier(node.declaration, name => { + checkUsage(node, name); + }); + } }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby11bnVzZWQtbW9kdWxlcy5qcyJdLCJuYW1lcyI6WyJsaXN0RmlsZXNUb1Byb2Nlc3MiLCJGaWxlRW51bWVyYXRvciIsInJlcXVpcmUiLCJzcmMiLCJleHRlbnNpb25zIiwiZSIsIkFycmF5IiwiZnJvbSIsIml0ZXJhdGVGaWxlcyIsImZpbGVQYXRoIiwiaWdub3JlZCIsImZpbGVuYW1lIiwiZTEiLCJvcmlnaW5hbExpc3RGaWxlc1RvUHJvY2VzcyIsImUyIiwicGF0dGVybnMiLCJyZWR1Y2UiLCJjYXJyeSIsInBhdH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GE6IHtcbiAgICB0eXBlOiAnc3VnZ2VzdGlvbicsXG4gICAgZG9jczogeyB1cmw6IGRvY3NVcmwoJ25vLXVudXNlZC1tb2R1bGVzJykgfSxcbiAgICBzY2hlbWE6IFt7XG4gICAgICBwcm9wZXJ0aWVzOiB7XG4gICAgICAgIHNyYzoge1xuICAgICAgICAgIGRlc2NyaXB0aW9uOiAnZmlsZXMvcGF0aHMgdG8gYmUgYW5hbHl6ZWQgKG9ubHkgZm9yIHVudXNlZCBleHBvcnRzKScsXG4gICAgICAgICAgdHlwZTogJ2FycmF5JyxcbiAgICAgICAgICBtaW5JdGVtczogMSxcbiAgICAgICAgICBpdGVtczoge1xuICAgICAgICAgICAgdHlwZTogJ3N0cmluZycsXG4gICAgICAgICAgICBtaW5MZW5ndGg6IDEsXG4gICAgICAgICAgfSxcbiAgICAgICAgfSxcbiAgICAgICAgaWdub3JlRXhwb3J0czoge1xuICAgICAgICAgIGRlc2NyaXB0aW9uOlxuICAgICAgICAgICAgJ2ZpbGVzL3BhdGhzIGZvciB3aGljaCB1bnVzZWQgZXhwb3J0cyB3aWxsIG5vdCBiZSByZXBvcnRlZCAoZS5nIG1vZHVsZSBlbnRyeSBwb2ludHMpJyxcbiAgICAgICAgICB0eXBlOiAnYXJyYXknLFxuICAgICAgICAgIG1pbkl0ZW1zOiAxLFxuICAgICAgICAgIGl0ZW1zOiB7XG4gICAgICAgICAgICB0eXBlOiAnc3RyaW5nJyxcbiAgICAgICAgICAgIG1pbkxlbmd0aDogMSxcbiAgICAgICAgICB9LFxuICAgICAgICB9LFxuICAgICAgICBtaXNzaW5nRXhwb3J0czoge1xuICAgICAgICAgIGRlc2NyaXB0aW9uOiAncmVwb3J0IG1vZHVsZXMgd2l0aG91dCBhbnkgZXhwb3J0cycsXG4gICAgICAgICAgdHlwZTogJ2Jvb2xlYW4nLFxuICAgICAgICB9LFxuICAgICAgICB1bnVzZWRFeHBvcnRzOiB7XG4gICAgICAgICAgZGVzY3JpcHRpb246ICdyZXBvcnQgZXhwb3J0cyB3aXRob3V0IGFueSB1c2FnZScsXG4gICAgICAgICAgdHlwZTogJ2Jvb2xlYW4nLFxuICAgICAgICB9LFxuICAgICAgfSxcbiAgICAgIG5vdDoge1xuICAgICAgICBwcm9wZXJ0aWVzOiB7XG4gICAgICAgICAgdW51c2VkRXhwb3J0czogeyBlbnVtOiBbZmFsc2VdIH0sXG4gICAgICAgICAgbWlzc2luZ0V4cG9ydHM6IHsgZW51bTogW2ZhbHNlXSB9LFxuICAgICAgICB9LFxuICAgICAgfSxcbiAgICAgIGFueU9mOlt7XG4gICAgICAgIG5vdDoge1xuICAgICAgICAgIHByb3BlcnRpZXM6IHtcbiAgICAgICAgICAgIHVudXNlZEV4cG9ydHM6IHsgZW51bTogW3RydWVdIH0sXG4gICAgICAgICAgfSxcbiAgICAgICAgfSxcbiAgICAgICAgcmVxdWlyZWQ6IFsnbWlzc2luZ0V4cG9ydHMnXSxcbiAgICAgIH0sIHtcbiAgICAgICAgbm90OiB7XG4gICAgICAgICAgcHJvcGVydGllczoge1xuICAgICAgICAgICAgbWlzc2luZ0V4cG9ydHM6IHsgZW51bTogW3RydWVdIH0sXG4gICAgICAgICAgfSxcbiAgICAgICAgfSxcbiAgICAgICAgcmVxdWlyZWQ6IFsndW51c2VkRXhwb3J0cyddLFxuICAgICAgfSwge1xuICAgICAgICBwcm9wZXJ0aWVzOiB7XG4gICAgICAgICAgdW51c2VkRXhwb3J0czogeyBlbnVtOiBbdHJ1ZV0gfSxcbiAgICAgICAgfSxcbiAgICAgICAgcmVxdWlyZWQ6IFsndW51c2VkRXhwb3J0cyddLFxuICAgICAgfSwge1xuICAgICAgICBwcm9wZXJ0aWVzOiB7XG4gICAgICAgICAgbWlzc2luZ0V4cG9ydHM6IHsgZW51bTogW3RydWVdIH0sXG4gICAgICAgIH0sXG4gICAgICAgIHJlcXVpcmVkOiBbJ21pc3NpbmdFeHBvcnRzJ10sXG4gICAgICB9XSxcbiAgICB9XSxcbiAgf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ICAgICAgICAgICAgcmVzb2x2ZWRQYXRoID0gcmVzb2x2ZShhc3ROb2RlLnNvdXJjZS5yYXcucmVwbGFjZSgvKCd8XCIpL2csICcnKSwgY29udGV4dClcbiAgICAgICAgICAgIGFzdE5vZGUuc3BlY2lmaWVycy5mb3JFYWNoKHNwZWNpZmllciA9PiB7XG4gICAgICAgICAgICAgIGNvbnN0IG5hbWUgPSBzcGVjaWZpZXIubG9jYWwubmFtZVxuICAgICAgICAgICAgICBpZiAoc3BlY2lmaWVyLmxvY2FsLm5hbWUgPT09IERFRkFVTFQpIHtcbiAgICAgICAgICAgICAgICBuZXdEZWZhdWx0SW1wb3J0cy5hZGQocmVzb2x2ZWRQYXRoKVxuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG5ld0ltcG9ydHMuc2V0KG5hbWUsIHJlc29sdmVkUGF0aClcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSlcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYXN0Tm9kZS50eXBlID09PSBFWFBPUlRfQUxMX0RFQ0xBUkFUSU9OKSB7XG4gICAgICAgICAgcmVzb2x2ZWRQYXRoID0gcmVzb2x2ZShhc3ROb2RlLnNvdXJjZS5yYXcucmVwbGFjZSgvKCd8XCIpL2csICcnKSwgY29udGV4dClcbiAgICAgICAgICBuZXdFeHBvcnRBbGwuYWRkKHJlc29sdmVkUGF0aClcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChhc3ROb2RlLnR5cGUgPT09IElNUE9SVF9ERUNMQVJBVElPTikge1xuICAgICAgICAgIHJlc29sdmVkUGF0aCA9IHJlc29sdmUoYXN0Tm9kZS5zb3VyY2UucmF3LnJlcGxhY2UoLygnfFwiKS9nLCAnJyksIGNvbnRleHQpXG4gICAgICAgICAgaWYgKCFyZXNvbHZlZFBhdGgpIHtcbiAgICAgICAgICAgIHJldHVyblxuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChp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mluZWQnKSB7XG4gICAgICAgICAgICBjdXJyZW50RXhwb3J0ID0gZXhwb3J0cy5nZXQoSU1QT1JUX0RFRkFVTFRfU1BFQ0lGSUVSKVxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBleHBvcnRzID0gbmV3IE1hcCgpXG4gICAgICAgICAgICBleHBvcnRMaXN0LnNldCh2YWx1ZSwgZXhwb3J0cylcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAodHlwZW9mIGN1cnJlbnRFeHBvcnQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBjdXJyZW50RXhwb3J0LndoZXJlVXNlZC5hZGQoZmlsZSlcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgY29uc3Qgd2hlcmVVc2VkID0gbmV3IFNldCgpXG4gICAgICAgICAgICB3aGVyZVVzZWQuYWRkKGZpbGUpXG4gICAgICAgICAgICBleHBvcnRzLnNldChJTVBPUlRfREVGQVVMVF9TUEVDSUZJRVIsIHsgd2hlcmVVc2VkIH0pXG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KVxuXG4gICAgICBvbGREZWZhdWx0SW1wb3J0cy5mb3JFYWNoKHZhbHVlID0+IHtcbiAgICAgICAgaWYgKCFuZXdEZWZhdWx0SW1wb3J0cy5oYXModmFsdWUpKSB7XG4gICAgICAgICAgY29uc3QgaW1wb3J0cyA9IG9sZEltcG9ydFBhdGhzLmdldCh2YWx1ZSlcbiAgICAgICAgICBpbXBvcnRzLmRlbGV0ZShJTVBPUlRfREVGQVVMVF9TUEVDSUZJRVIpXG5cbiAgICAgICAgICBjb25zdCBleHBvcnRzID0gZXhwb3J0TGlzdC5nZXQodmFsdWUpXG4gICAgICAgICAgaWYgKHR5cGVvZiBleHBvcnRzICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgY29uc3QgY3VycmVudEV4cG9ydCA9IGV4cG9ydHMuZ2V0KElNUE9SVF9ERUZBVUxUX1NQ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ZW50RXhwb3J0ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgY3VycmVudEV4cG9ydC53aGVyZVVzZWQuYWRkKGZpbGUpXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbnN0IHdoZXJlVXNlZCA9IG5ldyBTZXQoKVxuICAgICAgICAgICAgd2hlcmVVc2VkLmFkZChmaWxlKVxuICAgICAgICAgICAgZXhwb3J0cy5zZXQoSU1QT1JUX05BTUVTUEFDRV9TUEVDSUZJRVIsIHsgd2hlcmVVc2VkIH0pXG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KVxuXG4gICAgICBvbGROYW1lc3BhY2VJbXBvcnRzLmZvckVhY2godmFsdWUgPT4ge1xuICAgICAgICBpZiAoIW5ld05hbWVzcGFjZUltcG9ydHMuaGFzKHZhbHVlKSkge1xuICAgICAgICAgIGNvbnN0IGltcG9ydHMgPSBvbGRJbXBvcnRQYXRocy5nZXQodmFsdWUpXG4gICAgICAgICAgaW1wb3J0cy5kZWxldGUoSU1QT1JUX05BTUVTUEFDRV9TUEVDSUZJRVIpXG5cbiAgICAgICAgICBjb25zdCBleHBvcnRzID0gZXhwb3J0TGlzdC5nZXQodmFsdWUpXG4gICAgICAgICAgaWYgKHR5cGVvZiBleHBvcnRzICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgY29uc3QgY3VycmVudEV4cG9ydCA9IGV4cG9ydHMuZ2V0KElNUE9SVF9OQU1FU1BBQ0VfU1BFQ0lGSUVSKVxuICAgICAgICAgICAgaWYgKHR5cGVvZiBjdXJyZW50RXhwb3J0ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICBjdXJyZW50RXhwb3J0LndoZXJlVXNlZC5kZWxldGUoZmlsZSlcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0pXG5cbiAgICAgIG5ld0ltcG9ydHMuZm9yRWFjaCgodmFsdWUsIGtleSkgPT4ge1xuICAgICAgICBpZiAoIW9sZEltcG9ydHMuaGFzKGtleSkpIHtcbiAgICAgICAgICBsZXQgaW1wb3J0cyA9IG9sZEltcG9ydFBhdGhzLmdldCh2YWx1ZSlcbiAgICAgICAgICBpZiAodHlwZW9mIGltcG9ydHMgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpbXBvcnRzID0gbmV3IFNldCgpXG4gICAgICAgICAgfVxuICAgICAgICAgIGltcG9ydHMuYWRkKGtleSlcbiAgICAgICAgICBvbGRJbXBvcnRQYXRocy5zZXQodmFsdWUsIGltcG9ydHMpXG5cbiAgICAgICAgICBsZXQgZXhwb3J0cyA9IGV4cG9ydExpc3QuZ2V0KHZhbHVlKVxuICAgICAgICAgIGxldCBjdXJyZW50RXhwb3J0XG4gICAgICAgICAgaWYgKHR5cGVvZiBleHBvcnRzICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgY3VycmVudEV4cG9ydCA9IGV4cG9ydHMuZ2V0KGtleSlcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZXhwb3J0cyA9IG5ldyBNYXAoKVxuICAgICAgICAgICAgZXhwb3J0TGlzdC5zZXQodmFsdWUsIGV4cG9ydHMpXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHR5cGVvZiBjdXJyZW50RXhwb3J0ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgY3VycmVudEV4cG9ydC53aGVyZVVzZWQuYWRkKGZpbGUpXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbnN0IHdoZXJlVXNlZCA9IG5ldyBTZXQoKVxuICAgICAgICAgICAgd2hlcmVVc2VkLmFkZChmaWxlKVxuICAgICAgICAgICAgZXhwb3J0cy5zZXQoa2V5LCB7IHdoZXJlVXNlZCB9KVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSlcblxuICAgICAgb2xkSW1wb3J0cy5mb3JFYWNoKC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BzcGVjaWZpZXIuZXhwb3J0ZWQubmFtZSlcbiAgICAgICAgfSlcbiAgICAgICAgZm9yRWFjaERlY2xhcmF0aW9uSWRlbnRpZmllcihub2RlLmRlY2xhcmF0aW9uLCAobmFtZSkgPT4ge1xuICAgICAgICAgIGNoZWNrVXNhZ2Uobm9kZSwgbmFtZSlcbiAgICAgICAgfSlcbiAgICAgIH0sXG4gICAgfVxuICB9LFxufVxuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-useless-path-segments.js b/node_modules/eslint-plugin-import/lib/rules/no-useless-path-segments.js new file mode 100644 index 000000000..10b65740c --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-useless-path-segments.js @@ -0,0 +1,145 @@ +'use strict'; + + + + +var _ignore = require('eslint-module-utils/ignore'); +var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor); +var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve); +var _path = require('path');var _path2 = _interopRequireDefault(_path); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +/** + * convert a potentially relative path from node utils into a true + * relative path. + * + * ../ -> .. + * ./ -> . + * .foo/bar -> ./.foo/bar + * ..foo/bar -> ./..foo/bar + * foo/bar -> ./foo/bar + * + * @param relativePath {string} relative posix path potentially missing leading './' + * @returns {string} relative posix path that always starts with a ./ + **/ +function toRelativePath(relativePath) { + const stripped = relativePath.replace(/\/$/g, ''); // Remove trailing / + + return (/^((\.\.)|(\.))($|\/)/.test(stripped) ? stripped : `./${stripped}`); +} /** + * @fileOverview Ensures that there are no useless path segments + * @author Thomas Grainger + */function normalize(fn) {return toRelativePath(_path2.default.posix.normalize(fn)); +} + +function countRelativeParents(pathSegments) { + return pathSegments.reduce((sum, pathSegment) => pathSegment === '..' ? sum + 1 : sum, 0); +} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('no-useless-path-segments') }, + + + fixable: 'code', + + schema: [ + { + type: 'object', + properties: { + commonjs: { type: 'boolean' }, + noUselessIndex: { type: 'boolean' } }, + + additionalProperties: false }] }, + + + + + create(context) { + const currentDir = _path2.default.dirname(context.getFilename()); + const options = context.options[0]; + + function checkSourceValue(source) {const + importPath = source.value; + + function reportWithProposedPath(proposedPath) { + context.report({ + node: source, + // Note: Using messageIds is not possible due to the support for ESLint 2 and 3 + message: `Useless path segments for "${importPath}", should be "${proposedPath}"`, + fix: fixer => proposedPath && fixer.replaceText(source, JSON.stringify(proposedPath)) }); + + } + + // Only relative imports are relevant for this rule --> Skip checking + if (!importPath.startsWith('.')) { + return; + } + + // Report rule violation if path is not the shortest possible + const resolvedPath = (0, _resolve2.default)(importPath, context); + const normedPath = normalize(importPath); + const resolvedNormedPath = (0, _resolve2.default)(normedPath, context); + if (normedPath !== importPath && resolvedPath === resolvedNormedPath) { + return reportWithProposedPath(normedPath); + } + + const fileExtensions = (0, _ignore.getFileExtensions)(context.settings); + const regexUnnecessaryIndex = new RegExp( + `.*\\/index(\\${Array.from(fileExtensions).join('|\\')})?$`); + + + // Check if path contains unnecessary index (including a configured extension) + if (options && options.noUselessIndex && regexUnnecessaryIndex.test(importPath)) { + const parentDirectory = _path2.default.dirname(importPath); + + // Try to find ambiguous imports + if (parentDirectory !== '.' && parentDirectory !== '..') { + for (let fileExtension of fileExtensions) { + if ((0, _resolve2.default)(`${parentDirectory}${fileExtension}`, context)) { + return reportWithProposedPath(`${parentDirectory}/`); + } + } + } + + return reportWithProposedPath(parentDirectory); + } + + // Path is shortest possible + starts from the current directory --> Return directly + if (importPath.startsWith('./')) { + return; + } + + // Path is not existing --> Return directly (following code requires path to be defined) + if (resolvedPath === undefined) { + return; + } + + const expected = _path2.default.relative(currentDir, resolvedPath); // Expected import path + const expectedSplit = expected.split(_path2.default.sep); // Split by / or \ (depending on OS) + const importPathSplit = importPath.replace(/^\.\//, '').split('/'); + const countImportPathRelativeParents = countRelativeParents(importPathSplit); + const countExpectedRelativeParents = countRelativeParents(expectedSplit); + const diff = countImportPathRelativeParents - countExpectedRelativeParents; + + // Same number of relative parents --> Paths are the same --> Return directly + if (diff <= 0) { + return; + } + + // Report and propose minimal number of required relative parents + return reportWithProposedPath( + toRelativePath( + importPathSplit. + slice(0, countExpectedRelativeParents). + concat(importPathSplit.slice(countImportPathRelativeParents + diff)). + join('/'))); + + + } + + return (0, _moduleVisitor2.default)(checkSourceValue, options); + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby11c2VsZXNzLXBhdGgtc2VnbWVudHMuanMiXSwibmFtZXMiOlsidG9SZWxhdGl2ZVBhdGgiLCJyZWxhdGl2ZVBhdGgiLCJzdHJpcHBlZCIsInJlcGxhY2UiLCJ0ZXN0Iiwibm9ybWFsaXplIiwiZm4iLCJwYXRoIiwicG9zaXgiLCJjb3VudFJlbGF0aXZlUGFyZW50cyIsInBhdGhTZWdtZW50cyIsInJlZHVjZSIsInN1bSIsInBhdGhTZWdtZW50IiwibW9kdWxlIiwiZXhwb3J0cyIsIm1ldGEiLCJ0eXBlIiwiZG9jcyIsInVybCIsImZpeGFibGUiLCJzY2hlbWEiLCJwcm9wZXJ0aWVzIiwiY29tbW9uanMiLCJub1VzZWxlc3NJbmRleCIsImFkZGl0aW9uYWxQcm9wZXJ0aWVzIiwiY3JlYXRlIiwiY29udGV4dCIsImN1cnJlbnREaXIiLCJkaXJuYW1lIiwiZ2V0RmlsZW5hbWUiLCJvcHRpb25zIiwiY2hlY2tTb3VyY2VWYWx1ZSIsInNvdXJjZSIsImltcG9ydFBhdGgiLCJ2YWx1ZSIsInJlcG9ydFdpdGhQcm9wb3NlZFBhdGgiLCJwcm9wb3NlZFBhdGgiLCJyZXBvcnQiLCJub2RlIiwibWVzc2FnZSIs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vcnRQYXRoUmVsYXRpdmVQYXJlbnRzICsgZGlmZikpXG4gICAgICAgICAgICAuam9pbignLycpXG4gICAgICAgIClcbiAgICAgIClcbiAgICB9XG5cbiAgICByZXR1cm4gbW9kdWxlVmlzaXRvcihjaGVja1NvdXJjZVZhbHVlLCBvcHRpb25zKVxuICB9LFxufVxuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/no-webpack-loader-syntax.js b/node_modules/eslint-plugin-import/lib/rules/no-webpack-loader-syntax.js new file mode 100644 index 000000000..df99f18a5 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/no-webpack-loader-syntax.js @@ -0,0 +1,33 @@ +'use strict';var _staticRequire = require('../core/staticRequire');var _staticRequire2 = _interopRequireDefault(_staticRequire); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +function reportIfNonStandard(context, node, name) { + if (name.indexOf('!') !== -1) { + context.report(node, `Unexpected '!' in '${name}'. ` + + 'Do not use import syntax to configure webpack loaders.'); + + } +} + +module.exports = { + meta: { + type: 'problem', + docs: { + url: (0, _docsUrl2.default)('no-webpack-loader-syntax') }, + + schema: [] }, + + + create: function (context) { + return { + ImportDeclaration: function handleImports(node) { + reportIfNonStandard(context, node, node.source.value); + }, + CallExpression: function handleRequires(node) { + if ((0, _staticRequire2.default)(node)) { + reportIfNonStandard(context, node, node.arguments[0].value); + } + } }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby13ZWJwYWNrLWxvYWRlci1zeW50YXguanMiXSwibmFtZXMiOlsicmVwb3J0SWZOb25TdGFuZGFyZCIsImNvbnRleHQiLCJub2RlIiwibmFtZSIsImluZGV4T2YiLCJyZXBvcnQiLCJtb2R1bGUiLCJleHBvcnRzIiwibWV0YSIsInR5cGUiLC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JlcG9ydElmTm9uU3RhbmRhcmQoY29udGV4dCwgbm9kZSwgbm9kZS5hcmd1bWVudHNbMF0udmFsdWUpXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgfVxuICB9LFxufVxuIl19 \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/order.js b/node_modules/eslint-plugin-import/lib/rules/order.js new file mode 100644 index 000000000..d3cd44217 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/order.js @@ -0,0 +1,686 @@ +'use strict';var _slicedToArray = function () {function sliceIterator(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"]) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}return function (arr, i) {if (Array.isArray(arr)) {return arr;} else if (Symbol.iterator in Object(arr)) {return sliceIterator(arr, i);} else {throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}(); + +var _minimatch = require('minimatch');var _minimatch2 = _interopRequireDefault(_minimatch); +var _importType = require('../core/importType');var _importType2 = _interopRequireDefault(_importType); +var _staticRequire = require('../core/staticRequire');var _staticRequire2 = _interopRequireDefault(_staticRequire); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +const defaultGroups = ['builtin', 'external', 'parent', 'sibling', 'index']; + +// REPORTING AND FIXING + +function reverse(array) { + return array.map(function (v) { + return Object.assign({}, v, { rank: -v.rank }); + }).reverse(); +} + +function getTokensOrCommentsAfter(sourceCode, node, count) { + let currentNodeOrToken = node; + const result = []; + for (let i = 0; i < count; i++) { + currentNodeOrToken = sourceCode.getTokenOrCommentAfter(currentNodeOrToken); + if (currentNodeOrToken == null) { + break; + } + result.push(currentNodeOrToken); + } + return result; +} + +function getTokensOrCommentsBefore(sourceCode, node, count) { + let currentNodeOrToken = node; + const result = []; + for (let i = 0; i < count; i++) { + currentNodeOrToken = sourceCode.getTokenOrCommentBefore(currentNodeOrToken); + if (currentNodeOrToken == null) { + break; + } + result.push(currentNodeOrToken); + } + return result.reverse(); +} + +function takeTokensAfterWhile(sourceCode, node, condition) { + const tokens = getTokensOrCommentsAfter(sourceCode, node, 100); + const result = []; + for (let i = 0; i < tokens.length; i++) { + if (condition(tokens[i])) { + result.push(tokens[i]); + } else + { + break; + } + } + return result; +} + +function takeTokensBeforeWhile(sourceCode, node, condition) { + const tokens = getTokensOrCommentsBefore(sourceCode, node, 100); + const result = []; + for (let i = tokens.length - 1; i >= 0; i--) { + if (condition(tokens[i])) { + result.push(tokens[i]); + } else + { + break; + } + } + return result.reverse(); +} + +function findOutOfOrder(imported) { + if (imported.length === 0) { + return []; + } + let maxSeenRankNode = imported[0]; + return imported.filter(function (importedModule) { + const res = importedModule.rank < maxSeenRankNode.rank; + if (maxSeenRankNode.rank < importedModule.rank) { + maxSeenRankNode = importedModule; + } + return res; + }); +} + +function findRootNode(node) { + let parent = node; + while (parent.parent != null && parent.parent.body == null) { + parent = parent.parent; + } + return parent; +} + +function findEndOfLineWithComments(sourceCode, node) { + const tokensToEndOfLine = takeTokensAfterWhile(sourceCode, node, commentOnSameLineAs(node)); + let endOfTokens = tokensToEndOfLine.length > 0 ? + tokensToEndOfLine[tokensToEndOfLine.length - 1].range[1] : + node.range[1]; + let result = endOfTokens; + for (let i = endOfTokens; i < sourceCode.text.length; i++) { + if (sourceCode.text[i] === '\n') { + result = i + 1; + break; + } + if (sourceCode.text[i] !== ' ' && sourceCode.text[i] !== '\t' && sourceCode.text[i] !== '\r') { + break; + } + result = i + 1; + } + return result; +} + +function commentOnSameLineAs(node) { + return token => (token.type === 'Block' || token.type === 'Line') && + token.loc.start.line === token.loc.end.line && + token.loc.end.line === node.loc.end.line; +} + +function findStartOfLineWithComments(sourceCode, node) { + const tokensToEndOfLine = takeTokensBeforeWhile(sourceCode, node, commentOnSameLineAs(node)); + let startOfTokens = tokensToEndOfLine.length > 0 ? tokensToEndOfLine[0].range[0] : node.range[0]; + let result = startOfTokens; + for (let i = startOfTokens - 1; i > 0; i--) { + if (sourceCode.text[i] !== ' ' && sourceCode.text[i] !== '\t') { + break; + } + result = i; + } + return result; +} + +function isPlainRequireModule(node) { + if (node.type !== 'VariableDeclaration') { + return false; + } + if (node.declarations.length !== 1) { + return false; + } + const decl = node.declarations[0]; + const result = decl.id && ( + decl.id.type === 'Identifier' || decl.id.type === 'ObjectPattern') && + decl.init != null && + decl.init.type === 'CallExpression' && + decl.init.callee != null && + decl.init.callee.name === 'require' && + decl.init.arguments != null && + decl.init.arguments.length === 1 && + decl.init.arguments[0].type === 'Literal'; + return result; +} + +function isPlainImportModule(node) { + return node.type === 'ImportDeclaration' && node.specifiers != null && node.specifiers.length > 0; +} + +function isPlainImportEquals(node) { + return node.type === 'TSImportEqualsDeclaration' && node.moduleReference.expression; +} + +function canCrossNodeWhileReorder(node) { + return isPlainRequireModule(node) || isPlainImportModule(node) || isPlainImportEquals(node); +} + +function canReorderItems(firstNode, secondNode) { + const parent = firstNode.parent;var _sort = + [ + parent.body.indexOf(firstNode), + parent.body.indexOf(secondNode)]. + sort(),_sort2 = _slicedToArray(_sort, 2);const firstIndex = _sort2[0],secondIndex = _sort2[1]; + const nodesBetween = parent.body.slice(firstIndex, secondIndex + 1); + for (var nodeBetween of nodesBetween) { + if (!canCrossNodeWhileReorder(nodeBetween)) { + return false; + } + } + return true; +} + +function fixOutOfOrder(context, firstNode, secondNode, order) { + const sourceCode = context.getSourceCode(); + + const firstRoot = findRootNode(firstNode.node); + const firstRootStart = findStartOfLineWithComments(sourceCode, firstRoot); + const firstRootEnd = findEndOfLineWithComments(sourceCode, firstRoot); + + const secondRoot = findRootNode(secondNode.node); + const secondRootStart = findStartOfLineWithComments(sourceCode, secondRoot); + const secondRootEnd = findEndOfLineWithComments(sourceCode, secondRoot); + const canFix = canReorderItems(firstRoot, secondRoot); + + let newCode = sourceCode.text.substring(secondRootStart, secondRootEnd); + if (newCode[newCode.length - 1] !== '\n') { + newCode = newCode + '\n'; + } + + const message = `\`${secondNode.displayName}\` import should occur ${order} import of \`${firstNode.displayName}\``; + + if (order === 'before') { + context.report({ + node: secondNode.node, + message: message, + fix: canFix && (fixer => + fixer.replaceTextRange( + [firstRootStart, secondRootEnd], + newCode + sourceCode.text.substring(firstRootStart, secondRootStart))) }); + + + } else if (order === 'after') { + context.report({ + node: secondNode.node, + message: message, + fix: canFix && (fixer => + fixer.replaceTextRange( + [secondRootStart, firstRootEnd], + sourceCode.text.substring(secondRootEnd, firstRootEnd) + newCode)) }); + + + } +} + +function reportOutOfOrder(context, imported, outOfOrder, order) { + outOfOrder.forEach(function (imp) { + const found = imported.find(function hasHigherRank(importedItem) { + return importedItem.rank > imp.rank; + }); + fixOutOfOrder(context, found, imp, order); + }); +} + +function makeOutOfOrderReport(context, imported) { + const outOfOrder = findOutOfOrder(imported); + if (!outOfOrder.length) { + return; + } + // There are things to report. Try to minimize the number of reported errors. + const reversedImported = reverse(imported); + const reversedOrder = findOutOfOrder(reversedImported); + if (reversedOrder.length < outOfOrder.length) { + reportOutOfOrder(context, reversedImported, reversedOrder, 'after'); + return; + } + reportOutOfOrder(context, imported, outOfOrder, 'before'); +} + +function getSorter(ascending) { + const multiplier = ascending ? 1 : -1; + + return function importsSorter(importA, importB) { + let result; + + if (importA < importB) { + result = -1; + } else if (importA > importB) { + result = 1; + } else { + result = 0; + } + + return result * multiplier; + }; +} + +function mutateRanksToAlphabetize(imported, alphabetizeOptions) { + const groupedByRanks = imported.reduce(function (acc, importedItem) { + if (!Array.isArray(acc[importedItem.rank])) { + acc[importedItem.rank] = []; + } + acc[importedItem.rank].push(importedItem.value); + return acc; + }, {}); + + const groupRanks = Object.keys(groupedByRanks); + + const sorterFn = getSorter(alphabetizeOptions.order === 'asc'); + const comparator = alphabetizeOptions.caseInsensitive ? (a, b) => sorterFn(String(a).toLowerCase(), String(b).toLowerCase()) : (a, b) => sorterFn(a, b); + // sort imports locally within their group + groupRanks.forEach(function (groupRank) { + groupedByRanks[groupRank].sort(comparator); + }); + + // assign globally unique rank to each import + let newRank = 0; + const alphabetizedRanks = groupRanks.sort().reduce(function (acc, groupRank) { + groupedByRanks[groupRank].forEach(function (importedItemName) { + acc[importedItemName] = parseInt(groupRank, 10) + newRank; + newRank += 1; + }); + return acc; + }, {}); + + // mutate the original group-rank with alphabetized-rank + imported.forEach(function (importedItem) { + importedItem.rank = alphabetizedRanks[importedItem.value]; + }); +} + +// DETECTING + +function computePathRank(ranks, pathGroups, path, maxPosition) { + for (let i = 0, l = pathGroups.length; i < l; i++) {var _pathGroups$i = + pathGroups[i];const pattern = _pathGroups$i.pattern,patternOptions = _pathGroups$i.patternOptions,group = _pathGroups$i.group;var _pathGroups$i$positio = _pathGroups$i.position;const position = _pathGroups$i$positio === undefined ? 1 : _pathGroups$i$positio; + if ((0, _minimatch2.default)(path, pattern, patternOptions || { nocomment: true })) { + return ranks[group] + position / maxPosition; + } + } +} + +function computeRank(context, ranks, importEntry, excludedImportTypes) { + let impType; + let rank; + if (importEntry.type === 'import:object') { + impType = 'object'; + } else { + impType = (0, _importType2.default)(importEntry.value, context); + } + if (!excludedImportTypes.has(impType)) { + rank = computePathRank(ranks.groups, ranks.pathGroups, importEntry.value, ranks.maxPosition); + } + if (typeof rank === 'undefined') { + rank = ranks.groups[impType]; + } + if (importEntry.type !== 'import' && !importEntry.type.startsWith('import:')) { + rank += 100; + } + + return rank; +} + +function registerNode(context, importEntry, ranks, imported, excludedImportTypes) { + const rank = computeRank(context, ranks, importEntry, excludedImportTypes); + if (rank !== -1) { + imported.push(Object.assign({}, importEntry, { rank })); + } +} + +function isInVariableDeclarator(node) { + return node && ( + node.type === 'VariableDeclarator' || isInVariableDeclarator(node.parent)); +} + +const types = ['builtin', 'external', 'internal', 'unknown', 'parent', 'sibling', 'index', 'object']; + +// Creates an object with type-rank pairs. +// Example: { index: 0, sibling: 1, parent: 1, external: 1, builtin: 2, internal: 2 } +// Will throw an error if it contains a type that does not exist, or has a duplicate +function convertGroupsToRanks(groups) { + const rankObject = groups.reduce(function (res, group, index) { + if (typeof group === 'string') { + group = [group]; + } + group.forEach(function (groupItem) { + if (types.indexOf(groupItem) === -1) { + throw new Error('Incorrect configuration of the rule: Unknown type `' + + JSON.stringify(groupItem) + '`'); + } + if (res[groupItem] !== undefined) { + throw new Error('Incorrect configuration of the rule: `' + groupItem + '` is duplicated'); + } + res[groupItem] = index; + }); + return res; + }, {}); + + const omittedTypes = types.filter(function (type) { + return rankObject[type] === undefined; + }); + + return omittedTypes.reduce(function (res, type) { + res[type] = groups.length; + return res; + }, rankObject); +} + +function convertPathGroupsForRanks(pathGroups) { + const after = {}; + const before = {}; + + const transformed = pathGroups.map((pathGroup, index) => {const + group = pathGroup.group,positionString = pathGroup.position; + let position = 0; + if (positionString === 'after') { + if (!after[group]) { + after[group] = 1; + } + position = after[group]++; + } else if (positionString === 'before') { + if (!before[group]) { + before[group] = []; + } + before[group].push(index); + } + + return Object.assign({}, pathGroup, { position }); + }); + + let maxPosition = 1; + + Object.keys(before).forEach(group => { + const groupLength = before[group].length; + before[group].forEach((groupIndex, index) => { + transformed[groupIndex].position = -1 * (groupLength - index); + }); + maxPosition = Math.max(maxPosition, groupLength); + }); + + Object.keys(after).forEach(key => { + const groupNextPosition = after[key]; + maxPosition = Math.max(maxPosition, groupNextPosition - 1); + }); + + return { + pathGroups: transformed, + maxPosition: maxPosition > 10 ? Math.pow(10, Math.ceil(Math.log10(maxPosition))) : 10 }; + +} + +function fixNewLineAfterImport(context, previousImport) { + const prevRoot = findRootNode(previousImport.node); + const tokensToEndOfLine = takeTokensAfterWhile( + context.getSourceCode(), prevRoot, commentOnSameLineAs(prevRoot)); + + let endOfLine = prevRoot.range[1]; + if (tokensToEndOfLine.length > 0) { + endOfLine = tokensToEndOfLine[tokensToEndOfLine.length - 1].range[1]; + } + return fixer => fixer.insertTextAfterRange([prevRoot.range[0], endOfLine], '\n'); +} + +function removeNewLineAfterImport(context, currentImport, previousImport) { + const sourceCode = context.getSourceCode(); + const prevRoot = findRootNode(previousImport.node); + const currRoot = findRootNode(currentImport.node); + const rangeToRemove = [ + findEndOfLineWithComments(sourceCode, prevRoot), + findStartOfLineWithComments(sourceCode, currRoot)]; + + if (/^\s*$/.test(sourceCode.text.substring(rangeToRemove[0], rangeToRemove[1]))) { + return fixer => fixer.removeRange(rangeToRemove); + } + return undefined; +} + +function makeNewlinesBetweenReport(context, imported, newlinesBetweenImports) { + const getNumberOfEmptyLinesBetween = (currentImport, previousImport) => { + const linesBetweenImports = context.getSourceCode().lines.slice( + previousImport.node.loc.end.line, + currentImport.node.loc.start.line - 1); + + + return linesBetweenImports.filter(line => !line.trim().length).length; + }; + let previousImport = imported[0]; + + imported.slice(1).forEach(function (currentImport) { + const emptyLinesBetween = getNumberOfEmptyLinesBetween(currentImport, previousImport); + + if (newlinesBetweenImports === 'always' || + newlinesBetweenImports === 'always-and-inside-groups') { + if (currentImport.rank !== previousImport.rank && emptyLinesBetween === 0) { + context.report({ + node: previousImport.node, + message: 'There should be at least one empty line between import groups', + fix: fixNewLineAfterImport(context, previousImport) }); + + } else if (currentImport.rank === previousImport.rank && + emptyLinesBetween > 0 && + newlinesBetweenImports !== 'always-and-inside-groups') { + context.report({ + node: previousImport.node, + message: 'There should be no empty line within import group', + fix: removeNewLineAfterImport(context, currentImport, previousImport) }); + + } + } else if (emptyLinesBetween > 0) { + context.report({ + node: previousImport.node, + message: 'There should be no empty line between import groups', + fix: removeNewLineAfterImport(context, currentImport, previousImport) }); + + } + + previousImport = currentImport; + }); +} + +function getAlphabetizeConfig(options) { + const alphabetize = options.alphabetize || {}; + const order = alphabetize.order || 'ignore'; + const caseInsensitive = alphabetize.caseInsensitive || false; + + return { order, caseInsensitive }; +} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('order') }, + + + fixable: 'code', + schema: [ + { + type: 'object', + properties: { + groups: { + type: 'array' }, + + pathGroupsExcludedImportTypes: { + type: 'array' }, + + pathGroups: { + type: 'array', + items: { + type: 'object', + properties: { + pattern: { + type: 'string' }, + + patternOptions: { + type: 'object' }, + + group: { + type: 'string', + enum: types }, + + position: { + type: 'string', + enum: ['after', 'before'] } }, + + + required: ['pattern', 'group'] } }, + + + 'newlines-between': { + enum: [ + 'ignore', + 'always', + 'always-and-inside-groups', + 'never'] }, + + + alphabetize: { + type: 'object', + properties: { + caseInsensitive: { + type: 'boolean', + default: false }, + + order: { + enum: ['ignore', 'asc', 'desc'], + default: 'ignore' } }, + + + additionalProperties: false } }, + + + additionalProperties: false }] }, + + + + + create: function importOrderRule(context) { + const options = context.options[0] || {}; + const newlinesBetweenImports = options['newlines-between'] || 'ignore'; + const pathGroupsExcludedImportTypes = new Set(options['pathGroupsExcludedImportTypes'] || ['builtin', 'external', 'object']); + const alphabetize = getAlphabetizeConfig(options); + let ranks; + + try {var _convertPathGroupsFor = + convertPathGroupsForRanks(options.pathGroups || []);const pathGroups = _convertPathGroupsFor.pathGroups,maxPosition = _convertPathGroupsFor.maxPosition; + ranks = { + groups: convertGroupsToRanks(options.groups || defaultGroups), + pathGroups, + maxPosition }; + + } catch (error) { + // Malformed configuration + return { + Program: function (node) { + context.report(node, error.message); + } }; + + } + let imported = []; + let level = 0; + + function incrementLevel() { + level++; + } + function decrementLevel() { + level--; + } + + return { + ImportDeclaration: function handleImports(node) { + if (node.specifiers.length) {// Ignoring unassigned imports + const name = node.source.value; + registerNode( + context, + { + node, + value: name, + displayName: name, + type: 'import' }, + + ranks, + imported, + pathGroupsExcludedImportTypes); + + } + }, + TSImportEqualsDeclaration: function handleImports(node) { + let displayName; + let value; + let type; + // skip "export import"s + if (node.isExport) { + return; + } + if (node.moduleReference.type === 'TSExternalModuleReference') { + value = node.moduleReference.expression.value; + displayName = value; + type = 'import'; + } else { + value = ''; + displayName = context.getSourceCode().getText(node.moduleReference); + type = 'import:object'; + } + registerNode( + context, + { + node, + value, + displayName, + type }, + + ranks, + imported, + pathGroupsExcludedImportTypes); + + }, + CallExpression: function handleRequires(node) { + if (level !== 0 || !(0, _staticRequire2.default)(node) || !isInVariableDeclarator(node.parent)) { + return; + } + const name = node.arguments[0].value; + registerNode( + context, + { + node, + value: name, + displayName: name, + type: 'require' }, + + ranks, + imported, + pathGroupsExcludedImportTypes); + + }, + 'Program:exit': function reportAndReset() { + if (newlinesBetweenImports !== 'ignore') { + makeNewlinesBetweenReport(context, imported, newlinesBetweenImports); + } + + if (alphabetize.order !== 'ignore') { + mutateRanksToAlphabetize(imported, alphabetize); + } + + makeOutOfOrderReport(context, imported); + + imported = []; + }, + FunctionDeclaration: incrementLevel, + FunctionExpression: incrementLevel, + ArrowFunctionExpression: incrementLevel, + BlockStatement: incrementLevel, + ObjectExpression: incrementLevel, + 'FunctionDeclaration:exit': decrementLevel, + 'FunctionExpression:exit': decrementLevel, + 'ArrowFunctionExpression:exit': decrementLevel, + 'BlockStatement:exit': decrementLevel, + 'ObjectExpression:exit': decrementLevel }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9vcmRlci5qcyJdLCJuYW1lcyI6WyJkZWZhdWx0R3JvdXBzIiwicmV2ZXJzZSIsImFycmF5IiwibWFwIiwidiIsIk9iamVjdCIsImFzc2lnbiIsInJhbmsiLCJnZXRUb2tlbnNPckNvbW1lbnRzQWZ0ZXIiLCJzb3VyY2VDb2RlIiwibm9kZSIsImNvdW50IiwiY3VycmVudE5vZGVPclRva2VuIiwicmVzdWx0IiwiaSIsImdldFRva2VuT3JDb21tZW50QWZ0ZXIiLCJwdXNoIiwiZ2V0VG9rZW5zT3JDb21tZW50c0JlZm9yZSIsImdldFRva2VuT3JDb21tZW50QmVmb3JlIiwidGFrZVRva2Vuc0FmdGVyV2hpbGUiLCJjb25kaXRpb24iL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ge1xuICAgICAgICAgICAgICAgICAgdHlwZTogJ3N0cmluZycsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBwYXR0ZXJuT3B0aW9uczoge1xuICAgICAgICAgICAgICAgICAgdHlwZTogJ29iamVjdCcsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBncm91cDoge1xuICAgICAgICAgICAgICAgICAgdHlwZTogJ3N0cmluZycsXG4gICAgICAgICAgICAgICAgICBlbnVtOiB0eXBlcyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHBvc2l0aW9uOiB7XG4gICAgICAgICAgICAgICAgICB0eXBlOiAnc3RyaW5nJyxcbiAgICAgICAgICAgICAgICAgIGVudW06IFsnYWZ0ZXInLCAnYmVmb3JlJ10sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgcmVxdWlyZWQ6IFsncGF0dGVybicsICdncm91cCddLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICB9LFxuICAgICAgICAgICduZXdsaW5lcy1iZXR3ZWVuJzoge1xuICAgICAgICAgICAgZW51bTogW1xuICAgICAgICAgICAgICAnaWdub3JlJyxcbiAgICAgICAgICAgICAgJ2Fsd2F5cycsXG4gICAgICAgICAgICAgICdhbHdheXMtYW5kLWluc2lkZS1ncm91cHMnLFxuICAgICAgICAgICAgICAnbmV2ZXInLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgICB9LFxuICAgICAgICAgIGFscGhhYmV0aXplOiB7XG4gICAgICAgICAgICB0eXBlOiAnb2JqZWN0JyxcbiAgICAgICAgICAgIHByb3BlcnRpZXM6IHtcbiAgICAgICAgICAgICAgY2FzZUluc2Vuc2l0aXZlOiB7XG4gICAgICAgICAgICAgICAgdHlwZTogJ2Jvb2xlYW4nLFxuICAgICAgICAgICAgICAgIGRlZmF1bHQ6IGZhbHNlLFxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAg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ICAgICBwYXRoR3JvdXBzLFxuICAgICAgICBtYXhQb3NpdGlvbixcbiAgICAgIH1cbiAgICB9IGNhdGNoIChlcnJvcikge1xuICAgICAgLy8gTWFsZm9ybWVkIGNvbmZpZ3VyYXRpb25cbiAgICAgIHJldHVybiB7XG4gICAgICAgIFByb2dyYW06IGZ1bmN0aW9uKG5vZGUpIHtcbiAgICAgICAgICBjb250ZXh0LnJlcG9ydChub2RlLCBlcnJvci5tZXNzYWdlKVxuICAgICAgICB9LFxuICAgICAgfVxuICAgIH1cbiAgICBsZXQgaW1wb3J0ZWQgPSBbXVxuICAgIGxldCBsZXZlbCA9IDBcblxuICAgIGZ1bmN0aW9uIGluY3JlbWVudExldmVsKCkge1xuICAgICAgbGV2ZWwrK1xuICAgIH1cbiAgICBmdW5jdGlvbiBkZWNyZW1lbnRMZXZlbCgpIHtcbiAgICAgIGxldmVsLS1cbiAgICB9XG5cbiAgICByZXR1cm4ge1xuICAgICAgSW1wb3J0RGVjbGFyYXRpb246IGZ1bmN0aW9uIGhhbmRsZUltcG9ydHMobm9kZSkge1xuICAgICAgICBpZiAobm9kZS5zcGVjaWZpZXJzLmxlbmd0aCkgeyAvLyBJZ25vcmluZyB1bmFzc2lnbmVkIGltcG9ydHNcbiAgICAgICAgICBjb25zdCBuYW1lID0gbm9kZS5zb3VyY2UudmFsdWVcbiAgICAgICAgICByZWdpc3Rlck5vZGUoXG4gICAgICAgICAgICBjb250ZXh0LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICB2YWx1ZTogbmFtZSxcbiAgICAgICAgICAgICAgZGlzcGxheU5hbWU6IG5hbWUsXG4gICAgICAgICAgICAgIHR5cGU6ICdpbXBvcnQnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHJhbmtzLFxuICAgICAgICAgICAgaW1wb3J0ZWQsXG4gICAgICAgICAgICBwYXRoR3JvdXBzRXhjbHVkZWRJbXBvcnRUeXBlc1xuICAgICAgICAgIClcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIFRTSW1wb3J0RXF1YWxzRGVjbGFyYXRpb246IGZ1bmN0aW9uIGhhbmRsZUltcG9ydHMobm9kZSkge1xuICAgICAgICBsZXQgZGlzcGxheU5hbWVcbiAgICAgICAgbGV0IHZhbHVlXG4gICAgICAgIGxldCB0eXBlXG4gICAgICAgIC8vIHNraXAgXCJleHBvcnQgaW1wb3J0XCJzXG4gICAgICAgIGlmIChub2RlLmlzRXhwb3J0KSB7XG4gICAgICAgICAgcmV0dXJuXG4gICAgICAgIH1cbiAgICAgICAgaWYgKG5vZGUubW9kdWxlUmVmZXJlbmNlLnR5cGUgPT09ICdUU0V4dGVybmFsTW9kdWxlUmVmZXJlbmNlJykge1xuICAgICAgICAgIHZhbHVlID0gbm9kZS5tb2R1bGVSZWZlcmVuY2UuZXhwcmVzc2lvbi52YWx1ZVxuICAgICAgICAgIGRpc3BsYXlOYW1lID0gdmFsdWVcbiAgICAgICAgICB0eXBlID0gJ2ltcG9ydCdcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB2YWx1ZSA9ICcnXG4gICAgICAgICAgZGlzcGxheU5hbWUgPSBjb250ZXh0LmdldFNvdXJjZUNvZGUoKS5nZXRUZXh0KG5vZGUubW9kdWxlUmVmZXJlbmNlKVxuICAgICAgICAgIHR5cGUgPSAnaW1wb3J0Om9iamVjdCdcbiAgICAgICAgfVxuICAgICAgICByZWdpc3Rlck5vZGUoXG4gICAgICAgICAgY29udGV4dCxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgdmFsdWUsXG4gICAgICAgICAgICBkaXNwbGF5TmFtZSxcbiAgICAgICAgICAgIHR5cGUsXG4gICAgICAgICAgfSxcbiAgICAgICAgICByYW5rcyxcbiAgICAgICAgICBpbXBvcnRlZCxcbiAgICAgICAgICBwYXRoR3JvdXBzRXhjbHVkZWRJbXBvcnRUeXBlc1xuICAgICAgICApXG4gICAgICB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rZU91dE9mT3JkZXJSZXBvcnQoY29udGV4dCwgaW1wb3J0ZWQpXG5cbiAgICAgICAgaW1wb3J0ZWQgPSBbXVxuICAgICAgfSxcbiAgICAgIEZ1bmN0aW9uRGVjbGFyYXRpb246IGluY3JlbWVudExldmVsLFxuICAgICAgRnVuY3Rpb25FeHByZXNzaW9uOiBpbmNyZW1lbnRMZXZlbCxcbiAgICAgIEFycm93RnVuY3Rpb25FeHByZXNzaW9uOiBpbmNyZW1lbnRMZXZlbCxcbiAgICAgIEJsb2NrU3RhdGVtZW50OiBpbmNyZW1lbnRMZXZlbCxcbiAgICAgIE9iamVjdEV4cHJlc3Npb246IGluY3JlbWVudExldmVsLFxuICAgICAgJ0Z1bmN0aW9uRGVjbGFyYXRpb246ZXhpdCc6IGRlY3JlbWVudExldmVsLFxuICAgICAgJ0Z1bmN0aW9uRXhwcmVzc2lvbjpleGl0JzogZGVjcmVtZW50TGV2ZWwsXG4gICAgICAnQXJyb3dGdW5jdGlvbkV4cHJlc3Npb246ZXhpdCc6IGRlY3JlbWVudExldmVsLFxuICAgICAgJ0Jsb2NrU3RhdGVtZW50OmV4aXQnOiBkZWNyZW1lbnRMZXZlbCxcbiAgICAgICdPYmplY3RFeHByZXNzaW9uOmV4aXQnOiBkZWNyZW1lbnRMZXZlbCxcbiAgICB9XG4gIH0sXG59XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/prefer-default-export.js b/node_modules/eslint-plugin-import/lib/rules/prefer-default-export.js new file mode 100644 index 000000000..da0c31ee2 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/prefer-default-export.js @@ -0,0 +1,96 @@ +'use strict'; + +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +module.exports = { + meta: { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('prefer-default-export') }, + + schema: [] }, + + + create: function (context) { + let specifierExportCount = 0; + let hasDefaultExport = false; + let hasStarExport = false; + let hasTypeExport = false; + let namedExportNode = null; + + function captureDeclaration(identifierOrPattern) { + if (identifierOrPattern.type === 'ObjectPattern') { + // recursively capture + identifierOrPattern.properties. + forEach(function (property) { + captureDeclaration(property.value); + }); + } else if (identifierOrPattern.type === 'ArrayPattern') { + identifierOrPattern.elements. + forEach(captureDeclaration); + } else { + // assume it's a single standard identifier + specifierExportCount++; + } + } + + return { + 'ExportDefaultSpecifier': function () { + hasDefaultExport = true; + }, + + 'ExportSpecifier': function (node) { + if (node.exported.name === 'default') { + hasDefaultExport = true; + } else { + specifierExportCount++; + namedExportNode = node; + } + }, + + 'ExportNamedDeclaration': function (node) { + // if there are specifiers, node.declaration should be null + if (!node.declaration) return;const + + type = node.declaration.type; + + if ( + type === 'TSTypeAliasDeclaration' || + type === 'TypeAlias' || + type === 'TSInterfaceDeclaration' || + type === 'InterfaceDeclaration') + { + specifierExportCount++; + hasTypeExport = true; + return; + } + + if (node.declaration.declarations) { + node.declaration.declarations.forEach(function (declaration) { + captureDeclaration(declaration.id); + }); + } else + { + // captures 'export function foo() {}' syntax + specifierExportCount++; + } + + namedExportNode = node; + }, + + 'ExportDefaultDeclaration': function () { + hasDefaultExport = true; + }, + + 'ExportAllDeclaration': function () { + hasStarExport = true; + }, + + 'Program:exit': function () { + if (specifierExportCount === 1 && !hasDefaultExport && !hasStarExport && !hasTypeExport) { + context.report(namedExportNode, 'Prefer default export.'); + } + } }; + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9wcmVmZXItZGVmYXVsdC1leHBvcnQuanMiXSwibmFtZXMiOlsibW9kdWxlIiwiZXhwb3J0cyIsIm1ldGEiLCJ0eXBlIiwiZG9jcyIsInVybCIsInNjaGVtYSIsImNyZWF0ZSIsImNvbnRleHQiLCJzcGVjaWZpZXJFeHBvcnRDb3VudCIsImhhc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4cG9ydCA9IHRydWVcbiAgICAgIH0sXG5cbiAgICAgICdFeHBvcnRBbGxEZWNsYXJhdGlvbic6IGZ1bmN0aW9uKCkge1xuICAgICAgICBoYXNTdGFyRXhwb3J0ID0gdHJ1ZVxuICAgICAgfSxcblxuICAgICAgJ1Byb2dyYW06ZXhpdCc6IGZ1bmN0aW9uKCkge1xuICAgICAgICBpZiAoc3BlY2lmaWVyRXhwb3J0Q291bnQgPT09IDEgJiYgIWhhc0RlZmF1bHRFeHBvcnQgJiYgIWhhc1N0YXJFeHBvcnQgJiYgIWhhc1R5cGVFeHBvcnQpIHtcbiAgICAgICAgICBjb250ZXh0LnJlcG9ydChuYW1lZEV4cG9ydE5vZGUsICdQcmVmZXIgZGVmYXVsdCBleHBvcnQuJylcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICB9XG4gIH0sXG59XG4iXX0= \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/lib/rules/unambiguous.js b/node_modules/eslint-plugin-import/lib/rules/unambiguous.js new file mode 100644 index 000000000..68a12f845 --- /dev/null +++ b/node_modules/eslint-plugin-import/lib/rules/unambiguous.js @@ -0,0 +1,36 @@ +'use strict'; + + + + +var _unambiguous = require('eslint-module-utils/unambiguous'); +var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} /** + * @fileOverview Report modules that could parse incorrectly as scripts. + * @author Ben Mosher + */module.exports = { meta: { + type: 'suggestion', + docs: { + url: (0, _docsUrl2.default)('unambiguous') }, + + schema: [] }, + + + create: function (context) { + // ignore non-modules + if (context.parserOptions.sourceType !== 'module') { + return {}; + } + + return { + Program: function (ast) { + if (!(0, _unambiguous.isModule)(ast)) { + context.report({ + node: ast, + message: 'This module could be parsed as a valid script.' }); + + } + } }; + + + } }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3Ny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sZSB9IGZyb20gJ2VzbGludC1tb2R1bGUtdXRpbHMvdW5hbWJpZ3VvdXMnXG5pbXBvcnQgZG9jc1VybCBmcm9tICcuLi9kb2NzVXJsJ1xuXG5tb2R1bGUuZXhwb3J0cyA9IHtcbiAgbWV0YToge1xuICAgIHR5cGU6ICdzdWdnZXN0aW9uJyxcbiAgICBkb2NzOiB7XG4gICAgICB1cmw6IGRvY3NVcmwoJ3VuYW1iaWd1b3VzJyksXG4gICAgfSxcbiAgICBzY2hlbWE6IFtdLFxuICB9LFxuXG4gIGNyZWF0ZTogZnVuY3Rpb24gKGNvbnRleHQpIHtcbiAgICAvLyBpZ25vcmUgbm9uLW1vZHVsZXNcbiAgICBpZiAoY29udGV4dC5wYXJzZXJPcHRpb25zLnNvdXJjZVR5cGUgIT09ICdtb2R1bGUnKSB7XG4gICAgICByZXR1cm4ge31cbiAgICB9XG5cbiAgICByZXR1cm4ge1xuICAgICAgUHJvZ3JhbTogZnVuY3Rpb24gKGFzdCkge1xuICAgICAgICBpZiAoIWlzTW9kdWxlKGFzdCkpIHtcbiAgICAgICAgICBjb250ZXh0LnJlcG9ydCh7XG4gICAgICAgICAgICBub2RlOiBhc3QsXG4gICAgICAgICAgICBtZXNzYWdlOiAnVGhpcyBtb2R1bGUgY291bGQgYmUgcGFyc2VkIGFzIGEgdmFsaWQgc2NyaXB0LicsXG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICB9XG5cbiAgfSxcbn1cbiJdfQ== \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/memo-parser/LICENSE b/node_modules/eslint-plugin-import/memo-parser/LICENSE new file mode 100644 index 000000000..c6ade2a43 --- /dev/null +++ b/node_modules/eslint-plugin-import/memo-parser/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Ben Mosher + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/eslint-plugin-import/memo-parser/README.md b/node_modules/eslint-plugin-import/memo-parser/README.md new file mode 100644 index 000000000..8a2a3cb5c --- /dev/null +++ b/node_modules/eslint-plugin-import/memo-parser/README.md @@ -0,0 +1,23 @@ +# eslint-plugin-import/memo-parser + + +## NOTE! + +This used to improve performance, but as of ESLint 5 and v2 of this plugin, it seems to just consume a bunch of memory and slightly increase lint times. + +**Not recommended for use at this time!** + + +This parser is just a memoizing wrapper around some actual parser. + +To configure, just add your _actual_ parser to the `parserOptions`, like so: + +```yaml +parser: eslint-plugin-import/memo-parser +# parser: babel-eslint + +parserOptions: + parser: babel-eslint + sourceType: module + ecmaVersion: 6 +``` diff --git a/node_modules/eslint-plugin-import/memo-parser/index.js b/node_modules/eslint-plugin-import/memo-parser/index.js new file mode 100644 index 000000000..b64f85421 --- /dev/null +++ b/node_modules/eslint-plugin-import/memo-parser/index.js @@ -0,0 +1,41 @@ +'use strict' + +const crypto = require('crypto') + , moduleRequire = require('eslint-module-utils/module-require').default + , hashObject = require('eslint-module-utils/hash').hashObject + +const cache = new Map() + +// must match ESLint default options or we'll miss the cache every time +const parserOptions = { + loc: true, + range: true, + raw: true, + tokens: true, + comment: true, + attachComment: true, +} + +exports.parse = function parse(content, options) { + options = Object.assign({}, options, parserOptions) + + if (!options.filePath) { + throw new Error('no file path provided!') + } + + const keyHash = crypto.createHash('sha256') + keyHash.update(content) + hashObject(options, keyHash) + + const key = keyHash.digest('hex') + + let ast = cache.get(key) + if (ast != null) return ast + + const realParser = moduleRequire(options.parser) + + ast = realParser.parse(content, options) + cache.set(key, ast) + + return ast +} diff --git a/node_modules/eslint-plugin-import/memo-parser/package.json b/node_modules/eslint-plugin-import/memo-parser/package.json new file mode 100644 index 000000000..d101752ed --- /dev/null +++ b/node_modules/eslint-plugin-import/memo-parser/package.json @@ -0,0 +1,34 @@ +{ + "name": "memo-parser", + "version": "0.2.1", + "engines": { + "node": ">=4" + }, + "description": "Memoizing wrapper for any ESLint-compatible parser module.", + "main": "index.js", + "scripts": { + "prepublishOnly": "cp ../{LICENSE,.npmrc} ./", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/benmosher/eslint-plugin-import.git" + }, + "keywords": [ + "eslint", + "eslint-plugin-import", + "parser" + ], + "author": "Ben Mosher (me@benmosher.com)", + "license": "MIT", + "bugs": { + "url": "https://github.com/benmosher/eslint-plugin-import/issues" + }, + "homepage": "https://github.com/benmosher/eslint-plugin-import#readme", + "peerDependencies": { + "eslint": ">=3.5.0" + }, + "dependencies": { + "eslint-module-utils": "^2.5.0" + } +} \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/node_modules/debug/.coveralls.yml b/node_modules/eslint-plugin-import/node_modules/debug/.coveralls.yml new file mode 100644 index 000000000..20a706858 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/.coveralls.yml @@ -0,0 +1 @@ +repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve diff --git a/node_modules/eslint-plugin-import/node_modules/debug/.eslintrc b/node_modules/eslint-plugin-import/node_modules/debug/.eslintrc new file mode 100644 index 000000000..8a37ae2c2 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/.eslintrc @@ -0,0 +1,11 @@ +{ + "env": { + "browser": true, + "node": true + }, + "rules": { + "no-console": 0, + "no-empty": [1, { "allowEmptyCatch": true }] + }, + "extends": "eslint:recommended" +} diff --git a/node_modules/eslint-plugin-import/node_modules/debug/.npmignore b/node_modules/eslint-plugin-import/node_modules/debug/.npmignore new file mode 100644 index 000000000..5f60eecc8 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/.npmignore @@ -0,0 +1,9 @@ +support +test +examples +example +*.sock +dist +yarn.lock +coverage +bower.json diff --git a/node_modules/eslint-plugin-import/node_modules/debug/.travis.yml b/node_modules/eslint-plugin-import/node_modules/debug/.travis.yml new file mode 100644 index 000000000..6c6090c3b --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/.travis.yml @@ -0,0 +1,14 @@ + +language: node_js +node_js: + - "6" + - "5" + - "4" + +install: + - make node_modules + +script: + - make lint + - make test + - make coveralls diff --git a/node_modules/eslint-plugin-import/node_modules/debug/CHANGELOG.md b/node_modules/eslint-plugin-import/node_modules/debug/CHANGELOG.md new file mode 100644 index 000000000..eadaa1895 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/CHANGELOG.md @@ -0,0 +1,362 @@ + +2.6.9 / 2017-09-22 +================== + + * remove ReDoS regexp in %o formatter (#504) + +2.6.8 / 2017-05-18 +================== + + * Fix: Check for undefined on browser globals (#462, @marbemac) + +2.6.7 / 2017-05-16 +================== + + * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom) + * Fix: Inline extend function in node implementation (#452, @dougwilson) + * Docs: Fix typo (#455, @msasad) + +2.6.5 / 2017-04-27 +================== + + * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek) + * Misc: clean up browser reference checks (#447, @thebigredgeek) + * Misc: add npm-debug.log to .gitignore (@thebigredgeek) + + +2.6.4 / 2017-04-20 +================== + + * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo) + * Chore: ignore bower.json in npm installations. (#437, @joaovieira) + * Misc: update "ms" to v0.7.3 (@tootallnate) + +2.6.3 / 2017-03-13 +================== + + * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts) + * Docs: Changelog fix (@thebigredgeek) + +2.6.2 / 2017-03-10 +================== + + * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin) + * Docs: Add backers and sponsors from Open Collective (#422, @piamancini) + * Docs: Add Slackin invite badge (@tootallnate) + +2.6.1 / 2017-02-10 +================== + + * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error + * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0) + * Fix: IE8 "Expected identifier" error (#414, @vgoma) + * Fix: Namespaces would not disable once enabled (#409, @musikov) + +2.6.0 / 2016-12-28 +================== + + * Fix: added better null pointer checks for browser useColors (@thebigredgeek) + * Improvement: removed explicit `window.debug` export (#404, @tootallnate) + * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate) + +2.5.2 / 2016-12-25 +================== + + * Fix: reference error on window within webworkers (#393, @KlausTrainer) + * Docs: fixed README typo (#391, @lurch) + * Docs: added notice about v3 api discussion (@thebigredgeek) + +2.5.1 / 2016-12-20 +================== + + * Fix: babel-core compatibility + +2.5.0 / 2016-12-20 +================== + + * Fix: wrong reference in bower file (@thebigredgeek) + * Fix: webworker compatibility (@thebigredgeek) + * Fix: output formatting issue (#388, @kribblo) + * Fix: babel-loader compatibility (#383, @escwald) + * Misc: removed built asset from repo and publications (@thebigredgeek) + * Misc: moved source files to /src (#378, @yamikuronue) + * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue) + * Test: coveralls integration (#378, @yamikuronue) + * Docs: simplified language in the opening paragraph (#373, @yamikuronue) + +2.4.5 / 2016-12-17 +================== + + * Fix: `navigator` undefined in Rhino (#376, @jochenberger) + * Fix: custom log function (#379, @hsiliev) + * Improvement: bit of cleanup + linting fixes (@thebigredgeek) + * Improvement: rm non-maintainted `dist/` dir (#375, @freewil) + * Docs: simplified language in the opening paragraph. (#373, @yamikuronue) + +2.4.4 / 2016-12-14 +================== + + * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts) + +2.4.3 / 2016-12-14 +================== + + * Fix: navigation.userAgent error for react native (#364, @escwald) + +2.4.2 / 2016-12-14 +================== + + * Fix: browser colors (#367, @tootallnate) + * Misc: travis ci integration (@thebigredgeek) + * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek) + +2.4.1 / 2016-12-13 +================== + + * Fix: typo that broke the package (#356) + +2.4.0 / 2016-12-13 +================== + + * Fix: bower.json references unbuilt src entry point (#342, @justmatt) + * Fix: revert "handle regex special characters" (@tootallnate) + * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate) + * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate) + * Improvement: allow colors in workers (#335, @botverse) + * Improvement: use same color for same namespace. (#338, @lchenay) + +2.3.3 / 2016-11-09 +================== + + * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne) + * Fix: Returning `localStorage` saved values (#331, Levi Thomason) + * Improvement: Don't create an empty object when no `process` (Nathan Rajlich) + +2.3.2 / 2016-11-09 +================== + + * Fix: be super-safe in index.js as well (@TooTallNate) + * Fix: should check whether process exists (Tom Newby) + +2.3.1 / 2016-11-09 +================== + + * Fix: Added electron compatibility (#324, @paulcbetts) + * Improvement: Added performance optimizations (@tootallnate) + * Readme: Corrected PowerShell environment variable example (#252, @gimre) + * Misc: Removed yarn lock file from source control (#321, @fengmk2) + +2.3.0 / 2016-11-07 +================== + + * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic) + * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos) + * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15) + * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran) + * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom) + * Package: Update "ms" to 0.7.2 (#315, @DevSide) + * Package: removed superfluous version property from bower.json (#207 @kkirsche) + * Readme: fix USE_COLORS to DEBUG_COLORS + * Readme: Doc fixes for format string sugar (#269, @mlucool) + * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0) + * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable) + * Readme: better docs for browser support (#224, @matthewmueller) + * Tooling: Added yarn integration for development (#317, @thebigredgeek) + * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek) + * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman) + * Misc: Updated contributors (@thebigredgeek) + +2.2.0 / 2015-05-09 +================== + + * package: update "ms" to v0.7.1 (#202, @dougwilson) + * README: add logging to file example (#193, @DanielOchoa) + * README: fixed a typo (#191, @amir-s) + * browser: expose `storage` (#190, @stephenmathieson) + * Makefile: add a `distclean` target (#189, @stephenmathieson) + +2.1.3 / 2015-03-13 +================== + + * Updated stdout/stderr example (#186) + * Updated example/stdout.js to match debug current behaviour + * Renamed example/stderr.js to stdout.js + * Update Readme.md (#184) + * replace high intensity foreground color for bold (#182, #183) + +2.1.2 / 2015-03-01 +================== + + * dist: recompile + * update "ms" to v0.7.0 + * package: update "browserify" to v9.0.3 + * component: fix "ms.js" repo location + * changed bower package name + * updated documentation about using debug in a browser + * fix: security error on safari (#167, #168, @yields) + +2.1.1 / 2014-12-29 +================== + + * browser: use `typeof` to check for `console` existence + * browser: check for `console.log` truthiness (fix IE 8/9) + * browser: add support for Chrome apps + * Readme: added Windows usage remarks + * Add `bower.json` to properly support bower install + +2.1.0 / 2014-10-15 +================== + + * node: implement `DEBUG_FD` env variable support + * package: update "browserify" to v6.1.0 + * package: add "license" field to package.json (#135, @panuhorsmalahti) + +2.0.0 / 2014-09-01 +================== + + * package: update "browserify" to v5.11.0 + * node: use stderr rather than stdout for logging (#29, @stephenmathieson) + +1.0.4 / 2014-07-15 +================== + + * dist: recompile + * example: remove `console.info()` log usage + * example: add "Content-Type" UTF-8 header to browser example + * browser: place %c marker after the space character + * browser: reset the "content" color via `color: inherit` + * browser: add colors support for Firefox >= v31 + * debug: prefer an instance `log()` function over the global one (#119) + * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) + +1.0.3 / 2014-07-09 +================== + + * Add support for multiple wildcards in namespaces (#122, @seegno) + * browser: fix lint + +1.0.2 / 2014-06-10 +================== + + * browser: update color palette (#113, @gscottolson) + * common: make console logging function configurable (#108, @timoxley) + * node: fix %o colors on old node <= 0.8.x + * Makefile: find node path using shell/which (#109, @timoxley) + +1.0.1 / 2014-06-06 +================== + + * browser: use `removeItem()` to clear localStorage + * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) + * package: add "contributors" section + * node: fix comment typo + * README: list authors + +1.0.0 / 2014-06-04 +================== + + * make ms diff be global, not be scope + * debug: ignore empty strings in enable() + * node: make DEBUG_COLORS able to disable coloring + * *: export the `colors` array + * npmignore: don't publish the `dist` dir + * Makefile: refactor to use browserify + * package: add "browserify" as a dev dependency + * Readme: add Web Inspector Colors section + * node: reset terminal color for the debug content + * node: map "%o" to `util.inspect()` + * browser: map "%j" to `JSON.stringify()` + * debug: add custom "formatters" + * debug: use "ms" module for humanizing the diff + * Readme: add "bash" syntax highlighting + * browser: add Firebug color support + * browser: add colors for WebKit browsers + * node: apply log to `console` + * rewrite: abstract common logic for Node & browsers + * add .jshintrc file + +0.8.1 / 2014-04-14 +================== + + * package: re-add the "component" section + +0.8.0 / 2014-03-30 +================== + + * add `enable()` method for nodejs. Closes #27 + * change from stderr to stdout + * remove unnecessary index.js file + +0.7.4 / 2013-11-13 +================== + + * remove "browserify" key from package.json (fixes something in browserify) + +0.7.3 / 2013-10-30 +================== + + * fix: catch localStorage security error when cookies are blocked (Chrome) + * add debug(err) support. Closes #46 + * add .browser prop to package.json. Closes #42 + +0.7.2 / 2013-02-06 +================== + + * fix package.json + * fix: Mobile Safari (private mode) is broken with debug + * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript + +0.7.1 / 2013-02-05 +================== + + * add repository URL to package.json + * add DEBUG_COLORED to force colored output + * add browserify support + * fix component. Closes #24 + +0.7.0 / 2012-05-04 +================== + + * Added .component to package.json + * Added debug.component.js build + +0.6.0 / 2012-03-16 +================== + + * Added support for "-" prefix in DEBUG [Vinay Pulim] + * Added `.enabled` flag to the node version [TooTallNate] + +0.5.0 / 2012-02-02 +================== + + * Added: humanize diffs. Closes #8 + * Added `debug.disable()` to the CS variant + * Removed padding. Closes #10 + * Fixed: persist client-side variant again. Closes #9 + +0.4.0 / 2012-02-01 +================== + + * Added browser variant support for older browsers [TooTallNate] + * Added `debug.enable('project:*')` to browser variant [TooTallNate] + * Added padding to diff (moved it to the right) + +0.3.0 / 2012-01-26 +================== + + * Added millisecond diff when isatty, otherwise UTC string + +0.2.0 / 2012-01-22 +================== + + * Added wildcard support + +0.1.0 / 2011-12-02 +================== + + * Added: remove colors unless stderr isatty [TooTallNate] + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/eslint-plugin-import/node_modules/debug/LICENSE b/node_modules/eslint-plugin-import/node_modules/debug/LICENSE new file mode 100644 index 000000000..658c933d2 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/LICENSE @@ -0,0 +1,19 @@ +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the 'Software'), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/eslint-plugin-import/node_modules/debug/Makefile b/node_modules/eslint-plugin-import/node_modules/debug/Makefile new file mode 100644 index 000000000..584da8bf9 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/Makefile @@ -0,0 +1,50 @@ +# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 +THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) + +# BIN directory +BIN := $(THIS_DIR)/node_modules/.bin + +# Path +PATH := node_modules/.bin:$(PATH) +SHELL := /bin/bash + +# applications +NODE ?= $(shell which node) +YARN ?= $(shell which yarn) +PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm)) +BROWSERIFY ?= $(NODE) $(BIN)/browserify + +.FORCE: + +install: node_modules + +node_modules: package.json + @NODE_ENV= $(PKG) install + @touch node_modules + +lint: .FORCE + eslint browser.js debug.js index.js node.js + +test-node: .FORCE + istanbul cover node_modules/mocha/bin/_mocha -- test/**.js + +test-browser: .FORCE + mkdir -p dist + + @$(BROWSERIFY) \ + --standalone debug \ + . > dist/debug.js + + karma start --single-run + rimraf dist + +test: .FORCE + concurrently \ + "make test-node" \ + "make test-browser" + +coveralls: + cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js + +.PHONY: all install clean distclean diff --git a/node_modules/eslint-plugin-import/node_modules/debug/README.md b/node_modules/eslint-plugin-import/node_modules/debug/README.md new file mode 100644 index 000000000..f67be6b31 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/README.md @@ -0,0 +1,312 @@ +# debug +[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) +[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) + + + +A tiny node.js debugging utility modelled after node core's debugging technique. + +**Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)** + +## Installation + +```bash +$ npm install debug +``` + +## Usage + +`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. + +Example _app.js_: + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %s', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example _worker.js_: + +```js +var debug = require('debug')('worker'); + +setInterval(function(){ + debug('doing some work'); +}, 1000); +``` + + The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: + + ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) + + ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) + +#### Windows note + + On Windows the environment variable is set using the `set` command. + + ```cmd + set DEBUG=*,-not_this + ``` + + Note that PowerShell uses different syntax to set environment variables. + + ```cmd + $env:DEBUG = "*,-not_this" + ``` + +Then, run the program to be debugged as usual. + +## Millisecond diff + + When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) + + When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: + + ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) + +## Conventions + + If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". + +## Wildcards + + The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + + You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". + +## Environment Variables + + When running through Node.js, you can set a few environment variables that will + change the behavior of the debug logging: + +| Name | Purpose | +|-----------|-------------------------------------------------| +| `DEBUG` | Enables/disables specific debugging namespaces. | +| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | +| `DEBUG_DEPTH` | Object inspection depth. | +| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | + + + __Note:__ The environment variables beginning with `DEBUG_` end up being + converted into an Options object that gets used with `%o`/`%O` formatters. + See the Node.js documentation for + [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) + for the complete list. + +## Formatters + + + Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters: + +| Formatter | Representation | +|-----------|----------------| +| `%O` | Pretty-print an Object on multiple lines. | +| `%o` | Pretty-print an Object all on a single line. | +| `%s` | String. | +| `%d` | Number (both integer and float). | +| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | +| `%%` | Single percent sign ('%'). This does not consume an argument. | + +### Custom formatters + + You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like: + +```js +const createDebug = require('debug') +createDebug.formatters.h = (v) => { + return v.toString('hex') +} + +// …elsewhere +const debug = createDebug('foo') +debug('this is hex: %h', new Buffer('hello world')) +// foo this is hex: 68656c6c6f20776f726c6421 +0ms +``` + +## Browser support + You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), + or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), + if you don't want to build it yourself. + + Debug's enable state is currently persisted by `localStorage`. + Consider the situation shown below where you have `worker:a` and `worker:b`, + and wish to debug both. You can enable this using `localStorage.debug`: + +```js +localStorage.debug = 'worker:*' +``` + +And then refresh the page. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + +#### Web Inspector Colors + + Colors are also enabled on "Web Inspectors" that understand the `%c` formatting + option. These are WebKit web inspectors, Firefox ([since version + 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) + and the Firebug plugin for Firefox (any version). + + Colored output looks something like: + + ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) + + +## Output streams + + By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: + +Example _stdout.js_: + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + - Andrew Rhyne + +## Backers + +Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Sponsors + +Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## License + +(The MIT License) + +Copyright (c) 2014-2016 TJ Holowaychuk <tj@vision-media.ca> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/eslint-plugin-import/node_modules/debug/component.json b/node_modules/eslint-plugin-import/node_modules/debug/component.json new file mode 100644 index 000000000..9de26410f --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/component.json @@ -0,0 +1,19 @@ +{ + "name": "debug", + "repo": "visionmedia/debug", + "description": "small debugging utility", + "version": "2.6.9", + "keywords": [ + "debug", + "log", + "debugger" + ], + "main": "src/browser.js", + "scripts": [ + "src/browser.js", + "src/debug.js" + ], + "dependencies": { + "rauchg/ms.js": "0.7.1" + } +} diff --git a/node_modules/eslint-plugin-import/node_modules/debug/karma.conf.js b/node_modules/eslint-plugin-import/node_modules/debug/karma.conf.js new file mode 100644 index 000000000..103a82d15 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/karma.conf.js @@ -0,0 +1,70 @@ +// Karma configuration +// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC) + +module.exports = function(config) { + config.set({ + + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: '', + + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['mocha', 'chai', 'sinon'], + + + // list of files / patterns to load in the browser + files: [ + 'dist/debug.js', + 'test/*spec.js' + ], + + + // list of files to exclude + exclude: [ + 'src/node.js' + ], + + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + }, + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ['progress'], + + + // web server port + port: 9876, + + + // enable / disable colors in the output (reporters and logs) + colors: true, + + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: true, + + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: ['PhantomJS'], + + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: false, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: Infinity + }) +} diff --git a/node_modules/eslint-plugin-import/node_modules/debug/node.js b/node_modules/eslint-plugin-import/node_modules/debug/node.js new file mode 100644 index 000000000..7fc36fe6d --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/node.js @@ -0,0 +1 @@ +module.exports = require('./src/node'); diff --git a/node_modules/eslint-plugin-import/node_modules/debug/package.json b/node_modules/eslint-plugin-import/node_modules/debug/package.json new file mode 100644 index 000000000..0b1b9df8b --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/package.json @@ -0,0 +1,49 @@ +{ + "name": "debug", + "version": "2.6.9", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "description": "small debugging utility", + "keywords": [ + "debug", + "log", + "debugger" + ], + "author": "TJ Holowaychuk ", + "contributors": [ + "Nathan Rajlich (http://n8.io)", + "Andrew Rhyne " + ], + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + }, + "devDependencies": { + "browserify": "9.0.3", + "chai": "^3.5.0", + "concurrently": "^3.1.0", + "coveralls": "^2.11.15", + "eslint": "^3.12.1", + "istanbul": "^0.4.5", + "karma": "^1.3.0", + "karma-chai": "^0.1.0", + "karma-mocha": "^1.3.0", + "karma-phantomjs-launcher": "^1.0.2", + "karma-sinon": "^1.0.5", + "mocha": "^3.2.0", + "mocha-lcov-reporter": "^1.2.0", + "rimraf": "^2.5.4", + "sinon": "^1.17.6", + "sinon-chai": "^2.8.0" + }, + "main": "./src/index.js", + "browser": "./src/browser.js", + "component": { + "scripts": { + "debug/index.js": "browser.js", + "debug/debug.js": "debug.js" + } + } +} \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/node_modules/debug/src/browser.js b/node_modules/eslint-plugin-import/node_modules/debug/src/browser.js new file mode 100644 index 000000000..710692493 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/src/browser.js @@ -0,0 +1,185 @@ +/** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = 'undefined' != typeof chrome + && 'undefined' != typeof chrome.storage + ? chrome.storage.local + : localstorage(); + +/** + * Colors. + */ + +exports.colors = [ + 'lightseagreen', + 'forestgreen', + 'goldenrod', + 'dodgerblue', + 'darkorchid', + 'crimson' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { + return true; + } + + // is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +exports.formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (err) { + return '[UnexpectedJSONParseError]: ' + err.message; + } +}; + + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs(args) { + var useColors = this.useColors; + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); + + if (!useColors) return; + + var c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit') + + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); +} + +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + +function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + try { + if (null == namespaces) { + exports.storage.removeItem('debug'); + } else { + exports.storage.debug = namespaces; + } + } catch(e) {} +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + var r; + try { + r = exports.storage.debug; + } catch(e) {} + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; +} + +/** + * Enable namespaces listed in `localStorage.debug` initially. + */ + +exports.enable(load()); + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage() { + try { + return window.localStorage; + } catch (e) {} +} diff --git a/node_modules/eslint-plugin-import/node_modules/debug/src/debug.js b/node_modules/eslint-plugin-import/node_modules/debug/src/debug.js new file mode 100644 index 000000000..6a5e3fc94 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/src/debug.js @@ -0,0 +1,202 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; +exports.coerce = coerce; +exports.disable = disable; +exports.enable = enable; +exports.enabled = enabled; +exports.humanize = require('ms'); + +/** + * The currently active debug mode names, and names to skip. + */ + +exports.names = []; +exports.skips = []; + +/** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + +exports.formatters = {}; + +/** + * Previous log timestamp. + */ + +var prevTime; + +/** + * Select a color. + * @param {String} namespace + * @return {Number} + * @api private + */ + +function selectColor(namespace) { + var hash = 0, i; + + for (i in namespace) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return exports.colors[Math.abs(hash) % exports.colors.length]; +} + +/** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + +function createDebug(namespace) { + + function debug() { + // disabled? + if (!debug.enabled) return; + + var self = debug; + + // set `diff` timestamp + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // turn the `arguments` into a proper Array + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %O + args.unshift('%O'); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); + + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // apply env-specific formatting (colors, etc.) + exports.formatArgs.call(self, args); + + var logFn = debug.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.enabled = exports.enabled(namespace); + debug.useColors = exports.useColors(); + debug.color = selectColor(namespace); + + // env-specific initialization logic for debug instances + if ('function' === typeof exports.init) { + exports.init(debug); + } + + return debug; +} + +/** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + +function enable(namespaces) { + exports.save(namespaces); + + exports.names = []; + exports.skips = []; + + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; + + for (var i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } +} + +/** + * Disable debug output. + * + * @api public + */ + +function disable() { + exports.enable(''); +} + +/** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + +function enabled(name) { + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; +} + +/** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + +function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; +} diff --git a/node_modules/eslint-plugin-import/node_modules/debug/src/index.js b/node_modules/eslint-plugin-import/node_modules/debug/src/index.js new file mode 100644 index 000000000..e12cf4d58 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/src/index.js @@ -0,0 +1,10 @@ +/** + * Detect Electron renderer process, which is node, but we should + * treat as a browser. + */ + +if (typeof process !== 'undefined' && process.type === 'renderer') { + module.exports = require('./browser.js'); +} else { + module.exports = require('./node.js'); +} diff --git a/node_modules/eslint-plugin-import/node_modules/debug/src/inspector-log.js b/node_modules/eslint-plugin-import/node_modules/debug/src/inspector-log.js new file mode 100644 index 000000000..60ea6c04a --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/src/inspector-log.js @@ -0,0 +1,15 @@ +module.exports = inspectorLog; + +// black hole +const nullStream = new (require('stream').Writable)(); +nullStream._write = () => {}; + +/** + * Outputs a `console.log()` to the Node.js Inspector console *only*. + */ +function inspectorLog() { + const stdout = console._stdout; + console._stdout = nullStream; + console.log.apply(console, arguments); + console._stdout = stdout; +} diff --git a/node_modules/eslint-plugin-import/node_modules/debug/src/node.js b/node_modules/eslint-plugin-import/node_modules/debug/src/node.js new file mode 100644 index 000000000..b15109c90 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/debug/src/node.js @@ -0,0 +1,248 @@ +/** + * Module dependencies. + */ + +var tty = require('tty'); +var util = require('util'); + +/** + * This is the Node.js implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; + +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + +exports.inspectOpts = Object.keys(process.env).filter(function (key) { + return /^debug_/i.test(key); +}).reduce(function (obj, key) { + // camel-case + var prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() }); + + // coerce string value into JS value + var val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) val = true; + else if (/^(no|off|false|disabled)$/i.test(val)) val = false; + else if (val === 'null') val = null; + else val = Number(val); + + obj[prop] = val; + return obj; +}, {}); + +/** + * The file descriptor to write the `debug()` calls to. + * Set the `DEBUG_FD` env variable to override with another value. i.e.: + * + * $ DEBUG_FD=3 node script.js 3>debug.log + */ + +var fd = parseInt(process.env.DEBUG_FD, 10) || 2; + +if (1 !== fd && 2 !== fd) { + util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')() +} + +var stream = 1 === fd ? process.stdout : + 2 === fd ? process.stderr : + createWritableStdioStream(fd); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + return 'colors' in exports.inspectOpts + ? Boolean(exports.inspectOpts.colors) + : tty.isatty(fd); +} + +/** + * Map %o to `util.inspect()`, all on a single line. + */ + +exports.formatters.o = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n').map(function(str) { + return str.trim() + }).join(' '); +}; + +/** + * Map %o to `util.inspect()`, allowing multiple lines if needed. + */ + +exports.formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs(args) { + var name = this.namespace; + var useColors = this.useColors; + + if (useColors) { + var c = this.color; + var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m'; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); + } else { + args[0] = new Date().toUTCString() + + ' ' + name + ' ' + args[0]; + } +} + +/** + * Invokes `util.format()` with the specified arguments and writes to `stream`. + */ + +function log() { + return stream.write(util.format.apply(util, arguments) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + if (null == namespaces) { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } else { + process.env.DEBUG = namespaces; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Copied from `node/src/node.js`. + * + * XXX: It's lame that node doesn't expose this API out-of-the-box. It also + * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. + */ + +function createWritableStdioStream (fd) { + var stream; + var tty_wrap = process.binding('tty_wrap'); + + // Note stream._type is used for test-module-load-list.js + + switch (tty_wrap.guessHandleType(fd)) { + case 'TTY': + stream = new tty.WriteStream(fd); + stream._type = 'tty'; + + // Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + case 'FILE': + var fs = require('fs'); + stream = new fs.SyncWriteStream(fd, { autoClose: false }); + stream._type = 'fs'; + break; + + case 'PIPE': + case 'TCP': + var net = require('net'); + stream = new net.Socket({ + fd: fd, + readable: false, + writable: true + }); + + // FIXME Should probably have an option in net.Socket to create a + // stream from an existing fd which is writable only. But for now + // we'll just add this hack and set the `readable` member to false. + // Test: ./node test/fixtures/echo.js < /etc/passwd + stream.readable = false; + stream.read = null; + stream._type = 'pipe'; + + // FIXME Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + default: + // Probably an error on in uv_guess_handle() + throw new Error('Implement me. Unknown stream file type!'); + } + + // For supporting legacy API we put the FD here. + stream.fd = fd; + + stream._isStdio = true; + + return stream; +} + +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + +function init (debug) { + debug.inspectOpts = {}; + + var keys = Object.keys(exports.inspectOpts); + for (var i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} + +/** + * Enable namespaces listed in `process.env.DEBUG` initially. + */ + +exports.enable(load()); diff --git a/node_modules/eslint-plugin-import/node_modules/doctrine/CHANGELOG.md b/node_modules/eslint-plugin-import/node_modules/doctrine/CHANGELOG.md new file mode 100644 index 000000000..63fa77cfe --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/doctrine/CHANGELOG.md @@ -0,0 +1,70 @@ +v1.5.0 - October 13, 2016 + +* e33c6bb Update: Add support for BooleanLiteralType (#173) (Erik Arvidsson) + +v1.4.0 - September 13, 2016 + +* d7426e5 Update: add ability to parse optional properties in typedefs (refs #5) (#174) (ikokostya) + +v1.3.0 - August 22, 2016 + +* 12c7ad9 Update: Add support for numeric and string literal types (fixes #156) (#172) (Andrew Walter) + +v1.2.3 - August 16, 2016 + +* b96a884 Build: Add CI release script (Nicholas C. Zakas) +* 8d9b3c7 Upgrade: Upgrade esutils to v2.0.2 (fixes #170) (#171) (Emeegeemee) + +v1.2.2 - May 19, 2016 + +* ebe0b08 Fix: Support case insensitive tags (fixes #163) (#164) (alberto) +* 8e6d81e Chore: Remove copyright and license from headers (Nicholas C. Zakas) +* 79035c6 Chore: Include jQuery Foundation copyright (Nicholas C. Zakas) +* 06910a7 Fix: Preserve whitespace in default param string values (fixes #157) (Kai Cataldo) + +v1.2.1 - March 29, 2016 + +* 1f54014 Fix: allow hyphens in names (fixes #116) (Kai Cataldo) +* bbee469 Docs: Add issue template (Nicholas C. Zakas) + +v1.2.0 - February 19, 2016 + +* 18136c5 Build: Cleanup build system (Nicholas C. Zakas) +* b082f85 Update: Add support for slash in namepaths (fixes #100) (Ryan Duffy) +* def53a2 Docs: Fix typo in option lineNumbers (Daniel Tschinder) +* e2cbbc5 Update: Bump isarray to v1.0.0 (Shinnosuke Watanabe) +* ae07aa8 Fix: Allow whitespace in optional param with default value (fixes #141) (chris) + +v1.1.0 - January 6, 2016 + +* Build: Switch to Makefile.js (Nicholas C. Zakas) +* New: support name expression for @this tag (fixes #143) (Tim Schaub) +* Build: Update ESLint settings (Nicholas C. Zakas) + +v1.0.0 - December 21, 2015 + +* New: parse caption tags in examples into separate property. (fixes #131) (Tom MacWright) + +v0.7.2 - November 27, 2015 + +* Fix: Line numbers for some tags (fixes #138) Fixing issue where input was not consumed via advance() but was skipped when parsing tags resulting in sometimes incorrect reported lineNumber. (TEHEK) +* Build: Add missing linefix package (Nicholas C. Zakas) + +v0.7.1 - November 13, 2015 + +* Update: Begin switch to Makefile.js (Nicholas C. Zakas) +* Fix: permit return tag without type (fixes #136) (Tom MacWright) +* Fix: package.json homepage field (Bogdan Chadkin) +* Fix: Parse array default syntax. Fixes #133 (Tom MacWright) +* Fix: Last tag always has \n in the description (fixes #87) (Burak Yigit Kaya) +* Docs: Add changelog (Nicholas C. Zakas) + +v0.7.0 - September 21, 2015 + +* Docs: Update README with new info (fixes #127) (Nicholas C. Zakas) +* Fix: Parsing fix for param with arrays and properties (fixes #111) (Gyandeep Singh) +* Build: Add travis build (fixes #123) (Gyandeep Singh) +* Fix: Parsing of parameter name without a type (fixes #120) (Gyandeep Singh) +* New: added preserveWhitespace option (Aleks Totic) +* New: Add "files" entry to only deploy select files (Rob Loach) +* New: Add support and tests for typedefs. Refs #5 (Tom MacWright) diff --git a/node_modules/eslint-plugin-import/node_modules/doctrine/LICENSE.BSD b/node_modules/eslint-plugin-import/node_modules/doctrine/LICENSE.BSD new file mode 100644 index 000000000..1e03b5df5 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/doctrine/LICENSE.BSD @@ -0,0 +1,22 @@ +Doctrine +Copyright jQuery Foundation and other contributors, https://jquery.org/ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/doctrine/LICENSE.closure-compiler b/node_modules/eslint-plugin-import/node_modules/doctrine/LICENSE.closure-compiler similarity index 100% rename from node_modules/doctrine/LICENSE.closure-compiler rename to node_modules/eslint-plugin-import/node_modules/doctrine/LICENSE.closure-compiler diff --git a/node_modules/doctrine/LICENSE.esprima b/node_modules/eslint-plugin-import/node_modules/doctrine/LICENSE.esprima similarity index 100% rename from node_modules/doctrine/LICENSE.esprima rename to node_modules/eslint-plugin-import/node_modules/doctrine/LICENSE.esprima diff --git a/node_modules/eslint-plugin-import/node_modules/doctrine/README.md b/node_modules/eslint-plugin-import/node_modules/doctrine/README.md new file mode 100644 index 000000000..bc6dcf919 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/doctrine/README.md @@ -0,0 +1,174 @@ +[![NPM version][npm-image]][npm-url] +[![build status][travis-image]][travis-url] +[![Test coverage][coveralls-image]][coveralls-url] +[![Downloads][downloads-image]][downloads-url] +[![Join the chat at https://gitter.im/eslint/doctrine](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/eslint/doctrine?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +# Doctrine + +Doctrine is a [JSDoc](http://usejsdoc.org) parser that parses documentation comments from JavaScript (you need to pass in the comment, not a whole JavaScript file). + +## Installation + +You can install Doctrine using [npm](https://npmjs.com): + +``` +$ npm install doctrine --save-dev +``` + +Doctrine can also be used in web browsers using [Browserify](http://browserify.org). + +## Usage + +Require doctrine inside of your JavaScript: + +```js +var doctrine = require("doctrine"); +``` + +### parse() + +The primary method is `parse()`, which accepts two arguments: the JSDoc comment to parse and an optional options object. The available options are: + +* `unwrap` - set to `true` to delete the leading `/**`, any `*` that begins a line, and the trailing `*/` from the source text. Default: `false`. +* `tags` - an array of tags to return. When specified, Doctrine returns only tags in this array. For example, if `tags` is `["param"]`, then only `@param` tags will be returned. Default: `null`. +* `recoverable` - set to `true` to keep parsing even when syntax errors occur. Default: `false`. +* `sloppy` - set to `true` to allow optional parameters to be specified in brackets (`@param {string} [foo]`). Default: `false`. +* `lineNumbers` - set to `true` to add `lineNumber` to each node, specifying the line on which the node is found in the source. Default: `false`. + +Here's a simple example: + +```js +var ast = doctrine.parse( + [ + "/**", + " * This function comment is parsed by doctrine", + " * @param {{ok:String}} userName", + "*/" + ].join('\n'), { unwrap: true }); +``` + +This example returns the following AST: + + { + "description": "This function comment is parsed by doctrine", + "tags": [ + { + "title": "param", + "description": null, + "type": { + "type": "RecordType", + "fields": [ + { + "type": "FieldType", + "key": "ok", + "value": { + "type": "NameExpression", + "name": "String" + } + } + ] + }, + "name": "userName" + } + ] + } + +See the [demo page](http://eslint.org/doctrine/demo/) more detail. + +## Team + +These folks keep the project moving and are resources for help: + +* Nicholas C. Zakas ([@nzakas](https://github.com/nzakas)) - project lead +* Yusuke Suzuki ([@constellation](https://github.com/constellation)) - reviewer + +## Contributing + +Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/doctrine/issues). + +## Frequently Asked Questions + +### Can I pass a whole JavaScript file to Doctrine? + +No. Doctrine can only parse JSDoc comments, so you'll need to pass just the JSDoc comment to Doctrine in order to work. + + +### License + +#### doctrine + +Copyright (C) 2012 [Yusuke Suzuki](http://github.com/Constellation) + (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#### esprima + +some of functions is derived from esprima + +Copyright (C) 2012, 2011 [Ariya Hidayat](http://ariya.ofilabs.com/about) + (twitter: [@ariyahidayat](http://twitter.com/ariyahidayat)) and other contributors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#### closure-compiler + +some of extensions is derived from closure-compiler + +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + + +### Where to ask for help? + +Join our [Chatroom](https://gitter.im/eslint/doctrine) + +[npm-image]: https://img.shields.io/npm/v/doctrine.svg?style=flat-square +[npm-url]: https://www.npmjs.com/package/doctrine +[travis-image]: https://img.shields.io/travis/eslint/doctrine/master.svg?style=flat-square +[travis-url]: https://travis-ci.org/eslint/doctrine +[coveralls-image]: https://img.shields.io/coveralls/eslint/doctrine/master.svg?style=flat-square +[coveralls-url]: https://coveralls.io/r/eslint/doctrine?branch=master +[downloads-image]: http://img.shields.io/npm/dm/doctrine.svg?style=flat-square +[downloads-url]: https://www.npmjs.com/package/doctrine diff --git a/node_modules/eslint-plugin-import/node_modules/doctrine/lib/doctrine.js b/node_modules/eslint-plugin-import/node_modules/doctrine/lib/doctrine.js new file mode 100644 index 000000000..095eeeb4e --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/doctrine/lib/doctrine.js @@ -0,0 +1,897 @@ +/* + * @fileoverview Main Doctrine object + * @author Yusuke Suzuki + * @author Dan Tao + * @author Andrew Eisenberg + */ + +(function () { + 'use strict'; + + var typed, + utility, + isArray, + jsdoc, + esutils, + hasOwnProperty; + + esutils = require('esutils'); + isArray = require('isarray'); + typed = require('./typed'); + utility = require('./utility'); + + function sliceSource(source, index, last) { + return source.slice(index, last); + } + + hasOwnProperty = (function () { + var func = Object.prototype.hasOwnProperty; + return function hasOwnProperty(obj, name) { + return func.call(obj, name); + }; + }()); + + function shallowCopy(obj) { + var ret = {}, key; + for (key in obj) { + if (obj.hasOwnProperty(key)) { + ret[key] = obj[key]; + } + } + return ret; + } + + function isASCIIAlphanumeric(ch) { + return (ch >= 0x61 /* 'a' */ && ch <= 0x7A /* 'z' */) || + (ch >= 0x41 /* 'A' */ && ch <= 0x5A /* 'Z' */) || + (ch >= 0x30 /* '0' */ && ch <= 0x39 /* '9' */); + } + + function isParamTitle(title) { + return title === 'param' || title === 'argument' || title === 'arg'; + } + + function isReturnTitle(title) { + return title === 'return' || title === 'returns'; + } + + function isProperty(title) { + return title === 'property' || title === 'prop'; + } + + function isNameParameterRequired(title) { + return isParamTitle(title) || isProperty(title) || + title === 'alias' || title === 'this' || title === 'mixes' || title === 'requires'; + } + + function isAllowedName(title) { + return isNameParameterRequired(title) || title === 'const' || title === 'constant'; + } + + function isAllowedNested(title) { + return isProperty(title) || isParamTitle(title); + } + + function isAllowedOptional(title) { + return isProperty(title) || isParamTitle(title); + } + + function isTypeParameterRequired(title) { + return isParamTitle(title) || isReturnTitle(title) || + title === 'define' || title === 'enum' || + title === 'implements' || title === 'this' || + title === 'type' || title === 'typedef' || isProperty(title); + } + + // Consider deprecation instead using 'isTypeParameterRequired' and 'Rules' declaration to pick when a type is optional/required + // This would require changes to 'parseType' + function isAllowedType(title) { + return isTypeParameterRequired(title) || title === 'throws' || title === 'const' || title === 'constant' || + title === 'namespace' || title === 'member' || title === 'var' || title === 'module' || + title === 'constructor' || title === 'class' || title === 'extends' || title === 'augments' || + title === 'public' || title === 'private' || title === 'protected'; + } + + function trim(str) { + return str.replace(/^\s+/, '').replace(/\s+$/, ''); + } + + function unwrapComment(doc) { + // JSDoc comment is following form + // /** + // * ....... + // */ + // remove /**, */ and * + var BEFORE_STAR = 0, + STAR = 1, + AFTER_STAR = 2, + index, + len, + mode, + result, + ch; + + doc = doc.replace(/^\/\*\*?/, '').replace(/\*\/$/, ''); + index = 0; + len = doc.length; + mode = BEFORE_STAR; + result = ''; + + while (index < len) { + ch = doc.charCodeAt(index); + switch (mode) { + case BEFORE_STAR: + if (esutils.code.isLineTerminator(ch)) { + result += String.fromCharCode(ch); + } else if (ch === 0x2A /* '*' */) { + mode = STAR; + } else if (!esutils.code.isWhiteSpace(ch)) { + result += String.fromCharCode(ch); + mode = AFTER_STAR; + } + break; + + case STAR: + if (!esutils.code.isWhiteSpace(ch)) { + result += String.fromCharCode(ch); + } + mode = esutils.code.isLineTerminator(ch) ? BEFORE_STAR : AFTER_STAR; + break; + + case AFTER_STAR: + result += String.fromCharCode(ch); + if (esutils.code.isLineTerminator(ch)) { + mode = BEFORE_STAR; + } + break; + } + index += 1; + } + + return result.replace(/\s+$/, ''); + } + + // JSDoc Tag Parser + + (function (exports) { + var Rules, + index, + lineNumber, + length, + source, + recoverable, + sloppy, + strict; + + function advance() { + var ch = source.charCodeAt(index); + index += 1; + if (esutils.code.isLineTerminator(ch) && !(ch === 0x0D /* '\r' */ && source.charCodeAt(index) === 0x0A /* '\n' */)) { + lineNumber += 1; + } + return String.fromCharCode(ch); + } + + function scanTitle() { + var title = ''; + // waste '@' + advance(); + + while (index < length && isASCIIAlphanumeric(source.charCodeAt(index))) { + title += advance(); + } + + return title; + } + + function seekContent() { + var ch, waiting, last = index; + + waiting = false; + while (last < length) { + ch = source.charCodeAt(last); + if (esutils.code.isLineTerminator(ch) && !(ch === 0x0D /* '\r' */ && source.charCodeAt(last + 1) === 0x0A /* '\n' */)) { + waiting = true; + } else if (waiting) { + if (ch === 0x40 /* '@' */) { + break; + } + if (!esutils.code.isWhiteSpace(ch)) { + waiting = false; + } + } + last += 1; + } + return last; + } + + // type expression may have nest brace, such as, + // { { ok: string } } + // + // therefore, scanning type expression with balancing braces. + function parseType(title, last) { + var ch, brace, type, direct = false; + + + // search '{' + while (index < last) { + ch = source.charCodeAt(index); + if (esutils.code.isWhiteSpace(ch)) { + advance(); + } else if (ch === 0x7B /* '{' */) { + advance(); + break; + } else { + // this is direct pattern + direct = true; + break; + } + } + + + if (direct) { + return null; + } + + // type expression { is found + brace = 1; + type = ''; + while (index < last) { + ch = source.charCodeAt(index); + if (esutils.code.isLineTerminator(ch)) { + advance(); + } else { + if (ch === 0x7D /* '}' */) { + brace -= 1; + if (brace === 0) { + advance(); + break; + } + } else if (ch === 0x7B /* '{' */) { + brace += 1; + } + type += advance(); + } + } + + if (brace !== 0) { + // braces is not balanced + return utility.throwError('Braces are not balanced'); + } + + if (isAllowedOptional(title)) { + return typed.parseParamType(type); + } + + return typed.parseType(type); + } + + function scanIdentifier(last) { + var identifier; + if (!esutils.code.isIdentifierStartES5(source.charCodeAt(index))) { + return null; + } + identifier = advance(); + while (index < last && esutils.code.isIdentifierPartES5(source.charCodeAt(index))) { + identifier += advance(); + } + return identifier; + } + + function skipWhiteSpace(last) { + while (index < last && (esutils.code.isWhiteSpace(source.charCodeAt(index)) || esutils.code.isLineTerminator(source.charCodeAt(index)))) { + advance(); + } + } + + function parseName(last, allowBrackets, allowNestedParams) { + var name = '', + useBrackets, + insideString; + + + skipWhiteSpace(last); + + if (index >= last) { + return null; + } + + if (allowBrackets && source.charCodeAt(index) === 0x5B /* '[' */) { + useBrackets = true; + name = advance(); + } + + if (!esutils.code.isIdentifierStartES5(source.charCodeAt(index))) { + return null; + } + + name += scanIdentifier(last); + + if (allowNestedParams) { + if (source.charCodeAt(index) === 0x3A /* ':' */ && ( + name === 'module' || + name === 'external' || + name === 'event')) { + name += advance(); + name += scanIdentifier(last); + + } + if(source.charCodeAt(index) === 0x5B /* '[' */ && source.charCodeAt(index + 1) === 0x5D /* ']' */){ + name += advance(); + name += advance(); + } + while (source.charCodeAt(index) === 0x2E /* '.' */ || + source.charCodeAt(index) === 0x2F /* '/' */ || + source.charCodeAt(index) === 0x23 /* '#' */ || + source.charCodeAt(index) === 0x2D /* '-' */ || + source.charCodeAt(index) === 0x7E /* '~' */) { + name += advance(); + name += scanIdentifier(last); + } + } + + if (useBrackets) { + skipWhiteSpace(last); + // do we have a default value for this? + if (source.charCodeAt(index) === 0x3D /* '=' */) { + // consume the '='' symbol + name += advance(); + skipWhiteSpace(last); + + var ch; + var bracketDepth = 1; + + // scan in the default value + while (index < last) { + ch = source.charCodeAt(index); + + if (esutils.code.isWhiteSpace(ch)) { + if (!insideString) { + skipWhiteSpace(last); + ch = source.charCodeAt(index); + } + } + + if (ch === 0x27 /* ''' */) { + if (!insideString) { + insideString = '\''; + } else { + if (insideString === '\'') { + insideString = ''; + } + } + } + + if (ch === 0x22 /* '"' */) { + if (!insideString) { + insideString = '"'; + } else { + if (insideString === '"') { + insideString = ''; + } + } + } + + if (ch === 0x5B /* '[' */) { + bracketDepth++; + } else if (ch === 0x5D /* ']' */ && + --bracketDepth === 0) { + break; + } + + name += advance(); + } + } + + skipWhiteSpace(last); + + if (index >= last || source.charCodeAt(index) !== 0x5D /* ']' */) { + // we never found a closing ']' + return null; + } + + // collect the last ']' + name += advance(); + } + + return name; + } + + function skipToTag() { + while (index < length && source.charCodeAt(index) !== 0x40 /* '@' */) { + advance(); + } + if (index >= length) { + return false; + } + utility.assert(source.charCodeAt(index) === 0x40 /* '@' */); + return true; + } + + function TagParser(options, title) { + this._options = options; + this._title = title.toLowerCase(); + this._tag = { + title: title, + description: null + }; + if (this._options.lineNumbers) { + this._tag.lineNumber = lineNumber; + } + this._last = 0; + // space to save special information for title parsers. + this._extra = { }; + } + + // addError(err, ...) + TagParser.prototype.addError = function addError(errorText) { + var args = Array.prototype.slice.call(arguments, 1), + msg = errorText.replace( + /%(\d)/g, + function (whole, index) { + utility.assert(index < args.length, 'Message reference must be in range'); + return args[index]; + } + ); + + if (!this._tag.errors) { + this._tag.errors = []; + } + if (strict) { + utility.throwError(msg); + } + this._tag.errors.push(msg); + return recoverable; + }; + + TagParser.prototype.parseType = function () { + // type required titles + if (isTypeParameterRequired(this._title)) { + try { + this._tag.type = parseType(this._title, this._last); + if (!this._tag.type) { + if (!isParamTitle(this._title) && !isReturnTitle(this._title)) { + if (!this.addError('Missing or invalid tag type')) { + return false; + } + } + } + } catch (error) { + this._tag.type = null; + if (!this.addError(error.message)) { + return false; + } + } + } else if (isAllowedType(this._title)) { + // optional types + try { + this._tag.type = parseType(this._title, this._last); + } catch (e) { + //For optional types, lets drop the thrown error when we hit the end of the file + } + } + return true; + }; + + TagParser.prototype._parseNamePath = function (optional) { + var name; + name = parseName(this._last, sloppy && isAllowedOptional(this._title), true); + if (!name) { + if (!optional) { + if (!this.addError('Missing or invalid tag name')) { + return false; + } + } + } + this._tag.name = name; + return true; + }; + + TagParser.prototype.parseNamePath = function () { + return this._parseNamePath(false); + }; + + TagParser.prototype.parseNamePathOptional = function () { + return this._parseNamePath(true); + }; + + + TagParser.prototype.parseName = function () { + var assign, name; + + // param, property requires name + if (isAllowedName(this._title)) { + this._tag.name = parseName(this._last, sloppy && isAllowedOptional(this._title), isAllowedNested(this._title)); + if (!this._tag.name) { + if (!isNameParameterRequired(this._title)) { + return true; + } + + // it's possible the name has already been parsed but interpreted as a type + // it's also possible this is a sloppy declaration, in which case it will be + // fixed at the end + if (isParamTitle(this._title) && this._tag.type && this._tag.type.name) { + this._extra.name = this._tag.type; + this._tag.name = this._tag.type.name; + this._tag.type = null; + } else { + if (!this.addError('Missing or invalid tag name')) { + return false; + } + } + } else { + name = this._tag.name; + if (name.charAt(0) === '[' && name.charAt(name.length - 1) === ']') { + // extract the default value if there is one + // example: @param {string} [somebody=John Doe] description + assign = name.substring(1, name.length - 1).split('='); + if (assign[1]) { + this._tag['default'] = assign[1]; + } + this._tag.name = assign[0]; + + // convert to an optional type + if (this._tag.type && this._tag.type.type !== 'OptionalType') { + this._tag.type = { + type: 'OptionalType', + expression: this._tag.type + }; + } + } + } + } + + + return true; + }; + + TagParser.prototype.parseDescription = function parseDescription() { + var description = trim(sliceSource(source, index, this._last)); + if (description) { + if ((/^-\s+/).test(description)) { + description = description.substring(2); + } + this._tag.description = description; + } + return true; + }; + + TagParser.prototype.parseCaption = function parseDescription() { + var description = trim(sliceSource(source, index, this._last)); + var captionStartTag = ''; + var captionEndTag = ''; + var captionStart = description.indexOf(captionStartTag); + var captionEnd = description.indexOf(captionEndTag); + if (captionStart >= 0 && captionEnd >= 0) { + this._tag.caption = trim(description.substring( + captionStart + captionStartTag.length, captionEnd)); + this._tag.description = trim(description.substring(captionEnd + captionEndTag.length)); + } else { + this._tag.description = description; + } + return true; + }; + + TagParser.prototype.parseKind = function parseKind() { + var kind, kinds; + kinds = { + 'class': true, + 'constant': true, + 'event': true, + 'external': true, + 'file': true, + 'function': true, + 'member': true, + 'mixin': true, + 'module': true, + 'namespace': true, + 'typedef': true + }; + kind = trim(sliceSource(source, index, this._last)); + this._tag.kind = kind; + if (!hasOwnProperty(kinds, kind)) { + if (!this.addError('Invalid kind name \'%0\'', kind)) { + return false; + } + } + return true; + }; + + TagParser.prototype.parseAccess = function parseAccess() { + var access; + access = trim(sliceSource(source, index, this._last)); + this._tag.access = access; + if (access !== 'private' && access !== 'protected' && access !== 'public') { + if (!this.addError('Invalid access name \'%0\'', access)) { + return false; + } + } + return true; + }; + + TagParser.prototype.parseThis = function parseAccess() { + // this name may be a name expression (e.g. {foo.bar}) + // or a name path (e.g. foo.bar) + var value = trim(sliceSource(source, index, this._last)); + if (value && value.charAt(0) === '{') { + var gotType = this.parseType(); + if (gotType && this._tag.type.type === 'NameExpression') { + this._tag.name = this._tag.type.name; + return true; + } else { + return this.addError('Invalid name for this'); + } + } else { + return this.parseNamePath(); + } + }; + + TagParser.prototype.parseVariation = function parseVariation() { + var variation, text; + text = trim(sliceSource(source, index, this._last)); + variation = parseFloat(text, 10); + this._tag.variation = variation; + if (isNaN(variation)) { + if (!this.addError('Invalid variation \'%0\'', text)) { + return false; + } + } + return true; + }; + + TagParser.prototype.ensureEnd = function () { + var shouldBeEmpty = trim(sliceSource(source, index, this._last)); + if (shouldBeEmpty) { + if (!this.addError('Unknown content \'%0\'', shouldBeEmpty)) { + return false; + } + } + return true; + }; + + TagParser.prototype.epilogue = function epilogue() { + var description; + + description = this._tag.description; + // un-fix potentially sloppy declaration + if (isAllowedOptional(this._title) && !this._tag.type && description && description.charAt(0) === '[') { + this._tag.type = this._extra.name; + if (!this._tag.name) { + this._tag.name = undefined; + } + + if (!sloppy) { + if (!this.addError('Missing or invalid tag name')) { + return false; + } + } + } + + return true; + }; + + Rules = { + // http://usejsdoc.org/tags-access.html + 'access': ['parseAccess'], + // http://usejsdoc.org/tags-alias.html + 'alias': ['parseNamePath', 'ensureEnd'], + // http://usejsdoc.org/tags-augments.html + 'augments': ['parseType', 'parseNamePathOptional', 'ensureEnd'], + // http://usejsdoc.org/tags-constructor.html + 'constructor': ['parseType', 'parseNamePathOptional', 'ensureEnd'], + // Synonym: http://usejsdoc.org/tags-constructor.html + 'class': ['parseType', 'parseNamePathOptional', 'ensureEnd'], + // Synonym: http://usejsdoc.org/tags-extends.html + 'extends': ['parseType', 'parseNamePathOptional', 'ensureEnd'], + // http://usejsdoc.org/tags-example.html + 'example': ['parseCaption'], + // http://usejsdoc.org/tags-deprecated.html + 'deprecated': ['parseDescription'], + // http://usejsdoc.org/tags-global.html + 'global': ['ensureEnd'], + // http://usejsdoc.org/tags-inner.html + 'inner': ['ensureEnd'], + // http://usejsdoc.org/tags-instance.html + 'instance': ['ensureEnd'], + // http://usejsdoc.org/tags-kind.html + 'kind': ['parseKind'], + // http://usejsdoc.org/tags-mixes.html + 'mixes': ['parseNamePath', 'ensureEnd'], + // http://usejsdoc.org/tags-mixin.html + 'mixin': ['parseNamePathOptional', 'ensureEnd'], + // http://usejsdoc.org/tags-member.html + 'member': ['parseType', 'parseNamePathOptional', 'ensureEnd'], + // http://usejsdoc.org/tags-method.html + 'method': ['parseNamePathOptional', 'ensureEnd'], + // http://usejsdoc.org/tags-module.html + 'module': ['parseType', 'parseNamePathOptional', 'ensureEnd'], + // Synonym: http://usejsdoc.org/tags-method.html + 'func': ['parseNamePathOptional', 'ensureEnd'], + // Synonym: http://usejsdoc.org/tags-method.html + 'function': ['parseNamePathOptional', 'ensureEnd'], + // Synonym: http://usejsdoc.org/tags-member.html + 'var': ['parseType', 'parseNamePathOptional', 'ensureEnd'], + // http://usejsdoc.org/tags-name.html + 'name': ['parseNamePath', 'ensureEnd'], + // http://usejsdoc.org/tags-namespace.html + 'namespace': ['parseType', 'parseNamePathOptional', 'ensureEnd'], + // http://usejsdoc.org/tags-private.html + 'private': ['parseType', 'parseDescription'], + // http://usejsdoc.org/tags-protected.html + 'protected': ['parseType', 'parseDescription'], + // http://usejsdoc.org/tags-public.html + 'public': ['parseType', 'parseDescription'], + // http://usejsdoc.org/tags-readonly.html + 'readonly': ['ensureEnd'], + // http://usejsdoc.org/tags-requires.html + 'requires': ['parseNamePath', 'ensureEnd'], + // http://usejsdoc.org/tags-since.html + 'since': ['parseDescription'], + // http://usejsdoc.org/tags-static.html + 'static': ['ensureEnd'], + // http://usejsdoc.org/tags-summary.html + 'summary': ['parseDescription'], + // http://usejsdoc.org/tags-this.html + 'this': ['parseThis', 'ensureEnd'], + // http://usejsdoc.org/tags-todo.html + 'todo': ['parseDescription'], + // http://usejsdoc.org/tags-typedef.html + 'typedef': ['parseType', 'parseNamePathOptional'], + // http://usejsdoc.org/tags-variation.html + 'variation': ['parseVariation'], + // http://usejsdoc.org/tags-version.html + 'version': ['parseDescription'] + }; + + TagParser.prototype.parse = function parse() { + var i, iz, sequences, method; + + + // empty title + if (!this._title) { + if (!this.addError('Missing or invalid title')) { + return null; + } + } + + // Seek to content last index. + this._last = seekContent(this._title); + + if (hasOwnProperty(Rules, this._title)) { + sequences = Rules[this._title]; + } else { + // default sequences + sequences = ['parseType', 'parseName', 'parseDescription', 'epilogue']; + } + + for (i = 0, iz = sequences.length; i < iz; ++i) { + method = sequences[i]; + if (!this[method]()) { + return null; + } + } + + return this._tag; + }; + + function parseTag(options) { + var title, parser, tag; + + // skip to tag + if (!skipToTag()) { + return null; + } + + // scan title + title = scanTitle(); + + // construct tag parser + parser = new TagParser(options, title); + tag = parser.parse(); + + // Seek global index to end of this tag. + while (index < parser._last) { + advance(); + } + + return tag; + } + + // + // Parse JSDoc + // + + function scanJSDocDescription(preserveWhitespace) { + var description = '', ch, atAllowed; + + atAllowed = true; + while (index < length) { + ch = source.charCodeAt(index); + + if (atAllowed && ch === 0x40 /* '@' */) { + break; + } + + if (esutils.code.isLineTerminator(ch)) { + atAllowed = true; + } else if (atAllowed && !esutils.code.isWhiteSpace(ch)) { + atAllowed = false; + } + + description += advance(); + } + + return preserveWhitespace ? description : trim(description); + } + + function parse(comment, options) { + var tags = [], tag, description, interestingTags, i, iz; + + if (options === undefined) { + options = {}; + } + + if (typeof options.unwrap === 'boolean' && options.unwrap) { + source = unwrapComment(comment); + } else { + source = comment; + } + + // array of relevant tags + if (options.tags) { + if (isArray(options.tags)) { + interestingTags = { }; + for (i = 0, iz = options.tags.length; i < iz; i++) { + if (typeof options.tags[i] === 'string') { + interestingTags[options.tags[i]] = true; + } else { + utility.throwError('Invalid "tags" parameter: ' + options.tags); + } + } + } else { + utility.throwError('Invalid "tags" parameter: ' + options.tags); + } + } + + length = source.length; + index = 0; + lineNumber = 0; + recoverable = options.recoverable; + sloppy = options.sloppy; + strict = options.strict; + + description = scanJSDocDescription(options.preserveWhitespace); + + while (true) { + tag = parseTag(options); + if (!tag) { + break; + } + if (!interestingTags || interestingTags.hasOwnProperty(tag.title)) { + tags.push(tag); + } + } + + return { + description: description, + tags: tags + }; + } + exports.parse = parse; + }(jsdoc = {})); + + exports.version = utility.VERSION; + exports.parse = jsdoc.parse; + exports.parseType = typed.parseType; + exports.parseParamType = typed.parseParamType; + exports.unwrapComment = unwrapComment; + exports.Syntax = shallowCopy(typed.Syntax); + exports.Error = utility.DoctrineError; + exports.type = { + Syntax: exports.Syntax, + parseType: typed.parseType, + parseParamType: typed.parseParamType, + stringify: typed.stringify + }; +}()); +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-plugin-import/node_modules/doctrine/lib/typed.js b/node_modules/eslint-plugin-import/node_modules/doctrine/lib/typed.js new file mode 100644 index 000000000..f0d759bcb --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/doctrine/lib/typed.js @@ -0,0 +1,1283 @@ +/* + * @fileoverview Type expression parser. + * @author Yusuke Suzuki + * @author Dan Tao + * @author Andrew Eisenberg + */ + +// "typed", the Type Expression Parser for doctrine. + +(function () { + 'use strict'; + + var Syntax, + Token, + source, + length, + index, + previous, + token, + value, + esutils, + utility; + + esutils = require('esutils'); + utility = require('./utility'); + + Syntax = { + NullableLiteral: 'NullableLiteral', + AllLiteral: 'AllLiteral', + NullLiteral: 'NullLiteral', + UndefinedLiteral: 'UndefinedLiteral', + VoidLiteral: 'VoidLiteral', + UnionType: 'UnionType', + ArrayType: 'ArrayType', + RecordType: 'RecordType', + FieldType: 'FieldType', + FunctionType: 'FunctionType', + ParameterType: 'ParameterType', + RestType: 'RestType', + NonNullableType: 'NonNullableType', + OptionalType: 'OptionalType', + NullableType: 'NullableType', + NameExpression: 'NameExpression', + TypeApplication: 'TypeApplication', + StringLiteralType: 'StringLiteralType', + NumericLiteralType: 'NumericLiteralType', + BooleanLiteralType: 'BooleanLiteralType' + }; + + Token = { + ILLEGAL: 0, // ILLEGAL + DOT_LT: 1, // .< + REST: 2, // ... + LT: 3, // < + GT: 4, // > + LPAREN: 5, // ( + RPAREN: 6, // ) + LBRACE: 7, // { + RBRACE: 8, // } + LBRACK: 9, // [ + RBRACK: 10, // ] + COMMA: 11, // , + COLON: 12, // : + STAR: 13, // * + PIPE: 14, // | + QUESTION: 15, // ? + BANG: 16, // ! + EQUAL: 17, // = + NAME: 18, // name token + STRING: 19, // string + NUMBER: 20, // number + EOF: 21 + }; + + function isTypeName(ch) { + return '><(){}[],:*|?!='.indexOf(String.fromCharCode(ch)) === -1 && !esutils.code.isWhiteSpace(ch) && !esutils.code.isLineTerminator(ch); + } + + function Context(previous, index, token, value) { + this._previous = previous; + this._index = index; + this._token = token; + this._value = value; + } + + Context.prototype.restore = function () { + previous = this._previous; + index = this._index; + token = this._token; + value = this._value; + }; + + Context.save = function () { + return new Context(previous, index, token, value); + }; + + function advance() { + var ch = source.charAt(index); + index += 1; + return ch; + } + + function scanHexEscape(prefix) { + var i, len, ch, code = 0; + + len = (prefix === 'u') ? 4 : 2; + for (i = 0; i < len; ++i) { + if (index < length && esutils.code.isHexDigit(source.charCodeAt(index))) { + ch = advance(); + code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase()); + } else { + return ''; + } + } + return String.fromCharCode(code); + } + + function scanString() { + var str = '', quote, ch, code, unescaped, restore; //TODO review removal octal = false + quote = source.charAt(index); + ++index; + + while (index < length) { + ch = advance(); + + if (ch === quote) { + quote = ''; + break; + } else if (ch === '\\') { + ch = advance(); + if (!esutils.code.isLineTerminator(ch.charCodeAt(0))) { + switch (ch) { + case 'n': + str += '\n'; + break; + case 'r': + str += '\r'; + break; + case 't': + str += '\t'; + break; + case 'u': + case 'x': + restore = index; + unescaped = scanHexEscape(ch); + if (unescaped) { + str += unescaped; + } else { + index = restore; + str += ch; + } + break; + case 'b': + str += '\b'; + break; + case 'f': + str += '\f'; + break; + case 'v': + str += '\v'; + break; + + default: + if (esutils.code.isOctalDigit(ch.charCodeAt(0))) { + code = '01234567'.indexOf(ch); + + // \0 is not octal escape sequence + // Deprecating unused code. TODO review removal + //if (code !== 0) { + // octal = true; + //} + + if (index < length && esutils.code.isOctalDigit(source.charCodeAt(index))) { + //TODO Review Removal octal = true; + code = code * 8 + '01234567'.indexOf(advance()); + + // 3 digits are only allowed when string starts + // with 0, 1, 2, 3 + if ('0123'.indexOf(ch) >= 0 && + index < length && + esutils.code.isOctalDigit(source.charCodeAt(index))) { + code = code * 8 + '01234567'.indexOf(advance()); + } + } + str += String.fromCharCode(code); + } else { + str += ch; + } + break; + } + } else { + if (ch === '\r' && source.charCodeAt(index) === 0x0A /* '\n' */) { + ++index; + } + } + } else if (esutils.code.isLineTerminator(ch.charCodeAt(0))) { + break; + } else { + str += ch; + } + } + + if (quote !== '') { + utility.throwError('unexpected quote'); + } + + value = str; + return Token.STRING; + } + + function scanNumber() { + var number, ch; + + number = ''; + ch = source.charCodeAt(index); + + if (ch !== 0x2E /* '.' */) { + number = advance(); + ch = source.charCodeAt(index); + + if (number === '0') { + if (ch === 0x78 /* 'x' */ || ch === 0x58 /* 'X' */) { + number += advance(); + while (index < length) { + ch = source.charCodeAt(index); + if (!esutils.code.isHexDigit(ch)) { + break; + } + number += advance(); + } + + if (number.length <= 2) { + // only 0x + utility.throwError('unexpected token'); + } + + if (index < length) { + ch = source.charCodeAt(index); + if (esutils.code.isIdentifierStartES5(ch)) { + utility.throwError('unexpected token'); + } + } + value = parseInt(number, 16); + return Token.NUMBER; + } + + if (esutils.code.isOctalDigit(ch)) { + number += advance(); + while (index < length) { + ch = source.charCodeAt(index); + if (!esutils.code.isOctalDigit(ch)) { + break; + } + number += advance(); + } + + if (index < length) { + ch = source.charCodeAt(index); + if (esutils.code.isIdentifierStartES5(ch) || esutils.code.isDecimalDigit(ch)) { + utility.throwError('unexpected token'); + } + } + value = parseInt(number, 8); + return Token.NUMBER; + } + + if (esutils.code.isDecimalDigit(ch)) { + utility.throwError('unexpected token'); + } + } + + while (index < length) { + ch = source.charCodeAt(index); + if (!esutils.code.isDecimalDigit(ch)) { + break; + } + number += advance(); + } + } + + if (ch === 0x2E /* '.' */) { + number += advance(); + while (index < length) { + ch = source.charCodeAt(index); + if (!esutils.code.isDecimalDigit(ch)) { + break; + } + number += advance(); + } + } + + if (ch === 0x65 /* 'e' */ || ch === 0x45 /* 'E' */) { + number += advance(); + + ch = source.charCodeAt(index); + if (ch === 0x2B /* '+' */ || ch === 0x2D /* '-' */) { + number += advance(); + } + + ch = source.charCodeAt(index); + if (esutils.code.isDecimalDigit(ch)) { + number += advance(); + while (index < length) { + ch = source.charCodeAt(index); + if (!esutils.code.isDecimalDigit(ch)) { + break; + } + number += advance(); + } + } else { + utility.throwError('unexpected token'); + } + } + + if (index < length) { + ch = source.charCodeAt(index); + if (esutils.code.isIdentifierStartES5(ch)) { + utility.throwError('unexpected token'); + } + } + + value = parseFloat(number); + return Token.NUMBER; + } + + + function scanTypeName() { + var ch, ch2; + + value = advance(); + while (index < length && isTypeName(source.charCodeAt(index))) { + ch = source.charCodeAt(index); + if (ch === 0x2E /* '.' */) { + if ((index + 1) >= length) { + return Token.ILLEGAL; + } + ch2 = source.charCodeAt(index + 1); + if (ch2 === 0x3C /* '<' */) { + break; + } + } + value += advance(); + } + return Token.NAME; + } + + function next() { + var ch; + + previous = index; + + while (index < length && esutils.code.isWhiteSpace(source.charCodeAt(index))) { + advance(); + } + if (index >= length) { + token = Token.EOF; + return token; + } + + ch = source.charCodeAt(index); + switch (ch) { + case 0x27: /* ''' */ + case 0x22: /* '"' */ + token = scanString(); + return token; + + case 0x3A: /* ':' */ + advance(); + token = Token.COLON; + return token; + + case 0x2C: /* ',' */ + advance(); + token = Token.COMMA; + return token; + + case 0x28: /* '(' */ + advance(); + token = Token.LPAREN; + return token; + + case 0x29: /* ')' */ + advance(); + token = Token.RPAREN; + return token; + + case 0x5B: /* '[' */ + advance(); + token = Token.LBRACK; + return token; + + case 0x5D: /* ']' */ + advance(); + token = Token.RBRACK; + return token; + + case 0x7B: /* '{' */ + advance(); + token = Token.LBRACE; + return token; + + case 0x7D: /* '}' */ + advance(); + token = Token.RBRACE; + return token; + + case 0x2E: /* '.' */ + if (index + 1 < length) { + ch = source.charCodeAt(index + 1); + if (ch === 0x3C /* '<' */) { + advance(); // '.' + advance(); // '<' + token = Token.DOT_LT; + return token; + } + + if (ch === 0x2E /* '.' */ && index + 2 < length && source.charCodeAt(index + 2) === 0x2E /* '.' */) { + advance(); // '.' + advance(); // '.' + advance(); // '.' + token = Token.REST; + return token; + } + + if (esutils.code.isDecimalDigit(ch)) { + token = scanNumber(); + return token; + } + } + token = Token.ILLEGAL; + return token; + + case 0x3C: /* '<' */ + advance(); + token = Token.LT; + return token; + + case 0x3E: /* '>' */ + advance(); + token = Token.GT; + return token; + + case 0x2A: /* '*' */ + advance(); + token = Token.STAR; + return token; + + case 0x7C: /* '|' */ + advance(); + token = Token.PIPE; + return token; + + case 0x3F: /* '?' */ + advance(); + token = Token.QUESTION; + return token; + + case 0x21: /* '!' */ + advance(); + token = Token.BANG; + return token; + + case 0x3D: /* '=' */ + advance(); + token = Token.EQUAL; + return token; + + case 0x2D: /* '-' */ + token = scanNumber(); + return token; + + default: + if (esutils.code.isDecimalDigit(ch)) { + token = scanNumber(); + return token; + } + + // type string permits following case, + // + // namespace.module.MyClass + // + // this reduced 1 token TK_NAME + utility.assert(isTypeName(ch)); + token = scanTypeName(); + return token; + } + } + + function consume(target, text) { + utility.assert(token === target, text || 'consumed token not matched'); + next(); + } + + function expect(target, message) { + if (token !== target) { + utility.throwError(message || 'unexpected token'); + } + next(); + } + + // UnionType := '(' TypeUnionList ')' + // + // TypeUnionList := + // <> + // | NonemptyTypeUnionList + // + // NonemptyTypeUnionList := + // TypeExpression + // | TypeExpression '|' NonemptyTypeUnionList + function parseUnionType() { + var elements; + consume(Token.LPAREN, 'UnionType should start with ('); + elements = []; + if (token !== Token.RPAREN) { + while (true) { + elements.push(parseTypeExpression()); + if (token === Token.RPAREN) { + break; + } + expect(Token.PIPE); + } + } + consume(Token.RPAREN, 'UnionType should end with )'); + return { + type: Syntax.UnionType, + elements: elements + }; + } + + // ArrayType := '[' ElementTypeList ']' + // + // ElementTypeList := + // <> + // | TypeExpression + // | '...' TypeExpression + // | TypeExpression ',' ElementTypeList + function parseArrayType() { + var elements; + consume(Token.LBRACK, 'ArrayType should start with ['); + elements = []; + while (token !== Token.RBRACK) { + if (token === Token.REST) { + consume(Token.REST); + elements.push({ + type: Syntax.RestType, + expression: parseTypeExpression() + }); + break; + } else { + elements.push(parseTypeExpression()); + } + if (token !== Token.RBRACK) { + expect(Token.COMMA); + } + } + expect(Token.RBRACK); + return { + type: Syntax.ArrayType, + elements: elements + }; + } + + function parseFieldName() { + var v = value; + if (token === Token.NAME || token === Token.STRING) { + next(); + return v; + } + + if (token === Token.NUMBER) { + consume(Token.NUMBER); + return String(v); + } + + utility.throwError('unexpected token'); + } + + // FieldType := + // FieldName + // | FieldName ':' TypeExpression + // + // FieldName := + // NameExpression + // | StringLiteral + // | NumberLiteral + // | ReservedIdentifier + function parseFieldType() { + var key; + + key = parseFieldName(); + if (token === Token.COLON) { + consume(Token.COLON); + return { + type: Syntax.FieldType, + key: key, + value: parseTypeExpression() + }; + } + return { + type: Syntax.FieldType, + key: key, + value: null + }; + } + + // RecordType := '{' FieldTypeList '}' + // + // FieldTypeList := + // <> + // | FieldType + // | FieldType ',' FieldTypeList + function parseRecordType() { + var fields; + + consume(Token.LBRACE, 'RecordType should start with {'); + fields = []; + if (token === Token.COMMA) { + consume(Token.COMMA); + } else { + while (token !== Token.RBRACE) { + fields.push(parseFieldType()); + if (token !== Token.RBRACE) { + expect(Token.COMMA); + } + } + } + expect(Token.RBRACE); + return { + type: Syntax.RecordType, + fields: fields + }; + } + + // NameExpression := + // Identifier + // | TagIdentifier ':' Identifier + // + // Tag identifier is one of "module", "external" or "event" + // Identifier is the same as Token.NAME, including any dots, something like + // namespace.module.MyClass + function parseNameExpression() { + var name = value; + expect(Token.NAME); + + if (token === Token.COLON && ( + name === 'module' || + name === 'external' || + name === 'event')) { + consume(Token.COLON); + name += ':' + value; + expect(Token.NAME); + } + + return { + type: Syntax.NameExpression, + name: name + }; + } + + // TypeExpressionList := + // TopLevelTypeExpression + // | TopLevelTypeExpression ',' TypeExpressionList + function parseTypeExpressionList() { + var elements = []; + + elements.push(parseTop()); + while (token === Token.COMMA) { + consume(Token.COMMA); + elements.push(parseTop()); + } + return elements; + } + + // TypeName := + // NameExpression + // | NameExpression TypeApplication + // + // TypeApplication := + // '.<' TypeExpressionList '>' + // | '<' TypeExpressionList '>' // this is extension of doctrine + function parseTypeName() { + var expr, applications; + + expr = parseNameExpression(); + if (token === Token.DOT_LT || token === Token.LT) { + next(); + applications = parseTypeExpressionList(); + expect(Token.GT); + return { + type: Syntax.TypeApplication, + expression: expr, + applications: applications + }; + } + return expr; + } + + // ResultType := + // <> + // | ':' void + // | ':' TypeExpression + // + // BNF is above + // but, we remove <> pattern, so token is always TypeToken::COLON + function parseResultType() { + consume(Token.COLON, 'ResultType should start with :'); + if (token === Token.NAME && value === 'void') { + consume(Token.NAME); + return { + type: Syntax.VoidLiteral + }; + } + return parseTypeExpression(); + } + + // ParametersType := + // RestParameterType + // | NonRestParametersType + // | NonRestParametersType ',' RestParameterType + // + // RestParameterType := + // '...' + // '...' Identifier + // + // NonRestParametersType := + // ParameterType ',' NonRestParametersType + // | ParameterType + // | OptionalParametersType + // + // OptionalParametersType := + // OptionalParameterType + // | OptionalParameterType, OptionalParametersType + // + // OptionalParameterType := ParameterType= + // + // ParameterType := TypeExpression | Identifier ':' TypeExpression + // + // Identifier is "new" or "this" + function parseParametersType() { + var params = [], optionalSequence = false, expr, rest = false; + + while (token !== Token.RPAREN) { + if (token === Token.REST) { + // RestParameterType + consume(Token.REST); + rest = true; + } + + expr = parseTypeExpression(); + if (expr.type === Syntax.NameExpression && token === Token.COLON) { + // Identifier ':' TypeExpression + consume(Token.COLON); + expr = { + type: Syntax.ParameterType, + name: expr.name, + expression: parseTypeExpression() + }; + } + if (token === Token.EQUAL) { + consume(Token.EQUAL); + expr = { + type: Syntax.OptionalType, + expression: expr + }; + optionalSequence = true; + } else { + if (optionalSequence) { + utility.throwError('unexpected token'); + } + } + if (rest) { + expr = { + type: Syntax.RestType, + expression: expr + }; + } + params.push(expr); + if (token !== Token.RPAREN) { + expect(Token.COMMA); + } + } + return params; + } + + // FunctionType := 'function' FunctionSignatureType + // + // FunctionSignatureType := + // | TypeParameters '(' ')' ResultType + // | TypeParameters '(' ParametersType ')' ResultType + // | TypeParameters '(' 'this' ':' TypeName ')' ResultType + // | TypeParameters '(' 'this' ':' TypeName ',' ParametersType ')' ResultType + function parseFunctionType() { + var isNew, thisBinding, params, result, fnType; + utility.assert(token === Token.NAME && value === 'function', 'FunctionType should start with \'function\''); + consume(Token.NAME); + + // Google Closure Compiler is not implementing TypeParameters. + // So we do not. if we don't get '(', we see it as error. + expect(Token.LPAREN); + + isNew = false; + params = []; + thisBinding = null; + if (token !== Token.RPAREN) { + // ParametersType or 'this' + if (token === Token.NAME && + (value === 'this' || value === 'new')) { + // 'this' or 'new' + // 'new' is Closure Compiler extension + isNew = value === 'new'; + consume(Token.NAME); + expect(Token.COLON); + thisBinding = parseTypeName(); + if (token === Token.COMMA) { + consume(Token.COMMA); + params = parseParametersType(); + } + } else { + params = parseParametersType(); + } + } + + expect(Token.RPAREN); + + result = null; + if (token === Token.COLON) { + result = parseResultType(); + } + + fnType = { + type: Syntax.FunctionType, + params: params, + result: result + }; + if (thisBinding) { + // avoid adding null 'new' and 'this' properties + fnType['this'] = thisBinding; + if (isNew) { + fnType['new'] = true; + } + } + return fnType; + } + + // BasicTypeExpression := + // '*' + // | 'null' + // | 'undefined' + // | TypeName + // | FunctionType + // | UnionType + // | RecordType + // | ArrayType + function parseBasicTypeExpression() { + var context; + switch (token) { + case Token.STAR: + consume(Token.STAR); + return { + type: Syntax.AllLiteral + }; + + case Token.LPAREN: + return parseUnionType(); + + case Token.LBRACK: + return parseArrayType(); + + case Token.LBRACE: + return parseRecordType(); + + case Token.NAME: + if (value === 'null') { + consume(Token.NAME); + return { + type: Syntax.NullLiteral + }; + } + + if (value === 'undefined') { + consume(Token.NAME); + return { + type: Syntax.UndefinedLiteral + }; + } + + if (value === 'true' || value === 'false') { + consume(Token.NAME); + return { + type: Syntax.BooleanLiteralType, + value: value === 'true' + }; + } + + context = Context.save(); + if (value === 'function') { + try { + return parseFunctionType(); + } catch (e) { + context.restore(); + } + } + + return parseTypeName(); + + case Token.STRING: + next(); + return { + type: Syntax.StringLiteralType, + value: value + }; + + case Token.NUMBER: + next(); + return { + type: Syntax.NumericLiteralType, + value: value + }; + + default: + utility.throwError('unexpected token'); + } + } + + // TypeExpression := + // BasicTypeExpression + // | '?' BasicTypeExpression + // | '!' BasicTypeExpression + // | BasicTypeExpression '?' + // | BasicTypeExpression '!' + // | '?' + // | BasicTypeExpression '[]' + function parseTypeExpression() { + var expr; + + if (token === Token.QUESTION) { + consume(Token.QUESTION); + if (token === Token.COMMA || token === Token.EQUAL || token === Token.RBRACE || + token === Token.RPAREN || token === Token.PIPE || token === Token.EOF || + token === Token.RBRACK || token === Token.GT) { + return { + type: Syntax.NullableLiteral + }; + } + return { + type: Syntax.NullableType, + expression: parseBasicTypeExpression(), + prefix: true + }; + } + + if (token === Token.BANG) { + consume(Token.BANG); + return { + type: Syntax.NonNullableType, + expression: parseBasicTypeExpression(), + prefix: true + }; + } + + expr = parseBasicTypeExpression(); + if (token === Token.BANG) { + consume(Token.BANG); + return { + type: Syntax.NonNullableType, + expression: expr, + prefix: false + }; + } + + if (token === Token.QUESTION) { + consume(Token.QUESTION); + return { + type: Syntax.NullableType, + expression: expr, + prefix: false + }; + } + + if (token === Token.LBRACK) { + consume(Token.LBRACK); + expect(Token.RBRACK, 'expected an array-style type declaration (' + value + '[])'); + return { + type: Syntax.TypeApplication, + expression: { + type: Syntax.NameExpression, + name: 'Array' + }, + applications: [expr] + }; + } + + return expr; + } + + // TopLevelTypeExpression := + // TypeExpression + // | TypeUnionList + // + // This rule is Google Closure Compiler extension, not ES4 + // like, + // { number | string } + // If strict to ES4, we should write it as + // { (number|string) } + function parseTop() { + var expr, elements; + + expr = parseTypeExpression(); + if (token !== Token.PIPE) { + return expr; + } + + elements = [expr]; + consume(Token.PIPE); + while (true) { + elements.push(parseTypeExpression()); + if (token !== Token.PIPE) { + break; + } + consume(Token.PIPE); + } + + return { + type: Syntax.UnionType, + elements: elements + }; + } + + function parseTopParamType() { + var expr; + + if (token === Token.REST) { + consume(Token.REST); + return { + type: Syntax.RestType, + expression: parseTop() + }; + } + + expr = parseTop(); + if (token === Token.EQUAL) { + consume(Token.EQUAL); + return { + type: Syntax.OptionalType, + expression: expr + }; + } + + return expr; + } + + function parseType(src, opt) { + var expr; + + source = src; + length = source.length; + index = 0; + previous = 0; + + next(); + expr = parseTop(); + + if (opt && opt.midstream) { + return { + expression: expr, + index: previous + }; + } + + if (token !== Token.EOF) { + utility.throwError('not reach to EOF'); + } + + return expr; + } + + function parseParamType(src, opt) { + var expr; + + source = src; + length = source.length; + index = 0; + previous = 0; + + next(); + expr = parseTopParamType(); + + if (opt && opt.midstream) { + return { + expression: expr, + index: previous + }; + } + + if (token !== Token.EOF) { + utility.throwError('not reach to EOF'); + } + + return expr; + } + + function stringifyImpl(node, compact, topLevel) { + var result, i, iz; + + switch (node.type) { + case Syntax.NullableLiteral: + result = '?'; + break; + + case Syntax.AllLiteral: + result = '*'; + break; + + case Syntax.NullLiteral: + result = 'null'; + break; + + case Syntax.UndefinedLiteral: + result = 'undefined'; + break; + + case Syntax.VoidLiteral: + result = 'void'; + break; + + case Syntax.UnionType: + if (!topLevel) { + result = '('; + } else { + result = ''; + } + + for (i = 0, iz = node.elements.length; i < iz; ++i) { + result += stringifyImpl(node.elements[i], compact); + if ((i + 1) !== iz) { + result += '|'; + } + } + + if (!topLevel) { + result += ')'; + } + break; + + case Syntax.ArrayType: + result = '['; + for (i = 0, iz = node.elements.length; i < iz; ++i) { + result += stringifyImpl(node.elements[i], compact); + if ((i + 1) !== iz) { + result += compact ? ',' : ', '; + } + } + result += ']'; + break; + + case Syntax.RecordType: + result = '{'; + for (i = 0, iz = node.fields.length; i < iz; ++i) { + result += stringifyImpl(node.fields[i], compact); + if ((i + 1) !== iz) { + result += compact ? ',' : ', '; + } + } + result += '}'; + break; + + case Syntax.FieldType: + if (node.value) { + result = node.key + (compact ? ':' : ': ') + stringifyImpl(node.value, compact); + } else { + result = node.key; + } + break; + + case Syntax.FunctionType: + result = compact ? 'function(' : 'function ('; + + if (node['this']) { + if (node['new']) { + result += (compact ? 'new:' : 'new: '); + } else { + result += (compact ? 'this:' : 'this: '); + } + + result += stringifyImpl(node['this'], compact); + + if (node.params.length !== 0) { + result += compact ? ',' : ', '; + } + } + + for (i = 0, iz = node.params.length; i < iz; ++i) { + result += stringifyImpl(node.params[i], compact); + if ((i + 1) !== iz) { + result += compact ? ',' : ', '; + } + } + + result += ')'; + + if (node.result) { + result += (compact ? ':' : ': ') + stringifyImpl(node.result, compact); + } + break; + + case Syntax.ParameterType: + result = node.name + (compact ? ':' : ': ') + stringifyImpl(node.expression, compact); + break; + + case Syntax.RestType: + result = '...'; + if (node.expression) { + result += stringifyImpl(node.expression, compact); + } + break; + + case Syntax.NonNullableType: + if (node.prefix) { + result = '!' + stringifyImpl(node.expression, compact); + } else { + result = stringifyImpl(node.expression, compact) + '!'; + } + break; + + case Syntax.OptionalType: + result = stringifyImpl(node.expression, compact) + '='; + break; + + case Syntax.NullableType: + if (node.prefix) { + result = '?' + stringifyImpl(node.expression, compact); + } else { + result = stringifyImpl(node.expression, compact) + '?'; + } + break; + + case Syntax.NameExpression: + result = node.name; + break; + + case Syntax.TypeApplication: + result = stringifyImpl(node.expression, compact) + '.<'; + for (i = 0, iz = node.applications.length; i < iz; ++i) { + result += stringifyImpl(node.applications[i], compact); + if ((i + 1) !== iz) { + result += compact ? ',' : ', '; + } + } + result += '>'; + break; + + case Syntax.StringLiteralType: + result = '"' + node.value + '"'; + break; + + case Syntax.NumericLiteralType: + result = String(node.value); + break; + + case Syntax.BooleanLiteralType: + result = String(node.value); + break; + + default: + utility.throwError('Unknown type ' + node.type); + } + + return result; + } + + function stringify(node, options) { + if (options == null) { + options = {}; + } + return stringifyImpl(node, options.compact, options.topLevel); + } + + exports.parseType = parseType; + exports.parseParamType = parseParamType; + exports.stringify = stringify; + exports.Syntax = Syntax; +}()); +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-plugin-import/node_modules/doctrine/lib/utility.js b/node_modules/eslint-plugin-import/node_modules/doctrine/lib/utility.js new file mode 100644 index 000000000..381580ebe --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/doctrine/lib/utility.js @@ -0,0 +1,35 @@ +/* + * @fileoverview Utilities for Doctrine + * @author Yusuke Suzuki + */ + + +(function () { + 'use strict'; + + var VERSION; + + VERSION = require('../package.json').version; + exports.VERSION = VERSION; + + function DoctrineError(message) { + this.name = 'DoctrineError'; + this.message = message; + } + DoctrineError.prototype = (function () { + var Middle = function () { }; + Middle.prototype = Error.prototype; + return new Middle(); + }()); + DoctrineError.prototype.constructor = DoctrineError; + exports.DoctrineError = DoctrineError; + + function throwError(message) { + throw new DoctrineError(message); + } + exports.throwError = throwError; + + exports.assert = require('assert'); +}()); + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-plugin-import/node_modules/doctrine/package.json b/node_modules/eslint-plugin-import/node_modules/doctrine/package.json new file mode 100644 index 000000000..4454768df --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/doctrine/package.json @@ -0,0 +1,65 @@ +{ + "name": "doctrine", + "description": "JSDoc parser", + "homepage": "https://github.com/eslint/doctrine", + "main": "lib/doctrine.js", + "version": "1.5.0", + "engines": { + "node": ">=0.10.0" + }, + "directories": { + "lib": "./lib" + }, + "files": [ + "lib", + "LICENSE.BSD", + "LICENSE.closure-compiler", + "LICENSE.esprima", + "README.md" + ], + "maintainers": [ + { + "name": "Nicholas C. Zakas", + "email": "nicholas+npm@nczconsulting.com", + "web": "https://www.nczonline.net" + }, + { + "name": "Yusuke Suzuki", + "email": "utatane.tea@gmail.com", + "web": "https://github.com/Constellation" + } + ], + "repository": "eslint/doctrine", + "devDependencies": { + "coveralls": "^2.11.2", + "dateformat": "^1.0.11", + "eslint": "^1.10.3", + "eslint-release": "^0.10.0", + "istanbul": "^0.4.1", + "linefix": "^0.1.1", + "mocha": "^2.3.3", + "npm-license": "^0.3.1", + "semver": "^5.0.3", + "shelljs": "^0.5.3", + "shelljs-nodecli": "^0.1.1", + "should": "^5.0.1" + }, + "licenses": [ + { + "type": "BSD", + "url": "http://github.com/eslint/doctrine/raw/master/LICENSE.BSD" + } + ], + "scripts": { + "test": "npm run lint && node Makefile.js test", + "lint": "eslint lib/", + "release": "eslint-release", + "ci-release": "eslint-ci-release", + "alpharelease": "eslint-prerelease alpha", + "betarelease": "eslint-prerelease beta" + }, + "dependencies": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + } +} \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/node_modules/isarray/.npmignore b/node_modules/eslint-plugin-import/node_modules/isarray/.npmignore new file mode 100644 index 000000000..3c3629e64 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/isarray/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/eslint-plugin-import/node_modules/isarray/.travis.yml b/node_modules/eslint-plugin-import/node_modules/isarray/.travis.yml new file mode 100644 index 000000000..cc4dba29d --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/isarray/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/node_modules/eslint-plugin-import/node_modules/isarray/Makefile b/node_modules/eslint-plugin-import/node_modules/isarray/Makefile new file mode 100644 index 000000000..787d56e1e --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/isarray/Makefile @@ -0,0 +1,6 @@ + +test: + @node_modules/.bin/tape test.js + +.PHONY: test + diff --git a/node_modules/eslint-plugin-import/node_modules/isarray/README.md b/node_modules/eslint-plugin-import/node_modules/isarray/README.md new file mode 100644 index 000000000..16d2c59c6 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/isarray/README.md @@ -0,0 +1,60 @@ + +# isarray + +`Array#isArray` for older browsers. + +[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray) +[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray) + +[![browser support](https://ci.testling.com/juliangruber/isarray.png) +](https://ci.testling.com/juliangruber/isarray) + +## Usage + +```js +var isArray = require('isarray'); + +console.log(isArray([])); // => true +console.log(isArray({})); // => false +``` + +## Installation + +With [npm](http://npmjs.org) do + +```bash +$ npm install isarray +``` + +Then bundle for the browser with +[browserify](https://github.com/substack/browserify). + +With [component](http://component.io) do + +```bash +$ component install juliangruber/isarray +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/eslint-plugin-import/node_modules/isarray/component.json b/node_modules/eslint-plugin-import/node_modules/isarray/component.json new file mode 100644 index 000000000..9e31b6838 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/isarray/component.json @@ -0,0 +1,19 @@ +{ + "name" : "isarray", + "description" : "Array#isArray for older browsers", + "version" : "0.0.1", + "repository" : "juliangruber/isarray", + "homepage": "https://github.com/juliangruber/isarray", + "main" : "index.js", + "scripts" : [ + "index.js" + ], + "dependencies" : {}, + "keywords": ["browser","isarray","array"], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT" +} diff --git a/node_modules/eslint-plugin-import/node_modules/isarray/index.js b/node_modules/eslint-plugin-import/node_modules/isarray/index.js new file mode 100644 index 000000000..a57f63495 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/isarray/index.js @@ -0,0 +1,5 @@ +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; diff --git a/node_modules/eslint-plugin-import/node_modules/isarray/package.json b/node_modules/eslint-plugin-import/node_modules/isarray/package.json new file mode 100644 index 000000000..a732aec72 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/isarray/package.json @@ -0,0 +1,45 @@ +{ + "name": "isarray", + "description": "Array#isArray for older browsers", + "version": "1.0.0", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/isarray.git" + }, + "homepage": "https://github.com/juliangruber/isarray", + "main": "index.js", + "dependencies": {}, + "devDependencies": { + "tape": "~2.13.4" + }, + "keywords": [ + "browser", + "isarray", + "array" + ], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test.js", + "browsers": [ + "ie/8..latest", + "firefox/17..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "scripts": { + "test": "tape test.js" + } +} \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/node_modules/isarray/test.js b/node_modules/eslint-plugin-import/node_modules/isarray/test.js new file mode 100644 index 000000000..e0c3444d8 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/isarray/test.js @@ -0,0 +1,20 @@ +var isArray = require('./'); +var test = require('tape'); + +test('is array', function(t){ + t.ok(isArray([])); + t.notOk(isArray({})); + t.notOk(isArray(null)); + t.notOk(isArray(false)); + + var obj = {}; + obj[0] = true; + t.notOk(isArray(obj)); + + var arr = []; + arr.foo = 'bar'; + t.ok(isArray(arr)); + + t.end(); +}); + diff --git a/node_modules/eslint-plugin-import/node_modules/ms/index.js b/node_modules/eslint-plugin-import/node_modules/ms/index.js new file mode 100644 index 000000000..6a522b16b --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/ms/index.js @@ -0,0 +1,152 @@ +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isNaN(val) === false) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtShort(ms) { + if (ms >= d) { + return Math.round(ms / d) + 'd'; + } + if (ms >= h) { + return Math.round(ms / h) + 'h'; + } + if (ms >= m) { + return Math.round(ms / m) + 'm'; + } + if (ms >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtLong(ms) { + return plural(ms, d, 'day') || + plural(ms, h, 'hour') || + plural(ms, m, 'minute') || + plural(ms, s, 'second') || + ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, n, name) { + if (ms < n) { + return; + } + if (ms < n * 1.5) { + return Math.floor(ms / n) + ' ' + name; + } + return Math.ceil(ms / n) + ' ' + name + 's'; +} diff --git a/node_modules/eslint-plugin-import/node_modules/ms/license.md b/node_modules/eslint-plugin-import/node_modules/ms/license.md new file mode 100644 index 000000000..69b61253a --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/ms/license.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Zeit, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/eslint-plugin-import/node_modules/ms/package.json b/node_modules/eslint-plugin-import/node_modules/ms/package.json new file mode 100644 index 000000000..63aaff3ab --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/ms/package.json @@ -0,0 +1,37 @@ +{ + "name": "ms", + "version": "2.0.0", + "description": "Tiny milisecond conversion utility", + "repository": "zeit/ms", + "main": "./index", + "files": [ + "index.js" + ], + "scripts": { + "precommit": "lint-staged", + "lint": "eslint lib/* bin/*", + "test": "mocha tests.js" + }, + "eslintConfig": { + "extends": "eslint:recommended", + "env": { + "node": true, + "es6": true + } + }, + "lint-staged": { + "*.js": [ + "npm run lint", + "prettier --single-quote --write", + "git add" + ] + }, + "license": "MIT", + "devDependencies": { + "eslint": "3.19.0", + "expect.js": "0.3.1", + "husky": "0.13.3", + "lint-staged": "3.4.1", + "mocha": "3.4.1" + } +} \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/node_modules/ms/readme.md b/node_modules/eslint-plugin-import/node_modules/ms/readme.md new file mode 100644 index 000000000..84a9974cc --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/ms/readme.md @@ -0,0 +1,51 @@ +# ms + +[![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms) +[![Slack Channel](http://zeit-slackin.now.sh/badge.svg)](https://zeit.chat/) + +Use this package to easily convert various time formats to milliseconds. + +## Examples + +```js +ms('2 days') // 172800000 +ms('1d') // 86400000 +ms('10h') // 36000000 +ms('2.5 hrs') // 9000000 +ms('2h') // 7200000 +ms('1m') // 60000 +ms('5s') // 5000 +ms('1y') // 31557600000 +ms('100') // 100 +``` + +### Convert from milliseconds + +```js +ms(60000) // "1m" +ms(2 * 60000) // "2m" +ms(ms('10 hours')) // "10h" +``` + +### Time format written-out + +```js +ms(60000, { long: true }) // "1 minute" +ms(2 * 60000, { long: true }) // "2 minutes" +ms(ms('10 hours'), { long: true }) // "10 hours" +``` + +## Features + +- Works both in [node](https://nodejs.org) and in the browser. +- If a number is supplied to `ms`, a string with a unit is returned. +- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`). +- If you pass a string with a number and a valid unit, the number of equivalent ms is returned. + +## Caught a bug? + +1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device +2. Link the package to the global module directory: `npm link` +3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, node will now use your clone of ms! + +As always, you can run the tests using: `npm test` diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/.editorconfig b/node_modules/eslint-plugin-import/node_modules/resolve/.editorconfig new file mode 100644 index 000000000..bc228f826 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 150 + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/.eslintignore b/node_modules/eslint-plugin-import/node_modules/resolve/.eslintignore new file mode 100644 index 000000000..3c3629e64 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/.eslintignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/.eslintrc b/node_modules/eslint-plugin-import/node_modules/resolve/.eslintrc new file mode 100644 index 000000000..a22863c8c --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/.eslintrc @@ -0,0 +1,39 @@ +{ + "extends": "@ljharb", + "root": true, + "rules": { + "array-bracket-newline": 0, + "array-element-newline": 0, + "indent": [2, 4], + "strict": 0, + "complexity": 0, + "consistent-return": 0, + "curly": 0, + "dot-notation": [2, { "allowKeywords": true }], + "func-name-matching": 0, + "func-style": 0, + "global-require": 0, + "id-length": [2, { "min": 1, "max": 30 }], + "max-lines-per-function": 0, + "max-nested-callbacks": 0, + "max-params": 0, + "max-statements-per-line": [2, { "max": 2 }], + "max-statements": 0, + "no-magic-numbers": 0, + "no-console": 0, + "no-shadow": 0, + "no-unused-vars": [2, { "vars": "all", "args": "none" }], + "no-use-before-define": 0, + "object-curly-newline": 0, + "operator-linebreak": [2, "before"], + "sort-keys": 0, + }, + "overrides": [ + { + "files": "test/resolver/nested_symlinks/mylib/*.js", + "rules": { + "no-throw-literal": 0, + }, + }, + ], +} diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/.travis.yml b/node_modules/eslint-plugin-import/node_modules/resolve/.travis.yml new file mode 100644 index 000000000..5ed0fa52f --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/.travis.yml @@ -0,0 +1,8 @@ +version: ~> 1.0 +language: node_js +os: + - linux +import: + - ljharb/travis-ci:node/all.yml + - ljharb/travis-ci:node/pretest.yml + - ljharb/travis-ci:node/posttest.yml diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/LICENSE b/node_modules/eslint-plugin-import/node_modules/resolve/LICENSE new file mode 100644 index 000000000..ff4fce28a --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2012 James Halliday + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/appveyor.yml b/node_modules/eslint-plugin-import/node_modules/resolve/appveyor.yml new file mode 100644 index 000000000..9458fb82b --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/appveyor.yml @@ -0,0 +1,54 @@ +version: 1.0.{build} +skip_branch_with_pr: true +build: off + +environment: + matrix: + - nodejs_version: "12" + - nodejs_version: "11" + - nodejs_version: "10" + - nodejs_version: "9" + - nodejs_version: "8" + - nodejs_version: "7" + - nodejs_version: "6" + - nodejs_version: "5" + - nodejs_version: "4" + - nodejs_version: "3" + - nodejs_version: "2" + - nodejs_version: "1" + - nodejs_version: "0.12" + - nodejs_version: "0.10" + - nodejs_version: "0.8" + - nodejs_version: "0.6" +matrix: + # fast_finish: true + allow_failures: + - nodejs_version: "5" # due to windows npm bug, registry-side + - nodejs_version: "0.8" + - nodejs_version: "0.6" + +platform: + - x86 + - x64 + +# Install scripts. (runs after repo cloning) +install: + # Fix symlinks in working copy (see https://github.com/appveyor/ci/issues/650#issuecomment-186592582) / https://github.com/charleskorn/batect/commit/d08986802ec43086902958c4ee7e57ff3e71dbef + - git config core.symlinks true + - git reset --hard + # Get the latest stable version of Node.js or io.js + - ps: Install-Product node $env:nodejs_version $env:platform + - IF %nodejs_version% EQU 0.6 npm config set strict-ssl false && npm -g install npm@1.3 + - IF %nodejs_version% EQU 0.8 npm config set strict-ssl false && npm -g install npm@1.4.28 && npm install -g npm@4.5 + - set PATH=%APPDATA%\npm;%PATH% + #- IF %nodejs_version% NEQ 0.6 AND %nodejs_version% NEQ 0.8 npm -g install npm + # install modules + - npm install + +# Post-install test scripts. +test_script: + # Output useful info for debugging. + - node --version + - npm --version + # run tests + - npm run tests-only diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/example/async.js b/node_modules/eslint-plugin-import/node_modules/resolve/example/async.js new file mode 100644 index 000000000..20e65dc28 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/example/async.js @@ -0,0 +1,5 @@ +var resolve = require('../'); +resolve('tap', { basedir: __dirname }, function (err, res) { + if (err) console.error(err); + else console.log(res); +}); diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/example/sync.js b/node_modules/eslint-plugin-import/node_modules/resolve/example/sync.js new file mode 100644 index 000000000..54b2cc100 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/example/sync.js @@ -0,0 +1,3 @@ +var resolve = require('../'); +var res = resolve.sync('tap', { basedir: __dirname }); +console.log(res); diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/index.js b/node_modules/eslint-plugin-import/node_modules/resolve/index.js new file mode 100644 index 000000000..125d81464 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/index.js @@ -0,0 +1,6 @@ +var async = require('./lib/async'); +async.core = require('./lib/core'); +async.isCore = require('./lib/is-core'); +async.sync = require('./lib/sync'); + +module.exports = async; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/lib/async.js b/node_modules/eslint-plugin-import/node_modules/resolve/lib/async.js new file mode 100644 index 000000000..06aa45883 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/lib/async.js @@ -0,0 +1,298 @@ +var fs = require('fs'); +var path = require('path'); +var caller = require('./caller.js'); +var nodeModulesPaths = require('./node-modules-paths.js'); +var normalizeOptions = require('./normalize-options.js'); +var isCore = require('./is-core'); + +var realpathFS = fs.realpath && typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath; + +var defaultIsFile = function isFile(file, cb) { + fs.stat(file, function (err, stat) { + if (!err) { + return cb(null, stat.isFile() || stat.isFIFO()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); +}; + +var defaultIsDir = function isDirectory(dir, cb) { + fs.stat(dir, function (err, stat) { + if (!err) { + return cb(null, stat.isDirectory()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); +}; + +var defaultRealpath = function realpath(x, cb) { + realpathFS(x, function (realpathErr, realPath) { + if (realpathErr && realpathErr.code !== 'ENOENT') cb(realpathErr); + else cb(null, realpathErr ? x : realPath); + }); +}; + +var maybeRealpath = function maybeRealpath(realpath, x, opts, cb) { + if (opts && opts.preserveSymlinks === false) { + realpath(x, cb); + } else { + cb(null, x); + } +}; + +var getPackageCandidates = function getPackageCandidates(x, start, opts) { + var dirs = nodeModulesPaths(start, opts, x); + for (var i = 0; i < dirs.length; i++) { + dirs[i] = path.join(dirs[i], x); + } + return dirs; +}; + +module.exports = function resolve(x, options, callback) { + var cb = callback; + var opts = options; + if (typeof options === 'function') { + cb = opts; + opts = {}; + } + if (typeof x !== 'string') { + var err = new TypeError('Path must be a string.'); + return process.nextTick(function () { + cb(err); + }); + } + + opts = normalizeOptions(x, opts); + + var isFile = opts.isFile || defaultIsFile; + var isDirectory = opts.isDirectory || defaultIsDir; + var readFile = opts.readFile || fs.readFile; + var realpath = opts.realpath || defaultRealpath; + var packageIterator = opts.packageIterator; + + var extensions = opts.extensions || ['.js']; + var basedir = opts.basedir || path.dirname(caller()); + var parent = opts.filename || basedir; + + opts.paths = opts.paths || []; + + // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory + var absoluteStart = path.resolve(basedir); + + maybeRealpath( + realpath, + absoluteStart, + opts, + function (err, realStart) { + if (err) cb(err); + else init(realStart); + } + ); + + var res; + function init(basedir) { + if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) { + res = path.resolve(basedir, x); + if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/'; + if ((/\/$/).test(x) && res === basedir) { + loadAsDirectory(res, opts.package, onfile); + } else loadAsFile(res, opts.package, onfile); + } else if (isCore(x)) { + return cb(null, x); + } else loadNodeModules(x, basedir, function (err, n, pkg) { + if (err) cb(err); + else if (n) { + return maybeRealpath(realpath, n, opts, function (err, realN) { + if (err) { + cb(err); + } else { + cb(null, realN, pkg); + } + }); + } else { + var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'"); + moduleError.code = 'MODULE_NOT_FOUND'; + cb(moduleError); + } + }); + } + + function onfile(err, m, pkg) { + if (err) cb(err); + else if (m) cb(null, m, pkg); + else loadAsDirectory(res, function (err, d, pkg) { + if (err) cb(err); + else if (d) { + maybeRealpath(realpath, d, opts, function (err, realD) { + if (err) { + cb(err); + } else { + cb(null, realD, pkg); + } + }); + } else { + var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'"); + moduleError.code = 'MODULE_NOT_FOUND'; + cb(moduleError); + } + }); + } + + function loadAsFile(x, thePackage, callback) { + var loadAsFilePackage = thePackage; + var cb = callback; + if (typeof loadAsFilePackage === 'function') { + cb = loadAsFilePackage; + loadAsFilePackage = undefined; + } + + var exts = [''].concat(extensions); + load(exts, x, loadAsFilePackage); + + function load(exts, x, loadPackage) { + if (exts.length === 0) return cb(null, undefined, loadPackage); + var file = x + exts[0]; + + var pkg = loadPackage; + if (pkg) onpkg(null, pkg); + else loadpkg(path.dirname(file), onpkg); + + function onpkg(err, pkg_, dir) { + pkg = pkg_; + if (err) return cb(err); + if (dir && pkg && opts.pathFilter) { + var rfile = path.relative(dir, file); + var rel = rfile.slice(0, rfile.length - exts[0].length); + var r = opts.pathFilter(pkg, x, rel); + if (r) return load( + [''].concat(extensions.slice()), + path.resolve(dir, r), + pkg + ); + } + isFile(file, onex); + } + function onex(err, ex) { + if (err) return cb(err); + if (ex) return cb(null, file, pkg); + load(exts.slice(1), x, pkg); + } + } + } + + function loadpkg(dir, cb) { + if (dir === '' || dir === '/') return cb(null); + if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) { + return cb(null); + } + if ((/[/\\]node_modules[/\\]*$/).test(dir)) return cb(null); + + maybeRealpath(realpath, dir, opts, function (unwrapErr, pkgdir) { + if (unwrapErr) return loadpkg(path.dirname(dir), cb); + var pkgfile = path.join(pkgdir, 'package.json'); + isFile(pkgfile, function (err, ex) { + // on err, ex is false + if (!ex) return loadpkg(path.dirname(dir), cb); + + readFile(pkgfile, function (err, body) { + if (err) cb(err); + try { var pkg = JSON.parse(body); } catch (jsonErr) {} + + if (pkg && opts.packageFilter) { + pkg = opts.packageFilter(pkg, pkgfile); + } + cb(null, pkg, dir); + }); + }); + }); + } + + function loadAsDirectory(x, loadAsDirectoryPackage, callback) { + var cb = callback; + var fpkg = loadAsDirectoryPackage; + if (typeof fpkg === 'function') { + cb = fpkg; + fpkg = opts.package; + } + + maybeRealpath(realpath, x, opts, function (unwrapErr, pkgdir) { + if (unwrapErr) return cb(unwrapErr); + var pkgfile = path.join(pkgdir, 'package.json'); + isFile(pkgfile, function (err, ex) { + if (err) return cb(err); + if (!ex) return loadAsFile(path.join(x, 'index'), fpkg, cb); + + readFile(pkgfile, function (err, body) { + if (err) return cb(err); + try { + var pkg = JSON.parse(body); + } catch (jsonErr) {} + + if (pkg && opts.packageFilter) { + pkg = opts.packageFilter(pkg, pkgfile); + } + + if (pkg && pkg.main) { + if (typeof pkg.main !== 'string') { + var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string'); + mainError.code = 'INVALID_PACKAGE_MAIN'; + return cb(mainError); + } + if (pkg.main === '.' || pkg.main === './') { + pkg.main = 'index'; + } + loadAsFile(path.resolve(x, pkg.main), pkg, function (err, m, pkg) { + if (err) return cb(err); + if (m) return cb(null, m, pkg); + if (!pkg) return loadAsFile(path.join(x, 'index'), pkg, cb); + + var dir = path.resolve(x, pkg.main); + loadAsDirectory(dir, pkg, function (err, n, pkg) { + if (err) return cb(err); + if (n) return cb(null, n, pkg); + loadAsFile(path.join(x, 'index'), pkg, cb); + }); + }); + return; + } + + loadAsFile(path.join(x, '/index'), pkg, cb); + }); + }); + }); + } + + function processDirs(cb, dirs) { + if (dirs.length === 0) return cb(null, undefined); + var dir = dirs[0]; + + isDirectory(path.dirname(dir), isdir); + + function isdir(err, isdir) { + if (err) return cb(err); + if (!isdir) return processDirs(cb, dirs.slice(1)); + loadAsFile(dir, opts.package, onfile); + } + + function onfile(err, m, pkg) { + if (err) return cb(err); + if (m) return cb(null, m, pkg); + loadAsDirectory(dir, opts.package, ondir); + } + + function ondir(err, n, pkg) { + if (err) return cb(err); + if (n) return cb(null, n, pkg); + processDirs(cb, dirs.slice(1)); + } + } + function loadNodeModules(x, start, cb) { + var thunk = function () { return getPackageCandidates(x, start, opts); }; + processDirs( + cb, + packageIterator ? packageIterator(x, start, thunk, opts) : thunk() + ); + } +}; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/lib/caller.js b/node_modules/eslint-plugin-import/node_modules/resolve/lib/caller.js new file mode 100644 index 000000000..b14a2804a --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/lib/caller.js @@ -0,0 +1,8 @@ +module.exports = function () { + // see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi + var origPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = function (_, stack) { return stack; }; + var stack = (new Error()).stack; + Error.prepareStackTrace = origPrepareStackTrace; + return stack[2].getFileName(); +}; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/lib/core.js b/node_modules/eslint-plugin-import/node_modules/resolve/lib/core.js new file mode 100644 index 000000000..0877650cc --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/lib/core.js @@ -0,0 +1,53 @@ +var current = (process.versions && process.versions.node && process.versions.node.split('.')) || []; + +function specifierIncluded(specifier) { + var parts = specifier.split(' '); + var op = parts.length > 1 ? parts[0] : '='; + var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.'); + + for (var i = 0; i < 3; ++i) { + var cur = Number(current[i] || 0); + var ver = Number(versionParts[i] || 0); + if (cur === ver) { + continue; // eslint-disable-line no-restricted-syntax, no-continue + } + if (op === '<') { + return cur < ver; + } else if (op === '>=') { + return cur >= ver; + } else { + return false; + } + } + return op === '>='; +} + +function matchesRange(range) { + var specifiers = range.split(/ ?&& ?/); + if (specifiers.length === 0) { return false; } + for (var i = 0; i < specifiers.length; ++i) { + if (!specifierIncluded(specifiers[i])) { return false; } + } + return true; +} + +function versionIncluded(specifierValue) { + if (typeof specifierValue === 'boolean') { return specifierValue; } + if (specifierValue && typeof specifierValue === 'object') { + for (var i = 0; i < specifierValue.length; ++i) { + if (matchesRange(specifierValue[i])) { return true; } + } + return false; + } + return matchesRange(specifierValue); +} + +var data = require('./core.json'); + +var core = {}; +for (var mod in data) { // eslint-disable-line no-restricted-syntax + if (Object.prototype.hasOwnProperty.call(data, mod)) { + core[mod] = versionIncluded(data[mod]); + } +} +module.exports = core; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/lib/core.json b/node_modules/eslint-plugin-import/node_modules/resolve/lib/core.json new file mode 100644 index 000000000..d51b70b14 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/lib/core.json @@ -0,0 +1,75 @@ +{ + "assert": true, + "async_hooks": ">= 8", + "buffer_ieee754": "< 0.9.7", + "buffer": true, + "child_process": true, + "cluster": true, + "console": true, + "constants": true, + "crypto": true, + "_debug_agent": ">= 1 && < 8", + "_debugger": "< 8", + "dgram": true, + "dns": true, + "domain": true, + "events": true, + "freelist": "< 6", + "fs": true, + "fs/promises": [">= 10 && < 10.1", ">= 14"], + "_http_agent": ">= 0.11.1", + "_http_client": ">= 0.11.1", + "_http_common": ">= 0.11.1", + "_http_incoming": ">= 0.11.1", + "_http_outgoing": ">= 0.11.1", + "_http_server": ">= 0.11.1", + "http": true, + "http2": ">= 8.8", + "https": true, + "inspector": ">= 8.0.0", + "_linklist": "< 8", + "module": true, + "net": true, + "node-inspect/lib/_inspect": ">= 7.6.0 && < 12", + "node-inspect/lib/internal/inspect_client": ">= 7.6.0 && < 12", + "node-inspect/lib/internal/inspect_repl": ">= 7.6.0 && < 12", + "os": true, + "path": true, + "perf_hooks": ">= 8.5", + "process": ">= 1", + "punycode": true, + "querystring": true, + "readline": true, + "repl": true, + "smalloc": ">= 0.11.5 && < 3", + "_stream_duplex": ">= 0.9.4", + "_stream_transform": ">= 0.9.4", + "_stream_wrap": ">= 1.4.1", + "_stream_passthrough": ">= 0.9.4", + "_stream_readable": ">= 0.9.4", + "_stream_writable": ">= 0.9.4", + "stream": true, + "string_decoder": true, + "sys": true, + "timers": true, + "_tls_common": ">= 0.11.13", + "_tls_legacy": ">= 0.11.3 && < 10", + "_tls_wrap": ">= 0.11.3", + "tls": true, + "trace_events": ">= 10", + "tty": true, + "url": true, + "util": true, + "v8/tools/arguments": ">= 10 && < 12", + "v8/tools/codemap": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], + "v8/tools/consarray": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], + "v8/tools/csvparser": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], + "v8/tools/logreader": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], + "v8/tools/profile_view": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], + "v8/tools/splaytree": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], + "v8": ">= 1", + "vm": true, + "wasi": ">= 13.4 && < 13.5", + "worker_threads": ">= 11.7", + "zlib": true +} diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/lib/is-core.js b/node_modules/eslint-plugin-import/node_modules/resolve/lib/is-core.js new file mode 100644 index 000000000..48bc96c47 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/lib/is-core.js @@ -0,0 +1,5 @@ +var core = require('./core'); + +module.exports = function isCore(x) { + return Object.prototype.hasOwnProperty.call(core, x); +}; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/lib/node-modules-paths.js b/node_modules/eslint-plugin-import/node_modules/resolve/lib/node-modules-paths.js new file mode 100644 index 000000000..2b43813a7 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/lib/node-modules-paths.js @@ -0,0 +1,42 @@ +var path = require('path'); +var parse = path.parse || require('path-parse'); + +var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) { + var prefix = '/'; + if ((/^([A-Za-z]:)/).test(absoluteStart)) { + prefix = ''; + } else if ((/^\\\\/).test(absoluteStart)) { + prefix = '\\\\'; + } + + var paths = [absoluteStart]; + var parsed = parse(absoluteStart); + while (parsed.dir !== paths[paths.length - 1]) { + paths.push(parsed.dir); + parsed = parse(parsed.dir); + } + + return paths.reduce(function (dirs, aPath) { + return dirs.concat(modules.map(function (moduleDir) { + return path.resolve(prefix, aPath, moduleDir); + })); + }, []); +}; + +module.exports = function nodeModulesPaths(start, opts, request) { + var modules = opts && opts.moduleDirectory + ? [].concat(opts.moduleDirectory) + : ['node_modules']; + + if (opts && typeof opts.paths === 'function') { + return opts.paths( + request, + start, + function () { return getNodeModulesDirs(start, modules); }, + opts + ); + } + + var dirs = getNodeModulesDirs(start, modules); + return opts && opts.paths ? dirs.concat(opts.paths) : dirs; +}; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/lib/normalize-options.js b/node_modules/eslint-plugin-import/node_modules/resolve/lib/normalize-options.js new file mode 100644 index 000000000..4b56904ea --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/lib/normalize-options.js @@ -0,0 +1,10 @@ +module.exports = function (x, opts) { + /** + * This file is purposefully a passthrough. It's expected that third-party + * environments will override it at runtime in order to inject special logic + * into `resolve` (by manipulating the options). One such example is the PnP + * code path in Yarn. + */ + + return opts || {}; +}; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/lib/sync.js b/node_modules/eslint-plugin-import/node_modules/resolve/lib/sync.js new file mode 100644 index 000000000..da74e19d0 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/lib/sync.js @@ -0,0 +1,191 @@ +var isCore = require('./is-core'); +var fs = require('fs'); +var path = require('path'); +var caller = require('./caller.js'); +var nodeModulesPaths = require('./node-modules-paths.js'); +var normalizeOptions = require('./normalize-options.js'); + +var realpathFS = fs.realpathSync && typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync; + +var defaultIsFile = function isFile(file) { + try { + var stat = fs.statSync(file); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + return stat.isFile() || stat.isFIFO(); +}; + +var defaultIsDir = function isDirectory(dir) { + try { + var stat = fs.statSync(dir); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + return stat.isDirectory(); +}; + +var defaultRealpathSync = function realpathSync(x) { + try { + return realpathFS(x); + } catch (realpathErr) { + if (realpathErr.code !== 'ENOENT') { + throw realpathErr; + } + } + return x; +}; + +var maybeRealpathSync = function maybeRealpathSync(realpathSync, x, opts) { + if (opts && opts.preserveSymlinks === false) { + return realpathSync(x); + } + return x; +}; + +var getPackageCandidates = function getPackageCandidates(x, start, opts) { + var dirs = nodeModulesPaths(start, opts, x); + for (var i = 0; i < dirs.length; i++) { + dirs[i] = path.join(dirs[i], x); + } + return dirs; +}; + +module.exports = function resolveSync(x, options) { + if (typeof x !== 'string') { + throw new TypeError('Path must be a string.'); + } + var opts = normalizeOptions(x, options); + + var isFile = opts.isFile || defaultIsFile; + var readFileSync = opts.readFileSync || fs.readFileSync; + var isDirectory = opts.isDirectory || defaultIsDir; + var realpathSync = opts.realpathSync || defaultRealpathSync; + var packageIterator = opts.packageIterator; + + var extensions = opts.extensions || ['.js']; + var basedir = opts.basedir || path.dirname(caller()); + var parent = opts.filename || basedir; + + opts.paths = opts.paths || []; + + // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory + var absoluteStart = maybeRealpathSync(realpathSync, path.resolve(basedir), opts); + + if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) { + var res = path.resolve(absoluteStart, x); + if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/'; + var m = loadAsFileSync(res) || loadAsDirectorySync(res); + if (m) return maybeRealpathSync(realpathSync, m, opts); + } else if (isCore(x)) { + return x; + } else { + var n = loadNodeModulesSync(x, absoluteStart); + if (n) return maybeRealpathSync(realpathSync, n, opts); + } + + var err = new Error("Cannot find module '" + x + "' from '" + parent + "'"); + err.code = 'MODULE_NOT_FOUND'; + throw err; + + function loadAsFileSync(x) { + var pkg = loadpkg(path.dirname(x)); + + if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) { + var rfile = path.relative(pkg.dir, x); + var r = opts.pathFilter(pkg.pkg, x, rfile); + if (r) { + x = path.resolve(pkg.dir, r); // eslint-disable-line no-param-reassign + } + } + + if (isFile(x)) { + return x; + } + + for (var i = 0; i < extensions.length; i++) { + var file = x + extensions[i]; + if (isFile(file)) { + return file; + } + } + } + + function loadpkg(dir) { + if (dir === '' || dir === '/') return; + if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) { + return; + } + if ((/[/\\]node_modules[/\\]*$/).test(dir)) return; + + var pkgfile = path.join(maybeRealpathSync(realpathSync, dir, opts), 'package.json'); + + if (!isFile(pkgfile)) { + return loadpkg(path.dirname(dir)); + } + + var body = readFileSync(pkgfile); + + try { + var pkg = JSON.parse(body); + } catch (jsonErr) {} + + if (pkg && opts.packageFilter) { + // v2 will pass pkgfile + pkg = opts.packageFilter(pkg, /*pkgfile,*/ dir); // eslint-disable-line spaced-comment + } + + return { pkg: pkg, dir: dir }; + } + + function loadAsDirectorySync(x) { + var pkgfile = path.join(maybeRealpathSync(realpathSync, x, opts), '/package.json'); + if (isFile(pkgfile)) { + try { + var body = readFileSync(pkgfile, 'UTF8'); + var pkg = JSON.parse(body); + } catch (e) {} + + if (pkg && opts.packageFilter) { + // v2 will pass pkgfile + pkg = opts.packageFilter(pkg, /*pkgfile,*/ x); // eslint-disable-line spaced-comment + } + + if (pkg && pkg.main) { + if (typeof pkg.main !== 'string') { + var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string'); + mainError.code = 'INVALID_PACKAGE_MAIN'; + throw mainError; + } + if (pkg.main === '.' || pkg.main === './') { + pkg.main = 'index'; + } + try { + var m = loadAsFileSync(path.resolve(x, pkg.main)); + if (m) return m; + var n = loadAsDirectorySync(path.resolve(x, pkg.main)); + if (n) return n; + } catch (e) {} + } + } + + return loadAsFileSync(path.join(x, '/index')); + } + + function loadNodeModulesSync(x, start) { + var thunk = function () { return getPackageCandidates(x, start, opts); }; + var dirs = packageIterator ? packageIterator(x, start, thunk, opts) : thunk(); + + for (var i = 0; i < dirs.length; i++) { + var dir = dirs[i]; + if (isDirectory(path.dirname(dir))) { + var m = loadAsFileSync(dir); + if (m) return m; + var n = loadAsDirectorySync(dir); + if (n) return n; + } + } + } +}; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/package.json b/node_modules/eslint-plugin-import/node_modules/resolve/package.json new file mode 100644 index 000000000..d895eda5c --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/package.json @@ -0,0 +1,47 @@ +{ + "name": "resolve", + "description": "resolve like require.resolve() on behalf of files asynchronously and synchronously", + "version": "1.17.0", + "repository": { + "type": "git", + "url": "git://github.com/browserify/resolve.git" + }, + "main": "index.js", + "keywords": [ + "resolve", + "require", + "node", + "module" + ], + "scripts": { + "prepublish": "safe-publish-latest", + "lint": "eslint .", + "pretests-only": "cd ./test/resolver/nested_symlinks && node mylib/sync && node mylib/async", + "tests-only": "tape test/*.js", + "pretest": "npm run lint", + "test": "npm run --silent tests-only", + "posttest": "npm run test:multirepo", + "test:multirepo": "cd ./test/resolver/multirepo && npm install && npm test" + }, + "devDependencies": { + "@ljharb/eslint-config": "^16.0.0", + "array.prototype.map": "^1.0.2", + "eslint": "^6.8.0", + "object-keys": "^1.1.1", + "safe-publish-latest": "^1.1.4", + "tap": "0.4.13", + "tape": "^5.0.0-next.5" + }, + "license": "MIT", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "dependencies": { + "path-parse": "^1.0.6" + } +} \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/readme.markdown b/node_modules/eslint-plugin-import/node_modules/resolve/readme.markdown new file mode 100644 index 000000000..5e1aea331 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/readme.markdown @@ -0,0 +1,242 @@ +# resolve + +implements the [node `require.resolve()` +algorithm](https://nodejs.org/api/modules.html#modules_all_together) +such that you can `require.resolve()` on behalf of a file asynchronously and +synchronously + +[![build status](https://secure.travis-ci.org/browserify/resolve.png)](http://travis-ci.org/browserify/resolve) + +# example + +asynchronously resolve: + +```js +var resolve = require('resolve'); +resolve('tap', { basedir: __dirname }, function (err, res) { + if (err) console.error(err); + else console.log(res); +}); +``` + +``` +$ node example/async.js +/home/substack/projects/node-resolve/node_modules/tap/lib/main.js +``` + +synchronously resolve: + +```js +var resolve = require('resolve'); +var res = resolve.sync('tap', { basedir: __dirname }); +console.log(res); +``` + +``` +$ node example/sync.js +/home/substack/projects/node-resolve/node_modules/tap/lib/main.js +``` + +# methods + +```js +var resolve = require('resolve'); +``` + +## resolve(id, opts={}, cb) + +Asynchronously resolve the module path string `id` into `cb(err, res [, pkg])`, where `pkg` (if defined) is the data from `package.json`. + +options are: + +* opts.basedir - directory to begin resolving from + +* opts.package - `package.json` data applicable to the module being loaded + +* opts.extensions - array of file extensions to search in order + +* opts.readFile - how to read files asynchronously + +* opts.isFile - function to asynchronously test whether a file exists + +* opts.isDirectory - function to asynchronously test whether a directory exists + +* opts.realpath - function to asynchronously resolve a potential symlink to its real path + +* `opts.packageFilter(pkg, pkgfile, dir)` - transform the parsed package.json contents before looking at the "main" field + * pkg - package data + * pkgfile - path to package.json + * dir - directory for package.json + +* `opts.pathFilter(pkg, path, relativePath)` - transform a path within a package + * pkg - package data + * path - the path being resolved + * relativePath - the path relative from the package.json location + * returns - a relative path that will be joined from the package.json location + +* opts.paths - require.paths array to use if nothing is found on the normal `node_modules` recursive walk (probably don't use this) + + For advanced users, `paths` can also be a `opts.paths(request, start, opts)` function + * request - the import specifier being resolved + * start - lookup path + * getNodeModulesDirs - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution + * opts - the resolution options + +* `opts.packageIterator(request, start, opts)` - return the list of candidate paths where the packages sources may be found (probably don't use this) + * request - the import specifier being resolved + * start - lookup path + * getPackageCandidates - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution + * opts - the resolution options + +* opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: `"node_modules"` + +* opts.preserveSymlinks - if true, doesn't resolve `basedir` to real path before resolving. +This is the way Node resolves dependencies when executed with the [--preserve-symlinks](https://nodejs.org/api/all.html#cli_preserve_symlinks) flag. +**Note:** this property is currently `true` by default but it will be changed to +`false` in the next major version because *Node's resolution algorithm does not preserve symlinks by default*. + +default `opts` values: + +```js +{ + paths: [], + basedir: __dirname, + extensions: ['.js'], + readFile: fs.readFile, + isFile: function isFile(file, cb) { + fs.stat(file, function (err, stat) { + if (!err) { + return cb(null, stat.isFile() || stat.isFIFO()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); + }, + isDirectory: function isDirectory(dir, cb) { + fs.stat(dir, function (err, stat) { + if (!err) { + return cb(null, stat.isDirectory()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); + }, + realpath: function realpath(file, cb) { + var realpath = typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath; + realpath(file, function (realPathErr, realPath) { + if (realPathErr && realPathErr.code !== 'ENOENT') cb(realPathErr); + else cb(null, realPathErr ? file : realPath); + }); + }, + moduleDirectory: 'node_modules', + preserveSymlinks: true +} +``` + +## resolve.sync(id, opts) + +Synchronously resolve the module path string `id`, returning the result and +throwing an error when `id` can't be resolved. + +options are: + +* opts.basedir - directory to begin resolving from + +* opts.extensions - array of file extensions to search in order + +* opts.readFile - how to read files synchronously + +* opts.isFile - function to synchronously test whether a file exists + +* opts.isDirectory - function to synchronously test whether a directory exists + +* opts.realpathSync - function to synchronously resolve a potential symlink to its real path + +* `opts.packageFilter(pkg, dir)` - transform the parsed package.json contents before looking at the "main" field + * pkg - package data + * dir - directory for package.json (Note: the second argument will change to "pkgfile" in v2) + +* `opts.pathFilter(pkg, path, relativePath)` - transform a path within a package + * pkg - package data + * path - the path being resolved + * relativePath - the path relative from the package.json location + * returns - a relative path that will be joined from the package.json location + +* opts.paths - require.paths array to use if nothing is found on the normal `node_modules` recursive walk (probably don't use this) + + For advanced users, `paths` can also be a `opts.paths(request, start, opts)` function + * request - the import specifier being resolved + * start - lookup path + * getNodeModulesDirs - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution + * opts - the resolution options + +* `opts.packageIterator(request, start, opts)` - return the list of candidate paths where the packages sources may be found (probably don't use this) + * request - the import specifier being resolved + * start - lookup path + * getPackageCandidates - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution + * opts - the resolution options + +* opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: `"node_modules"` + +* opts.preserveSymlinks - if true, doesn't resolve `basedir` to real path before resolving. +This is the way Node resolves dependencies when executed with the [--preserve-symlinks](https://nodejs.org/api/all.html#cli_preserve_symlinks) flag. +**Note:** this property is currently `true` by default but it will be changed to +`false` in the next major version because *Node's resolution algorithm does not preserve symlinks by default*. + +default `opts` values: + +```js +{ + paths: [], + basedir: __dirname, + extensions: ['.js'], + readFileSync: fs.readFileSync, + isFile: function isFile(file) { + try { + var stat = fs.statSync(file); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + return stat.isFile() || stat.isFIFO(); + }, + isDirectory: function isDirectory(dir) { + try { + var stat = fs.statSync(dir); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + return stat.isDirectory(); + }, + realpathSync: function realpathSync(file) { + try { + var realpath = typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync; + return realpath(file); + } catch (realPathErr) { + if (realPathErr.code !== 'ENOENT') { + throw realPathErr; + } + } + return file; + }, + moduleDirectory: 'node_modules', + preserveSymlinks: true +} +``` + +## resolve.isCore(pkg) + +Return whether a package is in core. + +# install + +With [npm](https://npmjs.org) do: + +```sh +npm install resolve +``` + +# license + +MIT diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/.eslintrc b/node_modules/eslint-plugin-import/node_modules/resolve/test/.eslintrc new file mode 100644 index 000000000..ddd262df5 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/.eslintrc @@ -0,0 +1,5 @@ +{ + "rules": { + "max-lines": 0 + } +} diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/core.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/core.js new file mode 100644 index 000000000..4c111e1dd --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/core.js @@ -0,0 +1,85 @@ +var test = require('tape'); +var keys = require('object-keys'); +var resolve = require('../'); + +test('core modules', function (t) { + t.test('isCore()', function (st) { + st.ok(resolve.isCore('fs')); + st.ok(resolve.isCore('net')); + st.ok(resolve.isCore('http')); + + st.ok(!resolve.isCore('seq')); + st.ok(!resolve.isCore('../')); + + st.ok(!resolve.isCore('toString')); + + st.end(); + }); + + t.test('core list', function (st) { + var cores = keys(resolve.core); + st.plan(cores.length); + + for (var i = 0; i < cores.length; ++i) { + var mod = cores[i]; + if (resolve.core[mod]) { + st.doesNotThrow( + function () { require(mod); }, // eslint-disable-line no-loop-func + mod + ' supported; requiring does not throw' + ); + } else { + st.throws( + function () { require(mod); }, // eslint-disable-line no-loop-func + mod + ' not supported; requiring throws' + ); + } + } + + st.end(); + }); + + t.test('core via repl module', { skip: !resolve.core.repl }, function (st) { + var libs = require('repl')._builtinLibs; // eslint-disable-line no-underscore-dangle + if (!libs) { + st.skip('module.builtinModules does not exist'); + return st.end(); + } + for (var i = 0; i < libs.length; ++i) { + var mod = libs[i]; + st.ok(resolve.core[mod], mod + ' is a core module'); + st.doesNotThrow( + function () { require(mod); }, // eslint-disable-line no-loop-func + 'requiring ' + mod + ' does not throw' + ); + } + st.end(); + }); + + t.test('core via builtinModules list', { skip: !resolve.core.module }, function (st) { + var libs = require('module').builtinModules; + if (!libs) { + st.skip('module.builtinModules does not exist'); + return st.end(); + } + var blacklist = [ + '_debug_agent', + 'v8/tools/tickprocessor-driver', + 'v8/tools/SourceMap', + 'v8/tools/tickprocessor', + 'v8/tools/profile' + ]; + for (var i = 0; i < libs.length; ++i) { + var mod = libs[i]; + if (blacklist.indexOf(mod) === -1) { + st.ok(resolve.core[mod], mod + ' is a core module'); + st.doesNotThrow( + function () { require(mod); }, // eslint-disable-line no-loop-func + 'requiring ' + mod + ' does not throw' + ); + } + } + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/dotdot.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/dotdot.js new file mode 100644 index 000000000..30806659b --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/dotdot.js @@ -0,0 +1,29 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('dotdot', function (t) { + t.plan(4); + var dir = path.join(__dirname, '/dotdot/abc'); + + resolve('..', { basedir: dir }, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(__dirname, 'dotdot/index.js')); + }); + + resolve('.', { basedir: dir }, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, 'index.js')); + }); +}); + +test('dotdot sync', function (t) { + t.plan(2); + var dir = path.join(__dirname, '/dotdot/abc'); + + var a = resolve.sync('..', { basedir: dir }); + t.equal(a, path.join(__dirname, 'dotdot/index.js')); + + var b = resolve.sync('.', { basedir: dir }); + t.equal(b, path.join(dir, 'index.js')); +}); diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/dotdot/abc/index.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/dotdot/abc/index.js new file mode 100644 index 000000000..67f2534eb --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/dotdot/abc/index.js @@ -0,0 +1,2 @@ +var x = require('..'); +console.log(x); diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/dotdot/index.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/dotdot/index.js new file mode 100644 index 000000000..643f9fcc6 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/dotdot/index.js @@ -0,0 +1 @@ +module.exports = 'whatever'; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/faulty_basedir.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/faulty_basedir.js new file mode 100644 index 000000000..5f2141a67 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/faulty_basedir.js @@ -0,0 +1,29 @@ +var test = require('tape'); +var path = require('path'); +var resolve = require('../'); + +test('faulty basedir must produce error in windows', { skip: process.platform !== 'win32' }, function (t) { + t.plan(1); + + var resolverDir = 'C:\\a\\b\\c\\d'; + + resolve('tape/lib/test.js', { basedir: resolverDir }, function (err, res, pkg) { + t.equal(!!err, true); + }); +}); + +test('non-existent basedir should not throw when preserveSymlinks is false', function (t) { + t.plan(2); + + var opts = { + basedir: path.join(path.sep, 'unreal', 'path', 'that', 'does', 'not', 'exist'), + preserveSymlinks: false + }; + + var module = './dotdot/abc'; + + resolve(module, opts, function (err, res) { + t.equal(err.code, 'MODULE_NOT_FOUND'); + t.equal(res, undefined); + }); +}); diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/filter.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/filter.js new file mode 100644 index 000000000..8f8cccdb2 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/filter.js @@ -0,0 +1,34 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('filter', function (t) { + t.plan(4); + var dir = path.join(__dirname, 'resolver'); + var packageFilterArgs; + resolve('./baz', { + basedir: dir, + packageFilter: function (pkg, pkgfile) { + pkg.main = 'doom'; // eslint-disable-line no-param-reassign + packageFilterArgs = [pkg, pkgfile]; + return pkg; + } + }, function (err, res, pkg) { + if (err) t.fail(err); + + t.equal(res, path.join(dir, 'baz/doom.js'), 'changing the package "main" works'); + + var packageData = packageFilterArgs[0]; + t.equal(pkg, packageData, 'first packageFilter argument is "pkg"'); + t.equal(packageData.main, 'doom', 'package "main" was altered'); + + var packageFile = packageFilterArgs[1]; + t.equal( + packageFile, + path.join(dir, 'baz/package.json'), + 'second packageFilter argument is "pkgfile"' + ); + + t.end(); + }); +}); diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/filter_sync.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/filter_sync.js new file mode 100644 index 000000000..8a43b9818 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/filter_sync.js @@ -0,0 +1,33 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('filter', function (t) { + var dir = path.join(__dirname, 'resolver'); + var packageFilterArgs; + var res = resolve.sync('./baz', { + basedir: dir, + // NOTE: in v2.x, this will be `pkg, pkgfile, dir`, but must remain "broken" here in v1.x for compatibility + packageFilter: function (pkg, /*pkgfile,*/ dir) { // eslint-disable-line spaced-comment + pkg.main = 'doom'; // eslint-disable-line no-param-reassign + packageFilterArgs = 'is 1.x' ? [pkg, dir] : [pkg, pkgfile, dir]; // eslint-disable-line no-constant-condition, no-undef + return pkg; + } + }); + + t.equal(res, path.join(dir, 'baz/doom.js'), 'changing the package "main" works'); + + var packageData = packageFilterArgs[0]; + t.equal(packageData.main, 'doom', 'package "main" was altered'); + + if (!'is 1.x') { // eslint-disable-line no-constant-condition + var packageFile = packageFilterArgs[1]; + t.equal(packageFile, path.join(dir, 'baz', 'package.json'), 'package.json path is correct'); + } + + var packageDir = packageFilterArgs['is 1.x' ? 1 : 2]; // eslint-disable-line no-constant-condition + // eslint-disable-next-line no-constant-condition + t.equal(packageDir, path.join(dir, 'baz'), ('is 1.x' ? 'second' : 'third') + ' packageFilter argument is "dir"'); + + t.end(); +}); diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/mock.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/mock.js new file mode 100644 index 000000000..b9f17fe23 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/mock.js @@ -0,0 +1,239 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('mock', function (t) { + t.plan(8); + + var files = {}; + files[path.resolve('/foo/bar/baz.js')] = 'beep'; + + var dirs = {}; + dirs[path.resolve('/foo/bar')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); + }, + isDirectory: function (dir, cb) { + cb(null, !!dirs[path.resolve(dir)]); + }, + readFile: function (file, cb) { + cb(null, files[path.resolve(file)]); + }, + realpath: function (file, cb) { + cb(null, file); + } + }; + } + + resolve('./baz', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/baz.js')); + t.equal(pkg, undefined); + }); + + resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/baz.js')); + t.equal(pkg, undefined); + }); + + resolve('baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); + + resolve('../baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); +}); + +test('mock from package', function (t) { + t.plan(8); + + var files = {}; + files[path.resolve('/foo/bar/baz.js')] = 'beep'; + + var dirs = {}; + dirs[path.resolve('/foo/bar')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, file)); + }, + isDirectory: function (dir, cb) { + cb(null, !!dirs[path.resolve(dir)]); + }, + 'package': { main: 'bar' }, + readFile: function (file, cb) { + cb(null, files[file]); + }, + realpath: function (file, cb) { + cb(null, file); + } + }; + } + + resolve('./baz', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/baz.js')); + t.equal(pkg && pkg.main, 'bar'); + }); + + resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/baz.js')); + t.equal(pkg && pkg.main, 'bar'); + }); + + resolve('baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); + + resolve('../baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); +}); + +test('mock package', function (t) { + t.plan(2); + + var files = {}; + files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep'; + files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ + main: './baz.js' + }); + + var dirs = {}; + dirs[path.resolve('/foo')] = true; + dirs[path.resolve('/foo/node_modules')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); + }, + isDirectory: function (dir, cb) { + cb(null, !!dirs[path.resolve(dir)]); + }, + readFile: function (file, cb) { + cb(null, files[path.resolve(file)]); + }, + realpath: function (file, cb) { + cb(null, file); + } + }; + } + + resolve('bar', opts('/foo'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/node_modules/bar/baz.js')); + t.equal(pkg && pkg.main, './baz.js'); + }); +}); + +test('mock package from package', function (t) { + t.plan(2); + + var files = {}; + files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep'; + files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ + main: './baz.js' + }); + + var dirs = {}; + dirs[path.resolve('/foo')] = true; + dirs[path.resolve('/foo/node_modules')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); + }, + isDirectory: function (dir, cb) { + cb(null, !!dirs[path.resolve(dir)]); + }, + 'package': { main: 'bar' }, + readFile: function (file, cb) { + cb(null, files[path.resolve(file)]); + }, + realpath: function (file, cb) { + cb(null, file); + } + }; + } + + resolve('bar', opts('/foo'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/node_modules/bar/baz.js')); + t.equal(pkg && pkg.main, './baz.js'); + }); +}); + +test('symlinked', function (t) { + t.plan(4); + + var files = {}; + files[path.resolve('/foo/bar/baz.js')] = 'beep'; + files[path.resolve('/foo/bar/symlinked/baz.js')] = 'beep'; + + var dirs = {}; + dirs[path.resolve('/foo/bar')] = true; + dirs[path.resolve('/foo/bar/symlinked')] = true; + + function opts(basedir) { + return { + preserveSymlinks: false, + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); + }, + isDirectory: function (dir, cb) { + cb(null, !!dirs[path.resolve(dir)]); + }, + readFile: function (file, cb) { + cb(null, files[path.resolve(file)]); + }, + realpath: function (file, cb) { + var resolved = path.resolve(file); + + if (resolved.indexOf('symlinked') >= 0) { + cb(null, resolved); + return; + } + + var ext = path.extname(resolved); + + if (ext) { + var dir = path.dirname(resolved); + var base = path.basename(resolved); + cb(null, path.join(dir, 'symlinked', base)); + } else { + cb(null, path.join(resolved, 'symlinked')); + } + } + }; + } + + resolve('./baz', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/symlinked/baz.js')); + t.equal(pkg, undefined); + }); + + resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/symlinked/baz.js')); + t.equal(pkg, undefined); + }); +}); diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/mock_sync.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/mock_sync.js new file mode 100644 index 000000000..fcf811444 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/mock_sync.js @@ -0,0 +1,141 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('mock', function (t) { + t.plan(4); + + var files = {}; + files[path.resolve('/foo/bar/baz.js')] = 'beep'; + + var dirs = {}; + dirs[path.resolve('/foo/bar')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file) { + return Object.prototype.hasOwnProperty.call(files, path.resolve(file)); + }, + isDirectory: function (dir) { + return !!dirs[path.resolve(dir)]; + }, + readFileSync: function (file) { + return files[path.resolve(file)]; + }, + realpathSync: function (file) { + return file; + } + }; + } + + t.equal( + resolve.sync('./baz', opts('/foo/bar')), + path.resolve('/foo/bar/baz.js') + ); + + t.equal( + resolve.sync('./baz.js', opts('/foo/bar')), + path.resolve('/foo/bar/baz.js') + ); + + t.throws(function () { + resolve.sync('baz', opts('/foo/bar')); + }); + + t.throws(function () { + resolve.sync('../baz', opts('/foo/bar')); + }); +}); + +test('mock package', function (t) { + t.plan(1); + + var files = {}; + files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep'; + files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ + main: './baz.js' + }); + + var dirs = {}; + dirs[path.resolve('/foo')] = true; + dirs[path.resolve('/foo/node_modules')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file) { + return Object.prototype.hasOwnProperty.call(files, path.resolve(file)); + }, + isDirectory: function (dir) { + return !!dirs[path.resolve(dir)]; + }, + readFileSync: function (file) { + return files[path.resolve(file)]; + }, + realpathSync: function (file) { + return file; + } + }; + } + + t.equal( + resolve.sync('bar', opts('/foo')), + path.resolve('/foo/node_modules/bar/baz.js') + ); +}); + +test('symlinked', function (t) { + t.plan(2); + + var files = {}; + files[path.resolve('/foo/bar/baz.js')] = 'beep'; + files[path.resolve('/foo/bar/symlinked/baz.js')] = 'beep'; + + var dirs = {}; + dirs[path.resolve('/foo/bar')] = true; + dirs[path.resolve('/foo/bar/symlinked')] = true; + + function opts(basedir) { + return { + preserveSymlinks: false, + basedir: path.resolve(basedir), + isFile: function (file) { + return Object.prototype.hasOwnProperty.call(files, path.resolve(file)); + }, + isDirectory: function (dir) { + return !!dirs[path.resolve(dir)]; + }, + readFileSync: function (file) { + return files[path.resolve(file)]; + }, + realpathSync: function (file) { + var resolved = path.resolve(file); + + if (resolved.indexOf('symlinked') >= 0) { + return resolved; + } + + var ext = path.extname(resolved); + + if (ext) { + var dir = path.dirname(resolved); + var base = path.basename(resolved); + return path.join(dir, 'symlinked', base); + } else { + return path.join(resolved, 'symlinked'); + } + } + }; + } + + t.equal( + resolve.sync('./baz', opts('/foo/bar')), + path.resolve('/foo/bar/symlinked/baz.js') + ); + + t.equal( + resolve.sync('./baz.js', opts('/foo/bar')), + path.resolve('/foo/bar/symlinked/baz.js') + ); +}); diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/module_dir.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/module_dir.js new file mode 100644 index 000000000..b50e5bb17 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/module_dir.js @@ -0,0 +1,56 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('moduleDirectory strings', function (t) { + t.plan(4); + var dir = path.join(__dirname, 'module_dir'); + var xopts = { + basedir: dir, + moduleDirectory: 'xmodules' + }; + resolve('aaa', xopts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, '/xmodules/aaa/index.js')); + }); + + var yopts = { + basedir: dir, + moduleDirectory: 'ymodules' + }; + resolve('aaa', yopts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, '/ymodules/aaa/index.js')); + }); +}); + +test('moduleDirectory array', function (t) { + t.plan(6); + var dir = path.join(__dirname, 'module_dir'); + var aopts = { + basedir: dir, + moduleDirectory: ['xmodules', 'ymodules', 'zmodules'] + }; + resolve('aaa', aopts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, '/xmodules/aaa/index.js')); + }); + + var bopts = { + basedir: dir, + moduleDirectory: ['zmodules', 'ymodules', 'xmodules'] + }; + resolve('aaa', bopts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, '/ymodules/aaa/index.js')); + }); + + var copts = { + basedir: dir, + moduleDirectory: ['xmodules', 'ymodules', 'zmodules'] + }; + resolve('bbb', copts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, '/zmodules/bbb/main.js')); + }); +}); diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/module_dir/xmodules/aaa/index.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/module_dir/xmodules/aaa/index.js new file mode 100644 index 000000000..dd7cf7b2d --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/module_dir/xmodules/aaa/index.js @@ -0,0 +1 @@ +module.exports = function (x) { return x * 100; }; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/module_dir/ymodules/aaa/index.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/module_dir/ymodules/aaa/index.js new file mode 100644 index 000000000..ef2d4d4bf --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/module_dir/ymodules/aaa/index.js @@ -0,0 +1 @@ +module.exports = function (x) { return x + 100; }; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/module_dir/zmodules/bbb/main.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/module_dir/zmodules/bbb/main.js new file mode 100644 index 000000000..e8ba62993 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/module_dir/zmodules/bbb/main.js @@ -0,0 +1 @@ +module.exports = function (n) { return n * 111; }; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/module_dir/zmodules/bbb/package.json b/node_modules/eslint-plugin-import/node_modules/resolve/test/module_dir/zmodules/bbb/package.json new file mode 100644 index 000000000..a60376465 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/module_dir/zmodules/bbb/package.json @@ -0,0 +1,3 @@ +{ + "main": "main.js" +} \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/node-modules-paths.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/node-modules-paths.js new file mode 100644 index 000000000..675441db2 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/node-modules-paths.js @@ -0,0 +1,143 @@ +var test = require('tape'); +var path = require('path'); +var parse = path.parse || require('path-parse'); +var keys = require('object-keys'); + +var nodeModulesPaths = require('../lib/node-modules-paths'); + +var verifyDirs = function verifyDirs(t, start, dirs, moduleDirectories, paths) { + var moduleDirs = [].concat(moduleDirectories || 'node_modules'); + if (paths) { + for (var k = 0; k < paths.length; ++k) { + moduleDirs.push(path.basename(paths[k])); + } + } + + var foundModuleDirs = {}; + var uniqueDirs = {}; + var parsedDirs = {}; + for (var i = 0; i < dirs.length; ++i) { + var parsed = parse(dirs[i]); + if (!foundModuleDirs[parsed.base]) { foundModuleDirs[parsed.base] = 0; } + foundModuleDirs[parsed.base] += 1; + parsedDirs[parsed.dir] = true; + uniqueDirs[dirs[i]] = true; + } + t.equal(keys(parsedDirs).length >= start.split(path.sep).length, true, 'there are >= dirs than "start" has'); + var foundModuleDirNames = keys(foundModuleDirs); + t.deepEqual(foundModuleDirNames, moduleDirs, 'all desired module dirs were found'); + t.equal(keys(uniqueDirs).length, dirs.length, 'all dirs provided were unique'); + + var counts = {}; + for (var j = 0; j < foundModuleDirNames.length; ++j) { + counts[foundModuleDirs[j]] = true; + } + t.equal(keys(counts).length, 1, 'all found module directories had the same count'); +}; + +test('node-modules-paths', function (t) { + t.test('no options', function (t) { + var start = path.join(__dirname, 'resolver'); + var dirs = nodeModulesPaths(start); + + verifyDirs(t, start, dirs); + + t.end(); + }); + + t.test('empty options', function (t) { + var start = path.join(__dirname, 'resolver'); + var dirs = nodeModulesPaths(start, {}); + + verifyDirs(t, start, dirs); + + t.end(); + }); + + t.test('with paths=array option', function (t) { + var start = path.join(__dirname, 'resolver'); + var paths = ['a', 'b']; + var dirs = nodeModulesPaths(start, { paths: paths }); + + verifyDirs(t, start, dirs, null, paths); + + t.end(); + }); + + t.test('with paths=function option', function (t) { + var paths = function paths(request, absoluteStart, getNodeModulesDirs, opts) { + return getNodeModulesDirs().concat(path.join(absoluteStart, 'not node modules', request)); + }; + + var start = path.join(__dirname, 'resolver'); + var dirs = nodeModulesPaths(start, { paths: paths }, 'pkg'); + + verifyDirs(t, start, dirs, null, [path.join(start, 'not node modules', 'pkg')]); + + t.end(); + }); + + t.test('with paths=function skipping node modules resolution', function (t) { + var paths = function paths(request, absoluteStart, getNodeModulesDirs, opts) { + return []; + }; + var start = path.join(__dirname, 'resolver'); + var dirs = nodeModulesPaths(start, { paths: paths }); + t.deepEqual(dirs, [], 'no node_modules was computed'); + t.end(); + }); + + t.test('with moduleDirectory option', function (t) { + var start = path.join(__dirname, 'resolver'); + var moduleDirectory = 'not node modules'; + var dirs = nodeModulesPaths(start, { moduleDirectory: moduleDirectory }); + + verifyDirs(t, start, dirs, moduleDirectory); + + t.end(); + }); + + t.test('with 1 moduleDirectory and paths options', function (t) { + var start = path.join(__dirname, 'resolver'); + var paths = ['a', 'b']; + var moduleDirectory = 'not node modules'; + var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectory }); + + verifyDirs(t, start, dirs, moduleDirectory, paths); + + t.end(); + }); + + t.test('with 1+ moduleDirectory and paths options', function (t) { + var start = path.join(__dirname, 'resolver'); + var paths = ['a', 'b']; + var moduleDirectories = ['not node modules', 'other modules']; + var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectories }); + + verifyDirs(t, start, dirs, moduleDirectories, paths); + + t.end(); + }); + + t.test('combine paths correctly on Windows', function (t) { + var start = 'C:\\Users\\username\\myProject\\src'; + var paths = []; + var moduleDirectories = ['node_modules', start]; + var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectories }); + + t.equal(dirs.indexOf(path.resolve(start)) > -1, true, 'should contain start dir'); + + t.end(); + }); + + t.test('combine paths correctly on non-Windows', { skip: process.platform === 'win32' }, function (t) { + var start = '/Users/username/git/myProject/src'; + var paths = []; + var moduleDirectories = ['node_modules', '/Users/username/git/myProject/src']; + var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectories }); + + t.equal(dirs.indexOf(path.resolve(start)) > -1, true, 'should contain start dir'); + + t.end(); + }); +}); diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/node_path.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/node_path.js new file mode 100644 index 000000000..d06aa4eaf --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/node_path.js @@ -0,0 +1,70 @@ +var fs = require('fs'); +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('$NODE_PATH', function (t) { + t.plan(8); + + var isDir = function (dir, cb) { + if (dir === '/node_path' || dir === 'node_path/x') { + return cb(null, true); + } + fs.stat(dir, function (err, stat) { + if (!err) { + return cb(null, stat.isDirectory()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); + }; + + resolve('aaa', { + paths: [ + path.join(__dirname, '/node_path/x'), + path.join(__dirname, '/node_path/y') + ], + basedir: __dirname, + isDirectory: isDir + }, function (err, res) { + t.error(err); + t.equal(res, path.join(__dirname, '/node_path/x/aaa/index.js'), 'aaa resolves'); + }); + + resolve('bbb', { + paths: [ + path.join(__dirname, '/node_path/x'), + path.join(__dirname, '/node_path/y') + ], + basedir: __dirname, + isDirectory: isDir + }, function (err, res) { + t.error(err); + t.equal(res, path.join(__dirname, '/node_path/y/bbb/index.js'), 'bbb resolves'); + }); + + resolve('ccc', { + paths: [ + path.join(__dirname, '/node_path/x'), + path.join(__dirname, '/node_path/y') + ], + basedir: __dirname, + isDirectory: isDir + }, function (err, res) { + t.error(err); + t.equal(res, path.join(__dirname, '/node_path/x/ccc/index.js'), 'ccc resolves'); + }); + + // ensure that relative paths still resolve against the regular `node_modules` correctly + resolve('tap', { + paths: [ + 'node_path' + ], + basedir: path.join(__dirname, 'node_path/x'), + isDirectory: isDir + }, function (err, res) { + var root = require('tap/package.json').main; + t.error(err); + t.equal(res, path.resolve(__dirname, '..', 'node_modules/tap', root), 'tap resolves'); + }); +}); diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/node_path/x/aaa/index.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/node_path/x/aaa/index.js new file mode 100644 index 000000000..ad70d0bb0 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/node_path/x/aaa/index.js @@ -0,0 +1 @@ +module.exports = 'A'; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/node_path/x/ccc/index.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/node_path/x/ccc/index.js new file mode 100644 index 000000000..a64132e4c --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/node_path/x/ccc/index.js @@ -0,0 +1 @@ +module.exports = 'C'; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/node_path/y/bbb/index.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/node_path/y/bbb/index.js new file mode 100644 index 000000000..4d0f32e24 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/node_path/y/bbb/index.js @@ -0,0 +1 @@ +module.exports = 'B'; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/node_path/y/ccc/index.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/node_path/y/ccc/index.js new file mode 100644 index 000000000..793315e84 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/node_path/y/ccc/index.js @@ -0,0 +1 @@ +module.exports = 'CY'; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/nonstring.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/nonstring.js new file mode 100644 index 000000000..ef63c40f9 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/nonstring.js @@ -0,0 +1,9 @@ +var test = require('tape'); +var resolve = require('../'); + +test('nonstring', function (t) { + t.plan(1); + resolve(555, function (err, res, pkg) { + t.ok(err); + }); +}); diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/pathfilter.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/pathfilter.js new file mode 100644 index 000000000..16519aeae --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/pathfilter.js @@ -0,0 +1,75 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +var resolverDir = path.join(__dirname, '/pathfilter/deep_ref'); + +var pathFilterFactory = function (t) { + return function (pkg, x, remainder) { + t.equal(pkg.version, '1.2.3'); + t.equal(x, path.join(resolverDir, 'node_modules/deep/ref')); + t.equal(remainder, 'ref'); + return 'alt'; + }; +}; + +test('#62: deep module references and the pathFilter', function (t) { + t.test('deep/ref.js', function (st) { + st.plan(3); + + resolve('deep/ref', { basedir: resolverDir }, function (err, res, pkg) { + if (err) st.fail(err); + + st.equal(pkg.version, '1.2.3'); + st.equal(res, path.join(resolverDir, 'node_modules/deep/ref.js')); + }); + + var res = resolve.sync('deep/ref', { basedir: resolverDir }); + st.equal(res, path.join(resolverDir, 'node_modules/deep/ref.js')); + }); + + t.test('deep/deeper/ref', function (st) { + st.plan(4); + + resolve( + 'deep/deeper/ref', + { basedir: resolverDir }, + function (err, res, pkg) { + if (err) t.fail(err); + st.notEqual(pkg, undefined); + st.equal(pkg.version, '1.2.3'); + st.equal(res, path.join(resolverDir, 'node_modules/deep/deeper/ref.js')); + } + ); + + var res = resolve.sync( + 'deep/deeper/ref', + { basedir: resolverDir } + ); + st.equal(res, path.join(resolverDir, 'node_modules/deep/deeper/ref.js')); + }); + + t.test('deep/ref alt', function (st) { + st.plan(8); + + var pathFilter = pathFilterFactory(st); + + var res = resolve.sync( + 'deep/ref', + { basedir: resolverDir, pathFilter: pathFilter } + ); + st.equal(res, path.join(resolverDir, 'node_modules/deep/alt.js')); + + resolve( + 'deep/ref', + { basedir: resolverDir, pathFilter: pathFilter }, + function (err, res, pkg) { + if (err) st.fail(err); + st.equal(res, path.join(resolverDir, 'node_modules/deep/alt.js')); + st.end(); + } + ); + }); + + t.end(); +}); diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/pathfilter/deep_ref/main.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/pathfilter/deep_ref/main.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/precedence.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/precedence.js new file mode 100644 index 000000000..2febb598f --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/precedence.js @@ -0,0 +1,23 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('precedence', function (t) { + t.plan(3); + var dir = path.join(__dirname, 'precedence/aaa'); + + resolve('./', { basedir: dir }, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, 'index.js')); + t.equal(pkg.name, 'resolve'); + }); +}); + +test('./ should not load ${dir}.js', function (t) { // eslint-disable-line no-template-curly-in-string + t.plan(1); + var dir = path.join(__dirname, 'precedence/bbb'); + + resolve('./', { basedir: dir }, function (err, res, pkg) { + t.ok(err); + }); +}); diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/precedence/aaa.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/precedence/aaa.js new file mode 100644 index 000000000..b83a3e7ad --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/precedence/aaa.js @@ -0,0 +1 @@ +module.exports = 'wtf'; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/precedence/aaa/index.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/precedence/aaa/index.js new file mode 100644 index 000000000..e0f8f6abf --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/precedence/aaa/index.js @@ -0,0 +1 @@ +module.exports = 'okok'; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/precedence/aaa/main.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/precedence/aaa/main.js new file mode 100644 index 000000000..93542a965 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/precedence/aaa/main.js @@ -0,0 +1 @@ +console.log(require('./')); diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/precedence/bbb.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/precedence/bbb.js new file mode 100644 index 000000000..2298f47fd --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/precedence/bbb.js @@ -0,0 +1 @@ +module.exports = '>_<'; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/precedence/bbb/main.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/precedence/bbb/main.js new file mode 100644 index 000000000..716b81d4b --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/precedence/bbb/main.js @@ -0,0 +1 @@ +console.log(require('./')); // should throw diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver.js new file mode 100644 index 000000000..aa36ee114 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver.js @@ -0,0 +1,450 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('async foo', function (t) { + t.plan(12); + var dir = path.join(__dirname, 'resolver'); + + resolve('./foo', { basedir: dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'foo.js')); + t.equal(pkg && pkg.name, 'resolve'); + }); + + resolve('./foo.js', { basedir: dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'foo.js')); + t.equal(pkg && pkg.name, 'resolve'); + }); + + resolve('./foo', { basedir: dir, 'package': { main: 'resolver' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'foo.js')); + t.equal(pkg && pkg.main, 'resolver'); + }); + + resolve('./foo.js', { basedir: dir, 'package': { main: 'resolver' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'foo.js')); + t.equal(pkg.main, 'resolver'); + }); + + resolve('./foo', { basedir: dir, filename: path.join(dir, 'baz.js') }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'foo.js')); + }); + + resolve('foo', { basedir: dir }, function (err) { + t.equal(err.message, "Cannot find module 'foo' from '" + path.resolve(dir) + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); + + // Test that filename is reported as the "from" value when passed. + resolve('foo', { basedir: dir, filename: path.join(dir, 'baz.js') }, function (err) { + t.equal(err.message, "Cannot find module 'foo' from '" + path.join(dir, 'baz.js') + "'"); + }); +}); + +test('bar', function (t) { + t.plan(6); + var dir = path.join(__dirname, 'resolver'); + + resolve('foo', { basedir: dir + '/bar' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'bar/node_modules/foo/index.js')); + t.equal(pkg, undefined); + }); + + resolve('foo', { basedir: dir + '/bar' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'bar/node_modules/foo/index.js')); + t.equal(pkg, undefined); + }); + + resolve('foo', { basedir: dir + '/bar', 'package': { main: 'bar' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'bar/node_modules/foo/index.js')); + t.equal(pkg.main, 'bar'); + }); +}); + +test('baz', function (t) { + t.plan(4); + var dir = path.join(__dirname, 'resolver'); + + resolve('./baz', { basedir: dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'baz/quux.js')); + t.equal(pkg.main, 'quux.js'); + }); + + resolve('./baz', { basedir: dir, 'package': { main: 'resolver' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'baz/quux.js')); + t.equal(pkg.main, 'quux.js'); + }); +}); + +test('biz', function (t) { + t.plan(24); + var dir = path.join(__dirname, 'resolver/biz/node_modules'); + + resolve('./grux', { basedir: dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'grux/index.js')); + t.equal(pkg, undefined); + }); + + resolve('./grux', { basedir: dir, 'package': { main: 'biz' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'grux/index.js')); + t.equal(pkg.main, 'biz'); + }); + + resolve('./garply', { basedir: dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'garply/lib/index.js')); + t.equal(pkg.main, './lib'); + }); + + resolve('./garply', { basedir: dir, 'package': { main: 'biz' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'garply/lib/index.js')); + t.equal(pkg.main, './lib'); + }); + + resolve('tiv', { basedir: dir + '/grux' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'tiv/index.js')); + t.equal(pkg, undefined); + }); + + resolve('tiv', { basedir: dir + '/grux', 'package': { main: 'grux' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'tiv/index.js')); + t.equal(pkg.main, 'grux'); + }); + + resolve('tiv', { basedir: dir + '/garply' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'tiv/index.js')); + t.equal(pkg, undefined); + }); + + resolve('tiv', { basedir: dir + '/garply', 'package': { main: './lib' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'tiv/index.js')); + t.equal(pkg.main, './lib'); + }); + + resolve('grux', { basedir: dir + '/tiv' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'grux/index.js')); + t.equal(pkg, undefined); + }); + + resolve('grux', { basedir: dir + '/tiv', 'package': { main: 'tiv' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'grux/index.js')); + t.equal(pkg.main, 'tiv'); + }); + + resolve('garply', { basedir: dir + '/tiv' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'garply/lib/index.js')); + t.equal(pkg.main, './lib'); + }); + + resolve('garply', { basedir: dir + '/tiv', 'package': { main: 'tiv' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'garply/lib/index.js')); + t.equal(pkg.main, './lib'); + }); +}); + +test('quux', function (t) { + t.plan(2); + var dir = path.join(__dirname, 'resolver/quux'); + + resolve('./foo', { basedir: dir, 'package': { main: 'quux' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'foo/index.js')); + t.equal(pkg.main, 'quux'); + }); +}); + +test('normalize', function (t) { + t.plan(2); + var dir = path.join(__dirname, 'resolver/biz/node_modules/grux'); + + resolve('../grux', { basedir: dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'index.js')); + t.equal(pkg, undefined); + }); +}); + +test('cup', function (t) { + t.plan(5); + var dir = path.join(__dirname, 'resolver'); + + resolve('./cup', { basedir: dir, extensions: ['.js', '.coffee'] }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'cup.coffee')); + }); + + resolve('./cup.coffee', { basedir: dir }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'cup.coffee')); + }); + + resolve('./cup', { basedir: dir, extensions: ['.js'] }, function (err, res) { + t.equal(err.message, "Cannot find module './cup' from '" + path.resolve(dir) + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); + + // Test that filename is reported as the "from" value when passed. + resolve('./cup', { basedir: dir, extensions: ['.js'], filename: path.join(dir, 'cupboard.js') }, function (err, res) { + t.equal(err.message, "Cannot find module './cup' from '" + path.join(dir, 'cupboard.js') + "'"); + }); +}); + +test('mug', function (t) { + t.plan(3); + var dir = path.join(__dirname, 'resolver'); + + resolve('./mug', { basedir: dir }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'mug.js')); + }); + + resolve('./mug', { basedir: dir, extensions: ['.coffee', '.js'] }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(dir, '/mug.coffee')); + }); + + resolve('./mug', { basedir: dir, extensions: ['.js', '.coffee'] }, function (err, res) { + t.equal(res, path.join(dir, '/mug.js')); + }); +}); + +test('other path', function (t) { + t.plan(6); + var resolverDir = path.join(__dirname, 'resolver'); + var dir = path.join(resolverDir, 'bar'); + var otherDir = path.join(resolverDir, 'other_path'); + + resolve('root', { basedir: dir, paths: [otherDir] }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(resolverDir, 'other_path/root.js')); + }); + + resolve('lib/other-lib', { basedir: dir, paths: [otherDir] }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(resolverDir, 'other_path/lib/other-lib.js')); + }); + + resolve('root', { basedir: dir }, function (err, res) { + t.equal(err.message, "Cannot find module 'root' from '" + path.resolve(dir) + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); + + resolve('zzz', { basedir: dir, paths: [otherDir] }, function (err, res) { + t.equal(err.message, "Cannot find module 'zzz' from '" + path.resolve(dir) + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); +}); + +test('path iterator', function (t) { + t.plan(2); + + var resolverDir = path.join(__dirname, 'resolver'); + + var exactIterator = function (x, start, getPackageCandidates, opts) { + return [path.join(resolverDir, x)]; + }; + + resolve('baz', { packageIterator: exactIterator }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(resolverDir, 'baz/quux.js')); + t.equal(pkg && pkg.name, 'baz'); + }); +}); + +test('incorrect main', function (t) { + t.plan(1); + + var resolverDir = path.join(__dirname, 'resolver'); + var dir = path.join(resolverDir, 'incorrect_main'); + + resolve('./incorrect_main', { basedir: resolverDir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'index.js')); + }); +}); + +test('without basedir', function (t) { + t.plan(1); + + var dir = path.join(__dirname, 'resolver/without_basedir'); + var tester = require(path.join(dir, 'main.js')); + + tester(t, function (err, res, pkg) { + if (err) { + t.fail(err); + } else { + t.equal(res, path.join(dir, 'node_modules/mymodule.js')); + } + }); +}); + +test('#52 - incorrectly resolves module-paths like "./someFolder/" when there is a file of the same name', function (t) { + t.plan(2); + + var dir = path.join(__dirname, 'resolver'); + + resolve('./foo', { basedir: path.join(dir, 'same_names') }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'same_names/foo.js')); + }); + + resolve('./foo/', { basedir: path.join(dir, 'same_names') }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'same_names/foo/index.js')); + }); +}); + +test('#211 - incorrectly resolves module-paths like "." when from inside a folder with a sibling file of the same name', function (t) { + t.plan(2); + + var dir = path.join(__dirname, 'resolver'); + + resolve('./', { basedir: path.join(dir, 'same_names/foo') }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'same_names/foo/index.js')); + }); + + resolve('.', { basedir: path.join(dir, 'same_names/foo') }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'same_names/foo/index.js')); + }); +}); + +test('async: #121 - treating an existing file as a dir when no basedir', function (t) { + var testFile = path.basename(__filename); + + t.test('sanity check', function (st) { + st.plan(1); + resolve('./' + testFile, function (err, res, pkg) { + if (err) t.fail(err); + st.equal(res, __filename, 'sanity check'); + }); + }); + + t.test('with a fake directory', function (st) { + st.plan(4); + + resolve('./' + testFile + '/blah', function (err, res, pkg) { + st.ok(err, 'there is an error'); + st.notOk(res, 'no result'); + + st.equal(err && err.code, 'MODULE_NOT_FOUND', 'error code matches require.resolve'); + st.equal( + err && err.message, + 'Cannot find module \'./' + testFile + '/blah\' from \'' + __dirname + '\'', + 'can not find nonexistent module' + ); + st.end(); + }); + }); + + t.end(); +}); + +test('async dot main', function (t) { + var start = new Date(); + t.plan(3); + resolve('./resolver/dot_main', function (err, ret) { + t.notOk(err); + t.equal(ret, path.join(__dirname, 'resolver/dot_main/index.js')); + t.ok(new Date() - start < 50, 'resolve.sync timedout'); + t.end(); + }); +}); + +test('async dot slash main', function (t) { + var start = new Date(); + t.plan(3); + resolve('./resolver/dot_slash_main', function (err, ret) { + t.notOk(err); + t.equal(ret, path.join(__dirname, 'resolver/dot_slash_main/index.js')); + t.ok(new Date() - start < 50, 'resolve.sync timedout'); + t.end(); + }); +}); + +test('not a directory', function (t) { + t.plan(6); + var path = './foo'; + resolve(path, { basedir: __filename }, function (err, res, pkg) { + t.ok(err, 'a non-directory errors'); + t.equal(arguments.length, 1); + t.equal(res, undefined); + t.equal(pkg, undefined); + + t.equal(err && err.message, 'Cannot find module \'' + path + '\' from \'' + __filename + '\''); + t.equal(err && err.code, 'MODULE_NOT_FOUND'); + }); +}); + +test('non-string "main" field in package.json', function (t) { + t.plan(5); + + var dir = path.join(__dirname, 'resolver'); + resolve('./invalid_main', { basedir: dir }, function (err, res, pkg) { + t.ok(err, 'errors on non-string main'); + t.equal(err.message, 'package “invalid main” `main` must be a string'); + t.equal(err.code, 'INVALID_PACKAGE_MAIN'); + t.equal(res, undefined, 'res is undefined'); + t.equal(pkg, undefined, 'pkg is undefined'); + }); +}); + +test('non-string "main" field in package.json', function (t) { + t.plan(5); + + var dir = path.join(__dirname, 'resolver'); + resolve('./invalid_main', { basedir: dir }, function (err, res, pkg) { + t.ok(err, 'errors on non-string main'); + t.equal(err.message, 'package “invalid main” `main` must be a string'); + t.equal(err.code, 'INVALID_PACKAGE_MAIN'); + t.equal(res, undefined, 'res is undefined'); + t.equal(pkg, undefined, 'pkg is undefined'); + }); +}); + +test('browser field in package.json', function (t) { + t.plan(3); + + var dir = path.join(__dirname, 'resolver'); + resolve( + './browser_field', + { + basedir: dir, + packageFilter: function packageFilter(pkg) { + if (pkg.browser) { + pkg.main = pkg.browser; // eslint-disable-line no-param-reassign + delete pkg.browser; // eslint-disable-line no-param-reassign + } + return pkg; + } + }, + function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'browser_field', 'b.js')); + t.equal(pkg && pkg.main, 'b'); + t.equal(pkg && pkg.browser, undefined); + } + ); +}); diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/baz/doom.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/baz/doom.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/baz/package.json b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/baz/package.json new file mode 100644 index 000000000..6ba9318a0 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/baz/package.json @@ -0,0 +1,4 @@ +{ + "name": "baz", + "main": "quux.js" +} \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/baz/quux.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/baz/quux.js new file mode 100644 index 000000000..bd816eaba --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/baz/quux.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/browser_field/a.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/browser_field/a.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/browser_field/b.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/browser_field/b.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/browser_field/package.json b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/browser_field/package.json new file mode 100644 index 000000000..291ab03bc --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/browser_field/package.json @@ -0,0 +1,5 @@ +{ + "name": "browser_field", + "main": "a", + "browser": "b" +} \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/cup.coffee b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/cup.coffee new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/cup.coffee @@ -0,0 +1 @@ + diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/dot_main/index.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/dot_main/index.js new file mode 100644 index 000000000..bd816eaba --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/dot_main/index.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/dot_main/package.json b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/dot_main/package.json new file mode 100644 index 000000000..d08e00e9d --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/dot_main/package.json @@ -0,0 +1,3 @@ +{ + "main": "." +} \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/dot_slash_main/index.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/dot_slash_main/index.js new file mode 100644 index 000000000..bd816eaba --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/dot_slash_main/index.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/dot_slash_main/package.json b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/dot_slash_main/package.json new file mode 100644 index 000000000..a92bfd7b1 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/dot_slash_main/package.json @@ -0,0 +1,3 @@ +{ + "main": "./" +} \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/foo.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/foo.js new file mode 100644 index 000000000..bd816eaba --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/foo.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/incorrect_main/index.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/incorrect_main/index.js new file mode 100644 index 000000000..bc1fb0a6f --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/incorrect_main/index.js @@ -0,0 +1,2 @@ +// this is the actual main file 'index.js', not 'wrong.js' like the package.json would indicate +module.exports = 1; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/incorrect_main/package.json b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/incorrect_main/package.json new file mode 100644 index 000000000..b3b73da08 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/incorrect_main/package.json @@ -0,0 +1,3 @@ +{ + "main": "wrong.js" +} \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/invalid_main/package.json b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/invalid_main/package.json new file mode 100644 index 000000000..3158504f6 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/invalid_main/package.json @@ -0,0 +1,7 @@ +{ + "name": "invalid main", + "main": [ + "why is this a thing", + "srsly omg wtf" + ] +} \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/mug.coffee b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/mug.coffee new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/mug.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/mug.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/multirepo/lerna.json b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/multirepo/lerna.json new file mode 100644 index 000000000..d6707ca0c --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/multirepo/lerna.json @@ -0,0 +1,6 @@ +{ + "packages": [ + "packages/*" + ], + "version": "0.0.0" +} diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/multirepo/package.json b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/multirepo/package.json new file mode 100644 index 000000000..9c6d56b61 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/multirepo/package.json @@ -0,0 +1,20 @@ +{ + "name": "monorepo-symlink-test", + "private": true, + "version": "0.0.0", + "description": "", + "main": "index.js", + "scripts": { + "postinstall": "lerna bootstrap", + "test": "node packages/package-a" + }, + "author": "", + "license": "MIT", + "dependencies": { + "jquery": "^3.3.1", + "resolve": "../../../" + }, + "devDependencies": { + "lerna": "^3.4.3" + } +} \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js new file mode 100644 index 000000000..8875a32df --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js @@ -0,0 +1,35 @@ +'use strict'; + +var assert = require('assert'); +var path = require('path'); +var resolve = require('resolve'); + +var basedir = __dirname + '/node_modules/@my-scope/package-b'; + +var expected = path.join(__dirname, '../../node_modules/jquery/dist/jquery.js'); + +/* + * preserveSymlinks === false + * will search NPM package from + * - packages/package-b/node_modules + * - packages/node_modules + * - node_modules + */ +assert.equal(resolve.sync('jquery', { basedir: basedir, preserveSymlinks: false }), expected); +assert.equal(resolve.sync('../../node_modules/jquery', { basedir: basedir, preserveSymlinks: false }), expected); + +/* + * preserveSymlinks === true + * will search NPM package from + * - packages/package-a/node_modules/@my-scope/packages/package-b/node_modules + * - packages/package-a/node_modules/@my-scope/packages/node_modules + * - packages/package-a/node_modules/@my-scope/node_modules + * - packages/package-a/node_modules/node_modules + * - packages/package-a/node_modules + * - packages/node_modules + * - node_modules + */ +assert.equal(resolve.sync('jquery', { basedir: basedir, preserveSymlinks: true }), expected); +assert.equal(resolve.sync('../../../../../node_modules/jquery', { basedir: basedir, preserveSymlinks: true }), expected); + +console.log(' * all monorepo paths successfully resolved through symlinks'); diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json new file mode 100644 index 000000000..a2bbfff89 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json @@ -0,0 +1,14 @@ +{ + "name": "@my-scope/package-a", + "version": "0.0.0", + "private": true, + "description": "", + "license": "MIT", + "main": "index.js", + "scripts": { + "test": "echo \"Error: run tests from root\" && exit 1" + }, + "dependencies": { + "@my-scope/package-b": "^0.0.0" + } +} \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json new file mode 100644 index 000000000..f7adacdeb --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json @@ -0,0 +1,14 @@ +{ + "name": "@my-scope/package-b", + "private": true, + "version": "0.0.0", + "description": "", + "license": "MIT", + "main": "index.js", + "scripts": { + "test": "echo \"Error: run tests from root\" && exit 1" + }, + "dependencies": { + "@my-scope/package-a": "^0.0.0" + } +} \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js new file mode 100644 index 000000000..9b4846a82 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js @@ -0,0 +1,26 @@ +var a = require.resolve('buffer/').replace(process.cwd(), '$CWD'); +var b; +var c; + +var test = function test() { + console.log(a, ': require.resolve, preserveSymlinks ' + (process.execArgv.indexOf('preserve-symlinks') > -1 ? 'true' : 'false')); + console.log(b, ': preserveSymlinks true'); + console.log(c, ': preserveSymlinks false'); + + if (a !== b && a !== c) { + throw 'async: no match'; + } + console.log('async: success! a matched either b or c\n'); +}; + +require('resolve')('buffer/', { preserveSymlinks: true }, function (err, result) { + if (err) { throw err; } + b = result.replace(process.cwd(), '$CWD'); + if (b && c) { test(); } +}); +require('resolve')('buffer/', { preserveSymlinks: false }, function (err, result) { + if (err) { throw err; } + c = result.replace(process.cwd(), '$CWD'); + if (b && c) { test(); } +}); + diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json new file mode 100644 index 000000000..f3fffe71c --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json @@ -0,0 +1,15 @@ +{ + "name": "mylib", + "version": "0.0.0", + "description": "", + "private": true, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "buffer": "*" + } +} \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js new file mode 100644 index 000000000..3283efc2e --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js @@ -0,0 +1,12 @@ +var a = require.resolve('buffer/').replace(process.cwd(), '$CWD'); +var b = require('resolve').sync('buffer/', { preserveSymlinks: true }).replace(process.cwd(), '$CWD'); +var c = require('resolve').sync('buffer/', { preserveSymlinks: false }).replace(process.cwd(), '$CWD'); + +console.log(a, ': require.resolve, preserveSymlinks ' + (process.execArgv.indexOf('preserve-symlinks') > -1 ? 'true' : 'false')); +console.log(b, ': preserveSymlinks true'); +console.log(c, ': preserveSymlinks false'); + +if (a !== b && a !== c) { + throw 'sync: no match'; +} +console.log('sync: success! a matched either b or c\n'); diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/other_path/lib/other-lib.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/other_path/lib/other-lib.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/other_path/root.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/other_path/root.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/quux/foo/index.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/quux/foo/index.js new file mode 100644 index 000000000..bd816eaba --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/quux/foo/index.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/same_names/foo.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/same_names/foo.js new file mode 100644 index 000000000..888cae37a --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/same_names/foo.js @@ -0,0 +1 @@ +module.exports = 42; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/same_names/foo/index.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/same_names/foo/index.js new file mode 100644 index 000000000..bd816eaba --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/same_names/foo/index.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/symlinked/package/bar.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/symlinked/package/bar.js new file mode 100644 index 000000000..cb1c2c01e --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/symlinked/package/bar.js @@ -0,0 +1 @@ +module.exports = 'bar'; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/symlinked/package/package.json b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/symlinked/package/package.json new file mode 100644 index 000000000..b6e6d85fd --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/symlinked/package/package.json @@ -0,0 +1,3 @@ +{ + "main": "bar.js" +} \ No newline at end of file diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/without_basedir/main.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/without_basedir/main.js new file mode 100644 index 000000000..5b31975be --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver/without_basedir/main.js @@ -0,0 +1,5 @@ +var resolve = require('../../../'); + +module.exports = function (t, cb) { + resolve('mymodule', null, cb); +}; diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver_sync.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver_sync.js new file mode 100644 index 000000000..3082c96e5 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/resolver_sync.js @@ -0,0 +1,358 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('foo', function (t) { + var dir = path.join(__dirname, 'resolver'); + + t.equal( + resolve.sync('./foo', { basedir: dir }), + path.join(dir, 'foo.js') + ); + + t.equal( + resolve.sync('./foo.js', { basedir: dir }), + path.join(dir, 'foo.js') + ); + + t.equal( + resolve.sync('./foo.js', { basedir: dir, filename: path.join(dir, 'bar.js') }), + path.join(dir, 'foo.js') + ); + + t.throws(function () { + resolve.sync('foo', { basedir: dir }); + }); + + // Test that filename is reported as the "from" value when passed. + t.throws( + function () { + resolve.sync('foo', { basedir: dir, filename: path.join(dir, 'bar.js') }); + }, + { + name: 'Error', + message: "Cannot find module 'foo' from '" + path.join(dir, 'bar.js') + "'" + } + ); + + t.end(); +}); + +test('bar', function (t) { + var dir = path.join(__dirname, 'resolver'); + + t.equal( + resolve.sync('foo', { basedir: path.join(dir, 'bar') }), + path.join(dir, 'bar/node_modules/foo/index.js') + ); + t.end(); +}); + +test('baz', function (t) { + var dir = path.join(__dirname, 'resolver'); + + t.equal( + resolve.sync('./baz', { basedir: dir }), + path.join(dir, 'baz/quux.js') + ); + t.end(); +}); + +test('biz', function (t) { + var dir = path.join(__dirname, 'resolver/biz/node_modules'); + t.equal( + resolve.sync('./grux', { basedir: dir }), + path.join(dir, 'grux/index.js') + ); + + t.equal( + resolve.sync('tiv', { basedir: path.join(dir, 'grux') }), + path.join(dir, 'tiv/index.js') + ); + + t.equal( + resolve.sync('grux', { basedir: path.join(dir, 'tiv') }), + path.join(dir, 'grux/index.js') + ); + t.end(); +}); + +test('normalize', function (t) { + var dir = path.join(__dirname, 'resolver/biz/node_modules/grux'); + t.equal( + resolve.sync('../grux', { basedir: dir }), + path.join(dir, 'index.js') + ); + t.end(); +}); + +test('cup', function (t) { + var dir = path.join(__dirname, 'resolver'); + t.equal( + resolve.sync('./cup', { + basedir: dir, + extensions: ['.js', '.coffee'] + }), + path.join(dir, 'cup.coffee') + ); + + t.equal( + resolve.sync('./cup.coffee', { basedir: dir }), + path.join(dir, 'cup.coffee') + ); + + t.throws(function () { + resolve.sync('./cup', { + basedir: dir, + extensions: ['.js'] + }); + }); + + t.end(); +}); + +test('mug', function (t) { + var dir = path.join(__dirname, 'resolver'); + t.equal( + resolve.sync('./mug', { basedir: dir }), + path.join(dir, 'mug.js') + ); + + t.equal( + resolve.sync('./mug', { + basedir: dir, + extensions: ['.coffee', '.js'] + }), + path.join(dir, 'mug.coffee') + ); + + t.equal( + resolve.sync('./mug', { + basedir: dir, + extensions: ['.js', '.coffee'] + }), + path.join(dir, 'mug.js') + ); + + t.end(); +}); + +test('other path', function (t) { + var resolverDir = path.join(__dirname, 'resolver'); + var dir = path.join(resolverDir, 'bar'); + var otherDir = path.join(resolverDir, 'other_path'); + + t.equal( + resolve.sync('root', { + basedir: dir, + paths: [otherDir] + }), + path.join(resolverDir, 'other_path/root.js') + ); + + t.equal( + resolve.sync('lib/other-lib', { + basedir: dir, + paths: [otherDir] + }), + path.join(resolverDir, 'other_path/lib/other-lib.js') + ); + + t.throws(function () { + resolve.sync('root', { basedir: dir }); + }); + + t.throws(function () { + resolve.sync('zzz', { + basedir: dir, + paths: [otherDir] + }); + }); + + t.end(); +}); + +test('path iterator', function (t) { + var resolverDir = path.join(__dirname, 'resolver'); + + var exactIterator = function (x, start, getPackageCandidates, opts) { + return [path.join(resolverDir, x)]; + }; + + t.equal( + resolve.sync('baz', { packageIterator: exactIterator }), + path.join(resolverDir, 'baz/quux.js') + ); + + t.end(); +}); + +test('incorrect main', function (t) { + var resolverDir = path.join(__dirname, 'resolver'); + var dir = path.join(resolverDir, 'incorrect_main'); + + t.equal( + resolve.sync('./incorrect_main', { basedir: resolverDir }), + path.join(dir, 'index.js') + ); + + t.end(); +}); + +var stubStatSync = function stubStatSync(fn) { + var fs = require('fs'); + var statSync = fs.statSync; + try { + fs.statSync = function () { + throw new EvalError('Unknown Error'); + }; + return fn(); + } finally { + fs.statSync = statSync; + } +}; + +test('#79 - re-throw non ENOENT errors from stat', function (t) { + var dir = path.join(__dirname, 'resolver'); + + stubStatSync(function () { + t.throws(function () { + resolve.sync('foo', { basedir: dir }); + }, /Unknown Error/); + }); + + t.end(); +}); + +test('#52 - incorrectly resolves module-paths like "./someFolder/" when there is a file of the same name', function (t) { + var dir = path.join(__dirname, 'resolver'); + + t.equal( + resolve.sync('./foo', { basedir: path.join(dir, 'same_names') }), + path.join(dir, 'same_names/foo.js') + ); + t.equal( + resolve.sync('./foo/', { basedir: path.join(dir, 'same_names') }), + path.join(dir, 'same_names/foo/index.js') + ); + t.end(); +}); + +test('#211 - incorrectly resolves module-paths like "." when from inside a folder with a sibling file of the same name', function (t) { + var dir = path.join(__dirname, 'resolver'); + + t.equal( + resolve.sync('./', { basedir: path.join(dir, 'same_names/foo') }), + path.join(dir, 'same_names/foo/index.js') + ); + t.equal( + resolve.sync('.', { basedir: path.join(dir, 'same_names/foo') }), + path.join(dir, 'same_names/foo/index.js') + ); + t.end(); +}); + +test('sync: #121 - treating an existing file as a dir when no basedir', function (t) { + var testFile = path.basename(__filename); + + t.test('sanity check', function (st) { + st.equal( + resolve.sync('./' + testFile), + __filename, + 'sanity check' + ); + st.end(); + }); + + t.test('with a fake directory', function (st) { + function run() { return resolve.sync('./' + testFile + '/blah'); } + + st.throws(run, 'throws an error'); + + try { + run(); + } catch (e) { + st.equal(e.code, 'MODULE_NOT_FOUND', 'error code matches require.resolve'); + st.equal( + e.message, + 'Cannot find module \'./' + testFile + '/blah\' from \'' + __dirname + '\'', + 'can not find nonexistent module' + ); + } + + st.end(); + }); + + t.end(); +}); + +test('sync dot main', function (t) { + var start = new Date(); + t.equal(resolve.sync('./resolver/dot_main'), path.join(__dirname, 'resolver/dot_main/index.js')); + t.ok(new Date() - start < 50, 'resolve.sync timedout'); + t.end(); +}); + +test('sync dot slash main', function (t) { + var start = new Date(); + t.equal(resolve.sync('./resolver/dot_slash_main'), path.join(__dirname, 'resolver/dot_slash_main/index.js')); + t.ok(new Date() - start < 50, 'resolve.sync timedout'); + t.end(); +}); + +test('not a directory', function (t) { + var path = './foo'; + try { + resolve.sync(path, { basedir: __filename }); + t.fail(); + } catch (err) { + t.ok(err, 'a non-directory errors'); + t.equal(err && err.message, 'Cannot find module \'' + path + "' from '" + __filename + "'"); + t.equal(err && err.code, 'MODULE_NOT_FOUND'); + } + t.end(); +}); + +test('non-string "main" field in package.json', function (t) { + var dir = path.join(__dirname, 'resolver'); + try { + var result = resolve.sync('./invalid_main', { basedir: dir }); + t.equal(result, undefined, 'result should not exist'); + t.fail('should not get here'); + } catch (err) { + t.ok(err, 'errors on non-string main'); + t.equal(err.message, 'package “invalid main” `main` must be a string'); + t.equal(err.code, 'INVALID_PACKAGE_MAIN'); + } + t.end(); +}); + +test('non-string "main" field in package.json', function (t) { + var dir = path.join(__dirname, 'resolver'); + try { + var result = resolve.sync('./invalid_main', { basedir: dir }); + t.equal(result, undefined, 'result should not exist'); + t.fail('should not get here'); + } catch (err) { + t.ok(err, 'errors on non-string main'); + t.equal(err.message, 'package “invalid main” `main` must be a string'); + t.equal(err.code, 'INVALID_PACKAGE_MAIN'); + } + t.end(); +}); + +test('browser field in package.json', function (t) { + var dir = path.join(__dirname, 'resolver'); + var res = resolve.sync('./browser_field', { + basedir: dir, + packageFilter: function packageFilter(pkg) { + if (pkg.browser) { + pkg.main = pkg.browser; // eslint-disable-line no-param-reassign + delete pkg.browser; // eslint-disable-line no-param-reassign + } + return pkg; + } + }); + t.equal(res, path.join(dir, 'browser_field', 'b.js')); + t.end(); +}); diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/shadowed_core.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/shadowed_core.js new file mode 100644 index 000000000..98c52a760 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/shadowed_core.js @@ -0,0 +1,38 @@ +var test = require('tape'); +var resolve = require('../'); +var path = require('path'); + +test('shadowed core modules still return core module', function (t) { + t.plan(2); + + resolve('util', { basedir: path.join(__dirname, 'shadowed_core') }, function (err, res) { + t.ifError(err); + t.equal(res, 'util'); + }); +}); + +test('shadowed core modules still return core module [sync]', function (t) { + t.plan(1); + + var res = resolve.sync('util', { basedir: path.join(__dirname, 'shadowed_core') }); + + t.equal(res, 'util'); +}); + +test('shadowed core modules return shadow when appending `/`', function (t) { + t.plan(2); + + resolve('util/', { basedir: path.join(__dirname, 'shadowed_core') }, function (err, res) { + t.ifError(err); + t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js')); + }); +}); + +test('shadowed core modules return shadow when appending `/` [sync]', function (t) { + t.plan(1); + + var res = resolve.sync('util/', { basedir: path.join(__dirname, 'shadowed_core') }); + + t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js')); +}); + diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/shadowed_core/node_modules/util/index.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/shadowed_core/node_modules/util/index.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/subdirs.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/subdirs.js new file mode 100644 index 000000000..b7b8450a9 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/subdirs.js @@ -0,0 +1,13 @@ +var test = require('tape'); +var resolve = require('../'); +var path = require('path'); + +test('subdirs', function (t) { + t.plan(2); + + var dir = path.join(__dirname, '/subdirs'); + resolve('a/b/c/x.json', { basedir: dir }, function (err, res) { + t.ifError(err); + t.equal(res, path.join(dir, 'node_modules/a/b/c/x.json')); + }); +}); diff --git a/node_modules/eslint-plugin-import/node_modules/resolve/test/symlinks.js b/node_modules/eslint-plugin-import/node_modules/resolve/test/symlinks.js new file mode 100644 index 000000000..152d14ef2 --- /dev/null +++ b/node_modules/eslint-plugin-import/node_modules/resolve/test/symlinks.js @@ -0,0 +1,173 @@ +var path = require('path'); +var fs = require('fs'); +var test = require('tape'); +var map = require('array.prototype.map'); +var resolve = require('../'); + +var symlinkDir = path.join(__dirname, 'resolver', 'symlinked', 'symlink'); +var packageDir = path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'package'); +var modADir = path.join(__dirname, 'symlinks', 'source', 'node_modules', 'mod-a'); +var symlinkModADir = path.join(__dirname, 'symlinks', 'dest', 'node_modules', 'mod-a'); +try { + fs.unlinkSync(symlinkDir); +} catch (err) {} +try { + fs.unlinkSync(packageDir); +} catch (err) {} +try { + fs.unlinkSync(modADir); +} catch (err) {} +try { + fs.unlinkSync(symlinkModADir); +} catch (err) {} + +try { + fs.symlinkSync('./_/symlink_target', symlinkDir, 'dir'); +} catch (err) { + // if fails then it is probably on Windows and lets try to create a junction + fs.symlinkSync(path.join(__dirname, 'resolver', 'symlinked', '_', 'symlink_target') + '\\', symlinkDir, 'junction'); +} +try { + fs.symlinkSync('../../package', packageDir, 'dir'); +} catch (err) { + // if fails then it is probably on Windows and lets try to create a junction + fs.symlinkSync(path.join(__dirname, '..', '..', 'package') + '\\', packageDir, 'junction'); +} +try { + fs.symlinkSync('../../source/node_modules/mod-a', symlinkModADir, 'dir'); +} catch (err) { + // if fails then it is probably on Windows and lets try to create a junction + fs.symlinkSync(path.join(__dirname, '..', '..', 'source', 'node_modules', 'mod-a') + '\\', symlinkModADir, 'junction'); +} + +test('symlink', function (t) { + t.plan(2); + + resolve('foo', { basedir: symlinkDir, preserveSymlinks: false }, function (err, res, pkg) { + t.error(err); + t.equal(res, path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'foo.js')); + }); +}); + +test('sync symlink when preserveSymlinks = true', function (t) { + t.plan(4); + + resolve('foo', { basedir: symlinkDir }, function (err, res, pkg) { + t.ok(err, 'there is an error'); + t.notOk(res, 'no result'); + + t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error code matches require.resolve'); + t.equal( + err && err.message, + 'Cannot find module \'foo\' from \'' + symlinkDir + '\'', + 'can not find nonexistent module' + ); + }); +}); + +test('sync symlink', function (t) { + var start = new Date(); + t.doesNotThrow(function () { + t.equal(resolve.sync('foo', { basedir: symlinkDir, preserveSymlinks: false }), path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'foo.js')); + }); + t.ok(new Date() - start < 50, 'resolve.sync timedout'); + t.end(); +}); + +test('sync symlink when preserveSymlinks = true', function (t) { + t.throws(function () { + resolve.sync('foo', { basedir: symlinkDir }); + }, /Cannot find module 'foo'/); + t.end(); +}); + +test('sync symlink from node_modules to other dir when preserveSymlinks = false', function (t) { + var basedir = path.join(__dirname, 'resolver', 'symlinked', '_'); + var fn = resolve.sync('package', { basedir: basedir, preserveSymlinks: false }); + + t.equal(fn, path.resolve(__dirname, 'resolver/symlinked/package/bar.js')); + t.end(); +}); + +test('async symlink from node_modules to other dir when preserveSymlinks = false', function (t) { + t.plan(2); + var basedir = path.join(__dirname, 'resolver', 'symlinked', '_'); + resolve('package', { basedir: basedir, preserveSymlinks: false }, function (err, result) { + t.notOk(err, 'no error'); + t.equal(result, path.resolve(__dirname, 'resolver/symlinked/package/bar.js')); + }); +}); + +test('packageFilter', function (t) { + function relative(x) { + return path.relative(__dirname, x); + } + + function testPackageFilter(preserveSymlinks) { + return function (st) { + st.plan('is 1.x' ? 3 : 5); // eslint-disable-line no-constant-condition + + var destMain = 'symlinks/dest/node_modules/mod-a/index.js'; + var destPkg = 'symlinks/dest/node_modules/mod-a/package.json'; + var sourceMain = 'symlinks/source/node_modules/mod-a/index.js'; + var sourcePkg = 'symlinks/source/node_modules/mod-a/package.json'; + var destDir = path.join(__dirname, 'symlinks', 'dest'); + + /* eslint multiline-comment-style: 0 */ + /* v2.x will restore these tests + var packageFilterPath = []; + var actualPath = resolve.sync('mod-a', { + basedir: destDir, + preserveSymlinks: preserveSymlinks, + packageFilter: function (pkg, pkgfile, dir) { + packageFilterPath.push(pkgfile); + } + }); + st.equal( + relative(actualPath), + path.normalize(preserveSymlinks ? destMain : sourceMain), + 'sync: actual path is correct' + ); + st.deepEqual( + map(packageFilterPath, relative), + map(preserveSymlinks ? [destPkg, destPkg] : [sourcePkg, sourcePkg], path.normalize), + 'sync: packageFilter pkgfile arg is correct' + ); + */ + + var asyncPackageFilterPath = []; + resolve( + 'mod-a', + { + basedir: destDir, + preserveSymlinks: preserveSymlinks, + packageFilter: function (pkg, pkgfile) { + asyncPackageFilterPath.push(pkgfile); + } + }, + function (err, actualPath) { + st.error(err, 'no error'); + st.equal( + relative(actualPath), + path.normalize(preserveSymlinks ? destMain : sourceMain), + 'async: actual path is correct' + ); + st.deepEqual( + map(asyncPackageFilterPath, relative), + map( + preserveSymlinks ? [destPkg, destPkg, destPkg] : [sourcePkg, sourcePkg, sourcePkg], + path.normalize + ), + 'async: packageFilter pkgfile arg is correct' + ); + } + ); + }; + } + + t.test('preserveSymlinks: false', testPackageFilter(false)); + + t.test('preserveSymlinks: true', testPackageFilter(true)); + + t.end(); +}); diff --git a/node_modules/eslint-plugin-import/package.json b/node_modules/eslint-plugin-import/package.json new file mode 100644 index 000000000..4010e37a3 --- /dev/null +++ b/node_modules/eslint-plugin-import/package.json @@ -0,0 +1,125 @@ +{ + "name": "eslint-plugin-import", + "version": "2.22.0", + "description": "Import with sanity.", + "engines": { + "node": ">=4" + }, + "main": "lib/index.js", + "directories": { + "test": "tests" + }, + "files": [ + "*.md", + "LICENSE", + "docs", + "lib", + "config", + "memo-parser/{*.js,LICENSE,*.md}" + ], + "scripts": { + "prebuild": "rimraf lib", + "build": "babel --quiet --out-dir lib src", + "postbuild": "npm run copy-metafiles", + "copy-metafiles": "node --require babel-register ./scripts/copyMetafiles", + "watch": "npm run tests-only -- -- --watch", + "pretest": "linklocal", + "posttest": "eslint .", + "mocha": "cross-env BABEL_ENV=test nyc -s mocha", + "tests-only": "npm run mocha tests/src", + "test": "npm run tests-only", + "test-compiled": "npm run prepublish && BABEL_ENV=testCompiled mocha --compilers js:babel-register tests/src", + "test-all": "node --require babel-register ./scripts/testAll", + "prepublish": "not-in-publish || npm run build", + "coveralls": "nyc report --reporter lcovonly && coveralls < ./coverage/lcov.info" + }, + "repository": { + "type": "git", + "url": "https://github.com/benmosher/eslint-plugin-import" + }, + "keywords": [ + "eslint", + "eslintplugin", + "es6", + "jsnext", + "modules", + "import", + "export" + ], + "author": "Ben Mosher ", + "license": "MIT", + "bugs": { + "url": "https://github.com/benmosher/eslint-plugin-import/issues" + }, + "homepage": "https://github.com/benmosher/eslint-plugin-import", + "devDependencies": { + "@eslint/import-test-order-redirect-scoped": "file:./tests/files/order-redirect-scoped", + "@test-scope/some-module": "file:./tests/files/symlinked-module", + "@typescript-eslint/parser": "^2.23.0 || ^3.3.0", + "array.prototype.flatmap": "^1.2.3", + "babel-cli": "^6.26.0", + "babel-core": "^6.26.3", + "babel-eslint": "^8.2.6", + "babel-plugin-istanbul": "^4.1.6", + "babel-plugin-module-resolver": "^2.7.1", + "babel-preset-es2015-argon": "latest", + "babel-preset-flow": "^6.23.0", + "babel-register": "^6.26.0", + "babylon": "^6.18.0", + "chai": "^4.2.0", + "coveralls": "^3.0.6", + "cross-env": "^4.0.0", + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0", + "eslint-import-resolver-node": "file:./resolvers/node", + "eslint-import-resolver-typescript": "^1.0.2", + "eslint-import-resolver-webpack": "file:./resolvers/webpack", + "eslint-import-test-order-redirect": "file:./tests/files/order-redirect", + "eslint-module-utils": "file:./utils", + "eslint-plugin-eslint-plugin": "^2.2.1", + "eslint-plugin-import": "2.x", + "eslint-plugin-json": "^2.1.1", + "fs-copy-file-sync": "^1.1.1", + "glob": "^7.1.6", + "in-publish": "^2.0.1", + "linklocal": "^2.8.2", + "lodash.isarray": "^4.0.0", + "mocha": "^3.5.3", + "npm-which": "^3.0.1", + "nyc": "^11.9.0", + "redux": "^3.7.2", + "rimraf": "^2.7.1", + "semver": "^6.3.0", + "sinon": "^2.4.1", + "typescript": "~3.9.5", + "typescript-eslint-parser": "^22.0.0" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0" + }, + "dependencies": { + "array-includes": "^3.1.1", + "array.prototype.flat": "^1.2.3", + "contains-path": "^0.1.0", + "debug": "^2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.3", + "eslint-module-utils": "^2.6.0", + "has": "^1.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.1", + "read-pkg-up": "^2.0.0", + "resolve": "^1.17.0", + "tsconfig-paths": "^3.9.0" + }, + "nyc": { + "require": [ + "babel-register" + ], + "sourceMap": false, + "instrument": false, + "include": [ + "src/", + "resolvers/" + ] + } +} \ No newline at end of file diff --git a/node_modules/eslint-plugin-no-async-foreach/README.md b/node_modules/eslint-plugin-no-async-foreach/README.md new file mode 100644 index 000000000..2f0a1c587 --- /dev/null +++ b/node_modules/eslint-plugin-no-async-foreach/README.md @@ -0,0 +1,45 @@ +# eslint-plugin-no-async-foreach + +No async forEach + +## Installation + +You'll first need to install [ESLint](http://eslint.org): + +``` +$ npm i eslint --save-dev +``` + +Next, install `eslint-plugin-no-async-foreach`: + +``` +$ npm install eslint-plugin-no-async-foreach --save-dev +``` + +**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `eslint-plugin-no-async-foreach` globally. + +## Usage + +Add `no-async-foreach` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix: + +```json +{ + "plugins": [ + "no-async-foreach" + ] +} +``` + + +Then configure the rules you want to use under the rules section. + +```json +{ + "rules": { + "no-async-foreach/no-async-foreach": 2 + } +} +``` + + + diff --git a/node_modules/eslint-plugin-no-async-foreach/index.js b/node_modules/eslint-plugin-no-async-foreach/index.js new file mode 100644 index 000000000..ed320eef1 --- /dev/null +++ b/node_modules/eslint-plugin-no-async-foreach/index.js @@ -0,0 +1,5 @@ +module.exports = { + rules: { + "no-async-foreach": require('./lib/no-async-foreach') + } +}; \ No newline at end of file diff --git a/node_modules/eslint-plugin-no-async-foreach/lib/no-async-foreach.js b/node_modules/eslint-plugin-no-async-foreach/lib/no-async-foreach.js new file mode 100644 index 000000000..8a4effc39 --- /dev/null +++ b/node_modules/eslint-plugin-no-async-foreach/lib/no-async-foreach.js @@ -0,0 +1,34 @@ +/** + * @fileoverview Blah + * @author El + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + create: function(context) { + + return { + ExpressionStatement: function(node) { + const { callee } = node.expression + if (!callee || !callee.property || !callee.property.name) return; + if (callee.property.name === "forEach") { + const functionArguments = node.expression.arguments.find(n => { + return n.type === 'ArrowFunctionExpression' || n.type === 'FunctionExpression' + }) + if(functionArguments){ + if (functionArguments.async) { + context.report(node, "No async function in forEachs"); + } + } + } + + } + }; + } + + +} \ No newline at end of file diff --git a/node_modules/eslint-plugin-no-async-foreach/package.json b/node_modules/eslint-plugin-no-async-foreach/package.json new file mode 100644 index 000000000..0ce033466 --- /dev/null +++ b/node_modules/eslint-plugin-no-async-foreach/package.json @@ -0,0 +1,26 @@ +{ + "name": "eslint-plugin-no-async-foreach", + "version": "0.1.1", + "description": "No async forEachs", + "keywords": [ + "eslint", + "eslintplugin", + "eslint-plugin" + ], + "author": "Elliott McNary", + "main": "index.js", + "scripts": { + "test": "mocha tests --recursive" + }, + "dependencies": { + "requireindex": "~1.1.0" + }, + "devDependencies": { + "eslint": "~3.9.1", + "mocha": "^3.1.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "license": "ISC" +} \ No newline at end of file diff --git a/node_modules/eslint-plugin-no-async-foreach/tests/lib/rules/no-async-foreach.js b/node_modules/eslint-plugin-no-async-foreach/tests/lib/rules/no-async-foreach.js new file mode 100644 index 000000000..898103ad2 --- /dev/null +++ b/node_modules/eslint-plugin-no-async-foreach/tests/lib/rules/no-async-foreach.js @@ -0,0 +1,52 @@ +/** + * @fileoverview Blah + * @author El + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var rule = require("../../../lib/no-async-foreach"), + + RuleTester = require("eslint").RuleTester; + + +//------------------------------------------------------------------------------ +// Tests +//------------------------------------------------------------------------------ + +const ERROR_MSG = 'No async function in forEachs'; + +var ruleTester = new RuleTester(); +ruleTester.run("no-async-foreach", rule, { + + valid: [ + { + code: "[].forEach(() => {})", + parserOptions: { ecmaVersion: 8 } + }, + { + code: "[].forEach(function() {})", + parserOptions: { ecmaVersion: 8 } + } + ], + + invalid: [ + { + code: "[].forEach(async () => {});", + parserOptions: { ecmaVersion: 8 }, + errors: [{ + message: ERROR_MSG, + }] + }, + { + code: "[].forEach(async function() {});", + parserOptions: { ecmaVersion: 8 }, + errors: [{ + message: ERROR_MSG, + }] + } + ] +}); diff --git a/node_modules/eslint-plugin-prettier/CHANGELOG.md b/node_modules/eslint-plugin-prettier/CHANGELOG.md new file mode 100644 index 000000000..3e32d3c07 --- /dev/null +++ b/node_modules/eslint-plugin-prettier/CHANGELOG.md @@ -0,0 +1,217 @@ +# Changelog + +## v3.1.4 (2020-06-14) + +* Avoid clearing Prettier cache when not using prettierrc ([#303](git@github.com:prettier/eslint-plugin-prettier/issues/303)) ([3c8e2d9](git@github.com:prettier/eslint-plugin-prettier/commit/3c8e2d9871d86a82b10fe3d54f32bb5a54f2913b)) +* build(deps-dev): bump eslint-plugin-eslint-plugin from 2.2.1 to 2.2.2 ([93f7c8b](git@github.com:prettier/eslint-plugin-prettier/commit/93f7c8be7c99a0c3e4b11be6a5311316f76e6e08)) +* build(deps-dev): bump eslint from 7.1.0 to 7.2.0 ([650ac7a](git@github.com:prettier/eslint-plugin-prettier/commit/650ac7a40c1f4d46b0bd37efad3eed84f8155a44)) +* build(deps-dev): bump eslint-plugin-self from 1.2.0 to 1.2.1 ([6449ec1](git@github.com:prettier/eslint-plugin-prettier/commit/6449ec151f119e98d69da91ad6d10dbb374162d8)) +* build(deps-dev): bump eslint from 7.0.0 to 7.1.0 ([fd30022](git@github.com:prettier/eslint-plugin-prettier/commit/fd30022a51a57a4e96dd4ab3e04956b945886874)) +* Chore: Add CI tests for ESLint 7 ([#291](git@github.com:prettier/eslint-plugin-prettier/issues/291)) ([cc2979b](git@github.com:prettier/eslint-plugin-prettier/commit/cc2979b68258b8545931ce37168adfe17b1d3a7b)) +* build(deps-dev): bump eslint-config-prettier from 6.10.1 to 6.11.0 ([35a7ee6](git@github.com:prettier/eslint-plugin-prettier/commit/35a7ee68b02ea3088270210ac8dc85ff47ef65a9)) + +## v3.1.3 (2020-04-13) + +* Fix: Set `meta.type` to "layout" ([#283](git@github.com:prettier/eslint-plugin-prettier/issues/283)) ([97152e2](git@github.com:prettier/eslint-plugin-prettier/commit/97152e2787bf9bb27f053d6a91ccf826dc96a505)) +* build(deps-dev): bump eslint-config-prettier from 6.10.0 to 6.10.1 ([185b106](git@github.com:prettier/eslint-plugin-prettier/commit/185b1064d3dd674538456fb2fad97fbfcde49e0d)) +* build(deps): [security] bump acorn from 6.1.0 to 6.4.1 ([bba5881](git@github.com:prettier/eslint-plugin-prettier/commit/bba588151e860b1a644096441b31a0f3144db611)) +* build(deps-dev): bump eslint-config-prettier from 6.9.0 to 6.10.0 ([9a47a6f](git@github.com:prettier/eslint-plugin-prettier/commit/9a47a6feab691cf228d184c103d4cab99b464d0b)) +* build(deps-dev): bump eslint-plugin-eslint-plugin from 2.2.0 to 2.2.1 ([aad671d](git@github.com:prettier/eslint-plugin-prettier/commit/aad671d5123a2fd20e4396d591e25335d7219950)) +* build(deps-dev): bump eslint-plugin-eslint-plugin from 2.1.0 to 2.2.0 ([e2458c2](git@github.com:prettier/eslint-plugin-prettier/commit/e2458c2d41825f94441dc7d552da37aede95ffe7)) +* build(deps-dev): bump eslint-config-prettier from 6.8.0 to 6.9.0 ([05ef06f](git@github.com:prettier/eslint-plugin-prettier/commit/05ef06ffdda2bb485a2175243e6a8a167a01466c)) +* build(deps-dev): bump eslint-config-prettier from 6.7.0 to 6.8.0 ([ab80b3c](git@github.com:prettier/eslint-plugin-prettier/commit/ab80b3c5d30ea605aa363f13078aef9e0b697b6e)) +* build(deps-dev): bump eslint from 6.7.2 to 6.8.0 ([dea1b30](git@github.com:prettier/eslint-plugin-prettier/commit/dea1b30361921d7160aaf44d5302c5cc6490f87a)) + +## v3.1.2 (2019-12-15) + +* Resolve config when getting list of inferred parsers ([1ad45be](git@github.com:prettier/eslint-plugin-prettier/commit/1ad45be48ea1ed16e0eb3ba6247163724b956516)) +* Fix tests now they to stop them inheriting from base prettierrc file ([14840fa](git@github.com:prettier/eslint-plugin-prettier/commit/14840fa4c88c938bf30c1fdf1c26c32b2708a3b6)) +* Move prettier config into dedicated file, so vscode plugins pick it up ([c49334a](git@github.com:prettier/eslint-plugin-prettier/commit/c49334a846afa6f688695a4774f7824ee3a05e1c)) +* build(deps-dev): bump eslint from 6.7.1 to 6.7.2 ([15e6cf9](git@github.com:prettier/eslint-plugin-prettier/commit/15e6cf91509cb5b819d2e1fb19dbe9bc71c87893)) +* build(deps-dev): bump eslint from 6.6.0 to 6.7.1 ([e8ad019](git@github.com:prettier/eslint-plugin-prettier/commit/e8ad0195000af416f3315396e9c02fea261391cc)) +* build(deps-dev): bump eslint-config-prettier from 6.6.0 to 6.7.0 ([44f4bfe](git@github.com:prettier/eslint-plugin-prettier/commit/44f4bfe0b6f63234afeba266928b39b762269282)) +* build(deps-dev): bump eslint-config-prettier from 6.5.0 to 6.6.0 ([46580c5](git@github.com:prettier/eslint-plugin-prettier/commit/46580c55914057dee5089e9c6e525e41996888d1)) +* build(deps-dev): bump prettier from 1.18.2 to 1.19.1 ([10b4676](git@github.com:prettier/eslint-plugin-prettier/commit/10b46763fd007a8f939e43635831aec590717e87)) +* build(deps-dev): bump eslint from 6.5.1 to 6.6.0 ([53eaeae](git@github.com:prettier/eslint-plugin-prettier/commit/53eaeaec91c158b66cc04dbf80f9631bb82285bf)) +* build(deps-dev): bump eslint-config-prettier from 6.4.0 to 6.5.0 ([ad3321c](git@github.com:prettier/eslint-plugin-prettier/commit/ad3321c3ae6e963317fedcdd205ba719bf933d74)) +* build(deps-dev): bump mocha from 6.2.1 to 6.2.2 ([b7280b6](git@github.com:prettier/eslint-plugin-prettier/commit/b7280b68eaae243aa33de364576cddf0844c6848)) +* build(deps-dev): bump eslint-config-prettier from 6.3.0 to 6.4.0 ([4c1d69a](git@github.com:prettier/eslint-plugin-prettier/commit/4c1d69a8022c709cd62e964a82c7dbc7963f0544)) +* build(deps-dev): bump eslint from 6.5.0 to 6.5.1 ([c109a7a](git@github.com:prettier/eslint-plugin-prettier/commit/c109a7a5acca9533feae6258e9ac4934359ed9b3)) +* build(deps-dev): bump mocha from 6.2.0 to 6.2.1 ([3134bea](git@github.com:prettier/eslint-plugin-prettier/commit/3134beab61dee13aa2c73762a55f51f868553e8a)) +* build(deps-dev): bump eslint from 6.4.0 to 6.5.0 ([7c290d7](git@github.com:prettier/eslint-plugin-prettier/commit/7c290d799e319b39519d81a110b62846894bc7ba)) + +## v3.1.1 (2019-09-18) + +* build(deps-dev): bump eslint from 6.3.0 to 6.4.0 ([8a793eb](git@github.com:prettier/eslint-plugin-prettier/commit/8a793eba54ff01493e3ee83daf4dcb782d039fdd)) +* build(deps-dev): bump eslint-config-prettier from 6.2.0 to 6.3.0 ([88c3f6c](git@github.com:prettier/eslint-plugin-prettier/commit/88c3f6cb510b758e6dc866a1ad1a0484ef074484)) +* build(deps-dev): bump eslint-config-prettier from 6.0.0 to 6.2.0 ([5f9fbc1](git@github.com:prettier/eslint-plugin-prettier/commit/5f9fbc16f91d88a5c77b8b9d942b82424add77a5)) +* build(deps-dev): bump eslint from 6.2.2 to 6.3.0 ([746b66d](git@github.com:prettier/eslint-plugin-prettier/commit/746b66dc701e8226930f6e4d8386bd500dcb303b)) +* build(deps-dev): bump eslint from 6.1.0 to 6.2.2 ([97eedb4](git@github.com:prettier/eslint-plugin-prettier/commit/97eedb4734a4c569d4c24a62cffe024c2a26c178)) +* build(deps-dev): bump eslint from 6.0.1 to 6.1.0 ([afef9d1](git@github.com:prettier/eslint-plugin-prettier/commit/afef9d137c8b7887c63e3f8d51cabf42851f5cf1)) +* build(deps-dev): bump mocha from 6.1.4 to 6.2.0 ([0360a84](git@github.com:prettier/eslint-plugin-prettier/commit/0360a845ce530d8c25f390961d6446b4c58e85ac)) +* build(deps): [security] bump lodash from 4.17.11 to 4.17.14 ([9eceb68](git@github.com:prettier/eslint-plugin-prettier/commit/9eceb6834fcd003c5680c3202b656ca3474c19c2)) +* Fix: When forcing the JS parser, use the modern name ([#212](git@github.com:prettier/eslint-plugin-prettier/issues/212)) ([1385310](git@github.com:prettier/eslint-plugin-prettier/commit/1385310fce778a8c771d0dab0e400725c9f9d82e)) +* Add eslint 6 to test matrix ([#210](git@github.com:prettier/eslint-plugin-prettier/issues/210)) ([bca77e6](git@github.com:prettier/eslint-plugin-prettier/commit/bca77e66ed1eba682eb13055862adc70478d472b)) +* build(deps-dev): bump eslint-config-prettier from 5.0.0 to 6.0.0 ([4c069bd](git@github.com:prettier/eslint-plugin-prettier/commit/4c069bd0f3b907039569964e747479aa06279594)) +* build(deps-dev): bump eslint-config-prettier from 4.3.0 to 5.0.0 ([60bb22f](git@github.com:prettier/eslint-plugin-prettier/commit/60bb22f4ae1d6af001ba55338a7cb08111db23d9)) +* build(deps-dev): bump prettier from 1.18.0 to 1.18.2 ([a183560](git@github.com:prettier/eslint-plugin-prettier/commit/a1835600facebc819e31a0816061e62f8be2cd8b)) +* build(deps-dev): bump prettier from 1.17.1 to 1.18.0 ([0cad479](git@github.com:prettier/eslint-plugin-prettier/commit/0cad4793abb6139eb9d6853b5adef7469aef756d)) +* build(deps-dev): bump eslint-config-prettier from 4.2.0 to 4.3.0 ([6f3c76f](git@github.com:prettier/eslint-plugin-prettier/commit/6f3c76fd75dc4f982d1221e6b4802329b32176a9)) +* build(deps-dev): bump prettier from 1.17.0 to 1.17.1 ([03aecfd](git@github.com:prettier/eslint-plugin-prettier/commit/03aecfd49b96d055ff54ec989c93408a9fb3f3ee)) + +## v3.1.0 (2019-05-11) + +* New: Allow options to be passed to prettier.getFileInfo ([#187](https://github.com/prettier/eslint-plugin-prettier/issues/187)) ([21fa69a](https://github.com/prettier/eslint-plugin-prettier/commit/21fa69a8ed3b6acfc5461f6c3332444c21e65e28)) +* build(deps-dev): bump eslint-plugin-eslint-plugin from 2.0.1 to 2.1.0 ([bb597e1](https://github.com/prettier/eslint-plugin-prettier/commit/bb597e14aba46211fd4149d0b0f1bdc51fe76452)) +* build(deps-dev): bump eslint-config-prettier from 4.1.0 to 4.2.0 ([0bb7c1d](https://github.com/prettier/eslint-plugin-prettier/commit/0bb7c1d361b581fddebd64bf172b5dedcad5149c)) +* build(deps-dev): bump vue-eslint-parser from 6.0.3 to 6.0.4 ([2f77df4](https://github.com/prettier/eslint-plugin-prettier/commit/2f77df48f151d4975bbdb29ced8c74a72d011428)) +* build(deps-dev): bump mocha from 6.1.3 to 6.1.4 ([222b87a](https://github.com/prettier/eslint-plugin-prettier/commit/222b87a347331b20b3e7f65dcdfaa491bd277b3a)) +* build(deps-dev): bump prettier from 1.16.4 to 1.17.0 ([58d8ff8](https://github.com/prettier/eslint-plugin-prettier/commit/58d8ff8ab2b1f73c904f5492eb523d7ea585ed8f)) +* build(deps-dev): bump mocha from 6.1.2 to 6.1.3 ([e94e56c](https://github.com/prettier/eslint-plugin-prettier/commit/e94e56c36018aab6e08452fbe05bb16a23d64197)) +* build(deps-dev): bump mocha from 6.1.1 to 6.1.2 ([c02244b](https://github.com/prettier/eslint-plugin-prettier/commit/c02244b197893f4e2a214d43f755b726cecbd03c)) +* build(deps-dev): bump mocha from 6.0.2 to 6.1.1 ([a9a2e4e](https://github.com/prettier/eslint-plugin-prettier/commit/a9a2e4e3c0a243ec73061c10d9c4a5ae0c0e6f68)) +* build(deps-dev): bump eslint from 5.15.3 to 5.16.0 ([073c14c](https://github.com/prettier/eslint-plugin-prettier/commit/073c14c2ae5c43d0939fe6f475561f1cf3d7a3e5)) +* build(deps-dev): bump eslint from 5.15.2 to 5.15.3 ([bda931f](https://github.com/prettier/eslint-plugin-prettier/commit/bda931f4f1344f6927fbfd3a35965d1a4d319642)) +* build(deps-dev): bump eslint from 5.15.1 to 5.15.2 ([19f53d6](https://github.com/prettier/eslint-plugin-prettier/commit/19f53d6a94a701e0aab9630bef93051aec4dfd36)) +* build(deps-dev): bump eslint from 5.15.0 to 5.15.1 ([34b39de](https://github.com/prettier/eslint-plugin-prettier/commit/34b39dec2e6e283da1ca6faa0c636c5361efb5b9)) +* build(deps-dev): bump eslint from 5.14.1 to 5.15.0 ([13bcc66](https://github.com/prettier/eslint-plugin-prettier/commit/13bcc66c120d614c17040e329360510feab47e7d)) +* build(deps-dev): bump eslint-plugin-self from 1.1.0 to 1.2.0 ([5b4adb8](https://github.com/prettier/eslint-plugin-prettier/commit/5b4adb8ce683a93feddad07eda17d99b41849342)) +* build(deps-dev): bump vue-eslint-parser from 6.0.2 to 6.0.3 ([e676cd1](https://github.com/prettier/eslint-plugin-prettier/commit/e676cd19387e70102467d9a82014906561f3c225)) +* build(deps-dev): bump eslint-config-prettier from 4.0.0 to 4.1.0 ([b8a9215](https://github.com/prettier/eslint-plugin-prettier/commit/b8a9215515cdcb75faf212caeb00dfbcae11ee42)) +* build(deps-dev): bump mocha from 6.0.1 to 6.0.2 ([cde36e4](https://github.com/prettier/eslint-plugin-prettier/commit/cde36e4db18ac4442eba3c75a20c1a6605e937d4)) +* build(deps-dev): bump mocha from 6.0.0 to 6.0.1 ([eb39699](https://github.com/prettier/eslint-plugin-prettier/commit/eb39699b9bdf7c406a3134cc26c404947534661d)) +* build(deps-dev): bump mocha from 5.2.0 to 6.0.0 ([5d75421](https://github.com/prettier/eslint-plugin-prettier/commit/5d75421d5e3ee5f8293b47a5825e1f2415f7e6b9)) +* build(deps-dev): bump eslint from 5.14.0 to 5.14.1 ([829156e](https://github.com/prettier/eslint-plugin-prettier/commit/829156e467e53f554691afa687c13715086974f7)) +* build(deps-dev): bump eslint from 5.13.0 to 5.14.0 ([b76d0b4](https://github.com/prettier/eslint-plugin-prettier/commit/b76d0b4471845143630b3603b97607665bf66ca0)) +* build(deps-dev): bump vue-eslint-parser from 6.0.0 to 6.0.2 ([15439e8](https://github.com/prettier/eslint-plugin-prettier/commit/15439e8e0dcfa11a19f0cf249a1f4ad5f7fa5b96)) +* build(deps-dev): bump vue-eslint-parser from 5.0.0 to 6.0.0 ([0ea70e5](https://github.com/prettier/eslint-plugin-prettier/commit/0ea70e5161d315ab93e6c4eb93f76d5304b8c162)) +* build(deps-dev): bump eslint from 5.12.1 to 5.13.0 ([5f18729](https://github.com/prettier/eslint-plugin-prettier/commit/5f18729dbe359fe0df10730fd768a1ca6949b0a2)) +* build(deps-dev): bump prettier from 1.16.3 to 1.16.4 ([ef637fe](https://github.com/prettier/eslint-plugin-prettier/commit/ef637fea4d6028b472cfe56dcb4fe30ee7939e0d)) +* build(deps-dev): bump prettier from 1.16.1 to 1.16.3 ([58ab20c](https://github.com/prettier/eslint-plugin-prettier/commit/58ab20cc03f81a7d668998e64168eef7ad5b4365)) +* build(deps-dev): bump eslint-config-prettier from 3.6.0 to 4.0.0 ([14393bd](https://github.com/prettier/eslint-plugin-prettier/commit/14393bdbcfd6114e810c10b4b7f905485474a36f)) +* build(deps-dev): bump prettier from 1.16.0 to 1.16.1 ([00198b9](https://github.com/prettier/eslint-plugin-prettier/commit/00198b9795d1341f4c4a488c83f656e74f6bfdb0)) +* build(deps-dev): bump prettier from 1.15.3 to 1.16.0 ([7890a87](https://github.com/prettier/eslint-plugin-prettier/commit/7890a876fc1c22b1fdee8724296eaa56eb6df1a3)) +* build(deps-dev): bump eslint from 5.12.0 to 5.12.1 ([92a8984](https://github.com/prettier/eslint-plugin-prettier/commit/92a898470fbd88a4f5f4d8e1b15cf53bd7f8a92e)) +* build(deps-dev): bump eslint-config-prettier from 3.5.0 to 3.6.0 ([5292d12](https://github.com/prettier/eslint-plugin-prettier/commit/5292d127dfd4f90ec6695d4060b5f5447a2c0119)) +* build(deps-dev): bump eslint-config-prettier from 3.4.0 to 3.5.0 ([44a2558](https://github.com/prettier/eslint-plugin-prettier/commit/44a2558820d1c733f1572c98503e7b00b16b3fb7)) +* build(deps-dev): bump eslint-config-prettier from 3.3.0 to 3.4.0 ([425cfce](https://github.com/prettier/eslint-plugin-prettier/commit/425cfce1bb712c96dfdd2292b04d89cceb375681)) +* build(deps-dev): bump eslint from 5.11.1 to 5.12.0 ([3e9aa39](https://github.com/prettier/eslint-plugin-prettier/commit/3e9aa399ee3c0394a397f6ed3f8ec7c5e1597991)) +* build(deps-dev): bump eslint-plugin-node from 8.0.0 to 8.0.1 ([e913afd](https://github.com/prettier/eslint-plugin-prettier/commit/e913afdd7291b5e58adf567f5e7a5bb9257dc9e3)) +* build(deps-dev): bump vue-eslint-parser from 4.0.3 to 5.0.0 ([ecfd5ba](https://github.com/prettier/eslint-plugin-prettier/commit/ecfd5bab7bfb36e0203a334808243cb85aaeb512)) + +## v3.0.1 (2018-12-28) + +* Catch and format SyntaxErrors as eslint violations ([#141](https://github.com/prettier/eslint-plugin-prettier/issues/141)) ([4a0e57d](https://github.com/prettier/eslint-plugin-prettier/commit/4a0e57ddcc0fa2ae8e8f7d8b65ddc4ac93d9f474)) +* build(deps-dev): bump eslint from 5.11.0 to 5.11.1 ([d34daed](https://github.com/prettier/eslint-plugin-prettier/commit/d34daed47fbda09cbd19a73c38323e0aed0c30d5)) +* build(deps-dev): bump eslint from 5.10.0 to 5.11.0 ([7f4f45d](https://github.com/prettier/eslint-plugin-prettier/commit/7f4f45dd132ecd72207b536b86910bebf15693b6)) +* build(deps-dev): bump eslint-plugin-eslint-plugin from 2.0.0 to 2.0.1 ([5be3bcf](https://github.com/prettier/eslint-plugin-prettier/commit/5be3bcfce11b741cd35c92b9c972e457a4038766)) +* build(deps-dev): bump eslint from 5.9.0 to 5.10.0 ([11e7c44](https://github.com/prettier/eslint-plugin-prettier/commit/11e7c447a8ebcfae213afe6ba872f96adb43e6b9)) +* build(deps-dev): bump eslint-plugin-eslint-plugin from 1.4.1 to 2.0.0 ([9e5bf14](https://github.com/prettier/eslint-plugin-prettier/commit/9e5bf140451f82a36c78042315a9f88a12cfe45f)) +* build(deps-dev): bump vue-eslint-parser from 4.0.2 to 4.0.3 ([234583a](https://github.com/prettier/eslint-plugin-prettier/commit/234583a19a97ecd1f996542ccb1178a26d20c0fd)) +* build(deps-dev): bump vue-eslint-parser from 3.3.0 to 4.0.2 ([8675d57](https://github.com/prettier/eslint-plugin-prettier/commit/8675d5713f5171981119b89c2e8a58fda6b81259)) +* Upgrade: Bump vue-eslint-parser from 3.2.2 to 3.3.0 ([2379e93](https://github.com/prettier/eslint-plugin-prettier/commit/2379e93c7fb81ddfe306c1fe6a10d1833cfddf2c)) +* Upgrade: Bump eslint-config-prettier from 3.1.0 to 3.3.0 ([3ea0021](https://github.com/prettier/eslint-plugin-prettier/commit/3ea00218961b75e475def14372f9eab0de5ad05d)) +* Upgrade: Bump eslint from 5.8.0 to 5.9.0 ([c774fb8](https://github.com/prettier/eslint-plugin-prettier/commit/c774fb87fe53d19389964883f05e77309b321139)) +* build(deps-dev): bump eslint-plugin-node from 7.0.1 to 8.0.0 ([#121](https://github.com/prettier/eslint-plugin-prettier/issues/121)) ([2a4fba0](https://github.com/prettier/eslint-plugin-prettier/commit/2a4fba01222f62a576da48478e3dcd832e3bff7e)) +* build(deps-dev): bump eslint-plugin-eslint-plugin from 1.4.0 to 1.4.1 ([#120](https://github.com/prettier/eslint-plugin-prettier/issues/120)) ([29caa29](https://github.com/prettier/eslint-plugin-prettier/commit/29caa299612db8af7a188749a5dd8b9827f51a67)) +* build(deps-dev): bump eslint from 5.6.0 to 5.8.0 ([#119](https://github.com/prettier/eslint-plugin-prettier/issues/119)) ([2836350](https://github.com/prettier/eslint-plugin-prettier/commit/2836350829dc3c19b4c1ebca33a3a7905c1b28a5)) + +## v3.0.0 (2018-10-01) + +* Chore: Add eslint peer-dependency ([d55d79c](https://github.com/prettier/eslint-plugin-prettier/commit/d55d79c6a64f659f405788fc75f344704619979f)) +* Breaking: Extract showInvisibles and generateDifferences ([bf7c40c](https://github.com/prettier/eslint-plugin-prettier/commit/bf7c40c240d9833548a7c9d210a28c90a4f3957b)) +* Breaking: Defining prettier options must use an object ([478c7e5](https://github.com/prettier/eslint-plugin-prettier/commit/478c7e5d2165f3e67e893c9a317b602159eaff9c)) +* Breaking: Drop support for ESLint v3 and v4 ([2326231](https://github.com/prettier/eslint-plugin-prettier/commit/232623179b16b99c0cf89ec9b8ed7660c69b092d)) +* Chore: Update dependencies ([1ec94c8](https://github.com/prettier/eslint-plugin-prettier/commit/1ec94c8e3495f6964588da5264b890cb49616fff)) +* Chore: remove two unused dependencies ([bfe459c](https://github.com/prettier/eslint-plugin-prettier/commit/bfe459c39b742115137e81278f03f8e6abfd7dcf)) +* Chore: Rename test files to keep them sequential ([d38ea52](https://github.com/prettier/eslint-plugin-prettier/commit/d38ea52debdf9da718c60933f42a709fa05f550f)) +* Breaking: Remove pragma support ([3af422c](https://github.com/prettier/eslint-plugin-prettier/commit/3af422c8e301978b611cfc665e052d48c102b443)) +* Breaking: Update minimum required pretter version to 1.13.0 ([29c0506](https://github.com/prettier/eslint-plugin-prettier/commit/29c050605674fda2975b3b620c89a7eb9332641a)) +* Breaking: Drop support for node v4, v7 and v9 ([be460bd](https://github.com/prettier/eslint-plugin-prettier/commit/be460bdd06fafb04442b440efabc7b36b12934a7)) +* Chore: Add vscode config to autoformat on save ([9fac6b4](https://github.com/prettier/eslint-plugin-prettier/commit/9fac6b4039c1983b83073fa7af7864f0d7e1f2d3)) +* Chore: Improve travis matrix ([46d2444](https://github.com/prettier/eslint-plugin-prettier/commit/46d244409e397ba9ff2dea621e99a4ea90e0585b)) +* Chore: Add format script to run prettier ([d46aa6d](https://github.com/prettier/eslint-plugin-prettier/commit/d46aa6dbd8028802121231d3ae0fe3f837bca9ad)) + +## v2.7.0 (2018-09-26) + +* Update: Support prettierignore and custom processors ([#111](https://github.com/prettier/eslint-plugin-prettier/issues/111)) ([38537ba](https://github.com/prettier/eslint-plugin-prettier/commit/38537ba35fc9152852c3b91f3041d72556b43013)) +* Build: switch to release script package ([047dc8f](https://github.com/prettier/eslint-plugin-prettier/commit/047dc8ffdf006c74267df4902fec684c589dad12)) + +## v2.6.2 (2018-07-06) + +* Fix: Add representation for \r to showInvisibles ([#100](https://github.com/prettier/eslint-plugin-prettier/issues/100)) ([731bbb5](https://github.com/prettier/eslint-plugin-prettier/commit/731bbb576ce422a5c73a1fa9750aa3466c7da928)) +* Docs: Add clarification about Flow/React support to readme ([#96](https://github.com/prettier/eslint-plugin-prettier/issues/96)) ([977aa77](https://github.com/prettier/eslint-plugin-prettier/commit/977aa77a119f22af3f8ca8d6f47e5bcfcc9e23fb)) + +## v2.6.1 (2018-06-23) + +* Fix: respect editorconfig ([#92](https://github.com/prettier/eslint-plugin-prettier/issues/92)) ([0b04dd3](https://github.com/prettier/eslint-plugin-prettier/commit/0b04dd362d0d92534a7cf11eaebbab8eb59fc96d)) + +## v2.6.0 (2018-02-02) + +* Update: Add option to skip loading prettierrc ([#83](https://github.com/prettier/eslint-plugin-prettier/issues/83)) ([9e0fb48](https://github.com/prettier/eslint-plugin-prettier/commit/9e0fb48d077214a81ac549731308ab11512c37cd)) +* Build: add Node 8 and 9 to Travis ([e5b5fa7](https://github.com/prettier/eslint-plugin-prettier/commit/e5b5fa74d06a06a53d04c4748b31e24fcd7a41b9)) +* Chore: add test for vue parsing ([1ab43fd](https://github.com/prettier/eslint-plugin-prettier/commit/1ab43fd601a67100cb03bbfe614203fd399d40bb)) + +## v2.5.0 (2018-01-16) + +* Fix: pass filepath to prettier ([#76](https://github.com/prettier/eslint-plugin-prettier/issues/76)) ([0b6ab55](https://github.com/prettier/eslint-plugin-prettier/commit/0b6ab55e0a48e9c31cfa1d7f3b891100e0580493)) +* Update: Add URL to rule documentation to the metadata ([#75](https://github.com/prettier/eslint-plugin-prettier/issues/75)) ([804ead7](https://github.com/prettier/eslint-plugin-prettier/commit/804ead7406e12024a1f9c28628024e5d63b75854)) + +## v2.4.0 (2017-12-17) + +* New: Add 'recommended' configuration ([#73](https://github.com/prettier/eslint-plugin-prettier/issues/73)) ([e529b60](https://github.com/prettier/eslint-plugin-prettier/commit/e529b6004b278fb8de660c75d69381ea071b2114)) +* Docs: Create ISSUE_TEMPLATE.md ([4335b08](https://github.com/prettier/eslint-plugin-prettier/commit/4335b08f2956f695eda20f9ca41653fe15b6538d)) + +## v2.3.1 (2017-09-18) + +* Fix: Guard against older prettier installation ([#56](https://github.com/prettier/eslint-plugin-prettier/issues/56)) ([8a115f9](https://github.com/prettier/eslint-plugin-prettier/commit/8a115f9cc57dc20c9fc5c2b942f1e4770a5d730e)) + +## v2.3.0 (2017-09-18) + +* Update: Support .prettierrc config files (fixes [#46](https://github.com/prettier/eslint-plugin-prettier/issues/46)) ([#55](https://github.com/prettier/eslint-plugin-prettier/issues/55)) ([bc89153](https://github.com/prettier/eslint-plugin-prettier/commit/bc89153ffa733b3b58f123849485d7990577c216)) +* Docs: .eslintrc.json > .eslintrc ([#52](https://github.com/prettier/eslint-plugin-prettier/issues/52)) ([95f0808](https://github.com/prettier/eslint-plugin-prettier/commit/95f0808416f7493426c822790d79cf22b0db0f22)) +* Upgrade: jest-docblock to ^21.0.0 ([#50](https://github.com/prettier/eslint-plugin-prettier/issues/50)) ([c777111](https://github.com/prettier/eslint-plugin-prettier/commit/c777111a526c87236b8853d7e253ee93ac1d988d)) +* Chore: upgrade prettier to ^1.6.1 ([#49](https://github.com/prettier/eslint-plugin-prettier/issues/49)) ([56deffa](https://github.com/prettier/eslint-plugin-prettier/commit/56deffae056c0165a7ed2b993b7cf78b6c71148a)) +* Chore: use eslint-plugin-self for linting ([#47](https://github.com/prettier/eslint-plugin-prettier/issues/47)) ([5ea0526](https://github.com/prettier/eslint-plugin-prettier/commit/5ea05269cc947c2e30a42e5101140ab6faac311a)) + +## v2.2.0 (2017-08-16) + +* New: expose reporter api (fixes [#39](https://github.com/prettier/eslint-plugin-prettier/issues/39)) ([#41](https://github.com/prettier/eslint-plugin-prettier/issues/41)) ([1666067](https://github.com/prettier/eslint-plugin-prettier/commit/1666067aa396dfe6a622eb1d9fd5d21fa851a612)) + +## v2.1.2 (2017-06-14) + +* Chore: Relax peerDependencies ([#30](https://github.com/prettier/eslint-plugin-prettier/issues/30)) ([a19b8af](https://github.com/prettier/eslint-plugin-prettier/commit/a19b8afc5b3e7a05468e1c566d359f80f13b80cd)) +* Chore: Add release script ([#25](https://github.com/prettier/eslint-plugin-prettier/issues/25)) ([8fbfe73](https://github.com/prettier/eslint-plugin-prettier/commit/8fbfe73ec2cdba4c313e9e3add4b602fc3166ab8)) + +## v2.1.1 (2017-05-19) + +* Fix: Support ESLint <3.11.0 ([#24](git@github.com:prettier/eslint-plugin-prettier/issues/24)) ([fde7fdf](git@github.com:prettier/eslint-plugin-prettier/commit/fde7fdf2e2dcb3a1f164e1fddb337070802d2c68)) +* Chore: add yarn.lock ([#23](git@github.com:prettier/eslint-plugin-prettier/issues/23)) ([8b55518](git@github.com:prettier/eslint-plugin-prettier/commit/8b555187937a7e37ad84324c4331478b04898493)) +* Docs: fix links in changelog ([#22](git@github.com:prettier/eslint-plugin-prettier/issues/22)) ([7e70e11](git@github.com:prettier/eslint-plugin-prettier/commit/7e70e11de37ca77f5aeb3dcdb216e1a421b54f0d)) + +## v2.1.0 (2017-05-16) + +* Merge with eslint-plugin-prettify ([#21](https://github.com/prettier/eslint-plugin-prettier/issues/21)) ([6de494f](https://github.com/prettier/eslint-plugin-prettier/commit/6de494fd685a107f3a9a371e663a1f8d68d6d31f)) +* Docs: update repo links to new URL ([#18](https://github.com/prettier/eslint-plugin-prettier/issues/18)) ([6b69492](https://github.com/prettier/eslint-plugin-prettier/commit/6b694928e6e6c192dcb06e6287272fb40cbad17d)) +* Chore: Upgrade development dependencies ([#16](https://github.com/prettier/eslint-plugin-prettier/issues/16)) ([12984ea](https://github.com/prettier/eslint-plugin-prettier/commit/12984ead6c46156b25607c9a8b03ae17def7ef9e)) +* Docs: fix outdated info about prettier's semicolon support ([da6aad1](https://github.com/prettier/eslint-plugin-prettier/commit/da6aad15ea22aa899b26b5ce0979f4a945d80319)) +* Docs: update prettier options in example ([#14](https://github.com/prettier/eslint-plugin-prettier/issues/14)) ([0ae173f](https://github.com/prettier/eslint-plugin-prettier/commit/0ae173f2731b02c0ed72a6cb49efdbdcff54a419)) +* Docs: Change the order of dependencies install ([#13](https://github.com/prettier/eslint-plugin-prettier/issues/13)) ([cbf803c](https://github.com/prettier/eslint-plugin-prettier/commit/cbf803ccf0add6e324ae1513b5260e31bf9a3c05)) +* Docs: Add CONTRIBUTING.md (fixes [#9](https://github.com/prettier/eslint-plugin-prettier/issues/9)) ([40fe55b](https://github.com/prettier/eslint-plugin-prettier/commit/40fe55b3d8c000787b0dcbfa0aed4f0d930808a9)) + +## v2.0.1 (2017-02-26) + +* Docs: add travis badge to README.md ([1daa495](https://github.com/not-an-aardvark/eslint-plugin-prettier/commit/1daa49558a7f904f8d307d3d434a9bc80f41fee6)) +* Upgrade: prettier to 0.18.0 ([1700e41](https://github.com/not-an-aardvark/eslint-plugin-prettier/commit/1700e41b2c66721b521e766052cfaa3cc59cd219)) +* Chore: use eslint-config-prettier ([c979b84](https://github.com/not-an-aardvark/eslint-plugin-prettier/commit/c979b84641c42f8870c21c69d22b75916c8511e0)) +* Fix: avoid relying on an internal eslint function ([5296930](https://github.com/not-an-aardvark/eslint-plugin-prettier/commit/5296930386ef28a26e0f5c606d107e4293f51620)) +* Docs: mention eslint-config-prettier in README.md ([3fd855d](https://github.com/not-an-aardvark/eslint-plugin-prettier/commit/3fd855dfb356c8616c19b51b70eb5fcb8fb90c9c)) +* Chore: pin the version of prettier used to lint this module (refs [#1](https://github.com/not-an-aardvark/eslint-plugin-prettier/issues/1)) ([db85633](https://github.com/not-an-aardvark/eslint-plugin-prettier/commit/db85633a0360caeebbf5b20195a3bc19ebf7177a)) + +## v2.0.0 (2017-01-28) + +* Docs: create changelog ([d388095](https://github.com/not-an-aardvark/eslint-plugin-prettier/commit/d388095314f5c23b12df2b210219dca4cb31cb2d)) +* Docs: add 2.0.0 migration guide ([db508d7](https://github.com/not-an-aardvark/eslint-plugin-prettier/commit/db508d709c92ce60eee6f9f879af44c8d0b44d1d)) +* Breaking: Make prettier a peerDependency ([#1](https://github.com/not-an-aardvark/eslint-plugin-prettier/issues/1)) ([d8a8992](https://github.com/not-an-aardvark/eslint-plugin-prettier/commit/d8a89922ddc6b747c474b62a0948deba6ea2657d)) +* Docs: add repo url to package.json ([2474bc9](https://github.com/not-an-aardvark/eslint-plugin-prettier/commit/2474bc9dd3f05dbd0b1fec38e27bc91a9cb0f1c7)) +* Docs: suggest prettier-eslint if eslint rules disagree with prettier ([3414437](https://github.com/not-an-aardvark/eslint-plugin-prettier/commit/341443754ae231a17d82f037f8b35663257d282a)) diff --git a/node_modules/eslint-plugin-prettier/LICENSE.md b/node_modules/eslint-plugin-prettier/LICENSE.md new file mode 100644 index 000000000..26864ebf2 --- /dev/null +++ b/node_modules/eslint-plugin-prettier/LICENSE.md @@ -0,0 +1,24 @@ +# The MIT License (MIT) + +Copyright © 2017 Andres Suarez and Teddy Katz + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the “Software”), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/eslint-plugin-prettier/README.md b/node_modules/eslint-plugin-prettier/README.md new file mode 100644 index 000000000..2ebde9bdf --- /dev/null +++ b/node_modules/eslint-plugin-prettier/README.md @@ -0,0 +1,140 @@ +# eslint-plugin-prettier [![Build Status](https://travis-ci.org/prettier/eslint-plugin-prettier.svg?branch=master)](https://travis-ci.org/prettier/eslint-plugin-prettier) + +Runs [Prettier](https://github.com/prettier/prettier) as an [ESLint](http://eslint.org) rule and reports differences as individual ESLint issues. + +## Sample + +```js +error: Insert `,` (prettier/prettier) at pkg/commons-atom/ActiveEditorRegistry.js:22:25: + 20 | import { + 21 | observeActiveEditorsDebounced, +> 22 | editorChangesDebounced + | ^ + 23 | } from './debounced';; + 24 | + 25 | import {observableFromSubscribeFunction} from '../commons-node/event'; + + +error: Delete `;` (prettier/prettier) at pkg/commons-atom/ActiveEditorRegistry.js:23:21: + 21 | observeActiveEditorsDebounced, + 22 | editorChangesDebounced +> 23 | } from './debounced';; + | ^ + 24 | + 25 | import {observableFromSubscribeFunction} from '../commons-node/event'; + 26 | import {cacheWhileSubscribed} from '../commons-node/observable'; + + +2 errors found. +``` + +> `./node_modules/.bin/eslint --format codeframe pkg/commons-atom/ActiveEditorRegistry.js` (code from [nuclide](https://github.com/facebook/nuclide)). + +## Installation + +```sh +npm install --save-dev eslint-plugin-prettier +npm install --save-dev --save-exact prettier +``` + +**_`eslint-plugin-prettier` does not install Prettier or ESLint for you._** _You must install these yourself._ + +Then, in your `.eslintrc.json`: + +```json +{ + "plugins": ["prettier"], + "rules": { + "prettier/prettier": "error" + } +} +``` + +## Recommended Configuration + +This plugin works best if you disable all other ESLint rules relating to code formatting, and only enable rules that detect patterns in the AST. (If another active ESLint rule disagrees with `prettier` about how code should be formatted, it will be impossible to avoid lint errors.) You can use [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) to disable all formatting-related ESLint rules. + +If your desired formatting does not match the `prettier` output, you should use a different tool such as [prettier-eslint](https://github.com/prettier/prettier-eslint) instead. + +To integrate this plugin with `eslint-config-prettier`, you can use the `"recommended"` configuration: + +1. In addition to the above installation instructions, install `eslint-config-prettier`: + + ```sh + npm install --save-dev eslint-config-prettier + ``` + +2. Then you need to add `plugin:prettier/recommended` as the last extension in your `.eslintrc.json`: + + ```json + { + "extends": ["plugin:prettier/recommended"] + } + ``` + +This does three things: + +- Enables `eslint-plugin-prettier`. +- Sets the `prettier/prettier` rule to `"error"`. +- Extends the `eslint-config-prettier` configuration. + +You can then set Prettier's own options inside a `.prettierrc` file. + +3. In order to support special ESLint plugins (e.g. [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react)), add extra exclusions for the plugins you use like so: + +```json +{ + "extends": [ + "plugin:prettier/recommended", + "prettier/flowtype", + "prettier/react", + "prettier/standard" + ] +} +``` + +For the list of every available exclusion rule set, please see the [readme of eslint-config-prettier](https://github.com/prettier/eslint-config-prettier/blob/master/README.md). + +## Options + +> Note: While it is possible to pass options to Prettier via your ESLint configuration file, it is not recommended because editor extensions such as `prettier-atom` and `prettier-vscode` **will** read [`.prettierrc`](https://prettier.io/docs/en/configuration.html), but **won't** read settings from ESLint, which can lead to an inconsistent experience. + +- The first option: + + - An object representing [options](https://prettier.io/docs/en/options.html) that will be passed into prettier. Example: + + ```json + "prettier/prettier": ["error", {"singleQuote": true, "parser": "flow"}] + ``` + + NB: This option will merge and override any config set with `.prettierrc` files + +- The second option: + + - An object with the following options + + - `usePrettierrc`: Enables loading of the Prettier configuration file, (default: `true`). May be useful if you are using multiple tools that conflict with each other, or do not wish to mix your ESLint settings with your Prettier configuration. + + ```json + "prettier/prettier": ["error", {}, { + "usePrettierrc": false + }] + ``` + + - `fileInfoOptions`: Options that are passed to [prettier.getFileInfo](https://prettier.io/docs/en/api.html#prettiergetfileinfofilepath-options) to decide whether a file needs to be formatted. Can be used for example to opt-out from ignoring files located in `node_modules` directories. + + ```json + "prettier/prettier": ["error", {}, { + "fileInfoOptions": { + "withNodeModules": true + } + }] + ``` + +- The rule is autofixable -- if you run `eslint` with the `--fix` flag, your code will be formatted according to `prettier` style. + +--- + +## Contributing + +See [CONTRIBUTING.md](https://github.com/prettier/eslint-plugin-prettier/blob/master/CONTRIBUTING.md) diff --git a/node_modules/eslint-plugin-prettier/eslint-plugin-prettier.js b/node_modules/eslint-plugin-prettier/eslint-plugin-prettier.js new file mode 100644 index 000000000..4735e8fc7 --- /dev/null +++ b/node_modules/eslint-plugin-prettier/eslint-plugin-prettier.js @@ -0,0 +1,305 @@ +/** + * @fileoverview Runs `prettier` as an ESLint rule. + * @author Andres Suarez + */ + +'use strict'; + +// ------------------------------------------------------------------------------ +// Requirements +// ------------------------------------------------------------------------------ + +const { + showInvisibles, + generateDifferences +} = require('prettier-linter-helpers'); + +// ------------------------------------------------------------------------------ +// Constants +// ------------------------------------------------------------------------------ + +const { INSERT, DELETE, REPLACE } = generateDifferences; + +// ------------------------------------------------------------------------------ +// Privates +// ------------------------------------------------------------------------------ + +// Lazily-loaded Prettier. +let prettier; + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +/** + * Reports an "Insert ..." issue where text must be inserted. + * @param {RuleContext} context - The ESLint rule context. + * @param {number} offset - The source offset where to insert text. + * @param {string} text - The text to be inserted. + * @returns {void} + */ +function reportInsert(context, offset, text) { + const pos = context.getSourceCode().getLocFromIndex(offset); + const range = [offset, offset]; + context.report({ + message: 'Insert `{{ code }}`', + data: { code: showInvisibles(text) }, + loc: { start: pos, end: pos }, + fix(fixer) { + return fixer.insertTextAfterRange(range, text); + } + }); +} + +/** + * Reports a "Delete ..." issue where text must be deleted. + * @param {RuleContext} context - The ESLint rule context. + * @param {number} offset - The source offset where to delete text. + * @param {string} text - The text to be deleted. + * @returns {void} + */ +function reportDelete(context, offset, text) { + const start = context.getSourceCode().getLocFromIndex(offset); + const end = context.getSourceCode().getLocFromIndex(offset + text.length); + const range = [offset, offset + text.length]; + context.report({ + message: 'Delete `{{ code }}`', + data: { code: showInvisibles(text) }, + loc: { start, end }, + fix(fixer) { + return fixer.removeRange(range); + } + }); +} + +/** + * Reports a "Replace ... with ..." issue where text must be replaced. + * @param {RuleContext} context - The ESLint rule context. + * @param {number} offset - The source offset where to replace deleted text + with inserted text. + * @param {string} deleteText - The text to be deleted. + * @param {string} insertText - The text to be inserted. + * @returns {void} + */ +function reportReplace(context, offset, deleteText, insertText) { + const start = context.getSourceCode().getLocFromIndex(offset); + const end = context + .getSourceCode() + .getLocFromIndex(offset + deleteText.length); + const range = [offset, offset + deleteText.length]; + context.report({ + message: 'Replace `{{ deleteCode }}` with `{{ insertCode }}`', + data: { + deleteCode: showInvisibles(deleteText), + insertCode: showInvisibles(insertText) + }, + loc: { start, end }, + fix(fixer) { + return fixer.replaceTextRange(range, insertText); + } + }); +} + +// ------------------------------------------------------------------------------ +// Module Definition +// ------------------------------------------------------------------------------ + +module.exports = { + configs: { + recommended: { + extends: ['prettier'], + plugins: ['prettier'], + rules: { + 'prettier/prettier': 'error' + } + } + }, + rules: { + prettier: { + meta: { + docs: { + url: 'https://github.com/prettier/eslint-plugin-prettier#options' + }, + type: 'layout', + fixable: 'code', + schema: [ + // Prettier options: + { + type: 'object', + properties: {}, + additionalProperties: true + }, + { + type: 'object', + properties: { + usePrettierrc: { type: 'boolean' }, + fileInfoOptions: { + type: 'object', + properties: {}, + additionalProperties: true + } + }, + additionalProperties: true + } + ] + }, + create(context) { + const usePrettierrc = + !context.options[1] || context.options[1].usePrettierrc !== false; + const eslintFileInfoOptions = + (context.options[1] && context.options[1].fileInfoOptions) || {}; + const sourceCode = context.getSourceCode(); + const filepath = context.getFilename(); + const source = sourceCode.text; + + // This allows long-running ESLint processes (e.g. vscode-eslint) to + // pick up changes to .prettierrc without restarting the editor. This + // will invalidate the prettier plugin cache on every file as well which + // will make ESLint very slow, so it would probably be a good idea to + // find a better way to do this. + if (usePrettierrc && prettier && prettier.clearConfigCache) { + prettier.clearConfigCache(); + } + + return { + Program() { + if (!prettier) { + // Prettier is expensive to load, so only load it if needed. + prettier = require('prettier'); + } + + const eslintPrettierOptions = context.options[0] || {}; + + const prettierRcOptions = usePrettierrc + ? prettier.resolveConfig.sync(filepath, { + editorconfig: true + }) + : null; + + const prettierFileInfo = prettier.getFileInfo.sync( + filepath, + Object.assign( + {}, + { resolveConfig: true, ignorePath: '.prettierignore' }, + eslintFileInfoOptions + ) + ); + + // Skip if file is ignored using a .prettierignore file + if (prettierFileInfo.ignored) { + return; + } + + const initialOptions = {}; + + // ESLint suppports processors that let you extract and lint JS + // fragments within a non-JS language. In the cases where prettier + // supports the same language as a processor, we want to process + // the provided source code as javascript (as ESLint provides the + // rules with fragments of JS) instead of guessing the parser + // based off the filename. Otherwise, for instance, on a .md file we + // end up trying to run prettier over a fragment of JS using the + // markdown parser, which throws an error. + // If we can't infer the parser from from the filename, either + // because no filename was provided or because there is no parser + // found for the filename, use javascript. + // This is added to the options first, so that + // prettierRcOptions and eslintPrettierOptions can still override + // the parser. + // + // `parserBlocklist` should contain the list of prettier parser + // names for file types where: + // * Prettier supports parsing the file type + // * There is an ESLint processor that extracts JavaScript snippets + // from the file type. + const parserBlocklist = [null, 'graphql', 'markdown', 'html']; + if ( + parserBlocklist.indexOf(prettierFileInfo.inferredParser) !== -1 + ) { + // Prettier v1.16.0 renamed the `babylon` parser to `babel` + // Use the modern name if available + const supportBabelParser = prettier + .getSupportInfo() + .languages.some(language => language.parsers.includes('babel')); + + initialOptions.parser = supportBabelParser ? 'babel' : 'babylon'; + } + + const prettierOptions = Object.assign( + {}, + initialOptions, + prettierRcOptions, + eslintPrettierOptions, + { filepath } + ); + + // prettier.format() may throw a SyntaxError if it cannot parse the + // source code it is given. Ususally for JS files this isn't a + // problem as ESLint will report invalid syntax before trying to + // pass it to the prettier plugin. However this might be a problem + // for non-JS languages that are handled by a plugin. Notably Vue + // files throw an error if they contain unclosed elements, such as + // `. In this case report an error at the + // point at which parsing failed. + let prettierSource; + try { + prettierSource = prettier.format(source, prettierOptions); + } catch (err) { + if (!(err instanceof SyntaxError)) { + throw err; + } + + let message = 'Parsing error: ' + err.message; + + // Prettier's message contains a codeframe style preview of the + // invalid code and the line/column at which the error occured. + // ESLint shows those pieces of information elsewhere already so + // remove them from the message + if (err.codeFrame) { + message = message.replace(`\n${err.codeFrame}`, ''); + } + if (err.loc) { + message = message.replace(/ \(\d+:\d+\)$/, ''); + } + + context.report({ message, loc: err.loc }); + + return; + } + + if (source !== prettierSource) { + const differences = generateDifferences(source, prettierSource); + + differences.forEach(difference => { + switch (difference.operation) { + case INSERT: + reportInsert( + context, + difference.offset, + difference.insertText + ); + break; + case DELETE: + reportDelete( + context, + difference.offset, + difference.deleteText + ); + break; + case REPLACE: + reportReplace( + context, + difference.offset, + difference.deleteText, + difference.insertText + ); + break; + } + }); + } + } + }; + } + } + } +}; diff --git a/node_modules/eslint-plugin-prettier/package.json b/node_modules/eslint-plugin-prettier/package.json new file mode 100644 index 000000000..5b42531a7 --- /dev/null +++ b/node_modules/eslint-plugin-prettier/package.json @@ -0,0 +1,53 @@ +{ + "name": "eslint-plugin-prettier", + "version": "3.1.4", + "description": "Runs prettier as an eslint rule", + "keywords": [ + "eslint", + "eslintplugin", + "eslint-plugin", + "prettier" + ], + "author": "Teddy Katz", + "files": [ + "eslint-plugin-prettier.js" + ], + "main": "eslint-plugin-prettier.js", + "scripts": { + "lint": "eslint .", + "test": "npm run lint && mocha", + "format": "yarn run prettier '**/*.{js,json,md,yml}' --write && yarn run lint --fix", + "generate-release": "node-release-script" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/prettier/eslint-plugin-prettier.git" + }, + "bugs": { + "url": "https://github.com/prettier/eslint-plugin-prettier/issues" + }, + "homepage": "https://github.com/prettier/eslint-plugin-prettier#readme", + "dependencies": { + "prettier-linter-helpers": "^1.0.0" + }, + "peerDependencies": { + "eslint": ">=5.0.0", + "prettier": ">=1.13.0" + }, + "devDependencies": { + "@not-an-aardvark/node-release-script": "^0.1.0", + "eslint": "^7.0.0", + "eslint-config-not-an-aardvark": "^2.1.0", + "eslint-config-prettier": "^6.0.0", + "eslint-plugin-eslint-plugin": "^2.0.0", + "eslint-plugin-node": "^8.0.0", + "eslint-plugin-self": "^1.1.0", + "mocha": "^6.0.0", + "prettier": "^1.15.3", + "vue-eslint-parser": "^6.0.0" + }, + "engines": { + "node": ">=6.0.0" + }, + "license": "MIT" +} \ No newline at end of file diff --git a/node_modules/eslint-rule-documentation/index.js b/node_modules/eslint-rule-documentation/index.js new file mode 100644 index 000000000..151e5f300 --- /dev/null +++ b/node_modules/eslint-rule-documentation/index.js @@ -0,0 +1,49 @@ +'use strict'; + +var plugins = require('./plugins.json'); + +for (var pluginName of Object.keys(plugins)) { + var url = plugins[pluginName]; + + if (!url.includes('/')) { + url += '/eslint-plugin-' + pluginName; + } + if (url.split('/').length === 2) { + url = 'https://github.com/' + url + '/blob/master/docs/rules/RULENAME.md'; + } + + plugins[pluginName] = url; +} + +function getRuleURI(ruleId) { + if (typeof ruleId !== 'string') { + throw new TypeError(`ruleId must be a string, got ${typeof ruleId}`); + } + + var ruleParts = ruleId.split('/'); + + if (ruleParts.length === 1) { + return { + found: true, + url: 'https://eslint.org/docs/rules/' + ruleId + }; + } + + var pluginName = ruleParts[0]; + var ruleName = ruleParts[1]; + var url = plugins[pluginName]; + + if (!url) { + return { + found: false, + url: 'https://github.com/jfmengels/eslint-rule-documentation/blob/master/contributing.md' + }; + } + + return { + found: true, + url: url.replace('RULENAME', ruleName) + }; +} + +module.exports = getRuleURI; diff --git a/node_modules/eslint-rule-documentation/license b/node_modules/eslint-rule-documentation/license new file mode 100644 index 000000000..be62d7af5 --- /dev/null +++ b/node_modules/eslint-rule-documentation/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Jeroen Engels (github.com/jfmengels) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/eslint-rule-documentation/package.json b/node_modules/eslint-rule-documentation/package.json new file mode 100644 index 000000000..821f73786 --- /dev/null +++ b/node_modules/eslint-rule-documentation/package.json @@ -0,0 +1,40 @@ +{ + "name": "eslint-rule-documentation", + "version": "1.0.23", + "description": "Find the url for the documentation of an ESLint rule", + "license": "MIT", + "repository": "jfmengels/eslint-rule-documentation", + "author": { + "name": "Jeroen Engels", + "email": "jfm.engels@gmail.com", + "url": "github.com/jfmengels" + }, + "engines": { + "node": ">=4.0.0" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js", + "plugins.json" + ], + "keywords": [ + "eslint", + "eslintplugin", + "eslint-plugin", + "plugin", + "plugins", + "rule", + "rules", + "doc", + "documentation" + ], + "devDependencies": { + "ava": "^0.15.2", + "xo": "^0.16.0" + }, + "xo": { + "space": 2 + } +} \ No newline at end of file diff --git a/node_modules/eslint-rule-documentation/plugins.json b/node_modules/eslint-rule-documentation/plugins.json new file mode 100644 index 000000000..119e2c060 --- /dev/null +++ b/node_modules/eslint-rule-documentation/plugins.json @@ -0,0 +1,44 @@ +{ + "angular": "Gillespie59", + "ava": "avajs", + "backbone": "ilyavolodin", + "ember": "netguru", + "es6-recommended": "https://github.com/mgtitimoli/eslint-plugin-es6-recommended#rules", + "eslint-comments": "mysticatea", + "eslint-plugin": "not-an-aardvark", + "flowtype": "https://github.com/gajus/eslint-plugin-flowtype#RULENAME", + "fp": "jfmengels", + "github": "github", + "immutable": "https://github.com/jhusain/eslint-plugin-immutable#RULENAME", + "import": "benmosher", + "import-order": "jfmengels", + "jasmine": "tlvince", + "jest": "jest-community", + "jsdoc": "https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-RULENAME", + "jsx-a11y": "evcohen", + "lodash": "wix", + "lodash-fp": "jfmengels", + "meteor": "dferber90", + "mocha": "lo1tuma", + "mongodb": "https://github.com/nfroidure/eslint-plugin-mongodb#RULENAME", + "mozilla": "https://gecko.readthedocs.io/en/latest/tools/lint/linters/eslint-plugin-mozilla.html#RULENAME", + "netguru-ember": "https://github.com/netguru/eslint-plugin-netguru-ember/blob/master/docs/RULES.md#RULENAME", + "no-unsanitized": "mozilla", + "no-use-extend-native": "dustinspecker", + "node": "mysticatea", + "prettier": "https://github.com/prettier/eslint-plugin-prettier#options", + "promise": "xjamundx", + "protractor": "alecxe", + "react": "yannickcr", + "react-native": "Intellicode", + "redux-saga": "pke", + "requirejs": "cvisco", + "security": "https://github.com/nodesecurity/eslint-plugin-security#rules", + "standard": "https://github.com/xjamundx/eslint-plugin-standard#rules-explanations", + "typescript": "nzakas", + "unicorn": "sindresorhus", + "xo": "sindresorhus/eslint-plugin-unicorn", + "visualforce": "forcedotcom", + "vue": "vuejs", + "jsx-control-statements": "vkbansal" +} diff --git a/node_modules/eslint-rule-documentation/readme.md b/node_modules/eslint-rule-documentation/readme.md new file mode 100644 index 000000000..370edb0e2 --- /dev/null +++ b/node_modules/eslint-rule-documentation/readme.md @@ -0,0 +1,77 @@ +# eslint-rule-documentation [![Build Status](https://travis-ci.org/jfmengels/eslint-rule-documentation.svg?branch=master)](https://travis-ci.org/jfmengels/eslint-rule-documentation) + +> Find the url for the documentation of an [ESLint] rule + + +## Install + +``` +$ npm install --save eslint-rule-documentation +``` + + +## Usage + +```js +const getRuleURI = require('eslint-rule-documentation'); + +// find url for core rules +getRuleURI('no-var'); +// => { found: true, url: 'https://eslint.org/docs/rules/no-var' } + +// find url for known plugins +getRuleURI('import/no-unresolved'); +// => { found: true, url: 'https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md' } + +// If the plugin is not known, get a link to help improve this +getRuleURI('unknown-foo/bar'); +// => { found: false, url: 'https://github.com/jfmengels/eslint-rule-documentation/blob/master/contributing.md' } +``` + +## Contributing + +If you find a plugin that you use is not in the [list of supported plugins](./plugins.json), please consider adding it to the project by following the instructions [here](./contributing.md). + + +## API + +### getRuleURI(ruleId) + + + +#### ruleId + +Type: `string` + +Id of an [ESLint] rule. + +Examples: +- core rule: `no-var` +- plugin rule: `import/no-unresolved` (from the [eslint-plugin-import] plugin). + +#### returns + +Type: `object` + +```js +{ + found: , + url: +} +``` + +- `found`: `true` if the rule is an ESLint core rule, or a rule of a known plugin, `false` otherwise. +- `url`: if `found` is `true`, url of the documentation of a rule. If `found` is `false`, url of the [contribution guidelines](./contributing.md). + +## Thanks + +Special thanks to the team behind [linter-eslint] for the original work, and the people who contributed there. + + +## License + +MIT © [Jeroen Engels](https://github.com/jfmengels) + +[eslint-plugin-import]: https://github.com/benmosher/eslint-plugin-import +[ESLint]: https://eslint.org/ +[linter-eslint]: https://github.com/AtomLinter/linter-eslint diff --git a/node_modules/eslint-scope/CHANGELOG.md b/node_modules/eslint-scope/CHANGELOG.md new file mode 100644 index 000000000..cc07de01c --- /dev/null +++ b/node_modules/eslint-scope/CHANGELOG.md @@ -0,0 +1,70 @@ +v5.1.1 - September 12, 2020 + +* [`9b528d7`](https://github.com/eslint/eslint-scope/commit/9b528d778c381718c12dabfb7f1c0e0dc6b36e49) Upgrade: esrecurse version to ^4.3.0 (#64) (Timofey Kachalov) +* [`f758bbc`](https://github.com/eslint/eslint-scope/commit/f758bbc3d49b9b9ea2289a5d6a6bba8dcf2c4903) Chore: fix definiton -> definition typo in comments (#63) (Kevin Kirsche) +* [`7513734`](https://github.com/eslint/eslint-scope/commit/751373473375b3f2edc4eaf1c8d2763d8435bb72) Chore: move to GitHub Actions (#62) (Kai Cataldo) + +v5.1.0 - June 4, 2020 + +* [`d4a3764`](https://github.com/eslint/eslint-scope/commit/d4a376434b16289c1a428d7e304576e997520873) Update: support new export syntax (#56) (Toru Nagashima) + +v5.0.0 - July 20, 2019 + +* [`e9fa22e`](https://github.com/eslint/eslint-scope/commit/e9fa22ea412c26cf2761fa98af7e715644bdb464) Upgrade: update dependencies after dropping support for Node <8 (#53) (Kai Cataldo) +* [`ee9f7c1`](https://github.com/eslint/eslint-scope/commit/ee9f7c12721aa195ba7e0e69551f49bfdb479951) Breaking: drop support for Node v6 (#54) (Kai Cataldo) + +v4.0.3 - March 15, 2019 + +* [`299df64`](https://github.com/eslint/eslint-scope/commit/299df64bdafb30b4d9372e4b7af0cf51a3818c4a) Fix: arrow function scope strictness (take 2) (#52) (futpib) + +v4.0.2 - March 1, 2019 + +* [`c925600`](https://github.com/eslint/eslint-scope/commit/c925600a684ae0f71b96f85339437a43b4d50d99) Revert "Fix: Arrow function scope strictness (fixes #49) (#50)" (#51) (Teddy Katz) + +v4.0.1 - March 1, 2019 + +* [`2533966`](https://github.com/eslint/eslint-scope/commit/2533966faf317df5a3847fab937ba462c16808b8) Fix: Arrow function scope strictness (fixes #49) (#50) (futpib) +* [`0cbeea5`](https://github.com/eslint/eslint-scope/commit/0cbeea51dfb66ab88ea34b0e3b4ad5e6cc210f2f) Chore: add supported Node.js versions to CI (#47) (Kai Cataldo) +* [`b423057`](https://github.com/eslint/eslint-scope/commit/b42305760638b8edf4667acf1445e450869bd983) Upgrade: eslint-release@1.0.0 (#46) (Teddy Katz) + +v4.0.0 - June 21, 2018 + + + +v4.0.0-rc.0 - June 9, 2018 + +* 3b919b8 Build: Adding rc release script to package.json (#38) (Kevin Partington) +* 137732a Chore: avoid creating package-lock.json files (#37) (Teddy Katz) + +v4.0.0-alpha.0 - April 27, 2018 + +* 7cc3769 Upgrade: eslint-release ^0.11.1 (#36) (Teddy Katz) +* c9f6967 Breaking: remove TDZScope (refs eslint/eslint#10245) (#35) (Toru Nagashima) +* 982a71f Fix: wrong resolution about default parameters (#33) (Toru Nagashima) +* 57889f1 Docs: Remove extra header line from LICENSE (#32) (Gyandeep Singh) + +v3.7.1 - April 12, 2017 + +* ced6262 Fix: restore previous Scope API exports from escope (#31) (Vitor Balocco) +* 5c3d966 Fix: Remove and Modify tests that contain invalid ES6 syntax (#29) (Reyad Attiyat) + +v3.7.0 - March 17, 2017 + +* 9e27835 Chore: Add files section to package.json (#24) (Ilya Volodin) +* 3e4d123 Upgrade: eslint-config-eslint to 4.0.0 (#21) (Teddy Katz) +* 38c50fb Chore: Rename src to lib and test to tests (#20) (Corbin Uselton) +* f4cd920 Chore: Remove esprima (#19) (Corbin Uselton) +* f81fad5 Revert "Chore: Remove esprima" (#18) (James Henry) +* 31b0085 Chore: Remove es6-map and es6-weakmap as they are included in node4 (#10) (#13) (Corbin Uselton) +* 12a1ca1 Add Makefile.js and eslint (#15) (Reyad Attiyat) +* 7d23f8e Chore: Remove es6-map and es6-weakmap as they are included in node4 (#10) (Corbin Uselton) +* 019441e Chore: Convert to ES6 that is supported on Node 4, commonjs modules and remove Babel (#14) (Corbin Uselton) +* c647f65 Update: Add check for node.body in referencer (#2) (Corbin Uselton) +* eb5c9db Remove browserify and jsdoc (#12) (Corbin Uselton) +* cf38df0 Chore: Update README.md (#3) (James Henry) +* 8a142ca Chore: Add eslint-release scripts (#6) (James Henry) +* e60d8cb Chore: Remove unused bower.json (#5) (James Henry) +* 049c545 Chore: Fix tests for eslint-scope (#4) (James Henry) +* f026aab Chore: Update package.json for eslint fork (#1) (James Henry) +* a94d281 Chore: Update license with JSF copyright (Nicholas C. Zakas) + diff --git a/node_modules/eslint-scope/LICENSE b/node_modules/eslint-scope/LICENSE new file mode 100644 index 000000000..d36a526f7 --- /dev/null +++ b/node_modules/eslint-scope/LICENSE @@ -0,0 +1,22 @@ +Copyright JS Foundation and other contributors, https://js.foundation +Copyright (C) 2012-2013 Yusuke Suzuki (twitter: @Constellation) and other contributors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/eslint-scope/README.md b/node_modules/eslint-scope/README.md new file mode 100644 index 000000000..7e7ce0d34 --- /dev/null +++ b/node_modules/eslint-scope/README.md @@ -0,0 +1,54 @@ +# ESLint Scope + +ESLint Scope is the [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) scope analyzer used in ESLint. It is a fork of [escope](http://github.com/estools/escope). + +## Usage + +Install: + +``` +npm i eslint-scope --save +``` + +Example: + +```js +var eslintScope = require('eslint-scope'); +var espree = require('espree'); +var estraverse = require('estraverse'); + +var ast = espree.parse(code); +var scopeManager = eslintScope.analyze(ast); + +var currentScope = scopeManager.acquire(ast); // global scope + +estraverse.traverse(ast, { + enter: function(node, parent) { + // do stuff + + if (/Function/.test(node.type)) { + currentScope = scopeManager.acquire(node); // get current function scope + } + }, + leave: function(node, parent) { + if (/Function/.test(node.type)) { + currentScope = currentScope.upper; // set to parent scope + } + + // do stuff + } +}); +``` + +## Contributing + +Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/eslint-scope/issues). + +## Build Commands + +* `npm test` - run all linting and tests +* `npm run lint` - run all linting + +## License + +ESLint Scope is licensed under a permissive BSD 2-clause license. diff --git a/node_modules/eslint-scope/lib/definition.js b/node_modules/eslint-scope/lib/definition.js new file mode 100644 index 000000000..172bfe23b --- /dev/null +++ b/node_modules/eslint-scope/lib/definition.js @@ -0,0 +1,86 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +"use strict"; + +const Variable = require("./variable"); + +/** + * @class Definition + */ +class Definition { + constructor(type, name, node, parent, index, kind) { + + /** + * @member {String} Definition#type - type of the occurrence (e.g. "Parameter", "Variable", ...). + */ + this.type = type; + + /** + * @member {espree.Identifier} Definition#name - the identifier AST node of the occurrence. + */ + this.name = name; + + /** + * @member {espree.Node} Definition#node - the enclosing node of the identifier. + */ + this.node = node; + + /** + * @member {espree.Node?} Definition#parent - the enclosing statement node of the identifier. + */ + this.parent = parent; + + /** + * @member {Number?} Definition#index - the index in the declaration statement. + */ + this.index = index; + + /** + * @member {String?} Definition#kind - the kind of the declaration statement. + */ + this.kind = kind; + } +} + +/** + * @class ParameterDefinition + */ +class ParameterDefinition extends Definition { + constructor(name, node, index, rest) { + super(Variable.Parameter, name, node, null, index, null); + + /** + * Whether the parameter definition is a part of a rest parameter. + * @member {boolean} ParameterDefinition#rest + */ + this.rest = rest; + } +} + +module.exports = { + ParameterDefinition, + Definition +}; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/index.js b/node_modules/eslint-scope/lib/index.js new file mode 100644 index 000000000..0f16fa40f --- /dev/null +++ b/node_modules/eslint-scope/lib/index.js @@ -0,0 +1,165 @@ +/* + Copyright (C) 2012-2014 Yusuke Suzuki + Copyright (C) 2013 Alex Seville + Copyright (C) 2014 Thiago de Arruda + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * Escope (escope) is an ECMAScript + * scope analyzer extracted from the esmangle project. + *

+ * escope finds lexical scopes in a source program, i.e. areas of that + * program where different occurrences of the same identifier refer to the same + * variable. With each scope the contained variables are collected, and each + * identifier reference in code is linked to its corresponding variable (if + * possible). + *

+ * escope works on a syntax tree of the parsed source code which has + * to adhere to the + * Mozilla Parser API. E.g. espree is a parser + * that produces such syntax trees. + *

+ * The main interface is the {@link analyze} function. + * @module escope + */ +"use strict"; + +/* eslint no-underscore-dangle: ["error", { "allow": ["__currentScope"] }] */ + +const assert = require("assert"); + +const ScopeManager = require("./scope-manager"); +const Referencer = require("./referencer"); +const Reference = require("./reference"); +const Variable = require("./variable"); +const Scope = require("./scope").Scope; +const version = require("../package.json").version; + +/** + * Set the default options + * @returns {Object} options + */ +function defaultOptions() { + return { + optimistic: false, + directive: false, + nodejsScope: false, + impliedStrict: false, + sourceType: "script", // one of ['script', 'module'] + ecmaVersion: 5, + childVisitorKeys: null, + fallback: "iteration" + }; +} + +/** + * Preform deep update on option object + * @param {Object} target - Options + * @param {Object} override - Updates + * @returns {Object} Updated options + */ +function updateDeeply(target, override) { + + /** + * Is hash object + * @param {Object} value - Test value + * @returns {boolean} Result + */ + function isHashObject(value) { + return typeof value === "object" && value instanceof Object && !(value instanceof Array) && !(value instanceof RegExp); + } + + for (const key in override) { + if (Object.prototype.hasOwnProperty.call(override, key)) { + const val = override[key]; + + if (isHashObject(val)) { + if (isHashObject(target[key])) { + updateDeeply(target[key], val); + } else { + target[key] = updateDeeply({}, val); + } + } else { + target[key] = val; + } + } + } + return target; +} + +/** + * Main interface function. Takes an Espree syntax tree and returns the + * analyzed scopes. + * @function analyze + * @param {espree.Tree} tree - Abstract Syntax Tree + * @param {Object} providedOptions - Options that tailor the scope analysis + * @param {boolean} [providedOptions.optimistic=false] - the optimistic flag + * @param {boolean} [providedOptions.directive=false]- the directive flag + * @param {boolean} [providedOptions.ignoreEval=false]- whether to check 'eval()' calls + * @param {boolean} [providedOptions.nodejsScope=false]- whether the whole + * script is executed under node.js environment. When enabled, escope adds + * a function scope immediately following the global scope. + * @param {boolean} [providedOptions.impliedStrict=false]- implied strict mode + * (if ecmaVersion >= 5). + * @param {string} [providedOptions.sourceType='script']- the source type of the script. one of 'script' and 'module' + * @param {number} [providedOptions.ecmaVersion=5]- which ECMAScript version is considered + * @param {Object} [providedOptions.childVisitorKeys=null] - Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option. + * @param {string} [providedOptions.fallback='iteration'] - A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option. + * @returns {ScopeManager} ScopeManager + */ +function analyze(tree, providedOptions) { + const options = updateDeeply(defaultOptions(), providedOptions); + const scopeManager = new ScopeManager(options); + const referencer = new Referencer(options, scopeManager); + + referencer.visit(tree); + + assert(scopeManager.__currentScope === null, "currentScope should be null."); + + return scopeManager; +} + +module.exports = { + + /** @name module:escope.version */ + version, + + /** @name module:escope.Reference */ + Reference, + + /** @name module:escope.Variable */ + Variable, + + /** @name module:escope.Scope */ + Scope, + + /** @name module:escope.ScopeManager */ + ScopeManager, + analyze +}; + + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/pattern-visitor.js b/node_modules/eslint-scope/lib/pattern-visitor.js new file mode 100644 index 000000000..afa629173 --- /dev/null +++ b/node_modules/eslint-scope/lib/pattern-visitor.js @@ -0,0 +1,152 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +"use strict"; + +/* eslint-disable no-undefined */ + +const Syntax = require("estraverse").Syntax; +const esrecurse = require("esrecurse"); + +/** + * Get last array element + * @param {array} xs - array + * @returns {any} Last elment + */ +function getLast(xs) { + return xs[xs.length - 1] || null; +} + +class PatternVisitor extends esrecurse.Visitor { + static isPattern(node) { + const nodeType = node.type; + + return ( + nodeType === Syntax.Identifier || + nodeType === Syntax.ObjectPattern || + nodeType === Syntax.ArrayPattern || + nodeType === Syntax.SpreadElement || + nodeType === Syntax.RestElement || + nodeType === Syntax.AssignmentPattern + ); + } + + constructor(options, rootPattern, callback) { + super(null, options); + this.rootPattern = rootPattern; + this.callback = callback; + this.assignments = []; + this.rightHandNodes = []; + this.restElements = []; + } + + Identifier(pattern) { + const lastRestElement = getLast(this.restElements); + + this.callback(pattern, { + topLevel: pattern === this.rootPattern, + rest: lastRestElement !== null && lastRestElement !== undefined && lastRestElement.argument === pattern, + assignments: this.assignments + }); + } + + Property(property) { + + // Computed property's key is a right hand node. + if (property.computed) { + this.rightHandNodes.push(property.key); + } + + // If it's shorthand, its key is same as its value. + // If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern). + // If it's not shorthand, the name of new variable is its value's. + this.visit(property.value); + } + + ArrayPattern(pattern) { + for (let i = 0, iz = pattern.elements.length; i < iz; ++i) { + const element = pattern.elements[i]; + + this.visit(element); + } + } + + AssignmentPattern(pattern) { + this.assignments.push(pattern); + this.visit(pattern.left); + this.rightHandNodes.push(pattern.right); + this.assignments.pop(); + } + + RestElement(pattern) { + this.restElements.push(pattern); + this.visit(pattern.argument); + this.restElements.pop(); + } + + MemberExpression(node) { + + // Computed property's key is a right hand node. + if (node.computed) { + this.rightHandNodes.push(node.property); + } + + // the object is only read, write to its property. + this.rightHandNodes.push(node.object); + } + + // + // ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression. + // By spec, LeftHandSideExpression is Pattern or MemberExpression. + // (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758) + // But espree 2.0 parses to ArrayExpression, ObjectExpression, etc... + // + + SpreadElement(node) { + this.visit(node.argument); + } + + ArrayExpression(node) { + node.elements.forEach(this.visit, this); + } + + AssignmentExpression(node) { + this.assignments.push(node); + this.visit(node.left); + this.rightHandNodes.push(node.right); + this.assignments.pop(); + } + + CallExpression(node) { + + // arguments are right hand nodes. + node.arguments.forEach(a => { + this.rightHandNodes.push(a); + }); + this.visit(node.callee); + } +} + +module.exports = PatternVisitor; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/reference.js b/node_modules/eslint-scope/lib/reference.js new file mode 100644 index 000000000..9529827fe --- /dev/null +++ b/node_modules/eslint-scope/lib/reference.js @@ -0,0 +1,167 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +"use strict"; + +const READ = 0x1; +const WRITE = 0x2; +const RW = READ | WRITE; + +/** + * A Reference represents a single occurrence of an identifier in code. + * @class Reference + */ +class Reference { + constructor(ident, scope, flag, writeExpr, maybeImplicitGlobal, partial, init) { + + /** + * Identifier syntax node. + * @member {espreeIdentifier} Reference#identifier + */ + this.identifier = ident; + + /** + * Reference to the enclosing Scope. + * @member {Scope} Reference#from + */ + this.from = scope; + + /** + * Whether the reference comes from a dynamic scope (such as 'eval', + * 'with', etc.), and may be trapped by dynamic scopes. + * @member {boolean} Reference#tainted + */ + this.tainted = false; + + /** + * The variable this reference is resolved with. + * @member {Variable} Reference#resolved + */ + this.resolved = null; + + /** + * The read-write mode of the reference. (Value is one of {@link + * Reference.READ}, {@link Reference.RW}, {@link Reference.WRITE}). + * @member {number} Reference#flag + * @private + */ + this.flag = flag; + if (this.isWrite()) { + + /** + * If reference is writeable, this is the tree being written to it. + * @member {espreeNode} Reference#writeExpr + */ + this.writeExpr = writeExpr; + + /** + * Whether the Reference might refer to a partial value of writeExpr. + * @member {boolean} Reference#partial + */ + this.partial = partial; + + /** + * Whether the Reference is to write of initialization. + * @member {boolean} Reference#init + */ + this.init = init; + } + this.__maybeImplicitGlobal = maybeImplicitGlobal; + } + + /** + * Whether the reference is static. + * @method Reference#isStatic + * @returns {boolean} static + */ + isStatic() { + return !this.tainted && this.resolved && this.resolved.scope.isStatic(); + } + + /** + * Whether the reference is writeable. + * @method Reference#isWrite + * @returns {boolean} write + */ + isWrite() { + return !!(this.flag & Reference.WRITE); + } + + /** + * Whether the reference is readable. + * @method Reference#isRead + * @returns {boolean} read + */ + isRead() { + return !!(this.flag & Reference.READ); + } + + /** + * Whether the reference is read-only. + * @method Reference#isReadOnly + * @returns {boolean} read only + */ + isReadOnly() { + return this.flag === Reference.READ; + } + + /** + * Whether the reference is write-only. + * @method Reference#isWriteOnly + * @returns {boolean} write only + */ + isWriteOnly() { + return this.flag === Reference.WRITE; + } + + /** + * Whether the reference is read-write. + * @method Reference#isReadWrite + * @returns {boolean} read write + */ + isReadWrite() { + return this.flag === Reference.RW; + } +} + +/** + * @constant Reference.READ + * @private + */ +Reference.READ = READ; + +/** + * @constant Reference.WRITE + * @private + */ +Reference.WRITE = WRITE; + +/** + * @constant Reference.RW + * @private + */ +Reference.RW = RW; + +module.exports = Reference; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/referencer.js b/node_modules/eslint-scope/lib/referencer.js new file mode 100644 index 000000000..63d1935b3 --- /dev/null +++ b/node_modules/eslint-scope/lib/referencer.js @@ -0,0 +1,629 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +"use strict"; + +/* eslint-disable no-underscore-dangle */ +/* eslint-disable no-undefined */ + +const Syntax = require("estraverse").Syntax; +const esrecurse = require("esrecurse"); +const Reference = require("./reference"); +const Variable = require("./variable"); +const PatternVisitor = require("./pattern-visitor"); +const definition = require("./definition"); +const assert = require("assert"); + +const ParameterDefinition = definition.ParameterDefinition; +const Definition = definition.Definition; + +/** + * Traverse identifier in pattern + * @param {Object} options - options + * @param {pattern} rootPattern - root pattern + * @param {Refencer} referencer - referencer + * @param {callback} callback - callback + * @returns {void} + */ +function traverseIdentifierInPattern(options, rootPattern, referencer, callback) { + + // Call the callback at left hand identifier nodes, and Collect right hand nodes. + const visitor = new PatternVisitor(options, rootPattern, callback); + + visitor.visit(rootPattern); + + // Process the right hand nodes recursively. + if (referencer !== null && referencer !== undefined) { + visitor.rightHandNodes.forEach(referencer.visit, referencer); + } +} + +// Importing ImportDeclaration. +// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-moduledeclarationinstantiation +// https://github.com/estree/estree/blob/master/es6.md#importdeclaration +// FIXME: Now, we don't create module environment, because the context is +// implementation dependent. + +class Importer extends esrecurse.Visitor { + constructor(declaration, referencer) { + super(null, referencer.options); + this.declaration = declaration; + this.referencer = referencer; + } + + visitImport(id, specifier) { + this.referencer.visitPattern(id, pattern => { + this.referencer.currentScope().__define(pattern, + new Definition( + Variable.ImportBinding, + pattern, + specifier, + this.declaration, + null, + null + )); + }); + } + + ImportNamespaceSpecifier(node) { + const local = (node.local || node.id); + + if (local) { + this.visitImport(local, node); + } + } + + ImportDefaultSpecifier(node) { + const local = (node.local || node.id); + + this.visitImport(local, node); + } + + ImportSpecifier(node) { + const local = (node.local || node.id); + + if (node.name) { + this.visitImport(node.name, node); + } else { + this.visitImport(local, node); + } + } +} + +// Referencing variables and creating bindings. +class Referencer extends esrecurse.Visitor { + constructor(options, scopeManager) { + super(null, options); + this.options = options; + this.scopeManager = scopeManager; + this.parent = null; + this.isInnerMethodDefinition = false; + } + + currentScope() { + return this.scopeManager.__currentScope; + } + + close(node) { + while (this.currentScope() && node === this.currentScope().block) { + this.scopeManager.__currentScope = this.currentScope().__close(this.scopeManager); + } + } + + pushInnerMethodDefinition(isInnerMethodDefinition) { + const previous = this.isInnerMethodDefinition; + + this.isInnerMethodDefinition = isInnerMethodDefinition; + return previous; + } + + popInnerMethodDefinition(isInnerMethodDefinition) { + this.isInnerMethodDefinition = isInnerMethodDefinition; + } + + referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) { + const scope = this.currentScope(); + + assignments.forEach(assignment => { + scope.__referencing( + pattern, + Reference.WRITE, + assignment.right, + maybeImplicitGlobal, + pattern !== assignment.left, + init + ); + }); + } + + visitPattern(node, options, callback) { + let visitPatternOptions = options; + let visitPatternCallback = callback; + + if (typeof options === "function") { + visitPatternCallback = options; + visitPatternOptions = { processRightHandNodes: false }; + } + + traverseIdentifierInPattern( + this.options, + node, + visitPatternOptions.processRightHandNodes ? this : null, + visitPatternCallback + ); + } + + visitFunction(node) { + let i, iz; + + // FunctionDeclaration name is defined in upper scope + // NOTE: Not referring variableScope. It is intended. + // Since + // in ES5, FunctionDeclaration should be in FunctionBody. + // in ES6, FunctionDeclaration should be block scoped. + + if (node.type === Syntax.FunctionDeclaration) { + + // id is defined in upper scope + this.currentScope().__define(node.id, + new Definition( + Variable.FunctionName, + node.id, + node, + null, + null, + null + )); + } + + // FunctionExpression with name creates its special scope; + // FunctionExpressionNameScope. + if (node.type === Syntax.FunctionExpression && node.id) { + this.scopeManager.__nestFunctionExpressionNameScope(node); + } + + // Consider this function is in the MethodDefinition. + this.scopeManager.__nestFunctionScope(node, this.isInnerMethodDefinition); + + const that = this; + + /** + * Visit pattern callback + * @param {pattern} pattern - pattern + * @param {Object} info - info + * @returns {void} + */ + function visitPatternCallback(pattern, info) { + that.currentScope().__define(pattern, + new ParameterDefinition( + pattern, + node, + i, + info.rest + )); + + that.referencingDefaultValue(pattern, info.assignments, null, true); + } + + // Process parameter declarations. + for (i = 0, iz = node.params.length; i < iz; ++i) { + this.visitPattern(node.params[i], { processRightHandNodes: true }, visitPatternCallback); + } + + // if there's a rest argument, add that + if (node.rest) { + this.visitPattern({ + type: "RestElement", + argument: node.rest + }, pattern => { + this.currentScope().__define(pattern, + new ParameterDefinition( + pattern, + node, + node.params.length, + true + )); + }); + } + + // In TypeScript there are a number of function-like constructs which have no body, + // so check it exists before traversing + if (node.body) { + + // Skip BlockStatement to prevent creating BlockStatement scope. + if (node.body.type === Syntax.BlockStatement) { + this.visitChildren(node.body); + } else { + this.visit(node.body); + } + } + + this.close(node); + } + + visitClass(node) { + if (node.type === Syntax.ClassDeclaration) { + this.currentScope().__define(node.id, + new Definition( + Variable.ClassName, + node.id, + node, + null, + null, + null + )); + } + + this.visit(node.superClass); + + this.scopeManager.__nestClassScope(node); + + if (node.id) { + this.currentScope().__define(node.id, + new Definition( + Variable.ClassName, + node.id, + node + )); + } + this.visit(node.body); + + this.close(node); + } + + visitProperty(node) { + let previous; + + if (node.computed) { + this.visit(node.key); + } + + const isMethodDefinition = node.type === Syntax.MethodDefinition; + + if (isMethodDefinition) { + previous = this.pushInnerMethodDefinition(true); + } + this.visit(node.value); + if (isMethodDefinition) { + this.popInnerMethodDefinition(previous); + } + } + + visitForIn(node) { + if (node.left.type === Syntax.VariableDeclaration && node.left.kind !== "var") { + this.scopeManager.__nestForScope(node); + } + + if (node.left.type === Syntax.VariableDeclaration) { + this.visit(node.left); + this.visitPattern(node.left.declarations[0].id, pattern => { + this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true, true); + }); + } else { + this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => { + let maybeImplicitGlobal = null; + + if (!this.currentScope().isStrict) { + maybeImplicitGlobal = { + pattern, + node + }; + } + this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); + this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, true, false); + }); + } + this.visit(node.right); + this.visit(node.body); + + this.close(node); + } + + visitVariableDeclaration(variableTargetScope, type, node, index) { + + const decl = node.declarations[index]; + const init = decl.init; + + this.visitPattern(decl.id, { processRightHandNodes: true }, (pattern, info) => { + variableTargetScope.__define( + pattern, + new Definition( + type, + pattern, + decl, + node, + index, + node.kind + ) + ); + + this.referencingDefaultValue(pattern, info.assignments, null, true); + if (init) { + this.currentScope().__referencing(pattern, Reference.WRITE, init, null, !info.topLevel, true); + } + }); + } + + AssignmentExpression(node) { + if (PatternVisitor.isPattern(node.left)) { + if (node.operator === "=") { + this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => { + let maybeImplicitGlobal = null; + + if (!this.currentScope().isStrict) { + maybeImplicitGlobal = { + pattern, + node + }; + } + this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); + this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, !info.topLevel, false); + }); + } else { + this.currentScope().__referencing(node.left, Reference.RW, node.right); + } + } else { + this.visit(node.left); + } + this.visit(node.right); + } + + CatchClause(node) { + this.scopeManager.__nestCatchScope(node); + + this.visitPattern(node.param, { processRightHandNodes: true }, (pattern, info) => { + this.currentScope().__define(pattern, + new Definition( + Variable.CatchClause, + node.param, + node, + null, + null, + null + )); + this.referencingDefaultValue(pattern, info.assignments, null, true); + }); + this.visit(node.body); + + this.close(node); + } + + Program(node) { + this.scopeManager.__nestGlobalScope(node); + + if (this.scopeManager.__isNodejsScope()) { + + // Force strictness of GlobalScope to false when using node.js scope. + this.currentScope().isStrict = false; + this.scopeManager.__nestFunctionScope(node, false); + } + + if (this.scopeManager.__isES6() && this.scopeManager.isModule()) { + this.scopeManager.__nestModuleScope(node); + } + + if (this.scopeManager.isStrictModeSupported() && this.scopeManager.isImpliedStrict()) { + this.currentScope().isStrict = true; + } + + this.visitChildren(node); + this.close(node); + } + + Identifier(node) { + this.currentScope().__referencing(node); + } + + UpdateExpression(node) { + if (PatternVisitor.isPattern(node.argument)) { + this.currentScope().__referencing(node.argument, Reference.RW, null); + } else { + this.visitChildren(node); + } + } + + MemberExpression(node) { + this.visit(node.object); + if (node.computed) { + this.visit(node.property); + } + } + + Property(node) { + this.visitProperty(node); + } + + MethodDefinition(node) { + this.visitProperty(node); + } + + BreakStatement() {} // eslint-disable-line class-methods-use-this + + ContinueStatement() {} // eslint-disable-line class-methods-use-this + + LabeledStatement(node) { + this.visit(node.body); + } + + ForStatement(node) { + + // Create ForStatement declaration. + // NOTE: In ES6, ForStatement dynamically generates + // per iteration environment. However, escope is + // a static analyzer, we only generate one scope for ForStatement. + if (node.init && node.init.type === Syntax.VariableDeclaration && node.init.kind !== "var") { + this.scopeManager.__nestForScope(node); + } + + this.visitChildren(node); + + this.close(node); + } + + ClassExpression(node) { + this.visitClass(node); + } + + ClassDeclaration(node) { + this.visitClass(node); + } + + CallExpression(node) { + + // Check this is direct call to eval + if (!this.scopeManager.__ignoreEval() && node.callee.type === Syntax.Identifier && node.callee.name === "eval") { + + // NOTE: This should be `variableScope`. Since direct eval call always creates Lexical environment and + // let / const should be enclosed into it. Only VariableDeclaration affects on the caller's environment. + this.currentScope().variableScope.__detectEval(); + } + this.visitChildren(node); + } + + BlockStatement(node) { + if (this.scopeManager.__isES6()) { + this.scopeManager.__nestBlockScope(node); + } + + this.visitChildren(node); + + this.close(node); + } + + ThisExpression() { + this.currentScope().variableScope.__detectThis(); + } + + WithStatement(node) { + this.visit(node.object); + + // Then nest scope for WithStatement. + this.scopeManager.__nestWithScope(node); + + this.visit(node.body); + + this.close(node); + } + + VariableDeclaration(node) { + const variableTargetScope = (node.kind === "var") ? this.currentScope().variableScope : this.currentScope(); + + for (let i = 0, iz = node.declarations.length; i < iz; ++i) { + const decl = node.declarations[i]; + + this.visitVariableDeclaration(variableTargetScope, Variable.Variable, node, i); + if (decl.init) { + this.visit(decl.init); + } + } + } + + // sec 13.11.8 + SwitchStatement(node) { + this.visit(node.discriminant); + + if (this.scopeManager.__isES6()) { + this.scopeManager.__nestSwitchScope(node); + } + + for (let i = 0, iz = node.cases.length; i < iz; ++i) { + this.visit(node.cases[i]); + } + + this.close(node); + } + + FunctionDeclaration(node) { + this.visitFunction(node); + } + + FunctionExpression(node) { + this.visitFunction(node); + } + + ForOfStatement(node) { + this.visitForIn(node); + } + + ForInStatement(node) { + this.visitForIn(node); + } + + ArrowFunctionExpression(node) { + this.visitFunction(node); + } + + ImportDeclaration(node) { + assert(this.scopeManager.__isES6() && this.scopeManager.isModule(), "ImportDeclaration should appear when the mode is ES6 and in the module context."); + + const importer = new Importer(node, this); + + importer.visit(node); + } + + visitExportDeclaration(node) { + if (node.source) { + return; + } + if (node.declaration) { + this.visit(node.declaration); + return; + } + + this.visitChildren(node); + } + + // TODO: ExportDeclaration doesn't exist. for bc? + ExportDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportAllDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportDefaultDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportNamedDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportSpecifier(node) { + + // TODO: `node.id` doesn't exist. for bc? + const local = (node.id || node.local); + + this.visit(local); + } + + MetaProperty() { // eslint-disable-line class-methods-use-this + + // do nothing. + } +} + +module.exports = Referencer; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/scope-manager.js b/node_modules/eslint-scope/lib/scope-manager.js new file mode 100644 index 000000000..c1927994b --- /dev/null +++ b/node_modules/eslint-scope/lib/scope-manager.js @@ -0,0 +1,247 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +"use strict"; + +/* eslint-disable no-underscore-dangle */ + +const Scope = require("./scope"); +const assert = require("assert"); + +const GlobalScope = Scope.GlobalScope; +const CatchScope = Scope.CatchScope; +const WithScope = Scope.WithScope; +const ModuleScope = Scope.ModuleScope; +const ClassScope = Scope.ClassScope; +const SwitchScope = Scope.SwitchScope; +const FunctionScope = Scope.FunctionScope; +const ForScope = Scope.ForScope; +const FunctionExpressionNameScope = Scope.FunctionExpressionNameScope; +const BlockScope = Scope.BlockScope; + +/** + * @class ScopeManager + */ +class ScopeManager { + constructor(options) { + this.scopes = []; + this.globalScope = null; + this.__nodeToScope = new WeakMap(); + this.__currentScope = null; + this.__options = options; + this.__declaredVariables = new WeakMap(); + } + + __useDirective() { + return this.__options.directive; + } + + __isOptimistic() { + return this.__options.optimistic; + } + + __ignoreEval() { + return this.__options.ignoreEval; + } + + __isNodejsScope() { + return this.__options.nodejsScope; + } + + isModule() { + return this.__options.sourceType === "module"; + } + + isImpliedStrict() { + return this.__options.impliedStrict; + } + + isStrictModeSupported() { + return this.__options.ecmaVersion >= 5; + } + + // Returns appropriate scope for this node. + __get(node) { + return this.__nodeToScope.get(node); + } + + /** + * Get variables that are declared by the node. + * + * "are declared by the node" means the node is same as `Variable.defs[].node` or `Variable.defs[].parent`. + * If the node declares nothing, this method returns an empty array. + * CAUTION: This API is experimental. See https://github.com/estools/escope/pull/69 for more details. + * + * @param {Espree.Node} node - a node to get. + * @returns {Variable[]} variables that declared by the node. + */ + getDeclaredVariables(node) { + return this.__declaredVariables.get(node) || []; + } + + /** + * acquire scope from node. + * @method ScopeManager#acquire + * @param {Espree.Node} node - node for the acquired scope. + * @param {boolean=} inner - look up the most inner scope, default value is false. + * @returns {Scope?} Scope from node + */ + acquire(node, inner) { + + /** + * predicate + * @param {Scope} testScope - scope to test + * @returns {boolean} predicate + */ + function predicate(testScope) { + if (testScope.type === "function" && testScope.functionExpressionScope) { + return false; + } + return true; + } + + const scopes = this.__get(node); + + if (!scopes || scopes.length === 0) { + return null; + } + + // Heuristic selection from all scopes. + // If you would like to get all scopes, please use ScopeManager#acquireAll. + if (scopes.length === 1) { + return scopes[0]; + } + + if (inner) { + for (let i = scopes.length - 1; i >= 0; --i) { + const scope = scopes[i]; + + if (predicate(scope)) { + return scope; + } + } + } else { + for (let i = 0, iz = scopes.length; i < iz; ++i) { + const scope = scopes[i]; + + if (predicate(scope)) { + return scope; + } + } + } + + return null; + } + + /** + * acquire all scopes from node. + * @method ScopeManager#acquireAll + * @param {Espree.Node} node - node for the acquired scope. + * @returns {Scopes?} Scope array + */ + acquireAll(node) { + return this.__get(node); + } + + /** + * release the node. + * @method ScopeManager#release + * @param {Espree.Node} node - releasing node. + * @param {boolean=} inner - look up the most inner scope, default value is false. + * @returns {Scope?} upper scope for the node. + */ + release(node, inner) { + const scopes = this.__get(node); + + if (scopes && scopes.length) { + const scope = scopes[0].upper; + + if (!scope) { + return null; + } + return this.acquire(scope.block, inner); + } + return null; + } + + attach() { } // eslint-disable-line class-methods-use-this + + detach() { } // eslint-disable-line class-methods-use-this + + __nestScope(scope) { + if (scope instanceof GlobalScope) { + assert(this.__currentScope === null); + this.globalScope = scope; + } + this.__currentScope = scope; + return scope; + } + + __nestGlobalScope(node) { + return this.__nestScope(new GlobalScope(this, node)); + } + + __nestBlockScope(node) { + return this.__nestScope(new BlockScope(this, this.__currentScope, node)); + } + + __nestFunctionScope(node, isMethodDefinition) { + return this.__nestScope(new FunctionScope(this, this.__currentScope, node, isMethodDefinition)); + } + + __nestForScope(node) { + return this.__nestScope(new ForScope(this, this.__currentScope, node)); + } + + __nestCatchScope(node) { + return this.__nestScope(new CatchScope(this, this.__currentScope, node)); + } + + __nestWithScope(node) { + return this.__nestScope(new WithScope(this, this.__currentScope, node)); + } + + __nestClassScope(node) { + return this.__nestScope(new ClassScope(this, this.__currentScope, node)); + } + + __nestSwitchScope(node) { + return this.__nestScope(new SwitchScope(this, this.__currentScope, node)); + } + + __nestModuleScope(node) { + return this.__nestScope(new ModuleScope(this, this.__currentScope, node)); + } + + __nestFunctionExpressionNameScope(node) { + return this.__nestScope(new FunctionExpressionNameScope(this, this.__currentScope, node)); + } + + __isES6() { + return this.__options.ecmaVersion >= 6; + } +} + +module.exports = ScopeManager; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/scope.js b/node_modules/eslint-scope/lib/scope.js new file mode 100644 index 000000000..bdb5f637f --- /dev/null +++ b/node_modules/eslint-scope/lib/scope.js @@ -0,0 +1,748 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +"use strict"; + +/* eslint-disable no-underscore-dangle */ +/* eslint-disable no-undefined */ + +const Syntax = require("estraverse").Syntax; + +const Reference = require("./reference"); +const Variable = require("./variable"); +const Definition = require("./definition").Definition; +const assert = require("assert"); + +/** + * Test if scope is struct + * @param {Scope} scope - scope + * @param {Block} block - block + * @param {boolean} isMethodDefinition - is method definition + * @param {boolean} useDirective - use directive + * @returns {boolean} is strict scope + */ +function isStrictScope(scope, block, isMethodDefinition, useDirective) { + let body; + + // When upper scope is exists and strict, inner scope is also strict. + if (scope.upper && scope.upper.isStrict) { + return true; + } + + if (isMethodDefinition) { + return true; + } + + if (scope.type === "class" || scope.type === "module") { + return true; + } + + if (scope.type === "block" || scope.type === "switch") { + return false; + } + + if (scope.type === "function") { + if (block.type === Syntax.ArrowFunctionExpression && block.body.type !== Syntax.BlockStatement) { + return false; + } + + if (block.type === Syntax.Program) { + body = block; + } else { + body = block.body; + } + + if (!body) { + return false; + } + } else if (scope.type === "global") { + body = block; + } else { + return false; + } + + // Search 'use strict' directive. + if (useDirective) { + for (let i = 0, iz = body.body.length; i < iz; ++i) { + const stmt = body.body[i]; + + if (stmt.type !== Syntax.DirectiveStatement) { + break; + } + if (stmt.raw === "\"use strict\"" || stmt.raw === "'use strict'") { + return true; + } + } + } else { + for (let i = 0, iz = body.body.length; i < iz; ++i) { + const stmt = body.body[i]; + + if (stmt.type !== Syntax.ExpressionStatement) { + break; + } + const expr = stmt.expression; + + if (expr.type !== Syntax.Literal || typeof expr.value !== "string") { + break; + } + if (expr.raw !== null && expr.raw !== undefined) { + if (expr.raw === "\"use strict\"" || expr.raw === "'use strict'") { + return true; + } + } else { + if (expr.value === "use strict") { + return true; + } + } + } + } + return false; +} + +/** + * Register scope + * @param {ScopeManager} scopeManager - scope manager + * @param {Scope} scope - scope + * @returns {void} + */ +function registerScope(scopeManager, scope) { + scopeManager.scopes.push(scope); + + const scopes = scopeManager.__nodeToScope.get(scope.block); + + if (scopes) { + scopes.push(scope); + } else { + scopeManager.__nodeToScope.set(scope.block, [scope]); + } +} + +/** + * Should be statically + * @param {Object} def - def + * @returns {boolean} should be statically + */ +function shouldBeStatically(def) { + return ( + (def.type === Variable.ClassName) || + (def.type === Variable.Variable && def.parent.kind !== "var") + ); +} + +/** + * @class Scope + */ +class Scope { + constructor(scopeManager, type, upperScope, block, isMethodDefinition) { + + /** + * One of 'module', 'block', 'switch', 'function', 'catch', 'with', 'function', 'class', 'global'. + * @member {String} Scope#type + */ + this.type = type; + + /** + * The scoped {@link Variable}s of this scope, as { Variable.name + * : Variable }. + * @member {Map} Scope#set + */ + this.set = new Map(); + + /** + * The tainted variables of this scope, as { Variable.name : + * boolean }. + * @member {Map} Scope#taints */ + this.taints = new Map(); + + /** + * Generally, through the lexical scoping of JS you can always know + * which variable an identifier in the source code refers to. There are + * a few exceptions to this rule. With 'global' and 'with' scopes you + * can only decide at runtime which variable a reference refers to. + * Moreover, if 'eval()' is used in a scope, it might introduce new + * bindings in this or its parent scopes. + * All those scopes are considered 'dynamic'. + * @member {boolean} Scope#dynamic + */ + this.dynamic = this.type === "global" || this.type === "with"; + + /** + * A reference to the scope-defining syntax node. + * @member {espree.Node} Scope#block + */ + this.block = block; + + /** + * The {@link Reference|references} that are not resolved with this scope. + * @member {Reference[]} Scope#through + */ + this.through = []; + + /** + * The scoped {@link Variable}s of this scope. In the case of a + * 'function' scope this includes the automatic argument arguments as + * its first element, as well as all further formal arguments. + * @member {Variable[]} Scope#variables + */ + this.variables = []; + + /** + * Any variable {@link Reference|reference} found in this scope. This + * includes occurrences of local variables as well as variables from + * parent scopes (including the global scope). For local variables + * this also includes defining occurrences (like in a 'var' statement). + * In a 'function' scope this does not include the occurrences of the + * formal parameter in the parameter list. + * @member {Reference[]} Scope#references + */ + this.references = []; + + /** + * For 'global' and 'function' scopes, this is a self-reference. For + * other scope types this is the variableScope value of the + * parent scope. + * @member {Scope} Scope#variableScope + */ + this.variableScope = + (this.type === "global" || this.type === "function" || this.type === "module") ? this : upperScope.variableScope; + + /** + * Whether this scope is created by a FunctionExpression. + * @member {boolean} Scope#functionExpressionScope + */ + this.functionExpressionScope = false; + + /** + * Whether this is a scope that contains an 'eval()' invocation. + * @member {boolean} Scope#directCallToEvalScope + */ + this.directCallToEvalScope = false; + + /** + * @member {boolean} Scope#thisFound + */ + this.thisFound = false; + + this.__left = []; + + /** + * Reference to the parent {@link Scope|scope}. + * @member {Scope} Scope#upper + */ + this.upper = upperScope; + + /** + * Whether 'use strict' is in effect in this scope. + * @member {boolean} Scope#isStrict + */ + this.isStrict = isStrictScope(this, block, isMethodDefinition, scopeManager.__useDirective()); + + /** + * List of nested {@link Scope}s. + * @member {Scope[]} Scope#childScopes + */ + this.childScopes = []; + if (this.upper) { + this.upper.childScopes.push(this); + } + + this.__declaredVariables = scopeManager.__declaredVariables; + + registerScope(scopeManager, this); + } + + __shouldStaticallyClose(scopeManager) { + return (!this.dynamic || scopeManager.__isOptimistic()); + } + + __shouldStaticallyCloseForGlobal(ref) { + + // On global scope, let/const/class declarations should be resolved statically. + const name = ref.identifier.name; + + if (!this.set.has(name)) { + return false; + } + + const variable = this.set.get(name); + const defs = variable.defs; + + return defs.length > 0 && defs.every(shouldBeStatically); + } + + __staticCloseRef(ref) { + if (!this.__resolve(ref)) { + this.__delegateToUpperScope(ref); + } + } + + __dynamicCloseRef(ref) { + + // notify all names are through to global + let current = this; + + do { + current.through.push(ref); + current = current.upper; + } while (current); + } + + __globalCloseRef(ref) { + + // let/const/class declarations should be resolved statically. + // others should be resolved dynamically. + if (this.__shouldStaticallyCloseForGlobal(ref)) { + this.__staticCloseRef(ref); + } else { + this.__dynamicCloseRef(ref); + } + } + + __close(scopeManager) { + let closeRef; + + if (this.__shouldStaticallyClose(scopeManager)) { + closeRef = this.__staticCloseRef; + } else if (this.type !== "global") { + closeRef = this.__dynamicCloseRef; + } else { + closeRef = this.__globalCloseRef; + } + + // Try Resolving all references in this scope. + for (let i = 0, iz = this.__left.length; i < iz; ++i) { + const ref = this.__left[i]; + + closeRef.call(this, ref); + } + this.__left = null; + + return this.upper; + } + + // To override by function scopes. + // References in default parameters isn't resolved to variables which are in their function body. + __isValidResolution(ref, variable) { // eslint-disable-line class-methods-use-this, no-unused-vars + return true; + } + + __resolve(ref) { + const name = ref.identifier.name; + + if (!this.set.has(name)) { + return false; + } + const variable = this.set.get(name); + + if (!this.__isValidResolution(ref, variable)) { + return false; + } + variable.references.push(ref); + variable.stack = variable.stack && ref.from.variableScope === this.variableScope; + if (ref.tainted) { + variable.tainted = true; + this.taints.set(variable.name, true); + } + ref.resolved = variable; + + return true; + } + + __delegateToUpperScope(ref) { + if (this.upper) { + this.upper.__left.push(ref); + } + this.through.push(ref); + } + + __addDeclaredVariablesOfNode(variable, node) { + if (node === null || node === undefined) { + return; + } + + let variables = this.__declaredVariables.get(node); + + if (variables === null || variables === undefined) { + variables = []; + this.__declaredVariables.set(node, variables); + } + if (variables.indexOf(variable) === -1) { + variables.push(variable); + } + } + + __defineGeneric(name, set, variables, node, def) { + let variable; + + variable = set.get(name); + if (!variable) { + variable = new Variable(name, this); + set.set(name, variable); + variables.push(variable); + } + + if (def) { + variable.defs.push(def); + this.__addDeclaredVariablesOfNode(variable, def.node); + this.__addDeclaredVariablesOfNode(variable, def.parent); + } + if (node) { + variable.identifiers.push(node); + } + } + + __define(node, def) { + if (node && node.type === Syntax.Identifier) { + this.__defineGeneric( + node.name, + this.set, + this.variables, + node, + def + ); + } + } + + __referencing(node, assign, writeExpr, maybeImplicitGlobal, partial, init) { + + // because Array element may be null + if (!node || node.type !== Syntax.Identifier) { + return; + } + + // Specially handle like `this`. + if (node.name === "super") { + return; + } + + const ref = new Reference(node, this, assign || Reference.READ, writeExpr, maybeImplicitGlobal, !!partial, !!init); + + this.references.push(ref); + this.__left.push(ref); + } + + __detectEval() { + let current = this; + + this.directCallToEvalScope = true; + do { + current.dynamic = true; + current = current.upper; + } while (current); + } + + __detectThis() { + this.thisFound = true; + } + + __isClosed() { + return this.__left === null; + } + + /** + * returns resolved {Reference} + * @method Scope#resolve + * @param {Espree.Identifier} ident - identifier to be resolved. + * @returns {Reference} reference + */ + resolve(ident) { + let ref, i, iz; + + assert(this.__isClosed(), "Scope should be closed."); + assert(ident.type === Syntax.Identifier, "Target should be identifier."); + for (i = 0, iz = this.references.length; i < iz; ++i) { + ref = this.references[i]; + if (ref.identifier === ident) { + return ref; + } + } + return null; + } + + /** + * returns this scope is static + * @method Scope#isStatic + * @returns {boolean} static + */ + isStatic() { + return !this.dynamic; + } + + /** + * returns this scope has materialized arguments + * @method Scope#isArgumentsMaterialized + * @returns {boolean} arguemnts materialized + */ + isArgumentsMaterialized() { // eslint-disable-line class-methods-use-this + return true; + } + + /** + * returns this scope has materialized `this` reference + * @method Scope#isThisMaterialized + * @returns {boolean} this materialized + */ + isThisMaterialized() { // eslint-disable-line class-methods-use-this + return true; + } + + isUsedName(name) { + if (this.set.has(name)) { + return true; + } + for (let i = 0, iz = this.through.length; i < iz; ++i) { + if (this.through[i].identifier.name === name) { + return true; + } + } + return false; + } +} + +class GlobalScope extends Scope { + constructor(scopeManager, block) { + super(scopeManager, "global", null, block, false); + this.implicit = { + set: new Map(), + variables: [], + + /** + * List of {@link Reference}s that are left to be resolved (i.e. which + * need to be linked to the variable they refer to). + * @member {Reference[]} Scope#implicit#left + */ + left: [] + }; + } + + __close(scopeManager) { + const implicit = []; + + for (let i = 0, iz = this.__left.length; i < iz; ++i) { + const ref = this.__left[i]; + + if (ref.__maybeImplicitGlobal && !this.set.has(ref.identifier.name)) { + implicit.push(ref.__maybeImplicitGlobal); + } + } + + // create an implicit global variable from assignment expression + for (let i = 0, iz = implicit.length; i < iz; ++i) { + const info = implicit[i]; + + this.__defineImplicit(info.pattern, + new Definition( + Variable.ImplicitGlobalVariable, + info.pattern, + info.node, + null, + null, + null + )); + + } + + this.implicit.left = this.__left; + + return super.__close(scopeManager); + } + + __defineImplicit(node, def) { + if (node && node.type === Syntax.Identifier) { + this.__defineGeneric( + node.name, + this.implicit.set, + this.implicit.variables, + node, + def + ); + } + } +} + +class ModuleScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "module", upperScope, block, false); + } +} + +class FunctionExpressionNameScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "function-expression-name", upperScope, block, false); + this.__define(block.id, + new Definition( + Variable.FunctionName, + block.id, + block, + null, + null, + null + )); + this.functionExpressionScope = true; + } +} + +class CatchScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "catch", upperScope, block, false); + } +} + +class WithScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "with", upperScope, block, false); + } + + __close(scopeManager) { + if (this.__shouldStaticallyClose(scopeManager)) { + return super.__close(scopeManager); + } + + for (let i = 0, iz = this.__left.length; i < iz; ++i) { + const ref = this.__left[i]; + + ref.tainted = true; + this.__delegateToUpperScope(ref); + } + this.__left = null; + + return this.upper; + } +} + +class BlockScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "block", upperScope, block, false); + } +} + +class SwitchScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "switch", upperScope, block, false); + } +} + +class FunctionScope extends Scope { + constructor(scopeManager, upperScope, block, isMethodDefinition) { + super(scopeManager, "function", upperScope, block, isMethodDefinition); + + // section 9.2.13, FunctionDeclarationInstantiation. + // NOTE Arrow functions never have an arguments objects. + if (this.block.type !== Syntax.ArrowFunctionExpression) { + this.__defineArguments(); + } + } + + isArgumentsMaterialized() { + + // TODO(Constellation) + // We can more aggressive on this condition like this. + // + // function t() { + // // arguments of t is always hidden. + // function arguments() { + // } + // } + if (this.block.type === Syntax.ArrowFunctionExpression) { + return false; + } + + if (!this.isStatic()) { + return true; + } + + const variable = this.set.get("arguments"); + + assert(variable, "Always have arguments variable."); + return variable.tainted || variable.references.length !== 0; + } + + isThisMaterialized() { + if (!this.isStatic()) { + return true; + } + return this.thisFound; + } + + __defineArguments() { + this.__defineGeneric( + "arguments", + this.set, + this.variables, + null, + null + ); + this.taints.set("arguments", true); + } + + // References in default parameters isn't resolved to variables which are in their function body. + // const x = 1 + // function f(a = x) { // This `x` is resolved to the `x` in the outer scope. + // const x = 2 + // console.log(a) + // } + __isValidResolution(ref, variable) { + + // If `options.nodejsScope` is true, `this.block` becomes a Program node. + if (this.block.type === "Program") { + return true; + } + + const bodyStart = this.block.body.range[0]; + + // It's invalid resolution in the following case: + return !( + variable.scope === this && + ref.identifier.range[0] < bodyStart && // the reference is in the parameter part. + variable.defs.every(d => d.name.range[0] >= bodyStart) // the variable is in the body. + ); + } +} + +class ForScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "for", upperScope, block, false); + } +} + +class ClassScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "class", upperScope, block, false); + } +} + +module.exports = { + Scope, + GlobalScope, + ModuleScope, + FunctionExpressionNameScope, + CatchScope, + WithScope, + BlockScope, + SwitchScope, + FunctionScope, + ForScope, + ClassScope +}; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/lib/variable.js b/node_modules/eslint-scope/lib/variable.js new file mode 100644 index 000000000..702c4780a --- /dev/null +++ b/node_modules/eslint-scope/lib/variable.js @@ -0,0 +1,88 @@ +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +"use strict"; + +/** + * A Variable represents a locally scoped identifier. These include arguments to + * functions. + * @class Variable + */ +class Variable { + constructor(name, scope) { + + /** + * The variable name, as given in the source code. + * @member {String} Variable#name + */ + this.name = name; + + /** + * List of defining occurrences of this variable (like in 'var ...' + * statements or as parameter), as AST nodes. + * @member {espree.Identifier[]} Variable#identifiers + */ + this.identifiers = []; + + /** + * List of {@link Reference|references} of this variable (excluding parameter entries) + * in its defining scope and all nested scopes. For defining + * occurrences only see {@link Variable#defs}. + * @member {Reference[]} Variable#references + */ + this.references = []; + + /** + * List of defining occurrences of this variable (like in 'var ...' + * statements or as parameter), as custom objects. + * @member {Definition[]} Variable#defs + */ + this.defs = []; + + this.tainted = false; + + /** + * Whether this is a stack variable. + * @member {boolean} Variable#stack + */ + this.stack = true; + + /** + * Reference to the enclosing Scope. + * @member {Scope} Variable#scope + */ + this.scope = scope; + } +} + +Variable.CatchClause = "CatchClause"; +Variable.Parameter = "Parameter"; +Variable.FunctionName = "FunctionName"; +Variable.ClassName = "ClassName"; +Variable.Variable = "Variable"; +Variable.ImportBinding = "ImportBinding"; +Variable.ImplicitGlobalVariable = "ImplicitGlobalVariable"; + +module.exports = Variable; + +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint-scope/package.json b/node_modules/eslint-scope/package.json new file mode 100644 index 000000000..9ae6624ce --- /dev/null +++ b/node_modules/eslint-scope/package.json @@ -0,0 +1,48 @@ +{ + "name": "eslint-scope", + "description": "ECMAScript scope analyzer for ESLint", + "homepage": "http://github.com/eslint/eslint-scope", + "main": "lib/index.js", + "version": "5.1.1", + "engines": { + "node": ">=8.0.0" + }, + "repository": "eslint/eslint-scope", + "bugs": { + "url": "https://github.com/eslint/eslint-scope/issues" + }, + "license": "BSD-2-Clause", + "scripts": { + "test": "node Makefile.js test", + "lint": "node Makefile.js lint", + "generate-release": "eslint-generate-release", + "generate-alpharelease": "eslint-generate-prerelease alpha", + "generate-betarelease": "eslint-generate-prerelease beta", + "generate-rcrelease": "eslint-generate-prerelease rc", + "publish-release": "eslint-publish-release" + }, + "files": [ + "LICENSE", + "README.md", + "lib" + ], + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "devDependencies": { + "@typescript-eslint/parser": "^1.11.0", + "chai": "^4.2.0", + "eslint": "^6.0.1", + "eslint-config-eslint": "^5.0.1", + "eslint-plugin-node": "^9.1.0", + "eslint-release": "^1.0.0", + "eslint-visitor-keys": "^1.2.0", + "espree": "^7.1.0", + "istanbul": "^0.4.5", + "mocha": "^6.1.4", + "npm-license": "^0.3.3", + "shelljs": "^0.8.3", + "typescript": "^3.5.2" + } +} \ No newline at end of file diff --git a/node_modules/eslint-utils/LICENSE b/node_modules/eslint-utils/LICENSE new file mode 100644 index 000000000..883ee1f61 --- /dev/null +++ b/node_modules/eslint-utils/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Toru Nagashima + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/eslint-utils/README.md b/node_modules/eslint-utils/README.md new file mode 100644 index 000000000..0b917591b --- /dev/null +++ b/node_modules/eslint-utils/README.md @@ -0,0 +1,38 @@ +# eslint-utils + +[![npm version](https://img.shields.io/npm/v/eslint-utils.svg)](https://www.npmjs.com/package/eslint-utils) +[![Downloads/month](https://img.shields.io/npm/dm/eslint-utils.svg)](http://www.npmtrends.com/eslint-utils) +[![Build Status](https://github.com/mysticatea/eslint-utils/workflows/CI/badge.svg)](https://github.com/mysticatea/eslint-utils/actions) +[![Coverage Status](https://codecov.io/gh/mysticatea/eslint-utils/branch/master/graph/badge.svg)](https://codecov.io/gh/mysticatea/eslint-utils) +[![Dependency Status](https://david-dm.org/mysticatea/eslint-utils.svg)](https://david-dm.org/mysticatea/eslint-utils) + +## 🏁 Goal + +This package provides utility functions and classes for make ESLint custom rules. + +For examples: + +- [getStaticValue](https://eslint-utils.mysticatea.dev/api/ast-utils.html#getstaticvalue) evaluates static value on AST. +- [ReferenceTracker](https://eslint-utils.mysticatea.dev/api/scope-utils.html#referencetracker-class) checks the members of modules/globals as handling assignments and destructuring. + +## 📖 Usage + +See [documentation](https://eslint-utils.mysticatea.dev/). + +## 📰 Changelog + +See [releases](https://github.com/mysticatea/eslint-utils/releases). + +## ❤️ Contributing + +Welcome contributing! + +Please use GitHub's Issues/PRs. + +### Development Tools + +- `npm test` runs tests and measures coverage. +- `npm run clean` removes the coverage result of `npm test` command. +- `npm run coverage` shows the coverage result of the last `npm test` command. +- `npm run lint` runs ESLint. +- `npm run watch` runs tests on each file change. diff --git a/node_modules/eslint-utils/index.js b/node_modules/eslint-utils/index.js new file mode 100644 index 000000000..3d55509aa --- /dev/null +++ b/node_modules/eslint-utils/index.js @@ -0,0 +1,1880 @@ +/*! @author Toru Nagashima */ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var evk = _interopDefault(require('eslint-visitor-keys')); + +/** + * Get the innermost scope which contains a given location. + * @param {Scope} initialScope The initial scope to search. + * @param {Node} node The location to search. + * @returns {Scope} The innermost scope. + */ +function getInnermostScope(initialScope, node) { + const location = node.range[0]; + + let scope = initialScope; + let found = false; + do { + found = false; + for (const childScope of scope.childScopes) { + const range = childScope.block.range; + + if (range[0] <= location && location < range[1]) { + scope = childScope; + found = true; + break + } + } + } while (found) + + return scope +} + +/** + * Find the variable of a given name. + * @param {Scope} initialScope The scope to start finding. + * @param {string|Node} nameOrNode The variable name to find. If this is a Node object then it should be an Identifier node. + * @returns {Variable|null} The found variable or null. + */ +function findVariable(initialScope, nameOrNode) { + let name = ""; + let scope = initialScope; + + if (typeof nameOrNode === "string") { + name = nameOrNode; + } else { + name = nameOrNode.name; + scope = getInnermostScope(scope, nameOrNode); + } + + while (scope != null) { + const variable = scope.set.get(name); + if (variable != null) { + return variable + } + scope = scope.upper; + } + + return null +} + +/** + * Negate the result of `this` calling. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the result of `this(token)` is `false`. + */ +function negate0(token) { + return !this(token) //eslint-disable-line no-invalid-this +} + +/** + * Creates the negate function of the given function. + * @param {function(Token):boolean} f - The function to negate. + * @returns {function(Token):boolean} Negated function. + */ +function negate(f) { + return negate0.bind(f) +} + +/** + * Checks if the given token is an arrow token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is an arrow token. + */ +function isArrowToken(token) { + return token.value === "=>" && token.type === "Punctuator" +} + +/** + * Checks if the given token is a comma token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a comma token. + */ +function isCommaToken(token) { + return token.value === "," && token.type === "Punctuator" +} + +/** + * Checks if the given token is a semicolon token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a semicolon token. + */ +function isSemicolonToken(token) { + return token.value === ";" && token.type === "Punctuator" +} + +/** + * Checks if the given token is a colon token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a colon token. + */ +function isColonToken(token) { + return token.value === ":" && token.type === "Punctuator" +} + +/** + * Checks if the given token is an opening parenthesis token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is an opening parenthesis token. + */ +function isOpeningParenToken(token) { + return token.value === "(" && token.type === "Punctuator" +} + +/** + * Checks if the given token is a closing parenthesis token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a closing parenthesis token. + */ +function isClosingParenToken(token) { + return token.value === ")" && token.type === "Punctuator" +} + +/** + * Checks if the given token is an opening square bracket token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is an opening square bracket token. + */ +function isOpeningBracketToken(token) { + return token.value === "[" && token.type === "Punctuator" +} + +/** + * Checks if the given token is a closing square bracket token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a closing square bracket token. + */ +function isClosingBracketToken(token) { + return token.value === "]" && token.type === "Punctuator" +} + +/** + * Checks if the given token is an opening brace token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is an opening brace token. + */ +function isOpeningBraceToken(token) { + return token.value === "{" && token.type === "Punctuator" +} + +/** + * Checks if the given token is a closing brace token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a closing brace token. + */ +function isClosingBraceToken(token) { + return token.value === "}" && token.type === "Punctuator" +} + +/** + * Checks if the given token is a comment token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a comment token. + */ +function isCommentToken(token) { + return ( + token.type === "Line" || + token.type === "Block" || + token.type === "Shebang" + ) +} + +const isNotArrowToken = negate(isArrowToken); +const isNotCommaToken = negate(isCommaToken); +const isNotSemicolonToken = negate(isSemicolonToken); +const isNotColonToken = negate(isColonToken); +const isNotOpeningParenToken = negate(isOpeningParenToken); +const isNotClosingParenToken = negate(isClosingParenToken); +const isNotOpeningBracketToken = negate(isOpeningBracketToken); +const isNotClosingBracketToken = negate(isClosingBracketToken); +const isNotOpeningBraceToken = negate(isOpeningBraceToken); +const isNotClosingBraceToken = negate(isClosingBraceToken); +const isNotCommentToken = negate(isCommentToken); + +/** + * Get the `(` token of the given function node. + * @param {Node} node - The function node to get. + * @param {SourceCode} sourceCode - The source code object to get tokens. + * @returns {Token} `(` token. + */ +function getOpeningParenOfParams(node, sourceCode) { + return node.id + ? sourceCode.getTokenAfter(node.id, isOpeningParenToken) + : sourceCode.getFirstToken(node, isOpeningParenToken) +} + +/** + * Get the location of the given function node for reporting. + * @param {Node} node - The function node to get. + * @param {SourceCode} sourceCode - The source code object to get tokens. + * @returns {string} The location of the function node for reporting. + */ +function getFunctionHeadLocation(node, sourceCode) { + const parent = node.parent; + let start = null; + let end = null; + + if (node.type === "ArrowFunctionExpression") { + const arrowToken = sourceCode.getTokenBefore(node.body, isArrowToken); + + start = arrowToken.loc.start; + end = arrowToken.loc.end; + } else if ( + parent.type === "Property" || + parent.type === "MethodDefinition" + ) { + start = parent.loc.start; + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } else { + start = node.loc.start; + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } + + return { + start: Object.assign({}, start), + end: Object.assign({}, end), + } +} + +/* globals BigInt, globalThis, global, self, window */ + +const globalObject = + typeof globalThis !== "undefined" + ? globalThis + : typeof self !== "undefined" + ? self + : typeof window !== "undefined" + ? window + : typeof global !== "undefined" + ? global + : {}; + +const builtinNames = Object.freeze( + new Set([ + "Array", + "ArrayBuffer", + "BigInt", + "BigInt64Array", + "BigUint64Array", + "Boolean", + "DataView", + "Date", + "decodeURI", + "decodeURIComponent", + "encodeURI", + "encodeURIComponent", + "escape", + "Float32Array", + "Float64Array", + "Function", + "Infinity", + "Int16Array", + "Int32Array", + "Int8Array", + "isFinite", + "isNaN", + "isPrototypeOf", + "JSON", + "Map", + "Math", + "NaN", + "Number", + "Object", + "parseFloat", + "parseInt", + "Promise", + "Proxy", + "Reflect", + "RegExp", + "Set", + "String", + "Symbol", + "Uint16Array", + "Uint32Array", + "Uint8Array", + "Uint8ClampedArray", + "undefined", + "unescape", + "WeakMap", + "WeakSet", + ]) +); +const callAllowed = new Set( + [ + Array.isArray, + typeof BigInt === "function" ? BigInt : undefined, + Boolean, + Date, + Date.parse, + decodeURI, + decodeURIComponent, + encodeURI, + encodeURIComponent, + escape, + isFinite, + isNaN, + isPrototypeOf, + ...Object.getOwnPropertyNames(Math) + .map(k => Math[k]) + .filter(f => typeof f === "function"), + Number, + Number.isFinite, + Number.isNaN, + Number.parseFloat, + Number.parseInt, + Object, + Object.entries, + Object.is, + Object.isExtensible, + Object.isFrozen, + Object.isSealed, + Object.keys, + Object.values, + parseFloat, + parseInt, + RegExp, + String, + String.fromCharCode, + String.fromCodePoint, + String.raw, + Symbol, + Symbol.for, + Symbol.keyFor, + unescape, + ].filter(f => typeof f === "function") +); +const callPassThrough = new Set([ + Object.freeze, + Object.preventExtensions, + Object.seal, +]); + +/** + * Get the property descriptor. + * @param {object} object The object to get. + * @param {string|number|symbol} name The property name to get. + */ +function getPropertyDescriptor(object, name) { + let x = object; + while ((typeof x === "object" || typeof x === "function") && x !== null) { + const d = Object.getOwnPropertyDescriptor(x, name); + if (d) { + return d + } + x = Object.getPrototypeOf(x); + } + return null +} + +/** + * Check if a property is getter or not. + * @param {object} object The object to check. + * @param {string|number|symbol} name The property name to check. + */ +function isGetter(object, name) { + const d = getPropertyDescriptor(object, name); + return d != null && d.get != null +} + +/** + * Get the element values of a given node list. + * @param {Node[]} nodeList The node list to get values. + * @param {Scope|undefined} initialScope The initial scope to find variables. + * @returns {any[]|null} The value list if all nodes are constant. Otherwise, null. + */ +function getElementValues(nodeList, initialScope) { + const valueList = []; + + for (let i = 0; i < nodeList.length; ++i) { + const elementNode = nodeList[i]; + + if (elementNode == null) { + valueList.length = i + 1; + } else if (elementNode.type === "SpreadElement") { + const argument = getStaticValueR(elementNode.argument, initialScope); + if (argument == null) { + return null + } + valueList.push(...argument.value); + } else { + const element = getStaticValueR(elementNode, initialScope); + if (element == null) { + return null + } + valueList.push(element.value); + } + } + + return valueList +} + +const operations = Object.freeze({ + ArrayExpression(node, initialScope) { + const elements = getElementValues(node.elements, initialScope); + return elements != null ? { value: elements } : null + }, + + AssignmentExpression(node, initialScope) { + if (node.operator === "=") { + return getStaticValueR(node.right, initialScope) + } + return null + }, + + //eslint-disable-next-line complexity + BinaryExpression(node, initialScope) { + if (node.operator === "in" || node.operator === "instanceof") { + // Not supported. + return null + } + + const left = getStaticValueR(node.left, initialScope); + const right = getStaticValueR(node.right, initialScope); + if (left != null && right != null) { + switch (node.operator) { + case "==": + return { value: left.value == right.value } //eslint-disable-line eqeqeq + case "!=": + return { value: left.value != right.value } //eslint-disable-line eqeqeq + case "===": + return { value: left.value === right.value } + case "!==": + return { value: left.value !== right.value } + case "<": + return { value: left.value < right.value } + case "<=": + return { value: left.value <= right.value } + case ">": + return { value: left.value > right.value } + case ">=": + return { value: left.value >= right.value } + case "<<": + return { value: left.value << right.value } + case ">>": + return { value: left.value >> right.value } + case ">>>": + return { value: left.value >>> right.value } + case "+": + return { value: left.value + right.value } + case "-": + return { value: left.value - right.value } + case "*": + return { value: left.value * right.value } + case "/": + return { value: left.value / right.value } + case "%": + return { value: left.value % right.value } + case "**": + return { value: Math.pow(left.value, right.value) } + case "|": + return { value: left.value | right.value } + case "^": + return { value: left.value ^ right.value } + case "&": + return { value: left.value & right.value } + + // no default + } + } + + return null + }, + + CallExpression(node, initialScope) { + const calleeNode = node.callee; + const args = getElementValues(node.arguments, initialScope); + + if (args != null) { + if (calleeNode.type === "MemberExpression") { + const object = getStaticValueR(calleeNode.object, initialScope); + if (object != null) { + if ( + object.value == null && + (object.optional || node.optional) + ) { + return { value: undefined, optional: true } + } + const property = calleeNode.computed + ? getStaticValueR(calleeNode.property, initialScope) + : { value: calleeNode.property.name }; + + if (property != null) { + const receiver = object.value; + const methodName = property.value; + if (callAllowed.has(receiver[methodName])) { + return { value: receiver[methodName](...args) } + } + if (callPassThrough.has(receiver[methodName])) { + return { value: args[0] } + } + } + } + } else { + const callee = getStaticValueR(calleeNode, initialScope); + if (callee != null) { + if (callee.value == null && node.optional) { + return { value: undefined, optional: true } + } + const func = callee.value; + if (callAllowed.has(func)) { + return { value: func(...args) } + } + if (callPassThrough.has(func)) { + return { value: args[0] } + } + } + } + } + + return null + }, + + ConditionalExpression(node, initialScope) { + const test = getStaticValueR(node.test, initialScope); + if (test != null) { + return test.value + ? getStaticValueR(node.consequent, initialScope) + : getStaticValueR(node.alternate, initialScope) + } + return null + }, + + ExpressionStatement(node, initialScope) { + return getStaticValueR(node.expression, initialScope) + }, + + Identifier(node, initialScope) { + if (initialScope != null) { + const variable = findVariable(initialScope, node); + + // Built-in globals. + if ( + variable != null && + variable.defs.length === 0 && + builtinNames.has(variable.name) && + variable.name in globalObject + ) { + return { value: globalObject[variable.name] } + } + + // Constants. + if (variable != null && variable.defs.length === 1) { + const def = variable.defs[0]; + if ( + def.parent && + def.parent.kind === "const" && + // TODO(mysticatea): don't support destructuring here. + def.node.id.type === "Identifier" + ) { + return getStaticValueR(def.node.init, initialScope) + } + } + } + return null + }, + + Literal(node) { + //istanbul ignore if : this is implementation-specific behavior. + if ((node.regex != null || node.bigint != null) && node.value == null) { + // It was a RegExp/BigInt literal, but Node.js didn't support it. + return null + } + return { value: node.value } + }, + + LogicalExpression(node, initialScope) { + const left = getStaticValueR(node.left, initialScope); + if (left != null) { + if ( + (node.operator === "||" && Boolean(left.value) === true) || + (node.operator === "&&" && Boolean(left.value) === false) || + (node.operator === "??" && left.value != null) + ) { + return left + } + + const right = getStaticValueR(node.right, initialScope); + if (right != null) { + return right + } + } + + return null + }, + + MemberExpression(node, initialScope) { + const object = getStaticValueR(node.object, initialScope); + if (object != null) { + if (object.value == null && (object.optional || node.optional)) { + return { value: undefined, optional: true } + } + const property = node.computed + ? getStaticValueR(node.property, initialScope) + : { value: node.property.name }; + + if (property != null && !isGetter(object.value, property.value)) { + return { value: object.value[property.value] } + } + } + return null + }, + + ChainExpression(node, initialScope) { + const expression = getStaticValueR(node.expression, initialScope); + if (expression != null) { + return { value: expression.value } + } + return null + }, + + NewExpression(node, initialScope) { + const callee = getStaticValueR(node.callee, initialScope); + const args = getElementValues(node.arguments, initialScope); + + if (callee != null && args != null) { + const Func = callee.value; + if (callAllowed.has(Func)) { + return { value: new Func(...args) } + } + } + + return null + }, + + ObjectExpression(node, initialScope) { + const object = {}; + + for (const propertyNode of node.properties) { + if (propertyNode.type === "Property") { + if (propertyNode.kind !== "init") { + return null + } + const key = propertyNode.computed + ? getStaticValueR(propertyNode.key, initialScope) + : { value: propertyNode.key.name }; + const value = getStaticValueR(propertyNode.value, initialScope); + if (key == null || value == null) { + return null + } + object[key.value] = value.value; + } else if ( + propertyNode.type === "SpreadElement" || + propertyNode.type === "ExperimentalSpreadProperty" + ) { + const argument = getStaticValueR( + propertyNode.argument, + initialScope + ); + if (argument == null) { + return null + } + Object.assign(object, argument.value); + } else { + return null + } + } + + return { value: object } + }, + + SequenceExpression(node, initialScope) { + const last = node.expressions[node.expressions.length - 1]; + return getStaticValueR(last, initialScope) + }, + + TaggedTemplateExpression(node, initialScope) { + const tag = getStaticValueR(node.tag, initialScope); + const expressions = getElementValues( + node.quasi.expressions, + initialScope + ); + + if (tag != null && expressions != null) { + const func = tag.value; + const strings = node.quasi.quasis.map(q => q.value.cooked); + strings.raw = node.quasi.quasis.map(q => q.value.raw); + + if (func === String.raw) { + return { value: func(strings, ...expressions) } + } + } + + return null + }, + + TemplateLiteral(node, initialScope) { + const expressions = getElementValues(node.expressions, initialScope); + if (expressions != null) { + let value = node.quasis[0].value.cooked; + for (let i = 0; i < expressions.length; ++i) { + value += expressions[i]; + value += node.quasis[i + 1].value.cooked; + } + return { value } + } + return null + }, + + UnaryExpression(node, initialScope) { + if (node.operator === "delete") { + // Not supported. + return null + } + if (node.operator === "void") { + return { value: undefined } + } + + const arg = getStaticValueR(node.argument, initialScope); + if (arg != null) { + switch (node.operator) { + case "-": + return { value: -arg.value } + case "+": + return { value: +arg.value } //eslint-disable-line no-implicit-coercion + case "!": + return { value: !arg.value } + case "~": + return { value: ~arg.value } + case "typeof": + return { value: typeof arg.value } + + // no default + } + } + + return null + }, +}); + +/** + * Get the value of a given node if it's a static value. + * @param {Node} node The node to get. + * @param {Scope|undefined} initialScope The scope to start finding variable. + * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`. + */ +function getStaticValueR(node, initialScope) { + if (node != null && Object.hasOwnProperty.call(operations, node.type)) { + return operations[node.type](node, initialScope) + } + return null +} + +/** + * Get the value of a given node if it's a static value. + * @param {Node} node The node to get. + * @param {Scope} [initialScope] The scope to start finding variable. Optional. If this scope was given, this tries to resolve identifier references which are in the given node as much as possible. + * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`. + */ +function getStaticValue(node, initialScope = null) { + try { + return getStaticValueR(node, initialScope) + } catch (_error) { + return null + } +} + +/** + * Get the value of a given node if it's a literal or a template literal. + * @param {Node} node The node to get. + * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is an Identifier node and this scope was given, this checks the variable of the identifier, and returns the value of it if the variable is a constant. + * @returns {string|null} The value of the node, or `null`. + */ +function getStringIfConstant(node, initialScope = null) { + // Handle the literals that the platform doesn't support natively. + if (node && node.type === "Literal" && node.value === null) { + if (node.regex) { + return `/${node.regex.pattern}/${node.regex.flags}` + } + if (node.bigint) { + return node.bigint + } + } + + const evaluated = getStaticValue(node, initialScope); + return evaluated && String(evaluated.value) +} + +/** + * Get the property name from a MemberExpression node or a Property node. + * @param {Node} node The node to get. + * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it. + * @returns {string|null} The property name of the node. + */ +function getPropertyName(node, initialScope) { + switch (node.type) { + case "MemberExpression": + if (node.computed) { + return getStringIfConstant(node.property, initialScope) + } + return node.property.name + + case "Property": + case "MethodDefinition": + if (node.computed) { + return getStringIfConstant(node.key, initialScope) + } + if (node.key.type === "Literal") { + return String(node.key.value) + } + return node.key.name + + // no default + } + + return null +} + +/** + * Get the name and kind of the given function node. + * @param {ASTNode} node - The function node to get. + * @returns {string} The name and kind of the function node. + */ +function getFunctionNameWithKind(node) { + const parent = node.parent; + const tokens = []; + + if (parent.type === "MethodDefinition" && parent.static) { + tokens.push("static"); + } + if (node.async) { + tokens.push("async"); + } + if (node.generator) { + tokens.push("generator"); + } + + if (node.type === "ArrowFunctionExpression") { + tokens.push("arrow", "function"); + } else if ( + parent.type === "Property" || + parent.type === "MethodDefinition" + ) { + if (parent.kind === "constructor") { + return "constructor" + } + if (parent.kind === "get") { + tokens.push("getter"); + } else if (parent.kind === "set") { + tokens.push("setter"); + } else { + tokens.push("method"); + } + } else { + tokens.push("function"); + } + + if (node.id) { + tokens.push(`'${node.id.name}'`); + } else { + const name = getPropertyName(parent); + + if (name) { + tokens.push(`'${name}'`); + } + } + + if (node.type === "ArrowFunctionExpression") { + if ( + parent.type === "VariableDeclarator" && + parent.id && + parent.id.type === "Identifier" + ) { + tokens.push(`'${parent.id.name}'`); + } + if ( + parent.type === "AssignmentExpression" && + parent.left && + parent.left.type === "Identifier" + ) { + tokens.push(`'${parent.left.name}'`); + } + } + + return tokens.join(" ") +} + +const typeConversionBinaryOps = Object.freeze( + new Set([ + "==", + "!=", + "<", + "<=", + ">", + ">=", + "<<", + ">>", + ">>>", + "+", + "-", + "*", + "/", + "%", + "|", + "^", + "&", + "in", + ]) +); +const typeConversionUnaryOps = Object.freeze(new Set(["-", "+", "!", "~"])); + +/** + * Check whether the given value is an ASTNode or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if the value is an ASTNode. + */ +function isNode(x) { + return x !== null && typeof x === "object" && typeof x.type === "string" +} + +const visitor = Object.freeze( + Object.assign(Object.create(null), { + $visit(node, options, visitorKeys) { + const { type } = node; + + if (typeof this[type] === "function") { + return this[type](node, options, visitorKeys) + } + + return this.$visitChildren(node, options, visitorKeys) + }, + + $visitChildren(node, options, visitorKeys) { + const { type } = node; + + for (const key of visitorKeys[type] || evk.getKeys(node)) { + const value = node[key]; + + if (Array.isArray(value)) { + for (const element of value) { + if ( + isNode(element) && + this.$visit(element, options, visitorKeys) + ) { + return true + } + } + } else if ( + isNode(value) && + this.$visit(value, options, visitorKeys) + ) { + return true + } + } + + return false + }, + + ArrowFunctionExpression() { + return false + }, + AssignmentExpression() { + return true + }, + AwaitExpression() { + return true + }, + BinaryExpression(node, options, visitorKeys) { + if ( + options.considerImplicitTypeConversion && + typeConversionBinaryOps.has(node.operator) && + (node.left.type !== "Literal" || node.right.type !== "Literal") + ) { + return true + } + return this.$visitChildren(node, options, visitorKeys) + }, + CallExpression() { + return true + }, + FunctionExpression() { + return false + }, + ImportExpression() { + return true + }, + MemberExpression(node, options, visitorKeys) { + if (options.considerGetters) { + return true + } + if ( + options.considerImplicitTypeConversion && + node.computed && + node.property.type !== "Literal" + ) { + return true + } + return this.$visitChildren(node, options, visitorKeys) + }, + MethodDefinition(node, options, visitorKeys) { + if ( + options.considerImplicitTypeConversion && + node.computed && + node.key.type !== "Literal" + ) { + return true + } + return this.$visitChildren(node, options, visitorKeys) + }, + NewExpression() { + return true + }, + Property(node, options, visitorKeys) { + if ( + options.considerImplicitTypeConversion && + node.computed && + node.key.type !== "Literal" + ) { + return true + } + return this.$visitChildren(node, options, visitorKeys) + }, + UnaryExpression(node, options, visitorKeys) { + if (node.operator === "delete") { + return true + } + if ( + options.considerImplicitTypeConversion && + typeConversionUnaryOps.has(node.operator) && + node.argument.type !== "Literal" + ) { + return true + } + return this.$visitChildren(node, options, visitorKeys) + }, + UpdateExpression() { + return true + }, + YieldExpression() { + return true + }, + }) +); + +/** + * Check whether a given node has any side effect or not. + * @param {Node} node The node to get. + * @param {SourceCode} sourceCode The source code object. + * @param {object} [options] The option object. + * @param {boolean} [options.considerGetters=false] If `true` then it considers member accesses as the node which has side effects. + * @param {boolean} [options.considerImplicitTypeConversion=false] If `true` then it considers implicit type conversion as the node which has side effects. + * @param {object} [options.visitorKeys=evk.KEYS] The keys to traverse nodes. Use `context.getSourceCode().visitorKeys`. + * @returns {boolean} `true` if the node has a certain side effect. + */ +function hasSideEffect( + node, + sourceCode, + { considerGetters = false, considerImplicitTypeConversion = false } = {} +) { + return visitor.$visit( + node, + { considerGetters, considerImplicitTypeConversion }, + sourceCode.visitorKeys || evk.KEYS + ) +} + +/** + * Get the left parenthesis of the parent node syntax if it exists. + * E.g., `if (a) {}` then the `(`. + * @param {Node} node The AST node to check. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {Token|null} The left parenthesis of the parent node syntax + */ +function getParentSyntaxParen(node, sourceCode) { + const parent = node.parent; + + switch (parent.type) { + case "CallExpression": + case "NewExpression": + if (parent.arguments.length === 1 && parent.arguments[0] === node) { + return sourceCode.getTokenAfter( + parent.callee, + isOpeningParenToken + ) + } + return null + + case "DoWhileStatement": + if (parent.test === node) { + return sourceCode.getTokenAfter( + parent.body, + isOpeningParenToken + ) + } + return null + + case "IfStatement": + case "WhileStatement": + if (parent.test === node) { + return sourceCode.getFirstToken(parent, 1) + } + return null + + case "ImportExpression": + if (parent.source === node) { + return sourceCode.getFirstToken(parent, 1) + } + return null + + case "SwitchStatement": + if (parent.discriminant === node) { + return sourceCode.getFirstToken(parent, 1) + } + return null + + case "WithStatement": + if (parent.object === node) { + return sourceCode.getFirstToken(parent, 1) + } + return null + + default: + return null + } +} + +/** + * Check whether a given node is parenthesized or not. + * @param {number} times The number of parantheses. + * @param {Node} node The AST node to check. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {boolean} `true` if the node is parenthesized the given times. + */ +/** + * Check whether a given node is parenthesized or not. + * @param {Node} node The AST node to check. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {boolean} `true` if the node is parenthesized. + */ +function isParenthesized( + timesOrNode, + nodeOrSourceCode, + optionalSourceCode +) { + let times, node, sourceCode, maybeLeftParen, maybeRightParen; + if (typeof timesOrNode === "number") { + times = timesOrNode | 0; + node = nodeOrSourceCode; + sourceCode = optionalSourceCode; + if (!(times >= 1)) { + throw new TypeError("'times' should be a positive integer.") + } + } else { + times = 1; + node = timesOrNode; + sourceCode = nodeOrSourceCode; + } + + if (node == null) { + return false + } + + maybeLeftParen = maybeRightParen = node; + do { + maybeLeftParen = sourceCode.getTokenBefore(maybeLeftParen); + maybeRightParen = sourceCode.getTokenAfter(maybeRightParen); + } while ( + maybeLeftParen != null && + maybeRightParen != null && + isOpeningParenToken(maybeLeftParen) && + isClosingParenToken(maybeRightParen) && + // Avoid false positive such as `if (a) {}` + maybeLeftParen !== getParentSyntaxParen(node, sourceCode) && + --times > 0 + ) + + return times === 0 +} + +/** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ + +const placeholder = /\$(?:[$&`']|[1-9][0-9]?)/gu; + +/** @type {WeakMap} */ +const internal = new WeakMap(); + +/** + * Check whether a given character is escaped or not. + * @param {string} str The string to check. + * @param {number} index The location of the character to check. + * @returns {boolean} `true` if the character is escaped. + */ +function isEscaped(str, index) { + let escaped = false; + for (let i = index - 1; i >= 0 && str.charCodeAt(i) === 0x5c; --i) { + escaped = !escaped; + } + return escaped +} + +/** + * Replace a given string by a given matcher. + * @param {PatternMatcher} matcher The pattern matcher. + * @param {string} str The string to be replaced. + * @param {string} replacement The new substring to replace each matched part. + * @returns {string} The replaced string. + */ +function replaceS(matcher, str, replacement) { + const chunks = []; + let index = 0; + + /** @type {RegExpExecArray} */ + let match = null; + + /** + * @param {string} key The placeholder. + * @returns {string} The replaced string. + */ + function replacer(key) { + switch (key) { + case "$$": + return "$" + case "$&": + return match[0] + case "$`": + return str.slice(0, match.index) + case "$'": + return str.slice(match.index + match[0].length) + default: { + const i = key.slice(1); + if (i in match) { + return match[i] + } + return key + } + } + } + + for (match of matcher.execAll(str)) { + chunks.push(str.slice(index, match.index)); + chunks.push(replacement.replace(placeholder, replacer)); + index = match.index + match[0].length; + } + chunks.push(str.slice(index)); + + return chunks.join("") +} + +/** + * Replace a given string by a given matcher. + * @param {PatternMatcher} matcher The pattern matcher. + * @param {string} str The string to be replaced. + * @param {(...strs[])=>string} replace The function to replace each matched part. + * @returns {string} The replaced string. + */ +function replaceF(matcher, str, replace) { + const chunks = []; + let index = 0; + + for (const match of matcher.execAll(str)) { + chunks.push(str.slice(index, match.index)); + chunks.push(String(replace(...match, match.index, match.input))); + index = match.index + match[0].length; + } + chunks.push(str.slice(index)); + + return chunks.join("") +} + +/** + * The class to find patterns as considering escape sequences. + */ +class PatternMatcher { + /** + * Initialize this matcher. + * @param {RegExp} pattern The pattern to match. + * @param {{escaped:boolean}} options The options. + */ + constructor(pattern, { escaped = false } = {}) { + if (!(pattern instanceof RegExp)) { + throw new TypeError("'pattern' should be a RegExp instance.") + } + if (!pattern.flags.includes("g")) { + throw new Error("'pattern' should contains 'g' flag.") + } + + internal.set(this, { + pattern: new RegExp(pattern.source, pattern.flags), + escaped: Boolean(escaped), + }); + } + + /** + * Find the pattern in a given string. + * @param {string} str The string to find. + * @returns {IterableIterator} The iterator which iterate the matched information. + */ + *execAll(str) { + const { pattern, escaped } = internal.get(this); + let match = null; + let lastIndex = 0; + + pattern.lastIndex = 0; + while ((match = pattern.exec(str)) != null) { + if (escaped || !isEscaped(str, match.index)) { + lastIndex = pattern.lastIndex; + yield match; + pattern.lastIndex = lastIndex; + } + } + } + + /** + * Check whether the pattern is found in a given string. + * @param {string} str The string to check. + * @returns {boolean} `true` if the pattern was found in the string. + */ + test(str) { + const it = this.execAll(str); + const ret = it.next(); + return !ret.done + } + + /** + * Replace a given string. + * @param {string} str The string to be replaced. + * @param {(string|((...strs:string[])=>string))} replacer The string or function to replace. This is the same as the 2nd argument of `String.prototype.replace`. + * @returns {string} The replaced string. + */ + [Symbol.replace](str, replacer) { + return typeof replacer === "function" + ? replaceF(this, String(str), replacer) + : replaceS(this, String(str), String(replacer)) + } +} + +const IMPORT_TYPE = /^(?:Import|Export(?:All|Default|Named))Declaration$/u; +const has = Function.call.bind(Object.hasOwnProperty); + +const READ = Symbol("read"); +const CALL = Symbol("call"); +const CONSTRUCT = Symbol("construct"); +const ESM = Symbol("esm"); + +const requireCall = { require: { [CALL]: true } }; + +/** + * Check whether a given variable is modified or not. + * @param {Variable} variable The variable to check. + * @returns {boolean} `true` if the variable is modified. + */ +function isModifiedGlobal(variable) { + return ( + variable == null || + variable.defs.length !== 0 || + variable.references.some(r => r.isWrite()) + ) +} + +/** + * Check if the value of a given node is passed through to the parent syntax as-is. + * For example, `a` and `b` in (`a || b` and `c ? a : b`) are passed through. + * @param {Node} node A node to check. + * @returns {boolean} `true` if the node is passed through. + */ +function isPassThrough(node) { + const parent = node.parent; + + switch (parent && parent.type) { + case "ConditionalExpression": + return parent.consequent === node || parent.alternate === node + case "LogicalExpression": + return true + case "SequenceExpression": + return parent.expressions[parent.expressions.length - 1] === node + case "ChainExpression": + return true + + default: + return false + } +} + +/** + * The reference tracker. + */ +class ReferenceTracker { + /** + * Initialize this tracker. + * @param {Scope} globalScope The global scope. + * @param {object} [options] The options. + * @param {"legacy"|"strict"} [options.mode="strict"] The mode to determine the ImportDeclaration's behavior for CJS modules. + * @param {string[]} [options.globalObjectNames=["global","globalThis","self","window"]] The variable names for Global Object. + */ + constructor( + globalScope, + { + mode = "strict", + globalObjectNames = ["global", "globalThis", "self", "window"], + } = {} + ) { + this.variableStack = []; + this.globalScope = globalScope; + this.mode = mode; + this.globalObjectNames = globalObjectNames.slice(0); + } + + /** + * Iterate the references of global variables. + * @param {object} traceMap The trace map. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + *iterateGlobalReferences(traceMap) { + for (const key of Object.keys(traceMap)) { + const nextTraceMap = traceMap[key]; + const path = [key]; + const variable = this.globalScope.set.get(key); + + if (isModifiedGlobal(variable)) { + continue + } + + yield* this._iterateVariableReferences( + variable, + path, + nextTraceMap, + true + ); + } + + for (const key of this.globalObjectNames) { + const path = []; + const variable = this.globalScope.set.get(key); + + if (isModifiedGlobal(variable)) { + continue + } + + yield* this._iterateVariableReferences( + variable, + path, + traceMap, + false + ); + } + } + + /** + * Iterate the references of CommonJS modules. + * @param {object} traceMap The trace map. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + *iterateCjsReferences(traceMap) { + for (const { node } of this.iterateGlobalReferences(requireCall)) { + const key = getStringIfConstant(node.arguments[0]); + if (key == null || !has(traceMap, key)) { + continue + } + + const nextTraceMap = traceMap[key]; + const path = [key]; + + if (nextTraceMap[READ]) { + yield { + node, + path, + type: READ, + info: nextTraceMap[READ], + }; + } + yield* this._iteratePropertyReferences(node, path, nextTraceMap); + } + } + + /** + * Iterate the references of ES modules. + * @param {object} traceMap The trace map. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + *iterateEsmReferences(traceMap) { + const programNode = this.globalScope.block; + + for (const node of programNode.body) { + if (!IMPORT_TYPE.test(node.type) || node.source == null) { + continue + } + const moduleId = node.source.value; + + if (!has(traceMap, moduleId)) { + continue + } + const nextTraceMap = traceMap[moduleId]; + const path = [moduleId]; + + if (nextTraceMap[READ]) { + yield { node, path, type: READ, info: nextTraceMap[READ] }; + } + + if (node.type === "ExportAllDeclaration") { + for (const key of Object.keys(nextTraceMap)) { + const exportTraceMap = nextTraceMap[key]; + if (exportTraceMap[READ]) { + yield { + node, + path: path.concat(key), + type: READ, + info: exportTraceMap[READ], + }; + } + } + } else { + for (const specifier of node.specifiers) { + const esm = has(nextTraceMap, ESM); + const it = this._iterateImportReferences( + specifier, + path, + esm + ? nextTraceMap + : this.mode === "legacy" + ? Object.assign( + { default: nextTraceMap }, + nextTraceMap + ) + : { default: nextTraceMap } + ); + + if (esm) { + yield* it; + } else { + for (const report of it) { + report.path = report.path.filter(exceptDefault); + if ( + report.path.length >= 2 || + report.type !== READ + ) { + yield report; + } + } + } + } + } + } + } + + /** + * Iterate the references for a given variable. + * @param {Variable} variable The variable to iterate that references. + * @param {string[]} path The current path. + * @param {object} traceMap The trace map. + * @param {boolean} shouldReport = The flag to report those references. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + *_iterateVariableReferences(variable, path, traceMap, shouldReport) { + if (this.variableStack.includes(variable)) { + return + } + this.variableStack.push(variable); + try { + for (const reference of variable.references) { + if (!reference.isRead()) { + continue + } + const node = reference.identifier; + + if (shouldReport && traceMap[READ]) { + yield { node, path, type: READ, info: traceMap[READ] }; + } + yield* this._iteratePropertyReferences(node, path, traceMap); + } + } finally { + this.variableStack.pop(); + } + } + + /** + * Iterate the references for a given AST node. + * @param rootNode The AST node to iterate references. + * @param {string[]} path The current path. + * @param {object} traceMap The trace map. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + //eslint-disable-next-line complexity + *_iteratePropertyReferences(rootNode, path, traceMap) { + let node = rootNode; + while (isPassThrough(node)) { + node = node.parent; + } + + const parent = node.parent; + if (parent.type === "MemberExpression") { + if (parent.object === node) { + const key = getPropertyName(parent); + if (key == null || !has(traceMap, key)) { + return + } + + path = path.concat(key); //eslint-disable-line no-param-reassign + const nextTraceMap = traceMap[key]; + if (nextTraceMap[READ]) { + yield { + node: parent, + path, + type: READ, + info: nextTraceMap[READ], + }; + } + yield* this._iteratePropertyReferences( + parent, + path, + nextTraceMap + ); + } + return + } + if (parent.type === "CallExpression") { + if (parent.callee === node && traceMap[CALL]) { + yield { node: parent, path, type: CALL, info: traceMap[CALL] }; + } + return + } + if (parent.type === "NewExpression") { + if (parent.callee === node && traceMap[CONSTRUCT]) { + yield { + node: parent, + path, + type: CONSTRUCT, + info: traceMap[CONSTRUCT], + }; + } + return + } + if (parent.type === "AssignmentExpression") { + if (parent.right === node) { + yield* this._iterateLhsReferences(parent.left, path, traceMap); + yield* this._iteratePropertyReferences(parent, path, traceMap); + } + return + } + if (parent.type === "AssignmentPattern") { + if (parent.right === node) { + yield* this._iterateLhsReferences(parent.left, path, traceMap); + } + return + } + if (parent.type === "VariableDeclarator") { + if (parent.init === node) { + yield* this._iterateLhsReferences(parent.id, path, traceMap); + } + } + } + + /** + * Iterate the references for a given Pattern node. + * @param {Node} patternNode The Pattern node to iterate references. + * @param {string[]} path The current path. + * @param {object} traceMap The trace map. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + *_iterateLhsReferences(patternNode, path, traceMap) { + if (patternNode.type === "Identifier") { + const variable = findVariable(this.globalScope, patternNode); + if (variable != null) { + yield* this._iterateVariableReferences( + variable, + path, + traceMap, + false + ); + } + return + } + if (patternNode.type === "ObjectPattern") { + for (const property of patternNode.properties) { + const key = getPropertyName(property); + + if (key == null || !has(traceMap, key)) { + continue + } + + const nextPath = path.concat(key); + const nextTraceMap = traceMap[key]; + if (nextTraceMap[READ]) { + yield { + node: property, + path: nextPath, + type: READ, + info: nextTraceMap[READ], + }; + } + yield* this._iterateLhsReferences( + property.value, + nextPath, + nextTraceMap + ); + } + return + } + if (patternNode.type === "AssignmentPattern") { + yield* this._iterateLhsReferences(patternNode.left, path, traceMap); + } + } + + /** + * Iterate the references for a given ModuleSpecifier node. + * @param {Node} specifierNode The ModuleSpecifier node to iterate references. + * @param {string[]} path The current path. + * @param {object} traceMap The trace map. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + *_iterateImportReferences(specifierNode, path, traceMap) { + const type = specifierNode.type; + + if (type === "ImportSpecifier" || type === "ImportDefaultSpecifier") { + const key = + type === "ImportDefaultSpecifier" + ? "default" + : specifierNode.imported.name; + if (!has(traceMap, key)) { + return + } + + path = path.concat(key); //eslint-disable-line no-param-reassign + const nextTraceMap = traceMap[key]; + if (nextTraceMap[READ]) { + yield { + node: specifierNode, + path, + type: READ, + info: nextTraceMap[READ], + }; + } + yield* this._iterateVariableReferences( + findVariable(this.globalScope, specifierNode.local), + path, + nextTraceMap, + false + ); + + return + } + + if (type === "ImportNamespaceSpecifier") { + yield* this._iterateVariableReferences( + findVariable(this.globalScope, specifierNode.local), + path, + traceMap, + false + ); + return + } + + if (type === "ExportSpecifier") { + const key = specifierNode.local.name; + if (!has(traceMap, key)) { + return + } + + path = path.concat(key); //eslint-disable-line no-param-reassign + const nextTraceMap = traceMap[key]; + if (nextTraceMap[READ]) { + yield { + node: specifierNode, + path, + type: READ, + info: nextTraceMap[READ], + }; + } + } + } +} + +ReferenceTracker.READ = READ; +ReferenceTracker.CALL = CALL; +ReferenceTracker.CONSTRUCT = CONSTRUCT; +ReferenceTracker.ESM = ESM; + +/** + * This is a predicate function for Array#filter. + * @param {string} name A name part. + * @param {number} index The index of the name. + * @returns {boolean} `false` if it's default. + */ +function exceptDefault(name, index) { + return !(index === 1 && name === "default") +} + +var index = { + CALL, + CONSTRUCT, + ESM, + findVariable, + getFunctionHeadLocation, + getFunctionNameWithKind, + getInnermostScope, + getPropertyName, + getStaticValue, + getStringIfConstant, + hasSideEffect, + isArrowToken, + isClosingBraceToken, + isClosingBracketToken, + isClosingParenToken, + isColonToken, + isCommaToken, + isCommentToken, + isNotArrowToken, + isNotClosingBraceToken, + isNotClosingBracketToken, + isNotClosingParenToken, + isNotColonToken, + isNotCommaToken, + isNotCommentToken, + isNotOpeningBraceToken, + isNotOpeningBracketToken, + isNotOpeningParenToken, + isNotSemicolonToken, + isOpeningBraceToken, + isOpeningBracketToken, + isOpeningParenToken, + isParenthesized, + isSemicolonToken, + PatternMatcher, + READ, + ReferenceTracker, +}; + +exports.CALL = CALL; +exports.CONSTRUCT = CONSTRUCT; +exports.ESM = ESM; +exports.PatternMatcher = PatternMatcher; +exports.READ = READ; +exports.ReferenceTracker = ReferenceTracker; +exports.default = index; +exports.findVariable = findVariable; +exports.getFunctionHeadLocation = getFunctionHeadLocation; +exports.getFunctionNameWithKind = getFunctionNameWithKind; +exports.getInnermostScope = getInnermostScope; +exports.getPropertyName = getPropertyName; +exports.getStaticValue = getStaticValue; +exports.getStringIfConstant = getStringIfConstant; +exports.hasSideEffect = hasSideEffect; +exports.isArrowToken = isArrowToken; +exports.isClosingBraceToken = isClosingBraceToken; +exports.isClosingBracketToken = isClosingBracketToken; +exports.isClosingParenToken = isClosingParenToken; +exports.isColonToken = isColonToken; +exports.isCommaToken = isCommaToken; +exports.isCommentToken = isCommentToken; +exports.isNotArrowToken = isNotArrowToken; +exports.isNotClosingBraceToken = isNotClosingBraceToken; +exports.isNotClosingBracketToken = isNotClosingBracketToken; +exports.isNotClosingParenToken = isNotClosingParenToken; +exports.isNotColonToken = isNotColonToken; +exports.isNotCommaToken = isNotCommaToken; +exports.isNotCommentToken = isNotCommentToken; +exports.isNotOpeningBraceToken = isNotOpeningBraceToken; +exports.isNotOpeningBracketToken = isNotOpeningBracketToken; +exports.isNotOpeningParenToken = isNotOpeningParenToken; +exports.isNotSemicolonToken = isNotSemicolonToken; +exports.isOpeningBraceToken = isOpeningBraceToken; +exports.isOpeningBracketToken = isOpeningBracketToken; +exports.isOpeningParenToken = isOpeningParenToken; +exports.isParenthesized = isParenthesized; +exports.isSemicolonToken = isSemicolonToken; +//# sourceMappingURL=index.js.map diff --git a/node_modules/eslint-utils/index.js.map b/node_modules/eslint-utils/index.js.map new file mode 100644 index 000000000..5fab2d406 --- /dev/null +++ b/node_modules/eslint-utils/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["src/get-innermost-scope.js","src/find-variable.js","src/token-predicate.js","src/get-function-head-location.js","src/get-static-value.js","src/get-string-if-constant.js","src/get-property-name.js","src/get-function-name-with-kind.js","src/has-side-effect.js","src/is-parenthesized.js","src/pattern-matcher.js","src/reference-tracker.js","src/index.js"],"sourcesContent":["/**\n * Get the innermost scope which contains a given location.\n * @param {Scope} initialScope The initial scope to search.\n * @param {Node} node The location to search.\n * @returns {Scope} The innermost scope.\n */\nexport function getInnermostScope(initialScope, node) {\n const location = node.range[0]\n\n let scope = initialScope\n let found = false\n do {\n found = false\n for (const childScope of scope.childScopes) {\n const range = childScope.block.range\n\n if (range[0] <= location && location < range[1]) {\n scope = childScope\n found = true\n break\n }\n }\n } while (found)\n\n return scope\n}\n","import { getInnermostScope } from \"./get-innermost-scope\"\n\n/**\n * Find the variable of a given name.\n * @param {Scope} initialScope The scope to start finding.\n * @param {string|Node} nameOrNode The variable name to find. If this is a Node object then it should be an Identifier node.\n * @returns {Variable|null} The found variable or null.\n */\nexport function findVariable(initialScope, nameOrNode) {\n let name = \"\"\n let scope = initialScope\n\n if (typeof nameOrNode === \"string\") {\n name = nameOrNode\n } else {\n name = nameOrNode.name\n scope = getInnermostScope(scope, nameOrNode)\n }\n\n while (scope != null) {\n const variable = scope.set.get(name)\n if (variable != null) {\n return variable\n }\n scope = scope.upper\n }\n\n return null\n}\n","/**\n * Negate the result of `this` calling.\n * @param {Token} token The token to check.\n * @returns {boolean} `true` if the result of `this(token)` is `false`.\n */\nfunction negate0(token) {\n return !this(token) //eslint-disable-line no-invalid-this\n}\n\n/**\n * Creates the negate function of the given function.\n * @param {function(Token):boolean} f - The function to negate.\n * @returns {function(Token):boolean} Negated function.\n */\nfunction negate(f) {\n return negate0.bind(f)\n}\n\n/**\n * Checks if the given token is an arrow token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an arrow token.\n */\nexport function isArrowToken(token) {\n return token.value === \"=>\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a comma token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a comma token.\n */\nexport function isCommaToken(token) {\n return token.value === \",\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a semicolon token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a semicolon token.\n */\nexport function isSemicolonToken(token) {\n return token.value === \";\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a colon token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a colon token.\n */\nexport function isColonToken(token) {\n return token.value === \":\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is an opening parenthesis token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening parenthesis token.\n */\nexport function isOpeningParenToken(token) {\n return token.value === \"(\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a closing parenthesis token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing parenthesis token.\n */\nexport function isClosingParenToken(token) {\n return token.value === \")\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is an opening square bracket token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening square bracket token.\n */\nexport function isOpeningBracketToken(token) {\n return token.value === \"[\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a closing square bracket token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing square bracket token.\n */\nexport function isClosingBracketToken(token) {\n return token.value === \"]\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is an opening brace token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening brace token.\n */\nexport function isOpeningBraceToken(token) {\n return token.value === \"{\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a closing brace token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing brace token.\n */\nexport function isClosingBraceToken(token) {\n return token.value === \"}\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a comment token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a comment token.\n */\nexport function isCommentToken(token) {\n return (\n token.type === \"Line\" ||\n token.type === \"Block\" ||\n token.type === \"Shebang\"\n )\n}\n\nexport const isNotArrowToken = negate(isArrowToken)\nexport const isNotCommaToken = negate(isCommaToken)\nexport const isNotSemicolonToken = negate(isSemicolonToken)\nexport const isNotColonToken = negate(isColonToken)\nexport const isNotOpeningParenToken = negate(isOpeningParenToken)\nexport const isNotClosingParenToken = negate(isClosingParenToken)\nexport const isNotOpeningBracketToken = negate(isOpeningBracketToken)\nexport const isNotClosingBracketToken = negate(isClosingBracketToken)\nexport const isNotOpeningBraceToken = negate(isOpeningBraceToken)\nexport const isNotClosingBraceToken = negate(isClosingBraceToken)\nexport const isNotCommentToken = negate(isCommentToken)\n","import { isArrowToken, isOpeningParenToken } from \"./token-predicate\"\n\n/**\n * Get the `(` token of the given function node.\n * @param {Node} node - The function node to get.\n * @param {SourceCode} sourceCode - The source code object to get tokens.\n * @returns {Token} `(` token.\n */\nfunction getOpeningParenOfParams(node, sourceCode) {\n return node.id\n ? sourceCode.getTokenAfter(node.id, isOpeningParenToken)\n : sourceCode.getFirstToken(node, isOpeningParenToken)\n}\n\n/**\n * Get the location of the given function node for reporting.\n * @param {Node} node - The function node to get.\n * @param {SourceCode} sourceCode - The source code object to get tokens.\n * @returns {string} The location of the function node for reporting.\n */\nexport function getFunctionHeadLocation(node, sourceCode) {\n const parent = node.parent\n let start = null\n let end = null\n\n if (node.type === \"ArrowFunctionExpression\") {\n const arrowToken = sourceCode.getTokenBefore(node.body, isArrowToken)\n\n start = arrowToken.loc.start\n end = arrowToken.loc.end\n } else if (\n parent.type === \"Property\" ||\n parent.type === \"MethodDefinition\"\n ) {\n start = parent.loc.start\n end = getOpeningParenOfParams(node, sourceCode).loc.start\n } else {\n start = node.loc.start\n end = getOpeningParenOfParams(node, sourceCode).loc.start\n }\n\n return {\n start: Object.assign({}, start),\n end: Object.assign({}, end),\n }\n}\n","/* globals BigInt, globalThis, global, self, window */\n\nimport { findVariable } from \"./find-variable\"\n\nconst globalObject =\n typeof globalThis !== \"undefined\"\n ? globalThis\n : typeof self !== \"undefined\"\n ? self\n : typeof window !== \"undefined\"\n ? window\n : typeof global !== \"undefined\"\n ? global\n : {}\n\nconst builtinNames = Object.freeze(\n new Set([\n \"Array\",\n \"ArrayBuffer\",\n \"BigInt\",\n \"BigInt64Array\",\n \"BigUint64Array\",\n \"Boolean\",\n \"DataView\",\n \"Date\",\n \"decodeURI\",\n \"decodeURIComponent\",\n \"encodeURI\",\n \"encodeURIComponent\",\n \"escape\",\n \"Float32Array\",\n \"Float64Array\",\n \"Function\",\n \"Infinity\",\n \"Int16Array\",\n \"Int32Array\",\n \"Int8Array\",\n \"isFinite\",\n \"isNaN\",\n \"isPrototypeOf\",\n \"JSON\",\n \"Map\",\n \"Math\",\n \"NaN\",\n \"Number\",\n \"Object\",\n \"parseFloat\",\n \"parseInt\",\n \"Promise\",\n \"Proxy\",\n \"Reflect\",\n \"RegExp\",\n \"Set\",\n \"String\",\n \"Symbol\",\n \"Uint16Array\",\n \"Uint32Array\",\n \"Uint8Array\",\n \"Uint8ClampedArray\",\n \"undefined\",\n \"unescape\",\n \"WeakMap\",\n \"WeakSet\",\n ])\n)\nconst callAllowed = new Set(\n [\n Array.isArray,\n typeof BigInt === \"function\" ? BigInt : undefined,\n Boolean,\n Date,\n Date.parse,\n decodeURI,\n decodeURIComponent,\n encodeURI,\n encodeURIComponent,\n escape,\n isFinite,\n isNaN,\n isPrototypeOf,\n ...Object.getOwnPropertyNames(Math)\n .map(k => Math[k])\n .filter(f => typeof f === \"function\"),\n Number,\n Number.isFinite,\n Number.isNaN,\n Number.parseFloat,\n Number.parseInt,\n Object,\n Object.entries,\n Object.is,\n Object.isExtensible,\n Object.isFrozen,\n Object.isSealed,\n Object.keys,\n Object.values,\n parseFloat,\n parseInt,\n RegExp,\n String,\n String.fromCharCode,\n String.fromCodePoint,\n String.raw,\n Symbol,\n Symbol.for,\n Symbol.keyFor,\n unescape,\n ].filter(f => typeof f === \"function\")\n)\nconst callPassThrough = new Set([\n Object.freeze,\n Object.preventExtensions,\n Object.seal,\n])\n\n/**\n * Get the property descriptor.\n * @param {object} object The object to get.\n * @param {string|number|symbol} name The property name to get.\n */\nfunction getPropertyDescriptor(object, name) {\n let x = object\n while ((typeof x === \"object\" || typeof x === \"function\") && x !== null) {\n const d = Object.getOwnPropertyDescriptor(x, name)\n if (d) {\n return d\n }\n x = Object.getPrototypeOf(x)\n }\n return null\n}\n\n/**\n * Check if a property is getter or not.\n * @param {object} object The object to check.\n * @param {string|number|symbol} name The property name to check.\n */\nfunction isGetter(object, name) {\n const d = getPropertyDescriptor(object, name)\n return d != null && d.get != null\n}\n\n/**\n * Get the element values of a given node list.\n * @param {Node[]} nodeList The node list to get values.\n * @param {Scope|undefined} initialScope The initial scope to find variables.\n * @returns {any[]|null} The value list if all nodes are constant. Otherwise, null.\n */\nfunction getElementValues(nodeList, initialScope) {\n const valueList = []\n\n for (let i = 0; i < nodeList.length; ++i) {\n const elementNode = nodeList[i]\n\n if (elementNode == null) {\n valueList.length = i + 1\n } else if (elementNode.type === \"SpreadElement\") {\n const argument = getStaticValueR(elementNode.argument, initialScope)\n if (argument == null) {\n return null\n }\n valueList.push(...argument.value)\n } else {\n const element = getStaticValueR(elementNode, initialScope)\n if (element == null) {\n return null\n }\n valueList.push(element.value)\n }\n }\n\n return valueList\n}\n\nconst operations = Object.freeze({\n ArrayExpression(node, initialScope) {\n const elements = getElementValues(node.elements, initialScope)\n return elements != null ? { value: elements } : null\n },\n\n AssignmentExpression(node, initialScope) {\n if (node.operator === \"=\") {\n return getStaticValueR(node.right, initialScope)\n }\n return null\n },\n\n //eslint-disable-next-line complexity\n BinaryExpression(node, initialScope) {\n if (node.operator === \"in\" || node.operator === \"instanceof\") {\n // Not supported.\n return null\n }\n\n const left = getStaticValueR(node.left, initialScope)\n const right = getStaticValueR(node.right, initialScope)\n if (left != null && right != null) {\n switch (node.operator) {\n case \"==\":\n return { value: left.value == right.value } //eslint-disable-line eqeqeq\n case \"!=\":\n return { value: left.value != right.value } //eslint-disable-line eqeqeq\n case \"===\":\n return { value: left.value === right.value }\n case \"!==\":\n return { value: left.value !== right.value }\n case \"<\":\n return { value: left.value < right.value }\n case \"<=\":\n return { value: left.value <= right.value }\n case \">\":\n return { value: left.value > right.value }\n case \">=\":\n return { value: left.value >= right.value }\n case \"<<\":\n return { value: left.value << right.value }\n case \">>\":\n return { value: left.value >> right.value }\n case \">>>\":\n return { value: left.value >>> right.value }\n case \"+\":\n return { value: left.value + right.value }\n case \"-\":\n return { value: left.value - right.value }\n case \"*\":\n return { value: left.value * right.value }\n case \"/\":\n return { value: left.value / right.value }\n case \"%\":\n return { value: left.value % right.value }\n case \"**\":\n return { value: Math.pow(left.value, right.value) }\n case \"|\":\n return { value: left.value | right.value }\n case \"^\":\n return { value: left.value ^ right.value }\n case \"&\":\n return { value: left.value & right.value }\n\n // no default\n }\n }\n\n return null\n },\n\n CallExpression(node, initialScope) {\n const calleeNode = node.callee\n const args = getElementValues(node.arguments, initialScope)\n\n if (args != null) {\n if (calleeNode.type === \"MemberExpression\") {\n const object = getStaticValueR(calleeNode.object, initialScope)\n if (object != null) {\n if (\n object.value == null &&\n (object.optional || node.optional)\n ) {\n return { value: undefined, optional: true }\n }\n const property = calleeNode.computed\n ? getStaticValueR(calleeNode.property, initialScope)\n : { value: calleeNode.property.name }\n\n if (property != null) {\n const receiver = object.value\n const methodName = property.value\n if (callAllowed.has(receiver[methodName])) {\n return { value: receiver[methodName](...args) }\n }\n if (callPassThrough.has(receiver[methodName])) {\n return { value: args[0] }\n }\n }\n }\n } else {\n const callee = getStaticValueR(calleeNode, initialScope)\n if (callee != null) {\n if (callee.value == null && node.optional) {\n return { value: undefined, optional: true }\n }\n const func = callee.value\n if (callAllowed.has(func)) {\n return { value: func(...args) }\n }\n if (callPassThrough.has(func)) {\n return { value: args[0] }\n }\n }\n }\n }\n\n return null\n },\n\n ConditionalExpression(node, initialScope) {\n const test = getStaticValueR(node.test, initialScope)\n if (test != null) {\n return test.value\n ? getStaticValueR(node.consequent, initialScope)\n : getStaticValueR(node.alternate, initialScope)\n }\n return null\n },\n\n ExpressionStatement(node, initialScope) {\n return getStaticValueR(node.expression, initialScope)\n },\n\n Identifier(node, initialScope) {\n if (initialScope != null) {\n const variable = findVariable(initialScope, node)\n\n // Built-in globals.\n if (\n variable != null &&\n variable.defs.length === 0 &&\n builtinNames.has(variable.name) &&\n variable.name in globalObject\n ) {\n return { value: globalObject[variable.name] }\n }\n\n // Constants.\n if (variable != null && variable.defs.length === 1) {\n const def = variable.defs[0]\n if (\n def.parent &&\n def.parent.kind === \"const\" &&\n // TODO(mysticatea): don't support destructuring here.\n def.node.id.type === \"Identifier\"\n ) {\n return getStaticValueR(def.node.init, initialScope)\n }\n }\n }\n return null\n },\n\n Literal(node) {\n //istanbul ignore if : this is implementation-specific behavior.\n if ((node.regex != null || node.bigint != null) && node.value == null) {\n // It was a RegExp/BigInt literal, but Node.js didn't support it.\n return null\n }\n return { value: node.value }\n },\n\n LogicalExpression(node, initialScope) {\n const left = getStaticValueR(node.left, initialScope)\n if (left != null) {\n if (\n (node.operator === \"||\" && Boolean(left.value) === true) ||\n (node.operator === \"&&\" && Boolean(left.value) === false) ||\n (node.operator === \"??\" && left.value != null)\n ) {\n return left\n }\n\n const right = getStaticValueR(node.right, initialScope)\n if (right != null) {\n return right\n }\n }\n\n return null\n },\n\n MemberExpression(node, initialScope) {\n const object = getStaticValueR(node.object, initialScope)\n if (object != null) {\n if (object.value == null && (object.optional || node.optional)) {\n return { value: undefined, optional: true }\n }\n const property = node.computed\n ? getStaticValueR(node.property, initialScope)\n : { value: node.property.name }\n\n if (property != null && !isGetter(object.value, property.value)) {\n return { value: object.value[property.value] }\n }\n }\n return null\n },\n\n ChainExpression(node, initialScope) {\n const expression = getStaticValueR(node.expression, initialScope)\n if (expression != null) {\n return { value: expression.value }\n }\n return null\n },\n\n NewExpression(node, initialScope) {\n const callee = getStaticValueR(node.callee, initialScope)\n const args = getElementValues(node.arguments, initialScope)\n\n if (callee != null && args != null) {\n const Func = callee.value\n if (callAllowed.has(Func)) {\n return { value: new Func(...args) }\n }\n }\n\n return null\n },\n\n ObjectExpression(node, initialScope) {\n const object = {}\n\n for (const propertyNode of node.properties) {\n if (propertyNode.type === \"Property\") {\n if (propertyNode.kind !== \"init\") {\n return null\n }\n const key = propertyNode.computed\n ? getStaticValueR(propertyNode.key, initialScope)\n : { value: propertyNode.key.name }\n const value = getStaticValueR(propertyNode.value, initialScope)\n if (key == null || value == null) {\n return null\n }\n object[key.value] = value.value\n } else if (\n propertyNode.type === \"SpreadElement\" ||\n propertyNode.type === \"ExperimentalSpreadProperty\"\n ) {\n const argument = getStaticValueR(\n propertyNode.argument,\n initialScope\n )\n if (argument == null) {\n return null\n }\n Object.assign(object, argument.value)\n } else {\n return null\n }\n }\n\n return { value: object }\n },\n\n SequenceExpression(node, initialScope) {\n const last = node.expressions[node.expressions.length - 1]\n return getStaticValueR(last, initialScope)\n },\n\n TaggedTemplateExpression(node, initialScope) {\n const tag = getStaticValueR(node.tag, initialScope)\n const expressions = getElementValues(\n node.quasi.expressions,\n initialScope\n )\n\n if (tag != null && expressions != null) {\n const func = tag.value\n const strings = node.quasi.quasis.map(q => q.value.cooked)\n strings.raw = node.quasi.quasis.map(q => q.value.raw)\n\n if (func === String.raw) {\n return { value: func(strings, ...expressions) }\n }\n }\n\n return null\n },\n\n TemplateLiteral(node, initialScope) {\n const expressions = getElementValues(node.expressions, initialScope)\n if (expressions != null) {\n let value = node.quasis[0].value.cooked\n for (let i = 0; i < expressions.length; ++i) {\n value += expressions[i]\n value += node.quasis[i + 1].value.cooked\n }\n return { value }\n }\n return null\n },\n\n UnaryExpression(node, initialScope) {\n if (node.operator === \"delete\") {\n // Not supported.\n return null\n }\n if (node.operator === \"void\") {\n return { value: undefined }\n }\n\n const arg = getStaticValueR(node.argument, initialScope)\n if (arg != null) {\n switch (node.operator) {\n case \"-\":\n return { value: -arg.value }\n case \"+\":\n return { value: +arg.value } //eslint-disable-line no-implicit-coercion\n case \"!\":\n return { value: !arg.value }\n case \"~\":\n return { value: ~arg.value }\n case \"typeof\":\n return { value: typeof arg.value }\n\n // no default\n }\n }\n\n return null\n },\n})\n\n/**\n * Get the value of a given node if it's a static value.\n * @param {Node} node The node to get.\n * @param {Scope|undefined} initialScope The scope to start finding variable.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`.\n */\nfunction getStaticValueR(node, initialScope) {\n if (node != null && Object.hasOwnProperty.call(operations, node.type)) {\n return operations[node.type](node, initialScope)\n }\n return null\n}\n\n/**\n * Get the value of a given node if it's a static value.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If this scope was given, this tries to resolve identifier references which are in the given node as much as possible.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`.\n */\nexport function getStaticValue(node, initialScope = null) {\n try {\n return getStaticValueR(node, initialScope)\n } catch (_error) {\n return null\n }\n}\n","import { getStaticValue } from \"./get-static-value\"\n\n/**\n * Get the value of a given node if it's a literal or a template literal.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is an Identifier node and this scope was given, this checks the variable of the identifier, and returns the value of it if the variable is a constant.\n * @returns {string|null} The value of the node, or `null`.\n */\nexport function getStringIfConstant(node, initialScope = null) {\n // Handle the literals that the platform doesn't support natively.\n if (node && node.type === \"Literal\" && node.value === null) {\n if (node.regex) {\n return `/${node.regex.pattern}/${node.regex.flags}`\n }\n if (node.bigint) {\n return node.bigint\n }\n }\n\n const evaluated = getStaticValue(node, initialScope)\n return evaluated && String(evaluated.value)\n}\n","import { getStringIfConstant } from \"./get-string-if-constant\"\n\n/**\n * Get the property name from a MemberExpression node or a Property node.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.\n * @returns {string|null} The property name of the node.\n */\nexport function getPropertyName(node, initialScope) {\n switch (node.type) {\n case \"MemberExpression\":\n if (node.computed) {\n return getStringIfConstant(node.property, initialScope)\n }\n return node.property.name\n\n case \"Property\":\n case \"MethodDefinition\":\n if (node.computed) {\n return getStringIfConstant(node.key, initialScope)\n }\n if (node.key.type === \"Literal\") {\n return String(node.key.value)\n }\n return node.key.name\n\n // no default\n }\n\n return null\n}\n","import { getPropertyName } from \"./get-property-name\"\n\n/**\n * Get the name and kind of the given function node.\n * @param {ASTNode} node - The function node to get.\n * @returns {string} The name and kind of the function node.\n */\nexport function getFunctionNameWithKind(node) {\n const parent = node.parent\n const tokens = []\n\n if (parent.type === \"MethodDefinition\" && parent.static) {\n tokens.push(\"static\")\n }\n if (node.async) {\n tokens.push(\"async\")\n }\n if (node.generator) {\n tokens.push(\"generator\")\n }\n\n if (node.type === \"ArrowFunctionExpression\") {\n tokens.push(\"arrow\", \"function\")\n } else if (\n parent.type === \"Property\" ||\n parent.type === \"MethodDefinition\"\n ) {\n if (parent.kind === \"constructor\") {\n return \"constructor\"\n }\n if (parent.kind === \"get\") {\n tokens.push(\"getter\")\n } else if (parent.kind === \"set\") {\n tokens.push(\"setter\")\n } else {\n tokens.push(\"method\")\n }\n } else {\n tokens.push(\"function\")\n }\n\n if (node.id) {\n tokens.push(`'${node.id.name}'`)\n } else {\n const name = getPropertyName(parent)\n\n if (name) {\n tokens.push(`'${name}'`)\n }\n }\n\n if (node.type === \"ArrowFunctionExpression\") {\n if (\n parent.type === \"VariableDeclarator\" &&\n parent.id &&\n parent.id.type === \"Identifier\"\n ) {\n tokens.push(`'${parent.id.name}'`)\n }\n if (\n parent.type === \"AssignmentExpression\" &&\n parent.left &&\n parent.left.type === \"Identifier\"\n ) {\n tokens.push(`'${parent.left.name}'`)\n }\n }\n\n return tokens.join(\" \")\n}\n","import evk from \"eslint-visitor-keys\"\n\nconst typeConversionBinaryOps = Object.freeze(\n new Set([\n \"==\",\n \"!=\",\n \"<\",\n \"<=\",\n \">\",\n \">=\",\n \"<<\",\n \">>\",\n \">>>\",\n \"+\",\n \"-\",\n \"*\",\n \"/\",\n \"%\",\n \"|\",\n \"^\",\n \"&\",\n \"in\",\n ])\n)\nconst typeConversionUnaryOps = Object.freeze(new Set([\"-\", \"+\", \"!\", \"~\"]))\n\n/**\n * Check whether the given value is an ASTNode or not.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is an ASTNode.\n */\nfunction isNode(x) {\n return x !== null && typeof x === \"object\" && typeof x.type === \"string\"\n}\n\nconst visitor = Object.freeze(\n Object.assign(Object.create(null), {\n $visit(node, options, visitorKeys) {\n const { type } = node\n\n if (typeof this[type] === \"function\") {\n return this[type](node, options, visitorKeys)\n }\n\n return this.$visitChildren(node, options, visitorKeys)\n },\n\n $visitChildren(node, options, visitorKeys) {\n const { type } = node\n\n for (const key of visitorKeys[type] || evk.getKeys(node)) {\n const value = node[key]\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (\n isNode(element) &&\n this.$visit(element, options, visitorKeys)\n ) {\n return true\n }\n }\n } else if (\n isNode(value) &&\n this.$visit(value, options, visitorKeys)\n ) {\n return true\n }\n }\n\n return false\n },\n\n ArrowFunctionExpression() {\n return false\n },\n AssignmentExpression() {\n return true\n },\n AwaitExpression() {\n return true\n },\n BinaryExpression(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n typeConversionBinaryOps.has(node.operator) &&\n (node.left.type !== \"Literal\" || node.right.type !== \"Literal\")\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n CallExpression() {\n return true\n },\n FunctionExpression() {\n return false\n },\n ImportExpression() {\n return true\n },\n MemberExpression(node, options, visitorKeys) {\n if (options.considerGetters) {\n return true\n }\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.property.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n MethodDefinition(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n NewExpression() {\n return true\n },\n Property(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n UnaryExpression(node, options, visitorKeys) {\n if (node.operator === \"delete\") {\n return true\n }\n if (\n options.considerImplicitTypeConversion &&\n typeConversionUnaryOps.has(node.operator) &&\n node.argument.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n UpdateExpression() {\n return true\n },\n YieldExpression() {\n return true\n },\n })\n)\n\n/**\n * Check whether a given node has any side effect or not.\n * @param {Node} node The node to get.\n * @param {SourceCode} sourceCode The source code object.\n * @param {object} [options] The option object.\n * @param {boolean} [options.considerGetters=false] If `true` then it considers member accesses as the node which has side effects.\n * @param {boolean} [options.considerImplicitTypeConversion=false] If `true` then it considers implicit type conversion as the node which has side effects.\n * @param {object} [options.visitorKeys=evk.KEYS] The keys to traverse nodes. Use `context.getSourceCode().visitorKeys`.\n * @returns {boolean} `true` if the node has a certain side effect.\n */\nexport function hasSideEffect(\n node,\n sourceCode,\n { considerGetters = false, considerImplicitTypeConversion = false } = {}\n) {\n return visitor.$visit(\n node,\n { considerGetters, considerImplicitTypeConversion },\n sourceCode.visitorKeys || evk.KEYS\n )\n}\n","import { isClosingParenToken, isOpeningParenToken } from \"./token-predicate\"\n\n/**\n * Get the left parenthesis of the parent node syntax if it exists.\n * E.g., `if (a) {}` then the `(`.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {Token|null} The left parenthesis of the parent node syntax\n */\nfunction getParentSyntaxParen(node, sourceCode) {\n const parent = node.parent\n\n switch (parent.type) {\n case \"CallExpression\":\n case \"NewExpression\":\n if (parent.arguments.length === 1 && parent.arguments[0] === node) {\n return sourceCode.getTokenAfter(\n parent.callee,\n isOpeningParenToken\n )\n }\n return null\n\n case \"DoWhileStatement\":\n if (parent.test === node) {\n return sourceCode.getTokenAfter(\n parent.body,\n isOpeningParenToken\n )\n }\n return null\n\n case \"IfStatement\":\n case \"WhileStatement\":\n if (parent.test === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"ImportExpression\":\n if (parent.source === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"SwitchStatement\":\n if (parent.discriminant === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"WithStatement\":\n if (parent.object === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n default:\n return null\n }\n}\n\n/**\n * Check whether a given node is parenthesized or not.\n * @param {number} times The number of parantheses.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {boolean} `true` if the node is parenthesized the given times.\n */\n/**\n * Check whether a given node is parenthesized or not.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {boolean} `true` if the node is parenthesized.\n */\nexport function isParenthesized(\n timesOrNode,\n nodeOrSourceCode,\n optionalSourceCode\n) {\n let times, node, sourceCode, maybeLeftParen, maybeRightParen\n if (typeof timesOrNode === \"number\") {\n times = timesOrNode | 0\n node = nodeOrSourceCode\n sourceCode = optionalSourceCode\n if (!(times >= 1)) {\n throw new TypeError(\"'times' should be a positive integer.\")\n }\n } else {\n times = 1\n node = timesOrNode\n sourceCode = nodeOrSourceCode\n }\n\n if (node == null) {\n return false\n }\n\n maybeLeftParen = maybeRightParen = node\n do {\n maybeLeftParen = sourceCode.getTokenBefore(maybeLeftParen)\n maybeRightParen = sourceCode.getTokenAfter(maybeRightParen)\n } while (\n maybeLeftParen != null &&\n maybeRightParen != null &&\n isOpeningParenToken(maybeLeftParen) &&\n isClosingParenToken(maybeRightParen) &&\n // Avoid false positive such as `if (a) {}`\n maybeLeftParen !== getParentSyntaxParen(node, sourceCode) &&\n --times > 0\n )\n\n return times === 0\n}\n","/**\n * @author Toru Nagashima \n * See LICENSE file in root directory for full license.\n */\n\nconst placeholder = /\\$(?:[$&`']|[1-9][0-9]?)/gu\n\n/** @type {WeakMap} */\nconst internal = new WeakMap()\n\n/**\n * Check whether a given character is escaped or not.\n * @param {string} str The string to check.\n * @param {number} index The location of the character to check.\n * @returns {boolean} `true` if the character is escaped.\n */\nfunction isEscaped(str, index) {\n let escaped = false\n for (let i = index - 1; i >= 0 && str.charCodeAt(i) === 0x5c; --i) {\n escaped = !escaped\n }\n return escaped\n}\n\n/**\n * Replace a given string by a given matcher.\n * @param {PatternMatcher} matcher The pattern matcher.\n * @param {string} str The string to be replaced.\n * @param {string} replacement The new substring to replace each matched part.\n * @returns {string} The replaced string.\n */\nfunction replaceS(matcher, str, replacement) {\n const chunks = []\n let index = 0\n\n /** @type {RegExpExecArray} */\n let match = null\n\n /**\n * @param {string} key The placeholder.\n * @returns {string} The replaced string.\n */\n function replacer(key) {\n switch (key) {\n case \"$$\":\n return \"$\"\n case \"$&\":\n return match[0]\n case \"$`\":\n return str.slice(0, match.index)\n case \"$'\":\n return str.slice(match.index + match[0].length)\n default: {\n const i = key.slice(1)\n if (i in match) {\n return match[i]\n }\n return key\n }\n }\n }\n\n for (match of matcher.execAll(str)) {\n chunks.push(str.slice(index, match.index))\n chunks.push(replacement.replace(placeholder, replacer))\n index = match.index + match[0].length\n }\n chunks.push(str.slice(index))\n\n return chunks.join(\"\")\n}\n\n/**\n * Replace a given string by a given matcher.\n * @param {PatternMatcher} matcher The pattern matcher.\n * @param {string} str The string to be replaced.\n * @param {(...strs[])=>string} replace The function to replace each matched part.\n * @returns {string} The replaced string.\n */\nfunction replaceF(matcher, str, replace) {\n const chunks = []\n let index = 0\n\n for (const match of matcher.execAll(str)) {\n chunks.push(str.slice(index, match.index))\n chunks.push(String(replace(...match, match.index, match.input)))\n index = match.index + match[0].length\n }\n chunks.push(str.slice(index))\n\n return chunks.join(\"\")\n}\n\n/**\n * The class to find patterns as considering escape sequences.\n */\nexport class PatternMatcher {\n /**\n * Initialize this matcher.\n * @param {RegExp} pattern The pattern to match.\n * @param {{escaped:boolean}} options The options.\n */\n constructor(pattern, { escaped = false } = {}) {\n if (!(pattern instanceof RegExp)) {\n throw new TypeError(\"'pattern' should be a RegExp instance.\")\n }\n if (!pattern.flags.includes(\"g\")) {\n throw new Error(\"'pattern' should contains 'g' flag.\")\n }\n\n internal.set(this, {\n pattern: new RegExp(pattern.source, pattern.flags),\n escaped: Boolean(escaped),\n })\n }\n\n /**\n * Find the pattern in a given string.\n * @param {string} str The string to find.\n * @returns {IterableIterator} The iterator which iterate the matched information.\n */\n *execAll(str) {\n const { pattern, escaped } = internal.get(this)\n let match = null\n let lastIndex = 0\n\n pattern.lastIndex = 0\n while ((match = pattern.exec(str)) != null) {\n if (escaped || !isEscaped(str, match.index)) {\n lastIndex = pattern.lastIndex\n yield match\n pattern.lastIndex = lastIndex\n }\n }\n }\n\n /**\n * Check whether the pattern is found in a given string.\n * @param {string} str The string to check.\n * @returns {boolean} `true` if the pattern was found in the string.\n */\n test(str) {\n const it = this.execAll(str)\n const ret = it.next()\n return !ret.done\n }\n\n /**\n * Replace a given string.\n * @param {string} str The string to be replaced.\n * @param {(string|((...strs:string[])=>string))} replacer The string or function to replace. This is the same as the 2nd argument of `String.prototype.replace`.\n * @returns {string} The replaced string.\n */\n [Symbol.replace](str, replacer) {\n return typeof replacer === \"function\"\n ? replaceF(this, String(str), replacer)\n : replaceS(this, String(str), String(replacer))\n }\n}\n","import { findVariable } from \"./find-variable\"\nimport { getPropertyName } from \"./get-property-name\"\nimport { getStringIfConstant } from \"./get-string-if-constant\"\n\nconst IMPORT_TYPE = /^(?:Import|Export(?:All|Default|Named))Declaration$/u\nconst has = Function.call.bind(Object.hasOwnProperty)\n\nexport const READ = Symbol(\"read\")\nexport const CALL = Symbol(\"call\")\nexport const CONSTRUCT = Symbol(\"construct\")\nexport const ESM = Symbol(\"esm\")\n\nconst requireCall = { require: { [CALL]: true } }\n\n/**\n * Check whether a given variable is modified or not.\n * @param {Variable} variable The variable to check.\n * @returns {boolean} `true` if the variable is modified.\n */\nfunction isModifiedGlobal(variable) {\n return (\n variable == null ||\n variable.defs.length !== 0 ||\n variable.references.some(r => r.isWrite())\n )\n}\n\n/**\n * Check if the value of a given node is passed through to the parent syntax as-is.\n * For example, `a` and `b` in (`a || b` and `c ? a : b`) are passed through.\n * @param {Node} node A node to check.\n * @returns {boolean} `true` if the node is passed through.\n */\nfunction isPassThrough(node) {\n const parent = node.parent\n\n switch (parent && parent.type) {\n case \"ConditionalExpression\":\n return parent.consequent === node || parent.alternate === node\n case \"LogicalExpression\":\n return true\n case \"SequenceExpression\":\n return parent.expressions[parent.expressions.length - 1] === node\n case \"ChainExpression\":\n return true\n\n default:\n return false\n }\n}\n\n/**\n * The reference tracker.\n */\nexport class ReferenceTracker {\n /**\n * Initialize this tracker.\n * @param {Scope} globalScope The global scope.\n * @param {object} [options] The options.\n * @param {\"legacy\"|\"strict\"} [options.mode=\"strict\"] The mode to determine the ImportDeclaration's behavior for CJS modules.\n * @param {string[]} [options.globalObjectNames=[\"global\",\"globalThis\",\"self\",\"window\"]] The variable names for Global Object.\n */\n constructor(\n globalScope,\n {\n mode = \"strict\",\n globalObjectNames = [\"global\", \"globalThis\", \"self\", \"window\"],\n } = {}\n ) {\n this.variableStack = []\n this.globalScope = globalScope\n this.mode = mode\n this.globalObjectNames = globalObjectNames.slice(0)\n }\n\n /**\n * Iterate the references of global variables.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateGlobalReferences(traceMap) {\n for (const key of Object.keys(traceMap)) {\n const nextTraceMap = traceMap[key]\n const path = [key]\n const variable = this.globalScope.set.get(key)\n\n if (isModifiedGlobal(variable)) {\n continue\n }\n\n yield* this._iterateVariableReferences(\n variable,\n path,\n nextTraceMap,\n true\n )\n }\n\n for (const key of this.globalObjectNames) {\n const path = []\n const variable = this.globalScope.set.get(key)\n\n if (isModifiedGlobal(variable)) {\n continue\n }\n\n yield* this._iterateVariableReferences(\n variable,\n path,\n traceMap,\n false\n )\n }\n }\n\n /**\n * Iterate the references of CommonJS modules.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateCjsReferences(traceMap) {\n for (const { node } of this.iterateGlobalReferences(requireCall)) {\n const key = getStringIfConstant(node.arguments[0])\n if (key == null || !has(traceMap, key)) {\n continue\n }\n\n const nextTraceMap = traceMap[key]\n const path = [key]\n\n if (nextTraceMap[READ]) {\n yield {\n node,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iteratePropertyReferences(node, path, nextTraceMap)\n }\n }\n\n /**\n * Iterate the references of ES modules.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateEsmReferences(traceMap) {\n const programNode = this.globalScope.block\n\n for (const node of programNode.body) {\n if (!IMPORT_TYPE.test(node.type) || node.source == null) {\n continue\n }\n const moduleId = node.source.value\n\n if (!has(traceMap, moduleId)) {\n continue\n }\n const nextTraceMap = traceMap[moduleId]\n const path = [moduleId]\n\n if (nextTraceMap[READ]) {\n yield { node, path, type: READ, info: nextTraceMap[READ] }\n }\n\n if (node.type === \"ExportAllDeclaration\") {\n for (const key of Object.keys(nextTraceMap)) {\n const exportTraceMap = nextTraceMap[key]\n if (exportTraceMap[READ]) {\n yield {\n node,\n path: path.concat(key),\n type: READ,\n info: exportTraceMap[READ],\n }\n }\n }\n } else {\n for (const specifier of node.specifiers) {\n const esm = has(nextTraceMap, ESM)\n const it = this._iterateImportReferences(\n specifier,\n path,\n esm\n ? nextTraceMap\n : this.mode === \"legacy\"\n ? Object.assign(\n { default: nextTraceMap },\n nextTraceMap\n )\n : { default: nextTraceMap }\n )\n\n if (esm) {\n yield* it\n } else {\n for (const report of it) {\n report.path = report.path.filter(exceptDefault)\n if (\n report.path.length >= 2 ||\n report.type !== READ\n ) {\n yield report\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Iterate the references for a given variable.\n * @param {Variable} variable The variable to iterate that references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @param {boolean} shouldReport = The flag to report those references.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateVariableReferences(variable, path, traceMap, shouldReport) {\n if (this.variableStack.includes(variable)) {\n return\n }\n this.variableStack.push(variable)\n try {\n for (const reference of variable.references) {\n if (!reference.isRead()) {\n continue\n }\n const node = reference.identifier\n\n if (shouldReport && traceMap[READ]) {\n yield { node, path, type: READ, info: traceMap[READ] }\n }\n yield* this._iteratePropertyReferences(node, path, traceMap)\n }\n } finally {\n this.variableStack.pop()\n }\n }\n\n /**\n * Iterate the references for a given AST node.\n * @param rootNode The AST node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n //eslint-disable-next-line complexity\n *_iteratePropertyReferences(rootNode, path, traceMap) {\n let node = rootNode\n while (isPassThrough(node)) {\n node = node.parent\n }\n\n const parent = node.parent\n if (parent.type === \"MemberExpression\") {\n if (parent.object === node) {\n const key = getPropertyName(parent)\n if (key == null || !has(traceMap, key)) {\n return\n }\n\n path = path.concat(key) //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: parent,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iteratePropertyReferences(\n parent,\n path,\n nextTraceMap\n )\n }\n return\n }\n if (parent.type === \"CallExpression\") {\n if (parent.callee === node && traceMap[CALL]) {\n yield { node: parent, path, type: CALL, info: traceMap[CALL] }\n }\n return\n }\n if (parent.type === \"NewExpression\") {\n if (parent.callee === node && traceMap[CONSTRUCT]) {\n yield {\n node: parent,\n path,\n type: CONSTRUCT,\n info: traceMap[CONSTRUCT],\n }\n }\n return\n }\n if (parent.type === \"AssignmentExpression\") {\n if (parent.right === node) {\n yield* this._iterateLhsReferences(parent.left, path, traceMap)\n yield* this._iteratePropertyReferences(parent, path, traceMap)\n }\n return\n }\n if (parent.type === \"AssignmentPattern\") {\n if (parent.right === node) {\n yield* this._iterateLhsReferences(parent.left, path, traceMap)\n }\n return\n }\n if (parent.type === \"VariableDeclarator\") {\n if (parent.init === node) {\n yield* this._iterateLhsReferences(parent.id, path, traceMap)\n }\n }\n }\n\n /**\n * Iterate the references for a given Pattern node.\n * @param {Node} patternNode The Pattern node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateLhsReferences(patternNode, path, traceMap) {\n if (patternNode.type === \"Identifier\") {\n const variable = findVariable(this.globalScope, patternNode)\n if (variable != null) {\n yield* this._iterateVariableReferences(\n variable,\n path,\n traceMap,\n false\n )\n }\n return\n }\n if (patternNode.type === \"ObjectPattern\") {\n for (const property of patternNode.properties) {\n const key = getPropertyName(property)\n\n if (key == null || !has(traceMap, key)) {\n continue\n }\n\n const nextPath = path.concat(key)\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: property,\n path: nextPath,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iterateLhsReferences(\n property.value,\n nextPath,\n nextTraceMap\n )\n }\n return\n }\n if (patternNode.type === \"AssignmentPattern\") {\n yield* this._iterateLhsReferences(patternNode.left, path, traceMap)\n }\n }\n\n /**\n * Iterate the references for a given ModuleSpecifier node.\n * @param {Node} specifierNode The ModuleSpecifier node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateImportReferences(specifierNode, path, traceMap) {\n const type = specifierNode.type\n\n if (type === \"ImportSpecifier\" || type === \"ImportDefaultSpecifier\") {\n const key =\n type === \"ImportDefaultSpecifier\"\n ? \"default\"\n : specifierNode.imported.name\n if (!has(traceMap, key)) {\n return\n }\n\n path = path.concat(key) //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: specifierNode,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iterateVariableReferences(\n findVariable(this.globalScope, specifierNode.local),\n path,\n nextTraceMap,\n false\n )\n\n return\n }\n\n if (type === \"ImportNamespaceSpecifier\") {\n yield* this._iterateVariableReferences(\n findVariable(this.globalScope, specifierNode.local),\n path,\n traceMap,\n false\n )\n return\n }\n\n if (type === \"ExportSpecifier\") {\n const key = specifierNode.local.name\n if (!has(traceMap, key)) {\n return\n }\n\n path = path.concat(key) //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: specifierNode,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n }\n }\n}\n\nReferenceTracker.READ = READ\nReferenceTracker.CALL = CALL\nReferenceTracker.CONSTRUCT = CONSTRUCT\nReferenceTracker.ESM = ESM\n\n/**\n * This is a predicate function for Array#filter.\n * @param {string} name A name part.\n * @param {number} index The index of the name.\n * @returns {boolean} `false` if it's default.\n */\nfunction exceptDefault(name, index) {\n return !(index === 1 && name === \"default\")\n}\n","import { findVariable } from \"./find-variable\"\nimport { getFunctionHeadLocation } from \"./get-function-head-location\"\nimport { getFunctionNameWithKind } from \"./get-function-name-with-kind\"\nimport { getInnermostScope } from \"./get-innermost-scope\"\nimport { getPropertyName } from \"./get-property-name\"\nimport { getStaticValue } from \"./get-static-value\"\nimport { getStringIfConstant } from \"./get-string-if-constant\"\nimport { hasSideEffect } from \"./has-side-effect\"\nimport { isParenthesized } from \"./is-parenthesized\"\nimport { PatternMatcher } from \"./pattern-matcher\"\nimport {\n CALL,\n CONSTRUCT,\n ESM,\n READ,\n ReferenceTracker,\n} from \"./reference-tracker\"\nimport {\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isSemicolonToken,\n} from \"./token-predicate\"\n\nexport default {\n CALL,\n CONSTRUCT,\n ESM,\n findVariable,\n getFunctionHeadLocation,\n getFunctionNameWithKind,\n getInnermostScope,\n getPropertyName,\n getStaticValue,\n getStringIfConstant,\n hasSideEffect,\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isParenthesized,\n isSemicolonToken,\n PatternMatcher,\n READ,\n ReferenceTracker,\n}\nexport {\n CALL,\n CONSTRUCT,\n ESM,\n findVariable,\n getFunctionHeadLocation,\n getFunctionNameWithKind,\n getInnermostScope,\n getPropertyName,\n getStaticValue,\n getStringIfConstant,\n hasSideEffect,\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isParenthesized,\n isSemicolonToken,\n PatternMatcher,\n READ,\n ReferenceTracker,\n}\n"],"names":[],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,iBAAiB,CAAC,YAAY,EAAE,IAAI,EAAE;AACtD,IAAI,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAC;AAClC;AACA,IAAI,IAAI,KAAK,GAAG,aAAY;AAC5B,IAAI,IAAI,KAAK,GAAG,MAAK;AACrB,IAAI,GAAG;AACP,QAAQ,KAAK,GAAG,MAAK;AACrB,QAAQ,KA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iB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA,gBAAgB,CAAC,IAAI,GAAG,KAAI;AAC5B,gBAAgB,CAAC,IAAI,GAAG,KAAI;AAC5B,gBAAgB,CAAC,SAAS,GAAG,UAAS;AACtC,gBAAgB,CAAC,GAAG,GAAG,IAAG;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE;AACpC,IAAI,OAAO,EAAE,KAAK,KAAK,CAAC,IAAI,IAAI,KAAK,SAAS,CAAC;AAC/C,CAAC;;AC1ZD,YAAe;AACf,IAAI,IAAI;AACR,IAAI,SAAS;AACb,IAAI,GAAG;AACP,IAAI,YAAY;AAChB,IAAI,uBAAuB;AAC3B,IAAI,uBAAuB;AAC3B,IAAI,iBAAiB;AACrB,IAAI,eAAe;AACnB,IAAI,cAAc;AAClB,IAAI,mBAAmB;AACvB,IAAI,aAAa;AACjB,IAAI,YAAY;AAChB,IAAI,mBAAmB;AACvB,IAAI,qBAAqB;AACzB,IAAI,mBAAmB;AACvB,IAAI,YAAY;AAChB,IAAI,YAAY;AAChB,IAAI,cAAc;AAClB,IAAI,eAAe;AACnB,IAAI,sBAAsB;AAC1B,IAAI,wBAAwB;AAC5B,IAAI,sBAAsB;AAC1B,IAAI,eAAe;AACnB,IAAI,eAAe;AACnB,IAAI,iBAAiB;AACrB,IAAI,sBAAsB;AAC1B,IAAI,wBAAwB;AAC5B,IAAI,sBAAsB;AAC1B,IAAI,mBAAmB;AACvB,IAAI,mBAAmB;AACvB,IAAI,qBAAqB;AACzB,IAAI,mBAAmB;AACvB,IAAI,eAAe;AACnB,IAAI,gBAAgB;AACpB,IAAI,cAAc;AAClB,IAAI,IAAI;AACR,IAAI,gBAAgB;AACpB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/eslint-utils/index.mjs b/node_modules/eslint-utils/index.mjs new file mode 100644 index 000000000..6940337c8 --- /dev/null +++ b/node_modules/eslint-utils/index.mjs @@ -0,0 +1,1838 @@ +/*! @author Toru Nagashima */ +import evk from 'eslint-visitor-keys'; + +/** + * Get the innermost scope which contains a given location. + * @param {Scope} initialScope The initial scope to search. + * @param {Node} node The location to search. + * @returns {Scope} The innermost scope. + */ +function getInnermostScope(initialScope, node) { + const location = node.range[0]; + + let scope = initialScope; + let found = false; + do { + found = false; + for (const childScope of scope.childScopes) { + const range = childScope.block.range; + + if (range[0] <= location && location < range[1]) { + scope = childScope; + found = true; + break + } + } + } while (found) + + return scope +} + +/** + * Find the variable of a given name. + * @param {Scope} initialScope The scope to start finding. + * @param {string|Node} nameOrNode The variable name to find. If this is a Node object then it should be an Identifier node. + * @returns {Variable|null} The found variable or null. + */ +function findVariable(initialScope, nameOrNode) { + let name = ""; + let scope = initialScope; + + if (typeof nameOrNode === "string") { + name = nameOrNode; + } else { + name = nameOrNode.name; + scope = getInnermostScope(scope, nameOrNode); + } + + while (scope != null) { + const variable = scope.set.get(name); + if (variable != null) { + return variable + } + scope = scope.upper; + } + + return null +} + +/** + * Negate the result of `this` calling. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the result of `this(token)` is `false`. + */ +function negate0(token) { + return !this(token) //eslint-disable-line no-invalid-this +} + +/** + * Creates the negate function of the given function. + * @param {function(Token):boolean} f - The function to negate. + * @returns {function(Token):boolean} Negated function. + */ +function negate(f) { + return negate0.bind(f) +} + +/** + * Checks if the given token is an arrow token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is an arrow token. + */ +function isArrowToken(token) { + return token.value === "=>" && token.type === "Punctuator" +} + +/** + * Checks if the given token is a comma token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a comma token. + */ +function isCommaToken(token) { + return token.value === "," && token.type === "Punctuator" +} + +/** + * Checks if the given token is a semicolon token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a semicolon token. + */ +function isSemicolonToken(token) { + return token.value === ";" && token.type === "Punctuator" +} + +/** + * Checks if the given token is a colon token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a colon token. + */ +function isColonToken(token) { + return token.value === ":" && token.type === "Punctuator" +} + +/** + * Checks if the given token is an opening parenthesis token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is an opening parenthesis token. + */ +function isOpeningParenToken(token) { + return token.value === "(" && token.type === "Punctuator" +} + +/** + * Checks if the given token is a closing parenthesis token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a closing parenthesis token. + */ +function isClosingParenToken(token) { + return token.value === ")" && token.type === "Punctuator" +} + +/** + * Checks if the given token is an opening square bracket token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is an opening square bracket token. + */ +function isOpeningBracketToken(token) { + return token.value === "[" && token.type === "Punctuator" +} + +/** + * Checks if the given token is a closing square bracket token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a closing square bracket token. + */ +function isClosingBracketToken(token) { + return token.value === "]" && token.type === "Punctuator" +} + +/** + * Checks if the given token is an opening brace token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is an opening brace token. + */ +function isOpeningBraceToken(token) { + return token.value === "{" && token.type === "Punctuator" +} + +/** + * Checks if the given token is a closing brace token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a closing brace token. + */ +function isClosingBraceToken(token) { + return token.value === "}" && token.type === "Punctuator" +} + +/** + * Checks if the given token is a comment token or not. + * @param {Token} token - The token to check. + * @returns {boolean} `true` if the token is a comment token. + */ +function isCommentToken(token) { + return ( + token.type === "Line" || + token.type === "Block" || + token.type === "Shebang" + ) +} + +const isNotArrowToken = negate(isArrowToken); +const isNotCommaToken = negate(isCommaToken); +const isNotSemicolonToken = negate(isSemicolonToken); +const isNotColonToken = negate(isColonToken); +const isNotOpeningParenToken = negate(isOpeningParenToken); +const isNotClosingParenToken = negate(isClosingParenToken); +const isNotOpeningBracketToken = negate(isOpeningBracketToken); +const isNotClosingBracketToken = negate(isClosingBracketToken); +const isNotOpeningBraceToken = negate(isOpeningBraceToken); +const isNotClosingBraceToken = negate(isClosingBraceToken); +const isNotCommentToken = negate(isCommentToken); + +/** + * Get the `(` token of the given function node. + * @param {Node} node - The function node to get. + * @param {SourceCode} sourceCode - The source code object to get tokens. + * @returns {Token} `(` token. + */ +function getOpeningParenOfParams(node, sourceCode) { + return node.id + ? sourceCode.getTokenAfter(node.id, isOpeningParenToken) + : sourceCode.getFirstToken(node, isOpeningParenToken) +} + +/** + * Get the location of the given function node for reporting. + * @param {Node} node - The function node to get. + * @param {SourceCode} sourceCode - The source code object to get tokens. + * @returns {string} The location of the function node for reporting. + */ +function getFunctionHeadLocation(node, sourceCode) { + const parent = node.parent; + let start = null; + let end = null; + + if (node.type === "ArrowFunctionExpression") { + const arrowToken = sourceCode.getTokenBefore(node.body, isArrowToken); + + start = arrowToken.loc.start; + end = arrowToken.loc.end; + } else if ( + parent.type === "Property" || + parent.type === "MethodDefinition" + ) { + start = parent.loc.start; + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } else { + start = node.loc.start; + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } + + return { + start: Object.assign({}, start), + end: Object.assign({}, end), + } +} + +/* globals BigInt, globalThis, global, self, window */ + +const globalObject = + typeof globalThis !== "undefined" + ? globalThis + : typeof self !== "undefined" + ? self + : typeof window !== "undefined" + ? window + : typeof global !== "undefined" + ? global + : {}; + +const builtinNames = Object.freeze( + new Set([ + "Array", + "ArrayBuffer", + "BigInt", + "BigInt64Array", + "BigUint64Array", + "Boolean", + "DataView", + "Date", + "decodeURI", + "decodeURIComponent", + "encodeURI", + "encodeURIComponent", + "escape", + "Float32Array", + "Float64Array", + "Function", + "Infinity", + "Int16Array", + "Int32Array", + "Int8Array", + "isFinite", + "isNaN", + "isPrototypeOf", + "JSON", + "Map", + "Math", + "NaN", + "Number", + "Object", + "parseFloat", + "parseInt", + "Promise", + "Proxy", + "Reflect", + "RegExp", + "Set", + "String", + "Symbol", + "Uint16Array", + "Uint32Array", + "Uint8Array", + "Uint8ClampedArray", + "undefined", + "unescape", + "WeakMap", + "WeakSet", + ]) +); +const callAllowed = new Set( + [ + Array.isArray, + typeof BigInt === "function" ? BigInt : undefined, + Boolean, + Date, + Date.parse, + decodeURI, + decodeURIComponent, + encodeURI, + encodeURIComponent, + escape, + isFinite, + isNaN, + isPrototypeOf, + ...Object.getOwnPropertyNames(Math) + .map(k => Math[k]) + .filter(f => typeof f === "function"), + Number, + Number.isFinite, + Number.isNaN, + Number.parseFloat, + Number.parseInt, + Object, + Object.entries, + Object.is, + Object.isExtensible, + Object.isFrozen, + Object.isSealed, + Object.keys, + Object.values, + parseFloat, + parseInt, + RegExp, + String, + String.fromCharCode, + String.fromCodePoint, + String.raw, + Symbol, + Symbol.for, + Symbol.keyFor, + unescape, + ].filter(f => typeof f === "function") +); +const callPassThrough = new Set([ + Object.freeze, + Object.preventExtensions, + Object.seal, +]); + +/** + * Get the property descriptor. + * @param {object} object The object to get. + * @param {string|number|symbol} name The property name to get. + */ +function getPropertyDescriptor(object, name) { + let x = object; + while ((typeof x === "object" || typeof x === "function") && x !== null) { + const d = Object.getOwnPropertyDescriptor(x, name); + if (d) { + return d + } + x = Object.getPrototypeOf(x); + } + return null +} + +/** + * Check if a property is getter or not. + * @param {object} object The object to check. + * @param {string|number|symbol} name The property name to check. + */ +function isGetter(object, name) { + const d = getPropertyDescriptor(object, name); + return d != null && d.get != null +} + +/** + * Get the element values of a given node list. + * @param {Node[]} nodeList The node list to get values. + * @param {Scope|undefined} initialScope The initial scope to find variables. + * @returns {any[]|null} The value list if all nodes are constant. Otherwise, null. + */ +function getElementValues(nodeList, initialScope) { + const valueList = []; + + for (let i = 0; i < nodeList.length; ++i) { + const elementNode = nodeList[i]; + + if (elementNode == null) { + valueList.length = i + 1; + } else if (elementNode.type === "SpreadElement") { + const argument = getStaticValueR(elementNode.argument, initialScope); + if (argument == null) { + return null + } + valueList.push(...argument.value); + } else { + const element = getStaticValueR(elementNode, initialScope); + if (element == null) { + return null + } + valueList.push(element.value); + } + } + + return valueList +} + +const operations = Object.freeze({ + ArrayExpression(node, initialScope) { + const elements = getElementValues(node.elements, initialScope); + return elements != null ? { value: elements } : null + }, + + AssignmentExpression(node, initialScope) { + if (node.operator === "=") { + return getStaticValueR(node.right, initialScope) + } + return null + }, + + //eslint-disable-next-line complexity + BinaryExpression(node, initialScope) { + if (node.operator === "in" || node.operator === "instanceof") { + // Not supported. + return null + } + + const left = getStaticValueR(node.left, initialScope); + const right = getStaticValueR(node.right, initialScope); + if (left != null && right != null) { + switch (node.operator) { + case "==": + return { value: left.value == right.value } //eslint-disable-line eqeqeq + case "!=": + return { value: left.value != right.value } //eslint-disable-line eqeqeq + case "===": + return { value: left.value === right.value } + case "!==": + return { value: left.value !== right.value } + case "<": + return { value: left.value < right.value } + case "<=": + return { value: left.value <= right.value } + case ">": + return { value: left.value > right.value } + case ">=": + return { value: left.value >= right.value } + case "<<": + return { value: left.value << right.value } + case ">>": + return { value: left.value >> right.value } + case ">>>": + return { value: left.value >>> right.value } + case "+": + return { value: left.value + right.value } + case "-": + return { value: left.value - right.value } + case "*": + return { value: left.value * right.value } + case "/": + return { value: left.value / right.value } + case "%": + return { value: left.value % right.value } + case "**": + return { value: Math.pow(left.value, right.value) } + case "|": + return { value: left.value | right.value } + case "^": + return { value: left.value ^ right.value } + case "&": + return { value: left.value & right.value } + + // no default + } + } + + return null + }, + + CallExpression(node, initialScope) { + const calleeNode = node.callee; + const args = getElementValues(node.arguments, initialScope); + + if (args != null) { + if (calleeNode.type === "MemberExpression") { + const object = getStaticValueR(calleeNode.object, initialScope); + if (object != null) { + if ( + object.value == null && + (object.optional || node.optional) + ) { + return { value: undefined, optional: true } + } + const property = calleeNode.computed + ? getStaticValueR(calleeNode.property, initialScope) + : { value: calleeNode.property.name }; + + if (property != null) { + const receiver = object.value; + const methodName = property.value; + if (callAllowed.has(receiver[methodName])) { + return { value: receiver[methodName](...args) } + } + if (callPassThrough.has(receiver[methodName])) { + return { value: args[0] } + } + } + } + } else { + const callee = getStaticValueR(calleeNode, initialScope); + if (callee != null) { + if (callee.value == null && node.optional) { + return { value: undefined, optional: true } + } + const func = callee.value; + if (callAllowed.has(func)) { + return { value: func(...args) } + } + if (callPassThrough.has(func)) { + return { value: args[0] } + } + } + } + } + + return null + }, + + ConditionalExpression(node, initialScope) { + const test = getStaticValueR(node.test, initialScope); + if (test != null) { + return test.value + ? getStaticValueR(node.consequent, initialScope) + : getStaticValueR(node.alternate, initialScope) + } + return null + }, + + ExpressionStatement(node, initialScope) { + return getStaticValueR(node.expression, initialScope) + }, + + Identifier(node, initialScope) { + if (initialScope != null) { + const variable = findVariable(initialScope, node); + + // Built-in globals. + if ( + variable != null && + variable.defs.length === 0 && + builtinNames.has(variable.name) && + variable.name in globalObject + ) { + return { value: globalObject[variable.name] } + } + + // Constants. + if (variable != null && variable.defs.length === 1) { + const def = variable.defs[0]; + if ( + def.parent && + def.parent.kind === "const" && + // TODO(mysticatea): don't support destructuring here. + def.node.id.type === "Identifier" + ) { + return getStaticValueR(def.node.init, initialScope) + } + } + } + return null + }, + + Literal(node) { + //istanbul ignore if : this is implementation-specific behavior. + if ((node.regex != null || node.bigint != null) && node.value == null) { + // It was a RegExp/BigInt literal, but Node.js didn't support it. + return null + } + return { value: node.value } + }, + + LogicalExpression(node, initialScope) { + const left = getStaticValueR(node.left, initialScope); + if (left != null) { + if ( + (node.operator === "||" && Boolean(left.value) === true) || + (node.operator === "&&" && Boolean(left.value) === false) || + (node.operator === "??" && left.value != null) + ) { + return left + } + + const right = getStaticValueR(node.right, initialScope); + if (right != null) { + return right + } + } + + return null + }, + + MemberExpression(node, initialScope) { + const object = getStaticValueR(node.object, initialScope); + if (object != null) { + if (object.value == null && (object.optional || node.optional)) { + return { value: undefined, optional: true } + } + const property = node.computed + ? getStaticValueR(node.property, initialScope) + : { value: node.property.name }; + + if (property != null && !isGetter(object.value, property.value)) { + return { value: object.value[property.value] } + } + } + return null + }, + + ChainExpression(node, initialScope) { + const expression = getStaticValueR(node.expression, initialScope); + if (expression != null) { + return { value: expression.value } + } + return null + }, + + NewExpression(node, initialScope) { + const callee = getStaticValueR(node.callee, initialScope); + const args = getElementValues(node.arguments, initialScope); + + if (callee != null && args != null) { + const Func = callee.value; + if (callAllowed.has(Func)) { + return { value: new Func(...args) } + } + } + + return null + }, + + ObjectExpression(node, initialScope) { + const object = {}; + + for (const propertyNode of node.properties) { + if (propertyNode.type === "Property") { + if (propertyNode.kind !== "init") { + return null + } + const key = propertyNode.computed + ? getStaticValueR(propertyNode.key, initialScope) + : { value: propertyNode.key.name }; + const value = getStaticValueR(propertyNode.value, initialScope); + if (key == null || value == null) { + return null + } + object[key.value] = value.value; + } else if ( + propertyNode.type === "SpreadElement" || + propertyNode.type === "ExperimentalSpreadProperty" + ) { + const argument = getStaticValueR( + propertyNode.argument, + initialScope + ); + if (argument == null) { + return null + } + Object.assign(object, argument.value); + } else { + return null + } + } + + return { value: object } + }, + + SequenceExpression(node, initialScope) { + const last = node.expressions[node.expressions.length - 1]; + return getStaticValueR(last, initialScope) + }, + + TaggedTemplateExpression(node, initialScope) { + const tag = getStaticValueR(node.tag, initialScope); + const expressions = getElementValues( + node.quasi.expressions, + initialScope + ); + + if (tag != null && expressions != null) { + const func = tag.value; + const strings = node.quasi.quasis.map(q => q.value.cooked); + strings.raw = node.quasi.quasis.map(q => q.value.raw); + + if (func === String.raw) { + return { value: func(strings, ...expressions) } + } + } + + return null + }, + + TemplateLiteral(node, initialScope) { + const expressions = getElementValues(node.expressions, initialScope); + if (expressions != null) { + let value = node.quasis[0].value.cooked; + for (let i = 0; i < expressions.length; ++i) { + value += expressions[i]; + value += node.quasis[i + 1].value.cooked; + } + return { value } + } + return null + }, + + UnaryExpression(node, initialScope) { + if (node.operator === "delete") { + // Not supported. + return null + } + if (node.operator === "void") { + return { value: undefined } + } + + const arg = getStaticValueR(node.argument, initialScope); + if (arg != null) { + switch (node.operator) { + case "-": + return { value: -arg.value } + case "+": + return { value: +arg.value } //eslint-disable-line no-implicit-coercion + case "!": + return { value: !arg.value } + case "~": + return { value: ~arg.value } + case "typeof": + return { value: typeof arg.value } + + // no default + } + } + + return null + }, +}); + +/** + * Get the value of a given node if it's a static value. + * @param {Node} node The node to get. + * @param {Scope|undefined} initialScope The scope to start finding variable. + * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`. + */ +function getStaticValueR(node, initialScope) { + if (node != null && Object.hasOwnProperty.call(operations, node.type)) { + return operations[node.type](node, initialScope) + } + return null +} + +/** + * Get the value of a given node if it's a static value. + * @param {Node} node The node to get. + * @param {Scope} [initialScope] The scope to start finding variable. Optional. If this scope was given, this tries to resolve identifier references which are in the given node as much as possible. + * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`. + */ +function getStaticValue(node, initialScope = null) { + try { + return getStaticValueR(node, initialScope) + } catch (_error) { + return null + } +} + +/** + * Get the value of a given node if it's a literal or a template literal. + * @param {Node} node The node to get. + * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is an Identifier node and this scope was given, this checks the variable of the identifier, and returns the value of it if the variable is a constant. + * @returns {string|null} The value of the node, or `null`. + */ +function getStringIfConstant(node, initialScope = null) { + // Handle the literals that the platform doesn't support natively. + if (node && node.type === "Literal" && node.value === null) { + if (node.regex) { + return `/${node.regex.pattern}/${node.regex.flags}` + } + if (node.bigint) { + return node.bigint + } + } + + const evaluated = getStaticValue(node, initialScope); + return evaluated && String(evaluated.value) +} + +/** + * Get the property name from a MemberExpression node or a Property node. + * @param {Node} node The node to get. + * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it. + * @returns {string|null} The property name of the node. + */ +function getPropertyName(node, initialScope) { + switch (node.type) { + case "MemberExpression": + if (node.computed) { + return getStringIfConstant(node.property, initialScope) + } + return node.property.name + + case "Property": + case "MethodDefinition": + if (node.computed) { + return getStringIfConstant(node.key, initialScope) + } + if (node.key.type === "Literal") { + return String(node.key.value) + } + return node.key.name + + // no default + } + + return null +} + +/** + * Get the name and kind of the given function node. + * @param {ASTNode} node - The function node to get. + * @returns {string} The name and kind of the function node. + */ +function getFunctionNameWithKind(node) { + const parent = node.parent; + const tokens = []; + + if (parent.type === "MethodDefinition" && parent.static) { + tokens.push("static"); + } + if (node.async) { + tokens.push("async"); + } + if (node.generator) { + tokens.push("generator"); + } + + if (node.type === "ArrowFunctionExpression") { + tokens.push("arrow", "function"); + } else if ( + parent.type === "Property" || + parent.type === "MethodDefinition" + ) { + if (parent.kind === "constructor") { + return "constructor" + } + if (parent.kind === "get") { + tokens.push("getter"); + } else if (parent.kind === "set") { + tokens.push("setter"); + } else { + tokens.push("method"); + } + } else { + tokens.push("function"); + } + + if (node.id) { + tokens.push(`'${node.id.name}'`); + } else { + const name = getPropertyName(parent); + + if (name) { + tokens.push(`'${name}'`); + } + } + + if (node.type === "ArrowFunctionExpression") { + if ( + parent.type === "VariableDeclarator" && + parent.id && + parent.id.type === "Identifier" + ) { + tokens.push(`'${parent.id.name}'`); + } + if ( + parent.type === "AssignmentExpression" && + parent.left && + parent.left.type === "Identifier" + ) { + tokens.push(`'${parent.left.name}'`); + } + } + + return tokens.join(" ") +} + +const typeConversionBinaryOps = Object.freeze( + new Set([ + "==", + "!=", + "<", + "<=", + ">", + ">=", + "<<", + ">>", + ">>>", + "+", + "-", + "*", + "/", + "%", + "|", + "^", + "&", + "in", + ]) +); +const typeConversionUnaryOps = Object.freeze(new Set(["-", "+", "!", "~"])); + +/** + * Check whether the given value is an ASTNode or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if the value is an ASTNode. + */ +function isNode(x) { + return x !== null && typeof x === "object" && typeof x.type === "string" +} + +const visitor = Object.freeze( + Object.assign(Object.create(null), { + $visit(node, options, visitorKeys) { + const { type } = node; + + if (typeof this[type] === "function") { + return this[type](node, options, visitorKeys) + } + + return this.$visitChildren(node, options, visitorKeys) + }, + + $visitChildren(node, options, visitorKeys) { + const { type } = node; + + for (const key of visitorKeys[type] || evk.getKeys(node)) { + const value = node[key]; + + if (Array.isArray(value)) { + for (const element of value) { + if ( + isNode(element) && + this.$visit(element, options, visitorKeys) + ) { + return true + } + } + } else if ( + isNode(value) && + this.$visit(value, options, visitorKeys) + ) { + return true + } + } + + return false + }, + + ArrowFunctionExpression() { + return false + }, + AssignmentExpression() { + return true + }, + AwaitExpression() { + return true + }, + BinaryExpression(node, options, visitorKeys) { + if ( + options.considerImplicitTypeConversion && + typeConversionBinaryOps.has(node.operator) && + (node.left.type !== "Literal" || node.right.type !== "Literal") + ) { + return true + } + return this.$visitChildren(node, options, visitorKeys) + }, + CallExpression() { + return true + }, + FunctionExpression() { + return false + }, + ImportExpression() { + return true + }, + MemberExpression(node, options, visitorKeys) { + if (options.considerGetters) { + return true + } + if ( + options.considerImplicitTypeConversion && + node.computed && + node.property.type !== "Literal" + ) { + return true + } + return this.$visitChildren(node, options, visitorKeys) + }, + MethodDefinition(node, options, visitorKeys) { + if ( + options.considerImplicitTypeConversion && + node.computed && + node.key.type !== "Literal" + ) { + return true + } + return this.$visitChildren(node, options, visitorKeys) + }, + NewExpression() { + return true + }, + Property(node, options, visitorKeys) { + if ( + options.considerImplicitTypeConversion && + node.computed && + node.key.type !== "Literal" + ) { + return true + } + return this.$visitChildren(node, options, visitorKeys) + }, + UnaryExpression(node, options, visitorKeys) { + if (node.operator === "delete") { + return true + } + if ( + options.considerImplicitTypeConversion && + typeConversionUnaryOps.has(node.operator) && + node.argument.type !== "Literal" + ) { + return true + } + return this.$visitChildren(node, options, visitorKeys) + }, + UpdateExpression() { + return true + }, + YieldExpression() { + return true + }, + }) +); + +/** + * Check whether a given node has any side effect or not. + * @param {Node} node The node to get. + * @param {SourceCode} sourceCode The source code object. + * @param {object} [options] The option object. + * @param {boolean} [options.considerGetters=false] If `true` then it considers member accesses as the node which has side effects. + * @param {boolean} [options.considerImplicitTypeConversion=false] If `true` then it considers implicit type conversion as the node which has side effects. + * @param {object} [options.visitorKeys=evk.KEYS] The keys to traverse nodes. Use `context.getSourceCode().visitorKeys`. + * @returns {boolean} `true` if the node has a certain side effect. + */ +function hasSideEffect( + node, + sourceCode, + { considerGetters = false, considerImplicitTypeConversion = false } = {} +) { + return visitor.$visit( + node, + { considerGetters, considerImplicitTypeConversion }, + sourceCode.visitorKeys || evk.KEYS + ) +} + +/** + * Get the left parenthesis of the parent node syntax if it exists. + * E.g., `if (a) {}` then the `(`. + * @param {Node} node The AST node to check. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {Token|null} The left parenthesis of the parent node syntax + */ +function getParentSyntaxParen(node, sourceCode) { + const parent = node.parent; + + switch (parent.type) { + case "CallExpression": + case "NewExpression": + if (parent.arguments.length === 1 && parent.arguments[0] === node) { + return sourceCode.getTokenAfter( + parent.callee, + isOpeningParenToken + ) + } + return null + + case "DoWhileStatement": + if (parent.test === node) { + return sourceCode.getTokenAfter( + parent.body, + isOpeningParenToken + ) + } + return null + + case "IfStatement": + case "WhileStatement": + if (parent.test === node) { + return sourceCode.getFirstToken(parent, 1) + } + return null + + case "ImportExpression": + if (parent.source === node) { + return sourceCode.getFirstToken(parent, 1) + } + return null + + case "SwitchStatement": + if (parent.discriminant === node) { + return sourceCode.getFirstToken(parent, 1) + } + return null + + case "WithStatement": + if (parent.object === node) { + return sourceCode.getFirstToken(parent, 1) + } + return null + + default: + return null + } +} + +/** + * Check whether a given node is parenthesized or not. + * @param {number} times The number of parantheses. + * @param {Node} node The AST node to check. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {boolean} `true` if the node is parenthesized the given times. + */ +/** + * Check whether a given node is parenthesized or not. + * @param {Node} node The AST node to check. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {boolean} `true` if the node is parenthesized. + */ +function isParenthesized( + timesOrNode, + nodeOrSourceCode, + optionalSourceCode +) { + let times, node, sourceCode, maybeLeftParen, maybeRightParen; + if (typeof timesOrNode === "number") { + times = timesOrNode | 0; + node = nodeOrSourceCode; + sourceCode = optionalSourceCode; + if (!(times >= 1)) { + throw new TypeError("'times' should be a positive integer.") + } + } else { + times = 1; + node = timesOrNode; + sourceCode = nodeOrSourceCode; + } + + if (node == null) { + return false + } + + maybeLeftParen = maybeRightParen = node; + do { + maybeLeftParen = sourceCode.getTokenBefore(maybeLeftParen); + maybeRightParen = sourceCode.getTokenAfter(maybeRightParen); + } while ( + maybeLeftParen != null && + maybeRightParen != null && + isOpeningParenToken(maybeLeftParen) && + isClosingParenToken(maybeRightParen) && + // Avoid false positive such as `if (a) {}` + maybeLeftParen !== getParentSyntaxParen(node, sourceCode) && + --times > 0 + ) + + return times === 0 +} + +/** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ + +const placeholder = /\$(?:[$&`']|[1-9][0-9]?)/gu; + +/** @type {WeakMap} */ +const internal = new WeakMap(); + +/** + * Check whether a given character is escaped or not. + * @param {string} str The string to check. + * @param {number} index The location of the character to check. + * @returns {boolean} `true` if the character is escaped. + */ +function isEscaped(str, index) { + let escaped = false; + for (let i = index - 1; i >= 0 && str.charCodeAt(i) === 0x5c; --i) { + escaped = !escaped; + } + return escaped +} + +/** + * Replace a given string by a given matcher. + * @param {PatternMatcher} matcher The pattern matcher. + * @param {string} str The string to be replaced. + * @param {string} replacement The new substring to replace each matched part. + * @returns {string} The replaced string. + */ +function replaceS(matcher, str, replacement) { + const chunks = []; + let index = 0; + + /** @type {RegExpExecArray} */ + let match = null; + + /** + * @param {string} key The placeholder. + * @returns {string} The replaced string. + */ + function replacer(key) { + switch (key) { + case "$$": + return "$" + case "$&": + return match[0] + case "$`": + return str.slice(0, match.index) + case "$'": + return str.slice(match.index + match[0].length) + default: { + const i = key.slice(1); + if (i in match) { + return match[i] + } + return key + } + } + } + + for (match of matcher.execAll(str)) { + chunks.push(str.slice(index, match.index)); + chunks.push(replacement.replace(placeholder, replacer)); + index = match.index + match[0].length; + } + chunks.push(str.slice(index)); + + return chunks.join("") +} + +/** + * Replace a given string by a given matcher. + * @param {PatternMatcher} matcher The pattern matcher. + * @param {string} str The string to be replaced. + * @param {(...strs[])=>string} replace The function to replace each matched part. + * @returns {string} The replaced string. + */ +function replaceF(matcher, str, replace) { + const chunks = []; + let index = 0; + + for (const match of matcher.execAll(str)) { + chunks.push(str.slice(index, match.index)); + chunks.push(String(replace(...match, match.index, match.input))); + index = match.index + match[0].length; + } + chunks.push(str.slice(index)); + + return chunks.join("") +} + +/** + * The class to find patterns as considering escape sequences. + */ +class PatternMatcher { + /** + * Initialize this matcher. + * @param {RegExp} pattern The pattern to match. + * @param {{escaped:boolean}} options The options. + */ + constructor(pattern, { escaped = false } = {}) { + if (!(pattern instanceof RegExp)) { + throw new TypeError("'pattern' should be a RegExp instance.") + } + if (!pattern.flags.includes("g")) { + throw new Error("'pattern' should contains 'g' flag.") + } + + internal.set(this, { + pattern: new RegExp(pattern.source, pattern.flags), + escaped: Boolean(escaped), + }); + } + + /** + * Find the pattern in a given string. + * @param {string} str The string to find. + * @returns {IterableIterator} The iterator which iterate the matched information. + */ + *execAll(str) { + const { pattern, escaped } = internal.get(this); + let match = null; + let lastIndex = 0; + + pattern.lastIndex = 0; + while ((match = pattern.exec(str)) != null) { + if (escaped || !isEscaped(str, match.index)) { + lastIndex = pattern.lastIndex; + yield match; + pattern.lastIndex = lastIndex; + } + } + } + + /** + * Check whether the pattern is found in a given string. + * @param {string} str The string to check. + * @returns {boolean} `true` if the pattern was found in the string. + */ + test(str) { + const it = this.execAll(str); + const ret = it.next(); + return !ret.done + } + + /** + * Replace a given string. + * @param {string} str The string to be replaced. + * @param {(string|((...strs:string[])=>string))} replacer The string or function to replace. This is the same as the 2nd argument of `String.prototype.replace`. + * @returns {string} The replaced string. + */ + [Symbol.replace](str, replacer) { + return typeof replacer === "function" + ? replaceF(this, String(str), replacer) + : replaceS(this, String(str), String(replacer)) + } +} + +const IMPORT_TYPE = /^(?:Import|Export(?:All|Default|Named))Declaration$/u; +const has = Function.call.bind(Object.hasOwnProperty); + +const READ = Symbol("read"); +const CALL = Symbol("call"); +const CONSTRUCT = Symbol("construct"); +const ESM = Symbol("esm"); + +const requireCall = { require: { [CALL]: true } }; + +/** + * Check whether a given variable is modified or not. + * @param {Variable} variable The variable to check. + * @returns {boolean} `true` if the variable is modified. + */ +function isModifiedGlobal(variable) { + return ( + variable == null || + variable.defs.length !== 0 || + variable.references.some(r => r.isWrite()) + ) +} + +/** + * Check if the value of a given node is passed through to the parent syntax as-is. + * For example, `a` and `b` in (`a || b` and `c ? a : b`) are passed through. + * @param {Node} node A node to check. + * @returns {boolean} `true` if the node is passed through. + */ +function isPassThrough(node) { + const parent = node.parent; + + switch (parent && parent.type) { + case "ConditionalExpression": + return parent.consequent === node || parent.alternate === node + case "LogicalExpression": + return true + case "SequenceExpression": + return parent.expressions[parent.expressions.length - 1] === node + case "ChainExpression": + return true + + default: + return false + } +} + +/** + * The reference tracker. + */ +class ReferenceTracker { + /** + * Initialize this tracker. + * @param {Scope} globalScope The global scope. + * @param {object} [options] The options. + * @param {"legacy"|"strict"} [options.mode="strict"] The mode to determine the ImportDeclaration's behavior for CJS modules. + * @param {string[]} [options.globalObjectNames=["global","globalThis","self","window"]] The variable names for Global Object. + */ + constructor( + globalScope, + { + mode = "strict", + globalObjectNames = ["global", "globalThis", "self", "window"], + } = {} + ) { + this.variableStack = []; + this.globalScope = globalScope; + this.mode = mode; + this.globalObjectNames = globalObjectNames.slice(0); + } + + /** + * Iterate the references of global variables. + * @param {object} traceMap The trace map. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + *iterateGlobalReferences(traceMap) { + for (const key of Object.keys(traceMap)) { + const nextTraceMap = traceMap[key]; + const path = [key]; + const variable = this.globalScope.set.get(key); + + if (isModifiedGlobal(variable)) { + continue + } + + yield* this._iterateVariableReferences( + variable, + path, + nextTraceMap, + true + ); + } + + for (const key of this.globalObjectNames) { + const path = []; + const variable = this.globalScope.set.get(key); + + if (isModifiedGlobal(variable)) { + continue + } + + yield* this._iterateVariableReferences( + variable, + path, + traceMap, + false + ); + } + } + + /** + * Iterate the references of CommonJS modules. + * @param {object} traceMap The trace map. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + *iterateCjsReferences(traceMap) { + for (const { node } of this.iterateGlobalReferences(requireCall)) { + const key = getStringIfConstant(node.arguments[0]); + if (key == null || !has(traceMap, key)) { + continue + } + + const nextTraceMap = traceMap[key]; + const path = [key]; + + if (nextTraceMap[READ]) { + yield { + node, + path, + type: READ, + info: nextTraceMap[READ], + }; + } + yield* this._iteratePropertyReferences(node, path, nextTraceMap); + } + } + + /** + * Iterate the references of ES modules. + * @param {object} traceMap The trace map. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + *iterateEsmReferences(traceMap) { + const programNode = this.globalScope.block; + + for (const node of programNode.body) { + if (!IMPORT_TYPE.test(node.type) || node.source == null) { + continue + } + const moduleId = node.source.value; + + if (!has(traceMap, moduleId)) { + continue + } + const nextTraceMap = traceMap[moduleId]; + const path = [moduleId]; + + if (nextTraceMap[READ]) { + yield { node, path, type: READ, info: nextTraceMap[READ] }; + } + + if (node.type === "ExportAllDeclaration") { + for (const key of Object.keys(nextTraceMap)) { + const exportTraceMap = nextTraceMap[key]; + if (exportTraceMap[READ]) { + yield { + node, + path: path.concat(key), + type: READ, + info: exportTraceMap[READ], + }; + } + } + } else { + for (const specifier of node.specifiers) { + const esm = has(nextTraceMap, ESM); + const it = this._iterateImportReferences( + specifier, + path, + esm + ? nextTraceMap + : this.mode === "legacy" + ? Object.assign( + { default: nextTraceMap }, + nextTraceMap + ) + : { default: nextTraceMap } + ); + + if (esm) { + yield* it; + } else { + for (const report of it) { + report.path = report.path.filter(exceptDefault); + if ( + report.path.length >= 2 || + report.type !== READ + ) { + yield report; + } + } + } + } + } + } + } + + /** + * Iterate the references for a given variable. + * @param {Variable} variable The variable to iterate that references. + * @param {string[]} path The current path. + * @param {object} traceMap The trace map. + * @param {boolean} shouldReport = The flag to report those references. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + *_iterateVariableReferences(variable, path, traceMap, shouldReport) { + if (this.variableStack.includes(variable)) { + return + } + this.variableStack.push(variable); + try { + for (const reference of variable.references) { + if (!reference.isRead()) { + continue + } + const node = reference.identifier; + + if (shouldReport && traceMap[READ]) { + yield { node, path, type: READ, info: traceMap[READ] }; + } + yield* this._iteratePropertyReferences(node, path, traceMap); + } + } finally { + this.variableStack.pop(); + } + } + + /** + * Iterate the references for a given AST node. + * @param rootNode The AST node to iterate references. + * @param {string[]} path The current path. + * @param {object} traceMap The trace map. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + //eslint-disable-next-line complexity + *_iteratePropertyReferences(rootNode, path, traceMap) { + let node = rootNode; + while (isPassThrough(node)) { + node = node.parent; + } + + const parent = node.parent; + if (parent.type === "MemberExpression") { + if (parent.object === node) { + const key = getPropertyName(parent); + if (key == null || !has(traceMap, key)) { + return + } + + path = path.concat(key); //eslint-disable-line no-param-reassign + const nextTraceMap = traceMap[key]; + if (nextTraceMap[READ]) { + yield { + node: parent, + path, + type: READ, + info: nextTraceMap[READ], + }; + } + yield* this._iteratePropertyReferences( + parent, + path, + nextTraceMap + ); + } + return + } + if (parent.type === "CallExpression") { + if (parent.callee === node && traceMap[CALL]) { + yield { node: parent, path, type: CALL, info: traceMap[CALL] }; + } + return + } + if (parent.type === "NewExpression") { + if (parent.callee === node && traceMap[CONSTRUCT]) { + yield { + node: parent, + path, + type: CONSTRUCT, + info: traceMap[CONSTRUCT], + }; + } + return + } + if (parent.type === "AssignmentExpression") { + if (parent.right === node) { + yield* this._iterateLhsReferences(parent.left, path, traceMap); + yield* this._iteratePropertyReferences(parent, path, traceMap); + } + return + } + if (parent.type === "AssignmentPattern") { + if (parent.right === node) { + yield* this._iterateLhsReferences(parent.left, path, traceMap); + } + return + } + if (parent.type === "VariableDeclarator") { + if (parent.init === node) { + yield* this._iterateLhsReferences(parent.id, path, traceMap); + } + } + } + + /** + * Iterate the references for a given Pattern node. + * @param {Node} patternNode The Pattern node to iterate references. + * @param {string[]} path The current path. + * @param {object} traceMap The trace map. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + *_iterateLhsReferences(patternNode, path, traceMap) { + if (patternNode.type === "Identifier") { + const variable = findVariable(this.globalScope, patternNode); + if (variable != null) { + yield* this._iterateVariableReferences( + variable, + path, + traceMap, + false + ); + } + return + } + if (patternNode.type === "ObjectPattern") { + for (const property of patternNode.properties) { + const key = getPropertyName(property); + + if (key == null || !has(traceMap, key)) { + continue + } + + const nextPath = path.concat(key); + const nextTraceMap = traceMap[key]; + if (nextTraceMap[READ]) { + yield { + node: property, + path: nextPath, + type: READ, + info: nextTraceMap[READ], + }; + } + yield* this._iterateLhsReferences( + property.value, + nextPath, + nextTraceMap + ); + } + return + } + if (patternNode.type === "AssignmentPattern") { + yield* this._iterateLhsReferences(patternNode.left, path, traceMap); + } + } + + /** + * Iterate the references for a given ModuleSpecifier node. + * @param {Node} specifierNode The ModuleSpecifier node to iterate references. + * @param {string[]} path The current path. + * @param {object} traceMap The trace map. + * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. + */ + *_iterateImportReferences(specifierNode, path, traceMap) { + const type = specifierNode.type; + + if (type === "ImportSpecifier" || type === "ImportDefaultSpecifier") { + const key = + type === "ImportDefaultSpecifier" + ? "default" + : specifierNode.imported.name; + if (!has(traceMap, key)) { + return + } + + path = path.concat(key); //eslint-disable-line no-param-reassign + const nextTraceMap = traceMap[key]; + if (nextTraceMap[READ]) { + yield { + node: specifierNode, + path, + type: READ, + info: nextTraceMap[READ], + }; + } + yield* this._iterateVariableReferences( + findVariable(this.globalScope, specifierNode.local), + path, + nextTraceMap, + false + ); + + return + } + + if (type === "ImportNamespaceSpecifier") { + yield* this._iterateVariableReferences( + findVariable(this.globalScope, specifierNode.local), + path, + traceMap, + false + ); + return + } + + if (type === "ExportSpecifier") { + const key = specifierNode.local.name; + if (!has(traceMap, key)) { + return + } + + path = path.concat(key); //eslint-disable-line no-param-reassign + const nextTraceMap = traceMap[key]; + if (nextTraceMap[READ]) { + yield { + node: specifierNode, + path, + type: READ, + info: nextTraceMap[READ], + }; + } + } + } +} + +ReferenceTracker.READ = READ; +ReferenceTracker.CALL = CALL; +ReferenceTracker.CONSTRUCT = CONSTRUCT; +ReferenceTracker.ESM = ESM; + +/** + * This is a predicate function for Array#filter. + * @param {string} name A name part. + * @param {number} index The index of the name. + * @returns {boolean} `false` if it's default. + */ +function exceptDefault(name, index) { + return !(index === 1 && name === "default") +} + +var index = { + CALL, + CONSTRUCT, + ESM, + findVariable, + getFunctionHeadLocation, + getFunctionNameWithKind, + getInnermostScope, + getPropertyName, + getStaticValue, + getStringIfConstant, + hasSideEffect, + isArrowToken, + isClosingBraceToken, + isClosingBracketToken, + isClosingParenToken, + isColonToken, + isCommaToken, + isCommentToken, + isNotArrowToken, + isNotClosingBraceToken, + isNotClosingBracketToken, + isNotClosingParenToken, + isNotColonToken, + isNotCommaToken, + isNotCommentToken, + isNotOpeningBraceToken, + isNotOpeningBracketToken, + isNotOpeningParenToken, + isNotSemicolonToken, + isOpeningBraceToken, + isOpeningBracketToken, + isOpeningParenToken, + isParenthesized, + isSemicolonToken, + PatternMatcher, + READ, + ReferenceTracker, +}; + +export default index; +export { CALL, CONSTRUCT, ESM, PatternMatcher, READ, ReferenceTracker, findVariable, getFunctionHeadLocation, getFunctionNameWithKind, getInnermostScope, getPropertyName, getStaticValue, getStringIfConstant, hasSideEffect, isArrowToken, isClosingBraceToken, isClosingBracketToken, isClosingParenToken, isColonToken, isCommaToken, isCommentToken, isNotArrowToken, isNotClosingBraceToken, isNotClosingBracketToken, isNotClosingParenToken, isNotColonToken, isNotCommaToken, isNotCommentToken, isNotOpeningBraceToken, isNotOpeningBracketToken, isNotOpeningParenToken, isNotSemicolonToken, isOpeningBraceToken, isOpeningBracketToken, isOpeningParenToken, isParenthesized, isSemicolonToken }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/eslint-utils/index.mjs.map b/node_modules/eslint-utils/index.mjs.map new file mode 100644 index 000000000..0af151944 --- /dev/null +++ b/node_modules/eslint-utils/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["src/get-innermost-scope.js","src/find-variable.js","src/token-predicate.js","src/get-function-head-location.js","src/get-static-value.js","src/get-string-if-constant.js","src/get-property-name.js","src/get-function-name-with-kind.js","src/has-side-effect.js","src/is-parenthesized.js","src/pattern-matcher.js","src/reference-tracker.js","src/index.js"],"sourcesContent":["/**\n * Get the innermost scope which contains a given location.\n * @param {Scope} initialScope The initial scope to search.\n * @param {Node} node The location to search.\n * @returns {Scope} The innermost scope.\n */\nexport function getInnermostScope(initialScope, node) {\n const location = node.range[0]\n\n let scope = initialScope\n let found = false\n do {\n found = false\n for (const childScope of scope.childScopes) {\n const range = childScope.block.range\n\n if (range[0] <= location && location < range[1]) {\n scope = childScope\n found = true\n break\n }\n }\n } while (found)\n\n return scope\n}\n","import { getInnermostScope } from \"./get-innermost-scope\"\n\n/**\n * Find the variable of a given name.\n * @param {Scope} initialScope The scope to start finding.\n * @param {string|Node} nameOrNode The variable name to find. If this is a Node object then it should be an Identifier node.\n * @returns {Variable|null} The found variable or null.\n */\nexport function findVariable(initialScope, nameOrNode) {\n let name = \"\"\n let scope = initialScope\n\n if (typeof nameOrNode === \"string\") {\n name = nameOrNode\n } else {\n name = nameOrNode.name\n scope = getInnermostScope(scope, nameOrNode)\n }\n\n while (scope != null) {\n const variable = scope.set.get(name)\n if (variable != null) {\n return variable\n }\n scope = scope.upper\n }\n\n return null\n}\n","/**\n * Negate the result of `this` calling.\n * @param {Token} token The token to check.\n * @returns {boolean} `true` if the result of `this(token)` is `false`.\n */\nfunction negate0(token) {\n return !this(token) //eslint-disable-line no-invalid-this\n}\n\n/**\n * Creates the negate function of the given function.\n * @param {function(Token):boolean} f - The function to negate.\n * @returns {function(Token):boolean} Negated function.\n */\nfunction negate(f) {\n return negate0.bind(f)\n}\n\n/**\n * Checks if the given token is an arrow token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an arrow token.\n */\nexport function isArrowToken(token) {\n return token.value === \"=>\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a comma token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a comma token.\n */\nexport function isCommaToken(token) {\n return token.value === \",\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a semicolon token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a semicolon token.\n */\nexport function isSemicolonToken(token) {\n return token.value === \";\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a colon token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a colon token.\n */\nexport function isColonToken(token) {\n return token.value === \":\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is an opening parenthesis token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening parenthesis token.\n */\nexport function isOpeningParenToken(token) {\n return token.value === \"(\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a closing parenthesis token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing parenthesis token.\n */\nexport function isClosingParenToken(token) {\n return token.value === \")\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is an opening square bracket token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening square bracket token.\n */\nexport function isOpeningBracketToken(token) {\n return token.value === \"[\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a closing square bracket token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing square bracket token.\n */\nexport function isClosingBracketToken(token) {\n return token.value === \"]\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is an opening brace token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is an opening brace token.\n */\nexport function isOpeningBraceToken(token) {\n return token.value === \"{\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a closing brace token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a closing brace token.\n */\nexport function isClosingBraceToken(token) {\n return token.value === \"}\" && token.type === \"Punctuator\"\n}\n\n/**\n * Checks if the given token is a comment token or not.\n * @param {Token} token - The token to check.\n * @returns {boolean} `true` if the token is a comment token.\n */\nexport function isCommentToken(token) {\n return (\n token.type === \"Line\" ||\n token.type === \"Block\" ||\n token.type === \"Shebang\"\n )\n}\n\nexport const isNotArrowToken = negate(isArrowToken)\nexport const isNotCommaToken = negate(isCommaToken)\nexport const isNotSemicolonToken = negate(isSemicolonToken)\nexport const isNotColonToken = negate(isColonToken)\nexport const isNotOpeningParenToken = negate(isOpeningParenToken)\nexport const isNotClosingParenToken = negate(isClosingParenToken)\nexport const isNotOpeningBracketToken = negate(isOpeningBracketToken)\nexport const isNotClosingBracketToken = negate(isClosingBracketToken)\nexport const isNotOpeningBraceToken = negate(isOpeningBraceToken)\nexport const isNotClosingBraceToken = negate(isClosingBraceToken)\nexport const isNotCommentToken = negate(isCommentToken)\n","import { isArrowToken, isOpeningParenToken } from \"./token-predicate\"\n\n/**\n * Get the `(` token of the given function node.\n * @param {Node} node - The function node to get.\n * @param {SourceCode} sourceCode - The source code object to get tokens.\n * @returns {Token} `(` token.\n */\nfunction getOpeningParenOfParams(node, sourceCode) {\n return node.id\n ? sourceCode.getTokenAfter(node.id, isOpeningParenToken)\n : sourceCode.getFirstToken(node, isOpeningParenToken)\n}\n\n/**\n * Get the location of the given function node for reporting.\n * @param {Node} node - The function node to get.\n * @param {SourceCode} sourceCode - The source code object to get tokens.\n * @returns {string} The location of the function node for reporting.\n */\nexport function getFunctionHeadLocation(node, sourceCode) {\n const parent = node.parent\n let start = null\n let end = null\n\n if (node.type === \"ArrowFunctionExpression\") {\n const arrowToken = sourceCode.getTokenBefore(node.body, isArrowToken)\n\n start = arrowToken.loc.start\n end = arrowToken.loc.end\n } else if (\n parent.type === \"Property\" ||\n parent.type === \"MethodDefinition\"\n ) {\n start = parent.loc.start\n end = getOpeningParenOfParams(node, sourceCode).loc.start\n } else {\n start = node.loc.start\n end = getOpeningParenOfParams(node, sourceCode).loc.start\n }\n\n return {\n start: Object.assign({}, start),\n end: Object.assign({}, end),\n }\n}\n","/* globals BigInt, globalThis, global, self, window */\n\nimport { findVariable } from \"./find-variable\"\n\nconst globalObject =\n typeof globalThis !== \"undefined\"\n ? globalThis\n : typeof self !== \"undefined\"\n ? self\n : typeof window !== \"undefined\"\n ? window\n : typeof global !== \"undefined\"\n ? global\n : {}\n\nconst builtinNames = Object.freeze(\n new Set([\n \"Array\",\n \"ArrayBuffer\",\n \"BigInt\",\n \"BigInt64Array\",\n \"BigUint64Array\",\n \"Boolean\",\n \"DataView\",\n \"Date\",\n \"decodeURI\",\n \"decodeURIComponent\",\n \"encodeURI\",\n \"encodeURIComponent\",\n \"escape\",\n \"Float32Array\",\n \"Float64Array\",\n \"Function\",\n \"Infinity\",\n \"Int16Array\",\n \"Int32Array\",\n \"Int8Array\",\n \"isFinite\",\n \"isNaN\",\n \"isPrototypeOf\",\n \"JSON\",\n \"Map\",\n \"Math\",\n \"NaN\",\n \"Number\",\n \"Object\",\n \"parseFloat\",\n \"parseInt\",\n \"Promise\",\n \"Proxy\",\n \"Reflect\",\n \"RegExp\",\n \"Set\",\n \"String\",\n \"Symbol\",\n \"Uint16Array\",\n \"Uint32Array\",\n \"Uint8Array\",\n \"Uint8ClampedArray\",\n \"undefined\",\n \"unescape\",\n \"WeakMap\",\n \"WeakSet\",\n ])\n)\nconst callAllowed = new Set(\n [\n Array.isArray,\n typeof BigInt === \"function\" ? BigInt : undefined,\n Boolean,\n Date,\n Date.parse,\n decodeURI,\n decodeURIComponent,\n encodeURI,\n encodeURIComponent,\n escape,\n isFinite,\n isNaN,\n isPrototypeOf,\n ...Object.getOwnPropertyNames(Math)\n .map(k => Math[k])\n .filter(f => typeof f === \"function\"),\n Number,\n Number.isFinite,\n Number.isNaN,\n Number.parseFloat,\n Number.parseInt,\n Object,\n Object.entries,\n Object.is,\n Object.isExtensible,\n Object.isFrozen,\n Object.isSealed,\n Object.keys,\n Object.values,\n parseFloat,\n parseInt,\n RegExp,\n String,\n String.fromCharCode,\n String.fromCodePoint,\n String.raw,\n Symbol,\n Symbol.for,\n Symbol.keyFor,\n unescape,\n ].filter(f => typeof f === \"function\")\n)\nconst callPassThrough = new Set([\n Object.freeze,\n Object.preventExtensions,\n Object.seal,\n])\n\n/**\n * Get the property descriptor.\n * @param {object} object The object to get.\n * @param {string|number|symbol} name The property name to get.\n */\nfunction getPropertyDescriptor(object, name) {\n let x = object\n while ((typeof x === \"object\" || typeof x === \"function\") && x !== null) {\n const d = Object.getOwnPropertyDescriptor(x, name)\n if (d) {\n return d\n }\n x = Object.getPrototypeOf(x)\n }\n return null\n}\n\n/**\n * Check if a property is getter or not.\n * @param {object} object The object to check.\n * @param {string|number|symbol} name The property name to check.\n */\nfunction isGetter(object, name) {\n const d = getPropertyDescriptor(object, name)\n return d != null && d.get != null\n}\n\n/**\n * Get the element values of a given node list.\n * @param {Node[]} nodeList The node list to get values.\n * @param {Scope|undefined} initialScope The initial scope to find variables.\n * @returns {any[]|null} The value list if all nodes are constant. Otherwise, null.\n */\nfunction getElementValues(nodeList, initialScope) {\n const valueList = []\n\n for (let i = 0; i < nodeList.length; ++i) {\n const elementNode = nodeList[i]\n\n if (elementNode == null) {\n valueList.length = i + 1\n } else if (elementNode.type === \"SpreadElement\") {\n const argument = getStaticValueR(elementNode.argument, initialScope)\n if (argument == null) {\n return null\n }\n valueList.push(...argument.value)\n } else {\n const element = getStaticValueR(elementNode, initialScope)\n if (element == null) {\n return null\n }\n valueList.push(element.value)\n }\n }\n\n return valueList\n}\n\nconst operations = Object.freeze({\n ArrayExpression(node, initialScope) {\n const elements = getElementValues(node.elements, initialScope)\n return elements != null ? { value: elements } : null\n },\n\n AssignmentExpression(node, initialScope) {\n if (node.operator === \"=\") {\n return getStaticValueR(node.right, initialScope)\n }\n return null\n },\n\n //eslint-disable-next-line complexity\n BinaryExpression(node, initialScope) {\n if (node.operator === \"in\" || node.operator === \"instanceof\") {\n // Not supported.\n return null\n }\n\n const left = getStaticValueR(node.left, initialScope)\n const right = getStaticValueR(node.right, initialScope)\n if (left != null && right != null) {\n switch (node.operator) {\n case \"==\":\n return { value: left.value == right.value } //eslint-disable-line eqeqeq\n case \"!=\":\n return { value: left.value != right.value } //eslint-disable-line eqeqeq\n case \"===\":\n return { value: left.value === right.value }\n case \"!==\":\n return { value: left.value !== right.value }\n case \"<\":\n return { value: left.value < right.value }\n case \"<=\":\n return { value: left.value <= right.value }\n case \">\":\n return { value: left.value > right.value }\n case \">=\":\n return { value: left.value >= right.value }\n case \"<<\":\n return { value: left.value << right.value }\n case \">>\":\n return { value: left.value >> right.value }\n case \">>>\":\n return { value: left.value >>> right.value }\n case \"+\":\n return { value: left.value + right.value }\n case \"-\":\n return { value: left.value - right.value }\n case \"*\":\n return { value: left.value * right.value }\n case \"/\":\n return { value: left.value / right.value }\n case \"%\":\n return { value: left.value % right.value }\n case \"**\":\n return { value: Math.pow(left.value, right.value) }\n case \"|\":\n return { value: left.value | right.value }\n case \"^\":\n return { value: left.value ^ right.value }\n case \"&\":\n return { value: left.value & right.value }\n\n // no default\n }\n }\n\n return null\n },\n\n CallExpression(node, initialScope) {\n const calleeNode = node.callee\n const args = getElementValues(node.arguments, initialScope)\n\n if (args != null) {\n if (calleeNode.type === \"MemberExpression\") {\n const object = getStaticValueR(calleeNode.object, initialScope)\n if (object != null) {\n if (\n object.value == null &&\n (object.optional || node.optional)\n ) {\n return { value: undefined, optional: true }\n }\n const property = calleeNode.computed\n ? getStaticValueR(calleeNode.property, initialScope)\n : { value: calleeNode.property.name }\n\n if (property != null) {\n const receiver = object.value\n const methodName = property.value\n if (callAllowed.has(receiver[methodName])) {\n return { value: receiver[methodName](...args) }\n }\n if (callPassThrough.has(receiver[methodName])) {\n return { value: args[0] }\n }\n }\n }\n } else {\n const callee = getStaticValueR(calleeNode, initialScope)\n if (callee != null) {\n if (callee.value == null && node.optional) {\n return { value: undefined, optional: true }\n }\n const func = callee.value\n if (callAllowed.has(func)) {\n return { value: func(...args) }\n }\n if (callPassThrough.has(func)) {\n return { value: args[0] }\n }\n }\n }\n }\n\n return null\n },\n\n ConditionalExpression(node, initialScope) {\n const test = getStaticValueR(node.test, initialScope)\n if (test != null) {\n return test.value\n ? getStaticValueR(node.consequent, initialScope)\n : getStaticValueR(node.alternate, initialScope)\n }\n return null\n },\n\n ExpressionStatement(node, initialScope) {\n return getStaticValueR(node.expression, initialScope)\n },\n\n Identifier(node, initialScope) {\n if (initialScope != null) {\n const variable = findVariable(initialScope, node)\n\n // Built-in globals.\n if (\n variable != null &&\n variable.defs.length === 0 &&\n builtinNames.has(variable.name) &&\n variable.name in globalObject\n ) {\n return { value: globalObject[variable.name] }\n }\n\n // Constants.\n if (variable != null && variable.defs.length === 1) {\n const def = variable.defs[0]\n if (\n def.parent &&\n def.parent.kind === \"const\" &&\n // TODO(mysticatea): don't support destructuring here.\n def.node.id.type === \"Identifier\"\n ) {\n return getStaticValueR(def.node.init, initialScope)\n }\n }\n }\n return null\n },\n\n Literal(node) {\n //istanbul ignore if : this is implementation-specific behavior.\n if ((node.regex != null || node.bigint != null) && node.value == null) {\n // It was a RegExp/BigInt literal, but Node.js didn't support it.\n return null\n }\n return { value: node.value }\n },\n\n LogicalExpression(node, initialScope) {\n const left = getStaticValueR(node.left, initialScope)\n if (left != null) {\n if (\n (node.operator === \"||\" && Boolean(left.value) === true) ||\n (node.operator === \"&&\" && Boolean(left.value) === false) ||\n (node.operator === \"??\" && left.value != null)\n ) {\n return left\n }\n\n const right = getStaticValueR(node.right, initialScope)\n if (right != null) {\n return right\n }\n }\n\n return null\n },\n\n MemberExpression(node, initialScope) {\n const object = getStaticValueR(node.object, initialScope)\n if (object != null) {\n if (object.value == null && (object.optional || node.optional)) {\n return { value: undefined, optional: true }\n }\n const property = node.computed\n ? getStaticValueR(node.property, initialScope)\n : { value: node.property.name }\n\n if (property != null && !isGetter(object.value, property.value)) {\n return { value: object.value[property.value] }\n }\n }\n return null\n },\n\n ChainExpression(node, initialScope) {\n const expression = getStaticValueR(node.expression, initialScope)\n if (expression != null) {\n return { value: expression.value }\n }\n return null\n },\n\n NewExpression(node, initialScope) {\n const callee = getStaticValueR(node.callee, initialScope)\n const args = getElementValues(node.arguments, initialScope)\n\n if (callee != null && args != null) {\n const Func = callee.value\n if (callAllowed.has(Func)) {\n return { value: new Func(...args) }\n }\n }\n\n return null\n },\n\n ObjectExpression(node, initialScope) {\n const object = {}\n\n for (const propertyNode of node.properties) {\n if (propertyNode.type === \"Property\") {\n if (propertyNode.kind !== \"init\") {\n return null\n }\n const key = propertyNode.computed\n ? getStaticValueR(propertyNode.key, initialScope)\n : { value: propertyNode.key.name }\n const value = getStaticValueR(propertyNode.value, initialScope)\n if (key == null || value == null) {\n return null\n }\n object[key.value] = value.value\n } else if (\n propertyNode.type === \"SpreadElement\" ||\n propertyNode.type === \"ExperimentalSpreadProperty\"\n ) {\n const argument = getStaticValueR(\n propertyNode.argument,\n initialScope\n )\n if (argument == null) {\n return null\n }\n Object.assign(object, argument.value)\n } else {\n return null\n }\n }\n\n return { value: object }\n },\n\n SequenceExpression(node, initialScope) {\n const last = node.expressions[node.expressions.length - 1]\n return getStaticValueR(last, initialScope)\n },\n\n TaggedTemplateExpression(node, initialScope) {\n const tag = getStaticValueR(node.tag, initialScope)\n const expressions = getElementValues(\n node.quasi.expressions,\n initialScope\n )\n\n if (tag != null && expressions != null) {\n const func = tag.value\n const strings = node.quasi.quasis.map(q => q.value.cooked)\n strings.raw = node.quasi.quasis.map(q => q.value.raw)\n\n if (func === String.raw) {\n return { value: func(strings, ...expressions) }\n }\n }\n\n return null\n },\n\n TemplateLiteral(node, initialScope) {\n const expressions = getElementValues(node.expressions, initialScope)\n if (expressions != null) {\n let value = node.quasis[0].value.cooked\n for (let i = 0; i < expressions.length; ++i) {\n value += expressions[i]\n value += node.quasis[i + 1].value.cooked\n }\n return { value }\n }\n return null\n },\n\n UnaryExpression(node, initialScope) {\n if (node.operator === \"delete\") {\n // Not supported.\n return null\n }\n if (node.operator === \"void\") {\n return { value: undefined }\n }\n\n const arg = getStaticValueR(node.argument, initialScope)\n if (arg != null) {\n switch (node.operator) {\n case \"-\":\n return { value: -arg.value }\n case \"+\":\n return { value: +arg.value } //eslint-disable-line no-implicit-coercion\n case \"!\":\n return { value: !arg.value }\n case \"~\":\n return { value: ~arg.value }\n case \"typeof\":\n return { value: typeof arg.value }\n\n // no default\n }\n }\n\n return null\n },\n})\n\n/**\n * Get the value of a given node if it's a static value.\n * @param {Node} node The node to get.\n * @param {Scope|undefined} initialScope The scope to start finding variable.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`.\n */\nfunction getStaticValueR(node, initialScope) {\n if (node != null && Object.hasOwnProperty.call(operations, node.type)) {\n return operations[node.type](node, initialScope)\n }\n return null\n}\n\n/**\n * Get the value of a given node if it's a static value.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If this scope was given, this tries to resolve identifier references which are in the given node as much as possible.\n * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`.\n */\nexport function getStaticValue(node, initialScope = null) {\n try {\n return getStaticValueR(node, initialScope)\n } catch (_error) {\n return null\n }\n}\n","import { getStaticValue } from \"./get-static-value\"\n\n/**\n * Get the value of a given node if it's a literal or a template literal.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is an Identifier node and this scope was given, this checks the variable of the identifier, and returns the value of it if the variable is a constant.\n * @returns {string|null} The value of the node, or `null`.\n */\nexport function getStringIfConstant(node, initialScope = null) {\n // Handle the literals that the platform doesn't support natively.\n if (node && node.type === \"Literal\" && node.value === null) {\n if (node.regex) {\n return `/${node.regex.pattern}/${node.regex.flags}`\n }\n if (node.bigint) {\n return node.bigint\n }\n }\n\n const evaluated = getStaticValue(node, initialScope)\n return evaluated && String(evaluated.value)\n}\n","import { getStringIfConstant } from \"./get-string-if-constant\"\n\n/**\n * Get the property name from a MemberExpression node or a Property node.\n * @param {Node} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.\n * @returns {string|null} The property name of the node.\n */\nexport function getPropertyName(node, initialScope) {\n switch (node.type) {\n case \"MemberExpression\":\n if (node.computed) {\n return getStringIfConstant(node.property, initialScope)\n }\n return node.property.name\n\n case \"Property\":\n case \"MethodDefinition\":\n if (node.computed) {\n return getStringIfConstant(node.key, initialScope)\n }\n if (node.key.type === \"Literal\") {\n return String(node.key.value)\n }\n return node.key.name\n\n // no default\n }\n\n return null\n}\n","import { getPropertyName } from \"./get-property-name\"\n\n/**\n * Get the name and kind of the given function node.\n * @param {ASTNode} node - The function node to get.\n * @returns {string} The name and kind of the function node.\n */\nexport function getFunctionNameWithKind(node) {\n const parent = node.parent\n const tokens = []\n\n if (parent.type === \"MethodDefinition\" && parent.static) {\n tokens.push(\"static\")\n }\n if (node.async) {\n tokens.push(\"async\")\n }\n if (node.generator) {\n tokens.push(\"generator\")\n }\n\n if (node.type === \"ArrowFunctionExpression\") {\n tokens.push(\"arrow\", \"function\")\n } else if (\n parent.type === \"Property\" ||\n parent.type === \"MethodDefinition\"\n ) {\n if (parent.kind === \"constructor\") {\n return \"constructor\"\n }\n if (parent.kind === \"get\") {\n tokens.push(\"getter\")\n } else if (parent.kind === \"set\") {\n tokens.push(\"setter\")\n } else {\n tokens.push(\"method\")\n }\n } else {\n tokens.push(\"function\")\n }\n\n if (node.id) {\n tokens.push(`'${node.id.name}'`)\n } else {\n const name = getPropertyName(parent)\n\n if (name) {\n tokens.push(`'${name}'`)\n }\n }\n\n if (node.type === \"ArrowFunctionExpression\") {\n if (\n parent.type === \"VariableDeclarator\" &&\n parent.id &&\n parent.id.type === \"Identifier\"\n ) {\n tokens.push(`'${parent.id.name}'`)\n }\n if (\n parent.type === \"AssignmentExpression\" &&\n parent.left &&\n parent.left.type === \"Identifier\"\n ) {\n tokens.push(`'${parent.left.name}'`)\n }\n }\n\n return tokens.join(\" \")\n}\n","import evk from \"eslint-visitor-keys\"\n\nconst typeConversionBinaryOps = Object.freeze(\n new Set([\n \"==\",\n \"!=\",\n \"<\",\n \"<=\",\n \">\",\n \">=\",\n \"<<\",\n \">>\",\n \">>>\",\n \"+\",\n \"-\",\n \"*\",\n \"/\",\n \"%\",\n \"|\",\n \"^\",\n \"&\",\n \"in\",\n ])\n)\nconst typeConversionUnaryOps = Object.freeze(new Set([\"-\", \"+\", \"!\", \"~\"]))\n\n/**\n * Check whether the given value is an ASTNode or not.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is an ASTNode.\n */\nfunction isNode(x) {\n return x !== null && typeof x === \"object\" && typeof x.type === \"string\"\n}\n\nconst visitor = Object.freeze(\n Object.assign(Object.create(null), {\n $visit(node, options, visitorKeys) {\n const { type } = node\n\n if (typeof this[type] === \"function\") {\n return this[type](node, options, visitorKeys)\n }\n\n return this.$visitChildren(node, options, visitorKeys)\n },\n\n $visitChildren(node, options, visitorKeys) {\n const { type } = node\n\n for (const key of visitorKeys[type] || evk.getKeys(node)) {\n const value = node[key]\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (\n isNode(element) &&\n this.$visit(element, options, visitorKeys)\n ) {\n return true\n }\n }\n } else if (\n isNode(value) &&\n this.$visit(value, options, visitorKeys)\n ) {\n return true\n }\n }\n\n return false\n },\n\n ArrowFunctionExpression() {\n return false\n },\n AssignmentExpression() {\n return true\n },\n AwaitExpression() {\n return true\n },\n BinaryExpression(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n typeConversionBinaryOps.has(node.operator) &&\n (node.left.type !== \"Literal\" || node.right.type !== \"Literal\")\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n CallExpression() {\n return true\n },\n FunctionExpression() {\n return false\n },\n ImportExpression() {\n return true\n },\n MemberExpression(node, options, visitorKeys) {\n if (options.considerGetters) {\n return true\n }\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.property.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n MethodDefinition(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n NewExpression() {\n return true\n },\n Property(node, options, visitorKeys) {\n if (\n options.considerImplicitTypeConversion &&\n node.computed &&\n node.key.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n UnaryExpression(node, options, visitorKeys) {\n if (node.operator === \"delete\") {\n return true\n }\n if (\n options.considerImplicitTypeConversion &&\n typeConversionUnaryOps.has(node.operator) &&\n node.argument.type !== \"Literal\"\n ) {\n return true\n }\n return this.$visitChildren(node, options, visitorKeys)\n },\n UpdateExpression() {\n return true\n },\n YieldExpression() {\n return true\n },\n })\n)\n\n/**\n * Check whether a given node has any side effect or not.\n * @param {Node} node The node to get.\n * @param {SourceCode} sourceCode The source code object.\n * @param {object} [options] The option object.\n * @param {boolean} [options.considerGetters=false] If `true` then it considers member accesses as the node which has side effects.\n * @param {boolean} [options.considerImplicitTypeConversion=false] If `true` then it considers implicit type conversion as the node which has side effects.\n * @param {object} [options.visitorKeys=evk.KEYS] The keys to traverse nodes. Use `context.getSourceCode().visitorKeys`.\n * @returns {boolean} `true` if the node has a certain side effect.\n */\nexport function hasSideEffect(\n node,\n sourceCode,\n { considerGetters = false, considerImplicitTypeConversion = false } = {}\n) {\n return visitor.$visit(\n node,\n { considerGetters, considerImplicitTypeConversion },\n sourceCode.visitorKeys || evk.KEYS\n )\n}\n","import { isClosingParenToken, isOpeningParenToken } from \"./token-predicate\"\n\n/**\n * Get the left parenthesis of the parent node syntax if it exists.\n * E.g., `if (a) {}` then the `(`.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {Token|null} The left parenthesis of the parent node syntax\n */\nfunction getParentSyntaxParen(node, sourceCode) {\n const parent = node.parent\n\n switch (parent.type) {\n case \"CallExpression\":\n case \"NewExpression\":\n if (parent.arguments.length === 1 && parent.arguments[0] === node) {\n return sourceCode.getTokenAfter(\n parent.callee,\n isOpeningParenToken\n )\n }\n return null\n\n case \"DoWhileStatement\":\n if (parent.test === node) {\n return sourceCode.getTokenAfter(\n parent.body,\n isOpeningParenToken\n )\n }\n return null\n\n case \"IfStatement\":\n case \"WhileStatement\":\n if (parent.test === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"ImportExpression\":\n if (parent.source === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"SwitchStatement\":\n if (parent.discriminant === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n case \"WithStatement\":\n if (parent.object === node) {\n return sourceCode.getFirstToken(parent, 1)\n }\n return null\n\n default:\n return null\n }\n}\n\n/**\n * Check whether a given node is parenthesized or not.\n * @param {number} times The number of parantheses.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {boolean} `true` if the node is parenthesized the given times.\n */\n/**\n * Check whether a given node is parenthesized or not.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {boolean} `true` if the node is parenthesized.\n */\nexport function isParenthesized(\n timesOrNode,\n nodeOrSourceCode,\n optionalSourceCode\n) {\n let times, node, sourceCode, maybeLeftParen, maybeRightParen\n if (typeof timesOrNode === \"number\") {\n times = timesOrNode | 0\n node = nodeOrSourceCode\n sourceCode = optionalSourceCode\n if (!(times >= 1)) {\n throw new TypeError(\"'times' should be a positive integer.\")\n }\n } else {\n times = 1\n node = timesOrNode\n sourceCode = nodeOrSourceCode\n }\n\n if (node == null) {\n return false\n }\n\n maybeLeftParen = maybeRightParen = node\n do {\n maybeLeftParen = sourceCode.getTokenBefore(maybeLeftParen)\n maybeRightParen = sourceCode.getTokenAfter(maybeRightParen)\n } while (\n maybeLeftParen != null &&\n maybeRightParen != null &&\n isOpeningParenToken(maybeLeftParen) &&\n isClosingParenToken(maybeRightParen) &&\n // Avoid false positive such as `if (a) {}`\n maybeLeftParen !== getParentSyntaxParen(node, sourceCode) &&\n --times > 0\n )\n\n return times === 0\n}\n","/**\n * @author Toru Nagashima \n * See LICENSE file in root directory for full license.\n */\n\nconst placeholder = /\\$(?:[$&`']|[1-9][0-9]?)/gu\n\n/** @type {WeakMap} */\nconst internal = new WeakMap()\n\n/**\n * Check whether a given character is escaped or not.\n * @param {string} str The string to check.\n * @param {number} index The location of the character to check.\n * @returns {boolean} `true` if the character is escaped.\n */\nfunction isEscaped(str, index) {\n let escaped = false\n for (let i = index - 1; i >= 0 && str.charCodeAt(i) === 0x5c; --i) {\n escaped = !escaped\n }\n return escaped\n}\n\n/**\n * Replace a given string by a given matcher.\n * @param {PatternMatcher} matcher The pattern matcher.\n * @param {string} str The string to be replaced.\n * @param {string} replacement The new substring to replace each matched part.\n * @returns {string} The replaced string.\n */\nfunction replaceS(matcher, str, replacement) {\n const chunks = []\n let index = 0\n\n /** @type {RegExpExecArray} */\n let match = null\n\n /**\n * @param {string} key The placeholder.\n * @returns {string} The replaced string.\n */\n function replacer(key) {\n switch (key) {\n case \"$$\":\n return \"$\"\n case \"$&\":\n return match[0]\n case \"$`\":\n return str.slice(0, match.index)\n case \"$'\":\n return str.slice(match.index + match[0].length)\n default: {\n const i = key.slice(1)\n if (i in match) {\n return match[i]\n }\n return key\n }\n }\n }\n\n for (match of matcher.execAll(str)) {\n chunks.push(str.slice(index, match.index))\n chunks.push(replacement.replace(placeholder, replacer))\n index = match.index + match[0].length\n }\n chunks.push(str.slice(index))\n\n return chunks.join(\"\")\n}\n\n/**\n * Replace a given string by a given matcher.\n * @param {PatternMatcher} matcher The pattern matcher.\n * @param {string} str The string to be replaced.\n * @param {(...strs[])=>string} replace The function to replace each matched part.\n * @returns {string} The replaced string.\n */\nfunction replaceF(matcher, str, replace) {\n const chunks = []\n let index = 0\n\n for (const match of matcher.execAll(str)) {\n chunks.push(str.slice(index, match.index))\n chunks.push(String(replace(...match, match.index, match.input)))\n index = match.index + match[0].length\n }\n chunks.push(str.slice(index))\n\n return chunks.join(\"\")\n}\n\n/**\n * The class to find patterns as considering escape sequences.\n */\nexport class PatternMatcher {\n /**\n * Initialize this matcher.\n * @param {RegExp} pattern The pattern to match.\n * @param {{escaped:boolean}} options The options.\n */\n constructor(pattern, { escaped = false } = {}) {\n if (!(pattern instanceof RegExp)) {\n throw new TypeError(\"'pattern' should be a RegExp instance.\")\n }\n if (!pattern.flags.includes(\"g\")) {\n throw new Error(\"'pattern' should contains 'g' flag.\")\n }\n\n internal.set(this, {\n pattern: new RegExp(pattern.source, pattern.flags),\n escaped: Boolean(escaped),\n })\n }\n\n /**\n * Find the pattern in a given string.\n * @param {string} str The string to find.\n * @returns {IterableIterator} The iterator which iterate the matched information.\n */\n *execAll(str) {\n const { pattern, escaped } = internal.get(this)\n let match = null\n let lastIndex = 0\n\n pattern.lastIndex = 0\n while ((match = pattern.exec(str)) != null) {\n if (escaped || !isEscaped(str, match.index)) {\n lastIndex = pattern.lastIndex\n yield match\n pattern.lastIndex = lastIndex\n }\n }\n }\n\n /**\n * Check whether the pattern is found in a given string.\n * @param {string} str The string to check.\n * @returns {boolean} `true` if the pattern was found in the string.\n */\n test(str) {\n const it = this.execAll(str)\n const ret = it.next()\n return !ret.done\n }\n\n /**\n * Replace a given string.\n * @param {string} str The string to be replaced.\n * @param {(string|((...strs:string[])=>string))} replacer The string or function to replace. This is the same as the 2nd argument of `String.prototype.replace`.\n * @returns {string} The replaced string.\n */\n [Symbol.replace](str, replacer) {\n return typeof replacer === \"function\"\n ? replaceF(this, String(str), replacer)\n : replaceS(this, String(str), String(replacer))\n }\n}\n","import { findVariable } from \"./find-variable\"\nimport { getPropertyName } from \"./get-property-name\"\nimport { getStringIfConstant } from \"./get-string-if-constant\"\n\nconst IMPORT_TYPE = /^(?:Import|Export(?:All|Default|Named))Declaration$/u\nconst has = Function.call.bind(Object.hasOwnProperty)\n\nexport const READ = Symbol(\"read\")\nexport const CALL = Symbol(\"call\")\nexport const CONSTRUCT = Symbol(\"construct\")\nexport const ESM = Symbol(\"esm\")\n\nconst requireCall = { require: { [CALL]: true } }\n\n/**\n * Check whether a given variable is modified or not.\n * @param {Variable} variable The variable to check.\n * @returns {boolean} `true` if the variable is modified.\n */\nfunction isModifiedGlobal(variable) {\n return (\n variable == null ||\n variable.defs.length !== 0 ||\n variable.references.some(r => r.isWrite())\n )\n}\n\n/**\n * Check if the value of a given node is passed through to the parent syntax as-is.\n * For example, `a` and `b` in (`a || b` and `c ? a : b`) are passed through.\n * @param {Node} node A node to check.\n * @returns {boolean} `true` if the node is passed through.\n */\nfunction isPassThrough(node) {\n const parent = node.parent\n\n switch (parent && parent.type) {\n case \"ConditionalExpression\":\n return parent.consequent === node || parent.alternate === node\n case \"LogicalExpression\":\n return true\n case \"SequenceExpression\":\n return parent.expressions[parent.expressions.length - 1] === node\n case \"ChainExpression\":\n return true\n\n default:\n return false\n }\n}\n\n/**\n * The reference tracker.\n */\nexport class ReferenceTracker {\n /**\n * Initialize this tracker.\n * @param {Scope} globalScope The global scope.\n * @param {object} [options] The options.\n * @param {\"legacy\"|\"strict\"} [options.mode=\"strict\"] The mode to determine the ImportDeclaration's behavior for CJS modules.\n * @param {string[]} [options.globalObjectNames=[\"global\",\"globalThis\",\"self\",\"window\"]] The variable names for Global Object.\n */\n constructor(\n globalScope,\n {\n mode = \"strict\",\n globalObjectNames = [\"global\", \"globalThis\", \"self\", \"window\"],\n } = {}\n ) {\n this.variableStack = []\n this.globalScope = globalScope\n this.mode = mode\n this.globalObjectNames = globalObjectNames.slice(0)\n }\n\n /**\n * Iterate the references of global variables.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateGlobalReferences(traceMap) {\n for (const key of Object.keys(traceMap)) {\n const nextTraceMap = traceMap[key]\n const path = [key]\n const variable = this.globalScope.set.get(key)\n\n if (isModifiedGlobal(variable)) {\n continue\n }\n\n yield* this._iterateVariableReferences(\n variable,\n path,\n nextTraceMap,\n true\n )\n }\n\n for (const key of this.globalObjectNames) {\n const path = []\n const variable = this.globalScope.set.get(key)\n\n if (isModifiedGlobal(variable)) {\n continue\n }\n\n yield* this._iterateVariableReferences(\n variable,\n path,\n traceMap,\n false\n )\n }\n }\n\n /**\n * Iterate the references of CommonJS modules.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateCjsReferences(traceMap) {\n for (const { node } of this.iterateGlobalReferences(requireCall)) {\n const key = getStringIfConstant(node.arguments[0])\n if (key == null || !has(traceMap, key)) {\n continue\n }\n\n const nextTraceMap = traceMap[key]\n const path = [key]\n\n if (nextTraceMap[READ]) {\n yield {\n node,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iteratePropertyReferences(node, path, nextTraceMap)\n }\n }\n\n /**\n * Iterate the references of ES modules.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *iterateEsmReferences(traceMap) {\n const programNode = this.globalScope.block\n\n for (const node of programNode.body) {\n if (!IMPORT_TYPE.test(node.type) || node.source == null) {\n continue\n }\n const moduleId = node.source.value\n\n if (!has(traceMap, moduleId)) {\n continue\n }\n const nextTraceMap = traceMap[moduleId]\n const path = [moduleId]\n\n if (nextTraceMap[READ]) {\n yield { node, path, type: READ, info: nextTraceMap[READ] }\n }\n\n if (node.type === \"ExportAllDeclaration\") {\n for (const key of Object.keys(nextTraceMap)) {\n const exportTraceMap = nextTraceMap[key]\n if (exportTraceMap[READ]) {\n yield {\n node,\n path: path.concat(key),\n type: READ,\n info: exportTraceMap[READ],\n }\n }\n }\n } else {\n for (const specifier of node.specifiers) {\n const esm = has(nextTraceMap, ESM)\n const it = this._iterateImportReferences(\n specifier,\n path,\n esm\n ? nextTraceMap\n : this.mode === \"legacy\"\n ? Object.assign(\n { default: nextTraceMap },\n nextTraceMap\n )\n : { default: nextTraceMap }\n )\n\n if (esm) {\n yield* it\n } else {\n for (const report of it) {\n report.path = report.path.filter(exceptDefault)\n if (\n report.path.length >= 2 ||\n report.type !== READ\n ) {\n yield report\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Iterate the references for a given variable.\n * @param {Variable} variable The variable to iterate that references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @param {boolean} shouldReport = The flag to report those references.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateVariableReferences(variable, path, traceMap, shouldReport) {\n if (this.variableStack.includes(variable)) {\n return\n }\n this.variableStack.push(variable)\n try {\n for (const reference of variable.references) {\n if (!reference.isRead()) {\n continue\n }\n const node = reference.identifier\n\n if (shouldReport && traceMap[READ]) {\n yield { node, path, type: READ, info: traceMap[READ] }\n }\n yield* this._iteratePropertyReferences(node, path, traceMap)\n }\n } finally {\n this.variableStack.pop()\n }\n }\n\n /**\n * Iterate the references for a given AST node.\n * @param rootNode The AST node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n //eslint-disable-next-line complexity\n *_iteratePropertyReferences(rootNode, path, traceMap) {\n let node = rootNode\n while (isPassThrough(node)) {\n node = node.parent\n }\n\n const parent = node.parent\n if (parent.type === \"MemberExpression\") {\n if (parent.object === node) {\n const key = getPropertyName(parent)\n if (key == null || !has(traceMap, key)) {\n return\n }\n\n path = path.concat(key) //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: parent,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iteratePropertyReferences(\n parent,\n path,\n nextTraceMap\n )\n }\n return\n }\n if (parent.type === \"CallExpression\") {\n if (parent.callee === node && traceMap[CALL]) {\n yield { node: parent, path, type: CALL, info: traceMap[CALL] }\n }\n return\n }\n if (parent.type === \"NewExpression\") {\n if (parent.callee === node && traceMap[CONSTRUCT]) {\n yield {\n node: parent,\n path,\n type: CONSTRUCT,\n info: traceMap[CONSTRUCT],\n }\n }\n return\n }\n if (parent.type === \"AssignmentExpression\") {\n if (parent.right === node) {\n yield* this._iterateLhsReferences(parent.left, path, traceMap)\n yield* this._iteratePropertyReferences(parent, path, traceMap)\n }\n return\n }\n if (parent.type === \"AssignmentPattern\") {\n if (parent.right === node) {\n yield* this._iterateLhsReferences(parent.left, path, traceMap)\n }\n return\n }\n if (parent.type === \"VariableDeclarator\") {\n if (parent.init === node) {\n yield* this._iterateLhsReferences(parent.id, path, traceMap)\n }\n }\n }\n\n /**\n * Iterate the references for a given Pattern node.\n * @param {Node} patternNode The Pattern node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateLhsReferences(patternNode, path, traceMap) {\n if (patternNode.type === \"Identifier\") {\n const variable = findVariable(this.globalScope, patternNode)\n if (variable != null) {\n yield* this._iterateVariableReferences(\n variable,\n path,\n traceMap,\n false\n )\n }\n return\n }\n if (patternNode.type === \"ObjectPattern\") {\n for (const property of patternNode.properties) {\n const key = getPropertyName(property)\n\n if (key == null || !has(traceMap, key)) {\n continue\n }\n\n const nextPath = path.concat(key)\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: property,\n path: nextPath,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iterateLhsReferences(\n property.value,\n nextPath,\n nextTraceMap\n )\n }\n return\n }\n if (patternNode.type === \"AssignmentPattern\") {\n yield* this._iterateLhsReferences(patternNode.left, path, traceMap)\n }\n }\n\n /**\n * Iterate the references for a given ModuleSpecifier node.\n * @param {Node} specifierNode The ModuleSpecifier node to iterate references.\n * @param {string[]} path The current path.\n * @param {object} traceMap The trace map.\n * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references.\n */\n *_iterateImportReferences(specifierNode, path, traceMap) {\n const type = specifierNode.type\n\n if (type === \"ImportSpecifier\" || type === \"ImportDefaultSpecifier\") {\n const key =\n type === \"ImportDefaultSpecifier\"\n ? \"default\"\n : specifierNode.imported.name\n if (!has(traceMap, key)) {\n return\n }\n\n path = path.concat(key) //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: specifierNode,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n yield* this._iterateVariableReferences(\n findVariable(this.globalScope, specifierNode.local),\n path,\n nextTraceMap,\n false\n )\n\n return\n }\n\n if (type === \"ImportNamespaceSpecifier\") {\n yield* this._iterateVariableReferences(\n findVariable(this.globalScope, specifierNode.local),\n path,\n traceMap,\n false\n )\n return\n }\n\n if (type === \"ExportSpecifier\") {\n const key = specifierNode.local.name\n if (!has(traceMap, key)) {\n return\n }\n\n path = path.concat(key) //eslint-disable-line no-param-reassign\n const nextTraceMap = traceMap[key]\n if (nextTraceMap[READ]) {\n yield {\n node: specifierNode,\n path,\n type: READ,\n info: nextTraceMap[READ],\n }\n }\n }\n }\n}\n\nReferenceTracker.READ = READ\nReferenceTracker.CALL = CALL\nReferenceTracker.CONSTRUCT = CONSTRUCT\nReferenceTracker.ESM = ESM\n\n/**\n * This is a predicate function for Array#filter.\n * @param {string} name A name part.\n * @param {number} index The index of the name.\n * @returns {boolean} `false` if it's default.\n */\nfunction exceptDefault(name, index) {\n return !(index === 1 && name === \"default\")\n}\n","import { findVariable } from \"./find-variable\"\nimport { getFunctionHeadLocation } from \"./get-function-head-location\"\nimport { getFunctionNameWithKind } from \"./get-function-name-with-kind\"\nimport { getInnermostScope } from \"./get-innermost-scope\"\nimport { getPropertyName } from \"./get-property-name\"\nimport { getStaticValue } from \"./get-static-value\"\nimport { getStringIfConstant } from \"./get-string-if-constant\"\nimport { hasSideEffect } from \"./has-side-effect\"\nimport { isParenthesized } from \"./is-parenthesized\"\nimport { PatternMatcher } from \"./pattern-matcher\"\nimport {\n CALL,\n CONSTRUCT,\n ESM,\n READ,\n ReferenceTracker,\n} from \"./reference-tracker\"\nimport {\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isSemicolonToken,\n} from \"./token-predicate\"\n\nexport default {\n CALL,\n CONSTRUCT,\n ESM,\n findVariable,\n getFunctionHeadLocation,\n getFunctionNameWithKind,\n getInnermostScope,\n getPropertyName,\n getStaticValue,\n getStringIfConstant,\n hasSideEffect,\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isParenthesized,\n isSemicolonToken,\n PatternMatcher,\n READ,\n ReferenceTracker,\n}\nexport {\n CALL,\n CONSTRUCT,\n ESM,\n findVariable,\n getFunctionHeadLocation,\n getFunctionNameWithKind,\n getInnermostScope,\n getPropertyName,\n getStaticValue,\n getStringIfConstant,\n hasSideEffect,\n isArrowToken,\n isClosingBraceToken,\n isClosingBracketToken,\n isClosingParenToken,\n isColonToken,\n isCommaToken,\n isCommentToken,\n isNotArrowToken,\n isNotClosingBraceToken,\n isNotClosingBracketToken,\n isNotClosingParenToken,\n isNotColonToken,\n isNotCommaToken,\n isNotCommentToken,\n isNotOpeningBraceToken,\n isNotOpeningBracketToken,\n isNotOpeningParenToken,\n isNotSemicolonToken,\n isOpeningBraceToken,\n isOpeningBracketToken,\n isOpeningParenToken,\n isParenthesized,\n isSemicolonToken,\n PatternMatcher,\n READ,\n ReferenceTracker,\n}\n"],"names":[],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,iBAAiB,CAAC,YAAY,EAAE,IAAI,EAAE;AACtD,IAAI,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAC;AAClC;AACA,IAAI,IAAI,KAAK,GAAG,aAAY;AAC5B,IAAI,IAAI,KAAK,GAAG,MAAK;AACrB,IAAI,GAAG;AACP,QAAQ,KAAK,GAAG,MAAK;AACrB,QAAQ,KAAK,MAAM,UAAU,IAAI,KAAK,CAAC,WAAW,EAAE;AACpD,YAAY,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,MAAK;AAChD;AACA,YAAY,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,QAAQ,IAAI,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE;AAC7D,gBAAgB,KAAK,GAAG,WAAU;AAClC,gBAAgB,KAAK,GAAG,KAAI;AAC5B,gBAAgB,KAAK;AACrB,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EAAE,KAAK,KAAK,CAAC,IAAI,IAAI,KAAK,SAAS,CAAC;AAC/C,CAAC;;AC1ZD,YAAe;AACf,IAAI,IAAI;AACR,IAAI,SAAS;AACb,IAAI,GAAG;AACP,IAAI,YAAY;AAChB,IAAI,uBAAuB;AAC3B,IAAI,uBAAuB;AAC3B,IAAI,iBAAiB;AACrB,IAAI,eAAe;AACnB,IAAI,cAAc;AAClB,IAAI,mBAAmB;AACvB,IAAI,aAAa;AACjB,IAAI,YAAY;AAChB,IAAI,mBAAmB;AACvB,IAAI,qBAAqB;AACzB,IAAI,mBAAmB;AACvB,IAAI,YAAY;AAChB,IAAI,YAAY;AAChB,IAAI,cAAc;AAClB,IAAI,eAAe;AACnB,IAAI,sBAAsB;AAC1B,IAAI,wBAAwB;AAC5B,IAAI,sBAAsB;AAC1B,IAAI,eAAe;AACnB,IAAI,eAAe;AACnB,IAAI,iBAAiB;AACrB,IAAI,sBAAsB;AAC1B,IAAI,wBAAwB;AAC5B,IAAI,sBAAsB;AAC1B,IAAI,mBAAmB;AACvB,IAAI,mBAAmB;AACvB,IAAI,qBAAqB;AACzB,IAAI,mBAAmB;AACvB,IAAI,eAAe;AACnB,IAAI,gBAAgB;AACpB,IAAI,cAAc;AAClB,IAAI,IAAI;AACR,IAAI,gBAAgB;AACpB,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/eslint-utils/node_modules/eslint-visitor-keys/CHANGELOG.md b/node_modules/eslint-utils/node_modules/eslint-visitor-keys/CHANGELOG.md new file mode 100644 index 000000000..dc1d4b5ec --- /dev/null +++ b/node_modules/eslint-utils/node_modules/eslint-visitor-keys/CHANGELOG.md @@ -0,0 +1,25 @@ +v1.3.0 - June 19, 2020 + +* [`c92dd7f`](https://github.com/eslint/eslint-visitor-keys/commit/c92dd7ff96f0044dba12d681406a025b92b4c437) Update: add `ChainExpression` node (#12) (Toru Nagashima) + +v1.2.0 - June 4, 2020 + +* [`21f28bf`](https://github.com/eslint/eslint-visitor-keys/commit/21f28bf11be5329d740a8bf6bdbcd0ef13bbf1a2) Update: added exported in exportAllDeclaration key (#10) (Anix) + +v1.1.0 - August 13, 2019 + +* [`9331cc0`](https://github.com/eslint/eslint-visitor-keys/commit/9331cc09e756e65b9044c9186445a474b037fac6) Update: add ImportExpression (#8) (Toru Nagashima) +* [`5967f58`](https://github.com/eslint/eslint-visitor-keys/commit/5967f583b04f17fba9226aaa394e45d476d2b8af) Chore: add supported Node.js versions to CI (#7) (Kai Cataldo) +* [`6f7c60f`](https://github.com/eslint/eslint-visitor-keys/commit/6f7c60fef2ceec9f6323202df718321cec45cab0) Upgrade: eslint-release@1.0.0 (#5) (Teddy Katz) + +v1.0.0 - December 18, 2017 + +* 1f6bd38 Breaking: update keys (#4) (Toru Nagashima) + +v0.1.0 - November 17, 2017 + +* 17b4a88 Chore: update `repository` field in package.json (#3) (Toru Nagashima) +* a5a026b New: eslint-visitor-keys (#1) (Toru Nagashima) +* a1a48b8 Update: Change license to Apache 2 (#2) (Ilya Volodin) +* 2204715 Initial commit (Toru Nagashima) + diff --git a/node_modules/eslint-utils/node_modules/eslint-visitor-keys/LICENSE b/node_modules/eslint-utils/node_modules/eslint-visitor-keys/LICENSE new file mode 100644 index 000000000..17a25538d --- /dev/null +++ b/node_modules/eslint-utils/node_modules/eslint-visitor-keys/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright contributors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/eslint-utils/node_modules/eslint-visitor-keys/README.md b/node_modules/eslint-utils/node_modules/eslint-visitor-keys/README.md new file mode 100644 index 000000000..250f5fa31 --- /dev/null +++ b/node_modules/eslint-utils/node_modules/eslint-visitor-keys/README.md @@ -0,0 +1,98 @@ +# eslint-visitor-keys + +[![npm version](https://img.shields.io/npm/v/eslint-visitor-keys.svg)](https://www.npmjs.com/package/eslint-visitor-keys) +[![Downloads/month](https://img.shields.io/npm/dm/eslint-visitor-keys.svg)](http://www.npmtrends.com/eslint-visitor-keys) +[![Build Status](https://travis-ci.org/eslint/eslint-visitor-keys.svg?branch=master)](https://travis-ci.org/eslint/eslint-visitor-keys) +[![Dependency Status](https://david-dm.org/eslint/eslint-visitor-keys.svg)](https://david-dm.org/eslint/eslint-visitor-keys) + +Constants and utilities about visitor keys to traverse AST. + +## 💿 Installation + +Use [npm] to install. + +```bash +$ npm install eslint-visitor-keys +``` + +### Requirements + +- [Node.js] 4.0.0 or later. + +## 📖 Usage + +```js +const evk = require("eslint-visitor-keys") +``` + +### evk.KEYS + +> type: `{ [type: string]: string[] | undefined }` + +Visitor keys. This keys are frozen. + +This is an object. Keys are the type of [ESTree] nodes. Their values are an array of property names which have child nodes. + +For example: + +``` +console.log(evk.KEYS.AssignmentExpression) // → ["left", "right"] +``` + +### evk.getKeys(node) + +> type: `(node: object) => string[]` + +Get the visitor keys of a given AST node. + +This is similar to `Object.keys(node)` of ES Standard, but some keys are excluded: `parent`, `leadingComments`, `trailingComments`, and names which start with `_`. + +This will be used to traverse unknown nodes. + +For example: + +``` +const node = { + type: "AssignmentExpression", + left: { type: "Identifier", name: "foo" }, + right: { type: "Literal", value: 0 } +} +console.log(evk.getKeys(node)) // → ["type", "left", "right"] +``` + +### evk.unionWith(additionalKeys) + +> type: `(additionalKeys: object) => { [type: string]: string[] | undefined }` + +Make the union set with `evk.KEYS` and the given keys. + +- The order of keys is, `additionalKeys` is at first, then `evk.KEYS` is concatenated after that. +- It removes duplicated keys as keeping the first one. + +For example: + +``` +console.log(evk.unionWith({ + MethodDefinition: ["decorators"] +})) // → { ..., MethodDefinition: ["decorators", "key", "value"], ... } +``` + +## 📰 Change log + +See [GitHub releases](https://github.com/eslint/eslint-visitor-keys/releases). + +## 🍻 Contributing + +Welcome. See [ESLint contribution guidelines](https://eslint.org/docs/developer-guide/contributing/). + +### Development commands + +- `npm test` runs tests and measures code coverage. +- `npm run lint` checks source codes with ESLint. +- `npm run coverage` opens the code coverage report of the previous test with your default browser. +- `npm run release` publishes this package to [npm] registory. + + +[npm]: https://www.npmjs.com/ +[Node.js]: https://nodejs.org/en/ +[ESTree]: https://github.com/estree/estree diff --git a/node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/index.js b/node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/index.js new file mode 100644 index 000000000..cd8a32608 --- /dev/null +++ b/node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/index.js @@ -0,0 +1,81 @@ +/** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ +"use strict"; + +const KEYS = require("./visitor-keys.json"); + +// Types. +const NODE_TYPES = Object.freeze(Object.keys(KEYS)); + +// Freeze the keys. +for (const type of NODE_TYPES) { + Object.freeze(KEYS[type]); +} +Object.freeze(KEYS); + +// List to ignore keys. +const KEY_BLACKLIST = new Set([ + "parent", + "leadingComments", + "trailingComments" +]); + +/** + * Check whether a given key should be used or not. + * @param {string} key The key to check. + * @returns {boolean} `true` if the key should be used. + */ +function filterKey(key) { + return !KEY_BLACKLIST.has(key) && key[0] !== "_"; +} + +//------------------------------------------------------------------------------ +// Public interfaces +//------------------------------------------------------------------------------ + +module.exports = Object.freeze({ + + /** + * Visitor keys. + * @type {{ [type: string]: string[] | undefined }} + */ + KEYS, + + /** + * Get visitor keys of a given node. + * @param {Object} node The AST node to get keys. + * @returns {string[]} Visitor keys of the node. + */ + getKeys(node) { + return Object.keys(node).filter(filterKey); + }, + + // Disable valid-jsdoc rule because it reports syntax error on the type of @returns. + // eslint-disable-next-line valid-jsdoc + /** + * Make the union set with `KEYS` and given keys. + * @param {Object} additionalKeys The additional keys. + * @returns {{ [type: string]: string[] | undefined }} The union set. + */ + unionWith(additionalKeys) { + const retv = Object.assign({}, KEYS); + + for (const type of Object.keys(additionalKeys)) { + if (retv.hasOwnProperty(type)) { + const keys = new Set(additionalKeys[type]); + + for (const key of retv[type]) { + keys.add(key); + } + + retv[type] = Object.freeze(Array.from(keys)); + } else { + retv[type] = Object.freeze(Array.from(additionalKeys[type])); + } + } + + return Object.freeze(retv); + } +}); diff --git a/node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/visitor-keys.json b/node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/visitor-keys.json new file mode 100644 index 000000000..a33bbc660 --- /dev/null +++ b/node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/visitor-keys.json @@ -0,0 +1,284 @@ +{ + "AssignmentExpression": [ + "left", + "right" + ], + "AssignmentPattern": [ + "left", + "right" + ], + "ArrayExpression": [ + "elements" + ], + "ArrayPattern": [ + "elements" + ], + "ArrowFunctionExpression": [ + "params", + "body" + ], + "AwaitExpression": [ + "argument" + ], + "BlockStatement": [ + "body" + ], + "BinaryExpression": [ + "left", + "right" + ], + "BreakStatement": [ + "label" + ], + "CallExpression": [ + "callee", + "arguments" + ], + "CatchClause": [ + "param", + "body" + ], + "ChainExpression": [ + "expression" + ], + "ClassBody": [ + "body" + ], + "ClassDeclaration": [ + "id", + "superClass", + "body" + ], + "ClassExpression": [ + "id", + "superClass", + "body" + ], + "ConditionalExpression": [ + "test", + "consequent", + "alternate" + ], + "ContinueStatement": [ + "label" + ], + "DebuggerStatement": [], + "DoWhileStatement": [ + "body", + "test" + ], + "EmptyStatement": [], + "ExportAllDeclaration": [ + "exported", + "source" + ], + "ExportDefaultDeclaration": [ + "declaration" + ], + "ExportNamedDeclaration": [ + "declaration", + "specifiers", + "source" + ], + "ExportSpecifier": [ + "exported", + "local" + ], + "ExpressionStatement": [ + "expression" + ], + "ExperimentalRestProperty": [ + "argument" + ], + "ExperimentalSpreadProperty": [ + "argument" + ], + "ForStatement": [ + "init", + "test", + "update", + "body" + ], + "ForInStatement": [ + "left", + "right", + "body" + ], + "ForOfStatement": [ + "left", + "right", + "body" + ], + "FunctionDeclaration": [ + "id", + "params", + "body" + ], + "FunctionExpression": [ + "id", + "params", + "body" + ], + "Identifier": [], + "IfStatement": [ + "test", + "consequent", + "alternate" + ], + "ImportDeclaration": [ + "specifiers", + "source" + ], + "ImportDefaultSpecifier": [ + "local" + ], + "ImportExpression": [ + "source" + ], + "ImportNamespaceSpecifier": [ + "local" + ], + "ImportSpecifier": [ + "imported", + "local" + ], + "JSXAttribute": [ + "name", + "value" + ], + "JSXClosingElement": [ + "name" + ], + "JSXElement": [ + "openingElement", + "children", + "closingElement" + ], + "JSXEmptyExpression": [], + "JSXExpressionContainer": [ + "expression" + ], + "JSXIdentifier": [], + "JSXMemberExpression": [ + "object", + "property" + ], + "JSXNamespacedName": [ + "namespace", + "name" + ], + "JSXOpeningElement": [ + "name", + "attributes" + ], + "JSXSpreadAttribute": [ + "argument" + ], + "JSXText": [], + "JSXFragment": [ + "openingFragment", + "children", + "closingFragment" + ], + "Literal": [], + "LabeledStatement": [ + "label", + "body" + ], + "LogicalExpression": [ + "left", + "right" + ], + "MemberExpression": [ + "object", + "property" + ], + "MetaProperty": [ + "meta", + "property" + ], + "MethodDefinition": [ + "key", + "value" + ], + "NewExpression": [ + "callee", + "arguments" + ], + "ObjectExpression": [ + "properties" + ], + "ObjectPattern": [ + "properties" + ], + "Program": [ + "body" + ], + "Property": [ + "key", + "value" + ], + "RestElement": [ + "argument" + ], + "ReturnStatement": [ + "argument" + ], + "SequenceExpression": [ + "expressions" + ], + "SpreadElement": [ + "argument" + ], + "Super": [], + "SwitchStatement": [ + "discriminant", + "cases" + ], + "SwitchCase": [ + "test", + "consequent" + ], + "TaggedTemplateExpression": [ + "tag", + "quasi" + ], + "TemplateElement": [], + "TemplateLiteral": [ + "quasis", + "expressions" + ], + "ThisExpression": [], + "ThrowStatement": [ + "argument" + ], + "TryStatement": [ + "block", + "handler", + "finalizer" + ], + "UnaryExpression": [ + "argument" + ], + "UpdateExpression": [ + "argument" + ], + "VariableDeclaration": [ + "declarations" + ], + "VariableDeclarator": [ + "id", + "init" + ], + "WhileStatement": [ + "test", + "body" + ], + "WithStatement": [ + "object", + "body" + ], + "YieldExpression": [ + "argument" + ] +} diff --git a/node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json b/node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json new file mode 100644 index 000000000..98262a15c --- /dev/null +++ b/node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json @@ -0,0 +1,40 @@ +{ + "name": "eslint-visitor-keys", + "version": "1.3.0", + "description": "Constants and utilities about visitor keys to traverse AST.", + "main": "lib/index.js", + "files": [ + "lib" + ], + "engines": { + "node": ">=4" + }, + "dependencies": {}, + "devDependencies": { + "eslint": "^4.7.2", + "eslint-config-eslint": "^4.0.0", + "eslint-release": "^1.0.0", + "mocha": "^3.5.3", + "nyc": "^11.2.1", + "opener": "^1.4.3" + }, + "scripts": { + "lint": "eslint lib tests/lib", + "pretest": "npm run -s lint", + "test": "nyc mocha tests/lib", + "coverage": "nyc report --reporter lcov && opener coverage/lcov-report/index.html", + "generate-release": "eslint-generate-release", + "generate-alpharelease": "eslint-generate-prerelease alpha", + "generate-betarelease": "eslint-generate-prerelease beta", + "generate-rcrelease": "eslint-generate-prerelease rc", + "publish-release": "eslint-publish-release" + }, + "repository": "eslint/eslint-visitor-keys", + "keywords": [], + "author": "Toru Nagashima (https://github.com/mysticatea)", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/eslint/eslint-visitor-keys/issues" + }, + "homepage": "https://github.com/eslint/eslint-visitor-keys#readme" +} \ No newline at end of file diff --git a/node_modules/eslint-utils/package.json b/node_modules/eslint-utils/package.json new file mode 100644 index 000000000..1de02b13c --- /dev/null +++ b/node_modules/eslint-utils/package.json @@ -0,0 +1,65 @@ +{ + "name": "eslint-utils", + "version": "2.1.0", + "description": "Utilities for ESLint plugins.", + "engines": { + "node": ">=6" + }, + "sideEffects": false, + "main": "index", + "module": "index.mjs", + "files": [ + "index.*" + ], + "dependencies": { + "eslint-visitor-keys": "^1.1.0" + }, + "devDependencies": { + "@mysticatea/eslint-plugin": "^12.0.0", + "codecov": "^3.6.1", + "dot-prop": "^4.2.0", + "eslint": "^6.5.1", + "esm": "^3.2.25", + "espree": "^6.1.1", + "mocha": "^6.2.2", + "npm-run-all": "^4.1.5", + "nyc": "^14.1.1", + "opener": "^1.5.1", + "rimraf": "^3.0.0", + "rollup": "^1.25.0", + "rollup-plugin-sourcemaps": "^0.4.2", + "semver": "^7.3.2", + "vuepress": "^1.2.0", + "warun": "^1.0.0" + }, + "scripts": { + "prebuild": "npm run -s clean", + "build": "rollup -c", + "clean": "rimraf .nyc_output coverage index.*", + "codecov": "nyc report -r lcovonly && codecov", + "coverage": "opener ./coverage/lcov-report/index.html", + "docs:build": "vuepress build docs", + "docs:watch": "vuepress dev docs", + "lint": "eslint src test", + "test": "run-s lint build test:mocha", + "test:mocha": "nyc mocha --reporter dot \"test/*.js\"", + "preversion": "npm test && npm run -s build", + "postversion": "git push && git push --tags", + "prewatch": "npm run -s clean", + "watch": "warun \"{src,test}/**/*.js\" -- npm run -s test:mocha" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/mysticatea/eslint-utils.git" + }, + "keywords": [ + "eslint" + ], + "author": "Toru Nagashima", + "license": "MIT", + "bugs": { + "url": "https://github.com/mysticatea/eslint-utils/issues" + }, + "homepage": "https://github.com/mysticatea/eslint-utils#readme", + "funding": "https://github.com/sponsors/mysticatea" +} \ No newline at end of file diff --git a/node_modules/eslint-visitor-keys/CHANGELOG.md b/node_modules/eslint-visitor-keys/CHANGELOG.md new file mode 100644 index 000000000..a980b62d2 --- /dev/null +++ b/node_modules/eslint-visitor-keys/CHANGELOG.md @@ -0,0 +1,30 @@ +v2.0.0 - August 14, 2020 + +* [`fb86ca3`](https://github.com/eslint/eslint-visitor-keys/commit/fb86ca315daafc84e23ed9005db40b0892b972a6) Breaking: drop support for Node <10 (#13) (Kai Cataldo) +* [`69383b3`](https://github.com/eslint/eslint-visitor-keys/commit/69383b372915e33ada094880ecc6b6e8f8c7ca4e) Chore: move to GitHub Actions (#14) (Kai Cataldo) + +v1.3.0 - June 19, 2020 + +* [`c92dd7f`](https://github.com/eslint/eslint-visitor-keys/commit/c92dd7ff96f0044dba12d681406a025b92b4c437) Update: add `ChainExpression` node (#12) (Toru Nagashima) + +v1.2.0 - June 4, 2020 + +* [`21f28bf`](https://github.com/eslint/eslint-visitor-keys/commit/21f28bf11be5329d740a8bf6bdbcd0ef13bbf1a2) Update: added exported in exportAllDeclaration key (#10) (Anix) + +v1.1.0 - August 13, 2019 + +* [`9331cc0`](https://github.com/eslint/eslint-visitor-keys/commit/9331cc09e756e65b9044c9186445a474b037fac6) Update: add ImportExpression (#8) (Toru Nagashima) +* [`5967f58`](https://github.com/eslint/eslint-visitor-keys/commit/5967f583b04f17fba9226aaa394e45d476d2b8af) Chore: add supported Node.js versions to CI (#7) (Kai Cataldo) +* [`6f7c60f`](https://github.com/eslint/eslint-visitor-keys/commit/6f7c60fef2ceec9f6323202df718321cec45cab0) Upgrade: eslint-release@1.0.0 (#5) (Teddy Katz) + +v1.0.0 - December 18, 2017 + +* 1f6bd38 Breaking: update keys (#4) (Toru Nagashima) + +v0.1.0 - November 17, 2017 + +* 17b4a88 Chore: update `repository` field in package.json (#3) (Toru Nagashima) +* a5a026b New: eslint-visitor-keys (#1) (Toru Nagashima) +* a1a48b8 Update: Change license to Apache 2 (#2) (Ilya Volodin) +* 2204715 Initial commit (Toru Nagashima) + diff --git a/node_modules/eslint-visitor-keys/LICENSE b/node_modules/eslint-visitor-keys/LICENSE new file mode 100644 index 000000000..17a25538d --- /dev/null +++ b/node_modules/eslint-visitor-keys/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright contributors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/eslint-visitor-keys/README.md b/node_modules/eslint-visitor-keys/README.md new file mode 100644 index 000000000..250f5fa31 --- /dev/null +++ b/node_modules/eslint-visitor-keys/README.md @@ -0,0 +1,98 @@ +# eslint-visitor-keys + +[![npm version](https://img.shields.io/npm/v/eslint-visitor-keys.svg)](https://www.npmjs.com/package/eslint-visitor-keys) +[![Downloads/month](https://img.shields.io/npm/dm/eslint-visitor-keys.svg)](http://www.npmtrends.com/eslint-visitor-keys) +[![Build Status](https://travis-ci.org/eslint/eslint-visitor-keys.svg?branch=master)](https://travis-ci.org/eslint/eslint-visitor-keys) +[![Dependency Status](https://david-dm.org/eslint/eslint-visitor-keys.svg)](https://david-dm.org/eslint/eslint-visitor-keys) + +Constants and utilities about visitor keys to traverse AST. + +## 💿 Installation + +Use [npm] to install. + +```bash +$ npm install eslint-visitor-keys +``` + +### Requirements + +- [Node.js] 4.0.0 or later. + +## 📖 Usage + +```js +const evk = require("eslint-visitor-keys") +``` + +### evk.KEYS + +> type: `{ [type: string]: string[] | undefined }` + +Visitor keys. This keys are frozen. + +This is an object. Keys are the type of [ESTree] nodes. Their values are an array of property names which have child nodes. + +For example: + +``` +console.log(evk.KEYS.AssignmentExpression) // → ["left", "right"] +``` + +### evk.getKeys(node) + +> type: `(node: object) => string[]` + +Get the visitor keys of a given AST node. + +This is similar to `Object.keys(node)` of ES Standard, but some keys are excluded: `parent`, `leadingComments`, `trailingComments`, and names which start with `_`. + +This will be used to traverse unknown nodes. + +For example: + +``` +const node = { + type: "AssignmentExpression", + left: { type: "Identifier", name: "foo" }, + right: { type: "Literal", value: 0 } +} +console.log(evk.getKeys(node)) // → ["type", "left", "right"] +``` + +### evk.unionWith(additionalKeys) + +> type: `(additionalKeys: object) => { [type: string]: string[] | undefined }` + +Make the union set with `evk.KEYS` and the given keys. + +- The order of keys is, `additionalKeys` is at first, then `evk.KEYS` is concatenated after that. +- It removes duplicated keys as keeping the first one. + +For example: + +``` +console.log(evk.unionWith({ + MethodDefinition: ["decorators"] +})) // → { ..., MethodDefinition: ["decorators", "key", "value"], ... } +``` + +## 📰 Change log + +See [GitHub releases](https://github.com/eslint/eslint-visitor-keys/releases). + +## 🍻 Contributing + +Welcome. See [ESLint contribution guidelines](https://eslint.org/docs/developer-guide/contributing/). + +### Development commands + +- `npm test` runs tests and measures code coverage. +- `npm run lint` checks source codes with ESLint. +- `npm run coverage` opens the code coverage report of the previous test with your default browser. +- `npm run release` publishes this package to [npm] registory. + + +[npm]: https://www.npmjs.com/ +[Node.js]: https://nodejs.org/en/ +[ESTree]: https://github.com/estree/estree diff --git a/node_modules/eslint-visitor-keys/lib/index.js b/node_modules/eslint-visitor-keys/lib/index.js new file mode 100644 index 000000000..cd8a32608 --- /dev/null +++ b/node_modules/eslint-visitor-keys/lib/index.js @@ -0,0 +1,81 @@ +/** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ +"use strict"; + +const KEYS = require("./visitor-keys.json"); + +// Types. +const NODE_TYPES = Object.freeze(Object.keys(KEYS)); + +// Freeze the keys. +for (const type of NODE_TYPES) { + Object.freeze(KEYS[type]); +} +Object.freeze(KEYS); + +// List to ignore keys. +const KEY_BLACKLIST = new Set([ + "parent", + "leadingComments", + "trailingComments" +]); + +/** + * Check whether a given key should be used or not. + * @param {string} key The key to check. + * @returns {boolean} `true` if the key should be used. + */ +function filterKey(key) { + return !KEY_BLACKLIST.has(key) && key[0] !== "_"; +} + +//------------------------------------------------------------------------------ +// Public interfaces +//------------------------------------------------------------------------------ + +module.exports = Object.freeze({ + + /** + * Visitor keys. + * @type {{ [type: string]: string[] | undefined }} + */ + KEYS, + + /** + * Get visitor keys of a given node. + * @param {Object} node The AST node to get keys. + * @returns {string[]} Visitor keys of the node. + */ + getKeys(node) { + return Object.keys(node).filter(filterKey); + }, + + // Disable valid-jsdoc rule because it reports syntax error on the type of @returns. + // eslint-disable-next-line valid-jsdoc + /** + * Make the union set with `KEYS` and given keys. + * @param {Object} additionalKeys The additional keys. + * @returns {{ [type: string]: string[] | undefined }} The union set. + */ + unionWith(additionalKeys) { + const retv = Object.assign({}, KEYS); + + for (const type of Object.keys(additionalKeys)) { + if (retv.hasOwnProperty(type)) { + const keys = new Set(additionalKeys[type]); + + for (const key of retv[type]) { + keys.add(key); + } + + retv[type] = Object.freeze(Array.from(keys)); + } else { + retv[type] = Object.freeze(Array.from(additionalKeys[type])); + } + } + + return Object.freeze(retv); + } +}); diff --git a/node_modules/eslint-visitor-keys/lib/visitor-keys.json b/node_modules/eslint-visitor-keys/lib/visitor-keys.json new file mode 100644 index 000000000..a33bbc660 --- /dev/null +++ b/node_modules/eslint-visitor-keys/lib/visitor-keys.json @@ -0,0 +1,284 @@ +{ + "AssignmentExpression": [ + "left", + "right" + ], + "AssignmentPattern": [ + "left", + "right" + ], + "ArrayExpression": [ + "elements" + ], + "ArrayPattern": [ + "elements" + ], + "ArrowFunctionExpression": [ + "params", + "body" + ], + "AwaitExpression": [ + "argument" + ], + "BlockStatement": [ + "body" + ], + "BinaryExpression": [ + "left", + "right" + ], + "BreakStatement": [ + "label" + ], + "CallExpression": [ + "callee", + "arguments" + ], + "CatchClause": [ + "param", + "body" + ], + "ChainExpression": [ + "expression" + ], + "ClassBody": [ + "body" + ], + "ClassDeclaration": [ + "id", + "superClass", + "body" + ], + "ClassExpression": [ + "id", + "superClass", + "body" + ], + "ConditionalExpression": [ + "test", + "consequent", + "alternate" + ], + "ContinueStatement": [ + "label" + ], + "DebuggerStatement": [], + "DoWhileStatement": [ + "body", + "test" + ], + "EmptyStatement": [], + "ExportAllDeclaration": [ + "exported", + "source" + ], + "ExportDefaultDeclaration": [ + "declaration" + ], + "ExportNamedDeclaration": [ + "declaration", + "specifiers", + "source" + ], + "ExportSpecifier": [ + "exported", + "local" + ], + "ExpressionStatement": [ + "expression" + ], + "ExperimentalRestProperty": [ + "argument" + ], + "ExperimentalSpreadProperty": [ + "argument" + ], + "ForStatement": [ + "init", + "test", + "update", + "body" + ], + "ForInStatement": [ + "left", + "right", + "body" + ], + "ForOfStatement": [ + "left", + "right", + "body" + ], + "FunctionDeclaration": [ + "id", + "params", + "body" + ], + "FunctionExpression": [ + "id", + "params", + "body" + ], + "Identifier": [], + "IfStatement": [ + "test", + "consequent", + "alternate" + ], + "ImportDeclaration": [ + "specifiers", + "source" + ], + "ImportDefaultSpecifier": [ + "local" + ], + "ImportExpression": [ + "source" + ], + "ImportNamespaceSpecifier": [ + "local" + ], + "ImportSpecifier": [ + "imported", + "local" + ], + "JSXAttribute": [ + "name", + "value" + ], + "JSXClosingElement": [ + "name" + ], + "JSXElement": [ + "openingElement", + "children", + "closingElement" + ], + "JSXEmptyExpression": [], + "JSXExpressionContainer": [ + "expression" + ], + "JSXIdentifier": [], + "JSXMemberExpression": [ + "object", + "property" + ], + "JSXNamespacedName": [ + "namespace", + "name" + ], + "JSXOpeningElement": [ + "name", + "attributes" + ], + "JSXSpreadAttribute": [ + "argument" + ], + "JSXText": [], + "JSXFragment": [ + "openingFragment", + "children", + "closingFragment" + ], + "Literal": [], + "LabeledStatement": [ + "label", + "body" + ], + "LogicalExpression": [ + "left", + "right" + ], + "MemberExpression": [ + "object", + "property" + ], + "MetaProperty": [ + "meta", + "property" + ], + "MethodDefinition": [ + "key", + "value" + ], + "NewExpression": [ + "callee", + "arguments" + ], + "ObjectExpression": [ + "properties" + ], + "ObjectPattern": [ + "properties" + ], + "Program": [ + "body" + ], + "Property": [ + "key", + "value" + ], + "RestElement": [ + "argument" + ], + "ReturnStatement": [ + "argument" + ], + "SequenceExpression": [ + "expressions" + ], + "SpreadElement": [ + "argument" + ], + "Super": [], + "SwitchStatement": [ + "discriminant", + "cases" + ], + "SwitchCase": [ + "test", + "consequent" + ], + "TaggedTemplateExpression": [ + "tag", + "quasi" + ], + "TemplateElement": [], + "TemplateLiteral": [ + "quasis", + "expressions" + ], + "ThisExpression": [], + "ThrowStatement": [ + "argument" + ], + "TryStatement": [ + "block", + "handler", + "finalizer" + ], + "UnaryExpression": [ + "argument" + ], + "UpdateExpression": [ + "argument" + ], + "VariableDeclaration": [ + "declarations" + ], + "VariableDeclarator": [ + "id", + "init" + ], + "WhileStatement": [ + "test", + "body" + ], + "WithStatement": [ + "object", + "body" + ], + "YieldExpression": [ + "argument" + ] +} diff --git a/node_modules/eslint-visitor-keys/package.json b/node_modules/eslint-visitor-keys/package.json new file mode 100644 index 000000000..959b51792 --- /dev/null +++ b/node_modules/eslint-visitor-keys/package.json @@ -0,0 +1,39 @@ +{ + "name": "eslint-visitor-keys", + "version": "2.0.0", + "description": "Constants and utilities about visitor keys to traverse AST.", + "main": "lib/index.js", + "files": [ + "lib" + ], + "engines": { + "node": ">=10" + }, + "dependencies": {}, + "devDependencies": { + "eslint": "^4.7.2", + "eslint-config-eslint": "^4.0.0", + "eslint-release": "^1.0.0", + "mocha": "^3.5.3", + "nyc": "^11.2.1", + "opener": "^1.4.3" + }, + "scripts": { + "lint": "eslint lib tests/lib", + "test": "nyc mocha tests/lib", + "coverage": "nyc report --reporter lcov && opener coverage/lcov-report/index.html", + "generate-release": "eslint-generate-release", + "generate-alpharelease": "eslint-generate-prerelease alpha", + "generate-betarelease": "eslint-generate-prerelease beta", + "generate-rcrelease": "eslint-generate-prerelease rc", + "publish-release": "eslint-publish-release" + }, + "repository": "eslint/eslint-visitor-keys", + "keywords": [], + "author": "Toru Nagashima (https://github.com/mysticatea)", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/eslint/eslint-visitor-keys/issues" + }, + "homepage": "https://github.com/eslint/eslint-visitor-keys#readme" +} \ No newline at end of file diff --git a/node_modules/eslint/CHANGELOG.md b/node_modules/eslint/CHANGELOG.md new file mode 100644 index 000000000..289852651 --- /dev/null +++ b/node_modules/eslint/CHANGELOG.md @@ -0,0 +1,6201 @@ +v7.9.0 - September 12, 2020 + +* [`3ca2700`](https://github.com/eslint/eslint/commit/3ca27004ece5016ba7aed775f01ad13bc9282296) Fix: Corrected notice for invalid (:) plugin names (#13473) (Josh Goldberg) +* [`fc5783d`](https://github.com/eslint/eslint/commit/fc5783d2ff9e3b0d7a1f9664928d49270b4a6c01) Docs: Fix leaky anchors in v4 migration page (#13635) (Timo Tijhof) +* [`f1d07f1`](https://github.com/eslint/eslint/commit/f1d07f112be96c64dfdaa154aa9ac81985b16238) Docs: Provide install commands for Yarn (#13661) (Nikita Baksalyar) +* [`29d1cdc`](https://github.com/eslint/eslint/commit/29d1cdceedd6c056a39149723cf9ff2fbb260cbf) Fix: prefer-destructuring removes comments (refs #13678) (#13682) (Milos Djermanovic) +* [`b4da0a7`](https://github.com/eslint/eslint/commit/b4da0a7ca7995435bdfc116fd374eb0649470131) Docs: fix typo in working with plugins docs (#13683) (啸生) +* [`6f87db7`](https://github.com/eslint/eslint/commit/6f87db7c318225e48ccbbf0bec8b3758ea839b82) Update: fix id-length false negatives on Object.prototype property names (#13670) (Milos Djermanovic) +* [`361ac4d`](https://github.com/eslint/eslint/commit/361ac4d895c15086fb4351d4dca1405b2fdc4bd5) Fix: NonOctalDecimalIntegerLiteral is decimal integer (fixes #13588) (#13664) (Milos Djermanovic) +* [`f260716`](https://github.com/eslint/eslint/commit/f260716695064e4b4193337107b60401bd4b3f20) Docs: update outdated link (#13677) (klkhan) +* [`5138c91`](https://github.com/eslint/eslint/commit/5138c913c256e4266ffb68278783af45bf70af84) Docs: add missing eslint directive comments in no-await-in-loop (#13673) (Milos Djermanovic) +* [`17b58b5`](https://github.com/eslint/eslint/commit/17b58b528df62bf96813d50c087cafdf83306810) Docs: clarify correct example in no-return-await (fixes #13656) (#13657) (Milos Djermanovic) +* [`9171f0a`](https://github.com/eslint/eslint/commit/9171f0a99bb4d7c53f109b1c2b215004a7c27713) Chore: fix typo (#13660) (Nitin Kumar) +* [`6d9f8fb`](https://github.com/eslint/eslint/commit/6d9f8fbb7ed4361b475fb50d04e6d25744d5b1a2) Sponsors: Sync README with website (ESLint Jenkins) +* [`97b0dd9`](https://github.com/eslint/eslint/commit/97b0dd9a1af1ae4ae3857adcfe6eeac7837101ed) Sponsors: Sync README with website (ESLint Jenkins) +* [`deab125`](https://github.com/eslint/eslint/commit/deab125fc9220dab43baeb32c6cf78942ad25a83) Sponsors: Sync README with website (ESLint Jenkins) +* [`bf2e367`](https://github.com/eslint/eslint/commit/bf2e367bf4f6fde9930af9de8b8d8bc3d8b5782f) Sponsors: Sync README with website (ESLint Jenkins) +* [`8929208`](https://github.com/eslint/eslint/commit/89292084bf91ba5ae5bf966c6c56fa3da139ce57) Sponsors: Sync README with website (ESLint Jenkins) + +v7.8.1 - September 1, 2020 + +* [`f542b5d`](https://github.com/eslint/eslint/commit/f542b5d0679b73326ad249fc44a54c3f848bd3e6) Fix: Update broken @eslint/eslintrc version (fixes #13641) (#13647) (Nicholas C. Zakas) +* [`c1b5696`](https://github.com/eslint/eslint/commit/c1b56966c2354e12d16e8394443de49fa54f4290) Sponsors: Sync README with website (ESLint Jenkins) +* [`8ddeda0`](https://github.com/eslint/eslint/commit/8ddeda01afdb1e9656a43853b8e25c9c4582e6ad) Sponsors: Sync README with website (ESLint Jenkins) +* [`e02e2fe`](https://github.com/eslint/eslint/commit/e02e2fe019a1ed9a34a7b96e4c8961c35093b0ce) Sponsors: Sync README with website (ESLint Jenkins) + +v7.8.0 - August 31, 2020 + +* [`58abd93`](https://github.com/eslint/eslint/commit/58abd9311900a8af5a3c0963daaf64675bdd8383) Update: support logical assignments in code path analysis (refs #13569) (#13612) (Milos Djermanovic) +* [`db7488e`](https://github.com/eslint/eslint/commit/db7488e6326fd1b7ea04c5062beb1c5f75fc15ed) Update: support logical assignments in core rules (refs #13569) (#13618) (Milos Djermanovic) +* [`3729219`](https://github.com/eslint/eslint/commit/372921924778f2e525535985e17c97b988546210) Docs: Update Step 1 of Development Environment documentation (klkhan) +* [`a320324`](https://github.com/eslint/eslint/commit/a32032430a0779a4e3b2d137d4d0682844084b82) Chore: Test formatted integers in no-dupe-keys (refs #13568) (#13626) (Brandon Mills) +* [`88a9ade`](https://github.com/eslint/eslint/commit/88a9ade7643bb166efbab45cee15f3269496f4be) Update: add es2021 environment (refs #13602) (#13603) (Milos Djermanovic) +* [`0003dc0`](https://github.com/eslint/eslint/commit/0003dc0f966f2b47555595586f84eb3163cb0179) Update: support numeric separators (refs #13568) (#13581) (Milos Djermanovic) +* [`96b11a0`](https://github.com/eslint/eslint/commit/96b11a0717bf32b94ec768611574372320fb774b) Update: Add exceptionPatterns to id-length rule (fixes #13094) (#13576) (sodam) +* [`3439fea`](https://github.com/eslint/eslint/commit/3439fea5c0ed330d01d874b0c9df51dd51ae792c) Update: support numeric-separator in no-loss-of-precision (refs #13568) (#13574) (Anix) +* [`ed64767`](https://github.com/eslint/eslint/commit/ed64767859d776145d68145419a61f5379b4dd63) Update: add comment to message in no-warning-comments (fixes #12327) (#13522) (Anix) +* [`e60ec07`](https://github.com/eslint/eslint/commit/e60ec07fad0c1d4c966f28d214c5379da753ff4e) Sponsors: Sync README with website (ESLint Jenkins) +* [`483bf7f`](https://github.com/eslint/eslint/commit/483bf7f3cc40e0d866798d6ca9ee1c19aa77ddd2) Docs: fix examples in object-curly-newline (#13605) (Soobin Bak) +* [`1c35d57`](https://github.com/eslint/eslint/commit/1c35d57b0a5f374cc55f1727a7561bcab1962e83) Docs: Remove stale Keybase 2FA instructions (#13622) (Brandon Mills) +* [`82669fa`](https://github.com/eslint/eslint/commit/82669fa66670a00988db5b1d10fe8f3bf30be84e) Chore: Extract some functionality to eslintrc (refs #13481) (#13613) (Nicholas C. Zakas) +* [`4111d21`](https://github.com/eslint/eslint/commit/4111d21a046b73892e2c84f92815a21ef4db63e1) Docs: Fix typo and missing article before noun in docs (#13611) (Patrice Sandhu) +* [`091e52a`](https://github.com/eslint/eslint/commit/091e52ae1ca408f3e668f394c14d214c9ce806e6) Upgrade: espree@7.3.0 (refs #13568) (#13609) (Kai Cataldo) +* [`05074fb`](https://github.com/eslint/eslint/commit/05074fb2c243e904e8c09d714ad9d084acdd80d2) Sponsors: Sync README with website (ESLint Jenkins) +* [`bdb65ec`](https://github.com/eslint/eslint/commit/bdb65ec2e672c9815bee356b61d1cd60a1072152) Chore: add 3rd party parsers in BUG_REPORT template (#13606) (YeonJuan) +* [`f954476`](https://github.com/eslint/eslint/commit/f954476fb6b0664679c73babd5e8a0647572b81f) Chore: add common 3rd party parsers to issue template (#13596) (Kai Cataldo) +* [`2bee6d2`](https://github.com/eslint/eslint/commit/2bee6d256ae0516c9a9003bb3fdca24ff93253b5) Chore: Mark config-related files (refs #13481) (#13597) (Nicholas C. Zakas) +* [`66442a9`](https://github.com/eslint/eslint/commit/66442a9faf9872db4a40f56dde28c48f4d02fc7b) Update: Add no-magic-numbers 'ignoreDefaultValues' option (#12611) (Dieter Luypaert) +* [`b487164`](https://github.com/eslint/eslint/commit/b487164d01dd0bf66fdf2df0e374ce1c3bdb0339) Docs: add exponentiation operators to operator-assignment documentation (#13577) (Milos Djermanovic) +* [`2f27836`](https://github.com/eslint/eslint/commit/2f27836e989f3dfe236e34054b490febc359bc48) Sponsors: Sync README with website (ESLint Jenkins) +* [`60eafc1`](https://github.com/eslint/eslint/commit/60eafc15075f38955cb6816bf1f0bcf6e6e6d3a6) Sponsors: Sync README with website (ESLint Jenkins) + +v7.7.0 - August 14, 2020 + +* [`b46f3ee`](https://github.com/eslint/eslint/commit/b46f3ee0dae4add9df99cae940b641ad8de58b9e) Update: allowFunctionParams option in no-underscore-dangle (fixes 12579) (#13545) (Sunghyun Cho) +* [`26aa245`](https://github.com/eslint/eslint/commit/26aa2452b5f407fabc25dad21182180e4d3be532) Docs: clarify "case" specifier in padding-line-between-statements (#13562) (Milos Djermanovic) +* [`082891c`](https://github.com/eslint/eslint/commit/082891c042d72953fe86cd3ce9c96e661760793d) Docs: Update semantic versioning policy (#13563) (Nicholas C. Zakas) +* [`4e0b672`](https://github.com/eslint/eslint/commit/4e0b672eb4bf39f7502a550b08b25a56a196f19f) Fix: revert "Update: disallow multiple options in comma-dangle schema" (#13564) (Kai Cataldo) +* [`254990e`](https://github.com/eslint/eslint/commit/254990e87914457ca25ea2d7ee012964e56fc9e5) Fix: indent for async arrow functions (fixes #13497) (#13544) (Anix) +* [`28ca339`](https://github.com/eslint/eslint/commit/28ca339259b07c96c73f2ef28cbf112b96395855) Sponsors: Sync README with website (ESLint Jenkins) +* [`2e4158d`](https://github.com/eslint/eslint/commit/2e4158d3ec9cfed6400bf70795fd7171e96ff9b3) Sponsors: Sync README with website (ESLint Jenkins) +* [`488d159`](https://github.com/eslint/eslint/commit/488d1595aef43c4d52cccdb2c97977884f0375a8) Sponsors: Sync README with website (ESLint Jenkins) +* [`c44306e`](https://github.com/eslint/eslint/commit/c44306e52778309a79232ceab8b55a9aa0f2dfda) Sponsors: Sync README with website (ESLint Jenkins) +* [`6677180`](https://github.com/eslint/eslint/commit/6677180495e16a02d150d0552e7e5d5f6b77fcc5) Sponsors: Sync README with website (ESLint Jenkins) +* [`07db7b8`](https://github.com/eslint/eslint/commit/07db7b8080c2f68ee28e7d447db356c33e6fddce) Sponsors: Sync README with website (ESLint Jenkins) +* [`d4ce4d3`](https://github.com/eslint/eslint/commit/d4ce4d3b8492c3e4654ed1f51f2c48e6c0ad272f) Sponsors: Sync README with website (ESLint Jenkins) +* [`284e954`](https://github.com/eslint/eslint/commit/284e954f93126c50e0aa9b88f42afb03a47ad967) Sponsors: Sync README with website (ESLint Jenkins) +* [`ae9b54e`](https://github.com/eslint/eslint/commit/ae9b54e59b01aa9f50ee31f5b6787d86e6b59de6) Sponsors: Sync README with website (ESLint Jenkins) +* [`9124a15`](https://github.com/eslint/eslint/commit/9124a1599638a1caf4b7e252d1cb66abdc5e51c6) Chore: remove leche (fixes #13287) (#13533) (Mark de Dios) +* [`5c4c7f5`](https://github.com/eslint/eslint/commit/5c4c7f515c2e8e83f2186a66ddce75d6477abeb0) Sponsors: Sync README with website (ESLint Jenkins) +* [`48d8ec8`](https://github.com/eslint/eslint/commit/48d8ec8cf320c69aed17c6b6c78f19e7c1e587ca) Sponsors: Sync README with website (ESLint Jenkins) + +v7.6.0 - July 31, 2020 + +* [`ecb2b73`](https://github.com/eslint/eslint/commit/ecb2b7343a0d14fb57d297a16be6c1b176fb3dbf) Update: require `meta` for fixable rules in RuleTester (refs #13349) (#13489) (Milos Djermanovic) +* [`6fb4edd`](https://github.com/eslint/eslint/commit/6fb4edde3b7a7ae2faf8ac956a7342fbf80865fc) Docs: fix broken links in developer guide (#13518) (Sam Chen) +* [`318fe10`](https://github.com/eslint/eslint/commit/318fe103dbf2548eee293ff456ef0b829dbe3db3) Fix: Do not output `undefined` as line and column when it's unavailable (#13519) (haya14busa) +* [`493b5b4`](https://github.com/eslint/eslint/commit/493b5b40cae7a076fdeb19740f8c88fb4ae9c1fb) Sponsors: Sync README with website (ESLint Jenkins) +* [`f100143`](https://github.com/eslint/eslint/commit/f100143fa5f529aacb2b50e650a00d2697ca4c54) Sponsors: Sync README with website (ESLint Jenkins) +* [`16b10fe`](https://github.com/eslint/eslint/commit/16b10fe8ba3c78939d5ada4a25caf2f0c9e6a058) Fix: Update the chatroom link to go directly to help channel (#13536) (Nicholas C. Zakas) +* [`f937eb9`](https://github.com/eslint/eslint/commit/f937eb95407f60d3772bcb956e227aaf99e48777) Sponsors: Sync README with website (ESLint Jenkins) +* [`e71e298`](https://github.com/eslint/eslint/commit/e71e2980cd2e319afc70d8c859c7ffd59cf4157b) Update: Change no-duplicate-case to comparing tokens (fixes #13485) (#13494) (Yosuke Ota) +* [`6c4aea4`](https://github.com/eslint/eslint/commit/6c4aea44fd78e1eecea5fe3c37e1921e3b1e98a6) Docs: add ECMAScript 2020 to README (#13510) (Milos Djermanovic) + +v7.5.0 - July 18, 2020 + +* [`6ea3178`](https://github.com/eslint/eslint/commit/6ea3178776eae0e40c3f5498893e8aab0e23686b) Update: optional chaining support (fixes #12642) (#13416) (Toru Nagashima) +* [`540b1af`](https://github.com/eslint/eslint/commit/540b1af77278ae649b621aa8d4bf8d6de03c3155) Chore: enable consistent-meta-messages internal rule (#13487) (Milos Djermanovic) +* [`885a145`](https://github.com/eslint/eslint/commit/885a1455691265db88dc0befe9b48a69d69e8b9c) Docs: clarify behavior if `meta.fixable` is omitted (refs #13349) (#13493) (Milos Djermanovic) +* [`1a01b42`](https://github.com/eslint/eslint/commit/1a01b420eaab0de03dab5cc190a9f2a860c21a84) Docs: Update technology sponsors in README (#13478) (Nicholas C. Zakas) +* [`6ed9e8e`](https://github.com/eslint/eslint/commit/6ed9e8e4ff038c0259b0e7fe7ab7f4fd4ec55801) Upgrade: lodash@4.17.19 (#13499) (Yohan Siguret) +* [`45cdf00`](https://github.com/eslint/eslint/commit/45cdf00da6aeff3d584d37b0710fc8d6ad9456d6) Sponsors: Sync README with website (ESLint Jenkins) +* [`f1cc725`](https://github.com/eslint/eslint/commit/f1cc725ba1b8646dcf06a83716d96ad9bb726172) Docs: fix linebreaks between versions in changelog (#13488) (Milos Djermanovic) +* [`f4d7b9e`](https://github.com/eslint/eslint/commit/f4d7b9e1a599346b2f21ff9de003b311b51411e6) Update: deprecate id-blacklist rule (#13465) (Dimitri Mitropoulos) +* [`e14a645`](https://github.com/eslint/eslint/commit/e14a645aa495558081490f990ba221e21aa6b27c) Chore: use espree.latestEcmaVersion in fuzzer (#13484) (Milos Djermanovic) +* [`61097fe`](https://github.com/eslint/eslint/commit/61097fe5cc275d414a0c8e19b31c6060cb5568b7) Docs: Update int rule level to string (#13483) (Brandon Mills) +* [`c8f9c82`](https://github.com/eslint/eslint/commit/c8f9c8210cf4b9da8f07922093d7b219abad9f10) Update: Improve report location no-irregular-whitespace (refs #12334) (#13462) (Milos Djermanovic) +* [`f2e68ec`](https://github.com/eslint/eslint/commit/f2e68ec1d6cee6299e8a5cdf76c522c11d3008dd) Build: update webpack resolve.mainFields to match website config (#13457) (Milos Djermanovic) +* [`a96bc5e`](https://github.com/eslint/eslint/commit/a96bc5ec06f3a48bfe458bccd68d4d3b2a280ed9) Fix: arrow-body-style fixer for `in` wrap (fixes #11849) (#13228) (Anix) +* [`748734f`](https://github.com/eslint/eslint/commit/748734fdd497fbf61f3a616ff4a09169135b9396) Upgrade: Updated puppeteer version to v4.0.0 (#13444) (odidev) +* [`e951457`](https://github.com/eslint/eslint/commit/e951457b7aaa1b12b135588d36e3f4db4d7b8463) Docs: fix wording in configuring.md (#13469) (Piper) +* [`0af1d28`](https://github.com/eslint/eslint/commit/0af1d2828d27885483737867653ba1659af72005) Update: add allowSeparatedGroups option to sort-imports (fixes #12951) (#13455) (Milos Djermanovic) +* [`1050ee7`](https://github.com/eslint/eslint/commit/1050ee78a95da9484ff333dc1c74dac64c05da6f) Update: Improve report location for no-unneeded-ternary (refs #12334) (#13456) (Milos Djermanovic) +* [`b77b420`](https://github.com/eslint/eslint/commit/b77b4202bd1d5d1306f6f645e88d7a41a51715db) Update: Improve report location for max-len (refs #12334) (#13458) (Milos Djermanovic) +* [`095194c`](https://github.com/eslint/eslint/commit/095194c0fc0eb02aa69fde6b4280696e0e4de214) Fix: add end location to reports in object-curly-newline (refs #12334) (#13460) (Milos Djermanovic) +* [`10251bb`](https://github.com/eslint/eslint/commit/10251bbaeba80ac15244f385fc42cf2f2a30e5d2) Fix: add end location to reports in keyword-spacing (refs #12334) (#13461) (Milos Djermanovic) +* [`2ea7ee5`](https://github.com/eslint/eslint/commit/2ea7ee51a4e05ee76a6dae5954c3b6263b0970a3) Sponsors: Sync README with website (ESLint Jenkins) +* [`b55fd3b`](https://github.com/eslint/eslint/commit/b55fd3b8c05a29a465a794a524b06c1a28cddf0c) Sponsors: Sync README with website (ESLint Jenkins) + +v7.4.0 - July 3, 2020 + +* [`f21bad2`](https://github.com/eslint/eslint/commit/f21bad2680406a2671b877f8dba47f4475d0cc64) Docs: fix description for `never` in multiline-ternary (fixes #13368) (#13452) (Milos Djermanovic) +* [`ada2c89`](https://github.com/eslint/eslint/commit/ada2c891298382f82dfabf37cacd59a1057b2bb7) Fix: support typescript generics in arrow-parens (fixes #12570) (#13451) (Milos Djermanovic) +* [`89ee01e`](https://github.com/eslint/eslint/commit/89ee01e083f1e02293bf8d1447f9b0fdb3cb9384) Fix: Revert config cloning (fixes #13447) (#13449) (薛定谔的猫) +* [`0a463db`](https://github.com/eslint/eslint/commit/0a463dbf7cc5a77d442879c9117204d4d38db972) Docs: fix no-multiple-empty-lines examples (fixes #13432) (#13433) (Milos Djermanovic) +* [`ff5317e`](https://github.com/eslint/eslint/commit/ff5317e93425f93cfdf808609551ee67b2032543) Update: Improve array-callback-return report message (#13395) (Philip (flip) Kromer) +* [`3f51930`](https://github.com/eslint/eslint/commit/3f51930eea7cddc921a9ee3cb0328c7b649c0f83) Fix: false positive new with member in no-extra-parens (fixes #12740) (#13375) (YeonJuan) +* [`825a5b9`](https://github.com/eslint/eslint/commit/825a5b98d3d84f6eb72b75f7d8519de763cc8898) Fix: Clarify documentation on implicit ignore behavior (fixes #12348) (#12600) (Scott Hardin) +* [`c139156`](https://github.com/eslint/eslint/commit/c1391566a5f765f25716527de7b5cdee16c0ce36) Sponsors: Sync README with website (ESLint Jenkins) +* [`0c17e9d`](https://github.com/eslint/eslint/commit/0c17e9d2ac307cc288eea6ed7971bd5a7d33321a) Sponsors: Sync README with website (ESLint Jenkins) +* [`c680387`](https://github.com/eslint/eslint/commit/c680387ba61f6dccf0390d24a85d871fa83e9fea) Sponsors: Sync README with website (ESLint Jenkins) +* [`bf3939b`](https://github.com/eslint/eslint/commit/bf3939bbd9a33d0eb96cebe6a53bf61c855f9ba6) Sponsors: Sync README with website (ESLint Jenkins) +* [`7baf02e`](https://github.com/eslint/eslint/commit/7baf02e983af909800261263f125cca901a5bd0f) Sponsors: Sync README with website (ESLint Jenkins) +* [`5c4c3fd`](https://github.com/eslint/eslint/commit/5c4c3fdfbda18a13223ad36f44283adbfee8c496) Sponsors: Sync README with website (ESLint Jenkins) +* [`53912aa`](https://github.com/eslint/eslint/commit/53912aab1856327b399cca26cbb2ba81fd01bfa2) Sponsors: Sync README with website (ESLint Jenkins) +* [`51e42ec`](https://github.com/eslint/eslint/commit/51e42eca3e87d8259815d736ffe81e604f184057) Update: Add option "ignoreGlobals" to camelcase rule (fixes #11716) (#12782) (David Gasperoni) +* [`0655f66`](https://github.com/eslint/eslint/commit/0655f66525d167ca1288167b79a77087cfc8fcf6) Update: improve report location in arrow-body-style (refs #12334) (#13424) (YeonJuan) +* [`d53d69a`](https://github.com/eslint/eslint/commit/d53d69af08cfe55f42e0a0ca725b1014dabccc21) Update: prefer-regex-literal detect regex literals (fixes #12840) (#12842) (Mathias Schreck) +* [`004adae`](https://github.com/eslint/eslint/commit/004adae3f959414f56e44e5884f6221e9dcda142) Update: rename id-blacklist to id-denylist (fixes #13407) (#13408) (Kai Cataldo) + +v7.3.1 - June 22, 2020 + +* [`de77c11`](https://github.com/eslint/eslint/commit/de77c11e7515f2097ff355ddc0d7b6db9c83c892) Fix: Replace Infinity with Number.MAX_SAFE_INTEGER (fixes #13427) (#13435) (Nicholas C. Zakas) + +v7.3.0 - June 19, 2020 + +* [`638a6d6`](https://github.com/eslint/eslint/commit/638a6d6be18b4a37cfdc7223e1f5acd3718694be) Update: add missing `additionalProperties: false` to some rules' schema (#13198) (Milos Djermanovic) +* [`949a5cd`](https://github.com/eslint/eslint/commit/949a5cd741c2e930cfb43d80a9b6b084f9d677c3) Update: fix operator-linebreak overrides schema (#13199) (Milos Djermanovic) +* [`9e1414e`](https://github.com/eslint/eslint/commit/9e1414ee16b8caf582920f8fdf3b6ee1eb0b7cd5) New: Add no-promise-executor-return rule (fixes #12640) (#12648) (Milos Djermanovic) +* [`09cc0a2`](https://github.com/eslint/eslint/commit/09cc0a2bb5bcf3bcb0766a3c989871f268518437) Update: max-lines reporting loc improvement (refs #12334) (#13318) (Anix) +* [`ee2fc2e`](https://github.com/eslint/eslint/commit/ee2fc2e90d0f9dfcdba852b0609156bee5280b92) Update: object-property-newline end location (refs #12334) (#13399) (Anix) +* [`d98152a`](https://github.com/eslint/eslint/commit/d98152a3d8c72e4f5ac4c6fa10a615b12090c8f7) Update: added empty error array check for false negative (#13200) (Anix) +* [`7fb45cf`](https://github.com/eslint/eslint/commit/7fb45cf13e9908d489bd6d5fba3b7243c01508b9) Fix: clone config before validating (fixes #12592) (#13034) (Anix) +* [`aed46f6`](https://github.com/eslint/eslint/commit/aed46f69d54da167d9838149954ceeb4b02be5fd) Sponsors: Sync README with website (ESLint Jenkins) +* [`7686d7f`](https://github.com/eslint/eslint/commit/7686d7feaccc7b8fee927eda6602d641d8de1e5c) Update: semi-spacing should check do-while statements (#13358) (Milos Djermanovic) +* [`cbd0d00`](https://github.com/eslint/eslint/commit/cbd0d00a1ec2824d7e025bbbc084855ed0bf08bb) Update: disallow multiple options in comma-dangle schema (fixes #13165) (#13166) (Milos Djermanovic) +* [`b550330`](https://github.com/eslint/eslint/commit/b550330d739c73a7a8f887064e7c911d05a95f9a) New: Add no-unreachable-loop rule (fixes #12381) (#12660) (Milos Djermanovic) +* [`13999d2`](https://github.com/eslint/eslint/commit/13999d292080f814fa4fb266e011d61c184197c4) Update: curly should check consequent `if` statements (#12947) (Milos Djermanovic) +* [`c42e548`](https://github.com/eslint/eslint/commit/c42e54893b79b470ca7745bd2a626ffd069e017b) Chore: enable exceptRange option in the yoda rule (#12857) (Milos Djermanovic) +* [`6cfbd03`](https://github.com/eslint/eslint/commit/6cfbd03b3f22edb4d1c9c61c64eea7c129da71aa) Update: Drop @typescript-eslint/eslint-recommended from `eslint --init` (#13340) (Minh Nguyen) +* [`796f269`](https://github.com/eslint/eslint/commit/796f269e448fdcbf8a5a62edf1990bd857efd1af) Chore: update eslint-config-eslint's required node version (#13379) (薛定谔的猫) +* [`9d0186e`](https://github.com/eslint/eslint/commit/9d0186e55bee769ea6aa08dc5a62682f58316412) Docs: Fix changelog versions (#13410) (Tony Brix) +* [`1ee3c42`](https://github.com/eslint/eslint/commit/1ee3c42ceeee56b650bcc4206ed783b795f65643) Docs: On maxEOF with eol-last (fixes #12742) (#13374) (Arthur Dias) +* [`2a21049`](https://github.com/eslint/eslint/commit/2a210499288ed14ec9a6fd72decabfb77504c197) Update: key-spacing loc changes for extra space (refs #12334) (#13362) (Anix) +* [`7ce7988`](https://github.com/eslint/eslint/commit/7ce7988f411da64248a64a9d9d2b7884d5ba39e0) Chore: Replace the inquirer dependency with enquirer (#13254) (Selwyn) +* [`0f1f5ed`](https://github.com/eslint/eslint/commit/0f1f5ed2a20b8fb575d4360316861cf4c2b9b7bc) Docs: Add security policy link to README (#13403) (Nicholas C. Zakas) +* [`9e9ba89`](https://github.com/eslint/eslint/commit/9e9ba897c566601cfe90522099c635ea316b235f) Sponsors: Sync README with website (ESLint Jenkins) +* [`ca59fb9`](https://github.com/eslint/eslint/commit/ca59fb95a395c0a02ed23768a70e086480ab1f6d) Sponsors: Sync README with website (ESLint Jenkins) + +v7.2.0 - June 5, 2020 + +* [`b735a48`](https://github.com/eslint/eslint/commit/b735a485e77bcc791e4c4c6b8716801d94e98b2c) Update: add enforceForFunctionPrototypeMethods option to no-extra-parens (#12895) (Milos Djermanovic) +* [`27ef73f`](https://github.com/eslint/eslint/commit/27ef73ffb7428d5eff792d443186a2313e417bda) Update: reporter locr of func-call-spacing (refs #12334) (#13311) (Anix) +* [`353bfe9`](https://github.com/eslint/eslint/commit/353bfe9760ec640f470859855d4018df084a4e88) Update: handle parentheses in multiline-ternary (fixes #13195) (#13367) (Milos Djermanovic) +* [`a7fd343`](https://github.com/eslint/eslint/commit/a7fd343991cde99d8a219e3b25616db5792fe9a9) Update: keyword-spacing unexpected space loc improve (refs #12334) (#13377) (Anix) +* [`e49732e`](https://github.com/eslint/eslint/commit/e49732eb41bff6347ca7718c3c5ca1d13f1cd2d3) Fix: Ignore import expressions in no-unused-expressions rule (#13387) (Veniamin Krol) +* [`220349f`](https://github.com/eslint/eslint/commit/220349f5404060effe02fb5ec176a92e1383c3b5) Chore: Remove duplicate health files (#13380) (Nicholas C. Zakas) +* [`dd949ae`](https://github.com/eslint/eslint/commit/dd949aedb81fa772e10568920156daf075d25ea2) Update: support `??` operator, import.meta, and `export * as ns` (#13196) (Toru Nagashima) +* [`d5fce9f`](https://github.com/eslint/eslint/commit/d5fce9fa07e37ce61010a1fbb65964f1f7aefd82) Update: enable es2020 environment in --init (#13357) (Milos Djermanovic) +* [`21b1583`](https://github.com/eslint/eslint/commit/21b15832e326f96d349c063cd7e85e72c3abb670) Docs: fixed broken hash link for working-with-rules.md (#13386) (Yosuke Ota) +* [`b76aef7`](https://github.com/eslint/eslint/commit/b76aef778befb32afe7ad249934b132dc49713d2) Update: Improve report location for template-tag-spacing (refs #12334) (#13203) (Milos Djermanovic) +* [`578efad`](https://github.com/eslint/eslint/commit/578efad331b797e28c0f5f1547ce4769d2ea23ee) Chore: update no-unused-vars caughtErrors in eslint-config-eslint (#13351) (Milos Djermanovic) +* [`426088c`](https://github.com/eslint/eslint/commit/426088c966dc79dc338b33100f3adf827b147d69) Fix: no-unused-vars updated location to last reference (fixes #13181) (#13354) (Anix) +* [`cb50b69`](https://github.com/eslint/eslint/commit/cb50b69c08d4393e32d5c42c537d769c51dd34d8) Update: Improve location for no-mixed-spaces-and-tabs (refs #12334) (#13365) (Milos Djermanovic) +* [`f858f2a`](https://github.com/eslint/eslint/commit/f858f2a8f83232484491bd90b0bc5001b5056ad0) Chore: Add Tidelift to funding.yml (#13371) (Nicholas C. Zakas) +* [`ee30e5d`](https://github.com/eslint/eslint/commit/ee30e5d8bb1a4c82a2a3fbe1b9ee9f979b55c5c4) Sponsors: Sync README with website (ESLint Jenkins) +* [`c29bd9f`](https://github.com/eslint/eslint/commit/c29bd9f75582e5b1a403a8ffd0aafd1ffc8c58e1) Chore: Add breaking/core change link to issue templates (#13344) (Kai Cataldo) +* [`d55490f`](https://github.com/eslint/eslint/commit/d55490fa73ff69416de375e4c1cd67b6edba531c) Sponsors: Sync README with website (ESLint Jenkins) + +v7.1.0 - May 22, 2020 + +* [`a93083a`](https://github.com/eslint/eslint/commit/a93083af89c6f9714dcdd4a7f27c8655a0b0dba6) Fix: astUtils.getNextLocation returns invalid location after CRLF (#13275) (Milos Djermanovic) +* [`df01af1`](https://github.com/eslint/eslint/commit/df01af184d93b3d64b37cee786cad59bd0d7aacb) Update: padded-blocks loc position changes (refs #12334) (#13328) (Anix) +* [`bd3f092`](https://github.com/eslint/eslint/commit/bd3f092efa579944f75bfbc277b35f85e6d966ed) Fix: max-lines-per-function flagging arrow IIFEs (fixes #13332) (#13336) (cherryblossom000) +* [`25462b2`](https://github.com/eslint/eslint/commit/25462b23eac4ed1ded97eeae6187b5d8baa58e78) Update: block-spacing changed loc for extra (refs #12334) (#13314) (Anix) +* [`de0aab9`](https://github.com/eslint/eslint/commit/de0aab95005f172db72196fc3fd18e91ee9a5880) Fix: report end loc in one-var-declaration-per-line (refs #12334) (#13326) (YeonJuan) +* [`1710296`](https://github.com/eslint/eslint/commit/1710296082083602a904b080908657bb431fb56c) Fix: no-new-symbol false positive with Symbol as an argument (#13337) (Milos Djermanovic) +* [`cc01451`](https://github.com/eslint/eslint/commit/cc014514c29626e556acb0a528e3478b3725e284) Fix: arrow-parens no reporting for comments inside (fixes #12995) (#13312) (Anix) +* [`a195141`](https://github.com/eslint/eslint/commit/a19514193a42f4f00732559ff828b33a6ec9d7c5) Update: reporting location for semi-spacing (refs #12334) (#13285) (Anix) +* [`e3e4c41`](https://github.com/eslint/eslint/commit/e3e4c41ab625a5af8d4614d1c6d32c656f104f6b) Fix: fix false positives of no-new-func (#13333) (Pig Fang) +* [`611c676`](https://github.com/eslint/eslint/commit/611c676dfd671013d81810724f184e2a9c5ad5d7) Docs: Update new rules policies (#13343) (Nicholas C. Zakas) +* [`3a5fbb3`](https://github.com/eslint/eslint/commit/3a5fbb3d634be688615950c0a5fa8aead6ff08b5) Chore: correct fileoverview doc in accessor-pairs (#13335) (YeonJuan) +* [`b0a6b81`](https://github.com/eslint/eslint/commit/b0a6b8134e3b399beeb69432a02232a1037f7c46) Update: Improve report location for rest-spread-spacing (refs #12334) (#13313) (Milos Djermanovic) +* [`68c8ee3`](https://github.com/eslint/eslint/commit/68c8ee3ab70187972aef4c4e866bcf29da70a207) Fix: Stop path analyzer on unknown nodes (#13305) (Ilya Volodin) +* [`89e1081`](https://github.com/eslint/eslint/commit/89e10811c4df666216aae58bff5f855cd9df738b) Update: Improve report location for linebreak-style (refs #12334) (#13317) (Milos Djermanovic) +* [`0891379`](https://github.com/eslint/eslint/commit/08913798b4ec420b261b8fbc470504f9f248c840) Docs: Document the "correct" way to build an array with values (#13246) (Ed S) +* [`88127d7`](https://github.com/eslint/eslint/commit/88127d74d56b88cc5a0758856995716050021131) Chore: remove checkbox from PR template prerequesites (#13330) (Kai Cataldo) +* [`c636d57`](https://github.com/eslint/eslint/commit/c636d5708c461a8ff1ea55e5df56d4f76f9c4044) New: no-loss-of-precision (fixes #11279) (#12747) (jmoore914) +* [`72a4e10`](https://github.com/eslint/eslint/commit/72a4e1044592057c4a3f39dbb1dbe61b00ea8af6) Chore: Mark SourceCode getComments() method as deprecated (fixes #13293) (#13296) (SuperOleg39) +* [`7f14846`](https://github.com/eslint/eslint/commit/7f1484690665b4f4b9cd9680ca8bb7b5cf56e48a) Docs: fix broken link in Node.js API docs (#13307) (Kai Cataldo) +* [`02aeba1`](https://github.com/eslint/eslint/commit/02aeba19afb301140514097235a9f2a00a9acb2a) Sponsors: Sync README with website (ESLint Jenkins) +* [`1f17533`](https://github.com/eslint/eslint/commit/1f175338cba29960aab67a540f516051f9d428c8) Docs: Gitter -> Discord URL (refs #13039) (#13308) (Nicholas C. Zakas) +* [`82a448a`](https://github.com/eslint/eslint/commit/82a448a7deff24e9207f60dfe77622c00102bd99) Docs: improve documentation of no-return-await (#13215) (Linus Unnebäck) +* [`742941d`](https://github.com/eslint/eslint/commit/742941d7fdc3fd79ff8c5d2588413e0d3a5a525b) Update: added typescript-eslint/recommended configs for init (#13235) (Anix) +* [`3d03df0`](https://github.com/eslint/eslint/commit/3d03df08c8000403a85baffe2a000287f3335114) Sponsors: Sync README with website (ESLint Jenkins) +* [`f44a6b4`](https://github.com/eslint/eslint/commit/f44a6b4fd92602af8e2c75d5852f796ec064aa8e) Chore: fix invalid syntax in require-await tests (#13277) (Milos Djermanovic) +* [`2c778fb`](https://github.com/eslint/eslint/commit/2c778fb6e31b7943bb27a47a6e15dcbfd8336f39) Fix: remove custom plugins from replacedBy metadata (#13274) (Kai Cataldo) +* [`0db3b1d`](https://github.com/eslint/eslint/commit/0db3b1d5cc5e4e1de21462679581b7a4d89ff36e) Sponsors: Sync README with website (ESLint Jenkins) + +v7.0.0 - May 8, 2020 + +* [`b98d8bd`](https://github.com/eslint/eslint/commit/b98d8bda4630fe8278c5aa2b6650630770568fe5) Upgrade: eslint-release@2.0.0 (#13271) (Kai Cataldo) +* [`4c0b028`](https://github.com/eslint/eslint/commit/4c0b028c55fc1674b374efe0bc6dd22c02b4ac88) Fix: remove Node.js and CommonJS category from build process (#13242) (Kai Cataldo) +* [`401a687`](https://github.com/eslint/eslint/commit/401a68799d9d15145e1c7d92ee04644abec2f15a) Chore: fix rules list for prereleases (#13230) (Kai Cataldo) +* [`4ef6158`](https://github.com/eslint/eslint/commit/4ef61580736353f700ab9e4e29f005b5ac552c78) Breaking: espree@7.0.0 (#13270) (Kai Cataldo) +* [`b5c8d73`](https://github.com/eslint/eslint/commit/b5c8d7389bb2c5d4eae850b866832d099187818b) Docs: update 7.0.0 migration guide for consistency (#13267) (Kai Cataldo) +* [`356fdb4`](https://github.com/eslint/eslint/commit/356fdb46aa118ba3d81cee93e8c058a7c98acaf9) Docs: add migration guide (#12692) (Toru Nagashima) +* [`015edf6`](https://github.com/eslint/eslint/commit/015edf6467e33c67b904db037a674d71957a6865) Sponsors: Sync README with website (ESLint Jenkins) +* [`fdfa364`](https://github.com/eslint/eslint/commit/fdfa364c1b0d88689d02cbe8ae848a3e323209aa) 7.0.0-rc.0 (ESLint Jenkins) +* [`8d1b4db`](https://github.com/eslint/eslint/commit/8d1b4db9932cf7c3289187afbb3866a83f9b3f8c) Build: changelog update for 7.0.0-rc.0 (ESLint Jenkins) +* [`0b1d65a`](https://github.com/eslint/eslint/commit/0b1d65a45aa5dfe08cd596c420490e81b546317e) Update: Improve report location for array-callback-return (refs #12334) (#13109) (Milos Djermanovic) +* [`d85e291`](https://github.com/eslint/eslint/commit/d85e291d1b56960373031f2562547df7285444f7) Fix: yoda left string fix for exceptRange (fixes #12883) (#13052) (Anix) +* [`2ce6bed`](https://github.com/eslint/eslint/commit/2ce6bed04cad376003f70447ece4b6578c142bfd) Chore: added tests for nested arrays (#13145) (Anix) +* [`d3aac53`](https://github.com/eslint/eslint/commit/d3aac532f6a24c633f85dedf0e552eabd22d0956) Update: report backtick loc in no-unexpected-multiline (refs #12334) (#13142) (Milos Djermanovic) +* [`8e7a2d9`](https://github.com/eslint/eslint/commit/8e7a2d93595cfe0c1597af0e7873853369251c0b) Fix: func-call-spacing "never" reports wrong message (fixes #13190) (#13193) (Milos Djermanovic) +* [`bcafd0f`](https://github.com/eslint/eslint/commit/bcafd0f8508e19ab8087a35fac7b97fc4295df3e) Update: Add ESLint API (refs eslint/rfcs#40) (#12939) (Kai Cataldo) +* [`3eeae56`](https://github.com/eslint/eslint/commit/3eeae565bfb0834a31e5d3a253a17bbf4027cf88) Upgrade: some (dev) deps (#13155) (薛定谔的猫) +* [`6b7030b`](https://github.com/eslint/eslint/commit/6b7030b1a1e1e3d1a3953cfa9722074d6a6fc1a9) Chore: Run tests on Node.js v14 (#13210) (fisker Cheung) +* [`ebc28d7`](https://github.com/eslint/eslint/commit/ebc28d76658f1f3e4e8d56e70a25752b5d4a6686) Fix: Remove default .js from --ext CLI option (#13176) (Brandon Mills) +* [`5c1bdeb`](https://github.com/eslint/eslint/commit/5c1bdebcf728062fd41583886830c89b65485df9) Update: Improve report location for getter-return (refs #12334) (#13164) (Milos Djermanovic) +* [`56d2bee`](https://github.com/eslint/eslint/commit/56d2beea0ea0b6395a6d4a3e116ea6a964ff92f3) Docs: fix typos (#13204) (Nitin Kumar) +* [`e13256e`](https://github.com/eslint/eslint/commit/e13256e395cc413ce45a66c8562621d48440d8f4) Chore: use espree.latestEcmaVersion in config-initializer (#13157) (Kai Cataldo) +* [`e4f57b7`](https://github.com/eslint/eslint/commit/e4f57b7d7b8b7441a2217a217dcda1e7bfff516a) Chore: add nested array tests for array-element-newline (#13161) (Anix) +* [`63ac918`](https://github.com/eslint/eslint/commit/63ac91877668205aaa50495a9615806967e6e4cf) Sponsors: Sync README with website (ESLint Jenkins) +* [`516f253`](https://github.com/eslint/eslint/commit/516f253729daeeb9da5de5e9b38606ff9c1aae71) Docs: Adds import example for object-curly-newline rule (refs #12018) (#13177) (Luke Lewis) +* [`5a0e84e`](https://github.com/eslint/eslint/commit/5a0e84e9498a946a3e8491a370e012354e087fe0) Sponsors: Sync README with website (ESLint Jenkins) +* [`b398e0b`](https://github.com/eslint/eslint/commit/b398e0b9ff455e4e7d70f19d5ccea5819c21eb86) Docs: add rule comment in prefer-rest-params doc (#13191) (YeonJuan) +* [`ffaa4ba`](https://github.com/eslint/eslint/commit/ffaa4ba5e2bb1a51a78a2b2c028cbe2efc9e5165) Sponsors: Sync README with website (ESLint Jenkins) +* [`932869b`](https://github.com/eslint/eslint/commit/932869b3251b04c4ad5fa72279cb2a56a3e67b55) Sponsors: Sync README with website (ESLint Jenkins) +* [`54630f0`](https://github.com/eslint/eslint/commit/54630f0063fa66318476473757b5912465d4caf2) Sponsors: Sync README with website (ESLint Jenkins) +* [`c9a5035`](https://github.com/eslint/eslint/commit/c9a503571a4662f6c2d31cabc7fd7819ec388150) Fix: newBasePath should be an absolute path (fixes #12850) (#13078) (Nick Harris) +* [`e7c1d4b`](https://github.com/eslint/eslint/commit/e7c1d4b2ac56149a517d4b0000230348a641f1d3) Update: deprecate Node.js & CommonJS rules (#12898) (Kai Cataldo) +* [`95e1c70`](https://github.com/eslint/eslint/commit/95e1c70cebde210a990ee786ec7ab1c8e522edb8) Upgrade: levn@0.4.1 (fixes #9366) (#13140) (Kai Cataldo) +* [`c41de38`](https://github.com/eslint/eslint/commit/c41de382a330d4789488fd2dcf6db5a3163bb5d2) Docs: fix curly multi-or-nest examples with comments (refs #12972) (#13151) (Milos Djermanovic) +* [`57221d5`](https://github.com/eslint/eslint/commit/57221d58c60e757062242f30ed574e0502fc7c31) Docs: fix eslint comment in no-inner-declarations examples (#13152) (Milos Djermanovic) +* [`301b450`](https://github.com/eslint/eslint/commit/301b450ecd1985ae84d1915124f4638ab2a2e6de) Fix: no-extra-parens export default sequence expression false positive (#13096) (Milos Djermanovic) +* [`af4472f`](https://github.com/eslint/eslint/commit/af4472fed794b86e63730702e4b27294a4118d09) Update: Improve report location for new-cap (refs #12334) (#13136) (Milos Djermanovic) +* [`bfa811c`](https://github.com/eslint/eslint/commit/bfa811ceee801fe8ba212a5c879e13743146e909) Fix: init error in extending recommended config (fixes #12707) (#12738) (YeonJuan) +* [`5dfd4eb`](https://github.com/eslint/eslint/commit/5dfd4eb50d84077a57950f119e5de8976070e49a) Docs: examples with arrow functions in no-return-assign (fixes #13135) (#13138) (Anix) +* [`adc8fa8`](https://github.com/eslint/eslint/commit/adc8fa88c9f223b984a3519ed159a055bf933b18) Docs: clarify exceptions in spaced-comment (fixes #13032) (#13126) (Anix) +* [`a784dac`](https://github.com/eslint/eslint/commit/a784dac8bc26f31edbca869b16d6ad91bd4e5cc4) Update: Improve report location newline-per-chained-call (refs #12334) (#13116) (Milos Djermanovic) +* [`5e07574`](https://github.com/eslint/eslint/commit/5e07574a91861fdcab6888b4c6829868030c3a39) Update: Improve report location for space-before-function-paren (#13128) (Chiawen Chen) +* [`d0d32a8`](https://github.com/eslint/eslint/commit/d0d32a8c2a6c60c7e6e2d32a054e5987efd4c263) Sponsors: Sync README with website (ESLint Jenkins) +* [`17e2fe4`](https://github.com/eslint/eslint/commit/17e2fe425168e675fe7607182615e50527eedf53) Update: Improve error message for fatal fixer errors (#13120) (Brad Zacher) +* [`7551f0c`](https://github.com/eslint/eslint/commit/7551f0c6fd12f0295cc7d6377bf1899c092e79d8) Fix: no check for shadowed Object (fixes #12809) (#13115) (Anix) +* [`988d842`](https://github.com/eslint/eslint/commit/988d8428811934943ce13b2d8b833d795ac2bb4a) Fix: add end location to report in no-useless-concat (refs #12334) (#13110) (Milos Djermanovic) +* [`0518ebb`](https://github.com/eslint/eslint/commit/0518ebb840b5bf2d646dbd8a9b3e246e7069eb79) Sponsors: Sync README with website (ESLint Jenkins) +* [`252fd41`](https://github.com/eslint/eslint/commit/252fd4133805f003151e0220b5d89bbb70cfacb1) Sponsors: Sync README with website (ESLint Jenkins) +* [`438dcbb`](https://github.com/eslint/eslint/commit/438dcbb981214d67e8848006ce45afc0fbfa1705) Update: Improve report location for comma-style (refs #12334) (#13111) (Chiawen Chen) +* [`85b7254`](https://github.com/eslint/eslint/commit/85b72548c0c893499c787b82f404348e1b50354d) Update: no-inner-declarations false negative in non-block (fixes #12222) (#13062) (Anix) +* [`6631ef1`](https://github.com/eslint/eslint/commit/6631ef1678bbdd48680fb3025c3692abd0aeec4a) Update: Improve report location for no-empty-function (refs #12334) (#13121) (Milos Djermanovic) +* [`b228f95`](https://github.com/eslint/eslint/commit/b228f958afaf507d6f6f99c90b2075b395733839) Docs: Update README team and sponsors (ESLint Jenkins) +* [`119b7ce`](https://github.com/eslint/eslint/commit/119b7ce97993b84df5af4e4f82e5102e430dfff1) 7.0.0-alpha.3 (ESLint Jenkins) +* [`2531b80`](https://github.com/eslint/eslint/commit/2531b802a1527ea1084905641a17befcb50350c7) Build: changelog update for 7.0.0-alpha.3 (ESLint Jenkins) +* [`78c8cda`](https://github.com/eslint/eslint/commit/78c8cda5a5d82f5f8548c4528a6438d29756bb71) Breaking: RuleTester Improvements (refs eslint/rfcs#25) (#12955) (Milos Djermanovic) +* [`e0f1b6c`](https://github.com/eslint/eslint/commit/e0f1b6c3d62f725b99b8c07654603b559ba43ba9) Update: stricter array index check in no-magic-numbers (fixes #12845) (#12851) (Milos Djermanovic) +* [`362713c`](https://github.com/eslint/eslint/commit/362713c04aa89092b2b98a77fa94a75b3c933fc6) Update: Improve report location for template-curly-spacing (#12813) (Milos Djermanovic) +* [`29f32db`](https://github.com/eslint/eslint/commit/29f32db68c921a857e17ae627923d87b9c8708de) Fix: Change error message logic for implicit file ignore (fixes #12873) (#12878) (Scott Hardin) +* [`eb1a43c`](https://github.com/eslint/eslint/commit/eb1a43ce3113c906800192c3ef766d2ff188776f) Fix: require-await ignore async generators (fixes #12459) (#13048) (Anix) +* [`920465b`](https://github.com/eslint/eslint/commit/920465b5d8d291df8bce7eef8a066b1dd43d8cae) Fix: getNameLocationInGlobalDirectiveComment end location (refs #12334) (#13086) (Milos Djermanovic) +* [`ae14a02`](https://github.com/eslint/eslint/commit/ae14a021bbea5117fe366ae4ed235e8f08dc65a8) Fix: add end location to report in no-extra-bind (refs #12334) (#13083) (Milos Djermanovic) +* [`105384c`](https://github.com/eslint/eslint/commit/105384ccc11dcd7303104fb5a347eda1d4d48357) Update: report operator location in operator-linebreak (refs #12334) (#13102) (Milos Djermanovic) +* [`081e240`](https://github.com/eslint/eslint/commit/081e24022a40d9a026ddd2a85c68cb8c3f18dc53) Update: support globalThis in no-implied-eval (fixes #12670) (#13105) (YeonJuan) +* [`185982d`](https://github.com/eslint/eslint/commit/185982d5615d325ae8b45c2360d5847df4098bda) Breaking: improve plugin resolving (refs eslint/rfcs#47) (#12922) (Toru Nagashima) +* [`0c20bc0`](https://github.com/eslint/eslint/commit/0c20bc068e608869981a10711bba88ffde1539d8) Fix: check assignment property target in camelcase (fixes #13025) (#13027) (YeonJuan) +* [`8d50a7d`](https://github.com/eslint/eslint/commit/8d50a7d82244d4912f3eab62a66c81c76c44a9da) Fix: add end location to report in no-prototype-builtins (refs #12334) (#13087) (Milos Djermanovic) +* [`3e4e7f8`](https://github.com/eslint/eslint/commit/3e4e7f8d429dc70b78c0aefaa37f9c22a1e5fc0f) Fix: incorrect logic for required parens in no-extra-boolean-cast fixer (#13061) (Milos Djermanovic) +* [`6c069f9`](https://github.com/eslint/eslint/commit/6c069f907a04268b671c7f949c04a508df9d42a3) Docs: Add comments to code block in example (#13089) (Kibeom Kwon) +* [`ee1f053`](https://github.com/eslint/eslint/commit/ee1f0531aa534ef9182cf8586f55ad82aaa55e75) Docs: Fix typo (#13092) (Max Coplan) +* [`76324ac`](https://github.com/eslint/eslint/commit/76324ace67893c3d7e38a369114d6128df9ffb65) Docs: Add further reading to rule (#13084) (Max Coplan) +* [`a1370ab`](https://github.com/eslint/eslint/commit/a1370abed72e1fb93e601816d981fa6e46204afb) Update: Report constructor calls in no-obj-calls (#12909) (Milos Djermanovic) +* [`2111c52`](https://github.com/eslint/eslint/commit/2111c52443e7641caad291e0daaea8e2fe6c4562) Upgrade: esquery@1.2.0 (#13076) (Milos Djermanovic) +* [`3f7c9bf`](https://github.com/eslint/eslint/commit/3f7c9bf19615122fb776cdd13da532d860bd945a) Docs: clarify variables option in no-use-before-define (fixes #12986) (#13017) (Anix) +* [`aef9488`](https://github.com/eslint/eslint/commit/aef9488c07d3da4becff6e8d6918824b53086d86) Fix: allow references to external globals in id-blacklist (fixes #12567) (#12987) (Milos Djermanovic) +* [`4955c50`](https://github.com/eslint/eslint/commit/4955c50dc9e89b4077b28e35f065d45e89bdccd7) Fix: remove type arguments in prefer-object-spread (fixes #13058) (#13063) (Milos Djermanovic) +* [`48b122f`](https://github.com/eslint/eslint/commit/48b122f450b14dd27afef4c8115c69fca4f02be1) Breaking: change relative paths with --config (refs eslint/rfcs#37) (#12887) (Toru Nagashima) +* [`085979f`](https://github.com/eslint/eslint/commit/085979fed9a5e24a87e4d92ee79272b59211d03f) Update: consider env in no-implied-eval (fixes #12733) (#12757) (YeonJuan) +* [`9ac5b9e`](https://github.com/eslint/eslint/commit/9ac5b9edf06d16a9216c2c9b02bb20b6aa8ed0ab) Docs: Clarify node_modules is ignored by default (fixes #13006) (#13054) (Mika Kuijpers) +* [`0de91f3`](https://github.com/eslint/eslint/commit/0de91f39a97cdf530cb64edbadde57a2bb41ca86) Docs: removed correct code from incorrect eg (#13060) (Anix) +* [`dbe357d`](https://github.com/eslint/eslint/commit/dbe357de199620675446464f6fd0e35064c4d247) Fix: check template literal in prefer-numeric-literals (fixes #13045) (#13046) (YeonJuan) +* [`2260611`](https://github.com/eslint/eslint/commit/2260611e616bdc2a0bf16d508b60a50772ce7fbb) Fix: added async in allow method in no-empty-function (fixes #12768) (#13036) (Anix) +* [`f3788af`](https://github.com/eslint/eslint/commit/f3788aff615edfbfb7afc4c491bb07d20737531b) Sponsors: Sync README with website (ESLint Jenkins) +* [`e90b29b`](https://github.com/eslint/eslint/commit/e90b29bb1f41d4e5767e33d03db5984f036586ed) Update: Allow testing Suggestions with data in RuleTester (fixes #12606) (#12635) (Milos Djermanovic) +* [`7224eee`](https://github.com/eslint/eslint/commit/7224eee3ff4b4378d3439deb038bf34b116fa48b) Fix: no-plusplus allow comma operands in for afterthought (fixes #13005) (#13024) (Milos Djermanovic) +* [`7598cf8`](https://github.com/eslint/eslint/commit/7598cf816bd854de1dd7d96cf00dec6ecc4564ac) Fix: Newline before eof when creating config via --init (#12952) (Andreas Lind) +* [`183e300`](https://github.com/eslint/eslint/commit/183e3006841c29efdd245c45a72e6cefac86ae35) Update: support globalThis (refs #12670) (#12774) (YeonJuan) +* [`af7af9d`](https://github.com/eslint/eslint/commit/af7af9d32ea8073d2d0d726cc8551351261a170f) Docs: Update governance (#13055) (Nicholas C. Zakas) +* [`31d5eb3`](https://github.com/eslint/eslint/commit/31d5eb3e60b6c2ee26976721f07cc89d60867659) Sponsors: Sync README with website (ESLint Jenkins) +* [`95613d4`](https://github.com/eslint/eslint/commit/95613d46b7900b3d9757a7f6959d5dfb262f29fc) Upgrade: espree@6.2.1 (#13026) (Kai Cataldo) +* [`f1525dc`](https://github.com/eslint/eslint/commit/f1525dc45dfdbbe31e724671270785b41cffc6bd) Sponsors: Sync README with website (ESLint Jenkins) +* [`0243549`](https://github.com/eslint/eslint/commit/0243549db4d237cb78e720d55a9cae89b91f6830) Fix: camelcase false positive with computed property (fixes #13022) (#13023) (Milos Djermanovic) +* [`bc0c02c`](https://github.com/eslint/eslint/commit/bc0c02cd0368559c7a7b1510eb4620022a4cc31c) Chore: added lock files to gitignore (#13015) (Anix) +* [`79ac6cd`](https://github.com/eslint/eslint/commit/79ac6cd2d8e4c32e03dfea10a957806845058573) Docs: added less confusing explanation for func-style (fixes #12900) (#13004) (Anix) +* [`26267ed`](https://github.com/eslint/eslint/commit/26267ed70270ef746b785c09e267f815bf7c596a) Chore: update GitHub Actions (#12984) (Pig Fang) +* [`1299705`](https://github.com/eslint/eslint/commit/12997058626b5167ba4b9d2ae0d0ea965a01c4be) Update: acorn version (#13016) (Idan Avrahami) +* [`6cef0d5`](https://github.com/eslint/eslint/commit/6cef0d50a0d131bc8897799a54e1af1d38606db4) Fix: Check division operator in astUtils.canTokensBeAdjacent (#12879) (Milos Djermanovic) +* [`fd8e1f5`](https://github.com/eslint/eslint/commit/fd8e1f52110cada542a120750236fd1ec8779336) Sponsors: Sync README with website (ESLint Jenkins) +* [`472025f`](https://github.com/eslint/eslint/commit/472025f2814d0360fe8d4cddbcba049982e1cd43) Chore: update space-before-function-paren in eslint-config-eslint (#12966) (Kai Cataldo) +* [`fd8c42a`](https://github.com/eslint/eslint/commit/fd8c42ada52f0ae2488ad96ee8fee675f63134ce) Sponsors: Sync README with website (ESLint Jenkins) +* [`c615eae`](https://github.com/eslint/eslint/commit/c615eae0be3c6c167c6f77ec7a73e7adca0ecef0) 7.0.0-alpha.2 (ESLint Jenkins) +* [`2e8f193`](https://github.com/eslint/eslint/commit/2e8f193ebc970f07ea37d267c8bce02d74c285a8) Build: changelog update for 7.0.0-alpha.2 (ESLint Jenkins) +* [`a5b41a7`](https://github.com/eslint/eslint/commit/a5b41a75b57572e97476b06ad39b768e15b9d844) Update: no-restricted-modules handle TemplateLiteral (fixes #12926) (#12927) (Michal Piechowiak) +* [`051567a`](https://github.com/eslint/eslint/commit/051567adca7ca56d691bcda76f54ed72e3eae367) Update: check identifier in array pattern in id-length (fixes #12832) (#12839) (YeonJuan) +* [`4af06fc`](https://github.com/eslint/eslint/commit/4af06fc49029dac5c9acfd53f01fd9527bfbb4aa) Breaking: Test with an unknown error property should fail in RuleTester (#12096) (Milos Djermanovic) +* [`9038a29`](https://github.com/eslint/eslint/commit/9038a29569548c0563c29dbe9f7dae280ff3addd) Update: func-names `as-needed` false negative with AssignmentPattern (#12932) (Milos Djermanovic) +* [`afde78b`](https://github.com/eslint/eslint/commit/afde78b125747ce5ad9e5f871122a0d370dd0152) Fix: curly removes necessary braces between if and else (fixes #12928) (#12943) (Milos Djermanovic) +* [`4797fb2`](https://github.com/eslint/eslint/commit/4797fb2c29db97bc5cd23b40e5a9235fef1ea06a) Fix: arrow-body-style crash with object literal body (fixes #12884) (#12886) (Milos Djermanovic) +* [`afa9aac`](https://github.com/eslint/eslint/commit/afa9aac6de9444e935a55b46311e5b5a58f86063) Breaking: class default `true` computed-property-spacing (fixes #12812) (#12915) (Milos Djermanovic) +* [`b8e20d3`](https://github.com/eslint/eslint/commit/b8e20d33b7d6645266beef09cd231afaf5054328) Docs: Mention TypeScript's compiler check (#12903) (Benny Neugebauer) +* [`de14d1c`](https://github.com/eslint/eslint/commit/de14d1ce0cf422b4100a686abb906f53fbf905b3) Fix: wrap-iife autofix removes mandatory parentheses (#12905) (Milos Djermanovic) +* [`5775b06`](https://github.com/eslint/eslint/commit/5775b06a74573cbe068bea56b1d2376421f5e831) Fix: Optionally allow underscores in member names (#11972) (Edgardo Avilés) +* [`e997f32`](https://github.com/eslint/eslint/commit/e997f32b936463ac38e8b0034f764c47502e56a8) Docs: Updated arrow-parens for minor grammar issue (#12962) (Tom) +* [`7d52151`](https://github.com/eslint/eslint/commit/7d52151bcd5d5524f240588436a8808162be187f) Breaking: classes default `true` in accessor-pairs (fixes #12811) (#12919) (Milos Djermanovic) +* [`cf14355`](https://github.com/eslint/eslint/commit/cf14355e34a6757e15806f8e493553bd7110fb36) Docs: Fix links to custom parsers doc (#12965) (Brandon Mills) +* [`0dfc3ff`](https://github.com/eslint/eslint/commit/0dfc3ff9fb228e1d9b1df99de50033ce9140ac24) Fix: add end location to report in no-eval (#12960) (Milos Djermanovic) +* [`f479f6f`](https://github.com/eslint/eslint/commit/f479f6fe2eb95156e22bebfccb39a7fc1f19e9c0) Docs: References correct config file name (#12885) (Patrick Kilgore) +* [`78182e4`](https://github.com/eslint/eslint/commit/78182e45e0178d9eac2591944ef4daee21d2cb44) Breaking: Add new rules to eslint:recommended (fixes #12911) (#12920) (Milos Djermanovic) +* [`8d5c434`](https://github.com/eslint/eslint/commit/8d5c434f721142be74c7515aaa935668a15b79b1) Docs: fix category descriptions for site generation (fixes #12894) (#12930) (Kai Cataldo) +* [`05380e6`](https://github.com/eslint/eslint/commit/05380e6e7e19a79d26ea6d6b44a8d5ee7cde51c8) Docs: Remove claim about semicolons from docs (#12944) (Luke Sikina) +* [`aa9d725`](https://github.com/eslint/eslint/commit/aa9d72525054e641231a2960a2e37b3716228056) Sponsors: Sync README with website (ESLint Jenkins) +* [`7747177`](https://github.com/eslint/eslint/commit/7747177f8504961059b7c56bdb70a820bd1114c1) Update: report rename id destructuring in id-blacklist (fixes #12807) (#12923) (YeonJuan) +* [`6423e11`](https://github.com/eslint/eslint/commit/6423e11c0bedd3b4e661ab554316bdeb1fc1ee3c) Breaking: check unnamed default export in func-names (fixes #12194) (#12195) (Chiawen Chen) +* [`77df505`](https://github.com/eslint/eslint/commit/77df505d9a08496a8eaefeca4f885f54a21d5c5e) Update: check renaming identifier in object destructuring (fixes 12827) (#12881) (YeonJuan) +* [`41de9df`](https://github.com/eslint/eslint/commit/41de9df41a30a4300243bfe4ca26f716a787b2fc) Update: enforceForLogicalOperands no-extra-boolean-cast (fixes #12137) (#12734) (jmoore914) +* [`98a9b01`](https://github.com/eslint/eslint/commit/98a9b019e52f344c1a6bc2f704c227f89692afe3) 7.0.0-alpha.1 (ESLint Jenkins) +* [`e9f1073`](https://github.com/eslint/eslint/commit/e9f1073f748f8c22f754d145b1ba193e7ce82215) Build: changelog update for 7.0.0-alpha.1 (ESLint Jenkins) +* [`f702b1a`](https://github.com/eslint/eslint/commit/f702b1a54820d2b4e4993dcded99f551a98b490f) Add missing plugin reference (#12796) (Eduard Bardají Puig) +* [`1f1424c`](https://github.com/eslint/eslint/commit/1f1424cb200e609d58645f6c54739e11469e6265) Fix: fix inconsistently works option in no-extra-parens (fixes #12717) (#12843) (YeonJuan) +* [`b5adcaa`](https://github.com/eslint/eslint/commit/b5adcaab93f388f1d8e9d35d6f5e8c2994240850) Fix: make YieldExpression throwable (fixes #12880) (#12897) (YeonJuan) +* [`4293229`](https://github.com/eslint/eslint/commit/4293229709dde105692347241513766e953664dd) Breaking: use-isnan enforceForSwitchCase default `true` (fixes #12810) (#12913) (Milos Djermanovic) +* [`cf38d0d`](https://github.com/eslint/eslint/commit/cf38d0d939b62f3670cdd59f0143fd896fccd771) Breaking: change default ignore pattern (refs eslint/rfcs#51) (#12888) (Toru Nagashima) +* [`bfe1dc4`](https://github.com/eslint/eslint/commit/bfe1dc4e614640cb69032afbb5851c1493f537e3) Breaking: no-dupe-class-members checks some computed keys (fixes #12808) (#12837) (Milos Djermanovic) +* [`1ee6b63`](https://github.com/eslint/eslint/commit/1ee6b6388305a8671c8d4c3cf30c2dbf18a1ff7e) Update: check template literal in yoda (fixes #12863) (#12876) (YeonJuan) +* [`0ae7041`](https://github.com/eslint/eslint/commit/0ae70417af70ad565450d9e779ae78c05f6a51e2) Sponsors: Sync README with website (ESLint Jenkins) +* [`1907e57`](https://github.com/eslint/eslint/commit/1907e57362f7d5f7a02a5a78f24ac3347f868e93) Chore: add Twitter and Open Collective badge (#12877) (Kai Cataldo) +* [`95e0586`](https://github.com/eslint/eslint/commit/95e0586c95e6953d11983d1d11891ed30318109a) Fix: id-blacklist false positives on renamed imports (#12831) (Milos Djermanovic) +* [`b7f0d20`](https://github.com/eslint/eslint/commit/b7f0d200c125b3d233ccafaabdaa61c66dc60e3c) Chore: Use consistent badge style (#12825) (fisker Cheung) +* [`3734a66`](https://github.com/eslint/eslint/commit/3734a669983de7d5107ba8f39b291c6e3116489f) Chore: use ids for messages (#12859) (Gareth Jones) +* [`824d235`](https://github.com/eslint/eslint/commit/824d23585c205f2993716585cb6f55dfbe4a33f0) Docs: add errorOnUnmatchedPattern option to CLIEngine (#12834) (Arthur Denner) +* [`439c833`](https://github.com/eslint/eslint/commit/439c83342c364ba3ce5168d54e165b1fe3e35630) Update: array-callback-return checks Array.forEach (fixes #12551) (#12646) (Gabriel R Sezefredo) +* [`33efd71`](https://github.com/eslint/eslint/commit/33efd71d7c3496b4b9cbfe006280527064940826) Docs: Fix spelling mistakes (#12861) (Bryan Mishkin) +* [`a5b3c5f`](https://github.com/eslint/eslint/commit/a5b3c5fa4edc2312534af0d9f0911f68144f8baf) Docs: Update README team and sponsors (ESLint Jenkins) +* [`0cae920`](https://github.com/eslint/eslint/commit/0cae9203a8077184ad6beb00028fd376cc806f34) Chore: rename shadowed global (#12862) (Tony Brix) +* [`055b80d`](https://github.com/eslint/eslint/commit/055b80dc89bba2a5ab22f7a27deb40135b5cacfa) Chore: Fix typo in complexity.js (#12864) (Kyle Shevlin) +* [`d6c313d`](https://github.com/eslint/eslint/commit/d6c313de794ea0671d35b5027288cd2ea456c0b5) Docs: add missing eslint comments in prefer-regex-literals examples (#12858) (Milos Djermanovic) +* [`7d551ab`](https://github.com/eslint/eslint/commit/7d551ab8cbf2d3a802b0d0685379aa075fe9d7c0) Sponsors: Sync README with website (ESLint Jenkins) +* [`540de8e`](https://github.com/eslint/eslint/commit/540de8e34d08f4b17b66b06d13927acb7552357a) Sponsors: Sync README with website (ESLint Jenkins) +* [`ac5d515`](https://github.com/eslint/eslint/commit/ac5d515252c226f030fa646bf7635a12a3b856fe) Sponsors: Sync README with website (ESLint Jenkins) +* [`dadc892`](https://github.com/eslint/eslint/commit/dadc8927820576c60b48bcbc7d5a9056a6279d30) Fix: operator-assignment crash on adjacent division assignment (#12844) (Milos Djermanovic) +* [`9f39ef0`](https://github.com/eslint/eslint/commit/9f39ef0d4b398c7c09ceef89128da448680d587c) Chore: typo in PULL_REQUEST_TEMPLATE.md (#12848) (Balázs Orbán) +* [`a60d5cd`](https://github.com/eslint/eslint/commit/a60d5cd2325ca72fa1b272b0b90ccd7904b92062) Chore: typo in no-irregular-whitespace.js (#12847) (Balázs Orbán) +* [`691d19a`](https://github.com/eslint/eslint/commit/691d19a2872bffab50c0024d488b8cb33504cc83) Chore: add missing `ecmaVersion` 2020/11 type value (#12833) (Piotr Błażejewicz (Peter Blazejewicz)) +* [`516ddb3`](https://github.com/eslint/eslint/commit/516ddb37d39502e5a8c88a017ae3bad05046f41d) Sponsors: Sync README with website (ESLint Jenkins) +* [`a9d92f9`](https://github.com/eslint/eslint/commit/a9d92f991d69902a9150db373590e2ed54dec988) Fix: radix rule crash on disabled globals (#12824) (Milos Djermanovic) +* [`03a69db`](https://github.com/eslint/eslint/commit/03a69dbe86d5b5768a310105416ae726822e3c1c) Update: check template literal in no-proto, no-iterator (fixes #12801) (#12806) (YeonJuan) +* [`562e784`](https://github.com/eslint/eslint/commit/562e7845946a490f2e173a0bcd1af631070a4eef) Update: fix no-magic-numbers false negative with ignoreArrayIndexes (#12805) (Milos Djermanovic) +* [`f5b9656`](https://github.com/eslint/eslint/commit/f5b96564f732962f46755adbb33c49fae9af6a92) Chore: add test for no-constant-condition (#12836) (Milos Djermanovic) +* [`533c114`](https://github.com/eslint/eslint/commit/533c1140dc98bebdc3ae8334ab2e6c27c7df0c21) Fix: multiline-comment-style rule add extra space after * (fixes #12785) (#12823) (Karthik Priyadarshan) +* [`0460748`](https://github.com/eslint/eslint/commit/0460748cda67ddc4a4cb0db3cdf187a742d09bf8) Update: check template literal in no-constant-condition (fixes #12815) (#12816) (YeonJuan) +* [`80309c3`](https://github.com/eslint/eslint/commit/80309c3791188ac5d1c4eebc99ede323a55336e6) Fix: no-constant-condition doesn't introspect arrays (fixes #12225) (#12307) (Sean Gray) +* [`10a79a6`](https://github.com/eslint/eslint/commit/10a79a672b42d51539bcd6ace482be7afa5f34f8) Chore: Adopt `eslint-plugin/require-meta-docs-description` internally (#12762) (Bryan Mishkin) +* [`aea1729`](https://github.com/eslint/eslint/commit/aea172998ec4e2af1d9186b6767c3f34428945f4) Docs: Fix anchor links in Node.js API TOC (#12821) (Matija Marohnić) +* [`1b8a3ce`](https://github.com/eslint/eslint/commit/1b8a3ce15237b9085f2761dcf73655207e6169a6) Sponsors: Sync README with website (ESLint Jenkins) +* [`c2217c0`](https://github.com/eslint/eslint/commit/c2217c04d6c82b160a21b00fca39c8acec543403) Breaking: make `radix` rule stricter (#12608) (fisker Cheung) +* [`e03a7b3`](https://github.com/eslint/eslint/commit/e03a7b311cb9ddf55914b1496683609bd564de2f) 7.0.0-alpha.0 (ESLint Jenkins) +* [`c8c1b2b`](https://github.com/eslint/eslint/commit/c8c1b2b2efadfcd3c04aaf15bd793c5b4dd84cb6) Build: changelog update for 7.0.0-alpha.0 (ESLint Jenkins) +* [`1aa021d`](https://github.com/eslint/eslint/commit/1aa021d77fdd2c68d7b7d2f4603252110c414b32) Breaking: lint `overrides` files (fixes #10828, refs eslint/rfcs#20) (#12677) (Toru Nagashima) +* [`e59d775`](https://github.com/eslint/eslint/commit/e59d77536bd8db57e8a75cd5245f6f320aa699f8) Update: Separate pattern/expression options for array-element-newline (#11796) (jacobparish) +* [`f8f115a`](https://github.com/eslint/eslint/commit/f8f115af6e10539e6cad485588187cb11917f8c9) Update: treat comment tokens in template-curly-spacing (fixes #12744) (#12775) (YeonJuan) +* [`b50179d`](https://github.com/eslint/eslint/commit/b50179def3fedbd95fdeab25e32c2511867eb760) Breaking: Check assignment targets in no-extra-parens (#12490) (Milos Djermanovic) +* [`de4fa7c`](https://github.com/eslint/eslint/commit/de4fa7c65c7befefa64d1605550267071ee56a5d) Fix: wrong indent at tagged template in indent (fixes #12122) (#12596) (YeonJuan) +* [`d86a5bb`](https://github.com/eslint/eslint/commit/d86a5bbb1987d858d4963f647b0af5c1fd924b4f) Breaking: Check flatMap in array-callback-return (fixes #12235) (#12765) (Milos Djermanovic) +* [`cf46df7`](https://github.com/eslint/eslint/commit/cf46df70158a4ed4c09d5c9d655c07dc6df3ff5e) Breaking: description in directive comments (refs eslint/rfcs#33) (#12699) (Toru Nagashima) +* [`7350589`](https://github.com/eslint/eslint/commit/7350589a5bdfc9d75d1ff19364f476eec44c3911) Breaking: some rules recognize bigint literals (fixes #11803) (#12701) (Toru Nagashima) +* [`16a1c1f`](https://github.com/eslint/eslint/commit/16a1c1f79bc0a4cc1c3a87e98d220041de88bb93) Fix: prefer-object-spread false positives with accessors (fixes #12086) (#12784) (Milos Djermanovic) +* [`f9774ec`](https://github.com/eslint/eslint/commit/f9774ec11b0ebe63fb16a97b97890efb84699548) New: Add default-case-last rule (fixes #12665) (#12668) (Milos Djermanovic) +* [`9a93d9e`](https://github.com/eslint/eslint/commit/9a93d9ef389c49a133c4df4f9843927f5f806423) Update: fix no-restricted-imports export * false negative (fixes #12737) (#12798) (Milos Djermanovic) +* [`0d8c0af`](https://github.com/eslint/eslint/commit/0d8c0affe1ae7ecf228cdf91b490921f7e9d1fdb) Fix: improve report location for computed-property-spacing (#12795) (Milos Djermanovic) +* [`756b95d`](https://github.com/eslint/eslint/commit/756b95d59fb97cd9b3f3adf98cebf529fe4842a2) Fix: id-blacklist should ignore ObjectPatterns (fixes #12787) (#12792) (JP Ramassini) +* [`561b6d4`](https://github.com/eslint/eslint/commit/561b6d4726f3e77dd40ba0d340ca7f08429cd2eb) Chore: add prerequisites checklist to PR template (#12790) (Kai Cataldo) +* [`01ff791`](https://github.com/eslint/eslint/commit/01ff7910af86fc45b76e883bc9ab00c9be3b50ac) Fix: Display pipe character correctly in test output (#12771) (Brad Zacher) +* [`68becbd`](https://github.com/eslint/eslint/commit/68becbd84e8a0693409d36f2be10679c483e233a) Update: fix no-restricted-imports importNames reporting (fixes #12282) (#12711) (Andrey Alexandrov) +* [`ae959b6`](https://github.com/eslint/eslint/commit/ae959b691fb148ac8b474c924c8cb01ef61c436d) Update: report double extra parens in no-extra-parens (fixes #12127) (#12697) (YeonJuan) +* [`02fcc05`](https://github.com/eslint/eslint/commit/02fcc055710e8d69d986f1e682cae2014ad881e2) Docs: Improve sort-keys (#12791) (Steven Vachon) +* [`35cd958`](https://github.com/eslint/eslint/commit/35cd95893be0afd8c954cbcf9268c2aa045b7d5b) Sponsors: Sync README with website (ESLint Jenkins) +* [`a1d999c`](https://github.com/eslint/eslint/commit/a1d999c6b4e51c317ad409110be7be214ff9f7c6) New: Add no-useless-backreference rule (fixes #12673) (#12690) (Milos Djermanovic) +* [`b2c6209`](https://github.com/eslint/eslint/commit/b2c62096a8b318765d618cab222240f87d73063b) Update: fix no-extra-parens CallExpression#callee false negatives (#12743) (Milos Djermanovic) +* [`14b42c3`](https://github.com/eslint/eslint/commit/14b42c386be3387c415267b789f277e1294d4567) Update: fix counting jsx comment len in max-len (fixes #12213) (#12661) (YeonJuan) +* [`e632c31`](https://github.com/eslint/eslint/commit/e632c31d7e5363f1347b787702ecd4a85f5c11a2) Upgrade: several dependencies (#12753) (Toru Nagashima) +* [`25eb703`](https://github.com/eslint/eslint/commit/25eb703c8758563988ffb497a53f89a3ed345399) Docs: fix dead link in max-lines rule docs (#12766) (Christian Bundy) +* [`9dfc850`](https://github.com/eslint/eslint/commit/9dfc8501fb1956c90dc11e6377b4cb38a6bea65d) Chore: Refactor to use messageId in a number of rules (#12715) (Brad Zacher) +* [`1118fce`](https://github.com/eslint/eslint/commit/1118fceb49af3436b8dcd0c6089f913cedf9a329) Breaking: runtime-deprecation on '~/.eslintrc' (refs eslint/rfcs#32) (#12678) (Toru Nagashima) +* [`2c28fbb`](https://github.com/eslint/eslint/commit/2c28fbbb563a44282bef0c9fcc9be29d611cc83b) Breaking: drop Node.js 8 support (refs eslint/rfcs#44) (#12700) (Toru Nagashima) +* [`098b67d`](https://github.com/eslint/eslint/commit/098b67d04a4b4dc8ef4faa6434c6ef5abbde3ed3) Docs: fix minor typo in brace-style.md (#12749) (Marko Kaznovac) +* [`313f70a`](https://github.com/eslint/eslint/commit/313f70ac9a3cf5d1558d2427b00dd75666e18cf4) Update: add outerIIFEBody: "off" to indent rule (fixes #11377) (#12706) (Kai Cataldo) +* [`b77b858`](https://github.com/eslint/eslint/commit/b77b8585e33fc4bb438a0e11ca8177c7eb91dbd8) Chore: fix separateRequires tests for one-var rule (#12709) (Milos Djermanovic) +* [`e4df7df`](https://github.com/eslint/eslint/commit/e4df7dfb0199badb61d2c03ff4f7e4be735279d9) Chore: add JSDoc types for RuleTester test cases (#12325) (Chiawen Chen) +* [`b23ad0d`](https://github.com/eslint/eslint/commit/b23ad0d789a909baf8d7c41a35bc53df932eaf30) Docs: change a broken link in working-with-rules.md (#12732) (Damien Cassou) +* [`3fa39a6`](https://github.com/eslint/eslint/commit/3fa39a633b37544fec7cedfc1f2b0e62e9312a72) Update: Handle locally unsupported regex in computed property keys (#12056) (Milos Djermanovic) +* [`4744397`](https://github.com/eslint/eslint/commit/474439720258b1a64b305c31588f803104fa4aaf) Chore: remove unused code in max-lines-per-function (#12659) (YeonJuan) +* [`4e16957`](https://github.com/eslint/eslint/commit/4e169576a526023ee297d5bc8b37eedba229f63d) Build: update browser build (#12693) (Toru Nagashima) +* [`00ddfff`](https://github.com/eslint/eslint/commit/00ddfffe6b4b4244e4680b0f92f2c6697fad136f) Fix: Windows path parsing for JUnit (fixes #12507) (#12509) (Michael Wall) +* [`985dac3`](https://github.com/eslint/eslint/commit/985dac35e3c367f0f99d1f0e766e06a1d9818dd4) New: Add no-restricted-exports rule (fixes #10428) (#12546) (Milos Djermanovic) +* [`1aff21b`](https://github.com/eslint/eslint/commit/1aff21bb54da44cef0b6e378a34a74265863b930) Fix: no-mixed-spaces-and-tabs reports multiline strings (#12566) (Milos Djermanovic) +* [`8f1020f`](https://github.com/eslint/eslint/commit/8f1020ff711b0c57d590bf666e2841f64186d083) Update: no-void add an option to allow void as a statement (#12613) (Brad Zacher) +* [`bb6cf50`](https://github.com/eslint/eslint/commit/bb6cf5082623ffb67bb1495fee52c0610ee5f421) Update: Add offsetTernaryExpressions option for indent rule (#12556) (Adam Stankiewicz) +* [`39f5a45`](https://github.com/eslint/eslint/commit/39f5a453579b2ad732212edeb71f84ecb0991f97) Chore: add test cases for for-direction (#12698) (YeonJuan) +* [`b340304`](https://github.com/eslint/eslint/commit/b3403045e535921df6d34785a4ce053e14ba27fd) Chore: Add extra test, improve docs (#12492) (Kevin Partington) +* [`827259e`](https://github.com/eslint/eslint/commit/827259ea009f98a0fdf3f7ebf1bfb6cd661ce28d) Build: package.json update for eslint-config-eslint release (ESLint Jenkins) + +v7.0.0-rc.0 - April 24, 2020 + +* [`0b1d65a`](https://github.com/eslint/eslint/commit/0b1d65a45aa5dfe08cd596c420490e81b546317e) Update: Improve report location for array-callback-return (refs #12334) (#13109) (Milos Djermanovic) +* [`d85e291`](https://github.com/eslint/eslint/commit/d85e291d1b56960373031f2562547df7285444f7) Fix: yoda left string fix for exceptRange (fixes #12883) (#13052) (Anix) +* [`2ce6bed`](https://github.com/eslint/eslint/commit/2ce6bed04cad376003f70447ece4b6578c142bfd) Chore: added tests for nested arrays (#13145) (Anix) +* [`d3aac53`](https://github.com/eslint/eslint/commit/d3aac532f6a24c633f85dedf0e552eabd22d0956) Update: report backtick loc in no-unexpected-multiline (refs #12334) (#13142) (Milos Djermanovic) +* [`8e7a2d9`](https://github.com/eslint/eslint/commit/8e7a2d93595cfe0c1597af0e7873853369251c0b) Fix: func-call-spacing "never" reports wrong message (fixes #13190) (#13193) (Milos Djermanovic) +* [`bcafd0f`](https://github.com/eslint/eslint/commit/bcafd0f8508e19ab8087a35fac7b97fc4295df3e) Update: Add ESLint API (refs eslint/rfcs#40) (#12939) (Kai Cataldo) +* [`3eeae56`](https://github.com/eslint/eslint/commit/3eeae565bfb0834a31e5d3a253a17bbf4027cf88) Upgrade: some (dev) deps (#13155) (薛定谔的猫) +* [`6b7030b`](https://github.com/eslint/eslint/commit/6b7030b1a1e1e3d1a3953cfa9722074d6a6fc1a9) Chore: Run tests on Node.js v14 (#13210) (fisker Cheung) +* [`ebc28d7`](https://github.com/eslint/eslint/commit/ebc28d76658f1f3e4e8d56e70a25752b5d4a6686) Fix: Remove default .js from --ext CLI option (#13176) (Brandon Mills) +* [`5c1bdeb`](https://github.com/eslint/eslint/commit/5c1bdebcf728062fd41583886830c89b65485df9) Update: Improve report location for getter-return (refs #12334) (#13164) (Milos Djermanovic) +* [`56d2bee`](https://github.com/eslint/eslint/commit/56d2beea0ea0b6395a6d4a3e116ea6a964ff92f3) Docs: fix typos (#13204) (Nitin Kumar) +* [`e13256e`](https://github.com/eslint/eslint/commit/e13256e395cc413ce45a66c8562621d48440d8f4) Chore: use espree.latestEcmaVersion in config-initializer (#13157) (Kai Cataldo) +* [`e4f57b7`](https://github.com/eslint/eslint/commit/e4f57b7d7b8b7441a2217a217dcda1e7bfff516a) Chore: add nested array tests for array-element-newline (#13161) (Anix) +* [`63ac918`](https://github.com/eslint/eslint/commit/63ac91877668205aaa50495a9615806967e6e4cf) Sponsors: Sync README with website (ESLint Jenkins) +* [`516f253`](https://github.com/eslint/eslint/commit/516f253729daeeb9da5de5e9b38606ff9c1aae71) Docs: Adds import example for object-curly-newline rule (refs #12018) (#13177) (Luke Lewis) +* [`5a0e84e`](https://github.com/eslint/eslint/commit/5a0e84e9498a946a3e8491a370e012354e087fe0) Sponsors: Sync README with website (ESLint Jenkins) +* [`b398e0b`](https://github.com/eslint/eslint/commit/b398e0b9ff455e4e7d70f19d5ccea5819c21eb86) Docs: add rule comment in prefer-rest-params doc (#13191) (YeonJuan) +* [`ffaa4ba`](https://github.com/eslint/eslint/commit/ffaa4ba5e2bb1a51a78a2b2c028cbe2efc9e5165) Sponsors: Sync README with website (ESLint Jenkins) +* [`932869b`](https://github.com/eslint/eslint/commit/932869b3251b04c4ad5fa72279cb2a56a3e67b55) Sponsors: Sync README with website (ESLint Jenkins) +* [`54630f0`](https://github.com/eslint/eslint/commit/54630f0063fa66318476473757b5912465d4caf2) Sponsors: Sync README with website (ESLint Jenkins) +* [`c9a5035`](https://github.com/eslint/eslint/commit/c9a503571a4662f6c2d31cabc7fd7819ec388150) Fix: newBasePath should be an absolute path (fixes #12850) (#13078) (Nick Harris) +* [`e7c1d4b`](https://github.com/eslint/eslint/commit/e7c1d4b2ac56149a517d4b0000230348a641f1d3) Update: deprecate Node.js & CommonJS rules (#12898) (Kai Cataldo) +* [`95e1c70`](https://github.com/eslint/eslint/commit/95e1c70cebde210a990ee786ec7ab1c8e522edb8) Upgrade: levn@0.4.1 (fixes #9366) (#13140) (Kai Cataldo) +* [`c41de38`](https://github.com/eslint/eslint/commit/c41de382a330d4789488fd2dcf6db5a3163bb5d2) Docs: fix curly multi-or-nest examples with comments (refs #12972) (#13151) (Milos Djermanovic) +* [`57221d5`](https://github.com/eslint/eslint/commit/57221d58c60e757062242f30ed574e0502fc7c31) Docs: fix eslint comment in no-inner-declarations examples (#13152) (Milos Djermanovic) +* [`301b450`](https://github.com/eslint/eslint/commit/301b450ecd1985ae84d1915124f4638ab2a2e6de) Fix: no-extra-parens export default sequence expression false positive (#13096) (Milos Djermanovic) +* [`af4472f`](https://github.com/eslint/eslint/commit/af4472fed794b86e63730702e4b27294a4118d09) Update: Improve report location for new-cap (refs #12334) (#13136) (Milos Djermanovic) +* [`bfa811c`](https://github.com/eslint/eslint/commit/bfa811ceee801fe8ba212a5c879e13743146e909) Fix: init error in extending recommended config (fixes #12707) (#12738) (YeonJuan) +* [`5dfd4eb`](https://github.com/eslint/eslint/commit/5dfd4eb50d84077a57950f119e5de8976070e49a) Docs: examples with arrow functions in no-return-assign (fixes #13135) (#13138) (Anix) +* [`adc8fa8`](https://github.com/eslint/eslint/commit/adc8fa88c9f223b984a3519ed159a055bf933b18) Docs: clarify exceptions in spaced-comment (fixes #13032) (#13126) (Anix) +* [`a784dac`](https://github.com/eslint/eslint/commit/a784dac8bc26f31edbca869b16d6ad91bd4e5cc4) Update: Improve report location newline-per-chained-call (refs #12334) (#13116) (Milos Djermanovic) +* [`5e07574`](https://github.com/eslint/eslint/commit/5e07574a91861fdcab6888b4c6829868030c3a39) Update: Improve report location for space-before-function-paren (#13128) (Chiawen Chen) +* [`d0d32a8`](https://github.com/eslint/eslint/commit/d0d32a8c2a6c60c7e6e2d32a054e5987efd4c263) Sponsors: Sync README with website (ESLint Jenkins) +* [`17e2fe4`](https://github.com/eslint/eslint/commit/17e2fe425168e675fe7607182615e50527eedf53) Update: Improve error message for fatal fixer errors (#13120) (Brad Zacher) +* [`7551f0c`](https://github.com/eslint/eslint/commit/7551f0c6fd12f0295cc7d6377bf1899c092e79d8) Fix: no check for shadowed Object (fixes #12809) (#13115) (Anix) +* [`988d842`](https://github.com/eslint/eslint/commit/988d8428811934943ce13b2d8b833d795ac2bb4a) Fix: add end location to report in no-useless-concat (refs #12334) (#13110) (Milos Djermanovic) +* [`0518ebb`](https://github.com/eslint/eslint/commit/0518ebb840b5bf2d646dbd8a9b3e246e7069eb79) Sponsors: Sync README with website (ESLint Jenkins) +* [`252fd41`](https://github.com/eslint/eslint/commit/252fd4133805f003151e0220b5d89bbb70cfacb1) Sponsors: Sync README with website (ESLint Jenkins) +* [`438dcbb`](https://github.com/eslint/eslint/commit/438dcbb981214d67e8848006ce45afc0fbfa1705) Update: Improve report location for comma-style (refs #12334) (#13111) (Chiawen Chen) +* [`85b7254`](https://github.com/eslint/eslint/commit/85b72548c0c893499c787b82f404348e1b50354d) Update: no-inner-declarations false negative in non-block (fixes #12222) (#13062) (Anix) +* [`6631ef1`](https://github.com/eslint/eslint/commit/6631ef1678bbdd48680fb3025c3692abd0aeec4a) Update: Improve report location for no-empty-function (refs #12334) (#13121) (Milos Djermanovic) +* [`b228f95`](https://github.com/eslint/eslint/commit/b228f958afaf507d6f6f99c90b2075b395733839) Docs: Update README team and sponsors (ESLint Jenkins) + +v7.0.0-alpha.3 - March 27, 2020 + +* [`78c8cda`](https://github.com/eslint/eslint/commit/78c8cda5a5d82f5f8548c4528a6438d29756bb71) Breaking: RuleTester Improvements (refs eslint/rfcs#25) (#12955) (Milos Djermanovic) +* [`e0f1b6c`](https://github.com/eslint/eslint/commit/e0f1b6c3d62f725b99b8c07654603b559ba43ba9) Update: stricter array index check in no-magic-numbers (fixes #12845) (#12851) (Milos Djermanovic) +* [`362713c`](https://github.com/eslint/eslint/commit/362713c04aa89092b2b98a77fa94a75b3c933fc6) Update: Improve report location for template-curly-spacing (#12813) (Milos Djermanovic) +* [`29f32db`](https://github.com/eslint/eslint/commit/29f32db68c921a857e17ae627923d87b9c8708de) Fix: Change error message logic for implicit file ignore (fixes #12873) (#12878) (Scott Hardin) +* [`eb1a43c`](https://github.com/eslint/eslint/commit/eb1a43ce3113c906800192c3ef766d2ff188776f) Fix: require-await ignore async generators (fixes #12459) (#13048) (Anix) +* [`920465b`](https://github.com/eslint/eslint/commit/920465b5d8d291df8bce7eef8a066b1dd43d8cae) Fix: getNameLocationInGlobalDirectiveComment end location (refs #12334) (#13086) (Milos Djermanovic) +* [`ae14a02`](https://github.com/eslint/eslint/commit/ae14a021bbea5117fe366ae4ed235e8f08dc65a8) Fix: add end location to report in no-extra-bind (refs #12334) (#13083) (Milos Djermanovic) +* [`105384c`](https://github.com/eslint/eslint/commit/105384ccc11dcd7303104fb5a347eda1d4d48357) Update: report operator location in operator-linebreak (refs #12334) (#13102) (Milos Djermanovic) +* [`081e240`](https://github.com/eslint/eslint/commit/081e24022a40d9a026ddd2a85c68cb8c3f18dc53) Update: support globalThis in no-implied-eval (fixes #12670) (#13105) (YeonJuan) +* [`185982d`](https://github.com/eslint/eslint/commit/185982d5615d325ae8b45c2360d5847df4098bda) Breaking: improve plugin resolving (refs eslint/rfcs#47) (#12922) (Toru Nagashima) +* [`0c20bc0`](https://github.com/eslint/eslint/commit/0c20bc068e608869981a10711bba88ffde1539d8) Fix: check assignment property target in camelcase (fixes #13025) (#13027) (YeonJuan) +* [`8d50a7d`](https://github.com/eslint/eslint/commit/8d50a7d82244d4912f3eab62a66c81c76c44a9da) Fix: add end location to report in no-prototype-builtins (refs #12334) (#13087) (Milos Djermanovic) +* [`3e4e7f8`](https://github.com/eslint/eslint/commit/3e4e7f8d429dc70b78c0aefaa37f9c22a1e5fc0f) Fix: incorrect logic for required parens in no-extra-boolean-cast fixer (#13061) (Milos Djermanovic) +* [`6c069f9`](https://github.com/eslint/eslint/commit/6c069f907a04268b671c7f949c04a508df9d42a3) Docs: Add comments to code block in example (#13089) (Kibeom Kwon) +* [`ee1f053`](https://github.com/eslint/eslint/commit/ee1f0531aa534ef9182cf8586f55ad82aaa55e75) Docs: Fix typo (#13092) (Max Coplan) +* [`76324ac`](https://github.com/eslint/eslint/commit/76324ace67893c3d7e38a369114d6128df9ffb65) Docs: Add further reading to rule (#13084) (Max Coplan) +* [`a1370ab`](https://github.com/eslint/eslint/commit/a1370abed72e1fb93e601816d981fa6e46204afb) Update: Report constructor calls in no-obj-calls (#12909) (Milos Djermanovic) +* [`2111c52`](https://github.com/eslint/eslint/commit/2111c52443e7641caad291e0daaea8e2fe6c4562) Upgrade: esquery@1.2.0 (#13076) (Milos Djermanovic) +* [`3f7c9bf`](https://github.com/eslint/eslint/commit/3f7c9bf19615122fb776cdd13da532d860bd945a) Docs: clarify variables option in no-use-before-define (fixes #12986) (#13017) (Anix) +* [`aef9488`](https://github.com/eslint/eslint/commit/aef9488c07d3da4becff6e8d6918824b53086d86) Fix: allow references to external globals in id-blacklist (fixes #12567) (#12987) (Milos Djermanovic) +* [`4955c50`](https://github.com/eslint/eslint/commit/4955c50dc9e89b4077b28e35f065d45e89bdccd7) Fix: remove type arguments in prefer-object-spread (fixes #13058) (#13063) (Milos Djermanovic) +* [`48b122f`](https://github.com/eslint/eslint/commit/48b122f450b14dd27afef4c8115c69fca4f02be1) Breaking: change relative paths with --config (refs eslint/rfcs#37) (#12887) (Toru Nagashima) +* [`085979f`](https://github.com/eslint/eslint/commit/085979fed9a5e24a87e4d92ee79272b59211d03f) Update: consider env in no-implied-eval (fixes #12733) (#12757) (YeonJuan) +* [`9ac5b9e`](https://github.com/eslint/eslint/commit/9ac5b9edf06d16a9216c2c9b02bb20b6aa8ed0ab) Docs: Clarify node_modules is ignored by default (fixes #13006) (#13054) (Mika Kuijpers) +* [`0de91f3`](https://github.com/eslint/eslint/commit/0de91f39a97cdf530cb64edbadde57a2bb41ca86) Docs: removed correct code from incorrect eg (#13060) (Anix) +* [`dbe357d`](https://github.com/eslint/eslint/commit/dbe357de199620675446464f6fd0e35064c4d247) Fix: check template literal in prefer-numeric-literals (fixes #13045) (#13046) (YeonJuan) +* [`2260611`](https://github.com/eslint/eslint/commit/2260611e616bdc2a0bf16d508b60a50772ce7fbb) Fix: added async in allow method in no-empty-function (fixes #12768) (#13036) (Anix) +* [`f3788af`](https://github.com/eslint/eslint/commit/f3788aff615edfbfb7afc4c491bb07d20737531b) Sponsors: Sync README with website (ESLint Jenkins) +* [`e90b29b`](https://github.com/eslint/eslint/commit/e90b29bb1f41d4e5767e33d03db5984f036586ed) Update: Allow testing Suggestions with data in RuleTester (fixes #12606) (#12635) (Milos Djermanovic) +* [`7224eee`](https://github.com/eslint/eslint/commit/7224eee3ff4b4378d3439deb038bf34b116fa48b) Fix: no-plusplus allow comma operands in for afterthought (fixes #13005) (#13024) (Milos Djermanovic) +* [`7598cf8`](https://github.com/eslint/eslint/commit/7598cf816bd854de1dd7d96cf00dec6ecc4564ac) Fix: Newline before eof when creating config via --init (#12952) (Andreas Lind) +* [`183e300`](https://github.com/eslint/eslint/commit/183e3006841c29efdd245c45a72e6cefac86ae35) Update: support globalThis (refs #12670) (#12774) (YeonJuan) +* [`af7af9d`](https://github.com/eslint/eslint/commit/af7af9d32ea8073d2d0d726cc8551351261a170f) Docs: Update governance (#13055) (Nicholas C. Zakas) +* [`31d5eb3`](https://github.com/eslint/eslint/commit/31d5eb3e60b6c2ee26976721f07cc89d60867659) Sponsors: Sync README with website (ESLint Jenkins) +* [`95613d4`](https://github.com/eslint/eslint/commit/95613d46b7900b3d9757a7f6959d5dfb262f29fc) Upgrade: espree@6.2.1 (#13026) (Kai Cataldo) +* [`f1525dc`](https://github.com/eslint/eslint/commit/f1525dc45dfdbbe31e724671270785b41cffc6bd) Sponsors: Sync README with website (ESLint Jenkins) +* [`0243549`](https://github.com/eslint/eslint/commit/0243549db4d237cb78e720d55a9cae89b91f6830) Fix: camelcase false positive with computed property (fixes #13022) (#13023) (Milos Djermanovic) +* [`bc0c02c`](https://github.com/eslint/eslint/commit/bc0c02cd0368559c7a7b1510eb4620022a4cc31c) Chore: added lock files to gitignore (#13015) (Anix) +* [`79ac6cd`](https://github.com/eslint/eslint/commit/79ac6cd2d8e4c32e03dfea10a957806845058573) Docs: added less confusing explanation for func-style (fixes #12900) (#13004) (Anix) +* [`26267ed`](https://github.com/eslint/eslint/commit/26267ed70270ef746b785c09e267f815bf7c596a) Chore: update GitHub Actions (#12984) (Pig Fang) +* [`1299705`](https://github.com/eslint/eslint/commit/12997058626b5167ba4b9d2ae0d0ea965a01c4be) Update: acorn version (#13016) (Idan Avrahami) +* [`6cef0d5`](https://github.com/eslint/eslint/commit/6cef0d50a0d131bc8897799a54e1af1d38606db4) Fix: Check division operator in astUtils.canTokensBeAdjacent (#12879) (Milos Djermanovic) +* [`fd8e1f5`](https://github.com/eslint/eslint/commit/fd8e1f52110cada542a120750236fd1ec8779336) Sponsors: Sync README with website (ESLint Jenkins) +* [`472025f`](https://github.com/eslint/eslint/commit/472025f2814d0360fe8d4cddbcba049982e1cd43) Chore: update space-before-function-paren in eslint-config-eslint (#12966) (Kai Cataldo) +* [`fd8c42a`](https://github.com/eslint/eslint/commit/fd8c42ada52f0ae2488ad96ee8fee675f63134ce) Sponsors: Sync README with website (ESLint Jenkins) + +v7.0.0-alpha.2 - February 28, 2020 + +* [`a5b41a7`](https://github.com/eslint/eslint/commit/a5b41a75b57572e97476b06ad39b768e15b9d844) Update: no-restricted-modules handle TemplateLiteral (fixes #12926) (#12927) (Michal Piechowiak) +* [`051567a`](https://github.com/eslint/eslint/commit/051567adca7ca56d691bcda76f54ed72e3eae367) Update: check identifier in array pattern in id-length (fixes #12832) (#12839) (YeonJuan) +* [`4af06fc`](https://github.com/eslint/eslint/commit/4af06fc49029dac5c9acfd53f01fd9527bfbb4aa) Breaking: Test with an unknown error property should fail in RuleTester (#12096) (Milos Djermanovic) +* [`9038a29`](https://github.com/eslint/eslint/commit/9038a29569548c0563c29dbe9f7dae280ff3addd) Update: func-names `as-needed` false negative with AssignmentPattern (#12932) (Milos Djermanovic) +* [`afde78b`](https://github.com/eslint/eslint/commit/afde78b125747ce5ad9e5f871122a0d370dd0152) Fix: curly removes necessary braces between if and else (fixes #12928) (#12943) (Milos Djermanovic) +* [`4797fb2`](https://github.com/eslint/eslint/commit/4797fb2c29db97bc5cd23b40e5a9235fef1ea06a) Fix: arrow-body-style crash with object literal body (fixes #12884) (#12886) (Milos Djermanovic) +* [`afa9aac`](https://github.com/eslint/eslint/commit/afa9aac6de9444e935a55b46311e5b5a58f86063) Breaking: class default `true` computed-property-spacing (fixes #12812) (#12915) (Milos Djermanovic) +* [`b8e20d3`](https://github.com/eslint/eslint/commit/b8e20d33b7d6645266beef09cd231afaf5054328) Docs: Mention TypeScript's compiler check (#12903) (Benny Neugebauer) +* [`de14d1c`](https://github.com/eslint/eslint/commit/de14d1ce0cf422b4100a686abb906f53fbf905b3) Fix: wrap-iife autofix removes mandatory parentheses (#12905) (Milos Djermanovic) +* [`5775b06`](https://github.com/eslint/eslint/commit/5775b06a74573cbe068bea56b1d2376421f5e831) Fix: Optionally allow underscores in member names (#11972) (Edgardo Avilés) +* [`e997f32`](https://github.com/eslint/eslint/commit/e997f32b936463ac38e8b0034f764c47502e56a8) Docs: Updated arrow-parens for minor grammar issue (#12962) (Tom) +* [`7d52151`](https://github.com/eslint/eslint/commit/7d52151bcd5d5524f240588436a8808162be187f) Breaking: classes default `true` in accessor-pairs (fixes #12811) (#12919) (Milos Djermanovic) +* [`cf14355`](https://github.com/eslint/eslint/commit/cf14355e34a6757e15806f8e493553bd7110fb36) Docs: Fix links to custom parsers doc (#12965) (Brandon Mills) +* [`0dfc3ff`](https://github.com/eslint/eslint/commit/0dfc3ff9fb228e1d9b1df99de50033ce9140ac24) Fix: add end location to report in no-eval (#12960) (Milos Djermanovic) +* [`f479f6f`](https://github.com/eslint/eslint/commit/f479f6fe2eb95156e22bebfccb39a7fc1f19e9c0) Docs: References correct config file name (#12885) (Patrick Kilgore) +* [`78182e4`](https://github.com/eslint/eslint/commit/78182e45e0178d9eac2591944ef4daee21d2cb44) Breaking: Add new rules to eslint:recommended (fixes #12911) (#12920) (Milos Djermanovic) +* [`8d5c434`](https://github.com/eslint/eslint/commit/8d5c434f721142be74c7515aaa935668a15b79b1) Docs: fix category descriptions for site generation (fixes #12894) (#12930) (Kai Cataldo) +* [`05380e6`](https://github.com/eslint/eslint/commit/05380e6e7e19a79d26ea6d6b44a8d5ee7cde51c8) Docs: Remove claim about semicolons from docs (#12944) (Luke Sikina) +* [`aa9d725`](https://github.com/eslint/eslint/commit/aa9d72525054e641231a2960a2e37b3716228056) Sponsors: Sync README with website (ESLint Jenkins) +* [`7747177`](https://github.com/eslint/eslint/commit/7747177f8504961059b7c56bdb70a820bd1114c1) Update: report rename id destructuring in id-blacklist (fixes #12807) (#12923) (YeonJuan) +* [`6423e11`](https://github.com/eslint/eslint/commit/6423e11c0bedd3b4e661ab554316bdeb1fc1ee3c) Breaking: check unnamed default export in func-names (fixes #12194) (#12195) (Chiawen Chen) +* [`77df505`](https://github.com/eslint/eslint/commit/77df505d9a08496a8eaefeca4f885f54a21d5c5e) Update: check renaming identifier in object destructuring (fixes 12827) (#12881) (YeonJuan) +* [`41de9df`](https://github.com/eslint/eslint/commit/41de9df41a30a4300243bfe4ca26f716a787b2fc) Update: enforceForLogicalOperands no-extra-boolean-cast (fixes #12137) (#12734) (jmoore914) + +v7.0.0-alpha.1 - February 14, 2020 + +* [`f702b1a`](https://github.com/eslint/eslint/commit/f702b1a54820d2b4e4993dcded99f551a98b490f) Add missing plugin reference (#12796) (Eduard Bardají Puig) +* [`1f1424c`](https://github.com/eslint/eslint/commit/1f1424cb200e609d58645f6c54739e11469e6265) Fix: fix inconsistently works option in no-extra-parens (fixes #12717) (#12843) (YeonJuan) +* [`b5adcaa`](https://github.com/eslint/eslint/commit/b5adcaab93f388f1d8e9d35d6f5e8c2994240850) Fix: make YieldExpression throwable (fixes #12880) (#12897) (YeonJuan) +* [`4293229`](https://github.com/eslint/eslint/commit/4293229709dde105692347241513766e953664dd) Breaking: use-isnan enforceForSwitchCase default `true` (fixes #12810) (#12913) (Milos Djermanovic) +* [`cf38d0d`](https://github.com/eslint/eslint/commit/cf38d0d939b62f3670cdd59f0143fd896fccd771) Breaking: change default ignore pattern (refs eslint/rfcs#51) (#12888) (Toru Nagashima) +* [`bfe1dc4`](https://github.com/eslint/eslint/commit/bfe1dc4e614640cb69032afbb5851c1493f537e3) Breaking: no-dupe-class-members checks some computed keys (fixes #12808) (#12837) (Milos Djermanovic) +* [`1ee6b63`](https://github.com/eslint/eslint/commit/1ee6b6388305a8671c8d4c3cf30c2dbf18a1ff7e) Update: check template literal in yoda (fixes #12863) (#12876) (YeonJuan) +* [`0ae7041`](https://github.com/eslint/eslint/commit/0ae70417af70ad565450d9e779ae78c05f6a51e2) Sponsors: Sync README with website (ESLint Jenkins) +* [`1907e57`](https://github.com/eslint/eslint/commit/1907e57362f7d5f7a02a5a78f24ac3347f868e93) Chore: add Twitter and Open Collective badge (#12877) (Kai Cataldo) +* [`95e0586`](https://github.com/eslint/eslint/commit/95e0586c95e6953d11983d1d11891ed30318109a) Fix: id-blacklist false positives on renamed imports (#12831) (Milos Djermanovic) +* [`b7f0d20`](https://github.com/eslint/eslint/commit/b7f0d200c125b3d233ccafaabdaa61c66dc60e3c) Chore: Use consistent badge style (#12825) (fisker Cheung) +* [`3734a66`](https://github.com/eslint/eslint/commit/3734a669983de7d5107ba8f39b291c6e3116489f) Chore: use ids for messages (#12859) (Gareth Jones) +* [`824d235`](https://github.com/eslint/eslint/commit/824d23585c205f2993716585cb6f55dfbe4a33f0) Docs: add errorOnUnmatchedPattern option to CLIEngine (#12834) (Arthur Denner) +* [`439c833`](https://github.com/eslint/eslint/commit/439c83342c364ba3ce5168d54e165b1fe3e35630) Update: array-callback-return checks Array.forEach (fixes #12551) (#12646) (Gabriel R Sezefredo) +* [`33efd71`](https://github.com/eslint/eslint/commit/33efd71d7c3496b4b9cbfe006280527064940826) Docs: Fix spelling mistakes (#12861) (Bryan Mishkin) +* [`a5b3c5f`](https://github.com/eslint/eslint/commit/a5b3c5fa4edc2312534af0d9f0911f68144f8baf) Docs: Update README team and sponsors (ESLint Jenkins) +* [`0cae920`](https://github.com/eslint/eslint/commit/0cae9203a8077184ad6beb00028fd376cc806f34) Chore: rename shadowed global (#12862) (Tony Brix) +* [`055b80d`](https://github.com/eslint/eslint/commit/055b80dc89bba2a5ab22f7a27deb40135b5cacfa) Chore: Fix typo in complexity.js (#12864) (Kyle Shevlin) +* [`d6c313d`](https://github.com/eslint/eslint/commit/d6c313de794ea0671d35b5027288cd2ea456c0b5) Docs: add missing eslint comments in prefer-regex-literals examples (#12858) (Milos Djermanovic) +* [`7d551ab`](https://github.com/eslint/eslint/commit/7d551ab8cbf2d3a802b0d0685379aa075fe9d7c0) Sponsors: Sync README with website (ESLint Jenkins) +* [`540de8e`](https://github.com/eslint/eslint/commit/540de8e34d08f4b17b66b06d13927acb7552357a) Sponsors: Sync README with website (ESLint Jenkins) +* [`ac5d515`](https://github.com/eslint/eslint/commit/ac5d515252c226f030fa646bf7635a12a3b856fe) Sponsors: Sync README with website (ESLint Jenkins) +* [`dadc892`](https://github.com/eslint/eslint/commit/dadc8927820576c60b48bcbc7d5a9056a6279d30) Fix: operator-assignment crash on adjacent division assignment (#12844) (Milos Djermanovic) +* [`9f39ef0`](https://github.com/eslint/eslint/commit/9f39ef0d4b398c7c09ceef89128da448680d587c) Chore: typo in PULL_REQUEST_TEMPLATE.md (#12848) (Balázs Orbán) +* [`a60d5cd`](https://github.com/eslint/eslint/commit/a60d5cd2325ca72fa1b272b0b90ccd7904b92062) Chore: typo in no-irregular-whitespace.js (#12847) (Balázs Orbán) +* [`691d19a`](https://github.com/eslint/eslint/commit/691d19a2872bffab50c0024d488b8cb33504cc83) Chore: add missing `ecmaVersion` 2020/11 type value (#12833) (Piotr Błażejewicz (Peter Blazejewicz)) +* [`516ddb3`](https://github.com/eslint/eslint/commit/516ddb37d39502e5a8c88a017ae3bad05046f41d) Sponsors: Sync README with website (ESLint Jenkins) +* [`a9d92f9`](https://github.com/eslint/eslint/commit/a9d92f991d69902a9150db373590e2ed54dec988) Fix: radix rule crash on disabled globals (#12824) (Milos Djermanovic) +* [`03a69db`](https://github.com/eslint/eslint/commit/03a69dbe86d5b5768a310105416ae726822e3c1c) Update: check template literal in no-proto, no-iterator (fixes #12801) (#12806) (YeonJuan) +* [`562e784`](https://github.com/eslint/eslint/commit/562e7845946a490f2e173a0bcd1af631070a4eef) Update: fix no-magic-numbers false negative with ignoreArrayIndexes (#12805) (Milos Djermanovic) +* [`f5b9656`](https://github.com/eslint/eslint/commit/f5b96564f732962f46755adbb33c49fae9af6a92) Chore: add test for no-constant-condition (#12836) (Milos Djermanovic) +* [`533c114`](https://github.com/eslint/eslint/commit/533c1140dc98bebdc3ae8334ab2e6c27c7df0c21) Fix: multiline-comment-style rule add extra space after * (fixes #12785) (#12823) (Karthik Priyadarshan) +* [`0460748`](https://github.com/eslint/eslint/commit/0460748cda67ddc4a4cb0db3cdf187a742d09bf8) Update: check template literal in no-constant-condition (fixes #12815) (#12816) (YeonJuan) +* [`80309c3`](https://github.com/eslint/eslint/commit/80309c3791188ac5d1c4eebc99ede323a55336e6) Fix: no-constant-condition doesn't introspect arrays (fixes #12225) (#12307) (Sean Gray) +* [`10a79a6`](https://github.com/eslint/eslint/commit/10a79a672b42d51539bcd6ace482be7afa5f34f8) Chore: Adopt `eslint-plugin/require-meta-docs-description` internally (#12762) (Bryan Mishkin) +* [`aea1729`](https://github.com/eslint/eslint/commit/aea172998ec4e2af1d9186b6767c3f34428945f4) Docs: Fix anchor links in Node.js API TOC (#12821) (Matija Marohnić) +* [`1b8a3ce`](https://github.com/eslint/eslint/commit/1b8a3ce15237b9085f2761dcf73655207e6169a6) Sponsors: Sync README with website (ESLint Jenkins) +* [`c2217c0`](https://github.com/eslint/eslint/commit/c2217c04d6c82b160a21b00fca39c8acec543403) Breaking: make `radix` rule stricter (#12608) (fisker Cheung) + +v7.0.0-alpha.0 - January 17, 2020 + +* [`1aa021d`](https://github.com/eslint/eslint/commit/1aa021d77fdd2c68d7b7d2f4603252110c414b32) Breaking: lint `overrides` files (fixes #10828, refs eslint/rfcs#20) (#12677) (Toru Nagashima) +* [`e59d775`](https://github.com/eslint/eslint/commit/e59d77536bd8db57e8a75cd5245f6f320aa699f8) Update: Separate pattern/expression options for array-element-newline (#11796) (jacobparish) +* [`f8f115a`](https://github.com/eslint/eslint/commit/f8f115af6e10539e6cad485588187cb11917f8c9) Update: treat comment tokens in template-curly-spacing (fixes #12744) (#12775) (YeonJuan) +* [`b50179d`](https://github.com/eslint/eslint/commit/b50179def3fedbd95fdeab25e32c2511867eb760) Breaking: Check assignment targets in no-extra-parens (#12490) (Milos Djermanovic) +* [`de4fa7c`](https://github.com/eslint/eslint/commit/de4fa7c65c7befefa64d1605550267071ee56a5d) Fix: wrong indent at tagged template in indent (fixes #12122) (#12596) (YeonJuan) +* [`d86a5bb`](https://github.com/eslint/eslint/commit/d86a5bbb1987d858d4963f647b0af5c1fd924b4f) Breaking: Check flatMap in array-callback-return (fixes #12235) (#12765) (Milos Djermanovic) +* [`cf46df7`](https://github.com/eslint/eslint/commit/cf46df70158a4ed4c09d5c9d655c07dc6df3ff5e) Breaking: description in directive comments (refs eslint/rfcs#33) (#12699) (Toru Nagashima) +* [`7350589`](https://github.com/eslint/eslint/commit/7350589a5bdfc9d75d1ff19364f476eec44c3911) Breaking: some rules recognize bigint literals (fixes #11803) (#12701) (Toru Nagashima) +* [`16a1c1f`](https://github.com/eslint/eslint/commit/16a1c1f79bc0a4cc1c3a87e98d220041de88bb93) Fix: prefer-object-spread false positives with accessors (fixes #12086) (#12784) (Milos Djermanovic) +* [`f9774ec`](https://github.com/eslint/eslint/commit/f9774ec11b0ebe63fb16a97b97890efb84699548) New: Add default-case-last rule (fixes #12665) (#12668) (Milos Djermanovic) +* [`9a93d9e`](https://github.com/eslint/eslint/commit/9a93d9ef389c49a133c4df4f9843927f5f806423) Update: fix no-restricted-imports export * false negative (fixes #12737) (#12798) (Milos Djermanovic) +* [`0d8c0af`](https://github.com/eslint/eslint/commit/0d8c0affe1ae7ecf228cdf91b490921f7e9d1fdb) Fix: improve report location for computed-property-spacing (#12795) (Milos Djermanovic) +* [`756b95d`](https://github.com/eslint/eslint/commit/756b95d59fb97cd9b3f3adf98cebf529fe4842a2) Fix: id-blacklist should ignore ObjectPatterns (fixes #12787) (#12792) (JP Ramassini) +* [`561b6d4`](https://github.com/eslint/eslint/commit/561b6d4726f3e77dd40ba0d340ca7f08429cd2eb) Chore: add prerequisites checklist to PR template (#12790) (Kai Cataldo) +* [`01ff791`](https://github.com/eslint/eslint/commit/01ff7910af86fc45b76e883bc9ab00c9be3b50ac) Fix: Display pipe character correctly in test output (#12771) (Brad Zacher) +* [`68becbd`](https://github.com/eslint/eslint/commit/68becbd84e8a0693409d36f2be10679c483e233a) Update: fix no-restricted-imports importNames reporting (fixes #12282) (#12711) (Andrey Alexandrov) +* [`ae959b6`](https://github.com/eslint/eslint/commit/ae959b691fb148ac8b474c924c8cb01ef61c436d) Update: report double extra parens in no-extra-parens (fixes #12127) (#12697) (YeonJuan) +* [`02fcc05`](https://github.com/eslint/eslint/commit/02fcc055710e8d69d986f1e682cae2014ad881e2) Docs: Improve sort-keys (#12791) (Steven Vachon) +* [`35cd958`](https://github.com/eslint/eslint/commit/35cd95893be0afd8c954cbcf9268c2aa045b7d5b) Sponsors: Sync README with website (ESLint Jenkins) +* [`a1d999c`](https://github.com/eslint/eslint/commit/a1d999c6b4e51c317ad409110be7be214ff9f7c6) New: Add no-useless-backreference rule (fixes #12673) (#12690) (Milos Djermanovic) +* [`b2c6209`](https://github.com/eslint/eslint/commit/b2c62096a8b318765d618cab222240f87d73063b) Update: fix no-extra-parens CallExpression#callee false negatives (#12743) (Milos Djermanovic) +* [`14b42c3`](https://github.com/eslint/eslint/commit/14b42c386be3387c415267b789f277e1294d4567) Update: fix counting jsx comment len in max-len (fixes #12213) (#12661) (YeonJuan) +* [`e632c31`](https://github.com/eslint/eslint/commit/e632c31d7e5363f1347b787702ecd4a85f5c11a2) Upgrade: several dependencies (#12753) (Toru Nagashima) +* [`25eb703`](https://github.com/eslint/eslint/commit/25eb703c8758563988ffb497a53f89a3ed345399) Docs: fix dead link in max-lines rule docs (#12766) (Christian Bundy) +* [`9dfc850`](https://github.com/eslint/eslint/commit/9dfc8501fb1956c90dc11e6377b4cb38a6bea65d) Chore: Refactor to use messageId in a number of rules (#12715) (Brad Zacher) +* [`1118fce`](https://github.com/eslint/eslint/commit/1118fceb49af3436b8dcd0c6089f913cedf9a329) Breaking: runtime-deprecation on '~/.eslintrc' (refs eslint/rfcs#32) (#12678) (Toru Nagashima) +* [`2c28fbb`](https://github.com/eslint/eslint/commit/2c28fbbb563a44282bef0c9fcc9be29d611cc83b) Breaking: drop Node.js 8 support (refs eslint/rfcs#44) (#12700) (Toru Nagashima) +* [`098b67d`](https://github.com/eslint/eslint/commit/098b67d04a4b4dc8ef4faa6434c6ef5abbde3ed3) Docs: fix minor typo in brace-style.md (#12749) (Marko Kaznovac) +* [`313f70a`](https://github.com/eslint/eslint/commit/313f70ac9a3cf5d1558d2427b00dd75666e18cf4) Update: add outerIIFEBody: "off" to indent rule (fixes #11377) (#12706) (Kai Cataldo) +* [`b77b858`](https://github.com/eslint/eslint/commit/b77b8585e33fc4bb438a0e11ca8177c7eb91dbd8) Chore: fix separateRequires tests for one-var rule (#12709) (Milos Djermanovic) +* [`e4df7df`](https://github.com/eslint/eslint/commit/e4df7dfb0199badb61d2c03ff4f7e4be735279d9) Chore: add JSDoc types for RuleTester test cases (#12325) (Chiawen Chen) +* [`b23ad0d`](https://github.com/eslint/eslint/commit/b23ad0d789a909baf8d7c41a35bc53df932eaf30) Docs: change a broken link in working-with-rules.md (#12732) (Damien Cassou) +* [`3fa39a6`](https://github.com/eslint/eslint/commit/3fa39a633b37544fec7cedfc1f2b0e62e9312a72) Update: Handle locally unsupported regex in computed property keys (#12056) (Milos Djermanovic) +* [`4744397`](https://github.com/eslint/eslint/commit/474439720258b1a64b305c31588f803104fa4aaf) Chore: remove unused code in max-lines-per-function (#12659) (YeonJuan) +* [`4e16957`](https://github.com/eslint/eslint/commit/4e169576a526023ee297d5bc8b37eedba229f63d) Build: update browser build (#12693) (Toru Nagashima) +* [`00ddfff`](https://github.com/eslint/eslint/commit/00ddfffe6b4b4244e4680b0f92f2c6697fad136f) Fix: Windows path parsing for JUnit (fixes #12507) (#12509) (Michael Wall) +* [`985dac3`](https://github.com/eslint/eslint/commit/985dac35e3c367f0f99d1f0e766e06a1d9818dd4) New: Add no-restricted-exports rule (fixes #10428) (#12546) (Milos Djermanovic) +* [`1aff21b`](https://github.com/eslint/eslint/commit/1aff21bb54da44cef0b6e378a34a74265863b930) Fix: no-mixed-spaces-and-tabs reports multiline strings (#12566) (Milos Djermanovic) +* [`8f1020f`](https://github.com/eslint/eslint/commit/8f1020ff711b0c57d590bf666e2841f64186d083) Update: no-void add an option to allow void as a statement (#12613) (Brad Zacher) +* [`bb6cf50`](https://github.com/eslint/eslint/commit/bb6cf5082623ffb67bb1495fee52c0610ee5f421) Update: Add offsetTernaryExpressions option for indent rule (#12556) (Adam Stankiewicz) +* [`39f5a45`](https://github.com/eslint/eslint/commit/39f5a453579b2ad732212edeb71f84ecb0991f97) Chore: add test cases for for-direction (#12698) (YeonJuan) +* [`b340304`](https://github.com/eslint/eslint/commit/b3403045e535921df6d34785a4ce053e14ba27fd) Chore: Add extra test, improve docs (#12492) (Kevin Partington) +* [`827259e`](https://github.com/eslint/eslint/commit/827259ea009f98a0fdf3f7ebf1bfb6cd661ce28d) Build: package.json update for eslint-config-eslint release (ESLint Jenkins) + +v6.8.0 - December 20, 2019 + +* [`c5c7086`](https://github.com/eslint/eslint/commit/c5c708666b450fb69522a55aa375626f9297dc6f) Fix: ignore aligning single line in key-spacing (fixes #11414) (#12652) (YeonJuan) +* [`9986d9e`](https://github.com/eslint/eslint/commit/9986d9e0baed0d3586bbee472fe2fae2ed625f5d) Chore: add object option test cases in yield-star-spacing (#12679) (YeonJuan) +* [`1713d07`](https://github.com/eslint/eslint/commit/1713d0758b083f3840d724505f997a7cb20ff384) New: Add no-error-on-unmatched-pattern flag (fixes #10587) (#12377) (ncraley) +* [`5c25a26`](https://github.com/eslint/eslint/commit/5c25a26608fbd9a1d0127c9a3653609aa4b63e86) Update: autofix bug in lines-between-class-members (fixes #12391) (#12632) (YeonJuan) +* [`4b3cc5c`](https://github.com/eslint/eslint/commit/4b3cc5cd2459f04eae149faea0651785d7f9db0b) Chore: enable prefer-regex-literals in eslint codebase (#12268) (薛定谔的猫) +* [`05faebb`](https://github.com/eslint/eslint/commit/05faebb943456ad2b20117f3c8b3eccbe2e2fb03) Update: improve suggestion testing experience (#12602) (Brad Zacher) +* [`05f7dd5`](https://github.com/eslint/eslint/commit/05f7dd53ed91a6e3be9eb40825fb6d2207f82209) Update: Add suggestions for no-unsafe-negation (fixes #12591) (#12609) (Milos Djermanovic) +* [`d3e43f1`](https://github.com/eslint/eslint/commit/d3e43f1c10c5e19f40e7b3d3944b87f1b0c9c075) Docs: Update no-multi-assign explanation (#12615) (Yuping Zuo) +* [`272e4db`](https://github.com/eslint/eslint/commit/272e4db6074283bc01cc6ec72c9e396bb3c110e6) Fix: no-multiple-empty-lines: Adjust reported `loc` (#12594) (Tobias Bieniek) +* [`a258039`](https://github.com/eslint/eslint/commit/a258039e556075d7d1f955a79d094ea103ec165a) Fix: no-restricted-imports schema allows multiple paths/patterns objects (#12639) (Milos Djermanovic) +* [`51f9620`](https://github.com/eslint/eslint/commit/51f9620cc55cc091fe38dbe68e4633de06297b8c) Fix: improve report location for array-bracket-spacing (#12653) (Milos Djermanovic) +* [`45364af`](https://github.com/eslint/eslint/commit/45364afc9c7f0251348cd1a7a13656c3816435d7) Fix: prefer-numeric-literals doesn't check types of literal arguments (#12655) (Milos Djermanovic) +* [`e3c570e`](https://github.com/eslint/eslint/commit/e3c570eaf3d1d44fb57bf42f1870887856e4c5a0) Docs: Add example for expression option (#12694) (Arnaud Barré) +* [`6b774ef`](https://github.com/eslint/eslint/commit/6b774ef0d849ccf5c1127b25e1fe7c3e438d586b) Docs: Add spacing in comments for no-console rule (#12696) (Nikki Nikkhoui) +* [`7171fca`](https://github.com/eslint/eslint/commit/7171fca6ef4e0e8f267658fc7d8f603f00eddd84) Chore: refactor regex in config comment parser (#12662) (Milos Djermanovic) +* [`1600648`](https://github.com/eslint/eslint/commit/1600648d2880ffb1e9e414b31ff0f66ead7167f9) Update: Allow $schema in config (#12612) (Yordis Prieto) +* [`acc0e47`](https://github.com/eslint/eslint/commit/acc0e47572a9390292b4e313b4a4bf360d236358) Update: support .eslintrc.cjs (refs eslint/rfcs#43) (#12321) (Evan Plaice) +* [`49c1658`](https://github.com/eslint/eslint/commit/49c1658544ace24b9aaaa301af0fc07a2ef3bf30) Chore: remove bundling of ESLint during release (#12676) (Kai Cataldo) +* [`257f3d6`](https://github.com/eslint/eslint/commit/257f3d67905a52bf8602a5a5707c893cc90d7ca7) Chore: complete to move to GitHub Actions (#12625) (Toru Nagashima) +* [`ab912f0`](https://github.com/eslint/eslint/commit/ab912f0ef709a916ab9a27ea09d9d7adf046fb2d) Docs: 1tbs with allowSingleLine edge cases (refs #12284) (#12314) (Ari Kardasis) +* [`dd1c30e`](https://github.com/eslint/eslint/commit/dd1c30e35f05ed332e2abbd3d4d53635efde74b8) Sponsors: Sync README with website (ESLint Jenkins) +* [`a230f84`](https://github.com/eslint/eslint/commit/a230f8404e4f2423dd79378b065d24c12776775b) Update: include node version in cache (#12582) (Eric Wang) +* [`8b65f17`](https://github.com/eslint/eslint/commit/8b65f175dfb4fac11ed7184537be400ed14996fb) Chore: remove references to parser demo (#12644) (Kai Cataldo) +* [`e9cef99`](https://github.com/eslint/eslint/commit/e9cef99e6ebec1faefdb576ca597e81ae4f04afd) Docs: wrap {{}} in raw liquid tags to prevent interpolation (#12643) (Kai Cataldo) +* [`e707453`](https://github.com/eslint/eslint/commit/e70745325ff9e085acc6843dd8bfae5550645d4f) Docs: Fix configuration example in no-restricted-imports (fixes #11717) (#12638) (Milos Djermanovic) +* [`19194ce`](https://github.com/eslint/eslint/commit/19194cec724e016df02376bbeae31171be6f0bdf) Chore: Add tests to cover default object options in comma-dangle (#12627) (YeonJuan) +* [`6e36d12`](https://github.com/eslint/eslint/commit/6e36d12d95e76022172fd0ec8a5e85c22fde6a8a) Update: do not recommend require-atomic-updates (refs #11899) (#12599) (Kai Cataldo) + +v6.7.2 - November 30, 2019 + +* [`bc435a9`](https://github.com/eslint/eslint/commit/bc435a93afd6ba4def1b53993ef7cf8220f3f070) Fix: isSpaceBetweenTokens() recognizes spaces in JSXText (fixes #12614) (#12616) (Toru Nagashima) +* [`4928d51`](https://github.com/eslint/eslint/commit/4928d513b4fe716c7ed958c294a10ef8517be25e) Fix: don't ignore the entry directory (fixes #12604) (#12607) (Toru Nagashima) +* [`b41677a`](https://github.com/eslint/eslint/commit/b41677ae2a143790b19b0e70391a46ec6c8f5de1) Docs: Clarify suggestion's data in Working with Rules (refs #12606) (#12617) (Milos Djermanovic) +* [`ea16de4`](https://github.com/eslint/eslint/commit/ea16de4e7c6f661398b0b7843f95e5f307c89551) Fix: Support tagged template literal generics in no-unexpected-multiline (#11698) (Brad Zacher) +* [`fa6415d`](https://github.com/eslint/eslint/commit/fa6415d5b877370374a6a530a5190ab5a411b4dc) Sponsors: Sync README with website (ESLint Jenkins) +* [`e1e158b`](https://github.com/eslint/eslint/commit/e1e158b4d7bd61e812723b378d2c391295da43a5) Sponsors: Sync README with website (ESLint Jenkins) + +v6.7.1 - November 24, 2019 + +* [`dd1e9f4`](https://github.com/eslint/eslint/commit/dd1e9f4df2103c43509a54b0ad5f9106557997f9) Fix: revert changes to key-spacing due to regression (#12598) (Kai Cataldo) +* [`c644b54`](https://github.com/eslint/eslint/commit/c644b5429e5bc8a050afd70c99ec82035eb611fa) Docs: Update README team and sponsors (ESLint Jenkins) + +v6.7.0 - November 22, 2019 + +* [`312a88f`](https://github.com/eslint/eslint/commit/312a88f2230082d898b7d8d82f8af63cb352e55a) New: Add grouped-accessor-pairs rule (fixes #12277) (#12331) (Milos Djermanovic) +* [`5c68f5f`](https://github.com/eslint/eslint/commit/5c68f5feeb4a6c0cb53ff76b2fd255b5bfa69c93) Update: Add 'lexicalBindings' to no-implicit-globals and change messages (#11996) (Milos Djermanovic) +* [`6eaad96`](https://github.com/eslint/eslint/commit/6eaad964ff159d0a38de96c1104782ffe6858c78) New: Add suggestions API (#12384) (Will Douglas) +* [`b336fbe`](https://github.com/eslint/eslint/commit/b336fbedecd85731611fdc2dfd8edb635a8b1c39) Fix: indent rule with JSX spread props (#12581) (Nathan Woltman) +* [`97c745d`](https://github.com/eslint/eslint/commit/97c745dc277febbea82552a4d9186e3df847f860) Update: Report assignment expression location in no-cond-assign (#12465) (Milos Djermanovic) +* [`0f01f3d`](https://github.com/eslint/eslint/commit/0f01f3d0807c580631c2fdcff29192a64a870637) Update: Check member expressions with `this` in operator-assignment (#12495) (Milos Djermanovic) +* [`62c7038`](https://github.com/eslint/eslint/commit/62c7038a493d89e4a7b14ac673a063d09d04057b) Fix: invalid token checking in computed-property-spacing (fixes #12198) (#12533) (YeonJuan) +* [`4f8a1ee`](https://github.com/eslint/eslint/commit/4f8a1ee1c26ccb5882e5e83ea7eab2f406c7476b) Update: Add enforceForClassMembers option to no-useless-computed-key (#12110) (ark120202) +* [`1a2eb99`](https://github.com/eslint/eslint/commit/1a2eb99f11c65813bba11d6576a06cff2b823cc9) New: new rule no-constructor-return (fixes #12481) (#12529) (Pig Fang) +* [`ca3b2a6`](https://github.com/eslint/eslint/commit/ca3b2a62c9e829dc4534bca3643d6bc729b46df0) New: ignorePatterns in config files (refs eslint/rfcs#22) (#12274) (Toru Nagashima) +* [`60204a3`](https://github.com/eslint/eslint/commit/60204a3620e33a078c1c35fa2e5d839a16c627ff) Docs: Added another Textmate 2 bundle. (#12580) (Ryan Fitzer) +* [`62623f9`](https://github.com/eslint/eslint/commit/62623f9f611a3adb79696304760a2fd14be8afbc) Fix: preserve whitespace in multiline-comment-style (fixes #12312) (#12316) (Kai Cataldo) +* [`17a8849`](https://github.com/eslint/eslint/commit/17a8849491a983f6cb8e98da8c0c9d52ff5f2aa6) New: Add no-dupe-else-if rule (fixes #12469) (#12504) (Milos Djermanovic) +* [`41a78fd`](https://github.com/eslint/eslint/commit/41a78fd7ce245cad8ff6a96c42f5840688849427) Update: improve location for semi and comma-dangle (#12380) (Chiawen Chen) +* [`0a480f8`](https://github.com/eslint/eslint/commit/0a480f8307a0e438032f484254941e6426748143) Docs: Change "Code Conventions" link in pull-requests.md (#12401) (Denis Sikuler) +* [`fed20bb`](https://github.com/eslint/eslint/commit/fed20bb039cf9f53adfcf93e467f418c5e958f45) Fix: require-await crash on global await (#12571) (Brad Zacher) +* [`b8030fc`](https://github.com/eslint/eslint/commit/b8030fc23e88f57a04d955b3befd1ab0fc2c5d10) Update: deprecate personal config (fixes #11914, refs eslint/rfcs#32) (#12426) (Toru Nagashima) +* [`40c8c32`](https://github.com/eslint/eslint/commit/40c8c3264c7c383d98c9faf9c4cb4f8b75aee40f) Fix: improve report location for object-curly-spacing (#12563) (Milos Djermanovic) +* [`1110045`](https://github.com/eslint/eslint/commit/1110045e0d28a461e75d2f57d5f01533d59ef239) Fix: ignore marker-only comments in spaced-comment (fixes #12036) (#12558) (Milos Djermanovic) +* [`6503cb8`](https://github.com/eslint/eslint/commit/6503cb8d99e549fece53b80b110e890a7978b9fd) Update: Fix uglified object align in key-spacing (fixes #11414) (#12472) (YeonJuan) +* [`40791af`](https://github.com/eslint/eslint/commit/40791af69efde1701690637603ad37d41e15a727) Docs: clarify ignoreDestructuring option in the camelcase rule (#12553) (Milos Djermanovic) +* [`07d398d`](https://github.com/eslint/eslint/commit/07d398d91d5b6d0247e58b1f8ea64bb5acd570a8) Chore: Add GitHub organization to Sponsor button (#12562) (Brandon Mills) +* [`a477707`](https://github.com/eslint/eslint/commit/a47770706ac59633dcd73e886d1a7282b324ee06) Chore: Format style guide links so they can be clicked (#12189) (Ivan V) +* [`0f7edef`](https://github.com/eslint/eslint/commit/0f7edefdc1576d5e3e7ef89083002b0a4a31f039) Update: add react plugin config for eslint init (#12446) (Ibrahim Rouis) +* [`448ff1e`](https://github.com/eslint/eslint/commit/448ff1e53734c503fb9e7e6802c1c7e441d4c019) Update: Report '\08' and '\09' in no-octal-escape (fixes #12080) (#12526) (Milos Djermanovic) +* [`45aa6a3`](https://github.com/eslint/eslint/commit/45aa6a3ba3486f1b116c5daab6432d144e5ea574) New: Add no-setter-return rule (fixes #12285) (#12346) (Milos Djermanovic) +* [`0afb518`](https://github.com/eslint/eslint/commit/0afb518d1f139376245613dddd8eaef32b52d619) Fix: invalid autofix in function-call-argument-newline (fixes #12454) (#12539) (YeonJuan) +* [`90305e0`](https://github.com/eslint/eslint/commit/90305e017c2c5fba0b4b62f41b180910b4baeedb) Update: Depcrecate isSpaceBetweenTokens() (#12519) (Kai Cataldo) +* [`41b1e43`](https://github.com/eslint/eslint/commit/41b1e4308c1cb01c8b00cc8adc36440e77854117) New: add option for camelcase (fixes #12527) (#12528) (Pig Fang) +* [`f49f1e0`](https://github.com/eslint/eslint/commit/f49f1e0a69afa49f6548af7b2c0e6347e1ea022d) Upgrade: upgrade optionator to avoid license issue (fixes #11536) (#12537) (Pig Fang) +* [`0286b57`](https://github.com/eslint/eslint/commit/0286b5730501b391c74e069db46849f0de0885d2) Docs: Clean up Getting Started Guide (#12544) (Nicholas C. Zakas) +* [`575a98d`](https://github.com/eslint/eslint/commit/575a98d724b2688f1e9c83744c5dc9ffe9a7bfb4) Chore: Add funding field to package.json (#12543) (Nicholas C. Zakas) +* [`9e29e18`](https://github.com/eslint/eslint/commit/9e29e189752f06362fd1956659e07834efb746a5) Fix: sourceCode#isSpaceBetweenTokens() checks non-adjacent tokens (#12491) (Kai Cataldo) +* [`5868550`](https://github.com/eslint/eslint/commit/586855060afb3201f4752be8820dc85703b523a6) Docs: add notice about `function` keyword in keyword-spacing (#12524) (Pig Fang) +* [`bb556d5`](https://github.com/eslint/eslint/commit/bb556d5fd735ad2dcea322082edcc07a58105ce9) Fix: curly `multi` reports single lexical declarations (fixes #11908) (#12513) (Milos Djermanovic) +* [`ac60621`](https://github.com/eslint/eslint/commit/ac606217d4beebc35b865d14a7f9723fd21faa48) Fix: unexpected autofix in prefer-const (fixes #12514) (#12521) (YeonJuan) +* [`990065e`](https://github.com/eslint/eslint/commit/990065e5f58b6cc6922ab6cee5b97bfc56a6237a) Update: curly multi-or-nest flagging semis on next line (fixes #12370) (#12378) (cherryblossom000) +* [`084a8a6`](https://github.com/eslint/eslint/commit/084a8a63a749232681fefe9bdac6802efdcdc8a8) Fix: no-cond-assign with `always` option reports switch case clauses (#12470) (Milos Djermanovic) +* [`7e41355`](https://github.com/eslint/eslint/commit/7e41355b19a8ef347620dd7c0dde491c3460937b) Update: improve report location for space-infix-ops (#12324) (Chiawen Chen) +* [`94ff921`](https://github.com/eslint/eslint/commit/94ff921689115f856578159564ee1968b4b914be) Update: Add capIsConstructor option to no-invalid-this (fixes #12271) (#12308) (Milos Djermanovic) +* [`de65de6`](https://github.com/eslint/eslint/commit/de65de6e488112a602949e6a5d27dd4c754b003c) New: Add prefer-exponentiation-operator rule (fixes #10482) (#12360) (Milos Djermanovic) +* [`c78f4a7`](https://github.com/eslint/eslint/commit/c78f4a73de68f81cd41132b46d4840b91599d599) Update: Allow JSX exception in no-inline-comments (fixes #11270) (#12388) (Milos Djermanovic) +* [`e17fb90`](https://github.com/eslint/eslint/commit/e17fb90f5817d16081e690eb06b7720afcb9fa2a) New: allowAfterThisConstructor for no-underscore-dangle (fixes #11488) (#11489) (sripberger) +* [`287ca56`](https://github.com/eslint/eslint/commit/287ca562811d037bde09a47af7f5b9c7b741e022) Build: update CI for Node.js 13 (#12496) (Toru Nagashima) +* [`98e1d50`](https://github.com/eslint/eslint/commit/98e1d50273f31c2a7b59772298280ed7305274c8) Upgrade: globals to v12.1.0 (#12296) (Tony Brix) +* [`8ac71a3`](https://github.com/eslint/eslint/commit/8ac71a3c89a9db13706a44b23d1b509b65185113) Sponsors: Sync README with website (ESLint Jenkins) +* [`4e142ea`](https://github.com/eslint/eslint/commit/4e142ea411dfb692b6e2a69cd5f1204ade4dd58a) Docs: Update README team and sponsors (ESLint Jenkins) + +v6.6.0 - October 25, 2019 + +* [`39dfe08`](https://github.com/eslint/eslint/commit/39dfe0880fa934e287e8ea1f7b56d5cba8d43765) Update: false positives in function-call-argument-newline (fixes #12123) (#12280) (Scott O'Hara) +* [`4d84210`](https://github.com/eslint/eslint/commit/4d842105c9c82026be668d7425213138903d4d41) Update: improve report location for no-trailing-spaces (fixes #12315) (#12477) (Milos Djermanovic) +* [`c6a7745`](https://github.com/eslint/eslint/commit/c6a7745a1371a85932bfae5fec039d1b6fcfc128) Update: no-trailing-spaces false negatives after comments (fixes #12479) (#12480) (Milos Djermanovic) +* [`0bffe95`](https://github.com/eslint/eslint/commit/0bffe953d2752dd2d3045f2f8771c96b6cee8fc4) Fix: no-misleading-character-class crash on invalid regex (fixes #12169) (#12347) (Milos Djermanovic) +* [`c6a9a3b`](https://github.com/eslint/eslint/commit/c6a9a3bc58b69dbf9be9cd09b0283c081ca211e7) Update: Add enforceForIndexOf option to use-isnan (fixes #12207) (#12379) (Milos Djermanovic) +* [`364877b`](https://github.com/eslint/eslint/commit/364877b2504e8f7ece04770b93d517e2f27458d0) Update: measure plugin loading time and output in debug message (#12395) (Victor Homyakov) +* [`1744fab`](https://github.com/eslint/eslint/commit/1744faba3c93c869f7dbbf0a704d32e2692d6856) Fix: operator-assignment removes and duplicates comments (#12485) (Milos Djermanovic) +* [`52ca11a`](https://github.com/eslint/eslint/commit/52ca11a66ab6c2fb5a71d8b9869482f14f98cb9d) Fix: operator-assignment invalid autofix with adjacent tokens (#12483) (Milos Djermanovic) +* [`0f6d0dc`](https://github.com/eslint/eslint/commit/0f6d0dcdf5adc30079a7379bbf605a4ef3887a85) Fix: CLIEngine#addPlugin reset lastConfigArrays (fixes #12425) (#12468) (Toru Nagashima) +* [`923a8cb`](https://github.com/eslint/eslint/commit/923a8cb752b8dee1e622c5fd36f3f53288e30602) Chore: Fix lint failure in JSDoc comment (#12489) (Brandon Mills) +* [`aac3be4`](https://github.com/eslint/eslint/commit/aac3be435cccc241781150fcac728df04d086fa8) Update: Add ignored prop regex no-param-reassign (#11275) (Luke Bennett) +* [`e5382d6`](https://github.com/eslint/eslint/commit/e5382d6e4eb1344f537b6f107535269e9939fcb8) Chore: Remove unused parameter in dot-location (#12464) (Milos Djermanovic) +* [`49faefb`](https://github.com/eslint/eslint/commit/49faefbee3fc7daaf2482d9d7d23513d6ffda9e8) Fix: no-obj-calls false positive (fixes #12437) (#12467) (Toru Nagashima) +* [`b3dbd96`](https://github.com/eslint/eslint/commit/b3dbd9657bbeac6571111a4429b03fc085ba6655) Fix: problematic installation issue (fixes #11018) (#12309) (Toru Nagashima) +* [`cd7c29b`](https://github.com/eslint/eslint/commit/cd7c29b17085c14c9cf6345201c72a192c0d0e0c) Sponsors: Sync README with website (ESLint Jenkins) +* [`8233873`](https://github.com/eslint/eslint/commit/8233873b8e5facd80ab7b172bff1e896a9c5fd39) Docs: Add note about Node.js requiring SSL support (fixes #11413) (#12475) (Nicholas C. Zakas) +* [`89e8aaf`](https://github.com/eslint/eslint/commit/89e8aafcc622a4763bed6b9d62f148ef95798f38) Fix: improve report location for no-tabs (#12471) (Milos Djermanovic) +* [`7dffe48`](https://github.com/eslint/eslint/commit/7dffe482d646d4e5f94fa87a22f3b5b2e0a4b189) Update: Enable function string option in comma-dangle (fixes #12058) (#12462) (YeonJuan) +* [`e15e1f9`](https://github.com/eslint/eslint/commit/e15e1f933f287d274a726e7f0f0a1dd80f0964af) Docs: fix doc for no-unneeded-ternary rule (fixes #12098) (#12410) (Sam Rae) +* [`b1dc58f`](https://github.com/eslint/eslint/commit/b1dc58f0a717cb3d19300c845ca23a21ceb610d3) Sponsors: Sync README with website (ESLint Jenkins) +* [`61749c9`](https://github.com/eslint/eslint/commit/61749c94bd8a2ebcdfb89e0cd48c4a029a945079) Chore: Provide debug log for parser errors (#12474) (Brad Zacher) +* [`7c8bbe0`](https://github.com/eslint/eslint/commit/7c8bbe0391944e1f92e083a04715bf4b3fe6be5d) Update: enforceForOrderingRelations no-unsafe-negation (fixes #12163) (#12414) (Sam Rae) +* [`349ed67`](https://github.com/eslint/eslint/commit/349ed6700e1155384597e1e6035550a96cb8a42d) Update: improve report location for no-mixed-operators (#12328) (Chiawen Chen) +* [`a102eaa`](https://github.com/eslint/eslint/commit/a102eaa9ac19e1c6d92f79a4033e9048cfb64c0d) Fix: prefer-numeric-literals invalid autofix with adjacent tokens (#12387) (Milos Djermanovic) +* [`6e7c18d`](https://github.com/eslint/eslint/commit/6e7c18ddb30b32ee5b2e842cc8258aa7aebb7445) Update: enforceForNewInMemberExpressions no-extra-parens (fixes #12428) (#12436) (Milos Djermanovic) +* [`51fbbd7`](https://github.com/eslint/eslint/commit/51fbbd78f98f223d17071650f5117d07f60dadc2) Fix: array-bracket-newline consistent error with comments (fixes #12416) (#12441) (Milos Djermanovic) +* [`e657d4c`](https://github.com/eslint/eslint/commit/e657d4ccb9f3dd5cacceaaa40ffe24ac29a1349a) Fix: report full dot location in dot-location (#12452) (Milos Djermanovic) +* [`2d6e345`](https://github.com/eslint/eslint/commit/2d6e345e3c2626b0f2252f22cfaffdf53ea0871a) Update: make isSpaceBetweenTokens() ignore newline in comments (#12407) (YeonJuan) +* [`84f71de`](https://github.com/eslint/eslint/commit/84f71de0e686e0fe37b83d6728ce1825caaa44fb) Update: remove default overrides in keyword-spacing (fixes #12369) (#12411) (YeonJuan) +* [`18a0b0e`](https://github.com/eslint/eslint/commit/18a0b0e3df927428a22b5b5295f9faee4bd57246) Update: improve report location for no-space-in-parens (#12364) (Chiawen Chen) +* [`d61c8a5`](https://github.com/eslint/eslint/commit/d61c8a5a75447a36276f2d4f84afb3e1129618da) Update: improve report location for no-multi-spaces (#12329) (Chiawen Chen) +* [`561093f`](https://github.com/eslint/eslint/commit/561093fc4267a4ae317d63bc9f103020fad88802) Upgrade: bump inquirer to ^7.0.0 (#12440) (Joe Graham) +* [`fb633b2`](https://github.com/eslint/eslint/commit/fb633b2bbd0a390b247047524fdd1f612dbab803) Chore: Add a script for testing with more control (#12444) (Eric Wang) +* [`012ec51`](https://github.com/eslint/eslint/commit/012ec5151113a2be06fc0e4cd208d714e52dbc57) Sponsors: Sync README with website (ESLint Jenkins) +* [`874fe16`](https://github.com/eslint/eslint/commit/874fe1642a10a0fb937ccccdd4d22343b84f80dc) New: pass cwd from cli engine (#12389) (Eric Wang) +* [`b962775`](https://github.com/eslint/eslint/commit/b962775b8cb7c90985a5ab63e56744bb2ba79644) Update: no-self-assign should detect member expression with this (#12279) (Tibor Blenessy) +* [`02977f2`](https://github.com/eslint/eslint/commit/02977f25a922dd0b8617c16116bb4364d0f30e94) Docs: Clarify `eslint:recommended` semver policy (#12429) (Kevin Partington) +* [`97045ae`](https://github.com/eslint/eslint/commit/97045ae0805e6503887eef0b131dcb9e70b6d185) Docs: Fixes object type for `rules` in "Use a Plugin" (#12409) (Daisy Develops) +* [`24ca088`](https://github.com/eslint/eslint/commit/24ca088fdc901feef8f10b050414fbde64b55c7d) Docs: Fix typo in v6 migration guide (#12412) (Benjamim Sonntag) +* [`b094008`](https://github.com/eslint/eslint/commit/b094008fb196dc1de5b4c27b7dbf0bcbb4b7b352) Chore: update version parameter name (#12402) (Toru Nagashima) +* [`e5637ba`](https://github.com/eslint/eslint/commit/e5637badd42f087d115f81575b832097fe6fe554) Chore: enable jsdoc/require-description (#12365) (Kai Cataldo) +* [`d31f337`](https://github.com/eslint/eslint/commit/d31f3370396ec4868722bdc044aa697b135ac183) Sponsors: Sync README with website (ESLint Jenkins) +* [`7ffb22f`](https://github.com/eslint/eslint/commit/7ffb22f61cf1622511a7fe42b5ead7c3b216df5e) Chore: Clean up inline directive parsing (#12375) (Jordan Eldredge) +* [`84467c0`](https://github.com/eslint/eslint/commit/84467c07461cc47ee43807ba9014e13700473c5c) Docs: fix wrong max-depth example (fixes #11991) (#12358) (Gabriel R Sezefredo) +* [`3642342`](https://github.com/eslint/eslint/commit/364234262efabd91fa8bd53161d9d3e1e37e7944) Docs: Fix minor formatting/grammar errors (#12371) (cherryblossom000) +* [`c47fa0d`](https://github.com/eslint/eslint/commit/c47fa0dfc76211b3b0e5649c63acdd9606ce0eca) Docs: Fix missing word in sentence (#12361) (Dan Boulet) +* [`8108f49`](https://github.com/eslint/eslint/commit/8108f49f9fa0c2de80b3b66c847551beff585951) Chore: enable additional eslint-plugin-jsdoc rules (#12336) (Kai Cataldo) +* [`b718d2e`](https://github.com/eslint/eslint/commit/b718d2e6c9fe3fc56aa7cfc68b1a40b5cd8a7c01) Chore: update issue template with --eslint-fix flag (#12352) (James George) +* [`20ba14d`](https://github.com/eslint/eslint/commit/20ba14dc78fc2654b2920d14877dde21c6c10da4) Sponsors: Sync README with website (ESLint Jenkins) +* [`566a947`](https://github.com/eslint/eslint/commit/566a947f67c8038a50e204d68723519778a78a0f) Sponsors: Sync README with website (ESLint Jenkins) +* [`070cbd0`](https://github.com/eslint/eslint/commit/070cbd0a2ec07831962a25c4276d08e097302416) Sponsors: Sync README with website (ESLint Jenkins) + +v6.5.1 - September 30, 2019 + +* [`0d3d7d9`](https://github.com/eslint/eslint/commit/0d3d7d9cdd83a7f0e035c95f716a91b9ecc4868b) Docs: fix typo in no-magic-numbers (#12345) (Josiah Rooney) +* [`447ac87`](https://github.com/eslint/eslint/commit/447ac877e8ca2858d61b1e983f72d39e3e2ca74d) Fix: no-useless-rename handles ExperimentalRestProperty (fixes #12335) (#12339) (Kai Cataldo) +* [`b6ff73c`](https://github.com/eslint/eslint/commit/b6ff73cad13282fbfc91186cf4bc2f20278a8936) Sponsors: Sync README with website (ESLint Jenkins) + +v6.5.0 - September 29, 2019 + +* [`73596cb`](https://github.com/eslint/eslint/commit/73596cbdf0a12e2878b2994783f9b969b0c5fbeb) Update: Add enforceForSwitchCase option to use-isnan (#12106) (Milos Djermanovic) +* [`d592a24`](https://github.com/eslint/eslint/commit/d592a248d67920f7200925c003f10853d29f1f8d) Fix: exclude `\u000d` so new line won't convert to text (fixes #12027) (#12031) (zamboney) +* [`e85d27a`](https://github.com/eslint/eslint/commit/e85d27af427d6185ac553a0d801b5103153426d4) Fix: no-regex-spaces false positives and invalid autofix (fixes #12226) (#12231) (Milos Djermanovic) +* [`b349bf7`](https://github.com/eslint/eslint/commit/b349bf79ad56dded826bc99cb52c3551af34fa63) Fix: prefer-named-capture-group incorrect locations (fixes #12233) (#12247) (Milos Djermanovic) +* [`7dc1ea9`](https://github.com/eslint/eslint/commit/7dc1ea9a1b9a21daaffcf712ba9c0e91af81b906) Fix: no-useless-return autofix removes comments (#12292) (Milos Djermanovic) +* [`0e68677`](https://github.com/eslint/eslint/commit/0e68677ec0aaf060a071ecf71e4af954dddb6af0) Fix: no-extra-bind autofix removes comments (#12293) (Milos Djermanovic) +* [`6ad7e86`](https://github.com/eslint/eslint/commit/6ad7e864303e56a39c89569d50c6caf80752ee21) Fix: no-extra-label autofix removes comments (#12298) (Milos Djermanovic) +* [`acec201`](https://github.com/eslint/eslint/commit/acec201f06df780791179ad92cfc484f9b6d23d4) Fix: no-undef-init autofix removes comments (#12299) (Milos Djermanovic) +* [`d89390b`](https://github.com/eslint/eslint/commit/d89390b75e3e9993f347387a49b0ac5550f45c7f) Fix: use async reading of stdin in bin/eslint.js (fixes #12212) (#12230) (Barrie Treloar) +* [`334ca7c`](https://github.com/eslint/eslint/commit/334ca7c8b9c18ac097849c1cefaa43097a4e51dc) Update: no-useless-rename also reports default values (fixes #12301) (#12322) (Kai Cataldo) +* [`41bfe91`](https://github.com/eslint/eslint/commit/41bfe919c06932b7e58cd9ead20157e06656160a) Update: Fix handling of chained new expressions in new-parens (#12303) (Milos Djermanovic) +* [`160b7c4`](https://github.com/eslint/eslint/commit/160b7c46b556ccb6023eb411a8be8801a4bda6df) Chore: add autofix npm script (#12330) (Kai Cataldo) +* [`04b6adb`](https://github.com/eslint/eslint/commit/04b6adb7f1bcb2b6cb3fa377b1ca4cecd810630e) Chore: enable eslint-plugin-jsdoc (refs #11146) (#12332) (Kai Cataldo) +* [`9b86167`](https://github.com/eslint/eslint/commit/9b86167e6f053e4a72bf68ebc79db53903f7f8c3) Docs: Add new ES environments to Configuring ESLint (#12289) (Milos Djermanovic) +* [`c9aeab2`](https://github.com/eslint/eslint/commit/c9aeab21a71c6743f51163b7a8fdf4f0cbfcdbde) Docs: Add supported ECMAScript version to README (#12290) (Milos Djermanovic) +* [`8316e7b`](https://github.com/eslint/eslint/commit/8316e7be5a9429513d7ecf2ee2afc40ab4415b8f) Fix: no-useless-rename autofix removes comments (#12300) (Milos Djermanovic) +* [`29c12f1`](https://github.com/eslint/eslint/commit/29c12f18726a3afb21fc89ab1bdacc6972d49e68) Chore: cache results in runtime-info (#12320) (Kai Cataldo) +* [`f5537b2`](https://github.com/eslint/eslint/commit/f5537b2ed0b0b5e51a34c22cdd4ebfd024eaea3d) Fix: prefer-numeric-literals autofix removes comments (#12313) (Milos Djermanovic) +* [`11ae6fc`](https://github.com/eslint/eslint/commit/11ae6fcb5d5503e5dea41c02780369efe51f0bb9) Update: Fix call, new and member expressions in no-extra-parens (#12302) (Milos Djermanovic) +* [`a7894eb`](https://github.com/eslint/eslint/commit/a7894ebb43523152d36720efa770bb1fe8b58c07) New: add --env-info flag to CLI (#12270) (Kai Cataldo) +* [`61392ff`](https://github.com/eslint/eslint/commit/61392ff5ec660bfc01ac2ff0e9660d259cf88fd6) Sponsors: Sync README with website (ESLint Jenkins) +* [`2c6bf8e`](https://github.com/eslint/eslint/commit/2c6bf8ea9c8a8f94746f980bd5bea0a8c5c4d6b7) Docs: English fix (#12306) (Daniel Nixon) +* [`6f11877`](https://github.com/eslint/eslint/commit/6f118778366613fc53036cb6a7537e1b4c6e7af8) Sponsors: Sync README with website (ESLint Jenkins) +* [`2e202ca`](https://github.com/eslint/eslint/commit/2e202ca2228846e6226aa8dd99c614d572fb86a8) Docs: fix links in array-callback-return (#12288) (Milos Djermanovic) +* [`e39c631`](https://github.com/eslint/eslint/commit/e39c6318af0fd27edd5fd2aaf2b24a3e204005dd) Docs: add example for CLIEngine#executeOnText 3rd arg (#12286) (Kai Cataldo) +* [`d4f9a16`](https://github.com/eslint/eslint/commit/d4f9a16af7e00021e2ed63823d9c2f149bc985d6) Update: add support for JSXFragments in indent rule (fixes #12208) (#12210) (Kai Cataldo) +* [`c6af95f`](https://github.com/eslint/eslint/commit/c6af95f5bf1ef10f08545d54fd52b98e85fdf7f7) Sponsors: Sync README with website (ESLint Jenkins) +* [`8cadd52`](https://github.com/eslint/eslint/commit/8cadd5229b7372aed0d4785dcae15532a399bf55) Sponsors: Sync README with website (ESLint Jenkins) +* [`f9fc695`](https://github.com/eslint/eslint/commit/f9fc695d77c19cd5ecb3f0e97e1ea124c8543409) Chore: enable default-param-last (#12244) (薛定谔的猫) +* [`9984c3e`](https://github.com/eslint/eslint/commit/9984c3e27c92de76b8c05a58525dbcea12b10b83) Docs: Update README team and sponsors (ESLint Jenkins) + +v6.4.0 - September 13, 2019 + +* [`e915fff`](https://github.com/eslint/eslint/commit/e915fffb6089a23ff1cae926cc607f9b87dc1819) Docs: Improve examples and clarify default option (#12067) (Yuping Zuo) +* [`540296f`](https://github.com/eslint/eslint/commit/540296fcecd232a09dc873a5a22f5839b59b7842) Update: enforceForClassMembers option to accessor-pairs (fixes #12063) (#12192) (Milos Djermanovic) +* [`d3c2334`](https://github.com/eslint/eslint/commit/d3c2334646eae9287d5be9e457d041e445efb512) Update: flag nested block with declaration as error (#12193) (David Waller) +* [`b2498d2`](https://github.com/eslint/eslint/commit/b2498d284b9c30ed1543429c2f45d9014e12fe22) Update: Fix handling of property names in no-self-assign (#12105) (Milos Djermanovic) +* [`1ee61b0`](https://github.com/eslint/eslint/commit/1ee61b06715fcc750be2c923034a1e59ba663287) Update: enforceForClassMembers computed-property-spacing (fixes #12049) (#12214) (Milos Djermanovic) +* [`520c922`](https://github.com/eslint/eslint/commit/520c92270eed6e90c1a796e8af275980f01705e0) Docs: Added naming convention details to plugin usage (#12202) (Henrique Barcelos) +* [`f826eab`](https://github.com/eslint/eslint/commit/f826eabbeecddb047f58f4e7308a14c18148d369) Fix: Allow line comment exception in object-curly-spacing (fixes #11902) (#12216) (Milos Djermanovic) +* [`db2a29b`](https://github.com/eslint/eslint/commit/db2a29beb0fa28183f65bf9e659c66c03a8918b5) Update: indentation of comment followed by semicolon (fixes #12232) (#12243) (Kai Cataldo) +* [`ae17d1c`](https://github.com/eslint/eslint/commit/ae17d1ca59dd466aa64da0680ec2453c2dc3b80d) Fix: no-sequences is reporting incorrect locations (#12241) (Milos Djermanovic) +* [`365331a`](https://github.com/eslint/eslint/commit/365331a42e22af5a77ac9cfa9673d6a8f653eb5a) Fix: object-shorthand providing invalid fixes for typescript (#12260) (Brad Zacher) +* [`1c921c6`](https://github.com/eslint/eslint/commit/1c921c6dfd7ddfb0308c8103e53d32c1241475f0) New: add no-import-assign (fixes #12237) (#12252) (Toru Nagashima) +* [`3be04fd`](https://github.com/eslint/eslint/commit/3be04fd6a4e7b3f5a5ecb845a29cf29b71fe2dfb) New: Add prefer-regex-literals rule (fixes #12238) (#12254) (Milos Djermanovic) +* [`37c0fde`](https://github.com/eslint/eslint/commit/37c0fdeb87b92a0b779b125adf45535b79b65757) Update: Report global Atomics calls in no-obj-calls (fixes #12234) (#12258) (Milos Djermanovic) +* [`985c9e5`](https://github.com/eslint/eslint/commit/985c9e5eba351965a8a1491a41dbdcc78154b8f4) Fix: space-before-function-paren autofix removes comments (fixes #12259) (#12264) (Milos Djermanovic) +* [`01da7d0`](https://github.com/eslint/eslint/commit/01da7d04c4e5a7376cf241ec02db7971726a1bf9) Fix: eqeqeq rule reports incorrect locations (#12265) (Milos Djermanovic) +* [`319e4d8`](https://github.com/eslint/eslint/commit/319e4d8386ea846928f0f906c251b46043a53491) Docs: adding finally example (#12256) (Jens Melgaard) +* [`d52328f`](https://github.com/eslint/eslint/commit/d52328f012f3704c7d1ce39427e63f80531c7979) Docs: fix no-sequences `with` examples (#12239) (Milos Djermanovic) +* [`a41fdc0`](https://github.com/eslint/eslint/commit/a41fdc07404a7675d14183fab245fb8f49dcb858) Fix: Remove autofixer for no-unsafe-negation (#12157) (Milos Djermanovic) +* [`e38f5fd`](https://github.com/eslint/eslint/commit/e38f5fdfc786363a3eae642f1a69a8725600aa61) Update: fix no-octal-escape false negatives after \0 (#12079) (Milos Djermanovic) +* [`9418fbe`](https://github.com/eslint/eslint/commit/9418fbe0eb31cace3debe27b620709628df2fad7) Sponsors: Sync README with website (ESLint Jenkins) +* [`acc5ec5`](https://github.com/eslint/eslint/commit/acc5ec5082aed466a29899f651e6767b39155aec) Sponsors: Sync README with website (ESLint Jenkins) +* [`460c5ad`](https://github.com/eslint/eslint/commit/460c5ad176eaf39ff579cd96b3bcbe0539093f8f) Sponsors: Sync README with website (ESLint Jenkins) +* [`0313441`](https://github.com/eslint/eslint/commit/0313441d016c8aa0674c135f9da67a676e766ec5) New: add rule default-param-last (fixes #11361) (#12188) (Chiawen Chen) +* [`7621f5d`](https://github.com/eslint/eslint/commit/7621f5d2aa7d87e798b75ca47d6889c280597e99) Update: add more specific linting messages to space-in-parens (#11121) (Che Fisher) +* [`21eb904`](https://github.com/eslint/eslint/commit/21eb9044135c01b6c12188517bba840614483fc6) Fix: basePath of OverrideTester (fixes #12032) (#12205) (Toru Nagashima) +* [`86e5e65`](https://github.com/eslint/eslint/commit/86e5e657ea3fbf12b10524abcbc197afd215a060) Sponsors: Sync README with website (ESLint Jenkins) +* [`2b1a13f`](https://github.com/eslint/eslint/commit/2b1a13fa0de8360586857f3ced8da514c971297d) Fix: no-extra-boolean-cast reports wrong negation node (fixes #11324) (#12197) (Milos Djermanovic) +* [`ba8c2aa`](https://github.com/eslint/eslint/commit/ba8c2aa0154561fbeca33db0343cb39a7fbd9b4f) Sponsors: Sync README with website (ESLint Jenkins) +* [`a0a9746`](https://github.com/eslint/eslint/commit/a0a9746724ccd22c721ddc1b25c566aa9acea154) Docs: Fix link in no-irregular-whitespace.md (#12196) (Timo Tijhof) +* [`e10eeba`](https://github.com/eslint/eslint/commit/e10eebab4abd193dee697c4de7fb2d95bbab2d8c) Fix: quotes autofix produces syntax error with octal escape sequences (#12118) (Milos Djermanovic) + +v6.3.0 - August 30, 2019 + +* [`0acdefb`](https://github.com/eslint/eslint/commit/0acdefb97f35bb09db2910540c70dc377a01ad62) Chore: refactor code (#12113) (James George) +* [`52e2cf5`](https://github.com/eslint/eslint/commit/52e2cf50b35d57fb8466e0bcd0581eff1590fb4c) New: reportUnusedDisableDirectives in config (refs eslint/rfcs#22) (#12151) (Toru Nagashima) +* [`020f952`](https://github.com/eslint/eslint/commit/020f9526b618a191566acea3e17e20815d484c58) Update: enforceForSequenceExpressions to no-extra-parens (fixes #11916) (#12142) (Milos Djermanovic) +* [`aab1b84`](https://github.com/eslint/eslint/commit/aab1b840f9cffb2a76a5c9fe1852961be71dc184) Fix: reset to the default color (#12174) (Ricardo Gobbo de Souza) +* [`4009d39`](https://github.com/eslint/eslint/commit/4009d39aa59451510aa24911e758d664f216289a) Fix: yoda rule produces invalid autofix with preceding yield (#12166) (Milos Djermanovic) +* [`febb660`](https://github.com/eslint/eslint/commit/febb6605d350c936d64cb73e694482cfbb20b29c) Fix: no-extra-boolean-cast invalid autofix with yield before negation (#12164) (Milos Djermanovic) +* [`4c0b70b`](https://github.com/eslint/eslint/commit/4c0b70b869c16647f7af6de9d5c5479fc19f49db) New: support TypeScript at config initializer (fixes #11789) (#12172) (Pig Fang) +* [`94e39d9`](https://github.com/eslint/eslint/commit/94e39d9f782f45db86a079e07508d63040118ef1) Chore: use GitHub Actions (#12144) (Toru Nagashima) +* [`e88f305`](https://github.com/eslint/eslint/commit/e88f305df9d454868624c559fd93b981a680c215) Chore: support es2020 in fuzz (#12180) (薛定谔的猫) +* [`00d2c5b`](https://github.com/eslint/eslint/commit/00d2c5be9a89efd90135c4368a9589f33df3f7ba) Docs: corrected class extension example (#12176) (Marius M) +* [`31e5428`](https://github.com/eslint/eslint/commit/31e542819967b2aa1191e1abaa1c4a49fddbe3cf) Chore: Fix wrong error object keys in test files (#12162) (Milos Djermanovic) +* [`197f443`](https://github.com/eslint/eslint/commit/197f4432fca70a574028e5568c48afad12213224) Fix: func-name-matching crash on descriptor-like arguments (#12100) (Milos Djermanovic) +* [`644ce33`](https://github.com/eslint/eslint/commit/644ce3306748a33b74fc6a94be0267c2c9f19348) Fix: no-self-assign false positive with rest and spread in array (#12099) (Milos Djermanovic) +* [`a81d263`](https://github.com/eslint/eslint/commit/a81d2636ce41fb34d6826c2e9857814e11cb9c30) Fix: fix message of function-paren-newline (#12136) (Pig Fang) +* [`77f8ed1`](https://github.com/eslint/eslint/commit/77f8ed1ad9656c526217ce54a6717fa232d522c8) Chore: update blogpost template (#12154) (Toru Nagashima) +* [`6abc7b7`](https://github.com/eslint/eslint/commit/6abc7b72dfb824a372379708ca39340b2c7abc03) Docs: Document the exception in no-unsafe-negation (#12161) (Milos Djermanovic) + +v6.2.2 - August 23, 2019 + +* [`0e0b784`](https://github.com/eslint/eslint/commit/0e0b784b922051c2a1d39dd8160382114b645800) Upgrade: espree@^6.1.1 (#12158) (Kevin Partington) +* [`04e859f`](https://github.com/eslint/eslint/commit/04e859f228d081efd3af6edb22563dbc775f8d1d) Sponsors: Sync README with website (ESLint Jenkins) +* [`34783d1`](https://github.com/eslint/eslint/commit/34783d10ff9b58a3c1e39a36e10864caeb9f66e0) Sponsors: Sync README with website (ESLint Jenkins) +* [`b809e72`](https://github.com/eslint/eslint/commit/b809e72221bc658e5a42bfd4b8723d3771571f9e) Docs: Update README team and sponsors (ESLint Jenkins) + +v6.2.1 - August 20, 2019 + +* [`8c021b5`](https://github.com/eslint/eslint/commit/8c021b5917b3aa3c578ffe3972106d0a6bcf0838) Upgrade: eslint-utils 1.4.2 (#12131) (Toru Nagashima) +* [`e82388b`](https://github.com/eslint/eslint/commit/e82388bd87717430200ec554634cc08806e38d3c) Sponsors: Sync README with website (ESLint Jenkins) +* [`4aeeeed`](https://github.com/eslint/eslint/commit/4aeeeedb656ee3519ea82ebf0cb41ca801215046) Docs: update docs for ecmaVersion 2020 (#12120) (silverwind) +* [`6886148`](https://github.com/eslint/eslint/commit/6886148d1f528659ec3e125f61ef7a5f4c67556d) Docs: Add duplicate keys limitation to accessor-pairs (#12124) (Milos Djermanovic) + +v6.2.0 - August 18, 2019 + +* [`fee6acb`](https://github.com/eslint/eslint/commit/fee6acbe13cecd4c028e681e185fc6a6d6ba9452) Update: support bigint and dynamic import (refs #11803) (#11983) (Toru Nagashima) +* [`afd8012`](https://github.com/eslint/eslint/commit/afd8012c2797f2f5bf3c360cb241ea2ba6e1a489) New: noInlineConfig setting (refs eslint/rfcs#22) (#12091) (Toru Nagashima) +* [`3d12378`](https://github.com/eslint/eslint/commit/3d12378221961439c27ddae0ecda9845ac575107) Update: Fix accessor-pairs to enforce pairs per property in literals (#12062) (Milos Djermanovic) +* [`8cd00b3`](https://github.com/eslint/eslint/commit/8cd00b308987e0db0bdb2e242bf13b2b07b350bd) New: function-call-argument-newline (#12024) (finico) +* [`30ebf92`](https://github.com/eslint/eslint/commit/30ebf929f60684520b1201c1adfd86214c19d614) Fix: prefer-template autofix produces syntax error with octal escapes (#12085) (Milos Djermanovic) +* [`13c3988`](https://github.com/eslint/eslint/commit/13c3988a4001ae368ea7b6c8d3dd0abfa7c6cf64) Fix: Check literal type explicitly in dot-notation (#12095) (Milos Djermanovic) +* [`3e5ceca`](https://github.com/eslint/eslint/commit/3e5ceca4d2284b55a2292a1d3de9aa4cdf6fa213) Fix: Handle empty string property names in getFunctionNameWithKind (#12104) (Milos Djermanovic) +* [`9a043ff`](https://github.com/eslint/eslint/commit/9a043ffbb864fc65baeb16fe5668435e3b7cfe34) Fix: no-duplicate-case false positives on Object.prototype keys (#12107) (Milos Djermanovic) +* [`fe631af`](https://github.com/eslint/eslint/commit/fe631afee59641876598d19b1935967099cc6fa0) Chore: minor typo fix (#12112) (James George) +* [`4cb7877`](https://github.com/eslint/eslint/commit/4cb78774f6cc687a3c8701462f8c7f7b587ecaf0) Fix: fix no-extra-parens ignores some nodes (#11909) (Pig Fang) +* [`2dc23b8`](https://github.com/eslint/eslint/commit/2dc23b81e54defbce7a70a7f26c2e4c7b692cf58) Update: fix no-dupe-keys false negatives on empty string names (#12069) (Milos Djermanovic) +* [`19ab666`](https://github.com/eslint/eslint/commit/19ab6666e8e4142a183bdee2be96e5bafbac0e21) Fix: yoda exceptRange false positives on empty string property names (#12071) (Milos Djermanovic) +* [`d642150`](https://github.com/eslint/eslint/commit/d642150fe016608e71a1df2a72960e915b3cfbad) Update: Check empty string property names in sort-keys (#12073) (Milos Djermanovic) +* [`acce6de`](https://github.com/eslint/eslint/commit/acce6de940e2b089ff5ba59e4518a54af1682d5e) Fix: class-methods-use-this reports 'undefined' names (#12103) (Milos Djermanovic) +* [`92ec2cb`](https://github.com/eslint/eslint/commit/92ec2cb1731b7b6e0ac66336d583fbb782504290) Fix: Allow bind call with a single spread element in no-extra-bind (#12088) (Milos Djermanovic) +* [`bfdb0c9`](https://github.com/eslint/eslint/commit/bfdb0c97003fc0e045aa6ed10b177c35305a6e46) Fix: no-extra-boolean-cast invalid autofix for Boolean() without args (#12076) (Milos Djermanovic) +* [`34ccc0c`](https://github.com/eslint/eslint/commit/34ccc0cd81f495190e585c6efa8ae233d45bd3ed) Chore: Remove TDZ scope type condition from no-unused-vars (#12055) (Milos Djermanovic) +* [`01d38ce`](https://github.com/eslint/eslint/commit/01d38ce2faf0abbc9dd5d25694baeee131036165) Docs: Remove TDZ scope from the scope manager interface documentation (#12054) (Milos Djermanovic) +* [`1aff8fc`](https://github.com/eslint/eslint/commit/1aff8fc4f9394cd9126654a55f7f3a43ab1cf8f0) Update: warn about mixing ternary and logical operators (fixes #11704) (#12001) (Karthik Priyadarshan) +* [`11be2f8`](https://github.com/eslint/eslint/commit/11be2f8513bd61499f6247392a33ac0a26901c90) Docs: do not recommend global-installed usage (#12016) (薛定谔的猫) +* [`cf31dab`](https://github.com/eslint/eslint/commit/cf31dab5d5982151e0cfcc32879e69a83180ec70) Fix: no-restricted-syntax - correct the schema (#12051) (Brad Zacher) +* [`fbec99e`](https://github.com/eslint/eslint/commit/fbec99ea3e39316791685652c66e522d698f52d8) Update: fix class-methods-use-this false negatives with exceptMethods (#12077) (Milos Djermanovic) +* [`fb08b7c`](https://github.com/eslint/eslint/commit/fb08b7c9d28bc68864eb940e26df274059228b6a) Docs: Remove readonly/writable global logic from no-undef (fixes #11963) (#12053) (Milos Djermanovic) +* [`5b5934b`](https://github.com/eslint/eslint/commit/5b5934b9513f9114f5bf8e12ff4f4981590d64d3) Sponsors: Sync README with website (ESLint Jenkins) +* [`9156760`](https://github.com/eslint/eslint/commit/915676022a100ae5dba788fa3329d34b3c1f18d3) Sponsors: Sync README with website (ESLint Jenkins) +* [`f5e0cc4`](https://github.com/eslint/eslint/commit/f5e0cc40795f175692acb05daaadb91e9e5ae5d3) Update: Check computed method keys in no-extra-parens (#11973) (Milos Djermanovic) +* [`d961438`](https://github.com/eslint/eslint/commit/d9614388df8cfb977842ed7ac4725d76a3e05df3) Docs: Fix Incorrect Documentation (#12045) (Michael Miceli) +* [`887d08c`](https://github.com/eslint/eslint/commit/887d08c244e32f1fc18359e63380e2cdb0cb3797) Sponsors: Sync README with website (ESLint Jenkins) +* [`d90183f`](https://github.com/eslint/eslint/commit/d90183ff6757cff854f4ca4d25b835143dfb4b21) Docs: add a case to func-names (#12038) (Chiawen Chen) +* [`8a5b62d`](https://github.com/eslint/eslint/commit/8a5b62de2ae574f416c0f8ad91205da9b1837275) Docs: no use eslint.linter in code example (#12037) (薛定谔的猫) +* [`5831767`](https://github.com/eslint/eslint/commit/58317673210e48be3975e317c2c566fae155c94f) Update: report location of func-names (fixes #12022) (#12028) (Pig Fang) + +v6.1.0 - July 20, 2019 + +* [`8f86cca`](https://github.com/eslint/eslint/commit/8f86ccaa89daf10123370868c5dcb48c1fcbef7d) Upgrade: eslint-scope@^5.0.0 (#12011) (Kevin Partington) +* [`d08683e`](https://github.com/eslint/eslint/commit/d08683e3c807f92daf266894093c70f8d5ac6afa) Fix: glob processing (fixes #11940) (#11986) (Toru Nagashima) +* [`bfcf8b2`](https://github.com/eslint/eslint/commit/bfcf8b21011466b570b536ca31ec10fd228b3dca) Fix: dot-location errors with parenthesized objects (fixes #11868) (#11933) (Milos Djermanovic) +* [`79e8d09`](https://github.com/eslint/eslint/commit/79e8d099bbbebfa4d804484eeeeea9c074ede870) Fix: add parens for sequence expr in arrow-body-style (fixes #11917) (#11918) (Pig Fang) +* [`105c098`](https://github.com/eslint/eslint/commit/105c098f3cece8b83ab8d1566b8ea41dd94a60b9) Docs: update docs for object-curly-spacing (fixes #11634) (#12009) (Chiawen Chen) +* [`c90a12c`](https://github.com/eslint/eslint/commit/c90a12c283698befcafd2c86f8bd8942428fe80b) Chore: update release script for new website repo (#12006) (Kai Cataldo) +* [`e2c08a9`](https://github.com/eslint/eslint/commit/e2c08a9c8d86238955ecc8fd5a626584ee91eba5) Sponsors: Sync README with website (ESLint Jenkins) +* [`b974fcb`](https://github.com/eslint/eslint/commit/b974fcbd3321ab382a914520018d4c051b2e5c62) Update: Check computed property keys in no-extra-parens (#11952) (Milos Djermanovic) +* [`222d27c`](https://github.com/eslint/eslint/commit/222d27c32a6d6d8828233b3b99e93ecefa94c603) Update: Add for-in and for-of checks for props in no-param-reassign (#11941) (Milos Djermanovic) +* [`e4c450f`](https://github.com/eslint/eslint/commit/e4c450febc9bd77b33f6473667afa9f955be6b71) Fix: no-extra-parens autofix with `in` in a for-loop init (fixes #11706) (#11848) (Milos Djermanovic) +* [`2dafe2d`](https://github.com/eslint/eslint/commit/2dafe2d288d1e0d353bb938d12a5da888091cfdb) Fix: prefer-const produces invalid autofix (fixes #11699) (#11827) (Milos Djermanovic) +* [`cb475fd`](https://github.com/eslint/eslint/commit/cb475fd8c0bbfcb00340459966b6780f39ea87a7) Fix: Cache file error handling on read-only file system. (fixes #11945) (#11946) (Cuki) +* [`89412c3`](https://github.com/eslint/eslint/commit/89412c3cbc52e556dba590fa94e10bf40faf1fdf) Docs: Fixed a typo (fixes #11999) (#12000) (Eddie Olson) +* [`6669f78`](https://github.com/eslint/eslint/commit/6669f78a3dd305aef6191e7eea24fae2ae4fd2e8) Fix: --init with Vue.js failed (fixes #11970) (#11985) (Toru Nagashima) +* [`93633c2`](https://github.com/eslint/eslint/commit/93633c2b3716b17816bcb3dc221c49b75db41317) Upgrade: Upgrade lodash dependency (fixes #11992) (#11994) (Cyd La Luz) +* [`776dae7`](https://github.com/eslint/eslint/commit/776dae71f2f5c7b5f0650ea3c277eca26e324e41) Docs: fix wrong Node.js version in getting started (#11993) (Toru Nagashima) +* [`4448261`](https://github.com/eslint/eslint/commit/4448261f5d217d8a06eb0ef898401928b54a34e3) Docs: some typos and optimization points (#11960) (Jason Lee) +* [`2a10856`](https://github.com/eslint/eslint/commit/2a10856d1ed5880a09a5ba452bd80d49c1be4e6c) Chore: Add temporary test files to .gitignore (#11978) (Milos Djermanovic) +* [`d83b233`](https://github.com/eslint/eslint/commit/d83b23382de3b80056a7e6330ed5846316c94147) Chore: update path for release bundles (#11977) (Kai Cataldo) +* [`1fb3620`](https://github.com/eslint/eslint/commit/1fb362093a65b99456a11029967d9ee0c31fd697) Fix: creating of enabledGlobals object without prototype (fixes #11929) (#11935) (finico) +* [`c2f2db9`](https://github.com/eslint/eslint/commit/c2f2db97c6d6a415b78ee7b3e8924853d465e757) Docs: Replace global true and false with writable and readonly in rules (#11956) (Milos Djermanovic) +* [`19335b8`](https://github.com/eslint/eslint/commit/19335b8f47029b2f742d5507ba39484eaf68d07b) Fix: actual messageId and expected messageId are switched in rule tester (#11928) (Milos Djermanovic) +* [`8b216e0`](https://github.com/eslint/eslint/commit/8b216e04fb0dd0a1a4d3730ebe4b24780020b09c) Docs: Fix incorrect example comments for unicode-bom rule (fixes #11937) (#11938) (Brandon Yeager) +* [`cc3885b`](https://github.com/eslint/eslint/commit/cc3885b028e29ebc575c900f43af81cb0dabffb6) Chore: add v8-compile-cache to speed up instantiation time (#11921) (薛定谔的猫) +* [`d8f2688`](https://github.com/eslint/eslint/commit/d8f26886f19a17f2e1cdcb91e2db84fc7ba3fdfb) Upgrade: deps (#11904) (薛定谔的猫) +* [`e5f1ccc`](https://github.com/eslint/eslint/commit/e5f1ccc9e2d07ad0acf149027ffc382021d54da1) Docs: add 'stricter rule config validating' in migrating docs (#11905) (薛定谔的猫) + +v6.0.1 - June 24, 2019 + +* [`b5bde06`](https://github.com/eslint/eslint/commit/b5bde0669bd6a7a6b8e38cdf204d8d4b932cea63) Fix: --rulesdir option didn't work (fixes #11888) (#11890) (Toru Nagashima) +* [`13f0418`](https://github.com/eslint/eslint/commit/13f041897ee31982808a57b4d06450b57c9b27dc) Fix: improve error message on --print-config (fixes #11874) (#11885) (Toru Nagashima) +* [`056c2aa`](https://github.com/eslint/eslint/commit/056c2aaf39a5f8d06de24f06946dda95032a0361) Fix: improve diagnostics for shareable-config-missing errors (#11880) (Teddy Katz) +* [`566b7aa`](https://github.com/eslint/eslint/commit/566b7aa5d61fb31cd47fe4da7820b07cf9bde1ec) Docs: Update no-confusing-arrow with the new default option (#11886) (Yuping Zuo) +* [`d07f3fa`](https://github.com/eslint/eslint/commit/d07f3fae19b901c30cf4998f10722cb3182bd237) Fix: CLIEngine#getRules() contains plugin rules (fixes #11871) (#11872) (Toru Nagashima) +* [`21f4a80`](https://github.com/eslint/eslint/commit/21f4a8057ccc941f72bb617ae3b5c135a774f6c0) Docs: Fix inconsistent linking in migration guide (#11881) (Teddy Katz) +* [`f3a0774`](https://github.com/eslint/eslint/commit/f3a0774a8879b08777a4aedc76677f13d5156242) Docs: Fix typo in 6.0.0 migration guide (#11870) (Kevin Partington) + +v6.0.0 - June 21, 2019 + +* [`81aa06b`](https://github.com/eslint/eslint/commit/81aa06b4cc49e9c15234a2c4d27659a03fea53d8) Upgrade: espree@6.0.0 (#11869) (Teddy Katz) +* [`5f022bc`](https://github.com/eslint/eslint/commit/5f022bc91d0d93d140876ceb1ee4e08b1b7cfd49) Fix: no-else-return autofix produces name collisions (fixes #11069) (#11867) (Milos Djermanovic) +* [`ded9548`](https://github.com/eslint/eslint/commit/ded9548d881b15e771ca79b844e8159601f30f70) Fix: multiline-comment-style incorrect message (#11864) (golopot) +* [`cad074d`](https://github.com/eslint/eslint/commit/cad074d4ddb34a59183b5965ca50170713b5a711) Docs: Add JSHint W047 compat to no-floating-decimal (#11861) (Timo Tijhof) +* [`41f6304`](https://github.com/eslint/eslint/commit/41f6304ce641a82ee729251b448dceb9fb0d501d) Upgrade: sinon (#11855) (Toru Nagashima) +* [`167ce87`](https://github.com/eslint/eslint/commit/167ce87e908ec04b0d3d79960278d45c883c4285) Chore: remove unuseable profile command (#11854) (Toru Nagashima) +* [`c844c6f`](https://github.com/eslint/eslint/commit/c844c6f2ff314cfa8c6ca0e35a1ef58b7e297b79) Fix: max-len properly ignore trailing comments (fixes #11838) (#11841) (ZYSzys) +* [`1b5661a`](https://github.com/eslint/eslint/commit/1b5661ae467c227c0239e06cc1466480004aa799) Fix: no-var should not fix variables named 'let' (fixes #11830) (#11832) (Milos Djermanovic) +* [`4d75956`](https://github.com/eslint/eslint/commit/4d75956147b6fd662ee90eb21d3f762816463b88) Build: CI with Azure Pipelines (#11845) (Toru Nagashima) +* [`1db3462`](https://github.com/eslint/eslint/commit/1db346220889305a427b45a00afcf362b81b3767) Chore: rm superfluous argument & fix perf-multifiles-targets (#11834) (薛定谔的猫) +* [`c57a4a4`](https://github.com/eslint/eslint/commit/c57a4a4a993193c4208c6419df331a7bc644a536) Upgrade: @babel/polyfill => core-js v3 (#11833) (薛定谔的猫) +* [`65faa04`](https://github.com/eslint/eslint/commit/65faa04e8b42eecd4505111bbff296951179f033) Docs: Clarify prefer-destructuring array/object difference (fixes #9970) (#11851) (Oliver Sieweke) +* [`81c3823`](https://github.com/eslint/eslint/commit/81c382378923a45015bafe58362f6c8faa5c3d5f) Fix: require-atomic-updates reports parameters (fixes #11723) (#11774) (Toru Nagashima) +* [`aef8ea1`](https://github.com/eslint/eslint/commit/aef8ea1a44b9f13d468f48536c4c93f79f201d9b) Sponsors: Sync README with website (ESLint Jenkins) + +v6.0.0-rc.0 - June 9, 2019 + +* [`f403b07`](https://github.com/eslint/eslint/commit/f403b07283f91f1285d8318d6acea851dd765755) Update: introduce minKeys option to sort-keys rule (fixes #11624) (#11625) (Christian) +* [`87451f4`](https://github.com/eslint/eslint/commit/87451f4779bc4c0ec874042b6854920f947ee258) Fix: no-octal should report NonOctalDecimalIntegerLiteral (fixes #11794) (#11805) (Milos Djermanovic) +* [`e4ab053`](https://github.com/eslint/eslint/commit/e4ab0531c4e44c23494c6a802aa2329d15ac90e5) Update: support "bigint" in valid-typeof rule (#11802) (Colin Ihrig) +* [`e0fafc8`](https://github.com/eslint/eslint/commit/e0fafc8ef59a80a6137f4170bbe46582d6fbcafc) Chore: removes unnecessary assignment in loop (#11780) (Dimitri Mitropoulos) +* [`20908a3`](https://github.com/eslint/eslint/commit/20908a38f489c285abf8fceef4d9d13bf8b87f22) Docs: removed '>' prefix from from docs/working-with-rules (#11818) (Alok Takshak) +* [`1c43eef`](https://github.com/eslint/eslint/commit/1c43eef605a9cf02a157881424ea62dcae747f69) Sponsors: Sync README with website (ESLint Jenkins) +* [`21f3131`](https://github.com/eslint/eslint/commit/21f3131aa1636afa8e5c01053e0e870f968425b1) Fix: `overrides` handle relative paths as expected (fixes #11577) (#11799) (Toru Nagashima) +* [`5509cdf`](https://github.com/eslint/eslint/commit/5509cdfa1b3d575248eef89a935f79c82e3f3071) Fix: fails the test case if autofix made syntax error (fixes #11615) (#11798) (Toru Nagashima) +* [`cb1922b`](https://github.com/eslint/eslint/commit/cb1922bdc07e58de0e55c13fd992dd8faf3292a4) Fix: show custom message for namespace import (fixes #11580) (#11791) (Pig Fang) +* [`37e5193`](https://github.com/eslint/eslint/commit/37e5193102d7544f155cdcb09c7c50dc602914d4) Update: add `endColumn` to no-useless-escape (fixes #11629) (#11790) (Pig Fang) +* [`ad4b048`](https://github.com/eslint/eslint/commit/ad4b048c6d034cbd7fd97deb4390d059bde8803f) Build: Fix typo in blog post template (fixes #11614) (#11782) (Kai Cataldo) +* [`9590587`](https://github.com/eslint/eslint/commit/9590587cef74c936ef9b7ce2d22a71e2fd0fbbc4) Update: improve reported location of arrow-parens (fixes #11773) (#11775) (Pig Fang) +* [`d662b17`](https://github.com/eslint/eslint/commit/d662b178c7dad193201564d16f7977af2f81ebcf) New: Add classname attribute to JUnit testcase (refs #11068) (#11683) (Fabio Pitino) +* [`8eaa9b2`](https://github.com/eslint/eslint/commit/8eaa9b259dc08dfb48269b1e4413d0d47698ed87) Chore: remove incorrect comment (#11769) (薛定谔的猫) +* [`4039a49`](https://github.com/eslint/eslint/commit/4039a49177f2fefacd747050b420c0c4560b7d4b) Chore: add .github/funding.yml (#11764) (Toru Nagashima) + +v6.0.0-alpha.2 - May 25, 2019 + +* [`9b87fee`](https://github.com/eslint/eslint/commit/9b87fee9dc7b1d99a50b924cb6b81255ebb5c4a2) Chore: Fix formatter documentation generation (#11767) (Ilya Volodin) +* [`f116208`](https://github.com/eslint/eslint/commit/f11620848733a3a6f58811d9bb2c3e748d6135ac) Chore: Fix site generation script for releases (#11766) (Ilya Volodin) +* [`cf9cce8`](https://github.com/eslint/eslint/commit/cf9cce81aa68e9bc23840530cb33f4c3f551fb1e) Update: Add never option for new-parens (refs #10034) (#11379) (pfgithub) +* [`b5fa149`](https://github.com/eslint/eslint/commit/b5fa1491d2371a721e4b5029e797ae98fd30fed2) New: multiple processors support (fixes #11035, fixes #11725) (#11552) (Toru Nagashima) +* [`2d32a9e`](https://github.com/eslint/eslint/commit/2d32a9e8dd10a5927576bd50d184876c775da4af) Breaking: stricter rule config validating (fixes #9505) (#11742) (薛定谔的猫) +* [`71716eb`](https://github.com/eslint/eslint/commit/71716eba3155266d777b994a38af524952e97696) Update: add fixer for no-div-regex rule (fixes #11355) (#11744) (joe-re) +* [`53f7f4c`](https://github.com/eslint/eslint/commit/53f7f4cf8d8b66a1911db56e4f72764388a21cc4) Update: Uniform messages for the rules in "complexity" section (#11759) (Igor Novozhilov) +* [`0a801d7`](https://github.com/eslint/eslint/commit/0a801d702dc41dae7eac0c802b822493ddc3ac41) Chore: improve perf test (#11756) (薛定谔的猫) +* [`45bd336`](https://github.com/eslint/eslint/commit/45bd336e647a6fa8a502488e5cbd27ba02712083) Docs: add about RuleTester's parser to migration guide (fixes #11728) (#11761) (Toru Nagashima) +* [`1374be4`](https://github.com/eslint/eslint/commit/1374be44f7ec4b8c913c52cc84debc4012c4f3ea) Docs: add table of contents in readme (#11765) (薛定谔的猫) +* [`54e6eda`](https://github.com/eslint/eslint/commit/54e6edaa2f881aab530fa14e63d92e5e0e2ca55c) New: extends in glob-based config (fixes #8813) (#11554) (Toru Nagashima) +* [`ec105b2`](https://github.com/eslint/eslint/commit/ec105b24f7e036ecdc4267f018529ac3765e29d5) Chore: typo in JSDoc on timing.display's return value (#11755) (Dimitri Mitropoulos) +* [`e45cc3f`](https://github.com/eslint/eslint/commit/e45cc3f3dc44f3a5b6b713a1bf5ce6e46d87ca49) Docs: updated no-proto rule (fixes #11743) (#11746) (Francesco Trotta) +* [`15c6c63`](https://github.com/eslint/eslint/commit/15c6c6374c0425d5402142d012a541fa208bc9da) Chore: eslint-config-eslint require node >= 8 (#11718) (薛定谔的猫) +* [`f9790ca`](https://github.com/eslint/eslint/commit/f9790ca1baec1275f3c946586766a5713258ac32) Fix: typo: missing word in docs (#11750) (Dimitri Mitropoulos) +* [`219aecb`](https://github.com/eslint/eslint/commit/219aecb78bc646d44bad27dc775a9b3d3dc58232) Chore: restructure files (#11555) (Toru Nagashima) +* [`5dad0b1`](https://github.com/eslint/eslint/commit/5dad0b1d80c9cf380c49f46266c35d461d3cecad) Fix: Unignoring directories in .eslintignore (fixes #11684) (#11685) (Mykola Bilochub) +* [`4625090`](https://github.com/eslint/eslint/commit/462509058e46770cf70307cf8dba279f0e73b967) Docs: small fix about the migration guide (#11729) (Toru Nagashima) +* [`0e89c73`](https://github.com/eslint/eslint/commit/0e89c73177398eaf978a50d5b0f79ff8e43512f2) Sponsors: Sync README with website (ESLint Jenkins) +* [`5a296fa`](https://github.com/eslint/eslint/commit/5a296fa0c9345ad1a55e2b257e5f6c9f05fff362) Sponsors: Sync README with website (ESLint Jenkins) +* [`7c8e86b`](https://github.com/eslint/eslint/commit/7c8e86bf2c900cec7cd1dfd529a8c77cc81ef34c) Fix: wrong 'plugin-missing' error on Node.js 12 (fixes #11720) (#11722) (Toru Nagashima) +* [`67c671f`](https://github.com/eslint/eslint/commit/67c671fdc1c8b08cb8d263a9bb2151e3108c88b4) Chore: ignore deprecated rules in fuzz tests (#11710) (Pig Fang) +* [`af81cb3`](https://github.com/eslint/eslint/commit/af81cb3ecc5e6bf43a6a2d8f326103350513a1b8) Chore: make fuzzer produce minimal reproducible examples of bugs (#11700) (Teddy Katz) + +v6.0.0-alpha.1 - May 10, 2019 + +* [`e84b6f8`](https://github.com/eslint/eslint/commit/e84b6f8b171ba4266164688f76d5ee45d278e5c2) Docs: fix example in object-curly-newline docs (#11633) (golopot) +* [`252efd3`](https://github.com/eslint/eslint/commit/252efd337b1441debb6d2cc8f51a625549b2c535) Fix: delete unnecessary duplicated question (fixes #11617) (#11618) (HelloRusk) +* [`21dd211`](https://github.com/eslint/eslint/commit/21dd2116c70b93aa8dd50d2b15e202724b11486a) New: add --resolve-plugins-relative-to flag (#11696) (Teddy Katz) +* [`1a3a88d`](https://github.com/eslint/eslint/commit/1a3a88df2f952c34631d8e1d83de47178826fce0) Fix: Curly rule incorrectly flagging lexical declarations (fixes #11663) (#11675) (Brian Kurek) +* [`f42d0af`](https://github.com/eslint/eslint/commit/f42d0afd89874b459fce1eb1998247d53f9aa42b) Chore: lazy loading for rules (#11705) (Toru Nagashima) +* [`f47d72c`](https://github.com/eslint/eslint/commit/f47d72ce2f2edb80cd38810894b9d4bda896bb29) Fix: not set ecmaVersion to 6 when sourceType=module (fixes #9687) (#11649) (薛定谔的猫) +* [`9484e9e`](https://github.com/eslint/eslint/commit/9484e9ea188ff70683c3112e397c7fddcc3f8095) Fix: ignore return statements in dead code (fixes #11647) (#11688) (Toru Nagashima) +* [`aae6f65`](https://github.com/eslint/eslint/commit/aae6f6525557ba06e73f051511646056313fcf91) Fix: don't use deprecated API (#11689) (Toru Nagashima) +* [`483239e`](https://github.com/eslint/eslint/commit/483239ec74a0c13529fc99547a784b749f41dd54) Docs: updated ImportDeclaration in docs-rules-indent (#11679) (Alok Takshak) +* [`f5bae78`](https://github.com/eslint/eslint/commit/f5bae78c19d5359f67969a2ff344025082e253f4) Chore: fix CLIEngine tests when os.tmpdir is a symlink (#11697) (Teddy Katz) +* [`e4400b5`](https://github.com/eslint/eslint/commit/e4400b5a02602bba7f67ea4cb874c231903c546a) Fix: require-atomic-updates false positive (fixes #11194, fixes #11687) (#11224) (Toru Nagashima) +* [`6ae21a4`](https://github.com/eslint/eslint/commit/6ae21a4bfe5a1566f787fbad798182a524b96d28) Breaking: fix config loading (fixes #11510, fixes #11559, fixes #11586) (#11546) (Toru Nagashima) +* [`bc0819c`](https://github.com/eslint/eslint/commit/bc0819c94aad14f7fad3cbc2338ea15658b0f272) Sponsors: Sync README with website (ESLint Jenkins) +* [`036a188`](https://github.com/eslint/eslint/commit/036a188143677384f720ff18071fc4206c54500b) Sponsors: Sync README with website (ESLint Jenkins) +* [`4b3b036`](https://github.com/eslint/eslint/commit/4b3b036d6240cdbc2d52e670de36b1117f5f34d7) Docs: replace `var` with `const` in code examples (#11655) (Niyaz Akhmetov) +* [`e4a08ba`](https://github.com/eslint/eslint/commit/e4a08bae82788136b6899262cb8b9ed4fe7964e6) Chore: update eslint-plugin-node to 9.0.0 (#11670) (Toru Nagashima) +* [`f2e7828`](https://github.com/eslint/eslint/commit/f2e78281d057f38b18cc160e81ed1bb54a5b9565) Docs: Fix Node 6 LTS EOL date (#11676) (James Ross) +* [`4052bfe`](https://github.com/eslint/eslint/commit/4052bfebb87850b901f2eb8687edfbe49c01d68f) Sponsors: Sync README with website (ESLint Jenkins) +* [`f6fc045`](https://github.com/eslint/eslint/commit/f6fc0450e749707bed44118c1205fb4e73e65628) Sponsors: Sync README with website (ESLint Jenkins) +* [`1ebf21b`](https://github.com/eslint/eslint/commit/1ebf21bc18769956366110bb62ff677639e633ae) Sponsors: Sync README with website (ESLint Jenkins) +* [`776b0fe`](https://github.com/eslint/eslint/commit/776b0fe3d93da958517ac7752682091f22eb30b4) Fix: update rule message of no-throw-literal (fixes #11637) (#11638) (Pig Fang) +* [`67c08b6`](https://github.com/eslint/eslint/commit/67c08b67509c54acd96aab2cec22efb53bfe6265) Fix: consider comments in object-curly-spacing (fixes #11656) (#11657) (Pig Fang) +* [`b6d41cb`](https://github.com/eslint/eslint/commit/b6d41cbe28a8b28b1c1d9aa36cb4c349c73f6f1d) Fix: check token before using in no-cond-assign (fixes #11611) (#11619) (Pig Fang) +* [`7f290a9`](https://github.com/eslint/eslint/commit/7f290a9044ca795884ac2e495cd31b2a35f109a6) Chore: add eslint as a devDependeny (#11654) (Toru Nagashima) +* [`139fd2f`](https://github.com/eslint/eslint/commit/139fd2f1254bcc524738f8c2645e0847df95e0d0) Chore: add markdownlint-cli (#11653) (Toru Nagashima) +* [`adc6585`](https://github.com/eslint/eslint/commit/adc6585ce074e03fc8a842e8ebc5b082a0ed0b65) Docs: update status of breaking changes in migration guide (#11652) (Teddy Katz) +* [`eef71e4`](https://github.com/eslint/eslint/commit/eef71e455e67040168c8df8a6c9c2b4fbe805a50) Docs: add missing items to migration guide (#11628) (Teddy Katz) +* [`0fc8e62`](https://github.com/eslint/eslint/commit/0fc8e62818bc8d0a0a804b59c6110818844df5f3) Breaking: eslint:recommended changes (fixes #10768) (#11518) (薛定谔的猫) +* [`1c34d4a`](https://github.com/eslint/eslint/commit/1c34d4a6313c399761281282fff3a1bbe5e17b6d) Sponsors: Sync README with website (ESLint Jenkins) +* [`33695e7`](https://github.com/eslint/eslint/commit/33695e7f7048306ac196eff6e5a16e165ad03090) Sponsors: Sync README with website (ESLint Jenkins) +* [`c94cf21`](https://github.com/eslint/eslint/commit/c94cf212d31513fde74e0ea88b79e5e0f89a18a4) Sponsors: Sync README with website (ESLint Jenkins) +* [`f62a451`](https://github.com/eslint/eslint/commit/f62a4510b007172c7160f007a6ec2aa2c9a80dd7) Build: add node 12 (#11648) (薛定谔的猫) +* [`20364cc`](https://github.com/eslint/eslint/commit/20364cc4f7fe0423adce0dd44fb24fc48e1cae4b) Breaking: make no-redeclare stricter (fixes #11370, fixes #11405) (#11509) (Toru Nagashima) +* [`ed675a6`](https://github.com/eslint/eslint/commit/ed675a6e5ac42898555c51a7cf771b79695ba591) Sponsors: Sync README with website (ESLint Jenkins) +* [`8b4dba6`](https://github.com/eslint/eslint/commit/8b4dba606f8306f8ad0a37e2174a6e3236f7ebe7) Chore: Add linting to git commit (#11556) (Nicholas C. Zakas) +* [`8684f46`](https://github.com/eslint/eslint/commit/8684f4646da33bfe81e8f7f8c2d1af8b31065564) Sponsors: Sync README with website (ESLint Jenkins) +* [`1bdacc9`](https://github.com/eslint/eslint/commit/1bdacc9b703158d5ca3563e4a9b67bb8453ac316) Sponsors: Sync README with website (ESLint Jenkins) +* [`e62c8af`](https://github.com/eslint/eslint/commit/e62c8af6a86e35dc05f30713faf87a18cc77714d) Sponsors: Sync README with website (ESLint Jenkins) +* [`1dfe077`](https://github.com/eslint/eslint/commit/1dfe077b7e47c6090277eb984e08bd472bb5595e) Fix: autofix of no-unneeded-ternary made syntax error (fixes #11579) (#11616) (Toru Nagashima) +* [`bebd079`](https://github.com/eslint/eslint/commit/bebd0793eaf122b013cca501ff2c6b0fc05d5493) Docs: fix grammar mistake in no-caller docs (#11623) (Daniel Lemay) +* [`f570be1`](https://github.com/eslint/eslint/commit/f570be17b339cb7622c512331b1653013279855a) Sponsors: Sync README with website (ESLint Jenkins) +* [`7c13a1c`](https://github.com/eslint/eslint/commit/7c13a1c144a6a7c99cd9338a24166da9f7439cd0) Sponsors: Sync README with website (ESLint Jenkins) +* [`b7bd432`](https://github.com/eslint/eslint/commit/b7bd432e1161feba8dbb81f62cf03cafad42c3d4) Sponsors: Sync README with website (ESLint Jenkins) +* [`412a76b`](https://github.com/eslint/eslint/commit/412a76b316e05ca85334c1d6bc6372df536da2db) Sponsors: Sync README with website (ESLint Jenkins) + +v6.0.0-alpha.0 - April 12, 2019 + +* [`3d9e137`](https://github.com/eslint/eslint/commit/3d9e1372aad1e174b5438e3d6bd75fdefba06bad) Chore: fix test that fails when the CWD contains a space (#11612) (Teddy Katz) +* [`8bfd1d1`](https://github.com/eslint/eslint/commit/8bfd1d138001d4493180b2fcff3330b42d0bb7cb) Docs: add v6.0.0 migration guide (#11515) (Teddy Katz) +* [`9e49b56`](https://github.com/eslint/eslint/commit/9e49b56c08fd0e449fddab45dfeb0da8d918b460) Breaking: upgrade espree to 6.0.0-alpha.0 (fixes #9687) (#11610) (Teddy Katz) +* [`0127d10`](https://github.com/eslint/eslint/commit/0127d107590acabfdea4a68b56acbeee6a7b9daa) Fix: no-var fixed to incorrect code (fixes #11441) (#11443) (薛定谔的猫) +* [`5cfdc2d`](https://github.com/eslint/eslint/commit/5cfdc2d08307c63bec487e76d2f470ef84166867) Update: Improve no-loop-func rule description and message (#11046) (Pedro Lopes) +* [`608a02c`](https://github.com/eslint/eslint/commit/608a02c60656b96c3219d342eee7e98b55bdd580) Fix: object-shorthand ignoreConstructors option (fixes #11595) (#11596) (overlookmotel) +* [`eeea893`](https://github.com/eslint/eslint/commit/eeea89361d48494995446ddb6ee6f049457911ec) Upgrade: update js-yaml package to 3.13.1 version (#11607) (Pobegaylo Maksim) +* [`e70d5f7`](https://github.com/eslint/eslint/commit/e70d5f7573a9641d7b63394df53a3ef86183445c) Upgrade: compatible deps (#11608) (薛定谔的猫) +* [`a55913d`](https://github.com/eslint/eslint/commit/a55913d6c6fd1a7c684b8b4d7ab380cf7dc83eb8) Sponsors: Sync README with website (ESLint Jenkins) +* [`9a6e8fe`](https://github.com/eslint/eslint/commit/9a6e8fe4b025d52275f7ad2959361587f476cc58) Sponsors: Sync README with website (ESLint Jenkins) +* [`cbdee62`](https://github.com/eslint/eslint/commit/cbdee6230d22522c37259449467ace16f28ea8e8) Docs: README updates to reflect JSCS compat project is finished (#11568) (Kevin Partington) +* [`b92ca6e`](https://github.com/eslint/eslint/commit/b92ca6ea8ae46b92c258921e8b5b40f5035dbc43) Fix: getErrorResults function to not mutate passed parameter (#11592) (danielamaia) +* [`ef7801e`](https://github.com/eslint/eslint/commit/ef7801ea510e12a9ca4963bcc8ec7e3aacc75ff0) Breaking: disallow invalid rule defaults in RuleTester (fixes #11473) (#11599) (Teddy Katz) +* [`c021117`](https://github.com/eslint/eslint/commit/c021117915d5d23399233f761a237e138f1854af) Sponsors: Sync README with website (ESLint Jenkins) +* [`4e7cdca`](https://github.com/eslint/eslint/commit/4e7cdca571632a3f3c32b39eb03022fe88ca8b30) Breaking: comma-dangle enable functions: "never" (fixes #11502) (#11519) (薛定谔的猫) +* [`12f256f`](https://github.com/eslint/eslint/commit/12f256f22534c4a4e1ca0ba54c37c6db81441461) Breaking: no-confusing-arrow enable allowParens: true (fixes #11503) (#11520) (薛定谔的猫) +* [`25cc63d`](https://github.com/eslint/eslint/commit/25cc63d47e6c0aea8b88589a088c1f0de5f6f1cc) Breaking: simplify config/plugin/parser resolution (fixes #10125) (#11388) (Teddy Katz) +* [`63fead8`](https://github.com/eslint/eslint/commit/63fead86f8cf4e6b33d5424fb7db1e76a66d4cce) Sponsors: Sync README with website (ESLint Jenkins) +* [`595de40`](https://github.com/eslint/eslint/commit/595de4074fac1b5839f56b29fe0106a7fda7e3e0) Docs: edit arrow-parens as-needed explanation (fixes #11202) (#11569) (Logan Lowder) +* [`3396c3e`](https://github.com/eslint/eslint/commit/3396c3e2231b5b6e16da8751c22c86c256590f6b) Upgrade: karma@^4.0.1, drops Node 6 support, fixes vulnerability (#11570) (Kevin Partington) +* [`2f8ae13`](https://github.com/eslint/eslint/commit/2f8ae1397eef3625fe66636e95b0b312c6ff8a37) Update: support single argument on newline with function-paren-newline (#11406) (Vladlen Grachev) +* [`fd1c91b`](https://github.com/eslint/eslint/commit/fd1c91b00e8d8c3a83d21e60668d5f1fa61cb214) Breaking: throw an error for invalid global configs (refs #11338) (#11517) (Teddy Katz) +* [`be83322`](https://github.com/eslint/eslint/commit/be833229b355eafb90f3e0bbc29bb106e100bed0) Breaking: Remove extra rules from eslint:recommended (fixes #10873) (#11357) (Kevin Partington) +* [`2543f11`](https://github.com/eslint/eslint/commit/2543f11dfe8069ed5096073169cf6791d42454db) Breaking: remove deprecated experimentalObjectRestSpread option (#11420) (Teddy Katz) +* [`19248e0`](https://github.com/eslint/eslint/commit/19248e0838425748d75518fe9f0a985587793378) Fix: make `overrides[].files` matching dotfiles (fixes #11201) (#11225) (Toru Nagashima) +* [`0fb5fd4`](https://github.com/eslint/eslint/commit/0fb5fd402334098dc44cbfbb8ab25919da04843d) Breaking: interpret rule options as unicode regexes (fixes #11423) (#11516) (Teddy Katz) +* [`6e7da57`](https://github.com/eslint/eslint/commit/6e7da57dddc41830df4aee77e31c4320c1557350) Breaking: drop Node.js 6 support (fixes #11456) (#11557) (Toru Nagashima) +* [`a73b4b8`](https://github.com/eslint/eslint/commit/a73b4b8d6398b00bdaf90599d9e6d1c80f000f88) Docs: Update README team and sponsors (ESLint Jenkins) + +v5.16.0 - March 29, 2019 + +* [`dfef227`](https://github.com/eslint/eslint/commit/dfef227091955a2f8f3fa8c76ad79de8a77e7955) Build: gensite passes rulesMeta to formatter rendering (#11567) (Kevin Partington) +* [`c06d38c`](https://github.com/eslint/eslint/commit/c06d38c81bd9203c904587396a65d3c8cc7f2944) Fix: Allow HTML formatter to handle no meta data (#11566) (Ilya Volodin) +* [`87a5c03`](https://github.com/eslint/eslint/commit/87a5c034977cf4538ff3539d2f8776a987c5942a) Docs: `func-style`: clarify when `allowArrowFunctions` is used (#11548) (Oliver Joseph Ash) +* [`bc3e427`](https://github.com/eslint/eslint/commit/bc3e427ee8875c53eac6b6762884b50074f1adfc) Update: pass rule meta to formatters RFC 10 (#11551) (Chris Meyer) +* [`b452f27`](https://github.com/eslint/eslint/commit/b452f270bc0b523d88d5d827c95be3096f82e99d) Chore: Update README to pull in reviewer data (#11506) (Nicholas C. Zakas) +* [`afe3d25`](https://github.com/eslint/eslint/commit/afe3d25f8afb88caee43f7202d0eb96f33a92a6b) Upgrade: Bump js-yaml dependency to fix Denial of Service vulnerability (#11550) (Vernon de Goede) +* [`4fe7eb7`](https://github.com/eslint/eslint/commit/4fe7eb7cecdc2395cf1eeaa20921bda8460b00c2) Chore: use nyc instead of istanbul (#11532) (Toru Nagashima) +* [`f16af43`](https://github.com/eslint/eslint/commit/f16af439694aab473c647d8fae47c402bd489447) Chore: fix formatters/table test (#11534) (Toru Nagashima) +* [`78358a8`](https://github.com/eslint/eslint/commit/78358a8f66e95c4fcc921f2497e8a5ec5f1537ec) Docs: fix duplicate punctuation in CLI docs (#11528) (Teddy Katz) + +v5.15.3 - March 18, 2019 + +* [`71adc66`](https://github.com/eslint/eslint/commit/71adc665b9649b173adc76f80723b8de20664ae1) Fix: avoid moving comments in implicit-arrow-linebreak (fixes #11521) (#11522) (Teddy Katz) +* [`1f715a2`](https://github.com/eslint/eslint/commit/1f715a20c145d8ccc38f3310afccd838495d09d4) Chore: make test-case-property-ordering reasonable (#11511) (Toru Nagashima) + +v5.15.2 - March 15, 2019 + +* [`29dbca7`](https://github.com/eslint/eslint/commit/29dbca73d762a809adb2f457b527e144426d54a7) Fix: implicit-arrow-linebreak adds extra characters (fixes #11268) (#11407) (Mark de Dios) +* [`5d2083f`](https://github.com/eslint/eslint/commit/5d2083fa3e14c024197f6c386ff72237a145e258) Upgrade: eslint-scope@4.0.3 (#11513) (Teddy Katz) +* [`a5dae7c`](https://github.com/eslint/eslint/commit/a5dae7c3d30231c2f5f075d98c2c8825899bab16) Fix: Empty glob pattern incorrectly expands to "/**" (#11476) (Ben Chauvette) +* [`448e8da`](https://github.com/eslint/eslint/commit/448e8da94d09b397e98ffcb6f22b55a578ef79c1) Chore: improve crash reporting (fixes #11304) (#11463) (Alex Zherdev) +* [`0f56dc6`](https://github.com/eslint/eslint/commit/0f56dc6d9eadad05dc3d5c9d1d9ddef94e10c5d3) Chore: make config validator params more consistent (#11435) (薛定谔的猫) +* [`d6c1122`](https://github.com/eslint/eslint/commit/d6c112289f0f16ade070865c8786831b7940ca79) Docs: Add working groups to maintainer guide (#11400) (Nicholas C. Zakas) +* [`5fdb4d3`](https://github.com/eslint/eslint/commit/5fdb4d3fb01b9d8a4c2dff71ed9cddb2f8feefb0) Build: compile deps to ES5 when generating browser file (fixes #11504) (#11505) (Teddy Katz) +* [`06fa165`](https://github.com/eslint/eslint/commit/06fa1655c3da8394ed9144d727115fc434b0416f) Build: update CI testing configuration (#11500) (Reece Dunham) +* [`956e883`](https://github.com/eslint/eslint/commit/956e883c21fd9f393bf6718d032a4e2e53b33f22) Docs: Fix example in no-restricted-modules docs (#11454) (Paul O’Shannessy) +* [`2c7431d`](https://github.com/eslint/eslint/commit/2c7431d6b32063f74e3837ee727f26af215eada7) Docs: fix json schema example dead link (#11498) (kazuya kawaguchi) +* [`e7266c2`](https://github.com/eslint/eslint/commit/e7266c2478aff5d66e7859313feb49e3a129f85e) Docs: Fix invalid JSON in "Specifying Parser Options" (#11492) (Mihira Jayasekera) +* [`6693161`](https://github.com/eslint/eslint/commit/6693161978a83e0730d5ea0fecdb627c5a2acdfd) Sponsors: Sync README with website (ESLint Jenkins) +* [`62fee4a`](https://github.com/eslint/eslint/commit/62fee4a976897d158c8c137339728cd280333286) Chore: eslint-config-eslint enable comma-dangle functions: "never" (#11434) (薛定谔的猫) +* [`34a5382`](https://github.com/eslint/eslint/commit/34a53829e7a63ff2f6b371d77ce283bbdd373b91) Build: copy bundled espree to website directory (#11478) (Pig Fang) +* [`f078f9a`](https://github.com/eslint/eslint/commit/f078f9a9e094ec00c61a6ef1c9550d017631e69a) Chore: use "file:" dependencies for internal rules/config (#11465) (Teddy Katz) +* [`0756128`](https://github.com/eslint/eslint/commit/075612871f85aa04cef8137bd32247e128ad600b) Docs: Add `visualstudio` to formatter list (#11480) (Patrick Eriksson) +* [`44de9d7`](https://github.com/eslint/eslint/commit/44de9d7e1aa2fcae475a97b8f597b7d8094566b2) Docs: Fix typo in func-name-matching rule docs (#11484) (Iulian Onofrei) + +v5.15.1 - March 4, 2019 + +* [`fe1a892`](https://github.com/eslint/eslint/commit/fe1a892f85b09c3d2fea05bef011530a678a6af5) Build: bundle espree (fixes eslint/eslint.github.io#546) (#11467) (薛定谔的猫) +* [`458053b`](https://github.com/eslint/eslint/commit/458053b0b541f857bf233dacbde5ba80681820f8) Fix: avoid creating invalid regex in no-warning-comments (fixes #11471) (#11472) (Teddy Katz) + +v5.15.0 - March 1, 2019 + +* [`4088c6c`](https://github.com/eslint/eslint/commit/4088c6c9d4578cd581ce8ff4385d90b58a75b755) Build: Remove path.resolve in webpack build (#11462) (Kevin Partington) +* [`ec59ec0`](https://github.com/eslint/eslint/commit/ec59ec09c8d001b8c04f9edc09994e2b0d0af0f9) New: add rule "prefer-named-capture-group" (fixes #11381) (#11392) (Pig Fang) +* [`a44f750`](https://github.com/eslint/eslint/commit/a44f75073306e5ea4e6722654009a99884fbca4f) Upgrade: eslint-scope@4.0.2 (#11461) (Teddy Katz) +* [`d3ce611`](https://github.com/eslint/eslint/commit/d3ce611e1c705440ccbcae357f2194134d026541) Sponsors: Sync README with website (ESLint Jenkins) +* [`ee88475`](https://github.com/eslint/eslint/commit/ee884754e4111e11994ff0df3f0c29e43e1dc3f2) Chore: add utils for rule tests (#11453) (薛定谔的猫) +* [`d4824e4`](https://github.com/eslint/eslint/commit/d4824e46d7a6ca1618454d3c6198403382108123) Sponsors: Sync README with website (ESLint Jenkins) +* [`6489518`](https://github.com/eslint/eslint/commit/64895185bde5233223648bcaf46f8deb72c9fb55) Fix: no-extra-parens crash when code is "((let))" (#11444) (Teddy Katz) +* [`9d20de2`](https://github.com/eslint/eslint/commit/9d20de2b0ac756bd62888119b8e08c7441d8a5aa) Sponsors: Sync README with website (ESLint Jenkins) +* [`3f14de4`](https://github.com/eslint/eslint/commit/3f14de458ba120e9c013f5fc7c6fe3e9b40c1460) Sponsors: Sync README with website (ESLint Jenkins) +* [`3d6c770`](https://github.com/eslint/eslint/commit/3d6c7709d47e047b25d91ca1a77d6dab92313061) Sponsors: Sync README with website (ESLint Jenkins) +* [`de5cbc5`](https://github.com/eslint/eslint/commit/de5cbc526b30405e742b35d85d04361529d49ed4) Update: remove invalid defaults from core rules (fixes #11415) (#11427) (Teddy Katz) +* [`eb0650b`](https://github.com/eslint/eslint/commit/eb0650ba20cf9f9ad78dbaccfeb7e0e7ab56e31d) Build: fix linting errors on master (#11428) (Teddy Katz) +* [`5018378`](https://github.com/eslint/eslint/commit/5018378131fd5190bbccca902c0cf4276ee1581a) Chore: enable require-unicode-regexp on ESLint codebase (#11422) (Teddy Katz) +* [`f6ba633`](https://github.com/eslint/eslint/commit/f6ba633f56eca6be20fc4b0d9496a78b9498d578) Chore: lint all files in the repo at the same time (#11425) (Teddy Katz) +* [`8f3d717`](https://github.com/eslint/eslint/commit/8f3d71754932669332ad7623bcc4c1aef3897125) Docs: Add non-attending TSC member info (#11411) (Nicholas C. Zakas) +* [`ce0777d`](https://github.com/eslint/eslint/commit/ce0777da5bc167fe0c529158fd8216d3eaf11565) Docs: use more common spelling (#11417) (薛定谔的猫) +* [`b9aabe3`](https://github.com/eslint/eslint/commit/b9aabe34311f6189b87c9d8a1aa40f3513fed773) Chore: run fuzzer along with unit tests (#11404) (Teddy Katz) +* [`db0c5e2`](https://github.com/eslint/eslint/commit/db0c5e2a7f894b7cda71007b0ba43d7814b3fb2e) Build: switch from browserify to webpack (fixes #11366) (#11398) (Pig Fang) + +v5.14.1 - February 18, 2019 + +* [`1d6e639`](https://github.com/eslint/eslint/commit/1d6e63930073e79e52890f552cc6e9a0646b7fb4) Fix: sort-keys throws Error at SpreadElement (fixes #11402) (#11403) (Krist Wongsuphasawat) + +v5.14.0 - February 15, 2019 + +* [`85a04b3`](https://github.com/eslint/eslint/commit/85a04b319e6dfde1458174cd1d8c9e7d33da0871) Fix: adds conditional for separateRequires in one-var (fixes #10179) (#10980) (Scott Stern) +* [`0c02932`](https://github.com/eslint/eslint/commit/0c02932f1b2e2a85809e84617efa1b8836c19cfb) Upgrade: espree@5.0.1 (#11401) (Ilya Volodin) +* [`104ae88`](https://github.com/eslint/eslint/commit/104ae881d0b21e9c64e006b2a2c21535cef0ad28) Docs: Update governance doc with reviewers status (#11399) (Nicholas C. Zakas) +* [`ab8ac6a`](https://github.com/eslint/eslint/commit/ab8ac6adaaf7a88e160899e7f438a4cfd655eb6e) Fix: Support boundary spread elements in sort-keys (#11158) (Jakub Rożek) +* [`a23d197`](https://github.com/eslint/eslint/commit/a23d1975d48841eafdead1a1357e2af842f688bc) New: add allowSingleLineBlocks opt. to padded-blocks rule (fixes #7145) (#11243) (richie3366) +* [`e25e7aa`](https://github.com/eslint/eslint/commit/e25e7aa3ea1e8c9b3cd3242acda6d4a5572c2c6a) Fix: comma-spacing ignore comma before closing paren (fixes #11295) (#11374) (Pig Fang) +* [`a1f7c44`](https://github.com/eslint/eslint/commit/a1f7c44ea9efbd9393889c1cc91b74260e0a8e02) Docs: fix space-before-blocks correct code for "classes": "never" (#11391) (PoziWorld) +* [`14f58a2`](https://github.com/eslint/eslint/commit/14f58a2bec4d6aade0de22771c378b86b1e51959) Docs: fix grammar in object-curly-spacing docs (#11389) (PoziWorld) +* [`d3e9a27`](https://github.com/eslint/eslint/commit/d3e9a27bbba30008a610df59e82b7192f0ecc3a3) Docs: fix grammar in “those who says” (#11390) (PoziWorld) +* [`ea8e804`](https://github.com/eslint/eslint/commit/ea8e8045ba0e6c1e1015104346af962f3e16fd81) Docs: Add note about support for object spread (fixes #11136) (#11395) (Steven Thomas) +* [`95aa3fd`](https://github.com/eslint/eslint/commit/95aa3fdb392d265e6c3d813d54076458e88e7ad8) Docs: Update README team and sponsors (ESLint Jenkins) +* [`51c4972`](https://github.com/eslint/eslint/commit/51c497298a15ad296a2b1f8fc397df687976b836) Update: Behavior of --init (fixes #11105) (#11332) (Nicholas C. Zakas) +* [`ad7a380`](https://github.com/eslint/eslint/commit/ad7a38097c32a91e5a831ef1bc8933601532576c) Docs: Update README team and sponsors (ESLint Jenkins) +* [`550de1e`](https://github.com/eslint/eslint/commit/550de1e611a1e9af873bcb18d74cf2056e8d2e1b) Update: use `default` keyword in JSON schema (fixes #9929) (#11288) (Pig Fang) +* [`983c520`](https://github.com/eslint/eslint/commit/983c5201210d7a4ffab0b3d05ab9919c0754e5ca) Update: Use 'readonly' and 'writable' for globals (fixes #11359) (#11384) (Nicholas C. Zakas) +* [`f1d3a7e`](https://github.com/eslint/eslint/commit/f1d3a7ee7c82365989e219b1dae379f08f6dd526) Upgrade: some deps (fixes #11372) (#11373) (薛定谔的猫) +* [`3e0c417`](https://github.com/eslint/eslint/commit/3e0c4176eff085498b813f8ba1732d7ed6ee44f8) Docs: Fix grammar in “there’s nothing prevent you” (#11385) (PoziWorld) +* [`de988bc`](https://github.com/eslint/eslint/commit/de988bc909b491366ad0cd9bc83f4d6de42d041a) Docs: Fix grammar: Spacing improve -> Spacing improves (#11386) (PoziWorld) +* [`1309dfd`](https://github.com/eslint/eslint/commit/1309dfdebb5595460b79dcac20df6a1f109e7566) Revert "Build: fix test failure on Node 11 (#11100)" (#11375) (薛定谔的猫) +* [`1e56897`](https://github.com/eslint/eslint/commit/1e56897db3e254e0aef6d2fe3274157fc379c79e) Docs: “the function actually use”: use -> uses (#11380) (PoziWorld) +* [`5a71bc9`](https://github.com/eslint/eslint/commit/5a71bc95a7e961b1b1b77022645e0bd9cdd08dc0) Docs: Update README team and sponsors (ESLint Jenkins) +* [`82a58ce`](https://github.com/eslint/eslint/commit/82a58ce26b282fd80335b3ac4fc88f21266c3ba1) Docs: Update README team and sponsors (ESLint Jenkins) +* [`546d355`](https://github.com/eslint/eslint/commit/546d355ace65631e27de859baea3ffcc50e0ad2c) Docs: Update README with latest sponsors/team data (#11378) (Nicholas C. Zakas) +* [`c0df9fe`](https://github.com/eslint/eslint/commit/c0df9febb7c7e045ababc10b88dbcbb3f28c724c) Docs: `...` is not an operator (#11232) (Felix Kling) +* [`7ecfdef`](https://github.com/eslint/eslint/commit/7ecfdefaeadb772f8b96ffe37c4a2c97fde0da16) Docs: update typescript parser (refs #11368) (#11369) (薛定谔的猫) +* [`3c90dd7`](https://github.com/eslint/eslint/commit/3c90dd7e25cf97833deddb11cfbc107a5663ac08) Update: remove prefer-spread autofix (fixes #11330) (#11365) (薛定谔的猫) +* [`5eb3121`](https://github.com/eslint/eslint/commit/5eb3121b82c1837da0c3021b7d9384bb30832e36) Update: add fixer for `prefer-destructuring` (fixes #11151) (#11301) (golopot) +* [`173eb38`](https://github.com/eslint/eslint/commit/173eb38cdb3e4673cba947521f27158828186d77) Docs: Clarify ecmaVersion doesn't imply globals (refs #9812) (#11364) (Keith Maxwell) +* [`84ce72f`](https://github.com/eslint/eslint/commit/84ce72fdeba082b7b132e4ac6b714fb1a93831b7) Fix: Remove extraneous linefeeds in `one-var` fixer (fixes #10741) (#10955) (st-sloth) +* [`389362a`](https://github.com/eslint/eslint/commit/389362a06ac6601512b872d3e843c7371f2a1bcc) Docs: clarify motivation for no-prototype-builtins (#11356) (Teddy Katz) +* [`533d240`](https://github.com/eslint/eslint/commit/533d240b0811f663494cb213b06cc9e51e1ff2d0) Update: no-shadow-restricted-names lets unassigned vars shadow undefined (#11341) (Teddy Katz) +* [`d0e823a`](https://github.com/eslint/eslint/commit/d0e823aef196a6564c87a78b72c1ef980ce67af9) Update: Make --init run js config files through linter (fixes #9947) (#11337) (Brian Kurek) +* [`92fc2f4`](https://github.com/eslint/eslint/commit/92fc2f4f3faf8aeaae8a8e71db0de405404fb6c3) Fix: CircularJSON dependency warning (fixes #11052) (#11314) (Terry) +* [`4dd19a3`](https://github.com/eslint/eslint/commit/4dd19a3c4c037adc860a65e96f2ba3eeccace1de) Docs: mention 'prefer-spread' in docs of 'no-useless-call' (#11348) (Klaus Meinhardt) +* [`4fd83d5`](https://github.com/eslint/eslint/commit/4fd83d5ec47a6a7b81cd8801c3bd63d27ea1c7c4) Docs: fix a misleading example in one-var (#11350) (薛定谔的猫) +* [`9441ce7`](https://github.com/eslint/eslint/commit/9441ce77b7228f2c4562e158a10905afe11f31f2) Chore: update incorrect tests to fix build failing (#11354) (薛定谔的猫) + +v5.13.0 - February 1, 2019 + +* [`91c8884`](https://github.com/eslint/eslint/commit/91c8884971f5e57f5f7490d8daf92c4a9a489836) Chore: use local function to append "s" instead of a package (#11293) (Timo Tijhof) +* [`b5143bf`](https://github.com/eslint/eslint/commit/b5143bfc09e53d8da8f63421ade093b7593f4f51) Update: for-direction detection false positives/negatives (#11254) (Ruben Bridgewater) +* [`9005e63`](https://github.com/eslint/eslint/commit/9005e632d13476880c55f7e3c8a6e450762a5171) Chore: increase camelcase test coverage (#11299) (Redmond Tran) +* [`5b14ad1`](https://github.com/eslint/eslint/commit/5b14ad1003c7df9a37621dea55c6d6d0484adc05) Fix: false positive in no-constant-condition (fixes #11306) (#11308) (Pig Fang) +* [`6567c4f`](https://github.com/eslint/eslint/commit/6567c4f6665df85c3347388b29d8193cc8208d63) Fix: only remove arrow before body in object-shorthand (fixes #11305) (#11307) (Pig Fang) +* [`fa2f370`](https://github.com/eslint/eslint/commit/fa2f370affa4814dbdda278f9859d0172d4b7aa2) Docs: update rule configuration values in examples (#11323) (Kai Cataldo) +* [`0a3c3ff`](https://github.com/eslint/eslint/commit/0a3c3ff1d91e8f39943efc4a7d2bf6927d68d37e) New: Allow globals to be disabled/configured with strings (fixes #9940) (#11338) (Teddy Katz) +* [`dccee63`](https://github.com/eslint/eslint/commit/dccee63cf41234180c71bf0fe01b165c9078fc69) Chore: avoid hard-coding the list of core rules in eslint:recommended (#11336) (Teddy Katz) +* [`c1fd6f5`](https://github.com/eslint/eslint/commit/c1fd6f54d92efe615bcae529006221e122dbe9e6) Chore: remove undocumented `Linter#rules` property (refs #9161) (#11335) (Teddy Katz) +* [`36e3356`](https://github.com/eslint/eslint/commit/36e335681d61cbe3c83b653b7cc5f95730f1d86e) Chore: remove dead code for loading rules (#11334) (Teddy Katz) +* [`c464e27`](https://github.com/eslint/eslint/commit/c464e2744ec76e7e9c6c5af0f6162c92187f1ece) Docs: Rename `result` -> `foo` (#11210) (Alexis Tyler) + +v5.12.1 - January 18, 2019 + +* [`eb5c401`](https://github.com/eslint/eslint/commit/eb5c4014f16be1c2003ed46ce9560d0d8a567d0f) Chore: use meta.messages in some rules (2/4) (refs #9870) (#10773) (薛定谔的猫) +* [`aa56247`](https://github.com/eslint/eslint/commit/aa56247746a0095996a41dd03bdbbf659f0f93b6) Fix: avoid loading core rules dynamically from FS in Linter (#11278) (Peter Metz) +* [`04450bb`](https://github.com/eslint/eslint/commit/04450bb7ed20f2412102538b238119d9764b4dc9) Docs: clarify process for adding committers (#11272) (Kai Cataldo) +* [`3ffcf26`](https://github.com/eslint/eslint/commit/3ffcf26c1c83efe7d7cf2d87f1063695ae653709) Docs: add @g-plane as committer (#11277) (Kai Cataldo) +* [`c403445`](https://github.com/eslint/eslint/commit/c40344566eff2e77a6ae2b2d2dbdbd4ad3e76b67) Fix: warn constant on RHS of || in no-constant-condition (fixes #11181) (#11253) (Merlin Mason) +* [`9194f45`](https://github.com/eslint/eslint/commit/9194f45ac7d521119a53773bf02b81670bad526e) Fix: Manage severity of 1 with TAP reporter (fixes #11110) (#11221) (Gabriel Cousin) +* [`000f495`](https://github.com/eslint/eslint/commit/000f4952ae6a4311fbbc3ed36c481235fcb0b64b) Docs: fix example for sort-imports ignoreDeclarationSort (#11242) (Remco Haszing) +* [`7c0bf2c`](https://github.com/eslint/eslint/commit/7c0bf2ca92d83125a1fa000c9c4250bae6b4fc21) Docs: Add `npx` usage to Getting Started guide (#11249) (eyal0803) +* [`da9174e`](https://github.com/eslint/eslint/commit/da9174e0798c1d785ddabb3ae405860fc5b89311) Docs: fixes typo peerDepencies (#11252) (Christian Kühl) +* [`9c31625`](https://github.com/eslint/eslint/commit/9c31625f19176664ef76dcf088ce50703c41c324) Docs: Improve custom formatter docs (#11258) (Nicholas C. Zakas) + +v5.12.0 - January 4, 2019 + +* [`0d91e7d`](https://github.com/eslint/eslint/commit/0d91e7d28e5eba79a6032165cdef5d4549d26462) Update: Add sort-imports ignoreDeclarationSort (fixes #11019) (#11040) (Remco Haszing) +* [`f92d6f0`](https://github.com/eslint/eslint/commit/f92d6f05c4dcd4a3a0616871e10b31edae9dfad5) Build: Add karma-chrome-launcher support (#11027) (薛定谔的猫) +* [`166853d`](https://github.com/eslint/eslint/commit/166853d9c59db493f0b1bb68a67ad868662a4205) Upgrade: eslint-plugin-eslint-plugin@2.0.1 (#11220) (薛定谔的猫) +* [`bfff77a`](https://github.com/eslint/eslint/commit/bfff77ad4eaa02e2e62481c986634df38d5db6e5) Fix: no-param-reassign parameter in ternary operator (fixes #11236) (#11239) (周昊宇) +* [`258b654`](https://github.com/eslint/eslint/commit/258b6541f61dc3a9ae64e200680766a11c3dd316) Upgrade: require-uncached renamed to import-fresh (#11066) (薛定谔的猫) + +v5.11.1 - December 26, 2018 + +* [`de79f10`](https://github.com/eslint/eslint/commit/de79f1026b7035f0296d7876f1db64f225cca1b8) Fix: handle optional catch bindings in no-useless-catch (#11205) (Colin Ihrig) + +v5.11.0 - December 22, 2018 + +* [`b4395f6`](https://github.com/eslint/eslint/commit/b4395f671442a7e0be956382c24cce38025a6df6) New: add option `first` for VariableDeclarator in indent (fixes #8976) (#11193) (Pig Fang) +* [`2b5a602`](https://github.com/eslint/eslint/commit/2b5a60284670a3ab1281b206941ed38faf2ea10c) New: no-useless-catch rule (fixes #11174) (#11198) (Alexander Grasley) +* [`06b3b5b`](https://github.com/eslint/eslint/commit/06b3b5bfcf0429c5078d4f4af3c03bb777e4f022) Fix: Account for comments in implicit-arrow-linebreak (#10545) (Mark de Dios) +* [`4242314`](https://github.com/eslint/eslint/commit/4242314215a6f35e432860433906f47af1a29724) Update: handle computed properties in camelcase (fixes #11084) (#11113) (Bence Dányi) +* [`1009304`](https://github.com/eslint/eslint/commit/100930493d9ab802a94dac5c761515b12241ddd2) Docs: add a note for no-unused-expressions (fixes #11169) (#11192) (Pig Fang) +* [`88f99d3`](https://github.com/eslint/eslint/commit/88f99d31b88a4cde4563bc4a6f4c41f0cc557885) Docs: clarify how to use configs in plugins (#11199) (Kai Cataldo) +* [`bcf558b`](https://github.com/eslint/eslint/commit/bcf558b2f7036f487af2bdb2b2d34b6cdf7fc174) Docs: Clarify the no-unused-vars docs (#11195) (Jed Fox) +* [`a470eb7`](https://github.com/eslint/eslint/commit/a470eb73d52fae0f0bc48de5a487e23cf78fcfa9) Docs: Fix no-irregular-whitespace description (#11196) (Jed Fox) +* [`8abc8af`](https://github.com/eslint/eslint/commit/8abc8afe71691b747cbd1819a13d896e8aa5b92a) Docs: Remove a misleading example (#11204) (Bogdan Gradinariu) +* [`733d936`](https://github.com/eslint/eslint/commit/733d93618a99758a05453ab94505a9f1330950e0) Docs: link to JSDoc EOL blogpost in valid-jsdoc and require-jsdoc (#11191) (Nathan Diddle) +* [`d5eb108`](https://github.com/eslint/eslint/commit/d5eb108e17f676d0e4fcddeb1211b4bdfac760c1) Docs: Ensure `triage` label is added to new issues (#11182) (Teddy Katz) +* [`617a287`](https://github.com/eslint/eslint/commit/617a2874ed085bca36ca289aac55e3b7f7ce937e) Docs: add missing deprecation notices for jsdoc rules (#11171) (Teddy Katz) + +v5.10.0 - December 8, 2018 + +* [`4b0f517`](https://github.com/eslint/eslint/commit/4b0f517cd317e5f1b99a1e8a0392332bd8a2e231) Upgrade: single- and multiline const, let, var statements (fixes #10721) (#10919) (Tom Panier) +* [`9666aba`](https://github.com/eslint/eslint/commit/9666abaf46c841fba7b5d4e53c6998cd25b9bc33) Update: space-infix-ops reports violating operator (#10934) (Bence Dányi) +* [`c14f717`](https://github.com/eslint/eslint/commit/c14f717f4c32860766185da47f64f8eb0c2d2998) Fix: Update all-files-ignored.txt message to be less confusing (#11075) (z.ky) +* [`9f3573d`](https://github.com/eslint/eslint/commit/9f3573dda3dc35bc220e945686cc835eaad0ac2c) Docs: Clarify the CLIEngine options (#10995) (Ed Morley) +* [`dd7b0cb`](https://github.com/eslint/eslint/commit/dd7b0cb019d94964930d30fec36f7b22ef072822) Chore: refactor template literal feature detection in 'quotes' rule (#11125) (Bryan) +* [`3bf0332`](https://github.com/eslint/eslint/commit/3bf0332508b921cb660c2e8a1ab7ddf46a2013b6) Fix: fix the fixer of lone comma with comments (fixes #10632) (#11154) (Pig Fang) +* [`f850726`](https://github.com/eslint/eslint/commit/f8507260c2091d18488fde20e466639d1a7f913c) Upgrade: Espree v5.0.0 (#11161) (Kai Cataldo) +* [`4490d7a`](https://github.com/eslint/eslint/commit/4490d7af529d4ecc18b6874f1d838869656da58a) Update: deprecate valid-jsdoc and require-jsdoc (#11145) (Teddy Katz) +* [`60dfb6c`](https://github.com/eslint/eslint/commit/60dfb6c623dfe829e5350dabe507e7850c1beacf) Docs: Update issue templates (#11163) (Teddy Katz) +* [`958987a`](https://github.com/eslint/eslint/commit/958987aa6f5630faa051d8f822f0200faff41924) Docs: Fix link to rule no-useless-rename (#11165) (Brian) +* [`62fd2b9`](https://github.com/eslint/eslint/commit/62fd2b93448966331db3eb2dfbe4e1273eb032b2) Update: Amend keyword-spacing to validate `default` keywords (#11097) (Bin Ury) +* [`4bcdfd0`](https://github.com/eslint/eslint/commit/4bcdfd07d514fd7a6b8672d33703d0b6c606f214) Chore: fix some jsdoc-related issues (#11148) (薛定谔的猫) +* [`c6471ed`](https://github.com/eslint/eslint/commit/c6471ed6feb3e71e239379a7042deb9b8ab3cf39) Docs: fix typo in issue-templates/new-rule (#11149) (薛定谔的猫) +* [`5d451c5`](https://github.com/eslint/eslint/commit/5d451c510c15abc41b5bb14b4955a7db96aeb100) Chore: Remove dependency on is-resolvable (#11128) (Matt Grande) +* [`bc50dc7`](https://github.com/eslint/eslint/commit/bc50dc7737496712463220e662946eb516e36ae1) Chore: Move ignored-paths, report-translator to lib/util (refs #10559) (#11116) (Kevin Partington) +* [`c0a80d0`](https://github.com/eslint/eslint/commit/c0a80d0ca3c80ca27694fc8aedcf84b72bfd9465) Fix: Do not strip underscores in camelcase allow (fixes #11000) (#11001) (Luke Page) +* [`a675c89`](https://github.com/eslint/eslint/commit/a675c89573836adaf108a932696b061946abf1e6) Docs: (Grammar) "the setup" -> "to set up" (#11117) (MarvinJWendt) +* [`54dfa60`](https://github.com/eslint/eslint/commit/54dfa602f62e6d183d57d60d5fdd417a263f479e) Fix: Typo in function comment parameters (#11111) (Pierre Maoui) +* [`cf296bd`](https://github.com/eslint/eslint/commit/cf296bdabf0dbbfbae491419e38aee4ecd63ec71) Docs: switch incorrect example with correct one (#11107) (Romain Le Quellec) +* [`d2d500c`](https://github.com/eslint/eslint/commit/d2d500ca5dff307189b9d4161a5e7b8282557dd6) Docs: no-console#When-Not-To-Use provides incorrect rule snippet (#11093) (Lawrence Chou) +* [`f394a1d`](https://github.com/eslint/eslint/commit/f394a1dfc5eb4874f899b7bc19685896893af7b8) Chore: Extract config comment parsing (#11091) (Nicholas C. Zakas) +* [`709190f`](https://github.com/eslint/eslint/commit/709190f8c5d7559b1e0915e25af60b50a94ba1c7) Build: fix test failure on Node 11 (#11100) (Teddy Katz) +* [`3025cdd`](https://github.com/eslint/eslint/commit/3025cddf0a2ea8461ce05575098a5714fcf6278d) Update: don't indent leading semi in line after import (fixes #11082) (#11085) (Pig Fang) +* [`e18c827`](https://github.com/eslint/eslint/commit/e18c827cc12cb1c52e5d0aa993f572cb56238704) Chore: refactor linter#parseBooleanConfig to improve readability (#11074) (薛定谔的猫) +* [`5da378a`](https://github.com/eslint/eslint/commit/5da378ac922d732ca1765f08edee0face1b1b924) Upgrade: eslint-release@1.2.0 (#11073) (Teddy Katz) + +v5.9.0 - November 9, 2018 + +* 9436712 Fix: Unused recursive function expressions (fixes #10982) (#11032) (Sergei Startsev) +* c832cd5 Update: add `ignoreDestructuring` option to `id-match` rule (#10554) (一名宅。) +* 54687a8 Fix: prefer-const autofix multiline assignment (fixes #10582) (#10987) (Scott Stern) +* ae2b61d Update: "off" options for "space-before-blocks" (refs #10906) (#10907) (Sophie Kirschner) +* 57f357e Docs: Update require-await docs with exception (fixes #9540) (#11063) (Nicholas C. Zakas) +* 79a2797 Update: no-restricted-imports to check re-export (fixes #9678) (#11064) (Nicholas C. Zakas) +* 3dd7493 Docs: update ecmaVersion to include 2019/10 values (#11059) (Vse Mozhet Byt) +* 607635d Upgrade: eslint-plugin-node & eslint-plugin (#11067) (薛定谔的猫) +* dcc6233 Fix: Ignore empty statements in no-unreachable (fixes #9081) (#11058) (Nicholas C. Zakas) +* 7ad86de New: Add --fix-type option to CLI (fixes #10855) (#10912) (Nicholas C. Zakas) +* 0800b20 Chore: fix invalid super() calls in tests (#11054) (Teddy Katz) +* 4fe3287 Docs: Cross-reference two rules (refs #11041) (#11042) (Paul Melnikow) +* 5525eb6 Fix: rule deprecation warnings did not consider all rules (#11044) (Teddy Katz) +* 44d37ca Docs: Update steps for adding new TSC member (#11038) (Nicholas C. Zakas) +* 802e926 Update: Warn for deprecation in Node output (fixes #7443) (#10953) (Colin Chang) + +v5.8.0 - October 26, 2018 + +* 9152417 Fix: deprecation warning in RuleTester using Node v11 (#11009) (Teddy Katz) +* e349a03 Docs: Update issue templates to ask for PRs (#11012) (Nicholas C. Zakas) +* 3d88b38 Chore: avoid using legacy report API in no-irregular-whitespace (#11013) (Teddy Katz) +* 5a31a92 Build: compile espree's deps to ES5 when generating site (fixes #11014) (#11015) (Teddy Katz) +* 3943635 Update: Create Linter.version API (fixes #9271) (#11010) (Nicholas C. Zakas) +* a940cf4 Docs: Mention version for config glob patterns (fixes #8793) (Nicholas C. Zakas) +* 6e1c530 Build: run tests on Node 11 (#11008) (Teddy Katz) +* 58ff359 Docs: add instructions for npm 2FA (refs #10631) (#10992) (Teddy Katz) +* 2f87bb3 Upgrade: eslint-release@1.0.0 (refs #10631) (#10991) (Teddy Katz) +* 57ef0fd Fix: prefer-const when using destructuring assign (fixes #8308) (#10924) (Nicholas C. Zakas) +* 577cbf1 Chore: Add typescript-specific edge case tests to space-infix-ops (#10986) (Bence Dányi) +* d45b184 Chore: Using deconstruction assignment for shelljs (#10974) (ZYSzys) + +v5.7.0 - October 12, 2018 + +* 6cb63fd Update: Add iife to padding-line-between-statements (fixes #10853) (#10916) (Kevin Partington) +* 5fd1bda Update: no-tabs allowIndentationTabs option (fixes #10256) (#10925) (Kevin Partington) +* d12be69 Fix: no-extra-bind No autofix if arg may have side effect (fixes #10846) (#10918) (Kevin Partington) +* 847372f Fix: no-unused-vars false pos. with markVariableAsUsed (fixes #10952) (#10954) (Roy Sutton) +* 4132de7 Chore: Simplify space-infix-ops (#10935) (Bence Dányi) +* 543edfa Fix: Fix error with one-var (fixes #10937) (#10938) (Justin Krup) +* 95c4cb1 Docs: Fix typo for no-unsafe-finally (#10945) (Sergio Santoro) +* 5fe0e1a Fix: no-invalid-regexp disallows \ at end of pattern (fixes #10861) (#10920) (Toru Nagashima) +* f85547a Docs: Add 'When Not To Use' section to space-infix-ops (#10931) (Bence Dányi) +* 3dccac4 Docs: Update working-with-parsers link (#10929) (Azeem Bande-Ali) +* 557a8bb Docs: Remove old note about caching, add a new one (fixes #10739) (#10913) (Zac) +* fe8111a Chore: Add more test cases to space-infix-ops (#10936) (Bence Dányi) +* 066f7e0 Update: camelcase rule ignoreList added (#10783) (Julien Martin) +* 70bde69 Upgrade: table to version 5 (#10903) (Rouven Weßling) +* 2e52bca Chore: Update issue templates (#10900) (Nicholas C. Zakas) + +v5.6.1 - September 28, 2018 + +* 9b26bdb Fix: avoid exponential require-atomic-updates traversal (fixes #10893) (#10894) (Teddy Katz) +* 9432b10 Fix: make separateRequires work in consecutive mode (fixes #10784) (#10886) (Pig Fang) +* e51868d Upgrade: debug@4 (fixes #10854) (#10887) (薛定谔的猫) +* d3f3994 Docs: add information about reporting security issues (#10889) (Teddy Katz) +* cc458f4 Build: fix failing tests on master (#10890) (Teddy Katz) +* a6ebfd3 Docs: clarify defaultAssignment option, fix no-unneeded-ternary examples (#10874) (CoffeeTableEspresso) +* 9d52541 Fix: Remove duplicate error message on crash (fixes #8964) (#10865) (Nicholas C. Zakas) +* 4eb9a49 Docs: Update quotes.md (#10862) (The Jared Wilcurt) +* 9159e9b Docs: Update complexity.md (#10867) (Szymon Przybylski) +* 14f4e46 Docs: Use Linter instead of linter in Nodejs API page (#10864) (Nicholas C. Zakas) +* b3e3cb1 Chore: Update debug log name to match filename (#10863) (Nicholas C. Zakas) + +v5.6.0 - September 14, 2018 + +* c5b688e Update: Added generators option to func-names (fixes #9511) (#10697) (Oscar Barrett) +* 7da36d5 Fix: respect generator function expressions in no-constant-condition (#10827) (Julian Rosse) +* 0a65844 Chore: quote enable avoidEscape option in eslint-config-eslint (#10626) (薛定谔的猫) +* 32f41bd Chore: Add configuration wrapper markdown for the bug report template (#10669) (Iulian Onofrei) + +v5.5.0 - August 31, 2018 + +* 6e110e6 Fix: camelcase duplicate warning bug (fixes #10801) (#10802) (Julian Rosse) +* 5103ee7 Docs: Add Brackets integration (#10813) (Jan Pilzer) +* b61d2cd Update: max-params to only highlight function header (#10815) (Ian Obermiller) +* 2b2f11d Upgrade: babel-code-frame to version 7 (#10808) (Rouven Weßling) +* 2824d43 Docs: fix comment placement in a code example (#10799) (Vse Mozhet Byt) +* 10690b7 Upgrade: devdeps and deps to latest (#10622) (薛定谔的猫) +* 80c8598 Docs: gitignore syntax updates (fixes #8139) (#10776) (Gustavo Santana) +* cb946af Chore: use meta.messages in some rules (1/4) (#10764) (薛定谔的猫) + +v5.4.0 - August 17, 2018 + +* a70909f Docs: Add jscs-dev.github.io links (#10771) (Gustavo Santana) +* 034690f Fix: no-invalid-meta crashes for non Object values (fixes #10750) (#10753) (Sandeep Kumar Ranka) +* 11a462d Docs: Broken jscs.info URLs (fixes #10732) (#10770) (Gustavo Santana) +* 985567d Chore: rm unused dep string.prototype.matchall (#10756) (薛定谔的猫) +* f3d8454 Update: Improve no-extra-parens error message (#10748) (Timo Tijhof) +* 562a03f Fix: consistent-docs-url crashes if meta.docs is empty (fixes #10722) (#10749) (Sandeep Kumar Ranka) +* 6492233 Chore: enable no-prototype-builtins in codebase (fixes #10660) (#10664) (薛定谔的猫) +* 137140f Chore: use eslintrc overrides (#10677) (薛定谔的猫) + +v5.3.0 - August 3, 2018 + +* dd6cb19 Docs: Updated no-return-await Rule Documentation (fixes #9695) (#10699) (Marla Foreman) +* 6009239 Chore: rename utils for consistency (#10727) (薛定谔的猫) +* 6eb972c New: require-unicode-regexp rule (fixes #9961) (#10698) (Toru Nagashima) +* 5c5d64d Fix: ignored-paths for Windows path (fixes #10687) (#10691) (Toru Nagashima) +* 5f6a765 Build: ensure URL fragments remain in documentation links (fixes #10717) (#10720) (Teddy Katz) +* 863aa78 Docs: add another example for when not to use no-await-in-loop (#10714) (Valeri Karpov) +* 6e78b7d Docs: remove links to terminated jscs.info domain (#10706) (Piotr Kuczynski) +* d56c39d Fix: ESLint cache no longer stops autofix (fixes #10679) (#10694) (Kevin Partington) +* 2cc3240 New: add no-misleading-character-class (fixes #10049) (#10511) (Toru Nagashima) +* 877f4b8 Fix: The "../.." folder is always ignored (fixes #10675) (#10682) (Sridhar) +* 5984820 Chore: Move lib/file-finder.js to lib/util/ (refs #10559) (#10695) (Kevin Partington) +* e37a593 Update: Fix incorrect default value for position (#10670) (Iulian Onofrei) +* 8084bfc Docs: change when not to use object spread (#10621) (Benny Powers) +* 7f496e2 Chore: Update require path for ast-utils (#10693) (Kevin Partington) +* 648a33a Chore: reorganize code structure of utilities (refs #10599) (#10680) (薛定谔的猫) +* f026fe1 Update: Fix 'function' in padding-line-between-statements (fixes #10487) (#10676) (Kevin Partington) +* c2bb8bb Docs: Remove superfluous object option sample code (#10652) (Iulian Onofrei) +* d34a13b Docs: add subheader in configuring/configuring-rules (#10686) (薛定谔的猫) +* d8aea28 Chore: rm unnecessary plugin in eslint-config-eslint (#10685) (薛定谔的猫) +* 9e76be7 Update: indent comments w/ nearby code if no blank lines (fixes #9733) (#10640) (Kevin Partington) +* 9e93d46 New: add no-async-promise-executor rule (fixes #10217) (#10661) (Teddy Katz) +* 5a2538c New: require-atomic-updates rule (fixes #10405) (#10655) (Teddy Katz) +* 8b83d2b Fix: always resolve default ignore patterns from CWD (fixes #9227) (#10638) (Teddy Katz) +* acb6658 Fix: ESLint crash with prefer-object-spread (fixes #10646) (#10649) (薛定谔的猫) +* 99fb7d3 Docs: fix misleading no-prototype-builtins description (#10666) (薛定谔的猫) +* 005b849 Docs: fix outdated description of `baseConfig` option (#10657) (Teddy Katz) +* 15a77c4 Docs: fix broken links (fixes eslint/eslint-jp#6) (#10658) (Toru Nagashima) +* 87cd344 Docs: Make marking a default option consistent with other rules (#10650) (Iulian Onofrei) +* 0cb5e3e Chore: Replace some function application with spread operators (#10645) (Kevin Partington) +* b6daf0e Docs: Remove superfluous section from no-unsafe-negation (#10648) (Iulian Onofrei) +* e1a3cac Chore: rm deprecated experimentalObjectRestSpread option in tests (#10647) (薛定谔的猫) + +v5.2.0 - July 20, 2018 + +* 81283d0 Update: Cache files that failed linting (fixes #9948) (#10571) (Kevin Partington) +* 13cc63e Upgrade: ignore@4.0.2 (#10619) (Rouven Weßling) +* ac77a80 Chore: Fixing a call to Object.assign.apply in Linter (#10629) (Kevin Partington) +* 761f802 Upgrade: eslint-plugin-node to 7.0.1 (#10612) (Toru Nagashima) +* c517b2a Build: fix npm run perf failing(fixes #10577) (#10607) (薛定谔的猫) +* e596939 Chore: fix redundant equality check (#10617) (Toru Nagashima) +* 9f93d5f Docs: Updated Working with Custom Formatters (fixes #9950) (#10592) (Marla Foreman) +* 9aaf195 Chore: Extract lint result cache logic (refs #9948) (#10562) (Kevin Partington) +* 80b296e Build: package.json update for eslint-config-eslint release (ESLint Jenkins) +* e4e7ff2 Chore: fix error message in eslint-config-eslint (#10588) (薛定谔的猫) +* 1e88170 Chore: Move lib/logging and lib/timing to lib/util/ (refs #10559) (#10579) (Kevin Partington) +* 64dfa21 Build: Fix prerelease logic in blog post generation (fixes #10578) (#10581) (Kevin Partington) +* 0faf633 Chore: Simplify helper method in Linter tests (#10580) (Kevin Partington) + +v5.1.0 - July 8, 2018 + +* 7328f99 Build: package.json update for eslint-config-eslint release (ESLint Jenkins) +* b161f6b Build: Include prerelease install info in release blog post (#10463) (Kevin Partington) +* b2df738 Fix: prefer-object-spread duplicated comma (fixes #10512, fixes #10532) (#10524) (Toru Nagashima) +* d8c3a25 Fix: wrap-regex doesn't work in some expression(fixes #10573) (#10576) (薛定谔的猫) +* 114f42e Docs: Clarify option defaults in max-lines-per-function docs (#10569) (Chris Harwood) +* 63f36f7 Fix: sort-keys in an object that contains spread (fixes #10261) (#10495) (katerberg) +* 601a5c4 Fix: Prefer-const rule crashing on array destructuring (fixes #10520) (#10527) (Michael Mason) +* 143890a Update: Adjust grammar of error/warnings fixable (#10546) (Matt Mischuk) +* 8ee39c5 Chore: small refactor config-validator (#10565) (薛定谔的猫) +* 100f1be Docs: add note about release issues to readme (#10572) (Teddy Katz) +* 02efeac Fix: do not fail on nested unknown operators (#10561) (Rubén Norte) +* 92b19ca Chore: use eslintrc overrides(dogfooding) (#10566) (薛定谔的猫) +* 076a6b6 Docs: add actionable fix to no-irregular-whitespace (#10558) (Matteo Collina) +* de663ec Docs: Only successfully linted files are cached (fixes #9802) (#10557) (Kevin Partington) +* f0e22fc Upgrade: globals@11.7.0 (#10497) (薛定谔的猫) +* 8a2ff2c Docs: adding a section about disable rules for some files (#10536) (Wellington Soares) +* f22a3f8 Docs: fix a word in no-implied-eval (#10539) (Dan Homola) +* 20d8bbd Docs: add missing paragraph about "custom parsers" (#10547) (Pig Fang) +* b7addf6 Update: deprecate no-catch-shadow (fixes #10466) (#10526) (Toru Nagashima) +* e862dc3 Fix: Remove autofixer for no-debugger (fixes #10242) (#10509) (Teddy Katz) + +v5.0.1 - June 25, 2018 + +* 196c102 Fix: valid-jsdoc should allow optional returns for async (fixes #10386) (#10480) (Mark Banner) +* 4c823bd Docs: Fix max-lines-per-function correct code's max value (#10513) (Rhys Bower) + +v5.0.0 - June 22, 2018 + +* 0feedfd New: Added max-lines-per-function rule (fixes #9842) (#10188) (peteward44) +* daefbdb Upgrade: eslint-scope and espree to 4.0.0 (refs #10458) (#10500) (Brandon Mills) +* 077358b Docs: no-process-exit: recommend process.exitCode (#10478) (Andres Kalle) +* f93d6ff Fix: do not fail on unknown operators from custom parsers (fixes #10475) (#10476) (Rubén Norte) +* 05343fd Fix: add parens for yield statement (fixes #10432) (#10468) (Pig Fang) +* d477c5e Fix: check destructuring for "no-shadow-restricted-names" (fixes #10467) (#10470) (Pig Fang) +* 7a7580b Update: Add considerPropertyDescriptor option to func-name-matching (#9078) (Dieter Luypaert) +* e0a0418 Fix: crash on optional catch binding (#10429) (Toru Nagashima) +* de4dba9 Docs: styling team members (#10460) (薛定谔的猫) +* 5e453a3 Docs: display team members in tables. (#10433) (薛定谔的猫) +* b1895eb Docs: Restore intentional spelling mistake (#10459) (Wilfred Hughes) + +v5.0.0-rc.0 - June 9, 2018 + +* abf400d Update: Add ignoreDestructing option to camelcase rule (fixes #9807) (#10373) (Andrew Lunny) +* e2b394d Upgrade: espree and eslint-scope to rc versions (#10457) (Kevin Partington) +* a370da2 Chore: small opt to improve readability (#10241) (薛定谔的猫) +* 640bf07 Update: Fixes multiline no-warning-comments rule. (fixes #9884) (#10381) (Scott Stern) +* 831c39a Build: Adding rc release script to package.json (#10456) (Kevin Partington) +* dc4075e Update: fix false negative in no-use-before-define (fixes #10227) (#10396) (Toru Nagashima) +* 3721841 Docs: Add new experimental syntax policy to README (fixes #9804) (#10408) (Kevin Partington) +* d0aae3c Docs: Create docs landing page (#10453) (Kevin Partington) +* fe8bec3 Fix: fix writing config file when `source` is `prompt` (#10422) (Pig Fang) +* 917108d Update: Add requireParamType option to valid-jsdoc (fixes #6753) (#10220) (Tomasz Sterna) +* 1984c21 Docs: move custom parsers docs into a page (fixes #9919) (#10431) (Pig Fang) +* 400d4b5 Docs: Add rest and spread operator changes to migration guide (#10416) (Yannick Croissant) +* e7bdd02 Upgrade: Consume espree@4.0.0-alpha.1 (#10410) (Kevin Partington) +* 3e9f33a Fix: prevent crashing from JSON parsing error (fixes #10364) (#10376) (Pig Fang) +* 636457d Fix: parse later ES files in `eslint --init` (fixes #10003) (#10378) (Pig Fang) + +v5.0.0-alpha.4 - May 28, 2018 + +* ce3e62a Docs: remove test coverage badge (#10407) (薛定谔的猫) +* 240c1a4 Fix: prefer-const object destructuring false positive (fixes #9108) (#10368) (Pig Fang) +* 93c9a52 Update: config-validator should validate overrides (#10357) (Toru Nagashima) +* c2e0398 Update: Improves the prefer-object-spread rule by removing extraneous visitors (#10351) (Sharmila Jesupaul) +* d848949 Update: Support JSXFragment node (fixes #9662) (#9664) (Clement Hoang) +* f268128 Build: add Node v10 to travis (#10262) (alberto) +* 9c922ce Update: Add "consistent" option to array-element-newline (fixes #9457) (#10355) (Pig Fang) +* 65bce3a Fix: ensure --stdin flag works when stdin is piped asynchronously (#10393) (Teddy Katz) +* b9b23a9 Chore: rm unused argument (#10400) (薛定谔的猫) +* 8b7a70c Fix: handle one-var with no semicolon (fixes #10330) (#10371) (Malcolm Groves) +* 465e615 New: prompt users before installing dependencies (#10353) (Pig Fang) +* e25fc22 Chore: remove assert.doesNotThrow in tests (#10199) (Ruben Bridgewater) +* fb148aa Fix: allow no tokens after `return` keyword (fixes #10372) (#10379) (Pig Fang) +* 074bc1c Docs: polish for max-classes-per-file rule (#10377) (Pig Fang) +* a812845 Fix: allow array spread for prefer-object-spread rule (fixes #10344) (#10347) (Pig Fang) +* 448fc52 Docs: Update link to Integrations / Build tools / Start (#10354) (Kir Belevich) +* 4e5e9be Chore: avoid unnecessary filesystem accesses during config search (#10359) (Teddy Katz) +* 363da01 Chore: avoid code duplication in rule severity checking (#10358) (Teddy Katz) + +v5.0.0-alpha.3 - May 11, 2018 + +* 1a6b399 New: Adds prefer-object-spread rule (refs: #7230) (#9955) (Sharmila Jesupaul) +* c4109b2 New: add max-classes-per-file rule (#10163) (James Garbutt) +* 41f0f6e Breaking: report multiline eslint-disable-line directives (fixes #10334) (#10335) (Teddy Katz) +* 4ccd25a Chore: add eslint-plugin-node to eslint-config-eslint(fixes #10319) (#10320) (薛定谔的猫) +* 82757b2 Docs: Adding a little guidance to rule documentation (#10301) (Justin) +* 09dde26 Breaking: new object-curly-newline/no-self-assign default (fixes #10215) (#10337) (Teddy Katz) +* d65f11d Fix: correct comma fix in spare array (fixes #10273) (#10329) (Malcolm Groves) +* c343d86 Fix: do not autofix octal escape sequence (fixes #10031) (#10240) (Malcolm Groves) +* 514013c New: Add `globInputPaths` CLIEngine option (fixes #9972) (#10191) (Pierre Vanduynslager) +* 02e7b28 Chore: upgrade deps (#10339) (薛定谔的猫) +* 1397179 Chore: unskip test for scope analysis (#10336) (Teddy Katz) +* e5b33be Update: Add --fix for one-var rule (refs #9072) (#10040) (Sebastian Malton) +* 99b842d Chore: upgrade mock-fs@4.5.0 (#10325) (Tim Schaub) +* fe91859 Chore: Update issue templates with new format (#10309) (Ilya Volodin) +* 2f30aa5 Docs: add a better vim linting engine (#10292) (Jon Smithers) +* df2c1fb Docs: improve formatter guide (refs #9550) (#10294) (Dominic Lee) +* f7330c1 Chore: Add ESLint path to plugin-missing message (#10283) (Kevin Partington) +* bb6090f Fix: Throw error when --ignore-path not a file (fixes #10076) (#10205) (Malcolm Groves) +* 1b6b2b2 Build: remove trailing spaces in blogpost template (#10280) (Teddy Katz) +* a960d69 Docs: remove outdated notes from migration guide (#10279) (Teddy Katz) + +v5.0.0-alpha.2 - April 27, 2018 + +* 510ca8b Docs: make grammatical tweaks in migration guide (#10278) (Teddy Katz) +* 02e44a5 Breaking: remove TDZ scopes (fixes #10245) (#10270) (Toru Nagashima) +* c74933b Breaking: remove extra check in getScope (fixes #10246, fixes #10247) (#10252) (Toru Nagashima) +* 7c2e83a Chore: improve tests and checking for equality (#10182) (Ruben Bridgewater) +* 8799972 Docs: make template link wording more clear (#10219) (David Luzar) +* 8b7c6ea Breaking: report fatal error for linting nonexistent files (fixes #7390) (#10143) (Teddy Katz) +* 9100819 Breaking: fix plugin resolver in extends (fixes #9904) (#10236) (Toru Nagashima) +* c45f1d0 Breaking: add rules to recommended (fixes #8865) (#10158) (薛定谔的猫) +* 1d443a0 Fix: valid-jsdoc does not know async function returns (fixes #9881) (#10161) (Rachael Sim) +* a82cbea Update: re-enable experimentalObjectRestSpread (fixes #9990) (#10230) (Toru Nagashima) +* f9c7371 Fix: do not autofix object-shorthand with comments (fixes #10038) (#10238) (Malcolm Groves) +* 4672b56 Docs: Correct wording in the `smart-tabs` docs page (#10277) (Jed Fox) +* b32d1f4 Chore: upgrade eslump@1.6.2 (#10258) (薛定谔的猫) +* 7938bf1 Chore: update eslint-fuzzer ecmaVersion to 2018 (#10255) (薛定谔的猫) +* a2953ec Chore: small opt to improve readability (#10225) (薛定谔的猫) +* 85a5191 Docs: Update JSCS FAQ (#10221) (alberto) +* 8e89d5c Docs: Fix typo (#10223) (alberto) +* c0c331e Docs: Add Prettier to FAQ (#10222) (alberto) +* 2443627 Docs: add backticks in getter-return (#10218) (薛定谔的猫) +* 74bb5b5 Docs: Fix misspelling in changelog (#10216) (Kevin Partington) + +v5.0.0-alpha.1 - April 13, 2018 + +* b2a48a9 Breaking: stop using fake `context._linter` property (fixes #10140) (#10209) (Teddy Katz) +* a039956 Breaking: remove deprecated browser/jest/node globals (fixes #10141) (#10210) (Teddy Katz) +* 98f1cad Docs: update migration guide with latest changes (#10212) (Teddy Katz) +* 2e60017 Chore: remove concat-stream dependency (#10173) (Teddy Katz) +* 7f69f11 Chore: rearrange init options. (#10131) (薛定谔的猫) +* f595fd8 Upgrade: upgrade deps (#10184) (alberto) +* 71167be Docs: fix wrong config in id-length (#10196) (薛定谔的猫) +* 81629d2 Chore: enable rest/spread rules on ESLint codebase (#10211) (Teddy Katz) +* 2324570 Breaking: no-unused-vars reports all after-used params (fixes #9909) (#10119) (Kevin Partington) +* 7765fc4 Upgrade: ajv@^6.0.1, still using json schema draft 04 (#9856) (Kevin Partington) +* b77846d Breaking: drop supporting Node.js 4 (fixes #10052) (#10074) (薛定谔的猫) +* cd34d44 Chore: avoid modifying global state when tests fail (#10201) (Teddy Katz) +* 731da1e Docs: fix code in correct example. (#10195) (薛定谔的猫) +* 3780915 Docs: fix some small errors in examples (#10194) (薛定谔的猫) +* 869c9f5 Upgrade: babelify (#10185) (alberto) +* 218ee57 Fix: report no-case-declarations from declarations (fixes #10048) (#10167) (Carlo Abelli) +* b7ee1ed Upgrade: upgrade devdeps (#10178) (alberto) +* db1a582 Chore: Add debug logging for CLI args as they came in (#10174) (Kevin Partington) +* f3a0291 Upgrade: Update dependencies. (#10168) (alberto) +* 7d6e052 Upgrade: esquery@^1.0.1 (fixes #8733) (#10170) (Kevin Partington) +* 1e7252f Docs: Add more related rules for object-curly-spacing (#10175) (Saugat Acharya) +* e5cf9cc Docs: Reorder README sections (#10172) (alberto) +* c85578f Chore: Remove `esprima-fb` dependency. (#10171) (alberto) +* d0dc2e3 Docs: Add Missing Quotes (#10162) (Samarth Verma) +* 7a63bfa Upgrade: eslint-release to v0.11.1 (#10156) (Teddy Katz) +* b7a1a7a Build: Gensite creates prerelease dirs if needed (#10154) (Brandon Mills) + +v5.0.0-alpha.0 - March 30, 2018 + +* f4b3af5 Breaking: Upgrade to Espree v4 alpha (refs #9990) (#10152) (Brandon Mills) +* 3351129 Docs: add v5.0.0 migration guide (fixes #10142) (#10147) (Teddy Katz) +* f2f98dd Build: make prerelease script publish to GitHub/website (#10151) (Teddy Katz) +* d440e84 Breaking: support @scope shorthand in plugins (fixes #9903) (#9905) (Toru Nagashima) +* 462b058 Update: Include debugging information when rule throws error (#9742) (Patrick Hayes) +* 9a020dc Chore: refactor --no-ignore flag logic (#10146) (Teddy Katz) +* 4f61a0d Chore: add noopener/noreferrer (薛定谔的猫) +* 65cc834 Docs: Ensure CLI doc sections match command line help order (#10144) (Kevin Partington) +* 9c79174 Docs: Update capitalized-comments with missing letters (fixes #10135) (#10134) (jasonfry) +* 9e66bfb Docs: remove eslint vs jshint from faq (#10108) (alberto) +* 692e383 Docs: Add modified variable examples for no-loop-func (fixes #9527) (#10098) (Rachael Sim) +* a9ee9ae Breaking: require rules to provide report messages (fixes #10011) (#10057) (Teddy Katz) +* 837edc7 Chore: Uncommented test for empty program for no-invalid-meta (#10046) (Kevin Partington) +* c383bc5 Breaking: Make require('eslint').linter non-enumerable (fixes #9270) (#9692) (Jed Fox) +* 4eaebe5 Breaking: set `parent` of AST nodes before rules run (fixes #9122) (#10014) (Teddy Katz) +* 91ece32 Breaking: remove special exception for linting empty files (fixes #9534) (#10013) (Teddy Katz) +* 27e3f24 Breaking: remove `source` property from linting messages (fixes #7358) (#10012) (Teddy Katz) +* e4c3b3c Breaking: use an exit code of 2 for fatal config problems (fixes #9384) (#10009) (Teddy Katz) +* 2a7ecaa Breaking: Use strict equality in RuleTester comparisons (fixes #9417) (#10008) (Teddy Katz) +* 0bc4a38 Fix: Make rule-tester strictly check messageId. (ref #9890) (#9908) (Jacques Favreau) +* ea6fb17 Update: Make no-cond-assign work for ternaries (fixes #10091) (#10109) (Aaron Harper) + +v4.19.1 - March 21, 2018 + +* 3ff5d11 Fix: no-invalid-regexp not understand variable for flags (fixes #10112) (#10113) (薛定谔的猫) +* abc765c Fix: object-curly-newline minProperties w/default export (fixes #10101) (#10103) (Kevin Partington) +* 6f9e155 Docs: Update ambiguous for...in example for guard-for-in (#10114) (CJ R) +* 0360cc2 Chore: Adding debug logs on successful plugin loads (#10100) (Kevin Partington) +* a717c5d Chore: Adding log at beginning of unit tests in Makefile.js (#10102) (Kevin Partington) + +v4.19.0 - March 16, 2018 + +* 55a1593 Update: consecutive option for one-var (fixes #4680) (#9994) (薛定谔的猫) +* 8d3814e Fix: false positive about ES2018 RegExp enhancements (fixes #9893) (#10062) (Toru Nagashima) +* 935f4e4 Docs: Clarify default ignoring of node_modules (#10092) (Matijs Brinkhuis) +* 72ed3db Docs: Wrap `Buffer()` in backticks in `no-buffer-constructor` rule description (#10084) (Stephen Edgar) +* 3aded2f Docs: Fix lodash typos, make spacing consistent (#10073) (Josh Smith) +* e33bb64 Chore: enable no-param-reassign on ESLint codebase (#10065) (Teddy Katz) +* 66a1e9a Docs: fix possible typo (#10060) (Vse Mozhet Byt) +* 2e68be6 Update: give a node at least the indentation of its parent (fixes #9995) (#10054) (Teddy Katz) +* 72ca5b3 Update: Correctly indent JSXText with trailing linebreaks (fixes #9878) (#10055) (Teddy Katz) +* 2a4c838 Docs: Update ECMAScript versions in FAQ (#10047) (alberto) + +v4.18.2 - March 2, 2018 + +* 6b71fd0 Fix: table@4.0.2, because 4.0.3 needs "ajv": "^6.0.1" (#10022) (Mathieu Seiler) +* 3c697de Chore: fix incorrect comment about linter.verify return value (#10030) (Teddy Katz) +* 9df8653 Chore: refactor parser-loading out of linter.verify (#10028) (Teddy Katz) +* f6901d0 Fix: remove catastrophic backtracking vulnerability (fixes #10002) (#10019) (Jamie Davis) +* e4f52ce Chore: Simplify dataflow in linter.verify (#10020) (Teddy Katz) +* 33177cd Chore: make library files non-executable (#10021) (Teddy Katz) +* 558ccba Chore: refactor directive comment processing (#10007) (Teddy Katz) +* 18e15d9 Chore: avoid useless catch clauses that just rethrow errors (#10010) (Teddy Katz) +* a1c3759 Chore: refactor populating configs with defaults in linter (#10006) (Teddy Katz) +* aea07dc Fix: Make max-len ignoreStrings ignore JSXText (fixes #9954) (#9985) (Rachael Sim) + +v4.18.1 - February 20, 2018 + +* f417506 Fix: ensure no-await-in-loop reports the correct node (fixes #9992) (#9993) (Teddy Katz) +* 3e99363 Docs: Fixed typo in key-spacing rule doc (#9987) (Jaid) +* 7c2cd70 Docs: deprecate experimentalObjectRestSpread (#9986) (Toru Nagashima) + +v4.18.0 - February 16, 2018 + +* 70f22f3 Chore: Apply memoization to config creation within glob utils (#9944) (Kenton Jacobsen) +* 0e4ae22 Update: fix indent bug with binary operators/ignoredNodes (fixes #9882) (#9951) (Teddy Katz) +* 47ac478 Update: add named imports and exports for object-curly-newline (#9876) (Nicholas Chua) +* e8efdd0 Fix: support Rest/Spread Properties (fixes #9885) (#9943) (Toru Nagashima) +* f012b8c Fix: support Async iteration (fixes #9891) (#9957) (Toru Nagashima) +* 74fa253 Docs: Clarify no-mixed-operators options (fixes #9962) (#9964) (Ivan Hayes) +* 426868f Docs: clean up key-spacing docs (fixes #9900) (#9963) (Abid Uzair) +* 4a6f22e Update: support eslint-disable-* block comments (fixes #8781) (#9745) (Erin) +* 777283b Docs: Propose fix typo for function (#9965) (John Eismeier) +* bf3d494 Docs: Fix typo in max-len ignorePattern example. (#9956) (Tim Martin) +* d64fbb4 Docs: fix typo in prefer-destructuring.md example (#9930) (Vse Mozhet Byt) +* f8d343f Chore: Fix default issue template (#9946) (Kai Cataldo) + +v4.17.0 - February 2, 2018 + +* 1da1ada Update: Add "multiline" type to padding-line-between-statements (#8668) (Matthew Bennett) +* bb213dc Chore: Use messageIds in some of the core rules (#9648) (Jed Fox) +* 1aa1970 Docs: remove outdated rule naming convention (#9925) (Teddy Katz) +* 3afaff6 Docs: Add prefer-destructuring variable reassignment example (#9873) (LePirlouit) +* d20f6b4 Fix: Typo in error message when running npm (#9866) (Maciej Kasprzyk) +* 51ec6a7 Docs: Use GitHub Multiple PR/Issue templates (#9911) (Kai Cataldo) +* dc80487 Update: space-unary-ops uses astUtils.canTokensBeAdjacent (fixes #9907) (#9906) (Kevin Partington) +* 084351b Docs: Fix the messageId example (fixes #9889) (#9892) (Jed Fox) +* 9cbb487 Docs: Mention the `globals` key in the no-undef docs (#9867) (Dan Dascalescu) + +v4.16.0 - January 19, 2018 + +* e26a25f Update: allow continue instead of if wrap in guard-for-in (fixes #7567) (#9796) (Michael Ficarra) +* af043eb Update: Add NewExpression support to comma-style (#9591) (Frazer McLean) +* 4f898c7 Build: Fix JSDoc syntax errors (#9813) (Matija Marohnić) +* 13bcf3c Fix: Removing curly quotes in no-eq-null report message (#9852) (Kevin Partington) +* b96fb31 Docs: configuration hierarchy for CLIEngine options (fixes #9526) (#9855) (PiIsFour) +* 8ccbdda Docs: Clarify that -c configs merge with `.eslintrc.*` (fixes #9535) (#9847) (Kevin Partington) +* 978574f Docs: Fix examples for no-useless-escape (#9853) (Toru Kobayashi) +* cd5681d Chore: Deactivate consistent-docs-url in internal rules folder (#9815) (Kevin Partington) +* 2e87ddd Docs: Sync messageId examples' style with other examples (#9816) (Kevin Partington) +* 1d61930 Update: use doctrine range information in valid-jsdoc (#9831) (Teddy Katz) +* 133336e Update: fix indent behavior on template literal arguments (fixes #9061) (#9820) (Teddy Katz) +* ea1b15d Fix: avoid crashing on malformed configuration comments (fixes #9373) (#9819) (Teddy Katz) +* add1e70 Update: fix indent bug on comments in ternary expressions (fixes #9729) (#9818) (Teddy Katz) +* 6a5cd32 Fix: prefer-destructuring error with computed properties (fixes #9784) (#9817) (Teddy Katz) +* 601f851 Docs: Minor modification to code comments for clarity (#9821) (rgovind92) +* b9da067 Docs: fix misleading info about RuleTester column numbers (#9830) (Teddy Katz) +* 2cf4522 Update: Rename and deprecate object-property-newline option (#9570) (Jonathan Pool) +* acde640 Docs: Add ES 2018 to Configuring ESLint (#9829) (Kai Cataldo) +* ccfce15 Docs: Minor tweaks to working with rules page (#9824) (Kevin Partington) +* 54b329a Docs: fix substitution of {{ name }} (#9822) (Andres Kalle) + +v4.15.0 - January 6, 2018 + +* 6ab04b5 New: Add context.report({ messageId }) (fixes #6740) (#9165) (Jed Fox) +* fc7f404 Docs: add url to each of the rules (refs #6582) (#9788) (Patrick McElhaney) +* fc44da9 Docs: fix sort-imports rule block language (#9805) (ferhat elmas) +* 65f0176 New: CLIEngine#getRules() (refs #6582) (#9782) (Patrick McElhaney) +* c64195f Update: More detailed assert message for rule-tester (#9769) (Weijia Wang) +* 9fcfabf Fix: no-extra-parens false positive (fixes: #9755) (#9795) (Erin) +* 61e5fa0 Docs: Add table of contents to Node.js API docs (#9785) (Patrick McElhaney) +* 4c87f42 Fix: incorrect error messages of no-unused-vars (fixes #9774) (#9791) (akouryy) +* bbabf34 Update: add `ignoreComments` option to `indent` rule (fixes #9018) (#9752) (Kevin Partington) +* db431cb Docs: HTTP -> HTTPS (fixes #9768) (#9768) (Ronald Eddy Jr) +* cbf0fb9 Docs: describe how to feature-detect scopeManager/visitorKeys support (#9764) (Teddy Katz) +* f7dcb70 Docs: Add note about "patch release pending" label to maintainer guide (#9763) (Teddy Katz) + +v4.14.0 - December 23, 2017 + +* be2f57e Update: support separate requires in one-var. (fixes #6175) (#9441) (薛定谔的猫) +* 370d614 Docs: Fix typos (#9751) (Jed Fox) +* 8196c45 Chore: Reorganize CLI options and associated docs (#9758) (Kevin Partington) +* 75c7419 Update: Logical-and is counted in `complexity` rule (fixes #8535) (#9754) (Kevin Partington) +* eb4b1e0 Docs: reintroduce misspelling in `valid-typeof` example (#9753) (Teddy Katz) +* ae51eb2 New: Add allowImplicit option to array-callback-return (fixes #8539) (#9344) (James C. Davis) +* e9d5dfd Docs: improve no-extra-parens formatting (#9747) (Rich Trott) +* 37d066c Chore: Add unit tests for overrides glob matching. (#9744) (Robert Jackson) +* 805a94e Chore: Fix typo in CLIEngine test name (#9741) (@scriptdaemon) +* 1c2aafd Update: Improve parser integrations (fixes #8392) (#8755) (Toru Nagashima) +* 4ddc131 Upgrade: debug@^3.1.0 (#9731) (Kevin Partington) +* f252c19 Docs: Make the lint message `source` property a little more subtle (#9735) (Jed Fox) +* 5a5c23c Docs: fix the link to contributing page (#9727) (Victor Hom) +* f44ce11 Docs: change beginner to good first issue label text (#9726) (Victor Hom) +* 14baa2e Chore: improve arrow-body-style error message (refs #5498) (#9718) (Teddy Katz) +* f819920 Docs: fix typos (#9723) (Thomas Broadley) +* 43d4ba8 Fix: false positive on rule`lines-between-class-members` (fixes #9665) (#9680) (sakabar) + +v4.13.1 - December 11, 2017 + +* b72dc83 Fix: eol-last allow empty-string to always pass (refs #9534) (#9696) (Kevin Partington) +* d80aa7c Fix: camelcase destructure leading/trailing underscore (fixes #9700) (#9701) (Kevin Partington) +* d49d9d0 Docs: Add missing period to the README (#9702) (Kevin Partington) +* 4564fe0 Chore: no-invalid-meta crash if no export assignment (refs #9534) (#9698) (Kevin Partington) + +v4.13.0 - December 8, 2017 + +* 256481b Update: update handling of destructuring in camelcase (fixes #8511) (#9468) (Erin) +* d067ae1 Docs: Don’t use undocumented array-style configuration for max-len (#9690) (Jed Fox) +* 1ad3091 Chore: fix test-suite to work with node master (#9688) (Myles Borins) +* cdb1488 Docs: Adds an example with try/catch. (#9672) (Jaap Taal) + +v4.12.1 - November 30, 2017 + +* 1e362a0 Revert "Fix: Use XML 1.1 on XML formatters (fixes #9607) (#9608)" (#9667) (Kevin Partington) + +v4.12.0 - November 25, 2017 + +* 76dab18 Upgrade: doctrine@^2.0.2 (#9656) (Kevin Partington) +* 28c9c8e New: add a Linter#defineParser function (#9321) (Ives van Hoorne) +* 5619910 Update: Add autofix for `sort-vars` (#9496) (Trevin Hofmann) +* 71eedbf Update: add `beforeStatementContinuationChars` to semi (fixes #9521) (#9594) (Toru Nagashima) +* 4118f14 New: Adds implicit-arrow-linebreak rule (refs #9510) (#9629) (Sharmila Jesupaul) +* 208fb0f Fix: Use XML 1.1 on XML formatters (fixes #9607) (#9608) (Daniel Reigada) +* 6e04f14 Upgrade: `globals` to 11.0.1 (fixes #9614) (#9632) (Toru Nagashima) +* e13d439 Fix: space-in-parens crash (#9655) (Toru Nagashima) +* 92171cc Docs: Updating migration guide for single-line disable (#9385) (Justin Helmer) +* f39ffe7 Docs: remove extra punctuation from readme (#9640) (Teddy Katz) +* a015234 Fix: prefer-destructuring false positive on "super" (fixes #9625) (#9626) (Kei Ito) +* 0cf081e Update: add importNames option to no-restricted-imports (#9506) (Benjamin R Gibson) +* 332c214 Docs: Add @platinumazure to TSC (#9618) (Ilya Volodin) + +v4.11.0 - November 10, 2017 + +* d4557a6 Docs: disallow use of the comma operator using no-restricted-syntax (#9585) (薛定谔的猫) +* d602f9e Upgrade: espree v3.5.2 (#9611) (Kai Cataldo) +* 4def876 Chore: avoid handling rules instances in config-validator (#9364) (Teddy Katz) +* fe5ac7e Chore: fix incorrect comment in safe-emitter.js (#9605) (Teddy Katz) +* 6672fae Docs: Fixed a typo on lines-between-class-members doc (#9603) (Moinul Hossain) +* 980ecd3 Chore: Update copyright and license info (#9599) (薛定谔的猫) +* cc2c7c9 Build: use Node 8 in appveyor (#9595) (薛定谔的猫) +* 2542f04 Docs: Add missing options for `lines-around-comment` (#9589) (Clément Fiorio) +* b6a7490 Build: ensure fuzzer tests get run with `npm test` (#9590) (Teddy Katz) +* 1073bc5 Build: remove shelljs-nodecli (refs #9533) (#9588) (Teddy Katz) +* 7e3bf6a Fix: edge-cases of semi-style (#9560) (Toru Nagashima) +* e5a37ce Fix: object-curly-newline for flow code (#9458) (Tiddo Langerak) +* 9064b9c Chore: add equalTokens in ast-utils. (#9500) (薛定谔的猫) +* b7c5b19 Fix: Correct [object Object] output of error.data. (#9561) (Jonathan Pool) +* 51c8cf0 Docs: Disambiguate definition of Update tag (#9584) (Jonathan Pool) +* afc3c75 Docs: clarify what eslint-config-eslint is (#9582) (Teddy Katz) +* aedae9d Docs: fix spelling in valid-typeof example (#9574) (Maksim Degtyarev) +* 4c5aaf3 Docs: Fix typo in no-underscore-dangle rule (#9567) (Fabien Lucas) +* 3623600 Chore: upgrade ajv@5.3.0 (#9557) (薛定谔的猫) +* 1b606cd Chore: Remove an indirect dependency on jsonify (#9444) (Rouven Weßling) +* 4d7d7ab Update: Resolve npm installed formatters (#5900) (#9464) (Tom Erik Støwer) +* accc490 Fix: Files with no failures get "passing" testcase (#9547) (Samuel Levy) +* ab0f66d Docs: Add examples to better show rule coverage. (#9548) (Jonathan Pool) +* 88d2303 Chore: Add object-property-newline tests to increase coverage. (#9553) (Jonathan Pool) +* 7f37b1c Build: test Node 9 on Travis (#9556) (Teddy Katz) +* acccfbd Docs: Minor rephrase in `no-invalid-this`. (#9542) (Francisc) +* 8f9c0fe Docs: improve id-match usage advice (#9544) (Teddy Katz) +* a9606a3 Fix: invalid tests with super (fixes #9539) (#9545) (Teddy Katz) +* 8e1a095 Chore: enable a modified version of multiline-comment-style on codebase (#9452) (Teddy Katz) +* cb60285 Chore: remove commented test for HTML formatter (#9532) (Teddy Katz) +* 06b491e Docs: fix duplicate entries in changelog (#9530) (Teddy Katz) +* 2224733 Chore: use eslint-plugin-rulesdir instead of --rulesdir for self-linting (#9164) (Teddy Katz) +* 9cf4ebe Docs: add .md to link(for github users) (#9529) (薛定谔的猫) + +v4.10.0 - October 27, 2017 + +* bb6e60a Fix: Improve the doc for no-restricted-modules rule (fixes #9437) (#9495) (vibss2397) +* c529de9 Docs: Amend rule document to correct and complete it (refs #6251). (#9498) (Jonathan Pool) +* f9c6673 Chore: Add tests to cover array and object values and leading commas. (#9502) (Jonathan Pool) +* 9169258 Chore: remove `npm run check-commit` script (#9513) (Teddy Katz) +* 7d390b2 Docs: Revise contributor documentation on issue labels. (#9469) (Jonathan Pool) +* d80b9d0 Fix: no-var don't fix globals (fixes #9520) (#9525) (Toru Nagashima) +* b8aa071 Fix: allow linting the empty string from stdin (fixes #9515) (#9517) (Teddy Katz) +* 350a72c Chore: regex.test => string.startsWith (#9518) (薛定谔的猫) +* de0bef4 Chore: remove obsolete eslintbot templates (#9512) (Teddy Katz) +* 720b6d5 Docs: Update ISSUE_TEMPLATE.md (#9504) (薛定谔的猫) +* 2fa64b7 Fix: should not convert non-consecutive line comments to a single blo… (#9475) (薛定谔的猫) +* 9725146 Fix: multiline-comment-style fix produces invalid code (fixes #9461). (#9463) (薛定谔的猫) +* b12cff8 Fix: Expected order of jsdoc tags (fixes #9412) (#9451) (Orlando Wenzinger) +* f054ab5 Docs: add `.md` to link (for github users) (#9501) (薛定谔的猫) +* 5ed9cfc Docs: Correct violations of “Variable Declarations” in Code Conventions (#9447) (Jonathan Pool) +* 3171097 Docs: Clears confusion on usage of global and local plugins.(#9492) (Vasili Sviridov) +* 3204773 Chore: enable max-len. (#9414) (薛定谔的猫) +* 0f71fef Docs: Unquote booleans in lines-between-class-members docs (#9497) (Brandon Mills) +* b3d7532 Docs: use consistent terminology & fix link etc. (#9490) (薛定谔的猫) +* 87db8ae Docs: Fix broken links (#9488) (gpiress) +* 51bdb2f Docs: Incorrect link to related rule (#9477) (Gavin King) +* 1a962e8 Docs: Add FAQ for when ESLint cannot find plugin (#9467) (Kevin Partington) +* 8768b2d Fix: multiline-comment-style autofixer added trailing space (#9454) (Teddy Katz) +* e830aa1 Fix: multiline-comment-style reports block comments followed by code (#9450) (Teddy Katz) +* b12e5fe Docs: Repair broken links and add migration links. (#9473) (Jonathan Pool) +* eca01ed Docs: Add missing info about special status of home-dir config files. (#9472) (Jonathan Pool) +* eb8cfb1 Fix: change err report in constant condition (fixes #9398) (#9436) (Victor Hom) +* da77eb4 Chore: Revise no-config-file test to prevent false failure. (#9443) (Jonathan Pool) +* 47e5f6f Docs: ensure "good commit message" examples actually follow guidelines (#9466) (Teddy Katz) +* ebb530d Update: Don't ignore comments (no-trailing-spaces) (#9416) (Chris van Marle) +* 5012661 Build: fix `npm run profile` script (fixes #9397) (#9455) (Teddy Katz) +* ecac0fd Docs: Remove blockBindings references (#9446) (Jan Pilzer) +* 0b89865 Chore: ensure tests for internal rules get run (#9453) (Teddy Katz) +* 052c504 Docs: suggest deleting branches after merging PRs (#9449) (Teddy Katz) +* b31e55a Chore: move internal rules out of lib/ (#9448) (Teddy Katz) +* a7521e3 Docs: improve examples for multiline-comment-style (#9440) (Teddy Katz) + +v4.9.0 - October 14, 2017 + +* 85388fb Fix: Correct error and test messages to fit config search path (#9428) (Jonathan Pool) +* 62a323c Fix: Add class options for `lines-around-comment` (fixes #8564) (#8565) (Ed Lee) +* 8eb4aae New: multiline-comment-style rule (fixes #8320) (#9389) (薛定谔的猫) +* db41408 Chore: avoid applying eslint-env comments twice (#9278) (Teddy Katz) +* febb897 Chore: avoid loose equality assertions (#9415) (Teddy Katz) +* 2247efa Update: Add FunctionExpression to require-jsdoc (fixes #5867) (#9395) (Kai Cataldo) +* 6791d18 Docs: Corrected noun to verb. (#9438) (Jonathan Pool) +* b02fbb6 Update: custom messages for no-restricted-* (refs #8400) (Maja Wichrowska) +* 02732bd Docs: Reorganized to avoid misunderstandings. (#9434) (Jonathan Pool) +* d9466b8 Docs: Correct time forecast for tests. (#9432) (Jonathan Pool) +* f7ed84f Docs: Add instruction re home-directory config files (refs #7729) (#9426) (Jonathan Pool) +* 30d018b Chore: Add Aladdin-ADD & VictorHom to README (#9424) (Kai Cataldo) +* 2d8a303 Docs: fix examples for prefer-numeric-literals (#9155) (Lutz Lengemann) +* d7610f5 Docs: Add jquery warning to prefer-destructuring (#9409) (Thomas Grainger) +* e835dd1 Docs: clarify no-mixed-operators (fixes #8051) (Ruxandra Fediuc) +* 51360c8 Docs: update block-spacing details (fixes #8743) (#9375) (Victor Hom) +* 6767857 Update: fix ignored nodes in indent rule when using tabs (fixes #9392) (#9393) (Robin Houston) +* 37dde77 Chore: Refactor SourceCode#getJSDocComment (#9403) (Kai Cataldo) +* 9fedd51 Chore: Add missing space in blog post template (#9407) (Kevin Partington) +* 7654c99 Docs: add installing prerequisites in readme. (#9401) (薛定谔的猫) +* 786cc73 Update: Add "consistent" option to array-bracket-newline (fixes #9136) (#9206) (Ethan Rutherford) +* e171f6b Docs: add installing prerequisites. (#9394) (薛定谔的猫) +* 74dfc87 Docs: update doc for class-methods-use-this (fixes #8910) (#9374) (Victor Hom) +* b4a9dbf Docs: show console call with no-restricted-syntax (fixes #7806) (#9376) (Victor Hom) +* 8da525f Fix: recognise multiline comments as multiline arrays (fixes #9211) (#9369) (Phil Quinn) +* c581b77 Chore: Error => TypeError (#9390) (薛定谔的猫) +* ee99876 New: lines-between-class-members rule (fixes #5949) (#9141) (薛定谔的猫) +* 9d3f5ad Chore: report unused eslint-disable directives in ESLint codebase (#9371) (Teddy Katz) +* 1167638 Update: add allowElseIf option to no-else-return (fixes #9228) (#9229) (Thomas Grainger) +* 4567ab1 New: Add the fix-dry-run flag (fixes #9076) (#9073) (Rafał Ruciński) + +v4.8.0 - September 29, 2017 + +* 3f2b908 New: add option to report unused eslint-disable directives (fixes #9249) (#9250) (Teddy Katz) +* ff2be59 Fix: dot notation rule failing to catch string template (fixes #9350) (#9357) (Phil Quinn) +* b1372da Chore: remove sourceCode property from Linter (refs #9161) (#9363) (Teddy Katz) +* cef6f8c Docs: remove line about removing rules from semver policy (#9367) (Teddy Katz) +* 06efe87 Fix: Add meta element with charset attribute. (#9365) (H1Gdev) +* 458ca67 Docs: update architecture page (fixes #9337) (#9345) (Victor Hom) +* 1c6bc67 Fix: special EventEmitter keys leak information about other rules (#9328) (Teddy Katz) +* d593e61 Docs: update eslint.org links to use https (#9358) (Teddy Katz) +* 38d0cb2 Fix: fix wrong code-path about try-for-in (fixes #8848) (#9348) (Toru Nagashima) +* 434d9e2 Fix: Invalid font-size property value issue. (#9341) (H1Gdev) +* a7668c2 Chore: Remove unnecessary slice from logging utility (#9343) (Gyandeep Singh) +* 2ff6fb6 Chore: remove unused arguments in codebase (#9340) (Teddy Katz) + +v4.7.2 - September 21, 2017 + +* 4f87732 Fix: Revert setting node.parent early (fixes #9331) (#9336) (Teddy Katz) + +v4.7.1 - September 18, 2017 + +* 08656db Fix: Handle nested disable directive correctly (fixes #9318) (#9322) (Gyandeep Singh) +* 9226495 Revert "Chore: rewrite parseListConfig for a small perf gain." (#9325) (薛定谔的猫) + +v4.7.0 - September 15, 2017 + +* 787b78b Upgrade: Espree v3.5.1 (fixes #9153) (#9314) (Brandon Mills) +* 1488b51 Update: run rules after `node.parent` is already set (fixes #9122) (#9283) (Teddy Katz) +* 4431d68 Docs: fix wrong config in max-len example. (#9309) (薛定谔的猫) +* 7d24dde Docs: Fix code snippet to refer to the correct option (#9313) (Ruben Tytgat) +* 12388d4 Chore: rewrite parseListConfig for a small perf gain. (#9300) (薛定谔的猫) +* ce1f084 Update: fix MemberExpression handling in no-extra-parens (fixes #9156) (jackyho112) +* 0c720a3 Update: allow autofixing when using processors (fixes #7510) (#9090) (Teddy Katz) +* 838df76 Chore: upgrade deps. (#9289) (薛定谔的猫) +* f12def6 Update: indent flatTernary option to handle `return` (fixes #9285) (#9296) (Teddy Katz) +* e220687 Fix: remove autofix for var undef inits (fixes #9231) (#9288) (Victor Hom) +* 002e199 Docs: fix no-restricted-globals wrong config. (#9305) (薛定谔的猫) +* fcfe91a Docs: fix wrong config in id-length example. (#9303) (薛定谔的猫) +* 2731f94 Update: make newline-per-chained-call fixable (#9149) (João Granado) +* 61f1093 Chore: avoid monkeypatching Linter instances in RuleTester (#9276) (Teddy Katz) +* 28929cb Chore: remove Linter#reset (refs #9161) (#9268) (Teddy Katz) +* abc8634 Build: re-run browserify when generating site (#9275) (Teddy Katz) +* 7685fed Fix: IIFE and arrow functions in no-invalid-this (fixes #9126) (#9258) (Toru Nagashima) +* 2b1eba2 Chore: enable eslint-plugin/no-deprecated-context-methods (#9279) (Teddy Katz) +* 981f933 Fix: reuse the AST of source code object in verify (#9256) (Toru Nagashima) +* cd698ba Docs: move RuleTester documentation to Node.js API page (#9273) (Teddy Katz) +* 4ae7ad3 Docs: fix inaccuracy in `npm run perf` description (#9274) (Teddy Katz) +* cad45bd Docs: improve documentation for rule contexts (#9272) (Teddy Katz) +* 3b0c6fd Chore: remove extraneous linter properties (refs #9161) (#9267) (Teddy Katz) +* c3231b3 Docs: Fix typo in array-bracket-newline.md (#9269) (宋文强) +* 51132d6 Fix: Formatters keep trailing '.' if preceded by a space (fixes #9154) (#9247) (i-ron-y) +* 88d5d4d Chore: remove undocumented Linter#markVariableAsUsed method (refs #9161) (#9266) (Teddy Katz) +* 09414cf Chore: remove internal Linter#getDeclaredVariables method (refs #9161) (#9264) (Teddy Katz) +* f31f59d Chore: prefer smaller scope for variables in codebase (#9265) (Teddy Katz) +* 3693e4e Chore: remove undocumented Linter#getScope method (#9253) (Teddy Katz) +* 5d7eb81 Chore: refactor config hash caching in CLIEngine (#9260) (Teddy Katz) +* 1a76c4d Chore: remove SourceCode passthroughs from Linter.prototype (refs #9161) (#9263) (Teddy Katz) +* 40ae27b Chore: avoid relying on Linter#getScope/markVariableAsUsed in tests (#9252) (Teddy Katz) +* b383d81 Chore: make executeOnFile a pure function in CLIEngine (#9262) (Teddy Katz) +* 5e0e579 Chore: avoid internal SourceCode methods in Linter tests (refs #9161) (#9223) (Teddy Katz) +* adab827 Chore: remove unused eslint-disable comment (#9251) (Teddy Katz) +* 31e4ec8 Chore: use consistent names for apply-disable-directives in tests (#9246) (Teddy Katz) +* 7ba46e6 Fix: shebang error in eslint-disable-new-line; add tests (fixes #9238) (#9240) (i-ron-y) +* 8f6546c Chore: remove undocumented defaults() method (refs #9161) (#9237) (Teddy Katz) +* 82d8b73 Docs: Fix error in example code for sort-imports (fixes #8734) (#9245) (i-ron-y) +* a32ec36 Update: refactor eslint-disable comment processing (#9216) (Teddy Katz) +* 583f0b8 Chore: avoid using globals in CLIEngine tests (#9242) (Teddy Katz) +* c8bf687 Chore: upgrade eslint-plugin-eslint-plugin@1.0.0 (#9234) (薛定谔的猫) +* 3c41a05 Chore: always normalize rules to new API in rules.js (#9236) (Teddy Katz) +* c5f4227 Chore: move logic for handling missing rules to rules.js (#9235) (Teddy Katz) +* bf1e344 Chore: create report translators lazily (#9221) (Teddy Katz) +* 2eedc1f Chore: remove currentFilename prop from Linter instances (refs #9161) (#9219) (Teddy Katz) +* 5566e94 Docs: Replace misleading CLA links (#9133) (#9232) (i-ron-y) +* c991630 Chore: remove ConfigOps.normalize in favor of ConfigOps.getRuleSeverity (#9224) (Teddy Katz) +* 171962a Chore: remove internal Linter#getAncestors helper (refs #9161) (#9222) (Teddy Katz) +* a567499 Chore: avoid storing list of problems on Linter instance (refs #9161) (#9214) (Teddy Katz) +* ed6d088 Chore: avoid relying on undocumented Linter#getFilename API in tests (#9218) (Teddy Katz) + +v4.6.1 - September 3, 2017 + +* bdec46d Build: avoid process leak when generating website (#9217) (Teddy Katz) +* cb74b87 Fix: avoid adding globals when an env is used with `false` (fixes #9202) (#9203) (Teddy Katz) +* f9b7544 Docs: Correct a typo in generator-star-spacing documentation (#9205) (Ethan Rutherford) +* e5c5e83 Build: Fixing issue with docs generation (Fixes #9199) (#9200) (Ilya Volodin) + +v4.6.0 - September 1, 2017 + +* 56dd769 Docs: fix link format in prefer-arrow-callback.md (#9198) (Vse Mozhet Byt) +* 6becf91 Update: add eslint version to error output. (fixes #9037) (#9071) (薛定谔的猫) +* 0e09973 New: function-paren-newline rule (fixes #6074) (#8102) (Teddy Katz) +* 88a64cc Chore: Make parseJsonConfig() a pure function in Linter (#9186) (Teddy Katz) +* 1bbac51 Fix: avoid breaking eslint-plugin-eslint-comments (fixes #9193) (#9196) (Teddy Katz) +* 3e8b70a Fix: off-by-one error in eslint-disable comment checking (#9195) (Teddy Katz) +* 73815f6 Docs: rewrite prefer-arrow-callback documentation (fixes #8950) (#9077) (Charles E. Morgan) +* 0d3a854 Chore: avoid mutating report descriptors in report-translator (#9189) (Teddy Katz) +* 2db356b Update: no-unused-vars Improve message to include the allowed patterns (#9176) (Eli White) +* 8fbaf0a Update: Add configurability to generator-star-spacing (#8985) (Ethan Rutherford) +* 8ed779c Chore: remove currentScopes property from Linter instances (refs #9161) (#9187) (Teddy Katz) +* af4ad60 Fix: Handle error when running init without npm (#9169) (Gabriel Aumala) +* 4b94c6c Chore: make parse() a pure function in Linter (refs #9161) (#9183) (Teddy Katz) +* 1be5634 Chore: don't make Linter a subclass of EventEmitter (refs #9161) (#9177) (Teddy Katz) +* e95af9b Chore: don't include internal test helpers in npm package (#9160) (Teddy Katz) +* 6fb32e1 Chore: avoid using private Linter APIs in astUtils tests (refs #9161) (#9173) (Teddy Katz) +* de6dccd Docs: add documentation for Linter methods (refs #6525) (#9151) (Teddy Katz) +* 2d90030 Chore: remove unused assignment. (#9182) (薛定谔的猫) +* d672aef Chore: refactor reporting logic (refs #9161) (#9168) (Teddy Katz) +* 5ab0434 Fix: indent crash on sparse arrays with "off" option (fixes #9157) (#9166) (Teddy Katz) +* c147b97 Chore: Make SourceCodeFixer accept text instead of a SourceCode instance (#9178) (Teddy Katz) +* f127423 Chore: avoid using private Linter APIs in Linter tests (refs #9161) (#9175) (Teddy Katz) +* 2334335 Chore: avoid using private Linter APIs in SourceCode tests (refs #9161) (#9174) (Teddy Katz) +* 2dc243a Chore: avoid using internal Linter APIs in RuleTester (refs #9161) (#9172) (Teddy Katz) +* d6e436f Fix: no-extra-parens reported some parenthesized IIFEs (fixes #9140) (#9158) (Teddy Katz) +* e6b115c Build: Add an edit link to the rule docs’ metadata (#9049) (Jed Fox) +* fcb7bb4 Chore: avoid unnecessarily complex forEach calls in no-extra-parens (#9159) (Teddy Katz) +* ffa021e Docs: quotes rule - when does \n require backticks (#9135) (avimar) +* 60c5148 Chore: improve coverage in lib/*.js (#9130) (Teddy Katz) + +v4.5.0 - August 18, 2017 + +* decdd2c Update: allow arbitrary nodes to be ignored in `indent` (fixes #8594) (#9105) (Teddy Katz) +* 79062f3 Update: fix indentation of multiline `new.target` expressions (#9116) (Teddy Katz) +* d00e24f Upgrade: `chalk` to 2.x release (#9115) (Stephen Edgar) +* 6ef734a Docs: add missing word in processor documentation (#9106) (Teddy Katz) +* a4f53ba Fix: Include files with no messages in junit results (#9093) (#9094) (Sean DuBois) +* 1d6a9c0 Chore: enable eslint-plugin/test-case-shorthand-strings (#9067) (薛定谔的猫) +* f8add8f Fix: don't autofix with linter.verifyAndFix when `fix: false` is used (#9098) (Teddy Katz) +* 77bcee4 Docs: update instructions for adding TSC members (#9086) (Teddy Katz) +* bd09cd5 Update: avoid requiring NaN spaces of indentation (fixes #9083) (#9085) (Teddy Katz) +* c93a853 Chore: Remove extra space in blogpost template (#9088) (Kai Cataldo) + +v4.4.1 - August 7, 2017 + +* ec93614 Fix: no-multi-spaces to avoid reporting consecutive tabs (fixes #9079) (#9087) (Teddy Katz) + +v4.4.0 - August 5, 2017 + +* 89196fd Upgrade: Espree to 3.5.0 (#9074) (Gyandeep Singh) +* b3e4598 Fix: clarify AST and don't use `node.start`/`node.end` (fixes #8956) (#8984) (Toru Nagashima) +* 62911e4 Update: Add ImportDeclaration option to indent rule (#8955) (David Irvine) +* de75f9b Chore: enable object-curly-newline & object-property-newline.(fixes #9042) (#9068) (薛定谔的猫) +* 5ae8458 Docs: fix typo in object-shorthand.md (#9066) (Jon Berry) +* c3d5b39 Docs: clarify options descriptions (fixes #8875) (#9060) (Brandon Mailhiot) +* 37158c5 Docs: clarified behavior of globalReturn option (fixes #8953) (#9058) (Brandon Mailhiot) +* c2f3553 Docs: Update example for MemberExpression option of indent (fixes #9056) (#9057) (Jeff) +* 78a85e0 Fix: no-extra-parens incorrectly reports async function expressions (#9035) (薛定谔的猫) +* c794f86 Fix: getter-return reporting method named 'get' (fixes #8919) (#9004) (薛定谔的猫) +* d0f78ec Docs: update rule deprecation policy (fixes #8635) (#9033) (Teddy Katz) +* 5ab282f Fix: Print error message in bin/eslint.js (fixes #9011) (#9041) (Victor Hom) +* 50e3cf3 Docs: Update sort-keys doc to define natural ordering (fixes #9043) (#9045) (Karan Sharma) +* 7ecfe6a Chore: enable eslint-plugin/test-case-property-ordering (#9040) (薛定谔的猫) +* ad32697 Upgrade: js-yaml to 3.9.1 (refs #9011) (#9044) (Teddy Katz) +* 66c1d43 Docs: Create SUPPORT.md (#9031) (Teddy Katz) +* 7247b6c Update: handle indentation of custom destructuring syntax (fixes #8990) (#9027) (Teddy Katz) +* cdb82f2 Fix: padding-line-between-statements crash on semicolons after blocks (#8748) (Alexander Madyankin) +* 3141872 Chore: remove unnecessary eslint-disable comments in codebase (#9032) (Teddy Katz) +* 0f97279 Fix: refactor no-multi-spaces to avoid regex backtracking (fixes #9001) (#9008) (Teddy Katz) +* b74514d Fix: refactor RuleContext to not modify report locations (fixes #8980) (#8997) (Teddy Katz) +* 31d7fd2 Fix: inconsistent `indent` behavior on computed properties (fixes #8989) (#8999) (Teddy Katz) +* 3393894 Fix: avoid reporting the entire AST for missing rules (#8998) (Teddy Katz) +* b3b95b8 Chore: enable additional rules on ESLint codebase (#9013) (Teddy Katz) +* 9b6c552 Upgrade: eslint-plugin-eslint-plugin@0.8.0 (#9012) (薛定谔的猫) +* acbe86a Chore: disallow .substr and .substring in favor of .slice (#9010) (Teddy Katz) +* d0536d6 Chore: Optimizes adding Linter methods (fixes #9000) (#9007) (Sean C Denison) +* 0a0401f Chore: fix spelling error. (#9003) (薛定谔的猫) +* 3d020b9 Update: emit a warning for ecmaFeatures rather than throwing an error (#8974) (Teddy Katz) +* d2f8f9f Fix: include name of invalid config in validation messages (fixes #8963) (#8973) (Teddy Katz) +* c3ee46b Chore: fix misleading comment in RuleTester (#8995) (Teddy Katz) + +v4.3.0 - July 21, 2017 + +* 91dccdf Update: support more options in prefer-destructuring (#8796) (Victor Hom) +* 3bebcfd Update: Support generator yields in no constant condition (#8762) (Victor Hom) +* 96df8c9 Fix: Handle fixing objects containing comments (fixes #8484) (#8944) (Brian Schemp) +* e39d41d Docs: Make `peerDependencies` package.json snippet valid JSON (#8971) (Sam Adams) +* a5fd101 Fix: duplicated error message if a crash occurs (fixes #8964) (#8965) (Teddy Katz) +* f8d122c Docs: trailing commas not allowed in json (#8969) (Scott Fletcher) +* d09288a Chore: Use `output: null` to assert that a test case is not autofixed. (#8960) (薛定谔的猫) +* e639358 Update: add question to confirm downgrade (fixes #8870) (#8911) (Toru Nagashima) +* 601039d Docs: fix badge in eslint-config-eslint readme (#8954) (Teddy Katz) +* 3c231fa Update: add enforceInMethodNames to no-underscore-dangle (fixes #7065) (#7234) (Gabriele Petronella) +* 128591f Update: prefer-numeric-literals warns Number.parseInt (fixes #8913) (#8929) (Kevin Partington) +* 846f8b1 Docs: Clarified that core PRs require issue in maintainer guide (#8927) (Kevin Partington) +* 55bc35d Fix: Avoid shell mangling during eslint --init (#8936) (Anders Kaseorg) +* 10c3d78 Chore: fix misleading `indent` test (#8925) (Teddy Katz) +* fb8005d Update: no-restricted-globals custom error messages (fixes #8315) (#8932) (Kevin Partington) +* a747b6f Chore: make minor improvements to `indent` internals (#8947) (Teddy Katz) +* 1ea3723 Update: fix indentation of parenthesized MemberExpressions (fixes #8924) (#8928) (Teddy Katz) +* 9abc6f7 Update: fix BinaryExpression indentation edge case (fixes #8914) (#8930) (Teddy Katz) +* 0e90453 Docs: Fixing broken cyclomatic complexity link (fixes #8396) (#8937) (Chris Bargren) +* a8a8350 Chore: improve performance of `indent` rule (#8905) (Teddy Katz) +* 764b2a9 Chore: update header info in `indent` (#8926) (Teddy Katz) +* 597c217 Fix: confusing error if plugins from config is not an array (#8888) (Calvin Freitas) +* 3c1dd6d Docs: add description of no-sync `allowAtRootLevel` option (fixes #8902) (#8906) (Teddy Katz) +* 933a9cf Chore: add a fuzzer to detect bugs in core rules (#8422) (Teddy Katz) +* 45f8cd9 Docs: fix verifyAndFix result property name (#8903) (Tino Vyatkin) +* 1a89e1c Docs: Fix always-multiline example in multiline-ternary docs (#8904) (Nathan Woltman) + +v4.2.0 - July 8, 2017 + +* e0f0101 Update: fix indentation of nested function parameters (fixes #8892) (#8900) (Teddy Katz) +* 9f95a3e Chore: remove unused helper method from `indent` (#8901) (Teddy Katz) +* 11ffe6b Fix: no-regex-spaces rule incorrectly fixes quantified spaces (#8773) (Keri Warr) +* 975dacf Update: fix indentation of EmptyStatements (fixes #8882) (#8885) (Teddy Katz) +* 88ed041 Build: Turnoff CI branch build (fixes #8804) (#8873) (Gyandeep Singh) +* 72f22eb Chore: replace is-my-json-valid with Ajv (#8852) (Gajus Kuizinas) +* 7c8de92 Docs: Clarified PR guidelines in maintainer guide (#8876) (Kevin Partington) +* d1fc408 Docs: Update CLA link in Contributing docs (#8883) (Calvin Freitas) +* 931a9f1 Fix: indent false positive with multi-line await expression (#8837) (薛定谔的猫) +* 3767cda Update: add no-sync option to allow at root level (fixes #7985) (#8859) (Victor Hom) +* 1ce553d Docs: Fix wording of minProperties in object-curly-newline (fixes #8874) (#8878) (solmsted) +* f00854e Fix: --quiet no longer fixes warnings (fixes #8675) (#8858) (Kevin Partington) +* b678535 Chore: Add collapsible block for config in ISSUE_TEMPLATE (#8872) (Gyandeep Singh) +* 1f5bfc2 Update: Add always-multiline option to multiline-ternary (fixes #8770) (#8841) (Nathan Woltman) +* 22116f2 Fix: correct comma-dangle JSON schema (#8864) (Evgeny Poberezkin) +* 676af9e Update: fix indentation of JSXExpressionContainer contents (fixes #8832) (#8850) (Teddy Katz) +* 330dd58 Chore: fix title of linter test suite (#8861) (Teddy Katz) +* 60099ed Chore: enable for-direction rule on ESLint codebase (#8853) (薛定谔的猫) +* e0d1a84 Chore: upgrade eslint-plugin-eslint-plugin & eslint-plugin-node (#8856) (薛定谔的猫) +* 0780d86 Chore: remove identical tests (#8851) (Teddy Katz) +* 5c3ac8e Fix: arrow-parens fixer gets tripped up with trailing comma in args (#8838) (薛定谔的猫) +* c4f2e29 Build: fix race condition in demo (#8827) (Teddy Katz) +* c693be5 New: Allow passing a function as `fix` option (fixes #8039) (#8730) (Ian VanSchooten) +* 8796d55 Docs: add missing item to 4.0 migration guide table of contents (#8835) (薛定谔的猫) +* 742998c doc md update: false -> `false` (#8825) (Erik Vold) +* ce969f9 Docs: add guidelines for patch release communication (fixes #7277) (#8823) (Teddy Katz) +* 5c83c99 Docs: Clarify arrow function parens in no-extra-parens (fixes #8741) (#8822) (Kevin Partington) +* 84d921d Docs: Added note about Node/CJS scoping to no-redeclare (fixes #8814) (#8820) (Kevin Partington) +* 85c9327 Update: fix parenthesized CallExpression indentation (fixes #8790) (#8802) (Teddy Katz) +* be8d354 Update: simplify variable declarator indent handling (fixes #8785) (#8801) (Teddy Katz) +* 9417818 Fix: no-debugger autofixer produced invalid syntax (#8806) (Teddy Katz) +* 8698a92 New: getter-return rule (fixes #8449) (#8460) (薛定谔的猫) +* eac06f2 Fix: no-extra-parens false positives for variables called "let" (#8808) (Teddy Katz) +* 616587f Fix: dot-notation autofix produces syntax errors for object called "let" (#8807) (Teddy Katz) +* a53ef7e Fix: don't require a third argument in linter.verifyAndFix (fixes #8805) (#8809) (Teddy Katz) +* 5ad8b70 Docs: add minor formatting improvement to paragraph about parsers (#8816) (Teddy Katz) + +v4.1.1 - June 25, 2017 + +* f307aa0 Fix: ensure configs from a plugin are cached separately (fixes #8792) (#8798) (Teddy Katz) +* 8b48ae8 Docs: Add doc on parser services (fixes #8390) (#8795) (Victor Hom) +* 0d041e7 Fix: avoid crashing when using baseConfig with extends (fixes #8791) (#8797) (Teddy Katz) +* 03213bb Chore: improve comment explanation of `indent` internal functions (#8800) (Teddy Katz) +* d2e88ed Chore: Fix misleading comment in ConfigCache.js (#8799) (Teddy Katz) + +v4.1.0 - June 23, 2017 + +* e8f1362 Docs: Remove wrong descriptions in `padded-block` rule (#8783) (Plusb Preco) +* 291a783 Update: `enforceForArrowConditionals` to `no-extra-parens` (fixes #6196) (#8439) (Evilebot Tnawi) +* a21dd32 New: Add `overrides`/`files` options for glob-based config (fixes #3611) (#8081) (Sylvan Mably) +* 879688c Update: Add ignoreComments option to no-trailing-spaces (#8061) (Jake Roussel) +* b58ae2e Chore: Only instantiate fileEntryCache when cache flage set (perf) (#8763) (Gyandeep Singh) +* 9851288 Update: fix indent errors on multiline destructure (fixes #8729) (#8756) (Victor Hom) +* 3608f06 Docs: Increase visibility of code of conduct (fixes #8758) (#8764) (Kai Cataldo) +* 673a58b Update: support multiple fixes in a report (fixes #7348) (#8101) (Toru Nagashima) +* 7a1bc38 Fix: don't pass default parserOptions to custom parsers (fixes #8744) (#8745) (Teddy Katz) +* c5b4052 Chore: enable computed-property-spacing on ESLint codebase (#8760) (Teddy Katz) +* 3419f64 Docs: describe how to use formatters on the formatter demo page (#8754) (Teddy Katz) +* a3ff8f2 Chore: combine tests in tests/lib/eslint.js and tests/lib/linter.js (#8746) (Teddy Katz) +* b7cc1e6 Fix: Space-infix-ops should ignore type annotations in TypeScript (#8341) (Reyad Attiyat) +* 46e73ee Fix: eslint --init installs wrong dependencies of popular styles (fixes #7338) (#8713) (Toru Nagashima) +* a82361b Chore: Prevent package-lock.json files from being created (fixes #8742) (#8747) (Teddy Katz) +* 5f81a68 New: Add eslintIgnore support to package.json (fixes #8458) (#8690) (Victor Hom) +* b5a70b4 Update: fix multiline binary operator/parentheses indentation (#8719) (Teddy Katz) +* ab8b016 Update: fix MemberExpression indentation with "off" option (fixes #8721) (#8724) (Teddy Katz) +* eb5d12c Update: Add Fixer method to Linter API (#8631) (Gyandeep Singh) +* 26a2daa Chore: Cache fs reads in ignored-paths (fixes #8363) (#8706) (Victor Hom) + +v4.0.0 - June 11, 2017 + +* 4aefb49 Chore: avoid using deprecated rules on ESLint codebase (#8708) (Teddy Katz) +* 389feba Chore: upgrade deps. (#8684) (薛定谔的猫) +* 3da7b5e Fix: Semi-Style only check for comments when tokens exist (fixes #8696) (#8697) (Reyad Attiyat) +* 3cfe9ee Fix: Add space between async and param on fix (fixes #8682) (#8693) (Reyad Attiyat) +* c702858 Chore: enable no-multiple-empty-lines on ESLint codebase (#8694) (Teddy Katz) +* 34c4020 Update: Add support for parens on left side for-loops (fixes: #8393) (#8679) (Victor Hom) +* 735cd09 Docs: Correct the comment in an example for `no-mixed-requires` (#8686) (Fangzhou Li) +* 026f048 Chore: remove dead code from prefer-const (#8683) (Teddy Katz) + +v4.0.0-rc.0 - June 2, 2017 + +* 0058b0f8 Update: add --fix to no-debugger (#8660) (薛定谔的猫) +* b4daa225 Docs: Note to --fix option for strict rule (#8680) (Vitaliy Potapov) +* 4df33e7c Chore: check for root:true in project sooner (fixes #8561) (#8638) (Victor Hom) +* c9b980ce Build: Add Node 8 on travis (#8669) (Gyandeep Singh) +* 95248336 Fix: Don't check object destructing in integer property (fixes #8654) (#8657) (flowmemo) +* c4ac969c Update: fix parenthesized ternary expression indentation (fixes #8637) (#8649) (Teddy Katz) +* 4f2f9fcb Build: update license checker to allow LGPL (fixes #8647) (#8652) (Teddy Katz) +* b0c83bd1 Docs: suggest pushing new commits to a PR instead of amending (#8632) (Teddy Katz) +* d0e9fd2d Fix: Config merge to correctly account for extends (fixes #8193) (#8636) (Gyandeep Singh) +* 705d88f7 Docs: Update CLA link on Pull Requests page (#8642) (Teddy Katz) +* 794d4d6c Docs: missing paren on readme (#8640) (Dan Beam) +* 7ebd9d6f New: array-element-newline rule (fixes #6075) (#8375) (Jan Peer Stöcklmair) +* f62cff66 Chore: Remove dependency to user-home (fixes #8604) (#8629) (Pavol Madar) +* 936bc174 Docs: Add missing documentation for scoped modules in sharable config developer-guide (#8610) (Jonathan Samines) + +v4.0.0-beta.0 - May 19, 2017 + +* 2f7015b6 New: semi-style rule (fixes #8169) (#8542) (Toru Nagashima) +* 1eaef580 Revert "Breaking: Traverse into type annotations (fixes #7129) (#8365)" (#8584) (Kai Cataldo) +* eb14584a Fix: no-unneeded-ternary change code behavior after fix (fixes #8507) (#8624) (Jan Peer Stöcklmair) +* 3ec436ee Breaking: New Linter API (fixes #8454) (#8465) (Gyandeep Singh) +* 3fc9653a Fix: Call expression consistency in variable declaration (fixes #8607) (#8619) (Reyad Attiyat) +* 5b6093ef Docs: Remove .eslintignore reference to transpiled file filtering (#8622) (Alex Summer) +* 729bbcdb Chore: Fix lgtm alerts. (#8611) (Max Schaefer) +* 3418479a Update: improve indent of `flatTernaryExpressions` (fixes #8481) (#8587) (Toru Nagashima) +* 268d52ef Update: Use sane defaults for JSX indentation (fixes #8425) (#8593) (Teddy Katz) +* d21f5283 Chore: make shelljs a devDependency instead of a dependency (#8608) (Teddy Katz) +* 11493781 Docs: Rephrase in about section (#8609) (Sudarsan G P) +* 23401626 Chore: remove strip-bom dependency (refs #8603) (#8606) (Teddy Katz) +* a93a2f95 New: padding-line-between-statements rule (fixes #7356) (#8099) (Toru Nagashima) +* 0ef09ea0 New: for-direction rule (fixes #8387) (#8519) (薛定谔的猫) +* a73e6c09 Fix: Fix failing uknown node test since #8569 indents class bodies (#8588) (Reyad Attiyat) +* c6c639d6 Fix: Ignore unknown nodes for Indent rule (fixes #8440) (#8504) (Reyad Attiyat) +* df17bc87 Fix: object-shorthand crash on some computed keys (fixes #8576) (#8577) (Teddy Katz) +* 482d5720 New: switch-colon-spacing rule (fixes #7981) (#8540) (Toru Nagashima) +* afa35c68 Update: check allman-style classes correctly in indent (fixes #8493) (#8569) (Teddy Katz) +* de0b4ad7 Fix: Indent Ignore Variable Declaration init operator (fixes #8546) (#8563) (Reyad Attiyat) +* 927ca0dc Fix: invalid syntax from prefer-arrow-callback autofixer (fixes #8541) (#8555) (Teddy Katz) +* 25db3d22 Chore: avoid skipping test for env overrides (refs #8291) (#8556) (Teddy Katz) +* 456f519b Update: make indent MemberExpression handling more robust (fixes #8552) (#8554) (Teddy Katz) +* 873310e5 Fix: run no-unexpected-multiline only if needed (fixes #8550) (#8551) (Ruben Bridgewater) +* 833a0cad Fix: confusing RuleTester error message when options is not an array (#8557) (Teddy Katz) + +v4.0.0-alpha.2 - May 5, 2017 + +* 74ab344 Update: check allman-style blocks correctly in indent rule (fixes #8493) (#8499) (Teddy Katz) +* f6256d4 Update: no-extend-native checks global scope refs only (fixes #8461) (#8528) (Kevin Partington) +* b463045 Docs: add typescript-eslint-parser (#8388) (#8534) (薛定谔的猫) +* 99c56d5 Update: handle multiline parents consistently in indent (fixes #8455) (#8498) (Teddy Katz) +* cf940c6 Update: indent `from` tokens in import statements (fixes #8438) (#8466) (Teddy Katz) +* 0a9a90f Fix: max-len doesn't allow comments longer than code (#8532) (Ken Gregory) +* 734846b Breaking: validate eslintrc properties (fixes #8213) (#8295) (alberto) +* 025e97a Chore: delete duplicated test. (#8527) (薛定谔的猫) +* 6a333ff Upgrade: espree@^3.4.2 (#8526) (Kevin Partington) +* e52d998 Docs: Configuring Cascading and Hierarchy example correction (#8512) (Cheong Yip) +* e135aa5 Docs: Correct code of conduct link on Readme.md (#8517) (Zander Mackie) +* 37e3ba1 Chore: Add license report and scan status (#8503) (Kevin Wang) +* afbea78 Chore: don't pull default options from eslint:recommended (fixes #8374) (#8381) (Teddy Katz) +* d49acc3 Update: fix no-self-compare false negative on non-literals (fixes #7677) (#8492) (Teddy Katz) +* aaa1a81 Fix: avoid creating extra whitespace in brace-style fixer (fixes #7621) (#8491) (Teddy Katz) +* 9c3da77 Docs: list another related rule in no-undefined (#8467) (Ethan) +* f987814 Docs: Update CHANGELOG.md for v4.0.0-alpha.1 release (#8488) (Kai Cataldo) + +v4.0.0-alpha.1 - April 21, 2017 + +* b0dadfe3 Docs: Update comments section of Migrating to v4.0.0 (#8486) (Kai Cataldo) +* b337738f Update: Add `consistent` option to `object-curly-newline` (fixes #6488) (#7720) (Evilebot Tnawi) +* 53fefb3b Update: add fix for no-confusing-arrow (#8347) (Mordy Tikotzky) +* 735d02d5 Update: Deprecate sourceCode.getComments() (fixes #8408) (#8434) (Kai Cataldo) +* ac39e3b0 Update: no-unexpected-multiline to flag confusing division (fixes #8469) (#8475) (Teddy Katz) +* e35107f0 Fix: indent crash on arrow functions without parens at start of line (#8477) (Teddy Katz) +* 973adeb6 Docs: State that functions option only applies in ES2017 (fixes #7809) (#8468) (Thenaesh Elango) +* 7bc6fe0a New: array-bracket-newline rule (#8314) (Jan Peer Stöcklmair) +* 10a1a2d7 Chore: Do not use cache when testing (#8464) (Kai Cataldo) +* 9f540fd2 Update: no-unused-vars false negative about destructuring (fixes #8442) (#8459) (Toru Nagashima) +* 741ed393 Docs: Clarify how to run local ESLint installation (#8463) (Kai Cataldo) +* fac53890 Breaking: Remove array-callback-return from recommended (fixes #8428) (#8433) (Kai Cataldo) +* 288c96c1 Upgrade: dependencies (#8304) (alberto) +* 48700fc8 Docs: Remove extra header line from LICENSE (#8448) (Teddy Katz) +* 161ee4ea Chore: avoid cloning comments array in TokenStore (#8436) (Teddy Katz) +* 0c2a386e Docs: clarify new indent behavior with MemberExpressions (#8432) (Teddy Katz) +* 446b8876 Docs: update space-before-function-paren docs for 4.0 (fixes #8430) (#8431) (Teddy Katz) + +v4.0.0-alpha.0 - April 7, 2017 + +* 950874f Docs: add 4.0.0 migration guide (fixes #8306) (#8313) (Teddy Katz) +* 2754141 Fix: more autofix token-combining bugs (#8394) (Teddy Katz) +* f5a7e42 Breaking: log number of fixable problems (fixes #7364) (#8324) (alberto) +* 769b121 Chore: Fix indentation errors in indent-legacy (#8424) (Kai Cataldo) +* 8394e48 Update: add deprecated indent-legacy rule as v3.x indent rule snapshot (#8286) (Teddy Katz) +* 3c87e85 Fix: no-multi-spaces false positive with irregular indent whitespace (#8412) (Teddy Katz) +* cc53481 Breaking: rewrite indent (fixes #1801, #3737, #3845, #6007, ...16 more) (#7618) (Teddy Katz) +* 867dd2e Breaking: Calculate leading/trailing comments in core (#7516) (Kai Cataldo) +* de9f1a0 Docs: ES6 syntax vs globals configuration (fixes #7984) (#8350) (Zander Mackie) +* 66af53e Breaking: Traverse into type annotations (fixes #7129) (#8365) (Kai Cataldo) +* 86cf3e4 New: no-buffer-constructor rule (fixes #5614) (#8413) (Teddy Katz) +* f560c06 Update: fix space-unary-ops behavior with postfix UpdateExpressions (#8391) (Teddy Katz) +* 936af66 Fix: no-multiple-empty-lines crash on space after last \n (fixes #8401) (#8402) (Teddy Katz) +* e395919 Breaking: Resolve patterns from .eslintignore directory (fixes #6759) (#7678) (Ian VanSchooten) +* c778676 Breaking: convert RuleTester to ES6 class (refs #8231) (#8263) (Teddy Katz) +* 6f7757e Breaking: convert SourceCode to ES6 class (refs #8231) (#8264) (Teddy Katz) +* 8842d7e Chore: fix comment spacing in tests (#8405) (Teddy Katz) +* 9a9d916 Breaking: update eslint:recommended for 4.0.0 (fixes #8236) (#8372) (Teddy Katz) +* b0c63f0 Breaking: infer endLine and endColumn from a reported node (fixes #8004) (#8234) (Teddy Katz) +* 40b8c69 Breaking: no-multi-spaces check around inline comments (fixes #7693) (#7696) (Kai Cataldo) +* 034a575 Breaking: convert CLIEngine to ES6 class (refs #8231) (#8262) (Teddy Katz) +* 7dd890d Breaking: tweak space-before-function-paren default option (fixes #8267) (#8285) (Teddy Katz) +* 0e0dd27 Breaking: Remove `ecmaFeatures` from `eslint:recommended` (#8239) (alberto) +* 2fa7502 Breaking: disallow scoped plugin references without scope (fixes #6362) (#8233) (Teddy Katz) +* 4673f6e Chore: Switch to eslint-scope from escope (#8280) (Corbin Uselton) +* e232464 Breaking: change defaults for padded-blocks (fixes #7879) (#8134) (alberto) + +v3.19.0 - March 31, 2017 + +* e09132f Fix: no-extra-parens false positive with exports and object literals (#8359) (Teddy Katz) +* 91baed4 Update: allow custom messages in no-restricted-syntax (fixes #8298) (#8357) (Vitor Balocco) +* 35c93e6 Fix: prevent space-before-function-paren from checking type annotations (#8349) (Teddy Katz) +* 3342e9f Fix: don't modify operator precedence in operator-assignment autofixer (#8358) (Teddy Katz) +* f88375f Docs: clarify that no-unsafe-negation is in eslint:recommended (#8371) (Teddy Katz) +* 02f0d27 Docs: Add soda0289 to Development Team (#8367) (Kai Cataldo) +* 155424c Fix: ignore empty path in patterns (fixes #8362) (#8364) (alberto) +* 27616a8 Fix: prefer-const false positive with object spread (fixes #8187) (#8297) (Vitor Balocco) +* 8569a90 Docs: add note about git's linebreak handling to linebreak-style docs (#8361) (Teddy Katz) +* 5878593 Chore: fix invalid syntax in no-param-reassign test (#8360) (Teddy Katz) +* 1b1046b Fix: don't classify plugins that throw errors as "missing" (fixes #6874) (#8323) (Teddy Katz) +* 29f4ba5 Fix: no-useless-computed-key invalid autofix for getters and setters (#8335) (Teddy Katz) +* 0541eaf Fix: no-implicit-coercion invalid autofix with consecutive identifiers (#8340) (Teddy Katz) +* 41b9786 Fix: no-extra-parens false positive with objects following arrows (#8339) (Teddy Katz) +* 3146167 Fix: `eslint.verify` should not mutate config argument (fixes #8329) (#8334) (alberto) +* 927de90 Fix: dot-notation autofix produces invalid syntax for integer properties (#8332) (Teddy Katz) +* a9d1bea Fix: comma-style autofix produces errors on parenthesized elements (#8331) (Teddy Katz) +* d52173f Fix: don't generate invalid options in config-rule (#8326) (Teddy Katz) +* 6eda3b5 Fix: no-extra-parens invalid autofix in for-of statements (#8337) (Teddy Katz) +* 6c819d8 Fix: dot-notation autofix produces errors on parenthesized computed keys (#8330) (Teddy Katz) +* 2d883d7 Fix: object-shorthand autofix produces errors on parenthesized functions (#8328) (Teddy Katz) +* cd9b774 Fix: quotes false positive with backtick option in method names (#8327) (Teddy Katz) +* d064ba2 Fix: no-else-return false positive for ifs in single-statement position (#8338) (Teddy Katz) +* 6a718ba Chore: enable max-statements-per-line on ESLint codebase (#8321) (Teddy Katz) +* 614b62e Chore: update sinon calls to deprecated API. (#8310) (alberto) +* 0491572 Chore: use precalculated counts in codeframe formatter (#8296) (Vitor Balocco) +* 8733e6a Chore: Fix incorrect error location properties in tests (#8307) (alberto) +* c4ffb49 Chore: Fix typos in test option assertions (#8305) (Teddy Katz) +* 79a97cb Upgrade: devDependencies (#8303) (alberto) +* e4da200 Upgrade: Mocha to 3.2.0 (#8299) (Ilya Volodin) +* 2f144ca Fix: operator-assignment autofix errors with parentheses (fixes #8293) (#8294) (Teddy Katz) +* 7521cd5 Chore: update token logic in rules to use ast-utils (#8288) (Teddy Katz) +* 9b509ce Chore: refactor space-before-function-paren rule (#8284) (Teddy Katz) +* ddc6350 Fix: no-param-reassign false positive on destructuring (fixes #8279) (#8281) (Teddy Katz) +* f8176b3 Chore: improve test coverage for node-event-generator (#8287) (Teddy Katz) +* 602e9c2 Docs: fix incorrect selector examples (#8278) (Teddy Katz) + +v3.18.0 - March 17, 2017 + +* 85f74ca Fix: broken code path of direct nested loops (fixes #8248) (#8274) (Toru Nagashima) +* a61c359 Fix: Ignore hidden folders when resolving globs (fixes #8259) (#8270) (Ian VanSchooten) +* 6f05546 Chore: convert StubModuleResolver in config tests to ES6 class (#8265) (Teddy Katz) +* 0c0fc31 Fix: false positive of no-extra-parens about spread and sequense (#8275) (Toru Nagashima) +* e104973 Docs: remove self-reference in no-restricted-syntax docs (#8277) (Vitor Balocco) +* 23eca51 Update: Add allowTaggedTemplates to no-unused-expressions (fixes #7632) (#8253) (Kevin Partington) +* f9ede3f Upgrade: doctrine to 2.0.0 (#8269) (alberto) +* 1b678a6 New: allow rules to listen for AST selectors (fixes #5407) (#7833) (Teddy Katz) +* 63ca0c5 Chore: use precalculated counts in stylish formatter (#8251) (alberto) +* 47c3171 Fix: typo in console.error (#8258) (Jan Peer Stöcklmair) +* e74ed6d Chore: convert Traverser to ES6 class (refs #7849) (#8232) (Teddy Katz) +* 13eead9 Fix: sort-vars crash on mixed destructuring declarations (#8245) (Teddy Katz) +* 133f489 Fix: func-name-matching crash on destructuring assignment to functions (#8247) (Teddy Katz) +* a34b9c4 Fix: func-name-matching crash on non-string literal computed keys (#8246) (Teddy Katz) +* 7276e6d Docs: remove unneeded semicolons in arrow-parens.md (#8249) (Dmitry Gershun) +* 8c40a25 concat-stream known to be vulnerable prior 1.5.2 (#8228) (Samuel) +* 149c055 Upgrade: mock-fs to v4.2.0 (fixes #8194) (#8243) (Teddy Katz) +* a83bff9 Build: remove unneeded json config in demo (fixes #8237) (#8242) (alberto) +* df12137 Docs: fix typos (#8235) (Gyandeep Singh) +* b5e9788 Chore: rename no-extra-parens methods (#8225) (Vitor Balocco) +* 7f8afe6 Update: no-extra-parens overlooked spread and superClass (fixes #8175) (#8209) (Toru Nagashima) +* ce6ff56 Docs: set recommended true for no-global-assign (fixes #8215) (#8218) (BinYi LIU) +* 5b5c236 Fix: wrong comment when module not found in config (fixes #8192) (#8196) (alberto) + +v3.17.1 - March 6, 2017 + +* f8c8e6e Build: change mock-fs path without SSH (fixes #8207) (#8208) (Toru Nagashima) +* f713f11 Fix: nonblock-statement-body-position multiline error (fixes #8202) (#8203) (Teddy Katz) +* 41e3d9c Fix: `operator-assignment` with parenthesized expression (fixes #8190) (#8197) (alberto) +* 5e3bca7 Chore: add eslint-plugin-eslint-plugin (#8198) (Teddy Katz) +* 580da36 Chore: add missing `output` property to tests (#8195) (alberto) + +v3.17.0 - March 3, 2017 + +* 4fdf6d7 Update: deprecate `applyDefaultPatterns` in `line-comment-position` (#8183) (alberto) +* 25e5817 Fix: Don't autofix `+ +a` to `++a` in space-unary-ops (#8176) (Alan Pierce) +* a6ce8f9 Build: Sort rules before dumping them to doc files (#8154) (Danny Andrews) +* 0af9057 Chore: Upgrade to a patched version of mock-fs (fixes #8177) (#8188) (Teddy Katz) +* bf4d8cf Update: ignore eslint comments in lines-arount-comment (fixes #4345) (#8155) (alberto) +* dad20ad New: add SourceCode#getLocFromIndex and #getIndexFromLoc (fixes #8073) (#8158) (Teddy Katz) +* 18a519f Update: let RuleTester cases assert that no autofix occurs (fixes #8157) (#8163) (Teddy Katz) +* a30eb8d Docs: improve documentation for RuleTester cases (#8162) (Teddy Katz) +* a78ec9f Chore: upgrade `coveralls` to ^2.11.16 (#8161) (alberto) +* d02bd11 Fix: padded-blocks autofix problems with comments (#8149) (alberto) +* 9994889 Docs: Add missing space to `create` in `no-use-before-define` (#8166) (Justin Anastos) +* 4d542ba Docs: Remove unneeded statement about autofix (#8164) (alberto) +* 20daea5 New: no-compare-neg-zero rule (#8091) (薛定谔的猫) +* 4d35a81 Fix: Add a utility to avoid autofix conflicts (fixes #7928, fixes #8026) (#8067) (Alan Pierce) +* 287e882 New: nonblock-statement-body-position rule (fixes #6067) (#8108) (Teddy Katz) +* 7f1f4e5 Chore: remove unneeded devDeps `linefix` and `gh-got` (#8160) (alberto) +* ca1694b Update: ignore negative ranges in fixes (#8133) (alberto) +* 163d751 Docs: `lines-around-comment` doesn't disallow empty lines (#8151) (alberto) +* 1c84922 Chore: upgrade eslint-plugin-node (#8156) (alberto) +* 1ee5c27 Fix: Make RuleTester handle empty-string cases gracefully (fixes #8142) (#8143) (Teddy Katz) +* 044bc10 Docs: Add details about "--fix" option for "sort-imports" rule (#8077) (Olivier Audard) +* 3fec54a Add option to ignore property in no-param-reassign (#8087) (Christian Bundy) +* 4e52cfc Fix: Improve keyword-spacing typescript support (fixes #8110) (#8111) (Reyad Attiyat) +* 7ff42e8 New: Allow regexes in RuleTester (fixes #7837) (#8115) (Daniel Lo Nigro) +* cbd7ded Build: display rules’ meta data in their docs (fixes #5774) (#8127) (Wilson Kurniawan) +* da8e8af Update: include function name in report message if possible (fixes #7260) (#8058) (Dieter Luypaert) +* 8f91e32 Fix: `ignoreRestSiblings` option didn't cover arguments (fixes #8119) (#8120) (Toru Nagashima) + +v3.16.1 - February 22, 2017 + +* ff8a80c Fix: duplicated autofix output for inverted fix ranges (fixes #8116) (#8117) (Teddy Katz) +* a421897 Docs: fix typo in arrow-parens.md (#8132) (Will Chen) +* 22d7fbf Chore: fix invalid redeclared variables in tests (#8130) (Teddy Katz) +* 8d95598 Chore: fix output assertion typos in rule tests (#8129) (Teddy Katz) +* 9fa2559 Docs: Add missing quotes in key-spacing rule (#8121) (Glenn Reyes) +* f3a6ced Build: package.json update for eslint-config-eslint release (ESLint Jenkins) + +v3.16.0 - February 20, 2017 + +* d89d0b4 Update: fix quotes false negative for string literals as template tags (#8107) (Teddy Katz) +* 21be366 Chore: Ensuring eslint:recommended rules are sorted. (#8106) (Kevin Partington) +* 360dbe4 Update: Improve error message when extend config missing (fixes #6115) (#8100) (alberto) +* f62a724 Chore: use updated token iterator methods (#8103) (Kai Cataldo) +* daf6f26 Fix: check output in RuleTester when errors is a number (fixes #7640) (#8097) (alberto) +* cfb65c5 Update: make no-lone-blocks report blocks in switch cases (fixes #8047) (#8062) (Teddy Katz) +* 290fb1f Update: Add includeComments to getTokenByRangeStart (fixes #8068) (#8069) (Kai Cataldo) +* ff066dc Chore: Incorrect source code test text (#8096) (Jack Ford) +* 14d146d Docs: Clarify --ext only works with directories (fixes #7939) (#8095) (alberto) +* 013a454 Docs: Add TSC meeting quorum requirement (#8086) (Kevin Partington) +* 7516303 Fix: `sourceCode.getTokenAfter` shouldn't skip tokens after comments (#8055) (Toru Nagashima) +* c53e034 Fix: unicode-bom fixer insert BOM in appropriate location (fixes #8083) (#8084) (pantosha) +* 55ac302 Chore: fix the timing to define rules for tests (#8082) (Toru Nagashima) +* c7e64f3 Upgrade: mock-fs (#8070) (Toru Nagashima) +* acc3301 Update: handle uncommon linebreaks consistently in rules (fixes #7949) (#8049) (Teddy Katz) +* 591b74a Chore: enable operator-linebreak on ESLint codebase (#8064) (Teddy Katz) +* 6445d2a Docs: Add documentation for /* exported */ (fixes #7998) (#8065) (Lee Yi Min) +* fcc38db Chore: simplify and improve performance for autofix (#8035) (Toru Nagashima) +* b04fde7 Chore: improve performance of SourceCode constructor (#8054) (Teddy Katz) +* 90fd555 Update: improve null detection in eqeqeq for ES6 regexes (fixes #8020) (#8042) (Teddy Katz) +* 16248e2 Fix: no-extra-boolean-cast incorrect Boolean() autofixing (fixes #7977) (#8037) (Jonathan Wilsson) +* 834f45d Update: rewrite TokenStore (fixes #7810) (#7936) (Toru Nagashima) +* 329dcdc Chore: unify checks for statement list parents (#8048) (Teddy Katz) +* c596690 Docs: Clarify generator-star-spacing config example (fixes #8027) (#8034) (Hòa Trần) +* a11d4a6 Docs: fix a typo in shareable configs documentation (#8036) (Dan Homola) +* 1e3d4c6 Update: add fixer for no-unused-labels (#7841) (Teddy Katz) +* f47fb98 Update: ensure semi-spacing checks import/export declarations (#8033) (Teddy Katz) +* e228d56 Update: no-undefined handles properties/classes/modules (fixes #7964) (#7966) (Kevin Partington) +* 7bc92d9 Chore: fix invalid test cases (#8030) (Toru Nagashima) + +v3.15.0 - February 3, 2017 + +* f2a3580 Fix: `no-extra-parens` incorrect precedence (fixes #7978) (#7999) (alberto) +* d6b6ba1 Fix: no-var should fix ForStatement.init (#7993) (Toru Nagashima) +* 99d386d Upgrade: Espree v3.4.0 (#8019) (Kai Cataldo) +* 42390fd Docs: update README.md for team (#8016) (Toru Nagashima) +* d7ffd88 Chore: enable template-tag-spacing on ESLint codebase (#8005) (Teddy Katz) +* f2be7e3 Docs: Fix typo in object-curly-newline.md (#8002) (Danny Andrews) +* df2351a Docs: Fix misleading section in brace-style documentation (#7996) (Teddy Katz) +* 5ae6e00 Chore: avoid unnecessary feature detection for Symbol (#7992) (Teddy Katz) +* 5d57c57 Chore: fix no-else-return lint error (refs #7986) (#7994) (Vitor Balocco) +* 62fb054 Chore: enable no-else-return on ESLint codebase (#7986) (Teddy Katz) +* c59a0ba Update: add ignoreRestSiblings option to no-unused-vars (#7968) (Zack Argyle) +* 5cdfa99 Chore: enable no-unneeded-ternary on ESLint codebase (#7987) (Teddy Katz) +* fbd7c13 Update: ensure operator-assignment handles exponentiation operators (#7970) (Teddy Katz) +* c5066ce Update: add "variables" option to no-use-before-define (fixes #7111) (#7948) (Teddy Katz) +* 09546a4 New: `template-tag-spacing` rule (fixes #7631) (#7913) (Jonathan Wilsson) + +v3.14.1 - January 25, 2017 + +* 791f32b Fix: brace-style false positive for keyword method names (fixes #7974) (#7980) (Teddy Katz) +* d7a0add Docs: Add ESLint tutorial embed to getting started (#7971) (Jamis Charles) +* 72d41f0 Fix: no-var autofix syntax error in single-line statements (fixes #7961) (#7962) (Teddy Katz) +* b9e5b68 Fix: indent rule crash on sparse array with object (fixes #7959) (#7960) (Gyandeep Singh) +* a7bd66a Chore: Adding assign/redeclare tests to no-undefined (refs #7964) (#7965) (Kevin Partington) +* 8bcbf5d Docs: typo in prefer-promise-reject-errors (#7958) (Patrick McElhaney) + +v3.14.0 - January 20, 2017 + +* 506324a Fix: `no-var` does not fix if causes ReferenceError (fixes #7950) (#7953) (Toru Nagashima) +* 05e7432 New: no-chained-assignments rule (fixes #6424) (#7904) (Stewart Rand) +* 243e47d Update: Add fixer for no-else-return (fixes #7863) (#7864) (Xander Dumaine) +* f091d95 New: `prefer-promise-reject-errors` rule (fixes #7685) (#7689) (Teddy Katz) +* ca01e00 Fix: recognize all line terminators in func-call-spacing (fixes #7923) (#7924) (Francesco Trotta) +* a664e8a Update: add ignoreJSX option to no-extra-parens (Fixes #7444) (#7926) (Robert Rossmann) +* 8ac3518 Fix: no-useless-computed-key false positive with `__proto__` (#7934) (Teddy Katz) +* c835e19 Docs: remove reference to deleted rule (#7942) (Alejandro Oviedo) +* 3c1e63b Docs: Improve examples for no-case-declarations (fixes #6716) (#7920) (Kevin Rangel) +* 7e04b33 Fix: Ignore inline plugin rule config in autoconfig (fixes #7860) (#7919) (Ian VanSchooten) +* 6448ba0 Fix: add parentheses in no-extra-boolean-cast autofixer (fixes #7912) (#7914) (Szymon Przybylski) +* b3f2094 Fix: brace-style crash with lone block statements (fixes #7908) (#7909) (Teddy Katz) +* 5eb2e88 Docs: Correct typos in configuring.md (#7916) (Gabriel Delépine) +* bd5e219 Update: ensure brace-style validates class bodies (fixes #7608) (#7871) (Teddy Katz) +* 427543a Fix: catastrophic backtracking in astUtils linebreak regex (fixes #7893) (#7898) (Teddy Katz) +* 995554c Fix: Correct typos in no-alert.md and lib/ast-utils.js (#7905) (Stewart Rand) +* d6150e3 Chore: Enable comma-dangle on ESLint codebase (fixes #7725) (#7906) (Teddy Katz) +* 075ec25 Chore: update to use ES6 classes (refs #7849) (#7891) (Claire Dranginis) +* 55f0cb6 Update: refactor brace-style and fix inconsistencies (fixes #7869) (#7870) (Teddy Katz) + +v3.13.1 - January 9, 2017 + +* 3fc4e3f Fix: prefer-destructuring reporting compound assignments (fixes #7881) (#7882) (Teddy Katz) +* f90462e Fix: no-extra-label autofix should not remove labels used elsewhere (#7885) (Teddy Katz) + +v3.13.0 - January 6, 2017 + +* cd4c025 Update: add fixer for no-extra-label (#7840) (Teddy Katz) +* aa75c92 Fix: Ensure prefer-const fixes destructuring assignments (fixes #7852) (#7859) (Teddy Katz) +* 4008022 Chore: Refactor to use ES6 Classes (Part 3)(refs #7849) (#7865) (Gyandeep Singh) +* c9ba40a Update: add fixer for `no-unneeded-ternary` (#7540) (Teddy Katz) +* dd56d87 Update: add object-shorthand option for arrow functions (fixes #7564) (#7746) (Teddy Katz) +* fbafdc0 Docs: `padded-blocks` `never` case (fixes #7868) (#7878) (alberto) +* ca1f841 Fix: no-useless-return stack overflow on loops after throw (fixes #7855) (#7856) (Teddy Katz) +* d80d994 Update: add fixer for object-property-newline (fixes #7740) (#7808) (Teddy Katz) +* bf3ea3a Fix: capitalized-comments: Ignore consec. comments if first is invalid (#7835) (Kevin Partington) +* 616611a Chore: Refactor to use ES6 Classes (Part 2)(refs #7849) (#7847) (Gyandeep Singh) +* 856084b Chore: Refactor to use ES6 Classes (Part 1)(refs #7849) (#7846) (Gyandeep Singh) +* bf45893 Docs: Clarify that we only support Stage 4 proposals (#7845) (Kevin Partington) +* 0fc24f7 Fix: adapt new-paren rule so it handles TypeScript (fixes #7817) (#7820) (Philipp A) +* df0b06b Fix: no-multiple-empty-lines perf issue on large files (fixes #7803) (#7843) (Teddy Katz) +* 18fa521 Chore: use ast-utils helper functions in no-multiple-empty-lines (#7842) (Teddy Katz) +* 7122205 Docs: Array destructuring example for no-unused-vars (fixes #7838) (#7839) (Remco Haszing) +* e21b36b Chore: add integration tests for cache files (refs #7748) (#7794) (Teddy Katz) +* 2322733 Fix: Throw error if ruletester is missing required test scenarios (#7388) (Teddy Katz) +* 1beecec Update: add fixer for `operator-linebreak` (#7702) (Teddy Katz) +* c5c3b21 Fix: no-implied-eval false positive on 'setTimeoutFoo' (fixes #7821) (#7836) (Teddy Katz) +* 00dd96c Chore: enable array-bracket-spacing on ESLint codebase (#7830) (Teddy Katz) +* ebcae1f Update: no-return-await with with complex `return` argument (fixes #7594) (#7595) (Dalton Santos) +* fd4cd3b Fix: Disable no-var autofixer in some incorrect cases in loops (#7811) (Alan Pierce) +* 1f25834 Docs: update outdated info in Architecture page (#7816) (Teddy Katz) +* f20b9e9 Fix: Relax no-useless-escape's handling of ']' in regexes (fixes #7789) (#7793) (Teddy Katz) +* 3004c1e Fix: consistent-return shouldn't report class constructors (fixes #7790) (#7797) (Teddy Katz) +* b938f1f Docs: Add an example for the spread operator to prefer-spread.md (#7802) (#7804) (butlermd) +* b8ce2dc Docs: Remove .html extensions from links in developer-guide (#7805) (Kevin Partington) +* aafebb2 Docs: Wrap placeholder sample in {% raw %} (#7798) (Daniel Lo Nigro) +* bb6b73b Chore: replace unnecessary function callbacks with arrow functions (#7795) (Teddy Katz) +* 428fbdf Fix: func-call-spacing "never" doesn't fix w/ line breaks (fixes #7787) (#7788) (Kevin Partington) +* 6e61070 Fix: `semi` false positive before regex/template literals (fixes #7782) (#7783) (Teddy Katz) +* ff0c050 Fix: remove internal property from config generation (fixes #7758) (#7761) (alberto) +* 27424cb New: `prefer-destructuring` rule (fixes #6053) (#7741) (Alex LaFroscia) +* bb648ce Docs: fix unclear example for no-useless-escape (#7781) (Teddy Katz) +* 8c3a962 Fix: syntax errors from object-shorthand autofix (fixes #7744) (#7745) (Teddy Katz) +* 8b296a2 Docs: fix in semi.md: correct instead of incorrect (#7779) (German Prostakov) +* 3493241 Upgrade: strip-json-comments ~v2.0.1 (Janus Troelsen) +* 75b7ba4 Chore: enable object-curly-spacing on ESLint codebase (refs #7725) (#7770) (Teddy Katz) +* 7d1dc7e Update: Make default-case comment case-insensitive (fixes #7673) (#7742) (Robert Rossmann) +* f1bf5ec Chore: convert remaining old-style context.report() calls to the new API (#7763) (Teddy Katz) + +v3.12.2 - December 14, 2016 + +* dec3ec6 Fix: indent bug with AssignmentExpressions (fixes #7747) (#7750) (Teddy Katz) +* 5344751 Build: Don't create blogpost links from rule names within other words (#7754) (Teddy Katz) +* 639b798 Docs: Use `Object.prototype` in examples (#7755) (Alex Reardon) + +v3.12.1 - December 12, 2016 + +* 0ad4d33 Fix: `indent` regression with function calls (fixes #7732, fixes #7733) (#7734) (Teddy Katz) +* ab246dd Docs: Rules restricting globals/properties/syntax are linked together (#7743) (Kevin Partington) +* df2f115 Docs: Add eslint-config-mdcs to JSCS Migration Guide (#7737) (Joshua Koo) +* 4b77333 Build: avoid creating broken rule links in the changelog (#7731) (Teddy Katz) + +v3.12.0 - December 9, 2016 + +* e569225 Update: fix false positive/negative of yoda rule (fixes #7676) (#7695) (Toru Nagashima) +* e95a230 Fix: indent "first" option false positive on nested arrays (fixes #7727) (#7728) (Teddy Katz) +* 81f9e7d Fix: Allow duplicated let declarations in `prefer-const` (fixes #7712) (#7717) (Teddy Katz) +* 1d0d61d New: Add no-await-in-loop rule (#7563) (Nat Mote) +* 2cdfb4e New: Additional APIs (fixes #6256) (#7669) (Ilya Volodin) +* 4278c42 Update: make no-obj-calls report errors for Reflect (fixes #7700) (#7710) (Tomas Echeverri Valencia) +* 4742d82 Docs: clarify the default behavior of `operator-linebreak` (fixes #7459) (#7726) (Teddy Katz) +* a8489e2 Chore: Avoid parserOptions boilerplate in tests for ES6 rules (#7724) (Teddy Katz) +* b921d1f Update: add `indent` options for array and object literals (fixes #7473) (#7681) (Teddy Katz) +* 7079c89 Update: Add airbnb-base to init styleguides (fixes #6986) (#7699) (alberto) +* 63bb3f8 Docs: improve the documentation for the autofix API (#7716) (Teddy Katz) +* f8786fb Update: add fixer for `capitalized-comments` (#7701) (Teddy Katz) +* abfd24f Fix: don't validate schemas for disabled rules (fixes #7690) (#7692) (Teddy Katz) +* 2ac07d8 Upgrade: Update globals dependency to 9.14.0 (#7683) (Aleksandr Oleynikov) +* 90a5d29 Docs: Remove incorrect info about issue requirements from PR guide (#7691) (Teddy Katz) +* f80c278 Docs: Add sails-hook-lint to integrations list (#7679) (Anthony M) +* e96da3f Docs: link first instance of `package.json` (#7684) (Kent C. Dodds) +* bf20e20 Build: include links to rule pages in release blogpost (#7671) (Teddy Katz) +* b30116c Docs: Fix code-blocks in spaced-comment docs (#7524) (Michał Gołębiowski) +* 0a2a7fd Fix: Allow \u2028 and \u2029 as string escapes in no-useless-escape (#7672) (Teddy Katz) +* 76c33a9 Docs: Change Sails.js integration to active npm package (#7675) (Anthony M) + +v3.11.1 - November 28, 2016 + +* be739d0 Fix: capitalized-comments fatal error fixed (fixes #7663) (#7664) (Rich Trott) +* cc4cedc Docs: Fix a typo in array-bracket-spacing documentation (#7667) (Alex Guerrero) +* f8adadc Docs: fix a typo in capitalized-comments documentation (#7666) (Teddy Katz) + +v3.11.0 - November 25, 2016 + +* ad56694 New: capitalized-comments rule (fixes #6055) (#7415) (Kevin Partington) +* 7185567 Update: add fixer for `operator-assignment` (#7517) (Teddy Katz) +* faf5f56 Update: fix false negative of `quotes` with \n in template (fixes #7646) (#7647) (Teddy Katz) +* 474e444 Update: add fixer for `sort-imports` (#7535) (Teddy Katz) +* f9b70b3 Docs: Enable example highlighting in rules examples (ref #6444) (#7644) (Alex Guerrero) +* d50f6c1 Fix: incorrect location for `no-useless-escape` errors (fixes #7643) (#7645) (Teddy Katz) +* 54a993c Docs: Fix a typo in the require-yield.md (#7652) (Vse Mozhet Byt) +* eadd808 Chore: Fix prefer-arrow-callback lint errors (#7651) (Kevin Partington) +* 89bd8de New: `require-await` rule (fixes #6820) (#7435) (Toru Nagashima) +* b7432bd Chore: Ensure JS files are checked out with LF (#7624) (Kevin Partington) +* 32a3547 Docs: Add absent quotes in rules documentation (#7625) (Denis Sikuler) +* 5c9a4ad Fix: Prevent `quotes` from fixing templates to directives (fixes #7610) (#7617) (Teddy Katz) +* d90ca46 Upgrade: Update markdownlint dependency to 0.3.1 (fixes #7589) (#7592) (David Anson) +* 07124d1 Docs: add missing quote mark (+=" → "+=") (#7613) (Sean Juarez) +* 8998043 Docs: fix wording in docs for no-extra-parens config (Michael Ficarra) + +v3.10.2 - November 15, 2016 + +* 0643bfe Fix: correctly handle commented code in `indent` autofixer (fixes #7604) (#7606) (Teddy Katz) +* bd0514c Fix: syntax error after `key-spacing` autofix with comment (fixes #7603) (#7607) (Teddy Katz) +* f56c1ef Fix: `indent` crash on parenthesized global return values (fixes #7573) (#7596) (Teddy Katz) +* 100c6e1 Docs: Fix example for curly "multi-or-nest" option (#7597) (Will Chen) +* 6abb534 Docs: Update code of conduct link (#7599) (Nicholas C. Zakas) +* 8302cdb Docs: Update no-tabs to match existing standards & improve readbility (#7590) (Matt Stow) + +v3.10.1 - November 14, 2016 + +* 8a0e92a Fix: handle try/catch correctly in `no-return-await` (fixes #7581) (#7582) (Teddy Katz) +* c4dd015 Fix: no-useless-return stack overflow on unreachable loops (fixes #7583) (#7584) (Teddy Katz) + +v3.10.0 - November 11, 2016 + +* 7ee039b Update: Add comma-style options for calls, fns, imports (fixes #7470) (Max Englander) +* 670e060 Chore: make the `object-shorthand` tests more readable (#7580) (Teddy Katz) +* c3f4809 Update: Allow `func-names` to recognize inferred ES6 names (fixes #7235) (#7244) (Logan Smyth) +* b8d6e48 Fix: syntax errors created by `object-shorthand` autofix (fixes #7574) (#7575) (Teddy Katz) +* 1b3b65c Chore: ensure that files in tests/conf are linted (#7579) (Teddy Katz) +* 2bd1dd7 Update: avoid creating extra whitespace in `arrow-body-style` fixer (#7504) (Teddy Katz) +* 66fe9ff New: `no-return-await` rule. (fixes #7537) (#7547) (Jordan Harband) +* 759525e Chore: Use process.exitCode instead of process.exit() in bin/eslint.js (#7569) (Teddy Katz) +* 0d60db7 Fix: Curly rule doesn't account for leading comment (fixes #7538) (#7539) (Will Chen) +* 5003b1c Update: fix in/instanceof handling with `space-infix-ops` (fixes #7525) (#7552) (Teddy Katz) +* 3e6131e Docs: explain config option merging (#7499) (Danny Andrews) +* 1766524 Update: "Error type should be" assertion in rule-tester (fixes 6106) (#7550) (Frans Jaspers) +* 44eb274 Docs: Missing semicolon report was missing a comma (#7553) (James) +* 6dbda15 Docs: Document the optional defaults argument for RuleTester (#7548) (Teddy Katz) +* e117b80 Docs: typo fix (#7546) (oprogramador) +* 25e5613 Chore: Remove incorrect test from indent.js. (#7531) (Scott Stern) +* c0f4937 Fix: `arrow-parens` supports type annotations (fixes #7406) (#7436) (Toru Nagashima) +* a838b8e Docs: `func-name-matching`: update with “always”/“never” option (#7536) (Jordan Harband) +* 3c379ff Update: `no-restricted-{imports,modules}`: add “patterns” (fixes #6963) (#7433) (Jordan Harband) +* f5764ee Docs: Update example of results returned from `executeOnFiles` (#7362) (Simen Bekkhus) +* 4613ba0 Fix: Add support for escape char in JSX. (#7461) (Scott Stern) +* ea0970d Fix: `curly` false positive with no-semicolon style (#7509) (Teddy Katz) +* af1fde1 Update: fix `brace-style` false negative on multiline node (fixes #7493) (#7496) (Teddy Katz) +* 3798aea Update: max-statements to report function name (refs #7260) (#7399) (Nicholas C. Zakas) +* 0c215fa Update: Add `ArrowFunctionExpression` support to `require-jsdoc` rule (#7518) (Gyandeep Singh) +* 578c373 Build: handle deprecated rules with no 'replacedBy' (refs #7471) (#7494) (Vitor Balocco) +* a7f3976 Docs: Specify min ESLint version for new rule format (#7501) (cowchimp) +* 8a3e717 Update: Fix `lines-around-directive` semicolon handling (fixes #7450) (#7483) (Teddy Katz) +* e58cead Update: add a fixer for certain statically-verifiable `eqeqeq` cases (#7389) (Teddy Katz) +* 0dea0ac Chore: Add Node 7 to travis ci build (#7506) (Gyandeep Singh) +* 36338f0 Update: add fixer for `no-extra-boolean-cast` (#7387) (Teddy Katz) +* 183def6 Chore: enable `prefer-arrow-callback` on ESLint codebase (fixes #6407) (#7503) (Teddy Katz) +* 4f1fa67 Docs: Update copyright (#7497) (Nicholas C. Zakas) + +v3.9.1 - October 31, 2016 + +* 2012258 Fix: incorrect `indent` check for array property access (fixes #7484) (#7485) (Teddy Katz) +* 8a71d4a Fix: `no-useless-return` false positive on conditionals (fixes #7477) (#7482) (Teddy Katz) +* 56a662b Fix: allow escaped backreferences in `no-useless-escape` (fixes #7472) (#7474) (Teddy Katz) +* fffdf13 Build: Fix prefer-reflect rule to not crash site gen build (#7471) (Ilya Volodin) +* 8ba68a3 Docs: Update broken link (#7490) (Devinsuit) +* 65231d8 Docs: add the "fixable" icon for `no-useless-return` (#7480) (Teddy Katz) + +v3.9.0 - October 28, 2016 + +* d933516 New: `no-useless-return` rule (fixes #7309) (#7441) (Toru Nagashima) +* 5e7af30 Update: Add `CallExpression` option for `indent` (fixes #5946) (#7189) (Teddy Katz) +* b200086 Fix: Support type annotations in array-bracket-spacing (#7445) (Jimmy Jia) +* 5ed8b9b Update: Deprecate prefer-reflect (fixes #7226) (#7464) (Kai Cataldo) +* 92ad43b Chore: Update deprecated rules in conf/eslint.json (#7467) (Kai Cataldo) +* e46666b New: Codeframe formatter (fixes #5860) (#7437) (Vitor Balocco) +* fe0d903 Upgrade: Shelljs to ^0.7.5 (fixes #7316) (#7465) (Gyandeep Singh) +* 1d5146f Update: fix wrong indentation about `catch`,`finally` (#7371) (Toru Nagashima) +* 77e3a34 Chore: Pin mock-fs dev dependency (#7466) (Gyandeep Singh) +* c675d7d Update: Fix `no-useless-escape` false negative in regexes (fixes #7424) (#7425) (Teddy Katz) +* ee3bcea Update: add fixer for `newline-after-var` (fixes #5959) (#7375) (Teddy Katz) +* 6e9ff08 Fix: indent.js to support multiline array statements. (#7237) (Scott Stern) +* f8153ad Build: Ensure absolute links in docs retain .md extensions (fixes #7419) (#7438) (Teddy Katz) +* 16367a8 Fix: Return statement spacing. Fix for indent rule. (fixes #7164) (#7197) (Imad Elyafi) +* 3813988 Update: fix false negative of `no-extra-parens` (fixes #7122) (#7432) (Toru Nagashima) +* 23062e2 Docs: Fix typo in no-unexpected-multiline (fixes #7442) (#7447) (Denis Sikuler) +* d257428 Update: `func-name-matching`: add “always”/“never” option (fixes #7391) (#7428) (Jordan Harband) +* c710584 Fix: support for MemberExpression with function body. (#7400) (Scott Stern) +* 2c8ed2d Build: ensure that all files are linted on bash (fixes #7426) (#7427) (Teddy Katz) +* 18ff70f Chore: Enable `no-useless-escape` (#7403) (Vitor Balocco) +* 8dfd802 Fix: avoid `camelcase` false positive with NewExpressions (fixes #7363) (#7409) (Teddy Katz) +* e8159b4 Docs: Fix typo and explain static func calls for class-methods-use-this (#7421) (Scott O'Hara) +* 85d7e24 Docs: add additional examples for MemberExpressions in Indent rule. (#7408) (Scott Stern) +* 2aa1107 Docs: Include note on fatal: true in the node.js api section (#7376) (Simen Bekkhus) +* e064a25 Update: add fixer for `arrow-body-style` (#7240) (Teddy Katz) +* e0fe727 Update: add fixer for `brace-style` (fixes #7074) (#7347) (Teddy Katz) +* cbbe420 New: Support enhanced parsers (fixes #6974) (#6975) (Nicholas C. Zakas) +* 644d25b Update: Add an ignoreRegExpLiterals option to max-len (fixes #3229) (#7346) (Wilfred Hughes) +* 6875576 Docs: Remove broken links to jslinterrors.com (fixes #7368) (#7369) (Dannii Willis) + +v3.8.1 - October 17, 2016 + +* 681c78a Fix: `comma-dangle` was confused by type annotations (fixes #7370) (#7372) (Toru Nagashima) +* 7525042 Fix: Allow useless escapes in tagged template literals (fixes #7383) (#7384) (Teddy Katz) +* 9106964 Docs: Fix broken link for stylish formatter (#7386) (Vitor Balocco) +* 49d3c1b Docs: Document the deprecated meta property (#7367) (Randy Coulman) +* 19d2996 Docs: Relax permission for merging PRs (refs eslint/tsc-meetings#20) (#7360) (Brandon Mills) + +v3.8.0 - October 14, 2016 + +* ee60acf Chore: add integration tests for autofixing (fixes #5909) (#7349) (Teddy Katz) +* c8796e9 Update: `comma-dangle` supports trailing function commas (refs #7101) (#7181) (Toru Nagashima) +* c4abaf0 Update: `space-before-function-paren` supports async/await (refs #7101) (#7180) (Toru Nagashima) +* d0d3b28 Fix: id-length rule incorrectly firing on member access (fixes #6475) (#7365) (Burak Yiğit Kaya) +* 2729d94 Fix: Don't report setter params in class bodies as unused (fixes #7351) (#7352) (Teddy Katz) +* 0b85004 Chore: Enable prefer-template (fixes #6407) (#7357) (Kai Cataldo) +* ca1947b Chore: Update pull request template (refs eslint/tsc-meetings#20) (#7359) (Brandon Mills) +* d840afe Docs: remove broken link from no-loop-func doc (#7342) (Michael McDermott) +* 5266793 Update: no-useless-escape checks template literals (fixes #7331) (#7332) (Kai Cataldo) +* b08fb91 Update: add source property to LintResult object (fixes #7098) (#7304) (Vitor Balocco) +* 0db4164 Chore: run prefer-template autofixer on test files (refs #6407) (#7354) (Kai Cataldo) +* c1470b5 Update: Make the `prefer-template` fixer unescape quotes (fixes #7330) (#7334) (Teddy Katz) +* 5d08c33 Fix: Handle parentheses correctly in `yoda` fixer (fixes #7326) (#7327) (Teddy Katz) +* cd72bba New: `func-name-matching` rule (fixes #6065) (#7063) (Annie Zhang) +* 55b5146 Fix: `RuleTester` didn't support `mocha --watch` (#7287) (Toru Nagashima) +* f8387c1 Update: add fixer for `prefer-spread` (#7283) (Teddy Katz) +* 52da71e Fix: Don't require commas after rest properties (fixes #7297) (#7298) (Teddy Katz) +* 3b11d3f Chore: refactor `no-multiple-empty-lines` (#7314) (Teddy Katz) +* 16d495d Docs: Updating CLI overview with latest changes (#7335) (Kevin Partington) +* 52dfce5 Update: add fixer for `one-var-declaration-per-line` (#7295) (Teddy Katz) +* 0e994ae Update: Improve the error messages for `no-unused-vars` (fixes #7282) (#7315) (Teddy Katz) +* 93214aa Chore: Convert non-lib/test files to template literals (refs #6407) (#7329) (Kai Cataldo) +* 72f394d Update: Fix false negative of `no-multiple-empty-lines` (fixes #7312) (#7313) (Teddy Katz) +* 756bc5a Update: Use characters instead of code units for `max-len` (#7299) (Teddy Katz) +* c9a7ec5 Fix: Improving optionator configuration for --print-config (#7206) (Kevin Partington) +* 51bfade Fix: avoid `object-shorthand` crash with spread properties (fixes #7305) (#7306) (Teddy Katz) +* a12d1a9 Update: add fixer for `no-lonely-if` (#7202) (Teddy Katz) +* 1418384 Fix: Don't require semicolons before `++`/`--` (#7252) (Adrian Heine né Lang) +* 2ffe516 Update: add fixer for `curly` (#7105) (Teddy Katz) +* ac3504d Update: add functionPrototypeMethods to wrap-iife (fixes #7212) (#7284) (Eli White) +* 5e16fb4 Update: add fixer for `no-extra-bind` (#7236) (Teddy Katz) + +v3.7.1 - October 3, 2016 + +* 3dcae13 Fix: Use the correct location for `comma-dangle` errors (fixes #7291) (#7292) (Teddy Katz) +* cb7ba6d Fix: no-implicit-coercion should not fix ~. (fixes #7272) (#7289) (Eli White) +* ce590e2 Chore: Add additional tests for bin/eslint.js (#7290) (Teddy Katz) +* 8ec82ee Docs: change links of templates to raw data (#7288) (Toru Nagashima) + +v3.7.0 - September 30, 2016 + +* 2fee8ad Fix: object-shorthand's consistent-as-needed option (issue #7214) (#7215) (Naomi Jacobs) +* c05a19c Update: add fixer for `prefer-numeric-literals` (#7205) (Teddy Katz) +* 2f171f3 Update: add fixer for `no-undef-init` (#7210) (Teddy Katz) +* 876d747 Docs: Steps for adding new committers/TSCers (#7221) (Nicholas C. Zakas) +* dffb4fa Fix: `no-unused-vars` false positive (fixes #7250) (#7258) (Toru Nagashima) +* 4448cec Docs: Adding missing ES8 reference to configuring (#7271) (Kevin Partington) +* 332d213 Update: Ensure `indent` handles nested functions correctly (fixes #7249) (#7265) (Teddy Katz) +* c36d842 Update: add fixer for `no-useless-computed-key` (#7207) (Teddy Katz) +* 18376cf Update: add fixer for `lines-around-directive` (#7217) (Teddy Katz) +* f8e8fab Update: add fixer for `wrap-iife` (#7196) (Teddy Katz) +* 558b444 Docs: Add @not-an-aardvark to development team (#7279) (Ilya Volodin) +* cd1dc57 Update: Add a fixer for `dot-location` (#7186) (Teddy Katz) +* 89787b2 Update: for `yoda`, add a fixer (#7199) (Teddy Katz) +* 742ae67 Fix: avoid indent and no-mixed-spaces-and-tabs conflicts (fixes #7248) (#7266) (Teddy Katz) +* 85b8714 Fix: Use error templates even when reading from stdin (fixes #7213) (#7223) (Teddy Katz) +* 66adac1 Docs: correction in prefer-reflect docs (fixes #7069) (#7150) (Scott Stern) +* e3f95de Update: Fix `no-extra-parens` false negative (fixes #7229) (#7231) (Teddy Katz) +* 2909c19 Docs: Fix typo in object-shorthand docs (#7267) (Brian Donovan) +* 7bb800d Chore: add internal rule to enforce meta.docs conventions (fixes #6954) (#7155) (Vitor Balocco) +* 722c68c Docs: add code fences to the issue template (#7254) (Teddy Katz) + +v3.6.1 - September 26, 2016 + +* b467436 Upgrade: Upgrade Espree to 3.3.1 (#7253) (Ilya Volodin) +* 299a563 Build: Do not strip .md extension from absolute URLs (#7222) (Kai Cataldo) +* 27042d2 Chore: removed unused code related to scopeMap (#7218) (Yang Su) +* d154204 Chore: Lint bin/eslint.js (#7243) (Kevin Partington) +* 87625fa Docs: Improve eol-last examples in docs (#7227) (Chainarong Tangsurakit) +* de8eaa4 Docs: `class-methods-use-this`: fix option name (#7224) (Jordan Harband) +* 2355f8d Docs: Add Brunch plugin to integrations (#7225) (Aleksey Shvayka) +* a5817ae Docs: Default option from `operator-linebreak` is `after`and not always (#7228) (Konstantin Pschera) + +v3.6.0 - September 23, 2016 + +* 1b05d9c Update: add fixer for `strict` (fixes #6668) (#7198) (Teddy Katz) +* 0a36138 Docs: Update ecmaVersion instructions (#7195) (Nicholas C. Zakas) +* aaa3779 Update: Allow `space-unary-ops` to handle await expressions (#7174) (Teddy Katz) +* 91bf477 Update: add fixer for `prefer-template` (fixes #6978) (#7165) (Teddy Katz) +* 745343f Update: `no-extra-parens` supports async/await (refs #7101) (#7178) (Toru Nagashima) +* 8e1fee1 Fix: Handle number literals correctly in `no-whitespace-before-property` (#7185) (Teddy Katz) +* 462a3f7 Update: `keyword-spacing` supports async/await (refs #7101) (#7179) (Toru Nagashima) +* 709a734 Update: Allow template string in `valid-typeof` comparison (fixes #7166) (#7168) (Teddy Katz) +* f71937a Fix: Don't report async/generator callbacks in `array-callback-return` (#7172) (Teddy Katz) +* 461b015 Fix: Handle async functions correctly in `prefer-arrow-callback` fixer (#7173) (Teddy Katz) +* 7ea3e4b Fix: Handle await expressions correctly in `no-unused-expressions` (#7175) (Teddy Katz) +* 16bb802 Update: Ensure `arrow-parens` handles async arrow functions correctly (#7176) (Teddy Katz) +* 2d10657 Chore: add tests for `generator-star-spacing` and async (refs #7101) (#7182) (Toru Nagashima) +* c118d21 Update: Let `no-restricted-properties` check destructuring (fixes #7147) (#7151) (Teddy Katz) +* 9e0b068 Fix: valid-jsdoc does not throw on FieldType without value (fixes #7184) (#7187) (Kai Cataldo) +* 4b5d9b7 Docs: Update process for evaluating proposals (fixes #7156) (#7183) (Kai Cataldo) +* 95c777a Update: Make `no-restricted-properties` more flexible (fixes #7137) (#7139) (Teddy Katz) +* 0fdf23c Update: fix `quotes` rule's false negative (fixes #7084) (#7141) (Toru Nagashima) +* f2a789d Update: fix `no-unused-vars` false negative (fixes #7124) (#7143) (Toru Nagashima) +* 6148d85 Fix: Report columns for `eol-last` correctly (fixes #7136) (#7149) (kdex) +* e016384 Update: add fixer for quote-props (fixes #6996) (#7095) (Teddy Katz) +* 35f7be9 Upgrade: espree to 3.2.0, remove tests with SyntaxErrors (fixes #7169) (#7170) (Teddy Katz) +* 28ddcf8 Fix: `max-len`: `ignoreTemplateLiterals`: handle 3+ lines (fixes #7125) (#7138) (Jordan Harband) +* 660e091 Docs: Update rule descriptions (fixes #5912) (#7152) (Kenneth Williams) +* 8b3fc32 Update: Make `indent` report lines with mixed spaces/tabs (fixes #4274) (#7076) (Teddy Katz) +* b39ac2c Update: add fixer for `no-regex-spaces` (#7113) (Teddy Katz) +* cc80467 Docs: Update PR templates for formatting (#7128) (Nicholas C. Zakas) +* 76acbb5 Fix: include LogicalExpression in indent length calc (fixes #6731) (#7087) (Alec) +* a876673 Update: no-implicit-coercion checks TemplateLiterals (fixes #7062) (#7121) (Kai Cataldo) +* 8db4f0c Chore: Enable `typeof` check for `no-undef` rule in eslint-config-eslint (#7103) (Teddy Katz) +* 7e8316f Docs: Update release process (#7127) (Nicholas C. Zakas) +* 22edd8a Update: `class-methods-use-this`: `exceptMethods` option (fixes #7085) (#7120) (Jordan Harband) +* afd132a Fix: line-comment-position "above" string option now works (fixes #7100) (#7102) (Kevin Partington) +* 1738b2e Chore: fix name of internal-no-invalid-meta test file (#7142) (Vitor Balocco) +* ac0bb62 Docs: Fixes examples for allowTemplateLiterals (fixes #7115) (#7135) (Zoe Ingram) +* bcfa3e5 Update: Add `always`/`never` option to `eol-last` (fixes #6938) (#6952) (kdex) +* 0ca26d9 Docs: Distinguish examples for space-before-blocks (#7132) (Timo Tijhof) +* 9a2aefb Chore: Don't require an issue reference in check-commit npm script (#7104) (Teddy Katz) +* c85fd84 Fix: max-statements-per-line rule to force minimum to be 1 (fixes #7051) (#7092) (Scott Stern) +* e462e47 Docs: updates category of no-restricted-properties (fixes #7112) (#7118) (Alec) +* 6ae660b Fix: Don't report comparisons of two typeof expressions (fixes #7078) (#7082) (Teddy Katz) +* 710f205 Docs: Fix typos in Issues section of Maintainer's Guide (#7114) (Kai Cataldo) +* 546a3ca Docs: Clarify that linter does not process configuration (fixes #7108) (#7110) (Kevin Partington) +* 0d50943 Docs: Elaborate on `guard-for-in` best practice (fixes #7071) (#7094) (Dallon Feldner) +* 58e6d76 Docs: Fix examples for no-restricted-properties (#7099) (not-an-aardvark) +* 6cfe519 Docs: Corrected typo in line-comment-position rule doc (#7097) (Alex Mercier) +* f02e52a Docs: Add fixable note to no-implicit-coercion docs (#7096) (Brandon Mills) + +v3.5.0 - September 9, 2016 + +* 08fa538 Update: fix false negative of `arrow-spacing` (fixes #7079) (#7080) (Toru Nagashima) +* cec65e3 Update: add fixer for no-floating-decimal (fixes #7070) (#7081) (not-an-aardvark) +* 2a3f699 Fix: Column number for no-multiple-empty-lines (fixes #7086) (#7088) (Ian VanSchooten) +* 6947299 Docs: Add info about closing accepted issues to docs (fixes #6979) (#7089) (Kai Cataldo) +* d30157a Docs: Add link to awesome-eslint in integrations page (#7090) (Vitor Balocco) +* 457be1b Docs: Update so issues are not required (fixes #7015) (#7072) (Nicholas C. Zakas) +* d9513b7 Fix: Allow linting of .hidden files/folders (fixes #4828) (#6844) (Ian VanSchooten) +* 6d97c18 New: `max-len`: `ignoreStrings`+`ignoreTemplateLiterals` (fixes #5805) (#7049) (Jordan Harband) +* 538d258 Update: make no-implicit-coercion support autofixing. (fixes #7056) (#7061) (Eli White) +* 883316d Update: add fixer for prefer-arrow-callback (fixes #7002) (#7004) (not-an-aardvark) +* 7502eed Update: auto-fix for `comma-style` (fixes #6941) (#6957) (Gyandeep Singh) +* 645dda5 Update: add fixer for dot-notation (fixes #7014) (#7054) (not-an-aardvark) +* 2657846 Fix: `no-console` ignores user-defined console (fixes #7010) (#7058) (Toru Nagashima) +* 656bb6e Update: add fixer for newline-before-return (fixes #5958) (#7050) (Vitor Balocco) +* 1f995c3 Fix: no-implicit-coercion string concat false positive (fixes #7057) (#7060) (Kai Cataldo) +* 6718749 Docs: Clarify that `es6` env also sets `ecmaVersion` to 6 (#7067) (Jérémie Astori) +* e118728 Update: add fixer for wrap-regex (fixes #7013) (#7048) (not-an-aardvark) +* f4fcd1e Update: add more `indent` options for functions (fixes #6052) (#7043) (not-an-aardvark) +* 657eee5 Update: add fixer for new-parens (fixes #6994) (#7047) (not-an-aardvark) +* ff19aa9 Update: improve `max-statements-per-line` message (fixes #6287) (#7044) (Jordan Harband) +* 3960617 New: `prefer-numeric-literals` rule (fixes #6068) (#7029) (Annie Zhang) +* fa760f9 Chore: no-regex-spaces uses internal rule message format (fixes #7052) (#7053) (Kevin Partington) +* 22c7e09 Update: no-magic-numbers false negative on reassigned vars (fixes #4616) (#7028) (not-an-aardvark) +* be29599 Update: Throw error if whitespace found in plugin name (fixes #6854) (#6960) (Jesse Ostrander) +* 4063a79 Fix: Rule message placeholders can be inside braces (fixes #6988) (#7041) (Kevin Partington) +* 52e8d9c Docs: Clean up sort-vars (#7045) (Matthew Dunsdon) +* 4126f12 Chore: Rule messages use internal rule message format (fixes #6977) (#6989) (Kevin Partington) +* 46cb690 New: `no-restricted-properties` rule (fixes #3218) (#7017) (Eli White) +* 00b3042 Update: Pass file path to parse function (fixes #5344) (#7024) (Annie Zhang) +* 3f13325 Docs: Add kaicataldo and JamesHenry to our teams (#7039) (alberto) +* 8e77f16 Update: `new-parens` false negative (fixes #6997) (#6999) (Toru Nagashima) +* 326f457 Docs: Add missing 'to' in no-restricted-modules (#7022) (Oskar Risberg) +* 8277357 New: `line-comment-position` rule (fixes #6077) (#6953) (alberto) +* c1f0d76 New: `lines-around-directive` rule (fixes #6069) (#6998) (Kai Cataldo) +* 61f1de0 Docs: Fix typo in no-debugger (#7019) (Denis Ciccale) +* 256c4a2 Fix: Allow separate mode option for multiline and align (fixes #6691) (#6991) (Annie Zhang) +* a989a7c Docs: Declaring dependency on eslint in shared config (fixes #6617) (#6985) (alberto) +* 6869c60 Docs: Fix minor typo in no-extra-parens doc (#6992) (Jérémie Astori) +* 28f1619 Docs: Update the example of SwitchCase (#6981) (fish) + +v3.4.0 - August 26, 2016 + +* c210510 Update: add fixer for no-extra-parens (fixes #6944) (#6950) (not-an-aardvark) +* ca3d448 Fix: `prefer-const` false negative about `eslintUsed` (fixes #5837) (#6971) (Toru Nagashima) +* 1153955 Docs: Draft of JSCS migration guide (refs #5859) (#6942) (Nicholas C. Zakas) +* 3e522be Fix: false negative of `indent` with `else if` statements (fixes #6956) (#6965) (not-an-aardvark) +* 2dfb290 Docs: Distinguish examples in rules under Stylistic Issues part 7 (#6760) (Kenneth Williams) +* 3c710c9 Fix: rename "AirBnB" => "Airbnb" init choice (fixes #6969) (Harrison Shoff) +* 7660b39 Fix: `object-curly-spacing` for type annotations (fixes #6940) (#6945) (Toru Nagashima) +* 21ab784 New: do not remove non visited files from cache. (fixes #6780) (#6921) (Roy Riojas) +* 3a1763c Fix: enable `@scope/plugin/ruleId`-style specifier (refs #6362) (#6939) (Toru Nagashima) +* d6fd064 Update: Add never option to multiline-ternary (fixes #6751) (#6905) (Kai Cataldo) +* 0d268f1 New: `symbol-description` rule (fixes #6778) (#6825) (Jarek Rencz) +* a063d4e Fix: no-cond-assign within a function expression (fixes #6908) (#6909) (Patrick McElhaney) +* 16db93a Build: Tag docs, publish release notes (fixes #6892) (#6934) (Nicholas C. Zakas) +* 0cf1d55 Chore: Fix object-shorthand errors (fixes #6958) (#6959) (Kai Cataldo) +* 8851ddd Fix: Improve pref of globbing by inheriting glob.GlobSync (fixes #6710) (#6783) (Kael Zhang) +* cf2242c Update: `requireStringLiterals` option for `valid-typeof` (fixes #6698) (#6923) (not-an-aardvark) +* 8561389 Fix: `no-trailing-spaces` wrong fixing (fixes #6933) (#6937) (Toru Nagashima) +* 6a92be5 Docs: Update semantic versioning policy (#6935) (alberto) +* a5189a6 New: `class-methods-use-this` rule (fixes #5139) (#6881) (Gyandeep Singh) +* 1563808 Update: add support for ecmaVersion 20xx (fixes #6750) (#6907) (Kai Cataldo) +* d8b770c Docs: Change rule descriptions for consistent casing (#6915) (Brandon Mills) +* c676322 Chore: Use object-shorthand batch 3 (refs #6407) (#6914) (Kai Cataldo) + +v3.3.1 - August 15, 2016 + +* a2f06be Build: optimize rule page title for small browser tabs (fixes #6888) (#6904) (Vitor Balocco) +* 02a00d6 Docs: clarify rule details for no-template-curly-in-string (#6900) (not-an-aardvark) +* b9b3446 Fix: sort-keys ignores destructuring patterns (fixes #6896) (#6899) (Kai Cataldo) +* 3fe3a4f Docs: Update options in `object-shorthand` (#6898) (Grant Snodgrass) +* cd09c96 Chore: Use object-shorthand batch 2 (refs #6407) (#6897) (Kai Cataldo) +* 2841008 Chore: Use object-shorthand batch 1 (refs #6407) (#6893) (Kai Cataldo) + +v3.3.0 - August 12, 2016 + +* 683ac56 Build: Add CI release scripts (fixes #6884) (#6885) (Nicholas C. Zakas) +* ebf8441 Update: `prefer-rest-params` relax for member accesses (fixes #5990) (#6871) (Toru Nagashima) +* df01c4f Update: Add regex support for exceptions (fixes #5187) (#6883) (Annie Zhang) +* 055742c Fix: `no-dupe-keys` type errors (fixes #6886) (#6889) (Toru Nagashima) +* e456fd3 New: `sort-keys` rule (fixes #6076) (#6800) (Toru Nagashima) +* 3e879fc Update: Rule "eqeqeq" to have more specific null handling (fixes #6543) (#6849) (Simon Sturmer) +* e8cb7f9 Chore: use eslint-plugin-node (refs #6407) (#6862) (Toru Nagashima) +* e37bbd8 Docs: Remove duplicate statement (#6878) (Richard Käll) +* 11395ca Fix: `no-dupe-keys` false negative (fixes #6801) (#6863) (Toru Nagashima) +* 1ecd2a3 Update: improve error message in `no-control-regex` (#6839) (Jordan Harband) +* d610d6c Update: make `max-lines` report the actual number of lines (fixes #6766) (#6764) (Jarek Rencz) +* b256c50 Chore: Fix glob for core js files for lint (fixes #6870) (#6872) (Gyandeep Singh) +* f8ab8f1 New: func-call-spacing rule (fixes #6080) (#6749) (Brandon Mills) +* be68f0b New: no-template-curly-in-string rule (fixes #6186) (#6767) (Jeroen Engels) +* 80789ab Chore: don't throw if rule is in old format (fixes #6848) (#6850) (Vitor Balocco) +* d47c505 Fix: `newline-after-var` false positive (fixes #6834) (#6847) (Toru Nagashima) +* bf0afcb Update: validate void operator in no-constant-condition (fixes #5726) (#6837) (Vitor Balocco) +* 5ef839e New: Add consistent and ..-as-needed to object-shorthand (fixes #5438) (#5439) (Martijn de Haan) +* 7e1bf01 Fix: update peerDependencies of airbnb option for `--init` (fixes #6843) (#6846) (Vitor Balocco) +* 8581f4f Fix: `no-invalid-this` false positive (fixes #6824) (#6827) (Toru Nagashima) +* 90f78f4 Update: add `props` option to `no-self-assign` rule (fixes #6718) (#6721) (Toru Nagashima) +* 30d71d6 Update: 'requireForBlockBody' modifier for 'arrow-parens' (fixes #6557) (#6558) (Nicolas Froidure) +* cdded07 Chore: use native `Object.assign` (refs #6407) (#6832) (Gyandeep Singh) +* 579ec49 Chore: Add link to rule change guidelines in "needs info" template (fixes #6829) (#6831) (Kevin Partington) +* 117e7aa Docs: Remove incorrect "constructor" statement from `no-new-symbol` docs (#6830) (Jarek Rencz) +* aef18b4 New: `no-unsafe-negation` rule (fixes #2716) (#6789) (Toru Nagashima) +* d94e945 Docs: Update Getting Started w/ Readme installation instructions (#6823) (Kai Cataldo) +* dfbc112 Upgrade: proxyquire to 1.7.10 (fixes #6821) (#6822) (alberto) +* 4c5e911 Chore: enable `prefer-const` and apply it to our codebase (refs #6407) (#6805) (Toru Nagashima) +* e524d16 Update: camelcase rule fix for import declarations (fixes #6755) (#6784) (Lorenzo Zottar) +* 8f3509d Update: make `eslint:all` excluding deprecated rules (fixes #6734) (#6756) (Toru Nagashima) +* 2b17459 New: `no-global-assign` rule (fixes #6586) (#6746) (alberto) + +v3.2.2 - August 1, 2016 + +* 510ce4b Upgrade: file-entry-cache@^1.3.1 (fixes #6816, refs #6780) (#6819) (alberto) +* 46b14cd Fix: ignore MemberExpression in VariableDeclarators (fixes #6795) (#6815) (Nicholas C. Zakas) + +v3.2.1 - August 1, 2016 + +* 584577a Build: Pin file-entry-cache to avoid licence issue (refs #6816) (#6818) (alberto) +* 38d0d23 Docs: clarify minor releases and suggest using `~ to version (#6804) (Henry Zhu) +* 4ca809e Fix: Normalizes messages so all end with a period (fixes #6762) (#6807) (Patrick McElhaney) +* c7488ac Fix: Make MemberExpression option opt-in (fixes #6797) (#6798) (Rich Trott) +* 715e8fa Docs: Update issue closing policy (fixes #6765) (#6808) (Nicholas C. Zakas) +* 288f7bf Build: Fix site generation (fixes #6791) (#6793) (Nicholas C. Zakas) +* 261a9f3 Docs: Update JSCS status in README (#6802) (alberto) +* 5ae0887 Docs: Update no-void.md (#6799) (Daniel Hritzkiv) + +v3.2.0 - July 29, 2016 + +* 2438ee2 Upgrade: Update markdownlint dependency to 0.2.0 (fixes #6781) (#6782) (David Anson) +* 4fc0018 Chore: dogfooding `no-var` rule and remove `var`s (refs #6407) (#6757) (Toru Nagashima) +* b22eb5c New: `no-tabs` rule (fixes #6079) (#6772) (Gyandeep Singh) +* ddea63a Chore: Updated no-control-regex tests to cover all cases (fixes #6438) (#6752) (Efe Gürkan YALAMAN) +* 1025772 Docs: Add plugin example to disabling with comments guide (fixes #6742) (#6747) (Brandon Mills) +* 628aae4 Docs: fix inconsistent spacing inside block comment (#6768) (Brian Jacobel) +* 2983c32 Docs: Add options to func-names config comments (#6748) (Brandon Mills) +* 2f94443 Docs: fix wrong path (#6763) (molee1905) +* 6f3faa4 Revert "Build: Remove support for Node v5 (fixes #6743)" (#6758) (Nicholas C. Zakas) +* 99dfd1c Docs: fix grammar issue in rule-changes page (#6761) (Vitor Balocco) +* e825458 Fix: Rule no-unused-vars had missing period (fixes #6738) (#6739) (Brian Mock) +* 71ae64c Docs: Clarify cache file deletion (fixes #4943) (#6712) (Nicholas C. Zakas) +* 26c85dd Update: merge warnings of consecutive unreachable nodes (fixes #6583) (#6729) (Toru Nagashima) +* 106e40b Fix: Correct grammar in object-curly-newline reports (fixes #6725) (#6728) (Vitor Balocco) +* e00754c Chore: Dogfooding ES6 rules (refs #6407) (#6735) (alberto) +* 181b26a Build: Remove support for Node v5 (fixes #6743) (#6744) (alberto) +* 5320a6c Update: `no-use-before-define` false negative on for-in/of (fixes #6699) (#6719) (Toru Nagashima) +* a2090cb Fix: space-infix-ops doesn't fail for type annotations(fixes #5211) (#6723) (Nicholas C. Zakas) +* 9c36ecf Docs: Add @vitorbal and @platinumazure to development team (Ilya Volodin) +* e09d1b8 Docs: describe all RuleTester options (fixes #4810, fixes #6709) (#6711) (Nicholas C. Zakas) +* a157f47 Chore: Update CLIEngine option desc (fixes #5179) (#6713) (Nicholas C. Zakas) +* a0727f9 Chore: fix `.gitignore` for vscode (refs #6383) (#6720) (Toru Nagashima) +* 75d2d43 Docs: Clarify Closure type hint expectation (fixes #5231) (#6714) (Nicholas C. Zakas) +* 95ea25a Update: Check indentation of multi-line chained properties (refs #1801) (#5940) (Rich Trott) +* e7b1e1c Docs: Edit issue/PR waiting period docs (fixes #6009) (#6715) (Nicholas C. Zakas) +* 053aa0c Update: Added 'allowSuper' option to `no-underscore-dangle` (fixes #6355) (#6662) (peteward44) +* 8929045 Build: Automatically generate rule index (refs #2860) (#6658) (Ilya Volodin) +* f916ae5 Docs: Fix multiline-ternary typos (#6704) (Cédric Malard) +* c64b0c2 Chore: First ES6 refactoring (refs #6407) (#6570) (Nicholas C. Zakas) + +v3.1.1 - July 18, 2016 + +* 565e584 Fix: `eslint:all` causes regression in 3.1.0 (fixes #6687) (#6696) (alberto) +* cb90359 Fix: Allow named recursive functions (fixes #6616) (#6667) (alberto) +* 3f206dd Fix: `balanced` false positive in `spaced-comment` (fixes #6689) (#6692) (Grant Snodgrass) +* 57f1676 Docs: Add missing brackets from code examples (#6700) (Plusb Preco) +* 124f066 Chore: Remove fixable key from multiline-ternary metadata (fixes #6683) (#6688) (Kai Cataldo) +* 9f96086 Fix: Escape control characters in XML. (fixes #6673) (#6672) (George Chung) + +v3.1.0 - July 15, 2016 + +* e8f8c6c Fix: incorrect exitCode when eslint is called with --stdin (fixes #6677) (#6682) (Steven Humphrey) +* 38639bf Update: make `no-var` fixable (fixes #6639) (#6644) (Toru Nagashima) +* dfc20e9 Fix: `no-unused-vars` false positive in loop (fixes #6646) (#6649) (Toru Nagashima) +* 2ba75d5 Update: relax outerIIFEBody definition (fixes #6613) (#6653) (Stephen E. Baker) +* 421e4bf Chore: combine multiple RegEx replaces with one (fixes #6669) (#6661) (Sakthipriyan Vairamani) +* 089ee2c Docs: fix typos,wrong path,backticks (#6663) (molee1905) +* ef827d2 Docs: Add another pre-commit hook to integrations (#6666) (David Alan Hjelle) +* a343b3c Docs: Fix option typo in no-underscore-dangle (Fixes #6674) (#6675) (Luke Page) +* 5985eb2 Chore: add internal rule that validates meta property (fixes #6383) (#6608) (Vitor Balocco) +* 4adb15f Update: Add `balanced` option to `spaced-comment` (fixes #4133) (#6575) (Annie Zhang) +* 1b13c25 Docs: fix incorrect example being mark as correct (#6660) (David Björklund) +* a8b4e40 Fix: Install required eslint plugin for "standard" guide (fixes #6656) (#6657) (Feross Aboukhadijeh) +* 720686b New: `endLine` and `endColumn` of the lint result. (refs #3307) (#6640) (Toru Nagashima) +* 54faa46 Docs: Small tweaks to CLI documentation (fixes #6627) (#6642) (Kevin Partington) +* e108850 Docs: Added examples and structure to `padded-blocks` (fixes #6628) (#6643) (alberto) +* 350e1c0 Docs: Typo (#6650) (Peter Rood) +* b837c92 Docs: Correct a term in max-len.md (fixes #6637) (#6641) (Vse Mozhet Byt) +* baeb313 Fix: Warning behavior for executeOnText (fixes #6611) (#6632) (Nicholas C. Zakas) +* e6004be Chore: Enable preferType in valid-jsdoc (refs #5188) (#6634) (Nicholas C. Zakas) +* ca323cf Fix: Use default assertion messages (fixes #6532) (#6615) (Dmitrii Abramov) +* 2bdf22c Fix: Do not throw exception if baseConfig is provided (fixes #6605) (#6625) (Kevin Partington) +* e42cacb Upgrade: mock-fs to 3.10, fixes for Node 6.3 (fixes #6621) (#6624) (Tim Schaub) +* 8a263ae New: multiline-ternary rule (fixes #6066) (#6590) (Kai Cataldo) +* e951303 Update: Adding new `key-spacing` option (fixes #5613) (#5907) (Kyle Mendes) +* 10c3e91 Docs: Remove reference from 3.0.0 migration guide (refs #6605) (#6618) (Kevin Partington) +* 5010694 Docs: Removed non-existing resource (#6609) (Moritz Kröger) +* 6d40d85 Docs: Note that PR requires ACCEPTED issue (refs #6568) (#6604) (Patrick McElhaney) + +v3.0.1 - July 5, 2016 + +* 27700cf Fix: `no-unused-vars` false positive around callback (fixes #6576) (#6579) (Toru Nagashima) +* 124d8a3 Docs: Pull request template (#6568) (Nicholas C. Zakas) +* e9a2ed9 Docs: Fix rules\id-length exceptions typos (fixes #6397) (#6593) (GramParallelo) +* a2cfa1b Fix: Make outerIIFEBody work correctly (fixes #6585) (#6596) (Nicholas C. Zakas) +* 9c451a2 Docs: Use string severity in example (#6601) (Kenneth Williams) +* 8308c0b Chore: remove path-is-absolute in favor of the built-in (fixes #6598) (#6600) (shinnn) +* 7a63717 Docs: Add missing pull request step (fixes #6595) (#6597) (Nicholas C. Zakas) +* de3ed84 Fix: make `no-unused-vars` ignore for-in (fixes #2342) (#6126) (Oleg Gaidarenko) +* 6ef2cbe Fix: strip Unicode BOM of config files (fixes #6556) (#6580) (Toru Nagashima) +* ee7fcfa Docs: Correct type of `outerIIFEBody` in `indent` (fixes #6581) (#6584) (alberto) +* 25fc7b7 Fix: false negative of `max-len` (fixes #6564) (#6565) (not-an-aardvark) +* f6b8452 Docs: Distinguish examples in rules under Stylistic Issues part 6 (#6567) (Kenneth Williams) + +v3.0.0 - July 1, 2016 + +* 66de9d8 Docs: Update installation instructions on README (#6569) (Nicholas C. Zakas) +* dc5b78b Breaking: Add `require-yield` rule to `eslint:recommended` (fixes #6550) (#6554) (Gyandeep Singh) +* 7988427 Fix: lib/config.js tests pass if personal config exists (fixes #6559) (#6566) (Kevin Partington) +* 4c05967 Docs: Update rule docs for new format (fixes #5417) (#6551) (Nicholas C. Zakas) +* 70da5a8 Docs: Correct link to rules page (#fixes 6553) (#6561) (alberto) +* e2b2030 Update: Check RegExp strings for `no-regex-spaces` (fixes #3586) (#6379) (Jackson Ray Hamilton) +* 397e51b Update: Implement outerIIFEBody for indent rule (fixes #6259) (#6382) (David Shepherd) +* 666da7c Docs: 3.0.0 migration guide (#6521) (Nicholas C. Zakas) +* b9bf8fb Docs: Update Governance Policy (fixes #6452) (#6522) (Nicholas C. Zakas) +* 1290657 Update: `no-unused-vars` ignores read it modifies itself (fixes #6348) (#6535) (Toru Nagashima) +* d601f6b Fix: Delete cache only when executing on files (fixes #6459) (#6540) (Kai Cataldo) +* e0d4b19 Breaking: Error thrown/printed if no config found (fixes #5987) (#6538) (Kevin Partington) +* 18663d4 Fix: false negative of `no-useless-rename` (fixes #6502) (#6506) (Toru Nagashima) +* 0a7936d Update: Add fixer for prefer-const (fixes #6448) (#6486) (Nick Heiner) +* c60341f Chore: Update index and `meta` for `"eslint:recommended"` (refs #6403) (#6539) (Mark Pedrotti) +* 73da28d Better wording for the error reported by the rule "no-else-return" #6411 (#6413) (Olivier Thomann) +* e06a5b5 Update: Add fixer for arrow-parens (fixes #4766) (#6501) (madmed88) +* 5f8f3e8 Docs: Remove Box as a sponsor (#6529) (Nicholas C. Zakas) +* 7dfe0ad Docs: fix max-lines samples (fixes #6516) (#6515) (Dmitriy Shekhovtsov) +* fa05119 Breaking: Update eslint:recommended (fixes #6403) (#6509) (Nicholas C. Zakas) +* e96177b Docs: Add "Proposing a Rule Change" link to CONTRIBUTING.md (#6511) (Kevin Partington) +* bea9096 Docs: Update pull request steps (fixes #6474) (#6510) (Nicholas C. Zakas) +* 7bcf6e0 Docs: Consistent example headings & text pt3 (refs #5446) (#6492) (Guy Fraser) +* 1a328d9 Docs: Consistent example headings & text pt4 (refs #5446) (#6493) (Guy Fraser) +* ff5765e Docs: Consistent example headings & text pt2 (refs #5446)(#6491) (Guy Fraser) +* 01384fa Docs: Fixing typos (refs #5446)(#6494) (Guy Fraser) +* 4343ae8 Fix: false negative of `object-shorthand` (fixes #6429) (#6434) (Toru Nagashima) +* b7d8c7d Docs: more accurate yoda-speak (#6497) (Tony Lukasavage) +* 3b0ab0d Fix: add warnIgnored flag to CLIEngine.executeOnText (fixes #6302) (#6305) (Robert Levy) +* c2c6cec Docs: Mark object-shorthand as fixable. (#6485) (Nick Heiner) +* 5668236 Fix: Allow objectsInObjects exception when destructuring (fixes #6469) (#6470) (Adam Renklint) +* 17ac0ae Fix: `strict` rule reports a syntax error for ES2016 (fixes #6405) (#6464) (Toru Nagashima) +* 4545123 Docs: Rephrase documentation for `no-duplicate-imports` (#6463) (Simen Bekkhus) +* 1b133e3 Docs: improve `no-native-reassign` and specifying globals (fixes #5358) (#6462) (Toru Nagashima) +* b179373 Chore: Remove dead code in excuteOnFiles (fixes #6467) (#6466) (Andrew Hutchings) +* 18fbc4b Chore: Simplify eslint process exit code (fixes #6368) (#6371) (alberto) +* 58542e4 Breaking: Drop support for node < 4 (fixes #4483) (#6401) (alberto) +* f50657e Breaking: use default for complexity in eslint:recommended (fixes #6021) (#6410) (alberto) +* 3e690fb Fix: Exit init early if guide is chosen w/ no package.json (fixes #6476) (#6478) (Kai Cataldo) + +v2.13.1 - June 20, 2016 + +* 434de7f Fix: wrong baseDir (fixes #6450) (#6457) (Toru Nagashima) +* 3c9ce09 Fix: Keep indentation when fixing `padded-blocks` "never" (fixes #6454) (#6456) (Ed Lee) +* a9d4cb2 Docs: Fix typo in max-params examples (#6471) (J. William Ashton) +* 1e185b9 Fix: no-multiple-empty-lines errors when no line breaks (fixes #6449) (#6451) (strawbrary) + +v2.13.0 - June 17, 2016 + +* cf223dd Fix: add test for a syntax error (fixes #6013) (#6378) (Toru Nagashima) +* da30cf9 Update: Add fixer for object-shorthand (fixes #6412) (#6418) (Nick Heiner) +* 2cd90eb Chore: Fix rule meta description inconsistencies (refs #5417) (#6422) (Mark Pedrotti) +* d798b2c Added quotes around "classes" option key (#6441) (Guy Fraser) +* 852b6df Docs: Delete empty table of links from Code Path Analysis (#6423) (Mark Pedrotti) +* 5e9117e Chore: sort rules in eslint.json (fixes #6425) (#6426) (alberto) +* c2b5277 Docs: Add gitter chat link to Reporting Bugs (#6430) (Mark Pedrotti) +* 1316db0 Update: Add `never` option for `func-names` (fixes #6059) (#6392) (alberto) +* 1c123e2 Update: Add autofix for `padded-blocks` (fixes #6320) (#6393) (alberto) +* 8ec89c8 Fix: `--print-config` return config inside subdir (fixes #6329) (#6385) (alberto) +* 4f73240 Fix: `object-curly-newline` multiline with comments (fixes #6381) (#6396) (Toru Nagashima) +* 77697a7 Chore: Fake config hierarchy fixtures (fixes #6206) (#6402) (Gyandeep Singh) +* 73a9a6d Docs: Fix links in Configuring ESLint (#6421) (Mark Pedrotti) +* ed84c4c Fix: improve `newline-per-chained-call` message (fixes #6340) (#6360) (Toru Nagashima) +* 9ea4e44 Docs: Update parser reference to `espree` instead of `esprima` (#6404) (alberto) +* 7f57467 Docs: Make `fix` param clearer (fixes #6366) (#6367) (Nick Heiner) +* fb49c7f Fix: nested `extends` with relative path (fixes #6358) (#6359) (Toru Nagashima) +* 5122f73 Update: no-multiple-empty-lines fixer (fixes #6225) (#6226) (Ruurd Moelker) +* 0e7ce72 Docs: Fix rest-spread-spacing's name (#6365) (cody) +* cfdd524 Fix: allow semi as braceless body of statements (fixes #6386) (#6391) (alberto) +* 6b08cfc Docs: key-spacing fixable documenation notes (fixes #6375) (#6376) (Ruurd Moelker) +* 4b4be3b Docs: `max-lines` option: fix `skipComments` typo (#6374) (Jordan Harband) +* 20ab4f6 Docs: Fix wrong link in object-curly-newline (#6373) (Grant Snodgrass) +* 412ce8d Docs: Fix broken links in no-mixed-operators (#6372) (Grant Snodgrass) + +v2.12.0 - June 10, 2016 + +* 54c30fb Update: Add explicit default option `always` for `eqeqeq` (refs #6144) (#6342) (alberto) +* 2d63370 Update: max-len will warn indented comment lines (fixes #6322) (#6324) (Kai Cataldo) +* dcd4ad7 Docs: clarify usage of inline disable comments (fixes #6335) (#6347) (Kai Cataldo) +* c03300b Docs: Clarified how plugin rules look in plugin configs (fixes #6346) (#6351) (Kevin Partington) +* 9c87709 Docs: Add semantic versioning policy (fixes #6244) (#6343) (Nicholas C. Zakas) +* 5affab1 Docs: Describe values under Extending Configuration Files (refs #6240) (#6336) (Mark Pedrotti) +* 2520f5a New: `max-lines` rule (fixes #6078) (#6321) (alberto) +* 9bfbc64 Update: Option for object literals in `arrow-body-style` (fixes #5936) (#6216) (alberto) +* 977cdd5 Chore: remove unused method from FileFinder (fixes #6344) (#6345) (alberto) +* 477fbc1 Docs: Add section about customizing RuleTester (fixes #6227) (#6331) (Jeroen Engels) +* 0e14016 New: `no-mixed-operators` rule (fixes #6023) (#6241) (Toru Nagashima) +* 6e03c4b Update: Add never option to arrow-body-style (fixes #6317) (#6318) (Andrew Hyndman) +* f804397 New: Add `eslint:all` option (fixes #6240) (#6248) (Robert Fletcher) +* dfe05bf Docs: Link JSCS rules to their corresponding page. (#6334) (alberto) +* 1cc4356 Docs: Remove reference to numeric config (fixes #6309) (#6327) (Kevin Partington) +* 2d4efbe Docs: Describe options in rule under Strict Mode (#6312) (Mark Pedrotti) +* c1953fa Docs: Typo fix 'and' -> 'any' (#6326) (Stephen Edgar) +* d49ab4b Docs: Code conventions improvements (#6313) (Kevin Partington) +* 316a507 Fix: one-var allows uninitialized vars in ForIn/ForOf (fixes #5744) (#6272) (Kai Cataldo) +* 6cbee31 Docs: Typo fix 'colum' -> 'column' (#6306) (Andrew Cobby) +* 2663569 New: `object-curly-newline` (fixes #6072) (#6223) (Toru Nagashima) +* 72c2ea5 Update: callback-return allows for object methods (fixes #4711) (#6277) (Kai Cataldo) +* 89580a4 Docs: Distinguish examples in rules under Stylistic Issues part 5 (#6291) (Kenneth Williams) +* 1313804 New: rest-spread-spacing rule (fixes #5391) (#6278) (Kai Cataldo) +* 61dfe68 Fix: `no-useless-rename` false positive in babel-eslint (fixes #6266) (#6290) (alberto) +* c78c8cb Build: Remove commit check from appveyor (fixes #6292) (#6294) (alberto) +* 3e38fc1 Chore: more tests for comments at the end of blocks (refs #6090) (#6273) (Kai Cataldo) +* 38dccdd Docs: `--no-ignore` disables all forms of ignore (fixes #6260) (#6304) (alberto) +* bb69380 Fix: no-useless-rename handles ExperimentalRestProperty (fixes #6284) (#6288) (Kevin Partington) +* fca0679 Update: Improve perf not traversing default ignored dirs (fixes #5679) (#6276) (alberto) +* 320e8b0 Docs: Describe options in rules under Possible Errors part 4 (#6270) (Mark Pedrotti) +* 3e052c1 Docs: Mark no-useless-rename as fixable in rules index (#6297) (Dalton Santos) + +v2.11.1 - May 30, 2016 + +* 64b0d0c Fix: failed to parse `/*eslint` comments by colon (fixes #6224) (#6258) (Toru Nagashima) +* c8936eb Build: Don't check commit count (fixes #5935) (#6263) (Nicholas C. Zakas) +* 113c1a8 Fix: `max-statements-per-line` false positive at exports (fixes #6264) (#6268) (Toru Nagashima) +* 03beb27 Fix: `no-useless-rename` false positives (fixes #6266) (#6267) (alberto) +* fe89037 Docs: Fix rule name in example (#6279) (Kenneth Williams) + +v2.11.0 - May 27, 2016 + +* 77dd2b4 Fix: On --init, print message when package.json is invalid (fixes #6257) (#6261) (Kai Cataldo) +* 7f60186 Fix: `--ignore-pattern` can't uningnore files (fixes #6127) (#6253) (alberto) +* fea8fe6 New: no-useless-rename (fixes #6058) (#6249) (Kai Cataldo) +* b4cff9d Fix: Incorrect object-property-newline behavior (fixes #6207) (#6213) (Rafał Ruciński) +* 35b4656 Docs: Edit arrow-parens.md to show correct output value (#6245) (Adam Terlson) +* ee0cd58 Fix: `newline-before-return` shouldn't disallow newlines (fixes #6176) (#6217) (alberto) +* d4f5526 Fix: `vars-on-top` crashs at export declarations (fixes #6210) (#6220) (Toru Nagashima) +* 088bda9 New: `unicode-bom` rule to allow or disallow BOM (fixes #5502) (#6230) (Andrew Johnston) +* 14bfc03 Fix: `comma-dangle` wrong autofix (fixes #6233) (#6235) (Toru Nagashima) +* cdd65d7 Docs: added examples for arrow-body-style (refs #5498) (#6242) (Tieme van Veen) +* c10c07f Fix: lost code in autofixing (refs #6233) (#6234) (Toru Nagashima) +* e6d5b1f Docs: Add rule deprecation section to user guide (fixes #5845) (#6201) (Kai Cataldo) +* 777941e Upgrade: doctrine to 1.2.2 (fixes #6121) (#6231) (alberto) +* 74c458d Update: key-spacing rule whitespace fixer (fixes #6167) (#6169) (Ruurd Moelker) +* 04bd586 New: Disallow use of Object.prototype methods on objects (fixes #2693) (#6107) (Andrew Levine) +* 53754ec Update: max in `max-statements-per-line` should be >=0 (fixes #6171) (#6172) (alberto) +* 54d1201 Update: Add treatUndefinedAsUnspecified option (fixes #6026) (#6194) (Kenneth Williams) +* 18152dd Update: Add checkLoops option to no-constant-condition (fixes #5477) (#6202) (Kai Cataldo) +* 7644908 Fix: no-multiple-empty-lines BOF and EOF defaults (fixes #6179) (#6180) (Ruurd Moelker) +* 72335eb Fix: `max-statements-per-line` false positive (fixes #6173, fixes #6153) (#6192) (Toru Nagashima) +* 9fce04e Fix: `generator-star-spacing` false positive (fixes #6135) (#6168) (Toru Nagashima) + +v2.10.2 - May 16, 2016 + +* bda5de5 Fix: Remove default parser from CLIEngine options (fixes #6182) (#6183) (alberto) +* e59e5a0 Docs: Describe options in rules under Possible Errors part 3 (#6105) (Mark Pedrotti) +* 842ab2e Build: Run phantomjs tests using karma (fixes #6128) (#6178) (alberto) + +v2.10.1 - May 14, 2016 + +* 9397135 Fix: `valid-jsdoc` false positive at default parameters (fixes #6097) (#6170) (Toru Nagashima) +* 2166ad4 Fix: warning & error count in `CLIEngine.getErrorResults` (fixes #6155) (#6157) (alberto) +* 1e0a652 Fix: ignore empty statements in max-statements-per-line (fixes #6153) (#6156) (alberto) +* f9ca0d6 Fix: `no-extra-parens` to check for nulls (fixes #6161) (#6164) (Gyandeep Singh) +* d095ee3 Fix: Parser merge sequence in config (fixes #6158) (#6160) (Gyandeep Singh) +* f33e49f Fix: `no-return-assign` to check for null tokens (fixes #6159) (#6162) (Gyandeep Singh) + +v2.10.0 - May 13, 2016 + +* 098cd9c Docs: Distinguish examples in rules under Stylistic Issues part 4 (#6136) (Kenneth Williams) +* 805742c Docs: Clarify JSX option usage (#6132) (Richard Collins) +* 10b0933 Fix: Optimize no-irregular-whitespace for the common case (fixes #6116) (#6117) (Andres Suarez) +* 36bec90 Docs: linkify URLs in development-environment.md (#6150) (chrisjshull) +* 29c401a Docs: Convert rules in index under Removed from list to table (#6091) (Mark Pedrotti) +* e13e696 Fix: `_` and `$` in isES5Constructor (fixes #6085) (#6094) (Kevin Locke) +* 67916b9 Fix: `no-loop-func` crashed (fixes #6130) (#6138) (Toru Nagashima) +* d311a62 Fix: Sort fixes consistently even if they overlap (fixes #6124) (#6133) (alberto) +* 6294459 Docs: Correct syntax for default ignores and `.eslintignore` example (#6118) (alberto) +* 067db14 Fix: Replace `assert.deepEqual` by `lodash.isEqual` (fixes #6111) (#6112) (alberto) +* 52fdf04 Fix: `no-multiple-empty-lines` duplicate errors at BOF (fixes #6113) (#6114) (alberto) +* e6f56da Docs: Document `--ignore-pattern` (#6120) (alberto) +* ef739cd Fix: Merge various command line configs at the same time (fixes #6104) (#6108) (Ed Lee) +* 767da6f Update: add returnAssign option to no-extra-parens (fixes #6036) (#6095) (Kai Cataldo) +* 06f6252 Build: Use split instead of slice/indexOf for commit check (fixes #6109) (#6110) (Ed Lee) +* c4fc39b Docs: Update headings of rules under Removed (refs #5774) (#6102) (Mark Pedrotti) +* 716345f Build: Match rule id at beginning of heading (refs #5774) (#6089) (Mark Pedrotti) +* 0734967 Update: Add an option to `prefer-const` (fixes #5692) (#6040) (Toru Nagashima) +* 7941d5e Update: Add autofix for `lines-around-comment` (fixes #5956) (#6062) (alberto) +* dc538aa Build: Pin proxyquire to ">=1.0.0 <1.7.5" (fixes #6096) (#6100) (alberto) +* 04563ca Docs: Describe options in rules under Possible Errors part 2 (#6063) (Mark Pedrotti) +* 5d390b2 Chore: Replace deprecated calls to context - batch 4 (fixes #6029) (#6087) (alberto) +* 6df4b23 Fix: `no-return-assign` warning nested expressions (fixes #5913) (#6041) (Toru Nagashima) +* 16fad58 Merge pull request #6088 from eslint/docs-one-var-per-line (alberto) +* 0b67170 Docs: Correct default for `one-var-declaration-per-line` (fixes #6017) (#6022) (Ed Lee) +* d40017f Fix: comma-style accounts for parens in array (fixes #6006) (#6038) (Kai Cataldo) +* 992d9cf Docs: Fix typography/teriminology in indent doc (fixes #6045) (#6044) (Rich Trott) +* 4ae39d2 Chore: Replace deprecated calls to context - batch 3 (refs #6029) (#6056) (alberto) +* 8633e4d Update: multipass should not exit prematurely (fixes #5995) (#6048) (alberto) +* 3c44c2c Update: Adds an avoidQuotes option for object-shorthand (fixes #3366) (#5870) (Chris Sauvé) +* a9a4652 Fix: throw when rule uses `fix` but `meta.fixable` not set (fixes #5970) (#6043) (Vitor Balocco) +* ad10106 Docs: Update comma-style docs (#6039) (Kai Cataldo) +* 388d6f8 Fix: `no-sequences` false negative at arrow expressions (fixes #6082) (#6083) (Toru Nagashima) +* 8e96064 Docs: Clarify rule example in README since we allow string error levels (#6061) (Kevin Partington) +* a66bf19 Fix: `lines-around-comment` multiple errors on same line (fixes #5965) (#5994) (alberto) +* a2cc54e Docs: Organize meta and describe visitor in Working with Rules (#5967) (Mark Pedrotti) +* ef8cbff Fix: object-shorthand should only lint computed methods (fixes #6015) (#6024) (Kai Cataldo) +* cd1b057 Chore: Replace deprecated calls to context - batch 2 (refs #6029) (#6049) (alberto) +* a3a6e06 Update: no-irregal-whitespace in a regular expression (fixes #5840) (#6018) (Linda_pp) +* 9b9d76c Chore: Replace deprecated calls to context - batch 1 (refs #6029) (#6034) (alberto) +* dd8bf93 Fix: blockless else in max-statements-per-line (fixes #5926) (#5993) (Glen Mailer) +* f84eb80 New: Add new rule `object-property-newline` (fixes #5667) (#5933) (Vitor Balocco) +* d5f4104 Docs: mention parsing errors in strict mode (fixes #5485) (#5991) (Mark Pedrotti) +* 249732e Docs: Move docs from eslint.github.io (fixes #5964) (#6012) (Nicholas C. Zakas) +* 4c2de6c Docs: Add example of diff clarity to comma-dangle rule docs (#6035) (Vitor Balocco) +* 3db2e89 Fix: Do not swallow exceptions in CLIEngine.getFormatter (fixes #5977) (#5978) (Gustav Nikolaj) +* eb2fb44 Fix: Always ignore defaults unless explicitly passed (fixes #5547) (#5820) (Ian VanSchooten) +* ab57e94 Docs: Add example of diff clarity to newline-per-chained-call (#5986) (Vitor Balocco) +* 88bc014 Docs: Update readme info about jshint (#6027) (alberto) +* a2c15cc Docs: put config example in code block (#6005) (Amos Wenger) +* a5011cb Docs: Fix a wrong examples' header of `prefer-arrow-callback`. (#6020) (Toru Nagashima) +* 1484ede Docs: Typo in nodejs-api (#6025) (alberto) +* ade6a9b Docs: typo: "eslint-disable-line" not "eslint disable-line" (#6019) (Will Day) +* 2f15354 Fix: Removed false positives of break and continue (fixes #5972) (#6000) (Onur Temizkan) + +v2.9.0 - April 29, 2016 + +* a8a2cd8 Fix: Avoid autoconfig crashes from inline comments (fixes #5992) (#5999) (Ian VanSchooten) +* 23b00e0 Upgrade: npm-license to 0.3.2 (fixes #5996) (#5998) (alberto) +* 377167d Upgrade: ignore to 3.1.2 (fixes #5979) (#5988) (alberto) +* 141b778 Fix: no-control-regex literal handling fixed. (fixes #5737) (#5943) (Efe Gürkan YALAMAN) +* 577757d Fix: Clarify color option (fixes #5928) (#5974) (Grant Snodgrass) +* e7e6581 Docs: Update CLA link (#5980) (Gustav Nikolaj) +* 0be26bc Build: Add nodejs 6 to travis (fixes #5971) (#5973) (Gyandeep Singh) +* e606523 New: Rule `no-unsafe-finally` (fixes #5808) (#5932) (Onur Temizkan) +* 42d1ecc Chore: Add metadata to existing rules - Batch 7 (refs #5417) (#5969) (Vitor Balocco) +* e2ad1ec Update: object-shorthand lints computed methods (fixes #5871) (#5963) (Chris Sauvé) +* d24516a Chore: Add metadata to existing rules - Batch 6 (refs #5417) (#5966) (Vitor Balocco) +* 1e7a3ef Fix: `id-match` false positive in property values (fixes #5885) (#5960) (Mike Sherov) +* 51ddd4b Update: Use process @abstract when processing @return (fixes #5941) (#5945) (Simon Schick) +* 52a4bea Update: Add autofix for `no-whitespace-before-property` (fixes #5927) (#5951) (alberto) +* 46e058d Docs: Correct typo in configuring.md (#5957) (Nick S. Plekhanov) +* 5f8abab Chore: Add metadata to existing rules - Batch 5 (refs #5417) (#5944) (Vitor Balocco) +* 0562f77 Chore: Add missing newlines to test cases (fixes #5947) (Rich Trott) +* fc78e78 Chore: Enable quote-props rule in eslint-config-eslint (refs #5188) (#5938) (Gyandeep Singh) +* 43f6d05 Docs: Update docs to refer to column (#5937) (Sashko Stubailo) +* 586478e Update: Add autofix for `comma-dangle` (fixes #3805) (#5925) (alberto) +* a4f9c5a Docs: Distinguish examples in rules under Stylistic Issues part 3 (Kenneth Williams) +* e7c0737 Chore: Enable no-console rule in eslint-config-eslint (refs #5188) (Kevin Partington) +* 0023fe6 Build: Add “chore” to commit tags (fixes #5880) (#5929) (Mike Sherov) +* 25d626a Upgrade: espree 3.1.4 (fixes #5923, fixes #5756) (Kai Cataldo) +* a01b412 New: Add `no-useless-computed-key` rule (fixes #5402) (Burak Yigit Kaya) +* 9afb9cb Chore: Remove workaround for espree and escope bugs (fixes #5852) (alberto) +* 3ffc582 Chore: Update copyright and license info (alberto) +* 249eb40 Docs: Clarify init sets up local installation (fixes #5874) (Kai Cataldo) +* 6cd8c86 Docs: Describe options in rules under Possible Errors part 1 (Mark Pedrotti) +* f842d18 Fix: `no-this-before-super` crash on unreachable paths (fixes #5894) (Toru Nagashima) +* a02960b Docs: Fix missing delimiter in README links (Kevin Partington) +* 3a9e72c Docs: Update developer guide with new standards (Nicholas C. Zakas) +* cb78585 Update: Add `allowUnboundThis` to `prefer-arrow-callback` (fixes #4668) (Burak Yigit Kaya) +* 02be29f Chore: Remove CLA check from bot (Nicholas C. Zakas) +* 220713e Chore: Add metadata to existing rules - Batch 4 (refs #5417) (Vitor Balocco) +* df53414 Chore: Include jQuery Foundation info (Nicholas C. Zakas) +* f1b2992 Fix: `no-useless-escape` false positive in JSXAttribute (fixes #5882) (Toru Nagashima) +* 74674ad Docs: Move `sort-imports` to 'ECMAScript 6' (Kenneth Williams) +* ae69ddb Docs: Fix severity type in example (Kenneth Williams) +* 19f6fff Update: Autofixing does multiple passes (refs #5329) (Nicholas C. Zakas) +* 1e4b0ca Docs: Reduce length of paragraphs in rules index (Mark Pedrotti) +* 8cfe1eb Docs: Fix a wrong option (Zach Orlovsky) +* 8f6739f Docs: Add alberto as reviewer (alberto) +* 2ae4938 Docs: Fix message for `inline-config` option (alberto) +* 089900b Docs: Fix a wrong rule name in an example (Toru Nagashima) +* c032b41 Docs: Fix emphasis (Toru Nagashima) +* ae606f0 Docs: Update JSCS info in README (alberto) +* a9c5323 Fix: Install ESLint on init if not installed (fixes #5833) (Kai Cataldo) +* ed38358 Docs: Removed incorrect example (James M. Greene) +* af3113c Docs: Fix config comments in indent docs (Brandon Mills) +* 2b39461 Update: `commentPattern` option for `default-case` rule (fixes #5803) (Artyom Lvov) + +v2.8.0 - April 15, 2016 + +* a8821a5 Docs: Distinguish examples in rules under Stylistic Issues part 2 (Kenneth Williams) +* 76913b6 Update: Add metadata to existing rules - Batch 3 (refs #5417) (Vitor Balocco) +* 34ad8d2 Fix: Check that module.paths exists (fixes #5791) (Nicholas C. Zakas) +* 37239b1 Docs: Add new members of the team (Ilya Volodin) +* fb3c2eb Update: allow template literals (fixes #5234) (Jonathan Haines) +* 5a4a935 Update: Add metadata to existing rules - Batch 2 (refs #5417) (Vitor Balocco) +* ea2e625 Fix: newline-before-return handles return as first token (fixes #5816) (Kevin Partington) +* f8db9c9 Update: add nestedBinaryExpressions to no-extra-parens (fixes #3065) (Ilya Volodin) +* 0045d57 Update: `allowNamedFunctions` in `prefer-arrow-callback` (fixes #5675) (alberto) +* 19da72a Update: Add metadata to existing rules - Batch 1 (refs #5417) (Vitor Balocco) +* cc14e43 Fix: `no-fallthrough` empty case with comment (fixes #5799) (alberto) +* 13c8b14 Fix: LogicalExpression checks for short circuit (fixes #5693) (Vamshi krishna) +* 73b225e Fix: Document and fix metadata (refs #5417) (Ilya Volodin) +* 882d199 Docs: Improve options description in `no-redeclare` (alberto) +* 6a71ceb Docs: Improve options description in `no-params-reassign` (alberto) +* 24b6215 Update: Include 'typeof' in rule 'no-constant-condition' (fixes #5228) (Vamshi krishna) +* a959063 Docs: Remove link to deprecated ESLintTester project (refs #3110) (Trey Thomas) +* 6fd7d82 Update: Change order in `eslint --init` env options (fixes #5742) (alberto) +* c59d909 Fix: Extra paren check around object arrow bodies (fixes #5789) (Brandon Mills) +* 6f88546 Docs: Use double quotes for better Win compatibility (fixes #5796) (alberto) +* 02743d5 Fix: catch self-assignment operators in `no-magic-number` (fixes #4400) (alberto) +* c94e74e Docs: Make rule descriptions more consistent (Kenneth Williams) +* 6028252 Docs: Distinguish examples in rules under Stylistic Issues part 1 (Mark Pedrotti) +* ccd8ca9 Fix: Added property onlyDeclaration to id-match rule (fixes #3488) (Gajus Kuizinas) +* 6703c02 Update: no-useless-escape / exact locations of errors (fixes #5751) (Onur Temizkan) +* 3d84b91 Fix: ignore trailing whitespace in template literal (fixes #5786) (Kai Cataldo) +* b0e6bc4 Update: add allowEmptyCatch option to no-empty (fixes #5800) (Kai Cataldo) +* f1f1dd7 Docs: Add @pedrottimark as a committer (Brandon Mills) +* 228f201 Update: `commentPattern` option for `no-fallthrough` rule (fixes #5757) (Artyom Lvov) +* 41db670 Docs: Clarify disable inline comments (Kai Cataldo) +* 9c9a295 Docs: Add note about shell vs node glob parameters in cli (alberto) +* 5308ff9 Docs: Add code backticks to sentence in fixable rules (Mark Pedrotti) +* 965ec06 Docs: fix the examples for space-before-function-paren. (Craig Silverstein) +* 2b202fc Update: Add ignore option to space-before-function-parens (fixes #4127) (Craig Silverstein) +* 24c12ba Fix: improve `constructor-super` errors for literals (fixes #5449) (Toru Nagashima) + +v2.7.0 - April 4, 2016 + +* 134cb1f Revert "Update: adds nestedBinaryExpressions for no-extra-parens rule (fixes #3065)" (Ilya Volodin) +* 7e80867 Docs: Update sentence in fixable rules (Mark Pedrotti) +* 1b6d5a3 Update: adds nestedBinaryExpressions for no-extra-parens (fixes #3065) (Nick Fisher) +* 4f93c32 Docs: Clarify `array-bracket-spacing` with newlines (fixes #5768) (alberto) +* 161ddac Fix: remove `console.dir` (fixes #5770) (Toru Nagashima) +* 0c33f6a Fix: indent rule uses wrong node for class indent level (fixes #5764) (Paul O’Shannessy) + +v2.6.0 - April 1, 2016 + +* ce2accd Fix: vars-on-top now accepts exported variables (fixes #5711) (Olmo Kramer) +* 7aacba7 Update: Deprecate option `maximum` in favor of `max` (fixes #5685) (Vitor Balocco) +* 5fe6fca Fix: no-useless-escape \B regex escape (fixes #5750) (Onur Temizkan) +* 9b73ffd Update: `destructuring` option of `prefer-const` rule (fixes #5594) (Toru Nagashima) +* 8ac9206 Docs: Typo in `sort-imports` (alberto) +* 12902c5 Fix: valid-jsdoc crash w/ Field & Array Type (fixes #5745) (fixes #5746) (Burak Yigit Kaya) +* 2c8b65a Docs: Edit examples for a few rules (Mark Pedrotti) +* d736bc2 Fix: Treat SwitchCase like a block in lines-around-comment (fixes #5718) (Scott O'Hara) +* 24a61a4 Update: make `no-useless-escape` allowing line breaks (fixes #5689) (Toru Nagashima) +* 4ecd45e Fix: Ensure proper lookup of config files (fixes #5175, fixes #5468) (Nicholas C. Zakas) +* 088e26b Fix: Update doctrine to allow hyphens in JSDoc names (fixes #5612) (Kai Cataldo) +* 692fd5d Upgrade: Old Chalk.JS deprecated method (fixes #5716) (Morris Singer) +* f59d91d Update: no-param-reassign error msgs (fixes #5705) (Isaac Levy) +* c1b16cd Fix: Object spread throws error in key-spacing rule. (fixes #5724) (Ziad El Khoury Hanna) +* 3091613 Docs: Correct explanation about properties (James Monger) +* cb0f0be Fix: Lint issue with `valid-jsdoc` rule (refs #5188) (Gyandeep Singh) +* aba1954 Build: Ignore jsdoc folder internally (fixes #5714) (alberto) +* a35f127 Fix: Lint for eslint project in regards to vars (refs #5188) (Gyandeep Singh) +* d9ab4f0 Fix: Windows scoped package configs (fixes #5644) (Nicholas C. Zakas) +* 8d0cd0d Update: Basic valid-jsdoc default parameter support (fixes #5658) (Tom Andrews) + +v2.5.3 - March 28, 2016 + +* 8749ac5 Build: Disable bundling dependencies (fixes #5687) (Nicholas C. Zakas) + +v2.5.2 - March 28, 2016 + +* 1cc7f8e Docs: Remove mention of minimatch for .eslintignore (Ian VanSchooten) +* 5bd69a9 Docs: Reorder FAQ in README (alberto) +* 98e6bd9 Fix: Correct default for indentation in `eslint --init` (fixes #5698) (alberto) +* 679095e Fix: make the default of `options.cwd` in runtime (fixes #5694) (Toru Nagashima) +* 4f06f2f Docs: Distinguish examples in rules under Best Practices part 2 (Mark Pedrotti) +* 013a18e Build: Fix bundling script (fixes #5680) (Nicholas C. Zakas) +* 8c5d954 Docs: Typo fix (István Donkó) +* 09659d6 Docs: Use string severity (Kenneth Williams) +* a4ae769 Docs: Manual changelog update for v2.5.1 (Nicholas C. Zakas) +* c41fab9 Fix: don't use path.extname with undefined value (fixes #5678) (Myles Borins) + +v2.5.1 - March 25, 2016 + +* Build: No functional changes, just republished with a working package. + +v2.5.0 - March 25, 2016 + +* 7021aa9 Fix: lines-around-comment in ESLint repo, part 2 (refs #5188) (Kevin Partington) +* 095c435 Docs: Remove ES2016 from experimental section of README (Kevin Partington) +* 646f863 Build: Bundle dependencies in package.json (fixes #5013) (Nicholas C. Zakas) +* ea06868 Docs: Clarify --ext does not apply to globs (fixes #5452) (Ian VanSchooten) +* 569c478 Build: Fix phantomjs CI problems (fixes #5666) (alberto) +* 6022426 Docs: Add link to chat room in README primary links (alberto) +* 2fbb530 Docs: Add link to "Proposing a Rule Change" in README (alberto) +* 25bf491 Upgrade: globals 9.x (fixes #5668) (Toru Nagashima) +* d6f8409 New: Rule - No useless escape (fixes #5460) (Onur Temizkan) +* 12a43f1 Docs: remove brace expansion from configuring.md (refs #5314) (Jonathan Haines) +* 92d1749 New: max-statements-per-line (fixes #5424) (Kenneth Williams) +* aaf324a Fix: missing support for json sub configs (fixes #5413) (Noam Okman) +* 48ad5fe Update: Add 'caughtErrors' to rule no-unused-vars (fixes #3837) (vamshi) +* ad90c2b Fix: incorrect config message (fixes #5653) (s0ph1e) +* a551831 Docs: Distinguish examples in rules under Node.js and CommonJS (Mark Pedrotti) +* 83cd651 Upgrade: chai to 3.5.0 (fixes #5647) (alberto) +* 32748dc Fix: `radix` rule false positive at shadowed variables (fixes #5639) (Toru Nagashima) +* 66db38d Fix: `--no-ignore` should not un-ignore default ignores (fixes #5547) (alberto) +* e3e06f3 Docs: Distinguish examples in rules under Best Practices part 4 (Mark Pedrotti) +* a9f0865 Docs: Update no-sequences rule docs for clarity (fixes #5536) (Kai Cataldo) +* bae7b30 Docs: Add michaelficarra as committer (alberto) +* e2990e7 Docs: Consistent wording in rules README (alberto) +* 49b4d2a Docs: Update team list with new members (Ilya Volodin) +* d0ae66c Update: Allow autoconfiguration for JSX code (fixes #5511) (Ian VanSchooten) +* 38a0a64 Docs: Clarify `linebreak-style` docs (fixes #5628) (alberto) +* 4b7305e Fix: Allow default ignored files to be unignored (fixes #5410) (Ian VanSchooten) +* 4b05ce6 Update: Enforce repo coding conventions via ESLint (refs #5188) (Kevin Partington) +* 051b255 Docs: Remove or rewrite references to former ecmaFeatures (Mark Pedrotti) +* 9a22625 Fix: `prefer-const` false positive at non-blocked if (fixes #5610) (Toru Nagashima) +* b1fd482 Fix: leading comments added from previous node (fixes #5531) (Kai Cataldo) +* c335650 Docs: correct the no-confusing-arrow docs (Daniel Norman) +* e94b77d Fix: Respect 'ignoreTrailingComments' in max-len rule (fixes #5563) (Vamshi Krishna) +* 9289ef8 Fix: handle personal package.json without config (fixes #5496) (Denny Christochowitz) +* 87d74b2 Fix: `prefer-const` got to not change scopes (refs #5284) (Toru Nagashima) +* 5a881e7 Docs: Fix typo in code snippet for no-unmodified-loop-condition rule (Chris Rebert) +* 03037c2 Update: Overrides for space-unary-ops (fixes #5060) (Afnan Fahim) +* 24d986a Update: replace MD5 hashing of cache files with MurmurHash (fixes #5522) (Michael Ficarra) +* f405030 Fix: Ensure allowing `await` as a property name (fixes #5564) (Toru Nagashima) +* aefc90c Fix: `no-useless-constructor` clash (fixes #5573) (Toru Nagashima) +* 9eaa20d Docs: Fix typo in CLI help message (ryym) +* a7c3e67 Docs: Invalid json in `configuring.md` (alberto) +* 4e50332 Docs: Make `prefer-template` examples consistent. (alberto) +* cfc14a9 Fix: valid-jsdoc correctly checks type union (fixes #5260) (Kai Cataldo) +* 689cb7d Fix: `quote-props` false positive on certain keys (fixes #5532) (Burak Yigit Kaya) +* 167a03a Fix: `brace-style` erroneously ignoring certain errors (fixes #5197) (Burak Yigit Kaya) +* 3133f28 Fix: object-curly-spacing doesn't know types (fixes #5537) (fixes #5538) (Burak Yigit Kaya) +* d0ca171 Docs: Separate parser and config questions in issue template (Kevin Partington) +* bc769ca Fix: Improve file path resolution (fixes #5314) (Ian VanSchooten) +* 9ca8567 Docs: Distinguish examples in rules under Best Practices part 3 (Mark Pedrotti) +* b9c69f1 Docs: Distinguish examples in rules under Variables part 2 (Mark Pedrotti) +* c289414 New: `no-duplicate-imports` rule (fixes #3478) (Simen Bekkhus) + +v2.4.0 - March 11, 2016 + +* 97b2466 Fix: estraverse/escope to work with unknowns (fixes #5476) (Nicholas C. Zakas) +* 641b3f7 Fix: validate the type of severity level (fixes #5499) (Shinnosuke Watanabe) +* 9ee8869 Docs: no-unused-expressions - add more edge unusable and usable examples (Brett Zamir) +* 56bf864 Docs: Create parity between no-sequences examples (Brett Zamir) +* 13ef1c7 New: add `--parser-options` to CLI (fixes #5495) (Jordan Harband) +* ae1ee54 Docs: fix func-style arrow exception option (Craig Martin) +* 91852fd Docs: no-lone-blocks - show non-problematic (and problematic) label (Brett Zamir) +* b34458f Docs: Rearrange rules for better categories (and improve rule summaries) (Brett Zamir) +* 1198b26 Docs: Minor README clarifications (Brett Zamir) +* 03e6869 Fix: newline-before-return: bug with comment (fixes #5480) (mustafa) +* ad100fd Fix: overindent in VariableDeclarator parens or brackets (fixes #5492) (David Greenspan) +* 9b8e04b Docs: Replace all node references to Node.js which is the official name (Brett Zamir) +* cc1f2f0 Docs: Minor fixes in no-new-func (Brett Zamir) +* 6ab81d4 Docs: Distinguish examples in rules under Best Practices part 1 (Mark Pedrotti) +* 9c6c70c Update: add `allowParens` option to `no-confusing-arrow` (fixes #5332) (Burak Yigit Kaya) +* 979c096 Docs: Document linebreak-style as fixable. (Afnan Fahim) +* 9f18a81 Fix: Ignore destructuring assignment in `object-shorthand` (fixes #5488) (alberto) +* 5d9a798 Docs: README.md, prefer-const; change modified to reassigned (Michiel de Bruijne) +* 38eb7f1 Fix: key-spacing checks ObjectExpression is multiline (fixes #5479) (Kevin Partington) +* 9592c45 Fix: `no-unmodified-loop-condition` false positive (fixes #5445) (Toru Nagashima) + +v2.3.0 - March 4, 2016 + +* 1b2c6e0 Update: Proposed no-magic-numbers option: ignoreJSXNumbers (fixes #5348) (Brandon Beeks) +* 63c0b7d Docs: Fix incorrect environment ref. in Rules in Plugins. (fixes #5421) (Jesse McCarthy) +* 124c447 Build: Add additional linebreak to docs (fixes #5464) (Ilya Volodin) +* 0d3831b Docs: Add RuleTester parserOptions migration steps (Kevin Partington) +* 50f4d5a Fix: extends chain (fixes #5411) (Toru Nagashima) +* 0547072 Update: Replace getLast() with lodash.last() (fixes #5456) (Jordan Eldredge) +* 8c29946 Docs: Distinguish examples in rules under Possible Errors part 1 (Mark Pedrotti) +* 5319b4a Docs: Distinguish examples in rules under Possible Errors part 2 (Mark Pedrotti) +* 1da2420 Fix: crash when SourceCode object was reused (fixes #5007) (Toru Nagashima) +* 9e9daab New: newline-before-return rule (fixes #5009) (Kai Cataldo) +* e1bbe45 Fix: Check space after anonymous generator star (fixes #5435) (alberto) +* 119e0ed Docs: Distinguish examples in rules under Variables (Mark Pedrotti) +* 905c049 Fix: `no-undef` false positive at new.target (fixes #5420) (Toru Nagashima) +* 4a67b9a Update: Add ES7 support (fixes #5401) (Brandon Mills) +* 89c757d Docs: Replace ecmaFeatures with parserOptions in working-with-rules (Kevin Partington) +* 804c08e Docs: Add parserOptions to RuleTester section of working-with-rules (Kevin Partington) +* 1982c50 Docs: Document string option for `no-unused-vars`. (alberto) +* 4f82b2b Update: Support classes in `padded-blocks` (fixes #5092) (alberto) +* ed5564f Docs: Specify results of `no-unused-var` with `args` (fixes #5334) (chinesedfan) +* de0a4ef Fix: `getFormatter` throws an error when called as static (fixes #5378) (cowchimp) +* 78f7ca9 Fix: Prevent crash from swallowing console.log (fixes #5381) (Ian VanSchooten) +* 34b648d Fix: remove tests which have invalid syntax (fixes #5405) (Toru Nagashima) +* 7de5ae4 Docs: Missing allow option in docs (Scott O'Hara) +* cf14c71 Fix: `no-useless-constructor` rule crashes sometimes (fixes #5290) (Burak Yigit Kaya) +* 70e3a02 Update: Allow string severity in config (fixes #3626) (Nicholas C. Zakas) +* 13c7c19 Update: Exclude ES5 constructors from consistent-return (fixes #5379) (Kevin Locke) +* 784d3bf Fix: Location info in `dot-notation` rule (fixes #5397) (Gyandeep Singh) +* 6280b2d Update: Support switch statements in padded-blocks (fixes #5056) (alberto) +* 25a5b2c Fix: Allow irregular whitespace in comments (fixes #5368) (Christophe Porteneuve) +* 560c0d9 New: no-restricted-globals rule implementation (fixes #3966) (Benoît Zugmeyer) +* c5bb478 Fix: `constructor-super` false positive after a loop (fixes #5394) (Toru Nagashima) +* 6c0c4aa Docs: Add Issue template (fixes #5313) (Kai Cataldo) +* 1170e67 Fix: indent rule doesn't handle constructor instantiation (fixes #5384) (Nate Cavanaugh) +* 6bc9932 Fix: Avoid magic numbers in rule options (fixes #4182) (Brandon Beeks) +* 694e1c1 Fix: Add tests to cover default magic number tests (fixes #5385) (Brandon Beeks) +* 0b5349d Fix: .eslintignore paths should be absolute (fixes #5362) (alberto) +* 8f6c2e7 Update: Better error message for plugins (refs #5221) (Nicholas C. Zakas) +* 972d41b Update: Improve error message for rule-tester (fixes #5369) (Jeroen Engels) +* fe3f6bd Fix: `no-self-assign` false positive at shorthand (fixes #5371) (Toru Nagashima) +* 2376291 Docs: Missing space in `no-fallthrough` doc. (alberto) +* 5aedb87 Docs: Add mysticatea as reviewer (Nicholas C. Zakas) +* 1f9fd10 Update: no-invalid-regexp allows custom flags (fixes #5249) (Afnan Fahim) +* f1eab9b Fix: Support for dash and slash in `valid-jsdoc` (fixes #1598) (Gyandeep Singh) +* cd12a4b Fix:`newline-per-chained-call` should only warn on methods (fixes #5289) (Burak Yigit Kaya) +* 0d1377d Docs: Add missing `symbol` type into valid list (Plusb Preco) +* 6aa2380 Update: prefer-const; change modified to reassigned (fixes #5350) (Michiel de Bruijne) +* d1d62c6 Fix: indent check for else keyword with Stroustrup style (fixes #5218) (Gyandeep Singh) +* 7932f78 Build: Fix commit message validation (fixes #5340) (Nicholas C. Zakas) +* 1c347f5 Fix: Cleanup temp files from tests (fixes #5338) (Nick) +* 2f3e1ae Build: Change rules to warnings in perf test (fixes #5330) (Brandon Mills) +* 36f40c2 Docs: Achieve consistent order of h2 in rule pages (Mark Pedrotti) + +v2.2.0 - February 19, 2016 + +* 45a22b5 Docs: remove esprima-fb from suggested parsers (Henry Zhu) +* a4d9cd3 Docs: Fix semi rule typo (Brandon Mills) +* 9d005c0 Docs: Correct option name in `no-implicit-coercion` rule (Neil Kistner) +* 2977248 Fix: Do not cache `.eslintrc.js` (fixes #5067) (Nick) +* 211eb8f Fix: no-multi-spaces conflicts with smart tabs (fixes #2077) (Afnan Fahim) +* 6dc9483 Fix: Crash in `constructor-super` (fixes #5319) (Burak Yigit Kaya) +* 3f48875 Docs: Fix yield star spacing examples (Dmitriy Lazarev) +* 4dab76e Docs: Update `preferType` heading to keep code format (fixes #5307) (chinesedfan) +* 7020b82 Fix: `sort-imports` warned between default and members (fixes #5305) (Toru Nagashima) +* 2f4cd1c Fix: `constructor-super` and `no-this-before-super` false (fixes #5261) (Toru Nagashima) +* 59e9c5b New: eslint-disable-next-line (fixes #5206) (Kai Cataldo) +* afb6708 Fix: `indent` rule forgot about some CallExpressions (fixes #5295) (Burak Yigit Kaya) +* d18d406 Docs: Update PR creation bot message (fixes #5268) (Nicholas C. Zakas) +* 0b1cd19 Fix: Ignore parser option if set to default parser (fixes #5241) (Kai Cataldo) + +v2.1.0 - February 15, 2016 + +* 7981ef5 Build: Fix release script (Nicholas C. Zakas) +* c9c34ea Fix: Skip computed members in `newline-per-chained-call` (fixes #5245) (Burak Yigit Kaya) +* b32ddad Build: `npm run perf` command should check the exit code (fixes #5279) (Burak Yigit Kaya) +* 6580d1c Docs: Fix incorrect `api.verify` JSDoc for `config` param (refs #5104) (Burak Yigit Kaya) +* 1f47868 Docs: Update yield-star-spacing documentation for 2.0.0 (fixes #5272) (Burak Yigit Kaya) +* 29da8aa Fix: `newline-after-var` crash on a switch statement (fixes #5277) (Toru Nagashima) +* 86c5a20 Fix: `func-style` should ignore ExportDefaultDeclarations (fixes #5183) (Burak Yigit Kaya) +* ba287aa Fix: Consolidate try/catches to top levels (fixes #5243) (Ian VanSchooten) +* 3ef5da1 Docs: Update no-magic-numbers#ignorearrayindexes. (KazuakiM) +* 0d6850e Update: Allow var declaration at end of block (fixes #5246) (alberto) +* c1e3a73 Fix: Popular style init handles missing package.json keys (refs #5243) (Brandon Mills) +* 68c6e22 Docs: fix default value of `keyword-spacing`'s overrides option. (Toru Nagashima) +* 00fe46f Upgrade: inquirer (fixes #5265) (Bogdan Chadkin) +* ef729d7 Docs: Remove option that is not being used in max-len rule (Thanos Lefteris) +* 4a5ddd5 Docs: Fix rule config above examples for require-jsdoc (Thanos Lefteris) +* c5cbc1b Docs: Add rule config above each example in jsx-quotes (Thanos Lefteris) +* f0aceba Docs: Correct alphabetical ordering in rule list (Randy Coulman) +* 1651ffa Docs: update migrating to 2.0.0 (fixes #5232) (Toru Nagashima) +* 9078537 Fix: `indent` on variable declaration with separate array (fixes #5237) (Burak Yigit Kaya) +* f8868b2 Docs: Typo fix in consistent-this rule doc fixes #5240 (Nicolas Froidure) +* 44f6915 Fix: ESLint Bot mentions the wrong person for extra info (fixes #5229) (Burak Yigit Kaya) +* c612a8e Fix: `no-empty-function` crash (fixes #5227) (Toru Nagashima) +* ae663b6 Docs: Add links for issue documentation (Nicholas C. Zakas) +* 717bede Build: Switch to using eslint-release (fixes #5223) (Nicholas C. Zakas) +* 980e139 Fix: Combine all answers for processAnswers (fixes #5220) (Ian VanSchooten) +* 1f2a1d5 Docs: Remove inline errors from doc examples (fixes #4104) (Burak Yigit Kaya) + +v2.0.0 - February 12, 2016 + +* cc3a66b Docs: Issue message when more info is needed (Nicholas C. Zakas) +* 2bc40fa Docs: Simplify hierarchy of headings in rule pages (Mark Pedrotti) +* 1666254 Docs: Add note about only-whitespace rule for `--fix` (fixes #4774) (Burak Yigit Kaya) +* 2fa09d2 Docs: Add `quotes` to related section of `prefer-template` (fixes #5192) (Burak Yigit Kaya) +* 7b12995 Fix: `key-spacing` not enforcing no-space in minimum mode (fixes #5008) (Burak Yigit Kaya) +* c1c4f4d Breaking: new `no-empty-function` rule (fixes #5161) (Toru Nagashima) + +v2.0.0-rc.1 - February 9, 2016 + +* 4dad82a Update: Adding shared environment for node and browser (refs #5196) (Eli White) +* b46c893 Fix: Config file relative paths (fixes #5164, fixes #5160) (Nicholas C. Zakas) +* aa5b2ac Fix: no-whitespace-before-property fixes (fixes #5167) (Kai Cataldo) +* 4e99924 Update: Replace several dependencies with lodash (fixes #5012) (Gajus Kuizinas) +* 718dc68 Docs: Remove periods in rules' README for consistency. (alberto) +* 7a47085 Docs: Correct `arrow-spacing` overview. (alberto) +* a4cde1b Docs: Clarify global-require inside try/catch (fixes #3834) (Brandon Mills) +* fd07925 Docs: Clarify docs for api.verify (fixes #5101, fixes #5104) (Burak Yigit Kaya) +* 413247f New: Add a --print-config flag (fixes #5099) (Christopher Crouzet) +* efeef42 Update: Implement auto fix for space-in-parens (fixes #5050) (alberto) +* e07fdd4 Fix: code path analysis and labels (fixes #5171) (Toru Nagashima) +* 2417bb2 Fix: `no-unmodified-loop-condition` false positive (fixes #5166) (Toru Nagashima) +* fae1884 Fix: Allow same-line comments in padded-blocks (fixes #5055) (Brandon Mills) +* a24d8ad Fix: Improve autoconfig logging (fixes #5119) (Ian VanSchooten) +* e525923 Docs: Correct obvious inconsistencies in rules h2 elements (Mark Pedrotti) +* 9675b5e Docs: `avoid-escape` does not allow backticks (fixes #5147) (alberto) +* a03919a Fix: `no-unexpected-multiline` false positive (fixes #5148) (Feross Aboukhadijeh) +* 74360d6 Docs: Note no-empty applies to empty block statements (fixes #5105) (alberto) +* 6eeaa3f Build: Remove pending tests (fixes #5126) (Ian VanSchooten) +* 02c83df Docs: Update docs/rules/no-plusplus.md (Sheldon Griffin) +* 0c4de5c New: Added "table" formatter (fixes #4037) (Gajus Kuizinas) +* 0a59926 Update: 'implied strict mode' ecmaFeature (fixes #4832) (Nick Evans) +* 53a6eb3 Fix: Handle singular case in rule-tester error message (fixes #5141) (Bryan Smith) +* 97ac91c Build: Increment eslint-config-eslint (Nicholas C. Zakas) + +v2.0.0-rc.0 - February 2, 2016 + +* 973c499 Fix: `sort-imports` crash (fixes #5130) (Toru Nagashima) +* e64b2c2 Breaking: remove `no-empty-label` (fixes #5042) (Toru Nagashima) +* 79ebbc9 Breaking: update `eslint:recommended` (fixes #5103) (Toru Nagashima) +* e1d7368 New: `no-extra-label` rule (fixes #5059) (Toru Nagashima) +* c83b48c Fix: find ignore file only in cwd (fixes #5087) (Nicholas C. Zakas) +* 3a24240 Docs: Fix jsdoc param names to match function param names (Thanos Lefteris) +* 1d79746 Docs: Replace ecmaFeatures setting with link to config page (Thanos Lefteris) +* e96ffd2 New: `template-curly-spacing` rule (fixes #5049) (Toru Nagashima) +* 4b02902 Update: Extended no-console rule (fixes #5095) (EricHenry) +* 757651e Docs: Remove reference to rules enabled by default (fixes #5100) (Brandon Mills) +* 0d87f5d Docs: Clarify eslint-disable comments only affect rules (fixes #5005) (Brandon Mills) +* 1e791a2 New: `no-self-assign` rule (fixes #4729) (Toru Nagashima) +* c706eb9 Fix: reduced `no-loop-func` false positive (fixes #5044) (Toru Nagashima) +* 3275e86 Update: Add extra aliases to consistent-this rule (fixes #4492) (Zachary Alexander Belford) +* a227360 Docs: Replace joyent org with nodejs (Thanos Lefteris) +* b2aedfe New: Rule to enforce newline after each call in the chain (fixes #4538) (Rajendra Patil) +* d67bfdd New: `no-unused-labels` rule (fixes #5052) (Toru Nagashima) + +v2.0.0-beta.3 - January 29, 2016 + +* 86a3e3d Update: Remove blank lines at beginning of files (fixes #5045) (Jared Sohn) +* 4fea752 New: Autoconfiguration from source inspection (fixes #3567) (Ian VanSchooten) +* 519f39f Breaking: Remove deprecated rules (fixes #5032) (Gyandeep Singh) +* c75ee4a New: Add support for configs in plugins (fixes #3659) (Ilya Volodin) +* 361377f Fix: `prefer-const` false positive reading before writing (fixes #5074) (Toru Nagashima) +* ff2551d Build: Improve `npm run perf` command (fixes #5028) (Toru Nagashima) +* bcca69b Update: add int32Hint option to `no-bitwise` rule (fixes #4873) (Maga D. Zandaqo) +* e3f2683 Update: config extends dependency lookup (fixes #5023) (Nicholas C. Zakas) +* a327a06 Fix: Indent rule for allman brace style scenario (fixes #5064) (Gyandeep Singh) +* afdff6d Fix: `no-extra-bind` false positive (fixes #5058) (Toru Nagashima) +* c1fad4f Update: add autofix support for spaced-comment (fixes #4969, fixes #5030) (Maga D. Zandaqo) +* 889b942 Revert "Docs: Update readme for legend describing rules icons (refs #4355)" (Nicholas C. Zakas) +* b0f21a0 Fix: `keyword-spacing` false positive in template strings (fixes #5043) (Toru Nagashima) +* 53fa5d1 Fix: `prefer-const` false positive in a loop condition (fixes #5024) (Toru Nagashima) +* 385d399 Docs: Update readme for legend describing rules icons (Kai Cataldo) +* 505f1a6 Update: Allow parser to be relative to config (fixes #4985) (Nicholas C. Zakas) +* 79e8a0b New: `one-var-declaration-per-line` rule (fixes #1622) (alberto) +* 654e6e1 Update: Check extra Boolean calls in no-extra-boolean-cast (fixes #3650) (Andrew Sutton) + +v2.0.0-beta.2 - January 22, 2016 + +* 3fa834f Docs: Fix formatter links (fixes #5006) (Gyandeep Singh) +* 54b1bc8 Docs: Fix link in strict.md (fixes #5026) (Nick Evans) +* e0c5cf7 Upgrade: Espree to 3.0.0 (fixes #5018) (Ilya Volodin) +* 69f149d Docs: language tweaks (Andres Kalle) +* 2b33c74 Update: valid-jsdoc to not require @return in constructors (fixes #4976) (Maga D. Zandaqo) +* 6ac2e01 Docs: Fix description of exported comment (Mickael Jeanroy) +* 29392f8 New: allow-multiline option on comma-dangle (fixes #4967) (Alberto Gimeno) +* 05b8cb3 Update: Module overrides all 'strict' rule options (fixes #4936) (Nick Evans) +* 8470474 New: Add metadata to few test rules (fixes #4494) (Ilya Volodin) +* ba11c1b Docs: Add Algolia as sponsor to README (Nicholas C. Zakas) +* b28a19d Breaking: Plugins envs and config removal (fixes #4782, fixes #4952) (Nicholas C. Zakas) +* a456077 Docs: newline-after-var doesn't allow invalid options. (alberto) +* 3e6a24e Breaking: Change `strict` default mode to "safe" (fixes #4961) (alberto) +* 5b96265 Breaking: Update eslint:recommended (fixes #4953) (alberto) +* 7457a4e Upgrade: glob to 6.x (fixes #4991) (Gyandeep Singh) +* d3f4bdd Build: Cleanup for code coverage (fixes #4983) (Gyandeep Singh) +* b8fbaa0 Fix: multiple message in TAP formatter (fixes #4975) (Simon Degraeve) +* 990f8da Fix: `getNodeByRangeIndex` performance issue (fixes #4989) (Toru Nagashima) +* 8ac1dac Build: Update markdownlint dependency to 0.1.0 (fixes #4988) (David Anson) +* 5cd5429 Fix: function expression doc in call expression (fixes #4964) (Tim Schaub) +* 4173baa Fix: `no-dupe-class-members` false positive (fixes #4981) (Toru Nagashima) +* 12fe803 Breaking: Supports Unicode BOM (fixes #4878) (Toru Nagashima) +* 1fc80e9 Build: Increment eslint-config-eslint (Nicholas C. Zakas) +* e0a9024 Update: Report newline between template tag and literal (fixes #4210) (Rajendra Patil) +* da3336c Update: Rules should get `sourceType` from Program node (fixes #4960) (Nick Evans) +* a2ac359 Update: Make jsx-quotes fixable (refs #4377) (Gabriele Petronella) +* ee1014d Fix: Incorrect error location for object-curly-spacing (fixes #4957) (alberto) +* b52ed17 Fix: Incorrect error location for space-in-parens (fixes #4956) (alberto) +* 9c1bafb Fix: Columns of parse errors are off by 1 (fixes #4896) (alberto) +* 5e4841e New: 'id-blacklist' rule (fixes #3358) (Keith Cirkel) +* 700b8bc Update: Add "allow" option to allow specific operators (fixes #3308) (Rajendra Patil) +* d82eeb1 Update: Add describe around rule tester blocks (fixes #4907) (Ilya Volodin) +* 2967402 Update: Add minimum value to integer values in schema (fixes #4941) (Ilya Volodin) +* 7b632f8 Upgrade: Globals to ^8.18.0 (fixes #4728) (Gyandeep Singh) +* 86e6e57 Fix: Incorrect error at EOF for no-multiple-empty-lines (fixes #4917) (alberto) +* 7f058f3 Fix: Incorrect location for padded-blocks (fixes #4913) (alberto) +* b3de8f7 Fix: Do not show ignore messages for default ignored files (fixes #4931) (Gyandeep Singh) +* b1360da Update: Support multiLine and singleLine options (fixes #4697) (Rajendra Patil) +* 82fbe09 Docs: Small semantic issue in documentation example (fixes #4937) (Marcelo Zarate) +* 13a4e30 Docs: Formatting inconsistencies (fixes #4912) (alberto) +* d487013 Update: Option to allow extra parens for cond assign (fixes #3317) (alberto) +* 0f469b4 Fix: JSDoc for function expression on object property (fixes #4900) (Tim Schaub) +* c2dee27 Update: Add module tests to no-extra-semi (fixes #4915) (Nicholas C. Zakas) +* 5a633bf Update: Add `preferType` option to `valid-jsdoc` rule (fixes #3056) (Gyandeep Singh) +* ebd01b7 Build: Fix version number on release (fixes #4921) (Nicholas C. Zakas) +* 2d626a3 Docs: Fix typo in changelog (Nicholas C. Zakas) +* c4c4139 Fix: global-require no longer warns if require is shadowed (fixes #4812) (Kevin Partington) +* bbf7f27 New: provide config.parser via `parserName` on RuleContext (fixes #3670) (Ben Mosher) + +v2.0.0-beta.1 - January 11, 2016 + +* 6c70d84 Build: Fix prerelease script (fixes #4919) (Nicholas C. Zakas) +* d5c9435 New: 'sort-imports' rule (refs #3143) (Christian Schuller) +* a8cfd56 Fix: remove duplicate of eslint-config-eslint (fixes #4909) (Toru Nagashima) +* 19a9fbb Breaking: `space-before-blocks` ignores after keywords (fixes #1338) (Toru Nagashima) +* c275b41 Fix: no-extra-parens ExpressionStatement restricted prods (fixes #4902) (Michael Ficarra) +* b795850 Breaking: don't load ~/.eslintrc when using --config flag (fixes #4881) (alberto) +* 3906481 Build: Add AppVeyor CI (fixes #4894) (Gyandeep Singh) +* 6390862 Docs: Fix missing footnote (Yoshiya Hinosawa) +* e5e06f8 Fix: Jsdoc comment for multi-line function expressions (fixes #4889) (Gyandeep Singh) +* 7c9be60 Fix: Fix path errors in windows (fixes #4888) (Gyandeep Singh) +* a1840e7 Fix: gray text was invisible on Solarized Dark theme (fixes #4886) (Jack Leigh) +* fc9f528 Docs: Modify unnecessary flag docs in quote-props (Matija Marohnić) +* 186e8f0 Update: Ignore camelcase in object destructuring (fixes #3185) (alberto) +* 7c97201 Upgrade: doctrine version to 1.1.0 (fixes #4854) (Tim Schaub) +* ceaf324 New: Add no-new-symbol rule (fixes #4862) (alberto) +* e2f2b66 Breaking: Remove defaults from `eslint:recommended` (fixes #4809) (Ian VanSchooten) +* 0b3c01e Docs: Specify default for func-style (fixes #4834) (Ian VanSchooten) +* 008ea39 Docs: Document default for operator assignment (fixes #4835) (alberto) +* b566f56 Docs: no-new-func typo (alberto) +* 1569695 Update: Adds default 'that' for consistent-this (fixes #4833) (alberto) +* f7b28b7 Docs: clarify `requireReturn` option for valid-jsdoc rule (fixes #4859) (Tim Schaub) +* 407f329 Build: Fix prerelease script (Nicholas C. Zakas) +* 688f277 Fix: Set proper exit code for Node > 0.10 (fixes #4691) (Nicholas C. Zakas) +* 58715e9 Fix: Use single quotes in context.report messages (fixes #4845) (Joe Lencioni) +* 5b7586b Fix: do not require a @return tag for @interface (fixes #4860) (Tim Schaub) +* d43f26c Breaking: migrate from minimatch to node-ignore (fixes #2365) (Stefan Grönke) +* c07ca39 Breaking: merges keyword spacing rules (fixes #3869) (Toru Nagashima) +* 871f534 Upgrade: Optionator version to 0.8.1 (fixes #4851) (Eric Johnson) +* 82d4cd9 Update: Add atomtest env (fixes #4848) (Andres Suarez) +* 9c9beb5 Update: Add "ignore" override for operator-linebreak (fixes #4294) (Rajendra Patil) +* 9c03abc Update: Add "allowCall" option (fixes #4011) (Rajendra Patil) +* 29516f1 Docs: fix migration guide for no-arrow-condition rule (Peter Newnham) +* 2ef7549 Docs: clarify remedy to some prefer-const errors (Turadg Aleahmad) +* 1288ba4 Update: Add default limit to `complexity` (fixes #4808) (Ian VanSchooten) +* d3e8179 Fix: env is rewritten by modules (fixes #4814) (Toru Nagashima) +* fd72aba Docs: Example fix for `no-extra-parens` rule (fixes #3527) (Gyandeep Singh) +* 315f272 Fix: Change max-warnings type to Int (fixes #4660) (George Zahariev) +* 5050768 Update: Ask for `commonjs` under config init (fixes #3553) (Gyandeep Singh) +* 4665256 New: Add no-whitespace-before-property rule (fixes #1086) (Kai Cataldo) +* f500d7d Fix: allow extending @scope/eslint/file (fixes #4800) (André Cruz) +* 5ab564e New: 'ignoreArrayIndexes' option for 'no-magic-numbers' (fixes #4370) (Christian Schuller) +* 97cdb95 New: Add no-useless-constructor rule (fixes #4785) (alberto) +* b9bcbaf Fix: Bug in no-extra-bind (fixes #4806) (Andres Kalle) +* 246a6d2 Docs: Documentation fix (Andres Kalle) +* 9ea6b36 Update: Ignore case in jsdoc tags (fixes #4576) (alberto) +* acdda24 Fix: ignore argument parens in no-unexpected-multiline (fixes #4658) (alberto) +* 4931f56 Update: optionally allow bitwise operators (fixes #4742) (Swaagie) + +v2.0.0-alpha-2 - December 23, 2015 + +* Build: Add prerelease script (Nicholas C. Zakas) +* Update: Allow to omit semi for one-line blocks (fixes #4385) (alberto) +* Fix: Handle getters and setters in key-spacing (fixes #4792) (Brandon Mills) +* Fix: ObjectRestSpread throws error in key-spacing rule (fixes #4763) (Ziad El Khoury Hanna) +* Docs: Typo in generator-star (alberto) +* Fix: Backtick behavior in quotes rule (fixes #3090) (Nicholas C. Zakas) +* Fix: Empty schemas forbid any options (fixes #4789) (Brandon Mills) +* Fix: Remove `isMarkedAsUsed` function name (fixes #4783) (Gyandeep Singh) +* Fix: support arrow functions in no-return-assign (fixes #4743) (alberto) +* Docs: Add license header to Working with Rules guide (Brandon Mills) +* Fix: RuleTester to show parsing errors (fixes #4779) (Nicholas C. Zakas) +* Docs: Escape underscores in no-path-concat (alberto) +* Update: configuration for classes in space-before-blocks (fixes #4089) (alberto) +* Docs: Typo in no-useless-concat (alberto) +* Docs: fix typos, suggests (molee1905) +* Docs: Typos in space-before-keywords and space-unary-ops (fixes #4771) (alberto) +* Upgrade: beefy to ^2.0.0, fixes installation errors (fixes #4760) (Kai Cataldo) +* Docs: Typo in no-unexpected-multiline (fixes #4756) (alberto) +* Update: option to ignore top-level max statements (fixes #4309) (alberto) +* Update: Implement auto fix for semi-spacing rule (fixes #3829) (alberto) +* Fix: small typos in code examples (Plusb Preco) +* Docs: Add section on file extensions to user-guide/configuring (adam) +* Fix: Comma first issue in `indent` (fixes #4739, fixes #3456) (Gyandeep Singh) +* Fix: no-constant-condition false positive (fixes #4737) (alberto) +* Fix: Add source property for fatal errors (fixes #3325) (Gyandeep Singh) +* New: Add a comment length option to the max-len rule (fixes #4665) (Ian) +* Docs: RuleTester doesn't require any tests (fixes #4681) (alberto) +* Fix: Remove path analysis from debug log (fixes #4631) (Ilya Volodin) +* Fix: Set null to property ruleId when fatal is true (fixes #4722) (Sébastien Règne) +* New: Visual Studio compatible formatter (fixes #4708) (rhpijnacker) +* New: Add greasemonkey environment (fixes #4715) (silverwind) +* Fix: always-multiline for comma-dangle import (fixes #4704) (Nicholas C. Zakas) +* Fix: Check 1tbs non-block else (fixes #4692) (Nicholas C. Zakas) +* Fix: Apply environment configs last (fixes #3915) (Nicholas C. Zakas) +* New: `no-unmodified-loop-condition` rule (fixes #4523) (Toru Nagashima) +* Breaking: deprecate `no-arrow-condition` rule (fixes #4417) (Luke Karrys) +* Update: Add cwd option for cli-engine (fixes #4472) (Ilya Volodin) +* New: Add no-confusing-arrow rule (refs #4417) (Luke Karrys) +* Fix: ensure `ConfigOps.merge` do a deep copy (fixes #4682) (Toru Nagashima) +* Fix: `no-invalid-this` allows this in static method (fixes #4669) (Toru Nagashima) +* Fix: Export class syntax for `require-jsdoc` rule (fixes #4667) (Gyandeep Singh) +* Update: Add "safe" mode to strict (fixes #3306) (Brandon Mills) + +v2.0.0-alpha-1 - December 11, 2015 + +* Breaking: Correct links between variables and references (fixes #4615) (Toru Nagashima) +* Fix: Update rule tests for parser options (fixes #4673) (Nicholas C. Zakas) +* Breaking: Implement parserOptions (fixes #4641) (Nicholas C. Zakas) +* Fix: max-len rule overestimates the width of some tabs (fixes #4661) (Nick Evans) +* New: Add no-implicit-globals rule (fixes #4542) (Joshua Peek) +* Update: `no-use-before-define` checks invalid initializer (fixes #4280) (Toru Nagashima) +* Fix: Use oneValuePerFlag for --ignore-pattern option (fixes #4507) (George Zahariev) +* New: `array-callback-return` rule (fixes #1128) (Toru Nagashima) +* Upgrade: Handlebars to >= 4.0.5 for security reasons (fixes #4642) (Jacques Favreau) +* Update: Add class body support to `indent` rule (fixes #4372) (Gyandeep Singh) +* Breaking: Remove space-after-keyword newline check (fixes #4149) (Nicholas C. Zakas) +* Breaking: Treat package.json like the rest of configs (fixes #4451) (Ilya Volodin) +* Docs: writing mistake (molee1905) +* Update: Add 'method' option to no-empty (fixes #4605) (Kai Cataldo) +* Breaking: Remove autofix from eqeqeq (fixes #4578) (Ilya Volodin) +* Breaking: Remove ES6 global variables from builtins (fixes #4085) (Brandon Mills) +* Fix: Handle forbidden LineTerminators in no-extra-parens (fixes #4229) (Brandon Mills) +* Update: Option to ignore constructor Fns object-shorthand (fixes #4487) (Kai Cataldo) +* Fix: Check YieldExpression argument in no-extra-parens (fixes #4608) (Brandon Mills) +* Fix: Do not cache `package.json` (fixes #4611) (Spain) +* Build: Consume no-underscore-dangle allowAfterThis option (fixes #4599) (Kevin Partington) +* New: Add no-restricted-imports rule (fixes #3196) (Guy Ellis) +* Docs: no-extra-semi no longer refers to deprecated rule (fixes #4598) (Kevin Partington) +* Fix: `consistent-return` checks the last (refs #3530, fixes #3373) (Toru Nagashima) +* Update: add class option to `no-use-before-define` (fixes #3944) (Toru Nagashima) +* Breaking: Simplify rule schemas (fixes #3625) (Nicholas C. Zakas) +* Docs: Update docs/rules/no-plusplus.md (Xiangyun Chi) +* Breaking: added bower_components to default ignore (fixes #3550) (Julian Laval) +* Fix: `no-unreachable` with the code path (refs #3530, fixes #3939) (Toru Nagashima) +* Fix: `no-this-before-super` with the code path analysis (refs #3530) (Toru Nagashima) +* Fix: `no-fallthrough` with the code path analysis (refs #3530) (Toru Nagashima) +* Fix: `constructor-super` with the code path analysis (refs #3530) (Toru Nagashima) +* Breaking: Switch to Espree 3.0.0 (fixes #4334) (Nicholas C. Zakas) +* Breaking: Freeze context object (fixes #4495) (Nicholas C. Zakas) +* Docs: Add Code of Conduct (fixes #3095) (Nicholas C. Zakas) +* Breaking: Remove warnings of readonly from `no-undef` (fixes #4504) (Toru Nagashima) +* Update: allowAfterThis option in no-underscore-dangle (fixes #3435) (just-boris) +* Fix: Adding options unit tests for --ignore-pattern (refs #4507) (Kevin Partington) +* Breaking: Implement yield-star-spacing rule (fixes #4115) (Bryan Smith) +* New: `prefer-rest-params` rule (fixes #4108) (Toru Nagashima) +* Update: `prefer-const` begins to cover separating init (fixes #4474) (Toru Nagashima) +* Fix: `no-eval` come to catch indirect eval (fixes #4399, fixes #4441) (Toru Nagashima) +* Breaking: Default no-magic-numbers to none. (fixes #4193) (alberto) +* Breaking: Allow empty arrow body (fixes #4411) (alberto) +* New: Code Path Analysis (fixes #3530) (Toru Nagashima) + +v1.10.3 - December 1, 2015 + +* Docs: Update strict rule docs (fixes #4583) (Nicholas C. Zakas) +* Docs: Reference .eslintrc.* in contributing docs (fixes #4532) (Kai Cataldo) +* Fix: Add for-of to `curly` rule (fixes #4571) (Kai Cataldo) +* Fix: Ignore space before function in array start (fixes #4569) (alberto) + +v1.10.2 - November 27, 2015 + +* Upgrade: escope@3.3.0 (refs #4485) (Nicholas C. Zakas) +* Upgrade: Pinned down js-yaml to avoid breaking dep (fixes #4553) (alberto) +* Fix: lines-around-comment with multiple comments (fixes #3509) (alberto) +* Upgrade: doctrine@0.7.1 (fixes #4545) (Kevin Partington) +* Fix: Bugfix for eqeqeq autofix (fixes #4540) (Kevin Partington) +* Fix: Add for-in to `curly` rule (fixes #4436) (Kai Cataldo) +* Fix: `valid-jsdoc` unneeded require check fix (fixes #4527) (Gyandeep Singh) +* Fix: `brace-style` ASI fix for if-else condition (fixes #4520) (Gyandeep Singh) +* Build: Add branch update during release process (fixes #4491) (Gyandeep Singh) +* Build: Allow revert commits in commit messages (fixes #4452) (alberto) +* Fix: Incorrect location in no-fallthrough (fixes #4516) (alberto) +* Fix: `no-spaced-func` had been crashed (fixes #4508) (Toru Nagashima) +* Fix: Add a RestProperty test of `no-undef` (fixes #3271) (Toru Nagashima) +* Docs: Load badge from HTTPS (Brian J Brennan) +* Build: Update eslint bot messages (fixes #4497) (Nicholas C. Zakas) + +v1.10.1 - November 20, 2015 + +* Fix: Revert freezing context object (refs #4495) (Nicholas C. Zakas) +* 1.10.0 (Nicholas C. Zakas) + +v1.10.0 - November 20, 2015 + +* Docs: Remove dupes from changelog (Nicholas C. Zakas) +* Update: --init to create extensioned files (fixes #4476) (Nicholas C. Zakas) +* Docs: Update description of exported comment (fixes #3916) (Nicholas C. Zakas) +* Docs: Move legacy rules to stylistic (files #4111) (Nicholas C. Zakas) +* Docs: Clean up description of recommended rules (fixes #4365) (Nicholas C. Zakas) +* Docs: Fix home directory config description (fixes #4398) (Nicholas C. Zakas) +* Update: Add class support to `require-jsdoc` rule (fixes #4268) (Gyandeep Singh) +* Update: return type error in `valid-jsdoc` rule (fixes #4443) (Gyandeep Singh) +* Update: Display errors at the place where fix should go (fixes #4470) (nightwing) +* Docs: Fix typo in default `cacheLocation` value (Andrew Hutchings) +* Fix: Handle comments in block-spacing (fixes #4387) (alberto) +* Update: Accept array for `ignorePattern` (fixes #3982) (Jesse McCarthy) +* Update: replace label and break with IIFE and return (fixes #4459) (Ilya Panasenko) +* Fix: space-before-keywords false positive (fixes #4449) (alberto) +* Fix: Improves performance (refs #3530) (Toru Nagashima) +* Fix: Autofix quotes produces invalid javascript (fixes #4380) (nightwing) +* Docs: Update indent.md (Nathan Brown) +* New: Disable comment config option (fixes #3901) (Matthew Riley MacPherson) +* New: Config files with extensions (fixes #4045, fixes #4263) (Nicholas C. Zakas) +* Revert "Update: Add JSX exceptions to no-extra-parens (fixes #4229)" (Brandon Mills) +* Update: Add JSX exceptions to no-extra-parens (fixes #4229) (Brandon Mills) +* Docs: Replace link to deprecated rule with newer rule (Andrew Marshall) +* Fix: `no-extend-native` crashed at empty defineProperty (fixes #4438) (Toru Nagashima) +* Fix: Support empty if blocks in lines-around-comment (fixes #4339) (alberto) +* Fix: `curly` warns wrong location for `else` (fixes #4362) (Toru Nagashima) +* Fix: `id-length` properties never option (fixes #4347) (Toru Nagashima) +* Docs: missing close rbracket in example (@storkme) +* Revert "Update: Allow empty arrow body (fixes #4411)" (Nicholas C. Zakas) +* Fix: eqeqeq autofix avoids clashes with space-infix-ops (fixes #4423) (Kevin Partington) +* Docs: Document semi-spacing behaviour (fixes #4404) (alberto) +* Update: Allow empty arrow body (fixes #4411) (alberto) +* Fix: Handle comments in comma-spacing (fixes #4389) (alberto) +* Update: Refactor eslint.verify args (fixes #4395) (Nicholas C. Zakas) +* Fix: no-undef-init should ignore const (fixes #4284) (Nicholas C. Zakas) +* Fix: Add the missing "as-needed" docs to the radix rule (fixes #4364) (Michał Gołębiowski) +* Fix: Display singular/plural version of "line" in message (fixes #4359) (Marius Schulz) +* Update: Add Popular Style Guides (fixes #4320) (Jamund Ferguson) +* Fix: eslint.report can be called w/o node if loc provided (fixes #4220) (Kevin Partington) +* Update: no-implicit-coercion validate AssignmentExpression (fixes #4348) (Ilya Panasenko) + +v1.9.0 - November 6, 2015 + +* Update: Make radix accept a "as-needed" option (fixes #4048) (Michał Gołębiowski) +* Fix: Update the message to include number of lines (fixes #4342) (Brian Delahunty) +* Docs: ASI causes problem whether semicolons are used or not (Thai Pangsakulyanont) +* Fix: Fixer to not overlap ranges among fix objects (fixes #4321) (Gyandeep Singh) +* Update: Add default to `max-nested-callbacks` (fixes #4297) (alberto) +* Fix: Check comments in space-in-parens (fixes #4302) (alberto) +* Update: Add quotes to error messages to improve clarity (fixes #4313) (alberto) +* Fix: tests failing due to differences in temporary paths (fixes #4324) (alberto) +* Fix: Make tests compatible with Windows (fixes #4315) (Ian VanSchooten) +* Update: Extract glob and filesystem logic from cli-engine (fixes #4305) (Ian VanSchooten) +* Build: Clarify commit-check messages (fixes #4256) (Ian VanSchooten) +* Upgrade: Upgrade various dependencies (fixes #4303) (Gyandeep Singh) +* Build: Add node 5 to travis build (fixes #4310) (Gyandeep Singh) +* Fix: ensure using correct estraverse (fixes #3951) (Toru Nagashima) +* Docs: update docs about using gitignore (Mateusz Derks) +* Update: Detect and fix wrong linebreaks (fixes #3981) (alberto) +* New: Add no-case-declarations rule (fixes #4278) (Erik Arvidsson) + +v1.8.0 - October 30, 2015 + +* Fix: Check for node property before testing type (fixes #4298) (Ian VanSchooten) +* Docs: Specify 'double' as default for quotes (fixes #4270) (Ian VanSchooten) +* Fix: Missing errors in space-in-parens (fixes #4257, fixes #3996) (alberto) +* Docs: fixed typo (Mathieu M-Gosselin) +* Fix: `cacheLocation` handles paths in windows style. (fixes #4285) (royriojas) +* Docs: fixed typo (mpal9000) +* Update: Add support for class in `valid-jsdoc` rule (fixes #4279) (Gyandeep Singh) +* Update: cache-file accepts a directory. (fixes #4241) (royriojas) +* Update: Add `maxEOF` to no-multiple-empty-lines (fixes #4235) (Adrien Vergé) +* Update: fix option for comma-spacing (fixes #4232) (HIPP Edgar (PRESTA EXT)) +* Docs: Fix use of wrong word in configuration doc (Jérémie Astori) +* Fix: Prepare config before verifying SourceCode (fixes #4230) (Ian VanSchooten) +* Update: RuleTester come to check AST was not modified (fixes #4156) (Toru Nagashima) +* Fix: wrong count for 'no-multiple-empty-lines' on last line (fixes #4228) (alberto) +* Update: Add `allow` option to `no-shadow` rule (fixes #3035) (Gyandeep Singh) +* Doc: Correct the spelling of Alberto's surname (alberto) +* Docs: Add alberto as a committer (Gyandeep Singh) +* Build: Do not stub console in testing (fixes #1328) (Gyandeep Singh) +* Fix: Check node exists before checking type (fixes #4231) (Ian VanSchooten) +* Update: Option to exclude afterthoughts from no-plusplus (fixes #4093) (Brody McKee) +* New: Add rule no-arrow-condition (fixes #3280) (Luke Karrys) +* Update: Add linebreak style option to eol-last (fixes #4148) (alberto) +* New: arrow-body-style rule (fixes #4109) (alberto) + +v1.7.3 - October 21, 2015 + +* Fix: Support comma-first style in key-spacing (fixes #3877) (Brandon Mills) +* Fix: no-magic-numbers: variable declarations (fixes #4192) (Ilya Panasenko) +* Fix: Support ES6 shorthand in key-spacing (fixes #3678) (Brandon Mills) +* Fix: `indent` array with memberExpression (fixes #4203) (Gyandeep Singh) +* Fix: `indent` param function on sameline (fixes #4174) (Gyandeep Singh) +* Fix: no-multiple-empty-lines fails when empty line at EOF (fixes #4214) (alberto) +* Fix: `comma-dangle` false positive (fixes #4200) (Nicholas C. Zakas) +* Fix: `valid-jsdoc` prefer problem (fixes #4205) (Nicholas C. Zakas) +* Docs: Add missing single-quote (Kevin Lamping) +* Fix: correct no-multiple-empty-lines at EOF (fixes #4140) (alberto) + +v1.7.2 - October 19, 2015 + +* Fix: comma-dangle confused by parens (fixes #4195) (Nicholas C. Zakas) +* Fix: no-mixed-spaces-and-tabs (fixes #4189, fixes #4190) (alberto) +* Fix: no-extend-native disallow using Object.properties (fixes #4180) (Nathan Woltman) +* Fix: no-magic-numbers should ignore Number.parseInt (fixes #4167) (Henry Zhu) + +v1.7.1 - October 16, 2015 + +* Fix: id-match schema (fixes #4155) (Nicholas C. Zakas) +* Fix: no-magic-numbers should ignore parseInt (fixes #4167) (Nicholas C. Zakas) +* Fix: `indent` param function fix (fixes #4165, fixes #4164) (Gyandeep Singh) + +v1.7.0 - October 16, 2015 + +* Fix: array-bracket-spacing for empty array (fixes #4141) (alberto) +* Fix: `indent` arrow function check fix (fixes #4142) (Gyandeep Singh) +* Update: Support .js files for config (fixes #3102) (Gyandeep Singh) +* Fix: Make eslint-config-eslint work (fixes #4145) (Nicholas C. Zakas) +* Fix: `prefer-arrow-callback` had been wrong at arguments (fixes #4095) (Toru Nagashima) +* Docs: Update various rules docs (Nicholas C. Zakas) +* New: Create eslint-config-eslint (fixes #3525) (Nicholas C. Zakas) +* Update: RuleTester allows string errors in invalid cases (fixes #4117) (Kevin Partington) +* Docs: Reference no-unexpected-multiline in semi (fixes #4114) (alberto) +* Update: added exceptions to `lines-around-comment` rule. (fixes #2965) (Mathieu M-Gosselin) +* Update: Add `matchDescription` option to `valid-jsdoc` (fixes #2449) (Gyandeep Singh) +* Fix: check for objects or arrays in array-bracket-spacing (fixes #4083) (alberto) +* Docs: Alphabetize Rules lists (Kenneth Chung) +* Fix: message templates fail when no parameters are passed (fixes #4080) (Ilya Volodin) +* Fix: `indent` multi-line function call (fixes #4073, fixes #4075) (Gyandeep Singh) +* Docs: Improve comma-dangle documentation (Gilad Peleg) +* Fix: no-mixed-tabs-and-spaces fails with some comments (fixes #4086) (alberto) +* Fix: `semi` to check for do-while loops (fixes #4090) (Gyandeep Singh) +* Build: Fix path related failures on Windows in tests (fixes #4061) (Burak Yigit Kaya) +* Fix: `no-unused-vars` had been missing some parameters (fixes #4047) (Toru Nagashima) +* Fix: no-mixed-spaces-and-tabs with comments and templates (fixes #4077) (alberto) +* Update: Add `allow` option for `no-underscore-dangle` rule (fixes #2135) (Gyandeep Singh) +* Update: `allowArrowFunctions` option for `func-style` rule (fixes #1897) (Gyandeep Singh) +* Fix: Ignore template literals in no-mixed-tabs-and-spaces (fixes #4054) (Nicholas C. Zakas) +* Build: Enable CodeClimate (fixes #4068) (Nicholas C. Zakas) +* Fix: `no-cond-assign` had needed double parens in `for` (fixes #4023) (Toru Nagashima) +* Update: Ignore end of function in newline-after-var (fixes #3682) (alberto) +* Build: Performance perf to not ignore jshint file (refs #3765) (Gyandeep Singh) +* Fix: id-match bug incorrectly errors on `NewExpression` (fixes #4042) (Burak Yigit Kaya) +* Fix: `no-trailing-spaces` autofix to handle linebreaks (fixes #4050) (Gyandeep Singh) +* Fix: renamed no-magic-number to no-magic-numbers (fixes #4053) (Vincent Lemeunier) +* New: add "consistent" option to the "curly" rule (fixes #2390) (Benoît Zugmeyer) +* Update: Option to ignore for loops in init-declarations (fixes #3641) (alberto) +* Update: Add webextensions environment (fixes #4051) (Blake Winton) +* Fix: no-cond-assign should report assignment location (fixes #4040) (alberto) +* New: no-empty-pattern rule (fixes #3668) (alberto) +* Upgrade: Upgrade globals to 8.11.0 (fixes #3599) (Burak Yigit Kaya) +* Docs: Re-tag JSX code fences (fixes #4020) (Brandon Mills) +* New: no-magic-number rule (fixes #4027) (Vincent Lemeunier) +* Docs: Remove list of users from README (fixes #3881) (Brandon Mills) +* Fix: `no-redeclare` and `no-sahadow` for builtin globals (fixes #3971) (Toru Nagashima) +* Build: Add `.eslintignore` file for the project (fixes #3765) (Gyandeep Singh) + +v1.6.0 - October 2, 2015 + +* Fix: cache is basically not working (fixes #4008) (Richard Hansen) +* Fix: a test failure on Windows (fixes #3968) (Toru Nagashima) +* Fix: `no-invalid-this` had been missing globals in node (fixes #3961) (Toru Nagashima) +* Fix: `curly` with `multi` had false positive (fixes #3856) (Toru Nagashima) +* Build: Add load performance check inside perf function (fixes #3994) (Gyandeep Singh) +* Fix: space-before-keywords fails with super keyword (fixes #3946) (alberto) +* Fix: CLI should not fail on account of ignored files (fixes #3978) (Dominic Barnes) +* Fix: brace-style rule incorrectly flagging switch (fixes #4002) (Aparajita Fishman) +* Update: Implement auto fix for space-unary-ops rule (fixes #3976) (alberto) +* Update: Implement auto fix for computed-property-spacing (fixes #3975) (alberto) +* Update: Implement auto fix for no-multi-spaces rule (fixes #3979) (alberto) +* Fix: Report shorthand method names in complexity rule (fixes #3955) (Tijn Kersjes) +* Docs: Add note about typeof check for isNaN (fixes #3985) (Daniel Lo Nigro) +* Update: ESLint reports parsing errors with clear prefix. (fixes #3555) (Kevin Partington) +* Build: Update markdownlint dependency (fixes #3954) (David Anson) +* Update: `no-mixed-require` to have non boolean option (fixes #3922) (Gyandeep Singh) +* Fix: trailing spaces auto fix to check for line breaks (fixes #3940) (Gyandeep Singh) +* Update: Add `typeof` option to `no-undef` rule (fixes #3684) (Gyandeep Singh) +* Docs: Fix explanation and typos for accessor-pairs (alberto) +* Docs: Fix typos for camelcase (alberto) +* Docs: Fix typos for max-statements (Danny Guo) +* Update: Implement auto fix for object-curly-spacing (fixes #3857) (alberto) +* Update: Implement auto fix for array-bracket-spacing rule (fixes #3858) (alberto) +* Fix: Add schema to `global-require` rule (fixes #3923) (Gyandeep Singh) +* Update: Apply lazy loading for rules (fixes #3930) (Gyandeep Singh) +* Docs: Fix typo for arrow-spacing (Danny Guo) +* Docs: Fix typos for wrap-regex (Danny Guo) +* Docs: Fix explanation for space-before-keywords (Danny Guo) +* Docs: Fix typos for operator-linebreak (Danny Guo) +* Docs: Fix typos for callback-return (Danny Guo) +* Fix: no-trailing-spaces autofix to account for blank lines (fixes #3912) (Gyandeep Singh) +* Docs: Fix example in no-negated-condition.md (fixes #3908) (alberto) +* Update:warn message use @return when prefer.returns=return (fixes #3889) (闲耘™) +* Update: Implement auto fix for generator-star-spacing rule (fixes #3873) (alberto) +* Update: Implement auto fix for arrow-spacing rule (fixes #3860) (alberto) +* Update: Implement auto fix for block-spacing rule (fixes #3859) (alberto) +* Fix: Support allman style for switch statement (fixes #3903) (Gyandeep Singh) +* New: no-negated-condition rule (fixes #3740) (alberto) +* Docs: Fix typo in blog post template (Nicholas C. Zakas) +* Update: Add env 'nashorn' to support Java 8 Nashorn Engine (fixes #3874) (Benjamin Winterberg) +* Docs: Prepare for rule doc linting (refs #2271) (Ian VanSchooten) + +v1.5.1 - September 22, 2015 + +* Fix: valid-jsdoc fix for param with properties (fixes #3476) (Gyandeep Singh) +* Fix: valid-jsdoc error with square braces (fixes #2270) (Gyandeep Singh) +* Upgrade: `doctrine` to 0.7.0 (fixes #3891) (Gyandeep Singh) +* Fix: `space-before-keywords` had been wrong on getters (fixes #3854) (Toru Nagashima) +* Fix: `no-dupe-args` had been wrong for nested destructure (fixes #3867) (Toru Nagashima) +* Docs: io.js is the new Node.js (thefourtheye) +* Docs: Fix method signature on working-with-rules docs (fixes #3862) (alberto) +* Docs: Add related ternary links (refs #3835) (Ian VanSchooten) +* Fix: don’t ignore config if cwd is the home dir (fixes #3846) (Mathias Schreck) +* Fix: `func-style` had been warning arrows with `this` (fixes #3819) (Toru Nagashima) +* Fix: `space-before-keywords`; allow opening curly braces (fixes #3789) (Marko Raatikka) +* Build: Fix broken .gitattributes generation (fixes #3566) (Nicholas C. Zakas) +* Build: Fix formatter docs generation (fixes #3847) (Nicholas C. Zakas) + +v1.5.0 - September 18, 2015 + +* Fix: invalidate cache when config changes. (fixes #3770) (royriojas) +* Fix: function body indent issues (fixes #3614, fixes #3799) (Gyandeep Singh) +* Update: Add configuration option to `space-before-blocks` (fixes #3758) (Phil Vargas) +* Fix: space checking between tokens (fixes #2211) (Nicholas C. Zakas) +* Fix: env-specified ecmaFeatures had been wrong (fixes #3735) (Toru Nagashima) +* Docs: Change example wording from warnings to problems (fixes #3676) (Ian VanSchooten) +* Build: Generate formatter example docs (fixes #3560) (Ian VanSchooten) +* New: Add --debug flag to CLI (fixes #2692) (Nicholas C. Zakas) +* Docs: Update no-undef-init docs (fixes #3170) (Nicholas C. Zakas) +* Docs: Update no-unused-expressions docs (fixes #3685) (Nicholas C. Zakas) +* Docs: Clarify node types in no-multi-spaces (fixes #3781) (Nicholas C. Zakas) +* Docs: Update new-cap docs (fixes #3798) (Nicholas C. Zakas) +* Fix: `space-before-blocks` had conflicted `arrow-spacing` (fixes #3769) (Toru Nagashima) +* Fix: `comma-dangle` had not been checking imports/exports (fixes #3794) (Toru Nagashima) +* Fix: tests fail due to differences in temporary paths. (fixes #3778) (royriojas) +* Fix: Directory ignoring should work (fixes #3812) (Nicholas C. Zakas) +* Fix: Ensure **/node_modules works in ignore files (fixes #3788) (Nicholas C. Zakas) +* Update: Implement auto fix for `space-infix-ops` rule (fixes #3801) (Gyandeep Singh) +* Fix: `no-warning-comments` can't be set via config comment (fixes #3619) (Burak Yigit Kaya) +* Update: `key-spacing` should allow 1+ around colon (fixes #3363) (Burak Yigit Kaya) +* Fix: false alarm of semi-spacing with semi set to never (fixes #1983) (Chen Yicai) +* Fix: Ensure ./ works correctly with CLI (fixes #3792) (Nicholas C. Zakas) +* Docs: add more examples + tests for block-scoped-var (fixes #3791) (JT) +* Update: Implement auto fix for `indent` rule (fixes #3734) (Gyandeep Singh) +* Fix: `space-before-keywords` fails to handle some cases (fixes #3756) (Marko Raatikka) +* Docs: Add if-else example (fixes #3722) (Ian VanSchooten) +* Fix: jsx-quotes exception for attributes without value (fixes #3793) (Mathias Schreck) +* Docs: Fix closing code fence on cli docs (Ian VanSchooten) +* Update: Implement auto fix for `space-before-blocks` rule (fixes #3776) (Gyandeep Singh) +* Update: Implement auto fix for `space-after-keywords` rule (fixes #3773) (Gyandeep Singh) +* Fix: `semi-spacing` had conflicted with `block-spacing` (fixes #3721) (Toru Nagashima) +* Update: Implement auto fix for `space-before-keywords` rule (fixes #3771) (Gyandeep Singh) +* Update: auto fix for space-before-function-paren rule (fixes #3766) (alberto) +* Update: Implement auto fix for `no-extra-semi` rule (fixes #3745) (Gyandeep Singh) +* Update: Refactors the traversing logic (refs #3530) (Toru Nagashima) +* Update: Implement auto fix for `space-return-throw-case` (fixes #3732) (Gyandeep Singh) +* Update: Implement auto fix for `no-spaced-func` rule (fixes #3728) (Gyandeep Singh) +* Update: Implement auto fix for `eol-last` rule (fixes #3725) (Gyandeep Singh) +* Update: Implement auto fix for `no-trailing-spaces` rule (fixes #3723) (Gyandeep Singh) + +v1.4.3 - September 15, 2015 + +* Fix: Directory ignoring should work (fixes #3812) (Nicholas C. Zakas) +* Fix: jsx-quotes exception for attributes without value (fixes #3793) (Mathias Schreck) + +v1.4.2 - September 15, 2015 + +* Fix: Ensure **/node_modules works in ignore files (fixes #3788) (Nicholas C. Zakas) +* Fix: Ensure ./ works correctly with CLI (fixes #3792) (Nicholas C. Zakas) + +v1.4.1 - September 11, 2015 + +* Fix: CLIEngine default cache parameter name (fixes #3755) (Daniel G. Taylor) +* Fix: Glob pattern from .eslintignore not applied (fixes #3750) (Burak Yigit Kaya) +* Fix: Skip JSDoc from NewExpression (fixes #3744) (Nicholas C. Zakas) +* Docs: Shorten and simplify autocomment for new issues (Nicholas C. Zakas) + +v1.4.0 - September 11, 2015 + +* Docs: Add new formatters to API docs (Ian VanSchooten) +* New: Implement autofixing (fixes #3134) (Nicholas C. Zakas) +* Fix: Remove temporary `"allow-null"` (fixes #3705) (Toru Nagashima) +* Fix: `no-unused-vars` had been crashed at `/*global $foo*/` (fixes #3714) (Toru Nagashima) +* Build: check-commit now checks commit message length. (fixes #3706) (Kevin Partington) +* Fix: make getScope acquire innermost scope (fixes #3700) (voideanvalue) +* Docs: Fix spelling mistake (domharrington) +* Fix: Allow whitespace in rule message parameters. (fixes #3690) (Kevin Partington) +* Fix: Eqeqeq rule with no option does not warn on 'a == null' (fixes #3699) (fediev) +* Fix: `no-unused-expressions` with `allowShortCircuit` false positive if left has no effect (fixes #3675) (Toru Nagashima) +* Update: Add Node 4 to travis builds (fixes #3697) (Ian VanSchooten) +* Fix: Not check for punctuator if on same line as last var (fixes #3694) (Gyandeep Singh) +* Docs: Make `quotes` docs clearer (fixes #3646) (Nicholas C. Zakas) +* Build: Increase mocha timeout (fixes #3692) (Nicholas C. Zakas) +* Fix: `no-extra-bind` to flag all arrow funcs (fixes #3672) (Nicholas C. Zakas) +* Docs: Update README with release and sponsor info (Nicholas C. Zakas) +* Fix: `object-curly-spacing` had been crashing on an empty object pattern (fixes #3658) (Toru Nagashima) +* Fix: `no-extra-parens` false positive at IIFE with member accessing (fixes #3653) (Toru Nagashima) +* Fix: `comma-dangle` with `"always"`/`"always-multiline"` false positive after a rest element (fixes #3627) (Toru Nagashima) +* New: `jsx-quotes` rule (fixes #2011) (Mathias Schreck) +* Docs: Add linting for second half of rule docs (refs #2271) (Ian VanSchooten) +* Fix: `no-unused-vars` had not shown correct locations for `/*global` (fixes #3617) (Toru Nagashima) +* Fix: `space-after-keywords` not working for `catch` (fixes #3654) (Burak Yigit Kaya) +* Fix: Incorrectly warning about ignored files (fixes #3649) (Burak Yigit Kaya) +* Fix: Indent rule VariableDeclarator doesn't apply to arrow functions (fixes #3661) (Burak Yigit Kaya) +* Upgrade: Consuming handlebars@^4.0.0 (fixes #3632) (Kevin Partington) +* Docs: Fixing typos in plugin processor section. (fixes #3648) (Kevin Partington) +* Fix: Invalid env keys would cause an unhandled exception.(fixes #3265) (Ray Booysen) +* Docs: Fixing broken link in documentation (Ilya Volodin) +* Update: Check for default assignment in no-unneeded-ternary (fixes #3232) (cjihrig) +* Fix: `consistent-as-needed` mode with `keyword: true` (fixes #3636) (Alex Guerrero) +* New: Implement cache in order to only operate on changed files since previous run. (fixes #2998) (Roy Riojas) +* Update: Grouping related CLI options. (fixes #3612) (Kevin Partington) +* Update: Using @override does not require @param or @returns (fixes #3629) (Whitney Young) +* Docs: Use eslint-env in no-undef (fixes #3616) (Ian VanSchooten) +* New: `require-jsdoc` rule (fixes #1842) (Gyandeep Singh) +* New: Support glob path on command line (fixes #3402) (Burak Yigit Kaya) +* Update: Short circuit and ternary support in no-unused-expressions (fixes #2733) (David Warkentin) +* Docs: Replace to npmjs.com (Ryuichi Okumura) +* Fix: `indent` should only indent chain calls if the first call is single line (fixes #3591) (Burak Yigit Kaya) +* Fix: `quote-props` should not crash for object rest spread syntax (fixes #3595) (Joakim Carlstein) +* Update: Use `globals` module for the `commonjs` globals (fixes #3606) (Sindre Sorhus) +* New: `no-restricted-syntax` rule to forbid certain syntax (fixes #2422) (Burak Yigit Kaya) +* Fix: `no-useless-concat` false positive at numbers (fixes #3575, fixes #3589) (Toru Nagashima) +* New: Add --max-warnings flag to CLI (fixes #2769) (Kevin Partington) +* New: Add `parser` as an option (fixes #3127) (Gyandeep Singh) +* New: `space-before-keywords` rule (fixes #1631) (Marko Raatikka) +* Update: Allowing inline comments to disable eslint rules (fixes #3472) (Whitney Young) +* Docs: Including for(;;) as valid case in no-constant-condition (Kevin Partington) +* Update: Add quotes around the label in `no-redeclare` error messages (fixes #3583) (Ian VanSchooten) +* Docs: correct contributing URL (Dieter Luypaert) +* Fix: line number for duplicate object keys error (fixes #3573) (Elliot Lynde) +* New: global-require rule (fixes #2318) (Jamund Ferguson) + +v1.3.1 - August 29, 2015 + +* Fix: `indent` to not crash on empty files (fixes #3570) (Gyandeep Singh) +* Fix: Remove unused config file (fixes #2227) (Gyandeep Singh) + +v1.3.0 - August 28, 2015 + +* Build: Autogenerate release blog post (fixes #3562) (Nicholas C. Zakas) +* New: `no-useless-concat` rule (fixes #3506) (Henry Zhu) +* Update: Add `keywords` flag to `consistent-as-needed` mode in `quote-props` (fixes #3532) (Burak Yigit Kaya) +* Update: adds `numbers` option to quote-props (fixes #2914) (Jose Roberto Vidal) +* Fix: `quote-props` rule should ignore computed and shorthand properties (fixes #3557) (fixes #3544) (Burak Yigit Kaya) +* Docs: Add config comments for rule examples 'accessor-pairs' to 'no-extra-semi' (refs #2271) (Ian VanSchooten) +* Update: Return to accept `undefined` type (fixes #3382) (Gyandeep Singh) +* New: Added HTML formatter (fixes #3505) (Julian Laval) +* Fix: check space after yield keyword in space-unary-ops (fixes #2707) (Mathias Schreck) +* Docs: (curly) Fix broken code in example (Kent C. Dodds) +* Update: Quote var name in `no-unused-vars` error messages (refs #3526) (Burak Yigit Kaya) +* Update: Move methods to SourceCode (fixes #3516) (Nicholas C. Zakas) +* Fix: Don't try too hard to find fault in `no-implicit-coercion` (refs #3402) (Burak Yigit Kaya) +* Fix: Detect ternary operator in operator-linebreak rule (fixes #3274) (Burak Yigit Kaya) +* Docs: Clearer plugin rule configuration (fixes #2022) (Nicholas C. Zakas) +* Update: Add quotes around the label in `no-empty-label` error reports (fixes #3526) (Burak Yigit Kaya) +* Docs: Turn off Liquid in example (Nicholas C. Zakas) +* Docs: Mention CommonJS along with Node.js (fixes #3388) (Nicholas C. Zakas) +* Docs: Make it clear which rules are recommended (fixes #3398) (Nicholas C. Zakas) +* Docs: Add links to JSON Schema resources (fixes #3411) (Nicholas C. Zakas) +* Docs: Add more info to migration guide (fixes #3439) (Nicholas C. Zakas) +* Fix: ASI indentation issue (fixes #3514) (Burak Yigit Kaya) +* Fix: Make `no-implicit-coercion` smarter about numerical expressions (fixes #3510) (Burak Yigit Kaya) +* Fix: `prefer-template` had not been handling TemplateLiteral as literal node (fixes #3507) (Toru Nagashima) +* Update: `newline-after-var` Allow comment + blank after var (fixes #2852) (Ian VanSchooten) +* Update: Add `unnecessary` option to `quote-props` (fixes #3381) (Burak Yigit Kaya) +* Fix: `indent` shouldn't check the last line unless it is a punctuator (fixes #3498) (Burak Yigit Kaya) +* Fix: `indent` rule does not indent when doing multi-line chain calls (fixes #3279) (Burak Yigit Kaya) +* Fix: sort-vars rule fails when memo is undefined (fixes #3474) (Burak Yigit Kaya) +* Fix: `brace-style` doesn't report some closing brace errors (fixes #3486) (Burak Yigit Kaya) +* Update: separate options for block and line comments in `spaced-comment` rule (fixes #2897) (Burak Yigit Kaya) +* Fix: `indent` does not check FunctionDeclaration nodes properly (fixes #3173) (Burak Yigit Kaya) +* Update: Added "properties" option to `id-length` rule to ignore property names. (fixes #3450) (Mathieu M-Gosselin) +* Update: add new ignore pattern options to no-unused-vars (fixes #2321) (Mathias Schreck) +* New: Protractor environment (fixes #3457) (James Whitney) +* Docs: Added section to shareable config (Gregory Waxman) +* Update: Allow pre-parsed code (fixes #1025, fixes #948) (Nicholas C. Zakas) + +v1.2.1 - August 20, 2015 + +* Fix: "key-spacing" crashes eslint on object literal shorthand properties (fixes #3463) (Burak Yigit Kaya) +* Fix: ignore leading space check for `null` elements in comma-spacing (fixes #3392) (Mathias Schreck) +* Fix: `prefer-arrow-callback` false positive at recursive functions (fixes #3454) (Toru Nagashima) +* Fix: one-var rule doesn’t have default options (fixes #3449) (Burak Yigit Kaya) +* Fix: Refactor `no-duplicate-case` to be simpler and more efficient (fixes #3440) (Burak Yigit Kaya) +* Docs: Fix trailing spaces in README (Nicholas C. Zakas) +* Docs: Update gyandeeps and add byk (Nicholas C. Zakas) +* Docs: Update plugins documentation for 1.0.0 (Nicholas C. Zakas) +* Docs: `object-curly-spacing` doc is inaccurate about exceptions (Burak Yigit Kaya) +* Fix: `object-curly-spacing` shows the incorrect column for opening brace (fixes #3438) (Burak Yigit Kaya) + +v1.2.0 - August 18, 2015 + +* Update: add support for semicolon in comma-first setup in indent rule (fixes #3423) (Burak Yigit Kaya) +* Docs: better JSDoc for indent rule (Burak Yigit Kaya) +* Docs: Document the second argument of `CLIEngine.executeOnText()` (Sindre Sorhus) +* New: `no-dupe-class-members` rule (fixes #3294) (Toru Nagashima) +* Fix: exclude `AssignmentExpression` and `Property` nodes from extra indentation on first line (fixes #3391) (Burak Yigit Kaya) +* Update: Separate indent options for var, let and const (fixes #3339) (Burak Yigit Kaya) +* Fix: Add AssignmentPattern to space-infix-ops (fixes #3380) (Burak Yigit Kaya) +* Docs: Fix typo: exception label (tienslebien) +* Update: Clean up tests for CLI config support (refs #2543) (Gyandeep Singh) +* New: `block-spacing` rule (fixes #3303) (Toru Nagashima) +* Docs: Update docs for no-iterator (fixes #3405) (Nicholas C. Zakas) +* Upgrade: bump `espree` dependency to `2.2.4` (fixes #3403) (Burak Yigit Kaya) +* Fix: false positive on switch 'no duplicate case', (fixes #3408) (Cristian Carlesso) +* Fix: `valid-jsdoc` test does not recognize aliases for `@param` (fixes #3399) (Burak Yigit Kaya) +* New: enable `-c` flag to accept a shareable config (fixes #2543) (Shinnosuke Watanabe) +* Fix: Apply plugin given in CLI (fixes #3383) (Ian VanSchooten) +* New: Add commonjs environment (fixes #3377) (Nicholas C. Zakas) +* Docs: Update no-unused-var docs (Nicholas C. Zakas) +* Fix: trailing commas in object-curly-spacing for import/export (fixes #3324) (Henry Zhu) +* Update: Make `baseConfig` to behave as other config options (fixes #3371) (Gyandeep Singh) +* Docs: Add "Compatibility" section to linebreak-style (Vitor Balocco) +* New: `prefer-arrow-callback` rule (fixes #3140) (Toru Nagashima) +* Docs: Clarify what an unused var is (fixes #2342) (Nicholas C. Zakas) +* Docs: Mention double-byte character limitation in max-len (fixes #2370) (Nicholas C. Zakas) +* Fix: object curly spacing incorrectly warning for import with default and multiple named specifiers (fixes #3370) (Luke Karrys) +* Fix: Indent rule errors with array of objects (fixes #3329) (Burak Yigit Kaya) +* Update: Make it clear that `space-infix-ops` support `const` (fixes #3299) (Burak Yigit Kaya) +* New: `prefer-template` rule (fixes #3014) (Toru Nagashima) +* Docs: Clarify `no-process-env` docs (fixes #3318) (Nicholas C. Zakas) +* Docs: Fix arrow name typo (fixes #3309) (Nicholas C. Zakas) +* Update: Improve error message for `indent` rule violation (fixes #3340) (Burak Yigit Kaya) +* Fix: radix rule does not apply for Number.parseInt (ES6) (fixes #3364) (Burak Yigit Kaya) +* Fix: `key-spacing.align` doesn't pay attention to non-whitespace before key (fixes #3267) (Burak Yigit Kaya) +* Fix: arrow-parens & destructuring/default params (fixes #3353) (Jamund Ferguson) +* Update: Add support for Allman to brace-style rule, brackets on newline (fixes #3347) (Burak Yigit Kaya) +* Fix: Regression no-catch-shadow (1.1.0) (fixes #3322) (Burak Yigit Kaya) +* Docs: remove note outdated in 1.0.0 (Denis Sokolov) +* Build: automatically convert line endings in release script (fixes #2642) (Burak Yigit Kaya) +* Update: allow disabling new-cap on object methods (fixes #3172) (Burak Yigit Kaya) +* Update: Improve checkstyle format (fixes #3183) (Burak Yigit Kaya) +* Fix: Indent rule errors if an array literal starts a new statement (fixes #3328) (Burak Yigit Kaya) +* Update: Improve validation error messages (fixes #3193) (Burak Yigit Kaya) +* Docs: fix syntax error in space-before-function-paren (Fabrício Matté) +* Fix: `indent` rule to check for last line correctly (fixes #3327) (Gyandeep Singh) +* Fix: Inconsistent off-by-one errors with column numbers (fixes #3231) (Burak Yigit Kaya) +* Fix: Keyword "else" must not be followed by a newline (fixes #3226) (Burak Yigit Kaya) +* Fix: `id-length` does not work for most of the new ES6 patterns (fixes #3286) (Burak Yigit Kaya) +* Fix: Spaced Comment Exceptions Not Working (fixes #3276) (Jamund Ferguson) + +v1.1.0 - August 7, 2015 + +* Update: Added as-needed option to arrow-parens (fixes #3277) (Jamund Ferguson) +* Fix: curly-spacing missing import case (fixes #3302) (Jamund Ferguson) +* Fix: `eslint-env` in comments had not been setting `ecmaFeatures` (fixes #2134) (Toru Nagashima) +* Fix: `es6` env had been missing `spread` and `newTarget` (fixes #3281) (Toru Nagashima) +* Fix: Report no-spaced-func on last token before paren (fixes #3289) (Benjamin Woodruff) +* Fix: Check for null elements in indent rule (fixes #3272) (Gyandeep Singh) +* Docs: Use backticks for option heading (Gyandeep Singh) +* Fix: `no-invalid-this` had been missing jsdoc comment (fixes #3287) (Toru Nagashima) +* Fix: `indent` rule for multi-line objects and arrays (fixes #3236) (Gyandeep Singh) +* Update: add new `multi-or-nest` option for the `curly` rule (fixes #1806) (Ivan Nikulin) +* Fix: `no-cond-assign` had been missing simplest pattern (fixes #3249) (Toru Nagashima) +* Fix: id-length rule doesn't catch violations in arrow function parameters (fixes #3275) (Burak Yigit Kaya) +* New: Added grep-style formatter (fixes #2991) (Nobody Really) +* Update: Split out generic AST methods into utility (fixes #962) (Gyandeep Singh) +* Fix: `accessor-pairs` false positive (fixes #3262) (Toru Nagashima) +* Fix: `context.getScope()` returns correct scope in blockBindings (fixes #3254) (Toru Nagashima) +* Update: Expose `getErrorResults` as a static method on `CLIEngine` (fixes #3242) (Gyandeep Singh) +* Update: Expose `getFormatter` as a static method on `CLIEngine` (fixes #3239) (Gyandeep Singh) +* Docs: use correct encoding for id-match.md (fixes #3246) (Matthieu Larcher) +* Docs: place id-match rule at correct place in README.md (fixes #3245) (Matthieu Larcher) +* Docs: Update no-proto.md (Joe Zimmerman) +* Docs: Fix typo in object-shorthand docs (Gunnar Lium) +* Upgrade: inquirer dependency (fixes #3241) (Gyandeep Singh) +* Fix: `indent` rule for objects and nested one line blocks (fixes #3238, fixes #3237) (Gyandeep Singh) +* Docs: Fix wrong options in examples of key-spacing (keik) +* Docs: Adds missing "not" to semi.md (Marius Schulz) +* Docs: Update no-multi-spaces.md (Kenneth Powers) +* Fix: `indent` to not error on same line nodes (fixes #3228) (Gyandeep Singh) +* New: Jest environment (fixes #3212) (Darshak Parikh) + +v1.0.0 - July 31, 2015 + +* Update: merge `no-reserved-keys` into `quote-props` (fixes #1539) (Jose Roberto Vidal) +* Fix: `indent` error message (fixes #3220) (Gyandeep Singh) +* Update: Add embertest env (fixes #3205) (ismay) +* Docs: Correct documentation errors for `id-length` rule. (Jess Telford) +* Breaking: `indent` rule to have node specific options (fixes #3210) (Gyandeep Singh) +* Fix: space-after-keyword shouldn't allow newlines (fixes #3198) (Brandon Mills) +* New: Add JSON formatter (fixes #3036) (Burak Yigit Kaya) +* Breaking: Switch to RuleTester (fixes #3186) (Nicholas C. Zakas) +* Breaking: remove duplicate warnings of `no-undef` from `block-scoped-var` (fixes #3201) (Toru Nagashima) +* Fix: `init-declarations` ignores in for-in/of (fixes #3202) (Toru Nagashima) +* Fix: `quotes` with `"backtick"` ignores ModuleSpecifier and LiteralPropertyName (fixes #3181) (Toru Nagashima) +* Fix: space-in-parens in Template Strings (fixes #3182) (Ian VanSchooten) +* Fix: Check for concatenation in no-throw-literal (fixes #3099, fixes #3101) (Ian VanSchooten) +* Build: Remove `eslint-tester` from devDependencies (fixes #3189) (Gyandeep Singh) +* Fix: Use new ESLintTester (fixes #3187) (Nicholas C. Zakas) +* Update: `new-cap` supports fullnames (fixes #2584) (Toru Nagashima) +* Fix: Non object rule options merge (fixes #3179) (Gyandeep Singh) +* New: add id-match rule (fixes #2829) (Matthieu Larcher) +* Fix: Rule options merge (fixes #3175) (Gyandeep Singh) +* Fix: `spaced-comment` allows a mix of markers and exceptions (fixes #2895) (Toru Nagashima) +* Fix: `block-scoped-var` issues (fixes #2253, fixes #2747, fixes #2967) (Toru Nagashima) +* New: Add id-length rule (fixes #2784) (Burak Yigit Kaya) +* Update: New parameters for quote-props rule (fixes #1283, fixes #1658) (Tomasz Olędzki) + +v1.0.0-rc-3 - July 24, 2015 + +* Fix: Make Chai and Mocha as a dependency (fixes #3156) (Gyandeep Singh) +* Fix: traverse `ExperimentalSpread/RestProperty.argument` (fixes #3157) (Toru Nagashima) +* Fix: Check shareable config package prefix correctly (fixes #3146) (Gyandeep Singh) +* Update: move redeclaration checking for builtins (fixes #3070) (Toru Nagashima) +* Fix: `quotes` with `"backtick"` allows directive prologues (fixes #3132) (Toru Nagashima) +* Fix: `ESLintTester` path in exposed API (fixes #3149) (Gyandeep Singh) +* Docs: Remove AppVeyor badge (Gyandeep Singh) +* Fix: Check no-new-func on CallExpressions (fixes #3145) (Benjamin Woodruff) + +v1.0.0-rc-2 - July 23, 2015 + +* Docs: Mention eslint-tester in migration guide (Nicholas C. Zakas) +* Docs: Mention variables defined in a global comment (fixes #3137) (William Becker) +* Docs: add documentation about custom-formatters. (fixes #1260) (royriojas) +* Fix: Multi-line variable declarations indent (fixes #3139) (Gyandeep Singh) +* Fix: handles blocks in no-use-before-define (fixes #2960) (Jose Roberto Vidal) +* Update: `props` option of `no-param-reassign` (fixes #1600) (Toru Nagashima) +* New: Support shared configs named `@scope/eslint-config`, with shortcuts of `@scope` and `@scope/` (fixes #3123) (Jordan Harband) +* New: Add ignorePattern, ignoreComments, and ignoreUrls options to max-len (fixes #2934, fixes #2221, fixes #1661) (Benjamin Woodruff) +* Build: Increase Windows Mocha timeout (fixes #3133) (Ian VanSchooten) +* Docs: incorrect syntax in the example for rule «one-var» (Alexander Burtsev) +* Build: Check commit message format at end of tests (fixes #3058) (Ian VanSchooten) +* Update: Move eslint-tester into repo (fixes #3110) (Nicholas C. Zakas) +* Fix: Not load configs outside config with `root: true` (fixes #3109) (Gyandeep Singh) +* Docs: Add config information to README (fixes #3074) (Nicholas C. Zakas) +* Docs: Add mysticatea as committer (Nicholas C. Zakas) +* Docs: Grammar fixes in rule descriptions (refs #3038) (Greg Cochard) +* Fix: Update sort-vars to ignore Array and ObjectPattern (fixes #2954) (Harry Ho) +* Fix: block-scoped-var rule incorrectly flagging break/continue with label (fixes #3082) (Aparajita Fishman) +* Fix: spaces trigger wrong in `no-useless-call` and `prefer-spread` (fixes #3054) (Toru Nagashima) +* Fix: `arrow-spacing` allow multi-spaces and line-endings (fixes #3079) (Toru Nagashima) +* Fix: add missing loop scopes to one-var (fixes #3073) (Jose Roberto Vidal) +* New: the `no-invalid-this` rule (fixes #2815) (Toru Nagashima) +* Fix: allow empty loop body in no-extra-semi (fixes #3075) (Mathias Schreck) +* Update: Add qunit to environments (fixes #2870) (Nicholas C. Zakas) +* Fix: `space-before-blocks` to consider classes (fixes #3062) (Gyandeep Singh) +* Fix: Include phantomjs globals (fixes #3064) (Linus Unnebäck) +* Fix: no-else-return handles multiple else-if blocks (fixes #3015) (Jose Roberto Vidal) +* Fix: `no-*-assgin` rules support destructuring (fixes #3029) (Toru Nagashima) +* New: the `no-implicit-coercion` rule (fixes #1621) (Toru Nagashima) +* Fix: Make no-implied-eval match more types of strings (fixes #2898) (Benjamin Woodruff) +* Docs: Clarify that bot message is automatic (Ian VanSchooten) +* Fix: Skip rest properties in no-dupe-keys (fixes 3042) (Nicholas C. Zakas) +* Docs: New issue template (fixes #3048) (Nicholas C. Zakas) +* Fix: strict rule supports classes (fixes #2977) (Toru Nagashima) +* New: the `prefer-reflect` rule (fixes #2939) (Keith Cirkel) +* Docs: make grammar consistent in rules index (Greg Cochard) +* Docs: Fix unmatched paren in rule description (Greg Cochard) +* Docs: Small typo fix in no-useless-call documentation (Paul O’Shannessy) +* Build: readd phantomjs dependency with locked down version (fixes #3026) (Mathias Schreck) +* Docs: Add IanVS as committer (Nicholas C. Zakas) +* docs: additional computed-property-spacing documentation (fixes #2941) (Jamund Ferguson) +* Docs: Add let and const examples for newline-after-var (fixes #3020) (James Whitney) +* Build: Remove unnecessary phantomjs devDependency (fixes #3021) (Gyandeep Singh) +* Update: added shared builtins list (fixes #2972) (Jose Roberto Vidal) + +v1.0.0-rc-1 - July 15, 2015 + +* Upgrade: Espree to 2.2.0 (fixes #3011) (Nicholas C. Zakas) +* Docs: fix a typo (bartmichu) +* Fix: indent rule should recognize single line statements with ASI (fixes #3001, fixes #3000) (Mathias Schreck) +* Update: Handle CRLF line endings in spaced-comment rule - 2 (fixes #3005) (Burak Yigit Kaya) +* Fix: Indent rule error on empty block body (fixes #2999) (Gyandeep Singh) +* New: the `no-class-assign` rule (fixes #2718) (Toru Nagashima) +* New: the `no-const-assign` rule (fixes #2719) (Toru Nagashima) +* Docs: Add 1.0.0 migration guide (fixes #2994) (Nicholas C. Zakas) +* Docs: Update changelog for 0.24.1 (fixes #2976) (Nicholas C. Zakas) +* Breaking: Remove deprecated rules (fixes #1898) (Ian VanSchooten) +* Fix: multi-line + fat arrow indent (fixes #2239) (Gyandeep Singh) +* Breaking: Create eslint:recommended and add to --init (fixes #2713) (Greg Cochard) +* Fix: Indent rule (fixes #1797, fixes #1799, fixes #2248, fixes #2343, fixes #2278, fixes #1800) (Gyandeep Singh) +* New: `context.getDeclaredVariables(node)` (fixes #2801) (Toru Nagashima) +* New: the `no-useless-call` rule (fixes #1925) (Toru Nagashima) +* New: the `prefer-spread` rule (fixes #2946) (Toru Nagashima) +* Fix: `valid-jsdoc` counts `return` for arrow expressions (fixes #2952) (Toru Nagashima) +* New: Add exported comment option (fixes #1200) (Jamund Ferguson) +* Breaking: Default to --reset behavior (fixes #2100) (Brandon Mills) +* New: Add arrow-parens and arrow-spacing rule (fixes #2628) (Jxck) +* Fix: Shallow cloning issues in eslint config (fixes #2961) (Gyandeep Singh) +* Add: Warn on missing rule definition or deprecation (fixes #1549) (Ian VanSchooten) +* Update: adding some tests for no-redeclare to test named functions (fixes #2953) (Dominic Barnes) +* New: Add support for root: true in config files (fixes #2736) (Ian VanSchooten) +* Fix: workaround for leading and trailing comments in padded-block (fixes #2336 and fixes #2788) (Mathias Schreck) +* Fix: object-shorthand computed props (fixes #2937) (Jamund Ferguson) +* Fix: Remove invalid check inside `getJSDocComment` function (fixes #2938) (Gyandeep Singh) +* Docs: Clarify when not to use space-before-blocks (Ian VanSchooten) +* Update: `no-loop-func` allows block-scoped variables (fixes #2517) (Toru Nagashima) +* Docs: remove mistaken "off by default" (Jan Schär) +* Build: Add appveyor CI system (fixes #2923) (Gyandeep Singh) +* Docs: Fix typo in the shareable configs doc (Siddharth Kannan) +* Fix: max-len to report correct column number (fixes #2926) (Mathias Schreck) +* Fix: add destructuring support to comma-dangle rule (fixes #2911) (Mathias Schreck) +* Docs: clarification in no-unused-vars (Jan Schär) +* Fix: `no-redeclare` checks module scopes (fixes #2903) (Toru Nagashima) +* Docs: missing quotes in JSON (Jan Schär) +* Breaking: Switch to 1-based columns (fixes #2284) (Nicholas C. Zakas) +* Docs: array-bracket-spacing examples used space-in-brackets (Brandon Mills) +* Docs: Add spaced-line-comment deprecation notice (Brandon Mills) +* Docs: Add space-in-brackets deprecation notice (Brandon Mills) +* Fix: Include execScript in no-implied-eval rule (fixes #2873) (Frederik Braun) +* Fix: Support class syntax for line-around-comment rule (fixes #2894) (Gyandeep Singh) +* Fix: lines-around-comment was crashing in some cases due to a missing check (fixes #2892) (Mathieu M-Gosselin) +* New: Add init-declarations rule (fixes #2606) (cjihrig) +* Docs: Fix typo in array-bracket-spacing rule (zallek) +* Fix: Added missing export syntax support to the block-scoped-var rule. (fixes #2887) (Mathieu M-Gosselin) +* Build: gensite target supports rule removal (refs #1898) (Brandon Mills) +* Update: Handle CRLF line endings in spaced-comment rule (fixes #2884) (David Anson) +* Update: Attach parent in getNodeByRangeIndex (fixes #2863) (Brandon Mills) +* Docs: Fix typo (Bryan Smith) +* New: Add serviceworker environment (fixes #2557) (Gyandeep Singh) +* Fix: Yoda should ignore comparisons where both sides are constants (fixes #2867) (cjihrig) +* Update: Loosens regex rules around intentional fall through comments (Fixes #2811) (greg5green) +* Update: Add missing schema to rules (fixes #2858) (Ilya Volodin) +* New: `require-yield` rule (fixes #2822) (Toru Nagashima) +* New: add callback-return rule (fixes #994) (Jamund Ferguson) + +v0.24.1 - July 10, 2015 + +* Docs: Clarify when not to use space-before-blocks (Ian VanSchooten) +* Docs: remove mistaken "off by default" (Jan Schär) +* Docs: remove mistaken "off by default" (Jan Schär) +* Docs: Fix typo in the shareable configs doc (Siddharth Kannan) +* Docs: clarification in no-unused-vars (Jan Schär) +* Docs: missing quotes in JSON (Jan Schär) +* Fix: Revert 1-based column changes in tests for patch (refs #2284) (Nicholas C. Zakas) +* Fix: Shallow cloning issues in eslint config (fixes #2961) (Gyandeep Singh) +* Fix: object-shorthand computed props (fixes #2937) (Jamund Ferguson) +* Fix: Remove invalid check inside `getJSDocComment` function (fixes #2938) (Gyandeep Singh) +* Fix: max-len to report correct column number (fixes #2926) (Mathias Schreck) +* Fix: add destructuring support to comma-dangle rule (fixes #2911) (Mathias Schreck) +* Fix: `no-redeclare` checks module scopes (fixes #2903) (Toru Nagashima) +* Fix: Include execScript in no-implied-eval rule (fixes #2873) (Frederik Braun) +* Fix: Support class syntax for line-around-comment rule (fixes #2894) (Gyandeep Singh) +* Fix: lines-around-comment was crashing in some cases due to a missing check (fixes #2892) (Mathieu M-Gosselin) +* Fix: Added missing export syntax support to the block-scoped-var rule. (fixes #2887) (Mathieu M-Gosselin) +* Fix: Yoda should ignore comparisons where both sides are constants (fixes #2867) (cjihrig) +* Docs: array-bracket-spacing examples used space-in-brackets (Brandon Mills) +* Docs: Add spaced-line-comment deprecation notice (Brandon Mills) +* Docs: Add space-in-brackets deprecation notice (Brandon Mills) + +v0.24.0 - June 26, 2015 + +* Upgrade: eslint-tester to 0.8.1 (Nicholas C. Zakas) +* Fix: no-dupe-args sparse array crash (fixes #2848) (Chris Walker) +* Fix: space-after-keywords should ignore extra parens (fixes #2847) (Mathias Schreck) +* New: add no-unexpected-multiline rule (fixes #746) (Glen Mailer) +* Update: refactor handle-callback-err to improve performance (fixes #2841) (Mathias Schreck) +* Fix: Add --init to the CLI options (fixes #2817) (Gyandeep Singh) +* Update: Add `except-parens` option to `no-return-assign` rule (fixes #2809) (Toru Nagashima) +* Fix: handle-callback-err missing arrow functions (fixes #2823) (Jamund Ferguson) +* Fix: `no-extra-semi` in class bodies (fixes #2794) (Toru Nagashima) +* Fix: Check type to be file when looking for config files (fixes #2790) (Gyandeep Singh) +* Fix: valid-jsdoc to work for object getters (fixes #2407) (Gyandeep Singh) +* Update: Add an option as an object to `generator-star-spacing` rule (fixes #2787) (Toru Nagashima) +* Build: Update markdownlint dependency (David Anson) +* Fix: context report message to handle more scenarios (fixes #2746) (Gyandeep Singh) +* Update: Ignore JsDoc comments by default for `spaced-comment` (fixes #2766) (Gyandeep Singh) +* Fix: one-var 'never' option for mixed initialization (Fixes #2786) (Ian VanSchooten) +* Docs: Fix a minor typo in a prefer-const example (jviide) +* Fix: comma-dangle always-multiline: no comma right before the last brace (fixes #2091) (Benoît Zugmeyer) +* Fix: Allow blocked comments with markers and new-line (fixes #2777) (Gyandeep Singh) +* Docs: small fix in quote-props examples (Jose Roberto Vidal) +* Fix: object-shorthand rule should not warn for NFEs (fixes #2748) (Michael Ficarra) +* Fix: arraysInObjects for object-curly-spacing (fixes #2752) (Jamund Ferguson) +* Docs: Clarify --rule description (fixes #2773) (Nicholas C. Zakas) +* Fix: object literals in arrow function bodies (fixes #2702) (Jose Roberto Vidal) +* New: `constructor-super` rule (fixes #2720) (Toru Nagashima) +* New: `no-this-before-super` rule (fixes #2721) (Toru Nagashima) +* Fix: space-unary-ops flags expressions starting w/ keyword (fixes #2764) (Michael Ficarra) +* Update: Add block options to `lines-around-comment` rule (fixes #2667) (Gyandeep Singh) +* New: array-bracket-spacing (fixes #2226) (Jamund Ferguson) +* Fix: No-shadow rule duplicating error messages (fixes #2706) (Aliaksei Shytkin) + +v0.23.0 - June 14, 2015 + +* Build: Comment out auto publishing of release notes (refs #2640) (Ilya Volodin) +* Fix: "extends" within package.json (fixes #2754) (Gyandeep Singh) +* Upgrade: globals@8.0.0 (fixes #2759) (silverwind) +* Docs: eol-last docs fix (fixes #2755) (Gyandeep Singh) +* Docs: btmills is a reviewer (Nicholas C. Zakas) +* Build: Revert lock io.js to v2.1.0 (refs #2745) (Brandon Mills) +* New: computed-property-spacing (refs #2226) (Jamund Ferguson) +* Build: Pin Sinon version (fixes #2742) (Ilya Volodin) +* Fix: `prefer-const` treats `for-in`/`for-of` with the same way (Fixes #2739) (Toru Nagashima) +* Docs: Add links to team members profile (Gyandeep Singh) +* Docs: add team and ES7 info to readme (Nicholas C. Zakas) +* Fix: don't try to strip "line:" prefix from parser errors with no such prefix (fixes #2698) (Tim Cuthbertson) +* Fix: never ignore config comment options (fixes #2725) (Brandon Mills) +* Update: Add clarification to spaced-comment (refs #2588) (Greg Cochard) +* Update: Add markers to spaced-comment (fixes #2588) (Greg Cochard) +* Fix: no-trailing-spaces now handles skipBlankLines (fixes #2575) (Greg Cochard) +* Docs: Mark global-strict on by default (fixes #2629) (Ilya Volodin) +* New: Allow extends to be an array (fixes #2699) (Justin Morris) +* New: globals@7.1.0 (fixes #2682) (silverwind) +* New: `prefer-const` rule (fixes #2333) (Toru Nagashima) +* Fix: remove hard-coded list of unary keywords in space-unary-ops rule (fixes #2696) (Tim Cuthbertson) +* Breaking: Automatically validate rule options (fixes #2595) (Brandon Mills) +* Update: no-lone-blocks does not report block-level scopes (fixes #2119) (Jose Roberto Vidal) +* Update: yoda onlyEquality option (fixes #2638) (Denis Sokolov) +* Docs: update comment to align with source code it's referencing (Michael Ficarra) +* Fix: Misconfigured default option for lines-around-comment rule (fixes #2677) (Gyandeep Singh) +* Fix: `no-shadow` allows shadowing in the TDZ (fixes #2568) (Toru Nagashima) +* New: spaced-comment rule (fixes #1088) (Gyandeep Singh) +* Fix: Check unused vars in exported functions (fixes #2678) (Gyandeep Singh) +* Build: Stringify payload of release notes (fixes #2640) (Greg Cochard) +* Fix: Allowing u flag in regex to properly lint no-empty-character-class (fixes #2679) (Dominic Barnes) +* Docs: deprecate no-wrap-func (fixes #2644) (Jose Roberto Vidal) +* Docs: Fixing grammar: then -> than (E) +* Fix: trailing commas in object-curly-spacing (fixes #2647) (Jamund Ferguson) +* Docs: be consistent about deprecation status (Matthew Dapena-Tretter) +* Docs: Fix mistakes in object-curly-spacing docs (Matthew Dapena-Tretter) +* New: run processors when calling executeOnText (fixes #2331) (Mordy Tikotzky) +* Update: move executeOnText() tests to the correct describe block (fixes #2648) (Mordy Tikotzky) +* Update: add tests to assert that the preprocessor is running (fixes #2651) (Mordy Tikotzky) +* Build: Lock io.js to v2.1.0 (fixes #2653) (Ilya Volodin) + +v0.22.1 - May 30, 2015 + +* Build: Remove release notes auto-publish (refs #2640) (Ilya Volodin) + +v0.22.0 - May 30, 2015 + +* Upgrade: escope 3.1.0 (fixes #2310, #2405) (Toru Nagashima) +* Fix: “consistent-this” incorrectly flagging destructuring of `this` (fixes #2633) (David Aurelio) +* Upgrade: eslint-tester to 0.7.0 (Ilya Volodin) +* Update: allow shadowed references in no-alert (fixes #1105) (Mathias Schreck) +* Fix: no-multiple-empty-lines and template strings (fixes #2605) (Jamund Ferguson) +* New: object-curly-spacing (fixes #2225) (Jamund Ferguson) +* Docs: minor fix for one-var rule (Jamund Ferguson) +* Fix: Shared config being clobbered by other config (fixes #2592) (Dominic Barnes) +* Update: adds "functions" option to no-extra-parens (fixes #2477) (Jose Roberto Vidal) +* Docs: Fix json formatting for lines-around-comments rule (Gyandeep Singh) +* Fix: Improve around function/class names of `no-shadow` (fixes #2556, #2552) (Toru Nagashima) +* Fix: Improve code coverage (fixes #2590) (Ilya Volodin) +* Fix: Allow scoped configs to have sub-configs (fixes #2594) (Greg Cochard) +* Build: Add auto-update of release tag on github (fixes #2566) (Greg Cochard) +* New: lines-around-comment (fixes #1344) (Jamund Ferguson) +* Build: Unblock build by increasing code coverage (Ilya Volodin) +* New: accessor-pairs rule to object initializations (fixes #1638) (Gyandeep Singh) +* Fix: counting of variables statements in one-var (fixes #2570) (Mathias Schreck) +* Build: Add sudo:false for Travis (fixes #2582) (Ilya Volodin) +* New: Add rule schemas (refs #2179) (Brandon Mills) +* Docs: Fix typo in shareable-configs example (fixes #2571) (Ted Piotrowski) +* Build: Relax markdownlint rules by disabling style-only items (David Anson) +* Fix: Object shorthand rule incorrectly flagging getters/setters (fixes #2563) (Brad Dougherty) +* New: Add config validator (refs #2179) (Brandon Mills) +* New: Add worker environment (fixes #2442) (Ilya Volodin) +* New no-empty-character class (fixes #2508) (Jamund Ferguson) +* New: Adds --ignore-pattern option. (fixes #1742) (Patrick McElhaney) + +v0.21.2 - May 18, 2015 + +* 0.21.2 (Nicholas C. Zakas) +* Fix: one-var exception for ForStatement.init (fixes #2505) (Brandon Mills) +* Fix: Don't throw spurious shadow errors for classes (fixes #2545) (Jimmy Jia) +* Fix: valid-jsdoc rule to support exported functions (fixes #2522) (Gyandeep Singh) +* Fix: Allow scoped packages in configuration extends (fixes #2544) (Eric Isakson) +* Docs: Add chatroom to FAQ (Nicholas C. Zakas) +* Docs: Move Gitter badge (Nicholas C. Zakas) + +v0.21.1 - May 15, 2015 + +* 0.21.1 (Nicholas C. Zakas) +* Fix: loc obj in report fn expects column (fixes #2481) (Varun Verma) +* Build: Make sure that all md files end with empty line (fixes #2520) (Ilya Volodin) +* Added Gitter badge (The Gitter Badger) +* Fix: forced no-shadow to check all scopes (fixes #2294) (Jose Roberto Vidal) +* Fix: --init indent setting (fixes #2493) (Nicholas C. Zakas) +* Docs: Mention bundling multiple shareable configs (Nicholas C. Zakas) +* Fix: Not to override the required extended config object directly (fixes #2487) (Gyandeep Singh) +* Build: Update markdownlint dependency (David Anson) +* Docs: added recursive function example to no-unused-vars (Jose Roberto Vidal) +* Docs: Fix typo (then -> than) (Vladimir Agafonkin) +* Revert "Fix: sanitise Jekyll interpolation during site generation (fixes #2297)" (Nicholas C. Zakas) +* Fix: dot-location should use correct dot token (fixes #2504) (Mathias Schreck) +* Fix: Stop linebreak-style from crashing (fixes #2490) (James Whitney) +* Fix: rule no-duplicate-case problem with CallExpressions. (fixes #2499) (Matthias Osswald) +* Fix: Enable full support for eslint-env comments (refs #2134) (Ilya Volodin) +* Build: Speed up site generation (fixes #2475) (Ilya Volodin) +* Docs: Fixing trailing spaces (Fixes #2478) (Ilya Volodin) +* Docs: Update README FAQs (Nicholas C. Zakas) +* Fix: Allow comment before comma for comma-spacing rule (fixes #2408) (Gyandeep Singh) + +v0.21.0 - May 9, 2015 + +* 0.21.0 (Nicholas C. Zakas) +* New: Shareable configs (fixes #2415) (Nicholas C. Zakas) +* Fix: Edge cases for no-wrap-func (fixes #2466) (Nicholas C. Zakas) +* Docs: Update ecmaFeatures description (Nicholas C. Zakas) +* New: Add dot-location rule. (fixes #1884) (Greg Cochard) +* New: Add addPlugin method to CLI-engine (Fixes #1971) (Ilya Volodin) +* Breaking: Do not check unset declaration types (Fixes #2448) (Ilya Volodin) +* Fix: no-redeclare switch scoping (fixes #2337) (Nicholas C. Zakas) +* Fix: Check extra scope in no-use-before-define (fixes #2372) (Nicholas C. Zakas) +* Fix: Ensure baseConfig isn't changed (fixes #2380) (Nicholas C. Zakas) +* Fix: Don't warn for member expression functions (fixes #2402) (Nicholas C. Zakas) +* New: Adds skipBlankLines option to the no-trailing-spaces rule (fixes #2303) (Andrew Vaughan) +* Fix: Adding exception for last line (Refs #2423) (Greg Cochard) +* Fix: crash on 0 max (fixes #2423) (gcochard) +* Fix object-shorthand arrow functions (fixes #2414) (Jamund Ferguson) +* Fix: Improves detection of self-referential functions (fixes #2363) (Jose Roberto Vidal) +* Update: key-spacing groups must be consecutive lines (fixes #1728) (Brandon Mills) +* Docs: grammar fix in no-sync (Tony Lukasavage) +* Docs: Update configuring.md to fix incorrect link. (Ans) +* New: Check --stdin-filename by ignore settings (fixes #2432) (Aliaksei Shytkin) +* Fix: `no-loop-func` rule allows functions at init part (fixes #2427) (Toru Nagashima) +* New: Add init command (fixes #2302) (Ilya Volodin) +* Fix: no-irregular-whitespace should work with irregular line breaks (fixes #2316) (Mathias Schreck) +* Fix: generator-star-spacing with class methods (fixes #2351) (Brandon Mills) +* New: no-unneeded-ternary rule to disallow boolean literals in conditional expressions (fixes #2391) (Gyandeep Singh) +* Docs: Add `restParams` to `ecmaFeatures` options list (refs: #2346) (Bogdan Savluk) +* Fix: space-in-brackets Cannot read property 'range' (fixes #2392) (Gyandeep Singh) +* Docs: Sort the rules (Lukas Böcker) +* Add: Exception option for `no-extend-native` and `no-native-reassign` (fixes #2355) (Gyandeep Singh) +* Fix: space-in-brackets import declaration (fixes #2378) (Gyandeep Singh) +* Update: Add uninitialized and initialized options (fixes #2206) (Ian VanSchooten) +* Fix: brace-style to not warn about curly mix ifStatements (fixes #1739) (Gyandeep Singh) +* Fix: npm run profile script should use espree (fixes #2150) (Mathias Schreck) +* New: Add support for extending configurations (fixes #1637) (Espen Hovlandsdal) +* Fix: Include string literal keys in object-shorthand (Fixes #2374) (Jamund Ferguson) +* Docs: Specify language for all code fences, enable corresponding markdownlint rule. (David Anson) +* New: linebreak-style rule (fixes #1255) (Erik Müller) +* Update: Add "none" option to operator-linebreak rule (fixes #2295) (Casey Visco) +* Fix: sanitise Jekyll interpolation during site generation (fixes #2297) (Michael Ficarra) + +v0.20.0 - April 24, 2015 + +* 0.20.0 (Nicholas C. Zakas) +* Fix: support arrow functions in no-extra-parens (fixes #2367) (Michael Ficarra) +* Fix: Column position in space-infix-ops rule (fixes #2354) (Gyandeep Singh) +* Fix: allow plugins to be namespaced (fixes #2360) (Seth Pollack) +* Update: one-var: enable let & const (fixes #2301) (Joey Baker) +* Docs: Add meteor to avaiable environments list (bartmichu) +* Update: Use `Object.assign()` polyfill for all object merging (fixes #2348) (Sindre Sorhus) +* Docs: Update markdownlint dependency, resolve/suppress new issues. (David Anson) +* Fix: newline-after-var declare and export (fixes #2325) (Gyandeep Singh) +* Docs: Some typos and grammar. (AlexKVal) +* Fix: newline-after-var to ignore declare in for specifiers (fixes #2317) (Gyandeep Singh) +* New: add --stdin-filename option (fixes #1950) (Mordy Tikotzky) +* Fix: Load .eslintrc in $HOME only if no other .eslintrc is found (fixes #2279) (Jasper Woudenberg) +* Fix: Add `v8` module to no-mixed-requires rule (fixes #2320) (Gyandeep Singh) +* Fix: key-spacing with single properties (fixes #2311) (Brandon Mills) +* Docs: `no-invalid-regexp`: add `ecmaFeatures` flags for `u`/`y` (Jordan Harband) +* New: object-shorthand rule (refs: #1617) (Jamund Ferguson) +* Update: backticks support for quotes rule (fixes #2153) (borislavjivkov) +* Fix: space-in-brackets to work with modules (fixes #2216) (Nicholas C. Zakas) + +v0.19.0 - April 11, 2015 + +* 0.19.0 (Nicholas C. Zakas) +* Upgrade: Espree to 2.0.1 (Nicholas C. Zakas) +* Docs: Update one-var documentation (fixes #2210) (Nicholas C. Zakas) +* Update: Add test for no-undef (fixes #2214) (Nicholas C. Zakas) +* Fix: Report better location for padded-blocks error (fixes #2224) (Nicholas C. Zakas) +* Fix: Don't check concise methods in quote-props (fixes #2251) (Nicholas C. Zakas) +* Fix: Consider tabs for space-in-parens rule (fixes #2191) (Josh Quintana) +* Fix: block-scoped-var to work with classes (fixes #2280) (Nicholas C. Zakas) +* Docs: Remove trailing spaces, enable corresponding markdownlint rule. (David Anson) +* Fix: padded-blocks with ASI (fixes #2273) (Brandon Mills) +* Fix: Handle comment lines in newline-after-var (fixed #2237) (Casey Visco) +* Docs: Standardize on '*' for unordered lists, enable corresponding markdownlint rule. (David Anson) +* Fix: no-undef and no-underscore-dangle to use double quotes (fixes #2258) (Gyandeep Singh) +* Docs: Improve grammar and style in comma-dangle.md (Nate Eagleson) +* Docs: Improve grammar and style in padded-blocks.md (Nate Eagleson) +* Docs: Update URL in no-wrap-func.md to resolve 404 (Nate Eagleson) +* Docs: Fix typo in command-line-interface.md (Nate Eagleson) +* Docs: Fix typo in working-with-rules.md (Nate Eagleson) +* Docs: Remove hard tabs from *.md, enable corresponding markdownlint rule. (David Anson) +* Fix: Function id missing in parent scope when using ecmaFeature `modules` for rule block-scoped-var (fixes #2242) (Michael Ferris) +* Fix: Ignore single lines for vertical alignment (fixes #2018) (Ian VanSchooten) +* Fix: Allow inline comments in newline-after-var rule (fixes #2229) (Casey Visco) +* Upgrade: Espree 2.0.0 and escope 3.0.0 (fixes #2234, fixes #2201, fixes (Nicholas C. Zakas) +* Docs: Update --no-ignore warning (Brandon Mills) +* Build: Remove jshint files (fixes #2222) (Jeff Tan) +* Docs: no-empty fix comment change (refs #2188) (Gyandeep Singh) +* Fix: duplicate semi and no-extra-semi errors (fixes #2207) (Brandon Mills) +* Docs: Update processors description (Nicholas C. Zakas) +* Fix: semi error on export declaration (fixes #2194) (Brandon Mills) +* New: operator-linebreak rule (fixes #1405) (Benoît Zugmeyer) +* Docs: Fixing broken links in documentation (Ilya Volodin) +* Upgrade: Espree to 0.12.3 (fixes #2195) (Gyandeep Singh) +* Fix: camelcase rule with {properties: never} shouldn't check assignment (fixes #2189) (Gyandeep Singh) +* New: Allow modifying base config (fixes #2143) (Meo) +* New: no-continue rule (fixes #1945) (borislavjivkov) +* Fix: `no-empty` rule should allow any comments (fixes #2188) (Gyandeep Singh) +* Docs: Fix spell in camelcase doc (fixes #2190) (Gyandeep Singh) +* Fix: Require semicolon after import/export statements (fixes #2174) (Gyandeep Singh) +* Build: Add linting of Markdown files to "npm test" script (fixes #2182) (David Anson) +* Build: Fixing site generation (Ilya Volodin) +* Build: Fix gensite task to work even if files are missing (Nicholas C. Zakas) + +v0.18.0 - March 28, 2015 + +* 0.18.0 (Nicholas C. Zakas) +* Fix: Mark variables as used in module scope (fixes #2137) (Nicholas C. Zakas) +* Fix: arrow functions need wrapping (fixes #2113) (Nicholas C. Zakas) +* Fix: Don't crash on empty array pattern item (fixes #2111) (Nicholas C. Zakas) +* Fix: Don't error on destructured params (fixes #2051) (Nicholas C. Zakas) +* Docs: Fixing broken links (Ilya Volodin) +* Fix: no-constant-condition should not flag += (fixes #2155) (Nicholas C. Zakas) +* Fix: Ensure piped in code will trigger correct errors (fixes #2154) (Nicholas C. Zakas) +* Fix: block-scoped-var to handle imports (fixes #2087) (Nicholas C. Zakas) +* Fix: no-dupe-args to work with destructuring (fixes #2148) (Nicholas C. Zakas) +* Fix: key-spacing crash on computed properties (fixes #2120) (Brandon Mills) +* Fix: indent crash on caseless switch (fixes #2144) (Brandon Mills) +* Fix: Don't warn about destructured catch params (fixes #2125) (Nicholas C. Zakas) +* Update: Omit setter param from no-unused-vars (fixes #2133) (Nicholas C. Zakas) +* Docs: Cleaning dead links (Ilya Volodin) +* Docs: Moving documentation out of the repository and modifying build scripts (Ilya Volodin) +* Docs: Update link to Documentation (Kate Lizogubova) +* Docs: Adding back deprecated space-unary-word-ops documentation (Ilya Volodin) +* Fix: Unused recursive functions should be flagged (issue2095) (Nicholas C. Zakas) +* Breaking: Remove JSX support from no-undef (fixes #2093) (Nicholas C. Zakas) +* Fix: markVariableAsUsed() should work in Node.js env (fixes #2089) (Nicholas C. Zakas) +* New: Add "always" and "never" options to "one-var" rule. (fixes #1619) (Danny Fritz) +* New: newline-after-var rule (fixes #2057) (Gopal Venkatesan) +* Fix: func-names with ES6 classes (fixes #2103) (Marsup) +* Fix: Add "Error" to the "new-cap" rule exceptions (fixes #2098) (Mickaël Tricot) +* Fix: vars-on-top conflict with ES6 import (fixes #2099) (Gyandeep Singh) +* Docs: Fixed JSON syntax (Sajin) +* New: space-before-function-paren rule (fixes #2028) (Brandon Mills) +* Breaking: rule no-empty also checking for empty catch blocks. (fixes #1841) (Dieter Oberkofler) +* Update: rule camelcase to allow snake_case in object literals. (fixes #1919) (Dieter Oberkofler) +* New: Added option int32Hint for space-infix-ops (fixes #1295) (Kirill Efimov) +* New: no-param-reassign rule (fixes #1599) (Nat Burns) + +v0.17.1 - March 17, 2015 + +* 0.17.1 (Nicholas C. Zakas) +* Fix: no-func-assign should not fail on import declarations (fixes #2060) (Igor Zalutsky) +* Fix: block-scoped-var to work with destructuring (fixes #2059) (Nicholas C. Zakas) +* Fix: no-redeclare should check Node.js scope (fixes #2064) (Nicholas C. Zakas) +* Fix: space-before-function-parentheses generator methods (fixes #2082) (Brandon Mills) +* Fix: Method name resolution in complexity rule (fixes #2049) (Nicholas C. Zakas) +* Fix: no-unused-vars crash from escope workaround (fixes #2042) (Brandon Mills) +* Fix: restrict dot-notation keywords to actual ES3 keywords (fixes #2075) (Michael Ficarra) +* Fix: block-scoped-var to work with classes (fixes #2048) (Nicholas C. Zakas) +* Docs: Update no-new documentation (fixes #2044) (Nicholas C. Zakas) +* Fix: yoda range exceptions with this (fixes #2063) (Brandon Mills) +* Docs: Fix documentation on configuring eslint with comments (Miguel Ping) +* Fix: rule no-duplicate-case problem with MemberExpressions. (fixes #2038) (Dieter Oberkofler) +* Fix: Exempt \0 from no-octal-escape (fixes #1923) (Michael Ficarra) + +v0.17.0 - March 14, 2015 + +* 0.17.0 (Nicholas C. Zakas) +* Fix: module import specifiers should be defined (refs #1978) (Nicholas C. Zakas) +* Fix: Ignore super in no-undef (refs #1968) (Nicholas C. Zakas) +* Upgrade: Espree to v0.12.0 (refs #1968) (Nicholas C. Zakas) +* Fix: destructured arguments should work in block-scoped-var (fixes #1996) (Nicholas C. Zakas) +* Fix: Line breaking with just carriage return (fixes #2005) (Nicholas C. Zakas) +* Fix: location of new-cap error messages (fixes #2025) (Mathias Schreck) +* Breaking: Stop checking JSX variable use, expose API instead (fixes #1911) (Glen Mailer) +* Fix: Check spacing of class methods (fixes #1989) (Nicholas C. Zakas) +* New: no-duplicate-case rule to disallow a duplicate case label (fixes #2015) (Dieter Oberkofler) +* Clarify issue requirement for doc pull requests (Ian) +* Add quotes around object key (Ian) +* Fix: Add comma-dangle allow-multiline (fixes #1984) (Keith Cirkel) +* Fix: Don't explode on default export function (fixes #1985) (Nicholas C. Zakas) +* Update: Add AST node exceptions to comma-style. (fixes #1932) (Evan Simmons) +* Docs: Add spread operator to available language options (Nicholas C. Zakas) +* New: generator-star-spacing rule (fixes #1680, fixes #1949) (Brandon Mills) + +v0.16.2 - March 10, 2015 + +* 0.16.2 (Nicholas C. Zakas) +* Fix: Ensure globalReturn isn't on when node:false (fixes #1995) (Nicholas C. Zakas) +* Downgrade: escope pegged to 2.0.6 (refs #2001) (Nicholas C. Zakas) +* Upgrade: escope to 2.0.7 (fixes #1978) (Nicholas C. Zakas) +* Docs: Update descriptive text for --no-ignore option. (David Anson) +* Upgrade: estraverse to latest for ESTree support (fixes #1986) (Nicholas C. Zakas) +* Fix: Global block-scope-var check should work (fixes #1980) (Nicholas C. Zakas) +* Fix: Don't warn about parens around yield (fixes #1981) (Nicholas C. Zakas) + +v0.16.1 - March 8, 2015 + +* 0.16.1 (Nicholas C. Zakas) +* Fix: Node.js scoping in block-scoped-var (fixes #1969) (Nicholas C. Zakas) +* Update: Enable ES6 scoping for more options (Nicholas C. Zakas) +* Fix: Ensure all export nodes are traversable (fixes #1965) (Nicholas C. Zakas) +* Fix: Ensure class names are marked as used (fixes #1967) (Nicholas C. Zakas) +* Fix: remove typo that caused a crash (fixes #1963) (Fabricio C Zuardi) +* Docs: Added missing "are" (Sean Wilkinson) + +v0.16.0 - March 7, 2015 + +* 0.16.0 (Nicholas C. Zakas) +* Fix: Pass correct sourceType to escope (fixes #1959) (Nicholas C. Zakas) +* Fix: Scoping for Node.js (fixes #892) (Nicholas C. Zakas) +* Fix: strict rule should honor module code (fixes #1956) (Nicholas C. Zakas) +* New: Add es6 environment (fixes #1864, fixes #1944) (Nicholas C. Zakas) +* Docs: Update ecmaFeatures list (fixes #1942) (Nicholas C. Zakas) +* Fix: Make no-unused-vars ignore exports (fixes #1903) (Nicholas C. Zakas) +* Upgrade: Espree to v1.11.0 (Nicholas C. Zakas) +* Fix: Comment configuration of rule doesn't work (fixes #1792) (Jary) +* Fix: Rest args should work in no-undef and block-scoped-var (fixes #1543) (Nicholas C. Zakas) +* Breaking: change no-comma-dangle to comma-dangle (fixes #1350) (Mathias Schreck) +* Update: space-before-function-parentheses to support generators (fixes #1929) (Brandon Mills) +* New: Adding support for "// eslint-disable-line rule" style comments (Billy Matthews) +* Fix: Use unversioned sinon file in browser test (fixes #1947) (Nicholas C. Zakas) +* Docs: Add mention of compatible parsers (Nicholas C. Zakas) +* Fix: Better error when given null as rule config (fixes #1760) (Glen Mailer) +* Update: no-empty to check TryStatement.handler (fixes #1930) (Brandon Mills) +* Fix: space-before-function-parentheses and object methods (fixes #1920) (Brandon Mills) +* New: no-dupe-args rule (fixes #1880) (Jamund Ferguson) +* Fix: comma-spacing should ignore JSX text (fixes #1916) (Brandon Mills) +* Breaking: made eol-last less strict (fixes #1460) (Glen Mailer) +* New: generator-star middle option (fixes #1808) (Jamund Ferguson) +* Upgrade: Espree to 1.10.0 for classes support (Nicholas C. Zakas) +* Docs: no-plusplus.md - auto semicolon insertion (Miroslav Obradović) +* Docs: Use union types in TokenStore JSDoc (refs #1878) (Brandon Mills) +* Fix: block-scoped-var to work with destructuring (fixes #1863) (Nicholas C. Zakas) +* Docs: Update docs for token-related methods (fixes #1878) (Nicholas C. Zakas) +* Update: Remove preferGlobal from package.json (fixes #1877) (Nicholas C. Zakas) +* Fix: allow block bindings in no-inner-declarations (fixes #1893) (Roberto Vidal) +* Fix: getScope and no-use-before-define for arrow functions (fixes #1895) (Brandon Mills) +* Fix: Make no-inner-declarations look for arrow functions (fixes #1892) (Brandon Mills) +* Breaking: Change no-space-before-semi to semi-spacing and add "after" option (fixes #1671) (Mathias Schreck) +* Update: Add support for custom preprocessors (fixes #1817) (Ilya Volodin) + +v0.15.1 - February 26, 2015 + +* 0.15.1 (Nicholas C. Zakas) +* Build: Fix release task (Nicholas C. Zakas) +* Fix: check all semicolons in no-space-before-semi (fixes #1885) (Mathias Schreck) +* Fix: Refactor comma-spacing (fixes #1587, fixes #1845) (Roberto Vidal) +* Fix: Allow globalReturn in consistent-return (fixes #1868) (Brandon Mills) +* Fix: semi rule should check throw statements (fixes #1873) (Mathias Schreck) +* Docs: Added HolidayCheck AG as user (0xPIT) +* Upgrade: `chalk` to 1.0.0 (Sindre Sorhus) +* Docs: Add CustomInk to the list of companies (Derek Lindahl) +* Docs: Alphabetize project & company usage list (Derek Lindahl) +* Docs: fix typo (Henry Zhu) +* Docs: Fix typo (Brenard Cubacub) + +v0.15.0 - February 21, 2015 + +* 0.15.0 (Nicholas C. Zakas) +* Upgrade: Espree to 1.9.1 (fixes #1816, fixes #1805) (Nicholas C. Zakas) +* Fix: make rules work with for-of statements (fixes #1859) (Mathias Schreck) +* Fix: Enable globalReturn for Node.js environment (fixes #1158) (Nicholas C. Zakas) +* Fix: Location of extra paren message (fixes #1814) (Nicholas C. Zakas) +* Fix: Remove unnecessary file exists check (fixes #1831) (Nicholas C. Zakas) +* Fix: Don't count else-if in max-depth (fixes #1835) (Nicholas C. Zakas) +* Fix: Don't flag for-of statement (fixes #1852) (Nicholas C. Zakas) +* Build: Test using io.js as well (Nicholas C. Zakas) +* Change customformat value to path (suisho) +* Docs: Add a missing word in the Contributing doc (Ben Linskey) +* Docs: Fix typo in wrap-iife rule doc title (Ben Linskey) +* Docs: Update pages to fix rendering of lists (David Anson) +* Fix: new-cap should allow defining exceptions (fixes #1424) (Brian Di Palma) +* Update: Add requireReturnDescription for valid-jsdoc (fixes #1833) (Brian Di Palma) +* New: rule no-throw-literal added (fixes #1791) (Dieter Oberkofler) +* New: multi-line option for the curly rule (fixes #1812) (Hugo Wood) +* Docs: fix typo in configuring docs (mendenhallmagic) +* Update: Backslashes in path (fixes #1818) (Jan Schär) +* Docs: Update pages to fix rendering of lists and fenced code blocks (David Anson) +* Docs: add webpack loader to the docs/integrations page (Maxime Thirouin) +* Breaking: space-before-function-parentheses replaces space-after-function-name and checkFunctionKeyword (fixes #1618) (Mathias Schreck) + +v0.14.1 - February 8, 2015 + +* 0.14.1 (Nicholas C. Zakas) +* Fix: Exit code should be 1 for any number of errors (fixes #1795) (Nicholas C. Zakas) +* Fix: Check indentation of first line (fixes #1796) (Nicholas C. Zakas) +* Fix: strict rules shouldn't throw on arrow functions (fixes #1789) (Nicholas C. Zakas) + +v0.14.0 - February 7, 2015 + +* 0.14.0 (Nicholas C. Zakas) +* Update: Fix indentation of comment (Nicholas C. Zakas) +* Fix: comma-spacing for template literals (fixes #1736) (Nicholas C. Zakas) +* Build: Add Node.js 0.12 testing (Nicholas C. Zakas) +* Breaking: Remove node from results (fixes #957) (Nicholas C. Zakas) +* Breaking: Exit code is now error count (Nicholas C. Zakas) +* Docs: Correct getFormatter() documentation (refs #1723) (Nicholas C. Zakas) +* Update: Make rules work with arrow functions (fixes #1508, fixes #1509, fixes #1493) (Nicholas C. Zakas) +* Fix: Ensure template string references count (fixes #1542) (Nicholas C. Zakas) +* Fix: no-undef to work with arrow functions (fixes #1604) (Nicholas C. Zakas) +* Upgrade: Espree to version 1.8.0 (Nicholas C. Zakas) +* Fix: Don't throw error for arguments (fixes #1759) (Nicholas C. Zakas) +* Fix: Don't warn on computed nonliteral properties (fixes #1762) (Nicholas C. Zakas) +* New: Allow parser to be configured (fixes #1624) (Nicholas C. Zakas) +* Docs: Added double quotes for JSON keys for comma-spacing and key-spacing rule (Dmitry Polovka) +* New: Rule indent (fixes #1022) (Dmitriy Shekhovtsov) +* Revert "New: Rule indent (fixes #1022)" (Nicholas C. Zakas) +* Update: fix eslint indentations (fixes #1770) (Dmitriy Shekhovtsov) +* Fix: Scoping issues for no-unused-vars (fixes #1741) (Nicholas C. Zakas) +* Docs: Added `eslint-enable` inline (Ivan Fraixedes) +* New: Add predefined Meteor globals (fixes #1763) (Johan Brook) +* New: Rule indent (fixes #1022) (Dmitriy Shekhovtsov) +* Update: Check all assignments for consistent-this (fixes #1513) (Timothy Jones) +* Fix: Support exceptions in no-multi-spaces (fixes #1755) (Brandon Mills) +* Docs: Forgotten parentheses in code snippet (Ivan Fraixedes) +* Update: CLIEngine results include warning and error count (fixes #1732) (gyandeeps) +* Fix: Scoping issues for no-unused-vars (fixes #1733) (Nicholas C. Zakas) +* Update: Add getNodeByRangeIndex method (refs #1755) (Brandon Mills) +* Update: Replace getTokenByRange(Index->Start) (refs #1721) (Brandon Mills) +* Update: Fast-path for empty input (fixes #546) (Nicholas C. Zakas) +* Fix: Allow single line else-if (fixes #1739) (Nicholas C. Zakas) +* Fix: Don't crash when $HOME isn't set (fixes #1465) (Nicholas C. Zakas) +* Fix: Make no-multi-spaces work for every case (fixes #1603, fixes #1659) (Nicholas C. Zakas) +* Breaking: Show error and warning counts in stylish summary (fixes #1746) (Brandon Mills) +* Docs: fixed typo in no-lone-blocks docs (Vitor Balocco) +* Docs: fixed typo in consistent-return docs (Vitor Balocco) +* Breaking: remove implied eval check from no-eval (fixes #1202) (Mathias Schreck) +* Update: Improve CLIEngine.getFormatter() (refs #1723) (Nicholas C. Zakas) +* Docs: Add Backbone plugin link (Ilya Volodin) +* Docs: use npm's keyword route (Tom Vincent) +* Build: Update sitegen script (Closes #1725) (Ilya Volodin) + +v0.13.0 - January 24, 2015 + +* 0.13.0 (Nicholas C. Zakas) +* Update: The rule spaced-line-comment now also allows tabs and not only spaces as whitespace. (fixes #1713) (Dieter Oberkofler) +* Docs: add Jasmine rules and eslintplugin npm links (Tom Vincent) +* Fix: Make no-redeclare work with let (fixes #917) (Nicholas C. Zakas) +* Update: Add CLIEngine.getFormatter() (fixes #1653) (Nicholas C. Zakas) +* Breaking: Update escope (fixes #1642) (Nicholas C. Zakas) +* Update: Switch to using estraverse-fb (fixes #1712) (Nicholas C. Zakas) +* Docs: Update README FAQ (Nicholas C. Zakas) +* Update: no-warning-comments matches on whole word only (fixes #1709) (Nick Fisher) +* Build: Add JSDoc generation (fixes #1363) (Nicholas C. Zakas) +* Docs: Add more info about context (fixes #1330) (Nicholas C. Zakas) +* Upgrade: Espree to 1.7.1 (fixes #1706) (Nicholas C. Zakas) +* Docs: Make CLA notice more prominent (Nicholas C. Zakas) +* Update: Added globals for: phantom,jquery, prototypejs, shelljs (fixes #1704) (Dmitriy Shekhovtsov) +* Docs: Fixed example for the space-return-throw-case rule (mpal9000) +* Fix: Except object literal methods from func-names (fixes #1699) (Brandon Mills) +* Update: use global strict mode everywhere (fixes #1691) (Brandon Mills) +* Update: Add allowPattern option for dot-notation rule (fixes #1679) (Tim Schaub) +* Fix: Missing undeclared variables in JSX (fixes #1676) (Yannick Croissant) +* Fix: no-unused-expressions rule incorrectly flagging yield (fixes #1672) (Rémi Gérard-Marchant) +* Update: Combine strict mode rules (fixes #1246) (Brandon Mills) +* Fix: disregards leading './' in ignore pattern or file name (fixes #1685) (Chris Montrois) +* Upgrade: globals module to latest (fixes #1670) (Nicholas C. Zakas) +* Fix: generator-star should allow params (fixes #1677) (Brandon Mills) +* Fix: no-unused-vars for JSX (fixes #1673 and fixes #1534) (Yannick Croissant) +* Docs: Add angularjs-eslint link into the integration doc (Emmanuel DEMEY) + +v0.12.0 - January 17, 2015 + +* 0.12.0 (Nicholas C. Zakas) +* Fix: Track JSX global variable correctly (fixes #1534) (Nicholas C. Zakas) +* Fix: Property regex flag checking (fixes #1537) (Nicholas C. Zakas) +* Docs: Add angularjs-eslint link into the integration doc (Emmanuel DEMEY) +* Update: Expose ecmaFeatures on context (fixes #1648) (Nicholas C. Zakas) +* Docs: Added Fitbit to the list of companies (Igor Zalutsky) +* New: gen-star rule (refs #1617) (Jamund Ferguson) +* New: no-var rule (refs #1617) (Jamund Ferguson) +* Fix: Support JSX spread operator (fixes #1634) (Nicholas C. Zakas) +* Docs: Document ecmaFeatures (Nicholas C. Zakas) +* Upgrade: several dependencies (fixes #1377) (Nicholas C. Zakas) +* Fix: Broken JSX test (Nicholas C. Zakas) +* Fix: no-bitwise reports on bitwise assignment expressions (fixes #1643) (Mathias Schreck) +* Fix: Find JSXIdentifier refs in no-unused-vars (fixes #1534) (Nicholas C. Zakas) +* Update: Add a couple JSX tests (Nicholas C. Zakas) +* Fix: quotes rule ignores JSX literals (fixes #1477) (Nicholas C. Zakas) +* Fix: Don't warn on JSX literals with newlines (fixes #1533) (Nicholas C. Zakas) +* Update: Fully enable JSX support (fixes #1640) (Nicholas C. Zakas) +* Breaking: Allow parser feature flips (fixes #1602) (Nicholas C. Zakas) +* Fix: Allow comments in key-spacing groups (fixes #1632) (Brandon Mills) +* Fix: block-scoped-var reports labels (fixes #1630) (Michael Ficarra) +* Docs: add newline to no-process-env (fixes #1627) (Tom Vincent) +* Fix: Update optionator, --no in help (fixes #1134) (George Zahariev) +* Fix: Allow individual newlines in space-in-brackets (fixes #1614) (Brandon Mills) +* Docs: Correct alignment in example project tree (Tim Schaub) +* Docs: Remove references to Esprima (Nicholas C. Zakas) +* Docs: Remove illegal code fence (Nicholas C. Zakas) + +v0.11.0 - December 30, 2014 + +* 0.11.0 (Nicholas C. Zakas) +* Fix: Adding regexp literal exception (fixes #1589) (Greg Cochard) +* Fix: padded-blocks incorrectly complained on comments (fixes #1416) (Mathias Schreck) +* Fix: column location of key-spacing with additional tokens (fixes #1458) (Mathias Schreck) +* Build: tag correct commit (refs #1606) (Mathias Schreck) +* Upgrade: Updat Espree to 1.3.1 (Nicholas C. Zakas) +* Fix: add es3 config option to dot-notation rule (fixes #1484) (Michael Ficarra) +* Fix: valid-jsdoc should recognize @class (fixes #1585) (Nicholas C. Zakas) +* Update: Switch to use Espree (fixes #1595) (Nicholas C. Zakas) +* Fix: brace-style stroustrup should report on cuddled elseif (fixes #1583) (Ian Christian Myers) +* New: Configuration via package.json (fixes #698) (Michael Mclaughlin) +* Update: Set environments w/ globals (fixes #1577) (Elan Shanker) +* Fix: yoda treats negative numbers as literals (fixes #1571) (Brandon Mills) +* Fix: function arguments now count towards no-shadow check (fixes #1584) (Glen Mailer) +* Fix: check if next statement is on newline when warning against extra semicolons. (fixes #1580) (Evan You) +* Update: add yoda exception for range tests (fixes #1561) (Brandon Mills) +* New: space-after-function-name (fixes #1340) (Roberto Vidal) + +v0.10.2 - December 12, 2014 + +* 0.10.2 (Nicholas C. Zakas) +* Fix: detect for...in in no-loop-func (fixes #1573) (Greg Cochard) +* Update: simplify comma-spacing logic (fixes #1562) (Brandon Mills) +* Fix: operator-assignment addition is non-commutative (fixes#1556) (Brandon Mills) +* 0.10.1 (Nicholas C. Zakas) +* Update: Add new-cap exception configurations. (Fixes #1487) - `newCapsAllowed` - `nonNewCapsAllowed` (Jordan Harband) + +v0.10.1 - December 6, 2014 + +* 0.10.1 (Nicholas C. Zakas) +* Docs: Fix v0.10.0 changelog (Nicholas C. Zakas) +* Build: Ensure changelog works with large semver versions (Nicholas C. Zakas) +* Fix: comma-spacing and comma-style to work with array literals (fixes #1492) (Nicholas C. Zakas) +* Update: better operator regex in use-isnan rule (fixes #1551) (Michael Ficarra) +* Fix: wrong op index in no-multi-spaces (fixes #1547) (Brandon Mills) +* Fix: Restrict use-isnan violations to comparison operators. (Fixes #1535) (Jordan Harband) +* Fix: comma-spacing has false positives when parenthesis are used (fixes #1457) (Jamund Ferguson) +* Docs: alphabetize the "Stylistic Issues" section (Jeff Williams) +* Build: make the "gensite" target work when DOCS_DIR does not exist (fixes #1530) (Jeff Williams) +* Docs: badges should only refer to master branch (Mathias Schreck) +* Fix: prevent crash on empty blocks in no-else-return (fixes #1527) (Mathias Schreck) +* Build: Fix md to html conversion regex (fixes #1525) (Brandon Mills) +* 0.10.0 (Nicholas C. Zakas) + +v0.10.0 - November 27, 2014 + +* 0.10.0 (Nicholas C. Zakas) +* Fix: Add Object and Function as exceptions in new-cap (refs #1487) (Nicholas C. Zakas) +* Breaking: Allow extensionless files to be passed on CLI (fixes #1131) (Nicholas C. Zakas) +* Fix: typo: iffe to iife, none to non (Michael Ficarra) +* Update: refactor tokens API (refs #1212) (Brandon Mills) +* New: Allow other file extensions (fixes #801) (Nicholas C. Zakas) +* Update: Add Event to browser globals (fixes #1474) (Nicholas C. Zakas) +* Fix: check function call arguments in comma-spacing (fixes #1515) (Mathias Schreck) +* Update: Add no-cond-assign option to disallow nested assignments in conditionals (fixes #1444) (Jeff Williams) +* Fix: crash in no-multi-spaces on empty array elements (fixes #1418) (Brandon Mills) +* Fix: Don't explode on directory traversal (fixes #1452) (Nicholas C. Zakas) +* Fix: no-fallthrough should work when semis are missing (fixes #1447) (Nicholas C. Zakas) +* Fix: JSDoc parsing by updating doctrine (fixes #1442) (Nicholas C. Zakas) +* Update: restore the "runs" global present in Jasmine 1.3 (fixes #1498) (Michał Gołębiowski) +* Fix: ignore undefined identifiers in typeof (fixes #1482) (Mathias Schreck) +* Fix: Ignoring empty comments. (fixes #1488) (Greg Cochard) +* New: Add space-unary-ops rules (#1346) (Marcin Kumorek) +* Update: Remove shebang workaround in spaced-line-comment (fixes #1433) (Michael Ficarra) +* Docs: change 'and' to 'an' in docs/rules/valid-jsdoc.md (fixes #1441) (Michael Ficarra) +* Update: Add `beforeAll` and `afterAll` to the Jasmine globals (fixes #1478) (Gyandeep Singh) +* Update: Add exception options to space-in-parens (fixes #1368) (David Clark) +* Build: Add check for license issues (fixes #782) (Brandon Mills) +* Docs: update badges (Yoshua Wuyts) +* Docs: Update pages to fix rendering of lists and fenced code blocks (David Anson) +* Fix: env rules merging for command line config (fixes #1271) (Roberto Vidal) +* Fix: Collect variables declare in switch-case.(fixes #1453) (chris) +* Fix: remove extra capture group (Nate-Wilkins) +* Update: allow distinct alignment groups in key-spacing (fixes #1439) (Brandon Mills) +* Fix: message for numeric property names in quote-props (fixes #1459) (Brandon Mills) +* Docs: Remove assumption about the rule config (Alexander Schmidt) +* New: Add ability to time individual rules (fixes #1437) (Brandon Mills) +* Fix: single quotes (Nate-Wilkins) +* Docs: Fix broken code fences in key-spacing docs (Brandon Mills) +* Docs: Explain .eslintignore features (fixes #1094) (Brandon Mills) +* Breaking: ignore node_modules by default (fixes #1163) (Brandon Mills) +* Fix: Adds clamping to getSource beforeCount (fixes #1427) (Greg Gianforcaro) +* New: add no-inline-comment rule (fixes #1366) (Greg Cochard) +* Fix: '.md' to '.html' with anchors (fixes #1415) (Nate-Wilkins) +* Build: Filter and sort versions in gensite (fixes #1430) (Brandon Mills) +* Build: Escape period in regex (fixes #1428) (Brandon Mills) +* Revert "Fix: '.md' to '.html' with anchors (fixes #1415)" (Nicholas C. Zakas) +* 0.9.2 (Nicholas C. Zakas) +* New: Add operator-assignment rule (fixes #1420) (Brandon Mills) + +v0.9.2 - November 1, 2014 + +* 0.9.2 (Nicholas C. Zakas) +* Fix: '.md' to '.html' with anchors (fixes #1415) (Nate-Wilkins) +* Fix: Allow line breaks in key-spacing rule (fixes #1407) (Brandon Mills) +* Build: add coveralls integration (fixes #1411) (Mathias Schreck) +* Fix: add severity flag for ignored file warning (fixes #1401) (Mathias Schreck) +* Fix: Keep sinon at ~1.10.3 (fixes #1406) (Brandon Mills) +* Fix: ! negates .eslintignore patterns (fixes #1093) (Brandon Mills) +* Fix: let fs.stat throw if a file does not exist (fixes #1296) (Mathias Schreck) +* Fix: check switch statements in space-before-blocks (fixes #1397) (Mathias Schreck) +* Docs: fix rule name in example configuration (Mathias Schreck) +* Fix: disable colors during test run (fixes #1395) (Mathias Schreck) +* New: add isPathIgnored method to CLIEngine (fixes #1392) (Mathias Schreck) +* Docs: changing eslint to ESLint and add missing backtick (Mathias Schreck) +* Docs: Documents the functionality to load a custom formatter from a file (Adam Baldwin) +* 0.9.1 (Nicholas C. Zakas) +* Update: Option type for mixed tabs and spaces (fixes #1374) (Max Nordlund) +* Fix: Nested occurrences of no-else-return now show multiple reports (fixes #1369) (Jordan Hawker) + +v0.9.1 - October 25, 2014 + +* 0.9.1 (Nicholas C. Zakas) +* Docs: fix link on governance model (azu) +* Fix: plugins without rulesConfig causes crash (fixes #1388) (Mathias Schreck) +* 0.9.0 (Nicholas C. Zakas) + +v0.9.0 - October 24, 2014 + +* 0.9.0 (Nicholas C. Zakas) +* New: Allow reading from STDIN (fixes #368) (Nicholas C. Zakas) +* New: add --quiet option (fixes #905) (Mathias Schreck) +* Update: Add support for plugin default configuration (fixes #1358) (Ilya Volodin) +* Fix: Make sure shebang comment node is removed (fixes #1352) (Nicholas C. Zakas) +* New: Adding in rule for irregular whitespace checking. (fixes #1024) (Jonathan Kingston) +* Fix: space-in-parens should not throw for multiline statements (fixes #1351) (Jary) +* Docs: Explain global vs. local plugins (fixes #1238) (Nicholas C. Zakas) +* Docs: Add docs on Node.js API (fixes #1247) (Nicholas C. Zakas) +* Docs: Add recommended keywords for plugins (fixes #1248) (Nicholas C. Zakas) +* Update: Add CLIEngine#getConfigForFile (fixes #1309) (Nicholas C. Zakas) +* Update: turn on comma-style for project (fixes #1316) (Nicholas C. Zakas) +* Fix: Ensure messages are sorted by line (fixes #1343) (Nicholas C. Zakas) +* Update: Added arraysInObjects and objectsInObjects options to space-in-brackets rule (fixes #1265, fixes #1302) (vegetableman) +* Breaking: Removed comma spacing check from space-infix-ops (fixes #1361) (vegetableman) +* Fix: addressed linting errors (Nicholas C. Zakas) +* Docs: Add Contributor Model (fixes #1341) (Nicholas C. Zakas) +* Docs: Add reference to CLA (Nicholas C. Zakas) +* Build: add version numbers to docs (fixes #1170) (Mathias Schreck) +* Fix: no-fallthrough incorrectly flagged falls through annotations (fixes #1353) (Mathias Schreck) +* Build: separate site publishing form generation (fixes #1356) (Mathias Schreck) +* New: Add key-spacing rule (fixes #1280) (Brandon Mills) +* New: add spaced-line-comment rule (fixes #1345) (Greg Cochard) +* Docs: added more Related Rules sections (fixes #1347) (Delapouite) +* Fix: resolve linting issue in (fixes #1339) (Nicholas C. Zakas) +* New: add space-before-blocks rule (fixes #1277) (Mathias Schreck) +* Docs: Remove moot integration plugins (Sindre Sorhus) +* New: add rule for multiple empty lines (fixes #1254) (Greg Cochard) +* Fix: no-shadow rule should consider function expressions (fixes #1322) (Mathias Schreck) +* Update: remove globals present only in Jasmine plugins (fixes #1326) (Michał Gołębiowski) +* New: added no-multi-spaces rule (fixes #630) (vegetableman) +* New: Added comma-spacing rule (Fixes #628, Fixes #1319) (vegetableman) +* New: add rule for padded blocks (fixes #1278) (Mathias Schreck) +* Docs: fix eqeqeq isNullCheck comment (Denis Sokolov) +* Fix: no-comma-dangle violation in unit test and Makefile.js/lint not checking return codes (fixes #1306) (David Anson) +* Fix: allow comma-last with object properties having line breaks (fixes #1314) (vegetableman) +* New: Added comma-style rule (fixes #1282) (vegetableman) +* Update: add space after function keyword check (fixes #1276) (Mathias Schreck) +* Update: Add missing environments and fix sorting/grouping of rules (fixes #1307, fixes #1308) (David Anson) +* Docs: Fix sorting of rules within each section (David Anson) +* Docs: Correct a few misspelled words (David Anson) +* Docs: Update multiple pages to fix rendering of fenced code blocks (David Anson) +* New: Added no-process-env rule (fixes #657) (vegetableman) +* Fix: add rule ensuring #1258 is fixed by recent rewrite (fixes #1258) (Michael Ficarra) +* Update: split propertyName from singleValue in space-in-brackets (fixes #1253) (Michael Ficarra) +* Update: add "as-needed" option to quote-props rule (fixes #1279) (Michael Ficarra) +* Docs: fixed broken link and changed warning level to error level (vegetableman) +* Docs: Added "the native web" to the list of companies that use ESLint. (Golo Roden) +* Docs: Add BountySource badge to README (Nicholas C. Zakas) +* 0.8.2 (Nicholas C. Zakas) + +v0.8.2 - September 20, 2014 + +* 0.8.2 (Nicholas C. Zakas) +* Docs: Updated contribution guidelines to add accepted/bounty issues descriptions (Nicholas C. Zakas) +* Docs: Update README with links and FAQs (Nicholas C. Zakas) +* Docs: add finally to space-after-keywords documentation (Mathias Schreck) +* New: add ignoreCase option to sort-vars (fixes #1272) (Mathias Schreck) +* Docs: fix typo (Barry Handelman) +* Docs: Fix broken Markdown on configuration page (Nicholas C. Zakas) +* Docs: Fix reference to wrong rule name (Harry Wolff) +* Upgrade: Most dev dependencies (Nicholas C. Zakas) +* Upgrade: shelljs to 0.3.0 (Nicholas C. Zakas) +* Upgrade: doctrine to 0.5.2 (Nicholas C. Zakas) +* Upgrade: esprima to 1.2.2 (Nicholas C. Zakas) +* Upgrade: eslint-tester to latest (Nicholas C. Zakas) +* Fix: Load .eslintrc in directory with $HOME as an ancestor (fixes #1266) (Beau Gunderson) +* Fix: load .eslintrc from HOME (fixes #1262) (Beau Gunderson) +* New: Add sharable rule settings (fixes #1233) (Ilya Volodin) +* Upgrade: upgrade outdated dependencies (fixes #1251) (Mathias Schreck) +* Docs: fix typo in no-ex-assign documentation (Michael Ficarra) +* Docs: add intellij plugin to integrations (ido) +* Docs: Changing NPM to npm (Peter deHaan) +* Fix: strict should check function expressions (fixes #1244) (Brandon Mills) +* Docs: fix vars-on-top documentation (fixes #1234) (Mathias Schreck) +* 0.8.1 (Nicholas C. Zakas) +* Docs: Fixed a typo in brace-style.md (Anton Antonov) + +v0.8.1 - September 9, 2014 + +* 0.8.1 (Nicholas C. Zakas) +* Fix: Ensure exit code is 1 when there's a syntax error (fixes #1239) (Nicholas C. Zakas) +* Docs: fix up vars-on-top documentation (fixes #1234) (Michael Ficarra) +* Fix: vars-on-top directive support (fixes #1235) (Michael Ficarra) +* Fix: Avoid mutating node.range in max-len (fixes #1224) (Brandon Mills) +* Docs: Typo, add missing quotation mark (Ádám Lippai) +* Update: space-in-brackets to allow exceptions (fixes #1142) (Brandyn Bennett) +* 0.8.0 (Nicholas C. Zakas) + +v0.8.0 - September 5, 2014 + +* 0.8.0 (Nicholas C. Zakas) +* Perf-related revert "Fix: Speed up tokens API (refs #1212)" (Nicholas C. Zakas) +* Fix: no-fallthrough: continue affects control flow, too (fixes #1220) (Michael Ficarra) +* Fix: rewrite no-unused-vars rule (refs #1212) (Michael Ficarra) +* Fix: Error when there's a \r in .eslintrc (#1172) (Gyandeep Singh) +* Added rule disallowing reserved words being used as keys (fixes #1144) (Emil Bay) +* Fix: rewrite no-spaced-func rule (refs #1212) (Michael Ficarra) +* Fix: Speed up getScope() (refs #1212) (Brandon Mills) +* Fix: no-extra-strict behavior for named function expressions (fixes #1209) (Mathias Schreck) +* Add Date.UTC to allowed capitalized functions (David Brockman Smoliansky) +* New: Adding 'vars-on-top' rule (fixes #1148) (Gyandeep Singh) +* Fix: Speed up tokens API (refs #1212) (Brandon Mills) +* Docs: document plugin usage (fixes #1117) (Mathias Schreck) +* New: accept plugins from cli (fixes #1113) (Mathias Schreck) +* Docs: fix some typos. (Mathias Schreck) +* New: Load plugins from configs (fixes #1115). (Mathias Schreck) +* Fix: no-unused-expressions better directive detection (fixes #1195) (Michael Ficarra) +* Fix: no-unused-expressions directive support (fixes #1185) (Michael Ficarra) +* Update: Add 'allowSingleLine' option to brace-style (fixes #1089) (John Gozde) +* Docs: Spell checking and one extra closing curly in code example (Juga Paazmaya) +* Fix: mergeConfigs ensures the plugins property exists (fixes #1191). (Mathias Schreck) +* Update: Declare ES6 collections (Map, Set, WeakMap, WeakSet) as built-in globals (fixes #1189) (Michał Gołębiowski) +* New: Adding 'plugin' CLI option (fixes #1112) (Greg) +* Fix: Correct a typo in the error message in tests (Michał Gołębiowski) +* New: Add no-extra-bind rule to flag unnecessary bind calls (fixes #982) (Bence Dányi) +* Fix: Useless bind call in cli-engine (fixes #1181) (Bence Dányi) +* Docs: Updates `amd` description (fixes #1175) (James Whitney) +* New: Adds support for the `jasmine` env (fixes #1176) (James Whitney) +* Fix: for-in support to no-empty-label rule (fixes #1161) (Marc Harter) +* docs: Update link (Mathias Bynens) +* Fix: crash when loading empty eslintrc file (fixes #1164) (Michael Ficarra) +* Fix: no-unused-var should respect compound assignments (fixes #1166) (Michael Ficarra) +* Update: ES3 `ReservedWord`s (fixes #1151) Adds ES3 `ReservedWord`s to the list of keywords in the `dot-notation` rule (fixes #1151) (Emil Bay) +* Update: Update comment parser to read rule slashes (fixes #1116) (Jary) +* New: add no-void rule (fixes #1017). (Mike Sidorov) +* New: Add rules.import() (fixes #1114) (Mathias Schreck) +* New: Make mergeConfigs() merge plugin entries (fixes #1111) (Mathias Schreck) +* Breaking: Change no-global-strict to global-strict and add "always" option (fixes #989) (Brandon Mills) +* Fix: no-unreachable should check top-level statements (fixes #1138) (Brandon Mills) +* Fix: Speed up no-unreachable (fixes #1135) (Brandon Mills) +* New: advanced handle-callback-err configuration (fixes #1124) (Mathias Schreck) +* New: Expose CLIEngine (fixes #1083) (Gyandeep Singh) +* Docs: Add link to new Atom linter (fixes #1125) (Gil Pedersen) +* Fix: space-after-keywords checks finally of TryStatement (fixes #1122) (Michael Ficarra) +* Fix: space-after-keywords checks while of DoWhileStatement (fixes #1120) (Michael Ficarra) +* Fix: space-after-keywords w/ "never" should allow else-if (fixes #1118) (Michael Ficarra) +* Fix: dot-notation rule flags non-keyword reserved words (fixes #1102) (Michael Ficarra) +* Update: Use xml-escape instead of inline helper (Ref #848) (jrajav) +* Update: Added comments support to .eslintignore (fixes #1084) (Vitaly Puzrin) +* Update: enabled 'no-trailing-spaces' rule by default (fixes #1051) (Vitaly Puzrin) +* Breaking: Ignore children of all patterns by adding "/**" (Fixes #1069) (jrajav) +* Fix: skip dot files and ignored dirs on traverse (fixes #1077, related to #814) (Vitaly Puzrin) +* Docs: Added Gruntjs plugin on integrations page (Gyandeep Singh) +* Fix: don't break node offsets if hasbang present (fixes #1078) (Vitaly Puzrin) +* Build: Exclude readme/index from rules Resources generation (Fixes #1072) (jrajav) +* Docs: Change eol-last examples to `

` (Fixes #1068) (jrajav)
+* 0.7.4 (Nicholas C. Zakas)
+* New: space-in-parens rule (Closes #627) (jrajav)
+
+v0.7.4 - July 10, 2014
+
+* 0.7.4 (Nicholas C. Zakas)
+* Docs: Fix 'lintinging' typo and ref links (Tom Vincent)
+* Fix: Transform envs option to object in Config (Fixes #1064) (jrajav)
+* 0.7.3 (Nicholas C. Zakas)
+
+v0.7.3 - July 9, 2014
+
+* 0.7.3 (Nicholas C. Zakas)
+* Update: Address code review comment for strict rule (refs #1011) (Nicholas C. Zakas)
+* Docs: Update copyright policy (Nicholas C. Zakas)
+* Docs: Update documentation for max-len to include description of second option (fixes #1006) (Nicholas C. Zakas)
+* Fix: Avoid double warnings for strict rule (fixes #1011) (Nicholas C. Zakas)
+* Fix: Check envs for true/false (Fixes #1059) (jrajav)
+* 0.7.2 (Nicholas C. Zakas)
+
+v0.7.2 - July 8, 2014
+
+* 0.7.2 (Nicholas C. Zakas)
+* Fix: no-mixed-spaces-and-tabs incorrectly flagging multiline comments (fixes #1055) (Nicholas C. Zakas)
+* Fix: new-cap error that throws on non-string member (fixes #1056) (Nicholas C. Zakas)
+* Fix: Always make globals an object (Fixes #1049) (jrajav)
+* 0.7.1 (Nicholas C. Zakas)
+
+v0.7.1 - July 7, 2014
+
+* 0.7.1 (Nicholas C. Zakas)
+* Docs: Add Related Rules sections (Fixes #990) (jrajav)
+* Fix: Check output file isn't dir, fix tests (Fixes #1034) (jrajav)
+* Docs: Updated documentation for several rules (Nicholas C. Zakas)
+* Docs: Updated contributor guide and dev env setup guide (Nicholas C. Zakas)
+* Breaking: Implement configuration hierarchy (fixes #963) (Nicholas C. Zakas)
+* Update: greatly simplify eqeqeq's operator finding logic (fixes #1037) (Michael Ficarra)
+* New: Add getSourceLines() to core and rule context (fixed #1005) (Jary)
+* Build + Docs: Adding generated resource links to rule docs (Fixes #1021) (jrajav)
+* Fix: Ignore unused params for args: 'none' (Fixes #1026) (jrajav)
+* Fix: Point eqeqeq error at operator (Fixes #1029) (jrajav)
+* New: report output to a file (fixes #1027) (Gyandeep Singh)
+* Breaking: CLIEngine abstraction for CLI operations; formatters no longer are passed configs (fixes #935) (Nicholas C. Zakas)
+* Fix: Allow stdout to drain before exiting (fixes #317) (Nicholas C. Zakas)
+* New: add no-undefined rule (fixes #1020) (Michael Ficarra)
+* New: Added no-mixed-spaces-and-tabs rule (fixes #1003) (Jary)
+* New: Added no-trailing-spaces rule (fixes #995) (Vitaly Puzrin)
+* Update: Factor ignores out of Config (fixes #958) (jrajav)
+* Fix: rewrite eol-last rule (fixes #1007) (fixes #1008) (Michael Ficarra)
+* Fix: add additional IIFE exception in no-extra-parens (fixes #1004) (Michael Ficarra)
+* Docs: Removed reference to brace-style Stroustrup default (fixes #1000) (Caleb Troughton)
+* New: Added eol-last rule (Fixes #996) (Vitaly Puzrin)
+* Fix: Put rule severity in messages (Fixes #984); deprecates passing full config to Formatters (jrajav)
+* Fix: no-unused-vars to check only file globals (fixes #975) (Aliaksei Shytkin)
+* Build: Makefile - Check for rule ids in docs titles (Fixes #969) (Delapouite)
+* Docs: guard-for-in - added missing id in title (Fixes #969) (Delapouite)
+* Breaking: Change 'no-yoda' rule to 'yoda' and add "always" option (Fixes #959) (jrajav)
+* Fix: Fixes no-unused-vars to check /*globals*/ (Fixes #955) (jrajav)
+* Update: no-eval to also warn on setTimeout and setInterval (fixes #721) (Nicholas C. Zakas)
+* Remove: experimental match() method (Nicholas C. Zakas)
+* Update: space-in-brackets now always allows empty object and array literals to have no spaces (fixes #797) (Nicholas C. Zakas)
+* New: Allow the cli parameter "color" and "no-color" (fixes #954) (Tom Gallacher)
+* Fix: valid-jsdoc no more warning for multi-level params (Fixes #925) (Delapouite)
+* Update: Search parent directories for .eslintignore (Fixes #933) (jrajav)
+* Fix: Correct order of arguments passed to assert.equal (fixes #945) (Michał Gołębiowski)
+* Update: Write the summary in stylish formatter in yellow if no errors (fixes #906); test coloring of messages (Michał Gołębiowski)
+* Fix: Corrects configs merging into base config (Fixes #838) (jrajav)
+* Fix: Adding check if char is non-alphabetic to new-cap (Fixes #940) (jrajav)
+* Docs: Update about page description (fixes #936) (Nicholas C. Zakas)
+* Docs: Add '/', forgotten in first commit (Fixes #931) (jrajav)
+* Update: Rule `new-cap` checks capitalized functions (fixes #904) (Aliaksei Shytkin)
+* Docs: Mention allowed semicolons in "never" mode for 'semi' rule (fixes #931) (jrajav)
+* Docs: Mention Yeoman generator in dev setup (fixes #914) (Nicholas C. Zakas)
+* Build: Remove flaky perf test from Travis (Nicholas C. Zakas)
+* Breaking: Refactor .eslintignore functionality (refs #928, fixes #901, fixes #837, fixes #853) (Nicholas C. Zakas)
+* 0.6.2 (Nicholas C. Zakas)
+* Breaking: Remove JSON support for .eslintignore (fixes #883) (icebox)
+
+v0.6.2 - May 23, 2014
+
+* 0.6.2 (Nicholas C. Zakas)
+* Fix: Adding per-environment rule configs to docs and doc validation (Fixes #918) (jrajav)
+* Docs: Updated contribution guidelines (Nicholas C. Zakas)
+* Docs: Update description of eqeqeq to mention special cases (fixes #924) (Nicholas C. Zakas)
+* Fix: block-scoped-var CatchClause handling (fixes #922) (Michael Ficarra)
+* Fix: block-scoped-var respects decls in for and for-in (fixes #919) (Michael Ficarra)
+* Update: Implement eqeqeq option "allow-null" (fixes #910) (Michał Gołębiowski)
+* Fix: new-cap should allow non-alpha characters (fixes #897) (Michael Ficarra)
+* Update: Refactor ESLintTester to fix dependency hell (fixes #602) (Nicholas C. Zakas)
+* Fix: Merge configs with ancestors (Fixes #820) (jrajav)
+* Fix: no-fallthrough should respect block statements in case statements (fixes #893) (Nicholas C. Zakas)
+* Docs: Fix layout issue in configuration docs (fixes #889) (Nicholas C. Zakas)
+* Build: Enable default-case rule (fixes #881) (icebox)
+* Build: Enable space-after-keywords (fixes #884) (icebox)
+* Fix api double emit on comment nodes (fixes #876) (Aliaksei Shytkin)
+* 0.6.1 (Nicholas C. Zakas)
+
+v0.6.1 - May 17, 2014
+
+* 0.6.1 (Nicholas C. Zakas)
+* Upgrade: Optionator to 0.4.0 (fixes #885) (Nicholas C. Zakas)
+* 0.6.0 (Nicholas C. Zakas)
+
+v0.6.0 - May 17, 2014
+
+* 0.6.0 (Nicholas C. Zakas)
+* Fix: Remove -r alias for --rule (fixes #882) (Nicholas C. Zakas)
+* Docs: Update dev setup, contributing, default-case descriptions (Nicholas C. Zakas)
+* Update: valid-jsdoc now allows you to optionally turn off parameter description checks (fixes #822) (Nicholas C. Zakas)
+* Breaking: brace-style now disallows block statements where curlies are on the same line (fixes #758) (Nicholas C. Zakas)
+* Add linting Makefile.js (fixes #870) (icebox)
+* add rule flag, closes #692 (George Zahariev)
+* Add check between rules doc and index (fixes #865) (icebox)
+* Add Build Next mention in integrations README. (icebox)
+* document new IIFE exception for no-extra parens added as part of #655 (Michael Ficarra)
+* (fixes #622) Add rule ID on documentation pages (Delapouite)
+* fixes #655: add IIFE exception to no-extra-parens (Michael Ficarra)
+* add new rule "no-new-require" (Wil Moore III)
+* exit with non-zero status when tests fail (fixes #858) (Márton Salomváry)
+* removed unicode zero width space character from messages (fixes #857) (Márton Salomváry)
+* Change: --rulesdir now can be specified multiple times (fixes #830) (Nicholas C. Zakas)
+* Update: Node 0.8 no longer supported (fixes #734) (Nicholas C. Zakas)
+* Update: Add typed arrays into builtin environment globals (fixes #846) (Nicholas C. Zakas)
+* Fix: Add prototype methods to global scope (fixes #700) (Nicholas C. Zakas)
+* Rule: no-restricted-modules (fixes #791) (Christian)
+* Upgrade: Esprima to 1.2 (fixes #842) (Nicholas C. Zakas)
+* Docs: reporting level 2 is an error (fixes #843) (Brandon Mills)
+* Upgrade: Esprima to 1.2, switch to using Esprima comment attachment (fixes #730) (Nicholas C. Zakas)
+* Fix: Semi rule incorrectly flagging extra semicolon (fixes #840) (Nicholas C. Zakas)
+* Build: Update Travis to only test Node 0.10 (refs #734) (Nicholas C. Zakas)
+* Add "nofunc" option (fixes #829) (Conrad Zimmerman)
+* Rule: no-inner-declarations (fixes #587) (Brandon Mills)
+* Rule 'block-scoped-var': correct scope for functions, arguments (fixes #832) (Aliaksei Shytkin)
+* Rule: default-case (fixes #787) (Aliaksei Shytkin)
+* Ignored files are excluded unless --force is passed on the CLI (Nick Fisher)
+* Fixes a typo and a broken link in the documentation (Nick Fisher)
+* Replaces .some() with .indexOf() where appropriate (Nick Fisher)
+* Fix correct config merge for array values (fixes #819) (Aliaksei Shytkin)
+* Remove warning about ESLint being in Alpha (Nick Fisher)
+* Adds `space-after-keywords` rule (fixes #807) (Nick Fisher)
+* Rule: no-lonely-if (fixes #790) (Brandon Mills)
+* Add ignore comments in file (fixes #305) (Aliaksei Shytkin)
+* 0.5.1 (Nicholas C. Zakas)
+* Change: no-unused-vars default to 'all' (fixes #760) (Nicholas C. Zakas)
+
+v0.5.1 - April 17, 2014
+
+* 0.5.1 (Nicholas C. Zakas)
+* Fix general config not to be modified by comment config in files (fixes #806) (Aliaksei Shytkin)
+* SVG badges (Ryuichi Okumura)
+* fixes #804: clean up implementation of #803 (which fixed #781) (Michael Ficarra)
+* Build: Fix perf test to take median of three runs (fixes #781) (Nicholas C. Zakas)
+* Fix: --reset will now properly ignore default rules in environments.json (fixes #800) (Nicholas C. Zakas)
+* Docs: Updated contributor guidelines (Nicholas C. Zakas)
+* Added Mocha global variables for TDD style. Fixes #793. (Golo Roden)
+* Rule: no-sequences (fixes #561) (Brandon Mills)
+* Change .eslintignore to plain text (fixes #761) (Brandon Mills)
+* Change 'no-spaced-func' message (fixes #762) (Aliaksei Shytkin)
+* Rule 'block-scoped-var' works correct when object inits (fixes #783) (Aliaksei Shytkin)
+* Build: Always build docs site on top of origin/master (Nicholas C. Zakas)
+* 0.5.0 (Nicholas C. Zakas)
+
+v0.5.0 - April 10, 2014
+
+* 0.5.0 (Nicholas C. Zakas)
+* Build: Bump perf limit so Travis won't fail every time (fixes #780) (Nicholas C. Zakas)
+* Add tests to cover 100% of eslint.js (Aliaksei Shytkin)
+* Fix: Make sure no-path-concat doesn't flag non-concat operations (fixes #776) (Nicholas C. Zakas)
+* Rule 'no-unused-var' in functional expression with identifier (fixes #775) (Aliaksei Shytkin)
+* Rule: valid-typeof (Ian Christian Myers)
+* Add global cli flag (ref #692) (Brandon Mills)
+* update to latest Optionator (George Zahariev)
+* Add options for rule 'no-unused-vars' to check all arguments in functions (fixes #728) (Aliaksei Shytkin)
+* Fix: Cleanup package.json (Nicholas C. Zakas)
+* New: Experimental support for CSS Auron (fixes #765) (Nicholas C. Zakas)
+* Lint tests on build (fixes #764) (Aliaksei Shytkin)
+* Rule block-scoped-var works correct with object properties (fixes #755) (Aliaksei Shytkin)
+* Breaking: implement eslint-env and remove jshint/jslint environment comment support (fixes #759) (Aliaksei Shytkin)
+* readme: npm i -> npm install (Linus Unnebäck)
+* Add env flag to cli options summary (fixes #752) (Brandon Mills)
+* Fix: Give the perf test a better calculated budget (fixes #749) (Nicholas C. Zakas)
+* give the `env` flag type `[String]`, improve code (fixes #748) (George Zahariev)
+* fixes #735: add new, more efficient getTokens interfaces (Michael Ficarra)
+* Add --env cli flag (ref #692) (Brandon Mills)
+* Fixes #740 - Make sure callbacks exist before marking them as 'handled'. (mstuart)
+* fixes #743: wrap-regex rule warns on regex used in dynamic member access (Michael Ficarra)
+* replace tab indents with 4 spaces in lib/rules/handle-callback-err.js (Michael Ficarra)
+* Adding homepage and bugs links to package.json (Peter deHaan)
+* JSDoc for rules (Anton Rudeshko)
+* 0.4.5 (Nicholas C. Zakas)
+
+v0.4.5 - March 29, 2014
+
+* 0.4.5 (Nicholas C. Zakas)
+* Build: Add perf check into Travis build to better monitor performance regressions (fixes #732) (Nicholas C. Zakas)
+* Fix: Make sure semi reports correct location of missing semicolon (fixes #726) (Nicholas C. Zakas)
+* Add --no-eslintrc cli flag (ref #717) (Brandon Mills)
+* Fix #716 crash with reset flag (Brandon Mills)
+* Fixed JSON formatting and highlighting (Anton Rudeshko (Tesla))
+* fixes #723: block-scoped-var throws on unnamed function expression (Michael Ficarra)
+* Fix: Make stroustrup brace-style closing message make sense (fixes #719) (Nicholas C. Zakas)
+* no-comma-dangle reports correct line number (Andrey Popp)
+* Upgrade: Esprima to 1.1.1 and EScope to 1.0.1 (fixes #718) (Nicholas C. Zakas)
+* Add reset cli flag (refs #692) (Brandon Mills)
+* Relax eqeqeq null check (fixes #669) (Brandon Mills)
+* 0.4.4 (Nicholas C. Zakas)
+* New Rule: handle-callback-err (fixes #567) (Jamund Ferguson)
+
+v0.4.4 - March 25, 2014
+
+* 0.4.4 (Nicholas C. Zakas)
+* Fix no-used-vars to report FunctionExpression params (fixes #697). (Andrey Popp)
+* fixes #711: eslint reports wrong line number for files with shebang (Michael Ficarra)
+* Fix for no-unused-vars and MemberExpression (Andrey Popp)
+* added no-warning-comments rule (Alexander Schmidt)
+* fixes #699: brace-style does not check function expressions (Michael Ficarra)
+* rewrite block-scoped-var (Michael Ficarra)
+* recommend using hasOwnProperty from Object.prototype in guard-for-in docs (Michael Ficarra)
+* change conf/environments.json spacing to be simpler and more consistent (Michael Ficarra)
+* Update API to use context.getFilename() instead of .filename. (Loren Segal)
+* Small changes, JSDoc is clarified (Aliaksei Shytkin)
+* Move FileFinder to separate file (Aliaksei Shytkin)
+* Cache if file is not found (Aliaksei Shytkin)
+* Use cache on config files seach (Aliaksei Shytkin)
+* Added .eslintignore to load from parents folders (fixes #681) (Aliaksei Shytkin)
+* fix 'node-modules' typo in docs (Fred K. Schott)
+* Upgrade to the latest version of doctrine. (Brian Di Palma)
+* Document optional filename and default it to `input`. (Loren Segal)
+* Fix: Compatibility for Node 0.8 (Nicholas C. Zakas)
+* Update: Makefile.js now uses shelljs-nodecli (Nicholas C. Zakas)
+* #681 apply all .eslintignore exclusions (Aliaksei Shytkin)
+* Add RuleContext.filename property (for eslint/eslint#468). (Loren Segal)
+* 0.4.3 (Nicholas C. Zakas)
+
+v0.4.3 - March 18, 2014
+
+* 0.4.3 (Nicholas C. Zakas)
+* fixes #682: rewrite no-constant-condition rule (Michael Ficarra)
+* Fixes #673 allow configuration of @return errors via requireReturn - (fixes #673) (Brian Di Palma)
+* Tweaking inline code formatting for "if, while, dowhile" (Peter deHaan)
+* Fixes #677 getJSDocComment() should not search beyond FunctionExpression or FunctionDeclaration parent nodes. (Brian Di Palma)
+* Relaxed enforcement of camelcase rule (Ian Christian Myers)
+* Fixing issue #675. Incorrect triggering of no-else-return rule. (Brian Di Palma)
+* Added style option for wrap-iife (Mathias Schreck)
+* Fix: Issues with named function expressions in no-unused-vars and no-shadow (fixes #662) (Nicholas C. Zakas)
+* Update: camelcase rule now doesn't flag function calls (fixes #656) (Nicholas C. Zakas)
+* Updating documentation description for: no-space-before-semi rule, changing rules to exempt strings with semicolons and test for that condition. Fixes #629. (Jonathan Kingston)
+* Adding in rule no-space-before-semi to prevent spaces before semicolons. fixes #629 (Jonathan Kingston)
+* show NPM version (Paul Verest)
+* adapt code formatting (Mathias Schreck)
+* Added a TextMate 2 integration to the docs (Nate Silva)
+* 0.4.2 (Nicholas C. Zakas)
+
+v0.4.2 - March 3, 2014
+
+* 0.4.2 (Nicholas C. Zakas)
+* fixes #651: disable no-catch-shadow rule in node environment (Michael Ficarra)
+* Fixed context.report message parsing (Ian Christian Myers)
+* fixe #648: wrap-iife rule should actually check that IIFEs are wrapped (Michael Ficarra)
+* Added "stroustrup" option for brace-style (Ian Christian Myers)
+* 0.4.1 (Nicholas C. Zakas)
+
+v0.4.1 - February 27, 2014
+
+* 0.4.1 (Nicholas C. Zakas)
+* Created space-in-brackets rule (Ian Christian Myers)
+* Update: Allow valid-jsdoc to specify replacement tags (fixes #637) (Nicholas C. Zakas)
+* Fix: Ensure getJSDocComment() works for all function declarations (fixes #638) (Nicholas C. Zakas)
+* Added broccoli-eslint to integration docs (Christian)
+* fixes #634: getters/setters shouldn't trigger no-dupe-keys (Michael Ficarra)
+* Update: semi to also enforce not using semicolons (fixes #618) (Nicholas C. Zakas)
+* New Rule: no-constant-condition  - removed SwitchStatement discriminant check  - removed AssignmentExpression with right Identifier  - fixed copy paste error  - added DoWhileStatement, ForStatement based on discussion: https://github.com/eslint/eslint/pull/624 (fixes #621) (Christian)
+* New Rule: no-constant-condition (fixes #621) (Christian)
+* Adding mimosa-eslint to Build System list (dbashford)
+* Fix: Make sure semi flags return statements without a semicolon (fixes #616) (Nicholas C. Zakas)
+* Fix: stylish formatter blue text -> white text (fixes #607) (Nicholas C. Zakas)
+* Fix: radix rule should warn (not throw error) when parseInt() is called without arguments (fixes #611) (Nicholas C. Zakas)
+* Update README.md (Dmitry)
+* Adding JSDoc comments for TAP format helper functions (Jonathan Kingston)
+* Updating documentation to include TAP format option (Jonathan Kingston)
+* Fixing validation issues to TAP formatter (Jonathan Kingston)
+* Adding TAP formatter and basic tests (Jonathan Kingston)
+* Docs: Updated integrations page (Nicholas C. Zakas)
+* 0.4.0 (Nicholas C. Zakas)
+
+v0.4.0 - February 12, 2014
+
+* 0.4.0 (Nicholas C. Zakas)
+* Change: Switch :after to :exit (fixes #605) (Nicholas C. Zakas)
+* Fix: Make sure no-unused-vars doesn't get confused by nested functions (fixes #584) (Nicholas C. Zakas)
+* Update: .eslintrc to check more things (Nicholas C. Zakas)
+* Fix: Make sure JSDoc parser accepts JSDoc3-style optional parameters (Nicholas C. Zakas)
+* Docs: Update documentation with linking instructions for ESLintTester (Nicholas C. Zakas)
+* New Rule: valid-jsdoc (fixes #536) (Nicholas C. Zakas)
+* #595 improved func-names documentation (Kyle Nunery)
+* #595 added more func-names tests (Kyle Nunery)
+* #595 fix rule message and add more tests (Kyle Nunery)
+* use optionator for option parsing, not optimist (George Zahariev)
+* Include instructions for working with ESLintTester (Nicholas C. Zakas)
+* #595 remove needless 'function Foo() {}' in tests (Kyle Nunery)
+* #595 fix whitespace (Kyle Nunery)
+* #595 fix markdown for js code blocks (Kyle Nunery)
+* Adding information about Yeomen generator (Ilya Volodin)
+* #595 add docs for rule func-names (Kyle Nunery)
+* #595 add func-names rule (Kyle Nunery)
+* migrate variables array to map (Brandon Mills)
+* Perf: Move try-catch out of verify() function to allow V8 optimization (refs #574) (Nicholas C. Zakas)
+* Docs: Added instructions for running npm run profile (Nicholas C. Zakas)
+* refactor variable name lookup into a separate function (Brandon Mills)
+* optimize findVariable() in no-unused-vars (Brandon Mills)
+* move to tests/bench (Chris Dickinson)
+* add `npm run profile`. (Chris Dickinson)
+* #586 refactor based on https://github.com/eslint/eslint/pull/590#discussion_r9476367 (Christian)
+* #586 added no-unreachable jsdoc, documentation note on hoisting case (Christian)
+* #586 add hoisting check to no-unreachable (Christian)
+* readme: Remove stray asterisk (Timo Tijhof)
+* #580 Remove eslint.getAllComments(), related docs, related tests (Christian)
+* Added test for bug fix #582. Test Passes (Shmueli Englard)
+* Added curly braces to if statment (Shmueli Englard)
+* Added new test for fix to #582 (fixes 582) (Shmueli Englard)
+* Bug #582: Added check if node.value isn't a string just exit (Shmueli Englard)
+* Update Rule: implement curly options for single-statement bodies (fixes #511) (Nicholas C. Zakas)
+* New Rule: no-extra-boolean-cast (fixes #557) (Brandon Mills)
+* New Rule: no-sparse-arrays (fixes #499) (Nicholas C. Zakas)
+* Fix: no-spaced-func is now an error (Nicholas C. Zakas)
+* New Rule: no-process-exit (fixes #568) (Nicholas C. Zakas)
+* New Rule: no-labels (fixes #550) (Nicholas C. Zakas)
+* New Rule: no-lone-blocks (fixes #512) (Brandon Mills)
+* Added Emacs/Flycheck integration (Nikolai Prokoschenko)
+* Build: Add perf test (Nicholas C. Zakas)
+* Fix: no-cond-assign shouldn't throw error when there's a for loop with an empty conditional (fixes #53) (Nicholas C. Zakas)
+* Docs: Add docs for no-regex-spaces and all doc errors now break build (closes #562) (Nicholas C. Zakas)
+* Rename: regex-spaces to no-regex-spaces (Nicholas C. Zakas)
+* Docs: Add docs for no-underscore-dangle (refs #562) (Nicholas C. Zakas)
+* Docs: Add docs for no-undef-init (refs #562) (Nicholas C. Zakas)
+* Docs: Add docs for no-return-assign (refs #562) (Nicholas C. Zakas)
+* Fix: Misspelling in no-return-assign message (Nicholas C. Zakas)
+* Docs: Add docs for no-new-wrappers (refs #562) (Nicholas C. Zakas)
+* Docs: Add docs for no-new-object (refs #562) (Nicholas C. Zakas)
+* Docs: Add docs for no-implied-eval (refs #562) (Nicholas C. Zakas)
+* Docs: Updated documentation for developing rules (Nicholas C. Zakas)
+* Testing: Move ESLintTester to be external dependency (fixes #480) (Nicholas C. Zakas)
+* Docs: Add list of known integrations (Nicholas C. Zakas)
+* Fix #570 (dmp42)
+* document no-array-constructor rule (Michael Ficarra)
+* fixes #500: no-array-constructor should not flag 1-argument construction (Michael Ficarra)
+* fixes #501: no-array-constructor recognises CallExpression form (Michael Ficarra)
+* rename no-new-array rule to no-array-constructor; ref #501 (Michael Ficarra)
+* Fix: Make radix rule warn on invalid second parameter (fixes #563) (Nicholas C. Zakas)
+* Docs: Added no-floating-decimal docs (refs #562) (Nicholas C. Zakas)
+* New Rule: no-path-concat (fixes #540) (Nicholas C. Zakas)
+* Docs: Add some missing rule docs (refs #562) (Nicholas C. Zakas)
+* Fix: CLI should not output anything when there are no warnings (fixes #558) (Nicholas C. Zakas)
+* New Rule: no-yoda (fixes #504) (Nicholas C. Zakas)
+* New Rule: consistent-return (fixes #481) (Nicholas C. Zakas)
+* Rewrite configuration documentation to include information about globals (fixes #555) (Nicholas C. Zakas)
+* Allow YAML configuration files (fixes #491) (Nicholas C. Zakas)
+* 0.3.0 (Nicholas C. Zakas)
+
+v0.3.0 - January 20, 2014
+
+* 0.3.0 (Nicholas C. Zakas)
+* Config: Allow comments in JSON configuration files (fixes #492) (Nicholas C. Zakas)
+* Bug: max-len fix to report correct line number (fixes #552) (Nicholas C. Zakas)
+* Build: Use browserify to create browser-ready ESLint (fixes #119) (Nicholas C. Zakas)
+* Docs: Ensure all rules have entry on top-level rules index page (Nicholas C. Zakas)
+* Docs: Add docs for no-fallthrough rule (Nicholas C. Zakas)
+* Update README.md (Peter deHaan)
+* Update README.md (Peter deHaan)
+* Update package.json (Peter deHaan)
+* Docs: Added documentation for semi rule (Nicholas C. Zakas)
+* Build: Reset branch coverage target (Nicholas C. Zakas)
+* Update build system to generate eslint.org during release (Nicholas C. Zakas)
+* Updated setup doc (Nicholas C. Zakas)
+* Fix #525 & #528 (Mangled Deutz)
+* Improve no-negated-in-lhs description (David Bruant)
+* Fixing typo (David Bruant)
+* Update no-new.md (Tamas Fodor)
+* Update no-extra-semi.md (Tamas Fodor)
+* Fixing broken links in documentation (Ilya Volodin)
+* Update about page (Nicholas C. Zakas)
+* Site generation build step and documentation updates to support it (fixes #478) (Nicholas C. Zakas)
+* Change message for brace-style rule (fixes #490) (Nicholas C. Zakas)
+* Add question about ES6 support to FAQ (fixes #530) (Nicholas C. Zakas)
+* Set unlimited number of listeners for event emitter (fixes #524) (Nicholas C. Zakas)
+* Add support for comment events (fixes #531) Add :after events for comments (Nicholas C. Zakas)
+* Add :after events for comments (Nicholas C. Zakas)
+* Allow config files to have any name (fixes #486). (Aparajita Fishman)
+* List available formatters (fixes #533). (Aparajita Fishman)
+* Add support for comment events (fixes #531) (Nicholas C. Zakas)
+* Add Stylish formatter and make it default. Fixes #517 (Sindre Sorhus)
+* Fix missing code exit (Mangled Deutz)
+* Added unit test for calling Config.getConfig with no arguments. (Aparajita Fishman)
+* Typo (Mangled Deutz)
+* Fixed docs typo (Nicholas C. Zakas)
+* Mark functions as used when any method is called on them (Nicholas C. Zakas)
+* Fixed: Config.getConfig is called either with a file path or with no args (fixes #520) (Aparajita Fishman)
+* Fix minor bug in no-empty rule (Nicholas C. Zakas)
+* add more info for failure messages (Nicholas C. Zakas)
+* Add ruleId to all formatters output (fixes #472) (Nicholas C. Zakas)
+* Remove unused code (Nicholas C. Zakas)
+* Correctly handle case with both finally and catch in no-empty (Nicholas C. Zakas)
+* Update documentation for no-unused-vars (Nicholas C. Zakas)
+* Ensure that bound function expressions are reported as being used (fixes #510) (Nicholas C. Zakas)
+* Allow empty catch/finally blocks (fixes #514) and update documentation (fixes #513) (Nicholas C. Zakas)
+* Updated contribution guidelines (Nicholas C. Zakas)
+* Add default setting for no-cond-assign (Nicholas C. Zakas)
+* Add build step to check rule consistency (Nicholas C. Zakas)
+* update docs: explicit cli args are exempt from eslintignore exclusions (Michael Ficarra)
+* fixes #505: no-cond-assign should ignore doubly parenthesised tests (Michael Ficarra)
+* Renamed unnecessary-strict to no-extra-strict (Nicholas C. Zakas)
+* Fixed missing documentation links (Nicholas C. Zakas)
+* Add build task to check for missing docs and tests for rules (Nicholas C. Zakas)
+* Slight reorganization of rule groups (Nicholas C. Zakas)
+* Added one-var and sorted some rules (Nicholas C. Zakas)
+* Updated Travis badge for new location (Nicholas C. Zakas)
+* fixes #494: allow shebangs in processed JS files (Michael Ficarra)
+* fixes #496: lint ignored files when explicitly specified via the CLI (Michael Ficarra)
+* More tests (Ilya Volodin)
+* Upgrade Istanbul (Ilya Volodin)
+* fixes #495: holey arrays cause no-comma-dangle rule to throw (Michael Ficarra)
+* Documentation and minor changes (Ilya Volodin)
+* Adding missing package registration (Ilya Volodin)
+* Adding support for .eslintignore and .jshintignore (Closes #484) (Ilya Volodin)
+* fixes #482: brace-style bug with multiline conditions (Michael Ficarra)
+* Switching Travis to use ESLint (Closes #462) (Ilya Volodin)
+* 0.2.0 (Nicholas C. Zakas)
+
+v0.2.0 - January 1, 2014
+
+* 0.2.0 (Nicholas C. Zakas)
+* Bump code coverage checks (Nicholas C. Zakas)
+* Take care of unreachable code in case statement (Nicholas C. Zakas)
+* Updated rule messaging and added extra tests (Nicholas C. Zakas)
+* Fixing eslint errors and unittests (Ilya Volodin)
+* Rule: max-nested-callbacks (Ian Christian Myers)
+* Fix fall-through rule with nested switch statements (fixes #430) (Nicholas C. Zakas)
+* Fixed trailing comma (Nicholas C. Zakas)
+* Added more tests for func-style (Nicholas C. Zakas)
+* Fixed documentation for func-style (Nicholas C. Zakas)
+* Fixed linting error (Nicholas C. Zakas)
+* Rule to enforce function style (fixes #460) (Nicholas C. Zakas)
+* Rule is off by default. Updated documentation (Ilya Volodin)
+* Rule: sort variables. Closes #457 (Ilya Volodin)
+* Update architecture.md (Nicholas C. Zakas)
+* Change quotes option to avoid-escapes and update docs (fixes #199) (Brandon Payton)
+* Add allow-avoiding-escaped-quotes option to quotes rule (fixes #199) (Brandon Payton)
+* Update no-empty-class.md (Nicholas C. Zakas)
+* Updated titles on all rule documentation (fixes #348) (Nicholas C. Zakas)
+* Fixing eslint errors in codebase (Ilya Volodin)
+* fixes #464: space-infix-ops checks for VariableDeclarator init spacing (Michael Ficarra)
+* Add options to no-unused-vars. Fixes #367 (Ilya Volodin)
+* rename escape function to xmlEscape in checkstyle formatter (Michael Ficarra)
+* The semi rule now reports correct line number (Ian Christian Myers)
+* context.report now takes optional location (Ian Christian Myers)
+* fixes #454: escape values for XML in checkstyle formatter (Michael Ficarra)
+* Add color to Mocha test reporting (Ian Christian Myers)
+* Rule no-nested-ternary (Ian Christian Myers)
+* Fixing no-unused-var and no-redeclare (Ilya Volodin)
+* fixes #449: no-mixed-requires throws TypeError when grouping is enabled (Michael Ficarra)
+* Fixed reported line number for trailing comma error (Ian Christian Myers)
+* Update doc title for quote (Matthew DuVall)
+* fixes #446: join paths without additional delimiters (Michael Ficarra)
+* docs: add documentation for quotes rule (Matthew DuVall)
+* minor style changes to lib/rules/space-infix-ops.js as requested in #444 (Michael Ficarra)
+* remove "function invalid(){ return D }" from some tests (Michael Ficarra)
+* fixes #429: require spaces around infix operators; enabled by default (Michael Ficarra)
+* simplify fix for #442 (Michael Ficarra)
+* Fix broken test, ensure tests get run before a release is pushed (Nicholas C. Zakas)
+* 0.1.4 (Nicholas C. Zakas)
+
+v0.1.4 - December 5, 2013
+
+* 0.1.4 (Nicholas C. Zakas)
+* Add release scripts to package.json (Nicholas C. Zakas)
+* Fixed release error in Makefile (Nicholas C. Zakas)
+* Fix JSHint warnings (Nicholas C. Zakas)
+* Make sure 'default' isn't flagged by no-space-returns-throw rule (fixes #442) (Nicholas C. Zakas)
+* Fixing documentation (Ilya Volodin)
+* Fixing disabling rules with invalid comments Closes #435 (Ilya Volodin)
+* improve assertion on wrong number of errors (Christoph Neuroth)
+* fixes #431: no-unused-expressions should not flag statement level void (Michael Ficarra)
+* fixes #437: fragile no-extend-native rule (Michael Ficarra)
+* change space-* rule documentation headers to be more descriptive (Michael Ficarra)
+* Moved to tabs, added comments, a few more tests (Jamund Ferguson)
+* split GH-332 rule into space-unary-word-ops and space-return-throw-case (Michael Ficarra)
+* fixes #346: validate strings passed to the RegExp constructor (Michael Ficarra)
+* change some documentation extensions from js to md (Michael Ficarra)
+* fixes #332: unary word operators must be followed by whitespace (Michael Ficarra)
+* Add some docs (Jamund Ferguson)
+* DRYing cli tests and improving code coverage (Ilya Volodin)
+* fixes #371: add no-shadow-restricted-names rule (Michael Ficarra)
+* Added Support for Object.defineProperty() checking (Jamund Ferguson)
+* fixes #333: add rule to disallow gratuitously parenthesised expressions (Michael Ficarra)
+* improve rule test coverage (Michael Ficarra)
+* No Extend Native (Jamund Ferguson)
+* change getTokens 2nd/3rd arguments to count tokens, not characters (Michael Ficarra)
+* fixes #416: no-fallthrough flagging last case + reporting wrong line num (Michael Ficarra)
+* fixes #415: fix unnecessary-strict rule false positives (Michael Ficarra)
+* Add missing dependency (Nicholas C. Zakas)
+* Update docs related to running unit tests (Nicholas C. Zakas)
+* Add JSHint as missing dependency (Nicholas C. Zakas)
+* Switch to using ShellJS makefile (fixes #418) (Nicholas C. Zakas)
+* Updated documentation to reflect test changes (refs #417) (Nicholas C. Zakas)
+* Change to eslintTester.addRuleTest (fixes #417) (Nicholas C. Zakas)
+* Fix false positives for no-script-url (fixes #400) (Nicholas C. Zakas)
+* Fix lint warning (Nicholas C. Zakas)
+* Fixing ESLint warnings, introducing Makefile.js (not yet wired in) (Nicholas C. Zakas)
+* fixes #384: include builtin module list to avoid repl dependency (Michael Ficarra)
+* 0.1.3 (Nicholas C. Zakas)
+
+v0.1.3 - November 25, 2013
+
+* 0.1.3 (Nicholas C. Zakas)
+* Updated changelog (Nicholas C. Zakas)
+* Vows is gone. Mocha is now default (Ilya Volodin)
+* fixes #412: remove last remaining false positives in no-spaced-func (Michael Ficarra)
+* fixes #407: no-spaced-func rule flagging non-argument-list spaced parens (Michael Ficarra)
+* Add no-extra-semi to configuration (fixes #386) (Nicholas C. Zakas)
+* Converting formatter tests and core (Ilya Volodin)
+* Don't output anything when there are no errors in compact formatter (fixes #408) (Nicholas C. Zakas)
+* Removing Node 0.11 test - it fails all the time (Nicholas C. Zakas)
+* Completing conversion of rule's tests to mocha (Ilya Volodin)
+* added mocha conversion tests for strict, quote-props and one-var; enhanced one of the invalid one-var tests that was expecting two messages (Michael Paulukonis)
+
+
+v0.1.2 - November 23, 2013
+
+* 0.1.2 (Nicholas C. Zakas)
+* added mocha tests for radix and quotes; fixed some of the internals on quotes from vows annotations (Michael Paulukonis)
+* added tests for regex-spaces, strict, unnecessary-strict; fixed some types in overview/author notes in other tests. (Michael Paulukonis)
+* Converting unittests to mocha (Ilya Volodin)
+* mocha conversions of tests for 'use-isnan' and 'wrap-iife' (Michael Paulukonis)
+* added mocha tests semi.js and wrap-regex.js (Michael Paulukonis)
+* Converting more tests to mocha (Ilya Volodin)
+* Update CONTRIBUTING.md (Nicholas C. Zakas)
+* Cleaning up eslintTester (Ilya Volodin)
+* DRYing unittests and converting them to mocha (Ilya Volodin)
+* Reformatted Gruntfile (Nicholas C. Zakas)
+* Add tests to config load order: base, env, user. (icebox)
+* Fixing indent in gruntfile (Ilya Volodin)
+* Removing jake, adding Grunt, Travis now runs grunt (Ilya Volodin)
+* Add rules per environments to config. (icebox)
+* Add globals property to the environments. (icebox)
+* Fix error about IIFE if the function is in a new (Marsup)
+* Fix a broken link in the docs (Brian J Brennan)
+* Add test coverage for additional cases, fix open paren at beginning of expr (Matthew DuVall)
+* Fixing no-undef for eval use case (Ilya Volodin)
+* fixes #372: disallow negated left operand in `in` operator (Michael Ficarra)
+* Fixing no-self-compare rule to check for operator (Ilya Volodin)
+* bug: open parens in args causes no-spaced-func to trigger (Matthew DuVall)
+* fixes #369: restrict UnaryExpressions to delete in no-unused-expressions (Michael Ficarra)
+* Make sure delete operator isn't flagged as unused expression (fixes #364) (Nicholas C. Zakas)
+* Don't flag ++ or -- as unused expressions (fixes #366) (Nicholas C. Zakas)
+* Ensure that 'use strict' isn't flagged as an unused expression (fixes #361) (Nicholas C. Zakas)
+* Increase test coverage for strict-related rules (refs #361) (Nicholas C. Zakas)
+* Up code coverage numbers (Nicholas C. Zakas)
+* Fixes error in new-cap rule when 'new' is used without a constructor (fixes #360) (Nicholas C. Zakas)
+* added files array in package json (Christian)
+* removed unused jshint dependency (Christian)
+* Add test coverage for new Foo constructor usage (Matt DuVall)
+* Pull code coverage up by removing unused method (Matt DuVall)
+* recognise CallExpression variant of RegExp ctor in no-control-regex rule (Michael Ficarra)
+* Merge smart-eqeqeq into eqeqeq (Matt DuVall)
+* Catch additional cases for a.b, new F, iife (Matt DuVall)
+* 0.2.0-dev (Nicholas C. Zakas)
+* Version 0.1.0 (Nicholas C. Zakas)
+* rule: no-spaced-func disallow spaces between function identifier and application (Matt DuVall)
+
+v0.1.1 - November 09, 2013
+
+* Ensure mergeConfigs() doesn't thrown an error when keys are missing in base config (fixes #358) (Nicholas C. Zakas)
+
+v0.1.0 - November 03, 2013
+
+* Version 0.1.0 (Nicholas C. Zakas)
+* Updated Readme for v0.1.0 (Nicholas C. Zakas)
+* Bump code coverage verification to 95% across the board (Nicholas C. Zakas)
+* Fixed broken links (Nicholas C. Zakas)
+* Added information about runtime rules (Nicholas C. Zakas)
+* Added documentation about configuration files (Nicholas C. Zakas)
+* Added description of -v option (Nicholas C. Zakas)
+* Updated architecture documentation (Nicholas C. Zakas)
+* Fix bug in no-control-regex (fixes #347) (Nicholas C. Zakas)
+* Fix link to architecture doc in readme (azu)
+* Rule: No control characters in regular expressions (fixes #338) (Nicholas C. Zakas)
+* Add escaping \= test (Matt DuVall)
+* Add docs for rule (Matt DuVall)
+* rule: no-div-regex for catching ambiguous division operators in regexes (Matt DuVall)
+* Change context-var to block-scoped-var (Matt DuVall)
+* Implement config.globals (Oleg Grenrus)
+* Add 'config-declared global' test (Oleg Grenrus)
+* Adding ability to separate rules with comma (Ilya Volodin)
+* Added rule for missing 'use strict' (fixes #321) (Nicholas C. Zakas)
+* Fixing unittests and finishing code (Ilya Volodin)
+* Disabling/enabling rules through comments (Ilya Volodin)
+* Rename rule to context-var and add documentation (Matt DuVall)
+* Added link to no-global-strict doc in readme (Nicholas C. Zakas)
+* Add try-catch scoping with tests (Matt DuVall)
+* Fix linting error (Matt DuVall)
+* Store FunctionDeclarations in scope as they can be used as literals (Matt DuVall)
+* Fix to use getTokens and add test for MemberExpression usage (Matt DuVall)
+* rule: block-scope-var to check for variables declared in block-scope (Matt DuVall)
+* no-unused-expressions rule: add test and doc mention for `a && b()` (Michael Ficarra)
+* rule: wrap-regex for parens around regular expression literals (Matt DuVall)
+* fixes #308: implement no-unused-expressions rule; ref. jshint rule W030 (Michael Ficarra)
+* Updated change log script to filter out merge messages (Nicholas C. Zakas)
+* Updated changelog (Nicholas C. Zakas)
+* 0.1.0-dev (Nicholas C. Zakas)
+
+v0.0.9 - October 5, 2013
+
+* Version 0.0.9 release (Nicholas C. Zakas)
+* Added rule for no global strict mode (fixes #322) (Nicholas C. Zakas)
+* Change default on to be errors instead of warnings (fixes #326) (Nicholas C. Zakas)
+* Fixed bug where JSHint was using the wrong file in lint task (Nicholas C. Zakas)
+* Updated docs for no-unused vars rule. (Andrew de Andrade)
+* Removed console.log in tests. (Andrew de Andrade)
+* Added link to roadmap and JSHint feature parity list. (Andrew de Andrade)
+* Fixed warning when unused var declared as param in FunctionExpression/Declaration can be ignored because later param is used (Andrew de Andrade)
+* Rename test for smartereqeqeq.js to smarter-eqeqeq.js (Andrew de Andrade)
+* Keep test filename inline with rule name (Andrew de Andrade)
+* Added further instructions for multiline test cases. (Andrew de Andrade)
+* Protecting private method (Seth McLaughlin)
+* Updating look up algorithm for local config files (Seth McLaughlin)
+* Fixing ESLint errors (Ilya Volodin)
+* Implemented local default config file (Seth McLaughlin)
+* Upgrading escope version and fixing related bugs (Ilya Volodin)
+* Fixing assignment during initialization issue (Ilya Volodin)
+* add plain-English regexp description to no-empty-class rule (Michael Ficarra)
+* fixes #289: no-empty-class flags regexps with... flags (Michael Ficarra)
+* Rule: no-catch-shadow (Ian Christian Myers)
+* Update no-empty for compatibility with esprima@1.0.4 (fixes #290) (Mark Macdonald)
+* Fixing bug with _ in MemberExpression (Ilya Volodin)
+* Rule: no-func-assign (Ian Christian Myers)
+* Fix false warning from no-undef rule (fixes #283) (Mark Macdonald)
+* Adding eslint to jake (Ilya Volodin)
+* Rule no redeclare (Ilya Volodin)
+* Fixing no use before define issues (Ilya Volodin)
+* Rule: no-octal-escape (Ian Christian Myers)
+* Fix for `no-proto` and `no-iterator` false positive (Ian Christian Myers)
+* Rule: no-iterator (Ian Christian Myers)
+* Fixing type in guard-for-in documentation (Ilya Volodin)
+* Rule No use before define (Ilya Volodin)
+* Added documentation for the `no-new` rule (Ian Christian Myers)
+* Added documentation for the `no-eval` rule (Ian Christian Myers)
+* Added documentation for the `no-caller` rule (Ian Christian Myers)
+* Added documentation for the `no-bitwise` rule (Ian Christian Myers)
+* simplify no-empty-class rule (Michael Ficarra)
+* Fix `no-empty-class` false negatives (Ian Christian Myers)
+* Added documentation for the `no-alert` rule (Ian Christian Myers)
+* Added documentation for the `new-parens` rule (Ian Christian Myers)
+* Added documentation for the `max-params` rule (Ian Christian Myers)
+* Added documentation for `max-len` rule (Ian Christian Myers)
+* Created link from rules README.md to no-plusplus.md documentation (Ian Christian Myers)
+* Added documentation for `guard-for-in` rule (Ian Christian Myers)
+* Added documentation for `dot-notation` rule (Ian Christian Myers)
+* Added documentation for `curly` rule (Ian Christian Myers)
+* Updated `camelcase` rule documentation (Ian Christian Myers)
+* Added documentation for `complexity` rule (Ian Christian Myers)
+* Changed `no-dangle` documentation to `no-comma-dangle` (Ian Christian Myers)
+* Rule: no-empty-class (Ian Christian Myers)
+* Increased test coverage for max-depth (Ian Christian Myers)
+* Increased test coverage for no-shadow (Ian Christian Myers)
+* Increased test coverage on no-mixed-requires (Ian Christian Myers)
+* Added docs for eqeqeq and no-with (fixes #262) (Raphael Pigulla)
+* Create camelcase.md (Micah Eschbacher)
+* Fix issues with function in no-unused-vars (Ilya Volodin)
+* Rule: No shadow (Ilya Volodin)
+* fixes #252: semi rule errors on VariableDeclarations in ForInStatements (Michael Ficarra)
+* rule: max-len to lint maximum length of a line (Matt DuVall)
+* Fixes #249 (Raphael Pigulla)
+* Merge branch 'master' of https://github.com/beardtwizzle/eslint (Jonathan Mahoney)
+* Re-add lines that were accidentally deleted from config (Jonathan Mahoney)
+* Add support for pre-defined environment globals (re: #228) (Jonathan Mahoney)
+* Rule: no-else-return (Ian Christian Myers)
+* Re-add lines that were accidentally deleted from config (Jonathan Mahoney)
+* Add support for pre-defined environment globals (re: #228) (Jonathan Mahoney)
+* Fix no-unused-vars to report correct line numbers (Ilya Volodin)
+* Rule: no proto (Ilya Volodin)
+* Rule: No Script URL (Ilya Volodin)
+* Rule: max-depth (Ian Christian Myers)
+* Fix: Error severity for rules with options. (Ian Christian Myers)
+* Rule: No wrap func (Ilya Volodin)
+* bug: Fixes semi rule for VariableDeclaration in ForStatement (Matt DuVall)
+* Individual perf tests for rules (Ilya Volodin)
+* Fix loading rules from a rules directory (Ian Christian Myers)
+* Rule no-mixed-requires (fixes #221) (Raphael Pigulla)
+* bug: Add ForStatement for no-cond-assign check (Matthew DuVall)
+* JSLint XML formatter now escapes special characters in the evidence and reason attributes. (Ian Christian Myers)
+* Formatter: JSLint XML (Ian Christian Myers)
+* Refactored `max-statements` rule. (Ian Christian Myers)
+* Fix tests broken due to new rule message text (James Allardice)
+* Merge branch 'master' into match-jshint-messages (James Allardice)
+* Refactored `one-var` rule. (Ian Christian Myers)
+* split eslint.define into eslint.defineRule and eslint.defineRules (Michael Ficarra)
+* Removed unnecessary rules.js test. (Ian Christian Myers)
+* Rule: one-var (Ian Christian Myers)
+* Rule: No unused variables (Ilya Volodin)
+* expose interface for defining new rules at runtime without fs access (Michael Ficarra)
+* disallow 00 in no-octal rule (Michael Ficarra)
+* Increased test coverage for `lib/cli.js`. (Ian Christian Myers)
+* Increased test coverage for `lib/rules.js` (Ian Christian Myers)
+* Increased test coverage for jUnit formatter. (Ian Christian Myers)
+* scripts/bundle: output bundle+map to /build directory (Michael Ficarra)
+* add test for 0X... hex literals in no-octal tests (Michael Ficarra)
+* fixes #200: no-octals should not see leading-0 floats as violations (Michael Ficarra)
+* add back tests for loading rules from a directory (Michael Ficarra)
+* add back in ability to load rules from a directory (Michael Ficarra)
+* Increased test coverage for `complexity` rule. (Ian Christian Myers)
+* Increased test coverage for `max-params` rule. (Ian Christian Myers)
+* also output source map when generating bundle (Michael Ficarra)
+* Rule: unnecessary-strict (Ian Christian Myers)
+* Improve performance of getTokens (Ilya Volodin)
+* Performance jake task (Ilya Volodin)
+* don't force explicit listing of rules; generate listing for bundle (Michael Ficarra)
+* Rule: no-dupe-keys (Ian Christian Myers)
+* fixes #145: create a browser bundle (Michael Ficarra)
+* Fixing no-caller bug (Ilya Volodin)
+* Check for use of underscore library as an exception for var declarations (Matthew DuVall)
+* Merge branch 'master' of https://github.com/nzakas/eslint into no-underscore-dangle (Matthew DuVall)
+* Fixing spelling (Ilya Volodin)
+* Rule: no-empty-label (Ilya Volodin)
+* Add builtin globals to the global scope (fixes #185) (Mark Macdonald)
+* Rule: no-loop-func (Ilya Volodin)
+* Merge branch 'master' of https://github.com/nzakas/eslint into no-underscore-dangle (Matt DuVall)
+* Use proper node declarations and __proto__ exception (Matt DuVall)
+* Updating no-undef patch (see pull request #164) - Simplify parseBoolean() - Make knowledge of```/*jshint*/``` and ```/*global */``` internal to eslint object - Put user-declared globals in Program scope (Mark Macdonald)
+* Rule: no-eq-null (Ian Christian Myers)
+* fixed broken merge (Raphael Pigulla)
+* fixes #143 (Raphael Pigulla)
+* added consistent-this rule (Raphael Pigulla)
+* Rule: no-sync to encourage async usage (Matt DuVall)
+* Update eslint.json with no-underscore-dangle rule (Matt DuVall)
+* Rule: no-underscore-dangle for func/var declarations (Matt DuVall)
+* Warn on finding the bitwise NOT operator (James Allardice)
+* Updating no-undef patch (see pull request #164) 3. Move parsing of ```/*global */``` and ```/*jshint */``` to eslint.js (Mark Macdonald)
+* Warn on finding a bitwise shift operator (fixes #170) (James Allardice)
+* Fix broken test (James Allardice)
+* Add support for the do-while statement to the curly rule (closes #167) (James Allardice)
+* Removing nasty leading underscores (Patrick Brosset)
+* Added tests and test cases for a few files (Patrick Brosset)
+* CLI: -f now accepts a file path (Ian Christian Myers)
+* Updating no-undef patch (see pull request #164) 1. Move predefined globals to ```conf/environments.json``` 2. Move mixin() to ```lib/util.js``` (Mark Macdonald)
+* Match messages to JS[LH]int where appropriate, and ensure consistent message formatting (closes #163) (James Allardice)
+* Add support for the do-while statement to the curly rule (closes #167) (James Allardice)
+* Removing nasty leading underscores (Patrick Brosset)
+* Added tests and test cases for a few files (Patrick Brosset)
+* Merge branch 'master' of github.com:nzakas/jscheck (Nicholas C. Zakas)
+* Added acceptance criteria for rules to docs (Nicholas C. Zakas)
+* Add no-undef (fixes #6) (Mark Macdonald)
+* Fixing no-self-compare (Ilya Volodin)
+* Rule: No multiline strings (Ilya Volodin)
+* CLI refactor to remove process.exit(), file not found now a regular error message, updated formatters to handle this case (Nicholas C. Zakas)
+* Rule: no-self-compare (Ilya Volodin)
+* Rule: No unnecessary semicolons (fixes #158) (Nicholas C. Zakas)
+* Fixed error in no-ex-assign when return statement as found in catch clause (Nicholas C. Zakas)
+* Rename no-exc-assign to no-ex-assign and add to config (Nicholas C. Zakas)
+* Renamed count-spaces to regex-spaces (Nicholas C. Zakas)
+* Documentation updates (Nicholas C. Zakas)
+* Put all rules into strict mode and update docs accordingly (Nicholas C. Zakas)
+* Merge branch 'master' of github.com:nzakas/jscheck (Nicholas C. Zakas)
+* Ensure getScope() works properly when called from Program node (fixes #148) (Nicholas C. Zakas)
+* Rule: wrap-iife (Ilya Volodin)
+* add additional test for no-cond-assign rule (Stephen Murray)
+* Merge branch 'master' of github.com:nzakas/jscheck (Nicholas C. Zakas)
+* Experimental support for Jake as a build system (fixes #151) (Nicholas C. Zakas)
+* fixes #152 (Stephen Murray)
+* add docs for no-exc-assign (Stephen Murray)
+* Merge branch 'master' of https://github.com/nzakas/eslint into no-new-object-array-literals (Matt DuVall)
+* Merge branch 'master' of https://github.com/nzakas/eslint into count-spaces (Matt DuVall)
+* Added a test for getting global scope from Program node (refs #148) (Nicholas C. Zakas)
+* Add positive test case for `object.Array` (Matthew DuVall)
+* Only support space characters for repetitions (Matthew DuVall)
+* fix line length per code conventions (Stephen Murray)
+* fix indentation per code conventions (Stephen Murray)
+* fixes #149 (Stephen Murray)
+* Rule: no-ternary (Ian Christian Myers)
+* Check that the return statement has an argument before checking its type (James Allardice)
+* Rule: count-spaces for multiple spaces in regular expressions (Matt DuVall)
+* Update eslint.json configuration file for literal rules (Matt DuVall)
+* Created no-label-var rule. (Ian Christian Myers)
+* Rule: no-new-array and no-new-object (Matt DuVall)
+* Added ability to retrieve scope using escope. (Ian Christian Myers)
+* Corrected unused arguments (Patrick Brosset)
+* Reporting function complexity on function:after and using array push/pop to handle nesting (Patrick Brosset)
+* Fixing style issues discovered while npm testing (Patrick Brosset)
+* First draft proposal for a cyclomatic complexity ESLint rule (Patrick Brosset)
+* Corrected file extension on no-plusplus rule documentation. (Ian Christian Myers)
+* Documentation for no-delete-var rule. Closes #129 (Ilya Volodin)
+* Rule: max-statements (Ian Christian Myers)
+* Better documentation for the `no-plusplus` rule. (Ian Christian Myers)
+* Rule: no-plusplus (Ian Christian Myers)
+* Rule: no assignment in return statement (Ilya Volodin)
+* Updating max-params rule name (Ilya Volodin)
+* Rule: Function has too many parameters (Ilya Volodin)
+* Removing merge originals (Ilya Volodin)
+* Rebasing on master (Ilya Volodin)
+* Rule: Variables should not be deleted (Ilya Volodin)
+* Fixes incorrect reporting of missing semicolon (Ian Christian Myers)
+* Rebase against master branch (Mathias Bynens)
+* Rule to warn on use of Math and JSON as functions (James Allardice)
+* Formatter: Checkstyle (Ian Christian Myers)
+* docs: Clean up structure (Mathias Bynens)
+* Merging no-native-reassign and no-redefine (Ilya Volodin)
+* Rule: no native reassignment (Ilya Volodin)
+* 0.0.8-dev (Nicholas C. Zakas)
+* v0.0.7 released (Nicholas C. Zakas)
+* Updated Tests, etc. (Jamund Ferguson)
+* Added jUnit Support (Fixes #16) (Jamund Ferguson)
+
+v0.0.7 - July 22, 2013
+
+* 0.0.7 (Nicholas C. Zakas)
+* Add code coverage checks to npm test and update rule tests to have better coverage (Nicholas C. Zakas)
+* Fixed CLI output on serial programatic executions (Ian Christian Myers)
+* Removes line length from code style convention docs (Josh Perez)
+* Adds escapeRegExp and fixes documentation (Josh Perez)
+* Add quotes rule and test coverage for configuration options (Matt DuVall)
+* Adds templating for lint messages and refactors rules to use it (Josh Perez)
+* Fixes lint rules for unchecked test file (Josh Perez)
+* Changes dotnotation rule to match JSHint style (Josh Perez)
+* Change configInfo to options and add test coverage (Matt DuVall)
+* Merge branch 'master' of https://github.com/nzakas/eslint into optional-args-for-rule (Matt DuVall)
+* Adds dot notation lint rule (Josh Perez)
+* Strip trailing underscores in camelcase rule - Fixes #94 (Patrick Brosset)
+* add mailing list link (Douglas Campos)
+* Strip leading underscores in camelcase rule - Fixes #94 (Patrick Brosset)
+* Created no-dangle rule. (Ian Christian Myers)
+* Fixed rule name (James Allardice)
+* Make sure the callee type is Identifier (James Allardice)
+* Add rule for implied eval via setTimeout/Interval (James Allardice)
+* Fix rule name in config (James Allardice)
+* Fixes #90 -- updates docstrings (Stephen Murray)
+* Fixes issue with fs.existsSync on NodeJS 0.6 (Ian Christian Myers)
+* Fixing -c config option. (Ian Christian Myers)
+* Allow arrays to be passed as multiple args to rule (Matt DuVall)
+* Test to make sure empty case with one line break is safe (Matt DuVall)
+* Rule: The Function constructor is eval (Ilya Volodin)
+* Enabled require("eslint") and exposed out CLI. (Ian Christian Myers)
+* Adds test and fix for issue #82 (Mark Macdonald)
+* Merge branch 'master' of https://github.com/nzakas/eslint into ok (Yusuke Suzuki)
+* Created brace-style rule. (Ian Christian Myers)
+* Formatters can now process multiple files at once (Jamund Ferguson)
+* Rule: Do not use 'new' for side effects (Ilya Volodin)
+* Adds smarter-eqeqeq rule (Josh Perez)
+* Add EditorConfig file for consistent editor/IDE behavior (Jed Hunsaker)
+* Fix the positive case for no-unreachable where there is no return statement at all, or if the return is at the end. Those cases should not return any errors. The error condition was not be checked before throwing the rule error. (Joel Feenstra)
+* Adds test and fix for no-octal on 0 literal (Mark Macdonald)
+* Don't report no-empty warnings when a parent is FunctionExpression / FunctionDeclaration (Yusuke Suzuki)
+* Add api.getAncestors (Yusuke Suzuki)
+* Ensure estraverse version 1.2.0 or later (Yusuke Suzuki)
+* Fixes no-alert lint rule for non identifier calls (Josh Perez)
+* Fixes exception when init is null (Josh Perez)
+* Fixes no-octal check to only check for numbers (Josh Perez)
+* 0.0.7-dev (Nicholas C. Zakas)
+* 0.0.6 (Nicholas C. Zakas)
+* Follow the rule naming conventions (James Allardice)
+* Add rule for missing radix argument to parseInt (James Allardice)
+* Allow return, falls-through comment, and throw for falls-through (Matt DuVall)
+* Merge branch 'master' of https://github.com/nzakas/eslint into rule-fall-through (Matt DuVall)
+* Globals are not good, declare len (Matt DuVall)
+* Rule to add no-fall-through (Matt DuVall)
+
+v0.0.6 - July 16, 2013
+
+* 0.0.6 (Nicholas C. Zakas)
+* Changed semi rule to use tokens instead of source (Nicholas C. Zakas)
+* Renaming new-parens rule (Ilya Volodin)
+* Renaming no-new-wrappers rule and adding tests (Ilya Volodin)
+* Add license URL (Nick Schonning)
+* Remove unused sinon requires (Nick Schonning)
+* Remove redundant JSHint directives (Nick Schonning)
+* Rule: Do not use constructor for wrapper objects (Ilya Volodin)
+* Test node 0.11 unstable but allow it to fail (Nick Schonning)
+* Rule: Constructor should use parentheses (Ilya Volodin)
+* Fix reference to "CSS Lint" in Contributing documentation (Brian McKenna)
+* Add git attributes file for line endings (Andy Hu)
+* Rename to create an 'index' file in GH web view (Evan Goer)
+* Avoid accidentally creating a markdown link (Evan Goer)
+* Add headings and correct internal links (Evan Goer)
+* Add wiki files to docs directory (Evan Goer)
+* Add rules for leading/trailing decimal points (James Allardice)
+* Add rule to prevent comparisons with value NaN (James Allardice)
+* Fixing jshint error (Ilya Volodin)
+* Rule: no octal literals (Ilya Volodin)
+* Rule: no undefined when initializing variables (Ilya Volodin)
+* Updated CONTRIBUTING.md (Nicholas C. Zakas)
+* Make sure namespaces are honored in new-cap (Nicholas C. Zakas)
+* Make sure no-empty also checks for ';;' (Nicholas C. Zakas)
+* Add CLI option to output version (Nicholas C. Zakas)
+* Updated contribution guidelines (Nicholas C. Zakas)
+* Fixing jshint complaints. (Joel Feenstra)
+* Converting to a switch statement and declaring variables. (Joel Feenstra)
+* Added .jshintrc file (until ESLint can lint itself) and cleaned up JSHint warnings (Nicholas C. Zakas)
+* Merge branch 'master' of github.com:nzakas/jscheck (Nicholas C. Zakas)
+* A bit of cleanup (Nicholas C. Zakas)
+* Add unreachable code detection for switch cases and after continue/break. (Joel Feenstra)
+* Add support for detecting unreachable code after a throw or return statement. (Joel Feenstra)
+* Fix curly brace check when an if statement is the alternate. (Joel Feenstra)
+* Check for empty switch statements with no cases. (Matt DuVall)
+* Added CONTRIBUTING.md (Nicholas C. Zakas)
+* Added rule to check for missing semicolons (fixes #9) (Nicholas C. Zakas)
+* Verify that file paths exist before reading the file (Matt DuVall)
+* Added guard-for-in rule (fixes #1) (Nicholas C. Zakas)
+* Run linting with npm test as well (Nicholas C. Zakas)
+* Removed foo.txt (Nicholas C. Zakas)
+* Updated config file with new no-caller ID (Nicholas C. Zakas)
+* Changed name of no-arg to no-caller (Nicholas C. Zakas)
+* Increased test coverage (Nicholas C. Zakas)
+* Got npm test to work with istanbul, huzzah\! (Nicholas C. Zakas)
+* Moved /config to /conf (Nicholas C. Zakas)
+* Added script to auto-generate changelog (Nicholas C. Zakas)
+* Add `quote-props` rule (Mathias Bynens)
+* Cleaned up relationship between bin/eslint, lib/cli.js, and lib/eslint.js (Nicholas C. Zakas)
+* Add problem count to compact formatter (Nicholas C. Zakas)
+* Fix merge conflict (Nicholas C. Zakas)
+* Change reporters to formatters, add format command line option. Also added tests for compact format. (Nicholas C. Zakas)
+* Change reporters to formatters, add format command line option (Nicholas C. Zakas)
+* Start development of 0.0.6-dev (Nicholas C. Zakas)
diff --git a/node_modules/eslint/LICENSE b/node_modules/eslint/LICENSE
new file mode 100644
index 000000000..7fe552a86
--- /dev/null
+++ b/node_modules/eslint/LICENSE
@@ -0,0 +1,19 @@
+Copyright JS Foundation and other contributors, https://js.foundation
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/eslint/README.md b/node_modules/eslint/README.md
new file mode 100644
index 000000000..f5081d2f7
--- /dev/null
+++ b/node_modules/eslint/README.md
@@ -0,0 +1,276 @@
+[![NPM version](https://img.shields.io/npm/v/eslint.svg)](https://www.npmjs.com/package/eslint)
+[![Downloads](https://img.shields.io/npm/dm/eslint.svg)](https://www.npmjs.com/package/eslint)
+[![Build Status](https://github.com/eslint/eslint/workflows/CI/badge.svg)](https://github.com/eslint/eslint/actions)
+[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Feslint%2Feslint.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Feslint%2Feslint?ref=badge_shield)
+
+[![Open Collective Backers](https://img.shields.io/opencollective/backers/eslint)](https://opencollective.com/eslint) +[![Open Collective Sponsors](https://img.shields.io/opencollective/sponsors/eslint)](https://opencollective.com/eslint) +[![Follow us on Twitter](https://img.shields.io/twitter/follow/geteslint?label=Follow&style=social)](https://twitter.com/intent/user?screen_name=geteslint) + +# ESLint + +[Website](https://eslint.org) | +[Configuring](https://eslint.org/docs/user-guide/configuring) | +[Rules](https://eslint.org/docs/rules/) | +[Contributing](https://eslint.org/docs/developer-guide/contributing) | +[Reporting Bugs](https://eslint.org/docs/developer-guide/contributing/reporting-bugs) | +[Code of Conduct](https://js.foundation/community/code-of-conduct) | +[Twitter](https://twitter.com/geteslint) | +[Mailing List](https://groups.google.com/group/eslint) | +[Chat Room](https://eslint.org/chat) + +ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. In many ways, it is similar to JSLint and JSHint with a few exceptions: + +* ESLint uses [Espree](https://github.com/eslint/espree) for JavaScript parsing. +* ESLint uses an AST to evaluate patterns in code. +* ESLint is completely pluggable, every single rule is a plugin and you can add more at runtime. + +## Table of Contents + +1. [Installation and Usage](#installation-and-usage) +2. [Configuration](#configuration) +3. [Code of Conduct](#code-of-conduct) +4. [Filing Issues](#filing-issues) +5. [Frequently Asked Questions](#faq) +6. [Releases](#releases) +7. [Security Policy](#security-policy) +8. [Semantic Versioning Policy](#semantic-versioning-policy) +9. [License](#license) +10. [Team](#team) +11. [Sponsors](#sponsors) +12. [Technology Sponsors](#technology-sponsors) + +## Installation and Usage + +Prerequisites: [Node.js](https://nodejs.org/) (`^10.12.0`, or `>=12.0.0`) built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.) + +You can install ESLint using npm: + +``` +$ npm install eslint --save-dev +``` + +You should then set up a configuration file: + +``` +$ ./node_modules/.bin/eslint --init +``` + +After that, you can run ESLint on any file or directory like this: + +``` +$ ./node_modules/.bin/eslint yourfile.js +``` + +## Configuration + +After running `eslint --init`, you'll have a `.eslintrc` file in your directory. In it, you'll see some rules configured like this: + +```json +{ + "rules": { + "semi": ["error", "always"], + "quotes": ["error", "double"] + } +} +``` + +The names `"semi"` and `"quotes"` are the names of [rules](https://eslint.org/docs/rules) in ESLint. The first value is the error level of the rule and can be one of these values: + +* `"off"` or `0` - turn the rule off +* `"warn"` or `1` - turn the rule on as a warning (doesn't affect exit code) +* `"error"` or `2` - turn the rule on as an error (exit code will be 1) + +The three error levels allow you fine-grained control over how ESLint applies rules (for more configuration options and details, see the [configuration docs](https://eslint.org/docs/user-guide/configuring)). + +## Code of Conduct + +ESLint adheres to the [JS Foundation Code of Conduct](https://js.foundation/community/code-of-conduct). + +## Filing Issues + +Before filing an issue, please be sure to read the guidelines for what you're reporting: + +* [Bug Report](https://eslint.org/docs/developer-guide/contributing/reporting-bugs) +* [Propose a New Rule](https://eslint.org/docs/developer-guide/contributing/new-rules) +* [Proposing a Rule Change](https://eslint.org/docs/developer-guide/contributing/rule-changes) +* [Request a Change](https://eslint.org/docs/developer-guide/contributing/changes) + +## Frequently Asked Questions + +### I'm using JSCS, should I migrate to ESLint? + +Yes. [JSCS has reached end of life](https://eslint.org/blog/2016/07/jscs-end-of-life) and is no longer supported. + +We have prepared a [migration guide](https://eslint.org/docs/user-guide/migrating-from-jscs) to help you convert your JSCS settings to an ESLint configuration. + +We are now at or near 100% compatibility with JSCS. If you try ESLint and believe we are not yet compatible with a JSCS rule/configuration, please create an issue (mentioning that it is a JSCS compatibility issue) and we will evaluate it as per our normal process. + +### Does Prettier replace ESLint? + +No, ESLint does both traditional linting (looking for problematic patterns) and style checking (enforcement of conventions). You can use ESLint for everything, or you can combine both using Prettier to format your code and ESLint to catch possible errors. + +### Why can't ESLint find my plugins? + +* Make sure your plugins (and ESLint) are both in your project's `package.json` as devDependencies (or dependencies, if your project uses ESLint at runtime). +* Make sure you have run `npm install` and all your dependencies are installed. +* Make sure your plugins' peerDependencies have been installed as well. You can use `npm view eslint-plugin-myplugin peerDependencies` to see what peer dependencies `eslint-plugin-myplugin` has. + +### Does ESLint support JSX? + +Yes, ESLint natively supports parsing JSX syntax (this must be enabled in [configuration](https://eslint.org/docs/user-guide/configuring)). Please note that supporting JSX syntax *is not* the same as supporting React. React applies specific semantics to JSX syntax that ESLint doesn't recognize. We recommend using [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react) if you are using React and want React semantics. + +### What ECMAScript versions does ESLint support? + +ESLint has full support for ECMAScript 3, 5 (default), 2015, 2016, 2017, 2018, 2019, and 2020. You can set your desired ECMAScript syntax (and other settings, like global variables or your target environments) through [configuration](https://eslint.org/docs/user-guide/configuring). + +### What about experimental features? + +ESLint's parser only officially supports the latest final ECMAScript standard. We will make changes to core rules in order to avoid crashes on stage 3 ECMAScript syntax proposals (as long as they are implemented using the correct experimental ESTree syntax). We may make changes to core rules to better work with language extensions (such as JSX, Flow, and TypeScript) on a case-by-case basis. + +In other cases (including if rules need to warn on more or fewer cases due to new syntax, rather than just not crashing), we recommend you use other parsers and/or rule plugins. If you are using Babel, you can use the [babel-eslint](https://github.com/babel/babel-eslint) parser and [eslint-plugin-babel](https://github.com/babel/eslint-plugin-babel) to use any option available in Babel. + +Once a language feature has been adopted into the ECMAScript standard (stage 4 according to the [TC39 process](https://tc39.github.io/process-document/)), we will accept issues and pull requests related to the new feature, subject to our [contributing guidelines](https://eslint.org/docs/developer-guide/contributing). Until then, please use the appropriate parser and plugin(s) for your experimental feature. + +### Where to ask for help? + +Join our [Mailing List](https://groups.google.com/group/eslint) or [Chatroom](https://eslint.org/chat). + +## Releases + +We have scheduled releases every two weeks on Friday or Saturday. You can follow a [release issue](https://github.com/eslint/eslint/issues?q=is%3Aopen+is%3Aissue+label%3Arelease) for updates about the scheduling of any particular release. + +## Security Policy + +ESLint takes security seriously. We work hard to ensure that ESLint is safe for everyone and that security issues are addressed quickly and responsibly. Read the full [security policy](https://github.com/eslint/.github/blob/master/SECURITY.md). + +## Semantic Versioning Policy + +ESLint follows [semantic versioning](https://semver.org). However, due to the nature of ESLint as a code quality tool, it's not always clear when a minor or major version bump occurs. To help clarify this for everyone, we've defined the following semantic versioning policy for ESLint: + +* Patch release (intended to not break your lint build) + * A bug fix in a rule that results in ESLint reporting fewer linting errors. + * A bug fix to the CLI or core (including formatters). + * Improvements to documentation. + * Non-user-facing changes such as refactoring code, adding, deleting, or modifying tests, and increasing test coverage. + * Re-releasing after a failed release (i.e., publishing a release that doesn't work for anyone). +* Minor release (might break your lint build) + * A bug fix in a rule that results in ESLint reporting more linting errors. + * A new rule is created. + * A new option to an existing rule that does not result in ESLint reporting more linting errors by default. + * An existing rule is deprecated. + * A new CLI capability is created. + * New capabilities to the public API are added (new classes, new methods, new arguments to existing methods, etc.). + * A new formatter is created. + * `eslint:recommended` is updated and will result in strictly fewer linting errors (e.g., rule removals). +* Major release (likely to break your lint build) + * `eslint:recommended` is updated and may result in new linting errors (e.g., rule additions, most rule option updates). + * A new option to an existing rule that results in ESLint reporting more linting errors by default. + * An existing formatter is removed. + * Part of the public API is removed or changed in an incompatible way. The public API includes: + * Rule schemas + * Configuration schema + * Command-line options + * Node.js API + * Rule, formatter, parser, plugin APIs + +According to our policy, any minor update may report more linting errors than the previous release (ex: from a bug fix). As such, we recommend using the tilde (`~`) in `package.json` e.g. `"eslint": "~3.1.0"` to guarantee the results of your builds. + +## License + +[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Feslint%2Feslint.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Feslint%2Feslint?ref=badge_large) + +## Team + +These folks keep the project moving and are resources for help. + + + + +### Technical Steering Committee (TSC) + +The people who manage releases, review feature requests, and meet regularly to ensure ESLint is properly maintained. + +
+ +
+Nicholas C. Zakas +
+
+ +
+Brandon Mills +
+
+ +
+Toru Nagashima +
+
+ +
+Kai Cataldo +
+
+ +
+Milos Djermanovic +
+
+ + +### Reviewers + +The people who review and implement new features. + +
+ +
+薛定谔的猫 +
+
+ + + + +### Committers + +The people who review and fix bugs and help triage issues. + +
+ +
+Pig Fang +
+
+ +
+Anix +
+
+ +
+YeonJuan +
+
+ + + + +## Sponsors + +The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://opencollective.com/eslint) to get your logo on our README and website. + + + +

Gold Sponsors

+

Salesforce Airbnb Microsoft FOSS Fund Sponsorships

Silver Sponsors

+

Liftoff AMP Project

Bronze Sponsors

+

Buy.Fineproxy.Org Veikkaajat.com Nettikasinot.media My True Media Norgekasino Japanesecasino CasinoTop.com Casino Topp Anagram Solver Kasinot.fi Pelisivut Nettikasinot.org BonusFinder Deutschland Bugsnag Stability Monitoring Mixpanel VPS Server Icons8: free icons, photos, illustrations, and music Discord ThemeIsle Marfeel Fire Stick Tricks

+ + +## Technology Sponsors + +* Site search ([eslint.org](https://eslint.org)) is sponsored by [Algolia](https://www.algolia.com) +* Hosting for ([eslint.org](https://eslint.org)) is sponsored by [Netlify](https://www.netlify.com) +* Password management is sponsored by [1Password](https://www.1password.com) diff --git a/node_modules/eslint/bin/eslint.js b/node_modules/eslint/bin/eslint.js new file mode 100755 index 000000000..75b413148 --- /dev/null +++ b/node_modules/eslint/bin/eslint.js @@ -0,0 +1,146 @@ +#!/usr/bin/env node + +/** + * @fileoverview Main CLI that is run via the eslint command. + * @author Nicholas C. Zakas + */ + +/* eslint no-console:off */ + +"use strict"; + +// to use V8's code cache to speed up instantiation time +require("v8-compile-cache"); + +// must do this initialization *before* other requires in order to work +if (process.argv.includes("--debug")) { + require("debug").enable("eslint:*,-eslint:code-path"); +} + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Read data from stdin til the end. + * + * Note: See + * - https://github.com/nodejs/node/blob/master/doc/api/process.md#processstdin + * - https://github.com/nodejs/node/blob/master/doc/api/process.md#a-note-on-process-io + * - https://lists.gnu.org/archive/html/bug-gnu-emacs/2016-01/msg00419.html + * - https://github.com/nodejs/node/issues/7439 (historical) + * + * On Windows using `fs.readFileSync(STDIN_FILE_DESCRIPTOR, "utf8")` seems + * to read 4096 bytes before blocking and never drains to read further data. + * + * The investigation on the Emacs thread indicates: + * + * > Emacs on MS-Windows uses pipes to communicate with subprocesses; a + * > pipe on Windows has a 4K buffer. So as soon as Emacs writes more than + * > 4096 bytes to the pipe, the pipe becomes full, and Emacs then waits for + * > the subprocess to read its end of the pipe, at which time Emacs will + * > write the rest of the stuff. + * @returns {Promise} The read text. + */ +function readStdin() { + return new Promise((resolve, reject) => { + let content = ""; + let chunk = ""; + + process.stdin + .setEncoding("utf8") + .on("readable", () => { + while ((chunk = process.stdin.read()) !== null) { + content += chunk; + } + }) + .on("end", () => resolve(content)) + .on("error", reject); + }); +} + +/** + * Get the error message of a given value. + * @param {any} error The value to get. + * @returns {string} The error message. + */ +function getErrorMessage(error) { + + // Lazy loading because those are used only if error happened. + const fs = require("fs"); + const path = require("path"); + const util = require("util"); + const lodash = require("lodash"); + + // Foolproof -- thirdparty module might throw non-object. + if (typeof error !== "object" || error === null) { + return String(error); + } + + // Use templates if `error.messageTemplate` is present. + if (typeof error.messageTemplate === "string") { + try { + const templateFilePath = path.resolve( + __dirname, + `../messages/${error.messageTemplate}.txt` + ); + + // Use sync API because Node.js should exit at this tick. + const templateText = fs.readFileSync(templateFilePath, "utf-8"); + const template = lodash.template(templateText); + + return template(error.messageData || {}); + } catch { + + // Ignore template error then fallback to use `error.stack`. + } + } + + // Use the stacktrace if it's an error object. + if (typeof error.stack === "string") { + return error.stack; + } + + // Otherwise, dump the object. + return util.format("%o", error); +} + +/** + * Catch and report unexpected error. + * @param {any} error The thrown error object. + * @returns {void} + */ +function onFatalError(error) { + process.exitCode = 2; + + const { version } = require("../package.json"); + const message = getErrorMessage(error); + + console.error(` +Oops! Something went wrong! :( + +ESLint: ${version} + +${message}`); +} + +//------------------------------------------------------------------------------ +// Execution +//------------------------------------------------------------------------------ + +(async function main() { + process.on("uncaughtException", onFatalError); + process.on("unhandledRejection", onFatalError); + + // Call the config initializer if `--init` is present. + if (process.argv.includes("--init")) { + await require("../lib/init/config-initializer").initializeConfig(); + return; + } + + // Otherwise, call the CLI. + process.exitCode = await require("../lib/cli").execute( + process.argv, + process.argv.includes("--stdin") ? await readStdin() : null + ); +}()).catch(onFatalError); diff --git a/node_modules/eslint/conf/category-list.json b/node_modules/eslint/conf/category-list.json new file mode 100644 index 000000000..cd3b816b6 --- /dev/null +++ b/node_modules/eslint/conf/category-list.json @@ -0,0 +1,39 @@ +{ + "categories": [ + { "name": "Possible Errors", "description": "These rules relate to possible syntax or logic errors in JavaScript code:" }, + { "name": "Best Practices", "description": "These rules relate to better ways of doing things to help you avoid problems:" }, + { "name": "Strict Mode", "description": "These rules relate to strict mode directives:" }, + { "name": "Variables", "description": "These rules relate to variable declarations:" }, + { "name": "Stylistic Issues", "description": "These rules relate to style guidelines, and are therefore quite subjective:" }, + { "name": "ECMAScript 6", "description": "These rules relate to ES6, also known as ES2015:" } + ], + "deprecated": { + "name": "Deprecated", + "description": "These rules have been deprecated in accordance with the deprecation policy, and replaced by newer rules:", + "rules": [] + }, + "removed": { + "name": "Removed", + "description": "These rules from older versions of ESLint (before the deprecation policy existed) have been replaced by newer rules:", + "rules": [ + { "removed": "generator-star", "replacedBy": ["generator-star-spacing"] }, + { "removed": "global-strict", "replacedBy": ["strict"] }, + { "removed": "no-arrow-condition", "replacedBy": ["no-confusing-arrow", "no-constant-condition"] }, + { "removed": "no-comma-dangle", "replacedBy": ["comma-dangle"] }, + { "removed": "no-empty-class", "replacedBy": ["no-empty-character-class"] }, + { "removed": "no-empty-label", "replacedBy": ["no-labels"] }, + { "removed": "no-extra-strict", "replacedBy": ["strict"] }, + { "removed": "no-reserved-keys", "replacedBy": ["quote-props"] }, + { "removed": "no-space-before-semi", "replacedBy": ["semi-spacing"] }, + { "removed": "no-wrap-func", "replacedBy": ["no-extra-parens"] }, + { "removed": "space-after-function-name", "replacedBy": ["space-before-function-paren"] }, + { "removed": "space-after-keywords", "replacedBy": ["keyword-spacing"] }, + { "removed": "space-before-function-parentheses", "replacedBy": ["space-before-function-paren"] }, + { "removed": "space-before-keywords", "replacedBy": ["keyword-spacing"] }, + { "removed": "space-in-brackets", "replacedBy": ["object-curly-spacing", "array-bracket-spacing"] }, + { "removed": "space-return-throw-case", "replacedBy": ["keyword-spacing"] }, + { "removed": "space-unary-word-ops", "replacedBy": ["space-unary-ops"] }, + { "removed": "spaced-line-comment", "replacedBy": ["spaced-comment"] } + ] + } +} diff --git a/node_modules/eslint/conf/config-schema.js b/node_modules/eslint/conf/config-schema.js new file mode 100644 index 000000000..b83f65788 --- /dev/null +++ b/node_modules/eslint/conf/config-schema.js @@ -0,0 +1,93 @@ +/* + * STOP!!! DO NOT MODIFY. + * + * This file is part of the ongoing work to move the eslintrc-style config + * system into the @eslint/eslintrc package. This file needs to remain + * unchanged in order for this work to proceed. + * + * If you think you need to change this file, please contact @nzakas first. + * + * Thanks in advance for your cooperation. + */ + +/** + * @fileoverview Defines a schema for configs. + * @author Sylvan Mably + */ + +"use strict"; + +const baseConfigProperties = { + $schema: { type: "string" }, + 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" }, + ignorePatterns: { $ref: "#/definitions/stringOrStrings" }, + ...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; diff --git a/node_modules/eslint/conf/default-cli-options.js b/node_modules/eslint/conf/default-cli-options.js new file mode 100644 index 000000000..e09a829d1 --- /dev/null +++ b/node_modules/eslint/conf/default-cli-options.js @@ -0,0 +1,31 @@ +/** + * @fileoverview Default CLIEngineOptions. + * @author Ian VanSchooten + */ + +"use strict"; + +module.exports = { + configFile: null, + baseConfig: false, + rulePaths: [], + useEslintrc: true, + envs: [], + globals: [], + extensions: null, + ignore: true, + ignorePath: void 0, + cache: false, + + /* + * in order to honor the cacheFile option if specified + * this option should not have a default value otherwise + * it will always be used + */ + cacheLocation: "", + cacheFile: ".eslintcache", + fix: false, + allowInlineConfig: true, + reportUnusedDisableDirectives: void 0, + globInputPaths: true +}; diff --git a/node_modules/eslint/conf/eslint-all.js b/node_modules/eslint/conf/eslint-all.js new file mode 100644 index 000000000..10c5304fd --- /dev/null +++ b/node_modules/eslint/conf/eslint-all.js @@ -0,0 +1,31 @@ +/** + * @fileoverview Config to enable all rules. + * @author Robert Fletcher + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const builtInRules = require("../lib/rules"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const allRules = {}; + +for (const [ruleId, rule] of builtInRules) { + if (!rule.meta.deprecated) { + allRules[ruleId] = "error"; + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** @type {import("../lib/shared/types").ConfigData} */ +module.exports = { rules: allRules }; diff --git a/node_modules/eslint/conf/eslint-recommended.js b/node_modules/eslint/conf/eslint-recommended.js new file mode 100644 index 000000000..2137685fb --- /dev/null +++ b/node_modules/eslint/conf/eslint-recommended.js @@ -0,0 +1,72 @@ +/** + * @fileoverview Configuration applied when a user configuration extends from + * eslint:recommended. + * @author Nicholas C. Zakas + */ + +"use strict"; + +/* eslint sort-keys: ["error", "asc"] */ + +/** @type {import("../lib/shared/types").ConfigData} */ +module.exports = { + rules: { + "constructor-super": "error", + "for-direction": "error", + "getter-return": "error", + "no-async-promise-executor": "error", + "no-case-declarations": "error", + "no-class-assign": "error", + "no-compare-neg-zero": "error", + "no-cond-assign": "error", + "no-const-assign": "error", + "no-constant-condition": "error", + "no-control-regex": "error", + "no-debugger": "error", + "no-delete-var": "error", + "no-dupe-args": "error", + "no-dupe-class-members": "error", + "no-dupe-else-if": "error", + "no-dupe-keys": "error", + "no-duplicate-case": "error", + "no-empty": "error", + "no-empty-character-class": "error", + "no-empty-pattern": "error", + "no-ex-assign": "error", + "no-extra-boolean-cast": "error", + "no-extra-semi": "error", + "no-fallthrough": "error", + "no-func-assign": "error", + "no-global-assign": "error", + "no-import-assign": "error", + "no-inner-declarations": "error", + "no-invalid-regexp": "error", + "no-irregular-whitespace": "error", + "no-misleading-character-class": "error", + "no-mixed-spaces-and-tabs": "error", + "no-new-symbol": "error", + "no-obj-calls": "error", + "no-octal": "error", + "no-prototype-builtins": "error", + "no-redeclare": "error", + "no-regex-spaces": "error", + "no-self-assign": "error", + "no-setter-return": "error", + "no-shadow-restricted-names": "error", + "no-sparse-arrays": "error", + "no-this-before-super": "error", + "no-undef": "error", + "no-unexpected-multiline": "error", + "no-unreachable": "error", + "no-unsafe-finally": "error", + "no-unsafe-negation": "error", + "no-unused-labels": "error", + "no-unused-vars": "error", + "no-useless-catch": "error", + "no-useless-escape": "error", + "no-with": "error", + "require-yield": "error", + "use-isnan": "error", + "valid-typeof": "error" + } +}; diff --git a/node_modules/eslint/conf/replacements.json b/node_modules/eslint/conf/replacements.json new file mode 100644 index 000000000..c047811e6 --- /dev/null +++ b/node_modules/eslint/conf/replacements.json @@ -0,0 +1,22 @@ +{ + "rules": { + "generator-star": ["generator-star-spacing"], + "global-strict": ["strict"], + "no-arrow-condition": ["no-confusing-arrow", "no-constant-condition"], + "no-comma-dangle": ["comma-dangle"], + "no-empty-class": ["no-empty-character-class"], + "no-empty-label": ["no-labels"], + "no-extra-strict": ["strict"], + "no-reserved-keys": ["quote-props"], + "no-space-before-semi": ["semi-spacing"], + "no-wrap-func": ["no-extra-parens"], + "space-after-function-name": ["space-before-function-paren"], + "space-after-keywords": ["keyword-spacing"], + "space-before-function-parentheses": ["space-before-function-paren"], + "space-before-keywords": ["keyword-spacing"], + "space-in-brackets": ["object-curly-spacing", "array-bracket-spacing", "computed-property-spacing"], + "space-return-throw-case": ["keyword-spacing"], + "space-unary-word-ops": ["space-unary-ops"], + "spaced-line-comment": ["spaced-comment"] + } +} diff --git a/node_modules/eslint/lib/api.js b/node_modules/eslint/lib/api.js new file mode 100644 index 000000000..e4b6643b4 --- /dev/null +++ b/node_modules/eslint/lib/api.js @@ -0,0 +1,34 @@ +/** + * @fileoverview Expose out ESLint and CLI to require. + * @author Ian Christian Myers + */ + +"use strict"; + +const { CLIEngine } = require("./cli-engine"); +const { ESLint } = require("./eslint"); +const { Linter } = require("./linter"); +const { RuleTester } = require("./rule-tester"); +const { SourceCode } = require("./source-code"); + +module.exports = { + Linter, + CLIEngine, + ESLint, + RuleTester, + SourceCode +}; + +// DOTO: remove deprecated API. +let deprecatedLinterInstance = null; + +Object.defineProperty(module.exports, "linter", { + enumerable: false, + get() { + if (!deprecatedLinterInstance) { + deprecatedLinterInstance = new Linter(); + } + + return deprecatedLinterInstance; + } +}); diff --git a/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js b/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js new file mode 100644 index 000000000..df49c2777 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js @@ -0,0 +1,502 @@ +/* + * STOP!!! DO NOT MODIFY. + * + * This file is part of the ongoing work to move the eslintrc-style config + * system into the @eslint/eslintrc package. This file needs to remain + * unchanged in order for this work to proceed. + * + * If you think you need to change this file, please contact @nzakas first. + * + * Thanks in advance for your cooperation. + */ + +/** + * @fileoverview `CascadingConfigArrayFactory` class. + * + * `CascadingConfigArrayFactory` class has a responsibility: + * + * 1. Handles cascading of config files. + * + * It provides two methods: + * + * - `getConfigArrayForFile(filePath)` + * Get the corresponded configuration of a given file. This method doesn't + * throw even if the given file didn't exist. + * - `clearCache()` + * Clear the internal cache. You have to call this method when + * `additionalPluginPool` was updated if `baseConfig` or `cliConfig` depends + * on the additional plugins. (`CLIEngine#addPlugin()` method calls this.) + * + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const os = require("os"); +const path = require("path"); +const { validateConfigArray } = require("../shared/config-validator"); +const { emitDeprecationWarning } = require("../shared/deprecation-warnings"); +const { ConfigArrayFactory } = require("./config-array-factory"); +const { ConfigArray, ConfigDependency, IgnorePattern } = require("./config-array"); +const loadRules = require("./load-rules"); +const debug = require("debug")("eslint:cascading-config-array-factory"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +// Define types for VSCode IntelliSense. +/** @typedef {import("../shared/types").ConfigData} ConfigData */ +/** @typedef {import("../shared/types").Parser} Parser */ +/** @typedef {import("../shared/types").Plugin} Plugin */ +/** @typedef {ReturnType} ConfigArray */ + +/** + * @typedef {Object} CascadingConfigArrayFactoryOptions + * @property {Map} [additionalPluginPool] The map for additional plugins. + * @property {ConfigData} [baseConfig] The config by `baseConfig` option. + * @property {ConfigData} [cliConfig] The config by CLI options (`--env`, `--global`, `--ignore-pattern`, `--parser`, `--parser-options`, `--plugin`, and `--rule`). CLI options overwrite the setting in config files. + * @property {string} [cwd] The base directory to start lookup. + * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`. + * @property {string[]} [rulePaths] The value of `--rulesdir` option. + * @property {string} [specificConfigPath] The value of `--config` option. + * @property {boolean} [useEslintrc] if `false` then it doesn't load config files. + */ + +/** + * @typedef {Object} CascadingConfigArrayFactoryInternalSlots + * @property {ConfigArray} baseConfigArray The config array of `baseConfig` option. + * @property {ConfigData} baseConfigData The config data of `baseConfig` option. This is used to reset `baseConfigArray`. + * @property {ConfigArray} cliConfigArray The config array of CLI options. + * @property {ConfigData} cliConfigData The config data of CLI options. This is used to reset `cliConfigArray`. + * @property {ConfigArrayFactory} configArrayFactory The factory for config arrays. + * @property {Map} configCache The cache from directory paths to config arrays. + * @property {string} cwd The base directory to start lookup. + * @property {WeakMap} finalizeCache The cache from config arrays to finalized config arrays. + * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`. + * @property {string[]|null} rulePaths The value of `--rulesdir` option. This is used to reset `baseConfigArray`. + * @property {string|null} specificConfigPath The value of `--config` option. This is used to reset `cliConfigArray`. + * @property {boolean} useEslintrc if `false` then it doesn't load config files. + */ + +/** @type {WeakMap} */ +const internalSlotsMap = new WeakMap(); + +/** + * Create the config array from `baseConfig` and `rulePaths`. + * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots. + * @returns {ConfigArray} The config array of the base configs. + */ +function createBaseConfigArray({ + configArrayFactory, + baseConfigData, + rulePaths, + cwd +}) { + const baseConfigArray = configArrayFactory.create( + baseConfigData, + { name: "BaseConfig" } + ); + + /* + * Create the config array element for the default ignore patterns. + * This element has `ignorePattern` property that ignores the default + * patterns in the current working directory. + */ + baseConfigArray.unshift(configArrayFactory.create( + { ignorePatterns: IgnorePattern.DefaultPatterns }, + { name: "DefaultIgnorePattern" } + )[0]); + + /* + * Load rules `--rulesdir` option as a pseudo plugin. + * Use a pseudo plugin to define rules of `--rulesdir`, so we can validate + * the rule's options with only information in the config array. + */ + if (rulePaths && rulePaths.length > 0) { + baseConfigArray.push({ + type: "config", + name: "--rulesdir", + filePath: "", + plugins: { + "": new ConfigDependency({ + definition: { + rules: rulePaths.reduce( + (map, rulesPath) => Object.assign( + map, + loadRules(rulesPath, cwd) + ), + {} + ) + }, + filePath: "", + id: "", + importerName: "--rulesdir", + importerPath: "" + }) + } + }); + } + + return baseConfigArray; +} + +/** + * Create the config array from CLI options. + * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots. + * @returns {ConfigArray} The config array of the base configs. + */ +function createCLIConfigArray({ + cliConfigData, + configArrayFactory, + cwd, + ignorePath, + specificConfigPath +}) { + const cliConfigArray = configArrayFactory.create( + cliConfigData, + { name: "CLIOptions" } + ); + + cliConfigArray.unshift( + ...(ignorePath + ? configArrayFactory.loadESLintIgnore(ignorePath) + : configArrayFactory.loadDefaultESLintIgnore()) + ); + + if (specificConfigPath) { + cliConfigArray.unshift( + ...configArrayFactory.loadFile( + specificConfigPath, + { name: "--config", basePath: cwd } + ) + ); + } + + return cliConfigArray; +} + +/** + * The error type when there are files matched by a glob, but all of them have been ignored. + */ +class ConfigurationNotFoundError extends Error { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {string} directoryPath The directory path. + */ + constructor(directoryPath) { + super(`No ESLint configuration found in ${directoryPath}.`); + this.messageTemplate = "no-config-found"; + this.messageData = { directoryPath }; + } +} + +/** + * This class provides the functionality that enumerates every file which is + * matched by given glob patterns and that configuration. + */ +class CascadingConfigArrayFactory { + + /** + * Initialize this enumerator. + * @param {CascadingConfigArrayFactoryOptions} options The options. + */ + constructor({ + additionalPluginPool = new Map(), + baseConfig: baseConfigData = null, + cliConfig: cliConfigData = null, + cwd = process.cwd(), + ignorePath, + resolvePluginsRelativeTo, + rulePaths = [], + specificConfigPath = null, + useEslintrc = true + } = {}) { + const configArrayFactory = new ConfigArrayFactory({ + additionalPluginPool, + cwd, + resolvePluginsRelativeTo + }); + + internalSlotsMap.set(this, { + baseConfigArray: createBaseConfigArray({ + baseConfigData, + configArrayFactory, + cwd, + rulePaths + }), + baseConfigData, + cliConfigArray: createCLIConfigArray({ + cliConfigData, + configArrayFactory, + cwd, + ignorePath, + specificConfigPath + }), + cliConfigData, + configArrayFactory, + configCache: new Map(), + cwd, + finalizeCache: new WeakMap(), + ignorePath, + rulePaths, + specificConfigPath, + useEslintrc + }); + } + + /** + * The path to the current working directory. + * This is used by tests. + * @type {string} + */ + get cwd() { + const { cwd } = internalSlotsMap.get(this); + + return cwd; + } + + /** + * Get the config array of a given file. + * If `filePath` was not given, it returns the config which contains only + * `baseConfigData` and `cliConfigData`. + * @param {string} [filePath] The file path to a file. + * @param {Object} [options] The options. + * @param {boolean} [options.ignoreNotFoundError] If `true` then it doesn't throw `ConfigurationNotFoundError`. + * @returns {ConfigArray} The config array of the file. + */ + getConfigArrayForFile(filePath, { ignoreNotFoundError = false } = {}) { + const { + baseConfigArray, + cliConfigArray, + cwd + } = internalSlotsMap.get(this); + + if (!filePath) { + return new ConfigArray(...baseConfigArray, ...cliConfigArray); + } + + const directoryPath = path.dirname(path.resolve(cwd, filePath)); + + debug(`Load config files for ${directoryPath}.`); + + return this._finalizeConfigArray( + this._loadConfigInAncestors(directoryPath), + directoryPath, + ignoreNotFoundError + ); + } + + /** + * Set the config data to override all configs. + * Require to call `clearCache()` method after this method is called. + * @param {ConfigData} configData The config data to override all configs. + * @returns {void} + */ + setOverrideConfig(configData) { + const slots = internalSlotsMap.get(this); + + slots.cliConfigData = configData; + } + + /** + * Clear config cache. + * @returns {void} + */ + clearCache() { + const slots = internalSlotsMap.get(this); + + slots.baseConfigArray = createBaseConfigArray(slots); + slots.cliConfigArray = createCLIConfigArray(slots); + slots.configCache.clear(); + } + + /** + * Load and normalize config files from the ancestor directories. + * @param {string} directoryPath The path to a leaf directory. + * @param {boolean} configsExistInSubdirs `true` if configurations exist in subdirectories. + * @returns {ConfigArray} The loaded config. + * @private + */ + _loadConfigInAncestors(directoryPath, configsExistInSubdirs = false) { + const { + baseConfigArray, + configArrayFactory, + configCache, + cwd, + useEslintrc + } = internalSlotsMap.get(this); + + if (!useEslintrc) { + return baseConfigArray; + } + + let configArray = configCache.get(directoryPath); + + // Hit cache. + if (configArray) { + debug(`Cache hit: ${directoryPath}.`); + return configArray; + } + debug(`No cache found: ${directoryPath}.`); + + const homePath = os.homedir(); + + // Consider this is root. + if (directoryPath === homePath && cwd !== homePath) { + debug("Stop traversing because of considered root."); + if (configsExistInSubdirs) { + const filePath = ConfigArrayFactory.getPathToConfigFileInDirectory(directoryPath); + + if (filePath) { + emitDeprecationWarning( + filePath, + "ESLINT_PERSONAL_CONFIG_SUPPRESS" + ); + } + } + return this._cacheConfig(directoryPath, baseConfigArray); + } + + // Load the config on this directory. + try { + configArray = configArrayFactory.loadInDirectory(directoryPath); + } catch (error) { + /* istanbul ignore next */ + if (error.code === "EACCES") { + debug("Stop traversing because of 'EACCES' error."); + return this._cacheConfig(directoryPath, baseConfigArray); + } + throw error; + } + + if (configArray.length > 0 && configArray.isRoot()) { + debug("Stop traversing because of 'root:true'."); + configArray.unshift(...baseConfigArray); + return this._cacheConfig(directoryPath, configArray); + } + + // Load from the ancestors and merge it. + const parentPath = path.dirname(directoryPath); + const parentConfigArray = parentPath && parentPath !== directoryPath + ? this._loadConfigInAncestors( + parentPath, + configsExistInSubdirs || configArray.length > 0 + ) + : baseConfigArray; + + if (configArray.length > 0) { + configArray.unshift(...parentConfigArray); + } else { + configArray = parentConfigArray; + } + + // Cache and return. + return this._cacheConfig(directoryPath, configArray); + } + + /** + * Freeze and cache a given config. + * @param {string} directoryPath The path to a directory as a cache key. + * @param {ConfigArray} configArray The config array as a cache value. + * @returns {ConfigArray} The `configArray` (frozen). + */ + _cacheConfig(directoryPath, configArray) { + const { configCache } = internalSlotsMap.get(this); + + Object.freeze(configArray); + configCache.set(directoryPath, configArray); + + return configArray; + } + + /** + * Finalize a given config array. + * Concatenate `--config` and other CLI options. + * @param {ConfigArray} configArray The parent config array. + * @param {string} directoryPath The path to the leaf directory to find config files. + * @param {boolean} ignoreNotFoundError If `true` then it doesn't throw `ConfigurationNotFoundError`. + * @returns {ConfigArray} The loaded config. + * @private + */ + _finalizeConfigArray(configArray, directoryPath, ignoreNotFoundError) { + const { + cliConfigArray, + configArrayFactory, + finalizeCache, + useEslintrc + } = internalSlotsMap.get(this); + + let finalConfigArray = finalizeCache.get(configArray); + + if (!finalConfigArray) { + finalConfigArray = configArray; + + // Load the personal config if there are no regular config files. + if ( + useEslintrc && + configArray.every(c => !c.filePath) && + cliConfigArray.every(c => !c.filePath) // `--config` option can be a file. + ) { + const homePath = os.homedir(); + + debug("Loading the config file of the home directory:", homePath); + + const personalConfigArray = configArrayFactory.loadInDirectory( + homePath, + { name: "PersonalConfig" } + ); + + if ( + personalConfigArray.length > 0 && + !directoryPath.startsWith(homePath) + ) { + const lastElement = + personalConfigArray[personalConfigArray.length - 1]; + + emitDeprecationWarning( + lastElement.filePath, + "ESLINT_PERSONAL_CONFIG_LOAD" + ); + } + + finalConfigArray = finalConfigArray.concat(personalConfigArray); + } + + // Apply CLI options. + if (cliConfigArray.length > 0) { + finalConfigArray = finalConfigArray.concat(cliConfigArray); + } + + // Validate rule settings and environments. + validateConfigArray(finalConfigArray); + + // Cache it. + Object.freeze(finalConfigArray); + finalizeCache.set(configArray, finalConfigArray); + + debug( + "Configuration was determined: %o on %s", + finalConfigArray, + directoryPath + ); + } + + // At least one element (the default ignore patterns) exists. + if (!ignoreNotFoundError && useEslintrc && finalConfigArray.length <= 1) { + throw new ConfigurationNotFoundError(directoryPath); + } + + return finalConfigArray; + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { CascadingConfigArrayFactory }; diff --git a/node_modules/eslint/lib/cli-engine/cli-engine.js b/node_modules/eslint/lib/cli-engine/cli-engine.js new file mode 100644 index 000000000..70c6f6f39 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/cli-engine.js @@ -0,0 +1,1026 @@ +/** + * @fileoverview Main CLI object. + * @author Nicholas C. Zakas + */ + +"use strict"; + +/* + * The CLI object should *not* call process.exit() directly. It should only return + * exit codes. This allows other programs to use the CLI object and still control + * when the program exits. + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const fs = require("fs"); +const path = require("path"); +const defaultOptions = require("../../conf/default-cli-options"); +const pkg = require("../../package.json"); +const ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops"); +const naming = require("@eslint/eslintrc/lib/shared/naming"); +const ModuleResolver = require("../shared/relative-module-resolver"); +const { Linter } = require("../linter"); +const builtInRules = require("../rules"); +const { CascadingConfigArrayFactory } = require("./cascading-config-array-factory"); +const { IgnorePattern, getUsedExtractedConfigs } = require("./config-array"); +const { FileEnumerator } = require("./file-enumerator"); +const hash = require("./hash"); +const LintResultCache = require("./lint-result-cache"); + +const debug = require("debug")("eslint:cli-engine"); +const validFixTypes = new Set(["problem", "suggestion", "layout"]); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +// For VSCode IntelliSense +/** @typedef {import("../shared/types").ConfigData} ConfigData */ +/** @typedef {import("../shared/types").DeprecatedRuleInfo} DeprecatedRuleInfo */ +/** @typedef {import("../shared/types").LintMessage} LintMessage */ +/** @typedef {import("../shared/types").ParserOptions} ParserOptions */ +/** @typedef {import("../shared/types").Plugin} Plugin */ +/** @typedef {import("../shared/types").RuleConf} RuleConf */ +/** @typedef {import("../shared/types").Rule} Rule */ +/** @typedef {ReturnType} ConfigArray */ +/** @typedef {ReturnType} ExtractedConfig */ + +/** + * The options to configure a CLI engine with. + * @typedef {Object} CLIEngineOptions + * @property {boolean} [allowInlineConfig] Enable or disable inline configuration comments. + * @property {ConfigData} [baseConfig] Base config object, extended by all configs used with this CLIEngine instance + * @property {boolean} [cache] Enable result caching. + * @property {string} [cacheLocation] The cache file to use instead of .eslintcache. + * @property {string} [configFile] The configuration file to use. + * @property {string} [cwd] The value to use for the current working directory. + * @property {string[]} [envs] An array of environments to load. + * @property {string[]|null} [extensions] An array of file extensions to check. + * @property {boolean|Function} [fix] Execute in autofix mode. If a function, should return a boolean. + * @property {string[]} [fixTypes] Array of rule types to apply fixes for. + * @property {string[]} [globals] An array of global variables to declare. + * @property {boolean} [ignore] False disables use of .eslintignore. + * @property {string} [ignorePath] The ignore file to use instead of .eslintignore. + * @property {string|string[]} [ignorePattern] One or more glob patterns to ignore. + * @property {boolean} [useEslintrc] False disables looking for .eslintrc + * @property {string} [parser] The name of the parser to use. + * @property {ParserOptions} [parserOptions] An object of parserOption settings to use. + * @property {string[]} [plugins] An array of plugins to load. + * @property {Record} [rules] An object of rules to use. + * @property {string[]} [rulePaths] An array of directories to load custom rules from. + * @property {boolean} [reportUnusedDisableDirectives] `true` adds reports for unused eslint-disable directives + * @property {boolean} [globInputPaths] Set to false to skip glob resolution of input file paths to lint (default: true). If false, each input file paths is assumed to be a non-glob path to an existing file. + * @property {string} [resolvePluginsRelativeTo] The folder where plugins should be resolved from, defaulting to the CWD + */ + +/** + * A linting result. + * @typedef {Object} LintResult + * @property {string} filePath The path to the file that was linted. + * @property {LintMessage[]} messages All of the messages for the result. + * @property {number} errorCount Number of errors for the result. + * @property {number} warningCount Number of warnings for the result. + * @property {number} fixableErrorCount Number of fixable errors for the result. + * @property {number} fixableWarningCount Number of fixable warnings for the result. + * @property {string} [source] The source code of the file that was linted. + * @property {string} [output] The source code of the file that was linted, with as many fixes applied as possible. + */ + +/** + * Linting results. + * @typedef {Object} LintReport + * @property {LintResult[]} results All of the result. + * @property {number} errorCount Number of errors for the result. + * @property {number} warningCount Number of warnings for the result. + * @property {number} fixableErrorCount Number of fixable errors for the result. + * @property {number} fixableWarningCount Number of fixable warnings for the result. + * @property {DeprecatedRuleInfo[]} usedDeprecatedRules The list of used deprecated rules. + */ + +/** + * Private data for CLIEngine. + * @typedef {Object} CLIEngineInternalSlots + * @property {Map} additionalPluginPool The map for additional plugins. + * @property {string} cacheFilePath The path to the cache of lint results. + * @property {CascadingConfigArrayFactory} configArrayFactory The factory of configs. + * @property {(filePath: string) => boolean} defaultIgnores The default predicate function to check if a file ignored or not. + * @property {FileEnumerator} fileEnumerator The file enumerator. + * @property {ConfigArray[]} lastConfigArrays The list of config arrays that the last `executeOnFiles` or `executeOnText` used. + * @property {LintResultCache|null} lintResultCache The cache of lint results. + * @property {Linter} linter The linter instance which has loaded rules. + * @property {CLIEngineOptions} options The normalized options of this instance. + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** @type {WeakMap} */ +const internalSlotsMap = new WeakMap(); + +/** + * Determines if each fix type in an array is supported by ESLint and throws + * an error if not. + * @param {string[]} fixTypes An array of fix types to check. + * @returns {void} + * @throws {Error} If an invalid fix type is found. + */ +function validateFixTypes(fixTypes) { + for (const fixType of fixTypes) { + if (!validFixTypes.has(fixType)) { + throw new Error(`Invalid fix type "${fixType}" found.`); + } + } +} + +/** + * It will calculate the error and warning count for collection of messages per file + * @param {LintMessage[]} messages Collection of messages + * @returns {Object} Contains the stats + * @private + */ +function calculateStatsPerFile(messages) { + return messages.reduce((stat, message) => { + if (message.fatal || message.severity === 2) { + stat.errorCount++; + if (message.fix) { + stat.fixableErrorCount++; + } + } else { + stat.warningCount++; + if (message.fix) { + stat.fixableWarningCount++; + } + } + return stat; + }, { + errorCount: 0, + warningCount: 0, + fixableErrorCount: 0, + fixableWarningCount: 0 + }); +} + +/** + * It will calculate the error and warning count for collection of results from all files + * @param {LintResult[]} results Collection of messages from all the files + * @returns {Object} Contains the stats + * @private + */ +function calculateStatsPerRun(results) { + return results.reduce((stat, result) => { + stat.errorCount += result.errorCount; + stat.warningCount += result.warningCount; + stat.fixableErrorCount += result.fixableErrorCount; + stat.fixableWarningCount += result.fixableWarningCount; + return stat; + }, { + errorCount: 0, + warningCount: 0, + fixableErrorCount: 0, + fixableWarningCount: 0 + }); +} + +/** + * Processes an source code using ESLint. + * @param {Object} config The config object. + * @param {string} config.text The source code to verify. + * @param {string} config.cwd The path to the current working directory. + * @param {string|undefined} config.filePath The path to the file of `text`. If this is undefined, it uses ``. + * @param {ConfigArray} config.config The config. + * @param {boolean} config.fix If `true` then it does fix. + * @param {boolean} config.allowInlineConfig If `true` then it uses directive comments. + * @param {boolean} config.reportUnusedDisableDirectives If `true` then it reports unused `eslint-disable` comments. + * @param {FileEnumerator} config.fileEnumerator The file enumerator to check if a path is a target or not. + * @param {Linter} config.linter The linter instance to verify. + * @returns {LintResult} The result of linting. + * @private + */ +function verifyText({ + text, + cwd, + filePath: providedFilePath, + config, + fix, + allowInlineConfig, + reportUnusedDisableDirectives, + fileEnumerator, + linter +}) { + const filePath = providedFilePath || ""; + + debug(`Lint ${filePath}`); + + /* + * Verify. + * `config.extractConfig(filePath)` requires an absolute path, but `linter` + * doesn't know CWD, so it gives `linter` an absolute path always. + */ + const filePathToVerify = filePath === "" ? path.join(cwd, filePath) : filePath; + const { fixed, messages, output } = linter.verifyAndFix( + text, + config, + { + allowInlineConfig, + filename: filePathToVerify, + fix, + reportUnusedDisableDirectives, + + /** + * Check if the linter should adopt a given code block or not. + * @param {string} blockFilename The virtual filename of a code block. + * @returns {boolean} `true` if the linter should adopt the code block. + */ + filterCodeBlock(blockFilename) { + return fileEnumerator.isTargetPath(blockFilename); + } + } + ); + + // Tweak and return. + const result = { + filePath, + messages, + ...calculateStatsPerFile(messages) + }; + + if (fixed) { + result.output = output; + } + if ( + result.errorCount + result.warningCount > 0 && + typeof result.output === "undefined" + ) { + result.source = text; + } + + return result; +} + +/** + * Returns result with warning by ignore settings + * @param {string} filePath File path of checked code + * @param {string} baseDir Absolute path of base directory + * @returns {LintResult} Result with single warning + * @private + */ +function createIgnoreResult(filePath, baseDir) { + let message; + const isHidden = filePath.split(path.sep) + .find(segment => /^\./u.test(segment)); + const isInNodeModules = baseDir && path.relative(baseDir, filePath).startsWith("node_modules"); + + if (isHidden) { + message = "File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."; + } else if (isInNodeModules) { + message = "File ignored by default. Use \"--ignore-pattern '!node_modules/*'\" to override."; + } else { + message = "File ignored because of a matching ignore pattern. Use \"--no-ignore\" to override."; + } + + return { + filePath: path.resolve(filePath), + messages: [ + { + fatal: false, + severity: 1, + message + } + ], + errorCount: 0, + warningCount: 1, + fixableErrorCount: 0, + fixableWarningCount: 0 + }; +} + +/** + * Get a rule. + * @param {string} ruleId The rule ID to get. + * @param {ConfigArray[]} configArrays The config arrays that have plugin rules. + * @returns {Rule|null} The rule or null. + */ +function getRule(ruleId, configArrays) { + for (const configArray of configArrays) { + const rule = configArray.pluginRules.get(ruleId); + + if (rule) { + return rule; + } + } + return builtInRules.get(ruleId) || null; +} + +/** + * Collect used deprecated rules. + * @param {ConfigArray[]} usedConfigArrays The config arrays which were used. + * @returns {IterableIterator} Used deprecated rules. + */ +function *iterateRuleDeprecationWarnings(usedConfigArrays) { + const processedRuleIds = new Set(); + + // Flatten used configs. + /** @type {ExtractedConfig[]} */ + const configs = [].concat( + ...usedConfigArrays.map(getUsedExtractedConfigs) + ); + + // Traverse rule configs. + for (const config of configs) { + for (const [ruleId, ruleConfig] of Object.entries(config.rules)) { + + // Skip if it was processed. + if (processedRuleIds.has(ruleId)) { + continue; + } + processedRuleIds.add(ruleId); + + // Skip if it's not used. + if (!ConfigOps.getRuleSeverity(ruleConfig)) { + continue; + } + const rule = getRule(ruleId, usedConfigArrays); + + // Skip if it's not deprecated. + if (!(rule && rule.meta && rule.meta.deprecated)) { + continue; + } + + // This rule was used and deprecated. + yield { + ruleId, + replacedBy: rule.meta.replacedBy || [] + }; + } + } +} + +/** + * Checks if the given message is an error message. + * @param {LintMessage} message The message to check. + * @returns {boolean} Whether or not the message is an error message. + * @private + */ +function isErrorMessage(message) { + return message.severity === 2; +} + + +/** + * return the cacheFile to be used by eslint, based on whether the provided parameter is + * a directory or looks like a directory (ends in `path.sep`), in which case the file + * name will be the `cacheFile/.cache_hashOfCWD` + * + * if cacheFile points to a file or looks like a file then in will just use that file + * @param {string} cacheFile The name of file to be used to store the cache + * @param {string} cwd Current working directory + * @returns {string} the resolved path to the cache file + */ +function getCacheFile(cacheFile, cwd) { + + /* + * make sure the path separators are normalized for the environment/os + * keeping the trailing path separator if present + */ + const normalizedCacheFile = path.normalize(cacheFile); + + const resolvedCacheFile = path.resolve(cwd, normalizedCacheFile); + const looksLikeADirectory = normalizedCacheFile.slice(-1) === path.sep; + + /** + * return the name for the cache file in case the provided parameter is a directory + * @returns {string} the resolved path to the cacheFile + */ + function getCacheFileForDirectory() { + return path.join(resolvedCacheFile, `.cache_${hash(cwd)}`); + } + + let fileStats; + + try { + fileStats = fs.lstatSync(resolvedCacheFile); + } catch { + fileStats = null; + } + + + /* + * in case the file exists we need to verify if the provided path + * is a directory or a file. If it is a directory we want to create a file + * inside that directory + */ + if (fileStats) { + + /* + * is a directory or is a file, but the original file the user provided + * looks like a directory but `path.resolve` removed the `last path.sep` + * so we need to still treat this like a directory + */ + if (fileStats.isDirectory() || looksLikeADirectory) { + return getCacheFileForDirectory(); + } + + // is file so just use that file + return resolvedCacheFile; + } + + /* + * here we known the file or directory doesn't exist, + * so we will try to infer if its a directory if it looks like a directory + * for the current operating system. + */ + + // if the last character passed is a path separator we assume is a directory + if (looksLikeADirectory) { + return getCacheFileForDirectory(); + } + + return resolvedCacheFile; +} + +/** + * Convert a string array to a boolean map. + * @param {string[]|null} keys The keys to assign true. + * @param {boolean} defaultValue The default value for each property. + * @param {string} displayName The property name which is used in error message. + * @returns {Record} The boolean map. + */ +function toBooleanMap(keys, defaultValue, displayName) { + if (keys && !Array.isArray(keys)) { + throw new Error(`${displayName} must be an array.`); + } + if (keys && keys.length > 0) { + return keys.reduce((map, def) => { + const [key, value] = def.split(":"); + + if (key !== "__proto__") { + map[key] = value === void 0 + ? defaultValue + : value === "true"; + } + + return map; + }, {}); + } + return void 0; +} + +/** + * Create a config data from CLI options. + * @param {CLIEngineOptions} options The options + * @returns {ConfigData|null} The created config data. + */ +function createConfigDataFromOptions(options) { + const { + ignorePattern, + parser, + parserOptions, + plugins, + rules + } = options; + const env = toBooleanMap(options.envs, true, "envs"); + const globals = toBooleanMap(options.globals, false, "globals"); + + if ( + env === void 0 && + globals === void 0 && + (ignorePattern === void 0 || ignorePattern.length === 0) && + parser === void 0 && + parserOptions === void 0 && + plugins === void 0 && + rules === void 0 + ) { + return null; + } + return { + env, + globals, + ignorePatterns: ignorePattern, + parser, + parserOptions, + plugins, + rules + }; +} + +/** + * Checks whether a directory exists at the given location + * @param {string} resolvedPath A path from the CWD + * @returns {boolean} `true` if a directory exists + */ +function directoryExists(resolvedPath) { + try { + return fs.statSync(resolvedPath).isDirectory(); + } catch (error) { + if (error && error.code === "ENOENT") { + return false; + } + throw error; + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +class CLIEngine { + + /** + * Creates a new instance of the core CLI engine. + * @param {CLIEngineOptions} providedOptions The options for this instance. + */ + constructor(providedOptions) { + const options = Object.assign( + Object.create(null), + defaultOptions, + { cwd: process.cwd() }, + providedOptions + ); + + if (options.fix === void 0) { + options.fix = false; + } + + const additionalPluginPool = new Map(); + const cacheFilePath = getCacheFile( + options.cacheLocation || options.cacheFile, + options.cwd + ); + const configArrayFactory = new CascadingConfigArrayFactory({ + additionalPluginPool, + baseConfig: options.baseConfig || null, + cliConfig: createConfigDataFromOptions(options), + cwd: options.cwd, + ignorePath: options.ignorePath, + resolvePluginsRelativeTo: options.resolvePluginsRelativeTo, + rulePaths: options.rulePaths, + specificConfigPath: options.configFile, + useEslintrc: options.useEslintrc + }); + const fileEnumerator = new FileEnumerator({ + configArrayFactory, + cwd: options.cwd, + extensions: options.extensions, + globInputPaths: options.globInputPaths, + errorOnUnmatchedPattern: options.errorOnUnmatchedPattern, + ignore: options.ignore + }); + const lintResultCache = + options.cache ? new LintResultCache(cacheFilePath) : null; + const linter = new Linter({ cwd: options.cwd }); + + /** @type {ConfigArray[]} */ + const lastConfigArrays = [configArrayFactory.getConfigArrayForFile()]; + + // Store private data. + internalSlotsMap.set(this, { + additionalPluginPool, + cacheFilePath, + configArrayFactory, + defaultIgnores: IgnorePattern.createDefaultIgnore(options.cwd), + fileEnumerator, + lastConfigArrays, + lintResultCache, + linter, + options + }); + + // setup special filter for fixes + if (options.fix && options.fixTypes && options.fixTypes.length > 0) { + debug(`Using fix types ${options.fixTypes}`); + + // throw an error if any invalid fix types are found + validateFixTypes(options.fixTypes); + + // convert to Set for faster lookup + const fixTypes = new Set(options.fixTypes); + + // save original value of options.fix in case it's a function + const originalFix = (typeof options.fix === "function") + ? options.fix : () => true; + + options.fix = message => { + const rule = message.ruleId && getRule(message.ruleId, lastConfigArrays); + const matches = rule && rule.meta && fixTypes.has(rule.meta.type); + + return matches && originalFix(message); + }; + } + } + + getRules() { + const { lastConfigArrays } = internalSlotsMap.get(this); + + return new Map(function *() { + yield* builtInRules; + + for (const configArray of lastConfigArrays) { + yield* configArray.pluginRules; + } + }()); + } + + /** + * Returns results that only contains errors. + * @param {LintResult[]} results The results to filter. + * @returns {LintResult[]} The filtered results. + */ + static getErrorResults(results) { + const filtered = []; + + results.forEach(result => { + const filteredMessages = result.messages.filter(isErrorMessage); + + if (filteredMessages.length > 0) { + filtered.push({ + ...result, + messages: filteredMessages, + errorCount: filteredMessages.length, + warningCount: 0, + fixableErrorCount: result.fixableErrorCount, + fixableWarningCount: 0 + }); + } + }); + + return filtered; + } + + /** + * Outputs fixes from the given results to files. + * @param {LintReport} report The report object created by CLIEngine. + * @returns {void} + */ + static outputFixes(report) { + report.results.filter(result => Object.prototype.hasOwnProperty.call(result, "output")).forEach(result => { + fs.writeFileSync(result.filePath, result.output); + }); + } + + + /** + * Add a plugin by passing its configuration + * @param {string} name Name of the plugin. + * @param {Plugin} pluginObject Plugin configuration object. + * @returns {void} + */ + addPlugin(name, pluginObject) { + const { + additionalPluginPool, + configArrayFactory, + lastConfigArrays + } = internalSlotsMap.get(this); + + additionalPluginPool.set(name, pluginObject); + configArrayFactory.clearCache(); + lastConfigArrays.length = 1; + lastConfigArrays[0] = configArrayFactory.getConfigArrayForFile(); + } + + /** + * Resolves the patterns passed into executeOnFiles() into glob-based patterns + * for easier handling. + * @param {string[]} patterns The file patterns passed on the command line. + * @returns {string[]} The equivalent glob patterns. + */ + resolveFileGlobPatterns(patterns) { + const { options } = internalSlotsMap.get(this); + + if (options.globInputPaths === false) { + return patterns.filter(Boolean); + } + + const extensions = (options.extensions || [".js"]).map(ext => ext.replace(/^\./u, "")); + const dirSuffix = `/**/*.{${extensions.join(",")}}`; + + return patterns.filter(Boolean).map(pathname => { + const resolvedPath = path.resolve(options.cwd, pathname); + const newPath = directoryExists(resolvedPath) + ? pathname.replace(/[/\\]$/u, "") + dirSuffix + : pathname; + + return path.normalize(newPath).replace(/\\/gu, "/"); + }); + } + + /** + * Executes the current configuration on an array of file and directory names. + * @param {string[]} patterns An array of file and directory names. + * @returns {LintReport} The results for all files that were linted. + */ + executeOnFiles(patterns) { + const { + cacheFilePath, + fileEnumerator, + lastConfigArrays, + lintResultCache, + linter, + options: { + allowInlineConfig, + cache, + cwd, + fix, + reportUnusedDisableDirectives + } + } = internalSlotsMap.get(this); + const results = []; + const startTime = Date.now(); + + // Clear the last used config arrays. + lastConfigArrays.length = 0; + + // Delete cache file; should this do here? + if (!cache) { + try { + fs.unlinkSync(cacheFilePath); + } catch (error) { + const errorCode = error && error.code; + + // Ignore errors when no such file exists or file system is read only (and cache file does not exist) + if (errorCode !== "ENOENT" && !(errorCode === "EROFS" && !fs.existsSync(cacheFilePath))) { + throw error; + } + } + } + + // Iterate source code files. + for (const { config, filePath, ignored } of fileEnumerator.iterateFiles(patterns)) { + if (ignored) { + results.push(createIgnoreResult(filePath, cwd)); + continue; + } + + /* + * Store used configs for: + * - this method uses to collect used deprecated rules. + * - `getRules()` method uses to collect all loaded rules. + * - `--fix-type` option uses to get the loaded rule's meta data. + */ + if (!lastConfigArrays.includes(config)) { + lastConfigArrays.push(config); + } + + // Skip if there is cached result. + if (lintResultCache) { + const cachedResult = + lintResultCache.getCachedLintResults(filePath, config); + + if (cachedResult) { + const hadMessages = + cachedResult.messages && + cachedResult.messages.length > 0; + + if (hadMessages && fix) { + debug(`Reprocessing cached file to allow autofix: ${filePath}`); + } else { + debug(`Skipping file since it hasn't changed: ${filePath}`); + results.push(cachedResult); + continue; + } + } + } + + // Do lint. + const result = verifyText({ + text: fs.readFileSync(filePath, "utf8"), + filePath, + config, + cwd, + fix, + allowInlineConfig, + reportUnusedDisableDirectives, + fileEnumerator, + linter + }); + + results.push(result); + + /* + * Store the lint result in the LintResultCache. + * NOTE: The LintResultCache will remove the file source and any + * other properties that are difficult to serialize, and will + * hydrate those properties back in on future lint runs. + */ + if (lintResultCache) { + lintResultCache.setCachedLintResults(filePath, config, result); + } + } + + // Persist the cache to disk. + if (lintResultCache) { + lintResultCache.reconcile(); + } + + debug(`Linting complete in: ${Date.now() - startTime}ms`); + let usedDeprecatedRules; + + return { + results, + ...calculateStatsPerRun(results), + + // Initialize it lazily because CLI and `ESLint` API don't use it. + get usedDeprecatedRules() { + if (!usedDeprecatedRules) { + usedDeprecatedRules = Array.from( + iterateRuleDeprecationWarnings(lastConfigArrays) + ); + } + return usedDeprecatedRules; + } + }; + } + + /** + * Executes the current configuration on text. + * @param {string} text A string of JavaScript code to lint. + * @param {string} [filename] An optional string representing the texts filename. + * @param {boolean} [warnIgnored] Always warn when a file is ignored + * @returns {LintReport} The results for the linting. + */ + executeOnText(text, filename, warnIgnored) { + const { + configArrayFactory, + fileEnumerator, + lastConfigArrays, + linter, + options: { + allowInlineConfig, + cwd, + fix, + reportUnusedDisableDirectives + } + } = internalSlotsMap.get(this); + const results = []; + const startTime = Date.now(); + const resolvedFilename = filename && path.resolve(cwd, filename); + + + // Clear the last used config arrays. + lastConfigArrays.length = 0; + if (resolvedFilename && this.isPathIgnored(resolvedFilename)) { + if (warnIgnored) { + results.push(createIgnoreResult(resolvedFilename, cwd)); + } + } else { + const config = configArrayFactory.getConfigArrayForFile( + resolvedFilename || "__placeholder__.js" + ); + + /* + * Store used configs for: + * - this method uses to collect used deprecated rules. + * - `getRules()` method uses to collect all loaded rules. + * - `--fix-type` option uses to get the loaded rule's meta data. + */ + lastConfigArrays.push(config); + + // Do lint. + results.push(verifyText({ + text, + filePath: resolvedFilename, + config, + cwd, + fix, + allowInlineConfig, + reportUnusedDisableDirectives, + fileEnumerator, + linter + })); + } + + debug(`Linting complete in: ${Date.now() - startTime}ms`); + let usedDeprecatedRules; + + return { + results, + ...calculateStatsPerRun(results), + + // Initialize it lazily because CLI and `ESLint` API don't use it. + get usedDeprecatedRules() { + if (!usedDeprecatedRules) { + usedDeprecatedRules = Array.from( + iterateRuleDeprecationWarnings(lastConfigArrays) + ); + } + return usedDeprecatedRules; + } + }; + } + + /** + * Returns a configuration object for the given file based on the CLI options. + * This is the same logic used by the ESLint CLI executable to determine + * configuration for each file it processes. + * @param {string} filePath The path of the file to retrieve a config object for. + * @returns {ConfigData} A configuration object for the file. + */ + getConfigForFile(filePath) { + const { configArrayFactory, options } = internalSlotsMap.get(this); + const absolutePath = path.resolve(options.cwd, filePath); + + if (directoryExists(absolutePath)) { + throw Object.assign( + new Error("'filePath' should not be a directory path."), + { messageTemplate: "print-config-with-directory-path" } + ); + } + + return configArrayFactory + .getConfigArrayForFile(absolutePath) + .extractConfig(absolutePath) + .toCompatibleObjectAsConfigFileContent(); + } + + /** + * Checks if a given path is ignored by ESLint. + * @param {string} filePath The path of the file to check. + * @returns {boolean} Whether or not the given path is ignored. + */ + isPathIgnored(filePath) { + const { + configArrayFactory, + defaultIgnores, + options: { cwd, ignore } + } = internalSlotsMap.get(this); + const absolutePath = path.resolve(cwd, filePath); + + if (ignore) { + const config = configArrayFactory + .getConfigArrayForFile(absolutePath) + .extractConfig(absolutePath); + const ignores = config.ignores || defaultIgnores; + + return ignores(absolutePath); + } + + return defaultIgnores(absolutePath); + } + + /** + * Returns the formatter representing the given format or null if the `format` is not a string. + * @param {string} [format] The name of the format to load or the path to a + * custom formatter. + * @returns {(Function|null)} The formatter function or null if the `format` is not a string. + */ + getFormatter(format) { + + // default is stylish + const resolvedFormatName = format || "stylish"; + + // only strings are valid formatters + if (typeof resolvedFormatName === "string") { + + // replace \ with / for Windows compatibility + const normalizedFormatName = resolvedFormatName.replace(/\\/gu, "/"); + + const slots = internalSlotsMap.get(this); + const cwd = slots ? slots.options.cwd : process.cwd(); + const namespace = naming.getNamespaceFromTerm(normalizedFormatName); + + let formatterPath; + + // if there's a slash, then it's a file (TODO: this check seems dubious for scoped npm packages) + if (!namespace && normalizedFormatName.indexOf("/") > -1) { + formatterPath = path.resolve(cwd, normalizedFormatName); + } else { + try { + const npmFormat = naming.normalizePackageName(normalizedFormatName, "eslint-formatter"); + + formatterPath = ModuleResolver.resolve(npmFormat, path.join(cwd, "__placeholder__.js")); + } catch { + formatterPath = path.resolve(__dirname, "formatters", normalizedFormatName); + } + } + + try { + return require(formatterPath); + } catch (ex) { + ex.message = `There was a problem loading formatter: ${formatterPath}\nError: ${ex.message}`; + throw ex; + } + + } else { + return null; + } + } +} + +CLIEngine.version = pkg.version; +CLIEngine.getFormatter = CLIEngine.prototype.getFormatter; + +module.exports = { + CLIEngine, + + /** + * Get the internal slots of a given CLIEngine instance for tests. + * @param {CLIEngine} instance The CLIEngine instance to get. + * @returns {CLIEngineInternalSlots} The internal slots. + */ + getCLIEngineInternalSlots(instance) { + return internalSlotsMap.get(instance); + } +}; diff --git a/node_modules/eslint/lib/cli-engine/config-array-factory.js b/node_modules/eslint/lib/cli-engine/config-array-factory.js new file mode 100644 index 000000000..2c7a79b49 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/config-array-factory.js @@ -0,0 +1,1092 @@ +/* + * STOP!!! DO NOT MODIFY. + * + * This file is part of the ongoing work to move the eslintrc-style config + * system into the @eslint/eslintrc package. This file needs to remain + * unchanged in order for this work to proceed. + * + * If you think you need to change this file, please contact @nzakas first. + * + * Thanks in advance for your cooperation. + */ + +/** + * @fileoverview The factory of `ConfigArray` objects. + * + * This class provides methods to create `ConfigArray` instance. + * + * - `create(configData, options)` + * Create a `ConfigArray` instance from a config data. This is to handle CLI + * options except `--config`. + * - `loadFile(filePath, options)` + * Create a `ConfigArray` instance from a config file. This is to handle + * `--config` option. If the file was not found, throws the following error: + * - If the filename was `*.js`, a `MODULE_NOT_FOUND` error. + * - If the filename was `package.json`, an IO error or an + * `ESLINT_CONFIG_FIELD_NOT_FOUND` error. + * - Otherwise, an IO error such as `ENOENT`. + * - `loadInDirectory(directoryPath, options)` + * Create a `ConfigArray` instance from a config file which is on a given + * directory. This tries to load `.eslintrc.*` or `package.json`. If not + * found, returns an empty `ConfigArray`. + * - `loadESLintIgnore(filePath)` + * Create a `ConfigArray` instance from a config file that is `.eslintignore` + * format. This is to handle `--ignore-path` option. + * - `loadDefaultESLintIgnore()` + * Create a `ConfigArray` instance from `.eslintignore` or `package.json` in + * the current working directory. + * + * `ConfigArrayFactory` class has the responsibility that loads configuration + * files, including loading `extends`, `parser`, and `plugins`. The created + * `ConfigArray` instance has the loaded `extends`, `parser`, and `plugins`. + * + * But this class doesn't handle cascading. `CascadingConfigArrayFactory` class + * handles cascading and hierarchy. + * + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const fs = require("fs"); +const path = require("path"); +const importFresh = require("import-fresh"); +const stripComments = require("strip-json-comments"); +const { validateConfigSchema } = require("../shared/config-validator"); +const naming = require("@eslint/eslintrc/lib/shared/naming"); +const ModuleResolver = require("../shared/relative-module-resolver"); +const { + ConfigArray, + ConfigDependency, + IgnorePattern, + OverrideTester +} = require("./config-array"); +const debug = require("debug")("eslint:config-array-factory"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const eslintRecommendedPath = path.resolve(__dirname, "../../conf/eslint-recommended.js"); +const eslintAllPath = path.resolve(__dirname, "../../conf/eslint-all.js"); +const configFilenames = [ + ".eslintrc.js", + ".eslintrc.cjs", + ".eslintrc.yaml", + ".eslintrc.yml", + ".eslintrc.json", + ".eslintrc", + "package.json" +]; + +// Define types for VSCode IntelliSense. +/** @typedef {import("../shared/types").ConfigData} ConfigData */ +/** @typedef {import("../shared/types").OverrideConfigData} OverrideConfigData */ +/** @typedef {import("../shared/types").Parser} Parser */ +/** @typedef {import("../shared/types").Plugin} Plugin */ +/** @typedef {import("./config-array/config-dependency").DependentParser} DependentParser */ +/** @typedef {import("./config-array/config-dependency").DependentPlugin} DependentPlugin */ +/** @typedef {ConfigArray[0]} ConfigArrayElement */ + +/** + * @typedef {Object} ConfigArrayFactoryOptions + * @property {Map} [additionalPluginPool] The map for additional plugins. + * @property {string} [cwd] The path to the current working directory. + * @property {string} [resolvePluginsRelativeTo] A path to the directory that plugins should be resolved from. Defaults to `cwd`. + */ + +/** + * @typedef {Object} ConfigArrayFactoryInternalSlots + * @property {Map} additionalPluginPool The map for additional plugins. + * @property {string} cwd The path to the current working directory. + * @property {string | undefined} resolvePluginsRelativeTo An absolute path the the directory that plugins should be resolved from. + */ + +/** + * @typedef {Object} ConfigArrayFactoryLoadingContext + * @property {string} filePath The path to the current configuration. + * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @property {string} name The name of the current configuration. + * @property {string} pluginBasePath The base path to resolve plugins. + * @property {"config" | "ignore" | "implicit-processor"} type The type of the current configuration. This is `"config"` in normal. This is `"ignore"` if it came from `.eslintignore`. This is `"implicit-processor"` if it came from legacy file-extension processors. + */ + +/** + * @typedef {Object} ConfigArrayFactoryLoadingContext + * @property {string} filePath The path to the current configuration. + * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @property {string} name The name of the current configuration. + * @property {"config" | "ignore" | "implicit-processor"} type The type of the current configuration. This is `"config"` in normal. This is `"ignore"` if it came from `.eslintignore`. This is `"implicit-processor"` if it came from legacy file-extension processors. + */ + +/** @type {WeakMap} */ +const internalSlotsMap = new WeakMap(); + +/** + * Check if a given string is a file path. + * @param {string} nameOrPath A module name or file path. + * @returns {boolean} `true` if the `nameOrPath` is a file path. + */ +function isFilePath(nameOrPath) { + return ( + /^\.{1,2}[/\\]/u.test(nameOrPath) || + path.isAbsolute(nameOrPath) + ); +} + +/** + * Convenience wrapper for synchronously reading file contents. + * @param {string} filePath The filename to read. + * @returns {string} The file contents, with the BOM removed. + * @private + */ +function readFile(filePath) { + return fs.readFileSync(filePath, "utf8").replace(/^\ufeff/u, ""); +} + +/** + * Loads a YAML configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadYAMLConfigFile(filePath) { + debug(`Loading YAML config file: ${filePath}`); + + // lazy load YAML to improve performance when not used + const yaml = require("js-yaml"); + + try { + + // empty YAML file can be null, so always use + return yaml.safeLoad(readFile(filePath)) || {}; + } catch (e) { + debug(`Error reading YAML file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a JSON configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadJSONConfigFile(filePath) { + debug(`Loading JSON config file: ${filePath}`); + + try { + return JSON.parse(stripComments(readFile(filePath))); + } catch (e) { + debug(`Error reading JSON file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + e.messageTemplate = "failed-to-read-json"; + e.messageData = { + path: filePath, + message: e.message + }; + throw e; + } +} + +/** + * Loads a legacy (.eslintrc) configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadLegacyConfigFile(filePath) { + debug(`Loading legacy config file: ${filePath}`); + + // lazy load YAML to improve performance when not used + const yaml = require("js-yaml"); + + try { + return yaml.safeLoad(stripComments(readFile(filePath))) || /* istanbul ignore next */ {}; + } catch (e) { + debug("Error reading YAML file: %s\n%o", filePath, e); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a JavaScript configuration from a file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadJSConfigFile(filePath) { + debug(`Loading JS config file: ${filePath}`); + try { + return importFresh(filePath); + } catch (e) { + debug(`Error reading JavaScript file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a configuration from a package.json file. + * @param {string} filePath The filename to load. + * @returns {ConfigData} The configuration object from the file. + * @throws {Error} If the file cannot be read. + * @private + */ +function loadPackageJSONConfigFile(filePath) { + debug(`Loading package.json config file: ${filePath}`); + try { + const packageData = loadJSONConfigFile(filePath); + + if (!Object.hasOwnProperty.call(packageData, "eslintConfig")) { + throw Object.assign( + new Error("package.json file doesn't have 'eslintConfig' field."), + { code: "ESLINT_CONFIG_FIELD_NOT_FOUND" } + ); + } + + return packageData.eslintConfig; + } catch (e) { + debug(`Error reading package.json file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Loads a `.eslintignore` from a file. + * @param {string} filePath The filename to load. + * @returns {string[]} The ignore patterns from the file. + * @private + */ +function loadESLintIgnoreFile(filePath) { + debug(`Loading .eslintignore file: ${filePath}`); + + try { + return readFile(filePath) + .split(/\r?\n/gu) + .filter(line => line.trim() !== "" && !line.startsWith("#")); + } catch (e) { + debug(`Error reading .eslintignore file: ${filePath}`); + e.message = `Cannot read .eslintignore file: ${filePath}\nError: ${e.message}`; + throw e; + } +} + +/** + * Creates an error to notify about a missing config to extend from. + * @param {string} configName The name of the missing config. + * @param {string} importerName The name of the config that imported the missing config + * @param {string} messageTemplate The text template to source error strings from. + * @returns {Error} The error object to throw + * @private + */ +function configInvalidError(configName, importerName, messageTemplate) { + return Object.assign( + new Error(`Failed to load config "${configName}" to extend from.`), + { + messageTemplate, + messageData: { configName, importerName } + } + ); +} + +/** + * Loads a configuration file regardless of the source. Inspects the file path + * to determine the correctly way to load the config file. + * @param {string} filePath The path to the configuration. + * @returns {ConfigData|null} The configuration information. + * @private + */ +function loadConfigFile(filePath) { + switch (path.extname(filePath)) { + case ".js": + case ".cjs": + return loadJSConfigFile(filePath); + + case ".json": + if (path.basename(filePath) === "package.json") { + return loadPackageJSONConfigFile(filePath); + } + return loadJSONConfigFile(filePath); + + case ".yaml": + case ".yml": + return loadYAMLConfigFile(filePath); + + default: + return loadLegacyConfigFile(filePath); + } +} + +/** + * Write debug log. + * @param {string} request The requested module name. + * @param {string} relativeTo The file path to resolve the request relative to. + * @param {string} filePath The resolved file path. + * @returns {void} + */ +function writeDebugLogForLoading(request, relativeTo, filePath) { + /* istanbul ignore next */ + if (debug.enabled) { + let nameAndVersion = null; + + try { + const packageJsonPath = ModuleResolver.resolve( + `${request}/package.json`, + relativeTo + ); + const { version = "unknown" } = require(packageJsonPath); + + nameAndVersion = `${request}@${version}`; + } catch (error) { + debug("package.json was not found:", error.message); + nameAndVersion = request; + } + + debug("Loaded: %s (%s)", nameAndVersion, filePath); + } +} + +/** + * Create a new context with default values. + * @param {ConfigArrayFactoryInternalSlots} slots The internal slots. + * @param {"config" | "ignore" | "implicit-processor" | undefined} providedType The type of the current configuration. Default is `"config"`. + * @param {string | undefined} providedName The name of the current configuration. Default is the relative path from `cwd` to `filePath`. + * @param {string | undefined} providedFilePath The path to the current configuration. Default is empty string. + * @param {string | undefined} providedMatchBasePath The type of the current configuration. Default is the directory of `filePath` or `cwd`. + * @returns {ConfigArrayFactoryLoadingContext} The created context. + */ +function createContext( + { cwd, resolvePluginsRelativeTo }, + providedType, + providedName, + providedFilePath, + providedMatchBasePath +) { + const filePath = providedFilePath + ? path.resolve(cwd, providedFilePath) + : ""; + const matchBasePath = + (providedMatchBasePath && path.resolve(cwd, providedMatchBasePath)) || + (filePath && path.dirname(filePath)) || + cwd; + const name = + providedName || + (filePath && path.relative(cwd, filePath)) || + ""; + const pluginBasePath = + resolvePluginsRelativeTo || + (filePath && path.dirname(filePath)) || + cwd; + const type = providedType || "config"; + + return { filePath, matchBasePath, name, pluginBasePath, type }; +} + +/** + * Normalize a given plugin. + * - Ensure the object to have four properties: configs, environments, processors, and rules. + * - Ensure the object to not have other properties. + * @param {Plugin} plugin The plugin to normalize. + * @returns {Plugin} The normalized plugin. + */ +function normalizePlugin(plugin) { + return { + configs: plugin.configs || {}, + environments: plugin.environments || {}, + processors: plugin.processors || {}, + rules: plugin.rules || {} + }; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * The factory of `ConfigArray` objects. + */ +class ConfigArrayFactory { + + /** + * Initialize this instance. + * @param {ConfigArrayFactoryOptions} [options] The map for additional plugins. + */ + constructor({ + additionalPluginPool = new Map(), + cwd = process.cwd(), + resolvePluginsRelativeTo + } = {}) { + internalSlotsMap.set(this, { + additionalPluginPool, + cwd, + resolvePluginsRelativeTo: + resolvePluginsRelativeTo && + path.resolve(cwd, resolvePluginsRelativeTo) + }); + } + + /** + * Create `ConfigArray` instance from a config data. + * @param {ConfigData|null} configData The config data to create. + * @param {Object} [options] The options. + * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @param {string} [options.filePath] The path to this config data. + * @param {string} [options.name] The config name. + * @returns {ConfigArray} Loaded config. + */ + create(configData, { basePath, filePath, name } = {}) { + if (!configData) { + return new ConfigArray(); + } + + const slots = internalSlotsMap.get(this); + const ctx = createContext(slots, "config", name, filePath, basePath); + const elements = this._normalizeConfigData(configData, ctx); + + return new ConfigArray(...elements); + } + + /** + * Load a config file. + * @param {string} filePath The path to a config file. + * @param {Object} [options] The options. + * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @param {string} [options.name] The config name. + * @returns {ConfigArray} Loaded config. + */ + loadFile(filePath, { basePath, name } = {}) { + const slots = internalSlotsMap.get(this); + const ctx = createContext(slots, "config", name, filePath, basePath); + + return new ConfigArray(...this._loadConfigData(ctx)); + } + + /** + * Load the config file on a given directory if exists. + * @param {string} directoryPath The path to a directory. + * @param {Object} [options] The options. + * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`. + * @param {string} [options.name] The config name. + * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist. + */ + loadInDirectory(directoryPath, { basePath, name } = {}) { + const slots = internalSlotsMap.get(this); + + for (const filename of configFilenames) { + const ctx = createContext( + slots, + "config", + name, + path.join(directoryPath, filename), + basePath + ); + + if (fs.existsSync(ctx.filePath)) { + let configData; + + try { + configData = loadConfigFile(ctx.filePath); + } catch (error) { + if (!error || error.code !== "ESLINT_CONFIG_FIELD_NOT_FOUND") { + throw error; + } + } + + if (configData) { + debug(`Config file found: ${ctx.filePath}`); + return new ConfigArray( + ...this._normalizeConfigData(configData, ctx) + ); + } + } + } + + debug(`Config file not found on ${directoryPath}`); + return new ConfigArray(); + } + + /** + * Check if a config file on a given directory exists or not. + * @param {string} directoryPath The path to a directory. + * @returns {string | null} The path to the found config file. If not found then null. + */ + static getPathToConfigFileInDirectory(directoryPath) { + for (const filename of configFilenames) { + const filePath = path.join(directoryPath, filename); + + if (fs.existsSync(filePath)) { + if (filename === "package.json") { + try { + loadPackageJSONConfigFile(filePath); + return filePath; + } catch { /* ignore */ } + } else { + return filePath; + } + } + } + return null; + } + + /** + * Load `.eslintignore` file. + * @param {string} filePath The path to a `.eslintignore` file to load. + * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist. + */ + loadESLintIgnore(filePath) { + const slots = internalSlotsMap.get(this); + const ctx = createContext( + slots, + "ignore", + void 0, + filePath, + slots.cwd + ); + const ignorePatterns = loadESLintIgnoreFile(ctx.filePath); + + return new ConfigArray( + ...this._normalizeESLintIgnoreData(ignorePatterns, ctx) + ); + } + + /** + * Load `.eslintignore` file in the current working directory. + * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist. + */ + loadDefaultESLintIgnore() { + const slots = internalSlotsMap.get(this); + const eslintIgnorePath = path.resolve(slots.cwd, ".eslintignore"); + const packageJsonPath = path.resolve(slots.cwd, "package.json"); + + if (fs.existsSync(eslintIgnorePath)) { + return this.loadESLintIgnore(eslintIgnorePath); + } + if (fs.existsSync(packageJsonPath)) { + const data = loadJSONConfigFile(packageJsonPath); + + if (Object.hasOwnProperty.call(data, "eslintIgnore")) { + if (!Array.isArray(data.eslintIgnore)) { + throw new Error("Package.json eslintIgnore property requires an array of paths"); + } + const ctx = createContext( + slots, + "ignore", + "eslintIgnore in package.json", + packageJsonPath, + slots.cwd + ); + + return new ConfigArray( + ...this._normalizeESLintIgnoreData(data.eslintIgnore, ctx) + ); + } + } + + return new ConfigArray(); + } + + /** + * Load a given config file. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} Loaded config. + * @private + */ + _loadConfigData(ctx) { + return this._normalizeConfigData(loadConfigFile(ctx.filePath), ctx); + } + + /** + * Normalize a given `.eslintignore` data to config array elements. + * @param {string[]} ignorePatterns The patterns to ignore files. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + *_normalizeESLintIgnoreData(ignorePatterns, ctx) { + const elements = this._normalizeObjectConfigData( + { ignorePatterns }, + ctx + ); + + // Set `ignorePattern.loose` flag for backward compatibility. + for (const element of elements) { + if (element.ignorePattern) { + element.ignorePattern.loose = true; + } + yield element; + } + } + + /** + * Normalize a given config to an array. + * @param {ConfigData} configData The config data to normalize. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _normalizeConfigData(configData, ctx) { + validateConfigSchema(configData, ctx.name || ctx.filePath); + return this._normalizeObjectConfigData(configData, ctx); + } + + /** + * Normalize a given config to an array. + * @param {ConfigData|OverrideConfigData} configData The config data to normalize. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + *_normalizeObjectConfigData(configData, ctx) { + const { files, excludedFiles, ...configBody } = configData; + const criteria = OverrideTester.create( + files, + excludedFiles, + ctx.matchBasePath + ); + const elements = this._normalizeObjectConfigDataBody(configBody, ctx); + + // Apply the criteria to every element. + for (const element of elements) { + + /* + * Merge the criteria. + * This is for the `overrides` entries that came from the + * configurations of `overrides[].extends`. + */ + element.criteria = OverrideTester.and(criteria, element.criteria); + + /* + * Remove `root` property to ignore `root` settings which came from + * `extends` in `overrides`. + */ + if (element.criteria) { + element.root = void 0; + } + + yield element; + } + } + + /** + * Normalize a given config to an array. + * @param {ConfigData} configData The config data to normalize. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + *_normalizeObjectConfigDataBody( + { + env, + extends: extend, + globals, + ignorePatterns, + noInlineConfig, + parser: parserName, + parserOptions, + plugins: pluginList, + processor, + reportUnusedDisableDirectives, + root, + rules, + settings, + overrides: overrideList = [] + }, + ctx + ) { + const extendList = Array.isArray(extend) ? extend : [extend]; + const ignorePattern = ignorePatterns && new IgnorePattern( + Array.isArray(ignorePatterns) ? ignorePatterns : [ignorePatterns], + ctx.matchBasePath + ); + + // Flatten `extends`. + for (const extendName of extendList.filter(Boolean)) { + yield* this._loadExtends(extendName, ctx); + } + + // Load parser & plugins. + const parser = parserName && this._loadParser(parserName, ctx); + const plugins = pluginList && this._loadPlugins(pluginList, ctx); + + // Yield pseudo config data for file extension processors. + if (plugins) { + yield* this._takeFileExtensionProcessors(plugins, ctx); + } + + // Yield the config data except `extends` and `overrides`. + yield { + + // Debug information. + type: ctx.type, + name: ctx.name, + filePath: ctx.filePath, + + // Config data. + criteria: null, + env, + globals, + ignorePattern, + noInlineConfig, + parser, + parserOptions, + plugins, + processor, + reportUnusedDisableDirectives, + root, + rules, + settings + }; + + // Flatten `overries`. + for (let i = 0; i < overrideList.length; ++i) { + yield* this._normalizeObjectConfigData( + overrideList[i], + { ...ctx, name: `${ctx.name}#overrides[${i}]` } + ); + } + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _loadExtends(extendName, ctx) { + debug("Loading {extends:%j} relative to %s", extendName, ctx.filePath); + try { + if (extendName.startsWith("eslint:")) { + return this._loadExtendedBuiltInConfig(extendName, ctx); + } + if (extendName.startsWith("plugin:")) { + return this._loadExtendedPluginConfig(extendName, ctx); + } + return this._loadExtendedShareableConfig(extendName, ctx); + } catch (error) { + error.message += `\nReferenced from: ${ctx.filePath || ctx.name}`; + throw error; + } + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _loadExtendedBuiltInConfig(extendName, ctx) { + if (extendName === "eslint:recommended") { + return this._loadConfigData({ + ...ctx, + filePath: eslintRecommendedPath, + name: `${ctx.name} » ${extendName}` + }); + } + if (extendName === "eslint:all") { + return this._loadConfigData({ + ...ctx, + filePath: eslintAllPath, + name: `${ctx.name} » ${extendName}` + }); + } + + throw configInvalidError(extendName, ctx.name, "extend-config-missing"); + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _loadExtendedPluginConfig(extendName, ctx) { + const slashIndex = extendName.lastIndexOf("/"); + + if (slashIndex === -1) { + throw configInvalidError(extendName, ctx.filePath, "plugin-invalid"); + } + + const pluginName = extendName.slice("plugin:".length, slashIndex); + const configName = extendName.slice(slashIndex + 1); + + if (isFilePath(pluginName)) { + throw new Error("'extends' cannot use a file path for plugins."); + } + + const plugin = this._loadPlugin(pluginName, ctx); + const configData = + plugin.definition && + plugin.definition.configs[configName]; + + if (configData) { + return this._normalizeConfigData(configData, { + ...ctx, + filePath: plugin.filePath || ctx.filePath, + name: `${ctx.name} » plugin:${plugin.id}/${configName}` + }); + } + + throw plugin.error || configInvalidError(extendName, ctx.filePath, "extend-config-missing"); + } + + /** + * Load configs of an element in `extends`. + * @param {string} extendName The name of a base config. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The normalized config. + * @private + */ + _loadExtendedShareableConfig(extendName, ctx) { + const { cwd } = internalSlotsMap.get(this); + const relativeTo = ctx.filePath || path.join(cwd, "__placeholder__.js"); + let request; + + if (isFilePath(extendName)) { + request = extendName; + } else if (extendName.startsWith(".")) { + request = `./${extendName}`; // For backward compatibility. A ton of tests depended on this behavior. + } else { + request = naming.normalizePackageName( + extendName, + "eslint-config" + ); + } + + let filePath; + + try { + filePath = ModuleResolver.resolve(request, relativeTo); + } catch (error) { + /* istanbul ignore else */ + if (error && error.code === "MODULE_NOT_FOUND") { + throw configInvalidError(extendName, ctx.filePath, "extend-config-missing"); + } + throw error; + } + + writeDebugLogForLoading(request, relativeTo, filePath); + return this._loadConfigData({ + ...ctx, + filePath, + name: `${ctx.name} » ${request}` + }); + } + + /** + * Load given plugins. + * @param {string[]} names The plugin names to load. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {Record} The loaded parser. + * @private + */ + _loadPlugins(names, ctx) { + return names.reduce((map, name) => { + if (isFilePath(name)) { + throw new Error("Plugins array cannot includes file paths."); + } + const plugin = this._loadPlugin(name, ctx); + + map[plugin.id] = plugin; + + return map; + }, {}); + } + + /** + * Load a given parser. + * @param {string} nameOrPath The package name or the path to a parser file. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {DependentParser} The loaded parser. + */ + _loadParser(nameOrPath, ctx) { + debug("Loading parser %j from %s", nameOrPath, ctx.filePath); + + const { cwd } = internalSlotsMap.get(this); + const relativeTo = ctx.filePath || path.join(cwd, "__placeholder__.js"); + + try { + const filePath = ModuleResolver.resolve(nameOrPath, relativeTo); + + writeDebugLogForLoading(nameOrPath, relativeTo, filePath); + + return new ConfigDependency({ + definition: require(filePath), + filePath, + id: nameOrPath, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } catch (error) { + + // If the parser name is "espree", load the espree of ESLint. + if (nameOrPath === "espree") { + debug("Fallback espree."); + return new ConfigDependency({ + definition: require("espree"), + filePath: require.resolve("espree"), + id: nameOrPath, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + debug("Failed to load parser '%s' declared in '%s'.", nameOrPath, ctx.name); + error.message = `Failed to load parser '${nameOrPath}' declared in '${ctx.name}': ${error.message}`; + + return new ConfigDependency({ + error, + id: nameOrPath, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + } + + /** + * Load a given plugin. + * @param {string} name The plugin name to load. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {DependentPlugin} The loaded plugin. + * @private + */ + _loadPlugin(name, ctx) { + debug("Loading plugin %j from %s", name, ctx.filePath); + + const { additionalPluginPool } = internalSlotsMap.get(this); + const request = naming.normalizePackageName(name, "eslint-plugin"); + const id = naming.getShorthandName(request, "eslint-plugin"); + const relativeTo = path.join(ctx.pluginBasePath, "__placeholder__.js"); + + if (name.match(/\s+/u)) { + const error = Object.assign( + new Error(`Whitespace found in plugin name '${name}'`), + { + messageTemplate: "whitespace-found", + messageData: { pluginName: request } + } + ); + + return new ConfigDependency({ + error, + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + // Check for additional pool. + const plugin = + additionalPluginPool.get(request) || + additionalPluginPool.get(id); + + if (plugin) { + return new ConfigDependency({ + definition: normalizePlugin(plugin), + filePath: "", // It's unknown where the plugin came from. + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + let filePath; + let error; + + try { + filePath = ModuleResolver.resolve(request, relativeTo); + } catch (resolveError) { + error = resolveError; + /* istanbul ignore else */ + if (error && error.code === "MODULE_NOT_FOUND") { + error.messageTemplate = "plugin-missing"; + error.messageData = { + pluginName: request, + resolvePluginsRelativeTo: ctx.pluginBasePath, + importerName: ctx.name + }; + } + } + + if (filePath) { + try { + writeDebugLogForLoading(request, relativeTo, filePath); + + const startTime = Date.now(); + const pluginDefinition = require(filePath); + + debug(`Plugin ${filePath} loaded in: ${Date.now() - startTime}ms`); + + return new ConfigDependency({ + definition: normalizePlugin(pluginDefinition), + filePath, + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } catch (loadError) { + error = loadError; + } + } + + debug("Failed to load plugin '%s' declared in '%s'.", name, ctx.name); + error.message = `Failed to load plugin '${name}' declared in '${ctx.name}': ${error.message}`; + return new ConfigDependency({ + error, + id, + importerName: ctx.name, + importerPath: ctx.filePath + }); + } + + /** + * Take file expression processors as config array elements. + * @param {Record} plugins The plugin definitions. + * @param {ConfigArrayFactoryLoadingContext} ctx The loading context. + * @returns {IterableIterator} The config array elements of file expression processors. + * @private + */ + *_takeFileExtensionProcessors(plugins, ctx) { + for (const pluginId of Object.keys(plugins)) { + const processors = + plugins[pluginId] && + plugins[pluginId].definition && + plugins[pluginId].definition.processors; + + if (!processors) { + continue; + } + + for (const processorId of Object.keys(processors)) { + if (processorId.startsWith(".")) { + yield* this._normalizeObjectConfigData( + { + files: [`*${processorId}`], + processor: `${pluginId}/${processorId}` + }, + { + ...ctx, + type: "implicit-processor", + name: `${ctx.name}#processors["${pluginId}/${processorId}"]` + } + ); + } + } + } + } +} + +module.exports = { ConfigArrayFactory, createContext }; diff --git a/node_modules/eslint/lib/cli-engine/config-array/config-array.js b/node_modules/eslint/lib/cli-engine/config-array/config-array.js new file mode 100644 index 000000000..c2ef6c94a --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/config-array/config-array.js @@ -0,0 +1,536 @@ +/* + * STOP!!! DO NOT MODIFY. + * + * This file is part of the ongoing work to move the eslintrc-style config + * system into the @eslint/eslintrc package. This file needs to remain + * unchanged in order for this work to proceed. + * + * If you think you need to change this file, please contact @nzakas first. + * + * Thanks in advance for your cooperation. + */ + +/** + * @fileoverview `ConfigArray` class. + * + * `ConfigArray` class expresses the full of a configuration. It has the entry + * config file, base config files that were extended, loaded parsers, and loaded + * plugins. + * + * `ConfigArray` class provides three properties and two methods. + * + * - `pluginEnvironments` + * - `pluginProcessors` + * - `pluginRules` + * The `Map` objects that contain the members of all plugins that this + * config array contains. Those map objects don't have mutation methods. + * Those keys are the member ID such as `pluginId/memberName`. + * - `isRoot()` + * If `true` then this configuration has `root:true` property. + * - `extractConfig(filePath)` + * Extract the final configuration for a given file. This means merging + * every config array element which that `criteria` property matched. The + * `filePath` argument must be an absolute path. + * + * `ConfigArrayFactory` provides the loading logic of config files. + * + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { ExtractedConfig } = require("./extracted-config"); +const { IgnorePattern } = require("./ignore-pattern"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +// Define types for VSCode IntelliSense. +/** @typedef {import("../../shared/types").Environment} Environment */ +/** @typedef {import("../../shared/types").GlobalConf} GlobalConf */ +/** @typedef {import("../../shared/types").RuleConf} RuleConf */ +/** @typedef {import("../../shared/types").Rule} Rule */ +/** @typedef {import("../../shared/types").Plugin} Plugin */ +/** @typedef {import("../../shared/types").Processor} Processor */ +/** @typedef {import("./config-dependency").DependentParser} DependentParser */ +/** @typedef {import("./config-dependency").DependentPlugin} DependentPlugin */ +/** @typedef {import("./override-tester")["OverrideTester"]} OverrideTester */ + +/** + * @typedef {Object} ConfigArrayElement + * @property {string} name The name of this config element. + * @property {string} filePath The path to the source file of this config element. + * @property {InstanceType|null} criteria The tester for the `files` and `excludedFiles` of this config element. + * @property {Record|undefined} env The environment settings. + * @property {Record|undefined} globals The global variable settings. + * @property {IgnorePattern|undefined} ignorePattern The ignore patterns. + * @property {boolean|undefined} noInlineConfig The flag that disables directive comments. + * @property {DependentParser|undefined} parser The parser loader. + * @property {Object|undefined} parserOptions The parser options. + * @property {Record|undefined} plugins The plugin loaders. + * @property {string|undefined} processor The processor name to refer plugin's processor. + * @property {boolean|undefined} reportUnusedDisableDirectives The flag to report unused `eslint-disable` comments. + * @property {boolean|undefined} root The flag to express root. + * @property {Record|undefined} rules The rule settings + * @property {Object|undefined} settings The shared settings. + * @property {"config" | "ignore" | "implicit-processor"} type The element type. + */ + +/** + * @typedef {Object} ConfigArrayInternalSlots + * @property {Map} cache The cache to extract configs. + * @property {ReadonlyMap|null} envMap The map from environment ID to environment definition. + * @property {ReadonlyMap|null} processorMap The map from processor ID to environment definition. + * @property {ReadonlyMap|null} ruleMap The map from rule ID to rule definition. + */ + +/** @type {WeakMap} */ +const internalSlotsMap = new class extends WeakMap { + get(key) { + let value = super.get(key); + + if (!value) { + value = { + cache: new Map(), + envMap: null, + processorMap: null, + ruleMap: null + }; + super.set(key, value); + } + + return value; + } +}(); + +/** + * Get the indices which are matched to a given file. + * @param {ConfigArrayElement[]} elements The elements. + * @param {string} filePath The path to a target file. + * @returns {number[]} The indices. + */ +function getMatchedIndices(elements, filePath) { + const indices = []; + + for (let i = elements.length - 1; i >= 0; --i) { + const element = elements[i]; + + if (!element.criteria || (filePath && element.criteria.test(filePath))) { + indices.push(i); + } + } + + return indices; +} + +/** + * Check if a value is a non-null object. + * @param {any} x The value to check. + * @returns {boolean} `true` if the value is a non-null object. + */ +function isNonNullObject(x) { + return typeof x === "object" && x !== null; +} + +/** + * Merge two objects. + * + * Assign every property values of `y` to `x` if `x` doesn't have the property. + * If `x`'s property value is an object, it does recursive. + * @param {Object} target The destination to merge + * @param {Object|undefined} source The source to merge. + * @returns {void} + */ +function mergeWithoutOverwrite(target, source) { + if (!isNonNullObject(source)) { + return; + } + + for (const key of Object.keys(source)) { + if (key === "__proto__") { + continue; + } + + if (isNonNullObject(target[key])) { + mergeWithoutOverwrite(target[key], source[key]); + } else if (target[key] === void 0) { + if (isNonNullObject(source[key])) { + target[key] = Array.isArray(source[key]) ? [] : {}; + mergeWithoutOverwrite(target[key], source[key]); + } else if (source[key] !== void 0) { + target[key] = source[key]; + } + } + } +} + +/** + * The error for plugin conflicts. + */ +class PluginConflictError extends Error { + + /** + * Initialize this error object. + * @param {string} pluginId The plugin ID. + * @param {{filePath:string, importerName:string}[]} plugins The resolved plugins. + */ + constructor(pluginId, plugins) { + super(`Plugin "${pluginId}" was conflicted between ${plugins.map(p => `"${p.importerName}"`).join(" and ")}.`); + this.messageTemplate = "plugin-conflict"; + this.messageData = { pluginId, plugins }; + } +} + +/** + * Merge plugins. + * `target`'s definition is prior to `source`'s. + * @param {Record} target The destination to merge + * @param {Record|undefined} source The source to merge. + * @returns {void} + */ +function mergePlugins(target, source) { + if (!isNonNullObject(source)) { + return; + } + + for (const key of Object.keys(source)) { + if (key === "__proto__") { + continue; + } + const targetValue = target[key]; + const sourceValue = source[key]; + + // Adopt the plugin which was found at first. + if (targetValue === void 0) { + if (sourceValue.error) { + throw sourceValue.error; + } + target[key] = sourceValue; + } else if (sourceValue.filePath !== targetValue.filePath) { + throw new PluginConflictError(key, [ + { + filePath: targetValue.filePath, + importerName: targetValue.importerName + }, + { + filePath: sourceValue.filePath, + importerName: sourceValue.importerName + } + ]); + } + } +} + +/** + * Merge rule configs. + * `target`'s definition is prior to `source`'s. + * @param {Record} target The destination to merge + * @param {Record|undefined} source The source to merge. + * @returns {void} + */ +function mergeRuleConfigs(target, source) { + if (!isNonNullObject(source)) { + return; + } + + for (const key of Object.keys(source)) { + if (key === "__proto__") { + continue; + } + const targetDef = target[key]; + const sourceDef = source[key]; + + // Adopt the rule config which was found at first. + if (targetDef === void 0) { + if (Array.isArray(sourceDef)) { + target[key] = [...sourceDef]; + } else { + target[key] = [sourceDef]; + } + + /* + * If the first found rule config is severity only and the current rule + * config has options, merge the severity and the options. + */ + } else if ( + targetDef.length === 1 && + Array.isArray(sourceDef) && + sourceDef.length >= 2 + ) { + targetDef.push(...sourceDef.slice(1)); + } + } +} + +/** + * Create the extracted config. + * @param {ConfigArray} instance The config elements. + * @param {number[]} indices The indices to use. + * @returns {ExtractedConfig} The extracted config. + */ +function createConfig(instance, indices) { + const config = new ExtractedConfig(); + const ignorePatterns = []; + + // Merge elements. + for (const index of indices) { + const element = instance[index]; + + // Adopt the parser which was found at first. + if (!config.parser && element.parser) { + if (element.parser.error) { + throw element.parser.error; + } + config.parser = element.parser; + } + + // Adopt the processor which was found at first. + if (!config.processor && element.processor) { + config.processor = element.processor; + } + + // Adopt the noInlineConfig which was found at first. + if (config.noInlineConfig === void 0 && element.noInlineConfig !== void 0) { + config.noInlineConfig = element.noInlineConfig; + config.configNameOfNoInlineConfig = element.name; + } + + // Adopt the reportUnusedDisableDirectives which was found at first. + if (config.reportUnusedDisableDirectives === void 0 && element.reportUnusedDisableDirectives !== void 0) { + config.reportUnusedDisableDirectives = element.reportUnusedDisableDirectives; + } + + // Collect ignorePatterns + if (element.ignorePattern) { + ignorePatterns.push(element.ignorePattern); + } + + // Merge others. + mergeWithoutOverwrite(config.env, element.env); + mergeWithoutOverwrite(config.globals, element.globals); + mergeWithoutOverwrite(config.parserOptions, element.parserOptions); + mergeWithoutOverwrite(config.settings, element.settings); + mergePlugins(config.plugins, element.plugins); + mergeRuleConfigs(config.rules, element.rules); + } + + // Create the predicate function for ignore patterns. + if (ignorePatterns.length > 0) { + config.ignores = IgnorePattern.createIgnore(ignorePatterns.reverse()); + } + + return config; +} + +/** + * Collect definitions. + * @template T, U + * @param {string} pluginId The plugin ID for prefix. + * @param {Record} defs The definitions to collect. + * @param {Map} map The map to output. + * @param {function(T): U} [normalize] The normalize function for each value. + * @returns {void} + */ +function collect(pluginId, defs, map, normalize) { + if (defs) { + const prefix = pluginId && `${pluginId}/`; + + for (const [key, value] of Object.entries(defs)) { + map.set( + `${prefix}${key}`, + normalize ? normalize(value) : value + ); + } + } +} + +/** + * Normalize a rule definition. + * @param {Function|Rule} rule The rule definition to normalize. + * @returns {Rule} The normalized rule definition. + */ +function normalizePluginRule(rule) { + return typeof rule === "function" ? { create: rule } : rule; +} + +/** + * Delete the mutation methods from a given map. + * @param {Map} map The map object to delete. + * @returns {void} + */ +function deleteMutationMethods(map) { + Object.defineProperties(map, { + clear: { configurable: true, value: void 0 }, + delete: { configurable: true, value: void 0 }, + set: { configurable: true, value: void 0 } + }); +} + +/** + * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array. + * @param {ConfigArrayElement[]} elements The config elements. + * @param {ConfigArrayInternalSlots} slots The internal slots. + * @returns {void} + */ +function initPluginMemberMaps(elements, slots) { + const processed = new Set(); + + slots.envMap = new Map(); + slots.processorMap = new Map(); + slots.ruleMap = new Map(); + + for (const element of elements) { + if (!element.plugins) { + continue; + } + + for (const [pluginId, value] of Object.entries(element.plugins)) { + const plugin = value.definition; + + if (!plugin || processed.has(pluginId)) { + continue; + } + processed.add(pluginId); + + collect(pluginId, plugin.environments, slots.envMap); + collect(pluginId, plugin.processors, slots.processorMap); + collect(pluginId, plugin.rules, slots.ruleMap, normalizePluginRule); + } + } + + deleteMutationMethods(slots.envMap); + deleteMutationMethods(slots.processorMap); + deleteMutationMethods(slots.ruleMap); +} + +/** + * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array. + * @param {ConfigArray} instance The config elements. + * @returns {ConfigArrayInternalSlots} The extracted config. + */ +function ensurePluginMemberMaps(instance) { + const slots = internalSlotsMap.get(instance); + + if (!slots.ruleMap) { + initPluginMemberMaps(instance, slots); + } + + return slots; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * The Config Array. + * + * `ConfigArray` instance contains all settings, parsers, and plugins. + * You need to call `ConfigArray#extractConfig(filePath)` method in order to + * extract, merge and get only the config data which is related to an arbitrary + * file. + * @extends {Array} + */ +class ConfigArray extends Array { + + /** + * Get the plugin environments. + * The returned map cannot be mutated. + * @type {ReadonlyMap} The plugin environments. + */ + get pluginEnvironments() { + return ensurePluginMemberMaps(this).envMap; + } + + /** + * Get the plugin processors. + * The returned map cannot be mutated. + * @type {ReadonlyMap} The plugin processors. + */ + get pluginProcessors() { + return ensurePluginMemberMaps(this).processorMap; + } + + /** + * Get the plugin rules. + * The returned map cannot be mutated. + * @returns {ReadonlyMap} The plugin rules. + */ + get pluginRules() { + return ensurePluginMemberMaps(this).ruleMap; + } + + /** + * Check if this config has `root` flag. + * @returns {boolean} `true` if this config array is root. + */ + isRoot() { + for (let i = this.length - 1; i >= 0; --i) { + const root = this[i].root; + + if (typeof root === "boolean") { + return root; + } + } + return false; + } + + /** + * Extract the config data which is related to a given file. + * @param {string} filePath The absolute path to the target file. + * @returns {ExtractedConfig} The extracted config data. + */ + extractConfig(filePath) { + const { cache } = internalSlotsMap.get(this); + const indices = getMatchedIndices(this, filePath); + const cacheKey = indices.join(","); + + if (!cache.has(cacheKey)) { + cache.set(cacheKey, createConfig(this, indices)); + } + + return cache.get(cacheKey); + } + + /** + * Check if a given path is an additional lint target. + * @param {string} filePath The absolute path to the target file. + * @returns {boolean} `true` if the file is an additional lint target. + */ + isAdditionalTargetPath(filePath) { + for (const { criteria, type } of this) { + if ( + type === "config" && + criteria && + !criteria.endsWithWildcard && + criteria.test(filePath) + ) { + return true; + } + } + return false; + } +} + +const exportObject = { + ConfigArray, + + /** + * Get the used extracted configs. + * CLIEngine will use this method to collect used deprecated rules. + * @param {ConfigArray} instance The config array object to get. + * @returns {ExtractedConfig[]} The used extracted configs. + * @private + */ + getUsedExtractedConfigs(instance) { + const { cache } = internalSlotsMap.get(instance); + + return Array.from(cache.values()); + } +}; + +module.exports = exportObject; diff --git a/node_modules/eslint/lib/cli-engine/config-array/config-dependency.js b/node_modules/eslint/lib/cli-engine/config-array/config-dependency.js new file mode 100644 index 000000000..9fc67b010 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/config-array/config-dependency.js @@ -0,0 +1,128 @@ +/* + * STOP!!! DO NOT MODIFY. + * + * This file is part of the ongoing work to move the eslintrc-style config + * system into the @eslint/eslintrc package. This file needs to remain + * unchanged in order for this work to proceed. + * + * If you think you need to change this file, please contact @nzakas first. + * + * Thanks in advance for your cooperation. + */ + +/** + * @fileoverview `ConfigDependency` class. + * + * `ConfigDependency` class expresses a loaded parser or plugin. + * + * If the parser or plugin was loaded successfully, it has `definition` property + * and `filePath` property. Otherwise, it has `error` property. + * + * When `JSON.stringify()` converted a `ConfigDependency` object to a JSON, it + * omits `definition` property. + * + * `ConfigArrayFactory` creates `ConfigDependency` objects when it loads parsers + * or plugins. + * + * @author Toru Nagashima + */ +"use strict"; + +const util = require("util"); + +/** + * The class is to store parsers or plugins. + * This class hides the loaded object from `JSON.stringify()` and `console.log`. + * @template T + */ +class ConfigDependency { + + /** + * Initialize this instance. + * @param {Object} data The dependency data. + * @param {T} [data.definition] The dependency if the loading succeeded. + * @param {Error} [data.error] The error object if the loading failed. + * @param {string} [data.filePath] The actual path to the dependency if the loading succeeded. + * @param {string} data.id The ID of this dependency. + * @param {string} data.importerName The name of the config file which loads this dependency. + * @param {string} data.importerPath The path to the config file which loads this dependency. + */ + constructor({ + definition = null, + error = null, + filePath = null, + id, + importerName, + importerPath + }) { + + /** + * The loaded dependency if the loading succeeded. + * @type {T|null} + */ + this.definition = definition; + + /** + * The error object if the loading failed. + * @type {Error|null} + */ + this.error = error; + + /** + * The loaded dependency if the loading succeeded. + * @type {string|null} + */ + this.filePath = filePath; + + /** + * The ID of this dependency. + * @type {string} + */ + this.id = id; + + /** + * The name of the config file which loads this dependency. + * @type {string} + */ + this.importerName = importerName; + + /** + * The path to the config file which loads this dependency. + * @type {string} + */ + this.importerPath = importerPath; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {Object} a JSON compatible object. + */ + toJSON() { + const obj = this[util.inspect.custom](); + + // Display `error.message` (`Error#message` is unenumerable). + if (obj.error instanceof Error) { + obj.error = { ...obj.error, message: obj.error.message }; + } + + return obj; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {Object} an object to display by `console.log()`. + */ + [util.inspect.custom]() { + const { + definition: _ignore, // eslint-disable-line no-unused-vars + ...obj + } = this; + + return obj; + } +} + +/** @typedef {ConfigDependency} DependentParser */ +/** @typedef {ConfigDependency} DependentPlugin */ + +module.exports = { ConfigDependency }; diff --git a/node_modules/eslint/lib/cli-engine/config-array/extracted-config.js b/node_modules/eslint/lib/cli-engine/config-array/extracted-config.js new file mode 100644 index 000000000..fd7cabab3 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/config-array/extracted-config.js @@ -0,0 +1,158 @@ +/* + * STOP!!! DO NOT MODIFY. + * + * This file is part of the ongoing work to move the eslintrc-style config + * system into the @eslint/eslintrc package. This file needs to remain + * unchanged in order for this work to proceed. + * + * If you think you need to change this file, please contact @nzakas first. + * + * Thanks in advance for your cooperation. + */ + +/** + * @fileoverview `ExtractedConfig` class. + * + * `ExtractedConfig` class expresses a final configuration for a specific file. + * + * It provides one method. + * + * - `toCompatibleObjectAsConfigFileContent()` + * Convert this configuration to the compatible object as the content of + * config files. It converts the loaded parser and plugins to strings. + * `CLIEngine#getConfigForFile(filePath)` method uses this method. + * + * `ConfigArray#extractConfig(filePath)` creates a `ExtractedConfig` instance. + * + * @author Toru Nagashima + */ +"use strict"; + +const { IgnorePattern } = require("./ignore-pattern"); + +// For VSCode intellisense +/** @typedef {import("../../shared/types").ConfigData} ConfigData */ +/** @typedef {import("../../shared/types").GlobalConf} GlobalConf */ +/** @typedef {import("../../shared/types").SeverityConf} SeverityConf */ +/** @typedef {import("./config-dependency").DependentParser} DependentParser */ +/** @typedef {import("./config-dependency").DependentPlugin} DependentPlugin */ + +/** + * Check if `xs` starts with `ys`. + * @template T + * @param {T[]} xs The array to check. + * @param {T[]} ys The array that may be the first part of `xs`. + * @returns {boolean} `true` if `xs` starts with `ys`. + */ +function startsWith(xs, ys) { + return xs.length >= ys.length && ys.every((y, i) => y === xs[i]); +} + +/** + * The class for extracted config data. + */ +class ExtractedConfig { + constructor() { + + /** + * The config name what `noInlineConfig` setting came from. + * @type {string} + */ + this.configNameOfNoInlineConfig = ""; + + /** + * Environments. + * @type {Record} + */ + this.env = {}; + + /** + * Global variables. + * @type {Record} + */ + this.globals = {}; + + /** + * The glob patterns that ignore to lint. + * @type {(((filePath:string, dot?:boolean) => boolean) & { basePath:string; patterns:string[] }) | undefined} + */ + this.ignores = void 0; + + /** + * The flag that disables directive comments. + * @type {boolean|undefined} + */ + this.noInlineConfig = void 0; + + /** + * Parser definition. + * @type {DependentParser|null} + */ + this.parser = null; + + /** + * Options for the parser. + * @type {Object} + */ + this.parserOptions = {}; + + /** + * Plugin definitions. + * @type {Record} + */ + this.plugins = {}; + + /** + * Processor ID. + * @type {string|null} + */ + this.processor = null; + + /** + * The flag that reports unused `eslint-disable` directive comments. + * @type {boolean|undefined} + */ + this.reportUnusedDisableDirectives = void 0; + + /** + * Rule settings. + * @type {Record} + */ + this.rules = {}; + + /** + * Shared settings. + * @type {Object} + */ + this.settings = {}; + } + + /** + * Convert this config to the compatible object as a config file content. + * @returns {ConfigData} The converted object. + */ + toCompatibleObjectAsConfigFileContent() { + const { + /* eslint-disable no-unused-vars */ + configNameOfNoInlineConfig: _ignore1, + processor: _ignore2, + /* eslint-enable no-unused-vars */ + ignores, + ...config + } = this; + + config.parser = config.parser && config.parser.filePath; + config.plugins = Object.keys(config.plugins).filter(Boolean).reverse(); + config.ignorePatterns = ignores ? ignores.patterns : []; + + // Strip the default patterns from `ignorePatterns`. + if (startsWith(config.ignorePatterns, IgnorePattern.DefaultPatterns)) { + config.ignorePatterns = + config.ignorePatterns.slice(IgnorePattern.DefaultPatterns.length); + } + + return config; + } +} + +module.exports = { ExtractedConfig }; diff --git a/node_modules/eslint/lib/cli-engine/config-array/ignore-pattern.js b/node_modules/eslint/lib/cli-engine/config-array/ignore-pattern.js new file mode 100644 index 000000000..37d686dd1 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/config-array/ignore-pattern.js @@ -0,0 +1,249 @@ +/* + * STOP!!! DO NOT MODIFY. + * + * This file is part of the ongoing work to move the eslintrc-style config + * system into the @eslint/eslintrc package. This file needs to remain + * unchanged in order for this work to proceed. + * + * If you think you need to change this file, please contact @nzakas first. + * + * Thanks in advance for your cooperation. + */ + +/** + * @fileoverview `IgnorePattern` class. + * + * `IgnorePattern` class has the set of glob patterns and the base path. + * + * It provides two static methods. + * + * - `IgnorePattern.createDefaultIgnore(cwd)` + * Create the default predicate function. + * - `IgnorePattern.createIgnore(ignorePatterns)` + * Create the predicate function from multiple `IgnorePattern` objects. + * + * It provides two properties and a method. + * + * - `patterns` + * The glob patterns that ignore to lint. + * - `basePath` + * The base path of the glob patterns. If absolute paths existed in the + * glob patterns, those are handled as relative paths to the base path. + * - `getPatternsRelativeTo(basePath)` + * Get `patterns` as modified for a given base path. It modifies the + * absolute paths in the patterns as prepending the difference of two base + * paths. + * + * `ConfigArrayFactory` creates `IgnorePattern` objects when it processes + * `ignorePatterns` properties. + * + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const assert = require("assert"); +const path = require("path"); +const ignore = require("ignore"); +const debug = require("debug")("eslint:ignore-pattern"); + +/** @typedef {ReturnType} Ignore */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Get the path to the common ancestor directory of given paths. + * @param {string[]} sourcePaths The paths to calculate the common ancestor. + * @returns {string} The path to the common ancestor directory. + */ +function getCommonAncestorPath(sourcePaths) { + let result = sourcePaths[0]; + + for (let i = 1; i < sourcePaths.length; ++i) { + const a = result; + const b = sourcePaths[i]; + + // Set the shorter one (it's the common ancestor if one includes the other). + result = a.length < b.length ? a : b; + + // Set the common ancestor. + for (let j = 0, lastSepPos = 0; j < a.length && j < b.length; ++j) { + if (a[j] !== b[j]) { + result = a.slice(0, lastSepPos); + break; + } + if (a[j] === path.sep) { + lastSepPos = j; + } + } + } + + let resolvedResult = result || path.sep; + + // if Windows common ancestor is root of drive must have trailing slash to be absolute. + if (resolvedResult && resolvedResult.endsWith(":") && process.platform === "win32") { + resolvedResult += path.sep; + } + return resolvedResult; +} + +/** + * Make relative path. + * @param {string} from The source path to get relative path. + * @param {string} to The destination path to get relative path. + * @returns {string} The relative path. + */ +function relative(from, to) { + const relPath = path.relative(from, to); + + if (path.sep === "/") { + return relPath; + } + return relPath.split(path.sep).join("/"); +} + +/** + * Get the trailing slash if existed. + * @param {string} filePath The path to check. + * @returns {string} The trailing slash if existed. + */ +function dirSuffix(filePath) { + const isDir = ( + filePath.endsWith(path.sep) || + (process.platform === "win32" && filePath.endsWith("/")) + ); + + return isDir ? "/" : ""; +} + +const DefaultPatterns = Object.freeze(["/**/node_modules/*"]); +const DotPatterns = Object.freeze([".*", "!.eslintrc.*", "!../"]); + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +class IgnorePattern { + + /** + * The default patterns. + * @type {string[]} + */ + static get DefaultPatterns() { + return DefaultPatterns; + } + + /** + * Create the default predicate function. + * @param {string} cwd The current working directory. + * @returns {((filePath:string, dot:boolean) => boolean) & {basePath:string; patterns:string[]}} + * The preficate function. + * The first argument is an absolute path that is checked. + * The second argument is the flag to not ignore dotfiles. + * If the predicate function returned `true`, it means the path should be ignored. + */ + static createDefaultIgnore(cwd) { + return this.createIgnore([new IgnorePattern(DefaultPatterns, cwd)]); + } + + /** + * Create the predicate function from multiple `IgnorePattern` objects. + * @param {IgnorePattern[]} ignorePatterns The list of ignore patterns. + * @returns {((filePath:string, dot?:boolean) => boolean) & {basePath:string; patterns:string[]}} + * The preficate function. + * The first argument is an absolute path that is checked. + * The second argument is the flag to not ignore dotfiles. + * If the predicate function returned `true`, it means the path should be ignored. + */ + static createIgnore(ignorePatterns) { + debug("Create with: %o", ignorePatterns); + + const basePath = getCommonAncestorPath(ignorePatterns.map(p => p.basePath)); + const patterns = [].concat( + ...ignorePatterns.map(p => p.getPatternsRelativeTo(basePath)) + ); + const ig = ignore().add([...DotPatterns, ...patterns]); + const dotIg = ignore().add(patterns); + + debug(" processed: %o", { basePath, patterns }); + + return Object.assign( + (filePath, dot = false) => { + assert(path.isAbsolute(filePath), "'filePath' should be an absolute path."); + const relPathRaw = relative(basePath, filePath); + const relPath = relPathRaw && (relPathRaw + dirSuffix(filePath)); + const adoptedIg = dot ? dotIg : ig; + const result = relPath !== "" && adoptedIg.ignores(relPath); + + debug("Check", { filePath, dot, relativePath: relPath, result }); + return result; + }, + { basePath, patterns } + ); + } + + /** + * Initialize a new `IgnorePattern` instance. + * @param {string[]} patterns The glob patterns that ignore to lint. + * @param {string} basePath The base path of `patterns`. + */ + constructor(patterns, basePath) { + assert(path.isAbsolute(basePath), "'basePath' should be an absolute path."); + + /** + * The glob patterns that ignore to lint. + * @type {string[]} + */ + this.patterns = patterns; + + /** + * The base path of `patterns`. + * @type {string} + */ + this.basePath = basePath; + + /** + * If `true` then patterns which don't start with `/` will match the paths to the outside of `basePath`. Defaults to `false`. + * + * It's set `true` for `.eslintignore`, `package.json`, and `--ignore-path` for backward compatibility. + * It's `false` as-is for `ignorePatterns` property in config files. + * @type {boolean} + */ + this.loose = false; + } + + /** + * Get `patterns` as modified for a given base path. It modifies the + * absolute paths in the patterns as prepending the difference of two base + * paths. + * @param {string} newBasePath The base path. + * @returns {string[]} Modifired patterns. + */ + getPatternsRelativeTo(newBasePath) { + assert(path.isAbsolute(newBasePath), "'newBasePath' should be an absolute path."); + const { basePath, loose, patterns } = this; + + if (newBasePath === basePath) { + return patterns; + } + const prefix = `/${relative(newBasePath, basePath)}`; + + return patterns.map(pattern => { + const negative = pattern.startsWith("!"); + const head = negative ? "!" : ""; + const body = negative ? pattern.slice(1) : pattern; + + if (body.startsWith("/") || body.startsWith("../")) { + return `${head}${prefix}${body}`; + } + return loose ? pattern : `${head}${prefix}/**/${body}`; + }); + } +} + +module.exports = { IgnorePattern }; diff --git a/node_modules/eslint/lib/cli-engine/config-array/index.js b/node_modules/eslint/lib/cli-engine/config-array/index.js new file mode 100644 index 000000000..146c6f892 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/config-array/index.js @@ -0,0 +1,32 @@ +/* + * STOP!!! DO NOT MODIFY. + * + * This file is part of the ongoing work to move the eslintrc-style config + * system into the @eslint/eslintrc package. This file needs to remain + * unchanged in order for this work to proceed. + * + * If you think you need to change this file, please contact @nzakas first. + * + * Thanks in advance for your cooperation. + */ + +/** + * @fileoverview `ConfigArray` class. + * @author Toru Nagashima + */ +"use strict"; + +const { ConfigArray, getUsedExtractedConfigs } = require("./config-array"); +const { ConfigDependency } = require("./config-dependency"); +const { ExtractedConfig } = require("./extracted-config"); +const { IgnorePattern } = require("./ignore-pattern"); +const { OverrideTester } = require("./override-tester"); + +module.exports = { + ConfigArray, + ConfigDependency, + ExtractedConfig, + IgnorePattern, + OverrideTester, + getUsedExtractedConfigs +}; diff --git a/node_modules/eslint/lib/cli-engine/config-array/override-tester.js b/node_modules/eslint/lib/cli-engine/config-array/override-tester.js new file mode 100644 index 000000000..75dffe235 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/config-array/override-tester.js @@ -0,0 +1,235 @@ +/* + * STOP!!! DO NOT MODIFY. + * + * This file is part of the ongoing work to move the eslintrc-style config + * system into the @eslint/eslintrc package. This file needs to remain + * unchanged in order for this work to proceed. + * + * If you think you need to change this file, please contact @nzakas first. + * + * Thanks in advance for your cooperation. + */ + +/** + * @fileoverview `OverrideTester` class. + * + * `OverrideTester` class handles `files` property and `excludedFiles` property + * of `overrides` config. + * + * It provides one method. + * + * - `test(filePath)` + * Test if a file path matches the pair of `files` property and + * `excludedFiles` property. The `filePath` argument must be an absolute + * path. + * + * `ConfigArrayFactory` creates `OverrideTester` objects when it processes + * `overrides` properties. + * + * @author Toru Nagashima + */ +"use strict"; + +const assert = require("assert"); +const path = require("path"); +const util = require("util"); +const { Minimatch } = require("minimatch"); +const minimatchOpts = { dot: true, matchBase: true }; + +/** + * @typedef {Object} Pattern + * @property {InstanceType[] | null} includes The positive matchers. + * @property {InstanceType[] | null} excludes The negative matchers. + */ + +/** + * Normalize a given pattern to an array. + * @param {string|string[]|undefined} patterns A glob pattern or an array of glob patterns. + * @returns {string[]|null} Normalized patterns. + * @private + */ +function normalizePatterns(patterns) { + if (Array.isArray(patterns)) { + return patterns.filter(Boolean); + } + if (typeof patterns === "string" && patterns) { + return [patterns]; + } + return []; +} + +/** + * Create the matchers of given patterns. + * @param {string[]} patterns The patterns. + * @returns {InstanceType[] | null} The matchers. + */ +function toMatcher(patterns) { + if (patterns.length === 0) { + return null; + } + return patterns.map(pattern => { + if (/^\.[/\\]/u.test(pattern)) { + return new Minimatch( + pattern.slice(2), + + // `./*.js` should not match with `subdir/foo.js` + { ...minimatchOpts, matchBase: false } + ); + } + return new Minimatch(pattern, minimatchOpts); + }); +} + +/** + * Convert a given matcher to string. + * @param {Pattern} matchers The matchers. + * @returns {string} The string expression of the matcher. + */ +function patternToJson({ includes, excludes }) { + return { + includes: includes && includes.map(m => m.pattern), + excludes: excludes && excludes.map(m => m.pattern) + }; +} + +/** + * The class to test given paths are matched by the patterns. + */ +class OverrideTester { + + /** + * Create a tester with given criteria. + * If there are no criteria, returns `null`. + * @param {string|string[]} files The glob patterns for included files. + * @param {string|string[]} excludedFiles The glob patterns for excluded files. + * @param {string} basePath The path to the base directory to test paths. + * @returns {OverrideTester|null} The created instance or `null`. + */ + static create(files, excludedFiles, basePath) { + const includePatterns = normalizePatterns(files); + const excludePatterns = normalizePatterns(excludedFiles); + let endsWithWildcard = false; + + if (includePatterns.length === 0) { + return null; + } + + // Rejects absolute paths or relative paths to parents. + for (const pattern of includePatterns) { + if (path.isAbsolute(pattern) || pattern.includes("..")) { + throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`); + } + if (pattern.endsWith("*")) { + endsWithWildcard = true; + } + } + for (const pattern of excludePatterns) { + if (path.isAbsolute(pattern) || pattern.includes("..")) { + throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`); + } + } + + const includes = toMatcher(includePatterns); + const excludes = toMatcher(excludePatterns); + + return new OverrideTester( + [{ includes, excludes }], + basePath, + endsWithWildcard + ); + } + + /** + * Combine two testers by logical and. + * If either of the testers was `null`, returns the other tester. + * The `basePath` property of the two must be the same value. + * @param {OverrideTester|null} a A tester. + * @param {OverrideTester|null} b Another tester. + * @returns {OverrideTester|null} Combined tester. + */ + static and(a, b) { + if (!b) { + return a && new OverrideTester( + a.patterns, + a.basePath, + a.endsWithWildcard + ); + } + if (!a) { + return new OverrideTester( + b.patterns, + b.basePath, + b.endsWithWildcard + ); + } + + assert.strictEqual(a.basePath, b.basePath); + return new OverrideTester( + a.patterns.concat(b.patterns), + a.basePath, + a.endsWithWildcard || b.endsWithWildcard + ); + } + + /** + * Initialize this instance. + * @param {Pattern[]} patterns The matchers. + * @param {string} basePath The base path. + * @param {boolean} endsWithWildcard If `true` then a pattern ends with `*`. + */ + constructor(patterns, basePath, endsWithWildcard = false) { + + /** @type {Pattern[]} */ + this.patterns = patterns; + + /** @type {string} */ + this.basePath = basePath; + + /** @type {boolean} */ + this.endsWithWildcard = endsWithWildcard; + } + + /** + * Test if a given path is matched or not. + * @param {string} filePath The absolute path to the target file. + * @returns {boolean} `true` if the path was matched. + */ + test(filePath) { + if (typeof filePath !== "string" || !path.isAbsolute(filePath)) { + throw new Error(`'filePath' should be an absolute path, but got ${filePath}.`); + } + const relativePath = path.relative(this.basePath, filePath); + + return this.patterns.every(({ includes, excludes }) => ( + (!includes || includes.some(m => m.match(relativePath))) && + (!excludes || !excludes.some(m => m.match(relativePath))) + )); + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {Object} a JSON compatible object. + */ + toJSON() { + if (this.patterns.length === 1) { + return { + ...patternToJson(this.patterns[0]), + basePath: this.basePath + }; + } + return { + AND: this.patterns.map(patternToJson), + basePath: this.basePath + }; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {Object} an object to display by `console.log()`. + */ + [util.inspect.custom]() { + return this.toJSON(); + } +} + +module.exports = { OverrideTester }; diff --git a/node_modules/eslint/lib/cli-engine/file-enumerator.js b/node_modules/eslint/lib/cli-engine/file-enumerator.js new file mode 100644 index 000000000..7c433d32f --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/file-enumerator.js @@ -0,0 +1,528 @@ +/** + * @fileoverview `FileEnumerator` class. + * + * `FileEnumerator` class has two responsibilities: + * + * 1. Find target files by processing glob patterns. + * 2. Tie each target file and appropriate configuration. + * + * It provides a method: + * + * - `iterateFiles(patterns)` + * Iterate files which are matched by given patterns together with the + * corresponded configuration. This is for `CLIEngine#executeOnFiles()`. + * While iterating files, it loads the configuration file of each directory + * before iterate files on the directory, so we can use the configuration + * files to determine target files. + * + * @example + * const enumerator = new FileEnumerator(); + * const linter = new Linter(); + * + * for (const { config, filePath } of enumerator.iterateFiles(["*.js"])) { + * const code = fs.readFileSync(filePath, "utf8"); + * const messages = linter.verify(code, config, filePath); + * + * console.log(messages); + * } + * + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const fs = require("fs"); +const path = require("path"); +const getGlobParent = require("glob-parent"); +const isGlob = require("is-glob"); +const { escapeRegExp } = require("lodash"); +const { Minimatch } = require("minimatch"); +const { IgnorePattern } = require("./config-array"); +const { CascadingConfigArrayFactory } = require("./cascading-config-array-factory"); +const debug = require("debug")("eslint:file-enumerator"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const minimatchOpts = { dot: true, matchBase: true }; +const dotfilesPattern = /(?:(?:^\.)|(?:[/\\]\.))[^/\\.].*/u; +const NONE = 0; +const IGNORED_SILENTLY = 1; +const IGNORED = 2; + +// For VSCode intellisense +/** @typedef {ReturnType} ConfigArray */ + +/** + * @typedef {Object} FileEnumeratorOptions + * @property {CascadingConfigArrayFactory} [configArrayFactory] The factory for config arrays. + * @property {string} [cwd] The base directory to start lookup. + * @property {string[]} [extensions] The extensions to match files for directory patterns. + * @property {boolean} [globInputPaths] Set to false to skip glob resolution of input file paths to lint (default: true). If false, each input file paths is assumed to be a non-glob path to an existing file. + * @property {boolean} [ignore] The flag to check ignored files. + * @property {string[]} [rulePaths] The value of `--rulesdir` option. + */ + +/** + * @typedef {Object} FileAndConfig + * @property {string} filePath The path to a target file. + * @property {ConfigArray} config The config entries of that file. + * @property {boolean} ignored If `true` then this file should be ignored and warned because it was directly specified. + */ + +/** + * @typedef {Object} FileEntry + * @property {string} filePath The path to a target file. + * @property {ConfigArray} config The config entries of that file. + * @property {NONE|IGNORED_SILENTLY|IGNORED} flag The flag. + * - `NONE` means the file is a target file. + * - `IGNORED_SILENTLY` means the file should be ignored silently. + * - `IGNORED` means the file should be ignored and warned because it was directly specified. + */ + +/** + * @typedef {Object} FileEnumeratorInternalSlots + * @property {CascadingConfigArrayFactory} configArrayFactory The factory for config arrays. + * @property {string} cwd The base directory to start lookup. + * @property {RegExp|null} extensionRegExp The RegExp to test if a string ends with specific file extensions. + * @property {boolean} globInputPaths Set to false to skip glob resolution of input file paths to lint (default: true). If false, each input file paths is assumed to be a non-glob path to an existing file. + * @property {boolean} ignoreFlag The flag to check ignored files. + * @property {(filePath:string, dot:boolean) => boolean} defaultIgnores The default predicate function to ignore files. + */ + +/** @type {WeakMap} */ +const internalSlotsMap = new WeakMap(); + +/** + * Check if a string is a glob pattern or not. + * @param {string} pattern A glob pattern. + * @returns {boolean} `true` if the string is a glob pattern. + */ +function isGlobPattern(pattern) { + return isGlob(path.sep === "\\" ? pattern.replace(/\\/gu, "/") : pattern); +} + +/** + * Get stats of a given path. + * @param {string} filePath The path to target file. + * @returns {fs.Stats|null} The stats. + * @private + */ +function statSafeSync(filePath) { + try { + return fs.statSync(filePath); + } catch (error) { + /* istanbul ignore next */ + if (error.code !== "ENOENT") { + throw error; + } + return null; + } +} + +/** + * Get filenames in a given path to a directory. + * @param {string} directoryPath The path to target directory. + * @returns {import("fs").Dirent[]} The filenames. + * @private + */ +function readdirSafeSync(directoryPath) { + try { + return fs.readdirSync(directoryPath, { withFileTypes: true }); + } catch (error) { + /* istanbul ignore next */ + if (error.code !== "ENOENT") { + throw error; + } + return []; + } +} + +/** + * Create a `RegExp` object to detect extensions. + * @param {string[] | null} extensions The extensions to create. + * @returns {RegExp | null} The created `RegExp` object or null. + */ +function createExtensionRegExp(extensions) { + if (extensions) { + const normalizedExts = extensions.map(ext => escapeRegExp( + ext.startsWith(".") + ? ext.slice(1) + : ext + )); + + return new RegExp( + `.\\.(?:${normalizedExts.join("|")})$`, + "u" + ); + } + return null; +} + +/** + * The error type when no files match a glob. + */ +class NoFilesFoundError extends Error { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {string} pattern The glob pattern which was not found. + * @param {boolean} globDisabled If `true` then the pattern was a glob pattern, but glob was disabled. + */ + constructor(pattern, globDisabled) { + super(`No files matching '${pattern}' were found${globDisabled ? " (glob was disabled)" : ""}.`); + this.messageTemplate = "file-not-found"; + this.messageData = { pattern, globDisabled }; + } +} + +/** + * The error type when there are files matched by a glob, but all of them have been ignored. + */ +class AllFilesIgnoredError extends Error { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {string} pattern The glob pattern which was not found. + */ + constructor(pattern) { + super(`All files matched by '${pattern}' are ignored.`); + this.messageTemplate = "all-files-ignored"; + this.messageData = { pattern }; + } +} + +/** + * This class provides the functionality that enumerates every file which is + * matched by given glob patterns and that configuration. + */ +class FileEnumerator { + + /** + * Initialize this enumerator. + * @param {FileEnumeratorOptions} options The options. + */ + constructor({ + cwd = process.cwd(), + configArrayFactory = new CascadingConfigArrayFactory({ cwd }), + extensions = null, + globInputPaths = true, + errorOnUnmatchedPattern = true, + ignore = true + } = {}) { + internalSlotsMap.set(this, { + configArrayFactory, + cwd, + defaultIgnores: IgnorePattern.createDefaultIgnore(cwd), + extensionRegExp: createExtensionRegExp(extensions), + globInputPaths, + errorOnUnmatchedPattern, + ignoreFlag: ignore + }); + } + + /** + * Check if a given file is target or not. + * @param {string} filePath The path to a candidate file. + * @param {ConfigArray} [providedConfig] Optional. The configuration for the file. + * @returns {boolean} `true` if the file is a target. + */ + isTargetPath(filePath, providedConfig) { + const { + configArrayFactory, + extensionRegExp + } = internalSlotsMap.get(this); + + // If `--ext` option is present, use it. + if (extensionRegExp) { + return extensionRegExp.test(filePath); + } + + // `.js` file is target by default. + if (filePath.endsWith(".js")) { + return true; + } + + // use `overrides[].files` to check additional targets. + const config = + providedConfig || + configArrayFactory.getConfigArrayForFile( + filePath, + { ignoreNotFoundError: true } + ); + + return config.isAdditionalTargetPath(filePath); + } + + /** + * Iterate files which are matched by given glob patterns. + * @param {string|string[]} patternOrPatterns The glob patterns to iterate files. + * @returns {IterableIterator} The found files. + */ + *iterateFiles(patternOrPatterns) { + const { globInputPaths, errorOnUnmatchedPattern } = internalSlotsMap.get(this); + const patterns = Array.isArray(patternOrPatterns) + ? patternOrPatterns + : [patternOrPatterns]; + + debug("Start to iterate files: %o", patterns); + + // The set of paths to remove duplicate. + const set = new Set(); + + for (const pattern of patterns) { + let foundRegardlessOfIgnored = false; + let found = false; + + // Skip empty string. + if (!pattern) { + continue; + } + + // Iterate files of this pattern. + for (const { config, filePath, flag } of this._iterateFiles(pattern)) { + foundRegardlessOfIgnored = true; + if (flag === IGNORED_SILENTLY) { + continue; + } + found = true; + + // Remove duplicate paths while yielding paths. + if (!set.has(filePath)) { + set.add(filePath); + yield { + config, + filePath, + ignored: flag === IGNORED + }; + } + } + + // Raise an error if any files were not found. + if (errorOnUnmatchedPattern) { + if (!foundRegardlessOfIgnored) { + throw new NoFilesFoundError( + pattern, + !globInputPaths && isGlob(pattern) + ); + } + if (!found) { + throw new AllFilesIgnoredError(pattern); + } + } + } + + debug(`Complete iterating files: ${JSON.stringify(patterns)}`); + } + + /** + * Iterate files which are matched by a given glob pattern. + * @param {string} pattern The glob pattern to iterate files. + * @returns {IterableIterator} The found files. + */ + _iterateFiles(pattern) { + const { cwd, globInputPaths } = internalSlotsMap.get(this); + const absolutePath = path.resolve(cwd, pattern); + const isDot = dotfilesPattern.test(pattern); + const stat = statSafeSync(absolutePath); + + if (stat && stat.isDirectory()) { + return this._iterateFilesWithDirectory(absolutePath, isDot); + } + if (stat && stat.isFile()) { + return this._iterateFilesWithFile(absolutePath); + } + if (globInputPaths && isGlobPattern(pattern)) { + return this._iterateFilesWithGlob(absolutePath, isDot); + } + + return []; + } + + /** + * Iterate a file which is matched by a given path. + * @param {string} filePath The path to the target file. + * @returns {IterableIterator} The found files. + * @private + */ + _iterateFilesWithFile(filePath) { + debug(`File: ${filePath}`); + + const { configArrayFactory } = internalSlotsMap.get(this); + const config = configArrayFactory.getConfigArrayForFile(filePath); + const ignored = this._isIgnoredFile(filePath, { config, direct: true }); + const flag = ignored ? IGNORED : NONE; + + return [{ config, filePath, flag }]; + } + + /** + * Iterate files in a given path. + * @param {string} directoryPath The path to the target directory. + * @param {boolean} dotfiles If `true` then it doesn't skip dot files by default. + * @returns {IterableIterator} The found files. + * @private + */ + _iterateFilesWithDirectory(directoryPath, dotfiles) { + debug(`Directory: ${directoryPath}`); + + return this._iterateFilesRecursive( + directoryPath, + { dotfiles, recursive: true, selector: null } + ); + } + + /** + * Iterate files which are matched by a given glob pattern. + * @param {string} pattern The glob pattern to iterate files. + * @param {boolean} dotfiles If `true` then it doesn't skip dot files by default. + * @returns {IterableIterator} The found files. + * @private + */ + _iterateFilesWithGlob(pattern, dotfiles) { + debug(`Glob: ${pattern}`); + + const directoryPath = path.resolve(getGlobParent(pattern)); + const globPart = pattern.slice(directoryPath.length + 1); + + /* + * recursive if there are `**` or path separators in the glob part. + * Otherwise, patterns such as `src/*.js`, it doesn't need recursive. + */ + const recursive = /\*\*|\/|\\/u.test(globPart); + const selector = new Minimatch(pattern, minimatchOpts); + + debug(`recursive? ${recursive}`); + + return this._iterateFilesRecursive( + directoryPath, + { dotfiles, recursive, selector } + ); + } + + /** + * Iterate files in a given path. + * @param {string} directoryPath The path to the target directory. + * @param {Object} options The options to iterate files. + * @param {boolean} [options.dotfiles] If `true` then it doesn't skip dot files by default. + * @param {boolean} [options.recursive] If `true` then it dives into sub directories. + * @param {InstanceType} [options.selector] The matcher to choose files. + * @returns {IterableIterator} The found files. + * @private + */ + *_iterateFilesRecursive(directoryPath, options) { + debug(`Enter the directory: ${directoryPath}`); + const { configArrayFactory } = internalSlotsMap.get(this); + + /** @type {ConfigArray|null} */ + let config = null; + + // Enumerate the files of this directory. + for (const entry of readdirSafeSync(directoryPath)) { + const filePath = path.join(directoryPath, entry.name); + + // Check if the file is matched. + if (entry.isFile()) { + if (!config) { + config = configArrayFactory.getConfigArrayForFile( + filePath, + + /* + * We must ignore `ConfigurationNotFoundError` at this + * point because we don't know if target files exist in + * this directory. + */ + { ignoreNotFoundError: true } + ); + } + const matched = options.selector + + // Started with a glob pattern; choose by the pattern. + ? options.selector.match(filePath) + + // Started with a directory path; choose by file extensions. + : this.isTargetPath(filePath, config); + + if (matched) { + const ignored = this._isIgnoredFile(filePath, { ...options, config }); + const flag = ignored ? IGNORED_SILENTLY : NONE; + + debug(`Yield: ${entry.name}${ignored ? " but ignored" : ""}`); + yield { + config: configArrayFactory.getConfigArrayForFile(filePath), + filePath, + flag + }; + } else { + debug(`Didn't match: ${entry.name}`); + } + + // Dive into the sub directory. + } else if (options.recursive && entry.isDirectory()) { + if (!config) { + config = configArrayFactory.getConfigArrayForFile( + filePath, + { ignoreNotFoundError: true } + ); + } + const ignored = this._isIgnoredFile( + filePath + path.sep, + { ...options, config } + ); + + if (!ignored) { + yield* this._iterateFilesRecursive(filePath, options); + } + } + } + + debug(`Leave the directory: ${directoryPath}`); + } + + /** + * Check if a given file should be ignored. + * @param {string} filePath The path to a file to check. + * @param {Object} options Options + * @param {ConfigArray} [options.config] The config for this file. + * @param {boolean} [options.dotfiles] If `true` then this is not ignore dot files by default. + * @param {boolean} [options.direct] If `true` then this is a direct specified file. + * @returns {boolean} `true` if the file should be ignored. + * @private + */ + _isIgnoredFile(filePath, { + config: providedConfig, + dotfiles = false, + direct = false + }) { + const { + configArrayFactory, + defaultIgnores, + ignoreFlag + } = internalSlotsMap.get(this); + + if (ignoreFlag) { + const config = + providedConfig || + configArrayFactory.getConfigArrayForFile( + filePath, + { ignoreNotFoundError: true } + ); + const ignores = + config.extractConfig(filePath).ignores || defaultIgnores; + + return ignores(filePath, dotfiles); + } + + return !direct && defaultIgnores(filePath, dotfiles); + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { FileEnumerator }; diff --git a/node_modules/eslint/lib/cli-engine/formatters/checkstyle.js b/node_modules/eslint/lib/cli-engine/formatters/checkstyle.js new file mode 100644 index 000000000..f19b6fc09 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/checkstyle.js @@ -0,0 +1,60 @@ +/** + * @fileoverview CheckStyle XML reporter + * @author Ian Christian Myers + */ +"use strict"; + +const xmlEscape = require("../xml-escape"); + +//------------------------------------------------------------------------------ +// Helper Functions +//------------------------------------------------------------------------------ + +/** + * Returns the severity of warning or error + * @param {Object} message message object to examine + * @returns {string} severity level + * @private + */ +function getMessageType(message) { + if (message.fatal || message.severity === 2) { + return "error"; + } + return "warning"; + +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + + let output = ""; + + output += ""; + output += ""; + + results.forEach(result => { + const messages = result.messages; + + output += ``; + + messages.forEach(message => { + output += [ + `` + ].join(" "); + }); + + output += ""; + + }); + + output += ""; + + return output; +}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/codeframe.js b/node_modules/eslint/lib/cli-engine/formatters/codeframe.js new file mode 100644 index 000000000..41e3ab7b0 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/codeframe.js @@ -0,0 +1,138 @@ +/** + * @fileoverview Codeframe reporter + * @author Vitor Balocco + */ +"use strict"; + +const chalk = require("chalk"); +const { codeFrameColumns } = require("@babel/code-frame"); +const path = require("path"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Given a word and a count, append an s if count is not one. + * @param {string} word A word in its singular form. + * @param {number} count A number controlling whether word should be pluralized. + * @returns {string} The original word with an s on the end if count is not one. + */ +function pluralize(word, count) { + return (count === 1 ? word : `${word}s`); +} + +/** + * Gets a formatted relative file path from an absolute path and a line/column in the file. + * @param {string} filePath The absolute file path to format. + * @param {number} line The line from the file to use for formatting. + * @param {number} column The column from the file to use for formatting. + * @returns {string} The formatted file path. + */ +function formatFilePath(filePath, line, column) { + let relPath = path.relative(process.cwd(), filePath); + + if (line && column) { + relPath += `:${line}:${column}`; + } + + return chalk.green(relPath); +} + +/** + * Gets the formatted output for a given message. + * @param {Object} message The object that represents this message. + * @param {Object} parentResult The result object that this message belongs to. + * @returns {string} The formatted output. + */ +function formatMessage(message, parentResult) { + const type = (message.fatal || message.severity === 2) ? chalk.red("error") : chalk.yellow("warning"); + const msg = `${chalk.bold(message.message.replace(/([^ ])\.$/u, "$1"))}`; + const ruleId = message.fatal ? "" : chalk.dim(`(${message.ruleId})`); + const filePath = formatFilePath(parentResult.filePath, message.line, message.column); + const sourceCode = parentResult.output ? parentResult.output : parentResult.source; + + const firstLine = [ + `${type}:`, + `${msg}`, + ruleId ? `${ruleId}` : "", + sourceCode ? `at ${filePath}:` : `at ${filePath}` + ].filter(String).join(" "); + + const result = [firstLine]; + + if (sourceCode) { + result.push( + codeFrameColumns(sourceCode, { start: { line: message.line, column: message.column } }, { highlightCode: false }) + ); + } + + return result.join("\n"); +} + +/** + * Gets the formatted output summary for a given number of errors and warnings. + * @param {number} errors The number of errors. + * @param {number} warnings The number of warnings. + * @param {number} fixableErrors The number of fixable errors. + * @param {number} fixableWarnings The number of fixable warnings. + * @returns {string} The formatted output summary. + */ +function formatSummary(errors, warnings, fixableErrors, fixableWarnings) { + const summaryColor = errors > 0 ? "red" : "yellow"; + const summary = []; + const fixablesSummary = []; + + if (errors > 0) { + summary.push(`${errors} ${pluralize("error", errors)}`); + } + + if (warnings > 0) { + summary.push(`${warnings} ${pluralize("warning", warnings)}`); + } + + if (fixableErrors > 0) { + fixablesSummary.push(`${fixableErrors} ${pluralize("error", fixableErrors)}`); + } + + if (fixableWarnings > 0) { + fixablesSummary.push(`${fixableWarnings} ${pluralize("warning", fixableWarnings)}`); + } + + let output = chalk[summaryColor].bold(`${summary.join(" and ")} found.`); + + if (fixableErrors || fixableWarnings) { + output += chalk[summaryColor].bold(`\n${fixablesSummary.join(" and ")} potentially fixable with the \`--fix\` option.`); + } + + return output; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + let errors = 0; + let warnings = 0; + let fixableErrors = 0; + let fixableWarnings = 0; + + const resultsWithMessages = results.filter(result => result.messages.length > 0); + + let output = resultsWithMessages.reduce((resultsOutput, result) => { + const messages = result.messages.map(message => `${formatMessage(message, result)}\n\n`); + + errors += result.errorCount; + warnings += result.warningCount; + fixableErrors += result.fixableErrorCount; + fixableWarnings += result.fixableWarningCount; + + return resultsOutput.concat(messages); + }, []).join("\n"); + + output += "\n"; + output += formatSummary(errors, warnings, fixableErrors, fixableWarnings); + + return (errors + warnings) > 0 ? output : ""; +}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/compact.js b/node_modules/eslint/lib/cli-engine/formatters/compact.js new file mode 100644 index 000000000..2b540bde2 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/compact.js @@ -0,0 +1,60 @@ +/** + * @fileoverview Compact reporter + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Helper Functions +//------------------------------------------------------------------------------ + +/** + * Returns the severity of warning or error + * @param {Object} message message object to examine + * @returns {string} severity level + * @private + */ +function getMessageType(message) { + if (message.fatal || message.severity === 2) { + return "Error"; + } + return "Warning"; + +} + + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + + let output = "", + total = 0; + + results.forEach(result => { + + const messages = result.messages; + + total += messages.length; + + messages.forEach(message => { + + output += `${result.filePath}: `; + output += `line ${message.line || 0}`; + output += `, col ${message.column || 0}`; + output += `, ${getMessageType(message)}`; + output += ` - ${message.message}`; + output += message.ruleId ? ` (${message.ruleId})` : ""; + output += "\n"; + + }); + + }); + + if (total > 0) { + output += `\n${total} problem${total !== 1 ? "s" : ""}`; + } + + return output; +}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/html-template-message.html b/node_modules/eslint/lib/cli-engine/formatters/html-template-message.html new file mode 100644 index 000000000..93795a1bd --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/html-template-message.html @@ -0,0 +1,8 @@ + + <%= lineNumber %>:<%= columnNumber %> + <%= severityName %> + <%- message %> + + <%= ruleId %> + + diff --git a/node_modules/eslint/lib/cli-engine/formatters/html-template-page.html b/node_modules/eslint/lib/cli-engine/formatters/html-template-page.html new file mode 100644 index 000000000..4016576fa --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/html-template-page.html @@ -0,0 +1,115 @@ + + + + + ESLint Report + + + +
+

ESLint Report

+
+ <%= reportSummary %> - Generated on <%= date %> +
+
+ + + <%= results %> + +
+ + + diff --git a/node_modules/eslint/lib/cli-engine/formatters/html-template-result.html b/node_modules/eslint/lib/cli-engine/formatters/html-template-result.html new file mode 100644 index 000000000..f4a55933c --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/html-template-result.html @@ -0,0 +1,6 @@ + + + [+] <%- filePath %> + <%- summary %> + + diff --git a/node_modules/eslint/lib/cli-engine/formatters/html.js b/node_modules/eslint/lib/cli-engine/formatters/html.js new file mode 100644 index 000000000..69f739555 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/html.js @@ -0,0 +1,140 @@ +/** + * @fileoverview HTML reporter + * @author Julian Laval + */ +"use strict"; + +const lodash = require("lodash"); +const fs = require("fs"); +const path = require("path"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const pageTemplate = lodash.template(fs.readFileSync(path.join(__dirname, "html-template-page.html"), "utf-8")); +const messageTemplate = lodash.template(fs.readFileSync(path.join(__dirname, "html-template-message.html"), "utf-8")); +const resultTemplate = lodash.template(fs.readFileSync(path.join(__dirname, "html-template-result.html"), "utf-8")); + +/** + * Given a word and a count, append an s if count is not one. + * @param {string} word A word in its singular form. + * @param {int} count A number controlling whether word should be pluralized. + * @returns {string} The original word with an s on the end if count is not one. + */ +function pluralize(word, count) { + return (count === 1 ? word : `${word}s`); +} + +/** + * Renders text along the template of x problems (x errors, x warnings) + * @param {string} totalErrors Total errors + * @param {string} totalWarnings Total warnings + * @returns {string} The formatted string, pluralized where necessary + */ +function renderSummary(totalErrors, totalWarnings) { + const totalProblems = totalErrors + totalWarnings; + let renderedText = `${totalProblems} ${pluralize("problem", totalProblems)}`; + + if (totalProblems !== 0) { + renderedText += ` (${totalErrors} ${pluralize("error", totalErrors)}, ${totalWarnings} ${pluralize("warning", totalWarnings)})`; + } + return renderedText; +} + +/** + * Get the color based on whether there are errors/warnings... + * @param {string} totalErrors Total errors + * @param {string} totalWarnings Total warnings + * @returns {int} The color code (0 = green, 1 = yellow, 2 = red) + */ +function renderColor(totalErrors, totalWarnings) { + if (totalErrors !== 0) { + return 2; + } + if (totalWarnings !== 0) { + return 1; + } + return 0; +} + +/** + * Get HTML (table rows) describing the messages. + * @param {Array} messages Messages. + * @param {int} parentIndex Index of the parent HTML row. + * @param {Object} rulesMeta Dictionary containing metadata for each rule executed by the analysis. + * @returns {string} HTML (table rows) describing the messages. + */ +function renderMessages(messages, parentIndex, rulesMeta) { + + /** + * Get HTML (table row) describing a message. + * @param {Object} message Message. + * @returns {string} HTML (table row) describing a message. + */ + return lodash.map(messages, message => { + const lineNumber = message.line || 0; + const columnNumber = message.column || 0; + let ruleUrl; + + if (rulesMeta) { + const meta = rulesMeta[message.ruleId]; + + ruleUrl = lodash.get(meta, "docs.url", null); + } + + return messageTemplate({ + parentIndex, + lineNumber, + columnNumber, + severityNumber: message.severity, + severityName: message.severity === 1 ? "Warning" : "Error", + message: message.message, + ruleId: message.ruleId, + ruleUrl + }); + }).join("\n"); +} + +// eslint-disable-next-line jsdoc/require-description +/** + * @param {Array} results Test results. + * @param {Object} rulesMeta Dictionary containing metadata for each rule executed by the analysis. + * @returns {string} HTML string describing the results. + */ +function renderResults(results, rulesMeta) { + return lodash.map(results, (result, index) => resultTemplate({ + index, + color: renderColor(result.errorCount, result.warningCount), + filePath: result.filePath, + summary: renderSummary(result.errorCount, result.warningCount) + + }) + renderMessages(result.messages, index, rulesMeta)).join("\n"); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results, data) { + let totalErrors, + totalWarnings; + + const metaData = data ? data.rulesMeta : {}; + + totalErrors = 0; + totalWarnings = 0; + + // Iterate over results to get totals + results.forEach(result => { + totalErrors += result.errorCount; + totalWarnings += result.warningCount; + }); + + return pageTemplate({ + date: new Date(), + reportColor: renderColor(totalErrors, totalWarnings), + reportSummary: renderSummary(totalErrors, totalWarnings), + results: renderResults(results, metaData) + }); +}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/jslint-xml.js b/node_modules/eslint/lib/cli-engine/formatters/jslint-xml.js new file mode 100644 index 000000000..0ca1cbaed --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/jslint-xml.js @@ -0,0 +1,41 @@ +/** + * @fileoverview JSLint XML reporter + * @author Ian Christian Myers + */ +"use strict"; + +const xmlEscape = require("../xml-escape"); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + + let output = ""; + + output += ""; + output += ""; + + results.forEach(result => { + const messages = result.messages; + + output += ``; + + messages.forEach(message => { + output += [ + `` + ].join(" "); + }); + + output += ""; + + }); + + output += ""; + + return output; +}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/json-with-metadata.js b/node_modules/eslint/lib/cli-engine/formatters/json-with-metadata.js new file mode 100644 index 000000000..689947154 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/json-with-metadata.js @@ -0,0 +1,16 @@ +/** + * @fileoverview JSON reporter, including rules metadata + * @author Chris Meyer + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results, data) { + return JSON.stringify({ + results, + metadata: data + }); +}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/json.js b/node_modules/eslint/lib/cli-engine/formatters/json.js new file mode 100644 index 000000000..82138af18 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/json.js @@ -0,0 +1,13 @@ +/** + * @fileoverview JSON reporter + * @author Burak Yigit Kaya aka BYK + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + return JSON.stringify(results); +}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/junit.js b/node_modules/eslint/lib/cli-engine/formatters/junit.js new file mode 100644 index 000000000..a994b4b19 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/junit.js @@ -0,0 +1,82 @@ +/** + * @fileoverview jUnit Reporter + * @author Jamund Ferguson + */ +"use strict"; + +const xmlEscape = require("../xml-escape"); +const path = require("path"); + +//------------------------------------------------------------------------------ +// Helper Functions +//------------------------------------------------------------------------------ + +/** + * Returns the severity of warning or error + * @param {Object} message message object to examine + * @returns {string} severity level + * @private + */ +function getMessageType(message) { + if (message.fatal || message.severity === 2) { + return "Error"; + } + return "Warning"; + +} + +/** + * Returns a full file path without extension + * @param {string} filePath input file path + * @returns {string} file path without extension + * @private + */ +function pathWithoutExt(filePath) { + return path.join(path.dirname(filePath), path.basename(filePath, path.extname(filePath))); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + + let output = ""; + + output += "\n"; + output += "\n"; + + results.forEach(result => { + + const messages = result.messages; + const classname = pathWithoutExt(result.filePath); + + if (messages.length > 0) { + output += `\n`; + messages.forEach(message => { + const type = message.fatal ? "error" : "failure"; + + output += ``; + output += `<${type} message="${xmlEscape(message.message || "")}">`; + output += ""; + output += ``; + output += "\n"; + }); + output += "\n"; + } else { + output += `\n`; + output += `\n`; + output += "\n"; + } + + }); + + output += "\n"; + + return output; +}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/stylish.js b/node_modules/eslint/lib/cli-engine/formatters/stylish.js new file mode 100644 index 000000000..a808448b6 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/stylish.js @@ -0,0 +1,101 @@ +/** + * @fileoverview Stylish reporter + * @author Sindre Sorhus + */ +"use strict"; + +const chalk = require("chalk"), + stripAnsi = require("strip-ansi"), + table = require("text-table"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Given a word and a count, append an s if count is not one. + * @param {string} word A word in its singular form. + * @param {int} count A number controlling whether word should be pluralized. + * @returns {string} The original word with an s on the end if count is not one. + */ +function pluralize(word, count) { + return (count === 1 ? word : `${word}s`); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + + let output = "\n", + errorCount = 0, + warningCount = 0, + fixableErrorCount = 0, + fixableWarningCount = 0, + summaryColor = "yellow"; + + results.forEach(result => { + const messages = result.messages; + + if (messages.length === 0) { + return; + } + + errorCount += result.errorCount; + warningCount += result.warningCount; + fixableErrorCount += result.fixableErrorCount; + fixableWarningCount += result.fixableWarningCount; + + output += `${chalk.underline(result.filePath)}\n`; + + output += `${table( + messages.map(message => { + let messageType; + + if (message.fatal || message.severity === 2) { + messageType = chalk.red("error"); + summaryColor = "red"; + } else { + messageType = chalk.yellow("warning"); + } + + return [ + "", + message.line || 0, + message.column || 0, + messageType, + message.message.replace(/([^ ])\.$/u, "$1"), + chalk.dim(message.ruleId || "") + ]; + }), + { + align: ["", "r", "l"], + stringLength(str) { + return stripAnsi(str).length; + } + } + ).split("\n").map(el => el.replace(/(\d+)\s+(\d+)/u, (m, p1, p2) => chalk.dim(`${p1}:${p2}`))).join("\n")}\n\n`; + }); + + const total = errorCount + warningCount; + + if (total > 0) { + output += chalk[summaryColor].bold([ + "\u2716 ", total, pluralize(" problem", total), + " (", errorCount, pluralize(" error", errorCount), ", ", + warningCount, pluralize(" warning", warningCount), ")\n" + ].join("")); + + if (fixableErrorCount > 0 || fixableWarningCount > 0) { + output += chalk[summaryColor].bold([ + " ", fixableErrorCount, pluralize(" error", fixableErrorCount), " and ", + fixableWarningCount, pluralize(" warning", fixableWarningCount), + " potentially fixable with the `--fix` option.\n" + ].join("")); + } + } + + // Resets output color, for prevent change on top level + return total > 0 ? chalk.reset(output) : ""; +}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/table.js b/node_modules/eslint/lib/cli-engine/formatters/table.js new file mode 100644 index 000000000..a74cce0d5 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/table.js @@ -0,0 +1,159 @@ +/** + * @fileoverview "table reporter. + * @author Gajus Kuizinas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const chalk = require("chalk"), + table = require("table").table; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Given a word and a count, append an "s" if count is not one. + * @param {string} word A word. + * @param {number} count Quantity. + * @returns {string} The original word with an s on the end if count is not one. + */ +function pluralize(word, count) { + return (count === 1 ? word : `${word}s`); +} + +/** + * Draws text table. + * @param {Array} messages Error messages relating to a specific file. + * @returns {string} A text table. + */ +function drawTable(messages) { + const rows = []; + + if (messages.length === 0) { + return ""; + } + + rows.push([ + chalk.bold("Line"), + chalk.bold("Column"), + chalk.bold("Type"), + chalk.bold("Message"), + chalk.bold("Rule ID") + ]); + + messages.forEach(message => { + let messageType; + + if (message.fatal || message.severity === 2) { + messageType = chalk.red("error"); + } else { + messageType = chalk.yellow("warning"); + } + + rows.push([ + message.line || 0, + message.column || 0, + messageType, + message.message, + message.ruleId || "" + ]); + }); + + return table(rows, { + columns: { + 0: { + width: 8, + wrapWord: true + }, + 1: { + width: 8, + wrapWord: true + }, + 2: { + width: 8, + wrapWord: true + }, + 3: { + paddingRight: 5, + width: 50, + wrapWord: true + }, + 4: { + width: 20, + wrapWord: true + } + }, + drawHorizontalLine(index) { + return index === 1; + } + }); +} + +/** + * Draws a report (multiple tables). + * @param {Array} results Report results for every file. + * @returns {string} A column of text tables. + */ +function drawReport(results) { + let files; + + files = results.map(result => { + if (!result.messages.length) { + return ""; + } + + return `\n${result.filePath}\n\n${drawTable(result.messages)}`; + }); + + files = files.filter(content => content.trim()); + + return files.join(""); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(report) { + let result, + errorCount, + warningCount; + + result = ""; + errorCount = 0; + warningCount = 0; + + report.forEach(fileReport => { + errorCount += fileReport.errorCount; + warningCount += fileReport.warningCount; + }); + + if (errorCount || warningCount) { + result = drawReport(report); + } + + result += `\n${table([ + [ + chalk.red(pluralize(`${errorCount} Error`, errorCount)) + ], + [ + chalk.yellow(pluralize(`${warningCount} Warning`, warningCount)) + ] + ], { + columns: { + 0: { + width: 110, + wrapWord: true + } + }, + drawHorizontalLine() { + return true; + } + })}`; + + return result; +}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/tap.js b/node_modules/eslint/lib/cli-engine/formatters/tap.js new file mode 100644 index 000000000..354872a0c --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/tap.js @@ -0,0 +1,95 @@ +/** + * @fileoverview TAP reporter + * @author Jonathan Kingston + */ +"use strict"; + +const yaml = require("js-yaml"); + +//------------------------------------------------------------------------------ +// Helper Functions +//------------------------------------------------------------------------------ + +/** + * Returns a canonical error level string based upon the error message passed in. + * @param {Object} message Individual error message provided by eslint + * @returns {string} Error level string + */ +function getMessageType(message) { + if (message.fatal || message.severity === 2) { + return "error"; + } + return "warning"; +} + +/** + * Takes in a JavaScript object and outputs a TAP diagnostics string + * @param {Object} diagnostic JavaScript object to be embedded as YAML into output. + * @returns {string} diagnostics string with YAML embedded - TAP version 13 compliant + */ +function outputDiagnostics(diagnostic) { + const prefix = " "; + let output = `${prefix}---\n`; + + output += prefix + yaml.safeDump(diagnostic).split("\n").join(`\n${prefix}`); + output += "...\n"; + return output; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + let output = `TAP version 13\n1..${results.length}\n`; + + results.forEach((result, id) => { + const messages = result.messages; + let testResult = "ok"; + let diagnostics = {}; + + if (messages.length > 0) { + messages.forEach(message => { + const severity = getMessageType(message); + const diagnostic = { + message: message.message, + severity, + data: { + line: message.line || 0, + column: message.column || 0, + ruleId: message.ruleId || "" + } + }; + + // This ensures a warning message is not flagged as error + if (severity === "error") { + testResult = "not ok"; + } + + /* + * If we have multiple messages place them under a messages key + * The first error will be logged as message key + * This is to adhere to TAP 13 loosely defined specification of having a message key + */ + if ("message" in diagnostics) { + if (typeof diagnostics.messages === "undefined") { + diagnostics.messages = []; + } + diagnostics.messages.push(diagnostic); + } else { + diagnostics = diagnostic; + } + }); + } + + output += `${testResult} ${id + 1} - ${result.filePath}\n`; + + // If we have an error include diagnostics + if (messages.length > 0) { + output += outputDiagnostics(diagnostics); + } + + }); + + return output; +}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/unix.js b/node_modules/eslint/lib/cli-engine/formatters/unix.js new file mode 100644 index 000000000..c6c4ebbdb --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/unix.js @@ -0,0 +1,58 @@ +/** + * @fileoverview unix-style formatter. + * @author oshi-shinobu + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Helper Functions +//------------------------------------------------------------------------------ + +/** + * Returns a canonical error level string based upon the error message passed in. + * @param {Object} message Individual error message provided by eslint + * @returns {string} Error level string + */ +function getMessageType(message) { + if (message.fatal || message.severity === 2) { + return "Error"; + } + return "Warning"; + +} + + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + + let output = "", + total = 0; + + results.forEach(result => { + + const messages = result.messages; + + total += messages.length; + + messages.forEach(message => { + + output += `${result.filePath}:`; + output += `${message.line || 0}:`; + output += `${message.column || 0}:`; + output += ` ${message.message} `; + output += `[${getMessageType(message)}${message.ruleId ? `/${message.ruleId}` : ""}]`; + output += "\n"; + + }); + + }); + + if (total > 0) { + output += `\n${total} problem${total !== 1 ? "s" : ""}`; + } + + return output; +}; diff --git a/node_modules/eslint/lib/cli-engine/formatters/visualstudio.js b/node_modules/eslint/lib/cli-engine/formatters/visualstudio.js new file mode 100644 index 000000000..0d49431db --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/formatters/visualstudio.js @@ -0,0 +1,63 @@ +/** + * @fileoverview Visual Studio compatible formatter + * @author Ronald Pijnacker + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helper Functions +//------------------------------------------------------------------------------ + +/** + * Returns the severity of warning or error + * @param {Object} message message object to examine + * @returns {string} severity level + * @private + */ +function getMessageType(message) { + if (message.fatal || message.severity === 2) { + return "error"; + } + return "warning"; + +} + + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + + let output = "", + total = 0; + + results.forEach(result => { + + const messages = result.messages; + + total += messages.length; + + messages.forEach(message => { + + output += result.filePath; + output += `(${message.line || 0}`; + output += message.column ? `,${message.column}` : ""; + output += `): ${getMessageType(message)}`; + output += message.ruleId ? ` ${message.ruleId}` : ""; + output += ` : ${message.message}`; + output += "\n"; + + }); + + }); + + if (total === 0) { + output += "no problems"; + } else { + output += `\n${total} problem${total !== 1 ? "s" : ""}`; + } + + return output; +}; diff --git a/node_modules/eslint/lib/cli-engine/hash.js b/node_modules/eslint/lib/cli-engine/hash.js new file mode 100644 index 000000000..6d7ef8bf1 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/hash.js @@ -0,0 +1,35 @@ +/** + * @fileoverview Defining the hashing function in one place. + * @author Michael Ficarra + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const murmur = require("imurmurhash"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * hash the given string + * @param {string} str the string to hash + * @returns {string} the hash + */ +function hash(str) { + return murmur(str).result().toString(36); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = hash; diff --git a/node_modules/eslint/lib/cli-engine/index.js b/node_modules/eslint/lib/cli-engine/index.js new file mode 100644 index 000000000..52e45a6d7 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/index.js @@ -0,0 +1,7 @@ +"use strict"; + +const { CLIEngine } = require("./cli-engine"); + +module.exports = { + CLIEngine +}; diff --git a/node_modules/eslint/lib/cli-engine/lint-result-cache.js b/node_modules/eslint/lib/cli-engine/lint-result-cache.js new file mode 100644 index 000000000..23a142097 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/lint-result-cache.js @@ -0,0 +1,142 @@ +/** + * @fileoverview Utility for caching lint results. + * @author Kevin Partington + */ +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const assert = require("assert"); +const fs = require("fs"); +const fileEntryCache = require("file-entry-cache"); +const stringify = require("json-stable-stringify-without-jsonify"); +const pkg = require("../../package.json"); +const hash = require("./hash"); + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +const configHashCache = new WeakMap(); +const nodeVersion = process && process.version; + +/** + * Calculates the hash of the config + * @param {ConfigArray} config The config. + * @returns {string} The hash of the config + */ +function hashOfConfigFor(config) { + if (!configHashCache.has(config)) { + configHashCache.set(config, hash(`${pkg.version}_${nodeVersion}_${stringify(config)}`)); + } + + return configHashCache.get(config); +} + +//----------------------------------------------------------------------------- +// Public Interface +//----------------------------------------------------------------------------- + +/** + * Lint result cache. This wraps around the file-entry-cache module, + * transparently removing properties that are difficult or expensive to + * serialize and adding them back in on retrieval. + */ +class LintResultCache { + + /** + * Creates a new LintResultCache instance. + * @param {string} cacheFileLocation The cache file location. + * configuration lookup by file path). + */ + constructor(cacheFileLocation) { + assert(cacheFileLocation, "Cache file location is required"); + + this.fileEntryCache = fileEntryCache.create(cacheFileLocation); + } + + /** + * Retrieve cached lint results for a given file path, if present in the + * cache. If the file is present and has not been changed, rebuild any + * missing result information. + * @param {string} filePath The file for which to retrieve lint results. + * @param {ConfigArray} config The config of the file. + * @returns {Object|null} The rebuilt lint results, or null if the file is + * changed or not in the filesystem. + */ + getCachedLintResults(filePath, config) { + + /* + * Cached lint results are valid if and only if: + * 1. The file is present in the filesystem + * 2. The file has not changed since the time it was previously linted + * 3. The ESLint configuration has not changed since the time the file + * was previously linted + * If any of these are not true, we will not reuse the lint results. + */ + + const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath); + const hashOfConfig = hashOfConfigFor(config); + const changed = fileDescriptor.changed || fileDescriptor.meta.hashOfConfig !== hashOfConfig; + + if (fileDescriptor.notFound || changed) { + return null; + } + + // If source is present but null, need to reread the file from the filesystem. + if (fileDescriptor.meta.results && fileDescriptor.meta.results.source === null) { + fileDescriptor.meta.results.source = fs.readFileSync(filePath, "utf-8"); + } + + return fileDescriptor.meta.results; + } + + /** + * Set the cached lint results for a given file path, after removing any + * information that will be both unnecessary and difficult to serialize. + * Avoids caching results with an "output" property (meaning fixes were + * applied), to prevent potentially incorrect results if fixes are not + * written to disk. + * @param {string} filePath The file for which to set lint results. + * @param {ConfigArray} config The config of the file. + * @param {Object} result The lint result to be set for the file. + * @returns {void} + */ + setCachedLintResults(filePath, config, result) { + if (result && Object.prototype.hasOwnProperty.call(result, "output")) { + return; + } + + const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath); + + if (fileDescriptor && !fileDescriptor.notFound) { + + // Serialize the result, except that we want to remove the file source if present. + const resultToSerialize = Object.assign({}, result); + + /* + * Set result.source to null. + * In `getCachedLintResults`, if source is explicitly null, we will + * read the file from the filesystem to set the value again. + */ + if (Object.prototype.hasOwnProperty.call(resultToSerialize, "source")) { + resultToSerialize.source = null; + } + + fileDescriptor.meta.results = resultToSerialize; + fileDescriptor.meta.hashOfConfig = hashOfConfigFor(config); + } + } + + /** + * Persists the in-memory cache to disk. + * @returns {void} + */ + reconcile() { + this.fileEntryCache.reconcile(); + } +} + +module.exports = LintResultCache; diff --git a/node_modules/eslint/lib/cli-engine/load-rules.js b/node_modules/eslint/lib/cli-engine/load-rules.js new file mode 100644 index 000000000..81bab63fa --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/load-rules.js @@ -0,0 +1,46 @@ +/** + * @fileoverview Module for loading rules from files and directories. + * @author Michael Ficarra + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const fs = require("fs"), + path = require("path"); + +const rulesDirCache = {}; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Load all rule modules from specified directory. + * @param {string} relativeRulesDir Path to rules directory, may be relative. + * @param {string} cwd Current working directory + * @returns {Object} Loaded rule modules. + */ +module.exports = function(relativeRulesDir, cwd) { + const rulesDir = path.resolve(cwd, relativeRulesDir); + + // cache will help performance as IO operation are expensive + if (rulesDirCache[rulesDir]) { + return rulesDirCache[rulesDir]; + } + + const rules = Object.create(null); + + fs.readdirSync(rulesDir).forEach(file => { + if (path.extname(file) !== ".js") { + return; + } + rules[file.slice(0, -3)] = require(path.join(rulesDir, file)); + }); + rulesDirCache[rulesDir] = rules; + + return rules; +}; diff --git a/node_modules/eslint/lib/cli-engine/xml-escape.js b/node_modules/eslint/lib/cli-engine/xml-escape.js new file mode 100644 index 000000000..175c2c0c2 --- /dev/null +++ b/node_modules/eslint/lib/cli-engine/xml-escape.js @@ -0,0 +1,34 @@ +/** + * @fileoverview XML character escaper + * @author George Chung + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Returns the escaped value for a character + * @param {string} s string to examine + * @returns {string} severity level + * @private + */ +module.exports = function(s) { + return (`${s}`).replace(/[<>&"'\x00-\x1F\x7F\u0080-\uFFFF]/gu, c => { // eslint-disable-line no-control-regex + switch (c) { + case "<": + return "<"; + case ">": + return ">"; + case "&": + return "&"; + case "\"": + return """; + case "'": + return "'"; + default: + return `&#${c.charCodeAt(0)};`; + } + }); +}; diff --git a/node_modules/eslint/lib/cli.js b/node_modules/eslint/lib/cli.js new file mode 100644 index 000000000..ce1187800 --- /dev/null +++ b/node_modules/eslint/lib/cli.js @@ -0,0 +1,326 @@ +/** + * @fileoverview Main CLI object. + * @author Nicholas C. Zakas + */ + +"use strict"; + +/* + * The CLI object should *not* call process.exit() directly. It should only return + * exit codes. This allows other programs to use the CLI object and still control + * when the program exits. + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const fs = require("fs"), + path = require("path"), + { promisify } = require("util"), + { ESLint } = require("./eslint"), + CLIOptions = require("./options"), + log = require("./shared/logging"), + RuntimeInfo = require("./shared/runtime-info"); + +const debug = require("debug")("eslint:cli"); + +//------------------------------------------------------------------------------ +// Types +//------------------------------------------------------------------------------ + +/** @typedef {import("./eslint/eslint").ESLintOptions} ESLintOptions */ +/** @typedef {import("./eslint/eslint").LintMessage} LintMessage */ +/** @typedef {import("./eslint/eslint").LintResult} LintResult */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const mkdir = promisify(fs.mkdir); +const stat = promisify(fs.stat); +const writeFile = promisify(fs.writeFile); + +/** + * Predicate function for whether or not to apply fixes in quiet mode. + * If a message is a warning, do not apply a fix. + * @param {LintMessage} message The lint result. + * @returns {boolean} True if the lint message is an error (and thus should be + * autofixed), false otherwise. + */ +function quietFixPredicate(message) { + return message.severity === 2; +} + +/** + * Translates the CLI options into the options expected by the CLIEngine. + * @param {Object} cliOptions The CLI options to translate. + * @returns {ESLintOptions} The options object for the CLIEngine. + * @private + */ +function translateOptions({ + cache, + cacheFile, + cacheLocation, + config, + env, + errorOnUnmatchedPattern, + eslintrc, + ext, + fix, + fixDryRun, + fixType, + global, + ignore, + ignorePath, + ignorePattern, + inlineConfig, + parser, + parserOptions, + plugin, + quiet, + reportUnusedDisableDirectives, + resolvePluginsRelativeTo, + rule, + rulesdir +}) { + return { + allowInlineConfig: inlineConfig, + cache, + cacheLocation: cacheLocation || cacheFile, + errorOnUnmatchedPattern, + extensions: ext, + fix: (fix || fixDryRun) && (quiet ? quietFixPredicate : true), + fixTypes: fixType, + ignore, + ignorePath, + overrideConfig: { + env: env && env.reduce((obj, name) => { + obj[name] = true; + return obj; + }, {}), + globals: global && global.reduce((obj, name) => { + if (name.endsWith(":true")) { + obj[name.slice(0, -5)] = "writable"; + } else { + obj[name] = "readonly"; + } + return obj; + }, {}), + ignorePatterns: ignorePattern, + parser, + parserOptions, + plugins: plugin, + rules: rule + }, + overrideConfigFile: config, + reportUnusedDisableDirectives: reportUnusedDisableDirectives ? "error" : void 0, + resolvePluginsRelativeTo, + rulePaths: rulesdir, + useEslintrc: eslintrc + }; +} + +/** + * Count error messages. + * @param {LintResult[]} results The lint results. + * @returns {{errorCount:number;warningCount:number}} The number of error messages. + */ +function countErrors(results) { + let errorCount = 0; + let warningCount = 0; + + for (const result of results) { + errorCount += result.errorCount; + warningCount += result.warningCount; + } + + return { errorCount, warningCount }; +} + +/** + * Check if a given file path is a directory or not. + * @param {string} filePath The path to a file to check. + * @returns {Promise} `true` if the given path is a directory. + */ +async function isDirectory(filePath) { + try { + return (await stat(filePath)).isDirectory(); + } catch (error) { + if (error.code === "ENOENT" || error.code === "ENOTDIR") { + return false; + } + throw error; + } +} + +/** + * Outputs the results of the linting. + * @param {ESLint} engine The ESLint instance to use. + * @param {LintResult[]} results The results to print. + * @param {string} format The name of the formatter to use or the path to the formatter. + * @param {string} outputFile The path for the output file. + * @returns {Promise} True if the printing succeeds, false if not. + * @private + */ +async function printResults(engine, results, format, outputFile) { + let formatter; + + try { + formatter = await engine.loadFormatter(format); + } catch (e) { + log.error(e.message); + return false; + } + + const output = formatter.format(results); + + if (output) { + if (outputFile) { + const filePath = path.resolve(process.cwd(), outputFile); + + if (await isDirectory(filePath)) { + log.error("Cannot write to output file path, it is a directory: %s", outputFile); + return false; + } + + try { + await mkdir(path.dirname(filePath), { recursive: true }); + await writeFile(filePath, output); + } catch (ex) { + log.error("There was a problem writing the output file:\n%s", ex); + return false; + } + } else { + log.info(output); + } + } + + return true; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Encapsulates all CLI behavior for eslint. Makes it easier to test as well as + * for other Node.js programs to effectively run the CLI. + */ +const cli = { + + /** + * Executes the CLI based on an array of arguments that is passed in. + * @param {string|Array|Object} args The arguments to process. + * @param {string} [text] The text to lint (used for TTY). + * @returns {Promise} The exit code for the operation. + */ + async execute(args, text) { + if (Array.isArray(args)) { + debug("CLI args: %o", args.slice(2)); + } + let options; + + try { + options = CLIOptions.parse(args); + } catch (error) { + log.error(error.message); + return 2; + } + + const files = options._; + const useStdin = typeof text === "string"; + + if (options.help) { + log.info(CLIOptions.generateHelp()); + return 0; + } + if (options.version) { + log.info(RuntimeInfo.version()); + return 0; + } + if (options.envInfo) { + try { + log.info(RuntimeInfo.environment()); + return 0; + } catch (err) { + log.error(err.message); + return 2; + } + } + + if (options.printConfig) { + if (files.length) { + log.error("The --print-config option must be used with exactly one file name."); + return 2; + } + if (useStdin) { + log.error("The --print-config option is not available for piped-in code."); + return 2; + } + + const engine = new ESLint(translateOptions(options)); + const fileConfig = + await engine.calculateConfigForFile(options.printConfig); + + log.info(JSON.stringify(fileConfig, null, " ")); + return 0; + } + + debug(`Running on ${useStdin ? "text" : "files"}`); + + if (options.fix && options.fixDryRun) { + log.error("The --fix option and the --fix-dry-run option cannot be used together."); + return 2; + } + if (useStdin && options.fix) { + log.error("The --fix option is not available for piped-in code; use --fix-dry-run instead."); + return 2; + } + if (options.fixType && !options.fix && !options.fixDryRun) { + log.error("The --fix-type option requires either --fix or --fix-dry-run."); + return 2; + } + + const engine = new ESLint(translateOptions(options)); + let results; + + if (useStdin) { + results = await engine.lintText(text, { + filePath: options.stdinFilename, + warnIgnored: true + }); + } else { + results = await engine.lintFiles(files); + } + + if (options.fix) { + debug("Fix mode enabled - applying fixes"); + await ESLint.outputFixes(results); + } + + if (options.quiet) { + debug("Quiet mode enabled - filtering out warnings"); + results = ESLint.getErrorResults(results); + } + + if (await printResults(engine, results, options.format, options.outputFile)) { + const { errorCount, warningCount } = countErrors(results); + const tooManyWarnings = + options.maxWarnings >= 0 && warningCount > options.maxWarnings; + + if (!errorCount && tooManyWarnings) { + log.error( + "ESLint found too many warnings (maximum: %s).", + options.maxWarnings + ); + } + + return (errorCount || tooManyWarnings) ? 1 : 0; + } + + return 2; + } +}; + +module.exports = cli; diff --git a/node_modules/eslint/lib/eslint/eslint.js b/node_modules/eslint/lib/eslint/eslint.js new file mode 100644 index 000000000..a51ffbfe4 --- /dev/null +++ b/node_modules/eslint/lib/eslint/eslint.js @@ -0,0 +1,662 @@ +/** + * @fileoverview Main API Class + * @author Kai Cataldo + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const path = require("path"); +const fs = require("fs"); +const { promisify } = require("util"); +const { CLIEngine, getCLIEngineInternalSlots } = require("../cli-engine/cli-engine"); +const BuiltinRules = require("../rules"); +const { + Legacy: { + ConfigOps: { + getRuleSeverity + } + } +} = require("@eslint/eslintrc"); +const { version } = require("../../package.json"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** @typedef {import("../cli-engine/cli-engine").LintReport} CLIEngineLintReport */ +/** @typedef {import("../shared/types").DeprecatedRuleInfo} DeprecatedRuleInfo */ +/** @typedef {import("../shared/types").ConfigData} ConfigData */ +/** @typedef {import("../shared/types").LintMessage} LintMessage */ +/** @typedef {import("../shared/types").Plugin} Plugin */ +/** @typedef {import("../shared/types").Rule} Rule */ +/** @typedef {import("./load-formatter").Formatter} Formatter */ + +/** + * The options with which to configure the ESLint instance. + * @typedef {Object} ESLintOptions + * @property {boolean} [allowInlineConfig] Enable or disable inline configuration comments. + * @property {ConfigData} [baseConfig] Base config object, extended by all configs used with this instance + * @property {boolean} [cache] Enable result caching. + * @property {string} [cacheLocation] The cache file to use instead of .eslintcache. + * @property {string} [cwd] The value to use for the current working directory. + * @property {boolean} [errorOnUnmatchedPattern] If `false` then `ESLint#lintFiles()` doesn't throw even if no target files found. Defaults to `true`. + * @property {string[]} [extensions] An array of file extensions to check. + * @property {boolean|Function} [fix] Execute in autofix mode. If a function, should return a boolean. + * @property {string[]} [fixTypes] Array of rule types to apply fixes for. + * @property {boolean} [globInputPaths] Set to false to skip glob resolution of input file paths to lint (default: true). If false, each input file paths is assumed to be a non-glob path to an existing file. + * @property {boolean} [ignore] False disables use of .eslintignore. + * @property {string} [ignorePath] The ignore file to use instead of .eslintignore. + * @property {ConfigData} [overrideConfig] Override config object, overrides all configs used with this instance + * @property {string} [overrideConfigFile] The configuration file to use. + * @property {Record} [plugins] An array of plugin implementations. + * @property {"error" | "warn" | "off"} [reportUnusedDisableDirectives] the severity to report unused eslint-disable directives. + * @property {string} [resolvePluginsRelativeTo] The folder where plugins should be resolved from, defaulting to the CWD. + * @property {string[]} [rulePaths] An array of directories to load custom rules from. + * @property {boolean} [useEslintrc] False disables looking for .eslintrc.* files. + */ + +/** + * A rules metadata object. + * @typedef {Object} RulesMeta + * @property {string} id The plugin ID. + * @property {Object} definition The plugin definition. + */ + +/** + * A linting result. + * @typedef {Object} LintResult + * @property {string} filePath The path to the file that was linted. + * @property {LintMessage[]} messages All of the messages for the result. + * @property {number} errorCount Number of errors for the result. + * @property {number} warningCount Number of warnings for the result. + * @property {number} fixableErrorCount Number of fixable errors for the result. + * @property {number} fixableWarningCount Number of fixable warnings for the result. + * @property {string} [source] The source code of the file that was linted. + * @property {string} [output] The source code of the file that was linted, with as many fixes applied as possible. + * @property {DeprecatedRuleInfo[]} usedDeprecatedRules The list of used deprecated rules. + */ + +/** + * Private members for the `ESLint` instance. + * @typedef {Object} ESLintPrivateMembers + * @property {CLIEngine} cliEngine The wrapped CLIEngine instance. + * @property {ESLintOptions} options The options used to instantiate the ESLint instance. + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const writeFile = promisify(fs.writeFile); + +/** + * The map with which to store private class members. + * @type {WeakMap} + */ +const privateMembersMap = new WeakMap(); + +/** + * Check if a given value is a non-empty string or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if `x` is a non-empty string. + */ +function isNonEmptyString(x) { + return typeof x === "string" && x.trim() !== ""; +} + +/** + * Check if a given value is an array of non-empty stringss or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if `x` is an array of non-empty stringss. + */ +function isArrayOfNonEmptyString(x) { + return Array.isArray(x) && x.every(isNonEmptyString); +} + +/** + * Check if a given value is a valid fix type or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if `x` is valid fix type. + */ +function isFixType(x) { + return x === "problem" || x === "suggestion" || x === "layout"; +} + +/** + * Check if a given value is an array of fix types or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if `x` is an array of fix types. + */ +function isFixTypeArray(x) { + return Array.isArray(x) && x.every(isFixType); +} + +/** + * The error for invalid options. + */ +class ESLintInvalidOptionsError extends Error { + constructor(messages) { + super(`Invalid Options:\n- ${messages.join("\n- ")}`); + this.code = "ESLINT_INVALID_OPTIONS"; + Error.captureStackTrace(this, ESLintInvalidOptionsError); + } +} + +/** + * Validates and normalizes options for the wrapped CLIEngine instance. + * @param {ESLintOptions} options The options to process. + * @returns {ESLintOptions} The normalized options. + */ +function processOptions({ + allowInlineConfig = true, // ← we cannot use `overrideConfig.noInlineConfig` instead because `allowInlineConfig` has side-effect that suppress warnings that show inline configs are ignored. + baseConfig = null, + cache = false, + cacheLocation = ".eslintcache", + cwd = process.cwd(), + errorOnUnmatchedPattern = true, + extensions = null, // ← should be null by default because if it's an array then it suppresses RFC20 feature. + fix = false, + fixTypes = null, // ← should be null by default because if it's an array then it suppresses rules that don't have the `meta.type` property. + globInputPaths = true, + ignore = true, + ignorePath = null, // ← should be null by default because if it's a string then it may throw ENOENT. + overrideConfig = null, + overrideConfigFile = null, + plugins = {}, + reportUnusedDisableDirectives = null, // ← should be null by default because if it's a string then it overrides the 'reportUnusedDisableDirectives' setting in config files. And we cannot use `overrideConfig.reportUnusedDisableDirectives` instead because we cannot configure the `error` severity with that. + resolvePluginsRelativeTo = null, // ← should be null by default because if it's a string then it suppresses RFC47 feature. + rulePaths = [], + useEslintrc = true, + ...unknownOptions +}) { + const errors = []; + const unknownOptionKeys = Object.keys(unknownOptions); + + if (unknownOptionKeys.length >= 1) { + errors.push(`Unknown options: ${unknownOptionKeys.join(", ")}`); + if (unknownOptionKeys.includes("cacheFile")) { + errors.push("'cacheFile' has been removed. Please use the 'cacheLocation' option instead."); + } + if (unknownOptionKeys.includes("configFile")) { + errors.push("'configFile' has been removed. Please use the 'overrideConfigFile' option instead."); + } + if (unknownOptionKeys.includes("envs")) { + errors.push("'envs' has been removed. Please use the 'overrideConfig.env' option instead."); + } + if (unknownOptionKeys.includes("globals")) { + errors.push("'globals' has been removed. Please use the 'overrideConfig.globals' option instead."); + } + if (unknownOptionKeys.includes("ignorePattern")) { + errors.push("'ignorePattern' has been removed. Please use the 'overrideConfig.ignorePatterns' option instead."); + } + if (unknownOptionKeys.includes("parser")) { + errors.push("'parser' has been removed. Please use the 'overrideConfig.parser' option instead."); + } + if (unknownOptionKeys.includes("parserOptions")) { + errors.push("'parserOptions' has been removed. Please use the 'overrideConfig.parserOptions' option instead."); + } + if (unknownOptionKeys.includes("rules")) { + errors.push("'rules' has been removed. Please use the 'overrideConfig.rules' option instead."); + } + } + if (typeof allowInlineConfig !== "boolean") { + errors.push("'allowInlineConfig' must be a boolean."); + } + if (typeof baseConfig !== "object") { + errors.push("'baseConfig' must be an object or null."); + } + if (typeof cache !== "boolean") { + errors.push("'cache' must be a boolean."); + } + if (!isNonEmptyString(cacheLocation)) { + errors.push("'cacheLocation' must be a non-empty string."); + } + if (!isNonEmptyString(cwd) || !path.isAbsolute(cwd)) { + errors.push("'cwd' must be an absolute path."); + } + if (typeof errorOnUnmatchedPattern !== "boolean") { + errors.push("'errorOnUnmatchedPattern' must be a boolean."); + } + if (!isArrayOfNonEmptyString(extensions) && extensions !== null) { + errors.push("'extensions' must be an array of non-empty strings or null."); + } + if (typeof fix !== "boolean" && typeof fix !== "function") { + errors.push("'fix' must be a boolean or a function."); + } + if (fixTypes !== null && !isFixTypeArray(fixTypes)) { + errors.push("'fixTypes' must be an array of any of \"problem\", \"suggestion\", and \"layout\"."); + } + if (typeof globInputPaths !== "boolean") { + errors.push("'globInputPaths' must be a boolean."); + } + if (typeof ignore !== "boolean") { + errors.push("'ignore' must be a boolean."); + } + if (!isNonEmptyString(ignorePath) && ignorePath !== null) { + errors.push("'ignorePath' must be a non-empty string or null."); + } + if (typeof overrideConfig !== "object") { + errors.push("'overrideConfig' must be an object or null."); + } + if (!isNonEmptyString(overrideConfigFile) && overrideConfigFile !== null) { + errors.push("'overrideConfigFile' must be a non-empty string or null."); + } + if (typeof plugins !== "object") { + errors.push("'plugins' must be an object or null."); + } else if (plugins !== null && Object.keys(plugins).includes("")) { + errors.push("'plugins' must not include an empty string."); + } + if (Array.isArray(plugins)) { + errors.push("'plugins' doesn't add plugins to configuration to load. Please use the 'overrideConfig.plugins' option instead."); + } + if ( + reportUnusedDisableDirectives !== "error" && + reportUnusedDisableDirectives !== "warn" && + reportUnusedDisableDirectives !== "off" && + reportUnusedDisableDirectives !== null + ) { + errors.push("'reportUnusedDisableDirectives' must be any of \"error\", \"warn\", \"off\", and null."); + } + if ( + !isNonEmptyString(resolvePluginsRelativeTo) && + resolvePluginsRelativeTo !== null + ) { + errors.push("'resolvePluginsRelativeTo' must be a non-empty string or null."); + } + if (!isArrayOfNonEmptyString(rulePaths)) { + errors.push("'rulePaths' must be an array of non-empty strings."); + } + if (typeof useEslintrc !== "boolean") { + errors.push("'useElintrc' must be a boolean."); + } + + if (errors.length > 0) { + throw new ESLintInvalidOptionsError(errors); + } + + return { + allowInlineConfig, + baseConfig, + cache, + cacheLocation, + configFile: overrideConfigFile, + cwd, + errorOnUnmatchedPattern, + extensions, + fix, + fixTypes, + globInputPaths, + ignore, + ignorePath, + reportUnusedDisableDirectives, + resolvePluginsRelativeTo, + rulePaths, + useEslintrc + }; +} + +/** + * Check if a value has one or more properties and that value is not undefined. + * @param {any} obj The value to check. + * @returns {boolean} `true` if `obj` has one or more properties that that value is not undefined. + */ +function hasDefinedProperty(obj) { + if (typeof obj === "object" && obj !== null) { + for (const key in obj) { + if (typeof obj[key] !== "undefined") { + return true; + } + } + } + return false; +} + +/** + * Create rulesMeta object. + * @param {Map} rules a map of rules from which to generate the object. + * @returns {Object} metadata for all enabled rules. + */ +function createRulesMeta(rules) { + return Array.from(rules).reduce((retVal, [id, rule]) => { + retVal[id] = rule.meta; + return retVal; + }, {}); +} + +/** @type {WeakMap} */ +const usedDeprecatedRulesCache = new WeakMap(); + +/** + * Create used deprecated rule list. + * @param {CLIEngine} cliEngine The CLIEngine instance. + * @param {string} maybeFilePath The absolute path to a lint target file or `""`. + * @returns {DeprecatedRuleInfo[]} The used deprecated rule list. + */ +function getOrFindUsedDeprecatedRules(cliEngine, maybeFilePath) { + const { + configArrayFactory, + options: { cwd } + } = getCLIEngineInternalSlots(cliEngine); + const filePath = path.isAbsolute(maybeFilePath) + ? maybeFilePath + : path.join(cwd, "__placeholder__.js"); + const configArray = configArrayFactory.getConfigArrayForFile(filePath); + const config = configArray.extractConfig(filePath); + + // Most files use the same config, so cache it. + if (!usedDeprecatedRulesCache.has(config)) { + const pluginRules = configArray.pluginRules; + const retv = []; + + for (const [ruleId, ruleConf] of Object.entries(config.rules)) { + if (getRuleSeverity(ruleConf) === 0) { + continue; + } + const rule = pluginRules.get(ruleId) || BuiltinRules.get(ruleId); + const meta = rule && rule.meta; + + if (meta && meta.deprecated) { + retv.push({ ruleId, replacedBy: meta.replacedBy || [] }); + } + } + + usedDeprecatedRulesCache.set(config, Object.freeze(retv)); + } + + return usedDeprecatedRulesCache.get(config); +} + +/** + * Processes the linting results generated by a CLIEngine linting report to + * match the ESLint class's API. + * @param {CLIEngine} cliEngine The CLIEngine instance. + * @param {CLIEngineLintReport} report The CLIEngine linting report to process. + * @returns {LintResult[]} The processed linting results. + */ +function processCLIEngineLintReport(cliEngine, { results }) { + const descriptor = { + configurable: true, + enumerable: true, + get() { + return getOrFindUsedDeprecatedRules(cliEngine, this.filePath); + } + }; + + for (const result of results) { + Object.defineProperty(result, "usedDeprecatedRules", descriptor); + } + + return results; +} + +/** + * An Array.prototype.sort() compatible compare function to order results by their file path. + * @param {LintResult} a The first lint result. + * @param {LintResult} b The second lint result. + * @returns {number} An integer representing the order in which the two results should occur. + */ +function compareResultsByFilePath(a, b) { + if (a.filePath < b.filePath) { + return -1; + } + + if (a.filePath > b.filePath) { + return 1; + } + + return 0; +} + +class ESLint { + + /** + * Creates a new instance of the main ESLint API. + * @param {ESLintOptions} options The options for this instance. + */ + constructor(options = {}) { + const processedOptions = processOptions(options); + const cliEngine = new CLIEngine(processedOptions); + const { + additionalPluginPool, + configArrayFactory, + lastConfigArrays + } = getCLIEngineInternalSlots(cliEngine); + let updated = false; + + /* + * Address `plugins` to add plugin implementations. + * Operate the `additionalPluginPool` internal slot directly to avoid + * using `addPlugin(id, plugin)` method that resets cache everytime. + */ + if (options.plugins) { + for (const [id, plugin] of Object.entries(options.plugins)) { + additionalPluginPool.set(id, plugin); + updated = true; + } + } + + /* + * Address `overrideConfig` to set override config. + * Operate the `configArrayFactory` internal slot directly because this + * functionality doesn't exist as the public API of CLIEngine. + */ + if (hasDefinedProperty(options.overrideConfig)) { + configArrayFactory.setOverrideConfig(options.overrideConfig); + updated = true; + } + + // Update caches. + if (updated) { + configArrayFactory.clearCache(); + lastConfigArrays[0] = configArrayFactory.getConfigArrayForFile(); + } + + // Initialize private properties. + privateMembersMap.set(this, { + cliEngine, + options: processedOptions + }); + } + + /** + * The version text. + * @type {string} + */ + static get version() { + return version; + } + + /** + * Outputs fixes from the given results to files. + * @param {LintResult[]} results The lint results. + * @returns {Promise} Returns a promise that is used to track side effects. + */ + static async outputFixes(results) { + if (!Array.isArray(results)) { + throw new Error("'results' must be an array"); + } + + await Promise.all( + results + .filter(result => { + if (typeof result !== "object" || result === null) { + throw new Error("'results' must include only objects"); + } + return ( + typeof result.output === "string" && + path.isAbsolute(result.filePath) + ); + }) + .map(r => writeFile(r.filePath, r.output)) + ); + } + + /** + * Returns results that only contains errors. + * @param {LintResult[]} results The results to filter. + * @returns {LintResult[]} The filtered results. + */ + static getErrorResults(results) { + return CLIEngine.getErrorResults(results); + } + + /** + * Executes the current configuration on an array of file and directory names. + * @param {string[]} patterns An array of file and directory names. + * @returns {Promise} The results of linting the file patterns given. + */ + async lintFiles(patterns) { + if (!isNonEmptyString(patterns) && !isArrayOfNonEmptyString(patterns)) { + throw new Error("'patterns' must be a non-empty string or an array of non-empty strings"); + } + const { cliEngine } = privateMembersMap.get(this); + + return processCLIEngineLintReport( + cliEngine, + cliEngine.executeOnFiles(patterns) + ); + } + + /** + * Executes the current configuration on text. + * @param {string} code A string of JavaScript code to lint. + * @param {Object} [options] The options. + * @param {string} [options.filePath] The path to the file of the source code. + * @param {boolean} [options.warnIgnored] When set to true, warn if given filePath is an ignored path. + * @returns {Promise} The results of linting the string of code given. + */ + async lintText(code, options = {}) { + if (typeof code !== "string") { + throw new Error("'code' must be a string"); + } + if (typeof options !== "object") { + throw new Error("'options' must be an object, null, or undefined"); + } + const { + filePath, + warnIgnored = false, + ...unknownOptions + } = options || {}; + + for (const key of Object.keys(unknownOptions)) { + throw new Error(`'options' must not include the unknown option '${key}'`); + } + if (filePath !== void 0 && !isNonEmptyString(filePath)) { + throw new Error("'options.filePath' must be a non-empty string or undefined"); + } + if (typeof warnIgnored !== "boolean") { + throw new Error("'options.warnIgnored' must be a boolean or undefined"); + } + + const { cliEngine } = privateMembersMap.get(this); + + return processCLIEngineLintReport( + cliEngine, + cliEngine.executeOnText(code, filePath, warnIgnored) + ); + } + + /** + * Returns the formatter representing the given formatter name. + * @param {string} [name] The name of the formattter to load. + * The following values are allowed: + * - `undefined` ... Load `stylish` builtin formatter. + * - A builtin formatter name ... Load the builtin formatter. + * - A thirdparty formatter name: + * - `foo` → `eslint-formatter-foo` + * - `@foo` → `@foo/eslint-formatter` + * - `@foo/bar` → `@foo/eslint-formatter-bar` + * - A file path ... Load the file. + * @returns {Promise} A promise resolving to the formatter object. + * This promise will be rejected if the given formatter was not found or not + * a function. + */ + async loadFormatter(name = "stylish") { + if (typeof name !== "string") { + throw new Error("'name' must be a string"); + } + + const { cliEngine } = privateMembersMap.get(this); + const formatter = cliEngine.getFormatter(name); + + if (typeof formatter !== "function") { + throw new Error(`Formatter must be a function, but got a ${typeof formatter}.`); + } + + return { + + /** + * The main formatter method. + * @param {LintResults[]} results The lint results to format. + * @returns {string} The formatted lint results. + */ + format(results) { + let rulesMeta = null; + + results.sort(compareResultsByFilePath); + + return formatter(results, { + get rulesMeta() { + if (!rulesMeta) { + rulesMeta = createRulesMeta(cliEngine.getRules()); + } + + return rulesMeta; + } + }); + } + }; + } + + /** + * Returns a configuration object for the given file based on the CLI options. + * This is the same logic used by the ESLint CLI executable to determine + * configuration for each file it processes. + * @param {string} filePath The path of the file to retrieve a config object for. + * @returns {Promise} A configuration object for the file. + */ + async calculateConfigForFile(filePath) { + if (!isNonEmptyString(filePath)) { + throw new Error("'filePath' must be a non-empty string"); + } + const { cliEngine } = privateMembersMap.get(this); + + return cliEngine.getConfigForFile(filePath); + } + + /** + * Checks if a given path is ignored by ESLint. + * @param {string} filePath The path of the file to check. + * @returns {Promise} Whether or not the given path is ignored. + */ + async isPathIgnored(filePath) { + if (!isNonEmptyString(filePath)) { + throw new Error("'filePath' must be a non-empty string"); + } + const { cliEngine } = privateMembersMap.get(this); + + return cliEngine.isPathIgnored(filePath); + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + ESLint, + + /** + * Get the private class members of a given ESLint instance for tests. + * @param {ESLint} instance The ESLint instance to get. + * @returns {ESLintPrivateMembers} The instance's private class members. + */ + getESLintPrivateMembers(instance) { + return privateMembersMap.get(instance); + } +}; diff --git a/node_modules/eslint/lib/eslint/index.js b/node_modules/eslint/lib/eslint/index.js new file mode 100644 index 000000000..c9185ee0e --- /dev/null +++ b/node_modules/eslint/lib/eslint/index.js @@ -0,0 +1,7 @@ +"use strict"; + +const { ESLint } = require("./eslint"); + +module.exports = { + ESLint +}; diff --git a/node_modules/eslint/lib/init/autoconfig.js b/node_modules/eslint/lib/init/autoconfig.js new file mode 100644 index 000000000..0ace177aa --- /dev/null +++ b/node_modules/eslint/lib/init/autoconfig.js @@ -0,0 +1,348 @@ +/** + * @fileoverview Used for creating a suggested configuration based on project code. + * @author Ian VanSchooten + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"), + recConfig = require("../../conf/eslint-recommended"), + ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops"), + { Linter } = require("../linter"), + configRule = require("./config-rule"); + +const debug = require("debug")("eslint:autoconfig"); +const linter = new Linter(); + +//------------------------------------------------------------------------------ +// Data +//------------------------------------------------------------------------------ + +const MAX_CONFIG_COMBINATIONS = 17, // 16 combinations + 1 for severity only + RECOMMENDED_CONFIG_NAME = "eslint:recommended"; + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * Information about a rule configuration, in the context of a Registry. + * @typedef {Object} registryItem + * @param {ruleConfig} config A valid configuration for the rule + * @param {number} specificity The number of elements in the ruleConfig array + * @param {number} errorCount The number of errors encountered when linting with the config + */ + +/** + * This callback is used to measure execution status in a progress bar + * @callback progressCallback + * @param {number} The total number of times the callback will be called. + */ + +/** + * Create registryItems for rules + * @param {rulesConfig} rulesConfig Hash of rule names and arrays of ruleConfig items + * @returns {Object} registryItems for each rule in provided rulesConfig + */ +function makeRegistryItems(rulesConfig) { + return Object.keys(rulesConfig).reduce((accumulator, ruleId) => { + accumulator[ruleId] = rulesConfig[ruleId].map(config => ({ + config, + specificity: config.length || 1, + errorCount: void 0 + })); + return accumulator; + }, {}); +} + +/** + * Creates an object in which to store rule configs and error counts + * + * Unless a rulesConfig is provided at construction, the registry will not contain + * any rules, only methods. This will be useful for building up registries manually. + * + * Registry class + */ +class Registry { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {rulesConfig} [rulesConfig] Hash of rule names and arrays of possible configurations + */ + constructor(rulesConfig) { + this.rules = (rulesConfig) ? makeRegistryItems(rulesConfig) : {}; + } + + /** + * Populate the registry with core rule configs. + * + * It will set the registry's `rule` property to an object having rule names + * as keys and an array of registryItems as values. + * @returns {void} + */ + populateFromCoreRules() { + const rulesConfig = configRule.createCoreRuleConfigs(); + + this.rules = makeRegistryItems(rulesConfig); + } + + /** + * Creates sets of rule configurations which can be used for linting + * and initializes registry errors to zero for those configurations (side effect). + * + * This combines as many rules together as possible, such that the first sets + * in the array will have the highest number of rules configured, and later sets + * will have fewer and fewer, as not all rules have the same number of possible + * configurations. + * + * The length of the returned array will be <= MAX_CONFIG_COMBINATIONS. + * @returns {Object[]} "rules" configurations to use for linting + */ + buildRuleSets() { + let idx = 0; + const ruleIds = Object.keys(this.rules), + ruleSets = []; + + /** + * Add a rule configuration from the registry to the ruleSets + * + * This is broken out into its own function so that it doesn't need to be + * created inside of the while loop. + * @param {string} rule The ruleId to add. + * @returns {void} + */ + const addRuleToRuleSet = function(rule) { + + /* + * This check ensures that there is a rule configuration and that + * it has fewer than the max combinations allowed. + * If it has too many configs, we will only use the most basic of + * the possible configurations. + */ + const hasFewCombos = (this.rules[rule].length <= MAX_CONFIG_COMBINATIONS); + + if (this.rules[rule][idx] && (hasFewCombos || this.rules[rule][idx].specificity <= 2)) { + + /* + * If the rule has too many possible combinations, only take + * simple ones, avoiding objects. + */ + if (!hasFewCombos && typeof this.rules[rule][idx].config[1] === "object") { + return; + } + + ruleSets[idx] = ruleSets[idx] || {}; + ruleSets[idx][rule] = this.rules[rule][idx].config; + + /* + * Initialize errorCount to zero, since this is a config which + * will be linted. + */ + this.rules[rule][idx].errorCount = 0; + } + }.bind(this); + + while (ruleSets.length === idx) { + ruleIds.forEach(addRuleToRuleSet); + idx += 1; + } + + return ruleSets; + } + + /** + * Remove all items from the registry with a non-zero number of errors + * + * Note: this also removes rule configurations which were not linted + * (meaning, they have an undefined errorCount). + * @returns {void} + */ + stripFailingConfigs() { + const ruleIds = Object.keys(this.rules), + newRegistry = new Registry(); + + newRegistry.rules = Object.assign({}, this.rules); + ruleIds.forEach(ruleId => { + const errorFreeItems = newRegistry.rules[ruleId].filter(registryItem => (registryItem.errorCount === 0)); + + if (errorFreeItems.length > 0) { + newRegistry.rules[ruleId] = errorFreeItems; + } else { + delete newRegistry.rules[ruleId]; + } + }); + + return newRegistry; + } + + /** + * Removes rule configurations which were not included in a ruleSet + * @returns {void} + */ + stripExtraConfigs() { + const ruleIds = Object.keys(this.rules), + newRegistry = new Registry(); + + newRegistry.rules = Object.assign({}, this.rules); + ruleIds.forEach(ruleId => { + newRegistry.rules[ruleId] = newRegistry.rules[ruleId].filter(registryItem => (typeof registryItem.errorCount !== "undefined")); + }); + + return newRegistry; + } + + /** + * Creates a registry of rules which had no error-free configs. + * The new registry is intended to be analyzed to determine whether its rules + * should be disabled or set to warning. + * @returns {Registry} A registry of failing rules. + */ + getFailingRulesRegistry() { + const ruleIds = Object.keys(this.rules), + failingRegistry = new Registry(); + + ruleIds.forEach(ruleId => { + const failingConfigs = this.rules[ruleId].filter(registryItem => (registryItem.errorCount > 0)); + + if (failingConfigs && failingConfigs.length === this.rules[ruleId].length) { + failingRegistry.rules[ruleId] = failingConfigs; + } + }); + + return failingRegistry; + } + + /** + * Create an eslint config for any rules which only have one configuration + * in the registry. + * @returns {Object} An eslint config with rules section populated + */ + createConfig() { + const ruleIds = Object.keys(this.rules), + config = { rules: {} }; + + ruleIds.forEach(ruleId => { + if (this.rules[ruleId].length === 1) { + config.rules[ruleId] = this.rules[ruleId][0].config; + } + }); + + return config; + } + + /** + * Return a cloned registry containing only configs with a desired specificity + * @param {number} specificity Only keep configs with this specificity + * @returns {Registry} A registry of rules + */ + filterBySpecificity(specificity) { + const ruleIds = Object.keys(this.rules), + newRegistry = new Registry(); + + newRegistry.rules = Object.assign({}, this.rules); + ruleIds.forEach(ruleId => { + newRegistry.rules[ruleId] = this.rules[ruleId].filter(registryItem => (registryItem.specificity === specificity)); + }); + + return newRegistry; + } + + /** + * Lint SourceCodes against all configurations in the registry, and record results + * @param {Object[]} sourceCodes SourceCode objects for each filename + * @param {Object} config ESLint config object + * @param {progressCallback} [cb] Optional callback for reporting execution status + * @returns {Registry} New registry with errorCount populated + */ + lintSourceCode(sourceCodes, config, cb) { + let lintedRegistry = new Registry(); + + lintedRegistry.rules = Object.assign({}, this.rules); + + const ruleSets = lintedRegistry.buildRuleSets(); + + lintedRegistry = lintedRegistry.stripExtraConfigs(); + + debug("Linting with all possible rule combinations"); + + const filenames = Object.keys(sourceCodes); + const totalFilesLinting = filenames.length * ruleSets.length; + + filenames.forEach(filename => { + debug(`Linting file: ${filename}`); + + let ruleSetIdx = 0; + + ruleSets.forEach(ruleSet => { + const lintConfig = Object.assign({}, config, { rules: ruleSet }); + const lintResults = linter.verify(sourceCodes[filename], lintConfig); + + lintResults.forEach(result => { + + /* + * It is possible that the error is from a configuration comment + * in a linted file, in which case there may not be a config + * set in this ruleSetIdx. + * (https://github.com/eslint/eslint/issues/5992) + * (https://github.com/eslint/eslint/issues/7860) + */ + if ( + lintedRegistry.rules[result.ruleId] && + lintedRegistry.rules[result.ruleId][ruleSetIdx] + ) { + lintedRegistry.rules[result.ruleId][ruleSetIdx].errorCount += 1; + } + }); + + ruleSetIdx += 1; + + if (cb) { + cb(totalFilesLinting); // eslint-disable-line node/callback-return + } + }); + + // Deallocate for GC + sourceCodes[filename] = null; + }); + + return lintedRegistry; + } +} + +/** + * Extract rule configuration into eslint:recommended where possible. + * + * This will return a new config with `["extends": [ ..., "eslint:recommended"]` and + * only the rules which have configurations different from the recommended config. + * @param {Object} config config object + * @returns {Object} config object using `"extends": ["eslint:recommended"]` + */ +function extendFromRecommended(config) { + const newConfig = Object.assign({}, config); + + ConfigOps.normalizeToStrings(newConfig); + + const recRules = Object.keys(recConfig.rules).filter(ruleId => ConfigOps.isErrorSeverity(recConfig.rules[ruleId])); + + recRules.forEach(ruleId => { + if (lodash.isEqual(recConfig.rules[ruleId], newConfig.rules[ruleId])) { + delete newConfig.rules[ruleId]; + } + }); + newConfig.extends.unshift(RECOMMENDED_CONFIG_NAME); + return newConfig; +} + + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + Registry, + extendFromRecommended +}; diff --git a/node_modules/eslint/lib/init/config-file.js b/node_modules/eslint/lib/init/config-file.js new file mode 100644 index 000000000..fc62b8152 --- /dev/null +++ b/node_modules/eslint/lib/init/config-file.js @@ -0,0 +1,143 @@ +/** + * @fileoverview Helper to locate and load configuration files. + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const fs = require("fs"), + path = require("path"), + stringify = require("json-stable-stringify-without-jsonify"); + +const debug = require("debug")("eslint:config-file"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines sort order for object keys for json-stable-stringify + * + * see: https://github.com/samn/json-stable-stringify#cmp + * @param {Object} a The first comparison object ({key: akey, value: avalue}) + * @param {Object} b The second comparison object ({key: bkey, value: bvalue}) + * @returns {number} 1 or -1, used in stringify cmp method + */ +function sortByKey(a, b) { + return a.key > b.key ? 1 : -1; +} + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * Writes a configuration file in JSON format. + * @param {Object} config The configuration object to write. + * @param {string} filePath The filename to write to. + * @returns {void} + * @private + */ +function writeJSONConfigFile(config, filePath) { + debug(`Writing JSON config file: ${filePath}`); + + const content = `${stringify(config, { cmp: sortByKey, space: 4 })}\n`; + + fs.writeFileSync(filePath, content, "utf8"); +} + +/** + * Writes a configuration file in YAML format. + * @param {Object} config The configuration object to write. + * @param {string} filePath The filename to write to. + * @returns {void} + * @private + */ +function writeYAMLConfigFile(config, filePath) { + debug(`Writing YAML config file: ${filePath}`); + + // lazy load YAML to improve performance when not used + const yaml = require("js-yaml"); + + const content = yaml.safeDump(config, { sortKeys: true }); + + fs.writeFileSync(filePath, content, "utf8"); +} + +/** + * Writes a configuration file in JavaScript format. + * @param {Object} config The configuration object to write. + * @param {string} filePath The filename to write to. + * @throws {Error} If an error occurs linting the config file contents. + * @returns {void} + * @private + */ +function writeJSConfigFile(config, filePath) { + debug(`Writing JS config file: ${filePath}`); + + let contentToWrite; + const stringifiedContent = `module.exports = ${stringify(config, { cmp: sortByKey, space: 4 })};\n`; + + try { + const { CLIEngine } = require("../cli-engine"); + const linter = new CLIEngine({ + baseConfig: config, + fix: true, + useEslintrc: false + }); + const report = linter.executeOnText(stringifiedContent); + + contentToWrite = report.results[0].output || stringifiedContent; + } catch (e) { + debug("Error linting JavaScript config file, writing unlinted version"); + const errorMessage = e.message; + + contentToWrite = stringifiedContent; + e.message = "An error occurred while generating your JavaScript config file. "; + e.message += "A config file was still generated, but the config file itself may not follow your linting rules."; + e.message += `\nError: ${errorMessage}`; + throw e; + } finally { + fs.writeFileSync(filePath, contentToWrite, "utf8"); + } +} + +/** + * Writes a configuration file. + * @param {Object} config The configuration object to write. + * @param {string} filePath The filename to write to. + * @returns {void} + * @throws {Error} When an unknown file type is specified. + * @private + */ +function write(config, filePath) { + switch (path.extname(filePath)) { + case ".js": + writeJSConfigFile(config, filePath); + break; + + case ".json": + writeJSONConfigFile(config, filePath); + break; + + case ".yaml": + case ".yml": + writeYAMLConfigFile(config, filePath); + break; + + default: + throw new Error("Can't write to unknown file type."); + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + write +}; diff --git a/node_modules/eslint/lib/init/config-initializer.js b/node_modules/eslint/lib/init/config-initializer.js new file mode 100644 index 000000000..f7d4cc7a1 --- /dev/null +++ b/node_modules/eslint/lib/init/config-initializer.js @@ -0,0 +1,690 @@ +/** + * @fileoverview Config initialization wizard. + * @author Ilya Volodin + */ + + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const util = require("util"), + path = require("path"), + enquirer = require("enquirer"), + ProgressBar = require("progress"), + semver = require("semver"), + espree = require("espree"), + recConfig = require("../../conf/eslint-recommended"), + ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops"), + log = require("../shared/logging"), + naming = require("@eslint/eslintrc/lib/shared/naming"), + ModuleResolver = require("../shared/relative-module-resolver"), + autoconfig = require("./autoconfig.js"), + ConfigFile = require("./config-file"), + npmUtils = require("./npm-utils"), + { getSourceCodeOfFiles } = require("./source-code-utils"); + +const debug = require("debug")("eslint:config-initializer"); + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/* istanbul ignore next: hard to test fs function */ +/** + * Create .eslintrc file in the current working directory + * @param {Object} config object that contains user's answers + * @param {string} format The file format to write to. + * @returns {void} + */ +function writeFile(config, format) { + + // default is .js + let extname = ".js"; + + if (format === "YAML") { + extname = ".yml"; + } else if (format === "JSON") { + extname = ".json"; + } + + const installedESLint = config.installedESLint; + + delete config.installedESLint; + + ConfigFile.write(config, `./.eslintrc${extname}`); + log.info(`Successfully created .eslintrc${extname} file in ${process.cwd()}`); + + if (installedESLint) { + log.info("ESLint was installed locally. We recommend using this local copy instead of your globally-installed copy."); + } +} + +/** + * Get the peer dependencies of the given module. + * This adds the gotten value to cache at the first time, then reuses it. + * In a process, this function is called twice, but `npmUtils.fetchPeerDependencies` needs to access network which is relatively slow. + * @param {string} moduleName The module name to get. + * @returns {Object} The peer dependencies of the given module. + * This object is the object of `peerDependencies` field of `package.json`. + * Returns null if npm was not found. + */ +function getPeerDependencies(moduleName) { + let result = getPeerDependencies.cache.get(moduleName); + + if (!result) { + log.info(`Checking peerDependencies of ${moduleName}`); + + result = npmUtils.fetchPeerDependencies(moduleName); + getPeerDependencies.cache.set(moduleName, result); + } + + return result; +} +getPeerDependencies.cache = new Map(); + +/** + * Return necessary plugins, configs, parsers, etc. based on the config + * @param {Object} config config object + * @param {boolean} [installESLint=true] If `false` is given, it does not install eslint. + * @returns {string[]} An array of modules to be installed. + */ +function getModulesList(config, installESLint) { + const modules = {}; + + // Create a list of modules which should be installed based on config + if (config.plugins) { + for (const plugin of config.plugins) { + const moduleName = naming.normalizePackageName(plugin, "eslint-plugin"); + + modules[moduleName] = "latest"; + } + } + if (config.extends) { + const extendList = Array.isArray(config.extends) ? config.extends : [config.extends]; + + for (const extend of extendList) { + if (extend.startsWith("eslint:") || extend.startsWith("plugin:")) { + continue; + } + const moduleName = naming.normalizePackageName(extend, "eslint-config"); + + modules[moduleName] = "latest"; + Object.assign( + modules, + getPeerDependencies(`${moduleName}@latest`) + ); + } + } + + const parser = config.parser || (config.parserOptions && config.parserOptions.parser); + + if (parser) { + modules[parser] = "latest"; + } + + if (installESLint === false) { + delete modules.eslint; + } else { + const installStatus = npmUtils.checkDevDeps(["eslint"]); + + // Mark to show messages if it's new installation of eslint. + if (installStatus.eslint === false) { + log.info("Local ESLint installation not found."); + modules.eslint = modules.eslint || "latest"; + config.installedESLint = true; + } + } + + return Object.keys(modules).map(name => `${name}@${modules[name]}`); +} + +/** + * Set the `rules` of a config by examining a user's source code + * + * Note: This clones the config object and returns a new config to avoid mutating + * the original config parameter. + * @param {Object} answers answers received from enquirer + * @param {Object} config config object + * @returns {Object} config object with configured rules + */ +function configureRules(answers, config) { + const BAR_TOTAL = 20, + BAR_SOURCE_CODE_TOTAL = 4, + newConfig = Object.assign({}, config), + disabledConfigs = {}; + let sourceCodes, + registry; + + // Set up a progress bar, as this process can take a long time + const bar = new ProgressBar("Determining Config: :percent [:bar] :elapseds elapsed, eta :etas ", { + width: 30, + total: BAR_TOTAL + }); + + bar.tick(0); // Shows the progress bar + + // Get the SourceCode of all chosen files + const patterns = answers.patterns.split(/[\s]+/u); + + try { + sourceCodes = getSourceCodeOfFiles(patterns, { baseConfig: newConfig, useEslintrc: false }, total => { + bar.tick((BAR_SOURCE_CODE_TOTAL / total)); + }); + } catch (e) { + log.info("\n"); + throw e; + } + const fileQty = Object.keys(sourceCodes).length; + + if (fileQty === 0) { + log.info("\n"); + throw new Error("Automatic Configuration failed. No files were able to be parsed."); + } + + // Create a registry of rule configs + registry = new autoconfig.Registry(); + registry.populateFromCoreRules(); + + // Lint all files with each rule config in the registry + registry = registry.lintSourceCode(sourceCodes, newConfig, total => { + bar.tick((BAR_TOTAL - BAR_SOURCE_CODE_TOTAL) / total); // Subtract out ticks used at beginning + }); + debug(`\nRegistry: ${util.inspect(registry.rules, { depth: null })}`); + + // Create a list of recommended rules, because we don't want to disable them + const recRules = Object.keys(recConfig.rules).filter(ruleId => ConfigOps.isErrorSeverity(recConfig.rules[ruleId])); + + // Find and disable rules which had no error-free configuration + const failingRegistry = registry.getFailingRulesRegistry(); + + Object.keys(failingRegistry.rules).forEach(ruleId => { + + // If the rule is recommended, set it to error, otherwise disable it + disabledConfigs[ruleId] = (recRules.indexOf(ruleId) !== -1) ? 2 : 0; + }); + + // Now that we know which rules to disable, strip out configs with errors + registry = registry.stripFailingConfigs(); + + /* + * If there is only one config that results in no errors for a rule, we should use it. + * createConfig will only add rules that have one configuration in the registry. + */ + const singleConfigs = registry.createConfig().rules; + + /* + * The "sweet spot" for number of options in a config seems to be two (severity plus one option). + * Very often, a third option (usually an object) is available to address + * edge cases, exceptions, or unique situations. We will prefer to use a config with + * specificity of two. + */ + const specTwoConfigs = registry.filterBySpecificity(2).createConfig().rules; + + // Maybe a specific combination using all three options works + const specThreeConfigs = registry.filterBySpecificity(3).createConfig().rules; + + // If all else fails, try to use the default (severity only) + const defaultConfigs = registry.filterBySpecificity(1).createConfig().rules; + + // Combine configs in reverse priority order (later take precedence) + newConfig.rules = Object.assign({}, disabledConfigs, defaultConfigs, specThreeConfigs, specTwoConfigs, singleConfigs); + + // Make sure progress bar has finished (floating point rounding) + bar.update(BAR_TOTAL); + + // Log out some stats to let the user know what happened + const finalRuleIds = Object.keys(newConfig.rules); + const totalRules = finalRuleIds.length; + const enabledRules = finalRuleIds.filter(ruleId => (newConfig.rules[ruleId] !== 0)).length; + const resultMessage = [ + `\nEnabled ${enabledRules} out of ${totalRules}`, + `rules based on ${fileQty}`, + `file${(fileQty === 1) ? "." : "s."}` + ].join(" "); + + log.info(resultMessage); + + ConfigOps.normalizeToStrings(newConfig); + return newConfig; +} + +/** + * process user's answers and create config object + * @param {Object} answers answers received from enquirer + * @returns {Object} config object + */ +function processAnswers(answers) { + let config = { + rules: {}, + env: {}, + parserOptions: {}, + extends: [] + }; + + config.parserOptions.ecmaVersion = espree.latestEcmaVersion; + config.env.es2021 = true; + + // set the module type + if (answers.moduleType === "esm") { + config.parserOptions.sourceType = "module"; + } else if (answers.moduleType === "commonjs") { + config.env.commonjs = true; + } + + // add in browser and node environments if necessary + answers.env.forEach(env => { + config.env[env] = true; + }); + + // add in library information + if (answers.framework === "react") { + config.parserOptions.ecmaFeatures = { + jsx: true + }; + config.plugins = ["react"]; + config.extends.push("plugin:react/recommended"); + } else if (answers.framework === "vue") { + config.plugins = ["vue"]; + config.extends.push("plugin:vue/essential"); + } + + if (answers.typescript) { + if (answers.framework === "vue") { + config.parserOptions.parser = "@typescript-eslint/parser"; + } else { + config.parser = "@typescript-eslint/parser"; + } + + if (Array.isArray(config.plugins)) { + config.plugins.push("@typescript-eslint"); + } else { + config.plugins = ["@typescript-eslint"]; + } + } + + // setup rules based on problems/style enforcement preferences + if (answers.purpose === "problems") { + config.extends.unshift("eslint:recommended"); + } else if (answers.purpose === "style") { + if (answers.source === "prompt") { + config.extends.unshift("eslint:recommended"); + config.rules.indent = ["error", answers.indent]; + config.rules.quotes = ["error", answers.quotes]; + config.rules["linebreak-style"] = ["error", answers.linebreak]; + config.rules.semi = ["error", answers.semi ? "always" : "never"]; + } else if (answers.source === "auto") { + config = configureRules(answers, config); + config = autoconfig.extendFromRecommended(config); + } + } + if (answers.typescript && config.extends.includes("eslint:recommended")) { + config.extends.push("plugin:@typescript-eslint/recommended"); + } + + // normalize extends + if (config.extends.length === 0) { + delete config.extends; + } else if (config.extends.length === 1) { + config.extends = config.extends[0]; + } + + ConfigOps.normalizeToStrings(config); + return config; +} + +/** + * Get the version of the local ESLint. + * @returns {string|null} The version. If the local ESLint was not found, returns null. + */ +function getLocalESLintVersion() { + try { + const eslintPath = ModuleResolver.resolve("eslint", path.join(process.cwd(), "__placeholder__.js")); + const eslint = require(eslintPath); + + return eslint.linter.version || null; + } catch { + return null; + } +} + +/** + * Get the shareable config name of the chosen style guide. + * @param {Object} answers The answers object. + * @returns {string} The shareable config name. + */ +function getStyleGuideName(answers) { + if (answers.styleguide === "airbnb" && answers.framework !== "react") { + return "airbnb-base"; + } + return answers.styleguide; +} + +/** + * Check whether the local ESLint version conflicts with the required version of the chosen shareable config. + * @param {Object} answers The answers object. + * @returns {boolean} `true` if the local ESLint is found then it conflicts with the required version of the chosen shareable config. + */ +function hasESLintVersionConflict(answers) { + + // Get the local ESLint version. + const localESLintVersion = getLocalESLintVersion(); + + if (!localESLintVersion) { + return false; + } + + // Get the required range of ESLint version. + const configName = getStyleGuideName(answers); + const moduleName = `eslint-config-${configName}@latest`; + const peerDependencies = getPeerDependencies(moduleName) || {}; + const requiredESLintVersionRange = peerDependencies.eslint; + + if (!requiredESLintVersionRange) { + return false; + } + + answers.localESLintVersion = localESLintVersion; + answers.requiredESLintVersionRange = requiredESLintVersionRange; + + // Check the version. + if (semver.satisfies(localESLintVersion, requiredESLintVersionRange)) { + answers.installESLint = false; + return false; + } + + return true; +} + +/** + * Install modules. + * @param {string[]} modules Modules to be installed. + * @returns {void} + */ +function installModules(modules) { + log.info(`Installing ${modules.join(", ")}`); + npmUtils.installSyncSaveDev(modules); +} + +/* istanbul ignore next: no need to test enquirer */ +/** + * Ask user to install modules. + * @param {string[]} modules Array of modules to be installed. + * @param {boolean} packageJsonExists Indicates if package.json is existed. + * @returns {Promise} Answer that indicates if user wants to install. + */ +function askInstallModules(modules, packageJsonExists) { + + // If no modules, do nothing. + if (modules.length === 0) { + return Promise.resolve(); + } + + log.info("The config that you've selected requires the following dependencies:\n"); + log.info(modules.join(" ")); + return enquirer.prompt([ + { + type: "toggle", + name: "executeInstallation", + message: "Would you like to install them now with npm?", + enabled: "Yes", + disabled: "No", + initial: 1, + skip() { + return !(modules.length && packageJsonExists); + }, + result(input) { + return this.skipped ? null : input; + } + } + ]).then(({ executeInstallation }) => { + if (executeInstallation) { + installModules(modules); + } + }); +} + +/* istanbul ignore next: no need to test enquirer */ +/** + * Ask use a few questions on command prompt + * @returns {Promise} The promise with the result of the prompt + */ +function promptUser() { + + return enquirer.prompt([ + { + type: "select", + name: "purpose", + message: "How would you like to use ESLint?", + + // The returned number matches the name value of nth in the choices array. + initial: 1, + choices: [ + { message: "To check syntax only", name: "syntax" }, + { message: "To check syntax and find problems", name: "problems" }, + { message: "To check syntax, find problems, and enforce code style", name: "style" } + ] + }, + { + type: "select", + name: "moduleType", + message: "What type of modules does your project use?", + initial: 0, + choices: [ + { message: "JavaScript modules (import/export)", name: "esm" }, + { message: "CommonJS (require/exports)", name: "commonjs" }, + { message: "None of these", name: "none" } + ] + }, + { + type: "select", + name: "framework", + message: "Which framework does your project use?", + initial: 0, + choices: [ + { message: "React", name: "react" }, + { message: "Vue.js", name: "vue" }, + { message: "None of these", name: "none" } + ] + }, + { + type: "toggle", + name: "typescript", + message: "Does your project use TypeScript?", + enabled: "Yes", + disabled: "No", + initial: 0 + }, + { + type: "multiselect", + name: "env", + message: "Where does your code run?", + hint: "(Press to select, to toggle all, to invert selection)", + initial: 0, + choices: [ + { message: "Browser", name: "browser" }, + { message: "Node", name: "node" } + ] + }, + { + type: "select", + name: "source", + message: "How would you like to define a style for your project?", + choices: [ + { message: "Use a popular style guide", name: "guide" }, + { message: "Answer questions about your style", name: "prompt" }, + { message: "Inspect your JavaScript file(s)", name: "auto" } + ], + skip() { + return this.state.answers.purpose !== "style"; + }, + result(input) { + return this.skipped ? null : input; + } + }, + { + type: "select", + name: "styleguide", + message: "Which style guide do you want to follow?", + choices: [ + { message: "Airbnb: https://github.com/airbnb/javascript", name: "airbnb" }, + { message: "Standard: https://github.com/standard/standard", name: "standard" }, + { message: "Google: https://github.com/google/eslint-config-google", name: "google" } + ], + skip() { + this.state.answers.packageJsonExists = npmUtils.checkPackageJson(); + return !(this.state.answers.source === "guide" && this.state.answers.packageJsonExists); + }, + result(input) { + return this.skipped ? null : input; + } + }, + { + type: "input", + name: "patterns", + message: "Which file(s), path(s), or glob(s) should be examined?", + skip() { + return this.state.answers.source !== "auto"; + }, + validate(input) { + if (!this.skipped && input.trim().length === 0 && input.trim() !== ",") { + return "You must tell us what code to examine. Try again."; + } + return true; + } + }, + { + type: "select", + name: "format", + message: "What format do you want your config file to be in?", + initial: 0, + choices: ["JavaScript", "YAML", "JSON"] + }, + { + type: "toggle", + name: "installESLint", + message(answers) { + const verb = semver.ltr(answers.localESLintVersion, answers.requiredESLintVersionRange) + ? "upgrade" + : "downgrade"; + + return `The style guide "${answers.styleguide}" requires eslint@${answers.requiredESLintVersionRange}. You are currently using eslint@${answers.localESLintVersion}.\n Do you want to ${verb}?`; + }, + enabled: "Yes", + disabled: "No", + initial: 1, + skip() { + return !(this.state.answers.source === "guide" && this.state.answers.packageJsonExists && hasESLintVersionConflict(this.state.answers)); + }, + result(input) { + return this.skipped ? null : input; + } + } + ]).then(earlyAnswers => { + + // early exit if no style guide is necessary + if (earlyAnswers.purpose !== "style") { + const config = processAnswers(earlyAnswers); + const modules = getModulesList(config); + + return askInstallModules(modules, earlyAnswers.packageJsonExists) + .then(() => writeFile(config, earlyAnswers.format)); + } + + // early exit if you are using a style guide + if (earlyAnswers.source === "guide") { + if (!earlyAnswers.packageJsonExists) { + log.info("A package.json is necessary to install plugins such as style guides. Run `npm init` to create a package.json file and try again."); + return void 0; + } + if (earlyAnswers.installESLint === false && !semver.satisfies(earlyAnswers.localESLintVersion, earlyAnswers.requiredESLintVersionRange)) { + log.info(`Note: it might not work since ESLint's version is mismatched with the ${earlyAnswers.styleguide} config.`); + } + if (earlyAnswers.styleguide === "airbnb" && earlyAnswers.framework !== "react") { + earlyAnswers.styleguide = "airbnb-base"; + } + + const config = processAnswers(earlyAnswers); + + if (Array.isArray(config.extends)) { + config.extends.push(earlyAnswers.styleguide); + } else if (config.extends) { + config.extends = [config.extends, earlyAnswers.styleguide]; + } else { + config.extends = [earlyAnswers.styleguide]; + } + + const modules = getModulesList(config); + + return askInstallModules(modules, earlyAnswers.packageJsonExists) + .then(() => writeFile(config, earlyAnswers.format)); + + } + + if (earlyAnswers.source === "auto") { + const combinedAnswers = Object.assign({}, earlyAnswers); + const config = processAnswers(combinedAnswers); + const modules = getModulesList(config); + + return askInstallModules(modules).then(() => writeFile(config, earlyAnswers.format)); + } + + // continue with the style questions otherwise... + return enquirer.prompt([ + { + type: "select", + name: "indent", + message: "What style of indentation do you use?", + initial: 0, + choices: [{ message: "Tabs", name: "tab" }, { message: "Spaces", name: 4 }] + }, + { + type: "select", + name: "quotes", + message: "What quotes do you use for strings?", + initial: 0, + choices: [{ message: "Double", name: "double" }, { message: "Single", name: "single" }] + }, + { + type: "select", + name: "linebreak", + message: "What line endings do you use?", + initial: 0, + choices: [{ message: "Unix", name: "unix" }, { message: "Windows", name: "windows" }] + }, + { + type: "toggle", + name: "semi", + message: "Do you require semicolons?", + enabled: "Yes", + disabled: "No", + initial: 1 + } + ]).then(answers => { + const totalAnswers = Object.assign({}, earlyAnswers, answers); + + const config = processAnswers(totalAnswers); + const modules = getModulesList(config); + + return askInstallModules(modules).then(() => writeFile(config, earlyAnswers.format)); + }); + }); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +const init = { + getModulesList, + hasESLintVersionConflict, + installModules, + processAnswers, + /* istanbul ignore next */initializeConfig() { + return promptUser(); + } +}; + +module.exports = init; diff --git a/node_modules/eslint/lib/init/config-rule.js b/node_modules/eslint/lib/init/config-rule.js new file mode 100644 index 000000000..7aec89c3d --- /dev/null +++ b/node_modules/eslint/lib/init/config-rule.js @@ -0,0 +1,317 @@ +/** + * @fileoverview Create configurations for a rule + * @author Ian VanSchooten + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const builtInRules = require("../rules"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Wrap all of the elements of an array into arrays. + * @param {*[]} xs Any array. + * @returns {Array[]} An array of arrays. + */ +function explodeArray(xs) { + return xs.reduce((accumulator, x) => { + accumulator.push([x]); + return accumulator; + }, []); +} + +/** + * Mix two arrays such that each element of the second array is concatenated + * onto each element of the first array. + * + * For example: + * combineArrays([a, [b, c]], [x, y]); // -> [[a, x], [a, y], [b, c, x], [b, c, y]] + * @param {Array} arr1 The first array to combine. + * @param {Array} arr2 The second array to combine. + * @returns {Array} A mixture of the elements of the first and second arrays. + */ +function combineArrays(arr1, arr2) { + const res = []; + + if (arr1.length === 0) { + return explodeArray(arr2); + } + if (arr2.length === 0) { + return explodeArray(arr1); + } + arr1.forEach(x1 => { + arr2.forEach(x2 => { + res.push([].concat(x1, x2)); + }); + }); + return res; +} + +/** + * Group together valid rule configurations based on object properties + * + * e.g.: + * groupByProperty([ + * {before: true}, + * {before: false}, + * {after: true}, + * {after: false} + * ]); + * + * will return: + * [ + * [{before: true}, {before: false}], + * [{after: true}, {after: false}] + * ] + * @param {Object[]} objects Array of objects, each with one property/value pair + * @returns {Array[]} Array of arrays of objects grouped by property + */ +function groupByProperty(objects) { + const groupedObj = objects.reduce((accumulator, obj) => { + const prop = Object.keys(obj)[0]; + + accumulator[prop] = accumulator[prop] ? accumulator[prop].concat(obj) : [obj]; + return accumulator; + }, {}); + + return Object.keys(groupedObj).map(prop => groupedObj[prop]); +} + + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * Configuration settings for a rule. + * + * A configuration can be a single number (severity), or an array where the first + * element in the array is the severity, and is the only required element. + * Configs may also have one or more additional elements to specify rule + * configuration or options. + * @typedef {Array|number} ruleConfig + * @param {number} 0 The rule's severity (0, 1, 2). + */ + +/** + * Object whose keys are rule names and values are arrays of valid ruleConfig items + * which should be linted against the target source code to determine error counts. + * (a ruleConfigSet.ruleConfigs). + * + * e.g. rulesConfig = { + * "comma-dangle": [2, [2, "always"], [2, "always-multiline"], [2, "never"]], + * "no-console": [2] + * } + * @typedef rulesConfig + */ + + +/** + * Create valid rule configurations by combining two arrays, + * with each array containing multiple objects each with a + * single property/value pair and matching properties. + * + * e.g.: + * combinePropertyObjects( + * [{before: true}, {before: false}], + * [{after: true}, {after: false}] + * ); + * + * will return: + * [ + * {before: true, after: true}, + * {before: true, after: false}, + * {before: false, after: true}, + * {before: false, after: false} + * ] + * @param {Object[]} objArr1 Single key/value objects, all with the same key + * @param {Object[]} objArr2 Single key/value objects, all with another key + * @returns {Object[]} Combined objects for each combination of input properties and values + */ +function combinePropertyObjects(objArr1, objArr2) { + const res = []; + + if (objArr1.length === 0) { + return objArr2; + } + if (objArr2.length === 0) { + return objArr1; + } + objArr1.forEach(obj1 => { + objArr2.forEach(obj2 => { + const combinedObj = {}; + const obj1Props = Object.keys(obj1); + const obj2Props = Object.keys(obj2); + + obj1Props.forEach(prop1 => { + combinedObj[prop1] = obj1[prop1]; + }); + obj2Props.forEach(prop2 => { + combinedObj[prop2] = obj2[prop2]; + }); + res.push(combinedObj); + }); + }); + return res; +} + +/** + * Creates a new instance of a rule configuration set + * + * A rule configuration set is an array of configurations that are valid for a + * given rule. For example, the configuration set for the "semi" rule could be: + * + * ruleConfigSet.ruleConfigs // -> [[2], [2, "always"], [2, "never"]] + * + * Rule configuration set class + */ +class RuleConfigSet { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {ruleConfig[]} configs Valid rule configurations + */ + constructor(configs) { + + /** + * Stored valid rule configurations for this instance + * @type {Array} + */ + this.ruleConfigs = configs || []; + } + + /** + * Add a severity level to the front of all configs in the instance. + * This should only be called after all configs have been added to the instance. + * @returns {void} + */ + addErrorSeverity() { + const severity = 2; + + this.ruleConfigs = this.ruleConfigs.map(config => { + config.unshift(severity); + return config; + }); + + // Add a single config at the beginning consisting of only the severity + this.ruleConfigs.unshift(severity); + } + + /** + * Add rule configs from an array of strings (schema enums) + * @param {string[]} enums Array of valid rule options (e.g. ["always", "never"]) + * @returns {void} + */ + addEnums(enums) { + this.ruleConfigs = this.ruleConfigs.concat(combineArrays(this.ruleConfigs, enums)); + } + + /** + * Add rule configurations from a schema object + * @param {Object} obj Schema item with type === "object" + * @returns {boolean} true if at least one schema for the object could be generated, false otherwise + */ + addObject(obj) { + const objectConfigSet = { + objectConfigs: [], + add(property, values) { + for (let idx = 0; idx < values.length; idx++) { + const optionObj = {}; + + optionObj[property] = values[idx]; + this.objectConfigs.push(optionObj); + } + }, + + combine() { + this.objectConfigs = groupByProperty(this.objectConfigs).reduce((accumulator, objArr) => combinePropertyObjects(accumulator, objArr), []); + } + }; + + /* + * The object schema could have multiple independent properties. + * If any contain enums or booleans, they can be added and then combined + */ + Object.keys(obj.properties).forEach(prop => { + if (obj.properties[prop].enum) { + objectConfigSet.add(prop, obj.properties[prop].enum); + } + if (obj.properties[prop].type && obj.properties[prop].type === "boolean") { + objectConfigSet.add(prop, [true, false]); + } + }); + objectConfigSet.combine(); + + if (objectConfigSet.objectConfigs.length > 0) { + this.ruleConfigs = this.ruleConfigs.concat(combineArrays(this.ruleConfigs, objectConfigSet.objectConfigs)); + return true; + } + + return false; + } +} + +/** + * Generate valid rule configurations based on a schema object + * @param {Object} schema A rule's schema object + * @returns {Array[]} Valid rule configurations + */ +function generateConfigsFromSchema(schema) { + const configSet = new RuleConfigSet(); + + if (Array.isArray(schema)) { + for (const opt of schema) { + if (opt.enum) { + configSet.addEnums(opt.enum); + } else if (opt.type && opt.type === "object") { + if (!configSet.addObject(opt)) { + break; + } + + // TODO (IanVS): support oneOf + } else { + + // If we don't know how to fill in this option, don't fill in any of the following options. + break; + } + } + } + configSet.addErrorSeverity(); + return configSet.ruleConfigs; +} + +/** + * Generate possible rule configurations for all of the core rules + * @param {boolean} noDeprecated Indicates whether ignores deprecated rules or not. + * @returns {rulesConfig} Hash of rule names and arrays of possible configurations + */ +function createCoreRuleConfigs(noDeprecated = false) { + return Array.from(builtInRules).reduce((accumulator, [id, rule]) => { + const schema = (typeof rule === "function") ? rule.schema : rule.meta.schema; + const isDeprecated = (typeof rule === "function") ? rule.deprecated : rule.meta.deprecated; + + if (noDeprecated && isDeprecated) { + return accumulator; + } + + accumulator[id] = generateConfigsFromSchema(schema); + return accumulator; + }, {}); +} + + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + generateConfigsFromSchema, + createCoreRuleConfigs +}; diff --git a/node_modules/eslint/lib/init/npm-utils.js b/node_modules/eslint/lib/init/npm-utils.js new file mode 100644 index 000000000..555ea2b2b --- /dev/null +++ b/node_modules/eslint/lib/init/npm-utils.js @@ -0,0 +1,178 @@ +/** + * @fileoverview Utility for executing npm commands. + * @author Ian VanSchooten + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const fs = require("fs"), + spawn = require("cross-spawn"), + path = require("path"), + log = require("../shared/logging"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Find the closest package.json file, starting at process.cwd (by default), + * and working up to root. + * @param {string} [startDir=process.cwd()] Starting directory + * @returns {string} Absolute path to closest package.json file + */ +function findPackageJson(startDir) { + let dir = path.resolve(startDir || process.cwd()); + + do { + const pkgFile = path.join(dir, "package.json"); + + if (!fs.existsSync(pkgFile) || !fs.statSync(pkgFile).isFile()) { + dir = path.join(dir, ".."); + continue; + } + return pkgFile; + } while (dir !== path.resolve(dir, "..")); + return null; +} + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * Install node modules synchronously and save to devDependencies in package.json + * @param {string|string[]} packages Node module or modules to install + * @returns {void} + */ +function installSyncSaveDev(packages) { + const packageList = Array.isArray(packages) ? packages : [packages]; + const npmProcess = spawn.sync("npm", ["i", "--save-dev"].concat(packageList), + { stdio: "inherit" }); + const error = npmProcess.error; + + if (error && error.code === "ENOENT") { + const pluralS = packageList.length > 1 ? "s" : ""; + + log.error(`Could not execute npm. Please install the following package${pluralS} with a package manager of your choice: ${packageList.join(", ")}`); + } +} + +/** + * Fetch `peerDependencies` of the given package by `npm show` command. + * @param {string} packageName The package name to fetch peerDependencies. + * @returns {Object} Gotten peerDependencies. Returns null if npm was not found. + */ +function fetchPeerDependencies(packageName) { + const npmProcess = spawn.sync( + "npm", + ["show", "--json", packageName, "peerDependencies"], + { encoding: "utf8" } + ); + + const error = npmProcess.error; + + if (error && error.code === "ENOENT") { + return null; + } + const fetchedText = npmProcess.stdout.trim(); + + return JSON.parse(fetchedText || "{}"); + + +} + +/** + * Check whether node modules are include in a project's package.json. + * @param {string[]} packages Array of node module names + * @param {Object} opt Options Object + * @param {boolean} opt.dependencies Set to true to check for direct dependencies + * @param {boolean} opt.devDependencies Set to true to check for development dependencies + * @param {boolean} opt.startdir Directory to begin searching from + * @returns {Object} An object whose keys are the module names + * and values are booleans indicating installation. + */ +function check(packages, opt) { + const deps = new Set(); + const pkgJson = (opt) ? findPackageJson(opt.startDir) : findPackageJson(); + let fileJson; + + if (!pkgJson) { + throw new Error("Could not find a package.json file. Run 'npm init' to create one."); + } + + try { + fileJson = JSON.parse(fs.readFileSync(pkgJson, "utf8")); + } catch (e) { + const error = new Error(e); + + error.messageTemplate = "failed-to-read-json"; + error.messageData = { + path: pkgJson, + message: e.message + }; + throw error; + } + + ["dependencies", "devDependencies"].forEach(key => { + if (opt[key] && typeof fileJson[key] === "object") { + Object.keys(fileJson[key]).forEach(dep => deps.add(dep)); + } + }); + + return packages.reduce((status, pkg) => { + status[pkg] = deps.has(pkg); + return status; + }, {}); +} + +/** + * Check whether node modules are included in the dependencies of a project's + * package.json. + * + * Convenience wrapper around check(). + * @param {string[]} packages Array of node modules to check. + * @param {string} rootDir The directory containing a package.json + * @returns {Object} An object whose keys are the module names + * and values are booleans indicating installation. + */ +function checkDeps(packages, rootDir) { + return check(packages, { dependencies: true, startDir: rootDir }); +} + +/** + * Check whether node modules are included in the devDependencies of a project's + * package.json. + * + * Convenience wrapper around check(). + * @param {string[]} packages Array of node modules to check. + * @returns {Object} An object whose keys are the module names + * and values are booleans indicating installation. + */ +function checkDevDeps(packages) { + return check(packages, { devDependencies: true }); +} + +/** + * Check whether package.json is found in current path. + * @param {string} [startDir] Starting directory + * @returns {boolean} Whether a package.json is found in current path. + */ +function checkPackageJson(startDir) { + return !!findPackageJson(startDir); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + installSyncSaveDev, + fetchPeerDependencies, + checkDeps, + checkDevDeps, + checkPackageJson +}; diff --git a/node_modules/eslint/lib/init/source-code-utils.js b/node_modules/eslint/lib/init/source-code-utils.js new file mode 100644 index 000000000..dca6541d1 --- /dev/null +++ b/node_modules/eslint/lib/init/source-code-utils.js @@ -0,0 +1,109 @@ +/** + * @fileoverview Tools for obtaining SourceCode objects. + * @author Ian VanSchooten + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { CLIEngine } = require("../cli-engine"); + +/* + * This is used for: + * + * 1. Enumerate target file because we have not expose such a API on `CLIEngine` + * (https://github.com/eslint/eslint/issues/11222). + * 2. Create `SourceCode` instances. Because we don't have any function which + * instantiate `SourceCode` so it needs to take the created `SourceCode` + * instance out after linting. + * + * TODO1: Expose the API that enumerates target files. + * TODO2: Extract the creation logic of `SourceCode` from `Linter` class. + */ +const { getCLIEngineInternalSlots } = require("../cli-engine/cli-engine"); // eslint-disable-line node/no-restricted-require + +const debug = require("debug")("eslint:source-code-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Get the SourceCode object for a single file + * @param {string} filename The fully resolved filename to get SourceCode from. + * @param {Object} engine A CLIEngine. + * @returns {Array} Array of the SourceCode object representing the file + * and fatal error message. + */ +function getSourceCodeOfFile(filename, engine) { + debug("getting sourceCode of", filename); + const results = engine.executeOnFiles([filename]); + + if (results && results.results[0] && results.results[0].messages[0] && results.results[0].messages[0].fatal) { + const msg = results.results[0].messages[0]; + + throw new Error(`(${filename}:${msg.line}:${msg.column}) ${msg.message}`); + } + + // TODO: extract the logic that creates source code objects to `SourceCode#parse(text, options)` or something like. + const { linter } = getCLIEngineInternalSlots(engine); + const sourceCode = linter.getSourceCode(); + + return sourceCode; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + + +/** + * This callback is used to measure execution status in a progress bar + * @callback progressCallback + * @param {number} The total number of times the callback will be called. + */ + +/** + * Gets the SourceCode of a single file, or set of files. + * @param {string[]|string} patterns A filename, directory name, or glob, or an array of them + * @param {Object} options A CLIEngine options object. If not provided, the default cli options will be used. + * @param {progressCallback} callback Callback for reporting execution status + * @returns {Object} The SourceCode of all processed files. + */ +function getSourceCodeOfFiles(patterns, options, callback) { + const sourceCodes = {}; + const globPatternsList = typeof patterns === "string" ? [patterns] : patterns; + const engine = new CLIEngine({ ...options, rules: {} }); + + // TODO: make file iteration as a public API and use it. + const { fileEnumerator } = getCLIEngineInternalSlots(engine); + const filenames = + Array.from(fileEnumerator.iterateFiles(globPatternsList)) + .filter(entry => !entry.ignored) + .map(entry => entry.filePath); + + if (filenames.length === 0) { + debug(`Did not find any files matching pattern(s): ${globPatternsList}`); + } + + filenames.forEach(filename => { + const sourceCode = getSourceCodeOfFile(filename, engine); + + if (sourceCode) { + debug("got sourceCode of", filename); + sourceCodes[filename] = sourceCode; + } + if (callback) { + callback(filenames.length); // eslint-disable-line node/callback-return + } + }); + + return sourceCodes; +} + +module.exports = { + getSourceCodeOfFiles +}; diff --git a/node_modules/eslint/lib/linter/apply-disable-directives.js b/node_modules/eslint/lib/linter/apply-disable-directives.js new file mode 100644 index 000000000..41d6934ab --- /dev/null +++ b/node_modules/eslint/lib/linter/apply-disable-directives.js @@ -0,0 +1,167 @@ +/** + * @fileoverview A module that filters reported problems based on `eslint-disable` and `eslint-enable` comments + * @author Teddy Katz + */ + +"use strict"; + +const lodash = require("lodash"); + +/** + * Compares the locations of two objects in a source file + * @param {{line: number, column: number}} itemA The first object + * @param {{line: number, column: number}} itemB The second object + * @returns {number} A value less than 1 if itemA appears before itemB in the source file, greater than 1 if + * itemA appears after itemB in the source file, or 0 if itemA and itemB have the same location. + */ +function compareLocations(itemA, itemB) { + return itemA.line - itemB.line || itemA.column - itemB.column; +} + +/** + * This is the same as the exported function, except that it + * doesn't handle disable-line and disable-next-line directives, and it always reports unused + * disable directives. + * @param {Object} options options for applying directives. This is the same as the options + * for the exported function, except that `reportUnusedDisableDirectives` is not supported + * (this function always reports unused disable directives). + * @returns {{problems: Problem[], unusedDisableDirectives: Problem[]}} An object with a list + * of filtered problems and unused eslint-disable directives + */ +function applyDirectives(options) { + const problems = []; + let nextDirectiveIndex = 0; + let currentGlobalDisableDirective = null; + const disabledRuleMap = new Map(); + + // enabledRules is only used when there is a current global disable directive. + const enabledRules = new Set(); + const usedDisableDirectives = new Set(); + + for (const problem of options.problems) { + while ( + nextDirectiveIndex < options.directives.length && + compareLocations(options.directives[nextDirectiveIndex], problem) <= 0 + ) { + const directive = options.directives[nextDirectiveIndex++]; + + switch (directive.type) { + case "disable": + if (directive.ruleId === null) { + currentGlobalDisableDirective = directive; + disabledRuleMap.clear(); + enabledRules.clear(); + } else if (currentGlobalDisableDirective) { + enabledRules.delete(directive.ruleId); + disabledRuleMap.set(directive.ruleId, directive); + } else { + disabledRuleMap.set(directive.ruleId, directive); + } + break; + + case "enable": + if (directive.ruleId === null) { + currentGlobalDisableDirective = null; + disabledRuleMap.clear(); + } else if (currentGlobalDisableDirective) { + enabledRules.add(directive.ruleId); + disabledRuleMap.delete(directive.ruleId); + } else { + disabledRuleMap.delete(directive.ruleId); + } + break; + + // no default + } + } + + if (disabledRuleMap.has(problem.ruleId)) { + usedDisableDirectives.add(disabledRuleMap.get(problem.ruleId)); + } else if (currentGlobalDisableDirective && !enabledRules.has(problem.ruleId)) { + usedDisableDirectives.add(currentGlobalDisableDirective); + } else { + problems.push(problem); + } + } + + const unusedDisableDirectives = options.directives + .filter(directive => directive.type === "disable" && !usedDisableDirectives.has(directive)) + .map(directive => ({ + ruleId: null, + message: directive.ruleId + ? `Unused eslint-disable directive (no problems were reported from '${directive.ruleId}').` + : "Unused eslint-disable directive (no problems were reported).", + line: directive.unprocessedDirective.line, + column: directive.unprocessedDirective.column, + severity: options.reportUnusedDisableDirectives === "warn" ? 1 : 2, + nodeType: null + })); + + return { problems, unusedDisableDirectives }; +} + +/** + * Given a list of directive comments (i.e. metadata about eslint-disable and eslint-enable comments) and a list + * of reported problems, determines which problems should be reported. + * @param {Object} options Information about directives and problems + * @param {{ + * type: ("disable"|"enable"|"disable-line"|"disable-next-line"), + * ruleId: (string|null), + * line: number, + * column: number + * }} options.directives Directive comments found in the file, with one-based columns. + * Two directive comments can only have the same location if they also have the same type (e.g. a single eslint-disable + * comment for two different rules is represented as two directives). + * @param {{ruleId: (string|null), line: number, column: number}[]} options.problems + * A list of problems reported by rules, sorted by increasing location in the file, with one-based columns. + * @param {"off" | "warn" | "error"} options.reportUnusedDisableDirectives If `"warn"` or `"error"`, adds additional problems for unused directives + * @returns {{ruleId: (string|null), line: number, column: number}[]} + * A list of reported problems that were not disabled by the directive comments. + */ +module.exports = ({ directives, problems, reportUnusedDisableDirectives = "off" }) => { + const blockDirectives = directives + .filter(directive => directive.type === "disable" || directive.type === "enable") + .map(directive => Object.assign({}, directive, { unprocessedDirective: directive })) + .sort(compareLocations); + + const lineDirectives = lodash.flatMap(directives, directive => { + switch (directive.type) { + case "disable": + case "enable": + return []; + + case "disable-line": + return [ + { type: "disable", line: directive.line, column: 1, ruleId: directive.ruleId, unprocessedDirective: directive }, + { type: "enable", line: directive.line + 1, column: 0, ruleId: directive.ruleId, unprocessedDirective: directive } + ]; + + case "disable-next-line": + return [ + { type: "disable", line: directive.line + 1, column: 1, ruleId: directive.ruleId, unprocessedDirective: directive }, + { type: "enable", line: directive.line + 2, column: 0, ruleId: directive.ruleId, unprocessedDirective: directive } + ]; + + default: + throw new TypeError(`Unrecognized directive type '${directive.type}'`); + } + }).sort(compareLocations); + + const blockDirectivesResult = applyDirectives({ + problems, + directives: blockDirectives, + reportUnusedDisableDirectives + }); + const lineDirectivesResult = applyDirectives({ + problems: blockDirectivesResult.problems, + directives: lineDirectives, + reportUnusedDisableDirectives + }); + + return reportUnusedDisableDirectives !== "off" + ? lineDirectivesResult.problems + .concat(blockDirectivesResult.unusedDisableDirectives) + .concat(lineDirectivesResult.unusedDisableDirectives) + .sort(compareLocations) + : lineDirectivesResult.problems; +}; diff --git a/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js b/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js new file mode 100644 index 000000000..47427c11a --- /dev/null +++ b/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js @@ -0,0 +1,760 @@ +/** + * @fileoverview A class of the code path analyzer. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const assert = require("assert"), + { breakableTypePattern } = require("../../shared/ast-utils"), + CodePath = require("./code-path"), + CodePathSegment = require("./code-path-segment"), + IdGenerator = require("./id-generator"), + debug = require("./debug-helpers"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a `case` node (not `default` node). + * @param {ASTNode} node A `SwitchCase` node to check. + * @returns {boolean} `true` if the node is a `case` node (not `default` node). + */ +function isCaseNode(node) { + return Boolean(node.test); +} + +/** + * Checks whether the given logical operator is taken into account for the code + * path analysis. + * @param {string} operator The operator found in the LogicalExpression node + * @returns {boolean} `true` if the operator is "&&" or "||" or "??" + */ +function isHandledLogicalOperator(operator) { + return operator === "&&" || operator === "||" || operator === "??"; +} + +/** + * Checks whether the given assignment operator is a logical assignment operator. + * Logical assignments are taken into account for the code path analysis + * because of their short-circuiting semantics. + * @param {string} operator The operator found in the AssignmentExpression node + * @returns {boolean} `true` if the operator is "&&=" or "||=" or "??=" + */ +function isLogicalAssignmentOperator(operator) { + return operator === "&&=" || operator === "||=" || operator === "??="; +} + +/** + * Gets the label if the parent node of a given node is a LabeledStatement. + * @param {ASTNode} node A node to get. + * @returns {string|null} The label or `null`. + */ +function getLabel(node) { + if (node.parent.type === "LabeledStatement") { + return node.parent.label.name; + } + return null; +} + +/** + * Checks whether or not a given logical expression node goes different path + * between the `true` case and the `false` case. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a test of a choice statement. + */ +function isForkingByTrueOrFalse(node) { + const parent = node.parent; + + switch (parent.type) { + case "ConditionalExpression": + case "IfStatement": + case "WhileStatement": + case "DoWhileStatement": + case "ForStatement": + return parent.test === node; + + case "LogicalExpression": + return isHandledLogicalOperator(parent.operator); + + case "AssignmentExpression": + return isLogicalAssignmentOperator(parent.operator); + + default: + return false; + } +} + +/** + * Gets the boolean value of a given literal node. + * + * This is used to detect infinity loops (e.g. `while (true) {}`). + * Statements preceded by an infinity loop are unreachable if the loop didn't + * have any `break` statement. + * @param {ASTNode} node A node to get. + * @returns {boolean|undefined} a boolean value if the node is a Literal node, + * otherwise `undefined`. + */ +function getBooleanValueIfSimpleConstant(node) { + if (node.type === "Literal") { + return Boolean(node.value); + } + return void 0; +} + +/** + * Checks that a given identifier node is a reference or not. + * + * This is used to detect the first throwable node in a `try` block. + * @param {ASTNode} node An Identifier node to check. + * @returns {boolean} `true` if the node is a reference. + */ +function isIdentifierReference(node) { + const parent = node.parent; + + switch (parent.type) { + case "LabeledStatement": + case "BreakStatement": + case "ContinueStatement": + case "ArrayPattern": + case "RestElement": + case "ImportSpecifier": + case "ImportDefaultSpecifier": + case "ImportNamespaceSpecifier": + case "CatchClause": + return false; + + case "FunctionDeclaration": + case "FunctionExpression": + case "ArrowFunctionExpression": + case "ClassDeclaration": + case "ClassExpression": + case "VariableDeclarator": + return parent.id !== node; + + case "Property": + case "MethodDefinition": + return ( + parent.key !== node || + parent.computed || + parent.shorthand + ); + + case "AssignmentPattern": + return parent.key !== node; + + default: + return true; + } +} + +/** + * Updates the current segment with the head segment. + * This is similar to local branches and tracking branches of git. + * + * To separate the current and the head is in order to not make useless segments. + * + * In this process, both "onCodePathSegmentStart" and "onCodePathSegmentEnd" + * events are fired. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. + * @returns {void} + */ +function forwardCurrentToHead(analyzer, node) { + const codePath = analyzer.codePath; + const state = CodePath.getState(codePath); + const currentSegments = state.currentSegments; + const headSegments = state.headSegments; + const end = Math.max(currentSegments.length, headSegments.length); + let i, currentSegment, headSegment; + + // Fires leaving events. + for (i = 0; i < end; ++i) { + currentSegment = currentSegments[i]; + headSegment = headSegments[i]; + + if (currentSegment !== headSegment && currentSegment) { + debug.dump(`onCodePathSegmentEnd ${currentSegment.id}`); + + if (currentSegment.reachable) { + analyzer.emitter.emit( + "onCodePathSegmentEnd", + currentSegment, + node + ); + } + } + } + + // Update state. + state.currentSegments = headSegments; + + // Fires entering events. + for (i = 0; i < end; ++i) { + currentSegment = currentSegments[i]; + headSegment = headSegments[i]; + + if (currentSegment !== headSegment && headSegment) { + debug.dump(`onCodePathSegmentStart ${headSegment.id}`); + + CodePathSegment.markUsed(headSegment); + if (headSegment.reachable) { + analyzer.emitter.emit( + "onCodePathSegmentStart", + headSegment, + node + ); + } + } + } + +} + +/** + * Updates the current segment with empty. + * This is called at the last of functions or the program. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. + * @returns {void} + */ +function leaveFromCurrentSegment(analyzer, node) { + const state = CodePath.getState(analyzer.codePath); + const currentSegments = state.currentSegments; + + for (let i = 0; i < currentSegments.length; ++i) { + const currentSegment = currentSegments[i]; + + debug.dump(`onCodePathSegmentEnd ${currentSegment.id}`); + if (currentSegment.reachable) { + analyzer.emitter.emit( + "onCodePathSegmentEnd", + currentSegment, + node + ); + } + } + + state.currentSegments = []; +} + +/** + * Updates the code path due to the position of a given node in the parent node + * thereof. + * + * For example, if the node is `parent.consequent`, this creates a fork from the + * current path. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. + * @returns {void} + */ +function preprocess(analyzer, node) { + const codePath = analyzer.codePath; + const state = CodePath.getState(codePath); + const parent = node.parent; + + switch (parent.type) { + + // The `arguments.length == 0` case is in `postprocess` function. + case "CallExpression": + if (parent.optional === true && parent.arguments.length >= 1 && parent.arguments[0] === node) { + state.makeOptionalRight(); + } + break; + case "MemberExpression": + if (parent.optional === true && parent.property === node) { + state.makeOptionalRight(); + } + break; + + case "LogicalExpression": + if ( + parent.right === node && + isHandledLogicalOperator(parent.operator) + ) { + state.makeLogicalRight(); + } + break; + + case "AssignmentExpression": + if ( + parent.right === node && + isLogicalAssignmentOperator(parent.operator) + ) { + state.makeLogicalRight(); + } + break; + + case "ConditionalExpression": + case "IfStatement": + + /* + * Fork if this node is at `consequent`/`alternate`. + * `popForkContext()` exists at `IfStatement:exit` and + * `ConditionalExpression:exit`. + */ + if (parent.consequent === node) { + state.makeIfConsequent(); + } else if (parent.alternate === node) { + state.makeIfAlternate(); + } + break; + + case "SwitchCase": + if (parent.consequent[0] === node) { + state.makeSwitchCaseBody(false, !parent.test); + } + break; + + case "TryStatement": + if (parent.handler === node) { + state.makeCatchBlock(); + } else if (parent.finalizer === node) { + state.makeFinallyBlock(); + } + break; + + case "WhileStatement": + if (parent.test === node) { + state.makeWhileTest(getBooleanValueIfSimpleConstant(node)); + } else { + assert(parent.body === node); + state.makeWhileBody(); + } + break; + + case "DoWhileStatement": + if (parent.body === node) { + state.makeDoWhileBody(); + } else { + assert(parent.test === node); + state.makeDoWhileTest(getBooleanValueIfSimpleConstant(node)); + } + break; + + case "ForStatement": + if (parent.test === node) { + state.makeForTest(getBooleanValueIfSimpleConstant(node)); + } else if (parent.update === node) { + state.makeForUpdate(); + } else if (parent.body === node) { + state.makeForBody(); + } + break; + + case "ForInStatement": + case "ForOfStatement": + if (parent.left === node) { + state.makeForInOfLeft(); + } else if (parent.right === node) { + state.makeForInOfRight(); + } else { + assert(parent.body === node); + state.makeForInOfBody(); + } + break; + + case "AssignmentPattern": + + /* + * Fork if this node is at `right`. + * `left` is executed always, so it uses the current path. + * `popForkContext()` exists at `AssignmentPattern:exit`. + */ + if (parent.right === node) { + state.pushForkContext(); + state.forkBypassPath(); + state.forkPath(); + } + break; + + default: + break; + } +} + +/** + * Updates the code path due to the type of a given node in entering. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. + * @returns {void} + */ +function processCodePathToEnter(analyzer, node) { + let codePath = analyzer.codePath; + let state = codePath && CodePath.getState(codePath); + const parent = node.parent; + + switch (node.type) { + case "Program": + case "FunctionDeclaration": + case "FunctionExpression": + case "ArrowFunctionExpression": + if (codePath) { + + // Emits onCodePathSegmentStart events if updated. + forwardCurrentToHead(analyzer, node); + debug.dumpState(node, state, false); + } + + // Create the code path of this scope. + codePath = analyzer.codePath = new CodePath( + analyzer.idGenerator.next(), + codePath, + analyzer.onLooped + ); + state = CodePath.getState(codePath); + + // Emits onCodePathStart events. + debug.dump(`onCodePathStart ${codePath.id}`); + analyzer.emitter.emit("onCodePathStart", codePath, node); + break; + + case "ChainExpression": + state.pushChainContext(); + break; + case "CallExpression": + if (node.optional === true) { + state.makeOptionalNode(); + } + break; + case "MemberExpression": + if (node.optional === true) { + state.makeOptionalNode(); + } + break; + + case "LogicalExpression": + if (isHandledLogicalOperator(node.operator)) { + state.pushChoiceContext( + node.operator, + isForkingByTrueOrFalse(node) + ); + } + break; + + case "AssignmentExpression": + if (isLogicalAssignmentOperator(node.operator)) { + state.pushChoiceContext( + node.operator.slice(0, -1), // removes `=` from the end + isForkingByTrueOrFalse(node) + ); + } + break; + + case "ConditionalExpression": + case "IfStatement": + state.pushChoiceContext("test", false); + break; + + case "SwitchStatement": + state.pushSwitchContext( + node.cases.some(isCaseNode), + getLabel(node) + ); + break; + + case "TryStatement": + state.pushTryContext(Boolean(node.finalizer)); + break; + + case "SwitchCase": + + /* + * Fork if this node is after the 2st node in `cases`. + * It's similar to `else` blocks. + * The next `test` node is processed in this path. + */ + if (parent.discriminant !== node && parent.cases[0] !== node) { + state.forkPath(); + } + break; + + case "WhileStatement": + case "DoWhileStatement": + case "ForStatement": + case "ForInStatement": + case "ForOfStatement": + state.pushLoopContext(node.type, getLabel(node)); + break; + + case "LabeledStatement": + if (!breakableTypePattern.test(node.body.type)) { + state.pushBreakContext(false, node.label.name); + } + break; + + default: + break; + } + + // Emits onCodePathSegmentStart events if updated. + forwardCurrentToHead(analyzer, node); + debug.dumpState(node, state, false); +} + +/** + * Updates the code path due to the type of a given node in leaving. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. + * @returns {void} + */ +function processCodePathToExit(analyzer, node) { + const codePath = analyzer.codePath; + const state = CodePath.getState(codePath); + let dontForward = false; + + switch (node.type) { + case "ChainExpression": + state.popChainContext(); + break; + + case "IfStatement": + case "ConditionalExpression": + state.popChoiceContext(); + break; + + case "LogicalExpression": + if (isHandledLogicalOperator(node.operator)) { + state.popChoiceContext(); + } + break; + + case "AssignmentExpression": + if (isLogicalAssignmentOperator(node.operator)) { + state.popChoiceContext(); + } + break; + + case "SwitchStatement": + state.popSwitchContext(); + break; + + case "SwitchCase": + + /* + * This is the same as the process at the 1st `consequent` node in + * `preprocess` function. + * Must do if this `consequent` is empty. + */ + if (node.consequent.length === 0) { + state.makeSwitchCaseBody(true, !node.test); + } + if (state.forkContext.reachable) { + dontForward = true; + } + break; + + case "TryStatement": + state.popTryContext(); + break; + + case "BreakStatement": + forwardCurrentToHead(analyzer, node); + state.makeBreak(node.label && node.label.name); + dontForward = true; + break; + + case "ContinueStatement": + forwardCurrentToHead(analyzer, node); + state.makeContinue(node.label && node.label.name); + dontForward = true; + break; + + case "ReturnStatement": + forwardCurrentToHead(analyzer, node); + state.makeReturn(); + dontForward = true; + break; + + case "ThrowStatement": + forwardCurrentToHead(analyzer, node); + state.makeThrow(); + dontForward = true; + break; + + case "Identifier": + if (isIdentifierReference(node)) { + state.makeFirstThrowablePathInTryBlock(); + dontForward = true; + } + break; + + case "CallExpression": + case "ImportExpression": + case "MemberExpression": + case "NewExpression": + case "YieldExpression": + state.makeFirstThrowablePathInTryBlock(); + break; + + case "WhileStatement": + case "DoWhileStatement": + case "ForStatement": + case "ForInStatement": + case "ForOfStatement": + state.popLoopContext(); + break; + + case "AssignmentPattern": + state.popForkContext(); + break; + + case "LabeledStatement": + if (!breakableTypePattern.test(node.body.type)) { + state.popBreakContext(); + } + break; + + default: + break; + } + + // Emits onCodePathSegmentStart events if updated. + if (!dontForward) { + forwardCurrentToHead(analyzer, node); + } + debug.dumpState(node, state, true); +} + +/** + * Updates the code path to finalize the current code path. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. + * @returns {void} + */ +function postprocess(analyzer, node) { + switch (node.type) { + case "Program": + case "FunctionDeclaration": + case "FunctionExpression": + case "ArrowFunctionExpression": { + let codePath = analyzer.codePath; + + // Mark the current path as the final node. + CodePath.getState(codePath).makeFinal(); + + // Emits onCodePathSegmentEnd event of the current segments. + leaveFromCurrentSegment(analyzer, node); + + // Emits onCodePathEnd event of this code path. + debug.dump(`onCodePathEnd ${codePath.id}`); + analyzer.emitter.emit("onCodePathEnd", codePath, node); + debug.dumpDot(codePath); + + codePath = analyzer.codePath = analyzer.codePath.upper; + if (codePath) { + debug.dumpState(node, CodePath.getState(codePath), true); + } + break; + } + + // The `arguments.length >= 1` case is in `preprocess` function. + case "CallExpression": + if (node.optional === true && node.arguments.length === 0) { + CodePath.getState(analyzer.codePath).makeOptionalRight(); + } + break; + + default: + break; + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * The class to analyze code paths. + * This class implements the EventGenerator interface. + */ +class CodePathAnalyzer { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {EventGenerator} eventGenerator An event generator to wrap. + */ + constructor(eventGenerator) { + this.original = eventGenerator; + this.emitter = eventGenerator.emitter; + this.codePath = null; + this.idGenerator = new IdGenerator("s"); + this.currentNode = null; + this.onLooped = this.onLooped.bind(this); + } + + /** + * Does the process to enter a given AST node. + * This updates state of analysis and calls `enterNode` of the wrapped. + * @param {ASTNode} node A node which is entering. + * @returns {void} + */ + enterNode(node) { + this.currentNode = node; + + // Updates the code path due to node's position in its parent node. + if (node.parent) { + preprocess(this, node); + } + + /* + * Updates the code path. + * And emits onCodePathStart/onCodePathSegmentStart events. + */ + processCodePathToEnter(this, node); + + // Emits node events. + this.original.enterNode(node); + + this.currentNode = null; + } + + /** + * Does the process to leave a given AST node. + * This updates state of analysis and calls `leaveNode` of the wrapped. + * @param {ASTNode} node A node which is leaving. + * @returns {void} + */ + leaveNode(node) { + this.currentNode = node; + + /* + * Updates the code path. + * And emits onCodePathStart/onCodePathSegmentStart events. + */ + processCodePathToExit(this, node); + + // Emits node events. + this.original.leaveNode(node); + + // Emits the last onCodePathStart/onCodePathSegmentStart events. + postprocess(this, node); + + this.currentNode = null; + } + + /** + * This is called on a code path looped. + * Then this raises a looped event. + * @param {CodePathSegment} fromSegment A segment of prev. + * @param {CodePathSegment} toSegment A segment of next. + * @returns {void} + */ + onLooped(fromSegment, toSegment) { + if (fromSegment.reachable && toSegment.reachable) { + debug.dump(`onCodePathSegmentLoop ${fromSegment.id} -> ${toSegment.id}`); + this.emitter.emit( + "onCodePathSegmentLoop", + fromSegment, + toSegment, + this.currentNode + ); + } + } +} + +module.exports = CodePathAnalyzer; diff --git a/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js b/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js new file mode 100644 index 000000000..ca96ad341 --- /dev/null +++ b/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js @@ -0,0 +1,236 @@ +/** + * @fileoverview A class of the code path segment. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const debug = require("./debug-helpers"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given segment is reachable. + * @param {CodePathSegment} segment A segment to check. + * @returns {boolean} `true` if the segment is reachable. + */ +function isReachable(segment) { + return segment.reachable; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * A code path segment. + */ +class CodePathSegment { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {string} id An identifier. + * @param {CodePathSegment[]} allPrevSegments An array of the previous segments. + * This array includes unreachable segments. + * @param {boolean} reachable A flag which shows this is reachable. + */ + constructor(id, allPrevSegments, reachable) { + + /** + * The identifier of this code path. + * Rules use it to store additional information of each rule. + * @type {string} + */ + this.id = id; + + /** + * An array of the next segments. + * @type {CodePathSegment[]} + */ + this.nextSegments = []; + + /** + * An array of the previous segments. + * @type {CodePathSegment[]} + */ + this.prevSegments = allPrevSegments.filter(isReachable); + + /** + * An array of the next segments. + * This array includes unreachable segments. + * @type {CodePathSegment[]} + */ + this.allNextSegments = []; + + /** + * An array of the previous segments. + * This array includes unreachable segments. + * @type {CodePathSegment[]} + */ + this.allPrevSegments = allPrevSegments; + + /** + * A flag which shows this is reachable. + * @type {boolean} + */ + this.reachable = reachable; + + // Internal data. + Object.defineProperty(this, "internal", { + value: { + used: false, + loopedPrevSegments: [] + } + }); + + /* istanbul ignore if */ + if (debug.enabled) { + this.internal.nodes = []; + } + } + + /** + * Checks a given previous segment is coming from the end of a loop. + * @param {CodePathSegment} segment A previous segment to check. + * @returns {boolean} `true` if the segment is coming from the end of a loop. + */ + isLoopedPrevSegment(segment) { + return this.internal.loopedPrevSegments.indexOf(segment) !== -1; + } + + /** + * Creates the root segment. + * @param {string} id An identifier. + * @returns {CodePathSegment} The created segment. + */ + static newRoot(id) { + return new CodePathSegment(id, [], true); + } + + /** + * Creates a segment that follows given segments. + * @param {string} id An identifier. + * @param {CodePathSegment[]} allPrevSegments An array of the previous segments. + * @returns {CodePathSegment} The created segment. + */ + static newNext(id, allPrevSegments) { + return new CodePathSegment( + id, + CodePathSegment.flattenUnusedSegments(allPrevSegments), + allPrevSegments.some(isReachable) + ); + } + + /** + * Creates an unreachable segment that follows given segments. + * @param {string} id An identifier. + * @param {CodePathSegment[]} allPrevSegments An array of the previous segments. + * @returns {CodePathSegment} The created segment. + */ + static newUnreachable(id, allPrevSegments) { + const segment = new CodePathSegment(id, CodePathSegment.flattenUnusedSegments(allPrevSegments), false); + + /* + * In `if (a) return a; foo();` case, the unreachable segment preceded by + * the return statement is not used but must not be remove. + */ + CodePathSegment.markUsed(segment); + + return segment; + } + + /** + * Creates a segment that follows given segments. + * This factory method does not connect with `allPrevSegments`. + * But this inherits `reachable` flag. + * @param {string} id An identifier. + * @param {CodePathSegment[]} allPrevSegments An array of the previous segments. + * @returns {CodePathSegment} The created segment. + */ + static newDisconnected(id, allPrevSegments) { + return new CodePathSegment(id, [], allPrevSegments.some(isReachable)); + } + + /** + * Makes a given segment being used. + * + * And this function registers the segment into the previous segments as a next. + * @param {CodePathSegment} segment A segment to mark. + * @returns {void} + */ + static markUsed(segment) { + if (segment.internal.used) { + return; + } + segment.internal.used = true; + + let i; + + if (segment.reachable) { + for (i = 0; i < segment.allPrevSegments.length; ++i) { + const prevSegment = segment.allPrevSegments[i]; + + prevSegment.allNextSegments.push(segment); + prevSegment.nextSegments.push(segment); + } + } else { + for (i = 0; i < segment.allPrevSegments.length; ++i) { + segment.allPrevSegments[i].allNextSegments.push(segment); + } + } + } + + /** + * Marks a previous segment as looped. + * @param {CodePathSegment} segment A segment. + * @param {CodePathSegment} prevSegment A previous segment to mark. + * @returns {void} + */ + static markPrevSegmentAsLooped(segment, prevSegment) { + segment.internal.loopedPrevSegments.push(prevSegment); + } + + /** + * Replaces unused segments with the previous segments of each unused segment. + * @param {CodePathSegment[]} segments An array of segments to replace. + * @returns {CodePathSegment[]} The replaced array. + */ + static flattenUnusedSegments(segments) { + const done = Object.create(null); + const retv = []; + + for (let i = 0; i < segments.length; ++i) { + const segment = segments[i]; + + // Ignores duplicated. + if (done[segment.id]) { + continue; + } + + // Use previous segments if unused. + if (!segment.internal.used) { + for (let j = 0; j < segment.allPrevSegments.length; ++j) { + const prevSegment = segment.allPrevSegments[j]; + + if (!done[prevSegment.id]) { + done[prevSegment.id] = true; + retv.push(prevSegment); + } + } + } else { + done[segment.id] = true; + retv.push(segment); + } + } + + return retv; + } +} + +module.exports = CodePathSegment; diff --git a/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js b/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js new file mode 100644 index 000000000..f75e60e28 --- /dev/null +++ b/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js @@ -0,0 +1,1480 @@ +/** + * @fileoverview A class to manage state of generating a code path. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const CodePathSegment = require("./code-path-segment"), + ForkContext = require("./fork-context"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Adds given segments into the `dest` array. + * If the `others` array does not includes the given segments, adds to the `all` + * array as well. + * + * This adds only reachable and used segments. + * @param {CodePathSegment[]} dest A destination array (`returnedSegments` or `thrownSegments`). + * @param {CodePathSegment[]} others Another destination array (`returnedSegments` or `thrownSegments`). + * @param {CodePathSegment[]} all The unified destination array (`finalSegments`). + * @param {CodePathSegment[]} segments Segments to add. + * @returns {void} + */ +function addToReturnedOrThrown(dest, others, all, segments) { + for (let i = 0; i < segments.length; ++i) { + const segment = segments[i]; + + dest.push(segment); + if (others.indexOf(segment) === -1) { + all.push(segment); + } + } +} + +/** + * Gets a loop-context for a `continue` statement. + * @param {CodePathState} state A state to get. + * @param {string} label The label of a `continue` statement. + * @returns {LoopContext} A loop-context for a `continue` statement. + */ +function getContinueContext(state, label) { + if (!label) { + return state.loopContext; + } + + let context = state.loopContext; + + while (context) { + if (context.label === label) { + return context; + } + context = context.upper; + } + + /* istanbul ignore next: foolproof (syntax error) */ + return null; +} + +/** + * Gets a context for a `break` statement. + * @param {CodePathState} state A state to get. + * @param {string} label The label of a `break` statement. + * @returns {LoopContext|SwitchContext} A context for a `break` statement. + */ +function getBreakContext(state, label) { + let context = state.breakContext; + + while (context) { + if (label ? context.label === label : context.breakable) { + return context; + } + context = context.upper; + } + + /* istanbul ignore next: foolproof (syntax error) */ + return null; +} + +/** + * Gets a context for a `return` statement. + * @param {CodePathState} state A state to get. + * @returns {TryContext|CodePathState} A context for a `return` statement. + */ +function getReturnContext(state) { + let context = state.tryContext; + + while (context) { + if (context.hasFinalizer && context.position !== "finally") { + return context; + } + context = context.upper; + } + + return state; +} + +/** + * Gets a context for a `throw` statement. + * @param {CodePathState} state A state to get. + * @returns {TryContext|CodePathState} A context for a `throw` statement. + */ +function getThrowContext(state) { + let context = state.tryContext; + + while (context) { + if (context.position === "try" || + (context.hasFinalizer && context.position === "catch") + ) { + return context; + } + context = context.upper; + } + + return state; +} + +/** + * Removes a given element from a given array. + * @param {any[]} xs An array to remove the specific element. + * @param {any} x An element to be removed. + * @returns {void} + */ +function remove(xs, x) { + xs.splice(xs.indexOf(x), 1); +} + +/** + * Disconnect given segments. + * + * This is used in a process for switch statements. + * If there is the "default" chunk before other cases, the order is different + * between node's and running's. + * @param {CodePathSegment[]} prevSegments Forward segments to disconnect. + * @param {CodePathSegment[]} nextSegments Backward segments to disconnect. + * @returns {void} + */ +function removeConnection(prevSegments, nextSegments) { + for (let i = 0; i < prevSegments.length; ++i) { + const prevSegment = prevSegments[i]; + const nextSegment = nextSegments[i]; + + remove(prevSegment.nextSegments, nextSegment); + remove(prevSegment.allNextSegments, nextSegment); + remove(nextSegment.prevSegments, prevSegment); + remove(nextSegment.allPrevSegments, prevSegment); + } +} + +/** + * Creates looping path. + * @param {CodePathState} state The instance. + * @param {CodePathSegment[]} unflattenedFromSegments Segments which are source. + * @param {CodePathSegment[]} unflattenedToSegments Segments which are destination. + * @returns {void} + */ +function makeLooped(state, unflattenedFromSegments, unflattenedToSegments) { + const fromSegments = CodePathSegment.flattenUnusedSegments(unflattenedFromSegments); + const toSegments = CodePathSegment.flattenUnusedSegments(unflattenedToSegments); + + const end = Math.min(fromSegments.length, toSegments.length); + + for (let i = 0; i < end; ++i) { + const fromSegment = fromSegments[i]; + const toSegment = toSegments[i]; + + if (toSegment.reachable) { + fromSegment.nextSegments.push(toSegment); + } + if (fromSegment.reachable) { + toSegment.prevSegments.push(fromSegment); + } + fromSegment.allNextSegments.push(toSegment); + toSegment.allPrevSegments.push(fromSegment); + + if (toSegment.allPrevSegments.length >= 2) { + CodePathSegment.markPrevSegmentAsLooped(toSegment, fromSegment); + } + + state.notifyLooped(fromSegment, toSegment); + } +} + +/** + * Finalizes segments of `test` chunk of a ForStatement. + * + * - Adds `false` paths to paths which are leaving from the loop. + * - Sets `true` paths to paths which go to the body. + * @param {LoopContext} context A loop context to modify. + * @param {ChoiceContext} choiceContext A choice context of this loop. + * @param {CodePathSegment[]} head The current head paths. + * @returns {void} + */ +function finalizeTestSegmentsOfFor(context, choiceContext, head) { + if (!choiceContext.processed) { + choiceContext.trueForkContext.add(head); + choiceContext.falseForkContext.add(head); + choiceContext.qqForkContext.add(head); + } + + if (context.test !== true) { + context.brokenForkContext.addAll(choiceContext.falseForkContext); + } + context.endOfTestSegments = choiceContext.trueForkContext.makeNext(0, -1); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * A class which manages state to analyze code paths. + */ +class CodePathState { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {IdGenerator} idGenerator An id generator to generate id for code + * path segments. + * @param {Function} onLooped A callback function to notify looping. + */ + constructor(idGenerator, onLooped) { + this.idGenerator = idGenerator; + this.notifyLooped = onLooped; + this.forkContext = ForkContext.newRoot(idGenerator); + this.choiceContext = null; + this.switchContext = null; + this.tryContext = null; + this.loopContext = null; + this.breakContext = null; + this.chainContext = null; + + this.currentSegments = []; + this.initialSegment = this.forkContext.head[0]; + + // returnedSegments and thrownSegments push elements into finalSegments also. + const final = this.finalSegments = []; + const returned = this.returnedForkContext = []; + const thrown = this.thrownForkContext = []; + + returned.add = addToReturnedOrThrown.bind(null, returned, thrown, final); + thrown.add = addToReturnedOrThrown.bind(null, thrown, returned, final); + } + + /** + * The head segments. + * @type {CodePathSegment[]} + */ + get headSegments() { + return this.forkContext.head; + } + + /** + * The parent forking context. + * This is used for the root of new forks. + * @type {ForkContext} + */ + get parentForkContext() { + const current = this.forkContext; + + return current && current.upper; + } + + /** + * Creates and stacks new forking context. + * @param {boolean} forkLeavingPath A flag which shows being in a + * "finally" block. + * @returns {ForkContext} The created context. + */ + pushForkContext(forkLeavingPath) { + this.forkContext = ForkContext.newEmpty( + this.forkContext, + forkLeavingPath + ); + + return this.forkContext; + } + + /** + * Pops and merges the last forking context. + * @returns {ForkContext} The last context. + */ + popForkContext() { + const lastContext = this.forkContext; + + this.forkContext = lastContext.upper; + this.forkContext.replaceHead(lastContext.makeNext(0, -1)); + + return lastContext; + } + + /** + * Creates a new path. + * @returns {void} + */ + forkPath() { + this.forkContext.add(this.parentForkContext.makeNext(-1, -1)); + } + + /** + * Creates a bypass path. + * This is used for such as IfStatement which does not have "else" chunk. + * @returns {void} + */ + forkBypassPath() { + this.forkContext.add(this.parentForkContext.head); + } + + //-------------------------------------------------------------------------- + // ConditionalExpression, LogicalExpression, IfStatement + //-------------------------------------------------------------------------- + + /** + * Creates a context for ConditionalExpression, LogicalExpression, AssignmentExpression (logical assignments only), + * IfStatement, WhileStatement, DoWhileStatement, or ForStatement. + * + * LogicalExpressions have cases that it goes different paths between the + * `true` case and the `false` case. + * + * For Example: + * + * if (a || b) { + * foo(); + * } else { + * bar(); + * } + * + * In this case, `b` is evaluated always in the code path of the `else` + * block, but it's not so in the code path of the `if` block. + * So there are 3 paths. + * + * a -> foo(); + * a -> b -> foo(); + * a -> b -> bar(); + * @param {string} kind A kind string. + * If the new context is LogicalExpression's or AssignmentExpression's, this is `"&&"` or `"||"` or `"??"`. + * If it's IfStatement's or ConditionalExpression's, this is `"test"`. + * Otherwise, this is `"loop"`. + * @param {boolean} isForkingAsResult A flag that shows that goes different + * paths between `true` and `false`. + * @returns {void} + */ + pushChoiceContext(kind, isForkingAsResult) { + this.choiceContext = { + upper: this.choiceContext, + kind, + isForkingAsResult, + trueForkContext: ForkContext.newEmpty(this.forkContext), + falseForkContext: ForkContext.newEmpty(this.forkContext), + qqForkContext: ForkContext.newEmpty(this.forkContext), + processed: false + }; + } + + /** + * Pops the last choice context and finalizes it. + * @returns {ChoiceContext} The popped context. + */ + popChoiceContext() { + const context = this.choiceContext; + + this.choiceContext = context.upper; + + const forkContext = this.forkContext; + const headSegments = forkContext.head; + + switch (context.kind) { + case "&&": + case "||": + case "??": + + /* + * If any result were not transferred from child contexts, + * this sets the head segments to both cases. + * The head segments are the path of the right-hand operand. + */ + if (!context.processed) { + context.trueForkContext.add(headSegments); + context.falseForkContext.add(headSegments); + context.qqForkContext.add(headSegments); + } + + /* + * Transfers results to upper context if this context is in + * test chunk. + */ + if (context.isForkingAsResult) { + const parentContext = this.choiceContext; + + parentContext.trueForkContext.addAll(context.trueForkContext); + parentContext.falseForkContext.addAll(context.falseForkContext); + parentContext.qqForkContext.addAll(context.qqForkContext); + parentContext.processed = true; + + return context; + } + + break; + + case "test": + if (!context.processed) { + + /* + * The head segments are the path of the `if` block here. + * Updates the `true` path with the end of the `if` block. + */ + context.trueForkContext.clear(); + context.trueForkContext.add(headSegments); + } else { + + /* + * The head segments are the path of the `else` block here. + * Updates the `false` path with the end of the `else` + * block. + */ + context.falseForkContext.clear(); + context.falseForkContext.add(headSegments); + } + + break; + + case "loop": + + /* + * Loops are addressed in popLoopContext(). + * This is called from popLoopContext(). + */ + return context; + + /* istanbul ignore next */ + default: + throw new Error("unreachable"); + } + + // Merges all paths. + const prevForkContext = context.trueForkContext; + + prevForkContext.addAll(context.falseForkContext); + forkContext.replaceHead(prevForkContext.makeNext(0, -1)); + + return context; + } + + /** + * Makes a code path segment of the right-hand operand of a logical + * expression. + * @returns {void} + */ + makeLogicalRight() { + const context = this.choiceContext; + const forkContext = this.forkContext; + + if (context.processed) { + + /* + * This got segments already from the child choice context. + * Creates the next path from own true/false fork context. + */ + let prevForkContext; + + switch (context.kind) { + case "&&": // if true then go to the right-hand side. + prevForkContext = context.trueForkContext; + break; + case "||": // if false then go to the right-hand side. + prevForkContext = context.falseForkContext; + break; + case "??": // Both true/false can short-circuit, so needs the third path to go to the right-hand side. That's qqForkContext. + prevForkContext = context.qqForkContext; + break; + default: + throw new Error("unreachable"); + } + + forkContext.replaceHead(prevForkContext.makeNext(0, -1)); + prevForkContext.clear(); + context.processed = false; + } else { + + /* + * This did not get segments from the child choice context. + * So addresses the head segments. + * The head segments are the path of the left-hand operand. + */ + switch (context.kind) { + case "&&": // the false path can short-circuit. + context.falseForkContext.add(forkContext.head); + break; + case "||": // the true path can short-circuit. + context.trueForkContext.add(forkContext.head); + break; + case "??": // both can short-circuit. + context.trueForkContext.add(forkContext.head); + context.falseForkContext.add(forkContext.head); + break; + default: + throw new Error("unreachable"); + } + + forkContext.replaceHead(forkContext.makeNext(-1, -1)); + } + } + + /** + * Makes a code path segment of the `if` block. + * @returns {void} + */ + makeIfConsequent() { + const context = this.choiceContext; + const forkContext = this.forkContext; + + /* + * If any result were not transferred from child contexts, + * this sets the head segments to both cases. + * The head segments are the path of the test expression. + */ + if (!context.processed) { + context.trueForkContext.add(forkContext.head); + context.falseForkContext.add(forkContext.head); + context.qqForkContext.add(forkContext.head); + } + + context.processed = false; + + // Creates new path from the `true` case. + forkContext.replaceHead( + context.trueForkContext.makeNext(0, -1) + ); + } + + /** + * Makes a code path segment of the `else` block. + * @returns {void} + */ + makeIfAlternate() { + const context = this.choiceContext; + const forkContext = this.forkContext; + + /* + * The head segments are the path of the `if` block. + * Updates the `true` path with the end of the `if` block. + */ + context.trueForkContext.clear(); + context.trueForkContext.add(forkContext.head); + context.processed = true; + + // Creates new path from the `false` case. + forkContext.replaceHead( + context.falseForkContext.makeNext(0, -1) + ); + } + + //-------------------------------------------------------------------------- + // ChainExpression + //-------------------------------------------------------------------------- + + /** + * Push a new `ChainExpression` context to the stack. + * This method is called on entering to each `ChainExpression` node. + * This context is used to count forking in the optional chain then merge them on the exiting from the `ChainExpression` node. + * @returns {void} + */ + pushChainContext() { + this.chainContext = { + upper: this.chainContext, + countChoiceContexts: 0 + }; + } + + /** + * Pop a `ChainExpression` context from the stack. + * This method is called on exiting from each `ChainExpression` node. + * This merges all forks of the last optional chaining. + * @returns {void} + */ + popChainContext() { + const context = this.chainContext; + + this.chainContext = context.upper; + + // pop all choice contexts of this. + for (let i = context.countChoiceContexts; i > 0; --i) { + this.popChoiceContext(); + } + } + + /** + * Create a choice context for optional access. + * This method is called on entering to each `(Call|Member)Expression[optional=true]` node. + * This creates a choice context as similar to `LogicalExpression[operator="??"]` node. + * @returns {void} + */ + makeOptionalNode() { + if (this.chainContext) { + this.chainContext.countChoiceContexts += 1; + this.pushChoiceContext("??", false); + } + } + + /** + * Create a fork. + * This method is called on entering to the `arguments|property` property of each `(Call|Member)Expression` node. + * @returns {void} + */ + makeOptionalRight() { + if (this.chainContext) { + this.makeLogicalRight(); + } + } + + //-------------------------------------------------------------------------- + // SwitchStatement + //-------------------------------------------------------------------------- + + /** + * Creates a context object of SwitchStatement and stacks it. + * @param {boolean} hasCase `true` if the switch statement has one or more + * case parts. + * @param {string|null} label The label text. + * @returns {void} + */ + pushSwitchContext(hasCase, label) { + this.switchContext = { + upper: this.switchContext, + hasCase, + defaultSegments: null, + defaultBodySegments: null, + foundDefault: false, + lastIsDefault: false, + countForks: 0 + }; + + this.pushBreakContext(true, label); + } + + /** + * Pops the last context of SwitchStatement and finalizes it. + * + * - Disposes all forking stack for `case` and `default`. + * - Creates the next code path segment from `context.brokenForkContext`. + * - If the last `SwitchCase` node is not a `default` part, creates a path + * to the `default` body. + * @returns {void} + */ + popSwitchContext() { + const context = this.switchContext; + + this.switchContext = context.upper; + + const forkContext = this.forkContext; + const brokenForkContext = this.popBreakContext().brokenForkContext; + + if (context.countForks === 0) { + + /* + * When there is only one `default` chunk and there is one or more + * `break` statements, even if forks are nothing, it needs to merge + * those. + */ + if (!brokenForkContext.empty) { + brokenForkContext.add(forkContext.makeNext(-1, -1)); + forkContext.replaceHead(brokenForkContext.makeNext(0, -1)); + } + + return; + } + + const lastSegments = forkContext.head; + + this.forkBypassPath(); + const lastCaseSegments = forkContext.head; + + /* + * `brokenForkContext` is used to make the next segment. + * It must add the last segment into `brokenForkContext`. + */ + brokenForkContext.add(lastSegments); + + /* + * A path which is failed in all case test should be connected to path + * of `default` chunk. + */ + if (!context.lastIsDefault) { + if (context.defaultBodySegments) { + + /* + * Remove a link from `default` label to its chunk. + * It's false route. + */ + removeConnection(context.defaultSegments, context.defaultBodySegments); + makeLooped(this, lastCaseSegments, context.defaultBodySegments); + } else { + + /* + * It handles the last case body as broken if `default` chunk + * does not exist. + */ + brokenForkContext.add(lastCaseSegments); + } + } + + // Pops the segment context stack until the entry segment. + for (let i = 0; i < context.countForks; ++i) { + this.forkContext = this.forkContext.upper; + } + + /* + * Creates a path from all brokenForkContext paths. + * This is a path after switch statement. + */ + this.forkContext.replaceHead(brokenForkContext.makeNext(0, -1)); + } + + /** + * Makes a code path segment for a `SwitchCase` node. + * @param {boolean} isEmpty `true` if the body is empty. + * @param {boolean} isDefault `true` if the body is the default case. + * @returns {void} + */ + makeSwitchCaseBody(isEmpty, isDefault) { + const context = this.switchContext; + + if (!context.hasCase) { + return; + } + + /* + * Merge forks. + * The parent fork context has two segments. + * Those are from the current case and the body of the previous case. + */ + const parentForkContext = this.forkContext; + const forkContext = this.pushForkContext(); + + forkContext.add(parentForkContext.makeNext(0, -1)); + + /* + * Save `default` chunk info. + * If the `default` label is not at the last, we must make a path from + * the last `case` to the `default` chunk. + */ + if (isDefault) { + context.defaultSegments = parentForkContext.head; + if (isEmpty) { + context.foundDefault = true; + } else { + context.defaultBodySegments = forkContext.head; + } + } else { + if (!isEmpty && context.foundDefault) { + context.foundDefault = false; + context.defaultBodySegments = forkContext.head; + } + } + + context.lastIsDefault = isDefault; + context.countForks += 1; + } + + //-------------------------------------------------------------------------- + // TryStatement + //-------------------------------------------------------------------------- + + /** + * Creates a context object of TryStatement and stacks it. + * @param {boolean} hasFinalizer `true` if the try statement has a + * `finally` block. + * @returns {void} + */ + pushTryContext(hasFinalizer) { + this.tryContext = { + upper: this.tryContext, + position: "try", + hasFinalizer, + + returnedForkContext: hasFinalizer + ? ForkContext.newEmpty(this.forkContext) + : null, + + thrownForkContext: ForkContext.newEmpty(this.forkContext), + lastOfTryIsReachable: false, + lastOfCatchIsReachable: false + }; + } + + /** + * Pops the last context of TryStatement and finalizes it. + * @returns {void} + */ + popTryContext() { + const context = this.tryContext; + + this.tryContext = context.upper; + + if (context.position === "catch") { + + // Merges two paths from the `try` block and `catch` block merely. + this.popForkContext(); + return; + } + + /* + * The following process is executed only when there is the `finally` + * block. + */ + + const returned = context.returnedForkContext; + const thrown = context.thrownForkContext; + + if (returned.empty && thrown.empty) { + return; + } + + // Separate head to normal paths and leaving paths. + const headSegments = this.forkContext.head; + + this.forkContext = this.forkContext.upper; + const normalSegments = headSegments.slice(0, headSegments.length / 2 | 0); + const leavingSegments = headSegments.slice(headSegments.length / 2 | 0); + + // Forwards the leaving path to upper contexts. + if (!returned.empty) { + getReturnContext(this).returnedForkContext.add(leavingSegments); + } + if (!thrown.empty) { + getThrowContext(this).thrownForkContext.add(leavingSegments); + } + + // Sets the normal path as the next. + this.forkContext.replaceHead(normalSegments); + + /* + * If both paths of the `try` block and the `catch` block are + * unreachable, the next path becomes unreachable as well. + */ + if (!context.lastOfTryIsReachable && !context.lastOfCatchIsReachable) { + this.forkContext.makeUnreachable(); + } + } + + /** + * Makes a code path segment for a `catch` block. + * @returns {void} + */ + makeCatchBlock() { + const context = this.tryContext; + const forkContext = this.forkContext; + const thrown = context.thrownForkContext; + + // Update state. + context.position = "catch"; + context.thrownForkContext = ForkContext.newEmpty(forkContext); + context.lastOfTryIsReachable = forkContext.reachable; + + // Merge thrown paths. + thrown.add(forkContext.head); + const thrownSegments = thrown.makeNext(0, -1); + + // Fork to a bypass and the merged thrown path. + this.pushForkContext(); + this.forkBypassPath(); + this.forkContext.add(thrownSegments); + } + + /** + * Makes a code path segment for a `finally` block. + * + * In the `finally` block, parallel paths are created. The parallel paths + * are used as leaving-paths. The leaving-paths are paths from `return` + * statements and `throw` statements in a `try` block or a `catch` block. + * @returns {void} + */ + makeFinallyBlock() { + const context = this.tryContext; + let forkContext = this.forkContext; + const returned = context.returnedForkContext; + const thrown = context.thrownForkContext; + const headOfLeavingSegments = forkContext.head; + + // Update state. + if (context.position === "catch") { + + // Merges two paths from the `try` block and `catch` block. + this.popForkContext(); + forkContext = this.forkContext; + + context.lastOfCatchIsReachable = forkContext.reachable; + } else { + context.lastOfTryIsReachable = forkContext.reachable; + } + context.position = "finally"; + + if (returned.empty && thrown.empty) { + + // This path does not leave. + return; + } + + /* + * Create a parallel segment from merging returned and thrown. + * This segment will leave at the end of this finally block. + */ + const segments = forkContext.makeNext(-1, -1); + + for (let i = 0; i < forkContext.count; ++i) { + const prevSegsOfLeavingSegment = [headOfLeavingSegments[i]]; + + for (let j = 0; j < returned.segmentsList.length; ++j) { + prevSegsOfLeavingSegment.push(returned.segmentsList[j][i]); + } + for (let j = 0; j < thrown.segmentsList.length; ++j) { + prevSegsOfLeavingSegment.push(thrown.segmentsList[j][i]); + } + + segments.push( + CodePathSegment.newNext( + this.idGenerator.next(), + prevSegsOfLeavingSegment + ) + ); + } + + this.pushForkContext(true); + this.forkContext.add(segments); + } + + /** + * Makes a code path segment from the first throwable node to the `catch` + * block or the `finally` block. + * @returns {void} + */ + makeFirstThrowablePathInTryBlock() { + const forkContext = this.forkContext; + + if (!forkContext.reachable) { + return; + } + + const context = getThrowContext(this); + + if (context === this || + context.position !== "try" || + !context.thrownForkContext.empty + ) { + return; + } + + context.thrownForkContext.add(forkContext.head); + forkContext.replaceHead(forkContext.makeNext(-1, -1)); + } + + //-------------------------------------------------------------------------- + // Loop Statements + //-------------------------------------------------------------------------- + + /** + * Creates a context object of a loop statement and stacks it. + * @param {string} type The type of the node which was triggered. One of + * `WhileStatement`, `DoWhileStatement`, `ForStatement`, `ForInStatement`, + * and `ForStatement`. + * @param {string|null} label A label of the node which was triggered. + * @returns {void} + */ + pushLoopContext(type, label) { + const forkContext = this.forkContext; + const breakContext = this.pushBreakContext(true, label); + + switch (type) { + case "WhileStatement": + this.pushChoiceContext("loop", false); + this.loopContext = { + upper: this.loopContext, + type, + label, + test: void 0, + continueDestSegments: null, + brokenForkContext: breakContext.brokenForkContext + }; + break; + + case "DoWhileStatement": + this.pushChoiceContext("loop", false); + this.loopContext = { + upper: this.loopContext, + type, + label, + test: void 0, + entrySegments: null, + continueForkContext: ForkContext.newEmpty(forkContext), + brokenForkContext: breakContext.brokenForkContext + }; + break; + + case "ForStatement": + this.pushChoiceContext("loop", false); + this.loopContext = { + upper: this.loopContext, + type, + label, + test: void 0, + endOfInitSegments: null, + testSegments: null, + endOfTestSegments: null, + updateSegments: null, + endOfUpdateSegments: null, + continueDestSegments: null, + brokenForkContext: breakContext.brokenForkContext + }; + break; + + case "ForInStatement": + case "ForOfStatement": + this.loopContext = { + upper: this.loopContext, + type, + label, + prevSegments: null, + leftSegments: null, + endOfLeftSegments: null, + continueDestSegments: null, + brokenForkContext: breakContext.brokenForkContext + }; + break; + + /* istanbul ignore next */ + default: + throw new Error(`unknown type: "${type}"`); + } + } + + /** + * Pops the last context of a loop statement and finalizes it. + * @returns {void} + */ + popLoopContext() { + const context = this.loopContext; + + this.loopContext = context.upper; + + const forkContext = this.forkContext; + const brokenForkContext = this.popBreakContext().brokenForkContext; + + // Creates a looped path. + switch (context.type) { + case "WhileStatement": + case "ForStatement": + this.popChoiceContext(); + makeLooped( + this, + forkContext.head, + context.continueDestSegments + ); + break; + + case "DoWhileStatement": { + const choiceContext = this.popChoiceContext(); + + if (!choiceContext.processed) { + choiceContext.trueForkContext.add(forkContext.head); + choiceContext.falseForkContext.add(forkContext.head); + } + if (context.test !== true) { + brokenForkContext.addAll(choiceContext.falseForkContext); + } + + // `true` paths go to looping. + const segmentsList = choiceContext.trueForkContext.segmentsList; + + for (let i = 0; i < segmentsList.length; ++i) { + makeLooped( + this, + segmentsList[i], + context.entrySegments + ); + } + break; + } + + case "ForInStatement": + case "ForOfStatement": + brokenForkContext.add(forkContext.head); + makeLooped( + this, + forkContext.head, + context.leftSegments + ); + break; + + /* istanbul ignore next */ + default: + throw new Error("unreachable"); + } + + // Go next. + if (brokenForkContext.empty) { + forkContext.replaceHead(forkContext.makeUnreachable(-1, -1)); + } else { + forkContext.replaceHead(brokenForkContext.makeNext(0, -1)); + } + } + + /** + * Makes a code path segment for the test part of a WhileStatement. + * @param {boolean|undefined} test The test value (only when constant). + * @returns {void} + */ + makeWhileTest(test) { + const context = this.loopContext; + const forkContext = this.forkContext; + const testSegments = forkContext.makeNext(0, -1); + + // Update state. + context.test = test; + context.continueDestSegments = testSegments; + forkContext.replaceHead(testSegments); + } + + /** + * Makes a code path segment for the body part of a WhileStatement. + * @returns {void} + */ + makeWhileBody() { + const context = this.loopContext; + const choiceContext = this.choiceContext; + const forkContext = this.forkContext; + + if (!choiceContext.processed) { + choiceContext.trueForkContext.add(forkContext.head); + choiceContext.falseForkContext.add(forkContext.head); + } + + // Update state. + if (context.test !== true) { + context.brokenForkContext.addAll(choiceContext.falseForkContext); + } + forkContext.replaceHead(choiceContext.trueForkContext.makeNext(0, -1)); + } + + /** + * Makes a code path segment for the body part of a DoWhileStatement. + * @returns {void} + */ + makeDoWhileBody() { + const context = this.loopContext; + const forkContext = this.forkContext; + const bodySegments = forkContext.makeNext(-1, -1); + + // Update state. + context.entrySegments = bodySegments; + forkContext.replaceHead(bodySegments); + } + + /** + * Makes a code path segment for the test part of a DoWhileStatement. + * @param {boolean|undefined} test The test value (only when constant). + * @returns {void} + */ + makeDoWhileTest(test) { + const context = this.loopContext; + const forkContext = this.forkContext; + + context.test = test; + + // Creates paths of `continue` statements. + if (!context.continueForkContext.empty) { + context.continueForkContext.add(forkContext.head); + const testSegments = context.continueForkContext.makeNext(0, -1); + + forkContext.replaceHead(testSegments); + } + } + + /** + * Makes a code path segment for the test part of a ForStatement. + * @param {boolean|undefined} test The test value (only when constant). + * @returns {void} + */ + makeForTest(test) { + const context = this.loopContext; + const forkContext = this.forkContext; + const endOfInitSegments = forkContext.head; + const testSegments = forkContext.makeNext(-1, -1); + + // Update state. + context.test = test; + context.endOfInitSegments = endOfInitSegments; + context.continueDestSegments = context.testSegments = testSegments; + forkContext.replaceHead(testSegments); + } + + /** + * Makes a code path segment for the update part of a ForStatement. + * @returns {void} + */ + makeForUpdate() { + const context = this.loopContext; + const choiceContext = this.choiceContext; + const forkContext = this.forkContext; + + // Make the next paths of the test. + if (context.testSegments) { + finalizeTestSegmentsOfFor( + context, + choiceContext, + forkContext.head + ); + } else { + context.endOfInitSegments = forkContext.head; + } + + // Update state. + const updateSegments = forkContext.makeDisconnected(-1, -1); + + context.continueDestSegments = context.updateSegments = updateSegments; + forkContext.replaceHead(updateSegments); + } + + /** + * Makes a code path segment for the body part of a ForStatement. + * @returns {void} + */ + makeForBody() { + const context = this.loopContext; + const choiceContext = this.choiceContext; + const forkContext = this.forkContext; + + // Update state. + if (context.updateSegments) { + context.endOfUpdateSegments = forkContext.head; + + // `update` -> `test` + if (context.testSegments) { + makeLooped( + this, + context.endOfUpdateSegments, + context.testSegments + ); + } + } else if (context.testSegments) { + finalizeTestSegmentsOfFor( + context, + choiceContext, + forkContext.head + ); + } else { + context.endOfInitSegments = forkContext.head; + } + + let bodySegments = context.endOfTestSegments; + + if (!bodySegments) { + + /* + * If there is not the `test` part, the `body` path comes from the + * `init` part and the `update` part. + */ + const prevForkContext = ForkContext.newEmpty(forkContext); + + prevForkContext.add(context.endOfInitSegments); + if (context.endOfUpdateSegments) { + prevForkContext.add(context.endOfUpdateSegments); + } + + bodySegments = prevForkContext.makeNext(0, -1); + } + context.continueDestSegments = context.continueDestSegments || bodySegments; + forkContext.replaceHead(bodySegments); + } + + /** + * Makes a code path segment for the left part of a ForInStatement and a + * ForOfStatement. + * @returns {void} + */ + makeForInOfLeft() { + const context = this.loopContext; + const forkContext = this.forkContext; + const leftSegments = forkContext.makeDisconnected(-1, -1); + + // Update state. + context.prevSegments = forkContext.head; + context.leftSegments = context.continueDestSegments = leftSegments; + forkContext.replaceHead(leftSegments); + } + + /** + * Makes a code path segment for the right part of a ForInStatement and a + * ForOfStatement. + * @returns {void} + */ + makeForInOfRight() { + const context = this.loopContext; + const forkContext = this.forkContext; + const temp = ForkContext.newEmpty(forkContext); + + temp.add(context.prevSegments); + const rightSegments = temp.makeNext(-1, -1); + + // Update state. + context.endOfLeftSegments = forkContext.head; + forkContext.replaceHead(rightSegments); + } + + /** + * Makes a code path segment for the body part of a ForInStatement and a + * ForOfStatement. + * @returns {void} + */ + makeForInOfBody() { + const context = this.loopContext; + const forkContext = this.forkContext; + const temp = ForkContext.newEmpty(forkContext); + + temp.add(context.endOfLeftSegments); + const bodySegments = temp.makeNext(-1, -1); + + // Make a path: `right` -> `left`. + makeLooped(this, forkContext.head, context.leftSegments); + + // Update state. + context.brokenForkContext.add(forkContext.head); + forkContext.replaceHead(bodySegments); + } + + //-------------------------------------------------------------------------- + // Control Statements + //-------------------------------------------------------------------------- + + /** + * Creates new context for BreakStatement. + * @param {boolean} breakable The flag to indicate it can break by + * an unlabeled BreakStatement. + * @param {string|null} label The label of this context. + * @returns {Object} The new context. + */ + pushBreakContext(breakable, label) { + this.breakContext = { + upper: this.breakContext, + breakable, + label, + brokenForkContext: ForkContext.newEmpty(this.forkContext) + }; + return this.breakContext; + } + + /** + * Removes the top item of the break context stack. + * @returns {Object} The removed context. + */ + popBreakContext() { + const context = this.breakContext; + const forkContext = this.forkContext; + + this.breakContext = context.upper; + + // Process this context here for other than switches and loops. + if (!context.breakable) { + const brokenForkContext = context.brokenForkContext; + + if (!brokenForkContext.empty) { + brokenForkContext.add(forkContext.head); + forkContext.replaceHead(brokenForkContext.makeNext(0, -1)); + } + } + + return context; + } + + /** + * Makes a path for a `break` statement. + * + * It registers the head segment to a context of `break`. + * It makes new unreachable segment, then it set the head with the segment. + * @param {string} label A label of the break statement. + * @returns {void} + */ + makeBreak(label) { + const forkContext = this.forkContext; + + if (!forkContext.reachable) { + return; + } + + const context = getBreakContext(this, label); + + /* istanbul ignore else: foolproof (syntax error) */ + if (context) { + context.brokenForkContext.add(forkContext.head); + } + + forkContext.replaceHead(forkContext.makeUnreachable(-1, -1)); + } + + /** + * Makes a path for a `continue` statement. + * + * It makes a looping path. + * It makes new unreachable segment, then it set the head with the segment. + * @param {string} label A label of the continue statement. + * @returns {void} + */ + makeContinue(label) { + const forkContext = this.forkContext; + + if (!forkContext.reachable) { + return; + } + + const context = getContinueContext(this, label); + + /* istanbul ignore else: foolproof (syntax error) */ + if (context) { + if (context.continueDestSegments) { + makeLooped(this, forkContext.head, context.continueDestSegments); + + // If the context is a for-in/of loop, this effects a break also. + if (context.type === "ForInStatement" || + context.type === "ForOfStatement" + ) { + context.brokenForkContext.add(forkContext.head); + } + } else { + context.continueForkContext.add(forkContext.head); + } + } + forkContext.replaceHead(forkContext.makeUnreachable(-1, -1)); + } + + /** + * Makes a path for a `return` statement. + * + * It registers the head segment to a context of `return`. + * It makes new unreachable segment, then it set the head with the segment. + * @returns {void} + */ + makeReturn() { + const forkContext = this.forkContext; + + if (forkContext.reachable) { + getReturnContext(this).returnedForkContext.add(forkContext.head); + forkContext.replaceHead(forkContext.makeUnreachable(-1, -1)); + } + } + + /** + * Makes a path for a `throw` statement. + * + * It registers the head segment to a context of `throw`. + * It makes new unreachable segment, then it set the head with the segment. + * @returns {void} + */ + makeThrow() { + const forkContext = this.forkContext; + + if (forkContext.reachable) { + getThrowContext(this).thrownForkContext.add(forkContext.head); + forkContext.replaceHead(forkContext.makeUnreachable(-1, -1)); + } + } + + /** + * Makes the final path. + * @returns {void} + */ + makeFinal() { + const segments = this.currentSegments; + + if (segments.length > 0 && segments[0].reachable) { + this.returnedForkContext.add(segments); + } + } +} + +module.exports = CodePathState; diff --git a/node_modules/eslint/lib/linter/code-path-analysis/code-path.js b/node_modules/eslint/lib/linter/code-path-analysis/code-path.js new file mode 100644 index 000000000..49b37c6b2 --- /dev/null +++ b/node_modules/eslint/lib/linter/code-path-analysis/code-path.js @@ -0,0 +1,238 @@ +/** + * @fileoverview A class of the code path. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const CodePathState = require("./code-path-state"); +const IdGenerator = require("./id-generator"); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * A code path. + */ +class CodePath { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {string} id An identifier. + * @param {CodePath|null} upper The code path of the upper function scope. + * @param {Function} onLooped A callback function to notify looping. + */ + constructor(id, upper, onLooped) { + + /** + * The identifier of this code path. + * Rules use it to store additional information of each rule. + * @type {string} + */ + this.id = id; + + /** + * The code path of the upper function scope. + * @type {CodePath|null} + */ + this.upper = upper; + + /** + * The code paths of nested function scopes. + * @type {CodePath[]} + */ + this.childCodePaths = []; + + // Initializes internal state. + Object.defineProperty( + this, + "internal", + { value: new CodePathState(new IdGenerator(`${id}_`), onLooped) } + ); + + // Adds this into `childCodePaths` of `upper`. + if (upper) { + upper.childCodePaths.push(this); + } + } + + /** + * Gets the state of a given code path. + * @param {CodePath} codePath A code path to get. + * @returns {CodePathState} The state of the code path. + */ + static getState(codePath) { + return codePath.internal; + } + + /** + * The initial code path segment. + * @type {CodePathSegment} + */ + get initialSegment() { + return this.internal.initialSegment; + } + + /** + * Final code path segments. + * This array is a mix of `returnedSegments` and `thrownSegments`. + * @type {CodePathSegment[]} + */ + get finalSegments() { + return this.internal.finalSegments; + } + + /** + * Final code path segments which is with `return` statements. + * This array contains the last path segment if it's reachable. + * Since the reachable last path returns `undefined`. + * @type {CodePathSegment[]} + */ + get returnedSegments() { + return this.internal.returnedForkContext; + } + + /** + * Final code path segments which is with `throw` statements. + * @type {CodePathSegment[]} + */ + get thrownSegments() { + return this.internal.thrownForkContext; + } + + /** + * Current code path segments. + * @type {CodePathSegment[]} + */ + get currentSegments() { + return this.internal.currentSegments; + } + + /** + * Traverses all segments in this code path. + * + * codePath.traverseSegments(function(segment, controller) { + * // do something. + * }); + * + * This method enumerates segments in order from the head. + * + * The `controller` object has two methods. + * + * - `controller.skip()` - Skip the following segments in this branch. + * - `controller.break()` - Skip all following segments. + * @param {Object} [options] Omittable. + * @param {CodePathSegment} [options.first] The first segment to traverse. + * @param {CodePathSegment} [options.last] The last segment to traverse. + * @param {Function} callback A callback function. + * @returns {void} + */ + traverseSegments(options, callback) { + let resolvedOptions; + let resolvedCallback; + + if (typeof options === "function") { + resolvedCallback = options; + resolvedOptions = {}; + } else { + resolvedOptions = options || {}; + resolvedCallback = callback; + } + + const startSegment = resolvedOptions.first || this.internal.initialSegment; + const lastSegment = resolvedOptions.last; + + let item = null; + let index = 0; + let end = 0; + let segment = null; + const visited = Object.create(null); + const stack = [[startSegment, 0]]; + let skippedSegment = null; + let broken = false; + const controller = { + skip() { + if (stack.length <= 1) { + broken = true; + } else { + skippedSegment = stack[stack.length - 2][0]; + } + }, + break() { + broken = true; + } + }; + + /** + * Checks a given previous segment has been visited. + * @param {CodePathSegment} prevSegment A previous segment to check. + * @returns {boolean} `true` if the segment has been visited. + */ + function isVisited(prevSegment) { + return ( + visited[prevSegment.id] || + segment.isLoopedPrevSegment(prevSegment) + ); + } + + while (stack.length > 0) { + item = stack[stack.length - 1]; + segment = item[0]; + index = item[1]; + + if (index === 0) { + + // Skip if this segment has been visited already. + if (visited[segment.id]) { + stack.pop(); + continue; + } + + // Skip if all previous segments have not been visited. + if (segment !== startSegment && + segment.prevSegments.length > 0 && + !segment.prevSegments.every(isVisited) + ) { + stack.pop(); + continue; + } + + // Reset the flag of skipping if all branches have been skipped. + if (skippedSegment && segment.prevSegments.indexOf(skippedSegment) !== -1) { + skippedSegment = null; + } + visited[segment.id] = true; + + // Call the callback when the first time. + if (!skippedSegment) { + resolvedCallback.call(this, segment, controller); + if (segment === lastSegment) { + controller.skip(); + } + if (broken) { + break; + } + } + } + + // Update the stack. + end = segment.nextSegments.length - 1; + if (index < end) { + item[1] += 1; + stack.push([segment.nextSegments[index], 0]); + } else if (index === end) { + item[0] = segment.nextSegments[index]; + item[1] = 0; + } else { + stack.pop(); + } + } + } +} + +module.exports = CodePath; diff --git a/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js b/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js new file mode 100644 index 000000000..a4cb99a22 --- /dev/null +++ b/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js @@ -0,0 +1,203 @@ +/** + * @fileoverview Helpers to debug for code path analysis. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const debug = require("debug")("eslint:code-path"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets id of a given segment. + * @param {CodePathSegment} segment A segment to get. + * @returns {string} Id of the segment. + */ +/* istanbul ignore next */ +function getId(segment) { // eslint-disable-line jsdoc/require-jsdoc + return segment.id + (segment.reachable ? "" : "!"); +} + +/** + * Get string for the given node and operation. + * @param {ASTNode} node The node to convert. + * @param {"enter" | "exit" | undefined} label The operation label. + * @returns {string} The string representation. + */ +function nodeToString(node, label) { + const suffix = label ? `:${label}` : ""; + + switch (node.type) { + case "Identifier": return `${node.type}${suffix} (${node.name})`; + case "Literal": return `${node.type}${suffix} (${node.value})`; + default: return `${node.type}${suffix}`; + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + + /** + * A flag that debug dumping is enabled or not. + * @type {boolean} + */ + enabled: debug.enabled, + + /** + * Dumps given objects. + * @param {...any} args objects to dump. + * @returns {void} + */ + dump: debug, + + /** + * Dumps the current analyzing state. + * @param {ASTNode} node A node to dump. + * @param {CodePathState} state A state to dump. + * @param {boolean} leaving A flag whether or not it's leaving + * @returns {void} + */ + dumpState: !debug.enabled ? debug : /* istanbul ignore next */ function(node, state, leaving) { + for (let i = 0; i < state.currentSegments.length; ++i) { + const segInternal = state.currentSegments[i].internal; + + if (leaving) { + const last = segInternal.nodes.length - 1; + + if (last >= 0 && segInternal.nodes[last] === nodeToString(node, "enter")) { + segInternal.nodes[last] = nodeToString(node, void 0); + } else { + segInternal.nodes.push(nodeToString(node, "exit")); + } + } else { + segInternal.nodes.push(nodeToString(node, "enter")); + } + } + + debug([ + `${state.currentSegments.map(getId).join(",")})`, + `${node.type}${leaving ? ":exit" : ""}` + ].join(" ")); + }, + + /** + * Dumps a DOT code of a given code path. + * The DOT code can be visualized with Graphvis. + * @param {CodePath} codePath A code path to dump. + * @returns {void} + * @see http://www.graphviz.org + * @see http://www.webgraphviz.com + */ + dumpDot: !debug.enabled ? debug : /* istanbul ignore next */ function(codePath) { + let text = + "\n" + + "digraph {\n" + + "node[shape=box,style=\"rounded,filled\",fillcolor=white];\n" + + "initial[label=\"\",shape=circle,style=filled,fillcolor=black,width=0.25,height=0.25];\n"; + + if (codePath.returnedSegments.length > 0) { + text += "final[label=\"\",shape=doublecircle,style=filled,fillcolor=black,width=0.25,height=0.25];\n"; + } + if (codePath.thrownSegments.length > 0) { + text += "thrown[label=\"✘\",shape=circle,width=0.3,height=0.3,fixedsize];\n"; + } + + const traceMap = Object.create(null); + const arrows = this.makeDotArrows(codePath, traceMap); + + for (const id in traceMap) { // eslint-disable-line guard-for-in + const segment = traceMap[id]; + + text += `${id}[`; + + if (segment.reachable) { + text += "label=\""; + } else { + text += "style=\"rounded,dashed,filled\",fillcolor=\"#FF9800\",label=\"<>\\n"; + } + + if (segment.internal.nodes.length > 0) { + text += segment.internal.nodes.join("\\n"); + } else { + text += "????"; + } + + text += "\"];\n"; + } + + text += `${arrows}\n`; + text += "}"; + debug("DOT", text); + }, + + /** + * Makes a DOT code of a given code path. + * The DOT code can be visualized with Graphvis. + * @param {CodePath} codePath A code path to make DOT. + * @param {Object} traceMap Optional. A map to check whether or not segments had been done. + * @returns {string} A DOT code of the code path. + */ + makeDotArrows(codePath, traceMap) { + const stack = [[codePath.initialSegment, 0]]; + const done = traceMap || Object.create(null); + let lastId = codePath.initialSegment.id; + let text = `initial->${codePath.initialSegment.id}`; + + while (stack.length > 0) { + const item = stack.pop(); + const segment = item[0]; + const index = item[1]; + + if (done[segment.id] && index === 0) { + continue; + } + done[segment.id] = segment; + + const nextSegment = segment.allNextSegments[index]; + + if (!nextSegment) { + continue; + } + + if (lastId === segment.id) { + text += `->${nextSegment.id}`; + } else { + text += `;\n${segment.id}->${nextSegment.id}`; + } + lastId = nextSegment.id; + + stack.unshift([segment, 1 + index]); + stack.push([nextSegment, 0]); + } + + codePath.returnedSegments.forEach(finalSegment => { + if (lastId === finalSegment.id) { + text += "->final"; + } else { + text += `;\n${finalSegment.id}->final`; + } + lastId = null; + }); + + codePath.thrownSegments.forEach(finalSegment => { + if (lastId === finalSegment.id) { + text += "->thrown"; + } else { + text += `;\n${finalSegment.id}->thrown`; + } + lastId = null; + }); + + return `${text};`; + } +}; diff --git a/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js b/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js new file mode 100644 index 000000000..2e872b5c0 --- /dev/null +++ b/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js @@ -0,0 +1,249 @@ +/** + * @fileoverview A class to operate forking. + * + * This is state of forking. + * This has a fork list and manages it. + * + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const assert = require("assert"), + CodePathSegment = require("./code-path-segment"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets whether or not a given segment is reachable. + * @param {CodePathSegment} segment A segment to get. + * @returns {boolean} `true` if the segment is reachable. + */ +function isReachable(segment) { + return segment.reachable; +} + +/** + * Creates new segments from the specific range of `context.segmentsList`. + * + * When `context.segmentsList` is `[[a, b], [c, d], [e, f]]`, `begin` is `0`, and + * `end` is `-1`, this creates `[g, h]`. This `g` is from `a`, `c`, and `e`. + * This `h` is from `b`, `d`, and `f`. + * @param {ForkContext} context An instance. + * @param {number} begin The first index of the previous segments. + * @param {number} end The last index of the previous segments. + * @param {Function} create A factory function of new segments. + * @returns {CodePathSegment[]} New segments. + */ +function makeSegments(context, begin, end, create) { + const list = context.segmentsList; + + const normalizedBegin = begin >= 0 ? begin : list.length + begin; + const normalizedEnd = end >= 0 ? end : list.length + end; + + const segments = []; + + for (let i = 0; i < context.count; ++i) { + const allPrevSegments = []; + + for (let j = normalizedBegin; j <= normalizedEnd; ++j) { + allPrevSegments.push(list[j][i]); + } + + segments.push(create(context.idGenerator.next(), allPrevSegments)); + } + + return segments; +} + +/** + * `segments` becomes doubly in a `finally` block. Then if a code path exits by a + * control statement (such as `break`, `continue`) from the `finally` block, the + * destination's segments may be half of the source segments. In that case, this + * merges segments. + * @param {ForkContext} context An instance. + * @param {CodePathSegment[]} segments Segments to merge. + * @returns {CodePathSegment[]} The merged segments. + */ +function mergeExtraSegments(context, segments) { + let currentSegments = segments; + + while (currentSegments.length > context.count) { + const merged = []; + + for (let i = 0, length = currentSegments.length / 2 | 0; i < length; ++i) { + merged.push(CodePathSegment.newNext( + context.idGenerator.next(), + [currentSegments[i], currentSegments[i + length]] + )); + } + currentSegments = merged; + } + return currentSegments; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * A class to manage forking. + */ +class ForkContext { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {IdGenerator} idGenerator An identifier generator for segments. + * @param {ForkContext|null} upper An upper fork context. + * @param {number} count A number of parallel segments. + */ + constructor(idGenerator, upper, count) { + this.idGenerator = idGenerator; + this.upper = upper; + this.count = count; + this.segmentsList = []; + } + + /** + * The head segments. + * @type {CodePathSegment[]} + */ + get head() { + const list = this.segmentsList; + + return list.length === 0 ? [] : list[list.length - 1]; + } + + /** + * A flag which shows empty. + * @type {boolean} + */ + get empty() { + return this.segmentsList.length === 0; + } + + /** + * A flag which shows reachable. + * @type {boolean} + */ + get reachable() { + const segments = this.head; + + return segments.length > 0 && segments.some(isReachable); + } + + /** + * Creates new segments from this context. + * @param {number} begin The first index of previous segments. + * @param {number} end The last index of previous segments. + * @returns {CodePathSegment[]} New segments. + */ + makeNext(begin, end) { + return makeSegments(this, begin, end, CodePathSegment.newNext); + } + + /** + * Creates new segments from this context. + * The new segments is always unreachable. + * @param {number} begin The first index of previous segments. + * @param {number} end The last index of previous segments. + * @returns {CodePathSegment[]} New segments. + */ + makeUnreachable(begin, end) { + return makeSegments(this, begin, end, CodePathSegment.newUnreachable); + } + + /** + * Creates new segments from this context. + * The new segments don't have connections for previous segments. + * But these inherit the reachable flag from this context. + * @param {number} begin The first index of previous segments. + * @param {number} end The last index of previous segments. + * @returns {CodePathSegment[]} New segments. + */ + makeDisconnected(begin, end) { + return makeSegments(this, begin, end, CodePathSegment.newDisconnected); + } + + /** + * Adds segments into this context. + * The added segments become the head. + * @param {CodePathSegment[]} segments Segments to add. + * @returns {void} + */ + add(segments) { + assert(segments.length >= this.count, `${segments.length} >= ${this.count}`); + + this.segmentsList.push(mergeExtraSegments(this, segments)); + } + + /** + * Replaces the head segments with given segments. + * The current head segments are removed. + * @param {CodePathSegment[]} segments Segments to add. + * @returns {void} + */ + replaceHead(segments) { + assert(segments.length >= this.count, `${segments.length} >= ${this.count}`); + + this.segmentsList.splice(-1, 1, mergeExtraSegments(this, segments)); + } + + /** + * Adds all segments of a given fork context into this context. + * @param {ForkContext} context A fork context to add. + * @returns {void} + */ + addAll(context) { + assert(context.count === this.count); + + const source = context.segmentsList; + + for (let i = 0; i < source.length; ++i) { + this.segmentsList.push(source[i]); + } + } + + /** + * Clears all segments in this context. + * @returns {void} + */ + clear() { + this.segmentsList = []; + } + + /** + * Creates the root fork context. + * @param {IdGenerator} idGenerator An identifier generator for segments. + * @returns {ForkContext} New fork context. + */ + static newRoot(idGenerator) { + const context = new ForkContext(idGenerator, null, 1); + + context.add([CodePathSegment.newRoot(idGenerator.next())]); + + return context; + } + + /** + * Creates an empty fork context preceded by a given context. + * @param {ForkContext} parentContext The parent fork context. + * @param {boolean} forkLeavingPath A flag which shows inside of `finally` block. + * @returns {ForkContext} New fork context. + */ + static newEmpty(parentContext, forkLeavingPath) { + return new ForkContext( + parentContext.idGenerator, + parentContext, + (forkLeavingPath ? 2 : 1) * parentContext.count + ); + } +} + +module.exports = ForkContext; diff --git a/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js b/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js new file mode 100644 index 000000000..4cb2e0e3d --- /dev/null +++ b/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js @@ -0,0 +1,46 @@ +/** + * @fileoverview A class of identifiers generator for code path segments. + * + * Each rule uses the identifier of code path segments to store additional + * information of the code path. + * + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * A generator for unique ids. + */ +class IdGenerator { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {string} prefix Optional. A prefix of generated ids. + */ + constructor(prefix) { + this.prefix = String(prefix); + this.n = 0; + } + + /** + * Generates id. + * @returns {string} A generated id. + */ + next() { + this.n = 1 + this.n | 0; + + /* istanbul ignore if */ + if (this.n < 0) { + this.n = 1; + } + + return this.prefix + this.n; + } +} + +module.exports = IdGenerator; diff --git a/node_modules/eslint/lib/linter/config-comment-parser.js b/node_modules/eslint/lib/linter/config-comment-parser.js new file mode 100644 index 000000000..07bbead28 --- /dev/null +++ b/node_modules/eslint/lib/linter/config-comment-parser.js @@ -0,0 +1,141 @@ +/** + * @fileoverview Config Comment Parser + * @author Nicholas C. Zakas + */ + +/* eslint-disable class-methods-use-this*/ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const levn = require("levn"), + ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops"); + +const debug = require("debug")("eslint:config-comment-parser"); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Object to parse ESLint configuration comments inside JavaScript files. + * @name ConfigCommentParser + */ +module.exports = class ConfigCommentParser { + + /** + * Parses a list of "name:string_value" or/and "name" options divided by comma or + * whitespace. Used for "global" and "exported" comments. + * @param {string} string The string to parse. + * @param {Comment} comment The comment node which has the string. + * @returns {Object} Result map object of names and string values, or null values if no value was provided + */ + parseStringConfig(string, comment) { + debug("Parsing String config"); + + const items = {}; + + // Collapse whitespace around `:` and `,` to make parsing easier + const trimmedString = string.replace(/\s*([:,])\s*/gu, "$1"); + + trimmedString.split(/\s|,+/u).forEach(name => { + if (!name) { + return; + } + + // value defaults to null (if not provided), e.g: "foo" => ["foo", null] + const [key, value = null] = name.split(":"); + + items[key] = { value, comment }; + }); + return items; + } + + /** + * Parses a JSON-like config. + * @param {string} string The string to parse. + * @param {Object} location Start line and column of comments for potential error message. + * @returns {({success: true, config: Object}|{success: false, error: Problem})} Result map object + */ + parseJsonConfig(string, location) { + debug("Parsing JSON config"); + + let items = {}; + + // Parses a JSON-like comment by the same way as parsing CLI option. + try { + items = levn.parse("Object", string) || {}; + + // Some tests say that it should ignore invalid comments such as `/*eslint no-alert:abc*/`. + // Also, commaless notations have invalid severity: + // "no-alert: 2 no-console: 2" --> {"no-alert": "2 no-console: 2"} + // Should ignore that case as well. + if (ConfigOps.isEverySeverityValid(items)) { + return { + success: true, + config: items + }; + } + } catch { + + debug("Levn parsing failed; falling back to manual parsing."); + + // ignore to parse the string by a fallback. + } + + /* + * Optionator cannot parse commaless notations. + * But we are supporting that. So this is a fallback for that. + */ + items = {}; + const normalizedString = string.replace(/([-a-zA-Z0-9/]+):/gu, "\"$1\":").replace(/(\]|[0-9])\s+(?=")/u, "$1,"); + + try { + items = JSON.parse(`{${normalizedString}}`); + } catch (ex) { + debug("Manual parsing failed."); + + return { + success: false, + error: { + ruleId: null, + fatal: true, + severity: 2, + message: `Failed to parse JSON from '${normalizedString}': ${ex.message}`, + line: location.start.line, + column: location.start.column + 1 + } + }; + + } + + return { + success: true, + config: items + }; + } + + /** + * Parses a config of values separated by comma. + * @param {string} string The string to parse. + * @returns {Object} Result map of values and true values + */ + parseListConfig(string) { + debug("Parsing list config"); + + const items = {}; + + // Collapse whitespace around commas + string.replace(/\s*,\s*/gu, ",").split(/,+/u).forEach(name => { + const trimmedName = name.trim(); + + if (trimmedName) { + items[trimmedName] = true; + } + }); + return items; + } + +}; diff --git a/node_modules/eslint/lib/linter/index.js b/node_modules/eslint/lib/linter/index.js new file mode 100644 index 000000000..25fd769bd --- /dev/null +++ b/node_modules/eslint/lib/linter/index.js @@ -0,0 +1,13 @@ +"use strict"; + +const { Linter } = require("./linter"); +const interpolate = require("./interpolate"); +const SourceCodeFixer = require("./source-code-fixer"); + +module.exports = { + Linter, + + // For testers. + SourceCodeFixer, + interpolate +}; diff --git a/node_modules/eslint/lib/linter/interpolate.js b/node_modules/eslint/lib/linter/interpolate.js new file mode 100644 index 000000000..87e06a023 --- /dev/null +++ b/node_modules/eslint/lib/linter/interpolate.js @@ -0,0 +1,28 @@ +/** + * @fileoverview Interpolate keys from an object into a string with {{ }} markers. + * @author Jed Fox + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = (text, data) => { + if (!data) { + return text; + } + + // Substitution content for any {{ }} markers. + return text.replace(/\{\{([^{}]+?)\}\}/gu, (fullMatch, termWithWhitespace) => { + const term = termWithWhitespace.trim(); + + if (term in data) { + return data[term]; + } + + // Preserve old behavior: If parameter name not provided, don't replace it. + return fullMatch; + }); +}; diff --git a/node_modules/eslint/lib/linter/linter.js b/node_modules/eslint/lib/linter/linter.js new file mode 100644 index 000000000..5c1a8d78a --- /dev/null +++ b/node_modules/eslint/lib/linter/linter.js @@ -0,0 +1,1467 @@ +/** + * @fileoverview Main Linter Class + * @author Gyandeep Singh + * @author aladdin-add + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const + path = require("path"), + eslintScope = require("eslint-scope"), + evk = require("eslint-visitor-keys"), + espree = require("espree"), + lodash = require("lodash"), + BuiltInEnvironments = require("@eslint/eslintrc/conf/environments"), + pkg = require("../../package.json"), + astUtils = require("../shared/ast-utils"), + ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops"), + ConfigValidator = require("@eslint/eslintrc/lib/shared/config-validator"), + Traverser = require("../shared/traverser"), + { SourceCode } = require("../source-code"), + CodePathAnalyzer = require("./code-path-analysis/code-path-analyzer"), + applyDisableDirectives = require("./apply-disable-directives"), + ConfigCommentParser = require("./config-comment-parser"), + NodeEventGenerator = require("./node-event-generator"), + createReportTranslator = require("./report-translator"), + Rules = require("./rules"), + createEmitter = require("./safe-emitter"), + SourceCodeFixer = require("./source-code-fixer"), + timing = require("./timing"), + ruleReplacements = require("../../conf/replacements.json"); + +const debug = require("debug")("eslint:linter"); +const MAX_AUTOFIX_PASSES = 10; +const DEFAULT_PARSER_NAME = "espree"; +const commentParser = new ConfigCommentParser(); +const DEFAULT_ERROR_LOC = { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } }; + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** @typedef {InstanceType} ConfigArray */ +/** @typedef {InstanceType} ExtractedConfig */ +/** @typedef {import("../shared/types").ConfigData} ConfigData */ +/** @typedef {import("../shared/types").Environment} Environment */ +/** @typedef {import("../shared/types").GlobalConf} GlobalConf */ +/** @typedef {import("../shared/types").LintMessage} LintMessage */ +/** @typedef {import("../shared/types").ParserOptions} ParserOptions */ +/** @typedef {import("../shared/types").Processor} Processor */ +/** @typedef {import("../shared/types").Rule} Rule */ + +/** + * @template T + * @typedef {{ [P in keyof T]-?: T[P] }} Required + */ + +/** + * @typedef {Object} DisableDirective + * @property {("disable"|"enable"|"disable-line"|"disable-next-line")} type + * @property {number} line + * @property {number} column + * @property {(string|null)} ruleId + */ + +/** + * The private data for `Linter` instance. + * @typedef {Object} LinterInternalSlots + * @property {ConfigArray|null} lastConfigArray The `ConfigArray` instance that the last `verify()` call used. + * @property {SourceCode|null} lastSourceCode The `SourceCode` instance that the last `verify()` call used. + * @property {Map} parserMap The loaded parsers. + * @property {Rules} ruleMap The loaded rules. + */ + +/** + * @typedef {Object} VerifyOptions + * @property {boolean} [allowInlineConfig] Allow/disallow inline comments' ability + * to change config once it is set. Defaults to true if not supplied. + * Useful if you want to validate JS without comments overriding rules. + * @property {boolean} [disableFixes] if `true` then the linter doesn't make `fix` + * properties into the lint result. + * @property {string} [filename] the filename of the source code. + * @property {boolean | "off" | "warn" | "error"} [reportUnusedDisableDirectives] Adds reported errors for + * unused `eslint-disable` directives. + */ + +/** + * @typedef {Object} ProcessorOptions + * @property {(filename:string, text:string) => boolean} [filterCodeBlock] the + * predicate function that selects adopt code blocks. + * @property {Processor["postprocess"]} [postprocess] postprocessor for report + * messages. If provided, this should accept an array of the message lists + * for each code block returned from the preprocessor, apply a mapping to + * the messages as appropriate, and return a one-dimensional array of + * messages. + * @property {Processor["preprocess"]} [preprocess] preprocessor for source text. + * If provided, this should accept a string of source text, and return an + * array of code blocks to lint. + */ + +/** + * @typedef {Object} FixOptions + * @property {boolean | ((message: LintMessage) => boolean)} [fix] Determines + * whether fixes should be applied. + */ + +/** + * @typedef {Object} InternalOptions + * @property {string | null} warnInlineConfig The config name what `noInlineConfig` setting came from. If `noInlineConfig` setting didn't exist, this is null. If this is a config name, then the linter warns directive comments. + * @property {"off" | "warn" | "error"} reportUnusedDisableDirectives (boolean values were normalized) + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Ensures that variables representing built-in properties of the Global Object, + * and any globals declared by special block comments, are present in the global + * scope. + * @param {Scope} globalScope The global scope. + * @param {Object} configGlobals The globals declared in configuration + * @param {{exportedVariables: Object, enabledGlobals: Object}} commentDirectives Directives from comment configuration + * @returns {void} + */ +function addDeclaredGlobals(globalScope, configGlobals, { exportedVariables, enabledGlobals }) { + + // Define configured global variables. + for (const id of new Set([...Object.keys(configGlobals), ...Object.keys(enabledGlobals)])) { + + /* + * `ConfigOps.normalizeConfigGlobal` will throw an error if a configured global value is invalid. However, these errors would + * typically be caught when validating a config anyway (validity for inline global comments is checked separately). + */ + const configValue = configGlobals[id] === void 0 ? void 0 : ConfigOps.normalizeConfigGlobal(configGlobals[id]); + const commentValue = enabledGlobals[id] && enabledGlobals[id].value; + const value = commentValue || configValue; + const sourceComments = enabledGlobals[id] && enabledGlobals[id].comments; + + if (value === "off") { + continue; + } + + let variable = globalScope.set.get(id); + + if (!variable) { + variable = new eslintScope.Variable(id, globalScope); + + globalScope.variables.push(variable); + globalScope.set.set(id, variable); + } + + variable.eslintImplicitGlobalSetting = configValue; + variable.eslintExplicitGlobal = sourceComments !== void 0; + variable.eslintExplicitGlobalComments = sourceComments; + variable.writeable = (value === "writable"); + } + + // mark all exported variables as such + Object.keys(exportedVariables).forEach(name => { + const variable = globalScope.set.get(name); + + if (variable) { + variable.eslintUsed = true; + } + }); + + /* + * "through" contains all references which definitions cannot be found. + * Since we augment the global scope using configuration, we need to update + * references and remove the ones that were added by configuration. + */ + globalScope.through = globalScope.through.filter(reference => { + const name = reference.identifier.name; + const variable = globalScope.set.get(name); + + if (variable) { + + /* + * Links the variable and the reference. + * And this reference is removed from `Scope#through`. + */ + reference.resolved = variable; + variable.references.push(reference); + + return false; + } + + return true; + }); +} + +/** + * creates a missing-rule message. + * @param {string} ruleId the ruleId to create + * @returns {string} created error message + * @private + */ +function createMissingRuleMessage(ruleId) { + return Object.prototype.hasOwnProperty.call(ruleReplacements.rules, ruleId) + ? `Rule '${ruleId}' was removed and replaced by: ${ruleReplacements.rules[ruleId].join(", ")}` + : `Definition for rule '${ruleId}' was not found.`; +} + +/** + * creates a linting problem + * @param {Object} options to create linting error + * @param {string} [options.ruleId] the ruleId to report + * @param {Object} [options.loc] the loc to report + * @param {string} [options.message] the error message to report + * @param {string} [options.severity] the error message to report + * @returns {LintMessage} created problem, returns a missing-rule problem if only provided ruleId. + * @private + */ +function createLintingProblem(options) { + const { + ruleId = null, + loc = DEFAULT_ERROR_LOC, + message = createMissingRuleMessage(options.ruleId), + severity = 2 + } = options; + + return { + ruleId, + message, + line: loc.start.line, + column: loc.start.column + 1, + endLine: loc.end.line, + endColumn: loc.end.column + 1, + severity, + nodeType: null + }; +} + +/** + * Creates a collection of disable directives from a comment + * @param {Object} options to create disable directives + * @param {("disable"|"enable"|"disable-line"|"disable-next-line")} options.type The type of directive comment + * @param {{line: number, column: number}} options.loc The 0-based location of the comment token + * @param {string} options.value The value after the directive in the comment + * comment specified no specific rules, so it applies to all rules (e.g. `eslint-disable`) + * @param {function(string): {create: Function}} options.ruleMapper A map from rule IDs to defined rules + * @returns {Object} Directives and problems from the comment + */ +function createDisableDirectives(options) { + const { type, loc, value, ruleMapper } = options; + const ruleIds = Object.keys(commentParser.parseListConfig(value)); + const directiveRules = ruleIds.length ? ruleIds : [null]; + const result = { + directives: [], // valid disable directives + directiveProblems: [] // problems in directives + }; + + for (const ruleId of directiveRules) { + + // push to directives, if the rule is defined(including null, e.g. /*eslint enable*/) + if (ruleId === null || ruleMapper(ruleId) !== null) { + result.directives.push({ type, line: loc.start.line, column: loc.start.column + 1, ruleId }); + } else { + result.directiveProblems.push(createLintingProblem({ ruleId, loc })); + } + } + return result; +} + +/** + * Remove the ignored part from a given directive comment and trim it. + * @param {string} value The comment text to strip. + * @returns {string} The stripped text. + */ +function stripDirectiveComment(value) { + return value.split(/\s-{2,}\s/u)[0].trim(); +} + +/** + * Parses comments in file to extract file-specific config of rules, globals + * and environments and merges them with global config; also code blocks + * where reporting is disabled or enabled and merges them with reporting config. + * @param {string} filename The file being checked. + * @param {ASTNode} ast The top node of the AST. + * @param {function(string): {create: Function}} ruleMapper A map from rule IDs to defined rules + * @param {string|null} warnInlineConfig If a string then it should warn directive comments as disabled. The string value is the config name what the setting came from. + * @returns {{configuredRules: Object, enabledGlobals: {value:string,comment:Token}[], exportedVariables: Object, problems: Problem[], disableDirectives: DisableDirective[]}} + * A collection of the directive comments that were found, along with any problems that occurred when parsing + */ +function getDirectiveComments(filename, ast, ruleMapper, warnInlineConfig) { + const configuredRules = {}; + const enabledGlobals = Object.create(null); + const exportedVariables = {}; + const problems = []; + const disableDirectives = []; + const validator = new ConfigValidator({ + builtInRules: Rules + }); + + ast.comments.filter(token => token.type !== "Shebang").forEach(comment => { + const trimmedCommentText = stripDirectiveComment(comment.value); + const match = /^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u.exec(trimmedCommentText); + + if (!match) { + return; + } + const directiveText = match[1]; + const lineCommentSupported = /^eslint-disable-(next-)?line$/u.test(directiveText); + + if (comment.type === "Line" && !lineCommentSupported) { + return; + } + + if (warnInlineConfig) { + const kind = comment.type === "Block" ? `/*${directiveText}*/` : `//${directiveText}`; + + problems.push(createLintingProblem({ + ruleId: null, + message: `'${kind}' has no effect because you have 'noInlineConfig' setting in ${warnInlineConfig}.`, + loc: comment.loc, + severity: 1 + })); + return; + } + + if (lineCommentSupported && comment.loc.start.line !== comment.loc.end.line) { + const message = `${directiveText} comment should not span multiple lines.`; + + problems.push(createLintingProblem({ + ruleId: null, + message, + loc: comment.loc + })); + return; + } + + const directiveValue = trimmedCommentText.slice(match.index + directiveText.length); + + switch (directiveText) { + case "eslint-disable": + case "eslint-enable": + case "eslint-disable-next-line": + case "eslint-disable-line": { + const directiveType = directiveText.slice("eslint-".length); + const options = { type: directiveType, loc: comment.loc, value: directiveValue, ruleMapper }; + const { directives, directiveProblems } = createDisableDirectives(options); + + disableDirectives.push(...directives); + problems.push(...directiveProblems); + break; + } + + case "exported": + Object.assign(exportedVariables, commentParser.parseStringConfig(directiveValue, comment)); + break; + + case "globals": + case "global": + for (const [id, { value }] of Object.entries(commentParser.parseStringConfig(directiveValue, comment))) { + let normalizedValue; + + try { + normalizedValue = ConfigOps.normalizeConfigGlobal(value); + } catch (err) { + problems.push(createLintingProblem({ + ruleId: null, + loc: comment.loc, + message: err.message + })); + continue; + } + + if (enabledGlobals[id]) { + enabledGlobals[id].comments.push(comment); + enabledGlobals[id].value = normalizedValue; + } else { + enabledGlobals[id] = { + comments: [comment], + value: normalizedValue + }; + } + } + break; + + case "eslint": { + const parseResult = commentParser.parseJsonConfig(directiveValue, comment.loc); + + if (parseResult.success) { + Object.keys(parseResult.config).forEach(name => { + const rule = ruleMapper(name); + const ruleValue = parseResult.config[name]; + + if (rule === null) { + problems.push(createLintingProblem({ ruleId: name, loc: comment.loc })); + return; + } + + try { + validator.validateRuleOptions(rule, name, ruleValue); + } catch (err) { + problems.push(createLintingProblem({ + ruleId: name, + message: err.message, + loc: comment.loc + })); + + // do not apply the config, if found invalid options. + return; + } + + configuredRules[name] = ruleValue; + }); + } else { + problems.push(parseResult.error); + } + + break; + } + + // no default + } + }); + + return { + configuredRules, + enabledGlobals, + exportedVariables, + problems, + disableDirectives + }; +} + +/** + * Normalize ECMAScript version from the initial config + * @param {number} ecmaVersion ECMAScript version from the initial config + * @returns {number} normalized ECMAScript version + */ +function normalizeEcmaVersion(ecmaVersion) { + + /* + * Calculate ECMAScript edition number from official year version starting with + * ES2015, which corresponds with ES6 (or a difference of 2009). + */ + return ecmaVersion >= 2015 ? ecmaVersion - 2009 : ecmaVersion; +} + +const eslintEnvPattern = /\/\*\s*eslint-env\s(.+?)\*\//gu; + +/** + * Checks whether or not there is a comment which has "eslint-env *" in a given text. + * @param {string} text A source code text to check. + * @returns {Object|null} A result of parseListConfig() with "eslint-env *" comment. + */ +function findEslintEnv(text) { + let match, retv; + + eslintEnvPattern.lastIndex = 0; + + while ((match = eslintEnvPattern.exec(text)) !== null) { + retv = Object.assign( + retv || {}, + commentParser.parseListConfig(stripDirectiveComment(match[1])) + ); + } + + return retv; +} + +/** + * Convert "/path/to/" to "". + * `CLIEngine#executeOnText()` method gives "/path/to/" if the filename + * was omitted because `configArray.extractConfig()` requires an absolute path. + * But the linter should pass `` to `RuleContext#getFilename()` in that + * case. + * Also, code blocks can have their virtual filename. If the parent filename was + * ``, the virtual filename is `/0_foo.js` or something like (i.e., + * it's not an absolute path). + * @param {string} filename The filename to normalize. + * @returns {string} The normalized filename. + */ +function normalizeFilename(filename) { + const parts = filename.split(path.sep); + const index = parts.lastIndexOf(""); + + return index === -1 ? filename : parts.slice(index).join(path.sep); +} + +/** + * Normalizes the possible options for `linter.verify` and `linter.verifyAndFix` to a + * consistent shape. + * @param {VerifyOptions} providedOptions Options + * @param {ConfigData} config Config. + * @returns {Required & InternalOptions} Normalized options + */ +function normalizeVerifyOptions(providedOptions, config) { + const disableInlineConfig = config.noInlineConfig === true; + const ignoreInlineConfig = providedOptions.allowInlineConfig === false; + const configNameOfNoInlineConfig = config.configNameOfNoInlineConfig + ? ` (${config.configNameOfNoInlineConfig})` + : ""; + + let reportUnusedDisableDirectives = providedOptions.reportUnusedDisableDirectives; + + if (typeof reportUnusedDisableDirectives === "boolean") { + reportUnusedDisableDirectives = reportUnusedDisableDirectives ? "error" : "off"; + } + if (typeof reportUnusedDisableDirectives !== "string") { + reportUnusedDisableDirectives = config.reportUnusedDisableDirectives ? "warn" : "off"; + } + + return { + filename: normalizeFilename(providedOptions.filename || ""), + allowInlineConfig: !ignoreInlineConfig, + warnInlineConfig: disableInlineConfig && !ignoreInlineConfig + ? `your config${configNameOfNoInlineConfig}` + : null, + reportUnusedDisableDirectives, + disableFixes: Boolean(providedOptions.disableFixes) + }; +} + +/** + * Combines the provided parserOptions with the options from environments + * @param {string} parserName The parser name which uses this options. + * @param {ParserOptions} providedOptions The provided 'parserOptions' key in a config + * @param {Environment[]} enabledEnvironments The environments enabled in configuration and with inline comments + * @returns {ParserOptions} Resulting parser options after merge + */ +function resolveParserOptions(parserName, providedOptions, enabledEnvironments) { + const parserOptionsFromEnv = enabledEnvironments + .filter(env => env.parserOptions) + .reduce((parserOptions, env) => lodash.merge(parserOptions, env.parserOptions), {}); + const mergedParserOptions = lodash.merge(parserOptionsFromEnv, providedOptions || {}); + const isModule = mergedParserOptions.sourceType === "module"; + + if (isModule) { + + /* + * can't have global return inside of modules + * TODO: espree validate parserOptions.globalReturn when sourceType is setting to module.(@aladdin-add) + */ + mergedParserOptions.ecmaFeatures = Object.assign({}, mergedParserOptions.ecmaFeatures, { globalReturn: false }); + } + + /* + * TODO: @aladdin-add + * 1. for a 3rd-party parser, do not normalize parserOptions + * 2. for espree, no need to do this (espree will do it) + */ + mergedParserOptions.ecmaVersion = normalizeEcmaVersion(mergedParserOptions.ecmaVersion); + + return mergedParserOptions; +} + +/** + * Combines the provided globals object with the globals from environments + * @param {Record} providedGlobals The 'globals' key in a config + * @param {Environment[]} enabledEnvironments The environments enabled in configuration and with inline comments + * @returns {Record} The resolved globals object + */ +function resolveGlobals(providedGlobals, enabledEnvironments) { + return Object.assign( + {}, + ...enabledEnvironments.filter(env => env.globals).map(env => env.globals), + providedGlobals + ); +} + +/** + * Strips Unicode BOM from a given text. + * @param {string} text A text to strip. + * @returns {string} The stripped text. + */ +function stripUnicodeBOM(text) { + + /* + * Check Unicode BOM. + * In JavaScript, string data is stored as UTF-16, so BOM is 0xFEFF. + * http://www.ecma-international.org/ecma-262/6.0/#sec-unicode-format-control-characters + */ + if (text.charCodeAt(0) === 0xFEFF) { + return text.slice(1); + } + return text; +} + +/** + * Get the options for a rule (not including severity), if any + * @param {Array|number} ruleConfig rule configuration + * @returns {Array} of rule options, empty Array if none + */ +function getRuleOptions(ruleConfig) { + if (Array.isArray(ruleConfig)) { + return ruleConfig.slice(1); + } + return []; + +} + +/** + * Analyze scope of the given AST. + * @param {ASTNode} ast The `Program` node to analyze. + * @param {ParserOptions} parserOptions The parser options. + * @param {Record} visitorKeys The visitor keys. + * @returns {ScopeManager} The analysis result. + */ +function analyzeScope(ast, parserOptions, visitorKeys) { + const ecmaFeatures = parserOptions.ecmaFeatures || {}; + const ecmaVersion = parserOptions.ecmaVersion || 5; + + return eslintScope.analyze(ast, { + ignoreEval: true, + nodejsScope: ecmaFeatures.globalReturn, + impliedStrict: ecmaFeatures.impliedStrict, + ecmaVersion, + sourceType: parserOptions.sourceType || "script", + childVisitorKeys: visitorKeys || evk.KEYS, + fallback: Traverser.getKeys + }); +} + +/** + * Parses text into an AST. Moved out here because the try-catch prevents + * optimization of functions, so it's best to keep the try-catch as isolated + * as possible + * @param {string} text The text to parse. + * @param {Parser} parser The parser to parse. + * @param {ParserOptions} providedParserOptions Options to pass to the parser + * @param {string} filePath The path to the file being parsed. + * @returns {{success: false, error: Problem}|{success: true, sourceCode: SourceCode}} + * An object containing the AST and parser services if parsing was successful, or the error if parsing failed + * @private + */ +function parse(text, parser, providedParserOptions, filePath) { + const textToParse = stripUnicodeBOM(text).replace(astUtils.shebangPattern, (match, captured) => `//${captured}`); + const parserOptions = Object.assign({}, providedParserOptions, { + loc: true, + range: true, + raw: true, + tokens: true, + comment: true, + eslintVisitorKeys: true, + eslintScopeManager: true, + filePath + }); + + /* + * Check for parsing errors first. If there's a parsing error, nothing + * else can happen. However, a parsing error does not throw an error + * from this method - it's just considered a fatal error message, a + * problem that ESLint identified just like any other. + */ + try { + const parseResult = (typeof parser.parseForESLint === "function") + ? parser.parseForESLint(textToParse, parserOptions) + : { ast: parser.parse(textToParse, parserOptions) }; + const ast = parseResult.ast; + const parserServices = parseResult.services || {}; + const visitorKeys = parseResult.visitorKeys || evk.KEYS; + const scopeManager = parseResult.scopeManager || analyzeScope(ast, parserOptions, visitorKeys); + + return { + success: true, + + /* + * Save all values that `parseForESLint()` returned. + * If a `SourceCode` object is given as the first parameter instead of source code text, + * linter skips the parsing process and reuses the source code object. + * In that case, linter needs all the values that `parseForESLint()` returned. + */ + sourceCode: new SourceCode({ + text, + ast, + parserServices, + scopeManager, + visitorKeys + }) + }; + } catch (ex) { + + // If the message includes a leading line number, strip it: + const message = `Parsing error: ${ex.message.replace(/^line \d+:/iu, "").trim()}`; + + debug("%s\n%s", message, ex.stack); + + return { + success: false, + error: { + ruleId: null, + fatal: true, + severity: 2, + message, + line: ex.lineNumber, + column: ex.column + } + }; + } +} + +/** + * Gets the scope for the current node + * @param {ScopeManager} scopeManager The scope manager for this AST + * @param {ASTNode} currentNode The node to get the scope of + * @returns {eslint-scope.Scope} The scope information for this node + */ +function getScope(scopeManager, currentNode) { + + // On Program node, get the outermost scope to avoid return Node.js special function scope or ES modules scope. + const inner = currentNode.type !== "Program"; + + for (let node = currentNode; node; node = node.parent) { + const scope = scopeManager.acquire(node, inner); + + if (scope) { + if (scope.type === "function-expression-name") { + return scope.childScopes[0]; + } + return scope; + } + } + + return scopeManager.scopes[0]; +} + +/** + * Marks a variable as used in the current scope + * @param {ScopeManager} scopeManager The scope manager for this AST. The scope may be mutated by this function. + * @param {ASTNode} currentNode The node currently being traversed + * @param {Object} parserOptions The options used to parse this text + * @param {string} name The name of the variable that should be marked as used. + * @returns {boolean} True if the variable was found and marked as used, false if not. + */ +function markVariableAsUsed(scopeManager, currentNode, parserOptions, name) { + const hasGlobalReturn = parserOptions.ecmaFeatures && parserOptions.ecmaFeatures.globalReturn; + const specialScope = hasGlobalReturn || parserOptions.sourceType === "module"; + const currentScope = getScope(scopeManager, currentNode); + + // Special Node.js scope means we need to start one level deeper + const initialScope = currentScope.type === "global" && specialScope ? currentScope.childScopes[0] : currentScope; + + for (let scope = initialScope; scope; scope = scope.upper) { + const variable = scope.variables.find(scopeVar => scopeVar.name === name); + + if (variable) { + variable.eslintUsed = true; + return true; + } + } + + return false; +} + +/** + * Runs a rule, and gets its listeners + * @param {Rule} rule A normalized rule with a `create` method + * @param {Context} ruleContext The context that should be passed to the rule + * @returns {Object} A map of selector listeners provided by the rule + */ +function createRuleListeners(rule, ruleContext) { + try { + return rule.create(ruleContext); + } catch (ex) { + ex.message = `Error while loading rule '${ruleContext.id}': ${ex.message}`; + throw ex; + } +} + +/** + * Gets all the ancestors of a given node + * @param {ASTNode} node The node + * @returns {ASTNode[]} All the ancestor nodes in the AST, not including the provided node, starting + * from the root node and going inwards to the parent node. + */ +function getAncestors(node) { + const ancestorsStartingAtParent = []; + + for (let ancestor = node.parent; ancestor; ancestor = ancestor.parent) { + ancestorsStartingAtParent.push(ancestor); + } + + return ancestorsStartingAtParent.reverse(); +} + +// methods that exist on SourceCode object +const DEPRECATED_SOURCECODE_PASSTHROUGHS = { + getSource: "getText", + getSourceLines: "getLines", + getAllComments: "getAllComments", + getNodeByRangeIndex: "getNodeByRangeIndex", + getComments: "getComments", + getCommentsBefore: "getCommentsBefore", + getCommentsAfter: "getCommentsAfter", + getCommentsInside: "getCommentsInside", + getJSDocComment: "getJSDocComment", + getFirstToken: "getFirstToken", + getFirstTokens: "getFirstTokens", + getLastToken: "getLastToken", + getLastTokens: "getLastTokens", + getTokenAfter: "getTokenAfter", + getTokenBefore: "getTokenBefore", + getTokenByRangeStart: "getTokenByRangeStart", + getTokens: "getTokens", + getTokensAfter: "getTokensAfter", + getTokensBefore: "getTokensBefore", + getTokensBetween: "getTokensBetween" +}; + +const BASE_TRAVERSAL_CONTEXT = Object.freeze( + Object.keys(DEPRECATED_SOURCECODE_PASSTHROUGHS).reduce( + (contextInfo, methodName) => + Object.assign(contextInfo, { + [methodName](...args) { + return this.getSourceCode()[DEPRECATED_SOURCECODE_PASSTHROUGHS[methodName]](...args); + } + }), + {} + ) +); + +/** + * Runs the given rules on the given SourceCode object + * @param {SourceCode} sourceCode A SourceCode object for the given text + * @param {Object} configuredRules The rules configuration + * @param {function(string): Rule} ruleMapper A mapper function from rule names to rules + * @param {Object} parserOptions The options that were passed to the parser + * @param {string} parserName The name of the parser in the config + * @param {Object} settings The settings that were enabled in the config + * @param {string} filename The reported filename of the code + * @param {boolean} disableFixes If true, it doesn't make `fix` properties. + * @param {string | undefined} cwd cwd of the cli + * @returns {Problem[]} An array of reported problems + */ +function runRules(sourceCode, configuredRules, ruleMapper, parserOptions, parserName, settings, filename, disableFixes, cwd) { + const emitter = createEmitter(); + const nodeQueue = []; + let currentNode = sourceCode.ast; + + Traverser.traverse(sourceCode.ast, { + enter(node, parent) { + node.parent = parent; + nodeQueue.push({ isEntering: true, node }); + }, + leave(node) { + nodeQueue.push({ isEntering: false, node }); + }, + visitorKeys: sourceCode.visitorKeys + }); + + /* + * Create a frozen object with the ruleContext properties and methods that are shared by all rules. + * All rule contexts will inherit from this object. This avoids the performance penalty of copying all the + * properties once for each rule. + */ + const sharedTraversalContext = Object.freeze( + Object.assign( + Object.create(BASE_TRAVERSAL_CONTEXT), + { + getAncestors: () => getAncestors(currentNode), + getDeclaredVariables: sourceCode.scopeManager.getDeclaredVariables.bind(sourceCode.scopeManager), + getCwd: () => cwd, + getFilename: () => filename, + getScope: () => getScope(sourceCode.scopeManager, currentNode), + getSourceCode: () => sourceCode, + markVariableAsUsed: name => markVariableAsUsed(sourceCode.scopeManager, currentNode, parserOptions, name), + parserOptions, + parserPath: parserName, + parserServices: sourceCode.parserServices, + settings + } + ) + ); + + + const lintingProblems = []; + + Object.keys(configuredRules).forEach(ruleId => { + const severity = ConfigOps.getRuleSeverity(configuredRules[ruleId]); + + // not load disabled rules + if (severity === 0) { + return; + } + + const rule = ruleMapper(ruleId); + + if (rule === null) { + lintingProblems.push(createLintingProblem({ ruleId })); + return; + } + + const messageIds = rule.meta && rule.meta.messages; + let reportTranslator = null; + const ruleContext = Object.freeze( + Object.assign( + Object.create(sharedTraversalContext), + { + id: ruleId, + options: getRuleOptions(configuredRules[ruleId]), + report(...args) { + + /* + * Create a report translator lazily. + * In a vast majority of cases, any given rule reports zero errors on a given + * piece of code. Creating a translator lazily avoids the performance cost of + * creating a new translator function for each rule that usually doesn't get + * called. + * + * Using lazy report translators improves end-to-end performance by about 3% + * with Node 8.4.0. + */ + if (reportTranslator === null) { + reportTranslator = createReportTranslator({ + ruleId, + severity, + sourceCode, + messageIds, + disableFixes + }); + } + const problem = reportTranslator(...args); + + if (problem.fix && rule.meta && !rule.meta.fixable) { + throw new Error("Fixable rules should export a `meta.fixable` property."); + } + lintingProblems.push(problem); + } + } + ) + ); + + const ruleListeners = createRuleListeners(rule, ruleContext); + + // add all the selectors from the rule as listeners + Object.keys(ruleListeners).forEach(selector => { + emitter.on( + selector, + timing.enabled + ? timing.time(ruleId, ruleListeners[selector]) + : ruleListeners[selector] + ); + }); + }); + + // only run code path analyzer if the top level node is "Program", skip otherwise + const eventGenerator = nodeQueue[0].node.type === "Program" ? new CodePathAnalyzer(new NodeEventGenerator(emitter)) : new NodeEventGenerator(emitter); + + nodeQueue.forEach(traversalInfo => { + currentNode = traversalInfo.node; + + try { + if (traversalInfo.isEntering) { + eventGenerator.enterNode(currentNode); + } else { + eventGenerator.leaveNode(currentNode); + } + } catch (err) { + err.currentNode = currentNode; + throw err; + } + }); + + return lintingProblems; +} + +/** + * Ensure the source code to be a string. + * @param {string|SourceCode} textOrSourceCode The text or source code object. + * @returns {string} The source code text. + */ +function ensureText(textOrSourceCode) { + if (typeof textOrSourceCode === "object") { + const { hasBOM, text } = textOrSourceCode; + const bom = hasBOM ? "\uFEFF" : ""; + + return bom + text; + } + + return String(textOrSourceCode); +} + +/** + * Get an environment. + * @param {LinterInternalSlots} slots The internal slots of Linter. + * @param {string} envId The environment ID to get. + * @returns {Environment|null} The environment. + */ +function getEnv(slots, envId) { + return ( + (slots.lastConfigArray && slots.lastConfigArray.pluginEnvironments.get(envId)) || + BuiltInEnvironments.get(envId) || + null + ); +} + +/** + * Get a rule. + * @param {LinterInternalSlots} slots The internal slots of Linter. + * @param {string} ruleId The rule ID to get. + * @returns {Rule|null} The rule. + */ +function getRule(slots, ruleId) { + return ( + (slots.lastConfigArray && slots.lastConfigArray.pluginRules.get(ruleId)) || + slots.ruleMap.get(ruleId) + ); +} + +/** + * Normalize the value of the cwd + * @param {string | undefined} cwd raw value of the cwd, path to a directory that should be considered as the current working directory, can be undefined. + * @returns {string | undefined} normalized cwd + */ +function normalizeCwd(cwd) { + if (cwd) { + return cwd; + } + if (typeof process === "object") { + return process.cwd(); + } + + // It's more explicit to assign the undefined + // eslint-disable-next-line no-undefined + return undefined; +} + +/** + * The map to store private data. + * @type {WeakMap} + */ +const internalSlotsMap = new WeakMap(); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Object that is responsible for verifying JavaScript text + * @name eslint + */ +class Linter { + + /** + * Initialize the Linter. + * @param {Object} [config] the config object + * @param {string} [config.cwd] path to a directory that should be considered as the current working directory, can be undefined. + */ + constructor({ cwd } = {}) { + internalSlotsMap.set(this, { + cwd: normalizeCwd(cwd), + lastConfigArray: null, + lastSourceCode: null, + parserMap: new Map([["espree", espree]]), + ruleMap: new Rules() + }); + + this.version = pkg.version; + } + + /** + * Getter for package version. + * @static + * @returns {string} The version from package.json. + */ + static get version() { + return pkg.version; + } + + /** + * Same as linter.verify, except without support for processors. + * @param {string|SourceCode} textOrSourceCode The text to parse or a SourceCode object. + * @param {ConfigData} providedConfig An ESLintConfig instance to configure everything. + * @param {VerifyOptions} [providedOptions] The optional filename of the file being checked. + * @returns {LintMessage[]} The results as an array of messages or an empty array if no messages. + */ + _verifyWithoutProcessors(textOrSourceCode, providedConfig, providedOptions) { + const slots = internalSlotsMap.get(this); + const config = providedConfig || {}; + const options = normalizeVerifyOptions(providedOptions, config); + let text; + + // evaluate arguments + if (typeof textOrSourceCode === "string") { + slots.lastSourceCode = null; + text = textOrSourceCode; + } else { + slots.lastSourceCode = textOrSourceCode; + text = textOrSourceCode.text; + } + + // Resolve parser. + let parserName = DEFAULT_PARSER_NAME; + let parser = espree; + + if (typeof config.parser === "object" && config.parser !== null) { + parserName = config.parser.filePath; + parser = config.parser.definition; + } else if (typeof config.parser === "string") { + if (!slots.parserMap.has(config.parser)) { + return [{ + ruleId: null, + fatal: true, + severity: 2, + message: `Configured parser '${config.parser}' was not found.`, + line: 0, + column: 0 + }]; + } + parserName = config.parser; + parser = slots.parserMap.get(config.parser); + } + + // search and apply "eslint-env *". + const envInFile = options.allowInlineConfig && !options.warnInlineConfig + ? findEslintEnv(text) + : {}; + const resolvedEnvConfig = Object.assign({ builtin: true }, config.env, envInFile); + const enabledEnvs = Object.keys(resolvedEnvConfig) + .filter(envName => resolvedEnvConfig[envName]) + .map(envName => getEnv(slots, envName)) + .filter(env => env); + + const parserOptions = resolveParserOptions(parserName, config.parserOptions || {}, enabledEnvs); + const configuredGlobals = resolveGlobals(config.globals || {}, enabledEnvs); + const settings = config.settings || {}; + + if (!slots.lastSourceCode) { + const parseResult = parse( + text, + parser, + parserOptions, + options.filename + ); + + if (!parseResult.success) { + return [parseResult.error]; + } + + slots.lastSourceCode = parseResult.sourceCode; + } else { + + /* + * If the given source code object as the first argument does not have scopeManager, analyze the scope. + * This is for backward compatibility (SourceCode is frozen so it cannot rebind). + */ + if (!slots.lastSourceCode.scopeManager) { + slots.lastSourceCode = new SourceCode({ + text: slots.lastSourceCode.text, + ast: slots.lastSourceCode.ast, + parserServices: slots.lastSourceCode.parserServices, + visitorKeys: slots.lastSourceCode.visitorKeys, + scopeManager: analyzeScope(slots.lastSourceCode.ast, parserOptions) + }); + } + } + + const sourceCode = slots.lastSourceCode; + const commentDirectives = options.allowInlineConfig + ? getDirectiveComments(options.filename, sourceCode.ast, ruleId => getRule(slots, ruleId), options.warnInlineConfig) + : { configuredRules: {}, enabledGlobals: {}, exportedVariables: {}, problems: [], disableDirectives: [] }; + + // augment global scope with declared global variables + addDeclaredGlobals( + sourceCode.scopeManager.scopes[0], + configuredGlobals, + { exportedVariables: commentDirectives.exportedVariables, enabledGlobals: commentDirectives.enabledGlobals } + ); + + const configuredRules = Object.assign({}, config.rules, commentDirectives.configuredRules); + + let lintingProblems; + + try { + lintingProblems = runRules( + sourceCode, + configuredRules, + ruleId => getRule(slots, ruleId), + parserOptions, + parserName, + settings, + options.filename, + options.disableFixes, + slots.cwd + ); + } catch (err) { + err.message += `\nOccurred while linting ${options.filename}`; + debug("An error occurred while traversing"); + debug("Filename:", options.filename); + if (err.currentNode) { + const { line } = err.currentNode.loc.start; + + debug("Line:", line); + err.message += `:${line}`; + } + debug("Parser Options:", parserOptions); + debug("Parser Path:", parserName); + debug("Settings:", settings); + throw err; + } + + return applyDisableDirectives({ + directives: commentDirectives.disableDirectives, + problems: lintingProblems + .concat(commentDirectives.problems) + .sort((problemA, problemB) => problemA.line - problemB.line || problemA.column - problemB.column), + reportUnusedDisableDirectives: options.reportUnusedDisableDirectives + }); + } + + /** + * Verifies the text against the rules specified by the second argument. + * @param {string|SourceCode} textOrSourceCode The text to parse or a SourceCode object. + * @param {ConfigData|ConfigArray} config An ESLintConfig instance to configure everything. + * @param {(string|(VerifyOptions&ProcessorOptions))} [filenameOrOptions] The optional filename of the file being checked. + * If this is not set, the filename will default to '' in the rule context. If + * an object, then it has "filename", "allowInlineConfig", and some properties. + * @returns {LintMessage[]} The results as an array of messages or an empty array if no messages. + */ + verify(textOrSourceCode, config, filenameOrOptions) { + debug("Verify"); + const options = typeof filenameOrOptions === "string" + ? { filename: filenameOrOptions } + : filenameOrOptions || {}; + + // CLIEngine passes a `ConfigArray` object. + if (config && typeof config.extractConfig === "function") { + return this._verifyWithConfigArray(textOrSourceCode, config, options); + } + + /* + * `Linter` doesn't support `overrides` property in configuration. + * So we cannot apply multiple processors. + */ + if (options.preprocess || options.postprocess) { + return this._verifyWithProcessor(textOrSourceCode, config, options); + } + return this._verifyWithoutProcessors(textOrSourceCode, config, options); + } + + /** + * Verify a given code with `ConfigArray`. + * @param {string|SourceCode} textOrSourceCode The source code. + * @param {ConfigArray} configArray The config array. + * @param {VerifyOptions&ProcessorOptions} options The options. + * @returns {LintMessage[]} The found problems. + */ + _verifyWithConfigArray(textOrSourceCode, configArray, options) { + debug("With ConfigArray: %s", options.filename); + + // Store the config array in order to get plugin envs and rules later. + internalSlotsMap.get(this).lastConfigArray = configArray; + + // Extract the final config for this file. + const config = configArray.extractConfig(options.filename); + const processor = + config.processor && + configArray.pluginProcessors.get(config.processor); + + // Verify. + if (processor) { + debug("Apply the processor: %o", config.processor); + const { preprocess, postprocess, supportsAutofix } = processor; + const disableFixes = options.disableFixes || !supportsAutofix; + + return this._verifyWithProcessor( + textOrSourceCode, + config, + { ...options, disableFixes, postprocess, preprocess }, + configArray + ); + } + return this._verifyWithoutProcessors(textOrSourceCode, config, options); + } + + /** + * Verify with a processor. + * @param {string|SourceCode} textOrSourceCode The source code. + * @param {ConfigData|ExtractedConfig} config The config array. + * @param {VerifyOptions&ProcessorOptions} options The options. + * @param {ConfigArray} [configForRecursive] The `ConfigArray` object to apply multiple processors recursively. + * @returns {LintMessage[]} The found problems. + */ + _verifyWithProcessor(textOrSourceCode, config, options, configForRecursive) { + const filename = options.filename || ""; + const filenameToExpose = normalizeFilename(filename); + const text = ensureText(textOrSourceCode); + const preprocess = options.preprocess || (rawText => [rawText]); + const postprocess = options.postprocess || lodash.flatten; + const filterCodeBlock = + options.filterCodeBlock || + (blockFilename => blockFilename.endsWith(".js")); + const originalExtname = path.extname(filename); + const messageLists = preprocess(text, filenameToExpose).map((block, i) => { + debug("A code block was found: %o", block.filename || "(unnamed)"); + + // Keep the legacy behavior. + if (typeof block === "string") { + return this._verifyWithoutProcessors(block, config, options); + } + + const blockText = block.text; + const blockName = path.join(filename, `${i}_${block.filename}`); + + // Skip this block if filtered. + if (!filterCodeBlock(blockName, blockText)) { + debug("This code block was skipped."); + return []; + } + + // Resolve configuration again if the file extension was changed. + if (configForRecursive && path.extname(blockName) !== originalExtname) { + debug("Resolving configuration again because the file extension was changed."); + return this._verifyWithConfigArray( + blockText, + configForRecursive, + { ...options, filename: blockName } + ); + } + + // Does lint. + return this._verifyWithoutProcessors( + blockText, + config, + { ...options, filename: blockName } + ); + }); + + return postprocess(messageLists, filenameToExpose); + } + + /** + * Gets the SourceCode object representing the parsed source. + * @returns {SourceCode} The SourceCode object. + */ + getSourceCode() { + return internalSlotsMap.get(this).lastSourceCode; + } + + /** + * Defines a new linting rule. + * @param {string} ruleId A unique rule identifier + * @param {Function | Rule} ruleModule Function from context to object mapping AST node types to event handlers + * @returns {void} + */ + defineRule(ruleId, ruleModule) { + internalSlotsMap.get(this).ruleMap.define(ruleId, ruleModule); + } + + /** + * Defines many new linting rules. + * @param {Record} rulesToDefine map from unique rule identifier to rule + * @returns {void} + */ + defineRules(rulesToDefine) { + Object.getOwnPropertyNames(rulesToDefine).forEach(ruleId => { + this.defineRule(ruleId, rulesToDefine[ruleId]); + }); + } + + /** + * Gets an object with all loaded rules. + * @returns {Map} All loaded rules + */ + getRules() { + const { lastConfigArray, ruleMap } = internalSlotsMap.get(this); + + return new Map(function *() { + yield* ruleMap; + + if (lastConfigArray) { + yield* lastConfigArray.pluginRules; + } + }()); + } + + /** + * Define a new parser module + * @param {string} parserId Name of the parser + * @param {Parser} parserModule The parser object + * @returns {void} + */ + defineParser(parserId, parserModule) { + internalSlotsMap.get(this).parserMap.set(parserId, parserModule); + } + + /** + * Performs multiple autofix passes over the text until as many fixes as possible + * have been applied. + * @param {string} text The source text to apply fixes to. + * @param {ConfigData|ConfigArray} config The ESLint config object to use. + * @param {VerifyOptions&ProcessorOptions&FixOptions} options The ESLint options object to use. + * @returns {{fixed:boolean,messages:LintMessage[],output:string}} The result of the fix operation as returned from the + * SourceCodeFixer. + */ + verifyAndFix(text, config, options) { + let messages = [], + fixedResult, + fixed = false, + passNumber = 0, + currentText = text; + const debugTextDescription = options && options.filename || `${text.slice(0, 10)}...`; + const shouldFix = options && typeof options.fix !== "undefined" ? options.fix : true; + + /** + * This loop continues until one of the following is true: + * + * 1. No more fixes have been applied. + * 2. Ten passes have been made. + * + * That means anytime a fix is successfully applied, there will be another pass. + * Essentially, guaranteeing a minimum of two passes. + */ + do { + passNumber++; + + debug(`Linting code for ${debugTextDescription} (pass ${passNumber})`); + messages = this.verify(currentText, config, options); + + debug(`Generating fixed text for ${debugTextDescription} (pass ${passNumber})`); + fixedResult = SourceCodeFixer.applyFixes(currentText, messages, shouldFix); + + /* + * stop if there are any syntax errors. + * 'fixedResult.output' is a empty string. + */ + if (messages.length === 1 && messages[0].fatal) { + break; + } + + // keep track if any fixes were ever applied - important for return value + fixed = fixed || fixedResult.fixed; + + // update to use the fixed output instead of the original text + currentText = fixedResult.output; + + } while ( + fixedResult.fixed && + passNumber < MAX_AUTOFIX_PASSES + ); + + /* + * If the last result had fixes, we need to lint again to be sure we have + * the most up-to-date information. + */ + if (fixedResult.fixed) { + fixedResult.messages = this.verify(currentText, config, options); + } + + // ensure the last result properly reflects if fixes were done + fixedResult.fixed = fixed; + fixedResult.output = currentText; + + return fixedResult; + } +} + +module.exports = { + Linter, + + /** + * Get the internal slots of a given Linter instance for tests. + * @param {Linter} instance The Linter instance to get. + * @returns {LinterInternalSlots} The internal slots. + */ + getLinterInternalSlots(instance) { + return internalSlotsMap.get(instance); + } +}; diff --git a/node_modules/eslint/lib/linter/node-event-generator.js b/node_modules/eslint/lib/linter/node-event-generator.js new file mode 100644 index 000000000..6f3b25139 --- /dev/null +++ b/node_modules/eslint/lib/linter/node-event-generator.js @@ -0,0 +1,311 @@ +/** + * @fileoverview The event generator for AST nodes. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const esquery = require("esquery"); +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * An object describing an AST selector + * @typedef {Object} ASTSelector + * @property {string} rawSelector The string that was parsed into this selector + * @property {boolean} isExit `true` if this should be emitted when exiting the node rather than when entering + * @property {Object} parsedSelector An object (from esquery) describing the matching behavior of the selector + * @property {string[]|null} listenerTypes A list of node types that could possibly cause the selector to match, + * or `null` if all node types could cause a match + * @property {number} attributeCount The total number of classes, pseudo-classes, and attribute queries in this selector + * @property {number} identifierCount The total number of identifier queries in this selector + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets the possible types of a selector + * @param {Object} parsedSelector An object (from esquery) describing the matching behavior of the selector + * @returns {string[]|null} The node types that could possibly trigger this selector, or `null` if all node types could trigger it + */ +function getPossibleTypes(parsedSelector) { + switch (parsedSelector.type) { + case "identifier": + return [parsedSelector.value]; + + case "matches": { + const typesForComponents = parsedSelector.selectors.map(getPossibleTypes); + + if (typesForComponents.every(Boolean)) { + return lodash.union(...typesForComponents); + } + return null; + } + + case "compound": { + const typesForComponents = parsedSelector.selectors.map(getPossibleTypes).filter(typesForComponent => typesForComponent); + + // If all of the components could match any type, then the compound could also match any type. + if (!typesForComponents.length) { + return null; + } + + /* + * If at least one of the components could only match a particular type, the compound could only match + * the intersection of those types. + */ + return lodash.intersection(...typesForComponents); + } + + case "child": + case "descendant": + case "sibling": + case "adjacent": + return getPossibleTypes(parsedSelector.right); + + default: + return null; + + } +} + +/** + * Counts the number of class, pseudo-class, and attribute queries in this selector + * @param {Object} parsedSelector An object (from esquery) describing the selector's matching behavior + * @returns {number} The number of class, pseudo-class, and attribute queries in this selector + */ +function countClassAttributes(parsedSelector) { + switch (parsedSelector.type) { + case "child": + case "descendant": + case "sibling": + case "adjacent": + return countClassAttributes(parsedSelector.left) + countClassAttributes(parsedSelector.right); + + case "compound": + case "not": + case "matches": + return parsedSelector.selectors.reduce((sum, childSelector) => sum + countClassAttributes(childSelector), 0); + + case "attribute": + case "field": + case "nth-child": + case "nth-last-child": + return 1; + + default: + return 0; + } +} + +/** + * Counts the number of identifier queries in this selector + * @param {Object} parsedSelector An object (from esquery) describing the selector's matching behavior + * @returns {number} The number of identifier queries + */ +function countIdentifiers(parsedSelector) { + switch (parsedSelector.type) { + case "child": + case "descendant": + case "sibling": + case "adjacent": + return countIdentifiers(parsedSelector.left) + countIdentifiers(parsedSelector.right); + + case "compound": + case "not": + case "matches": + return parsedSelector.selectors.reduce((sum, childSelector) => sum + countIdentifiers(childSelector), 0); + + case "identifier": + return 1; + + default: + return 0; + } +} + +/** + * Compares the specificity of two selector objects, with CSS-like rules. + * @param {ASTSelector} selectorA An AST selector descriptor + * @param {ASTSelector} selectorB Another AST selector descriptor + * @returns {number} + * a value less than 0 if selectorA is less specific than selectorB + * a value greater than 0 if selectorA is more specific than selectorB + * a value less than 0 if selectorA and selectorB have the same specificity, and selectorA <= selectorB alphabetically + * a value greater than 0 if selectorA and selectorB have the same specificity, and selectorA > selectorB alphabetically + */ +function compareSpecificity(selectorA, selectorB) { + return selectorA.attributeCount - selectorB.attributeCount || + selectorA.identifierCount - selectorB.identifierCount || + (selectorA.rawSelector <= selectorB.rawSelector ? -1 : 1); +} + +/** + * Parses a raw selector string, and throws a useful error if parsing fails. + * @param {string} rawSelector A raw AST selector + * @returns {Object} An object (from esquery) describing the matching behavior of this selector + * @throws {Error} An error if the selector is invalid + */ +function tryParseSelector(rawSelector) { + try { + return esquery.parse(rawSelector.replace(/:exit$/u, "")); + } catch (err) { + if (err.location && err.location.start && typeof err.location.start.offset === "number") { + throw new SyntaxError(`Syntax error in selector "${rawSelector}" at position ${err.location.start.offset}: ${err.message}`); + } + throw err; + } +} + +/** + * Parses a raw selector string, and returns the parsed selector along with specificity and type information. + * @param {string} rawSelector A raw AST selector + * @returns {ASTSelector} A selector descriptor + */ +const parseSelector = lodash.memoize(rawSelector => { + const parsedSelector = tryParseSelector(rawSelector); + + return { + rawSelector, + isExit: rawSelector.endsWith(":exit"), + parsedSelector, + listenerTypes: getPossibleTypes(parsedSelector), + attributeCount: countClassAttributes(parsedSelector), + identifierCount: countIdentifiers(parsedSelector) + }; +}); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * The event generator for AST nodes. + * This implements below interface. + * + * ```ts + * interface EventGenerator { + * emitter: SafeEmitter; + * enterNode(node: ASTNode): void; + * leaveNode(node: ASTNode): void; + * } + * ``` + */ +class NodeEventGenerator { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {SafeEmitter} emitter + * An SafeEmitter which is the destination of events. This emitter must already + * have registered listeners for all of the events that it needs to listen for. + * (See lib/linter/safe-emitter.js for more details on `SafeEmitter`.) + * @returns {NodeEventGenerator} new instance + */ + constructor(emitter) { + this.emitter = emitter; + this.currentAncestry = []; + this.enterSelectorsByNodeType = new Map(); + this.exitSelectorsByNodeType = new Map(); + this.anyTypeEnterSelectors = []; + this.anyTypeExitSelectors = []; + + emitter.eventNames().forEach(rawSelector => { + const selector = parseSelector(rawSelector); + + if (selector.listenerTypes) { + const typeMap = selector.isExit ? this.exitSelectorsByNodeType : this.enterSelectorsByNodeType; + + selector.listenerTypes.forEach(nodeType => { + if (!typeMap.has(nodeType)) { + typeMap.set(nodeType, []); + } + typeMap.get(nodeType).push(selector); + }); + return; + } + const selectors = selector.isExit ? this.anyTypeExitSelectors : this.anyTypeEnterSelectors; + + selectors.push(selector); + }); + + this.anyTypeEnterSelectors.sort(compareSpecificity); + this.anyTypeExitSelectors.sort(compareSpecificity); + this.enterSelectorsByNodeType.forEach(selectorList => selectorList.sort(compareSpecificity)); + this.exitSelectorsByNodeType.forEach(selectorList => selectorList.sort(compareSpecificity)); + } + + /** + * Checks a selector against a node, and emits it if it matches + * @param {ASTNode} node The node to check + * @param {ASTSelector} selector An AST selector descriptor + * @returns {void} + */ + applySelector(node, selector) { + if (esquery.matches(node, selector.parsedSelector, this.currentAncestry)) { + this.emitter.emit(selector.rawSelector, node); + } + } + + /** + * Applies all appropriate selectors to a node, in specificity order + * @param {ASTNode} node The node to check + * @param {boolean} isExit `false` if the node is currently being entered, `true` if it's currently being exited + * @returns {void} + */ + applySelectors(node, isExit) { + const selectorsByNodeType = (isExit ? this.exitSelectorsByNodeType : this.enterSelectorsByNodeType).get(node.type) || []; + const anyTypeSelectors = isExit ? this.anyTypeExitSelectors : this.anyTypeEnterSelectors; + + /* + * selectorsByNodeType and anyTypeSelectors were already sorted by specificity in the constructor. + * Iterate through each of them, applying selectors in the right order. + */ + let selectorsByTypeIndex = 0; + let anyTypeSelectorsIndex = 0; + + while (selectorsByTypeIndex < selectorsByNodeType.length || anyTypeSelectorsIndex < anyTypeSelectors.length) { + if ( + selectorsByTypeIndex >= selectorsByNodeType.length || + anyTypeSelectorsIndex < anyTypeSelectors.length && + compareSpecificity(anyTypeSelectors[anyTypeSelectorsIndex], selectorsByNodeType[selectorsByTypeIndex]) < 0 + ) { + this.applySelector(node, anyTypeSelectors[anyTypeSelectorsIndex++]); + } else { + this.applySelector(node, selectorsByNodeType[selectorsByTypeIndex++]); + } + } + } + + /** + * Emits an event of entering AST node. + * @param {ASTNode} node A node which was entered. + * @returns {void} + */ + enterNode(node) { + if (node.parent) { + this.currentAncestry.unshift(node.parent); + } + this.applySelectors(node, false); + } + + /** + * Emits an event of leaving AST node. + * @param {ASTNode} node A node which was left. + * @returns {void} + */ + leaveNode(node) { + this.applySelectors(node, true); + this.currentAncestry.shift(); + } +} + +module.exports = NodeEventGenerator; diff --git a/node_modules/eslint/lib/linter/report-translator.js b/node_modules/eslint/lib/linter/report-translator.js new file mode 100644 index 000000000..eef516558 --- /dev/null +++ b/node_modules/eslint/lib/linter/report-translator.js @@ -0,0 +1,347 @@ +/** + * @fileoverview A helper that translates context.report() calls from the rule API into generic problem objects + * @author Teddy Katz + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const assert = require("assert"); +const ruleFixer = require("./rule-fixer"); +const interpolate = require("./interpolate"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * An error message description + * @typedef {Object} MessageDescriptor + * @property {ASTNode} [node] The reported node + * @property {Location} loc The location of the problem. + * @property {string} message The problem message. + * @property {Object} [data] Optional data to use to fill in placeholders in the + * message. + * @property {Function} [fix] The function to call that creates a fix command. + * @property {Array<{desc?: string, messageId?: string, fix: Function}>} suggest Suggestion descriptions and functions to create a the associated fixes. + */ + +/** + * Information about the report + * @typedef {Object} ReportInfo + * @property {string} ruleId + * @property {(0|1|2)} severity + * @property {(string|undefined)} message + * @property {(string|undefined)} [messageId] + * @property {number} line + * @property {number} column + * @property {(number|undefined)} [endLine] + * @property {(number|undefined)} [endColumn] + * @property {(string|null)} nodeType + * @property {string} source + * @property {({text: string, range: (number[]|null)}|null)} [fix] + * @property {Array<{text: string, range: (number[]|null)}|null>} [suggestions] + */ + +//------------------------------------------------------------------------------ +// Module Definition +//------------------------------------------------------------------------------ + + +/** + * Translates a multi-argument context.report() call into a single object argument call + * @param {...*} args A list of arguments passed to `context.report` + * @returns {MessageDescriptor} A normalized object containing report information + */ +function normalizeMultiArgReportCall(...args) { + + // If there is one argument, it is considered to be a new-style call already. + if (args.length === 1) { + + // Shallow clone the object to avoid surprises if reusing the descriptor + return Object.assign({}, args[0]); + } + + // If the second argument is a string, the arguments are interpreted as [node, message, data, fix]. + if (typeof args[1] === "string") { + return { + node: args[0], + message: args[1], + data: args[2], + fix: args[3] + }; + } + + // Otherwise, the arguments are interpreted as [node, loc, message, data, fix]. + return { + node: args[0], + loc: args[1], + message: args[2], + data: args[3], + fix: args[4] + }; +} + +/** + * Asserts that either a loc or a node was provided, and the node is valid if it was provided. + * @param {MessageDescriptor} descriptor A descriptor to validate + * @returns {void} + * @throws AssertionError if neither a node nor a loc was provided, or if the node is not an object + */ +function assertValidNodeInfo(descriptor) { + if (descriptor.node) { + assert(typeof descriptor.node === "object", "Node must be an object"); + } else { + assert(descriptor.loc, "Node must be provided when reporting error if location is not provided"); + } +} + +/** + * Normalizes a MessageDescriptor to always have a `loc` with `start` and `end` properties + * @param {MessageDescriptor} descriptor A descriptor for the report from a rule. + * @returns {{start: Location, end: (Location|null)}} An updated location that infers the `start` and `end` properties + * from the `node` of the original descriptor, or infers the `start` from the `loc` of the original descriptor. + */ +function normalizeReportLoc(descriptor) { + if (descriptor.loc) { + if (descriptor.loc.start) { + return descriptor.loc; + } + return { start: descriptor.loc, end: null }; + } + return descriptor.node.loc; +} + +/** + * Compares items in a fixes array by range. + * @param {Fix} a The first message. + * @param {Fix} b The second message. + * @returns {int} -1 if a comes before b, 1 if a comes after b, 0 if equal. + * @private + */ +function compareFixesByRange(a, b) { + return a.range[0] - b.range[0] || a.range[1] - b.range[1]; +} + +/** + * Merges the given fixes array into one. + * @param {Fix[]} fixes The fixes to merge. + * @param {SourceCode} sourceCode The source code object to get the text between fixes. + * @returns {{text: string, range: number[]}} The merged fixes + */ +function mergeFixes(fixes, sourceCode) { + if (fixes.length === 0) { + return null; + } + if (fixes.length === 1) { + return fixes[0]; + } + + fixes.sort(compareFixesByRange); + + const originalText = sourceCode.text; + const start = fixes[0].range[0]; + const end = fixes[fixes.length - 1].range[1]; + let text = ""; + let lastPos = Number.MIN_SAFE_INTEGER; + + for (const fix of fixes) { + assert(fix.range[0] >= lastPos, "Fix objects must not be overlapped in a report."); + + if (fix.range[0] >= 0) { + text += originalText.slice(Math.max(0, start, lastPos), fix.range[0]); + } + text += fix.text; + lastPos = fix.range[1]; + } + text += originalText.slice(Math.max(0, start, lastPos), end); + + return { range: [start, end], text }; +} + +/** + * Gets one fix object from the given descriptor. + * If the descriptor retrieves multiple fixes, this merges those to one. + * @param {MessageDescriptor} descriptor The report descriptor. + * @param {SourceCode} sourceCode The source code object to get text between fixes. + * @returns {({text: string, range: number[]}|null)} The fix for the descriptor + */ +function normalizeFixes(descriptor, sourceCode) { + if (typeof descriptor.fix !== "function") { + return null; + } + + // @type {null | Fix | Fix[] | IterableIterator} + const fix = descriptor.fix(ruleFixer); + + // Merge to one. + if (fix && Symbol.iterator in fix) { + return mergeFixes(Array.from(fix), sourceCode); + } + return fix; +} + +/** + * Gets an array of suggestion objects from the given descriptor. + * @param {MessageDescriptor} descriptor The report descriptor. + * @param {SourceCode} sourceCode The source code object to get text between fixes. + * @param {Object} messages Object of meta messages for the rule. + * @returns {Array} The suggestions for the descriptor + */ +function mapSuggestions(descriptor, sourceCode, messages) { + if (!descriptor.suggest || !Array.isArray(descriptor.suggest)) { + return []; + } + + return descriptor.suggest.map(suggestInfo => { + const computedDesc = suggestInfo.desc || messages[suggestInfo.messageId]; + + return { + ...suggestInfo, + desc: interpolate(computedDesc, suggestInfo.data), + fix: normalizeFixes(suggestInfo, sourceCode) + }; + }); +} + +/** + * Creates information about the report from a descriptor + * @param {Object} options Information about the problem + * @param {string} options.ruleId Rule ID + * @param {(0|1|2)} options.severity Rule severity + * @param {(ASTNode|null)} options.node Node + * @param {string} options.message Error message + * @param {string} [options.messageId] The error message ID. + * @param {{start: SourceLocation, end: (SourceLocation|null)}} options.loc Start and end location + * @param {{text: string, range: (number[]|null)}} options.fix The fix object + * @param {Array<{text: string, range: (number[]|null)}>} options.suggestions The array of suggestions objects + * @returns {function(...args): ReportInfo} Function that returns information about the report + */ +function createProblem(options) { + const problem = { + ruleId: options.ruleId, + severity: options.severity, + message: options.message, + line: options.loc.start.line, + column: options.loc.start.column + 1, + nodeType: options.node && options.node.type || null + }; + + /* + * If this isn’t in the conditional, some of the tests fail + * because `messageId` is present in the problem object + */ + if (options.messageId) { + problem.messageId = options.messageId; + } + + if (options.loc.end) { + problem.endLine = options.loc.end.line; + problem.endColumn = options.loc.end.column + 1; + } + + if (options.fix) { + problem.fix = options.fix; + } + + if (options.suggestions && options.suggestions.length > 0) { + problem.suggestions = options.suggestions; + } + + return problem; +} + +/** + * Validates that suggestions are properly defined. Throws if an error is detected. + * @param {Array<{ desc?: string, messageId?: string }>} suggest The incoming suggest data. + * @param {Object} messages Object of meta messages for the rule. + * @returns {void} + */ +function validateSuggestions(suggest, messages) { + if (suggest && Array.isArray(suggest)) { + suggest.forEach(suggestion => { + if (suggestion.messageId) { + const { messageId } = suggestion; + + if (!messages) { + throw new TypeError(`context.report() called with a suggest option with a messageId '${messageId}', but no messages were present in the rule metadata.`); + } + + if (!messages[messageId]) { + throw new TypeError(`context.report() called with a suggest option with a messageId '${messageId}' which is not present in the 'messages' config: ${JSON.stringify(messages, null, 2)}`); + } + + if (suggestion.desc) { + throw new TypeError("context.report() called with a suggest option that defines both a 'messageId' and an 'desc'. Please only pass one."); + } + } else if (!suggestion.desc) { + throw new TypeError("context.report() called with a suggest option that doesn't have either a `desc` or `messageId`"); + } + + if (typeof suggestion.fix !== "function") { + throw new TypeError(`context.report() called with a suggest option without a fix function. See: ${suggestion}`); + } + }); + } +} + +/** + * Returns a function that converts the arguments of a `context.report` call from a rule into a reported + * problem for the Node.js API. + * @param {{ruleId: string, severity: number, sourceCode: SourceCode, messageIds: Object, disableFixes: boolean}} metadata Metadata for the reported problem + * @param {SourceCode} sourceCode The `SourceCode` instance for the text being linted + * @returns {function(...args): ReportInfo} Function that returns information about the report + */ + +module.exports = function createReportTranslator(metadata) { + + /* + * `createReportTranslator` gets called once per enabled rule per file. It needs to be very performant. + * The report translator itself (i.e. the function that `createReportTranslator` returns) gets + * called every time a rule reports a problem, which happens much less frequently (usually, the vast + * majority of rules don't report any problems for a given file). + */ + return (...args) => { + const descriptor = normalizeMultiArgReportCall(...args); + const messages = metadata.messageIds; + + assertValidNodeInfo(descriptor); + + let computedMessage; + + if (descriptor.messageId) { + if (!messages) { + throw new TypeError("context.report() called with a messageId, but no messages were present in the rule metadata."); + } + const id = descriptor.messageId; + + if (descriptor.message) { + throw new TypeError("context.report() called with a message and a messageId. Please only pass one."); + } + if (!messages || !Object.prototype.hasOwnProperty.call(messages, id)) { + throw new TypeError(`context.report() called with a messageId of '${id}' which is not present in the 'messages' config: ${JSON.stringify(messages, null, 2)}`); + } + computedMessage = messages[id]; + } else if (descriptor.message) { + computedMessage = descriptor.message; + } else { + throw new TypeError("Missing `message` property in report() call; add a message that describes the linting problem."); + } + + validateSuggestions(descriptor.suggest, messages); + + return createProblem({ + ruleId: metadata.ruleId, + severity: metadata.severity, + node: descriptor.node, + message: interpolate(computedMessage, descriptor.data), + messageId: descriptor.messageId, + loc: normalizeReportLoc(descriptor), + fix: metadata.disableFixes ? null : normalizeFixes(descriptor, metadata.sourceCode), + suggestions: metadata.disableFixes ? [] : mapSuggestions(descriptor, metadata.sourceCode, messages) + }); + }; +}; diff --git a/node_modules/eslint/lib/linter/rule-fixer.js b/node_modules/eslint/lib/linter/rule-fixer.js new file mode 100644 index 000000000..bdd80d13b --- /dev/null +++ b/node_modules/eslint/lib/linter/rule-fixer.js @@ -0,0 +1,140 @@ +/** + * @fileoverview An object that creates fix commands for rules. + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +// none! + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Creates a fix command that inserts text at the specified index in the source text. + * @param {int} index The 0-based index at which to insert the new text. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + * @private + */ +function insertTextAt(index, text) { + return { + range: [index, index], + text + }; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Creates code fixing commands for rules. + */ + +const ruleFixer = Object.freeze({ + + /** + * Creates a fix command that inserts text after the given node or token. + * The fix is not applied until applyFixes() is called. + * @param {ASTNode|Token} nodeOrToken The node or token to insert after. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + insertTextAfter(nodeOrToken, text) { + return this.insertTextAfterRange(nodeOrToken.range, text); + }, + + /** + * Creates a fix command that inserts text after the specified range in the source text. + * The fix is not applied until applyFixes() is called. + * @param {int[]} range The range to replace, first item is start of range, second + * is end of range. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + insertTextAfterRange(range, text) { + return insertTextAt(range[1], text); + }, + + /** + * Creates a fix command that inserts text before the given node or token. + * The fix is not applied until applyFixes() is called. + * @param {ASTNode|Token} nodeOrToken The node or token to insert before. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + insertTextBefore(nodeOrToken, text) { + return this.insertTextBeforeRange(nodeOrToken.range, text); + }, + + /** + * Creates a fix command that inserts text before the specified range in the source text. + * The fix is not applied until applyFixes() is called. + * @param {int[]} range The range to replace, first item is start of range, second + * is end of range. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + insertTextBeforeRange(range, text) { + return insertTextAt(range[0], text); + }, + + /** + * Creates a fix command that replaces text at the node or token. + * The fix is not applied until applyFixes() is called. + * @param {ASTNode|Token} nodeOrToken The node or token to remove. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + replaceText(nodeOrToken, text) { + return this.replaceTextRange(nodeOrToken.range, text); + }, + + /** + * Creates a fix command that replaces text at the specified range in the source text. + * The fix is not applied until applyFixes() is called. + * @param {int[]} range The range to replace, first item is start of range, second + * is end of range. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + replaceTextRange(range, text) { + return { + range, + text + }; + }, + + /** + * Creates a fix command that removes the node or token from the source. + * The fix is not applied until applyFixes() is called. + * @param {ASTNode|Token} nodeOrToken The node or token to remove. + * @returns {Object} The fix command. + */ + remove(nodeOrToken) { + return this.removeRange(nodeOrToken.range); + }, + + /** + * Creates a fix command that removes the specified range of text from the source. + * The fix is not applied until applyFixes() is called. + * @param {int[]} range The range to remove, first item is start of range, second + * is end of range. + * @returns {Object} The fix command. + */ + removeRange(range) { + return { + range, + text: "" + }; + } + +}); + + +module.exports = ruleFixer; diff --git a/node_modules/eslint/lib/linter/rules.js b/node_modules/eslint/lib/linter/rules.js new file mode 100644 index 000000000..a153266ef --- /dev/null +++ b/node_modules/eslint/lib/linter/rules.js @@ -0,0 +1,77 @@ +/** + * @fileoverview Defines a storage for rules. + * @author Nicholas C. Zakas + * @author aladdin-add + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const builtInRules = require("../rules"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Normalizes a rule module to the new-style API + * @param {(Function|{create: Function})} rule A rule object, which can either be a function + * ("old-style") or an object with a `create` method ("new-style") + * @returns {{create: Function}} A new-style rule. + */ +function normalizeRule(rule) { + return typeof rule === "function" ? Object.assign({ create: rule }, rule) : rule; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +class Rules { + constructor() { + this._rules = Object.create(null); + } + + /** + * Registers a rule module for rule id in storage. + * @param {string} ruleId Rule id (file name). + * @param {Function} ruleModule Rule handler. + * @returns {void} + */ + define(ruleId, ruleModule) { + this._rules[ruleId] = normalizeRule(ruleModule); + } + + /** + * Access rule handler by id (file name). + * @param {string} ruleId Rule id (file name). + * @returns {{create: Function, schema: JsonSchema[]}} + * A rule. This is normalized to always have the new-style shape with a `create` method. + */ + get(ruleId) { + if (typeof this._rules[ruleId] === "string") { + this.define(ruleId, require(this._rules[ruleId])); + } + if (this._rules[ruleId]) { + return this._rules[ruleId]; + } + if (builtInRules.has(ruleId)) { + return builtInRules.get(ruleId); + } + + return null; + } + + *[Symbol.iterator]() { + yield* builtInRules; + + for (const ruleId of Object.keys(this._rules)) { + yield [ruleId, this.get(ruleId)]; + } + } +} + +module.exports = Rules; diff --git a/node_modules/eslint/lib/linter/safe-emitter.js b/node_modules/eslint/lib/linter/safe-emitter.js new file mode 100644 index 000000000..ab212230d --- /dev/null +++ b/node_modules/eslint/lib/linter/safe-emitter.js @@ -0,0 +1,52 @@ +/** + * @fileoverview A variant of EventEmitter which does not give listeners information about each other + * @author Teddy Katz + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * An event emitter + * @typedef {Object} SafeEmitter + * @property {function(eventName: string, listenerFunc: Function): void} on Adds a listener for a given event name + * @property {function(eventName: string, arg1?: any, arg2?: any, arg3?: any)} emit Emits an event with a given name. + * This calls all the listeners that were listening for that name, with `arg1`, `arg2`, and `arg3` as arguments. + * @property {function(): string[]} eventNames Gets the list of event names that have registered listeners. + */ + +/** + * Creates an object which can listen for and emit events. + * This is similar to the EventEmitter API in Node's standard library, but it has a few differences. + * The goal is to allow multiple modules to attach arbitrary listeners to the same emitter, without + * letting the modules know about each other at all. + * 1. It has no special keys like `error` and `newListener`, which would allow modules to detect when + * another module throws an error or registers a listener. + * 2. It calls listener functions without any `this` value. (`EventEmitter` calls listeners with a + * `this` value of the emitter instance, which would give listeners access to other listeners.) + * @returns {SafeEmitter} An emitter + */ +module.exports = () => { + const listeners = Object.create(null); + + return Object.freeze({ + on(eventName, listener) { + if (eventName in listeners) { + listeners[eventName].push(listener); + } else { + listeners[eventName] = [listener]; + } + }, + emit(eventName, ...args) { + if (eventName in listeners) { + listeners[eventName].forEach(listener => listener(...args)); + } + }, + eventNames() { + return Object.keys(listeners); + } + }); +}; diff --git a/node_modules/eslint/lib/linter/source-code-fixer.js b/node_modules/eslint/lib/linter/source-code-fixer.js new file mode 100644 index 000000000..53dc1dc6b --- /dev/null +++ b/node_modules/eslint/lib/linter/source-code-fixer.js @@ -0,0 +1,152 @@ +/** + * @fileoverview An object that caches and applies source code fixes. + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const debug = require("debug")("eslint:source-code-fixer"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const BOM = "\uFEFF"; + +/** + * Compares items in a messages array by range. + * @param {Message} a The first message. + * @param {Message} b The second message. + * @returns {int} -1 if a comes before b, 1 if a comes after b, 0 if equal. + * @private + */ +function compareMessagesByFixRange(a, b) { + return a.fix.range[0] - b.fix.range[0] || a.fix.range[1] - b.fix.range[1]; +} + +/** + * Compares items in a messages array by line and column. + * @param {Message} a The first message. + * @param {Message} b The second message. + * @returns {int} -1 if a comes before b, 1 if a comes after b, 0 if equal. + * @private + */ +function compareMessagesByLocation(a, b) { + return a.line - b.line || a.column - b.column; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Utility for apply fixes to source code. + * @constructor + */ +function SourceCodeFixer() { + Object.freeze(this); +} + +/** + * Applies the fixes specified by the messages to the given text. Tries to be + * smart about the fixes and won't apply fixes over the same area in the text. + * @param {string} sourceText The text to apply the changes to. + * @param {Message[]} messages The array of messages reported by ESLint. + * @param {boolean|Function} [shouldFix=true] Determines whether each message should be fixed + * @returns {Object} An object containing the fixed text and any unfixed messages. + */ +SourceCodeFixer.applyFixes = function(sourceText, messages, shouldFix) { + debug("Applying fixes"); + + if (shouldFix === false) { + debug("shouldFix parameter was false, not attempting fixes"); + return { + fixed: false, + messages, + output: sourceText + }; + } + + // clone the array + const remainingMessages = [], + fixes = [], + bom = sourceText.startsWith(BOM) ? BOM : "", + text = bom ? sourceText.slice(1) : sourceText; + let lastPos = Number.NEGATIVE_INFINITY, + output = bom; + + /** + * Try to use the 'fix' from a problem. + * @param {Message} problem The message object to apply fixes from + * @returns {boolean} Whether fix was successfully applied + */ + function attemptFix(problem) { + const fix = problem.fix; + const start = fix.range[0]; + const end = fix.range[1]; + + // Remain it as a problem if it's overlapped or it's a negative range + if (lastPos >= start || start > end) { + remainingMessages.push(problem); + return false; + } + + // Remove BOM. + if ((start < 0 && end >= 0) || (start === 0 && fix.text.startsWith(BOM))) { + output = ""; + } + + // Make output to this fix. + output += text.slice(Math.max(0, lastPos), Math.max(0, start)); + output += fix.text; + lastPos = end; + return true; + } + + messages.forEach(problem => { + if (Object.prototype.hasOwnProperty.call(problem, "fix")) { + fixes.push(problem); + } else { + remainingMessages.push(problem); + } + }); + + if (fixes.length) { + debug("Found fixes to apply"); + let fixesWereApplied = false; + + for (const problem of fixes.sort(compareMessagesByFixRange)) { + if (typeof shouldFix !== "function" || shouldFix(problem)) { + attemptFix(problem); + + /* + * The only time attemptFix will fail is if a previous fix was + * applied which conflicts with it. So we can mark this as true. + */ + fixesWereApplied = true; + } else { + remainingMessages.push(problem); + } + } + output += text.slice(Math.max(0, lastPos)); + + return { + fixed: fixesWereApplied, + messages: remainingMessages.sort(compareMessagesByLocation), + output + }; + } + + debug("No fixes to apply"); + return { + fixed: false, + messages, + output: bom + text + }; + +}; + +module.exports = SourceCodeFixer; diff --git a/node_modules/eslint/lib/linter/timing.js b/node_modules/eslint/lib/linter/timing.js new file mode 100644 index 000000000..8396d9215 --- /dev/null +++ b/node_modules/eslint/lib/linter/timing.js @@ -0,0 +1,139 @@ +/** + * @fileoverview Tracks performance of individual rules. + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/* istanbul ignore next */ +/** + * Align the string to left + * @param {string} str string to evaluate + * @param {int} len length of the string + * @param {string} ch delimiter character + * @returns {string} modified string + * @private + */ +function alignLeft(str, len, ch) { + return str + new Array(len - str.length + 1).join(ch || " "); +} + +/* istanbul ignore next */ +/** + * Align the string to right + * @param {string} str string to evaluate + * @param {int} len length of the string + * @param {string} ch delimiter character + * @returns {string} modified string + * @private + */ +function alignRight(str, len, ch) { + return new Array(len - str.length + 1).join(ch || " ") + str; +} + +//------------------------------------------------------------------------------ +// Module definition +//------------------------------------------------------------------------------ + +const enabled = !!process.env.TIMING; + +const HEADERS = ["Rule", "Time (ms)", "Relative"]; +const ALIGN = [alignLeft, alignRight, alignRight]; + +/* istanbul ignore next */ +/** + * display the data + * @param {Object} data Data object to be displayed + * @returns {void} prints modified string with console.log + * @private + */ +function display(data) { + let total = 0; + const rows = Object.keys(data) + .map(key => { + const time = data[key]; + + total += time; + return [key, time]; + }) + .sort((a, b) => b[1] - a[1]) + .slice(0, 10); + + rows.forEach(row => { + row.push(`${(row[1] * 100 / total).toFixed(1)}%`); + row[1] = row[1].toFixed(3); + }); + + rows.unshift(HEADERS); + + const widths = []; + + rows.forEach(row => { + const len = row.length; + + for (let i = 0; i < len; i++) { + const n = row[i].length; + + if (!widths[i] || n > widths[i]) { + widths[i] = n; + } + } + }); + + const table = rows.map(row => ( + row + .map((cell, index) => ALIGN[index](cell, widths[index])) + .join(" | ") + )); + + table.splice(1, 0, widths.map((width, index) => { + const extraAlignment = index !== 0 && index !== widths.length - 1 ? 2 : 1; + + return ALIGN[index](":", width + extraAlignment, "-"); + }).join("|")); + + console.log(table.join("\n")); // eslint-disable-line no-console +} + +/* istanbul ignore next */ +module.exports = (function() { + + const data = Object.create(null); + + /** + * Time the run + * @param {*} key key from the data object + * @param {Function} fn function to be called + * @returns {Function} function to be executed + * @private + */ + function time(key, fn) { + if (typeof data[key] === "undefined") { + data[key] = 0; + } + + return function(...args) { + let t = process.hrtime(); + + fn(...args); + t = process.hrtime(t); + data[key] += t[0] * 1e3 + t[1] / 1e6; + }; + } + + if (enabled) { + process.on("exit", () => { + display(data); + }); + } + + return { + time, + enabled + }; + +}()); diff --git a/node_modules/eslint/lib/options.js b/node_modules/eslint/lib/options.js new file mode 100644 index 000000000..1681f1dbd --- /dev/null +++ b/node_modules/eslint/lib/options.js @@ -0,0 +1,262 @@ +/** + * @fileoverview Options configuration for optionator. + * @author George Zahariev + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const optionator = require("optionator"); + +//------------------------------------------------------------------------------ +// Initialization and Public Interface +//------------------------------------------------------------------------------ + +// exports "parse(args)", "generateHelp()", and "generateHelpForOption(optionName)" +module.exports = optionator({ + prepend: "eslint [options] file.js [file.js] [dir]", + defaults: { + concatRepeatedArrays: true, + mergeRepeatedObjects: true + }, + options: [ + { + heading: "Basic configuration" + }, + { + option: "eslintrc", + type: "Boolean", + default: "true", + description: "Disable use of configuration from .eslintrc.*" + }, + { + option: "config", + alias: "c", + type: "path::String", + description: "Use this configuration, overriding .eslintrc.* config options if present" + }, + { + option: "env", + type: "[String]", + description: "Specify environments" + }, + { + option: "ext", + type: "[String]", + description: "Specify JavaScript file extensions" + }, + { + option: "global", + type: "[String]", + description: "Define global variables" + }, + { + option: "parser", + type: "String", + description: "Specify the parser to be used" + }, + { + option: "parser-options", + type: "Object", + description: "Specify parser options" + }, + { + option: "resolve-plugins-relative-to", + type: "path::String", + description: "A folder where plugins should be resolved from, CWD by default" + }, + { + heading: "Specifying rules and plugins" + }, + { + option: "rulesdir", + type: "[path::String]", + description: "Use additional rules from this directory" + }, + { + option: "plugin", + type: "[String]", + description: "Specify plugins" + }, + { + option: "rule", + type: "Object", + description: "Specify rules" + }, + { + heading: "Fixing problems" + }, + { + option: "fix", + type: "Boolean", + default: false, + description: "Automatically fix problems" + }, + { + option: "fix-dry-run", + type: "Boolean", + default: false, + description: "Automatically fix problems without saving the changes to the file system" + }, + { + option: "fix-type", + type: "Array", + description: "Specify the types of fixes to apply (problem, suggestion, layout)" + }, + { + heading: "Ignoring files" + }, + { + option: "ignore-path", + type: "path::String", + description: "Specify path of ignore file" + }, + { + option: "ignore", + type: "Boolean", + default: "true", + description: "Disable use of ignore files and patterns" + }, + { + option: "ignore-pattern", + type: "[String]", + description: "Pattern of files to ignore (in addition to those in .eslintignore)", + concatRepeatedArrays: [true, { + oneValuePerFlag: true + }] + }, + { + heading: "Using stdin" + }, + { + option: "stdin", + type: "Boolean", + default: "false", + description: "Lint code provided on " + }, + { + option: "stdin-filename", + type: "String", + description: "Specify filename to process STDIN as" + }, + { + heading: "Handling warnings" + }, + { + option: "quiet", + type: "Boolean", + default: "false", + description: "Report errors only" + }, + { + option: "max-warnings", + type: "Int", + default: "-1", + description: "Number of warnings to trigger nonzero exit code" + }, + { + heading: "Output" + }, + { + option: "output-file", + alias: "o", + type: "path::String", + description: "Specify file to write report to" + }, + { + option: "format", + alias: "f", + type: "String", + default: "stylish", + description: "Use a specific output format" + }, + { + option: "color", + type: "Boolean", + alias: "no-color", + description: "Force enabling/disabling of color" + }, + { + heading: "Inline configuration comments" + }, + { + option: "inline-config", + type: "Boolean", + default: "true", + description: "Prevent comments from changing config or rules" + }, + { + option: "report-unused-disable-directives", + type: "Boolean", + default: void 0, + description: "Adds reported errors for unused eslint-disable directives" + }, + { + heading: "Caching" + }, + { + option: "cache", + type: "Boolean", + default: "false", + description: "Only check changed files" + }, + { + option: "cache-file", + type: "path::String", + default: ".eslintcache", + description: "Path to the cache file. Deprecated: use --cache-location" + }, + { + option: "cache-location", + type: "path::String", + description: "Path to the cache file or directory" + }, + { + heading: "Miscellaneous" + }, + { + option: "init", + type: "Boolean", + default: "false", + description: "Run config initialization wizard" + }, + { + option: "env-info", + type: "Boolean", + default: "false", + description: "Output execution environment information" + }, + { + option: "error-on-unmatched-pattern", + type: "Boolean", + default: "true", + description: "Prevent errors when pattern is unmatched" + }, + { + option: "debug", + type: "Boolean", + default: false, + description: "Output debugging information" + }, + { + option: "help", + alias: "h", + type: "Boolean", + description: "Show help" + }, + { + option: "version", + alias: "v", + type: "Boolean", + description: "Output the version number" + }, + { + option: "print-config", + type: "path::String", + description: "Print the configuration for the given file" + } + ] +}); diff --git a/node_modules/eslint/lib/rule-tester/index.js b/node_modules/eslint/lib/rule-tester/index.js new file mode 100644 index 000000000..f52d14027 --- /dev/null +++ b/node_modules/eslint/lib/rule-tester/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = { + RuleTester: require("./rule-tester") +}; diff --git a/node_modules/eslint/lib/rule-tester/rule-tester.js b/node_modules/eslint/lib/rule-tester/rule-tester.js new file mode 100644 index 000000000..905f34181 --- /dev/null +++ b/node_modules/eslint/lib/rule-tester/rule-tester.js @@ -0,0 +1,903 @@ +/** + * @fileoverview Mocha test wrapper + * @author Ilya Volodin + */ +"use strict"; + +/* global describe, it */ + +/* + * This is a wrapper around mocha to allow for DRY unittests for eslint + * Format: + * RuleTester.run("{ruleName}", { + * valid: [ + * "{code}", + * { code: "{code}", options: {options}, globals: {globals}, parser: "{parser}", settings: {settings} } + * ], + * invalid: [ + * { code: "{code}", errors: {numErrors} }, + * { code: "{code}", errors: ["{errorMessage}"] }, + * { code: "{code}", options: {options}, globals: {globals}, parser: "{parser}", settings: {settings}, errors: [{ message: "{errorMessage}", type: "{errorNodeType}"}] } + * ] + * }); + * + * Variables: + * {code} - String that represents the code to be tested + * {options} - Arguments that are passed to the configurable rules. + * {globals} - An object representing a list of variables that are + * registered as globals + * {parser} - String representing the parser to use + * {settings} - An object representing global settings for all rules + * {numErrors} - If failing case doesn't need to check error message, + * this integer will specify how many errors should be + * received + * {errorMessage} - Message that is returned by the rule on failure + * {errorNodeType} - AST node type that is returned by they rule as + * a cause of the failure. + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const + assert = require("assert"), + path = require("path"), + util = require("util"), + lodash = require("lodash"), + Traverser = require("../../lib/shared/traverser"), + { getRuleOptionsSchema, validate } = require("../shared/config-validator"), + { Linter, SourceCodeFixer, interpolate } = require("../linter"); + +const ajv = require("../shared/ajv")({ strictDefaults: true }); + +const espreePath = require.resolve("espree"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** @typedef {import("../shared/types").Parser} Parser */ + +/** + * A test case that is expected to pass lint. + * @typedef {Object} ValidTestCase + * @property {string} code Code for the test case. + * @property {any[]} [options] Options for the test case. + * @property {{ [name: string]: any }} [settings] Settings for the test case. + * @property {string} [filename] The fake filename for the test case. Useful for rules that make assertion about filenames. + * @property {string} [parser] The absolute path for the parser. + * @property {{ [name: string]: any }} [parserOptions] Options for the parser. + * @property {{ [name: string]: "readonly" | "writable" | "off" }} [globals] The additional global variables. + * @property {{ [name: string]: boolean }} [env] Environments for the test case. + */ + +/** + * A test case that is expected to fail lint. + * @typedef {Object} InvalidTestCase + * @property {string} code Code for the test case. + * @property {number | Array} errors Expected errors. + * @property {string | null} [output] The expected code after autofixes are applied. If set to `null`, the test runner will assert that no autofix is suggested. + * @property {any[]} [options] Options for the test case. + * @property {{ [name: string]: any }} [settings] Settings for the test case. + * @property {string} [filename] The fake filename for the test case. Useful for rules that make assertion about filenames. + * @property {string} [parser] The absolute path for the parser. + * @property {{ [name: string]: any }} [parserOptions] Options for the parser. + * @property {{ [name: string]: "readonly" | "writable" | "off" }} [globals] The additional global variables. + * @property {{ [name: string]: boolean }} [env] Environments for the test case. + */ + +/** + * A description of a reported error used in a rule tester test. + * @typedef {Object} TestCaseError + * @property {string | RegExp} [message] Message. + * @property {string} [messageId] Message ID. + * @property {string} [type] The type of the reported AST node. + * @property {{ [name: string]: string }} [data] The data used to fill the message template. + * @property {number} [line] The 1-based line number of the reported start location. + * @property {number} [column] The 1-based column number of the reported start location. + * @property {number} [endLine] The 1-based line number of the reported end location. + * @property {number} [endColumn] The 1-based column number of the reported end location. + */ + +//------------------------------------------------------------------------------ +// Private Members +//------------------------------------------------------------------------------ + +/* + * testerDefaultConfig must not be modified as it allows to reset the tester to + * the initial default configuration + */ +const testerDefaultConfig = { rules: {} }; +let defaultConfig = { rules: {} }; + +/* + * List every parameters possible on a test case that are not related to eslint + * configuration + */ +const RuleTesterParameters = [ + "code", + "filename", + "options", + "errors", + "output" +]; + +/* + * All allowed property names in error objects. + */ +const errorObjectParameters = new Set([ + "message", + "messageId", + "data", + "type", + "line", + "column", + "endLine", + "endColumn", + "suggestions" +]); +const friendlyErrorObjectParameterList = `[${[...errorObjectParameters].map(key => `'${key}'`).join(", ")}]`; + +/* + * All allowed property names in suggestion objects. + */ +const suggestionObjectParameters = new Set([ + "desc", + "messageId", + "data", + "output" +]); +const friendlySuggestionObjectParameterList = `[${[...suggestionObjectParameters].map(key => `'${key}'`).join(", ")}]`; + +const hasOwnProperty = Function.call.bind(Object.hasOwnProperty); + +/** + * Clones a given value deeply. + * Note: This ignores `parent` property. + * @param {any} x A value to clone. + * @returns {any} A cloned value. + */ +function cloneDeeplyExcludesParent(x) { + if (typeof x === "object" && x !== null) { + if (Array.isArray(x)) { + return x.map(cloneDeeplyExcludesParent); + } + + const retv = {}; + + for (const key in x) { + if (key !== "parent" && hasOwnProperty(x, key)) { + retv[key] = cloneDeeplyExcludesParent(x[key]); + } + } + + return retv; + } + + return x; +} + +/** + * Freezes a given value deeply. + * @param {any} x A value to freeze. + * @returns {void} + */ +function freezeDeeply(x) { + if (typeof x === "object" && x !== null) { + if (Array.isArray(x)) { + x.forEach(freezeDeeply); + } else { + for (const key in x) { + if (key !== "parent" && hasOwnProperty(x, key)) { + freezeDeeply(x[key]); + } + } + } + Object.freeze(x); + } +} + +/** + * Replace control characters by `\u00xx` form. + * @param {string} text The text to sanitize. + * @returns {string} The sanitized text. + */ +function sanitize(text) { + return text.replace( + /[\u0000-\u0009\u000b-\u001a]/gu, // eslint-disable-line no-control-regex + c => `\\u${c.codePointAt(0).toString(16).padStart(4, "0")}` + ); +} + +/** + * Define `start`/`end` properties as throwing error. + * @param {string} objName Object name used for error messages. + * @param {ASTNode} node The node to define. + * @returns {void} + */ +function defineStartEndAsError(objName, node) { + Object.defineProperties(node, { + start: { + get() { + throw new Error(`Use ${objName}.range[0] instead of ${objName}.start`); + }, + configurable: true, + enumerable: false + }, + end: { + get() { + throw new Error(`Use ${objName}.range[1] instead of ${objName}.end`); + }, + configurable: true, + enumerable: false + } + }); +} + +/** + * Define `start`/`end` properties of all nodes of the given AST as throwing error. + * @param {ASTNode} ast The root node to errorize `start`/`end` properties. + * @param {Object} [visitorKeys] Visitor keys to be used for traversing the given ast. + * @returns {void} + */ +function defineStartEndAsErrorInTree(ast, visitorKeys) { + Traverser.traverse(ast, { visitorKeys, enter: defineStartEndAsError.bind(null, "node") }); + ast.tokens.forEach(defineStartEndAsError.bind(null, "token")); + ast.comments.forEach(defineStartEndAsError.bind(null, "token")); +} + +/** + * Wraps the given parser in order to intercept and modify return values from the `parse` and `parseForESLint` methods, for test purposes. + * In particular, to modify ast nodes, tokens and comments to throw on access to their `start` and `end` properties. + * @param {Parser} parser Parser object. + * @returns {Parser} Wrapped parser object. + */ +function wrapParser(parser) { + if (typeof parser.parseForESLint === "function") { + return { + parseForESLint(...args) { + const ret = parser.parseForESLint(...args); + + defineStartEndAsErrorInTree(ret.ast, ret.visitorKeys); + return ret; + } + }; + } + return { + parse(...args) { + const ast = parser.parse(...args); + + defineStartEndAsErrorInTree(ast); + return ast; + } + }; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +// default separators for testing +const DESCRIBE = Symbol("describe"); +const IT = Symbol("it"); + +/** + * This is `it` default handler if `it` don't exist. + * @this {Mocha} + * @param {string} text The description of the test case. + * @param {Function} method The logic of the test case. + * @returns {any} Returned value of `method`. + */ +function itDefaultHandler(text, method) { + try { + return method.call(this); + } catch (err) { + if (err instanceof assert.AssertionError) { + err.message += ` (${util.inspect(err.actual)} ${err.operator} ${util.inspect(err.expected)})`; + } + throw err; + } +} + +/** + * This is `describe` default handler if `describe` don't exist. + * @this {Mocha} + * @param {string} text The description of the test case. + * @param {Function} method The logic of the test case. + * @returns {any} Returned value of `method`. + */ +function describeDefaultHandler(text, method) { + return method.call(this); +} + +class RuleTester { + + /** + * Creates a new instance of RuleTester. + * @param {Object} [testerConfig] Optional, extra configuration for the tester + */ + constructor(testerConfig) { + + /** + * The configuration to use for this tester. Combination of the tester + * configuration and the default configuration. + * @type {Object} + */ + this.testerConfig = lodash.merge( + + // we have to clone because merge uses the first argument for recipient + lodash.cloneDeep(defaultConfig), + testerConfig, + { rules: { "rule-tester/validate-ast": "error" } } + ); + + /** + * Rule definitions to define before tests. + * @type {Object} + */ + this.rules = {}; + this.linter = new Linter(); + } + + /** + * Set the configuration to use for all future tests + * @param {Object} config the configuration to use. + * @returns {void} + */ + static setDefaultConfig(config) { + if (typeof config !== "object") { + throw new TypeError("RuleTester.setDefaultConfig: config must be an object"); + } + defaultConfig = config; + + // Make sure the rules object exists since it is assumed to exist later + defaultConfig.rules = defaultConfig.rules || {}; + } + + /** + * Get the current configuration used for all tests + * @returns {Object} the current configuration + */ + static getDefaultConfig() { + return defaultConfig; + } + + /** + * Reset the configuration to the initial configuration of the tester removing + * any changes made until now. + * @returns {void} + */ + static resetDefaultConfig() { + defaultConfig = lodash.cloneDeep(testerDefaultConfig); + } + + + /* + * If people use `mocha test.js --watch` command, `describe` and `it` function + * instances are different for each execution. So `describe` and `it` should get fresh instance + * always. + */ + static get describe() { + return ( + this[DESCRIBE] || + (typeof describe === "function" ? describe : describeDefaultHandler) + ); + } + + static set describe(value) { + this[DESCRIBE] = value; + } + + static get it() { + return ( + this[IT] || + (typeof it === "function" ? it : itDefaultHandler) + ); + } + + static set it(value) { + this[IT] = value; + } + + /** + * Define a rule for one particular run of tests. + * @param {string} name The name of the rule to define. + * @param {Function} rule The rule definition. + * @returns {void} + */ + defineRule(name, rule) { + this.rules[name] = rule; + } + + /** + * Adds a new rule test to execute. + * @param {string} ruleName The name of the rule to run. + * @param {Function} rule The rule to test. + * @param {{ + * valid: (ValidTestCase | string)[], + * invalid: InvalidTestCase[] + * }} test The collection of tests to run. + * @returns {void} + */ + run(ruleName, rule, test) { + + const testerConfig = this.testerConfig, + requiredScenarios = ["valid", "invalid"], + scenarioErrors = [], + linter = this.linter; + + if (lodash.isNil(test) || typeof test !== "object") { + throw new TypeError(`Test Scenarios for rule ${ruleName} : Could not find test scenario object`); + } + + requiredScenarios.forEach(scenarioType => { + if (lodash.isNil(test[scenarioType])) { + scenarioErrors.push(`Could not find any ${scenarioType} test scenarios`); + } + }); + + if (scenarioErrors.length > 0) { + throw new Error([ + `Test Scenarios for rule ${ruleName} is invalid:` + ].concat(scenarioErrors).join("\n")); + } + + + linter.defineRule(ruleName, Object.assign({}, rule, { + + // Create a wrapper rule that freezes the `context` properties. + create(context) { + freezeDeeply(context.options); + freezeDeeply(context.settings); + freezeDeeply(context.parserOptions); + + return (typeof rule === "function" ? rule : rule.create)(context); + } + })); + + linter.defineRules(this.rules); + + /** + * Run the rule for the given item + * @param {string|Object} item Item to run the rule against + * @returns {Object} Eslint run result + * @private + */ + function runRuleForItem(item) { + let config = lodash.cloneDeep(testerConfig), + code, filename, output, beforeAST, afterAST; + + if (typeof item === "string") { + code = item; + } else { + code = item.code; + + /* + * Assumes everything on the item is a config except for the + * parameters used by this tester + */ + const itemConfig = lodash.omit(item, RuleTesterParameters); + + /* + * Create the config object from the tester config and this item + * specific configurations. + */ + config = lodash.merge( + config, + itemConfig + ); + } + + if (item.filename) { + filename = item.filename; + } + + if (hasOwnProperty(item, "options")) { + assert(Array.isArray(item.options), "options must be an array"); + config.rules[ruleName] = [1].concat(item.options); + } else { + config.rules[ruleName] = 1; + } + + const schema = getRuleOptionsSchema(rule); + + /* + * Setup AST getters. + * The goal is to check whether or not AST was modified when + * running the rule under test. + */ + linter.defineRule("rule-tester/validate-ast", () => ({ + Program(node) { + beforeAST = cloneDeeplyExcludesParent(node); + }, + "Program:exit"(node) { + afterAST = node; + } + })); + + if (typeof config.parser === "string") { + assert(path.isAbsolute(config.parser), "Parsers provided as strings to RuleTester must be absolute paths"); + } else { + config.parser = espreePath; + } + + linter.defineParser(config.parser, wrapParser(require(config.parser))); + + if (schema) { + ajv.validateSchema(schema); + + if (ajv.errors) { + const errors = ajv.errors.map(error => { + const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath; + + return `\t${field}: ${error.message}`; + }).join("\n"); + + throw new Error([`Schema for rule ${ruleName} is invalid:`, errors]); + } + + /* + * `ajv.validateSchema` checks for errors in the structure of the schema (by comparing the schema against a "meta-schema"), + * and it reports those errors individually. However, there are other types of schema errors that only occur when compiling + * the schema (e.g. using invalid defaults in a schema), and only one of these errors can be reported at a time. As a result, + * the schema is compiled here separately from checking for `validateSchema` errors. + */ + try { + ajv.compile(schema); + } catch (err) { + throw new Error(`Schema for rule ${ruleName} is invalid: ${err.message}`); + } + } + + validate(config, "rule-tester", id => (id === ruleName ? rule : null)); + + // Verify the code. + const messages = linter.verify(code, config, filename); + const fatalErrorMessage = messages.find(m => m.fatal); + + assert(!fatalErrorMessage, `A fatal parsing error occurred: ${fatalErrorMessage && fatalErrorMessage.message}`); + + // Verify if autofix makes a syntax error or not. + if (messages.some(m => m.fix)) { + output = SourceCodeFixer.applyFixes(code, messages).output; + const errorMessageInFix = linter.verify(output, config, filename).find(m => m.fatal); + + assert(!errorMessageInFix, [ + "A fatal parsing error occurred in autofix.", + `Error: ${errorMessageInFix && errorMessageInFix.message}`, + "Autofix output:", + output + ].join("\n")); + } else { + output = code; + } + + return { + messages, + output, + beforeAST, + afterAST: cloneDeeplyExcludesParent(afterAST) + }; + } + + /** + * Check if the AST was changed + * @param {ASTNode} beforeAST AST node before running + * @param {ASTNode} afterAST AST node after running + * @returns {void} + * @private + */ + function assertASTDidntChange(beforeAST, afterAST) { + if (!lodash.isEqual(beforeAST, afterAST)) { + assert.fail("Rule should not modify AST."); + } + } + + /** + * Check if the template is valid or not + * all valid cases go through this + * @param {string|Object} item Item to run the rule against + * @returns {void} + * @private + */ + function testValidTemplate(item) { + const result = runRuleForItem(item); + const messages = result.messages; + + assert.strictEqual(messages.length, 0, util.format("Should have no errors but had %d: %s", + messages.length, util.inspect(messages))); + + assertASTDidntChange(result.beforeAST, result.afterAST); + } + + /** + * Asserts that the message matches its expected value. If the expected + * value is a regular expression, it is checked against the actual + * value. + * @param {string} actual Actual value + * @param {string|RegExp} expected Expected value + * @returns {void} + * @private + */ + function assertMessageMatches(actual, expected) { + if (expected instanceof RegExp) { + + // assert.js doesn't have a built-in RegExp match function + assert.ok( + expected.test(actual), + `Expected '${actual}' to match ${expected}` + ); + } else { + assert.strictEqual(actual, expected); + } + } + + /** + * Check if the template is invalid or not + * all invalid cases go through this. + * @param {string|Object} item Item to run the rule against + * @returns {void} + * @private + */ + function testInvalidTemplate(item) { + assert.ok(item.errors || item.errors === 0, + `Did not specify errors for an invalid test of ${ruleName}`); + + if (Array.isArray(item.errors) && item.errors.length === 0) { + assert.fail("Invalid cases must have at least one error"); + } + + const ruleHasMetaMessages = hasOwnProperty(rule, "meta") && hasOwnProperty(rule.meta, "messages"); + const friendlyIDList = ruleHasMetaMessages ? `[${Object.keys(rule.meta.messages).map(key => `'${key}'`).join(", ")}]` : null; + + const result = runRuleForItem(item); + const messages = result.messages; + + if (typeof item.errors === "number") { + + if (item.errors === 0) { + assert.fail("Invalid cases must have 'error' value greater than 0"); + } + + assert.strictEqual(messages.length, item.errors, util.format("Should have %d error%s but had %d: %s", + item.errors, item.errors === 1 ? "" : "s", messages.length, util.inspect(messages))); + } else { + assert.strictEqual( + messages.length, item.errors.length, + util.format( + "Should have %d error%s but had %d: %s", + item.errors.length, item.errors.length === 1 ? "" : "s", messages.length, util.inspect(messages) + ) + ); + + const hasMessageOfThisRule = messages.some(m => m.ruleId === ruleName); + + for (let i = 0, l = item.errors.length; i < l; i++) { + const error = item.errors[i]; + const message = messages[i]; + + assert(hasMessageOfThisRule, "Error rule name should be the same as the name of the rule being tested"); + + if (typeof error === "string" || error instanceof RegExp) { + + // Just an error message. + assertMessageMatches(message.message, error); + } else if (typeof error === "object" && error !== null) { + + /* + * Error object. + * This may have a message, messageId, data, node type, line, and/or + * column. + */ + + Object.keys(error).forEach(propertyName => { + assert.ok( + errorObjectParameters.has(propertyName), + `Invalid error property name '${propertyName}'. Expected one of ${friendlyErrorObjectParameterList}.` + ); + }); + + if (hasOwnProperty(error, "message")) { + assert.ok(!hasOwnProperty(error, "messageId"), "Error should not specify both 'message' and a 'messageId'."); + assert.ok(!hasOwnProperty(error, "data"), "Error should not specify both 'data' and 'message'."); + assertMessageMatches(message.message, error.message); + } else if (hasOwnProperty(error, "messageId")) { + assert.ok( + ruleHasMetaMessages, + "Error can not use 'messageId' if rule under test doesn't define 'meta.messages'." + ); + if (!hasOwnProperty(rule.meta.messages, error.messageId)) { + assert(false, `Invalid messageId '${error.messageId}'. Expected one of ${friendlyIDList}.`); + } + assert.strictEqual( + message.messageId, + error.messageId, + `messageId '${message.messageId}' does not match expected messageId '${error.messageId}'.` + ); + if (hasOwnProperty(error, "data")) { + + /* + * if data was provided, then directly compare the returned message to a synthetic + * interpolated message using the same message ID and data provided in the test. + * See https://github.com/eslint/eslint/issues/9890 for context. + */ + const unformattedOriginalMessage = rule.meta.messages[error.messageId]; + const rehydratedMessage = interpolate(unformattedOriginalMessage, error.data); + + assert.strictEqual( + message.message, + rehydratedMessage, + `Hydrated message "${rehydratedMessage}" does not match "${message.message}"` + ); + } + } + + assert.ok( + hasOwnProperty(error, "data") ? hasOwnProperty(error, "messageId") : true, + "Error must specify 'messageId' if 'data' is used." + ); + + if (error.type) { + assert.strictEqual(message.nodeType, error.type, `Error type should be ${error.type}, found ${message.nodeType}`); + } + + if (hasOwnProperty(error, "line")) { + assert.strictEqual(message.line, error.line, `Error line should be ${error.line}`); + } + + if (hasOwnProperty(error, "column")) { + assert.strictEqual(message.column, error.column, `Error column should be ${error.column}`); + } + + if (hasOwnProperty(error, "endLine")) { + assert.strictEqual(message.endLine, error.endLine, `Error endLine should be ${error.endLine}`); + } + + if (hasOwnProperty(error, "endColumn")) { + assert.strictEqual(message.endColumn, error.endColumn, `Error endColumn should be ${error.endColumn}`); + } + + if (hasOwnProperty(error, "suggestions")) { + + // Support asserting there are no suggestions + if (!error.suggestions || (Array.isArray(error.suggestions) && error.suggestions.length === 0)) { + if (Array.isArray(message.suggestions) && message.suggestions.length > 0) { + assert.fail(`Error should have no suggestions on error with message: "${message.message}"`); + } + } else { + assert.strictEqual(Array.isArray(message.suggestions), true, `Error should have an array of suggestions. Instead received "${message.suggestions}" on error with message: "${message.message}"`); + assert.strictEqual(message.suggestions.length, error.suggestions.length, `Error should have ${error.suggestions.length} suggestions. Instead found ${message.suggestions.length} suggestions`); + + error.suggestions.forEach((expectedSuggestion, index) => { + assert.ok( + typeof expectedSuggestion === "object" && expectedSuggestion !== null, + "Test suggestion in 'suggestions' array must be an object." + ); + Object.keys(expectedSuggestion).forEach(propertyName => { + assert.ok( + suggestionObjectParameters.has(propertyName), + `Invalid suggestion property name '${propertyName}'. Expected one of ${friendlySuggestionObjectParameterList}.` + ); + }); + + const actualSuggestion = message.suggestions[index]; + const suggestionPrefix = `Error Suggestion at index ${index} :`; + + if (hasOwnProperty(expectedSuggestion, "desc")) { + assert.ok( + !hasOwnProperty(expectedSuggestion, "data"), + `${suggestionPrefix} Test should not specify both 'desc' and 'data'.` + ); + assert.strictEqual( + actualSuggestion.desc, + expectedSuggestion.desc, + `${suggestionPrefix} desc should be "${expectedSuggestion.desc}" but got "${actualSuggestion.desc}" instead.` + ); + } + + if (hasOwnProperty(expectedSuggestion, "messageId")) { + assert.ok( + ruleHasMetaMessages, + `${suggestionPrefix} Test can not use 'messageId' if rule under test doesn't define 'meta.messages'.` + ); + assert.ok( + hasOwnProperty(rule.meta.messages, expectedSuggestion.messageId), + `${suggestionPrefix} Test has invalid messageId '${expectedSuggestion.messageId}', the rule under test allows only one of ${friendlyIDList}.` + ); + assert.strictEqual( + actualSuggestion.messageId, + expectedSuggestion.messageId, + `${suggestionPrefix} messageId should be '${expectedSuggestion.messageId}' but got '${actualSuggestion.messageId}' instead.` + ); + if (hasOwnProperty(expectedSuggestion, "data")) { + const unformattedMetaMessage = rule.meta.messages[expectedSuggestion.messageId]; + const rehydratedDesc = interpolate(unformattedMetaMessage, expectedSuggestion.data); + + assert.strictEqual( + actualSuggestion.desc, + rehydratedDesc, + `${suggestionPrefix} Hydrated test desc "${rehydratedDesc}" does not match received desc "${actualSuggestion.desc}".` + ); + } + } else { + assert.ok( + !hasOwnProperty(expectedSuggestion, "data"), + `${suggestionPrefix} Test must specify 'messageId' if 'data' is used.` + ); + } + + if (hasOwnProperty(expectedSuggestion, "output")) { + const codeWithAppliedSuggestion = SourceCodeFixer.applyFixes(item.code, [actualSuggestion]).output; + + assert.strictEqual(codeWithAppliedSuggestion, expectedSuggestion.output, `Expected the applied suggestion fix to match the test suggestion output for suggestion at index: ${index} on error with message: "${message.message}"`); + } + }); + } + } + } else { + + // Message was an unexpected type + assert.fail(`Error should be a string, object, or RegExp, but found (${util.inspect(message)})`); + } + } + } + + if (hasOwnProperty(item, "output")) { + if (item.output === null) { + assert.strictEqual( + result.output, + item.code, + "Expected no autofixes to be suggested" + ); + } else { + assert.strictEqual(result.output, item.output, "Output is incorrect."); + } + } else { + assert.strictEqual( + result.output, + item.code, + "The rule fixed the code. Please add 'output' property." + ); + } + + // Rules that produce fixes must have `meta.fixable` property. + if (result.output !== item.code) { + assert.ok( + hasOwnProperty(rule, "meta"), + "Fixable rules should export a `meta.fixable` property." + ); + + // Linter throws if a rule that produced a fix has `meta` but doesn't have `meta.fixable`. + } + + assertASTDidntChange(result.beforeAST, result.afterAST); + } + + /* + * This creates a mocha test suite and pipes all supplied info through + * one of the templates above. + */ + RuleTester.describe(ruleName, () => { + RuleTester.describe("valid", () => { + test.valid.forEach(valid => { + RuleTester.it(sanitize(typeof valid === "object" ? valid.code : valid), () => { + testValidTemplate(valid); + }); + }); + }); + + RuleTester.describe("invalid", () => { + test.invalid.forEach(invalid => { + RuleTester.it(sanitize(invalid.code), () => { + testInvalidTemplate(invalid); + }); + }); + }); + }); + } +} + +RuleTester[DESCRIBE] = RuleTester[IT] = null; + +module.exports = RuleTester; diff --git a/node_modules/eslint/lib/rules/accessor-pairs.js b/node_modules/eslint/lib/rules/accessor-pairs.js new file mode 100644 index 000000000..0e0d07a00 --- /dev/null +++ b/node_modules/eslint/lib/rules/accessor-pairs.js @@ -0,0 +1,354 @@ +/** + * @fileoverview Rule to enforce getter and setter pairs in objects and classes. + * @author Gyandeep Singh + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * Property name if it can be computed statically, otherwise the list of the tokens of the key node. + * @typedef {string|Token[]} Key + */ + +/** + * Accessor nodes with the same key. + * @typedef {Object} AccessorData + * @property {Key} key Accessor's key + * @property {ASTNode[]} getters List of getter nodes. + * @property {ASTNode[]} setters List of setter nodes. + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not the given lists represent the equal tokens in the same order. + * Tokens are compared by their properties, not by instance. + * @param {Token[]} left First list of tokens. + * @param {Token[]} right Second list of tokens. + * @returns {boolean} `true` if the lists have same tokens. + */ +function areEqualTokenLists(left, right) { + if (left.length !== right.length) { + return false; + } + + for (let i = 0; i < left.length; i++) { + const leftToken = left[i], + rightToken = right[i]; + + if (leftToken.type !== rightToken.type || leftToken.value !== rightToken.value) { + return false; + } + } + + return true; +} + +/** + * Checks whether or not the given keys are equal. + * @param {Key} left First key. + * @param {Key} right Second key. + * @returns {boolean} `true` if the keys are equal. + */ +function areEqualKeys(left, right) { + if (typeof left === "string" && typeof right === "string") { + + // Statically computed names. + return left === right; + } + if (Array.isArray(left) && Array.isArray(right)) { + + // Token lists. + return areEqualTokenLists(left, right); + } + + return false; +} + +/** + * Checks whether or not a given node is of an accessor kind ('get' or 'set'). + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is of an accessor kind. + */ +function isAccessorKind(node) { + return node.kind === "get" || node.kind === "set"; +} + +/** + * Checks whether or not a given node is an argument of a specified method call. + * @param {ASTNode} node A node to check. + * @param {number} index An expected index of the node in arguments. + * @param {string} object An expected name of the object of the method. + * @param {string} property An expected name of the method. + * @returns {boolean} `true` if the node is an argument of the specified method call. + */ +function isArgumentOfMethodCall(node, index, object, property) { + const parent = node.parent; + + return ( + parent.type === "CallExpression" && + astUtils.isSpecificMemberAccess(parent.callee, object, property) && + parent.arguments[index] === node + ); +} + +/** + * Checks whether or not a given node is a property descriptor. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a property descriptor. + */ +function isPropertyDescriptor(node) { + + // Object.defineProperty(obj, "foo", {set: ...}) + if (isArgumentOfMethodCall(node, 2, "Object", "defineProperty") || + isArgumentOfMethodCall(node, 2, "Reflect", "defineProperty") + ) { + return true; + } + + /* + * Object.defineProperties(obj, {foo: {set: ...}}) + * Object.create(proto, {foo: {set: ...}}) + */ + const grandparent = node.parent.parent; + + return grandparent.type === "ObjectExpression" && ( + isArgumentOfMethodCall(grandparent, 1, "Object", "create") || + isArgumentOfMethodCall(grandparent, 1, "Object", "defineProperties") + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce getter and setter pairs in objects and classes", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/accessor-pairs" + }, + + schema: [{ + type: "object", + properties: { + getWithoutSet: { + type: "boolean", + default: false + }, + setWithoutGet: { + type: "boolean", + default: true + }, + enforceForClassMembers: { + type: "boolean", + default: true + } + }, + additionalProperties: false + }], + + messages: { + missingGetterInPropertyDescriptor: "Getter is not present in property descriptor.", + missingSetterInPropertyDescriptor: "Setter is not present in property descriptor.", + missingGetterInObjectLiteral: "Getter is not present for {{ name }}.", + missingSetterInObjectLiteral: "Setter is not present for {{ name }}.", + missingGetterInClass: "Getter is not present for class {{ name }}.", + missingSetterInClass: "Setter is not present for class {{ name }}." + } + }, + create(context) { + const config = context.options[0] || {}; + const checkGetWithoutSet = config.getWithoutSet === true; + const checkSetWithoutGet = config.setWithoutGet !== false; + const enforceForClassMembers = config.enforceForClassMembers !== false; + const sourceCode = context.getSourceCode(); + + /** + * Reports the given node. + * @param {ASTNode} node The node to report. + * @param {string} messageKind "missingGetter" or "missingSetter". + * @returns {void} + * @private + */ + function report(node, messageKind) { + if (node.type === "Property") { + context.report({ + node, + messageId: `${messageKind}InObjectLiteral`, + loc: astUtils.getFunctionHeadLoc(node.value, sourceCode), + data: { name: astUtils.getFunctionNameWithKind(node.value) } + }); + } else if (node.type === "MethodDefinition") { + context.report({ + node, + messageId: `${messageKind}InClass`, + loc: astUtils.getFunctionHeadLoc(node.value, sourceCode), + data: { name: astUtils.getFunctionNameWithKind(node.value) } + }); + } else { + context.report({ + node, + messageId: `${messageKind}InPropertyDescriptor` + }); + } + } + + /** + * Reports each of the nodes in the given list using the same messageId. + * @param {ASTNode[]} nodes Nodes to report. + * @param {string} messageKind "missingGetter" or "missingSetter". + * @returns {void} + * @private + */ + function reportList(nodes, messageKind) { + for (const node of nodes) { + report(node, messageKind); + } + } + + /** + * Creates a new `AccessorData` object for the given getter or setter node. + * @param {ASTNode} node A getter or setter node. + * @returns {AccessorData} New `AccessorData` object that contains the given node. + * @private + */ + function createAccessorData(node) { + const name = astUtils.getStaticPropertyName(node); + const key = (name !== null) ? name : sourceCode.getTokens(node.key); + + return { + key, + getters: node.kind === "get" ? [node] : [], + setters: node.kind === "set" ? [node] : [] + }; + } + + /** + * Merges the given `AccessorData` object into the given accessors list. + * @param {AccessorData[]} accessors The list to merge into. + * @param {AccessorData} accessorData The object to merge. + * @returns {AccessorData[]} The same instance with the merged object. + * @private + */ + function mergeAccessorData(accessors, accessorData) { + const equalKeyElement = accessors.find(a => areEqualKeys(a.key, accessorData.key)); + + if (equalKeyElement) { + equalKeyElement.getters.push(...accessorData.getters); + equalKeyElement.setters.push(...accessorData.setters); + } else { + accessors.push(accessorData); + } + + return accessors; + } + + /** + * Checks accessor pairs in the given list of nodes. + * @param {ASTNode[]} nodes The list to check. + * @returns {void} + * @private + */ + function checkList(nodes) { + const accessors = nodes + .filter(isAccessorKind) + .map(createAccessorData) + .reduce(mergeAccessorData, []); + + for (const { getters, setters } of accessors) { + if (checkSetWithoutGet && setters.length && !getters.length) { + reportList(setters, "missingGetter"); + } + if (checkGetWithoutSet && getters.length && !setters.length) { + reportList(getters, "missingSetter"); + } + } + } + + /** + * Checks accessor pairs in an object literal. + * @param {ASTNode} node `ObjectExpression` node to check. + * @returns {void} + * @private + */ + function checkObjectLiteral(node) { + checkList(node.properties.filter(p => p.type === "Property")); + } + + /** + * Checks accessor pairs in a property descriptor. + * @param {ASTNode} node Property descriptor `ObjectExpression` node to check. + * @returns {void} + * @private + */ + function checkPropertyDescriptor(node) { + const namesToCheck = node.properties + .filter(p => p.type === "Property" && p.kind === "init" && !p.computed) + .map(({ key }) => key.name); + + const hasGetter = namesToCheck.includes("get"); + const hasSetter = namesToCheck.includes("set"); + + if (checkSetWithoutGet && hasSetter && !hasGetter) { + report(node, "missingGetter"); + } + if (checkGetWithoutSet && hasGetter && !hasSetter) { + report(node, "missingSetter"); + } + } + + /** + * Checks the given object expression as an object literal and as a possible property descriptor. + * @param {ASTNode} node `ObjectExpression` node to check. + * @returns {void} + * @private + */ + function checkObjectExpression(node) { + checkObjectLiteral(node); + if (isPropertyDescriptor(node)) { + checkPropertyDescriptor(node); + } + } + + /** + * Checks the given class body. + * @param {ASTNode} node `ClassBody` node to check. + * @returns {void} + * @private + */ + function checkClassBody(node) { + const methodDefinitions = node.body.filter(m => m.type === "MethodDefinition"); + + checkList(methodDefinitions.filter(m => m.static)); + checkList(methodDefinitions.filter(m => !m.static)); + } + + const listeners = {}; + + if (checkSetWithoutGet || checkGetWithoutSet) { + listeners.ObjectExpression = checkObjectExpression; + if (enforceForClassMembers) { + listeners.ClassBody = checkClassBody; + } + } + + return listeners; + } +}; diff --git a/node_modules/eslint/lib/rules/array-bracket-newline.js b/node_modules/eslint/lib/rules/array-bracket-newline.js new file mode 100644 index 000000000..b4b4dd430 --- /dev/null +++ b/node_modules/eslint/lib/rules/array-bracket-newline.js @@ -0,0 +1,258 @@ +/** + * @fileoverview Rule to enforce linebreaks after open and before close array brackets + * @author Jan Peer Stöcklmair + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce linebreaks after opening and before closing array brackets", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/array-bracket-newline" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["always", "never", "consistent"] + }, + { + type: "object", + properties: { + multiline: { + type: "boolean" + }, + minItems: { + type: ["integer", "null"], + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + unexpectedOpeningLinebreak: "There should be no linebreak after '['.", + unexpectedClosingLinebreak: "There should be no linebreak before ']'.", + missingOpeningLinebreak: "A linebreak is required after '['.", + missingClosingLinebreak: "A linebreak is required before ']'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Normalizes a given option value. + * @param {string|Object|undefined} option An option value to parse. + * @returns {{multiline: boolean, minItems: number}} Normalized option object. + */ + function normalizeOptionValue(option) { + let consistent = false; + let multiline = false; + let minItems = 0; + + if (option) { + if (option === "consistent") { + consistent = true; + minItems = Number.POSITIVE_INFINITY; + } else if (option === "always" || option.minItems === 0) { + minItems = 0; + } else if (option === "never") { + minItems = Number.POSITIVE_INFINITY; + } else { + multiline = Boolean(option.multiline); + minItems = option.minItems || Number.POSITIVE_INFINITY; + } + } else { + consistent = false; + multiline = true; + minItems = Number.POSITIVE_INFINITY; + } + + return { consistent, multiline, minItems }; + } + + /** + * Normalizes a given option value. + * @param {string|Object|undefined} options An option value to parse. + * @returns {{ArrayExpression: {multiline: boolean, minItems: number}, ArrayPattern: {multiline: boolean, minItems: number}}} Normalized option object. + */ + function normalizeOptions(options) { + const value = normalizeOptionValue(options); + + return { ArrayExpression: value, ArrayPattern: value }; + } + + /** + * Reports that there shouldn't be a linebreak after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoBeginningLinebreak(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "unexpectedOpeningLinebreak", + fix(fixer) { + const nextToken = sourceCode.getTokenAfter(token, { includeComments: true }); + + if (astUtils.isCommentToken(nextToken)) { + return null; + } + + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); + } + + /** + * Reports that there shouldn't be a linebreak before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoEndingLinebreak(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "unexpectedClosingLinebreak", + fix(fixer) { + const previousToken = sourceCode.getTokenBefore(token, { includeComments: true }); + + if (astUtils.isCommentToken(previousToken)) { + return null; + } + + return fixer.removeRange([previousToken.range[1], token.range[0]]); + } + }); + } + + /** + * Reports that there should be a linebreak after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredBeginningLinebreak(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "missingOpeningLinebreak", + fix(fixer) { + return fixer.insertTextAfter(token, "\n"); + } + }); + } + + /** + * Reports that there should be a linebreak before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredEndingLinebreak(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "missingClosingLinebreak", + fix(fixer) { + return fixer.insertTextBefore(token, "\n"); + } + }); + } + + /** + * Reports a given node if it violated this rule. + * @param {ASTNode} node A node to check. This is an ArrayExpression node or an ArrayPattern node. + * @returns {void} + */ + function check(node) { + const elements = node.elements; + const normalizedOptions = normalizeOptions(context.options[0]); + const options = normalizedOptions[node.type]; + const openBracket = sourceCode.getFirstToken(node); + const closeBracket = sourceCode.getLastToken(node); + const firstIncComment = sourceCode.getTokenAfter(openBracket, { includeComments: true }); + const lastIncComment = sourceCode.getTokenBefore(closeBracket, { includeComments: true }); + const first = sourceCode.getTokenAfter(openBracket); + const last = sourceCode.getTokenBefore(closeBracket); + + const needsLinebreaks = ( + elements.length >= options.minItems || + ( + options.multiline && + elements.length > 0 && + firstIncComment.loc.start.line !== lastIncComment.loc.end.line + ) || + ( + elements.length === 0 && + firstIncComment.type === "Block" && + firstIncComment.loc.start.line !== lastIncComment.loc.end.line && + firstIncComment === lastIncComment + ) || + ( + options.consistent && + openBracket.loc.end.line !== first.loc.start.line + ) + ); + + /* + * Use tokens or comments to check multiline or not. + * But use only tokens to check whether linebreaks are needed. + * This allows: + * var arr = [ // eslint-disable-line foo + * 'a' + * ] + */ + + if (needsLinebreaks) { + if (astUtils.isTokenOnSameLine(openBracket, first)) { + reportRequiredBeginningLinebreak(node, openBracket); + } + if (astUtils.isTokenOnSameLine(last, closeBracket)) { + reportRequiredEndingLinebreak(node, closeBracket); + } + } else { + if (!astUtils.isTokenOnSameLine(openBracket, first)) { + reportNoBeginningLinebreak(node, openBracket); + } + if (!astUtils.isTokenOnSameLine(last, closeBracket)) { + reportNoEndingLinebreak(node, closeBracket); + } + } + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + ArrayPattern: check, + ArrayExpression: check + }; + } +}; diff --git a/node_modules/eslint/lib/rules/array-bracket-spacing.js b/node_modules/eslint/lib/rules/array-bracket-spacing.js new file mode 100644 index 000000000..c2b77a641 --- /dev/null +++ b/node_modules/eslint/lib/rules/array-bracket-spacing.js @@ -0,0 +1,241 @@ +/** + * @fileoverview Disallows or enforces spaces inside of array brackets. + * @author Jamund Ferguson + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing inside array brackets", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/array-bracket-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + singleValue: { + type: "boolean" + }, + objectsInArrays: { + type: "boolean" + }, + arraysInArrays: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedSpaceAfter: "There should be no space after '{{tokenValue}}'.", + unexpectedSpaceBefore: "There should be no space before '{{tokenValue}}'.", + missingSpaceAfter: "A space is required after '{{tokenValue}}'.", + missingSpaceBefore: "A space is required before '{{tokenValue}}'." + } + }, + create(context) { + const spaced = context.options[0] === "always", + sourceCode = context.getSourceCode(); + + /** + * Determines whether an option is set, relative to the spacing option. + * If spaced is "always", then check whether option is set to false. + * If spaced is "never", then check whether option is set to true. + * @param {Object} option The option to exclude. + * @returns {boolean} Whether or not the property is excluded. + */ + function isOptionSet(option) { + return context.options[1] ? context.options[1][option] === !spaced : false; + } + + const options = { + spaced, + singleElementException: isOptionSet("singleValue"), + objectsInArraysException: isOptionSet("objectsInArrays"), + arraysInArraysException: isOptionSet("arraysInArrays") + }; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports that there shouldn't be a space after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoBeginningSpace(node, token) { + const nextToken = sourceCode.getTokenAfter(token); + + context.report({ + node, + loc: { start: token.loc.end, end: nextToken.loc.start }, + messageId: "unexpectedSpaceAfter", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); + } + + /** + * Reports that there shouldn't be a space before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoEndingSpace(node, token) { + const previousToken = sourceCode.getTokenBefore(token); + + context.report({ + node, + loc: { start: previousToken.loc.end, end: token.loc.start }, + messageId: "unexpectedSpaceBefore", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.removeRange([previousToken.range[1], token.range[0]]); + } + }); + } + + /** + * Reports that there should be a space after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredBeginningSpace(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "missingSpaceAfter", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + + /** + * Reports that there should be a space before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredEndingSpace(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "missingSpaceBefore", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + + /** + * Determines if a node is an object type + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether or not the node is an object type. + */ + function isObjectType(node) { + return node && (node.type === "ObjectExpression" || node.type === "ObjectPattern"); + } + + /** + * Determines if a node is an array type + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether or not the node is an array type. + */ + function isArrayType(node) { + return node && (node.type === "ArrayExpression" || node.type === "ArrayPattern"); + } + + /** + * Validates the spacing around array brackets + * @param {ASTNode} node The node we're checking for spacing + * @returns {void} + */ + function validateArraySpacing(node) { + if (options.spaced && node.elements.length === 0) { + return; + } + + const first = sourceCode.getFirstToken(node), + second = sourceCode.getFirstToken(node, 1), + last = node.typeAnnotation + ? sourceCode.getTokenBefore(node.typeAnnotation) + : sourceCode.getLastToken(node), + penultimate = sourceCode.getTokenBefore(last), + firstElement = node.elements[0], + lastElement = node.elements[node.elements.length - 1]; + + const openingBracketMustBeSpaced = + options.objectsInArraysException && isObjectType(firstElement) || + options.arraysInArraysException && isArrayType(firstElement) || + options.singleElementException && node.elements.length === 1 + ? !options.spaced : options.spaced; + + const closingBracketMustBeSpaced = + options.objectsInArraysException && isObjectType(lastElement) || + options.arraysInArraysException && isArrayType(lastElement) || + options.singleElementException && node.elements.length === 1 + ? !options.spaced : options.spaced; + + if (astUtils.isTokenOnSameLine(first, second)) { + if (openingBracketMustBeSpaced && !sourceCode.isSpaceBetweenTokens(first, second)) { + reportRequiredBeginningSpace(node, first); + } + if (!openingBracketMustBeSpaced && sourceCode.isSpaceBetweenTokens(first, second)) { + reportNoBeginningSpace(node, first); + } + } + + if (first !== penultimate && astUtils.isTokenOnSameLine(penultimate, last)) { + if (closingBracketMustBeSpaced && !sourceCode.isSpaceBetweenTokens(penultimate, last)) { + reportRequiredEndingSpace(node, last); + } + if (!closingBracketMustBeSpaced && sourceCode.isSpaceBetweenTokens(penultimate, last)) { + reportNoEndingSpace(node, last); + } + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ArrayPattern: validateArraySpacing, + ArrayExpression: validateArraySpacing + }; + } +}; diff --git a/node_modules/eslint/lib/rules/array-callback-return.js b/node_modules/eslint/lib/rules/array-callback-return.js new file mode 100644 index 000000000..726734714 --- /dev/null +++ b/node_modules/eslint/lib/rules/array-callback-return.js @@ -0,0 +1,296 @@ +/** + * @fileoverview Rule to enforce return statements in callbacks of array's methods + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const TARGET_NODE_TYPE = /^(?:Arrow)?FunctionExpression$/u; +const TARGET_METHODS = /^(?:every|filter|find(?:Index)?|flatMap|forEach|map|reduce(?:Right)?|some|sort)$/u; + +/** + * Checks a given code path segment is reachable. + * @param {CodePathSegment} segment A segment to check. + * @returns {boolean} `true` if the segment is reachable. + */ +function isReachable(segment) { + return segment.reachable; +} + +/** + * Checks a given node is a member access which has the specified name's + * property. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a member access which has + * the specified name's property. The node may be a `(Chain|Member)Expression` node. + */ +function isTargetMethod(node) { + return astUtils.isSpecificMemberAccess(node, null, TARGET_METHODS); +} + +/** + * Returns a human-legible description of an array method + * @param {string} arrayMethodName A method name to fully qualify + * @returns {string} the method name prefixed with `Array.` if it is a class method, + * or else `Array.prototype.` if it is an instance method. + */ +function fullMethodName(arrayMethodName) { + if (["from", "of", "isArray"].includes(arrayMethodName)) { + return "Array.".concat(arrayMethodName); + } + return "Array.prototype.".concat(arrayMethodName); +} + +/** + * Checks whether or not a given node is a function expression which is the + * callback of an array method, returning the method name. + * @param {ASTNode} node A node to check. This is one of + * FunctionExpression or ArrowFunctionExpression. + * @returns {string} The method name if the node is a callback method, + * null otherwise. + */ +function getArrayMethodName(node) { + let currentNode = node; + + while (currentNode) { + const parent = currentNode.parent; + + switch (parent.type) { + + /* + * Looks up the destination. e.g., + * foo.every(nativeFoo || function foo() { ... }); + */ + case "LogicalExpression": + case "ConditionalExpression": + case "ChainExpression": + currentNode = parent; + break; + + /* + * If the upper function is IIFE, checks the destination of the return value. + * e.g. + * foo.every((function() { + * // setup... + * return function callback() { ... }; + * })()); + */ + case "ReturnStatement": { + const func = astUtils.getUpperFunction(parent); + + if (func === null || !astUtils.isCallee(func)) { + return null; + } + currentNode = func.parent; + break; + } + + /* + * e.g. + * Array.from([], function() {}); + * list.every(function() {}); + */ + case "CallExpression": + if (astUtils.isArrayFromMethod(parent.callee)) { + if ( + parent.arguments.length >= 2 && + parent.arguments[1] === currentNode + ) { + return "from"; + } + } + if (isTargetMethod(parent.callee)) { + if ( + parent.arguments.length >= 1 && + parent.arguments[0] === currentNode + ) { + return astUtils.getStaticPropertyName(parent.callee); + } + } + return null; + + // Otherwise this node is not target. + default: + return null; + } + } + + /* istanbul ignore next: unreachable */ + return null; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "enforce `return` statements in callbacks of array methods", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/array-callback-return" + }, + + schema: [ + { + type: "object", + properties: { + allowImplicit: { + type: "boolean", + default: false + }, + checkForEach: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + expectedAtEnd: "{{arrayMethodName}}() expects a value to be returned at the end of {{name}}.", + expectedInside: "{{arrayMethodName}}() expects a return value from {{name}}.", + expectedReturnValue: "{{arrayMethodName}}() expects a return value from {{name}}.", + expectedNoReturnValue: "{{arrayMethodName}}() expects no useless return value from {{name}}." + } + }, + + create(context) { + + const options = context.options[0] || { allowImplicit: false, checkForEach: false }; + const sourceCode = context.getSourceCode(); + + let funcInfo = { + arrayMethodName: null, + upper: null, + codePath: null, + hasReturn: false, + shouldCheck: false, + node: null + }; + + /** + * Checks whether or not the last code path segment is reachable. + * Then reports this function if the segment is reachable. + * + * If the last code path segment is reachable, there are paths which are not + * returned or thrown. + * @param {ASTNode} node A node to check. + * @returns {void} + */ + function checkLastSegment(node) { + + if (!funcInfo.shouldCheck) { + return; + } + + let messageId = null; + + if (funcInfo.arrayMethodName === "forEach") { + if (options.checkForEach && node.type === "ArrowFunctionExpression" && node.expression) { + messageId = "expectedNoReturnValue"; + } + } else { + if (node.body.type === "BlockStatement" && funcInfo.codePath.currentSegments.some(isReachable)) { + messageId = funcInfo.hasReturn ? "expectedAtEnd" : "expectedInside"; + } + } + + if (messageId) { + const name = astUtils.getFunctionNameWithKind(node); + + context.report({ + node, + loc: astUtils.getFunctionHeadLoc(node, sourceCode), + messageId, + data: { name, arrayMethodName: fullMethodName(funcInfo.arrayMethodName) } + }); + } + } + + return { + + // Stacks this function's information. + onCodePathStart(codePath, node) { + + let methodName = null; + + if (TARGET_NODE_TYPE.test(node.type)) { + methodName = getArrayMethodName(node); + } + + funcInfo = { + arrayMethodName: methodName, + upper: funcInfo, + codePath, + hasReturn: false, + shouldCheck: + methodName && + !node.async && + !node.generator, + node + }; + }, + + // Pops this function's information. + onCodePathEnd() { + funcInfo = funcInfo.upper; + }, + + // Checks the return statement is valid. + ReturnStatement(node) { + + if (!funcInfo.shouldCheck) { + return; + } + + funcInfo.hasReturn = true; + + let messageId = null; + + if (funcInfo.arrayMethodName === "forEach") { + + // if checkForEach: true, returning a value at any path inside a forEach is not allowed + if (options.checkForEach && node.argument) { + messageId = "expectedNoReturnValue"; + } + } else { + + // if allowImplicit: false, should also check node.argument + if (!options.allowImplicit && !node.argument) { + messageId = "expectedReturnValue"; + } + } + + if (messageId) { + context.report({ + node, + messageId, + data: { + name: astUtils.getFunctionNameWithKind(funcInfo.node), + arrayMethodName: fullMethodName(funcInfo.arrayMethodName) + } + }); + } + }, + + // Reports a given function if the last path is reachable. + "FunctionExpression:exit": checkLastSegment, + "ArrowFunctionExpression:exit": checkLastSegment + }; + } +}; diff --git a/node_modules/eslint/lib/rules/array-element-newline.js b/node_modules/eslint/lib/rules/array-element-newline.js new file mode 100644 index 000000000..b7a967865 --- /dev/null +++ b/node_modules/eslint/lib/rules/array-element-newline.js @@ -0,0 +1,301 @@ +/** + * @fileoverview Rule to enforce line breaks after each array element + * @author Jan Peer Stöcklmair + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce line breaks after each array element", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/array-element-newline" + }, + + fixable: "whitespace", + + schema: { + definitions: { + basicConfig: { + oneOf: [ + { + enum: ["always", "never", "consistent"] + }, + { + type: "object", + properties: { + multiline: { + type: "boolean" + }, + minItems: { + type: ["integer", "null"], + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + }, + items: [ + { + oneOf: [ + { + $ref: "#/definitions/basicConfig" + }, + { + type: "object", + properties: { + ArrayExpression: { + $ref: "#/definitions/basicConfig" + }, + ArrayPattern: { + $ref: "#/definitions/basicConfig" + } + }, + additionalProperties: false, + minProperties: 1 + } + ] + } + ] + }, + + messages: { + unexpectedLineBreak: "There should be no linebreak here.", + missingLineBreak: "There should be a linebreak after this element." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Normalizes a given option value. + * @param {string|Object|undefined} providedOption An option value to parse. + * @returns {{multiline: boolean, minItems: number}} Normalized option object. + */ + function normalizeOptionValue(providedOption) { + let consistent = false; + let multiline = false; + let minItems; + + const option = providedOption || "always"; + + if (!option || option === "always" || option.minItems === 0) { + minItems = 0; + } else if (option === "never") { + minItems = Number.POSITIVE_INFINITY; + } else if (option === "consistent") { + consistent = true; + minItems = Number.POSITIVE_INFINITY; + } else { + multiline = Boolean(option.multiline); + minItems = option.minItems || Number.POSITIVE_INFINITY; + } + + return { consistent, multiline, minItems }; + } + + /** + * Normalizes a given option value. + * @param {string|Object|undefined} options An option value to parse. + * @returns {{ArrayExpression: {multiline: boolean, minItems: number}, ArrayPattern: {multiline: boolean, minItems: number}}} Normalized option object. + */ + function normalizeOptions(options) { + if (options && (options.ArrayExpression || options.ArrayPattern)) { + let expressionOptions, patternOptions; + + if (options.ArrayExpression) { + expressionOptions = normalizeOptionValue(options.ArrayExpression); + } + + if (options.ArrayPattern) { + patternOptions = normalizeOptionValue(options.ArrayPattern); + } + + return { ArrayExpression: expressionOptions, ArrayPattern: patternOptions }; + } + + const value = normalizeOptionValue(options); + + return { ArrayExpression: value, ArrayPattern: value }; + } + + /** + * Reports that there shouldn't be a line break after the first token + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoLineBreak(token) { + const tokenBefore = sourceCode.getTokenBefore(token, { includeComments: true }); + + context.report({ + loc: { + start: tokenBefore.loc.end, + end: token.loc.start + }, + messageId: "unexpectedLineBreak", + fix(fixer) { + if (astUtils.isCommentToken(tokenBefore)) { + return null; + } + + if (!astUtils.isTokenOnSameLine(tokenBefore, token)) { + return fixer.replaceTextRange([tokenBefore.range[1], token.range[0]], " "); + } + + /* + * This will check if the comma is on the same line as the next element + * Following array: + * [ + * 1 + * , 2 + * , 3 + * ] + * + * will be fixed to: + * [ + * 1, 2, 3 + * ] + */ + const twoTokensBefore = sourceCode.getTokenBefore(tokenBefore, { includeComments: true }); + + if (astUtils.isCommentToken(twoTokensBefore)) { + return null; + } + + return fixer.replaceTextRange([twoTokensBefore.range[1], tokenBefore.range[0]], ""); + + } + }); + } + + /** + * Reports that there should be a line break after the first token + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredLineBreak(token) { + const tokenBefore = sourceCode.getTokenBefore(token, { includeComments: true }); + + context.report({ + loc: { + start: tokenBefore.loc.end, + end: token.loc.start + }, + messageId: "missingLineBreak", + fix(fixer) { + return fixer.replaceTextRange([tokenBefore.range[1], token.range[0]], "\n"); + } + }); + } + + /** + * Reports a given node if it violated this rule. + * @param {ASTNode} node A node to check. This is an ObjectExpression node or an ObjectPattern node. + * @returns {void} + */ + function check(node) { + const elements = node.elements; + const normalizedOptions = normalizeOptions(context.options[0]); + const options = normalizedOptions[node.type]; + + if (!options) { + return; + } + + let elementBreak = false; + + /* + * MULTILINE: true + * loop through every element and check + * if at least one element has linebreaks inside + * this ensures that following is not valid (due to elements are on the same line): + * + * [ + * 1, + * 2, + * 3 + * ] + */ + if (options.multiline) { + elementBreak = elements + .filter(element => element !== null) + .some(element => element.loc.start.line !== element.loc.end.line); + } + + const linebreaksCount = node.elements.map((element, i) => { + const previousElement = elements[i - 1]; + + if (i === 0 || element === null || previousElement === null) { + return false; + } + + const commaToken = sourceCode.getFirstTokenBetween(previousElement, element, astUtils.isCommaToken); + const lastTokenOfPreviousElement = sourceCode.getTokenBefore(commaToken); + const firstTokenOfCurrentElement = sourceCode.getTokenAfter(commaToken); + + return !astUtils.isTokenOnSameLine(lastTokenOfPreviousElement, firstTokenOfCurrentElement); + }).filter(isBreak => isBreak === true).length; + + const needsLinebreaks = ( + elements.length >= options.minItems || + ( + options.multiline && + elementBreak + ) || + ( + options.consistent && + linebreaksCount > 0 && + linebreaksCount < node.elements.length + ) + ); + + elements.forEach((element, i) => { + const previousElement = elements[i - 1]; + + if (i === 0 || element === null || previousElement === null) { + return; + } + + const commaToken = sourceCode.getFirstTokenBetween(previousElement, element, astUtils.isCommaToken); + const lastTokenOfPreviousElement = sourceCode.getTokenBefore(commaToken); + const firstTokenOfCurrentElement = sourceCode.getTokenAfter(commaToken); + + if (needsLinebreaks) { + if (astUtils.isTokenOnSameLine(lastTokenOfPreviousElement, firstTokenOfCurrentElement)) { + reportRequiredLineBreak(firstTokenOfCurrentElement); + } + } else { + if (!astUtils.isTokenOnSameLine(lastTokenOfPreviousElement, firstTokenOfCurrentElement)) { + reportNoLineBreak(firstTokenOfCurrentElement); + } + } + }); + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + ArrayPattern: check, + ArrayExpression: check + }; + } +}; diff --git a/node_modules/eslint/lib/rules/arrow-body-style.js b/node_modules/eslint/lib/rules/arrow-body-style.js new file mode 100644 index 000000000..7b318ea8b --- /dev/null +++ b/node_modules/eslint/lib/rules/arrow-body-style.js @@ -0,0 +1,286 @@ +/** + * @fileoverview Rule to require braces in arrow function body. + * @author Alberto Rodríguez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require braces around arrow function bodies", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/arrow-body-style" + }, + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["always", "never"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["as-needed"] + }, + { + type: "object", + properties: { + requireReturnForObjectLiteral: { type: "boolean" } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + fixable: "code", + + messages: { + unexpectedOtherBlock: "Unexpected block statement surrounding arrow body.", + unexpectedEmptyBlock: "Unexpected block statement surrounding arrow body; put a value of `undefined` immediately after the `=>`.", + unexpectedObjectBlock: "Unexpected block statement surrounding arrow body; parenthesize the returned value and move it immediately after the `=>`.", + unexpectedSingleBlock: "Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`.", + expectedBlock: "Expected block statement surrounding arrow body." + } + }, + + create(context) { + const options = context.options; + const always = options[0] === "always"; + const asNeeded = !options[0] || options[0] === "as-needed"; + const never = options[0] === "never"; + const requireReturnForObjectLiteral = options[1] && options[1].requireReturnForObjectLiteral; + const sourceCode = context.getSourceCode(); + let funcInfo = null; + + /** + * Checks whether the given node has ASI problem or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if it changes semantics if `;` or `}` followed by the token are removed. + */ + function hasASIProblem(token) { + return token && token.type === "Punctuator" && /^[([/`+-]/u.test(token.value); + } + + /** + * Gets the closing parenthesis which is the pair of the given opening parenthesis. + * @param {Token} token The opening parenthesis token to get. + * @returns {Token} The found closing parenthesis token. + */ + function findClosingParen(token) { + let node = sourceCode.getNodeByRangeIndex(token.range[0]); + + while (!astUtils.isParenthesised(sourceCode, node)) { + node = node.parent; + } + return sourceCode.getTokenAfter(node); + } + + /** + * Check whether the node is inside of a for loop's init + * @param {ASTNode} node node is inside for loop + * @returns {boolean} `true` if the node is inside of a for loop, else `false` + */ + function isInsideForLoopInitializer(node) { + if (node && node.parent) { + if (node.parent.type === "ForStatement" && node.parent.init === node) { + return true; + } + return isInsideForLoopInitializer(node.parent); + } + return false; + } + + /** + * Determines whether a arrow function body needs braces + * @param {ASTNode} node The arrow function node. + * @returns {void} + */ + function validate(node) { + const arrowBody = node.body; + + if (arrowBody.type === "BlockStatement") { + const blockBody = arrowBody.body; + + if (blockBody.length !== 1 && !never) { + return; + } + + if (asNeeded && requireReturnForObjectLiteral && blockBody[0].type === "ReturnStatement" && + blockBody[0].argument && blockBody[0].argument.type === "ObjectExpression") { + return; + } + + if (never || asNeeded && blockBody[0].type === "ReturnStatement") { + let messageId; + + if (blockBody.length === 0) { + messageId = "unexpectedEmptyBlock"; + } else if (blockBody.length > 1) { + messageId = "unexpectedOtherBlock"; + } else if (blockBody[0].argument === null) { + messageId = "unexpectedSingleBlock"; + } else if (astUtils.isOpeningBraceToken(sourceCode.getFirstToken(blockBody[0], { skip: 1 }))) { + messageId = "unexpectedObjectBlock"; + } else { + messageId = "unexpectedSingleBlock"; + } + + context.report({ + node, + loc: arrowBody.loc, + messageId, + fix(fixer) { + const fixes = []; + + if (blockBody.length !== 1 || + blockBody[0].type !== "ReturnStatement" || + !blockBody[0].argument || + hasASIProblem(sourceCode.getTokenAfter(arrowBody)) + ) { + return fixes; + } + + const openingBrace = sourceCode.getFirstToken(arrowBody); + const closingBrace = sourceCode.getLastToken(arrowBody); + const firstValueToken = sourceCode.getFirstToken(blockBody[0], 1); + const lastValueToken = sourceCode.getLastToken(blockBody[0]); + const commentsExist = + sourceCode.commentsExistBetween(openingBrace, firstValueToken) || + sourceCode.commentsExistBetween(lastValueToken, closingBrace); + + /* + * Remove tokens around the return value. + * If comments don't exist, remove extra spaces as well. + */ + if (commentsExist) { + fixes.push( + fixer.remove(openingBrace), + fixer.remove(closingBrace), + fixer.remove(sourceCode.getTokenAfter(openingBrace)) // return keyword + ); + } else { + fixes.push( + fixer.removeRange([openingBrace.range[0], firstValueToken.range[0]]), + fixer.removeRange([lastValueToken.range[1], closingBrace.range[1]]) + ); + } + + /* + * If the first token of the reutrn value is `{` or the return value is a sequence expression, + * enclose the return value by parentheses to avoid syntax error. + */ + if (astUtils.isOpeningBraceToken(firstValueToken) || blockBody[0].argument.type === "SequenceExpression" || (funcInfo.hasInOperator && isInsideForLoopInitializer(node))) { + if (!astUtils.isParenthesised(sourceCode, blockBody[0].argument)) { + fixes.push( + fixer.insertTextBefore(firstValueToken, "("), + fixer.insertTextAfter(lastValueToken, ")") + ); + } + } + + /* + * If the last token of the return statement is semicolon, remove it. + * Non-block arrow body is an expression, not a statement. + */ + if (astUtils.isSemicolonToken(lastValueToken)) { + fixes.push(fixer.remove(lastValueToken)); + } + + return fixes; + } + }); + } + } else { + if (always || (asNeeded && requireReturnForObjectLiteral && arrowBody.type === "ObjectExpression")) { + context.report({ + node, + loc: arrowBody.loc, + messageId: "expectedBlock", + fix(fixer) { + const fixes = []; + const arrowToken = sourceCode.getTokenBefore(arrowBody, astUtils.isArrowToken); + const [firstTokenAfterArrow, secondTokenAfterArrow] = sourceCode.getTokensAfter(arrowToken, { count: 2 }); + const lastToken = sourceCode.getLastToken(node); + const isParenthesisedObjectLiteral = + astUtils.isOpeningParenToken(firstTokenAfterArrow) && + astUtils.isOpeningBraceToken(secondTokenAfterArrow); + + // If the value is object literal, remove parentheses which were forced by syntax. + if (isParenthesisedObjectLiteral) { + const openingParenToken = firstTokenAfterArrow; + const openingBraceToken = secondTokenAfterArrow; + + if (astUtils.isTokenOnSameLine(openingParenToken, openingBraceToken)) { + fixes.push(fixer.replaceText(openingParenToken, "{return ")); + } else { + + // Avoid ASI + fixes.push( + fixer.replaceText(openingParenToken, "{"), + fixer.insertTextBefore(openingBraceToken, "return ") + ); + } + + // Closing paren for the object doesn't have to be lastToken, e.g.: () => ({}).foo() + fixes.push(fixer.remove(findClosingParen(openingBraceToken))); + fixes.push(fixer.insertTextAfter(lastToken, "}")); + + } else { + fixes.push(fixer.insertTextBefore(firstTokenAfterArrow, "{return ")); + fixes.push(fixer.insertTextAfter(lastToken, "}")); + } + + return fixes; + } + }); + } + } + } + + return { + "BinaryExpression[operator='in']"() { + let info = funcInfo; + + while (info) { + info.hasInOperator = true; + info = info.upper; + } + }, + ArrowFunctionExpression() { + funcInfo = { + upper: funcInfo, + hasInOperator: false + }; + }, + "ArrowFunctionExpression:exit"(node) { + validate(node); + funcInfo = funcInfo.upper; + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/arrow-parens.js b/node_modules/eslint/lib/rules/arrow-parens.js new file mode 100644 index 000000000..eaa1aab02 --- /dev/null +++ b/node_modules/eslint/lib/rules/arrow-parens.js @@ -0,0 +1,183 @@ +/** + * @fileoverview Rule to require parens in arrow function arguments. + * @author Jxck + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines if the given arrow function has block body. + * @param {ASTNode} node `ArrowFunctionExpression` node. + * @returns {boolean} `true` if the function has block body. + */ +function hasBlockBody(node) { + return node.body.type === "BlockStatement"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require parentheses around arrow function arguments", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/arrow-parens" + }, + + fixable: "code", + + schema: [ + { + enum: ["always", "as-needed"] + }, + { + type: "object", + properties: { + requireForBlockBody: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedParens: "Unexpected parentheses around single function argument.", + expectedParens: "Expected parentheses around arrow function argument.", + + unexpectedParensInline: "Unexpected parentheses around single function argument having a body with no curly braces.", + expectedParensBlock: "Expected parentheses around arrow function argument having a body with curly braces." + } + }, + + create(context) { + const asNeeded = context.options[0] === "as-needed"; + const requireForBlockBody = asNeeded && context.options[1] && context.options[1].requireForBlockBody === true; + + const sourceCode = context.getSourceCode(); + + /** + * Finds opening paren of parameters for the given arrow function, if it exists. + * It is assumed that the given arrow function has exactly one parameter. + * @param {ASTNode} node `ArrowFunctionExpression` node. + * @returns {Token|null} the opening paren, or `null` if the given arrow function doesn't have parens of parameters. + */ + function findOpeningParenOfParams(node) { + const tokenBeforeParams = sourceCode.getTokenBefore(node.params[0]); + + if ( + tokenBeforeParams && + astUtils.isOpeningParenToken(tokenBeforeParams) && + node.range[0] <= tokenBeforeParams.range[0] + ) { + return tokenBeforeParams; + } + + return null; + } + + /** + * Finds closing paren of parameters for the given arrow function. + * It is assumed that the given arrow function has parens of parameters and that it has exactly one parameter. + * @param {ASTNode} node `ArrowFunctionExpression` node. + * @returns {Token} the closing paren of parameters. + */ + function getClosingParenOfParams(node) { + return sourceCode.getTokenAfter(node.params[0], astUtils.isClosingParenToken); + } + + /** + * Determines whether the given arrow function has comments inside parens of parameters. + * It is assumed that the given arrow function has parens of parameters. + * @param {ASTNode} node `ArrowFunctionExpression` node. + * @param {Token} openingParen Opening paren of parameters. + * @returns {boolean} `true` if the function has at least one comment inside of parens of parameters. + */ + function hasCommentsInParensOfParams(node, openingParen) { + return sourceCode.commentsExistBetween(openingParen, getClosingParenOfParams(node)); + } + + /** + * Determines whether the given arrow function has unexpected tokens before opening paren of parameters, + * in which case it will be assumed that the existing parens of parameters are necessary. + * Only tokens within the range of the arrow function (tokens that are part of the arrow function) are taken into account. + * Example: (a) => b + * @param {ASTNode} node `ArrowFunctionExpression` node. + * @param {Token} openingParen Opening paren of parameters. + * @returns {boolean} `true` if the function has at least one unexpected token. + */ + function hasUnexpectedTokensBeforeOpeningParen(node, openingParen) { + const expectedCount = node.async ? 1 : 0; + + return sourceCode.getFirstToken(node, { skip: expectedCount }) !== openingParen; + } + + return { + "ArrowFunctionExpression[params.length=1]"(node) { + const shouldHaveParens = !asNeeded || requireForBlockBody && hasBlockBody(node); + const openingParen = findOpeningParenOfParams(node); + const hasParens = openingParen !== null; + const [param] = node.params; + + if (shouldHaveParens && !hasParens) { + context.report({ + node, + messageId: requireForBlockBody ? "expectedParensBlock" : "expectedParens", + loc: param.loc, + *fix(fixer) { + yield fixer.insertTextBefore(param, "("); + yield fixer.insertTextAfter(param, ")"); + } + }); + } + + if ( + !shouldHaveParens && + hasParens && + param.type === "Identifier" && + !param.typeAnnotation && + !node.returnType && + !hasCommentsInParensOfParams(node, openingParen) && + !hasUnexpectedTokensBeforeOpeningParen(node, openingParen) + ) { + context.report({ + node, + messageId: requireForBlockBody ? "unexpectedParensInline" : "unexpectedParens", + loc: param.loc, + *fix(fixer) { + const tokenBeforeOpeningParen = sourceCode.getTokenBefore(openingParen); + const closingParen = getClosingParenOfParams(node); + + if ( + tokenBeforeOpeningParen && + tokenBeforeOpeningParen.range[1] === openingParen.range[0] && + !astUtils.canTokensBeAdjacent(tokenBeforeOpeningParen, sourceCode.getFirstToken(param)) + ) { + yield fixer.insertTextBefore(openingParen, " "); + } + + // remove parens, whitespace inside parens, and possible trailing comma + yield fixer.removeRange([openingParen.range[0], param.range[0]]); + yield fixer.removeRange([param.range[1], closingParen.range[1]]); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/arrow-spacing.js b/node_modules/eslint/lib/rules/arrow-spacing.js new file mode 100644 index 000000000..e5110c6c8 --- /dev/null +++ b/node_modules/eslint/lib/rules/arrow-spacing.js @@ -0,0 +1,161 @@ +/** + * @fileoverview Rule to define spacing before/after arrow function's arrow. + * @author Jxck + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing before and after the arrow in arrow functions", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/arrow-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + before: { + type: "boolean", + default: true + }, + after: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + expectedBefore: "Missing space before =>.", + unexpectedBefore: "Unexpected space before =>.", + + expectedAfter: "Missing space after =>.", + unexpectedAfter: "Unexpected space after =>." + } + }, + + create(context) { + + // merge rules with default + const rule = Object.assign({}, context.options[0]); + + rule.before = rule.before !== false; + rule.after = rule.after !== false; + + const sourceCode = context.getSourceCode(); + + /** + * Get tokens of arrow(`=>`) and before/after arrow. + * @param {ASTNode} node The arrow function node. + * @returns {Object} Tokens of arrow and before/after arrow. + */ + function getTokens(node) { + const arrow = sourceCode.getTokenBefore(node.body, astUtils.isArrowToken); + + return { + before: sourceCode.getTokenBefore(arrow), + arrow, + after: sourceCode.getTokenAfter(arrow) + }; + } + + /** + * Count spaces before/after arrow(`=>`) token. + * @param {Object} tokens Tokens before/after arrow. + * @returns {Object} count of space before/after arrow. + */ + function countSpaces(tokens) { + const before = tokens.arrow.range[0] - tokens.before.range[1]; + const after = tokens.after.range[0] - tokens.arrow.range[1]; + + return { before, after }; + } + + /** + * Determines whether space(s) before after arrow(`=>`) is satisfy rule. + * if before/after value is `true`, there should be space(s). + * if before/after value is `false`, there should be no space. + * @param {ASTNode} node The arrow function node. + * @returns {void} + */ + function spaces(node) { + const tokens = getTokens(node); + const countSpace = countSpaces(tokens); + + if (rule.before) { + + // should be space(s) before arrow + if (countSpace.before === 0) { + context.report({ + node: tokens.before, + messageId: "expectedBefore", + fix(fixer) { + return fixer.insertTextBefore(tokens.arrow, " "); + } + }); + } + } else { + + // should be no space before arrow + if (countSpace.before > 0) { + context.report({ + node: tokens.before, + messageId: "unexpectedBefore", + fix(fixer) { + return fixer.removeRange([tokens.before.range[1], tokens.arrow.range[0]]); + } + }); + } + } + + if (rule.after) { + + // should be space(s) after arrow + if (countSpace.after === 0) { + context.report({ + node: tokens.after, + messageId: "expectedAfter", + fix(fixer) { + return fixer.insertTextAfter(tokens.arrow, " "); + } + }); + } + } else { + + // should be no space after arrow + if (countSpace.after > 0) { + context.report({ + node: tokens.after, + messageId: "unexpectedAfter", + fix(fixer) { + return fixer.removeRange([tokens.arrow.range[1], tokens.after.range[0]]); + } + }); + } + } + } + + return { + ArrowFunctionExpression: spaces + }; + } +}; diff --git a/node_modules/eslint/lib/rules/block-scoped-var.js b/node_modules/eslint/lib/rules/block-scoped-var.js new file mode 100644 index 000000000..481057ba6 --- /dev/null +++ b/node_modules/eslint/lib/rules/block-scoped-var.js @@ -0,0 +1,122 @@ +/** + * @fileoverview Rule to check for "block scoped" variables by binding context + * @author Matt DuVall + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce the use of variables within the scope they are defined", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/block-scoped-var" + }, + + schema: [], + + messages: { + outOfScope: "'{{name}}' used outside of binding context." + } + }, + + create(context) { + let stack = []; + + /** + * Makes a block scope. + * @param {ASTNode} node A node of a scope. + * @returns {void} + */ + function enterScope(node) { + stack.push(node.range); + } + + /** + * Pops the last block scope. + * @returns {void} + */ + function exitScope() { + stack.pop(); + } + + /** + * Reports a given reference. + * @param {eslint-scope.Reference} reference A reference to report. + * @returns {void} + */ + function report(reference) { + const identifier = reference.identifier; + + context.report({ node: identifier, messageId: "outOfScope", data: { name: identifier.name } }); + } + + /** + * Finds and reports references which are outside of valid scopes. + * @param {ASTNode} node A node to get variables. + * @returns {void} + */ + function checkForVariables(node) { + if (node.kind !== "var") { + return; + } + + // Defines a predicate to check whether or not a given reference is outside of valid scope. + const scopeRange = stack[stack.length - 1]; + + /** + * Check if a reference is out of scope + * @param {ASTNode} reference node to examine + * @returns {boolean} True is its outside the scope + * @private + */ + function isOutsideOfScope(reference) { + const idRange = reference.identifier.range; + + return idRange[0] < scopeRange[0] || idRange[1] > scopeRange[1]; + } + + // Gets declared variables, and checks its references. + const variables = context.getDeclaredVariables(node); + + for (let i = 0; i < variables.length; ++i) { + + // Reports. + variables[i] + .references + .filter(isOutsideOfScope) + .forEach(report); + } + } + + return { + Program(node) { + stack = [node.range]; + }, + + // Manages scopes. + BlockStatement: enterScope, + "BlockStatement:exit": exitScope, + ForStatement: enterScope, + "ForStatement:exit": exitScope, + ForInStatement: enterScope, + "ForInStatement:exit": exitScope, + ForOfStatement: enterScope, + "ForOfStatement:exit": exitScope, + SwitchStatement: enterScope, + "SwitchStatement:exit": exitScope, + CatchClause: enterScope, + "CatchClause:exit": exitScope, + + // Finds and reports references which are outside of valid scope. + VariableDeclaration: checkForVariables + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/block-spacing.js b/node_modules/eslint/lib/rules/block-spacing.js new file mode 100644 index 000000000..c4b30b0b7 --- /dev/null +++ b/node_modules/eslint/lib/rules/block-spacing.js @@ -0,0 +1,164 @@ +/** + * @fileoverview A rule to disallow or enforce spaces inside of single line blocks. + * @author Toru Nagashima + */ + +"use strict"; + +const util = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow or enforce spaces inside of blocks after opening block and before closing block", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/block-spacing" + }, + + fixable: "whitespace", + + schema: [ + { enum: ["always", "never"] } + ], + + messages: { + missing: "Requires a space {{location}} '{{token}}'.", + extra: "Unexpected space(s) {{location}} '{{token}}'." + } + }, + + create(context) { + const always = (context.options[0] !== "never"), + messageId = always ? "missing" : "extra", + sourceCode = context.getSourceCode(); + + /** + * Gets the open brace token from a given node. + * @param {ASTNode} node A BlockStatement/SwitchStatement node to get. + * @returns {Token} The token of the open brace. + */ + function getOpenBrace(node) { + if (node.type === "SwitchStatement") { + if (node.cases.length > 0) { + return sourceCode.getTokenBefore(node.cases[0]); + } + return sourceCode.getLastToken(node, 1); + } + return sourceCode.getFirstToken(node); + } + + /** + * Checks whether or not: + * - given tokens are on same line. + * - there is/isn't a space between given tokens. + * @param {Token} left A token to check. + * @param {Token} right The token which is next to `left`. + * @returns {boolean} + * When the option is `"always"`, `true` if there are one or more spaces between given tokens. + * When the option is `"never"`, `true` if there are not any spaces between given tokens. + * If given tokens are not on same line, it's always `true`. + */ + function isValid(left, right) { + return ( + !util.isTokenOnSameLine(left, right) || + sourceCode.isSpaceBetweenTokens(left, right) === always + ); + } + + /** + * Reports invalid spacing style inside braces. + * @param {ASTNode} node A BlockStatement/SwitchStatement node to get. + * @returns {void} + */ + function checkSpacingInsideBraces(node) { + + // Gets braces and the first/last token of content. + const openBrace = getOpenBrace(node); + const closeBrace = sourceCode.getLastToken(node); + const firstToken = sourceCode.getTokenAfter(openBrace, { includeComments: true }); + const lastToken = sourceCode.getTokenBefore(closeBrace, { includeComments: true }); + + // Skip if the node is invalid or empty. + if (openBrace.type !== "Punctuator" || + openBrace.value !== "{" || + closeBrace.type !== "Punctuator" || + closeBrace.value !== "}" || + firstToken === closeBrace + ) { + return; + } + + // Skip line comments for option never + if (!always && firstToken.type === "Line") { + return; + } + + // Check. + if (!isValid(openBrace, firstToken)) { + let loc = openBrace.loc; + + if (messageId === "extra") { + loc = { + start: openBrace.loc.end, + end: firstToken.loc.start + }; + } + + context.report({ + node, + loc, + messageId, + data: { + location: "after", + token: openBrace.value + }, + fix(fixer) { + if (always) { + return fixer.insertTextBefore(firstToken, " "); + } + + return fixer.removeRange([openBrace.range[1], firstToken.range[0]]); + } + }); + } + if (!isValid(lastToken, closeBrace)) { + let loc = closeBrace.loc; + + if (messageId === "extra") { + loc = { + start: lastToken.loc.end, + end: closeBrace.loc.start + }; + } + context.report({ + node, + loc, + messageId, + data: { + location: "before", + token: closeBrace.value + }, + fix(fixer) { + if (always) { + return fixer.insertTextAfter(lastToken, " "); + } + + return fixer.removeRange([lastToken.range[1], closeBrace.range[0]]); + } + }); + } + } + + return { + BlockStatement: checkSpacingInsideBraces, + SwitchStatement: checkSpacingInsideBraces + }; + } +}; diff --git a/node_modules/eslint/lib/rules/brace-style.js b/node_modules/eslint/lib/rules/brace-style.js new file mode 100644 index 000000000..07223d10d --- /dev/null +++ b/node_modules/eslint/lib/rules/brace-style.js @@ -0,0 +1,188 @@ +/** + * @fileoverview Rule to flag block statements that do not use the one true brace style + * @author Ian Christian Myers + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent brace style for blocks", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/brace-style" + }, + + schema: [ + { + enum: ["1tbs", "stroustrup", "allman"] + }, + { + type: "object", + properties: { + allowSingleLine: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + fixable: "whitespace", + + messages: { + nextLineOpen: "Opening curly brace does not appear on the same line as controlling statement.", + sameLineOpen: "Opening curly brace appears on the same line as controlling statement.", + blockSameLine: "Statement inside of curly braces should be on next line.", + nextLineClose: "Closing curly brace does not appear on the same line as the subsequent block.", + singleLineClose: "Closing curly brace should be on the same line as opening curly brace or on the line after the previous block.", + sameLineClose: "Closing curly brace appears on the same line as the subsequent block." + } + }, + + create(context) { + const style = context.options[0] || "1tbs", + params = context.options[1] || {}, + sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Fixes a place where a newline unexpectedly appears + * @param {Token} firstToken The token before the unexpected newline + * @param {Token} secondToken The token after the unexpected newline + * @returns {Function} A fixer function to remove the newlines between the tokens + */ + function removeNewlineBetween(firstToken, secondToken) { + const textRange = [firstToken.range[1], secondToken.range[0]]; + const textBetween = sourceCode.text.slice(textRange[0], textRange[1]); + + // Don't do a fix if there is a comment between the tokens + if (textBetween.trim()) { + return null; + } + return fixer => fixer.replaceTextRange(textRange, " "); + } + + /** + * Validates a pair of curly brackets based on the user's config + * @param {Token} openingCurly The opening curly bracket + * @param {Token} closingCurly The closing curly bracket + * @returns {void} + */ + function validateCurlyPair(openingCurly, closingCurly) { + const tokenBeforeOpeningCurly = sourceCode.getTokenBefore(openingCurly); + const tokenAfterOpeningCurly = sourceCode.getTokenAfter(openingCurly); + const tokenBeforeClosingCurly = sourceCode.getTokenBefore(closingCurly); + const singleLineException = params.allowSingleLine && astUtils.isTokenOnSameLine(openingCurly, closingCurly); + + if (style !== "allman" && !astUtils.isTokenOnSameLine(tokenBeforeOpeningCurly, openingCurly)) { + context.report({ + node: openingCurly, + messageId: "nextLineOpen", + fix: removeNewlineBetween(tokenBeforeOpeningCurly, openingCurly) + }); + } + + if (style === "allman" && astUtils.isTokenOnSameLine(tokenBeforeOpeningCurly, openingCurly) && !singleLineException) { + context.report({ + node: openingCurly, + messageId: "sameLineOpen", + fix: fixer => fixer.insertTextBefore(openingCurly, "\n") + }); + } + + if (astUtils.isTokenOnSameLine(openingCurly, tokenAfterOpeningCurly) && tokenAfterOpeningCurly !== closingCurly && !singleLineException) { + context.report({ + node: openingCurly, + messageId: "blockSameLine", + fix: fixer => fixer.insertTextAfter(openingCurly, "\n") + }); + } + + if (tokenBeforeClosingCurly !== openingCurly && !singleLineException && astUtils.isTokenOnSameLine(tokenBeforeClosingCurly, closingCurly)) { + context.report({ + node: closingCurly, + messageId: "singleLineClose", + fix: fixer => fixer.insertTextBefore(closingCurly, "\n") + }); + } + } + + /** + * Validates the location of a token that appears before a keyword (e.g. a newline before `else`) + * @param {Token} curlyToken The closing curly token. This is assumed to precede a keyword token (such as `else` or `finally`). + * @returns {void} + */ + function validateCurlyBeforeKeyword(curlyToken) { + const keywordToken = sourceCode.getTokenAfter(curlyToken); + + if (style === "1tbs" && !astUtils.isTokenOnSameLine(curlyToken, keywordToken)) { + context.report({ + node: curlyToken, + messageId: "nextLineClose", + fix: removeNewlineBetween(curlyToken, keywordToken) + }); + } + + if (style !== "1tbs" && astUtils.isTokenOnSameLine(curlyToken, keywordToken)) { + context.report({ + node: curlyToken, + messageId: "sameLineClose", + fix: fixer => fixer.insertTextAfter(curlyToken, "\n") + }); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + BlockStatement(node) { + if (!astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type)) { + validateCurlyPair(sourceCode.getFirstToken(node), sourceCode.getLastToken(node)); + } + }, + ClassBody(node) { + validateCurlyPair(sourceCode.getFirstToken(node), sourceCode.getLastToken(node)); + }, + SwitchStatement(node) { + const closingCurly = sourceCode.getLastToken(node); + const openingCurly = sourceCode.getTokenBefore(node.cases.length ? node.cases[0] : closingCurly); + + validateCurlyPair(openingCurly, closingCurly); + }, + IfStatement(node) { + if (node.consequent.type === "BlockStatement" && node.alternate) { + + // Handle the keyword after the `if` block (before `else`) + validateCurlyBeforeKeyword(sourceCode.getLastToken(node.consequent)); + } + }, + TryStatement(node) { + + // Handle the keyword after the `try` block (before `catch` or `finally`) + validateCurlyBeforeKeyword(sourceCode.getLastToken(node.block)); + + if (node.handler && node.finalizer) { + + // Handle the keyword after the `catch` block (before `finally`) + validateCurlyBeforeKeyword(sourceCode.getLastToken(node.handler.body)); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/callback-return.js b/node_modules/eslint/lib/rules/callback-return.js new file mode 100644 index 000000000..ba13c9a64 --- /dev/null +++ b/node_modules/eslint/lib/rules/callback-return.js @@ -0,0 +1,186 @@ +/** + * @fileoverview Enforce return after a callback. + * @author Jamund Ferguson + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "require `return` statements after callbacks", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/callback-return" + }, + + schema: [{ + type: "array", + items: { type: "string" } + }], + + messages: { + missingReturn: "Expected return with your callback function." + } + }, + + create(context) { + + const callbacks = context.options[0] || ["callback", "cb", "next"], + sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Find the closest parent matching a list of types. + * @param {ASTNode} node The node whose parents we are searching + * @param {Array} types The node types to match + * @returns {ASTNode} The matched node or undefined. + */ + function findClosestParentOfType(node, types) { + if (!node.parent) { + return null; + } + if (types.indexOf(node.parent.type) === -1) { + return findClosestParentOfType(node.parent, types); + } + return node.parent; + } + + /** + * Check to see if a node contains only identifers + * @param {ASTNode} node The node to check + * @returns {boolean} Whether or not the node contains only identifers + */ + function containsOnlyIdentifiers(node) { + if (node.type === "Identifier") { + return true; + } + + if (node.type === "MemberExpression") { + if (node.object.type === "Identifier") { + return true; + } + if (node.object.type === "MemberExpression") { + return containsOnlyIdentifiers(node.object); + } + } + + return false; + } + + /** + * Check to see if a CallExpression is in our callback list. + * @param {ASTNode} node The node to check against our callback names list. + * @returns {boolean} Whether or not this function matches our callback name. + */ + function isCallback(node) { + return containsOnlyIdentifiers(node.callee) && callbacks.indexOf(sourceCode.getText(node.callee)) > -1; + } + + /** + * Determines whether or not the callback is part of a callback expression. + * @param {ASTNode} node The callback node + * @param {ASTNode} parentNode The expression node + * @returns {boolean} Whether or not this is part of a callback expression + */ + function isCallbackExpression(node, parentNode) { + + // ensure the parent node exists and is an expression + if (!parentNode || parentNode.type !== "ExpressionStatement") { + return false; + } + + // cb() + if (parentNode.expression === node) { + return true; + } + + // special case for cb && cb() and similar + if (parentNode.expression.type === "BinaryExpression" || parentNode.expression.type === "LogicalExpression") { + if (parentNode.expression.right === node) { + return true; + } + } + + return false; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + CallExpression(node) { + + // if we're not a callback we can return + if (!isCallback(node)) { + return; + } + + // find the closest block, return or loop + const closestBlock = findClosestParentOfType(node, ["BlockStatement", "ReturnStatement", "ArrowFunctionExpression"]) || {}; + + // if our parent is a return we know we're ok + if (closestBlock.type === "ReturnStatement") { + return; + } + + // arrow functions don't always have blocks and implicitly return + if (closestBlock.type === "ArrowFunctionExpression") { + return; + } + + // block statements are part of functions and most if statements + if (closestBlock.type === "BlockStatement") { + + // find the last item in the block + const lastItem = closestBlock.body[closestBlock.body.length - 1]; + + // if the callback is the last thing in a block that might be ok + if (isCallbackExpression(node, lastItem)) { + + const parentType = closestBlock.parent.type; + + // but only if the block is part of a function + if (parentType === "FunctionExpression" || + parentType === "FunctionDeclaration" || + parentType === "ArrowFunctionExpression" + ) { + return; + } + + } + + // ending a block with a return is also ok + if (lastItem.type === "ReturnStatement") { + + // but only if the callback is immediately before + if (isCallbackExpression(node, closestBlock.body[closestBlock.body.length - 2])) { + return; + } + } + + } + + // as long as you're the child of a function at this point you should be asked to return + if (findClosestParentOfType(node, ["FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression"])) { + context.report({ node, messageId: "missingReturn" }); + } + + } + + }; + } +}; diff --git a/node_modules/eslint/lib/rules/camelcase.js b/node_modules/eslint/lib/rules/camelcase.js new file mode 100644 index 000000000..d34656cfa --- /dev/null +++ b/node_modules/eslint/lib/rules/camelcase.js @@ -0,0 +1,325 @@ +/** + * @fileoverview Rule to flag non-camelcased identifiers + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce camelcase naming convention", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/camelcase" + }, + + schema: [ + { + type: "object", + properties: { + ignoreDestructuring: { + type: "boolean", + default: false + }, + ignoreImports: { + type: "boolean", + default: false + }, + ignoreGlobals: { + type: "boolean", + default: false + }, + properties: { + enum: ["always", "never"] + }, + allow: { + type: "array", + items: [ + { + type: "string" + } + ], + minItems: 0, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + notCamelCase: "Identifier '{{name}}' is not in camel case." + } + }, + + create(context) { + + const options = context.options[0] || {}; + let properties = options.properties || ""; + const ignoreDestructuring = options.ignoreDestructuring; + const ignoreImports = options.ignoreImports; + const ignoreGlobals = options.ignoreGlobals; + const allow = options.allow || []; + + let globalScope; + + if (properties !== "always" && properties !== "never") { + properties = "always"; + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // contains reported nodes to avoid reporting twice on destructuring with shorthand notation + const reported = []; + const ALLOWED_PARENT_TYPES = new Set(["CallExpression", "NewExpression"]); + + /** + * Checks if a string contains an underscore and isn't all upper-case + * @param {string} name The string to check. + * @returns {boolean} if the string is underscored + * @private + */ + function isUnderscored(name) { + + // if there's an underscore, it might be A_CONSTANT, which is okay + return name.includes("_") && name !== name.toUpperCase(); + } + + /** + * Checks if a string match the ignore list + * @param {string} name The string to check. + * @returns {boolean} if the string is ignored + * @private + */ + function isAllowed(name) { + return allow.some( + entry => name === entry || name.match(new RegExp(entry, "u")) + ); + } + + /** + * Checks if a parent of a node is an ObjectPattern. + * @param {ASTNode} node The node to check. + * @returns {boolean} if the node is inside an ObjectPattern + * @private + */ + function isInsideObjectPattern(node) { + let current = node; + + while (current) { + const parent = current.parent; + + if (parent && parent.type === "Property" && parent.computed && parent.key === current) { + return false; + } + + if (current.type === "ObjectPattern") { + return true; + } + + current = parent; + } + + return false; + } + + /** + * Checks whether the given node represents assignment target property in destructuring. + * + * For examples: + * ({a: b.foo} = c); // => true for `foo` + * ([a.foo] = b); // => true for `foo` + * ([a.foo = 1] = b); // => true for `foo` + * ({...a.foo} = b); // => true for `foo` + * @param {ASTNode} node An Identifier node to check + * @returns {boolean} True if the node is an assignment target property in destructuring. + */ + function isAssignmentTargetPropertyInDestructuring(node) { + if ( + node.parent.type === "MemberExpression" && + node.parent.property === node && + !node.parent.computed + ) { + const effectiveParent = node.parent.parent; + + return ( + effectiveParent.type === "Property" && + effectiveParent.value === node.parent && + effectiveParent.parent.type === "ObjectPattern" || + effectiveParent.type === "ArrayPattern" || + effectiveParent.type === "RestElement" || + ( + effectiveParent.type === "AssignmentPattern" && + effectiveParent.left === node.parent + ) + ); + } + return false; + } + + /** + * Checks whether the given node represents a reference to a global variable that is not declared in the source code. + * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a reference to a global variable. + */ + function isReferenceToGlobalVariable(node) { + const variable = globalScope.set.get(node.name); + + return variable && variable.defs.length === 0 && + variable.references.some(ref => ref.identifier === node); + } + + /** + * Checks whether the given node represents a reference to a property of an object in an object literal expression. + * This allows to differentiate between a global variable that is allowed to be used as a reference, and the key + * of the expressed object (which shouldn't be allowed). + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a property name of an object literal expression + */ + function isPropertyNameInObjectLiteral(node) { + const parent = node.parent; + + return ( + parent.type === "Property" && + parent.parent.type === "ObjectExpression" && + !parent.computed && + parent.key === node + ); + } + + /** + * Reports an AST node as a rule violation. + * @param {ASTNode} node The node to report. + * @returns {void} + * @private + */ + function report(node) { + if (!reported.includes(node)) { + reported.push(node); + context.report({ node, messageId: "notCamelCase", data: { name: node.name } }); + } + } + + return { + + Program() { + globalScope = context.getScope(); + }, + + Identifier(node) { + + /* + * Leading and trailing underscores are commonly used to flag + * private/protected identifiers, strip them before checking if underscored + */ + const name = node.name, + nameIsUnderscored = isUnderscored(name.replace(/^_+|_+$/gu, "")), + effectiveParent = (node.parent.type === "MemberExpression") ? node.parent.parent : node.parent; + + // First, we ignore the node if it match the ignore list + if (isAllowed(name)) { + return; + } + + // Check if it's a global variable + if (ignoreGlobals && isReferenceToGlobalVariable(node) && !isPropertyNameInObjectLiteral(node)) { + return; + } + + // MemberExpressions get special rules + if (node.parent.type === "MemberExpression") { + + // "never" check properties + if (properties === "never") { + return; + } + + // Always report underscored object names + if (node.parent.object.type === "Identifier" && node.parent.object.name === node.name && nameIsUnderscored) { + report(node); + + // Report AssignmentExpressions only if they are the left side of the assignment + } else if (effectiveParent.type === "AssignmentExpression" && nameIsUnderscored && (effectiveParent.right.type !== "MemberExpression" || effectiveParent.left.type === "MemberExpression" && effectiveParent.left.property.name === node.name)) { + report(node); + + } else if (isAssignmentTargetPropertyInDestructuring(node) && nameIsUnderscored) { + report(node); + } + + /* + * Properties have their own rules, and + * AssignmentPattern nodes can be treated like Properties: + * e.g.: const { no_camelcased = false } = bar; + */ + } else if (node.parent.type === "Property" || node.parent.type === "AssignmentPattern") { + + if (node.parent.parent && node.parent.parent.type === "ObjectPattern") { + if (node.parent.shorthand && node.parent.value.left && nameIsUnderscored) { + report(node); + } + + const assignmentKeyEqualsValue = node.parent.key.name === node.parent.value.name; + + if (nameIsUnderscored && node.parent.computed) { + report(node); + } + + // prevent checking righthand side of destructured object + if (node.parent.key === node && node.parent.value !== node) { + return; + } + + const valueIsUnderscored = node.parent.value.name && nameIsUnderscored; + + // ignore destructuring if the option is set, unless a new identifier is created + if (valueIsUnderscored && !(assignmentKeyEqualsValue && ignoreDestructuring)) { + report(node); + } + } + + // "never" check properties or always ignore destructuring + if (properties === "never" || (ignoreDestructuring && isInsideObjectPattern(node))) { + return; + } + + // don't check right hand side of AssignmentExpression to prevent duplicate warnings + if (nameIsUnderscored && !ALLOWED_PARENT_TYPES.has(effectiveParent.type) && !(node.parent.right === node)) { + report(node); + } + + // Check if it's an import specifier + } else if (["ImportSpecifier", "ImportNamespaceSpecifier", "ImportDefaultSpecifier"].includes(node.parent.type)) { + + if (node.parent.type === "ImportSpecifier" && ignoreImports) { + return; + } + + // Report only if the local imported identifier is underscored + if ( + node.parent.local && + node.parent.local.name === node.name && + nameIsUnderscored + ) { + report(node); + } + + // Report anything that is underscored that isn't a CallExpression + } else if (nameIsUnderscored && !ALLOWED_PARENT_TYPES.has(effectiveParent.type)) { + report(node); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/capitalized-comments.js b/node_modules/eslint/lib/rules/capitalized-comments.js new file mode 100644 index 000000000..d7524b878 --- /dev/null +++ b/node_modules/eslint/lib/rules/capitalized-comments.js @@ -0,0 +1,300 @@ +/** + * @fileoverview enforce or disallow capitalization of the first letter of a comment + * @author Kevin Partington + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const LETTER_PATTERN = require("./utils/patterns/letters"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const DEFAULT_IGNORE_PATTERN = astUtils.COMMENTS_IGNORE_PATTERN, + WHITESPACE = /\s/gu, + MAYBE_URL = /^\s*[^:/?#\s]+:\/\/[^?#]/u; // TODO: Combine w/ max-len pattern? + +/* + * Base schema body for defining the basic capitalization rule, ignorePattern, + * and ignoreInlineComments values. + * This can be used in a few different ways in the actual schema. + */ +const SCHEMA_BODY = { + type: "object", + properties: { + ignorePattern: { + type: "string" + }, + ignoreInlineComments: { + type: "boolean" + }, + ignoreConsecutiveComments: { + type: "boolean" + } + }, + additionalProperties: false +}; +const DEFAULTS = { + ignorePattern: "", + ignoreInlineComments: false, + ignoreConsecutiveComments: false +}; + +/** + * Get normalized options for either block or line comments from the given + * user-provided options. + * - If the user-provided options is just a string, returns a normalized + * set of options using default values for all other options. + * - If the user-provided options is an object, then a normalized option + * set is returned. Options specified in overrides will take priority + * over options specified in the main options object, which will in + * turn take priority over the rule's defaults. + * @param {Object|string} rawOptions The user-provided options. + * @param {string} which Either "line" or "block". + * @returns {Object} The normalized options. + */ +function getNormalizedOptions(rawOptions, which) { + return Object.assign({}, DEFAULTS, rawOptions[which] || rawOptions); +} + +/** + * Get normalized options for block and line comments. + * @param {Object|string} rawOptions The user-provided options. + * @returns {Object} An object with "Line" and "Block" keys and corresponding + * normalized options objects. + */ +function getAllNormalizedOptions(rawOptions = {}) { + return { + Line: getNormalizedOptions(rawOptions, "line"), + Block: getNormalizedOptions(rawOptions, "block") + }; +} + +/** + * Creates a regular expression for each ignorePattern defined in the rule + * options. + * + * This is done in order to avoid invoking the RegExp constructor repeatedly. + * @param {Object} normalizedOptions The normalized rule options. + * @returns {void} + */ +function createRegExpForIgnorePatterns(normalizedOptions) { + Object.keys(normalizedOptions).forEach(key => { + const ignorePatternStr = normalizedOptions[key].ignorePattern; + + if (ignorePatternStr) { + const regExp = RegExp(`^\\s*(?:${ignorePatternStr})`, "u"); + + normalizedOptions[key].ignorePatternRegExp = regExp; + } + }); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce or disallow capitalization of the first letter of a comment", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/capitalized-comments" + }, + + fixable: "code", + + schema: [ + { enum: ["always", "never"] }, + { + oneOf: [ + SCHEMA_BODY, + { + type: "object", + properties: { + line: SCHEMA_BODY, + block: SCHEMA_BODY + }, + additionalProperties: false + } + ] + } + ], + + messages: { + unexpectedLowercaseComment: "Comments should not begin with a lowercase character.", + unexpectedUppercaseComment: "Comments should not begin with an uppercase character." + } + }, + + create(context) { + + const capitalize = context.options[0] || "always", + normalizedOptions = getAllNormalizedOptions(context.options[1]), + sourceCode = context.getSourceCode(); + + createRegExpForIgnorePatterns(normalizedOptions); + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Checks whether a comment is an inline comment. + * + * For the purpose of this rule, a comment is inline if: + * 1. The comment is preceded by a token on the same line; and + * 2. The command is followed by a token on the same line. + * + * Note that the comment itself need not be single-line! + * + * Also, it follows from this definition that only block comments can + * be considered as possibly inline. This is because line comments + * would consume any following tokens on the same line as the comment. + * @param {ASTNode} comment The comment node to check. + * @returns {boolean} True if the comment is an inline comment, false + * otherwise. + */ + function isInlineComment(comment) { + const previousToken = sourceCode.getTokenBefore(comment, { includeComments: true }), + nextToken = sourceCode.getTokenAfter(comment, { includeComments: true }); + + return Boolean( + previousToken && + nextToken && + comment.loc.start.line === previousToken.loc.end.line && + comment.loc.end.line === nextToken.loc.start.line + ); + } + + /** + * Determine if a comment follows another comment. + * @param {ASTNode} comment The comment to check. + * @returns {boolean} True if the comment follows a valid comment. + */ + function isConsecutiveComment(comment) { + const previousTokenOrComment = sourceCode.getTokenBefore(comment, { includeComments: true }); + + return Boolean( + previousTokenOrComment && + ["Block", "Line"].indexOf(previousTokenOrComment.type) !== -1 + ); + } + + /** + * Check a comment to determine if it is valid for this rule. + * @param {ASTNode} comment The comment node to process. + * @param {Object} options The options for checking this comment. + * @returns {boolean} True if the comment is valid, false otherwise. + */ + function isCommentValid(comment, options) { + + // 1. Check for default ignore pattern. + if (DEFAULT_IGNORE_PATTERN.test(comment.value)) { + return true; + } + + // 2. Check for custom ignore pattern. + const commentWithoutAsterisks = comment.value + .replace(/\*/gu, ""); + + if (options.ignorePatternRegExp && options.ignorePatternRegExp.test(commentWithoutAsterisks)) { + return true; + } + + // 3. Check for inline comments. + if (options.ignoreInlineComments && isInlineComment(comment)) { + return true; + } + + // 4. Is this a consecutive comment (and are we tolerating those)? + if (options.ignoreConsecutiveComments && isConsecutiveComment(comment)) { + return true; + } + + // 5. Does the comment start with a possible URL? + if (MAYBE_URL.test(commentWithoutAsterisks)) { + return true; + } + + // 6. Is the initial word character a letter? + const commentWordCharsOnly = commentWithoutAsterisks + .replace(WHITESPACE, ""); + + if (commentWordCharsOnly.length === 0) { + return true; + } + + const firstWordChar = commentWordCharsOnly[0]; + + if (!LETTER_PATTERN.test(firstWordChar)) { + return true; + } + + // 7. Check the case of the initial word character. + const isUppercase = firstWordChar !== firstWordChar.toLocaleLowerCase(), + isLowercase = firstWordChar !== firstWordChar.toLocaleUpperCase(); + + if (capitalize === "always" && isLowercase) { + return false; + } + if (capitalize === "never" && isUppercase) { + return false; + } + + return true; + } + + /** + * Process a comment to determine if it needs to be reported. + * @param {ASTNode} comment The comment node to process. + * @returns {void} + */ + function processComment(comment) { + const options = normalizedOptions[comment.type], + commentValid = isCommentValid(comment, options); + + if (!commentValid) { + const messageId = capitalize === "always" + ? "unexpectedLowercaseComment" + : "unexpectedUppercaseComment"; + + context.report({ + node: null, // Intentionally using loc instead + loc: comment.loc, + messageId, + fix(fixer) { + const match = comment.value.match(LETTER_PATTERN); + + return fixer.replaceTextRange( + + // Offset match.index by 2 to account for the first 2 characters that start the comment (// or /*) + [comment.range[0] + match.index + 2, comment.range[0] + match.index + 3], + capitalize === "always" ? match[0].toLocaleUpperCase() : match[0].toLocaleLowerCase() + ); + } + }); + } + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + Program() { + const comments = sourceCode.getAllComments(); + + comments.filter(token => token.type !== "Shebang").forEach(processComment); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/class-methods-use-this.js b/node_modules/eslint/lib/rules/class-methods-use-this.js new file mode 100644 index 000000000..2cc5cc418 --- /dev/null +++ b/node_modules/eslint/lib/rules/class-methods-use-this.js @@ -0,0 +1,125 @@ +/** + * @fileoverview Rule to enforce that all class methods use 'this'. + * @author Patrick Williams + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce that class methods utilize `this`", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/class-methods-use-this" + }, + + schema: [{ + type: "object", + properties: { + exceptMethods: { + type: "array", + items: { + type: "string" + } + } + }, + additionalProperties: false + }], + + messages: { + missingThis: "Expected 'this' to be used by class {{name}}." + } + }, + create(context) { + const config = Object.assign({}, context.options[0]); + const exceptMethods = new Set(config.exceptMethods || []); + + const stack = []; + + /** + * Initializes the current context to false and pushes it onto the stack. + * These booleans represent whether 'this' has been used in the context. + * @returns {void} + * @private + */ + function enterFunction() { + stack.push(false); + } + + /** + * Check if the node is an instance method + * @param {ASTNode} node node to check + * @returns {boolean} True if its an instance method + * @private + */ + function isInstanceMethod(node) { + return !node.static && node.kind !== "constructor" && node.type === "MethodDefinition"; + } + + /** + * Check if the node is an instance method not excluded by config + * @param {ASTNode} node node to check + * @returns {boolean} True if it is an instance method, and not excluded by config + * @private + */ + function isIncludedInstanceMethod(node) { + return isInstanceMethod(node) && + (node.computed || !exceptMethods.has(node.key.name)); + } + + /** + * Checks if we are leaving a function that is a method, and reports if 'this' has not been used. + * Static methods and the constructor are exempt. + * Then pops the context off the stack. + * @param {ASTNode} node A function node that was entered. + * @returns {void} + * @private + */ + function exitFunction(node) { + const methodUsesThis = stack.pop(); + + if (isIncludedInstanceMethod(node.parent) && !methodUsesThis) { + context.report({ + node, + messageId: "missingThis", + data: { + name: astUtils.getFunctionNameWithKind(node) + } + }); + } + } + + /** + * Mark the current context as having used 'this'. + * @returns {void} + * @private + */ + function markThisUsed() { + if (stack.length) { + stack[stack.length - 1] = true; + } + } + + return { + FunctionDeclaration: enterFunction, + "FunctionDeclaration:exit": exitFunction, + FunctionExpression: enterFunction, + "FunctionExpression:exit": exitFunction, + ThisExpression: markThisUsed, + Super: markThisUsed + }; + } +}; diff --git a/node_modules/eslint/lib/rules/comma-dangle.js b/node_modules/eslint/lib/rules/comma-dangle.js new file mode 100644 index 000000000..e22b7f355 --- /dev/null +++ b/node_modules/eslint/lib/rules/comma-dangle.js @@ -0,0 +1,340 @@ +/** + * @fileoverview Rule to forbid or enforce dangling commas. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const DEFAULT_OPTIONS = Object.freeze({ + arrays: "never", + objects: "never", + imports: "never", + exports: "never", + functions: "never" +}); + +/** + * Checks whether or not a trailing comma is allowed in a given node. + * If the `lastItem` is `RestElement` or `RestProperty`, it disallows trailing commas. + * @param {ASTNode} lastItem The node of the last element in the given node. + * @returns {boolean} `true` if a trailing comma is allowed. + */ +function isTrailingCommaAllowed(lastItem) { + return !( + lastItem.type === "RestElement" || + lastItem.type === "RestProperty" || + lastItem.type === "ExperimentalRestProperty" + ); +} + +/** + * Normalize option value. + * @param {string|Object|undefined} optionValue The 1st option value to normalize. + * @param {number} ecmaVersion The normalized ECMAScript version. + * @returns {Object} The normalized option value. + */ +function normalizeOptions(optionValue, ecmaVersion) { + if (typeof optionValue === "string") { + return { + arrays: optionValue, + objects: optionValue, + imports: optionValue, + exports: optionValue, + functions: (!ecmaVersion || ecmaVersion < 8) ? "ignore" : optionValue + }; + } + if (typeof optionValue === "object" && optionValue !== null) { + return { + arrays: optionValue.arrays || DEFAULT_OPTIONS.arrays, + objects: optionValue.objects || DEFAULT_OPTIONS.objects, + imports: optionValue.imports || DEFAULT_OPTIONS.imports, + exports: optionValue.exports || DEFAULT_OPTIONS.exports, + functions: optionValue.functions || DEFAULT_OPTIONS.functions + }; + } + + return DEFAULT_OPTIONS; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow trailing commas", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/comma-dangle" + }, + + fixable: "code", + + schema: { + definitions: { + value: { + enum: [ + "always-multiline", + "always", + "never", + "only-multiline" + ] + }, + valueWithIgnore: { + enum: [ + "always-multiline", + "always", + "ignore", + "never", + "only-multiline" + ] + } + }, + type: "array", + items: [ + { + oneOf: [ + { + $ref: "#/definitions/value" + }, + { + type: "object", + properties: { + arrays: { $ref: "#/definitions/valueWithIgnore" }, + objects: { $ref: "#/definitions/valueWithIgnore" }, + imports: { $ref: "#/definitions/valueWithIgnore" }, + exports: { $ref: "#/definitions/valueWithIgnore" }, + functions: { $ref: "#/definitions/valueWithIgnore" } + }, + additionalProperties: false + } + ] + } + ] + }, + + messages: { + unexpected: "Unexpected trailing comma.", + missing: "Missing trailing comma." + } + }, + + create(context) { + const options = normalizeOptions(context.options[0], context.parserOptions.ecmaVersion); + + const sourceCode = context.getSourceCode(); + + /** + * Gets the last item of the given node. + * @param {ASTNode} node The node to get. + * @returns {ASTNode|null} The last node or null. + */ + function getLastItem(node) { + switch (node.type) { + case "ObjectExpression": + case "ObjectPattern": + return lodash.last(node.properties); + case "ArrayExpression": + case "ArrayPattern": + return lodash.last(node.elements); + case "ImportDeclaration": + case "ExportNamedDeclaration": + return lodash.last(node.specifiers); + case "FunctionDeclaration": + case "FunctionExpression": + case "ArrowFunctionExpression": + return lodash.last(node.params); + case "CallExpression": + case "NewExpression": + return lodash.last(node.arguments); + default: + return null; + } + } + + /** + * Gets the trailing comma token of the given node. + * If the trailing comma does not exist, this returns the token which is + * the insertion point of the trailing comma token. + * @param {ASTNode} node The node to get. + * @param {ASTNode} lastItem The last item of the node. + * @returns {Token} The trailing comma token or the insertion point. + */ + function getTrailingToken(node, lastItem) { + switch (node.type) { + case "ObjectExpression": + case "ArrayExpression": + case "CallExpression": + case "NewExpression": + return sourceCode.getLastToken(node, 1); + default: { + const nextToken = sourceCode.getTokenAfter(lastItem); + + if (astUtils.isCommaToken(nextToken)) { + return nextToken; + } + return sourceCode.getLastToken(lastItem); + } + } + } + + /** + * Checks whether or not a given node is multiline. + * This rule handles a given node as multiline when the closing parenthesis + * and the last element are not on the same line. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is multiline. + */ + function isMultiline(node) { + const lastItem = getLastItem(node); + + if (!lastItem) { + return false; + } + + const penultimateToken = getTrailingToken(node, lastItem); + const lastToken = sourceCode.getTokenAfter(penultimateToken); + + return lastToken.loc.end.line !== penultimateToken.loc.end.line; + } + + /** + * Reports a trailing comma if it exists. + * @param {ASTNode} node A node to check. Its type is one of + * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, + * ImportDeclaration, and ExportNamedDeclaration. + * @returns {void} + */ + function forbidTrailingComma(node) { + const lastItem = getLastItem(node); + + if (!lastItem || (node.type === "ImportDeclaration" && lastItem.type !== "ImportSpecifier")) { + return; + } + + const trailingToken = getTrailingToken(node, lastItem); + + if (astUtils.isCommaToken(trailingToken)) { + context.report({ + node: lastItem, + loc: trailingToken.loc, + messageId: "unexpected", + fix(fixer) { + return fixer.remove(trailingToken); + } + }); + } + } + + /** + * Reports the last element of a given node if it does not have a trailing + * comma. + * + * If a given node is `ArrayPattern` which has `RestElement`, the trailing + * comma is disallowed, so report if it exists. + * @param {ASTNode} node A node to check. Its type is one of + * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, + * ImportDeclaration, and ExportNamedDeclaration. + * @returns {void} + */ + function forceTrailingComma(node) { + const lastItem = getLastItem(node); + + if (!lastItem || (node.type === "ImportDeclaration" && lastItem.type !== "ImportSpecifier")) { + return; + } + if (!isTrailingCommaAllowed(lastItem)) { + forbidTrailingComma(node); + return; + } + + const trailingToken = getTrailingToken(node, lastItem); + + if (trailingToken.value !== ",") { + context.report({ + node: lastItem, + loc: { + start: trailingToken.loc.end, + end: astUtils.getNextLocation(sourceCode, trailingToken.loc.end) + }, + messageId: "missing", + fix(fixer) { + return fixer.insertTextAfter(trailingToken, ","); + } + }); + } + } + + /** + * If a given node is multiline, reports the last element of a given node + * when it does not have a trailing comma. + * Otherwise, reports a trailing comma if it exists. + * @param {ASTNode} node A node to check. Its type is one of + * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, + * ImportDeclaration, and ExportNamedDeclaration. + * @returns {void} + */ + function forceTrailingCommaIfMultiline(node) { + if (isMultiline(node)) { + forceTrailingComma(node); + } else { + forbidTrailingComma(node); + } + } + + /** + * Only if a given node is not multiline, reports the last element of a given node + * when it does not have a trailing comma. + * Otherwise, reports a trailing comma if it exists. + * @param {ASTNode} node A node to check. Its type is one of + * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, + * ImportDeclaration, and ExportNamedDeclaration. + * @returns {void} + */ + function allowTrailingCommaIfMultiline(node) { + if (!isMultiline(node)) { + forbidTrailingComma(node); + } + } + + const predicate = { + always: forceTrailingComma, + "always-multiline": forceTrailingCommaIfMultiline, + "only-multiline": allowTrailingCommaIfMultiline, + never: forbidTrailingComma, + ignore: lodash.noop + }; + + return { + ObjectExpression: predicate[options.objects], + ObjectPattern: predicate[options.objects], + + ArrayExpression: predicate[options.arrays], + ArrayPattern: predicate[options.arrays], + + ImportDeclaration: predicate[options.imports], + + ExportNamedDeclaration: predicate[options.exports], + + FunctionDeclaration: predicate[options.functions], + FunctionExpression: predicate[options.functions], + ArrowFunctionExpression: predicate[options.functions], + CallExpression: predicate[options.functions], + NewExpression: predicate[options.functions] + }; + } +}; diff --git a/node_modules/eslint/lib/rules/comma-spacing.js b/node_modules/eslint/lib/rules/comma-spacing.js new file mode 100644 index 000000000..73c10a771 --- /dev/null +++ b/node_modules/eslint/lib/rules/comma-spacing.js @@ -0,0 +1,195 @@ +/** + * @fileoverview Comma spacing - validates spacing before and after comma + * @author Vignesh Anand aka vegetableman. + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing before and after commas", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/comma-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + before: { + type: "boolean", + default: false + }, + after: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + missing: "A space is required {{loc}} ','.", + unexpected: "There should be no space {{loc}} ','." + } + }, + + create(context) { + + const sourceCode = context.getSourceCode(); + const tokensAndComments = sourceCode.tokensAndComments; + + const options = { + before: context.options[0] ? context.options[0].before : false, + after: context.options[0] ? context.options[0].after : true + }; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // list of comma tokens to ignore for the check of leading whitespace + const commaTokensToIgnore = []; + + /** + * Reports a spacing error with an appropriate message. + * @param {ASTNode} node The binary expression node to report. + * @param {string} loc Is the error "before" or "after" the comma? + * @param {ASTNode} otherNode The node at the left or right of `node` + * @returns {void} + * @private + */ + function report(node, loc, otherNode) { + context.report({ + node, + fix(fixer) { + if (options[loc]) { + if (loc === "before") { + return fixer.insertTextBefore(node, " "); + } + return fixer.insertTextAfter(node, " "); + + } + let start, end; + const newText = ""; + + if (loc === "before") { + start = otherNode.range[1]; + end = node.range[0]; + } else { + start = node.range[1]; + end = otherNode.range[0]; + } + + return fixer.replaceTextRange([start, end], newText); + + }, + messageId: options[loc] ? "missing" : "unexpected", + data: { + loc + } + }); + } + + /** + * Validates the spacing around a comma token. + * @param {Object} tokens The tokens to be validated. + * @param {Token} tokens.comma The token representing the comma. + * @param {Token} [tokens.left] The last token before the comma. + * @param {Token} [tokens.right] The first token after the comma. + * @param {Token|ASTNode} reportItem The item to use when reporting an error. + * @returns {void} + * @private + */ + function validateCommaItemSpacing(tokens, reportItem) { + if (tokens.left && astUtils.isTokenOnSameLine(tokens.left, tokens.comma) && + (options.before !== sourceCode.isSpaceBetweenTokens(tokens.left, tokens.comma)) + ) { + report(reportItem, "before", tokens.left); + } + + if (tokens.right && astUtils.isClosingParenToken(tokens.right)) { + return; + } + + if (tokens.right && !options.after && tokens.right.type === "Line") { + return; + } + + if (tokens.right && astUtils.isTokenOnSameLine(tokens.comma, tokens.right) && + (options.after !== sourceCode.isSpaceBetweenTokens(tokens.comma, tokens.right)) + ) { + report(reportItem, "after", tokens.right); + } + } + + /** + * Adds null elements of the given ArrayExpression or ArrayPattern node to the ignore list. + * @param {ASTNode} node An ArrayExpression or ArrayPattern node. + * @returns {void} + */ + function addNullElementsToIgnoreList(node) { + let previousToken = sourceCode.getFirstToken(node); + + node.elements.forEach(element => { + let token; + + if (element === null) { + token = sourceCode.getTokenAfter(previousToken); + + if (astUtils.isCommaToken(token)) { + commaTokensToIgnore.push(token); + } + } else { + token = sourceCode.getTokenAfter(element); + } + + previousToken = token; + }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + "Program:exit"() { + tokensAndComments.forEach((token, i) => { + + if (!astUtils.isCommaToken(token)) { + return; + } + + if (token && token.type === "JSXText") { + return; + } + + const previousToken = tokensAndComments[i - 1]; + const nextToken = tokensAndComments[i + 1]; + + validateCommaItemSpacing({ + comma: token, + left: astUtils.isCommaToken(previousToken) || commaTokensToIgnore.indexOf(token) > -1 ? null : previousToken, + right: astUtils.isCommaToken(nextToken) ? null : nextToken + }, token); + }); + }, + ArrayExpression: addNullElementsToIgnoreList, + ArrayPattern: addNullElementsToIgnoreList + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/comma-style.js b/node_modules/eslint/lib/rules/comma-style.js new file mode 100644 index 000000000..f1a23d63b --- /dev/null +++ b/node_modules/eslint/lib/rules/comma-style.js @@ -0,0 +1,310 @@ +/** + * @fileoverview Comma style - enforces comma styles of two types: last and first + * @author Vignesh Anand aka vegetableman + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent comma style", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/comma-style" + }, + + fixable: "code", + + schema: [ + { + enum: ["first", "last"] + }, + { + type: "object", + properties: { + exceptions: { + type: "object", + additionalProperties: { + type: "boolean" + } + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedLineBeforeAndAfterComma: "Bad line breaking before and after ','.", + expectedCommaFirst: "',' should be placed first.", + expectedCommaLast: "',' should be placed last." + } + }, + + create(context) { + const style = context.options[0] || "last", + sourceCode = context.getSourceCode(); + const exceptions = { + ArrayPattern: true, + ArrowFunctionExpression: true, + CallExpression: true, + FunctionDeclaration: true, + FunctionExpression: true, + ImportDeclaration: true, + ObjectPattern: true, + NewExpression: true + }; + + if (context.options.length === 2 && Object.prototype.hasOwnProperty.call(context.options[1], "exceptions")) { + const keys = Object.keys(context.options[1].exceptions); + + for (let i = 0; i < keys.length; i++) { + exceptions[keys[i]] = context.options[1].exceptions[keys[i]]; + } + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Modified text based on the style + * @param {string} styleType Style type + * @param {string} text Source code text + * @returns {string} modified text + * @private + */ + function getReplacedText(styleType, text) { + switch (styleType) { + case "between": + return `,${text.replace(astUtils.LINEBREAK_MATCHER, "")}`; + + case "first": + return `${text},`; + + case "last": + return `,${text}`; + + default: + return ""; + } + } + + /** + * Determines the fixer function for a given style. + * @param {string} styleType comma style + * @param {ASTNode} previousItemToken The token to check. + * @param {ASTNode} commaToken The token to check. + * @param {ASTNode} currentItemToken The token to check. + * @returns {Function} Fixer function + * @private + */ + function getFixerFunction(styleType, previousItemToken, commaToken, currentItemToken) { + const text = + sourceCode.text.slice(previousItemToken.range[1], commaToken.range[0]) + + sourceCode.text.slice(commaToken.range[1], currentItemToken.range[0]); + const range = [previousItemToken.range[1], currentItemToken.range[0]]; + + return function(fixer) { + return fixer.replaceTextRange(range, getReplacedText(styleType, text)); + }; + } + + /** + * Validates the spacing around single items in lists. + * @param {Token} previousItemToken The last token from the previous item. + * @param {Token} commaToken The token representing the comma. + * @param {Token} currentItemToken The first token of the current item. + * @param {Token} reportItem The item to use when reporting an error. + * @returns {void} + * @private + */ + function validateCommaItemSpacing(previousItemToken, commaToken, currentItemToken, reportItem) { + + // if single line + if (astUtils.isTokenOnSameLine(commaToken, currentItemToken) && + astUtils.isTokenOnSameLine(previousItemToken, commaToken)) { + + // do nothing. + + } else if (!astUtils.isTokenOnSameLine(commaToken, currentItemToken) && + !astUtils.isTokenOnSameLine(previousItemToken, commaToken)) { + + const comment = sourceCode.getCommentsAfter(commaToken)[0]; + const styleType = comment && comment.type === "Block" && astUtils.isTokenOnSameLine(commaToken, comment) + ? style + : "between"; + + // lone comma + context.report({ + node: reportItem, + loc: commaToken.loc, + messageId: "unexpectedLineBeforeAndAfterComma", + fix: getFixerFunction(styleType, previousItemToken, commaToken, currentItemToken) + }); + + } else if (style === "first" && !astUtils.isTokenOnSameLine(commaToken, currentItemToken)) { + + context.report({ + node: reportItem, + loc: commaToken.loc, + messageId: "expectedCommaFirst", + fix: getFixerFunction(style, previousItemToken, commaToken, currentItemToken) + }); + + } else if (style === "last" && astUtils.isTokenOnSameLine(commaToken, currentItemToken)) { + + context.report({ + node: reportItem, + loc: commaToken.loc, + messageId: "expectedCommaLast", + fix: getFixerFunction(style, previousItemToken, commaToken, currentItemToken) + }); + } + } + + /** + * Checks the comma placement with regards to a declaration/property/element + * @param {ASTNode} node The binary expression node to check + * @param {string} property The property of the node containing child nodes. + * @private + * @returns {void} + */ + function validateComma(node, property) { + const items = node[property], + arrayLiteral = (node.type === "ArrayExpression" || node.type === "ArrayPattern"); + + if (items.length > 1 || arrayLiteral) { + + // seed as opening [ + let previousItemToken = sourceCode.getFirstToken(node); + + items.forEach(item => { + const commaToken = item ? sourceCode.getTokenBefore(item) : previousItemToken, + currentItemToken = item ? sourceCode.getFirstToken(item) : sourceCode.getTokenAfter(commaToken), + reportItem = item || currentItemToken; + + /* + * This works by comparing three token locations: + * - previousItemToken is the last token of the previous item + * - commaToken is the location of the comma before the current item + * - currentItemToken is the first token of the current item + * + * These values get switched around if item is undefined. + * previousItemToken will refer to the last token not belonging + * to the current item, which could be a comma or an opening + * square bracket. currentItemToken could be a comma. + * + * All comparisons are done based on these tokens directly, so + * they are always valid regardless of an undefined item. + */ + if (astUtils.isCommaToken(commaToken)) { + validateCommaItemSpacing(previousItemToken, commaToken, + currentItemToken, reportItem); + } + + if (item) { + const tokenAfterItem = sourceCode.getTokenAfter(item, astUtils.isNotClosingParenToken); + + previousItemToken = tokenAfterItem + ? sourceCode.getTokenBefore(tokenAfterItem) + : sourceCode.ast.tokens[sourceCode.ast.tokens.length - 1]; + } + }); + + /* + * Special case for array literals that have empty last items, such + * as [ 1, 2, ]. These arrays only have two items show up in the + * AST, so we need to look at the token to verify that there's no + * dangling comma. + */ + if (arrayLiteral) { + + const lastToken = sourceCode.getLastToken(node), + nextToLastToken = sourceCode.getTokenBefore(lastToken); + + if (astUtils.isCommaToken(nextToLastToken)) { + validateCommaItemSpacing( + sourceCode.getTokenBefore(nextToLastToken), + nextToLastToken, + lastToken, + lastToken + ); + } + } + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + const nodes = {}; + + if (!exceptions.VariableDeclaration) { + nodes.VariableDeclaration = function(node) { + validateComma(node, "declarations"); + }; + } + if (!exceptions.ObjectExpression) { + nodes.ObjectExpression = function(node) { + validateComma(node, "properties"); + }; + } + if (!exceptions.ObjectPattern) { + nodes.ObjectPattern = function(node) { + validateComma(node, "properties"); + }; + } + if (!exceptions.ArrayExpression) { + nodes.ArrayExpression = function(node) { + validateComma(node, "elements"); + }; + } + if (!exceptions.ArrayPattern) { + nodes.ArrayPattern = function(node) { + validateComma(node, "elements"); + }; + } + if (!exceptions.FunctionDeclaration) { + nodes.FunctionDeclaration = function(node) { + validateComma(node, "params"); + }; + } + if (!exceptions.FunctionExpression) { + nodes.FunctionExpression = function(node) { + validateComma(node, "params"); + }; + } + if (!exceptions.ArrowFunctionExpression) { + nodes.ArrowFunctionExpression = function(node) { + validateComma(node, "params"); + }; + } + if (!exceptions.CallExpression) { + nodes.CallExpression = function(node) { + validateComma(node, "arguments"); + }; + } + if (!exceptions.ImportDeclaration) { + nodes.ImportDeclaration = function(node) { + validateComma(node, "specifiers"); + }; + } + if (!exceptions.NewExpression) { + nodes.NewExpression = function(node) { + validateComma(node, "arguments"); + }; + } + + return nodes; + } +}; diff --git a/node_modules/eslint/lib/rules/complexity.js b/node_modules/eslint/lib/rules/complexity.js new file mode 100644 index 000000000..7fc8bf9bc --- /dev/null +++ b/node_modules/eslint/lib/rules/complexity.js @@ -0,0 +1,160 @@ +/** + * @fileoverview Counts the cyclomatic complexity of each function of the script. See http://en.wikipedia.org/wiki/Cyclomatic_complexity. + * Counts the number of if, conditional, for, while, try, switch/case, + * @author Patrick Brosset + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a maximum cyclomatic complexity allowed in a program", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/complexity" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + maximum: { + type: "integer", + minimum: 0 + }, + max: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + complex: "{{name}} has a complexity of {{complexity}}. Maximum allowed is {{max}}." + } + }, + + create(context) { + const option = context.options[0]; + let THRESHOLD = 20; + + if ( + typeof option === "object" && + (Object.prototype.hasOwnProperty.call(option, "maximum") || Object.prototype.hasOwnProperty.call(option, "max")) + ) { + THRESHOLD = option.maximum || option.max; + } else if (typeof option === "number") { + THRESHOLD = option; + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // Using a stack to store complexity (handling nested functions) + const fns = []; + + /** + * When parsing a new function, store it in our function stack + * @returns {void} + * @private + */ + function startFunction() { + fns.push(1); + } + + /** + * Evaluate the node at the end of function + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function endFunction(node) { + const name = lodash.upperFirst(astUtils.getFunctionNameWithKind(node)); + const complexity = fns.pop(); + + if (complexity > THRESHOLD) { + context.report({ + node, + messageId: "complex", + data: { name, complexity, max: THRESHOLD } + }); + } + } + + /** + * Increase the complexity of the function in context + * @returns {void} + * @private + */ + function increaseComplexity() { + if (fns.length) { + fns[fns.length - 1]++; + } + } + + /** + * Increase the switch complexity in context + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function increaseSwitchComplexity(node) { + + // Avoiding `default` + if (node.test) { + increaseComplexity(); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + FunctionDeclaration: startFunction, + FunctionExpression: startFunction, + ArrowFunctionExpression: startFunction, + "FunctionDeclaration:exit": endFunction, + "FunctionExpression:exit": endFunction, + "ArrowFunctionExpression:exit": endFunction, + + CatchClause: increaseComplexity, + ConditionalExpression: increaseComplexity, + LogicalExpression: increaseComplexity, + ForStatement: increaseComplexity, + ForInStatement: increaseComplexity, + ForOfStatement: increaseComplexity, + IfStatement: increaseComplexity, + SwitchCase: increaseSwitchComplexity, + WhileStatement: increaseComplexity, + DoWhileStatement: increaseComplexity + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/computed-property-spacing.js b/node_modules/eslint/lib/rules/computed-property-spacing.js new file mode 100644 index 000000000..53fdb8f4e --- /dev/null +++ b/node_modules/eslint/lib/rules/computed-property-spacing.js @@ -0,0 +1,204 @@ +/** + * @fileoverview Disallows or enforces spaces inside computed properties. + * @author Jamund Ferguson + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing inside computed property brackets", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/computed-property-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + enforceForClassMembers: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedSpaceBefore: "There should be no space before '{{tokenValue}}'.", + unexpectedSpaceAfter: "There should be no space after '{{tokenValue}}'.", + + missingSpaceBefore: "A space is required before '{{tokenValue}}'.", + missingSpaceAfter: "A space is required after '{{tokenValue}}'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const propertyNameMustBeSpaced = context.options[0] === "always"; // default is "never" + const enforceForClassMembers = !context.options[1] || context.options[1].enforceForClassMembers; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports that there shouldn't be a space after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @param {Token} tokenAfter The token after `token`. + * @returns {void} + */ + function reportNoBeginningSpace(node, token, tokenAfter) { + context.report({ + node, + loc: { start: token.loc.end, end: tokenAfter.loc.start }, + messageId: "unexpectedSpaceAfter", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.removeRange([token.range[1], tokenAfter.range[0]]); + } + }); + } + + /** + * Reports that there shouldn't be a space before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @param {Token} tokenBefore The token before `token`. + * @returns {void} + */ + function reportNoEndingSpace(node, token, tokenBefore) { + context.report({ + node, + loc: { start: tokenBefore.loc.end, end: token.loc.start }, + messageId: "unexpectedSpaceBefore", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.removeRange([tokenBefore.range[1], token.range[0]]); + } + }); + } + + /** + * Reports that there should be a space after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredBeginningSpace(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "missingSpaceAfter", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + + /** + * Reports that there should be a space before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredEndingSpace(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "missingSpaceBefore", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + + /** + * Returns a function that checks the spacing of a node on the property name + * that was passed in. + * @param {string} propertyName The property on the node to check for spacing + * @returns {Function} A function that will check spacing on a node + */ + function checkSpacing(propertyName) { + return function(node) { + if (!node.computed) { + return; + } + + const property = node[propertyName]; + + const before = sourceCode.getTokenBefore(property, astUtils.isOpeningBracketToken), + first = sourceCode.getTokenAfter(before, { includeComments: true }), + after = sourceCode.getTokenAfter(property, astUtils.isClosingBracketToken), + last = sourceCode.getTokenBefore(after, { includeComments: true }); + + if (astUtils.isTokenOnSameLine(before, first)) { + if (propertyNameMustBeSpaced) { + if (!sourceCode.isSpaceBetweenTokens(before, first) && astUtils.isTokenOnSameLine(before, first)) { + reportRequiredBeginningSpace(node, before); + } + } else { + if (sourceCode.isSpaceBetweenTokens(before, first)) { + reportNoBeginningSpace(node, before, first); + } + } + } + + if (astUtils.isTokenOnSameLine(last, after)) { + if (propertyNameMustBeSpaced) { + if (!sourceCode.isSpaceBetweenTokens(last, after) && astUtils.isTokenOnSameLine(last, after)) { + reportRequiredEndingSpace(node, after); + } + } else { + if (sourceCode.isSpaceBetweenTokens(last, after)) { + reportNoEndingSpace(node, after, last); + } + } + } + }; + } + + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + const listeners = { + Property: checkSpacing("key"), + MemberExpression: checkSpacing("property") + }; + + if (enforceForClassMembers) { + listeners.MethodDefinition = checkSpacing("key"); + } + + return listeners; + + } +}; diff --git a/node_modules/eslint/lib/rules/consistent-return.js b/node_modules/eslint/lib/rules/consistent-return.js new file mode 100644 index 000000000..94db253d2 --- /dev/null +++ b/node_modules/eslint/lib/rules/consistent-return.js @@ -0,0 +1,185 @@ +/** + * @fileoverview Rule to flag consistent return values + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given code path segment is unreachable. + * @param {CodePathSegment} segment A CodePathSegment to check. + * @returns {boolean} `true` if the segment is unreachable. + */ +function isUnreachable(segment) { + return !segment.reachable; +} + +/** + * Checks whether a given node is a `constructor` method in an ES6 class + * @param {ASTNode} node A node to check + * @returns {boolean} `true` if the node is a `constructor` method + */ +function isClassConstructor(node) { + return node.type === "FunctionExpression" && + node.parent && + node.parent.type === "MethodDefinition" && + node.parent.kind === "constructor"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require `return` statements to either always or never specify values", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/consistent-return" + }, + + schema: [{ + type: "object", + properties: { + treatUndefinedAsUnspecified: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], + + messages: { + missingReturn: "Expected to return a value at the end of {{name}}.", + missingReturnValue: "{{name}} expected a return value.", + unexpectedReturnValue: "{{name}} expected no return value." + } + }, + + create(context) { + const options = context.options[0] || {}; + const treatUndefinedAsUnspecified = options.treatUndefinedAsUnspecified === true; + let funcInfo = null; + + /** + * Checks whether of not the implicit returning is consistent if the last + * code path segment is reachable. + * @param {ASTNode} node A program/function node to check. + * @returns {void} + */ + function checkLastSegment(node) { + let loc, name; + + /* + * Skip if it expected no return value or unreachable. + * When unreachable, all paths are returned or thrown. + */ + if (!funcInfo.hasReturnValue || + funcInfo.codePath.currentSegments.every(isUnreachable) || + astUtils.isES5Constructor(node) || + isClassConstructor(node) + ) { + return; + } + + // Adjust a location and a message. + if (node.type === "Program") { + + // The head of program. + loc = { line: 1, column: 0 }; + name = "program"; + } else if (node.type === "ArrowFunctionExpression") { + + // `=>` token + loc = context.getSourceCode().getTokenBefore(node.body, astUtils.isArrowToken).loc.start; + } else if ( + node.parent.type === "MethodDefinition" || + (node.parent.type === "Property" && node.parent.method) + ) { + + // Method name. + loc = node.parent.key.loc.start; + } else { + + // Function name or `function` keyword. + loc = (node.id || node).loc.start; + } + + if (!name) { + name = astUtils.getFunctionNameWithKind(node); + } + + // Reports. + context.report({ + node, + loc, + messageId: "missingReturn", + data: { name } + }); + } + + return { + + // Initializes/Disposes state of each code path. + onCodePathStart(codePath, node) { + funcInfo = { + upper: funcInfo, + codePath, + hasReturn: false, + hasReturnValue: false, + messageId: "", + node + }; + }, + onCodePathEnd() { + funcInfo = funcInfo.upper; + }, + + // Reports a given return statement if it's inconsistent. + ReturnStatement(node) { + const argument = node.argument; + let hasReturnValue = Boolean(argument); + + if (treatUndefinedAsUnspecified && hasReturnValue) { + hasReturnValue = !astUtils.isSpecificId(argument, "undefined") && argument.operator !== "void"; + } + + if (!funcInfo.hasReturn) { + funcInfo.hasReturn = true; + funcInfo.hasReturnValue = hasReturnValue; + funcInfo.messageId = hasReturnValue ? "missingReturnValue" : "unexpectedReturnValue"; + funcInfo.data = { + name: funcInfo.node.type === "Program" + ? "Program" + : lodash.upperFirst(astUtils.getFunctionNameWithKind(funcInfo.node)) + }; + } else if (funcInfo.hasReturnValue !== hasReturnValue) { + context.report({ + node, + messageId: funcInfo.messageId, + data: funcInfo.data + }); + } + }, + + // Reports a given program/function if the implicit returning is not consistent. + "Program:exit": checkLastSegment, + "FunctionDeclaration:exit": checkLastSegment, + "FunctionExpression:exit": checkLastSegment, + "ArrowFunctionExpression:exit": checkLastSegment + }; + } +}; diff --git a/node_modules/eslint/lib/rules/consistent-this.js b/node_modules/eslint/lib/rules/consistent-this.js new file mode 100644 index 000000000..e5bc9678d --- /dev/null +++ b/node_modules/eslint/lib/rules/consistent-this.js @@ -0,0 +1,151 @@ +/** + * @fileoverview Rule to enforce consistent naming of "this" context variables + * @author Raphael Pigulla + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce consistent naming when capturing the current execution context", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/consistent-this" + }, + + schema: { + type: "array", + items: { + type: "string", + minLength: 1 + }, + uniqueItems: true + }, + + messages: { + aliasNotAssignedToThis: "Designated alias '{{name}}' is not assigned to 'this'.", + unexpectedAlias: "Unexpected alias '{{name}}' for 'this'." + } + }, + + create(context) { + let aliases = []; + + if (context.options.length === 0) { + aliases.push("that"); + } else { + aliases = context.options; + } + + /** + * Reports that a variable declarator or assignment expression is assigning + * a non-'this' value to the specified alias. + * @param {ASTNode} node The assigning node. + * @param {string} name the name of the alias that was incorrectly used. + * @returns {void} + */ + function reportBadAssignment(node, name) { + context.report({ node, messageId: "aliasNotAssignedToThis", data: { name } }); + } + + /** + * Checks that an assignment to an identifier only assigns 'this' to the + * appropriate alias, and the alias is only assigned to 'this'. + * @param {ASTNode} node The assigning node. + * @param {Identifier} name The name of the variable assigned to. + * @param {Expression} value The value of the assignment. + * @returns {void} + */ + function checkAssignment(node, name, value) { + const isThis = value.type === "ThisExpression"; + + if (aliases.indexOf(name) !== -1) { + if (!isThis || node.operator && node.operator !== "=") { + reportBadAssignment(node, name); + } + } else if (isThis) { + context.report({ node, messageId: "unexpectedAlias", data: { name } }); + } + } + + /** + * Ensures that a variable declaration of the alias in a program or function + * is assigned to the correct value. + * @param {string} alias alias the check the assignment of. + * @param {Object} scope scope of the current code we are checking. + * @private + * @returns {void} + */ + function checkWasAssigned(alias, scope) { + const variable = scope.set.get(alias); + + if (!variable) { + return; + } + + if (variable.defs.some(def => def.node.type === "VariableDeclarator" && + def.node.init !== null)) { + return; + } + + /* + * The alias has been declared and not assigned: check it was + * assigned later in the same scope. + */ + if (!variable.references.some(reference => { + const write = reference.writeExpr; + + return ( + reference.from === scope && + write && write.type === "ThisExpression" && + write.parent.operator === "=" + ); + })) { + variable.defs.map(def => def.node).forEach(node => { + reportBadAssignment(node, alias); + }); + } + } + + /** + * Check each alias to ensure that is was assigned to the correct value. + * @returns {void} + */ + function ensureWasAssigned() { + const scope = context.getScope(); + + aliases.forEach(alias => { + checkWasAssigned(alias, scope); + }); + } + + return { + "Program:exit": ensureWasAssigned, + "FunctionExpression:exit": ensureWasAssigned, + "FunctionDeclaration:exit": ensureWasAssigned, + + VariableDeclarator(node) { + const id = node.id; + const isDestructuring = + id.type === "ArrayPattern" || id.type === "ObjectPattern"; + + if (node.init !== null && !isDestructuring) { + checkAssignment(node, id.name, node.init); + } + }, + + AssignmentExpression(node) { + if (node.left.type === "Identifier") { + checkAssignment(node, node.left.name, node.right); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/constructor-super.js b/node_modules/eslint/lib/rules/constructor-super.js new file mode 100644 index 000000000..8787fc569 --- /dev/null +++ b/node_modules/eslint/lib/rules/constructor-super.js @@ -0,0 +1,412 @@ +/** + * @fileoverview A rule to verify `super()` callings in constructor. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether a given code path segment is reachable or not. + * @param {CodePathSegment} segment A code path segment to check. + * @returns {boolean} `true` if the segment is reachable. + */ +function isReachable(segment) { + return segment.reachable; +} + +/** + * Checks whether or not a given node is a constructor. + * @param {ASTNode} node A node to check. This node type is one of + * `Program`, `FunctionDeclaration`, `FunctionExpression`, and + * `ArrowFunctionExpression`. + * @returns {boolean} `true` if the node is a constructor. + */ +function isConstructorFunction(node) { + return ( + node.type === "FunctionExpression" && + node.parent.type === "MethodDefinition" && + node.parent.kind === "constructor" + ); +} + +/** + * Checks whether a given node can be a constructor or not. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node can be a constructor. + */ +function isPossibleConstructor(node) { + if (!node) { + return false; + } + + switch (node.type) { + case "ClassExpression": + case "FunctionExpression": + case "ThisExpression": + case "MemberExpression": + case "CallExpression": + case "NewExpression": + case "ChainExpression": + case "YieldExpression": + case "TaggedTemplateExpression": + case "MetaProperty": + return true; + + case "Identifier": + return node.name !== "undefined"; + + case "AssignmentExpression": + if (["=", "&&="].includes(node.operator)) { + return isPossibleConstructor(node.right); + } + + if (["||=", "??="].includes(node.operator)) { + return ( + isPossibleConstructor(node.left) || + isPossibleConstructor(node.right) + ); + } + + /** + * All other assignment operators are mathematical assignment operators (arithmetic or bitwise). + * An assignment expression with a mathematical operator can either evaluate to a primitive value, + * or throw, depending on the operands. Thus, it cannot evaluate to a constructor function. + */ + return false; + + case "LogicalExpression": + return ( + isPossibleConstructor(node.left) || + isPossibleConstructor(node.right) + ); + + case "ConditionalExpression": + return ( + isPossibleConstructor(node.alternate) || + isPossibleConstructor(node.consequent) + ); + + case "SequenceExpression": { + const lastExpression = node.expressions[node.expressions.length - 1]; + + return isPossibleConstructor(lastExpression); + } + + default: + return false; + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "require `super()` calls in constructors", + category: "ECMAScript 6", + recommended: true, + url: "https://eslint.org/docs/rules/constructor-super" + }, + + schema: [], + + messages: { + missingSome: "Lacked a call of 'super()' in some code paths.", + missingAll: "Expected to call 'super()'.", + + duplicate: "Unexpected duplicate 'super()'.", + badSuper: "Unexpected 'super()' because 'super' is not a constructor.", + unexpected: "Unexpected 'super()'." + } + }, + + create(context) { + + /* + * {{hasExtends: boolean, scope: Scope, codePath: CodePath}[]} + * Information for each constructor. + * - upper: Information of the upper constructor. + * - hasExtends: A flag which shows whether own class has a valid `extends` + * part. + * - scope: The scope of own class. + * - codePath: The code path object of the constructor. + */ + let funcInfo = null; + + /* + * {Map} + * Information for each code path segment. + * - calledInSomePaths: A flag of be called `super()` in some code paths. + * - calledInEveryPaths: A flag of be called `super()` in all code paths. + * - validNodes: + */ + let segInfoMap = Object.create(null); + + /** + * Gets the flag which shows `super()` is called in some paths. + * @param {CodePathSegment} segment A code path segment to get. + * @returns {boolean} The flag which shows `super()` is called in some paths + */ + function isCalledInSomePath(segment) { + return segment.reachable && segInfoMap[segment.id].calledInSomePaths; + } + + /** + * Gets the flag which shows `super()` is called in all paths. + * @param {CodePathSegment} segment A code path segment to get. + * @returns {boolean} The flag which shows `super()` is called in all paths. + */ + function isCalledInEveryPath(segment) { + + /* + * If specific segment is the looped segment of the current segment, + * skip the segment. + * If not skipped, this never becomes true after a loop. + */ + if (segment.nextSegments.length === 1 && + segment.nextSegments[0].isLoopedPrevSegment(segment) + ) { + return true; + } + return segment.reachable && segInfoMap[segment.id].calledInEveryPaths; + } + + return { + + /** + * Stacks a constructor information. + * @param {CodePath} codePath A code path which was started. + * @param {ASTNode} node The current node. + * @returns {void} + */ + onCodePathStart(codePath, node) { + if (isConstructorFunction(node)) { + + // Class > ClassBody > MethodDefinition > FunctionExpression + const classNode = node.parent.parent.parent; + const superClass = classNode.superClass; + + funcInfo = { + upper: funcInfo, + isConstructor: true, + hasExtends: Boolean(superClass), + superIsConstructor: isPossibleConstructor(superClass), + codePath + }; + } else { + funcInfo = { + upper: funcInfo, + isConstructor: false, + hasExtends: false, + superIsConstructor: false, + codePath + }; + } + }, + + /** + * Pops a constructor information. + * And reports if `super()` lacked. + * @param {CodePath} codePath A code path which was ended. + * @param {ASTNode} node The current node. + * @returns {void} + */ + onCodePathEnd(codePath, node) { + const hasExtends = funcInfo.hasExtends; + + // Pop. + funcInfo = funcInfo.upper; + + if (!hasExtends) { + return; + } + + // Reports if `super()` lacked. + const segments = codePath.returnedSegments; + const calledInEveryPaths = segments.every(isCalledInEveryPath); + const calledInSomePaths = segments.some(isCalledInSomePath); + + if (!calledInEveryPaths) { + context.report({ + messageId: calledInSomePaths + ? "missingSome" + : "missingAll", + node: node.parent + }); + } + }, + + /** + * Initialize information of a given code path segment. + * @param {CodePathSegment} segment A code path segment to initialize. + * @returns {void} + */ + onCodePathSegmentStart(segment) { + if (!(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends)) { + return; + } + + // Initialize info. + const info = segInfoMap[segment.id] = { + calledInSomePaths: false, + calledInEveryPaths: false, + validNodes: [] + }; + + // When there are previous segments, aggregates these. + const prevSegments = segment.prevSegments; + + if (prevSegments.length > 0) { + info.calledInSomePaths = prevSegments.some(isCalledInSomePath); + info.calledInEveryPaths = prevSegments.every(isCalledInEveryPath); + } + }, + + /** + * Update information of the code path segment when a code path was + * looped. + * @param {CodePathSegment} fromSegment The code path segment of the + * end of a loop. + * @param {CodePathSegment} toSegment A code path segment of the head + * of a loop. + * @returns {void} + */ + onCodePathSegmentLoop(fromSegment, toSegment) { + if (!(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends)) { + return; + } + + // Update information inside of the loop. + const isRealLoop = toSegment.prevSegments.length >= 2; + + funcInfo.codePath.traverseSegments( + { first: toSegment, last: fromSegment }, + segment => { + const info = segInfoMap[segment.id]; + const prevSegments = segment.prevSegments; + + // Updates flags. + info.calledInSomePaths = prevSegments.some(isCalledInSomePath); + info.calledInEveryPaths = prevSegments.every(isCalledInEveryPath); + + // If flags become true anew, reports the valid nodes. + if (info.calledInSomePaths || isRealLoop) { + const nodes = info.validNodes; + + info.validNodes = []; + + for (let i = 0; i < nodes.length; ++i) { + const node = nodes[i]; + + context.report({ + messageId: "duplicate", + node + }); + } + } + } + ); + }, + + /** + * Checks for a call of `super()`. + * @param {ASTNode} node A CallExpression node to check. + * @returns {void} + */ + "CallExpression:exit"(node) { + if (!(funcInfo && funcInfo.isConstructor)) { + return; + } + + // Skips except `super()`. + if (node.callee.type !== "Super") { + return; + } + + // Reports if needed. + if (funcInfo.hasExtends) { + const segments = funcInfo.codePath.currentSegments; + let duplicate = false; + let info = null; + + for (let i = 0; i < segments.length; ++i) { + const segment = segments[i]; + + if (segment.reachable) { + info = segInfoMap[segment.id]; + + duplicate = duplicate || info.calledInSomePaths; + info.calledInSomePaths = info.calledInEveryPaths = true; + } + } + + if (info) { + if (duplicate) { + context.report({ + messageId: "duplicate", + node + }); + } else if (!funcInfo.superIsConstructor) { + context.report({ + messageId: "badSuper", + node + }); + } else { + info.validNodes.push(node); + } + } + } else if (funcInfo.codePath.currentSegments.some(isReachable)) { + context.report({ + messageId: "unexpected", + node + }); + } + }, + + /** + * Set the mark to the returned path as `super()` was called. + * @param {ASTNode} node A ReturnStatement node to check. + * @returns {void} + */ + ReturnStatement(node) { + if (!(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends)) { + return; + } + + // Skips if no argument. + if (!node.argument) { + return; + } + + // Returning argument is a substitute of 'super()'. + const segments = funcInfo.codePath.currentSegments; + + for (let i = 0; i < segments.length; ++i) { + const segment = segments[i]; + + if (segment.reachable) { + const info = segInfoMap[segment.id]; + + info.calledInSomePaths = info.calledInEveryPaths = true; + } + } + }, + + /** + * Resets state. + * @returns {void} + */ + "Program:exit"() { + segInfoMap = Object.create(null); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/curly.js b/node_modules/eslint/lib/rules/curly.js new file mode 100644 index 000000000..92d31a647 --- /dev/null +++ b/node_modules/eslint/lib/rules/curly.js @@ -0,0 +1,495 @@ +/** + * @fileoverview Rule to flag statements without curly braces + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce consistent brace style for all control statements", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/curly" + }, + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["all"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["multi", "multi-line", "multi-or-nest"] + }, + { + enum: ["consistent"] + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + fixable: "code", + + messages: { + missingCurlyAfter: "Expected { after '{{name}}'.", + missingCurlyAfterCondition: "Expected { after '{{name}}' condition.", + unexpectedCurlyAfter: "Unnecessary { after '{{name}}'.", + unexpectedCurlyAfterCondition: "Unnecessary { after '{{name}}' condition." + } + }, + + create(context) { + + const multiOnly = (context.options[0] === "multi"); + const multiLine = (context.options[0] === "multi-line"); + const multiOrNest = (context.options[0] === "multi-or-nest"); + const consistent = (context.options[1] === "consistent"); + + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Determines if a given node is a one-liner that's on the same line as it's preceding code. + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node is a one-liner that's on the same line as it's preceding code. + * @private + */ + function isCollapsedOneLiner(node) { + const before = sourceCode.getTokenBefore(node); + const last = sourceCode.getLastToken(node); + const lastExcludingSemicolon = astUtils.isSemicolonToken(last) ? sourceCode.getTokenBefore(last) : last; + + return before.loc.start.line === lastExcludingSemicolon.loc.end.line; + } + + /** + * Determines if a given node is a one-liner. + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node is a one-liner. + * @private + */ + function isOneLiner(node) { + if (node.type === "EmptyStatement") { + return true; + } + + const first = sourceCode.getFirstToken(node); + const last = sourceCode.getLastToken(node); + const lastExcludingSemicolon = astUtils.isSemicolonToken(last) ? sourceCode.getTokenBefore(last) : last; + + return first.loc.start.line === lastExcludingSemicolon.loc.end.line; + } + + /** + * Determines if the given node is a lexical declaration (let, const, function, or class) + * @param {ASTNode} node The node to check + * @returns {boolean} True if the node is a lexical declaration + * @private + */ + function isLexicalDeclaration(node) { + if (node.type === "VariableDeclaration") { + return node.kind === "const" || node.kind === "let"; + } + + return node.type === "FunctionDeclaration" || node.type === "ClassDeclaration"; + } + + /** + * Checks if the given token is an `else` token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is an `else` token. + */ + function isElseKeywordToken(token) { + return token.value === "else" && token.type === "Keyword"; + } + + /** + * Gets the `else` keyword token of a given `IfStatement` node. + * @param {ASTNode} node A `IfStatement` node to get. + * @returns {Token} The `else` keyword token. + */ + function getElseKeyword(node) { + return node.alternate && sourceCode.getFirstTokenBetween(node.consequent, node.alternate, isElseKeywordToken); + } + + /** + * Determines whether the given node has an `else` keyword token as the first token after. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is followed by an `else` keyword token. + */ + function isFollowedByElseKeyword(node) { + const nextToken = sourceCode.getTokenAfter(node); + + return Boolean(nextToken) && isElseKeywordToken(nextToken); + } + + /** + * Determines if a semicolon needs to be inserted after removing a set of curly brackets, in order to avoid a SyntaxError. + * @param {Token} closingBracket The } token + * @returns {boolean} `true` if a semicolon needs to be inserted after the last statement in the block. + */ + function needsSemicolon(closingBracket) { + const tokenBefore = sourceCode.getTokenBefore(closingBracket); + const tokenAfter = sourceCode.getTokenAfter(closingBracket); + const lastBlockNode = sourceCode.getNodeByRangeIndex(tokenBefore.range[0]); + + if (astUtils.isSemicolonToken(tokenBefore)) { + + // If the last statement already has a semicolon, don't add another one. + return false; + } + + if (!tokenAfter) { + + // If there are no statements after this block, there is no need to add a semicolon. + return false; + } + + if (lastBlockNode.type === "BlockStatement" && lastBlockNode.parent.type !== "FunctionExpression" && lastBlockNode.parent.type !== "ArrowFunctionExpression") { + + /* + * If the last node surrounded by curly brackets is a BlockStatement (other than a FunctionExpression or an ArrowFunctionExpression), + * don't insert a semicolon. Otherwise, the semicolon would be parsed as a separate statement, which would cause + * a SyntaxError if it was followed by `else`. + */ + return false; + } + + if (tokenBefore.loc.end.line === tokenAfter.loc.start.line) { + + // If the next token is on the same line, insert a semicolon. + return true; + } + + if (/^[([/`+-]/u.test(tokenAfter.value)) { + + // If the next token starts with a character that would disrupt ASI, insert a semicolon. + return true; + } + + if (tokenBefore.type === "Punctuator" && (tokenBefore.value === "++" || tokenBefore.value === "--")) { + + // If the last token is ++ or --, insert a semicolon to avoid disrupting ASI. + return true; + } + + // Otherwise, do not insert a semicolon. + return false; + } + + /** + * Determines whether the code represented by the given node contains an `if` statement + * that would become associated with an `else` keyword directly appended to that code. + * + * Examples where it returns `true`: + * + * if (a) + * foo(); + * + * if (a) { + * foo(); + * } + * + * if (a) + * foo(); + * else if (b) + * bar(); + * + * while (a) + * if (b) + * if(c) + * foo(); + * else + * bar(); + * + * Examples where it returns `false`: + * + * if (a) + * foo(); + * else + * bar(); + * + * while (a) { + * if (b) + * if(c) + * foo(); + * else + * bar(); + * } + * + * while (a) + * if (b) { + * if(c) + * foo(); + * } + * else + * bar(); + * @param {ASTNode} node Node representing the code to check. + * @returns {boolean} `true` if an `if` statement within the code would become associated with an `else` appended to that code. + */ + function hasUnsafeIf(node) { + switch (node.type) { + case "IfStatement": + if (!node.alternate) { + return true; + } + return hasUnsafeIf(node.alternate); + case "ForStatement": + case "ForInStatement": + case "ForOfStatement": + case "LabeledStatement": + case "WithStatement": + case "WhileStatement": + return hasUnsafeIf(node.body); + default: + return false; + } + } + + /** + * Determines whether the existing curly braces around the single statement are necessary to preserve the semantics of the code. + * The braces, which make the given block body, are necessary in either of the following situations: + * + * 1. The statement is a lexical declaration. + * 2. Without the braces, an `if` within the statement would become associated with an `else` after the closing brace: + * + * if (a) { + * if (b) + * foo(); + * } + * else + * bar(); + * + * if (a) + * while (b) + * while (c) { + * while (d) + * if (e) + * while(f) + * foo(); + * } + * else + * bar(); + * @param {ASTNode} node `BlockStatement` body with exactly one statement directly inside. The statement can have its own nested statements. + * @returns {boolean} `true` if the braces are necessary - removing them (replacing the given `BlockStatement` body with its single statement content) + * would change the semantics of the code or produce a syntax error. + */ + function areBracesNecessary(node) { + const statement = node.body[0]; + + return isLexicalDeclaration(statement) || + hasUnsafeIf(statement) && isFollowedByElseKeyword(node); + } + + /** + * Prepares to check the body of a node to see if it's a block statement. + * @param {ASTNode} node The node to report if there's a problem. + * @param {ASTNode} body The body node to check for blocks. + * @param {string} name The name to report if there's a problem. + * @param {{ condition: boolean }} opts Options to pass to the report functions + * @returns {Object} a prepared check object, with "actual", "expected", "check" properties. + * "actual" will be `true` or `false` whether the body is already a block statement. + * "expected" will be `true` or `false` if the body should be a block statement or not, or + * `null` if it doesn't matter, depending on the rule options. It can be modified to change + * the final behavior of "check". + * "check" will be a function reporting appropriate problems depending on the other + * properties. + */ + function prepareCheck(node, body, name, opts) { + const hasBlock = (body.type === "BlockStatement"); + let expected = null; + + if (hasBlock && (body.body.length !== 1 || areBracesNecessary(body))) { + expected = true; + } else if (multiOnly) { + expected = false; + } else if (multiLine) { + if (!isCollapsedOneLiner(body)) { + expected = true; + } + + // otherwise, the body is allowed to have braces or not to have braces + + } else if (multiOrNest) { + if (hasBlock) { + const statement = body.body[0]; + const leadingCommentsInBlock = sourceCode.getCommentsBefore(statement); + + expected = !isOneLiner(statement) || leadingCommentsInBlock.length > 0; + } else { + expected = !isOneLiner(body); + } + } else { + + // default "all" + expected = true; + } + + return { + actual: hasBlock, + expected, + check() { + if (this.expected !== null && this.expected !== this.actual) { + if (this.expected) { + context.report({ + node, + loc: (name !== "else" ? node : getElseKeyword(node)).loc.start, + messageId: opts && opts.condition ? "missingCurlyAfterCondition" : "missingCurlyAfter", + data: { + name + }, + fix: fixer => fixer.replaceText(body, `{${sourceCode.getText(body)}}`) + }); + } else { + context.report({ + node, + loc: (name !== "else" ? node : getElseKeyword(node)).loc.start, + messageId: opts && opts.condition ? "unexpectedCurlyAfterCondition" : "unexpectedCurlyAfter", + data: { + name + }, + fix(fixer) { + + /* + * `do while` expressions sometimes need a space to be inserted after `do`. + * e.g. `do{foo()} while (bar)` should be corrected to `do foo() while (bar)` + */ + const needsPrecedingSpace = node.type === "DoWhileStatement" && + sourceCode.getTokenBefore(body).range[1] === body.range[0] && + !astUtils.canTokensBeAdjacent("do", sourceCode.getFirstToken(body, { skip: 1 })); + + const openingBracket = sourceCode.getFirstToken(body); + const closingBracket = sourceCode.getLastToken(body); + const lastTokenInBlock = sourceCode.getTokenBefore(closingBracket); + + if (needsSemicolon(closingBracket)) { + + /* + * If removing braces would cause a SyntaxError due to multiple statements on the same line (or + * change the semantics of the code due to ASI), don't perform a fix. + */ + return null; + } + + const resultingBodyText = sourceCode.getText().slice(openingBracket.range[1], lastTokenInBlock.range[0]) + + sourceCode.getText(lastTokenInBlock) + + sourceCode.getText().slice(lastTokenInBlock.range[1], closingBracket.range[0]); + + return fixer.replaceText(body, (needsPrecedingSpace ? " " : "") + resultingBodyText); + } + }); + } + } + } + }; + } + + /** + * Prepares to check the bodies of a "if", "else if" and "else" chain. + * @param {ASTNode} node The first IfStatement node of the chain. + * @returns {Object[]} prepared checks for each body of the chain. See `prepareCheck` for more + * information. + */ + function prepareIfChecks(node) { + const preparedChecks = []; + + for (let currentNode = node; currentNode; currentNode = currentNode.alternate) { + preparedChecks.push(prepareCheck(currentNode, currentNode.consequent, "if", { condition: true })); + if (currentNode.alternate && currentNode.alternate.type !== "IfStatement") { + preparedChecks.push(prepareCheck(currentNode, currentNode.alternate, "else")); + break; + } + } + + if (consistent) { + + /* + * If any node should have or already have braces, make sure they + * all have braces. + * If all nodes shouldn't have braces, make sure they don't. + */ + const expected = preparedChecks.some(preparedCheck => { + if (preparedCheck.expected !== null) { + return preparedCheck.expected; + } + return preparedCheck.actual; + }); + + preparedChecks.forEach(preparedCheck => { + preparedCheck.expected = expected; + }); + } + + return preparedChecks; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + IfStatement(node) { + const parent = node.parent; + const isElseIf = parent.type === "IfStatement" && parent.alternate === node; + + if (!isElseIf) { + + // This is a top `if`, check the whole `if-else-if` chain + prepareIfChecks(node).forEach(preparedCheck => { + preparedCheck.check(); + }); + } + + // Skip `else if`, it's already checked (when the top `if` was visited) + }, + + WhileStatement(node) { + prepareCheck(node, node.body, "while", { condition: true }).check(); + }, + + DoWhileStatement(node) { + prepareCheck(node, node.body, "do").check(); + }, + + ForStatement(node) { + prepareCheck(node, node.body, "for", { condition: true }).check(); + }, + + ForInStatement(node) { + prepareCheck(node, node.body, "for-in").check(); + }, + + ForOfStatement(node) { + prepareCheck(node, node.body, "for-of").check(); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/default-case-last.js b/node_modules/eslint/lib/rules/default-case-last.js new file mode 100644 index 000000000..80c5d6bda --- /dev/null +++ b/node_modules/eslint/lib/rules/default-case-last.js @@ -0,0 +1,44 @@ +/** + * @fileoverview Rule to enforce default clauses in switch statements to be last + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce default clauses in switch statements to be last", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/default-case-last" + }, + + schema: [], + + messages: { + notLast: "Default clause should be the last clause." + } + }, + + create(context) { + return { + SwitchStatement(node) { + const cases = node.cases, + indexOfDefault = cases.findIndex(c => c.test === null); + + if (indexOfDefault !== -1 && indexOfDefault !== cases.length - 1) { + const defaultClause = cases[indexOfDefault]; + + context.report({ node: defaultClause, messageId: "notLast" }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/default-case.js b/node_modules/eslint/lib/rules/default-case.js new file mode 100644 index 000000000..821e0d72b --- /dev/null +++ b/node_modules/eslint/lib/rules/default-case.js @@ -0,0 +1,97 @@ +/** + * @fileoverview require default case in switch statements + * @author Aliaksei Shytkin + */ +"use strict"; + +const DEFAULT_COMMENT_PATTERN = /^no default$/iu; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require `default` cases in `switch` statements", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/default-case" + }, + + schema: [{ + type: "object", + properties: { + commentPattern: { + type: "string" + } + }, + additionalProperties: false + }], + + messages: { + missingDefaultCase: "Expected a default case." + } + }, + + create(context) { + const options = context.options[0] || {}; + const commentPattern = options.commentPattern + ? new RegExp(options.commentPattern, "u") + : DEFAULT_COMMENT_PATTERN; + + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Shortcut to get last element of array + * @param {*[]} collection Array + * @returns {*} Last element + */ + function last(collection) { + return collection[collection.length - 1]; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + SwitchStatement(node) { + + if (!node.cases.length) { + + /* + * skip check of empty switch because there is no easy way + * to extract comments inside it now + */ + return; + } + + const hasDefault = node.cases.some(v => v.test === null); + + if (!hasDefault) { + + let comment; + + const lastCase = last(node.cases); + const comments = sourceCode.getCommentsAfter(lastCase); + + if (comments.length) { + comment = last(comments); + } + + if (!comment || !commentPattern.test(comment.value.trim())) { + context.report({ node, messageId: "missingDefaultCase" }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/default-param-last.js b/node_modules/eslint/lib/rules/default-param-last.js new file mode 100644 index 000000000..12e0b5950 --- /dev/null +++ b/node_modules/eslint/lib/rules/default-param-last.js @@ -0,0 +1,62 @@ +/** + * @fileoverview enforce default parameters to be last + * @author Chiawen Chen + */ + +"use strict"; + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce default parameters to be last", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/default-param-last" + }, + + schema: [], + + messages: { + shouldBeLast: "Default parameters should be last." + } + }, + + create(context) { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {ASTNode} node function node + * @returns {void} + */ + function handleFunction(node) { + let hasSeenPlainParam = false; + + for (let i = node.params.length - 1; i >= 0; i -= 1) { + const param = node.params[i]; + + if ( + param.type !== "AssignmentPattern" && + param.type !== "RestElement" + ) { + hasSeenPlainParam = true; + continue; + } + + if (hasSeenPlainParam && param.type === "AssignmentPattern") { + context.report({ + node: param, + messageId: "shouldBeLast" + }); + } + } + } + + return { + FunctionDeclaration: handleFunction, + FunctionExpression: handleFunction, + ArrowFunctionExpression: handleFunction + }; + } +}; diff --git a/node_modules/eslint/lib/rules/dot-location.js b/node_modules/eslint/lib/rules/dot-location.js new file mode 100644 index 000000000..0a739b171 --- /dev/null +++ b/node_modules/eslint/lib/rules/dot-location.js @@ -0,0 +1,105 @@ +/** + * @fileoverview Validates newlines before and after dots + * @author Greg Cochard + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent newlines before and after dots", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/dot-location" + }, + + schema: [ + { + enum: ["object", "property"] + } + ], + + fixable: "code", + + messages: { + expectedDotAfterObject: "Expected dot to be on same line as object.", + expectedDotBeforeProperty: "Expected dot to be on same line as property." + } + }, + + create(context) { + + const config = context.options[0]; + + // default to onObject if no preference is passed + const onObject = config === "object" || !config; + + const sourceCode = context.getSourceCode(); + + /** + * Reports if the dot between object and property is on the correct loccation. + * @param {ASTNode} node The `MemberExpression` node. + * @returns {void} + */ + function checkDotLocation(node) { + const property = node.property; + const dotToken = sourceCode.getTokenBefore(property); + + if (onObject) { + + // `obj` expression can be parenthesized, but those paren tokens are not a part of the `obj` node. + const tokenBeforeDot = sourceCode.getTokenBefore(dotToken); + + if (!astUtils.isTokenOnSameLine(tokenBeforeDot, dotToken)) { + context.report({ + node, + loc: dotToken.loc, + messageId: "expectedDotAfterObject", + *fix(fixer) { + if (dotToken.value.startsWith(".") && astUtils.isDecimalIntegerNumericToken(tokenBeforeDot)) { + yield fixer.insertTextAfter(tokenBeforeDot, ` ${dotToken.value}`); + } else { + yield fixer.insertTextAfter(tokenBeforeDot, dotToken.value); + } + yield fixer.remove(dotToken); + } + }); + } + } else if (!astUtils.isTokenOnSameLine(dotToken, property)) { + context.report({ + node, + loc: dotToken.loc, + messageId: "expectedDotBeforeProperty", + *fix(fixer) { + yield fixer.remove(dotToken); + yield fixer.insertTextBefore(property, dotToken.value); + } + }); + } + } + + /** + * Checks the spacing of the dot within a member expression. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkNode(node) { + if (!node.computed) { + checkDotLocation(node); + } + } + + return { + MemberExpression: checkNode + }; + } +}; diff --git a/node_modules/eslint/lib/rules/dot-notation.js b/node_modules/eslint/lib/rules/dot-notation.js new file mode 100644 index 000000000..751b4628e --- /dev/null +++ b/node_modules/eslint/lib/rules/dot-notation.js @@ -0,0 +1,176 @@ +/** + * @fileoverview Rule to warn about using dot notation instead of square bracket notation when possible. + * @author Josh Perez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const keywords = require("./utils/keywords"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const validIdentifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/u; + +// `null` literal must be handled separately. +const literalTypesToCheck = new Set(["string", "boolean"]); + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce dot notation whenever possible", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/dot-notation" + }, + + schema: [ + { + type: "object", + properties: { + allowKeywords: { + type: "boolean", + default: true + }, + allowPattern: { + type: "string", + default: "" + } + }, + additionalProperties: false + } + ], + + fixable: "code", + + messages: { + useDot: "[{{key}}] is better written in dot notation.", + useBrackets: ".{{key}} is a syntax error." + } + }, + + create(context) { + const options = context.options[0] || {}; + const allowKeywords = options.allowKeywords === void 0 || options.allowKeywords; + const sourceCode = context.getSourceCode(); + + let allowPattern; + + if (options.allowPattern) { + allowPattern = new RegExp(options.allowPattern, "u"); + } + + /** + * Check if the property is valid dot notation + * @param {ASTNode} node The dot notation node + * @param {string} value Value which is to be checked + * @returns {void} + */ + function checkComputedProperty(node, value) { + if ( + validIdentifier.test(value) && + (allowKeywords || keywords.indexOf(String(value)) === -1) && + !(allowPattern && allowPattern.test(value)) + ) { + const formattedValue = node.property.type === "Literal" ? JSON.stringify(value) : `\`${value}\``; + + context.report({ + node: node.property, + messageId: "useDot", + data: { + key: formattedValue + }, + *fix(fixer) { + const leftBracket = sourceCode.getTokenAfter(node.object, astUtils.isOpeningBracketToken); + const rightBracket = sourceCode.getLastToken(node); + const nextToken = sourceCode.getTokenAfter(node); + + // Don't perform any fixes if there are comments inside the brackets. + if (sourceCode.commentsExistBetween(leftBracket, rightBracket)) { + return; // eslint-disable-line eslint-plugin/fixer-return -- false positive + } + + // Replace the brackets by an identifier. + if (!node.optional) { + yield fixer.insertTextBefore( + leftBracket, + astUtils.isDecimalInteger(node.object) ? " ." : "." + ); + } + yield fixer.replaceTextRange( + [leftBracket.range[0], rightBracket.range[1]], + value + ); + + // Insert a space after the property if it will be connected to the next token. + if ( + nextToken && + rightBracket.range[1] === nextToken.range[0] && + !astUtils.canTokensBeAdjacent(String(value), nextToken) + ) { + yield fixer.insertTextAfter(node, " "); + } + } + }); + } + } + + return { + MemberExpression(node) { + if ( + node.computed && + node.property.type === "Literal" && + (literalTypesToCheck.has(typeof node.property.value) || astUtils.isNullLiteral(node.property)) + ) { + checkComputedProperty(node, node.property.value); + } + if ( + node.computed && + node.property.type === "TemplateLiteral" && + node.property.expressions.length === 0 + ) { + checkComputedProperty(node, node.property.quasis[0].value.cooked); + } + if ( + !allowKeywords && + !node.computed && + keywords.indexOf(String(node.property.name)) !== -1 + ) { + context.report({ + node: node.property, + messageId: "useBrackets", + data: { + key: node.property.name + }, + *fix(fixer) { + const dotToken = sourceCode.getTokenBefore(node.property); + + // A statement that starts with `let[` is parsed as a destructuring variable declaration, not a MemberExpression. + if (node.object.type === "Identifier" && node.object.name === "let" && !node.optional) { + return; // eslint-disable-line eslint-plugin/fixer-return -- false positive + } + + // Don't perform any fixes if there are comments between the dot and the property name. + if (sourceCode.commentsExistBetween(dotToken, node.property)) { + return; // eslint-disable-line eslint-plugin/fixer-return -- false positive + } + + // Replace the identifier to brackets. + if (!node.optional) { + yield fixer.remove(dotToken); + } + yield fixer.replaceText(node.property, `["${node.property.name}"]`); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/eol-last.js b/node_modules/eslint/lib/rules/eol-last.js new file mode 100644 index 000000000..fbba6c8f5 --- /dev/null +++ b/node_modules/eslint/lib/rules/eol-last.js @@ -0,0 +1,112 @@ +/** + * @fileoverview Require or disallow newline at the end of files + * @author Nodeca Team + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow newline at the end of files", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/eol-last" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never", "unix", "windows"] + } + ], + + messages: { + missing: "Newline required at end of file but not found.", + unexpected: "Newline not allowed at end of file." + } + }, + create(context) { + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program: function checkBadEOF(node) { + const sourceCode = context.getSourceCode(), + src = sourceCode.getText(), + location = { + column: lodash.last(sourceCode.lines).length, + line: sourceCode.lines.length + }, + LF = "\n", + CRLF = `\r${LF}`, + endsWithNewline = lodash.endsWith(src, LF); + + /* + * Empty source is always valid: No content in file so we don't + * need to lint for a newline on the last line of content. + */ + if (!src.length) { + return; + } + + let mode = context.options[0] || "always", + appendCRLF = false; + + if (mode === "unix") { + + // `"unix"` should behave exactly as `"always"` + mode = "always"; + } + if (mode === "windows") { + + // `"windows"` should behave exactly as `"always"`, but append CRLF in the fixer for backwards compatibility + mode = "always"; + appendCRLF = true; + } + if (mode === "always" && !endsWithNewline) { + + // File is not newline-terminated, but should be + context.report({ + node, + loc: location, + messageId: "missing", + fix(fixer) { + return fixer.insertTextAfterRange([0, src.length], appendCRLF ? CRLF : LF); + } + }); + } else if (mode === "never" && endsWithNewline) { + + // File is newline-terminated, but shouldn't be + context.report({ + node, + loc: location, + messageId: "unexpected", + fix(fixer) { + const finalEOLs = /(?:\r?\n)+$/u, + match = finalEOLs.exec(sourceCode.text), + start = match.index, + end = sourceCode.text.length; + + return fixer.replaceTextRange([start, end], ""); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/eqeqeq.js b/node_modules/eslint/lib/rules/eqeqeq.js new file mode 100644 index 000000000..57926dbed --- /dev/null +++ b/node_modules/eslint/lib/rules/eqeqeq.js @@ -0,0 +1,174 @@ +/** + * @fileoverview Rule to flag statements that use != and == instead of !== and === + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require the use of `===` and `!==`", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/eqeqeq" + }, + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["always"] + }, + { + type: "object", + properties: { + null: { + enum: ["always", "never", "ignore"] + } + }, + additionalProperties: false + } + ], + additionalItems: false + }, + { + type: "array", + items: [ + { + enum: ["smart", "allow-null"] + } + ], + additionalItems: false + } + ] + }, + + fixable: "code", + + messages: { + unexpected: "Expected '{{expectedOperator}}' and instead saw '{{actualOperator}}'." + } + }, + + create(context) { + const config = context.options[0] || "always"; + const options = context.options[1] || {}; + const sourceCode = context.getSourceCode(); + + const nullOption = (config === "always") + ? options.null || "always" + : "ignore"; + const enforceRuleForNull = (nullOption === "always"); + const enforceInverseRuleForNull = (nullOption === "never"); + + /** + * Checks if an expression is a typeof expression + * @param {ASTNode} node The node to check + * @returns {boolean} if the node is a typeof expression + */ + function isTypeOf(node) { + return node.type === "UnaryExpression" && node.operator === "typeof"; + } + + /** + * Checks if either operand of a binary expression is a typeof operation + * @param {ASTNode} node The node to check + * @returns {boolean} if one of the operands is typeof + * @private + */ + function isTypeOfBinary(node) { + return isTypeOf(node.left) || isTypeOf(node.right); + } + + /** + * Checks if operands are literals of the same type (via typeof) + * @param {ASTNode} node The node to check + * @returns {boolean} if operands are of same type + * @private + */ + function areLiteralsAndSameType(node) { + return node.left.type === "Literal" && node.right.type === "Literal" && + typeof node.left.value === typeof node.right.value; + } + + /** + * Checks if one of the operands is a literal null + * @param {ASTNode} node The node to check + * @returns {boolean} if operands are null + * @private + */ + function isNullCheck(node) { + return astUtils.isNullLiteral(node.right) || astUtils.isNullLiteral(node.left); + } + + /** + * Reports a message for this rule. + * @param {ASTNode} node The binary expression node that was checked + * @param {string} expectedOperator The operator that was expected (either '==', '!=', '===', or '!==') + * @returns {void} + * @private + */ + function report(node, expectedOperator) { + const operatorToken = sourceCode.getFirstTokenBetween( + node.left, + node.right, + token => token.value === node.operator + ); + + context.report({ + node, + loc: operatorToken.loc, + messageId: "unexpected", + data: { expectedOperator, actualOperator: node.operator }, + fix(fixer) { + + // If the comparison is a `typeof` comparison or both sides are literals with the same type, then it's safe to fix. + if (isTypeOfBinary(node) || areLiteralsAndSameType(node)) { + return fixer.replaceText(operatorToken, expectedOperator); + } + return null; + } + }); + } + + return { + BinaryExpression(node) { + const isNull = isNullCheck(node); + + if (node.operator !== "==" && node.operator !== "!=") { + if (enforceInverseRuleForNull && isNull) { + report(node, node.operator.slice(0, -1)); + } + return; + } + + if (config === "smart" && (isTypeOfBinary(node) || + areLiteralsAndSameType(node) || isNull)) { + return; + } + + if (!enforceRuleForNull && isNull) { + return; + } + + report(node, `${node.operator}=`); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/for-direction.js b/node_modules/eslint/lib/rules/for-direction.js new file mode 100644 index 000000000..c15d10e5f --- /dev/null +++ b/node_modules/eslint/lib/rules/for-direction.js @@ -0,0 +1,126 @@ +/** + * @fileoverview enforce "for" loop update clause moving the counter in the right direction.(for-direction) + * @author Aladdin-ADD + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "enforce \"for\" loop update clause moving the counter in the right direction.", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/for-direction" + }, + + fixable: null, + schema: [], + + messages: { + incorrectDirection: "The update clause in this loop moves the variable in the wrong direction." + } + }, + + create(context) { + + /** + * report an error. + * @param {ASTNode} node the node to report. + * @returns {void} + */ + function report(node) { + context.report({ + node, + messageId: "incorrectDirection" + }); + } + + /** + * check the right side of the assignment + * @param {ASTNode} update UpdateExpression to check + * @param {int} dir expected direction that could either be turned around or invalidated + * @returns {int} return dir, the negated dir or zero if it's not clear for identifiers + */ + function getRightDirection(update, dir) { + if (update.right.type === "UnaryExpression") { + if (update.right.operator === "-") { + return -dir; + } + } else if (update.right.type === "Identifier") { + return 0; + } + return dir; + } + + /** + * check UpdateExpression add/sub the counter + * @param {ASTNode} update UpdateExpression to check + * @param {string} counter variable name to check + * @returns {int} if add return 1, if sub return -1, if nochange, return 0 + */ + function getUpdateDirection(update, counter) { + if (update.argument.type === "Identifier" && update.argument.name === counter) { + if (update.operator === "++") { + return 1; + } + if (update.operator === "--") { + return -1; + } + } + return 0; + } + + /** + * check AssignmentExpression add/sub the counter + * @param {ASTNode} update AssignmentExpression to check + * @param {string} counter variable name to check + * @returns {int} if add return 1, if sub return -1, if nochange, return 0 + */ + function getAssignmentDirection(update, counter) { + if (update.left.name === counter) { + if (update.operator === "+=") { + return getRightDirection(update, 1); + } + if (update.operator === "-=") { + return getRightDirection(update, -1); + } + } + return 0; + } + return { + ForStatement(node) { + + if (node.test && node.test.type === "BinaryExpression" && node.test.left.type === "Identifier" && node.update) { + const counter = node.test.left.name; + const operator = node.test.operator; + const update = node.update; + + let wrongDirection; + + if (operator === "<" || operator === "<=") { + wrongDirection = -1; + } else if (operator === ">" || operator === ">=") { + wrongDirection = 1; + } else { + return; + } + + if (update.type === "UpdateExpression") { + if (getUpdateDirection(update, counter) === wrongDirection) { + report(node); + } + } else if (update.type === "AssignmentExpression" && getAssignmentDirection(update, counter) === wrongDirection) { + report(node); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/func-call-spacing.js b/node_modules/eslint/lib/rules/func-call-spacing.js new file mode 100644 index 000000000..8fe690d4a --- /dev/null +++ b/node_modules/eslint/lib/rules/func-call-spacing.js @@ -0,0 +1,230 @@ +/** + * @fileoverview Rule to control spacing within function calls + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow spacing between function identifiers and their invocations", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/func-call-spacing" + }, + + fixable: "whitespace", + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["never"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["always"] + }, + { + type: "object", + properties: { + allowNewlines: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + messages: { + unexpectedWhitespace: "Unexpected whitespace between function name and paren.", + unexpectedNewline: "Unexpected newline between function name and paren.", + missing: "Missing space between function name and paren." + } + }, + + create(context) { + + const never = context.options[0] !== "always"; + const allowNewlines = !never && context.options[1] && context.options[1].allowNewlines; + const sourceCode = context.getSourceCode(); + const text = sourceCode.getText(); + + /** + * Check if open space is present in a function name + * @param {ASTNode} node node to evaluate + * @param {Token} leftToken The last token of the callee. This may be the closing parenthesis that encloses the callee. + * @param {Token} rightToken Tha first token of the arguments. this is the opening parenthesis that encloses the arguments. + * @returns {void} + * @private + */ + function checkSpacing(node, leftToken, rightToken) { + const textBetweenTokens = text.slice(leftToken.range[1], rightToken.range[0]).replace(/\/\*.*?\*\//gu, ""); + const hasWhitespace = /\s/u.test(textBetweenTokens); + const hasNewline = hasWhitespace && astUtils.LINEBREAK_MATCHER.test(textBetweenTokens); + + /* + * never allowNewlines hasWhitespace hasNewline message + * F F F F Missing space between function name and paren. + * F F F T (Invalid `!hasWhitespace && hasNewline`) + * F F T T Unexpected newline between function name and paren. + * F F T F (OK) + * F T T F (OK) + * F T T T (OK) + * F T F T (Invalid `!hasWhitespace && hasNewline`) + * F T F F Missing space between function name and paren. + * T T F F (Invalid `never && allowNewlines`) + * T T F T (Invalid `!hasWhitespace && hasNewline`) + * T T T T (Invalid `never && allowNewlines`) + * T T T F (Invalid `never && allowNewlines`) + * T F T F Unexpected space between function name and paren. + * T F T T Unexpected space between function name and paren. + * T F F T (Invalid `!hasWhitespace && hasNewline`) + * T F F F (OK) + * + * T T Unexpected space between function name and paren. + * F F Missing space between function name and paren. + * F F T Unexpected newline between function name and paren. + */ + + if (never && hasWhitespace) { + context.report({ + node, + loc: { + start: leftToken.loc.end, + end: { + line: rightToken.loc.start.line, + column: rightToken.loc.start.column - 1 + } + }, + messageId: "unexpectedWhitespace", + fix(fixer) { + + // Don't remove comments. + if (sourceCode.commentsExistBetween(leftToken, rightToken)) { + return null; + } + + // If `?.` exsits, it doesn't hide no-undexpected-multiline errors + if (node.optional) { + return fixer.replaceTextRange([leftToken.range[1], rightToken.range[0]], "?."); + } + + /* + * Only autofix if there is no newline + * https://github.com/eslint/eslint/issues/7787 + */ + if (hasNewline) { + return null; + } + return fixer.removeRange([leftToken.range[1], rightToken.range[0]]); + } + }); + } else if (!never && !hasWhitespace) { + context.report({ + node, + loc: { + start: { + line: leftToken.loc.end.line, + column: leftToken.loc.end.column - 1 + }, + end: rightToken.loc.start + }, + messageId: "missing", + fix(fixer) { + if (node.optional) { + return null; // Not sure if inserting a space to either before/after `?.` token. + } + return fixer.insertTextBefore(rightToken, " "); + } + }); + } else if (!never && !allowNewlines && hasNewline) { + context.report({ + node, + loc: { + start: leftToken.loc.end, + end: rightToken.loc.start + }, + messageId: "unexpectedNewline", + fix(fixer) { + + /* + * Only autofix if there is no newline + * https://github.com/eslint/eslint/issues/7787 + * But if `?.` exsits, it doesn't hide no-undexpected-multiline errors + */ + if (!node.optional) { + return null; + } + + // Don't remove comments. + if (sourceCode.commentsExistBetween(leftToken, rightToken)) { + return null; + } + + const range = [leftToken.range[1], rightToken.range[0]]; + const qdToken = sourceCode.getTokenAfter(leftToken); + + if (qdToken.range[0] === leftToken.range[1]) { + return fixer.replaceTextRange(range, "?. "); + } + if (qdToken.range[1] === rightToken.range[0]) { + return fixer.replaceTextRange(range, " ?."); + } + return fixer.replaceTextRange(range, " ?. "); + } + }); + } + } + + return { + "CallExpression, NewExpression"(node) { + const lastToken = sourceCode.getLastToken(node); + const lastCalleeToken = sourceCode.getLastToken(node.callee); + const parenToken = sourceCode.getFirstTokenBetween(lastCalleeToken, lastToken, astUtils.isOpeningParenToken); + const prevToken = parenToken && sourceCode.getTokenBefore(parenToken, astUtils.isNotQuestionDotToken); + + // Parens in NewExpression are optional + if (!(parenToken && parenToken.range[1] < node.range[1])) { + return; + } + + checkSpacing(node, prevToken, parenToken); + }, + + ImportExpression(node) { + const leftToken = sourceCode.getFirstToken(node); + const rightToken = sourceCode.getTokenAfter(leftToken); + + checkSpacing(node, leftToken, rightToken); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/func-name-matching.js b/node_modules/eslint/lib/rules/func-name-matching.js new file mode 100644 index 000000000..755c2ee50 --- /dev/null +++ b/node_modules/eslint/lib/rules/func-name-matching.js @@ -0,0 +1,249 @@ +/** + * @fileoverview Rule to require function names to match the name of the variable or property to which they are assigned. + * @author Annie Zhang, Pavel Strashkin + */ + +"use strict"; + +//-------------------------------------------------------------------------- +// Requirements +//-------------------------------------------------------------------------- + +const astUtils = require("./utils/ast-utils"); +const esutils = require("esutils"); + +//-------------------------------------------------------------------------- +// Helpers +//-------------------------------------------------------------------------- + +/** + * Determines if a pattern is `module.exports` or `module["exports"]` + * @param {ASTNode} pattern The left side of the AssignmentExpression + * @returns {boolean} True if the pattern is `module.exports` or `module["exports"]` + */ +function isModuleExports(pattern) { + if (pattern.type === "MemberExpression" && pattern.object.type === "Identifier" && pattern.object.name === "module") { + + // module.exports + if (pattern.property.type === "Identifier" && pattern.property.name === "exports") { + return true; + } + + // module["exports"] + if (pattern.property.type === "Literal" && pattern.property.value === "exports") { + return true; + } + } + return false; +} + +/** + * Determines if a string name is a valid identifier + * @param {string} name The string to be checked + * @param {int} ecmaVersion The ECMAScript version if specified in the parserOptions config + * @returns {boolean} True if the string is a valid identifier + */ +function isIdentifier(name, ecmaVersion) { + if (ecmaVersion >= 6) { + return esutils.keyword.isIdentifierES6(name); + } + return esutils.keyword.isIdentifierES5(name); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const alwaysOrNever = { enum: ["always", "never"] }; +const optionsObject = { + type: "object", + properties: { + considerPropertyDescriptor: { + type: "boolean" + }, + includeCommonJSModuleExports: { + type: "boolean" + } + }, + additionalProperties: false +}; + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require function names to match the name of the variable or property to which they are assigned", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/func-name-matching" + }, + + schema: { + anyOf: [{ + type: "array", + additionalItems: false, + items: [alwaysOrNever, optionsObject] + }, { + type: "array", + additionalItems: false, + items: [optionsObject] + }] + }, + + messages: { + matchProperty: "Function name `{{funcName}}` should match property name `{{name}}`.", + matchVariable: "Function name `{{funcName}}` should match variable name `{{name}}`.", + notMatchProperty: "Function name `{{funcName}}` should not match property name `{{name}}`.", + notMatchVariable: "Function name `{{funcName}}` should not match variable name `{{name}}`." + } + }, + + create(context) { + const options = (typeof context.options[0] === "object" ? context.options[0] : context.options[1]) || {}; + const nameMatches = typeof context.options[0] === "string" ? context.options[0] : "always"; + const considerPropertyDescriptor = options.considerPropertyDescriptor; + const includeModuleExports = options.includeCommonJSModuleExports; + const ecmaVersion = context.parserOptions && context.parserOptions.ecmaVersion ? context.parserOptions.ecmaVersion : 5; + + /** + * Check whether node is a certain CallExpression. + * @param {string} objName object name + * @param {string} funcName function name + * @param {ASTNode} node The node to check + * @returns {boolean} `true` if node matches CallExpression + */ + function isPropertyCall(objName, funcName, node) { + if (!node) { + return false; + } + return node.type === "CallExpression" && astUtils.isSpecificMemberAccess(node.callee, objName, funcName); + } + + /** + * Compares identifiers based on the nameMatches option + * @param {string} x the first identifier + * @param {string} y the second identifier + * @returns {boolean} whether the two identifiers should warn. + */ + function shouldWarn(x, y) { + return (nameMatches === "always" && x !== y) || (nameMatches === "never" && x === y); + } + + /** + * Reports + * @param {ASTNode} node The node to report + * @param {string} name The variable or property name + * @param {string} funcName The function name + * @param {boolean} isProp True if the reported node is a property assignment + * @returns {void} + */ + function report(node, name, funcName, isProp) { + let messageId; + + if (nameMatches === "always" && isProp) { + messageId = "matchProperty"; + } else if (nameMatches === "always") { + messageId = "matchVariable"; + } else if (isProp) { + messageId = "notMatchProperty"; + } else { + messageId = "notMatchVariable"; + } + context.report({ + node, + messageId, + data: { + name, + funcName + } + }); + } + + /** + * Determines whether a given node is a string literal + * @param {ASTNode} node The node to check + * @returns {boolean} `true` if the node is a string literal + */ + function isStringLiteral(node) { + return node.type === "Literal" && typeof node.value === "string"; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + VariableDeclarator(node) { + if (!node.init || node.init.type !== "FunctionExpression" || node.id.type !== "Identifier") { + return; + } + if (node.init.id && shouldWarn(node.id.name, node.init.id.name)) { + report(node, node.id.name, node.init.id.name, false); + } + }, + + AssignmentExpression(node) { + if ( + node.right.type !== "FunctionExpression" || + (node.left.computed && node.left.property.type !== "Literal") || + (!includeModuleExports && isModuleExports(node.left)) || + (node.left.type !== "Identifier" && node.left.type !== "MemberExpression") + ) { + return; + } + + const isProp = node.left.type === "MemberExpression"; + const name = isProp ? astUtils.getStaticPropertyName(node.left) : node.left.name; + + if (node.right.id && isIdentifier(name) && shouldWarn(name, node.right.id.name)) { + report(node, name, node.right.id.name, isProp); + } + }, + + Property(node) { + if (node.value.type !== "FunctionExpression" || !node.value.id || node.computed && !isStringLiteral(node.key)) { + return; + } + + if (node.key.type === "Identifier") { + const functionName = node.value.id.name; + let propertyName = node.key.name; + + if (considerPropertyDescriptor && propertyName === "value") { + if (isPropertyCall("Object", "defineProperty", node.parent.parent) || isPropertyCall("Reflect", "defineProperty", node.parent.parent)) { + const property = node.parent.parent.arguments[1]; + + if (isStringLiteral(property) && shouldWarn(property.value, functionName)) { + report(node, property.value, functionName, true); + } + } else if (isPropertyCall("Object", "defineProperties", node.parent.parent.parent.parent)) { + propertyName = node.parent.parent.key.name; + if (!node.parent.parent.computed && shouldWarn(propertyName, functionName)) { + report(node, propertyName, functionName, true); + } + } else if (isPropertyCall("Object", "create", node.parent.parent.parent.parent)) { + propertyName = node.parent.parent.key.name; + if (!node.parent.parent.computed && shouldWarn(propertyName, functionName)) { + report(node, propertyName, functionName, true); + } + } else if (shouldWarn(propertyName, functionName)) { + report(node, propertyName, functionName, true); + } + } else if (shouldWarn(propertyName, functionName)) { + report(node, propertyName, functionName, true); + } + return; + } + + if ( + isStringLiteral(node.key) && + isIdentifier(node.key.value, ecmaVersion) && + shouldWarn(node.key.value, node.value.id.name) + ) { + report(node, node.key.value, node.value.id.name, true); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/func-names.js b/node_modules/eslint/lib/rules/func-names.js new file mode 100644 index 000000000..ecfedb9e0 --- /dev/null +++ b/node_modules/eslint/lib/rules/func-names.js @@ -0,0 +1,190 @@ +/** + * @fileoverview Rule to warn when a function expression does not have a name. + * @author Kyle T. Nunery + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +/** + * Checks whether or not a given variable is a function name. + * @param {eslint-scope.Variable} variable A variable to check. + * @returns {boolean} `true` if the variable is a function name. + */ +function isFunctionName(variable) { + return variable && variable.defs[0].type === "FunctionName"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require or disallow named `function` expressions", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/func-names" + }, + + schema: { + definitions: { + value: { + enum: [ + "always", + "as-needed", + "never" + ] + } + }, + items: [ + { + $ref: "#/definitions/value" + }, + { + type: "object", + properties: { + generators: { + $ref: "#/definitions/value" + } + }, + additionalProperties: false + } + ] + }, + + messages: { + unnamed: "Unexpected unnamed {{name}}.", + named: "Unexpected named {{name}}." + } + }, + + create(context) { + + const sourceCode = context.getSourceCode(); + + /** + * Returns the config option for the given node. + * @param {ASTNode} node A node to get the config for. + * @returns {string} The config option. + */ + function getConfigForNode(node) { + if ( + node.generator && + context.options.length > 1 && + context.options[1].generators + ) { + return context.options[1].generators; + } + + return context.options[0] || "always"; + } + + /** + * Determines whether the current FunctionExpression node is a get, set, or + * shorthand method in an object literal or a class. + * @param {ASTNode} node A node to check. + * @returns {boolean} True if the node is a get, set, or shorthand method. + */ + function isObjectOrClassMethod(node) { + const parent = node.parent; + + return (parent.type === "MethodDefinition" || ( + parent.type === "Property" && ( + parent.method || + parent.kind === "get" || + parent.kind === "set" + ) + )); + } + + /** + * Determines whether the current FunctionExpression node has a name that would be + * inferred from context in a conforming ES6 environment. + * @param {ASTNode} node A node to check. + * @returns {boolean} True if the node would have a name assigned automatically. + */ + function hasInferredName(node) { + const parent = node.parent; + + return isObjectOrClassMethod(node) || + (parent.type === "VariableDeclarator" && parent.id.type === "Identifier" && parent.init === node) || + (parent.type === "Property" && parent.value === node) || + (parent.type === "AssignmentExpression" && parent.left.type === "Identifier" && parent.right === node) || + (parent.type === "AssignmentPattern" && parent.left.type === "Identifier" && parent.right === node); + } + + /** + * Reports that an unnamed function should be named + * @param {ASTNode} node The node to report in the event of an error. + * @returns {void} + */ + function reportUnexpectedUnnamedFunction(node) { + context.report({ + node, + messageId: "unnamed", + loc: astUtils.getFunctionHeadLoc(node, sourceCode), + data: { name: astUtils.getFunctionNameWithKind(node) } + }); + } + + /** + * Reports that a named function should be unnamed + * @param {ASTNode} node The node to report in the event of an error. + * @returns {void} + */ + function reportUnexpectedNamedFunction(node) { + context.report({ + node, + messageId: "named", + loc: astUtils.getFunctionHeadLoc(node, sourceCode), + data: { name: astUtils.getFunctionNameWithKind(node) } + }); + } + + /** + * The listener for function nodes. + * @param {ASTNode} node function node + * @returns {void} + */ + function handleFunction(node) { + + // Skip recursive functions. + const nameVar = context.getDeclaredVariables(node)[0]; + + if (isFunctionName(nameVar) && nameVar.references.length > 0) { + return; + } + + const hasName = Boolean(node.id && node.id.name); + const config = getConfigForNode(node); + + if (config === "never") { + if (hasName && node.type !== "FunctionDeclaration") { + reportUnexpectedNamedFunction(node); + } + } else if (config === "as-needed") { + if (!hasName && !hasInferredName(node)) { + reportUnexpectedUnnamedFunction(node); + } + } else { + if (!hasName && !isObjectOrClassMethod(node)) { + reportUnexpectedUnnamedFunction(node); + } + } + } + + return { + "FunctionExpression:exit": handleFunction, + "ExportDefaultDeclaration > FunctionDeclaration": handleFunction + }; + } +}; diff --git a/node_modules/eslint/lib/rules/func-style.js b/node_modules/eslint/lib/rules/func-style.js new file mode 100644 index 000000000..e150b1a76 --- /dev/null +++ b/node_modules/eslint/lib/rules/func-style.js @@ -0,0 +1,98 @@ +/** + * @fileoverview Rule to enforce a particular function style + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce the consistent use of either `function` declarations or expressions", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/func-style" + }, + + schema: [ + { + enum: ["declaration", "expression"] + }, + { + type: "object", + properties: { + allowArrowFunctions: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + expression: "Expected a function expression.", + declaration: "Expected a function declaration." + } + }, + + create(context) { + + const style = context.options[0], + allowArrowFunctions = context.options[1] && context.options[1].allowArrowFunctions, + enforceDeclarations = (style === "declaration"), + stack = []; + + const nodesToCheck = { + FunctionDeclaration(node) { + stack.push(false); + + if (!enforceDeclarations && node.parent.type !== "ExportDefaultDeclaration") { + context.report({ node, messageId: "expression" }); + } + }, + "FunctionDeclaration:exit"() { + stack.pop(); + }, + + FunctionExpression(node) { + stack.push(false); + + if (enforceDeclarations && node.parent.type === "VariableDeclarator") { + context.report({ node: node.parent, messageId: "declaration" }); + } + }, + "FunctionExpression:exit"() { + stack.pop(); + }, + + ThisExpression() { + if (stack.length > 0) { + stack[stack.length - 1] = true; + } + } + }; + + if (!allowArrowFunctions) { + nodesToCheck.ArrowFunctionExpression = function() { + stack.push(false); + }; + + nodesToCheck["ArrowFunctionExpression:exit"] = function(node) { + const hasThisExpr = stack.pop(); + + if (enforceDeclarations && !hasThisExpr && node.parent.type === "VariableDeclarator") { + context.report({ node: node.parent, messageId: "declaration" }); + } + }; + } + + return nodesToCheck; + + } +}; diff --git a/node_modules/eslint/lib/rules/function-call-argument-newline.js b/node_modules/eslint/lib/rules/function-call-argument-newline.js new file mode 100644 index 000000000..b6abbe95f --- /dev/null +++ b/node_modules/eslint/lib/rules/function-call-argument-newline.js @@ -0,0 +1,122 @@ +/** + * @fileoverview Rule to enforce line breaks between arguments of a function call + * @author Alexey Gonchar + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce line breaks between arguments of a function call", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/function-call-argument-newline" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never", "consistent"] + } + ], + + messages: { + unexpectedLineBreak: "There should be no line break here.", + missingLineBreak: "There should be a line break after this argument." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + const checkers = { + unexpected: { + messageId: "unexpectedLineBreak", + check: (prevToken, currentToken) => prevToken.loc.end.line !== currentToken.loc.start.line, + createFix: (token, tokenBefore) => fixer => + fixer.replaceTextRange([tokenBefore.range[1], token.range[0]], " ") + }, + missing: { + messageId: "missingLineBreak", + check: (prevToken, currentToken) => prevToken.loc.end.line === currentToken.loc.start.line, + createFix: (token, tokenBefore) => fixer => + fixer.replaceTextRange([tokenBefore.range[1], token.range[0]], "\n") + } + }; + + /** + * Check all arguments for line breaks in the CallExpression + * @param {CallExpression} node node to evaluate + * @param {{ messageId: string, check: Function }} checker selected checker + * @returns {void} + * @private + */ + function checkArguments(node, checker) { + for (let i = 1; i < node.arguments.length; i++) { + const prevArgToken = sourceCode.getLastToken(node.arguments[i - 1]); + const currentArgToken = sourceCode.getFirstToken(node.arguments[i]); + + if (checker.check(prevArgToken, currentArgToken)) { + const tokenBefore = sourceCode.getTokenBefore( + currentArgToken, + { includeComments: true } + ); + + const hasLineCommentBefore = tokenBefore.type === "Line"; + + context.report({ + node, + loc: { + start: tokenBefore.loc.end, + end: currentArgToken.loc.start + }, + messageId: checker.messageId, + fix: hasLineCommentBefore ? null : checker.createFix(currentArgToken, tokenBefore) + }); + } + } + } + + /** + * Check if open space is present in a function name + * @param {CallExpression} node node to evaluate + * @returns {void} + * @private + */ + function check(node) { + if (node.arguments.length < 2) { + return; + } + + const option = context.options[0] || "always"; + + if (option === "never") { + checkArguments(node, checkers.unexpected); + } else if (option === "always") { + checkArguments(node, checkers.missing); + } else if (option === "consistent") { + const firstArgToken = sourceCode.getLastToken(node.arguments[0]); + const secondArgToken = sourceCode.getFirstToken(node.arguments[1]); + + if (firstArgToken.loc.end.line === secondArgToken.loc.start.line) { + checkArguments(node, checkers.unexpected); + } else { + checkArguments(node, checkers.missing); + } + } + } + + return { + CallExpression: check, + NewExpression: check + }; + } +}; diff --git a/node_modules/eslint/lib/rules/function-paren-newline.js b/node_modules/eslint/lib/rules/function-paren-newline.js new file mode 100644 index 000000000..894c8e331 --- /dev/null +++ b/node_modules/eslint/lib/rules/function-paren-newline.js @@ -0,0 +1,281 @@ +/** + * @fileoverview enforce consistent line breaks inside function parentheses + * @author Teddy Katz + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent line breaks inside function parentheses", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/function-paren-newline" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["always", "never", "consistent", "multiline", "multiline-arguments"] + }, + { + type: "object", + properties: { + minItems: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + expectedBefore: "Expected newline before ')'.", + expectedAfter: "Expected newline after '('.", + expectedBetween: "Expected newline between arguments/params.", + unexpectedBefore: "Unexpected newline before ')'.", + unexpectedAfter: "Unexpected newline after '('." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const rawOption = context.options[0] || "multiline"; + const multilineOption = rawOption === "multiline"; + const multilineArgumentsOption = rawOption === "multiline-arguments"; + const consistentOption = rawOption === "consistent"; + let minItems; + + if (typeof rawOption === "object") { + minItems = rawOption.minItems; + } else if (rawOption === "always") { + minItems = 0; + } else if (rawOption === "never") { + minItems = Infinity; + } else { + minItems = null; + } + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Determines whether there should be newlines inside function parens + * @param {ASTNode[]} elements The arguments or parameters in the list + * @param {boolean} hasLeftNewline `true` if the left paren has a newline in the current code. + * @returns {boolean} `true` if there should be newlines inside the function parens + */ + function shouldHaveNewlines(elements, hasLeftNewline) { + if (multilineArgumentsOption && elements.length === 1) { + return hasLeftNewline; + } + if (multilineOption || multilineArgumentsOption) { + return elements.some((element, index) => index !== elements.length - 1 && element.loc.end.line !== elements[index + 1].loc.start.line); + } + if (consistentOption) { + return hasLeftNewline; + } + return elements.length >= minItems; + } + + /** + * Validates parens + * @param {Object} parens An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token + * @param {ASTNode[]} elements The arguments or parameters in the list + * @returns {void} + */ + function validateParens(parens, elements) { + const leftParen = parens.leftParen; + const rightParen = parens.rightParen; + const tokenAfterLeftParen = sourceCode.getTokenAfter(leftParen); + const tokenBeforeRightParen = sourceCode.getTokenBefore(rightParen); + const hasLeftNewline = !astUtils.isTokenOnSameLine(leftParen, tokenAfterLeftParen); + const hasRightNewline = !astUtils.isTokenOnSameLine(tokenBeforeRightParen, rightParen); + const needsNewlines = shouldHaveNewlines(elements, hasLeftNewline); + + if (hasLeftNewline && !needsNewlines) { + context.report({ + node: leftParen, + messageId: "unexpectedAfter", + fix(fixer) { + return sourceCode.getText().slice(leftParen.range[1], tokenAfterLeftParen.range[0]).trim() + + // If there is a comment between the ( and the first element, don't do a fix. + ? null + : fixer.removeRange([leftParen.range[1], tokenAfterLeftParen.range[0]]); + } + }); + } else if (!hasLeftNewline && needsNewlines) { + context.report({ + node: leftParen, + messageId: "expectedAfter", + fix: fixer => fixer.insertTextAfter(leftParen, "\n") + }); + } + + if (hasRightNewline && !needsNewlines) { + context.report({ + node: rightParen, + messageId: "unexpectedBefore", + fix(fixer) { + return sourceCode.getText().slice(tokenBeforeRightParen.range[1], rightParen.range[0]).trim() + + // If there is a comment between the last element and the ), don't do a fix. + ? null + : fixer.removeRange([tokenBeforeRightParen.range[1], rightParen.range[0]]); + } + }); + } else if (!hasRightNewline && needsNewlines) { + context.report({ + node: rightParen, + messageId: "expectedBefore", + fix: fixer => fixer.insertTextBefore(rightParen, "\n") + }); + } + } + + /** + * Validates a list of arguments or parameters + * @param {Object} parens An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token + * @param {ASTNode[]} elements The arguments or parameters in the list + * @returns {void} + */ + function validateArguments(parens, elements) { + const leftParen = parens.leftParen; + const tokenAfterLeftParen = sourceCode.getTokenAfter(leftParen); + const hasLeftNewline = !astUtils.isTokenOnSameLine(leftParen, tokenAfterLeftParen); + const needsNewlines = shouldHaveNewlines(elements, hasLeftNewline); + + for (let i = 0; i <= elements.length - 2; i++) { + const currentElement = elements[i]; + const nextElement = elements[i + 1]; + const hasNewLine = currentElement.loc.end.line !== nextElement.loc.start.line; + + if (!hasNewLine && needsNewlines) { + context.report({ + node: currentElement, + messageId: "expectedBetween", + fix: fixer => fixer.insertTextBefore(nextElement, "\n") + }); + } + } + } + + /** + * Gets the left paren and right paren tokens of a node. + * @param {ASTNode} node The node with parens + * @returns {Object} An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token. + * Can also return `null` if an expression has no parens (e.g. a NewExpression with no arguments, or an ArrowFunctionExpression + * with a single parameter) + */ + function getParenTokens(node) { + switch (node.type) { + case "NewExpression": + if (!node.arguments.length && !( + astUtils.isOpeningParenToken(sourceCode.getLastToken(node, { skip: 1 })) && + astUtils.isClosingParenToken(sourceCode.getLastToken(node)) + )) { + + // If the NewExpression does not have parens (e.g. `new Foo`), return null. + return null; + } + + // falls through + + case "CallExpression": + return { + leftParen: sourceCode.getTokenAfter(node.callee, astUtils.isOpeningParenToken), + rightParen: sourceCode.getLastToken(node) + }; + + case "FunctionDeclaration": + case "FunctionExpression": { + const leftParen = sourceCode.getFirstToken(node, astUtils.isOpeningParenToken); + const rightParen = node.params.length + ? sourceCode.getTokenAfter(node.params[node.params.length - 1], astUtils.isClosingParenToken) + : sourceCode.getTokenAfter(leftParen); + + return { leftParen, rightParen }; + } + + case "ArrowFunctionExpression": { + const firstToken = sourceCode.getFirstToken(node); + + if (!astUtils.isOpeningParenToken(firstToken)) { + + // If the ArrowFunctionExpression has a single param without parens, return null. + return null; + } + + return { + leftParen: firstToken, + rightParen: sourceCode.getTokenBefore(node.body, astUtils.isClosingParenToken) + }; + } + + case "ImportExpression": { + const leftParen = sourceCode.getFirstToken(node, 1); + const rightParen = sourceCode.getLastToken(node); + + return { leftParen, rightParen }; + } + + default: + throw new TypeError(`unexpected node with type ${node.type}`); + } + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + [[ + "ArrowFunctionExpression", + "CallExpression", + "FunctionDeclaration", + "FunctionExpression", + "ImportExpression", + "NewExpression" + ]](node) { + const parens = getParenTokens(node); + let params; + + if (node.type === "ImportExpression") { + params = [node.source]; + } else if (astUtils.isFunction(node)) { + params = node.params; + } else { + params = node.arguments; + } + + if (parens) { + validateParens(parens, params); + + if (multilineArgumentsOption) { + validateArguments(parens, params); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/generator-star-spacing.js b/node_modules/eslint/lib/rules/generator-star-spacing.js new file mode 100644 index 000000000..65534f727 --- /dev/null +++ b/node_modules/eslint/lib/rules/generator-star-spacing.js @@ -0,0 +1,206 @@ +/** + * @fileoverview Rule to check the spacing around the * in generator functions. + * @author Jamund Ferguson + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const OVERRIDE_SCHEMA = { + oneOf: [ + { + enum: ["before", "after", "both", "neither"] + }, + { + type: "object", + properties: { + before: { type: "boolean" }, + after: { type: "boolean" } + }, + additionalProperties: false + } + ] +}; + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing around `*` operators in generator functions", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/generator-star-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["before", "after", "both", "neither"] + }, + { + type: "object", + properties: { + before: { type: "boolean" }, + after: { type: "boolean" }, + named: OVERRIDE_SCHEMA, + anonymous: OVERRIDE_SCHEMA, + method: OVERRIDE_SCHEMA + }, + additionalProperties: false + } + ] + } + ], + + messages: { + missingBefore: "Missing space before *.", + missingAfter: "Missing space after *.", + unexpectedBefore: "Unexpected space before *.", + unexpectedAfter: "Unexpected space after *." + } + }, + + create(context) { + + const optionDefinitions = { + before: { before: true, after: false }, + after: { before: false, after: true }, + both: { before: true, after: true }, + neither: { before: false, after: false } + }; + + /** + * Returns resolved option definitions based on an option and defaults + * @param {any} option The option object or string value + * @param {Object} defaults The defaults to use if options are not present + * @returns {Object} the resolved object definition + */ + function optionToDefinition(option, defaults) { + if (!option) { + return defaults; + } + + return typeof option === "string" + ? optionDefinitions[option] + : Object.assign({}, defaults, option); + } + + const modes = (function(option) { + const defaults = optionToDefinition(option, optionDefinitions.before); + + return { + named: optionToDefinition(option.named, defaults), + anonymous: optionToDefinition(option.anonymous, defaults), + method: optionToDefinition(option.method, defaults) + }; + }(context.options[0] || {})); + + const sourceCode = context.getSourceCode(); + + /** + * Checks if the given token is a star token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a star token. + */ + function isStarToken(token) { + return token.value === "*" && token.type === "Punctuator"; + } + + /** + * Gets the generator star token of the given function node. + * @param {ASTNode} node The function node to get. + * @returns {Token} Found star token. + */ + function getStarToken(node) { + return sourceCode.getFirstToken( + (node.parent.method || node.parent.type === "MethodDefinition") ? node.parent : node, + isStarToken + ); + } + + /** + * capitalize a given string. + * @param {string} str the given string. + * @returns {string} the capitalized string. + */ + function capitalize(str) { + return str[0].toUpperCase() + str.slice(1); + } + + /** + * Checks the spacing between two tokens before or after the star token. + * @param {string} kind Either "named", "anonymous", or "method" + * @param {string} side Either "before" or "after". + * @param {Token} leftToken `function` keyword token if side is "before", or + * star token if side is "after". + * @param {Token} rightToken Star token if side is "before", or identifier + * token if side is "after". + * @returns {void} + */ + function checkSpacing(kind, side, leftToken, rightToken) { + if (!!(rightToken.range[0] - leftToken.range[1]) !== modes[kind][side]) { + const after = leftToken.value === "*"; + const spaceRequired = modes[kind][side]; + const node = after ? leftToken : rightToken; + const messageId = `${spaceRequired ? "missing" : "unexpected"}${capitalize(side)}`; + + context.report({ + node, + messageId, + fix(fixer) { + if (spaceRequired) { + if (after) { + return fixer.insertTextAfter(node, " "); + } + return fixer.insertTextBefore(node, " "); + } + return fixer.removeRange([leftToken.range[1], rightToken.range[0]]); + } + }); + } + } + + /** + * Enforces the spacing around the star if node is a generator function. + * @param {ASTNode} node A function expression or declaration node. + * @returns {void} + */ + function checkFunction(node) { + if (!node.generator) { + return; + } + + const starToken = getStarToken(node); + const prevToken = sourceCode.getTokenBefore(starToken); + const nextToken = sourceCode.getTokenAfter(starToken); + + let kind = "named"; + + if (node.parent.type === "MethodDefinition" || (node.parent.type === "Property" && node.parent.method)) { + kind = "method"; + } else if (!node.id) { + kind = "anonymous"; + } + + // Only check before when preceded by `function`|`static` keyword + if (!(kind === "method" && starToken === sourceCode.getFirstToken(node.parent))) { + checkSpacing(kind, "before", prevToken, starToken); + } + + checkSpacing(kind, "after", starToken, nextToken); + } + + return { + FunctionDeclaration: checkFunction, + FunctionExpression: checkFunction + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/getter-return.js b/node_modules/eslint/lib/rules/getter-return.js new file mode 100644 index 000000000..c54ebfb4f --- /dev/null +++ b/node_modules/eslint/lib/rules/getter-return.js @@ -0,0 +1,173 @@ +/** + * @fileoverview Enforces that a return statement is present in property getters. + * @author Aladdin-ADD(hh_2013@foxmail.com) + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ +const TARGET_NODE_TYPE = /^(?:Arrow)?FunctionExpression$/u; + +/** + * Checks a given code path segment is reachable. + * @param {CodePathSegment} segment A segment to check. + * @returns {boolean} `true` if the segment is reachable. + */ +function isReachable(segment) { + return segment.reachable; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "enforce `return` statements in getters", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/getter-return" + }, + + fixable: null, + + schema: [ + { + type: "object", + properties: { + allowImplicit: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + expected: "Expected to return a value in {{name}}.", + expectedAlways: "Expected {{name}} to always return a value." + } + }, + + create(context) { + + const options = context.options[0] || { allowImplicit: false }; + const sourceCode = context.getSourceCode(); + + let funcInfo = { + upper: null, + codePath: null, + hasReturn: false, + shouldCheck: false, + node: null + }; + + /** + * Checks whether or not the last code path segment is reachable. + * Then reports this function if the segment is reachable. + * + * If the last code path segment is reachable, there are paths which are not + * returned or thrown. + * @param {ASTNode} node A node to check. + * @returns {void} + */ + function checkLastSegment(node) { + if (funcInfo.shouldCheck && + funcInfo.codePath.currentSegments.some(isReachable) + ) { + context.report({ + node, + loc: astUtils.getFunctionHeadLoc(node, sourceCode), + messageId: funcInfo.hasReturn ? "expectedAlways" : "expected", + data: { + name: astUtils.getFunctionNameWithKind(funcInfo.node) + } + }); + } + } + + /** + * Checks whether a node means a getter function. + * @param {ASTNode} node a node to check. + * @returns {boolean} if node means a getter, return true; else return false. + */ + function isGetter(node) { + const parent = node.parent; + + if (TARGET_NODE_TYPE.test(node.type) && node.body.type === "BlockStatement") { + if (parent.kind === "get") { + return true; + } + if (parent.type === "Property" && astUtils.getStaticPropertyName(parent) === "get" && parent.parent.type === "ObjectExpression") { + + // Object.defineProperty() + if (parent.parent.parent.type === "CallExpression" && + astUtils.getStaticPropertyName(parent.parent.parent.callee) === "defineProperty") { + return true; + } + + // Object.defineProperties() + if (parent.parent.parent.type === "Property" && + parent.parent.parent.parent.type === "ObjectExpression" && + parent.parent.parent.parent.parent.type === "CallExpression" && + astUtils.getStaticPropertyName(parent.parent.parent.parent.parent.callee) === "defineProperties") { + return true; + } + } + } + return false; + } + return { + + // Stacks this function's information. + onCodePathStart(codePath, node) { + funcInfo = { + upper: funcInfo, + codePath, + hasReturn: false, + shouldCheck: isGetter(node), + node + }; + }, + + // Pops this function's information. + onCodePathEnd() { + funcInfo = funcInfo.upper; + }, + + // Checks the return statement is valid. + ReturnStatement(node) { + if (funcInfo.shouldCheck) { + funcInfo.hasReturn = true; + + // if allowImplicit: false, should also check node.argument + if (!options.allowImplicit && !node.argument) { + context.report({ + node, + messageId: "expected", + data: { + name: astUtils.getFunctionNameWithKind(funcInfo.node) + } + }); + } + } + }, + + // Reports a given function if the last path is reachable. + "FunctionExpression:exit": checkLastSegment, + "ArrowFunctionExpression:exit": checkLastSegment + }; + } +}; diff --git a/node_modules/eslint/lib/rules/global-require.js b/node_modules/eslint/lib/rules/global-require.js new file mode 100644 index 000000000..09d033200 --- /dev/null +++ b/node_modules/eslint/lib/rules/global-require.js @@ -0,0 +1,86 @@ +/** + * @fileoverview Rule for disallowing require() outside of the top-level module context + * @author Jamund Ferguson + */ + +"use strict"; + +const ACCEPTABLE_PARENTS = [ + "AssignmentExpression", + "VariableDeclarator", + "MemberExpression", + "ExpressionStatement", + "CallExpression", + "ConditionalExpression", + "Program", + "VariableDeclaration", + "ChainExpression" +]; + +/** + * Finds the eslint-scope reference in the given scope. + * @param {Object} scope The scope to search. + * @param {ASTNode} node The identifier node. + * @returns {Reference|null} Returns the found reference or null if none were found. + */ +function findReference(scope, node) { + const references = scope.references.filter(reference => reference.identifier.range[0] === node.range[0] && + reference.identifier.range[1] === node.range[1]); + + /* istanbul ignore else: correctly returns null */ + if (references.length === 1) { + return references[0]; + } + return null; + +} + +/** + * Checks if the given identifier node is shadowed in the given scope. + * @param {Object} scope The current scope. + * @param {ASTNode} node The identifier node to check. + * @returns {boolean} Whether or not the name is shadowed. + */ +function isShadowed(scope, node) { + const reference = findReference(scope, node); + + return reference && reference.resolved && reference.resolved.defs.length > 0; +} + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "require `require()` calls to be placed at top-level module scope", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/global-require" + }, + + schema: [], + messages: { + unexpected: "Unexpected require()." + } + }, + + create(context) { + return { + CallExpression(node) { + const currentScope = context.getScope(); + + if (node.callee.name === "require" && !isShadowed(currentScope, node.callee)) { + const isGoodRequire = context.getAncestors().every(parent => ACCEPTABLE_PARENTS.indexOf(parent.type) > -1); + + if (!isGoodRequire) { + context.report({ node, messageId: "unexpected" }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/grouped-accessor-pairs.js b/node_modules/eslint/lib/rules/grouped-accessor-pairs.js new file mode 100644 index 000000000..a790f8375 --- /dev/null +++ b/node_modules/eslint/lib/rules/grouped-accessor-pairs.js @@ -0,0 +1,224 @@ +/** + * @fileoverview Rule to require grouped accessor pairs in object literals and classes + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * Property name if it can be computed statically, otherwise the list of the tokens of the key node. + * @typedef {string|Token[]} Key + */ + +/** + * Accessor nodes with the same key. + * @typedef {Object} AccessorData + * @property {Key} key Accessor's key + * @property {ASTNode[]} getters List of getter nodes. + * @property {ASTNode[]} setters List of setter nodes. + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not the given lists represent the equal tokens in the same order. + * Tokens are compared by their properties, not by instance. + * @param {Token[]} left First list of tokens. + * @param {Token[]} right Second list of tokens. + * @returns {boolean} `true` if the lists have same tokens. + */ +function areEqualTokenLists(left, right) { + if (left.length !== right.length) { + return false; + } + + for (let i = 0; i < left.length; i++) { + const leftToken = left[i], + rightToken = right[i]; + + if (leftToken.type !== rightToken.type || leftToken.value !== rightToken.value) { + return false; + } + } + + return true; +} + +/** + * Checks whether or not the given keys are equal. + * @param {Key} left First key. + * @param {Key} right Second key. + * @returns {boolean} `true` if the keys are equal. + */ +function areEqualKeys(left, right) { + if (typeof left === "string" && typeof right === "string") { + + // Statically computed names. + return left === right; + } + if (Array.isArray(left) && Array.isArray(right)) { + + // Token lists. + return areEqualTokenLists(left, right); + } + + return false; +} + +/** + * Checks whether or not a given node is of an accessor kind ('get' or 'set'). + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is of an accessor kind. + */ +function isAccessorKind(node) { + return node.kind === "get" || node.kind === "set"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require grouped accessor pairs in object literals and classes", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/grouped-accessor-pairs" + }, + + schema: [ + { + enum: ["anyOrder", "getBeforeSet", "setBeforeGet"] + } + ], + + messages: { + notGrouped: "Accessor pair {{ formerName }} and {{ latterName }} should be grouped.", + invalidOrder: "Expected {{ latterName }} to be before {{ formerName }}." + } + }, + + create(context) { + const order = context.options[0] || "anyOrder"; + const sourceCode = context.getSourceCode(); + + /** + * Reports the given accessor pair. + * @param {string} messageId messageId to report. + * @param {ASTNode} formerNode getter/setter node that is defined before `latterNode`. + * @param {ASTNode} latterNode getter/setter node that is defined after `formerNode`. + * @returns {void} + * @private + */ + function report(messageId, formerNode, latterNode) { + context.report({ + node: latterNode, + messageId, + loc: astUtils.getFunctionHeadLoc(latterNode.value, sourceCode), + data: { + formerName: astUtils.getFunctionNameWithKind(formerNode.value), + latterName: astUtils.getFunctionNameWithKind(latterNode.value) + } + }); + } + + /** + * Creates a new `AccessorData` object for the given getter or setter node. + * @param {ASTNode} node A getter or setter node. + * @returns {AccessorData} New `AccessorData` object that contains the given node. + * @private + */ + function createAccessorData(node) { + const name = astUtils.getStaticPropertyName(node); + const key = (name !== null) ? name : sourceCode.getTokens(node.key); + + return { + key, + getters: node.kind === "get" ? [node] : [], + setters: node.kind === "set" ? [node] : [] + }; + } + + /** + * Merges the given `AccessorData` object into the given accessors list. + * @param {AccessorData[]} accessors The list to merge into. + * @param {AccessorData} accessorData The object to merge. + * @returns {AccessorData[]} The same instance with the merged object. + * @private + */ + function mergeAccessorData(accessors, accessorData) { + const equalKeyElement = accessors.find(a => areEqualKeys(a.key, accessorData.key)); + + if (equalKeyElement) { + equalKeyElement.getters.push(...accessorData.getters); + equalKeyElement.setters.push(...accessorData.setters); + } else { + accessors.push(accessorData); + } + + return accessors; + } + + /** + * Checks accessor pairs in the given list of nodes. + * @param {ASTNode[]} nodes The list to check. + * @param {Function} shouldCheck – Predicate that returns `true` if the node should be checked. + * @returns {void} + * @private + */ + function checkList(nodes, shouldCheck) { + const accessors = nodes + .filter(shouldCheck) + .filter(isAccessorKind) + .map(createAccessorData) + .reduce(mergeAccessorData, []); + + for (const { getters, setters } of accessors) { + + // Don't report accessor properties that have duplicate getters or setters. + if (getters.length === 1 && setters.length === 1) { + const [getter] = getters, + [setter] = setters, + getterIndex = nodes.indexOf(getter), + setterIndex = nodes.indexOf(setter), + formerNode = getterIndex < setterIndex ? getter : setter, + latterNode = getterIndex < setterIndex ? setter : getter; + + if (Math.abs(getterIndex - setterIndex) > 1) { + report("notGrouped", formerNode, latterNode); + } else if ( + (order === "getBeforeSet" && getterIndex > setterIndex) || + (order === "setBeforeGet" && getterIndex < setterIndex) + ) { + report("invalidOrder", formerNode, latterNode); + } + } + } + } + + return { + ObjectExpression(node) { + checkList(node.properties, n => n.type === "Property"); + }, + ClassBody(node) { + checkList(node.body, n => n.type === "MethodDefinition" && !n.static); + checkList(node.body, n => n.type === "MethodDefinition" && n.static); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/guard-for-in.js b/node_modules/eslint/lib/rules/guard-for-in.js new file mode 100644 index 000000000..2c0976d99 --- /dev/null +++ b/node_modules/eslint/lib/rules/guard-for-in.js @@ -0,0 +1,76 @@ +/** + * @fileoverview Rule to flag for-in loops without if statements inside + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require `for-in` loops to include an `if` statement", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/guard-for-in" + }, + + schema: [], + messages: { + wrap: "The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype." + } + }, + + create(context) { + + return { + + ForInStatement(node) { + const body = node.body; + + // empty statement + if (body.type === "EmptyStatement") { + return; + } + + // if statement + if (body.type === "IfStatement") { + return; + } + + // empty block + if (body.type === "BlockStatement" && body.body.length === 0) { + return; + } + + // block with just if statement + if (body.type === "BlockStatement" && body.body.length === 1 && body.body[0].type === "IfStatement") { + return; + } + + // block that starts with if statement + if (body.type === "BlockStatement" && body.body.length >= 1 && body.body[0].type === "IfStatement") { + const i = body.body[0]; + + // ... whose consequent is a continue + if (i.consequent.type === "ContinueStatement") { + return; + } + + // ... whose consequent is a block that contains only a continue + if (i.consequent.type === "BlockStatement" && i.consequent.body.length === 1 && i.consequent.body[0].type === "ContinueStatement") { + return; + } + } + + context.report({ node, messageId: "wrap" }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/handle-callback-err.js b/node_modules/eslint/lib/rules/handle-callback-err.js new file mode 100644 index 000000000..b92490ad1 --- /dev/null +++ b/node_modules/eslint/lib/rules/handle-callback-err.js @@ -0,0 +1,99 @@ +/** + * @fileoverview Ensure handling of errors when we know they exist. + * @author Jamund Ferguson + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "require error handling in callbacks", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/handle-callback-err" + }, + + schema: [ + { + type: "string" + } + ], + messages: { + expected: "Expected error to be handled." + } + }, + + create(context) { + + const errorArgument = context.options[0] || "err"; + + /** + * Checks if the given argument should be interpreted as a regexp pattern. + * @param {string} stringToCheck The string which should be checked. + * @returns {boolean} Whether or not the string should be interpreted as a pattern. + */ + function isPattern(stringToCheck) { + const firstChar = stringToCheck[0]; + + return firstChar === "^"; + } + + /** + * Checks if the given name matches the configured error argument. + * @param {string} name The name which should be compared. + * @returns {boolean} Whether or not the given name matches the configured error variable name. + */ + function matchesConfiguredErrorName(name) { + if (isPattern(errorArgument)) { + const regexp = new RegExp(errorArgument, "u"); + + return regexp.test(name); + } + return name === errorArgument; + } + + /** + * Get the parameters of a given function scope. + * @param {Object} scope The function scope. + * @returns {Array} All parameters of the given scope. + */ + function getParameters(scope) { + return scope.variables.filter(variable => variable.defs[0] && variable.defs[0].type === "Parameter"); + } + + /** + * Check to see if we're handling the error object properly. + * @param {ASTNode} node The AST node to check. + * @returns {void} + */ + function checkForError(node) { + const scope = context.getScope(), + parameters = getParameters(scope), + firstParameter = parameters[0]; + + if (firstParameter && matchesConfiguredErrorName(firstParameter.name)) { + if (firstParameter.references.length === 0) { + context.report({ node, messageId: "expected" }); + } + } + } + + return { + FunctionDeclaration: checkForError, + FunctionExpression: checkForError, + ArrowFunctionExpression: checkForError + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/id-blacklist.js b/node_modules/eslint/lib/rules/id-blacklist.js new file mode 100644 index 000000000..4fbba909f --- /dev/null +++ b/node_modules/eslint/lib/rules/id-blacklist.js @@ -0,0 +1,233 @@ +/** + * @fileoverview Rule that warns when identifier names that are + * specified in the configuration are used. + * @author Keith Cirkel (http://keithcirkel.co.uk) + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether the given node represents assignment target in a normal assignment or destructuring. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is assignment target. + */ +function isAssignmentTarget(node) { + const parent = node.parent; + + return ( + + // normal assignment + ( + parent.type === "AssignmentExpression" && + parent.left === node + ) || + + // destructuring + parent.type === "ArrayPattern" || + parent.type === "RestElement" || + ( + parent.type === "Property" && + parent.value === node && + parent.parent.type === "ObjectPattern" + ) || + ( + parent.type === "AssignmentPattern" && + parent.left === node + ) + ); +} + +/** + * Checks whether the given node represents an imported name that is renamed in the same import/export specifier. + * + * Examples: + * import { a as b } from 'mod'; // node `a` is renamed import + * export { a as b } from 'mod'; // node `a` is renamed import + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a renamed import. + */ +function isRenamedImport(node) { + const parent = node.parent; + + return ( + ( + parent.type === "ImportSpecifier" && + parent.imported !== parent.local && + parent.imported === node + ) || + ( + parent.type === "ExportSpecifier" && + parent.parent.source && // re-export + parent.local !== parent.exported && + parent.local === node + ) + ); +} + +/** + * Checks whether the given node is a renamed identifier node in an ObjectPattern destructuring. + * + * Examples: + * const { a : b } = foo; // node `a` is renamed node. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a renamed node in an ObjectPattern destructuring. + */ +function isRenamedInDestructuring(node) { + const parent = node.parent; + + return ( + ( + !parent.computed && + parent.type === "Property" && + parent.parent.type === "ObjectPattern" && + parent.value !== node && + parent.key === node + ) + ); +} + +/** + * Checks whether the given node represents shorthand definition of a property in an object literal. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a shorthand property definition. + */ +function isShorthandPropertyDefinition(node) { + const parent = node.parent; + + return ( + parent.type === "Property" && + parent.parent.type === "ObjectExpression" && + parent.shorthand + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + replacedBy: ["id-denylist"], + + type: "suggestion", + + docs: { + description: "disallow specified identifiers", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/id-blacklist" + }, + + schema: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + messages: { + restricted: "Identifier '{{name}}' is restricted." + } + }, + + create(context) { + + const denyList = new Set(context.options); + const reportedNodes = new Set(); + + let globalScope; + + /** + * Checks whether the given name is restricted. + * @param {string} name The name to check. + * @returns {boolean} `true` if the name is restricted. + * @private + */ + function isRestricted(name) { + return denyList.has(name); + } + + /** + * Checks whether the given node represents a reference to a global variable that is not declared in the source code. + * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a reference to a global variable. + */ + function isReferenceToGlobalVariable(node) { + const variable = globalScope.set.get(node.name); + + return variable && variable.defs.length === 0 && + variable.references.some(ref => ref.identifier === node); + } + + /** + * Determines whether the given node should be checked. + * @param {ASTNode} node `Identifier` node. + * @returns {boolean} `true` if the node should be checked. + */ + function shouldCheck(node) { + const parent = node.parent; + + /* + * Member access has special rules for checking property names. + * Read access to a property with a restricted name is allowed, because it can be on an object that user has no control over. + * Write access isn't allowed, because it potentially creates a new property with a restricted name. + */ + if ( + parent.type === "MemberExpression" && + parent.property === node && + !parent.computed + ) { + return isAssignmentTarget(parent); + } + + return ( + parent.type !== "CallExpression" && + parent.type !== "NewExpression" && + !isRenamedImport(node) && + !isRenamedInDestructuring(node) && + !( + isReferenceToGlobalVariable(node) && + !isShorthandPropertyDefinition(node) + ) + ); + } + + /** + * Reports an AST node as a rule violation. + * @param {ASTNode} node The node to report. + * @returns {void} + * @private + */ + function report(node) { + if (!reportedNodes.has(node)) { + context.report({ + node, + messageId: "restricted", + data: { + name: node.name + } + }); + reportedNodes.add(node); + } + } + + return { + + Program() { + globalScope = context.getScope(); + }, + + Identifier(node) { + if (isRestricted(node.name) && shouldCheck(node)) { + report(node); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/id-denylist.js b/node_modules/eslint/lib/rules/id-denylist.js new file mode 100644 index 000000000..112fd8a9d --- /dev/null +++ b/node_modules/eslint/lib/rules/id-denylist.js @@ -0,0 +1,230 @@ +/** + * @fileoverview Rule that warns when identifier names that are + * specified in the configuration are used. + * @author Keith Cirkel (http://keithcirkel.co.uk) + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether the given node represents assignment target in a normal assignment or destructuring. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is assignment target. + */ +function isAssignmentTarget(node) { + const parent = node.parent; + + return ( + + // normal assignment + ( + parent.type === "AssignmentExpression" && + parent.left === node + ) || + + // destructuring + parent.type === "ArrayPattern" || + parent.type === "RestElement" || + ( + parent.type === "Property" && + parent.value === node && + parent.parent.type === "ObjectPattern" + ) || + ( + parent.type === "AssignmentPattern" && + parent.left === node + ) + ); +} + +/** + * Checks whether the given node represents an imported name that is renamed in the same import/export specifier. + * + * Examples: + * import { a as b } from 'mod'; // node `a` is renamed import + * export { a as b } from 'mod'; // node `a` is renamed import + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a renamed import. + */ +function isRenamedImport(node) { + const parent = node.parent; + + return ( + ( + parent.type === "ImportSpecifier" && + parent.imported !== parent.local && + parent.imported === node + ) || + ( + parent.type === "ExportSpecifier" && + parent.parent.source && // re-export + parent.local !== parent.exported && + parent.local === node + ) + ); +} + +/** + * Checks whether the given node is a renamed identifier node in an ObjectPattern destructuring. + * + * Examples: + * const { a : b } = foo; // node `a` is renamed node. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a renamed node in an ObjectPattern destructuring. + */ +function isRenamedInDestructuring(node) { + const parent = node.parent; + + return ( + ( + !parent.computed && + parent.type === "Property" && + parent.parent.type === "ObjectPattern" && + parent.value !== node && + parent.key === node + ) + ); +} + +/** + * Checks whether the given node represents shorthand definition of a property in an object literal. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a shorthand property definition. + */ +function isShorthandPropertyDefinition(node) { + const parent = node.parent; + + return ( + parent.type === "Property" && + parent.parent.type === "ObjectExpression" && + parent.shorthand + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow specified identifiers", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/id-denylist" + }, + + schema: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + messages: { + restricted: "Identifier '{{name}}' is restricted." + } + }, + + create(context) { + + const denyList = new Set(context.options); + const reportedNodes = new Set(); + + let globalScope; + + /** + * Checks whether the given name is restricted. + * @param {string} name The name to check. + * @returns {boolean} `true` if the name is restricted. + * @private + */ + function isRestricted(name) { + return denyList.has(name); + } + + /** + * Checks whether the given node represents a reference to a global variable that is not declared in the source code. + * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a reference to a global variable. + */ + function isReferenceToGlobalVariable(node) { + const variable = globalScope.set.get(node.name); + + return variable && variable.defs.length === 0 && + variable.references.some(ref => ref.identifier === node); + } + + /** + * Determines whether the given node should be checked. + * @param {ASTNode} node `Identifier` node. + * @returns {boolean} `true` if the node should be checked. + */ + function shouldCheck(node) { + const parent = node.parent; + + /* + * Member access has special rules for checking property names. + * Read access to a property with a restricted name is allowed, because it can be on an object that user has no control over. + * Write access isn't allowed, because it potentially creates a new property with a restricted name. + */ + if ( + parent.type === "MemberExpression" && + parent.property === node && + !parent.computed + ) { + return isAssignmentTarget(parent); + } + + return ( + parent.type !== "CallExpression" && + parent.type !== "NewExpression" && + !isRenamedImport(node) && + !isRenamedInDestructuring(node) && + !( + isReferenceToGlobalVariable(node) && + !isShorthandPropertyDefinition(node) + ) + ); + } + + /** + * Reports an AST node as a rule violation. + * @param {ASTNode} node The node to report. + * @returns {void} + * @private + */ + function report(node) { + if (!reportedNodes.has(node)) { + context.report({ + node, + messageId: "restricted", + data: { + name: node.name + } + }); + reportedNodes.add(node); + } + } + + return { + + Program() { + globalScope = context.getScope(); + }, + + Identifier(node) { + if (isRestricted(node.name) && shouldCheck(node)) { + report(node); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/id-length.js b/node_modules/eslint/lib/rules/id-length.js new file mode 100644 index 000000000..4df081ff9 --- /dev/null +++ b/node_modules/eslint/lib/rules/id-length.js @@ -0,0 +1,145 @@ +/** + * @fileoverview Rule that warns when identifier names are shorter or longer + * than the values provided in configuration. + * @author Burak Yigit Kaya aka BYK + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce minimum and maximum identifier lengths", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/id-length" + }, + + schema: [ + { + type: "object", + properties: { + min: { + type: "integer", + default: 2 + }, + max: { + type: "integer" + }, + exceptions: { + type: "array", + uniqueItems: true, + items: { + type: "string" + } + }, + exceptionPatterns: { + type: "array", + uniqueItems: true, + items: { + type: "string" + } + }, + properties: { + enum: ["always", "never"] + } + }, + additionalProperties: false + } + ], + messages: { + tooShort: "Identifier name '{{name}}' is too short (< {{min}}).", + tooLong: "Identifier name '{{name}}' is too long (> {{max}})." + } + }, + + create(context) { + const options = context.options[0] || {}; + const minLength = typeof options.min !== "undefined" ? options.min : 2; + const maxLength = typeof options.max !== "undefined" ? options.max : Infinity; + const properties = options.properties !== "never"; + const exceptions = new Set(options.exceptions); + const exceptionPatterns = (options.exceptionPatterns || []).map(pattern => new RegExp(pattern, "u")); + const reportedNode = new Set(); + + /** + * Checks if a string matches the provided exception patterns + * @param {string} name The string to check. + * @returns {boolean} if the string is a match + * @private + */ + function matchesExceptionPattern(name) { + return exceptionPatterns.some(pattern => pattern.test(name)); + } + + const SUPPORTED_EXPRESSIONS = { + MemberExpression: properties && function(parent) { + return !parent.computed && ( + + // regular property assignment + (parent.parent.left === parent && parent.parent.type === "AssignmentExpression" || + + // or the last identifier in an ObjectPattern destructuring + parent.parent.type === "Property" && parent.parent.value === parent && + parent.parent.parent.type === "ObjectPattern" && parent.parent.parent.parent.left === parent.parent.parent) + ); + }, + AssignmentPattern(parent, node) { + return parent.left === node; + }, + VariableDeclarator(parent, node) { + return parent.id === node; + }, + Property(parent, node) { + + if (parent.parent.type === "ObjectPattern") { + return ( + parent.value !== parent.key && parent.value === node || + parent.value === parent.key && parent.key === node && properties + ); + } + return properties && !parent.computed && parent.key === node; + }, + ImportDefaultSpecifier: true, + RestElement: true, + FunctionExpression: true, + ArrowFunctionExpression: true, + ClassDeclaration: true, + FunctionDeclaration: true, + MethodDefinition: true, + CatchClause: true, + ArrayPattern: true + }; + + return { + Identifier(node) { + const name = node.name; + const parent = node.parent; + + const isShort = name.length < minLength; + const isLong = name.length > maxLength; + + if (!(isShort || isLong) || exceptions.has(name) || matchesExceptionPattern(name)) { + return; // Nothing to report + } + + const isValidExpression = SUPPORTED_EXPRESSIONS[parent.type]; + + if (isValidExpression && !reportedNode.has(node) && (isValidExpression === true || isValidExpression(parent, node))) { + reportedNode.add(node); + context.report({ + node, + messageId: isShort ? "tooShort" : "tooLong", + data: { name, min: minLength, max: maxLength } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/id-match.js b/node_modules/eslint/lib/rules/id-match.js new file mode 100644 index 000000000..7e400d037 --- /dev/null +++ b/node_modules/eslint/lib/rules/id-match.js @@ -0,0 +1,226 @@ +/** + * @fileoverview Rule to flag non-matching identifiers + * @author Matthieu Larcher + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require identifiers to match a specified regular expression", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/id-match" + }, + + schema: [ + { + type: "string" + }, + { + type: "object", + properties: { + properties: { + type: "boolean", + default: false + }, + onlyDeclarations: { + type: "boolean", + default: false + }, + ignoreDestructuring: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + messages: { + notMatch: "Identifier '{{name}}' does not match the pattern '{{pattern}}'." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Options + //-------------------------------------------------------------------------- + const pattern = context.options[0] || "^.+$", + regexp = new RegExp(pattern, "u"); + + const options = context.options[1] || {}, + properties = !!options.properties, + onlyDeclarations = !!options.onlyDeclarations, + ignoreDestructuring = !!options.ignoreDestructuring; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // contains reported nodes to avoid reporting twice on destructuring with shorthand notation + const reported = new Map(); + const ALLOWED_PARENT_TYPES = new Set(["CallExpression", "NewExpression"]); + const DECLARATION_TYPES = new Set(["FunctionDeclaration", "VariableDeclarator"]); + const IMPORT_TYPES = new Set(["ImportSpecifier", "ImportNamespaceSpecifier", "ImportDefaultSpecifier"]); + + /** + * Checks if a string matches the provided pattern + * @param {string} name The string to check. + * @returns {boolean} if the string is a match + * @private + */ + function isInvalid(name) { + return !regexp.test(name); + } + + /** + * Checks if a parent of a node is an ObjectPattern. + * @param {ASTNode} node The node to check. + * @returns {boolean} if the node is inside an ObjectPattern + * @private + */ + function isInsideObjectPattern(node) { + let { parent } = node; + + while (parent) { + if (parent.type === "ObjectPattern") { + return true; + } + + parent = parent.parent; + } + + return false; + } + + /** + * Verifies if we should report an error or not based on the effective + * parent node and the identifier name. + * @param {ASTNode} effectiveParent The effective parent node of the node to be reported + * @param {string} name The identifier name of the identifier node + * @returns {boolean} whether an error should be reported or not + */ + function shouldReport(effectiveParent, name) { + return (!onlyDeclarations || DECLARATION_TYPES.has(effectiveParent.type)) && + !ALLOWED_PARENT_TYPES.has(effectiveParent.type) && isInvalid(name); + } + + /** + * Reports an AST node as a rule violation. + * @param {ASTNode} node The node to report. + * @returns {void} + * @private + */ + function report(node) { + if (!reported.has(node)) { + context.report({ + node, + messageId: "notMatch", + data: { + name: node.name, + pattern + } + }); + reported.set(node, true); + } + } + + return { + + Identifier(node) { + const name = node.name, + parent = node.parent, + effectiveParent = (parent.type === "MemberExpression") ? parent.parent : parent; + + if (parent.type === "MemberExpression") { + + if (!properties) { + return; + } + + // Always check object names + if (parent.object.type === "Identifier" && + parent.object.name === name) { + if (isInvalid(name)) { + report(node); + } + + // Report AssignmentExpressions left side's assigned variable id + } else if (effectiveParent.type === "AssignmentExpression" && + effectiveParent.left.type === "MemberExpression" && + effectiveParent.left.property.name === node.name) { + if (isInvalid(name)) { + report(node); + } + + // Report AssignmentExpressions only if they are the left side of the assignment + } else if (effectiveParent.type === "AssignmentExpression" && effectiveParent.right.type !== "MemberExpression") { + if (isInvalid(name)) { + report(node); + } + } + + /* + * Properties have their own rules, and + * AssignmentPattern nodes can be treated like Properties: + * e.g.: const { no_camelcased = false } = bar; + */ + } else if (parent.type === "Property" || parent.type === "AssignmentPattern") { + + if (parent.parent && parent.parent.type === "ObjectPattern") { + if (parent.shorthand && parent.value.left && isInvalid(name)) { + + report(node); + } + + const assignmentKeyEqualsValue = parent.key.name === parent.value.name; + + // prevent checking righthand side of destructured object + if (!assignmentKeyEqualsValue && parent.key === node) { + return; + } + + const valueIsInvalid = parent.value.name && isInvalid(name); + + // ignore destructuring if the option is set, unless a new identifier is created + if (valueIsInvalid && !(assignmentKeyEqualsValue && ignoreDestructuring)) { + report(node); + } + } + + // never check properties or always ignore destructuring + if (!properties || (ignoreDestructuring && isInsideObjectPattern(node))) { + return; + } + + // don't check right hand side of AssignmentExpression to prevent duplicate warnings + if (parent.right !== node && shouldReport(effectiveParent, name)) { + report(node); + } + + // Check if it's an import specifier + } else if (IMPORT_TYPES.has(parent.type)) { + + // Report only if the local imported identifier is invalid + if (parent.local && parent.local.name === node.name && isInvalid(name)) { + report(node); + } + + // Report anything that is invalid that isn't a CallExpression + } else if (shouldReport(effectiveParent, name)) { + report(node); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js b/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js new file mode 100644 index 000000000..409145e7d --- /dev/null +++ b/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js @@ -0,0 +1,81 @@ +/** + * @fileoverview enforce the location of arrow function bodies + * @author Sharmila Jesupaul + */ +"use strict"; + +const { isCommentToken, isNotOpeningParenToken } = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce the location of arrow function bodies", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/implicit-arrow-linebreak" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["beside", "below"] + } + ], + messages: { + expected: "Expected a linebreak before this expression.", + unexpected: "Expected no linebreak before this expression." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const option = context.options[0] || "beside"; + + /** + * Validates the location of an arrow function body + * @param {ASTNode} node The arrow function body + * @returns {void} + */ + function validateExpression(node) { + if (node.body.type === "BlockStatement") { + return; + } + + const arrowToken = sourceCode.getTokenBefore(node.body, isNotOpeningParenToken); + const firstTokenOfBody = sourceCode.getTokenAfter(arrowToken); + + if (arrowToken.loc.end.line === firstTokenOfBody.loc.start.line && option === "below") { + context.report({ + node: firstTokenOfBody, + messageId: "expected", + fix: fixer => fixer.insertTextBefore(firstTokenOfBody, "\n") + }); + } else if (arrowToken.loc.end.line !== firstTokenOfBody.loc.start.line && option === "beside") { + context.report({ + node: firstTokenOfBody, + messageId: "unexpected", + fix(fixer) { + if (sourceCode.getFirstTokenBetween(arrowToken, firstTokenOfBody, { includeComments: true, filter: isCommentToken })) { + return null; + } + + return fixer.replaceTextRange([arrowToken.range[1], firstTokenOfBody.range[0]], " "); + } + }); + } + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + return { + ArrowFunctionExpression: node => validateExpression(node) + }; + } +}; diff --git a/node_modules/eslint/lib/rules/indent-legacy.js b/node_modules/eslint/lib/rules/indent-legacy.js new file mode 100644 index 000000000..50010d3f7 --- /dev/null +++ b/node_modules/eslint/lib/rules/indent-legacy.js @@ -0,0 +1,1125 @@ +/** + * @fileoverview This option sets a specific tab width for your code + * + * This rule has been ported and modified from nodeca. + * @author Vitaly Puzrin + * @author Gyandeep Singh + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/* istanbul ignore next: this rule has known coverage issues, but it's deprecated and shouldn't be updated in the future anyway. */ +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent indentation", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/indent-legacy" + }, + + deprecated: true, + + replacedBy: ["indent"], + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["tab"] + }, + { + type: "integer", + minimum: 0 + } + ] + }, + { + type: "object", + properties: { + SwitchCase: { + type: "integer", + minimum: 0 + }, + VariableDeclarator: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + var: { + type: "integer", + minimum: 0 + }, + let: { + type: "integer", + minimum: 0 + }, + const: { + type: "integer", + minimum: 0 + } + } + } + ] + }, + outerIIFEBody: { + type: "integer", + minimum: 0 + }, + MemberExpression: { + type: "integer", + minimum: 0 + }, + FunctionDeclaration: { + type: "object", + properties: { + parameters: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["first"] + } + ] + }, + body: { + type: "integer", + minimum: 0 + } + } + }, + FunctionExpression: { + type: "object", + properties: { + parameters: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["first"] + } + ] + }, + body: { + type: "integer", + minimum: 0 + } + } + }, + CallExpression: { + type: "object", + properties: { + parameters: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["first"] + } + ] + } + } + }, + ArrayExpression: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["first"] + } + ] + }, + ObjectExpression: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["first"] + } + ] + } + }, + additionalProperties: false + } + ], + messages: { + expected: "Expected indentation of {{expected}} but found {{actual}}." + } + }, + + create(context) { + const DEFAULT_VARIABLE_INDENT = 1; + const DEFAULT_PARAMETER_INDENT = null; // For backwards compatibility, don't check parameter indentation unless specified in the config + const DEFAULT_FUNCTION_BODY_INDENT = 1; + + let indentType = "space"; + let indentSize = 4; + const options = { + SwitchCase: 0, + VariableDeclarator: { + var: DEFAULT_VARIABLE_INDENT, + let: DEFAULT_VARIABLE_INDENT, + const: DEFAULT_VARIABLE_INDENT + }, + outerIIFEBody: null, + FunctionDeclaration: { + parameters: DEFAULT_PARAMETER_INDENT, + body: DEFAULT_FUNCTION_BODY_INDENT + }, + FunctionExpression: { + parameters: DEFAULT_PARAMETER_INDENT, + body: DEFAULT_FUNCTION_BODY_INDENT + }, + CallExpression: { + arguments: DEFAULT_PARAMETER_INDENT + }, + ArrayExpression: 1, + ObjectExpression: 1 + }; + + const sourceCode = context.getSourceCode(); + + if (context.options.length) { + if (context.options[0] === "tab") { + indentSize = 1; + indentType = "tab"; + } else /* istanbul ignore else : this will be caught by options validation */ if (typeof context.options[0] === "number") { + indentSize = context.options[0]; + indentType = "space"; + } + + if (context.options[1]) { + const opts = context.options[1]; + + options.SwitchCase = opts.SwitchCase || 0; + const variableDeclaratorRules = opts.VariableDeclarator; + + if (typeof variableDeclaratorRules === "number") { + options.VariableDeclarator = { + var: variableDeclaratorRules, + let: variableDeclaratorRules, + const: variableDeclaratorRules + }; + } else if (typeof variableDeclaratorRules === "object") { + Object.assign(options.VariableDeclarator, variableDeclaratorRules); + } + + if (typeof opts.outerIIFEBody === "number") { + options.outerIIFEBody = opts.outerIIFEBody; + } + + if (typeof opts.MemberExpression === "number") { + options.MemberExpression = opts.MemberExpression; + } + + if (typeof opts.FunctionDeclaration === "object") { + Object.assign(options.FunctionDeclaration, opts.FunctionDeclaration); + } + + if (typeof opts.FunctionExpression === "object") { + Object.assign(options.FunctionExpression, opts.FunctionExpression); + } + + if (typeof opts.CallExpression === "object") { + Object.assign(options.CallExpression, opts.CallExpression); + } + + if (typeof opts.ArrayExpression === "number" || typeof opts.ArrayExpression === "string") { + options.ArrayExpression = opts.ArrayExpression; + } + + if (typeof opts.ObjectExpression === "number" || typeof opts.ObjectExpression === "string") { + options.ObjectExpression = opts.ObjectExpression; + } + } + } + + const caseIndentStore = {}; + + /** + * Creates an error message for a line, given the expected/actual indentation. + * @param {int} expectedAmount The expected amount of indentation characters for this line + * @param {int} actualSpaces The actual number of indentation spaces that were found on this line + * @param {int} actualTabs The actual number of indentation tabs that were found on this line + * @returns {string} An error message for this line + */ + function createErrorMessageData(expectedAmount, actualSpaces, actualTabs) { + const expectedStatement = `${expectedAmount} ${indentType}${expectedAmount === 1 ? "" : "s"}`; // e.g. "2 tabs" + const foundSpacesWord = `space${actualSpaces === 1 ? "" : "s"}`; // e.g. "space" + const foundTabsWord = `tab${actualTabs === 1 ? "" : "s"}`; // e.g. "tabs" + let foundStatement; + + if (actualSpaces > 0 && actualTabs > 0) { + foundStatement = `${actualSpaces} ${foundSpacesWord} and ${actualTabs} ${foundTabsWord}`; // e.g. "1 space and 2 tabs" + } else if (actualSpaces > 0) { + + /* + * Abbreviate the message if the expected indentation is also spaces. + * e.g. 'Expected 4 spaces but found 2' rather than 'Expected 4 spaces but found 2 spaces' + */ + foundStatement = indentType === "space" ? actualSpaces : `${actualSpaces} ${foundSpacesWord}`; + } else if (actualTabs > 0) { + foundStatement = indentType === "tab" ? actualTabs : `${actualTabs} ${foundTabsWord}`; + } else { + foundStatement = "0"; + } + return { + expected: expectedStatement, + actual: foundStatement + }; + } + + /** + * Reports a given indent violation + * @param {ASTNode} node Node violating the indent rule + * @param {int} needed Expected indentation character count + * @param {int} gottenSpaces Indentation space count in the actual node/code + * @param {int} gottenTabs Indentation tab count in the actual node/code + * @param {Object} [loc] Error line and column location + * @param {boolean} isLastNodeCheck Is the error for last node check + * @returns {void} + */ + function report(node, needed, gottenSpaces, gottenTabs, loc, isLastNodeCheck) { + if (gottenSpaces && gottenTabs) { + + // To avoid conflicts with `no-mixed-spaces-and-tabs`, don't report lines that have both spaces and tabs. + return; + } + + const desiredIndent = (indentType === "space" ? " " : "\t").repeat(needed); + + const textRange = isLastNodeCheck + ? [node.range[1] - node.loc.end.column, node.range[1] - node.loc.end.column + gottenSpaces + gottenTabs] + : [node.range[0] - node.loc.start.column, node.range[0] - node.loc.start.column + gottenSpaces + gottenTabs]; + + context.report({ + node, + loc, + messageId: "expected", + data: createErrorMessageData(needed, gottenSpaces, gottenTabs), + fix: fixer => fixer.replaceTextRange(textRange, desiredIndent) + }); + } + + /** + * Get the actual indent of node + * @param {ASTNode|Token} node Node to examine + * @param {boolean} [byLastLine=false] get indent of node's last line + * @returns {Object} The node's indent. Contains keys `space` and `tab`, representing the indent of each character. Also + * contains keys `goodChar` and `badChar`, where `goodChar` is the amount of the user's desired indentation character, and + * `badChar` is the amount of the other indentation character. + */ + function getNodeIndent(node, byLastLine) { + const token = byLastLine ? sourceCode.getLastToken(node) : sourceCode.getFirstToken(node); + const srcCharsBeforeNode = sourceCode.getText(token, token.loc.start.column).split(""); + const indentChars = srcCharsBeforeNode.slice(0, srcCharsBeforeNode.findIndex(char => char !== " " && char !== "\t")); + const spaces = indentChars.filter(char => char === " ").length; + const tabs = indentChars.filter(char => char === "\t").length; + + return { + space: spaces, + tab: tabs, + goodChar: indentType === "space" ? spaces : tabs, + badChar: indentType === "space" ? tabs : spaces + }; + } + + /** + * Checks node is the first in its own start line. By default it looks by start line. + * @param {ASTNode} node The node to check + * @param {boolean} [byEndLocation=false] Lookup based on start position or end + * @returns {boolean} true if its the first in the its start line + */ + function isNodeFirstInLine(node, byEndLocation) { + const firstToken = byEndLocation === true ? sourceCode.getLastToken(node, 1) : sourceCode.getTokenBefore(node), + startLine = byEndLocation === true ? node.loc.end.line : node.loc.start.line, + endLine = firstToken ? firstToken.loc.end.line : -1; + + return startLine !== endLine; + } + + /** + * Check indent for node + * @param {ASTNode} node Node to check + * @param {int} neededIndent needed indent + * @returns {void} + */ + function checkNodeIndent(node, neededIndent) { + const actualIndent = getNodeIndent(node, false); + + if ( + node.type !== "ArrayExpression" && + node.type !== "ObjectExpression" && + (actualIndent.goodChar !== neededIndent || actualIndent.badChar !== 0) && + isNodeFirstInLine(node) + ) { + report(node, neededIndent, actualIndent.space, actualIndent.tab); + } + + if (node.type === "IfStatement" && node.alternate) { + const elseToken = sourceCode.getTokenBefore(node.alternate); + + checkNodeIndent(elseToken, neededIndent); + + if (!isNodeFirstInLine(node.alternate)) { + checkNodeIndent(node.alternate, neededIndent); + } + } + + if (node.type === "TryStatement" && node.handler) { + const catchToken = sourceCode.getFirstToken(node.handler); + + checkNodeIndent(catchToken, neededIndent); + } + + if (node.type === "TryStatement" && node.finalizer) { + const finallyToken = sourceCode.getTokenBefore(node.finalizer); + + checkNodeIndent(finallyToken, neededIndent); + } + + if (node.type === "DoWhileStatement") { + const whileToken = sourceCode.getTokenAfter(node.body); + + checkNodeIndent(whileToken, neededIndent); + } + } + + /** + * Check indent for nodes list + * @param {ASTNode[]} nodes list of node objects + * @param {int} indent needed indent + * @returns {void} + */ + function checkNodesIndent(nodes, indent) { + nodes.forEach(node => checkNodeIndent(node, indent)); + } + + /** + * Check last node line indent this detects, that block closed correctly + * @param {ASTNode} node Node to examine + * @param {int} lastLineIndent needed indent + * @returns {void} + */ + function checkLastNodeLineIndent(node, lastLineIndent) { + const lastToken = sourceCode.getLastToken(node); + const endIndent = getNodeIndent(lastToken, true); + + if ((endIndent.goodChar !== lastLineIndent || endIndent.badChar !== 0) && isNodeFirstInLine(node, true)) { + report( + node, + lastLineIndent, + endIndent.space, + endIndent.tab, + { line: lastToken.loc.start.line, column: lastToken.loc.start.column }, + true + ); + } + } + + /** + * Check last node line indent this detects, that block closed correctly + * This function for more complicated return statement case, where closing parenthesis may be followed by ';' + * @param {ASTNode} node Node to examine + * @param {int} firstLineIndent first line needed indent + * @returns {void} + */ + function checkLastReturnStatementLineIndent(node, firstLineIndent) { + + /* + * in case if return statement ends with ');' we have traverse back to ')' + * otherwise we'll measure indent for ';' and replace ')' + */ + const lastToken = sourceCode.getLastToken(node, astUtils.isClosingParenToken); + const textBeforeClosingParenthesis = sourceCode.getText(lastToken, lastToken.loc.start.column).slice(0, -1); + + if (textBeforeClosingParenthesis.trim()) { + + // There are tokens before the closing paren, don't report this case + return; + } + + const endIndent = getNodeIndent(lastToken, true); + + if (endIndent.goodChar !== firstLineIndent) { + report( + node, + firstLineIndent, + endIndent.space, + endIndent.tab, + { line: lastToken.loc.start.line, column: lastToken.loc.start.column }, + true + ); + } + } + + /** + * Check first node line indent is correct + * @param {ASTNode} node Node to examine + * @param {int} firstLineIndent needed indent + * @returns {void} + */ + function checkFirstNodeLineIndent(node, firstLineIndent) { + const startIndent = getNodeIndent(node, false); + + if ((startIndent.goodChar !== firstLineIndent || startIndent.badChar !== 0) && isNodeFirstInLine(node)) { + report( + node, + firstLineIndent, + startIndent.space, + startIndent.tab, + { line: node.loc.start.line, column: node.loc.start.column } + ); + } + } + + /** + * Returns a parent node of given node based on a specified type + * if not present then return null + * @param {ASTNode} node node to examine + * @param {string} type type that is being looked for + * @param {string} stopAtList end points for the evaluating code + * @returns {ASTNode|void} if found then node otherwise null + */ + function getParentNodeByType(node, type, stopAtList) { + let parent = node.parent; + const stopAtSet = new Set(stopAtList || ["Program"]); + + while (parent.type !== type && !stopAtSet.has(parent.type) && parent.type !== "Program") { + parent = parent.parent; + } + + return parent.type === type ? parent : null; + } + + /** + * Returns the VariableDeclarator based on the current node + * if not present then return null + * @param {ASTNode} node node to examine + * @returns {ASTNode|void} if found then node otherwise null + */ + function getVariableDeclaratorNode(node) { + return getParentNodeByType(node, "VariableDeclarator"); + } + + /** + * Check to see if the node is part of the multi-line variable declaration. + * Also if its on the same line as the varNode + * @param {ASTNode} node node to check + * @param {ASTNode} varNode variable declaration node to check against + * @returns {boolean} True if all the above condition satisfy + */ + function isNodeInVarOnTop(node, varNode) { + return varNode && + varNode.parent.loc.start.line === node.loc.start.line && + varNode.parent.declarations.length > 1; + } + + /** + * Check to see if the argument before the callee node is multi-line and + * there should only be 1 argument before the callee node + * @param {ASTNode} node node to check + * @returns {boolean} True if arguments are multi-line + */ + function isArgBeforeCalleeNodeMultiline(node) { + const parent = node.parent; + + if (parent.arguments.length >= 2 && parent.arguments[1] === node) { + return parent.arguments[0].loc.end.line > parent.arguments[0].loc.start.line; + } + + return false; + } + + /** + * Check to see if the node is a file level IIFE + * @param {ASTNode} node The function node to check. + * @returns {boolean} True if the node is the outer IIFE + */ + function isOuterIIFE(node) { + const parent = node.parent; + let stmt = parent.parent; + + /* + * Verify that the node is an IIEF + */ + if ( + parent.type !== "CallExpression" || + parent.callee !== node) { + + return false; + } + + /* + * Navigate legal ancestors to determine whether this IIEF is outer + */ + while ( + stmt.type === "UnaryExpression" && ( + stmt.operator === "!" || + stmt.operator === "~" || + stmt.operator === "+" || + stmt.operator === "-") || + stmt.type === "AssignmentExpression" || + stmt.type === "LogicalExpression" || + stmt.type === "SequenceExpression" || + stmt.type === "VariableDeclarator") { + + stmt = stmt.parent; + } + + return (( + stmt.type === "ExpressionStatement" || + stmt.type === "VariableDeclaration") && + stmt.parent && stmt.parent.type === "Program" + ); + } + + /** + * Check indent for function block content + * @param {ASTNode} node A BlockStatement node that is inside of a function. + * @returns {void} + */ + function checkIndentInFunctionBlock(node) { + + /* + * Search first caller in chain. + * Ex.: + * + * Models <- Identifier + * .User + * .find() + * .exec(function() { + * // function body + * }); + * + * Looks for 'Models' + */ + const calleeNode = node.parent; // FunctionExpression + let indent; + + if (calleeNode.parent && + (calleeNode.parent.type === "Property" || + calleeNode.parent.type === "ArrayExpression")) { + + // If function is part of array or object, comma can be put at left + indent = getNodeIndent(calleeNode, false).goodChar; + } else { + + // If function is standalone, simple calculate indent + indent = getNodeIndent(calleeNode).goodChar; + } + + if (calleeNode.parent.type === "CallExpression") { + const calleeParent = calleeNode.parent; + + if (calleeNode.type !== "FunctionExpression" && calleeNode.type !== "ArrowFunctionExpression") { + if (calleeParent && calleeParent.loc.start.line < node.loc.start.line) { + indent = getNodeIndent(calleeParent).goodChar; + } + } else { + if (isArgBeforeCalleeNodeMultiline(calleeNode) && + calleeParent.callee.loc.start.line === calleeParent.callee.loc.end.line && + !isNodeFirstInLine(calleeNode)) { + indent = getNodeIndent(calleeParent).goodChar; + } + } + } + + /* + * function body indent should be indent + indent size, unless this + * is a FunctionDeclaration, FunctionExpression, or outer IIFE and the corresponding options are enabled. + */ + let functionOffset = indentSize; + + if (options.outerIIFEBody !== null && isOuterIIFE(calleeNode)) { + functionOffset = options.outerIIFEBody * indentSize; + } else if (calleeNode.type === "FunctionExpression") { + functionOffset = options.FunctionExpression.body * indentSize; + } else if (calleeNode.type === "FunctionDeclaration") { + functionOffset = options.FunctionDeclaration.body * indentSize; + } + indent += functionOffset; + + // check if the node is inside a variable + const parentVarNode = getVariableDeclaratorNode(node); + + if (parentVarNode && isNodeInVarOnTop(node, parentVarNode)) { + indent += indentSize * options.VariableDeclarator[parentVarNode.parent.kind]; + } + + if (node.body.length > 0) { + checkNodesIndent(node.body, indent); + } + + checkLastNodeLineIndent(node, indent - functionOffset); + } + + + /** + * Checks if the given node starts and ends on the same line + * @param {ASTNode} node The node to check + * @returns {boolean} Whether or not the block starts and ends on the same line. + */ + function isSingleLineNode(node) { + const lastToken = sourceCode.getLastToken(node), + startLine = node.loc.start.line, + endLine = lastToken.loc.end.line; + + return startLine === endLine; + } + + /** + * Check indent for array block content or object block content + * @param {ASTNode} node node to examine + * @returns {void} + */ + function checkIndentInArrayOrObjectBlock(node) { + + // Skip inline + if (isSingleLineNode(node)) { + return; + } + + let elements = (node.type === "ArrayExpression") ? node.elements : node.properties; + + // filter out empty elements example would be [ , 2] so remove first element as espree considers it as null + elements = elements.filter(elem => elem !== null); + + let nodeIndent; + let elementsIndent; + const parentVarNode = getVariableDeclaratorNode(node); + + // TODO - come up with a better strategy in future + if (isNodeFirstInLine(node)) { + const parent = node.parent; + + nodeIndent = getNodeIndent(parent).goodChar; + if (!parentVarNode || parentVarNode.loc.start.line !== node.loc.start.line) { + if (parent.type !== "VariableDeclarator" || parentVarNode === parentVarNode.parent.declarations[0]) { + if (parent.type === "VariableDeclarator" && parentVarNode.loc.start.line === parent.loc.start.line) { + nodeIndent += (indentSize * options.VariableDeclarator[parentVarNode.parent.kind]); + } else if (parent.type === "ObjectExpression" || parent.type === "ArrayExpression") { + const parentElements = node.parent.type === "ObjectExpression" ? node.parent.properties : node.parent.elements; + + if (parentElements[0] && + parentElements[0].loc.start.line === parent.loc.start.line && + parentElements[0].loc.end.line !== parent.loc.start.line) { + + /* + * If the first element of the array spans multiple lines, don't increase the expected indentation of the rest. + * e.g. [{ + * foo: 1 + * }, + * { + * bar: 1 + * }] + * the second object is not indented. + */ + } else if (typeof options[parent.type] === "number") { + nodeIndent += options[parent.type] * indentSize; + } else { + nodeIndent = parentElements[0].loc.start.column; + } + } else if (parent.type === "CallExpression" || parent.type === "NewExpression") { + if (typeof options.CallExpression.arguments === "number") { + nodeIndent += options.CallExpression.arguments * indentSize; + } else if (options.CallExpression.arguments === "first") { + if (parent.arguments.indexOf(node) !== -1) { + nodeIndent = parent.arguments[0].loc.start.column; + } + } else { + nodeIndent += indentSize; + } + } else if (parent.type === "LogicalExpression" || parent.type === "ArrowFunctionExpression") { + nodeIndent += indentSize; + } + } + } + + checkFirstNodeLineIndent(node, nodeIndent); + } else { + nodeIndent = getNodeIndent(node).goodChar; + } + + if (options[node.type] === "first") { + elementsIndent = elements.length ? elements[0].loc.start.column : 0; // If there are no elements, elementsIndent doesn't matter. + } else { + elementsIndent = nodeIndent + indentSize * options[node.type]; + } + + /* + * Check if the node is a multiple variable declaration; if so, then + * make sure indentation takes that into account. + */ + if (isNodeInVarOnTop(node, parentVarNode)) { + elementsIndent += indentSize * options.VariableDeclarator[parentVarNode.parent.kind]; + } + + checkNodesIndent(elements, elementsIndent); + + if (elements.length > 0) { + + // Skip last block line check if last item in same line + if (elements[elements.length - 1].loc.end.line === node.loc.end.line) { + return; + } + } + + checkLastNodeLineIndent(node, nodeIndent + + (isNodeInVarOnTop(node, parentVarNode) ? options.VariableDeclarator[parentVarNode.parent.kind] * indentSize : 0)); + } + + /** + * Check if the node or node body is a BlockStatement or not + * @param {ASTNode} node node to test + * @returns {boolean} True if it or its body is a block statement + */ + function isNodeBodyBlock(node) { + return node.type === "BlockStatement" || node.type === "ClassBody" || (node.body && node.body.type === "BlockStatement") || + (node.consequent && node.consequent.type === "BlockStatement"); + } + + /** + * Check indentation for blocks + * @param {ASTNode} node node to check + * @returns {void} + */ + function blockIndentationCheck(node) { + + // Skip inline blocks + if (isSingleLineNode(node)) { + return; + } + + if (node.parent && ( + node.parent.type === "FunctionExpression" || + node.parent.type === "FunctionDeclaration" || + node.parent.type === "ArrowFunctionExpression") + ) { + checkIndentInFunctionBlock(node); + return; + } + + let indent; + let nodesToCheck = []; + + /* + * For this statements we should check indent from statement beginning, + * not from the beginning of the block. + */ + const statementsWithProperties = [ + "IfStatement", "WhileStatement", "ForStatement", "ForInStatement", "ForOfStatement", "DoWhileStatement", "ClassDeclaration", "TryStatement" + ]; + + if (node.parent && statementsWithProperties.indexOf(node.parent.type) !== -1 && isNodeBodyBlock(node)) { + indent = getNodeIndent(node.parent).goodChar; + } else if (node.parent && node.parent.type === "CatchClause") { + indent = getNodeIndent(node.parent.parent).goodChar; + } else { + indent = getNodeIndent(node).goodChar; + } + + if (node.type === "IfStatement" && node.consequent.type !== "BlockStatement") { + nodesToCheck = [node.consequent]; + } else if (Array.isArray(node.body)) { + nodesToCheck = node.body; + } else { + nodesToCheck = [node.body]; + } + + if (nodesToCheck.length > 0) { + checkNodesIndent(nodesToCheck, indent + indentSize); + } + + if (node.type === "BlockStatement") { + checkLastNodeLineIndent(node, indent); + } + } + + /** + * Filter out the elements which are on the same line of each other or the node. + * basically have only 1 elements from each line except the variable declaration line. + * @param {ASTNode} node Variable declaration node + * @returns {ASTNode[]} Filtered elements + */ + function filterOutSameLineVars(node) { + return node.declarations.reduce((finalCollection, elem) => { + const lastElem = finalCollection[finalCollection.length - 1]; + + if ((elem.loc.start.line !== node.loc.start.line && !lastElem) || + (lastElem && lastElem.loc.start.line !== elem.loc.start.line)) { + finalCollection.push(elem); + } + + return finalCollection; + }, []); + } + + /** + * Check indentation for variable declarations + * @param {ASTNode} node node to examine + * @returns {void} + */ + function checkIndentInVariableDeclarations(node) { + const elements = filterOutSameLineVars(node); + const nodeIndent = getNodeIndent(node).goodChar; + const lastElement = elements[elements.length - 1]; + + const elementsIndent = nodeIndent + indentSize * options.VariableDeclarator[node.kind]; + + checkNodesIndent(elements, elementsIndent); + + // Only check the last line if there is any token after the last item + if (sourceCode.getLastToken(node).loc.end.line <= lastElement.loc.end.line) { + return; + } + + const tokenBeforeLastElement = sourceCode.getTokenBefore(lastElement); + + if (tokenBeforeLastElement.value === ",") { + + // Special case for comma-first syntax where the semicolon is indented + checkLastNodeLineIndent(node, getNodeIndent(tokenBeforeLastElement).goodChar); + } else { + checkLastNodeLineIndent(node, elementsIndent - indentSize); + } + } + + /** + * Check and decide whether to check for indentation for blockless nodes + * Scenarios are for or while statements without braces around them + * @param {ASTNode} node node to examine + * @returns {void} + */ + function blockLessNodes(node) { + if (node.body.type !== "BlockStatement") { + blockIndentationCheck(node); + } + } + + /** + * Returns the expected indentation for the case statement + * @param {ASTNode} node node to examine + * @param {int} [providedSwitchIndent] indent for switch statement + * @returns {int} indent size + */ + function expectedCaseIndent(node, providedSwitchIndent) { + const switchNode = (node.type === "SwitchStatement") ? node : node.parent; + const switchIndent = typeof providedSwitchIndent === "undefined" + ? getNodeIndent(switchNode).goodChar + : providedSwitchIndent; + let caseIndent; + + if (caseIndentStore[switchNode.loc.start.line]) { + return caseIndentStore[switchNode.loc.start.line]; + } + + if (switchNode.cases.length > 0 && options.SwitchCase === 0) { + caseIndent = switchIndent; + } else { + caseIndent = switchIndent + (indentSize * options.SwitchCase); + } + + caseIndentStore[switchNode.loc.start.line] = caseIndent; + return caseIndent; + + } + + /** + * Checks wether a return statement is wrapped in () + * @param {ASTNode} node node to examine + * @returns {boolean} the result + */ + function isWrappedInParenthesis(node) { + const regex = /^return\s*?\(\s*?\);*?/u; + + const statementWithoutArgument = sourceCode.getText(node).replace( + sourceCode.getText(node.argument), "" + ); + + return regex.test(statementWithoutArgument); + } + + return { + Program(node) { + if (node.body.length > 0) { + + // Root nodes should have no indent + checkNodesIndent(node.body, getNodeIndent(node).goodChar); + } + }, + + ClassBody: blockIndentationCheck, + + BlockStatement: blockIndentationCheck, + + WhileStatement: blockLessNodes, + + ForStatement: blockLessNodes, + + ForInStatement: blockLessNodes, + + ForOfStatement: blockLessNodes, + + DoWhileStatement: blockLessNodes, + + IfStatement(node) { + if (node.consequent.type !== "BlockStatement" && node.consequent.loc.start.line > node.loc.start.line) { + blockIndentationCheck(node); + } + }, + + VariableDeclaration(node) { + if (node.declarations[node.declarations.length - 1].loc.start.line > node.declarations[0].loc.start.line) { + checkIndentInVariableDeclarations(node); + } + }, + + ObjectExpression(node) { + checkIndentInArrayOrObjectBlock(node); + }, + + ArrayExpression(node) { + checkIndentInArrayOrObjectBlock(node); + }, + + MemberExpression(node) { + + if (typeof options.MemberExpression === "undefined") { + return; + } + + if (isSingleLineNode(node)) { + return; + } + + /* + * The typical layout of variable declarations and assignments + * alter the expectation of correct indentation. Skip them. + * TODO: Add appropriate configuration options for variable + * declarations and assignments. + */ + if (getParentNodeByType(node, "VariableDeclarator", ["FunctionExpression", "ArrowFunctionExpression"])) { + return; + } + + if (getParentNodeByType(node, "AssignmentExpression", ["FunctionExpression"])) { + return; + } + + const propertyIndent = getNodeIndent(node).goodChar + indentSize * options.MemberExpression; + + const checkNodes = [node.property]; + + const dot = sourceCode.getTokenBefore(node.property); + + if (dot.type === "Punctuator" && dot.value === ".") { + checkNodes.push(dot); + } + + checkNodesIndent(checkNodes, propertyIndent); + }, + + SwitchStatement(node) { + + // Switch is not a 'BlockStatement' + const switchIndent = getNodeIndent(node).goodChar; + const caseIndent = expectedCaseIndent(node, switchIndent); + + checkNodesIndent(node.cases, caseIndent); + + + checkLastNodeLineIndent(node, switchIndent); + }, + + SwitchCase(node) { + + // Skip inline cases + if (isSingleLineNode(node)) { + return; + } + const caseIndent = expectedCaseIndent(node); + + checkNodesIndent(node.consequent, caseIndent + indentSize); + }, + + FunctionDeclaration(node) { + if (isSingleLineNode(node)) { + return; + } + if (options.FunctionDeclaration.parameters === "first" && node.params.length) { + checkNodesIndent(node.params.slice(1), node.params[0].loc.start.column); + } else if (options.FunctionDeclaration.parameters !== null) { + checkNodesIndent(node.params, getNodeIndent(node).goodChar + indentSize * options.FunctionDeclaration.parameters); + } + }, + + FunctionExpression(node) { + if (isSingleLineNode(node)) { + return; + } + if (options.FunctionExpression.parameters === "first" && node.params.length) { + checkNodesIndent(node.params.slice(1), node.params[0].loc.start.column); + } else if (options.FunctionExpression.parameters !== null) { + checkNodesIndent(node.params, getNodeIndent(node).goodChar + indentSize * options.FunctionExpression.parameters); + } + }, + + ReturnStatement(node) { + if (isSingleLineNode(node)) { + return; + } + + const firstLineIndent = getNodeIndent(node).goodChar; + + // in case if return statement is wrapped in parenthesis + if (isWrappedInParenthesis(node)) { + checkLastReturnStatementLineIndent(node, firstLineIndent); + } else { + checkNodeIndent(node, firstLineIndent); + } + }, + + CallExpression(node) { + if (isSingleLineNode(node)) { + return; + } + if (options.CallExpression.arguments === "first" && node.arguments.length) { + checkNodesIndent(node.arguments.slice(1), node.arguments[0].loc.start.column); + } else if (options.CallExpression.arguments !== null) { + checkNodesIndent(node.arguments, getNodeIndent(node).goodChar + indentSize * options.CallExpression.arguments); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/indent.js b/node_modules/eslint/lib/rules/indent.js new file mode 100644 index 000000000..1c0dccc5c --- /dev/null +++ b/node_modules/eslint/lib/rules/indent.js @@ -0,0 +1,1706 @@ +/** + * @fileoverview This rule sets a specific indentation style and width for your code + * + * @author Teddy Katz + * @author Vitaly Puzrin + * @author Gyandeep Singh + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); +const astUtils = require("./utils/ast-utils"); +const createTree = require("functional-red-black-tree"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const KNOWN_NODES = new Set([ + "AssignmentExpression", + "AssignmentPattern", + "ArrayExpression", + "ArrayPattern", + "ArrowFunctionExpression", + "AwaitExpression", + "BlockStatement", + "BinaryExpression", + "BreakStatement", + "CallExpression", + "CatchClause", + "ChainExpression", + "ClassBody", + "ClassDeclaration", + "ClassExpression", + "ConditionalExpression", + "ContinueStatement", + "DoWhileStatement", + "DebuggerStatement", + "EmptyStatement", + "ExperimentalRestProperty", + "ExperimentalSpreadProperty", + "ExpressionStatement", + "ForStatement", + "ForInStatement", + "ForOfStatement", + "FunctionDeclaration", + "FunctionExpression", + "Identifier", + "IfStatement", + "Literal", + "LabeledStatement", + "LogicalExpression", + "MemberExpression", + "MetaProperty", + "MethodDefinition", + "NewExpression", + "ObjectExpression", + "ObjectPattern", + "Program", + "Property", + "RestElement", + "ReturnStatement", + "SequenceExpression", + "SpreadElement", + "Super", + "SwitchCase", + "SwitchStatement", + "TaggedTemplateExpression", + "TemplateElement", + "TemplateLiteral", + "ThisExpression", + "ThrowStatement", + "TryStatement", + "UnaryExpression", + "UpdateExpression", + "VariableDeclaration", + "VariableDeclarator", + "WhileStatement", + "WithStatement", + "YieldExpression", + "JSXFragment", + "JSXOpeningFragment", + "JSXClosingFragment", + "JSXIdentifier", + "JSXNamespacedName", + "JSXMemberExpression", + "JSXEmptyExpression", + "JSXExpressionContainer", + "JSXElement", + "JSXClosingElement", + "JSXOpeningElement", + "JSXAttribute", + "JSXSpreadAttribute", + "JSXText", + "ExportDefaultDeclaration", + "ExportNamedDeclaration", + "ExportAllDeclaration", + "ExportSpecifier", + "ImportDeclaration", + "ImportSpecifier", + "ImportDefaultSpecifier", + "ImportNamespaceSpecifier", + "ImportExpression" +]); + +/* + * General rule strategy: + * 1. An OffsetStorage instance stores a map of desired offsets, where each token has a specified offset from another + * specified token or to the first column. + * 2. As the AST is traversed, modify the desired offsets of tokens accordingly. For example, when entering a + * BlockStatement, offset all of the tokens in the BlockStatement by 1 indent level from the opening curly + * brace of the BlockStatement. + * 3. After traversing the AST, calculate the expected indentation levels of every token according to the + * OffsetStorage container. + * 4. For each line, compare the expected indentation of the first token to the actual indentation in the file, + * and report the token if the two values are not equal. + */ + + +/** + * A mutable balanced binary search tree that stores (key, value) pairs. The keys are numeric, and must be unique. + * This is intended to be a generic wrapper around a balanced binary search tree library, so that the underlying implementation + * can easily be swapped out. + */ +class BinarySearchTree { + + /** + * Creates an empty tree + */ + constructor() { + this._rbTree = createTree(); + } + + /** + * Inserts an entry into the tree. + * @param {number} key The entry's key + * @param {*} value The entry's value + * @returns {void} + */ + insert(key, value) { + const iterator = this._rbTree.find(key); + + if (iterator.valid) { + this._rbTree = iterator.update(value); + } else { + this._rbTree = this._rbTree.insert(key, value); + } + } + + /** + * Finds the entry with the largest key less than or equal to the provided key + * @param {number} key The provided key + * @returns {{key: number, value: *}|null} The found entry, or null if no such entry exists. + */ + findLe(key) { + const iterator = this._rbTree.le(key); + + return iterator && { key: iterator.key, value: iterator.value }; + } + + /** + * Deletes all of the keys in the interval [start, end) + * @param {number} start The start of the range + * @param {number} end The end of the range + * @returns {void} + */ + deleteRange(start, end) { + + // Exit without traversing the tree if the range has zero size. + if (start === end) { + return; + } + const iterator = this._rbTree.ge(start); + + while (iterator.valid && iterator.key < end) { + this._rbTree = this._rbTree.remove(iterator.key); + iterator.next(); + } + } +} + +/** + * A helper class to get token-based info related to indentation + */ +class TokenInfo { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {SourceCode} sourceCode A SourceCode object + */ + constructor(sourceCode) { + this.sourceCode = sourceCode; + this.firstTokensByLineNumber = sourceCode.tokensAndComments.reduce((map, token) => { + if (!map.has(token.loc.start.line)) { + map.set(token.loc.start.line, token); + } + if (!map.has(token.loc.end.line) && sourceCode.text.slice(token.range[1] - token.loc.end.column, token.range[1]).trim()) { + map.set(token.loc.end.line, token); + } + return map; + }, new Map()); + } + + /** + * Gets the first token on a given token's line + * @param {Token|ASTNode} token a node or token + * @returns {Token} The first token on the given line + */ + getFirstTokenOfLine(token) { + return this.firstTokensByLineNumber.get(token.loc.start.line); + } + + /** + * Determines whether a token is the first token in its line + * @param {Token} token The token + * @returns {boolean} `true` if the token is the first on its line + */ + isFirstTokenOfLine(token) { + return this.getFirstTokenOfLine(token) === token; + } + + /** + * Get the actual indent of a token + * @param {Token} token Token to examine. This should be the first token on its line. + * @returns {string} The indentation characters that precede the token + */ + getTokenIndent(token) { + return this.sourceCode.text.slice(token.range[0] - token.loc.start.column, token.range[0]); + } +} + +/** + * A class to store information on desired offsets of tokens from each other + */ +class OffsetStorage { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {TokenInfo} tokenInfo a TokenInfo instance + * @param {number} indentSize The desired size of each indentation level + * @param {string} indentType The indentation character + */ + constructor(tokenInfo, indentSize, indentType) { + this._tokenInfo = tokenInfo; + this._indentSize = indentSize; + this._indentType = indentType; + + this._tree = new BinarySearchTree(); + this._tree.insert(0, { offset: 0, from: null, force: false }); + + this._lockedFirstTokens = new WeakMap(); + this._desiredIndentCache = new WeakMap(); + this._ignoredTokens = new WeakSet(); + } + + _getOffsetDescriptor(token) { + return this._tree.findLe(token.range[0]).value; + } + + /** + * Sets the offset column of token B to match the offset column of token A. + * **WARNING**: This matches a *column*, even if baseToken is not the first token on its line. In + * most cases, `setDesiredOffset` should be used instead. + * @param {Token} baseToken The first token + * @param {Token} offsetToken The second token, whose offset should be matched to the first token + * @returns {void} + */ + matchOffsetOf(baseToken, offsetToken) { + + /* + * lockedFirstTokens is a map from a token whose indentation is controlled by the "first" option to + * the token that it depends on. For example, with the `ArrayExpression: first` option, the first + * token of each element in the array after the first will be mapped to the first token of the first + * element. The desired indentation of each of these tokens is computed based on the desired indentation + * of the "first" element, rather than through the normal offset mechanism. + */ + this._lockedFirstTokens.set(offsetToken, baseToken); + } + + /** + * Sets the desired offset of a token. + * + * This uses a line-based offset collapsing behavior to handle tokens on the same line. + * For example, consider the following two cases: + * + * ( + * [ + * bar + * ] + * ) + * + * ([ + * bar + * ]) + * + * Based on the first case, it's clear that the `bar` token needs to have an offset of 1 indent level (4 spaces) from + * the `[` token, and the `[` token has to have an offset of 1 indent level from the `(` token. Since the `(` token is + * the first on its line (with an indent of 0 spaces), the `bar` token needs to be offset by 2 indent levels (8 spaces) + * from the start of its line. + * + * However, in the second case `bar` should only be indented by 4 spaces. This is because the offset of 1 indent level + * between the `(` and the `[` tokens gets "collapsed" because the two tokens are on the same line. As a result, the + * `(` token is mapped to the `[` token with an offset of 0, and the rule correctly decides that `bar` should be indented + * by 1 indent level from the start of the line. + * + * This is useful because rule listeners can usually just call `setDesiredOffset` for all the tokens in the node, + * without needing to check which lines those tokens are on. + * + * Note that since collapsing only occurs when two tokens are on the same line, there are a few cases where non-intuitive + * behavior can occur. For example, consider the following cases: + * + * foo( + * ). + * bar( + * baz + * ) + * + * foo( + * ).bar( + * baz + * ) + * + * Based on the first example, it would seem that `bar` should be offset by 1 indent level from `foo`, and `baz` + * should be offset by 1 indent level from `bar`. However, this is not correct, because it would result in `baz` + * being indented by 2 indent levels in the second case (since `foo`, `bar`, and `baz` are all on separate lines, no + * collapsing would occur). + * + * Instead, the correct way would be to offset `baz` by 1 level from `bar`, offset `bar` by 1 level from the `)`, and + * offset the `)` by 0 levels from `foo`. This ensures that the offset between `bar` and the `)` are correctly collapsed + * in the second case. + * @param {Token} token The token + * @param {Token} fromToken The token that `token` should be offset from + * @param {number} offset The desired indent level + * @returns {void} + */ + setDesiredOffset(token, fromToken, offset) { + return this.setDesiredOffsets(token.range, fromToken, offset); + } + + /** + * Sets the desired offset of all tokens in a range + * It's common for node listeners in this file to need to apply the same offset to a large, contiguous range of tokens. + * Moreover, the offset of any given token is usually updated multiple times (roughly once for each node that contains + * it). This means that the offset of each token is updated O(AST depth) times. + * It would not be performant to store and update the offsets for each token independently, because the rule would end + * up having a time complexity of O(number of tokens * AST depth), which is quite slow for large files. + * + * Instead, the offset tree is represented as a collection of contiguous offset ranges in a file. For example, the following + * list could represent the state of the offset tree at a given point: + * + * * Tokens starting in the interval [0, 15) are aligned with the beginning of the file + * * Tokens starting in the interval [15, 30) are offset by 1 indent level from the `bar` token + * * Tokens starting in the interval [30, 43) are offset by 1 indent level from the `foo` token + * * Tokens starting in the interval [43, 820) are offset by 2 indent levels from the `bar` token + * * Tokens starting in the interval [820, ∞) are offset by 1 indent level from the `baz` token + * + * The `setDesiredOffsets` methods inserts ranges like the ones above. The third line above would be inserted by using: + * `setDesiredOffsets([30, 43], fooToken, 1);` + * @param {[number, number]} range A [start, end] pair. All tokens with range[0] <= token.start < range[1] will have the offset applied. + * @param {Token} fromToken The token that this is offset from + * @param {number} offset The desired indent level + * @param {boolean} force `true` if this offset should not use the normal collapsing behavior. This should almost always be false. + * @returns {void} + */ + setDesiredOffsets(range, fromToken, offset, force) { + + /* + * Offset ranges are stored as a collection of nodes, where each node maps a numeric key to an offset + * descriptor. The tree for the example above would have the following nodes: + * + * * key: 0, value: { offset: 0, from: null } + * * key: 15, value: { offset: 1, from: barToken } + * * key: 30, value: { offset: 1, from: fooToken } + * * key: 43, value: { offset: 2, from: barToken } + * * key: 820, value: { offset: 1, from: bazToken } + * + * To find the offset descriptor for any given token, one needs to find the node with the largest key + * which is <= token.start. To make this operation fast, the nodes are stored in a balanced binary + * search tree indexed by key. + */ + + const descriptorToInsert = { offset, from: fromToken, force }; + + const descriptorAfterRange = this._tree.findLe(range[1]).value; + + const fromTokenIsInRange = fromToken && fromToken.range[0] >= range[0] && fromToken.range[1] <= range[1]; + const fromTokenDescriptor = fromTokenIsInRange && this._getOffsetDescriptor(fromToken); + + // First, remove any existing nodes in the range from the tree. + this._tree.deleteRange(range[0] + 1, range[1]); + + // Insert a new node into the tree for this range + this._tree.insert(range[0], descriptorToInsert); + + /* + * To avoid circular offset dependencies, keep the `fromToken` token mapped to whatever it was mapped to previously, + * even if it's in the current range. + */ + if (fromTokenIsInRange) { + this._tree.insert(fromToken.range[0], fromTokenDescriptor); + this._tree.insert(fromToken.range[1], descriptorToInsert); + } + + /* + * To avoid modifying the offset of tokens after the range, insert another node to keep the offset of the following + * tokens the same as it was before. + */ + this._tree.insert(range[1], descriptorAfterRange); + } + + /** + * Gets the desired indent of a token + * @param {Token} token The token + * @returns {string} The desired indent of the token + */ + getDesiredIndent(token) { + if (!this._desiredIndentCache.has(token)) { + + if (this._ignoredTokens.has(token)) { + + /* + * If the token is ignored, use the actual indent of the token as the desired indent. + * This ensures that no errors are reported for this token. + */ + this._desiredIndentCache.set( + token, + this._tokenInfo.getTokenIndent(token) + ); + } else if (this._lockedFirstTokens.has(token)) { + const firstToken = this._lockedFirstTokens.get(token); + + this._desiredIndentCache.set( + token, + + // (indentation for the first element's line) + this.getDesiredIndent(this._tokenInfo.getFirstTokenOfLine(firstToken)) + + + // (space between the start of the first element's line and the first element) + this._indentType.repeat(firstToken.loc.start.column - this._tokenInfo.getFirstTokenOfLine(firstToken).loc.start.column) + ); + } else { + const offsetInfo = this._getOffsetDescriptor(token); + const offset = ( + offsetInfo.from && + offsetInfo.from.loc.start.line === token.loc.start.line && + !/^\s*?\n/u.test(token.value) && + !offsetInfo.force + ) ? 0 : offsetInfo.offset * this._indentSize; + + this._desiredIndentCache.set( + token, + (offsetInfo.from ? this.getDesiredIndent(offsetInfo.from) : "") + this._indentType.repeat(offset) + ); + } + } + return this._desiredIndentCache.get(token); + } + + /** + * Ignores a token, preventing it from being reported. + * @param {Token} token The token + * @returns {void} + */ + ignoreToken(token) { + if (this._tokenInfo.isFirstTokenOfLine(token)) { + this._ignoredTokens.add(token); + } + } + + /** + * Gets the first token that the given token's indentation is dependent on + * @param {Token} token The token + * @returns {Token} The token that the given token depends on, or `null` if the given token is at the top level + */ + getFirstDependency(token) { + return this._getOffsetDescriptor(token).from; + } +} + +const ELEMENT_LIST_SCHEMA = { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["first", "off"] + } + ] +}; + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent indentation", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/indent" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["tab"] + }, + { + type: "integer", + minimum: 0 + } + ] + }, + { + type: "object", + properties: { + SwitchCase: { + type: "integer", + minimum: 0, + default: 0 + }, + VariableDeclarator: { + oneOf: [ + ELEMENT_LIST_SCHEMA, + { + type: "object", + properties: { + var: ELEMENT_LIST_SCHEMA, + let: ELEMENT_LIST_SCHEMA, + const: ELEMENT_LIST_SCHEMA + }, + additionalProperties: false + } + ] + }, + outerIIFEBody: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["off"] + } + ] + }, + MemberExpression: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["off"] + } + ] + }, + FunctionDeclaration: { + type: "object", + properties: { + parameters: ELEMENT_LIST_SCHEMA, + body: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + }, + FunctionExpression: { + type: "object", + properties: { + parameters: ELEMENT_LIST_SCHEMA, + body: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + }, + CallExpression: { + type: "object", + properties: { + arguments: ELEMENT_LIST_SCHEMA + }, + additionalProperties: false + }, + ArrayExpression: ELEMENT_LIST_SCHEMA, + ObjectExpression: ELEMENT_LIST_SCHEMA, + ImportDeclaration: ELEMENT_LIST_SCHEMA, + flatTernaryExpressions: { + type: "boolean", + default: false + }, + offsetTernaryExpressions: { + type: "boolean", + default: false + }, + ignoredNodes: { + type: "array", + items: { + type: "string", + not: { + pattern: ":exit$" + } + } + }, + ignoreComments: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + messages: { + wrongIndentation: "Expected indentation of {{expected}} but found {{actual}}." + } + }, + + create(context) { + const DEFAULT_VARIABLE_INDENT = 1; + const DEFAULT_PARAMETER_INDENT = 1; + const DEFAULT_FUNCTION_BODY_INDENT = 1; + + let indentType = "space"; + let indentSize = 4; + const options = { + SwitchCase: 0, + VariableDeclarator: { + var: DEFAULT_VARIABLE_INDENT, + let: DEFAULT_VARIABLE_INDENT, + const: DEFAULT_VARIABLE_INDENT + }, + outerIIFEBody: 1, + FunctionDeclaration: { + parameters: DEFAULT_PARAMETER_INDENT, + body: DEFAULT_FUNCTION_BODY_INDENT + }, + FunctionExpression: { + parameters: DEFAULT_PARAMETER_INDENT, + body: DEFAULT_FUNCTION_BODY_INDENT + }, + CallExpression: { + arguments: DEFAULT_PARAMETER_INDENT + }, + MemberExpression: 1, + ArrayExpression: 1, + ObjectExpression: 1, + ImportDeclaration: 1, + flatTernaryExpressions: false, + ignoredNodes: [], + ignoreComments: false + }; + + if (context.options.length) { + if (context.options[0] === "tab") { + indentSize = 1; + indentType = "tab"; + } else { + indentSize = context.options[0]; + indentType = "space"; + } + + if (context.options[1]) { + Object.assign(options, context.options[1]); + + if (typeof options.VariableDeclarator === "number" || options.VariableDeclarator === "first") { + options.VariableDeclarator = { + var: options.VariableDeclarator, + let: options.VariableDeclarator, + const: options.VariableDeclarator + }; + } + } + } + + const sourceCode = context.getSourceCode(); + const tokenInfo = new TokenInfo(sourceCode); + const offsets = new OffsetStorage(tokenInfo, indentSize, indentType === "space" ? " " : "\t"); + const parameterParens = new WeakSet(); + + /** + * Creates an error message for a line, given the expected/actual indentation. + * @param {int} expectedAmount The expected amount of indentation characters for this line + * @param {int} actualSpaces The actual number of indentation spaces that were found on this line + * @param {int} actualTabs The actual number of indentation tabs that were found on this line + * @returns {string} An error message for this line + */ + function createErrorMessageData(expectedAmount, actualSpaces, actualTabs) { + const expectedStatement = `${expectedAmount} ${indentType}${expectedAmount === 1 ? "" : "s"}`; // e.g. "2 tabs" + const foundSpacesWord = `space${actualSpaces === 1 ? "" : "s"}`; // e.g. "space" + const foundTabsWord = `tab${actualTabs === 1 ? "" : "s"}`; // e.g. "tabs" + let foundStatement; + + if (actualSpaces > 0) { + + /* + * Abbreviate the message if the expected indentation is also spaces. + * e.g. 'Expected 4 spaces but found 2' rather than 'Expected 4 spaces but found 2 spaces' + */ + foundStatement = indentType === "space" ? actualSpaces : `${actualSpaces} ${foundSpacesWord}`; + } else if (actualTabs > 0) { + foundStatement = indentType === "tab" ? actualTabs : `${actualTabs} ${foundTabsWord}`; + } else { + foundStatement = "0"; + } + return { + expected: expectedStatement, + actual: foundStatement + }; + } + + /** + * Reports a given indent violation + * @param {Token} token Token violating the indent rule + * @param {string} neededIndent Expected indentation string + * @returns {void} + */ + function report(token, neededIndent) { + const actualIndent = Array.from(tokenInfo.getTokenIndent(token)); + const numSpaces = actualIndent.filter(char => char === " ").length; + const numTabs = actualIndent.filter(char => char === "\t").length; + + context.report({ + node: token, + messageId: "wrongIndentation", + data: createErrorMessageData(neededIndent.length, numSpaces, numTabs), + loc: { + start: { line: token.loc.start.line, column: 0 }, + end: { line: token.loc.start.line, column: token.loc.start.column } + }, + fix(fixer) { + const range = [token.range[0] - token.loc.start.column, token.range[0]]; + const newText = neededIndent; + + return fixer.replaceTextRange(range, newText); + } + }); + } + + /** + * Checks if a token's indentation is correct + * @param {Token} token Token to examine + * @param {string} desiredIndent Desired indentation of the string + * @returns {boolean} `true` if the token's indentation is correct + */ + function validateTokenIndent(token, desiredIndent) { + const indentation = tokenInfo.getTokenIndent(token); + + return indentation === desiredIndent || + + // To avoid conflicts with no-mixed-spaces-and-tabs, don't report mixed spaces and tabs. + indentation.includes(" ") && indentation.includes("\t"); + } + + /** + * Check to see if the node is a file level IIFE + * @param {ASTNode} node The function node to check. + * @returns {boolean} True if the node is the outer IIFE + */ + function isOuterIIFE(node) { + + /* + * Verify that the node is an IIFE + */ + if (!node.parent || node.parent.type !== "CallExpression" || node.parent.callee !== node) { + return false; + } + + /* + * Navigate legal ancestors to determine whether this IIFE is outer. + * A "legal ancestor" is an expression or statement that causes the function to get executed immediately. + * For example, `!(function(){})()` is an outer IIFE even though it is preceded by a ! operator. + */ + let statement = node.parent && node.parent.parent; + + while ( + statement.type === "UnaryExpression" && ["!", "~", "+", "-"].indexOf(statement.operator) > -1 || + statement.type === "AssignmentExpression" || + statement.type === "LogicalExpression" || + statement.type === "SequenceExpression" || + statement.type === "VariableDeclarator" + ) { + statement = statement.parent; + } + + return (statement.type === "ExpressionStatement" || statement.type === "VariableDeclaration") && statement.parent.type === "Program"; + } + + /** + * Counts the number of linebreaks that follow the last non-whitespace character in a string + * @param {string} string The string to check + * @returns {number} The number of JavaScript linebreaks that follow the last non-whitespace character, + * or the total number of linebreaks if the string is all whitespace. + */ + function countTrailingLinebreaks(string) { + const trailingWhitespace = string.match(/\s*$/u)[0]; + const linebreakMatches = trailingWhitespace.match(astUtils.createGlobalLinebreakMatcher()); + + return linebreakMatches === null ? 0 : linebreakMatches.length; + } + + /** + * Check indentation for lists of elements (arrays, objects, function params) + * @param {ASTNode[]} elements List of elements that should be offset + * @param {Token} startToken The start token of the list that element should be aligned against, e.g. '[' + * @param {Token} endToken The end token of the list, e.g. ']' + * @param {number|string} offset The amount that the elements should be offset + * @returns {void} + */ + function addElementListIndent(elements, startToken, endToken, offset) { + + /** + * Gets the first token of a given element, including surrounding parentheses. + * @param {ASTNode} element A node in the `elements` list + * @returns {Token} The first token of this element + */ + function getFirstToken(element) { + let token = sourceCode.getTokenBefore(element); + + while (astUtils.isOpeningParenToken(token) && token !== startToken) { + token = sourceCode.getTokenBefore(token); + } + return sourceCode.getTokenAfter(token); + } + + // Run through all the tokens in the list, and offset them by one indent level (mainly for comments, other things will end up overridden) + offsets.setDesiredOffsets( + [startToken.range[1], endToken.range[0]], + startToken, + typeof offset === "number" ? offset : 1 + ); + offsets.setDesiredOffset(endToken, startToken, 0); + + // If the preference is "first" but there is no first element (e.g. sparse arrays w/ empty first slot), fall back to 1 level. + if (offset === "first" && elements.length && !elements[0]) { + return; + } + elements.forEach((element, index) => { + if (!element) { + + // Skip holes in arrays + return; + } + if (offset === "off") { + + // Ignore the first token of every element if the "off" option is used + offsets.ignoreToken(getFirstToken(element)); + } + + // Offset the following elements correctly relative to the first element + if (index === 0) { + return; + } + if (offset === "first" && tokenInfo.isFirstTokenOfLine(getFirstToken(element))) { + offsets.matchOffsetOf(getFirstToken(elements[0]), getFirstToken(element)); + } else { + const previousElement = elements[index - 1]; + const firstTokenOfPreviousElement = previousElement && getFirstToken(previousElement); + const previousElementLastToken = previousElement && sourceCode.getLastToken(previousElement); + + if ( + previousElement && + previousElementLastToken.loc.end.line - countTrailingLinebreaks(previousElementLastToken.value) > startToken.loc.end.line + ) { + offsets.setDesiredOffsets( + [previousElement.range[1], element.range[1]], + firstTokenOfPreviousElement, + 0 + ); + } + } + }); + } + + /** + * Check and decide whether to check for indentation for blockless nodes + * Scenarios are for or while statements without braces around them + * @param {ASTNode} node node to examine + * @returns {void} + */ + function addBlocklessNodeIndent(node) { + if (node.type !== "BlockStatement") { + const lastParentToken = sourceCode.getTokenBefore(node, astUtils.isNotOpeningParenToken); + + let firstBodyToken = sourceCode.getFirstToken(node); + let lastBodyToken = sourceCode.getLastToken(node); + + while ( + astUtils.isOpeningParenToken(sourceCode.getTokenBefore(firstBodyToken)) && + astUtils.isClosingParenToken(sourceCode.getTokenAfter(lastBodyToken)) + ) { + firstBodyToken = sourceCode.getTokenBefore(firstBodyToken); + lastBodyToken = sourceCode.getTokenAfter(lastBodyToken); + } + + offsets.setDesiredOffsets([firstBodyToken.range[0], lastBodyToken.range[1]], lastParentToken, 1); + + /* + * For blockless nodes with semicolon-first style, don't indent the semicolon. + * e.g. + * if (foo) bar() + * ; [1, 2, 3].map(foo) + */ + const lastToken = sourceCode.getLastToken(node); + + if (node.type !== "EmptyStatement" && astUtils.isSemicolonToken(lastToken)) { + offsets.setDesiredOffset(lastToken, lastParentToken, 0); + } + } + } + + /** + * Checks the indentation for nodes that are like function calls (`CallExpression` and `NewExpression`) + * @param {ASTNode} node A CallExpression or NewExpression node + * @returns {void} + */ + function addFunctionCallIndent(node) { + let openingParen; + + if (node.arguments.length) { + openingParen = sourceCode.getFirstTokenBetween(node.callee, node.arguments[0], astUtils.isOpeningParenToken); + } else { + openingParen = sourceCode.getLastToken(node, 1); + } + const closingParen = sourceCode.getLastToken(node); + + parameterParens.add(openingParen); + parameterParens.add(closingParen); + + /* + * If `?.` token exists, set desired offset for that. + * This logic is copied from `MemberExpression`'s. + */ + if (node.optional) { + const dotToken = sourceCode.getTokenAfter(node.callee, astUtils.isQuestionDotToken); + const calleeParenCount = sourceCode.getTokensBetween(node.callee, dotToken, { filter: astUtils.isClosingParenToken }).length; + const firstTokenOfCallee = calleeParenCount + ? sourceCode.getTokenBefore(node.callee, { skip: calleeParenCount - 1 }) + : sourceCode.getFirstToken(node.callee); + const lastTokenOfCallee = sourceCode.getTokenBefore(dotToken); + const offsetBase = lastTokenOfCallee.loc.end.line === openingParen.loc.start.line + ? lastTokenOfCallee + : firstTokenOfCallee; + + offsets.setDesiredOffset(dotToken, offsetBase, 1); + } + + const offsetAfterToken = node.callee.type === "TaggedTemplateExpression" ? sourceCode.getFirstToken(node.callee.quasi) : openingParen; + const offsetToken = sourceCode.getTokenBefore(offsetAfterToken); + + offsets.setDesiredOffset(openingParen, offsetToken, 0); + + addElementListIndent(node.arguments, openingParen, closingParen, options.CallExpression.arguments); + } + + /** + * Checks the indentation of parenthesized values, given a list of tokens in a program + * @param {Token[]} tokens A list of tokens + * @returns {void} + */ + function addParensIndent(tokens) { + const parenStack = []; + const parenPairs = []; + + tokens.forEach(nextToken => { + + // Accumulate a list of parenthesis pairs + if (astUtils.isOpeningParenToken(nextToken)) { + parenStack.push(nextToken); + } else if (astUtils.isClosingParenToken(nextToken)) { + parenPairs.unshift({ left: parenStack.pop(), right: nextToken }); + } + }); + + parenPairs.forEach(pair => { + const leftParen = pair.left; + const rightParen = pair.right; + + // We only want to handle parens around expressions, so exclude parentheses that are in function parameters and function call arguments. + if (!parameterParens.has(leftParen) && !parameterParens.has(rightParen)) { + const parenthesizedTokens = new Set(sourceCode.getTokensBetween(leftParen, rightParen)); + + parenthesizedTokens.forEach(token => { + if (!parenthesizedTokens.has(offsets.getFirstDependency(token))) { + offsets.setDesiredOffset(token, leftParen, 1); + } + }); + } + + offsets.setDesiredOffset(rightParen, leftParen, 0); + }); + } + + /** + * Ignore all tokens within an unknown node whose offset do not depend + * on another token's offset within the unknown node + * @param {ASTNode} node Unknown Node + * @returns {void} + */ + function ignoreNode(node) { + const unknownNodeTokens = new Set(sourceCode.getTokens(node, { includeComments: true })); + + unknownNodeTokens.forEach(token => { + if (!unknownNodeTokens.has(offsets.getFirstDependency(token))) { + const firstTokenOfLine = tokenInfo.getFirstTokenOfLine(token); + + if (token === firstTokenOfLine) { + offsets.ignoreToken(token); + } else { + offsets.setDesiredOffset(token, firstTokenOfLine, 0); + } + } + }); + } + + /** + * Check whether the given token is on the first line of a statement. + * @param {Token} token The token to check. + * @param {ASTNode} leafNode The expression node that the token belongs directly. + * @returns {boolean} `true` if the token is on the first line of a statement. + */ + function isOnFirstLineOfStatement(token, leafNode) { + let node = leafNode; + + while (node.parent && !node.parent.type.endsWith("Statement") && !node.parent.type.endsWith("Declaration")) { + node = node.parent; + } + node = node.parent; + + return !node || node.loc.start.line === token.loc.start.line; + } + + /** + * Check whether there are any blank (whitespace-only) lines between + * two tokens on separate lines. + * @param {Token} firstToken The first token. + * @param {Token} secondToken The second token. + * @returns {boolean} `true` if the tokens are on separate lines and + * there exists a blank line between them, `false` otherwise. + */ + function hasBlankLinesBetween(firstToken, secondToken) { + const firstTokenLine = firstToken.loc.end.line; + const secondTokenLine = secondToken.loc.start.line; + + if (firstTokenLine === secondTokenLine || firstTokenLine === secondTokenLine - 1) { + return false; + } + + for (let line = firstTokenLine + 1; line < secondTokenLine; ++line) { + if (!tokenInfo.firstTokensByLineNumber.has(line)) { + return true; + } + } + + return false; + } + + const ignoredNodeFirstTokens = new Set(); + + const baseOffsetListeners = { + "ArrayExpression, ArrayPattern"(node) { + const openingBracket = sourceCode.getFirstToken(node); + const closingBracket = sourceCode.getTokenAfter(lodash.findLast(node.elements) || openingBracket, astUtils.isClosingBracketToken); + + addElementListIndent(node.elements, openingBracket, closingBracket, options.ArrayExpression); + }, + + "ObjectExpression, ObjectPattern"(node) { + const openingCurly = sourceCode.getFirstToken(node); + const closingCurly = sourceCode.getTokenAfter( + node.properties.length ? node.properties[node.properties.length - 1] : openingCurly, + astUtils.isClosingBraceToken + ); + + addElementListIndent(node.properties, openingCurly, closingCurly, options.ObjectExpression); + }, + + ArrowFunctionExpression(node) { + const maybeOpeningParen = sourceCode.getFirstToken(node, { skip: node.async ? 1 : 0 }); + + if (astUtils.isOpeningParenToken(maybeOpeningParen)) { + const openingParen = maybeOpeningParen; + const closingParen = sourceCode.getTokenBefore(node.body, astUtils.isClosingParenToken); + + parameterParens.add(openingParen); + parameterParens.add(closingParen); + addElementListIndent(node.params, openingParen, closingParen, options.FunctionExpression.parameters); + } + + addBlocklessNodeIndent(node.body); + }, + + AssignmentExpression(node) { + const operator = sourceCode.getFirstTokenBetween(node.left, node.right, token => token.value === node.operator); + + offsets.setDesiredOffsets([operator.range[0], node.range[1]], sourceCode.getLastToken(node.left), 1); + offsets.ignoreToken(operator); + offsets.ignoreToken(sourceCode.getTokenAfter(operator)); + }, + + "BinaryExpression, LogicalExpression"(node) { + const operator = sourceCode.getFirstTokenBetween(node.left, node.right, token => token.value === node.operator); + + /* + * For backwards compatibility, don't check BinaryExpression indents, e.g. + * var foo = bar && + * baz; + */ + + const tokenAfterOperator = sourceCode.getTokenAfter(operator); + + offsets.ignoreToken(operator); + offsets.ignoreToken(tokenAfterOperator); + offsets.setDesiredOffset(tokenAfterOperator, operator, 0); + }, + + "BlockStatement, ClassBody"(node) { + let blockIndentLevel; + + if (node.parent && isOuterIIFE(node.parent)) { + blockIndentLevel = options.outerIIFEBody; + } else if (node.parent && (node.parent.type === "FunctionExpression" || node.parent.type === "ArrowFunctionExpression")) { + blockIndentLevel = options.FunctionExpression.body; + } else if (node.parent && node.parent.type === "FunctionDeclaration") { + blockIndentLevel = options.FunctionDeclaration.body; + } else { + blockIndentLevel = 1; + } + + /* + * For blocks that aren't lone statements, ensure that the opening curly brace + * is aligned with the parent. + */ + if (!astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type)) { + offsets.setDesiredOffset(sourceCode.getFirstToken(node), sourceCode.getFirstToken(node.parent), 0); + } + + addElementListIndent(node.body, sourceCode.getFirstToken(node), sourceCode.getLastToken(node), blockIndentLevel); + }, + + CallExpression: addFunctionCallIndent, + + "ClassDeclaration[superClass], ClassExpression[superClass]"(node) { + const classToken = sourceCode.getFirstToken(node); + const extendsToken = sourceCode.getTokenBefore(node.superClass, astUtils.isNotOpeningParenToken); + + offsets.setDesiredOffsets([extendsToken.range[0], node.body.range[0]], classToken, 1); + }, + + ConditionalExpression(node) { + const firstToken = sourceCode.getFirstToken(node); + + // `flatTernaryExpressions` option is for the following style: + // var a = + // foo > 0 ? bar : + // foo < 0 ? baz : + // /*else*/ qiz ; + if (!options.flatTernaryExpressions || + !astUtils.isTokenOnSameLine(node.test, node.consequent) || + isOnFirstLineOfStatement(firstToken, node) + ) { + const questionMarkToken = sourceCode.getFirstTokenBetween(node.test, node.consequent, token => token.type === "Punctuator" && token.value === "?"); + const colonToken = sourceCode.getFirstTokenBetween(node.consequent, node.alternate, token => token.type === "Punctuator" && token.value === ":"); + + const firstConsequentToken = sourceCode.getTokenAfter(questionMarkToken); + const lastConsequentToken = sourceCode.getTokenBefore(colonToken); + const firstAlternateToken = sourceCode.getTokenAfter(colonToken); + + offsets.setDesiredOffset(questionMarkToken, firstToken, 1); + offsets.setDesiredOffset(colonToken, firstToken, 1); + + offsets.setDesiredOffset(firstConsequentToken, firstToken, + options.offsetTernaryExpressions ? 2 : 1); + + /* + * The alternate and the consequent should usually have the same indentation. + * If they share part of a line, align the alternate against the first token of the consequent. + * This allows the alternate to be indented correctly in cases like this: + * foo ? ( + * bar + * ) : ( // this '(' is aligned with the '(' above, so it's considered to be aligned with `foo` + * baz // as a result, `baz` is offset by 1 rather than 2 + * ) + */ + if (lastConsequentToken.loc.end.line === firstAlternateToken.loc.start.line) { + offsets.setDesiredOffset(firstAlternateToken, firstConsequentToken, 0); + } else { + + /** + * If the alternate and consequent do not share part of a line, offset the alternate from the first + * token of the conditional expression. For example: + * foo ? bar + * : baz + * + * If `baz` were aligned with `bar` rather than being offset by 1 from `foo`, `baz` would end up + * having no expected indentation. + */ + offsets.setDesiredOffset(firstAlternateToken, firstToken, + firstAlternateToken.type === "Punctuator" && + options.offsetTernaryExpressions ? 2 : 1); + } + } + }, + + "DoWhileStatement, WhileStatement, ForInStatement, ForOfStatement": node => addBlocklessNodeIndent(node.body), + + ExportNamedDeclaration(node) { + if (node.declaration === null) { + const closingCurly = sourceCode.getLastToken(node, astUtils.isClosingBraceToken); + + // Indent the specifiers in `export {foo, bar, baz}` + addElementListIndent(node.specifiers, sourceCode.getFirstToken(node, { skip: 1 }), closingCurly, 1); + + if (node.source) { + + // Indent everything after and including the `from` token in `export {foo, bar, baz} from 'qux'` + offsets.setDesiredOffsets([closingCurly.range[1], node.range[1]], sourceCode.getFirstToken(node), 1); + } + } + }, + + ForStatement(node) { + const forOpeningParen = sourceCode.getFirstToken(node, 1); + + if (node.init) { + offsets.setDesiredOffsets(node.init.range, forOpeningParen, 1); + } + if (node.test) { + offsets.setDesiredOffsets(node.test.range, forOpeningParen, 1); + } + if (node.update) { + offsets.setDesiredOffsets(node.update.range, forOpeningParen, 1); + } + addBlocklessNodeIndent(node.body); + }, + + "FunctionDeclaration, FunctionExpression"(node) { + const closingParen = sourceCode.getTokenBefore(node.body); + const openingParen = sourceCode.getTokenBefore(node.params.length ? node.params[0] : closingParen); + + parameterParens.add(openingParen); + parameterParens.add(closingParen); + addElementListIndent(node.params, openingParen, closingParen, options[node.type].parameters); + }, + + IfStatement(node) { + addBlocklessNodeIndent(node.consequent); + if (node.alternate && node.alternate.type !== "IfStatement") { + addBlocklessNodeIndent(node.alternate); + } + }, + + ImportDeclaration(node) { + if (node.specifiers.some(specifier => specifier.type === "ImportSpecifier")) { + const openingCurly = sourceCode.getFirstToken(node, astUtils.isOpeningBraceToken); + const closingCurly = sourceCode.getLastToken(node, astUtils.isClosingBraceToken); + + addElementListIndent(node.specifiers.filter(specifier => specifier.type === "ImportSpecifier"), openingCurly, closingCurly, options.ImportDeclaration); + } + + const fromToken = sourceCode.getLastToken(node, token => token.type === "Identifier" && token.value === "from"); + const sourceToken = sourceCode.getLastToken(node, token => token.type === "String"); + const semiToken = sourceCode.getLastToken(node, token => token.type === "Punctuator" && token.value === ";"); + + if (fromToken) { + const end = semiToken && semiToken.range[1] === sourceToken.range[1] ? node.range[1] : sourceToken.range[1]; + + offsets.setDesiredOffsets([fromToken.range[0], end], sourceCode.getFirstToken(node), 1); + } + }, + + ImportExpression(node) { + const openingParen = sourceCode.getFirstToken(node, 1); + const closingParen = sourceCode.getLastToken(node); + + parameterParens.add(openingParen); + parameterParens.add(closingParen); + offsets.setDesiredOffset(openingParen, sourceCode.getTokenBefore(openingParen), 0); + + addElementListIndent([node.source], openingParen, closingParen, options.CallExpression.arguments); + }, + + "MemberExpression, JSXMemberExpression, MetaProperty"(node) { + const object = node.type === "MetaProperty" ? node.meta : node.object; + const firstNonObjectToken = sourceCode.getFirstTokenBetween(object, node.property, astUtils.isNotClosingParenToken); + const secondNonObjectToken = sourceCode.getTokenAfter(firstNonObjectToken); + + const objectParenCount = sourceCode.getTokensBetween(object, node.property, { filter: astUtils.isClosingParenToken }).length; + const firstObjectToken = objectParenCount + ? sourceCode.getTokenBefore(object, { skip: objectParenCount - 1 }) + : sourceCode.getFirstToken(object); + const lastObjectToken = sourceCode.getTokenBefore(firstNonObjectToken); + const firstPropertyToken = node.computed ? firstNonObjectToken : secondNonObjectToken; + + if (node.computed) { + + // For computed MemberExpressions, match the closing bracket with the opening bracket. + offsets.setDesiredOffset(sourceCode.getLastToken(node), firstNonObjectToken, 0); + offsets.setDesiredOffsets(node.property.range, firstNonObjectToken, 1); + } + + /* + * If the object ends on the same line that the property starts, match against the last token + * of the object, to ensure that the MemberExpression is not indented. + * + * Otherwise, match against the first token of the object, e.g. + * foo + * .bar + * .baz // <-- offset by 1 from `foo` + */ + const offsetBase = lastObjectToken.loc.end.line === firstPropertyToken.loc.start.line + ? lastObjectToken + : firstObjectToken; + + if (typeof options.MemberExpression === "number") { + + // Match the dot (for non-computed properties) or the opening bracket (for computed properties) against the object. + offsets.setDesiredOffset(firstNonObjectToken, offsetBase, options.MemberExpression); + + /* + * For computed MemberExpressions, match the first token of the property against the opening bracket. + * Otherwise, match the first token of the property against the object. + */ + offsets.setDesiredOffset(secondNonObjectToken, node.computed ? firstNonObjectToken : offsetBase, options.MemberExpression); + } else { + + // If the MemberExpression option is off, ignore the dot and the first token of the property. + offsets.ignoreToken(firstNonObjectToken); + offsets.ignoreToken(secondNonObjectToken); + + // To ignore the property indentation, ensure that the property tokens depend on the ignored tokens. + offsets.setDesiredOffset(firstNonObjectToken, offsetBase, 0); + offsets.setDesiredOffset(secondNonObjectToken, firstNonObjectToken, 0); + } + }, + + NewExpression(node) { + + // Only indent the arguments if the NewExpression has parens (e.g. `new Foo(bar)` or `new Foo()`, but not `new Foo` + if (node.arguments.length > 0 || + astUtils.isClosingParenToken(sourceCode.getLastToken(node)) && + astUtils.isOpeningParenToken(sourceCode.getLastToken(node, 1))) { + addFunctionCallIndent(node); + } + }, + + Property(node) { + if (!node.shorthand && !node.method && node.kind === "init") { + const colon = sourceCode.getFirstTokenBetween(node.key, node.value, astUtils.isColonToken); + + offsets.ignoreToken(sourceCode.getTokenAfter(colon)); + } + }, + + SwitchStatement(node) { + const openingCurly = sourceCode.getTokenAfter(node.discriminant, astUtils.isOpeningBraceToken); + const closingCurly = sourceCode.getLastToken(node); + + offsets.setDesiredOffsets([openingCurly.range[1], closingCurly.range[0]], openingCurly, options.SwitchCase); + + if (node.cases.length) { + sourceCode.getTokensBetween( + node.cases[node.cases.length - 1], + closingCurly, + { includeComments: true, filter: astUtils.isCommentToken } + ).forEach(token => offsets.ignoreToken(token)); + } + }, + + SwitchCase(node) { + if (!(node.consequent.length === 1 && node.consequent[0].type === "BlockStatement")) { + const caseKeyword = sourceCode.getFirstToken(node); + const tokenAfterCurrentCase = sourceCode.getTokenAfter(node); + + offsets.setDesiredOffsets([caseKeyword.range[1], tokenAfterCurrentCase.range[0]], caseKeyword, 1); + } + }, + + TemplateLiteral(node) { + node.expressions.forEach((expression, index) => { + const previousQuasi = node.quasis[index]; + const nextQuasi = node.quasis[index + 1]; + const tokenToAlignFrom = previousQuasi.loc.start.line === previousQuasi.loc.end.line + ? sourceCode.getFirstToken(previousQuasi) + : null; + + offsets.setDesiredOffsets([previousQuasi.range[1], nextQuasi.range[0]], tokenToAlignFrom, 1); + offsets.setDesiredOffset(sourceCode.getFirstToken(nextQuasi), tokenToAlignFrom, 0); + }); + }, + + VariableDeclaration(node) { + let variableIndent = Object.prototype.hasOwnProperty.call(options.VariableDeclarator, node.kind) + ? options.VariableDeclarator[node.kind] + : DEFAULT_VARIABLE_INDENT; + + const firstToken = sourceCode.getFirstToken(node), + lastToken = sourceCode.getLastToken(node); + + if (options.VariableDeclarator[node.kind] === "first") { + if (node.declarations.length > 1) { + addElementListIndent( + node.declarations, + firstToken, + lastToken, + "first" + ); + return; + } + + variableIndent = DEFAULT_VARIABLE_INDENT; + } + + if (node.declarations[node.declarations.length - 1].loc.start.line > node.loc.start.line) { + + /* + * VariableDeclarator indentation is a bit different from other forms of indentation, in that the + * indentation of an opening bracket sometimes won't match that of a closing bracket. For example, + * the following indentations are correct: + * + * var foo = { + * ok: true + * }; + * + * var foo = { + * ok: true, + * }, + * bar = 1; + * + * Account for when exiting the AST (after indentations have already been set for the nodes in + * the declaration) by manually increasing the indentation level of the tokens in this declarator + * on the same line as the start of the declaration, provided that there are declarators that + * follow this one. + */ + offsets.setDesiredOffsets(node.range, firstToken, variableIndent, true); + } else { + offsets.setDesiredOffsets(node.range, firstToken, variableIndent); + } + + if (astUtils.isSemicolonToken(lastToken)) { + offsets.ignoreToken(lastToken); + } + }, + + VariableDeclarator(node) { + if (node.init) { + const equalOperator = sourceCode.getTokenBefore(node.init, astUtils.isNotOpeningParenToken); + const tokenAfterOperator = sourceCode.getTokenAfter(equalOperator); + + offsets.ignoreToken(equalOperator); + offsets.ignoreToken(tokenAfterOperator); + offsets.setDesiredOffsets([tokenAfterOperator.range[0], node.range[1]], equalOperator, 1); + offsets.setDesiredOffset(equalOperator, sourceCode.getLastToken(node.id), 0); + } + }, + + "JSXAttribute[value]"(node) { + const equalsToken = sourceCode.getFirstTokenBetween(node.name, node.value, token => token.type === "Punctuator" && token.value === "="); + + offsets.setDesiredOffsets([equalsToken.range[0], node.value.range[1]], sourceCode.getFirstToken(node.name), 1); + }, + + JSXElement(node) { + if (node.closingElement) { + addElementListIndent(node.children, sourceCode.getFirstToken(node.openingElement), sourceCode.getFirstToken(node.closingElement), 1); + } + }, + + JSXOpeningElement(node) { + const firstToken = sourceCode.getFirstToken(node); + let closingToken; + + if (node.selfClosing) { + closingToken = sourceCode.getLastToken(node, { skip: 1 }); + offsets.setDesiredOffset(sourceCode.getLastToken(node), closingToken, 0); + } else { + closingToken = sourceCode.getLastToken(node); + } + offsets.setDesiredOffsets(node.name.range, sourceCode.getFirstToken(node)); + addElementListIndent(node.attributes, firstToken, closingToken, 1); + }, + + JSXClosingElement(node) { + const firstToken = sourceCode.getFirstToken(node); + + offsets.setDesiredOffsets(node.name.range, firstToken, 1); + }, + + JSXFragment(node) { + const firstOpeningToken = sourceCode.getFirstToken(node.openingFragment); + const firstClosingToken = sourceCode.getFirstToken(node.closingFragment); + + addElementListIndent(node.children, firstOpeningToken, firstClosingToken, 1); + }, + + JSXOpeningFragment(node) { + const firstToken = sourceCode.getFirstToken(node); + const closingToken = sourceCode.getLastToken(node); + + offsets.setDesiredOffsets(node.range, firstToken, 1); + offsets.matchOffsetOf(firstToken, closingToken); + }, + + JSXClosingFragment(node) { + const firstToken = sourceCode.getFirstToken(node); + const slashToken = sourceCode.getLastToken(node, { skip: 1 }); + const closingToken = sourceCode.getLastToken(node); + const tokenToMatch = astUtils.isTokenOnSameLine(slashToken, closingToken) ? slashToken : closingToken; + + offsets.setDesiredOffsets(node.range, firstToken, 1); + offsets.matchOffsetOf(firstToken, tokenToMatch); + }, + + JSXExpressionContainer(node) { + const openingCurly = sourceCode.getFirstToken(node); + const closingCurly = sourceCode.getLastToken(node); + + offsets.setDesiredOffsets( + [openingCurly.range[1], closingCurly.range[0]], + openingCurly, + 1 + ); + }, + + JSXSpreadAttribute(node) { + const openingCurly = sourceCode.getFirstToken(node); + const closingCurly = sourceCode.getLastToken(node); + + offsets.setDesiredOffsets( + [openingCurly.range[1], closingCurly.range[0]], + openingCurly, + 1 + ); + }, + + "*"(node) { + const firstToken = sourceCode.getFirstToken(node); + + // Ensure that the children of every node are indented at least as much as the first token. + if (firstToken && !ignoredNodeFirstTokens.has(firstToken)) { + offsets.setDesiredOffsets(node.range, firstToken, 0); + } + } + }; + + const listenerCallQueue = []; + + /* + * To ignore the indentation of a node: + * 1. Don't call the node's listener when entering it (if it has a listener) + * 2. Don't set any offsets against the first token of the node. + * 3. Call `ignoreNode` on the node sometime after exiting it and before validating offsets. + */ + const offsetListeners = lodash.mapValues( + baseOffsetListeners, + + /* + * Offset listener calls are deferred until traversal is finished, and are called as + * part of the final `Program:exit` listener. This is necessary because a node might + * be matched by multiple selectors. + * + * Example: Suppose there is an offset listener for `Identifier`, and the user has + * specified in configuration that `MemberExpression > Identifier` should be ignored. + * Due to selector specificity rules, the `Identifier` listener will get called first. However, + * if a given Identifier node is supposed to be ignored, then the `Identifier` offset listener + * should not have been called at all. Without doing extra selector matching, we don't know + * whether the Identifier matches the `MemberExpression > Identifier` selector until the + * `MemberExpression > Identifier` listener is called. + * + * To avoid this, the `Identifier` listener isn't called until traversal finishes and all + * ignored nodes are known. + */ + listener => + node => + listenerCallQueue.push({ listener, node }) + ); + + // For each ignored node selector, set up a listener to collect it into the `ignoredNodes` set. + const ignoredNodes = new Set(); + + /** + * Ignores a node + * @param {ASTNode} node The node to ignore + * @returns {void} + */ + function addToIgnoredNodes(node) { + ignoredNodes.add(node); + ignoredNodeFirstTokens.add(sourceCode.getFirstToken(node)); + } + + const ignoredNodeListeners = options.ignoredNodes.reduce( + (listeners, ignoredSelector) => Object.assign(listeners, { [ignoredSelector]: addToIgnoredNodes }), + {} + ); + + /* + * Join the listeners, and add a listener to verify that all tokens actually have the correct indentation + * at the end. + * + * Using Object.assign will cause some offset listeners to be overwritten if the same selector also appears + * in `ignoredNodeListeners`. This isn't a problem because all of the matching nodes will be ignored, + * so those listeners wouldn't be called anyway. + */ + return Object.assign( + offsetListeners, + ignoredNodeListeners, + { + "*:exit"(node) { + + // If a node's type is nonstandard, we can't tell how its children should be offset, so ignore it. + if (!KNOWN_NODES.has(node.type)) { + addToIgnoredNodes(node); + } + }, + "Program:exit"() { + + // If ignoreComments option is enabled, ignore all comment tokens. + if (options.ignoreComments) { + sourceCode.getAllComments() + .forEach(comment => offsets.ignoreToken(comment)); + } + + // Invoke the queued offset listeners for the nodes that aren't ignored. + listenerCallQueue + .filter(nodeInfo => !ignoredNodes.has(nodeInfo.node)) + .forEach(nodeInfo => nodeInfo.listener(nodeInfo.node)); + + // Update the offsets for ignored nodes to prevent their child tokens from being reported. + ignoredNodes.forEach(ignoreNode); + + addParensIndent(sourceCode.ast.tokens); + + /* + * Create a Map from (tokenOrComment) => (precedingToken). + * This is necessary because sourceCode.getTokenBefore does not handle a comment as an argument correctly. + */ + const precedingTokens = sourceCode.ast.comments.reduce((commentMap, comment) => { + const tokenOrCommentBefore = sourceCode.getTokenBefore(comment, { includeComments: true }); + + return commentMap.set(comment, commentMap.has(tokenOrCommentBefore) ? commentMap.get(tokenOrCommentBefore) : tokenOrCommentBefore); + }, new WeakMap()); + + sourceCode.lines.forEach((line, lineIndex) => { + const lineNumber = lineIndex + 1; + + if (!tokenInfo.firstTokensByLineNumber.has(lineNumber)) { + + // Don't check indentation on blank lines + return; + } + + const firstTokenOfLine = tokenInfo.firstTokensByLineNumber.get(lineNumber); + + if (firstTokenOfLine.loc.start.line !== lineNumber) { + + // Don't check the indentation of multi-line tokens (e.g. template literals or block comments) twice. + return; + } + + if (astUtils.isCommentToken(firstTokenOfLine)) { + const tokenBefore = precedingTokens.get(firstTokenOfLine); + const tokenAfter = tokenBefore ? sourceCode.getTokenAfter(tokenBefore) : sourceCode.ast.tokens[0]; + const mayAlignWithBefore = tokenBefore && !hasBlankLinesBetween(tokenBefore, firstTokenOfLine); + const mayAlignWithAfter = tokenAfter && !hasBlankLinesBetween(firstTokenOfLine, tokenAfter); + + /* + * If a comment precedes a line that begins with a semicolon token, align to that token, i.e. + * + * let foo + * // comment + * ;(async () => {})() + */ + if (tokenAfter && astUtils.isSemicolonToken(tokenAfter) && !astUtils.isTokenOnSameLine(firstTokenOfLine, tokenAfter)) { + offsets.setDesiredOffset(firstTokenOfLine, tokenAfter, 0); + } + + // If a comment matches the expected indentation of the token immediately before or after, don't report it. + if ( + mayAlignWithBefore && validateTokenIndent(firstTokenOfLine, offsets.getDesiredIndent(tokenBefore)) || + mayAlignWithAfter && validateTokenIndent(firstTokenOfLine, offsets.getDesiredIndent(tokenAfter)) + ) { + return; + } + } + + // If the token matches the expected indentation, don't report it. + if (validateTokenIndent(firstTokenOfLine, offsets.getDesiredIndent(firstTokenOfLine))) { + return; + } + + // Otherwise, report the token/comment. + report(firstTokenOfLine, offsets.getDesiredIndent(firstTokenOfLine)); + }); + } + } + ); + } +}; diff --git a/node_modules/eslint/lib/rules/index.js b/node_modules/eslint/lib/rules/index.js new file mode 100644 index 000000000..3cf26e51b --- /dev/null +++ b/node_modules/eslint/lib/rules/index.js @@ -0,0 +1,297 @@ +/** + * @fileoverview Collects the built-in rules into a map structure so that they can be imported all at once and without + * using the file-system directly. + * @author Peter (Somogyvari) Metz + */ + +"use strict"; + +/* eslint sort-keys: ["error", "asc"] */ + +const { LazyLoadingRuleMap } = require("./utils/lazy-loading-rule-map"); + +/** @type {Map} */ +module.exports = new LazyLoadingRuleMap(Object.entries({ + "accessor-pairs": () => require("./accessor-pairs"), + "array-bracket-newline": () => require("./array-bracket-newline"), + "array-bracket-spacing": () => require("./array-bracket-spacing"), + "array-callback-return": () => require("./array-callback-return"), + "array-element-newline": () => require("./array-element-newline"), + "arrow-body-style": () => require("./arrow-body-style"), + "arrow-parens": () => require("./arrow-parens"), + "arrow-spacing": () => require("./arrow-spacing"), + "block-scoped-var": () => require("./block-scoped-var"), + "block-spacing": () => require("./block-spacing"), + "brace-style": () => require("./brace-style"), + "callback-return": () => require("./callback-return"), + camelcase: () => require("./camelcase"), + "capitalized-comments": () => require("./capitalized-comments"), + "class-methods-use-this": () => require("./class-methods-use-this"), + "comma-dangle": () => require("./comma-dangle"), + "comma-spacing": () => require("./comma-spacing"), + "comma-style": () => require("./comma-style"), + complexity: () => require("./complexity"), + "computed-property-spacing": () => require("./computed-property-spacing"), + "consistent-return": () => require("./consistent-return"), + "consistent-this": () => require("./consistent-this"), + "constructor-super": () => require("./constructor-super"), + curly: () => require("./curly"), + "default-case": () => require("./default-case"), + "default-case-last": () => require("./default-case-last"), + "default-param-last": () => require("./default-param-last"), + "dot-location": () => require("./dot-location"), + "dot-notation": () => require("./dot-notation"), + "eol-last": () => require("./eol-last"), + eqeqeq: () => require("./eqeqeq"), + "for-direction": () => require("./for-direction"), + "func-call-spacing": () => require("./func-call-spacing"), + "func-name-matching": () => require("./func-name-matching"), + "func-names": () => require("./func-names"), + "func-style": () => require("./func-style"), + "function-call-argument-newline": () => require("./function-call-argument-newline"), + "function-paren-newline": () => require("./function-paren-newline"), + "generator-star-spacing": () => require("./generator-star-spacing"), + "getter-return": () => require("./getter-return"), + "global-require": () => require("./global-require"), + "grouped-accessor-pairs": () => require("./grouped-accessor-pairs"), + "guard-for-in": () => require("./guard-for-in"), + "handle-callback-err": () => require("./handle-callback-err"), + "id-blacklist": () => require("./id-blacklist"), + "id-denylist": () => require("./id-denylist"), + "id-length": () => require("./id-length"), + "id-match": () => require("./id-match"), + "implicit-arrow-linebreak": () => require("./implicit-arrow-linebreak"), + indent: () => require("./indent"), + "indent-legacy": () => require("./indent-legacy"), + "init-declarations": () => require("./init-declarations"), + "jsx-quotes": () => require("./jsx-quotes"), + "key-spacing": () => require("./key-spacing"), + "keyword-spacing": () => require("./keyword-spacing"), + "line-comment-position": () => require("./line-comment-position"), + "linebreak-style": () => require("./linebreak-style"), + "lines-around-comment": () => require("./lines-around-comment"), + "lines-around-directive": () => require("./lines-around-directive"), + "lines-between-class-members": () => require("./lines-between-class-members"), + "max-classes-per-file": () => require("./max-classes-per-file"), + "max-depth": () => require("./max-depth"), + "max-len": () => require("./max-len"), + "max-lines": () => require("./max-lines"), + "max-lines-per-function": () => require("./max-lines-per-function"), + "max-nested-callbacks": () => require("./max-nested-callbacks"), + "max-params": () => require("./max-params"), + "max-statements": () => require("./max-statements"), + "max-statements-per-line": () => require("./max-statements-per-line"), + "multiline-comment-style": () => require("./multiline-comment-style"), + "multiline-ternary": () => require("./multiline-ternary"), + "new-cap": () => require("./new-cap"), + "new-parens": () => require("./new-parens"), + "newline-after-var": () => require("./newline-after-var"), + "newline-before-return": () => require("./newline-before-return"), + "newline-per-chained-call": () => require("./newline-per-chained-call"), + "no-alert": () => require("./no-alert"), + "no-array-constructor": () => require("./no-array-constructor"), + "no-async-promise-executor": () => require("./no-async-promise-executor"), + "no-await-in-loop": () => require("./no-await-in-loop"), + "no-bitwise": () => require("./no-bitwise"), + "no-buffer-constructor": () => require("./no-buffer-constructor"), + "no-caller": () => require("./no-caller"), + "no-case-declarations": () => require("./no-case-declarations"), + "no-catch-shadow": () => require("./no-catch-shadow"), + "no-class-assign": () => require("./no-class-assign"), + "no-compare-neg-zero": () => require("./no-compare-neg-zero"), + "no-cond-assign": () => require("./no-cond-assign"), + "no-confusing-arrow": () => require("./no-confusing-arrow"), + "no-console": () => require("./no-console"), + "no-const-assign": () => require("./no-const-assign"), + "no-constant-condition": () => require("./no-constant-condition"), + "no-constructor-return": () => require("./no-constructor-return"), + "no-continue": () => require("./no-continue"), + "no-control-regex": () => require("./no-control-regex"), + "no-debugger": () => require("./no-debugger"), + "no-delete-var": () => require("./no-delete-var"), + "no-div-regex": () => require("./no-div-regex"), + "no-dupe-args": () => require("./no-dupe-args"), + "no-dupe-class-members": () => require("./no-dupe-class-members"), + "no-dupe-else-if": () => require("./no-dupe-else-if"), + "no-dupe-keys": () => require("./no-dupe-keys"), + "no-duplicate-case": () => require("./no-duplicate-case"), + "no-duplicate-imports": () => require("./no-duplicate-imports"), + "no-else-return": () => require("./no-else-return"), + "no-empty": () => require("./no-empty"), + "no-empty-character-class": () => require("./no-empty-character-class"), + "no-empty-function": () => require("./no-empty-function"), + "no-empty-pattern": () => require("./no-empty-pattern"), + "no-eq-null": () => require("./no-eq-null"), + "no-eval": () => require("./no-eval"), + "no-ex-assign": () => require("./no-ex-assign"), + "no-extend-native": () => require("./no-extend-native"), + "no-extra-bind": () => require("./no-extra-bind"), + "no-extra-boolean-cast": () => require("./no-extra-boolean-cast"), + "no-extra-label": () => require("./no-extra-label"), + "no-extra-parens": () => require("./no-extra-parens"), + "no-extra-semi": () => require("./no-extra-semi"), + "no-fallthrough": () => require("./no-fallthrough"), + "no-floating-decimal": () => require("./no-floating-decimal"), + "no-func-assign": () => require("./no-func-assign"), + "no-global-assign": () => require("./no-global-assign"), + "no-implicit-coercion": () => require("./no-implicit-coercion"), + "no-implicit-globals": () => require("./no-implicit-globals"), + "no-implied-eval": () => require("./no-implied-eval"), + "no-import-assign": () => require("./no-import-assign"), + "no-inline-comments": () => require("./no-inline-comments"), + "no-inner-declarations": () => require("./no-inner-declarations"), + "no-invalid-regexp": () => require("./no-invalid-regexp"), + "no-invalid-this": () => require("./no-invalid-this"), + "no-irregular-whitespace": () => require("./no-irregular-whitespace"), + "no-iterator": () => require("./no-iterator"), + "no-label-var": () => require("./no-label-var"), + "no-labels": () => require("./no-labels"), + "no-lone-blocks": () => require("./no-lone-blocks"), + "no-lonely-if": () => require("./no-lonely-if"), + "no-loop-func": () => require("./no-loop-func"), + "no-loss-of-precision": () => require("./no-loss-of-precision"), + "no-magic-numbers": () => require("./no-magic-numbers"), + "no-misleading-character-class": () => require("./no-misleading-character-class"), + "no-mixed-operators": () => require("./no-mixed-operators"), + "no-mixed-requires": () => require("./no-mixed-requires"), + "no-mixed-spaces-and-tabs": () => require("./no-mixed-spaces-and-tabs"), + "no-multi-assign": () => require("./no-multi-assign"), + "no-multi-spaces": () => require("./no-multi-spaces"), + "no-multi-str": () => require("./no-multi-str"), + "no-multiple-empty-lines": () => require("./no-multiple-empty-lines"), + "no-native-reassign": () => require("./no-native-reassign"), + "no-negated-condition": () => require("./no-negated-condition"), + "no-negated-in-lhs": () => require("./no-negated-in-lhs"), + "no-nested-ternary": () => require("./no-nested-ternary"), + "no-new": () => require("./no-new"), + "no-new-func": () => require("./no-new-func"), + "no-new-object": () => require("./no-new-object"), + "no-new-require": () => require("./no-new-require"), + "no-new-symbol": () => require("./no-new-symbol"), + "no-new-wrappers": () => require("./no-new-wrappers"), + "no-obj-calls": () => require("./no-obj-calls"), + "no-octal": () => require("./no-octal"), + "no-octal-escape": () => require("./no-octal-escape"), + "no-param-reassign": () => require("./no-param-reassign"), + "no-path-concat": () => require("./no-path-concat"), + "no-plusplus": () => require("./no-plusplus"), + "no-process-env": () => require("./no-process-env"), + "no-process-exit": () => require("./no-process-exit"), + "no-promise-executor-return": () => require("./no-promise-executor-return"), + "no-proto": () => require("./no-proto"), + "no-prototype-builtins": () => require("./no-prototype-builtins"), + "no-redeclare": () => require("./no-redeclare"), + "no-regex-spaces": () => require("./no-regex-spaces"), + "no-restricted-exports": () => require("./no-restricted-exports"), + "no-restricted-globals": () => require("./no-restricted-globals"), + "no-restricted-imports": () => require("./no-restricted-imports"), + "no-restricted-modules": () => require("./no-restricted-modules"), + "no-restricted-properties": () => require("./no-restricted-properties"), + "no-restricted-syntax": () => require("./no-restricted-syntax"), + "no-return-assign": () => require("./no-return-assign"), + "no-return-await": () => require("./no-return-await"), + "no-script-url": () => require("./no-script-url"), + "no-self-assign": () => require("./no-self-assign"), + "no-self-compare": () => require("./no-self-compare"), + "no-sequences": () => require("./no-sequences"), + "no-setter-return": () => require("./no-setter-return"), + "no-shadow": () => require("./no-shadow"), + "no-shadow-restricted-names": () => require("./no-shadow-restricted-names"), + "no-spaced-func": () => require("./no-spaced-func"), + "no-sparse-arrays": () => require("./no-sparse-arrays"), + "no-sync": () => require("./no-sync"), + "no-tabs": () => require("./no-tabs"), + "no-template-curly-in-string": () => require("./no-template-curly-in-string"), + "no-ternary": () => require("./no-ternary"), + "no-this-before-super": () => require("./no-this-before-super"), + "no-throw-literal": () => require("./no-throw-literal"), + "no-trailing-spaces": () => require("./no-trailing-spaces"), + "no-undef": () => require("./no-undef"), + "no-undef-init": () => require("./no-undef-init"), + "no-undefined": () => require("./no-undefined"), + "no-underscore-dangle": () => require("./no-underscore-dangle"), + "no-unexpected-multiline": () => require("./no-unexpected-multiline"), + "no-unmodified-loop-condition": () => require("./no-unmodified-loop-condition"), + "no-unneeded-ternary": () => require("./no-unneeded-ternary"), + "no-unreachable": () => require("./no-unreachable"), + "no-unreachable-loop": () => require("./no-unreachable-loop"), + "no-unsafe-finally": () => require("./no-unsafe-finally"), + "no-unsafe-negation": () => require("./no-unsafe-negation"), + "no-unused-expressions": () => require("./no-unused-expressions"), + "no-unused-labels": () => require("./no-unused-labels"), + "no-unused-vars": () => require("./no-unused-vars"), + "no-use-before-define": () => require("./no-use-before-define"), + "no-useless-backreference": () => require("./no-useless-backreference"), + "no-useless-call": () => require("./no-useless-call"), + "no-useless-catch": () => require("./no-useless-catch"), + "no-useless-computed-key": () => require("./no-useless-computed-key"), + "no-useless-concat": () => require("./no-useless-concat"), + "no-useless-constructor": () => require("./no-useless-constructor"), + "no-useless-escape": () => require("./no-useless-escape"), + "no-useless-rename": () => require("./no-useless-rename"), + "no-useless-return": () => require("./no-useless-return"), + "no-var": () => require("./no-var"), + "no-void": () => require("./no-void"), + "no-warning-comments": () => require("./no-warning-comments"), + "no-whitespace-before-property": () => require("./no-whitespace-before-property"), + "no-with": () => require("./no-with"), + "nonblock-statement-body-position": () => require("./nonblock-statement-body-position"), + "object-curly-newline": () => require("./object-curly-newline"), + "object-curly-spacing": () => require("./object-curly-spacing"), + "object-property-newline": () => require("./object-property-newline"), + "object-shorthand": () => require("./object-shorthand"), + "one-var": () => require("./one-var"), + "one-var-declaration-per-line": () => require("./one-var-declaration-per-line"), + "operator-assignment": () => require("./operator-assignment"), + "operator-linebreak": () => require("./operator-linebreak"), + "padded-blocks": () => require("./padded-blocks"), + "padding-line-between-statements": () => require("./padding-line-between-statements"), + "prefer-arrow-callback": () => require("./prefer-arrow-callback"), + "prefer-const": () => require("./prefer-const"), + "prefer-destructuring": () => require("./prefer-destructuring"), + "prefer-exponentiation-operator": () => require("./prefer-exponentiation-operator"), + "prefer-named-capture-group": () => require("./prefer-named-capture-group"), + "prefer-numeric-literals": () => require("./prefer-numeric-literals"), + "prefer-object-spread": () => require("./prefer-object-spread"), + "prefer-promise-reject-errors": () => require("./prefer-promise-reject-errors"), + "prefer-reflect": () => require("./prefer-reflect"), + "prefer-regex-literals": () => require("./prefer-regex-literals"), + "prefer-rest-params": () => require("./prefer-rest-params"), + "prefer-spread": () => require("./prefer-spread"), + "prefer-template": () => require("./prefer-template"), + "quote-props": () => require("./quote-props"), + quotes: () => require("./quotes"), + radix: () => require("./radix"), + "require-atomic-updates": () => require("./require-atomic-updates"), + "require-await": () => require("./require-await"), + "require-jsdoc": () => require("./require-jsdoc"), + "require-unicode-regexp": () => require("./require-unicode-regexp"), + "require-yield": () => require("./require-yield"), + "rest-spread-spacing": () => require("./rest-spread-spacing"), + semi: () => require("./semi"), + "semi-spacing": () => require("./semi-spacing"), + "semi-style": () => require("./semi-style"), + "sort-imports": () => require("./sort-imports"), + "sort-keys": () => require("./sort-keys"), + "sort-vars": () => require("./sort-vars"), + "space-before-blocks": () => require("./space-before-blocks"), + "space-before-function-paren": () => require("./space-before-function-paren"), + "space-in-parens": () => require("./space-in-parens"), + "space-infix-ops": () => require("./space-infix-ops"), + "space-unary-ops": () => require("./space-unary-ops"), + "spaced-comment": () => require("./spaced-comment"), + strict: () => require("./strict"), + "switch-colon-spacing": () => require("./switch-colon-spacing"), + "symbol-description": () => require("./symbol-description"), + "template-curly-spacing": () => require("./template-curly-spacing"), + "template-tag-spacing": () => require("./template-tag-spacing"), + "unicode-bom": () => require("./unicode-bom"), + "use-isnan": () => require("./use-isnan"), + "valid-jsdoc": () => require("./valid-jsdoc"), + "valid-typeof": () => require("./valid-typeof"), + "vars-on-top": () => require("./vars-on-top"), + "wrap-iife": () => require("./wrap-iife"), + "wrap-regex": () => require("./wrap-regex"), + "yield-star-spacing": () => require("./yield-star-spacing"), + yoda: () => require("./yoda") +})); diff --git a/node_modules/eslint/lib/rules/init-declarations.js b/node_modules/eslint/lib/rules/init-declarations.js new file mode 100644 index 000000000..6cfdf92c9 --- /dev/null +++ b/node_modules/eslint/lib/rules/init-declarations.js @@ -0,0 +1,139 @@ +/** + * @fileoverview A rule to control the style of variable initializations. + * @author Colin Ihrig + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a for loop. + * @param {ASTNode} block A node to check. + * @returns {boolean} `true` when the node is a for loop. + */ +function isForLoop(block) { + return block.type === "ForInStatement" || + block.type === "ForOfStatement" || + block.type === "ForStatement"; +} + +/** + * Checks whether or not a given declarator node has its initializer. + * @param {ASTNode} node A declarator node to check. + * @returns {boolean} `true` when the node has its initializer. + */ +function isInitialized(node) { + const declaration = node.parent; + const block = declaration.parent; + + if (isForLoop(block)) { + if (block.type === "ForStatement") { + return block.init === declaration; + } + return block.left === declaration; + } + return Boolean(node.init); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require or disallow initialization in variable declarations", + category: "Variables", + recommended: false, + url: "https://eslint.org/docs/rules/init-declarations" + }, + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["always"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["never"] + }, + { + type: "object", + properties: { + ignoreForLoopInit: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + messages: { + initialized: "Variable '{{idName}}' should be initialized on declaration.", + notInitialized: "Variable '{{idName}}' should not be initialized on declaration." + } + }, + + create(context) { + + const MODE_ALWAYS = "always", + MODE_NEVER = "never"; + + const mode = context.options[0] || MODE_ALWAYS; + const params = context.options[1] || {}; + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + "VariableDeclaration:exit"(node) { + + const kind = node.kind, + declarations = node.declarations; + + for (let i = 0; i < declarations.length; ++i) { + const declaration = declarations[i], + id = declaration.id, + initialized = isInitialized(declaration), + isIgnoredForLoop = params.ignoreForLoopInit && isForLoop(node.parent); + let messageId = ""; + + if (mode === MODE_ALWAYS && !initialized) { + messageId = "initialized"; + } else if (mode === MODE_NEVER && kind !== "const" && initialized && !isIgnoredForLoop) { + messageId = "notInitialized"; + } + + if (id.type === "Identifier" && messageId) { + context.report({ + node: declaration, + messageId, + data: { + idName: id.name + } + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/jsx-quotes.js b/node_modules/eslint/lib/rules/jsx-quotes.js new file mode 100644 index 000000000..3b282df2f --- /dev/null +++ b/node_modules/eslint/lib/rules/jsx-quotes.js @@ -0,0 +1,95 @@ +/** + * @fileoverview A rule to ensure consistent quotes used in jsx syntax. + * @author Mathias Schreck + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +const QUOTE_SETTINGS = { + "prefer-double": { + quote: "\"", + description: "singlequote", + convert(str) { + return str.replace(/'/gu, "\""); + } + }, + "prefer-single": { + quote: "'", + description: "doublequote", + convert(str) { + return str.replace(/"/gu, "'"); + } + } +}; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce the consistent use of either double or single quotes in JSX attributes", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/jsx-quotes" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["prefer-single", "prefer-double"] + } + ], + messages: { + unexpected: "Unexpected usage of {{description}}." + } + }, + + create(context) { + const quoteOption = context.options[0] || "prefer-double", + setting = QUOTE_SETTINGS[quoteOption]; + + /** + * Checks if the given string literal node uses the expected quotes + * @param {ASTNode} node A string literal node. + * @returns {boolean} Whether or not the string literal used the expected quotes. + * @public + */ + function usesExpectedQuotes(node) { + return node.value.indexOf(setting.quote) !== -1 || astUtils.isSurroundedBy(node.raw, setting.quote); + } + + return { + JSXAttribute(node) { + const attributeValue = node.value; + + if (attributeValue && astUtils.isStringLiteral(attributeValue) && !usesExpectedQuotes(attributeValue)) { + context.report({ + node: attributeValue, + messageId: "unexpected", + data: { + description: setting.description + }, + fix(fixer) { + return fixer.replaceText(attributeValue, setting.convert(attributeValue.raw)); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/key-spacing.js b/node_modules/eslint/lib/rules/key-spacing.js new file mode 100644 index 000000000..fc885a117 --- /dev/null +++ b/node_modules/eslint/lib/rules/key-spacing.js @@ -0,0 +1,674 @@ +/** + * @fileoverview Rule to specify spacing of object literal keys and values + * @author Brandon Mills + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether a string contains a line terminator as defined in + * http://www.ecma-international.org/ecma-262/5.1/#sec-7.3 + * @param {string} str String to test. + * @returns {boolean} True if str contains a line terminator. + */ +function containsLineTerminator(str) { + return astUtils.LINEBREAK_MATCHER.test(str); +} + +/** + * Gets the last element of an array. + * @param {Array} arr An array. + * @returns {any} Last element of arr. + */ +function last(arr) { + return arr[arr.length - 1]; +} + +/** + * Checks whether a node is contained on a single line. + * @param {ASTNode} node AST Node being evaluated. + * @returns {boolean} True if the node is a single line. + */ +function isSingleLine(node) { + return (node.loc.end.line === node.loc.start.line); +} + +/** + * Checks whether the properties on a single line. + * @param {ASTNode[]} properties List of Property AST nodes. + * @returns {boolean} True if all properties is on a single line. + */ +function isSingleLineProperties(properties) { + const [firstProp] = properties, + lastProp = last(properties); + + return firstProp.loc.start.line === lastProp.loc.end.line; +} + +/** + * Initializes a single option property from the configuration with defaults for undefined values + * @param {Object} toOptions Object to be initialized + * @param {Object} fromOptions Object to be initialized from + * @returns {Object} The object with correctly initialized options and values + */ +function initOptionProperty(toOptions, fromOptions) { + toOptions.mode = fromOptions.mode || "strict"; + + // Set value of beforeColon + if (typeof fromOptions.beforeColon !== "undefined") { + toOptions.beforeColon = +fromOptions.beforeColon; + } else { + toOptions.beforeColon = 0; + } + + // Set value of afterColon + if (typeof fromOptions.afterColon !== "undefined") { + toOptions.afterColon = +fromOptions.afterColon; + } else { + toOptions.afterColon = 1; + } + + // Set align if exists + if (typeof fromOptions.align !== "undefined") { + if (typeof fromOptions.align === "object") { + toOptions.align = fromOptions.align; + } else { // "string" + toOptions.align = { + on: fromOptions.align, + mode: toOptions.mode, + beforeColon: toOptions.beforeColon, + afterColon: toOptions.afterColon + }; + } + } + + return toOptions; +} + +/** + * Initializes all the option values (singleLine, multiLine and align) from the configuration with defaults for undefined values + * @param {Object} toOptions Object to be initialized + * @param {Object} fromOptions Object to be initialized from + * @returns {Object} The object with correctly initialized options and values + */ +function initOptions(toOptions, fromOptions) { + if (typeof fromOptions.align === "object") { + + // Initialize the alignment configuration + toOptions.align = initOptionProperty({}, fromOptions.align); + toOptions.align.on = fromOptions.align.on || "colon"; + toOptions.align.mode = fromOptions.align.mode || "strict"; + + toOptions.multiLine = initOptionProperty({}, (fromOptions.multiLine || fromOptions)); + toOptions.singleLine = initOptionProperty({}, (fromOptions.singleLine || fromOptions)); + + } else { // string or undefined + toOptions.multiLine = initOptionProperty({}, (fromOptions.multiLine || fromOptions)); + toOptions.singleLine = initOptionProperty({}, (fromOptions.singleLine || fromOptions)); + + // If alignment options are defined in multiLine, pull them out into the general align configuration + if (toOptions.multiLine.align) { + toOptions.align = { + on: toOptions.multiLine.align.on, + mode: toOptions.multiLine.align.mode || toOptions.multiLine.mode, + beforeColon: toOptions.multiLine.align.beforeColon, + afterColon: toOptions.multiLine.align.afterColon + }; + } + } + + return toOptions; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing between keys and values in object literal properties", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/key-spacing" + }, + + fixable: "whitespace", + + schema: [{ + anyOf: [ + { + type: "object", + properties: { + align: { + anyOf: [ + { + enum: ["colon", "value"] + }, + { + type: "object", + properties: { + mode: { + enum: ["strict", "minimum"] + }, + on: { + enum: ["colon", "value"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + }, + mode: { + enum: ["strict", "minimum"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + }, + { + type: "object", + properties: { + singleLine: { + type: "object", + properties: { + mode: { + enum: ["strict", "minimum"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + }, + multiLine: { + type: "object", + properties: { + align: { + anyOf: [ + { + enum: ["colon", "value"] + }, + { + type: "object", + properties: { + mode: { + enum: ["strict", "minimum"] + }, + on: { + enum: ["colon", "value"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + }, + mode: { + enum: ["strict", "minimum"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + } + }, + additionalProperties: false + }, + { + type: "object", + properties: { + singleLine: { + type: "object", + properties: { + mode: { + enum: ["strict", "minimum"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + }, + multiLine: { + type: "object", + properties: { + mode: { + enum: ["strict", "minimum"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + }, + align: { + type: "object", + properties: { + mode: { + enum: ["strict", "minimum"] + }, + on: { + enum: ["colon", "value"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + } + }, + additionalProperties: false + } + ] + }], + messages: { + extraKey: "Extra space after {{computed}}key '{{key}}'.", + extraValue: "Extra space before value for {{computed}}key '{{key}}'.", + missingKey: "Missing space after {{computed}}key '{{key}}'.", + missingValue: "Missing space before value for {{computed}}key '{{key}}'." + } + }, + + create(context) { + + /** + * OPTIONS + * "key-spacing": [2, { + * beforeColon: false, + * afterColon: true, + * align: "colon" // Optional, or "value" + * } + */ + const options = context.options[0] || {}, + ruleOptions = initOptions({}, options), + multiLineOptions = ruleOptions.multiLine, + singleLineOptions = ruleOptions.singleLine, + alignmentOptions = ruleOptions.align || null; + + const sourceCode = context.getSourceCode(); + + /** + * Checks whether a property is a member of the property group it follows. + * @param {ASTNode} lastMember The last Property known to be in the group. + * @param {ASTNode} candidate The next Property that might be in the group. + * @returns {boolean} True if the candidate property is part of the group. + */ + function continuesPropertyGroup(lastMember, candidate) { + const groupEndLine = lastMember.loc.start.line, + candidateStartLine = candidate.loc.start.line; + + if (candidateStartLine - groupEndLine <= 1) { + return true; + } + + /* + * Check that the first comment is adjacent to the end of the group, the + * last comment is adjacent to the candidate property, and that successive + * comments are adjacent to each other. + */ + const leadingComments = sourceCode.getCommentsBefore(candidate); + + if ( + leadingComments.length && + leadingComments[0].loc.start.line - groupEndLine <= 1 && + candidateStartLine - last(leadingComments).loc.end.line <= 1 + ) { + for (let i = 1; i < leadingComments.length; i++) { + if (leadingComments[i].loc.start.line - leadingComments[i - 1].loc.end.line > 1) { + return false; + } + } + return true; + } + + return false; + } + + /** + * Determines if the given property is key-value property. + * @param {ASTNode} property Property node to check. + * @returns {boolean} Whether the property is a key-value property. + */ + function isKeyValueProperty(property) { + return !( + (property.method || + property.shorthand || + property.kind !== "init" || property.type !== "Property") // Could be "ExperimentalSpreadProperty" or "SpreadElement" + ); + } + + /** + * Starting from the given a node (a property.key node here) looks forward + * until it finds the last token before a colon punctuator and returns it. + * @param {ASTNode} node The node to start looking from. + * @returns {ASTNode} The last token before a colon punctuator. + */ + function getLastTokenBeforeColon(node) { + const colonToken = sourceCode.getTokenAfter(node, astUtils.isColonToken); + + return sourceCode.getTokenBefore(colonToken); + } + + /** + * Starting from the given a node (a property.key node here) looks forward + * until it finds the colon punctuator and returns it. + * @param {ASTNode} node The node to start looking from. + * @returns {ASTNode} The colon punctuator. + */ + function getNextColon(node) { + return sourceCode.getTokenAfter(node, astUtils.isColonToken); + } + + /** + * Gets an object literal property's key as the identifier name or string value. + * @param {ASTNode} property Property node whose key to retrieve. + * @returns {string} The property's key. + */ + function getKey(property) { + const key = property.key; + + if (property.computed) { + return sourceCode.getText().slice(key.range[0], key.range[1]); + } + return astUtils.getStaticPropertyName(property); + } + + /** + * Reports an appropriately-formatted error if spacing is incorrect on one + * side of the colon. + * @param {ASTNode} property Key-value pair in an object literal. + * @param {string} side Side being verified - either "key" or "value". + * @param {string} whitespace Actual whitespace string. + * @param {int} expected Expected whitespace length. + * @param {string} mode Value of the mode as "strict" or "minimum" + * @returns {void} + */ + function report(property, side, whitespace, expected, mode) { + const diff = whitespace.length - expected, + nextColon = getNextColon(property.key), + tokenBeforeColon = sourceCode.getTokenBefore(nextColon, { includeComments: true }), + tokenAfterColon = sourceCode.getTokenAfter(nextColon, { includeComments: true }), + isKeySide = side === "key", + isExtra = diff > 0, + diffAbs = Math.abs(diff), + spaces = Array(diffAbs + 1).join(" "); + + const locStart = isKeySide ? tokenBeforeColon.loc.end : nextColon.loc.start; + const locEnd = isKeySide ? nextColon.loc.start : tokenAfterColon.loc.start; + const missingLoc = isKeySide ? tokenBeforeColon.loc : tokenAfterColon.loc; + const loc = isExtra ? { start: locStart, end: locEnd } : missingLoc; + + if (( + diff && mode === "strict" || + diff < 0 && mode === "minimum" || + diff > 0 && !expected && mode === "minimum") && + !(expected && containsLineTerminator(whitespace)) + ) { + let fix; + + if (isExtra) { + let range; + + // Remove whitespace + if (isKeySide) { + range = [tokenBeforeColon.range[1], tokenBeforeColon.range[1] + diffAbs]; + } else { + range = [tokenAfterColon.range[0] - diffAbs, tokenAfterColon.range[0]]; + } + fix = function(fixer) { + return fixer.removeRange(range); + }; + } else { + + // Add whitespace + if (isKeySide) { + fix = function(fixer) { + return fixer.insertTextAfter(tokenBeforeColon, spaces); + }; + } else { + fix = function(fixer) { + return fixer.insertTextBefore(tokenAfterColon, spaces); + }; + } + } + + let messageId = ""; + + if (isExtra) { + messageId = side === "key" ? "extraKey" : "extraValue"; + } else { + messageId = side === "key" ? "missingKey" : "missingValue"; + } + + context.report({ + node: property[side], + loc, + messageId, + data: { + computed: property.computed ? "computed " : "", + key: getKey(property) + }, + fix + }); + } + } + + /** + * Gets the number of characters in a key, including quotes around string + * keys and braces around computed property keys. + * @param {ASTNode} property Property of on object literal. + * @returns {int} Width of the key. + */ + function getKeyWidth(property) { + const startToken = sourceCode.getFirstToken(property); + const endToken = getLastTokenBeforeColon(property.key); + + return endToken.range[1] - startToken.range[0]; + } + + /** + * Gets the whitespace around the colon in an object literal property. + * @param {ASTNode} property Property node from an object literal. + * @returns {Object} Whitespace before and after the property's colon. + */ + function getPropertyWhitespace(property) { + const whitespace = /(\s*):(\s*)/u.exec(sourceCode.getText().slice( + property.key.range[1], property.value.range[0] + )); + + if (whitespace) { + return { + beforeColon: whitespace[1], + afterColon: whitespace[2] + }; + } + return null; + } + + /** + * Creates groups of properties. + * @param {ASTNode} node ObjectExpression node being evaluated. + * @returns {Array.} Groups of property AST node lists. + */ + function createGroups(node) { + if (node.properties.length === 1) { + return [node.properties]; + } + + return node.properties.reduce((groups, property) => { + const currentGroup = last(groups), + prev = last(currentGroup); + + if (!prev || continuesPropertyGroup(prev, property)) { + currentGroup.push(property); + } else { + groups.push([property]); + } + + return groups; + }, [ + [] + ]); + } + + /** + * Verifies correct vertical alignment of a group of properties. + * @param {ASTNode[]} properties List of Property AST nodes. + * @returns {void} + */ + function verifyGroupAlignment(properties) { + const length = properties.length, + widths = properties.map(getKeyWidth), // Width of keys, including quotes + align = alignmentOptions.on; // "value" or "colon" + let targetWidth = Math.max(...widths), + beforeColon, afterColon, mode; + + if (alignmentOptions && length > 1) { // When aligning values within a group, use the alignment configuration. + beforeColon = alignmentOptions.beforeColon; + afterColon = alignmentOptions.afterColon; + mode = alignmentOptions.mode; + } else { + beforeColon = multiLineOptions.beforeColon; + afterColon = multiLineOptions.afterColon; + mode = alignmentOptions.mode; + } + + // Conditionally include one space before or after colon + targetWidth += (align === "colon" ? beforeColon : afterColon); + + for (let i = 0; i < length; i++) { + const property = properties[i]; + const whitespace = getPropertyWhitespace(property); + + if (whitespace) { // Object literal getters/setters lack a colon + const width = widths[i]; + + if (align === "value") { + report(property, "key", whitespace.beforeColon, beforeColon, mode); + report(property, "value", whitespace.afterColon, targetWidth - width, mode); + } else { // align = "colon" + report(property, "key", whitespace.beforeColon, targetWidth - width, mode); + report(property, "value", whitespace.afterColon, afterColon, mode); + } + } + } + } + + /** + * Verifies spacing of property conforms to specified options. + * @param {ASTNode} node Property node being evaluated. + * @param {Object} lineOptions Configured singleLine or multiLine options + * @returns {void} + */ + function verifySpacing(node, lineOptions) { + const actual = getPropertyWhitespace(node); + + if (actual) { // Object literal getters/setters lack colons + report(node, "key", actual.beforeColon, lineOptions.beforeColon, lineOptions.mode); + report(node, "value", actual.afterColon, lineOptions.afterColon, lineOptions.mode); + } + } + + /** + * Verifies spacing of each property in a list. + * @param {ASTNode[]} properties List of Property AST nodes. + * @param {Object} lineOptions Configured singleLine or multiLine options + * @returns {void} + */ + function verifyListSpacing(properties, lineOptions) { + const length = properties.length; + + for (let i = 0; i < length; i++) { + verifySpacing(properties[i], lineOptions); + } + } + + /** + * Verifies vertical alignment, taking into account groups of properties. + * @param {ASTNode} node ObjectExpression node being evaluated. + * @returns {void} + */ + function verifyAlignment(node) { + createGroups(node).forEach(group => { + const properties = group.filter(isKeyValueProperty); + + if (properties.length > 0 && isSingleLineProperties(properties)) { + verifyListSpacing(properties, multiLineOptions); + } else { + verifyGroupAlignment(properties); + } + }); + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + if (alignmentOptions) { // Verify vertical alignment + + return { + ObjectExpression(node) { + if (isSingleLine(node)) { + verifyListSpacing(node.properties.filter(isKeyValueProperty), singleLineOptions); + } else { + verifyAlignment(node); + } + } + }; + + } + + // Obey beforeColon and afterColon in each property as configured + return { + Property(node) { + verifySpacing(node, isSingleLine(node.parent) ? singleLineOptions : multiLineOptions); + } + }; + + + } +}; diff --git a/node_modules/eslint/lib/rules/keyword-spacing.js b/node_modules/eslint/lib/rules/keyword-spacing.js new file mode 100644 index 000000000..913cf4682 --- /dev/null +++ b/node_modules/eslint/lib/rules/keyword-spacing.js @@ -0,0 +1,573 @@ +/** + * @fileoverview Rule to enforce spacing before and after keywords. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"), + keywords = require("./utils/keywords"); + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +const PREV_TOKEN = /^[)\]}>]$/u; +const NEXT_TOKEN = /^(?:[([{<~!]|\+\+?|--?)$/u; +const PREV_TOKEN_M = /^[)\]}>*]$/u; +const NEXT_TOKEN_M = /^[{*]$/u; +const TEMPLATE_OPEN_PAREN = /\$\{$/u; +const TEMPLATE_CLOSE_PAREN = /^\}/u; +const CHECK_TYPE = /^(?:JSXElement|RegularExpression|String|Template)$/u; +const KEYS = keywords.concat(["as", "async", "await", "from", "get", "let", "of", "set", "yield"]); + +// check duplications. +(function() { + KEYS.sort(); + for (let i = 1; i < KEYS.length; ++i) { + if (KEYS[i] === KEYS[i - 1]) { + throw new Error(`Duplication was found in the keyword list: ${KEYS[i]}`); + } + } +}()); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given token is a "Template" token ends with "${". + * @param {Token} token A token to check. + * @returns {boolean} `true` if the token is a "Template" token ends with "${". + */ +function isOpenParenOfTemplate(token) { + return token.type === "Template" && TEMPLATE_OPEN_PAREN.test(token.value); +} + +/** + * Checks whether or not a given token is a "Template" token starts with "}". + * @param {Token} token A token to check. + * @returns {boolean} `true` if the token is a "Template" token starts with "}". + */ +function isCloseParenOfTemplate(token) { + return token.type === "Template" && TEMPLATE_CLOSE_PAREN.test(token.value); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing before and after keywords", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/keyword-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + before: { type: "boolean", default: true }, + after: { type: "boolean", default: true }, + overrides: { + type: "object", + properties: KEYS.reduce((retv, key) => { + retv[key] = { + type: "object", + properties: { + before: { type: "boolean" }, + after: { type: "boolean" } + }, + additionalProperties: false + }; + return retv; + }, {}), + additionalProperties: false + } + }, + additionalProperties: false + } + ], + messages: { + expectedBefore: "Expected space(s) before \"{{value}}\".", + expectedAfter: "Expected space(s) after \"{{value}}\".", + unexpectedBefore: "Unexpected space(s) before \"{{value}}\".", + unexpectedAfter: "Unexpected space(s) after \"{{value}}\"." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Reports a given token if there are not space(s) before the token. + * @param {Token} token A token to report. + * @param {RegExp} pattern A pattern of the previous token to check. + * @returns {void} + */ + function expectSpaceBefore(token, pattern) { + const prevToken = sourceCode.getTokenBefore(token); + + if (prevToken && + (CHECK_TYPE.test(prevToken.type) || pattern.test(prevToken.value)) && + !isOpenParenOfTemplate(prevToken) && + astUtils.isTokenOnSameLine(prevToken, token) && + !sourceCode.isSpaceBetweenTokens(prevToken, token) + ) { + context.report({ + loc: token.loc, + messageId: "expectedBefore", + data: token, + fix(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + } + + /** + * Reports a given token if there are space(s) before the token. + * @param {Token} token A token to report. + * @param {RegExp} pattern A pattern of the previous token to check. + * @returns {void} + */ + function unexpectSpaceBefore(token, pattern) { + const prevToken = sourceCode.getTokenBefore(token); + + if (prevToken && + (CHECK_TYPE.test(prevToken.type) || pattern.test(prevToken.value)) && + !isOpenParenOfTemplate(prevToken) && + astUtils.isTokenOnSameLine(prevToken, token) && + sourceCode.isSpaceBetweenTokens(prevToken, token) + ) { + context.report({ + loc: { start: prevToken.loc.end, end: token.loc.start }, + messageId: "unexpectedBefore", + data: token, + fix(fixer) { + return fixer.removeRange([prevToken.range[1], token.range[0]]); + } + }); + } + } + + /** + * Reports a given token if there are not space(s) after the token. + * @param {Token} token A token to report. + * @param {RegExp} pattern A pattern of the next token to check. + * @returns {void} + */ + function expectSpaceAfter(token, pattern) { + const nextToken = sourceCode.getTokenAfter(token); + + if (nextToken && + (CHECK_TYPE.test(nextToken.type) || pattern.test(nextToken.value)) && + !isCloseParenOfTemplate(nextToken) && + astUtils.isTokenOnSameLine(token, nextToken) && + !sourceCode.isSpaceBetweenTokens(token, nextToken) + ) { + context.report({ + loc: token.loc, + messageId: "expectedAfter", + data: token, + fix(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + } + + /** + * Reports a given token if there are space(s) after the token. + * @param {Token} token A token to report. + * @param {RegExp} pattern A pattern of the next token to check. + * @returns {void} + */ + function unexpectSpaceAfter(token, pattern) { + const nextToken = sourceCode.getTokenAfter(token); + + if (nextToken && + (CHECK_TYPE.test(nextToken.type) || pattern.test(nextToken.value)) && + !isCloseParenOfTemplate(nextToken) && + astUtils.isTokenOnSameLine(token, nextToken) && + sourceCode.isSpaceBetweenTokens(token, nextToken) + ) { + + context.report({ + loc: { start: token.loc.end, end: nextToken.loc.start }, + messageId: "unexpectedAfter", + data: token, + fix(fixer) { + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); + } + } + + /** + * Parses the option object and determines check methods for each keyword. + * @param {Object|undefined} options The option object to parse. + * @returns {Object} - Normalized option object. + * Keys are keywords (there are for every keyword). + * Values are instances of `{"before": function, "after": function}`. + */ + function parseOptions(options = {}) { + const before = options.before !== false; + const after = options.after !== false; + const defaultValue = { + before: before ? expectSpaceBefore : unexpectSpaceBefore, + after: after ? expectSpaceAfter : unexpectSpaceAfter + }; + const overrides = (options && options.overrides) || {}; + const retv = Object.create(null); + + for (let i = 0; i < KEYS.length; ++i) { + const key = KEYS[i]; + const override = overrides[key]; + + if (override) { + const thisBefore = ("before" in override) ? override.before : before; + const thisAfter = ("after" in override) ? override.after : after; + + retv[key] = { + before: thisBefore ? expectSpaceBefore : unexpectSpaceBefore, + after: thisAfter ? expectSpaceAfter : unexpectSpaceAfter + }; + } else { + retv[key] = defaultValue; + } + } + + return retv; + } + + const checkMethodMap = parseOptions(context.options[0]); + + /** + * Reports a given token if usage of spacing followed by the token is + * invalid. + * @param {Token} token A token to report. + * @param {RegExp} [pattern] Optional. A pattern of the previous + * token to check. + * @returns {void} + */ + function checkSpacingBefore(token, pattern) { + checkMethodMap[token.value].before(token, pattern || PREV_TOKEN); + } + + /** + * Reports a given token if usage of spacing preceded by the token is + * invalid. + * @param {Token} token A token to report. + * @param {RegExp} [pattern] Optional. A pattern of the next + * token to check. + * @returns {void} + */ + function checkSpacingAfter(token, pattern) { + checkMethodMap[token.value].after(token, pattern || NEXT_TOKEN); + } + + /** + * Reports a given token if usage of spacing around the token is invalid. + * @param {Token} token A token to report. + * @returns {void} + */ + function checkSpacingAround(token) { + checkSpacingBefore(token); + checkSpacingAfter(token); + } + + /** + * Reports the first token of a given node if the first token is a keyword + * and usage of spacing around the token is invalid. + * @param {ASTNode|null} node A node to report. + * @returns {void} + */ + function checkSpacingAroundFirstToken(node) { + const firstToken = node && sourceCode.getFirstToken(node); + + if (firstToken && firstToken.type === "Keyword") { + checkSpacingAround(firstToken); + } + } + + /** + * Reports the first token of a given node if the first token is a keyword + * and usage of spacing followed by the token is invalid. + * + * This is used for unary operators (e.g. `typeof`), `function`, and `super`. + * Other rules are handling usage of spacing preceded by those keywords. + * @param {ASTNode|null} node A node to report. + * @returns {void} + */ + function checkSpacingBeforeFirstToken(node) { + const firstToken = node && sourceCode.getFirstToken(node); + + if (firstToken && firstToken.type === "Keyword") { + checkSpacingBefore(firstToken); + } + } + + /** + * Reports the previous token of a given node if the token is a keyword and + * usage of spacing around the token is invalid. + * @param {ASTNode|null} node A node to report. + * @returns {void} + */ + function checkSpacingAroundTokenBefore(node) { + if (node) { + const token = sourceCode.getTokenBefore(node, astUtils.isKeywordToken); + + checkSpacingAround(token); + } + } + + /** + * Reports `async` or `function` keywords of a given node if usage of + * spacing around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForFunction(node) { + const firstToken = node && sourceCode.getFirstToken(node); + + if (firstToken && + ((firstToken.type === "Keyword" && firstToken.value === "function") || + firstToken.value === "async") + ) { + checkSpacingBefore(firstToken); + } + } + + /** + * Reports `class` and `extends` keywords of a given node if usage of + * spacing around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForClass(node) { + checkSpacingAroundFirstToken(node); + checkSpacingAroundTokenBefore(node.superClass); + } + + /** + * Reports `if` and `else` keywords of a given node if usage of spacing + * around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForIfStatement(node) { + checkSpacingAroundFirstToken(node); + checkSpacingAroundTokenBefore(node.alternate); + } + + /** + * Reports `try`, `catch`, and `finally` keywords of a given node if usage + * of spacing around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForTryStatement(node) { + checkSpacingAroundFirstToken(node); + checkSpacingAroundFirstToken(node.handler); + checkSpacingAroundTokenBefore(node.finalizer); + } + + /** + * Reports `do` and `while` keywords of a given node if usage of spacing + * around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForDoWhileStatement(node) { + checkSpacingAroundFirstToken(node); + checkSpacingAroundTokenBefore(node.test); + } + + /** + * Reports `for` and `in` keywords of a given node if usage of spacing + * around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForForInStatement(node) { + checkSpacingAroundFirstToken(node); + checkSpacingAroundTokenBefore(node.right); + } + + /** + * Reports `for` and `of` keywords of a given node if usage of spacing + * around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForForOfStatement(node) { + if (node.await) { + checkSpacingBefore(sourceCode.getFirstToken(node, 0)); + checkSpacingAfter(sourceCode.getFirstToken(node, 1)); + } else { + checkSpacingAroundFirstToken(node); + } + checkSpacingAround(sourceCode.getTokenBefore(node.right, astUtils.isNotOpeningParenToken)); + } + + /** + * Reports `import`, `export`, `as`, and `from` keywords of a given node if + * usage of spacing around those keywords is invalid. + * + * This rule handles the `*` token in module declarations. + * + * import*as A from "./a"; /*error Expected space(s) after "import". + * error Expected space(s) before "as". + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForModuleDeclaration(node) { + const firstToken = sourceCode.getFirstToken(node); + + checkSpacingBefore(firstToken, PREV_TOKEN_M); + checkSpacingAfter(firstToken, NEXT_TOKEN_M); + + if (node.type === "ExportDefaultDeclaration") { + checkSpacingAround(sourceCode.getTokenAfter(firstToken)); + } + + if (node.type === "ExportAllDeclaration" && node.exported) { + const asToken = sourceCode.getTokenBefore(node.exported); + + checkSpacingBefore(asToken, PREV_TOKEN_M); + } + + if (node.source) { + const fromToken = sourceCode.getTokenBefore(node.source); + + checkSpacingBefore(fromToken, PREV_TOKEN_M); + checkSpacingAfter(fromToken, NEXT_TOKEN_M); + } + } + + /** + * Reports `as` keyword of a given node if usage of spacing around this + * keyword is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForImportNamespaceSpecifier(node) { + const asToken = sourceCode.getFirstToken(node, 1); + + checkSpacingBefore(asToken, PREV_TOKEN_M); + } + + /** + * Reports `static`, `get`, and `set` keywords of a given node if usage of + * spacing around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForProperty(node) { + if (node.static) { + checkSpacingAroundFirstToken(node); + } + if (node.kind === "get" || + node.kind === "set" || + ( + (node.method || node.type === "MethodDefinition") && + node.value.async + ) + ) { + const token = sourceCode.getTokenBefore( + node.key, + tok => { + switch (tok.value) { + case "get": + case "set": + case "async": + return true; + default: + return false; + } + } + ); + + if (!token) { + throw new Error("Failed to find token get, set, or async beside method name"); + } + + + checkSpacingAround(token); + } + } + + /** + * Reports `await` keyword of a given node if usage of spacing before + * this keyword is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForAwaitExpression(node) { + checkSpacingBefore(sourceCode.getFirstToken(node)); + } + + return { + + // Statements + DebuggerStatement: checkSpacingAroundFirstToken, + WithStatement: checkSpacingAroundFirstToken, + + // Statements - Control flow + BreakStatement: checkSpacingAroundFirstToken, + ContinueStatement: checkSpacingAroundFirstToken, + ReturnStatement: checkSpacingAroundFirstToken, + ThrowStatement: checkSpacingAroundFirstToken, + TryStatement: checkSpacingForTryStatement, + + // Statements - Choice + IfStatement: checkSpacingForIfStatement, + SwitchStatement: checkSpacingAroundFirstToken, + SwitchCase: checkSpacingAroundFirstToken, + + // Statements - Loops + DoWhileStatement: checkSpacingForDoWhileStatement, + ForInStatement: checkSpacingForForInStatement, + ForOfStatement: checkSpacingForForOfStatement, + ForStatement: checkSpacingAroundFirstToken, + WhileStatement: checkSpacingAroundFirstToken, + + // Statements - Declarations + ClassDeclaration: checkSpacingForClass, + ExportNamedDeclaration: checkSpacingForModuleDeclaration, + ExportDefaultDeclaration: checkSpacingForModuleDeclaration, + ExportAllDeclaration: checkSpacingForModuleDeclaration, + FunctionDeclaration: checkSpacingForFunction, + ImportDeclaration: checkSpacingForModuleDeclaration, + VariableDeclaration: checkSpacingAroundFirstToken, + + // Expressions + ArrowFunctionExpression: checkSpacingForFunction, + AwaitExpression: checkSpacingForAwaitExpression, + ClassExpression: checkSpacingForClass, + FunctionExpression: checkSpacingForFunction, + NewExpression: checkSpacingBeforeFirstToken, + Super: checkSpacingBeforeFirstToken, + ThisExpression: checkSpacingBeforeFirstToken, + UnaryExpression: checkSpacingBeforeFirstToken, + YieldExpression: checkSpacingBeforeFirstToken, + + // Others + ImportNamespaceSpecifier: checkSpacingForImportNamespaceSpecifier, + MethodDefinition: checkSpacingForProperty, + Property: checkSpacingForProperty + }; + } +}; diff --git a/node_modules/eslint/lib/rules/line-comment-position.js b/node_modules/eslint/lib/rules/line-comment-position.js new file mode 100644 index 000000000..77ee147cb --- /dev/null +++ b/node_modules/eslint/lib/rules/line-comment-position.js @@ -0,0 +1,122 @@ +/** + * @fileoverview Rule to enforce the position of line comments + * @author Alberto Rodríguez + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce position of line comments", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/line-comment-position" + }, + + schema: [ + { + oneOf: [ + { + enum: ["above", "beside"] + }, + { + type: "object", + properties: { + position: { + enum: ["above", "beside"] + }, + ignorePattern: { + type: "string" + }, + applyDefaultPatterns: { + type: "boolean" + }, + applyDefaultIgnorePatterns: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + } + ], + messages: { + above: "Expected comment to be above code.", + beside: "Expected comment to be beside code." + } + }, + + create(context) { + const options = context.options[0]; + + let above, + ignorePattern, + applyDefaultIgnorePatterns = true; + + if (!options || typeof options === "string") { + above = !options || options === "above"; + + } else { + above = !options.position || options.position === "above"; + ignorePattern = options.ignorePattern; + + if (Object.prototype.hasOwnProperty.call(options, "applyDefaultIgnorePatterns")) { + applyDefaultIgnorePatterns = options.applyDefaultIgnorePatterns; + } else { + applyDefaultIgnorePatterns = options.applyDefaultPatterns !== false; + } + } + + const defaultIgnoreRegExp = astUtils.COMMENTS_IGNORE_PATTERN; + const fallThroughRegExp = /^\s*falls?\s?through/u; + const customIgnoreRegExp = new RegExp(ignorePattern, "u"); + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program() { + const comments = sourceCode.getAllComments(); + + comments.filter(token => token.type === "Line").forEach(node => { + if (applyDefaultIgnorePatterns && (defaultIgnoreRegExp.test(node.value) || fallThroughRegExp.test(node.value))) { + return; + } + + if (ignorePattern && customIgnoreRegExp.test(node.value)) { + return; + } + + const previous = sourceCode.getTokenBefore(node, { includeComments: true }); + const isOnSameLine = previous && previous.loc.end.line === node.loc.start.line; + + if (above) { + if (isOnSameLine) { + context.report({ + node, + messageId: "above" + }); + } + } else { + if (!isOnSameLine) { + context.report({ + node, + messageId: "beside" + }); + } + } + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/linebreak-style.js b/node_modules/eslint/lib/rules/linebreak-style.js new file mode 100644 index 000000000..b3b393ead --- /dev/null +++ b/node_modules/eslint/lib/rules/linebreak-style.js @@ -0,0 +1,105 @@ +/** + * @fileoverview Rule to enforce a single linebreak style. + * @author Erik Mueller + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent linebreak style", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/linebreak-style" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["unix", "windows"] + } + ], + messages: { + expectedLF: "Expected linebreaks to be 'LF' but found 'CRLF'.", + expectedCRLF: "Expected linebreaks to be 'CRLF' but found 'LF'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Builds a fix function that replaces text at the specified range in the source text. + * @param {int[]} range The range to replace + * @param {string} text The text to insert. + * @returns {Function} Fixer function + * @private + */ + function createFix(range, text) { + return function(fixer) { + return fixer.replaceTextRange(range, text); + }; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program: function checkForLinebreakStyle(node) { + const linebreakStyle = context.options[0] || "unix", + expectedLF = linebreakStyle === "unix", + expectedLFChars = expectedLF ? "\n" : "\r\n", + source = sourceCode.getText(), + pattern = astUtils.createGlobalLinebreakMatcher(); + let match; + + let i = 0; + + while ((match = pattern.exec(source)) !== null) { + i++; + if (match[0] === expectedLFChars) { + continue; + } + + const index = match.index; + const range = [index, index + match[0].length]; + + context.report({ + node, + loc: { + start: { + line: i, + column: sourceCode.lines[i - 1].length + }, + end: { + line: i + 1, + column: 0 + } + }, + messageId: expectedLF ? "expectedLF" : "expectedCRLF", + fix: createFix(range, expectedLFChars) + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/lines-around-comment.js b/node_modules/eslint/lib/rules/lines-around-comment.js new file mode 100644 index 000000000..5e1b83cdd --- /dev/null +++ b/node_modules/eslint/lib/rules/lines-around-comment.js @@ -0,0 +1,404 @@ +/** + * @fileoverview Enforces empty lines around comments. + * @author Jamund Ferguson + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"), + astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Return an array with with any line numbers that are empty. + * @param {Array} lines An array of each line of the file. + * @returns {Array} An array of line numbers. + */ +function getEmptyLineNums(lines) { + const emptyLines = lines.map((line, i) => ({ + code: line.trim(), + num: i + 1 + })).filter(line => !line.code).map(line => line.num); + + return emptyLines; +} + +/** + * Return an array with with any line numbers that contain comments. + * @param {Array} comments An array of comment tokens. + * @returns {Array} An array of line numbers. + */ +function getCommentLineNums(comments) { + const lines = []; + + comments.forEach(token => { + const start = token.loc.start.line; + const end = token.loc.end.line; + + lines.push(start, end); + }); + return lines; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require empty lines around comments", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/lines-around-comment" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + beforeBlockComment: { + type: "boolean", + default: true + }, + afterBlockComment: { + type: "boolean", + default: false + }, + beforeLineComment: { + type: "boolean", + default: false + }, + afterLineComment: { + type: "boolean", + default: false + }, + allowBlockStart: { + type: "boolean", + default: false + }, + allowBlockEnd: { + type: "boolean", + default: false + }, + allowClassStart: { + type: "boolean" + }, + allowClassEnd: { + type: "boolean" + }, + allowObjectStart: { + type: "boolean" + }, + allowObjectEnd: { + type: "boolean" + }, + allowArrayStart: { + type: "boolean" + }, + allowArrayEnd: { + type: "boolean" + }, + ignorePattern: { + type: "string" + }, + applyDefaultIgnorePatterns: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + messages: { + after: "Expected line after comment.", + before: "Expected line before comment." + } + }, + + create(context) { + + const options = Object.assign({}, context.options[0]); + const ignorePattern = options.ignorePattern; + const defaultIgnoreRegExp = astUtils.COMMENTS_IGNORE_PATTERN; + const customIgnoreRegExp = new RegExp(ignorePattern, "u"); + const applyDefaultIgnorePatterns = options.applyDefaultIgnorePatterns !== false; + + options.beforeBlockComment = typeof options.beforeBlockComment !== "undefined" ? options.beforeBlockComment : true; + + const sourceCode = context.getSourceCode(); + + const lines = sourceCode.lines, + numLines = lines.length + 1, + comments = sourceCode.getAllComments(), + commentLines = getCommentLineNums(comments), + emptyLines = getEmptyLineNums(lines), + commentAndEmptyLines = commentLines.concat(emptyLines); + + /** + * Returns whether or not comments are on lines starting with or ending with code + * @param {token} token The comment token to check. + * @returns {boolean} True if the comment is not alone. + */ + function codeAroundComment(token) { + let currentToken = token; + + do { + currentToken = sourceCode.getTokenBefore(currentToken, { includeComments: true }); + } while (currentToken && astUtils.isCommentToken(currentToken)); + + if (currentToken && astUtils.isTokenOnSameLine(currentToken, token)) { + return true; + } + + currentToken = token; + do { + currentToken = sourceCode.getTokenAfter(currentToken, { includeComments: true }); + } while (currentToken && astUtils.isCommentToken(currentToken)); + + if (currentToken && astUtils.isTokenOnSameLine(token, currentToken)) { + return true; + } + + return false; + } + + /** + * Returns whether or not comments are inside a node type or not. + * @param {ASTNode} parent The Comment parent node. + * @param {string} nodeType The parent type to check against. + * @returns {boolean} True if the comment is inside nodeType. + */ + function isParentNodeType(parent, nodeType) { + return parent.type === nodeType || + (parent.body && parent.body.type === nodeType) || + (parent.consequent && parent.consequent.type === nodeType); + } + + /** + * Returns the parent node that contains the given token. + * @param {token} token The token to check. + * @returns {ASTNode} The parent node that contains the given token. + */ + function getParentNodeOfToken(token) { + return sourceCode.getNodeByRangeIndex(token.range[0]); + } + + /** + * Returns whether or not comments are at the parent start or not. + * @param {token} token The Comment token. + * @param {string} nodeType The parent type to check against. + * @returns {boolean} True if the comment is at parent start. + */ + function isCommentAtParentStart(token, nodeType) { + const parent = getParentNodeOfToken(token); + + return parent && isParentNodeType(parent, nodeType) && + token.loc.start.line - parent.loc.start.line === 1; + } + + /** + * Returns whether or not comments are at the parent end or not. + * @param {token} token The Comment token. + * @param {string} nodeType The parent type to check against. + * @returns {boolean} True if the comment is at parent end. + */ + function isCommentAtParentEnd(token, nodeType) { + const parent = getParentNodeOfToken(token); + + return parent && isParentNodeType(parent, nodeType) && + parent.loc.end.line - token.loc.end.line === 1; + } + + /** + * Returns whether or not comments are at the block start or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at block start. + */ + function isCommentAtBlockStart(token) { + return isCommentAtParentStart(token, "ClassBody") || isCommentAtParentStart(token, "BlockStatement") || isCommentAtParentStart(token, "SwitchCase"); + } + + /** + * Returns whether or not comments are at the block end or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at block end. + */ + function isCommentAtBlockEnd(token) { + return isCommentAtParentEnd(token, "ClassBody") || isCommentAtParentEnd(token, "BlockStatement") || isCommentAtParentEnd(token, "SwitchCase") || isCommentAtParentEnd(token, "SwitchStatement"); + } + + /** + * Returns whether or not comments are at the class start or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at class start. + */ + function isCommentAtClassStart(token) { + return isCommentAtParentStart(token, "ClassBody"); + } + + /** + * Returns whether or not comments are at the class end or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at class end. + */ + function isCommentAtClassEnd(token) { + return isCommentAtParentEnd(token, "ClassBody"); + } + + /** + * Returns whether or not comments are at the object start or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at object start. + */ + function isCommentAtObjectStart(token) { + return isCommentAtParentStart(token, "ObjectExpression") || isCommentAtParentStart(token, "ObjectPattern"); + } + + /** + * Returns whether or not comments are at the object end or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at object end. + */ + function isCommentAtObjectEnd(token) { + return isCommentAtParentEnd(token, "ObjectExpression") || isCommentAtParentEnd(token, "ObjectPattern"); + } + + /** + * Returns whether or not comments are at the array start or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at array start. + */ + function isCommentAtArrayStart(token) { + return isCommentAtParentStart(token, "ArrayExpression") || isCommentAtParentStart(token, "ArrayPattern"); + } + + /** + * Returns whether or not comments are at the array end or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at array end. + */ + function isCommentAtArrayEnd(token) { + return isCommentAtParentEnd(token, "ArrayExpression") || isCommentAtParentEnd(token, "ArrayPattern"); + } + + /** + * Checks if a comment token has lines around it (ignores inline comments) + * @param {token} token The Comment token. + * @param {Object} opts Options to determine the newline. + * @param {boolean} opts.after Should have a newline after this line. + * @param {boolean} opts.before Should have a newline before this line. + * @returns {void} + */ + function checkForEmptyLine(token, opts) { + if (applyDefaultIgnorePatterns && defaultIgnoreRegExp.test(token.value)) { + return; + } + + if (ignorePattern && customIgnoreRegExp.test(token.value)) { + return; + } + + let after = opts.after, + before = opts.before; + + const prevLineNum = token.loc.start.line - 1, + nextLineNum = token.loc.end.line + 1, + commentIsNotAlone = codeAroundComment(token); + + const blockStartAllowed = options.allowBlockStart && + isCommentAtBlockStart(token) && + !(options.allowClassStart === false && + isCommentAtClassStart(token)), + blockEndAllowed = options.allowBlockEnd && isCommentAtBlockEnd(token) && !(options.allowClassEnd === false && isCommentAtClassEnd(token)), + classStartAllowed = options.allowClassStart && isCommentAtClassStart(token), + classEndAllowed = options.allowClassEnd && isCommentAtClassEnd(token), + objectStartAllowed = options.allowObjectStart && isCommentAtObjectStart(token), + objectEndAllowed = options.allowObjectEnd && isCommentAtObjectEnd(token), + arrayStartAllowed = options.allowArrayStart && isCommentAtArrayStart(token), + arrayEndAllowed = options.allowArrayEnd && isCommentAtArrayEnd(token); + + const exceptionStartAllowed = blockStartAllowed || classStartAllowed || objectStartAllowed || arrayStartAllowed; + const exceptionEndAllowed = blockEndAllowed || classEndAllowed || objectEndAllowed || arrayEndAllowed; + + // ignore top of the file and bottom of the file + if (prevLineNum < 1) { + before = false; + } + if (nextLineNum >= numLines) { + after = false; + } + + // we ignore all inline comments + if (commentIsNotAlone) { + return; + } + + const previousTokenOrComment = sourceCode.getTokenBefore(token, { includeComments: true }); + const nextTokenOrComment = sourceCode.getTokenAfter(token, { includeComments: true }); + + // check for newline before + if (!exceptionStartAllowed && before && !lodash.includes(commentAndEmptyLines, prevLineNum) && + !(astUtils.isCommentToken(previousTokenOrComment) && astUtils.isTokenOnSameLine(previousTokenOrComment, token))) { + const lineStart = token.range[0] - token.loc.start.column; + const range = [lineStart, lineStart]; + + context.report({ + node: token, + messageId: "before", + fix(fixer) { + return fixer.insertTextBeforeRange(range, "\n"); + } + }); + } + + // check for newline after + if (!exceptionEndAllowed && after && !lodash.includes(commentAndEmptyLines, nextLineNum) && + !(astUtils.isCommentToken(nextTokenOrComment) && astUtils.isTokenOnSameLine(token, nextTokenOrComment))) { + context.report({ + node: token, + messageId: "after", + fix(fixer) { + return fixer.insertTextAfter(token, "\n"); + } + }); + } + + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program() { + comments.forEach(token => { + if (token.type === "Line") { + if (options.beforeLineComment || options.afterLineComment) { + checkForEmptyLine(token, { + after: options.afterLineComment, + before: options.beforeLineComment + }); + } + } else if (token.type === "Block") { + if (options.beforeBlockComment || options.afterBlockComment) { + checkForEmptyLine(token, { + after: options.afterBlockComment, + before: options.beforeBlockComment + }); + } + } + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/lines-around-directive.js b/node_modules/eslint/lib/rules/lines-around-directive.js new file mode 100644 index 000000000..fb439dad6 --- /dev/null +++ b/node_modules/eslint/lib/rules/lines-around-directive.js @@ -0,0 +1,201 @@ +/** + * @fileoverview Require or disallow newlines around directives. + * @author Kai Cataldo + * @deprecated + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow newlines around directives", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/lines-around-directive" + }, + + schema: [{ + oneOf: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + before: { + enum: ["always", "never"] + }, + after: { + enum: ["always", "never"] + } + }, + additionalProperties: false, + minProperties: 2 + } + ] + }], + + fixable: "whitespace", + messages: { + expected: "Expected newline {{location}} \"{{value}}\" directive.", + unexpected: "Unexpected newline {{location}} \"{{value}}\" directive." + }, + deprecated: true, + replacedBy: ["padding-line-between-statements"] + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const config = context.options[0] || "always"; + const expectLineBefore = typeof config === "string" ? config : config.before; + const expectLineAfter = typeof config === "string" ? config : config.after; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Check if node is preceded by a blank newline. + * @param {ASTNode} node Node to check. + * @returns {boolean} Whether or not the passed in node is preceded by a blank newline. + */ + function hasNewlineBefore(node) { + const tokenBefore = sourceCode.getTokenBefore(node, { includeComments: true }); + const tokenLineBefore = tokenBefore ? tokenBefore.loc.end.line : 0; + + return node.loc.start.line - tokenLineBefore >= 2; + } + + /** + * Gets the last token of a node that is on the same line as the rest of the node. + * This will usually be the last token of the node, but it will be the second-to-last token if the node has a trailing + * semicolon on a different line. + * @param {ASTNode} node A directive node + * @returns {Token} The last token of the node on the line + */ + function getLastTokenOnLine(node) { + const lastToken = sourceCode.getLastToken(node); + const secondToLastToken = sourceCode.getTokenBefore(lastToken); + + return astUtils.isSemicolonToken(lastToken) && lastToken.loc.start.line > secondToLastToken.loc.end.line + ? secondToLastToken + : lastToken; + } + + /** + * Check if node is followed by a blank newline. + * @param {ASTNode} node Node to check. + * @returns {boolean} Whether or not the passed in node is followed by a blank newline. + */ + function hasNewlineAfter(node) { + const lastToken = getLastTokenOnLine(node); + const tokenAfter = sourceCode.getTokenAfter(lastToken, { includeComments: true }); + + return tokenAfter.loc.start.line - lastToken.loc.end.line >= 2; + } + + /** + * Report errors for newlines around directives. + * @param {ASTNode} node Node to check. + * @param {string} location Whether the error was found before or after the directive. + * @param {boolean} expected Whether or not a newline was expected or unexpected. + * @returns {void} + */ + function reportError(node, location, expected) { + context.report({ + node, + messageId: expected ? "expected" : "unexpected", + data: { + value: node.expression.value, + location + }, + fix(fixer) { + const lastToken = getLastTokenOnLine(node); + + if (expected) { + return location === "before" ? fixer.insertTextBefore(node, "\n") : fixer.insertTextAfter(lastToken, "\n"); + } + return fixer.removeRange(location === "before" ? [node.range[0] - 1, node.range[0]] : [lastToken.range[1], lastToken.range[1] + 1]); + } + }); + } + + /** + * Check lines around directives in node + * @param {ASTNode} node node to check + * @returns {void} + */ + function checkDirectives(node) { + const directives = astUtils.getDirectivePrologue(node); + + if (!directives.length) { + return; + } + + const firstDirective = directives[0]; + const leadingComments = sourceCode.getCommentsBefore(firstDirective); + + /* + * Only check before the first directive if it is preceded by a comment or if it is at the top of + * the file and expectLineBefore is set to "never". This is to not force a newline at the top of + * the file if there are no comments as well as for compatibility with padded-blocks. + */ + if (leadingComments.length) { + if (expectLineBefore === "always" && !hasNewlineBefore(firstDirective)) { + reportError(firstDirective, "before", true); + } + + if (expectLineBefore === "never" && hasNewlineBefore(firstDirective)) { + reportError(firstDirective, "before", false); + } + } else if ( + node.type === "Program" && + expectLineBefore === "never" && + !leadingComments.length && + hasNewlineBefore(firstDirective) + ) { + reportError(firstDirective, "before", false); + } + + const lastDirective = directives[directives.length - 1]; + const statements = node.type === "Program" ? node.body : node.body.body; + + /* + * Do not check after the last directive if the body only + * contains a directive prologue and isn't followed by a comment to ensure + * this rule behaves well with padded-blocks. + */ + if (lastDirective === statements[statements.length - 1] && !lastDirective.trailingComments) { + return; + } + + if (expectLineAfter === "always" && !hasNewlineAfter(lastDirective)) { + reportError(lastDirective, "after", true); + } + + if (expectLineAfter === "never" && hasNewlineAfter(lastDirective)) { + reportError(lastDirective, "after", false); + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program: checkDirectives, + FunctionDeclaration: checkDirectives, + FunctionExpression: checkDirectives, + ArrowFunctionExpression: checkDirectives + }; + } +}; diff --git a/node_modules/eslint/lib/rules/lines-between-class-members.js b/node_modules/eslint/lib/rules/lines-between-class-members.js new file mode 100644 index 000000000..972353036 --- /dev/null +++ b/node_modules/eslint/lib/rules/lines-between-class-members.js @@ -0,0 +1,133 @@ +/** + * @fileoverview Rule to check empty newline between class members + * @author 薛定谔的猫 + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow an empty line between class members", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/lines-between-class-members" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + exceptAfterSingleLine: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + messages: { + never: "Unexpected blank line between class members.", + always: "Expected blank line between class members." + } + }, + + create(context) { + + const options = []; + + options[0] = context.options[0] || "always"; + options[1] = context.options[1] || { exceptAfterSingleLine: false }; + + const sourceCode = context.getSourceCode(); + + /** + * Return the last token among the consecutive tokens that have no exceed max line difference in between, before the first token in the next member. + * @param {Token} prevLastToken The last token in the previous member node. + * @param {Token} nextFirstToken The first token in the next member node. + * @param {number} maxLine The maximum number of allowed line difference between consecutive tokens. + * @returns {Token} The last token among the consecutive tokens. + */ + function findLastConsecutiveTokenAfter(prevLastToken, nextFirstToken, maxLine) { + const after = sourceCode.getTokenAfter(prevLastToken, { includeComments: true }); + + if (after !== nextFirstToken && after.loc.start.line - prevLastToken.loc.end.line <= maxLine) { + return findLastConsecutiveTokenAfter(after, nextFirstToken, maxLine); + } + return prevLastToken; + } + + /** + * Return the first token among the consecutive tokens that have no exceed max line difference in between, after the last token in the previous member. + * @param {Token} nextFirstToken The first token in the next member node. + * @param {Token} prevLastToken The last token in the previous member node. + * @param {number} maxLine The maximum number of allowed line difference between consecutive tokens. + * @returns {Token} The first token among the consecutive tokens. + */ + function findFirstConsecutiveTokenBefore(nextFirstToken, prevLastToken, maxLine) { + const before = sourceCode.getTokenBefore(nextFirstToken, { includeComments: true }); + + if (before !== prevLastToken && nextFirstToken.loc.start.line - before.loc.end.line <= maxLine) { + return findFirstConsecutiveTokenBefore(before, prevLastToken, maxLine); + } + return nextFirstToken; + } + + /** + * Checks if there is a token or comment between two tokens. + * @param {Token} before The token before. + * @param {Token} after The token after. + * @returns {boolean} True if there is a token or comment between two tokens. + */ + function hasTokenOrCommentBetween(before, after) { + return sourceCode.getTokensBetween(before, after, { includeComments: true }).length !== 0; + } + + return { + ClassBody(node) { + const body = node.body; + + for (let i = 0; i < body.length - 1; i++) { + const curFirst = sourceCode.getFirstToken(body[i]); + const curLast = sourceCode.getLastToken(body[i]); + const nextFirst = sourceCode.getFirstToken(body[i + 1]); + const isMulti = !astUtils.isTokenOnSameLine(curFirst, curLast); + const skip = !isMulti && options[1].exceptAfterSingleLine; + const beforePadding = findLastConsecutiveTokenAfter(curLast, nextFirst, 1); + const afterPadding = findFirstConsecutiveTokenBefore(nextFirst, curLast, 1); + const isPadded = afterPadding.loc.start.line - beforePadding.loc.end.line > 1; + const hasTokenInPadding = hasTokenOrCommentBetween(beforePadding, afterPadding); + const curLineLastToken = findLastConsecutiveTokenAfter(curLast, nextFirst, 0); + + if ((options[0] === "always" && !skip && !isPadded) || + (options[0] === "never" && isPadded)) { + context.report({ + node: body[i + 1], + messageId: isPadded ? "never" : "always", + fix(fixer) { + if (hasTokenInPadding) { + return null; + } + return isPadded + ? fixer.replaceTextRange([beforePadding.range[1], afterPadding.range[0]], "\n") + : fixer.insertTextAfter(curLineLastToken, "\n"); + } + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/max-classes-per-file.js b/node_modules/eslint/lib/rules/max-classes-per-file.js new file mode 100644 index 000000000..bb48a546e --- /dev/null +++ b/node_modules/eslint/lib/rules/max-classes-per-file.js @@ -0,0 +1,65 @@ +/** + * @fileoverview Enforce a maximum number of classes per file + * @author James Garbutt + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a maximum number of classes per file", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/max-classes-per-file" + }, + + schema: [ + { + type: "integer", + minimum: 1 + } + ], + + messages: { + maximumExceeded: "File has too many classes ({{ classCount }}). Maximum allowed is {{ max }}." + } + }, + create(context) { + + const maxClasses = context.options[0] || 1; + + let classCount = 0; + + return { + Program() { + classCount = 0; + }, + "Program:exit"(node) { + if (classCount > maxClasses) { + context.report({ + node, + messageId: "maximumExceeded", + data: { + classCount, + max: maxClasses + } + }); + } + }, + "ClassDeclaration, ClassExpression"() { + classCount++; + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/max-depth.js b/node_modules/eslint/lib/rules/max-depth.js new file mode 100644 index 000000000..5c5296bec --- /dev/null +++ b/node_modules/eslint/lib/rules/max-depth.js @@ -0,0 +1,154 @@ +/** + * @fileoverview A rule to set the maximum depth block can be nested in a function. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a maximum depth that blocks can be nested", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/max-depth" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + maximum: { + type: "integer", + minimum: 0 + }, + max: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + ], + messages: { + tooDeeply: "Blocks are nested too deeply ({{depth}}). Maximum allowed is {{maxDepth}}." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const functionStack = [], + option = context.options[0]; + let maxDepth = 4; + + if ( + typeof option === "object" && + (Object.prototype.hasOwnProperty.call(option, "maximum") || Object.prototype.hasOwnProperty.call(option, "max")) + ) { + maxDepth = option.maximum || option.max; + } + if (typeof option === "number") { + maxDepth = option; + } + + /** + * When parsing a new function, store it in our function stack + * @returns {void} + * @private + */ + function startFunction() { + functionStack.push(0); + } + + /** + * When parsing is done then pop out the reference + * @returns {void} + * @private + */ + function endFunction() { + functionStack.pop(); + } + + /** + * Save the block and Evaluate the node + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function pushBlock(node) { + const len = ++functionStack[functionStack.length - 1]; + + if (len > maxDepth) { + context.report({ node, messageId: "tooDeeply", data: { depth: len, maxDepth } }); + } + } + + /** + * Pop the saved block + * @returns {void} + * @private + */ + function popBlock() { + functionStack[functionStack.length - 1]--; + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + Program: startFunction, + FunctionDeclaration: startFunction, + FunctionExpression: startFunction, + ArrowFunctionExpression: startFunction, + + IfStatement(node) { + if (node.parent.type !== "IfStatement") { + pushBlock(node); + } + }, + SwitchStatement: pushBlock, + TryStatement: pushBlock, + DoWhileStatement: pushBlock, + WhileStatement: pushBlock, + WithStatement: pushBlock, + ForStatement: pushBlock, + ForInStatement: pushBlock, + ForOfStatement: pushBlock, + + "IfStatement:exit": popBlock, + "SwitchStatement:exit": popBlock, + "TryStatement:exit": popBlock, + "DoWhileStatement:exit": popBlock, + "WhileStatement:exit": popBlock, + "WithStatement:exit": popBlock, + "ForStatement:exit": popBlock, + "ForInStatement:exit": popBlock, + "ForOfStatement:exit": popBlock, + + "FunctionDeclaration:exit": endFunction, + "FunctionExpression:exit": endFunction, + "ArrowFunctionExpression:exit": endFunction, + "Program:exit": endFunction + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/max-len.js b/node_modules/eslint/lib/rules/max-len.js new file mode 100644 index 000000000..dd76760c5 --- /dev/null +++ b/node_modules/eslint/lib/rules/max-len.js @@ -0,0 +1,433 @@ +/** + * @fileoverview Rule to check for max length on a line. + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +const OPTIONS_SCHEMA = { + type: "object", + properties: { + code: { + type: "integer", + minimum: 0 + }, + comments: { + type: "integer", + minimum: 0 + }, + tabWidth: { + type: "integer", + minimum: 0 + }, + ignorePattern: { + type: "string" + }, + ignoreComments: { + type: "boolean" + }, + ignoreStrings: { + type: "boolean" + }, + ignoreUrls: { + type: "boolean" + }, + ignoreTemplateLiterals: { + type: "boolean" + }, + ignoreRegExpLiterals: { + type: "boolean" + }, + ignoreTrailingComments: { + type: "boolean" + } + }, + additionalProperties: false +}; + +const OPTIONS_OR_INTEGER_SCHEMA = { + anyOf: [ + OPTIONS_SCHEMA, + { + type: "integer", + minimum: 0 + } + ] +}; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce a maximum line length", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/max-len" + }, + + schema: [ + OPTIONS_OR_INTEGER_SCHEMA, + OPTIONS_OR_INTEGER_SCHEMA, + OPTIONS_SCHEMA + ], + messages: { + max: "This line has a length of {{lineLength}}. Maximum allowed is {{maxLength}}.", + maxComment: "This line has a comment length of {{lineLength}}. Maximum allowed is {{maxCommentLength}}." + } + }, + + create(context) { + + /* + * Inspired by http://tools.ietf.org/html/rfc3986#appendix-B, however: + * - They're matching an entire string that we know is a URI + * - We're matching part of a string where we think there *might* be a URL + * - We're only concerned about URLs, as picking out any URI would cause + * too many false positives + * - We don't care about matching the entire URL, any small segment is fine + */ + const URL_REGEXP = /[^:/?#]:\/\/[^?#]/u; + + const sourceCode = context.getSourceCode(); + + /** + * Computes the length of a line that may contain tabs. The width of each + * tab will be the number of spaces to the next tab stop. + * @param {string} line The line. + * @param {int} tabWidth The width of each tab stop in spaces. + * @returns {int} The computed line length. + * @private + */ + function computeLineLength(line, tabWidth) { + let extraCharacterCount = 0; + + line.replace(/\t/gu, (match, offset) => { + const totalOffset = offset + extraCharacterCount, + previousTabStopOffset = tabWidth ? totalOffset % tabWidth : 0, + spaceCount = tabWidth - previousTabStopOffset; + + extraCharacterCount += spaceCount - 1; // -1 for the replaced tab + }); + return Array.from(line).length + extraCharacterCount; + } + + // The options object must be the last option specified… + const options = Object.assign({}, context.options[context.options.length - 1]); + + // …but max code length… + if (typeof context.options[0] === "number") { + options.code = context.options[0]; + } + + // …and tabWidth can be optionally specified directly as integers. + if (typeof context.options[1] === "number") { + options.tabWidth = context.options[1]; + } + + const maxLength = typeof options.code === "number" ? options.code : 80, + tabWidth = typeof options.tabWidth === "number" ? options.tabWidth : 4, + ignoreComments = !!options.ignoreComments, + ignoreStrings = !!options.ignoreStrings, + ignoreTemplateLiterals = !!options.ignoreTemplateLiterals, + ignoreRegExpLiterals = !!options.ignoreRegExpLiterals, + ignoreTrailingComments = !!options.ignoreTrailingComments || !!options.ignoreComments, + ignoreUrls = !!options.ignoreUrls, + maxCommentLength = options.comments; + let ignorePattern = options.ignorePattern || null; + + if (ignorePattern) { + ignorePattern = new RegExp(ignorePattern, "u"); + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Tells if a given comment is trailing: it starts on the current line and + * extends to or past the end of the current line. + * @param {string} line The source line we want to check for a trailing comment on + * @param {number} lineNumber The one-indexed line number for line + * @param {ASTNode} comment The comment to inspect + * @returns {boolean} If the comment is trailing on the given line + */ + function isTrailingComment(line, lineNumber, comment) { + return comment && + (comment.loc.start.line === lineNumber && lineNumber <= comment.loc.end.line) && + (comment.loc.end.line > lineNumber || comment.loc.end.column === line.length); + } + + /** + * Tells if a comment encompasses the entire line. + * @param {string} line The source line with a trailing comment + * @param {number} lineNumber The one-indexed line number this is on + * @param {ASTNode} comment The comment to remove + * @returns {boolean} If the comment covers the entire line + */ + function isFullLineComment(line, lineNumber, comment) { + const start = comment.loc.start, + end = comment.loc.end, + isFirstTokenOnLine = !line.slice(0, comment.loc.start.column).trim(); + + return comment && + (start.line < lineNumber || (start.line === lineNumber && isFirstTokenOnLine)) && + (end.line > lineNumber || (end.line === lineNumber && end.column === line.length)); + } + + /** + * Check if a node is a JSXEmptyExpression contained in a single line JSXExpressionContainer. + * @param {ASTNode} node A node to check. + * @returns {boolean} True if the node is a JSXEmptyExpression contained in a single line JSXExpressionContainer. + */ + function isJSXEmptyExpressionInSingleLineContainer(node) { + if (!node || !node.parent || node.type !== "JSXEmptyExpression" || node.parent.type !== "JSXExpressionContainer") { + return false; + } + + const parent = node.parent; + + return parent.loc.start.line === parent.loc.end.line; + } + + /** + * Gets the line after the comment and any remaining trailing whitespace is + * stripped. + * @param {string} line The source line with a trailing comment + * @param {ASTNode} comment The comment to remove + * @returns {string} Line without comment and trailing whitespace + */ + function stripTrailingComment(line, comment) { + + // loc.column is zero-indexed + return line.slice(0, comment.loc.start.column).replace(/\s+$/u, ""); + } + + /** + * Ensure that an array exists at [key] on `object`, and add `value` to it. + * @param {Object} object the object to mutate + * @param {string} key the object's key + * @param {*} value the value to add + * @returns {void} + * @private + */ + function ensureArrayAndPush(object, key, value) { + if (!Array.isArray(object[key])) { + object[key] = []; + } + object[key].push(value); + } + + /** + * Retrieves an array containing all strings (" or ') in the source code. + * @returns {ASTNode[]} An array of string nodes. + */ + function getAllStrings() { + return sourceCode.ast.tokens.filter(token => (token.type === "String" || + (token.type === "JSXText" && sourceCode.getNodeByRangeIndex(token.range[0] - 1).type === "JSXAttribute"))); + } + + /** + * Retrieves an array containing all template literals in the source code. + * @returns {ASTNode[]} An array of template literal nodes. + */ + function getAllTemplateLiterals() { + return sourceCode.ast.tokens.filter(token => token.type === "Template"); + } + + + /** + * Retrieves an array containing all RegExp literals in the source code. + * @returns {ASTNode[]} An array of RegExp literal nodes. + */ + function getAllRegExpLiterals() { + return sourceCode.ast.tokens.filter(token => token.type === "RegularExpression"); + } + + + /** + * A reducer to group an AST node by line number, both start and end. + * @param {Object} acc the accumulator + * @param {ASTNode} node the AST node in question + * @returns {Object} the modified accumulator + * @private + */ + function groupByLineNumber(acc, node) { + for (let i = node.loc.start.line; i <= node.loc.end.line; ++i) { + ensureArrayAndPush(acc, i, node); + } + return acc; + } + + /** + * Returns an array of all comments in the source code. + * If the element in the array is a JSXEmptyExpression contained with a single line JSXExpressionContainer, + * the element is changed with JSXExpressionContainer node. + * @returns {ASTNode[]} An array of comment nodes + */ + function getAllComments() { + const comments = []; + + sourceCode.getAllComments() + .forEach(commentNode => { + const containingNode = sourceCode.getNodeByRangeIndex(commentNode.range[0]); + + if (isJSXEmptyExpressionInSingleLineContainer(containingNode)) { + + // push a unique node only + if (comments[comments.length - 1] !== containingNode.parent) { + comments.push(containingNode.parent); + } + } else { + comments.push(commentNode); + } + }); + + return comments; + } + + /** + * Check the program for max length + * @param {ASTNode} node Node to examine + * @returns {void} + * @private + */ + function checkProgramForMaxLength(node) { + + // split (honors line-ending) + const lines = sourceCode.lines, + + // list of comments to ignore + comments = ignoreComments || maxCommentLength || ignoreTrailingComments ? getAllComments() : []; + + // we iterate over comments in parallel with the lines + let commentsIndex = 0; + + const strings = getAllStrings(); + const stringsByLine = strings.reduce(groupByLineNumber, {}); + + const templateLiterals = getAllTemplateLiterals(); + const templateLiteralsByLine = templateLiterals.reduce(groupByLineNumber, {}); + + const regExpLiterals = getAllRegExpLiterals(); + const regExpLiteralsByLine = regExpLiterals.reduce(groupByLineNumber, {}); + + lines.forEach((line, i) => { + + // i is zero-indexed, line numbers are one-indexed + const lineNumber = i + 1; + + /* + * if we're checking comment length; we need to know whether this + * line is a comment + */ + let lineIsComment = false; + let textToMeasure; + + /* + * We can short-circuit the comment checks if we're already out of + * comments to check. + */ + if (commentsIndex < comments.length) { + let comment = null; + + // iterate over comments until we find one past the current line + do { + comment = comments[++commentsIndex]; + } while (comment && comment.loc.start.line <= lineNumber); + + // and step back by one + comment = comments[--commentsIndex]; + + if (isFullLineComment(line, lineNumber, comment)) { + lineIsComment = true; + textToMeasure = line; + } else if (ignoreTrailingComments && isTrailingComment(line, lineNumber, comment)) { + textToMeasure = stripTrailingComment(line, comment); + + // ignore multiple trailing comments in the same line + let lastIndex = commentsIndex; + + while (isTrailingComment(textToMeasure, lineNumber, comments[--lastIndex])) { + textToMeasure = stripTrailingComment(textToMeasure, comments[lastIndex]); + } + } else { + textToMeasure = line; + } + } else { + textToMeasure = line; + } + if (ignorePattern && ignorePattern.test(textToMeasure) || + ignoreUrls && URL_REGEXP.test(textToMeasure) || + ignoreStrings && stringsByLine[lineNumber] || + ignoreTemplateLiterals && templateLiteralsByLine[lineNumber] || + ignoreRegExpLiterals && regExpLiteralsByLine[lineNumber] + ) { + + // ignore this line + return; + } + + const lineLength = computeLineLength(textToMeasure, tabWidth); + const commentLengthApplies = lineIsComment && maxCommentLength; + + if (lineIsComment && ignoreComments) { + return; + } + + const loc = { + start: { + line: lineNumber, + column: 0 + }, + end: { + line: lineNumber, + column: textToMeasure.length + } + }; + + if (commentLengthApplies) { + if (lineLength > maxCommentLength) { + context.report({ + node, + loc, + messageId: "maxComment", + data: { + lineLength, + maxCommentLength + } + }); + } + } else if (lineLength > maxLength) { + context.report({ + node, + loc, + messageId: "max", + data: { + lineLength, + maxLength + } + }); + } + }); + } + + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + Program: checkProgramForMaxLength + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/max-lines-per-function.js b/node_modules/eslint/lib/rules/max-lines-per-function.js new file mode 100644 index 000000000..aa423a60a --- /dev/null +++ b/node_modules/eslint/lib/rules/max-lines-per-function.js @@ -0,0 +1,214 @@ +/** + * @fileoverview A rule to set the maximum number of line of code in a function. + * @author Pete Ward + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +const OPTIONS_SCHEMA = { + type: "object", + properties: { + max: { + type: "integer", + minimum: 0 + }, + skipComments: { + type: "boolean" + }, + skipBlankLines: { + type: "boolean" + }, + IIFEs: { + type: "boolean" + } + }, + additionalProperties: false +}; + +const OPTIONS_OR_INTEGER_SCHEMA = { + oneOf: [ + OPTIONS_SCHEMA, + { + type: "integer", + minimum: 1 + } + ] +}; + +/** + * Given a list of comment nodes, return a map with numeric keys (source code line numbers) and comment token values. + * @param {Array} comments An array of comment nodes. + * @returns {Map.} A map with numeric keys (source code line numbers) and comment token values. + */ +function getCommentLineNumbers(comments) { + const map = new Map(); + + comments.forEach(comment => { + for (let i = comment.loc.start.line; i <= comment.loc.end.line; i++) { + map.set(i, comment); + } + }); + return map; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a maximum number of line of code in a function", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/max-lines-per-function" + }, + + schema: [ + OPTIONS_OR_INTEGER_SCHEMA + ], + messages: { + exceed: "{{name}} has too many lines ({{lineCount}}). Maximum allowed is {{maxLines}}." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const lines = sourceCode.lines; + + const option = context.options[0]; + let maxLines = 50; + let skipComments = false; + let skipBlankLines = false; + let IIFEs = false; + + if (typeof option === "object") { + maxLines = typeof option.max === "number" ? option.max : 50; + skipComments = !!option.skipComments; + skipBlankLines = !!option.skipBlankLines; + IIFEs = !!option.IIFEs; + } else if (typeof option === "number") { + maxLines = option; + } + + const commentLineNumbers = getCommentLineNumbers(sourceCode.getAllComments()); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Tells if a comment encompasses the entire line. + * @param {string} line The source line with a trailing comment + * @param {number} lineNumber The one-indexed line number this is on + * @param {ASTNode} comment The comment to remove + * @returns {boolean} If the comment covers the entire line + */ + function isFullLineComment(line, lineNumber, comment) { + const start = comment.loc.start, + end = comment.loc.end, + isFirstTokenOnLine = start.line === lineNumber && !line.slice(0, start.column).trim(), + isLastTokenOnLine = end.line === lineNumber && !line.slice(end.column).trim(); + + return comment && + (start.line < lineNumber || isFirstTokenOnLine) && + (end.line > lineNumber || isLastTokenOnLine); + } + + /** + * Identifies is a node is a FunctionExpression which is part of an IIFE + * @param {ASTNode} node Node to test + * @returns {boolean} True if it's an IIFE + */ + function isIIFE(node) { + return (node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression") && node.parent && node.parent.type === "CallExpression" && node.parent.callee === node; + } + + /** + * Identifies is a node is a FunctionExpression which is embedded within a MethodDefinition or Property + * @param {ASTNode} node Node to test + * @returns {boolean} True if it's a FunctionExpression embedded within a MethodDefinition or Property + */ + function isEmbedded(node) { + if (!node.parent) { + return false; + } + if (node !== node.parent.value) { + return false; + } + if (node.parent.type === "MethodDefinition") { + return true; + } + if (node.parent.type === "Property") { + return node.parent.method === true || node.parent.kind === "get" || node.parent.kind === "set"; + } + return false; + } + + /** + * Count the lines in the function + * @param {ASTNode} funcNode Function AST node + * @returns {void} + * @private + */ + function processFunction(funcNode) { + const node = isEmbedded(funcNode) ? funcNode.parent : funcNode; + + if (!IIFEs && isIIFE(node)) { + return; + } + let lineCount = 0; + + for (let i = node.loc.start.line - 1; i < node.loc.end.line; ++i) { + const line = lines[i]; + + if (skipComments) { + if (commentLineNumbers.has(i + 1) && isFullLineComment(line, i + 1, commentLineNumbers.get(i + 1))) { + continue; + } + } + + if (skipBlankLines) { + if (line.match(/^\s*$/u)) { + continue; + } + } + + lineCount++; + } + + if (lineCount > maxLines) { + const name = lodash.upperFirst(astUtils.getFunctionNameWithKind(funcNode)); + + context.report({ + node, + messageId: "exceed", + data: { name, lineCount, maxLines } + }); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + FunctionDeclaration: processFunction, + FunctionExpression: processFunction, + ArrowFunctionExpression: processFunction + }; + } +}; diff --git a/node_modules/eslint/lib/rules/max-lines.js b/node_modules/eslint/lib/rules/max-lines.js new file mode 100644 index 000000000..f33adbdb5 --- /dev/null +++ b/node_modules/eslint/lib/rules/max-lines.js @@ -0,0 +1,174 @@ +/** + * @fileoverview enforce a maximum file length + * @author Alberto Rodríguez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a maximum number of lines per file", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/max-lines" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + max: { + type: "integer", + minimum: 0 + }, + skipComments: { + type: "boolean" + }, + skipBlankLines: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + } + ], + messages: { + exceed: + "File has too many lines ({{actual}}). Maximum allowed is {{max}}." + } + }, + + create(context) { + const option = context.options[0]; + let max = 300; + + if ( + typeof option === "object" && + Object.prototype.hasOwnProperty.call(option, "max") + ) { + max = option.max; + } else if (typeof option === "number") { + max = option; + } + + const skipComments = option && option.skipComments; + const skipBlankLines = option && option.skipBlankLines; + + const sourceCode = context.getSourceCode(); + + /** + * Returns whether or not a token is a comment node type + * @param {Token} token The token to check + * @returns {boolean} True if the token is a comment node + */ + function isCommentNodeType(token) { + return token && (token.type === "Block" || token.type === "Line"); + } + + /** + * Returns the line numbers of a comment that don't have any code on the same line + * @param {Node} comment The comment node to check + * @returns {number[]} The line numbers + */ + function getLinesWithoutCode(comment) { + let start = comment.loc.start.line; + let end = comment.loc.end.line; + + let token; + + token = comment; + do { + token = sourceCode.getTokenBefore(token, { + includeComments: true + }); + } while (isCommentNodeType(token)); + + if (token && astUtils.isTokenOnSameLine(token, comment)) { + start += 1; + } + + token = comment; + do { + token = sourceCode.getTokenAfter(token, { + includeComments: true + }); + } while (isCommentNodeType(token)); + + if (token && astUtils.isTokenOnSameLine(comment, token)) { + end -= 1; + } + + if (start <= end) { + return lodash.range(start, end + 1); + } + return []; + } + + return { + "Program:exit"() { + let lines = sourceCode.lines.map((text, i) => ({ + lineNumber: i + 1, + text + })); + + if (skipBlankLines) { + lines = lines.filter(l => l.text.trim() !== ""); + } + + if (skipComments) { + const comments = sourceCode.getAllComments(); + + const commentLines = lodash.flatten( + comments.map(comment => getLinesWithoutCode(comment)) + ); + + lines = lines.filter( + l => !lodash.includes(commentLines, l.lineNumber) + ); + } + + if (lines.length > max) { + const loc = { + start: { + line: lines[max].lineNumber, + column: 0 + }, + end: { + line: sourceCode.lines.length, + column: lodash.last(sourceCode.lines).length + } + }; + + context.report({ + loc, + messageId: "exceed", + data: { + max, + actual: lines.length + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/max-nested-callbacks.js b/node_modules/eslint/lib/rules/max-nested-callbacks.js new file mode 100644 index 000000000..df1baceeb --- /dev/null +++ b/node_modules/eslint/lib/rules/max-nested-callbacks.js @@ -0,0 +1,117 @@ +/** + * @fileoverview Rule to enforce a maximum number of nested callbacks. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a maximum depth that callbacks can be nested", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/max-nested-callbacks" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + maximum: { + type: "integer", + minimum: 0 + }, + max: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + ], + messages: { + exceed: "Too many nested callbacks ({{num}}). Maximum allowed is {{max}}." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Constants + //-------------------------------------------------------------------------- + const option = context.options[0]; + let THRESHOLD = 10; + + if ( + typeof option === "object" && + (Object.prototype.hasOwnProperty.call(option, "maximum") || Object.prototype.hasOwnProperty.call(option, "max")) + ) { + THRESHOLD = option.maximum || option.max; + } else if (typeof option === "number") { + THRESHOLD = option; + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const callbackStack = []; + + /** + * Checks a given function node for too many callbacks. + * @param {ASTNode} node The node to check. + * @returns {void} + * @private + */ + function checkFunction(node) { + const parent = node.parent; + + if (parent.type === "CallExpression") { + callbackStack.push(node); + } + + if (callbackStack.length > THRESHOLD) { + const opts = { num: callbackStack.length, max: THRESHOLD }; + + context.report({ node, messageId: "exceed", data: opts }); + } + } + + /** + * Pops the call stack. + * @returns {void} + * @private + */ + function popStack() { + callbackStack.pop(); + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + ArrowFunctionExpression: checkFunction, + "ArrowFunctionExpression:exit": popStack, + + FunctionExpression: checkFunction, + "FunctionExpression:exit": popStack + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/max-params.js b/node_modules/eslint/lib/rules/max-params.js new file mode 100644 index 000000000..4eebe2d95 --- /dev/null +++ b/node_modules/eslint/lib/rules/max-params.js @@ -0,0 +1,103 @@ +/** + * @fileoverview Rule to flag when a function has too many parameters + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a maximum number of parameters in function definitions", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/max-params" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + maximum: { + type: "integer", + minimum: 0 + }, + max: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + ], + messages: { + exceed: "{{name}} has too many parameters ({{count}}). Maximum allowed is {{max}}." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const option = context.options[0]; + let numParams = 3; + + if ( + typeof option === "object" && + (Object.prototype.hasOwnProperty.call(option, "maximum") || Object.prototype.hasOwnProperty.call(option, "max")) + ) { + numParams = option.maximum || option.max; + } + if (typeof option === "number") { + numParams = option; + } + + /** + * Checks a function to see if it has too many parameters. + * @param {ASTNode} node The node to check. + * @returns {void} + * @private + */ + function checkFunction(node) { + if (node.params.length > numParams) { + context.report({ + loc: astUtils.getFunctionHeadLoc(node, sourceCode), + node, + messageId: "exceed", + data: { + name: lodash.upperFirst(astUtils.getFunctionNameWithKind(node)), + count: node.params.length, + max: numParams + } + }); + } + } + + return { + FunctionDeclaration: checkFunction, + ArrowFunctionExpression: checkFunction, + FunctionExpression: checkFunction + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/max-statements-per-line.js b/node_modules/eslint/lib/rules/max-statements-per-line.js new file mode 100644 index 000000000..5407cff3c --- /dev/null +++ b/node_modules/eslint/lib/rules/max-statements-per-line.js @@ -0,0 +1,196 @@ +/** + * @fileoverview Specify the maximum number of statements allowed per line. + * @author Kenneth Williams + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce a maximum number of statements allowed per line", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/max-statements-per-line" + }, + + schema: [ + { + type: "object", + properties: { + max: { + type: "integer", + minimum: 1, + default: 1 + } + }, + additionalProperties: false + } + ], + messages: { + exceed: "This line has {{numberOfStatementsOnThisLine}} {{statements}}. Maximum allowed is {{maxStatementsPerLine}}." + } + }, + + create(context) { + + const sourceCode = context.getSourceCode(), + options = context.options[0] || {}, + maxStatementsPerLine = typeof options.max !== "undefined" ? options.max : 1; + + let lastStatementLine = 0, + numberOfStatementsOnThisLine = 0, + firstExtraStatement; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const SINGLE_CHILD_ALLOWED = /^(?:(?:DoWhile|For|ForIn|ForOf|If|Labeled|While)Statement|Export(?:Default|Named)Declaration)$/u; + + /** + * Reports with the first extra statement, and clears it. + * @returns {void} + */ + function reportFirstExtraStatementAndClear() { + if (firstExtraStatement) { + context.report({ + node: firstExtraStatement, + messageId: "exceed", + data: { + numberOfStatementsOnThisLine, + maxStatementsPerLine, + statements: numberOfStatementsOnThisLine === 1 ? "statement" : "statements" + } + }); + } + firstExtraStatement = null; + } + + /** + * Gets the actual last token of a given node. + * @param {ASTNode} node A node to get. This is a node except EmptyStatement. + * @returns {Token} The actual last token. + */ + function getActualLastToken(node) { + return sourceCode.getLastToken(node, astUtils.isNotSemicolonToken); + } + + /** + * Addresses a given node. + * It updates the state of this rule, then reports the node if the node violated this rule. + * @param {ASTNode} node A node to check. + * @returns {void} + */ + function enterStatement(node) { + const line = node.loc.start.line; + + /* + * Skip to allow non-block statements if this is direct child of control statements. + * `if (a) foo();` is counted as 1. + * But `if (a) foo(); else foo();` should be counted as 2. + */ + if (SINGLE_CHILD_ALLOWED.test(node.parent.type) && + node.parent.alternate !== node + ) { + return; + } + + // Update state. + if (line === lastStatementLine) { + numberOfStatementsOnThisLine += 1; + } else { + reportFirstExtraStatementAndClear(); + numberOfStatementsOnThisLine = 1; + lastStatementLine = line; + } + + // Reports if the node violated this rule. + if (numberOfStatementsOnThisLine === maxStatementsPerLine + 1) { + firstExtraStatement = firstExtraStatement || node; + } + } + + /** + * Updates the state of this rule with the end line of leaving node to check with the next statement. + * @param {ASTNode} node A node to check. + * @returns {void} + */ + function leaveStatement(node) { + const line = getActualLastToken(node).loc.end.line; + + // Update state. + if (line !== lastStatementLine) { + reportFirstExtraStatementAndClear(); + numberOfStatementsOnThisLine = 1; + lastStatementLine = line; + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + BreakStatement: enterStatement, + ClassDeclaration: enterStatement, + ContinueStatement: enterStatement, + DebuggerStatement: enterStatement, + DoWhileStatement: enterStatement, + ExpressionStatement: enterStatement, + ForInStatement: enterStatement, + ForOfStatement: enterStatement, + ForStatement: enterStatement, + FunctionDeclaration: enterStatement, + IfStatement: enterStatement, + ImportDeclaration: enterStatement, + LabeledStatement: enterStatement, + ReturnStatement: enterStatement, + SwitchStatement: enterStatement, + ThrowStatement: enterStatement, + TryStatement: enterStatement, + VariableDeclaration: enterStatement, + WhileStatement: enterStatement, + WithStatement: enterStatement, + ExportNamedDeclaration: enterStatement, + ExportDefaultDeclaration: enterStatement, + ExportAllDeclaration: enterStatement, + + "BreakStatement:exit": leaveStatement, + "ClassDeclaration:exit": leaveStatement, + "ContinueStatement:exit": leaveStatement, + "DebuggerStatement:exit": leaveStatement, + "DoWhileStatement:exit": leaveStatement, + "ExpressionStatement:exit": leaveStatement, + "ForInStatement:exit": leaveStatement, + "ForOfStatement:exit": leaveStatement, + "ForStatement:exit": leaveStatement, + "FunctionDeclaration:exit": leaveStatement, + "IfStatement:exit": leaveStatement, + "ImportDeclaration:exit": leaveStatement, + "LabeledStatement:exit": leaveStatement, + "ReturnStatement:exit": leaveStatement, + "SwitchStatement:exit": leaveStatement, + "ThrowStatement:exit": leaveStatement, + "TryStatement:exit": leaveStatement, + "VariableDeclaration:exit": leaveStatement, + "WhileStatement:exit": leaveStatement, + "WithStatement:exit": leaveStatement, + "ExportNamedDeclaration:exit": leaveStatement, + "ExportDefaultDeclaration:exit": leaveStatement, + "ExportAllDeclaration:exit": leaveStatement, + "Program:exit": reportFirstExtraStatementAndClear + }; + } +}; diff --git a/node_modules/eslint/lib/rules/max-statements.js b/node_modules/eslint/lib/rules/max-statements.js new file mode 100644 index 000000000..437b393a5 --- /dev/null +++ b/node_modules/eslint/lib/rules/max-statements.js @@ -0,0 +1,175 @@ +/** + * @fileoverview A rule to set the maximum number of statements in a function. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a maximum number of statements allowed in function blocks", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/max-statements" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + maximum: { + type: "integer", + minimum: 0 + }, + max: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + } + ] + }, + { + type: "object", + properties: { + ignoreTopLevelFunctions: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + messages: { + exceed: "{{name}} has too many statements ({{count}}). Maximum allowed is {{max}}." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const functionStack = [], + option = context.options[0], + ignoreTopLevelFunctions = context.options[1] && context.options[1].ignoreTopLevelFunctions || false, + topLevelFunctions = []; + let maxStatements = 10; + + if ( + typeof option === "object" && + (Object.prototype.hasOwnProperty.call(option, "maximum") || Object.prototype.hasOwnProperty.call(option, "max")) + ) { + maxStatements = option.maximum || option.max; + } else if (typeof option === "number") { + maxStatements = option; + } + + /** + * Reports a node if it has too many statements + * @param {ASTNode} node node to evaluate + * @param {int} count Number of statements in node + * @param {int} max Maximum number of statements allowed + * @returns {void} + * @private + */ + function reportIfTooManyStatements(node, count, max) { + if (count > max) { + const name = lodash.upperFirst(astUtils.getFunctionNameWithKind(node)); + + context.report({ + node, + messageId: "exceed", + data: { name, count, max } + }); + } + } + + /** + * When parsing a new function, store it in our function stack + * @returns {void} + * @private + */ + function startFunction() { + functionStack.push(0); + } + + /** + * Evaluate the node at the end of function + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function endFunction(node) { + const count = functionStack.pop(); + + if (ignoreTopLevelFunctions && functionStack.length === 0) { + topLevelFunctions.push({ node, count }); + } else { + reportIfTooManyStatements(node, count, maxStatements); + } + } + + /** + * Increment the count of the functions + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function countStatements(node) { + functionStack[functionStack.length - 1] += node.body.length; + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + FunctionDeclaration: startFunction, + FunctionExpression: startFunction, + ArrowFunctionExpression: startFunction, + + BlockStatement: countStatements, + + "FunctionDeclaration:exit": endFunction, + "FunctionExpression:exit": endFunction, + "ArrowFunctionExpression:exit": endFunction, + + "Program:exit"() { + if (topLevelFunctions.length === 1) { + return; + } + + topLevelFunctions.forEach(element => { + const count = element.count; + const node = element.node; + + reportIfTooManyStatements(node, count, maxStatements); + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/multiline-comment-style.js b/node_modules/eslint/lib/rules/multiline-comment-style.js new file mode 100644 index 000000000..9524818b8 --- /dev/null +++ b/node_modules/eslint/lib/rules/multiline-comment-style.js @@ -0,0 +1,435 @@ +/** + * @fileoverview enforce a particular style for multiline comments + * @author Teddy Katz + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a particular style for multiline comments", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/multiline-comment-style" + }, + + fixable: "whitespace", + schema: [{ enum: ["starred-block", "separate-lines", "bare-block"] }], + messages: { + expectedBlock: "Expected a block comment instead of consecutive line comments.", + expectedBareBlock: "Expected a block comment without padding stars.", + startNewline: "Expected a linebreak after '/*'.", + endNewline: "Expected a linebreak before '*/'.", + missingStar: "Expected a '*' at the start of this line.", + alignment: "Expected this line to be aligned with the start of the comment.", + expectedLines: "Expected multiple line comments instead of a block comment." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const option = context.options[0] || "starred-block"; + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Checks if a comment line is starred. + * @param {string} line A string representing a comment line. + * @returns {boolean} Whether or not the comment line is starred. + */ + function isStarredCommentLine(line) { + return /^\s*\*/u.test(line); + } + + /** + * Checks if a comment group is in starred-block form. + * @param {Token[]} commentGroup A group of comments, containing either multiple line comments or a single block comment. + * @returns {boolean} Whether or not the comment group is in starred block form. + */ + function isStarredBlockComment([firstComment]) { + if (firstComment.type !== "Block") { + return false; + } + + const lines = firstComment.value.split(astUtils.LINEBREAK_MATCHER); + + // The first and last lines can only contain whitespace. + return lines.length > 0 && lines.every((line, i) => (i === 0 || i === lines.length - 1 ? /^\s*$/u : /^\s*\*/u).test(line)); + } + + /** + * Checks if a comment group is in JSDoc form. + * @param {Token[]} commentGroup A group of comments, containing either multiple line comments or a single block comment. + * @returns {boolean} Whether or not the comment group is in JSDoc form. + */ + function isJSDocComment([firstComment]) { + if (firstComment.type !== "Block") { + return false; + } + + const lines = firstComment.value.split(astUtils.LINEBREAK_MATCHER); + + return /^\*\s*$/u.test(lines[0]) && + lines.slice(1, -1).every(line => /^\s* /u.test(line)) && + /^\s*$/u.test(lines[lines.length - 1]); + } + + /** + * Processes a comment group that is currently in separate-line form, calculating the offset for each line. + * @param {Token[]} commentGroup A group of comments containing multiple line comments. + * @returns {string[]} An array of the processed lines. + */ + function processSeparateLineComments(commentGroup) { + const allLinesHaveLeadingSpace = commentGroup + .map(({ value }) => value) + .filter(line => line.trim().length) + .every(line => line.startsWith(" ")); + + return commentGroup.map(({ value }) => (allLinesHaveLeadingSpace ? value.replace(/^ /u, "") : value)); + } + + /** + * Processes a comment group that is currently in starred-block form, calculating the offset for each line. + * @param {Token} comment A single block comment token in starred-block form. + * @returns {string[]} An array of the processed lines. + */ + function processStarredBlockComment(comment) { + const lines = comment.value.split(astUtils.LINEBREAK_MATCHER) + .filter((line, i, linesArr) => !(i === 0 || i === linesArr.length - 1)) + .map(line => line.replace(/^\s*$/u, "")); + const allLinesHaveLeadingSpace = lines + .map(line => line.replace(/\s*\*/u, "")) + .filter(line => line.trim().length) + .every(line => line.startsWith(" ")); + + return lines.map(line => line.replace(allLinesHaveLeadingSpace ? /\s*\* ?/u : /\s*\*/u, "")); + } + + /** + * Processes a comment group that is currently in bare-block form, calculating the offset for each line. + * @param {Token} comment A single block comment token in bare-block form. + * @returns {string[]} An array of the processed lines. + */ + function processBareBlockComment(comment) { + const lines = comment.value.split(astUtils.LINEBREAK_MATCHER).map(line => line.replace(/^\s*$/u, "")); + const leadingWhitespace = `${sourceCode.text.slice(comment.range[0] - comment.loc.start.column, comment.range[0])} `; + let offset = ""; + + /* + * Calculate the offset of the least indented line and use that as the basis for offsetting all the lines. + * The first line should not be checked because it is inline with the opening block comment delimiter. + */ + for (const [i, line] of lines.entries()) { + if (!line.trim().length || i === 0) { + continue; + } + + const [, lineOffset] = line.match(/^(\s*\*?\s*)/u); + + if (lineOffset.length < leadingWhitespace.length) { + const newOffset = leadingWhitespace.slice(lineOffset.length - leadingWhitespace.length); + + if (newOffset.length > offset.length) { + offset = newOffset; + } + } + } + + return lines.map(line => { + const match = line.match(/^(\s*\*?\s*)(.*)/u); + const [, lineOffset, lineContents] = match; + + if (lineOffset.length > leadingWhitespace.length) { + return `${lineOffset.slice(leadingWhitespace.length - (offset.length + lineOffset.length))}${lineContents}`; + } + + if (lineOffset.length < leadingWhitespace.length) { + return `${lineOffset.slice(leadingWhitespace.length)}${lineContents}`; + } + + return lineContents; + }); + } + + /** + * Gets a list of comment lines in a group, formatting leading whitespace as necessary. + * @param {Token[]} commentGroup A group of comments containing either multiple line comments or a single block comment. + * @returns {string[]} A list of comment lines. + */ + function getCommentLines(commentGroup) { + const [firstComment] = commentGroup; + + if (firstComment.type === "Line") { + return processSeparateLineComments(commentGroup); + } + + if (isStarredBlockComment(commentGroup)) { + return processStarredBlockComment(firstComment); + } + + return processBareBlockComment(firstComment); + } + + /** + * Gets the initial offset (whitespace) from the beginning of a line to a given comment token. + * @param {Token} comment The token to check. + * @returns {string} The offset from the beginning of a line to the token. + */ + function getInitialOffset(comment) { + return sourceCode.text.slice(comment.range[0] - comment.loc.start.column, comment.range[0]); + } + + /** + * Converts a comment into starred-block form + * @param {Token} firstComment The first comment of the group being converted + * @param {string[]} commentLinesList A list of lines to appear in the new starred-block comment + * @returns {string} A representation of the comment value in starred-block form, excluding start and end markers + */ + function convertToStarredBlock(firstComment, commentLinesList) { + const initialOffset = getInitialOffset(firstComment); + + return `/*\n${commentLinesList.map(line => `${initialOffset} * ${line}`).join("\n")}\n${initialOffset} */`; + } + + /** + * Converts a comment into separate-line form + * @param {Token} firstComment The first comment of the group being converted + * @param {string[]} commentLinesList A list of lines to appear in the new starred-block comment + * @returns {string} A representation of the comment value in separate-line form + */ + function convertToSeparateLines(firstComment, commentLinesList) { + return commentLinesList.map(line => `// ${line}`).join(`\n${getInitialOffset(firstComment)}`); + } + + /** + * Converts a comment into bare-block form + * @param {Token} firstComment The first comment of the group being converted + * @param {string[]} commentLinesList A list of lines to appear in the new starred-block comment + * @returns {string} A representation of the comment value in bare-block form + */ + function convertToBlock(firstComment, commentLinesList) { + return `/* ${commentLinesList.join(`\n${getInitialOffset(firstComment)} `)} */`; + } + + /** + * Each method checks a group of comments to see if it's valid according to the given option. + * @param {Token[]} commentGroup A list of comments that appear together. This will either contain a single + * block comment or multiple line comments. + * @returns {void} + */ + const commentGroupCheckers = { + "starred-block"(commentGroup) { + const [firstComment] = commentGroup; + const commentLines = getCommentLines(commentGroup); + + if (commentLines.some(value => value.includes("*/"))) { + return; + } + + if (commentGroup.length > 1) { + context.report({ + loc: { + start: firstComment.loc.start, + end: commentGroup[commentGroup.length - 1].loc.end + }, + messageId: "expectedBlock", + fix(fixer) { + const range = [firstComment.range[0], commentGroup[commentGroup.length - 1].range[1]]; + + return commentLines.some(value => value.startsWith("/")) + ? null + : fixer.replaceTextRange(range, convertToStarredBlock(firstComment, commentLines)); + } + }); + } else { + const lines = firstComment.value.split(astUtils.LINEBREAK_MATCHER); + const expectedLeadingWhitespace = getInitialOffset(firstComment); + const expectedLinePrefix = `${expectedLeadingWhitespace} *`; + + if (!/^\*?\s*$/u.test(lines[0])) { + const start = firstComment.value.startsWith("*") ? firstComment.range[0] + 1 : firstComment.range[0]; + + context.report({ + loc: { + start: firstComment.loc.start, + end: { line: firstComment.loc.start.line, column: firstComment.loc.start.column + 2 } + }, + messageId: "startNewline", + fix: fixer => fixer.insertTextAfterRange([start, start + 2], `\n${expectedLinePrefix}`) + }); + } + + if (!/^\s*$/u.test(lines[lines.length - 1])) { + context.report({ + loc: { + start: { line: firstComment.loc.end.line, column: firstComment.loc.end.column - 2 }, + end: firstComment.loc.end + }, + messageId: "endNewline", + fix: fixer => fixer.replaceTextRange([firstComment.range[1] - 2, firstComment.range[1]], `\n${expectedLinePrefix}/`) + }); + } + + for (let lineNumber = firstComment.loc.start.line + 1; lineNumber <= firstComment.loc.end.line; lineNumber++) { + const lineText = sourceCode.lines[lineNumber - 1]; + const errorType = isStarredCommentLine(lineText) + ? "alignment" + : "missingStar"; + + if (!lineText.startsWith(expectedLinePrefix)) { + context.report({ + loc: { + start: { line: lineNumber, column: 0 }, + end: { line: lineNumber, column: lineText.length } + }, + messageId: errorType, + fix(fixer) { + const lineStartIndex = sourceCode.getIndexFromLoc({ line: lineNumber, column: 0 }); + + if (errorType === "alignment") { + const [, commentTextPrefix = ""] = lineText.match(/^(\s*\*)/u) || []; + const commentTextStartIndex = lineStartIndex + commentTextPrefix.length; + + return fixer.replaceTextRange([lineStartIndex, commentTextStartIndex], expectedLinePrefix); + } + + const [, commentTextPrefix = ""] = lineText.match(/^(\s*)/u) || []; + const commentTextStartIndex = lineStartIndex + commentTextPrefix.length; + let offset; + + for (const [idx, line] of lines.entries()) { + if (!/\S+/u.test(line)) { + continue; + } + + const lineTextToAlignWith = sourceCode.lines[firstComment.loc.start.line - 1 + idx]; + const [, prefix = "", initialOffset = ""] = lineTextToAlignWith.match(/^(\s*(?:\/?\*)?(\s*))/u) || []; + + offset = `${commentTextPrefix.slice(prefix.length)}${initialOffset}`; + + if (/^\s*\//u.test(lineText) && offset.length === 0) { + offset += " "; + } + break; + } + + return fixer.replaceTextRange([lineStartIndex, commentTextStartIndex], `${expectedLinePrefix}${offset}`); + } + }); + } + } + } + }, + "separate-lines"(commentGroup) { + const [firstComment] = commentGroup; + + if (firstComment.type !== "Block" || isJSDocComment(commentGroup)) { + return; + } + + const commentLines = getCommentLines(commentGroup); + const tokenAfter = sourceCode.getTokenAfter(firstComment, { includeComments: true }); + + if (tokenAfter && firstComment.loc.end.line === tokenAfter.loc.start.line) { + return; + } + + context.report({ + loc: { + start: firstComment.loc.start, + end: { line: firstComment.loc.start.line, column: firstComment.loc.start.column + 2 } + }, + messageId: "expectedLines", + fix(fixer) { + return fixer.replaceText(firstComment, convertToSeparateLines(firstComment, commentLines)); + } + }); + }, + "bare-block"(commentGroup) { + if (isJSDocComment(commentGroup)) { + return; + } + + const [firstComment] = commentGroup; + const commentLines = getCommentLines(commentGroup); + + // Disallows consecutive line comments in favor of using a block comment. + if (firstComment.type === "Line" && commentLines.length > 1 && + !commentLines.some(value => value.includes("*/"))) { + context.report({ + loc: { + start: firstComment.loc.start, + end: commentGroup[commentGroup.length - 1].loc.end + }, + messageId: "expectedBlock", + fix(fixer) { + return fixer.replaceTextRange( + [firstComment.range[0], commentGroup[commentGroup.length - 1].range[1]], + convertToBlock(firstComment, commentLines) + ); + } + }); + } + + // Prohibits block comments from having a * at the beginning of each line. + if (isStarredBlockComment(commentGroup)) { + context.report({ + loc: { + start: firstComment.loc.start, + end: { line: firstComment.loc.start.line, column: firstComment.loc.start.column + 2 } + }, + messageId: "expectedBareBlock", + fix(fixer) { + return fixer.replaceText(firstComment, convertToBlock(firstComment, commentLines)); + } + }); + } + } + }; + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + Program() { + return sourceCode.getAllComments() + .filter(comment => comment.type !== "Shebang") + .filter(comment => !astUtils.COMMENTS_IGNORE_PATTERN.test(comment.value)) + .filter(comment => { + const tokenBefore = sourceCode.getTokenBefore(comment, { includeComments: true }); + + return !tokenBefore || tokenBefore.loc.end.line < comment.loc.start.line; + }) + .reduce((commentGroups, comment, index, commentList) => { + const tokenBefore = sourceCode.getTokenBefore(comment, { includeComments: true }); + + if ( + comment.type === "Line" && + index && commentList[index - 1].type === "Line" && + tokenBefore && tokenBefore.loc.end.line === comment.loc.start.line - 1 && + tokenBefore === commentList[index - 1] + ) { + commentGroups[commentGroups.length - 1].push(comment); + } else { + commentGroups.push([comment]); + } + + return commentGroups; + }, []) + .filter(commentGroup => !(commentGroup.length === 1 && commentGroup[0].loc.start.line === commentGroup[0].loc.end.line)) + .forEach(commentGroupCheckers[option]); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/multiline-ternary.js b/node_modules/eslint/lib/rules/multiline-ternary.js new file mode 100644 index 000000000..6668bff48 --- /dev/null +++ b/node_modules/eslint/lib/rules/multiline-ternary.js @@ -0,0 +1,114 @@ +/** + * @fileoverview Enforce newlines between operands of ternary expressions + * @author Kai Cataldo + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce newlines between operands of ternary expressions", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/multiline-ternary" + }, + + schema: [ + { + enum: ["always", "always-multiline", "never"] + } + ], + messages: { + expectedTestCons: "Expected newline between test and consequent of ternary expression.", + expectedConsAlt: "Expected newline between consequent and alternate of ternary expression.", + unexpectedTestCons: "Unexpected newline between test and consequent of ternary expression.", + unexpectedConsAlt: "Unexpected newline between consequent and alternate of ternary expression." + } + }, + + create(context) { + const option = context.options[0]; + const multiline = option !== "never"; + const allowSingleLine = option === "always-multiline"; + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ConditionalExpression(node) { + const questionToken = sourceCode.getTokenAfter(node.test, astUtils.isNotClosingParenToken); + const colonToken = sourceCode.getTokenAfter(node.consequent, astUtils.isNotClosingParenToken); + + const firstTokenOfTest = sourceCode.getFirstToken(node); + const lastTokenOfTest = sourceCode.getTokenBefore(questionToken); + const firstTokenOfConsequent = sourceCode.getTokenAfter(questionToken); + const lastTokenOfConsequent = sourceCode.getTokenBefore(colonToken); + const firstTokenOfAlternate = sourceCode.getTokenAfter(colonToken); + + const areTestAndConsequentOnSameLine = astUtils.isTokenOnSameLine(lastTokenOfTest, firstTokenOfConsequent); + const areConsequentAndAlternateOnSameLine = astUtils.isTokenOnSameLine(lastTokenOfConsequent, firstTokenOfAlternate); + + if (!multiline) { + if (!areTestAndConsequentOnSameLine) { + context.report({ + node: node.test, + loc: { + start: firstTokenOfTest.loc.start, + end: lastTokenOfTest.loc.end + }, + messageId: "unexpectedTestCons" + }); + } + + if (!areConsequentAndAlternateOnSameLine) { + context.report({ + node: node.consequent, + loc: { + start: firstTokenOfConsequent.loc.start, + end: lastTokenOfConsequent.loc.end + }, + messageId: "unexpectedConsAlt" + }); + } + } else { + if (allowSingleLine && node.loc.start.line === node.loc.end.line) { + return; + } + + if (areTestAndConsequentOnSameLine) { + context.report({ + node: node.test, + loc: { + start: firstTokenOfTest.loc.start, + end: lastTokenOfTest.loc.end + }, + messageId: "expectedTestCons" + }); + } + + if (areConsequentAndAlternateOnSameLine) { + context.report({ + node: node.consequent, + loc: { + start: firstTokenOfConsequent.loc.start, + end: lastTokenOfConsequent.loc.end + }, + messageId: "expectedConsAlt" + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/new-cap.js b/node_modules/eslint/lib/rules/new-cap.js new file mode 100644 index 000000000..4249a5428 --- /dev/null +++ b/node_modules/eslint/lib/rules/new-cap.js @@ -0,0 +1,275 @@ +/** + * @fileoverview Rule to flag use of constructors without capital letters + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const CAPS_ALLOWED = [ + "Array", + "Boolean", + "Date", + "Error", + "Function", + "Number", + "Object", + "RegExp", + "String", + "Symbol", + "BigInt" +]; + +/** + * Ensure that if the key is provided, it must be an array. + * @param {Object} obj Object to check with `key`. + * @param {string} key Object key to check on `obj`. + * @param {*} fallback If obj[key] is not present, this will be returned. + * @returns {string[]} Returns obj[key] if it's an Array, otherwise `fallback` + */ +function checkArray(obj, key, fallback) { + + /* istanbul ignore if */ + if (Object.prototype.hasOwnProperty.call(obj, key) && !Array.isArray(obj[key])) { + throw new TypeError(`${key}, if provided, must be an Array`); + } + return obj[key] || fallback; +} + +/** + * A reducer function to invert an array to an Object mapping the string form of the key, to `true`. + * @param {Object} map Accumulator object for the reduce. + * @param {string} key Object key to set to `true`. + * @returns {Object} Returns the updated Object for further reduction. + */ +function invert(map, key) { + map[key] = true; + return map; +} + +/** + * Creates an object with the cap is new exceptions as its keys and true as their values. + * @param {Object} config Rule configuration + * @returns {Object} Object with cap is new exceptions. + */ +function calculateCapIsNewExceptions(config) { + let capIsNewExceptions = checkArray(config, "capIsNewExceptions", CAPS_ALLOWED); + + if (capIsNewExceptions !== CAPS_ALLOWED) { + capIsNewExceptions = capIsNewExceptions.concat(CAPS_ALLOWED); + } + + return capIsNewExceptions.reduce(invert, {}); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require constructor names to begin with a capital letter", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/new-cap" + }, + + schema: [ + { + type: "object", + properties: { + newIsCap: { + type: "boolean", + default: true + }, + capIsNew: { + type: "boolean", + default: true + }, + newIsCapExceptions: { + type: "array", + items: { + type: "string" + } + }, + newIsCapExceptionPattern: { + type: "string" + }, + capIsNewExceptions: { + type: "array", + items: { + type: "string" + } + }, + capIsNewExceptionPattern: { + type: "string" + }, + properties: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + messages: { + upper: "A function with a name starting with an uppercase letter should only be used as a constructor.", + lower: "A constructor name should not start with a lowercase letter." + } + }, + + create(context) { + + const config = Object.assign({}, context.options[0]); + + config.newIsCap = config.newIsCap !== false; + config.capIsNew = config.capIsNew !== false; + const skipProperties = config.properties === false; + + const newIsCapExceptions = checkArray(config, "newIsCapExceptions", []).reduce(invert, {}); + const newIsCapExceptionPattern = config.newIsCapExceptionPattern ? new RegExp(config.newIsCapExceptionPattern, "u") : null; + + const capIsNewExceptions = calculateCapIsNewExceptions(config); + const capIsNewExceptionPattern = config.capIsNewExceptionPattern ? new RegExp(config.capIsNewExceptionPattern, "u") : null; + + const listeners = {}; + + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Get exact callee name from expression + * @param {ASTNode} node CallExpression or NewExpression node + * @returns {string} name + */ + function extractNameFromExpression(node) { + return node.callee.type === "Identifier" + ? node.callee.name + : astUtils.getStaticPropertyName(node.callee) || ""; + } + + /** + * Returns the capitalization state of the string - + * Whether the first character is uppercase, lowercase, or non-alphabetic + * @param {string} str String + * @returns {string} capitalization state: "non-alpha", "lower", or "upper" + */ + function getCap(str) { + const firstChar = str.charAt(0); + + const firstCharLower = firstChar.toLowerCase(); + const firstCharUpper = firstChar.toUpperCase(); + + if (firstCharLower === firstCharUpper) { + + // char has no uppercase variant, so it's non-alphabetic + return "non-alpha"; + } + if (firstChar === firstCharLower) { + return "lower"; + } + return "upper"; + + } + + /** + * Check if capitalization is allowed for a CallExpression + * @param {Object} allowedMap Object mapping calleeName to a Boolean + * @param {ASTNode} node CallExpression node + * @param {string} calleeName Capitalized callee name from a CallExpression + * @param {Object} pattern RegExp object from options pattern + * @returns {boolean} Returns true if the callee may be capitalized + */ + function isCapAllowed(allowedMap, node, calleeName, pattern) { + const sourceText = sourceCode.getText(node.callee); + + if (allowedMap[calleeName] || allowedMap[sourceText]) { + return true; + } + + if (pattern && pattern.test(sourceText)) { + return true; + } + + const callee = astUtils.skipChainExpression(node.callee); + + if (calleeName === "UTC" && callee.type === "MemberExpression") { + + // allow if callee is Date.UTC + return callee.object.type === "Identifier" && + callee.object.name === "Date"; + } + + return skipProperties && callee.type === "MemberExpression"; + } + + /** + * Reports the given messageId for the given node. The location will be the start of the property or the callee. + * @param {ASTNode} node CallExpression or NewExpression node. + * @param {string} messageId The messageId to report. + * @returns {void} + */ + function report(node, messageId) { + let callee = astUtils.skipChainExpression(node.callee); + + if (callee.type === "MemberExpression") { + callee = callee.property; + } + + context.report({ node, loc: callee.loc, messageId }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + if (config.newIsCap) { + listeners.NewExpression = function(node) { + + const constructorName = extractNameFromExpression(node); + + if (constructorName) { + const capitalization = getCap(constructorName); + const isAllowed = capitalization !== "lower" || isCapAllowed(newIsCapExceptions, node, constructorName, newIsCapExceptionPattern); + + if (!isAllowed) { + report(node, "lower"); + } + } + }; + } + + if (config.capIsNew) { + listeners.CallExpression = function(node) { + + const calleeName = extractNameFromExpression(node); + + if (calleeName) { + const capitalization = getCap(calleeName); + const isAllowed = capitalization !== "upper" || isCapAllowed(capIsNewExceptions, node, calleeName, capIsNewExceptionPattern); + + if (!isAllowed) { + report(node, "upper"); + } + } + }; + } + + return listeners; + } +}; diff --git a/node_modules/eslint/lib/rules/new-parens.js b/node_modules/eslint/lib/rules/new-parens.js new file mode 100644 index 000000000..405ec1b51 --- /dev/null +++ b/node_modules/eslint/lib/rules/new-parens.js @@ -0,0 +1,99 @@ +/** + * @fileoverview Rule to flag when using constructor without parentheses + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce or disallow parentheses when invoking a constructor with no arguments", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/new-parens" + }, + + fixable: "code", + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["always", "never"] + } + ], + minItems: 0, + maxItems: 1 + } + ] + }, + messages: { + missing: "Missing '()' invoking a constructor.", + unnecessary: "Unnecessary '()' invoking a constructor with no arguments." + } + }, + + create(context) { + const options = context.options; + const always = options[0] !== "never"; // Default is always + + const sourceCode = context.getSourceCode(); + + return { + NewExpression(node) { + if (node.arguments.length !== 0) { + return; // if there are arguments, there have to be parens + } + + const lastToken = sourceCode.getLastToken(node); + const hasLastParen = lastToken && astUtils.isClosingParenToken(lastToken); + + // `hasParens` is true only if the new expression ends with its own parens, e.g., new new foo() does not end with its own parens + const hasParens = hasLastParen && + astUtils.isOpeningParenToken(sourceCode.getTokenBefore(lastToken)) && + node.callee.range[1] < node.range[1]; + + if (always) { + if (!hasParens) { + context.report({ + node, + messageId: "missing", + fix: fixer => fixer.insertTextAfter(node, "()") + }); + } + } else { + if (hasParens) { + context.report({ + node, + messageId: "unnecessary", + fix: fixer => [ + fixer.remove(sourceCode.getTokenBefore(lastToken)), + fixer.remove(lastToken), + fixer.insertTextBefore(node, "("), + fixer.insertTextAfter(node, ")") + ] + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/newline-after-var.js b/node_modules/eslint/lib/rules/newline-after-var.js new file mode 100644 index 000000000..4809d9bfc --- /dev/null +++ b/node_modules/eslint/lib/rules/newline-after-var.js @@ -0,0 +1,255 @@ +/** + * @fileoverview Rule to check empty newline after "var" statement + * @author Gopal Venkatesan + * @deprecated + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow an empty line after variable declarations", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/newline-after-var" + }, + schema: [ + { + enum: ["never", "always"] + } + ], + fixable: "whitespace", + messages: { + expected: "Expected blank line after variable declarations.", + unexpected: "Unexpected blank line after variable declarations." + }, + + deprecated: true, + + replacedBy: ["padding-line-between-statements"] + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + // Default `mode` to "always". + const mode = context.options[0] === "never" ? "never" : "always"; + + // Cache starting and ending line numbers of comments for faster lookup + const commentEndLine = sourceCode.getAllComments().reduce((result, token) => { + result[token.loc.start.line] = token.loc.end.line; + return result; + }, {}); + + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Gets a token from the given node to compare line to the next statement. + * + * In general, the token is the last token of the node. However, the token is the second last token if the following conditions satisfy. + * + * - The last token is semicolon. + * - The semicolon is on a different line from the previous token of the semicolon. + * + * This behavior would address semicolon-less style code. e.g.: + * + * var foo = 1 + * + * ;(a || b).doSomething() + * @param {ASTNode} node The node to get. + * @returns {Token} The token to compare line to the next statement. + */ + function getLastToken(node) { + const lastToken = sourceCode.getLastToken(node); + + if (lastToken.type === "Punctuator" && lastToken.value === ";") { + const prevToken = sourceCode.getTokenBefore(lastToken); + + if (prevToken.loc.end.line !== lastToken.loc.start.line) { + return prevToken; + } + } + + return lastToken; + } + + /** + * Determine if provided keyword is a variable declaration + * @private + * @param {string} keyword keyword to test + * @returns {boolean} True if `keyword` is a type of var + */ + function isVar(keyword) { + return keyword === "var" || keyword === "let" || keyword === "const"; + } + + /** + * Determine if provided keyword is a variant of for specifiers + * @private + * @param {string} keyword keyword to test + * @returns {boolean} True if `keyword` is a variant of for specifier + */ + function isForTypeSpecifier(keyword) { + return keyword === "ForStatement" || keyword === "ForInStatement" || keyword === "ForOfStatement"; + } + + /** + * Determine if provided keyword is an export specifiers + * @private + * @param {string} nodeType nodeType to test + * @returns {boolean} True if `nodeType` is an export specifier + */ + function isExportSpecifier(nodeType) { + return nodeType === "ExportNamedDeclaration" || nodeType === "ExportSpecifier" || + nodeType === "ExportDefaultDeclaration" || nodeType === "ExportAllDeclaration"; + } + + /** + * Determine if provided node is the last of their parent block. + * @private + * @param {ASTNode} node node to test + * @returns {boolean} True if `node` is last of their parent block. + */ + function isLastNode(node) { + const token = sourceCode.getTokenAfter(node); + + return !token || (token.type === "Punctuator" && token.value === "}"); + } + + /** + * Gets the last line of a group of consecutive comments + * @param {number} commentStartLine The starting line of the group + * @returns {number} The number of the last comment line of the group + */ + function getLastCommentLineOfBlock(commentStartLine) { + const currentCommentEnd = commentEndLine[commentStartLine]; + + return commentEndLine[currentCommentEnd + 1] ? getLastCommentLineOfBlock(currentCommentEnd + 1) : currentCommentEnd; + } + + /** + * Determine if a token starts more than one line after a comment ends + * @param {token} token The token being checked + * @param {integer} commentStartLine The line number on which the comment starts + * @returns {boolean} True if `token` does not start immediately after a comment + */ + function hasBlankLineAfterComment(token, commentStartLine) { + return token.loc.start.line > getLastCommentLineOfBlock(commentStartLine) + 1; + } + + /** + * Checks that a blank line exists after a variable declaration when mode is + * set to "always", or checks that there is no blank line when mode is set + * to "never" + * @private + * @param {ASTNode} node `VariableDeclaration` node to test + * @returns {void} + */ + function checkForBlankLine(node) { + + /* + * lastToken is the last token on the node's line. It will usually also be the last token of the node, but it will + * sometimes be second-last if there is a semicolon on a different line. + */ + const lastToken = getLastToken(node), + + /* + * If lastToken is the last token of the node, nextToken should be the token after the node. Otherwise, nextToken + * is the last token of the node. + */ + nextToken = lastToken === sourceCode.getLastToken(node) ? sourceCode.getTokenAfter(node) : sourceCode.getLastToken(node), + nextLineNum = lastToken.loc.end.line + 1; + + // Ignore if there is no following statement + if (!nextToken) { + return; + } + + // Ignore if parent of node is a for variant + if (isForTypeSpecifier(node.parent.type)) { + return; + } + + // Ignore if parent of node is an export specifier + if (isExportSpecifier(node.parent.type)) { + return; + } + + /* + * Some coding styles use multiple `var` statements, so do nothing if + * the next token is a `var` statement. + */ + if (nextToken.type === "Keyword" && isVar(nextToken.value)) { + return; + } + + // Ignore if it is last statement in a block + if (isLastNode(node)) { + return; + } + + // Next statement is not a `var`... + const noNextLineToken = nextToken.loc.start.line > nextLineNum; + const hasNextLineComment = (typeof commentEndLine[nextLineNum] !== "undefined"); + + if (mode === "never" && noNextLineToken && !hasNextLineComment) { + context.report({ + node, + messageId: "unexpected", + data: { identifier: node.name }, + fix(fixer) { + const linesBetween = sourceCode.getText().slice(lastToken.range[1], nextToken.range[0]).split(astUtils.LINEBREAK_MATCHER); + + return fixer.replaceTextRange([lastToken.range[1], nextToken.range[0]], `${linesBetween.slice(0, -1).join("")}\n${linesBetween[linesBetween.length - 1]}`); + } + }); + } + + // Token on the next line, or comment without blank line + if ( + mode === "always" && ( + !noNextLineToken || + hasNextLineComment && !hasBlankLineAfterComment(nextToken, nextLineNum) + ) + ) { + context.report({ + node, + messageId: "expected", + data: { identifier: node.name }, + fix(fixer) { + if ((noNextLineToken ? getLastCommentLineOfBlock(nextLineNum) : lastToken.loc.end.line) === nextToken.loc.start.line) { + return fixer.insertTextBefore(nextToken, "\n\n"); + } + + return fixer.insertTextBeforeRange([nextToken.range[0] - nextToken.loc.start.column, nextToken.range[1]], "\n"); + } + }); + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + VariableDeclaration: checkForBlankLine + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/newline-before-return.js b/node_modules/eslint/lib/rules/newline-before-return.js new file mode 100644 index 000000000..65ca32321 --- /dev/null +++ b/node_modules/eslint/lib/rules/newline-before-return.js @@ -0,0 +1,217 @@ +/** + * @fileoverview Rule to require newlines before `return` statement + * @author Kai Cataldo + * @deprecated + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require an empty line before `return` statements", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/newline-before-return" + }, + + fixable: "whitespace", + schema: [], + messages: { + expected: "Expected newline before return statement." + }, + + deprecated: true, + replacedBy: ["padding-line-between-statements"] + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Tests whether node is preceded by supplied tokens + * @param {ASTNode} node node to check + * @param {Array} testTokens array of tokens to test against + * @returns {boolean} Whether or not the node is preceded by one of the supplied tokens + * @private + */ + function isPrecededByTokens(node, testTokens) { + const tokenBefore = sourceCode.getTokenBefore(node); + + return testTokens.some(token => tokenBefore.value === token); + } + + /** + * Checks whether node is the first node after statement or in block + * @param {ASTNode} node node to check + * @returns {boolean} Whether or not the node is the first node after statement or in block + * @private + */ + function isFirstNode(node) { + const parentType = node.parent.type; + + if (node.parent.body) { + return Array.isArray(node.parent.body) + ? node.parent.body[0] === node + : node.parent.body === node; + } + + if (parentType === "IfStatement") { + return isPrecededByTokens(node, ["else", ")"]); + } + if (parentType === "DoWhileStatement") { + return isPrecededByTokens(node, ["do"]); + } + if (parentType === "SwitchCase") { + return isPrecededByTokens(node, [":"]); + } + return isPrecededByTokens(node, [")"]); + + } + + /** + * Returns the number of lines of comments that precede the node + * @param {ASTNode} node node to check for overlapping comments + * @param {number} lineNumTokenBefore line number of previous token, to check for overlapping comments + * @returns {number} Number of lines of comments that precede the node + * @private + */ + function calcCommentLines(node, lineNumTokenBefore) { + const comments = sourceCode.getCommentsBefore(node); + let numLinesComments = 0; + + if (!comments.length) { + return numLinesComments; + } + + comments.forEach(comment => { + numLinesComments++; + + if (comment.type === "Block") { + numLinesComments += comment.loc.end.line - comment.loc.start.line; + } + + // avoid counting lines with inline comments twice + if (comment.loc.start.line === lineNumTokenBefore) { + numLinesComments--; + } + + if (comment.loc.end.line === node.loc.start.line) { + numLinesComments--; + } + }); + + return numLinesComments; + } + + /** + * Returns the line number of the token before the node that is passed in as an argument + * @param {ASTNode} node The node to use as the start of the calculation + * @returns {number} Line number of the token before `node` + * @private + */ + function getLineNumberOfTokenBefore(node) { + const tokenBefore = sourceCode.getTokenBefore(node); + let lineNumTokenBefore; + + /** + * Global return (at the beginning of a script) is a special case. + * If there is no token before `return`, then we expect no line + * break before the return. Comments are allowed to occupy lines + * before the global return, just no blank lines. + * Setting lineNumTokenBefore to zero in that case results in the + * desired behavior. + */ + if (tokenBefore) { + lineNumTokenBefore = tokenBefore.loc.end.line; + } else { + lineNumTokenBefore = 0; // global return at beginning of script + } + + return lineNumTokenBefore; + } + + /** + * Checks whether node is preceded by a newline + * @param {ASTNode} node node to check + * @returns {boolean} Whether or not the node is preceded by a newline + * @private + */ + function hasNewlineBefore(node) { + const lineNumNode = node.loc.start.line; + const lineNumTokenBefore = getLineNumberOfTokenBefore(node); + const commentLines = calcCommentLines(node, lineNumTokenBefore); + + return (lineNumNode - lineNumTokenBefore - commentLines) > 1; + } + + /** + * Checks whether it is safe to apply a fix to a given return statement. + * + * The fix is not considered safe if the given return statement has leading comments, + * as we cannot safely determine if the newline should be added before or after the comments. + * For more information, see: https://github.com/eslint/eslint/issues/5958#issuecomment-222767211 + * @param {ASTNode} node The return statement node to check. + * @returns {boolean} `true` if it can fix the node. + * @private + */ + function canFix(node) { + const leadingComments = sourceCode.getCommentsBefore(node); + const lastLeadingComment = leadingComments[leadingComments.length - 1]; + const tokenBefore = sourceCode.getTokenBefore(node); + + if (leadingComments.length === 0) { + return true; + } + + /* + * if the last leading comment ends in the same line as the previous token and + * does not share a line with the `return` node, we can consider it safe to fix. + * Example: + * function a() { + * var b; //comment + * return; + * } + */ + if (lastLeadingComment.loc.end.line === tokenBefore.loc.end.line && + lastLeadingComment.loc.end.line !== node.loc.start.line) { + return true; + } + + return false; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ReturnStatement(node) { + if (!isFirstNode(node) && !hasNewlineBefore(node)) { + context.report({ + node, + messageId: "expected", + fix(fixer) { + if (canFix(node)) { + const tokenBefore = sourceCode.getTokenBefore(node); + const newlines = node.loc.start.line === tokenBefore.loc.end.line ? "\n\n" : "\n"; + + return fixer.insertTextBefore(node, newlines); + } + return null; + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/newline-per-chained-call.js b/node_modules/eslint/lib/rules/newline-per-chained-call.js new file mode 100644 index 000000000..46c9d6c10 --- /dev/null +++ b/node_modules/eslint/lib/rules/newline-per-chained-call.js @@ -0,0 +1,123 @@ +/** + * @fileoverview Rule to ensure newline per method call when chaining calls + * @author Rajendra Patil + * @author Burak Yigit Kaya + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require a newline after each call in a method chain", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/newline-per-chained-call" + }, + + fixable: "whitespace", + + schema: [{ + type: "object", + properties: { + ignoreChainWithDepth: { + type: "integer", + minimum: 1, + maximum: 10, + default: 2 + } + }, + additionalProperties: false + }], + messages: { + expected: "Expected line break before `{{callee}}`." + } + }, + + create(context) { + + const options = context.options[0] || {}, + ignoreChainWithDepth = options.ignoreChainWithDepth || 2; + + const sourceCode = context.getSourceCode(); + + /** + * Get the prefix of a given MemberExpression node. + * If the MemberExpression node is a computed value it returns a + * left bracket. If not it returns a period. + * @param {ASTNode} node A MemberExpression node to get + * @returns {string} The prefix of the node. + */ + function getPrefix(node) { + if (node.computed) { + if (node.optional) { + return "?.["; + } + return "["; + } + if (node.optional) { + return "?."; + } + return "."; + } + + /** + * Gets the property text of a given MemberExpression node. + * If the text is multiline, this returns only the first line. + * @param {ASTNode} node A MemberExpression node to get. + * @returns {string} The property text of the node. + */ + function getPropertyText(node) { + const prefix = getPrefix(node); + const lines = sourceCode.getText(node.property).split(astUtils.LINEBREAK_MATCHER); + const suffix = node.computed && lines.length === 1 ? "]" : ""; + + return prefix + lines[0] + suffix; + } + + return { + "CallExpression:exit"(node) { + const callee = astUtils.skipChainExpression(node.callee); + + if (callee.type !== "MemberExpression") { + return; + } + + let parent = astUtils.skipChainExpression(callee.object); + let depth = 1; + + while (parent && parent.callee) { + depth += 1; + parent = astUtils.skipChainExpression(astUtils.skipChainExpression(parent.callee).object); + } + + if (depth > ignoreChainWithDepth && astUtils.isTokenOnSameLine(callee.object, callee.property)) { + const firstTokenAfterObject = sourceCode.getTokenAfter(callee.object, astUtils.isNotClosingParenToken); + + context.report({ + node: callee.property, + loc: { + start: firstTokenAfterObject.loc.start, + end: callee.loc.end + }, + messageId: "expected", + data: { + callee: getPropertyText(callee) + }, + fix(fixer) { + return fixer.insertTextBefore(firstTokenAfterObject, "\n"); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-alert.js b/node_modules/eslint/lib/rules/no-alert.js new file mode 100644 index 000000000..702b4d2ba --- /dev/null +++ b/node_modules/eslint/lib/rules/no-alert.js @@ -0,0 +1,136 @@ +/** + * @fileoverview Rule to flag use of alert, confirm, prompt + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { + getStaticPropertyName: getPropertyName, + getVariableByName, + skipChainExpression +} = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks if the given name is a prohibited identifier. + * @param {string} name The name to check + * @returns {boolean} Whether or not the name is prohibited. + */ +function isProhibitedIdentifier(name) { + return /^(alert|confirm|prompt)$/u.test(name); +} + +/** + * Finds the eslint-scope reference in the given scope. + * @param {Object} scope The scope to search. + * @param {ASTNode} node The identifier node. + * @returns {Reference|null} Returns the found reference or null if none were found. + */ +function findReference(scope, node) { + const references = scope.references.filter(reference => reference.identifier.range[0] === node.range[0] && + reference.identifier.range[1] === node.range[1]); + + if (references.length === 1) { + return references[0]; + } + return null; +} + +/** + * Checks if the given identifier node is shadowed in the given scope. + * @param {Object} scope The current scope. + * @param {string} node The identifier node to check + * @returns {boolean} Whether or not the name is shadowed. + */ +function isShadowed(scope, node) { + const reference = findReference(scope, node); + + return reference && reference.resolved && reference.resolved.defs.length > 0; +} + +/** + * Checks if the given identifier node is a ThisExpression in the global scope or the global window property. + * @param {Object} scope The current scope. + * @param {string} node The identifier node to check + * @returns {boolean} Whether or not the node is a reference to the global object. + */ +function isGlobalThisReferenceOrGlobalWindow(scope, node) { + if (scope.type === "global" && node.type === "ThisExpression") { + return true; + } + if ( + node.type === "Identifier" && + ( + node.name === "window" || + (node.name === "globalThis" && getVariableByName(scope, "globalThis")) + ) + ) { + return !isShadowed(scope, node); + } + + return false; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of `alert`, `confirm`, and `prompt`", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-alert" + }, + + schema: [], + + messages: { + unexpected: "Unexpected {{name}}." + } + }, + + create(context) { + return { + CallExpression(node) { + const callee = skipChainExpression(node.callee), + currentScope = context.getScope(); + + // without window. + if (callee.type === "Identifier") { + const name = callee.name; + + if (!isShadowed(currentScope, callee) && isProhibitedIdentifier(callee.name)) { + context.report({ + node, + messageId: "unexpected", + data: { name } + }); + } + + } else if (callee.type === "MemberExpression" && isGlobalThisReferenceOrGlobalWindow(currentScope, callee.object)) { + const name = getPropertyName(callee); + + if (isProhibitedIdentifier(name)) { + context.report({ + node, + messageId: "unexpected", + data: { name } + }); + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-array-constructor.js b/node_modules/eslint/lib/rules/no-array-constructor.js new file mode 100644 index 000000000..90c6d6bbd --- /dev/null +++ b/node_modules/eslint/lib/rules/no-array-constructor.js @@ -0,0 +1,54 @@ +/** + * @fileoverview Disallow construction of dense arrays using the Array constructor + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `Array` constructors", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-array-constructor" + }, + + schema: [], + + messages: { + preferLiteral: "The array literal notation [] is preferable." + } + }, + + create(context) { + + /** + * Disallow construction of dense arrays using the Array constructor + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function check(node) { + if ( + node.arguments.length !== 1 && + node.callee.type === "Identifier" && + node.callee.name === "Array" + ) { + context.report({ node, messageId: "preferLiteral" }); + } + } + + return { + CallExpression: check, + NewExpression: check + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-async-promise-executor.js b/node_modules/eslint/lib/rules/no-async-promise-executor.js new file mode 100644 index 000000000..553311e58 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-async-promise-executor.js @@ -0,0 +1,39 @@ +/** + * @fileoverview disallow using an async function as a Promise executor + * @author Teddy Katz + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow using an async function as a Promise executor", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-async-promise-executor" + }, + + fixable: null, + schema: [], + messages: { + async: "Promise executor functions should not be async." + } + }, + + create(context) { + return { + "NewExpression[callee.name='Promise'][arguments.0.async=true]"(node) { + context.report({ + node: context.getSourceCode().getFirstToken(node.arguments[0], token => token.value === "async"), + messageId: "async" + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-await-in-loop.js b/node_modules/eslint/lib/rules/no-await-in-loop.js new file mode 100644 index 000000000..9ca89866a --- /dev/null +++ b/node_modules/eslint/lib/rules/no-await-in-loop.js @@ -0,0 +1,106 @@ +/** + * @fileoverview Rule to disallow uses of await inside of loops. + * @author Nat Mote (nmote) + */ +"use strict"; + +/** + * Check whether it should stop traversing ancestors at the given node. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if it should stop traversing. + */ +function isBoundary(node) { + const t = node.type; + + return ( + t === "FunctionDeclaration" || + t === "FunctionExpression" || + t === "ArrowFunctionExpression" || + + /* + * Don't report the await expressions on for-await-of loop since it's + * asynchronous iteration intentionally. + */ + (t === "ForOfStatement" && node.await === true) + ); +} + +/** + * Check whether the given node is in loop. + * @param {ASTNode} node A node to check. + * @param {ASTNode} parent A parent node to check. + * @returns {boolean} `true` if the node is in loop. + */ +function isLooped(node, parent) { + switch (parent.type) { + case "ForStatement": + return ( + node === parent.test || + node === parent.update || + node === parent.body + ); + + case "ForOfStatement": + case "ForInStatement": + return node === parent.body; + + case "WhileStatement": + case "DoWhileStatement": + return node === parent.test || node === parent.body; + + default: + return false; + } +} + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow `await` inside of loops", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-await-in-loop" + }, + + schema: [], + + messages: { + unexpectedAwait: "Unexpected `await` inside a loop." + } + }, + create(context) { + + /** + * Validate an await expression. + * @param {ASTNode} awaitNode An AwaitExpression or ForOfStatement node to validate. + * @returns {void} + */ + function validate(awaitNode) { + if (awaitNode.type === "ForOfStatement" && !awaitNode.await) { + return; + } + + let node = awaitNode; + let parent = node.parent; + + while (parent && !isBoundary(parent)) { + if (isLooped(node, parent)) { + context.report({ + node: awaitNode, + messageId: "unexpectedAwait" + }); + return; + } + node = parent; + parent = parent.parent; + } + } + + return { + AwaitExpression: validate, + ForOfStatement: validate + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-bitwise.js b/node_modules/eslint/lib/rules/no-bitwise.js new file mode 100644 index 000000000..a9c3360a7 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-bitwise.js @@ -0,0 +1,119 @@ +/** + * @fileoverview Rule to flag bitwise identifiers + * @author Nicholas C. Zakas + */ + +"use strict"; + +/* + * + * Set of bitwise operators. + * + */ +const BITWISE_OPERATORS = [ + "^", "|", "&", "<<", ">>", ">>>", + "^=", "|=", "&=", "<<=", ">>=", ">>>=", + "~" +]; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow bitwise operators", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-bitwise" + }, + + schema: [ + { + type: "object", + properties: { + allow: { + type: "array", + items: { + enum: BITWISE_OPERATORS + }, + uniqueItems: true + }, + int32Hint: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "Unexpected use of '{{operator}}'." + } + }, + + create(context) { + const options = context.options[0] || {}; + const allowed = options.allow || []; + const int32Hint = options.int32Hint === true; + + /** + * Reports an unexpected use of a bitwise operator. + * @param {ASTNode} node Node which contains the bitwise operator. + * @returns {void} + */ + function report(node) { + context.report({ node, messageId: "unexpected", data: { operator: node.operator } }); + } + + /** + * Checks if the given node has a bitwise operator. + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether or not the node has a bitwise operator. + */ + function hasBitwiseOperator(node) { + return BITWISE_OPERATORS.indexOf(node.operator) !== -1; + } + + /** + * Checks if exceptions were provided, e.g. `{ allow: ['~', '|'] }`. + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether or not the node has a bitwise operator. + */ + function allowedOperator(node) { + return allowed.indexOf(node.operator) !== -1; + } + + /** + * Checks if the given bitwise operator is used for integer typecasting, i.e. "|0" + * @param {ASTNode} node The node to check. + * @returns {boolean} whether the node is used in integer typecasting. + */ + function isInt32Hint(node) { + return int32Hint && node.operator === "|" && node.right && + node.right.type === "Literal" && node.right.value === 0; + } + + /** + * Report if the given node contains a bitwise operator. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkNodeForBitwiseOperator(node) { + if (hasBitwiseOperator(node) && !allowedOperator(node) && !isInt32Hint(node)) { + report(node); + } + } + + return { + AssignmentExpression: checkNodeForBitwiseOperator, + BinaryExpression: checkNodeForBitwiseOperator, + UnaryExpression: checkNodeForBitwiseOperator + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-buffer-constructor.js b/node_modules/eslint/lib/rules/no-buffer-constructor.js new file mode 100644 index 000000000..152dda0ce --- /dev/null +++ b/node_modules/eslint/lib/rules/no-buffer-constructor.js @@ -0,0 +1,49 @@ +/** + * @fileoverview disallow use of the Buffer() constructor + * @author Teddy Katz + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "problem", + + docs: { + description: "disallow use of the `Buffer()` constructor", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/no-buffer-constructor" + }, + + schema: [], + + messages: { + deprecated: "{{expr}} is deprecated. Use Buffer.from(), Buffer.alloc(), or Buffer.allocUnsafe() instead." + } + }, + + create(context) { + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + "CallExpression[callee.name='Buffer'], NewExpression[callee.name='Buffer']"(node) { + context.report({ + node, + messageId: "deprecated", + data: { expr: node.type === "CallExpression" ? "Buffer()" : "new Buffer()" } + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-caller.js b/node_modules/eslint/lib/rules/no-caller.js new file mode 100644 index 000000000..5fe1bd449 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-caller.js @@ -0,0 +1,46 @@ +/** + * @fileoverview Rule to flag use of arguments.callee and arguments.caller. + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of `arguments.caller` or `arguments.callee`", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-caller" + }, + + schema: [], + + messages: { + unexpected: "Avoid arguments.{{prop}}." + } + }, + + create(context) { + + return { + + MemberExpression(node) { + const objectName = node.object.name, + propertyName = node.property.name; + + if (objectName === "arguments" && !node.computed && propertyName && propertyName.match(/^calle[er]$/u)) { + context.report({ node, messageId: "unexpected", data: { prop: propertyName } }); + } + + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-case-declarations.js b/node_modules/eslint/lib/rules/no-case-declarations.js new file mode 100644 index 000000000..1d54e2216 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-case-declarations.js @@ -0,0 +1,64 @@ +/** + * @fileoverview Rule to flag use of an lexical declarations inside a case clause + * @author Erik Arvidsson + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow lexical declarations in case clauses", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-case-declarations" + }, + + schema: [], + + messages: { + unexpected: "Unexpected lexical declaration in case block." + } + }, + + create(context) { + + /** + * Checks whether or not a node is a lexical declaration. + * @param {ASTNode} node A direct child statement of a switch case. + * @returns {boolean} Whether or not the node is a lexical declaration. + */ + function isLexicalDeclaration(node) { + switch (node.type) { + case "FunctionDeclaration": + case "ClassDeclaration": + return true; + case "VariableDeclaration": + return node.kind !== "var"; + default: + return false; + } + } + + return { + SwitchCase(node) { + for (let i = 0; i < node.consequent.length; i++) { + const statement = node.consequent[i]; + + if (isLexicalDeclaration(statement)) { + context.report({ + node: statement, + messageId: "unexpected" + }); + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-catch-shadow.js b/node_modules/eslint/lib/rules/no-catch-shadow.js new file mode 100644 index 000000000..4917af84e --- /dev/null +++ b/node_modules/eslint/lib/rules/no-catch-shadow.js @@ -0,0 +1,80 @@ +/** + * @fileoverview Rule to flag variable leak in CatchClauses in IE 8 and earlier + * @author Ian Christian Myers + * @deprecated in ESLint v5.1.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `catch` clause parameters from shadowing variables in the outer scope", + category: "Variables", + recommended: false, + url: "https://eslint.org/docs/rules/no-catch-shadow" + }, + + replacedBy: ["no-shadow"], + + deprecated: true, + schema: [], + + messages: { + mutable: "Value of '{{name}}' may be overwritten in IE 8 and earlier." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Check if the parameters are been shadowed + * @param {Object} scope current scope + * @param {string} name parameter name + * @returns {boolean} True is its been shadowed + */ + function paramIsShadowing(scope, name) { + return astUtils.getVariableByName(scope, name) !== null; + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + + "CatchClause[param!=null]"(node) { + let scope = context.getScope(); + + /* + * When ecmaVersion >= 6, CatchClause creates its own scope + * so start from one upper scope to exclude the current node + */ + if (scope.block === node) { + scope = scope.upper; + } + + if (paramIsShadowing(scope, node.param.name)) { + context.report({ node, messageId: "mutable", data: { name: node.param.name } }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-class-assign.js b/node_modules/eslint/lib/rules/no-class-assign.js new file mode 100644 index 000000000..887058ba0 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-class-assign.js @@ -0,0 +1,61 @@ +/** + * @fileoverview A rule to disallow modifying variables of class declarations + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow reassigning class members", + category: "ECMAScript 6", + recommended: true, + url: "https://eslint.org/docs/rules/no-class-assign" + }, + + schema: [], + + messages: { + class: "'{{name}}' is a class." + } + }, + + create(context) { + + /** + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + astUtils.getModifyingReferences(variable.references).forEach(reference => { + context.report({ node: reference.identifier, messageId: "class", data: { name: reference.identifier.name } }); + + }); + } + + /** + * Finds and reports references that are non initializer and writable. + * @param {ASTNode} node A ClassDeclaration/ClassExpression node to check. + * @returns {void} + */ + function checkForClass(node) { + context.getDeclaredVariables(node).forEach(checkVariable); + } + + return { + ClassDeclaration: checkForClass, + ClassExpression: checkForClass + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-compare-neg-zero.js b/node_modules/eslint/lib/rules/no-compare-neg-zero.js new file mode 100644 index 000000000..0c6865ad5 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-compare-neg-zero.js @@ -0,0 +1,60 @@ +/** + * @fileoverview The rule should warn against code that tries to compare against -0. + * @author Aladdin-ADD + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow comparing against -0", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-compare-neg-zero" + }, + + fixable: null, + schema: [], + + messages: { + unexpected: "Do not use the '{{operator}}' operator to compare against -0." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Checks a given node is -0 + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is -0. + */ + function isNegZero(node) { + return node.type === "UnaryExpression" && node.operator === "-" && node.argument.type === "Literal" && node.argument.value === 0; + } + const OPERATORS_TO_CHECK = new Set([">", ">=", "<", "<=", "==", "===", "!=", "!=="]); + + return { + BinaryExpression(node) { + if (OPERATORS_TO_CHECK.has(node.operator)) { + if (isNegZero(node.left) || isNegZero(node.right)) { + context.report({ + node, + messageId: "unexpected", + data: { operator: node.operator } + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-cond-assign.js b/node_modules/eslint/lib/rules/no-cond-assign.js new file mode 100644 index 000000000..3843a7ac2 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-cond-assign.js @@ -0,0 +1,159 @@ +/** + * @fileoverview Rule to flag assignment in a conditional statement's test expression + * @author Stephen Murray + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const TEST_CONDITION_PARENT_TYPES = new Set(["IfStatement", "WhileStatement", "DoWhileStatement", "ForStatement", "ConditionalExpression"]); + +const NODE_DESCRIPTIONS = { + DoWhileStatement: "a 'do...while' statement", + ForStatement: "a 'for' statement", + IfStatement: "an 'if' statement", + WhileStatement: "a 'while' statement" +}; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow assignment operators in conditional expressions", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-cond-assign" + }, + + schema: [ + { + enum: ["except-parens", "always"] + } + ], + + messages: { + unexpected: "Unexpected assignment within {{type}}.", + + // must match JSHint's error message + missing: "Expected a conditional expression and instead saw an assignment." + } + }, + + create(context) { + + const prohibitAssign = (context.options[0] || "except-parens"); + + const sourceCode = context.getSourceCode(); + + /** + * Check whether an AST node is the test expression for a conditional statement. + * @param {!Object} node The node to test. + * @returns {boolean} `true` if the node is the text expression for a conditional statement; otherwise, `false`. + */ + function isConditionalTestExpression(node) { + return node.parent && + TEST_CONDITION_PARENT_TYPES.has(node.parent.type) && + node === node.parent.test; + } + + /** + * Given an AST node, perform a bottom-up search for the first ancestor that represents a conditional statement. + * @param {!Object} node The node to use at the start of the search. + * @returns {?Object} The closest ancestor node that represents a conditional statement. + */ + function findConditionalAncestor(node) { + let currentAncestor = node; + + do { + if (isConditionalTestExpression(currentAncestor)) { + return currentAncestor.parent; + } + } while ((currentAncestor = currentAncestor.parent) && !astUtils.isFunction(currentAncestor)); + + return null; + } + + /** + * Check whether the code represented by an AST node is enclosed in two sets of parentheses. + * @param {!Object} node The node to test. + * @returns {boolean} `true` if the code is enclosed in two sets of parentheses; otherwise, `false`. + */ + function isParenthesisedTwice(node) { + const previousToken = sourceCode.getTokenBefore(node, 1), + nextToken = sourceCode.getTokenAfter(node, 1); + + return astUtils.isParenthesised(sourceCode, node) && + previousToken && astUtils.isOpeningParenToken(previousToken) && previousToken.range[1] <= node.range[0] && + astUtils.isClosingParenToken(nextToken) && nextToken.range[0] >= node.range[1]; + } + + /** + * Check a conditional statement's test expression for top-level assignments that are not enclosed in parentheses. + * @param {!Object} node The node for the conditional statement. + * @returns {void} + */ + function testForAssign(node) { + if (node.test && + (node.test.type === "AssignmentExpression") && + (node.type === "ForStatement" + ? !astUtils.isParenthesised(sourceCode, node.test) + : !isParenthesisedTwice(node.test) + ) + ) { + + context.report({ + node: node.test, + messageId: "missing" + }); + } + } + + /** + * Check whether an assignment expression is descended from a conditional statement's test expression. + * @param {!Object} node The node for the assignment expression. + * @returns {void} + */ + function testForConditionalAncestor(node) { + const ancestor = findConditionalAncestor(node); + + if (ancestor) { + context.report({ + node, + messageId: "unexpected", + data: { + type: NODE_DESCRIPTIONS[ancestor.type] || ancestor.type + } + }); + } + } + + if (prohibitAssign === "always") { + return { + AssignmentExpression: testForConditionalAncestor + }; + } + + return { + DoWhileStatement: testForAssign, + ForStatement: testForAssign, + IfStatement: testForAssign, + WhileStatement: testForAssign, + ConditionalExpression: testForAssign + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-confusing-arrow.js b/node_modules/eslint/lib/rules/no-confusing-arrow.js new file mode 100644 index 000000000..9009b64fa --- /dev/null +++ b/node_modules/eslint/lib/rules/no-confusing-arrow.js @@ -0,0 +1,85 @@ +/** + * @fileoverview A rule to warn against using arrow functions when they could be + * confused with comparisons + * @author Jxck + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils.js"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a node is a conditional expression. + * @param {ASTNode} node node to test + * @returns {boolean} `true` if the node is a conditional expression. + */ +function isConditional(node) { + return node && node.type === "ConditionalExpression"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow arrow functions where they could be confused with comparisons", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/no-confusing-arrow" + }, + + fixable: "code", + + schema: [{ + type: "object", + properties: { + allowParens: { type: "boolean", default: true } + }, + additionalProperties: false + }], + + messages: { + confusing: "Arrow function used ambiguously with a conditional expression." + } + }, + + create(context) { + const config = context.options[0] || {}; + const allowParens = config.allowParens || (config.allowParens === void 0); + const sourceCode = context.getSourceCode(); + + + /** + * Reports if an arrow function contains an ambiguous conditional. + * @param {ASTNode} node A node to check and report. + * @returns {void} + */ + function checkArrowFunc(node) { + const body = node.body; + + if (isConditional(body) && !(allowParens && astUtils.isParenthesised(sourceCode, body))) { + context.report({ + node, + messageId: "confusing", + fix(fixer) { + + // if `allowParens` is not set to true don't bother wrapping in parens + return allowParens && fixer.replaceText(node.body, `(${sourceCode.getText(node.body)})`); + } + }); + } + } + + return { + ArrowFunctionExpression: checkArrowFunc + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-console.js b/node_modules/eslint/lib/rules/no-console.js new file mode 100644 index 000000000..56dbbc3a9 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-console.js @@ -0,0 +1,134 @@ +/** + * @fileoverview Rule to flag use of console object + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of `console`", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-console" + }, + + schema: [ + { + type: "object", + properties: { + allow: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "Unexpected console statement." + } + }, + + create(context) { + const options = context.options[0] || {}; + const allowed = options.allow || []; + + /** + * Checks whether the given reference is 'console' or not. + * @param {eslint-scope.Reference} reference The reference to check. + * @returns {boolean} `true` if the reference is 'console'. + */ + function isConsole(reference) { + const id = reference.identifier; + + return id && id.name === "console"; + } + + /** + * Checks whether the property name of the given MemberExpression node + * is allowed by options or not. + * @param {ASTNode} node The MemberExpression node to check. + * @returns {boolean} `true` if the property name of the node is allowed. + */ + function isAllowed(node) { + const propertyName = astUtils.getStaticPropertyName(node); + + return propertyName && allowed.indexOf(propertyName) !== -1; + } + + /** + * Checks whether the given reference is a member access which is not + * allowed by options or not. + * @param {eslint-scope.Reference} reference The reference to check. + * @returns {boolean} `true` if the reference is a member access which + * is not allowed by options. + */ + function isMemberAccessExceptAllowed(reference) { + const node = reference.identifier; + const parent = node.parent; + + return ( + parent.type === "MemberExpression" && + parent.object === node && + !isAllowed(parent) + ); + } + + /** + * Reports the given reference as a violation. + * @param {eslint-scope.Reference} reference The reference to report. + * @returns {void} + */ + function report(reference) { + const node = reference.identifier.parent; + + context.report({ + node, + loc: node.loc, + messageId: "unexpected" + }); + } + + return { + "Program:exit"() { + const scope = context.getScope(); + const consoleVar = astUtils.getVariableByName(scope, "console"); + const shadowed = consoleVar && consoleVar.defs.length > 0; + + /* + * 'scope.through' includes all references to undefined + * variables. If the variable 'console' is not defined, it uses + * 'scope.through'. + */ + const references = consoleVar + ? consoleVar.references + : scope.through.filter(isConsole); + + if (!shadowed) { + references + .filter(isMemberAccessExceptAllowed) + .forEach(report); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-const-assign.js b/node_modules/eslint/lib/rules/no-const-assign.js new file mode 100644 index 000000000..e4ae89170 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-const-assign.js @@ -0,0 +1,54 @@ +/** + * @fileoverview A rule to disallow modifying variables that are declared using `const` + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow reassigning `const` variables", + category: "ECMAScript 6", + recommended: true, + url: "https://eslint.org/docs/rules/no-const-assign" + }, + + schema: [], + + messages: { + const: "'{{name}}' is constant." + } + }, + + create(context) { + + /** + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + astUtils.getModifyingReferences(variable.references).forEach(reference => { + context.report({ node: reference.identifier, messageId: "const", data: { name: reference.identifier.name } }); + }); + } + + return { + VariableDeclaration(node) { + if (node.kind === "const") { + context.getDeclaredVariables(node).forEach(checkVariable); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-constant-condition.js b/node_modules/eslint/lib/rules/no-constant-condition.js new file mode 100644 index 000000000..5e5838641 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-constant-condition.js @@ -0,0 +1,253 @@ +/** + * @fileoverview Rule to flag use constant conditions + * @author Christian Schulz + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const EQUALITY_OPERATORS = ["===", "!==", "==", "!="]; +const RELATIONAL_OPERATORS = [">", "<", ">=", "<=", "in", "instanceof"]; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow constant expressions in conditions", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-constant-condition" + }, + + schema: [ + { + type: "object", + properties: { + checkLoops: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "Unexpected constant condition." + } + }, + + create(context) { + const options = context.options[0] || {}, + checkLoops = options.checkLoops !== false, + loopSetStack = []; + + let loopsInCurrentScope = new Set(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + + /** + * Checks if a branch node of LogicalExpression short circuits the whole condition + * @param {ASTNode} node The branch of main condition which needs to be checked + * @param {string} operator The operator of the main LogicalExpression. + * @returns {boolean} true when condition short circuits whole condition + */ + function isLogicalIdentity(node, operator) { + switch (node.type) { + case "Literal": + return (operator === "||" && node.value === true) || + (operator === "&&" && node.value === false); + + case "UnaryExpression": + return (operator === "&&" && node.operator === "void"); + + case "LogicalExpression": + return isLogicalIdentity(node.left, node.operator) || + isLogicalIdentity(node.right, node.operator); + + // no default + } + return false; + } + + /** + * Checks if a node has a constant truthiness value. + * @param {ASTNode} node The AST node to check. + * @param {boolean} inBooleanPosition `false` if checking branch of a condition. + * `true` in all other cases + * @returns {Bool} true when node's truthiness is constant + * @private + */ + function isConstant(node, inBooleanPosition) { + + // node.elements can return null values in the case of sparse arrays ex. [,] + if (!node) { + return true; + } + switch (node.type) { + case "Literal": + case "ArrowFunctionExpression": + case "FunctionExpression": + case "ObjectExpression": + return true; + case "TemplateLiteral": + return (inBooleanPosition && node.quasis.some(quasi => quasi.value.cooked.length)) || + node.expressions.every(exp => isConstant(exp, inBooleanPosition)); + + case "ArrayExpression": { + if (node.parent.type === "BinaryExpression" && node.parent.operator === "+") { + return node.elements.every(element => isConstant(element, false)); + } + return true; + } + + case "UnaryExpression": + if (node.operator === "void") { + return true; + } + + return (node.operator === "typeof" && inBooleanPosition) || + isConstant(node.argument, true); + + case "BinaryExpression": + return isConstant(node.left, false) && + isConstant(node.right, false) && + node.operator !== "in"; + + case "LogicalExpression": { + const isLeftConstant = isConstant(node.left, inBooleanPosition); + const isRightConstant = isConstant(node.right, inBooleanPosition); + const isLeftShortCircuit = (isLeftConstant && isLogicalIdentity(node.left, node.operator)); + const isRightShortCircuit = (isRightConstant && isLogicalIdentity(node.right, node.operator)); + + return (isLeftConstant && isRightConstant) || + ( + + // in the case of an "OR", we need to know if the right constant value is truthy + node.operator === "||" && + isRightConstant && + node.right.value && + ( + !node.parent || + node.parent.type !== "BinaryExpression" || + !(EQUALITY_OPERATORS.includes(node.parent.operator) || RELATIONAL_OPERATORS.includes(node.parent.operator)) + ) + ) || + isLeftShortCircuit || + isRightShortCircuit; + } + + case "AssignmentExpression": + return (node.operator === "=") && isConstant(node.right, inBooleanPosition); + + case "SequenceExpression": + return isConstant(node.expressions[node.expressions.length - 1], inBooleanPosition); + + // no default + } + return false; + } + + /** + * Tracks when the given node contains a constant condition. + * @param {ASTNode} node The AST node to check. + * @returns {void} + * @private + */ + function trackConstantConditionLoop(node) { + if (node.test && isConstant(node.test, true)) { + loopsInCurrentScope.add(node); + } + } + + /** + * Reports when the set contains the given constant condition node + * @param {ASTNode} node The AST node to check. + * @returns {void} + * @private + */ + function checkConstantConditionLoopInSet(node) { + if (loopsInCurrentScope.has(node)) { + loopsInCurrentScope.delete(node); + context.report({ node: node.test, messageId: "unexpected" }); + } + } + + /** + * Reports when the given node contains a constant condition. + * @param {ASTNode} node The AST node to check. + * @returns {void} + * @private + */ + function reportIfConstant(node) { + if (node.test && isConstant(node.test, true)) { + context.report({ node: node.test, messageId: "unexpected" }); + } + } + + /** + * Stores current set of constant loops in loopSetStack temporarily + * and uses a new set to track constant loops + * @returns {void} + * @private + */ + function enterFunction() { + loopSetStack.push(loopsInCurrentScope); + loopsInCurrentScope = new Set(); + } + + /** + * Reports when the set still contains stored constant conditions + * @returns {void} + * @private + */ + function exitFunction() { + loopsInCurrentScope = loopSetStack.pop(); + } + + /** + * Checks node when checkLoops option is enabled + * @param {ASTNode} node The AST node to check. + * @returns {void} + * @private + */ + function checkLoop(node) { + if (checkLoops) { + trackConstantConditionLoop(node); + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ConditionalExpression: reportIfConstant, + IfStatement: reportIfConstant, + WhileStatement: checkLoop, + "WhileStatement:exit": checkConstantConditionLoopInSet, + DoWhileStatement: checkLoop, + "DoWhileStatement:exit": checkConstantConditionLoopInSet, + ForStatement: checkLoop, + "ForStatement > .test": node => checkLoop(node.parent), + "ForStatement:exit": checkConstantConditionLoopInSet, + FunctionDeclaration: enterFunction, + "FunctionDeclaration:exit": exitFunction, + FunctionExpression: enterFunction, + "FunctionExpression:exit": exitFunction, + YieldExpression: () => loopsInCurrentScope.clear() + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-constructor-return.js b/node_modules/eslint/lib/rules/no-constructor-return.js new file mode 100644 index 000000000..4757770b7 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-constructor-return.js @@ -0,0 +1,62 @@ +/** + * @fileoverview Rule to disallow returning value from constructor. + * @author Pig Fang + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow returning value from constructor", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-constructor-return" + }, + + schema: {}, + + fixable: null, + + messages: { + unexpected: "Unexpected return statement in constructor." + } + }, + + create(context) { + const stack = []; + + return { + onCodePathStart(_, node) { + stack.push(node); + }, + onCodePathEnd() { + stack.pop(); + }, + ReturnStatement(node) { + const last = stack[stack.length - 1]; + + if (!last.parent) { + return; + } + + if ( + last.parent.type === "MethodDefinition" && + last.parent.kind === "constructor" && + (node.parent.parent === last || node.argument) + ) { + context.report({ + node, + messageId: "unexpected" + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-continue.js b/node_modules/eslint/lib/rules/no-continue.js new file mode 100644 index 000000000..96718d17a --- /dev/null +++ b/node_modules/eslint/lib/rules/no-continue.js @@ -0,0 +1,39 @@ +/** + * @fileoverview Rule to flag use of continue statement + * @author Borislav Zhivkov + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `continue` statements", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-continue" + }, + + schema: [], + + messages: { + unexpected: "Unexpected use of continue statement." + } + }, + + create(context) { + + return { + ContinueStatement(node) { + context.report({ node, messageId: "unexpected" }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-control-regex.js b/node_modules/eslint/lib/rules/no-control-regex.js new file mode 100644 index 000000000..146c4f22d --- /dev/null +++ b/node_modules/eslint/lib/rules/no-control-regex.js @@ -0,0 +1,113 @@ +/** + * @fileoverview Rule to forbid control characters from regular expressions. + * @author Nicholas C. Zakas + */ + +"use strict"; + +const RegExpValidator = require("regexpp").RegExpValidator; +const collector = new (class { + constructor() { + this.ecmaVersion = 2018; + this._source = ""; + this._controlChars = []; + this._validator = new RegExpValidator(this); + } + + onPatternEnter() { + this._controlChars = []; + } + + onCharacter(start, end, cp) { + if (cp >= 0x00 && + cp <= 0x1F && + ( + this._source.codePointAt(start) === cp || + this._source.slice(start, end).startsWith("\\x") || + this._source.slice(start, end).startsWith("\\u") + ) + ) { + this._controlChars.push(`\\x${`0${cp.toString(16)}`.slice(-2)}`); + } + } + + collectControlChars(regexpStr) { + try { + this._source = regexpStr; + this._validator.validatePattern(regexpStr); // Call onCharacter hook + } catch { + + // Ignore syntax errors in RegExp. + } + return this._controlChars; + } +})(); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow control characters in regular expressions", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-control-regex" + }, + + schema: [], + + messages: { + unexpected: "Unexpected control character(s) in regular expression: {{controlChars}}." + } + }, + + create(context) { + + /** + * Get the regex expression + * @param {ASTNode} node node to evaluate + * @returns {RegExp|null} Regex if found else null + * @private + */ + function getRegExpPattern(node) { + if (node.regex) { + return node.regex.pattern; + } + if (typeof node.value === "string" && + (node.parent.type === "NewExpression" || node.parent.type === "CallExpression") && + node.parent.callee.type === "Identifier" && + node.parent.callee.name === "RegExp" && + node.parent.arguments[0] === node + ) { + return node.value; + } + + return null; + } + + return { + Literal(node) { + const pattern = getRegExpPattern(node); + + if (pattern) { + const controlCharacters = collector.collectControlChars(pattern); + + if (controlCharacters.length > 0) { + context.report({ + node, + messageId: "unexpected", + data: { + controlChars: controlCharacters.join(", ") + } + }); + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-debugger.js b/node_modules/eslint/lib/rules/no-debugger.js new file mode 100644 index 000000000..95a28a862 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-debugger.js @@ -0,0 +1,43 @@ +/** + * @fileoverview Rule to flag use of a debugger statement + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow the use of `debugger`", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-debugger" + }, + + fixable: null, + schema: [], + + messages: { + unexpected: "Unexpected 'debugger' statement." + } + }, + + create(context) { + + return { + DebuggerStatement(node) { + context.report({ + node, + messageId: "unexpected" + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-delete-var.js b/node_modules/eslint/lib/rules/no-delete-var.js new file mode 100644 index 000000000..aeab951d7 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-delete-var.js @@ -0,0 +1,42 @@ +/** + * @fileoverview Rule to flag when deleting variables + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow deleting variables", + category: "Variables", + recommended: true, + url: "https://eslint.org/docs/rules/no-delete-var" + }, + + schema: [], + + messages: { + unexpected: "Variables should not be deleted." + } + }, + + create(context) { + + return { + + UnaryExpression(node) { + if (node.operator === "delete" && node.argument.type === "Identifier") { + context.report({ node, messageId: "unexpected" }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-div-regex.js b/node_modules/eslint/lib/rules/no-div-regex.js new file mode 100644 index 000000000..0ccabdcc6 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-div-regex.js @@ -0,0 +1,53 @@ +/** + * @fileoverview Rule to check for ambiguous div operator in regexes + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow division operators explicitly at the beginning of regular expressions", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-div-regex" + }, + + fixable: "code", + + schema: [], + + messages: { + unexpected: "A regular expression literal can be confused with '/='." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + + Literal(node) { + const token = sourceCode.getFirstToken(node); + + if (token.type === "RegularExpression" && token.value[1] === "=") { + context.report({ + node, + messageId: "unexpected", + fix(fixer) { + return fixer.replaceTextRange([token.range[0] + 1, token.range[0] + 2], "[=]"); + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-dupe-args.js b/node_modules/eslint/lib/rules/no-dupe-args.js new file mode 100644 index 000000000..817277f52 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-dupe-args.js @@ -0,0 +1,80 @@ +/** + * @fileoverview Rule to flag duplicate arguments + * @author Jamund Ferguson + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow duplicate arguments in `function` definitions", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-dupe-args" + }, + + schema: [], + + messages: { + unexpected: "Duplicate param '{{name}}'." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Checks whether or not a given definition is a parameter's. + * @param {eslint-scope.DefEntry} def A definition to check. + * @returns {boolean} `true` if the definition is a parameter's. + */ + function isParameter(def) { + return def.type === "Parameter"; + } + + /** + * Determines if a given node has duplicate parameters. + * @param {ASTNode} node The node to check. + * @returns {void} + * @private + */ + function checkParams(node) { + const variables = context.getDeclaredVariables(node); + + for (let i = 0; i < variables.length; ++i) { + const variable = variables[i]; + + // Checks and reports duplications. + const defs = variable.defs.filter(isParameter); + + if (defs.length >= 2) { + context.report({ + node, + messageId: "unexpected", + data: { name: variable.name } + }); + } + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + FunctionDeclaration: checkParams, + FunctionExpression: checkParams + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-dupe-class-members.js b/node_modules/eslint/lib/rules/no-dupe-class-members.js new file mode 100644 index 000000000..b12939d57 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-dupe-class-members.js @@ -0,0 +1,103 @@ +/** + * @fileoverview A rule to disallow duplicate name in class members. + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow duplicate class members", + category: "ECMAScript 6", + recommended: true, + url: "https://eslint.org/docs/rules/no-dupe-class-members" + }, + + schema: [], + + messages: { + unexpected: "Duplicate name '{{name}}'." + } + }, + + create(context) { + let stack = []; + + /** + * Gets state of a given member name. + * @param {string} name A name of a member. + * @param {boolean} isStatic A flag which specifies that is a static member. + * @returns {Object} A state of a given member name. + * - retv.init {boolean} A flag which shows the name is declared as normal member. + * - retv.get {boolean} A flag which shows the name is declared as getter. + * - retv.set {boolean} A flag which shows the name is declared as setter. + */ + function getState(name, isStatic) { + const stateMap = stack[stack.length - 1]; + const key = `$${name}`; // to avoid "__proto__". + + if (!stateMap[key]) { + stateMap[key] = { + nonStatic: { init: false, get: false, set: false }, + static: { init: false, get: false, set: false } + }; + } + + return stateMap[key][isStatic ? "static" : "nonStatic"]; + } + + return { + + // Initializes the stack of state of member declarations. + Program() { + stack = []; + }, + + // Initializes state of member declarations for the class. + ClassBody() { + stack.push(Object.create(null)); + }, + + // Disposes the state for the class. + "ClassBody:exit"() { + stack.pop(); + }, + + // Reports the node if its name has been declared already. + MethodDefinition(node) { + const name = astUtils.getStaticPropertyName(node); + + if (name === null || node.kind === "constructor") { + return; + } + + const state = getState(name, node.static); + let isDuplicate = false; + + if (node.kind === "get") { + isDuplicate = (state.init || state.get); + state.get = true; + } else if (node.kind === "set") { + isDuplicate = (state.init || state.set); + state.set = true; + } else { + isDuplicate = (state.init || state.get || state.set); + state.init = true; + } + + if (isDuplicate) { + context.report({ node, messageId: "unexpected", data: { name } }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-dupe-else-if.js b/node_modules/eslint/lib/rules/no-dupe-else-if.js new file mode 100644 index 000000000..cbeb437da --- /dev/null +++ b/node_modules/eslint/lib/rules/no-dupe-else-if.js @@ -0,0 +1,122 @@ +/** + * @fileoverview Rule to disallow duplicate conditions in if-else-if chains + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines whether the first given array is a subset of the second given array. + * @param {Function} comparator A function to compare two elements, should return `true` if they are equal. + * @param {Array} arrA The array to compare from. + * @param {Array} arrB The array to compare against. + * @returns {boolean} `true` if the array `arrA` is a subset of the array `arrB`. + */ +function isSubsetByComparator(comparator, arrA, arrB) { + return arrA.every(a => arrB.some(b => comparator(a, b))); +} + +/** + * Splits the given node by the given logical operator. + * @param {string} operator Logical operator `||` or `&&`. + * @param {ASTNode} node The node to split. + * @returns {ASTNode[]} Array of conditions that makes the node when joined by the operator. + */ +function splitByLogicalOperator(operator, node) { + if (node.type === "LogicalExpression" && node.operator === operator) { + return [...splitByLogicalOperator(operator, node.left), ...splitByLogicalOperator(operator, node.right)]; + } + return [node]; +} + +const splitByOr = splitByLogicalOperator.bind(null, "||"); +const splitByAnd = splitByLogicalOperator.bind(null, "&&"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow duplicate conditions in if-else-if chains", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-dupe-else-if" + }, + + schema: [], + + messages: { + unexpected: "This branch can never execute. Its condition is a duplicate or covered by previous conditions in the if-else-if chain." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Determines whether the two given nodes are considered to be equal. In particular, given that the nodes + * represent expressions in a boolean context, `||` and `&&` can be considered as commutative operators. + * @param {ASTNode} a First node. + * @param {ASTNode} b Second node. + * @returns {boolean} `true` if the nodes are considered to be equal. + */ + function equal(a, b) { + if (a.type !== b.type) { + return false; + } + + if ( + a.type === "LogicalExpression" && + (a.operator === "||" || a.operator === "&&") && + a.operator === b.operator + ) { + return equal(a.left, b.left) && equal(a.right, b.right) || + equal(a.left, b.right) && equal(a.right, b.left); + } + + return astUtils.equalTokens(a, b, sourceCode); + } + + const isSubset = isSubsetByComparator.bind(null, equal); + + return { + IfStatement(node) { + const test = node.test, + conditionsToCheck = test.type === "LogicalExpression" && test.operator === "&&" + ? [test, ...splitByAnd(test)] + : [test]; + let current = node, + listToCheck = conditionsToCheck.map(c => splitByOr(c).map(splitByAnd)); + + while (current.parent && current.parent.type === "IfStatement" && current.parent.alternate === current) { + current = current.parent; + + const currentOrOperands = splitByOr(current.test).map(splitByAnd); + + listToCheck = listToCheck.map(orOperands => orOperands.filter( + orOperand => !currentOrOperands.some(currentOrOperand => isSubset(currentOrOperand, orOperand)) + )); + + if (listToCheck.some(orOperands => orOperands.length === 0)) { + context.report({ node: test, messageId: "unexpected" }); + break; + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-dupe-keys.js b/node_modules/eslint/lib/rules/no-dupe-keys.js new file mode 100644 index 000000000..89e1f2de6 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-dupe-keys.js @@ -0,0 +1,143 @@ +/** + * @fileoverview Rule to flag use of duplicate keys in an object. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const GET_KIND = /^(?:init|get)$/u; +const SET_KIND = /^(?:init|set)$/u; + +/** + * The class which stores properties' information of an object. + */ +class ObjectInfo { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {ObjectInfo|null} upper The information of the outer object. + * @param {ASTNode} node The ObjectExpression node of this information. + */ + constructor(upper, node) { + this.upper = upper; + this.node = node; + this.properties = new Map(); + } + + /** + * Gets the information of the given Property node. + * @param {ASTNode} node The Property node to get. + * @returns {{get: boolean, set: boolean}} The information of the property. + */ + getPropertyInfo(node) { + const name = astUtils.getStaticPropertyName(node); + + if (!this.properties.has(name)) { + this.properties.set(name, { get: false, set: false }); + } + return this.properties.get(name); + } + + /** + * Checks whether the given property has been defined already or not. + * @param {ASTNode} node The Property node to check. + * @returns {boolean} `true` if the property has been defined. + */ + isPropertyDefined(node) { + const entry = this.getPropertyInfo(node); + + return ( + (GET_KIND.test(node.kind) && entry.get) || + (SET_KIND.test(node.kind) && entry.set) + ); + } + + /** + * Defines the given property. + * @param {ASTNode} node The Property node to define. + * @returns {void} + */ + defineProperty(node) { + const entry = this.getPropertyInfo(node); + + if (GET_KIND.test(node.kind)) { + entry.get = true; + } + if (SET_KIND.test(node.kind)) { + entry.set = true; + } + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow duplicate keys in object literals", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-dupe-keys" + }, + + schema: [], + + messages: { + unexpected: "Duplicate key '{{name}}'." + } + }, + + create(context) { + let info = null; + + return { + ObjectExpression(node) { + info = new ObjectInfo(info, node); + }, + "ObjectExpression:exit"() { + info = info.upper; + }, + + Property(node) { + const name = astUtils.getStaticPropertyName(node); + + // Skip destructuring. + if (node.parent.type !== "ObjectExpression") { + return; + } + + // Skip if the name is not static. + if (name === null) { + return; + } + + // Reports if the name is defined already. + if (info.isPropertyDefined(node)) { + context.report({ + node: info.node, + loc: node.key.loc, + messageId: "unexpected", + data: { name } + }); + } + + // Update info. + info.defineProperty(node); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-duplicate-case.js b/node_modules/eslint/lib/rules/no-duplicate-case.js new file mode 100644 index 000000000..e2d9665e7 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-duplicate-case.js @@ -0,0 +1,71 @@ +/** + * @fileoverview Rule to disallow a duplicate case label. + * @author Dieter Oberkofler + * @author Burak Yigit Kaya + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow duplicate case labels", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-duplicate-case" + }, + + schema: [], + + messages: { + unexpected: "Duplicate case label." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Determines whether the two given nodes are considered to be equal. + * @param {ASTNode} a First node. + * @param {ASTNode} b Second node. + * @returns {boolean} `true` if the nodes are considered to be equal. + */ + function equal(a, b) { + if (a.type !== b.type) { + return false; + } + + return astUtils.equalTokens(a, b, sourceCode); + } + return { + SwitchStatement(node) { + const previousTests = []; + + for (const switchCase of node.cases) { + if (switchCase.test) { + const test = switchCase.test; + + if (previousTests.some(previousTest => equal(previousTest, test))) { + context.report({ node: switchCase, messageId: "unexpected" }); + } else { + previousTests.push(test); + } + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-duplicate-imports.js b/node_modules/eslint/lib/rules/no-duplicate-imports.js new file mode 100644 index 000000000..7218dc64a --- /dev/null +++ b/node_modules/eslint/lib/rules/no-duplicate-imports.js @@ -0,0 +1,142 @@ +/** + * @fileoverview Restrict usage of duplicate imports. + * @author Simen Bekkhus + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** + * Returns the name of the module imported or re-exported. + * @param {ASTNode} node A node to get. + * @returns {string} the name of the module, or empty string if no name. + */ +function getValue(node) { + if (node && node.source && node.source.value) { + return node.source.value.trim(); + } + + return ""; +} + +/** + * Checks if the name of the import or export exists in the given array, and reports if so. + * @param {RuleContext} context The ESLint rule context object. + * @param {ASTNode} node A node to get. + * @param {string} value The name of the imported or exported module. + * @param {string[]} array The array containing other imports or exports in the file. + * @param {string} messageId A messageId to be reported after the name of the module + * + * @returns {void} No return value + */ +function checkAndReport(context, node, value, array, messageId) { + if (array.indexOf(value) !== -1) { + context.report({ + node, + messageId, + data: { + module: value + } + }); + } +} + +/** + * @callback nodeCallback + * @param {ASTNode} node A node to handle. + */ + +/** + * Returns a function handling the imports of a given file + * @param {RuleContext} context The ESLint rule context object. + * @param {boolean} includeExports Whether or not to check for exports in addition to imports. + * @param {string[]} importsInFile The array containing other imports in the file. + * @param {string[]} exportsInFile The array containing other exports in the file. + * + * @returns {nodeCallback} A function passed to ESLint to handle the statement. + */ +function handleImports(context, includeExports, importsInFile, exportsInFile) { + return function(node) { + const value = getValue(node); + + if (value) { + checkAndReport(context, node, value, importsInFile, "import"); + + if (includeExports) { + checkAndReport(context, node, value, exportsInFile, "importAs"); + } + + importsInFile.push(value); + } + }; +} + +/** + * Returns a function handling the exports of a given file + * @param {RuleContext} context The ESLint rule context object. + * @param {string[]} importsInFile The array containing other imports in the file. + * @param {string[]} exportsInFile The array containing other exports in the file. + * + * @returns {nodeCallback} A function passed to ESLint to handle the statement. + */ +function handleExports(context, importsInFile, exportsInFile) { + return function(node) { + const value = getValue(node); + + if (value) { + checkAndReport(context, node, value, exportsInFile, "export"); + checkAndReport(context, node, value, importsInFile, "exportAs"); + + exportsInFile.push(value); + } + }; +} + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow duplicate module imports", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/no-duplicate-imports" + }, + + schema: [{ + type: "object", + properties: { + includeExports: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], + messages: { + import: "'{{module}}' import is duplicated.", + importAs: "'{{module}}' import is duplicated as export.", + export: "'{{module}}' export is duplicated.", + exportAs: "'{{module}}' export is duplicated as import." + } + }, + + create(context) { + const includeExports = (context.options[0] || {}).includeExports, + importsInFile = [], + exportsInFile = []; + + const handlers = { + ImportDeclaration: handleImports(context, includeExports, importsInFile, exportsInFile) + }; + + if (includeExports) { + handlers.ExportNamedDeclaration = handleExports(context, importsInFile, exportsInFile); + handlers.ExportAllDeclaration = handleExports(context, importsInFile, exportsInFile); + } + + return handlers; + } +}; diff --git a/node_modules/eslint/lib/rules/no-else-return.js b/node_modules/eslint/lib/rules/no-else-return.js new file mode 100644 index 000000000..84409fac8 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-else-return.js @@ -0,0 +1,404 @@ +/** + * @fileoverview Rule to flag `else` after a `return` in `if` + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const FixTracker = require("./utils/fix-tracker"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `else` blocks after `return` statements in `if` statements", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-else-return" + }, + + schema: [{ + type: "object", + properties: { + allowElseIf: { + type: "boolean", + default: true + } + }, + additionalProperties: false + }], + + fixable: "code", + + messages: { + unexpected: "Unnecessary 'else' after 'return'." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Checks whether the given names can be safely used to declare block-scoped variables + * in the given scope. Name collisions can produce redeclaration syntax errors, + * or silently change references and modify behavior of the original code. + * + * This is not a generic function. In particular, it is assumed that the scope is a function scope or + * a function's inner scope, and that the names can be valid identifiers in the given scope. + * @param {string[]} names Array of variable names. + * @param {eslint-scope.Scope} scope Function scope or a function's inner scope. + * @returns {boolean} True if all names can be safely declared, false otherwise. + */ + function isSafeToDeclare(names, scope) { + + if (names.length === 0) { + return true; + } + + const functionScope = scope.variableScope; + + /* + * If this is a function scope, scope.variables will contain parameters, implicit variables such as "arguments", + * all function-scoped variables ('var'), and block-scoped variables defined in the scope. + * If this is an inner scope, scope.variables will contain block-scoped variables defined in the scope. + * + * Redeclaring any of these would cause a syntax error, except for the implicit variables. + */ + const declaredVariables = scope.variables.filter(({ defs }) => defs.length > 0); + + if (declaredVariables.some(({ name }) => names.includes(name))) { + return false; + } + + // Redeclaring a catch variable would also cause a syntax error. + if (scope !== functionScope && scope.upper.type === "catch") { + if (scope.upper.variables.some(({ name }) => names.includes(name))) { + return false; + } + } + + /* + * Redeclaring an implicit variable, such as "arguments", would not cause a syntax error. + * However, if the variable was used, declaring a new one with the same name would change references + * and modify behavior. + */ + const usedImplicitVariables = scope.variables.filter(({ defs, references }) => + defs.length === 0 && references.length > 0); + + if (usedImplicitVariables.some(({ name }) => names.includes(name))) { + return false; + } + + /* + * Declaring a variable with a name that was already used to reference a variable from an upper scope + * would change references and modify behavior. + */ + if (scope.through.some(t => names.includes(t.identifier.name))) { + return false; + } + + /* + * If the scope is an inner scope (not the function scope), an uninitialized `var` variable declared inside + * the scope node (directly or in one of its descendants) is neither declared nor 'through' in the scope. + * + * For example, this would be a syntax error "Identifier 'a' has already been declared": + * function foo() { if (bar) { let a; if (baz) { var a; } } } + */ + if (scope !== functionScope) { + const scopeNodeRange = scope.block.range; + const variablesToCheck = functionScope.variables.filter(({ name }) => names.includes(name)); + + if (variablesToCheck.some(v => v.defs.some(({ node: { range } }) => + scopeNodeRange[0] <= range[0] && range[1] <= scopeNodeRange[1]))) { + return false; + } + } + + return true; + } + + + /** + * Checks whether the removal of `else` and its braces is safe from variable name collisions. + * @param {Node} node The 'else' node. + * @param {eslint-scope.Scope} scope The scope in which the node and the whole 'if' statement is. + * @returns {boolean} True if it is safe, false otherwise. + */ + function isSafeFromNameCollisions(node, scope) { + + if (node.type === "FunctionDeclaration") { + + // Conditional function declaration. Scope and hoisting are unpredictable, different engines work differently. + return false; + } + + if (node.type !== "BlockStatement") { + return true; + } + + const elseBlockScope = scope.childScopes.find(({ block }) => block === node); + + if (!elseBlockScope) { + + // ecmaVersion < 6, `else` block statement cannot have its own scope, no possible collisions. + return true; + } + + /* + * elseBlockScope is supposed to merge into its upper scope. elseBlockScope.variables array contains + * only block-scoped variables (such as let and const variables or class and function declarations) + * defined directly in the elseBlockScope. These are exactly the only names that could cause collisions. + */ + const namesToCheck = elseBlockScope.variables.map(({ name }) => name); + + return isSafeToDeclare(namesToCheck, scope); + } + + /** + * Display the context report if rule is violated + * @param {Node} node The 'else' node + * @returns {void} + */ + function displayReport(node) { + const currentScope = context.getScope(); + + context.report({ + node, + messageId: "unexpected", + fix: fixer => { + + if (!isSafeFromNameCollisions(node, currentScope)) { + return null; + } + + const sourceCode = context.getSourceCode(); + const startToken = sourceCode.getFirstToken(node); + const elseToken = sourceCode.getTokenBefore(startToken); + const source = sourceCode.getText(node); + const lastIfToken = sourceCode.getTokenBefore(elseToken); + let fixedSource, firstTokenOfElseBlock; + + if (startToken.type === "Punctuator" && startToken.value === "{") { + firstTokenOfElseBlock = sourceCode.getTokenAfter(startToken); + } else { + firstTokenOfElseBlock = startToken; + } + + /* + * If the if block does not have curly braces and does not end in a semicolon + * and the else block starts with (, [, /, +, ` or -, then it is not + * safe to remove the else keyword, because ASI will not add a semicolon + * after the if block + */ + const ifBlockMaybeUnsafe = node.parent.consequent.type !== "BlockStatement" && lastIfToken.value !== ";"; + const elseBlockUnsafe = /^[([/+`-]/u.test(firstTokenOfElseBlock.value); + + if (ifBlockMaybeUnsafe && elseBlockUnsafe) { + return null; + } + + const endToken = sourceCode.getLastToken(node); + const lastTokenOfElseBlock = sourceCode.getTokenBefore(endToken); + + if (lastTokenOfElseBlock.value !== ";") { + const nextToken = sourceCode.getTokenAfter(endToken); + + const nextTokenUnsafe = nextToken && /^[([/+`-]/u.test(nextToken.value); + const nextTokenOnSameLine = nextToken && nextToken.loc.start.line === lastTokenOfElseBlock.loc.start.line; + + /* + * If the else block contents does not end in a semicolon, + * and the else block starts with (, [, /, +, ` or -, then it is not + * safe to remove the else block, because ASI will not add a semicolon + * after the remaining else block contents + */ + if (nextTokenUnsafe || (nextTokenOnSameLine && nextToken.value !== "}")) { + return null; + } + } + + if (startToken.type === "Punctuator" && startToken.value === "{") { + fixedSource = source.slice(1, -1); + } else { + fixedSource = source; + } + + /* + * Extend the replacement range to include the entire + * function to avoid conflicting with no-useless-return. + * https://github.com/eslint/eslint/issues/8026 + * + * Also, to avoid name collisions between two else blocks. + */ + return new FixTracker(fixer, sourceCode) + .retainEnclosingFunction(node) + .replaceTextRange([elseToken.range[0], node.range[1]], fixedSource); + } + }); + } + + /** + * Check to see if the node is a ReturnStatement + * @param {Node} node The node being evaluated + * @returns {boolean} True if node is a return + */ + function checkForReturn(node) { + return node.type === "ReturnStatement"; + } + + /** + * Naive return checking, does not iterate through the whole + * BlockStatement because we make the assumption that the ReturnStatement + * will be the last node in the body of the BlockStatement. + * @param {Node} node The consequent/alternate node + * @returns {boolean} True if it has a return + */ + function naiveHasReturn(node) { + if (node.type === "BlockStatement") { + const body = node.body, + lastChildNode = body[body.length - 1]; + + return lastChildNode && checkForReturn(lastChildNode); + } + return checkForReturn(node); + } + + /** + * Check to see if the node is valid for evaluation, + * meaning it has an else. + * @param {Node} node The node being evaluated + * @returns {boolean} True if the node is valid + */ + function hasElse(node) { + return node.alternate && node.consequent; + } + + /** + * If the consequent is an IfStatement, check to see if it has an else + * and both its consequent and alternate path return, meaning this is + * a nested case of rule violation. If-Else not considered currently. + * @param {Node} node The consequent node + * @returns {boolean} True if this is a nested rule violation + */ + function checkForIf(node) { + return node.type === "IfStatement" && hasElse(node) && + naiveHasReturn(node.alternate) && naiveHasReturn(node.consequent); + } + + /** + * Check the consequent/body node to make sure it is not + * a ReturnStatement or an IfStatement that returns on both + * code paths. + * @param {Node} node The consequent or body node + * @returns {boolean} `true` if it is a Return/If node that always returns. + */ + function checkForReturnOrIf(node) { + return checkForReturn(node) || checkForIf(node); + } + + + /** + * Check whether a node returns in every codepath. + * @param {Node} node The node to be checked + * @returns {boolean} `true` if it returns on every codepath. + */ + function alwaysReturns(node) { + if (node.type === "BlockStatement") { + + // If we have a BlockStatement, check each consequent body node. + return node.body.some(checkForReturnOrIf); + } + + /* + * If not a block statement, make sure the consequent isn't a + * ReturnStatement or an IfStatement with returns on both paths. + */ + return checkForReturnOrIf(node); + } + + + /** + * Check the if statement, but don't catch else-if blocks. + * @returns {void} + * @param {Node} node The node for the if statement to check + * @private + */ + function checkIfWithoutElse(node) { + const parent = node.parent; + + /* + * Fixing this would require splitting one statement into two, so no error should + * be reported if this node is in a position where only one statement is allowed. + */ + if (!astUtils.STATEMENT_LIST_PARENTS.has(parent.type)) { + return; + } + + const consequents = []; + let alternate; + + for (let currentNode = node; currentNode.type === "IfStatement"; currentNode = currentNode.alternate) { + if (!currentNode.alternate) { + return; + } + consequents.push(currentNode.consequent); + alternate = currentNode.alternate; + } + + if (consequents.every(alwaysReturns)) { + displayReport(alternate); + } + } + + /** + * Check the if statement + * @returns {void} + * @param {Node} node The node for the if statement to check + * @private + */ + function checkIfWithElse(node) { + const parent = node.parent; + + + /* + * Fixing this would require splitting one statement into two, so no error should + * be reported if this node is in a position where only one statement is allowed. + */ + if (!astUtils.STATEMENT_LIST_PARENTS.has(parent.type)) { + return; + } + + const alternate = node.alternate; + + if (alternate && alwaysReturns(node.consequent)) { + displayReport(alternate); + } + } + + const allowElseIf = !(context.options[0] && context.options[0].allowElseIf === false); + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + + "IfStatement:exit": allowElseIf ? checkIfWithoutElse : checkIfWithElse + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-empty-character-class.js b/node_modules/eslint/lib/rules/no-empty-character-class.js new file mode 100644 index 000000000..7dc219fe1 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-empty-character-class.js @@ -0,0 +1,64 @@ +/** + * @fileoverview Rule to flag the use of empty character classes in regular expressions + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/* + * plain-English description of the following regexp: + * 0. `^` fix the match at the beginning of the string + * 1. `\/`: the `/` that begins the regexp + * 2. `([^\\[]|\\.|\[([^\\\]]|\\.)+\])*`: regexp contents; 0 or more of the following + * 2.0. `[^\\[]`: any character that's not a `\` or a `[` (anything but escape sequences and character classes) + * 2.1. `\\.`: an escape sequence + * 2.2. `\[([^\\\]]|\\.)+\]`: a character class that isn't empty + * 3. `\/` the `/` that ends the regexp + * 4. `[gimuy]*`: optional regexp flags + * 5. `$`: fix the match at the end of the string + */ +const regex = /^\/([^\\[]|\\.|\[([^\\\]]|\\.)+\])*\/[gimuys]*$/u; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow empty character classes in regular expressions", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-empty-character-class" + }, + + schema: [], + + messages: { + unexpected: "Empty class." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + + Literal(node) { + const token = sourceCode.getFirstToken(node); + + if (token.type === "RegularExpression" && !regex.test(token.value)) { + context.report({ node, messageId: "unexpected" }); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-empty-function.js b/node_modules/eslint/lib/rules/no-empty-function.js new file mode 100644 index 000000000..c512f8cd5 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-empty-function.js @@ -0,0 +1,167 @@ +/** + * @fileoverview Rule to disallow empty functions. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const ALLOW_OPTIONS = Object.freeze([ + "functions", + "arrowFunctions", + "generatorFunctions", + "methods", + "generatorMethods", + "getters", + "setters", + "constructors", + "asyncFunctions", + "asyncMethods" +]); + +/** + * Gets the kind of a given function node. + * @param {ASTNode} node A function node to get. This is one of + * an ArrowFunctionExpression, a FunctionDeclaration, or a + * FunctionExpression. + * @returns {string} The kind of the function. This is one of "functions", + * "arrowFunctions", "generatorFunctions", "asyncFunctions", "methods", + * "generatorMethods", "asyncMethods", "getters", "setters", and + * "constructors". + */ +function getKind(node) { + const parent = node.parent; + let kind = ""; + + if (node.type === "ArrowFunctionExpression") { + return "arrowFunctions"; + } + + // Detects main kind. + if (parent.type === "Property") { + if (parent.kind === "get") { + return "getters"; + } + if (parent.kind === "set") { + return "setters"; + } + kind = parent.method ? "methods" : "functions"; + + } else if (parent.type === "MethodDefinition") { + if (parent.kind === "get") { + return "getters"; + } + if (parent.kind === "set") { + return "setters"; + } + if (parent.kind === "constructor") { + return "constructors"; + } + kind = "methods"; + + } else { + kind = "functions"; + } + + // Detects prefix. + let prefix = ""; + + if (node.generator) { + prefix = "generator"; + } else if (node.async) { + prefix = "async"; + } else { + return kind; + } + return prefix + kind[0].toUpperCase() + kind.slice(1); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow empty functions", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-empty-function" + }, + + schema: [ + { + type: "object", + properties: { + allow: { + type: "array", + items: { enum: ALLOW_OPTIONS }, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "Unexpected empty {{name}}." + } + }, + + create(context) { + const options = context.options[0] || {}; + const allowed = options.allow || []; + + const sourceCode = context.getSourceCode(); + + /** + * Reports a given function node if the node matches the following patterns. + * + * - Not allowed by options. + * - The body is empty. + * - The body doesn't have any comments. + * @param {ASTNode} node A function node to report. This is one of + * an ArrowFunctionExpression, a FunctionDeclaration, or a + * FunctionExpression. + * @returns {void} + */ + function reportIfEmpty(node) { + const kind = getKind(node); + const name = astUtils.getFunctionNameWithKind(node); + const innerComments = sourceCode.getTokens(node.body, { + includeComments: true, + filter: astUtils.isCommentToken + }); + + if (allowed.indexOf(kind) === -1 && + node.body.type === "BlockStatement" && + node.body.body.length === 0 && + innerComments.length === 0 + ) { + context.report({ + node, + loc: node.body.loc, + messageId: "unexpected", + data: { name } + }); + } + } + + return { + ArrowFunctionExpression: reportIfEmpty, + FunctionDeclaration: reportIfEmpty, + FunctionExpression: reportIfEmpty + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-empty-pattern.js b/node_modules/eslint/lib/rules/no-empty-pattern.js new file mode 100644 index 000000000..9f34bfde9 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-empty-pattern.js @@ -0,0 +1,43 @@ +/** + * @fileoverview Rule to disallow an empty pattern + * @author Alberto Rodríguez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow empty destructuring patterns", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-empty-pattern" + }, + + schema: [], + + messages: { + unexpected: "Unexpected empty {{type}} pattern." + } + }, + + create(context) { + return { + ObjectPattern(node) { + if (node.properties.length === 0) { + context.report({ node, messageId: "unexpected", data: { type: "object" } }); + } + }, + ArrayPattern(node) { + if (node.elements.length === 0) { + context.report({ node, messageId: "unexpected", data: { type: "array" } }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-empty.js b/node_modules/eslint/lib/rules/no-empty.js new file mode 100644 index 000000000..45bf03c13 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-empty.js @@ -0,0 +1,86 @@ +/** + * @fileoverview Rule to flag use of an empty block statement + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow empty block statements", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-empty" + }, + + schema: [ + { + type: "object", + properties: { + allowEmptyCatch: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "Empty {{type}} statement." + } + }, + + create(context) { + const options = context.options[0] || {}, + allowEmptyCatch = options.allowEmptyCatch || false; + + const sourceCode = context.getSourceCode(); + + return { + BlockStatement(node) { + + // if the body is not empty, we can just return immediately + if (node.body.length !== 0) { + return; + } + + // a function is generally allowed to be empty + if (astUtils.isFunction(node.parent)) { + return; + } + + if (allowEmptyCatch && node.parent.type === "CatchClause") { + return; + } + + // any other block is only allowed to be empty, if it contains a comment + if (sourceCode.getCommentsInside(node).length > 0) { + return; + } + + context.report({ node, messageId: "unexpected", data: { type: "block" } }); + }, + + SwitchStatement(node) { + + if (typeof node.cases === "undefined" || node.cases.length === 0) { + context.report({ node, messageId: "unexpected", data: { type: "switch" } }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-eq-null.js b/node_modules/eslint/lib/rules/no-eq-null.js new file mode 100644 index 000000000..b8dead96d --- /dev/null +++ b/node_modules/eslint/lib/rules/no-eq-null.js @@ -0,0 +1,46 @@ +/** + * @fileoverview Rule to flag comparisons to null without a type-checking + * operator. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `null` comparisons without type-checking operators", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-eq-null" + }, + + schema: [], + + messages: { + unexpected: "Use '===' to compare with null." + } + }, + + create(context) { + + return { + + BinaryExpression(node) { + const badOperator = node.operator === "==" || node.operator === "!="; + + if (node.right.type === "Literal" && node.right.raw === "null" && badOperator || + node.left.type === "Literal" && node.left.raw === "null" && badOperator) { + context.report({ node, messageId: "unexpected" }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-eval.js b/node_modules/eslint/lib/rules/no-eval.js new file mode 100644 index 000000000..a020fdee0 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-eval.js @@ -0,0 +1,277 @@ +/** + * @fileoverview Rule to flag use of eval() statement + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const candidatesOfGlobalObject = Object.freeze([ + "global", + "window", + "globalThis" +]); + +/** + * Checks a given node is a MemberExpression node which has the specified name's + * property. + * @param {ASTNode} node A node to check. + * @param {string} name A name to check. + * @returns {boolean} `true` if the node is a MemberExpression node which has + * the specified name's property + */ +function isMember(node, name) { + return astUtils.isSpecificMemberAccess(node, null, name); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of `eval()`", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-eval" + }, + + schema: [ + { + type: "object", + properties: { + allowIndirect: { type: "boolean", default: false } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "eval can be harmful." + } + }, + + create(context) { + const allowIndirect = Boolean( + context.options[0] && + context.options[0].allowIndirect + ); + const sourceCode = context.getSourceCode(); + let funcInfo = null; + + /** + * Pushs a variable scope (Program or Function) information to the stack. + * + * This is used in order to check whether or not `this` binding is a + * reference to the global object. + * @param {ASTNode} node A node of the scope. This is one of Program, + * FunctionDeclaration, FunctionExpression, and ArrowFunctionExpression. + * @returns {void} + */ + function enterVarScope(node) { + const strict = context.getScope().isStrict; + + funcInfo = { + upper: funcInfo, + node, + strict, + defaultThis: false, + initialized: strict + }; + } + + /** + * Pops a variable scope from the stack. + * @returns {void} + */ + function exitVarScope() { + funcInfo = funcInfo.upper; + } + + /** + * Reports a given node. + * + * `node` is `Identifier` or `MemberExpression`. + * The parent of `node` might be `CallExpression`. + * + * The location of the report is always `eval` `Identifier` (or possibly + * `Literal`). The type of the report is `CallExpression` if the parent is + * `CallExpression`. Otherwise, it's the given node type. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function report(node) { + const parent = node.parent; + const locationNode = node.type === "MemberExpression" + ? node.property + : node; + + const reportNode = parent.type === "CallExpression" && parent.callee === node + ? parent + : node; + + context.report({ + node: reportNode, + loc: locationNode.loc, + messageId: "unexpected" + }); + } + + /** + * Reports accesses of `eval` via the global object. + * @param {eslint-scope.Scope} globalScope The global scope. + * @returns {void} + */ + function reportAccessingEvalViaGlobalObject(globalScope) { + for (let i = 0; i < candidatesOfGlobalObject.length; ++i) { + const name = candidatesOfGlobalObject[i]; + const variable = astUtils.getVariableByName(globalScope, name); + + if (!variable) { + continue; + } + + const references = variable.references; + + for (let j = 0; j < references.length; ++j) { + const identifier = references[j].identifier; + let node = identifier.parent; + + // To detect code like `window.window.eval`. + while (isMember(node, name)) { + node = node.parent; + } + + // Reports. + if (isMember(node, "eval")) { + report(node); + } + } + } + } + + /** + * Reports all accesses of `eval` (excludes direct calls to eval). + * @param {eslint-scope.Scope} globalScope The global scope. + * @returns {void} + */ + function reportAccessingEval(globalScope) { + const variable = astUtils.getVariableByName(globalScope, "eval"); + + if (!variable) { + return; + } + + const references = variable.references; + + for (let i = 0; i < references.length; ++i) { + const reference = references[i]; + const id = reference.identifier; + + if (id.name === "eval" && !astUtils.isCallee(id)) { + + // Is accessing to eval (excludes direct calls to eval) + report(id); + } + } + } + + if (allowIndirect) { + + // Checks only direct calls to eval. It's simple! + return { + "CallExpression:exit"(node) { + const callee = node.callee; + + /* + * Optional call (`eval?.("code")`) is not direct eval. + * The direct eval is only step 6.a.vi of https://tc39.es/ecma262/#sec-function-calls-runtime-semantics-evaluation + * But the optional call is https://tc39.es/ecma262/#sec-optional-chaining-chain-evaluation + */ + if (!node.optional && astUtils.isSpecificId(callee, "eval")) { + report(callee); + } + } + }; + } + + return { + "CallExpression:exit"(node) { + const callee = node.callee; + + if (astUtils.isSpecificId(callee, "eval")) { + report(callee); + } + }, + + Program(node) { + const scope = context.getScope(), + features = context.parserOptions.ecmaFeatures || {}, + strict = + scope.isStrict || + node.sourceType === "module" || + (features.globalReturn && scope.childScopes[0].isStrict); + + funcInfo = { + upper: null, + node, + strict, + defaultThis: true, + initialized: true + }; + }, + + "Program:exit"() { + const globalScope = context.getScope(); + + exitVarScope(); + reportAccessingEval(globalScope); + reportAccessingEvalViaGlobalObject(globalScope); + }, + + FunctionDeclaration: enterVarScope, + "FunctionDeclaration:exit": exitVarScope, + FunctionExpression: enterVarScope, + "FunctionExpression:exit": exitVarScope, + ArrowFunctionExpression: enterVarScope, + "ArrowFunctionExpression:exit": exitVarScope, + + ThisExpression(node) { + if (!isMember(node.parent, "eval")) { + return; + } + + /* + * `this.eval` is found. + * Checks whether or not the value of `this` is the global object. + */ + if (!funcInfo.initialized) { + funcInfo.initialized = true; + funcInfo.defaultThis = astUtils.isDefaultThisBinding( + funcInfo.node, + sourceCode + ); + } + + if (!funcInfo.strict && funcInfo.defaultThis) { + + // `this.eval` is possible built-in `eval`. + report(node.parent); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-ex-assign.js b/node_modules/eslint/lib/rules/no-ex-assign.js new file mode 100644 index 000000000..116392036 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-ex-assign.js @@ -0,0 +1,52 @@ +/** + * @fileoverview Rule to flag assignment of the exception parameter + * @author Stephen Murray + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow reassigning exceptions in `catch` clauses", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-ex-assign" + }, + + schema: [], + + messages: { + unexpected: "Do not assign to the exception parameter." + } + }, + + create(context) { + + /** + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + astUtils.getModifyingReferences(variable.references).forEach(reference => { + context.report({ node: reference.identifier, messageId: "unexpected" }); + }); + } + + return { + CatchClause(node) { + context.getDeclaredVariables(node).forEach(checkVariable); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-extend-native.js b/node_modules/eslint/lib/rules/no-extend-native.js new file mode 100644 index 000000000..db365b509 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-extend-native.js @@ -0,0 +1,178 @@ +/** + * @fileoverview Rule to flag adding properties to native object's prototypes. + * @author David Nelson + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const globals = require("globals"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow extending native types", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-extend-native" + }, + + schema: [ + { + type: "object", + properties: { + exceptions: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "{{builtin}} prototype is read only, properties should not be added." + } + }, + + create(context) { + + const config = context.options[0] || {}; + const exceptions = new Set(config.exceptions || []); + const modifiedBuiltins = new Set( + Object.keys(globals.builtin) + .filter(builtin => builtin[0].toUpperCase() === builtin[0]) + .filter(builtin => !exceptions.has(builtin)) + ); + + /** + * Reports a lint error for the given node. + * @param {ASTNode} node The node to report. + * @param {string} builtin The name of the native builtin being extended. + * @returns {void} + */ + function reportNode(node, builtin) { + context.report({ + node, + messageId: "unexpected", + data: { + builtin + } + }); + } + + /** + * Check to see if the `prototype` property of the given object + * identifier node is being accessed. + * @param {ASTNode} identifierNode The Identifier representing the object + * to check. + * @returns {boolean} True if the identifier is the object of a + * MemberExpression and its `prototype` property is being accessed, + * false otherwise. + */ + function isPrototypePropertyAccessed(identifierNode) { + return Boolean( + identifierNode && + identifierNode.parent && + identifierNode.parent.type === "MemberExpression" && + identifierNode.parent.object === identifierNode && + astUtils.getStaticPropertyName(identifierNode.parent) === "prototype" + ); + } + + /** + * Check if it's an assignment to the property of the given node. + * Example: `*.prop = 0` // the `*` is the given node. + * @param {ASTNode} node The node to check. + * @returns {boolean} True if an assignment to the property of the node. + */ + function isAssigningToPropertyOf(node) { + return ( + node.parent.type === "MemberExpression" && + node.parent.object === node && + node.parent.parent.type === "AssignmentExpression" && + node.parent.parent.left === node.parent + ); + } + + /** + * Checks if the given node is at the first argument of the method call of `Object.defineProperty()` or `Object.defineProperties()`. + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node is at the first argument of the method call of `Object.defineProperty()` or `Object.defineProperties()`. + */ + function isInDefinePropertyCall(node) { + return ( + node.parent.type === "CallExpression" && + node.parent.arguments[0] === node && + astUtils.isSpecificMemberAccess(node.parent.callee, "Object", /^definePropert(?:y|ies)$/u) + ); + } + + /** + * Check to see if object prototype access is part of a prototype + * extension. There are three ways a prototype can be extended: + * 1. Assignment to prototype property (Object.prototype.foo = 1) + * 2. Object.defineProperty()/Object.defineProperties() on a prototype + * If prototype extension is detected, report the AssignmentExpression + * or CallExpression node. + * @param {ASTNode} identifierNode The Identifier representing the object + * which prototype is being accessed and possibly extended. + * @returns {void} + */ + function checkAndReportPrototypeExtension(identifierNode) { + if (!isPrototypePropertyAccessed(identifierNode)) { + return; // This is not `*.prototype` access. + } + + /* + * `identifierNode.parent` is a MamberExpression `*.prototype`. + * If it's an optional member access, it may be wrapped by a `ChainExpression` node. + */ + const prototypeNode = + identifierNode.parent.parent.type === "ChainExpression" + ? identifierNode.parent.parent + : identifierNode.parent; + + if (isAssigningToPropertyOf(prototypeNode)) { + + // `*.prototype` -> MemberExpression -> AssignmentExpression + reportNode(prototypeNode.parent.parent, identifierNode.name); + } else if (isInDefinePropertyCall(prototypeNode)) { + + // `*.prototype` -> CallExpression + reportNode(prototypeNode.parent, identifierNode.name); + } + } + + return { + + "Program:exit"() { + const globalScope = context.getScope(); + + modifiedBuiltins.forEach(builtin => { + const builtinVar = globalScope.set.get(builtin); + + if (builtinVar && builtinVar.references) { + builtinVar.references + .map(ref => ref.identifier) + .forEach(checkAndReportPrototypeExtension); + } + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-extra-bind.js b/node_modules/eslint/lib/rules/no-extra-bind.js new file mode 100644 index 000000000..2db440dc1 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-extra-bind.js @@ -0,0 +1,213 @@ +/** + * @fileoverview Rule to flag unnecessary bind calls + * @author Bence Dányi + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SIDE_EFFECT_FREE_NODE_TYPES = new Set(["Literal", "Identifier", "ThisExpression", "FunctionExpression"]); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary calls to `.bind()`", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-extra-bind" + }, + + schema: [], + fixable: "code", + + messages: { + unexpected: "The function binding is unnecessary." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + let scopeInfo = null; + + /** + * Checks if a node is free of side effects. + * + * This check is stricter than it needs to be, in order to keep the implementation simple. + * @param {ASTNode} node A node to check. + * @returns {boolean} True if the node is known to be side-effect free, false otherwise. + */ + function isSideEffectFree(node) { + return SIDE_EFFECT_FREE_NODE_TYPES.has(node.type); + } + + /** + * Reports a given function node. + * @param {ASTNode} node A node to report. This is a FunctionExpression or + * an ArrowFunctionExpression. + * @returns {void} + */ + function report(node) { + const memberNode = node.parent; + const callNode = memberNode.parent.type === "ChainExpression" + ? memberNode.parent.parent + : memberNode.parent; + + context.report({ + node: callNode, + messageId: "unexpected", + loc: memberNode.property.loc, + + fix(fixer) { + if (!isSideEffectFree(callNode.arguments[0])) { + return null; + } + + /* + * The list of the first/last token pair of a removal range. + * This is two parts because closing parentheses may exist between the method name and arguments. + * E.g. `(function(){}.bind ) (obj)` + * ^^^^^ ^^^^^ < removal ranges + * E.g. `(function(){}?.['bind'] ) ?.(obj)` + * ^^^^^^^^^^ ^^^^^^^ < removal ranges + */ + const tokenPairs = [ + [ + + // `.`, `?.`, or `[` token. + sourceCode.getTokenAfter( + memberNode.object, + astUtils.isNotClosingParenToken + ), + + // property name or `]` token. + sourceCode.getLastToken(memberNode) + ], + [ + + // `?.` or `(` token of arguments. + sourceCode.getTokenAfter( + memberNode, + astUtils.isNotClosingParenToken + ), + + // `)` token of arguments. + sourceCode.getLastToken(callNode) + ] + ]; + const firstTokenToRemove = tokenPairs[0][0]; + const lastTokenToRemove = tokenPairs[1][1]; + + if (sourceCode.commentsExistBetween(firstTokenToRemove, lastTokenToRemove)) { + return null; + } + + return tokenPairs.map(([start, end]) => + fixer.removeRange([start.range[0], end.range[1]])); + } + }); + } + + /** + * Checks whether or not a given function node is the callee of `.bind()` + * method. + * + * e.g. `(function() {}.bind(foo))` + * @param {ASTNode} node A node to report. This is a FunctionExpression or + * an ArrowFunctionExpression. + * @returns {boolean} `true` if the node is the callee of `.bind()` method. + */ + function isCalleeOfBindMethod(node) { + if (!astUtils.isSpecificMemberAccess(node.parent, null, "bind")) { + return false; + } + + // The node of `*.bind` member access. + const bindNode = node.parent.parent.type === "ChainExpression" + ? node.parent.parent + : node.parent; + + return ( + bindNode.parent.type === "CallExpression" && + bindNode.parent.callee === bindNode && + bindNode.parent.arguments.length === 1 && + bindNode.parent.arguments[0].type !== "SpreadElement" + ); + } + + /** + * Adds a scope information object to the stack. + * @param {ASTNode} node A node to add. This node is a FunctionExpression + * or a FunctionDeclaration node. + * @returns {void} + */ + function enterFunction(node) { + scopeInfo = { + isBound: isCalleeOfBindMethod(node), + thisFound: false, + upper: scopeInfo + }; + } + + /** + * Removes the scope information object from the top of the stack. + * At the same time, this reports the function node if the function has + * `.bind()` and the `this` keywords found. + * @param {ASTNode} node A node to remove. This node is a + * FunctionExpression or a FunctionDeclaration node. + * @returns {void} + */ + function exitFunction(node) { + if (scopeInfo.isBound && !scopeInfo.thisFound) { + report(node); + } + + scopeInfo = scopeInfo.upper; + } + + /** + * Reports a given arrow function if the function is callee of `.bind()` + * method. + * @param {ASTNode} node A node to report. This node is an + * ArrowFunctionExpression. + * @returns {void} + */ + function exitArrowFunction(node) { + if (isCalleeOfBindMethod(node)) { + report(node); + } + } + + /** + * Set the mark as the `this` keyword was found in this scope. + * @returns {void} + */ + function markAsThisFound() { + if (scopeInfo) { + scopeInfo.thisFound = true; + } + } + + return { + "ArrowFunctionExpression:exit": exitArrowFunction, + FunctionDeclaration: enterFunction, + "FunctionDeclaration:exit": exitFunction, + FunctionExpression: enterFunction, + "FunctionExpression:exit": exitFunction, + ThisExpression: markAsThisFound + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-extra-boolean-cast.js b/node_modules/eslint/lib/rules/no-extra-boolean-cast.js new file mode 100644 index 000000000..6ae3ea62c --- /dev/null +++ b/node_modules/eslint/lib/rules/no-extra-boolean-cast.js @@ -0,0 +1,316 @@ +/** + * @fileoverview Rule to flag unnecessary double negation in Boolean contexts + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const eslintUtils = require("eslint-utils"); + +const precedence = astUtils.getPrecedence; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary boolean casts", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-extra-boolean-cast" + }, + + schema: [{ + type: "object", + properties: { + enforceForLogicalOperands: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], + fixable: "code", + + messages: { + unexpectedCall: "Redundant Boolean call.", + unexpectedNegation: "Redundant double negation." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + // Node types which have a test which will coerce values to booleans. + const BOOLEAN_NODE_TYPES = [ + "IfStatement", + "DoWhileStatement", + "WhileStatement", + "ConditionalExpression", + "ForStatement" + ]; + + /** + * Check if a node is a Boolean function or constructor. + * @param {ASTNode} node the node + * @returns {boolean} If the node is Boolean function or constructor + */ + function isBooleanFunctionOrConstructorCall(node) { + + // Boolean() and new Boolean() + return (node.type === "CallExpression" || node.type === "NewExpression") && + node.callee.type === "Identifier" && + node.callee.name === "Boolean"; + } + + /** + * Checks whether the node is a logical expression and that the option is enabled + * @param {ASTNode} node the node + * @returns {boolean} if the node is a logical expression and option is enabled + */ + function isLogicalContext(node) { + return node.type === "LogicalExpression" && + (node.operator === "||" || node.operator === "&&") && + (context.options.length && context.options[0].enforceForLogicalOperands === true); + + } + + + /** + * Check if a node is in a context where its value would be coerced to a boolean at runtime. + * @param {ASTNode} node The node + * @returns {boolean} If it is in a boolean context + */ + function isInBooleanContext(node) { + return ( + (isBooleanFunctionOrConstructorCall(node.parent) && + node === node.parent.arguments[0]) || + + (BOOLEAN_NODE_TYPES.indexOf(node.parent.type) !== -1 && + node === node.parent.test) || + + // ! + (node.parent.type === "UnaryExpression" && + node.parent.operator === "!") + ); + } + + /** + * Checks whether the node is a context that should report an error + * Acts recursively if it is in a logical context + * @param {ASTNode} node the node + * @returns {boolean} If the node is in one of the flagged contexts + */ + function isInFlaggedContext(node) { + if (node.parent.type === "ChainExpression") { + return isInFlaggedContext(node.parent); + } + + return isInBooleanContext(node) || + (isLogicalContext(node.parent) && + + // For nested logical statements + isInFlaggedContext(node.parent) + ); + } + + + /** + * Check if a node has comments inside. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if it has comments inside. + */ + function hasCommentsInside(node) { + return Boolean(sourceCode.getCommentsInside(node).length); + } + + /** + * Checks if the given node is wrapped in grouping parentheses. Parentheses for constructs such as if() don't count. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is parenthesized. + * @private + */ + function isParenthesized(node) { + return eslintUtils.isParenthesized(1, node, sourceCode); + } + + /** + * Determines whether the given node needs to be parenthesized when replacing the previous node. + * It assumes that `previousNode` is the node to be reported by this rule, so it has a limited list + * of possible parent node types. By the same assumption, the node's role in a particular parent is already known. + * For example, if the parent is `ConditionalExpression`, `previousNode` must be its `test` child. + * @param {ASTNode} previousNode Previous node. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node needs to be parenthesized. + */ + function needsParens(previousNode, node) { + if (previousNode.parent.type === "ChainExpression") { + return needsParens(previousNode.parent, node); + } + if (isParenthesized(previousNode)) { + + // parentheses around the previous node will stay, so there is no need for an additional pair + return false; + } + + // parent of the previous node will become parent of the replacement node + const parent = previousNode.parent; + + switch (parent.type) { + case "CallExpression": + case "NewExpression": + return node.type === "SequenceExpression"; + case "IfStatement": + case "DoWhileStatement": + case "WhileStatement": + case "ForStatement": + return false; + case "ConditionalExpression": + return precedence(node) <= precedence(parent); + case "UnaryExpression": + return precedence(node) < precedence(parent); + case "LogicalExpression": + if (astUtils.isMixedLogicalAndCoalesceExpressions(node, parent)) { + return true; + } + if (previousNode === parent.left) { + return precedence(node) < precedence(parent); + } + return precedence(node) <= precedence(parent); + + /* istanbul ignore next */ + default: + throw new Error(`Unexpected parent type: ${parent.type}`); + } + } + + return { + UnaryExpression(node) { + const parent = node.parent; + + + // Exit early if it's guaranteed not to match + if (node.operator !== "!" || + parent.type !== "UnaryExpression" || + parent.operator !== "!") { + return; + } + + + if (isInFlaggedContext(parent)) { + context.report({ + node: parent, + messageId: "unexpectedNegation", + fix(fixer) { + if (hasCommentsInside(parent)) { + return null; + } + + if (needsParens(parent, node.argument)) { + return fixer.replaceText(parent, `(${sourceCode.getText(node.argument)})`); + } + + let prefix = ""; + const tokenBefore = sourceCode.getTokenBefore(parent); + const firstReplacementToken = sourceCode.getFirstToken(node.argument); + + if ( + tokenBefore && + tokenBefore.range[1] === parent.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, firstReplacementToken) + ) { + prefix = " "; + } + + return fixer.replaceText(parent, prefix + sourceCode.getText(node.argument)); + } + }); + } + }, + + CallExpression(node) { + if (node.callee.type !== "Identifier" || node.callee.name !== "Boolean") { + return; + } + + if (isInFlaggedContext(node)) { + context.report({ + node, + messageId: "unexpectedCall", + fix(fixer) { + const parent = node.parent; + + if (node.arguments.length === 0) { + if (parent.type === "UnaryExpression" && parent.operator === "!") { + + /* + * !Boolean() -> true + */ + + if (hasCommentsInside(parent)) { + return null; + } + + const replacement = "true"; + let prefix = ""; + const tokenBefore = sourceCode.getTokenBefore(parent); + + if ( + tokenBefore && + tokenBefore.range[1] === parent.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, replacement) + ) { + prefix = " "; + } + + return fixer.replaceText(parent, prefix + replacement); + } + + /* + * Boolean() -> false + */ + + if (hasCommentsInside(node)) { + return null; + } + + return fixer.replaceText(node, "false"); + } + + if (node.arguments.length === 1) { + const argument = node.arguments[0]; + + if (argument.type === "SpreadElement" || hasCommentsInside(node)) { + return null; + } + + /* + * Boolean(expression) -> expression + */ + + if (needsParens(node, argument)) { + return fixer.replaceText(node, `(${sourceCode.getText(argument)})`); + } + + return fixer.replaceText(node, sourceCode.getText(argument)); + } + + // two or more arguments + return null; + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-extra-label.js b/node_modules/eslint/lib/rules/no-extra-label.js new file mode 100644 index 000000000..81406e760 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-extra-label.js @@ -0,0 +1,149 @@ +/** + * @fileoverview Rule to disallow unnecessary labels + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary labels", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-extra-label" + }, + + schema: [], + fixable: "code", + + messages: { + unexpected: "This label '{{name}}' is unnecessary." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + let scopeInfo = null; + + /** + * Creates a new scope with a breakable statement. + * @param {ASTNode} node A node to create. This is a BreakableStatement. + * @returns {void} + */ + function enterBreakableStatement(node) { + scopeInfo = { + label: node.parent.type === "LabeledStatement" ? node.parent.label : null, + breakable: true, + upper: scopeInfo + }; + } + + /** + * Removes the top scope of the stack. + * @returns {void} + */ + function exitBreakableStatement() { + scopeInfo = scopeInfo.upper; + } + + /** + * Creates a new scope with a labeled statement. + * + * This ignores it if the body is a breakable statement. + * In this case it's handled in the `enterBreakableStatement` function. + * @param {ASTNode} node A node to create. This is a LabeledStatement. + * @returns {void} + */ + function enterLabeledStatement(node) { + if (!astUtils.isBreakableStatement(node.body)) { + scopeInfo = { + label: node.label, + breakable: false, + upper: scopeInfo + }; + } + } + + /** + * Removes the top scope of the stack. + * + * This ignores it if the body is a breakable statement. + * In this case it's handled in the `exitBreakableStatement` function. + * @param {ASTNode} node A node. This is a LabeledStatement. + * @returns {void} + */ + function exitLabeledStatement(node) { + if (!astUtils.isBreakableStatement(node.body)) { + scopeInfo = scopeInfo.upper; + } + } + + /** + * Reports a given control node if it's unnecessary. + * @param {ASTNode} node A node. This is a BreakStatement or a + * ContinueStatement. + * @returns {void} + */ + function reportIfUnnecessary(node) { + if (!node.label) { + return; + } + + const labelNode = node.label; + + for (let info = scopeInfo; info !== null; info = info.upper) { + if (info.breakable || info.label && info.label.name === labelNode.name) { + if (info.breakable && info.label && info.label.name === labelNode.name) { + context.report({ + node: labelNode, + messageId: "unexpected", + data: labelNode, + fix(fixer) { + const breakOrContinueToken = sourceCode.getFirstToken(node); + + if (sourceCode.commentsExistBetween(breakOrContinueToken, labelNode)) { + return null; + } + + return fixer.removeRange([breakOrContinueToken.range[1], labelNode.range[1]]); + } + }); + } + return; + } + } + } + + return { + WhileStatement: enterBreakableStatement, + "WhileStatement:exit": exitBreakableStatement, + DoWhileStatement: enterBreakableStatement, + "DoWhileStatement:exit": exitBreakableStatement, + ForStatement: enterBreakableStatement, + "ForStatement:exit": exitBreakableStatement, + ForInStatement: enterBreakableStatement, + "ForInStatement:exit": exitBreakableStatement, + ForOfStatement: enterBreakableStatement, + "ForOfStatement:exit": exitBreakableStatement, + SwitchStatement: enterBreakableStatement, + "SwitchStatement:exit": exitBreakableStatement, + LabeledStatement: enterLabeledStatement, + "LabeledStatement:exit": exitLabeledStatement, + BreakStatement: reportIfUnnecessary, + ContinueStatement: reportIfUnnecessary + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-extra-parens.js b/node_modules/eslint/lib/rules/no-extra-parens.js new file mode 100644 index 000000000..e9d394c61 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-extra-parens.js @@ -0,0 +1,1177 @@ +/** + * @fileoverview Disallow parenthesising higher precedence subexpressions. + * @author Michael Ficarra + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const { isParenthesized: isParenthesizedRaw } = require("eslint-utils"); +const astUtils = require("./utils/ast-utils.js"); + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow unnecessary parentheses", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-extra-parens" + }, + + fixable: "code", + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["functions"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["all"] + }, + { + type: "object", + properties: { + conditionalAssign: { type: "boolean" }, + nestedBinaryExpressions: { type: "boolean" }, + returnAssign: { type: "boolean" }, + ignoreJSX: { enum: ["none", "all", "single-line", "multi-line"] }, + enforceForArrowConditionals: { type: "boolean" }, + enforceForSequenceExpressions: { type: "boolean" }, + enforceForNewInMemberExpressions: { type: "boolean" }, + enforceForFunctionPrototypeMethods: { type: "boolean" } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + messages: { + unexpected: "Unnecessary parentheses around expression." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + const tokensToIgnore = new WeakSet(); + const precedence = astUtils.getPrecedence; + const ALL_NODES = context.options[0] !== "functions"; + const EXCEPT_COND_ASSIGN = ALL_NODES && context.options[1] && context.options[1].conditionalAssign === false; + const NESTED_BINARY = ALL_NODES && context.options[1] && context.options[1].nestedBinaryExpressions === false; + const EXCEPT_RETURN_ASSIGN = ALL_NODES && context.options[1] && context.options[1].returnAssign === false; + const IGNORE_JSX = ALL_NODES && context.options[1] && context.options[1].ignoreJSX; + const IGNORE_ARROW_CONDITIONALS = ALL_NODES && context.options[1] && + context.options[1].enforceForArrowConditionals === false; + const IGNORE_SEQUENCE_EXPRESSIONS = ALL_NODES && context.options[1] && + context.options[1].enforceForSequenceExpressions === false; + const IGNORE_NEW_IN_MEMBER_EXPR = ALL_NODES && context.options[1] && + context.options[1].enforceForNewInMemberExpressions === false; + const IGNORE_FUNCTION_PROTOTYPE_METHODS = ALL_NODES && context.options[1] && + context.options[1].enforceForFunctionPrototypeMethods === false; + + const PRECEDENCE_OF_ASSIGNMENT_EXPR = precedence({ type: "AssignmentExpression" }); + const PRECEDENCE_OF_UPDATE_EXPR = precedence({ type: "UpdateExpression" }); + + let reportsBuffer; + + /** + * Determines whether the given node is a `call` or `apply` method call, invoked directly on a `FunctionExpression` node. + * Example: function(){}.call() + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is an immediate `call` or `apply` method call. + * @private + */ + function isImmediateFunctionPrototypeMethodCall(node) { + const callNode = astUtils.skipChainExpression(node); + + if (callNode.type !== "CallExpression") { + return false; + } + const callee = astUtils.skipChainExpression(callNode.callee); + + return ( + callee.type === "MemberExpression" && + callee.object.type === "FunctionExpression" && + ["call", "apply"].includes(astUtils.getStaticPropertyName(callee)) + ); + } + + /** + * Determines if this rule should be enforced for a node given the current configuration. + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the rule should be enforced for this node. + * @private + */ + function ruleApplies(node) { + if (node.type === "JSXElement" || node.type === "JSXFragment") { + const isSingleLine = node.loc.start.line === node.loc.end.line; + + switch (IGNORE_JSX) { + + // Exclude this JSX element from linting + case "all": + return false; + + // Exclude this JSX element if it is multi-line element + case "multi-line": + return isSingleLine; + + // Exclude this JSX element if it is single-line element + case "single-line": + return !isSingleLine; + + // Nothing special to be done for JSX elements + case "none": + break; + + // no default + } + } + + if (node.type === "SequenceExpression" && IGNORE_SEQUENCE_EXPRESSIONS) { + return false; + } + + if (isImmediateFunctionPrototypeMethodCall(node) && IGNORE_FUNCTION_PROTOTYPE_METHODS) { + return false; + } + + return ALL_NODES || node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression"; + } + + /** + * Determines if a node is surrounded by parentheses. + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is parenthesised. + * @private + */ + function isParenthesised(node) { + return isParenthesizedRaw(1, node, sourceCode); + } + + /** + * Determines if a node is surrounded by parentheses twice. + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is doubly parenthesised. + * @private + */ + function isParenthesisedTwice(node) { + return isParenthesizedRaw(2, node, sourceCode); + } + + /** + * Determines if a node is surrounded by (potentially) invalid parentheses. + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is incorrectly parenthesised. + * @private + */ + function hasExcessParens(node) { + return ruleApplies(node) && isParenthesised(node); + } + + /** + * Determines if a node that is expected to be parenthesised is surrounded by + * (potentially) invalid extra parentheses. + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is has an unexpected extra pair of parentheses. + * @private + */ + function hasDoubleExcessParens(node) { + return ruleApplies(node) && isParenthesisedTwice(node); + } + + /** + * Determines if a node that is expected to be parenthesised is surrounded by + * (potentially) invalid extra parentheses with considering precedence level of the node. + * If the preference level of the node is not higher or equal to precedence lower limit, it also checks + * whether the node is surrounded by parentheses twice or not. + * @param {ASTNode} node The node to be checked. + * @param {number} precedenceLowerLimit The lower limit of precedence. + * @returns {boolean} True if the node is has an unexpected extra pair of parentheses. + * @private + */ + function hasExcessParensWithPrecedence(node, precedenceLowerLimit) { + if (ruleApplies(node) && isParenthesised(node)) { + if ( + precedence(node) >= precedenceLowerLimit || + isParenthesisedTwice(node) + ) { + return true; + } + } + return false; + } + + /** + * Determines if a node test expression is allowed to have a parenthesised assignment + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the assignment can be parenthesised. + * @private + */ + function isCondAssignException(node) { + return EXCEPT_COND_ASSIGN && node.test.type === "AssignmentExpression"; + } + + /** + * Determines if a node is in a return statement + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is in a return statement. + * @private + */ + function isInReturnStatement(node) { + for (let currentNode = node; currentNode; currentNode = currentNode.parent) { + if ( + currentNode.type === "ReturnStatement" || + (currentNode.type === "ArrowFunctionExpression" && currentNode.body.type !== "BlockStatement") + ) { + return true; + } + } + + return false; + } + + /** + * Determines if a constructor function is newed-up with parens + * @param {ASTNode} newExpression The NewExpression node to be checked. + * @returns {boolean} True if the constructor is called with parens. + * @private + */ + function isNewExpressionWithParens(newExpression) { + const lastToken = sourceCode.getLastToken(newExpression); + const penultimateToken = sourceCode.getTokenBefore(lastToken); + + return newExpression.arguments.length > 0 || + ( + + // The expression should end with its own parens, e.g., new new foo() is not a new expression with parens + astUtils.isOpeningParenToken(penultimateToken) && + astUtils.isClosingParenToken(lastToken) && + newExpression.callee.range[1] < newExpression.range[1] + ); + } + + /** + * Determines if a node is or contains an assignment expression + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is or contains an assignment expression. + * @private + */ + function containsAssignment(node) { + if (node.type === "AssignmentExpression") { + return true; + } + if (node.type === "ConditionalExpression" && + (node.consequent.type === "AssignmentExpression" || node.alternate.type === "AssignmentExpression")) { + return true; + } + if ((node.left && node.left.type === "AssignmentExpression") || + (node.right && node.right.type === "AssignmentExpression")) { + return true; + } + + return false; + } + + /** + * Determines if a node is contained by or is itself a return statement and is allowed to have a parenthesised assignment + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the assignment can be parenthesised. + * @private + */ + function isReturnAssignException(node) { + if (!EXCEPT_RETURN_ASSIGN || !isInReturnStatement(node)) { + return false; + } + + if (node.type === "ReturnStatement") { + return node.argument && containsAssignment(node.argument); + } + if (node.type === "ArrowFunctionExpression" && node.body.type !== "BlockStatement") { + return containsAssignment(node.body); + } + return containsAssignment(node); + + } + + /** + * Determines if a node following a [no LineTerminator here] restriction is + * surrounded by (potentially) invalid extra parentheses. + * @param {Token} token The token preceding the [no LineTerminator here] restriction. + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is incorrectly parenthesised. + * @private + */ + function hasExcessParensNoLineTerminator(token, node) { + if (token.loc.end.line === node.loc.start.line) { + return hasExcessParens(node); + } + + return hasDoubleExcessParens(node); + } + + /** + * Determines whether a node should be preceded by an additional space when removing parens + * @param {ASTNode} node node to evaluate; must be surrounded by parentheses + * @returns {boolean} `true` if a space should be inserted before the node + * @private + */ + function requiresLeadingSpace(node) { + const leftParenToken = sourceCode.getTokenBefore(node); + const tokenBeforeLeftParen = sourceCode.getTokenBefore(leftParenToken, { includeComments: true }); + const tokenAfterLeftParen = sourceCode.getTokenAfter(leftParenToken, { includeComments: true }); + + return tokenBeforeLeftParen && + tokenBeforeLeftParen.range[1] === leftParenToken.range[0] && + leftParenToken.range[1] === tokenAfterLeftParen.range[0] && + !astUtils.canTokensBeAdjacent(tokenBeforeLeftParen, tokenAfterLeftParen); + } + + /** + * Determines whether a node should be followed by an additional space when removing parens + * @param {ASTNode} node node to evaluate; must be surrounded by parentheses + * @returns {boolean} `true` if a space should be inserted after the node + * @private + */ + function requiresTrailingSpace(node) { + const nextTwoTokens = sourceCode.getTokensAfter(node, { count: 2 }); + const rightParenToken = nextTwoTokens[0]; + const tokenAfterRightParen = nextTwoTokens[1]; + const tokenBeforeRightParen = sourceCode.getLastToken(node); + + return rightParenToken && tokenAfterRightParen && + !sourceCode.isSpaceBetweenTokens(rightParenToken, tokenAfterRightParen) && + !astUtils.canTokensBeAdjacent(tokenBeforeRightParen, tokenAfterRightParen); + } + + /** + * Determines if a given expression node is an IIFE + * @param {ASTNode} node The node to check + * @returns {boolean} `true` if the given node is an IIFE + */ + function isIIFE(node) { + const maybeCallNode = astUtils.skipChainExpression(node); + + return maybeCallNode.type === "CallExpression" && maybeCallNode.callee.type === "FunctionExpression"; + } + + /** + * Determines if the given node can be the assignment target in destructuring or the LHS of an assignment. + * This is to avoid an autofix that could change behavior because parsers mistakenly allow invalid syntax, + * such as `(a = b) = c` and `[(a = b) = c] = []`. Ideally, this function shouldn't be necessary. + * @param {ASTNode} [node] The node to check + * @returns {boolean} `true` if the given node can be a valid assignment target + */ + function canBeAssignmentTarget(node) { + return node && (node.type === "Identifier" || node.type === "MemberExpression"); + } + + /** + * Report the node + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function report(node) { + const leftParenToken = sourceCode.getTokenBefore(node); + const rightParenToken = sourceCode.getTokenAfter(node); + + if (!isParenthesisedTwice(node)) { + if (tokensToIgnore.has(sourceCode.getFirstToken(node))) { + return; + } + + if (isIIFE(node) && !isParenthesised(node.callee)) { + return; + } + } + + /** + * Finishes reporting + * @returns {void} + * @private + */ + function finishReport() { + context.report({ + node, + loc: leftParenToken.loc, + messageId: "unexpected", + fix(fixer) { + const parenthesizedSource = sourceCode.text.slice(leftParenToken.range[1], rightParenToken.range[0]); + + return fixer.replaceTextRange([ + leftParenToken.range[0], + rightParenToken.range[1] + ], (requiresLeadingSpace(node) ? " " : "") + parenthesizedSource + (requiresTrailingSpace(node) ? " " : "")); + } + }); + } + + if (reportsBuffer) { + reportsBuffer.reports.push({ node, finishReport }); + return; + } + + finishReport(); + } + + /** + * Evaluate a argument of the node. + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkArgumentWithPrecedence(node) { + if (hasExcessParensWithPrecedence(node.argument, precedence(node))) { + report(node.argument); + } + } + + /** + * Check if a member expression contains a call expression + * @param {ASTNode} node MemberExpression node to evaluate + * @returns {boolean} true if found, false if not + */ + function doesMemberExpressionContainCallExpression(node) { + let currentNode = node.object; + let currentNodeType = node.object.type; + + while (currentNodeType === "MemberExpression") { + currentNode = currentNode.object; + currentNodeType = currentNode.type; + } + + return currentNodeType === "CallExpression"; + } + + /** + * Evaluate a new call + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkCallNew(node) { + const callee = node.callee; + + if (hasExcessParensWithPrecedence(callee, precedence(node))) { + const hasNewParensException = callee.type === "NewExpression" && !isNewExpressionWithParens(callee); + + if ( + hasDoubleExcessParens(callee) || + !isIIFE(node) && + !hasNewParensException && + !( + + // Allow extra parens around a new expression if they are intervening parentheses. + node.type === "NewExpression" && + callee.type === "MemberExpression" && + doesMemberExpressionContainCallExpression(callee) + ) && + !(!node.optional && callee.type === "ChainExpression") + ) { + report(node.callee); + } + } + node.arguments + .filter(arg => hasExcessParensWithPrecedence(arg, PRECEDENCE_OF_ASSIGNMENT_EXPR)) + .forEach(report); + } + + /** + * Evaluate binary logicals + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkBinaryLogical(node) { + const prec = precedence(node); + const leftPrecedence = precedence(node.left); + const rightPrecedence = precedence(node.right); + const isExponentiation = node.operator === "**"; + const shouldSkipLeft = NESTED_BINARY && (node.left.type === "BinaryExpression" || node.left.type === "LogicalExpression"); + const shouldSkipRight = NESTED_BINARY && (node.right.type === "BinaryExpression" || node.right.type === "LogicalExpression"); + + if (!shouldSkipLeft && hasExcessParens(node.left)) { + if ( + !(node.left.type === "UnaryExpression" && isExponentiation) && + !astUtils.isMixedLogicalAndCoalesceExpressions(node.left, node) && + (leftPrecedence > prec || (leftPrecedence === prec && !isExponentiation)) || + isParenthesisedTwice(node.left) + ) { + report(node.left); + } + } + + if (!shouldSkipRight && hasExcessParens(node.right)) { + if ( + !astUtils.isMixedLogicalAndCoalesceExpressions(node.right, node) && + (rightPrecedence > prec || (rightPrecedence === prec && isExponentiation)) || + isParenthesisedTwice(node.right) + ) { + report(node.right); + } + } + } + + /** + * Check the parentheses around the super class of the given class definition. + * @param {ASTNode} node The node of class declarations to check. + * @returns {void} + */ + function checkClass(node) { + if (!node.superClass) { + return; + } + + /* + * If `node.superClass` is a LeftHandSideExpression, parentheses are extra. + * Otherwise, parentheses are needed. + */ + const hasExtraParens = precedence(node.superClass) > PRECEDENCE_OF_UPDATE_EXPR + ? hasExcessParens(node.superClass) + : hasDoubleExcessParens(node.superClass); + + if (hasExtraParens) { + report(node.superClass); + } + } + + /** + * Check the parentheses around the argument of the given spread operator. + * @param {ASTNode} node The node of spread elements/properties to check. + * @returns {void} + */ + function checkSpreadOperator(node) { + if (hasExcessParensWithPrecedence(node.argument, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(node.argument); + } + } + + /** + * Checks the parentheses for an ExpressionStatement or ExportDefaultDeclaration + * @param {ASTNode} node The ExpressionStatement.expression or ExportDefaultDeclaration.declaration node + * @returns {void} + */ + function checkExpressionOrExportStatement(node) { + const firstToken = isParenthesised(node) ? sourceCode.getTokenBefore(node) : sourceCode.getFirstToken(node); + const secondToken = sourceCode.getTokenAfter(firstToken, astUtils.isNotOpeningParenToken); + const thirdToken = secondToken ? sourceCode.getTokenAfter(secondToken) : null; + const tokenAfterClosingParens = secondToken ? sourceCode.getTokenAfter(secondToken, astUtils.isNotClosingParenToken) : null; + + if ( + astUtils.isOpeningParenToken(firstToken) && + ( + astUtils.isOpeningBraceToken(secondToken) || + secondToken.type === "Keyword" && ( + secondToken.value === "function" || + secondToken.value === "class" || + secondToken.value === "let" && + tokenAfterClosingParens && + ( + astUtils.isOpeningBracketToken(tokenAfterClosingParens) || + tokenAfterClosingParens.type === "Identifier" + ) + ) || + secondToken && secondToken.type === "Identifier" && secondToken.value === "async" && thirdToken && thirdToken.type === "Keyword" && thirdToken.value === "function" + ) + ) { + tokensToIgnore.add(secondToken); + } + + const hasExtraParens = node.parent.type === "ExportDefaultDeclaration" + ? hasExcessParensWithPrecedence(node, PRECEDENCE_OF_ASSIGNMENT_EXPR) + : hasExcessParens(node); + + if (hasExtraParens) { + report(node); + } + } + + /** + * Finds the path from the given node to the specified ancestor. + * @param {ASTNode} node First node in the path. + * @param {ASTNode} ancestor Last node in the path. + * @returns {ASTNode[]} Path, including both nodes. + * @throws {Error} If the given node does not have the specified ancestor. + */ + function pathToAncestor(node, ancestor) { + const path = [node]; + let currentNode = node; + + while (currentNode !== ancestor) { + + currentNode = currentNode.parent; + + /* istanbul ignore if */ + if (currentNode === null) { + throw new Error("Nodes are not in the ancestor-descendant relationship."); + } + + path.push(currentNode); + } + + return path; + } + + /** + * Finds the path from the given node to the specified descendant. + * @param {ASTNode} node First node in the path. + * @param {ASTNode} descendant Last node in the path. + * @returns {ASTNode[]} Path, including both nodes. + * @throws {Error} If the given node does not have the specified descendant. + */ + function pathToDescendant(node, descendant) { + return pathToAncestor(descendant, node).reverse(); + } + + /** + * Checks whether the syntax of the given ancestor of an 'in' expression inside a for-loop initializer + * is preventing the 'in' keyword from being interpreted as a part of an ill-formed for-in loop. + * @param {ASTNode} node Ancestor of an 'in' expression. + * @param {ASTNode} child Child of the node, ancestor of the same 'in' expression or the 'in' expression itself. + * @returns {boolean} True if the keyword 'in' would be interpreted as the 'in' operator, without any parenthesis. + */ + function isSafelyEnclosingInExpression(node, child) { + switch (node.type) { + case "ArrayExpression": + case "ArrayPattern": + case "BlockStatement": + case "ObjectExpression": + case "ObjectPattern": + case "TemplateLiteral": + return true; + case "ArrowFunctionExpression": + case "FunctionExpression": + return node.params.includes(child); + case "CallExpression": + case "NewExpression": + return node.arguments.includes(child); + case "MemberExpression": + return node.computed && node.property === child; + case "ConditionalExpression": + return node.consequent === child; + default: + return false; + } + } + + /** + * Starts a new reports buffering. Warnings will be stored in a buffer instead of being reported immediately. + * An additional logic that requires multiple nodes (e.g. a whole subtree) may dismiss some of the stored warnings. + * @returns {void} + */ + function startNewReportsBuffering() { + reportsBuffer = { + upper: reportsBuffer, + inExpressionNodes: [], + reports: [] + }; + } + + /** + * Ends the current reports buffering. + * @returns {void} + */ + function endCurrentReportsBuffering() { + const { upper, inExpressionNodes, reports } = reportsBuffer; + + if (upper) { + upper.inExpressionNodes.push(...inExpressionNodes); + upper.reports.push(...reports); + } else { + + // flush remaining reports + reports.forEach(({ finishReport }) => finishReport()); + } + + reportsBuffer = upper; + } + + /** + * Checks whether the given node is in the current reports buffer. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node is in the current buffer, false otherwise. + */ + function isInCurrentReportsBuffer(node) { + return reportsBuffer.reports.some(r => r.node === node); + } + + /** + * Removes the given node from the current reports buffer. + * @param {ASTNode} node Node to remove. + * @returns {void} + */ + function removeFromCurrentReportsBuffer(node) { + reportsBuffer.reports = reportsBuffer.reports.filter(r => r.node !== node); + } + + /** + * Checks whether a node is a MemberExpression at NewExpression's callee. + * @param {ASTNode} node node to check. + * @returns {boolean} True if the node is a MemberExpression at NewExpression's callee. false otherwise. + */ + function isMemberExpInNewCallee(node) { + if (node.type === "MemberExpression") { + return node.parent.type === "NewExpression" && node.parent.callee === node + ? true + : node.parent.object === node && isMemberExpInNewCallee(node.parent); + } + return false; + } + + return { + ArrayExpression(node) { + node.elements + .filter(e => e && hasExcessParensWithPrecedence(e, PRECEDENCE_OF_ASSIGNMENT_EXPR)) + .forEach(report); + }, + + ArrayPattern(node) { + node.elements + .filter(e => canBeAssignmentTarget(e) && hasExcessParens(e)) + .forEach(report); + }, + + ArrowFunctionExpression(node) { + if (isReturnAssignException(node)) { + return; + } + + if (node.body.type === "ConditionalExpression" && + IGNORE_ARROW_CONDITIONALS + ) { + return; + } + + if (node.body.type !== "BlockStatement") { + const firstBodyToken = sourceCode.getFirstToken(node.body, astUtils.isNotOpeningParenToken); + const tokenBeforeFirst = sourceCode.getTokenBefore(firstBodyToken); + + if (astUtils.isOpeningParenToken(tokenBeforeFirst) && astUtils.isOpeningBraceToken(firstBodyToken)) { + tokensToIgnore.add(firstBodyToken); + } + if (hasExcessParensWithPrecedence(node.body, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(node.body); + } + } + }, + + AssignmentExpression(node) { + if (canBeAssignmentTarget(node.left) && hasExcessParens(node.left)) { + report(node.left); + } + + if (!isReturnAssignException(node) && hasExcessParensWithPrecedence(node.right, precedence(node))) { + report(node.right); + } + }, + + BinaryExpression(node) { + if (reportsBuffer && node.operator === "in") { + reportsBuffer.inExpressionNodes.push(node); + } + + checkBinaryLogical(node); + }, + + CallExpression: checkCallNew, + + ClassBody(node) { + node.body + .filter(member => member.type === "MethodDefinition" && member.computed && member.key) + .filter(member => hasExcessParensWithPrecedence(member.key, PRECEDENCE_OF_ASSIGNMENT_EXPR)) + .forEach(member => report(member.key)); + }, + + ConditionalExpression(node) { + if (isReturnAssignException(node)) { + return; + } + if ( + !isCondAssignException(node) && + hasExcessParensWithPrecedence(node.test, precedence({ type: "LogicalExpression", operator: "||" })) + ) { + report(node.test); + } + + if (hasExcessParensWithPrecedence(node.consequent, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(node.consequent); + } + + if (hasExcessParensWithPrecedence(node.alternate, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(node.alternate); + } + }, + + DoWhileStatement(node) { + if (hasExcessParens(node.test) && !isCondAssignException(node)) { + report(node.test); + } + }, + + ExportDefaultDeclaration: node => checkExpressionOrExportStatement(node.declaration), + ExpressionStatement: node => checkExpressionOrExportStatement(node.expression), + + "ForInStatement, ForOfStatement"(node) { + if (node.left.type !== "VariableDeclarator") { + const firstLeftToken = sourceCode.getFirstToken(node.left, astUtils.isNotOpeningParenToken); + + if ( + firstLeftToken.value === "let" && ( + + /* + * If `let` is the only thing on the left side of the loop, it's the loop variable: `for ((let) of foo);` + * Removing it will cause a syntax error, because it will be parsed as the start of a VariableDeclarator. + */ + (firstLeftToken.range[1] === node.left.range[1] || /* + * If `let` is followed by a `[` token, it's a property access on the `let` value: `for ((let[foo]) of bar);` + * Removing it will cause the property access to be parsed as a destructuring declaration of `foo` instead. + */ + astUtils.isOpeningBracketToken( + sourceCode.getTokenAfter(firstLeftToken, astUtils.isNotClosingParenToken) + )) + ) + ) { + tokensToIgnore.add(firstLeftToken); + } + } + + if (node.type === "ForOfStatement") { + const hasExtraParens = node.right.type === "SequenceExpression" + ? hasDoubleExcessParens(node.right) + : hasExcessParens(node.right); + + if (hasExtraParens) { + report(node.right); + } + } else if (hasExcessParens(node.right)) { + report(node.right); + } + + if (hasExcessParens(node.left)) { + report(node.left); + } + }, + + ForStatement(node) { + if (node.test && hasExcessParens(node.test) && !isCondAssignException(node)) { + report(node.test); + } + + if (node.update && hasExcessParens(node.update)) { + report(node.update); + } + + if (node.init) { + startNewReportsBuffering(); + + if (hasExcessParens(node.init)) { + report(node.init); + } + } + }, + + "ForStatement > *.init:exit"(node) { + + /* + * Removing parentheses around `in` expressions might change semantics and cause errors. + * + * For example, this valid for loop: + * for (let a = (b in c); ;); + * after removing parentheses would be treated as an invalid for-in loop: + * for (let a = b in c; ;); + */ + + if (reportsBuffer.reports.length) { + reportsBuffer.inExpressionNodes.forEach(inExpressionNode => { + const path = pathToDescendant(node, inExpressionNode); + let nodeToExclude; + + for (let i = 0; i < path.length; i++) { + const pathNode = path[i]; + + if (i < path.length - 1) { + const nextPathNode = path[i + 1]; + + if (isSafelyEnclosingInExpression(pathNode, nextPathNode)) { + + // The 'in' expression in safely enclosed by the syntax of its ancestor nodes (e.g. by '{}' or '[]'). + return; + } + } + + if (isParenthesised(pathNode)) { + if (isInCurrentReportsBuffer(pathNode)) { + + // This node was supposed to be reported, but parentheses might be necessary. + + if (isParenthesisedTwice(pathNode)) { + + /* + * This node is parenthesised twice, it certainly has at least one pair of `extra` parentheses. + * If the --fix option is on, the current fixing iteration will remove only one pair of parentheses. + * The remaining pair is safely enclosing the 'in' expression. + */ + return; + } + + // Exclude the outermost node only. + if (!nodeToExclude) { + nodeToExclude = pathNode; + } + + // Don't break the loop here, there might be some safe nodes or parentheses that will stay inside. + + } else { + + // This node will stay parenthesised, the 'in' expression in safely enclosed by '()'. + return; + } + } + } + + // Exclude the node from the list (i.e. treat parentheses as necessary) + removeFromCurrentReportsBuffer(nodeToExclude); + }); + } + + endCurrentReportsBuffering(); + }, + + IfStatement(node) { + if (hasExcessParens(node.test) && !isCondAssignException(node)) { + report(node.test); + } + }, + + ImportExpression(node) { + const { source } = node; + + if (source.type === "SequenceExpression") { + if (hasDoubleExcessParens(source)) { + report(source); + } + } else if (hasExcessParens(source)) { + report(source); + } + }, + + LogicalExpression: checkBinaryLogical, + + MemberExpression(node) { + const shouldAllowWrapOnce = isMemberExpInNewCallee(node) && + doesMemberExpressionContainCallExpression(node); + const nodeObjHasExcessParens = shouldAllowWrapOnce + ? hasDoubleExcessParens(node.object) + : hasExcessParens(node.object) && + !( + isImmediateFunctionPrototypeMethodCall(node.parent) && + node.parent.callee === node && + IGNORE_FUNCTION_PROTOTYPE_METHODS + ); + + if ( + nodeObjHasExcessParens && + precedence(node.object) >= precedence(node) && + ( + node.computed || + !( + astUtils.isDecimalInteger(node.object) || + + // RegExp literal is allowed to have parens (#1589) + (node.object.type === "Literal" && node.object.regex) + ) + ) + ) { + report(node.object); + } + + if (nodeObjHasExcessParens && + node.object.type === "CallExpression" + ) { + report(node.object); + } + + if (nodeObjHasExcessParens && + !IGNORE_NEW_IN_MEMBER_EXPR && + node.object.type === "NewExpression" && + isNewExpressionWithParens(node.object)) { + report(node.object); + } + + if (nodeObjHasExcessParens && + node.optional && + node.object.type === "ChainExpression" + ) { + report(node.object); + } + + if (node.computed && hasExcessParens(node.property)) { + report(node.property); + } + }, + + NewExpression: checkCallNew, + + ObjectExpression(node) { + node.properties + .filter(property => property.value && hasExcessParensWithPrecedence(property.value, PRECEDENCE_OF_ASSIGNMENT_EXPR)) + .forEach(property => report(property.value)); + }, + + ObjectPattern(node) { + node.properties + .filter(property => { + const value = property.value; + + return canBeAssignmentTarget(value) && hasExcessParens(value); + }).forEach(property => report(property.value)); + }, + + Property(node) { + if (node.computed) { + const { key } = node; + + if (key && hasExcessParensWithPrecedence(key, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(key); + } + } + }, + + RestElement(node) { + const argument = node.argument; + + if (canBeAssignmentTarget(argument) && hasExcessParens(argument)) { + report(argument); + } + }, + + ReturnStatement(node) { + const returnToken = sourceCode.getFirstToken(node); + + if (isReturnAssignException(node)) { + return; + } + + if (node.argument && + hasExcessParensNoLineTerminator(returnToken, node.argument) && + + // RegExp literal is allowed to have parens (#1589) + !(node.argument.type === "Literal" && node.argument.regex)) { + report(node.argument); + } + }, + + SequenceExpression(node) { + const precedenceOfNode = precedence(node); + + node.expressions + .filter(e => hasExcessParensWithPrecedence(e, precedenceOfNode)) + .forEach(report); + }, + + SwitchCase(node) { + if (node.test && hasExcessParens(node.test)) { + report(node.test); + } + }, + + SwitchStatement(node) { + if (hasExcessParens(node.discriminant)) { + report(node.discriminant); + } + }, + + ThrowStatement(node) { + const throwToken = sourceCode.getFirstToken(node); + + if (hasExcessParensNoLineTerminator(throwToken, node.argument)) { + report(node.argument); + } + }, + + UnaryExpression: checkArgumentWithPrecedence, + UpdateExpression: checkArgumentWithPrecedence, + AwaitExpression: checkArgumentWithPrecedence, + + VariableDeclarator(node) { + if ( + node.init && hasExcessParensWithPrecedence(node.init, PRECEDENCE_OF_ASSIGNMENT_EXPR) && + + // RegExp literal is allowed to have parens (#1589) + !(node.init.type === "Literal" && node.init.regex) + ) { + report(node.init); + } + }, + + WhileStatement(node) { + if (hasExcessParens(node.test) && !isCondAssignException(node)) { + report(node.test); + } + }, + + WithStatement(node) { + if (hasExcessParens(node.object)) { + report(node.object); + } + }, + + YieldExpression(node) { + if (node.argument) { + const yieldToken = sourceCode.getFirstToken(node); + + if ((precedence(node.argument) >= precedence(node) && + hasExcessParensNoLineTerminator(yieldToken, node.argument)) || + hasDoubleExcessParens(node.argument)) { + report(node.argument); + } + } + }, + + ClassDeclaration: checkClass, + ClassExpression: checkClass, + + SpreadElement: checkSpreadOperator, + SpreadProperty: checkSpreadOperator, + ExperimentalSpreadProperty: checkSpreadOperator, + + TemplateLiteral(node) { + node.expressions + .filter(e => e && hasExcessParens(e)) + .forEach(report); + }, + + AssignmentPattern(node) { + const { left, right } = node; + + if (canBeAssignmentTarget(left) && hasExcessParens(left)) { + report(left); + } + + if (right && hasExcessParensWithPrecedence(right, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(right); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-extra-semi.js b/node_modules/eslint/lib/rules/no-extra-semi.js new file mode 100644 index 000000000..e0a8df056 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-extra-semi.js @@ -0,0 +1,126 @@ +/** + * @fileoverview Rule to flag use of unnecessary semicolons + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const FixTracker = require("./utils/fix-tracker"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary semicolons", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-extra-semi" + }, + + fixable: "code", + schema: [], + + messages: { + unexpected: "Unnecessary semicolon." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Reports an unnecessary semicolon error. + * @param {Node|Token} nodeOrToken A node or a token to be reported. + * @returns {void} + */ + function report(nodeOrToken) { + context.report({ + node: nodeOrToken, + messageId: "unexpected", + fix(fixer) { + + /* + * Expand the replacement range to include the surrounding + * tokens to avoid conflicting with semi. + * https://github.com/eslint/eslint/issues/7928 + */ + return new FixTracker(fixer, context.getSourceCode()) + .retainSurroundingTokens(nodeOrToken) + .remove(nodeOrToken); + } + }); + } + + /** + * Checks for a part of a class body. + * This checks tokens from a specified token to a next MethodDefinition or the end of class body. + * @param {Token} firstToken The first token to check. + * @returns {void} + */ + function checkForPartOfClassBody(firstToken) { + for (let token = firstToken; + token.type === "Punctuator" && !astUtils.isClosingBraceToken(token); + token = sourceCode.getTokenAfter(token) + ) { + if (astUtils.isSemicolonToken(token)) { + report(token); + } + } + } + + return { + + /** + * Reports this empty statement, except if the parent node is a loop. + * @param {Node} node A EmptyStatement node to be reported. + * @returns {void} + */ + EmptyStatement(node) { + const parent = node.parent, + allowedParentTypes = [ + "ForStatement", + "ForInStatement", + "ForOfStatement", + "WhileStatement", + "DoWhileStatement", + "IfStatement", + "LabeledStatement", + "WithStatement" + ]; + + if (allowedParentTypes.indexOf(parent.type) === -1) { + report(node); + } + }, + + /** + * Checks tokens from the head of this class body to the first MethodDefinition or the end of this class body. + * @param {Node} node A ClassBody node to check. + * @returns {void} + */ + ClassBody(node) { + checkForPartOfClassBody(sourceCode.getFirstToken(node, 1)); // 0 is `{`. + }, + + /** + * Checks tokens from this MethodDefinition to the next MethodDefinition or the end of this class body. + * @param {Node} node A MethodDefinition node of the start point. + * @returns {void} + */ + MethodDefinition(node) { + checkForPartOfClassBody(sourceCode.getTokenAfter(node)); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-fallthrough.js b/node_modules/eslint/lib/rules/no-fallthrough.js new file mode 100644 index 000000000..dd1f3ed9d --- /dev/null +++ b/node_modules/eslint/lib/rules/no-fallthrough.js @@ -0,0 +1,142 @@ +/** + * @fileoverview Rule to flag fall-through cases in switch statements. + * @author Matt DuVall + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const DEFAULT_FALLTHROUGH_COMMENT = /falls?\s?through/iu; + +/** + * Checks whether or not a given node has a fallthrough comment. + * @param {ASTNode} node A SwitchCase node to get comments. + * @param {RuleContext} context A rule context which stores comments. + * @param {RegExp} fallthroughCommentPattern A pattern to match comment to. + * @returns {boolean} `true` if the node has a valid fallthrough comment. + */ +function hasFallthroughComment(node, context, fallthroughCommentPattern) { + const sourceCode = context.getSourceCode(); + const comment = lodash.last(sourceCode.getCommentsBefore(node)); + + return Boolean(comment && fallthroughCommentPattern.test(comment.value)); +} + +/** + * Checks whether or not a given code path segment is reachable. + * @param {CodePathSegment} segment A CodePathSegment to check. + * @returns {boolean} `true` if the segment is reachable. + */ +function isReachable(segment) { + return segment.reachable; +} + +/** + * Checks whether a node and a token are separated by blank lines + * @param {ASTNode} node The node to check + * @param {Token} token The token to compare against + * @returns {boolean} `true` if there are blank lines between node and token + */ +function hasBlankLinesBetween(node, token) { + return token.loc.start.line > node.loc.end.line + 1; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow fallthrough of `case` statements", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-fallthrough" + }, + + schema: [ + { + type: "object", + properties: { + commentPattern: { + type: "string", + default: "" + } + }, + additionalProperties: false + } + ], + messages: { + case: "Expected a 'break' statement before 'case'.", + default: "Expected a 'break' statement before 'default'." + } + }, + + create(context) { + const options = context.options[0] || {}; + let currentCodePath = null; + const sourceCode = context.getSourceCode(); + + /* + * We need to use leading comments of the next SwitchCase node because + * trailing comments is wrong if semicolons are omitted. + */ + let fallthroughCase = null; + let fallthroughCommentPattern = null; + + if (options.commentPattern) { + fallthroughCommentPattern = new RegExp(options.commentPattern, "u"); + } else { + fallthroughCommentPattern = DEFAULT_FALLTHROUGH_COMMENT; + } + + return { + onCodePathStart(codePath) { + currentCodePath = codePath; + }, + onCodePathEnd() { + currentCodePath = currentCodePath.upper; + }, + + SwitchCase(node) { + + /* + * Checks whether or not there is a fallthrough comment. + * And reports the previous fallthrough node if that does not exist. + */ + if (fallthroughCase && !hasFallthroughComment(node, context, fallthroughCommentPattern)) { + context.report({ + messageId: node.test ? "case" : "default", + node + }); + } + fallthroughCase = null; + }, + + "SwitchCase:exit"(node) { + const nextToken = sourceCode.getTokenAfter(node); + + /* + * `reachable` meant fall through because statements preceded by + * `break`, `return`, or `throw` are unreachable. + * And allows empty cases and the last case. + */ + if (currentCodePath.currentSegments.some(isReachable) && + (node.consequent.length > 0 || hasBlankLinesBetween(node, nextToken)) && + lodash.last(node.parent.cases) !== node) { + fallthroughCase = node; + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-floating-decimal.js b/node_modules/eslint/lib/rules/no-floating-decimal.js new file mode 100644 index 000000000..b1d883212 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-floating-decimal.js @@ -0,0 +1,70 @@ +/** + * @fileoverview Rule to flag use of a leading/trailing decimal point in a numeric literal + * @author James Allardice + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow leading or trailing decimal points in numeric literals", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-floating-decimal" + }, + + schema: [], + fixable: "code", + messages: { + leading: "A leading decimal point can be confused with a dot.", + trailing: "A trailing decimal point can be confused with a dot." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + Literal(node) { + + if (typeof node.value === "number") { + if (node.raw.startsWith(".")) { + context.report({ + node, + messageId: "leading", + fix(fixer) { + const tokenBefore = sourceCode.getTokenBefore(node); + const needsSpaceBefore = tokenBefore && + tokenBefore.range[1] === node.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, `0${node.raw}`); + + return fixer.insertTextBefore(node, needsSpaceBefore ? " 0" : "0"); + } + }); + } + if (node.raw.indexOf(".") === node.raw.length - 1) { + context.report({ + node, + messageId: "trailing", + fix: fixer => fixer.insertTextAfter(node, "0") + }); + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-func-assign.js b/node_modules/eslint/lib/rules/no-func-assign.js new file mode 100644 index 000000000..33d0ad9ec --- /dev/null +++ b/node_modules/eslint/lib/rules/no-func-assign.js @@ -0,0 +1,76 @@ +/** + * @fileoverview Rule to flag use of function declaration identifiers as variables. + * @author Ian Christian Myers + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow reassigning `function` declarations", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-func-assign" + }, + + schema: [], + + messages: { + isAFunction: "'{{name}}' is a function." + } + }, + + create(context) { + + /** + * Reports a reference if is non initializer and writable. + * @param {References} references Collection of reference to check. + * @returns {void} + */ + function checkReference(references) { + astUtils.getModifyingReferences(references).forEach(reference => { + context.report({ + node: reference.identifier, + messageId: "isAFunction", + data: { + name: reference.identifier.name + } + }); + }); + } + + /** + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + if (variable.defs[0].type === "FunctionName") { + checkReference(variable.references); + } + } + + /** + * Checks parameters of a given function node. + * @param {ASTNode} node A function node to check. + * @returns {void} + */ + function checkForFunction(node) { + context.getDeclaredVariables(node).forEach(checkVariable); + } + + return { + FunctionDeclaration: checkForFunction, + FunctionExpression: checkForFunction + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-global-assign.js b/node_modules/eslint/lib/rules/no-global-assign.js new file mode 100644 index 000000000..ea854c4aa --- /dev/null +++ b/node_modules/eslint/lib/rules/no-global-assign.js @@ -0,0 +1,94 @@ +/** + * @fileoverview Rule to disallow assignments to native objects or read-only global variables + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow assignments to native objects or read-only global variables", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-global-assign" + }, + + schema: [ + { + type: "object", + properties: { + exceptions: { + type: "array", + items: { type: "string" }, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + globalShouldNotBeModified: "Read-only global '{{name}}' should not be modified." + } + }, + + create(context) { + const config = context.options[0]; + const exceptions = (config && config.exceptions) || []; + + /** + * Reports write references. + * @param {Reference} reference A reference to check. + * @param {int} index The index of the reference in the references. + * @param {Reference[]} references The array that the reference belongs to. + * @returns {void} + */ + function checkReference(reference, index, references) { + const identifier = reference.identifier; + + if (reference.init === false && + reference.isWrite() && + + /* + * Destructuring assignments can have multiple default value, + * so possibly there are multiple writeable references for the same identifier. + */ + (index === 0 || references[index - 1].identifier !== identifier) + ) { + context.report({ + node: identifier, + messageId: "globalShouldNotBeModified", + data: { + name: identifier.name + } + }); + } + } + + /** + * Reports write references if a given variable is read-only builtin. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + if (variable.writeable === false && exceptions.indexOf(variable.name) === -1) { + variable.references.forEach(checkReference); + } + } + + return { + Program() { + const globalScope = context.getScope(); + + globalScope.variables.forEach(checkVariable); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-implicit-coercion.js b/node_modules/eslint/lib/rules/no-implicit-coercion.js new file mode 100644 index 000000000..a639711ec --- /dev/null +++ b/node_modules/eslint/lib/rules/no-implicit-coercion.js @@ -0,0 +1,305 @@ +/** + * @fileoverview A rule to disallow the type conversions with shorter notations. + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const INDEX_OF_PATTERN = /^(?:i|lastI)ndexOf$/u; +const ALLOWABLE_OPERATORS = ["~", "!!", "+", "*"]; + +/** + * Parses and normalizes an option object. + * @param {Object} options An option object to parse. + * @returns {Object} The parsed and normalized option object. + */ +function parseOptions(options) { + return { + boolean: "boolean" in options ? options.boolean : true, + number: "number" in options ? options.number : true, + string: "string" in options ? options.string : true, + allow: options.allow || [] + }; +} + +/** + * Checks whether or not a node is a double logical nigating. + * @param {ASTNode} node An UnaryExpression node to check. + * @returns {boolean} Whether or not the node is a double logical nigating. + */ +function isDoubleLogicalNegating(node) { + return ( + node.operator === "!" && + node.argument.type === "UnaryExpression" && + node.argument.operator === "!" + ); +} + +/** + * Checks whether or not a node is a binary negating of `.indexOf()` method calling. + * @param {ASTNode} node An UnaryExpression node to check. + * @returns {boolean} Whether or not the node is a binary negating of `.indexOf()` method calling. + */ +function isBinaryNegatingOfIndexOf(node) { + if (node.operator !== "~") { + return false; + } + const callNode = astUtils.skipChainExpression(node.argument); + + return ( + callNode.type === "CallExpression" && + astUtils.isSpecificMemberAccess(callNode.callee, null, INDEX_OF_PATTERN) + ); +} + +/** + * Checks whether or not a node is a multiplying by one. + * @param {BinaryExpression} node A BinaryExpression node to check. + * @returns {boolean} Whether or not the node is a multiplying by one. + */ +function isMultiplyByOne(node) { + return node.operator === "*" && ( + node.left.type === "Literal" && node.left.value === 1 || + node.right.type === "Literal" && node.right.value === 1 + ); +} + +/** + * Checks whether the result of a node is numeric or not + * @param {ASTNode} node The node to test + * @returns {boolean} true if the node is a number literal or a `Number()`, `parseInt` or `parseFloat` call + */ +function isNumeric(node) { + return ( + node.type === "Literal" && typeof node.value === "number" || + node.type === "CallExpression" && ( + node.callee.name === "Number" || + node.callee.name === "parseInt" || + node.callee.name === "parseFloat" + ) + ); +} + +/** + * Returns the first non-numeric operand in a BinaryExpression. Designed to be + * used from bottom to up since it walks up the BinaryExpression trees using + * node.parent to find the result. + * @param {BinaryExpression} node The BinaryExpression node to be walked up on + * @returns {ASTNode|null} The first non-numeric item in the BinaryExpression tree or null + */ +function getNonNumericOperand(node) { + const left = node.left, + right = node.right; + + if (right.type !== "BinaryExpression" && !isNumeric(right)) { + return right; + } + + if (left.type !== "BinaryExpression" && !isNumeric(left)) { + return left; + } + + return null; +} + +/** + * Checks whether a node is an empty string literal or not. + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether or not the passed in node is an + * empty string literal or not. + */ +function isEmptyString(node) { + return astUtils.isStringLiteral(node) && (node.value === "" || (node.type === "TemplateLiteral" && node.quasis.length === 1 && node.quasis[0].value.cooked === "")); +} + +/** + * Checks whether or not a node is a concatenating with an empty string. + * @param {ASTNode} node A BinaryExpression node to check. + * @returns {boolean} Whether or not the node is a concatenating with an empty string. + */ +function isConcatWithEmptyString(node) { + return node.operator === "+" && ( + (isEmptyString(node.left) && !astUtils.isStringLiteral(node.right)) || + (isEmptyString(node.right) && !astUtils.isStringLiteral(node.left)) + ); +} + +/** + * Checks whether or not a node is appended with an empty string. + * @param {ASTNode} node An AssignmentExpression node to check. + * @returns {boolean} Whether or not the node is appended with an empty string. + */ +function isAppendEmptyString(node) { + return node.operator === "+=" && isEmptyString(node.right); +} + +/** + * Returns the operand that is not an empty string from a flagged BinaryExpression. + * @param {ASTNode} node The flagged BinaryExpression node to check. + * @returns {ASTNode} The operand that is not an empty string from a flagged BinaryExpression. + */ +function getNonEmptyOperand(node) { + return isEmptyString(node.left) ? node.right : node.left; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow shorthand type conversions", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-implicit-coercion" + }, + + fixable: "code", + + schema: [{ + type: "object", + properties: { + boolean: { + type: "boolean", + default: true + }, + number: { + type: "boolean", + default: true + }, + string: { + type: "boolean", + default: true + }, + allow: { + type: "array", + items: { + enum: ALLOWABLE_OPERATORS + }, + uniqueItems: true + } + }, + additionalProperties: false + }], + + messages: { + useRecommendation: "use `{{recommendation}}` instead." + } + }, + + create(context) { + const options = parseOptions(context.options[0] || {}); + const sourceCode = context.getSourceCode(); + + /** + * Reports an error and autofixes the node + * @param {ASTNode} node An ast node to report the error on. + * @param {string} recommendation The recommended code for the issue + * @param {bool} shouldFix Whether this report should fix the node + * @returns {void} + */ + function report(node, recommendation, shouldFix) { + context.report({ + node, + messageId: "useRecommendation", + data: { + recommendation + }, + fix(fixer) { + if (!shouldFix) { + return null; + } + + const tokenBefore = sourceCode.getTokenBefore(node); + + if ( + tokenBefore && + tokenBefore.range[1] === node.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, recommendation) + ) { + return fixer.replaceText(node, ` ${recommendation}`); + } + return fixer.replaceText(node, recommendation); + } + }); + } + + return { + UnaryExpression(node) { + let operatorAllowed; + + // !!foo + operatorAllowed = options.allow.indexOf("!!") >= 0; + if (!operatorAllowed && options.boolean && isDoubleLogicalNegating(node)) { + const recommendation = `Boolean(${sourceCode.getText(node.argument.argument)})`; + + report(node, recommendation, true); + } + + // ~foo.indexOf(bar) + operatorAllowed = options.allow.indexOf("~") >= 0; + if (!operatorAllowed && options.boolean && isBinaryNegatingOfIndexOf(node)) { + + // `foo?.indexOf(bar) !== -1` will be true (== found) if the `foo` is nullish. So use `>= 0` in that case. + const comparison = node.argument.type === "ChainExpression" ? ">= 0" : "!== -1"; + const recommendation = `${sourceCode.getText(node.argument)} ${comparison}`; + + report(node, recommendation, false); + } + + // +foo + operatorAllowed = options.allow.indexOf("+") >= 0; + if (!operatorAllowed && options.number && node.operator === "+" && !isNumeric(node.argument)) { + const recommendation = `Number(${sourceCode.getText(node.argument)})`; + + report(node, recommendation, true); + } + }, + + // Use `:exit` to prevent double reporting + "BinaryExpression:exit"(node) { + let operatorAllowed; + + // 1 * foo + operatorAllowed = options.allow.indexOf("*") >= 0; + const nonNumericOperand = !operatorAllowed && options.number && isMultiplyByOne(node) && getNonNumericOperand(node); + + if (nonNumericOperand) { + const recommendation = `Number(${sourceCode.getText(nonNumericOperand)})`; + + report(node, recommendation, true); + } + + // "" + foo + operatorAllowed = options.allow.indexOf("+") >= 0; + if (!operatorAllowed && options.string && isConcatWithEmptyString(node)) { + const recommendation = `String(${sourceCode.getText(getNonEmptyOperand(node))})`; + + report(node, recommendation, true); + } + }, + + AssignmentExpression(node) { + + // foo += "" + const operatorAllowed = options.allow.indexOf("+") >= 0; + + if (!operatorAllowed && options.string && isAppendEmptyString(node)) { + const code = sourceCode.getText(getNonEmptyOperand(node)); + const recommendation = `${code} = String(${code})`; + + report(node, recommendation, true); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-implicit-globals.js b/node_modules/eslint/lib/rules/no-implicit-globals.js new file mode 100644 index 000000000..d4bfa3af8 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-implicit-globals.js @@ -0,0 +1,140 @@ +/** + * @fileoverview Rule to check for implicit global variables, functions and classes. + * @author Joshua Peek + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow declarations in the global scope", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-implicit-globals" + }, + + schema: [{ + type: "object", + properties: { + lexicalBindings: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], + + messages: { + globalNonLexicalBinding: "Unexpected {{kind}} declaration in the global scope, wrap in an IIFE for a local variable, assign as global property for a global variable.", + globalLexicalBinding: "Unexpected {{kind}} declaration in the global scope, wrap in a block or in an IIFE.", + globalVariableLeak: "Global variable leak, declare the variable if it is intended to be local.", + assignmentToReadonlyGlobal: "Unexpected assignment to read-only global variable.", + redeclarationOfReadonlyGlobal: "Unexpected redeclaration of read-only global variable." + } + }, + + create(context) { + + const checkLexicalBindings = context.options[0] && context.options[0].lexicalBindings === true; + + /** + * Reports the node. + * @param {ASTNode} node Node to report. + * @param {string} messageId Id of the message to report. + * @param {string|undefined} kind Declaration kind, can be 'var', 'const', 'let', function or class. + * @returns {void} + */ + function report(node, messageId, kind) { + context.report({ + node, + messageId, + data: { + kind + } + }); + } + + return { + Program() { + const scope = context.getScope(); + + scope.variables.forEach(variable => { + + // Only ESLint global variables have the `writable` key. + const isReadonlyEslintGlobalVariable = variable.writeable === false; + const isWritableEslintGlobalVariable = variable.writeable === true; + + if (isWritableEslintGlobalVariable) { + + // Everything is allowed with writable ESLint global variables. + return; + } + + variable.defs.forEach(def => { + const defNode = def.node; + + if (def.type === "FunctionName" || (def.type === "Variable" && def.parent.kind === "var")) { + if (isReadonlyEslintGlobalVariable) { + report(defNode, "redeclarationOfReadonlyGlobal"); + } else { + report( + defNode, + "globalNonLexicalBinding", + def.type === "FunctionName" ? "function" : `'${def.parent.kind}'` + ); + } + } + + if (checkLexicalBindings) { + if (def.type === "ClassName" || + (def.type === "Variable" && (def.parent.kind === "let" || def.parent.kind === "const"))) { + if (isReadonlyEslintGlobalVariable) { + report(defNode, "redeclarationOfReadonlyGlobal"); + } else { + report( + defNode, + "globalLexicalBinding", + def.type === "ClassName" ? "class" : `'${def.parent.kind}'` + ); + } + } + } + }); + }); + + // Undeclared assigned variables. + scope.implicit.variables.forEach(variable => { + const scopeVariable = scope.set.get(variable.name); + let messageId; + + if (scopeVariable) { + + // ESLint global variable + if (scopeVariable.writeable) { + return; + } + messageId = "assignmentToReadonlyGlobal"; + + } else { + + // Reference to an unknown variable, possible global leak. + messageId = "globalVariableLeak"; + } + + // def.node is an AssignmentExpression, ForInStatement or ForOfStatement. + variable.defs.forEach(def => { + report(def.node, messageId); + }); + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-implied-eval.js b/node_modules/eslint/lib/rules/no-implied-eval.js new file mode 100644 index 000000000..b8120a648 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-implied-eval.js @@ -0,0 +1,131 @@ +/** + * @fileoverview Rule to flag use of implied eval via setTimeout and setInterval + * @author James Allardice + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const { getStaticValue } = require("eslint-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of `eval()`-like methods", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-implied-eval" + }, + + schema: [], + + messages: { + impliedEval: "Implied eval. Consider passing a function instead of a string." + } + }, + + create(context) { + const GLOBAL_CANDIDATES = Object.freeze(["global", "window", "globalThis"]); + const EVAL_LIKE_FUNC_PATTERN = /^(?:set(?:Interval|Timeout)|execScript)$/u; + + /** + * Checks whether a node is evaluated as a string or not. + * @param {ASTNode} node A node to check. + * @returns {boolean} True if the node is evaluated as a string. + */ + function isEvaluatedString(node) { + if ( + (node.type === "Literal" && typeof node.value === "string") || + node.type === "TemplateLiteral" + ) { + return true; + } + if (node.type === "BinaryExpression" && node.operator === "+") { + return isEvaluatedString(node.left) || isEvaluatedString(node.right); + } + return false; + } + + /** + * Reports if the `CallExpression` node has evaluated argument. + * @param {ASTNode} node A CallExpression to check. + * @returns {void} + */ + function reportImpliedEvalCallExpression(node) { + const [firstArgument] = node.arguments; + + if (firstArgument) { + + const staticValue = getStaticValue(firstArgument, context.getScope()); + const isStaticString = staticValue && typeof staticValue.value === "string"; + const isString = isStaticString || isEvaluatedString(firstArgument); + + if (isString) { + context.report({ + node, + messageId: "impliedEval" + }); + } + } + + } + + /** + * Reports calls of `implied eval` via the global references. + * @param {Variable} globalVar A global variable to check. + * @returns {void} + */ + function reportImpliedEvalViaGlobal(globalVar) { + const { references, name } = globalVar; + + references.forEach(ref => { + const identifier = ref.identifier; + let node = identifier.parent; + + while (astUtils.isSpecificMemberAccess(node, null, name)) { + node = node.parent; + } + + if (astUtils.isSpecificMemberAccess(node, null, EVAL_LIKE_FUNC_PATTERN)) { + const calleeNode = node.parent.type === "ChainExpression" ? node.parent : node; + const parent = calleeNode.parent; + + if (parent.type === "CallExpression" && parent.callee === calleeNode) { + reportImpliedEvalCallExpression(parent); + } + } + }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + CallExpression(node) { + if (astUtils.isSpecificId(node.callee, EVAL_LIKE_FUNC_PATTERN)) { + reportImpliedEvalCallExpression(node); + } + }, + "Program:exit"() { + const globalScope = context.getScope(); + + GLOBAL_CANDIDATES + .map(candidate => astUtils.getVariableByName(globalScope, candidate)) + .filter(globalVar => !!globalVar && globalVar.defs.length === 0) + .forEach(reportImpliedEvalViaGlobal); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-import-assign.js b/node_modules/eslint/lib/rules/no-import-assign.js new file mode 100644 index 000000000..7a349bb73 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-import-assign.js @@ -0,0 +1,239 @@ +/** + * @fileoverview Rule to flag updates of imported bindings. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const { findVariable } = require("eslint-utils"); +const astUtils = require("./utils/ast-utils"); + +const WellKnownMutationFunctions = { + Object: /^(?:assign|definePropert(?:y|ies)|freeze|setPrototypeOf)$/u, + Reflect: /^(?:(?:define|delete)Property|set(?:PrototypeOf)?)$/u +}; + +/** + * Check if a given node is LHS of an assignment node. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is LHS. + */ +function isAssignmentLeft(node) { + const { parent } = node; + + return ( + ( + parent.type === "AssignmentExpression" && + parent.left === node + ) || + + // Destructuring assignments + parent.type === "ArrayPattern" || + ( + parent.type === "Property" && + parent.value === node && + parent.parent.type === "ObjectPattern" + ) || + parent.type === "RestElement" || + ( + parent.type === "AssignmentPattern" && + parent.left === node + ) + ); +} + +/** + * Check if a given node is the operand of mutation unary operator. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is the operand of mutation unary operator. + */ +function isOperandOfMutationUnaryOperator(node) { + const argumentNode = node.parent.type === "ChainExpression" + ? node.parent + : node; + const { parent } = argumentNode; + + return ( + ( + parent.type === "UpdateExpression" && + parent.argument === argumentNode + ) || + ( + parent.type === "UnaryExpression" && + parent.operator === "delete" && + parent.argument === argumentNode + ) + ); +} + +/** + * Check if a given node is the iteration variable of `for-in`/`for-of` syntax. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is the iteration variable. + */ +function isIterationVariable(node) { + const { parent } = node; + + return ( + ( + parent.type === "ForInStatement" && + parent.left === node + ) || + ( + parent.type === "ForOfStatement" && + parent.left === node + ) + ); +} + +/** + * Check if a given node is at the first argument of a well-known mutation function. + * - `Object.assign` + * - `Object.defineProperty` + * - `Object.defineProperties` + * - `Object.freeze` + * - `Object.setPrototypeOf` + * - `Refrect.defineProperty` + * - `Refrect.deleteProperty` + * - `Refrect.set` + * - `Refrect.setPrototypeOf` + * @param {ASTNode} node The node to check. + * @param {Scope} scope A `escope.Scope` object to find variable (whichever). + * @returns {boolean} `true` if the node is at the first argument of a well-known mutation function. + */ +function isArgumentOfWellKnownMutationFunction(node, scope) { + const { parent } = node; + + if (parent.type !== "CallExpression" || parent.arguments[0] !== node) { + return false; + } + const callee = astUtils.skipChainExpression(parent.callee); + + if ( + !astUtils.isSpecificMemberAccess(callee, "Object", WellKnownMutationFunctions.Object) && + !astUtils.isSpecificMemberAccess(callee, "Reflect", WellKnownMutationFunctions.Reflect) + ) { + return false; + } + const variable = findVariable(scope, callee.object); + + return variable !== null && variable.scope.type === "global"; +} + +/** + * Check if the identifier node is placed at to update members. + * @param {ASTNode} id The Identifier node to check. + * @param {Scope} scope A `escope.Scope` object to find variable (whichever). + * @returns {boolean} `true` if the member of `id` was updated. + */ +function isMemberWrite(id, scope) { + const { parent } = id; + + return ( + ( + parent.type === "MemberExpression" && + parent.object === id && + ( + isAssignmentLeft(parent) || + isOperandOfMutationUnaryOperator(parent) || + isIterationVariable(parent) + ) + ) || + isArgumentOfWellKnownMutationFunction(id, scope) + ); +} + +/** + * Get the mutation node. + * @param {ASTNode} id The Identifier node to get. + * @returns {ASTNode} The mutation node. + */ +function getWriteNode(id) { + let node = id.parent; + + while ( + node && + node.type !== "AssignmentExpression" && + node.type !== "UpdateExpression" && + node.type !== "UnaryExpression" && + node.type !== "CallExpression" && + node.type !== "ForInStatement" && + node.type !== "ForOfStatement" + ) { + node = node.parent; + } + + return node || id; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow assigning to imported bindings", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-import-assign" + }, + + schema: [], + + messages: { + readonly: "'{{name}}' is read-only.", + readonlyMember: "The members of '{{name}}' are read-only." + } + }, + + create(context) { + return { + ImportDeclaration(node) { + const scope = context.getScope(); + + for (const variable of context.getDeclaredVariables(node)) { + const shouldCheckMembers = variable.defs.some( + d => d.node.type === "ImportNamespaceSpecifier" + ); + let prevIdNode = null; + + for (const reference of variable.references) { + const idNode = reference.identifier; + + /* + * AssignmentPattern (e.g. `[a = 0] = b`) makes two write + * references for the same identifier. This should skip + * the one of the two in order to prevent redundant reports. + */ + if (idNode === prevIdNode) { + continue; + } + prevIdNode = idNode; + + if (reference.isWrite()) { + context.report({ + node: getWriteNode(idNode), + messageId: "readonly", + data: { name: idNode.name } + }); + } else if (shouldCheckMembers && isMemberWrite(idNode, scope)) { + context.report({ + node: getWriteNode(idNode), + messageId: "readonlyMember", + data: { name: idNode.name } + }); + } + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-inline-comments.js b/node_modules/eslint/lib/rules/no-inline-comments.js new file mode 100644 index 000000000..41b0f1e66 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-inline-comments.js @@ -0,0 +1,89 @@ +/** + * @fileoverview Enforces or disallows inline comments. + * @author Greg Cochard + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow inline comments after code", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-inline-comments" + }, + + schema: [], + + messages: { + unexpectedInlineComment: "Unexpected comment inline with code." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Will check that comments are not on lines starting with or ending with code + * @param {ASTNode} node The comment node to check + * @private + * @returns {void} + */ + function testCodeAroundComment(node) { + + const startLine = String(sourceCode.lines[node.loc.start.line - 1]), + endLine = String(sourceCode.lines[node.loc.end.line - 1]), + preamble = startLine.slice(0, node.loc.start.column).trim(), + postamble = endLine.slice(node.loc.end.column).trim(), + isPreambleEmpty = !preamble, + isPostambleEmpty = !postamble; + + // Nothing on both sides + if (isPreambleEmpty && isPostambleEmpty) { + return; + } + + // JSX Exception + if ( + (isPreambleEmpty || preamble === "{") && + (isPostambleEmpty || postamble === "}") + ) { + const enclosingNode = sourceCode.getNodeByRangeIndex(node.range[0]); + + if (enclosingNode && enclosingNode.type === "JSXEmptyExpression") { + return; + } + } + + // Don't report ESLint directive comments + if (astUtils.isDirectiveComment(node)) { + return; + } + + context.report({ + node, + messageId: "unexpectedInlineComment" + }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program() { + const comments = sourceCode.getAllComments(); + + comments.filter(token => token.type !== "Shebang").forEach(testCodeAroundComment); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-inner-declarations.js b/node_modules/eslint/lib/rules/no-inner-declarations.js new file mode 100644 index 000000000..0768bc611 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-inner-declarations.js @@ -0,0 +1,88 @@ +/** + * @fileoverview Rule to enforce declarations in program or function body root. + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const validParent = new Set(["Program", "ExportNamedDeclaration", "ExportDefaultDeclaration"]); +const validBlockStatementParent = new Set(["FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression"]); + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow variable or `function` declarations in nested blocks", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-inner-declarations" + }, + + schema: [ + { + enum: ["functions", "both"] + } + ], + + messages: { + moveDeclToRoot: "Move {{type}} declaration to {{body}} root." + } + }, + + create(context) { + + /** + * Ensure that a given node is at a program or function body's root. + * @param {ASTNode} node Declaration node to check. + * @returns {void} + */ + function check(node) { + const parent = node.parent; + + if ( + parent.type === "BlockStatement" && validBlockStatementParent.has(parent.parent.type) + ) { + return; + } + + if (validParent.has(parent.type)) { + return; + } + + const upperFunction = astUtils.getUpperFunction(parent); + + context.report({ + node, + messageId: "moveDeclToRoot", + data: { + type: (node.type === "FunctionDeclaration" ? "function" : "variable"), + body: (upperFunction === null ? "program" : "function body") + } + }); + } + + + return { + + FunctionDeclaration: check, + VariableDeclaration(node) { + if (context.options[0] === "both" && node.kind === "var") { + check(node); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-invalid-regexp.js b/node_modules/eslint/lib/rules/no-invalid-regexp.js new file mode 100644 index 000000000..48b7188d4 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-invalid-regexp.js @@ -0,0 +1,130 @@ +/** + * @fileoverview Validate strings passed to the RegExp constructor + * @author Michael Ficarra + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const RegExpValidator = require("regexpp").RegExpValidator; +const validator = new RegExpValidator({ ecmaVersion: 2018 }); +const validFlags = /[gimuys]/gu; +const undefined1 = void 0; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow invalid regular expression strings in `RegExp` constructors", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-invalid-regexp" + }, + + schema: [{ + type: "object", + properties: { + allowConstructorFlags: { + type: "array", + items: { + type: "string" + } + } + }, + additionalProperties: false + }], + + messages: { + regexMessage: "{{message}}." + } + }, + + create(context) { + + const options = context.options[0]; + let allowedFlags = null; + + if (options && options.allowConstructorFlags) { + const temp = options.allowConstructorFlags.join("").replace(validFlags, ""); + + if (temp) { + allowedFlags = new RegExp(`[${temp}]`, "giu"); + } + } + + /** + * Check if node is a string + * @param {ASTNode} node node to evaluate + * @returns {boolean} True if its a string + * @private + */ + function isString(node) { + return node && node.type === "Literal" && typeof node.value === "string"; + } + + /** + * Check syntax error in a given pattern. + * @param {string} pattern The RegExp pattern to validate. + * @param {boolean} uFlag The Unicode flag. + * @returns {string|null} The syntax error. + */ + function validateRegExpPattern(pattern, uFlag) { + try { + validator.validatePattern(pattern, undefined1, undefined1, uFlag); + return null; + } catch (err) { + return err.message; + } + } + + /** + * Check syntax error in a given flags. + * @param {string} flags The RegExp flags to validate. + * @returns {string|null} The syntax error. + */ + function validateRegExpFlags(flags) { + try { + validator.validateFlags(flags); + return null; + } catch { + return `Invalid flags supplied to RegExp constructor '${flags}'`; + } + } + + return { + "CallExpression, NewExpression"(node) { + if (node.callee.type !== "Identifier" || node.callee.name !== "RegExp" || !isString(node.arguments[0])) { + return; + } + const pattern = node.arguments[0].value; + let flags = isString(node.arguments[1]) ? node.arguments[1].value : ""; + + if (allowedFlags) { + flags = flags.replace(allowedFlags, ""); + } + + // If flags are unknown, check both are errored or not. + const message = validateRegExpFlags(flags) || ( + flags + ? validateRegExpPattern(pattern, flags.indexOf("u") !== -1) + : validateRegExpPattern(pattern, true) && validateRegExpPattern(pattern, false) + ); + + if (message) { + context.report({ + node, + messageId: "regexMessage", + data: { message } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-invalid-this.js b/node_modules/eslint/lib/rules/no-invalid-this.js new file mode 100644 index 000000000..a79c586d7 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-invalid-this.js @@ -0,0 +1,145 @@ +/** + * @fileoverview A rule to disallow `this` keywords outside of classes or class-like objects. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `this` keywords outside of classes or class-like objects", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-invalid-this" + }, + + schema: [ + { + type: "object", + properties: { + capIsConstructor: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedThis: "Unexpected 'this'." + } + }, + + create(context) { + const options = context.options[0] || {}; + const capIsConstructor = options.capIsConstructor !== false; + const stack = [], + sourceCode = context.getSourceCode(); + + /** + * Gets the current checking context. + * + * The return value has a flag that whether or not `this` keyword is valid. + * The flag is initialized when got at the first time. + * @returns {{valid: boolean}} + * an object which has a flag that whether or not `this` keyword is valid. + */ + stack.getCurrent = function() { + const current = this[this.length - 1]; + + if (!current.init) { + current.init = true; + current.valid = !astUtils.isDefaultThisBinding( + current.node, + sourceCode, + { capIsConstructor } + ); + } + return current; + }; + + /** + * Pushs new checking context into the stack. + * + * The checking context is not initialized yet. + * Because most functions don't have `this` keyword. + * When `this` keyword was found, the checking context is initialized. + * @param {ASTNode} node A function node that was entered. + * @returns {void} + */ + function enterFunction(node) { + + // `this` can be invalid only under strict mode. + stack.push({ + init: !context.getScope().isStrict, + node, + valid: true + }); + } + + /** + * Pops the current checking context from the stack. + * @returns {void} + */ + function exitFunction() { + stack.pop(); + } + + return { + + /* + * `this` is invalid only under strict mode. + * Modules is always strict mode. + */ + Program(node) { + const scope = context.getScope(), + features = context.parserOptions.ecmaFeatures || {}; + + stack.push({ + init: true, + node, + valid: !( + scope.isStrict || + node.sourceType === "module" || + (features.globalReturn && scope.childScopes[0].isStrict) + ) + }); + }, + + "Program:exit"() { + stack.pop(); + }, + + FunctionDeclaration: enterFunction, + "FunctionDeclaration:exit": exitFunction, + FunctionExpression: enterFunction, + "FunctionExpression:exit": exitFunction, + + // Reports if `this` of the current context is invalid. + ThisExpression(node) { + const current = stack.getCurrent(); + + if (current && !current.valid) { + context.report({ + node, + messageId: "unexpectedThis" + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-irregular-whitespace.js b/node_modules/eslint/lib/rules/no-irregular-whitespace.js new file mode 100644 index 000000000..0bf69b128 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-irregular-whitespace.js @@ -0,0 +1,261 @@ +/** + * @fileoverview Rule to disallow whitespace that is not a tab or space, whitespace inside strings and comments are allowed + * @author Jonathan Kingston + * @author Christophe Porteneuve + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +const ALL_IRREGULARS = /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000\u2028\u2029]/u; +const IRREGULAR_WHITESPACE = /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000]+/mgu; +const IRREGULAR_LINE_TERMINATORS = /[\u2028\u2029]/mgu; +const LINE_BREAK = astUtils.createGlobalLinebreakMatcher(); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow irregular whitespace", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-irregular-whitespace" + }, + + schema: [ + { + type: "object", + properties: { + skipComments: { + type: "boolean", + default: false + }, + skipStrings: { + type: "boolean", + default: true + }, + skipTemplates: { + type: "boolean", + default: false + }, + skipRegExps: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + noIrregularWhitespace: "Irregular whitespace not allowed." + } + }, + + create(context) { + + // Module store of errors that we have found + let errors = []; + + // Lookup the `skipComments` option, which defaults to `false`. + const options = context.options[0] || {}; + const skipComments = !!options.skipComments; + const skipStrings = options.skipStrings !== false; + const skipRegExps = !!options.skipRegExps; + const skipTemplates = !!options.skipTemplates; + + const sourceCode = context.getSourceCode(); + const commentNodes = sourceCode.getAllComments(); + + /** + * Removes errors that occur inside a string node + * @param {ASTNode} node to check for matching errors. + * @returns {void} + * @private + */ + function removeWhitespaceError(node) { + const locStart = node.loc.start; + const locEnd = node.loc.end; + + errors = errors.filter(({ loc: { start: errorLoc } }) => { + if (errorLoc.line >= locStart.line && errorLoc.line <= locEnd.line) { + if (errorLoc.column >= locStart.column && (errorLoc.column <= locEnd.column || errorLoc.line < locEnd.line)) { + return false; + } + } + return true; + }); + } + + /** + * Checks identifier or literal nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors + * @param {ASTNode} node to check for matching errors. + * @returns {void} + * @private + */ + function removeInvalidNodeErrorsInIdentifierOrLiteral(node) { + const shouldCheckStrings = skipStrings && (typeof node.value === "string"); + const shouldCheckRegExps = skipRegExps && Boolean(node.regex); + + if (shouldCheckStrings || shouldCheckRegExps) { + + // If we have irregular characters remove them from the errors list + if (ALL_IRREGULARS.test(node.raw)) { + removeWhitespaceError(node); + } + } + } + + /** + * Checks template string literal nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors + * @param {ASTNode} node to check for matching errors. + * @returns {void} + * @private + */ + function removeInvalidNodeErrorsInTemplateLiteral(node) { + if (typeof node.value.raw === "string") { + if (ALL_IRREGULARS.test(node.value.raw)) { + removeWhitespaceError(node); + } + } + } + + /** + * Checks comment nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors + * @param {ASTNode} node to check for matching errors. + * @returns {void} + * @private + */ + function removeInvalidNodeErrorsInComment(node) { + if (ALL_IRREGULARS.test(node.value)) { + removeWhitespaceError(node); + } + } + + /** + * Checks the program source for irregular whitespace + * @param {ASTNode} node The program node + * @returns {void} + * @private + */ + function checkForIrregularWhitespace(node) { + const sourceLines = sourceCode.lines; + + sourceLines.forEach((sourceLine, lineIndex) => { + const lineNumber = lineIndex + 1; + let match; + + while ((match = IRREGULAR_WHITESPACE.exec(sourceLine)) !== null) { + errors.push({ + node, + messageId: "noIrregularWhitespace", + loc: { + start: { + line: lineNumber, + column: match.index + }, + end: { + line: lineNumber, + column: match.index + match[0].length + } + } + }); + } + }); + } + + /** + * Checks the program source for irregular line terminators + * @param {ASTNode} node The program node + * @returns {void} + * @private + */ + function checkForIrregularLineTerminators(node) { + const source = sourceCode.getText(), + sourceLines = sourceCode.lines, + linebreaks = source.match(LINE_BREAK); + let lastLineIndex = -1, + match; + + while ((match = IRREGULAR_LINE_TERMINATORS.exec(source)) !== null) { + const lineIndex = linebreaks.indexOf(match[0], lastLineIndex + 1) || 0; + + errors.push({ + node, + messageId: "noIrregularWhitespace", + loc: { + start: { + line: lineIndex + 1, + column: sourceLines[lineIndex].length + }, + end: { + line: lineIndex + 2, + column: 0 + } + } + }); + + lastLineIndex = lineIndex; + } + } + + /** + * A no-op function to act as placeholder for comment accumulation when the `skipComments` option is `false`. + * @returns {void} + * @private + */ + function noop() {} + + const nodes = {}; + + if (ALL_IRREGULARS.test(sourceCode.getText())) { + nodes.Program = function(node) { + + /* + * As we can easily fire warnings for all white space issues with + * all the source its simpler to fire them here. + * This means we can check all the application code without having + * to worry about issues caused in the parser tokens. + * When writing this code also evaluating per node was missing out + * connecting tokens in some cases. + * We can later filter the errors when they are found to be not an + * issue in nodes we don't care about. + */ + checkForIrregularWhitespace(node); + checkForIrregularLineTerminators(node); + }; + + nodes.Identifier = removeInvalidNodeErrorsInIdentifierOrLiteral; + nodes.Literal = removeInvalidNodeErrorsInIdentifierOrLiteral; + nodes.TemplateElement = skipTemplates ? removeInvalidNodeErrorsInTemplateLiteral : noop; + nodes["Program:exit"] = function() { + if (skipComments) { + + // First strip errors occurring in comment nodes. + commentNodes.forEach(removeInvalidNodeErrorsInComment); + } + + // If we have any errors remaining report on them + errors.forEach(error => context.report(error)); + }; + } else { + nodes.Program = noop; + } + + return nodes; + } +}; diff --git a/node_modules/eslint/lib/rules/no-iterator.js b/node_modules/eslint/lib/rules/no-iterator.js new file mode 100644 index 000000000..9ba1e7aef --- /dev/null +++ b/node_modules/eslint/lib/rules/no-iterator.js @@ -0,0 +1,52 @@ +/** + * @fileoverview Rule to flag usage of __iterator__ property + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { getStaticPropertyName } = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of the `__iterator__` property", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-iterator" + }, + + schema: [], + + messages: { + noIterator: "Reserved name '__iterator__'." + } + }, + + create(context) { + + return { + + MemberExpression(node) { + + if (getStaticPropertyName(node) === "__iterator__") { + context.report({ + node, + messageId: "noIterator" + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-label-var.js b/node_modules/eslint/lib/rules/no-label-var.js new file mode 100644 index 000000000..570db0328 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-label-var.js @@ -0,0 +1,79 @@ +/** + * @fileoverview Rule to flag labels that are the same as an identifier + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow labels that share a name with a variable", + category: "Variables", + recommended: false, + url: "https://eslint.org/docs/rules/no-label-var" + }, + + schema: [], + + messages: { + identifierClashWithLabel: "Found identifier with same name as label." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Check if the identifier is present inside current scope + * @param {Object} scope current scope + * @param {string} name To evaluate + * @returns {boolean} True if its present + * @private + */ + function findIdentifier(scope, name) { + return astUtils.getVariableByName(scope, name) !== null; + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + + LabeledStatement(node) { + + // Fetch the innermost scope. + const scope = context.getScope(); + + /* + * Recursively find the identifier walking up the scope, starting + * with the innermost scope. + */ + if (findIdentifier(scope, node.label.name)) { + context.report({ + node, + messageId: "identifierClashWithLabel" + }); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-labels.js b/node_modules/eslint/lib/rules/no-labels.js new file mode 100644 index 000000000..85760d80d --- /dev/null +++ b/node_modules/eslint/lib/rules/no-labels.js @@ -0,0 +1,149 @@ +/** + * @fileoverview Disallow Labeled Statements + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow labeled statements", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-labels" + }, + + schema: [ + { + type: "object", + properties: { + allowLoop: { + type: "boolean", + default: false + }, + allowSwitch: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedLabel: "Unexpected labeled statement.", + unexpectedLabelInBreak: "Unexpected label in break statement.", + unexpectedLabelInContinue: "Unexpected label in continue statement." + } + }, + + create(context) { + const options = context.options[0]; + const allowLoop = options && options.allowLoop; + const allowSwitch = options && options.allowSwitch; + let scopeInfo = null; + + /** + * Gets the kind of a given node. + * @param {ASTNode} node A node to get. + * @returns {string} The kind of the node. + */ + function getBodyKind(node) { + if (astUtils.isLoop(node)) { + return "loop"; + } + if (node.type === "SwitchStatement") { + return "switch"; + } + return "other"; + } + + /** + * Checks whether the label of a given kind is allowed or not. + * @param {string} kind A kind to check. + * @returns {boolean} `true` if the kind is allowed. + */ + function isAllowed(kind) { + switch (kind) { + case "loop": return allowLoop; + case "switch": return allowSwitch; + default: return false; + } + } + + /** + * Checks whether a given name is a label of a loop or not. + * @param {string} label A name of a label to check. + * @returns {boolean} `true` if the name is a label of a loop. + */ + function getKind(label) { + let info = scopeInfo; + + while (info) { + if (info.label === label) { + return info.kind; + } + info = info.upper; + } + + /* istanbul ignore next: syntax error */ + return "other"; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + LabeledStatement(node) { + scopeInfo = { + label: node.label.name, + kind: getBodyKind(node.body), + upper: scopeInfo + }; + }, + + "LabeledStatement:exit"(node) { + if (!isAllowed(scopeInfo.kind)) { + context.report({ + node, + messageId: "unexpectedLabel" + }); + } + + scopeInfo = scopeInfo.upper; + }, + + BreakStatement(node) { + if (node.label && !isAllowed(getKind(node.label.name))) { + context.report({ + node, + messageId: "unexpectedLabelInBreak" + }); + } + }, + + ContinueStatement(node) { + if (node.label && !isAllowed(getKind(node.label.name))) { + context.report({ + node, + messageId: "unexpectedLabelInContinue" + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-lone-blocks.js b/node_modules/eslint/lib/rules/no-lone-blocks.js new file mode 100644 index 000000000..290784b82 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-lone-blocks.js @@ -0,0 +1,128 @@ +/** + * @fileoverview Rule to flag blocks with no reason to exist + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary nested blocks", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-lone-blocks" + }, + + schema: [], + + messages: { + redundantBlock: "Block is redundant.", + redundantNestedBlock: "Nested block is redundant." + } + }, + + create(context) { + + // A stack of lone blocks to be checked for block-level bindings + const loneBlocks = []; + let ruleDef; + + /** + * Reports a node as invalid. + * @param {ASTNode} node The node to be reported. + * @returns {void} + */ + function report(node) { + const messageId = node.parent.type === "BlockStatement" ? "redundantNestedBlock" : "redundantBlock"; + + context.report({ + node, + messageId + }); + } + + /** + * Checks for any occurrence of a BlockStatement in a place where lists of statements can appear + * @param {ASTNode} node The node to check + * @returns {boolean} True if the node is a lone block. + */ + function isLoneBlock(node) { + return node.parent.type === "BlockStatement" || + node.parent.type === "Program" || + + // Don't report blocks in switch cases if the block is the only statement of the case. + node.parent.type === "SwitchCase" && !(node.parent.consequent[0] === node && node.parent.consequent.length === 1); + } + + /** + * Checks the enclosing block of the current node for block-level bindings, + * and "marks it" as valid if any. + * @returns {void} + */ + function markLoneBlock() { + if (loneBlocks.length === 0) { + return; + } + + const block = context.getAncestors().pop(); + + if (loneBlocks[loneBlocks.length - 1] === block) { + loneBlocks.pop(); + } + } + + // Default rule definition: report all lone blocks + ruleDef = { + BlockStatement(node) { + if (isLoneBlock(node)) { + report(node); + } + } + }; + + // ES6: report blocks without block-level bindings, or that's only child of another block + if (context.parserOptions.ecmaVersion >= 6) { + ruleDef = { + BlockStatement(node) { + if (isLoneBlock(node)) { + loneBlocks.push(node); + } + }, + "BlockStatement:exit"(node) { + if (loneBlocks.length > 0 && loneBlocks[loneBlocks.length - 1] === node) { + loneBlocks.pop(); + report(node); + } else if ( + node.parent.type === "BlockStatement" && + node.parent.body.length === 1 + ) { + report(node); + } + } + }; + + ruleDef.VariableDeclaration = function(node) { + if (node.kind === "let" || node.kind === "const") { + markLoneBlock(); + } + }; + + ruleDef.FunctionDeclaration = function() { + if (context.getScope().isStrict) { + markLoneBlock(); + } + }; + + ruleDef.ClassDeclaration = markLoneBlock; + } + + return ruleDef; + } +}; diff --git a/node_modules/eslint/lib/rules/no-lonely-if.js b/node_modules/eslint/lib/rules/no-lonely-if.js new file mode 100644 index 000000000..6552adc57 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-lonely-if.js @@ -0,0 +1,89 @@ +/** + * @fileoverview Rule to disallow if as the only statement in an else block + * @author Brandon Mills + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `if` statements as the only statement in `else` blocks", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-lonely-if" + }, + + schema: [], + fixable: "code", + + messages: { + unexpectedLonelyIf: "Unexpected if as the only statement in an else block." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + IfStatement(node) { + const ancestors = context.getAncestors(), + parent = ancestors.pop(), + grandparent = ancestors.pop(); + + if (parent && parent.type === "BlockStatement" && + parent.body.length === 1 && grandparent && + grandparent.type === "IfStatement" && + parent === grandparent.alternate) { + context.report({ + node, + messageId: "unexpectedLonelyIf", + fix(fixer) { + const openingElseCurly = sourceCode.getFirstToken(parent); + const closingElseCurly = sourceCode.getLastToken(parent); + const elseKeyword = sourceCode.getTokenBefore(openingElseCurly); + const tokenAfterElseBlock = sourceCode.getTokenAfter(closingElseCurly); + const lastIfToken = sourceCode.getLastToken(node.consequent); + const sourceText = sourceCode.getText(); + + if (sourceText.slice(openingElseCurly.range[1], + node.range[0]).trim() || sourceText.slice(node.range[1], closingElseCurly.range[0]).trim()) { + + // Don't fix if there are any non-whitespace characters interfering (e.g. comments) + return null; + } + + if ( + node.consequent.type !== "BlockStatement" && lastIfToken.value !== ";" && tokenAfterElseBlock && + ( + node.consequent.loc.end.line === tokenAfterElseBlock.loc.start.line || + /^[([/+`-]/u.test(tokenAfterElseBlock.value) || + lastIfToken.value === "++" || + lastIfToken.value === "--" + ) + ) { + + /* + * If the `if` statement has no block, and is not followed by a semicolon, make sure that fixing + * the issue would not change semantics due to ASI. If this would happen, don't do a fix. + */ + return null; + } + + return fixer.replaceTextRange( + [openingElseCurly.range[0], closingElseCurly.range[1]], + (elseKeyword.range[1] === openingElseCurly.range[0] ? " " : "") + sourceCode.getText(node) + ); + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-loop-func.js b/node_modules/eslint/lib/rules/no-loop-func.js new file mode 100644 index 000000000..13ebd3ee2 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-loop-func.js @@ -0,0 +1,204 @@ +/** + * @fileoverview Rule to flag creation of function inside a loop + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets the containing loop node of a specified node. + * + * We don't need to check nested functions, so this ignores those. + * `Scope.through` contains references of nested functions. + * @param {ASTNode} node An AST node to get. + * @returns {ASTNode|null} The containing loop node of the specified node, or + * `null`. + */ +function getContainingLoopNode(node) { + for (let currentNode = node; currentNode.parent; currentNode = currentNode.parent) { + const parent = currentNode.parent; + + switch (parent.type) { + case "WhileStatement": + case "DoWhileStatement": + return parent; + + case "ForStatement": + + // `init` is outside of the loop. + if (parent.init !== currentNode) { + return parent; + } + break; + + case "ForInStatement": + case "ForOfStatement": + + // `right` is outside of the loop. + if (parent.right !== currentNode) { + return parent; + } + break; + + case "ArrowFunctionExpression": + case "FunctionExpression": + case "FunctionDeclaration": + + // We don't need to check nested functions. + return null; + + default: + break; + } + } + + return null; +} + +/** + * Gets the containing loop node of a given node. + * If the loop was nested, this returns the most outer loop. + * @param {ASTNode} node A node to get. This is a loop node. + * @param {ASTNode|null} excludedNode A node that the result node should not + * include. + * @returns {ASTNode} The most outer loop node. + */ +function getTopLoopNode(node, excludedNode) { + const border = excludedNode ? excludedNode.range[1] : 0; + let retv = node; + let containingLoopNode = node; + + while (containingLoopNode && containingLoopNode.range[0] >= border) { + retv = containingLoopNode; + containingLoopNode = getContainingLoopNode(containingLoopNode); + } + + return retv; +} + +/** + * Checks whether a given reference which refers to an upper scope's variable is + * safe or not. + * @param {ASTNode} loopNode A containing loop node. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is safe or not. + */ +function isSafe(loopNode, reference) { + const variable = reference.resolved; + const definition = variable && variable.defs[0]; + const declaration = definition && definition.parent; + const kind = (declaration && declaration.type === "VariableDeclaration") + ? declaration.kind + : ""; + + // Variables which are declared by `const` is safe. + if (kind === "const") { + return true; + } + + /* + * Variables which are declared by `let` in the loop is safe. + * It's a different instance from the next loop step's. + */ + if (kind === "let" && + declaration.range[0] > loopNode.range[0] && + declaration.range[1] < loopNode.range[1] + ) { + return true; + } + + /* + * WriteReferences which exist after this border are unsafe because those + * can modify the variable. + */ + const border = getTopLoopNode( + loopNode, + (kind === "let") ? declaration : null + ).range[0]; + + /** + * Checks whether a given reference is safe or not. + * The reference is every reference of the upper scope's variable we are + * looking now. + * + * It's safeafe if the reference matches one of the following condition. + * - is readonly. + * - doesn't exist inside a local function and after the border. + * @param {eslint-scope.Reference} upperRef A reference to check. + * @returns {boolean} `true` if the reference is safe. + */ + function isSafeReference(upperRef) { + const id = upperRef.identifier; + + return ( + !upperRef.isWrite() || + variable.scope.variableScope === upperRef.from.variableScope && + id.range[0] < border + ); + } + + return Boolean(variable) && variable.references.every(isSafeReference); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow function declarations that contain unsafe references inside loop statements", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-loop-func" + }, + + schema: [], + + messages: { + unsafeRefs: "Function declared in a loop contains unsafe references to variable(s) {{ varNames }}." + } + }, + + create(context) { + + /** + * Reports functions which match the following condition: + * + * - has a loop node in ancestors. + * - has any references which refers to an unsafe variable. + * @param {ASTNode} node The AST node to check. + * @returns {boolean} Whether or not the node is within a loop. + */ + function checkForLoops(node) { + const loopNode = getContainingLoopNode(node); + + if (!loopNode) { + return; + } + + const references = context.getScope().through; + const unsafeRefs = references.filter(r => !isSafe(loopNode, r)).map(r => r.identifier.name); + + if (unsafeRefs.length > 0) { + context.report({ + node, + messageId: "unsafeRefs", + data: { varNames: `'${unsafeRefs.join("', '")}'` } + }); + } + } + + return { + ArrowFunctionExpression: checkForLoops, + FunctionExpression: checkForLoops, + FunctionDeclaration: checkForLoops + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-loss-of-precision.js b/node_modules/eslint/lib/rules/no-loss-of-precision.js new file mode 100644 index 000000000..9e2811809 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-loss-of-precision.js @@ -0,0 +1,206 @@ +/** + * @fileoverview Rule to flag numbers that will lose significant figure precision at runtime + * @author Jacob Moore + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow literal numbers that lose precision", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-loss-of-precision" + }, + schema: [], + messages: { + noLossOfPrecision: "This number literal will lose precision at runtime." + } + }, + + create(context) { + + /** + * Returns whether the node is number literal + * @param {Node} node the node literal being evaluated + * @returns {boolean} true if the node is a number literal + */ + function isNumber(node) { + return typeof node.value === "number"; + } + + /** + * Gets the source code of the given number literal. Removes `_` numeric separators from the result. + * @param {Node} node the number `Literal` node + * @returns {string} raw source code of the literal, without numeric separators + */ + function getRaw(node) { + return node.raw.replace(/_/gu, ""); + } + + /** + * Checks whether the number is base ten + * @param {ASTNode} node the node being evaluated + * @returns {boolean} true if the node is in base ten + */ + function isBaseTen(node) { + const prefixes = ["0x", "0X", "0b", "0B", "0o", "0O"]; + + return prefixes.every(prefix => !node.raw.startsWith(prefix)) && + !/^0[0-7]+$/u.test(node.raw); + } + + /** + * Checks that the user-intended non-base ten number equals the actual number after is has been converted to the Number type + * @param {Node} node the node being evaluated + * @returns {boolean} true if they do not match + */ + function notBaseTenLosesPrecision(node) { + const rawString = getRaw(node).toUpperCase(); + let base = 0; + + if (rawString.startsWith("0B")) { + base = 2; + } else if (rawString.startsWith("0X")) { + base = 16; + } else { + base = 8; + } + + return !rawString.endsWith(node.value.toString(base).toUpperCase()); + } + + /** + * Adds a decimal point to the numeric string at index 1 + * @param {string} stringNumber the numeric string without any decimal point + * @returns {string} the numeric string with a decimal point in the proper place + */ + function addDecimalPointToNumber(stringNumber) { + return `${stringNumber.slice(0, 1)}.${stringNumber.slice(1)}`; + } + + /** + * Returns the number stripped of leading zeros + * @param {string} numberAsString the string representation of the number + * @returns {string} the stripped string + */ + function removeLeadingZeros(numberAsString) { + return numberAsString.replace(/^0*/u, ""); + } + + /** + * Returns the number stripped of trailing zeros + * @param {string} numberAsString the string representation of the number + * @returns {string} the stripped string + */ + function removeTrailingZeros(numberAsString) { + return numberAsString.replace(/0*$/u, ""); + } + + /** + * Converts an integer to to an object containing the the integer's coefficient and order of magnitude + * @param {string} stringInteger the string representation of the integer being converted + * @returns {Object} the object containing the the integer's coefficient and order of magnitude + */ + function normalizeInteger(stringInteger) { + const significantDigits = removeTrailingZeros(removeLeadingZeros(stringInteger)); + + return { + magnitude: stringInteger.startsWith("0") ? stringInteger.length - 2 : stringInteger.length - 1, + coefficient: addDecimalPointToNumber(significantDigits) + }; + } + + /** + * + * Converts a float to to an object containing the the floats's coefficient and order of magnitude + * @param {string} stringFloat the string representation of the float being converted + * @returns {Object} the object containing the the integer's coefficient and order of magnitude + */ + function normalizeFloat(stringFloat) { + const trimmedFloat = removeLeadingZeros(stringFloat); + + if (trimmedFloat.startsWith(".")) { + const decimalDigits = trimmedFloat.split(".").pop(); + const significantDigits = removeLeadingZeros(decimalDigits); + + return { + magnitude: significantDigits.length - decimalDigits.length - 1, + coefficient: addDecimalPointToNumber(significantDigits) + }; + + } + return { + magnitude: trimmedFloat.indexOf(".") - 1, + coefficient: addDecimalPointToNumber(trimmedFloat.replace(".", "")) + + }; + } + + + /** + * Converts a base ten number to proper scientific notation + * @param {string} stringNumber the string representation of the base ten number to be converted + * @returns {string} the number converted to scientific notation + */ + function convertNumberToScientificNotation(stringNumber) { + const splitNumber = stringNumber.replace("E", "e").split("e"); + const originalCoefficient = splitNumber[0]; + const normalizedNumber = stringNumber.includes(".") ? normalizeFloat(originalCoefficient) + : normalizeInteger(originalCoefficient); + const normalizedCoefficient = normalizedNumber.coefficient; + const magnitude = splitNumber.length > 1 ? (parseInt(splitNumber[1], 10) + normalizedNumber.magnitude) + : normalizedNumber.magnitude; + + return `${normalizedCoefficient}e${magnitude}`; + + } + + /** + * Checks that the user-intended base ten number equals the actual number after is has been converted to the Number type + * @param {Node} node the node being evaluated + * @returns {boolean} true if they do not match + */ + function baseTenLosesPrecision(node) { + const normalizedRawNumber = convertNumberToScientificNotation(getRaw(node)); + const requestedPrecision = normalizedRawNumber.split("e")[0].replace(".", "").length; + + if (requestedPrecision > 100) { + return true; + } + const storedNumber = node.value.toPrecision(requestedPrecision); + const normalizedStoredNumber = convertNumberToScientificNotation(storedNumber); + + return normalizedRawNumber !== normalizedStoredNumber; + } + + + /** + * Checks that the user-intended number equals the actual number after is has been converted to the Number type + * @param {Node} node the node being evaluated + * @returns {boolean} true if they do not match + */ + function losesPrecision(node) { + return isBaseTen(node) ? baseTenLosesPrecision(node) : notBaseTenLosesPrecision(node); + } + + + return { + Literal(node) { + if (node.value && isNumber(node) && losesPrecision(node)) { + context.report({ + messageId: "noLossOfPrecision", + node + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-magic-numbers.js b/node_modules/eslint/lib/rules/no-magic-numbers.js new file mode 100644 index 000000000..510b3f9b2 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-magic-numbers.js @@ -0,0 +1,226 @@ +/** + * @fileoverview Rule to flag statements that use magic numbers (adapted from https://github.com/danielstjules/buddy.js) + * @author Vincent Lemeunier + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +// Maximum array length by the ECMAScript Specification. +const MAX_ARRAY_LENGTH = 2 ** 32 - 1; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** + * Convert the value to bigint if it's a string. Otherwise return the value as-is. + * @param {bigint|number|string} x The value to normalize. + * @returns {bigint|number} The normalized value. + */ +function normalizeIgnoreValue(x) { + if (typeof x === "string") { + return BigInt(x.slice(0, -1)); + } + return x; +} + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow magic numbers", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-magic-numbers" + }, + + schema: [{ + type: "object", + properties: { + detectObjects: { + type: "boolean", + default: false + }, + enforceConst: { + type: "boolean", + default: false + }, + ignore: { + type: "array", + items: { + anyOf: [ + { type: "number" }, + { type: "string", pattern: "^[+-]?(?:0|[1-9][0-9]*)n$" } + ] + }, + uniqueItems: true + }, + ignoreArrayIndexes: { + type: "boolean", + default: false + }, + ignoreDefaultValues: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], + + messages: { + useConst: "Number constants declarations must use 'const'.", + noMagic: "No magic number: {{raw}}." + } + }, + + create(context) { + const config = context.options[0] || {}, + detectObjects = !!config.detectObjects, + enforceConst = !!config.enforceConst, + ignore = (config.ignore || []).map(normalizeIgnoreValue), + ignoreArrayIndexes = !!config.ignoreArrayIndexes, + ignoreDefaultValues = !!config.ignoreDefaultValues; + + const okTypes = detectObjects ? [] : ["ObjectExpression", "Property", "AssignmentExpression"]; + + /** + * Returns whether the rule is configured to ignore the given value + * @param {bigint|number} value The value to check + * @returns {boolean} true if the value is ignored + */ + function isIgnoredValue(value) { + return ignore.indexOf(value) !== -1; + } + + /** + * Returns whether the number is a default value assignment. + * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node + * @returns {boolean} true if the number is a default value + */ + function isDefaultValue(fullNumberNode) { + const parent = fullNumberNode.parent; + + return parent.type === "AssignmentPattern" && parent.right === fullNumberNode; + } + + /** + * Returns whether the given node is used as a radix within parseInt() or Number.parseInt() + * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node + * @returns {boolean} true if the node is radix + */ + function isParseIntRadix(fullNumberNode) { + const parent = fullNumberNode.parent; + + return parent.type === "CallExpression" && fullNumberNode === parent.arguments[1] && + ( + astUtils.isSpecificId(parent.callee, "parseInt") || + astUtils.isSpecificMemberAccess(parent.callee, "Number", "parseInt") + ); + } + + /** + * Returns whether the given node is a direct child of a JSX node. + * In particular, it aims to detect numbers used as prop values in JSX tags. + * Example: + * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node + * @returns {boolean} true if the node is a JSX number + */ + function isJSXNumber(fullNumberNode) { + return fullNumberNode.parent.type.indexOf("JSX") === 0; + } + + /** + * Returns whether the given node is used as an array index. + * Value must coerce to a valid array index name: "0", "1", "2" ... "4294967294". + * + * All other values, like "-1", "2.5", or "4294967295", are just "normal" object properties, + * which can be created and accessed on an array in addition to the array index properties, + * but they don't affect array's length and are not considered by methods such as .map(), .forEach() etc. + * + * The maximum array length by the specification is 2 ** 32 - 1 = 4294967295, + * thus the maximum valid index is 2 ** 32 - 2 = 4294967294. + * + * All notations are allowed, as long as the value coerces to one of "0", "1", "2" ... "4294967294". + * + * Valid examples: + * a[0], a[1], a[1.2e1], a[0xAB], a[0n], a[1n] + * a[-0] (same as a[0] because -0 coerces to "0") + * a[-0n] (-0n evaluates to 0n) + * + * Invalid examples: + * a[-1], a[-0xAB], a[-1n], a[2.5], a[1.23e1], a[12e-1] + * a[4294967295] (above the max index, it's an access to a regular property a["4294967295"]) + * a[999999999999999999999] (even if it wasn't above the max index, it would be a["1e+21"]) + * a[1e310] (same as a["Infinity"]) + * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node + * @param {bigint|number} value Value expressed by the fullNumberNode + * @returns {boolean} true if the node is a valid array index + */ + function isArrayIndex(fullNumberNode, value) { + const parent = fullNumberNode.parent; + + return parent.type === "MemberExpression" && parent.property === fullNumberNode && + (Number.isInteger(value) || typeof value === "bigint") && + value >= 0 && value < MAX_ARRAY_LENGTH; + } + + return { + Literal(node) { + if (!astUtils.isNumericLiteral(node)) { + return; + } + + let fullNumberNode; + let value; + let raw; + + // Treat unary minus as a part of the number + if (node.parent.type === "UnaryExpression" && node.parent.operator === "-") { + fullNumberNode = node.parent; + value = -node.value; + raw = `-${node.raw}`; + } else { + fullNumberNode = node; + value = node.value; + raw = node.raw; + } + + const parent = fullNumberNode.parent; + + // Always allow radix arguments and JSX props + if ( + isIgnoredValue(value) || + (ignoreDefaultValues && isDefaultValue(fullNumberNode)) || + isParseIntRadix(fullNumberNode) || + isJSXNumber(fullNumberNode) || + (ignoreArrayIndexes && isArrayIndex(fullNumberNode, value)) + ) { + return; + } + + if (parent.type === "VariableDeclarator") { + if (enforceConst && parent.parent.kind !== "const") { + context.report({ + node: fullNumberNode, + messageId: "useConst" + }); + } + } else if ( + okTypes.indexOf(parent.type) === -1 || + (parent.type === "AssignmentExpression" && parent.left.type === "Identifier") + ) { + context.report({ + node: fullNumberNode, + messageId: "noMagic", + data: { + raw + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-misleading-character-class.js b/node_modules/eslint/lib/rules/no-misleading-character-class.js new file mode 100644 index 000000000..3d004615c --- /dev/null +++ b/node_modules/eslint/lib/rules/no-misleading-character-class.js @@ -0,0 +1,200 @@ +/** + * @author Toru Nagashima + */ +"use strict"; + +const { CALL, CONSTRUCT, ReferenceTracker, getStringIfConstant } = require("eslint-utils"); +const { RegExpParser, visitRegExpAST } = require("regexpp"); +const { isCombiningCharacter, isEmojiModifier, isRegionalIndicatorSymbol, isSurrogatePair } = require("./utils/unicode"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Iterate character sequences of a given nodes. + * + * CharacterClassRange syntax can steal a part of character sequence, + * so this function reverts CharacterClassRange syntax and restore the sequence. + * @param {regexpp.AST.CharacterClassElement[]} nodes The node list to iterate character sequences. + * @returns {IterableIterator} The list of character sequences. + */ +function *iterateCharacterSequence(nodes) { + let seq = []; + + for (const node of nodes) { + switch (node.type) { + case "Character": + seq.push(node.value); + break; + + case "CharacterClassRange": + seq.push(node.min.value); + yield seq; + seq = [node.max.value]; + break; + + case "CharacterSet": + if (seq.length > 0) { + yield seq; + seq = []; + } + break; + + // no default + } + } + + if (seq.length > 0) { + yield seq; + } +} + +const hasCharacterSequence = { + surrogatePairWithoutUFlag(chars) { + return chars.some((c, i) => i !== 0 && isSurrogatePair(chars[i - 1], c)); + }, + + combiningClass(chars) { + return chars.some((c, i) => ( + i !== 0 && + isCombiningCharacter(c) && + !isCombiningCharacter(chars[i - 1]) + )); + }, + + emojiModifier(chars) { + return chars.some((c, i) => ( + i !== 0 && + isEmojiModifier(c) && + !isEmojiModifier(chars[i - 1]) + )); + }, + + regionalIndicatorSymbol(chars) { + return chars.some((c, i) => ( + i !== 0 && + isRegionalIndicatorSymbol(c) && + isRegionalIndicatorSymbol(chars[i - 1]) + )); + }, + + zwj(chars) { + const lastIndex = chars.length - 1; + + return chars.some((c, i) => ( + i !== 0 && + i !== lastIndex && + c === 0x200d && + chars[i - 1] !== 0x200d && + chars[i + 1] !== 0x200d + )); + } +}; + +const kinds = Object.keys(hasCharacterSequence); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow characters which are made with multiple code points in character class syntax", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-misleading-character-class" + }, + + schema: [], + + messages: { + surrogatePairWithoutUFlag: "Unexpected surrogate pair in character class. Use 'u' flag.", + combiningClass: "Unexpected combined character in character class.", + emojiModifier: "Unexpected modified Emoji in character class.", + regionalIndicatorSymbol: "Unexpected national flag in character class.", + zwj: "Unexpected joined character sequence in character class." + } + }, + create(context) { + const parser = new RegExpParser(); + + /** + * Verify a given regular expression. + * @param {Node} node The node to report. + * @param {string} pattern The regular expression pattern to verify. + * @param {string} flags The flags of the regular expression. + * @returns {void} + */ + function verify(node, pattern, flags) { + const has = { + surrogatePairWithoutUFlag: false, + combiningClass: false, + variationSelector: false, + emojiModifier: false, + regionalIndicatorSymbol: false, + zwj: false + }; + let patternNode; + + try { + patternNode = parser.parsePattern( + pattern, + 0, + pattern.length, + flags.includes("u") + ); + } catch { + + // Ignore regular expressions with syntax errors + return; + } + + visitRegExpAST(patternNode, { + onCharacterClassEnter(ccNode) { + for (const chars of iterateCharacterSequence(ccNode.elements)) { + for (const kind of kinds) { + has[kind] = has[kind] || hasCharacterSequence[kind](chars); + } + } + } + }); + + for (const kind of kinds) { + if (has[kind]) { + context.report({ node, messageId: kind }); + } + } + } + + return { + "Literal[regex]"(node) { + verify(node, node.regex.pattern, node.regex.flags); + }, + "Program"() { + const scope = context.getScope(); + const tracker = new ReferenceTracker(scope); + + /* + * Iterate calls of RegExp. + * E.g., `new RegExp()`, `RegExp()`, `new window.RegExp()`, + * `const {RegExp: a} = window; new a()`, etc... + */ + for (const { node } of tracker.iterateGlobalReferences({ + RegExp: { [CALL]: true, [CONSTRUCT]: true } + })) { + const [patternNode, flagsNode] = node.arguments; + const pattern = getStringIfConstant(patternNode, scope); + const flags = getStringIfConstant(flagsNode, scope); + + if (typeof pattern === "string") { + verify(node, pattern, flags || ""); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-mixed-operators.js b/node_modules/eslint/lib/rules/no-mixed-operators.js new file mode 100644 index 000000000..f0290e93e --- /dev/null +++ b/node_modules/eslint/lib/rules/no-mixed-operators.js @@ -0,0 +1,243 @@ +/** + * @fileoverview Rule to disallow mixed binary operators. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils.js"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const ARITHMETIC_OPERATORS = ["+", "-", "*", "/", "%", "**"]; +const BITWISE_OPERATORS = ["&", "|", "^", "~", "<<", ">>", ">>>"]; +const COMPARISON_OPERATORS = ["==", "!=", "===", "!==", ">", ">=", "<", "<="]; +const LOGICAL_OPERATORS = ["&&", "||"]; +const RELATIONAL_OPERATORS = ["in", "instanceof"]; +const TERNARY_OPERATOR = ["?:"]; +const COALESCE_OPERATOR = ["??"]; +const ALL_OPERATORS = [].concat( + ARITHMETIC_OPERATORS, + BITWISE_OPERATORS, + COMPARISON_OPERATORS, + LOGICAL_OPERATORS, + RELATIONAL_OPERATORS, + TERNARY_OPERATOR, + COALESCE_OPERATOR +); +const DEFAULT_GROUPS = [ + ARITHMETIC_OPERATORS, + BITWISE_OPERATORS, + COMPARISON_OPERATORS, + LOGICAL_OPERATORS, + RELATIONAL_OPERATORS +]; +const TARGET_NODE_TYPE = /^(?:Binary|Logical|Conditional)Expression$/u; + +/** + * Normalizes options. + * @param {Object|undefined} options A options object to normalize. + * @returns {Object} Normalized option object. + */ +function normalizeOptions(options = {}) { + const hasGroups = options.groups && options.groups.length > 0; + const groups = hasGroups ? options.groups : DEFAULT_GROUPS; + const allowSamePrecedence = options.allowSamePrecedence !== false; + + return { + groups, + allowSamePrecedence + }; +} + +/** + * Checks whether any group which includes both given operator exists or not. + * @param {Array.} groups A list of groups to check. + * @param {string} left An operator. + * @param {string} right Another operator. + * @returns {boolean} `true` if such group existed. + */ +function includesBothInAGroup(groups, left, right) { + return groups.some(group => group.indexOf(left) !== -1 && group.indexOf(right) !== -1); +} + +/** + * Checks whether the given node is a conditional expression and returns the test node else the left node. + * @param {ASTNode} node A node which can be a BinaryExpression or a LogicalExpression node. + * This parent node can be BinaryExpression, LogicalExpression + * , or a ConditionalExpression node + * @returns {ASTNode} node the appropriate node(left or test). + */ +function getChildNode(node) { + return node.type === "ConditionalExpression" ? node.test : node.left; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow mixed binary operators", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-mixed-operators" + }, + + schema: [ + { + type: "object", + properties: { + groups: { + type: "array", + items: { + type: "array", + items: { enum: ALL_OPERATORS }, + minItems: 2, + uniqueItems: true + }, + uniqueItems: true + }, + allowSamePrecedence: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedMixedOperator: "Unexpected mix of '{{leftOperator}}' and '{{rightOperator}}'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const options = normalizeOptions(context.options[0]); + + /** + * Checks whether a given node should be ignored by options or not. + * @param {ASTNode} node A node to check. This is a BinaryExpression + * node or a LogicalExpression node. This parent node is one of + * them, too. + * @returns {boolean} `true` if the node should be ignored. + */ + function shouldIgnore(node) { + const a = node; + const b = node.parent; + + return ( + !includesBothInAGroup(options.groups, a.operator, b.type === "ConditionalExpression" ? "?:" : b.operator) || + ( + options.allowSamePrecedence && + astUtils.getPrecedence(a) === astUtils.getPrecedence(b) + ) + ); + } + + /** + * Checks whether the operator of a given node is mixed with parent + * node's operator or not. + * @param {ASTNode} node A node to check. This is a BinaryExpression + * node or a LogicalExpression node. This parent node is one of + * them, too. + * @returns {boolean} `true` if the node was mixed. + */ + function isMixedWithParent(node) { + + return ( + node.operator !== node.parent.operator && + !astUtils.isParenthesised(sourceCode, node) + ); + } + + /** + * Checks whether the operator of a given node is mixed with a + * conditional expression. + * @param {ASTNode} node A node to check. This is a conditional + * expression node + * @returns {boolean} `true` if the node was mixed. + */ + function isMixedWithConditionalParent(node) { + return !astUtils.isParenthesised(sourceCode, node) && !astUtils.isParenthesised(sourceCode, node.test); + } + + /** + * Gets the operator token of a given node. + * @param {ASTNode} node A node to check. This is a BinaryExpression + * node or a LogicalExpression node. + * @returns {Token} The operator token of the node. + */ + function getOperatorToken(node) { + return sourceCode.getTokenAfter(getChildNode(node), astUtils.isNotClosingParenToken); + } + + /** + * Reports both the operator of a given node and the operator of the + * parent node. + * @param {ASTNode} node A node to check. This is a BinaryExpression + * node or a LogicalExpression node. This parent node is one of + * them, too. + * @returns {void} + */ + function reportBothOperators(node) { + const parent = node.parent; + const left = (getChildNode(parent) === node) ? node : parent; + const right = (getChildNode(parent) !== node) ? node : parent; + const data = { + leftOperator: left.operator || "?:", + rightOperator: right.operator || "?:" + }; + + context.report({ + node: left, + loc: getOperatorToken(left).loc, + messageId: "unexpectedMixedOperator", + data + }); + context.report({ + node: right, + loc: getOperatorToken(right).loc, + messageId: "unexpectedMixedOperator", + data + }); + } + + /** + * Checks between the operator of this node and the operator of the + * parent node. + * @param {ASTNode} node A node to check. + * @returns {void} + */ + function check(node) { + if (TARGET_NODE_TYPE.test(node.parent.type)) { + if (node.parent.type === "ConditionalExpression" && !shouldIgnore(node) && isMixedWithConditionalParent(node.parent)) { + reportBothOperators(node); + } else { + if (TARGET_NODE_TYPE.test(node.parent.type) && + isMixedWithParent(node) && + !shouldIgnore(node) + ) { + reportBothOperators(node); + } + } + } + + } + + return { + BinaryExpression: check, + LogicalExpression: check + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-mixed-requires.js b/node_modules/eslint/lib/rules/no-mixed-requires.js new file mode 100644 index 000000000..a02de9104 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-mixed-requires.js @@ -0,0 +1,237 @@ +/** + * @fileoverview Rule to enforce grouped require statements for Node.JS + * @author Raphael Pigulla + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "disallow `require` calls to be mixed with regular variable declarations", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/no-mixed-requires" + }, + + schema: [ + { + oneOf: [ + { + type: "boolean" + }, + { + type: "object", + properties: { + grouping: { + type: "boolean" + }, + allowCall: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + noMixRequire: "Do not mix 'require' and other declarations.", + noMixCoreModuleFileComputed: "Do not mix core, module, file and computed requires." + } + }, + + create(context) { + + const options = context.options[0]; + let grouping = false, + allowCall = false; + + if (typeof options === "object") { + grouping = options.grouping; + allowCall = options.allowCall; + } else { + grouping = !!options; + } + + /** + * Returns the list of built-in modules. + * @returns {string[]} An array of built-in Node.js modules. + */ + function getBuiltinModules() { + + /* + * This list is generated using: + * `require("repl")._builtinLibs.concat('repl').sort()` + * This particular list is as per nodejs v0.12.2 and iojs v0.7.1 + */ + return [ + "assert", "buffer", "child_process", "cluster", "crypto", + "dgram", "dns", "domain", "events", "fs", "http", "https", + "net", "os", "path", "punycode", "querystring", "readline", + "repl", "smalloc", "stream", "string_decoder", "tls", "tty", + "url", "util", "v8", "vm", "zlib" + ]; + } + + const BUILTIN_MODULES = getBuiltinModules(); + + const DECL_REQUIRE = "require", + DECL_UNINITIALIZED = "uninitialized", + DECL_OTHER = "other"; + + const REQ_CORE = "core", + REQ_FILE = "file", + REQ_MODULE = "module", + REQ_COMPUTED = "computed"; + + /** + * Determines the type of a declaration statement. + * @param {ASTNode} initExpression The init node of the VariableDeclarator. + * @returns {string} The type of declaration represented by the expression. + */ + function getDeclarationType(initExpression) { + if (!initExpression) { + + // "var x;" + return DECL_UNINITIALIZED; + } + + if (initExpression.type === "CallExpression" && + initExpression.callee.type === "Identifier" && + initExpression.callee.name === "require" + ) { + + // "var x = require('util');" + return DECL_REQUIRE; + } + if (allowCall && + initExpression.type === "CallExpression" && + initExpression.callee.type === "CallExpression" + ) { + + // "var x = require('diagnose')('sub-module');" + return getDeclarationType(initExpression.callee); + } + if (initExpression.type === "MemberExpression") { + + // "var x = require('glob').Glob;" + return getDeclarationType(initExpression.object); + } + + // "var x = 42;" + return DECL_OTHER; + } + + /** + * Determines the type of module that is loaded via require. + * @param {ASTNode} initExpression The init node of the VariableDeclarator. + * @returns {string} The module type. + */ + function inferModuleType(initExpression) { + if (initExpression.type === "MemberExpression") { + + // "var x = require('glob').Glob;" + return inferModuleType(initExpression.object); + } + if (initExpression.arguments.length === 0) { + + // "var x = require();" + return REQ_COMPUTED; + } + + const arg = initExpression.arguments[0]; + + if (arg.type !== "Literal" || typeof arg.value !== "string") { + + // "var x = require(42);" + return REQ_COMPUTED; + } + + if (BUILTIN_MODULES.indexOf(arg.value) !== -1) { + + // "var fs = require('fs');" + return REQ_CORE; + } + if (/^\.{0,2}\//u.test(arg.value)) { + + // "var utils = require('./utils');" + return REQ_FILE; + } + + // "var async = require('async');" + return REQ_MODULE; + + } + + /** + * Check if the list of variable declarations is mixed, i.e. whether it + * contains both require and other declarations. + * @param {ASTNode} declarations The list of VariableDeclarators. + * @returns {boolean} True if the declarations are mixed, false if not. + */ + function isMixed(declarations) { + const contains = {}; + + declarations.forEach(declaration => { + const type = getDeclarationType(declaration.init); + + contains[type] = true; + }); + + return !!( + contains[DECL_REQUIRE] && + (contains[DECL_UNINITIALIZED] || contains[DECL_OTHER]) + ); + } + + /** + * Check if all require declarations in the given list are of the same + * type. + * @param {ASTNode} declarations The list of VariableDeclarators. + * @returns {boolean} True if the declarations are grouped, false if not. + */ + function isGrouped(declarations) { + const found = {}; + + declarations.forEach(declaration => { + if (getDeclarationType(declaration.init) === DECL_REQUIRE) { + found[inferModuleType(declaration.init)] = true; + } + }); + + return Object.keys(found).length <= 1; + } + + + return { + + VariableDeclaration(node) { + + if (isMixed(node.declarations)) { + context.report({ + node, + messageId: "noMixRequire" + }); + } else if (grouping && !isGrouped(node.declarations)) { + context.report({ + node, + messageId: "noMixCoreModuleFileComputed" + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js b/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js new file mode 100644 index 000000000..287cbda03 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js @@ -0,0 +1,113 @@ +/** + * @fileoverview Disallow mixed spaces and tabs for indentation + * @author Jary Niebur + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow mixed spaces and tabs for indentation", + category: "Stylistic Issues", + recommended: true, + url: "https://eslint.org/docs/rules/no-mixed-spaces-and-tabs" + }, + + schema: [ + { + enum: ["smart-tabs", true, false] + } + ], + + messages: { + mixedSpacesAndTabs: "Mixed spaces and tabs." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + let smartTabs; + + switch (context.options[0]) { + case true: // Support old syntax, maybe add deprecation warning here + case "smart-tabs": + smartTabs = true; + break; + default: + smartTabs = false; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + "Program:exit"(node) { + const lines = sourceCode.lines, + comments = sourceCode.getAllComments(), + ignoredCommentLines = new Set(); + + // Add all lines except the first ones. + comments.forEach(comment => { + for (let i = comment.loc.start.line + 1; i <= comment.loc.end.line; i++) { + ignoredCommentLines.add(i); + } + }); + + /* + * At least one space followed by a tab + * or the reverse before non-tab/-space + * characters begin. + */ + let regex = /^(?=( +|\t+))\1(?:\t| )/u; + + if (smartTabs) { + + /* + * At least one space followed by a tab + * before non-tab/-space characters begin. + */ + regex = /^(?=(\t*))\1(?=( +))\2\t/u; + } + + lines.forEach((line, i) => { + const match = regex.exec(line); + + if (match) { + const lineNumber = i + 1; + const loc = { + start: { + line: lineNumber, + column: match[0].length - 2 + }, + end: { + line: lineNumber, + column: match[0].length + } + }; + + if (!ignoredCommentLines.has(lineNumber)) { + const containingNode = sourceCode.getNodeByRangeIndex(sourceCode.getIndexFromLoc(loc.start)); + + if (!(containingNode && ["Literal", "TemplateElement"].includes(containingNode.type))) { + context.report({ + node, + loc, + messageId: "mixedSpacesAndTabs" + }); + } + } + } + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-multi-assign.js b/node_modules/eslint/lib/rules/no-multi-assign.js new file mode 100644 index 000000000..ab6430c19 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-multi-assign.js @@ -0,0 +1,49 @@ +/** + * @fileoverview Rule to check use of chained assignment expressions + * @author Stewart Rand + */ + +"use strict"; + + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow use of chained assignment expressions", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-multi-assign" + }, + + schema: [], + + messages: { + unexpectedChain: "Unexpected chained assignment." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + AssignmentExpression(node) { + if (["AssignmentExpression", "VariableDeclarator"].indexOf(node.parent.type) !== -1) { + context.report({ + node, + messageId: "unexpectedChain" + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-multi-spaces.js b/node_modules/eslint/lib/rules/no-multi-spaces.js new file mode 100644 index 000000000..d43ed7363 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-multi-spaces.js @@ -0,0 +1,138 @@ +/** + * @fileoverview Disallow use of multiple spaces. + * @author Nicholas C. Zakas + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow multiple spaces", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-multi-spaces" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + exceptions: { + type: "object", + patternProperties: { + "^([A-Z][a-z]*)+$": { + type: "boolean" + } + }, + additionalProperties: false + }, + ignoreEOLComments: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + multipleSpaces: "Multiple spaces found before '{{displayValue}}'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const options = context.options[0] || {}; + const ignoreEOLComments = options.ignoreEOLComments; + const exceptions = Object.assign({ Property: true }, options.exceptions); + const hasExceptions = Object.keys(exceptions).filter(key => exceptions[key]).length > 0; + + /** + * Formats value of given comment token for error message by truncating its length. + * @param {Token} token comment token + * @returns {string} formatted value + * @private + */ + function formatReportedCommentValue(token) { + const valueLines = token.value.split("\n"); + const value = valueLines[0]; + const formattedValue = `${value.slice(0, 12)}...`; + + return valueLines.length === 1 && value.length <= 12 ? value : formattedValue; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program() { + sourceCode.tokensAndComments.forEach((leftToken, leftIndex, tokensAndComments) => { + if (leftIndex === tokensAndComments.length - 1) { + return; + } + const rightToken = tokensAndComments[leftIndex + 1]; + + // Ignore tokens that don't have 2 spaces between them or are on different lines + if ( + !sourceCode.text.slice(leftToken.range[1], rightToken.range[0]).includes(" ") || + leftToken.loc.end.line < rightToken.loc.start.line + ) { + return; + } + + // Ignore comments that are the last token on their line if `ignoreEOLComments` is active. + if ( + ignoreEOLComments && + astUtils.isCommentToken(rightToken) && + ( + leftIndex === tokensAndComments.length - 2 || + rightToken.loc.end.line < tokensAndComments[leftIndex + 2].loc.start.line + ) + ) { + return; + } + + // Ignore tokens that are in a node in the "exceptions" object + if (hasExceptions) { + const parentNode = sourceCode.getNodeByRangeIndex(rightToken.range[0] - 1); + + if (parentNode && exceptions[parentNode.type]) { + return; + } + } + + let displayValue; + + if (rightToken.type === "Block") { + displayValue = `/*${formatReportedCommentValue(rightToken)}*/`; + } else if (rightToken.type === "Line") { + displayValue = `//${formatReportedCommentValue(rightToken)}`; + } else { + displayValue = rightToken.value; + } + + context.report({ + node: rightToken, + loc: { start: leftToken.loc.end, end: rightToken.loc.start }, + messageId: "multipleSpaces", + data: { displayValue }, + fix: fixer => fixer.replaceTextRange([leftToken.range[1], rightToken.range[0]], " ") + }); + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-multi-str.js b/node_modules/eslint/lib/rules/no-multi-str.js new file mode 100644 index 000000000..7cf1ae367 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-multi-str.js @@ -0,0 +1,65 @@ +/** + * @fileoverview Rule to flag when using multiline strings + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow multiline strings", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-multi-str" + }, + + schema: [], + + messages: { + multilineString: "Multiline support is limited to browsers supporting ES5 only." + } + }, + + create(context) { + + /** + * Determines if a given node is part of JSX syntax. + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node is a JSX node, false if not. + * @private + */ + function isJSXElement(node) { + return node.type.indexOf("JSX") === 0; + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + + Literal(node) { + if (astUtils.LINEBREAK_MATCHER.test(node.raw) && !isJSXElement(node.parent)) { + context.report({ + node, + messageId: "multilineString" + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-multiple-empty-lines.js b/node_modules/eslint/lib/rules/no-multiple-empty-lines.js new file mode 100644 index 000000000..9cccef308 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-multiple-empty-lines.js @@ -0,0 +1,151 @@ +/** + * @fileoverview Disallows multiple blank lines. + * implementation adapted from the no-trailing-spaces rule. + * @author Greg Cochard + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow multiple empty lines", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-multiple-empty-lines" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + max: { + type: "integer", + minimum: 0 + }, + maxEOF: { + type: "integer", + minimum: 0 + }, + maxBOF: { + type: "integer", + minimum: 0 + } + }, + required: ["max"], + additionalProperties: false + } + ], + + messages: { + blankBeginningOfFile: "Too many blank lines at the beginning of file. Max of {{max}} allowed.", + blankEndOfFile: "Too many blank lines at the end of file. Max of {{max}} allowed.", + consecutiveBlank: "More than {{max}} blank {{pluralizedLines}} not allowed." + } + }, + + create(context) { + + // Use options.max or 2 as default + let max = 2, + maxEOF = max, + maxBOF = max; + + if (context.options.length) { + max = context.options[0].max; + maxEOF = typeof context.options[0].maxEOF !== "undefined" ? context.options[0].maxEOF : max; + maxBOF = typeof context.options[0].maxBOF !== "undefined" ? context.options[0].maxBOF : max; + } + + const sourceCode = context.getSourceCode(); + + // Swallow the final newline, as some editors add it automatically and we don't want it to cause an issue + const allLines = sourceCode.lines[sourceCode.lines.length - 1] === "" ? sourceCode.lines.slice(0, -1) : sourceCode.lines; + const templateLiteralLines = new Set(); + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + TemplateLiteral(node) { + node.quasis.forEach(literalPart => { + + // Empty lines have a semantic meaning if they're inside template literals. Don't count these as empty lines. + for (let ignoredLine = literalPart.loc.start.line; ignoredLine < literalPart.loc.end.line; ignoredLine++) { + templateLiteralLines.add(ignoredLine); + } + }); + }, + "Program:exit"(node) { + return allLines + + // Given a list of lines, first get a list of line numbers that are non-empty. + .reduce((nonEmptyLineNumbers, line, index) => { + if (line.trim() || templateLiteralLines.has(index + 1)) { + nonEmptyLineNumbers.push(index + 1); + } + return nonEmptyLineNumbers; + }, []) + + // Add a value at the end to allow trailing empty lines to be checked. + .concat(allLines.length + 1) + + // Given two line numbers of non-empty lines, report the lines between if the difference is too large. + .reduce((lastLineNumber, lineNumber) => { + let messageId, maxAllowed; + + if (lastLineNumber === 0) { + messageId = "blankBeginningOfFile"; + maxAllowed = maxBOF; + } else if (lineNumber === allLines.length + 1) { + messageId = "blankEndOfFile"; + maxAllowed = maxEOF; + } else { + messageId = "consecutiveBlank"; + maxAllowed = max; + } + + if (lineNumber - lastLineNumber - 1 > maxAllowed) { + context.report({ + node, + loc: { + start: { line: lastLineNumber + maxAllowed + 1, column: 0 }, + end: { line: lineNumber, column: 0 } + }, + messageId, + data: { + max: maxAllowed, + pluralizedLines: maxAllowed === 1 ? "line" : "lines" + }, + fix(fixer) { + const rangeStart = sourceCode.getIndexFromLoc({ line: lastLineNumber + 1, column: 0 }); + + /* + * The end of the removal range is usually the start index of the next line. + * However, at the end of the file there is no next line, so the end of the + * range is just the length of the text. + */ + const lineNumberAfterRemovedLines = lineNumber - maxAllowed; + const rangeEnd = lineNumberAfterRemovedLines <= allLines.length + ? sourceCode.getIndexFromLoc({ line: lineNumberAfterRemovedLines, column: 0 }) + : sourceCode.text.length; + + return fixer.removeRange([rangeStart, rangeEnd]); + } + }); + } + + return lineNumber; + }, 0); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-native-reassign.js b/node_modules/eslint/lib/rules/no-native-reassign.js new file mode 100644 index 000000000..833e3b7ce --- /dev/null +++ b/node_modules/eslint/lib/rules/no-native-reassign.js @@ -0,0 +1,97 @@ +/** + * @fileoverview Rule to disallow assignments to native objects or read-only global variables + * @author Ilya Volodin + * @deprecated in ESLint v3.3.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow assignments to native objects or read-only global variables", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-native-reassign" + }, + + deprecated: true, + + replacedBy: ["no-global-assign"], + + schema: [ + { + type: "object", + properties: { + exceptions: { + type: "array", + items: { type: "string" }, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + nativeReassign: "Read-only global '{{name}}' should not be modified." + } + }, + + create(context) { + const config = context.options[0]; + const exceptions = (config && config.exceptions) || []; + + /** + * Reports write references. + * @param {Reference} reference A reference to check. + * @param {int} index The index of the reference in the references. + * @param {Reference[]} references The array that the reference belongs to. + * @returns {void} + */ + function checkReference(reference, index, references) { + const identifier = reference.identifier; + + if (reference.init === false && + reference.isWrite() && + + /* + * Destructuring assignments can have multiple default value, + * so possibly there are multiple writeable references for the same identifier. + */ + (index === 0 || references[index - 1].identifier !== identifier) + ) { + context.report({ + node: identifier, + messageId: "nativeReassign", + data: identifier + }); + } + } + + /** + * Reports write references if a given variable is read-only builtin. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + if (variable.writeable === false && exceptions.indexOf(variable.name) === -1) { + variable.references.forEach(checkReference); + } + } + + return { + Program() { + const globalScope = context.getScope(); + + globalScope.variables.forEach(checkVariable); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-negated-condition.js b/node_modules/eslint/lib/rules/no-negated-condition.js new file mode 100644 index 000000000..8a9eba881 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-negated-condition.js @@ -0,0 +1,95 @@ +/** + * @fileoverview Rule to disallow a negated condition + * @author Alberto Rodríguez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow negated conditions", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-negated-condition" + }, + + schema: [], + + messages: { + unexpectedNegated: "Unexpected negated condition." + } + }, + + create(context) { + + /** + * Determines if a given node is an if-else without a condition on the else + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node has an else without an if. + * @private + */ + function hasElseWithoutCondition(node) { + return node.alternate && node.alternate.type !== "IfStatement"; + } + + /** + * Determines if a given node is a negated unary expression + * @param {Object} test The test object to check. + * @returns {boolean} True if the node is a negated unary expression. + * @private + */ + function isNegatedUnaryExpression(test) { + return test.type === "UnaryExpression" && test.operator === "!"; + } + + /** + * Determines if a given node is a negated binary expression + * @param {Test} test The test to check. + * @returns {boolean} True if the node is a negated binary expression. + * @private + */ + function isNegatedBinaryExpression(test) { + return test.type === "BinaryExpression" && + (test.operator === "!=" || test.operator === "!=="); + } + + /** + * Determines if a given node has a negated if expression + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node has a negated if expression. + * @private + */ + function isNegatedIf(node) { + return isNegatedUnaryExpression(node.test) || isNegatedBinaryExpression(node.test); + } + + return { + IfStatement(node) { + if (!hasElseWithoutCondition(node)) { + return; + } + + if (isNegatedIf(node)) { + context.report({ + node, + messageId: "unexpectedNegated" + }); + } + }, + ConditionalExpression(node) { + if (isNegatedIf(node)) { + context.report({ + node, + messageId: "unexpectedNegated" + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-negated-in-lhs.js b/node_modules/eslint/lib/rules/no-negated-in-lhs.js new file mode 100644 index 000000000..1229cedd1 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-negated-in-lhs.js @@ -0,0 +1,46 @@ +/** + * @fileoverview A rule to disallow negated left operands of the `in` operator + * @author Michael Ficarra + * @deprecated in ESLint v3.3.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow negating the left operand in `in` expressions", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-negated-in-lhs" + }, + + replacedBy: ["no-unsafe-negation"], + + deprecated: true, + schema: [], + + messages: { + negatedLHS: "The 'in' expression's left operand is negated." + } + }, + + create(context) { + + return { + + BinaryExpression(node) { + if (node.operator === "in" && node.left.type === "UnaryExpression" && node.left.operator === "!") { + context.report({ node, messageId: "negatedLHS" }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-nested-ternary.js b/node_modules/eslint/lib/rules/no-nested-ternary.js new file mode 100644 index 000000000..383bb2388 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-nested-ternary.js @@ -0,0 +1,44 @@ +/** + * @fileoverview Rule to flag nested ternary expressions + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow nested ternary expressions", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-nested-ternary" + }, + + schema: [], + + messages: { + noNestedTernary: "Do not nest ternary expressions." + } + }, + + create(context) { + + return { + ConditionalExpression(node) { + if (node.alternate.type === "ConditionalExpression" || + node.consequent.type === "ConditionalExpression") { + context.report({ + node, + messageId: "noNestedTernary" + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-new-func.js b/node_modules/eslint/lib/rules/no-new-func.js new file mode 100644 index 000000000..9af4e31ca --- /dev/null +++ b/node_modules/eslint/lib/rules/no-new-func.js @@ -0,0 +1,58 @@ +/** + * @fileoverview Rule to flag when using new Function + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `new` operators with the `Function` object", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-new-func" + }, + + schema: [], + + messages: { + noFunctionConstructor: "The Function constructor is eval." + } + }, + + create(context) { + + return { + "Program:exit"() { + const globalScope = context.getScope(); + const variable = globalScope.set.get("Function"); + + if (variable && variable.defs.length === 0) { + variable.references.forEach(ref => { + const node = ref.identifier; + const { parent } = node; + + if ( + parent && + (parent.type === "NewExpression" || parent.type === "CallExpression") && + node === parent.callee + ) { + context.report({ + node: parent, + messageId: "noFunctionConstructor" + }); + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-new-object.js b/node_modules/eslint/lib/rules/no-new-object.js new file mode 100644 index 000000000..e9f915db5 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-new-object.js @@ -0,0 +1,57 @@ +/** + * @fileoverview A rule to disallow calls to the Object constructor + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `Object` constructors", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-new-object" + }, + + schema: [], + + messages: { + preferLiteral: "The object literal notation {} is preferrable." + } + }, + + create(context) { + return { + NewExpression(node) { + const variable = astUtils.getVariableByName( + context.getScope(), + node.callee.name + ); + + if (variable && variable.identifiers.length > 0) { + return; + } + + if (node.callee.name === "Object") { + context.report({ + node, + messageId: "preferLiteral" + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-new-require.js b/node_modules/eslint/lib/rules/no-new-require.js new file mode 100644 index 000000000..063f783e7 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-new-require.js @@ -0,0 +1,49 @@ +/** + * @fileoverview Rule to disallow use of new operator with the `require` function + * @author Wil Moore III + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "disallow `new` operators with calls to `require`", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/no-new-require" + }, + + schema: [], + + messages: { + noNewRequire: "Unexpected use of new with require." + } + }, + + create(context) { + + return { + + NewExpression(node) { + if (node.callee.type === "Identifier" && node.callee.name === "require") { + context.report({ + node, + messageId: "noNewRequire" + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-new-symbol.js b/node_modules/eslint/lib/rules/no-new-symbol.js new file mode 100644 index 000000000..aeb509c0d --- /dev/null +++ b/node_modules/eslint/lib/rules/no-new-symbol.js @@ -0,0 +1,54 @@ +/** + * @fileoverview Rule to disallow use of the new operator with the `Symbol` object + * @author Alberto Rodríguez + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow `new` operators with the `Symbol` object", + category: "ECMAScript 6", + recommended: true, + url: "https://eslint.org/docs/rules/no-new-symbol" + }, + + schema: [], + + messages: { + noNewSymbol: "`Symbol` cannot be called as a constructor." + } + }, + + create(context) { + + return { + "Program:exit"() { + const globalScope = context.getScope(); + const variable = globalScope.set.get("Symbol"); + + if (variable && variable.defs.length === 0) { + variable.references.forEach(ref => { + const node = ref.identifier; + const parent = node.parent; + + if (parent && parent.type === "NewExpression" && parent.callee === node) { + context.report({ + node, + messageId: "noNewSymbol" + }); + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-new-wrappers.js b/node_modules/eslint/lib/rules/no-new-wrappers.js new file mode 100644 index 000000000..d276c48d2 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-new-wrappers.js @@ -0,0 +1,48 @@ +/** + * @fileoverview Rule to flag when using constructor for wrapper objects + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `new` operators with the `String`, `Number`, and `Boolean` objects", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-new-wrappers" + }, + + schema: [], + + messages: { + noConstructor: "Do not use {{fn}} as a constructor." + } + }, + + create(context) { + + return { + + NewExpression(node) { + const wrapperObjects = ["String", "Number", "Boolean"]; + + if (wrapperObjects.indexOf(node.callee.name) > -1) { + context.report({ + node, + messageId: "noConstructor", + data: { fn: node.callee.name } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-new.js b/node_modules/eslint/lib/rules/no-new.js new file mode 100644 index 000000000..aa8a4e268 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-new.js @@ -0,0 +1,43 @@ +/** + * @fileoverview Rule to flag statements with function invocation preceded by + * "new" and not part of assignment + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `new` operators outside of assignments or comparisons", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-new" + }, + + schema: [], + + messages: { + noNewStatement: "Do not use 'new' for side effects." + } + }, + + create(context) { + + return { + "ExpressionStatement > NewExpression"(node) { + context.report({ + node: node.parent, + messageId: "noNewStatement" + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-obj-calls.js b/node_modules/eslint/lib/rules/no-obj-calls.js new file mode 100644 index 000000000..6eb200c9b --- /dev/null +++ b/node_modules/eslint/lib/rules/no-obj-calls.js @@ -0,0 +1,84 @@ +/** + * @fileoverview Rule to flag use of an object property of the global object (Math and JSON) as a function + * @author James Allardice + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { CALL, CONSTRUCT, ReferenceTracker } = require("eslint-utils"); +const getPropertyName = require("./utils/ast-utils").getStaticPropertyName; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const nonCallableGlobals = ["Atomics", "JSON", "Math", "Reflect"]; + +/** + * Returns the name of the node to report + * @param {ASTNode} node A node to report + * @returns {string} name to report + */ +function getReportNodeName(node) { + if (node.type === "ChainExpression") { + return getReportNodeName(node.expression); + } + if (node.type === "MemberExpression") { + return getPropertyName(node); + } + return node.name; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow calling global object properties as functions", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-obj-calls" + }, + + schema: [], + + messages: { + unexpectedCall: "'{{name}}' is not a function.", + unexpectedRefCall: "'{{name}}' is reference to '{{ref}}', which is not a function." + } + }, + + create(context) { + + return { + Program() { + const scope = context.getScope(); + const tracker = new ReferenceTracker(scope); + const traceMap = {}; + + for (const g of nonCallableGlobals) { + traceMap[g] = { + [CALL]: true, + [CONSTRUCT]: true + }; + } + + for (const { node, path } of tracker.iterateGlobalReferences(traceMap)) { + const name = getReportNodeName(node.callee); + const ref = path[0]; + const messageId = name === ref ? "unexpectedCall" : "unexpectedRefCall"; + + context.report({ node, messageId, data: { name, ref } }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-octal-escape.js b/node_modules/eslint/lib/rules/no-octal-escape.js new file mode 100644 index 000000000..5b4c7b2eb --- /dev/null +++ b/node_modules/eslint/lib/rules/no-octal-escape.js @@ -0,0 +1,56 @@ +/** + * @fileoverview Rule to flag octal escape sequences in string literals. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow octal escape sequences in string literals", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-octal-escape" + }, + + schema: [], + + messages: { + octalEscapeSequence: "Don't use octal: '\\{{sequence}}'. Use '\\u....' instead." + } + }, + + create(context) { + + return { + + Literal(node) { + if (typeof node.value !== "string") { + return; + } + + // \0 represents a valid NULL character if it isn't followed by a digit. + const match = node.raw.match( + /^(?:[^\\]|\\.)*?\\([0-3][0-7]{1,2}|[4-7][0-7]|0(?=[89])|[1-7])/su + ); + + if (match) { + context.report({ + node, + messageId: "octalEscapeSequence", + data: { sequence: match[1] } + }); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-octal.js b/node_modules/eslint/lib/rules/no-octal.js new file mode 100644 index 000000000..e9940befa --- /dev/null +++ b/node_modules/eslint/lib/rules/no-octal.js @@ -0,0 +1,45 @@ +/** + * @fileoverview Rule to flag when initializing octal literal + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow octal literals", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-octal" + }, + + schema: [], + + messages: { + noOcatal: "Octal literals should not be used." + } + }, + + create(context) { + + return { + + Literal(node) { + if (typeof node.value === "number" && /^0[0-9]/u.test(node.raw)) { + context.report({ + node, + messageId: "noOcatal" + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-param-reassign.js b/node_modules/eslint/lib/rules/no-param-reassign.js new file mode 100644 index 000000000..6874af44f --- /dev/null +++ b/node_modules/eslint/lib/rules/no-param-reassign.js @@ -0,0 +1,229 @@ +/** + * @fileoverview Disallow reassignment of function parameters. + * @author Nat Burns + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const stopNodePattern = /(?:Statement|Declaration|Function(?:Expression)?|Program)$/u; + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow reassigning `function` parameters", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-param-reassign" + }, + + schema: [ + { + oneOf: [ + { + type: "object", + properties: { + props: { + enum: [false] + } + }, + additionalProperties: false + }, + { + type: "object", + properties: { + props: { + enum: [true] + }, + ignorePropertyModificationsFor: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + ignorePropertyModificationsForRegex: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + assignmentToFunctionParam: "Assignment to function parameter '{{name}}'.", + assignmentToFunctionParamProp: "Assignment to property of function parameter '{{name}}'." + } + }, + + create(context) { + const props = context.options[0] && context.options[0].props; + const ignoredPropertyAssignmentsFor = context.options[0] && context.options[0].ignorePropertyModificationsFor || []; + const ignoredPropertyAssignmentsForRegex = context.options[0] && context.options[0].ignorePropertyModificationsForRegex || []; + + /** + * Checks whether or not the reference modifies properties of its variable. + * @param {Reference} reference A reference to check. + * @returns {boolean} Whether or not the reference modifies properties of its variable. + */ + function isModifyingProp(reference) { + let node = reference.identifier; + let parent = node.parent; + + while (parent && (!stopNodePattern.test(parent.type) || + parent.type === "ForInStatement" || parent.type === "ForOfStatement")) { + switch (parent.type) { + + // e.g. foo.a = 0; + case "AssignmentExpression": + return parent.left === node; + + // e.g. ++foo.a; + case "UpdateExpression": + return true; + + // e.g. delete foo.a; + case "UnaryExpression": + if (parent.operator === "delete") { + return true; + } + break; + + // e.g. for (foo.a in b) {} + case "ForInStatement": + case "ForOfStatement": + if (parent.left === node) { + return true; + } + + // this is a stop node for parent.right and parent.body + return false; + + // EXCLUDES: e.g. cache.get(foo.a).b = 0; + case "CallExpression": + if (parent.callee !== node) { + return false; + } + break; + + // EXCLUDES: e.g. cache[foo.a] = 0; + case "MemberExpression": + if (parent.property === node) { + return false; + } + break; + + // EXCLUDES: e.g. ({ [foo]: a }) = bar; + case "Property": + if (parent.key === node) { + return false; + } + + break; + + // EXCLUDES: e.g. (foo ? a : b).c = bar; + case "ConditionalExpression": + if (parent.test === node) { + return false; + } + + break; + + // no default + } + + node = parent; + parent = node.parent; + } + + return false; + } + + /** + * Tests that an identifier name matches any of the ignored property assignments. + * First we test strings in ignoredPropertyAssignmentsFor. + * Then we instantiate and test RegExp objects from ignoredPropertyAssignmentsForRegex strings. + * @param {string} identifierName A string that describes the name of an identifier to + * ignore property assignments for. + * @returns {boolean} Whether the string matches an ignored property assignment regular expression or not. + */ + function isIgnoredPropertyAssignment(identifierName) { + return ignoredPropertyAssignmentsFor.includes(identifierName) || + ignoredPropertyAssignmentsForRegex.some(ignored => new RegExp(ignored, "u").test(identifierName)); + } + + /** + * Reports a reference if is non initializer and writable. + * @param {Reference} reference A reference to check. + * @param {int} index The index of the reference in the references. + * @param {Reference[]} references The array that the reference belongs to. + * @returns {void} + */ + function checkReference(reference, index, references) { + const identifier = reference.identifier; + + if (identifier && + !reference.init && + + /* + * Destructuring assignments can have multiple default value, + * so possibly there are multiple writeable references for the same identifier. + */ + (index === 0 || references[index - 1].identifier !== identifier) + ) { + if (reference.isWrite()) { + context.report({ + node: identifier, + messageId: "assignmentToFunctionParam", + data: { name: identifier.name } + }); + } else if (props && isModifyingProp(reference) && !isIgnoredPropertyAssignment(identifier.name)) { + context.report({ + node: identifier, + messageId: "assignmentToFunctionParamProp", + data: { name: identifier.name } + }); + } + } + } + + /** + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + if (variable.defs[0].type === "Parameter") { + variable.references.forEach(checkReference); + } + } + + /** + * Checks parameters of a given function node. + * @param {ASTNode} node A function node to check. + * @returns {void} + */ + function checkForFunction(node) { + context.getDeclaredVariables(node).forEach(checkVariable); + } + + return { + + // `:exit` is needed for the `node.parent` property of identifier nodes. + "FunctionDeclaration:exit": checkForFunction, + "FunctionExpression:exit": checkForFunction, + "ArrowFunctionExpression:exit": checkForFunction + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-path-concat.js b/node_modules/eslint/lib/rules/no-path-concat.js new file mode 100644 index 000000000..fc1f894f8 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-path-concat.js @@ -0,0 +1,63 @@ +/** + * @fileoverview Disallow string concatenation when using __dirname and __filename + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "disallow string concatenation with `__dirname` and `__filename`", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/no-path-concat" + }, + + schema: [], + + messages: { + usePathFunctions: "Use path.join() or path.resolve() instead of + to create paths." + } + }, + + create(context) { + + const MATCHER = /^__(?:dir|file)name$/u; + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + BinaryExpression(node) { + + const left = node.left, + right = node.right; + + if (node.operator === "+" && + ((left.type === "Identifier" && MATCHER.test(left.name)) || + (right.type === "Identifier" && MATCHER.test(right.name))) + ) { + + context.report({ + node, + messageId: "usePathFunctions" + }); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-plusplus.js b/node_modules/eslint/lib/rules/no-plusplus.js new file mode 100644 index 000000000..84d6c3e1f --- /dev/null +++ b/node_modules/eslint/lib/rules/no-plusplus.js @@ -0,0 +1,105 @@ +/** + * @fileoverview Rule to flag use of unary increment and decrement operators. + * @author Ian Christian Myers + * @author Brody McKee (github.com/mrmckeb) + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines whether the given node is the update node of a `ForStatement`. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is `ForStatement` update. + */ +function isForStatementUpdate(node) { + const parent = node.parent; + + return parent.type === "ForStatement" && parent.update === node; +} + +/** + * Determines whether the given node is considered to be a for loop "afterthought" by the logic of this rule. + * In particular, it returns `true` if the given node is either: + * - The update node of a `ForStatement`: for (;; i++) {} + * - An operand of a sequence expression that is the update node: for (;; foo(), i++) {} + * - An operand of a sequence expression that is child of another sequence expression, etc., + * up to the sequence expression that is the update node: for (;; foo(), (bar(), (baz(), i++))) {} + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is a for loop afterthought. + */ +function isForLoopAfterthought(node) { + const parent = node.parent; + + if (parent.type === "SequenceExpression") { + return isForLoopAfterthought(parent); + } + + return isForStatementUpdate(node); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the unary operators `++` and `--`", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-plusplus" + }, + + schema: [ + { + type: "object", + properties: { + allowForLoopAfterthoughts: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedUnaryOp: "Unary operator '{{operator}}' used." + } + }, + + create(context) { + + const config = context.options[0]; + let allowForLoopAfterthoughts = false; + + if (typeof config === "object") { + allowForLoopAfterthoughts = config.allowForLoopAfterthoughts === true; + } + + return { + + UpdateExpression(node) { + if (allowForLoopAfterthoughts && isForLoopAfterthought(node)) { + return; + } + + context.report({ + node, + messageId: "unexpectedUnaryOp", + data: { + operator: node.operator + } + }); + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-process-env.js b/node_modules/eslint/lib/rules/no-process-env.js new file mode 100644 index 000000000..49d173490 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-process-env.js @@ -0,0 +1,50 @@ +/** + * @fileoverview Disallow the use of process.env() + * @author Vignesh Anand + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "disallow the use of `process.env`", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/no-process-env" + }, + + schema: [], + + messages: { + unexpectedProcessEnv: "Unexpected use of process.env." + } + }, + + create(context) { + + return { + + MemberExpression(node) { + const objectName = node.object.name, + propertyName = node.property.name; + + if (objectName === "process" && !node.computed && propertyName && propertyName === "env") { + context.report({ node, messageId: "unexpectedProcessEnv" }); + } + + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-process-exit.js b/node_modules/eslint/lib/rules/no-process-exit.js new file mode 100644 index 000000000..77c9cfd7c --- /dev/null +++ b/node_modules/eslint/lib/rules/no-process-exit.js @@ -0,0 +1,46 @@ +/** + * @fileoverview Disallow the use of process.exit() + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "disallow the use of `process.exit()`", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/no-process-exit" + }, + + schema: [], + + messages: { + noProcessExit: "Don't use process.exit(); throw an error instead." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + "CallExpression > MemberExpression.callee[object.name = 'process'][property.name = 'exit']"(node) { + context.report({ node: node.parent, messageId: "noProcessExit" }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-promise-executor-return.js b/node_modules/eslint/lib/rules/no-promise-executor-return.js new file mode 100644 index 000000000..32ee6e151 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-promise-executor-return.js @@ -0,0 +1,121 @@ +/** + * @fileoverview Rule to disallow returning values from Promise executor functions + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { findVariable } = require("eslint-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const functionTypesToCheck = new Set(["ArrowFunctionExpression", "FunctionExpression"]); + +/** + * Determines whether the given identifier node is a reference to a global variable. + * @param {ASTNode} node `Identifier` node to check. + * @param {Scope} scope Scope to which the node belongs. + * @returns {boolean} True if the identifier is a reference to a global variable. + */ +function isGlobalReference(node, scope) { + const variable = findVariable(scope, node); + + return variable !== null && variable.scope.type === "global" && variable.defs.length === 0; +} + +/** + * Finds function's outer scope. + * @param {Scope} scope Function's own scope. + * @returns {Scope} Function's outer scope. + */ +function getOuterScope(scope) { + const upper = scope.upper; + + if (upper.type === "function-expression-name") { + return upper.upper; + } + return upper; +} + +/** + * Determines whether the given function node is used as a Promise executor. + * @param {ASTNode} node The node to check. + * @param {Scope} scope Function's own scope. + * @returns {boolean} `true` if the node is a Promise executor. + */ +function isPromiseExecutor(node, scope) { + const parent = node.parent; + + return parent.type === "NewExpression" && + parent.arguments[0] === node && + parent.callee.type === "Identifier" && + parent.callee.name === "Promise" && + isGlobalReference(parent.callee, getOuterScope(scope)); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow returning values from Promise executor functions", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-promise-executor-return" + }, + + schema: [], + + messages: { + returnsValue: "Return values from promise executor functions cannot be read." + } + }, + + create(context) { + + let funcInfo = null; + + /** + * Reports the given node. + * @param {ASTNode} node Node to report. + * @returns {void} + */ + function report(node) { + context.report({ node, messageId: "returnsValue" }); + } + + return { + + onCodePathStart(_, node) { + funcInfo = { + upper: funcInfo, + shouldCheck: functionTypesToCheck.has(node.type) && isPromiseExecutor(node, context.getScope()) + }; + + if (funcInfo.shouldCheck && node.type === "ArrowFunctionExpression" && node.expression) { + report(node.body); + } + }, + + onCodePathEnd() { + funcInfo = funcInfo.upper; + }, + + ReturnStatement(node) { + if (funcInfo.shouldCheck && node.argument) { + report(node); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-proto.js b/node_modules/eslint/lib/rules/no-proto.js new file mode 100644 index 000000000..82ce02fa4 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-proto.js @@ -0,0 +1,48 @@ +/** + * @fileoverview Rule to flag usage of __proto__ property + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { getStaticPropertyName } = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of the `__proto__` property", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-proto" + }, + + schema: [], + + messages: { + unexpectedProto: "The '__proto__' property is deprecated." + } + }, + + create(context) { + + return { + + MemberExpression(node) { + if (getStaticPropertyName(node) === "__proto__") { + context.report({ node, messageId: "unexpectedProto" }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-prototype-builtins.js b/node_modules/eslint/lib/rules/no-prototype-builtins.js new file mode 100644 index 000000000..ccec86c30 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-prototype-builtins.js @@ -0,0 +1,71 @@ +/** + * @fileoverview Rule to disallow use of Object.prototype builtins on objects + * @author Andrew Levine + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow calling some `Object.prototype` methods directly on objects", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-prototype-builtins" + }, + + schema: [], + + messages: { + prototypeBuildIn: "Do not access Object.prototype method '{{prop}}' from target object." + } + }, + + create(context) { + const DISALLOWED_PROPS = [ + "hasOwnProperty", + "isPrototypeOf", + "propertyIsEnumerable" + ]; + + /** + * Reports if a disallowed property is used in a CallExpression + * @param {ASTNode} node The CallExpression node. + * @returns {void} + */ + function disallowBuiltIns(node) { + + // TODO: just use `astUtils.getStaticPropertyName(node.callee)` + const callee = astUtils.skipChainExpression(node.callee); + + if (callee.type !== "MemberExpression" || callee.computed) { + return; + } + const propName = callee.property.name; + + if (DISALLOWED_PROPS.indexOf(propName) > -1) { + context.report({ + messageId: "prototypeBuildIn", + loc: callee.property.loc, + data: { prop: propName }, + node + }); + } + } + + return { + CallExpression: disallowBuiltIns + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-redeclare.js b/node_modules/eslint/lib/rules/no-redeclare.js new file mode 100644 index 000000000..6ddb21c9e --- /dev/null +++ b/node_modules/eslint/lib/rules/no-redeclare.js @@ -0,0 +1,172 @@ +/** + * @fileoverview Rule to flag when the same variable is declared more then once. + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow variable redeclaration", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-redeclare" + }, + + messages: { + redeclared: "'{{id}}' is already defined.", + redeclaredAsBuiltin: "'{{id}}' is already defined as a built-in global variable.", + redeclaredBySyntax: "'{{id}}' is already defined by a variable declaration." + }, + + schema: [ + { + type: "object", + properties: { + builtinGlobals: { type: "boolean", default: true } + }, + additionalProperties: false + } + ] + }, + + create(context) { + const options = { + builtinGlobals: Boolean( + context.options.length === 0 || + context.options[0].builtinGlobals + ) + }; + const sourceCode = context.getSourceCode(); + + /** + * Iterate declarations of a given variable. + * @param {escope.variable} variable The variable object to iterate declarations. + * @returns {IterableIterator<{type:string,node:ASTNode,loc:SourceLocation}>} The declarations. + */ + function *iterateDeclarations(variable) { + if (options.builtinGlobals && ( + variable.eslintImplicitGlobalSetting === "readonly" || + variable.eslintImplicitGlobalSetting === "writable" + )) { + yield { type: "builtin" }; + } + + for (const id of variable.identifiers) { + yield { type: "syntax", node: id, loc: id.loc }; + } + + if (variable.eslintExplicitGlobalComments) { + for (const comment of variable.eslintExplicitGlobalComments) { + yield { + type: "comment", + node: comment, + loc: astUtils.getNameLocationInGlobalDirectiveComment( + sourceCode, + comment, + variable.name + ) + }; + } + } + } + + /** + * Find variables in a given scope and flag redeclared ones. + * @param {Scope} scope An eslint-scope scope object. + * @returns {void} + * @private + */ + function findVariablesInScope(scope) { + for (const variable of scope.variables) { + const [ + declaration, + ...extraDeclarations + ] = iterateDeclarations(variable); + + if (extraDeclarations.length === 0) { + continue; + } + + /* + * If the type of a declaration is different from the type of + * the first declaration, it shows the location of the first + * declaration. + */ + const detailMessageId = declaration.type === "builtin" + ? "redeclaredAsBuiltin" + : "redeclaredBySyntax"; + const data = { id: variable.name }; + + // Report extra declarations. + for (const { type, node, loc } of extraDeclarations) { + const messageId = type === declaration.type + ? "redeclared" + : detailMessageId; + + context.report({ node, loc, messageId, data }); + } + } + } + + /** + * Find variables in the current scope. + * @param {ASTNode} node The node of the current scope. + * @returns {void} + * @private + */ + function checkForBlock(node) { + const scope = context.getScope(); + + /* + * In ES5, some node type such as `BlockStatement` doesn't have that scope. + * `scope.block` is a different node in such a case. + */ + if (scope.block === node) { + findVariablesInScope(scope); + } + } + + return { + Program() { + const scope = context.getScope(); + + findVariablesInScope(scope); + + // Node.js or ES modules has a special scope. + if ( + scope.type === "global" && + scope.childScopes[0] && + + // The special scope's block is the Program node. + scope.block === scope.childScopes[0].block + ) { + findVariablesInScope(scope.childScopes[0]); + } + }, + + FunctionDeclaration: checkForBlock, + FunctionExpression: checkForBlock, + ArrowFunctionExpression: checkForBlock, + + BlockStatement: checkForBlock, + ForStatement: checkForBlock, + ForInStatement: checkForBlock, + ForOfStatement: checkForBlock, + SwitchStatement: checkForBlock + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-regex-spaces.js b/node_modules/eslint/lib/rules/no-regex-spaces.js new file mode 100644 index 000000000..e6d4c9efb --- /dev/null +++ b/node_modules/eslint/lib/rules/no-regex-spaces.js @@ -0,0 +1,180 @@ +/** + * @fileoverview Rule to count multiple spaces in regular expressions + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const regexpp = require("regexpp"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const regExpParser = new regexpp.RegExpParser(); +const DOUBLE_SPACE = / {2}/u; + +/** + * Check if node is a string + * @param {ASTNode} node node to evaluate + * @returns {boolean} True if its a string + * @private + */ +function isString(node) { + return node && node.type === "Literal" && typeof node.value === "string"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow multiple spaces in regular expressions", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-regex-spaces" + }, + + schema: [], + fixable: "code", + + messages: { + multipleSpaces: "Spaces are hard to count. Use {{{length}}}." + } + }, + + create(context) { + + /** + * Validate regular expression + * @param {ASTNode} nodeToReport Node to report. + * @param {string} pattern Regular expression pattern to validate. + * @param {string} rawPattern Raw representation of the pattern in the source code. + * @param {number} rawPatternStartRange Start range of the pattern in the source code. + * @param {string} flags Regular expression flags. + * @returns {void} + * @private + */ + function checkRegex(nodeToReport, pattern, rawPattern, rawPatternStartRange, flags) { + + // Skip if there are no consecutive spaces in the source code, to avoid reporting e.g., RegExp(' \ '). + if (!DOUBLE_SPACE.test(rawPattern)) { + return; + } + + const characterClassNodes = []; + let regExpAST; + + try { + regExpAST = regExpParser.parsePattern(pattern, 0, pattern.length, flags.includes("u")); + } catch { + + // Ignore regular expressions with syntax errors + return; + } + + regexpp.visitRegExpAST(regExpAST, { + onCharacterClassEnter(ccNode) { + characterClassNodes.push(ccNode); + } + }); + + const spacesPattern = /( {2,})(?: [+*{?]|[^+*{?]|$)/gu; + let match; + + while ((match = spacesPattern.exec(pattern))) { + const { 1: { length }, index } = match; + + // Report only consecutive spaces that are not in character classes. + if ( + characterClassNodes.every(({ start, end }) => index < start || end <= index) + ) { + context.report({ + node: nodeToReport, + messageId: "multipleSpaces", + data: { length }, + fix(fixer) { + if (pattern !== rawPattern) { + return null; + } + return fixer.replaceTextRange( + [rawPatternStartRange + index, rawPatternStartRange + index + length], + ` {${length}}` + ); + } + }); + + // Report only the first occurrence of consecutive spaces + return; + } + } + } + + /** + * Validate regular expression literals + * @param {ASTNode} node node to validate + * @returns {void} + * @private + */ + function checkLiteral(node) { + if (node.regex) { + const pattern = node.regex.pattern; + const rawPattern = node.raw.slice(1, node.raw.lastIndexOf("/")); + const rawPatternStartRange = node.range[0] + 1; + const flags = node.regex.flags; + + checkRegex( + node, + pattern, + rawPattern, + rawPatternStartRange, + flags + ); + } + } + + /** + * Validate strings passed to the RegExp constructor + * @param {ASTNode} node node to validate + * @returns {void} + * @private + */ + function checkFunction(node) { + const scope = context.getScope(); + const regExpVar = astUtils.getVariableByName(scope, "RegExp"); + const shadowed = regExpVar && regExpVar.defs.length > 0; + const patternNode = node.arguments[0]; + const flagsNode = node.arguments[1]; + + if (node.callee.type === "Identifier" && node.callee.name === "RegExp" && isString(patternNode) && !shadowed) { + const pattern = patternNode.value; + const rawPattern = patternNode.raw.slice(1, -1); + const rawPatternStartRange = patternNode.range[0] + 1; + const flags = isString(flagsNode) ? flagsNode.value : ""; + + checkRegex( + node, + pattern, + rawPattern, + rawPatternStartRange, + flags + ); + } + } + + return { + Literal: checkLiteral, + CallExpression: checkFunction, + NewExpression: checkFunction + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-restricted-exports.js b/node_modules/eslint/lib/rules/no-restricted-exports.js new file mode 100644 index 000000000..6031e26de --- /dev/null +++ b/node_modules/eslint/lib/rules/no-restricted-exports.js @@ -0,0 +1,90 @@ +/** + * @fileoverview Rule to disallow specified names in exports + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow specified names in exports", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/no-restricted-exports" + }, + + schema: [{ + type: "object", + properties: { + restrictedNamedExports: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + additionalProperties: false + }], + + messages: { + restrictedNamed: "'{{name}}' is restricted from being used as an exported name." + } + }, + + create(context) { + + const restrictedNames = new Set(context.options[0] && context.options[0].restrictedNamedExports); + + /** + * Checks and reports given exported identifier. + * @param {ASTNode} node exported `Identifer` node to check. + * @returns {void} + */ + function checkExportedName(node) { + const name = node.name; + + if (restrictedNames.has(name)) { + context.report({ + node, + messageId: "restrictedNamed", + data: { name } + }); + } + } + + return { + ExportAllDeclaration(node) { + if (node.exported) { + checkExportedName(node.exported); + } + }, + + ExportNamedDeclaration(node) { + const declaration = node.declaration; + + if (declaration) { + if (declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") { + checkExportedName(declaration.id); + } else if (declaration.type === "VariableDeclaration") { + context.getDeclaredVariables(declaration) + .map(v => v.defs.find(d => d.parent === declaration)) + .map(d => d.name) // Identifier nodes + .forEach(checkExportedName); + } + } else { + node.specifiers + .map(s => s.exported) + .forEach(checkExportedName); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-restricted-globals.js b/node_modules/eslint/lib/rules/no-restricted-globals.js new file mode 100644 index 000000000..2c932a730 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-restricted-globals.js @@ -0,0 +1,122 @@ +/** + * @fileoverview Restrict usage of specified globals. + * @author Benoît Zugmeyer + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow specified global variables", + category: "Variables", + recommended: false, + url: "https://eslint.org/docs/rules/no-restricted-globals" + }, + + schema: { + type: "array", + items: { + oneOf: [ + { + type: "string" + }, + { + type: "object", + properties: { + name: { type: "string" }, + message: { type: "string" } + }, + required: ["name"], + additionalProperties: false + } + ] + }, + uniqueItems: true, + minItems: 0 + }, + + messages: { + defaultMessage: "Unexpected use of '{{name}}'.", + // eslint-disable-next-line eslint-plugin/report-message-format + customMessage: "Unexpected use of '{{name}}'. {{customMessage}}" + } + }, + + create(context) { + + // If no globals are restricted, we don't need to do anything + if (context.options.length === 0) { + return {}; + } + + const restrictedGlobalMessages = context.options.reduce((memo, option) => { + if (typeof option === "string") { + memo[option] = null; + } else { + memo[option.name] = option.message; + } + + return memo; + }, {}); + + /** + * Report a variable to be used as a restricted global. + * @param {Reference} reference the variable reference + * @returns {void} + * @private + */ + function reportReference(reference) { + const name = reference.identifier.name, + customMessage = restrictedGlobalMessages[name], + messageId = customMessage + ? "customMessage" + : "defaultMessage"; + + context.report({ + node: reference.identifier, + messageId, + data: { + name, + customMessage + } + }); + } + + /** + * Check if the given name is a restricted global name. + * @param {string} name name of a variable + * @returns {boolean} whether the variable is a restricted global or not + * @private + */ + function isRestricted(name) { + return Object.prototype.hasOwnProperty.call(restrictedGlobalMessages, name); + } + + return { + Program() { + const scope = context.getScope(); + + // Report variables declared elsewhere (ex: variables defined as "global" by eslint) + scope.variables.forEach(variable => { + if (!variable.defs.length && isRestricted(variable.name)) { + variable.references.forEach(reportReference); + } + }); + + // Report variables not declared at all + scope.through.forEach(reference => { + if (isRestricted(reference.identifier.name)) { + reportReference(reference); + } + }); + + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-restricted-imports.js b/node_modules/eslint/lib/rules/no-restricted-imports.js new file mode 100644 index 000000000..c205dad8b --- /dev/null +++ b/node_modules/eslint/lib/rules/no-restricted-imports.js @@ -0,0 +1,268 @@ +/** + * @fileoverview Restrict usage of specified node imports. + * @author Guy Ellis + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const ignore = require("ignore"); + +const arrayOfStrings = { + type: "array", + items: { type: "string" }, + uniqueItems: true +}; + +const arrayOfStringsOrObjects = { + type: "array", + items: { + anyOf: [ + { type: "string" }, + { + type: "object", + properties: { + name: { type: "string" }, + message: { + type: "string", + minLength: 1 + }, + importNames: { + type: "array", + items: { + type: "string" + } + } + }, + additionalProperties: false, + required: ["name"] + } + ] + }, + uniqueItems: true +}; + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow specified modules when loaded by `import`", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/no-restricted-imports" + }, + + messages: { + path: "'{{importSource}}' import is restricted from being used.", + // eslint-disable-next-line eslint-plugin/report-message-format + pathWithCustomMessage: "'{{importSource}}' import is restricted from being used. {{customMessage}}", + + patterns: "'{{importSource}}' import is restricted from being used by a pattern.", + + everything: "* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted.", + // eslint-disable-next-line eslint-plugin/report-message-format + everythingWithCustomMessage: "* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted. {{customMessage}}", + + importName: "'{{importName}}' import from '{{importSource}}' is restricted.", + // eslint-disable-next-line eslint-plugin/report-message-format + importNameWithCustomMessage: "'{{importName}}' import from '{{importSource}}' is restricted. {{customMessage}}" + }, + + schema: { + anyOf: [ + arrayOfStringsOrObjects, + { + type: "array", + items: [{ + type: "object", + properties: { + paths: arrayOfStringsOrObjects, + patterns: arrayOfStrings + }, + additionalProperties: false + }], + additionalItems: false + } + ] + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const options = Array.isArray(context.options) ? context.options : []; + const isPathAndPatternsObject = + typeof options[0] === "object" && + (Object.prototype.hasOwnProperty.call(options[0], "paths") || Object.prototype.hasOwnProperty.call(options[0], "patterns")); + + const restrictedPaths = (isPathAndPatternsObject ? options[0].paths : context.options) || []; + const restrictedPatterns = (isPathAndPatternsObject ? options[0].patterns : []) || []; + + // if no imports are restricted we don"t need to check + if (Object.keys(restrictedPaths).length === 0 && restrictedPatterns.length === 0) { + return {}; + } + + const restrictedPathMessages = restrictedPaths.reduce((memo, importSource) => { + if (typeof importSource === "string") { + memo[importSource] = { message: null }; + } else { + memo[importSource.name] = { + message: importSource.message, + importNames: importSource.importNames + }; + } + return memo; + }, {}); + + const restrictedPatternsMatcher = ignore().add(restrictedPatterns); + + /** + * Report a restricted path. + * @param {string} importSource path of the import + * @param {Map} importNames Map of import names that are being imported + * @param {node} node representing the restricted path reference + * @returns {void} + * @private + */ + function checkRestrictedPathAndReport(importSource, importNames, node) { + if (!Object.prototype.hasOwnProperty.call(restrictedPathMessages, importSource)) { + return; + } + + const customMessage = restrictedPathMessages[importSource].message; + const restrictedImportNames = restrictedPathMessages[importSource].importNames; + + if (restrictedImportNames) { + if (importNames.has("*")) { + const specifierData = importNames.get("*")[0]; + + context.report({ + node, + messageId: customMessage ? "everythingWithCustomMessage" : "everything", + loc: specifierData.loc, + data: { + importSource, + importNames: restrictedImportNames, + customMessage + } + }); + } + + restrictedImportNames.forEach(importName => { + if (importNames.has(importName)) { + const specifiers = importNames.get(importName); + + specifiers.forEach(specifier => { + context.report({ + node, + messageId: customMessage ? "importNameWithCustomMessage" : "importName", + loc: specifier.loc, + data: { + importSource, + customMessage, + importName + } + }); + }); + } + }); + } else { + context.report({ + node, + messageId: customMessage ? "pathWithCustomMessage" : "path", + data: { + importSource, + customMessage + } + }); + } + } + + /** + * Report a restricted path specifically for patterns. + * @param {node} node representing the restricted path reference + * @returns {void} + * @private + */ + function reportPathForPatterns(node) { + const importSource = node.source.value.trim(); + + context.report({ + node, + messageId: "patterns", + data: { + importSource + } + }); + } + + /** + * Check if the given importSource is restricted by a pattern. + * @param {string} importSource path of the import + * @returns {boolean} whether the variable is a restricted pattern or not + * @private + */ + function isRestrictedPattern(importSource) { + return restrictedPatterns.length > 0 && restrictedPatternsMatcher.ignores(importSource); + } + + /** + * Checks a node to see if any problems should be reported. + * @param {ASTNode} node The node to check. + * @returns {void} + * @private + */ + function checkNode(node) { + const importSource = node.source.value.trim(); + const importNames = new Map(); + + if (node.type === "ExportAllDeclaration") { + const starToken = sourceCode.getFirstToken(node, 1); + + importNames.set("*", [{ loc: starToken.loc }]); + } else if (node.specifiers) { + for (const specifier of node.specifiers) { + let name; + const specifierData = { loc: specifier.loc }; + + if (specifier.type === "ImportDefaultSpecifier") { + name = "default"; + } else if (specifier.type === "ImportNamespaceSpecifier") { + name = "*"; + } else if (specifier.imported) { + name = specifier.imported.name; + } else if (specifier.local) { + name = specifier.local.name; + } + + if (name) { + if (importNames.has(name)) { + importNames.get(name).push(specifierData); + } else { + importNames.set(name, [specifierData]); + } + } + } + } + + checkRestrictedPathAndReport(importSource, importNames, node); + + if (isRestrictedPattern(importSource)) { + reportPathForPatterns(node); + } + } + + return { + ImportDeclaration: checkNode, + ExportNamedDeclaration(node) { + if (node.source) { + checkNode(node); + } + }, + ExportAllDeclaration: checkNode + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-restricted-modules.js b/node_modules/eslint/lib/rules/no-restricted-modules.js new file mode 100644 index 000000000..d0b8a78a5 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-restricted-modules.js @@ -0,0 +1,214 @@ +/** + * @fileoverview Restrict usage of specified node modules. + * @author Christian Schulz + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const ignore = require("ignore"); + +const arrayOfStrings = { + type: "array", + items: { type: "string" }, + uniqueItems: true +}; + +const arrayOfStringsOrObjects = { + type: "array", + items: { + anyOf: [ + { type: "string" }, + { + type: "object", + properties: { + name: { type: "string" }, + message: { + type: "string", + minLength: 1 + } + }, + additionalProperties: false, + required: ["name"] + } + ] + }, + uniqueItems: true +}; + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "disallow specified modules when loaded by `require`", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/no-restricted-modules" + }, + + schema: { + anyOf: [ + arrayOfStringsOrObjects, + { + type: "array", + items: { + type: "object", + properties: { + paths: arrayOfStringsOrObjects, + patterns: arrayOfStrings + }, + additionalProperties: false + }, + additionalItems: false + } + ] + }, + + messages: { + defaultMessage: "'{{name}}' module is restricted from being used.", + // eslint-disable-next-line eslint-plugin/report-message-format + customMessage: "'{{name}}' module is restricted from being used. {{customMessage}}", + patternMessage: "'{{name}}' module is restricted from being used by a pattern." + } + }, + + create(context) { + const options = Array.isArray(context.options) ? context.options : []; + const isPathAndPatternsObject = + typeof options[0] === "object" && + (Object.prototype.hasOwnProperty.call(options[0], "paths") || Object.prototype.hasOwnProperty.call(options[0], "patterns")); + + const restrictedPaths = (isPathAndPatternsObject ? options[0].paths : context.options) || []; + const restrictedPatterns = (isPathAndPatternsObject ? options[0].patterns : []) || []; + + const restrictedPathMessages = restrictedPaths.reduce((memo, importName) => { + if (typeof importName === "string") { + memo[importName] = null; + } else { + memo[importName.name] = importName.message; + } + return memo; + }, {}); + + // if no imports are restricted we don"t need to check + if (Object.keys(restrictedPaths).length === 0 && restrictedPatterns.length === 0) { + return {}; + } + + const ig = ignore().add(restrictedPatterns); + + + /** + * Function to check if a node is a string literal. + * @param {ASTNode} node The node to check. + * @returns {boolean} If the node is a string literal. + */ + function isStringLiteral(node) { + return node && node.type === "Literal" && typeof node.value === "string"; + } + + /** + * Function to check if a node is a static string template literal. + * @param {ASTNode} node The node to check. + * @returns {boolean} If the node is a string template literal. + */ + function isStaticTemplateLiteral(node) { + return node && node.type === "TemplateLiteral" && node.expressions.length === 0; + } + + /** + * Function to check if a node is a require call. + * @param {ASTNode} node The node to check. + * @returns {boolean} If the node is a require call. + */ + function isRequireCall(node) { + return node.callee.type === "Identifier" && node.callee.name === "require"; + } + + /** + * Extract string from Literal or TemplateLiteral node + * @param {ASTNode} node The node to extract from + * @returns {string|null} Extracted string or null if node doesn't represent a string + */ + function getFirstArgumentString(node) { + if (isStringLiteral(node)) { + return node.value.trim(); + } + + if (isStaticTemplateLiteral(node)) { + return node.quasis[0].value.cooked.trim(); + } + + return null; + } + + /** + * Report a restricted path. + * @param {node} node representing the restricted path reference + * @param {string} name restricted path + * @returns {void} + * @private + */ + function reportPath(node, name) { + const customMessage = restrictedPathMessages[name]; + const messageId = customMessage + ? "customMessage" + : "defaultMessage"; + + context.report({ + node, + messageId, + data: { + name, + customMessage + } + }); + } + + /** + * Check if the given name is a restricted path name + * @param {string} name name of a variable + * @returns {boolean} whether the variable is a restricted path or not + * @private + */ + function isRestrictedPath(name) { + return Object.prototype.hasOwnProperty.call(restrictedPathMessages, name); + } + + return { + CallExpression(node) { + if (isRequireCall(node)) { + + // node has arguments + if (node.arguments.length) { + const name = getFirstArgumentString(node.arguments[0]); + + // if first argument is a string literal or a static string template literal + if (name) { + + // check if argument value is in restricted modules array + if (isRestrictedPath(name)) { + reportPath(node, name); + } + + if (restrictedPatterns.length > 0 && ig.ignores(name)) { + context.report({ + node, + messageId: "patternMessage", + data: { name } + }); + } + } + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-restricted-properties.js b/node_modules/eslint/lib/rules/no-restricted-properties.js new file mode 100644 index 000000000..7ab83995a --- /dev/null +++ b/node_modules/eslint/lib/rules/no-restricted-properties.js @@ -0,0 +1,181 @@ +/** + * @fileoverview Rule to disallow certain object properties + * @author Will Klein & Eli White + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow certain properties on certain objects", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-restricted-properties" + }, + + schema: { + type: "array", + items: { + anyOf: [ // `object` and `property` are both optional, but at least one of them must be provided. + { + type: "object", + properties: { + object: { + type: "string" + }, + property: { + type: "string" + }, + message: { + type: "string" + } + }, + additionalProperties: false, + required: ["object"] + }, + { + type: "object", + properties: { + object: { + type: "string" + }, + property: { + type: "string" + }, + message: { + type: "string" + } + }, + additionalProperties: false, + required: ["property"] + } + ] + }, + uniqueItems: true + }, + + messages: { + // eslint-disable-next-line eslint-plugin/report-message-format + restrictedObjectProperty: "'{{objectName}}.{{propertyName}}' is restricted from being used.{{message}}", + // eslint-disable-next-line eslint-plugin/report-message-format + restrictedProperty: "'{{propertyName}}' is restricted from being used.{{message}}" + } + }, + + create(context) { + const restrictedCalls = context.options; + + if (restrictedCalls.length === 0) { + return {}; + } + + const restrictedProperties = new Map(); + const globallyRestrictedObjects = new Map(); + const globallyRestrictedProperties = new Map(); + + restrictedCalls.forEach(option => { + const objectName = option.object; + const propertyName = option.property; + + if (typeof objectName === "undefined") { + globallyRestrictedProperties.set(propertyName, { message: option.message }); + } else if (typeof propertyName === "undefined") { + globallyRestrictedObjects.set(objectName, { message: option.message }); + } else { + if (!restrictedProperties.has(objectName)) { + restrictedProperties.set(objectName, new Map()); + } + + restrictedProperties.get(objectName).set(propertyName, { + message: option.message + }); + } + }); + + /** + * Checks to see whether a property access is restricted, and reports it if so. + * @param {ASTNode} node The node to report + * @param {string} objectName The name of the object + * @param {string} propertyName The name of the property + * @returns {undefined} + */ + function checkPropertyAccess(node, objectName, propertyName) { + if (propertyName === null) { + return; + } + const matchedObject = restrictedProperties.get(objectName); + const matchedObjectProperty = matchedObject ? matchedObject.get(propertyName) : globallyRestrictedObjects.get(objectName); + const globalMatchedProperty = globallyRestrictedProperties.get(propertyName); + + if (matchedObjectProperty) { + const message = matchedObjectProperty.message ? ` ${matchedObjectProperty.message}` : ""; + + context.report({ + node, + messageId: "restrictedObjectProperty", + data: { + objectName, + propertyName, + message + } + }); + } else if (globalMatchedProperty) { + const message = globalMatchedProperty.message ? ` ${globalMatchedProperty.message}` : ""; + + context.report({ + node, + messageId: "restrictedProperty", + data: { + propertyName, + message + } + }); + } + } + + /** + * Checks property accesses in a destructuring assignment expression, e.g. `var foo; ({foo} = bar);` + * @param {ASTNode} node An AssignmentExpression or AssignmentPattern node + * @returns {undefined} + */ + function checkDestructuringAssignment(node) { + if (node.right.type === "Identifier") { + const objectName = node.right.name; + + if (node.left.type === "ObjectPattern") { + node.left.properties.forEach(property => { + checkPropertyAccess(node.left, objectName, astUtils.getStaticPropertyName(property)); + }); + } + } + } + + return { + MemberExpression(node) { + checkPropertyAccess(node, node.object && node.object.name, astUtils.getStaticPropertyName(node)); + }, + VariableDeclarator(node) { + if (node.init && node.init.type === "Identifier") { + const objectName = node.init.name; + + if (node.id.type === "ObjectPattern") { + node.id.properties.forEach(property => { + checkPropertyAccess(node.id, objectName, astUtils.getStaticPropertyName(property)); + }); + } + } + }, + AssignmentExpression: checkDestructuringAssignment, + AssignmentPattern: checkDestructuringAssignment + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-restricted-syntax.js b/node_modules/eslint/lib/rules/no-restricted-syntax.js new file mode 100644 index 000000000..9572603a8 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-restricted-syntax.js @@ -0,0 +1,70 @@ +/** + * @fileoverview Rule to flag use of certain node types + * @author Burak Yigit Kaya + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow specified syntax", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-restricted-syntax" + }, + + schema: { + type: "array", + items: { + oneOf: [ + { + type: "string" + }, + { + type: "object", + properties: { + selector: { type: "string" }, + message: { type: "string" } + }, + required: ["selector"], + additionalProperties: false + } + ] + }, + uniqueItems: true, + minItems: 0 + }, + + messages: { + // eslint-disable-next-line eslint-plugin/report-message-format + restrictedSyntax: "{{message}}" + } + }, + + create(context) { + return context.options.reduce((result, selectorOrObject) => { + const isStringFormat = (typeof selectorOrObject === "string"); + const hasCustomMessage = !isStringFormat && Boolean(selectorOrObject.message); + + const selector = isStringFormat ? selectorOrObject : selectorOrObject.selector; + const message = hasCustomMessage ? selectorOrObject.message : `Using '${selector}' is not allowed.`; + + return Object.assign(result, { + [selector](node) { + context.report({ + node, + messageId: "restrictedSyntax", + data: { message } + }); + } + }); + }, {}); + + } +}; diff --git a/node_modules/eslint/lib/rules/no-return-assign.js b/node_modules/eslint/lib/rules/no-return-assign.js new file mode 100644 index 000000000..4b57d42eb --- /dev/null +++ b/node_modules/eslint/lib/rules/no-return-assign.js @@ -0,0 +1,80 @@ +/** + * @fileoverview Rule to flag when return statement contains assignment + * @author Ilya Volodin + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SENTINEL_TYPE = /^(?:[a-zA-Z]+?Statement|ArrowFunctionExpression|FunctionExpression|ClassExpression)$/u; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow assignment operators in `return` statements", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-return-assign" + }, + + schema: [ + { + enum: ["except-parens", "always"] + } + ], + + messages: { + returnAssignment: "Return statement should not contain assignment.", + arrowAssignment: "Arrow function should not return assignment." + } + }, + + create(context) { + const always = (context.options[0] || "except-parens") !== "except-parens"; + const sourceCode = context.getSourceCode(); + + return { + AssignmentExpression(node) { + if (!always && astUtils.isParenthesised(sourceCode, node)) { + return; + } + + let currentChild = node; + let parent = currentChild.parent; + + // Find ReturnStatement or ArrowFunctionExpression in ancestors. + while (parent && !SENTINEL_TYPE.test(parent.type)) { + currentChild = parent; + parent = parent.parent; + } + + // Reports. + if (parent && parent.type === "ReturnStatement") { + context.report({ + node: parent, + messageId: "returnAssignment" + }); + } else if (parent && parent.type === "ArrowFunctionExpression" && parent.body === currentChild) { + context.report({ + node: parent, + messageId: "arrowAssignment" + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-return-await.js b/node_modules/eslint/lib/rules/no-return-await.js new file mode 100644 index 000000000..d1d898268 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-return-await.js @@ -0,0 +1,103 @@ +/** + * @fileoverview Disallows unnecessary `return await` + * @author Jordan Harband + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary `return await`", + category: "Best Practices", + + recommended: false, + + url: "https://eslint.org/docs/rules/no-return-await" + }, + + fixable: null, + + schema: [ + ], + + messages: { + redundantUseOfAwait: "Redundant use of `await` on a return value." + } + }, + + create(context) { + + /** + * Reports a found unnecessary `await` expression. + * @param {ASTNode} node The node representing the `await` expression to report + * @returns {void} + */ + function reportUnnecessaryAwait(node) { + context.report({ + node: context.getSourceCode().getFirstToken(node), + loc: node.loc, + messageId: "redundantUseOfAwait" + }); + } + + /** + * Determines whether a thrown error from this node will be caught/handled within this function rather than immediately halting + * this function. For example, a statement in a `try` block will always have an error handler. A statement in + * a `catch` block will only have an error handler if there is also a `finally` block. + * @param {ASTNode} node A node representing a location where an could be thrown + * @returns {boolean} `true` if a thrown error will be caught/handled in this function + */ + function hasErrorHandler(node) { + let ancestor = node; + + while (!astUtils.isFunction(ancestor) && ancestor.type !== "Program") { + if (ancestor.parent.type === "TryStatement" && (ancestor === ancestor.parent.block || ancestor === ancestor.parent.handler && ancestor.parent.finalizer)) { + return true; + } + ancestor = ancestor.parent; + } + return false; + } + + /** + * Checks if a node is placed in tail call position. Once `return` arguments (or arrow function expressions) can be a complex expression, + * an `await` expression could or could not be unnecessary by the definition of this rule. So we're looking for `await` expressions that are in tail position. + * @param {ASTNode} node A node representing the `await` expression to check + * @returns {boolean} The checking result + */ + function isInTailCallPosition(node) { + if (node.parent.type === "ArrowFunctionExpression") { + return true; + } + if (node.parent.type === "ReturnStatement") { + return !hasErrorHandler(node.parent); + } + if (node.parent.type === "ConditionalExpression" && (node === node.parent.consequent || node === node.parent.alternate)) { + return isInTailCallPosition(node.parent); + } + if (node.parent.type === "LogicalExpression" && node === node.parent.right) { + return isInTailCallPosition(node.parent); + } + if (node.parent.type === "SequenceExpression" && node === node.parent.expressions[node.parent.expressions.length - 1]) { + return isInTailCallPosition(node.parent); + } + return false; + } + + return { + AwaitExpression(node) { + if (isInTailCallPosition(node) && !hasErrorHandler(node)) { + reportUnnecessaryAwait(node); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-script-url.js b/node_modules/eslint/lib/rules/no-script-url.js new file mode 100644 index 000000000..2078fc1dc --- /dev/null +++ b/node_modules/eslint/lib/rules/no-script-url.js @@ -0,0 +1,48 @@ +/** + * @fileoverview Rule to flag when using javascript: urls + * @author Ilya Volodin + */ +/* jshint scripturl: true */ +/* eslint no-script-url: 0 */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `javascript:` urls", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-script-url" + }, + + schema: [], + + messages: { + unexpectedScriptURL: "Script URL is a form of eval." + } + }, + + create(context) { + + return { + + Literal(node) { + if (node.value && typeof node.value === "string") { + const value = node.value.toLowerCase(); + + if (value.indexOf("javascript:") === 0) { + context.report({ node, messageId: "unexpectedScriptURL" }); + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-self-assign.js b/node_modules/eslint/lib/rules/no-self-assign.js new file mode 100644 index 000000000..705be324c --- /dev/null +++ b/node_modules/eslint/lib/rules/no-self-assign.js @@ -0,0 +1,183 @@ +/** + * @fileoverview Rule to disallow assignments where both sides are exactly the same + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SPACES = /\s+/gu; + +/** + * Traverses 2 Pattern nodes in parallel, then reports self-assignments. + * @param {ASTNode|null} left A left node to traverse. This is a Pattern or + * a Property. + * @param {ASTNode|null} right A right node to traverse. This is a Pattern or + * a Property. + * @param {boolean} props The flag to check member expressions as well. + * @param {Function} report A callback function to report. + * @returns {void} + */ +function eachSelfAssignment(left, right, props, report) { + if (!left || !right) { + + // do nothing + } else if ( + left.type === "Identifier" && + right.type === "Identifier" && + left.name === right.name + ) { + report(right); + } else if ( + left.type === "ArrayPattern" && + right.type === "ArrayExpression" + ) { + const end = Math.min(left.elements.length, right.elements.length); + + for (let i = 0; i < end; ++i) { + const leftElement = left.elements[i]; + const rightElement = right.elements[i]; + + // Avoid cases such as [...a] = [...a, 1] + if ( + leftElement && + leftElement.type === "RestElement" && + i < right.elements.length - 1 + ) { + break; + } + + eachSelfAssignment(leftElement, rightElement, props, report); + + // After a spread element, those indices are unknown. + if (rightElement && rightElement.type === "SpreadElement") { + break; + } + } + } else if ( + left.type === "RestElement" && + right.type === "SpreadElement" + ) { + eachSelfAssignment(left.argument, right.argument, props, report); + } else if ( + left.type === "ObjectPattern" && + right.type === "ObjectExpression" && + right.properties.length >= 1 + ) { + + /* + * Gets the index of the last spread property. + * It's possible to overwrite properties followed by it. + */ + let startJ = 0; + + for (let i = right.properties.length - 1; i >= 0; --i) { + const propType = right.properties[i].type; + + if (propType === "SpreadElement" || propType === "ExperimentalSpreadProperty") { + startJ = i + 1; + break; + } + } + + for (let i = 0; i < left.properties.length; ++i) { + for (let j = startJ; j < right.properties.length; ++j) { + eachSelfAssignment( + left.properties[i], + right.properties[j], + props, + report + ); + } + } + } else if ( + left.type === "Property" && + right.type === "Property" && + right.kind === "init" && + !right.method + ) { + const leftName = astUtils.getStaticPropertyName(left); + + if (leftName !== null && leftName === astUtils.getStaticPropertyName(right)) { + eachSelfAssignment(left.value, right.value, props, report); + } + } else if ( + props && + astUtils.skipChainExpression(left).type === "MemberExpression" && + astUtils.skipChainExpression(right).type === "MemberExpression" && + astUtils.isSameReference(left, right) + ) { + report(right); + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow assignments where both sides are exactly the same", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-self-assign" + }, + + schema: [ + { + type: "object", + properties: { + props: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + selfAssignment: "'{{name}}' is assigned to itself." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const [{ props = true } = {}] = context.options; + + /** + * Reports a given node as self assignments. + * @param {ASTNode} node A node to report. This is an Identifier node. + * @returns {void} + */ + function report(node) { + context.report({ + node, + messageId: "selfAssignment", + data: { + name: sourceCode.getText(node).replace(SPACES, "") + } + }); + } + + return { + AssignmentExpression(node) { + if (node.operator === "=") { + eachSelfAssignment(node.left, node.right, props, report); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-self-compare.js b/node_modules/eslint/lib/rules/no-self-compare.js new file mode 100644 index 000000000..79b6ac7ea --- /dev/null +++ b/node_modules/eslint/lib/rules/no-self-compare.js @@ -0,0 +1,60 @@ +/** + * @fileoverview Rule to flag comparison where left part is the same as the right + * part. + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow comparisons where both sides are exactly the same", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-self-compare" + }, + + schema: [], + + messages: { + comparingToSelf: "Comparing to itself is potentially pointless." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Determines whether two nodes are composed of the same tokens. + * @param {ASTNode} nodeA The first node + * @param {ASTNode} nodeB The second node + * @returns {boolean} true if the nodes have identical token representations + */ + function hasSameTokens(nodeA, nodeB) { + const tokensA = sourceCode.getTokens(nodeA); + const tokensB = sourceCode.getTokens(nodeB); + + return tokensA.length === tokensB.length && + tokensA.every((token, index) => token.type === tokensB[index].type && token.value === tokensB[index].value); + } + + return { + + BinaryExpression(node) { + const operators = new Set(["===", "==", "!==", "!=", ">", "<", ">=", "<="]); + + if (operators.has(node.operator) && hasSameTokens(node.left, node.right)) { + context.report({ node, messageId: "comparingToSelf" }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-sequences.js b/node_modules/eslint/lib/rules/no-sequences.js new file mode 100644 index 000000000..d67635d11 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-sequences.js @@ -0,0 +1,119 @@ +/** + * @fileoverview Rule to flag use of comma operator + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow comma operators", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-sequences" + }, + + schema: [], + + messages: { + unexpectedCommaExpression: "Unexpected use of comma operator." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Parts of the grammar that are required to have parens. + */ + const parenthesized = { + DoWhileStatement: "test", + IfStatement: "test", + SwitchStatement: "discriminant", + WhileStatement: "test", + WithStatement: "object", + ArrowFunctionExpression: "body" + + /* + * Omitting CallExpression - commas are parsed as argument separators + * Omitting NewExpression - commas are parsed as argument separators + * Omitting ForInStatement - parts aren't individually parenthesised + * Omitting ForStatement - parts aren't individually parenthesised + */ + }; + + /** + * Determines whether a node is required by the grammar to be wrapped in + * parens, e.g. the test of an if statement. + * @param {ASTNode} node The AST node + * @returns {boolean} True if parens around node belong to parent node. + */ + function requiresExtraParens(node) { + return node.parent && parenthesized[node.parent.type] && + node === node.parent[parenthesized[node.parent.type]]; + } + + /** + * Check if a node is wrapped in parens. + * @param {ASTNode} node The AST node + * @returns {boolean} True if the node has a paren on each side. + */ + function isParenthesised(node) { + return astUtils.isParenthesised(sourceCode, node); + } + + /** + * Check if a node is wrapped in two levels of parens. + * @param {ASTNode} node The AST node + * @returns {boolean} True if two parens surround the node on each side. + */ + function isParenthesisedTwice(node) { + const previousToken = sourceCode.getTokenBefore(node, 1), + nextToken = sourceCode.getTokenAfter(node, 1); + + return isParenthesised(node) && previousToken && nextToken && + astUtils.isOpeningParenToken(previousToken) && previousToken.range[1] <= node.range[0] && + astUtils.isClosingParenToken(nextToken) && nextToken.range[0] >= node.range[1]; + } + + return { + SequenceExpression(node) { + + // Always allow sequences in for statement update + if (node.parent.type === "ForStatement" && + (node === node.parent.init || node === node.parent.update)) { + return; + } + + // Wrapping a sequence in extra parens indicates intent + if (requiresExtraParens(node)) { + if (isParenthesisedTwice(node)) { + return; + } + } else { + if (isParenthesised(node)) { + return; + } + } + + const firstCommaToken = sourceCode.getTokenAfter(node.expressions[0], astUtils.isCommaToken); + + context.report({ node, loc: firstCommaToken.loc, messageId: "unexpectedCommaExpression" }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-setter-return.js b/node_modules/eslint/lib/rules/no-setter-return.js new file mode 100644 index 000000000..9c79240dd --- /dev/null +++ b/node_modules/eslint/lib/rules/no-setter-return.js @@ -0,0 +1,224 @@ +/** + * @fileoverview Rule to disallow returning values from setters + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const { findVariable } = require("eslint-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines whether the given identifier node is a reference to a global variable. + * @param {ASTNode} node `Identifier` node to check. + * @param {Scope} scope Scope to which the node belongs. + * @returns {boolean} True if the identifier is a reference to a global variable. + */ +function isGlobalReference(node, scope) { + const variable = findVariable(scope, node); + + return variable !== null && variable.scope.type === "global" && variable.defs.length === 0; +} + +/** + * Determines whether the given node is an argument of the specified global method call, at the given `index` position. + * E.g., for given `index === 1`, this function checks for `objectName.methodName(foo, node)`, where objectName is a global variable. + * @param {ASTNode} node The node to check. + * @param {Scope} scope Scope to which the node belongs. + * @param {string} objectName Name of the global object. + * @param {string} methodName Name of the method. + * @param {number} index The given position. + * @returns {boolean} `true` if the node is argument at the given position. + */ +function isArgumentOfGlobalMethodCall(node, scope, objectName, methodName, index) { + const callNode = node.parent; + + return callNode.type === "CallExpression" && + callNode.arguments[index] === node && + astUtils.isSpecificMemberAccess(callNode.callee, objectName, methodName) && + isGlobalReference(astUtils.skipChainExpression(callNode.callee).object, scope); +} + +/** + * Determines whether the given node is used as a property descriptor. + * @param {ASTNode} node The node to check. + * @param {Scope} scope Scope to which the node belongs. + * @returns {boolean} `true` if the node is a property descriptor. + */ +function isPropertyDescriptor(node, scope) { + if ( + isArgumentOfGlobalMethodCall(node, scope, "Object", "defineProperty", 2) || + isArgumentOfGlobalMethodCall(node, scope, "Reflect", "defineProperty", 2) + ) { + return true; + } + + const parent = node.parent; + + if ( + parent.type === "Property" && + parent.value === node + ) { + const grandparent = parent.parent; + + if ( + grandparent.type === "ObjectExpression" && + ( + isArgumentOfGlobalMethodCall(grandparent, scope, "Object", "create", 1) || + isArgumentOfGlobalMethodCall(grandparent, scope, "Object", "defineProperties", 1) + ) + ) { + return true; + } + } + + return false; +} + +/** + * Determines whether the given function node is used as a setter function. + * @param {ASTNode} node The node to check. + * @param {Scope} scope Scope to which the node belongs. + * @returns {boolean} `true` if the node is a setter. + */ +function isSetter(node, scope) { + const parent = node.parent; + + if ( + parent.kind === "set" && + parent.value === node + ) { + + // Setter in an object literal or in a class + return true; + } + + if ( + parent.type === "Property" && + parent.value === node && + astUtils.getStaticPropertyName(parent) === "set" && + parent.parent.type === "ObjectExpression" && + isPropertyDescriptor(parent.parent, scope) + ) { + + // Setter in a property descriptor + return true; + } + + return false; +} + +/** + * Finds function's outer scope. + * @param {Scope} scope Function's own scope. + * @returns {Scope} Function's outer scope. + */ +function getOuterScope(scope) { + const upper = scope.upper; + + if (upper.type === "function-expression-name") { + return upper.upper; + } + + return upper; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow returning values from setters", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-setter-return" + }, + + schema: [], + + messages: { + returnsValue: "Setter cannot return a value." + } + }, + + create(context) { + let funcInfo = null; + + /** + * Creates and pushes to the stack a function info object for the given function node. + * @param {ASTNode} node The function node. + * @returns {void} + */ + function enterFunction(node) { + const outerScope = getOuterScope(context.getScope()); + + funcInfo = { + upper: funcInfo, + isSetter: isSetter(node, outerScope) + }; + } + + /** + * Pops the current function info object from the stack. + * @returns {void} + */ + function exitFunction() { + funcInfo = funcInfo.upper; + } + + /** + * Reports the given node. + * @param {ASTNode} node Node to report. + * @returns {void} + */ + function report(node) { + context.report({ node, messageId: "returnsValue" }); + } + + return { + + /* + * Function declarations cannot be setters, but we still have to track them in the `funcInfo` stack to avoid + * false positives, because a ReturnStatement node can belong to a function declaration inside a setter. + * + * Note: A previously declared function can be referenced and actually used as a setter in a property descriptor, + * but that's out of scope for this rule. + */ + FunctionDeclaration: enterFunction, + FunctionExpression: enterFunction, + ArrowFunctionExpression(node) { + enterFunction(node); + + if (funcInfo.isSetter && node.expression) { + + // { set: foo => bar } property descriptor. Report implicit return 'bar' as the equivalent for a return statement. + report(node.body); + } + }, + + "FunctionDeclaration:exit": exitFunction, + "FunctionExpression:exit": exitFunction, + "ArrowFunctionExpression:exit": exitFunction, + + ReturnStatement(node) { + + // Global returns (e.g., at the top level of a Node module) don't have `funcInfo`. + if (funcInfo && funcInfo.isSetter && node.argument) { + report(node); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-shadow-restricted-names.js b/node_modules/eslint/lib/rules/no-shadow-restricted-names.js new file mode 100644 index 000000000..9647e9a1b --- /dev/null +++ b/node_modules/eslint/lib/rules/no-shadow-restricted-names.js @@ -0,0 +1,64 @@ +/** + * @fileoverview Disallow shadowing of NaN, undefined, and Infinity (ES5 section 15.1.1) + * @author Michael Ficarra + */ +"use strict"; + +/** + * Determines if a variable safely shadows undefined. + * This is the case when a variable named `undefined` is never assigned to a value (i.e. it always shares the same value + * as the global). + * @param {eslintScope.Variable} variable The variable to check + * @returns {boolean} true if this variable safely shadows `undefined` + */ +function safelyShadowsUndefined(variable) { + return variable.name === "undefined" && + variable.references.every(ref => !ref.isWrite()) && + variable.defs.every(def => def.node.type === "VariableDeclarator" && def.node.init === null); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow identifiers from shadowing restricted names", + category: "Variables", + recommended: true, + url: "https://eslint.org/docs/rules/no-shadow-restricted-names" + }, + + schema: [], + + messages: { + shadowingRestrictedName: "Shadowing of global property '{{name}}'." + } + }, + + create(context) { + + + const RESTRICTED = new Set(["undefined", "NaN", "Infinity", "arguments", "eval"]); + + return { + "VariableDeclaration, :function, CatchClause"(node) { + for (const variable of context.getDeclaredVariables(node)) { + if (variable.defs.length > 0 && RESTRICTED.has(variable.name) && !safelyShadowsUndefined(variable)) { + context.report({ + node: variable.defs[0].name, + messageId: "shadowingRestrictedName", + data: { + name: variable.name + } + }); + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-shadow.js b/node_modules/eslint/lib/rules/no-shadow.js new file mode 100644 index 000000000..1be8590e4 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-shadow.js @@ -0,0 +1,192 @@ +/** + * @fileoverview Rule to flag on declaring variables already declared in the outer scope + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow variable declarations from shadowing variables declared in the outer scope", + category: "Variables", + recommended: false, + url: "https://eslint.org/docs/rules/no-shadow" + }, + + schema: [ + { + type: "object", + properties: { + builtinGlobals: { type: "boolean", default: false }, + hoist: { enum: ["all", "functions", "never"], default: "functions" }, + allow: { + type: "array", + items: { + type: "string" + } + } + }, + additionalProperties: false + } + ], + + messages: { + noShadow: "'{{name}}' is already declared in the upper scope." + } + }, + + create(context) { + + const options = { + builtinGlobals: context.options[0] && context.options[0].builtinGlobals, + hoist: (context.options[0] && context.options[0].hoist) || "functions", + allow: (context.options[0] && context.options[0].allow) || [] + }; + + /** + * Check if variable name is allowed. + * @param {ASTNode} variable The variable to check. + * @returns {boolean} Whether or not the variable name is allowed. + */ + function isAllowed(variable) { + return options.allow.indexOf(variable.name) !== -1; + } + + /** + * Checks if a variable of the class name in the class scope of ClassDeclaration. + * + * ClassDeclaration creates two variables of its name into its outer scope and its class scope. + * So we should ignore the variable in the class scope. + * @param {Object} variable The variable to check. + * @returns {boolean} Whether or not the variable of the class name in the class scope of ClassDeclaration. + */ + function isDuplicatedClassNameVariable(variable) { + const block = variable.scope.block; + + return block.type === "ClassDeclaration" && block.id === variable.identifiers[0]; + } + + /** + * Checks if a variable is inside the initializer of scopeVar. + * + * To avoid reporting at declarations such as `var a = function a() {};`. + * But it should report `var a = function(a) {};` or `var a = function() { function a() {} };`. + * @param {Object} variable The variable to check. + * @param {Object} scopeVar The scope variable to look for. + * @returns {boolean} Whether or not the variable is inside initializer of scopeVar. + */ + function isOnInitializer(variable, scopeVar) { + const outerScope = scopeVar.scope; + const outerDef = scopeVar.defs[0]; + const outer = outerDef && outerDef.parent && outerDef.parent.range; + const innerScope = variable.scope; + const innerDef = variable.defs[0]; + const inner = innerDef && innerDef.name.range; + + return ( + outer && + inner && + outer[0] < inner[0] && + inner[1] < outer[1] && + ((innerDef.type === "FunctionName" && innerDef.node.type === "FunctionExpression") || innerDef.node.type === "ClassExpression") && + outerScope === innerScope.upper + ); + } + + /** + * Get a range of a variable's identifier node. + * @param {Object} variable The variable to get. + * @returns {Array|undefined} The range of the variable's identifier node. + */ + function getNameRange(variable) { + const def = variable.defs[0]; + + return def && def.name.range; + } + + /** + * Checks if a variable is in TDZ of scopeVar. + * @param {Object} variable The variable to check. + * @param {Object} scopeVar The variable of TDZ. + * @returns {boolean} Whether or not the variable is in TDZ of scopeVar. + */ + function isInTdz(variable, scopeVar) { + const outerDef = scopeVar.defs[0]; + const inner = getNameRange(variable); + const outer = getNameRange(scopeVar); + + return ( + inner && + outer && + inner[1] < outer[0] && + + // Excepts FunctionDeclaration if is {"hoist":"function"}. + (options.hoist !== "functions" || !outerDef || outerDef.node.type !== "FunctionDeclaration") + ); + } + + /** + * Checks the current context for shadowed variables. + * @param {Scope} scope Fixme + * @returns {void} + */ + function checkForShadows(scope) { + const variables = scope.variables; + + for (let i = 0; i < variables.length; ++i) { + const variable = variables[i]; + + // Skips "arguments" or variables of a class name in the class scope of ClassDeclaration. + if (variable.identifiers.length === 0 || + isDuplicatedClassNameVariable(variable) || + isAllowed(variable) + ) { + continue; + } + + // Gets shadowed variable. + const shadowed = astUtils.getVariableByName(scope.upper, variable.name); + + if (shadowed && + (shadowed.identifiers.length > 0 || (options.builtinGlobals && "writeable" in shadowed)) && + !isOnInitializer(variable, shadowed) && + !(options.hoist !== "all" && isInTdz(variable, shadowed)) + ) { + context.report({ + node: variable.identifiers[0], + messageId: "noShadow", + data: variable + }); + } + } + } + + return { + "Program:exit"() { + const globalScope = context.getScope(); + const stack = globalScope.childScopes.slice(); + + while (stack.length) { + const scope = stack.pop(); + + stack.push(...scope.childScopes); + checkForShadows(scope); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-spaced-func.js b/node_modules/eslint/lib/rules/no-spaced-func.js new file mode 100644 index 000000000..961bc681f --- /dev/null +++ b/node_modules/eslint/lib/rules/no-spaced-func.js @@ -0,0 +1,83 @@ +/** + * @fileoverview Rule to check that spaced function application + * @author Matt DuVall + * @deprecated in ESLint v3.3.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow spacing between function identifiers and their applications (deprecated)", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-spaced-func" + }, + + deprecated: true, + + replacedBy: ["func-call-spacing"], + + fixable: "whitespace", + schema: [], + + messages: { + noSpacedFunction: "Unexpected space between function name and paren." + } + }, + + create(context) { + + const sourceCode = context.getSourceCode(); + + /** + * Check if open space is present in a function name + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function detectOpenSpaces(node) { + const lastCalleeToken = sourceCode.getLastToken(node.callee); + let prevToken = lastCalleeToken, + parenToken = sourceCode.getTokenAfter(lastCalleeToken); + + // advances to an open parenthesis. + while ( + parenToken && + parenToken.range[1] < node.range[1] && + parenToken.value !== "(" + ) { + prevToken = parenToken; + parenToken = sourceCode.getTokenAfter(parenToken); + } + + // look for a space between the callee and the open paren + if (parenToken && + parenToken.range[1] < node.range[1] && + sourceCode.isSpaceBetweenTokens(prevToken, parenToken) + ) { + context.report({ + node, + loc: lastCalleeToken.loc.start, + messageId: "noSpacedFunction", + fix(fixer) { + return fixer.removeRange([prevToken.range[1], parenToken.range[0]]); + } + }); + } + } + + return { + CallExpression: detectOpenSpaces, + NewExpression: detectOpenSpaces + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-sparse-arrays.js b/node_modules/eslint/lib/rules/no-sparse-arrays.js new file mode 100644 index 000000000..e8407c3fa --- /dev/null +++ b/node_modules/eslint/lib/rules/no-sparse-arrays.js @@ -0,0 +1,50 @@ +/** + * @fileoverview Disallow sparse arrays + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow sparse arrays", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-sparse-arrays" + }, + + schema: [], + + messages: { + unexpectedSparseArray: "Unexpected comma in middle of array." + } + }, + + create(context) { + + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + ArrayExpression(node) { + + const emptySpot = node.elements.indexOf(null) > -1; + + if (emptySpot) { + context.report({ node, messageId: "unexpectedSparseArray" }); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-sync.js b/node_modules/eslint/lib/rules/no-sync.js new file mode 100644 index 000000000..06424e0b3 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-sync.js @@ -0,0 +1,65 @@ +/** + * @fileoverview Rule to check for properties whose identifier ends with the string Sync + * @author Matt DuVall + */ + +/* jshint node:true */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "disallow synchronous methods", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/no-sync" + }, + + schema: [ + { + type: "object", + properties: { + allowAtRootLevel: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + noSync: "Unexpected sync method: '{{propertyName}}'." + } + }, + + create(context) { + const selector = context.options[0] && context.options[0].allowAtRootLevel + ? ":function MemberExpression[property.name=/.*Sync$/]" + : "MemberExpression[property.name=/.*Sync$/]"; + + return { + [selector](node) { + context.report({ + node, + messageId: "noSync", + data: { + propertyName: node.property.name + } + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-tabs.js b/node_modules/eslint/lib/rules/no-tabs.js new file mode 100644 index 000000000..ca7be2616 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-tabs.js @@ -0,0 +1,78 @@ +/** + * @fileoverview Rule to check for tabs inside a file + * @author Gyandeep Singh + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const tabRegex = /\t+/gu; +const anyNonWhitespaceRegex = /\S/u; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow all tabs", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-tabs" + }, + schema: [{ + type: "object", + properties: { + allowIndentationTabs: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], + + messages: { + unexpectedTab: "Unexpected tab character." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const allowIndentationTabs = context.options && context.options[0] && context.options[0].allowIndentationTabs; + + return { + Program(node) { + sourceCode.getLines().forEach((line, index) => { + let match; + + while ((match = tabRegex.exec(line)) !== null) { + if (allowIndentationTabs && !anyNonWhitespaceRegex.test(line.slice(0, match.index))) { + continue; + } + + context.report({ + node, + loc: { + start: { + line: index + 1, + column: match.index + }, + end: { + line: index + 1, + column: match.index + match[0].length + } + }, + messageId: "unexpectedTab" + }); + } + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-template-curly-in-string.js b/node_modules/eslint/lib/rules/no-template-curly-in-string.js new file mode 100644 index 000000000..539cd5be5 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-template-curly-in-string.js @@ -0,0 +1,44 @@ +/** + * @fileoverview Warn when using template string syntax in regular strings + * @author Jeroen Engels + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow template literal placeholder syntax in regular strings", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-template-curly-in-string" + }, + + schema: [], + + messages: { + unexpectedTemplateExpression: "Unexpected template string expression." + } + }, + + create(context) { + const regex = /\$\{[^}]+\}/u; + + return { + Literal(node) { + if (typeof node.value === "string" && regex.test(node.value)) { + context.report({ + node, + messageId: "unexpectedTemplateExpression" + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-ternary.js b/node_modules/eslint/lib/rules/no-ternary.js new file mode 100644 index 000000000..b3ced8605 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-ternary.js @@ -0,0 +1,41 @@ +/** + * @fileoverview Rule to flag use of ternary operators. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow ternary operators", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-ternary" + }, + + schema: [], + + messages: { + noTernaryOperator: "Ternary operator used." + } + }, + + create(context) { + + return { + + ConditionalExpression(node) { + context.report({ node, messageId: "noTernaryOperator" }); + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-this-before-super.js b/node_modules/eslint/lib/rules/no-this-before-super.js new file mode 100644 index 000000000..44288c0c9 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-this-before-super.js @@ -0,0 +1,304 @@ +/** + * @fileoverview A rule to disallow using `this`/`super` before `super()`. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a constructor. + * @param {ASTNode} node A node to check. This node type is one of + * `Program`, `FunctionDeclaration`, `FunctionExpression`, and + * `ArrowFunctionExpression`. + * @returns {boolean} `true` if the node is a constructor. + */ +function isConstructorFunction(node) { + return ( + node.type === "FunctionExpression" && + node.parent.type === "MethodDefinition" && + node.parent.kind === "constructor" + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow `this`/`super` before calling `super()` in constructors", + category: "ECMAScript 6", + recommended: true, + url: "https://eslint.org/docs/rules/no-this-before-super" + }, + + schema: [], + + messages: { + noBeforeSuper: "'{{kind}}' is not allowed before 'super()'." + } + }, + + create(context) { + + /* + * Information for each constructor. + * - upper: Information of the upper constructor. + * - hasExtends: A flag which shows whether the owner class has a valid + * `extends` part. + * - scope: The scope of the owner class. + * - codePath: The code path of this constructor. + */ + let funcInfo = null; + + /* + * Information for each code path segment. + * Each key is the id of a code path segment. + * Each value is an object: + * - superCalled: The flag which shows `super()` called in all code paths. + * - invalidNodes: The array of invalid ThisExpression and Super nodes. + */ + let segInfoMap = Object.create(null); + + /** + * Gets whether or not `super()` is called in a given code path segment. + * @param {CodePathSegment} segment A code path segment to get. + * @returns {boolean} `true` if `super()` is called. + */ + function isCalled(segment) { + return !segment.reachable || segInfoMap[segment.id].superCalled; + } + + /** + * Checks whether or not this is in a constructor. + * @returns {boolean} `true` if this is in a constructor. + */ + function isInConstructorOfDerivedClass() { + return Boolean(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends); + } + + /** + * Checks whether or not this is before `super()` is called. + * @returns {boolean} `true` if this is before `super()` is called. + */ + function isBeforeCallOfSuper() { + return ( + isInConstructorOfDerivedClass() && + !funcInfo.codePath.currentSegments.every(isCalled) + ); + } + + /** + * Sets a given node as invalid. + * @param {ASTNode} node A node to set as invalid. This is one of + * a ThisExpression and a Super. + * @returns {void} + */ + function setInvalid(node) { + const segments = funcInfo.codePath.currentSegments; + + for (let i = 0; i < segments.length; ++i) { + const segment = segments[i]; + + if (segment.reachable) { + segInfoMap[segment.id].invalidNodes.push(node); + } + } + } + + /** + * Sets the current segment as `super` was called. + * @returns {void} + */ + function setSuperCalled() { + const segments = funcInfo.codePath.currentSegments; + + for (let i = 0; i < segments.length; ++i) { + const segment = segments[i]; + + if (segment.reachable) { + segInfoMap[segment.id].superCalled = true; + } + } + } + + return { + + /** + * Adds information of a constructor into the stack. + * @param {CodePath} codePath A code path which was started. + * @param {ASTNode} node The current node. + * @returns {void} + */ + onCodePathStart(codePath, node) { + if (isConstructorFunction(node)) { + + // Class > ClassBody > MethodDefinition > FunctionExpression + const classNode = node.parent.parent.parent; + + funcInfo = { + upper: funcInfo, + isConstructor: true, + hasExtends: Boolean( + classNode.superClass && + !astUtils.isNullOrUndefined(classNode.superClass) + ), + codePath + }; + } else { + funcInfo = { + upper: funcInfo, + isConstructor: false, + hasExtends: false, + codePath + }; + } + }, + + /** + * Removes the top of stack item. + * + * And this treverses all segments of this code path then reports every + * invalid node. + * @param {CodePath} codePath A code path which was ended. + * @returns {void} + */ + onCodePathEnd(codePath) { + const isDerivedClass = funcInfo.hasExtends; + + funcInfo = funcInfo.upper; + if (!isDerivedClass) { + return; + } + + codePath.traverseSegments((segment, controller) => { + const info = segInfoMap[segment.id]; + + for (let i = 0; i < info.invalidNodes.length; ++i) { + const invalidNode = info.invalidNodes[i]; + + context.report({ + messageId: "noBeforeSuper", + node: invalidNode, + data: { + kind: invalidNode.type === "Super" ? "super" : "this" + } + }); + } + + if (info.superCalled) { + controller.skip(); + } + }); + }, + + /** + * Initialize information of a given code path segment. + * @param {CodePathSegment} segment A code path segment to initialize. + * @returns {void} + */ + onCodePathSegmentStart(segment) { + if (!isInConstructorOfDerivedClass()) { + return; + } + + // Initialize info. + segInfoMap[segment.id] = { + superCalled: ( + segment.prevSegments.length > 0 && + segment.prevSegments.every(isCalled) + ), + invalidNodes: [] + }; + }, + + /** + * Update information of the code path segment when a code path was + * looped. + * @param {CodePathSegment} fromSegment The code path segment of the + * end of a loop. + * @param {CodePathSegment} toSegment A code path segment of the head + * of a loop. + * @returns {void} + */ + onCodePathSegmentLoop(fromSegment, toSegment) { + if (!isInConstructorOfDerivedClass()) { + return; + } + + // Update information inside of the loop. + funcInfo.codePath.traverseSegments( + { first: toSegment, last: fromSegment }, + (segment, controller) => { + const info = segInfoMap[segment.id]; + + if (info.superCalled) { + info.invalidNodes = []; + controller.skip(); + } else if ( + segment.prevSegments.length > 0 && + segment.prevSegments.every(isCalled) + ) { + info.superCalled = true; + info.invalidNodes = []; + } + } + ); + }, + + /** + * Reports if this is before `super()`. + * @param {ASTNode} node A target node. + * @returns {void} + */ + ThisExpression(node) { + if (isBeforeCallOfSuper()) { + setInvalid(node); + } + }, + + /** + * Reports if this is before `super()`. + * @param {ASTNode} node A target node. + * @returns {void} + */ + Super(node) { + if (!astUtils.isCallee(node) && isBeforeCallOfSuper()) { + setInvalid(node); + } + }, + + /** + * Marks `super()` called. + * @param {ASTNode} node A target node. + * @returns {void} + */ + "CallExpression:exit"(node) { + if (node.callee.type === "Super" && isBeforeCallOfSuper()) { + setSuperCalled(); + } + }, + + /** + * Resets state. + * @returns {void} + */ + "Program:exit"() { + segInfoMap = Object.create(null); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-throw-literal.js b/node_modules/eslint/lib/rules/no-throw-literal.js new file mode 100644 index 000000000..29fb3718b --- /dev/null +++ b/node_modules/eslint/lib/rules/no-throw-literal.js @@ -0,0 +1,51 @@ +/** + * @fileoverview Rule to restrict what can be thrown as an exception. + * @author Dieter Oberkofler + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow throwing literals as exceptions", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-throw-literal" + }, + + schema: [], + + messages: { + object: "Expected an error object to be thrown.", + undef: "Do not throw undefined." + } + }, + + create(context) { + + return { + + ThrowStatement(node) { + if (!astUtils.couldBeError(node.argument)) { + context.report({ node, messageId: "object" }); + } else if (node.argument.type === "Identifier") { + if (node.argument.name === "undefined") { + context.report({ node, messageId: "undef" }); + } + } + + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-trailing-spaces.js b/node_modules/eslint/lib/rules/no-trailing-spaces.js new file mode 100644 index 000000000..98ae62c89 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-trailing-spaces.js @@ -0,0 +1,190 @@ +/** + * @fileoverview Disallow trailing spaces at the end of lines. + * @author Nodeca Team + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow trailing whitespace at the end of lines", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-trailing-spaces" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + skipBlankLines: { + type: "boolean", + default: false + }, + ignoreComments: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + trailingSpace: "Trailing spaces not allowed." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + const BLANK_CLASS = "[ \t\u00a0\u2000-\u200b\u3000]", + SKIP_BLANK = `^${BLANK_CLASS}*$`, + NONBLANK = `${BLANK_CLASS}+$`; + + const options = context.options[0] || {}, + skipBlankLines = options.skipBlankLines || false, + ignoreComments = options.ignoreComments || false; + + /** + * Report the error message + * @param {ASTNode} node node to report + * @param {int[]} location range information + * @param {int[]} fixRange Range based on the whole program + * @returns {void} + */ + function report(node, location, fixRange) { + + /* + * Passing node is a bit dirty, because message data will contain big + * text in `source`. But... who cares :) ? + * One more kludge will not make worse the bloody wizardry of this + * plugin. + */ + context.report({ + node, + loc: location, + messageId: "trailingSpace", + fix(fixer) { + return fixer.removeRange(fixRange); + } + }); + } + + /** + * Given a list of comment nodes, return the line numbers for those comments. + * @param {Array} comments An array of comment nodes. + * @returns {number[]} An array of line numbers containing comments. + */ + function getCommentLineNumbers(comments) { + const lines = new Set(); + + comments.forEach(comment => { + const endLine = comment.type === "Block" + ? comment.loc.end.line - 1 + : comment.loc.end.line; + + for (let i = comment.loc.start.line; i <= endLine; i++) { + lines.add(i); + } + }); + + return lines; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + Program: function checkTrailingSpaces(node) { + + /* + * Let's hack. Since Espree does not return whitespace nodes, + * fetch the source code and do matching via regexps. + */ + + const re = new RegExp(NONBLANK, "u"), + skipMatch = new RegExp(SKIP_BLANK, "u"), + lines = sourceCode.lines, + linebreaks = sourceCode.getText().match(astUtils.createGlobalLinebreakMatcher()), + comments = sourceCode.getAllComments(), + commentLineNumbers = getCommentLineNumbers(comments); + + let totalLength = 0, + fixRange = []; + + for (let i = 0, ii = lines.length; i < ii; i++) { + const lineNumber = i + 1; + + /* + * Always add linebreak length to line length to accommodate for line break (\n or \r\n) + * Because during the fix time they also reserve one spot in the array. + * Usually linebreak length is 2 for \r\n (CRLF) and 1 for \n (LF) + */ + const linebreakLength = linebreaks && linebreaks[i] ? linebreaks[i].length : 1; + const lineLength = lines[i].length + linebreakLength; + + const matches = re.exec(lines[i]); + + if (matches) { + const location = { + start: { + line: lineNumber, + column: matches.index + }, + end: { + line: lineNumber, + column: lineLength - linebreakLength + } + }; + + const rangeStart = totalLength + location.start.column; + const rangeEnd = totalLength + location.end.column; + const containingNode = sourceCode.getNodeByRangeIndex(rangeStart); + + if (containingNode && containingNode.type === "TemplateElement" && + rangeStart > containingNode.parent.range[0] && + rangeEnd < containingNode.parent.range[1]) { + totalLength += lineLength; + continue; + } + + /* + * If the line has only whitespace, and skipBlankLines + * is true, don't report it + */ + if (skipBlankLines && skipMatch.test(lines[i])) { + totalLength += lineLength; + continue; + } + + fixRange = [rangeStart, rangeEnd]; + + if (!ignoreComments || !commentLineNumbers.has(lineNumber)) { + report(node, location, fixRange); + } + } + + totalLength += lineLength; + } + } + + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-undef-init.js b/node_modules/eslint/lib/rules/no-undef-init.js new file mode 100644 index 000000000..5c240fef7 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-undef-init.js @@ -0,0 +1,75 @@ +/** + * @fileoverview Rule to flag when initializing to undefined + * @author Ilya Volodin + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow initializing variables to `undefined`", + category: "Variables", + recommended: false, + url: "https://eslint.org/docs/rules/no-undef-init" + }, + + schema: [], + fixable: "code", + + messages: { + unnecessaryUndefinedInit: "It's not necessary to initialize '{{name}}' to undefined." + } + }, + + create(context) { + + const sourceCode = context.getSourceCode(); + + return { + + VariableDeclarator(node) { + const name = sourceCode.getText(node.id), + init = node.init && node.init.name, + scope = context.getScope(), + undefinedVar = astUtils.getVariableByName(scope, "undefined"), + shadowed = undefinedVar && undefinedVar.defs.length > 0, + lastToken = sourceCode.getLastToken(node); + + if (init === "undefined" && node.parent.kind !== "const" && !shadowed) { + context.report({ + node, + messageId: "unnecessaryUndefinedInit", + data: { name }, + fix(fixer) { + if (node.parent.kind === "var") { + return null; + } + + if (node.id.type === "ArrayPattern" || node.id.type === "ObjectPattern") { + + // Don't fix destructuring assignment to `undefined`. + return null; + } + + if (sourceCode.commentsExistBetween(node.id, lastToken)) { + return null; + } + + return fixer.removeRange([node.id.range[1], node.range[1]]); + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-undef.js b/node_modules/eslint/lib/rules/no-undef.js new file mode 100644 index 000000000..6b5140819 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-undef.js @@ -0,0 +1,78 @@ +/** + * @fileoverview Rule to flag references to undeclared variables. + * @author Mark Macdonald + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks if the given node is the argument of a typeof operator. + * @param {ASTNode} node The AST node being checked. + * @returns {boolean} Whether or not the node is the argument of a typeof operator. + */ +function hasTypeOfOperator(node) { + const parent = node.parent; + + return parent.type === "UnaryExpression" && parent.operator === "typeof"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow the use of undeclared variables unless mentioned in `/*global */` comments", + category: "Variables", + recommended: true, + url: "https://eslint.org/docs/rules/no-undef" + }, + + schema: [ + { + type: "object", + properties: { + typeof: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + messages: { + undef: "'{{name}}' is not defined." + } + }, + + create(context) { + const options = context.options[0]; + const considerTypeOf = options && options.typeof === true || false; + + return { + "Program:exit"(/* node */) { + const globalScope = context.getScope(); + + globalScope.through.forEach(ref => { + const identifier = ref.identifier; + + if (!considerTypeOf && hasTypeOfOperator(identifier)) { + return; + } + + context.report({ + node: identifier, + messageId: "undef", + data: identifier + }); + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-undefined.js b/node_modules/eslint/lib/rules/no-undefined.js new file mode 100644 index 000000000..a075d903e --- /dev/null +++ b/node_modules/eslint/lib/rules/no-undefined.js @@ -0,0 +1,84 @@ +/** + * @fileoverview Rule to flag references to the undefined variable. + * @author Michael Ficarra + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of `undefined` as an identifier", + category: "Variables", + recommended: false, + url: "https://eslint.org/docs/rules/no-undefined" + }, + + schema: [], + + messages: { + unexpectedUndefined: "Unexpected use of undefined." + } + }, + + create(context) { + + /** + * Report an invalid "undefined" identifier node. + * @param {ASTNode} node The node to report. + * @returns {void} + */ + function report(node) { + context.report({ + node, + messageId: "unexpectedUndefined" + }); + } + + /** + * Checks the given scope for references to `undefined` and reports + * all references found. + * @param {eslint-scope.Scope} scope The scope to check. + * @returns {void} + */ + function checkScope(scope) { + const undefinedVar = scope.set.get("undefined"); + + if (!undefinedVar) { + return; + } + + const references = undefinedVar.references; + + const defs = undefinedVar.defs; + + // Report non-initializing references (those are covered in defs below) + references + .filter(ref => !ref.init) + .forEach(ref => report(ref.identifier)); + + defs.forEach(def => report(def.name)); + } + + return { + "Program:exit"() { + const globalScope = context.getScope(); + + const stack = [globalScope]; + + while (stack.length) { + const scope = stack.pop(); + + stack.push(...scope.childScopes); + checkScope(scope); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-underscore-dangle.js b/node_modules/eslint/lib/rules/no-underscore-dangle.js new file mode 100644 index 000000000..87d2336fa --- /dev/null +++ b/node_modules/eslint/lib/rules/no-underscore-dangle.js @@ -0,0 +1,277 @@ +/** + * @fileoverview Rule to flag dangling underscores in variable declarations. + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow dangling underscores in identifiers", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-underscore-dangle" + }, + + schema: [ + { + type: "object", + properties: { + allow: { + type: "array", + items: { + type: "string" + } + }, + allowAfterThis: { + type: "boolean", + default: false + }, + allowAfterSuper: { + type: "boolean", + default: false + }, + allowAfterThisConstructor: { + type: "boolean", + default: false + }, + enforceInMethodNames: { + type: "boolean", + default: false + }, + allowFunctionParams: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedUnderscore: "Unexpected dangling '_' in '{{identifier}}'." + } + }, + + create(context) { + + const options = context.options[0] || {}; + const ALLOWED_VARIABLES = options.allow ? options.allow : []; + const allowAfterThis = typeof options.allowAfterThis !== "undefined" ? options.allowAfterThis : false; + const allowAfterSuper = typeof options.allowAfterSuper !== "undefined" ? options.allowAfterSuper : false; + const allowAfterThisConstructor = typeof options.allowAfterThisConstructor !== "undefined" ? options.allowAfterThisConstructor : false; + const enforceInMethodNames = typeof options.enforceInMethodNames !== "undefined" ? options.enforceInMethodNames : false; + const allowFunctionParams = typeof options.allowFunctionParams !== "undefined" ? options.allowFunctionParams : true; + + //------------------------------------------------------------------------- + // Helpers + //------------------------------------------------------------------------- + + /** + * Check if identifier is present inside the allowed option + * @param {string} identifier name of the node + * @returns {boolean} true if its is present + * @private + */ + function isAllowed(identifier) { + return ALLOWED_VARIABLES.some(ident => ident === identifier); + } + + /** + * Check if identifier has a dangling underscore + * @param {string} identifier name of the node + * @returns {boolean} true if its is present + * @private + */ + function hasDanglingUnderscore(identifier) { + const len = identifier.length; + + return identifier !== "_" && (identifier[0] === "_" || identifier[len - 1] === "_"); + } + + /** + * Check if identifier is a special case member expression + * @param {string} identifier name of the node + * @returns {boolean} true if its is a special case + * @private + */ + function isSpecialCaseIdentifierForMemberExpression(identifier) { + return identifier === "__proto__"; + } + + /** + * Check if identifier is a special case variable expression + * @param {string} identifier name of the node + * @returns {boolean} true if its is a special case + * @private + */ + function isSpecialCaseIdentifierInVariableExpression(identifier) { + + // Checks for the underscore library usage here + return identifier === "_"; + } + + /** + * Check if a node is a member reference of this.constructor + * @param {ASTNode} node node to evaluate + * @returns {boolean} true if it is a reference on this.constructor + * @private + */ + function isThisConstructorReference(node) { + return node.object.type === "MemberExpression" && + node.object.property.name === "constructor" && + node.object.object.type === "ThisExpression"; + } + + /** + * Check if function parameter has a dangling underscore. + * @param {ASTNode} node function node to evaluate + * @returns {void} + * @private + */ + function checkForDanglingUnderscoreInFunctionParameters(node) { + if (!allowFunctionParams) { + node.params.forEach(param => { + const { type } = param; + let nodeToCheck; + + if (type === "RestElement") { + nodeToCheck = param.argument; + } else if (type === "AssignmentPattern") { + nodeToCheck = param.left; + } else { + nodeToCheck = param; + } + + if (nodeToCheck.type === "Identifier") { + const identifier = nodeToCheck.name; + + if (hasDanglingUnderscore(identifier) && !isAllowed(identifier)) { + context.report({ + node: param, + messageId: "unexpectedUnderscore", + data: { + identifier + } + }); + } + } + }); + } + } + + /** + * Check if function has a dangling underscore + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkForDanglingUnderscoreInFunction(node) { + if (node.type === "FunctionDeclaration" && node.id) { + const identifier = node.id.name; + + if (typeof identifier !== "undefined" && hasDanglingUnderscore(identifier) && !isAllowed(identifier)) { + context.report({ + node, + messageId: "unexpectedUnderscore", + data: { + identifier + } + }); + } + } + checkForDanglingUnderscoreInFunctionParameters(node); + } + + /** + * Check if variable expression has a dangling underscore + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkForDanglingUnderscoreInVariableExpression(node) { + const identifier = node.id.name; + + if (typeof identifier !== "undefined" && hasDanglingUnderscore(identifier) && + !isSpecialCaseIdentifierInVariableExpression(identifier) && !isAllowed(identifier)) { + context.report({ + node, + messageId: "unexpectedUnderscore", + data: { + identifier + } + }); + } + } + + /** + * Check if member expression has a dangling underscore + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkForDanglingUnderscoreInMemberExpression(node) { + const identifier = node.property.name, + isMemberOfThis = node.object.type === "ThisExpression", + isMemberOfSuper = node.object.type === "Super", + isMemberOfThisConstructor = isThisConstructorReference(node); + + if (typeof identifier !== "undefined" && hasDanglingUnderscore(identifier) && + !(isMemberOfThis && allowAfterThis) && + !(isMemberOfSuper && allowAfterSuper) && + !(isMemberOfThisConstructor && allowAfterThisConstructor) && + !isSpecialCaseIdentifierForMemberExpression(identifier) && !isAllowed(identifier)) { + context.report({ + node, + messageId: "unexpectedUnderscore", + data: { + identifier + } + }); + } + } + + /** + * Check if method declaration or method property has a dangling underscore + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkForDanglingUnderscoreInMethod(node) { + const identifier = node.key.name; + const isMethod = node.type === "MethodDefinition" || node.type === "Property" && node.method; + + if (typeof identifier !== "undefined" && enforceInMethodNames && isMethod && hasDanglingUnderscore(identifier) && !isAllowed(identifier)) { + context.report({ + node, + messageId: "unexpectedUnderscore", + data: { + identifier + } + }); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + FunctionDeclaration: checkForDanglingUnderscoreInFunction, + VariableDeclarator: checkForDanglingUnderscoreInVariableExpression, + MemberExpression: checkForDanglingUnderscoreInMemberExpression, + MethodDefinition: checkForDanglingUnderscoreInMethod, + Property: checkForDanglingUnderscoreInMethod, + FunctionExpression: checkForDanglingUnderscoreInFunction, + ArrowFunctionExpression: checkForDanglingUnderscoreInFunction + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-unexpected-multiline.js b/node_modules/eslint/lib/rules/no-unexpected-multiline.js new file mode 100644 index 000000000..7af3fe670 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unexpected-multiline.js @@ -0,0 +1,120 @@ +/** + * @fileoverview Rule to spot scenarios where a newline looks like it is ending a statement, but is not. + * @author Glen Mailer + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow confusing multiline expressions", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-unexpected-multiline" + }, + + schema: [], + messages: { + function: "Unexpected newline between function and ( of function call.", + property: "Unexpected newline between object and [ of property access.", + taggedTemplate: "Unexpected newline between template tag and template literal.", + division: "Unexpected newline between numerator and division operator." + } + }, + + create(context) { + + const REGEX_FLAG_MATCHER = /^[gimsuy]+$/u; + + const sourceCode = context.getSourceCode(); + + /** + * Check to see if there is a newline between the node and the following open bracket + * line's expression + * @param {ASTNode} node The node to check. + * @param {string} messageId The error messageId to use. + * @returns {void} + * @private + */ + function checkForBreakAfter(node, messageId) { + const openParen = sourceCode.getTokenAfter(node, astUtils.isNotClosingParenToken); + const nodeExpressionEnd = sourceCode.getTokenBefore(openParen); + + if (openParen.loc.start.line !== nodeExpressionEnd.loc.end.line) { + context.report({ + node, + loc: openParen.loc, + messageId + }); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + + MemberExpression(node) { + if (!node.computed || node.optional) { + return; + } + checkForBreakAfter(node.object, "property"); + }, + + TaggedTemplateExpression(node) { + const { quasi } = node; + + // handles common tags, parenthesized tags, and typescript's generic type arguments + const tokenBefore = sourceCode.getTokenBefore(quasi); + + if (tokenBefore.loc.end.line !== quasi.loc.start.line) { + context.report({ + node, + loc: { + start: quasi.loc.start, + end: { + line: quasi.loc.start.line, + column: quasi.loc.start.column + 1 + } + }, + messageId: "taggedTemplate" + }); + } + }, + + CallExpression(node) { + if (node.arguments.length === 0 || node.optional) { + return; + } + checkForBreakAfter(node.callee, "function"); + }, + + "BinaryExpression[operator='/'] > BinaryExpression[operator='/'].left"(node) { + const secondSlash = sourceCode.getTokenAfter(node, token => token.value === "/"); + const tokenAfterOperator = sourceCode.getTokenAfter(secondSlash); + + if ( + tokenAfterOperator.type === "Identifier" && + REGEX_FLAG_MATCHER.test(tokenAfterOperator.value) && + secondSlash.range[1] === tokenAfterOperator.range[0] + ) { + checkForBreakAfter(node.left, "division"); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js b/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js new file mode 100644 index 000000000..7031a4dd8 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js @@ -0,0 +1,360 @@ +/** + * @fileoverview Rule to disallow use of unmodified expressions in loop conditions + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Traverser = require("../shared/traverser"), + astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SENTINEL_PATTERN = /(?:(?:Call|Class|Function|Member|New|Yield)Expression|Statement|Declaration)$/u; +const LOOP_PATTERN = /^(?:DoWhile|For|While)Statement$/u; // for-in/of statements don't have `test` property. +const GROUP_PATTERN = /^(?:BinaryExpression|ConditionalExpression)$/u; +const SKIP_PATTERN = /^(?:ArrowFunction|Class|Function)Expression$/u; +const DYNAMIC_PATTERN = /^(?:Call|Member|New|TaggedTemplate|Yield)Expression$/u; + +/** + * @typedef {Object} LoopConditionInfo + * @property {eslint-scope.Reference} reference - The reference. + * @property {ASTNode} group - BinaryExpression or ConditionalExpression nodes + * that the reference is belonging to. + * @property {Function} isInLoop - The predicate which checks a given reference + * is in this loop. + * @property {boolean} modified - The flag that the reference is modified in + * this loop. + */ + +/** + * Checks whether or not a given reference is a write reference. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is a write reference. + */ +function isWriteReference(reference) { + if (reference.init) { + const def = reference.resolved && reference.resolved.defs[0]; + + if (!def || def.type !== "Variable" || def.parent.kind !== "var") { + return false; + } + } + return reference.isWrite(); +} + +/** + * Checks whether or not a given loop condition info does not have the modified + * flag. + * @param {LoopConditionInfo} condition A loop condition info to check. + * @returns {boolean} `true` if the loop condition info is "unmodified". + */ +function isUnmodified(condition) { + return !condition.modified; +} + +/** + * Checks whether or not a given loop condition info does not have the modified + * flag and does not have the group this condition belongs to. + * @param {LoopConditionInfo} condition A loop condition info to check. + * @returns {boolean} `true` if the loop condition info is "unmodified". + */ +function isUnmodifiedAndNotBelongToGroup(condition) { + return !(condition.modified || condition.group); +} + +/** + * Checks whether or not a given reference is inside of a given node. + * @param {ASTNode} node A node to check. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is inside of the node. + */ +function isInRange(node, reference) { + const or = node.range; + const ir = reference.identifier.range; + + return or[0] <= ir[0] && ir[1] <= or[1]; +} + +/** + * Checks whether or not a given reference is inside of a loop node's condition. + * @param {ASTNode} node A node to check. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is inside of the loop node's + * condition. + */ +const isInLoop = { + WhileStatement: isInRange, + DoWhileStatement: isInRange, + ForStatement(node, reference) { + return ( + isInRange(node, reference) && + !(node.init && isInRange(node.init, reference)) + ); + } +}; + +/** + * Gets the function which encloses a given reference. + * This supports only FunctionDeclaration. + * @param {eslint-scope.Reference} reference A reference to get. + * @returns {ASTNode|null} The function node or null. + */ +function getEncloseFunctionDeclaration(reference) { + let node = reference.identifier; + + while (node) { + if (node.type === "FunctionDeclaration") { + return node.id ? node : null; + } + + node = node.parent; + } + + return null; +} + +/** + * Updates the "modified" flags of given loop conditions with given modifiers. + * @param {LoopConditionInfo[]} conditions The loop conditions to be updated. + * @param {eslint-scope.Reference[]} modifiers The references to update. + * @returns {void} + */ +function updateModifiedFlag(conditions, modifiers) { + + for (let i = 0; i < conditions.length; ++i) { + const condition = conditions[i]; + + for (let j = 0; !condition.modified && j < modifiers.length; ++j) { + const modifier = modifiers[j]; + let funcNode, funcVar; + + /* + * Besides checking for the condition being in the loop, we want to + * check the function that this modifier is belonging to is called + * in the loop. + * FIXME: This should probably be extracted to a function. + */ + const inLoop = condition.isInLoop(modifier) || Boolean( + (funcNode = getEncloseFunctionDeclaration(modifier)) && + (funcVar = astUtils.getVariableByName(modifier.from.upper, funcNode.id.name)) && + funcVar.references.some(condition.isInLoop) + ); + + condition.modified = inLoop; + } + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow unmodified loop conditions", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-unmodified-loop-condition" + }, + + schema: [], + + messages: { + loopConditionNotModified: "'{{name}}' is not modified in this loop." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + let groupMap = null; + + /** + * Reports a given condition info. + * @param {LoopConditionInfo} condition A loop condition info to report. + * @returns {void} + */ + function report(condition) { + const node = condition.reference.identifier; + + context.report({ + node, + messageId: "loopConditionNotModified", + data: node + }); + } + + /** + * Registers given conditions to the group the condition belongs to. + * @param {LoopConditionInfo[]} conditions A loop condition info to + * register. + * @returns {void} + */ + function registerConditionsToGroup(conditions) { + for (let i = 0; i < conditions.length; ++i) { + const condition = conditions[i]; + + if (condition.group) { + let group = groupMap.get(condition.group); + + if (!group) { + group = []; + groupMap.set(condition.group, group); + } + group.push(condition); + } + } + } + + /** + * Reports references which are inside of unmodified groups. + * @param {LoopConditionInfo[]} conditions A loop condition info to report. + * @returns {void} + */ + function checkConditionsInGroup(conditions) { + if (conditions.every(isUnmodified)) { + conditions.forEach(report); + } + } + + /** + * Checks whether or not a given group node has any dynamic elements. + * @param {ASTNode} root A node to check. + * This node is one of BinaryExpression or ConditionalExpression. + * @returns {boolean} `true` if the node is dynamic. + */ + function hasDynamicExpressions(root) { + let retv = false; + + Traverser.traverse(root, { + visitorKeys: sourceCode.visitorKeys, + enter(node) { + if (DYNAMIC_PATTERN.test(node.type)) { + retv = true; + this.break(); + } else if (SKIP_PATTERN.test(node.type)) { + this.skip(); + } + } + }); + + return retv; + } + + /** + * Creates the loop condition information from a given reference. + * @param {eslint-scope.Reference} reference A reference to create. + * @returns {LoopConditionInfo|null} Created loop condition info, or null. + */ + function toLoopCondition(reference) { + if (reference.init) { + return null; + } + + let group = null; + let child = reference.identifier; + let node = child.parent; + + while (node) { + if (SENTINEL_PATTERN.test(node.type)) { + if (LOOP_PATTERN.test(node.type) && node.test === child) { + + // This reference is inside of a loop condition. + return { + reference, + group, + isInLoop: isInLoop[node.type].bind(null, node), + modified: false + }; + } + + // This reference is outside of a loop condition. + break; + } + + /* + * If it's inside of a group, OK if either operand is modified. + * So stores the group this reference belongs to. + */ + if (GROUP_PATTERN.test(node.type)) { + + // If this expression is dynamic, no need to check. + if (hasDynamicExpressions(node)) { + break; + } else { + group = node; + } + } + + child = node; + node = node.parent; + } + + return null; + } + + /** + * Finds unmodified references which are inside of a loop condition. + * Then reports the references which are outside of groups. + * @param {eslint-scope.Variable} variable A variable to report. + * @returns {void} + */ + function checkReferences(variable) { + + // Gets references that exist in loop conditions. + const conditions = variable + .references + .map(toLoopCondition) + .filter(Boolean); + + if (conditions.length === 0) { + return; + } + + // Registers the conditions to belonging groups. + registerConditionsToGroup(conditions); + + // Check the conditions are modified. + const modifiers = variable.references.filter(isWriteReference); + + if (modifiers.length > 0) { + updateModifiedFlag(conditions, modifiers); + } + + /* + * Reports the conditions which are not belonging to groups. + * Others will be reported after all variables are done. + */ + conditions + .filter(isUnmodifiedAndNotBelongToGroup) + .forEach(report); + } + + return { + "Program:exit"() { + const queue = [context.getScope()]; + + groupMap = new Map(); + + let scope; + + while ((scope = queue.pop())) { + queue.push(...scope.childScopes); + scope.variables.forEach(checkReferences); + } + + groupMap.forEach(checkConditionsInGroup); + groupMap = null; + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unneeded-ternary.js b/node_modules/eslint/lib/rules/no-unneeded-ternary.js new file mode 100644 index 000000000..06c615f38 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unneeded-ternary.js @@ -0,0 +1,166 @@ +/** + * @fileoverview Rule to flag no-unneeded-ternary + * @author Gyandeep Singh + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +// Operators that always result in a boolean value +const BOOLEAN_OPERATORS = new Set(["==", "===", "!=", "!==", ">", ">=", "<", "<=", "in", "instanceof"]); +const OPERATOR_INVERSES = { + "==": "!=", + "!=": "==", + "===": "!==", + "!==": "===" + + // Operators like < and >= are not true inverses, since both will return false with NaN. +}; +const OR_PRECEDENCE = astUtils.getPrecedence({ type: "LogicalExpression", operator: "||" }); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow ternary operators when simpler alternatives exist", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-unneeded-ternary" + }, + + schema: [ + { + type: "object", + properties: { + defaultAssignment: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + fixable: "code", + + messages: { + unnecessaryConditionalExpression: "Unnecessary use of boolean literals in conditional expression.", + unnecessaryConditionalAssignment: "Unnecessary use of conditional expression for default assignment." + } + }, + + create(context) { + const options = context.options[0] || {}; + const defaultAssignment = options.defaultAssignment !== false; + const sourceCode = context.getSourceCode(); + + /** + * Test if the node is a boolean literal + * @param {ASTNode} node The node to report. + * @returns {boolean} True if the its a boolean literal + * @private + */ + function isBooleanLiteral(node) { + return node.type === "Literal" && typeof node.value === "boolean"; + } + + /** + * Creates an expression that represents the boolean inverse of the expression represented by the original node + * @param {ASTNode} node A node representing an expression + * @returns {string} A string representing an inverted expression + */ + function invertExpression(node) { + if (node.type === "BinaryExpression" && Object.prototype.hasOwnProperty.call(OPERATOR_INVERSES, node.operator)) { + const operatorToken = sourceCode.getFirstTokenBetween( + node.left, + node.right, + token => token.value === node.operator + ); + const text = sourceCode.getText(); + + return text.slice(node.range[0], + operatorToken.range[0]) + OPERATOR_INVERSES[node.operator] + text.slice(operatorToken.range[1], node.range[1]); + } + + if (astUtils.getPrecedence(node) < astUtils.getPrecedence({ type: "UnaryExpression" })) { + return `!(${astUtils.getParenthesisedText(sourceCode, node)})`; + } + return `!${astUtils.getParenthesisedText(sourceCode, node)}`; + } + + /** + * Tests if a given node always evaluates to a boolean value + * @param {ASTNode} node An expression node + * @returns {boolean} True if it is determined that the node will always evaluate to a boolean value + */ + function isBooleanExpression(node) { + return node.type === "BinaryExpression" && BOOLEAN_OPERATORS.has(node.operator) || + node.type === "UnaryExpression" && node.operator === "!"; + } + + /** + * Test if the node matches the pattern id ? id : expression + * @param {ASTNode} node The ConditionalExpression to check. + * @returns {boolean} True if the pattern is matched, and false otherwise + * @private + */ + function matchesDefaultAssignment(node) { + return node.test.type === "Identifier" && + node.consequent.type === "Identifier" && + node.test.name === node.consequent.name; + } + + return { + + ConditionalExpression(node) { + if (isBooleanLiteral(node.alternate) && isBooleanLiteral(node.consequent)) { + context.report({ + node, + messageId: "unnecessaryConditionalExpression", + fix(fixer) { + if (node.consequent.value === node.alternate.value) { + + // Replace `foo ? true : true` with just `true`, but don't replace `foo() ? true : true` + return node.test.type === "Identifier" ? fixer.replaceText(node, node.consequent.value.toString()) : null; + } + if (node.alternate.value) { + + // Replace `foo() ? false : true` with `!(foo())` + return fixer.replaceText(node, invertExpression(node.test)); + } + + // Replace `foo ? true : false` with `foo` if `foo` is guaranteed to be a boolean, or `!!foo` otherwise. + + return fixer.replaceText(node, isBooleanExpression(node.test) ? astUtils.getParenthesisedText(sourceCode, node.test) : `!${invertExpression(node.test)}`); + } + }); + } else if (!defaultAssignment && matchesDefaultAssignment(node)) { + context.report({ + node, + messageId: "unnecessaryConditionalAssignment", + fix: fixer => { + const shouldParenthesizeAlternate = + ( + astUtils.getPrecedence(node.alternate) < OR_PRECEDENCE || + astUtils.isCoalesceExpression(node.alternate) + ) && + !astUtils.isParenthesised(sourceCode, node.alternate); + const alternateText = shouldParenthesizeAlternate + ? `(${sourceCode.getText(node.alternate)})` + : astUtils.getParenthesisedText(sourceCode, node.alternate); + const testText = astUtils.getParenthesisedText(sourceCode, node.test); + + return fixer.replaceText(node, `${testText} || ${alternateText}`); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unreachable-loop.js b/node_modules/eslint/lib/rules/no-unreachable-loop.js new file mode 100644 index 000000000..868a6ff98 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unreachable-loop.js @@ -0,0 +1,150 @@ +/** + * @fileoverview Rule to disallow loops with a body that allows only one iteration + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const allLoopTypes = ["WhileStatement", "DoWhileStatement", "ForStatement", "ForInStatement", "ForOfStatement"]; + +/** + * Determines whether the given node is the first node in the code path to which a loop statement + * 'loops' for the next iteration. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is a looping target. + */ +function isLoopingTarget(node) { + const parent = node.parent; + + if (parent) { + switch (parent.type) { + case "WhileStatement": + return node === parent.test; + case "DoWhileStatement": + return node === parent.body; + case "ForStatement": + return node === (parent.update || parent.test || parent.body); + case "ForInStatement": + case "ForOfStatement": + return node === parent.left; + + // no default + } + } + + return false; +} + +/** + * Creates an array with elements from the first given array that are not included in the second given array. + * @param {Array} arrA The array to compare from. + * @param {Array} arrB The array to compare against. + * @returns {Array} a new array that represents `arrA \ arrB`. + */ +function getDifference(arrA, arrB) { + return arrA.filter(a => !arrB.includes(a)); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow loops with a body that allows only one iteration", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-unreachable-loop" + }, + + schema: [{ + type: "object", + properties: { + ignore: { + type: "array", + items: { + enum: allLoopTypes + }, + uniqueItems: true + } + }, + additionalProperties: false + }], + + messages: { + invalid: "Invalid loop. Its body allows only one iteration." + } + }, + + create(context) { + const ignoredLoopTypes = context.options[0] && context.options[0].ignore || [], + loopTypesToCheck = getDifference(allLoopTypes, ignoredLoopTypes), + loopSelector = loopTypesToCheck.join(","), + loopsByTargetSegments = new Map(), + loopsToReport = new Set(); + + let currentCodePath = null; + + return { + onCodePathStart(codePath) { + currentCodePath = codePath; + }, + + onCodePathEnd() { + currentCodePath = currentCodePath.upper; + }, + + [loopSelector](node) { + + /** + * Ignore unreachable loop statements to avoid unnecessary complexity in the implementation, or false positives otherwise. + * For unreachable segments, the code path analysis does not raise events required for this implementation. + */ + if (currentCodePath.currentSegments.some(segment => segment.reachable)) { + loopsToReport.add(node); + } + }, + + onCodePathSegmentStart(segment, node) { + if (isLoopingTarget(node)) { + const loop = node.parent; + + loopsByTargetSegments.set(segment, loop); + } + }, + + onCodePathSegmentLoop(_, toSegment, node) { + const loop = loopsByTargetSegments.get(toSegment); + + /** + * The second iteration is reachable, meaning that the loop is valid by the logic of this rule, + * only if there is at least one loop event with the appropriate target (which has been already + * determined in the `loopsByTargetSegments` map), raised from either: + * + * - the end of the loop's body (in which case `node === loop`) + * - a `continue` statement + * + * This condition skips loop events raised from `ForInStatement > .right` and `ForOfStatement > .right` nodes. + */ + if (node === loop || node.type === "ContinueStatement") { + + // Removes loop if it exists in the set. Otherwise, `Set#delete` has no effect and doesn't throw. + loopsToReport.delete(loop); + } + }, + + "Program:exit"() { + loopsToReport.forEach( + node => context.report({ node, messageId: "invalid" }) + ); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unreachable.js b/node_modules/eslint/lib/rules/no-unreachable.js new file mode 100644 index 000000000..415631a6f --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unreachable.js @@ -0,0 +1,218 @@ +/** + * @fileoverview Checks for unreachable code due to return, throws, break, and continue. + * @author Joel Feenstra + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given variable declarator has the initializer. + * @param {ASTNode} node A VariableDeclarator node to check. + * @returns {boolean} `true` if the node has the initializer. + */ +function isInitialized(node) { + return Boolean(node.init); +} + +/** + * Checks whether or not a given code path segment is unreachable. + * @param {CodePathSegment} segment A CodePathSegment to check. + * @returns {boolean} `true` if the segment is unreachable. + */ +function isUnreachable(segment) { + return !segment.reachable; +} + +/** + * The class to distinguish consecutive unreachable statements. + */ +class ConsecutiveRange { + constructor(sourceCode) { + this.sourceCode = sourceCode; + this.startNode = null; + this.endNode = null; + } + + /** + * The location object of this range. + * @type {Object} + */ + get location() { + return { + start: this.startNode.loc.start, + end: this.endNode.loc.end + }; + } + + /** + * `true` if this range is empty. + * @type {boolean} + */ + get isEmpty() { + return !(this.startNode && this.endNode); + } + + /** + * Checks whether the given node is inside of this range. + * @param {ASTNode|Token} node The node to check. + * @returns {boolean} `true` if the node is inside of this range. + */ + contains(node) { + return ( + node.range[0] >= this.startNode.range[0] && + node.range[1] <= this.endNode.range[1] + ); + } + + /** + * Checks whether the given node is consecutive to this range. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is consecutive to this range. + */ + isConsecutive(node) { + return this.contains(this.sourceCode.getTokenBefore(node)); + } + + /** + * Merges the given node to this range. + * @param {ASTNode} node The node to merge. + * @returns {void} + */ + merge(node) { + this.endNode = node; + } + + /** + * Resets this range by the given node or null. + * @param {ASTNode|null} node The node to reset, or null. + * @returns {void} + */ + reset(node) { + this.startNode = this.endNode = node; + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow unreachable code after `return`, `throw`, `continue`, and `break` statements", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-unreachable" + }, + + schema: [], + + messages: { + unreachableCode: "Unreachable code." + } + }, + + create(context) { + let currentCodePath = null; + + const range = new ConsecutiveRange(context.getSourceCode()); + + /** + * Reports a given node if it's unreachable. + * @param {ASTNode} node A statement node to report. + * @returns {void} + */ + function reportIfUnreachable(node) { + let nextNode = null; + + if (node && currentCodePath.currentSegments.every(isUnreachable)) { + + // Store this statement to distinguish consecutive statements. + if (range.isEmpty) { + range.reset(node); + return; + } + + // Skip if this statement is inside of the current range. + if (range.contains(node)) { + return; + } + + // Merge if this statement is consecutive to the current range. + if (range.isConsecutive(node)) { + range.merge(node); + return; + } + + nextNode = node; + } + + /* + * Report the current range since this statement is reachable or is + * not consecutive to the current range. + */ + if (!range.isEmpty) { + context.report({ + messageId: "unreachableCode", + loc: range.location, + node: range.startNode + }); + } + + // Update the current range. + range.reset(nextNode); + } + + return { + + // Manages the current code path. + onCodePathStart(codePath) { + currentCodePath = codePath; + }, + + onCodePathEnd() { + currentCodePath = currentCodePath.upper; + }, + + // Registers for all statement nodes (excludes FunctionDeclaration). + BlockStatement: reportIfUnreachable, + BreakStatement: reportIfUnreachable, + ClassDeclaration: reportIfUnreachable, + ContinueStatement: reportIfUnreachable, + DebuggerStatement: reportIfUnreachable, + DoWhileStatement: reportIfUnreachable, + ExpressionStatement: reportIfUnreachable, + ForInStatement: reportIfUnreachable, + ForOfStatement: reportIfUnreachable, + ForStatement: reportIfUnreachable, + IfStatement: reportIfUnreachable, + ImportDeclaration: reportIfUnreachable, + LabeledStatement: reportIfUnreachable, + ReturnStatement: reportIfUnreachable, + SwitchStatement: reportIfUnreachable, + ThrowStatement: reportIfUnreachable, + TryStatement: reportIfUnreachable, + + VariableDeclaration(node) { + if (node.kind !== "var" || node.declarations.some(isInitialized)) { + reportIfUnreachable(node); + } + }, + + WhileStatement: reportIfUnreachable, + WithStatement: reportIfUnreachable, + ExportNamedDeclaration: reportIfUnreachable, + ExportDefaultDeclaration: reportIfUnreachable, + ExportAllDeclaration: reportIfUnreachable, + + "Program:exit"() { + reportIfUnreachable(); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unsafe-finally.js b/node_modules/eslint/lib/rules/no-unsafe-finally.js new file mode 100644 index 000000000..11bf06e87 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unsafe-finally.js @@ -0,0 +1,111 @@ +/** + * @fileoverview Rule to flag unsafe statements in finally block + * @author Onur Temizkan + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SENTINEL_NODE_TYPE_RETURN_THROW = /^(?:Program|(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression)$/u; +const SENTINEL_NODE_TYPE_BREAK = /^(?:Program|(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|DoWhileStatement|WhileStatement|ForOfStatement|ForInStatement|ForStatement|SwitchStatement)$/u; +const SENTINEL_NODE_TYPE_CONTINUE = /^(?:Program|(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|DoWhileStatement|WhileStatement|ForOfStatement|ForInStatement|ForStatement)$/u; + + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow control flow statements in `finally` blocks", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-unsafe-finally" + }, + + schema: [], + + messages: { + unsafeUsage: "Unsafe usage of {{nodeType}}." + } + }, + create(context) { + + /** + * Checks if the node is the finalizer of a TryStatement + * @param {ASTNode} node node to check. + * @returns {boolean} - true if the node is the finalizer of a TryStatement + */ + function isFinallyBlock(node) { + return node.parent.type === "TryStatement" && node.parent.finalizer === node; + } + + /** + * Climbs up the tree if the node is not a sentinel node + * @param {ASTNode} node node to check. + * @param {string} label label of the break or continue statement + * @returns {boolean} - return whether the node is a finally block or a sentinel node + */ + function isInFinallyBlock(node, label) { + let labelInside = false; + let sentinelNodeType; + + if (node.type === "BreakStatement" && !node.label) { + sentinelNodeType = SENTINEL_NODE_TYPE_BREAK; + } else if (node.type === "ContinueStatement") { + sentinelNodeType = SENTINEL_NODE_TYPE_CONTINUE; + } else { + sentinelNodeType = SENTINEL_NODE_TYPE_RETURN_THROW; + } + + for ( + let currentNode = node; + currentNode && !sentinelNodeType.test(currentNode.type); + currentNode = currentNode.parent + ) { + if (currentNode.parent.label && label && (currentNode.parent.label.name === label.name)) { + labelInside = true; + } + if (isFinallyBlock(currentNode)) { + if (label && labelInside) { + return false; + } + return true; + } + } + return false; + } + + /** + * Checks whether the possibly-unsafe statement is inside a finally block. + * @param {ASTNode} node node to check. + * @returns {void} + */ + function check(node) { + if (isInFinallyBlock(node, node.label)) { + context.report({ + messageId: "unsafeUsage", + data: { + nodeType: node.type + }, + node, + line: node.loc.line, + column: node.loc.column + }); + } + } + + return { + ReturnStatement: check, + ThrowStatement: check, + BreakStatement: check, + ContinueStatement: check + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unsafe-negation.js b/node_modules/eslint/lib/rules/no-unsafe-negation.js new file mode 100644 index 000000000..a9c2ee74f --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unsafe-negation.js @@ -0,0 +1,127 @@ +/** + * @fileoverview Rule to disallow negating the left operand of relational operators + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether the given operator is `in` or `instanceof` + * @param {string} op The operator type to check. + * @returns {boolean} `true` if the operator is `in` or `instanceof` + */ +function isInOrInstanceOfOperator(op) { + return op === "in" || op === "instanceof"; +} + +/** + * Checks whether the given operator is an ordering relational operator or not. + * @param {string} op The operator type to check. + * @returns {boolean} `true` if the operator is an ordering relational operator. + */ +function isOrderingRelationalOperator(op) { + return op === "<" || op === ">" || op === ">=" || op === "<="; +} + +/** + * Checks whether the given node is a logical negation expression or not. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is a logical negation expression. + */ +function isNegation(node) { + return node.type === "UnaryExpression" && node.operator === "!"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow negating the left operand of relational operators", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-unsafe-negation", + suggestion: true + }, + + schema: [ + { + type: "object", + properties: { + enforceForOrderingRelations: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + fixable: null, + + messages: { + unexpected: "Unexpected negating the left operand of '{{operator}}' operator.", + suggestNegatedExpression: "Negate '{{operator}}' expression instead of its left operand. This changes the current behavior.", + suggestParenthesisedNegation: "Wrap negation in '()' to make the intention explicit. This preserves the current behavior." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const options = context.options[0] || {}; + const enforceForOrderingRelations = options.enforceForOrderingRelations === true; + + return { + BinaryExpression(node) { + const operator = node.operator; + const orderingRelationRuleApplies = enforceForOrderingRelations && isOrderingRelationalOperator(operator); + + if ( + (isInOrInstanceOfOperator(operator) || orderingRelationRuleApplies) && + isNegation(node.left) && + !astUtils.isParenthesised(sourceCode, node.left) + ) { + context.report({ + node, + loc: node.left.loc, + messageId: "unexpected", + data: { operator }, + suggest: [ + { + messageId: "suggestNegatedExpression", + data: { operator }, + fix(fixer) { + const negationToken = sourceCode.getFirstToken(node.left); + const fixRange = [negationToken.range[1], node.range[1]]; + const text = sourceCode.text.slice(fixRange[0], fixRange[1]); + + return fixer.replaceTextRange(fixRange, `(${text})`); + } + }, + { + messageId: "suggestParenthesisedNegation", + fix(fixer) { + return fixer.replaceText(node.left, `(${sourceCode.getText(node.left)})`); + } + } + ] + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unused-expressions.js b/node_modules/eslint/lib/rules/no-unused-expressions.js new file mode 100644 index 000000000..882a0fd1c --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unused-expressions.js @@ -0,0 +1,172 @@ +/** + * @fileoverview Flag expressions in statement position that do not side effect + * @author Michael Ficarra + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** + * Returns `true`. + * @returns {boolean} `true`. + */ +function alwaysTrue() { + return true; +} + +/** + * Returns `false`. + * @returns {boolean} `false`. + */ +function alwaysFalse() { + return false; +} + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unused expressions", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-unused-expressions" + }, + + schema: [ + { + type: "object", + properties: { + allowShortCircuit: { + type: "boolean", + default: false + }, + allowTernary: { + type: "boolean", + default: false + }, + allowTaggedTemplates: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + unusedExpression: "Expected an assignment or function call and instead saw an expression." + } + }, + + create(context) { + const config = context.options[0] || {}, + allowShortCircuit = config.allowShortCircuit || false, + allowTernary = config.allowTernary || false, + allowTaggedTemplates = config.allowTaggedTemplates || false; + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {ASTNode} node any node + * @returns {boolean} whether the given node structurally represents a directive + */ + function looksLikeDirective(node) { + return node.type === "ExpressionStatement" && + node.expression.type === "Literal" && typeof node.expression.value === "string"; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {Function} predicate ([a] -> Boolean) the function used to make the determination + * @param {a[]} list the input list + * @returns {a[]} the leading sequence of members in the given list that pass the given predicate + */ + function takeWhile(predicate, list) { + for (let i = 0; i < list.length; ++i) { + if (!predicate(list[i])) { + return list.slice(0, i); + } + } + return list.slice(); + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {ASTNode} node a Program or BlockStatement node + * @returns {ASTNode[]} the leading sequence of directive nodes in the given node's body + */ + function directives(node) { + return takeWhile(looksLikeDirective, node.body); + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {ASTNode} node any node + * @param {ASTNode[]} ancestors the given node's ancestors + * @returns {boolean} whether the given node is considered a directive in its current position + */ + function isDirective(node, ancestors) { + const parent = ancestors[ancestors.length - 1], + grandparent = ancestors[ancestors.length - 2]; + + return (parent.type === "Program" || parent.type === "BlockStatement" && + (/Function/u.test(grandparent.type))) && + directives(parent).indexOf(node) >= 0; + } + + /** + * The member functions return `true` if the type has no side-effects. + * Unknown nodes are handled as `false`, then this rule ignores those. + */ + const Checker = Object.assign(Object.create(null), { + isDisallowed(node) { + return (Checker[node.type] || alwaysFalse)(node); + }, + + ArrayExpression: alwaysTrue, + ArrowFunctionExpression: alwaysTrue, + BinaryExpression: alwaysTrue, + ChainExpression(node) { + return Checker.isDisallowed(node.expression); + }, + ClassExpression: alwaysTrue, + ConditionalExpression(node) { + if (allowTernary) { + return Checker.isDisallowed(node.consequent) || Checker.isDisallowed(node.alternate); + } + return true; + }, + FunctionExpression: alwaysTrue, + Identifier: alwaysTrue, + Literal: alwaysTrue, + LogicalExpression(node) { + if (allowShortCircuit) { + return Checker.isDisallowed(node.right); + } + return true; + }, + MemberExpression: alwaysTrue, + MetaProperty: alwaysTrue, + ObjectExpression: alwaysTrue, + SequenceExpression: alwaysTrue, + TaggedTemplateExpression() { + return !allowTaggedTemplates; + }, + TemplateLiteral: alwaysTrue, + ThisExpression: alwaysTrue, + UnaryExpression(node) { + return node.operator !== "void" && node.operator !== "delete"; + } + }); + + return { + ExpressionStatement(node) { + if (Checker.isDisallowed(node.expression) && !isDirective(node, context.getAncestors())) { + context.report({ node, messageId: "unusedExpression" }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unused-labels.js b/node_modules/eslint/lib/rules/no-unused-labels.js new file mode 100644 index 000000000..b33fcb786 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unused-labels.js @@ -0,0 +1,110 @@ +/** + * @fileoverview Rule to disallow unused labels. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unused labels", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-unused-labels" + }, + + schema: [], + + fixable: "code", + + messages: { + unused: "'{{name}}:' is defined but never used." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + let scopeInfo = null; + + /** + * Adds a scope info to the stack. + * @param {ASTNode} node A node to add. This is a LabeledStatement. + * @returns {void} + */ + function enterLabeledScope(node) { + scopeInfo = { + label: node.label.name, + used: false, + upper: scopeInfo + }; + } + + /** + * Removes the top of the stack. + * At the same time, this reports the label if it's never used. + * @param {ASTNode} node A node to report. This is a LabeledStatement. + * @returns {void} + */ + function exitLabeledScope(node) { + if (!scopeInfo.used) { + context.report({ + node: node.label, + messageId: "unused", + data: node.label, + fix(fixer) { + + /* + * Only perform a fix if there are no comments between the label and the body. This will be the case + * when there is exactly one token/comment (the ":") between the label and the body. + */ + if (sourceCode.getTokenAfter(node.label, { includeComments: true }) === + sourceCode.getTokenBefore(node.body, { includeComments: true })) { + return fixer.removeRange([node.range[0], node.body.range[0]]); + } + + return null; + } + }); + } + + scopeInfo = scopeInfo.upper; + } + + /** + * Marks the label of a given node as used. + * @param {ASTNode} node A node to mark. This is a BreakStatement or + * ContinueStatement. + * @returns {void} + */ + function markAsUsed(node) { + if (!node.label) { + return; + } + + const label = node.label.name; + let info = scopeInfo; + + while (info) { + if (info.label === label) { + info.used = true; + break; + } + info = info.upper; + } + } + + return { + LabeledStatement: enterLabeledScope, + "LabeledStatement:exit": exitLabeledScope, + BreakStatement: markAsUsed, + ContinueStatement: markAsUsed + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-unused-vars.js b/node_modules/eslint/lib/rules/no-unused-vars.js new file mode 100644 index 000000000..4dc6dc2ba --- /dev/null +++ b/node_modules/eslint/lib/rules/no-unused-vars.js @@ -0,0 +1,648 @@ +/** + * @fileoverview Rule to flag declared but unused variables + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * Bag of data used for formatting the `unusedVar` lint message. + * @typedef {Object} UnusedVarMessageData + * @property {string} varName The name of the unused var. + * @property {'defined'|'assigned a value'} action Description of the vars state. + * @property {string} additional Any additional info to be appended at the end. + */ + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow unused variables", + category: "Variables", + recommended: true, + url: "https://eslint.org/docs/rules/no-unused-vars" + }, + + schema: [ + { + oneOf: [ + { + enum: ["all", "local"] + }, + { + type: "object", + properties: { + vars: { + enum: ["all", "local"] + }, + varsIgnorePattern: { + type: "string" + }, + args: { + enum: ["all", "after-used", "none"] + }, + ignoreRestSiblings: { + type: "boolean" + }, + argsIgnorePattern: { + type: "string" + }, + caughtErrors: { + enum: ["all", "none"] + }, + caughtErrorsIgnorePattern: { + type: "string" + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + unusedVar: "'{{varName}}' is {{action}} but never used{{additional}}." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + const REST_PROPERTY_TYPE = /^(?:RestElement|(?:Experimental)?RestProperty)$/u; + + const config = { + vars: "all", + args: "after-used", + ignoreRestSiblings: false, + caughtErrors: "none" + }; + + const firstOption = context.options[0]; + + if (firstOption) { + if (typeof firstOption === "string") { + config.vars = firstOption; + } else { + config.vars = firstOption.vars || config.vars; + config.args = firstOption.args || config.args; + config.ignoreRestSiblings = firstOption.ignoreRestSiblings || config.ignoreRestSiblings; + config.caughtErrors = firstOption.caughtErrors || config.caughtErrors; + + if (firstOption.varsIgnorePattern) { + config.varsIgnorePattern = new RegExp(firstOption.varsIgnorePattern, "u"); + } + + if (firstOption.argsIgnorePattern) { + config.argsIgnorePattern = new RegExp(firstOption.argsIgnorePattern, "u"); + } + + if (firstOption.caughtErrorsIgnorePattern) { + config.caughtErrorsIgnorePattern = new RegExp(firstOption.caughtErrorsIgnorePattern, "u"); + } + } + } + + /** + * Generates the message data about the variable being defined and unused, + * including the ignore pattern if configured. + * @param {Variable} unusedVar eslint-scope variable object. + * @returns {UnusedVarMessageData} The message data to be used with this unused variable. + */ + function getDefinedMessageData(unusedVar) { + const defType = unusedVar.defs && unusedVar.defs[0] && unusedVar.defs[0].type; + let type; + let pattern; + + if (defType === "CatchClause" && config.caughtErrorsIgnorePattern) { + type = "args"; + pattern = config.caughtErrorsIgnorePattern.toString(); + } else if (defType === "Parameter" && config.argsIgnorePattern) { + type = "args"; + pattern = config.argsIgnorePattern.toString(); + } else if (defType !== "Parameter" && config.varsIgnorePattern) { + type = "vars"; + pattern = config.varsIgnorePattern.toString(); + } + + const additional = type ? `. Allowed unused ${type} must match ${pattern}` : ""; + + return { + varName: unusedVar.name, + action: "defined", + additional + }; + } + + /** + * Generate the warning message about the variable being + * assigned and unused, including the ignore pattern if configured. + * @param {Variable} unusedVar eslint-scope variable object. + * @returns {UnusedVarMessageData} The message data to be used with this unused variable. + */ + function getAssignedMessageData(unusedVar) { + const additional = config.varsIgnorePattern ? `. Allowed unused vars must match ${config.varsIgnorePattern.toString()}` : ""; + + return { + varName: unusedVar.name, + action: "assigned a value", + additional + }; + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const STATEMENT_TYPE = /(?:Statement|Declaration)$/u; + + /** + * Determines if a given variable is being exported from a module. + * @param {Variable} variable eslint-scope variable object. + * @returns {boolean} True if the variable is exported, false if not. + * @private + */ + function isExported(variable) { + + const definition = variable.defs[0]; + + if (definition) { + + let node = definition.node; + + if (node.type === "VariableDeclarator") { + node = node.parent; + } else if (definition.type === "Parameter") { + return false; + } + + return node.parent.type.indexOf("Export") === 0; + } + return false; + + } + + /** + * Determines if a variable has a sibling rest property + * @param {Variable} variable eslint-scope variable object. + * @returns {boolean} True if the variable is exported, false if not. + * @private + */ + function hasRestSpreadSibling(variable) { + if (config.ignoreRestSiblings) { + return variable.defs.some(def => { + const propertyNode = def.name.parent; + const patternNode = propertyNode.parent; + + return ( + propertyNode.type === "Property" && + patternNode.type === "ObjectPattern" && + REST_PROPERTY_TYPE.test(patternNode.properties[patternNode.properties.length - 1].type) + ); + }); + } + + return false; + } + + /** + * Determines if a reference is a read operation. + * @param {Reference} ref An eslint-scope Reference + * @returns {boolean} whether the given reference represents a read operation + * @private + */ + function isReadRef(ref) { + return ref.isRead(); + } + + /** + * Determine if an identifier is referencing an enclosing function name. + * @param {Reference} ref The reference to check. + * @param {ASTNode[]} nodes The candidate function nodes. + * @returns {boolean} True if it's a self-reference, false if not. + * @private + */ + function isSelfReference(ref, nodes) { + let scope = ref.from; + + while (scope) { + if (nodes.indexOf(scope.block) >= 0) { + return true; + } + + scope = scope.upper; + } + + return false; + } + + /** + * Gets a list of function definitions for a specified variable. + * @param {Variable} variable eslint-scope variable object. + * @returns {ASTNode[]} Function nodes. + * @private + */ + function getFunctionDefinitions(variable) { + const functionDefinitions = []; + + variable.defs.forEach(def => { + const { type, node } = def; + + // FunctionDeclarations + if (type === "FunctionName") { + functionDefinitions.push(node); + } + + // FunctionExpressions + if (type === "Variable" && node.init && + (node.init.type === "FunctionExpression" || node.init.type === "ArrowFunctionExpression")) { + functionDefinitions.push(node.init); + } + }); + return functionDefinitions; + } + + /** + * Checks the position of given nodes. + * @param {ASTNode} inner A node which is expected as inside. + * @param {ASTNode} outer A node which is expected as outside. + * @returns {boolean} `true` if the `inner` node exists in the `outer` node. + * @private + */ + function isInside(inner, outer) { + return ( + inner.range[0] >= outer.range[0] && + inner.range[1] <= outer.range[1] + ); + } + + /** + * If a given reference is left-hand side of an assignment, this gets + * the right-hand side node of the assignment. + * + * In the following cases, this returns null. + * + * - The reference is not the LHS of an assignment expression. + * - The reference is inside of a loop. + * - The reference is inside of a function scope which is different from + * the declaration. + * @param {eslint-scope.Reference} ref A reference to check. + * @param {ASTNode} prevRhsNode The previous RHS node. + * @returns {ASTNode|null} The RHS node or null. + * @private + */ + function getRhsNode(ref, prevRhsNode) { + const id = ref.identifier; + const parent = id.parent; + const grandparent = parent.parent; + const refScope = ref.from.variableScope; + const varScope = ref.resolved.scope.variableScope; + const canBeUsedLater = refScope !== varScope || astUtils.isInLoop(id); + + /* + * Inherits the previous node if this reference is in the node. + * This is for `a = a + a`-like code. + */ + if (prevRhsNode && isInside(id, prevRhsNode)) { + return prevRhsNode; + } + + if (parent.type === "AssignmentExpression" && + grandparent.type === "ExpressionStatement" && + id === parent.left && + !canBeUsedLater + ) { + return parent.right; + } + return null; + } + + /** + * Checks whether a given function node is stored to somewhere or not. + * If the function node is stored, the function can be used later. + * @param {ASTNode} funcNode A function node to check. + * @param {ASTNode} rhsNode The RHS node of the previous assignment. + * @returns {boolean} `true` if under the following conditions: + * - the funcNode is assigned to a variable. + * - the funcNode is bound as an argument of a function call. + * - the function is bound to a property and the object satisfies above conditions. + * @private + */ + function isStorableFunction(funcNode, rhsNode) { + let node = funcNode; + let parent = funcNode.parent; + + while (parent && isInside(parent, rhsNode)) { + switch (parent.type) { + case "SequenceExpression": + if (parent.expressions[parent.expressions.length - 1] !== node) { + return false; + } + break; + + case "CallExpression": + case "NewExpression": + return parent.callee !== node; + + case "AssignmentExpression": + case "TaggedTemplateExpression": + case "YieldExpression": + return true; + + default: + if (STATEMENT_TYPE.test(parent.type)) { + + /* + * If it encountered statements, this is a complex pattern. + * Since analyzing complex patterns is hard, this returns `true` to avoid false positive. + */ + return true; + } + } + + node = parent; + parent = parent.parent; + } + + return false; + } + + /** + * Checks whether a given Identifier node exists inside of a function node which can be used later. + * + * "can be used later" means: + * - the function is assigned to a variable. + * - the function is bound to a property and the object can be used later. + * - the function is bound as an argument of a function call. + * + * If a reference exists in a function which can be used later, the reference is read when the function is called. + * @param {ASTNode} id An Identifier node to check. + * @param {ASTNode} rhsNode The RHS node of the previous assignment. + * @returns {boolean} `true` if the `id` node exists inside of a function node which can be used later. + * @private + */ + function isInsideOfStorableFunction(id, rhsNode) { + const funcNode = astUtils.getUpperFunction(id); + + return ( + funcNode && + isInside(funcNode, rhsNode) && + isStorableFunction(funcNode, rhsNode) + ); + } + + /** + * Checks whether a given reference is a read to update itself or not. + * @param {eslint-scope.Reference} ref A reference to check. + * @param {ASTNode} rhsNode The RHS node of the previous assignment. + * @returns {boolean} The reference is a read to update itself. + * @private + */ + function isReadForItself(ref, rhsNode) { + const id = ref.identifier; + const parent = id.parent; + const grandparent = parent.parent; + + return ref.isRead() && ( + + // self update. e.g. `a += 1`, `a++` + (// in RHS of an assignment for itself. e.g. `a = a + 1` + (( + parent.type === "AssignmentExpression" && + grandparent.type === "ExpressionStatement" && + parent.left === id + ) || + ( + parent.type === "UpdateExpression" && + grandparent.type === "ExpressionStatement" + ) || rhsNode && + isInside(id, rhsNode) && + !isInsideOfStorableFunction(id, rhsNode))) + ); + } + + /** + * Determine if an identifier is used either in for-in loops. + * @param {Reference} ref The reference to check. + * @returns {boolean} whether reference is used in the for-in loops + * @private + */ + function isForInRef(ref) { + let target = ref.identifier.parent; + + + // "for (var ...) { return; }" + if (target.type === "VariableDeclarator") { + target = target.parent.parent; + } + + if (target.type !== "ForInStatement") { + return false; + } + + // "for (...) { return; }" + if (target.body.type === "BlockStatement") { + target = target.body.body[0]; + + // "for (...) return;" + } else { + target = target.body; + } + + // For empty loop body + if (!target) { + return false; + } + + return target.type === "ReturnStatement"; + } + + /** + * Determines if the variable is used. + * @param {Variable} variable The variable to check. + * @returns {boolean} True if the variable is used + * @private + */ + function isUsedVariable(variable) { + const functionNodes = getFunctionDefinitions(variable), + isFunctionDefinition = functionNodes.length > 0; + let rhsNode = null; + + return variable.references.some(ref => { + if (isForInRef(ref)) { + return true; + } + + const forItself = isReadForItself(ref, rhsNode); + + rhsNode = getRhsNode(ref, rhsNode); + + return ( + isReadRef(ref) && + !forItself && + !(isFunctionDefinition && isSelfReference(ref, functionNodes)) + ); + }); + } + + /** + * Checks whether the given variable is after the last used parameter. + * @param {eslint-scope.Variable} variable The variable to check. + * @returns {boolean} `true` if the variable is defined after the last + * used parameter. + */ + function isAfterLastUsedArg(variable) { + const def = variable.defs[0]; + const params = context.getDeclaredVariables(def.node); + const posteriorParams = params.slice(params.indexOf(variable) + 1); + + // If any used parameters occur after this parameter, do not report. + return !posteriorParams.some(v => v.references.length > 0 || v.eslintUsed); + } + + /** + * Gets an array of variables without read references. + * @param {Scope} scope an eslint-scope Scope object. + * @param {Variable[]} unusedVars an array that saving result. + * @returns {Variable[]} unused variables of the scope and descendant scopes. + * @private + */ + function collectUnusedVariables(scope, unusedVars) { + const variables = scope.variables; + const childScopes = scope.childScopes; + let i, l; + + if (scope.type !== "global" || config.vars === "all") { + for (i = 0, l = variables.length; i < l; ++i) { + const variable = variables[i]; + + // skip a variable of class itself name in the class scope + if (scope.type === "class" && scope.block.id === variable.identifiers[0]) { + continue; + } + + // skip function expression names and variables marked with markVariableAsUsed() + if (scope.functionExpressionScope || variable.eslintUsed) { + continue; + } + + // skip implicit "arguments" variable + if (scope.type === "function" && variable.name === "arguments" && variable.identifiers.length === 0) { + continue; + } + + // explicit global variables don't have definitions. + const def = variable.defs[0]; + + if (def) { + const type = def.type; + + // skip catch variables + if (type === "CatchClause") { + if (config.caughtErrors === "none") { + continue; + } + + // skip ignored parameters + if (config.caughtErrorsIgnorePattern && config.caughtErrorsIgnorePattern.test(def.name.name)) { + continue; + } + } + + if (type === "Parameter") { + + // skip any setter argument + if ((def.node.parent.type === "Property" || def.node.parent.type === "MethodDefinition") && def.node.parent.kind === "set") { + continue; + } + + // if "args" option is "none", skip any parameter + if (config.args === "none") { + continue; + } + + // skip ignored parameters + if (config.argsIgnorePattern && config.argsIgnorePattern.test(def.name.name)) { + continue; + } + + // if "args" option is "after-used", skip used variables + if (config.args === "after-used" && astUtils.isFunction(def.name.parent) && !isAfterLastUsedArg(variable)) { + continue; + } + } else { + + // skip ignored variables + if (config.varsIgnorePattern && config.varsIgnorePattern.test(def.name.name)) { + continue; + } + } + } + + if (!isUsedVariable(variable) && !isExported(variable) && !hasRestSpreadSibling(variable)) { + unusedVars.push(variable); + } + } + } + + for (i = 0, l = childScopes.length; i < l; ++i) { + collectUnusedVariables(childScopes[i], unusedVars); + } + + return unusedVars; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + "Program:exit"(programNode) { + const unusedVars = collectUnusedVariables(context.getScope(), []); + + for (let i = 0, l = unusedVars.length; i < l; ++i) { + const unusedVar = unusedVars[i]; + + // Report the first declaration. + if (unusedVar.defs.length > 0) { + context.report({ + node: unusedVar.references.length ? unusedVar.references[ + unusedVar.references.length - 1 + ].identifier : unusedVar.identifiers[0], + messageId: "unusedVar", + data: unusedVar.references.some(ref => ref.isWrite()) + ? getAssignedMessageData(unusedVar) + : getDefinedMessageData(unusedVar) + }); + + // If there are no regular declaration, report the first `/*globals*/` comment directive. + } else if (unusedVar.eslintExplicitGlobalComments) { + const directiveComment = unusedVar.eslintExplicitGlobalComments[0]; + + context.report({ + node: programNode, + loc: astUtils.getNameLocationInGlobalDirectiveComment(sourceCode, directiveComment, unusedVar.name), + messageId: "unusedVar", + data: getDefinedMessageData(unusedVar) + }); + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/no-use-before-define.js b/node_modules/eslint/lib/rules/no-use-before-define.js new file mode 100644 index 000000000..c7300567e --- /dev/null +++ b/node_modules/eslint/lib/rules/no-use-before-define.js @@ -0,0 +1,233 @@ +/** + * @fileoverview Rule to flag use of variables before they are defined + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SENTINEL_TYPE = /^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/u; +const FOR_IN_OF_TYPE = /^For(?:In|Of)Statement$/u; + +/** + * Parses a given value as options. + * @param {any} options A value to parse. + * @returns {Object} The parsed options. + */ +function parseOptions(options) { + let functions = true; + let classes = true; + let variables = true; + + if (typeof options === "string") { + functions = (options !== "nofunc"); + } else if (typeof options === "object" && options !== null) { + functions = options.functions !== false; + classes = options.classes !== false; + variables = options.variables !== false; + } + + return { functions, classes, variables }; +} + +/** + * Checks whether or not a given variable is a function declaration. + * @param {eslint-scope.Variable} variable A variable to check. + * @returns {boolean} `true` if the variable is a function declaration. + */ +function isFunction(variable) { + return variable.defs[0].type === "FunctionName"; +} + +/** + * Checks whether or not a given variable is a class declaration in an upper function scope. + * @param {eslint-scope.Variable} variable A variable to check. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the variable is a class declaration. + */ +function isOuterClass(variable, reference) { + return ( + variable.defs[0].type === "ClassName" && + variable.scope.variableScope !== reference.from.variableScope + ); +} + +/** + * Checks whether or not a given variable is a variable declaration in an upper function scope. + * @param {eslint-scope.Variable} variable A variable to check. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the variable is a variable declaration. + */ +function isOuterVariable(variable, reference) { + return ( + variable.defs[0].type === "Variable" && + variable.scope.variableScope !== reference.from.variableScope + ); +} + +/** + * Checks whether or not a given location is inside of the range of a given node. + * @param {ASTNode} node An node to check. + * @param {number} location A location to check. + * @returns {boolean} `true` if the location is inside of the range of the node. + */ +function isInRange(node, location) { + return node && node.range[0] <= location && location <= node.range[1]; +} + +/** + * Checks whether or not a given reference is inside of the initializers of a given variable. + * + * This returns `true` in the following cases: + * + * var a = a + * var [a = a] = list + * var {a = a} = obj + * for (var a in a) {} + * for (var a of a) {} + * @param {Variable} variable A variable to check. + * @param {Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is inside of the initializers. + */ +function isInInitializer(variable, reference) { + if (variable.scope !== reference.from) { + return false; + } + + let node = variable.identifiers[0].parent; + const location = reference.identifier.range[1]; + + while (node) { + if (node.type === "VariableDeclarator") { + if (isInRange(node.init, location)) { + return true; + } + if (FOR_IN_OF_TYPE.test(node.parent.parent.type) && + isInRange(node.parent.parent.right, location) + ) { + return true; + } + break; + } else if (node.type === "AssignmentPattern") { + if (isInRange(node.right, location)) { + return true; + } + } else if (SENTINEL_TYPE.test(node.type)) { + break; + } + + node = node.parent; + } + + return false; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow the use of variables before they are defined", + category: "Variables", + recommended: false, + url: "https://eslint.org/docs/rules/no-use-before-define" + }, + + schema: [ + { + oneOf: [ + { + enum: ["nofunc"] + }, + { + type: "object", + properties: { + functions: { type: "boolean" }, + classes: { type: "boolean" }, + variables: { type: "boolean" } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + usedBeforeDefined: "'{{name}}' was used before it was defined." + } + }, + + create(context) { + const options = parseOptions(context.options[0]); + + /** + * Determines whether a given use-before-define case should be reported according to the options. + * @param {eslint-scope.Variable} variable The variable that gets used before being defined + * @param {eslint-scope.Reference} reference The reference to the variable + * @returns {boolean} `true` if the usage should be reported + */ + function isForbidden(variable, reference) { + if (isFunction(variable)) { + return options.functions; + } + if (isOuterClass(variable, reference)) { + return options.classes; + } + if (isOuterVariable(variable, reference)) { + return options.variables; + } + return true; + } + + /** + * Finds and validates all variables in a given scope. + * @param {Scope} scope The scope object. + * @returns {void} + * @private + */ + function findVariablesInScope(scope) { + scope.references.forEach(reference => { + const variable = reference.resolved; + + /* + * Skips when the reference is: + * - initialization's. + * - referring to an undefined variable. + * - referring to a global environment variable (there're no identifiers). + * - located preceded by the variable (except in initializers). + * - allowed by options. + */ + if (reference.init || + !variable || + variable.identifiers.length === 0 || + (variable.identifiers[0].range[1] < reference.identifier.range[1] && !isInInitializer(variable, reference)) || + !isForbidden(variable, reference) + ) { + return; + } + + // Reports. + context.report({ + node: reference.identifier, + messageId: "usedBeforeDefined", + data: reference.identifier + }); + }); + + scope.childScopes.forEach(findVariablesInScope); + } + + return { + Program() { + findVariablesInScope(context.getScope()); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-backreference.js b/node_modules/eslint/lib/rules/no-useless-backreference.js new file mode 100644 index 000000000..958e3d5dd --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-backreference.js @@ -0,0 +1,193 @@ +/** + * @fileoverview Rule to disallow useless backreferences in regular expressions + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { CALL, CONSTRUCT, ReferenceTracker, getStringIfConstant } = require("eslint-utils"); +const { RegExpParser, visitRegExpAST } = require("regexpp"); +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const parser = new RegExpParser(); + +/** + * Finds the path from the given `regexpp` AST node to the root node. + * @param {regexpp.Node} node Node. + * @returns {regexpp.Node[]} Array that starts with the given node and ends with the root node. + */ +function getPathToRoot(node) { + const path = []; + let current = node; + + do { + path.push(current); + current = current.parent; + } while (current); + + return path; +} + +/** + * Determines whether the given `regexpp` AST node is a lookaround node. + * @param {regexpp.Node} node Node. + * @returns {boolean} `true` if it is a lookaround node. + */ +function isLookaround(node) { + return node.type === "Assertion" && + (node.kind === "lookahead" || node.kind === "lookbehind"); +} + +/** + * Determines whether the given `regexpp` AST node is a negative lookaround node. + * @param {regexpp.Node} node Node. + * @returns {boolean} `true` if it is a negative lookaround node. + */ +function isNegativeLookaround(node) { + return isLookaround(node) && node.negate; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow useless backreferences in regular expressions", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-useless-backreference" + }, + + schema: [], + + messages: { + nested: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}' from within that group.", + forward: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}' which appears later in the pattern.", + backward: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}' which appears before in the same lookbehind.", + disjunctive: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}' which is in another alternative.", + intoNegativeLookaround: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}' which is in a negative lookaround." + } + }, + + create(context) { + + /** + * Checks and reports useless backreferences in the given regular expression. + * @param {ASTNode} node Node that represents regular expression. A regex literal or RegExp constructor call. + * @param {string} pattern Regular expression pattern. + * @param {string} flags Regular expression flags. + * @returns {void} + */ + function checkRegex(node, pattern, flags) { + let regExpAST; + + try { + regExpAST = parser.parsePattern(pattern, 0, pattern.length, flags.includes("u")); + } catch { + + // Ignore regular expressions with syntax errors + return; + } + + visitRegExpAST(regExpAST, { + onBackreferenceEnter(bref) { + const group = bref.resolved, + brefPath = getPathToRoot(bref), + groupPath = getPathToRoot(group); + let messageId = null; + + if (brefPath.includes(group)) { + + // group is bref's ancestor => bref is nested ('nested reference') => group hasn't matched yet when bref starts to match. + messageId = "nested"; + } else { + + // Start from the root to find the lowest common ancestor. + let i = brefPath.length - 1, + j = groupPath.length - 1; + + do { + i--; + j--; + } while (brefPath[i] === groupPath[j]); + + const indexOfLowestCommonAncestor = j + 1, + groupCut = groupPath.slice(0, indexOfLowestCommonAncestor), + commonPath = groupPath.slice(indexOfLowestCommonAncestor), + lowestCommonLookaround = commonPath.find(isLookaround), + isMatchingBackward = lowestCommonLookaround && lowestCommonLookaround.kind === "lookbehind"; + + if (!isMatchingBackward && bref.end <= group.start) { + + // bref is left, group is right ('forward reference') => group hasn't matched yet when bref starts to match. + messageId = "forward"; + } else if (isMatchingBackward && group.end <= bref.start) { + + // the opposite of the previous when the regex is matching backward in a lookbehind context. + messageId = "backward"; + } else if (lodash.last(groupCut).type === "Alternative") { + + // group's and bref's ancestor nodes below the lowest common ancestor are sibling alternatives => they're disjunctive. + messageId = "disjunctive"; + } else if (groupCut.some(isNegativeLookaround)) { + + // group is in a negative lookaround which isn't bref's ancestor => group has already failed when bref starts to match. + messageId = "intoNegativeLookaround"; + } + } + + if (messageId) { + context.report({ + node, + messageId, + data: { + bref: bref.raw, + group: group.raw + } + }); + } + } + }); + } + + return { + "Literal[regex]"(node) { + const { pattern, flags } = node.regex; + + checkRegex(node, pattern, flags); + }, + Program() { + const scope = context.getScope(), + tracker = new ReferenceTracker(scope), + traceMap = { + RegExp: { + [CALL]: true, + [CONSTRUCT]: true + } + }; + + for (const { node } of tracker.iterateGlobalReferences(traceMap)) { + const [patternNode, flagsNode] = node.arguments, + pattern = getStringIfConstant(patternNode, scope), + flags = getStringIfConstant(flagsNode, scope); + + if (typeof pattern === "string") { + checkRegex(node, pattern, flags || ""); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-call.js b/node_modules/eslint/lib/rules/no-useless-call.js new file mode 100644 index 000000000..b1382a2fa --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-call.js @@ -0,0 +1,90 @@ +/** + * @fileoverview A rule to disallow unnecessary `.call()` and `.apply()`. + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a node is a `.call()`/`.apply()`. + * @param {ASTNode} node A CallExpression node to check. + * @returns {boolean} Whether or not the node is a `.call()`/`.apply()`. + */ +function isCallOrNonVariadicApply(node) { + const callee = astUtils.skipChainExpression(node.callee); + + return ( + callee.type === "MemberExpression" && + callee.property.type === "Identifier" && + callee.computed === false && + ( + (callee.property.name === "call" && node.arguments.length >= 1) || + (callee.property.name === "apply" && node.arguments.length === 2 && node.arguments[1].type === "ArrayExpression") + ) + ); +} + + +/** + * Checks whether or not `thisArg` is not changed by `.call()`/`.apply()`. + * @param {ASTNode|null} expectedThis The node that is the owner of the applied function. + * @param {ASTNode} thisArg The node that is given to the first argument of the `.call()`/`.apply()`. + * @param {SourceCode} sourceCode The ESLint source code object. + * @returns {boolean} Whether or not `thisArg` is not changed by `.call()`/`.apply()`. + */ +function isValidThisArg(expectedThis, thisArg, sourceCode) { + if (!expectedThis) { + return astUtils.isNullOrUndefined(thisArg); + } + return astUtils.equalTokens(expectedThis, thisArg, sourceCode); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary calls to `.call()` and `.apply()`", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-useless-call" + }, + + schema: [], + + messages: { + unnecessaryCall: "Unnecessary '.{{name}}()'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + CallExpression(node) { + if (!isCallOrNonVariadicApply(node)) { + return; + } + + const callee = astUtils.skipChainExpression(node.callee); + const applied = astUtils.skipChainExpression(callee.object); + const expectedThis = (applied.type === "MemberExpression") ? applied.object : null; + const thisArg = node.arguments[0]; + + if (isValidThisArg(expectedThis, thisArg, sourceCode)) { + context.report({ node, messageId: "unnecessaryCall", data: { name: callee.property.name } }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-catch.js b/node_modules/eslint/lib/rules/no-useless-catch.js new file mode 100644 index 000000000..f303c2729 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-catch.js @@ -0,0 +1,57 @@ +/** + * @fileoverview Reports useless `catch` clauses that just rethrow their error. + * @author Teddy Katz + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary `catch` clauses", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-useless-catch" + }, + + schema: [], + + messages: { + unnecessaryCatchClause: "Unnecessary catch clause.", + unnecessaryCatch: "Unnecessary try/catch wrapper." + } + }, + + create(context) { + return { + CatchClause(node) { + if ( + node.param && + node.param.type === "Identifier" && + node.body.body.length && + node.body.body[0].type === "ThrowStatement" && + node.body.body[0].argument.type === "Identifier" && + node.body.body[0].argument.name === node.param.name + ) { + if (node.parent.finalizer) { + context.report({ + node, + messageId: "unnecessaryCatchClause" + }); + } else { + context.report({ + node: node.parent, + messageId: "unnecessaryCatch" + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-computed-key.js b/node_modules/eslint/lib/rules/no-useless-computed-key.js new file mode 100644 index 000000000..e0505a318 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-computed-key.js @@ -0,0 +1,103 @@ +/** + * @fileoverview Rule to disallow unnecessary computed property keys in object literals + * @author Burak Yigit Kaya + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary computed property keys in objects and classes", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/no-useless-computed-key" + }, + + schema: [{ + type: "object", + properties: { + enforceForClassMembers: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], + fixable: "code", + + messages: { + unnecessarilyComputedProperty: "Unnecessarily computed property [{{property}}] found." + } + }, + create(context) { + const sourceCode = context.getSourceCode(); + const enforceForClassMembers = context.options[0] && context.options[0].enforceForClassMembers; + + /** + * Reports a given node if it violated this rule. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function check(node) { + if (!node.computed) { + return; + } + + const key = node.key, + nodeType = typeof key.value; + + let allowedKey; + + if (node.type === "MethodDefinition") { + allowedKey = node.static ? "prototype" : "constructor"; + } else { + allowedKey = "__proto__"; + } + + if (key.type === "Literal" && (nodeType === "string" || nodeType === "number") && key.value !== allowedKey) { + context.report({ + node, + messageId: "unnecessarilyComputedProperty", + data: { property: sourceCode.getText(key) }, + fix(fixer) { + const leftSquareBracket = sourceCode.getTokenBefore(key, astUtils.isOpeningBracketToken); + const rightSquareBracket = sourceCode.getTokenAfter(key, astUtils.isClosingBracketToken); + + // If there are comments between the brackets and the property name, don't do a fix. + if (sourceCode.commentsExistBetween(leftSquareBracket, rightSquareBracket)) { + return null; + } + + const tokenBeforeLeftBracket = sourceCode.getTokenBefore(leftSquareBracket); + + // Insert a space before the key to avoid changing identifiers, e.g. ({ get[2]() {} }) to ({ get2() {} }) + const needsSpaceBeforeKey = tokenBeforeLeftBracket.range[1] === leftSquareBracket.range[0] && + !astUtils.canTokensBeAdjacent(tokenBeforeLeftBracket, sourceCode.getFirstToken(key)); + + const replacementKey = (needsSpaceBeforeKey ? " " : "") + key.raw; + + return fixer.replaceTextRange([leftSquareBracket.range[0], rightSquareBracket.range[1]], replacementKey); + } + }); + } + } + + return { + Property: check, + MethodDefinition: enforceForClassMembers ? check : lodash.noop + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-concat.js b/node_modules/eslint/lib/rules/no-useless-concat.js new file mode 100644 index 000000000..cfc60c8fb --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-concat.js @@ -0,0 +1,115 @@ +/** + * @fileoverview disallow unnecessary concatenation of template strings + * @author Henry Zhu + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a concatenation. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a concatenation. + */ +function isConcatenation(node) { + return node.type === "BinaryExpression" && node.operator === "+"; +} + +/** + * Checks if the given token is a `+` token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a `+` token. + */ +function isConcatOperatorToken(token) { + return token.value === "+" && token.type === "Punctuator"; +} + +/** + * Get's the right most node on the left side of a BinaryExpression with + operator. + * @param {ASTNode} node A BinaryExpression node to check. + * @returns {ASTNode} node + */ +function getLeft(node) { + let left = node.left; + + while (isConcatenation(left)) { + left = left.right; + } + return left; +} + +/** + * Get's the left most node on the right side of a BinaryExpression with + operator. + * @param {ASTNode} node A BinaryExpression node to check. + * @returns {ASTNode} node + */ +function getRight(node) { + let right = node.right; + + while (isConcatenation(right)) { + right = right.left; + } + return right; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary concatenation of literals or template literals", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-useless-concat" + }, + + schema: [], + + messages: { + unexpectedConcat: "Unexpected string concatenation of literals." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + BinaryExpression(node) { + + // check if not concatenation + if (node.operator !== "+") { + return; + } + + // account for the `foo + "a" + "b"` case + const left = getLeft(node); + const right = getRight(node); + + if (astUtils.isStringLiteral(left) && + astUtils.isStringLiteral(right) && + astUtils.isTokenOnSameLine(left, right) + ) { + const operatorToken = sourceCode.getFirstTokenBetween(left, right, isConcatOperatorToken); + + context.report({ + node, + loc: operatorToken.loc, + messageId: "unexpectedConcat" + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-constructor.js b/node_modules/eslint/lib/rules/no-useless-constructor.js new file mode 100644 index 000000000..4c34aeda7 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-constructor.js @@ -0,0 +1,181 @@ +/** + * @fileoverview Rule to flag the use of redundant constructors in classes. + * @author Alberto Rodríguez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether a given array of statements is a single call of `super`. + * @param {ASTNode[]} body An array of statements to check. + * @returns {boolean} `true` if the body is a single call of `super`. + */ +function isSingleSuperCall(body) { + return ( + body.length === 1 && + body[0].type === "ExpressionStatement" && + body[0].expression.type === "CallExpression" && + body[0].expression.callee.type === "Super" + ); +} + +/** + * Checks whether a given node is a pattern which doesn't have any side effects. + * Default parameters and Destructuring parameters can have side effects. + * @param {ASTNode} node A pattern node. + * @returns {boolean} `true` if the node doesn't have any side effects. + */ +function isSimple(node) { + return node.type === "Identifier" || node.type === "RestElement"; +} + +/** + * Checks whether a given array of expressions is `...arguments` or not. + * `super(...arguments)` passes all arguments through. + * @param {ASTNode[]} superArgs An array of expressions to check. + * @returns {boolean} `true` if the superArgs is `...arguments`. + */ +function isSpreadArguments(superArgs) { + return ( + superArgs.length === 1 && + superArgs[0].type === "SpreadElement" && + superArgs[0].argument.type === "Identifier" && + superArgs[0].argument.name === "arguments" + ); +} + +/** + * Checks whether given 2 nodes are identifiers which have the same name or not. + * @param {ASTNode} ctorParam A node to check. + * @param {ASTNode} superArg A node to check. + * @returns {boolean} `true` if the nodes are identifiers which have the same + * name. + */ +function isValidIdentifierPair(ctorParam, superArg) { + return ( + ctorParam.type === "Identifier" && + superArg.type === "Identifier" && + ctorParam.name === superArg.name + ); +} + +/** + * Checks whether given 2 nodes are a rest/spread pair which has the same values. + * @param {ASTNode} ctorParam A node to check. + * @param {ASTNode} superArg A node to check. + * @returns {boolean} `true` if the nodes are a rest/spread pair which has the + * same values. + */ +function isValidRestSpreadPair(ctorParam, superArg) { + return ( + ctorParam.type === "RestElement" && + superArg.type === "SpreadElement" && + isValidIdentifierPair(ctorParam.argument, superArg.argument) + ); +} + +/** + * Checks whether given 2 nodes have the same value or not. + * @param {ASTNode} ctorParam A node to check. + * @param {ASTNode} superArg A node to check. + * @returns {boolean} `true` if the nodes have the same value or not. + */ +function isValidPair(ctorParam, superArg) { + return ( + isValidIdentifierPair(ctorParam, superArg) || + isValidRestSpreadPair(ctorParam, superArg) + ); +} + +/** + * Checks whether the parameters of a constructor and the arguments of `super()` + * have the same values or not. + * @param {ASTNode} ctorParams The parameters of a constructor to check. + * @param {ASTNode} superArgs The arguments of `super()` to check. + * @returns {boolean} `true` if those have the same values. + */ +function isPassingThrough(ctorParams, superArgs) { + if (ctorParams.length !== superArgs.length) { + return false; + } + + for (let i = 0; i < ctorParams.length; ++i) { + if (!isValidPair(ctorParams[i], superArgs[i])) { + return false; + } + } + + return true; +} + +/** + * Checks whether the constructor body is a redundant super call. + * @param {Array} body constructor body content. + * @param {Array} ctorParams The params to check against super call. + * @returns {boolean} true if the constructor body is redundant + */ +function isRedundantSuperCall(body, ctorParams) { + return ( + isSingleSuperCall(body) && + ctorParams.every(isSimple) && + ( + isSpreadArguments(body[0].expression.arguments) || + isPassingThrough(ctorParams, body[0].expression.arguments) + ) + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary constructors", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/no-useless-constructor" + }, + + schema: [], + + messages: { + noUselessConstructor: "Useless constructor." + } + }, + + create(context) { + + /** + * Checks whether a node is a redundant constructor + * @param {ASTNode} node node to check + * @returns {void} + */ + function checkForConstructor(node) { + if (node.kind !== "constructor") { + return; + } + + const body = node.value.body.body; + const ctorParams = node.value.params; + const superClass = node.parent.parent.superClass; + + if (superClass ? isRedundantSuperCall(body, ctorParams) : (body.length === 0)) { + context.report({ + node, + messageId: "noUselessConstructor" + }); + } + } + + return { + MethodDefinition: checkForConstructor + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-escape.js b/node_modules/eslint/lib/rules/no-useless-escape.js new file mode 100644 index 000000000..8057e44dd --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-escape.js @@ -0,0 +1,252 @@ +/** + * @fileoverview Look for useless escapes in strings and regexes + * @author Onur Temizkan + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** + * Returns the union of two sets. + * @param {Set} setA The first set + * @param {Set} setB The second set + * @returns {Set} The union of the two sets + */ +function union(setA, setB) { + return new Set(function *() { + yield* setA; + yield* setB; + }()); +} + +const VALID_STRING_ESCAPES = union(new Set("\\nrvtbfux"), astUtils.LINEBREAKS); +const REGEX_GENERAL_ESCAPES = new Set("\\bcdDfnpPrsStvwWxu0123456789]"); +const REGEX_NON_CHARCLASS_ESCAPES = union(REGEX_GENERAL_ESCAPES, new Set("^/.$*+?[{}|()Bk")); + +/** + * Parses a regular expression into a list of characters with character class info. + * @param {string} regExpText The raw text used to create the regular expression + * @returns {Object[]} A list of characters, each with info on escaping and whether they're in a character class. + * @example + * + * parseRegExp('a\\b[cd-]') + * + * returns: + * [ + * {text: 'a', index: 0, escaped: false, inCharClass: false, startsCharClass: false, endsCharClass: false}, + * {text: 'b', index: 2, escaped: true, inCharClass: false, startsCharClass: false, endsCharClass: false}, + * {text: 'c', index: 4, escaped: false, inCharClass: true, startsCharClass: true, endsCharClass: false}, + * {text: 'd', index: 5, escaped: false, inCharClass: true, startsCharClass: false, endsCharClass: false}, + * {text: '-', index: 6, escaped: false, inCharClass: true, startsCharClass: false, endsCharClass: false} + * ] + */ +function parseRegExp(regExpText) { + const charList = []; + + regExpText.split("").reduce((state, char, index) => { + if (!state.escapeNextChar) { + if (char === "\\") { + return Object.assign(state, { escapeNextChar: true }); + } + if (char === "[" && !state.inCharClass) { + return Object.assign(state, { inCharClass: true, startingCharClass: true }); + } + if (char === "]" && state.inCharClass) { + if (charList.length && charList[charList.length - 1].inCharClass) { + charList[charList.length - 1].endsCharClass = true; + } + return Object.assign(state, { inCharClass: false, startingCharClass: false }); + } + } + charList.push({ + text: char, + index, + escaped: state.escapeNextChar, + inCharClass: state.inCharClass, + startsCharClass: state.startingCharClass, + endsCharClass: false + }); + return Object.assign(state, { escapeNextChar: false, startingCharClass: false }); + }, { escapeNextChar: false, inCharClass: false, startingCharClass: false }); + + return charList; +} + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary escape characters", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-useless-escape", + suggestion: true + }, + + messages: { + unnecessaryEscape: "Unnecessary escape character: \\{{character}}.", + removeEscape: "Remove the `\\`. This maintains the current functionality.", + escapeBackslash: "Replace the `\\` with `\\\\` to include the actual backslash character." + }, + + schema: [] + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Reports a node + * @param {ASTNode} node The node to report + * @param {number} startOffset The backslash's offset from the start of the node + * @param {string} character The uselessly escaped character (not including the backslash) + * @returns {void} + */ + function report(node, startOffset, character) { + const start = sourceCode.getLocFromIndex(sourceCode.getIndexFromLoc(node.loc.start) + startOffset); + const rangeStart = sourceCode.getIndexFromLoc(node.loc.start) + startOffset; + const range = [rangeStart, rangeStart + 1]; + + context.report({ + node, + loc: { + start, + end: { line: start.line, column: start.column + 1 } + }, + messageId: "unnecessaryEscape", + data: { character }, + suggest: [ + { + messageId: "removeEscape", + fix(fixer) { + return fixer.removeRange(range); + } + }, + { + messageId: "escapeBackslash", + fix(fixer) { + return fixer.insertTextBeforeRange(range, "\\"); + } + } + ] + }); + } + + /** + * Checks if the escape character in given string slice is unnecessary. + * @private + * @param {ASTNode} node node to validate. + * @param {string} match string slice to validate. + * @returns {void} + */ + function validateString(node, match) { + const isTemplateElement = node.type === "TemplateElement"; + const escapedChar = match[0][1]; + let isUnnecessaryEscape = !VALID_STRING_ESCAPES.has(escapedChar); + let isQuoteEscape; + + if (isTemplateElement) { + isQuoteEscape = escapedChar === "`"; + + if (escapedChar === "$") { + + // Warn if `\$` is not followed by `{` + isUnnecessaryEscape = match.input[match.index + 2] !== "{"; + } else if (escapedChar === "{") { + + /* + * Warn if `\{` is not preceded by `$`. If preceded by `$`, escaping + * is necessary and the rule should not warn. If preceded by `/$`, the rule + * will warn for the `/$` instead, as it is the first unnecessarily escaped character. + */ + isUnnecessaryEscape = match.input[match.index - 1] !== "$"; + } + } else { + isQuoteEscape = escapedChar === node.raw[0]; + } + + if (isUnnecessaryEscape && !isQuoteEscape) { + report(node, match.index + 1, match[0].slice(1)); + } + } + + /** + * Checks if a node has an escape. + * @param {ASTNode} node node to check. + * @returns {void} + */ + function check(node) { + const isTemplateElement = node.type === "TemplateElement"; + + if ( + isTemplateElement && + node.parent && + node.parent.parent && + node.parent.parent.type === "TaggedTemplateExpression" && + node.parent === node.parent.parent.quasi + ) { + + // Don't report tagged template literals, because the backslash character is accessible to the tag function. + return; + } + + if (typeof node.value === "string" || isTemplateElement) { + + /* + * JSXAttribute doesn't have any escape sequence: https://facebook.github.io/jsx/. + * In addition, backticks are not supported by JSX yet: https://github.com/facebook/jsx/issues/25. + */ + if (node.parent.type === "JSXAttribute" || node.parent.type === "JSXElement" || node.parent.type === "JSXFragment") { + return; + } + + const value = isTemplateElement ? node.value.raw : node.raw.slice(1, -1); + const pattern = /\\[^\d]/gu; + let match; + + while ((match = pattern.exec(value))) { + validateString(node, match); + } + } else if (node.regex) { + parseRegExp(node.regex.pattern) + + /* + * The '-' character is a special case, because it's only valid to escape it if it's in a character + * class, and is not at either edge of the character class. To account for this, don't consider '-' + * characters to be valid in general, and filter out '-' characters that appear in the middle of a + * character class. + */ + .filter(charInfo => !(charInfo.text === "-" && charInfo.inCharClass && !charInfo.startsCharClass && !charInfo.endsCharClass)) + + /* + * The '^' character is also a special case; it must always be escaped outside of character classes, but + * it only needs to be escaped in character classes if it's at the beginning of the character class. To + * account for this, consider it to be a valid escape character outside of character classes, and filter + * out '^' characters that appear at the start of a character class. + */ + .filter(charInfo => !(charInfo.text === "^" && charInfo.startsCharClass)) + + // Filter out characters that aren't escaped. + .filter(charInfo => charInfo.escaped) + + // Filter out characters that are valid to escape, based on their position in the regular expression. + .filter(charInfo => !(charInfo.inCharClass ? REGEX_GENERAL_ESCAPES : REGEX_NON_CHARCLASS_ESCAPES).has(charInfo.text)) + + // Report all the remaining characters. + .forEach(charInfo => report(node, charInfo.index, charInfo.text)); + } + + } + + return { + Literal: check, + TemplateElement: check + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-rename.js b/node_modules/eslint/lib/rules/no-useless-rename.js new file mode 100644 index 000000000..fa88f37f5 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-rename.js @@ -0,0 +1,168 @@ +/** + * @fileoverview Disallow renaming import, export, and destructured assignments to the same name. + * @author Kai Cataldo + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow renaming import, export, and destructured assignments to the same name", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/no-useless-rename" + }, + + fixable: "code", + + schema: [ + { + type: "object", + properties: { + ignoreDestructuring: { type: "boolean", default: false }, + ignoreImport: { type: "boolean", default: false }, + ignoreExport: { type: "boolean", default: false } + }, + additionalProperties: false + } + ], + + messages: { + unnecessarilyRenamed: "{{type}} {{name}} unnecessarily renamed." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(), + options = context.options[0] || {}, + ignoreDestructuring = options.ignoreDestructuring === true, + ignoreImport = options.ignoreImport === true, + ignoreExport = options.ignoreExport === true; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports error for unnecessarily renamed assignments + * @param {ASTNode} node node to report + * @param {ASTNode} initial node with initial name value + * @param {ASTNode} result node with new name value + * @param {string} type the type of the offending node + * @returns {void} + */ + function reportError(node, initial, result, type) { + const name = initial.type === "Identifier" ? initial.name : initial.value; + + return context.report({ + node, + messageId: "unnecessarilyRenamed", + data: { + name, + type + }, + fix(fixer) { + if (sourceCode.commentsExistBetween(initial, result)) { + return null; + } + + const replacementText = result.type === "AssignmentPattern" + ? sourceCode.getText(result) + : name; + + return fixer.replaceTextRange([ + initial.range[0], + result.range[1] + ], replacementText); + } + }); + } + + /** + * Checks whether a destructured assignment is unnecessarily renamed + * @param {ASTNode} node node to check + * @returns {void} + */ + function checkDestructured(node) { + if (ignoreDestructuring) { + return; + } + + for (const property of node.properties) { + + /* + * TODO: Remove after babel-eslint removes ExperimentalRestProperty + * https://github.com/eslint/eslint/issues/12335 + */ + if (property.type === "ExperimentalRestProperty") { + continue; + } + + /** + * Properties using shorthand syntax and rest elements can not be renamed. + * If the property is computed, we have no idea if a rename is useless or not. + */ + if (property.shorthand || property.type === "RestElement" || property.computed) { + continue; + } + + const key = (property.key.type === "Identifier" && property.key.name) || (property.key.type === "Literal" && property.key.value); + const renamedKey = property.value.type === "AssignmentPattern" ? property.value.left.name : property.value.name; + + if (key === renamedKey) { + reportError(property, property.key, property.value, "Destructuring assignment"); + } + } + } + + /** + * Checks whether an import is unnecessarily renamed + * @param {ASTNode} node node to check + * @returns {void} + */ + function checkImport(node) { + if (ignoreImport) { + return; + } + + if (node.imported.name === node.local.name && + node.imported.range[0] !== node.local.range[0]) { + reportError(node, node.imported, node.local, "Import"); + } + } + + /** + * Checks whether an export is unnecessarily renamed + * @param {ASTNode} node node to check + * @returns {void} + */ + function checkExport(node) { + if (ignoreExport) { + return; + } + + if (node.local.name === node.exported.name && + node.local.range[0] !== node.exported.range[0]) { + reportError(node, node.local, node.exported, "Export"); + } + + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ObjectPattern: checkDestructured, + ImportSpecifier: checkImport, + ExportSpecifier: checkExport + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-useless-return.js b/node_modules/eslint/lib/rules/no-useless-return.js new file mode 100644 index 000000000..111cb2101 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-useless-return.js @@ -0,0 +1,305 @@ +/** + * @fileoverview Disallow redundant return statements + * @author Teddy Katz + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"), + FixTracker = require("./utils/fix-tracker"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Removes the given element from the array. + * @param {Array} array The source array to remove. + * @param {any} element The target item to remove. + * @returns {void} + */ +function remove(array, element) { + const index = array.indexOf(element); + + if (index !== -1) { + array.splice(index, 1); + } +} + +/** + * Checks whether it can remove the given return statement or not. + * @param {ASTNode} node The return statement node to check. + * @returns {boolean} `true` if the node is removable. + */ +function isRemovable(node) { + return astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type); +} + +/** + * Checks whether the given return statement is in a `finally` block or not. + * @param {ASTNode} node The return statement node to check. + * @returns {boolean} `true` if the node is in a `finally` block. + */ +function isInFinally(node) { + for ( + let currentNode = node; + currentNode && currentNode.parent && !astUtils.isFunction(currentNode); + currentNode = currentNode.parent + ) { + if (currentNode.parent.type === "TryStatement" && currentNode.parent.finalizer === currentNode) { + return true; + } + } + + return false; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow redundant return statements", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-useless-return" + }, + + fixable: "code", + schema: [], + + messages: { + unnecessaryReturn: "Unnecessary return statement." + } + }, + + create(context) { + const segmentInfoMap = new WeakMap(); + const usedUnreachableSegments = new WeakSet(); + const sourceCode = context.getSourceCode(); + let scopeInfo = null; + + /** + * Checks whether the given segment is terminated by a return statement or not. + * @param {CodePathSegment} segment The segment to check. + * @returns {boolean} `true` if the segment is terminated by a return statement, or if it's still a part of unreachable. + */ + function isReturned(segment) { + const info = segmentInfoMap.get(segment); + + return !info || info.returned; + } + + /** + * Collects useless return statements from the given previous segments. + * + * A previous segment may be an unreachable segment. + * In that case, the information object of the unreachable segment is not + * initialized because `onCodePathSegmentStart` event is not notified for + * unreachable segments. + * This goes to the previous segments of the unreachable segment recursively + * if the unreachable segment was generated by a return statement. Otherwise, + * this ignores the unreachable segment. + * + * This behavior would simulate code paths for the case that the return + * statement does not exist. + * @param {ASTNode[]} uselessReturns The collected return statements. + * @param {CodePathSegment[]} prevSegments The previous segments to traverse. + * @param {WeakSet} [providedTraversedSegments] A set of segments that have already been traversed in this call + * @returns {ASTNode[]} `uselessReturns`. + */ + function getUselessReturns(uselessReturns, prevSegments, providedTraversedSegments) { + const traversedSegments = providedTraversedSegments || new WeakSet(); + + for (const segment of prevSegments) { + if (!segment.reachable) { + if (!traversedSegments.has(segment)) { + traversedSegments.add(segment); + getUselessReturns( + uselessReturns, + segment.allPrevSegments.filter(isReturned), + traversedSegments + ); + } + continue; + } + + uselessReturns.push(...segmentInfoMap.get(segment).uselessReturns); + } + + return uselessReturns; + } + + /** + * Removes the return statements on the given segment from the useless return + * statement list. + * + * This segment may be an unreachable segment. + * In that case, the information object of the unreachable segment is not + * initialized because `onCodePathSegmentStart` event is not notified for + * unreachable segments. + * This goes to the previous segments of the unreachable segment recursively + * if the unreachable segment was generated by a return statement. Otherwise, + * this ignores the unreachable segment. + * + * This behavior would simulate code paths for the case that the return + * statement does not exist. + * @param {CodePathSegment} segment The segment to get return statements. + * @returns {void} + */ + function markReturnStatementsOnSegmentAsUsed(segment) { + if (!segment.reachable) { + usedUnreachableSegments.add(segment); + segment.allPrevSegments + .filter(isReturned) + .filter(prevSegment => !usedUnreachableSegments.has(prevSegment)) + .forEach(markReturnStatementsOnSegmentAsUsed); + return; + } + + const info = segmentInfoMap.get(segment); + + for (const node of info.uselessReturns) { + remove(scopeInfo.uselessReturns, node); + } + info.uselessReturns = []; + } + + /** + * Removes the return statements on the current segments from the useless + * return statement list. + * + * This function will be called at every statement except FunctionDeclaration, + * BlockStatement, and BreakStatement. + * + * - FunctionDeclarations are always executed whether it's returned or not. + * - BlockStatements do nothing. + * - BreakStatements go the next merely. + * @returns {void} + */ + function markReturnStatementsOnCurrentSegmentsAsUsed() { + scopeInfo + .codePath + .currentSegments + .forEach(markReturnStatementsOnSegmentAsUsed); + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + + // Makes and pushs a new scope information. + onCodePathStart(codePath) { + scopeInfo = { + upper: scopeInfo, + uselessReturns: [], + codePath + }; + }, + + // Reports useless return statements if exist. + onCodePathEnd() { + for (const node of scopeInfo.uselessReturns) { + context.report({ + node, + loc: node.loc, + messageId: "unnecessaryReturn", + fix(fixer) { + if (isRemovable(node) && !sourceCode.getCommentsInside(node).length) { + + /* + * Extend the replacement range to include the + * entire function to avoid conflicting with + * no-else-return. + * https://github.com/eslint/eslint/issues/8026 + */ + return new FixTracker(fixer, sourceCode) + .retainEnclosingFunction(node) + .remove(node); + } + return null; + } + }); + } + + scopeInfo = scopeInfo.upper; + }, + + /* + * Initializes segments. + * NOTE: This event is notified for only reachable segments. + */ + onCodePathSegmentStart(segment) { + const info = { + uselessReturns: getUselessReturns([], segment.allPrevSegments), + returned: false + }; + + // Stores the info. + segmentInfoMap.set(segment, info); + }, + + // Adds ReturnStatement node to check whether it's useless or not. + ReturnStatement(node) { + if (node.argument) { + markReturnStatementsOnCurrentSegmentsAsUsed(); + } + if ( + node.argument || + astUtils.isInLoop(node) || + isInFinally(node) || + + // Ignore `return` statements in unreachable places (https://github.com/eslint/eslint/issues/11647). + !scopeInfo.codePath.currentSegments.some(s => s.reachable) + ) { + return; + } + + for (const segment of scopeInfo.codePath.currentSegments) { + const info = segmentInfoMap.get(segment); + + if (info) { + info.uselessReturns.push(node); + info.returned = true; + } + } + scopeInfo.uselessReturns.push(node); + }, + + /* + * Registers for all statement nodes except FunctionDeclaration, BlockStatement, BreakStatement. + * Removes return statements of the current segments from the useless return statement list. + */ + ClassDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed, + ContinueStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + DebuggerStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + DoWhileStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + EmptyStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ExpressionStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ForInStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ForOfStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ForStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + IfStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ImportDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed, + LabeledStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + SwitchStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ThrowStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + TryStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + VariableDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed, + WhileStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + WithStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ExportNamedDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed, + ExportDefaultDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed, + ExportAllDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-var.js b/node_modules/eslint/lib/rules/no-var.js new file mode 100644 index 000000000..f2cb96b1f --- /dev/null +++ b/node_modules/eslint/lib/rules/no-var.js @@ -0,0 +1,334 @@ +/** + * @fileoverview Rule to check for the usage of var. + * @author Jamund Ferguson + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Check whether a given variable is a global variable or not. + * @param {eslint-scope.Variable} variable The variable to check. + * @returns {boolean} `true` if the variable is a global variable. + */ +function isGlobal(variable) { + return Boolean(variable.scope) && variable.scope.type === "global"; +} + +/** + * Finds the nearest function scope or global scope walking up the scope + * hierarchy. + * @param {eslint-scope.Scope} scope The scope to traverse. + * @returns {eslint-scope.Scope} a function scope or global scope containing the given + * scope. + */ +function getEnclosingFunctionScope(scope) { + let currentScope = scope; + + while (currentScope.type !== "function" && currentScope.type !== "global") { + currentScope = currentScope.upper; + } + return currentScope; +} + +/** + * Checks whether the given variable has any references from a more specific + * function expression (i.e. a closure). + * @param {eslint-scope.Variable} variable A variable to check. + * @returns {boolean} `true` if the variable is used from a closure. + */ +function isReferencedInClosure(variable) { + const enclosingFunctionScope = getEnclosingFunctionScope(variable.scope); + + return variable.references.some(reference => + getEnclosingFunctionScope(reference.from) !== enclosingFunctionScope); +} + +/** + * Checks whether the given node is the assignee of a loop. + * @param {ASTNode} node A VariableDeclaration node to check. + * @returns {boolean} `true` if the declaration is assigned as part of loop + * iteration. + */ +function isLoopAssignee(node) { + return (node.parent.type === "ForOfStatement" || node.parent.type === "ForInStatement") && + node === node.parent.left; +} + +/** + * Checks whether the given variable declaration is immediately initialized. + * @param {ASTNode} node A VariableDeclaration node to check. + * @returns {boolean} `true` if the declaration has an initializer. + */ +function isDeclarationInitialized(node) { + return node.declarations.every(declarator => declarator.init !== null); +} + +const SCOPE_NODE_TYPE = /^(?:Program|BlockStatement|SwitchStatement|ForStatement|ForInStatement|ForOfStatement)$/u; + +/** + * Gets the scope node which directly contains a given node. + * @param {ASTNode} node A node to get. This is a `VariableDeclaration` or + * an `Identifier`. + * @returns {ASTNode} A scope node. This is one of `Program`, `BlockStatement`, + * `SwitchStatement`, `ForStatement`, `ForInStatement`, and + * `ForOfStatement`. + */ +function getScopeNode(node) { + for (let currentNode = node; currentNode; currentNode = currentNode.parent) { + if (SCOPE_NODE_TYPE.test(currentNode.type)) { + return currentNode; + } + } + + /* istanbul ignore next : unreachable */ + return null; +} + +/** + * Checks whether a given variable is redeclared or not. + * @param {eslint-scope.Variable} variable A variable to check. + * @returns {boolean} `true` if the variable is redeclared. + */ +function isRedeclared(variable) { + return variable.defs.length >= 2; +} + +/** + * Checks whether a given variable is used from outside of the specified scope. + * @param {ASTNode} scopeNode A scope node to check. + * @returns {Function} The predicate function which checks whether a given + * variable is used from outside of the specified scope. + */ +function isUsedFromOutsideOf(scopeNode) { + + /** + * Checks whether a given reference is inside of the specified scope or not. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is inside of the specified + * scope. + */ + function isOutsideOfScope(reference) { + const scope = scopeNode.range; + const id = reference.identifier.range; + + return id[0] < scope[0] || id[1] > scope[1]; + } + + return function(variable) { + return variable.references.some(isOutsideOfScope); + }; +} + +/** + * Creates the predicate function which checks whether a variable has their references in TDZ. + * + * The predicate function would return `true`: + * + * - if a reference is before the declarator. E.g. (var a = b, b = 1;)(var {a = b, b} = {};) + * - if a reference is in the expression of their default value. E.g. (var {a = a} = {};) + * - if a reference is in the expression of their initializer. E.g. (var a = a;) + * @param {ASTNode} node The initializer node of VariableDeclarator. + * @returns {Function} The predicate function. + * @private + */ +function hasReferenceInTDZ(node) { + const initStart = node.range[0]; + const initEnd = node.range[1]; + + return variable => { + const id = variable.defs[0].name; + const idStart = id.range[0]; + const defaultValue = (id.parent.type === "AssignmentPattern" ? id.parent.right : null); + const defaultStart = defaultValue && defaultValue.range[0]; + const defaultEnd = defaultValue && defaultValue.range[1]; + + return variable.references.some(reference => { + const start = reference.identifier.range[0]; + const end = reference.identifier.range[1]; + + return !reference.init && ( + start < idStart || + (defaultValue !== null && start >= defaultStart && end <= defaultEnd) || + (start >= initStart && end <= initEnd) + ); + }); + }; +} + +/** + * Checks whether a given variable has name that is allowed for 'var' declarations, + * but disallowed for `let` declarations. + * @param {eslint-scope.Variable} variable The variable to check. + * @returns {boolean} `true` if the variable has a disallowed name. + */ +function hasNameDisallowedForLetDeclarations(variable) { + return variable.name === "let"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require `let` or `const` instead of `var`", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/no-var" + }, + + schema: [], + fixable: "code", + + messages: { + unexpectedVar: "Unexpected var, use let or const instead." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Checks whether the variables which are defined by the given declarator node have their references in TDZ. + * @param {ASTNode} declarator The VariableDeclarator node to check. + * @returns {boolean} `true` if one of the variables which are defined by the given declarator node have their references in TDZ. + */ + function hasSelfReferenceInTDZ(declarator) { + if (!declarator.init) { + return false; + } + const variables = context.getDeclaredVariables(declarator); + + return variables.some(hasReferenceInTDZ(declarator.init)); + } + + /** + * Checks whether it can fix a given variable declaration or not. + * It cannot fix if the following cases: + * + * - A variable is a global variable. + * - A variable is declared on a SwitchCase node. + * - A variable is redeclared. + * - A variable is used from outside the scope. + * - A variable is used from a closure within a loop. + * - A variable might be used before it is assigned within a loop. + * - A variable might be used in TDZ. + * - A variable is declared in statement position (e.g. a single-line `IfStatement`) + * - A variable has name that is disallowed for `let` declarations. + * + * ## A variable is declared on a SwitchCase node. + * + * If this rule modifies 'var' declarations on a SwitchCase node, it + * would generate the warnings of 'no-case-declarations' rule. And the + * 'eslint:recommended' preset includes 'no-case-declarations' rule, so + * this rule doesn't modify those declarations. + * + * ## A variable is redeclared. + * + * The language spec disallows redeclarations of `let` declarations. + * Those variables would cause syntax errors. + * + * ## A variable is used from outside the scope. + * + * The language spec disallows accesses from outside of the scope for + * `let` declarations. Those variables would cause reference errors. + * + * ## A variable is used from a closure within a loop. + * + * A `var` declaration within a loop shares the same variable instance + * across all loop iterations, while a `let` declaration creates a new + * instance for each iteration. This means if a variable in a loop is + * referenced by any closure, changing it from `var` to `let` would + * change the behavior in a way that is generally unsafe. + * + * ## A variable might be used before it is assigned within a loop. + * + * Within a loop, a `let` declaration without an initializer will be + * initialized to null, while a `var` declaration will retain its value + * from the previous iteration, so it is only safe to change `var` to + * `let` if we can statically determine that the variable is always + * assigned a value before its first access in the loop body. To keep + * the implementation simple, we only convert `var` to `let` within + * loops when the variable is a loop assignee or the declaration has an + * initializer. + * @param {ASTNode} node A variable declaration node to check. + * @returns {boolean} `true` if it can fix the node. + */ + function canFix(node) { + const variables = context.getDeclaredVariables(node); + const scopeNode = getScopeNode(node); + + if (node.parent.type === "SwitchCase" || + node.declarations.some(hasSelfReferenceInTDZ) || + variables.some(isGlobal) || + variables.some(isRedeclared) || + variables.some(isUsedFromOutsideOf(scopeNode)) || + variables.some(hasNameDisallowedForLetDeclarations) + ) { + return false; + } + + if (astUtils.isInLoop(node)) { + if (variables.some(isReferencedInClosure)) { + return false; + } + if (!isLoopAssignee(node) && !isDeclarationInitialized(node)) { + return false; + } + } + + if ( + !isLoopAssignee(node) && + !(node.parent.type === "ForStatement" && node.parent.init === node) && + !astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type) + ) { + + // If the declaration is not in a block, e.g. `if (foo) var bar = 1;`, then it can't be fixed. + return false; + } + + return true; + } + + /** + * Reports a given variable declaration node. + * @param {ASTNode} node A variable declaration node to report. + * @returns {void} + */ + function report(node) { + context.report({ + node, + messageId: "unexpectedVar", + + fix(fixer) { + const varToken = sourceCode.getFirstToken(node, { filter: t => t.value === "var" }); + + return canFix(node) + ? fixer.replaceText(varToken, "let") + : null; + } + }); + } + + return { + "VariableDeclaration:exit"(node) { + if (node.kind === "var") { + report(node); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-void.js b/node_modules/eslint/lib/rules/no-void.js new file mode 100644 index 000000000..99c837855 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-void.js @@ -0,0 +1,64 @@ +/** + * @fileoverview Rule to disallow use of void operator. + * @author Mike Sidorov + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `void` operators", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-void" + }, + + messages: { + noVoid: "Expected 'undefined' and instead saw 'void'." + }, + + schema: [ + { + type: "object", + properties: { + allowAsStatement: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ] + }, + + create(context) { + const allowAsStatement = + context.options[0] && context.options[0].allowAsStatement; + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + 'UnaryExpression[operator="void"]'(node) { + if ( + allowAsStatement && + node.parent && + node.parent.type === "ExpressionStatement" + ) { + return; + } + context.report({ + node, + messageId: "noVoid" + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-warning-comments.js b/node_modules/eslint/lib/rules/no-warning-comments.js new file mode 100644 index 000000000..0691a31f7 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-warning-comments.js @@ -0,0 +1,196 @@ +/** + * @fileoverview Rule that warns about used warning comments + * @author Alexander Schmidt + */ + +"use strict"; + +const { escapeRegExp } = require("lodash"); +const astUtils = require("./utils/ast-utils"); + +const CHAR_LIMIT = 40; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow specified warning terms in comments", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-warning-comments" + }, + + schema: [ + { + type: "object", + properties: { + terms: { + type: "array", + items: { + type: "string" + } + }, + location: { + enum: ["start", "anywhere"] + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedComment: "Unexpected '{{matchedTerm}}' comment: '{{comment}}'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(), + configuration = context.options[0] || {}, + warningTerms = configuration.terms || ["todo", "fixme", "xxx"], + location = configuration.location || "start", + selfConfigRegEx = /\bno-warning-comments\b/u; + + /** + * Convert a warning term into a RegExp which will match a comment containing that whole word in the specified + * location ("start" or "anywhere"). If the term starts or ends with non word characters, then the match will not + * require word boundaries on that side. + * @param {string} term A term to convert to a RegExp + * @returns {RegExp} The term converted to a RegExp + */ + function convertToRegExp(term) { + const escaped = escapeRegExp(term); + const wordBoundary = "\\b"; + const eitherOrWordBoundary = `|${wordBoundary}`; + let prefix; + + /* + * If the term ends in a word character (a-z0-9_), ensure a word + * boundary at the end, so that substrings do not get falsely + * matched. eg "todo" in a string such as "mastodon". + * If the term ends in a non-word character, then \b won't match on + * the boundary to the next non-word character, which would likely + * be a space. For example `/\bFIX!\b/.test('FIX! blah') === false`. + * In these cases, use no bounding match. Same applies for the + * prefix, handled below. + */ + const suffix = /\w$/u.test(term) ? "\\b" : ""; + + if (location === "start") { + + /* + * When matching at the start, ignore leading whitespace, and + * there's no need to worry about word boundaries. + */ + prefix = "^\\s*"; + } else if (/^\w/u.test(term)) { + prefix = wordBoundary; + } else { + prefix = ""; + } + + if (location === "start") { + + /* + * For location "start" the regex should be + * ^\s*TERM\b. This checks the word boundary + * at the beginning of the comment. + */ + return new RegExp(prefix + escaped + suffix, "iu"); + } + + /* + * For location "anywhere" the regex should be + * \bTERM\b|\bTERM\b, this checks the entire comment + * for the term. + */ + return new RegExp( + prefix + + escaped + + suffix + + eitherOrWordBoundary + + term + + wordBoundary, + "iu" + ); + } + + const warningRegExps = warningTerms.map(convertToRegExp); + + /** + * Checks the specified comment for matches of the configured warning terms and returns the matches. + * @param {string} comment The comment which is checked. + * @returns {Array} All matched warning terms for this comment. + */ + function commentContainsWarningTerm(comment) { + const matches = []; + + warningRegExps.forEach((regex, index) => { + if (regex.test(comment)) { + matches.push(warningTerms[index]); + } + }); + + return matches; + } + + /** + * Checks the specified node for matching warning comments and reports them. + * @param {ASTNode} node The AST node being checked. + * @returns {void} undefined. + */ + function checkComment(node) { + const comment = node.value; + + if ( + astUtils.isDirectiveComment(node) && + selfConfigRegEx.test(comment) + ) { + return; + } + + const matches = commentContainsWarningTerm(comment); + + matches.forEach(matchedTerm => { + let commentToDisplay = ""; + let truncated = false; + + for (const c of comment.trim().split(/\s+/u)) { + const tmp = commentToDisplay ? `${commentToDisplay} ${c}` : c; + + if (tmp.length <= CHAR_LIMIT) { + commentToDisplay = tmp; + } else { + truncated = true; + break; + } + } + + context.report({ + node, + messageId: "unexpectedComment", + data: { + matchedTerm, + comment: `${commentToDisplay}${ + truncated ? "..." : "" + }` + } + }); + }); + } + + return { + Program() { + const comments = sourceCode.getAllComments(); + + comments + .filter(token => token.type !== "Shebang") + .forEach(checkComment); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-whitespace-before-property.js b/node_modules/eslint/lib/rules/no-whitespace-before-property.js new file mode 100644 index 000000000..226f873c5 --- /dev/null +++ b/node_modules/eslint/lib/rules/no-whitespace-before-property.js @@ -0,0 +1,113 @@ +/** + * @fileoverview Rule to disallow whitespace before properties + * @author Kai Cataldo + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow whitespace before properties", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-whitespace-before-property" + }, + + fixable: "whitespace", + schema: [], + + messages: { + unexpectedWhitespace: "Unexpected whitespace before property {{propName}}." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports whitespace before property token + * @param {ASTNode} node the node to report in the event of an error + * @param {Token} leftToken the left token + * @param {Token} rightToken the right token + * @returns {void} + * @private + */ + function reportError(node, leftToken, rightToken) { + context.report({ + node, + messageId: "unexpectedWhitespace", + data: { + propName: sourceCode.getText(node.property) + }, + fix(fixer) { + let replacementText = ""; + + if (!node.computed && !node.optional && astUtils.isDecimalInteger(node.object)) { + + /* + * If the object is a number literal, fixing it to something like 5.toString() would cause a SyntaxError. + * Don't fix this case. + */ + return null; + } + + // Don't fix if comments exist. + if (sourceCode.commentsExistBetween(leftToken, rightToken)) { + return null; + } + + if (node.optional) { + replacementText = "?."; + } else if (!node.computed) { + replacementText = "."; + } + + return fixer.replaceTextRange([leftToken.range[1], rightToken.range[0]], replacementText); + } + }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + MemberExpression(node) { + let rightToken; + let leftToken; + + if (!astUtils.isTokenOnSameLine(node.object, node.property)) { + return; + } + + if (node.computed) { + rightToken = sourceCode.getTokenBefore(node.property, astUtils.isOpeningBracketToken); + leftToken = sourceCode.getTokenBefore(rightToken, node.optional ? 1 : 0); + } else { + rightToken = sourceCode.getFirstToken(node.property); + leftToken = sourceCode.getTokenBefore(rightToken, 1); + } + + if (sourceCode.isSpaceBetweenTokens(leftToken, rightToken)) { + reportError(node, leftToken, rightToken); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/no-with.js b/node_modules/eslint/lib/rules/no-with.js new file mode 100644 index 000000000..d3e52e02f --- /dev/null +++ b/node_modules/eslint/lib/rules/no-with.js @@ -0,0 +1,39 @@ +/** + * @fileoverview Rule to flag use of with statement + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `with` statements", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-with" + }, + + schema: [], + + messages: { + unexpectedWith: "Unexpected use of 'with' statement." + } + }, + + create(context) { + + return { + WithStatement(node) { + context.report({ node, messageId: "unexpectedWith" }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/nonblock-statement-body-position.js b/node_modules/eslint/lib/rules/nonblock-statement-body-position.js new file mode 100644 index 000000000..34e6eeac3 --- /dev/null +++ b/node_modules/eslint/lib/rules/nonblock-statement-body-position.js @@ -0,0 +1,124 @@ +/** + * @fileoverview enforce the location of single-line statements + * @author Teddy Katz + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const POSITION_SCHEMA = { enum: ["beside", "below", "any"] }; + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce the location of single-line statements", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/nonblock-statement-body-position" + }, + + fixable: "whitespace", + + schema: [ + POSITION_SCHEMA, + { + properties: { + overrides: { + properties: { + if: POSITION_SCHEMA, + else: POSITION_SCHEMA, + while: POSITION_SCHEMA, + do: POSITION_SCHEMA, + for: POSITION_SCHEMA + }, + additionalProperties: false + } + }, + additionalProperties: false + } + ], + + messages: { + expectNoLinebreak: "Expected no linebreak before this statement.", + expectLinebreak: "Expected a linebreak before this statement." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Gets the applicable preference for a particular keyword + * @param {string} keywordName The name of a keyword, e.g. 'if' + * @returns {string} The applicable option for the keyword, e.g. 'beside' + */ + function getOption(keywordName) { + return context.options[1] && context.options[1].overrides && context.options[1].overrides[keywordName] || + context.options[0] || + "beside"; + } + + /** + * Validates the location of a single-line statement + * @param {ASTNode} node The single-line statement + * @param {string} keywordName The applicable keyword name for the single-line statement + * @returns {void} + */ + function validateStatement(node, keywordName) { + const option = getOption(keywordName); + + if (node.type === "BlockStatement" || option === "any") { + return; + } + + const tokenBefore = sourceCode.getTokenBefore(node); + + if (tokenBefore.loc.end.line === node.loc.start.line && option === "below") { + context.report({ + node, + messageId: "expectLinebreak", + fix: fixer => fixer.insertTextBefore(node, "\n") + }); + } else if (tokenBefore.loc.end.line !== node.loc.start.line && option === "beside") { + context.report({ + node, + messageId: "expectNoLinebreak", + fix(fixer) { + if (sourceCode.getText().slice(tokenBefore.range[1], node.range[0]).trim()) { + return null; + } + return fixer.replaceTextRange([tokenBefore.range[1], node.range[0]], " "); + } + }); + } + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + IfStatement(node) { + validateStatement(node.consequent, "if"); + + // Check the `else` node, but don't check 'else if' statements. + if (node.alternate && node.alternate.type !== "IfStatement") { + validateStatement(node.alternate, "else"); + } + }, + WhileStatement: node => validateStatement(node.body, "while"), + DoWhileStatement: node => validateStatement(node.body, "do"), + ForStatement: node => validateStatement(node.body, "for"), + ForInStatement: node => validateStatement(node.body, "for"), + ForOfStatement: node => validateStatement(node.body, "for") + }; + } +}; diff --git a/node_modules/eslint/lib/rules/object-curly-newline.js b/node_modules/eslint/lib/rules/object-curly-newline.js new file mode 100644 index 000000000..616d59851 --- /dev/null +++ b/node_modules/eslint/lib/rules/object-curly-newline.js @@ -0,0 +1,306 @@ +/** + * @fileoverview Rule to require or disallow line breaks inside braces. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +// Schema objects. +const OPTION_VALUE = { + oneOf: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + multiline: { + type: "boolean" + }, + minProperties: { + type: "integer", + minimum: 0 + }, + consistent: { + type: "boolean" + } + }, + additionalProperties: false, + minProperties: 1 + } + ] +}; + +/** + * Normalizes a given option value. + * @param {string|Object|undefined} value An option value to parse. + * @returns {{multiline: boolean, minProperties: number, consistent: boolean}} Normalized option object. + */ +function normalizeOptionValue(value) { + let multiline = false; + let minProperties = Number.POSITIVE_INFINITY; + let consistent = false; + + if (value) { + if (value === "always") { + minProperties = 0; + } else if (value === "never") { + minProperties = Number.POSITIVE_INFINITY; + } else { + multiline = Boolean(value.multiline); + minProperties = value.minProperties || Number.POSITIVE_INFINITY; + consistent = Boolean(value.consistent); + } + } else { + consistent = true; + } + + return { multiline, minProperties, consistent }; +} + +/** + * Normalizes a given option value. + * @param {string|Object|undefined} options An option value to parse. + * @returns {{ + * ObjectExpression: {multiline: boolean, minProperties: number, consistent: boolean}, + * ObjectPattern: {multiline: boolean, minProperties: number, consistent: boolean}, + * ImportDeclaration: {multiline: boolean, minProperties: number, consistent: boolean}, + * ExportNamedDeclaration : {multiline: boolean, minProperties: number, consistent: boolean} + * }} Normalized option object. + */ +function normalizeOptions(options) { + const isNodeSpecificOption = lodash.overSome([lodash.isPlainObject, lodash.isString]); + + if (lodash.isPlainObject(options) && lodash.some(options, isNodeSpecificOption)) { + return { + ObjectExpression: normalizeOptionValue(options.ObjectExpression), + ObjectPattern: normalizeOptionValue(options.ObjectPattern), + ImportDeclaration: normalizeOptionValue(options.ImportDeclaration), + ExportNamedDeclaration: normalizeOptionValue(options.ExportDeclaration) + }; + } + + const value = normalizeOptionValue(options); + + return { ObjectExpression: value, ObjectPattern: value, ImportDeclaration: value, ExportNamedDeclaration: value }; +} + +/** + * Determines if ObjectExpression, ObjectPattern, ImportDeclaration or ExportNamedDeclaration + * node needs to be checked for missing line breaks + * @param {ASTNode} node Node under inspection + * @param {Object} options option specific to node type + * @param {Token} first First object property + * @param {Token} last Last object property + * @returns {boolean} `true` if node needs to be checked for missing line breaks + */ +function areLineBreaksRequired(node, options, first, last) { + let objectProperties; + + if (node.type === "ObjectExpression" || node.type === "ObjectPattern") { + objectProperties = node.properties; + } else { + + // is ImportDeclaration or ExportNamedDeclaration + objectProperties = node.specifiers + .filter(s => s.type === "ImportSpecifier" || s.type === "ExportSpecifier"); + } + + return objectProperties.length >= options.minProperties || + ( + options.multiline && + objectProperties.length > 0 && + first.loc.start.line !== last.loc.end.line + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent line breaks inside braces", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/object-curly-newline" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + OPTION_VALUE, + { + type: "object", + properties: { + ObjectExpression: OPTION_VALUE, + ObjectPattern: OPTION_VALUE, + ImportDeclaration: OPTION_VALUE, + ExportDeclaration: OPTION_VALUE + }, + additionalProperties: false, + minProperties: 1 + } + ] + } + ], + + messages: { + unexpectedLinebreakBeforeClosingBrace: "Unexpected line break before this closing brace.", + unexpectedLinebreakAfterOpeningBrace: "Unexpected line break after this opening brace.", + expectedLinebreakBeforeClosingBrace: "Expected a line break before this closing brace.", + expectedLinebreakAfterOpeningBrace: "Expected a line break after this opening brace." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const normalizedOptions = normalizeOptions(context.options[0]); + + /** + * Reports a given node if it violated this rule. + * @param {ASTNode} node A node to check. This is an ObjectExpression, ObjectPattern, ImportDeclaration or ExportNamedDeclaration node. + * @returns {void} + */ + function check(node) { + const options = normalizedOptions[node.type]; + + if ( + (node.type === "ImportDeclaration" && + !node.specifiers.some(specifier => specifier.type === "ImportSpecifier")) || + (node.type === "ExportNamedDeclaration" && + !node.specifiers.some(specifier => specifier.type === "ExportSpecifier")) + ) { + return; + } + + const openBrace = sourceCode.getFirstToken(node, token => token.value === "{"); + + let closeBrace; + + if (node.typeAnnotation) { + closeBrace = sourceCode.getTokenBefore(node.typeAnnotation); + } else { + closeBrace = sourceCode.getLastToken(node, token => token.value === "}"); + } + + let first = sourceCode.getTokenAfter(openBrace, { includeComments: true }); + let last = sourceCode.getTokenBefore(closeBrace, { includeComments: true }); + + const needsLineBreaks = areLineBreaksRequired(node, options, first, last); + + const hasCommentsFirstToken = astUtils.isCommentToken(first); + const hasCommentsLastToken = astUtils.isCommentToken(last); + + /* + * Use tokens or comments to check multiline or not. + * But use only tokens to check whether line breaks are needed. + * This allows: + * var obj = { // eslint-disable-line foo + * a: 1 + * } + */ + first = sourceCode.getTokenAfter(openBrace); + last = sourceCode.getTokenBefore(closeBrace); + + if (needsLineBreaks) { + if (astUtils.isTokenOnSameLine(openBrace, first)) { + context.report({ + messageId: "expectedLinebreakAfterOpeningBrace", + node, + loc: openBrace.loc, + fix(fixer) { + if (hasCommentsFirstToken) { + return null; + } + + return fixer.insertTextAfter(openBrace, "\n"); + } + }); + } + if (astUtils.isTokenOnSameLine(last, closeBrace)) { + context.report({ + messageId: "expectedLinebreakBeforeClosingBrace", + node, + loc: closeBrace.loc, + fix(fixer) { + if (hasCommentsLastToken) { + return null; + } + + return fixer.insertTextBefore(closeBrace, "\n"); + } + }); + } + } else { + const consistent = options.consistent; + const hasLineBreakBetweenOpenBraceAndFirst = !astUtils.isTokenOnSameLine(openBrace, first); + const hasLineBreakBetweenCloseBraceAndLast = !astUtils.isTokenOnSameLine(last, closeBrace); + + if ( + (!consistent && hasLineBreakBetweenOpenBraceAndFirst) || + (consistent && hasLineBreakBetweenOpenBraceAndFirst && !hasLineBreakBetweenCloseBraceAndLast) + ) { + context.report({ + messageId: "unexpectedLinebreakAfterOpeningBrace", + node, + loc: openBrace.loc, + fix(fixer) { + if (hasCommentsFirstToken) { + return null; + } + + return fixer.removeRange([ + openBrace.range[1], + first.range[0] + ]); + } + }); + } + if ( + (!consistent && hasLineBreakBetweenCloseBraceAndLast) || + (consistent && !hasLineBreakBetweenOpenBraceAndFirst && hasLineBreakBetweenCloseBraceAndLast) + ) { + context.report({ + messageId: "unexpectedLinebreakBeforeClosingBrace", + node, + loc: closeBrace.loc, + fix(fixer) { + if (hasCommentsLastToken) { + return null; + } + + return fixer.removeRange([ + last.range[1], + closeBrace.range[0] + ]); + } + }); + } + } + } + + return { + ObjectExpression: check, + ObjectPattern: check, + ImportDeclaration: check, + ExportNamedDeclaration: check + }; + } +}; diff --git a/node_modules/eslint/lib/rules/object-curly-spacing.js b/node_modules/eslint/lib/rules/object-curly-spacing.js new file mode 100644 index 000000000..c0044f503 --- /dev/null +++ b/node_modules/eslint/lib/rules/object-curly-spacing.js @@ -0,0 +1,308 @@ +/** + * @fileoverview Disallows or enforces spaces inside of object literals. + * @author Jamund Ferguson + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing inside braces", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/object-curly-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + arraysInObjects: { + type: "boolean" + }, + objectsInObjects: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + requireSpaceBefore: "A space is required before '{{token}}'.", + requireSpaceAfter: "A space is required after '{{token}}'.", + unexpectedSpaceBefore: "There should be no space before '{{token}}'.", + unexpectedSpaceAfter: "There should be no space after '{{token}}'." + } + }, + + create(context) { + const spaced = context.options[0] === "always", + sourceCode = context.getSourceCode(); + + /** + * Determines whether an option is set, relative to the spacing option. + * If spaced is "always", then check whether option is set to false. + * If spaced is "never", then check whether option is set to true. + * @param {Object} option The option to exclude. + * @returns {boolean} Whether or not the property is excluded. + */ + function isOptionSet(option) { + return context.options[1] ? context.options[1][option] === !spaced : false; + } + + const options = { + spaced, + arraysInObjectsException: isOptionSet("arraysInObjects"), + objectsInObjectsException: isOptionSet("objectsInObjects") + }; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports that there shouldn't be a space after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoBeginningSpace(node, token) { + const nextToken = context.getSourceCode().getTokenAfter(token, { includeComments: true }); + + context.report({ + node, + loc: { start: token.loc.end, end: nextToken.loc.start }, + messageId: "unexpectedSpaceAfter", + data: { + token: token.value + }, + fix(fixer) { + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); + } + + /** + * Reports that there shouldn't be a space before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoEndingSpace(node, token) { + const previousToken = context.getSourceCode().getTokenBefore(token, { includeComments: true }); + + context.report({ + node, + loc: { start: previousToken.loc.end, end: token.loc.start }, + messageId: "unexpectedSpaceBefore", + data: { + token: token.value + }, + fix(fixer) { + return fixer.removeRange([previousToken.range[1], token.range[0]]); + } + }); + } + + /** + * Reports that there should be a space after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredBeginningSpace(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "requireSpaceAfter", + data: { + token: token.value + }, + fix(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + + /** + * Reports that there should be a space before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredEndingSpace(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "requireSpaceBefore", + data: { + token: token.value + }, + fix(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + + /** + * Determines if spacing in curly braces is valid. + * @param {ASTNode} node The AST node to check. + * @param {Token} first The first token to check (should be the opening brace) + * @param {Token} second The second token to check (should be first after the opening brace) + * @param {Token} penultimate The penultimate token to check (should be last before closing brace) + * @param {Token} last The last token to check (should be closing brace) + * @returns {void} + */ + function validateBraceSpacing(node, first, second, penultimate, last) { + if (astUtils.isTokenOnSameLine(first, second)) { + const firstSpaced = sourceCode.isSpaceBetweenTokens(first, second); + + if (options.spaced && !firstSpaced) { + reportRequiredBeginningSpace(node, first); + } + if (!options.spaced && firstSpaced && second.type !== "Line") { + reportNoBeginningSpace(node, first); + } + } + + if (astUtils.isTokenOnSameLine(penultimate, last)) { + const shouldCheckPenultimate = ( + options.arraysInObjectsException && astUtils.isClosingBracketToken(penultimate) || + options.objectsInObjectsException && astUtils.isClosingBraceToken(penultimate) + ); + const penultimateType = shouldCheckPenultimate && sourceCode.getNodeByRangeIndex(penultimate.range[0]).type; + + const closingCurlyBraceMustBeSpaced = ( + options.arraysInObjectsException && penultimateType === "ArrayExpression" || + options.objectsInObjectsException && (penultimateType === "ObjectExpression" || penultimateType === "ObjectPattern") + ) ? !options.spaced : options.spaced; + + const lastSpaced = sourceCode.isSpaceBetweenTokens(penultimate, last); + + if (closingCurlyBraceMustBeSpaced && !lastSpaced) { + reportRequiredEndingSpace(node, last); + } + if (!closingCurlyBraceMustBeSpaced && lastSpaced) { + reportNoEndingSpace(node, last); + } + } + } + + /** + * Gets '}' token of an object node. + * + * Because the last token of object patterns might be a type annotation, + * this traverses tokens preceded by the last property, then returns the + * first '}' token. + * @param {ASTNode} node The node to get. This node is an + * ObjectExpression or an ObjectPattern. And this node has one or + * more properties. + * @returns {Token} '}' token. + */ + function getClosingBraceOfObject(node) { + const lastProperty = node.properties[node.properties.length - 1]; + + return sourceCode.getTokenAfter(lastProperty, astUtils.isClosingBraceToken); + } + + /** + * Reports a given object node if spacing in curly braces is invalid. + * @param {ASTNode} node An ObjectExpression or ObjectPattern node to check. + * @returns {void} + */ + function checkForObject(node) { + if (node.properties.length === 0) { + return; + } + + const first = sourceCode.getFirstToken(node), + last = getClosingBraceOfObject(node), + second = sourceCode.getTokenAfter(first, { includeComments: true }), + penultimate = sourceCode.getTokenBefore(last, { includeComments: true }); + + validateBraceSpacing(node, first, second, penultimate, last); + } + + /** + * Reports a given import node if spacing in curly braces is invalid. + * @param {ASTNode} node An ImportDeclaration node to check. + * @returns {void} + */ + function checkForImport(node) { + if (node.specifiers.length === 0) { + return; + } + + let firstSpecifier = node.specifiers[0]; + const lastSpecifier = node.specifiers[node.specifiers.length - 1]; + + if (lastSpecifier.type !== "ImportSpecifier") { + return; + } + if (firstSpecifier.type !== "ImportSpecifier") { + firstSpecifier = node.specifiers[1]; + } + + const first = sourceCode.getTokenBefore(firstSpecifier), + last = sourceCode.getTokenAfter(lastSpecifier, astUtils.isNotCommaToken), + second = sourceCode.getTokenAfter(first, { includeComments: true }), + penultimate = sourceCode.getTokenBefore(last, { includeComments: true }); + + validateBraceSpacing(node, first, second, penultimate, last); + } + + /** + * Reports a given export node if spacing in curly braces is invalid. + * @param {ASTNode} node An ExportNamedDeclaration node to check. + * @returns {void} + */ + function checkForExport(node) { + if (node.specifiers.length === 0) { + return; + } + + const firstSpecifier = node.specifiers[0], + lastSpecifier = node.specifiers[node.specifiers.length - 1], + first = sourceCode.getTokenBefore(firstSpecifier), + last = sourceCode.getTokenAfter(lastSpecifier, astUtils.isNotCommaToken), + second = sourceCode.getTokenAfter(first, { includeComments: true }), + penultimate = sourceCode.getTokenBefore(last, { includeComments: true }); + + validateBraceSpacing(node, first, second, penultimate, last); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + // var {x} = y; + ObjectPattern: checkForObject, + + // var y = {x: 'y'} + ObjectExpression: checkForObject, + + // import {y} from 'x'; + ImportDeclaration: checkForImport, + + // export {name} from 'yo'; + ExportNamedDeclaration: checkForExport + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/object-property-newline.js b/node_modules/eslint/lib/rules/object-property-newline.js new file mode 100644 index 000000000..0c7f80028 --- /dev/null +++ b/node_modules/eslint/lib/rules/object-property-newline.js @@ -0,0 +1,99 @@ +/** + * @fileoverview Rule to enforce placing object properties on separate lines. + * @author Vitor Balocco + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce placing object properties on separate lines", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/object-property-newline" + }, + + schema: [ + { + type: "object", + properties: { + allowAllPropertiesOnSameLine: { + type: "boolean", + default: false + }, + allowMultiplePropertiesPerLine: { // Deprecated + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + fixable: "whitespace", + + messages: { + propertiesOnNewlineAll: "Object properties must go on a new line if they aren't all on the same line.", + propertiesOnNewline: "Object properties must go on a new line." + } + }, + + create(context) { + const allowSameLine = context.options[0] && ( + (context.options[0].allowAllPropertiesOnSameLine || context.options[0].allowMultiplePropertiesPerLine /* Deprecated */) + ); + const messageId = allowSameLine + ? "propertiesOnNewlineAll" + : "propertiesOnNewline"; + + const sourceCode = context.getSourceCode(); + + return { + ObjectExpression(node) { + if (allowSameLine) { + if (node.properties.length > 1) { + const firstTokenOfFirstProperty = sourceCode.getFirstToken(node.properties[0]); + const lastTokenOfLastProperty = sourceCode.getLastToken(node.properties[node.properties.length - 1]); + + if (firstTokenOfFirstProperty.loc.end.line === lastTokenOfLastProperty.loc.start.line) { + + // All keys and values are on the same line + return; + } + } + } + + for (let i = 1; i < node.properties.length; i++) { + const lastTokenOfPreviousProperty = sourceCode.getLastToken(node.properties[i - 1]); + const firstTokenOfCurrentProperty = sourceCode.getFirstToken(node.properties[i]); + + if (lastTokenOfPreviousProperty.loc.end.line === firstTokenOfCurrentProperty.loc.start.line) { + context.report({ + node, + loc: firstTokenOfCurrentProperty.loc, + messageId, + fix(fixer) { + const comma = sourceCode.getTokenBefore(firstTokenOfCurrentProperty); + const rangeAfterComma = [comma.range[1], firstTokenOfCurrentProperty.range[0]]; + + // Don't perform a fix if there are any comments between the comma and the next property. + if (sourceCode.text.slice(rangeAfterComma[0], rangeAfterComma[1]).trim()) { + return null; + } + + return fixer.replaceTextRange(rangeAfterComma, "\n"); + } + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/object-shorthand.js b/node_modules/eslint/lib/rules/object-shorthand.js new file mode 100644 index 000000000..3999ff8b9 --- /dev/null +++ b/node_modules/eslint/lib/rules/object-shorthand.js @@ -0,0 +1,508 @@ +/** + * @fileoverview Rule to enforce concise object methods and properties. + * @author Jamund Ferguson + */ + +"use strict"; + +const OPTIONS = { + always: "always", + never: "never", + methods: "methods", + properties: "properties", + consistent: "consistent", + consistentAsNeeded: "consistent-as-needed" +}; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require or disallow method and property shorthand syntax for object literals", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/object-shorthand" + }, + + fixable: "code", + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["always", "methods", "properties", "never", "consistent", "consistent-as-needed"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["always", "methods", "properties"] + }, + { + type: "object", + properties: { + avoidQuotes: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + }, + { + type: "array", + items: [ + { + enum: ["always", "methods"] + }, + { + type: "object", + properties: { + ignoreConstructors: { + type: "boolean" + }, + avoidQuotes: { + type: "boolean" + }, + avoidExplicitReturnArrows: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + messages: { + expectedAllPropertiesShorthanded: "Expected shorthand for all properties.", + expectedLiteralMethodLongform: "Expected longform method syntax for string literal keys.", + expectedPropertyShorthand: "Expected property shorthand.", + expectedPropertyLongform: "Expected longform property syntax.", + expectedMethodShorthand: "Expected method shorthand.", + expectedMethodLongform: "Expected longform method syntax.", + unexpectedMix: "Unexpected mix of shorthand and non-shorthand properties." + } + }, + + create(context) { + const APPLY = context.options[0] || OPTIONS.always; + const APPLY_TO_METHODS = APPLY === OPTIONS.methods || APPLY === OPTIONS.always; + const APPLY_TO_PROPS = APPLY === OPTIONS.properties || APPLY === OPTIONS.always; + const APPLY_NEVER = APPLY === OPTIONS.never; + const APPLY_CONSISTENT = APPLY === OPTIONS.consistent; + const APPLY_CONSISTENT_AS_NEEDED = APPLY === OPTIONS.consistentAsNeeded; + + const PARAMS = context.options[1] || {}; + const IGNORE_CONSTRUCTORS = PARAMS.ignoreConstructors; + const AVOID_QUOTES = PARAMS.avoidQuotes; + const AVOID_EXPLICIT_RETURN_ARROWS = !!PARAMS.avoidExplicitReturnArrows; + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const CTOR_PREFIX_REGEX = /[^_$0-9]/u; + + /** + * Determines if the first character of the name is a capital letter. + * @param {string} name The name of the node to evaluate. + * @returns {boolean} True if the first character of the property name is a capital letter, false if not. + * @private + */ + function isConstructor(name) { + const match = CTOR_PREFIX_REGEX.exec(name); + + // Not a constructor if name has no characters apart from '_', '$' and digits e.g. '_', '$$', '_8' + if (!match) { + return false; + } + + const firstChar = name.charAt(match.index); + + return firstChar === firstChar.toUpperCase(); + } + + /** + * Determines if the property can have a shorthand form. + * @param {ASTNode} property Property AST node + * @returns {boolean} True if the property can have a shorthand form + * @private + * + */ + function canHaveShorthand(property) { + return (property.kind !== "set" && property.kind !== "get" && property.type !== "SpreadElement" && property.type !== "SpreadProperty" && property.type !== "ExperimentalSpreadProperty"); + } + + /** + * Checks whether a node is a string literal. + * @param {ASTNode} node Any AST node. + * @returns {boolean} `true` if it is a string literal. + */ + function isStringLiteral(node) { + return node.type === "Literal" && typeof node.value === "string"; + } + + /** + * Determines if the property is a shorthand or not. + * @param {ASTNode} property Property AST node + * @returns {boolean} True if the property is considered shorthand, false if not. + * @private + * + */ + function isShorthand(property) { + + // property.method is true when `{a(){}}`. + return (property.shorthand || property.method); + } + + /** + * Determines if the property's key and method or value are named equally. + * @param {ASTNode} property Property AST node + * @returns {boolean} True if the key and value are named equally, false if not. + * @private + * + */ + function isRedundant(property) { + const value = property.value; + + if (value.type === "FunctionExpression") { + return !value.id; // Only anonymous should be shorthand method. + } + if (value.type === "Identifier") { + return astUtils.getStaticPropertyName(property) === value.name; + } + + return false; + } + + /** + * Ensures that an object's properties are consistently shorthand, or not shorthand at all. + * @param {ASTNode} node Property AST node + * @param {boolean} checkRedundancy Whether to check longform redundancy + * @returns {void} + * + */ + function checkConsistency(node, checkRedundancy) { + + // We are excluding getters/setters and spread properties as they are considered neither longform nor shorthand. + const properties = node.properties.filter(canHaveShorthand); + + // Do we still have properties left after filtering the getters and setters? + if (properties.length > 0) { + const shorthandProperties = properties.filter(isShorthand); + + /* + * If we do not have an equal number of longform properties as + * shorthand properties, we are using the annotations inconsistently + */ + if (shorthandProperties.length !== properties.length) { + + // We have at least 1 shorthand property + if (shorthandProperties.length > 0) { + context.report({ node, messageId: "unexpectedMix" }); + } else if (checkRedundancy) { + + /* + * If all properties of the object contain a method or value with a name matching it's key, + * all the keys are redundant. + */ + const canAlwaysUseShorthand = properties.every(isRedundant); + + if (canAlwaysUseShorthand) { + context.report({ node, messageId: "expectedAllPropertiesShorthanded" }); + } + } + } + } + } + + /** + * Fixes a FunctionExpression node by making it into a shorthand property. + * @param {SourceCodeFixer} fixer The fixer object + * @param {ASTNode} node A `Property` node that has a `FunctionExpression` or `ArrowFunctionExpression` as its value + * @returns {Object} A fix for this node + */ + function makeFunctionShorthand(fixer, node) { + const firstKeyToken = node.computed + ? sourceCode.getFirstToken(node, astUtils.isOpeningBracketToken) + : sourceCode.getFirstToken(node.key); + const lastKeyToken = node.computed + ? sourceCode.getFirstTokenBetween(node.key, node.value, astUtils.isClosingBracketToken) + : sourceCode.getLastToken(node.key); + const keyText = sourceCode.text.slice(firstKeyToken.range[0], lastKeyToken.range[1]); + let keyPrefix = ""; + + // key: /* */ () => {} + if (sourceCode.commentsExistBetween(lastKeyToken, node.value)) { + return null; + } + + if (node.value.async) { + keyPrefix += "async "; + } + if (node.value.generator) { + keyPrefix += "*"; + } + + const fixRange = [firstKeyToken.range[0], node.range[1]]; + const methodPrefix = keyPrefix + keyText; + + if (node.value.type === "FunctionExpression") { + const functionToken = sourceCode.getTokens(node.value).find(token => token.type === "Keyword" && token.value === "function"); + const tokenBeforeParams = node.value.generator ? sourceCode.getTokenAfter(functionToken) : functionToken; + + return fixer.replaceTextRange( + fixRange, + methodPrefix + sourceCode.text.slice(tokenBeforeParams.range[1], node.value.range[1]) + ); + } + + const arrowToken = sourceCode.getTokenBefore(node.value.body, astUtils.isArrowToken); + const fnBody = sourceCode.text.slice(arrowToken.range[1], node.value.range[1]); + + let shouldAddParensAroundParameters = false; + let tokenBeforeParams; + + if (node.value.params.length === 0) { + tokenBeforeParams = sourceCode.getFirstToken(node.value, astUtils.isOpeningParenToken); + } else { + tokenBeforeParams = sourceCode.getTokenBefore(node.value.params[0]); + } + + if (node.value.params.length === 1) { + const hasParen = astUtils.isOpeningParenToken(tokenBeforeParams); + const isTokenOutsideNode = tokenBeforeParams.range[0] < node.range[0]; + + shouldAddParensAroundParameters = !hasParen || isTokenOutsideNode; + } + + const sliceStart = shouldAddParensAroundParameters + ? node.value.params[0].range[0] + : tokenBeforeParams.range[0]; + const sliceEnd = sourceCode.getTokenBefore(arrowToken).range[1]; + + const oldParamText = sourceCode.text.slice(sliceStart, sliceEnd); + const newParamText = shouldAddParensAroundParameters ? `(${oldParamText})` : oldParamText; + + return fixer.replaceTextRange( + fixRange, + methodPrefix + newParamText + fnBody + ); + + } + + /** + * Fixes a FunctionExpression node by making it into a longform property. + * @param {SourceCodeFixer} fixer The fixer object + * @param {ASTNode} node A `Property` node that has a `FunctionExpression` as its value + * @returns {Object} A fix for this node + */ + function makeFunctionLongform(fixer, node) { + const firstKeyToken = node.computed ? sourceCode.getTokens(node).find(token => token.value === "[") : sourceCode.getFirstToken(node.key); + const lastKeyToken = node.computed ? sourceCode.getTokensBetween(node.key, node.value).find(token => token.value === "]") : sourceCode.getLastToken(node.key); + const keyText = sourceCode.text.slice(firstKeyToken.range[0], lastKeyToken.range[1]); + let functionHeader = "function"; + + if (node.value.async) { + functionHeader = `async ${functionHeader}`; + } + if (node.value.generator) { + functionHeader = `${functionHeader}*`; + } + + return fixer.replaceTextRange([node.range[0], lastKeyToken.range[1]], `${keyText}: ${functionHeader}`); + } + + /* + * To determine whether a given arrow function has a lexical identifier (`this`, `arguments`, `super`, or `new.target`), + * create a stack of functions that define these identifiers (i.e. all functions except arrow functions) as the AST is + * traversed. Whenever a new function is encountered, create a new entry on the stack (corresponding to a different lexical + * scope of `this`), and whenever a function is exited, pop that entry off the stack. When an arrow function is entered, + * keep a reference to it on the current stack entry, and remove that reference when the arrow function is exited. + * When a lexical identifier is encountered, mark all the arrow functions on the current stack entry by adding them + * to an `arrowsWithLexicalIdentifiers` set. Any arrow function in that set will not be reported by this rule, + * because converting it into a method would change the value of one of the lexical identifiers. + */ + const lexicalScopeStack = []; + const arrowsWithLexicalIdentifiers = new WeakSet(); + const argumentsIdentifiers = new WeakSet(); + + /** + * Enters a function. This creates a new lexical identifier scope, so a new Set of arrow functions is pushed onto the stack. + * Also, this marks all `arguments` identifiers so that they can be detected later. + * @returns {void} + */ + function enterFunction() { + lexicalScopeStack.unshift(new Set()); + context.getScope().variables.filter(variable => variable.name === "arguments").forEach(variable => { + variable.references.map(ref => ref.identifier).forEach(identifier => argumentsIdentifiers.add(identifier)); + }); + } + + /** + * Exits a function. This pops the current set of arrow functions off the lexical scope stack. + * @returns {void} + */ + function exitFunction() { + lexicalScopeStack.shift(); + } + + /** + * Marks the current function as having a lexical keyword. This implies that all arrow functions + * in the current lexical scope contain a reference to this lexical keyword. + * @returns {void} + */ + function reportLexicalIdentifier() { + lexicalScopeStack[0].forEach(arrowFunction => arrowsWithLexicalIdentifiers.add(arrowFunction)); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program: enterFunction, + FunctionDeclaration: enterFunction, + FunctionExpression: enterFunction, + "Program:exit": exitFunction, + "FunctionDeclaration:exit": exitFunction, + "FunctionExpression:exit": exitFunction, + + ArrowFunctionExpression(node) { + lexicalScopeStack[0].add(node); + }, + "ArrowFunctionExpression:exit"(node) { + lexicalScopeStack[0].delete(node); + }, + + ThisExpression: reportLexicalIdentifier, + Super: reportLexicalIdentifier, + MetaProperty(node) { + if (node.meta.name === "new" && node.property.name === "target") { + reportLexicalIdentifier(); + } + }, + Identifier(node) { + if (argumentsIdentifiers.has(node)) { + reportLexicalIdentifier(); + } + }, + + ObjectExpression(node) { + if (APPLY_CONSISTENT) { + checkConsistency(node, false); + } else if (APPLY_CONSISTENT_AS_NEEDED) { + checkConsistency(node, true); + } + }, + + "Property:exit"(node) { + const isConciseProperty = node.method || node.shorthand; + + // Ignore destructuring assignment + if (node.parent.type === "ObjectPattern") { + return; + } + + // getters and setters are ignored + if (node.kind === "get" || node.kind === "set") { + return; + } + + // only computed methods can fail the following checks + if (node.computed && node.value.type !== "FunctionExpression" && node.value.type !== "ArrowFunctionExpression") { + return; + } + + //-------------------------------------------------------------- + // Checks for property/method shorthand. + if (isConciseProperty) { + if (node.method && (APPLY_NEVER || AVOID_QUOTES && isStringLiteral(node.key))) { + const messageId = APPLY_NEVER ? "expectedMethodLongform" : "expectedLiteralMethodLongform"; + + // { x() {} } should be written as { x: function() {} } + context.report({ + node, + messageId, + fix: fixer => makeFunctionLongform(fixer, node) + }); + } else if (APPLY_NEVER) { + + // { x } should be written as { x: x } + context.report({ + node, + messageId: "expectedPropertyLongform", + fix: fixer => fixer.insertTextAfter(node.key, `: ${node.key.name}`) + }); + } + } else if (APPLY_TO_METHODS && !node.value.id && (node.value.type === "FunctionExpression" || node.value.type === "ArrowFunctionExpression")) { + if (IGNORE_CONSTRUCTORS && node.key.type === "Identifier" && isConstructor(node.key.name)) { + return; + } + if (AVOID_QUOTES && isStringLiteral(node.key)) { + return; + } + + // {[x]: function(){}} should be written as {[x]() {}} + if (node.value.type === "FunctionExpression" || + node.value.type === "ArrowFunctionExpression" && + node.value.body.type === "BlockStatement" && + AVOID_EXPLICIT_RETURN_ARROWS && + !arrowsWithLexicalIdentifiers.has(node.value) + ) { + context.report({ + node, + messageId: "expectedMethodShorthand", + fix: fixer => makeFunctionShorthand(fixer, node) + }); + } + } else if (node.value.type === "Identifier" && node.key.name === node.value.name && APPLY_TO_PROPS) { + + // {x: x} should be written as {x} + context.report({ + node, + messageId: "expectedPropertyShorthand", + fix(fixer) { + return fixer.replaceText(node, node.value.name); + } + }); + } else if (node.value.type === "Identifier" && node.key.type === "Literal" && node.key.value === node.value.name && APPLY_TO_PROPS) { + if (AVOID_QUOTES) { + return; + } + + // {"x": x} should be written as {x} + context.report({ + node, + messageId: "expectedPropertyShorthand", + fix(fixer) { + return fixer.replaceText(node, node.value.name); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/one-var-declaration-per-line.js b/node_modules/eslint/lib/rules/one-var-declaration-per-line.js new file mode 100644 index 000000000..db4674760 --- /dev/null +++ b/node_modules/eslint/lib/rules/one-var-declaration-per-line.js @@ -0,0 +1,92 @@ +/** + * @fileoverview Rule to check multiple var declarations per line + * @author Alberto Rodríguez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require or disallow newlines around variable declarations", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/one-var-declaration-per-line" + }, + + schema: [ + { + enum: ["always", "initializations"] + } + ], + + fixable: "whitespace", + + messages: { + expectVarOnNewline: "Expected variable declaration to be on a new line." + } + }, + + create(context) { + + const always = context.options[0] === "always"; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + + /** + * Determine if provided keyword is a variant of for specifiers + * @private + * @param {string} keyword keyword to test + * @returns {boolean} True if `keyword` is a variant of for specifier + */ + function isForTypeSpecifier(keyword) { + return keyword === "ForStatement" || keyword === "ForInStatement" || keyword === "ForOfStatement"; + } + + /** + * Checks newlines around variable declarations. + * @private + * @param {ASTNode} node `VariableDeclaration` node to test + * @returns {void} + */ + function checkForNewLine(node) { + if (isForTypeSpecifier(node.parent.type)) { + return; + } + + const declarations = node.declarations; + let prev; + + declarations.forEach(current => { + if (prev && prev.loc.end.line === current.loc.start.line) { + if (always || prev.init || current.init) { + context.report({ + node, + messageId: "expectVarOnNewline", + loc: current.loc, + fix: fixer => fixer.insertTextBefore(current, "\n") + }); + } + } + prev = current; + }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + VariableDeclaration: checkForNewLine + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/one-var.js b/node_modules/eslint/lib/rules/one-var.js new file mode 100644 index 000000000..c31a0d2b1 --- /dev/null +++ b/node_modules/eslint/lib/rules/one-var.js @@ -0,0 +1,535 @@ +/** + * @fileoverview A rule to control the use of single variable declarations. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce variables to be declared either together or separately in functions", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/one-var" + }, + + fixable: "code", + + schema: [ + { + oneOf: [ + { + enum: ["always", "never", "consecutive"] + }, + { + type: "object", + properties: { + separateRequires: { + type: "boolean" + }, + var: { + enum: ["always", "never", "consecutive"] + }, + let: { + enum: ["always", "never", "consecutive"] + }, + const: { + enum: ["always", "never", "consecutive"] + } + }, + additionalProperties: false + }, + { + type: "object", + properties: { + initialized: { + enum: ["always", "never", "consecutive"] + }, + uninitialized: { + enum: ["always", "never", "consecutive"] + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + combineUninitialized: "Combine this with the previous '{{type}}' statement with uninitialized variables.", + combineInitialized: "Combine this with the previous '{{type}}' statement with initialized variables.", + splitUninitialized: "Split uninitialized '{{type}}' declarations into multiple statements.", + splitInitialized: "Split initialized '{{type}}' declarations into multiple statements.", + splitRequires: "Split requires to be separated into a single block.", + combine: "Combine this with the previous '{{type}}' statement.", + split: "Split '{{type}}' declarations into multiple statements." + } + }, + + create(context) { + const MODE_ALWAYS = "always"; + const MODE_NEVER = "never"; + const MODE_CONSECUTIVE = "consecutive"; + const mode = context.options[0] || MODE_ALWAYS; + + const options = {}; + + if (typeof mode === "string") { // simple options configuration with just a string + options.var = { uninitialized: mode, initialized: mode }; + options.let = { uninitialized: mode, initialized: mode }; + options.const = { uninitialized: mode, initialized: mode }; + } else if (typeof mode === "object") { // options configuration is an object + options.separateRequires = !!mode.separateRequires; + options.var = { uninitialized: mode.var, initialized: mode.var }; + options.let = { uninitialized: mode.let, initialized: mode.let }; + options.const = { uninitialized: mode.const, initialized: mode.const }; + if (Object.prototype.hasOwnProperty.call(mode, "uninitialized")) { + options.var.uninitialized = mode.uninitialized; + options.let.uninitialized = mode.uninitialized; + options.const.uninitialized = mode.uninitialized; + } + if (Object.prototype.hasOwnProperty.call(mode, "initialized")) { + options.var.initialized = mode.initialized; + options.let.initialized = mode.initialized; + options.const.initialized = mode.initialized; + } + } + + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const functionStack = []; + const blockStack = []; + + /** + * Increments the blockStack counter. + * @returns {void} + * @private + */ + function startBlock() { + blockStack.push({ + let: { initialized: false, uninitialized: false }, + const: { initialized: false, uninitialized: false } + }); + } + + /** + * Increments the functionStack counter. + * @returns {void} + * @private + */ + function startFunction() { + functionStack.push({ initialized: false, uninitialized: false }); + startBlock(); + } + + /** + * Decrements the blockStack counter. + * @returns {void} + * @private + */ + function endBlock() { + blockStack.pop(); + } + + /** + * Decrements the functionStack counter. + * @returns {void} + * @private + */ + function endFunction() { + functionStack.pop(); + endBlock(); + } + + /** + * Check if a variable declaration is a require. + * @param {ASTNode} decl variable declaration Node + * @returns {bool} if decl is a require, return true; else return false. + * @private + */ + function isRequire(decl) { + return decl.init && decl.init.type === "CallExpression" && decl.init.callee.name === "require"; + } + + /** + * Records whether initialized/uninitialized/required variables are defined in current scope. + * @param {string} statementType node.kind, one of: "var", "let", or "const" + * @param {ASTNode[]} declarations List of declarations + * @param {Object} currentScope The scope being investigated + * @returns {void} + * @private + */ + function recordTypes(statementType, declarations, currentScope) { + for (let i = 0; i < declarations.length; i++) { + if (declarations[i].init === null) { + if (options[statementType] && options[statementType].uninitialized === MODE_ALWAYS) { + currentScope.uninitialized = true; + } + } else { + if (options[statementType] && options[statementType].initialized === MODE_ALWAYS) { + if (options.separateRequires && isRequire(declarations[i])) { + currentScope.required = true; + } else { + currentScope.initialized = true; + } + } + } + } + } + + /** + * Determines the current scope (function or block) + * @param {string} statementType node.kind, one of: "var", "let", or "const" + * @returns {Object} The scope associated with statementType + */ + function getCurrentScope(statementType) { + let currentScope; + + if (statementType === "var") { + currentScope = functionStack[functionStack.length - 1]; + } else if (statementType === "let") { + currentScope = blockStack[blockStack.length - 1].let; + } else if (statementType === "const") { + currentScope = blockStack[blockStack.length - 1].const; + } + return currentScope; + } + + /** + * Counts the number of initialized and uninitialized declarations in a list of declarations + * @param {ASTNode[]} declarations List of declarations + * @returns {Object} Counts of 'uninitialized' and 'initialized' declarations + * @private + */ + function countDeclarations(declarations) { + const counts = { uninitialized: 0, initialized: 0 }; + + for (let i = 0; i < declarations.length; i++) { + if (declarations[i].init === null) { + counts.uninitialized++; + } else { + counts.initialized++; + } + } + return counts; + } + + /** + * Determines if there is more than one var statement in the current scope. + * @param {string} statementType node.kind, one of: "var", "let", or "const" + * @param {ASTNode[]} declarations List of declarations + * @returns {boolean} Returns true if it is the first var declaration, false if not. + * @private + */ + function hasOnlyOneStatement(statementType, declarations) { + + const declarationCounts = countDeclarations(declarations); + const currentOptions = options[statementType] || {}; + const currentScope = getCurrentScope(statementType); + const hasRequires = declarations.some(isRequire); + + if (currentOptions.uninitialized === MODE_ALWAYS && currentOptions.initialized === MODE_ALWAYS) { + if (currentScope.uninitialized || currentScope.initialized) { + if (!hasRequires) { + return false; + } + } + } + + if (declarationCounts.uninitialized > 0) { + if (currentOptions.uninitialized === MODE_ALWAYS && currentScope.uninitialized) { + return false; + } + } + if (declarationCounts.initialized > 0) { + if (currentOptions.initialized === MODE_ALWAYS && currentScope.initialized) { + if (!hasRequires) { + return false; + } + } + } + if (currentScope.required && hasRequires) { + return false; + } + recordTypes(statementType, declarations, currentScope); + return true; + } + + /** + * Fixer to join VariableDeclaration's into a single declaration + * @param {VariableDeclarator[]} declarations The `VariableDeclaration` to join + * @returns {Function} The fixer function + */ + function joinDeclarations(declarations) { + const declaration = declarations[0]; + const body = Array.isArray(declaration.parent.parent.body) ? declaration.parent.parent.body : []; + const currentIndex = body.findIndex(node => node.range[0] === declaration.parent.range[0]); + const previousNode = body[currentIndex - 1]; + + return fixer => { + const type = sourceCode.getTokenBefore(declaration); + const prevSemi = sourceCode.getTokenBefore(type); + const res = []; + + if (previousNode && previousNode.kind === sourceCode.getText(type)) { + if (prevSemi.value === ";") { + res.push(fixer.replaceText(prevSemi, ",")); + } else { + res.push(fixer.insertTextAfter(prevSemi, ",")); + } + res.push(fixer.replaceText(type, "")); + } + + return res; + }; + } + + /** + * Fixer to split a VariableDeclaration into individual declarations + * @param {VariableDeclaration} declaration The `VariableDeclaration` to split + * @returns {Function} The fixer function + */ + function splitDeclarations(declaration) { + return fixer => declaration.declarations.map(declarator => { + const tokenAfterDeclarator = sourceCode.getTokenAfter(declarator); + + if (tokenAfterDeclarator === null) { + return null; + } + + const afterComma = sourceCode.getTokenAfter(tokenAfterDeclarator, { includeComments: true }); + + if (tokenAfterDeclarator.value !== ",") { + return null; + } + + /* + * `var x,y` + * tokenAfterDeclarator ^^ afterComma + */ + if (afterComma.range[0] === tokenAfterDeclarator.range[1]) { + return fixer.replaceText(tokenAfterDeclarator, `; ${declaration.kind} `); + } + + /* + * `var x, + * tokenAfterDeclarator ^ + * y` + * ^ afterComma + */ + if ( + afterComma.loc.start.line > tokenAfterDeclarator.loc.end.line || + afterComma.type === "Line" || + afterComma.type === "Block" + ) { + let lastComment = afterComma; + + while (lastComment.type === "Line" || lastComment.type === "Block") { + lastComment = sourceCode.getTokenAfter(lastComment, { includeComments: true }); + } + + return fixer.replaceTextRange( + [tokenAfterDeclarator.range[0], lastComment.range[0]], + `;${sourceCode.text.slice(tokenAfterDeclarator.range[1], lastComment.range[0])}${declaration.kind} ` + ); + } + + return fixer.replaceText(tokenAfterDeclarator, `; ${declaration.kind}`); + }).filter(x => x); + } + + /** + * Checks a given VariableDeclaration node for errors. + * @param {ASTNode} node The VariableDeclaration node to check + * @returns {void} + * @private + */ + function checkVariableDeclaration(node) { + const parent = node.parent; + const type = node.kind; + + if (!options[type]) { + return; + } + + const declarations = node.declarations; + const declarationCounts = countDeclarations(declarations); + const mixedRequires = declarations.some(isRequire) && !declarations.every(isRequire); + + if (options[type].initialized === MODE_ALWAYS) { + if (options.separateRequires && mixedRequires) { + context.report({ + node, + messageId: "splitRequires" + }); + } + } + + // consecutive + const nodeIndex = (parent.body && parent.body.length > 0 && parent.body.indexOf(node)) || 0; + + if (nodeIndex > 0) { + const previousNode = parent.body[nodeIndex - 1]; + const isPreviousNodeDeclaration = previousNode.type === "VariableDeclaration"; + const declarationsWithPrevious = declarations.concat(previousNode.declarations || []); + + if ( + isPreviousNodeDeclaration && + previousNode.kind === type && + !(declarationsWithPrevious.some(isRequire) && !declarationsWithPrevious.every(isRequire)) + ) { + const previousDeclCounts = countDeclarations(previousNode.declarations); + + if (options[type].initialized === MODE_CONSECUTIVE && options[type].uninitialized === MODE_CONSECUTIVE) { + context.report({ + node, + messageId: "combine", + data: { + type + }, + fix: joinDeclarations(declarations) + }); + } else if (options[type].initialized === MODE_CONSECUTIVE && declarationCounts.initialized > 0 && previousDeclCounts.initialized > 0) { + context.report({ + node, + messageId: "combineInitialized", + data: { + type + }, + fix: joinDeclarations(declarations) + }); + } else if (options[type].uninitialized === MODE_CONSECUTIVE && + declarationCounts.uninitialized > 0 && + previousDeclCounts.uninitialized > 0) { + context.report({ + node, + messageId: "combineUninitialized", + data: { + type + }, + fix: joinDeclarations(declarations) + }); + } + } + } + + // always + if (!hasOnlyOneStatement(type, declarations)) { + if (options[type].initialized === MODE_ALWAYS && options[type].uninitialized === MODE_ALWAYS) { + context.report({ + node, + messageId: "combine", + data: { + type + }, + fix: joinDeclarations(declarations) + }); + } else { + if (options[type].initialized === MODE_ALWAYS && declarationCounts.initialized > 0) { + context.report({ + node, + messageId: "combineInitialized", + data: { + type + }, + fix: joinDeclarations(declarations) + }); + } + if (options[type].uninitialized === MODE_ALWAYS && declarationCounts.uninitialized > 0) { + if (node.parent.left === node && (node.parent.type === "ForInStatement" || node.parent.type === "ForOfStatement")) { + return; + } + context.report({ + node, + messageId: "combineUninitialized", + data: { + type + }, + fix: joinDeclarations(declarations) + }); + } + } + } + + // never + if (parent.type !== "ForStatement" || parent.init !== node) { + const totalDeclarations = declarationCounts.uninitialized + declarationCounts.initialized; + + if (totalDeclarations > 1) { + if (options[type].initialized === MODE_NEVER && options[type].uninitialized === MODE_NEVER) { + + // both initialized and uninitialized + context.report({ + node, + messageId: "split", + data: { + type + }, + fix: splitDeclarations(node) + }); + } else if (options[type].initialized === MODE_NEVER && declarationCounts.initialized > 0) { + + // initialized + context.report({ + node, + messageId: "splitInitialized", + data: { + type + }, + fix: splitDeclarations(node) + }); + } else if (options[type].uninitialized === MODE_NEVER && declarationCounts.uninitialized > 0) { + + // uninitialized + context.report({ + node, + messageId: "splitUninitialized", + data: { + type + }, + fix: splitDeclarations(node) + }); + } + } + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + Program: startFunction, + FunctionDeclaration: startFunction, + FunctionExpression: startFunction, + ArrowFunctionExpression: startFunction, + BlockStatement: startBlock, + ForStatement: startBlock, + ForInStatement: startBlock, + ForOfStatement: startBlock, + SwitchStatement: startBlock, + VariableDeclaration: checkVariableDeclaration, + "ForStatement:exit": endBlock, + "ForOfStatement:exit": endBlock, + "ForInStatement:exit": endBlock, + "SwitchStatement:exit": endBlock, + "BlockStatement:exit": endBlock, + "Program:exit": endFunction, + "FunctionDeclaration:exit": endFunction, + "FunctionExpression:exit": endFunction, + "ArrowFunctionExpression:exit": endFunction + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/operator-assignment.js b/node_modules/eslint/lib/rules/operator-assignment.js new file mode 100644 index 000000000..fdb088492 --- /dev/null +++ b/node_modules/eslint/lib/rules/operator-assignment.js @@ -0,0 +1,204 @@ +/** + * @fileoverview Rule to replace assignment expressions with operator assignment + * @author Brandon Mills + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether an operator is commutative and has an operator assignment + * shorthand form. + * @param {string} operator Operator to check. + * @returns {boolean} True if the operator is commutative and has a + * shorthand form. + */ +function isCommutativeOperatorWithShorthand(operator) { + return ["*", "&", "^", "|"].indexOf(operator) >= 0; +} + +/** + * Checks whether an operator is not commutative and has an operator assignment + * shorthand form. + * @param {string} operator Operator to check. + * @returns {boolean} True if the operator is not commutative and has + * a shorthand form. + */ +function isNonCommutativeOperatorWithShorthand(operator) { + return ["+", "-", "/", "%", "<<", ">>", ">>>", "**"].indexOf(operator) >= 0; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** + * Determines if the left side of a node can be safely fixed (i.e. if it activates the same getters/setters and) + * toString calls regardless of whether assignment shorthand is used) + * @param {ASTNode} node The node on the left side of the expression + * @returns {boolean} `true` if the node can be fixed + */ +function canBeFixed(node) { + return ( + node.type === "Identifier" || + ( + node.type === "MemberExpression" && + (node.object.type === "Identifier" || node.object.type === "ThisExpression") && + (!node.computed || node.property.type === "Literal") + ) + ); +} + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require or disallow assignment operator shorthand where possible", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/operator-assignment" + }, + + schema: [ + { + enum: ["always", "never"] + } + ], + + fixable: "code", + messages: { + replaced: "Assignment can be replaced with operator assignment.", + unexpected: "Unexpected operator assignment shorthand." + } + }, + + create(context) { + + const sourceCode = context.getSourceCode(); + + /** + * Returns the operator token of an AssignmentExpression or BinaryExpression + * @param {ASTNode} node An AssignmentExpression or BinaryExpression node + * @returns {Token} The operator token in the node + */ + function getOperatorToken(node) { + return sourceCode.getFirstTokenBetween(node.left, node.right, token => token.value === node.operator); + } + + /** + * Ensures that an assignment uses the shorthand form where possible. + * @param {ASTNode} node An AssignmentExpression node. + * @returns {void} + */ + function verify(node) { + if (node.operator !== "=" || node.right.type !== "BinaryExpression") { + return; + } + + const left = node.left; + const expr = node.right; + const operator = expr.operator; + + if (isCommutativeOperatorWithShorthand(operator) || isNonCommutativeOperatorWithShorthand(operator)) { + if (astUtils.isSameReference(left, expr.left, true)) { + context.report({ + node, + messageId: "replaced", + fix(fixer) { + if (canBeFixed(left) && canBeFixed(expr.left)) { + const equalsToken = getOperatorToken(node); + const operatorToken = getOperatorToken(expr); + const leftText = sourceCode.getText().slice(node.range[0], equalsToken.range[0]); + const rightText = sourceCode.getText().slice(operatorToken.range[1], node.right.range[1]); + + // Check for comments that would be removed. + if (sourceCode.commentsExistBetween(equalsToken, operatorToken)) { + return null; + } + + return fixer.replaceText(node, `${leftText}${expr.operator}=${rightText}`); + } + return null; + } + }); + } else if (astUtils.isSameReference(left, expr.right, true) && isCommutativeOperatorWithShorthand(operator)) { + + /* + * This case can't be fixed safely. + * If `a` and `b` both have custom valueOf() behavior, then fixing `a = b * a` to `a *= b` would + * change the execution order of the valueOf() functions. + */ + context.report({ + node, + messageId: "replaced" + }); + } + } + } + + /** + * Warns if an assignment expression uses operator assignment shorthand. + * @param {ASTNode} node An AssignmentExpression node. + * @returns {void} + */ + function prohibit(node) { + if (node.operator !== "=" && !astUtils.isLogicalAssignmentOperator(node.operator)) { + context.report({ + node, + messageId: "unexpected", + fix(fixer) { + if (canBeFixed(node.left)) { + const firstToken = sourceCode.getFirstToken(node); + const operatorToken = getOperatorToken(node); + const leftText = sourceCode.getText().slice(node.range[0], operatorToken.range[0]); + const newOperator = node.operator.slice(0, -1); + let rightText; + + // Check for comments that would be duplicated. + if (sourceCode.commentsExistBetween(firstToken, operatorToken)) { + return null; + } + + // If this change would modify precedence (e.g. `foo *= bar + 1` => `foo = foo * (bar + 1)`), parenthesize the right side. + if ( + astUtils.getPrecedence(node.right) <= astUtils.getPrecedence({ type: "BinaryExpression", operator: newOperator }) && + !astUtils.isParenthesised(sourceCode, node.right) + ) { + rightText = `${sourceCode.text.slice(operatorToken.range[1], node.right.range[0])}(${sourceCode.getText(node.right)})`; + } else { + const tokenAfterOperator = sourceCode.getTokenAfter(operatorToken, { includeComments: true }); + let rightTextPrefix = ""; + + if ( + operatorToken.range[1] === tokenAfterOperator.range[0] && + !astUtils.canTokensBeAdjacent({ type: "Punctuator", value: newOperator }, tokenAfterOperator) + ) { + rightTextPrefix = " "; // foo+=+bar -> foo= foo+ +bar + } + + rightText = `${rightTextPrefix}${sourceCode.text.slice(operatorToken.range[1], node.range[1])}`; + } + + return fixer.replaceText(node, `${leftText}= ${leftText}${newOperator}${rightText}`); + } + return null; + } + }); + } + } + + return { + AssignmentExpression: context.options[0] !== "never" ? verify : prohibit + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/operator-linebreak.js b/node_modules/eslint/lib/rules/operator-linebreak.js new file mode 100644 index 000000000..18da5c55b --- /dev/null +++ b/node_modules/eslint/lib/rules/operator-linebreak.js @@ -0,0 +1,247 @@ +/** + * @fileoverview Operator linebreak - enforces operator linebreak style of two types: after and before + * @author Benoît Zugmeyer + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent linebreak style for operators", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/operator-linebreak" + }, + + schema: [ + { + enum: ["after", "before", "none", null] + }, + { + type: "object", + properties: { + overrides: { + type: "object", + additionalProperties: { + enum: ["after", "before", "none", "ignore"] + } + } + }, + additionalProperties: false + } + ], + + fixable: "code", + + messages: { + operatorAtBeginning: "'{{operator}}' should be placed at the beginning of the line.", + operatorAtEnd: "'{{operator}}' should be placed at the end of the line.", + badLinebreak: "Bad line breaking before and after '{{operator}}'.", + noLinebreak: "There should be no line break before or after '{{operator}}'." + } + }, + + create(context) { + + const usedDefaultGlobal = !context.options[0]; + const globalStyle = context.options[0] || "after"; + const options = context.options[1] || {}; + const styleOverrides = options.overrides ? Object.assign({}, options.overrides) : {}; + + if (usedDefaultGlobal && !styleOverrides["?"]) { + styleOverrides["?"] = "before"; + } + + if (usedDefaultGlobal && !styleOverrides[":"]) { + styleOverrides[":"] = "before"; + } + + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Gets a fixer function to fix rule issues + * @param {Token} operatorToken The operator token of an expression + * @param {string} desiredStyle The style for the rule. One of 'before', 'after', 'none' + * @returns {Function} A fixer function + */ + function getFixer(operatorToken, desiredStyle) { + return fixer => { + const tokenBefore = sourceCode.getTokenBefore(operatorToken); + const tokenAfter = sourceCode.getTokenAfter(operatorToken); + const textBefore = sourceCode.text.slice(tokenBefore.range[1], operatorToken.range[0]); + const textAfter = sourceCode.text.slice(operatorToken.range[1], tokenAfter.range[0]); + const hasLinebreakBefore = !astUtils.isTokenOnSameLine(tokenBefore, operatorToken); + const hasLinebreakAfter = !astUtils.isTokenOnSameLine(operatorToken, tokenAfter); + let newTextBefore, newTextAfter; + + if (hasLinebreakBefore !== hasLinebreakAfter && desiredStyle !== "none") { + + // If there is a comment before and after the operator, don't do a fix. + if (sourceCode.getTokenBefore(operatorToken, { includeComments: true }) !== tokenBefore && + sourceCode.getTokenAfter(operatorToken, { includeComments: true }) !== tokenAfter) { + + return null; + } + + /* + * If there is only one linebreak and it's on the wrong side of the operator, swap the text before and after the operator. + * foo && + * bar + * would get fixed to + * foo + * && bar + */ + newTextBefore = textAfter; + newTextAfter = textBefore; + } else { + const LINEBREAK_REGEX = astUtils.createGlobalLinebreakMatcher(); + + // Otherwise, if no linebreak is desired and no comments interfere, replace the linebreaks with empty strings. + newTextBefore = desiredStyle === "before" || textBefore.trim() ? textBefore : textBefore.replace(LINEBREAK_REGEX, ""); + newTextAfter = desiredStyle === "after" || textAfter.trim() ? textAfter : textAfter.replace(LINEBREAK_REGEX, ""); + + // If there was no change (due to interfering comments), don't output a fix. + if (newTextBefore === textBefore && newTextAfter === textAfter) { + return null; + } + } + + if (newTextAfter === "" && tokenAfter.type === "Punctuator" && "+-".includes(operatorToken.value) && tokenAfter.value === operatorToken.value) { + + // To avoid accidentally creating a ++ or -- operator, insert a space if the operator is a +/- and the following token is a unary +/-. + newTextAfter += " "; + } + + return fixer.replaceTextRange([tokenBefore.range[1], tokenAfter.range[0]], newTextBefore + operatorToken.value + newTextAfter); + }; + } + + /** + * Checks the operator placement + * @param {ASTNode} node The node to check + * @param {ASTNode} leftSide The node that comes before the operator in `node` + * @private + * @returns {void} + */ + function validateNode(node, leftSide) { + + /* + * When the left part of a binary expression is a single expression wrapped in + * parentheses (ex: `(a) + b`), leftToken will be the last token of the expression + * and operatorToken will be the closing parenthesis. + * The leftToken should be the last closing parenthesis, and the operatorToken + * should be the token right after that. + */ + const operatorToken = sourceCode.getTokenAfter(leftSide, astUtils.isNotClosingParenToken); + const leftToken = sourceCode.getTokenBefore(operatorToken); + const rightToken = sourceCode.getTokenAfter(operatorToken); + const operator = operatorToken.value; + const operatorStyleOverride = styleOverrides[operator]; + const style = operatorStyleOverride || globalStyle; + const fix = getFixer(operatorToken, style); + + // if single line + if (astUtils.isTokenOnSameLine(leftToken, operatorToken) && + astUtils.isTokenOnSameLine(operatorToken, rightToken)) { + + // do nothing. + + } else if (operatorStyleOverride !== "ignore" && !astUtils.isTokenOnSameLine(leftToken, operatorToken) && + !astUtils.isTokenOnSameLine(operatorToken, rightToken)) { + + // lone operator + context.report({ + node, + loc: operatorToken.loc, + messageId: "badLinebreak", + data: { + operator + }, + fix + }); + + } else if (style === "before" && astUtils.isTokenOnSameLine(leftToken, operatorToken)) { + + context.report({ + node, + loc: operatorToken.loc, + messageId: "operatorAtBeginning", + data: { + operator + }, + fix + }); + + } else if (style === "after" && astUtils.isTokenOnSameLine(operatorToken, rightToken)) { + + context.report({ + node, + loc: operatorToken.loc, + messageId: "operatorAtEnd", + data: { + operator + }, + fix + }); + + } else if (style === "none") { + + context.report({ + node, + loc: operatorToken.loc, + messageId: "noLinebreak", + data: { + operator + }, + fix + }); + + } + } + + /** + * Validates a binary expression using `validateNode` + * @param {BinaryExpression|LogicalExpression|AssignmentExpression} node node to be validated + * @returns {void} + */ + function validateBinaryExpression(node) { + validateNode(node, node.left); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + BinaryExpression: validateBinaryExpression, + LogicalExpression: validateBinaryExpression, + AssignmentExpression: validateBinaryExpression, + VariableDeclarator(node) { + if (node.init) { + validateNode(node, node.id); + } + }, + ConditionalExpression(node) { + validateNode(node, node.test); + validateNode(node, node.consequent); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/padded-blocks.js b/node_modules/eslint/lib/rules/padded-blocks.js new file mode 100644 index 000000000..f8b5bd977 --- /dev/null +++ b/node_modules/eslint/lib/rules/padded-blocks.js @@ -0,0 +1,298 @@ +/** + * @fileoverview A rule to ensure blank lines within blocks. + * @author Mathias Schreck + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow padding within blocks", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/padded-blocks" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + blocks: { + enum: ["always", "never"] + }, + switches: { + enum: ["always", "never"] + }, + classes: { + enum: ["always", "never"] + } + }, + additionalProperties: false, + minProperties: 1 + } + ] + }, + { + type: "object", + properties: { + allowSingleLineBlocks: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + alwaysPadBlock: "Block must be padded by blank lines.", + neverPadBlock: "Block must not be padded by blank lines." + } + }, + + create(context) { + const options = {}; + const typeOptions = context.options[0] || "always"; + const exceptOptions = context.options[1] || {}; + + if (typeof typeOptions === "string") { + const shouldHavePadding = typeOptions === "always"; + + options.blocks = shouldHavePadding; + options.switches = shouldHavePadding; + options.classes = shouldHavePadding; + } else { + if (Object.prototype.hasOwnProperty.call(typeOptions, "blocks")) { + options.blocks = typeOptions.blocks === "always"; + } + if (Object.prototype.hasOwnProperty.call(typeOptions, "switches")) { + options.switches = typeOptions.switches === "always"; + } + if (Object.prototype.hasOwnProperty.call(typeOptions, "classes")) { + options.classes = typeOptions.classes === "always"; + } + } + + if (Object.prototype.hasOwnProperty.call(exceptOptions, "allowSingleLineBlocks")) { + options.allowSingleLineBlocks = exceptOptions.allowSingleLineBlocks === true; + } + + const sourceCode = context.getSourceCode(); + + /** + * Gets the open brace token from a given node. + * @param {ASTNode} node A BlockStatement or SwitchStatement node from which to get the open brace. + * @returns {Token} The token of the open brace. + */ + function getOpenBrace(node) { + if (node.type === "SwitchStatement") { + return sourceCode.getTokenBefore(node.cases[0]); + } + return sourceCode.getFirstToken(node); + } + + /** + * Checks if the given parameter is a comment node + * @param {ASTNode|Token} node An AST node or token + * @returns {boolean} True if node is a comment + */ + function isComment(node) { + return node.type === "Line" || node.type === "Block"; + } + + /** + * Checks if there is padding between two tokens + * @param {Token} first The first token + * @param {Token} second The second token + * @returns {boolean} True if there is at least a line between the tokens + */ + function isPaddingBetweenTokens(first, second) { + return second.loc.start.line - first.loc.end.line >= 2; + } + + + /** + * Checks if the given token has a blank line after it. + * @param {Token} token The token to check. + * @returns {boolean} Whether or not the token is followed by a blank line. + */ + function getFirstBlockToken(token) { + let prev, + first = token; + + do { + prev = first; + first = sourceCode.getTokenAfter(first, { includeComments: true }); + } while (isComment(first) && first.loc.start.line === prev.loc.end.line); + + return first; + } + + /** + * Checks if the given token is preceded by a blank line. + * @param {Token} token The token to check + * @returns {boolean} Whether or not the token is preceded by a blank line + */ + function getLastBlockToken(token) { + let last = token, + next; + + do { + next = last; + last = sourceCode.getTokenBefore(last, { includeComments: true }); + } while (isComment(last) && last.loc.end.line === next.loc.start.line); + + return last; + } + + /** + * Checks if a node should be padded, according to the rule config. + * @param {ASTNode} node The AST node to check. + * @returns {boolean} True if the node should be padded, false otherwise. + */ + function requirePaddingFor(node) { + switch (node.type) { + case "BlockStatement": + return options.blocks; + case "SwitchStatement": + return options.switches; + case "ClassBody": + return options.classes; + + /* istanbul ignore next */ + default: + throw new Error("unreachable"); + } + } + + /** + * Checks the given BlockStatement node to be padded if the block is not empty. + * @param {ASTNode} node The AST node of a BlockStatement. + * @returns {void} undefined. + */ + function checkPadding(node) { + const openBrace = getOpenBrace(node), + firstBlockToken = getFirstBlockToken(openBrace), + tokenBeforeFirst = sourceCode.getTokenBefore(firstBlockToken, { includeComments: true }), + closeBrace = sourceCode.getLastToken(node), + lastBlockToken = getLastBlockToken(closeBrace), + tokenAfterLast = sourceCode.getTokenAfter(lastBlockToken, { includeComments: true }), + blockHasTopPadding = isPaddingBetweenTokens(tokenBeforeFirst, firstBlockToken), + blockHasBottomPadding = isPaddingBetweenTokens(lastBlockToken, tokenAfterLast); + + if (options.allowSingleLineBlocks && astUtils.isTokenOnSameLine(tokenBeforeFirst, tokenAfterLast)) { + return; + } + + if (requirePaddingFor(node)) { + + if (!blockHasTopPadding) { + context.report({ + node, + loc: { + start: tokenBeforeFirst.loc.start, + end: firstBlockToken.loc.start + }, + fix(fixer) { + return fixer.insertTextAfter(tokenBeforeFirst, "\n"); + }, + messageId: "alwaysPadBlock" + }); + } + if (!blockHasBottomPadding) { + context.report({ + node, + loc: { + end: tokenAfterLast.loc.start, + start: lastBlockToken.loc.end + }, + fix(fixer) { + return fixer.insertTextBefore(tokenAfterLast, "\n"); + }, + messageId: "alwaysPadBlock" + }); + } + } else { + if (blockHasTopPadding) { + + context.report({ + node, + loc: { + start: tokenBeforeFirst.loc.start, + end: firstBlockToken.loc.start + }, + fix(fixer) { + return fixer.replaceTextRange([tokenBeforeFirst.range[1], firstBlockToken.range[0] - firstBlockToken.loc.start.column], "\n"); + }, + messageId: "neverPadBlock" + }); + } + + if (blockHasBottomPadding) { + + context.report({ + node, + loc: { + end: tokenAfterLast.loc.start, + start: lastBlockToken.loc.end + }, + messageId: "neverPadBlock", + fix(fixer) { + return fixer.replaceTextRange([lastBlockToken.range[1], tokenAfterLast.range[0] - tokenAfterLast.loc.start.column], "\n"); + } + }); + } + } + } + + const rule = {}; + + if (Object.prototype.hasOwnProperty.call(options, "switches")) { + rule.SwitchStatement = function(node) { + if (node.cases.length === 0) { + return; + } + checkPadding(node); + }; + } + + if (Object.prototype.hasOwnProperty.call(options, "blocks")) { + rule.BlockStatement = function(node) { + if (node.body.length === 0) { + return; + } + checkPadding(node); + }; + } + + if (Object.prototype.hasOwnProperty.call(options, "classes")) { + rule.ClassBody = function(node) { + if (node.body.length === 0) { + return; + } + checkPadding(node); + }; + } + + return rule; + } +}; diff --git a/node_modules/eslint/lib/rules/padding-line-between-statements.js b/node_modules/eslint/lib/rules/padding-line-between-statements.js new file mode 100644 index 000000000..c97b9956b --- /dev/null +++ b/node_modules/eslint/lib/rules/padding-line-between-statements.js @@ -0,0 +1,632 @@ +/** + * @fileoverview Rule to require or disallow newlines between statements + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const LT = `[${Array.from(astUtils.LINEBREAKS).join("")}]`; +const PADDING_LINE_SEQUENCE = new RegExp( + String.raw`^(\s*?${LT})\s*${LT}(\s*;?)$`, + "u" +); +const CJS_EXPORT = /^(?:module\s*\.\s*)?exports(?:\s*\.|\s*\[|$)/u; +const CJS_IMPORT = /^require\(/u; + +/** + * Creates tester which check if a node starts with specific keyword. + * @param {string} keyword The keyword to test. + * @returns {Object} the created tester. + * @private + */ +function newKeywordTester(keyword) { + return { + test: (node, sourceCode) => + sourceCode.getFirstToken(node).value === keyword + }; +} + +/** + * Creates tester which check if a node starts with specific keyword and spans a single line. + * @param {string} keyword The keyword to test. + * @returns {Object} the created tester. + * @private + */ +function newSinglelineKeywordTester(keyword) { + return { + test: (node, sourceCode) => + node.loc.start.line === node.loc.end.line && + sourceCode.getFirstToken(node).value === keyword + }; +} + +/** + * Creates tester which check if a node starts with specific keyword and spans multiple lines. + * @param {string} keyword The keyword to test. + * @returns {Object} the created tester. + * @private + */ +function newMultilineKeywordTester(keyword) { + return { + test: (node, sourceCode) => + node.loc.start.line !== node.loc.end.line && + sourceCode.getFirstToken(node).value === keyword + }; +} + +/** + * Creates tester which check if a node is specific type. + * @param {string} type The node type to test. + * @returns {Object} the created tester. + * @private + */ +function newNodeTypeTester(type) { + return { + test: node => + node.type === type + }; +} + +/** + * Checks the given node is an expression statement of IIFE. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is an expression statement of IIFE. + * @private + */ +function isIIFEStatement(node) { + if (node.type === "ExpressionStatement") { + let call = astUtils.skipChainExpression(node.expression); + + if (call.type === "UnaryExpression") { + call = astUtils.skipChainExpression(call.argument); + } + return call.type === "CallExpression" && astUtils.isFunction(call.callee); + } + return false; +} + +/** + * Checks whether the given node is a block-like statement. + * This checks the last token of the node is the closing brace of a block. + * @param {SourceCode} sourceCode The source code to get tokens. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is a block-like statement. + * @private + */ +function isBlockLikeStatement(sourceCode, node) { + + // do-while with a block is a block-like statement. + if (node.type === "DoWhileStatement" && node.body.type === "BlockStatement") { + return true; + } + + /* + * IIFE is a block-like statement specially from + * JSCS#disallowPaddingNewLinesAfterBlocks. + */ + if (isIIFEStatement(node)) { + return true; + } + + // Checks the last token is a closing brace of blocks. + const lastToken = sourceCode.getLastToken(node, astUtils.isNotSemicolonToken); + const belongingNode = lastToken && astUtils.isClosingBraceToken(lastToken) + ? sourceCode.getNodeByRangeIndex(lastToken.range[0]) + : null; + + return Boolean(belongingNode) && ( + belongingNode.type === "BlockStatement" || + belongingNode.type === "SwitchStatement" + ); +} + +/** + * Check whether the given node is a directive or not. + * @param {ASTNode} node The node to check. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {boolean} `true` if the node is a directive. + */ +function isDirective(node, sourceCode) { + return ( + node.type === "ExpressionStatement" && + ( + node.parent.type === "Program" || + ( + node.parent.type === "BlockStatement" && + astUtils.isFunction(node.parent.parent) + ) + ) && + node.expression.type === "Literal" && + typeof node.expression.value === "string" && + !astUtils.isParenthesised(sourceCode, node.expression) + ); +} + +/** + * Check whether the given node is a part of directive prologue or not. + * @param {ASTNode} node The node to check. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {boolean} `true` if the node is a part of directive prologue. + */ +function isDirectivePrologue(node, sourceCode) { + if (isDirective(node, sourceCode)) { + for (const sibling of node.parent.body) { + if (sibling === node) { + break; + } + if (!isDirective(sibling, sourceCode)) { + return false; + } + } + return true; + } + return false; +} + +/** + * Gets the actual last token. + * + * If a semicolon is semicolon-less style's semicolon, this ignores it. + * For example: + * + * foo() + * ;[1, 2, 3].forEach(bar) + * @param {SourceCode} sourceCode The source code to get tokens. + * @param {ASTNode} node The node to get. + * @returns {Token} The actual last token. + * @private + */ +function getActualLastToken(sourceCode, node) { + const semiToken = sourceCode.getLastToken(node); + const prevToken = sourceCode.getTokenBefore(semiToken); + const nextToken = sourceCode.getTokenAfter(semiToken); + const isSemicolonLessStyle = Boolean( + prevToken && + nextToken && + prevToken.range[0] >= node.range[0] && + astUtils.isSemicolonToken(semiToken) && + semiToken.loc.start.line !== prevToken.loc.end.line && + semiToken.loc.end.line === nextToken.loc.start.line + ); + + return isSemicolonLessStyle ? prevToken : semiToken; +} + +/** + * This returns the concatenation of the first 2 captured strings. + * @param {string} _ Unused. Whole matched string. + * @param {string} trailingSpaces The trailing spaces of the first line. + * @param {string} indentSpaces The indentation spaces of the last line. + * @returns {string} The concatenation of trailingSpaces and indentSpaces. + * @private + */ +function replacerToRemovePaddingLines(_, trailingSpaces, indentSpaces) { + return trailingSpaces + indentSpaces; +} + +/** + * Check and report statements for `any` configuration. + * It does nothing. + * @returns {void} + * @private + */ +function verifyForAny() { +} + +/** + * Check and report statements for `never` configuration. + * This autofix removes blank lines between the given 2 statements. + * However, if comments exist between 2 blank lines, it does not remove those + * blank lines automatically. + * @param {RuleContext} context The rule context to report. + * @param {ASTNode} _ Unused. The previous node to check. + * @param {ASTNode} nextNode The next node to check. + * @param {Array} paddingLines The array of token pairs that blank + * lines exist between the pair. + * @returns {void} + * @private + */ +function verifyForNever(context, _, nextNode, paddingLines) { + if (paddingLines.length === 0) { + return; + } + + context.report({ + node: nextNode, + messageId: "unexpectedBlankLine", + fix(fixer) { + if (paddingLines.length >= 2) { + return null; + } + + const prevToken = paddingLines[0][0]; + const nextToken = paddingLines[0][1]; + const start = prevToken.range[1]; + const end = nextToken.range[0]; + const text = context.getSourceCode().text + .slice(start, end) + .replace(PADDING_LINE_SEQUENCE, replacerToRemovePaddingLines); + + return fixer.replaceTextRange([start, end], text); + } + }); +} + +/** + * Check and report statements for `always` configuration. + * This autofix inserts a blank line between the given 2 statements. + * If the `prevNode` has trailing comments, it inserts a blank line after the + * trailing comments. + * @param {RuleContext} context The rule context to report. + * @param {ASTNode} prevNode The previous node to check. + * @param {ASTNode} nextNode The next node to check. + * @param {Array} paddingLines The array of token pairs that blank + * lines exist between the pair. + * @returns {void} + * @private + */ +function verifyForAlways(context, prevNode, nextNode, paddingLines) { + if (paddingLines.length > 0) { + return; + } + + context.report({ + node: nextNode, + messageId: "expectedBlankLine", + fix(fixer) { + const sourceCode = context.getSourceCode(); + let prevToken = getActualLastToken(sourceCode, prevNode); + const nextToken = sourceCode.getFirstTokenBetween( + prevToken, + nextNode, + { + includeComments: true, + + /** + * Skip the trailing comments of the previous node. + * This inserts a blank line after the last trailing comment. + * + * For example: + * + * foo(); // trailing comment. + * // comment. + * bar(); + * + * Get fixed to: + * + * foo(); // trailing comment. + * + * // comment. + * bar(); + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is not a trailing comment. + * @private + */ + filter(token) { + if (astUtils.isTokenOnSameLine(prevToken, token)) { + prevToken = token; + return false; + } + return true; + } + } + ) || nextNode; + const insertText = astUtils.isTokenOnSameLine(prevToken, nextToken) + ? "\n\n" + : "\n"; + + return fixer.insertTextAfter(prevToken, insertText); + } + }); +} + +/** + * Types of blank lines. + * `any`, `never`, and `always` are defined. + * Those have `verify` method to check and report statements. + * @private + */ +const PaddingTypes = { + any: { verify: verifyForAny }, + never: { verify: verifyForNever }, + always: { verify: verifyForAlways } +}; + +/** + * Types of statements. + * Those have `test` method to check it matches to the given statement. + * @private + */ +const StatementTypes = { + "*": { test: () => true }, + "block-like": { + test: (node, sourceCode) => isBlockLikeStatement(sourceCode, node) + }, + "cjs-export": { + test: (node, sourceCode) => + node.type === "ExpressionStatement" && + node.expression.type === "AssignmentExpression" && + CJS_EXPORT.test(sourceCode.getText(node.expression.left)) + }, + "cjs-import": { + test: (node, sourceCode) => + node.type === "VariableDeclaration" && + node.declarations.length > 0 && + Boolean(node.declarations[0].init) && + CJS_IMPORT.test(sourceCode.getText(node.declarations[0].init)) + }, + directive: { + test: isDirectivePrologue + }, + expression: { + test: (node, sourceCode) => + node.type === "ExpressionStatement" && + !isDirectivePrologue(node, sourceCode) + }, + iife: { + test: isIIFEStatement + }, + "multiline-block-like": { + test: (node, sourceCode) => + node.loc.start.line !== node.loc.end.line && + isBlockLikeStatement(sourceCode, node) + }, + "multiline-expression": { + test: (node, sourceCode) => + node.loc.start.line !== node.loc.end.line && + node.type === "ExpressionStatement" && + !isDirectivePrologue(node, sourceCode) + }, + + "multiline-const": newMultilineKeywordTester("const"), + "multiline-let": newMultilineKeywordTester("let"), + "multiline-var": newMultilineKeywordTester("var"), + "singleline-const": newSinglelineKeywordTester("const"), + "singleline-let": newSinglelineKeywordTester("let"), + "singleline-var": newSinglelineKeywordTester("var"), + + block: newNodeTypeTester("BlockStatement"), + empty: newNodeTypeTester("EmptyStatement"), + function: newNodeTypeTester("FunctionDeclaration"), + + break: newKeywordTester("break"), + case: newKeywordTester("case"), + class: newKeywordTester("class"), + const: newKeywordTester("const"), + continue: newKeywordTester("continue"), + debugger: newKeywordTester("debugger"), + default: newKeywordTester("default"), + do: newKeywordTester("do"), + export: newKeywordTester("export"), + for: newKeywordTester("for"), + if: newKeywordTester("if"), + import: newKeywordTester("import"), + let: newKeywordTester("let"), + return: newKeywordTester("return"), + switch: newKeywordTester("switch"), + throw: newKeywordTester("throw"), + try: newKeywordTester("try"), + var: newKeywordTester("var"), + while: newKeywordTester("while"), + with: newKeywordTester("with") +}; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow padding lines between statements", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/padding-line-between-statements" + }, + + fixable: "whitespace", + + schema: { + definitions: { + paddingType: { + enum: Object.keys(PaddingTypes) + }, + statementType: { + anyOf: [ + { enum: Object.keys(StatementTypes) }, + { + type: "array", + items: { enum: Object.keys(StatementTypes) }, + minItems: 1, + uniqueItems: true, + additionalItems: false + } + ] + } + }, + type: "array", + items: { + type: "object", + properties: { + blankLine: { $ref: "#/definitions/paddingType" }, + prev: { $ref: "#/definitions/statementType" }, + next: { $ref: "#/definitions/statementType" } + }, + additionalProperties: false, + required: ["blankLine", "prev", "next"] + }, + additionalItems: false + }, + + messages: { + unexpectedBlankLine: "Unexpected blank line before this statement.", + expectedBlankLine: "Expected blank line before this statement." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const configureList = context.options || []; + let scopeInfo = null; + + /** + * Processes to enter to new scope. + * This manages the current previous statement. + * @returns {void} + * @private + */ + function enterScope() { + scopeInfo = { + upper: scopeInfo, + prevNode: null + }; + } + + /** + * Processes to exit from the current scope. + * @returns {void} + * @private + */ + function exitScope() { + scopeInfo = scopeInfo.upper; + } + + /** + * Checks whether the given node matches the given type. + * @param {ASTNode} node The statement node to check. + * @param {string|string[]} type The statement type to check. + * @returns {boolean} `true` if the statement node matched the type. + * @private + */ + function match(node, type) { + let innerStatementNode = node; + + while (innerStatementNode.type === "LabeledStatement") { + innerStatementNode = innerStatementNode.body; + } + if (Array.isArray(type)) { + return type.some(match.bind(null, innerStatementNode)); + } + return StatementTypes[type].test(innerStatementNode, sourceCode); + } + + /** + * Finds the last matched configure from configureList. + * @param {ASTNode} prevNode The previous statement to match. + * @param {ASTNode} nextNode The current statement to match. + * @returns {Object} The tester of the last matched configure. + * @private + */ + function getPaddingType(prevNode, nextNode) { + for (let i = configureList.length - 1; i >= 0; --i) { + const configure = configureList[i]; + const matched = + match(prevNode, configure.prev) && + match(nextNode, configure.next); + + if (matched) { + return PaddingTypes[configure.blankLine]; + } + } + return PaddingTypes.any; + } + + /** + * Gets padding line sequences between the given 2 statements. + * Comments are separators of the padding line sequences. + * @param {ASTNode} prevNode The previous statement to count. + * @param {ASTNode} nextNode The current statement to count. + * @returns {Array} The array of token pairs. + * @private + */ + function getPaddingLineSequences(prevNode, nextNode) { + const pairs = []; + let prevToken = getActualLastToken(sourceCode, prevNode); + + if (nextNode.loc.start.line - prevToken.loc.end.line >= 2) { + do { + const token = sourceCode.getTokenAfter( + prevToken, + { includeComments: true } + ); + + if (token.loc.start.line - prevToken.loc.end.line >= 2) { + pairs.push([prevToken, token]); + } + prevToken = token; + + } while (prevToken.range[0] < nextNode.range[0]); + } + + return pairs; + } + + /** + * Verify padding lines between the given node and the previous node. + * @param {ASTNode} node The node to verify. + * @returns {void} + * @private + */ + function verify(node) { + const parentType = node.parent.type; + const validParent = + astUtils.STATEMENT_LIST_PARENTS.has(parentType) || + parentType === "SwitchStatement"; + + if (!validParent) { + return; + } + + // Save this node as the current previous statement. + const prevNode = scopeInfo.prevNode; + + // Verify. + if (prevNode) { + const type = getPaddingType(prevNode, node); + const paddingLines = getPaddingLineSequences(prevNode, node); + + type.verify(context, prevNode, node, paddingLines); + } + + scopeInfo.prevNode = node; + } + + /** + * Verify padding lines between the given node and the previous node. + * Then process to enter to new scope. + * @param {ASTNode} node The node to verify. + * @returns {void} + * @private + */ + function verifyThenEnterScope(node) { + verify(node); + enterScope(); + } + + return { + Program: enterScope, + BlockStatement: enterScope, + SwitchStatement: enterScope, + "Program:exit": exitScope, + "BlockStatement:exit": exitScope, + "SwitchStatement:exit": exitScope, + + ":statement": verify, + + SwitchCase: verifyThenEnterScope, + "SwitchCase:exit": exitScope + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-arrow-callback.js b/node_modules/eslint/lib/rules/prefer-arrow-callback.js new file mode 100644 index 000000000..ee5cfe3c8 --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-arrow-callback.js @@ -0,0 +1,379 @@ +/** + * @fileoverview A rule to suggest using arrow functions as callbacks. + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given variable is a function name. + * @param {eslint-scope.Variable} variable A variable to check. + * @returns {boolean} `true` if the variable is a function name. + */ +function isFunctionName(variable) { + return variable && variable.defs[0].type === "FunctionName"; +} + +/** + * Checks whether or not a given MetaProperty node equals to a given value. + * @param {ASTNode} node A MetaProperty node to check. + * @param {string} metaName The name of `MetaProperty.meta`. + * @param {string} propertyName The name of `MetaProperty.property`. + * @returns {boolean} `true` if the node is the specific value. + */ +function checkMetaProperty(node, metaName, propertyName) { + return node.meta.name === metaName && node.property.name === propertyName; +} + +/** + * Gets the variable object of `arguments` which is defined implicitly. + * @param {eslint-scope.Scope} scope A scope to get. + * @returns {eslint-scope.Variable} The found variable object. + */ +function getVariableOfArguments(scope) { + const variables = scope.variables; + + for (let i = 0; i < variables.length; ++i) { + const variable = variables[i]; + + if (variable.name === "arguments") { + + /* + * If there was a parameter which is named "arguments", the + * implicit "arguments" is not defined. + * So does fast return with null. + */ + return (variable.identifiers.length === 0) ? variable : null; + } + } + + /* istanbul ignore next */ + return null; +} + +/** + * Checks whether or not a given node is a callback. + * @param {ASTNode} node A node to check. + * @returns {Object} + * {boolean} retv.isCallback - `true` if the node is a callback. + * {boolean} retv.isLexicalThis - `true` if the node is with `.bind(this)`. + */ +function getCallbackInfo(node) { + const retv = { isCallback: false, isLexicalThis: false }; + let currentNode = node; + let parent = node.parent; + let bound = false; + + while (currentNode) { + switch (parent.type) { + + // Checks parents recursively. + + case "LogicalExpression": + case "ChainExpression": + case "ConditionalExpression": + break; + + // Checks whether the parent node is `.bind(this)` call. + case "MemberExpression": + if ( + parent.object === currentNode && + !parent.property.computed && + parent.property.type === "Identifier" && + parent.property.name === "bind" + ) { + const maybeCallee = parent.parent.type === "ChainExpression" + ? parent.parent + : parent; + + if (astUtils.isCallee(maybeCallee)) { + if (!bound) { + bound = true; // Use only the first `.bind()` to make `isLexicalThis` value. + retv.isLexicalThis = ( + maybeCallee.parent.arguments.length === 1 && + maybeCallee.parent.arguments[0].type === "ThisExpression" + ); + } + parent = maybeCallee.parent; + } else { + return retv; + } + } else { + return retv; + } + break; + + // Checks whether the node is a callback. + case "CallExpression": + case "NewExpression": + if (parent.callee !== currentNode) { + retv.isCallback = true; + } + return retv; + + default: + return retv; + } + + currentNode = parent; + parent = parent.parent; + } + + /* istanbul ignore next */ + throw new Error("unreachable"); +} + +/** + * Checks whether a simple list of parameters contains any duplicates. This does not handle complex + * parameter lists (e.g. with destructuring), since complex parameter lists are a SyntaxError with duplicate + * parameter names anyway. Instead, it always returns `false` for complex parameter lists. + * @param {ASTNode[]} paramsList The list of parameters for a function + * @returns {boolean} `true` if the list of parameters contains any duplicates + */ +function hasDuplicateParams(paramsList) { + return paramsList.every(param => param.type === "Identifier") && paramsList.length !== new Set(paramsList.map(param => param.name)).size; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require using arrow functions for callbacks", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-arrow-callback" + }, + + schema: [ + { + type: "object", + properties: { + allowNamedFunctions: { + type: "boolean", + default: false + }, + allowUnboundThis: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + fixable: "code", + + messages: { + preferArrowCallback: "Unexpected function expression." + } + }, + + create(context) { + const options = context.options[0] || {}; + + const allowUnboundThis = options.allowUnboundThis !== false; // default to true + const allowNamedFunctions = options.allowNamedFunctions; + const sourceCode = context.getSourceCode(); + + /* + * {Array<{this: boolean, super: boolean, meta: boolean}>} + * - this - A flag which shows there are one or more ThisExpression. + * - super - A flag which shows there are one or more Super. + * - meta - A flag which shows there are one or more MethProperty. + */ + let stack = []; + + /** + * Pushes new function scope with all `false` flags. + * @returns {void} + */ + function enterScope() { + stack.push({ this: false, super: false, meta: false }); + } + + /** + * Pops a function scope from the stack. + * @returns {{this: boolean, super: boolean, meta: boolean}} The information of the last scope. + */ + function exitScope() { + return stack.pop(); + } + + return { + + // Reset internal state. + Program() { + stack = []; + }, + + // If there are below, it cannot replace with arrow functions merely. + ThisExpression() { + const info = stack[stack.length - 1]; + + if (info) { + info.this = true; + } + }, + + Super() { + const info = stack[stack.length - 1]; + + if (info) { + info.super = true; + } + }, + + MetaProperty(node) { + const info = stack[stack.length - 1]; + + if (info && checkMetaProperty(node, "new", "target")) { + info.meta = true; + } + }, + + // To skip nested scopes. + FunctionDeclaration: enterScope, + "FunctionDeclaration:exit": exitScope, + + // Main. + FunctionExpression: enterScope, + "FunctionExpression:exit"(node) { + const scopeInfo = exitScope(); + + // Skip named function expressions + if (allowNamedFunctions && node.id && node.id.name) { + return; + } + + // Skip generators. + if (node.generator) { + return; + } + + // Skip recursive functions. + const nameVar = context.getDeclaredVariables(node)[0]; + + if (isFunctionName(nameVar) && nameVar.references.length > 0) { + return; + } + + // Skip if it's using arguments. + const variable = getVariableOfArguments(context.getScope()); + + if (variable && variable.references.length > 0) { + return; + } + + // Reports if it's a callback which can replace with arrows. + const callbackInfo = getCallbackInfo(node); + + if (callbackInfo.isCallback && + (!allowUnboundThis || !scopeInfo.this || callbackInfo.isLexicalThis) && + !scopeInfo.super && + !scopeInfo.meta + ) { + context.report({ + node, + messageId: "preferArrowCallback", + *fix(fixer) { + if ((!callbackInfo.isLexicalThis && scopeInfo.this) || hasDuplicateParams(node.params)) { + + /* + * If the callback function does not have .bind(this) and contains a reference to `this`, there + * is no way to determine what `this` should be, so don't perform any fixes. + * If the callback function has duplicates in its list of parameters (possible in sloppy mode), + * don't replace it with an arrow function, because this is a SyntaxError with arrow functions. + */ + return; // eslint-disable-line eslint-plugin/fixer-return -- false positive + } + + // Remove `.bind(this)` if exists. + if (callbackInfo.isLexicalThis) { + const memberNode = node.parent; + + /* + * If `.bind(this)` exists but the parent is not `.bind(this)`, don't remove it automatically. + * E.g. `(foo || function(){}).bind(this)` + */ + if (memberNode.type !== "MemberExpression") { + return; // eslint-disable-line eslint-plugin/fixer-return -- false positive + } + + const callNode = memberNode.parent; + const firstTokenToRemove = sourceCode.getTokenAfter(memberNode.object, astUtils.isNotClosingParenToken); + const lastTokenToRemove = sourceCode.getLastToken(callNode); + + /* + * If the member expression is parenthesized, don't remove the right paren. + * E.g. `(function(){}.bind)(this)` + * ^^^^^^^^^^^^ + */ + if (astUtils.isParenthesised(sourceCode, memberNode)) { + return; // eslint-disable-line eslint-plugin/fixer-return -- false positive + } + + // If comments exist in the `.bind(this)`, don't remove those. + if (sourceCode.commentsExistBetween(firstTokenToRemove, lastTokenToRemove)) { + return; // eslint-disable-line eslint-plugin/fixer-return -- false positive + } + + yield fixer.removeRange([firstTokenToRemove.range[0], lastTokenToRemove.range[1]]); + } + + // Convert the function expression to an arrow function. + const functionToken = sourceCode.getFirstToken(node, node.async ? 1 : 0); + const leftParenToken = sourceCode.getTokenAfter(functionToken, astUtils.isOpeningParenToken); + + if (sourceCode.commentsExistBetween(functionToken, leftParenToken)) { + + // Remove only extra tokens to keep comments. + yield fixer.remove(functionToken); + if (node.id) { + yield fixer.remove(node.id); + } + } else { + + // Remove extra tokens and spaces. + yield fixer.removeRange([functionToken.range[0], leftParenToken.range[0]]); + } + yield fixer.insertTextBefore(node.body, "=> "); + + // Get the node that will become the new arrow function. + let replacedNode = callbackInfo.isLexicalThis ? node.parent.parent : node; + + if (replacedNode.type === "ChainExpression") { + replacedNode = replacedNode.parent; + } + + /* + * If the replaced node is part of a BinaryExpression, LogicalExpression, or MemberExpression, then + * the arrow function needs to be parenthesized, because `foo || () => {}` is invalid syntax even + * though `foo || function() {}` is valid. + */ + if ( + replacedNode.parent.type !== "CallExpression" && + replacedNode.parent.type !== "ConditionalExpression" && + !astUtils.isParenthesised(sourceCode, replacedNode) && + !astUtils.isParenthesised(sourceCode, node) + ) { + yield fixer.insertTextBefore(replacedNode, "("); + yield fixer.insertTextAfter(replacedNode, ")"); + } + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-const.js b/node_modules/eslint/lib/rules/prefer-const.js new file mode 100644 index 000000000..439a4db3c --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-const.js @@ -0,0 +1,476 @@ +/** + * @fileoverview A rule to suggest using of const declaration for variables that are never reassigned after declared. + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const PATTERN_TYPE = /^(?:.+?Pattern|RestElement|SpreadProperty|ExperimentalRestProperty|Property)$/u; +const DECLARATION_HOST_TYPE = /^(?:Program|BlockStatement|SwitchCase)$/u; +const DESTRUCTURING_HOST_TYPE = /^(?:VariableDeclarator|AssignmentExpression)$/u; + +/** + * Checks whether a given node is located at `ForStatement.init` or not. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is located at `ForStatement.init`. + */ +function isInitOfForStatement(node) { + return node.parent.type === "ForStatement" && node.parent.init === node; +} + +/** + * Checks whether a given Identifier node becomes a VariableDeclaration or not. + * @param {ASTNode} identifier An Identifier node to check. + * @returns {boolean} `true` if the node can become a VariableDeclaration. + */ +function canBecomeVariableDeclaration(identifier) { + let node = identifier.parent; + + while (PATTERN_TYPE.test(node.type)) { + node = node.parent; + } + + return ( + node.type === "VariableDeclarator" || + ( + node.type === "AssignmentExpression" && + node.parent.type === "ExpressionStatement" && + DECLARATION_HOST_TYPE.test(node.parent.parent.type) + ) + ); +} + +/** + * Checks if an property or element is from outer scope or function parameters + * in destructing pattern. + * @param {string} name A variable name to be checked. + * @param {eslint-scope.Scope} initScope A scope to start find. + * @returns {boolean} Indicates if the variable is from outer scope or function parameters. + */ +function isOuterVariableInDestructing(name, initScope) { + + if (initScope.through.find(ref => ref.resolved && ref.resolved.name === name)) { + return true; + } + + const variable = astUtils.getVariableByName(initScope, name); + + if (variable !== null) { + return variable.defs.some(def => def.type === "Parameter"); + } + + return false; +} + +/** + * Gets the VariableDeclarator/AssignmentExpression node that a given reference + * belongs to. + * This is used to detect a mix of reassigned and never reassigned in a + * destructuring. + * @param {eslint-scope.Reference} reference A reference to get. + * @returns {ASTNode|null} A VariableDeclarator/AssignmentExpression node or + * null. + */ +function getDestructuringHost(reference) { + if (!reference.isWrite()) { + return null; + } + let node = reference.identifier.parent; + + while (PATTERN_TYPE.test(node.type)) { + node = node.parent; + } + + if (!DESTRUCTURING_HOST_TYPE.test(node.type)) { + return null; + } + return node; +} + +/** + * Determines if a destructuring assignment node contains + * any MemberExpression nodes. This is used to determine if a + * variable that is only written once using destructuring can be + * safely converted into a const declaration. + * @param {ASTNode} node The ObjectPattern or ArrayPattern node to check. + * @returns {boolean} True if the destructuring pattern contains + * a MemberExpression, false if not. + */ +function hasMemberExpressionAssignment(node) { + switch (node.type) { + case "ObjectPattern": + return node.properties.some(prop => { + if (prop) { + + /* + * Spread elements have an argument property while + * others have a value property. Because different + * parsers use different node types for spread elements, + * we just check if there is an argument property. + */ + return hasMemberExpressionAssignment(prop.argument || prop.value); + } + + return false; + }); + + case "ArrayPattern": + return node.elements.some(element => { + if (element) { + return hasMemberExpressionAssignment(element); + } + + return false; + }); + + case "AssignmentPattern": + return hasMemberExpressionAssignment(node.left); + + case "MemberExpression": + return true; + + // no default + } + + return false; +} + +/** + * Gets an identifier node of a given variable. + * + * If the initialization exists or one or more reading references exist before + * the first assignment, the identifier node is the node of the declaration. + * Otherwise, the identifier node is the node of the first assignment. + * + * If the variable should not change to const, this function returns null. + * - If the variable is reassigned. + * - If the variable is never initialized nor assigned. + * - If the variable is initialized in a different scope from the declaration. + * - If the unique assignment of the variable cannot change to a declaration. + * e.g. `if (a) b = 1` / `return (b = 1)` + * - If the variable is declared in the global scope and `eslintUsed` is `true`. + * `/*exported foo` directive comment makes such variables. This rule does not + * warn such variables because this rule cannot distinguish whether the + * exported variables are reassigned or not. + * @param {eslint-scope.Variable} variable A variable to get. + * @param {boolean} ignoreReadBeforeAssign + * The value of `ignoreReadBeforeAssign` option. + * @returns {ASTNode|null} + * An Identifier node if the variable should change to const. + * Otherwise, null. + */ +function getIdentifierIfShouldBeConst(variable, ignoreReadBeforeAssign) { + if (variable.eslintUsed && variable.scope.type === "global") { + return null; + } + + // Finds the unique WriteReference. + let writer = null; + let isReadBeforeInit = false; + const references = variable.references; + + for (let i = 0; i < references.length; ++i) { + const reference = references[i]; + + if (reference.isWrite()) { + const isReassigned = ( + writer !== null && + writer.identifier !== reference.identifier + ); + + if (isReassigned) { + return null; + } + + const destructuringHost = getDestructuringHost(reference); + + if (destructuringHost !== null && destructuringHost.left !== void 0) { + const leftNode = destructuringHost.left; + let hasOuterVariables = false, + hasNonIdentifiers = false; + + if (leftNode.type === "ObjectPattern") { + const properties = leftNode.properties; + + hasOuterVariables = properties + .filter(prop => prop.value) + .map(prop => prop.value.name) + .some(name => isOuterVariableInDestructing(name, variable.scope)); + + hasNonIdentifiers = hasMemberExpressionAssignment(leftNode); + + } else if (leftNode.type === "ArrayPattern") { + const elements = leftNode.elements; + + hasOuterVariables = elements + .map(element => element && element.name) + .some(name => isOuterVariableInDestructing(name, variable.scope)); + + hasNonIdentifiers = hasMemberExpressionAssignment(leftNode); + } + + if (hasOuterVariables || hasNonIdentifiers) { + return null; + } + + } + + writer = reference; + + } else if (reference.isRead() && writer === null) { + if (ignoreReadBeforeAssign) { + return null; + } + isReadBeforeInit = true; + } + } + + /* + * If the assignment is from a different scope, ignore it. + * If the assignment cannot change to a declaration, ignore it. + */ + const shouldBeConst = ( + writer !== null && + writer.from === variable.scope && + canBecomeVariableDeclaration(writer.identifier) + ); + + if (!shouldBeConst) { + return null; + } + + if (isReadBeforeInit) { + return variable.defs[0].name; + } + + return writer.identifier; +} + +/** + * Groups by the VariableDeclarator/AssignmentExpression node that each + * reference of given variables belongs to. + * This is used to detect a mix of reassigned and never reassigned in a + * destructuring. + * @param {eslint-scope.Variable[]} variables Variables to group by destructuring. + * @param {boolean} ignoreReadBeforeAssign + * The value of `ignoreReadBeforeAssign` option. + * @returns {Map} Grouped identifier nodes. + */ +function groupByDestructuring(variables, ignoreReadBeforeAssign) { + const identifierMap = new Map(); + + for (let i = 0; i < variables.length; ++i) { + const variable = variables[i]; + const references = variable.references; + const identifier = getIdentifierIfShouldBeConst(variable, ignoreReadBeforeAssign); + let prevId = null; + + for (let j = 0; j < references.length; ++j) { + const reference = references[j]; + const id = reference.identifier; + + /* + * Avoid counting a reference twice or more for default values of + * destructuring. + */ + if (id === prevId) { + continue; + } + prevId = id; + + // Add the identifier node into the destructuring group. + const group = getDestructuringHost(reference); + + if (group) { + if (identifierMap.has(group)) { + identifierMap.get(group).push(identifier); + } else { + identifierMap.set(group, [identifier]); + } + } + } + } + + return identifierMap; +} + +/** + * Finds the nearest parent of node with a given type. + * @param {ASTNode} node The node to search from. + * @param {string} type The type field of the parent node. + * @param {Function} shouldStop A predicate that returns true if the traversal should stop, and false otherwise. + * @returns {ASTNode} The closest ancestor with the specified type; null if no such ancestor exists. + */ +function findUp(node, type, shouldStop) { + if (!node || shouldStop(node)) { + return null; + } + if (node.type === type) { + return node; + } + return findUp(node.parent, type, shouldStop); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require `const` declarations for variables that are never reassigned after declared", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-const" + }, + + fixable: "code", + + schema: [ + { + type: "object", + properties: { + destructuring: { enum: ["any", "all"], default: "any" }, + ignoreReadBeforeAssign: { type: "boolean", default: false } + }, + additionalProperties: false + } + ], + messages: { + useConst: "'{{name}}' is never reassigned. Use 'const' instead." + } + }, + + create(context) { + const options = context.options[0] || {}; + const sourceCode = context.getSourceCode(); + const shouldMatchAnyDestructuredVariable = options.destructuring !== "all"; + const ignoreReadBeforeAssign = options.ignoreReadBeforeAssign === true; + const variables = []; + let reportCount = 0; + let checkedId = null; + let checkedName = ""; + + + /** + * Reports given identifier nodes if all of the nodes should be declared + * as const. + * + * The argument 'nodes' is an array of Identifier nodes. + * This node is the result of 'getIdentifierIfShouldBeConst()', so it's + * nullable. In simple declaration or assignment cases, the length of + * the array is 1. In destructuring cases, the length of the array can + * be 2 or more. + * @param {(eslint-scope.Reference|null)[]} nodes + * References which are grouped by destructuring to report. + * @returns {void} + */ + function checkGroup(nodes) { + const nodesToReport = nodes.filter(Boolean); + + if (nodes.length && (shouldMatchAnyDestructuredVariable || nodesToReport.length === nodes.length)) { + const varDeclParent = findUp(nodes[0], "VariableDeclaration", parentNode => parentNode.type.endsWith("Statement")); + const isVarDecParentNull = varDeclParent === null; + + if (!isVarDecParentNull && varDeclParent.declarations.length > 0) { + const firstDeclaration = varDeclParent.declarations[0]; + + if (firstDeclaration.init) { + const firstDecParent = firstDeclaration.init.parent; + + /* + * First we check the declaration type and then depending on + * if the type is a "VariableDeclarator" or its an "ObjectPattern" + * we compare the name and id from the first identifier, if the names are different + * we assign the new name, id and reset the count of reportCount and nodeCount in + * order to check each block for the number of reported errors and base our fix + * based on comparing nodes.length and nodesToReport.length. + */ + + if (firstDecParent.type === "VariableDeclarator") { + + if (firstDecParent.id.name !== checkedName) { + checkedName = firstDecParent.id.name; + reportCount = 0; + } + + if (firstDecParent.id.type === "ObjectPattern") { + if (firstDecParent.init.name !== checkedName) { + checkedName = firstDecParent.init.name; + reportCount = 0; + } + } + + if (firstDecParent.id !== checkedId) { + checkedId = firstDecParent.id; + reportCount = 0; + } + } + } + } + + let shouldFix = varDeclParent && + + // Don't do a fix unless all variables in the declarations are initialized (or it's in a for-in or for-of loop) + (varDeclParent.parent.type === "ForInStatement" || varDeclParent.parent.type === "ForOfStatement" || + varDeclParent.declarations.every(declaration => declaration.init)) && + + /* + * If options.destructuring is "all", then this warning will not occur unless + * every assignment in the destructuring should be const. In that case, it's safe + * to apply the fix. + */ + nodesToReport.length === nodes.length; + + if (!isVarDecParentNull && varDeclParent.declarations && varDeclParent.declarations.length !== 1) { + + if (varDeclParent && varDeclParent.declarations && varDeclParent.declarations.length >= 1) { + + /* + * Add nodesToReport.length to a count, then comparing the count to the length + * of the declarations in the current block. + */ + + reportCount += nodesToReport.length; + + shouldFix = shouldFix && (reportCount === varDeclParent.declarations.length); + } + } + + nodesToReport.forEach(node => { + context.report({ + node, + messageId: "useConst", + data: node, + fix: shouldFix + ? fixer => fixer.replaceText( + sourceCode.getFirstToken(varDeclParent, t => t.value === varDeclParent.kind), + "const" + ) + : null + }); + }); + } + } + + return { + "Program:exit"() { + groupByDestructuring(variables, ignoreReadBeforeAssign).forEach(checkGroup); + }, + + VariableDeclaration(node) { + if (node.kind === "let" && !isInitOfForStatement(node)) { + variables.push(...context.getDeclaredVariables(node)); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-destructuring.js b/node_modules/eslint/lib/rules/prefer-destructuring.js new file mode 100644 index 000000000..d3314dc7e --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-destructuring.js @@ -0,0 +1,277 @@ +/** + * @fileoverview Prefer destructuring from arrays and objects + * @author Alex LaFroscia + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require destructuring from arrays and/or objects", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-destructuring" + }, + + fixable: "code", + + schema: [ + { + + /* + * old support {array: Boolean, object: Boolean} + * new support {VariableDeclarator: {}, AssignmentExpression: {}} + */ + oneOf: [ + { + type: "object", + properties: { + VariableDeclarator: { + type: "object", + properties: { + array: { + type: "boolean" + }, + object: { + type: "boolean" + } + }, + additionalProperties: false + }, + AssignmentExpression: { + type: "object", + properties: { + array: { + type: "boolean" + }, + object: { + type: "boolean" + } + }, + additionalProperties: false + } + }, + additionalProperties: false + }, + { + type: "object", + properties: { + array: { + type: "boolean" + }, + object: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + }, + { + type: "object", + properties: { + enforceForRenamedProperties: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + preferDestructuring: "Use {{type}} destructuring." + } + }, + create(context) { + + const enabledTypes = context.options[0]; + const enforceForRenamedProperties = context.options[1] && context.options[1].enforceForRenamedProperties; + let normalizedOptions = { + VariableDeclarator: { array: true, object: true }, + AssignmentExpression: { array: true, object: true } + }; + + if (enabledTypes) { + normalizedOptions = typeof enabledTypes.array !== "undefined" || typeof enabledTypes.object !== "undefined" + ? { VariableDeclarator: enabledTypes, AssignmentExpression: enabledTypes } + : enabledTypes; + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {string} nodeType "AssignmentExpression" or "VariableDeclarator" + * @param {string} destructuringType "array" or "object" + * @returns {boolean} `true` if the destructuring type should be checked for the given node + */ + function shouldCheck(nodeType, destructuringType) { + return normalizedOptions && + normalizedOptions[nodeType] && + normalizedOptions[nodeType][destructuringType]; + } + + /** + * Determines if the given node is accessing an array index + * + * This is used to differentiate array index access from object property + * access. + * @param {ASTNode} node the node to evaluate + * @returns {boolean} whether or not the node is an integer + */ + function isArrayIndexAccess(node) { + return Number.isInteger(node.property.value); + } + + /** + * Report that the given node should use destructuring + * @param {ASTNode} reportNode the node to report + * @param {string} type the type of destructuring that should have been done + * @param {Function|null} fix the fix function or null to pass to context.report + * @returns {void} + */ + function report(reportNode, type, fix) { + context.report({ + node: reportNode, + messageId: "preferDestructuring", + data: { type }, + fix + }); + } + + /** + * Determines if a node should be fixed into object destructuring + * + * The fixer only fixes the simplest case of object destructuring, + * like: `let x = a.x`; + * + * Assignment expression is not fixed. + * Array destructuring is not fixed. + * Renamed property is not fixed. + * @param {ASTNode} node the the node to evaluate + * @returns {boolean} whether or not the node should be fixed + */ + function shouldFix(node) { + return node.type === "VariableDeclarator" && + node.id.type === "Identifier" && + node.init.type === "MemberExpression" && + node.id.name === node.init.property.name; + } + + /** + * Fix a node into object destructuring. + * This function only handles the simplest case of object destructuring, + * see {@link shouldFix}. + * @param {SourceCodeFixer} fixer the fixer object + * @param {ASTNode} node the node to be fixed. + * @returns {Object} a fix for the node + */ + function fixIntoObjectDestructuring(fixer, node) { + const rightNode = node.init; + const sourceCode = context.getSourceCode(); + + // Don't fix if that would remove any comments. Only comments inside `rightNode.object` can be preserved. + if (sourceCode.getCommentsInside(node).length > sourceCode.getCommentsInside(rightNode.object).length) { + return null; + } + + return fixer.replaceText( + node, + `{${rightNode.property.name}} = ${sourceCode.getText(rightNode.object)}` + ); + } + + /** + * Check that the `prefer-destructuring` rules are followed based on the + * given left- and right-hand side of the assignment. + * + * Pulled out into a separate method so that VariableDeclarators and + * AssignmentExpressions can share the same verification logic. + * @param {ASTNode} leftNode the left-hand side of the assignment + * @param {ASTNode} rightNode the right-hand side of the assignment + * @param {ASTNode} reportNode the node to report the error on + * @returns {void} + */ + function performCheck(leftNode, rightNode, reportNode) { + if (rightNode.type !== "MemberExpression" || rightNode.object.type === "Super") { + return; + } + + if (isArrayIndexAccess(rightNode)) { + if (shouldCheck(reportNode.type, "array")) { + report(reportNode, "array", null); + } + return; + } + + const fix = shouldFix(reportNode) + ? fixer => fixIntoObjectDestructuring(fixer, reportNode) + : null; + + if (shouldCheck(reportNode.type, "object") && enforceForRenamedProperties) { + report(reportNode, "object", fix); + return; + } + + if (shouldCheck(reportNode.type, "object")) { + const property = rightNode.property; + + if ( + (property.type === "Literal" && leftNode.name === property.value) || + (property.type === "Identifier" && leftNode.name === property.name && !rightNode.computed) + ) { + report(reportNode, "object", fix); + } + } + } + + /** + * Check if a given variable declarator is coming from an property access + * that should be using destructuring instead + * @param {ASTNode} node the variable declarator to check + * @returns {void} + */ + function checkVariableDeclarator(node) { + + // Skip if variable is declared without assignment + if (!node.init) { + return; + } + + // We only care about member expressions past this point + if (node.init.type !== "MemberExpression") { + return; + } + + performCheck(node.id, node.init, node); + } + + /** + * Run the `prefer-destructuring` check on an AssignmentExpression + * @param {ASTNode} node the AssignmentExpression node + * @returns {void} + */ + function checkAssigmentExpression(node) { + if (node.operator === "=") { + performCheck(node.left, node.right, node); + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + VariableDeclarator: checkVariableDeclarator, + AssignmentExpression: checkAssigmentExpression + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js b/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js new file mode 100644 index 000000000..d1a00d620 --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js @@ -0,0 +1,189 @@ +/** + * @fileoverview Rule to disallow Math.pow in favor of the ** operator + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const { CALL, ReferenceTracker } = require("eslint-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const PRECEDENCE_OF_EXPONENTIATION_EXPR = astUtils.getPrecedence({ type: "BinaryExpression", operator: "**" }); + +/** + * Determines whether the given node needs parens if used as the base in an exponentiation binary expression. + * @param {ASTNode} base The node to check. + * @returns {boolean} `true` if the node needs to be parenthesised. + */ +function doesBaseNeedParens(base) { + return ( + + // '**' is right-associative, parens are needed when Math.pow(a ** b, c) is converted to (a ** b) ** c + astUtils.getPrecedence(base) <= PRECEDENCE_OF_EXPONENTIATION_EXPR || + + // An unary operator cannot be used immediately before an exponentiation expression + base.type === "UnaryExpression" + ); +} + +/** + * Determines whether the given node needs parens if used as the exponent in an exponentiation binary expression. + * @param {ASTNode} exponent The node to check. + * @returns {boolean} `true` if the node needs to be parenthesised. + */ +function doesExponentNeedParens(exponent) { + + // '**' is right-associative, there is no need for parens when Math.pow(a, b ** c) is converted to a ** b ** c + return astUtils.getPrecedence(exponent) < PRECEDENCE_OF_EXPONENTIATION_EXPR; +} + +/** + * Determines whether an exponentiation binary expression at the place of the given node would need parens. + * @param {ASTNode} node A node that would be replaced by an exponentiation binary expression. + * @param {SourceCode} sourceCode A SourceCode object. + * @returns {boolean} `true` if the expression needs to be parenthesised. + */ +function doesExponentiationExpressionNeedParens(node, sourceCode) { + const parent = node.parent.type === "ChainExpression" ? node.parent.parent : node.parent; + + const needsParens = ( + parent.type === "ClassDeclaration" || + ( + parent.type.endsWith("Expression") && + astUtils.getPrecedence(parent) >= PRECEDENCE_OF_EXPONENTIATION_EXPR && + !(parent.type === "BinaryExpression" && parent.operator === "**" && parent.right === node) && + !((parent.type === "CallExpression" || parent.type === "NewExpression") && parent.arguments.includes(node)) && + !(parent.type === "MemberExpression" && parent.computed && parent.property === node) && + !(parent.type === "ArrayExpression") + ) + ); + + return needsParens && !astUtils.isParenthesised(sourceCode, node); +} + +/** + * Optionally parenthesizes given text. + * @param {string} text The text to parenthesize. + * @param {boolean} shouldParenthesize If `true`, the text will be parenthesised. + * @returns {string} parenthesised or unchanged text. + */ +function parenthesizeIfShould(text, shouldParenthesize) { + return shouldParenthesize ? `(${text})` : text; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of `Math.pow` in favor of the `**` operator", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-exponentiation-operator" + }, + + schema: [], + fixable: "code", + + messages: { + useExponentiation: "Use the '**' operator instead of 'Math.pow'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Reports the given node. + * @param {ASTNode} node 'Math.pow()' node to report. + * @returns {void} + */ + function report(node) { + context.report({ + node, + messageId: "useExponentiation", + fix(fixer) { + if ( + node.arguments.length !== 2 || + node.arguments.some(arg => arg.type === "SpreadElement") || + sourceCode.getCommentsInside(node).length > 0 + ) { + return null; + } + + const base = node.arguments[0], + exponent = node.arguments[1], + baseText = sourceCode.getText(base), + exponentText = sourceCode.getText(exponent), + shouldParenthesizeBase = doesBaseNeedParens(base), + shouldParenthesizeExponent = doesExponentNeedParens(exponent), + shouldParenthesizeAll = doesExponentiationExpressionNeedParens(node, sourceCode); + + let prefix = "", + suffix = ""; + + if (!shouldParenthesizeAll) { + if (!shouldParenthesizeBase) { + const firstReplacementToken = sourceCode.getFirstToken(base), + tokenBefore = sourceCode.getTokenBefore(node); + + if ( + tokenBefore && + tokenBefore.range[1] === node.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, firstReplacementToken) + ) { + prefix = " "; // a+Math.pow(++b, c) -> a+ ++b**c + } + } + if (!shouldParenthesizeExponent) { + const lastReplacementToken = sourceCode.getLastToken(exponent), + tokenAfter = sourceCode.getTokenAfter(node); + + if ( + tokenAfter && + node.range[1] === tokenAfter.range[0] && + !astUtils.canTokensBeAdjacent(lastReplacementToken, tokenAfter) + ) { + suffix = " "; // Math.pow(a, b)in c -> a**b in c + } + } + } + + const baseReplacement = parenthesizeIfShould(baseText, shouldParenthesizeBase), + exponentReplacement = parenthesizeIfShould(exponentText, shouldParenthesizeExponent), + replacement = parenthesizeIfShould(`${baseReplacement}**${exponentReplacement}`, shouldParenthesizeAll); + + return fixer.replaceText(node, `${prefix}${replacement}${suffix}`); + } + }); + } + + return { + Program() { + const scope = context.getScope(); + const tracker = new ReferenceTracker(scope); + const trackMap = { + Math: { + pow: { [CALL]: true } + } + }; + + for (const { node } of tracker.iterateGlobalReferences(trackMap)) { + report(node); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-named-capture-group.js b/node_modules/eslint/lib/rules/prefer-named-capture-group.js new file mode 100644 index 000000000..7d0aa3f9d --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-named-capture-group.js @@ -0,0 +1,110 @@ +/** + * @fileoverview Rule to enforce requiring named capture groups in regular expression. + * @author Pig Fang + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { + CALL, + CONSTRUCT, + ReferenceTracker, + getStringIfConstant +} = require("eslint-utils"); +const regexpp = require("regexpp"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const parser = new regexpp.RegExpParser(); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce using named capture group in regular expression", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-named-capture-group" + }, + + schema: [], + + messages: { + required: "Capture group '{{group}}' should be converted to a named or non-capturing group." + } + }, + + create(context) { + + /** + * Function to check regular expression. + * @param {string} pattern The regular expression pattern to be check. + * @param {ASTNode} node AST node which contains regular expression. + * @param {boolean} uFlag Flag indicates whether unicode mode is enabled or not. + * @returns {void} + */ + function checkRegex(pattern, node, uFlag) { + let ast; + + try { + ast = parser.parsePattern(pattern, 0, pattern.length, uFlag); + } catch { + + // ignore regex syntax errors + return; + } + + regexpp.visitRegExpAST(ast, { + onCapturingGroupEnter(group) { + if (!group.name) { + context.report({ + node, + messageId: "required", + data: { + group: group.raw + } + }); + } + } + }); + } + + return { + Literal(node) { + if (node.regex) { + checkRegex(node.regex.pattern, node, node.regex.flags.includes("u")); + } + }, + Program() { + const scope = context.getScope(); + const tracker = new ReferenceTracker(scope); + const traceMap = { + RegExp: { + [CALL]: true, + [CONSTRUCT]: true + } + }; + + for (const { node } of tracker.iterateGlobalReferences(traceMap)) { + const regex = getStringIfConstant(node.arguments[0]); + const flags = getStringIfConstant(node.arguments[1]); + + if (regex) { + checkRegex(regex, node, flags && flags.includes("u")); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-numeric-literals.js b/node_modules/eslint/lib/rules/prefer-numeric-literals.js new file mode 100644 index 000000000..cc82e6653 --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-numeric-literals.js @@ -0,0 +1,148 @@ +/** + * @fileoverview Rule to disallow `parseInt()` in favor of binary, octal, and hexadecimal literals + * @author Annie Zhang, Henry Zhu + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const radixMap = new Map([ + [2, { system: "binary", literalPrefix: "0b" }], + [8, { system: "octal", literalPrefix: "0o" }], + [16, { system: "hexadecimal", literalPrefix: "0x" }] +]); + +/** + * Checks to see if a CallExpression's callee node is `parseInt` or + * `Number.parseInt`. + * @param {ASTNode} calleeNode The callee node to evaluate. + * @returns {boolean} True if the callee is `parseInt` or `Number.parseInt`, + * false otherwise. + */ +function isParseInt(calleeNode) { + return ( + astUtils.isSpecificId(calleeNode, "parseInt") || + astUtils.isSpecificMemberAccess(calleeNode, "Number", "parseInt") + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-numeric-literals" + }, + + schema: [], + + messages: { + useLiteral: "Use {{system}} literals instead of {{functionName}}()." + }, + + fixable: "code" + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + + "CallExpression[arguments.length=2]"(node) { + const [strNode, radixNode] = node.arguments, + str = astUtils.getStaticStringValue(strNode), + radix = radixNode.value; + + if ( + str !== null && + astUtils.isStringLiteral(strNode) && + radixNode.type === "Literal" && + typeof radix === "number" && + radixMap.has(radix) && + isParseInt(node.callee) + ) { + + const { system, literalPrefix } = radixMap.get(radix); + + context.report({ + node, + messageId: "useLiteral", + data: { + system, + functionName: sourceCode.getText(node.callee) + }, + fix(fixer) { + if (sourceCode.getCommentsInside(node).length) { + return null; + } + + const replacement = `${literalPrefix}${str}`; + + if (+replacement !== parseInt(str, radix)) { + + /* + * If the newly-produced literal would be invalid, (e.g. 0b1234), + * or it would yield an incorrect parseInt result for some other reason, don't make a fix. + * + * If `str` had numeric separators, `+replacement` will evaluate to `NaN` because unary `+` + * per the specification doesn't support numeric separators. Thus, the above condition will be `true` + * (`NaN !== anything` is always `true`) regardless of the `parseInt(str, radix)` value. + * Consequently, no autofixes will be made. This is correct behavior because `parseInt` also + * doesn't support numeric separators, but it does parse part of the string before the first `_`, + * so the autofix would be invalid: + * + * parseInt("1_1", 2) // === 1 + * 0b1_1 // === 3 + */ + return null; + } + + const tokenBefore = sourceCode.getTokenBefore(node), + tokenAfter = sourceCode.getTokenAfter(node); + let prefix = "", + suffix = ""; + + if ( + tokenBefore && + tokenBefore.range[1] === node.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, replacement) + ) { + prefix = " "; + } + + if ( + tokenAfter && + node.range[1] === tokenAfter.range[0] && + !astUtils.canTokensBeAdjacent(replacement, tokenAfter) + ) { + suffix = " "; + } + + return fixer.replaceText(node, `${prefix}${replacement}${suffix}`); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-object-spread.js b/node_modules/eslint/lib/rules/prefer-object-spread.js new file mode 100644 index 000000000..ab252c73a --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-object-spread.js @@ -0,0 +1,299 @@ +/** + * @fileoverview Prefers object spread property over Object.assign + * @author Sharmila Jesupaul + * See LICENSE file in root directory for full license. + */ + +"use strict"; + +const { CALL, ReferenceTracker } = require("eslint-utils"); +const { + isCommaToken, + isOpeningParenToken, + isClosingParenToken, + isParenthesised +} = require("./utils/ast-utils"); + +const ANY_SPACE = /\s/u; + +/** + * Helper that checks if the Object.assign call has array spread + * @param {ASTNode} node The node that the rule warns on + * @returns {boolean} - Returns true if the Object.assign call has array spread + */ +function hasArraySpread(node) { + return node.arguments.some(arg => arg.type === "SpreadElement"); +} + +/** + * Determines whether the given node is an accessor property (getter/setter). + * @param {ASTNode} node Node to check. + * @returns {boolean} `true` if the node is a getter or a setter. + */ +function isAccessorProperty(node) { + return node.type === "Property" && + (node.kind === "get" || node.kind === "set"); +} + +/** + * Determines whether the given object expression node has accessor properties (getters/setters). + * @param {ASTNode} node `ObjectExpression` node to check. + * @returns {boolean} `true` if the node has at least one getter/setter. + */ +function hasAccessors(node) { + return node.properties.some(isAccessorProperty); +} + +/** + * Determines whether the given call expression node has object expression arguments with accessor properties (getters/setters). + * @param {ASTNode} node `CallExpression` node to check. + * @returns {boolean} `true` if the node has at least one argument that is an object expression with at least one getter/setter. + */ +function hasArgumentsWithAccessors(node) { + return node.arguments + .filter(arg => arg.type === "ObjectExpression") + .some(hasAccessors); +} + +/** + * Helper that checks if the node needs parentheses to be valid JS. + * The default is to wrap the node in parentheses to avoid parsing errors. + * @param {ASTNode} node The node that the rule warns on + * @param {Object} sourceCode in context sourcecode object + * @returns {boolean} - Returns true if the node needs parentheses + */ +function needsParens(node, sourceCode) { + const parent = node.parent; + + switch (parent.type) { + case "VariableDeclarator": + case "ArrayExpression": + case "ReturnStatement": + case "CallExpression": + case "Property": + return false; + case "AssignmentExpression": + return parent.left === node && !isParenthesised(sourceCode, node); + default: + return !isParenthesised(sourceCode, node); + } +} + +/** + * Determines if an argument needs parentheses. The default is to not add parens. + * @param {ASTNode} node The node to be checked. + * @param {Object} sourceCode in context sourcecode object + * @returns {boolean} True if the node needs parentheses + */ +function argNeedsParens(node, sourceCode) { + switch (node.type) { + case "AssignmentExpression": + case "ArrowFunctionExpression": + case "ConditionalExpression": + return !isParenthesised(sourceCode, node); + default: + return false; + } +} + +/** + * Get the parenthesis tokens of a given ObjectExpression node. + * This includes the braces of the object literal and enclosing parentheses. + * @param {ASTNode} node The node to get. + * @param {Token} leftArgumentListParen The opening paren token of the argument list. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {Token[]} The parenthesis tokens of the node. This is sorted by the location. + */ +function getParenTokens(node, leftArgumentListParen, sourceCode) { + const parens = [sourceCode.getFirstToken(node), sourceCode.getLastToken(node)]; + let leftNext = sourceCode.getTokenBefore(node); + let rightNext = sourceCode.getTokenAfter(node); + + // Note: don't include the parens of the argument list. + while ( + leftNext && + rightNext && + leftNext.range[0] > leftArgumentListParen.range[0] && + isOpeningParenToken(leftNext) && + isClosingParenToken(rightNext) + ) { + parens.push(leftNext, rightNext); + leftNext = sourceCode.getTokenBefore(leftNext); + rightNext = sourceCode.getTokenAfter(rightNext); + } + + return parens.sort((a, b) => a.range[0] - b.range[0]); +} + +/** + * Get the range of a given token and around whitespaces. + * @param {Token} token The token to get range. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {number} The end of the range of the token and around whitespaces. + */ +function getStartWithSpaces(token, sourceCode) { + const text = sourceCode.text; + let start = token.range[0]; + + // If the previous token is a line comment then skip this step to avoid commenting this token out. + { + const prevToken = sourceCode.getTokenBefore(token, { includeComments: true }); + + if (prevToken && prevToken.type === "Line") { + return start; + } + } + + // Detect spaces before the token. + while (ANY_SPACE.test(text[start - 1] || "")) { + start -= 1; + } + + return start; +} + +/** + * Get the range of a given token and around whitespaces. + * @param {Token} token The token to get range. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {number} The start of the range of the token and around whitespaces. + */ +function getEndWithSpaces(token, sourceCode) { + const text = sourceCode.text; + let end = token.range[1]; + + // Detect spaces after the token. + while (ANY_SPACE.test(text[end] || "")) { + end += 1; + } + + return end; +} + +/** + * Autofixes the Object.assign call to use an object spread instead. + * @param {ASTNode|null} node The node that the rule warns on, i.e. the Object.assign call + * @param {string} sourceCode sourceCode of the Object.assign call + * @returns {Function} autofixer - replaces the Object.assign with a spread object. + */ +function defineFixer(node, sourceCode) { + return function *(fixer) { + const leftParen = sourceCode.getTokenAfter(node.callee, isOpeningParenToken); + const rightParen = sourceCode.getLastToken(node); + + // Remove everything before the opening paren: callee `Object.assign`, type arguments, and whitespace between the callee and the paren. + yield fixer.removeRange([node.range[0], leftParen.range[0]]); + + // Replace the parens of argument list to braces. + if (needsParens(node, sourceCode)) { + yield fixer.replaceText(leftParen, "({"); + yield fixer.replaceText(rightParen, "})"); + } else { + yield fixer.replaceText(leftParen, "{"); + yield fixer.replaceText(rightParen, "}"); + } + + // Process arguments. + for (const argNode of node.arguments) { + const innerParens = getParenTokens(argNode, leftParen, sourceCode); + const left = innerParens.shift(); + const right = innerParens.pop(); + + if (argNode.type === "ObjectExpression") { + const maybeTrailingComma = sourceCode.getLastToken(argNode, 1); + const maybeArgumentComma = sourceCode.getTokenAfter(right); + + /* + * Make bare this object literal. + * And remove spaces inside of the braces for better formatting. + */ + for (const innerParen of innerParens) { + yield fixer.remove(innerParen); + } + const leftRange = [left.range[0], getEndWithSpaces(left, sourceCode)]; + const rightRange = [ + Math.max(getStartWithSpaces(right, sourceCode), leftRange[1]), // Ensure ranges don't overlap + right.range[1] + ]; + + yield fixer.removeRange(leftRange); + yield fixer.removeRange(rightRange); + + // Remove the comma of this argument if it's duplication. + if ( + (argNode.properties.length === 0 || isCommaToken(maybeTrailingComma)) && + isCommaToken(maybeArgumentComma) + ) { + yield fixer.remove(maybeArgumentComma); + } + } else { + + // Make spread. + if (argNeedsParens(argNode, sourceCode)) { + yield fixer.insertTextBefore(left, "...("); + yield fixer.insertTextAfter(right, ")"); + } else { + yield fixer.insertTextBefore(left, "..."); + } + } + } + }; +} + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: + "disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead.", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-object-spread" + }, + + schema: [], + fixable: "code", + + messages: { + useSpreadMessage: "Use an object spread instead of `Object.assign` eg: `{ ...foo }`.", + useLiteralMessage: "Use an object literal instead of `Object.assign`. eg: `{ foo: bar }`." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + Program() { + const scope = context.getScope(); + const tracker = new ReferenceTracker(scope); + const trackMap = { + Object: { + assign: { [CALL]: true } + } + }; + + // Iterate all calls of `Object.assign` (only of the global variable `Object`). + for (const { node } of tracker.iterateGlobalReferences(trackMap)) { + if ( + node.arguments.length >= 1 && + node.arguments[0].type === "ObjectExpression" && + !hasArraySpread(node) && + !( + node.arguments.length > 1 && + hasArgumentsWithAccessors(node) + ) + ) { + const messageId = node.arguments.length === 1 + ? "useLiteralMessage" + : "useSpreadMessage"; + const fix = defineFixer(node, sourceCode); + + context.report({ node, messageId, fix }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js b/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js new file mode 100644 index 000000000..ec16e4455 --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js @@ -0,0 +1,131 @@ +/** + * @fileoverview restrict values that can be used as Promise rejection reasons + * @author Teddy Katz + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require using Error objects as Promise rejection reasons", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-promise-reject-errors" + }, + + fixable: null, + + schema: [ + { + type: "object", + properties: { + allowEmptyReject: { type: "boolean", default: false } + }, + additionalProperties: false + } + ], + + messages: { + rejectAnError: "Expected the Promise rejection reason to be an Error." + } + }, + + create(context) { + + const ALLOW_EMPTY_REJECT = context.options.length && context.options[0].allowEmptyReject; + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Checks the argument of a reject() or Promise.reject() CallExpression, and reports it if it can't be an Error + * @param {ASTNode} callExpression A CallExpression node which is used to reject a Promise + * @returns {void} + */ + function checkRejectCall(callExpression) { + if (!callExpression.arguments.length && ALLOW_EMPTY_REJECT) { + return; + } + if ( + !callExpression.arguments.length || + !astUtils.couldBeError(callExpression.arguments[0]) || + callExpression.arguments[0].type === "Identifier" && callExpression.arguments[0].name === "undefined" + ) { + context.report({ + node: callExpression, + messageId: "rejectAnError" + }); + } + } + + /** + * Determines whether a function call is a Promise.reject() call + * @param {ASTNode} node A CallExpression node + * @returns {boolean} `true` if the call is a Promise.reject() call + */ + function isPromiseRejectCall(node) { + return astUtils.isSpecificMemberAccess(node.callee, "Promise", "reject"); + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + + // Check `Promise.reject(value)` calls. + CallExpression(node) { + if (isPromiseRejectCall(node)) { + checkRejectCall(node); + } + }, + + /* + * Check for `new Promise((resolve, reject) => {})`, and check for reject() calls. + * This function is run on "NewExpression:exit" instead of "NewExpression" to ensure that + * the nodes in the expression already have the `parent` property. + */ + "NewExpression:exit"(node) { + if ( + node.callee.type === "Identifier" && node.callee.name === "Promise" && + node.arguments.length && astUtils.isFunction(node.arguments[0]) && + node.arguments[0].params.length > 1 && node.arguments[0].params[1].type === "Identifier" + ) { + context.getDeclaredVariables(node.arguments[0]) + + /* + * Find the first variable that matches the second parameter's name. + * If the first parameter has the same name as the second parameter, then the variable will actually + * be "declared" when the first parameter is evaluated, but then it will be immediately overwritten + * by the second parameter. It's not possible for an expression with the variable to be evaluated before + * the variable is overwritten, because functions with duplicate parameters cannot have destructuring or + * default assignments in their parameter lists. Therefore, it's not necessary to explicitly account for + * this case. + */ + .find(variable => variable.name === node.arguments[0].params[1].name) + + // Get the references to that variable. + .references + + // Only check the references that read the parameter's value. + .filter(ref => ref.isRead()) + + // Only check the references that are used as the callee in a function call, e.g. `reject(foo)`. + .filter(ref => ref.identifier.parent.type === "CallExpression" && ref.identifier === ref.identifier.parent.callee) + + // Check the argument of the function call to determine whether it's an Error. + .forEach(ref => checkRejectCall(ref.identifier.parent)); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-reflect.js b/node_modules/eslint/lib/rules/prefer-reflect.js new file mode 100644 index 000000000..fb2de923b --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-reflect.js @@ -0,0 +1,127 @@ +/** + * @fileoverview Rule to suggest using "Reflect" api over Function/Object methods + * @author Keith Cirkel + * @deprecated in ESLint v3.9.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require `Reflect` methods where applicable", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-reflect" + }, + + deprecated: true, + + replacedBy: [], + + schema: [ + { + type: "object", + properties: { + exceptions: { + type: "array", + items: { + enum: [ + "apply", + "call", + "delete", + "defineProperty", + "getOwnPropertyDescriptor", + "getPrototypeOf", + "setPrototypeOf", + "isExtensible", + "getOwnPropertyNames", + "preventExtensions" + ] + }, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + preferReflect: "Avoid using {{existing}}, instead use {{substitute}}." + } + }, + + create(context) { + const existingNames = { + apply: "Function.prototype.apply", + call: "Function.prototype.call", + defineProperty: "Object.defineProperty", + getOwnPropertyDescriptor: "Object.getOwnPropertyDescriptor", + getPrototypeOf: "Object.getPrototypeOf", + setPrototypeOf: "Object.setPrototypeOf", + isExtensible: "Object.isExtensible", + getOwnPropertyNames: "Object.getOwnPropertyNames", + preventExtensions: "Object.preventExtensions" + }; + + const reflectSubstitutes = { + apply: "Reflect.apply", + call: "Reflect.apply", + defineProperty: "Reflect.defineProperty", + getOwnPropertyDescriptor: "Reflect.getOwnPropertyDescriptor", + getPrototypeOf: "Reflect.getPrototypeOf", + setPrototypeOf: "Reflect.setPrototypeOf", + isExtensible: "Reflect.isExtensible", + getOwnPropertyNames: "Reflect.getOwnPropertyNames", + preventExtensions: "Reflect.preventExtensions" + }; + + const exceptions = (context.options[0] || {}).exceptions || []; + + /** + * Reports the Reflect violation based on the `existing` and `substitute` + * @param {Object} node The node that violates the rule. + * @param {string} existing The existing method name that has been used. + * @param {string} substitute The Reflect substitute that should be used. + * @returns {void} + */ + function report(node, existing, substitute) { + context.report({ + node, + messageId: "preferReflect", + data: { + existing, + substitute + } + }); + } + + return { + CallExpression(node) { + const methodName = (node.callee.property || {}).name; + const isReflectCall = (node.callee.object || {}).name === "Reflect"; + const hasReflectSubsitute = Object.prototype.hasOwnProperty.call(reflectSubstitutes, methodName); + const userConfiguredException = exceptions.indexOf(methodName) !== -1; + + if (hasReflectSubsitute && !isReflectCall && !userConfiguredException) { + report(node, existingNames[methodName], reflectSubstitutes[methodName]); + } + }, + UnaryExpression(node) { + const isDeleteOperator = node.operator === "delete"; + const targetsIdentifier = node.argument.type === "Identifier"; + const userConfiguredException = exceptions.indexOf("delete") !== -1; + + if (isDeleteOperator && !targetsIdentifier && !userConfiguredException) { + report(node, "the delete keyword", "Reflect.deleteProperty"); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-regex-literals.js b/node_modules/eslint/lib/rules/prefer-regex-literals.js new file mode 100644 index 000000000..9e8ce0235 --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-regex-literals.js @@ -0,0 +1,180 @@ +/** + * @fileoverview Rule to disallow use of the `RegExp` constructor in favor of regular expression literals + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const { CALL, CONSTRUCT, ReferenceTracker, findVariable } = require("eslint-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines whether the given node is a string literal. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node is a string literal. + */ +function isStringLiteral(node) { + return node.type === "Literal" && typeof node.value === "string"; +} + +/** + * Determines whether the given node is a regex literal. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node is a regex literal. + */ +function isRegexLiteral(node) { + return node.type === "Literal" && Object.prototype.hasOwnProperty.call(node, "regex"); +} + +/** + * Determines whether the given node is a template literal without expressions. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node is a template literal without expressions. + */ +function isStaticTemplateLiteral(node) { + return node.type === "TemplateLiteral" && node.expressions.length === 0; +} + + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow use of the `RegExp` constructor in favor of regular expression literals", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-regex-literals" + }, + + schema: [ + { + type: "object", + properties: { + disallowRedundantWrapping: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedRegExp: "Use a regular expression literal instead of the 'RegExp' constructor.", + unexpectedRedundantRegExp: "Regular expression literal is unnecessarily wrapped within a 'RegExp' constructor.", + unexpectedRedundantRegExpWithFlags: "Use regular expression literal with flags instead of the 'RegExp' constructor." + } + }, + + create(context) { + const [{ disallowRedundantWrapping = false } = {}] = context.options; + + /** + * Determines whether the given identifier node is a reference to a global variable. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} True if the identifier is a reference to a global variable. + */ + function isGlobalReference(node) { + const scope = context.getScope(); + const variable = findVariable(scope, node); + + return variable !== null && variable.scope.type === "global" && variable.defs.length === 0; + } + + /** + * Determines whether the given node is a String.raw`` tagged template expression + * with a static template literal. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node is String.raw`` with a static template. + */ + function isStringRawTaggedStaticTemplateLiteral(node) { + return node.type === "TaggedTemplateExpression" && + astUtils.isSpecificMemberAccess(node.tag, "String", "raw") && + isGlobalReference(astUtils.skipChainExpression(node.tag).object) && + isStaticTemplateLiteral(node.quasi); + } + + /** + * Determines whether the given node is considered to be a static string by the logic of this rule. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node is a static string. + */ + function isStaticString(node) { + return isStringLiteral(node) || + isStaticTemplateLiteral(node) || + isStringRawTaggedStaticTemplateLiteral(node); + } + + /** + * Determines whether the relevant arguments of the given are all static string literals. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if all arguments are static strings. + */ + function hasOnlyStaticStringArguments(node) { + const args = node.arguments; + + if ((args.length === 1 || args.length === 2) && args.every(isStaticString)) { + return true; + } + + return false; + } + + /** + * Determines whether the arguments of the given node indicate that a regex literal is unnecessarily wrapped. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node already contains a regex literal argument. + */ + function isUnnecessarilyWrappedRegexLiteral(node) { + const args = node.arguments; + + if (args.length === 1 && isRegexLiteral(args[0])) { + return true; + } + + if (args.length === 2 && isRegexLiteral(args[0]) && isStaticString(args[1])) { + return true; + } + + return false; + } + + return { + Program() { + const scope = context.getScope(); + const tracker = new ReferenceTracker(scope); + const traceMap = { + RegExp: { + [CALL]: true, + [CONSTRUCT]: true + } + }; + + for (const { node } of tracker.iterateGlobalReferences(traceMap)) { + if (disallowRedundantWrapping && isUnnecessarilyWrappedRegexLiteral(node)) { + if (node.arguments.length === 2) { + context.report({ node, messageId: "unexpectedRedundantRegExpWithFlags" }); + } else { + context.report({ node, messageId: "unexpectedRedundantRegExp" }); + } + } else if (hasOnlyStaticStringArguments(node)) { + context.report({ node, messageId: "unexpectedRegExp" }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-rest-params.js b/node_modules/eslint/lib/rules/prefer-rest-params.js new file mode 100644 index 000000000..3ecea732a --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-rest-params.js @@ -0,0 +1,115 @@ +/** + * @fileoverview Rule to + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets the variable object of `arguments` which is defined implicitly. + * @param {eslint-scope.Scope} scope A scope to get. + * @returns {eslint-scope.Variable} The found variable object. + */ +function getVariableOfArguments(scope) { + const variables = scope.variables; + + for (let i = 0; i < variables.length; ++i) { + const variable = variables[i]; + + if (variable.name === "arguments") { + + /* + * If there was a parameter which is named "arguments", the implicit "arguments" is not defined. + * So does fast return with null. + */ + return (variable.identifiers.length === 0) ? variable : null; + } + } + + /* istanbul ignore next : unreachable */ + return null; +} + +/** + * Checks if the given reference is not normal member access. + * + * - arguments .... true // not member access + * - arguments[i] .... true // computed member access + * - arguments[0] .... true // computed member access + * - arguments.length .... false // normal member access + * @param {eslint-scope.Reference} reference The reference to check. + * @returns {boolean} `true` if the reference is not normal member access. + */ +function isNotNormalMemberAccess(reference) { + const id = reference.identifier; + const parent = id.parent; + + return !( + parent.type === "MemberExpression" && + parent.object === id && + !parent.computed + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require rest parameters instead of `arguments`", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-rest-params" + }, + + schema: [], + + messages: { + preferRestParams: "Use the rest parameters instead of 'arguments'." + } + }, + + create(context) { + + /** + * Reports a given reference. + * @param {eslint-scope.Reference} reference A reference to report. + * @returns {void} + */ + function report(reference) { + context.report({ + node: reference.identifier, + loc: reference.identifier.loc, + messageId: "preferRestParams" + }); + } + + /** + * Reports references of the implicit `arguments` variable if exist. + * @returns {void} + */ + function checkForArguments() { + const argumentsVar = getVariableOfArguments(context.getScope()); + + if (argumentsVar) { + argumentsVar + .references + .filter(isNotNormalMemberAccess) + .forEach(report); + } + } + + return { + "FunctionDeclaration:exit": checkForArguments, + "FunctionExpression:exit": checkForArguments + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-spread.js b/node_modules/eslint/lib/rules/prefer-spread.js new file mode 100644 index 000000000..d3c3c4d22 --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-spread.js @@ -0,0 +1,87 @@ +/** + * @fileoverview A rule to suggest using of the spread operator instead of `.apply()`. + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a node is a `.apply()` for variadic. + * @param {ASTNode} node A CallExpression node to check. + * @returns {boolean} Whether or not the node is a `.apply()` for variadic. + */ +function isVariadicApplyCalling(node) { + return ( + astUtils.isSpecificMemberAccess(node.callee, null, "apply") && + node.arguments.length === 2 && + node.arguments[1].type !== "ArrayExpression" && + node.arguments[1].type !== "SpreadElement" + ); +} + +/** + * Checks whether or not `thisArg` is not changed by `.apply()`. + * @param {ASTNode|null} expectedThis The node that is the owner of the applied function. + * @param {ASTNode} thisArg The node that is given to the first argument of the `.apply()`. + * @param {RuleContext} context The ESLint rule context object. + * @returns {boolean} Whether or not `thisArg` is not changed by `.apply()`. + */ +function isValidThisArg(expectedThis, thisArg, context) { + if (!expectedThis) { + return astUtils.isNullOrUndefined(thisArg); + } + return astUtils.equalTokens(expectedThis, thisArg, context); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require spread operators instead of `.apply()`", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-spread" + }, + + schema: [], + fixable: null, + + messages: { + preferSpread: "Use the spread operator instead of '.apply()'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + CallExpression(node) { + if (!isVariadicApplyCalling(node)) { + return; + } + + const applied = astUtils.skipChainExpression(astUtils.skipChainExpression(node.callee).object); + const expectedThis = (applied.type === "MemberExpression") ? applied.object : null; + const thisArg = node.arguments[0]; + + if (isValidThisArg(expectedThis, thisArg, sourceCode)) { + context.report({ + node, + messageId: "preferSpread" + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/prefer-template.js b/node_modules/eslint/lib/rules/prefer-template.js new file mode 100644 index 000000000..e8f980ebd --- /dev/null +++ b/node_modules/eslint/lib/rules/prefer-template.js @@ -0,0 +1,283 @@ +/** + * @fileoverview A rule to suggest using template literals instead of string concatenation. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a concatenation. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a concatenation. + */ +function isConcatenation(node) { + return node.type === "BinaryExpression" && node.operator === "+"; +} + +/** + * Gets the top binary expression node for concatenation in parents of a given node. + * @param {ASTNode} node A node to get. + * @returns {ASTNode} the top binary expression node in parents of a given node. + */ +function getTopConcatBinaryExpression(node) { + let currentNode = node; + + while (isConcatenation(currentNode.parent)) { + currentNode = currentNode.parent; + } + return currentNode; +} + +/** + * Determines whether a given node is a octal escape sequence + * @param {ASTNode} node A node to check + * @returns {boolean} `true` if the node is an octal escape sequence + */ +function isOctalEscapeSequence(node) { + + // No need to check TemplateLiterals – would throw error with octal escape + const isStringLiteral = node.type === "Literal" && typeof node.value === "string"; + + if (!isStringLiteral) { + return false; + } + + return astUtils.hasOctalEscapeSequence(node.raw); +} + +/** + * Checks whether or not a node contains a octal escape sequence + * @param {ASTNode} node A node to check + * @returns {boolean} `true` if the node contains an octal escape sequence + */ +function hasOctalEscapeSequence(node) { + if (isConcatenation(node)) { + return hasOctalEscapeSequence(node.left) || hasOctalEscapeSequence(node.right); + } + + return isOctalEscapeSequence(node); +} + +/** + * Checks whether or not a given binary expression has string literals. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node has string literals. + */ +function hasStringLiteral(node) { + if (isConcatenation(node)) { + + // `left` is deeper than `right` normally. + return hasStringLiteral(node.right) || hasStringLiteral(node.left); + } + return astUtils.isStringLiteral(node); +} + +/** + * Checks whether or not a given binary expression has non string literals. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node has non string literals. + */ +function hasNonStringLiteral(node) { + if (isConcatenation(node)) { + + // `left` is deeper than `right` normally. + return hasNonStringLiteral(node.right) || hasNonStringLiteral(node.left); + } + return !astUtils.isStringLiteral(node); +} + +/** + * Determines whether a given node will start with a template curly expression (`${}`) when being converted to a template literal. + * @param {ASTNode} node The node that will be fixed to a template literal + * @returns {boolean} `true` if the node will start with a template curly. + */ +function startsWithTemplateCurly(node) { + if (node.type === "BinaryExpression") { + return startsWithTemplateCurly(node.left); + } + if (node.type === "TemplateLiteral") { + return node.expressions.length && node.quasis.length && node.quasis[0].range[0] === node.quasis[0].range[1]; + } + return node.type !== "Literal" || typeof node.value !== "string"; +} + +/** + * Determines whether a given node end with a template curly expression (`${}`) when being converted to a template literal. + * @param {ASTNode} node The node that will be fixed to a template literal + * @returns {boolean} `true` if the node will end with a template curly. + */ +function endsWithTemplateCurly(node) { + if (node.type === "BinaryExpression") { + return startsWithTemplateCurly(node.right); + } + if (node.type === "TemplateLiteral") { + return node.expressions.length && node.quasis.length && node.quasis[node.quasis.length - 1].range[0] === node.quasis[node.quasis.length - 1].range[1]; + } + return node.type !== "Literal" || typeof node.value !== "string"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require template literals instead of string concatenation", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-template" + }, + + schema: [], + fixable: "code", + + messages: { + unexpectedStringConcatenation: "Unexpected string concatenation." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + let done = Object.create(null); + + /** + * Gets the non-token text between two nodes, ignoring any other tokens that appear between the two tokens. + * @param {ASTNode} node1 The first node + * @param {ASTNode} node2 The second node + * @returns {string} The text between the nodes, excluding other tokens + */ + function getTextBetween(node1, node2) { + const allTokens = [node1].concat(sourceCode.getTokensBetween(node1, node2)).concat(node2); + const sourceText = sourceCode.getText(); + + return allTokens.slice(0, -1).reduce((accumulator, token, index) => accumulator + sourceText.slice(token.range[1], allTokens[index + 1].range[0]), ""); + } + + /** + * Returns a template literal form of the given node. + * @param {ASTNode} currentNode A node that should be converted to a template literal + * @param {string} textBeforeNode Text that should appear before the node + * @param {string} textAfterNode Text that should appear after the node + * @returns {string} A string form of this node, represented as a template literal + */ + function getTemplateLiteral(currentNode, textBeforeNode, textAfterNode) { + if (currentNode.type === "Literal" && typeof currentNode.value === "string") { + + /* + * If the current node is a string literal, escape any instances of ${ or ` to prevent them from being interpreted + * as a template placeholder. However, if the code already contains a backslash before the ${ or ` + * for some reason, don't add another backslash, because that would change the meaning of the code (it would cause + * an actual backslash character to appear before the dollar sign). + */ + return `\`${currentNode.raw.slice(1, -1).replace(/\\*(\$\{|`)/gu, matched => { + if (matched.lastIndexOf("\\") % 2) { + return `\\${matched}`; + } + return matched; + + // Unescape any quotes that appear in the original Literal that no longer need to be escaped. + }).replace(new RegExp(`\\\\${currentNode.raw[0]}`, "gu"), currentNode.raw[0])}\``; + } + + if (currentNode.type === "TemplateLiteral") { + return sourceCode.getText(currentNode); + } + + if (isConcatenation(currentNode) && hasStringLiteral(currentNode) && hasNonStringLiteral(currentNode)) { + const plusSign = sourceCode.getFirstTokenBetween(currentNode.left, currentNode.right, token => token.value === "+"); + const textBeforePlus = getTextBetween(currentNode.left, plusSign); + const textAfterPlus = getTextBetween(plusSign, currentNode.right); + const leftEndsWithCurly = endsWithTemplateCurly(currentNode.left); + const rightStartsWithCurly = startsWithTemplateCurly(currentNode.right); + + if (leftEndsWithCurly) { + + // If the left side of the expression ends with a template curly, add the extra text to the end of the curly bracket. + // `foo${bar}` /* comment */ + 'baz' --> `foo${bar /* comment */ }${baz}` + return getTemplateLiteral(currentNode.left, textBeforeNode, textBeforePlus + textAfterPlus).slice(0, -1) + + getTemplateLiteral(currentNode.right, null, textAfterNode).slice(1); + } + if (rightStartsWithCurly) { + + // Otherwise, if the right side of the expression starts with a template curly, add the text there. + // 'foo' /* comment */ + `${bar}baz` --> `foo${ /* comment */ bar}baz` + return getTemplateLiteral(currentNode.left, textBeforeNode, null).slice(0, -1) + + getTemplateLiteral(currentNode.right, textBeforePlus + textAfterPlus, textAfterNode).slice(1); + } + + /* + * Otherwise, these nodes should not be combined into a template curly, since there is nowhere to put + * the text between them. + */ + return `${getTemplateLiteral(currentNode.left, textBeforeNode, null)}${textBeforePlus}+${textAfterPlus}${getTemplateLiteral(currentNode.right, textAfterNode, null)}`; + } + + return `\`\${${textBeforeNode || ""}${sourceCode.getText(currentNode)}${textAfterNode || ""}}\``; + } + + /** + * Returns a fixer object that converts a non-string binary expression to a template literal + * @param {SourceCodeFixer} fixer The fixer object + * @param {ASTNode} node A node that should be converted to a template literal + * @returns {Object} A fix for this binary expression + */ + function fixNonStringBinaryExpression(fixer, node) { + const topBinaryExpr = getTopConcatBinaryExpression(node.parent); + + if (hasOctalEscapeSequence(topBinaryExpr)) { + return null; + } + + return fixer.replaceText(topBinaryExpr, getTemplateLiteral(topBinaryExpr, null, null)); + } + + /** + * Reports if a given node is string concatenation with non string literals. + * @param {ASTNode} node A node to check. + * @returns {void} + */ + function checkForStringConcat(node) { + if (!astUtils.isStringLiteral(node) || !isConcatenation(node.parent)) { + return; + } + + const topBinaryExpr = getTopConcatBinaryExpression(node.parent); + + // Checks whether or not this node had been checked already. + if (done[topBinaryExpr.range[0]]) { + return; + } + done[topBinaryExpr.range[0]] = true; + + if (hasNonStringLiteral(topBinaryExpr)) { + context.report({ + node: topBinaryExpr, + messageId: "unexpectedStringConcatenation", + fix: fixer => fixNonStringBinaryExpression(fixer, node) + }); + } + } + + return { + Program() { + done = Object.create(null); + }, + + Literal: checkForStringConcat, + TemplateLiteral: checkForStringConcat + }; + } +}; diff --git a/node_modules/eslint/lib/rules/quote-props.js b/node_modules/eslint/lib/rules/quote-props.js new file mode 100644 index 000000000..fab7bdc9c --- /dev/null +++ b/node_modules/eslint/lib/rules/quote-props.js @@ -0,0 +1,307 @@ +/** + * @fileoverview Rule to flag non-quoted property names in object literals. + * @author Mathias Bynens + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const espree = require("espree"); +const astUtils = require("./utils/ast-utils"); +const keywords = require("./utils/keywords"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require quotes around object literal property names", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/quote-props" + }, + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["always", "as-needed", "consistent", "consistent-as-needed"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["always", "as-needed", "consistent", "consistent-as-needed"] + }, + { + type: "object", + properties: { + keywords: { + type: "boolean" + }, + unnecessary: { + type: "boolean" + }, + numbers: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + fixable: "code", + messages: { + requireQuotesDueToReservedWord: "Properties should be quoted as '{{property}}' is a reserved word.", + inconsistentlyQuotedProperty: "Inconsistently quoted property '{{key}}' found.", + unnecessarilyQuotedProperty: "Unnecessarily quoted property '{{property}}' found.", + unquotedReservedProperty: "Unquoted reserved word '{{property}}' used as key.", + unquotedNumericProperty: "Unquoted number literal '{{property}}' used as key.", + unquotedPropertyFound: "Unquoted property '{{property}}' found.", + redundantQuoting: "Properties shouldn't be quoted as all quotes are redundant." + } + }, + + create(context) { + + const MODE = context.options[0], + KEYWORDS = context.options[1] && context.options[1].keywords, + CHECK_UNNECESSARY = !context.options[1] || context.options[1].unnecessary !== false, + NUMBERS = context.options[1] && context.options[1].numbers, + + sourceCode = context.getSourceCode(); + + + /** + * Checks whether a certain string constitutes an ES3 token + * @param {string} tokenStr The string to be checked. + * @returns {boolean} `true` if it is an ES3 token. + */ + function isKeyword(tokenStr) { + return keywords.indexOf(tokenStr) >= 0; + } + + /** + * Checks if an espree-tokenized key has redundant quotes (i.e. whether quotes are unnecessary) + * @param {string} rawKey The raw key value from the source + * @param {espreeTokens} tokens The espree-tokenized node key + * @param {boolean} [skipNumberLiterals=false] Indicates whether number literals should be checked + * @returns {boolean} Whether or not a key has redundant quotes. + * @private + */ + function areQuotesRedundant(rawKey, tokens, skipNumberLiterals) { + return tokens.length === 1 && tokens[0].start === 0 && tokens[0].end === rawKey.length && + (["Identifier", "Keyword", "Null", "Boolean"].indexOf(tokens[0].type) >= 0 || + (tokens[0].type === "Numeric" && !skipNumberLiterals && String(+tokens[0].value) === tokens[0].value)); + } + + /** + * Returns a string representation of a property node with quotes removed + * @param {ASTNode} key Key AST Node, which may or may not be quoted + * @returns {string} A replacement string for this property + */ + function getUnquotedKey(key) { + return key.type === "Identifier" ? key.name : key.value; + } + + /** + * Returns a string representation of a property node with quotes added + * @param {ASTNode} key Key AST Node, which may or may not be quoted + * @returns {string} A replacement string for this property + */ + function getQuotedKey(key) { + if (key.type === "Literal" && typeof key.value === "string") { + + // If the key is already a string literal, don't replace the quotes with double quotes. + return sourceCode.getText(key); + } + + // Otherwise, the key is either an identifier or a number literal. + return `"${key.type === "Identifier" ? key.name : key.value}"`; + } + + /** + * Ensures that a property's key is quoted only when necessary + * @param {ASTNode} node Property AST node + * @returns {void} + */ + function checkUnnecessaryQuotes(node) { + const key = node.key; + + if (node.method || node.computed || node.shorthand) { + return; + } + + if (key.type === "Literal" && typeof key.value === "string") { + let tokens; + + try { + tokens = espree.tokenize(key.value); + } catch { + return; + } + + if (tokens.length !== 1) { + return; + } + + const isKeywordToken = isKeyword(tokens[0].value); + + if (isKeywordToken && KEYWORDS) { + return; + } + + if (CHECK_UNNECESSARY && areQuotesRedundant(key.value, tokens, NUMBERS)) { + context.report({ + node, + messageId: "unnecessarilyQuotedProperty", + data: { property: key.value }, + fix: fixer => fixer.replaceText(key, getUnquotedKey(key)) + }); + } + } else if (KEYWORDS && key.type === "Identifier" && isKeyword(key.name)) { + context.report({ + node, + messageId: "unquotedReservedProperty", + data: { property: key.name }, + fix: fixer => fixer.replaceText(key, getQuotedKey(key)) + }); + } else if (NUMBERS && key.type === "Literal" && astUtils.isNumericLiteral(key)) { + context.report({ + node, + messageId: "unquotedNumericProperty", + data: { property: key.value }, + fix: fixer => fixer.replaceText(key, getQuotedKey(key)) + }); + } + } + + /** + * Ensures that a property's key is quoted + * @param {ASTNode} node Property AST node + * @returns {void} + */ + function checkOmittedQuotes(node) { + const key = node.key; + + if (!node.method && !node.computed && !node.shorthand && !(key.type === "Literal" && typeof key.value === "string")) { + context.report({ + node, + messageId: "unquotedPropertyFound", + data: { property: key.name || key.value }, + fix: fixer => fixer.replaceText(key, getQuotedKey(key)) + }); + } + } + + /** + * Ensures that an object's keys are consistently quoted, optionally checks for redundancy of quotes + * @param {ASTNode} node Property AST node + * @param {boolean} checkQuotesRedundancy Whether to check quotes' redundancy + * @returns {void} + */ + function checkConsistency(node, checkQuotesRedundancy) { + const quotedProps = [], + unquotedProps = []; + let keywordKeyName = null, + necessaryQuotes = false; + + node.properties.forEach(property => { + const key = property.key; + + if (!key || property.method || property.computed || property.shorthand) { + return; + } + + if (key.type === "Literal" && typeof key.value === "string") { + + quotedProps.push(property); + + if (checkQuotesRedundancy) { + let tokens; + + try { + tokens = espree.tokenize(key.value); + } catch { + necessaryQuotes = true; + return; + } + + necessaryQuotes = necessaryQuotes || !areQuotesRedundant(key.value, tokens) || KEYWORDS && isKeyword(tokens[0].value); + } + } else if (KEYWORDS && checkQuotesRedundancy && key.type === "Identifier" && isKeyword(key.name)) { + unquotedProps.push(property); + necessaryQuotes = true; + keywordKeyName = key.name; + } else { + unquotedProps.push(property); + } + }); + + if (checkQuotesRedundancy && quotedProps.length && !necessaryQuotes) { + quotedProps.forEach(property => { + context.report({ + node: property, + messageId: "redundantQuoting", + fix: fixer => fixer.replaceText(property.key, getUnquotedKey(property.key)) + }); + }); + } else if (unquotedProps.length && keywordKeyName) { + unquotedProps.forEach(property => { + context.report({ + node: property, + messageId: "requireQuotesDueToReservedWord", + data: { property: keywordKeyName }, + fix: fixer => fixer.replaceText(property.key, getQuotedKey(property.key)) + }); + }); + } else if (quotedProps.length && unquotedProps.length) { + unquotedProps.forEach(property => { + context.report({ + node: property, + messageId: "inconsistentlyQuotedProperty", + data: { key: property.key.name || property.key.value }, + fix: fixer => fixer.replaceText(property.key, getQuotedKey(property.key)) + }); + }); + } + } + + return { + Property(node) { + if (MODE === "always" || !MODE) { + checkOmittedQuotes(node); + } + if (MODE === "as-needed") { + checkUnnecessaryQuotes(node); + } + }, + ObjectExpression(node) { + if (MODE === "consistent") { + checkConsistency(node, false); + } + if (MODE === "consistent-as-needed") { + checkConsistency(node, true); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/quotes.js b/node_modules/eslint/lib/rules/quotes.js new file mode 100644 index 000000000..d1f4443b9 --- /dev/null +++ b/node_modules/eslint/lib/rules/quotes.js @@ -0,0 +1,332 @@ +/** + * @fileoverview A rule to choose between single and double quote marks + * @author Matt DuVall , Brandon Payton + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +const QUOTE_SETTINGS = { + double: { + quote: "\"", + alternateQuote: "'", + description: "doublequote" + }, + single: { + quote: "'", + alternateQuote: "\"", + description: "singlequote" + }, + backtick: { + quote: "`", + alternateQuote: "\"", + description: "backtick" + } +}; + +// An unescaped newline is a newline preceded by an even number of backslashes. +const UNESCAPED_LINEBREAK_PATTERN = new RegExp(String.raw`(^|[^\\])(\\\\)*[${Array.from(astUtils.LINEBREAKS).join("")}]`, "u"); + +/** + * Switches quoting of javascript string between ' " and ` + * escaping and unescaping as necessary. + * Only escaping of the minimal set of characters is changed. + * Note: escaping of newlines when switching from backtick to other quotes is not handled. + * @param {string} str A string to convert. + * @returns {string} The string with changed quotes. + * @private + */ +QUOTE_SETTINGS.double.convert = +QUOTE_SETTINGS.single.convert = +QUOTE_SETTINGS.backtick.convert = function(str) { + const newQuote = this.quote; + const oldQuote = str[0]; + + if (newQuote === oldQuote) { + return str; + } + return newQuote + str.slice(1, -1).replace(/\\(\$\{|\r\n?|\n|.)|["'`]|\$\{|(\r\n?|\n)/gu, (match, escaped, newline) => { + if (escaped === oldQuote || oldQuote === "`" && escaped === "${") { + return escaped; // unescape + } + if (match === newQuote || newQuote === "`" && match === "${") { + return `\\${match}`; // escape + } + if (newline && oldQuote === "`") { + return "\\n"; // escape newlines + } + return match; + }) + newQuote; +}; + +const AVOID_ESCAPE = "avoid-escape"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce the consistent use of either backticks, double, or single quotes", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/quotes" + }, + + fixable: "code", + + schema: [ + { + enum: ["single", "double", "backtick"] + }, + { + anyOf: [ + { + enum: ["avoid-escape"] + }, + { + type: "object", + properties: { + avoidEscape: { + type: "boolean" + }, + allowTemplateLiterals: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + wrongQuotes: "Strings must use {{description}}." + } + }, + + create(context) { + + const quoteOption = context.options[0], + settings = QUOTE_SETTINGS[quoteOption || "double"], + options = context.options[1], + allowTemplateLiterals = options && options.allowTemplateLiterals === true, + sourceCode = context.getSourceCode(); + let avoidEscape = options && options.avoidEscape === true; + + // deprecated + if (options === AVOID_ESCAPE) { + avoidEscape = true; + } + + /** + * Determines if a given node is part of JSX syntax. + * + * This function returns `true` in the following cases: + * + * - `
` ... If the literal is an attribute value, the parent of the literal is `JSXAttribute`. + * - `
foo
` ... If the literal is a text content, the parent of the literal is `JSXElement`. + * - `<>foo` ... If the literal is a text content, the parent of the literal is `JSXFragment`. + * + * In particular, this function returns `false` in the following cases: + * + * - `
` + * - `
{"foo"}
` + * + * In both cases, inside of the braces is handled as normal JavaScript. + * The braces are `JSXExpressionContainer` nodes. + * @param {ASTNode} node The Literal node to check. + * @returns {boolean} True if the node is a part of JSX, false if not. + * @private + */ + function isJSXLiteral(node) { + return node.parent.type === "JSXAttribute" || node.parent.type === "JSXElement" || node.parent.type === "JSXFragment"; + } + + /** + * Checks whether or not a given node is a directive. + * The directive is a `ExpressionStatement` which has only a string literal. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a directive. + * @private + */ + function isDirective(node) { + return ( + node.type === "ExpressionStatement" && + node.expression.type === "Literal" && + typeof node.expression.value === "string" + ); + } + + /** + * Checks whether or not a given node is a part of directive prologues. + * See also: http://www.ecma-international.org/ecma-262/6.0/#sec-directive-prologues-and-the-use-strict-directive + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a part of directive prologues. + * @private + */ + function isPartOfDirectivePrologue(node) { + const block = node.parent.parent; + + if (block.type !== "Program" && (block.type !== "BlockStatement" || !astUtils.isFunction(block.parent))) { + return false; + } + + // Check the node is at a prologue. + for (let i = 0; i < block.body.length; ++i) { + const statement = block.body[i]; + + if (statement === node.parent) { + return true; + } + if (!isDirective(statement)) { + break; + } + } + + return false; + } + + /** + * Checks whether or not a given node is allowed as non backtick. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is allowed as non backtick. + * @private + */ + function isAllowedAsNonBacktick(node) { + const parent = node.parent; + + switch (parent.type) { + + // Directive Prologues. + case "ExpressionStatement": + return isPartOfDirectivePrologue(node); + + // LiteralPropertyName. + case "Property": + case "MethodDefinition": + return parent.key === node && !parent.computed; + + // ModuleSpecifier. + case "ImportDeclaration": + case "ExportNamedDeclaration": + case "ExportAllDeclaration": + return parent.source === node; + + // Others don't allow. + default: + return false; + } + } + + /** + * Checks whether or not a given TemplateLiteral node is actually using any of the special features provided by template literal strings. + * @param {ASTNode} node A TemplateLiteral node to check. + * @returns {boolean} Whether or not the TemplateLiteral node is using any of the special features provided by template literal strings. + * @private + */ + function isUsingFeatureOfTemplateLiteral(node) { + const hasTag = node.parent.type === "TaggedTemplateExpression" && node === node.parent.quasi; + + if (hasTag) { + return true; + } + + const hasStringInterpolation = node.expressions.length > 0; + + if (hasStringInterpolation) { + return true; + } + + const isMultilineString = node.quasis.length >= 1 && UNESCAPED_LINEBREAK_PATTERN.test(node.quasis[0].value.raw); + + if (isMultilineString) { + return true; + } + + return false; + } + + return { + + Literal(node) { + const val = node.value, + rawVal = node.raw; + + if (settings && typeof val === "string") { + let isValid = (quoteOption === "backtick" && isAllowedAsNonBacktick(node)) || + isJSXLiteral(node) || + astUtils.isSurroundedBy(rawVal, settings.quote); + + if (!isValid && avoidEscape) { + isValid = astUtils.isSurroundedBy(rawVal, settings.alternateQuote) && rawVal.indexOf(settings.quote) >= 0; + } + + if (!isValid) { + context.report({ + node, + messageId: "wrongQuotes", + data: { + description: settings.description + }, + fix(fixer) { + if (quoteOption === "backtick" && astUtils.hasOctalEscapeSequence(rawVal)) { + + // An octal escape sequence in a template literal would produce syntax error, even in non-strict mode. + return null; + } + + return fixer.replaceText(node, settings.convert(node.raw)); + } + }); + } + } + }, + + TemplateLiteral(node) { + + // Don't throw an error if backticks are expected or a template literal feature is in use. + if ( + allowTemplateLiterals || + quoteOption === "backtick" || + isUsingFeatureOfTemplateLiteral(node) + ) { + return; + } + + context.report({ + node, + messageId: "wrongQuotes", + data: { + description: settings.description + }, + fix(fixer) { + if (isPartOfDirectivePrologue(node)) { + + /* + * TemplateLiterals in a directive prologue aren't actually directives, but if they're + * in the directive prologue, then fixing them might turn them into directives and change + * the behavior of the code. + */ + return null; + } + return fixer.replaceText(node, settings.convert(sourceCode.getText(node))); + } + }); + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/radix.js b/node_modules/eslint/lib/rules/radix.js new file mode 100644 index 000000000..e32256623 --- /dev/null +++ b/node_modules/eslint/lib/rules/radix.js @@ -0,0 +1,181 @@ +/** + * @fileoverview Rule to flag use of parseInt without a radix argument + * @author James Allardice + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const MODE_ALWAYS = "always", + MODE_AS_NEEDED = "as-needed"; + +const validRadixValues = new Set(Array.from({ length: 37 - 2 }, (_, index) => index + 2)); + +/** + * Checks whether a given variable is shadowed or not. + * @param {eslint-scope.Variable} variable A variable to check. + * @returns {boolean} `true` if the variable is shadowed. + */ +function isShadowed(variable) { + return variable.defs.length >= 1; +} + +/** + * Checks whether a given node is a MemberExpression of `parseInt` method or not. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a MemberExpression of `parseInt` + * method. + */ +function isParseIntMethod(node) { + return ( + node.type === "MemberExpression" && + !node.computed && + node.property.type === "Identifier" && + node.property.name === "parseInt" + ); +} + +/** + * Checks whether a given node is a valid value of radix or not. + * + * The following values are invalid. + * + * - A literal except integers between 2 and 36. + * - undefined. + * @param {ASTNode} radix A node of radix to check. + * @returns {boolean} `true` if the node is valid. + */ +function isValidRadix(radix) { + return !( + (radix.type === "Literal" && !validRadixValues.has(radix.value)) || + (radix.type === "Identifier" && radix.name === "undefined") + ); +} + +/** + * Checks whether a given node is a default value of radix or not. + * @param {ASTNode} radix A node of radix to check. + * @returns {boolean} `true` if the node is the literal node of `10`. + */ +function isDefaultRadix(radix) { + return radix.type === "Literal" && radix.value === 10; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce the consistent use of the radix argument when using `parseInt()`", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/radix" + }, + + schema: [ + { + enum: ["always", "as-needed"] + } + ], + + messages: { + missingParameters: "Missing parameters.", + redundantRadix: "Redundant radix parameter.", + missingRadix: "Missing radix parameter.", + invalidRadix: "Invalid radix parameter, must be an integer between 2 and 36." + } + }, + + create(context) { + const mode = context.options[0] || MODE_ALWAYS; + + /** + * Checks the arguments of a given CallExpression node and reports it if it + * offends this rule. + * @param {ASTNode} node A CallExpression node to check. + * @returns {void} + */ + function checkArguments(node) { + const args = node.arguments; + + switch (args.length) { + case 0: + context.report({ + node, + messageId: "missingParameters" + }); + break; + + case 1: + if (mode === MODE_ALWAYS) { + context.report({ + node, + messageId: "missingRadix" + }); + } + break; + + default: + if (mode === MODE_AS_NEEDED && isDefaultRadix(args[1])) { + context.report({ + node, + messageId: "redundantRadix" + }); + } else if (!isValidRadix(args[1])) { + context.report({ + node, + messageId: "invalidRadix" + }); + } + break; + } + } + + return { + "Program:exit"() { + const scope = context.getScope(); + let variable; + + // Check `parseInt()` + variable = astUtils.getVariableByName(scope, "parseInt"); + if (variable && !isShadowed(variable)) { + variable.references.forEach(reference => { + const node = reference.identifier; + + if (astUtils.isCallee(node)) { + checkArguments(node.parent); + } + }); + } + + // Check `Number.parseInt()` + variable = astUtils.getVariableByName(scope, "Number"); + if (variable && !isShadowed(variable)) { + variable.references.forEach(reference => { + const node = reference.identifier.parent; + const maybeCallee = node.parent.type === "ChainExpression" + ? node.parent + : node; + + if (isParseIntMethod(node) && astUtils.isCallee(maybeCallee)) { + checkArguments(maybeCallee.parent); + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/require-atomic-updates.js b/node_modules/eslint/lib/rules/require-atomic-updates.js new file mode 100644 index 000000000..4f6acceab --- /dev/null +++ b/node_modules/eslint/lib/rules/require-atomic-updates.js @@ -0,0 +1,283 @@ +/** + * @fileoverview disallow assignments that can lead to race conditions due to usage of `await` or `yield` + * @author Teddy Katz + * @author Toru Nagashima + */ +"use strict"; + +/** + * Make the map from identifiers to each reference. + * @param {escope.Scope} scope The scope to get references. + * @param {Map} [outReferenceMap] The map from identifier nodes to each reference object. + * @returns {Map} `referenceMap`. + */ +function createReferenceMap(scope, outReferenceMap = new Map()) { + for (const reference of scope.references) { + outReferenceMap.set(reference.identifier, reference); + } + for (const childScope of scope.childScopes) { + if (childScope.type !== "function") { + createReferenceMap(childScope, outReferenceMap); + } + } + + return outReferenceMap; +} + +/** + * Get `reference.writeExpr` of a given reference. + * If it's the read reference of MemberExpression in LHS, returns RHS in order to address `a.b = await a` + * @param {escope.Reference} reference The reference to get. + * @returns {Expression|null} The `reference.writeExpr`. + */ +function getWriteExpr(reference) { + if (reference.writeExpr) { + return reference.writeExpr; + } + let node = reference.identifier; + + while (node) { + const t = node.parent.type; + + if (t === "AssignmentExpression" && node.parent.left === node) { + return node.parent.right; + } + if (t === "MemberExpression" && node.parent.object === node) { + node = node.parent; + continue; + } + + break; + } + + return null; +} + +/** + * Checks if an expression is a variable that can only be observed within the given function. + * @param {Variable|null} variable The variable to check + * @param {boolean} isMemberAccess If `true` then this is a member access. + * @returns {boolean} `true` if the variable is local to the given function, and is never referenced in a closure. + */ +function isLocalVariableWithoutEscape(variable, isMemberAccess) { + if (!variable) { + return false; // A global variable which was not defined. + } + + // If the reference is a property access and the variable is a parameter, it handles the variable is not local. + if (isMemberAccess && variable.defs.some(d => d.type === "Parameter")) { + return false; + } + + const functionScope = variable.scope.variableScope; + + return variable.references.every(reference => + reference.from.variableScope === functionScope); +} + +class SegmentInfo { + constructor() { + this.info = new WeakMap(); + } + + /** + * Initialize the segment information. + * @param {PathSegment} segment The segment to initialize. + * @returns {void} + */ + initialize(segment) { + const outdatedReadVariableNames = new Set(); + const freshReadVariableNames = new Set(); + + for (const prevSegment of segment.prevSegments) { + const info = this.info.get(prevSegment); + + if (info) { + info.outdatedReadVariableNames.forEach(Set.prototype.add, outdatedReadVariableNames); + info.freshReadVariableNames.forEach(Set.prototype.add, freshReadVariableNames); + } + } + + this.info.set(segment, { outdatedReadVariableNames, freshReadVariableNames }); + } + + /** + * Mark a given variable as read on given segments. + * @param {PathSegment[]} segments The segments that it read the variable on. + * @param {string} variableName The variable name to be read. + * @returns {void} + */ + markAsRead(segments, variableName) { + for (const segment of segments) { + const info = this.info.get(segment); + + if (info) { + info.freshReadVariableNames.add(variableName); + } + } + } + + /** + * Move `freshReadVariableNames` to `outdatedReadVariableNames`. + * @param {PathSegment[]} segments The segments to process. + * @returns {void} + */ + makeOutdated(segments) { + for (const segment of segments) { + const info = this.info.get(segment); + + if (info) { + info.freshReadVariableNames.forEach(Set.prototype.add, info.outdatedReadVariableNames); + info.freshReadVariableNames.clear(); + } + } + } + + /** + * Check if a given variable is outdated on the current segments. + * @param {PathSegment[]} segments The current segments. + * @param {string} variableName The variable name to check. + * @returns {boolean} `true` if the variable is outdated on the segments. + */ + isOutdated(segments, variableName) { + for (const segment of segments) { + const info = this.info.get(segment); + + if (info && info.outdatedReadVariableNames.has(variableName)) { + return true; + } + } + return false; + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow assignments that can lead to race conditions due to usage of `await` or `yield`", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/require-atomic-updates" + }, + + fixable: null, + schema: [], + + messages: { + nonAtomicUpdate: "Possible race condition: `{{value}}` might be reassigned based on an outdated value of `{{value}}`." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const assignmentReferences = new Map(); + const segmentInfo = new SegmentInfo(); + let stack = null; + + return { + onCodePathStart(codePath) { + const scope = context.getScope(); + const shouldVerify = + scope.type === "function" && + (scope.block.async || scope.block.generator); + + stack = { + upper: stack, + codePath, + referenceMap: shouldVerify ? createReferenceMap(scope) : null + }; + }, + onCodePathEnd() { + stack = stack.upper; + }, + + // Initialize the segment information. + onCodePathSegmentStart(segment) { + segmentInfo.initialize(segment); + }, + + // Handle references to prepare verification. + Identifier(node) { + const { codePath, referenceMap } = stack; + const reference = referenceMap && referenceMap.get(node); + + // Ignore if this is not a valid variable reference. + if (!reference) { + return; + } + const name = reference.identifier.name; + const variable = reference.resolved; + const writeExpr = getWriteExpr(reference); + const isMemberAccess = reference.identifier.parent.type === "MemberExpression"; + + // Add a fresh read variable. + if (reference.isRead() && !(writeExpr && writeExpr.parent.operator === "=")) { + segmentInfo.markAsRead(codePath.currentSegments, name); + } + + /* + * Register the variable to verify after ESLint traversed the `writeExpr` node + * if this reference is an assignment to a variable which is referred from other closure. + */ + if (writeExpr && + writeExpr.parent.right === writeExpr && // ← exclude variable declarations. + !isLocalVariableWithoutEscape(variable, isMemberAccess) + ) { + let refs = assignmentReferences.get(writeExpr); + + if (!refs) { + refs = []; + assignmentReferences.set(writeExpr, refs); + } + + refs.push(reference); + } + }, + + /* + * Verify assignments. + * If the reference exists in `outdatedReadVariableNames` list, report it. + */ + ":expression:exit"(node) { + const { codePath, referenceMap } = stack; + + // referenceMap exists if this is in a resumable function scope. + if (!referenceMap) { + return; + } + + // Mark the read variables on this code path as outdated. + if (node.type === "AwaitExpression" || node.type === "YieldExpression") { + segmentInfo.makeOutdated(codePath.currentSegments); + } + + // Verify. + const references = assignmentReferences.get(node); + + if (references) { + assignmentReferences.delete(node); + + for (const reference of references) { + const name = reference.identifier.name; + + if (segmentInfo.isOutdated(codePath.currentSegments, name)) { + context.report({ + node: node.parent, + messageId: "nonAtomicUpdate", + data: { + value: sourceCode.getText(node.parent.left) + } + }); + } + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/require-await.js b/node_modules/eslint/lib/rules/require-await.js new file mode 100644 index 000000000..9b5acc78c --- /dev/null +++ b/node_modules/eslint/lib/rules/require-await.js @@ -0,0 +1,113 @@ +/** + * @fileoverview Rule to disallow async functions which have no `await` expression. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Capitalize the 1st letter of the given text. + * @param {string} text The text to capitalize. + * @returns {string} The text that the 1st letter was capitalized. + */ +function capitalizeFirstLetter(text) { + return text[0].toUpperCase() + text.slice(1); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow async functions which have no `await` expression", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/require-await" + }, + + schema: [], + + messages: { + missingAwait: "{{name}} has no 'await' expression." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + let scopeInfo = null; + + /** + * Push the scope info object to the stack. + * @returns {void} + */ + function enterFunction() { + scopeInfo = { + upper: scopeInfo, + hasAwait: false + }; + } + + /** + * Pop the top scope info object from the stack. + * Also, it reports the function if needed. + * @param {ASTNode} node The node to report. + * @returns {void} + */ + function exitFunction(node) { + if (!node.generator && node.async && !scopeInfo.hasAwait && !astUtils.isEmptyFunction(node)) { + context.report({ + node, + loc: astUtils.getFunctionHeadLoc(node, sourceCode), + messageId: "missingAwait", + data: { + name: capitalizeFirstLetter( + astUtils.getFunctionNameWithKind(node) + ) + } + }); + } + + scopeInfo = scopeInfo.upper; + } + + return { + FunctionDeclaration: enterFunction, + FunctionExpression: enterFunction, + ArrowFunctionExpression: enterFunction, + "FunctionDeclaration:exit": exitFunction, + "FunctionExpression:exit": exitFunction, + "ArrowFunctionExpression:exit": exitFunction, + + AwaitExpression() { + if (!scopeInfo) { + return; + } + + scopeInfo.hasAwait = true; + }, + ForOfStatement(node) { + if (!scopeInfo) { + return; + } + + if (node.await) { + scopeInfo.hasAwait = true; + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/require-jsdoc.js b/node_modules/eslint/lib/rules/require-jsdoc.js new file mode 100644 index 000000000..e581b2bee --- /dev/null +++ b/node_modules/eslint/lib/rules/require-jsdoc.js @@ -0,0 +1,121 @@ +/** + * @fileoverview Rule to check for jsdoc presence. + * @author Gyandeep Singh + */ +"use strict"; + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require JSDoc comments", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/require-jsdoc" + }, + + schema: [ + { + type: "object", + properties: { + require: { + type: "object", + properties: { + ClassDeclaration: { + type: "boolean", + default: false + }, + MethodDefinition: { + type: "boolean", + default: false + }, + FunctionDeclaration: { + type: "boolean", + default: true + }, + ArrowFunctionExpression: { + type: "boolean", + default: false + }, + FunctionExpression: { + type: "boolean", + default: false + } + }, + additionalProperties: false, + default: {} + } + }, + additionalProperties: false + } + ], + + deprecated: true, + replacedBy: [], + + messages: { + missingJSDocComment: "Missing JSDoc comment." + } + }, + + create(context) { + const source = context.getSourceCode(); + const DEFAULT_OPTIONS = { + FunctionDeclaration: true, + MethodDefinition: false, + ClassDeclaration: false, + ArrowFunctionExpression: false, + FunctionExpression: false + }; + const options = Object.assign(DEFAULT_OPTIONS, context.options[0] && context.options[0].require); + + /** + * Report the error message + * @param {ASTNode} node node to report + * @returns {void} + */ + function report(node) { + context.report({ node, messageId: "missingJSDocComment" }); + } + + /** + * Check if the jsdoc comment is present or not. + * @param {ASTNode} node node to examine + * @returns {void} + */ + function checkJsDoc(node) { + const jsdocComment = source.getJSDocComment(node); + + if (!jsdocComment) { + report(node); + } + } + + return { + FunctionDeclaration(node) { + if (options.FunctionDeclaration) { + checkJsDoc(node); + } + }, + FunctionExpression(node) { + if ( + (options.MethodDefinition && node.parent.type === "MethodDefinition") || + (options.FunctionExpression && (node.parent.type === "VariableDeclarator" || (node.parent.type === "Property" && node === node.parent.value))) + ) { + checkJsDoc(node); + } + }, + ClassDeclaration(node) { + if (options.ClassDeclaration) { + checkJsDoc(node); + } + }, + ArrowFunctionExpression(node) { + if (options.ArrowFunctionExpression && node.parent.type === "VariableDeclarator") { + checkJsDoc(node); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/require-unicode-regexp.js b/node_modules/eslint/lib/rules/require-unicode-regexp.js new file mode 100644 index 000000000..880405e9a --- /dev/null +++ b/node_modules/eslint/lib/rules/require-unicode-regexp.js @@ -0,0 +1,69 @@ +/** + * @fileoverview Rule to enforce the use of `u` flag on RegExp. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { + CALL, + CONSTRUCT, + ReferenceTracker, + getStringIfConstant +} = require("eslint-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce the use of `u` flag on RegExp", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/require-unicode-regexp" + }, + + messages: { + requireUFlag: "Use the 'u' flag." + }, + + schema: [] + }, + + create(context) { + return { + "Literal[regex]"(node) { + const flags = node.regex.flags || ""; + + if (!flags.includes("u")) { + context.report({ node, messageId: "requireUFlag" }); + } + }, + + Program() { + const scope = context.getScope(); + const tracker = new ReferenceTracker(scope); + const trackMap = { + RegExp: { [CALL]: true, [CONSTRUCT]: true } + }; + + for (const { node } of tracker.iterateGlobalReferences(trackMap)) { + const flagsNode = node.arguments[1]; + const flags = getStringIfConstant(flagsNode, scope); + + if (!flagsNode || (typeof flags === "string" && !flags.includes("u"))) { + context.report({ node, messageId: "requireUFlag" }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/require-yield.js b/node_modules/eslint/lib/rules/require-yield.js new file mode 100644 index 000000000..af2344dfa --- /dev/null +++ b/node_modules/eslint/lib/rules/require-yield.js @@ -0,0 +1,78 @@ +/** + * @fileoverview Rule to flag the generator functions that does not have yield. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require generator functions to contain `yield`", + category: "ECMAScript 6", + recommended: true, + url: "https://eslint.org/docs/rules/require-yield" + }, + + schema: [], + + messages: { + missingYield: "This generator function does not have 'yield'." + } + }, + + create(context) { + const stack = []; + + /** + * If the node is a generator function, start counting `yield` keywords. + * @param {Node} node A function node to check. + * @returns {void} + */ + function beginChecking(node) { + if (node.generator) { + stack.push(0); + } + } + + /** + * If the node is a generator function, end counting `yield` keywords, then + * reports result. + * @param {Node} node A function node to check. + * @returns {void} + */ + function endChecking(node) { + if (!node.generator) { + return; + } + + const countYield = stack.pop(); + + if (countYield === 0 && node.body.body.length > 0) { + context.report({ node, messageId: "missingYield" }); + } + } + + return { + FunctionDeclaration: beginChecking, + "FunctionDeclaration:exit": endChecking, + FunctionExpression: beginChecking, + "FunctionExpression:exit": endChecking, + + // Increases the count of `yield` keyword. + YieldExpression() { + + /* istanbul ignore else */ + if (stack.length > 0) { + stack[stack.length - 1] += 1; + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/rest-spread-spacing.js b/node_modules/eslint/lib/rules/rest-spread-spacing.js new file mode 100644 index 000000000..8cb9814f0 --- /dev/null +++ b/node_modules/eslint/lib/rules/rest-spread-spacing.js @@ -0,0 +1,120 @@ +/** + * @fileoverview Enforce spacing between rest and spread operators and their expressions. + * @author Kai Cataldo + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce spacing between rest and spread operators and their expressions", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/rest-spread-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + } + ], + + messages: { + unexpectedWhitespace: "Unexpected whitespace after {{type}} operator.", + expectedWhitespace: "Expected whitespace after {{type}} operator." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(), + alwaysSpace = context.options[0] === "always"; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Checks whitespace between rest/spread operators and their expressions + * @param {ASTNode} node The node to check + * @returns {void} + */ + function checkWhiteSpace(node) { + const operator = sourceCode.getFirstToken(node), + nextToken = sourceCode.getTokenAfter(operator), + hasWhitespace = sourceCode.isSpaceBetweenTokens(operator, nextToken); + let type; + + switch (node.type) { + case "SpreadElement": + type = "spread"; + if (node.parent.type === "ObjectExpression") { + type += " property"; + } + break; + case "RestElement": + type = "rest"; + if (node.parent.type === "ObjectPattern") { + type += " property"; + } + break; + case "ExperimentalSpreadProperty": + type = "spread property"; + break; + case "ExperimentalRestProperty": + type = "rest property"; + break; + default: + return; + } + + if (alwaysSpace && !hasWhitespace) { + context.report({ + node, + loc: operator.loc, + messageId: "expectedWhitespace", + data: { + type + }, + fix(fixer) { + return fixer.replaceTextRange([operator.range[1], nextToken.range[0]], " "); + } + }); + } else if (!alwaysSpace && hasWhitespace) { + context.report({ + node, + loc: { + start: operator.loc.end, + end: nextToken.loc.start + }, + messageId: "unexpectedWhitespace", + data: { + type + }, + fix(fixer) { + return fixer.removeRange([operator.range[1], nextToken.range[0]]); + } + }); + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + SpreadElement: checkWhiteSpace, + RestElement: checkWhiteSpace, + ExperimentalSpreadProperty: checkWhiteSpace, + ExperimentalRestProperty: checkWhiteSpace + }; + } +}; diff --git a/node_modules/eslint/lib/rules/semi-spacing.js b/node_modules/eslint/lib/rules/semi-spacing.js new file mode 100644 index 000000000..5c546f290 --- /dev/null +++ b/node_modules/eslint/lib/rules/semi-spacing.js @@ -0,0 +1,244 @@ +/** + * @fileoverview Validates spacing before and after semicolon + * @author Mathias Schreck + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing before and after semicolons", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/semi-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + before: { + type: "boolean", + default: false + }, + after: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedWhitespaceBefore: "Unexpected whitespace before semicolon.", + unexpectedWhitespaceAfter: "Unexpected whitespace after semicolon.", + missingWhitespaceBefore: "Missing whitespace before semicolon.", + missingWhitespaceAfter: "Missing whitespace after semicolon." + } + }, + + create(context) { + + const config = context.options[0], + sourceCode = context.getSourceCode(); + let requireSpaceBefore = false, + requireSpaceAfter = true; + + if (typeof config === "object") { + requireSpaceBefore = config.before; + requireSpaceAfter = config.after; + } + + /** + * Checks if a given token has leading whitespace. + * @param {Object} token The token to check. + * @returns {boolean} True if the given token has leading space, false if not. + */ + function hasLeadingSpace(token) { + const tokenBefore = sourceCode.getTokenBefore(token); + + return tokenBefore && astUtils.isTokenOnSameLine(tokenBefore, token) && sourceCode.isSpaceBetweenTokens(tokenBefore, token); + } + + /** + * Checks if a given token has trailing whitespace. + * @param {Object} token The token to check. + * @returns {boolean} True if the given token has trailing space, false if not. + */ + function hasTrailingSpace(token) { + const tokenAfter = sourceCode.getTokenAfter(token); + + return tokenAfter && astUtils.isTokenOnSameLine(token, tokenAfter) && sourceCode.isSpaceBetweenTokens(token, tokenAfter); + } + + /** + * Checks if the given token is the last token in its line. + * @param {Token} token The token to check. + * @returns {boolean} Whether or not the token is the last in its line. + */ + function isLastTokenInCurrentLine(token) { + const tokenAfter = sourceCode.getTokenAfter(token); + + return !(tokenAfter && astUtils.isTokenOnSameLine(token, tokenAfter)); + } + + /** + * Checks if the given token is the first token in its line + * @param {Token} token The token to check. + * @returns {boolean} Whether or not the token is the first in its line. + */ + function isFirstTokenInCurrentLine(token) { + const tokenBefore = sourceCode.getTokenBefore(token); + + return !(tokenBefore && astUtils.isTokenOnSameLine(token, tokenBefore)); + } + + /** + * Checks if the next token of a given token is a closing parenthesis. + * @param {Token} token The token to check. + * @returns {boolean} Whether or not the next token of a given token is a closing parenthesis. + */ + function isBeforeClosingParen(token) { + const nextToken = sourceCode.getTokenAfter(token); + + return (nextToken && astUtils.isClosingBraceToken(nextToken) || astUtils.isClosingParenToken(nextToken)); + } + + /** + * Report location example : + * + * for unexpected space `before` + * + * var a = 'b' ; + * ^^^ + * + * for unexpected space `after` + * + * var a = 'b'; c = 10; + * ^^ + * + * Reports if the given token has invalid spacing. + * @param {Token} token The semicolon token to check. + * @param {ASTNode} node The corresponding node of the token. + * @returns {void} + */ + function checkSemicolonSpacing(token, node) { + if (astUtils.isSemicolonToken(token)) { + if (hasLeadingSpace(token)) { + if (!requireSpaceBefore) { + const tokenBefore = sourceCode.getTokenBefore(token); + const loc = { + start: tokenBefore.loc.end, + end: token.loc.start + }; + + context.report({ + node, + loc, + messageId: "unexpectedWhitespaceBefore", + fix(fixer) { + + return fixer.removeRange([tokenBefore.range[1], token.range[0]]); + } + }); + } + } else { + if (requireSpaceBefore) { + const loc = token.loc; + + context.report({ + node, + loc, + messageId: "missingWhitespaceBefore", + fix(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + } + + if (!isFirstTokenInCurrentLine(token) && !isLastTokenInCurrentLine(token) && !isBeforeClosingParen(token)) { + if (hasTrailingSpace(token)) { + if (!requireSpaceAfter) { + const tokenAfter = sourceCode.getTokenAfter(token); + const loc = { + start: token.loc.end, + end: tokenAfter.loc.start + }; + + context.report({ + node, + loc, + messageId: "unexpectedWhitespaceAfter", + fix(fixer) { + + return fixer.removeRange([token.range[1], tokenAfter.range[0]]); + } + }); + } + } else { + if (requireSpaceAfter) { + const loc = token.loc; + + context.report({ + node, + loc, + messageId: "missingWhitespaceAfter", + fix(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + } + } + } + } + + /** + * Checks the spacing of the semicolon with the assumption that the last token is the semicolon. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkNode(node) { + const token = sourceCode.getLastToken(node); + + checkSemicolonSpacing(token, node); + } + + return { + VariableDeclaration: checkNode, + ExpressionStatement: checkNode, + BreakStatement: checkNode, + ContinueStatement: checkNode, + DebuggerStatement: checkNode, + DoWhileStatement: checkNode, + ReturnStatement: checkNode, + ThrowStatement: checkNode, + ImportDeclaration: checkNode, + ExportNamedDeclaration: checkNode, + ExportAllDeclaration: checkNode, + ExportDefaultDeclaration: checkNode, + ForStatement(node) { + if (node.init) { + checkSemicolonSpacing(sourceCode.getTokenAfter(node.init), node); + } + + if (node.test) { + checkSemicolonSpacing(sourceCode.getTokenAfter(node.test), node); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/semi-style.js b/node_modules/eslint/lib/rules/semi-style.js new file mode 100644 index 000000000..0c9bec4c8 --- /dev/null +++ b/node_modules/eslint/lib/rules/semi-style.js @@ -0,0 +1,151 @@ +/** + * @fileoverview Rule to enforce location of semicolons. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const SELECTOR = `:matches(${ + [ + "BreakStatement", "ContinueStatement", "DebuggerStatement", + "DoWhileStatement", "ExportAllDeclaration", + "ExportDefaultDeclaration", "ExportNamedDeclaration", + "ExpressionStatement", "ImportDeclaration", "ReturnStatement", + "ThrowStatement", "VariableDeclaration" + ].join(",") +})`; + +/** + * Get the child node list of a given node. + * This returns `Program#body`, `BlockStatement#body`, or `SwitchCase#consequent`. + * This is used to check whether a node is the first/last child. + * @param {Node} node A node to get child node list. + * @returns {Node[]|null} The child node list. + */ +function getChildren(node) { + const t = node.type; + + if (t === "BlockStatement" || t === "Program") { + return node.body; + } + if (t === "SwitchCase") { + return node.consequent; + } + return null; +} + +/** + * Check whether a given node is the last statement in the parent block. + * @param {Node} node A node to check. + * @returns {boolean} `true` if the node is the last statement in the parent block. + */ +function isLastChild(node) { + const t = node.parent.type; + + if (t === "IfStatement" && node.parent.consequent === node && node.parent.alternate) { // before `else` keyword. + return true; + } + if (t === "DoWhileStatement") { // before `while` keyword. + return true; + } + const nodeList = getChildren(node.parent); + + return nodeList !== null && nodeList[nodeList.length - 1] === node; // before `}` or etc. +} + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce location of semicolons", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/semi-style" + }, + + schema: [{ enum: ["last", "first"] }], + fixable: "whitespace", + + messages: { + expectedSemiColon: "Expected this semicolon to be at {{pos}}." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const option = context.options[0] || "last"; + + /** + * Check the given semicolon token. + * @param {Token} semiToken The semicolon token to check. + * @param {"first"|"last"} expected The expected location to check. + * @returns {void} + */ + function check(semiToken, expected) { + const prevToken = sourceCode.getTokenBefore(semiToken); + const nextToken = sourceCode.getTokenAfter(semiToken); + const prevIsSameLine = !prevToken || astUtils.isTokenOnSameLine(prevToken, semiToken); + const nextIsSameLine = !nextToken || astUtils.isTokenOnSameLine(semiToken, nextToken); + + if ((expected === "last" && !prevIsSameLine) || (expected === "first" && !nextIsSameLine)) { + context.report({ + loc: semiToken.loc, + messageId: "expectedSemiColon", + data: { + pos: (expected === "last") + ? "the end of the previous line" + : "the beginning of the next line" + }, + fix(fixer) { + if (prevToken && nextToken && sourceCode.commentsExistBetween(prevToken, nextToken)) { + return null; + } + + const start = prevToken ? prevToken.range[1] : semiToken.range[0]; + const end = nextToken ? nextToken.range[0] : semiToken.range[1]; + const text = (expected === "last") ? ";\n" : "\n;"; + + return fixer.replaceTextRange([start, end], text); + } + }); + } + } + + return { + [SELECTOR](node) { + if (option === "first" && isLastChild(node)) { + return; + } + + const lastToken = sourceCode.getLastToken(node); + + if (astUtils.isSemicolonToken(lastToken)) { + check(lastToken, option); + } + }, + + ForStatement(node) { + const firstSemi = node.init && sourceCode.getTokenAfter(node.init, astUtils.isSemicolonToken); + const secondSemi = node.test && sourceCode.getTokenAfter(node.test, astUtils.isSemicolonToken); + + if (firstSemi) { + check(firstSemi, "last"); + } + if (secondSemi) { + check(secondSemi, "last"); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/semi.js b/node_modules/eslint/lib/rules/semi.js new file mode 100644 index 000000000..d2f067042 --- /dev/null +++ b/node_modules/eslint/lib/rules/semi.js @@ -0,0 +1,336 @@ +/** + * @fileoverview Rule to flag missing semicolons. + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const FixTracker = require("./utils/fix-tracker"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow semicolons instead of ASI", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/semi" + }, + + fixable: "code", + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["never"] + }, + { + type: "object", + properties: { + beforeStatementContinuationChars: { + enum: ["always", "any", "never"] + } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + }, + { + type: "array", + items: [ + { + enum: ["always"] + }, + { + type: "object", + properties: { + omitLastInOneLineBlock: { type: "boolean" } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + messages: { + missingSemi: "Missing semicolon.", + extraSemi: "Extra semicolon." + } + }, + + create(context) { + + const OPT_OUT_PATTERN = /^[-[(/+`]/u; // One of [(/+-` + const options = context.options[1]; + const never = context.options[0] === "never"; + const exceptOneLine = Boolean(options && options.omitLastInOneLineBlock); + const beforeStatementContinuationChars = options && options.beforeStatementContinuationChars || "any"; + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports a semicolon error with appropriate location and message. + * @param {ASTNode} node The node with an extra or missing semicolon. + * @param {boolean} missing True if the semicolon is missing. + * @returns {void} + */ + function report(node, missing) { + const lastToken = sourceCode.getLastToken(node); + let messageId, + fix, + loc; + + if (!missing) { + messageId = "missingSemi"; + loc = { + start: lastToken.loc.end, + end: astUtils.getNextLocation(sourceCode, lastToken.loc.end) + }; + fix = function(fixer) { + return fixer.insertTextAfter(lastToken, ";"); + }; + } else { + messageId = "extraSemi"; + loc = lastToken.loc; + fix = function(fixer) { + + /* + * Expand the replacement range to include the surrounding + * tokens to avoid conflicting with no-extra-semi. + * https://github.com/eslint/eslint/issues/7928 + */ + return new FixTracker(fixer, sourceCode) + .retainSurroundingTokens(lastToken) + .remove(lastToken); + }; + } + + context.report({ + node, + loc, + messageId, + fix + }); + + } + + /** + * Check whether a given semicolon token is redundant. + * @param {Token} semiToken A semicolon token to check. + * @returns {boolean} `true` if the next token is `;` or `}`. + */ + function isRedundantSemi(semiToken) { + const nextToken = sourceCode.getTokenAfter(semiToken); + + return ( + !nextToken || + astUtils.isClosingBraceToken(nextToken) || + astUtils.isSemicolonToken(nextToken) + ); + } + + /** + * Check whether a given token is the closing brace of an arrow function. + * @param {Token} lastToken A token to check. + * @returns {boolean} `true` if the token is the closing brace of an arrow function. + */ + function isEndOfArrowBlock(lastToken) { + if (!astUtils.isClosingBraceToken(lastToken)) { + return false; + } + const node = sourceCode.getNodeByRangeIndex(lastToken.range[0]); + + return ( + node.type === "BlockStatement" && + node.parent.type === "ArrowFunctionExpression" + ); + } + + /** + * Check whether a given node is on the same line with the next token. + * @param {Node} node A statement node to check. + * @returns {boolean} `true` if the node is on the same line with the next token. + */ + function isOnSameLineWithNextToken(node) { + const prevToken = sourceCode.getLastToken(node, 1); + const nextToken = sourceCode.getTokenAfter(node); + + return !!nextToken && astUtils.isTokenOnSameLine(prevToken, nextToken); + } + + /** + * Check whether a given node can connect the next line if the next line is unreliable. + * @param {Node} node A statement node to check. + * @returns {boolean} `true` if the node can connect the next line. + */ + function maybeAsiHazardAfter(node) { + const t = node.type; + + if (t === "DoWhileStatement" || + t === "BreakStatement" || + t === "ContinueStatement" || + t === "DebuggerStatement" || + t === "ImportDeclaration" || + t === "ExportAllDeclaration" + ) { + return false; + } + if (t === "ReturnStatement") { + return Boolean(node.argument); + } + if (t === "ExportNamedDeclaration") { + return Boolean(node.declaration); + } + if (isEndOfArrowBlock(sourceCode.getLastToken(node, 1))) { + return false; + } + + return true; + } + + /** + * Check whether a given token can connect the previous statement. + * @param {Token} token A token to check. + * @returns {boolean} `true` if the token is one of `[`, `(`, `/`, `+`, `-`, ```, `++`, and `--`. + */ + function maybeAsiHazardBefore(token) { + return ( + Boolean(token) && + OPT_OUT_PATTERN.test(token.value) && + token.value !== "++" && + token.value !== "--" + ); + } + + /** + * Check if the semicolon of a given node is unnecessary, only true if: + * - next token is a valid statement divider (`;` or `}`). + * - next token is on a new line and the node is not connectable to the new line. + * @param {Node} node A statement node to check. + * @returns {boolean} whether the semicolon is unnecessary. + */ + function canRemoveSemicolon(node) { + if (isRedundantSemi(sourceCode.getLastToken(node))) { + return true; // `;;` or `;}` + } + if (isOnSameLineWithNextToken(node)) { + return false; // One liner. + } + if (beforeStatementContinuationChars === "never" && !maybeAsiHazardAfter(node)) { + return true; // ASI works. This statement doesn't connect to the next. + } + if (!maybeAsiHazardBefore(sourceCode.getTokenAfter(node))) { + return true; // ASI works. The next token doesn't connect to this statement. + } + + return false; + } + + /** + * Checks a node to see if it's in a one-liner block statement. + * @param {ASTNode} node The node to check. + * @returns {boolean} whether the node is in a one-liner block statement. + */ + function isOneLinerBlock(node) { + const parent = node.parent; + const nextToken = sourceCode.getTokenAfter(node); + + if (!nextToken || nextToken.value !== "}") { + return false; + } + return ( + !!parent && + parent.type === "BlockStatement" && + parent.loc.start.line === parent.loc.end.line + ); + } + + /** + * Checks a node to see if it's followed by a semicolon. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkForSemicolon(node) { + const isSemi = astUtils.isSemicolonToken(sourceCode.getLastToken(node)); + + if (never) { + if (isSemi && canRemoveSemicolon(node)) { + report(node, true); + } else if (!isSemi && beforeStatementContinuationChars === "always" && maybeAsiHazardBefore(sourceCode.getTokenAfter(node))) { + report(node); + } + } else { + const oneLinerBlock = (exceptOneLine && isOneLinerBlock(node)); + + if (isSemi && oneLinerBlock) { + report(node, true); + } else if (!isSemi && !oneLinerBlock) { + report(node); + } + } + } + + /** + * Checks to see if there's a semicolon after a variable declaration. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkForSemicolonForVariableDeclaration(node) { + const parent = node.parent; + + if ((parent.type !== "ForStatement" || parent.init !== node) && + (!/^For(?:In|Of)Statement/u.test(parent.type) || parent.left !== node) + ) { + checkForSemicolon(node); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + VariableDeclaration: checkForSemicolonForVariableDeclaration, + ExpressionStatement: checkForSemicolon, + ReturnStatement: checkForSemicolon, + ThrowStatement: checkForSemicolon, + DoWhileStatement: checkForSemicolon, + DebuggerStatement: checkForSemicolon, + BreakStatement: checkForSemicolon, + ContinueStatement: checkForSemicolon, + ImportDeclaration: checkForSemicolon, + ExportAllDeclaration: checkForSemicolon, + ExportNamedDeclaration(node) { + if (!node.declaration) { + checkForSemicolon(node); + } + }, + ExportDefaultDeclaration(node) { + if (!/(?:Class|Function)Declaration/u.test(node.declaration.type)) { + checkForSemicolon(node); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/sort-imports.js b/node_modules/eslint/lib/rules/sort-imports.js new file mode 100644 index 000000000..4c3ddec76 --- /dev/null +++ b/node_modules/eslint/lib/rules/sort-imports.js @@ -0,0 +1,241 @@ +/** + * @fileoverview Rule to require sorting of import declarations + * @author Christian Schuller + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce sorted import declarations within modules", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/sort-imports" + }, + + schema: [ + { + type: "object", + properties: { + ignoreCase: { + type: "boolean", + default: false + }, + memberSyntaxSortOrder: { + type: "array", + items: { + enum: ["none", "all", "multiple", "single"] + }, + uniqueItems: true, + minItems: 4, + maxItems: 4 + }, + ignoreDeclarationSort: { + type: "boolean", + default: false + }, + ignoreMemberSort: { + type: "boolean", + default: false + }, + allowSeparatedGroups: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + fixable: "code", + + messages: { + sortImportsAlphabetically: "Imports should be sorted alphabetically.", + sortMembersAlphabetically: "Member '{{memberName}}' of the import declaration should be sorted alphabetically.", + unexpectedSyntaxOrder: "Expected '{{syntaxA}}' syntax before '{{syntaxB}}' syntax." + } + }, + + create(context) { + + const configuration = context.options[0] || {}, + ignoreCase = configuration.ignoreCase || false, + ignoreDeclarationSort = configuration.ignoreDeclarationSort || false, + ignoreMemberSort = configuration.ignoreMemberSort || false, + memberSyntaxSortOrder = configuration.memberSyntaxSortOrder || ["none", "all", "multiple", "single"], + allowSeparatedGroups = configuration.allowSeparatedGroups || false, + sourceCode = context.getSourceCode(); + let previousDeclaration = null; + + /** + * Gets the used member syntax style. + * + * import "my-module.js" --> none + * import * as myModule from "my-module.js" --> all + * import {myMember} from "my-module.js" --> single + * import {foo, bar} from "my-module.js" --> multiple + * @param {ASTNode} node the ImportDeclaration node. + * @returns {string} used member parameter style, ["all", "multiple", "single"] + */ + function usedMemberSyntax(node) { + if (node.specifiers.length === 0) { + return "none"; + } + if (node.specifiers[0].type === "ImportNamespaceSpecifier") { + return "all"; + } + if (node.specifiers.length === 1) { + return "single"; + } + return "multiple"; + + } + + /** + * Gets the group by member parameter index for given declaration. + * @param {ASTNode} node the ImportDeclaration node. + * @returns {number} the declaration group by member index. + */ + function getMemberParameterGroupIndex(node) { + return memberSyntaxSortOrder.indexOf(usedMemberSyntax(node)); + } + + /** + * Gets the local name of the first imported module. + * @param {ASTNode} node the ImportDeclaration node. + * @returns {?string} the local name of the first imported module. + */ + function getFirstLocalMemberName(node) { + if (node.specifiers[0]) { + return node.specifiers[0].local.name; + } + return null; + + } + + /** + * Calculates number of lines between two nodes. It is assumed that the given `left` node appears before + * the given `right` node in the source code. Lines are counted from the end of the `left` node till the + * start of the `right` node. If the given nodes are on the same line, it returns `0`, same as if they were + * on two consecutive lines. + * @param {ASTNode} left node that appears before the given `right` node. + * @param {ASTNode} right node that appears after the given `left` node. + * @returns {number} number of lines between nodes. + */ + function getNumberOfLinesBetween(left, right) { + return Math.max(right.loc.start.line - left.loc.end.line - 1, 0); + } + + return { + ImportDeclaration(node) { + if (!ignoreDeclarationSort) { + if ( + previousDeclaration && + allowSeparatedGroups && + getNumberOfLinesBetween(previousDeclaration, node) > 0 + ) { + + // reset declaration sort + previousDeclaration = null; + } + + if (previousDeclaration) { + const currentMemberSyntaxGroupIndex = getMemberParameterGroupIndex(node), + previousMemberSyntaxGroupIndex = getMemberParameterGroupIndex(previousDeclaration); + let currentLocalMemberName = getFirstLocalMemberName(node), + previousLocalMemberName = getFirstLocalMemberName(previousDeclaration); + + if (ignoreCase) { + previousLocalMemberName = previousLocalMemberName && previousLocalMemberName.toLowerCase(); + currentLocalMemberName = currentLocalMemberName && currentLocalMemberName.toLowerCase(); + } + + /* + * When the current declaration uses a different member syntax, + * then check if the ordering is correct. + * Otherwise, make a default string compare (like rule sort-vars to be consistent) of the first used local member name. + */ + if (currentMemberSyntaxGroupIndex !== previousMemberSyntaxGroupIndex) { + if (currentMemberSyntaxGroupIndex < previousMemberSyntaxGroupIndex) { + context.report({ + node, + messageId: "unexpectedSyntaxOrder", + data: { + syntaxA: memberSyntaxSortOrder[currentMemberSyntaxGroupIndex], + syntaxB: memberSyntaxSortOrder[previousMemberSyntaxGroupIndex] + } + }); + } + } else { + if (previousLocalMemberName && + currentLocalMemberName && + currentLocalMemberName < previousLocalMemberName + ) { + context.report({ + node, + messageId: "sortImportsAlphabetically" + }); + } + } + } + + previousDeclaration = node; + } + + if (!ignoreMemberSort) { + const importSpecifiers = node.specifiers.filter(specifier => specifier.type === "ImportSpecifier"); + const getSortableName = ignoreCase ? specifier => specifier.local.name.toLowerCase() : specifier => specifier.local.name; + const firstUnsortedIndex = importSpecifiers.map(getSortableName).findIndex((name, index, array) => array[index - 1] > name); + + if (firstUnsortedIndex !== -1) { + context.report({ + node: importSpecifiers[firstUnsortedIndex], + messageId: "sortMembersAlphabetically", + data: { memberName: importSpecifiers[firstUnsortedIndex].local.name }, + fix(fixer) { + if (importSpecifiers.some(specifier => + sourceCode.getCommentsBefore(specifier).length || sourceCode.getCommentsAfter(specifier).length)) { + + // If there are comments in the ImportSpecifier list, don't rearrange the specifiers. + return null; + } + + return fixer.replaceTextRange( + [importSpecifiers[0].range[0], importSpecifiers[importSpecifiers.length - 1].range[1]], + importSpecifiers + + // Clone the importSpecifiers array to avoid mutating it + .slice() + + // Sort the array into the desired order + .sort((specifierA, specifierB) => { + const aName = getSortableName(specifierA); + const bName = getSortableName(specifierB); + + return aName > bName ? 1 : -1; + }) + + // Build a string out of the sorted list of import specifiers and the text between the originals + .reduce((sourceText, specifier, index) => { + const textAfterSpecifier = index === importSpecifiers.length - 1 + ? "" + : sourceCode.getText().slice(importSpecifiers[index].range[1], importSpecifiers[index + 1].range[0]); + + return sourceText + sourceCode.getText(specifier) + textAfterSpecifier; + }, "") + ); + } + }); + } + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/sort-keys.js b/node_modules/eslint/lib/rules/sort-keys.js new file mode 100644 index 000000000..8a95ee25d --- /dev/null +++ b/node_modules/eslint/lib/rules/sort-keys.js @@ -0,0 +1,187 @@ +/** + * @fileoverview Rule to require object keys to be sorted + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"), + naturalCompare = require("natural-compare"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets the property name of the given `Property` node. + * + * - If the property's key is an `Identifier` node, this returns the key's name + * whether it's a computed property or not. + * - If the property has a static name, this returns the static name. + * - Otherwise, this returns null. + * @param {ASTNode} node The `Property` node to get. + * @returns {string|null} The property name or null. + * @private + */ +function getPropertyName(node) { + const staticName = astUtils.getStaticPropertyName(node); + + if (staticName !== null) { + return staticName; + } + + return node.key.name || null; +} + +/** + * Functions which check that the given 2 names are in specific order. + * + * Postfix `I` is meant insensitive. + * Postfix `N` is meant natural. + * @private + */ +const isValidOrders = { + asc(a, b) { + return a <= b; + }, + ascI(a, b) { + return a.toLowerCase() <= b.toLowerCase(); + }, + ascN(a, b) { + return naturalCompare(a, b) <= 0; + }, + ascIN(a, b) { + return naturalCompare(a.toLowerCase(), b.toLowerCase()) <= 0; + }, + desc(a, b) { + return isValidOrders.asc(b, a); + }, + descI(a, b) { + return isValidOrders.ascI(b, a); + }, + descN(a, b) { + return isValidOrders.ascN(b, a); + }, + descIN(a, b) { + return isValidOrders.ascIN(b, a); + } +}; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require object keys to be sorted", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/sort-keys" + }, + + schema: [ + { + enum: ["asc", "desc"] + }, + { + type: "object", + properties: { + caseSensitive: { + type: "boolean", + default: true + }, + natural: { + type: "boolean", + default: false + }, + minKeys: { + type: "integer", + minimum: 2, + default: 2 + } + }, + additionalProperties: false + } + ], + + messages: { + sortKeys: "Expected object keys to be in {{natural}}{{insensitive}}{{order}}ending order. '{{thisName}}' should be before '{{prevName}}'." + } + }, + + create(context) { + + // Parse options. + const order = context.options[0] || "asc"; + const options = context.options[1]; + const insensitive = options && options.caseSensitive === false; + const natural = options && options.natural; + const minKeys = options && options.minKeys; + const isValidOrder = isValidOrders[ + order + (insensitive ? "I" : "") + (natural ? "N" : "") + ]; + + // The stack to save the previous property's name for each object literals. + let stack = null; + + return { + ObjectExpression(node) { + stack = { + upper: stack, + prevName: null, + numKeys: node.properties.length + }; + }, + + "ObjectExpression:exit"() { + stack = stack.upper; + }, + + SpreadElement(node) { + if (node.parent.type === "ObjectExpression") { + stack.prevName = null; + } + }, + + Property(node) { + if (node.parent.type === "ObjectPattern") { + return; + } + + const prevName = stack.prevName; + const numKeys = stack.numKeys; + const thisName = getPropertyName(node); + + if (thisName !== null) { + stack.prevName = thisName; + } + + if (prevName === null || thisName === null || numKeys < minKeys) { + return; + } + + if (!isValidOrder(prevName, thisName)) { + context.report({ + node, + loc: node.key.loc, + messageId: "sortKeys", + data: { + thisName, + prevName, + order, + insensitive: insensitive ? "insensitive " : "", + natural: natural ? "natural " : "" + } + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/sort-vars.js b/node_modules/eslint/lib/rules/sort-vars.js new file mode 100644 index 000000000..7add2cf74 --- /dev/null +++ b/node_modules/eslint/lib/rules/sort-vars.js @@ -0,0 +1,104 @@ +/** + * @fileoverview Rule to require sorting of variables within a single Variable Declaration block + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require variables within the same declaration block to be sorted", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/sort-vars" + }, + + schema: [ + { + type: "object", + properties: { + ignoreCase: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + fixable: "code", + + messages: { + sortVars: "Variables within the same declaration block should be sorted alphabetically." + } + }, + + create(context) { + + const configuration = context.options[0] || {}, + ignoreCase = configuration.ignoreCase || false, + sourceCode = context.getSourceCode(); + + return { + VariableDeclaration(node) { + const idDeclarations = node.declarations.filter(decl => decl.id.type === "Identifier"); + const getSortableName = ignoreCase ? decl => decl.id.name.toLowerCase() : decl => decl.id.name; + const unfixable = idDeclarations.some(decl => decl.init !== null && decl.init.type !== "Literal"); + let fixed = false; + + idDeclarations.slice(1).reduce((memo, decl) => { + const lastVariableName = getSortableName(memo), + currentVariableName = getSortableName(decl); + + if (currentVariableName < lastVariableName) { + context.report({ + node: decl, + messageId: "sortVars", + fix(fixer) { + if (unfixable || fixed) { + return null; + } + return fixer.replaceTextRange( + [idDeclarations[0].range[0], idDeclarations[idDeclarations.length - 1].range[1]], + idDeclarations + + // Clone the idDeclarations array to avoid mutating it + .slice() + + // Sort the array into the desired order + .sort((declA, declB) => { + const aName = getSortableName(declA); + const bName = getSortableName(declB); + + return aName > bName ? 1 : -1; + }) + + // Build a string out of the sorted list of identifier declarations and the text between the originals + .reduce((sourceText, identifier, index) => { + const textAfterIdentifier = index === idDeclarations.length - 1 + ? "" + : sourceCode.getText().slice(idDeclarations[index].range[1], idDeclarations[index + 1].range[0]); + + return sourceText + sourceCode.getText(identifier) + textAfterIdentifier; + }, "") + + ); + } + }); + fixed = true; + return memo; + } + return decl; + + }, idDeclarations[0]); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/space-before-blocks.js b/node_modules/eslint/lib/rules/space-before-blocks.js new file mode 100644 index 000000000..9b56481bf --- /dev/null +++ b/node_modules/eslint/lib/rules/space-before-blocks.js @@ -0,0 +1,164 @@ +/** + * @fileoverview A rule to ensure whitespace before blocks. + * @author Mathias Schreck + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing before blocks", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/space-before-blocks" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + keywords: { + enum: ["always", "never", "off"] + }, + functions: { + enum: ["always", "never", "off"] + }, + classes: { + enum: ["always", "never", "off"] + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + unexpectedSpace: "Unexpected space before opening brace.", + missingSpace: "Missing space before opening brace." + } + }, + + create(context) { + const config = context.options[0], + sourceCode = context.getSourceCode(); + let alwaysFunctions = true, + alwaysKeywords = true, + alwaysClasses = true, + neverFunctions = false, + neverKeywords = false, + neverClasses = false; + + if (typeof config === "object") { + alwaysFunctions = config.functions === "always"; + alwaysKeywords = config.keywords === "always"; + alwaysClasses = config.classes === "always"; + neverFunctions = config.functions === "never"; + neverKeywords = config.keywords === "never"; + neverClasses = config.classes === "never"; + } else if (config === "never") { + alwaysFunctions = false; + alwaysKeywords = false; + alwaysClasses = false; + neverFunctions = true; + neverKeywords = true; + neverClasses = true; + } + + /** + * Checks whether or not a given token is an arrow operator (=>) or a keyword + * in order to avoid to conflict with `arrow-spacing` and `keyword-spacing`. + * @param {Token} token A token to check. + * @returns {boolean} `true` if the token is an arrow operator. + */ + function isConflicted(token) { + return (token.type === "Punctuator" && token.value === "=>") || token.type === "Keyword"; + } + + /** + * Checks the given BlockStatement node has a preceding space if it doesn’t start on a new line. + * @param {ASTNode|Token} node The AST node of a BlockStatement. + * @returns {void} undefined. + */ + function checkPrecedingSpace(node) { + const precedingToken = sourceCode.getTokenBefore(node); + + if (precedingToken && !isConflicted(precedingToken) && astUtils.isTokenOnSameLine(precedingToken, node)) { + const hasSpace = sourceCode.isSpaceBetweenTokens(precedingToken, node); + const parent = context.getAncestors().pop(); + let requireSpace; + let requireNoSpace; + + if (parent.type === "FunctionExpression" || parent.type === "FunctionDeclaration") { + requireSpace = alwaysFunctions; + requireNoSpace = neverFunctions; + } else if (node.type === "ClassBody") { + requireSpace = alwaysClasses; + requireNoSpace = neverClasses; + } else { + requireSpace = alwaysKeywords; + requireNoSpace = neverKeywords; + } + + if (requireSpace && !hasSpace) { + context.report({ + node, + messageId: "missingSpace", + fix(fixer) { + return fixer.insertTextBefore(node, " "); + } + }); + } else if (requireNoSpace && hasSpace) { + context.report({ + node, + messageId: "unexpectedSpace", + fix(fixer) { + return fixer.removeRange([precedingToken.range[1], node.range[0]]); + } + }); + } + } + } + + /** + * Checks if the CaseBlock of an given SwitchStatement node has a preceding space. + * @param {ASTNode} node The node of a SwitchStatement. + * @returns {void} undefined. + */ + function checkSpaceBeforeCaseBlock(node) { + const cases = node.cases; + let openingBrace; + + if (cases.length > 0) { + openingBrace = sourceCode.getTokenBefore(cases[0]); + } else { + openingBrace = sourceCode.getLastToken(node, 1); + } + + checkPrecedingSpace(openingBrace); + } + + return { + BlockStatement: checkPrecedingSpace, + ClassBody: checkPrecedingSpace, + SwitchStatement: checkSpaceBeforeCaseBlock + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/space-before-function-paren.js b/node_modules/eslint/lib/rules/space-before-function-paren.js new file mode 100644 index 000000000..1021a110c --- /dev/null +++ b/node_modules/eslint/lib/rules/space-before-function-paren.js @@ -0,0 +1,164 @@ +/** + * @fileoverview Rule to validate spacing before function paren. + * @author Mathias Schreck + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing before `function` definition opening parenthesis", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/space-before-function-paren" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + anonymous: { + enum: ["always", "never", "ignore"] + }, + named: { + enum: ["always", "never", "ignore"] + }, + asyncArrow: { + enum: ["always", "never", "ignore"] + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + unexpectedSpace: "Unexpected space before function parentheses.", + missingSpace: "Missing space before function parentheses." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const baseConfig = typeof context.options[0] === "string" ? context.options[0] : "always"; + const overrideConfig = typeof context.options[0] === "object" ? context.options[0] : {}; + + /** + * Determines whether a function has a name. + * @param {ASTNode} node The function node. + * @returns {boolean} Whether the function has a name. + */ + function isNamedFunction(node) { + if (node.id) { + return true; + } + + const parent = node.parent; + + return parent.type === "MethodDefinition" || + (parent.type === "Property" && + ( + parent.kind === "get" || + parent.kind === "set" || + parent.method + ) + ); + } + + /** + * Gets the config for a given function + * @param {ASTNode} node The function node + * @returns {string} "always", "never", or "ignore" + */ + function getConfigForFunction(node) { + if (node.type === "ArrowFunctionExpression") { + + // Always ignore non-async functions and arrow functions without parens, e.g. async foo => bar + if (node.async && astUtils.isOpeningParenToken(sourceCode.getFirstToken(node, { skip: 1 }))) { + return overrideConfig.asyncArrow || baseConfig; + } + } else if (isNamedFunction(node)) { + return overrideConfig.named || baseConfig; + + // `generator-star-spacing` should warn anonymous generators. E.g. `function* () {}` + } else if (!node.generator) { + return overrideConfig.anonymous || baseConfig; + } + + return "ignore"; + } + + /** + * Checks the parens of a function node + * @param {ASTNode} node A function node + * @returns {void} + */ + function checkFunction(node) { + const functionConfig = getConfigForFunction(node); + + if (functionConfig === "ignore") { + return; + } + + const rightToken = sourceCode.getFirstToken(node, astUtils.isOpeningParenToken); + const leftToken = sourceCode.getTokenBefore(rightToken); + const hasSpacing = sourceCode.isSpaceBetweenTokens(leftToken, rightToken); + + if (hasSpacing && functionConfig === "never") { + context.report({ + node, + loc: { + start: leftToken.loc.end, + end: rightToken.loc.start + }, + messageId: "unexpectedSpace", + fix(fixer) { + const comments = sourceCode.getCommentsBefore(rightToken); + + // Don't fix anything if there's a single line comment between the left and the right token + if (comments.some(comment => comment.type === "Line")) { + return null; + } + return fixer.replaceTextRange( + [leftToken.range[1], rightToken.range[0]], + comments.reduce((text, comment) => text + sourceCode.getText(comment), "") + ); + } + }); + } else if (!hasSpacing && functionConfig === "always") { + context.report({ + node, + loc: rightToken.loc, + messageId: "missingSpace", + fix: fixer => fixer.insertTextAfter(leftToken, " ") + }); + } + } + + return { + ArrowFunctionExpression: checkFunction, + FunctionDeclaration: checkFunction, + FunctionExpression: checkFunction + }; + } +}; diff --git a/node_modules/eslint/lib/rules/space-in-parens.js b/node_modules/eslint/lib/rules/space-in-parens.js new file mode 100644 index 000000000..b0a604d95 --- /dev/null +++ b/node_modules/eslint/lib/rules/space-in-parens.js @@ -0,0 +1,282 @@ +/** + * @fileoverview Disallows or enforces spaces inside of parentheses. + * @author Jonathan Rajavuori + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing inside parentheses", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/space-in-parens" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + exceptions: { + type: "array", + items: { + enum: ["{}", "[]", "()", "empty"] + }, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + missingOpeningSpace: "There must be a space after this paren.", + missingClosingSpace: "There must be a space before this paren.", + rejectedOpeningSpace: "There should be no space after this paren.", + rejectedClosingSpace: "There should be no space before this paren." + } + }, + + create(context) { + const ALWAYS = context.options[0] === "always", + exceptionsArrayOptions = (context.options[1] && context.options[1].exceptions) || [], + options = {}; + + let exceptions; + + if (exceptionsArrayOptions.length) { + options.braceException = exceptionsArrayOptions.includes("{}"); + options.bracketException = exceptionsArrayOptions.includes("[]"); + options.parenException = exceptionsArrayOptions.includes("()"); + options.empty = exceptionsArrayOptions.includes("empty"); + } + + /** + * Produces an object with the opener and closer exception values + * @returns {Object} `openers` and `closers` exception values + * @private + */ + function getExceptions() { + const openers = [], + closers = []; + + if (options.braceException) { + openers.push("{"); + closers.push("}"); + } + + if (options.bracketException) { + openers.push("["); + closers.push("]"); + } + + if (options.parenException) { + openers.push("("); + closers.push(")"); + } + + if (options.empty) { + openers.push(")"); + closers.push("("); + } + + return { + openers, + closers + }; + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + const sourceCode = context.getSourceCode(); + + /** + * Determines if a token is one of the exceptions for the opener paren + * @param {Object} token The token to check + * @returns {boolean} True if the token is one of the exceptions for the opener paren + */ + function isOpenerException(token) { + return exceptions.openers.includes(token.value); + } + + /** + * Determines if a token is one of the exceptions for the closer paren + * @param {Object} token The token to check + * @returns {boolean} True if the token is one of the exceptions for the closer paren + */ + function isCloserException(token) { + return exceptions.closers.includes(token.value); + } + + /** + * Determines if an opening paren is immediately followed by a required space + * @param {Object} openingParenToken The paren token + * @param {Object} tokenAfterOpeningParen The token after it + * @returns {boolean} True if the opening paren is missing a required space + */ + function openerMissingSpace(openingParenToken, tokenAfterOpeningParen) { + if (sourceCode.isSpaceBetweenTokens(openingParenToken, tokenAfterOpeningParen)) { + return false; + } + + if (!options.empty && astUtils.isClosingParenToken(tokenAfterOpeningParen)) { + return false; + } + + if (ALWAYS) { + return !isOpenerException(tokenAfterOpeningParen); + } + return isOpenerException(tokenAfterOpeningParen); + } + + /** + * Determines if an opening paren is immediately followed by a disallowed space + * @param {Object} openingParenToken The paren token + * @param {Object} tokenAfterOpeningParen The token after it + * @returns {boolean} True if the opening paren has a disallowed space + */ + function openerRejectsSpace(openingParenToken, tokenAfterOpeningParen) { + if (!astUtils.isTokenOnSameLine(openingParenToken, tokenAfterOpeningParen)) { + return false; + } + + if (tokenAfterOpeningParen.type === "Line") { + return false; + } + + if (!sourceCode.isSpaceBetweenTokens(openingParenToken, tokenAfterOpeningParen)) { + return false; + } + + if (ALWAYS) { + return isOpenerException(tokenAfterOpeningParen); + } + return !isOpenerException(tokenAfterOpeningParen); + } + + /** + * Determines if a closing paren is immediately preceded by a required space + * @param {Object} tokenBeforeClosingParen The token before the paren + * @param {Object} closingParenToken The paren token + * @returns {boolean} True if the closing paren is missing a required space + */ + function closerMissingSpace(tokenBeforeClosingParen, closingParenToken) { + if (sourceCode.isSpaceBetweenTokens(tokenBeforeClosingParen, closingParenToken)) { + return false; + } + + if (!options.empty && astUtils.isOpeningParenToken(tokenBeforeClosingParen)) { + return false; + } + + if (ALWAYS) { + return !isCloserException(tokenBeforeClosingParen); + } + return isCloserException(tokenBeforeClosingParen); + } + + /** + * Determines if a closer paren is immediately preceded by a disallowed space + * @param {Object} tokenBeforeClosingParen The token before the paren + * @param {Object} closingParenToken The paren token + * @returns {boolean} True if the closing paren has a disallowed space + */ + function closerRejectsSpace(tokenBeforeClosingParen, closingParenToken) { + if (!astUtils.isTokenOnSameLine(tokenBeforeClosingParen, closingParenToken)) { + return false; + } + + if (!sourceCode.isSpaceBetweenTokens(tokenBeforeClosingParen, closingParenToken)) { + return false; + } + + if (ALWAYS) { + return isCloserException(tokenBeforeClosingParen); + } + return !isCloserException(tokenBeforeClosingParen); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program: function checkParenSpaces(node) { + exceptions = getExceptions(); + const tokens = sourceCode.tokensAndComments; + + tokens.forEach((token, i) => { + const prevToken = tokens[i - 1]; + const nextToken = tokens[i + 1]; + + // if token is not an opening or closing paren token, do nothing + if (!astUtils.isOpeningParenToken(token) && !astUtils.isClosingParenToken(token)) { + return; + } + + // if token is an opening paren and is not followed by a required space + if (token.value === "(" && openerMissingSpace(token, nextToken)) { + context.report({ + node, + loc: token.loc, + messageId: "missingOpeningSpace", + fix(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + + // if token is an opening paren and is followed by a disallowed space + if (token.value === "(" && openerRejectsSpace(token, nextToken)) { + context.report({ + node, + loc: { start: token.loc.end, end: nextToken.loc.start }, + messageId: "rejectedOpeningSpace", + fix(fixer) { + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); + } + + // if token is a closing paren and is not preceded by a required space + if (token.value === ")" && closerMissingSpace(prevToken, token)) { + context.report({ + node, + loc: token.loc, + messageId: "missingClosingSpace", + fix(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + + // if token is a closing paren and is preceded by a disallowed space + if (token.value === ")" && closerRejectsSpace(prevToken, token)) { + context.report({ + node, + loc: { start: prevToken.loc.end, end: token.loc.start }, + messageId: "rejectedClosingSpace", + fix(fixer) { + return fixer.removeRange([prevToken.range[1], token.range[0]]); + } + }); + } + }); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/space-infix-ops.js b/node_modules/eslint/lib/rules/space-infix-ops.js new file mode 100644 index 000000000..471c22210 --- /dev/null +++ b/node_modules/eslint/lib/rules/space-infix-ops.js @@ -0,0 +1,169 @@ +/** + * @fileoverview Require spaces around infix operators + * @author Michael Ficarra + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require spacing around infix operators", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/space-infix-ops" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + int32Hint: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + missingSpace: "Operator '{{operator}}' must be spaced." + } + }, + + create(context) { + const int32Hint = context.options[0] ? context.options[0].int32Hint === true : false; + const sourceCode = context.getSourceCode(); + + /** + * Returns the first token which violates the rule + * @param {ASTNode} left The left node of the main node + * @param {ASTNode} right The right node of the main node + * @param {string} op The operator of the main node + * @returns {Object} The violator token or null + * @private + */ + function getFirstNonSpacedToken(left, right, op) { + const operator = sourceCode.getFirstTokenBetween(left, right, token => token.value === op); + const prev = sourceCode.getTokenBefore(operator); + const next = sourceCode.getTokenAfter(operator); + + if (!sourceCode.isSpaceBetweenTokens(prev, operator) || !sourceCode.isSpaceBetweenTokens(operator, next)) { + return operator; + } + + return null; + } + + /** + * Reports an AST node as a rule violation + * @param {ASTNode} mainNode The node to report + * @param {Object} culpritToken The token which has a problem + * @returns {void} + * @private + */ + function report(mainNode, culpritToken) { + context.report({ + node: mainNode, + loc: culpritToken.loc, + messageId: "missingSpace", + data: { + operator: culpritToken.value + }, + fix(fixer) { + const previousToken = sourceCode.getTokenBefore(culpritToken); + const afterToken = sourceCode.getTokenAfter(culpritToken); + let fixString = ""; + + if (culpritToken.range[0] - previousToken.range[1] === 0) { + fixString = " "; + } + + fixString += culpritToken.value; + + if (afterToken.range[0] - culpritToken.range[1] === 0) { + fixString += " "; + } + + return fixer.replaceText(culpritToken, fixString); + } + }); + } + + /** + * Check if the node is binary then report + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkBinary(node) { + const leftNode = (node.left.typeAnnotation) ? node.left.typeAnnotation : node.left; + const rightNode = node.right; + + // search for = in AssignmentPattern nodes + const operator = node.operator || "="; + + const nonSpacedNode = getFirstNonSpacedToken(leftNode, rightNode, operator); + + if (nonSpacedNode) { + if (!(int32Hint && sourceCode.getText(node).endsWith("|0"))) { + report(node, nonSpacedNode); + } + } + } + + /** + * Check if the node is conditional + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkConditional(node) { + const nonSpacedConsequentNode = getFirstNonSpacedToken(node.test, node.consequent, "?"); + const nonSpacedAlternateNode = getFirstNonSpacedToken(node.consequent, node.alternate, ":"); + + if (nonSpacedConsequentNode) { + report(node, nonSpacedConsequentNode); + } else if (nonSpacedAlternateNode) { + report(node, nonSpacedAlternateNode); + } + } + + /** + * Check if the node is a variable + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkVar(node) { + const leftNode = (node.id.typeAnnotation) ? node.id.typeAnnotation : node.id; + const rightNode = node.init; + + if (rightNode) { + const nonSpacedNode = getFirstNonSpacedToken(leftNode, rightNode, "="); + + if (nonSpacedNode) { + report(node, nonSpacedNode); + } + } + } + + return { + AssignmentExpression: checkBinary, + AssignmentPattern: checkBinary, + BinaryExpression: checkBinary, + LogicalExpression: checkBinary, + ConditionalExpression: checkConditional, + VariableDeclarator: checkVar + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/space-unary-ops.js b/node_modules/eslint/lib/rules/space-unary-ops.js new file mode 100644 index 000000000..f417eea58 --- /dev/null +++ b/node_modules/eslint/lib/rules/space-unary-ops.js @@ -0,0 +1,321 @@ +/** + * @fileoverview This rule shoud require or disallow spaces before or after unary operations. + * @author Marcin Kumorek + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing before or after unary operators", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/space-unary-ops" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + words: { + type: "boolean", + default: true + }, + nonwords: { + type: "boolean", + default: false + }, + overrides: { + type: "object", + additionalProperties: { + type: "boolean" + } + } + }, + additionalProperties: false + } + ], + messages: { + unexpectedBefore: "Unexpected space before unary operator '{{operator}}'.", + unexpectedAfter: "Unexpected space after unary operator '{{operator}}'.", + unexpectedAfterWord: "Unexpected space after unary word operator '{{word}}'.", + wordOperator: "Unary word operator '{{word}}' must be followed by whitespace.", + operator: "Unary operator '{{operator}}' must be followed by whitespace.", + beforeUnaryExpressions: "Space is required before unary expressions '{{token}}'." + } + }, + + create(context) { + const options = context.options[0] || { words: true, nonwords: false }; + + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Check if the node is the first "!" in a "!!" convert to Boolean expression + * @param {ASTnode} node AST node + * @returns {boolean} Whether or not the node is first "!" in "!!" + */ + function isFirstBangInBangBangExpression(node) { + return node && node.type === "UnaryExpression" && node.argument.operator === "!" && + node.argument && node.argument.type === "UnaryExpression" && node.argument.operator === "!"; + } + + /** + * Checks if an override exists for a given operator. + * @param {string} operator Operator + * @returns {boolean} Whether or not an override has been provided for the operator + */ + function overrideExistsForOperator(operator) { + return options.overrides && Object.prototype.hasOwnProperty.call(options.overrides, operator); + } + + /** + * Gets the value that the override was set to for this operator + * @param {string} operator Operator + * @returns {boolean} Whether or not an override enforces a space with this operator + */ + function overrideEnforcesSpaces(operator) { + return options.overrides[operator]; + } + + /** + * Verify Unary Word Operator has spaces after the word operator + * @param {ASTnode} node AST node + * @param {Object} firstToken first token from the AST node + * @param {Object} secondToken second token from the AST node + * @param {string} word The word to be used for reporting + * @returns {void} + */ + function verifyWordHasSpaces(node, firstToken, secondToken, word) { + if (secondToken.range[0] === firstToken.range[1]) { + context.report({ + node, + messageId: "wordOperator", + data: { + word + }, + fix(fixer) { + return fixer.insertTextAfter(firstToken, " "); + } + }); + } + } + + /** + * Verify Unary Word Operator doesn't have spaces after the word operator + * @param {ASTnode} node AST node + * @param {Object} firstToken first token from the AST node + * @param {Object} secondToken second token from the AST node + * @param {string} word The word to be used for reporting + * @returns {void} + */ + function verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word) { + if (astUtils.canTokensBeAdjacent(firstToken, secondToken)) { + if (secondToken.range[0] > firstToken.range[1]) { + context.report({ + node, + messageId: "unexpectedAfterWord", + data: { + word + }, + fix(fixer) { + return fixer.removeRange([firstToken.range[1], secondToken.range[0]]); + } + }); + } + } + } + + /** + * Check Unary Word Operators for spaces after the word operator + * @param {ASTnode} node AST node + * @param {Object} firstToken first token from the AST node + * @param {Object} secondToken second token from the AST node + * @param {string} word The word to be used for reporting + * @returns {void} + */ + function checkUnaryWordOperatorForSpaces(node, firstToken, secondToken, word) { + if (overrideExistsForOperator(word)) { + if (overrideEnforcesSpaces(word)) { + verifyWordHasSpaces(node, firstToken, secondToken, word); + } else { + verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word); + } + } else if (options.words) { + verifyWordHasSpaces(node, firstToken, secondToken, word); + } else { + verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word); + } + } + + /** + * Verifies YieldExpressions satisfy spacing requirements + * @param {ASTnode} node AST node + * @returns {void} + */ + function checkForSpacesAfterYield(node) { + const tokens = sourceCode.getFirstTokens(node, 3), + word = "yield"; + + if (!node.argument || node.delegate) { + return; + } + + checkUnaryWordOperatorForSpaces(node, tokens[0], tokens[1], word); + } + + /** + * Verifies AwaitExpressions satisfy spacing requirements + * @param {ASTNode} node AwaitExpression AST node + * @returns {void} + */ + function checkForSpacesAfterAwait(node) { + const tokens = sourceCode.getFirstTokens(node, 3); + + checkUnaryWordOperatorForSpaces(node, tokens[0], tokens[1], "await"); + } + + /** + * Verifies UnaryExpression, UpdateExpression and NewExpression have spaces before or after the operator + * @param {ASTnode} node AST node + * @param {Object} firstToken First token in the expression + * @param {Object} secondToken Second token in the expression + * @returns {void} + */ + function verifyNonWordsHaveSpaces(node, firstToken, secondToken) { + if (node.prefix) { + if (isFirstBangInBangBangExpression(node)) { + return; + } + if (firstToken.range[1] === secondToken.range[0]) { + context.report({ + node, + messageId: "operator", + data: { + operator: firstToken.value + }, + fix(fixer) { + return fixer.insertTextAfter(firstToken, " "); + } + }); + } + } else { + if (firstToken.range[1] === secondToken.range[0]) { + context.report({ + node, + messageId: "beforeUnaryExpressions", + data: { + token: secondToken.value + }, + fix(fixer) { + return fixer.insertTextBefore(secondToken, " "); + } + }); + } + } + } + + /** + * Verifies UnaryExpression, UpdateExpression and NewExpression don't have spaces before or after the operator + * @param {ASTnode} node AST node + * @param {Object} firstToken First token in the expression + * @param {Object} secondToken Second token in the expression + * @returns {void} + */ + function verifyNonWordsDontHaveSpaces(node, firstToken, secondToken) { + if (node.prefix) { + if (secondToken.range[0] > firstToken.range[1]) { + context.report({ + node, + messageId: "unexpectedAfter", + data: { + operator: firstToken.value + }, + fix(fixer) { + if (astUtils.canTokensBeAdjacent(firstToken, secondToken)) { + return fixer.removeRange([firstToken.range[1], secondToken.range[0]]); + } + return null; + } + }); + } + } else { + if (secondToken.range[0] > firstToken.range[1]) { + context.report({ + node, + messageId: "unexpectedBefore", + data: { + operator: secondToken.value + }, + fix(fixer) { + return fixer.removeRange([firstToken.range[1], secondToken.range[0]]); + } + }); + } + } + } + + /** + * Verifies UnaryExpression, UpdateExpression and NewExpression satisfy spacing requirements + * @param {ASTnode} node AST node + * @returns {void} + */ + function checkForSpaces(node) { + const tokens = node.type === "UpdateExpression" && !node.prefix + ? sourceCode.getLastTokens(node, 2) + : sourceCode.getFirstTokens(node, 2); + const firstToken = tokens[0]; + const secondToken = tokens[1]; + + if ((node.type === "NewExpression" || node.prefix) && firstToken.type === "Keyword") { + checkUnaryWordOperatorForSpaces(node, firstToken, secondToken, firstToken.value); + return; + } + + const operator = node.prefix ? tokens[0].value : tokens[1].value; + + if (overrideExistsForOperator(operator)) { + if (overrideEnforcesSpaces(operator)) { + verifyNonWordsHaveSpaces(node, firstToken, secondToken); + } else { + verifyNonWordsDontHaveSpaces(node, firstToken, secondToken); + } + } else if (options.nonwords) { + verifyNonWordsHaveSpaces(node, firstToken, secondToken); + } else { + verifyNonWordsDontHaveSpaces(node, firstToken, secondToken); + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + UnaryExpression: checkForSpaces, + UpdateExpression: checkForSpaces, + NewExpression: checkForSpaces, + YieldExpression: checkForSpacesAfterYield, + AwaitExpression: checkForSpacesAfterAwait + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/spaced-comment.js b/node_modules/eslint/lib/rules/spaced-comment.js new file mode 100644 index 000000000..d3221f0ea --- /dev/null +++ b/node_modules/eslint/lib/rules/spaced-comment.js @@ -0,0 +1,382 @@ +/** + * @fileoverview Source code for spaced-comments rule + * @author Gyandeep Singh + */ +"use strict"; + +const lodash = require("lodash"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Escapes the control characters of a given string. + * @param {string} s A string to escape. + * @returns {string} An escaped string. + */ +function escape(s) { + return `(?:${lodash.escapeRegExp(s)})`; +} + +/** + * Escapes the control characters of a given string. + * And adds a repeat flag. + * @param {string} s A string to escape. + * @returns {string} An escaped string. + */ +function escapeAndRepeat(s) { + return `${escape(s)}+`; +} + +/** + * Parses `markers` option. + * If markers don't include `"*"`, this adds `"*"` to allow JSDoc comments. + * @param {string[]} [markers] A marker list. + * @returns {string[]} A marker list. + */ +function parseMarkersOption(markers) { + + // `*` is a marker for JSDoc comments. + if (markers.indexOf("*") === -1) { + return markers.concat("*"); + } + + return markers; +} + +/** + * Creates string pattern for exceptions. + * Generated pattern: + * + * 1. A space or an exception pattern sequence. + * @param {string[]} exceptions An exception pattern list. + * @returns {string} A regular expression string for exceptions. + */ +function createExceptionsPattern(exceptions) { + let pattern = ""; + + /* + * A space or an exception pattern sequence. + * [] ==> "\s" + * ["-"] ==> "(?:\s|\-+$)" + * ["-", "="] ==> "(?:\s|(?:\-+|=+)$)" + * ["-", "=", "--=="] ==> "(?:\s|(?:\-+|=+|(?:\-\-==)+)$)" ==> https://jex.im/regulex/#!embed=false&flags=&re=(%3F%3A%5Cs%7C(%3F%3A%5C-%2B%7C%3D%2B%7C(%3F%3A%5C-%5C-%3D%3D)%2B)%24) + */ + if (exceptions.length === 0) { + + // a space. + pattern += "\\s"; + } else { + + // a space or... + pattern += "(?:\\s|"; + + if (exceptions.length === 1) { + + // a sequence of the exception pattern. + pattern += escapeAndRepeat(exceptions[0]); + } else { + + // a sequence of one of the exception patterns. + pattern += "(?:"; + pattern += exceptions.map(escapeAndRepeat).join("|"); + pattern += ")"; + } + pattern += `(?:$|[${Array.from(astUtils.LINEBREAKS).join("")}]))`; + } + + return pattern; +} + +/** + * Creates RegExp object for `always` mode. + * Generated pattern for beginning of comment: + * + * 1. First, a marker or nothing. + * 2. Next, a space or an exception pattern sequence. + * @param {string[]} markers A marker list. + * @param {string[]} exceptions An exception pattern list. + * @returns {RegExp} A RegExp object for the beginning of a comment in `always` mode. + */ +function createAlwaysStylePattern(markers, exceptions) { + let pattern = "^"; + + /* + * A marker or nothing. + * ["*"] ==> "\*?" + * ["*", "!"] ==> "(?:\*|!)?" + * ["*", "/", "!<"] ==> "(?:\*|\/|(?:!<))?" ==> https://jex.im/regulex/#!embed=false&flags=&re=(%3F%3A%5C*%7C%5C%2F%7C(%3F%3A!%3C))%3F + */ + if (markers.length === 1) { + + // the marker. + pattern += escape(markers[0]); + } else { + + // one of markers. + pattern += "(?:"; + pattern += markers.map(escape).join("|"); + pattern += ")"; + } + + pattern += "?"; // or nothing. + pattern += createExceptionsPattern(exceptions); + + return new RegExp(pattern, "u"); +} + +/** + * Creates RegExp object for `never` mode. + * Generated pattern for beginning of comment: + * + * 1. First, a marker or nothing (captured). + * 2. Next, a space or a tab. + * @param {string[]} markers A marker list. + * @returns {RegExp} A RegExp object for `never` mode. + */ +function createNeverStylePattern(markers) { + const pattern = `^(${markers.map(escape).join("|")})?[ \t]+`; + + return new RegExp(pattern, "u"); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce consistent spacing after the `//` or `/*` in a comment", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/spaced-comment" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + exceptions: { + type: "array", + items: { + type: "string" + } + }, + markers: { + type: "array", + items: { + type: "string" + } + }, + line: { + type: "object", + properties: { + exceptions: { + type: "array", + items: { + type: "string" + } + }, + markers: { + type: "array", + items: { + type: "string" + } + } + }, + additionalProperties: false + }, + block: { + type: "object", + properties: { + exceptions: { + type: "array", + items: { + type: "string" + } + }, + markers: { + type: "array", + items: { + type: "string" + } + }, + balanced: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedSpaceAfterMarker: "Unexpected space or tab after marker ({{refChar}}) in comment.", + expectedExceptionAfter: "Expected exception block, space or tab after '{{refChar}}' in comment.", + unexpectedSpaceBefore: "Unexpected space or tab before '*/' in comment.", + unexpectedSpaceAfter: "Unexpected space or tab after '{{refChar}}' in comment.", + expectedSpaceBefore: "Expected space or tab before '*/' in comment.", + expectedSpaceAfter: "Expected space or tab after '{{refChar}}' in comment." + } + }, + + create(context) { + + const sourceCode = context.getSourceCode(); + + // Unless the first option is never, require a space + const requireSpace = context.options[0] !== "never"; + + /* + * Parse the second options. + * If markers don't include `"*"`, it's added automatically for JSDoc + * comments. + */ + const config = context.options[1] || {}; + const balanced = config.block && config.block.balanced; + + const styleRules = ["block", "line"].reduce((rule, type) => { + const markers = parseMarkersOption(config[type] && config[type].markers || config.markers || []); + const exceptions = config[type] && config[type].exceptions || config.exceptions || []; + const endNeverPattern = "[ \t]+$"; + + // Create RegExp object for valid patterns. + rule[type] = { + beginRegex: requireSpace ? createAlwaysStylePattern(markers, exceptions) : createNeverStylePattern(markers), + endRegex: balanced && requireSpace ? new RegExp(`${createExceptionsPattern(exceptions)}$`, "u") : new RegExp(endNeverPattern, "u"), + hasExceptions: exceptions.length > 0, + captureMarker: new RegExp(`^(${markers.map(escape).join("|")})`, "u"), + markers: new Set(markers) + }; + + return rule; + }, {}); + + /** + * Reports a beginning spacing error with an appropriate message. + * @param {ASTNode} node A comment node to check. + * @param {string} messageId An error message to report. + * @param {Array} match An array of match results for markers. + * @param {string} refChar Character used for reference in the error message. + * @returns {void} + */ + function reportBegin(node, messageId, match, refChar) { + const type = node.type.toLowerCase(), + commentIdentifier = type === "block" ? "/*" : "//"; + + context.report({ + node, + fix(fixer) { + const start = node.range[0]; + let end = start + 2; + + if (requireSpace) { + if (match) { + end += match[0].length; + } + return fixer.insertTextAfterRange([start, end], " "); + } + end += match[0].length; + return fixer.replaceTextRange([start, end], commentIdentifier + (match[1] ? match[1] : "")); + + }, + messageId, + data: { refChar } + }); + } + + /** + * Reports an ending spacing error with an appropriate message. + * @param {ASTNode} node A comment node to check. + * @param {string} messageId An error message to report. + * @param {string} match An array of the matched whitespace characters. + * @returns {void} + */ + function reportEnd(node, messageId, match) { + context.report({ + node, + fix(fixer) { + if (requireSpace) { + return fixer.insertTextAfterRange([node.range[0], node.range[1] - 2], " "); + } + const end = node.range[1] - 2, + start = end - match[0].length; + + return fixer.replaceTextRange([start, end], ""); + + }, + messageId + }); + } + + /** + * Reports a given comment if it's invalid. + * @param {ASTNode} node a comment node to check. + * @returns {void} + */ + function checkCommentForSpace(node) { + const type = node.type.toLowerCase(), + rule = styleRules[type], + commentIdentifier = type === "block" ? "/*" : "//"; + + // Ignores empty comments and comments that consist only of a marker. + if (node.value.length === 0 || rule.markers.has(node.value)) { + return; + } + + const beginMatch = rule.beginRegex.exec(node.value); + const endMatch = rule.endRegex.exec(node.value); + + // Checks. + if (requireSpace) { + if (!beginMatch) { + const hasMarker = rule.captureMarker.exec(node.value); + const marker = hasMarker ? commentIdentifier + hasMarker[0] : commentIdentifier; + + if (rule.hasExceptions) { + reportBegin(node, "expectedExceptionAfter", hasMarker, marker); + } else { + reportBegin(node, "expectedSpaceAfter", hasMarker, marker); + } + } + + if (balanced && type === "block" && !endMatch) { + reportEnd(node, "expectedSpaceBefore"); + } + } else { + if (beginMatch) { + if (!beginMatch[1]) { + reportBegin(node, "unexpectedSpaceAfter", beginMatch, commentIdentifier); + } else { + reportBegin(node, "unexpectedSpaceAfterMarker", beginMatch, beginMatch[1]); + } + } + + if (balanced && type === "block" && endMatch) { + reportEnd(node, "unexpectedSpaceBefore", endMatch); + } + } + } + + return { + Program() { + const comments = sourceCode.getAllComments(); + + comments.filter(token => token.type !== "Shebang").forEach(checkCommentForSpace); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/strict.js b/node_modules/eslint/lib/rules/strict.js new file mode 100644 index 000000000..b0d6cf917 --- /dev/null +++ b/node_modules/eslint/lib/rules/strict.js @@ -0,0 +1,277 @@ +/** + * @fileoverview Rule to control usage of strict mode directives. + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets all of the Use Strict Directives in the Directive Prologue of a group of + * statements. + * @param {ASTNode[]} statements Statements in the program or function body. + * @returns {ASTNode[]} All of the Use Strict Directives. + */ +function getUseStrictDirectives(statements) { + const directives = []; + + for (let i = 0; i < statements.length; i++) { + const statement = statements[i]; + + if ( + statement.type === "ExpressionStatement" && + statement.expression.type === "Literal" && + statement.expression.value === "use strict" + ) { + directives[i] = statement; + } else { + break; + } + } + + return directives; +} + +/** + * Checks whether a given parameter is a simple parameter. + * @param {ASTNode} node A pattern node to check. + * @returns {boolean} `true` if the node is an Identifier node. + */ +function isSimpleParameter(node) { + return node.type === "Identifier"; +} + +/** + * Checks whether a given parameter list is a simple parameter list. + * @param {ASTNode[]} params A parameter list to check. + * @returns {boolean} `true` if the every parameter is an Identifier node. + */ +function isSimpleParameterList(params) { + return params.every(isSimpleParameter); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require or disallow strict mode directives", + category: "Strict Mode", + recommended: false, + url: "https://eslint.org/docs/rules/strict" + }, + + schema: [ + { + enum: ["never", "global", "function", "safe"] + } + ], + + fixable: "code", + messages: { + function: "Use the function form of 'use strict'.", + global: "Use the global form of 'use strict'.", + multiple: "Multiple 'use strict' directives.", + never: "Strict mode is not permitted.", + unnecessary: "Unnecessary 'use strict' directive.", + module: "'use strict' is unnecessary inside of modules.", + implied: "'use strict' is unnecessary when implied strict mode is enabled.", + unnecessaryInClasses: "'use strict' is unnecessary inside of classes.", + nonSimpleParameterList: "'use strict' directive inside a function with non-simple parameter list throws a syntax error since ES2016.", + wrap: "Wrap {{name}} in a function with 'use strict' directive." + } + }, + + create(context) { + + const ecmaFeatures = context.parserOptions.ecmaFeatures || {}, + scopes = [], + classScopes = []; + let mode = context.options[0] || "safe"; + + if (ecmaFeatures.impliedStrict) { + mode = "implied"; + } else if (mode === "safe") { + mode = ecmaFeatures.globalReturn ? "global" : "function"; + } + + /** + * Determines whether a reported error should be fixed, depending on the error type. + * @param {string} errorType The type of error + * @returns {boolean} `true` if the reported error should be fixed + */ + function shouldFix(errorType) { + return errorType === "multiple" || errorType === "unnecessary" || errorType === "module" || errorType === "implied" || errorType === "unnecessaryInClasses"; + } + + /** + * Gets a fixer function to remove a given 'use strict' directive. + * @param {ASTNode} node The directive that should be removed + * @returns {Function} A fixer function + */ + function getFixFunction(node) { + return fixer => fixer.remove(node); + } + + /** + * Report a slice of an array of nodes with a given message. + * @param {ASTNode[]} nodes Nodes. + * @param {string} start Index to start from. + * @param {string} end Index to end before. + * @param {string} messageId Message to display. + * @param {boolean} fix `true` if the directive should be fixed (i.e. removed) + * @returns {void} + */ + function reportSlice(nodes, start, end, messageId, fix) { + nodes.slice(start, end).forEach(node => { + context.report({ node, messageId, fix: fix ? getFixFunction(node) : null }); + }); + } + + /** + * Report all nodes in an array with a given message. + * @param {ASTNode[]} nodes Nodes. + * @param {string} messageId Message id to display. + * @param {boolean} fix `true` if the directive should be fixed (i.e. removed) + * @returns {void} + */ + function reportAll(nodes, messageId, fix) { + reportSlice(nodes, 0, nodes.length, messageId, fix); + } + + /** + * Report all nodes in an array, except the first, with a given message. + * @param {ASTNode[]} nodes Nodes. + * @param {string} messageId Message id to display. + * @param {boolean} fix `true` if the directive should be fixed (i.e. removed) + * @returns {void} + */ + function reportAllExceptFirst(nodes, messageId, fix) { + reportSlice(nodes, 1, nodes.length, messageId, fix); + } + + /** + * Entering a function in 'function' mode pushes a new nested scope onto the + * stack. The new scope is true if the nested function is strict mode code. + * @param {ASTNode} node The function declaration or expression. + * @param {ASTNode[]} useStrictDirectives The Use Strict Directives of the node. + * @returns {void} + */ + function enterFunctionInFunctionMode(node, useStrictDirectives) { + const isInClass = classScopes.length > 0, + isParentGlobal = scopes.length === 0 && classScopes.length === 0, + isParentStrict = scopes.length > 0 && scopes[scopes.length - 1], + isStrict = useStrictDirectives.length > 0; + + if (isStrict) { + if (!isSimpleParameterList(node.params)) { + context.report({ node: useStrictDirectives[0], messageId: "nonSimpleParameterList" }); + } else if (isParentStrict) { + context.report({ node: useStrictDirectives[0], messageId: "unnecessary", fix: getFixFunction(useStrictDirectives[0]) }); + } else if (isInClass) { + context.report({ node: useStrictDirectives[0], messageId: "unnecessaryInClasses", fix: getFixFunction(useStrictDirectives[0]) }); + } + + reportAllExceptFirst(useStrictDirectives, "multiple", true); + } else if (isParentGlobal) { + if (isSimpleParameterList(node.params)) { + context.report({ node, messageId: "function" }); + } else { + context.report({ + node, + messageId: "wrap", + data: { name: astUtils.getFunctionNameWithKind(node) } + }); + } + } + + scopes.push(isParentStrict || isStrict); + } + + /** + * Exiting a function in 'function' mode pops its scope off the stack. + * @returns {void} + */ + function exitFunctionInFunctionMode() { + scopes.pop(); + } + + /** + * Enter a function and either: + * - Push a new nested scope onto the stack (in 'function' mode). + * - Report all the Use Strict Directives (in the other modes). + * @param {ASTNode} node The function declaration or expression. + * @returns {void} + */ + function enterFunction(node) { + const isBlock = node.body.type === "BlockStatement", + useStrictDirectives = isBlock + ? getUseStrictDirectives(node.body.body) : []; + + if (mode === "function") { + enterFunctionInFunctionMode(node, useStrictDirectives); + } else if (useStrictDirectives.length > 0) { + if (isSimpleParameterList(node.params)) { + reportAll(useStrictDirectives, mode, shouldFix(mode)); + } else { + context.report({ node: useStrictDirectives[0], messageId: "nonSimpleParameterList" }); + reportAllExceptFirst(useStrictDirectives, "multiple", true); + } + } + } + + const rule = { + Program(node) { + const useStrictDirectives = getUseStrictDirectives(node.body); + + if (node.sourceType === "module") { + mode = "module"; + } + + if (mode === "global") { + if (node.body.length > 0 && useStrictDirectives.length === 0) { + context.report({ node, messageId: "global" }); + } + reportAllExceptFirst(useStrictDirectives, "multiple", true); + } else { + reportAll(useStrictDirectives, mode, shouldFix(mode)); + } + }, + FunctionDeclaration: enterFunction, + FunctionExpression: enterFunction, + ArrowFunctionExpression: enterFunction + }; + + if (mode === "function") { + Object.assign(rule, { + + // Inside of class bodies are always strict mode. + ClassBody() { + classScopes.push(true); + }, + "ClassBody:exit"() { + classScopes.pop(); + }, + + "FunctionDeclaration:exit": exitFunctionInFunctionMode, + "FunctionExpression:exit": exitFunctionInFunctionMode, + "ArrowFunctionExpression:exit": exitFunctionInFunctionMode + }); + } + + return rule; + } +}; diff --git a/node_modules/eslint/lib/rules/switch-colon-spacing.js b/node_modules/eslint/lib/rules/switch-colon-spacing.js new file mode 100644 index 000000000..c90641573 --- /dev/null +++ b/node_modules/eslint/lib/rules/switch-colon-spacing.js @@ -0,0 +1,141 @@ +/** + * @fileoverview Rule to enforce spacing around colons of switch statements. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce spacing around colons of switch statements", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/switch-colon-spacing" + }, + + schema: [ + { + type: "object", + properties: { + before: { type: "boolean", default: false }, + after: { type: "boolean", default: true } + }, + additionalProperties: false + } + ], + fixable: "whitespace", + messages: { + expectedBefore: "Expected space(s) before this colon.", + expectedAfter: "Expected space(s) after this colon.", + unexpectedBefore: "Unexpected space(s) before this colon.", + unexpectedAfter: "Unexpected space(s) after this colon." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const options = context.options[0] || {}; + const beforeSpacing = options.before === true; // false by default + const afterSpacing = options.after !== false; // true by default + + /** + * Get the colon token of the given SwitchCase node. + * @param {ASTNode} node The SwitchCase node to get. + * @returns {Token} The colon token of the node. + */ + function getColonToken(node) { + if (node.test) { + return sourceCode.getTokenAfter(node.test, astUtils.isColonToken); + } + return sourceCode.getFirstToken(node, 1); + } + + /** + * Check whether the spacing between the given 2 tokens is valid or not. + * @param {Token} left The left token to check. + * @param {Token} right The right token to check. + * @param {boolean} expected The expected spacing to check. `true` if there should be a space. + * @returns {boolean} `true` if the spacing between the tokens is valid. + */ + function isValidSpacing(left, right, expected) { + return ( + astUtils.isClosingBraceToken(right) || + !astUtils.isTokenOnSameLine(left, right) || + sourceCode.isSpaceBetweenTokens(left, right) === expected + ); + } + + /** + * Check whether comments exist between the given 2 tokens. + * @param {Token} left The left token to check. + * @param {Token} right The right token to check. + * @returns {boolean} `true` if comments exist between the given 2 tokens. + */ + function commentsExistBetween(left, right) { + return sourceCode.getFirstTokenBetween( + left, + right, + { + includeComments: true, + filter: astUtils.isCommentToken + } + ) !== null; + } + + /** + * Fix the spacing between the given 2 tokens. + * @param {RuleFixer} fixer The fixer to fix. + * @param {Token} left The left token of fix range. + * @param {Token} right The right token of fix range. + * @param {boolean} spacing The spacing style. `true` if there should be a space. + * @returns {Fix|null} The fix object. + */ + function fix(fixer, left, right, spacing) { + if (commentsExistBetween(left, right)) { + return null; + } + if (spacing) { + return fixer.insertTextAfter(left, " "); + } + return fixer.removeRange([left.range[1], right.range[0]]); + } + + return { + SwitchCase(node) { + const colonToken = getColonToken(node); + const beforeToken = sourceCode.getTokenBefore(colonToken); + const afterToken = sourceCode.getTokenAfter(colonToken); + + if (!isValidSpacing(beforeToken, colonToken, beforeSpacing)) { + context.report({ + node, + loc: colonToken.loc, + messageId: beforeSpacing ? "expectedBefore" : "unexpectedBefore", + fix: fixer => fix(fixer, beforeToken, colonToken, beforeSpacing) + }); + } + if (!isValidSpacing(colonToken, afterToken, afterSpacing)) { + context.report({ + node, + loc: colonToken.loc, + messageId: afterSpacing ? "expectedAfter" : "unexpectedAfter", + fix: fixer => fix(fixer, colonToken, afterToken, afterSpacing) + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/symbol-description.js b/node_modules/eslint/lib/rules/symbol-description.js new file mode 100644 index 000000000..155cea4dc --- /dev/null +++ b/node_modules/eslint/lib/rules/symbol-description.js @@ -0,0 +1,71 @@ +/** + * @fileoverview Rule to enforce description with the `Symbol` object + * @author Jarek Rencz + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require symbol descriptions", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/symbol-description" + }, + fixable: null, + schema: [], + messages: { + expected: "Expected Symbol to have a description." + } + }, + + create(context) { + + /** + * Reports if node does not conform the rule in case rule is set to + * report missing description + * @param {ASTNode} node A CallExpression node to check. + * @returns {void} + */ + function checkArgument(node) { + if (node.arguments.length === 0) { + context.report({ + node, + messageId: "expected" + }); + } + } + + return { + "Program:exit"() { + const scope = context.getScope(); + const variable = astUtils.getVariableByName(scope, "Symbol"); + + if (variable && variable.defs.length === 0) { + variable.references.forEach(reference => { + const node = reference.identifier; + + if (astUtils.isCallee(node)) { + checkArgument(node.parent); + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/template-curly-spacing.js b/node_modules/eslint/lib/rules/template-curly-spacing.js new file mode 100644 index 000000000..26043bc91 --- /dev/null +++ b/node_modules/eslint/lib/rules/template-curly-spacing.js @@ -0,0 +1,141 @@ +/** + * @fileoverview Rule to enforce spacing around embedded expressions of template strings + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow spacing around embedded expressions of template strings", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/template-curly-spacing" + }, + + fixable: "whitespace", + + schema: [ + { enum: ["always", "never"] } + ], + messages: { + expectedBefore: "Expected space(s) before '}'.", + expectedAfter: "Expected space(s) after '${'.", + unexpectedBefore: "Unexpected space(s) before '}'.", + unexpectedAfter: "Unexpected space(s) after '${'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const always = context.options[0] === "always"; + + /** + * Checks spacing before `}` of a given token. + * @param {Token} token A token to check. This is a Template token. + * @returns {void} + */ + function checkSpacingBefore(token) { + if (!token.value.startsWith("}")) { + return; // starts with a backtick, this is the first template element in the template literal + } + + const prevToken = sourceCode.getTokenBefore(token, { includeComments: true }), + hasSpace = sourceCode.isSpaceBetween(prevToken, token); + + if (!astUtils.isTokenOnSameLine(prevToken, token)) { + return; + } + + if (always && !hasSpace) { + context.report({ + loc: { + start: token.loc.start, + end: { + line: token.loc.start.line, + column: token.loc.start.column + 1 + } + }, + messageId: "expectedBefore", + fix: fixer => fixer.insertTextBefore(token, " ") + }); + } + + if (!always && hasSpace) { + context.report({ + loc: { + start: prevToken.loc.end, + end: token.loc.start + }, + messageId: "unexpectedBefore", + fix: fixer => fixer.removeRange([prevToken.range[1], token.range[0]]) + }); + } + } + + /** + * Checks spacing after `${` of a given token. + * @param {Token} token A token to check. This is a Template token. + * @returns {void} + */ + function checkSpacingAfter(token) { + if (!token.value.endsWith("${")) { + return; // ends with a backtick, this is the last template element in the template literal + } + + const nextToken = sourceCode.getTokenAfter(token, { includeComments: true }), + hasSpace = sourceCode.isSpaceBetween(token, nextToken); + + if (!astUtils.isTokenOnSameLine(token, nextToken)) { + return; + } + + if (always && !hasSpace) { + context.report({ + loc: { + start: { + line: token.loc.end.line, + column: token.loc.end.column - 2 + }, + end: token.loc.end + }, + messageId: "expectedAfter", + fix: fixer => fixer.insertTextAfter(token, " ") + }); + } + + if (!always && hasSpace) { + context.report({ + loc: { + start: token.loc.end, + end: nextToken.loc.start + }, + messageId: "unexpectedAfter", + fix: fixer => fixer.removeRange([token.range[1], nextToken.range[0]]) + }); + } + } + + return { + TemplateElement(node) { + const token = sourceCode.getFirstToken(node); + + checkSpacingBefore(token); + checkSpacingAfter(token); + } + }; + } +}; diff --git a/node_modules/eslint/lib/rules/template-tag-spacing.js b/node_modules/eslint/lib/rules/template-tag-spacing.js new file mode 100644 index 000000000..16f586255 --- /dev/null +++ b/node_modules/eslint/lib/rules/template-tag-spacing.js @@ -0,0 +1,90 @@ +/** + * @fileoverview Rule to check spacing between template tags and their literals + * @author Jonathan Wilsson + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow spacing between template tags and their literals", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/template-tag-spacing" + }, + + fixable: "whitespace", + + schema: [ + { enum: ["always", "never"] } + ], + messages: { + unexpected: "Unexpected space between template tag and template literal.", + missing: "Missing space between template tag and template literal." + } + }, + + create(context) { + const never = context.options[0] !== "always"; + const sourceCode = context.getSourceCode(); + + /** + * Check if a space is present between a template tag and its literal + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkSpacing(node) { + const tagToken = sourceCode.getTokenBefore(node.quasi); + const literalToken = sourceCode.getFirstToken(node.quasi); + const hasWhitespace = sourceCode.isSpaceBetweenTokens(tagToken, literalToken); + + if (never && hasWhitespace) { + context.report({ + node, + loc: { + start: tagToken.loc.end, + end: literalToken.loc.start + }, + messageId: "unexpected", + fix(fixer) { + const comments = sourceCode.getCommentsBefore(node.quasi); + + // Don't fix anything if there's a single line comment after the template tag + if (comments.some(comment => comment.type === "Line")) { + return null; + } + + return fixer.replaceTextRange( + [tagToken.range[1], literalToken.range[0]], + comments.reduce((text, comment) => text + sourceCode.getText(comment), "") + ); + } + }); + } else if (!never && !hasWhitespace) { + context.report({ + node, + loc: { + start: node.loc.start, + end: literalToken.loc.start + }, + messageId: "missing", + fix(fixer) { + return fixer.insertTextAfter(tagToken, " "); + } + }); + } + } + + return { + TaggedTemplateExpression: checkSpacing + }; + } +}; diff --git a/node_modules/eslint/lib/rules/unicode-bom.js b/node_modules/eslint/lib/rules/unicode-bom.js new file mode 100644 index 000000000..39642f851 --- /dev/null +++ b/node_modules/eslint/lib/rules/unicode-bom.js @@ -0,0 +1,73 @@ +/** + * @fileoverview Require or disallow Unicode BOM + * @author Andrew Johnston + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow Unicode byte order mark (BOM)", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/unicode-bom" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + } + ], + messages: { + expected: "Expected Unicode BOM (Byte Order Mark).", + unexpected: "Unexpected Unicode BOM (Byte Order Mark)." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + Program: function checkUnicodeBOM(node) { + + const sourceCode = context.getSourceCode(), + location = { column: 0, line: 1 }, + requireBOM = context.options[0] || "never"; + + if (!sourceCode.hasBOM && (requireBOM === "always")) { + context.report({ + node, + loc: location, + messageId: "expected", + fix(fixer) { + return fixer.insertTextBeforeRange([0, 1], "\uFEFF"); + } + }); + } else if (sourceCode.hasBOM && (requireBOM === "never")) { + context.report({ + node, + loc: location, + messageId: "unexpected", + fix(fixer) { + return fixer.removeRange([-1, 0]); + } + }); + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/use-isnan.js b/node_modules/eslint/lib/rules/use-isnan.js new file mode 100644 index 000000000..53ffeb7e6 --- /dev/null +++ b/node_modules/eslint/lib/rules/use-isnan.js @@ -0,0 +1,138 @@ +/** + * @fileoverview Rule to flag comparisons to the value NaN + * @author James Allardice + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines if the given node is a NaN `Identifier` node. + * @param {ASTNode|null} node The node to check. + * @returns {boolean} `true` if the node is 'NaN' identifier. + */ +function isNaNIdentifier(node) { + return Boolean(node) && node.type === "Identifier" && node.name === "NaN"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "require calls to `isNaN()` when checking for `NaN`", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/use-isnan" + }, + + schema: [ + { + type: "object", + properties: { + enforceForSwitchCase: { + type: "boolean", + default: true + }, + enforceForIndexOf: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + comparisonWithNaN: "Use the isNaN function to compare with NaN.", + switchNaN: "'switch(NaN)' can never match a case clause. Use Number.isNaN instead of the switch.", + caseNaN: "'case NaN' can never match. Use Number.isNaN before the switch.", + indexOfNaN: "Array prototype method '{{ methodName }}' cannot find NaN." + } + }, + + create(context) { + + const enforceForSwitchCase = !context.options[0] || context.options[0].enforceForSwitchCase; + const enforceForIndexOf = context.options[0] && context.options[0].enforceForIndexOf; + + /** + * Checks the given `BinaryExpression` node for `foo === NaN` and other comparisons. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkBinaryExpression(node) { + if ( + /^(?:[<>]|[!=]=)=?$/u.test(node.operator) && + (isNaNIdentifier(node.left) || isNaNIdentifier(node.right)) + ) { + context.report({ node, messageId: "comparisonWithNaN" }); + } + } + + /** + * Checks the discriminant and all case clauses of the given `SwitchStatement` node for `switch(NaN)` and `case NaN:` + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkSwitchStatement(node) { + if (isNaNIdentifier(node.discriminant)) { + context.report({ node, messageId: "switchNaN" }); + } + + for (const switchCase of node.cases) { + if (isNaNIdentifier(switchCase.test)) { + context.report({ node: switchCase, messageId: "caseNaN" }); + } + } + } + + /** + * Checks the the given `CallExpression` node for `.indexOf(NaN)` and `.lastIndexOf(NaN)`. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkCallExpression(node) { + const callee = astUtils.skipChainExpression(node.callee); + + if (callee.type === "MemberExpression") { + const methodName = astUtils.getStaticPropertyName(callee); + + if ( + (methodName === "indexOf" || methodName === "lastIndexOf") && + node.arguments.length === 1 && + isNaNIdentifier(node.arguments[0]) + ) { + context.report({ node, messageId: "indexOfNaN", data: { methodName } }); + } + } + } + + const listeners = { + BinaryExpression: checkBinaryExpression + }; + + if (enforceForSwitchCase) { + listeners.SwitchStatement = checkSwitchStatement; + } + + if (enforceForIndexOf) { + listeners.CallExpression = checkCallExpression; + } + + return listeners; + } +}; diff --git a/node_modules/eslint/lib/rules/utils/ast-utils.js b/node_modules/eslint/lib/rules/utils/ast-utils.js new file mode 100644 index 000000000..fb8beb252 --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/ast-utils.js @@ -0,0 +1,1794 @@ +/** + * @fileoverview Common utils for AST. + * @author Gyandeep Singh + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const esutils = require("esutils"); +const espree = require("espree"); +const lodash = require("lodash"); +const { + breakableTypePattern, + createGlobalLinebreakMatcher, + lineBreakPattern, + shebangPattern +} = require("../../shared/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const anyFunctionPattern = /^(?:Function(?:Declaration|Expression)|ArrowFunctionExpression)$/u; +const anyLoopPattern = /^(?:DoWhile|For|ForIn|ForOf|While)Statement$/u; +const arrayOrTypedArrayPattern = /Array$/u; +const arrayMethodPattern = /^(?:every|filter|find|findIndex|forEach|map|some)$/u; +const bindOrCallOrApplyPattern = /^(?:bind|call|apply)$/u; +const thisTagPattern = /^[\s*]*@this/mu; + + +const COMMENTS_IGNORE_PATTERN = /^\s*(?:eslint|jshint\s+|jslint\s+|istanbul\s+|globals?\s+|exported\s+|jscs)/u; +const LINEBREAKS = new Set(["\r\n", "\r", "\n", "\u2028", "\u2029"]); + +// A set of node types that can contain a list of statements +const STATEMENT_LIST_PARENTS = new Set(["Program", "BlockStatement", "SwitchCase"]); + +const DECIMAL_INTEGER_PATTERN = /^(?:0|0[0-7]*[89]\d*|[1-9](?:_?\d)*)$/u; +const OCTAL_ESCAPE_PATTERN = /^(?:[^\\]|\\[^0-7]|\\0(?![0-9]))*\\(?:[1-7]|0[0-9])/u; + +const LOGICAL_ASSIGNMENT_OPERATORS = new Set(["&&=", "||=", "??="]); + +/** + * Checks reference if is non initializer and writable. + * @param {Reference} reference A reference to check. + * @param {int} index The index of the reference in the references. + * @param {Reference[]} references The array that the reference belongs to. + * @returns {boolean} Success/Failure + * @private + */ +function isModifyingReference(reference, index, references) { + const identifier = reference.identifier; + + /* + * Destructuring assignments can have multiple default value, so + * possibly there are multiple writeable references for the same + * identifier. + */ + const modifyingDifferentIdentifier = index === 0 || + references[index - 1].identifier !== identifier; + + return (identifier && + reference.init === false && + reference.isWrite() && + modifyingDifferentIdentifier + ); +} + +/** + * Checks whether the given string starts with uppercase or not. + * @param {string} s The string to check. + * @returns {boolean} `true` if the string starts with uppercase. + */ +function startsWithUpperCase(s) { + return s[0] !== s[0].toLocaleLowerCase(); +} + +/** + * Checks whether or not a node is a constructor. + * @param {ASTNode} node A function node to check. + * @returns {boolean} Wehether or not a node is a constructor. + */ +function isES5Constructor(node) { + return (node.id && startsWithUpperCase(node.id.name)); +} + +/** + * Finds a function node from ancestors of a node. + * @param {ASTNode} node A start node to find. + * @returns {Node|null} A found function node. + */ +function getUpperFunction(node) { + for (let currentNode = node; currentNode; currentNode = currentNode.parent) { + if (anyFunctionPattern.test(currentNode.type)) { + return currentNode; + } + } + return null; +} + +/** + * Checks whether a given node is a function node or not. + * The following types are function nodes: + * + * - ArrowFunctionExpression + * - FunctionDeclaration + * - FunctionExpression + * @param {ASTNode|null} node A node to check. + * @returns {boolean} `true` if the node is a function node. + */ +function isFunction(node) { + return Boolean(node && anyFunctionPattern.test(node.type)); +} + +/** + * Checks whether a given node is a loop node or not. + * The following types are loop nodes: + * + * - DoWhileStatement + * - ForInStatement + * - ForOfStatement + * - ForStatement + * - WhileStatement + * @param {ASTNode|null} node A node to check. + * @returns {boolean} `true` if the node is a loop node. + */ +function isLoop(node) { + return Boolean(node && anyLoopPattern.test(node.type)); +} + +/** + * Checks whether the given node is in a loop or not. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is in a loop. + */ +function isInLoop(node) { + for (let currentNode = node; currentNode && !isFunction(currentNode); currentNode = currentNode.parent) { + if (isLoop(currentNode)) { + return true; + } + } + + return false; +} + +/** + * Determines whether the given node is a `null` literal. + * @param {ASTNode} node The node to check + * @returns {boolean} `true` if the node is a `null` literal + */ +function isNullLiteral(node) { + + /* + * Checking `node.value === null` does not guarantee that a literal is a null literal. + * When parsing values that cannot be represented in the current environment (e.g. unicode + * regexes in Node 4), `node.value` is set to `null` because it wouldn't be possible to + * set `node.value` to a unicode regex. To make sure a literal is actually `null`, check + * `node.regex` instead. Also see: https://github.com/eslint/eslint/issues/8020 + */ + return node.type === "Literal" && node.value === null && !node.regex && !node.bigint; +} + +/** + * Checks whether or not a node is `null` or `undefined`. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a `null` or `undefined`. + * @public + */ +function isNullOrUndefined(node) { + return ( + isNullLiteral(node) || + (node.type === "Identifier" && node.name === "undefined") || + (node.type === "UnaryExpression" && node.operator === "void") + ); +} + +/** + * Checks whether or not a node is callee. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is callee. + */ +function isCallee(node) { + return node.parent.type === "CallExpression" && node.parent.callee === node; +} + +/** + * Returns the result of the string conversion applied to the evaluated value of the given expression node, + * if it can be determined statically. + * + * This function returns a `string` value for all `Literal` nodes and simple `TemplateLiteral` nodes only. + * In all other cases, this function returns `null`. + * @param {ASTNode} node Expression node. + * @returns {string|null} String value if it can be determined. Otherwise, `null`. + */ +function getStaticStringValue(node) { + switch (node.type) { + case "Literal": + if (node.value === null) { + if (isNullLiteral(node)) { + return String(node.value); // "null" + } + if (node.regex) { + return `/${node.regex.pattern}/${node.regex.flags}`; + } + if (node.bigint) { + return node.bigint; + } + + // Otherwise, this is an unknown literal. The function will return null. + + } else { + return String(node.value); + } + break; + case "TemplateLiteral": + if (node.expressions.length === 0 && node.quasis.length === 1) { + return node.quasis[0].value.cooked; + } + break; + + // no default + } + + return null; +} + +/** + * Gets the property name of a given node. + * The node can be a MemberExpression, a Property, or a MethodDefinition. + * + * If the name is dynamic, this returns `null`. + * + * For examples: + * + * a.b // => "b" + * a["b"] // => "b" + * a['b'] // => "b" + * a[`b`] // => "b" + * a[100] // => "100" + * a[b] // => null + * a["a" + "b"] // => null + * a[tag`b`] // => null + * a[`${b}`] // => null + * + * let a = {b: 1} // => "b" + * let a = {["b"]: 1} // => "b" + * let a = {['b']: 1} // => "b" + * let a = {[`b`]: 1} // => "b" + * let a = {[100]: 1} // => "100" + * let a = {[b]: 1} // => null + * let a = {["a" + "b"]: 1} // => null + * let a = {[tag`b`]: 1} // => null + * let a = {[`${b}`]: 1} // => null + * @param {ASTNode} node The node to get. + * @returns {string|null} The property name if static. Otherwise, null. + */ +function getStaticPropertyName(node) { + let prop; + + switch (node && node.type) { + case "ChainExpression": + return getStaticPropertyName(node.expression); + + case "Property": + case "MethodDefinition": + prop = node.key; + break; + + case "MemberExpression": + prop = node.property; + break; + + // no default + } + + if (prop) { + if (prop.type === "Identifier" && !node.computed) { + return prop.name; + } + + return getStaticStringValue(prop); + } + + return null; +} + +/** + * Retrieve `ChainExpression#expression` value if the given node a `ChainExpression` node. Otherwise, pass through it. + * @param {ASTNode} node The node to address. + * @returns {ASTNode} The `ChainExpression#expression` value if the node is a `ChainExpression` node. Otherwise, the node. + */ +function skipChainExpression(node) { + return node && node.type === "ChainExpression" ? node.expression : node; +} + +/** + * Check if the `actual` is an expected value. + * @param {string} actual The string value to check. + * @param {string | RegExp} expected The expected string value or pattern. + * @returns {boolean} `true` if the `actual` is an expected value. + */ +function checkText(actual, expected) { + return typeof expected === "string" + ? actual === expected + : expected.test(actual); +} + +/** + * Check if a given node is an Identifier node with a given name. + * @param {ASTNode} node The node to check. + * @param {string | RegExp} name The expected name or the expected pattern of the object name. + * @returns {boolean} `true` if the node is an Identifier node with the name. + */ +function isSpecificId(node, name) { + return node.type === "Identifier" && checkText(node.name, name); +} + +/** + * Check if a given node is member access with a given object name and property name pair. + * This is regardless of optional or not. + * @param {ASTNode} node The node to check. + * @param {string | RegExp | null} objectName The expected name or the expected pattern of the object name. If this is nullish, this method doesn't check object. + * @param {string | RegExp | null} propertyName The expected name or the expected pattern of the property name. If this is nullish, this method doesn't check property. + * @returns {boolean} `true` if the node is member access with the object name and property name pair. + * The node is a `MemberExpression` or `ChainExpression`. + */ +function isSpecificMemberAccess(node, objectName, propertyName) { + const checkNode = skipChainExpression(node); + + if (checkNode.type !== "MemberExpression") { + return false; + } + + if (objectName && !isSpecificId(checkNode.object, objectName)) { + return false; + } + + if (propertyName) { + const actualPropertyName = getStaticPropertyName(checkNode); + + if (typeof actualPropertyName !== "string" || !checkText(actualPropertyName, propertyName)) { + return false; + } + } + + return true; +} + +/** + * Check if two literal nodes are the same value. + * @param {ASTNode} left The Literal node to compare. + * @param {ASTNode} right The other Literal node to compare. + * @returns {boolean} `true` if the two literal nodes are the same value. + */ +function equalLiteralValue(left, right) { + + // RegExp literal. + if (left.regex || right.regex) { + return Boolean( + left.regex && + right.regex && + left.regex.pattern === right.regex.pattern && + left.regex.flags === right.regex.flags + ); + } + + // BigInt literal. + if (left.bigint || right.bigint) { + return left.bigint === right.bigint; + } + + return left.value === right.value; +} + +/** + * Check if two expressions reference the same value. For example: + * a = a + * a.b = a.b + * a[0] = a[0] + * a['b'] = a['b'] + * @param {ASTNode} left The left side of the comparison. + * @param {ASTNode} right The right side of the comparison. + * @param {boolean} [disableStaticComputedKey] Don't address `a.b` and `a["b"]` are the same if `true`. For backward compatibility. + * @returns {boolean} `true` if both sides match and reference the same value. + */ +function isSameReference(left, right, disableStaticComputedKey = false) { + if (left.type !== right.type) { + + // Handle `a.b` and `a?.b` are samely. + if (left.type === "ChainExpression") { + return isSameReference(left.expression, right, disableStaticComputedKey); + } + if (right.type === "ChainExpression") { + return isSameReference(left, right.expression, disableStaticComputedKey); + } + + return false; + } + + switch (left.type) { + case "Super": + case "ThisExpression": + return true; + + case "Identifier": + return left.name === right.name; + case "Literal": + return equalLiteralValue(left, right); + + case "ChainExpression": + return isSameReference(left.expression, right.expression, disableStaticComputedKey); + + case "MemberExpression": { + if (!disableStaticComputedKey) { + const nameA = getStaticPropertyName(left); + + // x.y = x["y"] + if (nameA !== null) { + return ( + isSameReference(left.object, right.object, disableStaticComputedKey) && + nameA === getStaticPropertyName(right) + ); + } + } + + /* + * x[0] = x[0] + * x[y] = x[y] + * x.y = x.y + */ + return ( + left.computed === right.computed && + isSameReference(left.object, right.object, disableStaticComputedKey) && + isSameReference(left.property, right.property, disableStaticComputedKey) + ); + } + + default: + return false; + } +} + +/** + * Checks whether or not a node is `Reflect.apply`. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a `Reflect.apply`. + */ +function isReflectApply(node) { + return isSpecificMemberAccess(node, "Reflect", "apply"); +} + +/** + * Checks whether or not a node is `Array.from`. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a `Array.from`. + */ +function isArrayFromMethod(node) { + return isSpecificMemberAccess(node, arrayOrTypedArrayPattern, "from"); +} + +/** + * Checks whether or not a node is a method which has `thisArg`. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a method which has `thisArg`. + */ +function isMethodWhichHasThisArg(node) { + return isSpecificMemberAccess(node, null, arrayMethodPattern); +} + +/** + * Creates the negate function of the given function. + * @param {Function} f The function to negate. + * @returns {Function} Negated function. + */ +function negate(f) { + return token => !f(token); +} + +/** + * Checks whether or not a node has a `@this` tag in its comments. + * @param {ASTNode} node A node to check. + * @param {SourceCode} sourceCode A SourceCode instance to get comments. + * @returns {boolean} Whether or not the node has a `@this` tag in its comments. + */ +function hasJSDocThisTag(node, sourceCode) { + const jsdocComment = sourceCode.getJSDocComment(node); + + if (jsdocComment && thisTagPattern.test(jsdocComment.value)) { + return true; + } + + // Checks `@this` in its leading comments for callbacks, + // because callbacks don't have its JSDoc comment. + // e.g. + // sinon.test(/* @this sinon.Sandbox */function() { this.spy(); }); + return sourceCode.getCommentsBefore(node).some(comment => thisTagPattern.test(comment.value)); +} + +/** + * Determines if a node is surrounded by parentheses. + * @param {SourceCode} sourceCode The ESLint source code object + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is parenthesised. + * @private + */ +function isParenthesised(sourceCode, node) { + const previousToken = sourceCode.getTokenBefore(node), + nextToken = sourceCode.getTokenAfter(node); + + return Boolean(previousToken && nextToken) && + previousToken.value === "(" && previousToken.range[1] <= node.range[0] && + nextToken.value === ")" && nextToken.range[0] >= node.range[1]; +} + +/** + * Checks if the given token is an arrow token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is an arrow token. + */ +function isArrowToken(token) { + return token.value === "=>" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a comma token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a comma token. + */ +function isCommaToken(token) { + return token.value === "," && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a dot token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a dot token. + */ +function isDotToken(token) { + return token.value === "." && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a `?.` token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a `?.` token. + */ +function isQuestionDotToken(token) { + return token.value === "?." && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a semicolon token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a semicolon token. + */ +function isSemicolonToken(token) { + return token.value === ";" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a colon token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a colon token. + */ +function isColonToken(token) { + return token.value === ":" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is an opening parenthesis token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is an opening parenthesis token. + */ +function isOpeningParenToken(token) { + return token.value === "(" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a closing parenthesis token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a closing parenthesis token. + */ +function isClosingParenToken(token) { + return token.value === ")" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is an opening square bracket token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is an opening square bracket token. + */ +function isOpeningBracketToken(token) { + return token.value === "[" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a closing square bracket token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a closing square bracket token. + */ +function isClosingBracketToken(token) { + return token.value === "]" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is an opening brace token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is an opening brace token. + */ +function isOpeningBraceToken(token) { + return token.value === "{" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a closing brace token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a closing brace token. + */ +function isClosingBraceToken(token) { + return token.value === "}" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a comment token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a comment token. + */ +function isCommentToken(token) { + return token.type === "Line" || token.type === "Block" || token.type === "Shebang"; +} + +/** + * Checks if the given token is a keyword token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a keyword token. + */ +function isKeywordToken(token) { + return token.type === "Keyword"; +} + +/** + * Gets the `(` token of the given function node. + * @param {ASTNode} node The function node to get. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {Token} `(` token. + */ +function getOpeningParenOfParams(node, sourceCode) { + return node.id + ? sourceCode.getTokenAfter(node.id, isOpeningParenToken) + : sourceCode.getFirstToken(node, isOpeningParenToken); +} + +/** + * Checks whether or not the tokens of two given nodes are same. + * @param {ASTNode} left A node 1 to compare. + * @param {ASTNode} right A node 2 to compare. + * @param {SourceCode} sourceCode The ESLint source code object. + * @returns {boolean} the source code for the given node. + */ +function equalTokens(left, right, sourceCode) { + const tokensL = sourceCode.getTokens(left); + const tokensR = sourceCode.getTokens(right); + + if (tokensL.length !== tokensR.length) { + return false; + } + for (let i = 0; i < tokensL.length; ++i) { + if (tokensL[i].type !== tokensR[i].type || + tokensL[i].value !== tokensR[i].value + ) { + return false; + } + } + + return true; +} + +/** + * Check if the given node is a true logical expression or not. + * + * The three binary expressions logical-or (`||`), logical-and (`&&`), and + * coalesce (`??`) are known as `ShortCircuitExpression`. + * But ESTree represents those by `LogicalExpression` node. + * + * This function rejects coalesce expressions of `LogicalExpression` node. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is `&&` or `||`. + * @see https://tc39.es/ecma262/#prod-ShortCircuitExpression + */ +function isLogicalExpression(node) { + return ( + node.type === "LogicalExpression" && + (node.operator === "&&" || node.operator === "||") + ); +} + +/** + * Check if the given node is a nullish coalescing expression or not. + * + * The three binary expressions logical-or (`||`), logical-and (`&&`), and + * coalesce (`??`) are known as `ShortCircuitExpression`. + * But ESTree represents those by `LogicalExpression` node. + * + * This function finds only coalesce expressions of `LogicalExpression` node. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is `??`. + */ +function isCoalesceExpression(node) { + return node.type === "LogicalExpression" && node.operator === "??"; +} + +/** + * Check if given two nodes are the pair of a logical expression and a coalesce expression. + * @param {ASTNode} left A node to check. + * @param {ASTNode} right Another node to check. + * @returns {boolean} `true` if the two nodes are the pair of a logical expression and a coalesce expression. + */ +function isMixedLogicalAndCoalesceExpressions(left, right) { + return ( + (isLogicalExpression(left) && isCoalesceExpression(right)) || + (isCoalesceExpression(left) && isLogicalExpression(right)) + ); +} + +/** + * Checks if the given operator is a logical assignment operator. + * @param {string} operator The operator to check. + * @returns {boolean} `true` if the operator is a logical assignment operator. + */ +function isLogicalAssignmentOperator(operator) { + return LOGICAL_ASSIGNMENT_OPERATORS.has(operator); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + COMMENTS_IGNORE_PATTERN, + LINEBREAKS, + LINEBREAK_MATCHER: lineBreakPattern, + SHEBANG_MATCHER: shebangPattern, + STATEMENT_LIST_PARENTS, + + /** + * Determines whether two adjacent tokens are on the same line. + * @param {Object} left The left token object. + * @param {Object} right The right token object. + * @returns {boolean} Whether or not the tokens are on the same line. + * @public + */ + isTokenOnSameLine(left, right) { + return left.loc.end.line === right.loc.start.line; + }, + + isNullOrUndefined, + isCallee, + isES5Constructor, + getUpperFunction, + isFunction, + isLoop, + isInLoop, + isArrayFromMethod, + isParenthesised, + createGlobalLinebreakMatcher, + equalTokens, + + isArrowToken, + isClosingBraceToken, + isClosingBracketToken, + isClosingParenToken, + isColonToken, + isCommaToken, + isCommentToken, + isDotToken, + isQuestionDotToken, + isKeywordToken, + isNotClosingBraceToken: negate(isClosingBraceToken), + isNotClosingBracketToken: negate(isClosingBracketToken), + isNotClosingParenToken: negate(isClosingParenToken), + isNotColonToken: negate(isColonToken), + isNotCommaToken: negate(isCommaToken), + isNotDotToken: negate(isDotToken), + isNotQuestionDotToken: negate(isQuestionDotToken), + isNotOpeningBraceToken: negate(isOpeningBraceToken), + isNotOpeningBracketToken: negate(isOpeningBracketToken), + isNotOpeningParenToken: negate(isOpeningParenToken), + isNotSemicolonToken: negate(isSemicolonToken), + isOpeningBraceToken, + isOpeningBracketToken, + isOpeningParenToken, + isSemicolonToken, + + /** + * Checks whether or not a given node is a string literal. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a string literal. + */ + isStringLiteral(node) { + return ( + (node.type === "Literal" && typeof node.value === "string") || + node.type === "TemplateLiteral" + ); + }, + + /** + * Checks whether a given node is a breakable statement or not. + * The node is breakable if the node is one of the following type: + * + * - DoWhileStatement + * - ForInStatement + * - ForOfStatement + * - ForStatement + * - SwitchStatement + * - WhileStatement + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is breakable. + */ + isBreakableStatement(node) { + return breakableTypePattern.test(node.type); + }, + + /** + * Gets references which are non initializer and writable. + * @param {Reference[]} references An array of references. + * @returns {Reference[]} An array of only references which are non initializer and writable. + * @public + */ + getModifyingReferences(references) { + return references.filter(isModifyingReference); + }, + + /** + * Validate that a string passed in is surrounded by the specified character + * @param {string} val The text to check. + * @param {string} character The character to see if it's surrounded by. + * @returns {boolean} True if the text is surrounded by the character, false if not. + * @private + */ + isSurroundedBy(val, character) { + return val[0] === character && val[val.length - 1] === character; + }, + + /** + * Returns whether the provided node is an ESLint directive comment or not + * @param {Line|Block} node The comment token to be checked + * @returns {boolean} `true` if the node is an ESLint directive comment + */ + isDirectiveComment(node) { + const comment = node.value.trim(); + + return ( + node.type === "Line" && comment.indexOf("eslint-") === 0 || + node.type === "Block" && ( + comment.indexOf("global ") === 0 || + comment.indexOf("eslint ") === 0 || + comment.indexOf("eslint-") === 0 + ) + ); + }, + + /** + * Gets the trailing statement of a given node. + * + * if (code) + * consequent; + * + * When taking this `IfStatement`, returns `consequent;` statement. + * @param {ASTNode} A node to get. + * @returns {ASTNode|null} The trailing statement's node. + */ + getTrailingStatement: esutils.ast.trailingStatement, + + /** + * Finds the variable by a given name in a given scope and its upper scopes. + * @param {eslint-scope.Scope} initScope A scope to start find. + * @param {string} name A variable name to find. + * @returns {eslint-scope.Variable|null} A found variable or `null`. + */ + getVariableByName(initScope, name) { + let scope = initScope; + + while (scope) { + const variable = scope.set.get(name); + + if (variable) { + return variable; + } + + scope = scope.upper; + } + + return null; + }, + + /** + * Checks whether or not a given function node is the default `this` binding. + * + * First, this checks the node: + * + * - The function name does not start with uppercase. It's a convention to capitalize the names + * of constructor functions. This check is not performed if `capIsConstructor` is set to `false`. + * - The function does not have a JSDoc comment that has a @this tag. + * + * Next, this checks the location of the node. + * If the location is below, this judges `this` is valid. + * + * - The location is not on an object literal. + * - The location is not assigned to a variable which starts with an uppercase letter. Applies to anonymous + * functions only, as the name of the variable is considered to be the name of the function in this case. + * This check is not performed if `capIsConstructor` is set to `false`. + * - The location is not on an ES2015 class. + * - Its `bind`/`call`/`apply` method is not called directly. + * - The function is not a callback of array methods (such as `.forEach()`) if `thisArg` is given. + * @param {ASTNode} node A function node to check. + * @param {SourceCode} sourceCode A SourceCode instance to get comments. + * @param {boolean} [capIsConstructor = true] `false` disables the assumption that functions which name starts + * with an uppercase or are assigned to a variable which name starts with an uppercase are constructors. + * @returns {boolean} The function node is the default `this` binding. + */ + isDefaultThisBinding(node, sourceCode, { capIsConstructor = true } = {}) { + if ( + (capIsConstructor && isES5Constructor(node)) || + hasJSDocThisTag(node, sourceCode) + ) { + return false; + } + const isAnonymous = node.id === null; + let currentNode = node; + + while (currentNode) { + const parent = currentNode.parent; + + switch (parent.type) { + + /* + * Looks up the destination. + * e.g., obj.foo = nativeFoo || function foo() { ... }; + */ + case "LogicalExpression": + case "ConditionalExpression": + case "ChainExpression": + currentNode = parent; + break; + + /* + * If the upper function is IIFE, checks the destination of the return value. + * e.g. + * obj.foo = (function() { + * // setup... + * return function foo() { ... }; + * })(); + * obj.foo = (() => + * function foo() { ... } + * )(); + */ + case "ReturnStatement": { + const func = getUpperFunction(parent); + + if (func === null || !isCallee(func)) { + return true; + } + currentNode = func.parent; + break; + } + case "ArrowFunctionExpression": + if (currentNode !== parent.body || !isCallee(parent)) { + return true; + } + currentNode = parent.parent; + break; + + /* + * e.g. + * var obj = { foo() { ... } }; + * var obj = { foo: function() { ... } }; + * class A { constructor() { ... } } + * class A { foo() { ... } } + * class A { get foo() { ... } } + * class A { set foo() { ... } } + * class A { static foo() { ... } } + */ + case "Property": + case "MethodDefinition": + return parent.value !== currentNode; + + /* + * e.g. + * obj.foo = function foo() { ... }; + * Foo = function() { ... }; + * [obj.foo = function foo() { ... }] = a; + * [Foo = function() { ... }] = a; + */ + case "AssignmentExpression": + case "AssignmentPattern": + if (parent.left.type === "MemberExpression") { + return false; + } + if ( + capIsConstructor && + isAnonymous && + parent.left.type === "Identifier" && + startsWithUpperCase(parent.left.name) + ) { + return false; + } + return true; + + /* + * e.g. + * var Foo = function() { ... }; + */ + case "VariableDeclarator": + return !( + capIsConstructor && + isAnonymous && + parent.init === currentNode && + parent.id.type === "Identifier" && + startsWithUpperCase(parent.id.name) + ); + + /* + * e.g. + * var foo = function foo() { ... }.bind(obj); + * (function foo() { ... }).call(obj); + * (function foo() { ... }).apply(obj, []); + */ + case "MemberExpression": + if ( + parent.object === currentNode && + isSpecificMemberAccess(parent, null, bindOrCallOrApplyPattern) + ) { + const maybeCalleeNode = parent.parent.type === "ChainExpression" + ? parent.parent + : parent; + + return !( + isCallee(maybeCalleeNode) && + maybeCalleeNode.parent.arguments.length >= 1 && + !isNullOrUndefined(maybeCalleeNode.parent.arguments[0]) + ); + } + return true; + + /* + * e.g. + * Reflect.apply(function() {}, obj, []); + * Array.from([], function() {}, obj); + * list.forEach(function() {}, obj); + */ + case "CallExpression": + if (isReflectApply(parent.callee)) { + return ( + parent.arguments.length !== 3 || + parent.arguments[0] !== currentNode || + isNullOrUndefined(parent.arguments[1]) + ); + } + if (isArrayFromMethod(parent.callee)) { + return ( + parent.arguments.length !== 3 || + parent.arguments[1] !== currentNode || + isNullOrUndefined(parent.arguments[2]) + ); + } + if (isMethodWhichHasThisArg(parent.callee)) { + return ( + parent.arguments.length !== 2 || + parent.arguments[0] !== currentNode || + isNullOrUndefined(parent.arguments[1]) + ); + } + return true; + + // Otherwise `this` is default. + default: + return true; + } + } + + /* istanbul ignore next */ + return true; + }, + + /** + * Get the precedence level based on the node type + * @param {ASTNode} node node to evaluate + * @returns {int} precedence level + * @private + */ + getPrecedence(node) { + switch (node.type) { + case "SequenceExpression": + return 0; + + case "AssignmentExpression": + case "ArrowFunctionExpression": + case "YieldExpression": + return 1; + + case "ConditionalExpression": + return 3; + + case "LogicalExpression": + switch (node.operator) { + case "||": + case "??": + return 4; + case "&&": + return 5; + + // no default + } + + /* falls through */ + + case "BinaryExpression": + + switch (node.operator) { + case "|": + return 6; + case "^": + return 7; + case "&": + return 8; + case "==": + case "!=": + case "===": + case "!==": + return 9; + case "<": + case "<=": + case ">": + case ">=": + case "in": + case "instanceof": + return 10; + case "<<": + case ">>": + case ">>>": + return 11; + case "+": + case "-": + return 12; + case "*": + case "/": + case "%": + return 13; + case "**": + return 15; + + // no default + } + + /* falls through */ + + case "UnaryExpression": + case "AwaitExpression": + return 16; + + case "UpdateExpression": + return 17; + + case "CallExpression": + case "ChainExpression": + case "ImportExpression": + return 18; + + case "NewExpression": + return 19; + + default: + return 20; + } + }, + + /** + * Checks whether the given node is an empty block node or not. + * @param {ASTNode|null} node The node to check. + * @returns {boolean} `true` if the node is an empty block. + */ + isEmptyBlock(node) { + return Boolean(node && node.type === "BlockStatement" && node.body.length === 0); + }, + + /** + * Checks whether the given node is an empty function node or not. + * @param {ASTNode|null} node The node to check. + * @returns {boolean} `true` if the node is an empty function. + */ + isEmptyFunction(node) { + return isFunction(node) && module.exports.isEmptyBlock(node.body); + }, + + /** + * Get directives from directive prologue of a Program or Function node. + * @param {ASTNode} node The node to check. + * @returns {ASTNode[]} The directives found in the directive prologue. + */ + getDirectivePrologue(node) { + const directives = []; + + // Directive prologues only occur at the top of files or functions. + if ( + node.type === "Program" || + node.type === "FunctionDeclaration" || + node.type === "FunctionExpression" || + + /* + * Do not check arrow functions with implicit return. + * `() => "use strict";` returns the string `"use strict"`. + */ + (node.type === "ArrowFunctionExpression" && node.body.type === "BlockStatement") + ) { + const statements = node.type === "Program" ? node.body : node.body.body; + + for (const statement of statements) { + if ( + statement.type === "ExpressionStatement" && + statement.expression.type === "Literal" + ) { + directives.push(statement); + } else { + break; + } + } + } + + return directives; + }, + + + /** + * Determines whether this node is a decimal integer literal. If a node is a decimal integer literal, a dot added + * after the node will be parsed as a decimal point, rather than a property-access dot. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if this node is a decimal integer. + * @example + * + * 0 // true + * 5 // true + * 50 // true + * 5_000 // true + * 1_234_56 // true + * 08 // true + * 0192 // true + * 5. // false + * .5 // false + * 5.0 // false + * 5.00_00 // false + * 05 // false + * 0x5 // false + * 0b101 // false + * 0b11_01 // false + * 0o5 // false + * 5e0 // false + * 5e1_000 // false + * 5n // false + * 1_000n // false + * '5' // false + */ + isDecimalInteger(node) { + return node.type === "Literal" && typeof node.value === "number" && + DECIMAL_INTEGER_PATTERN.test(node.raw); + }, + + /** + * Determines whether this token is a decimal integer numeric token. + * This is similar to isDecimalInteger(), but for tokens. + * @param {Token} token The token to check. + * @returns {boolean} `true` if this token is a decimal integer. + */ + isDecimalIntegerNumericToken(token) { + return token.type === "Numeric" && DECIMAL_INTEGER_PATTERN.test(token.value); + }, + + /** + * Gets the name and kind of the given function node. + * + * - `function foo() {}` .................... `function 'foo'` + * - `(function foo() {})` .................. `function 'foo'` + * - `(function() {})` ...................... `function` + * - `function* foo() {}` ................... `generator function 'foo'` + * - `(function* foo() {})` ................. `generator function 'foo'` + * - `(function*() {})` ..................... `generator function` + * - `() => {}` ............................. `arrow function` + * - `async () => {}` ....................... `async arrow function` + * - `({ foo: function foo() {} })` ......... `method 'foo'` + * - `({ foo: function() {} })` ............. `method 'foo'` + * - `({ ['foo']: function() {} })` ......... `method 'foo'` + * - `({ [foo]: function() {} })` ........... `method` + * - `({ foo() {} })` ....................... `method 'foo'` + * - `({ foo: function* foo() {} })` ........ `generator method 'foo'` + * - `({ foo: function*() {} })` ............ `generator method 'foo'` + * - `({ ['foo']: function*() {} })` ........ `generator method 'foo'` + * - `({ [foo]: function*() {} })` .......... `generator method` + * - `({ *foo() {} })` ...................... `generator method 'foo'` + * - `({ foo: async function foo() {} })` ... `async method 'foo'` + * - `({ foo: async function() {} })` ....... `async method 'foo'` + * - `({ ['foo']: async function() {} })` ... `async method 'foo'` + * - `({ [foo]: async function() {} })` ..... `async method` + * - `({ async foo() {} })` ................. `async method 'foo'` + * - `({ get foo() {} })` ................... `getter 'foo'` + * - `({ set foo(a) {} })` .................. `setter 'foo'` + * - `class A { constructor() {} }` ......... `constructor` + * - `class A { foo() {} }` ................. `method 'foo'` + * - `class A { *foo() {} }` ................ `generator method 'foo'` + * - `class A { async foo() {} }` ........... `async method 'foo'` + * - `class A { ['foo']() {} }` ............. `method 'foo'` + * - `class A { *['foo']() {} }` ............ `generator method 'foo'` + * - `class A { async ['foo']() {} }` ....... `async method 'foo'` + * - `class A { [foo]() {} }` ............... `method` + * - `class A { *[foo]() {} }` .............. `generator method` + * - `class A { async [foo]() {} }` ......... `async method` + * - `class A { get foo() {} }` ............. `getter 'foo'` + * - `class A { set foo(a) {} }` ............ `setter 'foo'` + * - `class A { static foo() {} }` .......... `static method 'foo'` + * - `class A { static *foo() {} }` ......... `static generator method 'foo'` + * - `class A { static async foo() {} }` .... `static async method 'foo'` + * - `class A { static get foo() {} }` ...... `static getter 'foo'` + * - `class A { static set foo(a) {} }` ..... `static setter 'foo'` + * @param {ASTNode} node The function node to get. + * @returns {string} The name and kind of the function node. + */ + getFunctionNameWithKind(node) { + const parent = node.parent; + const tokens = []; + + if (parent.type === "MethodDefinition" && parent.static) { + tokens.push("static"); + } + if (node.async) { + tokens.push("async"); + } + if (node.generator) { + tokens.push("generator"); + } + + if (node.type === "ArrowFunctionExpression") { + tokens.push("arrow", "function"); + } else if (parent.type === "Property" || parent.type === "MethodDefinition") { + if (parent.kind === "constructor") { + return "constructor"; + } + if (parent.kind === "get") { + tokens.push("getter"); + } else if (parent.kind === "set") { + tokens.push("setter"); + } else { + tokens.push("method"); + } + } else { + tokens.push("function"); + } + + if (node.id) { + tokens.push(`'${node.id.name}'`); + } else { + const name = getStaticPropertyName(parent); + + if (name !== null) { + tokens.push(`'${name}'`); + } + } + + return tokens.join(" "); + }, + + /** + * Gets the location of the given function node for reporting. + * + * - `function foo() {}` + * ^^^^^^^^^^^^ + * - `(function foo() {})` + * ^^^^^^^^^^^^ + * - `(function() {})` + * ^^^^^^^^ + * - `function* foo() {}` + * ^^^^^^^^^^^^^ + * - `(function* foo() {})` + * ^^^^^^^^^^^^^ + * - `(function*() {})` + * ^^^^^^^^^ + * - `() => {}` + * ^^ + * - `async () => {}` + * ^^ + * - `({ foo: function foo() {} })` + * ^^^^^^^^^^^^^^^^^ + * - `({ foo: function() {} })` + * ^^^^^^^^^^^^^ + * - `({ ['foo']: function() {} })` + * ^^^^^^^^^^^^^^^^^ + * - `({ [foo]: function() {} })` + * ^^^^^^^^^^^^^^^ + * - `({ foo() {} })` + * ^^^ + * - `({ foo: function* foo() {} })` + * ^^^^^^^^^^^^^^^^^^ + * - `({ foo: function*() {} })` + * ^^^^^^^^^^^^^^ + * - `({ ['foo']: function*() {} })` + * ^^^^^^^^^^^^^^^^^^ + * - `({ [foo]: function*() {} })` + * ^^^^^^^^^^^^^^^^ + * - `({ *foo() {} })` + * ^^^^ + * - `({ foo: async function foo() {} })` + * ^^^^^^^^^^^^^^^^^^^^^^^ + * - `({ foo: async function() {} })` + * ^^^^^^^^^^^^^^^^^^^ + * - `({ ['foo']: async function() {} })` + * ^^^^^^^^^^^^^^^^^^^^^^^ + * - `({ [foo]: async function() {} })` + * ^^^^^^^^^^^^^^^^^^^^^ + * - `({ async foo() {} })` + * ^^^^^^^^^ + * - `({ get foo() {} })` + * ^^^^^^^ + * - `({ set foo(a) {} })` + * ^^^^^^^ + * - `class A { constructor() {} }` + * ^^^^^^^^^^^ + * - `class A { foo() {} }` + * ^^^ + * - `class A { *foo() {} }` + * ^^^^ + * - `class A { async foo() {} }` + * ^^^^^^^^^ + * - `class A { ['foo']() {} }` + * ^^^^^^^ + * - `class A { *['foo']() {} }` + * ^^^^^^^^ + * - `class A { async ['foo']() {} }` + * ^^^^^^^^^^^^^ + * - `class A { [foo]() {} }` + * ^^^^^ + * - `class A { *[foo]() {} }` + * ^^^^^^ + * - `class A { async [foo]() {} }` + * ^^^^^^^^^^^ + * - `class A { get foo() {} }` + * ^^^^^^^ + * - `class A { set foo(a) {} }` + * ^^^^^^^ + * - `class A { static foo() {} }` + * ^^^^^^^^^^ + * - `class A { static *foo() {} }` + * ^^^^^^^^^^^ + * - `class A { static async foo() {} }` + * ^^^^^^^^^^^^^^^^ + * - `class A { static get foo() {} }` + * ^^^^^^^^^^^^^^ + * - `class A { static set foo(a) {} }` + * ^^^^^^^^^^^^^^ + * @param {ASTNode} node The function node to get. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {string} The location of the function node for reporting. + */ + getFunctionHeadLoc(node, sourceCode) { + const parent = node.parent; + let start = null; + let end = null; + + if (node.type === "ArrowFunctionExpression") { + const arrowToken = sourceCode.getTokenBefore(node.body, isArrowToken); + + start = arrowToken.loc.start; + end = arrowToken.loc.end; + } else if (parent.type === "Property" || parent.type === "MethodDefinition") { + start = parent.loc.start; + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } else { + start = node.loc.start; + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } + + return { + start: Object.assign({}, start), + end: Object.assign({}, end) + }; + }, + + /** + * Gets next location when the result is not out of bound, otherwise returns null. + * + * Assumptions: + * + * - The given location represents a valid location in the given source code. + * - Columns are 0-based. + * - Lines are 1-based. + * - Column immediately after the last character in a line (not incl. linebreaks) is considered to be a valid location. + * - If the source code ends with a linebreak, `sourceCode.lines` array will have an extra element (empty string) at the end. + * The start (column 0) of that extra line is considered to be a valid location. + * + * Examples of successive locations (line, column): + * + * code: foo + * locations: (1, 0) -> (1, 1) -> (1, 2) -> (1, 3) -> null + * + * code: foo + * locations: (1, 0) -> (1, 1) -> (1, 2) -> (1, 3) -> (2, 0) -> null + * + * code: foo + * locations: (1, 0) -> (1, 1) -> (1, 2) -> (1, 3) -> (2, 0) -> null + * + * code: ab + * locations: (1, 0) -> (1, 1) -> (2, 0) -> (2, 1) -> null + * + * code: ab + * locations: (1, 0) -> (1, 1) -> (2, 0) -> (2, 1) -> (3, 0) -> null + * + * code: ab + * locations: (1, 0) -> (1, 1) -> (2, 0) -> (2, 1) -> (3, 0) -> null + * + * code: a + * locations: (1, 0) -> (1, 1) -> (2, 0) -> (3, 0) -> null + * + * code: + * locations: (1, 0) -> (2, 0) -> null + * + * code: + * locations: (1, 0) -> null + * @param {SourceCode} sourceCode The sourceCode + * @param {{line: number, column: number}} location The location + * @returns {{line: number, column: number} | null} Next location + */ + getNextLocation(sourceCode, { line, column }) { + if (column < sourceCode.lines[line - 1].length) { + return { + line, + column: column + 1 + }; + } + + if (line < sourceCode.lines.length) { + return { + line: line + 1, + column: 0 + }; + } + + return null; + }, + + /** + * Gets the parenthesized text of a node. This is similar to sourceCode.getText(node), but it also includes any parentheses + * surrounding the node. + * @param {SourceCode} sourceCode The source code object + * @param {ASTNode} node An expression node + * @returns {string} The text representing the node, with all surrounding parentheses included + */ + getParenthesisedText(sourceCode, node) { + let leftToken = sourceCode.getFirstToken(node); + let rightToken = sourceCode.getLastToken(node); + + while ( + sourceCode.getTokenBefore(leftToken) && + sourceCode.getTokenBefore(leftToken).type === "Punctuator" && + sourceCode.getTokenBefore(leftToken).value === "(" && + sourceCode.getTokenAfter(rightToken) && + sourceCode.getTokenAfter(rightToken).type === "Punctuator" && + sourceCode.getTokenAfter(rightToken).value === ")" + ) { + leftToken = sourceCode.getTokenBefore(leftToken); + rightToken = sourceCode.getTokenAfter(rightToken); + } + + return sourceCode.getText().slice(leftToken.range[0], rightToken.range[1]); + }, + + /* + * Determine if a node has a possiblity to be an Error object + * @param {ASTNode} node ASTNode to check + * @returns {boolean} True if there is a chance it contains an Error obj + */ + couldBeError(node) { + switch (node.type) { + case "Identifier": + case "CallExpression": + case "NewExpression": + case "MemberExpression": + case "TaggedTemplateExpression": + case "YieldExpression": + case "AwaitExpression": + case "ChainExpression": + return true; // possibly an error object. + + case "AssignmentExpression": + if (["=", "&&="].includes(node.operator)) { + return module.exports.couldBeError(node.right); + } + + if (["||=", "??="].includes(node.operator)) { + return module.exports.couldBeError(node.left) || module.exports.couldBeError(node.right); + } + + /** + * All other assignment operators are mathematical assignment operators (arithmetic or bitwise). + * An assignment expression with a mathematical operator can either evaluate to a primitive value, + * or throw, depending on the operands. Thus, it cannot evaluate to an `Error` object. + */ + return false; + + case "SequenceExpression": { + const exprs = node.expressions; + + return exprs.length !== 0 && module.exports.couldBeError(exprs[exprs.length - 1]); + } + + case "LogicalExpression": + return module.exports.couldBeError(node.left) || module.exports.couldBeError(node.right); + + case "ConditionalExpression": + return module.exports.couldBeError(node.consequent) || module.exports.couldBeError(node.alternate); + + default: + return false; + } + }, + + /** + * Check if a given node is a numeric literal or not. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is a number or bigint literal. + */ + isNumericLiteral(node) { + return ( + node.type === "Literal" && + (typeof node.value === "number" || Boolean(node.bigint)) + ); + }, + + /** + * Determines whether two tokens can safely be placed next to each other without merging into a single token + * @param {Token|string} leftValue The left token. If this is a string, it will be tokenized and the last token will be used. + * @param {Token|string} rightValue The right token. If this is a string, it will be tokenized and the first token will be used. + * @returns {boolean} If the tokens cannot be safely placed next to each other, returns `false`. If the tokens can be placed + * next to each other, behavior is undefined (although it should return `true` in most cases). + */ + canTokensBeAdjacent(leftValue, rightValue) { + const espreeOptions = { + ecmaVersion: espree.latestEcmaVersion, + comment: true, + range: true + }; + + let leftToken; + + if (typeof leftValue === "string") { + let tokens; + + try { + tokens = espree.tokenize(leftValue, espreeOptions); + } catch { + return false; + } + + const comments = tokens.comments; + + leftToken = tokens[tokens.length - 1]; + if (comments.length) { + const lastComment = comments[comments.length - 1]; + + if (lastComment.range[0] > leftToken.range[0]) { + leftToken = lastComment; + } + } + } else { + leftToken = leftValue; + } + + if (leftToken.type === "Shebang") { + return false; + } + + let rightToken; + + if (typeof rightValue === "string") { + let tokens; + + try { + tokens = espree.tokenize(rightValue, espreeOptions); + } catch { + return false; + } + + const comments = tokens.comments; + + rightToken = tokens[0]; + if (comments.length) { + const firstComment = comments[0]; + + if (firstComment.range[0] < rightToken.range[0]) { + rightToken = firstComment; + } + } + } else { + rightToken = rightValue; + } + + if (leftToken.type === "Punctuator" || rightToken.type === "Punctuator") { + if (leftToken.type === "Punctuator" && rightToken.type === "Punctuator") { + const PLUS_TOKENS = new Set(["+", "++"]); + const MINUS_TOKENS = new Set(["-", "--"]); + + return !( + PLUS_TOKENS.has(leftToken.value) && PLUS_TOKENS.has(rightToken.value) || + MINUS_TOKENS.has(leftToken.value) && MINUS_TOKENS.has(rightToken.value) + ); + } + if (leftToken.type === "Punctuator" && leftToken.value === "/") { + return !["Block", "Line", "RegularExpression"].includes(rightToken.type); + } + return true; + } + + if ( + leftToken.type === "String" || rightToken.type === "String" || + leftToken.type === "Template" || rightToken.type === "Template" + ) { + return true; + } + + if (leftToken.type !== "Numeric" && rightToken.type === "Numeric" && rightToken.value.startsWith(".")) { + return true; + } + + if (leftToken.type === "Block" || rightToken.type === "Block" || rightToken.type === "Line") { + return true; + } + + return false; + }, + + /** + * Get the `loc` object of a given name in a `/*globals` directive comment. + * @param {SourceCode} sourceCode The source code to convert index to loc. + * @param {Comment} comment The `/*globals` directive comment which include the name. + * @param {string} name The name to find. + * @returns {SourceLocation} The `loc` object. + */ + getNameLocationInGlobalDirectiveComment(sourceCode, comment, name) { + const namePattern = new RegExp(`[\\s,]${lodash.escapeRegExp(name)}(?:$|[\\s,:])`, "gu"); + + // To ignore the first text "global". + namePattern.lastIndex = comment.value.indexOf("global") + 6; + + // Search a given variable name. + const match = namePattern.exec(comment.value); + + // Convert the index to loc. + const start = sourceCode.getLocFromIndex( + comment.range[0] + + "/*".length + + (match ? match.index + 1 : 0) + ); + const end = { + line: start.line, + column: start.column + (match ? name.length : 1) + }; + + return { start, end }; + }, + + /** + * Determines whether the given raw string contains an octal escape sequence. + * + * "\1", "\2" ... "\7" + * "\00", "\01" ... "\09" + * + * "\0", when not followed by a digit, is not an octal escape sequence. + * @param {string} rawString A string in its raw representation. + * @returns {boolean} `true` if the string contains at least one octal escape sequence. + */ + hasOctalEscapeSequence(rawString) { + return OCTAL_ESCAPE_PATTERN.test(rawString); + }, + + isLogicalExpression, + isCoalesceExpression, + isMixedLogicalAndCoalesceExpressions, + isNullLiteral, + getStaticStringValue, + getStaticPropertyName, + skipChainExpression, + isSpecificId, + isSpecificMemberAccess, + equalLiteralValue, + isSameReference, + isLogicalAssignmentOperator +}; diff --git a/node_modules/eslint/lib/rules/utils/fix-tracker.js b/node_modules/eslint/lib/rules/utils/fix-tracker.js new file mode 100644 index 000000000..589870b39 --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/fix-tracker.js @@ -0,0 +1,114 @@ +/** + * @fileoverview Helper class to aid in constructing fix commands. + * @author Alan Pierce + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./ast-utils"); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * A helper class to combine fix options into a fix command. Currently, it + * exposes some "retain" methods that extend the range of the text being + * replaced so that other fixes won't touch that region in the same pass. + */ +class FixTracker { + + /** + * Create a new FixTracker. + * @param {ruleFixer} fixer A ruleFixer instance. + * @param {SourceCode} sourceCode A SourceCode object for the current code. + */ + constructor(fixer, sourceCode) { + this.fixer = fixer; + this.sourceCode = sourceCode; + this.retainedRange = null; + } + + /** + * Mark the given range as "retained", meaning that other fixes may not + * may not modify this region in the same pass. + * @param {int[]} range The range to retain. + * @returns {FixTracker} The same RuleFixer, for chained calls. + */ + retainRange(range) { + this.retainedRange = range; + return this; + } + + /** + * Given a node, find the function containing it (or the entire program) and + * mark it as retained, meaning that other fixes may not modify it in this + * pass. This is useful for avoiding conflicts in fixes that modify control + * flow. + * @param {ASTNode} node The node to use as a starting point. + * @returns {FixTracker} The same RuleFixer, for chained calls. + */ + retainEnclosingFunction(node) { + const functionNode = astUtils.getUpperFunction(node); + + return this.retainRange(functionNode ? functionNode.range : this.sourceCode.ast.range); + } + + /** + * Given a node or token, find the token before and afterward, and mark that + * range as retained, meaning that other fixes may not modify it in this + * pass. This is useful for avoiding conflicts in fixes that make a small + * change to the code where the AST should not be changed. + * @param {ASTNode|Token} nodeOrToken The node or token to use as a starting + * point. The token to the left and right are use in the range. + * @returns {FixTracker} The same RuleFixer, for chained calls. + */ + retainSurroundingTokens(nodeOrToken) { + const tokenBefore = this.sourceCode.getTokenBefore(nodeOrToken) || nodeOrToken; + const tokenAfter = this.sourceCode.getTokenAfter(nodeOrToken) || nodeOrToken; + + return this.retainRange([tokenBefore.range[0], tokenAfter.range[1]]); + } + + /** + * Create a fix command that replaces the given range with the given text, + * accounting for any retained ranges. + * @param {int[]} range The range to remove in the fix. + * @param {string} text The text to insert in place of the range. + * @returns {Object} The fix command. + */ + replaceTextRange(range, text) { + let actualRange; + + if (this.retainedRange) { + actualRange = [ + Math.min(this.retainedRange[0], range[0]), + Math.max(this.retainedRange[1], range[1]) + ]; + } else { + actualRange = range; + } + + return this.fixer.replaceTextRange( + actualRange, + this.sourceCode.text.slice(actualRange[0], range[0]) + + text + + this.sourceCode.text.slice(range[1], actualRange[1]) + ); + } + + /** + * Create a fix command that removes the given node or token, accounting for + * any retained ranges. + * @param {ASTNode|Token} nodeOrToken The node or token to remove. + * @returns {Object} The fix command. + */ + remove(nodeOrToken) { + return this.replaceTextRange(nodeOrToken.range, ""); + } +} + +module.exports = FixTracker; diff --git a/node_modules/eslint/lib/rules/utils/keywords.js b/node_modules/eslint/lib/rules/utils/keywords.js new file mode 100644 index 000000000..3fbb77771 --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/keywords.js @@ -0,0 +1,67 @@ +/** + * @fileoverview A shared list of ES3 keywords. + * @author Josh Perez + */ +"use strict"; + +module.exports = [ + "abstract", + "boolean", + "break", + "byte", + "case", + "catch", + "char", + "class", + "const", + "continue", + "debugger", + "default", + "delete", + "do", + "double", + "else", + "enum", + "export", + "extends", + "false", + "final", + "finally", + "float", + "for", + "function", + "goto", + "if", + "implements", + "import", + "in", + "instanceof", + "int", + "interface", + "long", + "native", + "new", + "null", + "package", + "private", + "protected", + "public", + "return", + "short", + "static", + "super", + "switch", + "synchronized", + "this", + "throw", + "throws", + "transient", + "true", + "try", + "typeof", + "var", + "void", + "volatile", + "while", + "with" +]; diff --git a/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js b/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js new file mode 100644 index 000000000..d426d85c5 --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js @@ -0,0 +1,115 @@ +/** + * @fileoverview `Map` to load rules lazily. + * @author Toru Nagashima + */ +"use strict"; + +const debug = require("debug")("eslint:rules"); + +/** @typedef {import("./types").Rule} Rule */ + +/** + * The `Map` object that loads each rule when it's accessed. + * @example + * const rules = new LazyLoadingRuleMap([ + * ["eqeqeq", () => require("eqeqeq")], + * ["semi", () => require("semi")], + * ["no-unused-vars", () => require("no-unused-vars")], + * ]) + * + * rules.get("semi") // call `() => require("semi")` here. + * + * @extends {Map Rule>} + */ +class LazyLoadingRuleMap extends Map { + + /** + * Initialize this map. + * @param {Array<[string, function(): Rule]>} loaders The rule loaders. + */ + constructor(loaders) { + let remaining = loaders.length; + + super( + debug.enabled + ? loaders.map(([ruleId, load]) => { + let cache = null; + + return [ + ruleId, + () => { + if (!cache) { + debug("Loading rule %o (remaining=%d)", ruleId, --remaining); + cache = load(); + } + return cache; + } + ]; + }) + : loaders + ); + + // `super(...iterable)` uses `this.set()`, so disable it here. + Object.defineProperty(LazyLoadingRuleMap.prototype, "set", { + configurable: true, + value: void 0 + }); + } + + /** + * Get a rule. + * Each rule will be loaded on the first access. + * @param {string} ruleId The rule ID to get. + * @returns {Rule|undefined} The rule. + */ + get(ruleId) { + const load = super.get(ruleId); + + return load && load(); + } + + /** + * Iterate rules. + * @returns {IterableIterator} Rules. + */ + *values() { + for (const load of super.values()) { + yield load(); + } + } + + /** + * Iterate rules. + * @returns {IterableIterator<[string, Rule]>} Rules. + */ + *entries() { + for (const [ruleId, load] of super.entries()) { + yield [ruleId, load()]; + } + } + + /** + * Call a function with each rule. + * @param {Function} callbackFn The callback function. + * @param {any} [thisArg] The object to pass to `this` of the callback function. + * @returns {void} + */ + forEach(callbackFn, thisArg) { + for (const [ruleId, load] of super.entries()) { + callbackFn.call(thisArg, load(), ruleId, this); + } + } +} + +// Forbid mutation. +Object.defineProperties(LazyLoadingRuleMap.prototype, { + clear: { configurable: true, value: void 0 }, + delete: { configurable: true, value: void 0 }, + [Symbol.iterator]: { + configurable: true, + writable: true, + value: LazyLoadingRuleMap.prototype.entries + } +}); + +module.exports = { LazyLoadingRuleMap }; diff --git a/node_modules/eslint/lib/rules/utils/patterns/letters.js b/node_modules/eslint/lib/rules/utils/patterns/letters.js new file mode 100644 index 000000000..9bb2de310 --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/patterns/letters.js @@ -0,0 +1,36 @@ +/** + * @fileoverview Pattern for detecting any letter (even letters outside of ASCII). + * NOTE: This file was generated using this script in JSCS based on the Unicode 7.0.0 standard: https://github.com/jscs-dev/node-jscs/blob/f5ed14427deb7e7aac84f3056a5aab2d9f3e563e/publish/helpers/generate-patterns.js + * Do not edit this file by hand-- please use https://github.com/mathiasbynens/regenerate to regenerate the regular expression exported from this file. + * @author Kevin Partington + * @license MIT License (from JSCS). See below. + */ + +/* + * The MIT License (MIT) + * + * Copyright 2013-2016 Dulin Marat and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +"use strict"; + +module.exports = /[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/u; diff --git a/node_modules/eslint/lib/rules/utils/unicode/index.js b/node_modules/eslint/lib/rules/utils/unicode/index.js new file mode 100644 index 000000000..02eea502d --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/unicode/index.js @@ -0,0 +1,11 @@ +/** + * @author Toru Nagashima + */ +"use strict"; + +module.exports = { + isCombiningCharacter: require("./is-combining-character"), + isEmojiModifier: require("./is-emoji-modifier"), + isRegionalIndicatorSymbol: require("./is-regional-indicator-symbol"), + isSurrogatePair: require("./is-surrogate-pair") +}; diff --git a/node_modules/eslint/lib/rules/utils/unicode/is-combining-character.js b/node_modules/eslint/lib/rules/utils/unicode/is-combining-character.js new file mode 100644 index 000000000..0498b99a2 --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/unicode/is-combining-character.js @@ -0,0 +1,13 @@ +/** + * @author Toru Nagashima + */ +"use strict"; + +/** + * Check whether a given character is a combining mark or not. + * @param {number} codePoint The character code to check. + * @returns {boolean} `true` if the character belongs to the category, any of `Mc`, `Me`, and `Mn`. + */ +module.exports = function isCombiningCharacter(codePoint) { + return /^[\p{Mc}\p{Me}\p{Mn}]$/u.test(String.fromCodePoint(codePoint)); +}; diff --git a/node_modules/eslint/lib/rules/utils/unicode/is-emoji-modifier.js b/node_modules/eslint/lib/rules/utils/unicode/is-emoji-modifier.js new file mode 100644 index 000000000..1bd5f557d --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/unicode/is-emoji-modifier.js @@ -0,0 +1,13 @@ +/** + * @author Toru Nagashima + */ +"use strict"; + +/** + * Check whether a given character is an emoji modifier. + * @param {number} code The character code to check. + * @returns {boolean} `true` if the character is an emoji modifier. + */ +module.exports = function isEmojiModifier(code) { + return code >= 0x1F3FB && code <= 0x1F3FF; +}; diff --git a/node_modules/eslint/lib/rules/utils/unicode/is-regional-indicator-symbol.js b/node_modules/eslint/lib/rules/utils/unicode/is-regional-indicator-symbol.js new file mode 100644 index 000000000..c48ed46ef --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/unicode/is-regional-indicator-symbol.js @@ -0,0 +1,13 @@ +/** + * @author Toru Nagashima + */ +"use strict"; + +/** + * Check whether a given character is a regional indicator symbol. + * @param {number} code The character code to check. + * @returns {boolean} `true` if the character is a regional indicator symbol. + */ +module.exports = function isRegionalIndicatorSymbol(code) { + return code >= 0x1F1E6 && code <= 0x1F1FF; +}; diff --git a/node_modules/eslint/lib/rules/utils/unicode/is-surrogate-pair.js b/node_modules/eslint/lib/rules/utils/unicode/is-surrogate-pair.js new file mode 100644 index 000000000..b8e5c1cac --- /dev/null +++ b/node_modules/eslint/lib/rules/utils/unicode/is-surrogate-pair.js @@ -0,0 +1,14 @@ +/** + * @author Toru Nagashima + */ +"use strict"; + +/** + * Check whether given two characters are a surrogate pair. + * @param {number} lead The code of the lead character. + * @param {number} tail The code of the tail character. + * @returns {boolean} `true` if the character pair is a surrogate pair. + */ +module.exports = function isSurrogatePair(lead, tail) { + return lead >= 0xD800 && lead < 0xDC00 && tail >= 0xDC00 && tail < 0xE000; +}; diff --git a/node_modules/eslint/lib/rules/valid-jsdoc.js b/node_modules/eslint/lib/rules/valid-jsdoc.js new file mode 100644 index 000000000..9ec6938e3 --- /dev/null +++ b/node_modules/eslint/lib/rules/valid-jsdoc.js @@ -0,0 +1,515 @@ +/** + * @fileoverview Validates JSDoc comments are syntactically correct + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const doctrine = require("doctrine"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce valid JSDoc comments", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/valid-jsdoc" + }, + + schema: [ + { + type: "object", + properties: { + prefer: { + type: "object", + additionalProperties: { + type: "string" + } + }, + preferType: { + type: "object", + additionalProperties: { + type: "string" + } + }, + requireReturn: { + type: "boolean", + default: true + }, + requireParamDescription: { + type: "boolean", + default: true + }, + requireReturnDescription: { + type: "boolean", + default: true + }, + matchDescription: { + type: "string" + }, + requireReturnType: { + type: "boolean", + default: true + }, + requireParamType: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + fixable: "code", + messages: { + unexpectedTag: "Unexpected @{{title}} tag; function has no return statement.", + expected: "Expected JSDoc for '{{name}}' but found '{{jsdocName}}'.", + use: "Use @{{name}} instead.", + useType: "Use '{{expectedTypeName}}' instead of '{{currentTypeName}}'.", + syntaxError: "JSDoc syntax error.", + missingBrace: "JSDoc type missing brace.", + missingParamDesc: "Missing JSDoc parameter description for '{{name}}'.", + missingParamType: "Missing JSDoc parameter type for '{{name}}'.", + missingReturnType: "Missing JSDoc return type.", + missingReturnDesc: "Missing JSDoc return description.", + missingReturn: "Missing JSDoc @{{returns}} for function.", + missingParam: "Missing JSDoc for parameter '{{name}}'.", + duplicateParam: "Duplicate JSDoc parameter '{{name}}'.", + unsatisfiedDesc: "JSDoc description does not satisfy the regex pattern." + }, + + deprecated: true, + replacedBy: [] + }, + + create(context) { + + const options = context.options[0] || {}, + prefer = options.prefer || {}, + sourceCode = context.getSourceCode(), + + // these both default to true, so you have to explicitly make them false + requireReturn = options.requireReturn !== false, + requireParamDescription = options.requireParamDescription !== false, + requireReturnDescription = options.requireReturnDescription !== false, + requireReturnType = options.requireReturnType !== false, + requireParamType = options.requireParamType !== false, + preferType = options.preferType || {}, + checkPreferType = Object.keys(preferType).length !== 0; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // Using a stack to store if a function returns or not (handling nested functions) + const fns = []; + + /** + * Check if node type is a Class + * @param {ASTNode} node node to check. + * @returns {boolean} True is its a class + * @private + */ + function isTypeClass(node) { + return node.type === "ClassExpression" || node.type === "ClassDeclaration"; + } + + /** + * When parsing a new function, store it in our function stack. + * @param {ASTNode} node A function node to check. + * @returns {void} + * @private + */ + function startFunction(node) { + fns.push({ + returnPresent: (node.type === "ArrowFunctionExpression" && node.body.type !== "BlockStatement") || + isTypeClass(node) || node.async + }); + } + + /** + * Indicate that return has been found in the current function. + * @param {ASTNode} node The return node. + * @returns {void} + * @private + */ + function addReturn(node) { + const functionState = fns[fns.length - 1]; + + if (functionState && node.argument !== null) { + functionState.returnPresent = true; + } + } + + /** + * Check if return tag type is void or undefined + * @param {Object} tag JSDoc tag + * @returns {boolean} True if its of type void or undefined + * @private + */ + function isValidReturnType(tag) { + return tag.type === null || tag.type.name === "void" || tag.type.type === "UndefinedLiteral"; + } + + /** + * Check if type should be validated based on some exceptions + * @param {Object} type JSDoc tag + * @returns {boolean} True if it can be validated + * @private + */ + function canTypeBeValidated(type) { + return type !== "UndefinedLiteral" && // {undefined} as there is no name property available. + type !== "NullLiteral" && // {null} + type !== "NullableLiteral" && // {?} + type !== "FunctionType" && // {function(a)} + type !== "AllLiteral"; // {*} + } + + /** + * Extract the current and expected type based on the input type object + * @param {Object} type JSDoc tag + * @returns {{currentType: Doctrine.Type, expectedTypeName: string}} The current type annotation and + * the expected name of the annotation + * @private + */ + function getCurrentExpectedTypes(type) { + let currentType; + + if (type.name) { + currentType = type; + } else if (type.expression) { + currentType = type.expression; + } + + return { + currentType, + expectedTypeName: currentType && preferType[currentType.name] + }; + } + + /** + * Gets the location of a JSDoc node in a file + * @param {Token} jsdocComment The comment that this node is parsed from + * @param {{range: number[]}} parsedJsdocNode A tag or other node which was parsed from this comment + * @returns {{start: SourceLocation, end: SourceLocation}} The 0-based source location for the tag + */ + function getAbsoluteRange(jsdocComment, parsedJsdocNode) { + return { + start: sourceCode.getLocFromIndex(jsdocComment.range[0] + 2 + parsedJsdocNode.range[0]), + end: sourceCode.getLocFromIndex(jsdocComment.range[0] + 2 + parsedJsdocNode.range[1]) + }; + } + + /** + * Validate type for a given JSDoc node + * @param {Object} jsdocNode JSDoc node + * @param {Object} type JSDoc tag + * @returns {void} + * @private + */ + function validateType(jsdocNode, type) { + if (!type || !canTypeBeValidated(type.type)) { + return; + } + + const typesToCheck = []; + let elements = []; + + switch (type.type) { + case "TypeApplication": // {Array.} + elements = type.applications[0].type === "UnionType" ? type.applications[0].elements : type.applications; + typesToCheck.push(getCurrentExpectedTypes(type)); + break; + case "RecordType": // {{20:String}} + elements = type.fields; + break; + case "UnionType": // {String|number|Test} + case "ArrayType": // {[String, number, Test]} + elements = type.elements; + break; + case "FieldType": // Array.<{count: number, votes: number}> + if (type.value) { + typesToCheck.push(getCurrentExpectedTypes(type.value)); + } + break; + default: + typesToCheck.push(getCurrentExpectedTypes(type)); + } + + elements.forEach(validateType.bind(null, jsdocNode)); + + typesToCheck.forEach(typeToCheck => { + if (typeToCheck.expectedTypeName && + typeToCheck.expectedTypeName !== typeToCheck.currentType.name) { + context.report({ + node: jsdocNode, + messageId: "useType", + loc: getAbsoluteRange(jsdocNode, typeToCheck.currentType), + data: { + currentTypeName: typeToCheck.currentType.name, + expectedTypeName: typeToCheck.expectedTypeName + }, + fix(fixer) { + return fixer.replaceTextRange( + typeToCheck.currentType.range.map(indexInComment => jsdocNode.range[0] + 2 + indexInComment), + typeToCheck.expectedTypeName + ); + } + }); + } + }); + } + + /** + * Validate the JSDoc node and output warnings if anything is wrong. + * @param {ASTNode} node The AST node to check. + * @returns {void} + * @private + */ + function checkJSDoc(node) { + const jsdocNode = sourceCode.getJSDocComment(node), + functionData = fns.pop(), + paramTagsByName = Object.create(null), + paramTags = []; + let hasReturns = false, + returnsTag, + hasConstructor = false, + isInterface = false, + isOverride = false, + isAbstract = false; + + // make sure only to validate JSDoc comments + if (jsdocNode) { + let jsdoc; + + try { + jsdoc = doctrine.parse(jsdocNode.value, { + strict: true, + unwrap: true, + sloppy: true, + range: true + }); + } catch (ex) { + + if (/braces/iu.test(ex.message)) { + context.report({ node: jsdocNode, messageId: "missingBrace" }); + } else { + context.report({ node: jsdocNode, messageId: "syntaxError" }); + } + + return; + } + + jsdoc.tags.forEach(tag => { + + switch (tag.title.toLowerCase()) { + + case "param": + case "arg": + case "argument": + paramTags.push(tag); + break; + + case "return": + case "returns": + hasReturns = true; + returnsTag = tag; + break; + + case "constructor": + case "class": + hasConstructor = true; + break; + + case "override": + case "inheritdoc": + isOverride = true; + break; + + case "abstract": + case "virtual": + isAbstract = true; + break; + + case "interface": + isInterface = true; + break; + + // no default + } + + // check tag preferences + if (Object.prototype.hasOwnProperty.call(prefer, tag.title) && tag.title !== prefer[tag.title]) { + const entireTagRange = getAbsoluteRange(jsdocNode, tag); + + context.report({ + node: jsdocNode, + messageId: "use", + loc: { + start: entireTagRange.start, + end: { + line: entireTagRange.start.line, + column: entireTagRange.start.column + `@${tag.title}`.length + } + }, + data: { name: prefer[tag.title] }, + fix(fixer) { + return fixer.replaceTextRange( + [ + jsdocNode.range[0] + tag.range[0] + 3, + jsdocNode.range[0] + tag.range[0] + tag.title.length + 3 + ], + prefer[tag.title] + ); + } + }); + } + + // validate the types + if (checkPreferType && tag.type) { + validateType(jsdocNode, tag.type); + } + }); + + paramTags.forEach(param => { + if (requireParamType && !param.type) { + context.report({ + node: jsdocNode, + messageId: "missingParamType", + loc: getAbsoluteRange(jsdocNode, param), + data: { name: param.name } + }); + } + if (!param.description && requireParamDescription) { + context.report({ + node: jsdocNode, + messageId: "missingParamDesc", + loc: getAbsoluteRange(jsdocNode, param), + data: { name: param.name } + }); + } + if (paramTagsByName[param.name]) { + context.report({ + node: jsdocNode, + messageId: "duplicateParam", + loc: getAbsoluteRange(jsdocNode, param), + data: { name: param.name } + }); + } else if (param.name.indexOf(".") === -1) { + paramTagsByName[param.name] = param; + } + }); + + if (hasReturns) { + if (!requireReturn && !functionData.returnPresent && (returnsTag.type === null || !isValidReturnType(returnsTag)) && !isAbstract) { + context.report({ + node: jsdocNode, + messageId: "unexpectedTag", + loc: getAbsoluteRange(jsdocNode, returnsTag), + data: { + title: returnsTag.title + } + }); + } else { + if (requireReturnType && !returnsTag.type) { + context.report({ node: jsdocNode, messageId: "missingReturnType" }); + } + + if (!isValidReturnType(returnsTag) && !returnsTag.description && requireReturnDescription) { + context.report({ node: jsdocNode, messageId: "missingReturnDesc" }); + } + } + } + + // check for functions missing @returns + if (!isOverride && !hasReturns && !hasConstructor && !isInterface && + node.parent.kind !== "get" && node.parent.kind !== "constructor" && + node.parent.kind !== "set" && !isTypeClass(node)) { + if (requireReturn || (functionData.returnPresent && !node.async)) { + context.report({ + node: jsdocNode, + messageId: "missingReturn", + data: { + returns: prefer.returns || "returns" + } + }); + } + } + + // check the parameters + const jsdocParamNames = Object.keys(paramTagsByName); + + if (node.params) { + node.params.forEach((param, paramsIndex) => { + const bindingParam = param.type === "AssignmentPattern" + ? param.left + : param; + + // TODO(nzakas): Figure out logical things to do with destructured, default, rest params + if (bindingParam.type === "Identifier") { + const name = bindingParam.name; + + if (jsdocParamNames[paramsIndex] && (name !== jsdocParamNames[paramsIndex])) { + context.report({ + node: jsdocNode, + messageId: "expected", + loc: getAbsoluteRange(jsdocNode, paramTagsByName[jsdocParamNames[paramsIndex]]), + data: { + name, + jsdocName: jsdocParamNames[paramsIndex] + } + }); + } else if (!paramTagsByName[name] && !isOverride) { + context.report({ + node: jsdocNode, + messageId: "missingParam", + data: { + name + } + }); + } + } + }); + } + + if (options.matchDescription) { + const regex = new RegExp(options.matchDescription, "u"); + + if (!regex.test(jsdoc.description)) { + context.report({ node: jsdocNode, messageId: "unsatisfiedDesc" }); + } + } + + } + + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ArrowFunctionExpression: startFunction, + FunctionExpression: startFunction, + FunctionDeclaration: startFunction, + ClassExpression: startFunction, + ClassDeclaration: startFunction, + "ArrowFunctionExpression:exit": checkJSDoc, + "FunctionExpression:exit": checkJSDoc, + "FunctionDeclaration:exit": checkJSDoc, + "ClassExpression:exit": checkJSDoc, + "ClassDeclaration:exit": checkJSDoc, + ReturnStatement: addReturn + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/valid-typeof.js b/node_modules/eslint/lib/rules/valid-typeof.js new file mode 100644 index 000000000..a0f20f74d --- /dev/null +++ b/node_modules/eslint/lib/rules/valid-typeof.js @@ -0,0 +1,85 @@ +/** + * @fileoverview Ensures that the results of typeof are compared against a valid string + * @author Ian Christian Myers + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "enforce comparing `typeof` expressions against valid strings", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/valid-typeof" + }, + + schema: [ + { + type: "object", + properties: { + requireStringLiterals: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + messages: { + invalidValue: "Invalid typeof comparison value.", + notString: "Typeof comparisons should be to string literals." + } + }, + + create(context) { + + const VALID_TYPES = ["symbol", "undefined", "object", "boolean", "number", "string", "function", "bigint"], + OPERATORS = ["==", "===", "!=", "!=="]; + + const requireStringLiterals = context.options[0] && context.options[0].requireStringLiterals; + + /** + * Determines whether a node is a typeof expression. + * @param {ASTNode} node The node + * @returns {boolean} `true` if the node is a typeof expression + */ + function isTypeofExpression(node) { + return node.type === "UnaryExpression" && node.operator === "typeof"; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + UnaryExpression(node) { + if (isTypeofExpression(node)) { + const parent = context.getAncestors().pop(); + + if (parent.type === "BinaryExpression" && OPERATORS.indexOf(parent.operator) !== -1) { + const sibling = parent.left === node ? parent.right : parent.left; + + if (sibling.type === "Literal" || sibling.type === "TemplateLiteral" && !sibling.expressions.length) { + const value = sibling.type === "Literal" ? sibling.value : sibling.quasis[0].value.cooked; + + if (VALID_TYPES.indexOf(value) === -1) { + context.report({ node: sibling, messageId: "invalidValue" }); + } + } else if (requireStringLiterals && !isTypeofExpression(sibling)) { + context.report({ node: sibling, messageId: "notString" }); + } + } + } + } + + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/vars-on-top.js b/node_modules/eslint/lib/rules/vars-on-top.js new file mode 100644 index 000000000..28ddae442 --- /dev/null +++ b/node_modules/eslint/lib/rules/vars-on-top.js @@ -0,0 +1,144 @@ +/** + * @fileoverview Rule to enforce var declarations are only at the top of a function. + * @author Danny Fritz + * @author Gyandeep Singh + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require `var` declarations be placed at the top of their containing scope", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/vars-on-top" + }, + + schema: [], + messages: { + top: "All 'var' declarations must be at the top of the function scope." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {ASTNode} node any node + * @returns {boolean} whether the given node structurally represents a directive + */ + function looksLikeDirective(node) { + return node.type === "ExpressionStatement" && + node.expression.type === "Literal" && typeof node.expression.value === "string"; + } + + /** + * Check to see if its a ES6 import declaration + * @param {ASTNode} node any node + * @returns {boolean} whether the given node represents a import declaration + */ + function looksLikeImport(node) { + return node.type === "ImportDeclaration" || node.type === "ImportSpecifier" || + node.type === "ImportDefaultSpecifier" || node.type === "ImportNamespaceSpecifier"; + } + + /** + * Checks whether a given node is a variable declaration or not. + * @param {ASTNode} node any node + * @returns {boolean} `true` if the node is a variable declaration. + */ + function isVariableDeclaration(node) { + return ( + node.type === "VariableDeclaration" || + ( + node.type === "ExportNamedDeclaration" && + node.declaration && + node.declaration.type === "VariableDeclaration" + ) + ); + } + + /** + * Checks whether this variable is on top of the block body + * @param {ASTNode} node The node to check + * @param {ASTNode[]} statements collection of ASTNodes for the parent node block + * @returns {boolean} True if var is on top otherwise false + */ + function isVarOnTop(node, statements) { + const l = statements.length; + let i = 0; + + // skip over directives + for (; i < l; ++i) { + if (!looksLikeDirective(statements[i]) && !looksLikeImport(statements[i])) { + break; + } + } + + for (; i < l; ++i) { + if (!isVariableDeclaration(statements[i])) { + return false; + } + if (statements[i] === node) { + return true; + } + } + + return false; + } + + /** + * Checks whether variable is on top at the global level + * @param {ASTNode} node The node to check + * @param {ASTNode} parent Parent of the node + * @returns {void} + */ + function globalVarCheck(node, parent) { + if (!isVarOnTop(node, parent.body)) { + context.report({ node, messageId: "top" }); + } + } + + /** + * Checks whether variable is on top at functional block scope level + * @param {ASTNode} node The node to check + * @param {ASTNode} parent Parent of the node + * @param {ASTNode} grandParent Parent of the node's parent + * @returns {void} + */ + function blockScopeVarCheck(node, parent, grandParent) { + if (!(/Function/u.test(grandParent.type) && + parent.type === "BlockStatement" && + isVarOnTop(node, parent.body))) { + context.report({ node, messageId: "top" }); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + "VariableDeclaration[kind='var']"(node) { + if (node.parent.type === "ExportNamedDeclaration") { + globalVarCheck(node.parent, node.parent.parent); + } else if (node.parent.type === "Program") { + globalVarCheck(node, node.parent); + } else { + blockScopeVarCheck(node, node.parent, node.parent.parent); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/wrap-iife.js b/node_modules/eslint/lib/rules/wrap-iife.js new file mode 100644 index 000000000..07e5b84a4 --- /dev/null +++ b/node_modules/eslint/lib/rules/wrap-iife.js @@ -0,0 +1,204 @@ +/** + * @fileoverview Rule to flag when IIFE is not wrapped in parens + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const eslintUtils = require("eslint-utils"); + +//---------------------------------------------------------------------- +// Helpers +//---------------------------------------------------------------------- + +/** + * Check if the given node is callee of a `NewExpression` node + * @param {ASTNode} node node to check + * @returns {boolean} True if the node is callee of a `NewExpression` node + * @private + */ +function isCalleeOfNewExpression(node) { + const maybeCallee = node.parent.type === "ChainExpression" + ? node.parent + : node; + + return ( + maybeCallee.parent.type === "NewExpression" && + maybeCallee.parent.callee === maybeCallee + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require parentheses around immediate `function` invocations", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/wrap-iife" + }, + + schema: [ + { + enum: ["outside", "inside", "any"] + }, + { + type: "object", + properties: { + functionPrototypeMethods: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + fixable: "code", + messages: { + wrapInvocation: "Wrap an immediate function invocation in parentheses.", + wrapExpression: "Wrap only the function expression in parens.", + moveInvocation: "Move the invocation into the parens that contain the function." + } + }, + + create(context) { + + const style = context.options[0] || "outside"; + const includeFunctionPrototypeMethods = context.options[1] && context.options[1].functionPrototypeMethods; + + const sourceCode = context.getSourceCode(); + + /** + * Check if the node is wrapped in any (). All parens count: grouping parens and parens for constructs such as if() + * @param {ASTNode} node node to evaluate + * @returns {boolean} True if it is wrapped in any parens + * @private + */ + function isWrappedInAnyParens(node) { + return astUtils.isParenthesised(sourceCode, node); + } + + /** + * Check if the node is wrapped in grouping (). Parens for constructs such as if() don't count + * @param {ASTNode} node node to evaluate + * @returns {boolean} True if it is wrapped in grouping parens + * @private + */ + function isWrappedInGroupingParens(node) { + return eslintUtils.isParenthesized(1, node, sourceCode); + } + + /** + * Get the function node from an IIFE + * @param {ASTNode} node node to evaluate + * @returns {ASTNode} node that is the function expression of the given IIFE, or null if none exist + */ + function getFunctionNodeFromIIFE(node) { + const callee = astUtils.skipChainExpression(node.callee); + + if (callee.type === "FunctionExpression") { + return callee; + } + + if (includeFunctionPrototypeMethods && + callee.type === "MemberExpression" && + callee.object.type === "FunctionExpression" && + (astUtils.getStaticPropertyName(callee) === "call" || astUtils.getStaticPropertyName(callee) === "apply") + ) { + return callee.object; + } + + return null; + } + + + return { + CallExpression(node) { + const innerNode = getFunctionNodeFromIIFE(node); + + if (!innerNode) { + return; + } + + const isCallExpressionWrapped = isWrappedInAnyParens(node), + isFunctionExpressionWrapped = isWrappedInAnyParens(innerNode); + + if (!isCallExpressionWrapped && !isFunctionExpressionWrapped) { + context.report({ + node, + messageId: "wrapInvocation", + fix(fixer) { + const nodeToSurround = style === "inside" ? innerNode : node; + + return fixer.replaceText(nodeToSurround, `(${sourceCode.getText(nodeToSurround)})`); + } + }); + } else if (style === "inside" && !isFunctionExpressionWrapped) { + context.report({ + node, + messageId: "wrapExpression", + fix(fixer) { + + // The outer call expression will always be wrapped at this point. + + if (isWrappedInGroupingParens(node) && !isCalleeOfNewExpression(node)) { + + /* + * Parenthesize the function expression and remove unnecessary grouping parens around the call expression. + * Replace the range between the end of the function expression and the end of the call expression. + * for example, in `(function(foo) {}(bar))`, the range `(bar))` should get replaced with `)(bar)`. + */ + + const parenAfter = sourceCode.getTokenAfter(node); + + return fixer.replaceTextRange( + [innerNode.range[1], parenAfter.range[1]], + `)${sourceCode.getText().slice(innerNode.range[1], parenAfter.range[0])}` + ); + } + + /* + * Call expression is wrapped in mandatory parens such as if(), or in necessary grouping parens. + * These parens cannot be removed, so just parenthesize the function expression. + */ + + return fixer.replaceText(innerNode, `(${sourceCode.getText(innerNode)})`); + } + }); + } else if (style === "outside" && !isCallExpressionWrapped) { + context.report({ + node, + messageId: "moveInvocation", + fix(fixer) { + + /* + * The inner function expression will always be wrapped at this point. + * It's only necessary to replace the range between the end of the function expression + * and the call expression. For example, in `(function(foo) {})(bar)`, the range `)(bar)` + * should get replaced with `(bar))`. + */ + const parenAfter = sourceCode.getTokenAfter(innerNode); + + return fixer.replaceTextRange( + [parenAfter.range[0], node.range[1]], + `${sourceCode.getText().slice(parenAfter.range[1], node.range[1])})` + ); + } + }); + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/wrap-regex.js b/node_modules/eslint/lib/rules/wrap-regex.js new file mode 100644 index 000000000..4ecbcecbb --- /dev/null +++ b/node_modules/eslint/lib/rules/wrap-regex.js @@ -0,0 +1,59 @@ +/** + * @fileoverview Rule to flag when regex literals are not wrapped in parens + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require parenthesis around regex literals", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/wrap-regex" + }, + + schema: [], + fixable: "code", + + messages: { + requireParens: "Wrap the regexp literal in parens to disambiguate the slash." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + + Literal(node) { + const token = sourceCode.getFirstToken(node), + nodeType = token.type; + + if (nodeType === "RegularExpression") { + const beforeToken = sourceCode.getTokenBefore(node); + const afterToken = sourceCode.getTokenAfter(node); + const ancestors = context.getAncestors(); + const grandparent = ancestors[ancestors.length - 1]; + + if (grandparent.type === "MemberExpression" && grandparent.object === node && + !(beforeToken && beforeToken.value === "(" && afterToken && afterToken.value === ")")) { + context.report({ + node, + messageId: "requireParens", + fix: fixer => fixer.replaceText(node, `(${sourceCode.getText(node)})`) + }); + } + } + } + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/yield-star-spacing.js b/node_modules/eslint/lib/rules/yield-star-spacing.js new file mode 100644 index 000000000..20b8e9ea9 --- /dev/null +++ b/node_modules/eslint/lib/rules/yield-star-spacing.js @@ -0,0 +1,127 @@ +/** + * @fileoverview Rule to check the spacing around the * in yield* expressions. + * @author Bryan Smith + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow spacing around the `*` in `yield*` expressions", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/yield-star-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["before", "after", "both", "neither"] + }, + { + type: "object", + properties: { + before: { type: "boolean" }, + after: { type: "boolean" } + }, + additionalProperties: false + } + ] + } + ], + messages: { + missingBefore: "Missing space before *.", + missingAfter: "Missing space after *.", + unexpectedBefore: "Unexpected space before *.", + unexpectedAfter: "Unexpected space after *." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + const mode = (function(option) { + if (!option || typeof option === "string") { + return { + before: { before: true, after: false }, + after: { before: false, after: true }, + both: { before: true, after: true }, + neither: { before: false, after: false } + }[option || "after"]; + } + return option; + }(context.options[0])); + + /** + * Checks the spacing between two tokens before or after the star token. + * @param {string} side Either "before" or "after". + * @param {Token} leftToken `function` keyword token if side is "before", or + * star token if side is "after". + * @param {Token} rightToken Star token if side is "before", or identifier + * token if side is "after". + * @returns {void} + */ + function checkSpacing(side, leftToken, rightToken) { + if (sourceCode.isSpaceBetweenTokens(leftToken, rightToken) !== mode[side]) { + const after = leftToken.value === "*"; + const spaceRequired = mode[side]; + const node = after ? leftToken : rightToken; + let messageId = ""; + + if (spaceRequired) { + messageId = side === "before" ? "missingBefore" : "missingAfter"; + } else { + messageId = side === "before" ? "unexpectedBefore" : "unexpectedAfter"; + } + + context.report({ + node, + messageId, + fix(fixer) { + if (spaceRequired) { + if (after) { + return fixer.insertTextAfter(node, " "); + } + return fixer.insertTextBefore(node, " "); + } + return fixer.removeRange([leftToken.range[1], rightToken.range[0]]); + } + }); + } + } + + /** + * Enforces the spacing around the star if node is a yield* expression. + * @param {ASTNode} node A yield expression node. + * @returns {void} + */ + function checkExpression(node) { + if (!node.delegate) { + return; + } + + const tokens = sourceCode.getFirstTokens(node, 3); + const yieldToken = tokens[0]; + const starToken = tokens[1]; + const nextToken = tokens[2]; + + checkSpacing("before", yieldToken, starToken); + checkSpacing("after", starToken, nextToken); + } + + return { + YieldExpression: checkExpression + }; + + } +}; diff --git a/node_modules/eslint/lib/rules/yoda.js b/node_modules/eslint/lib/rules/yoda.js new file mode 100644 index 000000000..87dd5ed6c --- /dev/null +++ b/node_modules/eslint/lib/rules/yoda.js @@ -0,0 +1,352 @@ +/** + * @fileoverview Rule to require or disallow yoda comparisons + * @author Nicholas C. Zakas + */ +"use strict"; + +//-------------------------------------------------------------------------- +// Requirements +//-------------------------------------------------------------------------- + +const astUtils = require("./utils/ast-utils"); + +//-------------------------------------------------------------------------- +// Helpers +//-------------------------------------------------------------------------- + +/** + * Determines whether an operator is a comparison operator. + * @param {string} operator The operator to check. + * @returns {boolean} Whether or not it is a comparison operator. + */ +function isComparisonOperator(operator) { + return /^(==|===|!=|!==|<|>|<=|>=)$/u.test(operator); +} + +/** + * Determines whether an operator is an equality operator. + * @param {string} operator The operator to check. + * @returns {boolean} Whether or not it is an equality operator. + */ +function isEqualityOperator(operator) { + return /^(==|===)$/u.test(operator); +} + +/** + * Determines whether an operator is one used in a range test. + * Allowed operators are `<` and `<=`. + * @param {string} operator The operator to check. + * @returns {boolean} Whether the operator is used in range tests. + */ +function isRangeTestOperator(operator) { + return ["<", "<="].indexOf(operator) >= 0; +} + +/** + * Determines whether a non-Literal node is a negative number that should be + * treated as if it were a single Literal node. + * @param {ASTNode} node Node to test. + * @returns {boolean} True if the node is a negative number that looks like a + * real literal and should be treated as such. + */ +function isNegativeNumericLiteral(node) { + return ( + node.type === "UnaryExpression" && + node.operator === "-" && + node.prefix && + astUtils.isNumericLiteral(node.argument) + ); +} + +/** + * Determines whether a node is a Template Literal which can be determined statically. + * @param {ASTNode} node Node to test + * @returns {boolean} True if the node is a Template Literal without expression. + */ +function isStaticTemplateLiteral(node) { + return node.type === "TemplateLiteral" && node.expressions.length === 0; +} + +/** + * Determines whether a non-Literal node should be treated as a single Literal node. + * @param {ASTNode} node Node to test + * @returns {boolean} True if the node should be treated as a single Literal node. + */ +function looksLikeLiteral(node) { + return isNegativeNumericLiteral(node) || isStaticTemplateLiteral(node); +} + +/** + * Attempts to derive a Literal node from nodes that are treated like literals. + * @param {ASTNode} node Node to normalize. + * @returns {ASTNode} One of the following options. + * 1. The original node if the node is already a Literal + * 2. A normalized Literal node with the negative number as the value if the + * node represents a negative number literal. + * 3. A normalized Literal node with the string as the value if the node is + * a Template Literal without expression. + * 4. Otherwise `null`. + */ +function getNormalizedLiteral(node) { + if (node.type === "Literal") { + return node; + } + + if (isNegativeNumericLiteral(node)) { + return { + type: "Literal", + value: -node.argument.value, + raw: `-${node.argument.value}` + }; + } + + if (isStaticTemplateLiteral(node)) { + return { + type: "Literal", + value: node.quasis[0].value.cooked, + raw: node.quasis[0].value.raw + }; + } + + return null; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: 'require or disallow "Yoda" conditions', + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/yoda" + }, + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + exceptRange: { + type: "boolean", + default: false + }, + onlyEquality: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + fixable: "code", + messages: { + expected: + "Expected literal to be on the {{expectedSide}} side of {{operator}}." + } + }, + + create(context) { + + // Default to "never" (!always) if no option + const always = context.options[0] === "always"; + const exceptRange = + context.options[1] && context.options[1].exceptRange; + const onlyEquality = + context.options[1] && context.options[1].onlyEquality; + + const sourceCode = context.getSourceCode(); + + /** + * Determines whether node represents a range test. + * A range test is a "between" test like `(0 <= x && x < 1)` or an "outside" + * test like `(x < 0 || 1 <= x)`. It must be wrapped in parentheses, and + * both operators must be `<` or `<=`. Finally, the literal on the left side + * must be less than or equal to the literal on the right side so that the + * test makes any sense. + * @param {ASTNode} node LogicalExpression node to test. + * @returns {boolean} Whether node is a range test. + */ + function isRangeTest(node) { + const left = node.left, + right = node.right; + + /** + * Determines whether node is of the form `0 <= x && x < 1`. + * @returns {boolean} Whether node is a "between" range test. + */ + function isBetweenTest() { + if (node.operator === "&&" && astUtils.isSameReference(left.right, right.left)) { + const leftLiteral = getNormalizedLiteral(left.left); + const rightLiteral = getNormalizedLiteral(right.right); + + if (leftLiteral === null && rightLiteral === null) { + return false; + } + + if (rightLiteral === null || leftLiteral === null) { + return true; + } + + if (leftLiteral.value <= rightLiteral.value) { + return true; + } + } + return false; + } + + /** + * Determines whether node is of the form `x < 0 || 1 <= x`. + * @returns {boolean} Whether node is an "outside" range test. + */ + function isOutsideTest() { + if (node.operator === "||" && astUtils.isSameReference(left.left, right.right)) { + const leftLiteral = getNormalizedLiteral(left.right); + const rightLiteral = getNormalizedLiteral(right.left); + + if (leftLiteral === null && rightLiteral === null) { + return false; + } + + if (rightLiteral === null || leftLiteral === null) { + return true; + } + + if (leftLiteral.value <= rightLiteral.value) { + return true; + } + } + + return false; + } + + /** + * Determines whether node is wrapped in parentheses. + * @returns {boolean} Whether node is preceded immediately by an open + * paren token and followed immediately by a close + * paren token. + */ + function isParenWrapped() { + return astUtils.isParenthesised(sourceCode, node); + } + + return ( + node.type === "LogicalExpression" && + left.type === "BinaryExpression" && + right.type === "BinaryExpression" && + isRangeTestOperator(left.operator) && + isRangeTestOperator(right.operator) && + (isBetweenTest() || isOutsideTest()) && + isParenWrapped() + ); + } + + const OPERATOR_FLIP_MAP = { + "===": "===", + "!==": "!==", + "==": "==", + "!=": "!=", + "<": ">", + ">": "<", + "<=": ">=", + ">=": "<=" + }; + + /** + * Returns a string representation of a BinaryExpression node with its sides/operator flipped around. + * @param {ASTNode} node The BinaryExpression node + * @returns {string} A string representation of the node with the sides and operator flipped + */ + function getFlippedString(node) { + const tokenBefore = sourceCode.getTokenBefore(node); + const operatorToken = sourceCode.getFirstTokenBetween( + node.left, + node.right, + token => token.value === node.operator + ); + const textBeforeOperator = sourceCode + .getText() + .slice( + sourceCode.getTokenBefore(operatorToken).range[1], + operatorToken.range[0] + ); + const textAfterOperator = sourceCode + .getText() + .slice( + operatorToken.range[1], + sourceCode.getTokenAfter(operatorToken).range[0] + ); + const leftText = sourceCode + .getText() + .slice( + node.range[0], + sourceCode.getTokenBefore(operatorToken).range[1] + ); + const firstRightToken = sourceCode.getTokenAfter(operatorToken); + const rightText = sourceCode + .getText() + .slice(firstRightToken.range[0], node.range[1]); + + let prefix = ""; + + if ( + tokenBefore && + tokenBefore.range[1] === node.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, firstRightToken) + ) { + prefix = " "; + } + + return ( + prefix + + rightText + + textBeforeOperator + + OPERATOR_FLIP_MAP[operatorToken.value] + + textAfterOperator + + leftText + ); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + BinaryExpression(node) { + const expectedLiteral = always ? node.left : node.right; + const expectedNonLiteral = always ? node.right : node.left; + + // If `expectedLiteral` is not a literal, and `expectedNonLiteral` is a literal, raise an error. + if ( + (expectedNonLiteral.type === "Literal" || + looksLikeLiteral(expectedNonLiteral)) && + !( + expectedLiteral.type === "Literal" || + looksLikeLiteral(expectedLiteral) + ) && + !(!isEqualityOperator(node.operator) && onlyEquality) && + isComparisonOperator(node.operator) && + !(exceptRange && isRangeTest(context.getAncestors().pop())) + ) { + context.report({ + node, + messageId: "expected", + data: { + operator: node.operator, + expectedSide: always ? "left" : "right" + }, + fix: fixer => + fixer.replaceText(node, getFlippedString(node)) + }); + } + } + }; + } +}; diff --git a/node_modules/eslint/lib/shared/ajv.js b/node_modules/eslint/lib/shared/ajv.js new file mode 100644 index 000000000..3fb0fbdd3 --- /dev/null +++ b/node_modules/eslint/lib/shared/ajv.js @@ -0,0 +1,34 @@ +/** + * @fileoverview The instance of Ajv validator. + * @author Evgeny Poberezkin + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Ajv = require("ajv"), + metaSchema = require("ajv/lib/refs/json-schema-draft-04.json"); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = (additionalOptions = {}) => { + const ajv = new Ajv({ + meta: false, + useDefaults: true, + validateSchema: false, + missingRefs: "ignore", + verbose: true, + schemaId: "auto", + ...additionalOptions + }); + + ajv.addMetaSchema(metaSchema); + // eslint-disable-next-line no-underscore-dangle + ajv._opts.defaultMeta = metaSchema.id; + + return ajv; +}; diff --git a/node_modules/eslint/lib/shared/ast-utils.js b/node_modules/eslint/lib/shared/ast-utils.js new file mode 100644 index 000000000..4ebd49c3c --- /dev/null +++ b/node_modules/eslint/lib/shared/ast-utils.js @@ -0,0 +1,29 @@ +/** + * @fileoverview Common utils for AST. + * + * This file contains only shared items for core and rules. + * If you make a utility for rules, please see `../rules/utils/ast-utils.js`. + * + * @author Toru Nagashima + */ +"use strict"; + +const breakableTypePattern = /^(?:(?:Do)?While|For(?:In|Of)?|Switch)Statement$/u; +const lineBreakPattern = /\r\n|[\r\n\u2028\u2029]/u; +const shebangPattern = /^#!([^\r\n]+)/u; + +/** + * Creates a version of the `lineBreakPattern` regex with the global flag. + * Global regexes are mutable, so this needs to be a function instead of a constant. + * @returns {RegExp} A global regular expression that matches line terminators + */ +function createGlobalLinebreakMatcher() { + return new RegExp(lineBreakPattern.source, "gu"); +} + +module.exports = { + breakableTypePattern, + lineBreakPattern, + createGlobalLinebreakMatcher, + shebangPattern +}; diff --git a/node_modules/eslint/lib/shared/config-validator.js b/node_modules/eslint/lib/shared/config-validator.js new file mode 100644 index 000000000..03b32f1c9 --- /dev/null +++ b/node_modules/eslint/lib/shared/config-validator.js @@ -0,0 +1,338 @@ +/* + * STOP!!! DO NOT MODIFY. + * + * This file is part of the ongoing work to move the eslintrc-style config + * system into the @eslint/eslintrc package. This file needs to remain + * unchanged in order for this work to proceed. + * + * If you think you need to change this file, please contact @nzakas first. + * + * Thanks in advance for your cooperation. + */ + +/** + * @fileoverview Validates configs. + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const + util = require("util"), + configSchema = require("../../conf/config-schema"), + BuiltInEnvironments = require("@eslint/eslintrc/conf/environments"), + BuiltInRules = require("../rules"), + ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops"), + { emitDeprecationWarning } = require("./deprecation-warnings"); + +const ajv = require("./ajv")(); +const ruleValidators = new WeakMap(); +const noop = Function.prototype; + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ +let validateSchema; +const severityMap = { + error: 2, + warn: 1, + off: 0 +}; + +/** + * Gets a complete options schema for a rule. + * @param {{create: Function, schema: (Array|null)}} rule A new-style rule object + * @returns {Object} JSON Schema for the rule's options. + */ +function getRuleOptionsSchema(rule) { + if (!rule) { + return null; + } + + const schema = rule.schema || rule.meta && rule.meta.schema; + + // Given a tuple of schemas, insert warning level at the beginning + if (Array.isArray(schema)) { + if (schema.length) { + return { + type: "array", + items: schema, + minItems: 0, + maxItems: schema.length + }; + } + return { + type: "array", + minItems: 0, + maxItems: 0 + }; + + } + + // Given a full schema, leave it alone + return schema || null; +} + +/** + * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid. + * @param {options} options The given options for the rule. + * @returns {number|string} The rule's severity value + */ +function validateRuleSeverity(options) { + const severity = Array.isArray(options) ? options[0] : options; + const normSeverity = typeof severity === "string" ? severityMap[severity.toLowerCase()] : severity; + + if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) { + return normSeverity; + } + + throw new Error(`\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util.inspect(severity).replace(/'/gu, "\"").replace(/\n/gu, "")}').\n`); + +} + +/** + * Validates the non-severity options passed to a rule, based on its schema. + * @param {{create: Function}} rule The rule to validate + * @param {Array} localOptions The options for the rule, excluding severity + * @returns {void} + */ +function validateRuleSchema(rule, localOptions) { + if (!ruleValidators.has(rule)) { + const schema = getRuleOptionsSchema(rule); + + if (schema) { + ruleValidators.set(rule, ajv.compile(schema)); + } + } + + const validateRule = ruleValidators.get(rule); + + if (validateRule) { + validateRule(localOptions); + if (validateRule.errors) { + throw new Error(validateRule.errors.map( + error => `\tValue ${JSON.stringify(error.data)} ${error.message}.\n` + ).join("")); + } + } +} + +/** + * Validates a rule's options against its schema. + * @param {{create: Function}|null} rule The rule that the config is being validated for + * @param {string} ruleId The rule's unique name. + * @param {Array|number} options The given options for the rule. + * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined, + * no source is prepended to the message. + * @returns {void} + */ +function validateRuleOptions(rule, ruleId, options, source = null) { + try { + const severity = validateRuleSeverity(options); + + if (severity !== 0) { + validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []); + } + } catch (err) { + const enhancedMessage = `Configuration for rule "${ruleId}" is invalid:\n${err.message}`; + + if (typeof source === "string") { + throw new Error(`${source}:\n\t${enhancedMessage}`); + } else { + throw new Error(enhancedMessage); + } + } +} + +/** + * Validates an environment object + * @param {Object} environment The environment config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded environments. + * @returns {void} + */ +function validateEnvironment( + environment, + source, + getAdditionalEnv = noop +) { + + // not having an environment is ok + if (!environment) { + return; + } + + Object.keys(environment).forEach(id => { + const env = getAdditionalEnv(id) || BuiltInEnvironments.get(id) || null; + + if (!env) { + const message = `${source}:\n\tEnvironment key "${id}" is unknown\n`; + + throw new Error(message); + } + }); +} + +/** + * Validates a rules config object + * @param {Object} rulesConfig The rules config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(ruleId:string): Object} getAdditionalRule A map from strings to loaded rules + * @returns {void} + */ +function validateRules( + rulesConfig, + source, + getAdditionalRule = noop +) { + if (!rulesConfig) { + return; + } + + Object.keys(rulesConfig).forEach(id => { + const rule = getAdditionalRule(id) || BuiltInRules.get(id) || null; + + validateRuleOptions(rule, id, rulesConfig[id], source); + }); +} + +/** + * Validates a `globals` section of a config file + * @param {Object} globalsConfig The `globals` section + * @param {string|null} source The name of the configuration source to report in the event of an error. + * @returns {void} + */ +function validateGlobals(globalsConfig, source = null) { + if (!globalsConfig) { + return; + } + + Object.entries(globalsConfig) + .forEach(([configuredGlobal, configuredValue]) => { + try { + ConfigOps.normalizeConfigGlobal(configuredValue); + } catch (err) { + throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\n${err.message}`); + } + }); +} + +/** + * Validate `processor` configuration. + * @param {string|undefined} processorName The processor name. + * @param {string} source The name of config file. + * @param {function(id:string): Processor} getProcessor The getter of defined processors. + * @returns {void} + */ +function validateProcessor(processorName, source, getProcessor) { + if (processorName && !getProcessor(processorName)) { + throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`); + } +} + +/** + * Formats an array of schema validation errors. + * @param {Array} errors An array of error messages to format. + * @returns {string} Formatted error message + */ +function formatErrors(errors) { + return errors.map(error => { + if (error.keyword === "additionalProperties") { + const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty; + + return `Unexpected top-level property "${formattedPropertyPath}"`; + } + if (error.keyword === "type") { + const formattedField = error.dataPath.slice(1); + const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join("/") : error.schema; + const formattedValue = JSON.stringify(error.data); + + return `Property "${formattedField}" is the wrong type (expected ${formattedExpectedType} but got \`${formattedValue}\`)`; + } + + const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath; + + return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`; + }).map(message => `\t- ${message}.\n`).join(""); +} + +/** + * Validates the top level properties of the config object. + * @param {Object} config The config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @returns {void} + */ +function validateConfigSchema(config, source = null) { + validateSchema = validateSchema || ajv.compile(configSchema); + + if (!validateSchema(config)) { + throw new Error(`ESLint configuration in ${source} is invalid:\n${formatErrors(validateSchema.errors)}`); + } + + if (Object.hasOwnProperty.call(config, "ecmaFeatures")) { + emitDeprecationWarning(source, "ESLINT_LEGACY_ECMAFEATURES"); + } +} + +/** + * Validates an entire config object. + * @param {Object} config The config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(ruleId:string): Object} [getAdditionalRule] A map from strings to loaded rules. + * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded envs. + * @returns {void} + */ +function validate(config, source, getAdditionalRule, getAdditionalEnv) { + validateConfigSchema(config, source); + validateRules(config.rules, source, getAdditionalRule); + validateEnvironment(config.env, source, getAdditionalEnv); + validateGlobals(config.globals, source); + + for (const override of config.overrides || []) { + validateRules(override.rules, source, getAdditionalRule); + validateEnvironment(override.env, source, getAdditionalEnv); + validateGlobals(config.globals, source); + } +} + +const validated = new WeakSet(); + +/** + * Validate config array object. + * @param {ConfigArray} configArray The config array to validate. + * @returns {void} + */ +function validateConfigArray(configArray) { + const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments); + const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors); + const getPluginRule = Map.prototype.get.bind(configArray.pluginRules); + + // Validate. + for (const element of configArray) { + if (validated.has(element)) { + continue; + } + validated.add(element); + + validateEnvironment(element.env, element.name, getPluginEnv); + validateGlobals(element.globals, element.name); + validateProcessor(element.processor, element.name, getPluginProcessor); + validateRules(element.rules, element.name, getPluginRule); + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + getRuleOptionsSchema, + validate, + validateConfigArray, + validateConfigSchema, + validateRuleOptions +}; diff --git a/node_modules/eslint/lib/shared/deprecation-warnings.js b/node_modules/eslint/lib/shared/deprecation-warnings.js new file mode 100644 index 000000000..e1481a2e9 --- /dev/null +++ b/node_modules/eslint/lib/shared/deprecation-warnings.js @@ -0,0 +1,56 @@ +/** + * @fileoverview Provide the function that emits deprecation warnings. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const path = require("path"); +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +// Defitions for deprecation warnings. +const deprecationWarningMessages = { + ESLINT_LEGACY_ECMAFEATURES: + "The 'ecmaFeatures' config file property is deprecated and has no effect.", + ESLINT_PERSONAL_CONFIG_LOAD: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please use a config file per project or the '--config' option.", + ESLINT_PERSONAL_CONFIG_SUPPRESS: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please remove it or add 'root:true' to the config files in your " + + "projects in order to avoid loading '~/.eslintrc.*' accidentally." +}; + +/** + * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted + * for each unique file path, but repeated invocations with the same file path have no effect. + * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active. + * @param {string} source The name of the configuration source to report the warning for. + * @param {string} errorCode The warning message to show. + * @returns {void} + */ +const emitDeprecationWarning = lodash.memoize((source, errorCode) => { + const rel = path.relative(process.cwd(), source); + const message = deprecationWarningMessages[errorCode]; + + process.emitWarning( + `${message} (found in "${rel}")`, + "DeprecationWarning", + errorCode + ); +}, (...args) => JSON.stringify(args)); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + emitDeprecationWarning +}; diff --git a/node_modules/eslint/lib/shared/logging.js b/node_modules/eslint/lib/shared/logging.js new file mode 100644 index 000000000..6aa1f5a1e --- /dev/null +++ b/node_modules/eslint/lib/shared/logging.js @@ -0,0 +1,30 @@ +/** + * @fileoverview Handle logging for ESLint + * @author Gyandeep Singh + */ + +"use strict"; + +/* eslint no-console: "off" */ + +/* istanbul ignore next */ +module.exports = { + + /** + * Cover for console.log + * @param {...any} args The elements to log. + * @returns {void} + */ + info(...args) { + console.log(...args); + }, + + /** + * Cover for console.error + * @param {...any} args The elements to log. + * @returns {void} + */ + error(...args) { + console.error(...args); + } +}; diff --git a/node_modules/eslint/lib/shared/relative-module-resolver.js b/node_modules/eslint/lib/shared/relative-module-resolver.js new file mode 100644 index 000000000..cd743f379 --- /dev/null +++ b/node_modules/eslint/lib/shared/relative-module-resolver.js @@ -0,0 +1,56 @@ +/* + * STOP!!! DO NOT MODIFY. + * + * This file is part of the ongoing work to move the eslintrc-style config + * system into the @eslint/eslintrc package. This file needs to remain + * unchanged in order for this work to proceed. + * + * If you think you need to change this file, please contact @nzakas first. + * + * Thanks in advance for your cooperation. + */ + +/** + * Utility for resolving a module relative to another module + * @author Teddy Katz + */ + +"use strict"; + +const Module = require("module"); + +/* + * `Module.createRequire` is added in v12.2.0. It supports URL as well. + * We only support the case where the argument is a filepath, not a URL. + */ +// eslint-disable-next-line node/no-unsupported-features/node-builtins, node/no-deprecated-api +const createRequire = Module.createRequire || Module.createRequireFromPath; + +module.exports = { + + /** + * Resolves a Node module relative to another module + * @param {string} moduleName The name of a Node module, or a path to a Node module. + * @param {string} relativeToPath An absolute path indicating the module that `moduleName` should be resolved relative to. This must be + * a file rather than a directory, but the file need not actually exist. + * @returns {string} The absolute path that would result from calling `require.resolve(moduleName)` in a file located at `relativeToPath` + */ + resolve(moduleName, relativeToPath) { + try { + return createRequire(relativeToPath).resolve(moduleName); + } catch (error) { + + // This `if` block is for older Node.js than 12.0.0. We can remove this block in the future. + if ( + typeof error === "object" && + error !== null && + error.code === "MODULE_NOT_FOUND" && + !error.requireStack && + error.message.includes(moduleName) + ) { + error.message += `\nRequire stack:\n- ${relativeToPath}`; + } + throw error; + } + } +}; diff --git a/node_modules/eslint/lib/shared/runtime-info.js b/node_modules/eslint/lib/shared/runtime-info.js new file mode 100644 index 000000000..feed00533 --- /dev/null +++ b/node_modules/eslint/lib/shared/runtime-info.js @@ -0,0 +1,163 @@ +/** + * @fileoverview Utility to get information about the execution environment. + * @author Kai Cataldo + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const path = require("path"); +const spawn = require("cross-spawn"); +const { isEmpty } = require("lodash"); +const log = require("../shared/logging"); +const packageJson = require("../../package.json"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Generates and returns execution environment information. + * @returns {string} A string that contains execution environment information. + */ +function environment() { + const cache = new Map(); + + /** + * Checks if a path is a child of a directory. + * @param {string} parentPath The parent path to check. + * @param {string} childPath The path to check. + * @returns {boolean} Whether or not the given path is a child of a directory. + */ + function isChildOfDirectory(parentPath, childPath) { + return !path.relative(parentPath, childPath).startsWith(".."); + } + + /** + * Synchronously executes a shell command and formats the result. + * @param {string} cmd The command to execute. + * @param {Array} args The arguments to be executed with the command. + * @returns {string} The version returned by the command. + */ + function execCommand(cmd, args) { + const key = [cmd, ...args].join(" "); + + if (cache.has(key)) { + return cache.get(key); + } + + const process = spawn.sync(cmd, args, { encoding: "utf8" }); + + if (process.error) { + throw process.error; + } + + const result = process.stdout.trim(); + + cache.set(key, result); + return result; + } + + /** + * Normalizes a version number. + * @param {string} versionStr The string to normalize. + * @returns {string} The normalized version number. + */ + function normalizeVersionStr(versionStr) { + return versionStr.startsWith("v") ? versionStr : `v${versionStr}`; + } + + /** + * Gets bin version. + * @param {string} bin The bin to check. + * @returns {string} The normalized version returned by the command. + */ + function getBinVersion(bin) { + const binArgs = ["--version"]; + + try { + return normalizeVersionStr(execCommand(bin, binArgs)); + } catch (e) { + log.error(`Error finding ${bin} version running the command \`${bin} ${binArgs.join(" ")}\``); + throw e; + } + } + + /** + * Gets installed npm package version. + * @param {string} pkg The package to check. + * @param {boolean} global Whether to check globally or not. + * @returns {string} The normalized version returned by the command. + */ + function getNpmPackageVersion(pkg, { global = false } = {}) { + const npmBinArgs = ["bin", "-g"]; + const npmLsArgs = ["ls", "--depth=0", "--json", "eslint"]; + + if (global) { + npmLsArgs.push("-g"); + } + + try { + const parsedStdout = JSON.parse(execCommand("npm", npmLsArgs)); + + /* + * Checking globally returns an empty JSON object, while local checks + * include the name and version of the local project. + */ + if (isEmpty(parsedStdout) || !(parsedStdout.dependencies && parsedStdout.dependencies.eslint)) { + return "Not found"; + } + + const [, processBinPath] = process.argv; + let npmBinPath; + + try { + npmBinPath = execCommand("npm", npmBinArgs); + } catch (e) { + log.error(`Error finding npm binary path when running command \`npm ${npmBinArgs.join(" ")}\``); + throw e; + } + + const isGlobal = isChildOfDirectory(npmBinPath, processBinPath); + let pkgVersion = parsedStdout.dependencies.eslint.version; + + if ((global && isGlobal) || (!global && !isGlobal)) { + pkgVersion += " (Currently used)"; + } + + return normalizeVersionStr(pkgVersion); + } catch (e) { + log.error(`Error finding ${pkg} version running the command \`npm ${npmLsArgs.join(" ")}\``); + throw e; + } + } + + return [ + "Environment Info:", + "", + `Node version: ${getBinVersion("node")}`, + `npm version: ${getBinVersion("npm")}`, + `Local ESLint version: ${getNpmPackageVersion("eslint", { global: false })}`, + `Global ESLint version: ${getNpmPackageVersion("eslint", { global: true })}` + ].join("\n"); +} + +/** + * Returns version of currently executing ESLint. + * @returns {string} The version from the currently executing ESLint's package.json. + */ +function version() { + return `v${packageJson.version}`; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + environment, + version +}; diff --git a/node_modules/eslint/lib/shared/traverser.js b/node_modules/eslint/lib/shared/traverser.js new file mode 100644 index 000000000..32f767795 --- /dev/null +++ b/node_modules/eslint/lib/shared/traverser.js @@ -0,0 +1,195 @@ +/** + * @fileoverview Traverser to traverse AST trees. + * @author Nicholas C. Zakas + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const vk = require("eslint-visitor-keys"); +const debug = require("debug")("eslint:traverser"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Do nothing. + * @returns {void} + */ +function noop() { + + // do nothing. +} + +/** + * Check whether the given value is an ASTNode or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if the value is an ASTNode. + */ +function isNode(x) { + return x !== null && typeof x === "object" && typeof x.type === "string"; +} + +/** + * Get the visitor keys of a given node. + * @param {Object} visitorKeys The map of visitor keys. + * @param {ASTNode} node The node to get their visitor keys. + * @returns {string[]} The visitor keys of the node. + */ +function getVisitorKeys(visitorKeys, node) { + let keys = visitorKeys[node.type]; + + if (!keys) { + keys = vk.getKeys(node); + debug("Unknown node type \"%s\": Estimated visitor keys %j", node.type, keys); + } + + return keys; +} + +/** + * The traverser class to traverse AST trees. + */ +class Traverser { + constructor() { + this._current = null; + this._parents = []; + this._skipped = false; + this._broken = false; + this._visitorKeys = null; + this._enter = null; + this._leave = null; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {ASTNode} The current node. + */ + current() { + return this._current; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {ASTNode[]} The ancestor nodes. + */ + parents() { + return this._parents.slice(0); + } + + /** + * Break the current traversal. + * @returns {void} + */ + break() { + this._broken = true; + } + + /** + * Skip child nodes for the current traversal. + * @returns {void} + */ + skip() { + this._skipped = true; + } + + /** + * Traverse the given AST tree. + * @param {ASTNode} node The root node to traverse. + * @param {Object} options The option object. + * @param {Object} [options.visitorKeys=DEFAULT_VISITOR_KEYS] The keys of each node types to traverse child nodes. Default is `./default-visitor-keys.json`. + * @param {Function} [options.enter=noop] The callback function which is called on entering each node. + * @param {Function} [options.leave=noop] The callback function which is called on leaving each node. + * @returns {void} + */ + traverse(node, options) { + this._current = null; + this._parents = []; + this._skipped = false; + this._broken = false; + this._visitorKeys = options.visitorKeys || vk.KEYS; + this._enter = options.enter || noop; + this._leave = options.leave || noop; + this._traverse(node, null); + } + + /** + * Traverse the given AST tree recursively. + * @param {ASTNode} node The current node. + * @param {ASTNode|null} parent The parent node. + * @returns {void} + * @private + */ + _traverse(node, parent) { + if (!isNode(node)) { + return; + } + + this._current = node; + this._skipped = false; + this._enter(node, parent); + + if (!this._skipped && !this._broken) { + const keys = getVisitorKeys(this._visitorKeys, node); + + if (keys.length >= 1) { + this._parents.push(node); + for (let i = 0; i < keys.length && !this._broken; ++i) { + const child = node[keys[i]]; + + if (Array.isArray(child)) { + for (let j = 0; j < child.length && !this._broken; ++j) { + this._traverse(child[j], node); + } + } else { + this._traverse(child, node); + } + } + this._parents.pop(); + } + } + + if (!this._broken) { + this._leave(node, parent); + } + + this._current = parent; + } + + /** + * Calculates the keys to use for traversal. + * @param {ASTNode} node The node to read keys from. + * @returns {string[]} An array of keys to visit on the node. + * @private + */ + static getKeys(node) { + return vk.getKeys(node); + } + + /** + * Traverse the given AST tree. + * @param {ASTNode} node The root node to traverse. + * @param {Object} options The option object. + * @param {Object} [options.visitorKeys=DEFAULT_VISITOR_KEYS] The keys of each node types to traverse child nodes. Default is `./default-visitor-keys.json`. + * @param {Function} [options.enter=noop] The callback function which is called on entering each node. + * @param {Function} [options.leave=noop] The callback function which is called on leaving each node. + * @returns {void} + */ + static traverse(node, options) { + new Traverser().traverse(node, options); + } + + /** + * The default visitor keys. + * @type {Object} + */ + static get DEFAULT_VISITOR_KEYS() { + return vk.KEYS; + } +} + +module.exports = Traverser; diff --git a/node_modules/eslint/lib/shared/types.js b/node_modules/eslint/lib/shared/types.js new file mode 100644 index 000000000..8ad3b1b64 --- /dev/null +++ b/node_modules/eslint/lib/shared/types.js @@ -0,0 +1,150 @@ +/** + * @fileoverview Define common types for input completion. + * @author Toru Nagashima + */ +"use strict"; + +/** @type {any} */ +module.exports = {}; + +/** @typedef {boolean | "off" | "readable" | "readonly" | "writable" | "writeable"} GlobalConf */ +/** @typedef {0 | 1 | 2 | "off" | "warn" | "error"} SeverityConf */ +/** @typedef {SeverityConf | [SeverityConf, ...any[]]} RuleConf */ + +/** + * @typedef {Object} EcmaFeatures + * @property {boolean} [globalReturn] Enabling `return` statements at the top-level. + * @property {boolean} [jsx] Enabling JSX syntax. + * @property {boolean} [impliedStrict] Enabling strict mode always. + */ + +/** + * @typedef {Object} ParserOptions + * @property {EcmaFeatures} [ecmaFeatures] The optional features. + * @property {3|5|6|7|8|9|10|11|12|2015|2016|2017|2018|2019|2020|2021} [ecmaVersion] The ECMAScript version (or revision number). + * @property {"script"|"module"} [sourceType] The source code type. + */ + +/** + * @typedef {Object} ConfigData + * @property {Record} [env] The environment settings. + * @property {string | string[]} [extends] The path to other config files or the package name of shareable configs. + * @property {Record} [globals] The global variable settings. + * @property {string | string[]} [ignorePatterns] The glob patterns that ignore to lint. + * @property {boolean} [noInlineConfig] The flag that disables directive comments. + * @property {OverrideConfigData[]} [overrides] The override settings per kind of files. + * @property {string} [parser] The path to a parser or the package name of a parser. + * @property {ParserOptions} [parserOptions] The parser options. + * @property {string[]} [plugins] The plugin specifiers. + * @property {string} [processor] The processor specifier. + * @property {boolean} [reportUnusedDisableDirectives] The flag to report unused `eslint-disable` comments. + * @property {boolean} [root] The root flag. + * @property {Record} [rules] The rule settings. + * @property {Object} [settings] The shared settings. + */ + +/** + * @typedef {Object} OverrideConfigData + * @property {Record} [env] The environment settings. + * @property {string | string[]} [excludedFiles] The glob pattarns for excluded files. + * @property {string | string[]} [extends] The path to other config files or the package name of shareable configs. + * @property {string | string[]} files The glob pattarns for target files. + * @property {Record} [globals] The global variable settings. + * @property {boolean} [noInlineConfig] The flag that disables directive comments. + * @property {OverrideConfigData[]} [overrides] The override settings per kind of files. + * @property {string} [parser] The path to a parser or the package name of a parser. + * @property {ParserOptions} [parserOptions] The parser options. + * @property {string[]} [plugins] The plugin specifiers. + * @property {string} [processor] The processor specifier. + * @property {boolean} [reportUnusedDisableDirectives] The flag to report unused `eslint-disable` comments. + * @property {Record} [rules] The rule settings. + * @property {Object} [settings] The shared settings. + */ + +/** + * @typedef {Object} ParseResult + * @property {Object} ast The AST. + * @property {ScopeManager} [scopeManager] The scope manager of the AST. + * @property {Record} [services] The services that the parser provides. + * @property {Record} [visitorKeys] The visitor keys of the AST. + */ + +/** + * @typedef {Object} Parser + * @property {(text:string, options:ParserOptions) => Object} parse The definition of global variables. + * @property {(text:string, options:ParserOptions) => ParseResult} [parseForESLint] The parser options that will be enabled under this environment. + */ + +/** + * @typedef {Object} Environment + * @property {Record} [globals] The definition of global variables. + * @property {ParserOptions} [parserOptions] The parser options that will be enabled under this environment. + */ + +/** + * @typedef {Object} LintMessage + * @property {number} column The 1-based column number. + * @property {number} [endColumn] The 1-based column number of the end location. + * @property {number} [endLine] The 1-based line number of the end location. + * @property {boolean} fatal If `true` then this is a fatal error. + * @property {{range:[number,number], text:string}} [fix] Information for autofix. + * @property {number} line The 1-based line number. + * @property {string} message The error message. + * @property {string|null} ruleId The ID of the rule which makes this message. + * @property {0|1|2} severity The severity of this message. + * @property {Array<{desc?: string, messageId?: string, fix: {range: [number, number], text: string}}>} [suggestions] Information for suggestions. + */ + +/** + * @typedef {Object} SuggestionResult + * @property {string} desc A short description. + * @property {string} [messageId] Id referencing a message for the description. + * @property {{ text: string, range: number[] }} fix fix result info + */ + +/** + * @typedef {Object} Processor + * @property {(text:string, filename:string) => Array} [preprocess] The function to extract code blocks. + * @property {(messagesList:LintMessage[][], filename:string) => LintMessage[]} [postprocess] The function to merge messages. + * @property {boolean} [supportsAutofix] If `true` then it means the processor supports autofix. + */ + +/** + * @typedef {Object} RuleMetaDocs + * @property {string} category The category of the rule. + * @property {string} description The description of the rule. + * @property {boolean} recommended If `true` then the rule is included in `eslint:recommended` preset. + * @property {string} url The URL of the rule documentation. + */ + +/** + * @typedef {Object} RuleMeta + * @property {boolean} [deprecated] If `true` then the rule has been deprecated. + * @property {RuleMetaDocs} docs The document information of the rule. + * @property {"code"|"whitespace"} [fixable] The autofix type. + * @property {Record} [messages] The messages the rule reports. + * @property {string[]} [replacedBy] The IDs of the alternative rules. + * @property {Array|Object} schema The option schema of the rule. + * @property {"problem"|"suggestion"|"layout"} type The rule type. + */ + +/** + * @typedef {Object} Rule + * @property {Function} create The factory of the rule. + * @property {RuleMeta} meta The meta data of the rule. + */ + +/** + * @typedef {Object} Plugin + * @property {Record} [configs] The definition of plugin configs. + * @property {Record} [environments] The definition of plugin environments. + * @property {Record} [processors] The definition of plugin processors. + * @property {Record} [rules] The definition of plugin rules. + */ + +/** + * Information of deprecated rules. + * @typedef {Object} DeprecatedRuleInfo + * @property {string} ruleId The rule ID. + * @property {string[]} replacedBy The rule IDs that replace this deprecated rule. + */ diff --git a/node_modules/eslint/lib/source-code/index.js b/node_modules/eslint/lib/source-code/index.js new file mode 100644 index 000000000..76e27869f --- /dev/null +++ b/node_modules/eslint/lib/source-code/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = { + SourceCode: require("./source-code") +}; diff --git a/node_modules/eslint/lib/source-code/source-code.js b/node_modules/eslint/lib/source-code/source-code.js new file mode 100644 index 000000000..6b20495b6 --- /dev/null +++ b/node_modules/eslint/lib/source-code/source-code.js @@ -0,0 +1,586 @@ +/** + * @fileoverview Abstraction of JavaScript source code. + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const + { isCommentToken } = require("eslint-utils"), + TokenStore = require("./token-store"), + astUtils = require("../shared/ast-utils"), + Traverser = require("../shared/traverser"), + lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * Validates that the given AST has the required information. + * @param {ASTNode} ast The Program node of the AST to check. + * @throws {Error} If the AST doesn't contain the correct information. + * @returns {void} + * @private + */ +function validate(ast) { + if (!ast.tokens) { + throw new Error("AST is missing the tokens array."); + } + + if (!ast.comments) { + throw new Error("AST is missing the comments array."); + } + + if (!ast.loc) { + throw new Error("AST is missing location information."); + } + + if (!ast.range) { + throw new Error("AST is missing range information"); + } +} + +/** + * Check to see if its a ES6 export declaration. + * @param {ASTNode} astNode An AST node. + * @returns {boolean} whether the given node represents an export declaration. + * @private + */ +function looksLikeExport(astNode) { + return astNode.type === "ExportDefaultDeclaration" || astNode.type === "ExportNamedDeclaration" || + astNode.type === "ExportAllDeclaration" || astNode.type === "ExportSpecifier"; +} + +/** + * Merges two sorted lists into a larger sorted list in O(n) time. + * @param {Token[]} tokens The list of tokens. + * @param {Token[]} comments The list of comments. + * @returns {Token[]} A sorted list of tokens and comments. + * @private + */ +function sortedMerge(tokens, comments) { + const result = []; + let tokenIndex = 0; + let commentIndex = 0; + + while (tokenIndex < tokens.length || commentIndex < comments.length) { + if (commentIndex >= comments.length || tokenIndex < tokens.length && tokens[tokenIndex].range[0] < comments[commentIndex].range[0]) { + result.push(tokens[tokenIndex++]); + } else { + result.push(comments[commentIndex++]); + } + } + + return result; +} + +/** + * Determines if two nodes or tokens overlap. + * @param {ASTNode|Token} first The first node or token to check. + * @param {ASTNode|Token} second The second node or token to check. + * @returns {boolean} True if the two nodes or tokens overlap. + * @private + */ +function nodesOrTokensOverlap(first, second) { + return (first.range[0] <= second.range[0] && first.range[1] >= second.range[0]) || + (second.range[0] <= first.range[0] && second.range[1] >= first.range[0]); +} + +/** + * Determines if two nodes or tokens have at least one whitespace character + * between them. Order does not matter. Returns false if the given nodes or + * tokens overlap. + * @param {SourceCode} sourceCode The source code object. + * @param {ASTNode|Token} first The first node or token to check between. + * @param {ASTNode|Token} second The second node or token to check between. + * @param {boolean} checkInsideOfJSXText If `true` is present, check inside of JSXText tokens for backward compatibility. + * @returns {boolean} True if there is a whitespace character between + * any of the tokens found between the two given nodes or tokens. + * @public + */ +function isSpaceBetween(sourceCode, first, second, checkInsideOfJSXText) { + if (nodesOrTokensOverlap(first, second)) { + return false; + } + + const [startingNodeOrToken, endingNodeOrToken] = first.range[1] <= second.range[0] + ? [first, second] + : [second, first]; + const firstToken = sourceCode.getLastToken(startingNodeOrToken) || startingNodeOrToken; + const finalToken = sourceCode.getFirstToken(endingNodeOrToken) || endingNodeOrToken; + let currentToken = firstToken; + + while (currentToken !== finalToken) { + const nextToken = sourceCode.getTokenAfter(currentToken, { includeComments: true }); + + if ( + currentToken.range[1] !== nextToken.range[0] || + + /* + * For backward compatibility, check spaces in JSXText. + * https://github.com/eslint/eslint/issues/12614 + */ + ( + checkInsideOfJSXText && + nextToken !== finalToken && + nextToken.type === "JSXText" && + /\s/u.test(nextToken.value) + ) + ) { + return true; + } + + currentToken = nextToken; + } + + return false; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +class SourceCode extends TokenStore { + + /** + * Represents parsed source code. + * @param {string|Object} textOrConfig The source code text or config object. + * @param {string} textOrConfig.text The source code text. + * @param {ASTNode} textOrConfig.ast The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped. + * @param {Object|null} textOrConfig.parserServices The parser services. + * @param {ScopeManager|null} textOrConfig.scopeManager The scope of this source code. + * @param {Object|null} textOrConfig.visitorKeys The visitor keys to traverse AST. + * @param {ASTNode} [astIfNoConfig] The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped. + */ + constructor(textOrConfig, astIfNoConfig) { + let text, ast, parserServices, scopeManager, visitorKeys; + + // Process overloading. + if (typeof textOrConfig === "string") { + text = textOrConfig; + ast = astIfNoConfig; + } else if (typeof textOrConfig === "object" && textOrConfig !== null) { + text = textOrConfig.text; + ast = textOrConfig.ast; + parserServices = textOrConfig.parserServices; + scopeManager = textOrConfig.scopeManager; + visitorKeys = textOrConfig.visitorKeys; + } + + validate(ast); + super(ast.tokens, ast.comments); + + /** + * The flag to indicate that the source code has Unicode BOM. + * @type boolean + */ + this.hasBOM = (text.charCodeAt(0) === 0xFEFF); + + /** + * The original text source code. + * BOM was stripped from this text. + * @type string + */ + this.text = (this.hasBOM ? text.slice(1) : text); + + /** + * The parsed AST for the source code. + * @type ASTNode + */ + this.ast = ast; + + /** + * The parser services of this source code. + * @type {Object} + */ + this.parserServices = parserServices || {}; + + /** + * The scope of this source code. + * @type {ScopeManager|null} + */ + this.scopeManager = scopeManager || null; + + /** + * The visitor keys to traverse AST. + * @type {Object} + */ + this.visitorKeys = visitorKeys || Traverser.DEFAULT_VISITOR_KEYS; + + // Check the source text for the presence of a shebang since it is parsed as a standard line comment. + const shebangMatched = this.text.match(astUtils.shebangPattern); + const hasShebang = shebangMatched && ast.comments.length && ast.comments[0].value === shebangMatched[1]; + + if (hasShebang) { + ast.comments[0].type = "Shebang"; + } + + this.tokensAndComments = sortedMerge(ast.tokens, ast.comments); + + /** + * The source code split into lines according to ECMA-262 specification. + * This is done to avoid each rule needing to do so separately. + * @type string[] + */ + this.lines = []; + this.lineStartIndices = [0]; + + const lineEndingPattern = astUtils.createGlobalLinebreakMatcher(); + let match; + + /* + * Previously, this was implemented using a regex that + * matched a sequence of non-linebreak characters followed by a + * linebreak, then adding the lengths of the matches. However, + * this caused a catastrophic backtracking issue when the end + * of a file contained a large number of non-newline characters. + * To avoid this, the current implementation just matches newlines + * and uses match.index to get the correct line start indices. + */ + while ((match = lineEndingPattern.exec(this.text))) { + this.lines.push(this.text.slice(this.lineStartIndices[this.lineStartIndices.length - 1], match.index)); + this.lineStartIndices.push(match.index + match[0].length); + } + this.lines.push(this.text.slice(this.lineStartIndices[this.lineStartIndices.length - 1])); + + // Cache for comments found using getComments(). + this._commentCache = new WeakMap(); + + // don't allow modification of this object + Object.freeze(this); + Object.freeze(this.lines); + } + + /** + * Split the source code into multiple lines based on the line delimiters. + * @param {string} text Source code as a string. + * @returns {string[]} Array of source code lines. + * @public + */ + static splitLines(text) { + return text.split(astUtils.createGlobalLinebreakMatcher()); + } + + /** + * Gets the source code for the given node. + * @param {ASTNode} [node] The AST node to get the text for. + * @param {int} [beforeCount] The number of characters before the node to retrieve. + * @param {int} [afterCount] The number of characters after the node to retrieve. + * @returns {string} The text representing the AST node. + * @public + */ + getText(node, beforeCount, afterCount) { + if (node) { + return this.text.slice(Math.max(node.range[0] - (beforeCount || 0), 0), + node.range[1] + (afterCount || 0)); + } + return this.text; + } + + /** + * Gets the entire source text split into an array of lines. + * @returns {Array} The source text as an array of lines. + * @public + */ + getLines() { + return this.lines; + } + + /** + * Retrieves an array containing all comments in the source code. + * @returns {ASTNode[]} An array of comment nodes. + * @public + */ + getAllComments() { + return this.ast.comments; + } + + /** + * Gets all comments for the given node. + * @param {ASTNode} node The AST node to get the comments for. + * @returns {Object} An object containing a leading and trailing array + * of comments indexed by their position. + * @public + * @deprecated replaced by getCommentsBefore(), getCommentsAfter(), and getCommentsInside(). + */ + getComments(node) { + if (this._commentCache.has(node)) { + return this._commentCache.get(node); + } + + const comments = { + leading: [], + trailing: [] + }; + + /* + * Return all comments as leading comments of the Program node when + * there is no executable code. + */ + if (node.type === "Program") { + if (node.body.length === 0) { + comments.leading = node.comments; + } + } else { + + /* + * Return comments as trailing comments of nodes that only contain + * comments (to mimic the comment attachment behavior present in Espree). + */ + if ((node.type === "BlockStatement" || node.type === "ClassBody") && node.body.length === 0 || + node.type === "ObjectExpression" && node.properties.length === 0 || + node.type === "ArrayExpression" && node.elements.length === 0 || + node.type === "SwitchStatement" && node.cases.length === 0 + ) { + comments.trailing = this.getTokens(node, { + includeComments: true, + filter: isCommentToken + }); + } + + /* + * Iterate over tokens before and after node and collect comment tokens. + * Do not include comments that exist outside of the parent node + * to avoid duplication. + */ + let currentToken = this.getTokenBefore(node, { includeComments: true }); + + while (currentToken && isCommentToken(currentToken)) { + if (node.parent && (currentToken.start < node.parent.start)) { + break; + } + comments.leading.push(currentToken); + currentToken = this.getTokenBefore(currentToken, { includeComments: true }); + } + + comments.leading.reverse(); + + currentToken = this.getTokenAfter(node, { includeComments: true }); + + while (currentToken && isCommentToken(currentToken)) { + if (node.parent && (currentToken.end > node.parent.end)) { + break; + } + comments.trailing.push(currentToken); + currentToken = this.getTokenAfter(currentToken, { includeComments: true }); + } + } + + this._commentCache.set(node, comments); + return comments; + } + + /** + * Retrieves the JSDoc comment for a given node. + * @param {ASTNode} node The AST node to get the comment for. + * @returns {Token|null} The Block comment token containing the JSDoc comment + * for the given node or null if not found. + * @public + * @deprecated + */ + getJSDocComment(node) { + + /** + * Checks for the presence of a JSDoc comment for the given node and returns it. + * @param {ASTNode} astNode The AST node to get the comment for. + * @returns {Token|null} The Block comment token containing the JSDoc comment + * for the given node or null if not found. + * @private + */ + const findJSDocComment = astNode => { + const tokenBefore = this.getTokenBefore(astNode, { includeComments: true }); + + if ( + tokenBefore && + isCommentToken(tokenBefore) && + tokenBefore.type === "Block" && + tokenBefore.value.charAt(0) === "*" && + astNode.loc.start.line - tokenBefore.loc.end.line <= 1 + ) { + return tokenBefore; + } + + return null; + }; + let parent = node.parent; + + switch (node.type) { + case "ClassDeclaration": + case "FunctionDeclaration": + return findJSDocComment(looksLikeExport(parent) ? parent : node); + + case "ClassExpression": + return findJSDocComment(parent.parent); + + case "ArrowFunctionExpression": + case "FunctionExpression": + if (parent.type !== "CallExpression" && parent.type !== "NewExpression") { + while ( + !this.getCommentsBefore(parent).length && + !/Function/u.test(parent.type) && + parent.type !== "MethodDefinition" && + parent.type !== "Property" + ) { + parent = parent.parent; + + if (!parent) { + break; + } + } + + if (parent && parent.type !== "FunctionDeclaration" && parent.type !== "Program") { + return findJSDocComment(parent); + } + } + + return findJSDocComment(node); + + // falls through + default: + return null; + } + } + + /** + * Gets the deepest node containing a range index. + * @param {int} index Range index of the desired node. + * @returns {ASTNode} The node if found or null if not found. + * @public + */ + getNodeByRangeIndex(index) { + let result = null; + + Traverser.traverse(this.ast, { + visitorKeys: this.visitorKeys, + enter(node) { + if (node.range[0] <= index && index < node.range[1]) { + result = node; + } else { + this.skip(); + } + }, + leave(node) { + if (node === result) { + this.break(); + } + } + }); + + return result; + } + + /** + * Determines if two nodes or tokens have at least one whitespace character + * between them. Order does not matter. Returns false if the given nodes or + * tokens overlap. + * @param {ASTNode|Token} first The first node or token to check between. + * @param {ASTNode|Token} second The second node or token to check between. + * @returns {boolean} True if there is a whitespace character between + * any of the tokens found between the two given nodes or tokens. + * @public + */ + isSpaceBetween(first, second) { + return isSpaceBetween(this, first, second, false); + } + + /** + * Determines if two nodes or tokens have at least one whitespace character + * between them. Order does not matter. Returns false if the given nodes or + * tokens overlap. + * For backward compatibility, this method returns true if there are + * `JSXText` tokens that contain whitespaces between the two. + * @param {ASTNode|Token} first The first node or token to check between. + * @param {ASTNode|Token} second The second node or token to check between. + * @returns {boolean} True if there is a whitespace character between + * any of the tokens found between the two given nodes or tokens. + * @deprecated in favor of isSpaceBetween(). + * @public + */ + isSpaceBetweenTokens(first, second) { + return isSpaceBetween(this, first, second, true); + } + + /** + * Converts a source text index into a (line, column) pair. + * @param {number} index The index of a character in a file + * @returns {Object} A {line, column} location object with a 0-indexed column + * @public + */ + getLocFromIndex(index) { + if (typeof index !== "number") { + throw new TypeError("Expected `index` to be a number."); + } + + if (index < 0 || index > this.text.length) { + throw new RangeError(`Index out of range (requested index ${index}, but source text has length ${this.text.length}).`); + } + + /* + * For an argument of this.text.length, return the location one "spot" past the last character + * of the file. If the last character is a linebreak, the location will be column 0 of the next + * line; otherwise, the location will be in the next column on the same line. + * + * See getIndexFromLoc for the motivation for this special case. + */ + if (index === this.text.length) { + return { line: this.lines.length, column: this.lines[this.lines.length - 1].length }; + } + + /* + * To figure out which line rangeIndex is on, determine the last index at which rangeIndex could + * be inserted into lineIndices to keep the list sorted. + */ + const lineNumber = lodash.sortedLastIndex(this.lineStartIndices, index); + + return { line: lineNumber, column: index - this.lineStartIndices[lineNumber - 1] }; + } + + /** + * Converts a (line, column) pair into a range index. + * @param {Object} loc A line/column location + * @param {number} loc.line The line number of the location (1-indexed) + * @param {number} loc.column The column number of the location (0-indexed) + * @returns {number} The range index of the location in the file. + * @public + */ + getIndexFromLoc(loc) { + if (typeof loc !== "object" || typeof loc.line !== "number" || typeof loc.column !== "number") { + throw new TypeError("Expected `loc` to be an object with numeric `line` and `column` properties."); + } + + if (loc.line <= 0) { + throw new RangeError(`Line number out of range (line ${loc.line} requested). Line numbers should be 1-based.`); + } + + if (loc.line > this.lineStartIndices.length) { + throw new RangeError(`Line number out of range (line ${loc.line} requested, but only ${this.lineStartIndices.length} lines present).`); + } + + const lineStartIndex = this.lineStartIndices[loc.line - 1]; + const lineEndIndex = loc.line === this.lineStartIndices.length ? this.text.length : this.lineStartIndices[loc.line]; + const positionIndex = lineStartIndex + loc.column; + + /* + * By design, getIndexFromLoc({ line: lineNum, column: 0 }) should return the start index of + * the given line, provided that the line number is valid element of this.lines. Since the + * last element of this.lines is an empty string for files with trailing newlines, add a + * special case where getting the index for the first location after the end of the file + * will return the length of the file, rather than throwing an error. This allows rules to + * use getIndexFromLoc consistently without worrying about edge cases at the end of a file. + */ + if ( + loc.line === this.lineStartIndices.length && positionIndex > lineEndIndex || + loc.line < this.lineStartIndices.length && positionIndex >= lineEndIndex + ) { + throw new RangeError(`Column number out of range (column ${loc.column} requested, but the length of line ${loc.line} is ${lineEndIndex - lineStartIndex}).`); + } + + return positionIndex; + } +} + +module.exports = SourceCode; diff --git a/node_modules/eslint/lib/source-code/token-store/backward-token-comment-cursor.js b/node_modules/eslint/lib/source-code/token-store/backward-token-comment-cursor.js new file mode 100644 index 000000000..7255a6226 --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/backward-token-comment-cursor.js @@ -0,0 +1,57 @@ +/** + * @fileoverview Define the cursor which iterates tokens and comments in reverse. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Cursor = require("./cursor"); +const utils = require("./utils"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The cursor which iterates tokens and comments in reverse. + */ +module.exports = class BackwardTokenCommentCursor extends Cursor { + + /** + * Initializes this cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + */ + constructor(tokens, comments, indexMap, startLoc, endLoc) { + super(); + this.tokens = tokens; + this.comments = comments; + this.tokenIndex = utils.getLastIndex(tokens, indexMap, endLoc); + this.commentIndex = utils.search(comments, endLoc) - 1; + this.border = startLoc; + } + + /** @inheritdoc */ + moveNext() { + const token = (this.tokenIndex >= 0) ? this.tokens[this.tokenIndex] : null; + const comment = (this.commentIndex >= 0) ? this.comments[this.commentIndex] : null; + + if (token && (!comment || token.range[1] > comment.range[1])) { + this.current = token; + this.tokenIndex -= 1; + } else if (comment) { + this.current = comment; + this.commentIndex -= 1; + } else { + this.current = null; + } + + return Boolean(this.current) && (this.border === -1 || this.current.range[0] >= this.border); + } +}; diff --git a/node_modules/eslint/lib/source-code/token-store/backward-token-cursor.js b/node_modules/eslint/lib/source-code/token-store/backward-token-cursor.js new file mode 100644 index 000000000..454a24497 --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/backward-token-cursor.js @@ -0,0 +1,58 @@ +/** + * @fileoverview Define the cursor which iterates tokens only in reverse. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Cursor = require("./cursor"); +const utils = require("./utils"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The cursor which iterates tokens only in reverse. + */ +module.exports = class BackwardTokenCursor extends Cursor { + + /** + * Initializes this cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + */ + constructor(tokens, comments, indexMap, startLoc, endLoc) { + super(); + this.tokens = tokens; + this.index = utils.getLastIndex(tokens, indexMap, endLoc); + this.indexEnd = utils.getFirstIndex(tokens, indexMap, startLoc); + } + + /** @inheritdoc */ + moveNext() { + if (this.index >= this.indexEnd) { + this.current = this.tokens[this.index]; + this.index -= 1; + return true; + } + return false; + } + + /* + * + * Shorthand for performance. + * + */ + + /** @inheritdoc */ + getOneToken() { + return (this.index >= this.indexEnd) ? this.tokens[this.index] : null; + } +}; diff --git a/node_modules/eslint/lib/source-code/token-store/cursor.js b/node_modules/eslint/lib/source-code/token-store/cursor.js new file mode 100644 index 000000000..4e1595c6d --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/cursor.js @@ -0,0 +1,76 @@ +/** + * @fileoverview Define the abstract class about cursors which iterate tokens. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The abstract class about cursors which iterate tokens. + * + * This class has 2 abstract methods. + * + * - `current: Token | Comment | null` ... The current token. + * - `moveNext(): boolean` ... Moves this cursor to the next token. If the next token didn't exist, it returns `false`. + * + * This is similar to ES2015 Iterators. + * However, Iterators were slow (at 2017-01), so I created this class as similar to C# IEnumerable. + * + * There are the following known sub classes. + * + * - ForwardTokenCursor .......... The cursor which iterates tokens only. + * - BackwardTokenCursor ......... The cursor which iterates tokens only in reverse. + * - ForwardTokenCommentCursor ... The cursor which iterates tokens and comments. + * - BackwardTokenCommentCursor .. The cursor which iterates tokens and comments in reverse. + * - DecorativeCursor + * - FilterCursor ............ The cursor which ignores the specified tokens. + * - SkipCursor .............. The cursor which ignores the first few tokens. + * - LimitCursor ............. The cursor which limits the count of tokens. + * + */ +module.exports = class Cursor { + + /** + * Initializes this cursor. + */ + constructor() { + this.current = null; + } + + /** + * Gets the first token. + * This consumes this cursor. + * @returns {Token|Comment} The first token or null. + */ + getOneToken() { + return this.moveNext() ? this.current : null; + } + + /** + * Gets the first tokens. + * This consumes this cursor. + * @returns {(Token|Comment)[]} All tokens. + */ + getAllTokens() { + const tokens = []; + + while (this.moveNext()) { + tokens.push(this.current); + } + + return tokens; + } + + /** + * Moves this cursor to the next token. + * @returns {boolean} `true` if the next token exists. + * @abstract + */ + /* istanbul ignore next */ + moveNext() { // eslint-disable-line class-methods-use-this + throw new Error("Not implemented."); + } +}; diff --git a/node_modules/eslint/lib/source-code/token-store/cursors.js b/node_modules/eslint/lib/source-code/token-store/cursors.js new file mode 100644 index 000000000..30c72b69b --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/cursors.js @@ -0,0 +1,90 @@ +/** + * @fileoverview Define 2 token factories; forward and backward. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const BackwardTokenCommentCursor = require("./backward-token-comment-cursor"); +const BackwardTokenCursor = require("./backward-token-cursor"); +const FilterCursor = require("./filter-cursor"); +const ForwardTokenCommentCursor = require("./forward-token-comment-cursor"); +const ForwardTokenCursor = require("./forward-token-cursor"); +const LimitCursor = require("./limit-cursor"); +const SkipCursor = require("./skip-cursor"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * The cursor factory. + * @private + */ +class CursorFactory { + + /** + * Initializes this cursor. + * @param {Function} TokenCursor The class of the cursor which iterates tokens only. + * @param {Function} TokenCommentCursor The class of the cursor which iterates the mix of tokens and comments. + */ + constructor(TokenCursor, TokenCommentCursor) { + this.TokenCursor = TokenCursor; + this.TokenCommentCursor = TokenCommentCursor; + } + + /** + * Creates a base cursor instance that can be decorated by createCursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {boolean} includeComments The flag to iterate comments as well. + * @returns {Cursor} The created base cursor. + */ + createBaseCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments) { + const Cursor = includeComments ? this.TokenCommentCursor : this.TokenCursor; + + return new Cursor(tokens, comments, indexMap, startLoc, endLoc); + } + + /** + * Creates a cursor that iterates tokens with normalized options. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {boolean} includeComments The flag to iterate comments as well. + * @param {Function|null} filter The predicate function to choose tokens. + * @param {number} skip The count of tokens the cursor skips. + * @param {number} count The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility. + * @returns {Cursor} The created cursor. + */ + createCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments, filter, skip, count) { + let cursor = this.createBaseCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments); + + if (filter) { + cursor = new FilterCursor(cursor, filter); + } + if (skip >= 1) { + cursor = new SkipCursor(cursor, skip); + } + if (count >= 0) { + cursor = new LimitCursor(cursor, count); + } + + return cursor; + } +} + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +exports.forward = new CursorFactory(ForwardTokenCursor, ForwardTokenCommentCursor); +exports.backward = new CursorFactory(BackwardTokenCursor, BackwardTokenCommentCursor); diff --git a/node_modules/eslint/lib/source-code/token-store/decorative-cursor.js b/node_modules/eslint/lib/source-code/token-store/decorative-cursor.js new file mode 100644 index 000000000..3ee7b0b39 --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/decorative-cursor.js @@ -0,0 +1,39 @@ +/** + * @fileoverview Define the abstract class about cursors which manipulate another cursor. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Cursor = require("./cursor"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The abstract class about cursors which manipulate another cursor. + */ +module.exports = class DecorativeCursor extends Cursor { + + /** + * Initializes this cursor. + * @param {Cursor} cursor The cursor to be decorated. + */ + constructor(cursor) { + super(); + this.cursor = cursor; + } + + /** @inheritdoc */ + moveNext() { + const retv = this.cursor.moveNext(); + + this.current = this.cursor.current; + + return retv; + } +}; diff --git a/node_modules/eslint/lib/source-code/token-store/filter-cursor.js b/node_modules/eslint/lib/source-code/token-store/filter-cursor.js new file mode 100644 index 000000000..08c4f2203 --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/filter-cursor.js @@ -0,0 +1,43 @@ +/** + * @fileoverview Define the cursor which ignores specified tokens. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const DecorativeCursor = require("./decorative-cursor"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The decorative cursor which ignores specified tokens. + */ +module.exports = class FilterCursor extends DecorativeCursor { + + /** + * Initializes this cursor. + * @param {Cursor} cursor The cursor to be decorated. + * @param {Function} predicate The predicate function to decide tokens this cursor iterates. + */ + constructor(cursor, predicate) { + super(cursor); + this.predicate = predicate; + } + + /** @inheritdoc */ + moveNext() { + const predicate = this.predicate; + + while (super.moveNext()) { + if (predicate(this.current)) { + return true; + } + } + return false; + } +}; diff --git a/node_modules/eslint/lib/source-code/token-store/forward-token-comment-cursor.js b/node_modules/eslint/lib/source-code/token-store/forward-token-comment-cursor.js new file mode 100644 index 000000000..50c7a394f --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/forward-token-comment-cursor.js @@ -0,0 +1,57 @@ +/** + * @fileoverview Define the cursor which iterates tokens and comments. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Cursor = require("./cursor"); +const utils = require("./utils"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The cursor which iterates tokens and comments. + */ +module.exports = class ForwardTokenCommentCursor extends Cursor { + + /** + * Initializes this cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + */ + constructor(tokens, comments, indexMap, startLoc, endLoc) { + super(); + this.tokens = tokens; + this.comments = comments; + this.tokenIndex = utils.getFirstIndex(tokens, indexMap, startLoc); + this.commentIndex = utils.search(comments, startLoc); + this.border = endLoc; + } + + /** @inheritdoc */ + moveNext() { + const token = (this.tokenIndex < this.tokens.length) ? this.tokens[this.tokenIndex] : null; + const comment = (this.commentIndex < this.comments.length) ? this.comments[this.commentIndex] : null; + + if (token && (!comment || token.range[0] < comment.range[0])) { + this.current = token; + this.tokenIndex += 1; + } else if (comment) { + this.current = comment; + this.commentIndex += 1; + } else { + this.current = null; + } + + return Boolean(this.current) && (this.border === -1 || this.current.range[1] <= this.border); + } +}; diff --git a/node_modules/eslint/lib/source-code/token-store/forward-token-cursor.js b/node_modules/eslint/lib/source-code/token-store/forward-token-cursor.js new file mode 100644 index 000000000..e8c186096 --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/forward-token-cursor.js @@ -0,0 +1,63 @@ +/** + * @fileoverview Define the cursor which iterates tokens only. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Cursor = require("./cursor"); +const utils = require("./utils"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The cursor which iterates tokens only. + */ +module.exports = class ForwardTokenCursor extends Cursor { + + /** + * Initializes this cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + */ + constructor(tokens, comments, indexMap, startLoc, endLoc) { + super(); + this.tokens = tokens; + this.index = utils.getFirstIndex(tokens, indexMap, startLoc); + this.indexEnd = utils.getLastIndex(tokens, indexMap, endLoc); + } + + /** @inheritdoc */ + moveNext() { + if (this.index <= this.indexEnd) { + this.current = this.tokens[this.index]; + this.index += 1; + return true; + } + return false; + } + + /* + * + * Shorthand for performance. + * + */ + + /** @inheritdoc */ + getOneToken() { + return (this.index <= this.indexEnd) ? this.tokens[this.index] : null; + } + + /** @inheritdoc */ + getAllTokens() { + return this.tokens.slice(this.index, this.indexEnd + 1); + } +}; diff --git a/node_modules/eslint/lib/source-code/token-store/index.js b/node_modules/eslint/lib/source-code/token-store/index.js new file mode 100644 index 000000000..25db8a4f4 --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/index.js @@ -0,0 +1,627 @@ +/** + * @fileoverview Object to handle access and retrieval of tokens. + * @author Brandon Mills + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const assert = require("assert"); +const { isCommentToken } = require("eslint-utils"); +const cursors = require("./cursors"); +const ForwardTokenCursor = require("./forward-token-cursor"); +const PaddedTokenCursor = require("./padded-token-cursor"); +const utils = require("./utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const TOKENS = Symbol("tokens"); +const COMMENTS = Symbol("comments"); +const INDEX_MAP = Symbol("indexMap"); + +/** + * Creates the map from locations to indices in `tokens`. + * + * The first/last location of tokens is mapped to the index of the token. + * The first/last location of comments is mapped to the index of the next token of each comment. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @returns {Object} The map from locations to indices in `tokens`. + * @private + */ +function createIndexMap(tokens, comments) { + const map = Object.create(null); + let tokenIndex = 0; + let commentIndex = 0; + let nextStart = 0; + let range = null; + + while (tokenIndex < tokens.length || commentIndex < comments.length) { + nextStart = (commentIndex < comments.length) ? comments[commentIndex].range[0] : Number.MAX_SAFE_INTEGER; + while (tokenIndex < tokens.length && (range = tokens[tokenIndex].range)[0] < nextStart) { + map[range[0]] = tokenIndex; + map[range[1] - 1] = tokenIndex; + tokenIndex += 1; + } + + nextStart = (tokenIndex < tokens.length) ? tokens[tokenIndex].range[0] : Number.MAX_SAFE_INTEGER; + while (commentIndex < comments.length && (range = comments[commentIndex].range)[0] < nextStart) { + map[range[0]] = tokenIndex; + map[range[1] - 1] = tokenIndex; + commentIndex += 1; + } + } + + return map; +} + +/** + * Creates the cursor iterates tokens with options. + * @param {CursorFactory} factory The cursor factory to initialize cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {number|Function|Object} [opts=0] The option object. If this is a number then it's `opts.skip`. If this is a function then it's `opts.filter`. + * @param {boolean} [opts.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [opts.filter=null] The predicate function to choose tokens. + * @param {number} [opts.skip=0] The count of tokens the cursor skips. + * @returns {Cursor} The created cursor. + * @private + */ +function createCursorWithSkip(factory, tokens, comments, indexMap, startLoc, endLoc, opts) { + let includeComments = false; + let skip = 0; + let filter = null; + + if (typeof opts === "number") { + skip = opts | 0; + } else if (typeof opts === "function") { + filter = opts; + } else if (opts) { + includeComments = !!opts.includeComments; + skip = opts.skip | 0; + filter = opts.filter || null; + } + assert(skip >= 0, "options.skip should be zero or a positive integer."); + assert(!filter || typeof filter === "function", "options.filter should be a function."); + + return factory.createCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments, filter, skip, -1); +} + +/** + * Creates the cursor iterates tokens with options. + * @param {CursorFactory} factory The cursor factory to initialize cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {number|Function|Object} [opts=0] The option object. If this is a number then it's `opts.count`. If this is a function then it's `opts.filter`. + * @param {boolean} [opts.includeComments] The flag to iterate comments as well. + * @param {Function|null} [opts.filter=null] The predicate function to choose tokens. + * @param {number} [opts.count=0] The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility. + * @returns {Cursor} The created cursor. + * @private + */ +function createCursorWithCount(factory, tokens, comments, indexMap, startLoc, endLoc, opts) { + let includeComments = false; + let count = 0; + let countExists = false; + let filter = null; + + if (typeof opts === "number") { + count = opts | 0; + countExists = true; + } else if (typeof opts === "function") { + filter = opts; + } else if (opts) { + includeComments = !!opts.includeComments; + count = opts.count | 0; + countExists = typeof opts.count === "number"; + filter = opts.filter || null; + } + assert(count >= 0, "options.count should be zero or a positive integer."); + assert(!filter || typeof filter === "function", "options.filter should be a function."); + + return factory.createCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments, filter, 0, countExists ? count : -1); +} + +/** + * Creates the cursor iterates tokens with options. + * This is overload function of the below. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {Function|Object} opts The option object. If this is a function then it's `opts.filter`. + * @param {boolean} [opts.includeComments] The flag to iterate comments as well. + * @param {Function|null} [opts.filter=null] The predicate function to choose tokens. + * @param {number} [opts.count=0] The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility. + * @returns {Cursor} The created cursor. + * @private + */ +/** + * Creates the cursor iterates tokens with options. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {number} [beforeCount=0] The number of tokens before the node to retrieve. + * @param {boolean} [afterCount=0] The number of tokens after the node to retrieve. + * @returns {Cursor} The created cursor. + * @private + */ +function createCursorWithPadding(tokens, comments, indexMap, startLoc, endLoc, beforeCount, afterCount) { + if (typeof beforeCount === "undefined" && typeof afterCount === "undefined") { + return new ForwardTokenCursor(tokens, comments, indexMap, startLoc, endLoc); + } + if (typeof beforeCount === "number" || typeof beforeCount === "undefined") { + return new PaddedTokenCursor(tokens, comments, indexMap, startLoc, endLoc, beforeCount | 0, afterCount | 0); + } + return createCursorWithCount(cursors.forward, tokens, comments, indexMap, startLoc, endLoc, beforeCount); +} + +/** + * Gets comment tokens that are adjacent to the current cursor position. + * @param {Cursor} cursor A cursor instance. + * @returns {Array} An array of comment tokens adjacent to the current cursor position. + * @private + */ +function getAdjacentCommentTokensFromCursor(cursor) { + const tokens = []; + let currentToken = cursor.getOneToken(); + + while (currentToken && isCommentToken(currentToken)) { + tokens.push(currentToken); + currentToken = cursor.getOneToken(); + } + + return tokens; +} + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The token store. + * + * This class provides methods to get tokens by locations as fast as possible. + * The methods are a part of public API, so we should be careful if it changes this class. + * + * People can get tokens in O(1) by the hash map which is mapping from the location of tokens/comments to tokens. + * Also people can get a mix of tokens and comments in O(log k), the k is the number of comments. + * Assuming that comments to be much fewer than tokens, this does not make hash map from token's locations to comments to reduce memory cost. + * This uses binary-searching instead for comments. + */ +module.exports = class TokenStore { + + /** + * Initializes this token store. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + */ + constructor(tokens, comments) { + this[TOKENS] = tokens; + this[COMMENTS] = comments; + this[INDEX_MAP] = createIndexMap(tokens, comments); + } + + //-------------------------------------------------------------------------- + // Gets single token. + //-------------------------------------------------------------------------- + + /** + * Gets the token starting at the specified index. + * @param {number} offset Index of the start of the token's range. + * @param {Object} [options=0] The option object. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. + * @returns {Token|null} The token starting at index, or null if no such token. + */ + getTokenByRangeStart(offset, options) { + const includeComments = options && options.includeComments; + const token = cursors.forward.createBaseCursor( + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + offset, + -1, + includeComments + ).getOneToken(); + + if (token && token.range[0] === offset) { + return token; + } + return null; + } + + /** + * Gets the first token of the given node. + * @param {ASTNode} node The AST node. + * @param {number|Function|Object} [options=0] The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [options.filter=null] The predicate function to choose tokens. + * @param {number} [options.skip=0] The count of tokens the cursor skips. + * @returns {Token|null} An object representing the token. + */ + getFirstToken(node, options) { + return createCursorWithSkip( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[0], + node.range[1], + options + ).getOneToken(); + } + + /** + * Gets the last token of the given node. + * @param {ASTNode} node The AST node. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() + * @returns {Token|null} An object representing the token. + */ + getLastToken(node, options) { + return createCursorWithSkip( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[0], + node.range[1], + options + ).getOneToken(); + } + + /** + * Gets the token that precedes a given node or token. + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() + * @returns {Token|null} An object representing the token. + */ + getTokenBefore(node, options) { + return createCursorWithSkip( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + -1, + node.range[0], + options + ).getOneToken(); + } + + /** + * Gets the token that follows a given node or token. + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() + * @returns {Token|null} An object representing the token. + */ + getTokenAfter(node, options) { + return createCursorWithSkip( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[1], + -1, + options + ).getOneToken(); + } + + /** + * Gets the first token between two non-overlapping nodes. + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() + * @returns {Token|null} An object representing the token. + */ + getFirstTokenBetween(left, right, options) { + return createCursorWithSkip( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + left.range[1], + right.range[0], + options + ).getOneToken(); + } + + /** + * Gets the last token between two non-overlapping nodes. + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() + * @returns {Token|null} An object representing the token. + */ + getLastTokenBetween(left, right, options) { + return createCursorWithSkip( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + left.range[1], + right.range[0], + options + ).getOneToken(); + } + + /** + * Gets the token that precedes a given node or token in the token stream. + * This is defined for backward compatibility. Use `includeComments` option instead. + * TODO: We have a plan to remove this in a future major version. + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number} [skip=0] A number of tokens to skip. + * @returns {Token|null} An object representing the token. + * @deprecated + */ + getTokenOrCommentBefore(node, skip) { + return this.getTokenBefore(node, { includeComments: true, skip }); + } + + /** + * Gets the token that follows a given node or token in the token stream. + * This is defined for backward compatibility. Use `includeComments` option instead. + * TODO: We have a plan to remove this in a future major version. + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number} [skip=0] A number of tokens to skip. + * @returns {Token|null} An object representing the token. + * @deprecated + */ + getTokenOrCommentAfter(node, skip) { + return this.getTokenAfter(node, { includeComments: true, skip }); + } + + //-------------------------------------------------------------------------- + // Gets multiple tokens. + //-------------------------------------------------------------------------- + + /** + * Gets the first `count` tokens of the given node. + * @param {ASTNode} node The AST node. + * @param {number|Function|Object} [options=0] The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [options.filter=null] The predicate function to choose tokens. + * @param {number} [options.count=0] The maximum count of tokens the cursor iterates. + * @returns {Token[]} Tokens. + */ + getFirstTokens(node, options) { + return createCursorWithCount( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[0], + node.range[1], + options + ).getAllTokens(); + } + + /** + * Gets the last `count` tokens of the given node. + * @param {ASTNode} node The AST node. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() + * @returns {Token[]} Tokens. + */ + getLastTokens(node, options) { + return createCursorWithCount( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[0], + node.range[1], + options + ).getAllTokens().reverse(); + } + + /** + * Gets the `count` tokens that precedes a given node or token. + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() + * @returns {Token[]} Tokens. + */ + getTokensBefore(node, options) { + return createCursorWithCount( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + -1, + node.range[0], + options + ).getAllTokens().reverse(); + } + + /** + * Gets the `count` tokens that follows a given node or token. + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() + * @returns {Token[]} Tokens. + */ + getTokensAfter(node, options) { + return createCursorWithCount( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[1], + -1, + options + ).getAllTokens(); + } + + /** + * Gets the first `count` tokens between two non-overlapping nodes. + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() + * @returns {Token[]} Tokens between left and right. + */ + getFirstTokensBetween(left, right, options) { + return createCursorWithCount( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + left.range[1], + right.range[0], + options + ).getAllTokens(); + } + + /** + * Gets the last `count` tokens between two non-overlapping nodes. + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() + * @returns {Token[]} Tokens between left and right. + */ + getLastTokensBetween(left, right, options) { + return createCursorWithCount( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + left.range[1], + right.range[0], + options + ).getAllTokens().reverse(); + } + + /** + * Gets all tokens that are related to the given node. + * @param {ASTNode} node The AST node. + * @param {Function|Object} options The option object. If this is a function then it's `options.filter`. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [options.filter=null] The predicate function to choose tokens. + * @param {number} [options.count=0] The maximum count of tokens the cursor iterates. + * @returns {Token[]} Array of objects representing tokens. + */ + /** + * Gets all tokens that are related to the given node. + * @param {ASTNode} node The AST node. + * @param {int} [beforeCount=0] The number of tokens before the node to retrieve. + * @param {int} [afterCount=0] The number of tokens after the node to retrieve. + * @returns {Token[]} Array of objects representing tokens. + */ + getTokens(node, beforeCount, afterCount) { + return createCursorWithPadding( + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[0], + node.range[1], + beforeCount, + afterCount + ).getAllTokens(); + } + + /** + * Gets all of the tokens between two non-overlapping nodes. + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {Function|Object} options The option object. If this is a function then it's `options.filter`. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [options.filter=null] The predicate function to choose tokens. + * @param {number} [options.count=0] The maximum count of tokens the cursor iterates. + * @returns {Token[]} Tokens between left and right. + */ + /** + * Gets all of the tokens between two non-overlapping nodes. + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {int} [padding=0] Number of extra tokens on either side of center. + * @returns {Token[]} Tokens between left and right. + */ + getTokensBetween(left, right, padding) { + return createCursorWithPadding( + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + left.range[1], + right.range[0], + padding, + padding + ).getAllTokens(); + } + + //-------------------------------------------------------------------------- + // Others. + //-------------------------------------------------------------------------- + + /** + * Checks whether any comments exist or not between the given 2 nodes. + * @param {ASTNode} left The node to check. + * @param {ASTNode} right The node to check. + * @returns {boolean} `true` if one or more comments exist. + */ + commentsExistBetween(left, right) { + const index = utils.search(this[COMMENTS], left.range[1]); + + return ( + index < this[COMMENTS].length && + this[COMMENTS][index].range[1] <= right.range[0] + ); + } + + /** + * Gets all comment tokens directly before the given node or token. + * @param {ASTNode|token} nodeOrToken The AST node or token to check for adjacent comment tokens. + * @returns {Array} An array of comments in occurrence order. + */ + getCommentsBefore(nodeOrToken) { + const cursor = createCursorWithCount( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + -1, + nodeOrToken.range[0], + { includeComments: true } + ); + + return getAdjacentCommentTokensFromCursor(cursor).reverse(); + } + + /** + * Gets all comment tokens directly after the given node or token. + * @param {ASTNode|token} nodeOrToken The AST node or token to check for adjacent comment tokens. + * @returns {Array} An array of comments in occurrence order. + */ + getCommentsAfter(nodeOrToken) { + const cursor = createCursorWithCount( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + nodeOrToken.range[1], + -1, + { includeComments: true } + ); + + return getAdjacentCommentTokensFromCursor(cursor); + } + + /** + * Gets all comment tokens inside the given node. + * @param {ASTNode} node The AST node to get the comments for. + * @returns {Array} An array of comments in occurrence order. + */ + getCommentsInside(node) { + return this.getTokens(node, { + includeComments: true, + filter: isCommentToken + }); + } +}; diff --git a/node_modules/eslint/lib/source-code/token-store/limit-cursor.js b/node_modules/eslint/lib/source-code/token-store/limit-cursor.js new file mode 100644 index 000000000..0fd92a776 --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/limit-cursor.js @@ -0,0 +1,40 @@ +/** + * @fileoverview Define the cursor which limits the number of tokens. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const DecorativeCursor = require("./decorative-cursor"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The decorative cursor which limits the number of tokens. + */ +module.exports = class LimitCursor extends DecorativeCursor { + + /** + * Initializes this cursor. + * @param {Cursor} cursor The cursor to be decorated. + * @param {number} count The count of tokens this cursor iterates. + */ + constructor(cursor, count) { + super(cursor); + this.count = count; + } + + /** @inheritdoc */ + moveNext() { + if (this.count > 0) { + this.count -= 1; + return super.moveNext(); + } + return false; + } +}; diff --git a/node_modules/eslint/lib/source-code/token-store/padded-token-cursor.js b/node_modules/eslint/lib/source-code/token-store/padded-token-cursor.js new file mode 100644 index 000000000..89349fa1c --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/padded-token-cursor.js @@ -0,0 +1,38 @@ +/** + * @fileoverview Define the cursor which iterates tokens only, with inflated range. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const ForwardTokenCursor = require("./forward-token-cursor"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The cursor which iterates tokens only, with inflated range. + * This is for the backward compatibility of padding options. + */ +module.exports = class PaddedTokenCursor extends ForwardTokenCursor { + + /** + * Initializes this cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {number} beforeCount The number of tokens this cursor iterates before start. + * @param {number} afterCount The number of tokens this cursor iterates after end. + */ + constructor(tokens, comments, indexMap, startLoc, endLoc, beforeCount, afterCount) { + super(tokens, comments, indexMap, startLoc, endLoc); + this.index = Math.max(0, this.index - beforeCount); + this.indexEnd = Math.min(tokens.length - 1, this.indexEnd + afterCount); + } +}; diff --git a/node_modules/eslint/lib/source-code/token-store/skip-cursor.js b/node_modules/eslint/lib/source-code/token-store/skip-cursor.js new file mode 100644 index 000000000..f068f531c --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/skip-cursor.js @@ -0,0 +1,42 @@ +/** + * @fileoverview Define the cursor which ignores the first few tokens. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const DecorativeCursor = require("./decorative-cursor"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The decorative cursor which ignores the first few tokens. + */ +module.exports = class SkipCursor extends DecorativeCursor { + + /** + * Initializes this cursor. + * @param {Cursor} cursor The cursor to be decorated. + * @param {number} count The count of tokens this cursor skips. + */ + constructor(cursor, count) { + super(cursor); + this.count = count; + } + + /** @inheritdoc */ + moveNext() { + while (this.count > 0) { + this.count -= 1; + if (!super.moveNext()) { + return false; + } + } + return super.moveNext(); + } +}; diff --git a/node_modules/eslint/lib/source-code/token-store/utils.js b/node_modules/eslint/lib/source-code/token-store/utils.js new file mode 100644 index 000000000..21e1d6ff7 --- /dev/null +++ b/node_modules/eslint/lib/source-code/token-store/utils.js @@ -0,0 +1,100 @@ +/** + * @fileoverview Define utility functions for token store. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets `token.range[0]` from the given token. + * @param {Node|Token|Comment} token The token to get. + * @returns {number} The start location. + * @private + */ +function getStartLocation(token) { + return token.range[0]; +} + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * Binary-searches the index of the first token which is after the given location. + * If it was not found, this returns `tokens.length`. + * @param {(Token|Comment)[]} tokens It searches the token in this list. + * @param {number} location The location to search. + * @returns {number} The found index or `tokens.length`. + */ +exports.search = function search(tokens, location) { + return lodash.sortedIndexBy( + tokens, + { range: [location] }, + getStartLocation + ); +}; + +/** + * Gets the index of the `startLoc` in `tokens`. + * `startLoc` can be the value of `node.range[1]`, so this checks about `startLoc - 1` as well. + * @param {(Token|Comment)[]} tokens The tokens to find an index. + * @param {Object} indexMap The map from locations to indices. + * @param {number} startLoc The location to get an index. + * @returns {number} The index. + */ +exports.getFirstIndex = function getFirstIndex(tokens, indexMap, startLoc) { + if (startLoc in indexMap) { + return indexMap[startLoc]; + } + if ((startLoc - 1) in indexMap) { + const index = indexMap[startLoc - 1]; + const token = (index >= 0 && index < tokens.length) ? tokens[index] : null; + + /* + * For the map of "comment's location -> token's index", it points the next token of a comment. + * In that case, +1 is unnecessary. + */ + if (token && token.range[0] >= startLoc) { + return index; + } + return index + 1; + } + return 0; +}; + +/** + * Gets the index of the `endLoc` in `tokens`. + * The information of end locations are recorded at `endLoc - 1` in `indexMap`, so this checks about `endLoc - 1` as well. + * @param {(Token|Comment)[]} tokens The tokens to find an index. + * @param {Object} indexMap The map from locations to indices. + * @param {number} endLoc The location to get an index. + * @returns {number} The index. + */ +exports.getLastIndex = function getLastIndex(tokens, indexMap, endLoc) { + if (endLoc in indexMap) { + return indexMap[endLoc] - 1; + } + if ((endLoc - 1) in indexMap) { + const index = indexMap[endLoc - 1]; + const token = (index >= 0 && index < tokens.length) ? tokens[index] : null; + + /* + * For the map of "comment's location -> token's index", it points the next token of a comment. + * In that case, -1 is necessary. + */ + if (token && token.range[1] > endLoc) { + return index - 1; + } + return index; + } + return tokens.length - 1; +}; diff --git a/node_modules/eslint/messages/all-files-ignored.txt b/node_modules/eslint/messages/all-files-ignored.txt new file mode 100644 index 000000000..3f4c8ced4 --- /dev/null +++ b/node_modules/eslint/messages/all-files-ignored.txt @@ -0,0 +1,8 @@ +You are linting "<%= pattern %>", but all of the files matching the glob pattern "<%= pattern %>" are ignored. + +If you don't want to lint these files, remove the pattern "<%= pattern %>" from the list of arguments passed to ESLint. + +If you do want to lint these files, try the following solutions: + +* Check your .eslintignore file, or the eslintIgnore property in package.json, to ensure that the files are not configured to be ignored. +* Explicitly list the files from this glob that you'd like to lint on the command-line, rather than providing a glob as an argument. diff --git a/node_modules/eslint/messages/extend-config-missing.txt b/node_modules/eslint/messages/extend-config-missing.txt new file mode 100644 index 000000000..4defd7ac4 --- /dev/null +++ b/node_modules/eslint/messages/extend-config-missing.txt @@ -0,0 +1,5 @@ +ESLint couldn't find the config "<%- configName %>" to extend from. Please check that the name of the config is correct. + +The config "<%- configName %>" was referenced from the config file in "<%- importerName %>". + +If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. diff --git a/node_modules/eslint/messages/failed-to-read-json.txt b/node_modules/eslint/messages/failed-to-read-json.txt new file mode 100644 index 000000000..b5e2b861c --- /dev/null +++ b/node_modules/eslint/messages/failed-to-read-json.txt @@ -0,0 +1,3 @@ +Failed to read JSON file at <%= path %>: + +<%= message %> diff --git a/node_modules/eslint/messages/file-not-found.txt b/node_modules/eslint/messages/file-not-found.txt new file mode 100644 index 000000000..639498eb5 --- /dev/null +++ b/node_modules/eslint/messages/file-not-found.txt @@ -0,0 +1,2 @@ +No files matching the pattern "<%= pattern %>"<% if (globDisabled) { %> (with disabling globs)<% } %> were found. +Please check for typing mistakes in the pattern. diff --git a/node_modules/eslint/messages/no-config-found.txt b/node_modules/eslint/messages/no-config-found.txt new file mode 100644 index 000000000..b46a7e5a7 --- /dev/null +++ b/node_modules/eslint/messages/no-config-found.txt @@ -0,0 +1,7 @@ +ESLint couldn't find a configuration file. To set up a configuration file for this project, please run: + + eslint --init + +ESLint looked for configuration files in <%= directoryPath %> and its ancestors. If it found none, it then looked in your home directory. + +If you think you already have a configuration file or if you need more help, please stop by the ESLint chat room: https://eslint.org/chat/help diff --git a/node_modules/eslint/messages/plugin-conflict.txt b/node_modules/eslint/messages/plugin-conflict.txt new file mode 100644 index 000000000..3ab4b340e --- /dev/null +++ b/node_modules/eslint/messages/plugin-conflict.txt @@ -0,0 +1,7 @@ +ESLint couldn't determine the plugin "<%- pluginId %>" uniquely. +<% for (const { filePath, importerName } of plugins) { %> +- <%= filePath %> (loaded in "<%= importerName %>")<% } %> + +Please remove the "plugins" setting from either config or remove either plugin installation. + +If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. diff --git a/node_modules/eslint/messages/plugin-invalid.txt b/node_modules/eslint/messages/plugin-invalid.txt new file mode 100644 index 000000000..3ee251821 --- /dev/null +++ b/node_modules/eslint/messages/plugin-invalid.txt @@ -0,0 +1,8 @@ +"<%- configName %>" is invalid syntax for a config specifier. + +* If your intention is to extend from a configuration exported from the plugin, add the configuration name after a slash: e.g. "<%- configName %>/myConfig". +* If this is the name of a shareable config instead of a plugin, remove the "plugin:" prefix: i.e. "<%- configName.slice("plugin:".length) %>". + +"<%- configName %>" was referenced from the config file in "<%- importerName %>". + +If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. diff --git a/node_modules/eslint/messages/plugin-missing.txt b/node_modules/eslint/messages/plugin-missing.txt new file mode 100644 index 000000000..aa25f59ac --- /dev/null +++ b/node_modules/eslint/messages/plugin-missing.txt @@ -0,0 +1,11 @@ +ESLint couldn't find the plugin "<%- pluginName %>". + +(The package "<%- pluginName %>" was not found when loaded as a Node module from the directory "<%- resolvePluginsRelativeTo %>".) + +It's likely that the plugin isn't installed correctly. Try reinstalling by running the following: + + npm install <%- pluginName %>@latest --save-dev + +The plugin "<%- pluginName %>" was referenced from the config file in "<%- importerName %>". + +If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. diff --git a/node_modules/eslint/messages/print-config-with-directory-path.txt b/node_modules/eslint/messages/print-config-with-directory-path.txt new file mode 100644 index 000000000..1afc9b1e8 --- /dev/null +++ b/node_modules/eslint/messages/print-config-with-directory-path.txt @@ -0,0 +1,2 @@ +The '--print-config' CLI option requires a path to a source code file rather than a directory. +See also: https://eslint.org/docs/user-guide/command-line-interface#--print-config diff --git a/node_modules/eslint/messages/whitespace-found.txt b/node_modules/eslint/messages/whitespace-found.txt new file mode 100644 index 000000000..3eed1af58 --- /dev/null +++ b/node_modules/eslint/messages/whitespace-found.txt @@ -0,0 +1,3 @@ +ESLint couldn't find the plugin "<%- pluginName %>". because there is whitespace in the name. Please check your configuration and remove all whitespace from the plugin name. + +If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. diff --git a/node_modules/eslint/node_modules/.bin/node-which b/node_modules/eslint/node_modules/.bin/node-which new file mode 120000 index 000000000..6f8415ec5 --- /dev/null +++ b/node_modules/eslint/node_modules/.bin/node-which @@ -0,0 +1 @@ +../which/bin/node-which \ No newline at end of file diff --git a/node_modules/eslint/node_modules/ansi-styles/index.d.ts b/node_modules/eslint/node_modules/ansi-styles/index.d.ts new file mode 100644 index 000000000..7e9b2b71b --- /dev/null +++ b/node_modules/eslint/node_modules/ansi-styles/index.d.ts @@ -0,0 +1,197 @@ +import * as cssColors from 'color-name'; + +declare namespace ansiStyles { + interface ColorConvert { + /** + The RGB color space. + + @param red - (`0`-`255`) + @param green - (`0`-`255`) + @param blue - (`0`-`255`) + */ + rgb(red: number, green: number, blue: number): string; + + /** + The RGB HEX color space. + + @param hex - A hexadecimal string containing RGB data. + */ + hex(hex: string): string; + + /** + @param keyword - A CSS color name. + */ + keyword(keyword: keyof typeof cssColors): string; + + /** + The HSL color space. + + @param hue - (`0`-`360`) + @param saturation - (`0`-`100`) + @param lightness - (`0`-`100`) + */ + hsl(hue: number, saturation: number, lightness: number): string; + + /** + The HSV color space. + + @param hue - (`0`-`360`) + @param saturation - (`0`-`100`) + @param value - (`0`-`100`) + */ + hsv(hue: number, saturation: number, value: number): string; + + /** + The HSV color space. + + @param hue - (`0`-`360`) + @param whiteness - (`0`-`100`) + @param blackness - (`0`-`100`) + */ + hwb(hue: number, whiteness: number, blackness: number): string; + + /** + Use a [4-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4-bit) to set text color. + */ + ansi(ansi: number): string; + + /** + Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. + */ + ansi256(ansi: number): string; + } + + interface CSPair { + /** + The ANSI terminal control sequence for starting this style. + */ + readonly open: string; + + /** + The ANSI terminal control sequence for ending this style. + */ + readonly close: string; + } + + interface ColorBase { + readonly ansi: ColorConvert; + readonly ansi256: ColorConvert; + readonly ansi16m: ColorConvert; + + /** + The ANSI terminal control sequence for ending this color. + */ + readonly close: string; + } + + interface Modifier { + /** + Resets the current color chain. + */ + readonly reset: CSPair; + + /** + Make text bold. + */ + readonly bold: CSPair; + + /** + Emitting only a small amount of light. + */ + readonly dim: CSPair; + + /** + Make text italic. (Not widely supported) + */ + readonly italic: CSPair; + + /** + Make text underline. (Not widely supported) + */ + readonly underline: CSPair; + + /** + Inverse background and foreground colors. + */ + readonly inverse: CSPair; + + /** + Prints the text, but makes it invisible. + */ + readonly hidden: CSPair; + + /** + Puts a horizontal line through the center of the text. (Not widely supported) + */ + readonly strikethrough: CSPair; + } + + interface ForegroundColor { + readonly black: CSPair; + readonly red: CSPair; + readonly green: CSPair; + readonly yellow: CSPair; + readonly blue: CSPair; + readonly cyan: CSPair; + readonly magenta: CSPair; + readonly white: CSPair; + + /** + Alias for `blackBright`. + */ + readonly gray: CSPair; + + /** + Alias for `blackBright`. + */ + readonly grey: CSPair; + + readonly blackBright: CSPair; + readonly redBright: CSPair; + readonly greenBright: CSPair; + readonly yellowBright: CSPair; + readonly blueBright: CSPair; + readonly cyanBright: CSPair; + readonly magentaBright: CSPair; + readonly whiteBright: CSPair; + } + + interface BackgroundColor { + readonly bgBlack: CSPair; + readonly bgRed: CSPair; + readonly bgGreen: CSPair; + readonly bgYellow: CSPair; + readonly bgBlue: CSPair; + readonly bgCyan: CSPair; + readonly bgMagenta: CSPair; + readonly bgWhite: CSPair; + + /** + Alias for `bgBlackBright`. + */ + readonly bgGray: CSPair; + + /** + Alias for `bgBlackBright`. + */ + readonly bgGrey: CSPair; + + readonly bgBlackBright: CSPair; + readonly bgRedBright: CSPair; + readonly bgGreenBright: CSPair; + readonly bgYellowBright: CSPair; + readonly bgBlueBright: CSPair; + readonly bgCyanBright: CSPair; + readonly bgMagentaBright: CSPair; + readonly bgWhiteBright: CSPair; + } +} + +declare const ansiStyles: { + readonly modifier: ansiStyles.Modifier; + readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase; + readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase; + readonly codes: ReadonlyMap; +} & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier; + +export = ansiStyles; diff --git a/node_modules/eslint/node_modules/ansi-styles/index.js b/node_modules/eslint/node_modules/ansi-styles/index.js new file mode 100644 index 000000000..5d82581a1 --- /dev/null +++ b/node_modules/eslint/node_modules/ansi-styles/index.js @@ -0,0 +1,163 @@ +'use strict'; + +const wrapAnsi16 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${code + offset}m`; +}; + +const wrapAnsi256 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${38 + offset};5;${code}m`; +}; + +const wrapAnsi16m = (fn, offset) => (...args) => { + const rgb = fn(...args); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; + +const ansi2ansi = n => n; +const rgb2rgb = (r, g, b) => [r, g, b]; + +const setLazyProperty = (object, property, get) => { + Object.defineProperty(object, property, { + get: () => { + const value = get(); + + Object.defineProperty(object, property, { + value, + enumerable: true, + configurable: true + }); + + return value; + }, + enumerable: true, + configurable: true + }); +}; + +/** @type {typeof import('color-convert')} */ +let colorConvert; +const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { + if (colorConvert === undefined) { + colorConvert = require('color-convert'); + } + + const offset = isBackground ? 10 : 0; + const styles = {}; + + for (const [sourceSpace, suite] of Object.entries(colorConvert)) { + const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; + if (sourceSpace === targetSpace) { + styles[name] = wrap(identity, offset); + } else if (typeof suite === 'object') { + styles[name] = wrap(suite[targetSpace], offset); + } + } + + return styles; +}; + +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + + // Bright color + blackBright: [90, 39], + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + + // Alias bright black as gray (and grey) + styles.color.gray = styles.color.blackBright; + styles.bgColor.bgGray = styles.bgColor.bgBlackBright; + styles.color.grey = styles.color.blackBright; + styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; + + for (const [groupName, group] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group)) { + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; + + group[styleName] = styles[styleName]; + + codes.set(style[0], style[1]); + } + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + } + + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; + + setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); + setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); + + return styles; +} + +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); diff --git a/node_modules/eslint/node_modules/ansi-styles/license b/node_modules/eslint/node_modules/ansi-styles/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/eslint/node_modules/ansi-styles/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/eslint/node_modules/ansi-styles/package.json b/node_modules/eslint/node_modules/ansi-styles/package.json new file mode 100644 index 000000000..1a7731952 --- /dev/null +++ b/node_modules/eslint/node_modules/ansi-styles/package.json @@ -0,0 +1,57 @@ +{ + "name": "ansi-styles", + "version": "4.2.1", + "description": "ANSI escape codes for styling strings in the terminal", + "license": "MIT", + "repository": "chalk/ansi-styles", + "funding": "https://github.com/chalk/ansi-styles?sponsor=1", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + }, + "devDependencies": { + "@types/color-convert": "^1.9.0", + "ava": "^2.3.0", + "svg-term-cli": "^2.1.1", + "tsd": "^0.11.0", + "xo": "^0.25.3" + } +} \ No newline at end of file diff --git a/node_modules/eslint/node_modules/ansi-styles/readme.md b/node_modules/eslint/node_modules/ansi-styles/readme.md new file mode 100644 index 000000000..2a1ef6546 --- /dev/null +++ b/node_modules/eslint/node_modules/ansi-styles/readme.md @@ -0,0 +1,158 @@ +# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) + +> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal + +You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. + + + +## Install + +``` +$ npm install ansi-styles +``` + +## Usage + +```js +const style = require('ansi-styles'); + +console.log(`${style.green.open}Hello world!${style.green.close}`); + + +// Color conversion between 16/256/truecolor +// NOTE: If conversion goes to 16 colors or 256 colors, the original color +// may be degraded to fit that color palette. This means terminals +// that do not support 16 million colors will best-match the +// original color. +console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); +console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); +console.log(style.color.ansi16m.hex('#abcdef') + 'Hello world!' + style.color.close); +``` + +## API + +Each style has an `open` and `close` property. + +## Styles + +### Modifiers + +- `reset` +- `bold` +- `dim` +- `italic` *(Not widely supported)* +- `underline` +- `inverse` +- `hidden` +- `strikethrough` *(Not widely supported)* + +### Colors + +- `black` +- `red` +- `green` +- `yellow` +- `blue` +- `magenta` +- `cyan` +- `white` +- `blackBright` (alias: `gray`, `grey`) +- `redBright` +- `greenBright` +- `yellowBright` +- `blueBright` +- `magentaBright` +- `cyanBright` +- `whiteBright` + +### Background colors + +- `bgBlack` +- `bgRed` +- `bgGreen` +- `bgYellow` +- `bgBlue` +- `bgMagenta` +- `bgCyan` +- `bgWhite` +- `bgBlackBright` (alias: `bgGray`, `bgGrey`) +- `bgRedBright` +- `bgGreenBright` +- `bgYellowBright` +- `bgBlueBright` +- `bgMagentaBright` +- `bgCyanBright` +- `bgWhiteBright` + +## Advanced usage + +By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. + +- `style.modifier` +- `style.color` +- `style.bgColor` + +###### Example + +```js +console.log(style.color.green.open); +``` + +Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. + +###### Example + +```js +console.log(style.codes.get(36)); +//=> 39 +``` + +## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) + +`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. + +The following color spaces from `color-convert` are supported: + +- `rgb` +- `hex` +- `keyword` +- `hsl` +- `hsv` +- `hwb` +- `ansi` +- `ansi256` + +To use these, call the associated conversion function with the intended output, for example: + +```js +style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code +style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code + +style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code +style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code + +style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code +style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code +``` + +## Related + +- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + +--- + +
diff --git a/node_modules/eslint/node_modules/chalk/index.d.ts b/node_modules/eslint/node_modules/chalk/index.d.ts new file mode 100644 index 000000000..9cd88f38b --- /dev/null +++ b/node_modules/eslint/node_modules/chalk/index.d.ts @@ -0,0 +1,415 @@ +/** +Basic foreground colors. + +[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) +*/ +declare type ForegroundColor = + | 'black' + | 'red' + | 'green' + | 'yellow' + | 'blue' + | 'magenta' + | 'cyan' + | 'white' + | 'gray' + | 'grey' + | 'blackBright' + | 'redBright' + | 'greenBright' + | 'yellowBright' + | 'blueBright' + | 'magentaBright' + | 'cyanBright' + | 'whiteBright'; + +/** +Basic background colors. + +[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) +*/ +declare type BackgroundColor = + | 'bgBlack' + | 'bgRed' + | 'bgGreen' + | 'bgYellow' + | 'bgBlue' + | 'bgMagenta' + | 'bgCyan' + | 'bgWhite' + | 'bgGray' + | 'bgGrey' + | 'bgBlackBright' + | 'bgRedBright' + | 'bgGreenBright' + | 'bgYellowBright' + | 'bgBlueBright' + | 'bgMagentaBright' + | 'bgCyanBright' + | 'bgWhiteBright'; + +/** +Basic colors. + +[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) +*/ +declare type Color = ForegroundColor | BackgroundColor; + +declare type Modifiers = + | 'reset' + | 'bold' + | 'dim' + | 'italic' + | 'underline' + | 'inverse' + | 'hidden' + | 'strikethrough' + | 'visible'; + +declare namespace chalk { + /** + Levels: + - `0` - All colors disabled. + - `1` - Basic 16 colors support. + - `2` - ANSI 256 colors support. + - `3` - Truecolor 16 million colors support. + */ + type Level = 0 | 1 | 2 | 3; + + interface Options { + /** + Specify the color support for Chalk. + + By default, color support is automatically detected based on the environment. + + Levels: + - `0` - All colors disabled. + - `1` - Basic 16 colors support. + - `2` - ANSI 256 colors support. + - `3` - Truecolor 16 million colors support. + */ + level?: Level; + } + + /** + Return a new Chalk instance. + */ + type Instance = new (options?: Options) => Chalk; + + /** + Detect whether the terminal supports color. + */ + interface ColorSupport { + /** + The color level used by Chalk. + */ + level: Level; + + /** + Return whether Chalk supports basic 16 colors. + */ + hasBasic: boolean; + + /** + Return whether Chalk supports ANSI 256 colors. + */ + has256: boolean; + + /** + Return whether Chalk supports Truecolor 16 million colors. + */ + has16m: boolean; + } + + interface ChalkFunction { + /** + Use a template string. + + @remarks Template literals are unsupported for nested calls (see [issue #341](https://github.com/chalk/chalk/issues/341)) + + @example + ``` + import chalk = require('chalk'); + + log(chalk` + CPU: {red ${cpu.totalPercent}%} + RAM: {green ${ram.used / ram.total * 100}%} + DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} + `); + ``` + + @example + ``` + import chalk = require('chalk'); + + log(chalk.red.bgBlack`2 + 3 = {bold ${2 + 3}}`) + ``` + */ + (text: TemplateStringsArray, ...placeholders: unknown[]): string; + + (...text: unknown[]): string; + } + + interface Chalk extends ChalkFunction { + /** + Return a new Chalk instance. + */ + Instance: Instance; + + /** + The color support for Chalk. + + By default, color support is automatically detected based on the environment. + + Levels: + - `0` - All colors disabled. + - `1` - Basic 16 colors support. + - `2` - ANSI 256 colors support. + - `3` - Truecolor 16 million colors support. + */ + level: Level; + + /** + Use HEX value to set text color. + + @param color - Hexadecimal value representing the desired color. + + @example + ``` + import chalk = require('chalk'); + + chalk.hex('#DEADED'); + ``` + */ + hex(color: string): Chalk; + + /** + Use keyword color value to set text color. + + @param color - Keyword value representing the desired color. + + @example + ``` + import chalk = require('chalk'); + + chalk.keyword('orange'); + ``` + */ + keyword(color: string): Chalk; + + /** + Use RGB values to set text color. + */ + rgb(red: number, green: number, blue: number): Chalk; + + /** + Use HSL values to set text color. + */ + hsl(hue: number, saturation: number, lightness: number): Chalk; + + /** + Use HSV values to set text color. + */ + hsv(hue: number, saturation: number, value: number): Chalk; + + /** + Use HWB values to set text color. + */ + hwb(hue: number, whiteness: number, blackness: number): Chalk; + + /** + Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set text color. + + 30 <= code && code < 38 || 90 <= code && code < 98 + For example, 31 for red, 91 for redBright. + */ + ansi(code: number): Chalk; + + /** + Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. + */ + ansi256(index: number): Chalk; + + /** + Use HEX value to set background color. + + @param color - Hexadecimal value representing the desired color. + + @example + ``` + import chalk = require('chalk'); + + chalk.bgHex('#DEADED'); + ``` + */ + bgHex(color: string): Chalk; + + /** + Use keyword color value to set background color. + + @param color - Keyword value representing the desired color. + + @example + ``` + import chalk = require('chalk'); + + chalk.bgKeyword('orange'); + ``` + */ + bgKeyword(color: string): Chalk; + + /** + Use RGB values to set background color. + */ + bgRgb(red: number, green: number, blue: number): Chalk; + + /** + Use HSL values to set background color. + */ + bgHsl(hue: number, saturation: number, lightness: number): Chalk; + + /** + Use HSV values to set background color. + */ + bgHsv(hue: number, saturation: number, value: number): Chalk; + + /** + Use HWB values to set background color. + */ + bgHwb(hue: number, whiteness: number, blackness: number): Chalk; + + /** + Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set background color. + + 30 <= code && code < 38 || 90 <= code && code < 98 + For example, 31 for red, 91 for redBright. + Use the foreground code, not the background code (for example, not 41, nor 101). + */ + bgAnsi(code: number): Chalk; + + /** + Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set background color. + */ + bgAnsi256(index: number): Chalk; + + /** + Modifier: Resets the current color chain. + */ + readonly reset: Chalk; + + /** + Modifier: Make text bold. + */ + readonly bold: Chalk; + + /** + Modifier: Emitting only a small amount of light. + */ + readonly dim: Chalk; + + /** + Modifier: Make text italic. (Not widely supported) + */ + readonly italic: Chalk; + + /** + Modifier: Make text underline. (Not widely supported) + */ + readonly underline: Chalk; + + /** + Modifier: Inverse background and foreground colors. + */ + readonly inverse: Chalk; + + /** + Modifier: Prints the text, but makes it invisible. + */ + readonly hidden: Chalk; + + /** + Modifier: Puts a horizontal line through the center of the text. (Not widely supported) + */ + readonly strikethrough: Chalk; + + /** + Modifier: Prints the text only when Chalk has a color support level > 0. + Can be useful for things that are purely cosmetic. + */ + readonly visible: Chalk; + + readonly black: Chalk; + readonly red: Chalk; + readonly green: Chalk; + readonly yellow: Chalk; + readonly blue: Chalk; + readonly magenta: Chalk; + readonly cyan: Chalk; + readonly white: Chalk; + + /* + Alias for `blackBright`. + */ + readonly gray: Chalk; + + /* + Alias for `blackBright`. + */ + readonly grey: Chalk; + + readonly blackBright: Chalk; + readonly redBright: Chalk; + readonly greenBright: Chalk; + readonly yellowBright: Chalk; + readonly blueBright: Chalk; + readonly magentaBright: Chalk; + readonly cyanBright: Chalk; + readonly whiteBright: Chalk; + + readonly bgBlack: Chalk; + readonly bgRed: Chalk; + readonly bgGreen: Chalk; + readonly bgYellow: Chalk; + readonly bgBlue: Chalk; + readonly bgMagenta: Chalk; + readonly bgCyan: Chalk; + readonly bgWhite: Chalk; + + /* + Alias for `bgBlackBright`. + */ + readonly bgGray: Chalk; + + /* + Alias for `bgBlackBright`. + */ + readonly bgGrey: Chalk; + + readonly bgBlackBright: Chalk; + readonly bgRedBright: Chalk; + readonly bgGreenBright: Chalk; + readonly bgYellowBright: Chalk; + readonly bgBlueBright: Chalk; + readonly bgMagentaBright: Chalk; + readonly bgCyanBright: Chalk; + readonly bgWhiteBright: Chalk; + } +} + +/** +Main Chalk object that allows to chain styles together. +Call the last one as a method with a string argument. +Order doesn't matter, and later styles take precedent in case of a conflict. +This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`. +*/ +declare const chalk: chalk.Chalk & chalk.ChalkFunction & { + supportsColor: chalk.ColorSupport | false; + Level: chalk.Level; + Color: Color; + ForegroundColor: ForegroundColor; + BackgroundColor: BackgroundColor; + Modifiers: Modifiers; + stderr: chalk.Chalk & {supportsColor: chalk.ColorSupport | false}; +}; + +export = chalk; diff --git a/node_modules/eslint/node_modules/chalk/license b/node_modules/eslint/node_modules/chalk/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/eslint/node_modules/chalk/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/eslint/node_modules/chalk/package.json b/node_modules/eslint/node_modules/chalk/package.json new file mode 100644 index 000000000..efe4541a6 --- /dev/null +++ b/node_modules/eslint/node_modules/chalk/package.json @@ -0,0 +1,68 @@ +{ + "name": "chalk", + "version": "4.1.0", + "description": "Terminal string styling done right", + "license": "MIT", + "repository": "chalk/chalk", + "funding": "https://github.com/chalk/chalk?sponsor=1", + "main": "source", + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && nyc ava && tsd", + "bench": "matcha benchmark.js" + }, + "files": [ + "source", + "index.d.ts" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "str", + "ansi", + "style", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "devDependencies": { + "ava": "^2.4.0", + "coveralls": "^3.0.7", + "execa": "^4.0.0", + "import-fresh": "^3.1.0", + "matcha": "^0.7.0", + "nyc": "^15.0.0", + "resolve-from": "^5.0.0", + "tsd": "^0.7.4", + "xo": "^0.28.2" + }, + "xo": { + "rules": { + "unicorn/prefer-string-slice": "off", + "unicorn/prefer-includes": "off", + "@typescript-eslint/member-ordering": "off", + "no-redeclare": "off", + "unicorn/string-content": "off", + "unicorn/better-regex": "off" + } + } +} \ No newline at end of file diff --git a/node_modules/eslint/node_modules/chalk/readme.md b/node_modules/eslint/node_modules/chalk/readme.md new file mode 100644 index 000000000..338f42cb8 --- /dev/null +++ b/node_modules/eslint/node_modules/chalk/readme.md @@ -0,0 +1,293 @@ +

+
+
+ Chalk +
+
+
+

+ +> Terminal string styling done right + +[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![npm dependents](https://badgen.net/npm/dependents/chalk)](https://www.npmjs.com/package/chalk?activeTab=dependents) [![Downloads](https://badgen.net/npm/dt/chalk)](https://www.npmjs.com/package/chalk) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) ![TypeScript-ready](https://img.shields.io/npm/types/chalk.svg) [![run on repl.it](https://repl.it/badge/github/chalk/chalk)](https://repl.it/github/chalk/chalk) + + + +## Highlights + +- Expressive API +- Highly performant +- Ability to nest styles +- [256/Truecolor color support](#256-and-truecolor-color-support) +- Auto-detects color support +- Doesn't extend `String.prototype` +- Clean and focused +- Actively maintained +- [Used by ~50,000 packages](https://www.npmjs.com/browse/depended/chalk) as of January 1, 2020 + +## Install + +```console +$ npm install chalk +``` + +## Usage + +```js +const chalk = require('chalk'); + +console.log(chalk.blue('Hello world!')); +``` + +Chalk comes with an easy to use composable API where you just chain and nest the styles you want. + +```js +const chalk = require('chalk'); +const log = console.log; + +// Combine styled and normal strings +log(chalk.blue('Hello') + ' World' + chalk.red('!')); + +// Compose multiple styles using the chainable API +log(chalk.blue.bgRed.bold('Hello world!')); + +// Pass in multiple arguments +log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz')); + +// Nest styles +log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!')); + +// Nest styles of the same type even (color, underline, background) +log(chalk.green( + 'I am a green line ' + + chalk.blue.underline.bold('with a blue substring') + + ' that becomes green again!' +)); + +// ES2015 template literal +log(` +CPU: ${chalk.red('90%')} +RAM: ${chalk.green('40%')} +DISK: ${chalk.yellow('70%')} +`); + +// ES2015 tagged template literal +log(chalk` +CPU: {red ${cpu.totalPercent}%} +RAM: {green ${ram.used / ram.total * 100}%} +DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} +`); + +// Use RGB colors in terminal emulators that support it. +log(chalk.keyword('orange')('Yay for orange colored text!')); +log(chalk.rgb(123, 45, 67).underline('Underlined reddish color')); +log(chalk.hex('#DEADED').bold('Bold gray!')); +``` + +Easily define your own themes: + +```js +const chalk = require('chalk'); + +const error = chalk.bold.red; +const warning = chalk.keyword('orange'); + +console.log(error('Error!')); +console.log(warning('Warning!')); +``` + +Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args): + +```js +const name = 'Sindre'; +console.log(chalk.green('Hello %s'), name); +//=> 'Hello Sindre' +``` + +## API + +### chalk.` + * css`` + * css.global`` + * css.resolve`` + */ + + +function isStyledJsx(path) { + const node = path.getValue(); + const parent = path.getParentNode(); + const parentParent = path.getParentNode(1); + return parentParent && node.quasis && parent.type === "JSXExpressionContainer" && parentParent.type === "JSXElement" && parentParent.openingElement.name.name === "style" && parentParent.openingElement.attributes.some(attribute => attribute.name.name === "jsx") || parent && parent.type === "TaggedTemplateExpression" && parent.tag.type === "Identifier" && parent.tag.name === "css" || parent && parent.type === "TaggedTemplateExpression" && parent.tag.type === "MemberExpression" && parent.tag.object.name === "css" && (parent.tag.property.name === "global" || parent.tag.property.name === "resolve"); +} +/** + * Angular Components can have: + * - Inline HTML template + * - Inline CSS styles + * + * ...which are both within template literals somewhere + * inside of the Component decorator factory. + * + * E.g. + * @Component({ + * template: `
...
`, + * styles: [`h1 { color: blue; }`] + * }) + */ + + +function isAngularComponentStyles(path) { + return path.match(node => node.type === "TemplateLiteral", (node, name) => node.type === "ArrayExpression" && name === "elements", (node, name) => (node.type === "Property" || node.type === "ObjectProperty") && node.key.type === "Identifier" && node.key.name === "styles" && name === "value", ...angularComponentObjectExpressionPredicates); +} + +function isAngularComponentTemplate(path) { + return path.match(node => node.type === "TemplateLiteral", (node, name) => (node.type === "Property" || node.type === "ObjectProperty") && node.key.type === "Identifier" && node.key.name === "template" && name === "value", ...angularComponentObjectExpressionPredicates); +} + +const angularComponentObjectExpressionPredicates = [(node, name) => node.type === "ObjectExpression" && name === "properties", (node, name) => node.type === "CallExpression" && node.callee.type === "Identifier" && node.callee.name === "Component" && name === "arguments", (node, name) => node.type === "Decorator" && name === "expression"]; +/** + * styled-components template literals + */ + +function isStyledComponents(path) { + const parent = path.getParentNode(); + + if (!parent || parent.type !== "TaggedTemplateExpression") { + return false; + } + + const { + tag + } = parent; + + switch (tag.type) { + case "MemberExpression": + return (// styled.foo`` + isStyledIdentifier(tag.object) || // Component.extend`` + isStyledExtend(tag) + ); + + case "CallExpression": + return (// styled(Component)`` + isStyledIdentifier(tag.callee) || tag.callee.type === "MemberExpression" && (tag.callee.object.type === "MemberExpression" && ( // styled.foo.attrs({})`` + isStyledIdentifier(tag.callee.object.object) || // Component.extend.attrs({})`` + isStyledExtend(tag.callee.object)) || // styled(Component).attrs({})`` + tag.callee.object.type === "CallExpression" && isStyledIdentifier(tag.callee.object.callee)) + ); + + case "Identifier": + // css`` + return tag.name === "css"; + + default: + return false; + } +} +/** + * JSX element with CSS prop + */ + + +function isCssProp(path) { + const parent = path.getParentNode(); + const parentParent = path.getParentNode(1); + return parentParent && parent.type === "JSXExpressionContainer" && parentParent.type === "JSXAttribute" && parentParent.name.type === "JSXIdentifier" && parentParent.name.name === "css"; +} + +function isStyledIdentifier(node) { + return node.type === "Identifier" && node.name === "styled"; +} + +function isStyledExtend(node) { + return /^[A-Z]/.test(node.object.name) && node.property.name === "extend"; +} +/* + * react-relay and graphql-tag + * graphql`...` + * graphql.experimental`...` + * gql`...` + * GraphQL comment block + * + * This intentionally excludes Relay Classic tags, as Prettier does not + * support Relay Classic formatting. + */ + + +function isGraphQL(path) { + const node = path.getValue(); + const parent = path.getParentNode(); + return hasLanguageComment(node, "GraphQL") || parent && (parent.type === "TaggedTemplateExpression" && (parent.tag.type === "MemberExpression" && parent.tag.object.name === "graphql" && parent.tag.property.name === "experimental" || parent.tag.type === "Identifier" && (parent.tag.name === "gql" || parent.tag.name === "graphql")) || parent.type === "CallExpression" && parent.callee.type === "Identifier" && parent.callee.name === "graphql"); +} + +function hasLanguageComment(node, languageName) { + // This checks for a leading comment that is exactly `/* GraphQL */` + // In order to be in line with other implementations of this comment tag + // we will not trim the comment value and we will expect exactly one space on + // either side of the GraphQL string + // Also see ./clean.js + return hasLeadingComment$1(node, comment => isBlockComment$1(comment) && comment.value === ` ${languageName} `); +} +/** + * - html`...` + * - HTML comment block + */ + + +function isHtml(path) { + return hasLanguageComment(path.getValue(), "HTML") || path.match(node => node.type === "TemplateLiteral", (node, name) => node.type === "TaggedTemplateExpression" && node.tag.type === "Identifier" && node.tag.name === "html" && name === "quasi"); +} // The counter is needed to distinguish nested embeds. + + +let htmlTemplateLiteralCounter = 0; + +function printHtmlTemplateLiteral(path, print, textToDoc, parser, options) { + const node = path.getValue(); + const counter = htmlTemplateLiteralCounter; + htmlTemplateLiteralCounter = htmlTemplateLiteralCounter + 1 >>> 0; + + const composePlaceholder = index => `PRETTIER_HTML_PLACEHOLDER_${index}_${counter}_IN_JS`; + + const text = node.quasis.map((quasi, index, quasis) => index === quasis.length - 1 ? quasi.value.cooked : quasi.value.cooked + composePlaceholder(index)).join(""); + const expressionDocs = path.map(print, "expressions"); + + if (expressionDocs.length === 0 && text.trim().length === 0) { + return "``"; + } + + const placeholderRegex = new RegExp(composePlaceholder("(\\d+)"), "g"); + let topLevelCount = 0; + const contentDoc = mapDoc$1(textToDoc(text, { + parser, + + __onHtmlRoot(root) { + topLevelCount = root.children.length; + } + + }, { + stripTrailingHardline: true + }), doc => { + if (typeof doc !== "string") { + return doc; + } + + const parts = []; + const components = doc.split(placeholderRegex); + + for (let i = 0; i < components.length; i++) { + let component = components[i]; + + if (i % 2 === 0) { + if (component) { + component = uncook(component); + + if (options.embeddedInHtml) { + component = component.replace(/<\/(script)\b/gi, "<\\/$1"); + } + + parts.push(component); + } + + continue; + } + + const placeholderIndex = +component; + parts.push(concat$4(["${", group$1(expressionDocs[placeholderIndex]), "}"])); + } + + return concat$4(parts); + }); + const leadingWhitespace = /^\s/.test(text) ? " " : ""; + const trailingWhitespace = /\s$/.test(text) ? " " : ""; + const linebreak = options.htmlWhitespaceSensitivity === "ignore" ? hardline$3 : leadingWhitespace && trailingWhitespace ? line$3 : null; + + if (linebreak) { + return group$1(concat$4(["`", indent$2(concat$4([linebreak, group$1(contentDoc)])), linebreak, "`"])); + } + + return group$1(concat$4(["`", leadingWhitespace, topLevelCount > 1 ? indent$2(group$1(contentDoc)) : group$1(contentDoc), trailingWhitespace, "`"])); +} + +var embed_1 = embed; + +function clean(ast, newObj, parent) { + ["range", "raw", "comments", "leadingComments", "trailingComments", "innerComments", "extra", "start", "end", "loc", "flags", "errors", "tokens"].forEach(name => { + delete newObj[name]; + }); + + if (ast.type === "Program") { + delete newObj.sourceType; + } + + if (ast.type === "BigIntLiteral") { + if (newObj.value) { + newObj.value = newObj.value.toLowerCase(); + } + + if (newObj.bigint) { + newObj.bigint = newObj.bigint.toLowerCase(); + } + } + + if (ast.type === "DecimalLiteral") { + newObj.value = Number(newObj.value); + } // We remove extra `;` and add them when needed + + + if (ast.type === "EmptyStatement") { + return null; + } // We move text around, including whitespaces and add {" "} + + + if (ast.type === "JSXText") { + return null; + } + + if (ast.type === "JSXExpressionContainer" && (ast.expression.type === "Literal" || ast.expression.type === "StringLiteral") && ast.expression.value === " ") { + return null; + } // We change {'key': value} into {key: value}. + // And {key: value} into {'key': value}. + // Also for (some) number keys. + + + if ((ast.type === "Property" || ast.type === "ObjectProperty" || ast.type === "MethodDefinition" || ast.type === "ClassProperty" || ast.type === "ClassMethod" || ast.type === "TSDeclareMethod" || ast.type === "TSPropertySignature" || ast.type === "ObjectTypeProperty") && typeof ast.key === "object" && ast.key && (ast.key.type === "Literal" || ast.key.type === "NumericLiteral" || ast.key.type === "StringLiteral" || ast.key.type === "Identifier")) { + delete newObj.key; + } + + if (ast.type === "OptionalMemberExpression" && ast.optional === false) { + newObj.type = "MemberExpression"; + delete newObj.optional; + } // Remove raw and cooked values from TemplateElement when it's CSS + // styled-jsx + + + if (ast.type === "JSXElement" && ast.openingElement.name.name === "style" && ast.openingElement.attributes.some(attr => attr.name.name === "jsx")) { + const templateLiterals = newObj.children.filter(child => child.type === "JSXExpressionContainer" && child.expression.type === "TemplateLiteral").map(container => container.expression); + const quasis = templateLiterals.reduce((quasis, templateLiteral) => quasis.concat(templateLiteral.quasis), []); + quasis.forEach(q => delete q.value); + } // CSS template literals in css prop + + + if (ast.type === "JSXAttribute" && ast.name.name === "css" && ast.value.type === "JSXExpressionContainer" && ast.value.expression.type === "TemplateLiteral") { + newObj.value.expression.quasis.forEach(q => delete q.value); + } // We change quotes + + + if (ast.type === "JSXAttribute" && ast.value && ast.value.type === "Literal" && /["']|"|'/.test(ast.value.value)) { + newObj.value.value = newObj.value.value.replace(/["']|"|'/g, '"'); + } // Angular Components: Inline HTML template and Inline CSS styles + + + const expression = ast.expression || ast.callee; + + if (ast.type === "Decorator" && expression.type === "CallExpression" && expression.callee.name === "Component" && expression.arguments.length === 1) { + const astProps = ast.expression.arguments[0].properties; + newObj.expression.arguments[0].properties.forEach((prop, index) => { + let templateLiteral = null; + + switch (astProps[index].key.name) { + case "styles": + if (prop.value.type === "ArrayExpression") { + templateLiteral = prop.value.elements[0]; + } + + break; + + case "template": + if (prop.value.type === "TemplateLiteral") { + templateLiteral = prop.value; + } + + break; + } + + if (templateLiteral) { + templateLiteral.quasis.forEach(q => delete q.value); + } + }); + } // styled-components, graphql, markdown + + + if (ast.type === "TaggedTemplateExpression" && (ast.tag.type === "MemberExpression" || ast.tag.type === "Identifier" && (ast.tag.name === "gql" || ast.tag.name === "graphql" || ast.tag.name === "css" || ast.tag.name === "md" || ast.tag.name === "markdown" || ast.tag.name === "html") || ast.tag.type === "CallExpression")) { + newObj.quasi.quasis.forEach(quasi => delete quasi.value); + } + + if (ast.type === "TemplateLiteral") { + // This checks for a leading comment that is exactly `/* GraphQL */` + // In order to be in line with other implementations of this comment tag + // we will not trim the comment value and we will expect exactly one space on + // either side of the GraphQL string + // Also see ./embed.js + const hasLanguageComment = ast.leadingComments && ast.leadingComments.some(comment => comment.type === "CommentBlock" && ["GraphQL", "HTML"].some(languageName => comment.value === ` ${languageName} `)); + + if (hasLanguageComment || parent.type === "CallExpression" && parent.callee.name === "graphql") { + newObj.quasis.forEach(quasi => delete quasi.value); + } // TODO: check parser + // `flow` and `typescript` don't have `leadingComments` + + + if (!ast.leadingComments) { + newObj.quasis.forEach(quasi => { + if (quasi.value) { + delete quasi.value.cooked; + } + }); + } + } + + if (ast.type === "InterpreterDirective") { + newObj.value = newObj.value.trimEnd(); + } +} + +var clean_1 = clean; + +const detectNewline = string => { + if (typeof string !== 'string') { + throw new TypeError('Expected a string'); + } + + const newlines = string.match(/(?:\r?\n)/g) || []; + + if (newlines.length === 0) { + return; + } + + const crlf = newlines.filter(newline => newline === '\r\n').length; + const lf = newlines.length - crlf; + return crlf > lf ? '\r\n' : '\n'; +}; + +var detectNewline_1 = detectNewline; + +var graceful = string => typeof string === 'string' && detectNewline(string) || '\n'; +detectNewline_1.graceful = graceful; + +var build = createCommonjsModule(function (module, exports) { + + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.extract = extract; + exports.strip = strip; + exports.parse = parse; + exports.parseWithComments = parseWithComments; + exports.print = print; + + function _os() { + const data = os__default['default']; + + _os = function () { + return data; + }; + + return data; + } + + function _detectNewline() { + const data = _interopRequireDefault(detectNewline_1); + + _detectNewline = function () { + return data; + }; + + return data; + } + + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; + } + /** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + + const commentEndRe = /\*\/$/; + const commentStartRe = /^\/\*\*/; + const docblockRe = /^\s*(\/\*\*?(.|\r?\n)*?\*\/)/; + const lineCommentRe = /(^|\s+)\/\/([^\r\n]*)/g; + const ltrimNewlineRe = /^(\r?\n)+/; + const multilineRe = /(?:^|\r?\n) *(@[^\r\n]*?) *\r?\n *(?![^@\r\n]*\/\/[^]*)([^@\r\n\s][^@\r\n]+?) *\r?\n/g; + const propertyRe = /(?:^|\r?\n) *@(\S+) *([^\r\n]*)/g; + const stringStartRe = /(\r?\n|^) *\* ?/g; + const STRING_ARRAY = []; + + function extract(contents) { + const match = contents.match(docblockRe); + return match ? match[0].trimLeft() : ''; + } + + function strip(contents) { + const match = contents.match(docblockRe); + return match && match[0] ? contents.substring(match[0].length) : contents; + } + + function parse(docblock) { + return parseWithComments(docblock).pragmas; + } + + function parseWithComments(docblock) { + const line = (0, _detectNewline().default)(docblock) || _os().EOL; + + docblock = docblock.replace(commentStartRe, '').replace(commentEndRe, '').replace(stringStartRe, '$1'); // Normalize multi-line directives + + let prev = ''; + + while (prev !== docblock) { + prev = docblock; + docblock = docblock.replace(multilineRe, `${line}$1 $2${line}`); + } + + docblock = docblock.replace(ltrimNewlineRe, '').trimRight(); + const result = Object.create(null); + const comments = docblock.replace(propertyRe, '').replace(ltrimNewlineRe, '').trimRight(); + let match; + + while (match = propertyRe.exec(docblock)) { + // strip linecomments from pragmas + const nextPragma = match[2].replace(lineCommentRe, ''); + + if (typeof result[match[1]] === 'string' || Array.isArray(result[match[1]])) { + result[match[1]] = STRING_ARRAY.concat(result[match[1]], nextPragma); + } else { + result[match[1]] = nextPragma; + } + } + + return { + comments, + pragmas: result + }; + } + + function print({ + comments = '', + pragmas = {} + }) { + const line = (0, _detectNewline().default)(comments) || _os().EOL; + + const head = '/**'; + const start = ' *'; + const tail = ' */'; + const keys = Object.keys(pragmas); + const printedObject = keys.map(key => printKeyValues(key, pragmas[key])).reduce((arr, next) => arr.concat(next), []).map(keyValue => start + ' ' + keyValue + line).join(''); + + if (!comments) { + if (keys.length === 0) { + return ''; + } + + if (keys.length === 1 && !Array.isArray(pragmas[keys[0]])) { + const value = pragmas[keys[0]]; + return `${head} ${printKeyValues(keys[0], value)[0]}${tail}`; + } + } + + const printedComments = comments.split(line).map(textLine => `${start} ${textLine}`).join(line) + line; + return head + line + (comments ? printedComments : '') + (comments && keys.length ? start + line : '') + printedObject + tail; + } + + function printKeyValues(key, valueOrArray) { + return STRING_ARRAY.concat(valueOrArray).map(value => `@${key} ${value}`.trim()); + } +}); + +const { + parseWithComments, + strip, + extract, + print +} = build; +const { + getShebang: getShebang$1 +} = util; +const { + normalizeEndOfLine: normalizeEndOfLine$2 +} = endOfLine; + +function parseDocBlock(text) { + const shebang = getShebang$1(text); + + if (shebang) { + text = text.slice(shebang.length + 1); + } + + const docBlock = extract(text); + const { + pragmas, + comments + } = parseWithComments(docBlock); + return { + shebang, + text, + pragmas, + comments + }; +} + +function hasPragma(text) { + const pragmas = Object.keys(parseDocBlock(text).pragmas); + return pragmas.includes("prettier") || pragmas.includes("format"); +} + +function insertPragma(originalText) { + const { + shebang, + text, + pragmas, + comments + } = parseDocBlock(originalText); + const strippedText = strip(text); + const docBlock = print({ + pragmas: Object.assign({ + format: "" + }, pragmas), + comments: comments.trimStart() + }); + return (shebang ? `${shebang}\n` : "") + // normalise newlines (mitigate use of os.EOL by jest-docblock) + normalizeEndOfLine$2(docBlock) + (strippedText.startsWith("\n") ? "\n" : "\n\n") + strippedText; +} + +var pragma = { + hasPragma, + insertPragma +}; + +var ast = createCommonjsModule(function (module) { + /* + Copyright (C) 2013 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + (function () { + + function isExpression(node) { + if (node == null) { + return false; + } + + switch (node.type) { + case 'ArrayExpression': + case 'AssignmentExpression': + case 'BinaryExpression': + case 'CallExpression': + case 'ConditionalExpression': + case 'FunctionExpression': + case 'Identifier': + case 'Literal': + case 'LogicalExpression': + case 'MemberExpression': + case 'NewExpression': + case 'ObjectExpression': + case 'SequenceExpression': + case 'ThisExpression': + case 'UnaryExpression': + case 'UpdateExpression': + return true; + } + + return false; + } + + function isIterationStatement(node) { + if (node == null) { + return false; + } + + switch (node.type) { + case 'DoWhileStatement': + case 'ForInStatement': + case 'ForStatement': + case 'WhileStatement': + return true; + } + + return false; + } + + function isStatement(node) { + if (node == null) { + return false; + } + + switch (node.type) { + case 'BlockStatement': + case 'BreakStatement': + case 'ContinueStatement': + case 'DebuggerStatement': + case 'DoWhileStatement': + case 'EmptyStatement': + case 'ExpressionStatement': + case 'ForInStatement': + case 'ForStatement': + case 'IfStatement': + case 'LabeledStatement': + case 'ReturnStatement': + case 'SwitchStatement': + case 'ThrowStatement': + case 'TryStatement': + case 'VariableDeclaration': + case 'WhileStatement': + case 'WithStatement': + return true; + } + + return false; + } + + function isSourceElement(node) { + return isStatement(node) || node != null && node.type === 'FunctionDeclaration'; + } + + function trailingStatement(node) { + switch (node.type) { + case 'IfStatement': + if (node.alternate != null) { + return node.alternate; + } + + return node.consequent; + + case 'LabeledStatement': + case 'ForStatement': + case 'ForInStatement': + case 'WhileStatement': + case 'WithStatement': + return node.body; + } + + return null; + } + + function isProblematicIfStatement(node) { + var current; + + if (node.type !== 'IfStatement') { + return false; + } + + if (node.alternate == null) { + return false; + } + + current = node.consequent; + + do { + if (current.type === 'IfStatement') { + if (current.alternate == null) { + return true; + } + } + + current = trailingStatement(current); + } while (current); + + return false; + } + + module.exports = { + isExpression: isExpression, + isStatement: isStatement, + isIterationStatement: isIterationStatement, + isSourceElement: isSourceElement, + isProblematicIfStatement: isProblematicIfStatement, + trailingStatement: trailingStatement + }; + })(); + /* vim: set sw=4 ts=4 et tw=80 : */ + +}); + +var code = createCommonjsModule(function (module) { + /* + Copyright (C) 2013-2014 Yusuke Suzuki + Copyright (C) 2014 Ivan Nikulin + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + (function () { + + var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch; // See `tools/generate-identifier-regex.js`. + + ES5Regex = { + // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierStart: + NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/, + // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierPart: + NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF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u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/ + }; + ES6Regex = { + // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierStart: + NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\u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55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/, + // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierPart: + NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\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uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ + }; + + function isDecimalDigit(ch) { + return 0x30 <= ch && ch <= 0x39; // 0..9 + } + + function isHexDigit(ch) { + return 0x30 <= ch && ch <= 0x39 || // 0..9 + 0x61 <= ch && ch <= 0x66 || // a..f + 0x41 <= ch && ch <= 0x46; // A..F + } + + function isOctalDigit(ch) { + return ch >= 0x30 && ch <= 0x37; // 0..7 + } // 7.2 White Space + + + NON_ASCII_WHITESPACES = [0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF]; + + function isWhiteSpace(ch) { + return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || ch >= 0x1680 && NON_ASCII_WHITESPACES.indexOf(ch) >= 0; + } // 7.3 Line Terminators + + + function isLineTerminator(ch) { + return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029; + } // 7.6 Identifier Names and Identifiers + + + function fromCodePoint(cp) { + if (cp <= 0xFFFF) { + return String.fromCharCode(cp); + } + + var cu1 = String.fromCharCode(Math.floor((cp - 0x10000) / 0x400) + 0xD800); + var cu2 = String.fromCharCode((cp - 0x10000) % 0x400 + 0xDC00); + return cu1 + cu2; + } + + IDENTIFIER_START = new Array(0x80); + + for (ch = 0; ch < 0x80; ++ch) { + IDENTIFIER_START[ch] = ch >= 0x61 && ch <= 0x7A || // a..z + ch >= 0x41 && ch <= 0x5A || // A..Z + ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore) + } + + IDENTIFIER_PART = new Array(0x80); + + for (ch = 0; ch < 0x80; ++ch) { + IDENTIFIER_PART[ch] = ch >= 0x61 && ch <= 0x7A || // a..z + ch >= 0x41 && ch <= 0x5A || // A..Z + ch >= 0x30 && ch <= 0x39 || // 0..9 + ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore) + } + + function isIdentifierStartES5(ch) { + return ch < 0x80 ? IDENTIFIER_START[ch] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch)); + } + + function isIdentifierPartES5(ch) { + return ch < 0x80 ? IDENTIFIER_PART[ch] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch)); + } + + function isIdentifierStartES6(ch) { + return ch < 0x80 ? IDENTIFIER_START[ch] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch)); + } + + function isIdentifierPartES6(ch) { + return ch < 0x80 ? IDENTIFIER_PART[ch] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch)); + } + + module.exports = { + isDecimalDigit: isDecimalDigit, + isHexDigit: isHexDigit, + isOctalDigit: isOctalDigit, + isWhiteSpace: isWhiteSpace, + isLineTerminator: isLineTerminator, + isIdentifierStartES5: isIdentifierStartES5, + isIdentifierPartES5: isIdentifierPartES5, + isIdentifierStartES6: isIdentifierStartES6, + isIdentifierPartES6: isIdentifierPartES6 + }; + })(); + /* vim: set sw=4 ts=4 et tw=80 : */ + +}); + +var keyword$1 = createCommonjsModule(function (module) { + /* + Copyright (C) 2013 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + (function () { + + var code$1 = code; + + function isStrictModeReservedWordES6(id) { + switch (id) { + case 'implements': + case 'interface': + case 'package': + case 'private': + case 'protected': + case 'public': + case 'static': + case 'let': + return true; + + default: + return false; + } + } + + function isKeywordES5(id, strict) { + // yield should not be treated as keyword under non-strict mode. + if (!strict && id === 'yield') { + return false; + } + + return isKeywordES6(id, strict); + } + + function isKeywordES6(id, strict) { + if (strict && isStrictModeReservedWordES6(id)) { + return true; + } + + switch (id.length) { + case 2: + return id === 'if' || id === 'in' || id === 'do'; + + case 3: + return id === 'var' || id === 'for' || id === 'new' || id === 'try'; + + case 4: + return id === 'this' || id === 'else' || id === 'case' || id === 'void' || id === 'with' || id === 'enum'; + + case 5: + return id === 'while' || id === 'break' || id === 'catch' || id === 'throw' || id === 'const' || id === 'yield' || id === 'class' || id === 'super'; + + case 6: + return id === 'return' || id === 'typeof' || id === 'delete' || id === 'switch' || id === 'export' || id === 'import'; + + case 7: + return id === 'default' || id === 'finally' || id === 'extends'; + + case 8: + return id === 'function' || id === 'continue' || id === 'debugger'; + + case 10: + return id === 'instanceof'; + + default: + return false; + } + } + + function isReservedWordES5(id, strict) { + return id === 'null' || id === 'true' || id === 'false' || isKeywordES5(id, strict); + } + + function isReservedWordES6(id, strict) { + return id === 'null' || id === 'true' || id === 'false' || isKeywordES6(id, strict); + } + + function isRestrictedWord(id) { + return id === 'eval' || id === 'arguments'; + } + + function isIdentifierNameES5(id) { + var i, iz, ch; + + if (id.length === 0) { + return false; + } + + ch = id.charCodeAt(0); + + if (!code$1.isIdentifierStartES5(ch)) { + return false; + } + + for (i = 1, iz = id.length; i < iz; ++i) { + ch = id.charCodeAt(i); + + if (!code$1.isIdentifierPartES5(ch)) { + return false; + } + } + + return true; + } + + function decodeUtf16(lead, trail) { + return (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; + } + + function isIdentifierNameES6(id) { + var i, iz, ch, lowCh, check; + + if (id.length === 0) { + return false; + } + + check = code$1.isIdentifierStartES6; + + for (i = 0, iz = id.length; i < iz; ++i) { + ch = id.charCodeAt(i); + + if (0xD800 <= ch && ch <= 0xDBFF) { + ++i; + + if (i >= iz) { + return false; + } + + lowCh = id.charCodeAt(i); + + if (!(0xDC00 <= lowCh && lowCh <= 0xDFFF)) { + return false; + } + + ch = decodeUtf16(ch, lowCh); + } + + if (!check(ch)) { + return false; + } + + check = code$1.isIdentifierPartES6; + } + + return true; + } + + function isIdentifierES5(id, strict) { + return isIdentifierNameES5(id) && !isReservedWordES5(id, strict); + } + + function isIdentifierES6(id, strict) { + return isIdentifierNameES6(id) && !isReservedWordES6(id, strict); + } + + module.exports = { + isKeywordES5: isKeywordES5, + isKeywordES6: isKeywordES6, + isReservedWordES5: isReservedWordES5, + isReservedWordES6: isReservedWordES6, + isRestrictedWord: isRestrictedWord, + isIdentifierNameES5: isIdentifierNameES5, + isIdentifierNameES6: isIdentifierNameES6, + isIdentifierES5: isIdentifierES5, + isIdentifierES6: isIdentifierES6 + }; + })(); + /* vim: set sw=4 ts=4 et tw=80 : */ + +}); + +var utils$5 = createCommonjsModule(function (module, exports) { + /* + Copyright (C) 2013 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + (function () { + + exports.ast = ast; + exports.code = code; + exports.keyword = keyword$1; + })(); + /* vim: set sw=4 ts=4 et tw=80 : */ + +}); + +const isIdentifierName = utils$5.keyword.isIdentifierNameES5; +const { + getLast: getLast$2, + hasNewline: hasNewline$4, + hasNewlineInRange: hasNewlineInRange$3, + hasIgnoreComment: hasIgnoreComment$1, + hasNodeIgnoreComment: hasNodeIgnoreComment$1, + skipWhitespace: skipWhitespace$2 +} = util; +/** + * @typedef {import("./types/estree").Node} Node + * @typedef {import("./types/estree").TemplateLiteral} TemplateLiteral + * @typedef {import("./types/estree").Comment} Comment + * @typedef {import("./types/estree").MemberExpression} MemberExpression + * @typedef {import("./types/estree").OptionalMemberExpression} OptionalMemberExpression + * @typedef {import("./types/estree").CallExpression} CallExpression + * @typedef {import("./types/estree").OptionalCallExpression} OptionalCallExpression + * @typedef {import("./types/estree").Expression} Expression + * @typedef {import("./types/estree").Property} Property + * @typedef {import("./types/estree").ObjectTypeProperty} ObjectTypeProperty + * @typedef {import("./types/estree").JSXElement} JSXElement + * @typedef {import("./types/estree").TaggedTemplateExpression} TaggedTemplateExpression + * @typedef {import("./types/estree").Literal} Literal + * + * @typedef {import("../common/fast-path")} FastPath + */ +// We match any whitespace except line terminators because +// Flow annotation comments cannot be split across lines. For example: +// +// (this /* +// : any */).foo = 5; +// +// is not picked up by Flow (see https://github.com/facebook/flow/issues/7050), so +// removing the newline would create a type annotation that the user did not intend +// to create. + +const NON_LINE_TERMINATING_WHITE_SPACE = "(?:(?=.)\\s)"; +const FLOW_SHORTHAND_ANNOTATION = new RegExp(`^${NON_LINE_TERMINATING_WHITE_SPACE}*:`); +const FLOW_ANNOTATION = new RegExp(`^${NON_LINE_TERMINATING_WHITE_SPACE}*::`); +/** + * @param {Node} node + * @returns {boolean} + */ + +function hasFlowShorthandAnnotationComment(node) { + // https://flow.org/en/docs/types/comments/ + // Syntax example: const r = new (window.Request /*: Class */)(""); + return node.extra && node.extra.parenthesized && node.trailingComments && FLOW_SHORTHAND_ANNOTATION.test(node.trailingComments[0].value); +} +/** + * @param {Comment[]} comments + * @returns {boolean} + */ + + +function hasFlowAnnotationComment(comments) { + return comments && FLOW_ANNOTATION.test(comments[0].value); +} +/** + * @param {Node} node + * @param {(Node) => boolean} fn + * @returns {boolean} + */ + + +function hasNode(node, fn) { + if (!node || typeof node !== "object") { + return false; + } + + if (Array.isArray(node)) { + return node.some(value => hasNode(value, fn)); + } + + const result = fn(node); + return typeof result === "boolean" ? result : Object.keys(node).some(key => hasNode(node[key], fn)); +} +/** + * @param {Node} node + * @returns {boolean} + */ + + +function hasNakedLeftSide(node) { + return node.type === "AssignmentExpression" || node.type === "BinaryExpression" || node.type === "LogicalExpression" || node.type === "NGPipeExpression" || node.type === "ConditionalExpression" || node.type === "CallExpression" || node.type === "OptionalCallExpression" || node.type === "MemberExpression" || node.type === "OptionalMemberExpression" || node.type === "SequenceExpression" || node.type === "TaggedTemplateExpression" || node.type === "BindExpression" || node.type === "UpdateExpression" && !node.prefix || node.type === "TSAsExpression" || node.type === "TSNonNullExpression"; +} + +function getLeftSide(node) { + if (node.expressions) { + return node.expressions[0]; + } + + return node.left || node.test || node.callee || node.object || node.tag || node.argument || node.expression; +} + +function getLeftSidePathName(path, node) { + if (node.expressions) { + return ["expressions", 0]; + } + + if (node.left) { + return ["left"]; + } + + if (node.test) { + return ["test"]; + } + + if (node.object) { + return ["object"]; + } + + if (node.callee) { + return ["callee"]; + } + + if (node.tag) { + return ["tag"]; + } + + if (node.argument) { + return ["argument"]; + } + + if (node.expression) { + return ["expression"]; + } + + throw new Error("Unexpected node has no left side."); +} + +const exportDeclarationTypes = new Set(["ExportDefaultDeclaration", "ExportDefaultSpecifier", "DeclareExportDeclaration", "ExportNamedDeclaration", "ExportAllDeclaration"]); +/** + * @param {Node} node + * @returns {boolean} + */ + +function isExportDeclaration(node) { + return node && exportDeclarationTypes.has(node.type); +} +/** + * @param {FastPath} path + * @returns {Node | null} + */ + + +function getParentExportDeclaration(path) { + const parentNode = path.getParentNode(); + + if (path.getName() === "declaration" && isExportDeclaration(parentNode)) { + return parentNode; + } + + return null; +} +/** + * @param {Node} node + * @returns {boolean} + */ + + +function isLiteral(node) { + return node.type === "BooleanLiteral" || node.type === "DirectiveLiteral" || node.type === "Literal" || node.type === "NullLiteral" || node.type === "NumericLiteral" || node.type === "BigIntLiteral" || node.type === "DecimalLiteral" || node.type === "RegExpLiteral" || node.type === "StringLiteral" || node.type === "TemplateLiteral" || node.type === "TSTypeLiteral" || node.type === "JSXText"; +} +/** + * @param {Node} node + * @returns {boolean} + */ + + +function isNumericLiteral(node) { + return node.type === "NumericLiteral" || node.type === "Literal" && typeof node.value === "number"; +} +/** + * @param {Node} node + * @returns {boolean} + */ + + +function isStringLiteral(node) { + return node.type === "StringLiteral" || node.type === "Literal" && typeof node.value === "string"; +} +/** + * @param {Node} node + * @returns {boolean} + */ + + +function isObjectType(node) { + return node.type === "ObjectTypeAnnotation" || node.type === "TSTypeLiteral"; +} +/** + * @param {Node} node + * @returns {boolean} + */ + + +function isFunctionOrArrowExpression(node) { + return node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression"; +} +/** + * @param {Node} node + * @returns {boolean} + */ + + +function isFunctionOrArrowExpressionWithBody(node) { + return node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression" && node.body.type === "BlockStatement"; +} +/** + * @param {Node} node + * @returns {boolean} + */ + + +function isTemplateLiteral(node) { + return node.type === "TemplateLiteral"; +} +/** + * Note: `inject` is used in AngularJS 1.x, `async` in Angular 2+ + * example: https://docs.angularjs.org/guide/unit-testing#using-beforeall- + * + * @param {Node} node + * @returns {boolean} + */ + + +function isAngularTestWrapper(node) { + return (node.type === "CallExpression" || node.type === "OptionalCallExpression") && node.callee.type === "Identifier" && (node.callee.name === "async" || node.callee.name === "inject" || node.callee.name === "fakeAsync"); +} +/** + * @param {Node} node + * @returns {boolean} + */ + + +function isJSXNode(node) { + return node.type === "JSXElement" || node.type === "JSXFragment"; +} + +function isTheOnlyJSXElementInMarkdown(options, path) { + if (options.parentParser !== "markdown" && options.parentParser !== "mdx") { + return false; + } + + const node = path.getNode(); + + if (!node.expression || !isJSXNode(node.expression)) { + return false; + } + + const parent = path.getParentNode(); + return parent.type === "Program" && parent.body.length === 1; +} // Detect an expression node representing `{" "}` + + +function isJSXWhitespaceExpression(node) { + return node.type === "JSXExpressionContainer" && isLiteral(node.expression) && node.expression.value === " " && !node.expression.comments; +} +/** + * @param {Node} node + * @returns {boolean} + */ + + +function isMemberExpressionChain(node) { + if (node.type !== "MemberExpression" && node.type !== "OptionalMemberExpression") { + return false; + } + + if (node.object.type === "Identifier") { + return true; + } + + return isMemberExpressionChain(node.object); +} + +function isGetterOrSetter(node) { + return node.kind === "get" || node.kind === "set"; +} +/** + * @param {Node} nodeA + * @param {Node} nodeB + * @returns {boolean} + */ + + +function sameLocStart(nodeA, nodeB, options) { + return options.locStart(nodeA) === options.locStart(nodeB); +} // TODO: This is a bad hack and we need a better way to distinguish between +// arrow functions and otherwise + + +function isFunctionNotation(node, options) { + return isGetterOrSetter(node) || sameLocStart(node, node.value, options); +} // Hack to differentiate between the following two which have the same ast +// type T = { method: () => void }; +// type T = { method(): void }; + +/** + * @param {Node} node + * @returns {boolean} + */ + + +function isObjectTypePropertyAFunction(node, options) { + return (node.type === "ObjectTypeProperty" || node.type === "ObjectTypeInternalSlot") && node.value.type === "FunctionTypeAnnotation" && !node.static && !isFunctionNotation(node, options); +} // Hack to differentiate between the following two which have the same ast +// declare function f(a): void; +// var f: (a) => void; + + +function isTypeAnnotationAFunction(node, options) { + return (node.type === "TypeAnnotation" || node.type === "TSTypeAnnotation") && node.typeAnnotation.type === "FunctionTypeAnnotation" && !node.static && !sameLocStart(node, node.typeAnnotation, options); +} + +const binaryishNodeTypes = new Set(["BinaryExpression", "LogicalExpression", "NGPipeExpression"]); +/** + * @param {Node} node + * @returns {boolean} + */ + +function isBinaryish(node) { + return binaryishNodeTypes.has(node.type); +} +/** + * @param {Node} node + * @returns {boolean} + */ + + +function isMemberish(node) { + return node.type === "MemberExpression" || node.type === "OptionalMemberExpression" || node.type === "BindExpression" && Boolean(node.object); +} + +const flowTypeAnnotations = new Set(["AnyTypeAnnotation", "NullLiteralTypeAnnotation", "GenericTypeAnnotation", "ThisTypeAnnotation", "NumberTypeAnnotation", "VoidTypeAnnotation", "EmptyTypeAnnotation", "MixedTypeAnnotation", "BooleanTypeAnnotation", "BooleanLiteralTypeAnnotation", "StringTypeAnnotation"]); +/** + * @param {Node} node + * @returns {boolean} + */ + +function isSimpleFlowType(node) { + return node && flowTypeAnnotations.has(node.type) && !(node.type === "GenericTypeAnnotation" && node.typeParameters); +} + +const unitTestRe = /^(skip|[fx]?(it|describe|test))$/; +/** + * @param {CallExpression} node + * @returns {boolean} + */ + +function isSkipOrOnlyBlock(node) { + return (node.callee.type === "MemberExpression" || node.callee.type === "OptionalMemberExpression") && node.callee.object.type === "Identifier" && node.callee.property.type === "Identifier" && unitTestRe.test(node.callee.object.name) && (node.callee.property.name === "only" || node.callee.property.name === "skip"); +} +/** + * @param {CallExpression} node + * @returns {boolean} + */ + + +function isUnitTestSetUp(node) { + const unitTestSetUpRe = /^(before|after)(Each|All)$/; + return node.callee.type === "Identifier" && unitTestSetUpRe.test(node.callee.name) && node.arguments.length === 1; +} // eg; `describe("some string", (done) => {})` + + +function isTestCall(n, parent) { + if (n.type !== "CallExpression") { + return false; + } + + if (n.arguments.length === 1) { + if (isAngularTestWrapper(n) && parent && isTestCall(parent)) { + return isFunctionOrArrowExpression(n.arguments[0]); + } + + if (isUnitTestSetUp(n)) { + return isAngularTestWrapper(n.arguments[0]); + } + } else if (n.arguments.length === 2 || n.arguments.length === 3) { + if ((n.callee.type === "Identifier" && unitTestRe.test(n.callee.name) || isSkipOrOnlyBlock(n)) && (isTemplateLiteral(n.arguments[0]) || isStringLiteral(n.arguments[0]))) { + // it("name", () => { ... }, 2500) + if (n.arguments[2] && !isNumericLiteral(n.arguments[2])) { + return false; + } + + return (n.arguments.length === 2 ? isFunctionOrArrowExpression(n.arguments[1]) : isFunctionOrArrowExpressionWithBody(n.arguments[1]) && n.arguments[1].params.length <= 1) || isAngularTestWrapper(n.arguments[1]); + } + } + + return false; +} +/** + * @param {Node} node + * @returns {boolean} + */ + + +function hasLeadingComment$2(node) { + return node.comments && node.comments.some(comment => comment.leading); +} +/** + * @param {Node} node + * @returns {boolean} + */ + + +function hasTrailingComment(node) { + return node.comments && node.comments.some(comment => comment.trailing); +} +/** + * @param {Node} node + * @returns {boolean} + */ + + +function hasTrailingLineComment(node) { + return node.comments && node.comments.some(comment => comment.trailing && !comments$1.isBlockComment(comment)); +} +/** + * @param {CallExpression | OptionalCallExpression} node + * @returns {boolean} + */ + + +function isCallOrOptionalCallExpression(node) { + return node.type === "CallExpression" || node.type === "OptionalCallExpression"; +} +/** + * @param {Node} node + * @returns {boolean} + */ + + +function hasDanglingComments(node) { + return node.comments && node.comments.some(comment => !comment.leading && !comment.trailing); +} +/** identify if an angular expression seems to have side effects */ + +/** + * @param {FastPath} path + * @returns {boolean} + */ + + +function hasNgSideEffect(path) { + return hasNode(path.getValue(), node => { + switch (node.type) { + case undefined: + return false; + + case "CallExpression": + case "OptionalCallExpression": + case "AssignmentExpression": + return true; + } + }); +} + +function isNgForOf(node, index, parentNode) { + return node.type === "NGMicrosyntaxKeyedExpression" && node.key.name === "of" && index === 1 && parentNode.body[0].type === "NGMicrosyntaxLet" && parentNode.body[0].value === null; +} +/** + * + * @param {any} node + * @returns {boolean} + */ + + +function isSimpleTemplateLiteral(node) { + if (node.expressions.length === 0) { + return false; + } + + return node.expressions.every(expr => { + // Disallow comments since printDocToString can't print them here + if (expr.comments) { + return false; + } // Allow `x` and `this` + + + if (expr.type === "Identifier" || expr.type === "ThisExpression") { + return true; + } // Allow `a.b.c`, `a.b[c]`, and `this.x.y` + + + if (expr.type === "MemberExpression" || expr.type === "OptionalMemberExpression") { + let head = expr; + + while (head.type === "MemberExpression" || head.type === "OptionalMemberExpression") { + if (head.property.type !== "Identifier" && head.property.type !== "Literal" && head.property.type !== "StringLiteral" && head.property.type !== "NumericLiteral") { + return false; + } + + head = head.object; + + if (head.comments) { + return false; + } + } + + if (head.type === "Identifier" || head.type === "ThisExpression") { + return true; + } + + return false; + } + + return false; + }); +} +/** + * @param {ObjectTypeProperty} node + */ + + +function getFlowVariance(node) { + if (!node.variance) { + return null; + } // Babel 7.0 currently uses variance node type, and flow should + // follow suit soon: + // https://github.com/babel/babel/issues/4722 + + + const variance = node.variance.kind || node.variance; + + switch (variance) { + case "plus": + return "+"; + + case "minus": + return "-"; + + default: + /* istanbul ignore next */ + return variance; + } +} +/** + * @param {FastPath} path + * @returns {boolean} + */ + + +function classPropMayCauseASIProblems(path) { + const node = path.getNode(); + + if (node.type !== "ClassProperty") { + return false; + } + + const name = node.key && node.key.name; // this isn't actually possible yet with most parsers available today + // so isn't properly tested yet. + + if ((name === "static" || name === "get" || name === "set") && !node.value && !node.typeAnnotation) { + return true; + } +} + +function classChildNeedsASIProtection(node) { + if (!node) { + return; + } + + if (node.static || node.accessibility // TypeScript + ) { + return false; + } + + if (!node.computed) { + const name = node.key && node.key.name; + + if (name === "in" || name === "instanceof") { + return true; + } + } + + switch (node.type) { + case "ClassProperty": + case "TSAbstractClassProperty": + return node.computed; + + case "MethodDefinition": // Flow + + case "TSAbstractMethodDefinition": // TypeScript + + case "ClassMethod": + case "ClassPrivateMethod": + { + // Babel + const isAsync = node.value ? node.value.async : node.async; + const isGenerator = node.value ? node.value.generator : node.generator; + + if (isAsync || node.kind === "get" || node.kind === "set") { + return false; + } + + if (node.computed || isGenerator) { + return true; + } + + return false; + } + + case "TSIndexSignature": + return true; + + default: + /* istanbul ignore next */ + return false; + } +} +/** + * @param {string} tokenNode + * @param {string} keyword + * @returns {string} + */ + + +function getTypeScriptMappedTypeModifier(tokenNode, keyword) { + if (tokenNode === "+") { + return "+" + keyword; + } else if (tokenNode === "-") { + return "-" + keyword; + } + + return keyword; +} + +function hasNewlineBetweenOrAfterDecorators(node, options) { + return hasNewlineInRange$3(options.originalText, options.locStart(node.decorators[0]), options.locEnd(getLast$2(node.decorators))) || hasNewline$4(options.originalText, options.locEnd(getLast$2(node.decorators))); +} // Only space, newline, carriage return, and tab are treated as whitespace +// inside JSX. + + +const jsxWhitespaceChars = " \n\r\t"; +const matchJsxWhitespaceRegex = new RegExp("([" + jsxWhitespaceChars + "]+)"); +const containsNonJsxWhitespaceRegex = new RegExp("[^" + jsxWhitespaceChars + "]"); // Meaningful if it contains non-whitespace characters, +// or it contains whitespace without a new line. + +/** + * @param {Node} node + * @returns {boolean} + */ + +function isMeaningfulJSXText(node) { + return isLiteral(node) && (containsNonJsxWhitespaceRegex.test(rawText(node)) || !/\n/.test(rawText(node))); +} +/** + * @param {FastPath} path + * @returns {boolean} + */ + + +function hasJsxIgnoreComment(path) { + const node = path.getValue(); + const parent = path.getParentNode(); + + if (!parent || !node || !isJSXNode(node) || !isJSXNode(parent)) { + return false; + } // Lookup the previous sibling, ignoring any empty JSXText elements + + + const index = parent.children.indexOf(node); + let prevSibling = null; + + for (let i = index; i > 0; i--) { + const candidate = parent.children[i - 1]; + + if (candidate.type === "JSXText" && !isMeaningfulJSXText(candidate)) { + continue; + } + + prevSibling = candidate; + break; + } + + return prevSibling && prevSibling.type === "JSXExpressionContainer" && prevSibling.expression.type === "JSXEmptyExpression" && prevSibling.expression.comments && prevSibling.expression.comments.some(comment => comment.value.trim() === "prettier-ignore"); +} +/** + * @param {JSXElement} node + * @returns {boolean} + */ + + +function isEmptyJSXElement(node) { + if (node.children.length === 0) { + return true; + } + + if (node.children.length > 1) { + return false; + } // if there is one text child and does not contain any meaningful text + // we can treat the element as empty. + + + const child = node.children[0]; + return isLiteral(child) && !isMeaningfulJSXText(child); +} +/** + * @param {FastPath} path + * @returns {boolean} + */ + + +function hasPrettierIgnore(path) { + return hasIgnoreComment$1(path) || hasJsxIgnoreComment(path); +} +/** + * @param {FastPath} path + * @returns {boolean} + */ + + +function isLastStatement(path) { + const parent = path.getParentNode(); + + if (!parent) { + return true; + } + + const node = path.getValue(); + const body = (parent.body || parent.consequent).filter(stmt => stmt.type !== "EmptyStatement"); + return body[body.length - 1] === node; +} +/** + * @param {string} text + * @param {Node} typeAnnotation + * @returns {boolean} + */ + + +function isFlowAnnotationComment(text, typeAnnotation, options) { + const start = options.locStart(typeAnnotation); + const end = skipWhitespace$2(text, options.locEnd(typeAnnotation)); + return end !== false && text.slice(start, start + 2) === "/*" && text.slice(end, end + 2) === "*/"; +} +/** + * @param {string} text + * @param {Node} node + * @returns {boolean} + */ + + +function hasLeadingOwnLineComment(text, node, options) { + if (isJSXNode(node)) { + return hasNodeIgnoreComment$1(node); + } + + const res = node.comments && node.comments.some(comment => comment.leading && hasNewline$4(text, options.locEnd(comment))); + return res; +} // This recurses the return argument, looking for the first token +// (the leftmost leaf node) and, if it (or its parents) has any +// leadingComments, returns true (so it can be wrapped in parens). + + +function returnArgumentHasLeadingComment(options, argument) { + if (hasLeadingOwnLineComment(options.originalText, argument, options)) { + return true; + } + + if (hasNakedLeftSide(argument)) { + let leftMost = argument; + let newLeftMost; + + while (newLeftMost = getLeftSide(leftMost)) { + leftMost = newLeftMost; + + if (hasLeadingOwnLineComment(options.originalText, leftMost, options)) { + return true; + } + } + } + + return false; +} // Note: Quoting/unquoting numbers in TypeScript is not safe. +// +// let a = { 1: 1, 2: 2 } +// let b = { '1': 1, '2': 2 } +// +// declare let aa: keyof typeof a; +// declare let bb: keyof typeof b; +// +// aa = bb; +// ^^ +// Type '"1" | "2"' is not assignable to type '1 | 2'. +// Type '"1"' is not assignable to type '1 | 2'.(2322) +// +// And in Flow, you get: +// +// const x = { +// 0: 1 +// ^ Non-string literal property keys not supported. [unsupported-syntax] +// } +// +// Angular does not support unquoted numbers in expressions. +// +// So we play it safe and only unquote numbers for the "babel" parser. +// (Vue supports unquoted numbers in expressions, but let’s keep it simple.) +// +// Identifiers can be unquoted in more circumstances, though. + + +function isStringPropSafeToUnquote(node, options) { + return options.parser !== "json" && isStringLiteral(node.key) && rawText(node.key).slice(1, -1) === node.key.value && (isIdentifierName(node.key.value) && // With `--strictPropertyInitialization`, TS treats properties with quoted names differently than unquoted ones. + // See https://github.com/microsoft/TypeScript/pull/20075 + !((options.parser === "typescript" || options.parser === "babel-ts") && node.type === "ClassProperty") || isSimpleNumber(node.key.value) && String(Number(node.key.value)) === node.key.value && options.parser === "babel"); +} // Matches “simple” numbers like `123` and `2.5` but not `1_000`, `1e+100` or `0b10`. + + +function isSimpleNumber(numberString) { + return /^(\d+|\d+\.\d+)$/.test(numberString); +} +/** + * @param {Node} node + * @param {Node} parentNode + * @returns {boolean} + */ + + +function isJestEachTemplateLiteral(node, parentNode) { + /** + * describe.each`table`(name, fn) + * describe.only.each`table`(name, fn) + * describe.skip.each`table`(name, fn) + * test.each`table`(name, fn) + * test.only.each`table`(name, fn) + * test.skip.each`table`(name, fn) + * + * Ref: https://github.com/facebook/jest/pull/6102 + */ + const jestEachTriggerRegex = /^[fx]?(describe|it|test)$/; + return parentNode.type === "TaggedTemplateExpression" && parentNode.quasi === node && parentNode.tag.type === "MemberExpression" && parentNode.tag.property.type === "Identifier" && parentNode.tag.property.name === "each" && (parentNode.tag.object.type === "Identifier" && jestEachTriggerRegex.test(parentNode.tag.object.name) || parentNode.tag.object.type === "MemberExpression" && parentNode.tag.object.property.type === "Identifier" && (parentNode.tag.object.property.name === "only" || parentNode.tag.object.property.name === "skip") && parentNode.tag.object.object.type === "Identifier" && jestEachTriggerRegex.test(parentNode.tag.object.object.name)); +} +/** + * @param {TemplateLiteral} template + * @returns {boolean} + */ + + +function templateLiteralHasNewLines(template) { + return template.quasis.some(quasi => quasi.value.raw.includes("\n")); +} +/** + * @param {TemplateLiteral | TaggedTemplateExpression} n + * @param {string} text + * @returns {boolean} + */ + + +function isTemplateOnItsOwnLine(n, text, options) { + return (n.type === "TemplateLiteral" && templateLiteralHasNewLines(n) || n.type === "TaggedTemplateExpression" && templateLiteralHasNewLines(n.quasi)) && !hasNewline$4(text, options.locStart(n), { + backwards: true + }); +} +/** + * @param {Node} node + * @returns {boolean} + */ + + +function needsHardlineAfterDanglingComment(node) { + if (!node.comments) { + return false; + } + + const lastDanglingComment = getLast$2(node.comments.filter(comment => !comment.leading && !comment.trailing)); + return lastDanglingComment && !comments$1.isBlockComment(lastDanglingComment); +} // Logic to check for args with multiple anonymous functions. For instance, +// the following call should be split on multiple lines for readability: +// source.pipe(map((x) => x + x), filter((x) => x % 2 === 0)) + + +function isFunctionCompositionArgs(args) { + if (args.length <= 1) { + return false; + } + + let count = 0; + + for (const arg of args) { + if (isFunctionOrArrowExpression(arg)) { + count += 1; + + if (count > 1) { + return true; + } + } else if (isCallOrOptionalCallExpression(arg)) { + for (const childArg of arg.arguments) { + if (isFunctionOrArrowExpression(childArg)) { + return true; + } + } + } + } + + return false; +} // Logic to determine if a call is a “long curried function call”. +// See https://github.com/prettier/prettier/issues/1420. +// +// `connect(a, b, c)(d)` +// In the above call expression, the second call is the parent node and the +// first call is the current node. + +/** + * @param {FastPath} path + * @returns {boolean} + */ + + +function isLongCurriedCallExpression(path) { + const node = path.getValue(); + const parent = path.getParentNode(); + return isCallOrOptionalCallExpression(node) && isCallOrOptionalCallExpression(parent) && parent.callee === node && node.arguments.length > parent.arguments.length && parent.arguments.length > 0; +} +/** + * @param {any} node + * @param {number} depth + * @returns {boolean} + */ + + +function isSimpleCallArgument(node, depth) { + if (depth >= 2) { + return false; + } + + const isChildSimple = child => isSimpleCallArgument(child, depth + 1); + + const regexpPattern = node.type === "Literal" && "regex" in node && node.regex.pattern || node.type === "RegExpLiteral" && node.pattern; + + if (regexpPattern && regexpPattern.length > 5) { + return false; + } + + if (node.type === "Literal" || node.type === "BigIntLiteral" || node.type === "DecimalLiteral" || node.type === "BooleanLiteral" || node.type === "NullLiteral" || node.type === "NumericLiteral" || node.type === "RegExpLiteral" || node.type === "StringLiteral" || node.type === "Identifier" || node.type === "ThisExpression" || node.type === "Super" || node.type === "PrivateName" || node.type === "ArgumentPlaceholder" || node.type === "Import") { + return true; + } + + if (node.type === "TemplateLiteral") { + return node.expressions.every(isChildSimple); + } + + if (node.type === "ObjectExpression") { + return node.properties.every(p => !p.computed && (p.shorthand || p.value && isChildSimple(p.value))); + } + + if (node.type === "ArrayExpression") { + return node.elements.every(x => x === null || isChildSimple(x)); + } + + if (node.type === "ImportExpression") { + return isChildSimple(node.source); + } + + if (node.type === "CallExpression" || node.type === "OptionalCallExpression" || node.type === "NewExpression") { + return isSimpleCallArgument(node.callee, depth) && node.arguments.every(isChildSimple); + } + + if (node.type === "MemberExpression" || node.type === "OptionalMemberExpression") { + return isSimpleCallArgument(node.object, depth) && isSimpleCallArgument(node.property, depth); + } + + if (node.type === "UnaryExpression" && (node.operator === "!" || node.operator === "-")) { + return isSimpleCallArgument(node.argument, depth); + } + + if (node.type === "TSNonNullExpression") { + return isSimpleCallArgument(node.expression, depth); + } + + return false; +} + +function rawText(node) { + return node.extra ? node.extra.raw : node.raw; +} + +function identity$1(x) { + return x; +} + +function isTSXFile(options) { + return options.filepath && /\.tsx$/i.test(options.filepath); +} +/** + * @param {any} options + * @param {("es5" | "all")} [level] + * @returns {boolean} + */ + + +function shouldPrintComma(options, level = "es5") { + return options.trailingComma === "es5" && level === "es5" || options.trailingComma === "all" && (level === "all" || level === "es5"); +} +/** + * Tests if an expression starts with `{`, or (if forbidFunctionClassAndDoExpr + * holds) `function`, `class`, or `do {}`. Will be overzealous if there's + * already necessary grouping parentheses. + * + * @param {Node} node + * @param {boolean} forbidFunctionClassAndDoExpr + * @returns {boolean} + */ + + +function startsWithNoLookaheadToken(node, forbidFunctionClassAndDoExpr) { + node = getLeftMost(node); + + switch (node.type) { + case "FunctionExpression": + case "ClassExpression": + case "DoExpression": + return forbidFunctionClassAndDoExpr; + + case "ObjectExpression": + return true; + + case "MemberExpression": + case "OptionalMemberExpression": + return startsWithNoLookaheadToken(node.object, forbidFunctionClassAndDoExpr); + + case "TaggedTemplateExpression": + if (node.tag.type === "FunctionExpression") { + // IIFEs are always already parenthesized + return false; + } + + return startsWithNoLookaheadToken(node.tag, forbidFunctionClassAndDoExpr); + + case "CallExpression": + case "OptionalCallExpression": + if (node.callee.type === "FunctionExpression") { + // IIFEs are always already parenthesized + return false; + } + + return startsWithNoLookaheadToken(node.callee, forbidFunctionClassAndDoExpr); + + case "ConditionalExpression": + return startsWithNoLookaheadToken(node.test, forbidFunctionClassAndDoExpr); + + case "UpdateExpression": + return !node.prefix && startsWithNoLookaheadToken(node.argument, forbidFunctionClassAndDoExpr); + + case "BindExpression": + return node.object && startsWithNoLookaheadToken(node.object, forbidFunctionClassAndDoExpr); + + case "SequenceExpression": + return startsWithNoLookaheadToken(node.expressions[0], forbidFunctionClassAndDoExpr); + + case "TSAsExpression": + return startsWithNoLookaheadToken(node.expression, forbidFunctionClassAndDoExpr); + + default: + return false; + } +} + +const equalityOperators = { + "==": true, + "!=": true, + "===": true, + "!==": true +}; +const multiplicativeOperators = { + "*": true, + "/": true, + "%": true +}; +const bitshiftOperators = { + ">>": true, + ">>>": true, + "<<": true +}; + +function shouldFlatten(parentOp, nodeOp) { + if (getPrecedence(nodeOp) !== getPrecedence(parentOp)) { + return false; + } // ** is right-associative + // x ** y ** z --> x ** (y ** z) + + + if (parentOp === "**") { + return false; + } // x == y == z --> (x == y) == z + + + if (equalityOperators[parentOp] && equalityOperators[nodeOp]) { + return false; + } // x * y % z --> (x * y) % z + + + if (nodeOp === "%" && multiplicativeOperators[parentOp] || parentOp === "%" && multiplicativeOperators[nodeOp]) { + return false; + } // x * y / z --> (x * y) / z + // x / y * z --> (x / y) * z + + + if (nodeOp !== parentOp && multiplicativeOperators[nodeOp] && multiplicativeOperators[parentOp]) { + return false; + } // x << y << z --> (x << y) << z + + + if (bitshiftOperators[parentOp] && bitshiftOperators[nodeOp]) { + return false; + } + + return true; +} + +const PRECEDENCE = {}; +[["|>"], ["??"], ["||"], ["&&"], ["|"], ["^"], ["&"], ["==", "===", "!=", "!=="], ["<", ">", "<=", ">=", "in", "instanceof"], [">>", "<<", ">>>"], ["+", "-"], ["*", "/", "%"], ["**"]].forEach((tier, i) => { + tier.forEach(op => { + PRECEDENCE[op] = i; + }); +}); + +function getPrecedence(op) { + return PRECEDENCE[op]; +} + +function getLeftMost(node) { + while (node.left) { + node = node.left; + } + + return node; +} + +function isBitwiseOperator(operator) { + return !!bitshiftOperators[operator] || operator === "|" || operator === "^" || operator === "&"; +} + +var utils$6 = { + classChildNeedsASIProtection, + classPropMayCauseASIProblems, + getFlowVariance, + getLeftSidePathName, + getParentExportDeclaration, + getTypeScriptMappedTypeModifier, + hasDanglingComments, + hasFlowAnnotationComment, + hasFlowShorthandAnnotationComment, + hasLeadingComment: hasLeadingComment$2, + hasLeadingOwnLineComment, + hasNakedLeftSide, + hasNewlineBetweenOrAfterDecorators, + hasNgSideEffect, + hasNode, + hasPrettierIgnore, + hasTrailingComment, + hasTrailingLineComment, + identity: identity$1, + isBinaryish, + isCallOrOptionalCallExpression, + isEmptyJSXElement, + isExportDeclaration, + isFlowAnnotationComment, + isFunctionCompositionArgs, + isFunctionNotation, + isFunctionOrArrowExpression, + isGetterOrSetter, + isJestEachTemplateLiteral, + isJSXNode, + isJSXWhitespaceExpression, + isLastStatement, + isLiteral, + isLongCurriedCallExpression, + isSimpleCallArgument, + isMeaningfulJSXText, + isMemberExpressionChain, + isMemberish, + isNgForOf, + isNumericLiteral, + isObjectType, + isObjectTypePropertyAFunction, + isSimpleFlowType, + isSimpleNumber, + isSimpleTemplateLiteral, + isStringLiteral, + isStringPropSafeToUnquote, + isTemplateOnItsOwnLine, + isTestCall, + isTheOnlyJSXElementInMarkdown, + isTSXFile, + isTypeAnnotationAFunction, + matchJsxWhitespaceRegex, + needsHardlineAfterDanglingComment, + rawText, + returnArgumentHasLeadingComment, + shouldPrintComma, + isBitwiseOperator, + shouldFlatten, + startsWithNoLookaheadToken, + getPrecedence +}; + +/** @type {import("assert")} */ + + +const { + getLeftSidePathName: getLeftSidePathName$1, + hasFlowShorthandAnnotationComment: hasFlowShorthandAnnotationComment$1, + hasNakedLeftSide: hasNakedLeftSide$1, + hasNode: hasNode$1, + isBitwiseOperator: isBitwiseOperator$1, + startsWithNoLookaheadToken: startsWithNoLookaheadToken$1, + shouldFlatten: shouldFlatten$1, + getPrecedence: getPrecedence$1 +} = utils$6; + +function needsParens(path, options) { + const parent = path.getParentNode(); + + if (!parent) { + return false; + } + + const name = path.getName(); + const node = path.getNode(); // If the value of this path is some child of a Node and not a Node + // itself, then it doesn't need parentheses. Only Node objects (in + // fact, only Expression nodes) need parentheses. + + if (path.getValue() !== node) { + return false; + } // to avoid unexpected `}}` in HTML interpolations + + + if (options.__isInHtmlInterpolation && !options.bracketSpacing && endsWithRightBracket(node) && isFollowedByRightBracket(path)) { + return true; + } // Only statements don't need parentheses. + + + if (isStatement(node)) { + return false; + } + + if ( // Preserve parens if we have a Flow annotation comment, unless we're using the Flow + // parser. The Flow parser turns Flow comments into type annotation nodes in its + // AST, which we handle separately. + options.parser !== "flow" && hasFlowShorthandAnnotationComment$1(path.getValue())) { + return true; + } // Identifiers never need parentheses. + + + if (node.type === "Identifier") { + // ...unless those identifiers are embed placeholders. They might be substituted by complex + // expressions, so the parens around them should not be dropped. Example (JS-in-HTML-in-JS): + // let tpl = html``; + // If the inner JS formatter removes the parens, the expression might change its meaning: + // f((a + b) / 2) vs f(a + b / 2) + if (node.extra && node.extra.parenthesized && /^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/.test(node.name)) { + return true; + } + + return false; + } + + if (parent.type === "ParenthesizedExpression") { + return false; + } // Add parens around the extends clause of a class. It is needed for almost + // all expressions. + + + if ((parent.type === "ClassDeclaration" || parent.type === "ClassExpression") && parent.superClass === node && (node.type === "ArrowFunctionExpression" || node.type === "AssignmentExpression" || node.type === "AwaitExpression" || node.type === "BinaryExpression" || node.type === "ConditionalExpression" || node.type === "LogicalExpression" || node.type === "NewExpression" || node.type === "ObjectExpression" || node.type === "ParenthesizedExpression" || node.type === "SequenceExpression" || node.type === "TaggedTemplateExpression" || node.type === "UnaryExpression" || node.type === "UpdateExpression" || node.type === "YieldExpression")) { + return true; + } + + if (parent.type === "ExportDefaultDeclaration") { + return (// `export default function` or `export default class` can't be followed by + // anything after. So an expression like `export default (function(){}).toString()` + // needs to be followed by a parentheses + shouldWrapFunctionForExportDefault(path, options) || // `export default (foo, bar)` also needs parentheses + node.type === "SequenceExpression" + ); + } + + if (parent.type === "Decorator" && parent.expression === node) { + let hasCallExpression = false; + let hasMemberExpression = false; + let current = node; + + while (current) { + switch (current.type) { + case "MemberExpression": + hasMemberExpression = true; + current = current.object; + break; + + case "CallExpression": + if ( + /** @(x().y) */ + hasMemberExpression || + /** @(x().y()) */ + hasCallExpression) { + return true; + } + + hasCallExpression = true; + current = current.callee; + break; + + case "Identifier": + return false; + + default: + return true; + } + } + + return true; + } + + if (parent.type === "ArrowFunctionExpression" && parent.body === node && node.type !== "SequenceExpression" && // these have parens added anyway + startsWithNoLookaheadToken$1(node, + /* forbidFunctionClassAndDoExpr */ + false) || parent.type === "ExpressionStatement" && startsWithNoLookaheadToken$1(node, + /* forbidFunctionClassAndDoExpr */ + true)) { + return true; + } + + switch (node.type) { + case "SpreadElement": + case "SpreadProperty": + return parent.type === "MemberExpression" && name === "object" && parent.object === node; + + case "UpdateExpression": + if (parent.type === "UnaryExpression") { + return node.prefix && (node.operator === "++" && parent.operator === "+" || node.operator === "--" && parent.operator === "-"); + } + + // else fallthrough + + case "UnaryExpression": + switch (parent.type) { + case "UnaryExpression": + return node.operator === parent.operator && (node.operator === "+" || node.operator === "-"); + + case "BindExpression": + return true; + + case "MemberExpression": + case "OptionalMemberExpression": + return name === "object"; + + case "TaggedTemplateExpression": + return true; + + case "NewExpression": + case "CallExpression": + case "OptionalCallExpression": + return name === "callee"; + + case "BinaryExpression": + return parent.operator === "**" && name === "left"; + + case "TSNonNullExpression": + return true; + + default: + return false; + } + + case "BinaryExpression": + { + if (parent.type === "UpdateExpression" || parent.type === "PipelineTopicExpression" && node.operator === "|>") { + return true; + } + + const isLeftOfAForStatement = node => { + let i = 0; + + while (node) { + const parent = path.getParentNode(i++); + + if (!parent) { + return false; + } + + if (parent.type === "ForStatement" && parent.init === node) { + return true; + } + + node = parent; + } + + return false; + }; + + if (node.operator === "in" && isLeftOfAForStatement(node)) { + return true; + } + + if (node.operator === "|>" && node.extra && node.extra.parenthesized) { + const grandParent = path.getParentNode(1); + + if (grandParent.type === "BinaryExpression" && grandParent.operator === "|>") { + return true; + } + } + } + // fallthrough + + case "TSTypeAssertion": + case "TSAsExpression": + case "LogicalExpression": + switch (parent.type) { + case "ConditionalExpression": + return node.type === "TSAsExpression"; + + case "CallExpression": + case "NewExpression": + case "OptionalCallExpression": + return name === "callee"; + + case "ClassExpression": + case "ClassDeclaration": + return name === "superClass" && parent.superClass === node; + + case "TSTypeAssertion": + case "TaggedTemplateExpression": + case "UnaryExpression": + case "JSXSpreadAttribute": + case "SpreadElement": + case "SpreadProperty": + case "BindExpression": + case "AwaitExpression": + case "TSAsExpression": + case "TSNonNullExpression": + case "UpdateExpression": + return true; + + case "MemberExpression": + case "OptionalMemberExpression": + return name === "object"; + + case "AssignmentExpression": + return parent.left === node && (node.type === "TSTypeAssertion" || node.type === "TSAsExpression"); + + case "LogicalExpression": + if (node.type === "LogicalExpression") { + return parent.operator !== node.operator; + } + + // else fallthrough + + case "BinaryExpression": + { + if (!node.operator && node.type !== "TSTypeAssertion") { + return true; + } + + const po = parent.operator; + const pp = getPrecedence$1(po); + const no = node.operator; + const np = getPrecedence$1(no); + + if (pp > np) { + return true; + } + + if (pp === np && name === "right") { + assert__default['default'].strictEqual(parent.right, node); + return true; + } + + if (pp === np && !shouldFlatten$1(po, no)) { + return true; + } + + if (pp < np && no === "%") { + return po === "+" || po === "-"; + } // Add parenthesis when working with bitwise operators + // It's not strictly needed but helps with code understanding + + + if (isBitwiseOperator$1(po)) { + return true; + } + + return false; + } + + default: + return false; + } + + case "SequenceExpression": + switch (parent.type) { + case "ReturnStatement": + return false; + + case "ForStatement": + // Although parentheses wouldn't hurt around sequence + // expressions in the head of for loops, traditional style + // dictates that e.g. i++, j++ should not be wrapped with + // parentheses. + return false; + + case "ExpressionStatement": + return name !== "expression"; + + case "ArrowFunctionExpression": + // We do need parentheses, but SequenceExpressions are handled + // specially when printing bodies of arrow functions. + return name !== "body"; + + default: + // Otherwise err on the side of overparenthesization, adding + // explicit exceptions above if this proves overzealous. + return true; + } + + case "YieldExpression": + if (parent.type === "UnaryExpression" || parent.type === "AwaitExpression" || parent.type === "TSAsExpression" || parent.type === "TSNonNullExpression") { + return true; + } + + // else fallthrough + + case "AwaitExpression": + switch (parent.type) { + case "TaggedTemplateExpression": + case "UnaryExpression": + case "LogicalExpression": + case "SpreadElement": + case "SpreadProperty": + case "TSAsExpression": + case "TSNonNullExpression": + case "BindExpression": + return true; + + case "MemberExpression": + case "OptionalMemberExpression": + return name === "object"; + + case "NewExpression": + case "CallExpression": + case "OptionalCallExpression": + return name === "callee"; + + case "ConditionalExpression": + return parent.test === node; + + case "BinaryExpression": + { + if (!node.argument && parent.operator === "|>") { + return false; + } + + return true; + } + + default: + return false; + } + + case "TSJSDocFunctionType": + case "TSConditionalType": + if (parent.type === "TSConditionalType" && node === parent.extendsType) { + return true; + } + + // fallthrough + + case "TSFunctionType": + case "TSConstructorType": + if (parent.type === "TSConditionalType" && node === parent.checkType) { + return true; + } + + // fallthrough + + case "TSUnionType": + case "TSIntersectionType": + if (parent.type === "TSUnionType" || parent.type === "TSIntersectionType") { + return true; + } + + // fallthrough + + case "TSInferType": + if (node.type === "TSInferType" && parent.type === "TSRestType") { + return false; + } + + // fallthrough + + case "TSTypeOperator": + return parent.type === "TSArrayType" || parent.type === "TSOptionalType" || parent.type === "TSRestType" || parent.type === "TSIndexedAccessType" && node === parent.objectType || parent.type === "TSTypeOperator" || parent.type === "TSTypeAnnotation" && /^TSJSDoc/.test(path.getParentNode(1).type); + + case "ArrayTypeAnnotation": + return parent.type === "NullableTypeAnnotation"; + + case "IntersectionTypeAnnotation": + case "UnionTypeAnnotation": + return parent.type === "ArrayTypeAnnotation" || parent.type === "NullableTypeAnnotation" || parent.type === "IntersectionTypeAnnotation" || parent.type === "UnionTypeAnnotation"; + + case "NullableTypeAnnotation": + return parent.type === "ArrayTypeAnnotation"; + + case "FunctionTypeAnnotation": + { + const ancestor = parent.type === "NullableTypeAnnotation" ? path.getParentNode(1) : parent; + return ancestor.type === "UnionTypeAnnotation" || ancestor.type === "IntersectionTypeAnnotation" || ancestor.type === "ArrayTypeAnnotation" || // We should check ancestor's parent to know whether the parentheses + // are really needed, but since ??T doesn't make sense this check + // will almost never be true. + ancestor.type === "NullableTypeAnnotation" || // See #5283 + parent.type === "FunctionTypeParam" && parent.name === null && node.params && node.params.some(param => param.typeAnnotation && param.typeAnnotation.type === "NullableTypeAnnotation"); + } + + case "StringLiteral": + case "NumericLiteral": + case "Literal": + if (typeof node.value === "string" && parent.type === "ExpressionStatement" && !parent.directive) { + // To avoid becoming a directive + const grandParent = path.getParentNode(1); + return grandParent.type === "Program" || grandParent.type === "BlockStatement"; + } + + return parent.type === "MemberExpression" && typeof node.value === "number" && name === "object" && parent.object === node; + + case "AssignmentExpression": + { + const grandParent = path.getParentNode(1); + + if (parent.type === "ArrowFunctionExpression" && parent.body === node) { + return true; + } else if (parent.type === "ClassProperty" && parent.key === node && parent.computed) { + return false; + } else if (parent.type === "TSPropertySignature" && parent.name === node) { + return false; + } else if (parent.type === "ForStatement" && (parent.init === node || parent.update === node)) { + return false; + } else if (parent.type === "ExpressionStatement") { + return node.left.type === "ObjectPattern"; + } else if (parent.type === "TSPropertySignature" && parent.key === node) { + return false; + } else if (parent.type === "AssignmentExpression") { + return false; + } else if (parent.type === "SequenceExpression" && grandParent && grandParent.type === "ForStatement" && (grandParent.init === parent || grandParent.update === parent)) { + return false; + } else if (parent.type === "Property" && parent.value === node) { + return false; + } else if (parent.type === "NGChainedExpression") { + return false; + } + + return true; + } + + case "ConditionalExpression": + switch (parent.type) { + case "TaggedTemplateExpression": + case "UnaryExpression": + case "SpreadElement": + case "SpreadProperty": + case "BinaryExpression": + case "LogicalExpression": + case "NGPipeExpression": + case "ExportDefaultDeclaration": + case "AwaitExpression": + case "JSXSpreadAttribute": + case "TSTypeAssertion": + case "TypeCastExpression": + case "TSAsExpression": + case "TSNonNullExpression": + return true; + + case "NewExpression": + case "CallExpression": + case "OptionalCallExpression": + return name === "callee"; + + case "ConditionalExpression": + return name === "test" && parent.test === node; + + case "MemberExpression": + case "OptionalMemberExpression": + return name === "object"; + + default: + return false; + } + + case "FunctionExpression": + switch (parent.type) { + case "NewExpression": + case "CallExpression": + case "OptionalCallExpression": + // Not always necessary, but it's clearer to the reader if IIFEs are wrapped in parentheses. + // Is necessary if it is `expression` of `ExpressionStatement`. + return name === "callee"; + + case "TaggedTemplateExpression": + return true; + // This is basically a kind of IIFE. + + default: + return false; + } + + case "ArrowFunctionExpression": + switch (parent.type) { + case "PipelineTopicExpression": + return !!(node.extra && node.extra.parenthesized); + + case "BinaryExpression": + return parent.operator !== "|>" || node.extra && node.extra.parenthesized; + + case "NewExpression": + case "CallExpression": + case "OptionalCallExpression": + return name === "callee"; + + case "MemberExpression": + case "OptionalMemberExpression": + return name === "object"; + + case "TSAsExpression": + case "BindExpression": + case "TaggedTemplateExpression": + case "UnaryExpression": + case "LogicalExpression": + case "AwaitExpression": + case "TSTypeAssertion": + return true; + + case "ConditionalExpression": + return name === "test"; + + default: + return false; + } + + case "ClassExpression": + switch (parent.type) { + case "NewExpression": + return name === "callee" && parent.callee === node; + + default: + return false; + } + + case "OptionalMemberExpression": + case "OptionalCallExpression": + { + const parentParent = path.getParentNode(1); + + if (parent.type === "MemberExpression" && name === "object" || (parent.type === "CallExpression" || parent.type === "NewExpression") && name === "callee" || parent.type === "TSNonNullExpression" && parentParent.type === "MemberExpression" && parentParent.object === parent) { + return true; + } + } + // fallthrough + + case "CallExpression": + case "MemberExpression": + case "TaggedTemplateExpression": + case "TSNonNullExpression": + if ((parent.type === "BindExpression" || parent.type === "NewExpression") && name === "callee") { + let object = node; + + while (object) { + switch (object.type) { + case "CallExpression": + case "OptionalCallExpression": + return true; + + case "MemberExpression": + case "OptionalMemberExpression": + case "BindExpression": + object = object.object; + break; + // tagged templates are basically member expressions from a grammar perspective + // see https://tc39.github.io/ecma262/#prod-MemberExpression + + case "TaggedTemplateExpression": + object = object.tag; + break; + + case "TSNonNullExpression": + object = object.expression; + break; + + default: + return false; + } + } + } + + return false; + + case "BindExpression": + return (parent.type === "BindExpression" || parent.type === "NewExpression") && name === "callee" || (parent.type === "MemberExpression" || parent.type === "OptionalMemberExpression") && name === "object"; + + case "NGPipeExpression": + if (parent.type === "NGRoot" || parent.type === "NGMicrosyntaxExpression" || parent.type === "ObjectProperty" && // Preserve parens for compatibility with AngularJS expressions + !(node.extra && node.extra.parenthesized) || parent.type === "ArrayExpression" || (parent.type === "CallExpression" || parent.type === "OptionalCallExpression") && parent.arguments[name] === node || parent.type === "NGPipeExpression" && name === "right" || parent.type === "MemberExpression" && name === "property" || parent.type === "AssignmentExpression") { + return false; + } + + return true; + + case "JSXFragment": + case "JSXElement": + return name === "callee" || parent.type === "BinaryExpression" && parent.operator === "<" && name === "left" || parent.type !== "ArrayExpression" && parent.type !== "ArrowFunctionExpression" && parent.type !== "AssignmentExpression" && parent.type !== "AssignmentPattern" && parent.type !== "BinaryExpression" && parent.type !== "CallExpression" && parent.type !== "NewExpression" && parent.type !== "ConditionalExpression" && parent.type !== "ExpressionStatement" && parent.type !== "JsExpressionRoot" && parent.type !== "JSXAttribute" && parent.type !== "JSXElement" && parent.type !== "JSXExpressionContainer" && parent.type !== "JSXFragment" && parent.type !== "LogicalExpression" && parent.type !== "ObjectProperty" && parent.type !== "OptionalCallExpression" && parent.type !== "Property" && parent.type !== "ReturnStatement" && parent.type !== "ThrowStatement" && parent.type !== "TypeCastExpression" && parent.type !== "VariableDeclarator"; + + case "TypeAnnotation": + return name === "returnType" && parent.type === "ArrowFunctionExpression" && includesFunctionTypeInObjectType(node); + } + + return false; +} + +function isStatement(node) { + return node.type === "BlockStatement" || node.type === "BreakStatement" || node.type === "ClassBody" || node.type === "ClassDeclaration" || node.type === "ClassMethod" || node.type === "ClassProperty" || node.type === "ClassPrivateProperty" || node.type === "ContinueStatement" || node.type === "DebuggerStatement" || node.type === "DeclareClass" || node.type === "DeclareExportAllDeclaration" || node.type === "DeclareExportDeclaration" || node.type === "DeclareFunction" || node.type === "DeclareInterface" || node.type === "DeclareModule" || node.type === "DeclareModuleExports" || node.type === "DeclareVariable" || node.type === "DoWhileStatement" || node.type === "EnumDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ExportDefaultDeclaration" || node.type === "ExportNamedDeclaration" || node.type === "ExpressionStatement" || node.type === "ForInStatement" || node.type === "ForOfStatement" || node.type === "ForStatement" || node.type === "FunctionDeclaration" || node.type === "IfStatement" || node.type === "ImportDeclaration" || node.type === "InterfaceDeclaration" || node.type === "LabeledStatement" || node.type === "MethodDefinition" || node.type === "ReturnStatement" || node.type === "SwitchStatement" || node.type === "ThrowStatement" || node.type === "TryStatement" || node.type === "TSDeclareFunction" || node.type === "TSEnumDeclaration" || node.type === "TSImportEqualsDeclaration" || node.type === "TSInterfaceDeclaration" || node.type === "TSModuleDeclaration" || node.type === "TSNamespaceExportDeclaration" || node.type === "TypeAlias" || node.type === "VariableDeclaration" || node.type === "WhileStatement" || node.type === "WithStatement"; +} + +function includesFunctionTypeInObjectType(node) { + return hasNode$1(node, n1 => n1.type === "ObjectTypeAnnotation" && hasNode$1(n1, n2 => n2.type === "FunctionTypeAnnotation" || undefined) || undefined); +} + +function endsWithRightBracket(node) { + switch (node.type) { + case "ObjectExpression": + return true; + + default: + return false; + } +} + +function isFollowedByRightBracket(path) { + const node = path.getValue(); + const parent = path.getParentNode(); + const name = path.getName(); + + switch (parent.type) { + case "NGPipeExpression": + if (typeof name === "number" && parent.arguments[name] === node && parent.arguments.length - 1 === name) { + return path.callParent(isFollowedByRightBracket); + } + + break; + + case "ObjectProperty": + if (name === "value") { + const parentParent = path.getParentNode(1); + return parentParent.properties[parentParent.properties.length - 1] === parent; + } + + break; + + case "BinaryExpression": + case "LogicalExpression": + if (name === "right") { + return path.callParent(isFollowedByRightBracket); + } + + break; + + case "ConditionalExpression": + if (name === "alternate") { + return path.callParent(isFollowedByRightBracket); + } + + break; + + case "UnaryExpression": + if (parent.prefix) { + return path.callParent(isFollowedByRightBracket); + } + + break; + } + + return false; +} + +function shouldWrapFunctionForExportDefault(path, options) { + const node = path.getValue(); + const parent = path.getParentNode(); + + if (node.type === "FunctionExpression" || node.type === "ClassExpression") { + return parent.type === "ExportDefaultDeclaration" || // in some cases the function is already wrapped + // (e.g. `export default (function() {})();`) + // in this case we don't need to add extra parens + !needsParens(path, options); + } + + if (!hasNakedLeftSide$1(node) || parent.type !== "ExportDefaultDeclaration" && needsParens(path, options)) { + return false; + } + + return path.call(childPath => shouldWrapFunctionForExportDefault(childPath, options), ...getLeftSidePathName$1(path, node)); +} + +var needsParens_1 = needsParens; + +const { + builders: { + concat: concat$5, + join: join$3, + line: line$4 + } +} = document; + +function printHtmlBinding(path, options, print) { + const node = path.getValue(); + + if (options.__onHtmlBindingRoot && path.getName() === null) { + options.__onHtmlBindingRoot(node, options); + } + + if (node.type !== "File") { + return; + } + + if (options.__isVueForBindingLeft) { + return path.call(functionDeclarationPath => { + const { + params + } = functionDeclarationPath.getValue(); + return concat$5([params.length > 1 ? "(" : "", join$3(concat$5([",", line$4]), functionDeclarationPath.map(print, "params")), params.length > 1 ? ")" : ""]); + }, "program", "body", 0); + } + + if (options.__isVueSlotScope) { + return path.call(functionDeclarationPath => join$3(concat$5([",", line$4]), functionDeclarationPath.map(print, "params")), "program", "body", 0); + } +} // based on https://github.com/prettier/prettier/blob/master/src/language-html/syntax-vue.js isVueEventBindingExpression() + + +function isVueEventBindingExpression(node) { + switch (node.type) { + case "MemberExpression": + switch (node.property.type) { + case "Identifier": + case "NumericLiteral": + case "StringLiteral": + return isVueEventBindingExpression(node.object); + } + + return false; + + case "Identifier": + return true; + + default: + return false; + } +} + +var htmlBinding = { + isVueEventBindingExpression, + printHtmlBinding +}; + +function preprocess(ast, options) { + switch (options.parser) { + case "json": + case "json5": + case "json-stringify": + case "__js_expression": + case "__vue_expression": + return Object.assign({}, ast, { + type: options.parser.startsWith("__") ? "JsExpressionRoot" : "JsonRoot", + node: ast, + comments: [], + rootMarker: options.rootMarker + }); + + default: + return ast; + } +} + +var preprocess_1 = preprocess; + +const { + getLast: getLast$3, + getPenultimate: getPenultimate$1, + isNextLineEmpty: isNextLineEmpty$2 +} = util; +const { + hasLeadingComment: hasLeadingComment$3, + hasTrailingComment: hasTrailingComment$1, + isFunctionCompositionArgs: isFunctionCompositionArgs$1, + isJSXNode: isJSXNode$1, + isLongCurriedCallExpression: isLongCurriedCallExpression$1, + shouldPrintComma: shouldPrintComma$1 +} = utils$6; +const { + builders: { + concat: concat$6, + line: line$5, + hardline: hardline$4, + softline: softline$2, + group: group$2, + indent: indent$3, + conditionalGroup: conditionalGroup$1, + ifBreak: ifBreak$1, + breakParent: breakParent$2 + }, + utils: { + willBreak: willBreak$1 + } +} = document; + +function printCallArguments(path, options, print) { + const node = path.getValue(); + const isDynamicImport = node.type === "ImportExpression"; + const args = isDynamicImport ? [node.source] : node.arguments; + + if (args.length === 0) { + return concat$6(["(", comments.printDanglingComments(path, options, + /* sameIndent */ + true), ")"]); + } // useEffect(() => { ... }, [foo, bar, baz]) + + + if (args.length === 2 && args[0].type === "ArrowFunctionExpression" && args[0].params.length === 0 && args[0].body.type === "BlockStatement" && args[1].type === "ArrayExpression" && !args.some(arg => arg.comments)) { + return concat$6(["(", path.call(print, "arguments", 0), ", ", path.call(print, "arguments", 1), ")"]); + } // func( + // ({ + // a, + // + // b + // }) => {} + // ); + + + function shouldBreakForArrowFunctionInArguments(arg, argPath) { + if (!arg || arg.type !== "ArrowFunctionExpression" || !arg.body || arg.body.type !== "BlockStatement" || !arg.params || arg.params.length < 1) { + return false; + } + + let shouldBreak = false; + argPath.each(paramPath => { + const printed = concat$6([print(paramPath)]); + shouldBreak = shouldBreak || willBreak$1(printed); + }, "params"); + return shouldBreak; + } + + let anyArgEmptyLine = false; + let shouldBreakForArrowFunction = false; + let hasEmptyLineFollowingFirstArg = false; + const lastArgIndex = args.length - 1; + + const printArgument = (argPath, index) => { + const arg = argPath.getNode(); + const parts = [print(argPath)]; + + if (index === lastArgIndex) ; else if (isNextLineEmpty$2(options.originalText, arg, options.locEnd)) { + if (index === 0) { + hasEmptyLineFollowingFirstArg = true; + } + + anyArgEmptyLine = true; + parts.push(",", hardline$4, hardline$4); + } else { + parts.push(",", line$5); + } + + shouldBreakForArrowFunction = shouldBreakForArrowFunctionInArguments(arg, argPath); + return concat$6(parts); + }; + + const printedArguments = isDynamicImport ? [path.call(path => printArgument(path, 0), "source")] : path.map(printArgument, "arguments"); + const maybeTrailingComma = // Dynamic imports cannot have trailing commas + !(isDynamicImport || node.callee && node.callee.type === "Import") && shouldPrintComma$1(options, "all") ? "," : ""; + + function allArgsBrokenOut() { + return group$2(concat$6(["(", indent$3(concat$6([line$5, concat$6(printedArguments)])), maybeTrailingComma, line$5, ")"]), { + shouldBreak: true + }); + } + + if (path.getParentNode().type !== "Decorator" && isFunctionCompositionArgs$1(args)) { + return allArgsBrokenOut(); + } + + const shouldGroupFirst = shouldGroupFirstArg(args); + const shouldGroupLast = shouldGroupLastArg(args); + + if (shouldGroupFirst || shouldGroupLast) { + const shouldBreak = (shouldGroupFirst ? printedArguments.slice(1).some(willBreak$1) : printedArguments.slice(0, -1).some(willBreak$1)) || anyArgEmptyLine || shouldBreakForArrowFunction; // We want to print the last argument with a special flag + + let printedExpanded = []; + let i = 0; + + const printArgument = argPath => { + if (shouldGroupFirst && i === 0) { + printedExpanded = [concat$6([argPath.call(p => print(p, { + expandFirstArg: true + })), printedArguments.length > 1 ? "," : "", hasEmptyLineFollowingFirstArg ? hardline$4 : line$5, hasEmptyLineFollowingFirstArg ? hardline$4 : ""])].concat(printedArguments.slice(1)); + } + + if (shouldGroupLast && i === args.length - 1) { + printedExpanded = printedArguments.slice(0, -1).concat(argPath.call(p => print(p, { + expandLastArg: true + }))); + } + + i++; + }; + + if (isDynamicImport) { + path.call(printArgument, "source"); + } else { + path.each(printArgument, "arguments"); + } + + const somePrintedArgumentsWillBreak = printedArguments.some(willBreak$1); + const simpleConcat = concat$6(["(", concat$6(printedExpanded), ")"]); + return concat$6([somePrintedArgumentsWillBreak ? breakParent$2 : "", conditionalGroup$1([!somePrintedArgumentsWillBreak && !node.typeArguments && !node.typeParameters ? simpleConcat : ifBreak$1(allArgsBrokenOut(), simpleConcat), shouldGroupFirst ? concat$6(["(", group$2(printedExpanded[0], { + shouldBreak: true + }), concat$6(printedExpanded.slice(1)), ")"]) : concat$6(["(", concat$6(printedArguments.slice(0, -1)), group$2(getLast$3(printedExpanded), { + shouldBreak: true + }), ")"]), allArgsBrokenOut()], { + shouldBreak + })]); + } + + const contents = concat$6(["(", indent$3(concat$6([softline$2, concat$6(printedArguments)])), ifBreak$1(maybeTrailingComma), softline$2, ")"]); + + if (isLongCurriedCallExpression$1(path)) { + // By not wrapping the arguments in a group, the printer prioritizes + // breaking up these arguments rather than the args of the parent call. + return contents; + } + + return group$2(contents, { + shouldBreak: printedArguments.some(willBreak$1) || anyArgEmptyLine + }); +} + +function couldGroupArg(arg) { + return arg.type === "ObjectExpression" && (arg.properties.length > 0 || arg.comments) || arg.type === "ArrayExpression" && (arg.elements.length > 0 || arg.comments) || arg.type === "TSTypeAssertion" && couldGroupArg(arg.expression) || arg.type === "TSAsExpression" && couldGroupArg(arg.expression) || arg.type === "FunctionExpression" || arg.type === "ArrowFunctionExpression" && ( // we want to avoid breaking inside composite return types but not simple keywords + // https://github.com/prettier/prettier/issues/4070 + // export class Thing implements OtherThing { + // do: (type: Type) => Provider = memoize( + // (type: ObjectType): Provider => {} + // ); + // } + // https://github.com/prettier/prettier/issues/6099 + // app.get("/", (req, res): void => { + // res.send("Hello World!"); + // }); + !arg.returnType || !arg.returnType.typeAnnotation || arg.returnType.typeAnnotation.type !== "TSTypeReference") && (arg.body.type === "BlockStatement" || arg.body.type === "ArrowFunctionExpression" || arg.body.type === "ObjectExpression" || arg.body.type === "ArrayExpression" || arg.body.type === "CallExpression" || arg.body.type === "OptionalCallExpression" || arg.body.type === "ConditionalExpression" || isJSXNode$1(arg.body)); +} + +function shouldGroupLastArg(args) { + const lastArg = getLast$3(args); + const penultimateArg = getPenultimate$1(args); + return !hasLeadingComment$3(lastArg) && !hasTrailingComment$1(lastArg) && couldGroupArg(lastArg) && ( // If the last two arguments are of the same type, + // disable last element expansion. + !penultimateArg || penultimateArg.type !== lastArg.type); +} + +function shouldGroupFirstArg(args) { + if (args.length !== 2) { + return false; + } + + const [firstArg, secondArg] = args; + return (!firstArg.comments || !firstArg.comments.length) && (firstArg.type === "FunctionExpression" || firstArg.type === "ArrowFunctionExpression" && firstArg.body.type === "BlockStatement") && secondArg.type !== "FunctionExpression" && secondArg.type !== "ArrowFunctionExpression" && secondArg.type !== "ConditionalExpression" && !couldGroupArg(secondArg); +} + +var callArguments = printCallArguments; + +const { + isNumericLiteral: isNumericLiteral$1 +} = utils$6; +const { + builders: { + concat: concat$7, + softline: softline$3, + group: group$3, + indent: indent$4 + } +} = document; + +function printOptionalToken(path) { + const node = path.getValue(); + + if (!node.optional || // It's an optional computed method parsed by typescript-estree. + // "?" is printed in `printMethod`. + node.type === "Identifier" && node === path.getParentNode().key) { + return ""; + } + + if (node.type === "OptionalCallExpression" || node.type === "OptionalMemberExpression" && node.computed) { + return "?."; + } + + return "?"; +} + +function printFunctionTypeParameters(path, options, print) { + const fun = path.getValue(); + + if (fun.typeArguments) { + return path.call(print, "typeArguments"); + } + + if (fun.typeParameters) { + return path.call(print, "typeParameters"); + } + + return ""; +} + +function printMemberLookup(path, options, print) { + const property = path.call(print, "property"); + const n = path.getValue(); + const optional = printOptionalToken(path); + + if (!n.computed) { + return concat$7([optional, ".", property]); + } + + if (!n.property || isNumericLiteral$1(n.property)) { + return concat$7([optional, "[", property, "]"]); + } + + return group$3(concat$7([optional, "[", indent$4(concat$7([softline$3, property])), softline$3, "]"])); +} + +function printBindExpressionCallee(path, options, print) { + return concat$7(["::", path.call(print, "callee")]); +} + +var misc = { + printOptionalToken, + printFunctionTypeParameters, + printMemberLookup, + printBindExpressionCallee +}; + +const { + getLast: getLast$4, + isNextLineEmpty: isNextLineEmpty$3, + isNextLineEmptyAfterIndex: isNextLineEmptyAfterIndex$2, + getNextNonSpaceNonCommentCharacterIndex: getNextNonSpaceNonCommentCharacterIndex$3 +} = util; +const { + hasLeadingComment: hasLeadingComment$4, + hasTrailingComment: hasTrailingComment$2, + isCallOrOptionalCallExpression: isCallOrOptionalCallExpression$1, + isFunctionOrArrowExpression: isFunctionOrArrowExpression$1, + isLongCurriedCallExpression: isLongCurriedCallExpression$2, + isMemberish: isMemberish$1, + isNumericLiteral: isNumericLiteral$2, + isSimpleCallArgument: isSimpleCallArgument$1 +} = utils$6; +const { + builders: { + concat: concat$8, + join: join$4, + hardline: hardline$5, + group: group$4, + indent: indent$5, + conditionalGroup: conditionalGroup$2, + breakParent: breakParent$3 + }, + utils: { + willBreak: willBreak$2 + } +} = document; +const { + printOptionalToken: printOptionalToken$1, + printFunctionTypeParameters: printFunctionTypeParameters$1, + printMemberLookup: printMemberLookup$1, + printBindExpressionCallee: printBindExpressionCallee$1 +} = misc; // We detect calls on member expressions specially to format a +// common pattern better. The pattern we are looking for is this: +// +// arr +// .map(x => x + 1) +// .filter(x => x > 10) +// .some(x => x % 2) +// +// The way it is structured in the AST is via a nested sequence of +// MemberExpression and CallExpression. We need to traverse the AST +// and make groups out of it to print it in the desired way. + +function printMemberChain(path, options, print) { + const parent = path.getParentNode(); + const isExpressionStatement = !parent || parent.type === "ExpressionStatement"; // The first phase is to linearize the AST by traversing it down. + // + // a().b() + // has the following AST structure: + // CallExpression(MemberExpression(CallExpression(Identifier))) + // and we transform it into + // [Identifier, CallExpression, MemberExpression, CallExpression] + + const printedNodes = []; // Here we try to retain one typed empty line after each call expression or + // the first group whether it is in parentheses or not + + function shouldInsertEmptyLineAfter(node) { + const { + originalText + } = options; + const nextCharIndex = getNextNonSpaceNonCommentCharacterIndex$3(originalText, node, options.locEnd); + const nextChar = originalText.charAt(nextCharIndex); // if it is cut off by a parenthesis, we only account for one typed empty + // line after that parenthesis + + if (nextChar === ")") { + return nextCharIndex !== false && isNextLineEmptyAfterIndex$2(originalText, nextCharIndex + 1); + } + + return isNextLineEmpty$3(originalText, node, options.locEnd); + } + + function rec(path) { + const node = path.getValue(); + + if (isCallOrOptionalCallExpression$1(node) && (isMemberish$1(node.callee) || isCallOrOptionalCallExpression$1(node.callee))) { + printedNodes.unshift({ + node, + printed: concat$8([comments.printComments(path, () => concat$8([printOptionalToken$1(path), printFunctionTypeParameters$1(path, options, print), callArguments(path, options, print)]), options), shouldInsertEmptyLineAfter(node) ? hardline$5 : ""]) + }); + path.call(callee => rec(callee), "callee"); + } else if (isMemberish$1(node)) { + printedNodes.unshift({ + node, + needsParens: needsParens_1(path, options), + printed: comments.printComments(path, () => node.type === "OptionalMemberExpression" || node.type === "MemberExpression" ? printMemberLookup$1(path, options, print) : printBindExpressionCallee$1(path, options, print), options) + }); + path.call(object => rec(object), "object"); + } else if (node.type === "TSNonNullExpression") { + printedNodes.unshift({ + node, + printed: comments.printComments(path, () => "!", options) + }); + path.call(expression => rec(expression), "expression"); + } else { + printedNodes.unshift({ + node, + printed: path.call(print) + }); + } + } // Note: the comments of the root node have already been printed, so we + // need to extract this first call without printing them as they would + // if handled inside of the recursive call. + + + const node = path.getValue(); + printedNodes.unshift({ + node, + printed: concat$8([printOptionalToken$1(path), printFunctionTypeParameters$1(path, options, print), callArguments(path, options, print)]) + }); + + if (node.callee) { + path.call(callee => rec(callee), "callee"); + } // Once we have a linear list of printed nodes, we want to create groups out + // of it. + // + // a().b.c().d().e + // will be grouped as + // [ + // [Identifier, CallExpression], + // [MemberExpression, MemberExpression, CallExpression], + // [MemberExpression, CallExpression], + // [MemberExpression], + // ] + // so that we can print it as + // a() + // .b.c() + // .d() + // .e + // The first group is the first node followed by + // - as many CallExpression as possible + // < fn()()() >.something() + // - as many array accessors as possible + // < fn()[0][1][2] >.something() + // - then, as many MemberExpression as possible but the last one + // < this.items >.something() + + + const groups = []; + let currentGroup = [printedNodes[0]]; + let i = 1; + + for (; i < printedNodes.length; ++i) { + if (printedNodes[i].node.type === "TSNonNullExpression" || isCallOrOptionalCallExpression$1(printedNodes[i].node) || (printedNodes[i].node.type === "MemberExpression" || printedNodes[i].node.type === "OptionalMemberExpression") && printedNodes[i].node.computed && isNumericLiteral$2(printedNodes[i].node.property)) { + currentGroup.push(printedNodes[i]); + } else { + break; + } + } + + if (!isCallOrOptionalCallExpression$1(printedNodes[0].node)) { + for (; i + 1 < printedNodes.length; ++i) { + if (isMemberish$1(printedNodes[i].node) && isMemberish$1(printedNodes[i + 1].node)) { + currentGroup.push(printedNodes[i]); + } else { + break; + } + } + } + + groups.push(currentGroup); + currentGroup = []; // Then, each following group is a sequence of MemberExpression followed by + // a sequence of CallExpression. To compute it, we keep adding things to the + // group until we has seen a CallExpression in the past and reach a + // MemberExpression + + let hasSeenCallExpression = false; + + for (; i < printedNodes.length; ++i) { + if (hasSeenCallExpression && isMemberish$1(printedNodes[i].node)) { + // [0] should be appended at the end of the group instead of the + // beginning of the next one + if (printedNodes[i].node.computed && isNumericLiteral$2(printedNodes[i].node.property)) { + currentGroup.push(printedNodes[i]); + continue; + } + + groups.push(currentGroup); + currentGroup = []; + hasSeenCallExpression = false; + } + + if (isCallOrOptionalCallExpression$1(printedNodes[i].node) || printedNodes[i].node.type === "ImportExpression") { + hasSeenCallExpression = true; + } + + currentGroup.push(printedNodes[i]); + + if (printedNodes[i].node.comments && printedNodes[i].node.comments.some(comment => comment.trailing)) { + groups.push(currentGroup); + currentGroup = []; + hasSeenCallExpression = false; + } + } + + if (currentGroup.length > 0) { + groups.push(currentGroup); + } // There are cases like Object.keys(), Observable.of(), _.values() where + // they are the subject of all the chained calls and therefore should + // be kept on the same line: + // + // Object.keys(items) + // .filter(x => x) + // .map(x => x) + // + // In order to detect those cases, we use an heuristic: if the first + // node is an identifier with the name starting with a capital + // letter or just a sequence of _$. The rationale is that they are + // likely to be factories. + + + function isFactory(name) { + return /^[A-Z]|^[$_]+$/.test(name); + } // In case the Identifier is shorter than tab width, we can keep the + // first call in a single line, if it's an ExpressionStatement. + // + // d3.scaleLinear() + // .domain([0, 100]) + // .range([0, width]); + // + + + function isShort(name) { + return name.length <= options.tabWidth; + } + + function shouldNotWrap(groups) { + const hasComputed = groups[1].length && groups[1][0].node.computed; + + if (groups[0].length === 1) { + const firstNode = groups[0][0].node; + return firstNode.type === "ThisExpression" || firstNode.type === "Identifier" && (isFactory(firstNode.name) || isExpressionStatement && isShort(firstNode.name) || hasComputed); + } + + const lastNode = getLast$4(groups[0]).node; + return (lastNode.type === "MemberExpression" || lastNode.type === "OptionalMemberExpression") && lastNode.property.type === "Identifier" && (isFactory(lastNode.property.name) || hasComputed); + } + + const shouldMerge = groups.length >= 2 && !groups[1][0].node.comments && shouldNotWrap(groups); + + function printGroup(printedGroup) { + const printed = printedGroup.map(tuple => tuple.printed); // Checks if the last node (i.e. the parent node) needs parens and print + // accordingly + + if (printedGroup.length > 0 && printedGroup[printedGroup.length - 1].needsParens) { + return concat$8(["(", ...printed, ")"]); + } + + return concat$8(printed); + } + + function printIndentedGroup(groups) { + /* istanbul ignore next */ + if (groups.length === 0) { + return ""; + } + + return indent$5(group$4(concat$8([hardline$5, join$4(hardline$5, groups.map(printGroup))]))); + } + + const printedGroups = groups.map(printGroup); + const oneLine = concat$8(printedGroups); + const cutoff = shouldMerge ? 3 : 2; + const flatGroups = flatten_1(groups); + const hasComment = flatGroups.slice(1, -1).some(node => hasLeadingComment$4(node.node)) || flatGroups.slice(0, -1).some(node => hasTrailingComment$2(node.node)) || groups[cutoff] && hasLeadingComment$4(groups[cutoff][0].node); // If we only have a single `.`, we shouldn't do anything fancy and just + // render everything concatenated together. + + if (groups.length <= cutoff && !hasComment) { + if (isLongCurriedCallExpression$2(path)) { + return oneLine; + } + + return group$4(oneLine); + } // Find out the last node in the first group and check if it has an + // empty line after + + + const lastNodeBeforeIndent = getLast$4(groups[shouldMerge ? 1 : 0]).node; + const shouldHaveEmptyLineBeforeIndent = !isCallOrOptionalCallExpression$1(lastNodeBeforeIndent) && shouldInsertEmptyLineAfter(lastNodeBeforeIndent); + const expanded = concat$8([printGroup(groups[0]), shouldMerge ? concat$8(groups.slice(1, 2).map(printGroup)) : "", shouldHaveEmptyLineBeforeIndent ? hardline$5 : "", printIndentedGroup(groups.slice(shouldMerge ? 2 : 1))]); + const callExpressions = printedNodes.map(({ + node + }) => node).filter(isCallOrOptionalCallExpression$1); + + function lastGroupWillBreakAndOtherCallsHaveFunctionArguments() { + const lastGroupNode = getLast$4(getLast$4(groups)).node; + const lastGroupDoc = getLast$4(printedGroups); + return isCallOrOptionalCallExpression$1(lastGroupNode) && willBreak$2(lastGroupDoc) && callExpressions.slice(0, -1).some(n => n.arguments.some(isFunctionOrArrowExpression$1)); + } // We don't want to print in one line if at least one of these conditions occurs: + // * the chain has comments, + // * the chain is an expression statement and all the arguments are literal-like ("fluent configuration" pattern), + // * the chain is longer than 2 calls and has non-trivial arguments or more than 2 arguments in any call but the first one, + // * any group but the last one has a hard line, + // * the last call's arguments have a hard line and other calls have non-trivial arguments. + + + if (hasComment || callExpressions.length > 2 && callExpressions.some(expr => !expr.arguments.every(arg => isSimpleCallArgument$1(arg, 0))) || printedGroups.slice(0, -1).some(willBreak$2) || lastGroupWillBreakAndOtherCallsHaveFunctionArguments()) { + return group$4(expanded); + } + + return concat$8([// We only need to check `oneLine` because if `expanded` is chosen + // that means that the parent group has already been broken + // naturally + willBreak$2(oneLine) || shouldHaveEmptyLineBeforeIndent ? breakParent$3 : "", conditionalGroup$2([oneLine, expanded])]); +} + +var memberChain = printMemberChain; + +const { + builders: { + concat: concat$9, + softline: softline$4, + group: group$5, + indent: indent$6, + join: join$5, + line: line$6, + ifBreak: ifBreak$2 + } +} = document; +const { + shouldPrintComma: shouldPrintComma$2 +} = utils$6; +/** + * @typedef {import("../../document").Doc} Doc + */ + +function printModuleSource(path, options, print) { + const node = path.getValue(); + return node.source ? concat$9([" from ", path.call(print, "source")]) : ""; +} + +function printModuleSpecifiers(path, options, print) { + const node = path.getValue(); + /** @type{Doc[]} */ + + const parts = [node.type === "ImportDeclaration" ? " " : ""]; + + if (node.specifiers && node.specifiers.length > 0) { + const standalonesSpecifiers = []; + const groupedSpecifiers = []; + path.each(specifierPath => { + const specifierType = path.getValue().type; + + if (specifierType === "ExportNamespaceSpecifier" || specifierType === "ExportDefaultSpecifier" || specifierType === "ImportNamespaceSpecifier" || specifierType === "ImportDefaultSpecifier") { + standalonesSpecifiers.push(print(specifierPath)); + } else if (specifierType === "ExportSpecifier" || specifierType === "ImportSpecifier") { + groupedSpecifiers.push(print(specifierPath)); + } else { + /* istanbul ignore next */ + throw new Error(`Unknown specifier type ${JSON.stringify(specifierType)}`); + } + }, "specifiers"); + parts.push(join$5(", ", standalonesSpecifiers)); + + if (groupedSpecifiers.length !== 0) { + if (standalonesSpecifiers.length !== 0) { + parts.push(", "); + } + + const canBreak = groupedSpecifiers.length > 1 || standalonesSpecifiers.length > 0 || node.specifiers.some(node => node.comments); + + if (canBreak) { + parts.push(group$5(concat$9(["{", indent$6(concat$9([options.bracketSpacing ? line$6 : softline$4, join$5(concat$9([",", line$6]), groupedSpecifiers)])), ifBreak$2(shouldPrintComma$2(options) ? "," : ""), options.bracketSpacing ? line$6 : softline$4, "}"]))); + } else { + parts.push(concat$9(["{", options.bracketSpacing ? " " : "", concat$9(groupedSpecifiers), options.bracketSpacing ? " " : "", "}"])); + } + } + } else { + parts.push("{}"); + } + + return concat$9(parts); +} + +var module$2 = { + printModuleSource, + printModuleSpecifiers +}; + +const { + isJSXNode: isJSXNode$2 +} = utils$6; +const { + hasNewlineInRange: hasNewlineInRange$4 +} = util; +const { + builders: { + concat: concat$a, + line: line$7, + softline: softline$5, + group: group$6, + indent: indent$7, + align: align$1, + ifBreak: ifBreak$3, + dedent: dedent$1, + breakParent: breakParent$4 + } +} = document; +/** + * @typedef {import("../../document").Doc} Doc + * @typedef {import("../../common/fast-path")} FastPath + * + * @typedef {any} Options - Prettier options (TBD ...) + * + * @typedef {Object} OperatorOptions + * @property {() => Array} beforeParts - Parts to print before the `?`. + * @property {(breakClosingParen: boolean) => Array} afterParts - Parts to print after the conditional expression. + * @property {boolean} shouldCheckJsx - Whether to check for and print in JSX mode. + * @property {string} conditionalNodeType - The type of the conditional expression node, ie "ConditionalExpression" or "TSConditionalType". + * @property {string} consequentNodePropertyName - The property at which the consequent node can be found on the main node, eg "consequent". + * @property {string} alternateNodePropertyName - The property at which the alternate node can be found on the main node, eg "alternate". + * @property {string[]} testNodePropertyNames - The properties at which the test nodes can be found on the main node, eg "test". + */ +// If we have nested conditional expressions, we want to print them in JSX mode +// if there's at least one JSXElement somewhere in the tree. +// +// A conditional expression chain like this should be printed in normal mode, +// because there aren't JSXElements anywhere in it: +// +// isA ? "A" : isB ? "B" : isC ? "C" : "Unknown"; +// +// But a conditional expression chain like this should be printed in JSX mode, +// because there is a JSXElement in the last ConditionalExpression: +// +// isA ? "A" : isB ? "B" : isC ? "C" : Unknown; +// +// This type of ConditionalExpression chain is structured like this in the AST: +// +// ConditionalExpression { +// test: ..., +// consequent: ..., +// alternate: ConditionalExpression { +// test: ..., +// consequent: ..., +// alternate: ConditionalExpression { +// test: ..., +// consequent: ..., +// alternate: ..., +// } +// } +// } +// +// We want to traverse over that shape and convert it into a flat structure so +// that we can find if there's a JSXElement somewhere inside. + +function getConditionalChainContents(node) { + // Given this code: + // + // // Using a ConditionalExpression as the consequent is uncommon, but should + // // be handled. + // A ? B : C ? D : E ? F ? G : H : I + // + // which has this AST: + // + // ConditionalExpression { + // test: Identifier(A), + // consequent: Identifier(B), + // alternate: ConditionalExpression { + // test: Identifier(C), + // consequent: Identifier(D), + // alternate: ConditionalExpression { + // test: Identifier(E), + // consequent: ConditionalExpression { + // test: Identifier(F), + // consequent: Identifier(G), + // alternate: Identifier(H), + // }, + // alternate: Identifier(I), + // } + // } + // } + // + // we should return this Array: + // + // [ + // Identifier(A), + // Identifier(B), + // Identifier(C), + // Identifier(D), + // Identifier(E), + // Identifier(F), + // Identifier(G), + // Identifier(H), + // Identifier(I) + // ]; + // + // This loses the information about whether each node was the test, + // consequent, or alternate, but we don't care about that here- we are only + // flattening this structure to find if there's any JSXElements inside. + const nonConditionalExpressions = []; + + function recurse(node) { + if (node.type === "ConditionalExpression") { + recurse(node.test); + recurse(node.consequent); + recurse(node.alternate); + } else { + nonConditionalExpressions.push(node); + } + } + + recurse(node); + return nonConditionalExpressions; +} + +function conditionalExpressionChainContainsJSX(node) { + return getConditionalChainContents(node).some(isJSXNode$2); +} +/** + * The following is the shared logic for + * ternary operators, namely ConditionalExpression + * and TSConditionalType + * @param {FastPath} path - The path to the ConditionalExpression/TSConditionalType node. + * @param {Options} options - Prettier options + * @param {Function} print - Print function to call recursively + * @param {OperatorOptions} operatorOptions + * @returns {Doc} + */ + + +function printTernaryOperator(path, options, print, operatorOptions) { + const node = path.getValue(); + const consequentNode = node[operatorOptions.consequentNodePropertyName]; + const alternateNode = node[operatorOptions.alternateNodePropertyName]; + const parts = []; // We print a ConditionalExpression in either "JSX mode" or "normal mode". + // See tests/jsx/conditional-expression.js for more info. + + let jsxMode = false; + const parent = path.getParentNode(); + const isParentTest = parent.type === operatorOptions.conditionalNodeType && operatorOptions.testNodePropertyNames.some(prop => parent[prop] === node); + let forceNoIndent = parent.type === operatorOptions.conditionalNodeType && !isParentTest; // Find the outermost non-ConditionalExpression parent, and the outermost + // ConditionalExpression parent. We'll use these to determine if we should + // print in JSX mode. + + let currentParent; + let previousParent; + let i = 0; + + do { + previousParent = currentParent || node; + currentParent = path.getParentNode(i); + i++; + } while (currentParent && currentParent.type === operatorOptions.conditionalNodeType && operatorOptions.testNodePropertyNames.every(prop => currentParent[prop] !== previousParent)); + + const firstNonConditionalParent = currentParent || parent; + const lastConditionalParent = previousParent; + + if (operatorOptions.shouldCheckJsx && (isJSXNode$2(node[operatorOptions.testNodePropertyNames[0]]) || isJSXNode$2(consequentNode) || isJSXNode$2(alternateNode) || conditionalExpressionChainContainsJSX(lastConditionalParent))) { + jsxMode = true; + forceNoIndent = true; // Even though they don't need parens, we wrap (almost) everything in + // parens when using ?: within JSX, because the parens are analogous to + // curly braces in an if statement. + + const wrap = doc => concat$a([ifBreak$3("(", ""), indent$7(concat$a([softline$5, doc])), softline$5, ifBreak$3(")", "")]); // The only things we don't wrap are: + // * Nested conditional expressions in alternates + // * null + // * undefined + + + const isNil = node => node.type === "NullLiteral" || node.type === "Literal" && node.value === null || node.type === "Identifier" && node.name === "undefined"; + + parts.push(" ? ", isNil(consequentNode) ? path.call(print, operatorOptions.consequentNodePropertyName) : wrap(path.call(print, operatorOptions.consequentNodePropertyName)), " : ", alternateNode.type === operatorOptions.conditionalNodeType || isNil(alternateNode) ? path.call(print, operatorOptions.alternateNodePropertyName) : wrap(path.call(print, operatorOptions.alternateNodePropertyName))); + } else { + // normal mode + const part = concat$a([line$7, "? ", consequentNode.type === operatorOptions.conditionalNodeType ? ifBreak$3("", "(") : "", align$1(2, path.call(print, operatorOptions.consequentNodePropertyName)), consequentNode.type === operatorOptions.conditionalNodeType ? ifBreak$3("", ")") : "", line$7, ": ", alternateNode.type === operatorOptions.conditionalNodeType ? path.call(print, operatorOptions.alternateNodePropertyName) : align$1(2, path.call(print, operatorOptions.alternateNodePropertyName))]); + parts.push(parent.type !== operatorOptions.conditionalNodeType || parent[operatorOptions.alternateNodePropertyName] === node || isParentTest ? part : options.useTabs ? dedent$1(indent$7(part)) : align$1(Math.max(0, options.tabWidth - 2), part)); + } // We want a whole chain of ConditionalExpressions to all + // break if any of them break. That means we should only group around the + // outer-most ConditionalExpression. + + + const comments = flatten_1([...operatorOptions.testNodePropertyNames.map(propertyName => node[propertyName].comments), consequentNode.comments, alternateNode.comments]).filter(Boolean); + const shouldBreak = comments.some(comment => comments$1.isBlockComment(comment) && hasNewlineInRange$4(options.originalText, options.locStart(comment), options.locEnd(comment))); + + const maybeGroup = doc => parent === firstNonConditionalParent ? group$6(doc, { + shouldBreak + }) : shouldBreak ? concat$a([doc, breakParent$4]) : doc; // Break the closing paren to keep the chain right after it: + // (a + // ? b + // : c + // ).call() + + + const breakClosingParen = !jsxMode && (parent.type === "MemberExpression" || parent.type === "OptionalMemberExpression" || parent.type === "NGPipeExpression" && parent.left === node) && !parent.computed; + const result = maybeGroup(concat$a([].concat((testDoc => + /** + * a + * ? b + * : multiline + * test + * node + * ^^ align(2) + * ? d + * : e + */ + parent.type === operatorOptions.conditionalNodeType && parent[operatorOptions.alternateNodePropertyName] === node ? align$1(2, testDoc) : testDoc)(concat$a(operatorOptions.beforeParts())), forceNoIndent ? concat$a(parts) : indent$7(concat$a(parts)), operatorOptions.afterParts(breakClosingParen)))); + return isParentTest ? group$6(concat$a([indent$7(concat$a([softline$5, result])), softline$5])) : result; +} + +var ternary = printTernaryOperator; + +/** @typedef {import("../document").Doc} Doc */ + +/** @type {import("assert")} */ +// TODO(azz): anything that imports from main shouldn't be in a `language-*` dir. + + +const { + getNextNonSpaceNonCommentCharacter: getNextNonSpaceNonCommentCharacter$2, + hasNewline: hasNewline$5, + hasNewlineInRange: hasNewlineInRange$5, + getLast: getLast$5, + getStringWidth: getStringWidth$3, + printString: printString$1, + printNumber: printNumber$1, + hasIgnoreComment: hasIgnoreComment$2, + hasNodeIgnoreComment: hasNodeIgnoreComment$2, + getIndentSize: getIndentSize$2, + getPreferredQuote: getPreferredQuote$1 +} = util; +const { + isNextLineEmpty: isNextLineEmpty$4, + getNextNonSpaceNonCommentCharacterIndex: getNextNonSpaceNonCommentCharacterIndex$4 +} = utilShared; +const { + builders: { + concat: concat$b, + join: join$6, + line: line$8, + hardline: hardline$6, + softline: softline$6, + literalline: literalline$2, + group: group$7, + indent: indent$8, + align: align$2, + conditionalGroup: conditionalGroup$3, + fill: fill$3, + ifBreak: ifBreak$4, + lineSuffixBoundary: lineSuffixBoundary$1, + addAlignmentToDoc: addAlignmentToDoc$2 + }, + utils: { + willBreak: willBreak$3, + isLineNext: isLineNext$1, + isEmpty: isEmpty$1, + removeLines: removeLines$1, + normalizeParts: normalizeParts$1 + }, + printer: { + printDocToString: printDocToString$2 + } +} = document; +const { + insertPragma: insertPragma$1 +} = pragma; +const { + printHtmlBinding: printHtmlBinding$1, + isVueEventBindingExpression: isVueEventBindingExpression$1 +} = htmlBinding; +const { + classChildNeedsASIProtection: classChildNeedsASIProtection$1, + classPropMayCauseASIProblems: classPropMayCauseASIProblems$1, + getFlowVariance: getFlowVariance$1, + getLeftSidePathName: getLeftSidePathName$2, + getParentExportDeclaration: getParentExportDeclaration$1, + getTypeScriptMappedTypeModifier: getTypeScriptMappedTypeModifier$1, + hasDanglingComments: hasDanglingComments$1, + hasFlowAnnotationComment: hasFlowAnnotationComment$1, + hasFlowShorthandAnnotationComment: hasFlowShorthandAnnotationComment$2, + hasLeadingOwnLineComment: hasLeadingOwnLineComment$1, + hasNakedLeftSide: hasNakedLeftSide$2, + hasNewlineBetweenOrAfterDecorators: hasNewlineBetweenOrAfterDecorators$1, + hasNgSideEffect: hasNgSideEffect$1, + hasPrettierIgnore: hasPrettierIgnore$1, + hasTrailingComment: hasTrailingComment$3, + hasTrailingLineComment: hasTrailingLineComment$1, + identity: identity$2, + isBinaryish: isBinaryish$1, + isCallOrOptionalCallExpression: isCallOrOptionalCallExpression$2, + isEmptyJSXElement: isEmptyJSXElement$1, + isExportDeclaration: isExportDeclaration$1, + isFlowAnnotationComment: isFlowAnnotationComment$1, + isFunctionNotation: isFunctionNotation$1, + isGetterOrSetter: isGetterOrSetter$1, + isJestEachTemplateLiteral: isJestEachTemplateLiteral$1, + isJSXNode: isJSXNode$3, + isJSXWhitespaceExpression: isJSXWhitespaceExpression$1, + isLastStatement: isLastStatement$1, + isLiteral: isLiteral$1, + isMeaningfulJSXText: isMeaningfulJSXText$1, + isMemberExpressionChain: isMemberExpressionChain$1, + isMemberish: isMemberish$2, + isNgForOf: isNgForOf$1, + isNumericLiteral: isNumericLiteral$3, + isObjectType: isObjectType$1, + isObjectTypePropertyAFunction: isObjectTypePropertyAFunction$1, + isSimpleFlowType: isSimpleFlowType$1, + isSimpleNumber: isSimpleNumber$1, + isSimpleTemplateLiteral: isSimpleTemplateLiteral$1, + isStringLiteral: isStringLiteral$1, + isStringPropSafeToUnquote: isStringPropSafeToUnquote$1, + isTemplateOnItsOwnLine: isTemplateOnItsOwnLine$1, + isTestCall: isTestCall$1, + isTheOnlyJSXElementInMarkdown: isTheOnlyJSXElementInMarkdown$1, + isTSXFile: isTSXFile$1, + isTypeAnnotationAFunction: isTypeAnnotationAFunction$1, + matchJsxWhitespaceRegex: matchJsxWhitespaceRegex$1, + needsHardlineAfterDanglingComment: needsHardlineAfterDanglingComment$1, + rawText: rawText$1, + returnArgumentHasLeadingComment: returnArgumentHasLeadingComment$1, + shouldPrintComma: shouldPrintComma$3, + shouldFlatten: shouldFlatten$2, + startsWithNoLookaheadToken: startsWithNoLookaheadToken$2 +} = utils$6; +const { + printOptionalToken: printOptionalToken$2, + printFunctionTypeParameters: printFunctionTypeParameters$2, + printMemberLookup: printMemberLookup$2, + printBindExpressionCallee: printBindExpressionCallee$2 +} = misc; +const { + printModuleSource: printModuleSource$1, + printModuleSpecifiers: printModuleSpecifiers$1 +} = module$2; +const needsQuoteProps = new WeakMap(); +let uid = 0; + +function genericPrint(path, options, printPath, args) { + const node = path.getValue(); + let needsParens = false; + const linesWithoutParens = printPathNoParens(path, options, printPath, args); + + if (!node || isEmpty$1(linesWithoutParens)) { + return linesWithoutParens; + } + + const parentExportDecl = getParentExportDeclaration$1(path); + const decorators = []; + + if (node.type === "ClassMethod" || node.type === "ClassPrivateMethod" || node.type === "ClassProperty" || node.type === "TSAbstractClassProperty" || node.type === "ClassPrivateProperty" || node.type === "MethodDefinition" || node.type === "TSAbstractMethodDefinition" || node.type === "TSDeclareMethod") ; else if (node.decorators && node.decorators.length > 0 && // If the parent node is an export declaration and the decorator + // was written before the export, the export will be responsible + // for printing the decorators. + !(parentExportDecl && options.locStart(parentExportDecl, { + ignoreDecorators: true + }) > options.locStart(node.decorators[0]))) { + const shouldBreak = node.type === "ClassExpression" || node.type === "ClassDeclaration" || hasNewlineBetweenOrAfterDecorators$1(node, options); + const separator = shouldBreak ? hardline$6 : line$8; + path.each(decoratorPath => { + let decorator = decoratorPath.getValue(); + + if (decorator.expression) { + decorator = decorator.expression; + } else { + decorator = decorator.callee; + } + + decorators.push(printPath(decoratorPath), separator); + }, "decorators"); + + if (parentExportDecl) { + decorators.unshift(hardline$6); + } + } else if (isExportDeclaration$1(node) && node.declaration && node.declaration.decorators && node.declaration.decorators.length > 0 && // Only print decorators here if they were written before the export, + // otherwise they are printed by the node.declaration + options.locStart(node, { + ignoreDecorators: true + }) > options.locStart(node.declaration.decorators[0])) { + // Export declarations are responsible for printing any decorators + // that logically apply to node.declaration. + path.each(decoratorPath => { + const decorator = decoratorPath.getValue(); + const prefix = decorator.type === "Decorator" ? "" : "@"; + decorators.push(prefix, printPath(decoratorPath), hardline$6); + }, "declaration", "decorators"); + } else { + // Nodes with decorators can't have parentheses, so we can avoid + // computing pathNeedsParens() except in this case. + needsParens = needsParens_1(path, options); + } + + const parts = []; + + if (needsParens) { + parts.unshift("("); + } + + parts.push(linesWithoutParens); + + if (needsParens) { + const node = path.getValue(); + + if (hasFlowShorthandAnnotationComment$2(node)) { + parts.push(" /*"); + parts.push(node.trailingComments[0].value.trimStart()); + parts.push("*/"); + node.trailingComments[0].printed = true; + } + + parts.push(")"); + } + + if (decorators.length > 0) { + return group$7(concat$b(decorators.concat(parts))); + } + + return concat$b(parts); +} + +function printDecorators(path, options, print) { + const node = path.getValue(); + return group$7(concat$b([join$6(line$8, path.map(print, "decorators")), hasNewlineBetweenOrAfterDecorators$1(node, options) ? hardline$6 : line$8])); +} + +function printPathNoParens(path, options, print, args) { + const n = path.getValue(); + const semi = options.semi ? ";" : ""; + + if (!n) { + return ""; + } + + if (typeof n === "string") { + return n; + } + + const htmlBinding = printHtmlBinding$1(path, options, print); + + if (htmlBinding) { + return htmlBinding; + } + /** @type{Doc[]} */ + + + let parts = []; + + switch (n.type) { + case "JsExpressionRoot": + return path.call(print, "node"); + + case "JsonRoot": + return concat$b([path.call(print, "node"), hardline$6]); + + case "File": + // Print @babel/parser's InterpreterDirective here so that + // leading comments on the `Program` node get printed after the hashbang. + if (n.program && n.program.interpreter) { + parts.push(path.call(programPath => programPath.call(print, "interpreter"), "program")); + } + + parts.push(path.call(print, "program")); + return concat$b(parts); + + case "Program": + { + const hasContents = !n.body.every(({ + type + }) => type === "EmptyStatement") || n.comments; // Babel 6 + + if (n.directives) { + const directivesCount = n.directives.length; + path.map((childPath, index) => { + parts.push(print(childPath), semi, hardline$6); + + if ((index < directivesCount - 1 || hasContents) && isNextLineEmpty$4(options.originalText, childPath.getValue(), options.locEnd)) { + parts.push(hardline$6); + } + }, "directives"); + } + + parts.push(path.call(bodyPath => { + return printStatementSequence(bodyPath, options, print); + }, "body")); + parts.push(comments.printDanglingComments(path, options, + /* sameIndent */ + true)); // Only force a trailing newline if there were any contents. + + if (hasContents) { + parts.push(hardline$6); + } + + return concat$b(parts); + } + // Babel extension. + + case "EmptyStatement": + return ""; + + case "ExpressionStatement": + // Detect Flow and TypeScript directives + if (n.directive) { + return concat$b([nodeStr(n.expression, options, true), semi]); + } + + if (options.parser === "__vue_event_binding") { + const parent = path.getParentNode(); + + if (parent.type === "Program" && parent.body.length === 1 && parent.body[0] === n) { + return concat$b([path.call(print, "expression"), isVueEventBindingExpression$1(n.expression) ? ";" : ""]); + } + } // Do not append semicolon after the only JSX element in a program + + + return concat$b([path.call(print, "expression"), isTheOnlyJSXElementInMarkdown$1(options, path) ? "" : semi]); + // Babel non-standard node. Used for Closure-style type casts. See postprocess.js. + + case "ParenthesizedExpression": + { + const shouldHug = !n.expression.comments; + + if (shouldHug) { + return concat$b(["(", path.call(print, "expression"), ")"]); + } + + return group$7(concat$b(["(", indent$8(concat$b([softline$6, path.call(print, "expression")])), softline$6, ")"])); + } + + case "AssignmentExpression": + return printAssignment(n.left, path.call(print, "left"), concat$b([" ", n.operator]), n.right, path.call(print, "right"), options); + + case "BinaryExpression": + case "LogicalExpression": + case "NGPipeExpression": + { + const parent = path.getParentNode(); + const parentParent = path.getParentNode(1); + const isInsideParenthesis = n !== parent.body && (parent.type === "IfStatement" || parent.type === "WhileStatement" || parent.type === "SwitchStatement" || parent.type === "DoWhileStatement"); + const parts = printBinaryishExpressions(path, print, options, + /* isNested */ + false, isInsideParenthesis); // if ( + // this.hasPlugin("dynamicImports") && this.lookahead().type === tt.parenLeft + // ) { + // + // looks super weird, we want to break the children if the parent breaks + // + // if ( + // this.hasPlugin("dynamicImports") && + // this.lookahead().type === tt.parenLeft + // ) { + + if (isInsideParenthesis) { + return concat$b(parts); + } // Break between the parens in + // unaries or in a member or specific call expression, i.e. + // + // ( + // a && + // b && + // c + // ).call() + + + if ((parent.type === "CallExpression" || parent.type === "OptionalCallExpression") && parent.callee === n || parent.type === "UnaryExpression" || (parent.type === "MemberExpression" || parent.type === "OptionalMemberExpression") && !parent.computed) { + return group$7(concat$b([indent$8(concat$b([softline$6, concat$b(parts)])), softline$6])); + } // Avoid indenting sub-expressions in some cases where the first sub-expression is already + // indented accordingly. We should indent sub-expressions where the first case isn't indented. + + + const shouldNotIndent = parent.type === "ReturnStatement" || parent.type === "ThrowStatement" || parent.type === "JSXExpressionContainer" && parentParent.type === "JSXAttribute" || n.operator !== "|" && parent.type === "JsExpressionRoot" || n.type !== "NGPipeExpression" && (parent.type === "NGRoot" && options.parser === "__ng_binding" || parent.type === "NGMicrosyntaxExpression" && parentParent.type === "NGMicrosyntax" && parentParent.body.length === 1) || n === parent.body && parent.type === "ArrowFunctionExpression" || n !== parent.body && parent.type === "ForStatement" || parent.type === "ConditionalExpression" && parentParent.type !== "ReturnStatement" && parentParent.type !== "ThrowStatement" && parentParent.type !== "CallExpression" && parentParent.type !== "OptionalCallExpression" || parent.type === "TemplateLiteral"; + const shouldIndentIfInlining = parent.type === "AssignmentExpression" || parent.type === "VariableDeclarator" || parent.type === "ClassProperty" || parent.type === "TSAbstractClassProperty" || parent.type === "ClassPrivateProperty" || parent.type === "ObjectProperty" || parent.type === "Property"; + const samePrecedenceSubExpression = isBinaryish$1(n.left) && shouldFlatten$2(n.operator, n.left.operator); + + if (shouldNotIndent || shouldInlineLogicalExpression(n) && !samePrecedenceSubExpression || !shouldInlineLogicalExpression(n) && shouldIndentIfInlining) { + return group$7(concat$b(parts)); + } + + if (parts.length === 0) { + return ""; + } // If the right part is a JSX node, we include it in a separate group to + // prevent it breaking the whole chain, so we can print the expression like: + // + // foo && bar && ( + // + // + // + // ) + + + const hasJSX = isJSXNode$3(n.right); + const firstGroupIndex = parts.findIndex(part => typeof part !== "string" && part.type === "group"); // Separate the leftmost expression, possibly with its leading comments. + + const headParts = parts.slice(0, firstGroupIndex === -1 ? 1 : firstGroupIndex + 1); + const rest = concat$b(parts.slice(headParts.length, hasJSX ? -1 : undefined)); + const groupId = Symbol("logicalChain-" + ++uid); + const chain = group$7(concat$b([// Don't include the initial expression in the indentation + // level. The first item is guaranteed to be the first + // left-most expression. + ...headParts, indent$8(rest)]), { + id: groupId + }); + + if (!hasJSX) { + return chain; + } + + const jsxPart = getLast$5(parts); + return group$7(concat$b([chain, ifBreak$4(indent$8(jsxPart), jsxPart, { + groupId + })])); + } + + case "AssignmentPattern": + return concat$b([path.call(print, "left"), " = ", path.call(print, "right")]); + + case "TSTypeAssertion": + { + const shouldBreakAfterCast = !(n.expression.type === "ArrayExpression" || n.expression.type === "ObjectExpression"); + const castGroup = group$7(concat$b(["<", indent$8(concat$b([softline$6, path.call(print, "typeAnnotation")])), softline$6, ">"])); + const exprContents = concat$b([ifBreak$4("("), indent$8(concat$b([softline$6, path.call(print, "expression")])), softline$6, ifBreak$4(")")]); + + if (shouldBreakAfterCast) { + return conditionalGroup$3([concat$b([castGroup, path.call(print, "expression")]), concat$b([castGroup, group$7(exprContents, { + shouldBreak: true + })]), concat$b([castGroup, path.call(print, "expression")])]); + } + + return group$7(concat$b([castGroup, path.call(print, "expression")])); + } + + case "OptionalMemberExpression": + case "MemberExpression": + { + const parent = path.getParentNode(); + let firstNonMemberParent; + let i = 0; + + do { + firstNonMemberParent = path.getParentNode(i); + i++; + } while (firstNonMemberParent && (firstNonMemberParent.type === "MemberExpression" || firstNonMemberParent.type === "OptionalMemberExpression" || firstNonMemberParent.type === "TSNonNullExpression")); + + const shouldInline = firstNonMemberParent && (firstNonMemberParent.type === "NewExpression" || firstNonMemberParent.type === "BindExpression" || firstNonMemberParent.type === "VariableDeclarator" && firstNonMemberParent.id.type !== "Identifier" || firstNonMemberParent.type === "AssignmentExpression" && firstNonMemberParent.left.type !== "Identifier") || n.computed || n.object.type === "Identifier" && n.property.type === "Identifier" && parent.type !== "MemberExpression" && parent.type !== "OptionalMemberExpression"; + return concat$b([path.call(print, "object"), shouldInline ? printMemberLookup$2(path, options, print) : group$7(indent$8(concat$b([softline$6, printMemberLookup$2(path, options, print)])))]); + } + + case "MetaProperty": + return concat$b([path.call(print, "meta"), ".", path.call(print, "property")]); + + case "BindExpression": + if (n.object) { + parts.push(path.call(print, "object")); + } + + parts.push(group$7(indent$8(concat$b([softline$6, printBindExpressionCallee$2(path, options, print)])))); + return concat$b(parts); + + case "Identifier": + { + return concat$b([n.name, printOptionalToken$2(path), printTypeAnnotation(path, options, print)]); + } + + case "V8IntrinsicIdentifier": + return concat$b(["%", n.name]); + + case "SpreadElement": + case "SpreadElementPattern": + case "SpreadProperty": + case "SpreadPropertyPattern": + case "RestElement": + case "ObjectTypeSpreadProperty": + return concat$b(["...", path.call(print, "argument"), printTypeAnnotation(path, options, print)]); + + case "FunctionDeclaration": + case "FunctionExpression": + parts.push(printFunctionDeclaration(path, print, options)); + + if (!n.body) { + parts.push(semi); + } + + return concat$b(parts); + + case "ArrowFunctionExpression": + { + if (n.async) { + parts.push("async "); + } + + if (shouldPrintParamsWithoutParens(path, options)) { + parts.push(path.call(print, "params", 0)); + } else { + parts.push(group$7(concat$b([printFunctionParams(path, print, options, + /* expandLast */ + args && (args.expandLastArg || args.expandFirstArg), + /* printTypeParams */ + true), printReturnType(path, print, options)]))); + } + + const dangling = comments.printDanglingComments(path, options, + /* sameIndent */ + true, comment => { + const nextCharacter = getNextNonSpaceNonCommentCharacterIndex$4(options.originalText, comment, options.locEnd); + return nextCharacter !== false && options.originalText.slice(nextCharacter, nextCharacter + 2) === "=>"; + }); + + if (dangling) { + parts.push(" ", dangling); + } + + parts.push(" =>"); + const body = path.call(bodyPath => print(bodyPath, args), "body"); // We want to always keep these types of nodes on the same line + // as the arrow. + + if (!hasLeadingOwnLineComment$1(options.originalText, n.body, options) && (n.body.type === "ArrayExpression" || n.body.type === "ObjectExpression" || n.body.type === "BlockStatement" || isJSXNode$3(n.body) || isTemplateOnItsOwnLine$1(n.body, options.originalText, options) || n.body.type === "ArrowFunctionExpression" || n.body.type === "DoExpression")) { + return group$7(concat$b([concat$b(parts), " ", body])); + } // We handle sequence expressions as the body of arrows specially, + // so that the required parentheses end up on their own lines. + + + if (n.body.type === "SequenceExpression") { + return group$7(concat$b([concat$b(parts), group$7(concat$b([" (", indent$8(concat$b([softline$6, body])), softline$6, ")"]))])); + } // if the arrow function is expanded as last argument, we are adding a + // level of indentation and need to add a softline to align the closing ) + // with the opening (, or if it's inside a JSXExpression (e.g. an attribute) + // we should align the expression's closing } with the line with the opening {. + + + const shouldAddSoftLine = (args && args.expandLastArg || path.getParentNode().type === "JSXExpressionContainer") && !(n.comments && n.comments.length); + const printTrailingComma = args && args.expandLastArg && shouldPrintComma$3(options, "all"); // In order to avoid confusion between + // a => a ? a : a + // a <= a ? a : a + + const shouldAddParens = n.body.type === "ConditionalExpression" && !startsWithNoLookaheadToken$2(n.body, + /* forbidFunctionAndClass */ + false); + return group$7(concat$b([concat$b(parts), group$7(concat$b([indent$8(concat$b([line$8, shouldAddParens ? ifBreak$4("", "(") : "", body, shouldAddParens ? ifBreak$4("", ")") : ""])), shouldAddSoftLine ? concat$b([ifBreak$4(printTrailingComma ? "," : ""), softline$6]) : ""]))])); + } + + case "YieldExpression": + parts.push("yield"); + + if (n.delegate) { + parts.push("*"); + } + + if (n.argument) { + parts.push(" ", path.call(print, "argument")); + } + + return concat$b(parts); + + case "AwaitExpression": + { + parts.push("await"); + + if (n.argument) { + parts.push(" ", path.call(print, "argument")); + } + + const parent = path.getParentNode(); + + if ((parent.type === "CallExpression" || parent.type === "OptionalCallExpression") && parent.callee === n || (parent.type === "MemberExpression" || parent.type === "OptionalMemberExpression") && parent.object === n) { + return group$7(concat$b([indent$8(concat$b([softline$6, concat$b(parts)])), softline$6])); + } + + return concat$b(parts); + } + + case "ImportSpecifier": + if (n.importKind) { + parts.push(path.call(print, "importKind"), " "); + } + + parts.push(path.call(print, "imported")); + + if (n.local && n.local.name !== n.imported.name) { + parts.push(" as ", path.call(print, "local")); + } + + return concat$b(parts); + + case "ExportSpecifier": + parts.push(path.call(print, "local")); + + if (n.exported && n.exported.name !== n.local.name) { + parts.push(" as ", path.call(print, "exported")); + } + + return concat$b(parts); + + case "ImportNamespaceSpecifier": + parts.push("* as "); + parts.push(path.call(print, "local")); + return concat$b(parts); + + case "ImportDefaultSpecifier": + return path.call(print, "local"); + + case "TSExportAssignment": + return concat$b(["export = ", path.call(print, "expression"), semi]); + + case "ExportDefaultDeclaration": + case "ExportNamedDeclaration": + return printExportDeclaration(path, options, print); + + case "DeclareExportDeclaration": + return concat$b(["declare ", printExportDeclaration(path, options, print)]); + + case "ExportAllDeclaration": + parts.push("export"); + + if (n.exportKind === "type") { + parts.push(" type"); + } + + parts.push(" *"); + + if (n.exported) { + parts.push(" as ", path.call(print, "exported")); + } + + parts.push(printModuleSource$1(path, options, print), semi); + return concat$b(parts); + + case "ExportNamespaceSpecifier": + return concat$b(["* as ", path.call(print, "exported")]); + + case "ExportDefaultSpecifier": + return path.call(print, "exported"); + + case "ImportDeclaration": + { + parts.push("import"); + + if (n.importKind && n.importKind !== "value") { + parts.push(" ", n.importKind); + } + + if (n.specifiers && n.specifiers.length > 0) { + parts.push(printModuleSpecifiers$1(path, options, print)); + parts.push(printModuleSource$1(path, options, print)); + } else if (n.importKind && n.importKind === "type" || // import {} from 'x' + /{\s*}/.test(options.originalText.slice(options.locStart(n), options.locStart(n.source)))) { + parts.push(" {}", printModuleSource$1(path, options, print)); + } else { + parts.push(" ", path.call(print, "source")); + } + + if (Array.isArray(n.attributes) && n.attributes.length !== 0) { + parts.push(" with ", concat$b(path.map(print, "attributes"))); + } + + parts.push(semi); + return concat$b(parts); + } + + case "ImportAttribute": + return concat$b([path.call(print, "key"), ": ", path.call(print, "value")]); + + case "Import": + return "import"; + + case "TSModuleBlock": + case "BlockStatement": + { + const naked = path.call(bodyPath => { + return printStatementSequence(bodyPath, options, print); + }, "body"); + const hasContent = n.body.some(node => node.type !== "EmptyStatement"); + const hasDirectives = n.directives && n.directives.length > 0; + const parent = path.getParentNode(); + const parentParent = path.getParentNode(1); + + if (!hasContent && !hasDirectives && !hasDanglingComments$1(n) && (parent.type === "ArrowFunctionExpression" || parent.type === "FunctionExpression" || parent.type === "FunctionDeclaration" || parent.type === "ObjectMethod" || parent.type === "ClassMethod" || parent.type === "ClassPrivateMethod" || parent.type === "ForStatement" || parent.type === "WhileStatement" || parent.type === "DoWhileStatement" || parent.type === "DoExpression" || parent.type === "CatchClause" && !parentParent.finalizer || parent.type === "TSModuleDeclaration")) { + return "{}"; + } + + parts.push("{"); // Babel 6 + + if (hasDirectives) { + path.each(childPath => { + parts.push(indent$8(concat$b([hardline$6, print(childPath), semi]))); + + if (isNextLineEmpty$4(options.originalText, childPath.getValue(), options.locEnd)) { + parts.push(hardline$6); + } + }, "directives"); + } + + if (hasContent) { + parts.push(indent$8(concat$b([hardline$6, naked]))); + } + + parts.push(comments.printDanglingComments(path, options)); + parts.push(hardline$6, "}"); + return concat$b(parts); + } + + case "ReturnStatement": + return concat$b(["return", printReturnAndThrowArgument(path, options, print)]); + + case "NewExpression": + case "ImportExpression": + case "OptionalCallExpression": + case "CallExpression": + { + const isNew = n.type === "NewExpression"; + const isDynamicImport = n.type === "ImportExpression"; + const optional = printOptionalToken$2(path); + const args = isDynamicImport ? [n.source] : n.arguments; + + if ( // We want to keep CommonJS- and AMD-style require calls, and AMD-style + // define calls, as a unit. + // e.g. `define(["some/lib", (lib) => {` + !isDynamicImport && !isNew && n.callee.type === "Identifier" && (n.callee.name === "require" || n.callee.name === "define") || // Template literals as single arguments + args.length === 1 && isTemplateOnItsOwnLine$1(args[0], options.originalText, options) || // Keep test declarations on a single line + // e.g. `it('long name', () => {` + !isNew && isTestCall$1(n, path.getParentNode())) { + return concat$b([isNew ? "new " : "", path.call(print, "callee"), optional, printFunctionTypeParameters$2(path, options, print), concat$b(["(", isDynamicImport ? path.call(print, "source") : join$6(", ", path.map(print, "arguments")), ")"])]); + } // Inline Flow annotation comments following Identifiers in Call nodes need to + // stay with the Identifier. For example: + // + // foo /*:: */(bar); + // + // Here, we ensure that such comments stay between the Identifier and the Callee. + + + const isIdentifierWithFlowAnnotation = n.callee && n.callee.type === "Identifier" && hasFlowAnnotationComment$1(n.callee.trailingComments); + + if (isIdentifierWithFlowAnnotation) { + n.callee.trailingComments[0].printed = true; + } // We detect calls on member lookups and possibly print them in a + // special chain format. See `printMemberChain` for more info. + + + if (!isDynamicImport && !isNew && isMemberish$2(n.callee) && !path.call(path => needsParens_1(path, options), "callee")) { + return memberChain(path, options, print); + } + + const contents = concat$b([isNew ? "new " : "", isDynamicImport ? "import" : path.call(print, "callee"), optional, isIdentifierWithFlowAnnotation ? `/*:: ${n.callee.trailingComments[0].value.slice(2).trim()} */` : "", printFunctionTypeParameters$2(path, options, print), callArguments(path, options, print)]); // We group here when the callee is itself a call expression. + // See `isLongCurriedCallExpression` for more info. + + if (isDynamicImport || isCallOrOptionalCallExpression$2(n.callee)) { + return group$7(contents); + } + + return contents; + } + + case "ObjectTypeInternalSlot": + return concat$b([n.static ? "static " : "", "[[", path.call(print, "id"), "]]", printOptionalToken$2(path), n.method ? "" : ": ", path.call(print, "value")]); + + case "ObjectExpression": + case "ObjectPattern": + case "ObjectTypeAnnotation": + case "TSInterfaceBody": + case "TSTypeLiteral": + case "RecordExpression": + { + let propertiesField; + + if (n.type === "TSTypeLiteral") { + propertiesField = "members"; + } else if (n.type === "TSInterfaceBody") { + propertiesField = "body"; + } else { + propertiesField = "properties"; + } + + const isTypeAnnotation = n.type === "ObjectTypeAnnotation"; + const fields = []; + + if (isTypeAnnotation) { + fields.push("indexers", "callProperties", "internalSlots"); + } + + fields.push(propertiesField); + const firstProperty = fields.map(field => n[field][0]).sort((a, b) => options.locStart(a) - options.locStart(b))[0]; + const parent = path.getParentNode(0); + const isFlowInterfaceLikeBody = isTypeAnnotation && parent && (parent.type === "InterfaceDeclaration" || parent.type === "DeclareInterface" || parent.type === "DeclareClass") && path.getName() === "body"; + const shouldBreak = n.type === "TSInterfaceBody" || isFlowInterfaceLikeBody || n.type === "ObjectPattern" && parent.type !== "FunctionDeclaration" && parent.type !== "FunctionExpression" && parent.type !== "ArrowFunctionExpression" && parent.type !== "ObjectMethod" && parent.type !== "ClassMethod" && parent.type !== "ClassPrivateMethod" && parent.type !== "AssignmentPattern" && parent.type !== "CatchClause" && n.properties.some(property => property.value && (property.value.type === "ObjectPattern" || property.value.type === "ArrayPattern")) || n.type !== "ObjectPattern" && firstProperty && hasNewlineInRange$5(options.originalText, options.locStart(n), options.locStart(firstProperty)); + const separator = isFlowInterfaceLikeBody ? ";" : n.type === "TSInterfaceBody" || n.type === "TSTypeLiteral" ? ifBreak$4(semi, ";") : ","; + const leftBrace = n.type === "RecordExpression" ? "#{" : n.exact ? "{|" : "{"; + const rightBrace = n.exact ? "|}" : "}"; // Unfortunately, things are grouped together in the ast can be + // interleaved in the source code. So we need to reorder them before + // printing them. + + const propsAndLoc = []; + fields.forEach(field => { + path.each(childPath => { + const node = childPath.getValue(); + propsAndLoc.push({ + node, + printed: print(childPath), + loc: options.locStart(node) + }); + }, field); + }); + let separatorParts = []; + const props = propsAndLoc.sort((a, b) => a.loc - b.loc).map(prop => { + const result = concat$b(separatorParts.concat(group$7(prop.printed))); + separatorParts = [separator, line$8]; + + if ((prop.node.type === "TSPropertySignature" || prop.node.type === "TSMethodSignature" || prop.node.type === "TSConstructSignatureDeclaration") && hasNodeIgnoreComment$2(prop.node)) { + separatorParts.shift(); + } + + if (isNextLineEmpty$4(options.originalText, prop.node, options.locEnd)) { + separatorParts.push(hardline$6); + } + + return result; + }); + + if (n.inexact) { + let printed; + + if (hasDanglingComments$1(n)) { + const hasLineComments = !n.comments.every(comments$1.isBlockComment); + const printedDanglingComments = comments.printDanglingComments(path, options, + /* sameIndent */ + true); + printed = concat$b([printedDanglingComments, hasLineComments || hasNewline$5(options.originalText, options.locEnd(n.comments[n.comments.length - 1])) ? hardline$6 : line$8, "..."]); + } else { + printed = "..."; + } + + props.push(concat$b(separatorParts.concat(printed))); + } + + const lastElem = getLast$5(n[propertiesField]); + const canHaveTrailingSeparator = !(n.inexact || lastElem && lastElem.type === "RestElement"); + let content; + + if (props.length === 0) { + if (!hasDanglingComments$1(n)) { + return concat$b([leftBrace, rightBrace, printTypeAnnotation(path, options, print)]); + } + + content = group$7(concat$b([leftBrace, comments.printDanglingComments(path, options), softline$6, rightBrace, printOptionalToken$2(path), printTypeAnnotation(path, options, print)])); + } else { + content = concat$b([leftBrace, indent$8(concat$b([options.bracketSpacing ? line$8 : softline$6, concat$b(props)])), ifBreak$4(canHaveTrailingSeparator && (separator !== "," || shouldPrintComma$3(options)) ? separator : ""), concat$b([options.bracketSpacing ? line$8 : softline$6, rightBrace]), printOptionalToken$2(path), printTypeAnnotation(path, options, print)]); + } // If we inline the object as first argument of the parent, we don't want + // to create another group so that the object breaks before the return + // type + + + if (path.match(node => node.type === "ObjectPattern" && !node.decorators, (node, name, number) => shouldHugArguments(node) && (name === "params" || name === "parameters") && number === 0) || path.match(shouldHugType, (node, name) => name === "typeAnnotation", (node, name) => name === "typeAnnotation", (node, name, number) => shouldHugArguments(node) && (name === "params" || name === "parameters") && number === 0)) { + return content; + } + + return group$7(content, { + shouldBreak + }); + } + // Babel 6 + + case "ObjectProperty": // Non-standard AST node type. + + case "Property": + if (n.method || n.kind === "get" || n.kind === "set") { + return printMethod(path, options, print); + } + + if (n.shorthand) { + parts.push(path.call(print, "value")); + } else { + parts.push(printAssignment(n.key, printPropertyKey(path, options, print), ":", n.value, path.call(print, "value"), options)); + } + + return concat$b(parts); + // Babel 6 + + case "ClassMethod": + case "ClassPrivateMethod": + case "MethodDefinition": + case "TSAbstractMethodDefinition": + case "TSDeclareMethod": + if (n.decorators && n.decorators.length !== 0) { + parts.push(printDecorators(path, options, print)); + } + + if (n.accessibility) { + parts.push(n.accessibility + " "); + } + + if (n.static) { + parts.push("static "); + } + + if (n.type === "TSAbstractMethodDefinition" || n.abstract) { + parts.push("abstract "); + } + + parts.push(printMethod(path, options, print)); + return concat$b(parts); + + case "ObjectMethod": + return printMethod(path, options, print); + + case "Decorator": + return concat$b(["@", path.call(print, "expression"), path.call(print, "callee")]); + + case "ArrayExpression": + case "ArrayPattern": + case "TupleExpression": + { + const openBracket = n.type === "TupleExpression" ? "#[" : "["; + const closeBracket = "]"; + + if (n.elements.length === 0) { + if (!hasDanglingComments$1(n)) { + parts.push(openBracket, closeBracket); + } else { + parts.push(group$7(concat$b([openBracket, comments.printDanglingComments(path, options), softline$6, closeBracket]))); + } + } else { + const lastElem = getLast$5(n.elements); + const canHaveTrailingComma = !(lastElem && lastElem.type === "RestElement"); // JavaScript allows you to have empty elements in an array which + // changes its length based on the number of commas. The algorithm + // is that if the last argument is null, we need to force insert + // a comma to ensure JavaScript recognizes it. + // [,].length === 1 + // [1,].length === 1 + // [1,,].length === 2 + // + // Note that getLast returns null if the array is empty, but + // we already check for an empty array just above so we are safe + + const needsForcedTrailingComma = canHaveTrailingComma && lastElem === null; + const shouldBreak = !options.__inJestEach && n.elements.length > 1 && n.elements.every((element, i, elements) => { + const elementType = element && element.type; + + if (elementType !== "ArrayExpression" && elementType !== "ObjectExpression") { + return false; + } + + const nextElement = elements[i + 1]; + + if (nextElement && elementType !== nextElement.type) { + return false; + } + + const itemsKey = elementType === "ArrayExpression" ? "elements" : "properties"; + return element[itemsKey] && element[itemsKey].length > 1; + }); + parts.push(group$7(concat$b([openBracket, indent$8(concat$b([softline$6, printArrayItems(path, options, "elements", print)])), needsForcedTrailingComma ? "," : "", ifBreak$4(canHaveTrailingComma && !needsForcedTrailingComma && shouldPrintComma$3(options) ? "," : ""), comments.printDanglingComments(path, options, + /* sameIndent */ + true), softline$6, closeBracket]), { + shouldBreak + })); + } + + parts.push(printOptionalToken$2(path), printTypeAnnotation(path, options, print)); + return concat$b(parts); + } + + case "SequenceExpression": + { + const parent = path.getParentNode(0); + + if (parent.type === "ExpressionStatement" || parent.type === "ForStatement") { + // For ExpressionStatements and for-loop heads, which are among + // the few places a SequenceExpression appears unparenthesized, we want + // to indent expressions after the first. + const parts = []; + path.each(p => { + if (p.getName() === 0) { + parts.push(print(p)); + } else { + parts.push(",", indent$8(concat$b([line$8, print(p)]))); + } + }, "expressions"); + return group$7(concat$b(parts)); + } + + return group$7(concat$b([join$6(concat$b([",", line$8]), path.map(print, "expressions"))])); + } + + case "ThisExpression": + return "this"; + + case "Super": + return "super"; + + case "NullLiteral": + // Babel 6 Literal split + return "null"; + + case "RegExpLiteral": + // Babel 6 Literal split + return printRegex(n); + + case "NumericLiteral": + // Babel 6 Literal split + return printNumber$1(n.extra.raw); + + case "DecimalLiteral": + return printNumber$1(n.value) + "m"; + + case "BigIntLiteral": + // babel: n.extra.raw, flow: n.bigint + return (n.bigint || n.extra.raw).toLowerCase(); + + case "BooleanLiteral": // Babel 6 Literal split + + case "StringLiteral": // Babel 6 Literal split + + case "Literal": + if (n.regex) { + return printRegex(n.regex); + } // typescript + + + if (n.bigint) { + return n.raw.toLowerCase(); + } + + if (typeof n.value === "number") { + return printNumber$1(n.raw); + } + + if (typeof n.value !== "string") { + return "" + n.value; + } + + return nodeStr(n, options); + + case "Directive": + return path.call(print, "value"); + // Babel 6 + + case "DirectiveLiteral": + return nodeStr(n, options); + + case "UnaryExpression": + parts.push(n.operator); + + if (/[a-z]$/.test(n.operator)) { + parts.push(" "); + } + + if (n.argument.comments && n.argument.comments.length > 0) { + parts.push(group$7(concat$b(["(", indent$8(concat$b([softline$6, path.call(print, "argument")])), softline$6, ")"]))); + } else { + parts.push(path.call(print, "argument")); + } + + return concat$b(parts); + + case "UpdateExpression": + parts.push(path.call(print, "argument"), n.operator); + + if (n.prefix) { + parts.reverse(); + } + + return concat$b(parts); + + case "ConditionalExpression": + return ternary(path, options, print, { + beforeParts: () => [path.call(print, "test")], + afterParts: breakClosingParen => [breakClosingParen ? softline$6 : ""], + shouldCheckJsx: true, + conditionalNodeType: "ConditionalExpression", + consequentNodePropertyName: "consequent", + alternateNodePropertyName: "alternate", + testNodePropertyNames: ["test"] + }); + + case "VariableDeclaration": + { + const printed = path.map(childPath => { + return print(childPath); + }, "declarations"); // We generally want to terminate all variable declarations with a + // semicolon, except when they in the () part of for loops. + + const parentNode = path.getParentNode(); + const isParentForLoop = parentNode.type === "ForStatement" || parentNode.type === "ForInStatement" || parentNode.type === "ForOfStatement"; + const hasValue = n.declarations.some(decl => decl.init); + let firstVariable; + + if (printed.length === 1 && !n.declarations[0].comments) { + firstVariable = printed[0]; + } else if (printed.length > 0) { + // Indent first var to comply with eslint one-var rule + firstVariable = indent$8(printed[0]); + } + + parts = [n.declare ? "declare " : "", n.kind, firstVariable ? concat$b([" ", firstVariable]) : "", indent$8(concat$b(printed.slice(1).map(p => concat$b([",", hasValue && !isParentForLoop ? hardline$6 : line$8, p]))))]; + + if (!(isParentForLoop && parentNode.body !== n)) { + parts.push(semi); + } + + return group$7(concat$b(parts)); + } + + case "TSTypeAliasDeclaration": + { + if (n.declare) { + parts.push("declare "); + } + + const printed = printAssignmentRight(n.id, n.typeAnnotation, n.typeAnnotation && path.call(print, "typeAnnotation"), options); + parts.push("type ", path.call(print, "id"), path.call(print, "typeParameters"), " =", printed, semi); + return group$7(concat$b(parts)); + } + + case "VariableDeclarator": + return printAssignment(n.id, path.call(print, "id"), " =", n.init, n.init && path.call(print, "init"), options); + + case "WithStatement": + return group$7(concat$b(["with (", path.call(print, "object"), ")", adjustClause(n.body, path.call(print, "body"))])); + + case "IfStatement": + { + const con = adjustClause(n.consequent, path.call(print, "consequent")); + const opening = group$7(concat$b(["if (", group$7(concat$b([indent$8(concat$b([softline$6, path.call(print, "test")])), softline$6])), ")", con])); + parts.push(opening); + + if (n.alternate) { + const commentOnOwnLine = hasTrailingComment$3(n.consequent) && n.consequent.comments.some(comment => comment.trailing && !comments$1.isBlockComment(comment)) || needsHardlineAfterDanglingComment$1(n); + const elseOnSameLine = n.consequent.type === "BlockStatement" && !commentOnOwnLine; + parts.push(elseOnSameLine ? " " : hardline$6); + + if (hasDanglingComments$1(n)) { + parts.push(comments.printDanglingComments(path, options, true), commentOnOwnLine ? hardline$6 : " "); + } + + parts.push("else", group$7(adjustClause(n.alternate, path.call(print, "alternate"), n.alternate.type === "IfStatement"))); + } + + return concat$b(parts); + } + + case "ForStatement": + { + const body = adjustClause(n.body, path.call(print, "body")); // We want to keep dangling comments above the loop to stay consistent. + // Any comment positioned between the for statement and the parentheses + // is going to be printed before the statement. + + const dangling = comments.printDanglingComments(path, options, + /* sameLine */ + true); + const printedComments = dangling ? concat$b([dangling, softline$6]) : ""; + + if (!n.init && !n.test && !n.update) { + return concat$b([printedComments, group$7(concat$b(["for (;;)", body]))]); + } + + return concat$b([printedComments, group$7(concat$b(["for (", group$7(concat$b([indent$8(concat$b([softline$6, path.call(print, "init"), ";", line$8, path.call(print, "test"), ";", line$8, path.call(print, "update")])), softline$6])), ")", body]))]); + } + + case "WhileStatement": + return group$7(concat$b(["while (", group$7(concat$b([indent$8(concat$b([softline$6, path.call(print, "test")])), softline$6])), ")", adjustClause(n.body, path.call(print, "body"))])); + + case "ForInStatement": + // Note: esprima can't actually parse "for each (". + return group$7(concat$b([n.each ? "for each (" : "for (", path.call(print, "left"), " in ", path.call(print, "right"), ")", adjustClause(n.body, path.call(print, "body"))])); + + case "ForOfStatement": + return group$7(concat$b(["for", n.await ? " await" : "", " (", path.call(print, "left"), " of ", path.call(print, "right"), ")", adjustClause(n.body, path.call(print, "body"))])); + + case "DoWhileStatement": + { + const clause = adjustClause(n.body, path.call(print, "body")); + const doBody = group$7(concat$b(["do", clause])); + parts = [doBody]; + + if (n.body.type === "BlockStatement") { + parts.push(" "); + } else { + parts.push(hardline$6); + } + + parts.push("while ("); + parts.push(group$7(concat$b([indent$8(concat$b([softline$6, path.call(print, "test")])), softline$6])), ")", semi); + return concat$b(parts); + } + + case "DoExpression": + return concat$b(["do ", path.call(print, "body")]); + + case "BreakStatement": + parts.push("break"); + + if (n.label) { + parts.push(" ", path.call(print, "label")); + } + + parts.push(semi); + return concat$b(parts); + + case "ContinueStatement": + parts.push("continue"); + + if (n.label) { + parts.push(" ", path.call(print, "label")); + } + + parts.push(semi); + return concat$b(parts); + + case "LabeledStatement": + if (n.body.type === "EmptyStatement") { + return concat$b([path.call(print, "label"), ":;"]); + } + + return concat$b([path.call(print, "label"), ": ", path.call(print, "body")]); + + case "TryStatement": + return concat$b(["try ", path.call(print, "block"), n.handler ? concat$b([" ", path.call(print, "handler")]) : "", n.finalizer ? concat$b([" finally ", path.call(print, "finalizer")]) : ""]); + + case "CatchClause": + if (n.param) { + const hasComments = n.param.comments && n.param.comments.some(comment => !comments$1.isBlockComment(comment) || comment.leading && hasNewline$5(options.originalText, options.locEnd(comment)) || comment.trailing && hasNewline$5(options.originalText, options.locStart(comment), { + backwards: true + })); + const param = path.call(print, "param"); + return concat$b(["catch ", hasComments ? concat$b(["(", indent$8(concat$b([softline$6, param])), softline$6, ") "]) : concat$b(["(", param, ") "]), path.call(print, "body")]); + } + + return concat$b(["catch ", path.call(print, "body")]); + + case "ThrowStatement": + return concat$b(["throw", printReturnAndThrowArgument(path, options, print)]); + // Note: ignoring n.lexical because it has no printing consequences. + + case "SwitchStatement": + return concat$b([group$7(concat$b(["switch (", indent$8(concat$b([softline$6, path.call(print, "discriminant")])), softline$6, ")"])), " {", n.cases.length > 0 ? indent$8(concat$b([hardline$6, join$6(hardline$6, path.map(casePath => { + const caseNode = casePath.getValue(); + return concat$b([casePath.call(print), n.cases.indexOf(caseNode) !== n.cases.length - 1 && isNextLineEmpty$4(options.originalText, caseNode, options.locEnd) ? hardline$6 : ""]); + }, "cases"))])) : "", hardline$6, "}"]); + + case "SwitchCase": + { + if (n.test) { + parts.push("case ", path.call(print, "test"), ":"); + } else { + parts.push("default:"); + } + + const consequent = n.consequent.filter(node => node.type !== "EmptyStatement"); + + if (consequent.length > 0) { + const cons = path.call(consequentPath => { + return printStatementSequence(consequentPath, options, print); + }, "consequent"); + parts.push(consequent.length === 1 && consequent[0].type === "BlockStatement" ? concat$b([" ", cons]) : indent$8(concat$b([hardline$6, cons]))); + } + + return concat$b(parts); + } + // JSX extensions below. + + case "DebuggerStatement": + return concat$b(["debugger", semi]); + + case "JSXAttribute": + parts.push(path.call(print, "name")); + + if (n.value) { + let res; + + if (isStringLiteral$1(n.value)) { + const raw = rawText$1(n.value); // Unescape all quotes so we get an accurate preferred quote + + let final = raw.replace(/'/g, "'").replace(/"/g, '"'); + const quote = getPreferredQuote$1(final, options.jsxSingleQuote ? "'" : '"'); + const escape = quote === "'" ? "'" : """; + final = final.slice(1, -1).replace(new RegExp(quote, "g"), escape); + res = concat$b([quote, final, quote]); + } else { + res = path.call(print, "value"); + } + + parts.push("=", res); + } + + return concat$b(parts); + + case "JSXIdentifier": + return "" + n.name; + + case "JSXNamespacedName": + return join$6(":", [path.call(print, "namespace"), path.call(print, "name")]); + + case "JSXMemberExpression": + return join$6(".", [path.call(print, "object"), path.call(print, "property")]); + + case "TSQualifiedName": + return join$6(".", [path.call(print, "left"), path.call(print, "right")]); + + case "JSXSpreadAttribute": + case "JSXSpreadChild": + { + return concat$b(["{", path.call(p => { + const printed = concat$b(["...", print(p)]); + const n = p.getValue(); + + if (!n.comments || !n.comments.length || !willPrintOwnComments(p)) { + return printed; + } + + return concat$b([indent$8(concat$b([softline$6, comments.printComments(p, () => printed, options)])), softline$6]); + }, n.type === "JSXSpreadAttribute" ? "argument" : "expression"), "}"]); + } + + case "JSXExpressionContainer": + { + const parent = path.getParentNode(0); + const hasComments = n.expression.comments && n.expression.comments.length > 0; + const shouldInline = n.expression.type === "JSXEmptyExpression" || !hasComments && (n.expression.type === "ArrayExpression" || n.expression.type === "ObjectExpression" || n.expression.type === "ArrowFunctionExpression" || n.expression.type === "CallExpression" || n.expression.type === "OptionalCallExpression" || n.expression.type === "FunctionExpression" || n.expression.type === "TemplateLiteral" || n.expression.type === "TaggedTemplateExpression" || n.expression.type === "DoExpression" || isJSXNode$3(parent) && (n.expression.type === "ConditionalExpression" || isBinaryish$1(n.expression))); + + if (shouldInline) { + return group$7(concat$b(["{", path.call(print, "expression"), lineSuffixBoundary$1, "}"])); + } + + return group$7(concat$b(["{", indent$8(concat$b([softline$6, path.call(print, "expression")])), softline$6, lineSuffixBoundary$1, "}"])); + } + + case "JSXFragment": + case "JSXElement": + { + const elem = comments.printComments(path, () => printJSXElement(path, options, print), options); + return maybeWrapJSXElementInParens(path, elem, options); + } + + case "JSXOpeningElement": + { + const n = path.getValue(); + const nameHasComments = n.name && n.name.comments && n.name.comments.length > 0 || n.typeParameters && n.typeParameters.comments && n.typeParameters.comments.length > 0; // Don't break self-closing elements with no attributes and no comments + + if (n.selfClosing && !n.attributes.length && !nameHasComments) { + return concat$b(["<", path.call(print, "name"), path.call(print, "typeParameters"), " />"]); + } // don't break up opening elements with a single long text attribute + + + if (n.attributes && n.attributes.length === 1 && n.attributes[0].value && isStringLiteral$1(n.attributes[0].value) && !n.attributes[0].value.value.includes("\n") && // We should break for the following cases: + //
+ //
+ !nameHasComments && (!n.attributes[0].comments || !n.attributes[0].comments.length)) { + return group$7(concat$b(["<", path.call(print, "name"), path.call(print, "typeParameters"), " ", concat$b(path.map(print, "attributes")), n.selfClosing ? " />" : ">"])); + } + + const lastAttrHasTrailingComments = n.attributes.length && hasTrailingComment$3(getLast$5(n.attributes)); + const bracketSameLine = // Simple tags (no attributes and no comment in tag name) should be + // kept unbroken regardless of `jsxBracketSameLine` + !n.attributes.length && !nameHasComments || options.jsxBracketSameLine && ( // We should print the bracket in a new line for the following cases: + //
+ //
+ !nameHasComments || n.attributes.length) && !lastAttrHasTrailingComments; // We should print the opening element expanded if any prop value is a + // string literal with newlines + + const shouldBreak = n.attributes && n.attributes.some(attr => attr.value && isStringLiteral$1(attr.value) && attr.value.value.includes("\n")); + return group$7(concat$b(["<", path.call(print, "name"), path.call(print, "typeParameters"), concat$b([indent$8(concat$b(path.map(attr => concat$b([line$8, print(attr)]), "attributes"))), n.selfClosing ? line$8 : bracketSameLine ? ">" : softline$6]), n.selfClosing ? "/>" : bracketSameLine ? "" : ">"]), { + shouldBreak + }); + } + + case "JSXClosingElement": + return concat$b([""]); + + case "JSXOpeningFragment": + case "JSXClosingFragment": + { + const hasComment = n.comments && n.comments.length; + const hasOwnLineComment = hasComment && !n.comments.every(comments$1.isBlockComment); + const isOpeningFragment = n.type === "JSXOpeningFragment"; + return concat$b([isOpeningFragment ? "<" : ""]); + } + + case "JSXText": + /* istanbul ignore next */ + throw new Error("JSXTest should be handled by JSXElement"); + + case "JSXEmptyExpression": + { + const requiresHardline = n.comments && !n.comments.every(comments$1.isBlockComment); + return concat$b([comments.printDanglingComments(path, options, + /* sameIndent */ + !requiresHardline), requiresHardline ? hardline$6 : ""]); + } + + case "ClassBody": + if (!n.comments && n.body.length === 0) { + return "{}"; + } + + return concat$b(["{", n.body.length > 0 ? indent$8(concat$b([hardline$6, path.call(bodyPath => { + return printStatementSequence(bodyPath, options, print); + }, "body")])) : comments.printDanglingComments(path, options), hardline$6, "}"]); + + case "ClassProperty": + case "TSAbstractClassProperty": + case "ClassPrivateProperty": + { + if (n.decorators && n.decorators.length !== 0) { + parts.push(printDecorators(path, options, print)); + } + + if (n.accessibility) { + parts.push(n.accessibility + " "); + } + + if (n.declare) { + parts.push("declare "); + } + + if (n.static) { + parts.push("static "); + } + + if (n.type === "TSAbstractClassProperty" || n.abstract) { + parts.push("abstract "); + } + + if (n.readonly) { + parts.push("readonly "); + } + + const variance = getFlowVariance$1(n); + + if (variance) { + parts.push(variance); + } + + parts.push(printPropertyKey(path, options, print), printOptionalToken$2(path), printTypeAnnotation(path, options, print)); + + if (n.value) { + parts.push(" =", printAssignmentRight(n.key, n.value, path.call(print, "value"), options)); + } + + parts.push(semi); + return group$7(concat$b(parts)); + } + + case "ClassDeclaration": + case "ClassExpression": + if (n.declare) { + parts.push("declare "); + } + + parts.push(concat$b(printClass(path, options, print))); + return concat$b(parts); + + case "TSInterfaceHeritage": + case "TSExpressionWithTypeArguments": + // Babel AST + parts.push(path.call(print, "expression")); + + if (n.typeParameters) { + parts.push(path.call(print, "typeParameters")); + } + + return concat$b(parts); + + case "TemplateElement": + return join$6(literalline$2, n.value.raw.split(/\r?\n/g)); + + case "TemplateLiteral": + { + const parentNode = path.getParentNode(); + + if (isJestEachTemplateLiteral$1(n, parentNode)) { + const printed = printJestEachTemplateLiteral(path, options, print); + + if (printed) { + return printed; + } + } + + let expressions = path.map(print, "expressions"); + const isSimple = isSimpleTemplateLiteral$1(n); + + if (isSimple) { + expressions = expressions.map(doc => printDocToString$2(doc, Object.assign({}, options, { + printWidth: Infinity + })).formatted); + } + + parts.push(lineSuffixBoundary$1, "`"); + path.each(childPath => { + const i = childPath.getName(); + parts.push(print(childPath)); + + if (i < expressions.length) { + // For a template literal of the following form: + // `someQuery { + // ${call({ + // a, + // b, + // })} + // }` + // the expression is on its own line (there is a \n in the previous + // quasi literal), therefore we want to indent the JavaScript + // expression inside at the beginning of ${ instead of the beginning + // of the `. + const { + tabWidth + } = options; + const quasi = childPath.getValue(); + const indentSize = getIndentSize$2(quasi.value.raw, tabWidth); + let printed = expressions[i]; + + if (!isSimple) { + // Breaks at the template element boundaries (${ and }) are preferred to breaking + // in the middle of a MemberExpression + if (n.expressions[i].comments && n.expressions[i].comments.length || n.expressions[i].type === "MemberExpression" || n.expressions[i].type === "OptionalMemberExpression" || n.expressions[i].type === "ConditionalExpression" || n.expressions[i].type === "SequenceExpression" || n.expressions[i].type === "TSAsExpression" || isBinaryish$1(n.expressions[i])) { + printed = concat$b([indent$8(concat$b([softline$6, printed])), softline$6]); + } + } + + const aligned = indentSize === 0 && quasi.value.raw.endsWith("\n") ? align$2(-Infinity, printed) : addAlignmentToDoc$2(printed, indentSize, tabWidth); + parts.push(group$7(concat$b(["${", aligned, lineSuffixBoundary$1, "}"]))); + } + }, "quasis"); + parts.push("`"); + return concat$b(parts); + } + + case "TaggedTemplateExpression": + return concat$b([path.call(print, "tag"), path.call(print, "typeParameters"), path.call(print, "quasi")]); + // These types are unprintable because they serve as abstract + // supertypes for other (printable) types. + + case "Node": + case "Printable": + case "SourceLocation": + case "Position": + case "Statement": + case "Function": + case "Pattern": + case "Expression": + case "Declaration": + case "Specifier": + case "NamedSpecifier": + case "Comment": + case "MemberTypeAnnotation": // Flow + + case "Type": + /* istanbul ignore next */ + throw new Error("unprintable type: " + JSON.stringify(n.type)); + // Type Annotations for Facebook Flow, typically stripped out or + // transformed away before printing. + + case "TypeAnnotation": + case "TSTypeAnnotation": + if (n.typeAnnotation) { + return path.call(print, "typeAnnotation"); + } + /* istanbul ignore next */ + + + return ""; + + case "TSNamedTupleMember": + return concat$b([path.call(print, "label"), n.optional ? "?" : "", ": ", path.call(print, "elementType")]); + + case "TSTupleType": + case "TupleTypeAnnotation": + { + const typesField = n.type === "TSTupleType" ? "elementTypes" : "types"; + const hasRest = n[typesField].length > 0 && getLast$5(n[typesField]).type === "TSRestType"; + return group$7(concat$b(["[", indent$8(concat$b([softline$6, printArrayItems(path, options, typesField, print)])), ifBreak$4(shouldPrintComma$3(options, "all") && !hasRest ? "," : ""), comments.printDanglingComments(path, options, + /* sameIndent */ + true), softline$6, "]"])); + } + + case "ExistsTypeAnnotation": + return "*"; + + case "EmptyTypeAnnotation": + return "empty"; + + case "AnyTypeAnnotation": + return "any"; + + case "MixedTypeAnnotation": + return "mixed"; + + case "ArrayTypeAnnotation": + return concat$b([path.call(print, "elementType"), "[]"]); + + case "BooleanTypeAnnotation": + return "boolean"; + + case "BooleanLiteralTypeAnnotation": + return "" + n.value; + + case "DeclareClass": + return printFlowDeclaration(path, printClass(path, options, print)); + + case "TSDeclareFunction": + // For TypeScript the TSDeclareFunction node shares the AST + // structure with FunctionDeclaration + return concat$b([n.declare ? "declare " : "", printFunctionDeclaration(path, print, options), semi]); + + case "DeclareFunction": + return printFlowDeclaration(path, ["function ", path.call(print, "id"), n.predicate ? " " : "", path.call(print, "predicate"), semi]); + + case "DeclareModule": + return printFlowDeclaration(path, ["module ", path.call(print, "id"), " ", path.call(print, "body")]); + + case "DeclareModuleExports": + return printFlowDeclaration(path, ["module.exports", ": ", path.call(print, "typeAnnotation"), semi]); + + case "DeclareVariable": + return printFlowDeclaration(path, ["var ", path.call(print, "id"), semi]); + + case "DeclareExportAllDeclaration": + return concat$b(["declare export *", printModuleSource$1(path, options, print)]); + + case "DeclareOpaqueType": + case "OpaqueType": + { + parts.push("opaque type ", path.call(print, "id"), path.call(print, "typeParameters")); + + if (n.supertype) { + parts.push(": ", path.call(print, "supertype")); + } + + if (n.impltype) { + parts.push(" = ", path.call(print, "impltype")); + } + + parts.push(semi); + + if (n.type === "DeclareOpaqueType") { + return printFlowDeclaration(path, parts); + } + + return concat$b(parts); + } + + case "EnumDeclaration": + return concat$b(["enum ", path.call(print, "id"), " ", path.call(print, "body")]); + + case "EnumBooleanBody": + case "EnumNumberBody": + case "EnumStringBody": + case "EnumSymbolBody": + { + if (n.type === "EnumSymbolBody" || n.explicitType) { + let type = null; + + switch (n.type) { + case "EnumBooleanBody": + type = "boolean"; + break; + + case "EnumNumberBody": + type = "number"; + break; + + case "EnumStringBody": + type = "string"; + break; + + case "EnumSymbolBody": + type = "symbol"; + break; + } + + parts.push("of ", type, " "); + } + + if (n.members.length === 0) { + parts.push(group$7(concat$b(["{", comments.printDanglingComments(path, options), softline$6, "}"]))); + } else { + parts.push(group$7(concat$b(["{", indent$8(concat$b([hardline$6, printArrayItems(path, options, "members", print), shouldPrintComma$3(options) ? "," : ""])), comments.printDanglingComments(path, options, + /* sameIndent */ + true), hardline$6, "}"]))); + } + + return concat$b(parts); + } + + case "EnumBooleanMember": + case "EnumNumberMember": + case "EnumStringMember": + return concat$b([path.call(print, "id"), " = ", typeof n.init === "object" ? path.call(print, "init") : String(n.init)]); + + case "EnumDefaultedMember": + return path.call(print, "id"); + + case "FunctionTypeAnnotation": + case "TSFunctionType": + { + // FunctionTypeAnnotation is ambiguous: + // declare function foo(a: B): void; OR + // var A: (a: B) => void; + const parent = path.getParentNode(0); + const parentParent = path.getParentNode(1); + const parentParentParent = path.getParentNode(2); + let isArrowFunctionTypeAnnotation = n.type === "TSFunctionType" || !((parent.type === "ObjectTypeProperty" || parent.type === "ObjectTypeInternalSlot") && !getFlowVariance$1(parent) && !parent.optional && options.locStart(parent) === options.locStart(n) || parent.type === "ObjectTypeCallProperty" || parentParentParent && parentParentParent.type === "DeclareFunction"); + let needsColon = isArrowFunctionTypeAnnotation && (parent.type === "TypeAnnotation" || parent.type === "TSTypeAnnotation"); // Sadly we can't put it inside of FastPath::needsColon because we are + // printing ":" as part of the expression and it would put parenthesis + // around :( + + const needsParens = needsColon && isArrowFunctionTypeAnnotation && (parent.type === "TypeAnnotation" || parent.type === "TSTypeAnnotation") && parentParent.type === "ArrowFunctionExpression"; + + if (isObjectTypePropertyAFunction$1(parent, options)) { + isArrowFunctionTypeAnnotation = true; + needsColon = true; + } + + if (needsParens) { + parts.push("("); + } + + parts.push(printFunctionParams(path, print, options, + /* expandArg */ + false, + /* printTypeParams */ + true)); // The returnType is not wrapped in a TypeAnnotation, so the colon + // needs to be added separately. + + if (n.returnType || n.predicate || n.typeAnnotation) { + parts.push(isArrowFunctionTypeAnnotation ? " => " : ": ", path.call(print, "returnType"), path.call(print, "predicate"), path.call(print, "typeAnnotation")); + } + + if (needsParens) { + parts.push(")"); + } + + return group$7(concat$b(parts)); + } + + case "TSRestType": + return concat$b(["...", path.call(print, "typeAnnotation")]); + + case "TSOptionalType": + return concat$b([path.call(print, "typeAnnotation"), "?"]); + + case "FunctionTypeParam": + return concat$b([path.call(print, "name"), printOptionalToken$2(path), n.name ? ": " : "", path.call(print, "typeAnnotation")]); + + case "GenericTypeAnnotation": + return concat$b([path.call(print, "id"), path.call(print, "typeParameters")]); + + case "DeclareInterface": + case "InterfaceDeclaration": + case "InterfaceTypeAnnotation": + case "TSInterfaceDeclaration": + { + if (n.type === "DeclareInterface" || n.declare) { + parts.push("declare "); + } + + if (n.type === "TSInterfaceDeclaration") { + parts.push(n.abstract ? "abstract " : "", printTypeScriptModifiers(path, options, print)); + } + + parts.push("interface"); + const partsGroup = []; + const extendsParts = []; + + if (n.type !== "InterfaceTypeAnnotation") { + partsGroup.push(" ", path.call(print, "id"), path.call(print, "typeParameters")); + } + + const shouldIndentOnlyHeritageClauses = n.typeParameters && !hasTrailingLineComment$1(n.typeParameters); + + if (n.extends && n.extends.length !== 0) { + extendsParts.push(shouldIndentOnlyHeritageClauses ? ifBreak$4(" ", line$8, { + groupId: getTypeParametersGroupId(n.typeParameters) + }) : line$8, "extends ", (n.extends.length === 1 ? identity$2 : indent$8)(join$6(concat$b([",", line$8]), path.map(print, "extends")))); + } + + if (n.id && hasTrailingComment$3(n.id) || n.extends && n.extends.length !== 0) { + const printedExtends = concat$b(extendsParts); + + if (shouldIndentOnlyHeritageClauses) { + parts.push(group$7(concat$b(partsGroup.concat(ifBreak$4(indent$8(printedExtends), printedExtends))))); + } else { + parts.push(group$7(indent$8(concat$b(partsGroup.concat(printedExtends))))); + } + } else { + parts.push(...partsGroup, ...extendsParts); + } + + parts.push(" ", path.call(print, "body")); + return group$7(concat$b(parts)); + } + + case "ClassImplements": + case "InterfaceExtends": + return concat$b([path.call(print, "id"), path.call(print, "typeParameters")]); + + case "TSClassImplements": + return concat$b([path.call(print, "expression"), path.call(print, "typeParameters")]); + + case "TSIntersectionType": + case "IntersectionTypeAnnotation": + { + const types = path.map(print, "types"); + const result = []; + let wasIndented = false; + + for (let i = 0; i < types.length; ++i) { + if (i === 0) { + result.push(types[i]); + } else if (isObjectType$1(n.types[i - 1]) && isObjectType$1(n.types[i])) { + // If both are objects, don't indent + result.push(concat$b([" & ", wasIndented ? indent$8(types[i]) : types[i]])); + } else if (!isObjectType$1(n.types[i - 1]) && !isObjectType$1(n.types[i])) { + // If no object is involved, go to the next line if it breaks + result.push(indent$8(concat$b([" &", line$8, types[i]]))); + } else { + // If you go from object to non-object or vis-versa, then inline it + if (i > 1) { + wasIndented = true; + } + + result.push(" & ", i > 1 ? indent$8(types[i]) : types[i]); + } + } + + return group$7(concat$b(result)); + } + + case "TSUnionType": + case "UnionTypeAnnotation": + { + // single-line variation + // A | B | C + // multi-line variation + // | A + // | B + // | C + const parent = path.getParentNode(); // If there's a leading comment, the parent is doing the indentation + + const shouldIndent = parent.type !== "TypeParameterInstantiation" && parent.type !== "TSTypeParameterInstantiation" && parent.type !== "GenericTypeAnnotation" && parent.type !== "TSTypeReference" && parent.type !== "TSTypeAssertion" && parent.type !== "TupleTypeAnnotation" && parent.type !== "TSTupleType" && !(parent.type === "FunctionTypeParam" && !parent.name) && !((parent.type === "TypeAlias" || parent.type === "VariableDeclarator" || parent.type === "TSTypeAliasDeclaration") && hasLeadingOwnLineComment$1(options.originalText, n, options)); // { + // a: string + // } | null | void + // should be inlined and not be printed in the multi-line variant + + const shouldHug = shouldHugType(n); // We want to align the children but without its comment, so it looks like + // | child1 + // // comment + // | child2 + + const printed = path.map(typePath => { + let printedType = typePath.call(print); + + if (!shouldHug) { + printedType = align$2(2, printedType); + } + + return comments.printComments(typePath, () => printedType, options); + }, "types"); + + if (shouldHug) { + return join$6(" | ", printed); + } + + const shouldAddStartLine = shouldIndent && !hasLeadingOwnLineComment$1(options.originalText, n, options); + const code = concat$b([ifBreak$4(concat$b([shouldAddStartLine ? line$8 : "", "| "])), join$6(concat$b([line$8, "| "]), printed)]); + + if (needsParens_1(path, options)) { + return group$7(concat$b([indent$8(code), softline$6])); + } + + if (parent.type === "TupleTypeAnnotation" && parent.types.length > 1 || parent.type === "TSTupleType" && parent.elementTypes.length > 1) { + return group$7(concat$b([indent$8(concat$b([ifBreak$4(concat$b(["(", softline$6])), code])), softline$6, ifBreak$4(")")])); + } + + return group$7(shouldIndent ? indent$8(code) : code); + } + + case "NullableTypeAnnotation": + return concat$b(["?", path.call(print, "typeAnnotation")]); + + case "TSNullKeyword": + case "NullLiteralTypeAnnotation": + return "null"; + + case "ThisTypeAnnotation": + return "this"; + + case "NumberTypeAnnotation": + return "number"; + + case "SymbolTypeAnnotation": + return "symbol"; + + case "ObjectTypeCallProperty": + if (n.static) { + parts.push("static "); + } + + parts.push(path.call(print, "value")); + return concat$b(parts); + + case "ObjectTypeIndexer": + { + const variance = getFlowVariance$1(n); + return concat$b([variance || "", "[", path.call(print, "id"), n.id ? ": " : "", path.call(print, "key"), "]: ", path.call(print, "value")]); + } + + case "ObjectTypeProperty": + { + const variance = getFlowVariance$1(n); + let modifier = ""; + + if (n.proto) { + modifier = "proto "; + } else if (n.static) { + modifier = "static "; + } + + return concat$b([modifier, isGetterOrSetter$1(n) ? n.kind + " " : "", variance || "", printPropertyKey(path, options, print), printOptionalToken$2(path), isFunctionNotation$1(n, options) ? "" : ": ", path.call(print, "value")]); + } + + case "QualifiedTypeIdentifier": + return concat$b([path.call(print, "qualification"), ".", path.call(print, "id")]); + + case "StringLiteralTypeAnnotation": + return nodeStr(n, options); + + case "NumberLiteralTypeAnnotation": + assert__default['default'].strictEqual(typeof n.value, "number"); + + if (n.extra != null) { + return printNumber$1(n.extra.raw); + } + + return printNumber$1(n.raw); + + case "StringTypeAnnotation": + return "string"; + + case "DeclareTypeAlias": + case "TypeAlias": + { + if (n.type === "DeclareTypeAlias" || n.declare) { + parts.push("declare "); + } + + const printed = printAssignmentRight(n.id, n.right, path.call(print, "right"), options); + parts.push("type ", path.call(print, "id"), path.call(print, "typeParameters"), " =", printed, semi); + return group$7(concat$b(parts)); + } + + case "TypeCastExpression": + { + return concat$b(["(", path.call(print, "expression"), printTypeAnnotation(path, options, print), ")"]); + } + + case "TypeParameterDeclaration": + case "TypeParameterInstantiation": + { + const value = path.getValue(); + const commentStart = options.originalText.slice(0, options.locStart(value)).lastIndexOf("/*"); // As noted in the TypeCastExpression comments above, we're able to use a normal whitespace regex here + // because we know for sure that this is a type definition. + + const commentSyntax = commentStart >= 0 && options.originalText.slice(commentStart).match(/^\/\*\s*::/); + + if (commentSyntax) { + return concat$b(["/*:: ", printTypeParameters(path, options, print, "params"), " */"]); + } + + return printTypeParameters(path, options, print, "params"); + } + + case "TSTypeParameterDeclaration": + case "TSTypeParameterInstantiation": + return printTypeParameters(path, options, print, "params"); + + case "TSTypeParameter": + case "TypeParameter": + { + const parent = path.getParentNode(); + + if (parent.type === "TSMappedType") { + parts.push("[", path.call(print, "name")); + + if (n.constraint) { + parts.push(" in ", path.call(print, "constraint")); + } + + parts.push("]"); + return concat$b(parts); + } + + const variance = getFlowVariance$1(n); + + if (variance) { + parts.push(variance); + } + + parts.push(path.call(print, "name")); + + if (n.bound) { + parts.push(": "); + parts.push(path.call(print, "bound")); + } + + if (n.constraint) { + parts.push(" extends ", path.call(print, "constraint")); + } + + if (n.default) { + parts.push(" = ", path.call(print, "default")); + } // Keep comma if the file extension is .tsx and + // has one type parameter that isn't extend with any types. + // Because, otherwise formatted result will be invalid as tsx. + + + const grandParent = path.getNode(2); + + if (parent.params && parent.params.length === 1 && isTSXFile$1(options) && !n.constraint && grandParent.type === "ArrowFunctionExpression") { + parts.push(","); + } + + return concat$b(parts); + } + + case "TypeofTypeAnnotation": + return concat$b(["typeof ", path.call(print, "argument")]); + + case "VoidTypeAnnotation": + return "void"; + + case "InferredPredicate": + return "%checks"; + // Unhandled types below. If encountered, nodes of these types should + // be either left alone or desugared into AST types that are fully + // supported by the pretty-printer. + + case "DeclaredPredicate": + return concat$b(["%checks(", path.call(print, "value"), ")"]); + + case "TSAbstractKeyword": + return "abstract"; + + case "TSAnyKeyword": + return "any"; + + case "TSAsyncKeyword": + return "async"; + + case "TSBooleanKeyword": + return "boolean"; + + case "TSBigIntKeyword": + return "bigint"; + + case "TSConstKeyword": + return "const"; + + case "TSDeclareKeyword": + return "declare"; + + case "TSExportKeyword": + return "export"; + + case "TSNeverKeyword": + return "never"; + + case "TSNumberKeyword": + return "number"; + + case "TSObjectKeyword": + return "object"; + + case "TSProtectedKeyword": + return "protected"; + + case "TSPrivateKeyword": + return "private"; + + case "TSPublicKeyword": + return "public"; + + case "TSReadonlyKeyword": + return "readonly"; + + case "TSSymbolKeyword": + return "symbol"; + + case "TSStaticKeyword": + return "static"; + + case "TSStringKeyword": + return "string"; + + case "TSUndefinedKeyword": + return "undefined"; + + case "TSUnknownKeyword": + return "unknown"; + + case "TSVoidKeyword": + return "void"; + + case "TSAsExpression": + return concat$b([path.call(print, "expression"), " as ", path.call(print, "typeAnnotation")]); + + case "TSArrayType": + return concat$b([path.call(print, "elementType"), "[]"]); + + case "TSPropertySignature": + { + if (n.export) { + parts.push("export "); + } + + if (n.accessibility) { + parts.push(n.accessibility + " "); + } + + if (n.static) { + parts.push("static "); + } + + if (n.readonly) { + parts.push("readonly "); + } + + parts.push(printPropertyKey(path, options, print), printOptionalToken$2(path)); + + if (n.typeAnnotation) { + parts.push(": "); + parts.push(path.call(print, "typeAnnotation")); + } // This isn't valid semantically, but it's in the AST so we can print it. + + + if (n.initializer) { + parts.push(" = ", path.call(print, "initializer")); + } + + return concat$b(parts); + } + + case "TSParameterProperty": + if (n.accessibility) { + parts.push(n.accessibility + " "); + } + + if (n.export) { + parts.push("export "); + } + + if (n.static) { + parts.push("static "); + } + + if (n.readonly) { + parts.push("readonly "); + } + + parts.push(path.call(print, "parameter")); + return concat$b(parts); + + case "TSTypeReference": + return concat$b([path.call(print, "typeName"), printTypeParameters(path, options, print, "typeParameters")]); + + case "TSTypeQuery": + return concat$b(["typeof ", path.call(print, "exprName")]); + + case "TSIndexSignature": + { + const parent = path.getParentNode(); // The typescript parser accepts multiple parameters here. If you're + // using them, it makes sense to have a trailing comma. But if you + // aren't, this is more like a computed property name than an array. + // So we leave off the trailing comma when there's just one parameter. + + const trailingComma = n.parameters.length > 1 ? ifBreak$4(shouldPrintComma$3(options) ? "," : "") : ""; + const parametersGroup = group$7(concat$b([indent$8(concat$b([softline$6, join$6(concat$b([", ", softline$6]), path.map(print, "parameters"))])), trailingComma, softline$6])); + return concat$b([n.export ? "export " : "", n.accessibility ? concat$b([n.accessibility, " "]) : "", n.static ? "static " : "", n.readonly ? "readonly " : "", "[", n.parameters ? parametersGroup : "", n.typeAnnotation ? "]: " : "]", n.typeAnnotation ? path.call(print, "typeAnnotation") : "", parent.type === "ClassBody" ? semi : ""]); + } + + case "TSTypePredicate": + return concat$b([n.asserts ? "asserts " : "", path.call(print, "parameterName"), n.typeAnnotation ? concat$b([" is ", path.call(print, "typeAnnotation")]) : ""]); + + case "TSNonNullExpression": + return concat$b([path.call(print, "expression"), "!"]); + + case "TSThisType": + return "this"; + + case "TSImportType": + return concat$b([!n.isTypeOf ? "" : "typeof ", "import(", path.call(print, n.parameter ? "parameter" : "argument"), ")", !n.qualifier ? "" : concat$b([".", path.call(print, "qualifier")]), printTypeParameters(path, options, print, "typeParameters")]); + + case "TSLiteralType": + return path.call(print, "literal"); + + case "TSIndexedAccessType": + return concat$b([path.call(print, "objectType"), "[", path.call(print, "indexType"), "]"]); + + case "TSConstructSignatureDeclaration": + case "TSCallSignatureDeclaration": + case "TSConstructorType": + { + if (n.type !== "TSCallSignatureDeclaration") { + parts.push("new "); + } + + parts.push(group$7(printFunctionParams(path, print, options, + /* expandArg */ + false, + /* printTypeParams */ + true))); + + if (n.returnType || n.typeAnnotation) { + const isType = n.type === "TSConstructorType"; + parts.push(isType ? " => " : ": ", path.call(print, "returnType"), path.call(print, "typeAnnotation")); + } + + return concat$b(parts); + } + + case "TSTypeOperator": + return concat$b([n.operator, " ", path.call(print, "typeAnnotation")]); + + case "TSMappedType": + { + const shouldBreak = hasNewlineInRange$5(options.originalText, options.locStart(n), options.locEnd(n)); + return group$7(concat$b(["{", indent$8(concat$b([options.bracketSpacing ? line$8 : softline$6, n.readonly ? concat$b([getTypeScriptMappedTypeModifier$1(n.readonly, "readonly"), " "]) : "", printTypeScriptModifiers(path, options, print), path.call(print, "typeParameter"), n.optional ? getTypeScriptMappedTypeModifier$1(n.optional, "?") : "", n.typeAnnotation ? ": " : "", path.call(print, "typeAnnotation"), ifBreak$4(semi, "")])), comments.printDanglingComments(path, options, + /* sameIndent */ + true), options.bracketSpacing ? line$8 : softline$6, "}"]), { + shouldBreak + }); + } + + case "TSMethodSignature": + parts.push(n.accessibility ? concat$b([n.accessibility, " "]) : "", n.export ? "export " : "", n.static ? "static " : "", n.readonly ? "readonly " : "", n.computed ? "[" : "", path.call(print, "key"), n.computed ? "]" : "", printOptionalToken$2(path), printFunctionParams(path, print, options, + /* expandArg */ + false, + /* printTypeParams */ + true)); + + if (n.returnType || n.typeAnnotation) { + parts.push(": ", path.call(print, "returnType"), path.call(print, "typeAnnotation")); + } + + return group$7(concat$b(parts)); + + case "TSNamespaceExportDeclaration": + parts.push("export as namespace ", path.call(print, "id")); + + if (options.semi) { + parts.push(";"); + } + + return group$7(concat$b(parts)); + + case "TSEnumDeclaration": + if (n.declare) { + parts.push("declare "); + } + + if (n.modifiers) { + parts.push(printTypeScriptModifiers(path, options, print)); + } + + if (n.const) { + parts.push("const "); + } + + parts.push("enum ", path.call(print, "id"), " "); + + if (n.members.length === 0) { + parts.push(group$7(concat$b(["{", comments.printDanglingComments(path, options), softline$6, "}"]))); + } else { + parts.push(group$7(concat$b(["{", indent$8(concat$b([hardline$6, printArrayItems(path, options, "members", print), shouldPrintComma$3(options, "es5") ? "," : ""])), comments.printDanglingComments(path, options, + /* sameIndent */ + true), hardline$6, "}"]))); + } + + return concat$b(parts); + + case "TSEnumMember": + parts.push(path.call(print, "id")); + + if (n.initializer) { + parts.push(" = ", path.call(print, "initializer")); + } + + return concat$b(parts); + + case "TSImportEqualsDeclaration": + if (n.isExport) { + parts.push("export "); + } + + parts.push("import ", path.call(print, "id"), " = ", path.call(print, "moduleReference")); + + if (options.semi) { + parts.push(";"); + } + + return group$7(concat$b(parts)); + + case "TSExternalModuleReference": + return concat$b(["require(", path.call(print, "expression"), ")"]); + + case "TSModuleDeclaration": + { + const parent = path.getParentNode(); + const isExternalModule = isLiteral$1(n.id); + const parentIsDeclaration = parent.type === "TSModuleDeclaration"; + const bodyIsDeclaration = n.body && n.body.type === "TSModuleDeclaration"; + + if (parentIsDeclaration) { + parts.push("."); + } else { + if (n.declare) { + parts.push("declare "); + } + + parts.push(printTypeScriptModifiers(path, options, print)); + const textBetweenNodeAndItsId = options.originalText.slice(options.locStart(n), options.locStart(n.id)); // Global declaration looks like this: + // (declare)? global { ... } + + const isGlobalDeclaration = n.id.type === "Identifier" && n.id.name === "global" && !/namespace|module/.test(textBetweenNodeAndItsId); + + if (!isGlobalDeclaration) { + parts.push(isExternalModule || /(^|\s)module(\s|$)/.test(textBetweenNodeAndItsId) ? "module " : "namespace "); + } + } + + parts.push(path.call(print, "id")); + + if (bodyIsDeclaration) { + parts.push(path.call(print, "body")); + } else if (n.body) { + parts.push(" ", group$7(path.call(print, "body"))); + } else { + parts.push(semi); + } + + return concat$b(parts); + } + + case "PrivateName": + return concat$b(["#", path.call(print, "id")]); + // TODO: Temporary auto-generated node type. To remove when typescript-estree has proper support for private fields. + + case "TSPrivateIdentifier": + return n.escapedText; + + case "TSConditionalType": + return ternary(path, options, print, { + beforeParts: () => [path.call(print, "checkType"), " ", "extends", " ", path.call(print, "extendsType")], + afterParts: () => [], + shouldCheckJsx: false, + conditionalNodeType: "TSConditionalType", + consequentNodePropertyName: "trueType", + alternateNodePropertyName: "falseType", + testNodePropertyNames: ["checkType", "extendsType"] + }); + + case "TSInferType": + return concat$b(["infer", " ", path.call(print, "typeParameter")]); + + case "InterpreterDirective": + parts.push("#!", n.value, hardline$6); + + if (isNextLineEmpty$4(options.originalText, n, options.locEnd)) { + parts.push(hardline$6); + } + + return concat$b(parts); + + case "NGRoot": + return concat$b([].concat(path.call(print, "node"), !n.node.comments || n.node.comments.length === 0 ? [] : concat$b([" //", n.node.comments[0].value.trimEnd()]))); + + case "NGChainedExpression": + return group$7(join$6(concat$b([";", line$8]), path.map(childPath => hasNgSideEffect$1(childPath) ? print(childPath) : concat$b(["(", print(childPath), ")"]), "expressions"))); + + case "NGEmptyExpression": + return ""; + + case "NGQuotedExpression": + return concat$b([n.prefix, ": ", n.value.trim()]); + + case "NGMicrosyntax": + return concat$b(path.map((childPath, index) => concat$b([index === 0 ? "" : isNgForOf$1(childPath.getValue(), index, n) ? " " : concat$b([";", line$8]), print(childPath)]), "body")); + + case "NGMicrosyntaxKey": + return /^[$_a-z][\w$]*(-[$_a-z][\w$])*$/i.test(n.name) ? n.name : JSON.stringify(n.name); + + case "NGMicrosyntaxExpression": + return concat$b([path.call(print, "expression"), n.alias === null ? "" : concat$b([" as ", path.call(print, "alias")])]); + + case "NGMicrosyntaxKeyedExpression": + { + const index = path.getName(); + const parentNode = path.getParentNode(); + const shouldNotPrintColon = isNgForOf$1(n, index, parentNode) || (index === 1 && (n.key.name === "then" || n.key.name === "else") || index === 2 && n.key.name === "else" && parentNode.body[index - 1].type === "NGMicrosyntaxKeyedExpression" && parentNode.body[index - 1].key.name === "then") && parentNode.body[0].type === "NGMicrosyntaxExpression"; + return concat$b([path.call(print, "key"), shouldNotPrintColon ? " " : ": ", path.call(print, "expression")]); + } + + case "NGMicrosyntaxLet": + return concat$b(["let ", path.call(print, "key"), n.value === null ? "" : concat$b([" = ", path.call(print, "value")])]); + + case "NGMicrosyntaxAs": + return concat$b([path.call(print, "key"), " as ", path.call(print, "alias")]); + + case "PipelineBareFunction": + return path.call(print, "callee"); + + case "PipelineTopicExpression": + return path.call(print, "expression"); + + case "PipelinePrimaryTopicReference": + { + parts.push("#"); + return concat$b(parts); + } + + case "ArgumentPlaceholder": + return "?"; + // These are not valid TypeScript. Printing them just for the sake of error recovery. + + case "TSJSDocAllType": + return "*"; + + case "TSJSDocUnknownType": + return "?"; + + case "TSJSDocNullableType": + return concat$b(["?", path.call(print, "typeAnnotation")]); + + case "TSJSDocNonNullableType": + return concat$b(["!", path.call(print, "typeAnnotation")]); + + case "TSJSDocFunctionType": + return concat$b(["function(", // The parameters could be here, but typescript-estree doesn't convert them anyway (throws an error). + "): ", path.call(print, "typeAnnotation")]); + + default: + /* istanbul ignore next */ + throw new Error("unknown type: " + JSON.stringify(n.type)); + } +} + +function printStatementSequence(path, options, print) { + const printed = []; + const bodyNode = path.getNode(); + const isClass = bodyNode.type === "ClassBody"; + path.map((stmtPath, i) => { + const stmt = stmtPath.getValue(); // Just in case the AST has been modified to contain falsy + // "statements," it's safer simply to skip them. + + /* istanbul ignore if */ + + if (!stmt) { + return; + } // Skip printing EmptyStatement nodes to avoid leaving stray + // semicolons lying around. + + + if (stmt.type === "EmptyStatement") { + return; + } + + const stmtPrinted = print(stmtPath); + const text = options.originalText; + const parts = []; // in no-semi mode, prepend statement with semicolon if it might break ASI + // don't prepend the only JSX element in a program with semicolon + + if (!options.semi && !isClass && !isTheOnlyJSXElementInMarkdown$1(options, stmtPath) && stmtNeedsASIProtection(stmtPath, options)) { + if (stmt.comments && stmt.comments.some(comment => comment.leading)) { + parts.push(print(stmtPath, { + needsSemi: true + })); + } else { + parts.push(";", stmtPrinted); + } + } else { + parts.push(stmtPrinted); + } + + if (!options.semi && isClass) { + if (classPropMayCauseASIProblems$1(stmtPath)) { + parts.push(";"); + } else if (stmt.type === "ClassProperty") { + const nextChild = bodyNode.body[i + 1]; + + if (classChildNeedsASIProtection$1(nextChild)) { + parts.push(";"); + } + } + } + + if (isNextLineEmpty$4(text, stmt, options.locEnd) && !isLastStatement$1(stmtPath)) { + parts.push(hardline$6); + } + + printed.push(concat$b(parts)); + }); + return join$6(hardline$6, printed); +} + +function printPropertyKey(path, options, print) { + const node = path.getNode(); + + if (node.computed) { + return concat$b(["[", path.call(print, "key"), "]"]); + } + + const parent = path.getParentNode(); + const { + key + } = node; + + if (node.type === "ClassPrivateProperty" && // flow has `Identifier` key, and babel has `PrivateName` key + key.type === "Identifier") { + return concat$b(["#", path.call(print, "key")]); + } + + if (options.quoteProps === "consistent" && !needsQuoteProps.has(parent)) { + const objectHasStringProp = (parent.properties || parent.body || parent.members).some(prop => !prop.computed && prop.key && isStringLiteral$1(prop.key) && !isStringPropSafeToUnquote$1(prop, options)); + needsQuoteProps.set(parent, objectHasStringProp); + } + + if ((key.type === "Identifier" || isNumericLiteral$3(key) && isSimpleNumber$1(printNumber$1(rawText$1(key))) && // Avoid converting 999999999999999999999 to 1e+21, 0.99999999999999999 to 1 and 1.0 to 1. + String(key.value) === printNumber$1(rawText$1(key)) && // Quoting number keys is safe in JS and Flow, but not in TypeScript (as + // mentioned in `isStringPropSafeToUnquote`). + !(options.parser === "typescript" || options.parser === "babel-ts")) && (options.parser === "json" || options.quoteProps === "consistent" && needsQuoteProps.get(parent))) { + // a -> "a" + // 1 -> "1" + // 1.5 -> "1.5" + const prop = printString$1(JSON.stringify(key.type === "Identifier" ? key.name : key.value.toString()), options); + return path.call(keyPath => comments.printComments(keyPath, () => prop, options), "key"); + } + + if (isStringPropSafeToUnquote$1(node, options) && (options.quoteProps === "as-needed" || options.quoteProps === "consistent" && !needsQuoteProps.get(parent))) { + // 'a' -> a + // '1' -> 1 + // '1.5' -> 1.5 + return path.call(keyPath => comments.printComments(keyPath, () => /^\d/.test(key.value) ? printNumber$1(key.value) : key.value, options), "key"); + } + + return path.call(print, "key"); +} + +function printMethod(path, options, print) { + const node = path.getNode(); + const { + kind + } = node; + const value = node.value || node; + const parts = []; + + if (!kind || kind === "init" || kind === "method" || kind === "constructor") { + if (value.async) { + parts.push("async "); + } + + if (value.generator) { + parts.push("*"); + } + } else { + assert__default['default'].ok(kind === "get" || kind === "set"); + parts.push(kind, " "); + } + + parts.push(printPropertyKey(path, options, print), node.optional || node.key.optional ? "?" : "", node === value ? printMethodInternal(path, options, print) : path.call(path => printMethodInternal(path, options, print), "value")); + return concat$b(parts); +} + +function printMethodInternal(path, options, print) { + const parts = [printFunctionTypeParameters$2(path, options, print), group$7(concat$b([printFunctionParams(path, print, options), printReturnType(path, print, options)]))]; + + if (path.getNode().body) { + parts.push(" ", path.call(print, "body")); + } else { + parts.push(options.semi ? ";" : ""); + } + + return concat$b(parts); +} + +function printJestEachTemplateLiteral(path, options, print) { + /** + * a | b | expected + * ${1} | ${1} | ${2} + * ${1} | ${2} | ${3} + * ${2} | ${1} | ${3} + */ + const node = path.getNode(); + const headerNames = node.quasis[0].value.raw.trim().split(/\s*\|\s*/); + + if (headerNames.length > 1 || headerNames.some(headerName => headerName.length !== 0)) { + options.__inJestEach = true; + const expressions = path.map(print, "expressions"); + options.__inJestEach = false; + const parts = []; + const stringifiedExpressions = expressions.map(doc => "${" + printDocToString$2(doc, Object.assign({}, options, { + printWidth: Infinity, + endOfLine: "lf" + })).formatted + "}"); + const tableBody = [{ + hasLineBreak: false, + cells: [] + }]; + + for (let i = 1; i < node.quasis.length; i++) { + const row = tableBody[tableBody.length - 1]; + const correspondingExpression = stringifiedExpressions[i - 1]; + row.cells.push(correspondingExpression); + + if (correspondingExpression.includes("\n")) { + row.hasLineBreak = true; + } + + if (node.quasis[i].value.raw.includes("\n")) { + tableBody.push({ + hasLineBreak: false, + cells: [] + }); + } + } + + const maxColumnCount = Math.max(headerNames.length, ...tableBody.map(row => row.cells.length)); + const maxColumnWidths = Array.from({ + length: maxColumnCount + }).fill(0); + const table = [{ + cells: headerNames + }, ...tableBody.filter(row => row.cells.length !== 0)]; + + for (const { + cells + } of table.filter(row => !row.hasLineBreak)) { + cells.forEach((cell, index) => { + maxColumnWidths[index] = Math.max(maxColumnWidths[index], getStringWidth$3(cell)); + }); + } + + parts.push(lineSuffixBoundary$1, "`", indent$8(concat$b([hardline$6, join$6(hardline$6, table.map(row => join$6(" | ", row.cells.map((cell, index) => row.hasLineBreak ? cell : cell + " ".repeat(maxColumnWidths[index] - getStringWidth$3(cell))))))])), hardline$6, "`"); + return concat$b(parts); + } +} + +function printTypeAnnotation(path, options, print) { + const node = path.getValue(); + + if (!node.typeAnnotation) { + return ""; + } + + const parentNode = path.getParentNode(); + const isDefinite = node.definite || parentNode && parentNode.type === "VariableDeclarator" && parentNode.definite; + const isFunctionDeclarationIdentifier = parentNode.type === "DeclareFunction" && parentNode.id === node; + + if (isFlowAnnotationComment$1(options.originalText, node.typeAnnotation, options)) { + return concat$b([" /*: ", path.call(print, "typeAnnotation"), " */"]); + } + + return concat$b([isFunctionDeclarationIdentifier ? "" : isDefinite ? "!: " : ": ", path.call(print, "typeAnnotation")]); +} + +function printFunctionParams(path, print, options, expandArg, printTypeParams) { + const fun = path.getValue(); + const parent = path.getParentNode(); + const paramsField = fun.parameters ? "parameters" : "params"; + const isParametersInTestCall = isTestCall$1(parent); + const shouldHugParameters = shouldHugArguments(fun); + const shouldExpandParameters = expandArg && !(fun[paramsField] && fun[paramsField].some(n => n.comments)); + const typeParams = printTypeParams ? printFunctionTypeParameters$2(path, options, print) : ""; + let printed = []; + + if (fun[paramsField]) { + const lastArgIndex = fun[paramsField].length - 1; + printed = path.map((childPath, index) => { + const parts = []; + const param = childPath.getValue(); + parts.push(print(childPath)); + + if (index === lastArgIndex) { + if (fun.rest) { + parts.push(",", line$8); + } + } else if (isParametersInTestCall || shouldHugParameters || shouldExpandParameters) { + parts.push(", "); + } else if (isNextLineEmpty$4(options.originalText, param, options.locEnd)) { + parts.push(",", hardline$6, hardline$6); + } else { + parts.push(",", line$8); + } + + return concat$b(parts); + }, paramsField); + } + + if (fun.rest) { + printed.push(concat$b(["...", path.call(print, "rest")])); + } + + if (printed.length === 0) { + return concat$b([typeParams, "(", comments.printDanglingComments(path, options, + /* sameIndent */ + true, comment => getNextNonSpaceNonCommentCharacter$2(options.originalText, comment, options.locEnd) === ")"), ")"]); + } + + const lastParam = getLast$5(fun[paramsField]); // If the parent is a call with the first/last argument expansion and this is the + // params of the first/last argument, we don't want the arguments to break and instead + // want the whole expression to be on a new line. + // + // Good: Bad: + // verylongcall( verylongcall(( + // (a, b) => { a, + // } b, + // }) ) => { + // }) + + if (shouldExpandParameters) { + return group$7(concat$b([removeLines$1(typeParams), "(", concat$b(printed.map(removeLines$1)), ")"])); + } // Single object destructuring should hug + // + // function({ + // a, + // b, + // c + // }) {} + + + const hasNotParameterDecorator = fun[paramsField].every(param => !param.decorators); + + if (shouldHugParameters && hasNotParameterDecorator) { + return concat$b([typeParams, "(", concat$b(printed), ")"]); + } // don't break in specs, eg; `it("should maintain parens around done even when long", (done) => {})` + + + if (isParametersInTestCall) { + return concat$b([typeParams, "(", concat$b(printed), ")"]); + } + + const isFlowShorthandWithOneArg = (isObjectTypePropertyAFunction$1(parent, options) || isTypeAnnotationAFunction$1(parent, options) || parent.type === "TypeAlias" || parent.type === "UnionTypeAnnotation" || parent.type === "TSUnionType" || parent.type === "IntersectionTypeAnnotation" || parent.type === "FunctionTypeAnnotation" && parent.returnType === fun) && fun[paramsField].length === 1 && fun[paramsField][0].name === null && fun[paramsField][0].typeAnnotation && fun.typeParameters === null && isSimpleFlowType$1(fun[paramsField][0].typeAnnotation) && !fun.rest; + + if (isFlowShorthandWithOneArg) { + if (options.arrowParens === "always") { + return concat$b(["(", concat$b(printed), ")"]); + } + + return concat$b(printed); + } + + const canHaveTrailingComma = !(lastParam && lastParam.type === "RestElement") && !fun.rest; + return concat$b([typeParams, "(", indent$8(concat$b([softline$6, concat$b(printed)])), ifBreak$4(canHaveTrailingComma && shouldPrintComma$3(options, "all") ? "," : ""), softline$6, ")"]); +} + +function shouldPrintParamsWithoutParens(path, options) { + if (options.arrowParens === "always") { + return false; + } + + if (options.arrowParens === "avoid") { + const node = path.getValue(); + return canPrintParamsWithoutParens(node); + } // Fallback default; should be unreachable + + /* istanbul ignore next */ + + + return false; +} + +function canPrintParamsWithoutParens(node) { + return node.params.length === 1 && !node.rest && !node.typeParameters && !hasDanglingComments$1(node) && node.params[0].type === "Identifier" && !node.params[0].typeAnnotation && !node.params[0].comments && !node.params[0].optional && !node.predicate && !node.returnType; +} + +function printFunctionDeclaration(path, print, options) { + const n = path.getValue(); + const parts = []; + + if (n.async) { + parts.push("async "); + } + + if (n.generator) { + parts.push("function* "); + } else { + parts.push("function "); + } + + if (n.id) { + parts.push(path.call(print, "id")); + } + + parts.push(printFunctionTypeParameters$2(path, options, print), group$7(concat$b([printFunctionParams(path, print, options), printReturnType(path, print, options)])), n.body ? " " : "", path.call(print, "body")); + return concat$b(parts); +} + +function printReturnType(path, print, options) { + const n = path.getValue(); + const returnType = path.call(print, "returnType"); + + if (n.returnType && isFlowAnnotationComment$1(options.originalText, n.returnType, options)) { + return concat$b([" /*: ", returnType, " */"]); + } + + const parts = [returnType]; // prepend colon to TypeScript type annotation + + if (n.returnType && n.returnType.typeAnnotation) { + parts.unshift(": "); + } + + if (n.predicate) { + // The return type will already add the colon, but otherwise we + // need to do it ourselves + parts.push(n.returnType ? " " : ": ", path.call(print, "predicate")); + } + + return concat$b(parts); +} + +function printExportDeclaration(path, options, print) { + const decl = path.getValue(); + const semi = options.semi ? ";" : ""; + /** @type{Doc[]} */ + + const parts = ["export "]; + const isDefault = decl.default || decl.type === "ExportDefaultDeclaration"; + + if (isDefault) { + parts.push("default "); + } + + parts.push(comments.printDanglingComments(path, options, + /* sameIndent */ + true)); + + if (needsHardlineAfterDanglingComment$1(decl)) { + parts.push(hardline$6); + } + + if (decl.declaration) { + parts.push(path.call(print, "declaration")); + + if (isDefault && decl.declaration.type !== "ClassDeclaration" && decl.declaration.type !== "FunctionDeclaration" && decl.declaration.type !== "TSInterfaceDeclaration" && decl.declaration.type !== "DeclareClass" && decl.declaration.type !== "DeclareFunction" && decl.declaration.type !== "TSDeclareFunction" && decl.declaration.type !== "EnumDeclaration") { + parts.push(semi); + } + } else { + parts.push(decl.exportKind === "type" ? "type " : ""); + parts.push(printModuleSpecifiers$1(path, options, print)); + parts.push(printModuleSource$1(path, options, print)); + parts.push(semi); + } + + return concat$b(parts); +} + +function printFlowDeclaration(path, parts) { + const parentExportDecl = getParentExportDeclaration$1(path); + + if (parentExportDecl) { + assert__default['default'].strictEqual(parentExportDecl.type, "DeclareExportDeclaration"); + } else { + // If the parent node has type DeclareExportDeclaration, then it + // will be responsible for printing the "declare" token. Otherwise + // it needs to be printed with this non-exported declaration node. + parts.unshift("declare "); + } + + return concat$b(parts); +} + +function printTypeScriptModifiers(path, options, print) { + const n = path.getValue(); + + if (!n.modifiers || !n.modifiers.length) { + return ""; + } + + return concat$b([join$6(" ", path.map(print, "modifiers")), " "]); +} + +const typeParametersGroupIds = new WeakMap(); + +function getTypeParametersGroupId(node) { + if (!typeParametersGroupIds.has(node)) { + typeParametersGroupIds.set(node, Symbol("typeParameters")); + } + + return typeParametersGroupIds.get(node); +} + +function printTypeParameters(path, options, print, paramsKey) { + const n = path.getValue(); + + if (!n[paramsKey]) { + return ""; + } // for TypeParameterDeclaration typeParameters is a single node + + + if (!Array.isArray(n[paramsKey])) { + return path.call(print, paramsKey); + } + + const grandparent = path.getNode(2); + const greatGrandParent = path.getNode(3); + const greatGreatGrandParent = path.getNode(4); + const isParameterInTestCall = grandparent != null && isTestCall$1(grandparent); + const shouldInline = isParameterInTestCall || n[paramsKey].length === 0 || n[paramsKey].length === 1 && (shouldHugType(n[paramsKey][0]) || n[paramsKey][0].type === "GenericTypeAnnotation" && shouldHugType(n[paramsKey][0].id) || n[paramsKey][0].type === "TSTypeReference" && shouldHugType(n[paramsKey][0].typeName) || n[paramsKey][0].type === "NullableTypeAnnotation" || // See https://github.com/prettier/prettier/pull/6467 for the context. + greatGreatGrandParent && greatGreatGrandParent.type === "VariableDeclarator" && grandparent.type === "TSTypeAnnotation" && greatGrandParent.type !== "ArrowFunctionExpression" && n[paramsKey][0].type !== "TSUnionType" && n[paramsKey][0].type !== "UnionTypeAnnotation" && n[paramsKey][0].type !== "TSIntersectionType" && n[paramsKey][0].type !== "IntersectionTypeAnnotation" && n[paramsKey][0].type !== "TSConditionalType" && n[paramsKey][0].type !== "TSMappedType" && n[paramsKey][0].type !== "TSTypeOperator" && n[paramsKey][0].type !== "TSIndexedAccessType" && n[paramsKey][0].type !== "TSArrayType"); + + function printDanglingCommentsForInline(n) { + if (!hasDanglingComments$1(n)) { + return ""; + } + + const hasOnlyBlockComments = n.comments.every(comments$1.isBlockComment); + const printed = comments.printDanglingComments(path, options, + /* sameIndent */ + hasOnlyBlockComments); + + if (hasOnlyBlockComments) { + return printed; + } + + return concat$b([printed, hardline$6]); + } + + if (shouldInline) { + return concat$b(["<", join$6(", ", path.map(print, paramsKey)), printDanglingCommentsForInline(n), ">"]); + } + + return group$7(concat$b(["<", indent$8(concat$b([softline$6, join$6(concat$b([",", line$8]), path.map(print, paramsKey))])), ifBreak$4(options.parser !== "typescript" && options.parser !== "babel-ts" && shouldPrintComma$3(options, "all") ? "," : ""), softline$6, ">"]), { + id: getTypeParametersGroupId(n) + }); +} + +function printClass(path, options, print) { + const n = path.getValue(); + const parts = []; + + if (n.abstract) { + parts.push("abstract "); + } + + parts.push("class"); // Keep old behaviour of extends in same line + // If there is only on extends and there are not comments + + const groupMode = n.id && hasTrailingComment$3(n.id) || n.superClass && n.superClass.comments && n.superClass.comments.length !== 0 || n.extends && n.extends.length !== 0 || // DeclareClass + n.mixins && n.mixins.length !== 0 || n.implements && n.implements.length !== 0; + const partsGroup = []; + const extendsParts = []; + + if (n.id) { + partsGroup.push(" ", path.call(print, "id")); + } + + partsGroup.push(path.call(print, "typeParameters")); + const hasMultipleHeritage = ["superClass", "extends", "mixins", "implements"].filter(key => !!n[key]).length > 1; + const shouldIndentOnlyHeritageClauses = n.typeParameters && !hasTrailingLineComment$1(n.typeParameters) && !hasMultipleHeritage; + + function printList(listName) { + if (n[listName] && n[listName].length !== 0) { + const printedLeadingComments = comments.printDanglingComments(path, options, + /* sameIndent */ + true, ({ + marker + }) => marker === listName); + extendsParts.push(shouldIndentOnlyHeritageClauses ? ifBreak$4(" ", line$8, { + groupId: getTypeParametersGroupId(n.typeParameters) + }) : line$8, printedLeadingComments, printedLeadingComments && hardline$6, listName, group$7(indent$8(concat$b([line$8, join$6(concat$b([",", line$8]), path.map(print, listName))])))); + } + } + + if (n.superClass) { + const printed = concat$b(["extends ", path.call(print, "superClass"), path.call(print, "superTypeParameters")]); + const printedWithComments = path.call(superClass => comments.printComments(superClass, () => printed, options), "superClass"); + + if (groupMode) { + extendsParts.push(line$8, group$7(printedWithComments)); + } else { + extendsParts.push(" ", printedWithComments); + } + } else { + printList("extends"); + } + + printList("mixins"); + printList("implements"); + + if (groupMode) { + const printedExtends = concat$b(extendsParts); + + if (shouldIndentOnlyHeritageClauses) { + parts.push(group$7(concat$b(partsGroup.concat(ifBreak$4(indent$8(printedExtends), printedExtends))))); + } else { + parts.push(group$7(indent$8(concat$b(partsGroup.concat(printedExtends))))); + } + } else { + parts.push(...partsGroup, ...extendsParts); + } + + parts.push(" ", path.call(print, "body")); + return parts; +} + +function separatorNoWhitespace(isFacebookTranslationTag, child, childNode, nextNode) { + if (isFacebookTranslationTag) { + return ""; + } + + if (childNode.type === "JSXElement" && !childNode.closingElement || nextNode && nextNode.type === "JSXElement" && !nextNode.closingElement) { + return child.length === 1 ? softline$6 : hardline$6; + } + + return softline$6; +} + +function separatorWithWhitespace(isFacebookTranslationTag, child, childNode, nextNode) { + if (isFacebookTranslationTag) { + return hardline$6; + } + + if (child.length === 1) { + return childNode.type === "JSXElement" && !childNode.closingElement || nextNode && nextNode.type === "JSXElement" && !nextNode.closingElement ? hardline$6 : softline$6; + } + + return hardline$6; +} // JSX Children are strange, mostly for two reasons: +// 1. JSX reads newlines into string values, instead of skipping them like JS +// 2. up to one whitespace between elements within a line is significant, +// but not between lines. +// +// Leading, trailing, and lone whitespace all need to +// turn themselves into the rather ugly `{' '}` when breaking. +// +// We print JSX using the `fill` doc primitive. +// This requires that we give it an array of alternating +// content and whitespace elements. +// To ensure this we add dummy `""` content elements as needed. + + +function printJSXChildren(path, options, print, jsxWhitespace, isFacebookTranslationTag) { + const n = path.getValue(); + const children = []; // using `map` instead of `each` because it provides `i` + + path.map((childPath, i) => { + const child = childPath.getValue(); + + if (isLiteral$1(child)) { + const text = rawText$1(child); // Contains a non-whitespace character + + if (isMeaningfulJSXText$1(child)) { + const words = text.split(matchJsxWhitespaceRegex$1); // Starts with whitespace + + if (words[0] === "") { + children.push(""); + words.shift(); + + if (/\n/.test(words[0])) { + const next = n.children[i + 1]; + children.push(separatorWithWhitespace(isFacebookTranslationTag, words[1], child, next)); + } else { + children.push(jsxWhitespace); + } + + words.shift(); + } + + let endWhitespace; // Ends with whitespace + + if (getLast$5(words) === "") { + words.pop(); + endWhitespace = words.pop(); + } // This was whitespace only without a new line. + + + if (words.length === 0) { + return; + } + + words.forEach((word, i) => { + if (i % 2 === 1) { + children.push(line$8); + } else { + children.push(word); + } + }); + + if (endWhitespace !== undefined) { + if (/\n/.test(endWhitespace)) { + const next = n.children[i + 1]; + children.push(separatorWithWhitespace(isFacebookTranslationTag, getLast$5(children), child, next)); + } else { + children.push(jsxWhitespace); + } + } else { + const next = n.children[i + 1]; + children.push(separatorNoWhitespace(isFacebookTranslationTag, getLast$5(children), child, next)); + } + } else if (/\n/.test(text)) { + // Keep (up to one) blank line between tags/expressions/text. + // Note: We don't keep blank lines between text elements. + if (text.match(/\n/g).length > 1) { + children.push(""); + children.push(hardline$6); + } + } else { + children.push(""); + children.push(jsxWhitespace); + } + } else { + const printedChild = print(childPath); + children.push(printedChild); + const next = n.children[i + 1]; + const directlyFollowedByMeaningfulText = next && isMeaningfulJSXText$1(next); + + if (directlyFollowedByMeaningfulText) { + const firstWord = rawText$1(next).trim().split(matchJsxWhitespaceRegex$1)[0]; + children.push(separatorNoWhitespace(isFacebookTranslationTag, firstWord, child, next)); + } else { + children.push(hardline$6); + } + } + }, "children"); + return children; +} // JSX expands children from the inside-out, instead of the outside-in. +// This is both to break children before attributes, +// and to ensure that when children break, their parents do as well. +// +// Any element that is written without any newlines and fits on a single line +// is left that way. +// Not only that, any user-written-line containing multiple JSX siblings +// should also be kept on one line if possible, +// so each user-written-line is wrapped in its own group. +// +// Elements that contain newlines or don't fit on a single line (recursively) +// are fully-split, using hardline and shouldBreak: true. +// +// To support that case properly, all leading and trailing spaces +// are stripped from the list of children, and replaced with a single hardline. + + +function printJSXElement(path, options, print) { + const n = path.getValue(); + + if (n.type === "JSXElement" && isEmptyJSXElement$1(n)) { + return concat$b([path.call(print, "openingElement"), path.call(print, "closingElement")]); + } + + const openingLines = n.type === "JSXElement" ? path.call(print, "openingElement") : path.call(print, "openingFragment"); + const closingLines = n.type === "JSXElement" ? path.call(print, "closingElement") : path.call(print, "closingFragment"); + + if (n.children.length === 1 && n.children[0].type === "JSXExpressionContainer" && (n.children[0].expression.type === "TemplateLiteral" || n.children[0].expression.type === "TaggedTemplateExpression")) { + return concat$b([openingLines, concat$b(path.map(print, "children")), closingLines]); + } // Convert `{" "}` to text nodes containing a space. + // This makes it easy to turn them into `jsxWhitespace` which + // can then print as either a space or `{" "}` when breaking. + + + n.children = n.children.map(child => { + if (isJSXWhitespaceExpression$1(child)) { + return { + type: "JSXText", + value: " ", + raw: " " + }; + } + + return child; + }); + const containsTag = n.children.filter(isJSXNode$3).length > 0; + const containsMultipleExpressions = n.children.filter(child => child.type === "JSXExpressionContainer").length > 1; + const containsMultipleAttributes = n.type === "JSXElement" && n.openingElement.attributes.length > 1; // Record any breaks. Should never go from true to false, only false to true. + + let forcedBreak = willBreak$3(openingLines) || containsTag || containsMultipleAttributes || containsMultipleExpressions; + const isMdxBlock = path.getParentNode().rootMarker === "mdx"; + const rawJsxWhitespace = options.singleQuote ? "{' '}" : '{" "}'; + const jsxWhitespace = isMdxBlock ? concat$b([" "]) : ifBreak$4(concat$b([rawJsxWhitespace, softline$6]), " "); + const isFacebookTranslationTag = n.openingElement && n.openingElement.name && n.openingElement.name.name === "fbt"; + const children = printJSXChildren(path, options, print, jsxWhitespace, isFacebookTranslationTag); + const containsText = n.children.some(child => isMeaningfulJSXText$1(child)); // We can end up we multiple whitespace elements with empty string + // content between them. + // We need to remove empty whitespace and softlines before JSX whitespace + // to get the correct output. + + for (let i = children.length - 2; i >= 0; i--) { + const isPairOfEmptyStrings = children[i] === "" && children[i + 1] === ""; + const isPairOfHardlines = children[i] === hardline$6 && children[i + 1] === "" && children[i + 2] === hardline$6; + const isLineFollowedByJSXWhitespace = (children[i] === softline$6 || children[i] === hardline$6) && children[i + 1] === "" && children[i + 2] === jsxWhitespace; + const isJSXWhitespaceFollowedByLine = children[i] === jsxWhitespace && children[i + 1] === "" && (children[i + 2] === softline$6 || children[i + 2] === hardline$6); + const isDoubleJSXWhitespace = children[i] === jsxWhitespace && children[i + 1] === "" && children[i + 2] === jsxWhitespace; + const isPairOfHardOrSoftLines = children[i] === softline$6 && children[i + 1] === "" && children[i + 2] === hardline$6 || children[i] === hardline$6 && children[i + 1] === "" && children[i + 2] === softline$6; + + if (isPairOfHardlines && containsText || isPairOfEmptyStrings || isLineFollowedByJSXWhitespace || isDoubleJSXWhitespace || isPairOfHardOrSoftLines) { + children.splice(i, 2); + } else if (isJSXWhitespaceFollowedByLine) { + children.splice(i + 1, 2); + } + } // Trim trailing lines (or empty strings) + + + while (children.length && (isLineNext$1(getLast$5(children)) || isEmpty$1(getLast$5(children)))) { + children.pop(); + } // Trim leading lines (or empty strings) + + + while (children.length && (isLineNext$1(children[0]) || isEmpty$1(children[0])) && (isLineNext$1(children[1]) || isEmpty$1(children[1]))) { + children.shift(); + children.shift(); + } // Tweak how we format children if outputting this element over multiple lines. + // Also detect whether we will force this element to output over multiple lines. + + + const multilineChildren = []; + children.forEach((child, i) => { + // There are a number of situations where we need to ensure we display + // whitespace as `{" "}` when outputting this element over multiple lines. + if (child === jsxWhitespace) { + if (i === 1 && children[i - 1] === "") { + if (children.length === 2) { + // Solitary whitespace + multilineChildren.push(rawJsxWhitespace); + return; + } // Leading whitespace + + + multilineChildren.push(concat$b([rawJsxWhitespace, hardline$6])); + return; + } else if (i === children.length - 1) { + // Trailing whitespace + multilineChildren.push(rawJsxWhitespace); + return; + } else if (children[i - 1] === "" && children[i - 2] === hardline$6) { + // Whitespace after line break + multilineChildren.push(rawJsxWhitespace); + return; + } + } + + multilineChildren.push(child); + + if (willBreak$3(child)) { + forcedBreak = true; + } + }); // If there is text we use `fill` to fit as much onto each line as possible. + // When there is no text (just tags and expressions) we use `group` + // to output each on a separate line. + + const content = containsText ? fill$3(multilineChildren) : group$7(concat$b(multilineChildren), { + shouldBreak: true + }); + + if (isMdxBlock) { + return content; + } + + const multiLineElem = group$7(concat$b([openingLines, indent$8(concat$b([hardline$6, content])), hardline$6, closingLines])); + + if (forcedBreak) { + return multiLineElem; + } + + return conditionalGroup$3([group$7(concat$b([openingLines, concat$b(children), closingLines])), multiLineElem]); +} + +function maybeWrapJSXElementInParens(path, elem, options) { + const parent = path.getParentNode(); + /* istanbul ignore next */ + + if (!parent) { + return elem; + } + + const NO_WRAP_PARENTS = { + ArrayExpression: true, + JSXAttribute: true, + JSXElement: true, + JSXExpressionContainer: true, + JSXFragment: true, + ExpressionStatement: true, + CallExpression: true, + OptionalCallExpression: true, + ConditionalExpression: true, + JsExpressionRoot: true + }; + + if (NO_WRAP_PARENTS[parent.type]) { + return elem; + } + + const shouldBreak = path.match(undefined, node => node.type === "ArrowFunctionExpression", isCallOrOptionalCallExpression$2, node => node.type === "JSXExpressionContainer"); + const needsParens = needsParens_1(path, options); + return group$7(concat$b([needsParens ? "" : ifBreak$4("("), indent$8(concat$b([softline$6, elem])), softline$6, needsParens ? "" : ifBreak$4(")")]), { + shouldBreak + }); +} + +function shouldInlineLogicalExpression(node) { + if (node.type !== "LogicalExpression") { + return false; + } + + if (node.right.type === "ObjectExpression" && node.right.properties.length !== 0) { + return true; + } + + if (node.right.type === "ArrayExpression" && node.right.elements.length !== 0) { + return true; + } + + if (isJSXNode$3(node.right)) { + return true; + } + + return false; +} // For binary expressions to be consistent, we need to group +// subsequent operators with the same precedence level under a single +// group. Otherwise they will be nested such that some of them break +// onto new lines but not all. Operators with the same precedence +// level should either all break or not. Because we group them by +// precedence level and the AST is structured based on precedence +// level, things are naturally broken up correctly, i.e. `&&` is +// broken before `+`. + + +function printBinaryishExpressions(path, print, options, isNested, isInsideParenthesis) { + /** @type{Doc[]} */ + let parts = []; + const node = path.getValue(); // We treat BinaryExpression and LogicalExpression nodes the same. + + if (isBinaryish$1(node)) { + // Put all operators with the same precedence level in the same + // group. The reason we only need to do this with the `left` + // expression is because given an expression like `1 + 2 - 3`, it + // is always parsed like `((1 + 2) - 3)`, meaning the `left` side + // is where the rest of the expression will exist. Binary + // expressions on the right side mean they have a difference + // precedence level and should be treated as a separate group, so + // print them normally. (This doesn't hold for the `**` operator, + // which is unique in that it is right-associative.) + if (shouldFlatten$2(node.operator, node.left.operator)) { + // Flatten them out by recursively calling this function. + parts = parts.concat(path.call(left => printBinaryishExpressions(left, print, options, + /* isNested */ + true, isInsideParenthesis), "left")); + } else { + parts.push(group$7(path.call(print, "left"))); + } + + const shouldInline = shouldInlineLogicalExpression(node); + const lineBeforeOperator = (node.operator === "|>" || node.type === "NGPipeExpression" || node.operator === "|" && options.parser === "__vue_expression") && !hasLeadingOwnLineComment$1(options.originalText, node.right, options); + const operator = node.type === "NGPipeExpression" ? "|" : node.operator; + const rightSuffix = node.type === "NGPipeExpression" && node.arguments.length !== 0 ? group$7(indent$8(concat$b([softline$6, ": ", join$6(concat$b([softline$6, ":", ifBreak$4(" ")]), path.map(print, "arguments").map(arg => align$2(2, group$7(arg))))]))) : ""; + const right = shouldInline ? concat$b([operator, " ", path.call(print, "right"), rightSuffix]) : concat$b([lineBeforeOperator ? line$8 : "", operator, lineBeforeOperator ? " " : line$8, path.call(print, "right"), rightSuffix]); // If there's only a single binary expression, we want to create a group + // in order to avoid having a small right part like -1 be on its own line. + + const parent = path.getParentNode(); + const shouldBreak = hasTrailingLineComment$1(node.left); + const shouldGroup = shouldBreak || !(isInsideParenthesis && node.type === "LogicalExpression") && parent.type !== node.type && node.left.type !== node.type && node.right.type !== node.type; + parts.push(lineBeforeOperator ? "" : " ", shouldGroup ? group$7(right, { + shouldBreak + }) : right); // The root comments are already printed, but we need to manually print + // the other ones since we don't call the normal print on BinaryExpression, + // only for the left and right parts + + if (isNested && node.comments) { + parts = normalizeParts$1(comments.printComments(path, () => concat$b(parts), options).parts); + } + } else { + // Our stopping case. Simply print the node normally. + parts.push(group$7(path.call(print))); + } + + return parts; +} + +function printAssignmentRight(leftNode, rightNode, printedRight, options) { + if (hasLeadingOwnLineComment$1(options.originalText, rightNode, options)) { + return indent$8(concat$b([line$8, printedRight])); + } + + const canBreak = isBinaryish$1(rightNode) && !shouldInlineLogicalExpression(rightNode) || rightNode.type === "ConditionalExpression" && isBinaryish$1(rightNode.test) && !shouldInlineLogicalExpression(rightNode.test) || rightNode.type === "StringLiteralTypeAnnotation" || rightNode.type === "ClassExpression" && rightNode.decorators && rightNode.decorators.length || (leftNode.type === "Identifier" || isStringLiteral$1(leftNode) || leftNode.type === "MemberExpression") && (isStringLiteral$1(rightNode) || isMemberExpressionChain$1(rightNode)) && // do not put values on a separate line from the key in json + options.parser !== "json" && options.parser !== "json5" || rightNode.type === "SequenceExpression"; + + if (canBreak) { + return group$7(indent$8(concat$b([line$8, printedRight]))); + } + + return concat$b([" ", printedRight]); +} + +function printAssignment(leftNode, printedLeft, operator, rightNode, printedRight, options) { + if (!rightNode) { + return printedLeft; + } + + const printed = printAssignmentRight(leftNode, rightNode, printedRight, options); + return group$7(concat$b([printedLeft, operator, printed])); +} + +function adjustClause(node, clause, forceSpace) { + if (node.type === "EmptyStatement") { + return ";"; + } + + if (node.type === "BlockStatement" || forceSpace) { + return concat$b([" ", clause]); + } + + return indent$8(concat$b([line$8, clause])); +} + +function nodeStr(node, options, isFlowOrTypeScriptDirectiveLiteral) { + const raw = rawText$1(node); + const isDirectiveLiteral = isFlowOrTypeScriptDirectiveLiteral || node.type === "DirectiveLiteral"; + return printString$1(raw, options, isDirectiveLiteral); +} + +function printRegex(node) { + const flags = node.flags.split("").sort().join(""); + return `/${node.pattern}/${flags}`; +} + +function exprNeedsASIProtection(path, options) { + const node = path.getValue(); + const maybeASIProblem = needsParens_1(path, options) || node.type === "ParenthesizedExpression" || node.type === "TypeCastExpression" || node.type === "ArrowFunctionExpression" && !shouldPrintParamsWithoutParens(path, options) || node.type === "ArrayExpression" || node.type === "ArrayPattern" || node.type === "UnaryExpression" && node.prefix && (node.operator === "+" || node.operator === "-") || node.type === "TemplateLiteral" || node.type === "TemplateElement" || isJSXNode$3(node) || node.type === "BindExpression" && !node.object || node.type === "RegExpLiteral" || node.type === "Literal" && node.pattern || node.type === "Literal" && node.regex; + + if (maybeASIProblem) { + return true; + } + + if (!hasNakedLeftSide$2(node)) { + return false; + } + + return path.call(childPath => exprNeedsASIProtection(childPath, options), ...getLeftSidePathName$2(path, node)); +} + +function stmtNeedsASIProtection(path, options) { + const node = path.getNode(); + + if (node.type !== "ExpressionStatement") { + return false; + } + + return path.call(childPath => exprNeedsASIProtection(childPath, options), "expression"); +} + +function shouldHugType(node) { + if (isSimpleFlowType$1(node) || isObjectType$1(node)) { + return true; + } + + if (node.type === "UnionTypeAnnotation" || node.type === "TSUnionType") { + const voidCount = node.types.filter(n => n.type === "VoidTypeAnnotation" || n.type === "TSVoidKeyword" || n.type === "NullLiteralTypeAnnotation" || n.type === "TSNullKeyword").length; + const hasObject = node.types.some(n => n.type === "ObjectTypeAnnotation" || n.type === "TSTypeLiteral" || // This is a bit aggressive but captures Array<{x}> + n.type === "GenericTypeAnnotation" || n.type === "TSTypeReference"); + + if (node.types.length - 1 === voidCount && hasObject) { + return true; + } + } + + return false; +} + +function shouldHugArguments(fun) { + if (!fun || fun.rest) { + return false; + } + + const params = fun.params || fun.parameters; + + if (!params || params.length !== 1) { + return false; + } + + const param = params[0]; + return !param.comments && (param.type === "ObjectPattern" || param.type === "ArrayPattern" || param.type === "Identifier" && param.typeAnnotation && (param.typeAnnotation.type === "TypeAnnotation" || param.typeAnnotation.type === "TSTypeAnnotation") && isObjectType$1(param.typeAnnotation.typeAnnotation) || param.type === "FunctionTypeParam" && isObjectType$1(param.typeAnnotation) || param.type === "AssignmentPattern" && (param.left.type === "ObjectPattern" || param.left.type === "ArrayPattern") && (param.right.type === "Identifier" || param.right.type === "ObjectExpression" && param.right.properties.length === 0 || param.right.type === "ArrayExpression" && param.right.elements.length === 0)); +} + +function printArrayItems(path, options, printPath, print) { + const printedElements = []; + let separatorParts = []; + path.each(childPath => { + printedElements.push(concat$b(separatorParts)); + printedElements.push(group$7(print(childPath))); + separatorParts = [",", line$8]; + + if (childPath.getValue() && isNextLineEmpty$4(options.originalText, childPath.getValue(), options.locEnd)) { + separatorParts.push(softline$6); + } + }, printPath); + return concat$b(printedElements); +} + +function printReturnAndThrowArgument(path, options, print) { + const node = path.getValue(); + const semi = options.semi ? ";" : ""; + const parts = []; + + if (node.argument) { + if (returnArgumentHasLeadingComment$1(options, node.argument)) { + parts.push(concat$b([" (", indent$8(concat$b([hardline$6, path.call(print, "argument")])), hardline$6, ")"])); + } else if (isBinaryish$1(node.argument) || node.argument.type === "SequenceExpression") { + parts.push(group$7(concat$b([ifBreak$4(" (", " "), indent$8(concat$b([softline$6, path.call(print, "argument")])), softline$6, ifBreak$4(")")]))); + } else { + parts.push(" ", path.call(print, "argument")); + } + } + + const lastComment = Array.isArray(node.comments) && node.comments[node.comments.length - 1]; + const isLastCommentLine = lastComment && (lastComment.type === "CommentLine" || lastComment.type === "Line"); + + if (isLastCommentLine) { + parts.push(semi); + } + + if (hasDanglingComments$1(node)) { + parts.push(" ", comments.printDanglingComments(path, options, + /* sameIndent */ + true)); + } + + if (!isLastCommentLine) { + parts.push(semi); + } + + return concat$b(parts); +} + +function willPrintOwnComments(path +/*, options */ +) { + const node = path.getValue(); + const parent = path.getParentNode(); + return (node && (isJSXNode$3(node) || hasFlowShorthandAnnotationComment$2(node) || parent && (parent.type === "CallExpression" || parent.type === "OptionalCallExpression") && (hasFlowAnnotationComment$1(node.leadingComments) || hasFlowAnnotationComment$1(node.trailingComments))) || parent && (parent.type === "JSXSpreadAttribute" || parent.type === "JSXSpreadChild" || parent.type === "UnionTypeAnnotation" || parent.type === "TSUnionType" || (parent.type === "ClassDeclaration" || parent.type === "ClassExpression") && parent.superClass === node)) && (!hasIgnoreComment$2(path) || parent.type === "UnionTypeAnnotation" || parent.type === "TSUnionType"); +} + +function canAttachComment(node) { + return node.type && node.type !== "CommentBlock" && node.type !== "CommentLine" && node.type !== "Line" && node.type !== "Block" && node.type !== "EmptyStatement" && node.type !== "TemplateElement" && node.type !== "Import"; +} + +function printComment$1(commentPath, options) { + const comment = commentPath.getValue(); + + switch (comment.type) { + case "CommentBlock": + case "Block": + { + if (isIndentableBlockComment(comment)) { + const printed = printIndentableBlockComment(comment); // We need to prevent an edge case of a previous trailing comment + // printed as a `lineSuffix` which causes the comments to be + // interleaved. See https://github.com/prettier/prettier/issues/4412 + + if (comment.trailing && !hasNewline$5(options.originalText, options.locStart(comment), { + backwards: true + })) { + return concat$b([hardline$6, printed]); + } + + return printed; + } + + const commentEnd = options.locEnd(comment); + const isInsideFlowComment = options.originalText.slice(commentEnd - 3, commentEnd) === "*-/"; + return "/*" + comment.value + (isInsideFlowComment ? "*-/" : "*/"); + } + + case "CommentLine": + case "Line": + // Supports `//`, `#!`, `` + return options.originalText.slice(options.locStart(comment), options.locEnd(comment)).trimEnd(); + + default: + /* istanbul ignore next */ + throw new Error("Not a comment: " + JSON.stringify(comment)); + } +} + +function isIndentableBlockComment(comment) { + // If the comment has multiple lines and every line starts with a star + // we can fix the indentation of each line. The stars in the `/*` and + // `*/` delimiters are not included in the comment value, so add them + // back first. + const lines = `*${comment.value}*`.split("\n"); + return lines.length > 1 && lines.every(line => line.trim()[0] === "*"); +} + +function printIndentableBlockComment(comment) { + const lines = comment.value.split("\n"); + return concat$b(["/*", join$6(hardline$6, lines.map((line, index) => index === 0 ? line.trimEnd() : " " + (index < lines.length - 1 ? line.trim() : line.trimStart()))), "*/"]); +} + +var printerEstree = { + preprocess: preprocess_1, + print: genericPrint, + embed: embed_1, + insertPragma: insertPragma$1, + massageAstNode: clean_1, + hasPrettierIgnore: hasPrettierIgnore$1, + willPrintOwnComments, + canAttachComment, + printComment: printComment$1, + isBlockComment: comments$1.isBlockComment, + handleComments: { + ownLine: comments$1.handleOwnLineComment, + endOfLine: comments$1.handleEndOfLineComment, + remaining: comments$1.handleRemainingComment + }, + getGapRegex: comments$1.getGapRegex, + getCommentChildNodes: comments$1.getCommentChildNodes +}; + +const { + concat: concat$c, + hardline: hardline$7, + indent: indent$9, + join: join$7 +} = document.builders; + +function genericPrint$1(path, options, print) { + const node = path.getValue(); + + switch (node.type) { + case "JsonRoot": + return concat$c([path.call(print, "node"), hardline$7]); + + case "ArrayExpression": + return node.elements.length === 0 ? "[]" : concat$c(["[", indent$9(concat$c([hardline$7, join$7(concat$c([",", hardline$7]), path.map(print, "elements"))])), hardline$7, "]"]); + + case "ObjectExpression": + return node.properties.length === 0 ? "{}" : concat$c(["{", indent$9(concat$c([hardline$7, join$7(concat$c([",", hardline$7]), path.map(print, "properties"))])), hardline$7, "}"]); + + case "ObjectProperty": + return concat$c([path.call(print, "key"), ": ", path.call(print, "value")]); + + case "UnaryExpression": + return concat$c([node.operator === "+" ? "" : node.operator, path.call(print, "argument")]); + + case "NullLiteral": + return "null"; + + case "BooleanLiteral": + return node.value ? "true" : "false"; + + case "StringLiteral": + case "NumericLiteral": + return JSON.stringify(node.value); + + case "Identifier": + return JSON.stringify(node.name); + + default: + /* istanbul ignore next */ + throw new Error("unknown type: " + JSON.stringify(node.type)); + } +} + +function clean$1(node, newNode +/*, parent*/ +) { + delete newNode.start; + delete newNode.end; + delete newNode.extra; + delete newNode.loc; + delete newNode.comments; + delete newNode.errors; + delete newNode.range; + + if (node.type === "Identifier") { + return { + type: "StringLiteral", + value: node.name + }; + } + + if (node.type === "UnaryExpression" && node.operator === "+") { + return newNode.argument; + } +} + +var printerEstreeJson = { + preprocess: preprocess_1, + print: genericPrint$1, + massageAstNode: clean$1 +}; + +const CATEGORY_COMMON = "Common"; // format based on https://github.com/prettier/prettier/blob/master/src/main/core-options.js + +var commonOptions = { + bracketSpacing: { + since: "0.0.0", + category: CATEGORY_COMMON, + type: "boolean", + default: true, + description: "Print spaces between brackets.", + oppositeDescription: "Do not print spaces between brackets." + }, + singleQuote: { + since: "0.0.0", + category: CATEGORY_COMMON, + type: "boolean", + default: false, + description: "Use single quotes instead of double quotes." + }, + proseWrap: { + since: "1.8.2", + category: CATEGORY_COMMON, + type: "choice", + default: [{ + since: "1.8.2", + value: true + }, { + since: "1.9.0", + value: "preserve" + }], + description: "How to wrap prose.", + choices: [{ + since: "1.9.0", + value: "always", + description: "Wrap prose if it exceeds the print width." + }, { + since: "1.9.0", + value: "never", + description: "Do not wrap prose." + }, { + since: "1.9.0", + value: "preserve", + description: "Wrap prose as-is." + }] + } +}; + +const CATEGORY_JAVASCRIPT = "JavaScript"; // format based on https://github.com/prettier/prettier/blob/master/src/main/core-options.js + +var options$2 = { + arrowParens: { + since: "1.9.0", + category: CATEGORY_JAVASCRIPT, + type: "choice", + default: [{ + since: "1.9.0", + value: "avoid" + }, { + since: "2.0.0", + value: "always" + }], + description: "Include parentheses around a sole arrow function parameter.", + choices: [{ + value: "always", + description: "Always include parens. Example: `(x) => x`" + }, { + value: "avoid", + description: "Omit parens when possible. Example: `x => x`" + }] + }, + bracketSpacing: commonOptions.bracketSpacing, + jsxBracketSameLine: { + since: "0.17.0", + category: CATEGORY_JAVASCRIPT, + type: "boolean", + default: false, + description: "Put > on the last line instead of at a new line." + }, + semi: { + since: "1.0.0", + category: CATEGORY_JAVASCRIPT, + type: "boolean", + default: true, + description: "Print semicolons.", + oppositeDescription: "Do not print semicolons, except at the beginning of lines which may need them." + }, + singleQuote: commonOptions.singleQuote, + jsxSingleQuote: { + since: "1.15.0", + category: CATEGORY_JAVASCRIPT, + type: "boolean", + default: false, + description: "Use single quotes in JSX." + }, + quoteProps: { + since: "1.17.0", + category: CATEGORY_JAVASCRIPT, + type: "choice", + default: "as-needed", + description: "Change when properties in objects are quoted.", + choices: [{ + value: "as-needed", + description: "Only add quotes around object properties where required." + }, { + value: "consistent", + description: "If at least one property in an object requires quotes, quote all properties." + }, { + value: "preserve", + description: "Respect the input use of quotes in object properties." + }] + }, + trailingComma: { + since: "0.0.0", + category: CATEGORY_JAVASCRIPT, + type: "choice", + default: [{ + since: "0.0.0", + value: false + }, { + since: "0.19.0", + value: "none" + }, { + since: "2.0.0", + value: "es5" + }], + description: "Print trailing commas wherever possible when multi-line.", + choices: [{ + value: "es5", + description: "Trailing commas where valid in ES5 (objects, arrays, etc.)" + }, { + value: "none", + description: "No trailing commas." + }, { + value: "all", + description: "Trailing commas wherever possible (including function arguments)." + }] + } +}; + +var name$2 = "JavaScript"; +var type = "programming"; +var tmScope = "source.js"; +var aceMode = "javascript"; +var codemirrorMode = "javascript"; +var codemirrorMimeType = "text/javascript"; +var color = "#f1e05a"; +var aliases = [ + "js", + "node" +]; +var extensions = [ + ".js", + "._js", + ".bones", + ".cjs", + ".es", + ".es6", + ".frag", + ".gs", + ".jake", + ".jsb", + ".jscad", + ".jsfl", + ".jsm", + ".jss", + ".mjs", + ".njs", + ".pac", + ".sjs", + ".ssjs", + ".xsjs", + ".xsjslib" +]; +var filenames = [ + "Jakefile" +]; +var interpreters = [ + "chakra", + "d8", + "gjs", + "js", + "node", + "qjs", + "rhino", + "v8", + "v8-shell" +]; +var languageId = 183; +var JavaScript = { + name: name$2, + type: type, + tmScope: tmScope, + aceMode: aceMode, + codemirrorMode: codemirrorMode, + codemirrorMimeType: codemirrorMimeType, + color: color, + aliases: aliases, + extensions: extensions, + filenames: filenames, + interpreters: interpreters, + languageId: languageId +}; + +var JavaScript$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$2, + type: type, + tmScope: tmScope, + aceMode: aceMode, + codemirrorMode: codemirrorMode, + codemirrorMimeType: codemirrorMimeType, + color: color, + aliases: aliases, + extensions: extensions, + filenames: filenames, + interpreters: interpreters, + languageId: languageId, + 'default': JavaScript +}); + +var name$3 = "JSX"; +var type$1 = "programming"; +var group$8 = "JavaScript"; +var extensions$1 = [ + ".jsx" +]; +var tmScope$1 = "source.js.jsx"; +var aceMode$1 = "javascript"; +var codemirrorMode$1 = "jsx"; +var codemirrorMimeType$1 = "text/jsx"; +var languageId$1 = 178; +var JSX = { + name: name$3, + type: type$1, + group: group$8, + extensions: extensions$1, + tmScope: tmScope$1, + aceMode: aceMode$1, + codemirrorMode: codemirrorMode$1, + codemirrorMimeType: codemirrorMimeType$1, + languageId: languageId$1 +}; + +var JSX$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$3, + type: type$1, + group: group$8, + extensions: extensions$1, + tmScope: tmScope$1, + aceMode: aceMode$1, + codemirrorMode: codemirrorMode$1, + codemirrorMimeType: codemirrorMimeType$1, + languageId: languageId$1, + 'default': JSX +}); + +var name$4 = "TypeScript"; +var type$2 = "programming"; +var color$1 = "#2b7489"; +var aliases$1 = [ + "ts" +]; +var interpreters$1 = [ + "deno", + "ts-node" +]; +var extensions$2 = [ + ".ts" +]; +var tmScope$2 = "source.ts"; +var aceMode$2 = "typescript"; +var codemirrorMode$2 = "javascript"; +var codemirrorMimeType$2 = "application/typescript"; +var languageId$2 = 378; +var TypeScript = { + name: name$4, + type: type$2, + color: color$1, + aliases: aliases$1, + interpreters: interpreters$1, + extensions: extensions$2, + tmScope: tmScope$2, + aceMode: aceMode$2, + codemirrorMode: codemirrorMode$2, + codemirrorMimeType: codemirrorMimeType$2, + languageId: languageId$2 +}; + +var TypeScript$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$4, + type: type$2, + color: color$1, + aliases: aliases$1, + interpreters: interpreters$1, + extensions: extensions$2, + tmScope: tmScope$2, + aceMode: aceMode$2, + codemirrorMode: codemirrorMode$2, + codemirrorMimeType: codemirrorMimeType$2, + languageId: languageId$2, + 'default': TypeScript +}); + +var name$5 = "TSX"; +var type$3 = "programming"; +var group$9 = "TypeScript"; +var extensions$3 = [ + ".tsx" +]; +var tmScope$3 = "source.tsx"; +var aceMode$3 = "javascript"; +var codemirrorMode$3 = "jsx"; +var codemirrorMimeType$3 = "text/jsx"; +var languageId$3 = 94901924; +var TSX = { + name: name$5, + type: type$3, + group: group$9, + extensions: extensions$3, + tmScope: tmScope$3, + aceMode: aceMode$3, + codemirrorMode: codemirrorMode$3, + codemirrorMimeType: codemirrorMimeType$3, + languageId: languageId$3 +}; + +var TSX$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$5, + type: type$3, + group: group$9, + extensions: extensions$3, + tmScope: tmScope$3, + aceMode: aceMode$3, + codemirrorMode: codemirrorMode$3, + codemirrorMimeType: codemirrorMimeType$3, + languageId: languageId$3, + 'default': TSX +}); + +var name$6 = "JSON"; +var type$4 = "data"; +var tmScope$4 = "source.json"; +var aceMode$4 = "json"; +var codemirrorMode$4 = "javascript"; +var codemirrorMimeType$4 = "application/json"; +var searchable = false; +var extensions$4 = [ + ".json", + ".avsc", + ".geojson", + ".gltf", + ".har", + ".ice", + ".JSON-tmLanguage", + ".jsonl", + ".mcmeta", + ".tfstate", + ".tfstate.backup", + ".topojson", + ".webapp", + ".webmanifest", + ".yy", + ".yyp" +]; +var filenames$1 = [ + ".arcconfig", + ".htmlhintrc", + ".tern-config", + ".tern-project", + ".watchmanconfig", + "composer.lock", + "mcmod.info" +]; +var languageId$4 = 174; +var _JSON = { + name: name$6, + type: type$4, + tmScope: tmScope$4, + aceMode: aceMode$4, + codemirrorMode: codemirrorMode$4, + codemirrorMimeType: codemirrorMimeType$4, + searchable: searchable, + extensions: extensions$4, + filenames: filenames$1, + languageId: languageId$4 +}; + +var _JSON$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$6, + type: type$4, + tmScope: tmScope$4, + aceMode: aceMode$4, + codemirrorMode: codemirrorMode$4, + codemirrorMimeType: codemirrorMimeType$4, + searchable: searchable, + extensions: extensions$4, + filenames: filenames$1, + languageId: languageId$4, + 'default': _JSON +}); + +var name$7 = "JSON with Comments"; +var type$5 = "data"; +var group$a = "JSON"; +var tmScope$5 = "source.js"; +var aceMode$5 = "javascript"; +var codemirrorMode$5 = "javascript"; +var codemirrorMimeType$5 = "text/javascript"; +var aliases$2 = [ + "jsonc" +]; +var extensions$5 = [ + ".jsonc", + ".sublime-build", + ".sublime-commands", + ".sublime-completions", + ".sublime-keymap", + ".sublime-macro", + ".sublime-menu", + ".sublime-mousemap", + ".sublime-project", + ".sublime-settings", + ".sublime-theme", + ".sublime-workspace", + ".sublime_metrics", + ".sublime_session" +]; +var filenames$2 = [ + ".babelrc", + ".eslintrc.json", + ".jscsrc", + ".jshintrc", + ".jslintrc", + "jsconfig.json", + "language-configuration.json", + "tsconfig.json" +]; +var languageId$5 = 423; +var JSON_with_Comments = { + name: name$7, + type: type$5, + group: group$a, + tmScope: tmScope$5, + aceMode: aceMode$5, + codemirrorMode: codemirrorMode$5, + codemirrorMimeType: codemirrorMimeType$5, + aliases: aliases$2, + extensions: extensions$5, + filenames: filenames$2, + languageId: languageId$5 +}; + +var JSON_with_Comments$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$7, + type: type$5, + group: group$a, + tmScope: tmScope$5, + aceMode: aceMode$5, + codemirrorMode: codemirrorMode$5, + codemirrorMimeType: codemirrorMimeType$5, + aliases: aliases$2, + extensions: extensions$5, + filenames: filenames$2, + languageId: languageId$5, + 'default': JSON_with_Comments +}); + +var name$8 = "JSON5"; +var type$6 = "data"; +var extensions$6 = [ + ".json5" +]; +var tmScope$6 = "source.js"; +var aceMode$6 = "javascript"; +var codemirrorMode$6 = "javascript"; +var codemirrorMimeType$6 = "application/json"; +var languageId$6 = 175; +var JSON5$1 = { + name: name$8, + type: type$6, + extensions: extensions$6, + tmScope: tmScope$6, + aceMode: aceMode$6, + codemirrorMode: codemirrorMode$6, + codemirrorMimeType: codemirrorMimeType$6, + languageId: languageId$6 +}; + +var JSON5$2 = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$8, + type: type$6, + extensions: extensions$6, + tmScope: tmScope$6, + aceMode: aceMode$6, + codemirrorMode: codemirrorMode$6, + codemirrorMimeType: codemirrorMimeType$6, + languageId: languageId$6, + 'default': JSON5$1 +}); + +var require$$0$2 = getCjsExportFromNamespace(JavaScript$1); + +var require$$1 = getCjsExportFromNamespace(JSX$1); + +var require$$2 = getCjsExportFromNamespace(TypeScript$1); + +var require$$3 = getCjsExportFromNamespace(TSX$1); + +var require$$4$1 = getCjsExportFromNamespace(_JSON$1); + +var require$$5 = getCjsExportFromNamespace(JSON_with_Comments$1); + +var require$$6 = getCjsExportFromNamespace(JSON5$2); + +const languages = [createLanguage(require$$0$2, data => ({ + since: "0.0.0", + parsers: ["babel", "flow"], + vscodeLanguageIds: ["javascript", "mongo"], + interpreters: data.interpreters.concat(["nodejs"]) +})), createLanguage(require$$0$2, () => ({ + name: "Flow", + since: "0.0.0", + parsers: ["babel", "flow"], + vscodeLanguageIds: ["javascript"], + aliases: [], + filenames: [], + extensions: [".js.flow"] +})), createLanguage(require$$1, () => ({ + since: "0.0.0", + parsers: ["babel", "flow"], + vscodeLanguageIds: ["javascriptreact"] +})), createLanguage(require$$2, () => ({ + since: "1.4.0", + parsers: ["typescript", "babel-ts"], + vscodeLanguageIds: ["typescript"] +})), createLanguage(require$$3, () => ({ + since: "1.4.0", + parsers: ["typescript", "babel-ts"], + vscodeLanguageIds: ["typescriptreact"] +})), createLanguage(require$$4$1, () => ({ + name: "JSON.stringify", + since: "1.13.0", + parsers: ["json-stringify"], + vscodeLanguageIds: ["json"], + extensions: [], + // .json file defaults to json instead of json-stringify + filenames: ["package.json", "package-lock.json", "composer.json"] +})), createLanguage(require$$4$1, data => ({ + since: "1.5.0", + parsers: ["json"], + vscodeLanguageIds: ["json"], + filenames: data.filenames.concat([".prettierrc"]) +})), createLanguage(require$$5, data => ({ + since: "1.5.0", + parsers: ["json"], + vscodeLanguageIds: ["jsonc"], + filenames: data.filenames.concat([".eslintrc"]) +})), createLanguage(require$$6, () => ({ + since: "1.13.0", + parsers: ["json5"], + vscodeLanguageIds: ["json5"] +}))]; +const printers = { + estree: printerEstree, + "estree-json": printerEstreeJson +}; +const parsers = { + // JS - Babel + get babel() { + return require("./parser-babel").parsers.babel; + }, + + get "babel-flow"() { + return require("./parser-babel").parsers["babel-flow"]; + }, + + get "babel-ts"() { + return require("./parser-babel").parsers["babel-ts"]; + }, + + get json() { + return require("./parser-babel").parsers.json; + }, + + get json5() { + return require("./parser-babel").parsers.json5; + }, + + get "json-stringify"() { + return require("./parser-babel").parsers["json-stringify"]; + }, + + get __js_expression() { + return require("./parser-babel").parsers.__js_expression; + }, + + get __vue_expression() { + return require("./parser-babel").parsers.__vue_expression; + }, + + get __vue_event_binding() { + return require("./parser-babel").parsers.__vue_event_binding; + }, + + // JS - Flow + get flow() { + return require("./parser-flow").parsers.flow; + }, + + // JS - TypeScript + get typescript() { + return require("./parser-typescript").parsers.typescript; + }, + + // JS - Angular Action + get __ng_action() { + return require("./parser-angular").parsers.__ng_action; + }, + + // JS - Angular Binding + get __ng_binding() { + return require("./parser-angular").parsers.__ng_binding; + }, + + // JS - Angular Interpolation + get __ng_interpolation() { + return require("./parser-angular").parsers.__ng_interpolation; + }, + + // JS - Angular Directive + get __ng_directive() { + return require("./parser-angular").parsers.__ng_directive; + } + +}; +var languageJs = { + languages, + options: options$2, + printers, + parsers +}; + +const { + isFrontMatterNode: isFrontMatterNode$1 +} = util; + +function clean$2(ast, newObj, parent) { + ["raw", // front-matter + "raws", "sourceIndex", "source", "before", "after", "trailingComma"].forEach(name => { + delete newObj[name]; + }); + + if (isFrontMatterNode$1(ast) && ast.lang === "yaml") { + delete newObj.value; + } + + if (ast.type === "css-comment" && parent.type === "css-root" && parent.nodes.length !== 0) { + // --insert-pragma + // first non-front-matter comment + if (parent.nodes[0] === ast || isFrontMatterNode$1(parent.nodes[0]) && parent.nodes[1] === ast) { + /** + * something + * + * @format + */ + delete newObj.text; // standalone pragma + + if (/^\*\s*@(format|prettier)\s*$/.test(ast.text)) { + return null; + } + } // Last comment is not parsed, when omitting semicolon, #8675 + + + if (parent.type === "css-root" && getLast(parent.nodes) === ast) { + return null; + } + } + + if (ast.type === "value-root") { + delete newObj.text; + } + + if (ast.type === "media-query" || ast.type === "media-query-list" || ast.type === "media-feature-expression") { + delete newObj.value; + } + + if (ast.type === "css-rule") { + delete newObj.params; + } + + if (ast.type === "selector-combinator") { + newObj.value = newObj.value.replace(/\s+/g, " "); + } + + if (ast.type === "media-feature") { + newObj.value = newObj.value.replace(/ /g, ""); + } + + if (ast.type === "value-word" && (ast.isColor && ast.isHex || ["initial", "inherit", "unset", "revert"].includes(newObj.value.replace().toLowerCase())) || ast.type === "media-feature" || ast.type === "selector-root-invalid" || ast.type === "selector-pseudo") { + newObj.value = newObj.value.toLowerCase(); + } + + if (ast.type === "css-decl") { + newObj.prop = newObj.prop.toLowerCase(); + } + + if (ast.type === "css-atrule" || ast.type === "css-import") { + newObj.name = newObj.name.toLowerCase(); + } + + if (ast.type === "value-number") { + newObj.unit = newObj.unit.toLowerCase(); + } + + if ((ast.type === "media-feature" || ast.type === "media-keyword" || ast.type === "media-type" || ast.type === "media-unknown" || ast.type === "media-url" || ast.type === "media-value" || ast.type === "selector-attribute" || ast.type === "selector-string" || ast.type === "selector-class" || ast.type === "selector-combinator" || ast.type === "value-string") && newObj.value) { + newObj.value = cleanCSSStrings(newObj.value); + } + + if (ast.type === "selector-attribute") { + newObj.attribute = newObj.attribute.trim(); + + if (newObj.namespace) { + if (typeof newObj.namespace === "string") { + newObj.namespace = newObj.namespace.trim(); + + if (newObj.namespace.length === 0) { + newObj.namespace = true; + } + } + } + + if (newObj.value) { + newObj.value = newObj.value.trim().replace(/^["']|["']$/g, ""); + delete newObj.quoted; + } + } + + if ((ast.type === "media-value" || ast.type === "media-type" || ast.type === "value-number" || ast.type === "selector-root-invalid" || ast.type === "selector-class" || ast.type === "selector-combinator" || ast.type === "selector-tag") && newObj.value) { + newObj.value = newObj.value.replace(/([\d+.Ee-]+)([A-Za-z]*)/g, (match, numStr, unit) => { + const num = Number(numStr); + return isNaN(num) ? match : num + unit.toLowerCase(); + }); + } + + if (ast.type === "selector-tag") { + const lowercasedValue = ast.value.toLowerCase(); + + if (["from", "to"].includes(lowercasedValue)) { + newObj.value = lowercasedValue; + } + } // Workaround when `postcss-values-parser` parse `not`, `and` or `or` keywords as `value-func` + + + if (ast.type === "css-atrule" && ast.name.toLowerCase() === "supports") { + delete newObj.value; + } // Workaround for SCSS nested properties + + + if (ast.type === "selector-unknown") { + delete newObj.value; + } +} + +function cleanCSSStrings(value) { + return value.replace(/'/g, '"').replace(/\\([^\dA-Fa-f])/g, "$1"); +} + +var clean_1$1 = clean$2; + +const { + builders: { + hardline: hardline$8, + concat: concat$d, + markAsRoot: markAsRoot$1 + } +} = document; +const DELIMITER_MAP = { + "---": "yaml", + "+++": "toml" +}; + +function parse$7(text) { + const delimiterRegex = Object.keys(DELIMITER_MAP).map(escapeStringRegexp).join("|"); + const match = text.match( // trailing spaces after delimiters are allowed + new RegExp(`^(${delimiterRegex})([^\\n]*)\\n(?:([\\s\\S]*?)\\n)?\\1[^\\n\\S]*(\\n|$)`)); + + if (match === null) { + return { + frontMatter: null, + content: text + }; + } + + const [raw, delimiter, language, value] = match; + let lang = DELIMITER_MAP[delimiter]; + + if (lang !== "toml" && language && language.trim()) { + lang = language.trim(); + } + + return { + frontMatter: { + type: "front-matter", + lang, + value, + raw: raw.replace(/\n$/, "") + }, + content: raw.replace(/[^\n]/g, " ") + text.slice(raw.length) + }; +} + +function print$1(node, textToDoc) { + if (node.lang === "yaml") { + const value = node.value.trim(); + const doc = value ? textToDoc(value, { + parser: "yaml" + }, { + stripTrailingHardline: true + }) : ""; + return markAsRoot$1(concat$d(["---", hardline$8, doc, doc ? hardline$8 : "", "---"])); + } +} + +var frontMatter = { + parse: parse$7, + print: print$1 +}; + +const { + builders: { + hardline: hardline$9, + concat: concat$e + } +} = document; +const { + print: printFrontMatter +} = frontMatter; + +function embed$1(path, print, textToDoc +/*, options */ +) { + const node = path.getValue(); + + if (node.type === "front-matter") { + const doc = printFrontMatter(node, textToDoc); + return doc ? concat$e([doc, hardline$9]) : ""; + } +} + +var embed_1$1 = embed$1; + +const { + parse: parseFrontMatter +} = frontMatter; + +function hasPragma$1(text) { + return pragma.hasPragma(parseFrontMatter(text).content); +} + +function insertPragma$2(text) { + const { + frontMatter, + content + } = parseFrontMatter(text); + return (frontMatter ? frontMatter.raw + "\n\n" : "") + pragma.insertPragma(content); +} + +var pragma$1 = { + hasPragma: hasPragma$1, + insertPragma: insertPragma$2 +}; + +const colorAdjusterFunctions = new Set(["red", "green", "blue", "alpha", "a", "rgb", "hue", "h", "saturation", "s", "lightness", "l", "whiteness", "w", "blackness", "b", "tint", "shade", "blend", "blenda", "contrast", "hsl", "hsla", "hwb", "hwba"]); + +function getAncestorCounter(path, typeOrTypes) { + const types = [].concat(typeOrTypes); + let counter = -1; + let ancestorNode; + + while (ancestorNode = path.getParentNode(++counter)) { + if (types.includes(ancestorNode.type)) { + return counter; + } + } + + return -1; +} + +function getAncestorNode(path, typeOrTypes) { + const counter = getAncestorCounter(path, typeOrTypes); + return counter === -1 ? null : path.getParentNode(counter); +} + +function getPropOfDeclNode(path) { + const declAncestorNode = getAncestorNode(path, "css-decl"); + return declAncestorNode && declAncestorNode.prop && declAncestorNode.prop.toLowerCase(); +} + +function hasSCSSInterpolation(groupList) { + if (groupList && groupList.length) { + for (let i = groupList.length - 1; i > 0; i--) { + // If we find `#{`, return true. + if (groupList[i].type === "word" && groupList[i].value === "{" && groupList[i - 1].type === "word" && groupList[i - 1].value.endsWith("#")) { + return true; + } + } + } + + return false; +} + +function hasStringOrFunction(groupList) { + if (groupList && groupList.length) { + for (let i = 0; i < groupList.length; i++) { + if (groupList[i].type === "string" || groupList[i].type === "func") { + return true; + } + } + } + + return false; +} + +function isSCSS(parser, text) { + const hasExplicitParserChoice = parser === "less" || parser === "scss"; + const IS_POSSIBLY_SCSS = /(\w\s*:\s*[^:}]+|#){|@import[^\n]+(?:url|,)/; + return hasExplicitParserChoice ? parser === "scss" : IS_POSSIBLY_SCSS.test(text); +} + +function isSCSSVariable(node) { + return !!(node && node.type === "word" && node.value.startsWith("$")); +} + +function isWideKeywords(value) { + return ["initial", "inherit", "unset", "revert"].includes(value.toLowerCase()); +} + +function isKeyframeAtRuleKeywords(path, value) { + const atRuleAncestorNode = getAncestorNode(path, "css-atrule"); + return atRuleAncestorNode && atRuleAncestorNode.name && atRuleAncestorNode.name.toLowerCase().endsWith("keyframes") && ["from", "to"].includes(value.toLowerCase()); +} + +function maybeToLowerCase(value) { + return value.includes("$") || value.includes("@") || value.includes("#") || value.startsWith("%") || value.startsWith("--") || value.startsWith(":--") || value.includes("(") && value.includes(")") ? value : value.toLowerCase(); +} + +function insideValueFunctionNode(path, functionName) { + const funcAncestorNode = getAncestorNode(path, "value-func"); + return funcAncestorNode && funcAncestorNode.value && funcAncestorNode.value.toLowerCase() === functionName; +} + +function insideICSSRuleNode(path) { + const ruleAncestorNode = getAncestorNode(path, "css-rule"); + return ruleAncestorNode && ruleAncestorNode.raws && ruleAncestorNode.raws.selector && (ruleAncestorNode.raws.selector.startsWith(":import") || ruleAncestorNode.raws.selector.startsWith(":export")); +} + +function insideAtRuleNode(path, atRuleNameOrAtRuleNames) { + const atRuleNames = [].concat(atRuleNameOrAtRuleNames); + const atRuleAncestorNode = getAncestorNode(path, "css-atrule"); + return atRuleAncestorNode && atRuleNames.includes(atRuleAncestorNode.name.toLowerCase()); +} + +function insideURLFunctionInImportAtRuleNode(path) { + const node = path.getValue(); + const atRuleAncestorNode = getAncestorNode(path, "css-atrule"); + return atRuleAncestorNode && atRuleAncestorNode.name === "import" && node.groups[0].value === "url" && node.groups.length === 2; +} + +function isURLFunctionNode(node) { + return node.type === "value-func" && node.value.toLowerCase() === "url"; +} + +function isLastNode(path, node) { + const parentNode = path.getParentNode(); + /* istanbul ignore next */ + + if (!parentNode) { + return false; + } + + const { + nodes + } = parentNode; + return nodes && nodes.indexOf(node) === nodes.length - 1; +} + +function isDetachedRulesetDeclarationNode(node) { + // If a Less file ends up being parsed with the SCSS parser, Less + // variable declarations will be parsed as atrules with names ending + // with a colon, so keep the original case then. + + /* istanbul ignore next */ + if (!node.selector) { + return false; + } + + return typeof node.selector === "string" && /^@.+:.*$/.test(node.selector) || node.selector.value && /^@.+:.*$/.test(node.selector.value); +} + +function isForKeywordNode(node) { + return node.type === "value-word" && ["from", "through", "end"].includes(node.value); +} + +function isIfElseKeywordNode(node) { + return node.type === "value-word" && ["and", "or", "not"].includes(node.value); +} + +function isEachKeywordNode(node) { + return node.type === "value-word" && node.value === "in"; +} + +function isMultiplicationNode(node) { + return node.type === "value-operator" && node.value === "*"; +} + +function isDivisionNode(node) { + return node.type === "value-operator" && node.value === "/"; +} + +function isAdditionNode(node) { + return node.type === "value-operator" && node.value === "+"; +} + +function isSubtractionNode(node) { + return node.type === "value-operator" && node.value === "-"; +} + +function isModuloNode(node) { + return node.type === "value-operator" && node.value === "%"; +} + +function isMathOperatorNode(node) { + return isMultiplicationNode(node) || isDivisionNode(node) || isAdditionNode(node) || isSubtractionNode(node) || isModuloNode(node); +} + +function isEqualityOperatorNode(node) { + return node.type === "value-word" && ["==", "!="].includes(node.value); +} + +function isRelationalOperatorNode(node) { + return node.type === "value-word" && ["<", ">", "<=", ">="].includes(node.value); +} + +function isSCSSControlDirectiveNode(node) { + return node.type === "css-atrule" && ["if", "else", "for", "each", "while"].includes(node.name); +} + +function isSCSSNestedPropertyNode(node) { + /* istanbul ignore next */ + if (!node.selector) { + return false; + } + + return node.selector.replace(/\/\*.*?\*\//, "").replace(/\/\/.*?\n/, "").trim().endsWith(":"); +} + +function isDetachedRulesetCallNode(node) { + return node.raws && node.raws.params && /^\(\s*\)$/.test(node.raws.params); +} + +function isTemplatePlaceholderNode(node) { + return node.name.startsWith("prettier-placeholder"); +} + +function isTemplatePropNode(node) { + return node.prop.startsWith("@prettier-placeholder"); +} + +function isPostcssSimpleVarNode(currentNode, nextNode) { + return currentNode.value === "$$" && currentNode.type === "value-func" && nextNode && nextNode.type === "value-word" && !nextNode.raws.before; +} + +function hasComposesNode(node) { + return node.value && node.value.type === "value-root" && node.value.group && node.value.group.type === "value-value" && node.prop.toLowerCase() === "composes"; +} + +function hasParensAroundNode(node) { + return node.value && node.value.group && node.value.group.group && node.value.group.group.type === "value-paren_group" && node.value.group.group.open !== null && node.value.group.group.close !== null; +} + +function hasEmptyRawBefore(node) { + return node.raws && node.raws.before === ""; +} + +function isKeyValuePairNode(node) { + return node.type === "value-comma_group" && node.groups && node.groups[1] && node.groups[1].type === "value-colon"; +} + +function isKeyValuePairInParenGroupNode(node) { + return node.type === "value-paren_group" && node.groups && node.groups[0] && isKeyValuePairNode(node.groups[0]); +} + +function isSCSSMapItemNode(path) { + const node = path.getValue(); // Ignore empty item (i.e. `$key: ()`) + + if (node.groups.length === 0) { + return false; + } + + const parentParentNode = path.getParentNode(1); // Check open parens contain key/value pair (i.e. `(key: value)` and `(key: (value, other-value)`) + + if (!isKeyValuePairInParenGroupNode(node) && !(parentParentNode && isKeyValuePairInParenGroupNode(parentParentNode))) { + return false; + } + + const declNode = getAncestorNode(path, "css-decl"); // SCSS map declaration (i.e. `$map: (key: value, other-key: other-value)`) + + if (declNode && declNode.prop && declNode.prop.startsWith("$")) { + return true; + } // List as value of key inside SCSS map (i.e. `$map: (key: (value other-value other-other-value))`) + + + if (isKeyValuePairInParenGroupNode(parentParentNode)) { + return true; + } // SCSS Map is argument of function (i.e. `func((key: value, other-key: other-value))`) + + + if (parentParentNode.type === "value-func") { + return true; + } + + return false; +} + +function isInlineValueCommentNode(node) { + return node.type === "value-comment" && node.inline; +} + +function isHashNode(node) { + return node.type === "value-word" && node.value === "#"; +} + +function isLeftCurlyBraceNode(node) { + return node.type === "value-word" && node.value === "{"; +} + +function isRightCurlyBraceNode(node) { + return node.type === "value-word" && node.value === "}"; +} + +function isWordNode(node) { + return ["value-word", "value-atword"].includes(node.type); +} + +function isColonNode(node) { + return node.type === "value-colon"; +} + +function isMediaAndSupportsKeywords(node) { + return node.value && ["not", "and", "or"].includes(node.value.toLowerCase()); +} + +function isColorAdjusterFuncNode(node) { + if (node.type !== "value-func") { + return false; + } + + return colorAdjusterFunctions.has(node.value.toLowerCase()); +} // TODO: only check `less` when we don't use `less` to parse `css` + + +function isLessParser(options) { + return options.parser === "css" || options.parser === "less"; +} + +function lastLineHasInlineComment(text) { + return /\/\//.test(text.split(/[\n\r]/).pop()); +} + +function stringifyNode(node) { + if (node.groups) { + const open = node.open && node.open.value ? node.open.value : ""; + const groups = node.groups.reduce((previousValue, currentValue, index) => { + return previousValue + stringifyNode(currentValue) + (node.groups[0].type === "comma_group" && index !== node.groups.length - 1 ? "," : ""); + }, ""); + const close = node.close && node.close.value ? node.close.value : ""; + return open + groups + close; + } + + const before = node.raws && node.raws.before ? node.raws.before : ""; + const quote = node.raws && node.raws.quote ? node.raws.quote : ""; + const atword = node.type === "atword" ? "@" : ""; + const value = node.value ? node.value : ""; + const unit = node.unit ? node.unit : ""; + const group = node.group ? stringifyNode(node.group) : ""; + const after = node.raws && node.raws.after ? node.raws.after : ""; + return before + quote + atword + value + quote + unit + group + after; +} + +var utils$7 = { + getAncestorCounter, + getAncestorNode, + getPropOfDeclNode, + hasSCSSInterpolation, + hasStringOrFunction, + maybeToLowerCase, + insideValueFunctionNode, + insideICSSRuleNode, + insideAtRuleNode, + insideURLFunctionInImportAtRuleNode, + isKeyframeAtRuleKeywords, + isWideKeywords, + isSCSS, + isSCSSVariable, + isLastNode, + isLessParser, + isSCSSControlDirectiveNode, + isDetachedRulesetDeclarationNode, + isRelationalOperatorNode, + isEqualityOperatorNode, + isMultiplicationNode, + isDivisionNode, + isAdditionNode, + isSubtractionNode, + isModuloNode, + isMathOperatorNode, + isEachKeywordNode, + isForKeywordNode, + isURLFunctionNode, + isIfElseKeywordNode, + hasComposesNode, + hasParensAroundNode, + hasEmptyRawBefore, + isSCSSNestedPropertyNode, + isDetachedRulesetCallNode, + isTemplatePlaceholderNode, + isTemplatePropNode, + isPostcssSimpleVarNode, + isKeyValuePairNode, + isKeyValuePairInParenGroupNode, + isSCSSMapItemNode, + isInlineValueCommentNode, + isHashNode, + isLeftCurlyBraceNode, + isRightCurlyBraceNode, + isWordNode, + isColonNode, + isMediaAndSupportsKeywords, + isColorAdjusterFuncNode, + lastLineHasInlineComment, + stringifyNode +}; + +const { + printNumber: printNumber$2, + printString: printString$2, + hasIgnoreComment: hasIgnoreComment$3, + hasNewline: hasNewline$6, + isFrontMatterNode: isFrontMatterNode$2, + isNextLineEmpty: isNextLineEmpty$5 +} = util; +const { + builders: { + concat: concat$f, + join: join$8, + line: line$9, + hardline: hardline$a, + softline: softline$7, + group: group$b, + fill: fill$4, + indent: indent$a, + dedent: dedent$2, + ifBreak: ifBreak$5, + breakParent: breakParent$5 + }, + utils: { + removeLines: removeLines$2 + } +} = document; +const { + insertPragma: insertPragma$3 +} = pragma$1; +const { + getAncestorNode: getAncestorNode$1, + getPropOfDeclNode: getPropOfDeclNode$1, + maybeToLowerCase: maybeToLowerCase$1, + insideValueFunctionNode: insideValueFunctionNode$1, + insideICSSRuleNode: insideICSSRuleNode$1, + insideAtRuleNode: insideAtRuleNode$1, + insideURLFunctionInImportAtRuleNode: insideURLFunctionInImportAtRuleNode$1, + isKeyframeAtRuleKeywords: isKeyframeAtRuleKeywords$1, + isWideKeywords: isWideKeywords$1, + isSCSS: isSCSS$1, + isLastNode: isLastNode$1, + isLessParser: isLessParser$1, + isSCSSControlDirectiveNode: isSCSSControlDirectiveNode$1, + isDetachedRulesetDeclarationNode: isDetachedRulesetDeclarationNode$1, + isRelationalOperatorNode: isRelationalOperatorNode$1, + isEqualityOperatorNode: isEqualityOperatorNode$1, + isMultiplicationNode: isMultiplicationNode$1, + isDivisionNode: isDivisionNode$1, + isAdditionNode: isAdditionNode$1, + isSubtractionNode: isSubtractionNode$1, + isMathOperatorNode: isMathOperatorNode$1, + isEachKeywordNode: isEachKeywordNode$1, + isForKeywordNode: isForKeywordNode$1, + isURLFunctionNode: isURLFunctionNode$1, + isIfElseKeywordNode: isIfElseKeywordNode$1, + hasComposesNode: hasComposesNode$1, + hasParensAroundNode: hasParensAroundNode$1, + hasEmptyRawBefore: hasEmptyRawBefore$1, + isKeyValuePairNode: isKeyValuePairNode$1, + isDetachedRulesetCallNode: isDetachedRulesetCallNode$1, + isTemplatePlaceholderNode: isTemplatePlaceholderNode$1, + isTemplatePropNode: isTemplatePropNode$1, + isPostcssSimpleVarNode: isPostcssSimpleVarNode$1, + isSCSSMapItemNode: isSCSSMapItemNode$1, + isInlineValueCommentNode: isInlineValueCommentNode$1, + isHashNode: isHashNode$1, + isLeftCurlyBraceNode: isLeftCurlyBraceNode$1, + isRightCurlyBraceNode: isRightCurlyBraceNode$1, + isWordNode: isWordNode$1, + isColonNode: isColonNode$1, + isMediaAndSupportsKeywords: isMediaAndSupportsKeywords$1, + isColorAdjusterFuncNode: isColorAdjusterFuncNode$1, + lastLineHasInlineComment: lastLineHasInlineComment$1 +} = utils$7; + +function shouldPrintComma$4(options) { + return options.trailingComma === "es5" || options.trailingComma === "all"; +} + +function genericPrint$2(path, options, print) { + const node = path.getValue(); + /* istanbul ignore if */ + + if (!node) { + return ""; + } + + if (typeof node === "string") { + return node; + } + + switch (node.type) { + case "front-matter": + return concat$f([node.raw, hardline$a]); + + case "css-root": + { + const nodes = printNodeSequence(path, options, print); + const after = node.raws.after.trim(); + return concat$f([nodes, after ? ` ${after}` : "", nodes.parts.length && !options.__isHTMLStyleAttribute ? hardline$a : ""]); + } + + case "css-comment": + { + const isInlineComment = node.inline || node.raws.inline; + const text = options.originalText.slice(options.locStart(node), options.locEnd(node)); + return isInlineComment ? text.trimEnd() : text; + } + + case "css-rule": + { + return concat$f([path.call(print, "selector"), node.important ? " !important" : "", node.nodes ? concat$f([node.selector && node.selector.type === "selector-unknown" && lastLineHasInlineComment$1(node.selector.value) ? line$9 : " ", "{", node.nodes.length > 0 ? indent$a(concat$f([hardline$a, printNodeSequence(path, options, print)])) : "", hardline$a, "}", isDetachedRulesetDeclarationNode$1(node) ? ";" : ""]) : ";"]); + } + + case "css-decl": + { + const parentNode = path.getParentNode(); + const { + between: rawBetween + } = node.raws; + const trimmedBetween = rawBetween.trim(); + const isColon = trimmedBetween === ":"; + let value = hasComposesNode$1(node) ? removeLines$2(path.call(print, "value")) : path.call(print, "value"); + + if (!isColon && lastLineHasInlineComment$1(trimmedBetween)) { + value = indent$a(concat$f([hardline$a, dedent$2(value)])); + } + + return concat$f([node.raws.before.replace(/[\s;]/g, ""), insideICSSRuleNode$1(path) ? node.prop : maybeToLowerCase$1(node.prop), trimmedBetween.startsWith("//") ? " " : "", trimmedBetween, node.extend ? "" : " ", isLessParser$1(options) && node.extend && node.selector ? concat$f(["extend(", path.call(print, "selector"), ")"]) : "", value, node.raws.important ? node.raws.important.replace(/\s*!\s*important/i, " !important") : node.important ? " !important" : "", node.raws.scssDefault ? node.raws.scssDefault.replace(/\s*!default/i, " !default") : node.scssDefault ? " !default" : "", node.raws.scssGlobal ? node.raws.scssGlobal.replace(/\s*!global/i, " !global") : node.scssGlobal ? " !global" : "", node.nodes ? concat$f([" {", indent$a(concat$f([softline$7, printNodeSequence(path, options, print)])), softline$7, "}"]) : isTemplatePropNode$1(node) && !parentNode.raws.semicolon && options.originalText[options.locEnd(node) - 1] !== ";" ? "" : options.__isHTMLStyleAttribute && isLastNode$1(path, node) ? ifBreak$5(";", "") : ";"]); + } + + case "css-atrule": + { + const parentNode = path.getParentNode(); + const isTemplatePlaceholderNodeWithoutSemiColon = isTemplatePlaceholderNode$1(node) && !parentNode.raws.semicolon && options.originalText[options.locEnd(node) - 1] !== ";"; + + if (isLessParser$1(options)) { + if (node.mixin) { + return concat$f([path.call(print, "selector"), node.important ? " !important" : "", isTemplatePlaceholderNodeWithoutSemiColon ? "" : ";"]); + } + + if (node.function) { + return concat$f([node.name, concat$f([path.call(print, "params")]), isTemplatePlaceholderNodeWithoutSemiColon ? "" : ";"]); + } + + if (node.variable) { + return concat$f(["@", node.name, ": ", node.value ? concat$f([path.call(print, "value")]) : "", node.raws.between.trim() ? node.raws.between.trim() + " " : "", node.nodes ? concat$f(["{", indent$a(concat$f([node.nodes.length > 0 ? softline$7 : "", printNodeSequence(path, options, print)])), softline$7, "}"]) : "", isTemplatePlaceholderNodeWithoutSemiColon ? "" : ";"]); + } + } + + return concat$f(["@", // If a Less file ends up being parsed with the SCSS parser, Less + // variable declarations will be parsed as at-rules with names ending + // with a colon, so keep the original case then. + isDetachedRulesetCallNode$1(node) || node.name.endsWith(":") ? node.name : maybeToLowerCase$1(node.name), node.params ? concat$f([isDetachedRulesetCallNode$1(node) ? "" : isTemplatePlaceholderNode$1(node) ? node.raws.afterName === "" ? "" : node.name.endsWith(":") ? " " : /^\s*\n\s*\n/.test(node.raws.afterName) ? concat$f([hardline$a, hardline$a]) : /^\s*\n/.test(node.raws.afterName) ? hardline$a : " " : " ", path.call(print, "params")]) : "", node.selector ? indent$a(concat$f([" ", path.call(print, "selector")])) : "", node.value ? group$b(concat$f([" ", path.call(print, "value"), isSCSSControlDirectiveNode$1(node) ? hasParensAroundNode$1(node) ? " " : line$9 : ""])) : node.name === "else" ? " " : "", node.nodes ? concat$f([isSCSSControlDirectiveNode$1(node) ? "" : node.selector && !node.selector.nodes && typeof node.selector.value === "string" && lastLineHasInlineComment$1(node.selector.value) || !node.selector && typeof node.params === "string" && lastLineHasInlineComment$1(node.params) ? line$9 : " ", "{", indent$a(concat$f([node.nodes.length > 0 ? softline$7 : "", printNodeSequence(path, options, print)])), softline$7, "}"]) : isTemplatePlaceholderNodeWithoutSemiColon ? "" : ";"]); + } + // postcss-media-query-parser + + case "media-query-list": + { + const parts = []; + path.each(childPath => { + const node = childPath.getValue(); + + if (node.type === "media-query" && node.value === "") { + return; + } + + parts.push(childPath.call(print)); + }, "nodes"); + return group$b(indent$a(join$8(line$9, parts))); + } + + case "media-query": + { + return concat$f([join$8(" ", path.map(print, "nodes")), isLastNode$1(path, node) ? "" : ","]); + } + + case "media-type": + { + return adjustNumbers(adjustStrings(node.value, options)); + } + + case "media-feature-expression": + { + if (!node.nodes) { + return node.value; + } + + return concat$f(["(", concat$f(path.map(print, "nodes")), ")"]); + } + + case "media-feature": + { + return maybeToLowerCase$1(adjustStrings(node.value.replace(/ +/g, " "), options)); + } + + case "media-colon": + { + return concat$f([node.value, " "]); + } + + case "media-value": + { + return adjustNumbers(adjustStrings(node.value, options)); + } + + case "media-keyword": + { + return adjustStrings(node.value, options); + } + + case "media-url": + { + return adjustStrings(node.value.replace(/^url\(\s+/gi, "url(").replace(/\s+\)$/gi, ")"), options); + } + + case "media-unknown": + { + return node.value; + } + // postcss-selector-parser + + case "selector-root": + { + return group$b(concat$f([insideAtRuleNode$1(path, "custom-selector") ? concat$f([getAncestorNode$1(path, "css-atrule").customSelector, line$9]) : "", join$8(concat$f([",", insideAtRuleNode$1(path, ["extend", "custom-selector", "nest"]) ? line$9 : hardline$a]), path.map(print, "nodes"))])); + } + + case "selector-selector": + { + return group$b(indent$a(concat$f(path.map(print, "nodes")))); + } + + case "selector-comment": + { + return node.value; + } + + case "selector-string": + { + return adjustStrings(node.value, options); + } + + case "selector-tag": + { + const parentNode = path.getParentNode(); + const index = parentNode && parentNode.nodes.indexOf(node); + const prevNode = index && parentNode.nodes[index - 1]; + return concat$f([node.namespace ? concat$f([node.namespace === true ? "" : node.namespace.trim(), "|"]) : "", prevNode.type === "selector-nesting" ? node.value : adjustNumbers(isKeyframeAtRuleKeywords$1(path, node.value) ? node.value.toLowerCase() : node.value)]); + } + + case "selector-id": + { + return concat$f(["#", node.value]); + } + + case "selector-class": + { + return concat$f([".", adjustNumbers(adjustStrings(node.value, options))]); + } + + case "selector-attribute": + { + return concat$f(["[", node.namespace ? concat$f([node.namespace === true ? "" : node.namespace.trim(), "|"]) : "", node.attribute.trim(), node.operator ? node.operator : "", node.value ? quoteAttributeValue(adjustStrings(node.value.trim(), options), options) : "", node.insensitive ? " i" : "", "]"]); + } + + case "selector-combinator": + { + if (node.value === "+" || node.value === ">" || node.value === "~" || node.value === ">>>") { + const parentNode = path.getParentNode(); + const leading = parentNode.type === "selector-selector" && parentNode.nodes[0] === node ? "" : line$9; + return concat$f([leading, node.value, isLastNode$1(path, node) ? "" : " "]); + } + + const leading = node.value.trim().startsWith("(") ? line$9 : ""; + const value = adjustNumbers(adjustStrings(node.value.trim(), options)) || line$9; + return concat$f([leading, value]); + } + + case "selector-universal": + { + return concat$f([node.namespace ? concat$f([node.namespace === true ? "" : node.namespace.trim(), "|"]) : "", node.value]); + } + + case "selector-pseudo": + { + return concat$f([maybeToLowerCase$1(node.value), node.nodes && node.nodes.length > 0 ? concat$f(["(", join$8(", ", path.map(print, "nodes")), ")"]) : ""]); + } + + case "selector-nesting": + { + return node.value; + } + + case "selector-unknown": + { + const ruleAncestorNode = getAncestorNode$1(path, "css-rule"); // Nested SCSS property + + if (ruleAncestorNode && ruleAncestorNode.isSCSSNesterProperty) { + return adjustNumbers(adjustStrings(maybeToLowerCase$1(node.value), options)); + } // originalText has to be used for Less, see replaceQuotesInInlineComments in loc.js + + + const parentNode = path.getParentNode(); + + if (parentNode.raws && parentNode.raws.selector) { + const start = options.locStart(parentNode); + const end = start + parentNode.raws.selector.length; + return options.originalText.slice(start, end).trim(); + } // Same reason above + + + const grandParent = path.getParentNode(1); + + if (parentNode.type === "value-paren_group" && grandParent && grandParent.type === "value-func" && grandParent.value === "selector") { + const start = options.locStart(parentNode.open) + 1; + const end = options.locEnd(parentNode.close) - 1; + const selector = options.originalText.slice(start, end).trim(); + return lastLineHasInlineComment$1(selector) ? concat$f([breakParent$5, selector]) : selector; + } + + return node.value; + } + // postcss-values-parser + + case "value-value": + case "value-root": + { + return path.call(print, "group"); + } + + case "value-comment": + { + return options.originalText.slice(options.locStart(node), options.locEnd(node)); + } + + case "value-comma_group": + { + const parentNode = path.getParentNode(); + const parentParentNode = path.getParentNode(1); + const declAncestorProp = getPropOfDeclNode$1(path); + const isGridValue = declAncestorProp && parentNode.type === "value-value" && (declAncestorProp === "grid" || declAncestorProp.startsWith("grid-template")); + const atRuleAncestorNode = getAncestorNode$1(path, "css-atrule"); + const isControlDirective = atRuleAncestorNode && isSCSSControlDirectiveNode$1(atRuleAncestorNode); + const printed = path.map(print, "groups"); + const parts = []; + const insideURLFunction = insideValueFunctionNode$1(path, "url"); + let insideSCSSInterpolationInString = false; + let didBreak = false; + + for (let i = 0; i < node.groups.length; ++i) { + parts.push(printed[i]); + const iPrevNode = node.groups[i - 1]; + const iNode = node.groups[i]; + const iNextNode = node.groups[i + 1]; + const iNextNextNode = node.groups[i + 2]; + + if (insideURLFunction) { + if (iNextNode && isAdditionNode$1(iNextNode) || isAdditionNode$1(iNode)) { + parts.push(" "); + } + + continue; + } // Ignore after latest node (i.e. before semicolon) + + + if (!iNextNode) { + continue; + } // styled.div` background: var(--${one}); ` + + + if (iNode.type === "value-word" && iNode.value.endsWith("-") && iNextNode.type === "value-atword" && iNextNode.value.startsWith("prettier-placeholder-")) { + continue; + } // Ignore spaces before/after string interpolation (i.e. `"#{my-fn("_")}"`) + + + const isStartSCSSInterpolationInString = iNode.type === "value-string" && iNode.value.startsWith("#{"); + const isEndingSCSSInterpolationInString = insideSCSSInterpolationInString && iNextNode.type === "value-string" && iNextNode.value.endsWith("}"); + + if (isStartSCSSInterpolationInString || isEndingSCSSInterpolationInString) { + insideSCSSInterpolationInString = !insideSCSSInterpolationInString; + continue; + } + + if (insideSCSSInterpolationInString) { + continue; + } // Ignore colon (i.e. `:`) + + + if (isColonNode$1(iNode) || isColonNode$1(iNextNode)) { + continue; + } // Ignore `@` in Less (i.e. `@@var;`) + + + if (iNode.type === "value-atword" && iNode.value === "") { + continue; + } // Ignore `~` in Less (i.e. `content: ~"^//* some horrible but needed css hack";`) + + + if (iNode.value === "~") { + continue; + } // Ignore escape `\` + + + if (iNode.value && iNode.value.includes("\\") && iNextNode && iNextNode.type !== "value-comment") { + continue; + } // Ignore escaped `/` + + + if (iPrevNode && iPrevNode.value && iPrevNode.value.indexOf("\\") === iPrevNode.value.length - 1 && iNode.type === "value-operator" && iNode.value === "/") { + continue; + } // Ignore `\` (i.e. `$variable: \@small;`) + + + if (iNode.value === "\\") { + continue; + } // Ignore `$$` (i.e. `background-color: $$(style)Color;`) + + + if (isPostcssSimpleVarNode$1(iNode, iNextNode)) { + continue; + } // Ignore spaces after `#` and after `{` and before `}` in SCSS interpolation (i.e. `#{variable}`) + + + if (isHashNode$1(iNode) || isLeftCurlyBraceNode$1(iNode) || isRightCurlyBraceNode$1(iNextNode) || isLeftCurlyBraceNode$1(iNextNode) && hasEmptyRawBefore$1(iNextNode) || isRightCurlyBraceNode$1(iNode) && hasEmptyRawBefore$1(iNextNode)) { + continue; + } // Ignore css variables and interpolation in SCSS (i.e. `--#{$var}`) + + + if (iNode.value === "--" && isHashNode$1(iNextNode)) { + continue; + } // Formatting math operations + + + const isMathOperator = isMathOperatorNode$1(iNode); + const isNextMathOperator = isMathOperatorNode$1(iNextNode); // Print spaces before and after math operators beside SCSS interpolation as is + // (i.e. `#{$var}+5`, `#{$var} +5`, `#{$var}+ 5`, `#{$var} + 5`) + // (i.e. `5+#{$var}`, `5 +#{$var}`, `5+ #{$var}`, `5 + #{$var}`) + + if ((isMathOperator && isHashNode$1(iNextNode) || isNextMathOperator && isRightCurlyBraceNode$1(iNode)) && hasEmptyRawBefore$1(iNextNode)) { + continue; + } // Print spaces before and after addition and subtraction math operators as is in `calc` function + // due to the fact that it is not valid syntax + // (i.e. `calc(1px+1px)`, `calc(1px+ 1px)`, `calc(1px +1px)`, `calc(1px + 1px)`) + + + if (insideValueFunctionNode$1(path, "calc") && (isAdditionNode$1(iNode) || isAdditionNode$1(iNextNode) || isSubtractionNode$1(iNode) || isSubtractionNode$1(iNextNode)) && hasEmptyRawBefore$1(iNextNode)) { + continue; + } // Print spaces after `+` and `-` in color adjuster functions as is (e.g. `color(red l(+ 20%))`) + // Adjusters with signed numbers (e.g. `color(red l(+20%))`) output as-is. + + + const isColorAdjusterNode = (isAdditionNode$1(iNode) || isSubtractionNode$1(iNode)) && i === 0 && (iNextNode.type === "value-number" || iNextNode.isHex) && parentParentNode && isColorAdjusterFuncNode$1(parentParentNode) && !hasEmptyRawBefore$1(iNextNode); + const requireSpaceBeforeOperator = iNextNextNode && iNextNextNode.type === "value-func" || iNextNextNode && isWordNode$1(iNextNextNode) || iNode.type === "value-func" || isWordNode$1(iNode); + const requireSpaceAfterOperator = iNextNode.type === "value-func" || isWordNode$1(iNextNode) || iPrevNode && iPrevNode.type === "value-func" || iPrevNode && isWordNode$1(iPrevNode); // Formatting `/`, `+`, `-` sign + + if (!(isMultiplicationNode$1(iNextNode) || isMultiplicationNode$1(iNode)) && !insideValueFunctionNode$1(path, "calc") && !isColorAdjusterNode && (isDivisionNode$1(iNextNode) && !requireSpaceBeforeOperator || isDivisionNode$1(iNode) && !requireSpaceAfterOperator || isAdditionNode$1(iNextNode) && !requireSpaceBeforeOperator || isAdditionNode$1(iNode) && !requireSpaceAfterOperator || isSubtractionNode$1(iNextNode) || isSubtractionNode$1(iNode)) && (hasEmptyRawBefore$1(iNextNode) || isMathOperator && (!iPrevNode || iPrevNode && isMathOperatorNode$1(iPrevNode)))) { + continue; + } // Add `hardline` after inline comment (i.e. `// comment\n foo: bar;`) + + + if (isInlineValueCommentNode$1(iNode)) { + if (parentNode.type === "value-paren_group") { + parts.push(dedent$2(hardline$a)); + continue; + } + + parts.push(hardline$a); + continue; + } // Handle keywords in SCSS control directive + + + if (isControlDirective && (isEqualityOperatorNode$1(iNextNode) || isRelationalOperatorNode$1(iNextNode) || isIfElseKeywordNode$1(iNextNode) || isEachKeywordNode$1(iNode) || isForKeywordNode$1(iNode))) { + parts.push(" "); + continue; + } // At-rule `namespace` should be in one line + + + if (atRuleAncestorNode && atRuleAncestorNode.name.toLowerCase() === "namespace") { + parts.push(" "); + continue; + } // Formatting `grid` property + + + if (isGridValue) { + if (iNode.source && iNextNode.source && iNode.source.start.line !== iNextNode.source.start.line) { + parts.push(hardline$a); + didBreak = true; + } else { + parts.push(" "); + } + + continue; + } // Add `space` before next math operation + // Note: `grip` property have `/` delimiter and it is not math operation, so + // `grid` property handles above + + + if (isNextMathOperator) { + parts.push(" "); + continue; + } // allow function(returns-list($list)...) + + + if (iNextNode && iNextNode.value === "...") { + continue; + } // Be default all values go through `line` + + + parts.push(line$9); + } + + if (didBreak) { + parts.unshift(hardline$a); + } + + if (isControlDirective) { + return group$b(indent$a(concat$f(parts))); + } // Indent is not needed for import url when url is very long + // and node has two groups + // when type is value-comma_group + // example @import url("verylongurl") projection,tv + + + if (insideURLFunctionInImportAtRuleNode$1(path)) { + return group$b(fill$4(parts)); + } + + return group$b(indent$a(fill$4(parts))); + } + + case "value-paren_group": + { + const parentNode = path.getParentNode(); + + if (parentNode && isURLFunctionNode$1(parentNode) && (node.groups.length === 1 || node.groups.length > 0 && node.groups[0].type === "value-comma_group" && node.groups[0].groups.length > 0 && node.groups[0].groups[0].type === "value-word" && node.groups[0].groups[0].value.startsWith("data:"))) { + return concat$f([node.open ? path.call(print, "open") : "", join$8(",", path.map(print, "groups")), node.close ? path.call(print, "close") : ""]); + } + + if (!node.open) { + const printed = path.map(print, "groups"); + const res = []; + + for (let i = 0; i < printed.length; i++) { + if (i !== 0) { + res.push(concat$f([",", line$9])); + } + + res.push(printed[i]); + } + + return group$b(indent$a(fill$4(res))); + } + + const isSCSSMapItem = isSCSSMapItemNode$1(path); + const lastItem = node.groups[node.groups.length - 1]; + const isLastItemComment = lastItem && lastItem.type === "value-comment"; + return group$b(concat$f([node.open ? path.call(print, "open") : "", indent$a(concat$f([softline$7, join$8(concat$f([",", line$9]), path.map(childPath => { + const node = childPath.getValue(); + const printed = print(childPath); // Key/Value pair in open paren already indented + + if (isKeyValuePairNode$1(node) && node.type === "value-comma_group" && node.groups && node.groups[2] && node.groups[2].type === "value-paren_group") { + printed.contents.contents.parts[1] = group$b(printed.contents.contents.parts[1]); + return group$b(dedent$2(printed)); + } + + return printed; + }, "groups"))])), ifBreak$5(!isLastItemComment && isSCSS$1(options.parser, options.originalText) && isSCSSMapItem && shouldPrintComma$4(options) ? "," : ""), softline$7, node.close ? path.call(print, "close") : ""]), { + shouldBreak: isSCSSMapItem + }); + } + + case "value-func": + { + return concat$f([node.value, insideAtRuleNode$1(path, "supports") && isMediaAndSupportsKeywords$1(node) ? " " : "", path.call(print, "group")]); + } + + case "value-paren": + { + return node.value; + } + + case "value-number": + { + return concat$f([printCssNumber(node.value), maybeToLowerCase$1(node.unit)]); + } + + case "value-operator": + { + return node.value; + } + + case "value-word": + { + if (node.isColor && node.isHex || isWideKeywords$1(node.value)) { + return node.value.toLowerCase(); + } + + return node.value; + } + + case "value-colon": + { + const parentNode = path.getParentNode(); + const index = parentNode && parentNode.groups.indexOf(node); + const prevNode = index && parentNode.groups[index - 1]; + return concat$f([node.value, // Don't add spaces on escaped colon `:`, e.g: grid-template-rows: [row-1-00\:00] auto; + prevNode && prevNode.value[prevNode.value.length - 1] === "\\" || // Don't add spaces on `:` in `url` function (i.e. `url(fbglyph: cross-outline, fig-white)`) + insideValueFunctionNode$1(path, "url") ? "" : line$9]); + } + // TODO: confirm this code is dead + + /* istanbul ignore next */ + + case "value-comma": + { + return concat$f([node.value, " "]); + } + + case "value-string": + { + return printString$2(node.raws.quote + node.value + node.raws.quote, options); + } + + case "value-atword": + { + return concat$f(["@", node.value]); + } + + case "value-unicode-range": + { + return node.value; + } + + case "value-unknown": + { + return node.value; + } + + default: + /* istanbul ignore next */ + throw new Error(`Unknown postcss type ${JSON.stringify(node.type)}`); + } +} + +function printNodeSequence(path, options, print) { + const node = path.getValue(); + const parts = []; + let i = 0; + path.map(pathChild => { + const prevNode = node.nodes[i - 1]; + + if (prevNode && prevNode.type === "css-comment" && prevNode.text.trim() === "prettier-ignore") { + const childNode = pathChild.getValue(); + parts.push(options.originalText.slice(options.locStart(childNode), options.locEnd(childNode))); + } else { + parts.push(pathChild.call(print)); + } + + if (i !== node.nodes.length - 1) { + if (node.nodes[i + 1].type === "css-comment" && !hasNewline$6(options.originalText, options.locStart(node.nodes[i + 1]), { + backwards: true + }) && !isFrontMatterNode$2(node.nodes[i]) || node.nodes[i + 1].type === "css-atrule" && node.nodes[i + 1].name === "else" && node.nodes[i].type !== "css-comment") { + parts.push(" "); + } else { + parts.push(options.__isHTMLStyleAttribute ? line$9 : hardline$a); + + if (isNextLineEmpty$5(options.originalText, pathChild.getValue(), options.locEnd) && !isFrontMatterNode$2(node.nodes[i])) { + parts.push(hardline$a); + } + } + } + + i++; + }, "nodes"); + return concat$f(parts); +} + +const STRING_REGEX$3 = /(["'])(?:(?!\1)[^\\]|\\[\S\s])*\1/g; +const NUMBER_REGEX = /(?:\d*\.\d+|\d+\.?)(?:[Ee][+-]?\d+)?/g; +const STANDARD_UNIT_REGEX = /[A-Za-z]+/g; +const WORD_PART_REGEX = /[$@]?[A-Z_a-z\u0080-\uFFFF][\w\u0080-\uFFFF-]*/g; +const ADJUST_NUMBERS_REGEX = new RegExp(STRING_REGEX$3.source + "|" + `(${WORD_PART_REGEX.source})?` + `(${NUMBER_REGEX.source})` + `(${STANDARD_UNIT_REGEX.source})?`, "g"); + +function adjustStrings(value, options) { + return value.replace(STRING_REGEX$3, match => printString$2(match, options)); +} + +function quoteAttributeValue(value, options) { + const quote = options.singleQuote ? "'" : '"'; + return value.includes('"') || value.includes("'") ? value : quote + value + quote; +} + +function adjustNumbers(value) { + return value.replace(ADJUST_NUMBERS_REGEX, (match, quote, wordPart, number, unit) => !wordPart && number ? printCssNumber(number) + maybeToLowerCase$1(unit || "") : match); +} + +function printCssNumber(rawNumber) { + return printNumber$2(rawNumber) // Remove trailing `.0`. + .replace(/\.0(?=$|e)/, ""); +} + +var printerPostcss = { + print: genericPrint$2, + embed: embed_1$1, + insertPragma: insertPragma$3, + hasPrettierIgnore: hasIgnoreComment$3, + massageAstNode: clean_1$1 +}; + +var options$3 = { + singleQuote: commonOptions.singleQuote +}; + +var name$9 = "CSS"; +var type$7 = "markup"; +var tmScope$7 = "source.css"; +var aceMode$7 = "css"; +var codemirrorMode$7 = "css"; +var codemirrorMimeType$7 = "text/css"; +var color$2 = "#563d7c"; +var extensions$7 = [ + ".css" +]; +var languageId$7 = 50; +var CSS = { + name: name$9, + type: type$7, + tmScope: tmScope$7, + aceMode: aceMode$7, + codemirrorMode: codemirrorMode$7, + codemirrorMimeType: codemirrorMimeType$7, + color: color$2, + extensions: extensions$7, + languageId: languageId$7 +}; + +var CSS$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$9, + type: type$7, + tmScope: tmScope$7, + aceMode: aceMode$7, + codemirrorMode: codemirrorMode$7, + codemirrorMimeType: codemirrorMimeType$7, + color: color$2, + extensions: extensions$7, + languageId: languageId$7, + 'default': CSS +}); + +var name$a = "PostCSS"; +var type$8 = "markup"; +var tmScope$8 = "source.postcss"; +var group$c = "CSS"; +var extensions$8 = [ + ".pcss", + ".postcss" +]; +var aceMode$8 = "text"; +var languageId$8 = 262764437; +var PostCSS = { + name: name$a, + type: type$8, + tmScope: tmScope$8, + group: group$c, + extensions: extensions$8, + aceMode: aceMode$8, + languageId: languageId$8 +}; + +var PostCSS$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$a, + type: type$8, + tmScope: tmScope$8, + group: group$c, + extensions: extensions$8, + aceMode: aceMode$8, + languageId: languageId$8, + 'default': PostCSS +}); + +var name$b = "Less"; +var type$9 = "markup"; +var group$d = "CSS"; +var extensions$9 = [ + ".less" +]; +var tmScope$9 = "source.css.less"; +var aceMode$9 = "less"; +var codemirrorMode$8 = "css"; +var codemirrorMimeType$8 = "text/css"; +var languageId$9 = 198; +var Less = { + name: name$b, + type: type$9, + group: group$d, + extensions: extensions$9, + tmScope: tmScope$9, + aceMode: aceMode$9, + codemirrorMode: codemirrorMode$8, + codemirrorMimeType: codemirrorMimeType$8, + languageId: languageId$9 +}; + +var Less$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$b, + type: type$9, + group: group$d, + extensions: extensions$9, + tmScope: tmScope$9, + aceMode: aceMode$9, + codemirrorMode: codemirrorMode$8, + codemirrorMimeType: codemirrorMimeType$8, + languageId: languageId$9, + 'default': Less +}); + +var name$c = "SCSS"; +var type$a = "markup"; +var tmScope$a = "source.css.scss"; +var group$e = "CSS"; +var aceMode$a = "scss"; +var codemirrorMode$9 = "css"; +var codemirrorMimeType$9 = "text/x-scss"; +var extensions$a = [ + ".scss" +]; +var languageId$a = 329; +var SCSS = { + name: name$c, + type: type$a, + tmScope: tmScope$a, + group: group$e, + aceMode: aceMode$a, + codemirrorMode: codemirrorMode$9, + codemirrorMimeType: codemirrorMimeType$9, + extensions: extensions$a, + languageId: languageId$a +}; + +var SCSS$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$c, + type: type$a, + tmScope: tmScope$a, + group: group$e, + aceMode: aceMode$a, + codemirrorMode: codemirrorMode$9, + codemirrorMimeType: codemirrorMimeType$9, + extensions: extensions$a, + languageId: languageId$a, + 'default': SCSS +}); + +var require$$0$3 = getCjsExportFromNamespace(CSS$1); + +var require$$1$1 = getCjsExportFromNamespace(PostCSS$1); + +var require$$2$1 = getCjsExportFromNamespace(Less$1); + +var require$$3$1 = getCjsExportFromNamespace(SCSS$1); + +const languages$1 = [createLanguage(require$$0$3, () => ({ + since: "1.4.0", + parsers: ["css"], + vscodeLanguageIds: ["css"] +})), createLanguage(require$$1$1, () => ({ + since: "1.4.0", + parsers: ["css"], + vscodeLanguageIds: ["postcss"] +})), createLanguage(require$$2$1, () => ({ + since: "1.4.0", + parsers: ["less"], + vscodeLanguageIds: ["less"] +})), createLanguage(require$$3$1, () => ({ + since: "1.4.0", + parsers: ["scss"], + vscodeLanguageIds: ["scss"] +}))]; +const printers$1 = { + postcss: printerPostcss +}; +const parsers$1 = { + // TODO: switch these to just `postcss` and use `language` instead. + get css() { + return require("./parser-postcss").parsers.css; + }, + + get less() { + return require("./parser-postcss").parsers.less; + }, + + get scss() { + return require("./parser-postcss").parsers.scss; + } + +}; +var languageCss = { + languages: languages$1, + options: options$3, + printers: printers$1, + parsers: parsers$1 +}; + +var clean$3 = function (ast, newNode) { + delete newNode.loc; + delete newNode.selfClosing; // (Glimmer/HTML) ignore TextNode whitespace + + if (ast.type === "TextNode") { + const trimmed = ast.chars.trim(); + + if (!trimmed) { + return null; + } + + newNode.chars = trimmed; + } +}; + +var index = [ + "area", + "base", + "basefont", + "bgsound", + "br", + "col", + "command", + "embed", + "frame", + "hr", + "image", + "img", + "input", + "isindex", + "keygen", + "link", + "menuitem", + "meta", + "nextid", + "param", + "source", + "track", + "wbr" +]; + +var htmlVoidElements = /*#__PURE__*/Object.freeze({ + __proto__: null, + 'default': index +}); + +var htmlVoidElements$1 = getCjsExportFromNamespace(htmlVoidElements); + +function isUppercase(string) { + return string.toUpperCase() === string; +} + +function isGlimmerComponent(node) { + return isNodeOfSomeType(node, ["ElementNode"]) && typeof node.tag === "string" && (isUppercase(node.tag[0]) || node.tag.includes(".")); +} + +const voidTags = new Set(htmlVoidElements$1); + +function isVoid(node) { + return isGlimmerComponent(node) && (node.children === 0 || node.children.every(n => isWhitespaceNode(n))) || voidTags.has(node.tag); +} + +function isWhitespaceNode(node) { + return isNodeOfSomeType(node, ["TextNode"]) && !/\S/.test(node.chars); +} + +function isNodeOfSomeType(node, types) { + return node && types.some(type => node.type === type); +} + +function isParentOfSomeType(path, types) { + const parentNode = path.getParentNode(0); + return isNodeOfSomeType(parentNode, types); +} + +function isPreviousNodeOfSomeType(path, types) { + const previousNode = getPreviousNode(path); + return isNodeOfSomeType(previousNode, types); +} + +function isNextNodeOfSomeType(path, types) { + const nextNode = getNextNode(path); + return isNodeOfSomeType(nextNode, types); +} + +function getSiblingNode(path, offset) { + const node = path.getValue(); + const parentNode = path.getParentNode(0) || {}; + const children = parentNode.children || parentNode.body || parentNode.parts || []; + const index = children.indexOf(node); + return index !== -1 && children[index + offset]; +} + +function getPreviousNode(path, lookBack = 1) { + return getSiblingNode(path, -lookBack); +} + +function getNextNode(path) { + return getSiblingNode(path, 1); +} + +function isPrettierIgnoreNode(node) { + return isNodeOfSomeType(node, ["MustacheCommentStatement"]) && typeof node.value === "string" && node.value.trim() === "prettier-ignore"; +} + +function hasPrettierIgnore$2(path) { + const node = path.getValue(); + const previousPreviousNode = getPreviousNode(path, 2); + return isPrettierIgnoreNode(node) || isPrettierIgnoreNode(previousPreviousNode); +} + +var utils$8 = { + getNextNode, + getPreviousNode, + hasPrettierIgnore: hasPrettierIgnore$2, + isNextNodeOfSomeType, + isNodeOfSomeType, + isParentOfSomeType, + isPreviousNodeOfSomeType, + isVoid, + isWhitespaceNode +}; + +const { + concat: concat$g, + group: group$f, + hardline: hardline$b, + ifBreak: ifBreak$6, + indent: indent$b, + join: join$9, + line: line$a, + softline: softline$8 +} = document.builders; +const { + getNextNode: getNextNode$1, + getPreviousNode: getPreviousNode$1, + hasPrettierIgnore: hasPrettierIgnore$3, + isNextNodeOfSomeType: isNextNodeOfSomeType$1, + isNodeOfSomeType: isNodeOfSomeType$1, + isParentOfSomeType: isParentOfSomeType$1, + isPreviousNodeOfSomeType: isPreviousNodeOfSomeType$1, + isVoid: isVoid$1, + isWhitespaceNode: isWhitespaceNode$1 +} = utils$8; // Formatter based on @glimmerjs/syntax's built-in test formatter: +// https://github.com/glimmerjs/glimmer-vm/blob/master/packages/%40glimmer/syntax/lib/generation/print.ts + +function print$2(path, options, print) { + const n = path.getValue(); + /* istanbul ignore if*/ + + if (!n) { + return ""; + } + + if (hasPrettierIgnore$3(path)) { + const startOffset = locationToOffset(options.originalText, n.loc.start.line - 1, n.loc.start.column); + const endOffset = locationToOffset(options.originalText, n.loc.end.line - 1, n.loc.end.column); + const ignoredText = options.originalText.slice(startOffset, endOffset); + return ignoredText; + } + + switch (n.type) { + case "Block": + case "Program": + case "Template": + { + return group$f(concat$g(path.map(print, "body"))); + } + + case "ElementNode": + { + // TODO: make it whitespace sensitive + const bim = isNextNodeOfSomeType$1(path, ["ElementNode"]) ? hardline$b : ""; + + if (isVoid$1(n)) { + return concat$g([group$f(printStartingTag(path, print)), bim]); + } + + const isWhitespaceOnly = n.children.every(n => isWhitespaceNode$1(n)); + return concat$g([group$f(printStartingTag(path, print)), group$f(concat$g([isWhitespaceOnly ? "" : indent$b(printChildren(path, options, print)), n.children.length ? hardline$b : "", concat$g([""])])), bim]); + } + + case "BlockStatement": + { + const pp = path.getParentNode(1); + const isElseIf = pp && pp.inverse && pp.inverse.body.length === 1 && pp.inverse.body[0] === n && pp.inverse.body[0].path.parts[0] === "if"; + + if (isElseIf) { + return concat$g([printElseIfBlock(path, print), printProgram(path, print), printInverse(path, print)]); + } + + return concat$g([printOpenBlock(path, print), group$f(concat$g([printProgram(path, print), printInverse(path, print), printCloseBlock(path, print)]))]); + } + + case "ElementModifierStatement": + { + return group$f(concat$g(["{{", printPathAndParams(path, print), softline$8, "}}"])); + } + + case "MustacheStatement": + { + const isParentOfSpecifiedTypes = isParentOfSomeType$1(path, ["AttrNode", "ConcatStatement"]); + const isChildOfElementNodeAndDoesNotHaveParams = isParentOfSomeType$1(path, ["ElementNode"]) && doesNotHaveHashParams(n) && doesNotHavePositionalParams(n); + const shouldBreakOpeningMustache = isParentOfSpecifiedTypes || isChildOfElementNodeAndDoesNotHaveParams; + return group$f(concat$g([printOpeningMustache(n), shouldBreakOpeningMustache ? indent$b(softline$8) : "", printPathAndParams(path, print), softline$8, printClosingMustache(n)])); + } + + case "SubExpression": + { + return group$f(concat$g(["(", printSubExpressionPathAndParams(path, print), softline$8, ")"])); + } + + case "AttrNode": + { + const isText = n.value.type === "TextNode"; + const isEmptyText = isText && n.value.chars === ""; // If the text is empty and the value's loc start and end columns are the + // same, there is no value for this AttrNode and it should be printed + // without the `=""`. Example: `` -> `` + + const isEmptyValue = isEmptyText && n.value.loc.start.column === n.value.loc.end.column; + + if (isEmptyValue) { + return concat$g([n.name]); + } + + const value = path.call(print, "value"); + const quotedValue = isText ? printStringLiteral(value.parts.join(), options) : value; + return concat$g([n.name, "=", quotedValue]); + } + + case "ConcatStatement": + { + const quote = options.singleQuote ? "'" : '"'; + return concat$g([quote, ...path.map(partPath => print(partPath), "parts"), quote]); + } + + case "Hash": + { + return concat$g([join$9(line$a, path.map(print, "pairs"))]); + } + + case "HashPair": + { + return concat$g([n.key, "=", path.call(print, "value")]); + } + + case "TextNode": + { + const maxLineBreaksToPreserve = 2; + const isFirstElement = !getPreviousNode$1(path); + const isLastElement = !getNextNode$1(path); + const isWhitespaceOnly = !/\S/.test(n.chars); + const lineBreaksCount = countNewLines(n.chars); + let leadingLineBreaksCount = countLeadingNewLines(n.chars); + let trailingLineBreaksCount = countTrailingNewLines(n.chars); + + if ((isFirstElement || isLastElement) && isWhitespaceOnly && isParentOfSomeType$1(path, ["Block", "ElementNode", "Template"])) { + return ""; + } + + if (isWhitespaceOnly && lineBreaksCount) { + leadingLineBreaksCount = Math.min(lineBreaksCount, maxLineBreaksToPreserve); + trailingLineBreaksCount = 0; + } else { + if (isNextNodeOfSomeType$1(path, ["BlockStatement", "ElementNode"])) { + trailingLineBreaksCount = Math.max(trailingLineBreaksCount, 1); + } + + if (isPreviousNodeOfSomeType$1(path, ["BlockStatement", "ElementNode"])) { + leadingLineBreaksCount = Math.max(leadingLineBreaksCount, 1); + } + } + + const inAttrNode = path.stack.includes("attributes"); + + if (inAttrNode) { + // TODO: format style and srcset attributes + // and cleanup concat that is not necessary + if (!isInAttributeOfName(path, "class")) { + return concat$g([n.chars]); + } + + let leadingSpace = ""; + let trailingSpace = ""; + + if (isParentOfSomeType$1(path, ["ConcatStatement"])) { + if (isPreviousNodeOfSomeType$1(path, ["MustacheStatement"])) { + leadingSpace = " "; + } + + if (isNextNodeOfSomeType$1(path, ["MustacheStatement"])) { + trailingSpace = " "; + } + } + + return concat$g([...generateHardlines(leadingLineBreaksCount, maxLineBreaksToPreserve), n.chars.replace(/^\s+/g, leadingSpace).replace(/\s+$/, trailingSpace), ...generateHardlines(trailingLineBreaksCount, maxLineBreaksToPreserve)]); + } + + let leadingSpace = ""; + let trailingSpace = ""; + + if (trailingLineBreaksCount === 0 && isNextNodeOfSomeType$1(path, ["MustacheStatement"])) { + trailingSpace = " "; + } + + if (leadingLineBreaksCount === 0 && isPreviousNodeOfSomeType$1(path, ["MustacheStatement"])) { + leadingSpace = " "; + } + + if (isFirstElement) { + leadingLineBreaksCount = 0; + leadingSpace = ""; + } + + if (isLastElement) { + trailingLineBreaksCount = 0; + trailingSpace = ""; + } + + let text = n.chars; + /* if `{{my-component}}` (or any text starting with a mustache) + * makes it to the TextNode, + * it means it was escaped, + * so let's print it escaped, ie.; `\{{my-component}}` */ + + if (text.startsWith("{{") && text.includes("}}")) { + text = "\\" + text; + } + + return concat$g([...generateHardlines(leadingLineBreaksCount, maxLineBreaksToPreserve), text.replace(/^\s+/g, leadingSpace).replace(/\s+$/, trailingSpace), ...generateHardlines(trailingLineBreaksCount, maxLineBreaksToPreserve)]); + } + + case "MustacheCommentStatement": + { + const dashes = n.value.includes("}}") ? "--" : ""; + return concat$g(["{{!", dashes, n.value, dashes, "}}"]); + } + + case "PathExpression": + { + return n.original; + } + + case "BooleanLiteral": + { + return String(n.value); + } + + case "CommentStatement": + { + return concat$g([""]); + } + + case "StringLiteral": + { + return printStringLiteral(n.value, options); + } + + case "NumberLiteral": + { + return String(n.value); + } + + case "UndefinedLiteral": + { + return "undefined"; + } + + case "NullLiteral": + { + return "null"; + } + + /* istanbul ignore next */ + + default: + throw new Error("unknown glimmer type: " + JSON.stringify(n.type)); + } +} +/* ElementNode print helpers */ + + +function printStartingTag(path, print) { + const node = path.getValue(); + return concat$g(["<", node.tag, printAttributesLike(path, print), printBlockParams(node), printStartingTagEndMarker(node)]); +} + +function printAttributesLike(path, print) { + const node = path.getValue(); + return indent$b(concat$g([node.attributes.length ? line$a : "", join$9(line$a, path.map(print, "attributes")), node.modifiers.length ? line$a : "", join$9(line$a, path.map(print, "modifiers")), node.comments.length ? line$a : "", join$9(line$a, path.map(print, "comments"))])); +} + +function printChildren(path, options, print) { + return concat$g(path.map((childPath, childIndex) => { + if (childIndex === 0) { + return concat$g([softline$8, print(childPath, options, print)]); + } + + return print(childPath, options, print); + }, "children")); +} + +function printStartingTagEndMarker(node) { + if (isVoid$1(node)) { + return ifBreak$6(concat$g([softline$8, "/>"]), concat$g([" />", softline$8])); + } + + return ifBreak$6(concat$g([softline$8, ">"]), ">"); +} +/* MustacheStatement print helpers */ + + +function printOpeningMustache(node) { + const mustache = node.escaped === false ? "{{{" : "{{"; + const strip = node.strip && node.strip.open ? "~" : ""; + return concat$g([mustache, strip]); +} + +function printClosingMustache(node) { + const mustache = node.escaped === false ? "}}}" : "}}"; + const strip = node.strip && node.strip.close ? "~" : ""; + return concat$g([strip, mustache]); +} +/* BlockStatement print helpers */ + + +function printOpeningBlockOpeningMustache(node) { + const opening = printOpeningMustache(node); + const strip = node.openStrip.open ? "~" : ""; + return concat$g([opening, strip, "#"]); +} + +function printOpeningBlockClosingMustache(node) { + const closing = printClosingMustache(node); + const strip = node.openStrip.close ? "~" : ""; + return concat$g([strip, closing]); +} + +function printClosingBlockOpeningMustache(node) { + const opening = printOpeningMustache(node); + const strip = node.closeStrip.open ? "~" : ""; + return concat$g([opening, strip, "/"]); +} + +function printClosingBlockClosingMustache(node) { + const closing = printClosingMustache(node); + const strip = node.closeStrip.close ? "~" : ""; + return concat$g([strip, closing]); +} + +function printInverseBlockOpeningMustache(node) { + const opening = printOpeningMustache(node); + const strip = node.inverseStrip.open ? "~" : ""; + return concat$g([opening, strip]); +} + +function printInverseBlockClosingMustache(node) { + const closing = printClosingMustache(node); + const strip = node.inverseStrip.close ? "~" : ""; + return concat$g([strip, closing]); +} + +function printOpenBlock(path, print) { + const node = path.getValue(); + return group$f(concat$g([printOpeningBlockOpeningMustache(node), printPathAndParams(path, print), printBlockParams(node.program), softline$8, printOpeningBlockClosingMustache(node)])); +} + +function printElseBlock(node) { + return concat$g([hardline$b, printInverseBlockOpeningMustache(node), "else", printInverseBlockClosingMustache(node)]); +} + +function printElseIfBlock(path, print) { + const parentNode = path.getParentNode(1); + return concat$g([printInverseBlockOpeningMustache(parentNode), "else ", printPathAndParams(path, print), printInverseBlockClosingMustache(parentNode)]); +} + +function printCloseBlock(path, print) { + const node = path.getValue(); + return concat$g([blockStatementHasOnlyWhitespaceInProgram(node) ? softline$8 : hardline$b, printClosingBlockOpeningMustache(node), path.call(print, "path"), printClosingBlockClosingMustache(node)]); +} + +function blockStatementHasOnlyWhitespaceInProgram(node) { + return isNodeOfSomeType$1(node, ["BlockStatement"]) && node.program.body.every(n => isWhitespaceNode$1(n)); +} + +function blockStatementHasElseIf(node) { + return blockStatementHasElse(node) && node.inverse.body.length === 1 && isNodeOfSomeType$1(node.inverse.body[0], ["BlockStatement"]) && node.inverse.body[0].path.parts[0] === "if"; +} + +function blockStatementHasElse(node) { + return isNodeOfSomeType$1(node, ["BlockStatement"]) && node.inverse; +} + +function printProgram(path, print) { + const node = path.getValue(); + + if (blockStatementHasOnlyWhitespaceInProgram(node)) { + return ""; + } + + const program = path.call(print, "program"); + return indent$b(concat$g([hardline$b, program])); +} + +function printInverse(path, print) { + const node = path.getValue(); + const inverse = path.call(print, "inverse"); + const parts = concat$g([hardline$b, inverse]); + + if (blockStatementHasElseIf(node)) { + return parts; + } + + if (blockStatementHasElse(node)) { + return concat$g([printElseBlock(node), indent$b(parts)]); + } + + return ""; +} +/* TextNode print helpers */ + + +function isInAttributeOfName(path, type) { + return isParentOfSomeType$1(path, ["AttrNode"]) && path.getParentNode().name.toLowerCase() === type || isParentOfSomeType$1(path, ["ConcatStatement"]) && path.getParentNode(1).name.toLowerCase() === type; +} + +function countNewLines(string) { + /* istanbul ignore next */ + string = typeof string === "string" ? string : ""; + return string.split("\n").length - 1; +} + +function countLeadingNewLines(string) { + /* istanbul ignore next */ + string = typeof string === "string" ? string : ""; + const newLines = (string.match(/^([^\S\n\r]*[\n\r])+/g) || [])[0] || ""; + return countNewLines(newLines); +} + +function countTrailingNewLines(string) { + /* istanbul ignore next */ + string = typeof string === "string" ? string : ""; + const newLines = (string.match(/([\n\r][^\S\n\r]*)+$/g) || [])[0] || ""; + return countNewLines(newLines); +} + +function generateHardlines(number = 0, max = 0) { + return new Array(Math.min(number, max)).fill(hardline$b); +} +/* StringLiteral print helpers */ + +/** + * Prints a string literal with the correct surrounding quotes based on + * `options.singleQuote` and the number of escaped quotes contained in + * the string literal. This function is the glimmer equivalent of `printString` + * in `common/util`, but has differences because of the way escaped characters + * are treated in hbs string literals. + * @param {string} stringLiteral - the string literal value + * @param {object} options - the prettier options object + */ + + +function printStringLiteral(stringLiteral, options) { + const double = { + quote: '"', + regex: /"/g + }; + const single = { + quote: "'", + regex: /'/g + }; + const preferred = options.singleQuote ? single : double; + const alternate = preferred === single ? double : single; + let shouldUseAlternateQuote = false; // If `stringLiteral` contains at least one of the quote preferred for + // enclosing the string, we might want to enclose with the alternate quote + // instead, to minimize the number of escaped quotes. + + if (stringLiteral.includes(preferred.quote) || stringLiteral.includes(alternate.quote)) { + const numPreferredQuotes = (stringLiteral.match(preferred.regex) || []).length; + const numAlternateQuotes = (stringLiteral.match(alternate.regex) || []).length; + shouldUseAlternateQuote = numPreferredQuotes > numAlternateQuotes; + } + + const enclosingQuote = shouldUseAlternateQuote ? alternate : preferred; + const escapedStringLiteral = stringLiteral.replace(enclosingQuote.regex, `\\${enclosingQuote.quote}`); + return concat$g([enclosingQuote.quote, escapedStringLiteral, enclosingQuote.quote]); +} +/* SubExpression print helpers */ + + +function printSubExpressionPathAndParams(path, print) { + const p = printPath(path, print); + const params = printParams(path, print); + + if (!params) { + return p; + } + + return indent$b(concat$g([p, line$a, group$f(params)])); +} +/* misc. print helpers */ + + +function printPathAndParams(path, print) { + const p = printPath(path, print); + const params = printParams(path, print); + + if (!params) { + return p; + } + + return indent$b(group$f(concat$g([p, line$a, params]))); +} + +function printPath(path, print) { + return path.call(print, "path"); +} + +function printParams(path, print) { + const node = path.getValue(); + const parts = []; + + if (node.params.length) { + const params = path.map(print, "params"); + parts.push(...params); + } + + if (node.hash && node.hash.pairs.length > 0) { + const hash = path.call(print, "hash"); + parts.push(hash); + } + + if (!parts.length) { + return ""; + } + + return join$9(line$a, parts); +} + +function printBlockParams(node) { + if (!node || !node.blockParams.length) { + return ""; + } + + return concat$g([" as |", node.blockParams.join(" "), "|"]); +} +/* istanbul ignore next + https://github.com/glimmerjs/glimmer-vm/blob/master/packages/%40glimmer/compiler/lib/location.ts#L5-L29 +*/ + + +function locationToOffset(source, line, column) { + let seenLines = 0; + let seenChars = 0; // eslint-disable-next-line no-constant-condition + + while (true) { + if (seenChars === source.length) { + return null; + } + + let nextLine = source.indexOf("\n", seenChars); + + if (nextLine === -1) { + nextLine = source.length; + } + + if (seenLines === line) { + if (seenChars + column > nextLine) { + return null; + } + + return seenChars + column; + } else if (nextLine === -1) { + return null; + } + + seenLines += 1; + seenChars = nextLine + 1; + } +} + +function doesNotHaveHashParams(node) { + return node.hash.pairs.length === 0; +} + +function doesNotHavePositionalParams(node) { + return node.params.length === 0; +} + +var printerGlimmer = { + print: print$2, + massageAstNode: clean$3 +}; + +var name$d = "Handlebars"; +var type$b = "markup"; +var group$g = "HTML"; +var aliases$3 = [ + "hbs", + "htmlbars" +]; +var extensions$b = [ + ".handlebars", + ".hbs" +]; +var tmScope$b = "text.html.handlebars"; +var aceMode$b = "handlebars"; +var languageId$b = 155; +var Handlebars = { + name: name$d, + type: type$b, + group: group$g, + aliases: aliases$3, + extensions: extensions$b, + tmScope: tmScope$b, + aceMode: aceMode$b, + languageId: languageId$b +}; + +var Handlebars$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$d, + type: type$b, + group: group$g, + aliases: aliases$3, + extensions: extensions$b, + tmScope: tmScope$b, + aceMode: aceMode$b, + languageId: languageId$b, + 'default': Handlebars +}); + +var require$$0$4 = getCjsExportFromNamespace(Handlebars$1); + +const languages$2 = [createLanguage(require$$0$4, () => ({ + since: null, + // unreleased + parsers: ["glimmer"], + vscodeLanguageIds: ["handlebars"] +}))]; +const printers$2 = { + glimmer: printerGlimmer +}; +const parsers$2 = { + get glimmer() { + return require("./parser-glimmer").parsers.glimmer; + } + +}; +var languageHandlebars = { + languages: languages$2, + printers: printers$2, + parsers: parsers$2 +}; + +function hasPragma$2(text) { + return /^\s*#[^\S\n]*@(format|prettier)\s*(\n|$)/.test(text); +} + +function insertPragma$4(text) { + return "# @format\n\n" + text; +} + +var pragma$2 = { + hasPragma: hasPragma$2, + insertPragma: insertPragma$4 +}; + +const { + concat: concat$h, + join: join$a, + hardline: hardline$c, + line: line$b, + softline: softline$9, + group: group$h, + indent: indent$c, + ifBreak: ifBreak$7 +} = document.builders; +const { + hasIgnoreComment: hasIgnoreComment$4, + isNextLineEmpty: isNextLineEmpty$6 +} = util; +const { + insertPragma: insertPragma$5 +} = pragma$2; + +function genericPrint$3(path, options, print) { + const n = path.getValue(); + + if (!n) { + return ""; + } + + if (typeof n === "string") { + return n; + } + + switch (n.kind) { + case "Document": + { + const parts = []; + path.map((pathChild, index) => { + parts.push(concat$h([pathChild.call(print)])); + + if (index !== n.definitions.length - 1) { + parts.push(hardline$c); + + if (isNextLineEmpty$6(options.originalText, pathChild.getValue(), options.locEnd)) { + parts.push(hardline$c); + } + } + }, "definitions"); + return concat$h([concat$h(parts), hardline$c]); + } + + case "OperationDefinition": + { + const hasOperation = options.originalText[options.locStart(n)] !== "{"; + const hasName = !!n.name; + return concat$h([hasOperation ? n.operation : "", hasOperation && hasName ? concat$h([" ", path.call(print, "name")]) : "", n.variableDefinitions && n.variableDefinitions.length ? group$h(concat$h(["(", indent$c(concat$h([softline$9, join$a(concat$h([ifBreak$7("", ", "), softline$9]), path.map(print, "variableDefinitions"))])), softline$9, ")"])) : "", printDirectives(path, print, n), n.selectionSet ? !hasOperation && !hasName ? "" : " " : "", path.call(print, "selectionSet")]); + } + + case "FragmentDefinition": + { + return concat$h(["fragment ", path.call(print, "name"), n.variableDefinitions && n.variableDefinitions.length ? group$h(concat$h(["(", indent$c(concat$h([softline$9, join$a(concat$h([ifBreak$7("", ", "), softline$9]), path.map(print, "variableDefinitions"))])), softline$9, ")"])) : "", " on ", path.call(print, "typeCondition"), printDirectives(path, print, n), " ", path.call(print, "selectionSet")]); + } + + case "SelectionSet": + { + return concat$h(["{", indent$c(concat$h([hardline$c, join$a(hardline$c, path.call(selectionsPath => printSequence(selectionsPath, options, print), "selections"))])), hardline$c, "}"]); + } + + case "Field": + { + return group$h(concat$h([n.alias ? concat$h([path.call(print, "alias"), ": "]) : "", path.call(print, "name"), n.arguments.length > 0 ? group$h(concat$h(["(", indent$c(concat$h([softline$9, join$a(concat$h([ifBreak$7("", ", "), softline$9]), path.call(argsPath => printSequence(argsPath, options, print), "arguments"))])), softline$9, ")"])) : "", printDirectives(path, print, n), n.selectionSet ? " " : "", path.call(print, "selectionSet")])); + } + + case "Name": + { + return n.value; + } + + case "StringValue": + { + if (n.block) { + return concat$h(['"""', hardline$c, join$a(hardline$c, n.value.replace(/"""/g, "\\$&").split("\n")), hardline$c, '"""']); + } + + return concat$h(['"', n.value.replace(/["\\]/g, "\\$&").replace(/\n/g, "\\n"), '"']); + } + + case "IntValue": + case "FloatValue": + case "EnumValue": + { + return n.value; + } + + case "BooleanValue": + { + return n.value ? "true" : "false"; + } + + case "NullValue": + { + return "null"; + } + + case "Variable": + { + return concat$h(["$", path.call(print, "name")]); + } + + case "ListValue": + { + return group$h(concat$h(["[", indent$c(concat$h([softline$9, join$a(concat$h([ifBreak$7("", ", "), softline$9]), path.map(print, "values"))])), softline$9, "]"])); + } + + case "ObjectValue": + { + return group$h(concat$h(["{", options.bracketSpacing && n.fields.length > 0 ? " " : "", indent$c(concat$h([softline$9, join$a(concat$h([ifBreak$7("", ", "), softline$9]), path.map(print, "fields"))])), softline$9, ifBreak$7("", options.bracketSpacing && n.fields.length > 0 ? " " : ""), "}"])); + } + + case "ObjectField": + case "Argument": + { + return concat$h([path.call(print, "name"), ": ", path.call(print, "value")]); + } + + case "Directive": + { + return concat$h(["@", path.call(print, "name"), n.arguments.length > 0 ? group$h(concat$h(["(", indent$c(concat$h([softline$9, join$a(concat$h([ifBreak$7("", ", "), softline$9]), path.call(argsPath => printSequence(argsPath, options, print), "arguments"))])), softline$9, ")"])) : ""]); + } + + case "NamedType": + { + return path.call(print, "name"); + } + + case "VariableDefinition": + { + return concat$h([path.call(print, "variable"), ": ", path.call(print, "type"), n.defaultValue ? concat$h([" = ", path.call(print, "defaultValue")]) : "", printDirectives(path, print, n)]); + } + + case "ObjectTypeExtension": + case "ObjectTypeDefinition": + { + return concat$h([path.call(print, "description"), n.description ? hardline$c : "", n.kind === "ObjectTypeExtension" ? "extend " : "", "type ", path.call(print, "name"), n.interfaces.length > 0 ? concat$h([" implements ", concat$h(printInterfaces(path, options, print))]) : "", printDirectives(path, print, n), n.fields.length > 0 ? concat$h([" {", indent$c(concat$h([hardline$c, join$a(hardline$c, path.call(fieldsPath => printSequence(fieldsPath, options, print), "fields"))])), hardline$c, "}"]) : ""]); + } + + case "FieldDefinition": + { + return concat$h([path.call(print, "description"), n.description ? hardline$c : "", path.call(print, "name"), n.arguments.length > 0 ? group$h(concat$h(["(", indent$c(concat$h([softline$9, join$a(concat$h([ifBreak$7("", ", "), softline$9]), path.call(argsPath => printSequence(argsPath, options, print), "arguments"))])), softline$9, ")"])) : "", ": ", path.call(print, "type"), printDirectives(path, print, n)]); + } + + case "DirectiveDefinition": + { + return concat$h([path.call(print, "description"), n.description ? hardline$c : "", "directive ", "@", path.call(print, "name"), n.arguments.length > 0 ? group$h(concat$h(["(", indent$c(concat$h([softline$9, join$a(concat$h([ifBreak$7("", ", "), softline$9]), path.call(argsPath => printSequence(argsPath, options, print), "arguments"))])), softline$9, ")"])) : "", n.repeatable ? " repeatable" : "", concat$h([" on ", join$a(" | ", path.map(print, "locations"))])]); + } + + case "EnumTypeExtension": + case "EnumTypeDefinition": + { + return concat$h([path.call(print, "description"), n.description ? hardline$c : "", n.kind === "EnumTypeExtension" ? "extend " : "", "enum ", path.call(print, "name"), printDirectives(path, print, n), n.values.length > 0 ? concat$h([" {", indent$c(concat$h([hardline$c, join$a(hardline$c, path.call(valuesPath => printSequence(valuesPath, options, print), "values"))])), hardline$c, "}"]) : ""]); + } + + case "EnumValueDefinition": + { + return concat$h([path.call(print, "description"), n.description ? hardline$c : "", path.call(print, "name"), printDirectives(path, print, n)]); + } + + case "InputValueDefinition": + { + return concat$h([path.call(print, "description"), n.description ? n.description.block ? hardline$c : line$b : "", path.call(print, "name"), ": ", path.call(print, "type"), n.defaultValue ? concat$h([" = ", path.call(print, "defaultValue")]) : "", printDirectives(path, print, n)]); + } + + case "InputObjectTypeExtension": + case "InputObjectTypeDefinition": + { + return concat$h([path.call(print, "description"), n.description ? hardline$c : "", n.kind === "InputObjectTypeExtension" ? "extend " : "", "input ", path.call(print, "name"), printDirectives(path, print, n), n.fields.length > 0 ? concat$h([" {", indent$c(concat$h([hardline$c, join$a(hardline$c, path.call(fieldsPath => printSequence(fieldsPath, options, print), "fields"))])), hardline$c, "}"]) : ""]); + } + + case "SchemaDefinition": + { + return concat$h(["schema", printDirectives(path, print, n), " {", n.operationTypes.length > 0 ? indent$c(concat$h([hardline$c, join$a(hardline$c, path.call(opsPath => printSequence(opsPath, options, print), "operationTypes"))])) : "", hardline$c, "}"]); + } + + case "OperationTypeDefinition": + { + return concat$h([path.call(print, "operation"), ": ", path.call(print, "type")]); + } + + case "InterfaceTypeExtension": + case "InterfaceTypeDefinition": + { + return concat$h([path.call(print, "description"), n.description ? hardline$c : "", n.kind === "InterfaceTypeExtension" ? "extend " : "", "interface ", path.call(print, "name"), n.interfaces.length > 0 ? concat$h([" implements ", concat$h(printInterfaces(path, options, print))]) : "", printDirectives(path, print, n), n.fields.length > 0 ? concat$h([" {", indent$c(concat$h([hardline$c, join$a(hardline$c, path.call(fieldsPath => printSequence(fieldsPath, options, print), "fields"))])), hardline$c, "}"]) : ""]); + } + + case "FragmentSpread": + { + return concat$h(["...", path.call(print, "name"), printDirectives(path, print, n)]); + } + + case "InlineFragment": + { + return concat$h(["...", n.typeCondition ? concat$h([" on ", path.call(print, "typeCondition")]) : "", printDirectives(path, print, n), " ", path.call(print, "selectionSet")]); + } + + case "UnionTypeExtension": + case "UnionTypeDefinition": + { + return group$h(concat$h([path.call(print, "description"), n.description ? hardline$c : "", group$h(concat$h([n.kind === "UnionTypeExtension" ? "extend " : "", "union ", path.call(print, "name"), printDirectives(path, print, n), n.types.length > 0 ? concat$h([" =", ifBreak$7("", " "), indent$c(concat$h([ifBreak$7(concat$h([line$b, " "])), join$a(concat$h([line$b, "| "]), path.map(print, "types"))]))]) : ""]))])); + } + + case "ScalarTypeExtension": + case "ScalarTypeDefinition": + { + return concat$h([path.call(print, "description"), n.description ? hardline$c : "", n.kind === "ScalarTypeExtension" ? "extend " : "", "scalar ", path.call(print, "name"), printDirectives(path, print, n)]); + } + + case "NonNullType": + { + return concat$h([path.call(print, "type"), "!"]); + } + + case "ListType": + { + return concat$h(["[", path.call(print, "type"), "]"]); + } + + default: + /* istanbul ignore next */ + throw new Error("unknown graphql type: " + JSON.stringify(n.kind)); + } +} + +function printDirectives(path, print, n) { + if (n.directives.length === 0) { + return ""; + } + + return group$h(concat$h([line$b, join$a(line$b, path.map(print, "directives"))])); +} + +function printSequence(sequencePath, options, print) { + const count = sequencePath.getValue().length; + return sequencePath.map((path, i) => { + const printed = print(path); + + if (isNextLineEmpty$6(options.originalText, path.getValue(), options.locEnd) && i < count - 1) { + return concat$h([printed, hardline$c]); + } + + return printed; + }); +} + +function canAttachComment$1(node) { + return node.kind && node.kind !== "Comment"; +} + +function printComment$2(commentPath) { + const comment = commentPath.getValue(); + + if (comment.kind === "Comment") { + return "#" + comment.value.trimEnd(); + } + /* istanbul ignore next */ + + + throw new Error("Not a comment: " + JSON.stringify(comment)); +} + +function printInterfaces(path, options, print) { + const node = path.getNode(); + const parts = []; + const { + interfaces + } = node; + const printed = path.map(node => print(node), "interfaces"); + + for (let index = 0; index < interfaces.length; index++) { + const interfaceNode = interfaces[index]; + parts.push(printed[index]); + const nextInterfaceNode = interfaces[index + 1]; + + if (nextInterfaceNode) { + const textBetween = options.originalText.slice(interfaceNode.loc.end, nextInterfaceNode.loc.start); + const hasComment = textBetween.includes("#"); + const separator = textBetween.replace(/#.*/g, "").trim(); + parts.push(separator === "," ? "," : " &"); + parts.push(hasComment ? line$b : " "); + } + } + + return parts; +} + +function clean$4(node, newNode +/*, parent*/ +) { + delete newNode.loc; + delete newNode.comments; +} + +var printerGraphql = { + print: genericPrint$3, + massageAstNode: clean$4, + hasPrettierIgnore: hasIgnoreComment$4, + insertPragma: insertPragma$5, + printComment: printComment$2, + canAttachComment: canAttachComment$1 +}; + +var options$4 = { + bracketSpacing: commonOptions.bracketSpacing +}; + +var name$e = "GraphQL"; +var type$c = "data"; +var extensions$c = [ + ".graphql", + ".gql", + ".graphqls" +]; +var tmScope$c = "source.graphql"; +var aceMode$c = "text"; +var languageId$c = 139; +var GraphQL = { + name: name$e, + type: type$c, + extensions: extensions$c, + tmScope: tmScope$c, + aceMode: aceMode$c, + languageId: languageId$c +}; + +var GraphQL$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$e, + type: type$c, + extensions: extensions$c, + tmScope: tmScope$c, + aceMode: aceMode$c, + languageId: languageId$c, + 'default': GraphQL +}); + +var require$$0$5 = getCjsExportFromNamespace(GraphQL$1); + +const languages$3 = [createLanguage(require$$0$5, () => ({ + since: "1.5.0", + parsers: ["graphql"], + vscodeLanguageIds: ["graphql"] +}))]; +const printers$3 = { + graphql: printerGraphql +}; +const parsers$3 = { + get graphql() { + return require("./parser-graphql").parsers.graphql; + } + +}; +var languageGraphql = { + languages: languages$3, + options: options$4, + printers: printers$3, + parsers: parsers$3 +}; + +var json = { + "cjkPattern": "(?:[\\u02ea-\\u02eb\\u1100-\\u11ff\\u2e80-\\u2e99\\u2e9b-\\u2ef3\\u2f00-\\u2fd5\\u3000-\\u303f\\u3041-\\u3096\\u3099-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u3190-\\u3191\\u3196-\\u31ba\\u31c0-\\u31e3\\u31f0-\\u321e\\u322a-\\u3247\\u3260-\\u327e\\u328a-\\u32b0\\u32c0-\\u32cb\\u32d0-\\u3370\\u337b-\\u337f\\u33e0-\\u33fe\\u3400-\\u4db5\\u4e00-\\u9fef\\ua960-\\ua97c\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufe10-\\ufe1f\\ufe30-\\ufe6f\\uff00-\\uffef]|[\\ud840-\\ud868\\ud86a-\\ud86c\\ud86f-\\ud872\\ud874-\\ud879][\\udc00-\\udfff]|\\ud82c[\\udc00-\\udd1e\\udd50-\\udd52\\udd64-\\udd67]|\\ud83c[\\ude00\\ude50-\\ude51]|\\ud869[\\udc00-\\uded6\\udf00-\\udfff]|\\ud86d[\\udc00-\\udf34\\udf40-\\udfff]|\\ud86e[\\udc00-\\udc1d\\udc20-\\udfff]|\\ud873[\\udc00-\\udea1\\udeb0-\\udfff]|\\ud87a[\\udc00-\\udfe0]|\\ud87e[\\udc00-\\ude1d])(?:[\\ufe00-\\ufe0f]|\\udb40[\\udd00-\\uddef])?", + "kPattern": "[\\u1100-\\u11ff\\u3001-\\u3003\\u3008-\\u3011\\u3013-\\u301f\\u302e-\\u3030\\u3037\\u30fb\\u3131-\\u318e\\u3200-\\u321e\\u3260-\\u327e\\ua960-\\ua97c\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\ufe45-\\ufe46\\uff61-\\uff65\\uffa0-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc]", + "punctuationPattern": "[\\u0021-\\u002f\\u003a-\\u0040\\u005b-\\u0060\\u007b-\\u007e\\u00a1\\u00a7\\u00ab\\u00b6-\\u00b7\\u00bb\\u00bf\\u037e\\u0387\\u055a-\\u055f\\u0589-\\u058a\\u05be\\u05c0\\u05c3\\u05c6\\u05f3-\\u05f4\\u0609-\\u060a\\u060c-\\u060d\\u061b\\u061e-\\u061f\\u066a-\\u066d\\u06d4\\u0700-\\u070d\\u07f7-\\u07f9\\u0830-\\u083e\\u085e\\u0964-\\u0965\\u0970\\u09fd\\u0a76\\u0af0\\u0c77\\u0c84\\u0df4\\u0e4f\\u0e5a-\\u0e5b\\u0f04-\\u0f12\\u0f14\\u0f3a-\\u0f3d\\u0f85\\u0fd0-\\u0fd4\\u0fd9-\\u0fda\\u104a-\\u104f\\u10fb\\u1360-\\u1368\\u1400\\u166e\\u169b-\\u169c\\u16eb-\\u16ed\\u1735-\\u1736\\u17d4-\\u17d6\\u17d8-\\u17da\\u1800-\\u180a\\u1944-\\u1945\\u1a1e-\\u1a1f\\u1aa0-\\u1aa6\\u1aa8-\\u1aad\\u1b5a-\\u1b60\\u1bfc-\\u1bff\\u1c3b-\\u1c3f\\u1c7e-\\u1c7f\\u1cc0-\\u1cc7\\u1cd3\\u2010-\\u2027\\u2030-\\u2043\\u2045-\\u2051\\u2053-\\u205e\\u207d-\\u207e\\u208d-\\u208e\\u2308-\\u230b\\u2329-\\u232a\\u2768-\\u2775\\u27c5-\\u27c6\\u27e6-\\u27ef\\u2983-\\u2998\\u29d8-\\u29db\\u29fc-\\u29fd\\u2cf9-\\u2cfc\\u2cfe-\\u2cff\\u2d70\\u2e00-\\u2e2e\\u2e30-\\u2e4f\\u3001-\\u3003\\u3008-\\u3011\\u3014-\\u301f\\u3030\\u303d\\u30a0\\u30fb\\ua4fe-\\ua4ff\\ua60d-\\ua60f\\ua673\\ua67e\\ua6f2-\\ua6f7\\ua874-\\ua877\\ua8ce-\\ua8cf\\ua8f8-\\ua8fa\\ua8fc\\ua92e-\\ua92f\\ua95f\\ua9c1-\\ua9cd\\ua9de-\\ua9df\\uaa5c-\\uaa5f\\uaade-\\uaadf\\uaaf0-\\uaaf1\\uabeb\\ufd3e-\\ufd3f\\ufe10-\\ufe19\\ufe30-\\ufe52\\ufe54-\\ufe61\\ufe63\\ufe68\\ufe6a-\\ufe6b\\uff01-\\uff03\\uff05-\\uff0a\\uff0c-\\uff0f\\uff1a-\\uff1b\\uff1f-\\uff20\\uff3b-\\uff3d\\uff3f\\uff5b\\uff5d\\uff5f-\\uff65]|\\ud800[\\udd00-\\udd02\\udf9f\\udfd0]|\\ud801[\\udd6f]|\\ud802[\\udc57\\udd1f\\udd3f\\ude50-\\ude58\\ude7f\\udef0-\\udef6\\udf39-\\udf3f\\udf99-\\udf9c]|\\ud803[\\udf55-\\udf59]|\\ud804[\\udc47-\\udc4d\\udcbb-\\udcbc\\udcbe-\\udcc1\\udd40-\\udd43\\udd74-\\udd75\\uddc5-\\uddc8\\uddcd\\udddb\\udddd-\\udddf\\ude38-\\ude3d\\udea9]|\\ud805[\\udc4b-\\udc4f\\udc5b\\udc5d\\udcc6\\uddc1-\\uddd7\\ude41-\\ude43\\ude60-\\ude6c\\udf3c-\\udf3e]|\\ud806[\\udc3b\\udde2\\ude3f-\\ude46\\ude9a-\\ude9c\\ude9e-\\udea2]|\\ud807[\\udc41-\\udc45\\udc70-\\udc71\\udef7-\\udef8\\udfff]|\\ud809[\\udc70-\\udc74]|\\ud81a[\\ude6e-\\ude6f\\udef5\\udf37-\\udf3b\\udf44]|\\ud81b[\\ude97-\\ude9a\\udfe2]|\\ud82f[\\udc9f]|\\ud836[\\ude87-\\ude8b]|\\ud83a[\\udd5e-\\udd5f]" +}; + +const { + getLast: getLast$6 +} = util; +const { + cjkPattern, + kPattern, + punctuationPattern +} = json; +const INLINE_NODE_TYPES = ["liquidNode", "inlineCode", "emphasis", "strong", "delete", "link", "linkReference", "image", "imageReference", "footnote", "footnoteReference", "sentence", "whitespace", "word", "break", "inlineMath"]; +const INLINE_NODE_WRAPPER_TYPES = INLINE_NODE_TYPES.concat(["tableCell", "paragraph", "heading"]); +const kRegex = new RegExp(kPattern); +const punctuationRegex = new RegExp(punctuationPattern); +/** + * split text into whitespaces and words + * @param {string} text + * @return {Array<{ type: "whitespace", value: " " | "\n" | "" } | { type: "word", value: string }>} + */ + +function splitText(text, options) { + const KIND_NON_CJK = "non-cjk"; + const KIND_CJ_LETTER = "cj-letter"; + const KIND_K_LETTER = "k-letter"; + const KIND_CJK_PUNCTUATION = "cjk-punctuation"; + const nodes = []; + (options.proseWrap === "preserve" ? text : text.replace(new RegExp(`(${cjkPattern})\n(${cjkPattern})`, "g"), "$1$2")).split(/([\t\n ]+)/).forEach((token, index, tokens) => { + // whitespace + if (index % 2 === 1) { + nodes.push({ + type: "whitespace", + value: /\n/.test(token) ? "\n" : " " + }); + return; + } // word separated by whitespace + + + if ((index === 0 || index === tokens.length - 1) && token === "") { + return; + } + + token.split(new RegExp(`(${cjkPattern})`)).forEach((innerToken, innerIndex, innerTokens) => { + if ((innerIndex === 0 || innerIndex === innerTokens.length - 1) && innerToken === "") { + return; + } // non-CJK word + + + if (innerIndex % 2 === 0) { + if (innerToken !== "") { + appendNode({ + type: "word", + value: innerToken, + kind: KIND_NON_CJK, + hasLeadingPunctuation: punctuationRegex.test(innerToken[0]), + hasTrailingPunctuation: punctuationRegex.test(getLast$6(innerToken)) + }); + } + + return; + } // CJK character + + + appendNode(punctuationRegex.test(innerToken) ? { + type: "word", + value: innerToken, + kind: KIND_CJK_PUNCTUATION, + hasLeadingPunctuation: true, + hasTrailingPunctuation: true + } : { + type: "word", + value: innerToken, + kind: kRegex.test(innerToken) ? KIND_K_LETTER : KIND_CJ_LETTER, + hasLeadingPunctuation: false, + hasTrailingPunctuation: false + }); + }); + }); + return nodes; + + function appendNode(node) { + const lastNode = getLast$6(nodes); + + if (lastNode && lastNode.type === "word") { + if (lastNode.kind === KIND_NON_CJK && node.kind === KIND_CJ_LETTER && !lastNode.hasTrailingPunctuation || lastNode.kind === KIND_CJ_LETTER && node.kind === KIND_NON_CJK && !node.hasLeadingPunctuation) { + nodes.push({ + type: "whitespace", + value: " " + }); + } else if (!isBetween(KIND_NON_CJK, KIND_CJK_PUNCTUATION) && // disallow leading/trailing full-width whitespace + ![lastNode.value, node.value].some(value => /\u3000/.test(value))) { + nodes.push({ + type: "whitespace", + value: "" + }); + } + } + + nodes.push(node); + + function isBetween(kind1, kind2) { + return lastNode.kind === kind1 && node.kind === kind2 || lastNode.kind === kind2 && node.kind === kind1; + } + } +} + +function getOrderedListItemInfo(orderListItem, originalText) { + const [, numberText, marker, leadingSpaces] = originalText.slice(orderListItem.position.start.offset, orderListItem.position.end.offset).match(/^\s*(\d+)(\.|\))(\s*)/); + return { + numberText, + marker, + leadingSpaces + }; +} + +function hasGitDiffFriendlyOrderedList(node, options) { + if (!node.ordered) { + return false; + } + + if (node.children.length < 2) { + return false; + } + + const firstNumber = Number(getOrderedListItemInfo(node.children[0], options.originalText).numberText); + const secondNumber = Number(getOrderedListItemInfo(node.children[1], options.originalText).numberText); + + if (firstNumber === 0 && node.children.length > 2) { + const thirdNumber = Number(getOrderedListItemInfo(node.children[2], options.originalText).numberText); + return secondNumber === 1 && thirdNumber === 1; + } + + return secondNumber === 1; +} // workaround for https://github.com/remarkjs/remark/issues/351 +// leading and trailing newlines are stripped by remark + + +function getFencedCodeBlockValue(node, originalText) { + const text = originalText.trimEnd().slice(node.position.start.offset, node.position.end.offset); + const leadingSpaceCount = text.match(/^\s*/)[0].length; + const replaceRegex = new RegExp(`^\\s{0,${leadingSpaceCount}}`); + const lineContents = text.split("\n"); + const markerStyle = text[leadingSpaceCount]; // ` or ~ + + const marker = text.slice(leadingSpaceCount).match(new RegExp(`^[${markerStyle}]+`))[0]; // https://spec.commonmark.org/0.28/#example-104: Closing fences may be indented by 0-3 spaces + // https://spec.commonmark.org/0.28/#example-93: The closing code fence must be at least as long as the opening fence + + const hasEndMarker = new RegExp(`^\\s{0,3}${marker}`).test(lineContents[lineContents.length - 1].slice(getIndent(lineContents.length - 1))); + return lineContents.slice(1, hasEndMarker ? -1 : undefined).map((x, i) => x.slice(getIndent(i + 1)).replace(replaceRegex, "")).join("\n"); + + function getIndent(lineIndex) { + return node.position.indent[lineIndex - 1] - 1; + } +} + +function mapAst(ast, handler) { + return function preorder(node, index, parentStack) { + parentStack = parentStack || []; + const newNode = Object.assign({}, handler(node, index, parentStack)); + + if (newNode.children) { + newNode.children = newNode.children.map((child, index) => { + return preorder(child, index, [newNode].concat(parentStack)); + }); + } + + return newNode; + }(ast, null, null); +} + +function isAutolink(node, options) { + if (!node || node.type !== "link" || node.children.length !== 1) { + return false; + } + + const child = node.children[0]; + return child && options.locStart(node) === options.locStart(child) && options.locEnd(node) === options.locEnd(child); +} + +var utils$9 = { + mapAst, + splitText, + punctuationPattern, + getFencedCodeBlockValue, + getOrderedListItemInfo, + hasGitDiffFriendlyOrderedList, + INLINE_NODE_TYPES, + INLINE_NODE_WRAPPER_TYPES, + isAutolink +}; + +const { + getParserName: getParserName$1, + getMaxContinuousCount: getMaxContinuousCount$2 +} = util; +const { + builders: { + hardline: hardline$d, + literalline: literalline$3, + concat: concat$i, + markAsRoot: markAsRoot$2 + }, + utils: { + mapDoc: mapDoc$2 + } +} = document; +const { + print: printFrontMatter$1 +} = frontMatter; +const { + getFencedCodeBlockValue: getFencedCodeBlockValue$1 +} = utils$9; + +function embed$2(path, print, textToDoc, options) { + const node = path.getValue(); + + if (node.type === "code" && node.lang !== null) { + // only look for the first string so as to support [markdown-preview-enhanced](https://shd101wyy.github.io/markdown-preview-enhanced/#/code-chunk) + const langMatch = node.lang.match(/^[\w-]+/); + const lang = langMatch ? langMatch[0] : ""; + const parser = getParserName$1(lang, options); + + if (parser) { + const styleUnit = options.__inJsTemplate ? "~" : "`"; + const style = styleUnit.repeat(Math.max(3, getMaxContinuousCount$2(node.value, styleUnit) + 1)); + const doc = textToDoc(getFencedCodeBlockValue$1(node, options.originalText), { + parser + }, { + stripTrailingHardline: true + }); + return markAsRoot$2(concat$i([style, node.lang, node.meta ? " " + node.meta : "", hardline$d, replaceNewlinesWithLiterallines(doc), hardline$d, style])); + } + } + + switch (node.type) { + case "front-matter": + return printFrontMatter$1(node, textToDoc); + // MDX + + case "importExport": + return concat$i([textToDoc(node.value, { + parser: "babel" + }, { + stripTrailingHardline: true + }), hardline$d]); + + case "jsx": + return textToDoc(`<$>${node.value}`, { + parser: "__js_expression", + rootMarker: "mdx" + }, { + stripTrailingHardline: true + }); + } + + return null; + + function replaceNewlinesWithLiterallines(doc) { + return mapDoc$2(doc, currentDoc => typeof currentDoc === "string" && currentDoc.includes("\n") ? concat$i(currentDoc.split(/(\n)/g).map((v, i) => i % 2 === 0 ? v : literalline$3)) : currentDoc); + } +} + +var embed_1$2 = embed$2; + +const { + parse: parseFrontMatter$1 +} = frontMatter; +const pragmas = ["format", "prettier"]; + +function startWithPragma(text) { + const pragma = `@(${pragmas.join("|")})`; + const regex = new RegExp([``, ``].join("|"), "m"); + const matched = text.match(regex); + return matched && matched.index === 0; +} + +var pragma$3 = { + startWithPragma, + hasPragma: text => startWithPragma(parseFrontMatter$1(text).content.trimStart()), + insertPragma: text => { + const extracted = parseFrontMatter$1(text); + const pragma = ``; + return extracted.frontMatter ? `${extracted.frontMatter.raw}\n\n${pragma}\n\n${extracted.content}` : `${pragma}\n\n${extracted.content}`; + } +}; + +const { + getOrderedListItemInfo: getOrderedListItemInfo$1, + mapAst: mapAst$1, + splitText: splitText$1 +} = utils$9; // 0x0 ~ 0x10ffff +// eslint-disable-next-line no-control-regex + +const isSingleCharRegex = /^([\u0000-\uffff]|[\ud800-\udbff][\udc00-\udfff])$/; + +function preprocess$1(ast, options) { + ast = restoreUnescapedCharacter(ast, options); + ast = mergeContinuousTexts(ast); + ast = transformInlineCode(ast); + ast = transformIndentedCodeblockAndMarkItsParentList(ast, options); + ast = markAlignedList(ast, options); + ast = splitTextIntoSentences(ast, options); + ast = transformImportExport(ast); + ast = mergeContinuousImportExport(ast); + return ast; +} + +function transformImportExport(ast) { + return mapAst$1(ast, node => { + if (node.type !== "import" && node.type !== "export") { + return node; + } + + return Object.assign({}, node, { + type: "importExport" + }); + }); +} + +function transformInlineCode(ast) { + return mapAst$1(ast, node => { + if (node.type !== "inlineCode") { + return node; + } + + return Object.assign({}, node, { + value: node.value.replace(/\s+/g, " ") + }); + }); +} + +function restoreUnescapedCharacter(ast, options) { + return mapAst$1(ast, node => { + return node.type !== "text" ? node : Object.assign({}, node, { + value: node.value !== "*" && node.value !== "_" && node.value !== "$" && // handle these cases in printer + isSingleCharRegex.test(node.value) && node.position.end.offset - node.position.start.offset !== node.value.length ? options.originalText.slice(node.position.start.offset, node.position.end.offset) : node.value + }); + }); +} + +function mergeContinuousImportExport(ast) { + return mergeChildren(ast, (prevNode, node) => prevNode.type === "importExport" && node.type === "importExport", (prevNode, node) => ({ + type: "importExport", + value: prevNode.value + "\n\n" + node.value, + position: { + start: prevNode.position.start, + end: node.position.end + } + })); +} + +function mergeChildren(ast, shouldMerge, mergeNode) { + return mapAst$1(ast, node => { + if (!node.children) { + return node; + } + + const children = node.children.reduce((current, child) => { + const lastChild = current[current.length - 1]; + + if (lastChild && shouldMerge(lastChild, child)) { + current.splice(-1, 1, mergeNode(lastChild, child)); + } else { + current.push(child); + } + + return current; + }, []); + return Object.assign({}, node, { + children + }); + }); +} + +function mergeContinuousTexts(ast) { + return mergeChildren(ast, (prevNode, node) => prevNode.type === "text" && node.type === "text", (prevNode, node) => ({ + type: "text", + value: prevNode.value + node.value, + position: { + start: prevNode.position.start, + end: node.position.end + } + })); +} + +function splitTextIntoSentences(ast, options) { + return mapAst$1(ast, (node, index, [parentNode]) => { + if (node.type !== "text") { + return node; + } + + let { + value + } = node; + + if (parentNode.type === "paragraph") { + if (index === 0) { + value = value.trimStart(); + } + + if (index === parentNode.children.length - 1) { + value = value.trimEnd(); + } + } + + return { + type: "sentence", + position: node.position, + children: splitText$1(value, options) + }; + }); +} + +function transformIndentedCodeblockAndMarkItsParentList(ast, options) { + return mapAst$1(ast, (node, index, parentStack) => { + if (node.type === "code") { + // the first char may point to `\n`, e.g. `\n\t\tbar`, just ignore it + const isIndented = /^\n?( {4,}|\t)/.test(options.originalText.slice(node.position.start.offset, node.position.end.offset)); + node.isIndented = isIndented; + + if (isIndented) { + for (let i = 0; i < parentStack.length; i++) { + const parent = parentStack[i]; // no need to check checked items + + if (parent.hasIndentedCodeblock) { + break; + } + + if (parent.type === "list") { + parent.hasIndentedCodeblock = true; + } + } + } + } + + return node; + }); +} + +function markAlignedList(ast, options) { + return mapAst$1(ast, (node, index, parentStack) => { + if (node.type === "list" && node.children.length !== 0) { + // if one of its parents is not aligned, it's not possible to be aligned in sub-lists + for (let i = 0; i < parentStack.length; i++) { + const parent = parentStack[i]; + + if (parent.type === "list" && !parent.isAligned) { + node.isAligned = false; + return node; + } + } + + node.isAligned = isAligned(node); + } + + return node; + }); + + function getListItemStart(listItem) { + return listItem.children.length === 0 ? -1 : listItem.children[0].position.start.column - 1; + } + + function isAligned(list) { + if (!list.ordered) { + /** + * - 123 + * - 123 + */ + return true; + } + + const [firstItem, secondItem] = list.children; + const firstInfo = getOrderedListItemInfo$1(firstItem, options.originalText); + + if (firstInfo.leadingSpaces.length > 1) { + /** + * 1. 123 + * + * 1. 123 + * 1. 123 + */ + return true; + } + + const firstStart = getListItemStart(firstItem); + + if (firstStart === -1) { + /** + * 1. + * + * 1. + * 1. + */ + return false; + } + + if (list.children.length === 1) { + /** + * aligned: + * + * 11. 123 + * + * not aligned: + * + * 1. 123 + */ + return firstStart % options.tabWidth === 0; + } + + const secondStart = getListItemStart(secondItem); + + if (firstStart !== secondStart) { + /** + * 11. 123 + * 1. 123 + * + * 1. 123 + * 11. 123 + */ + return false; + } + + if (firstStart % options.tabWidth === 0) { + /** + * 11. 123 + * 12. 123 + */ + return true; + } + /** + * aligned: + * + * 11. 123 + * 1. 123 + * + * not aligned: + * + * 1. 123 + * 2. 123 + */ + + + const secondInfo = getOrderedListItemInfo$1(secondItem, options.originalText); + return secondInfo.leadingSpaces.length > 1; + } +} + +var preprocess_1$1 = preprocess$1; + +const { + getLast: getLast$7, + getMinNotPresentContinuousCount: getMinNotPresentContinuousCount$1, + getMaxContinuousCount: getMaxContinuousCount$3, + getStringWidth: getStringWidth$4 +} = util; +const { + builders: { + breakParent: breakParent$6, + concat: concat$j, + join: join$b, + line: line$c, + literalline: literalline$4, + markAsRoot: markAsRoot$3, + hardline: hardline$e, + softline: softline$a, + ifBreak: ifBreak$8, + fill: fill$5, + align: align$3, + indent: indent$d, + group: group$i + }, + utils: { + normalizeDoc: normalizeDoc$1 + }, + printer: { + printDocToString: printDocToString$3 + } +} = document; +const { + replaceEndOfLineWith: replaceEndOfLineWith$1, + isFrontMatterNode: isFrontMatterNode$3 +} = util; +const { + getFencedCodeBlockValue: getFencedCodeBlockValue$2, + hasGitDiffFriendlyOrderedList: hasGitDiffFriendlyOrderedList$1, + splitText: splitText$2, + punctuationPattern: punctuationPattern$1, + INLINE_NODE_TYPES: INLINE_NODE_TYPES$1, + INLINE_NODE_WRAPPER_TYPES: INLINE_NODE_WRAPPER_TYPES$1, + isAutolink: isAutolink$1 +} = utils$9; +const TRAILING_HARDLINE_NODES = new Set(["importExport"]); +const SINGLE_LINE_NODE_TYPES = ["heading", "tableCell", "link"]; +const SIBLING_NODE_TYPES = new Set(["listItem", "definition", "footnoteDefinition"]); + +function genericPrint$4(path, options, print) { + const node = path.getValue(); + + if (shouldRemainTheSameContent(path)) { + return concat$j(splitText$2(options.originalText.slice(node.position.start.offset, node.position.end.offset), options).map(node => node.type === "word" ? node.value : node.value === "" ? "" : printLine(path, node.value, options))); + } + + switch (node.type) { + case "front-matter": + return options.originalText.slice(node.position.start.offset, node.position.end.offset); + + case "root": + if (node.children.length === 0) { + return ""; + } + + return concat$j([normalizeDoc$1(printRoot(path, options, print)), !TRAILING_HARDLINE_NODES.has(getLastDescendantNode(node).type) ? hardline$e : ""]); + + case "paragraph": + return printChildren$1(path, options, print, { + postprocessor: fill$5 + }); + + case "sentence": + return printChildren$1(path, options, print); + + case "word": + { + let escapedValue = node.value.replace(/[$*]/g, "\\$&") // escape all `*` and `$` (math) + .replace(new RegExp([`(^|${punctuationPattern$1})(_+)`, `(_+)(${punctuationPattern$1}|$)`].join("|"), "g"), (_, text1, underscore1, underscore2, text2) => (underscore1 ? `${text1}${underscore1}` : `${underscore2}${text2}`).replace(/_/g, "\\_")); // escape all `_` except concating with non-punctuation, e.g. `1_2_3` is not considered emphasis + + const isFirstSentence = (node, name, index) => node.type === "sentence" && index === 0; + + const isLastChildAutolink = (node, name, index) => isAutolink$1(node.children[index - 1], options); + + if (escapedValue !== node.value && (path.match(undefined, isFirstSentence, isLastChildAutolink) || path.match(undefined, isFirstSentence, (node, name, index) => node.type === "emphasis" && index === 0, isLastChildAutolink))) { + // backslash is parsed as part of autolinks, so we need to remove it + escapedValue = escapedValue.replace(/^(\\?[*_])+/, prefix => prefix.replace(/\\/g, "")); + } + + return escapedValue; + } + + case "whitespace": + { + const parentNode = path.getParentNode(); + const index = parentNode.children.indexOf(node); + const nextNode = parentNode.children[index + 1]; + const proseWrap = // leading char that may cause different syntax + nextNode && /^>|^([*+-]|#{1,6}|\d+[).])$/.test(nextNode.value) ? "never" : options.proseWrap; + return printLine(path, node.value, { + proseWrap + }); + } + + case "emphasis": + { + let style; + + if (isAutolink$1(node.children[0], options)) { + style = options.originalText[node.position.start.offset]; + } else { + const parentNode = path.getParentNode(); + const index = parentNode.children.indexOf(node); + const prevNode = parentNode.children[index - 1]; + const nextNode = parentNode.children[index + 1]; + const hasPrevOrNextWord = // `1*2*3` is considered emphasis but `1_2_3` is not + prevNode && prevNode.type === "sentence" && prevNode.children.length > 0 && getLast$7(prevNode.children).type === "word" && !getLast$7(prevNode.children).hasTrailingPunctuation || nextNode && nextNode.type === "sentence" && nextNode.children.length > 0 && nextNode.children[0].type === "word" && !nextNode.children[0].hasLeadingPunctuation; + style = hasPrevOrNextWord || getAncestorNode$2(path, "emphasis") ? "*" : "_"; + } + + return concat$j([style, printChildren$1(path, options, print), style]); + } + + case "strong": + return concat$j(["**", printChildren$1(path, options, print), "**"]); + + case "delete": + return concat$j(["~~", printChildren$1(path, options, print), "~~"]); + + case "inlineCode": + { + const backtickCount = getMinNotPresentContinuousCount$1(node.value, "`"); + const style = "`".repeat(backtickCount || 1); + const gap = backtickCount && !/^\s/.test(node.value) ? " " : ""; + return concat$j([style, gap, node.value, gap, style]); + } + + case "link": + switch (options.originalText[node.position.start.offset]) { + case "<": + { + const mailto = "mailto:"; + const url = // is parsed as { url: "mailto:hello@example.com" } + node.url.startsWith(mailto) && options.originalText.slice(node.position.start.offset + 1, node.position.start.offset + 1 + mailto.length) !== mailto ? node.url.slice(mailto.length) : node.url; + return concat$j(["<", url, ">"]); + } + + case "[": + return concat$j(["[", printChildren$1(path, options, print), "](", printUrl(node.url, ")"), printTitle(node.title, options), ")"]); + + default: + return options.originalText.slice(node.position.start.offset, node.position.end.offset); + } + + case "image": + return concat$j(["![", node.alt || "", "](", printUrl(node.url, ")"), printTitle(node.title, options), ")"]); + + case "blockquote": + return concat$j(["> ", align$3("> ", printChildren$1(path, options, print))]); + + case "heading": + return concat$j(["#".repeat(node.depth) + " ", printChildren$1(path, options, print)]); + + case "code": + { + if (node.isIndented) { + // indented code block + const alignment = " ".repeat(4); + return align$3(alignment, concat$j([alignment, concat$j(replaceEndOfLineWith$1(node.value, hardline$e))])); + } // fenced code block + + + const styleUnit = options.__inJsTemplate ? "~" : "`"; + const style = styleUnit.repeat(Math.max(3, getMaxContinuousCount$3(node.value, styleUnit) + 1)); + return concat$j([style, node.lang || "", node.meta ? " " + node.meta : "", hardline$e, concat$j(replaceEndOfLineWith$1(getFencedCodeBlockValue$2(node, options.originalText), hardline$e)), hardline$e, style]); + } + + case "html": + { + const parentNode = path.getParentNode(); + const value = parentNode.type === "root" && getLast$7(parentNode.children) === node ? node.value.trimEnd() : node.value; + const isHtmlComment = /^$/.test(value); + return concat$j(replaceEndOfLineWith$1(value, isHtmlComment ? hardline$e : markAsRoot$3(literalline$4))); + } + + case "list": + { + const nthSiblingIndex = getNthListSiblingIndex(node, path.getParentNode()); + const isGitDiffFriendlyOrderedList = hasGitDiffFriendlyOrderedList$1(node, options); + return printChildren$1(path, options, print, { + processor: (childPath, index) => { + const prefix = getPrefix(); + const childNode = childPath.getValue(); + + if (childNode.children.length === 2 && childNode.children[1].type === "html" && childNode.children[0].position.start.column !== childNode.children[1].position.start.column) { + return concat$j([prefix, printListItem(childPath, options, print, prefix)]); + } + + return concat$j([prefix, align$3(" ".repeat(prefix.length), printListItem(childPath, options, print, prefix))]); + + function getPrefix() { + const rawPrefix = node.ordered ? (index === 0 ? node.start : isGitDiffFriendlyOrderedList ? 1 : node.start + index) + (nthSiblingIndex % 2 === 0 ? ". " : ") ") : nthSiblingIndex % 2 === 0 ? "- " : "* "; + return node.isAligned || + /* workaround for https://github.com/remarkjs/remark/issues/315 */ + node.hasIndentedCodeblock ? alignListPrefix(rawPrefix, options) : rawPrefix; + } + } + }); + } + + case "thematicBreak": + { + const counter = getAncestorCounter$1(path, "list"); + + if (counter === -1) { + return "---"; + } + + const nthSiblingIndex = getNthListSiblingIndex(path.getParentNode(counter), path.getParentNode(counter + 1)); + return nthSiblingIndex % 2 === 0 ? "***" : "---"; + } + + case "linkReference": + return concat$j(["[", printChildren$1(path, options, print), "]", node.referenceType === "full" ? concat$j(["[", node.identifier, "]"]) : node.referenceType === "collapsed" ? "[]" : ""]); + + case "imageReference": + switch (node.referenceType) { + case "full": + return concat$j(["![", node.alt || "", "][", node.identifier, "]"]); + + default: + return concat$j(["![", node.alt, "]", node.referenceType === "collapsed" ? "[]" : ""]); + } + + case "definition": + { + const lineOrSpace = options.proseWrap === "always" ? line$c : " "; + return group$i(concat$j([concat$j(["[", node.identifier, "]:"]), indent$d(concat$j([lineOrSpace, printUrl(node.url), node.title === null ? "" : concat$j([lineOrSpace, printTitle(node.title, options, false)])]))])); + } + // `footnote` requires `.use(footnotes, {inlineNotes: true})`, we are not using this option + // https://github.com/remarkjs/remark-footnotes#optionsinlinenotes + + /* istanbul ignore next */ + + case "footnote": + return concat$j(["[^", printChildren$1(path, options, print), "]"]); + + case "footnoteReference": + return concat$j(["[^", node.identifier, "]"]); + + case "footnoteDefinition": + { + const nextNode = path.getParentNode().children[path.getName() + 1]; + const shouldInlineFootnote = node.children.length === 1 && node.children[0].type === "paragraph" && (options.proseWrap === "never" || options.proseWrap === "preserve" && node.children[0].position.start.line === node.children[0].position.end.line); + return concat$j(["[^", node.identifier, "]: ", shouldInlineFootnote ? printChildren$1(path, options, print) : group$i(concat$j([align$3(" ".repeat(4), printChildren$1(path, options, print, { + processor: (childPath, index) => { + return index === 0 ? group$i(concat$j([softline$a, childPath.call(print)])) : childPath.call(print); + } + })), nextNode && nextNode.type === "footnoteDefinition" ? softline$a : ""]))]); + } + + case "table": + return printTable(path, options, print); + + case "tableCell": + return printChildren$1(path, options, print); + + case "break": + return /\s/.test(options.originalText[node.position.start.offset]) ? concat$j([" ", markAsRoot$3(literalline$4)]) : concat$j(["\\", hardline$e]); + + case "liquidNode": + return concat$j(replaceEndOfLineWith$1(node.value, hardline$e)); + // MDX + + case "importExport": + case "jsx": + // fallback to the original text if multiparser failed + // or `embeddedLanguageFormatting: "off"` + return concat$j([node.value, hardline$e]); + + case "math": + return concat$j(["$$", hardline$e, node.value ? concat$j([concat$j(replaceEndOfLineWith$1(node.value, hardline$e)), hardline$e]) : "", "$$"]); + + case "inlineMath": + { + // remark-math trims content but we don't want to remove whitespaces + // since it's very possible that it's recognized as math accidentally + return options.originalText.slice(options.locStart(node), options.locEnd(node)); + } + + case "tableRow": // handled in "table" + + case "listItem": // handled in "list" + + default: + /* istanbul ignore next */ + throw new Error(`Unknown markdown type ${JSON.stringify(node.type)}`); + } +} + +function printListItem(path, options, print, listPrefix) { + const node = path.getValue(); + const prefix = node.checked === null ? "" : node.checked ? "[x] " : "[ ] "; + return concat$j([prefix, printChildren$1(path, options, print, { + processor: (childPath, index) => { + if (index === 0 && childPath.getValue().type !== "list") { + return align$3(" ".repeat(prefix.length), childPath.call(print)); + } + + const alignment = " ".repeat(clamp(options.tabWidth - listPrefix.length, 0, 3) // 4+ will cause indented code block + ); + return concat$j([alignment, align$3(alignment, childPath.call(print))]); + } + })]); +} + +function alignListPrefix(prefix, options) { + const additionalSpaces = getAdditionalSpaces(); + return prefix + " ".repeat(additionalSpaces >= 4 ? 0 : additionalSpaces // 4+ will cause indented code block + ); + + function getAdditionalSpaces() { + const restSpaces = prefix.length % options.tabWidth; + return restSpaces === 0 ? 0 : options.tabWidth - restSpaces; + } +} + +function getNthListSiblingIndex(node, parentNode) { + return getNthSiblingIndex(node, parentNode, siblingNode => siblingNode.ordered === node.ordered); +} + +function getNthSiblingIndex(node, parentNode, condition) { + condition = condition || (() => true); + + let index = -1; + + for (const childNode of parentNode.children) { + if (childNode.type === node.type && condition(childNode)) { + index++; + } else { + index = -1; + } + + if (childNode === node) { + return index; + } + } +} + +function getAncestorCounter$1(path, typeOrTypes) { + const types = [].concat(typeOrTypes); + let counter = -1; + let ancestorNode; + + while (ancestorNode = path.getParentNode(++counter)) { + if (types.includes(ancestorNode.type)) { + return counter; + } + } + + return -1; +} + +function getAncestorNode$2(path, typeOrTypes) { + const counter = getAncestorCounter$1(path, typeOrTypes); + return counter === -1 ? null : path.getParentNode(counter); +} + +function printLine(path, value, options) { + if (options.proseWrap === "preserve" && value === "\n") { + return hardline$e; + } + + const isBreakable = options.proseWrap === "always" && !getAncestorNode$2(path, SINGLE_LINE_NODE_TYPES); + return value !== "" ? isBreakable ? line$c : " " : isBreakable ? softline$a : ""; +} + +function printTable(path, options, print) { + const hardlineWithoutBreakParent = hardline$e.parts[0]; + const node = path.getValue(); + const contents = []; // { [rowIndex: number]: { [columnIndex: number]: string } } + + path.map(rowPath => { + const rowContents = []; + rowPath.map(cellPath => { + rowContents.push(printDocToString$3(cellPath.call(print), options).formatted); + }, "children"); + contents.push(rowContents); + }, "children"); // Get the width of each column + + const columnMaxWidths = contents.reduce((currentWidths, rowContents) => currentWidths.map((width, columnIndex) => Math.max(width, getStringWidth$4(rowContents[columnIndex]))), contents[0].map(() => 3) // minimum width = 3 (---, :--, :-:, --:) + ); + const alignedTable = join$b(hardlineWithoutBreakParent, [printRow(contents[0]), printSeparator(), join$b(hardlineWithoutBreakParent, contents.slice(1).map(rowContents => printRow(rowContents)))]); + + if (options.proseWrap !== "never") { + return concat$j([breakParent$6, alignedTable]); + } // Only if the --prose-wrap never is set and it exceeds the print width. + + + const compactTable = join$b(hardlineWithoutBreakParent, [printRow(contents[0], + /* isCompact */ + true), printSeparator( + /* isCompact */ + true), join$b(hardlineWithoutBreakParent, contents.slice(1).map(rowContents => printRow(rowContents, + /* isCompact */ + true)))]); + return concat$j([breakParent$6, group$i(ifBreak$8(compactTable, alignedTable))]); + + function printSeparator(isCompact) { + return concat$j(["| ", join$b(" | ", columnMaxWidths.map((width, index) => { + const spaces = isCompact ? 3 : width; + + switch (node.align[index]) { + case "left": + return ":" + "-".repeat(spaces - 1); + + case "right": + return "-".repeat(spaces - 1) + ":"; + + case "center": + return ":" + "-".repeat(spaces - 2) + ":"; + + default: + return "-".repeat(spaces); + } + })), " |"]); + } + + function printRow(rowContents, isCompact) { + return concat$j(["| ", join$b(" | ", isCompact ? rowContents : rowContents.map((rowContent, columnIndex) => { + switch (node.align[columnIndex]) { + case "right": + return alignRight(rowContent, columnMaxWidths[columnIndex]); + + case "center": + return alignCenter(rowContent, columnMaxWidths[columnIndex]); + + default: + return alignLeft(rowContent, columnMaxWidths[columnIndex]); + } + })), " |"]); + } + + function alignLeft(text, width) { + const spaces = width - getStringWidth$4(text); + return concat$j([text, " ".repeat(spaces)]); + } + + function alignRight(text, width) { + const spaces = width - getStringWidth$4(text); + return concat$j([" ".repeat(spaces), text]); + } + + function alignCenter(text, width) { + const spaces = width - getStringWidth$4(text); + const left = Math.floor(spaces / 2); + const right = spaces - left; + return concat$j([" ".repeat(left), text, " ".repeat(right)]); + } +} + +function printRoot(path, options, print) { + /** @typedef {{ index: number, offset: number }} IgnorePosition */ + + /** @type {Array<{start: IgnorePosition, end: IgnorePosition}>} */ + const ignoreRanges = []; + /** @type {IgnorePosition | null} */ + + let ignoreStart = null; + const { + children + } = path.getValue(); + children.forEach((childNode, index) => { + switch (isPrettierIgnore(childNode)) { + case "start": + if (ignoreStart === null) { + ignoreStart = { + index, + offset: childNode.position.end.offset + }; + } + + break; + + case "end": + if (ignoreStart !== null) { + ignoreRanges.push({ + start: ignoreStart, + end: { + index, + offset: childNode.position.start.offset + } + }); + ignoreStart = null; + } + + break; + } + }); + return printChildren$1(path, options, print, { + processor: (childPath, index) => { + if (ignoreRanges.length !== 0) { + const ignoreRange = ignoreRanges[0]; + + if (index === ignoreRange.start.index) { + return concat$j([children[ignoreRange.start.index].value, options.originalText.slice(ignoreRange.start.offset, ignoreRange.end.offset), children[ignoreRange.end.index].value]); + } + + if (ignoreRange.start.index < index && index < ignoreRange.end.index) { + return false; + } + + if (index === ignoreRange.end.index) { + ignoreRanges.shift(); + return false; + } + } + + return childPath.call(print); + } + }); +} + +function printChildren$1(path, options, print, events) { + events = events || {}; + const postprocessor = events.postprocessor || concat$j; + + const processor = events.processor || (childPath => childPath.call(print)); + + const node = path.getValue(); + const parts = []; + let lastChildNode; + path.map((childPath, index) => { + const childNode = childPath.getValue(); + const result = processor(childPath, index); + + if (result !== false) { + const data = { + parts, + prevNode: lastChildNode, + parentNode: node, + options + }; + + if (!shouldNotPrePrintHardline(childNode, data)) { + parts.push(hardline$e); // Can't find a case to pass `shouldPrePrintTripleHardline` + + /* istanbul ignore next */ + + if (lastChildNode && TRAILING_HARDLINE_NODES.has(lastChildNode.type)) { + if (shouldPrePrintTripleHardline(childNode, data)) { + parts.push(hardline$e); + } + } else { + if (shouldPrePrintDoubleHardline(childNode, data) || shouldPrePrintTripleHardline(childNode, data)) { + parts.push(hardline$e); + } + + if (shouldPrePrintTripleHardline(childNode, data)) { + parts.push(hardline$e); + } + } + } + + parts.push(result); + lastChildNode = childNode; + } + }, "children"); + return postprocessor(parts); +} + +function getLastDescendantNode(node) { + let current = node; + + while (current.children && current.children.length !== 0) { + current = current.children[current.children.length - 1]; + } + + return current; +} +/** @return {false | 'next' | 'start' | 'end'} */ + + +function isPrettierIgnore(node) { + if (node.type !== "html") { + return false; + } + + const match = node.value.match(/^$/); + return match === null ? false : match[1] ? match[1] : "next"; +} + +function shouldNotPrePrintHardline(node, data) { + const isFirstNode = data.parts.length === 0; + const isInlineNode = INLINE_NODE_TYPES$1.includes(node.type); + const isInlineHTML = node.type === "html" && INLINE_NODE_WRAPPER_TYPES$1.includes(data.parentNode.type); + return isFirstNode || isInlineNode || isInlineHTML; +} + +function shouldPrePrintDoubleHardline(node, data) { + const isSequence = (data.prevNode && data.prevNode.type) === node.type; + const isSiblingNode = isSequence && SIBLING_NODE_TYPES.has(node.type); + const isInTightListItem = data.parentNode.type === "listItem" && !data.parentNode.loose; + const isPrevNodeLooseListItem = data.prevNode && data.prevNode.type === "listItem" && data.prevNode.loose; + const isPrevNodePrettierIgnore = isPrettierIgnore(data.prevNode) === "next"; + const isBlockHtmlWithoutBlankLineBetweenPrevHtml = node.type === "html" && data.prevNode && data.prevNode.type === "html" && data.prevNode.position.end.line + 1 === node.position.start.line; + const isHtmlDirectAfterListItem = node.type === "html" && data.parentNode.type === "listItem" && data.prevNode && data.prevNode.type === "paragraph" && data.prevNode.position.end.line + 1 === node.position.start.line; + return isPrevNodeLooseListItem || !(isSiblingNode || isInTightListItem || isPrevNodePrettierIgnore || isBlockHtmlWithoutBlankLineBetweenPrevHtml || isHtmlDirectAfterListItem); +} + +function shouldPrePrintTripleHardline(node, data) { + const isPrevNodeList = data.prevNode && data.prevNode.type === "list"; + const isIndentedCode = node.type === "code" && node.isIndented; + return isPrevNodeList && isIndentedCode; +} + +function shouldRemainTheSameContent(path) { + const ancestorNode = getAncestorNode$2(path, ["linkReference", "imageReference"]); + return ancestorNode && (ancestorNode.type !== "linkReference" || ancestorNode.referenceType !== "full"); +} + +function printUrl(url, dangerousCharOrChars) { + const dangerousChars = [" "].concat(dangerousCharOrChars || []); + return new RegExp(dangerousChars.map(x => `\\${x}`).join("|")).test(url) ? `<${url}>` : url; +} + +function printTitle(title, options, printSpace) { + if (printSpace == null) { + printSpace = true; + } + + if (!title) { + return ""; + } + + if (printSpace) { + return " " + printTitle(title, options, false); + } // title is escaped after `remark-parse` v7 + + + title = title.replace(/\\(["')])/g, "$1"); + + if (title.includes('"') && title.includes("'") && !title.includes(")")) { + return `(${title})`; // avoid escaped quotes + } // faster than using RegExps: https://jsperf.com/performance-of-match-vs-split + + + const singleCount = title.split("'").length - 1; + const doubleCount = title.split('"').length - 1; + const quote = singleCount > doubleCount ? '"' : doubleCount > singleCount ? "'" : options.singleQuote ? "'" : '"'; + title = title.replace(/\\/, "\\\\"); + title = title.replace(new RegExp(`(${quote})`, "g"), "\\$1"); + return `${quote}${title}${quote}`; +} + +function clamp(value, min, max) { + return value < min ? min : value > max ? max : value; +} + +function clean$5(ast, newObj, parent) { + delete newObj.position; + delete newObj.raw; // front-matter + // for codeblock + + if (ast.type === "front-matter" || ast.type === "code" || ast.type === "yaml" || ast.type === "import" || ast.type === "export" || ast.type === "jsx") { + delete newObj.value; + } + + if (ast.type === "list") { + delete newObj.isAligned; + } + + if (ast.type === "list" || ast.type === "listItem") { + delete newObj.spread; + delete newObj.loose; + } // texts can be splitted or merged + + + if (ast.type === "text") { + return null; + } + + if (ast.type === "inlineCode") { + newObj.value = ast.value.replace(/[\t\n ]+/g, " "); + } + + if (ast.type === "definition" || ast.type === "linkReference") { + newObj.label = ast.label.trim().replace(/[\t\n ]+/g, " ").toLowerCase(); + } + + if ((ast.type === "definition" || ast.type === "link" || ast.type === "image") && ast.title) { + newObj.title = ast.title.replace(/\\(["')])/g, "$1"); + } // for insert pragma + + + if (parent && parent.type === "root" && parent.children.length > 0 && (parent.children[0] === ast || isFrontMatterNode$3(parent.children[0]) && parent.children[1] === ast) && ast.type === "html" && pragma$3.startWithPragma(ast.value)) { + return null; + } +} + +function hasPrettierIgnore$4(path) { + const index = +path.getName(); + + if (index === 0) { + return false; + } + + const prevNode = path.getParentNode().children[index - 1]; + return isPrettierIgnore(prevNode) === "next"; +} + +var printerMarkdown = { + preprocess: preprocess_1$1, + print: genericPrint$4, + embed: embed_1$2, + massageAstNode: clean$5, + hasPrettierIgnore: hasPrettierIgnore$4, + insertPragma: pragma$3.insertPragma +}; + +var options$5 = { + proseWrap: commonOptions.proseWrap, + singleQuote: commonOptions.singleQuote +}; + +var name$f = "Markdown"; +var type$d = "prose"; +var aliases$4 = [ + "pandoc" +]; +var aceMode$d = "markdown"; +var codemirrorMode$a = "gfm"; +var codemirrorMimeType$a = "text/x-gfm"; +var wrap = true; +var extensions$d = [ + ".md", + ".markdown", + ".mdown", + ".mdwn", + ".mdx", + ".mkd", + ".mkdn", + ".mkdown", + ".ronn", + ".workbook" +]; +var filenames$3 = [ + "contents.lr" +]; +var tmScope$d = "source.gfm"; +var languageId$d = 222; +var Markdown = { + name: name$f, + type: type$d, + aliases: aliases$4, + aceMode: aceMode$d, + codemirrorMode: codemirrorMode$a, + codemirrorMimeType: codemirrorMimeType$a, + wrap: wrap, + extensions: extensions$d, + filenames: filenames$3, + tmScope: tmScope$d, + languageId: languageId$d +}; + +var Markdown$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + name: name$f, + type: type$d, + aliases: aliases$4, + aceMode: aceMode$d, + codemirrorMode: codemirrorMode$a, + codemirrorMimeType: codemirrorMimeType$a, + wrap: wrap, + extensions: extensions$d, + filenames: filenames$3, + tmScope: tmScope$d, + languageId: languageId$d, + 'default': Markdown +}); + +var require$$0$6 = getCjsExportFromNamespace(Markdown$1); + +const languages$4 = [createLanguage(require$$0$6, data => ({ + since: "1.8.0", + parsers: ["markdown"], + vscodeLanguageIds: ["markdown"], + filenames: data.filenames.concat(["README"]), + extensions: data.extensions.filter(extension => extension !== ".mdx") +})), createLanguage(require$$0$6, () => ({ + name: "MDX", + since: "1.15.0", + parsers: ["mdx"], + vscodeLanguageIds: ["mdx"], + filenames: [], + extensions: [".mdx"] +}))]; +const printers$4 = { + mdast: printerMarkdown +}; +const parsers$4 = { + /* istanbul ignore next */ + get remark() { + return require("./parser-markdown").parsers.remark; + }, + + get markdown() { + return require("./parser-markdown").parsers.remark; + }, + + get mdx() { + return require("./parser-markdown").parsers.mdx; + } + +}; +var languageMarkdown = { + languages: languages$4, + options: options$5, + printers: printers$4, + parsers: parsers$4 +}; + +const { + isFrontMatterNode: isFrontMatterNode$4 +} = util; + +var clean$6 = function (ast, newNode) { + delete newNode.sourceSpan; + delete newNode.startSourceSpan; + delete newNode.endSourceSpan; + delete newNode.nameSpan; + delete newNode.valueSpan; + + if (ast.type === "text" || ast.type === "comment") { + return null; + } // may be formatted by multiparser + + + if (isFrontMatterNode$4(ast) || ast.type === "yaml" || ast.type === "toml") { + return null; + } + + if (ast.type === "attribute") { + delete newNode.value; + } + + if (ast.type === "docType") { + delete newNode.value; + } +}; + +var index$1 = [ + "a", + "abbr", + "acronym", + "address", + "applet", + "area", + "article", + "aside", + "audio", + "b", + "base", + "basefont", + "bdi", + "bdo", + "bgsound", + "big", + "blink", + "blockquote", + "body", + "br", + "button", + "canvas", + "caption", + "center", + "cite", + "code", + "col", + "colgroup", + "command", + "content", + "data", + "datalist", + "dd", + "del", + "details", + "dfn", + "dialog", + "dir", + "div", + "dl", + "dt", + "element", + "em", + "embed", + "fieldset", + "figcaption", + "figure", + "font", + "footer", + "form", + "frame", + "frameset", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "head", + "header", + "hgroup", + "hr", + "html", + "i", + "iframe", + "image", + "img", + "input", + "ins", + "isindex", + "kbd", + "keygen", + "label", + "legend", + "li", + "link", + "listing", + "main", + "map", + "mark", + "marquee", + "math", + "menu", + "menuitem", + "meta", + "meter", + "multicol", + "nav", + "nextid", + "nobr", + "noembed", + "noframes", + "noscript", + "object", + "ol", + "optgroup", + "option", + "output", + "p", + "param", + "picture", + "plaintext", + "pre", + "progress", + "q", + "rb", + "rbc", + "rp", + "rt", + "rtc", + "ruby", + "s", + "samp", + "script", + "section", + "select", + "shadow", + "slot", + "small", + "source", + "spacer", + "span", + "strike", + "strong", + "style", + "sub", + "summary", + "sup", + "svg", + "table", + "tbody", + "td", + "template", + "textarea", + "tfoot", + "th", + "thead", + "time", + "title", + "tr", + "track", + "tt", + "u", + "ul", + "var", + "video", + "wbr", + "xmp" +]; + +var htmlTagNames = /*#__PURE__*/Object.freeze({ + __proto__: null, + 'default': index$1 +}); + +var a = [ + "accesskey", + "charset", + "coords", + "download", + "href", + "hreflang", + "name", + "ping", + "referrerpolicy", + "rel", + "rev", + "shape", + "tabindex", + "target", + "type" +]; +var abbr = [ + "title" +]; +var applet = [ + "align", + "alt", + "archive", + "code", + "codebase", + "height", + "hspace", + "name", + "object", + "vspace", + "width" +]; +var area = [ + "accesskey", + "alt", + "coords", + "download", + "href", + "hreflang", + "nohref", + "ping", + "referrerpolicy", + "rel", + "shape", + "tabindex", + "target", + "type" +]; +var audio = [ + "autoplay", + "controls", + "crossorigin", + "loop", + "muted", + "preload", + "src" +]; +var base = [ + "href", + "target" +]; +var basefont = [ + "color", + "face", + "size" +]; +var bdo = [ + "dir" +]; +var blockquote = [ + "cite" +]; +var body = [ + "alink", + "background", + "bgcolor", + "link", + "text", + "vlink" +]; +var br = [ + "clear" +]; +var button = [ + "accesskey", + "autofocus", + "disabled", + "form", + "formaction", + "formenctype", + "formmethod", + "formnovalidate", + "formtarget", + "name", + "tabindex", + "type", + "value" +]; +var canvas = [ + "height", + "width" +]; +var caption = [ + "align" +]; +var col = [ + "align", + "char", + "charoff", + "span", + "valign", + "width" +]; +var colgroup = [ + "align", + "char", + "charoff", + "span", + "valign", + "width" +]; +var data$1 = [ + "value" +]; +var del$1 = [ + "cite", + "datetime" +]; +var details = [ + "open" +]; +var dfn = [ + "title" +]; +var dialog = [ + "open" +]; +var dir = [ + "compact" +]; +var div = [ + "align" +]; +var dl = [ + "compact" +]; +var embed$3 = [ + "height", + "src", + "type", + "width" +]; +var fieldset = [ + "disabled", + "form", + "name" +]; +var font = [ + "color", + "face", + "size" +]; +var form = [ + "accept", + "accept-charset", + "action", + "autocomplete", + "enctype", + "method", + "name", + "novalidate", + "target" +]; +var frame = [ + "frameborder", + "longdesc", + "marginheight", + "marginwidth", + "name", + "noresize", + "scrolling", + "src" +]; +var frameset = [ + "cols", + "rows" +]; +var h1 = [ + "align" +]; +var h2 = [ + "align" +]; +var h3 = [ + "align" +]; +var h4 = [ + "align" +]; +var h5 = [ + "align" +]; +var h6 = [ + "align" +]; +var head = [ + "profile" +]; +var hr = [ + "align", + "noshade", + "size", + "width" +]; +var html = [ + "manifest", + "version" +]; +var iframe = [ + "align", + "allow", + "allowfullscreen", + "allowpaymentrequest", + "allowusermedia", + "frameborder", + "height", + "longdesc", + "marginheight", + "marginwidth", + "name", + "referrerpolicy", + "sandbox", + "scrolling", + "src", + "srcdoc", + "width" +]; +var img = [ + "align", + "alt", + "border", + "crossorigin", + "decoding", + "height", + "hspace", + "ismap", + "longdesc", + "name", + "referrerpolicy", + "sizes", + "src", + "srcset", + "usemap", + "vspace", + "width" +]; +var input = [ + "accept", + "accesskey", + "align", + "alt", + "autocomplete", + "autofocus", + "checked", + "dirname", + "disabled", + "form", + "formaction", + "formenctype", + "formmethod", + "formnovalidate", + "formtarget", + "height", + "ismap", + "list", + "max", + "maxlength", + "min", + "minlength", + "multiple", + "name", + "pattern", + "placeholder", + "readonly", + "required", + "size", + "src", + "step", + "tabindex", + "title", + "type", + "usemap", + "value", + "width" +]; +var ins = [ + "cite", + "datetime" +]; +var isindex = [ + "prompt" +]; +var label = [ + "accesskey", + "for", + "form" +]; +var legend = [ + "accesskey", + "align" +]; +var li = [ + "type", + "value" +]; +var link$3 = [ + "as", + "charset", + "color", + "crossorigin", + "href", + "hreflang", + "imagesizes", + "imagesrcset", + "integrity", + "media", + "nonce", + "referrerpolicy", + "rel", + "rev", + "sizes", + "target", + "title", + "type" +]; +var map$1 = [ + "name" +]; +var menu = [ + "compact" +]; +var meta = [ + "charset", + "content", + "http-equiv", + "name", + "scheme" +]; +var meter = [ + "high", + "low", + "max", + "min", + "optimum", + "value" +]; +var object = [ + "align", + "archive", + "border", + "classid", + "codebase", + "codetype", + "data", + "declare", + "form", + "height", + "hspace", + "name", + "standby", + "tabindex", + "type", + "typemustmatch", + "usemap", + "vspace", + "width" +]; +var ol = [ + "compact", + "reversed", + "start", + "type" +]; +var optgroup = [ + "disabled", + "label" +]; +var option = [ + "disabled", + "label", + "selected", + "value" +]; +var output = [ + "for", + "form", + "name" +]; +var p = [ + "align" +]; +var param = [ + "name", + "type", + "value", + "valuetype" +]; +var pre = [ + "width" +]; +var progress = [ + "max", + "value" +]; +var q = [ + "cite" +]; +var script = [ + "async", + "charset", + "crossorigin", + "defer", + "integrity", + "language", + "nomodule", + "nonce", + "referrerpolicy", + "src", + "type" +]; +var select = [ + "autocomplete", + "autofocus", + "disabled", + "form", + "multiple", + "name", + "required", + "size", + "tabindex" +]; +var slot = [ + "name" +]; +var source$2 = [ + "media", + "sizes", + "src", + "srcset", + "type" +]; +var style = [ + "media", + "nonce", + "title", + "type" +]; +var table = [ + "align", + "bgcolor", + "border", + "cellpadding", + "cellspacing", + "frame", + "rules", + "summary", + "width" +]; +var tbody = [ + "align", + "char", + "charoff", + "valign" +]; +var td = [ + "abbr", + "align", + "axis", + "bgcolor", + "char", + "charoff", + "colspan", + "headers", + "height", + "nowrap", + "rowspan", + "scope", + "valign", + "width" +]; +var textarea = [ + "accesskey", + "autocomplete", + "autofocus", + "cols", + "dirname", + "disabled", + "form", + "maxlength", + "minlength", + "name", + "placeholder", + "readonly", + "required", + "rows", + "tabindex", + "wrap" +]; +var tfoot = [ + "align", + "char", + "charoff", + "valign" +]; +var th = [ + "abbr", + "align", + "axis", + "bgcolor", + "char", + "charoff", + "colspan", + "headers", + "height", + "nowrap", + "rowspan", + "scope", + "valign", + "width" +]; +var thead = [ + "align", + "char", + "charoff", + "valign" +]; +var time = [ + "datetime" +]; +var tr = [ + "align", + "bgcolor", + "char", + "charoff", + "valign" +]; +var track = [ + "default", + "kind", + "label", + "src", + "srclang" +]; +var ul = [ + "compact", + "type" +]; +var video = [ + "autoplay", + "controls", + "crossorigin", + "height", + "loop", + "muted", + "playsinline", + "poster", + "preload", + "src", + "width" +]; +var index$2 = { + "*": [ + "accesskey", + "autocapitalize", + "autofocus", + "class", + "contenteditable", + "dir", + "draggable", + "enterkeyhint", + "hidden", + "id", + "inputmode", + "is", + "itemid", + "itemprop", + "itemref", + "itemscope", + "itemtype", + "lang", + "nonce", + "slot", + "spellcheck", + "style", + "tabindex", + "title", + "translate" +], + a: a, + abbr: abbr, + applet: applet, + area: area, + audio: audio, + base: base, + basefont: basefont, + bdo: bdo, + blockquote: blockquote, + body: body, + br: br, + button: button, + canvas: canvas, + caption: caption, + col: col, + colgroup: colgroup, + data: data$1, + del: del$1, + details: details, + dfn: dfn, + dialog: dialog, + dir: dir, + div: div, + dl: dl, + embed: embed$3, + fieldset: fieldset, + font: font, + form: form, + frame: frame, + frameset: frameset, + h1: h1, + h2: h2, + h3: h3, + h4: h4, + h5: h5, + h6: h6, + head: head, + hr: hr, + html: html, + iframe: iframe, + img: img, + input: input, + ins: ins, + isindex: isindex, + label: label, + legend: legend, + li: li, + link: link$3, + map: map$1, + menu: menu, + meta: meta, + meter: meter, + object: object, + ol: ol, + optgroup: optgroup, + option: option, + output: output, + p: p, + param: param, + pre: pre, + progress: progress, + q: q, + script: script, + select: select, + slot: slot, + source: source$2, + style: style, + table: table, + tbody: tbody, + td: td, + textarea: textarea, + tfoot: tfoot, + th: th, + thead: thead, + time: time, + tr: tr, + track: track, + ul: ul, + video: video +}; + +var htmlElementAttributes = /*#__PURE__*/Object.freeze({ + __proto__: null, + a: a, + abbr: abbr, + applet: applet, + area: area, + audio: audio, + base: base, + basefont: basefont, + bdo: bdo, + blockquote: blockquote, + body: body, + br: br, + button: button, + canvas: canvas, + caption: caption, + col: col, + colgroup: colgroup, + data: data$1, + del: del$1, + details: details, + dfn: dfn, + dialog: dialog, + dir: dir, + div: div, + dl: dl, + embed: embed$3, + fieldset: fieldset, + font: font, + form: form, + frame: frame, + frameset: frameset, + h1: h1, + h2: h2, + h3: h3, + h4: h4, + h5: h5, + h6: h6, + head: head, + hr: hr, + html: html, + iframe: iframe, + img: img, + input: input, + ins: ins, + isindex: isindex, + label: label, + legend: legend, + li: li, + link: link$3, + map: map$1, + menu: menu, + meta: meta, + meter: meter, + object: object, + ol: ol, + optgroup: optgroup, + option: option, + output: output, + p: p, + param: param, + pre: pre, + progress: progress, + q: q, + script: script, + select: select, + slot: slot, + source: source$2, + style: style, + table: table, + tbody: tbody, + td: td, + textarea: textarea, + tfoot: tfoot, + th: th, + thead: thead, + time: time, + tr: tr, + track: track, + ul: ul, + video: video, + 'default': index$2 +}); + +var json$1 = { + "CSS_DISPLAY_TAGS": { + "area": "none", + "base": "none", + "basefont": "none", + "datalist": "none", + "head": "none", + "link": "none", + "meta": "none", + "noembed": "none", + "noframes": "none", + "param": "block", + "rp": "none", + "script": "block", + "source": "block", + "style": "none", + "template": "inline", + "track": "block", + "title": "none", + "html": "block", + "body": "block", + "address": "block", + "blockquote": "block", + "center": "block", + "div": "block", + "figure": "block", + "figcaption": "block", + "footer": "block", + "form": "block", + "header": "block", + "hr": "block", + "legend": "block", + "listing": "block", + "main": "block", + "p": "block", + "plaintext": "block", + "pre": "block", + "xmp": "block", + "slot": "contents", + "ruby": "ruby", + "rt": "ruby-text", + "article": "block", + "aside": "block", + "h1": "block", + "h2": "block", + "h3": "block", + "h4": "block", + "h5": "block", + "h6": "block", + "hgroup": "block", + "nav": "block", + "section": "block", + "dir": "block", + "dd": "block", + "dl": "block", + "dt": "block", + "ol": "block", + "ul": "block", + "li": "list-item", + "table": "table", + "caption": "table-caption", + "colgroup": "table-column-group", + "col": "table-column", + "thead": "table-header-group", + "tbody": "table-row-group", + "tfoot": "table-footer-group", + "tr": "table-row", + "td": "table-cell", + "th": "table-cell", + "fieldset": "block", + "button": "inline-block", + "details": "block", + "summary": "block", + "dialog": "block", + "meter": "inline-block", + "progress": "inline-block", + "object": "inline-block", + "video": "inline-block", + "audio": "inline-block", + "select": "inline-block", + "option": "block", + "optgroup": "block" + }, + "CSS_DISPLAY_DEFAULT": "inline", + "CSS_WHITE_SPACE_TAGS": { + "listing": "pre", + "plaintext": "pre", + "pre": "pre", + "xmp": "pre", + "nobr": "nowrap", + "table": "initial", + "textarea": "pre-wrap" + }, + "CSS_WHITE_SPACE_DEFAULT": "normal" +}; + +var htmlTagNames$1 = getCjsExportFromNamespace(htmlTagNames); + +var htmlElementAttributes$1 = getCjsExportFromNamespace(htmlElementAttributes); + +const { + getParserName: getParserName$2, + isFrontMatterNode: isFrontMatterNode$5 +} = util; +const { + CSS_DISPLAY_TAGS, + CSS_DISPLAY_DEFAULT, + CSS_WHITE_SPACE_TAGS, + CSS_WHITE_SPACE_DEFAULT +} = json$1; +const HTML_TAGS = arrayToMap(htmlTagNames$1); +const HTML_ELEMENT_ATTRIBUTES = mapObject(htmlElementAttributes$1, arrayToMap); // https://infra.spec.whatwg.org/#ascii-whitespace + +const HTML_WHITESPACE = new Set(["\t", "\n", "\f", "\r", " "]); + +const htmlTrimStart = string => string.replace(/^[\t\n\f\r ]+/, ""); + +const htmlTrimEnd = string => string.replace(/[\t\n\f\r ]+$/, ""); + +const htmlTrim = string => htmlTrimStart(htmlTrimEnd(string)); + +const htmlTrimLeadingBlankLines = string => string.replace(/^[\t\f\r ]*?\n/g, ""); + +const htmlTrimPreserveIndentation = string => htmlTrimLeadingBlankLines(htmlTrimEnd(string)); + +const splitByHtmlWhitespace = string => string.split(/[\t\n\f\r ]+/); + +const getLeadingHtmlWhitespace = string => string.match(/^[\t\n\f\r ]*/)[0]; + +const getLeadingAndTrailingHtmlWhitespace = string => { + const [, leadingWhitespace, text, trailingWhitespace] = string.match(/^([\t\n\f\r ]*)([\S\s]*?)([\t\n\f\r ]*)$/); + return { + leadingWhitespace, + trailingWhitespace, + text + }; +}; + +const hasHtmlWhitespace = string => /[\t\n\f\r ]/.test(string); + +function arrayToMap(array) { + const map = Object.create(null); + + for (const value of array) { + map[value] = true; + } + + return map; +} + +function mapObject(object, fn) { + const newObject = Object.create(null); + + for (const key of Object.keys(object)) { + newObject[key] = fn(object[key], key); + } + + return newObject; +} + +function shouldPreserveContent(node, options) { + // unterminated node in ie conditional comment + // e.g. + if (node.type === "ieConditionalComment" && node.lastChild && !node.lastChild.isSelfClosing && !node.lastChild.endSourceSpan) { + return true; + } // incomplete html in ie conditional comment + // e.g. + + + if (node.type === "ieConditionalComment" && !node.complete) { + return true; + } // TODO: handle non-text children in
+
+
+  if (isPreLikeNode(node) && node.children.some(child => child.type !== "text" && child.type !== "interpolation")) {
+    return true;
+  }
+
+  if (isVueNonHtmlBlock(node, options) && !isScriptLikeTag(node) && node.type !== "interpolation") {
+    return true;
+  }
+
+  return false;
+}
+
+function hasPrettierIgnore$5(node) {
+  /* istanbul ignore next */
+  if (node.type === "attribute") {
+    return false;
+  }
+  /* istanbul ignore next */
+
+
+  if (!node.parent) {
+    return false;
+  }
+
+  if (typeof node.index !== "number" || node.index === 0) {
+    return false;
+  }
+
+  const prevNode = node.parent.children[node.index - 1];
+  return isPrettierIgnore$1(prevNode);
+}
+
+function isPrettierIgnore$1(node) {
+  return node.type === "comment" && node.value.trim() === "prettier-ignore";
+}
+
+function getPrettierIgnoreAttributeCommentData(value) {
+  const match = value.trim().match(/^prettier-ignore-attribute(?:\s+([^]+))?$/);
+
+  if (!match) {
+    return false;
+  }
+
+  if (!match[1]) {
+    return true;
+  }
+
+  return match[1].split(/\s+/);
+}
+/** there's no opening/closing tag or it's considered not breakable */
+
+
+function isTextLikeNode(node) {
+  return node.type === "text" || node.type === "comment";
+}
+
+function isScriptLikeTag(node) {
+  return node.type === "element" && (node.fullName === "script" || node.fullName === "style" || node.fullName === "svg:style" || isUnknownNamespace(node) && (node.name === "script" || node.name === "style"));
+}
+
+function canHaveInterpolation(node) {
+  return node.children && !isScriptLikeTag(node);
+}
+
+function isWhitespaceSensitiveNode(node) {
+  return isScriptLikeTag(node) || node.type === "interpolation" || isIndentationSensitiveNode(node);
+}
+
+function isIndentationSensitiveNode(node) {
+  return getNodeCssStyleWhiteSpace(node).startsWith("pre");
+}
+
+function isLeadingSpaceSensitiveNode(node, options) {
+  const isLeadingSpaceSensitive = _isLeadingSpaceSensitiveNode();
+
+  if (isLeadingSpaceSensitive && !node.prev && node.parent && node.parent.tagDefinition && node.parent.tagDefinition.ignoreFirstLf) {
+    return node.type === "interpolation";
+  }
+
+  return isLeadingSpaceSensitive;
+
+  function _isLeadingSpaceSensitiveNode() {
+    if (isFrontMatterNode$5(node)) {
+      return false;
+    }
+
+    if ((node.type === "text" || node.type === "interpolation") && node.prev && (node.prev.type === "text" || node.prev.type === "interpolation")) {
+      return true;
+    }
+
+    if (!node.parent || node.parent.cssDisplay === "none") {
+      return false;
+    }
+
+    if (isPreLikeNode(node.parent)) {
+      return true;
+    }
+
+    if (!node.prev && (node.parent.type === "root" || isPreLikeNode(node) && node.parent || isScriptLikeTag(node.parent) || isVueCustomBlock(node.parent, options) || !isFirstChildLeadingSpaceSensitiveCssDisplay(node.parent.cssDisplay))) {
+      return false;
+    }
+
+    if (node.prev && !isNextLeadingSpaceSensitiveCssDisplay(node.prev.cssDisplay)) {
+      return false;
+    }
+
+    return true;
+  }
+}
+
+function isTrailingSpaceSensitiveNode(node, options) {
+  if (isFrontMatterNode$5(node)) {
+    return false;
+  }
+
+  if ((node.type === "text" || node.type === "interpolation") && node.next && (node.next.type === "text" || node.next.type === "interpolation")) {
+    return true;
+  }
+
+  if (!node.parent || node.parent.cssDisplay === "none") {
+    return false;
+  }
+
+  if (isPreLikeNode(node.parent)) {
+    return true;
+  }
+
+  if (!node.next && (node.parent.type === "root" || isPreLikeNode(node) && node.parent || isScriptLikeTag(node.parent) || isVueCustomBlock(node.parent, options) || !isLastChildTrailingSpaceSensitiveCssDisplay(node.parent.cssDisplay))) {
+    return false;
+  }
+
+  if (node.next && !isPrevTrailingSpaceSensitiveCssDisplay(node.next.cssDisplay)) {
+    return false;
+  }
+
+  return true;
+}
+
+function isDanglingSpaceSensitiveNode(node) {
+  return isDanglingSpaceSensitiveCssDisplay(node.cssDisplay) && !isScriptLikeTag(node);
+}
+
+function forceNextEmptyLine(node) {
+  return isFrontMatterNode$5(node) || node.next && node.sourceSpan.end && node.sourceSpan.end.line + 1 < node.next.sourceSpan.start.line;
+}
+/** firstChild leadingSpaces and lastChild trailingSpaces */
+
+
+function forceBreakContent(node) {
+  return forceBreakChildren(node) || node.type === "element" && node.children.length !== 0 && (["body", "script", "style"].includes(node.name) || node.children.some(child => hasNonTextChild(child))) || node.firstChild && node.firstChild === node.lastChild && node.firstChild.type !== "text" && hasLeadingLineBreak(node.firstChild) && (!node.lastChild.isTrailingSpaceSensitive || hasTrailingLineBreak(node.lastChild));
+}
+/** spaces between children */
+
+
+function forceBreakChildren(node) {
+  return node.type === "element" && node.children.length !== 0 && (["html", "head", "ul", "ol", "select"].includes(node.name) || node.cssDisplay.startsWith("table") && node.cssDisplay !== "table-cell");
+}
+
+function preferHardlineAsLeadingSpaces(node) {
+  return preferHardlineAsSurroundingSpaces(node) || node.prev && preferHardlineAsTrailingSpaces(node.prev) || hasSurroundingLineBreak(node);
+}
+
+function preferHardlineAsTrailingSpaces(node) {
+  return preferHardlineAsSurroundingSpaces(node) || node.type === "element" && node.fullName === "br" || hasSurroundingLineBreak(node);
+}
+
+function hasSurroundingLineBreak(node) {
+  return hasLeadingLineBreak(node) && hasTrailingLineBreak(node);
+}
+
+function hasLeadingLineBreak(node) {
+  return node.hasLeadingSpaces && (node.prev ? node.prev.sourceSpan.end.line < node.sourceSpan.start.line : node.parent.type === "root" || node.parent.startSourceSpan.end.line < node.sourceSpan.start.line);
+}
+
+function hasTrailingLineBreak(node) {
+  return node.hasTrailingSpaces && (node.next ? node.next.sourceSpan.start.line > node.sourceSpan.end.line : node.parent.type === "root" || node.parent.endSourceSpan && node.parent.endSourceSpan.start.line > node.sourceSpan.end.line);
+}
+
+function preferHardlineAsSurroundingSpaces(node) {
+  switch (node.type) {
+    case "ieConditionalComment":
+    case "comment":
+    case "directive":
+      return true;
+
+    case "element":
+      return ["script", "select"].includes(node.name);
+  }
+
+  return false;
+}
+
+function getLastDescendant(node) {
+  return node.lastChild ? getLastDescendant(node.lastChild) : node;
+}
+
+function hasNonTextChild(node) {
+  return node.children && node.children.some(child => child.type !== "text");
+}
+
+function _inferScriptParser(node) {
+  const {
+    type,
+    lang
+  } = node.attrMap;
+
+  if (type === "module" || type === "text/javascript" || type === "text/babel" || type === "application/javascript" || lang === "jsx") {
+    return "babel";
+  }
+
+  if (type === "application/x-typescript" || lang === "ts" || lang === "tsx") {
+    return "typescript";
+  }
+
+  if (type === "text/markdown") {
+    return "markdown";
+  }
+
+  if (type === "text/html") {
+    return "html";
+  }
+
+  if (type && (type.endsWith("json") || type.endsWith("importmap"))) {
+    return "json";
+  }
+
+  if (type === "text/x-handlebars-template") {
+    return "glimmer";
+  }
+}
+
+function inferStyleParser(node) {
+  const {
+    lang
+  } = node.attrMap;
+
+  if (!lang || lang === "postcss" || lang === "css") {
+    return "css";
+  }
+
+  if (lang === "scss") {
+    return "scss";
+  }
+
+  if (lang === "less") {
+    return "less";
+  }
+}
+
+function inferScriptParser(node, options) {
+  if (node.name === "script" && !node.attrMap.src) {
+    if (!node.attrMap.lang && !node.attrMap.type) {
+      return "babel";
+    }
+
+    return _inferScriptParser(node);
+  }
+
+  if (node.name === "style") {
+    return inferStyleParser(node);
+  }
+
+  if (options && isVueNonHtmlBlock(node, options)) {
+    return _inferScriptParser(node) || !("src" in node.attrMap) && getParserName$2(node.attrMap.lang, options);
+  }
+}
+
+function isBlockLikeCssDisplay(cssDisplay) {
+  return cssDisplay === "block" || cssDisplay === "list-item" || cssDisplay.startsWith("table");
+}
+
+function isFirstChildLeadingSpaceSensitiveCssDisplay(cssDisplay) {
+  return !isBlockLikeCssDisplay(cssDisplay) && cssDisplay !== "inline-block";
+}
+
+function isLastChildTrailingSpaceSensitiveCssDisplay(cssDisplay) {
+  return !isBlockLikeCssDisplay(cssDisplay) && cssDisplay !== "inline-block";
+}
+
+function isPrevTrailingSpaceSensitiveCssDisplay(cssDisplay) {
+  return !isBlockLikeCssDisplay(cssDisplay);
+}
+
+function isNextLeadingSpaceSensitiveCssDisplay(cssDisplay) {
+  return !isBlockLikeCssDisplay(cssDisplay);
+}
+
+function isDanglingSpaceSensitiveCssDisplay(cssDisplay) {
+  return !isBlockLikeCssDisplay(cssDisplay) && cssDisplay !== "inline-block";
+}
+
+function isPreLikeNode(node) {
+  return getNodeCssStyleWhiteSpace(node).startsWith("pre");
+}
+
+function countParents(path, predicate) {
+  let counter = 0;
+
+  for (let i = path.stack.length - 1; i >= 0; i--) {
+    const value = path.stack[i];
+
+    if (value && typeof value === "object" && !Array.isArray(value) && predicate(value)) {
+      counter++;
+    }
+  }
+
+  return counter;
+}
+
+function hasParent(node, fn) {
+  let current = node;
+
+  while (current) {
+    if (fn(current)) {
+      return true;
+    }
+
+    current = current.parent;
+  }
+
+  return false;
+}
+
+function getNodeCssStyleDisplay(node, options) {
+  if (node.prev && node.prev.type === "comment") {
+    // 
+    const match = node.prev.value.match(/^\s*display:\s*([a-z]+)\s*$/);
+
+    if (match) {
+      return match[1];
+    }
+  }
+
+  let isInSvgForeignObject = false;
+
+  if (node.type === "element" && node.namespace === "svg") {
+    if (hasParent(node, parent => parent.fullName === "svg:foreignObject")) {
+      isInSvgForeignObject = true;
+    } else {
+      return node.name === "svg" ? "inline-block" : "block";
+    }
+  }
+
+  switch (options.htmlWhitespaceSensitivity) {
+    case "strict":
+      return "inline";
+
+    case "ignore":
+      return "block";
+
+    default:
+      {
+        // See https://github.com/prettier/prettier/issues/8151
+        if (options.parser === "vue" && node.parent && node.parent.type === "root") {
+          return "block";
+        }
+
+        return node.type === "element" && (!node.namespace || isInSvgForeignObject || isUnknownNamespace(node)) && CSS_DISPLAY_TAGS[node.name] || CSS_DISPLAY_DEFAULT;
+      }
+  }
+}
+
+function isUnknownNamespace(node) {
+  return node.type === "element" && !node.hasExplicitNamespace && !["html", "svg"].includes(node.namespace);
+}
+
+function getNodeCssStyleWhiteSpace(node) {
+  return node.type === "element" && (!node.namespace || isUnknownNamespace(node)) && CSS_WHITE_SPACE_TAGS[node.name] || CSS_WHITE_SPACE_DEFAULT;
+}
+
+function getMinIndentation(text) {
+  let minIndentation = Infinity;
+
+  for (const lineText of text.split("\n")) {
+    if (lineText.length === 0) {
+      continue;
+    }
+
+    if (!HTML_WHITESPACE.has(lineText[0])) {
+      return 0;
+    }
+
+    const indentation = getLeadingHtmlWhitespace(lineText).length;
+
+    if (lineText.length === indentation) {
+      continue;
+    }
+
+    if (indentation < minIndentation) {
+      minIndentation = indentation;
+    }
+  }
+
+  return minIndentation === Infinity ? 0 : minIndentation;
+}
+
+function dedentString(text, minIndent = getMinIndentation(text)) {
+  return minIndent === 0 ? text : text.split("\n").map(lineText => lineText.slice(minIndent)).join("\n");
+}
+
+function shouldNotPrintClosingTag(node, options) {
+  return !node.isSelfClosing && !node.endSourceSpan && (hasPrettierIgnore$5(node) || shouldPreserveContent(node.parent, options));
+}
+
+function countChars(text, char) {
+  let counter = 0;
+
+  for (let i = 0; i < text.length; i++) {
+    if (text[i] === char) {
+      counter++;
+    }
+  }
+
+  return counter;
+}
+
+function unescapeQuoteEntities(text) {
+  return text.replace(/'/g, "'").replace(/"/g, '"');
+} // top-level elements (excluding 
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+